REF GO_MIXINS                                          Ben Rabau, Aug 93

     COPYRIGHT Integral Solutions Ltd. 1993. All Rights Reserved.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<                             >>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<      GRAPHICAL OBJECT       >>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<        mixin CLASSES        >>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<                             >>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


    WARNING: This  is  the  first  version of  a  class  library  of
    graphical objects and is distributed with this release of Poplog
    for evaluation and comment. As a  result of feedback and in  the
    interests of  better  integration with  Poplog,  the  facilities
    described may be modified. While all reasonable endeavours  will
    be made to limit incompatible changes, programs which use  these
    facilities may require modification to run on later versions.


         CONTENTS - (Use <ENTER> g to access required sections)

 -- go_colourable
 -- go_composite
 -- go_editor
 -- go_fillable
 -- go_labelled
 -- go_located
 -- go_key_sensitive
 -- go_mouse_sensitive
 -- go_rotatable

-- go_colourable ------------------------------------------------------


go_colourable;                                              [mixinclass]


stored_go_fgcolour                                                [slot]
    Default: == false ;
    stored word of the foreground colour or false for default from pane


stored_go_bgcolour                                                [slot]
    Default: == false ;
    stored word of the background colour or false for default from pane


go_fgcolour( COLOURABLE ) -> WORD_OR_INTEGER;                   [method]
WORD_OR_STRING_OR_INTEGER -> go_fgcolour( COLOURABLE ); [method updater]
    The foreground colour of the colourable object. The colour is stored
    as words  rather than  strings or  as the  integer representing  the
    colour index in the colour table of the go_pane it will be shown in.
    Such an index is  not screen independent and  is unsafe. This  means
    that slot defaults need to be words or integers too .
    COLOURABLE is a go_colourable instance.


go_bgcolour( COLOURABLE ) -> WORD_OR_INTEGER;                   [method]
WORD_OR_STRING_OR_INTEGER -> go_bgcolour( COLOURABLE ); [method updater]
    The background colour of the colourable object. The colour is stored
    as words  rather than  strings or  as the  integer representing  the
    colour index in the colour table of the go_pane it will be shown in.
    Such an index is  not screen independent and  is unsafe. This  means
    that slot defaults need to be words or integers too .
    COLOURABLE is a go_colourable instance.


-- go_composite -------------------------------------------------------


go_composite;                                               [mixinclass]

    The mixin go_composite  is for  objects which  consists of  multiple
    elements (such as  go_group and go_pane).  This information will  be
    used to enable a composite object to be edited as a whole or each of
    its constituting elements separately.


go_is_editable                                                    [slot]
    Default: == false ;
    Boolean: whether or not elements of composite can be edited.


the_go_components                                                 [slot]
    Default: == [] ;
    The handles to the components of the composite group.


go_font( COMPOSITE ) -> XFONT;                                  [method]
    Gets the default font of the composite object, which is the  default
    font from its first parent.
    COMPOSITE is a go_composite instance.


go_make_editable( COMPOSITE );                                  [method]
    Make the composite object editable (slot "go_is_editable"). This  is
    currently based on a test in  go_find_ui_object in LIB * GO_PANE  If
    the go_composite is "go_is_editable" then its elements can be  moved
    separately.
    COMPOSITE is a go_composite instance.


go_make_editable( COMPOSITE );                                  [method]
    Stop   the   composite    object   from    being   editable    (slot
    "go_is_editable"). If the go_composite is not "go_is_editable"  then
    its elements can't be moved separately, the composite object  reacts
    as a single unit.
    COMPOSITE is a go_composite instance.


go_is_in( SCREEN_OBJECT, COMPOSITE ) -> BOOLEAN;                [method]
    The boolean true if the screen object is a component of the  object,
    else it is false.
    Note: objects in a go_pane might or might not be visible by the user
    at this point  since it could  be hidden below  other objects or  be
    outside the  visible part  of the  pane  on the  screen or  even  be
    temporarily cleared.
    SCREEN_OBJECT is a go_screen_object instance.
    COMPOSITE is a go_composite instance.


go_remove_from( SCREEN_OBJECT, COMPOSITE );                     [method]
    Removes the screen object  from the list of  objects visible in  the
    given composite object.
    SCREEN_OBJECT is a go_screen_object instance.
    COMPOSITE is a go_composite instance.


go_add_to( SCREEN_OBJECT, COMPOSITE );                          [method]
    Makes the screen  object part of  the objects visible  in the  given
    composite group. The screen object will appear on top of every other
    object in the composite group when drawn.
    SCREEN_OBJECT is a go_screen_object instance.
    COMPOSITE is a go_composite instance.


go_annex_to( SCREEN_OBJECT, COMPOSITE );                        [method]
    Makes the screen  object part of  the objects visible  in the  given
    composite group. The  screen object  will appear  below every  other
    object in the composite group when drawn.
    SCREEN_OBJECT is a go_screen_object instance.
    COMPOSITE is a go_composite instance.


go_raise( SCREEN_OBJECT, COMPOSITE );                           [method]
    Puts the screen  object on  top of all  other objects  in the  given
    parent.
    SCREEN_OBJECT is a go_screen_object instance.
    COMPOSITE is a go_composite instance.


go_lower( SCREEN_OBJECT, COMPOSITE );                           [method]
    Moves the screen  object under  of all  other objects  in the  given
    parent.
    SCREEN_OBJECT is a go_screen_object instance.
    COMPOSITE is a go_composite instance.


go_find_ui_object( X, Y, TYPE, RAW_EVENT_DATA, COMPOSITE )      [method]
    -> BOOLEAN;
    If a component of the composite  contains the location (X,Y) and  it
    accepts the type of events, then return true, otherwise if the group
    accepts the event and  the location is in  the group then the  group
    takes the event. If none of the above then it is false. The  objects
    which are found are added to the global variable go_forward_event_to
    (see REF * go_forward_event_to and REF * go_transparent_to_events).
    X and Y are integer world coordinates of the test position.
    TYPE is one of "mouse" or "keyboard"
    RAW_EVENT_DATA is a vector (see REF * go_expand_event_data)
    COMPOSITE is a go_composite instance.


