home *** CD-ROM | disk | FTP | other *** search
- /*
- bordobj.h
-
- % "public" header for border objects
-
- OWL 1.1
- Copyright (c) 1986, 1987, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 9/01/87 jmd added NO_PROTO option
- 6/23/88 jmd converted generic pointers to VOID*
- 7/09/88 jmd added windows
- 8/08/88 jmd added bord_FixSides
- 8/09/88 jmd added new object stuff
- 8/13/88 jmd changed bd_ names to bord_
- 9/12/88 jmd Added in and out data to objects
- 10/05/88 jmd Added BD_PROMPTLEN
- 11/02/88 ted Changed to new non-window border scheme
- 12/04/88 jmd moved some routines from bordod.h to here
- 12/16/88 jmd Added bord_SendMsg
-
- 3/31/89 ted split attr into xd struct
- 4/10/89 jmd added NULL test to bord_Attr
- 5/12/89 jmd renamed bord_Open to win_SetBorder
- 5/23/89 jmd added "border features"
- 5/28/89 jmd added Shadow support
- 7/12/89 ted Converted '_func' prototypes from typedef to macro.
- 8/04/89 jmd added BD_TOP feature
- 5/28/89 jmd moved Shadow support out.
- */
-
- #include "bord.h" /* file of all border object class function names */
- /* winobj.h is already included for all owl files */
-
- extern class_func (border_Class);
-
- #define bd_fptr class_fptr /* make it look like it does in the manual */
-
- #define bord_Do(win, msg, indata, outdata) \
- ((win_border(win) != NULL) ? obj_Do(win_border(win), msg, indata, outdata) : 0)
-
- /*** Border Window messages ***/
- /* messages used externally */
-
- #define BDM_SETTITLE (OBJM_LASTMSG+0)
- #define BDM_PROMPT (OBJM_LASTMSG+1)
- #define BDM_GETFEATURE (OBJM_LASTMSG+2)
- #define BDM_GETTITLE (OBJM_LASTMSG+3)
- #define BDM_SETFEATURE (OBJM_LASTMSG+4)
- #define BDM_SHADOW (OBJM_LASTMSG+5)
-
- /* messages used internally */
-
- #define BDM_DRAW (OBJM_LASTMSG+6)
- #define BDM_RESIZE (OBJM_LASTMSG+7)
- #define BDM_SCROLL (OBJM_LASTMSG+8)
- #define BDM_STARTMOUSE (OBJM_LASTMSG+9)
- #define BDM_MOUSE (OBJM_LASTMSG+10)
- #define BDM_ENDMOUSE (OBJM_LASTMSG+11)
-
- #define BDM_LASTMSG (OBJM_LASTMSG+22)
-
- /** border "mouse feature" flags (bit masks) **/
-
- #define BD_MOVE 0x01
- #define BD_RESIZE 0x02
- #define BD_OUTLINE 0x04
- #define BD_TOP 0x08
-
- /* -------------------------------------------------------------------------- */
- typedef struct {
- common_xd cd; /* common object super class */
- byte attr; /* the border's foreground/background attribute */
- } border_xd;
-
- /* Macros-------------------------------------------------------------------- */
- #define bord_GetId(border) obj_GetId(border)
- #define bord_getxd(border) ((border_xd *) obj_getxd(border))
- /* -------------------------------------------------------------------------- */
-
- #define bord_GetAttr(win) \
- ((win_border(win) != NULL) ? (bord_getxd(win_border(win))->attr) : 0x00)
-
- #define bord_SetAttr(win, at) \
- ((win_border(win) != NULL) ? (bord_getxd(win_border(win))->attr = (at), 1) : 0)
-
- #define bord_setxdattr(bord, at) (bord_getxd(bord)->attr = (at))
-
- #define bord_GetPixWidth(win) ((opcoord)opbox_GetWidth(win_pixboxp(win)))
- #define bord_GetPixHeight(win) ((opcoord)opbox_GetHeight(win_pixboxp(win)))
-
- #define bord_GetWidth(win) \
- ((int)(bord_GetPixWidth(win)/win_GetFontWidth(win)))
-
- #define bord_GetHeight(win) \
- ((int)(bord_GetPixHeight(win)/win_GetFontHeight(win)))
-
- /* Paints all unobscured parts of win and border. */
- #define bord_Paint(win) bord_Expose(win, WINM_PAINT, NULL)
-
- #define bord_xoffs(win) (-win_inboxp(win)->xmin)
- #define bord_yoffs(win) (-win_inboxp(win)->ymin)
-
- #define bord_GetColOff(win) (bord_xoffs(win)/win_GetFontWidth(win))
- #define bord_GetRowOff(win) (bord_yoffs(win)/win_GetFontHeight(win))
-
- #define bord_GetXmin(win) (win_pixboxp(win)->xmin)
- #define bord_GetYmin(win) (win_pixboxp(win)->ymin)
- #define bord_GetXmax(win) (win_pixboxp(win)->xmax)
- #define bord_GetYmax(win) (win_pixboxp(win)->ymax)
-
- #define bord_GetLeftCol(win) \
- opcoord_GetXCol(bord_GetXmin(win), win_GetFont(win))
- #define bord_GetTopRow(win) \
- opcoord_GetYRow(bord_GetYmin(win), win_GetFont(win))
- #define bord_GetRightCol(win) \
- (opcoord_GetXCol(bord_GetXmax(win), win_GetFont(win)) - 1)
- #define bord_GetBotRow(win) \
- (opcoord_GetYRow(bord_GetYmax(win), win_GetFont(win)) - 1)
- /* -------------------------------------------------------------------------- */
- /*** Functions ***/
-
- /* border.c */
- extern boolean win_SetBorder(_arg2(win_type, class_fptr));
-
- /* bordclos.c */
- extern void bord_Close(_arg1(win_type));
-
- /* bordsetp.c */
- extern void bord_SetPosition(_arg3(win_type win, int row, int col));
- extern void bord_SetPixPosition(_arg3(win_type win, opcoord xpos, opcoord ypos));
-
- /* bordimo.c */
- extern void bord_MouseInit(_arg1(void));
-
- /* bordaux.c */
- extern void bord_GetBox(_arg2(win_type win, ocbox *cboxp));
- extern void bord_GetPixBox(_arg2(win_type win, opbox *boxp));
- extern void bord_Expose(_arg3(win_type win, int msg, VOID *msgdata));
-
- /* bordssds.c */
- extern void bord_SetSides(_arg5(win_type, int, int, int, int));
- extern void bord_SetPixSides(_arg5(win_type, opcoord, opcoord, opcoord, opcoord));
-
- /* bordglts.c */
- extern void bord_GetLights(_arg5(win_type, boolean *, boolean *, boolean *, boolean *));
-
- /* bordgvtb.c */
- extern void bord_GetVtBar(_arg5(win_type, int *, int *, boolean *, boolean *));
-
- /* bordghzb.c */
- extern void bord_GetHzBar(_arg5(win_type, int *, int *, boolean *, boolean *));
-
- /* bordsend.c */
- extern int bord_SendMsg(_arg4(win_type, int, VOID *, VOID *));
- extern void bord_SetFeature(_arg2(win_type win, unsigned features));
-
- /* borddrwt.c */
- extern void bord_DrawTitle(_arg6(ptd_struct *, int, int, char *, byte, int));
-
- /* bordout.c - see winpriv.h */
- /* -------------------------------------------------------------------------- */
-
-