home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / INCLUDE / WINPRIV.H < prev    next >
Text File  |  1990-09-23  |  8KB  |  172 lines

  1. /*
  2.     winpriv.h
  3.  
  4.     % private definitions for windows
  5.  
  6.     3/29/88    by Ted
  7.  
  8.     OWL 1.2
  9.     Copyright (c) 1988, 1989 by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.      6/26/89 ted    Added macros for fromwin, nextwin, mousecode.
  15.      6/28/89 ted    Added macros for [un]employedhead, bot_sys/employed_win.
  16.      7/10/89 ted    Moved nextwin to window structure from wmgr.
  17.      8/10/89 ted    Added macros: win_getwinbox & win_getshadowbox.
  18.      8/18/89 ted    Added win_OpenRaw.
  19.     11/06/89 ted    Added win_TopChild function used in fixing nested paint bug.
  20.     11/27/89 ted    Moved wmgr_trapmousewin() macro to disp_GetMouseTrap() in winproto.h.
  21.     12/04/89 jmd    added cursor color
  22.  
  23.      1/08/89 ted    Added arg to win_MakeCurrent.
  24.      1/17/90 ted    Added shademsg args to _Expose functions.
  25.      3/28/90 ted    Added prototype for win_paintcursor() which used to be static.
  26.      3/28/90 ted    Added cudrawn, curshide xd macros.
  27.      3/28/90 jmd    ansi-fied
  28.      5/08/90 jmd    added underscores to func macros for vms compiler
  29.      8/08/90 ted    renamed mousecode to stuffcode.
  30.      8/27/90 ted    added nextchild stuff for offer/request mouse msgs to use.
  31.      8/30/90 ted    added wmgr_EvClaim/EvRelease macros.
  32.      9/07/90 jmd    renamed win_GetNextWin
  33.      9/23/90 ted    added wmgr_currmev macro.
  34. */
  35. /* -------------------------------------------------------------------------- */
  36. /* Macros */
  37.  
  38. #define win_setemployed(win, ef)    (win_getxd(win)->employed = (unsigned)(ef))
  39. #define win_setabove(win, ab)        (win_getxd(win)->above = (ab))
  40. #define win_setbelow(win, be)        (win_getxd(win)->below = (be))
  41.  
  42. #define win_curscolor(win)             (win_getxd(win)->curscolor)
  43. #define win_setcurscolor(win, cc)    (win_getxd(win)->curscolor = (cc))
  44.  
  45. #define win_setcurshide(win, ch)    (win_getxd(win)->curshide = (ch))
  46. #define win_curshide(win)            (win_getxd(win)->curshide)
  47. #define win_inccurshide(win)        (win_curshide(win)++)
  48. #define win_deccurshide(win)        (win_curshide(win)--)
  49.  
  50. #define win_setcudrawn(win, cd)        (win_getxd(win)->cudrawn = (unsigned)(cd))
  51. #define win_cudrawn(win)            ((boolean) win_getxd(win)->cudrawn)
  52.  
  53. #define win_getwinbox(win, boxp)                    \
  54.     (opbox_copy(boxp, win_inboxp(win)),                \
  55.      opbox_trans(boxp, win_pixboxp(win)->xmin, win_pixboxp(win)->ymin))
  56. #define win_getshadowbox(win, boxp)                    \
  57.     (opbox_copy(boxp, win_pixboxp(win)),            \
  58.      (boxp)->xmax += win_GetShadowX(win), (boxp)->ymax += win_GetShadowY(win))
  59.  
  60. #define win_setbd(win, bd)            (win_getxd(win)->bord = (bd))
  61. #define win_setfontptr(win, fn)        (win_getxd(win)->font = (fn))
  62. #define win_setattribute(win, attr)    (win_getxd(win)->attribute = (attr))
  63. #define win_setcursx(win, cx)        (win_getxd(win)->cursx = (cx))
  64. #define win_setcursy(win, cy)        (win_getxd(win)->cursy = (cy))
  65. #define win_setcurstype(win, ct)    (win_getxd(win)->curstype = (ct))
  66. #define win_setnullfont(win, nf)    (win_getxd(win)->nullfont = (nf))
  67.  
  68. #define win_DoMouse(win, msg, mev)    (*win_getxd(win)->mouhandler)(win, msg, mev)
  69.  
  70. #define win_setidmgr(win, id)        (win_getxd(win)->idmgr = id)
  71. #define win_GetNextWin(win)            (win_getxd(win)->nextwin)
  72. #define win_nextchild(win)            (win_getxd(win)->nextchild)
  73. /* -------------------------------------------------------------------------- */
  74.  
  75. #define wmgr_employedhead()            (curr_wmgr->employedhead)
  76. #define wmgr_setemployedhead(win)    (curr_wmgr->employedhead = (win))
  77. #define wmgr_unemployedhead()        (curr_wmgr->unemployedhead)
  78. #define wmgr_setunemployedhead(win)    (curr_wmgr->unemployedhead = (win))
  79. #define wmgr_botsyswin()            (curr_wmgr->bot_sys_win)
  80. #define wmgr_setbotsyswin(win)        (curr_wmgr->bot_sys_win = (win))
  81. #define wmgr_setbotemployedwin(win)    (curr_wmgr->bot_employed_win = (win))
  82.  
  83. #define wmgr_setcurrwin(win)        (curr_wmgr->currwin = (win))
  84. #define wmgr_setbackwin(win)        (curr_wmgr->backwin = (win))
  85. #define wmgr_setdispwin(win)        (curr_wmgr->dispwin = (win))
  86.  
  87. #define wmgr_lastmev()                (&curr_wmgr->lastmev)
  88. #define wmgr_currmev()                (&curr_wmgr->currmev)
  89. #define wmgr_lastmoupos()            (&curr_wmgr->lastmoupos)
  90. #define wmgr_setfromwin(fwin)        (curr_wmgr->fromwin = fwin)
  91. #define wmgr_stuffcode()            (curr_wmgr->stuffcode)
  92.  
  93. #define wmgr_SMMptr()                (curr_wmgr->SMMptr)
  94. #define wmgr_SetSMMptr(smm)            (curr_wmgr->SMMptr = (smm))
  95.  
  96. #define wmgr_SendMouseMsgs(mouposp, newcurr)            \
  97.     (*curr_wmgr->SMMptr)(mouposp, newcurr)
  98.  
  99. #define wmgr_SetReplyStash(ec)        (curr_wmgr->mousereply = (ec))
  100. #define wmgr_ReplyStash()            (curr_wmgr->mousereply)
  101. #define wmgr_SetInMouse(mg)            (curr_wmgr->inmousemsg = (mg))
  102. #define wmgr_InMouse()                ((boolean) curr_wmgr->inmousemsg)
  103. #define wmgr_SetNewCurrentFlag(nc)    (curr_wmgr->newcurrent = (nc))
  104. #define wmgr_NewCurrentFlag()        ((boolean) curr_wmgr->newcurrent)
  105. #define wmgr_SetWasMouse(mf)        (curr_wmgr->wasmouse = (mf))
  106. #define wmgr_SetFakeMouse(fm)        (curr_wmgr->fakemouse = (fm))
  107.  
  108. #define wmgr_EvClaim(n)            (curr_wmgr->inevcall[n]++ == 0)
  109. #define wmgr_EvRelease(n)        (--curr_wmgr->inevcall[n] == 0)
  110. #define wmgr_EvInit()            memset((VOID *) curr_wmgr->inevcall, 0, sizeof(curr_wmgr->inevcall))
  111. /* -------------------------------------------------------------------------- */
  112.  
  113. #define bordout_func(fname)        boolean fname(ptd_struct *_ptd, win_type _win, opbox *_box)
  114. typedef bordout_func ((*bordout_fptr));
  115.  
  116. OEXTERN bordout_fptr bord_drawoutfunc;
  117.  
  118. /* BORDOUT.C */
  119. extern void        bord_DrawOutline(win_type win, opbox *rectboxp);
  120. extern void        bord_EraseOutline(win_type win, opbox *rectboxp);
  121.  
  122. /* WMGRINIT.C */
  123. extern boolean    OWLPRIV wmgr_Init(class_fptr backwin);
  124. extern void        OWLPRIV wmgr_Wrapup(void);
  125.  
  126. /* WINOPEN.C */
  127. extern win_type win_OpenRaw(class_fptr winclass, winopendata_struct *wodp);
  128.  
  129. /* WINEXPOS.C */
  130. extern boolean    OWLPRIV wmgr_ExposePixBox(win_type topwin, win_type botwin, opbox *boxp, int emsg, VOID *emsgdata, int shademsg, VOID *shademsgdata);
  131. extern boolean    OWLPRIV wmgr_OpenTiler(void);
  132. extern void        OWLPRIV wmgr_CloseTiler(void);
  133.  
  134. /* WINOBJ.C */
  135. extern void OWLPRIV win_paintcursor(win_type);
  136.  
  137. /* WINOBSC.C */
  138. extern win_type OWLPRIV win_TopChild(win_type win);
  139. extern unsigned OWLPRIV win_ParentClip(win_type win, opbox *boxp, boolean doshad);
  140.  
  141. /* WINGO.C */
  142. extern win_type OWLPRIV win_MakeCurrent(win_type win, win_type *ttwinp);
  143.  
  144. /* WINLIST.C */
  145. extern win_type OWLPRIV wmgr_ListOpen(void);
  146. extern void        OWLPRIV wmgr_ListClose(win_type listtop);
  147. extern void        OWLPRIV win_ListAdd(win_type listtop, win_type win);
  148. extern void        OWLPRIV win_ListRemove(win_type win);
  149.  
  150. /* DISPINIT.C (in here because there's no more sensible place for it) */
  151. extern boolean    OWLPRIV dispsetup(dmode_fptr dmode);
  152.  
  153. /* -------------------------------------------------------------------------- */
  154.  
  155. /*    Paints the window(s) equal to or below 'win' within 'box'. */
  156. #define wmgr_PaintPixBox(win, scrboxp)                \
  157.     wmgr_ExposePixBox(win, NULL, scrboxp, WINM_PAINT, NULL, WINM_SHADOW, NULL)
  158.  
  159. /*    Paints the window(s) equal to or below 'twin' and above 'bwin' within 'box'. */
  160. #define wmgr_PaintPixLayer(twin, bwin, scrboxp)        \
  161.     wmgr_ExposePixBox(twin, bwin, scrboxp, WINM_PAINT, NULL, WINM_SHADOW, NULL)
  162.  
  163. /*    Saves the window(s) equal to or below 'win' within 'box'. */
  164. #define wmgr_SavePixBox(win, scrboxp)                \
  165.     wmgr_ExposePixBox(win, NULL, scrboxp, WINM_SAVE, NULL, WINM_SHADOWSAVE, NULL)
  166.  
  167. /*    Saves the window(s) equal to or below 'twin' and above 'bwin' within 'box'. */
  168. #define wmgr_SavePixLayer(twin, bwin, scrboxp)        \
  169.     wmgr_ExposePixBox(twin, bwin, scrboxp, WINM_SAVE, NULL, WINM_SHADOWSAVE, NULL)
  170. /* -------------------------------------------------------------------------- */
  171.  
  172.