home *** CD-ROM | disk | FTP | other *** search
- /*
- winobj.h
-
- % Window object definitions for basic window types
-
- 11/28/88 by Ted.
-
- OWL 1.1
- 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.
- */
-
- #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);
-
- #define win_Do(win, msg, indata, outdata) \
- ((win != NULL) ? obj_Do(win, msg, indata, outdata) : FALSE)
-
- /* -------------------------------------------------------------------------- */
- /* Message data types */
-
- typedef struct {
- opbox *boxp;
- ofont_type font;
- obj_type list;
- } winopendata_struct;
-
- /* InPos query message data structure */
-
- typedef struct {
- win_type win;
- opbox inbox; /* box for win contents field relative to window */
- } inposdata_struct;
-
- /* WINM_SETFLDPOS msg */
- typedef struct {
-
- 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) unsigned fname(_arg3(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 {
- common_xd cd; /* common object xdata */
-
- obj_type parent; /* parent object (if any) */
- unsigned depend:1; /* are we dependent? */
-
- } bob_xd;
-
- #define bob_getxd(bob) ((bob_xd *) obj_getxd(bob))
-
- /* The window public data structure */
-
- typedef struct {
- bob_xd cd; /* 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 */
- cursortype curstype; /* cursor type for this window */
-
- win_type nextwin; /* Window to "go" after currently "going" win returns */
- 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 */
-
- 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 */
-
- } win_xd;
-
- #define win_GetId(win) obj_GetId(win)
-
- typedef win_xd npwin_xd;
- typedef win_xd blwin_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_SHOWCURS (OBJM_LASTMSG + 11)
- #define WINM_HIDECURS (OBJM_LASTMSG + 12)
- #define WINM_EXPLODE (OBJM_LASTMSG + 13)
- #define WINM_GETINPOS (OBJM_LASTMSG + 14) /* get size & pos of contents */
- #define WINM_SCROLLREQ (OBJM_LASTMSG + 15)
- #define WINM_SETSIZE (OBJM_LASTMSG + 16)
- #define WINM_SETPOS (OBJM_LASTMSG + 17)
- #define WINM_PUTUNDER (OBJM_LASTMSG + 18)
- #define WINM_UNEMPLOY (OBJM_LASTMSG + 19) /* Unemploy a window */
- #define WINM_ICONREQ (OBJM_LASTMSG + 20)
- #define WINM_CHILDCLOSE (OBJM_LASTMSG + 21) /* Notification that a child window is closing itself */
- #define WINM_GO (OBJM_LASTMSG + 22)
-
- /* messages used by LNF */
- #define WINM_LNFGETGO (OBJM_LASTMSG + 23)
- #define WINM_LNFSETGO (OBJM_LASTMSG + 24)
- #define WINM_LNFRESET (OBJM_LASTMSG + 25)
-
- #define WINM_GOREQ (OBJM_LASTMSG + 26)
- #define WINM_PAINTREQ (OBJM_LASTMSG + 27)
- #define WINM_GETFLDPOS (OBJM_LASTMSG + 28)
- #define WINM_SETFLDPOS (OBJM_LASTMSG + 29)
-
- #define WINM_LASTMSG (OBJM_LASTMSG + 100)
-
- /*** bob macros ***/
-
- #define bob_Do(bob, msg, indata, outdata) obj_Do(bob, msg, indata, outdata)
-
- #define bob_GetParent(bob) (bob_getxd(bob)->parent)
- #define bob_IsDepend(bob) ((boolean) bob_getxd(bob)->depend)
-
- #define bob_SetParent(bob, parnt) (bob_getxd(bob)->parent = (parnt))
- #define bob_SetDepend(bob, d) (bob_getxd(bob)->depend = (d))
-
- #define bob_IsWin(bob) obj_Who(bob, ID_WIN)
-
- #define BOB_DEPENDENT TRUE
- #define BOB_INDEPENDENT FALSE
-
- typedef obj_type bob_type;
-
- #define win_CreateBob(win, flag) (win_SetParentClip(win, flag), (win))
-
- #define bob_Repaint(bob) win_Do(bob, WINM_PAINTREQ, NULL, NULL);
- #define bob_Pop(bob) win_UnEmploy(bob)
- #define bob_SetPosition(bob, row, col) (bord_SetPosition(bob, row, col))
-
- /*** bob functions ***/
- extern int bob_Go(_arg1(bob_type));
- extern void bob_GetSize(_arg3(bob_type, int *, int *));
- extern void bob_GetPosition(_arg3(bob_type, int *, int *));
-
- /* -------------------------------------------------------------------------- */
- /* Request func */
-
- #define win_MouseInit() bord_MouseInit()
- extern classinit_func (win_LoadInit);
- extern classinit_func (win_SaveInit);
-
- /* -------------------------------------------------------------------------- */
- #endif
-
-