home *** CD-ROM | disk | FTP | other *** search
-
- The HASWIN window library.
- ===========================
- Copyright H.A. Shaw 1990.
- ===========================
-
- Carets under the HASWIN system.
- -------------------------------
-
- HASWIN provides a more complex text caret system than that provided
- by the WIMP. Since there is a single caret available at any time HASWIN
- considers the caret to be a non-shared resource available to the user
- program (in the same way the pointer is a non-shared resource). Each HASWIN
- window can have its own caret that is automatically selected when the
- window gains the input focus. In addition to this new carets may be
- selected at any time. A first-in-first-out caret stack is provided to
- simplify programming. If a section of code wishes to use a caret it
- pushes its caret onto the stack at the begining, and pulls its caret
- off at the end of the code. If no action is taken the existing caret is
- not changed. Programs must be careful to pair pushes and pulls of the caret
- stack.
-
-
- The HASWIN caret is a data structure created and maintained by
- the HASWIN routines. A caret has the following user selected features.
-
- 1) A window to put the caret in.
- 2) An icon to put the caret in.
- 3) A x,y coordinate, height and index into a string for the caret.
- 4) The colour of the caret.
- 5) A set of flags to define the way the caret behaves.
-
- Since all of the fields of the caret structure are user setable
- they will all be described.
-
- struct window *win;
- - The window to put the caret into. If the window is not a HASWIN
- one "win" is the window handle. If 0 the caret is not in a window.
-
- struct icon *ic;
- - The icon to put the caret into. If the icon is not a HASWIN
- one "ic" is the icon handle. If 0 the caret is not in an icon.
-
- int x;
- - The X coordinate of the caret in the window. If the icon is in an
- icon then this has no real meaning.
-
- int y;
- - The Y coordinate of the caret in the window. If the icon is in an
- icon then this has no real meaning.
-
- int height;
- - The height of the caret. If -1 then "x", "y" and "height" are
- determined from "win", "ic" and "index".
-
- int colour;
- - The caret colour, but see flags below.
-
- int flags;
- - A set of flags as below...
- CARET_HEIGHT mask for height of caret in OS units
- CARET_COLOUR mask for colour if USECOLOUR bit set
- CARET_VDU5 use a VDU type 5 caret
- CARET_INVIS the caret is invisible
- CARET_USECOLOUR if set use COLOUR else use WIMP colour 11
- CARET_WIMPCOL if set COLOUR is real else WIMP translates
- CARET_REALCOL make colour ACTUAL colour by EOR with
- background
- CARET_HASWIN if set the caret is in a HASWIN window
-
- int index;
- - The index of the caret into the icon "ic", if -1 then use "win",
- "ic", "x" and "y" to determine "height" and "index".
-
-
- The routines that deal with carets within the HASWIN system are
- described below.
-
- caret *haswin_getcaretinfo(caret *car);
- - fill in the current caret coordinates and the window and icon the
- caret is in with the current state as obtained from the WIMP.
- If "car" is 0 then a new caret structure is created and all its
- fields are filled in from the current state.
- - Returns the caret "car", the newly created caret structure,
- or HASWIN_FALSE on any error.
-
- caret *haswin_makecaret(window *win, icon *ic, int x, int y, int height,
- int colour, int flags, int index);
- - Create a new caret structure.
- - "win" window to put caret in (handle for non-HASWIN windows).
- - "ic" icon to put caret in (handle for non-HASWIN windows).
- - "x" X coordinate of caret position.
- - "y" X coordinate of caret position.
- - "height" hieght of caret, if -1 then use "win", "ic", "index"
- to determine "x", "y" and "height".
- - "colour" colour of caret (but see the flags)
- - "flags" flags.
- - "index" index of the caret into "ic", if -1 then use "win",
- "ic", "x" and "y" to determine "height" and "index".
- - Returns the new caret, or HASWIN_FALSE on any error.
-
- int haswin_popcaret(void);
- - Pull a caret from the caret stack. If the stacked caret is 0
- then turn the caret off.
- - Return HASWIN_TRUE if successful, or HASWIN_FALSE on any error.
-
- int haswin_pushcaret(caret *car);
- - Push the current caret onto the caret stack and then change
- the current caret to "car". If "car" is 0 turn the caret off.
- - Return HASWIN_TRUE if successful, or HASWIN_FALSE on any error.
-
- int haswin_setcaret(caret *car);
- - Change the current caret to "car". If "car" is 0 turn the caret
- off.
- - Return HASWIN_TRUE if successful, or HASWIN_FALSE on any error.
-
-