PreviousUpNext

15.3.642  src/lib/x-kit/widget/edit/screenline.api

## screenline.api
#
# One line of textfile contents in a textpane display.

# Compiled by:
#     src/lib/x-kit/widget/xkit-widget.sublib


stipulate
    include package   threadkit;                                                # threadkit                     is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg
    include package   geometry2d;                                               # geometry2d                    is from   src/lib/std/2d/geometry2d.pkg
    #
    package gd  =  gui_displaylist;                                             # gui_displaylist               is from   src/lib/x-kit/widget/theme/gui-displaylist.pkg
    package gt  =  guiboss_types;                                               # guiboss_types                 is from   src/lib/x-kit/widget/gui/guiboss-types.pkg
    package wt  =  widget_theme;                                                # widget_theme                  is from   src/lib/x-kit/widget/theme/widget/widget-theme.pkg
    package wi  =  widget_imp;                                                  # widget_imp                    is from   src/lib/x-kit/widget/xkit/theme/widget/default/look/widget-imp.pkg
    package g2d =  geometry2d;                                                  # geometry2d                    is from   src/lib/std/2d/geometry2d.pkg
    package evt =  gui_event_types;                                             # gui_event_types               is from   src/lib/x-kit/widget/gui/gui-event-types.pkg
    package mtx =  rw_matrix;                                                   # rw_matrix                     is from   src/lib/std/src/rw-matrix.pkg
    package r8  =  rgb8;                                                        # rgb8                          is from   src/lib/x-kit/xclient/src/color/rgb8.pkg
    package l2p =  screenline_to_textpane;                                      # screenline_to_textpane        is from   src/lib/x-kit/widget/edit/screenline-to-textpane.pkg
    package p2l =  textpane_to_screenline;                                      # textpane_to_screenline        is from   src/lib/x-kit/widget/edit/textpane-to-screenline.pkg
    package slt =  screenline_types;                                            # screenline_types              is from   src/lib/x-kit/widget/edit/screenline-types.pkg
herein

    # This api is implemented in:
    #
    #     src/lib/x-kit/widget/edit/screenline.pkg
    #
    api Screenline {
        #
        Redraw_Fn_Arg         == slt::Redraw_Fn_Arg;
        Redraw_Fn             = slt::Redraw_Fn;
        Mouse_Click_Fn_Arg   == slt::Mouse_Click_Fn_Arg;
        Mouse_Click_Fn        = slt::Mouse_Click_Fn;
        Mouse_Drag_Fn_Arg    == slt::Mouse_Drag_Fn_Arg;
        Mouse_Drag_Fn         = slt::Mouse_Drag_Fn;
        Mouse_Transit_Fn_Arg == slt::Mouse_Transit_Fn_Arg;
        Mouse_Transit_Fn      = slt::Mouse_Transit_Fn;

        Option  = PIXELS_SQUARE         Int                                     # ==  [ PIXELS_HIGH_MIN i,  PIXELS_WIDE_MIN i,  PIXELS_HIGH_CUT 0.0,  PIXELS_WIDE_CUT 0.0 ]
                #
                | PIXELS_HIGH_MIN       Int                                     # Give widget at least this many pixels vertically.
                | PIXELS_WIDE_MIN       Int                                     # Give widget at least this many pixels horizontally.
                #
                | PIXELS_HIGH_CUT       Float                                   # Give widget this big a share of remaining pixels vertically.    0.0 means to never expand it beyond its minimum size.
                | PIXELS_WIDE_CUT       Float                                   # Give widget this big a share of remaining pixels horizontally.  0.0 means to never expand it beyond its minimum size.
                #
                | INITIALLY_ACTIVE      Bool
                #
                | BODY_COLOR                            rgb::Rgb
                | BODY_COLOR_WITH_MOUSEFOCUS            rgb::Rgb
                | BODY_COLOR_WHEN_ON                    rgb::Rgb
                | BODY_COLOR_WHEN_ON_WITH_MOUSEFOCUS    rgb::Rgb
                #
                | ID                    Id
                | DOC                   String
                #
                | STATE                 p2l::Linestate                          # What to display in screenline.
                #
                | FONT_SIZE             Int                                     # Show any text in this pointsize.  Default is 12.
                | FONTS                 List(String)                            # Override theme font:  Font to use for text label, e.g. "-*-courier-bold-r-*-*-20-*-*-*-*-*-*-*".  We'll use the first font in list which is found on X server, else "9x15" (which X guarantees to have).
                #
                | ROMAN                                                         # Show any text in plain  font from widget-theme.  This is the default.
                | ITALIC                                                        # Show any text in italic font from widget-theme.
                | BOLD                                                          # Show any text in bold   font from widget-theme.  NB: Text is either bold or italic, not both.
                #
                | REDRAW_FN             slt::Redraw_Fn                          # Application-specific handler for widget redraw.
                | MOUSE_CLICK_FN        slt::Mouse_Click_Fn                     # Application-specific handler for mousebutton clicks.
                | MOUSE_DRAG_FN         slt::Mouse_Drag_Fn                      # Application-specific handler for mouse drags.
                | MOUSE_TRANSIT_FN      slt::Mouse_Transit_Fn                   # Application-specific handler for mouse crossings.
                #
                | STATEWATCHER          (p2l::Linestate -> Void)                # Widget's current state              will be sent to these fns each time state changes.
                | SITEWATCHER           (Null_Or((Id,g2d::Box)) -> Void)        # Widget's site in window coordinates will be sent to these fns each time it changes.

                ;                                                               # To help prevent deadlock, watcher fns should be fast and nonblocking, typically just setting a var or entering something into a mailqueue.
                
        with: { paneline:       Int,                                            # The point of the 'with' name is that GUI coders can write 'screenline::with { this => that, foo => bar, ... }.'
                textpane_id:    Id,
                options:        List(Option)
              }
              -> gt::Gp_Widget_Type;
    };
end;


## COPYRIGHT (c) 1994 by AT&T Bell Laboratories  See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext