home *** CD-ROM | disk | FTP | other *** search
- /*
- winpriv.h
-
- % private definitions for windows
-
- 3/29/88 by Ted
-
- OWL 1.2
- Copyright (c) 1988, 1989 by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 6/26/89 ted Added macros for fromwin, nextwin, mousecode.
- 6/28/89 ted Added macros for [un]employedhead, bot_sys/employed_win.
- 7/10/89 ted Moved nextwin to window structure from wmgr.
- 8/10/89 ted Added macros: win_getwinbox & win_getshadowbox.
- 8/18/89 ted Added win_OpenRaw.
- 11/06/89 ted Added win_TopChild function used in fixing nested paint bug.
- 11/27/89 ted Moved wmgr_trapmousewin() macro to disp_GetMouseTrap() in winproto.h.
- 12/04/89 jmd added cursor color
-
- 1/08/89 ted Added arg to win_MakeCurrent.
- 1/17/90 ted Added shademsg args to _Expose functions.
- 3/28/90 ted Added prototype for win_paintcursor() which used to be static.
- 3/28/90 ted Added cudrawn, curshide xd macros.
- 3/28/90 jmd ansi-fied
- 5/08/90 jmd added underscores to func macros for vms compiler
- 8/08/90 ted renamed mousecode to stuffcode.
- 8/27/90 ted added nextchild stuff for offer/request mouse msgs to use.
- 8/30/90 ted added wmgr_EvClaim/EvRelease macros.
- 9/07/90 jmd renamed win_GetNextWin
- 9/23/90 ted added wmgr_currmev macro.
- */
- /* -------------------------------------------------------------------------- */
- /* Macros */
-
- #define win_setemployed(win, ef) (win_getxd(win)->employed = (unsigned)(ef))
- #define win_setabove(win, ab) (win_getxd(win)->above = (ab))
- #define win_setbelow(win, be) (win_getxd(win)->below = (be))
-
- #define win_curscolor(win) (win_getxd(win)->curscolor)
- #define win_setcurscolor(win, cc) (win_getxd(win)->curscolor = (cc))
-
- #define win_setcurshide(win, ch) (win_getxd(win)->curshide = (ch))
- #define win_curshide(win) (win_getxd(win)->curshide)
- #define win_inccurshide(win) (win_curshide(win)++)
- #define win_deccurshide(win) (win_curshide(win)--)
-
- #define win_setcudrawn(win, cd) (win_getxd(win)->cudrawn = (unsigned)(cd))
- #define win_cudrawn(win) ((boolean) win_getxd(win)->cudrawn)
-
- #define win_getwinbox(win, boxp) \
- (opbox_copy(boxp, win_inboxp(win)), \
- opbox_trans(boxp, win_pixboxp(win)->xmin, win_pixboxp(win)->ymin))
- #define win_getshadowbox(win, boxp) \
- (opbox_copy(boxp, win_pixboxp(win)), \
- (boxp)->xmax += win_GetShadowX(win), (boxp)->ymax += win_GetShadowY(win))
-
- #define win_setbd(win, bd) (win_getxd(win)->bord = (bd))
- #define win_setfontptr(win, fn) (win_getxd(win)->font = (fn))
- #define win_setattribute(win, attr) (win_getxd(win)->attribute = (attr))
- #define win_setcursx(win, cx) (win_getxd(win)->cursx = (cx))
- #define win_setcursy(win, cy) (win_getxd(win)->cursy = (cy))
- #define win_setcurstype(win, ct) (win_getxd(win)->curstype = (ct))
- #define win_setnullfont(win, nf) (win_getxd(win)->nullfont = (nf))
-
- #define win_DoMouse(win, msg, mev) (*win_getxd(win)->mouhandler)(win, msg, mev)
-
- #define win_setidmgr(win, id) (win_getxd(win)->idmgr = id)
- #define win_GetNextWin(win) (win_getxd(win)->nextwin)
- #define win_nextchild(win) (win_getxd(win)->nextchild)
- /* -------------------------------------------------------------------------- */
-
- #define wmgr_employedhead() (curr_wmgr->employedhead)
- #define wmgr_setemployedhead(win) (curr_wmgr->employedhead = (win))
- #define wmgr_unemployedhead() (curr_wmgr->unemployedhead)
- #define wmgr_setunemployedhead(win) (curr_wmgr->unemployedhead = (win))
- #define wmgr_botsyswin() (curr_wmgr->bot_sys_win)
- #define wmgr_setbotsyswin(win) (curr_wmgr->bot_sys_win = (win))
- #define wmgr_setbotemployedwin(win) (curr_wmgr->bot_employed_win = (win))
-
- #define wmgr_setcurrwin(win) (curr_wmgr->currwin = (win))
- #define wmgr_setbackwin(win) (curr_wmgr->backwin = (win))
- #define wmgr_setdispwin(win) (curr_wmgr->dispwin = (win))
-
- #define wmgr_lastmev() (&curr_wmgr->lastmev)
- #define wmgr_currmev() (&curr_wmgr->currmev)
- #define wmgr_lastmoupos() (&curr_wmgr->lastmoupos)
- #define wmgr_setfromwin(fwin) (curr_wmgr->fromwin = fwin)
- #define wmgr_stuffcode() (curr_wmgr->stuffcode)
-
- #define wmgr_SMMptr() (curr_wmgr->SMMptr)
- #define wmgr_SetSMMptr(smm) (curr_wmgr->SMMptr = (smm))
-
- #define wmgr_SendMouseMsgs(mouposp, newcurr) \
- (*curr_wmgr->SMMptr)(mouposp, newcurr)
-
- #define wmgr_SetReplyStash(ec) (curr_wmgr->mousereply = (ec))
- #define wmgr_ReplyStash() (curr_wmgr->mousereply)
- #define wmgr_SetInMouse(mg) (curr_wmgr->inmousemsg = (mg))
- #define wmgr_InMouse() ((boolean) curr_wmgr->inmousemsg)
- #define wmgr_SetNewCurrentFlag(nc) (curr_wmgr->newcurrent = (nc))
- #define wmgr_NewCurrentFlag() ((boolean) curr_wmgr->newcurrent)
- #define wmgr_SetWasMouse(mf) (curr_wmgr->wasmouse = (mf))
- #define wmgr_SetFakeMouse(fm) (curr_wmgr->fakemouse = (fm))
-
- #define wmgr_EvClaim(n) (curr_wmgr->inevcall[n]++ == 0)
- #define wmgr_EvRelease(n) (--curr_wmgr->inevcall[n] == 0)
- #define wmgr_EvInit() memset((VOID *) curr_wmgr->inevcall, 0, sizeof(curr_wmgr->inevcall))
- /* -------------------------------------------------------------------------- */
-
- #define bordout_func(fname) boolean fname(ptd_struct *_ptd, win_type _win, opbox *_box)
- typedef bordout_func ((*bordout_fptr));
-
- OEXTERN bordout_fptr bord_drawoutfunc;
-
- /* BORDOUT.C */
- extern void bord_DrawOutline(win_type win, opbox *rectboxp);
- extern void bord_EraseOutline(win_type win, opbox *rectboxp);
-
- /* WMGRINIT.C */
- extern boolean OWLPRIV wmgr_Init(class_fptr backwin);
- extern void OWLPRIV wmgr_Wrapup(void);
-
- /* WINOPEN.C */
- extern win_type win_OpenRaw(class_fptr winclass, winopendata_struct *wodp);
-
- /* WINEXPOS.C */
- extern boolean OWLPRIV wmgr_ExposePixBox(win_type topwin, win_type botwin, opbox *boxp, int emsg, VOID *emsgdata, int shademsg, VOID *shademsgdata);
- extern boolean OWLPRIV wmgr_OpenTiler(void);
- extern void OWLPRIV wmgr_CloseTiler(void);
-
- /* WINOBJ.C */
- extern void OWLPRIV win_paintcursor(win_type);
-
- /* WINOBSC.C */
- extern win_type OWLPRIV win_TopChild(win_type win);
- extern unsigned OWLPRIV win_ParentClip(win_type win, opbox *boxp, boolean doshad);
-
- /* WINGO.C */
- extern win_type OWLPRIV win_MakeCurrent(win_type win, win_type *ttwinp);
-
- /* WINLIST.C */
- extern win_type OWLPRIV wmgr_ListOpen(void);
- extern void OWLPRIV wmgr_ListClose(win_type listtop);
- extern void OWLPRIV win_ListAdd(win_type listtop, win_type win);
- extern void OWLPRIV win_ListRemove(win_type win);
-
- /* DISPINIT.C (in here because there's no more sensible place for it) */
- extern boolean OWLPRIV dispsetup(dmode_fptr dmode);
-
- /* -------------------------------------------------------------------------- */
-
- /* Paints the window(s) equal to or below 'win' within 'box'. */
- #define wmgr_PaintPixBox(win, scrboxp) \
- wmgr_ExposePixBox(win, NULL, scrboxp, WINM_PAINT, NULL, WINM_SHADOW, NULL)
-
- /* Paints the window(s) equal to or below 'twin' and above 'bwin' within 'box'. */
- #define wmgr_PaintPixLayer(twin, bwin, scrboxp) \
- wmgr_ExposePixBox(twin, bwin, scrboxp, WINM_PAINT, NULL, WINM_SHADOW, NULL)
-
- /* Saves the window(s) equal to or below 'win' within 'box'. */
- #define wmgr_SavePixBox(win, scrboxp) \
- wmgr_ExposePixBox(win, NULL, scrboxp, WINM_SAVE, NULL, WINM_SHADOWSAVE, NULL)
-
- /* Saves the window(s) equal to or below 'twin' and above 'bwin' within 'box'. */
- #define wmgr_SavePixLayer(twin, bwin, scrboxp) \
- wmgr_ExposePixBox(twin, bwin, scrboxp, WINM_SAVE, NULL, WINM_SHADOWSAVE, NULL)
- /* -------------------------------------------------------------------------- */
-