PreviousUpNext

15.3.640  src/lib/x-kit/widget/edit/drawpane.api

## drawpane.api
#
# Interface to provide drawing services to a textpane (or more precisely, to the foo-mode.pkg for that textpane).

# 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 d2p =  drawpane_to_textpane;                                        # drawpane_to_textpane          is from   src/lib/x-kit/widget/edit/drawpane-to-textpane.pkg
    package p2d =  textpane_to_drawpane;                                        # textpane_to_drawpane          is from   src/lib/x-kit/widget/edit/textpane-to-drawpane.pkg
    package dpt =  drawpane_types;                                              # drawpane_types                is from   src/lib/x-kit/widget/edit/drawpane-types.pkg
herein

    # This api is implemented in:
    #
    #     src/lib/x-kit/widget/edit/drawpane.pkg
    #
    api Drawpane {
        #
                                                                                # Following options inherited from screenline.pkg -- probably most of them should die.  -- 2015-08-30 CrT

        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                 p2d::Linestate                          # What to display in drawpane.
                #
                | 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.
                #
                | STATEWATCHER          (p2d::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:                                                                   # The point of the 'with' name is that GUI coders can write 'drawpane::with { this => that, foo => bar, ... }.'
              { textpane_id:    Id,                                             # The textpane to which we belong. Caller provides this so we can register outself with it via millboss_imp.
                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