go_redraw_area( DRAW, BELOW, PANE, GO_COMPOSITE );              [method]
    This recusively  calls REF  * go_redraw_area  on all  containers  in
    which the composite objetc is visible (see also REF * go_visible_in.
    Redraws the  area occupied  by  the screen  object if  requested  by
    redrawing all  the objects  underneath the  screen object,  then  if
    requested the screen object itself, then all the objects and editors
    on top of it. This is used by the go_redraw and go_clear methods.
    DRAW is a boolean indicating if the object itself needs to be drawn.
    BELOW is a boolean indicating if objects underneath are requested.
    COMPOSITE is a go_composite instance.
    SCREEN_OBJECT is a go_screen_object instance.


-- go_editor ----------------------------------------------------------


go_editor;                                                  [mixinclass]

    Editable objects are used to edit other objects.
    Note: This mixin needs to be used with go_screen_objects.


go_edited_object                                                  [slot]
    Default: == false ;
    Handle to object which is edited by this editor if any (else false)


stored_go_get_absolute                                            [slot]
    Default: == go_position_of_centre ;
    Procedure to get position of editor in World Coordinates


stored_go_move_absolute                                           [slot]
    Default: == updater(go_position_of_centre) ;
    Procedure to set position of editor in World Coordinates


go_move_absolute( EDITOR ) -> PROCEDURE;                        [method]
PROCEDURE -> go_move_absolute( EDITOR );                [method updater]
    Procedure attached to the editor which will be executed whenever the
    editor moves.
    EDITOR is an instance of the go_editor class.


go_internal_redraw( EDITOR );                                   [method]
    Redraws both the edited object and  the editor itself (on top),  but
    only the objects  on top  of the edited  object are  redrawn so  the
    objects underneath can be wrong.
    EDITOR is an instance of the go_editor class.


go_internal_redraw( EDITOR );                                   [method]
    Redraws the area of the edited object and the editor itself (on top).
    EDITOR is an instance of the go_editor class.


go_internal_redraw( EDITOR );                                   [method]
    Clears both of the edited object and the editor itself.
    EDITOR is an instance of the go_editor class.


go_bounding_box( PANE, EDITOR ) -> (X, Y, W, H );               [method]
    The safe region in  screen coordinates of  an editor comprises  both
    the safe region of  the edited object and  sufficient space for  the
    editor to be on its borders.
    WARNING. go_bounding_box methods (including width and height) do NOT
             include this extra space which allows editors to have centres
             which are distinct from those from their edited  object.
    PANE is an instance of the go_pane class.
    EDITOR is an instance of the go_editor class.
    X and Y are the screen coordinates of the occupied area of the object.
    W and H are the screen dimensions of the occupied area of the object.


go_draw_drag( DRAG_DATA, EDITOR );                              [method]
    Drags the edit point and updates the object it is editing.
    DRAG_DATA is a structure with drag data.
    EDITOR is an instance of the go_editor class.


-- go_fillable --------------------------------------------------------


go_fillable;                                                [mixinclass]

    The mixin go_fillable allows a go_screen_object to become filled.
    See REF * GO_SCREEN_OBJECT and go_bgcolour in REF * GO_COLOURABLE.
    A special global variable go_drag_filled allows optimised dragging.
    See REF * GO_VARS/go_drag_filled.


stored_go_filled                                                  [slot]
    Default: = false ;
    Boolean: whether the object is filled or not, this relates to the
    part of the object drawn in background colour. See also:
    REF * GO_COLOURABLE/go_bgcolour and REF * GO_XDRAW/go_bgdraw.


go_drag_filled                                                [variable]
    Default: = true;
    Draw filling if fillable.  go_drag_filled allows optimised  dragging
    of filled screen objects, by only drawing the foreground and not the
    background.


go_filled( FILLABLE ) -> BOOLEAN;                               [method]
BOOLEAN -> go_filled( FILLABLE );                       [method updater]
    Gets/sets whether or not the fillable screen object is filled.
    FILLABLE is an go_fillable instance.


go_draw_drag( CLIENT_DATA, FILLABLE );                          [method]
    Warning: This REDEFINES go_draw_drag from in LIB * GO_SCREEN_OBJECT.
    It offers an additional performance improvement with the global
    variable go_drag_filled:
        1. If go_drag_filled is false then objects will be dragged over
           the screen without being filled and on top of every other
           object.
        2. If go_drag_filled is true, a filled object will be filled and
           shown in its right screen depth even during dragging.
    This method is called from the go_drag method and should never be
    called directly.
    CLIENT_DATA is a structure containing information for dragging.
    FILLABLE is an go_fillable instance.


-- go_labelled --------------------------------------------------------


go_labelled;                                                [mixinclass]

    The mixin go_labelled can be inherited to attach a label to an
    object. The label will have the same positions the original
    object, unless the go_label_x_offset()/go_label_y_offset() are
    used to displace it.
    The dimensions of the label is only taken into account if the
    inheritance precedes all other classes or mixins:
        e.g. CORRECT: isa go_labelled go_rectangle;
             WRONG  : isa go_rectangle go_labelled;


stored_go_label                                                   [slot]
    Default: =  'Label' ;
    The object's string used in the label.


stored_go_label_font                                              [slot]
    Default: == false ;
    The XFontStruct used  for this object  if not the  default from  the
    pane.  The  applications  default   XFont  can  be  retrieved   from
    go_default_font


stored_go_label_x_offset                                          [slot]
    Default: == 0 ;
    The horizontal displacement  in world coordinates  from the left  of
    the bounding box. The bounding box of the label itself will also  be
    extended to the right but this can be clipped by the other inherited
    classes.


stored_go_label_y_offset                                          [slot]
    Default: == 0 ;
    The vertical displacement  in world coordinates  from the bottom  of
    the bounding box. The bounding box of the label itself will also  be
    extended to the top but this  can be clipped by the other  inherited
    classes.


go_label( LABELLED ) -> STRING;                                 [method]
STRING -> go_label( LABELLED );                         [method updater]
    Gets/sets the text of the go_labelled object.
    LABELLED is an instance of the go_labelled mixin.


go_label_font( LABELLED ) -> XFONT;                             [method]
XFONT -> go_label_font( LABELLED );                     [method updater]
    Gets/sets the font of the go_labelled object
    LABELLED is an instance of the go_labelled mixin.


go_label_x_offset( LABELLED ) -> INTEGER;                       [method]
INTEGER -> go_label_x_offset( LABELLED );               [method updater]
    Gets/sets
the horizontal offset on either side of the go_labelled object.
    LABELLED is an instance of the go_labelled mixin.


go_label_y_offset( LABELLED ) -> INTEGER;                       [method]
INTEGER -> go_label_y_offset( LABELLED );               [method updater]
    Gets/sets
the vertical offset on either side of the go_labelled object.
    LABELLED is an instance of the go_labelled mixin.


go_label_text_width( LABELLED ) -> INTEGER;                     [method]
    Calculates how wide the  text itself is  in world coordinates.  If a
    font is  given in  go_label_font(  label )  then  the font  is  used
    Otherwise the font is derived from the first pane it is shown in  or
    from the application's default (see  also ~/.Xdefaults file) if  not
    shown. It returns  at least 10  (even if string  is empty) to  avoid
    losing the item on the screen.
    LABELLED is an instance of the go_labelled mixin.


go_label_text_height( LABELLED ) -> INTEGER;                    [method]
    Calculates how heigh the text  itself is in world coordinates.  If a
    font is  given in  go_label_font(  label )  then  the font  is  used
    Otherwise the font is derived from the first pane it is shown in  or
    from the application's default (see  also ~/.Xdefaults file) if  not
    shown.
    LABELLED is an instance of the go_labelled mixin.


go_label_width( LABELLED ) -> INTEGER;                          [method]
    Calculates how wide the  text and offset  are in world  coordinates.
    see go_label_text_width() for calculation of the width of the text
    LABELLED is an instance of the go_labelled mixin.


go_label_height( LABELLED ) -> INTEGER;                         [method]
    Calculates how heigh the text  and offset are in world  coordinates.
    see go_label_text_height() for calculation of the height of the text
    LABELLED is an instance of the go_labelled mixin.


go_draw_label( PANE, LABELLED );                                [method]
    Draws the go_labelled object on the given pane (used by  go_fgdraw).
    This takes axes orientation and  label-offsets into account. If  The
    label does not fit in the width  of the bounding box then the  label
    will be clipped on whole characters at  the end of the string or  if
    the offset is negative clipped on whole characters at the  beginning
    of the string (or  both if necessary). If  the height does't fit  in
    the bounding box, then NO label  is printed (the user is advised  to
    use a smaller font (see REF * GO_LABELLED/go_label_font).
    LABELLED is an instance of the go_labelled mixin.


go_fgdraw( PANE, LABELLED );                                    [method]
    Draws the go_labelled object  and the label on  the given pane.  The
    label is always on top of the go_labelled object.
    LABELLED is an instance of the go_labelled mixin.


go_label_editing( char, LABELLED );                             [method]
    Handles the  given  character  input  on  the  label  of  the  given
    go_labelled object. All  recognisable input is  seen as editing  the
    label of the  object. No  support for multi-lines  is foreseen.  All
    unrecognised keys (like function keys or modifiers) produce  warning
    messages on the tty. Only uses keys from the X-interface.
    See also REF * XT_LIBS and INCLUDE * X_KEYSYMS
    LABELLED is an instance of the go_labelled mixin.


-- go_located ---------------------------------------------------------


go_located;                                                 [mixinclass]

    The mixin go_located is one of the base classes in the Graphical
    Objects library, and introduces the concept of the "bounding box".
    Each object has an enclosing rectangle parrallel with the axes.
    This bounding box makes a lot of geometrical operations easier by
    offering a bounding width and height and uniform reference points
    like a corner and the centre for each object however complex an
    irregular. Additional scaling around the centre of the bounding box
    completes this class. See also scaling of panes in which the
    objects will be visualized.


stored_go_xorigin                                                 [slot]
    Default: == 0 ;
    Stored horizontal origin of the object's local coordinate system.


stored_go_yorigin                                                 [slot]
    Default: == 0 ;
    Stored vertical origin of the object's local coordinate system.


stored_go_bounding_width                                          [slot]
    Default: == 1 ;
    Stored Width in local coordinates of bounding box.


stored_go_bounding_height                                         [slot]
    Default: == 1 ;
    Stored Height in local coordinates of bounding box.


stored_go_xscale                                                  [slot]
    Default: == 1 ;
    Stored X scale of object (horizontal compression).


stored_go_yscale                                                  [slot]
    Default: == 1 ;
    Stored Y scale of object (vertical compression).


stored_go_local_coords                                            [slot]
    Default: == [] ;
    X and Y-coordinates from go_xorigin and from go_yorigin


go_xorigin( SCREEN_OBJECT ) -> INTEGER;                         [method]
INTEGER -> go_xorigin( SCREEN_OBJECT );                 [method updater]
    The horizontal origin of the local coordinates of the object.
    LOCATED is a go_located instance.


go_yorigin( SCREEN_OBJECT ) -> INTEGER;                         [method]
INTEGER -> go_yorigin( SCREEN_OBJECT );                 [method updater]
    The vertical origin of the local coordinates of the object.
    LOCATED is a go_located instance.


go_origin_to( X, Y, LOCATED );                                  [method]
    Sets both horizontal and vertical origin of a located object.
    This is a convenience method using go_xorigin and go_yorigin.
    X and Y are world coordinates of the new origin position.
    LOCATED is a go_located instance.


go_xcentre( SCREEN_OBJECT ) -> INTEGER;                         [method]
INTEGER -> go_xcentre( SCREEN_OBJECT );                 [method updater]
    The horizontal centre of the local coordinates of the object.
    LOCATED is a go_located instance.


go_ycentre( SCREEN_OBJECT ) -> INTEGER;                         [method]
INTEGER -> go_ycentre( SCREEN_OBJECT );                 [method updater]
    The vertical centre of the local coordinates of the object.
    LOCATED is a go_located instance.


go_centre_to( X, Y, LOCATED );                                  [method]
    Sets both horizontal and vertical centre of a located object.
    This is a convenience method using go_xcentre and go_ycentre.
    X and Y are world coordinates of the new centre position.
    LOCATED is a go_located instance.


go_position_of_origin( LOCATED ) -> (X, Y);                     [method]
(X, Y) -> go_position_of_origin( LOCATED );             [method updater]
    The world coordinates of the origin point of the local coordinates
    of a located object. This is a convenience function using the
    go_xorigin and go_yorigin methods.
    X and Y are the world coordinates of the origin point of the object.
    LOCATED is a go_located instance.


go_position_of_centre( LOCATED ) -> (X, Y);                     [method]
(X, Y) -> go_position_of_centre( LOCATED );             [method updater]
    The world coordinates of the centre point of the bounding box
    of a located object. This is a convenience function using the
    go_xcentre and go_ycentre methods.
    X and Y are the world coordinates of the centre point of the object.
    LOCATED is a go_located instance.


go_xscale( LOCATED ) -> REAL;                                   [method]
REAL -> go_xscale( LOCATED );                           [method updater]
    The horizontal scaling factor of a located object. This will
    preserve the position of the centre of the bounding box. Care is
    taken that the value does not become ZERO.
    LOCATED is a go_located instance.


go_yscale( LOCATED ) -> REAL;                                   [method]
REAL -> go_yscale( LOCATED );                           [method updater]
    The vertical scaling factor of a located object. This will
    preserve the position of the centre of the bounding box. Care is
    taken that the value does not become ZERO.
    LOCATED is a go_located instance.


go_scale( LOCATED ) -> REAL;                                    [method]
REAL -> go_scale( LOCATED );                            [method updater]
    Sets both horizontal and vertical scaling factor of a located object.
    This is a convenience method using go_xscale and go_yscale.
    LOCATED is a go_located instance.


go_xloc( LOCATED ) -> INTEGER;                                  [method]
INTEGER -> go_xloc( LOCATED );                          [method updater]
    The horizontal world coordinate of the reference corner of
    the bounding box of a located object. In a positive orientation of
    the axes, the reference point is the bottom-left corner.
    LOCATED is a go_located instance.


go_yloc( LOCATED ) -> INTEGER;                                  [method]
INTEGER -> go_yloc( LOCATED );                          [method updater]
    The vertical world coordinate of the reference corner of
    the bounding box of a located object. In a positive orientation of
    the axes, the reference point is the bottom-left corner.
    LOCATED is a go_located instance.


go_bounding_width( LOCATED ) -> INTEGER;                        [method]
INTEGER -> go_bounding_width( LOCATED );                [method updater]
    The width in world coordinates of the bounding box of a
    located object. This influences the scaling (see go_xscale).
    LOCATED is a go_located instance.


go_bounding_height( LOCATED ) -> INTEGER;                       [method]
INTEGER -> go_bounding_height( LOCATED );               [method updater]
    The height in world coordinates of the bounding box of a
    located object. This influences the scaling (see go_xscale).
    LOCATED is a go_located instance.


go_bounding_box( LOCATED ) -> (X, Y, W, H);                     [method]
    Gets the dimensions in world coordinates of the bounding box of a
    located object. This uses the go_xcentre, go_ycentre,
    go_bounding_width and go_bounding_height methods.
    X and Y are the world coordinates of the object's reference point.
    W and H are sizes in world coordinates of the object's bounding box.
    LOCATED is a go_located instance.


go_transxyout( LX, LY, SCREEN_OBJECT ) -> ( X, Y );             [method]
    Calculation of the transformed coordinates corresponding to
    a given position in the objects local coordinates.
    LX and LY are the object's local coordinates of a position.
    SCREEN_OBJECT is a go_screen_object instance.
    X and Y are the transformed coordinates of the position.


go_transxyin( X, Y, SCREEN_OBJECT ) -> ( LX, LY );              [method]
    Calculation of  the object's  local coordinates  corresponding  to a
    given position in previously transformed coordinates.
    X and Y are the previously transformed coordinates of the position.
    SCREEN_OBJECT is a go_screen_object instance.
    LX and LY are the object's local coordinates of a position.


go_translistout( LOCALCOORDLIST, SCREEN_OBJECT )                [method]
    -> TRANSCOORDLIST;
    Calculates the transformed coordinates for a given object This takes
    account of the current centre of the object, the the extra  rotation
    and extra scaling of the object (not the scaling of the panes it  is
    in).
    LOCALCOORDLIST are the object's local coordinates of a position.
    SCREEN_OBJECT is a go_screen_object instance.
    TRANSCOORDLIST are the transformed coordinates of a position in  the
    pane.


go_translistin( TRANSCOORDLIST, SCREEN_OBJECT )                 [method]
    -> LOCALCOORDLIST;
    Calculates the previously transformed coordinates for a given object
    This takes account of the current centre of the object, the
    the extra rotation and extra scaling of the object (not the scaling
    of the panes it is in).
    TRANSCOORDLIST are the transformed coordinates of a position in the
    pane.
    SCREEN_OBJECT is a go_screen_object instance.
    LOCALCOORDLIST are the object's local coordinates of a position.


go_local_coords( LOCATED ) -> LIST;                             [method]
LIST -> go_local_coords( LOCATED );                     [method updater]
    LIST is the list of horizontal and vertical integer coordinates of
    points in the object's local coordinate system.
    LOCATED is a go_located instance.


go_translistin( DX, DY, SCREEN_OBJECT ) -> NEWLOCALCOORDLIST;   [method]
    Calculates the local coordinates for a given object after translating
    over a given distance.
    DX and DY are the horizontal and vertical offset in local coordinates.
    NEWLOCALCOORDLIST are the object's local coordinates after
    translation.


go_world_coords( LOCATED ) -> WORLDCOORDLIST;                   [method]
WORLDCOORDLIST -> go_world_coords( LOCATED );           [method updater]
    LOCATED is a go_located instance.
    WORLDCOORDLIST is a list of world coordinates of the groups offsets.


go_contains( X, Y, LOCATED ) -> LOCATED_OR_FALSE;               [method]
    Checks whether the world coordinates of a test position fall inside
    the bounding box of a located object. This is a good default method
    for testing whether a position falls inside an object. If not
    inside then the method returns the boolean false, else it returns
    the object itself.
    X and Y are the world coordinates of the test position.
    LOCATED is a go_located instance.


go_overlaps_bounding_boxes( LOCATED1, LOCATED2 ) -> BOOLEAN;    [method]
    Checks whether the bounding boxes of two located objects overlap or
    not. This is a good default method for testing whether two objects
    overlap. It returns the boolean true if it overlaps, else it is
    false.
    LOCATED1 and LOCATED2 are go_located instances.


go_overlaps( LOCATED1, LOCATED2 ) -> BOOLEAN;                   [method]
    This uses the go_overlaps_bounding_boxes method to check whether two
    objects overlap. It checks whether the bounding boxes of two located
    objects overlap or not. It returns the boolean true if it overlaps,
    else it is false.
    LOCATED1 and LOCATED2 are go_located instances.


-- go_key_sensitive ---------------------------------------------------


go_key_sensitive;                                           [mixinclass]

    Dummy action in GO (default action on key-strokes): erase arguments.
    The mixin go_key_sensitive adds behaviour (actions) to the
    Graphical Objects when keyboard events occur over the object. The
    actions only get called in "live" mode (see HELP * GO_LIVE).
    The actions are devided in two categories: down and up which
    correspond to the state of a mouse button.
    In "edit" mode the  behaviour is determined by the edit actions.


go_key_down_action                                                [slot]
    Default: = no_key_action ;
    Procedure called when a keyboard key-down event happens when the
    mouse is over this object.


go_key_up_action                                                  [slot]
    Default: = no_key_action ;
    Procedure called when a keyboard key-up event happens after a
    key-down event happened with the mouse over this object.


go_accepts_events( TYPE, RAW_EVENT_DATA, MOUSE_SENSITIVE )      [method]
    -> BOOLEAN;
    Returns whether or not this object accepts the event. In this
    case whether the event is a keyboard event.
    RAW_EVENT_DATA is a vector (see REF * GO_XACTION/go_expand_event_data).
    KEY_SENSITIVE is a go_key_sensitive object.


go_key_down_action_string( KEY_SENSITIVE ) -> STRING;           [method]
    Gets the string representing the action triggered when a keyboard
    key goes down. The string can be any compilable Pop-11 structure which
    expects two arguments on the stack: the key and the object over which
    the mouse resided when the key was hit.
    KEY_SENSITIVE is a go_key_sensitive object.


STRING -> go_key_down_action_string( KEY_SENSITIVE );   [method updater]
    Compiles the string representing the action triggered when a keyboard
    key goes up. The string can be any compilable Pop-11 structure which
    expects two arguments on the stack: the key and the object over which
    the mouse resides when the key is hit.


go_key_up_action_string( KEY_SENSITIVE ) -> STRING;             [method]
    Gets the string representing the action triggered when a keyboard
    key goes up. The string can be any compilable Pop-11 structure which
    expects two arguments on the stack: the key and the object over which
    the mouse resided when the key was hit.


STRING -> go_key_up_action_string( KEY_SENSITIVE );     [method updater]
    Compiles the string representing the action triggered when a keyboard
    key goes up. The string can be any compilable Pop-11 structure which
    expects two arguments on the stack: the key and the object over which
    the mouse resides when the key is hit.


-- go_mouse_sensitive -------------------------------------------------


go_mouse_sensitive;                                         [mixinclass]

    The mixin go_mouse_sensitive adds behaviour (actions) to the
    Graphical Objects when mouse events occur over the object. These
    actions only get called in "live" mode (see HELP * GO_LIVE).
    The actions are devided in three categories: down, drag and up
    which correspond to the state of a mouse button. By default the
    code foresees a three button mouse, but any number of buttons can
    be accomodated by extending the stored lists. Note that the number
    of butons relates to the logical device; e.g. in X-windows vendors
    with a physical two-button mouse often add a third logical button
    in the form of combined pressing of both physical mouse-buttons.
    See also LIB * GO_KEY_SENSITIVE for keyboard actions.
    no_action( EVENT_DATA, OBJECT );
    Dummy action in GO (default action on mouse-clicks): erase
    arguments.


stored_go_mouse_down_action                                       [slot]
    Default: = {^no_action ^no_action ^no_action} ;
    A vector representing the actions attached to the down event of a
    mouse-button. The vector needs to be as long as the maximum number
    of mouse-buttons available. Default: 3 mouse-buttons with
    no_action()


stored_go_mouse_drag_action                                       [slot]
    Default: = {^no_action ^no_action ^no_action} ;
    A vector representing the actions attached to the drag event of a
    mouse-button. The vector needs to be as long as the maximum number
    of mouse-buttons available. Default: 3 mouse-buttons with
    no_action()


stored_go_mouse_up_action                                         [slot]
    Default: = {^no_action ^no_action ^no_action} ;
    A vector representing the actions attached to the up event of a
    mouse-button. The vector needs to be as long as the maximum number
    of mouse-buttons available. Default: 3 mouse-buttons with
    no_action()


go_accepts_events( TYPE, RAW_EVENT_DATA, MOUSE_SENSITIVE )      [method]
    -> BOOLEAN;
    Returns whether or not this object  accepts the event. In this  case
    whether the  event is  a mouse  event.  TYPE is  one of  "mouse"  or
    "keyboard".
    RAW_EVENT_DATA is a vector (see REF *
    GO_XACTION/go_expand_event_data).
    MOUSE_SENSITIVE is a go_mouse_sensitive object.


go_mouse_down_action( Button, MOUSE_SENSITIVE ) -> PROCEDURE;   [method]
    Gets the  action attached  to the  mouse sensitive  object when  the
    indicated mouse-button is pushed down over the object. These actions
    only get called  in "live" mode  (see HELP *  GO_LIVE).
    Button  is a positive integer indicating the mouse-button, default
    [1.3]
    MOUSE_SENSITIVE is a go_mouse_sensitive object.


PROCEDURE -> go_mouse_down_action( Button,              [method updater]
    MOUSE_SENSITIVE );
    Attaches the  action to  the  mouse sensitive  object for  when  the
    indicated mouse-button is pushed down over the object. These actions
    only get called  in "live" mode  (see HELP *  GO_LIVE).
    Button  is a positive integer indicating the mouse-button, default
    [1.3]
    MOUSE_SENSITIVE is a go_mouse_sensitive object.


go_mouse_drag_action( Button, MOUSE_SENSITIVE ) -> PROCEDURE;   [method]
    Gets the action attached to the mouse sensitive object when the
    indicated mouse-button is held down over the object and then moved.
    These actions only get called in "live" mode (see HELP * GO_LIVE).
    Button is a positive integer indicating the mouse-button, default
    [1.3]
    MOUSE_SENSITIVE is a go_mouse_sensitive object.


PROCEDURE -> go_mouse_drag_action( Button,              [method updater]
    MOUSE_SENSITIVE);
    Attaches the action to the mouse sensitive object for when the
    indicated mouse-button is held down over the object and then moved.
    These actions only get called in "live" mode (see HELP * GO_LIVE).
    Button is a positive integer indicating the mouse-button, default
    [1.3]
    MOUSE_SENSITIVE is a go_mouse_sensitive object.


go_mouse_drag_action( Button, MOUSE_SENSITIVE ) -> PROCEDURE;   [method]
    Gets the action attached to the mouse sensitive object when the
    indicated mouse-button is released after being held down over the
    object. These actions only get called in "live" mode (see HELP *
    GO_LIVE).
    Button is a positive integer indicating the mouse-button, default
    [1.3]
    MOUSE_SENSITIVE is a go_mouse_sensitive object.


PROCEDURE -> go_mouse_drag_action( Button,              [method updater]
    MOUSE_SENSITIVE );
    Attaches the action to the mouse sensitive object for when the
    indicated mouse-button is released after being held down over the
    object. These actions only get called in "live" mode (see HELP *
    GO_LIVE).
    Button is a positive integer indicating the mouse-button, default
    [1.3]
    MOUSE_SENSITIVE is a go_mouse_sensitive object.


-- go_rotatable -------------------------------------------------------

go_rotatable;                                               [mixinclass]

    The mixin go_rotatable is for objects which can be rotated.
    A special meaning is attached to the rotation of groups (see
    REF * GO_GROUP/go_angle).


stored_go_angle                                                   [slot]
    Default: == 0 ;
    Stored value of angle in degrees to the reference point (to the
    east).


stored_go_xrotation                                               [slot]
    Default: == 0 ;
    Stored horizontal rotation of the object's local coordinate system.


stored_go_yrotation                                               [slot]
    Default: == 0 ;
    Stored vertical rotation of the object's local coordinate system.


go_angle( ROTATABLE ) -> INTEGER;                               [method]
INTEGER -> go_angle( ROTATABLE );                       [method updater]
    Current angle of the object.
    ROTATABLE is an instance of a go_rotatable class.


go_xrotation( ROTATABLE ) -> REAL;                              [method]
REAL -> go_xrotation( ROTATABLE );                      [method updater]
    The horizontal world coordinate for rotation of the local coords of
    the given object.
    ROTATABLE is an instance of a go_rotatable class.


go_yrotation( ROTATABLE ) -> REAL;                              [method]
REAL -> go_yrotation( ROTATABLE );                      [method updater]
    The vertical world coordinate for rotation of the local coords of
    the given object.
    ROTATABLE is an instance of a go_rotatable class.


go_position_of_rotation( ROTATABLE ) -> (X, Y);                 [method]
(X, Y) -> go_position_of_rotation( ROTATABLE );         [method updater]
    The world coordinates of the rotation point of a located object.
    This is a convenience function using go_xrotation and go_yrotation.
    X and Y are the world coordinates for rotation of the local coords
    of the object.
    ROTATABLE is an instance of a go_rotatable class.


go_rotate( ANGLE, STEP, ROTATABLE );                            [method]
    Rotate the object a step at the time until the given angle.
    ANGLE is the integer angle in degrees towards which the object
    rotates.
    STEP is the integer step in degrees taken in the rotation.
    ROTATABLE is an instance of a go_rotatable class.


go_transxyout( LX, LY, ROTATABLE ) -> ( X, Y );                 [method]
    Calculation of the world coordinates corresponding to a given
    position in the objects local coordinates.
    LX and LY are the object's local coordinates of a position.
    ROTATABLE is an instance of a go_rotatable class.
    X and Y are the world coordinates of a position in the pane.


go_transxyin( X, Y, ROTATABLE ) -> ( LX, LY );                  [method]
    Calculation of the object's local coordinates corresponding to a
    given position in world coordinates.
    X and Y are the world coordinates of a position in the pane.
    ROTATABLE is an instance of a go_rotatable class.
    LX and LY are the object's local coordinates of a position.


go_translistout( LOCALCOORDLIST, ROTATABLE ) -> WORLDCOORDLIST; [method]
    Calculates the absolute world coordinates for a given object This
    takes account of the current rotation point of the object, the the
    extra rotation and extra scaling of the object (not the scaling of
    the panes it is in).
    LOCALCOORDLIST are the object's local coordinates of a position.
    ROTATABLE is an instance of a go_rotatable class.
    WORLDCOORDLIST are the world coordinates of a position in the pane.


go_translistin( WORLDCOORDLIST, ROTATABLE ) -> LOCALCOORDLIST;  [method]
    Calculates the absolute world coordinates for a given object This
    takes account of the current rotation point of the object, the the
    extra rotation and extra scaling of the object (not the scaling of
    the panes it is in).
    WORLDCOORDLIST are the world coordinates of a position in the pane.
    ROTATABLE is an instance of a go_rotatable class.
    LOCALCOORDLIST are the object's local coordinates of a position.


go_bounding_width( ROTATABLE ) -> INTEGER;                      [method]
INTEGER -> go_bounding_width( PANE, ROTATABLE );        [method updater]
    The width of the region occupied by the rotatable screen object.
    This is calculated on the basis of the rotation of the original
    bounding box over the angle the object holds. This results in a
    bounding box which is always too large since it contains the
    original box.
    PANE is an instance of the go_pane class.
    ROTATABLE is an instance of a go_rotatable class.


go_bounding_height( PANE, ROTATABLE ) -> INTEGER;               [method]
INTEGER -> go_bounding_height( PANE, ROTATABLE );       [method updater]
    The height of the region occupied by the rotatable screen object.
    This is calculated on the basis of the rotation of the original
    bounding box over the angle the object holds. This results in a
    bounding box which is always too large since it contains the
    original box.
    PANE is an instance of the go_pane class.
    ROTATABLE is an instance of a go_rotatable class.


-- go_pane ------------------------------------------------------------


go_pane;                                                    [mixinclass]
    isa go_composite go_located go_short_print;

    Basic structure for an XpwGraphic related pane This mixin is
    inherited by all the pane related objects whether they are pure
    screen objects or connected to X-specific shells. See also TEACH *
    GO_PANE


stored_go_window                                                  [slot]
    Default: == false ;
    The XpwGraphics window (REF * XpwGraphic).


stored_go_edit_mode                                               [slot]
    Default: == true ;
    Boolean: whether the pane is in edit or live mode.


go_editors                                                        [slot]
    Default: == [] ;
    The editor objects visible in this pane.


go_selected_object                                                [slot]
    Default: == false ;
    The selected object (or group) visible in this pane.


stored_go_xscale                                                  [slot]
    Default: == false ;
    The horizontal compression factor for all objects. This will is on
    top of any compression of the objects.


stored_go_yscale                                                  [slot]
    Default: == false ;
    The vertical compression factor for all objects. This will is on
    top of any compression of the objects.


stored_go_xorigin                                                 [slot]
    Default: == 0 ;
    The horizontal origin in screen coordinates from the top-left.


stored_go_yorigin                                                 [slot]
    Default: == 0 ;
    The vertical origin in screen coordinates from the top-left.


go_double_buffer                                                  [slot]
    Default: == false ;
    Whether or not drawing in this pane is double buffered.


the_go_double_buffer                                              [slot]
    Default: == false ;
    Whether or not drawing in this pane is double buffered.


cached_go_coord_list                                              [slot]
    Default: == false ;
    cached go_screen_coords (per object) on the pane's screen.


cached_go_coord_reg                                               [slot]
    Default: == false ;
    cached regions (per object) on the pane's screen.


cached_go_colourtable                                             [slot]
    Default: == false ;
    Property to cache colours on this window.
    on cons do procedure(); go_initialise_pane(); endprocedure;


go_panes                                                      [variable]
    Default: = []
    All current panes.


go_default_pane                                               [variable]
    Last go_pane to be actively used either on creation or on mouse
    actions.


go_initialise_window_pane( PANE );                              [method]
    Execute user initialisations. The default adds a colour caching
    table and adds the new pane to the global vars "go_panes" (REF *
    go_panes). This is executed each time a new window pane is created.
    Users can add extra initialisations which will be executed each time
    a new pane is created.
    PANE is an instance of the go_pane class.


the_go_window( PANE ) -> XPWGRAPHIC_OR_FALSE;                   [method]
XPWGRAPHIC_OR_FALSE -> the_go_window( PANE );           [method updater]
    Attached XpwGraphic widget. If none is attached the boolean "false"
    used (i.e. updating with false detaches the current XpwGraphic
    widget from the given pane).
    PANE is an instance of the go_pane class.


the_go_pane( PANE ) -> PANE;                                    [method]
    Return pane in which pane is displayed. The default pane for
    displaying a pane is itself.
    PANE is an instance of the go_pane class.


go_update( PANE );                                              [method]
    Reinitialise pane. This function assures that all stored screen
    coordinates are removed.
    PANE is an instance of the go_pane class.


go_update_and_draw( PANE );                                     [method]
    Reinitialise and refresh pane. This function assures that all screen
    coordinates are recalculated.
    PANE is an instance of the go_pane class.


go_live_mode( PANE ) -> BOOLEAN;                                [method]
BOOLEAN -> go_live_mode( PANE );                        [method updater]
    Returns or changes the state of the pane (opposite of go_edit_mode).
    PANE is an instance of the go_pane class.


go_live_mode( PANE ) -> BOOLEAN;                                [method]
BOOLEAN -> go_live_mode( PANE );                        [method updater]
    Returns or changes the state of the pane (opposite of go_edit_mode).
    PANE is an instance of the go_pane class.


go_xorigin( PANE ) -> INTEGER;                                  [method]
INTEGER -> go_xorigin( PANE );                          [method updater]
    Changes horizontal origin of objects in pane
    Integer screen coord of pane relative to top-left corner of shell
    PANE is an instance of the go_pane class.


go_yorigin( PANE ) -> INTEGER;                                  [method]
INTEGER -> go_yorigin( PANE );                          [method updater]
    Changes vertical origin of objects in pane.
    Integer screen coord of pane relative to top-left corner of shell
    PANE is an instance of the go_pane class.


go_xscale( LOCATED ) -> REAL;                                   [method]
    Sets the horizontal scaling factor of the given pane. This will
    preserve the position of the centre of the pane. It influences
    the screen coordinate calculations.
    For more on scaling see REF * GO_LOCATED.
    PANE is an instance of the go_pane class.


go_yscale( LOCATED ) -> REAL;                                   [method]
    Sets the vertical scaling factor of the given pane. This will
    preserve the position of the centre of the pane. It influences
    the screen coordinate calculations.
    For more on scaling see REF * GO_LOCATED.
    PANE is an instance of the go_pane class.


go_accepts_events( TYPE, RAW_EVENT_DATA, PANE ) -> BOOLEAN;     [method]
    Returns whether or not this object accepts the event. By default
    this is FALSE for a pane.
    RAW_EVENT_DATA is a vector (see REF *
    GO_XACTION/go_expand_event_data)
    PANE is an instance of the go_pane class.


go_edit_drag_action( event_data, PANE );                        [method]
    When the mouse is dragged on the pane in edit mode, then scroll the
    pane if mouse is dragged outside the pane (when it is held down over
    an empty spot of the pane). This will influence the go_xorigin and
    go_yorigin slots of the pane.
    event_data is a vector with mouse event information (REF *
    GO_XACTION).
    PANE is an instance of the go_pane class.


go_get_colour( COLOUR, PANE ) -> INTEGER;                       [method]
    Get the cached index in the colour table of the pane's XpwGraphics
    widget or if it doesn't yet exist retrieve the index and cache it.
    See also REF * GO_COLOURABLE.
    COLOUR is a word or a string describing the colour or the index
    itself.
    PANE is an instance of the go_pane class.


go_fgcolour( PANE ) -> INTEGER;                                 [method]
    Get the foreground colour of the pane. The colour is the index in
    the colour table of the pane's XpwGraphics widget.
    PANE is an instance of the go_pane class.


COLOUR -> go_fgcolour( PANE );                          [method updater]
    Set the foreground colour of the pane. The colour is a word or a
    string describing the colour or the index in the colour table of the
    pane's XpwGraphics widget.
    PANE is an instance of the go_pane class.


go_bgcolour( PANE ) -> INTEGER;                                 [method]
    Get the background colour of the pane. The colour is the index in
    the colour table of the pane's XpwGraphics widget.
    PANE is an instance of the go_pane class.


COLOUR -> go_bgcolour( PANE );                          [method updater]
    Set the background colour of the pane. The colour is a word or a
    string describing the colour or the index in the colour table of the
    pane's XpwGraphics widget.
    PANE is an instance of the go_pane class.


go_redraw( PANE );                                              [method]
    Clean pane and redraw all the visible objects in it. This method
    mirrors behaviour of the screen objects.
    PANE is an instance of the go_pane class.


go_find_ui_object( X, Y, TYPE, RAW_EVENT_DATA, PANE )           [method]
    -> BOOLEAN;
    Finds the object(s) amongst those visible in the given pane which
    accepts interaction at the given world coordinate position. An
    object accepts interaction if it is in edit mode but can only accept
    inter- action in live mode when it is sensitive (see REF *
    GO_MOUSE_SENSITIVE and REF * GO_KEY_SENSITIVE). The latter can be
    further subdivided if an object was a group: the first element of
    the group which is sensitive will accept the interaction if the
    group is in live mode, whereas in edit mode the whole group accepts
    interaction. See also REF * GO_SCREEN_OBJECT/go_accepts_events. The
    objects if any are added to the global variable go_forward_event_to
    (See the global variable REF * go_forward_event_to and also the
    global variable REF * go_transparent_to_events).
    X and Y are integer world coordinates of the test position.
    TYPE is one of "mouse" or "keyboard"
    RAW_EVENT_DATA is a vector (see REF * GO_XACTION/go_expand_event_data)
    PANE is an instance of the go_pane class.


go_remove_from( LOCATED, PANE );                                [method]
    Removes the screen object from the list of objects visible in the
    given pane.
    SCREEN_OBJECT is a go_screen_object instance.
    PANE is an instance of the go_pane class.


go_copy_object( PANE ) -> NEW_PANE;                             [method]
    Creates a new pane as an exact copy of the given pane. This also
    copies all objects visible in the pane but not the editors.
    PANE and NEW_PANE are instances of the go_pane class.


go_empty_pane( PANE );                                          [method]
    Empties the pane object by removing all objects from it. These
    objects themselves are not destroyed since they could be visible in
    other panes.
    PANE is an instance of the go_pane class.


go_destroy_object( PANE );                                      [method]
    Destroys the pane object after removing all objects from it. These
    objects themselves are not destroyed since they could be visible in
    other panes.
    PANE is an instance of the go_pane class.


go_is_in( EDITOR, PANE) -> BOOLEAN;                             [method]
    Checks whether or not the object is one of the editors visible in
    the given pane. It might or might not be visible by the user at this
    point since it could be hidden below other objects or be outside the
    visible part of the pane on the screen or even be temporarily
    cleared. See also REF * GO_EDITOR.
    EDITOR is an instance of the go_editor class.
    PANE is an instance of the go_pane class.


go_remove_from( EDITOR, PANE );                                 [method]
    Removes the screen object from the list of objects visible in the
    given pane. It does not attempt to clear it from the screen.
    EDITOR is an instance of the go_editor class.
    PANE is an instance of the go_pane class.


go_add_to( EDITOR, PANE );                                      [method]
    Makes the screen object part of the objects visible in the given
    pane. It does not attempt to draw it but the object will appear on
    top of every other object and editor in the pane when drawn.
    EDITOR is an instance of the go_editor class.
    PANE is an instance of the go_pane class.


--- C.all/lib/proto/go/ref/go_mixins
--- Copyright University of Sussex 1993. All rights reserved.
