home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / BORDOBJ.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  5.7 KB  |  166 lines

  1. /*
  2.     bordobj.h
  3.  
  4.     % "public" header for border objects
  5.  
  6.     OWL 1.1
  7.     Copyright (c) 1986, 1987, by Oakland Group, Inc.
  8.     ALL RIGHTS RESERVED.
  9.  
  10.     Revision History:
  11.     -----------------
  12.      9/01/87 jmd     added NO_PROTO option
  13.      6/23/88 jmd    converted generic pointers to VOID*
  14.      7/09/88 jmd    added windows
  15.      8/08/88 jmd    added bord_FixSides
  16.      8/09/88 jmd    added new object stuff
  17.      8/13/88 jmd    changed bd_ names to bord_
  18.      9/12/88 jmd    Added in and out data to objects
  19.     10/05/88 jmd    Added BD_PROMPTLEN
  20.     11/02/88 ted    Changed to new non-window border scheme
  21.     12/04/88 jmd    moved some routines from bordod.h to here
  22.     12/16/88 jmd    Added bord_SendMsg
  23.  
  24.      3/31/89 ted    split attr into xd struct
  25.      4/10/89 jmd    added NULL test to bord_Attr
  26.      5/12/89 jmd    renamed bord_Open to win_SetBorder
  27.      5/23/89 jmd    added "border features"
  28.      5/28/89 jmd    added Shadow support
  29.      7/12/89 ted    Converted '_func' prototypes from typedef to macro.
  30.      8/04/89 jmd    added BD_TOP feature
  31.      5/28/89 jmd    moved Shadow support out.
  32. */
  33.  
  34. #include "bord.h"    /* file of all border object class function names */
  35. /* winobj.h is already included for all owl files */
  36.  
  37. extern class_func        (border_Class);
  38.  
  39. #define    bd_fptr    class_fptr        /* make it look like it does in the manual */
  40.  
  41. #define bord_Do(win, msg, indata, outdata)            \
  42.     ((win_border(win) != NULL) ? obj_Do(win_border(win), msg, indata, outdata) : 0)
  43.  
  44. /*** Border Window messages ***/
  45. /* messages used externally */
  46.  
  47. #define BDM_SETTITLE        (OBJM_LASTMSG+0)
  48. #define BDM_PROMPT            (OBJM_LASTMSG+1)
  49. #define BDM_GETFEATURE        (OBJM_LASTMSG+2)
  50. #define BDM_GETTITLE        (OBJM_LASTMSG+3)
  51. #define BDM_SETFEATURE        (OBJM_LASTMSG+4)
  52. #define BDM_SHADOW            (OBJM_LASTMSG+5)
  53.  
  54. /* messages used internally */
  55.  
  56. #define BDM_DRAW            (OBJM_LASTMSG+6)
  57. #define BDM_RESIZE            (OBJM_LASTMSG+7)
  58. #define BDM_SCROLL            (OBJM_LASTMSG+8)
  59. #define BDM_STARTMOUSE        (OBJM_LASTMSG+9)
  60. #define BDM_MOUSE            (OBJM_LASTMSG+10)
  61. #define BDM_ENDMOUSE        (OBJM_LASTMSG+11)
  62.  
  63. #define BDM_LASTMSG            (OBJM_LASTMSG+22)
  64.  
  65. /** border "mouse feature" flags (bit masks) **/
  66.  
  67. #define    BD_MOVE            0x01        
  68. #define    BD_RESIZE        0x02
  69. #define    BD_OUTLINE         0x04
  70. #define    BD_TOP             0x08
  71.  
  72. /* -------------------------------------------------------------------------- */
  73. typedef struct {
  74.     common_xd    cd;            /* common object super class */
  75.     byte        attr;        /* the border's foreground/background attribute */
  76. } border_xd;
  77.  
  78. /* Macros-------------------------------------------------------------------- */
  79. #define bord_GetId(border)            obj_GetId(border)
  80. #define bord_getxd(border)            ((border_xd *) obj_getxd(border))
  81. /* -------------------------------------------------------------------------- */
  82.  
  83. #define bord_GetAttr(win)                            \
  84.     ((win_border(win) != NULL) ? (bord_getxd(win_border(win))->attr) : 0x00)
  85.  
  86. #define bord_SetAttr(win, at)                        \
  87.     ((win_border(win) != NULL) ? (bord_getxd(win_border(win))->attr = (at), 1) : 0)
  88.  
  89. #define bord_setxdattr(bord, at)    (bord_getxd(bord)->attr = (at))
  90.  
  91. #define bord_GetPixWidth(win)        ((opcoord)opbox_GetWidth(win_pixboxp(win)))
  92. #define bord_GetPixHeight(win)        ((opcoord)opbox_GetHeight(win_pixboxp(win)))
  93.  
  94. #define bord_GetWidth(win)                            \
  95.     ((int)(bord_GetPixWidth(win)/win_GetFontWidth(win)))
  96.  
  97. #define bord_GetHeight(win)                            \
  98.     ((int)(bord_GetPixHeight(win)/win_GetFontHeight(win)))
  99.  
  100. /*    Paints all unobscured parts of win and border. */
  101. #define    bord_Paint(win)                bord_Expose(win, WINM_PAINT, NULL)
  102.  
  103. #define bord_xoffs(win)                (-win_inboxp(win)->xmin)
  104. #define bord_yoffs(win)                (-win_inboxp(win)->ymin)
  105.  
  106. #define bord_GetColOff(win)            (bord_xoffs(win)/win_GetFontWidth(win))
  107. #define bord_GetRowOff(win)            (bord_yoffs(win)/win_GetFontHeight(win))
  108.  
  109. #define bord_GetXmin(win)            (win_pixboxp(win)->xmin)
  110. #define bord_GetYmin(win)            (win_pixboxp(win)->ymin)
  111. #define bord_GetXmax(win)            (win_pixboxp(win)->xmax)
  112. #define bord_GetYmax(win)            (win_pixboxp(win)->ymax)
  113.  
  114. #define bord_GetLeftCol(win)                        \
  115.     opcoord_GetXCol(bord_GetXmin(win), win_GetFont(win))
  116. #define bord_GetTopRow(win)                            \
  117.     opcoord_GetYRow(bord_GetYmin(win), win_GetFont(win))
  118. #define bord_GetRightCol(win)                        \
  119.     (opcoord_GetXCol(bord_GetXmax(win), win_GetFont(win)) - 1)
  120. #define bord_GetBotRow(win)                            \
  121.     (opcoord_GetYRow(bord_GetYmax(win), win_GetFont(win)) - 1)
  122. /* -------------------------------------------------------------------------- */
  123. /*** Functions ***/
  124.  
  125. /* border.c */
  126. extern boolean    win_SetBorder(_arg2(win_type, class_fptr));
  127.  
  128. /* bordclos.c */
  129. extern void        bord_Close(_arg1(win_type));
  130.  
  131. /* bordsetp.c */
  132. extern void        bord_SetPosition(_arg3(win_type win, int row, int col));
  133. extern void        bord_SetPixPosition(_arg3(win_type win, opcoord xpos, opcoord ypos));
  134.  
  135. /* bordimo.c */
  136. extern void     bord_MouseInit(_arg1(void));
  137.  
  138. /* bordaux.c */
  139. extern void        bord_GetBox(_arg2(win_type win, ocbox *cboxp));
  140. extern void        bord_GetPixBox(_arg2(win_type win, opbox *boxp));
  141. extern void        bord_Expose(_arg3(win_type win, int msg, VOID *msgdata));
  142.  
  143. /* bordssds.c */
  144. extern void        bord_SetSides(_arg5(win_type, int, int, int, int));
  145. extern void        bord_SetPixSides(_arg5(win_type, opcoord, opcoord, opcoord, opcoord));
  146.  
  147. /* bordglts.c */
  148. extern void        bord_GetLights(_arg5(win_type, boolean *, boolean *, boolean *, boolean *));
  149.  
  150. /* bordgvtb.c */
  151. extern void        bord_GetVtBar(_arg5(win_type, int *, int *, boolean *, boolean *));
  152.  
  153. /* bordghzb.c */
  154. extern void        bord_GetHzBar(_arg5(win_type, int *, int *, boolean *, boolean *));
  155.  
  156. /* bordsend.c */
  157. extern int        bord_SendMsg(_arg4(win_type, int, VOID *, VOID *));
  158. extern void     bord_SetFeature(_arg2(win_type win, unsigned features));
  159.  
  160. /* borddrwt.c */
  161. extern void        bord_DrawTitle(_arg6(ptd_struct *, int, int, char *, byte, int));
  162.  
  163. /* bordout.c - see winpriv.h */
  164. /* -------------------------------------------------------------------------- */
  165.  
  166.