home *** CD-ROM | disk | FTP | other *** search
- /*
- winobj.h
-
- % Window object definitions for basic window types
-
- 11/28/88 by Ted.
-
- OWL 1.2
- Copyright (c) 1988, 1989 by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 3/11/88 Ted Hacked.
- 8/15/88 jmd preened
- 10/31/88 ted Removed linked window support.
- 11/04/88 ted Added new border object.
- 11/17/88 ted Added Mouse support.
- 2/12/88 ted Fixed up mouse support for new current window cases
- 3/23/89 Ted Merged with windecl.h in converting win's to pure obj's
- 3/23/89 Ted Extracted wmgr_struct to wmgrdecl.h
- 4/14/89 ted Added CHILDCLOSE msg.
- 4/21/89 ted Renamed xd elements box and border to wbox and bord for Unix.
- 5/11/89 ted Added win parent clip flag.
- 6/26/89 ted Moved nextwin out of goresult_struc into wmgr.
- 7/10/89 ted Moved nextwin to window structure from wmgr.
- 7/12/89 ted Converted '_func' prototypes from typedef to macro.
- 7/25/89 ted Added explode function.
- 8/08/89 jmd Made new messages (setsize, etc.).
- 8/10/89 jmd Killed bob, added new messages to windows.
- 8/11/89 jmd Added new bob class
- 8/16/89 ted Removed GETEXPLODE, SETEXPLODE messages
- 8/16/89 ted Added resize and nullfont flags.
-
- 11/06/89 jmd added bob_Class macro
- 11/10/89 jmd added PRINT, GRAB messages
- 11/21/89 ted Renamed win xd and od bob kernels from cd to bd.
- 12/04/89 jmd added cursor color
- 12/10/89 jmd added win gofunc
- 12/11/89 jmd added bob user bits
- 12/18/89 jmd added child number messages, parent move flag
- 12/21/89 jmd added bob owner funcs
- 3/28/90 ted Moved curshide flag to xd here from od.
- 3/28/90 ted Removed HIDECURS & SHOWCURS msgs.
- 3/28/90 jmd ansi-fied
- 4/25/90 jmd added window generic data pointer
- 5/08/90 jmd added underscores to func macros for vms compiler
- 5/12/90 jmd made mouse handlers return ints
- 7/29/90 jmd added win aux messages
- 8/04/90 jmd moved aux messages to oakaux.h
- 8/13/90 jdc added class_func sym handle in the bob_xd
- 8/24/90 jdc added classhandle macros
- 8/27/90 ted added nextchild stuff for offer/request mouse msgs to use.
- 8/27/90 ted moved bob macros and prototypes out to bobproto.h
- 9/24/90 jmd added userpaint flaq, removed gofunc
- 9/25/90 jmd added userwin
- */
-
- #ifndef OAK_WINOBJ
- #define OAK_WINOBJ
-
- /* ** #include "commnobj.h" Note: always included in Oakland code. */
- #include "winfsym.h" /* for WIN_FSYM_COUNT */
-
- /* -------------------------------------------------------------------------- */
- extern class_func (win_Class);
-
- extern class_func (npwin_Class);
- extern class_func (blwin_Class);
- extern class_func (userwin_Class);
-
- #define win_Do(win, msg, indata, outdata) \
- ((win != NULL) ? obj_Do(win, msg, indata, outdata) : FALSE)
-
- /* bob_Class doesn't really exist, trick its children with this clever macro */
- #define bob_Class(od, msg, indata, outdata) common_Class(od, msg, indata, outdata)
-
- #define bob_Do(bob, msg, indata, outdata) obj_Do(bob, msg, indata, outdata)
- /* -------------------------------------------------------------------------- */
- /* Message data types */
-
- typedef struct _winopendata {
- opbox *boxp;
- ofont_type font;
- obj_type list;
- } winopendata_struct;
-
- /* InPos query message data structure */
-
- typedef struct _inposdata {
- win_type win;
- opbox inbox; /* box for win contents field relative to window */
- } inposdata_struct;
-
- /* WINM_SETFLDPOS msg */
- typedef struct _winsfp {
-
- ocbox *ocboxp; /* pointer to position box */
- int pref; /* prefered box search direction */
-
- } winsfp_struct;
-
- /* Bit masks for PAINTREQ message ***/
-
- #define WPD_SENTER 0x01
- #define WPD_BORDER 0x02
- #define WPD_TEXT 0x04
- #define WPD_FIELDS 0x08
-
- /* -------------------------------------------------------------------------- */
- /* Data types */
-
- #define mouhandler_func(fname) int fname(win_type _win, int _msg, mev_struct *_mev)
- typedef mouhandler_func ((*mouhandler_fptr)); /* note: change in win struct too */
-
- #define exp_fptr class_fptr
-
- /* The bob public data structure */
-
- typedef struct _bobxd {
- common_xd cd; /* common object xdata */
-
- obj_type parent; /* parent object (if any) */
- unsigned depend:1; /* are we dependent? */
-
- unsigned noparmove:1; /* no parent move flag */
- unsigned ubit0:1; /* user bit 0 */
- unsigned ubit1:1; /* user bit 1 */
-
- short classhandle; /* handle for class_func sym (LNF) */
- /* see winfsym.h */
- } bob_xd;
-
- #define bob_getxd(bob) ((bob_xd *) obj_getxd(bob))
-
- /* The window public data structure */
-
- typedef struct _winxd {
- bob_xd bd; /* bob object xdata */
-
- unsigned employed:1; /* the employed flag */
- win_type above; /* the window above */
- win_type below; /* the window below */
-
- opbox wbox; /* the outer edges of the window */
- opbox inbox; /* the inside of the border (relative) */
- obj_type bord; /* the attached border object, if any */
- opcoord shadowx; /* x size of window shadow */
- opcoord shadowy; /* y size of window shadow */
- byte shadowattr; /* color attribute of shadow */
-
- ofont_type font;
- unsigned nullfont:1; /* Flag whether win has null font. for use */
- /* in allocating new fonts after disp mode change */
- byte attribute; /* Default window foreground/background color */
- opcoord cursx; /* Text cursor x position within window */
- opcoord cursy; /* Text cursor y position within window */
- unsigned curshide:1; /* Hide/show count for text cursor in this window */
- unsigned cudrawn:1; /* Cursor drawn flag */
- cursortype curstype; /* Cursor type for this window */
- opixval curscolor; /* Color of graphics cursor */
-
- win_type nextwin; /* Window to "go" after currently "going" win returns */
- int nextchild; /* New child or field to be current in moused window */
- mouhandler_fptr mouhandler; /* pointer to a mouse handler function */
- unsigned debounced:1; /* debouncing flag for use by mouse handler */
-
- unsigned charsize:1; /* flag for whether window must lock to char size */
- unsigned resize:1; /* resize strategy flag: when display size changes, */
- /* make window size change proportionally */
- /* (using nearest font available) or: */
- /* keep font and window size */
-
- unsigned userpaint:1; /* flag to send WINA_PAINT message to aux func */
-
- exp_fptr explode; /* Window explode function */
-
- int idmgr; /* the id of the dmgr this win belongs to */
-
- short handles[WIN_FSYM_COUNT]; /* LNF function name handles */
-
- VOID *data; /* generic data pointer */
-
- } win_xd;
-
- #define win_GetId(win) obj_GetId(win)
-
- typedef win_xd npwin_xd;
- typedef win_xd blwin_xd;
- typedef win_xd userwin_xd;
-
- /* win messages */
-
- #define WINM_ISAVE (OBJM_LASTMSG + 0) /* Initial Screen Image Save */
- #define WINM_PAINT (OBJM_LASTMSG + 1)
- #define WINM_SAVE (OBJM_LASTMSG + 2)
- #define WINM_SHADOW (OBJM_LASTMSG + 3) /* Shadow paint message */
- #define WINM_SHADOWSAVE (OBJM_LASTMSG + 4) /* Shadow paint message */
- #define WINM_DRAWCURSOR (OBJM_LASTMSG + 5)
- #define WINM_STARTCUR (OBJM_LASTMSG + 6)
- #define WINM_STOPCUR (OBJM_LASTMSG + 7)
- #define WINM_SCROLL (OBJM_LASTMSG + 8)
- #define WINM_CLEAR (OBJM_LASTMSG + 9)
- #define WINM_SETFONT (OBJM_LASTMSG + 10)
- #define WINM_EXPLODE (OBJM_LASTMSG + 11)
- #define WINM_GETINPOS (OBJM_LASTMSG + 12) /* get size & pos of contents */
- #define WINM_SCROLLREQ (OBJM_LASTMSG + 13)
- #define WINM_SETSIZE (OBJM_LASTMSG + 14)
- #define WINM_SETPOS (OBJM_LASTMSG + 15)
- #define WINM_PUTUNDER (OBJM_LASTMSG + 16)
- #define WINM_UNEMPLOY (OBJM_LASTMSG + 17) /* Unemploy a window */
- #define WINM_ICONREQ (OBJM_LASTMSG + 18)
- #define WINM_CHILDCLOSE (OBJM_LASTMSG + 19) /* Notification that a child window is closing itself */
- #define WINM_GO (OBJM_LASTMSG + 20)
-
- /* messages used by LNF */
- #define WINM_LNFGETGO (OBJM_LASTMSG + 21)
- #define WINM_LNFSETGO (OBJM_LASTMSG + 22)
- #define WINM_LNFRESET (OBJM_LASTMSG + 23)
-
- #define WINM_GOREQ (OBJM_LASTMSG + 24)
- #define WINM_PAINTREQ (OBJM_LASTMSG + 25)
- #define WINM_GETFLDPOS (OBJM_LASTMSG + 26)
- #define WINM_SETFLDPOS (OBJM_LASTMSG + 27)
-
- #define WINM_GRAB (OBJM_LASTMSG + 28)
- #define WINM_PRINT (OBJM_LASTMSG + 29)
-
- #define WINM_SETCURRCHILD (OBJM_LASTMSG + 30)
- #define WINM_GETCHILDNO (OBJM_LASTMSG + 31)
-
- #define WINM_LASTMSG (OBJM_LASTMSG + 100)
- /* -------------------------------------------------------------------------- */
- /* Request funcs */
- extern classinit_func (win_LoadInit);
- extern classinit_func (win_SaveInit);
- /* -------------------------------------------------------------------------- */
- #endif
-
-