home *** CD-ROM | disk | FTP | other *** search
- /*
- oboxdecl.h 5/15/88
-
- % driver functions and other things that need attending to
-
- By Ted.
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 8/24/88 jmd added ocbox_FindDist
- 10/19/88 ted split out ocolmap stuff to ocmapdecl.h
- 5/09/89 ted renamed old set's to copy's, added new set's.
- 5/09/89 ted Made _point_copy a macro.
- 8/21/89 ted Changed ofont and opsize widths and heights to 'odims'.
- 8/21/89 ted Added ofontdesc_struct, font 'real' and 'req' elements.
- 9/10/89 ted Removed ofontdesc 'seriph' element.
- */
- /* -------------------------------------------------------------------------- */
- /* data types */
-
- typedef int opcoord; /* signed pixel coordinate */
- typedef unsigned odim; /* unsigned pixel dimension/distance (coord-coord) */
- typedef unsigned short oangle; /* angle measurement; units of 2pi/(USHRT_MAX+1) */
-
- typedef struct {
- opcoord width;
- opcoord height;
- short int style; /* An arbitrary indicator of increasing floweriness */
- unsigned bold:1;
- unsigned underline:1;
- unsigned outline:1;
- oangle slant; /* Font angle measured clockwise from straight up */
- } ofontdesc_struct;
-
- typedef struct ofont_struct {
- short fontid;
- ofontdesc_struct real; /* actual font description */
- ofontdesc_struct req; /* requested font description */
- } *ofont_type;
-
- typedef struct {
- int leftcol;
- int rightcol;
- int toprow;
- int botrow;
- } ocbox; /* box in char coords; width = xmax-xmin + 1 */
-
- typedef struct {
- int height;
- int width;
- } ocsize_struct;
-
- /* Character position struct */
- typedef struct {
- int row;
- int col;
- } ocpos_struct;
-
- typedef struct {
- opcoord xmin;
- opcoord xmax;
- opcoord ymin;
- opcoord ymax;
- } opbox; /* box in pixel coords; width = xmax-xmin */
-
- typedef struct {
- odim height;
- odim width;
- } opsize_struct;
-
- typedef struct {
- opcoord x;
- opcoord y;
- } opoint; /* point in pixel coords; */
- /* -------------------------------------------------------------------------- */
-
- /* opbox.c */
- extern void opbox_charcoords(_arg3(opbox *, ofont_type, ocbox *));
- extern void opbox_uncover(_arg2(opbox *, opbox *));
- extern boolean opbox_empty(_arg1(opbox *boxp));
- extern boolean opbox_ScrollVtIn(_arg2(opbox *, int));
- extern boolean opbox_ScrollHzIn(_arg2(opbox *, int));
- extern odim _box_GetWidth(_arg1(opbox *boxp));
- extern odim _box_GetHeight(_arg1(opbox *boxp));
- extern opbox * _box_copy(_arg2(opbox *dboxp, opbox *sboxp));
- extern opbox * _box_trans(_arg3(opbox *boxp, opcoord x, opcoord y));
- extern boolean _box_equal(_arg2(opbox *boxp1, opbox *boxp2));
-
- /* ocbox.c */
- extern void ocbox_pixcoords(_arg3(ocbox *, ofont_type, opbox *));
- extern int opcoord_GetYRow(_arg2(opcoord y, ofont_type font));
- extern int opcoord_GetXCol(_arg2(opcoord x, ofont_type font));
- extern void opcoord_GridRound(_arg3(opcoord *xp, opcoord *yp, ofont_type font));
- extern boolean ocbox_ScrollVtIn(_arg2(ocbox *, int));
- extern boolean ocbox_ScrollHzIn(_arg2(ocbox *, int));
-
- /* oboxclip.c */
- extern unsigned opbox_clipbox(_arg2(opbox *clipboxp, opbox *boxp));
- extern unsigned opbox_clippoint(_arg3(opbox *clipboxp, opcoord *xp, opcoord *yp));
- extern unsigned opwh_clipbox(_arg3(odim width, odim height, opbox *boxp));
- extern unsigned opwh_clippoint(_arg4(odim width, odim height, opcoord *xp, opcoord *yp));
- extern unsigned ocbox_clippos(_arg3(ocbox *cboxp, int *rowp, int *colp));
-
- /* opclipst.c */
- extern int opbox_clipstring(_arg5(opbox *winboxp, opcoord *xp, opcoord *yp, int *slenp, ofont_type font));
- /* opclipso.c */
- extern int opbox_clipstrout(_arg5(opbox *winboxp, opcoord *xp, opcoord *yp, int *slenp, ofont_type font));
- /* oboxdist.c */
- extern int ocbox_FindDist(_arg3(ocbox *, ocbox *, int));
- /* -------------------------------------------------------------------------- */
-
- #define ofont_GetWidth(font) ((font)->real.width)
- #define ofont_GetHeight(font) ((font)->real.height)
-
- #define opbox_GetWidth(boxp) _box_GetWidth(boxp)
- #define opbox_GetHeight(boxp) _box_GetHeight(boxp)
- #define opbox_copy(dboxp, sboxp) _box_copy(dboxp, sboxp)
- #define opbox_trans(boxp, xdisp, ydisp) _box_trans(boxp, xdisp, ydisp)
- #define opbox_equal(boxp1, boxp2) _box_equal(boxp1, boxp2)
- #define opbox_set(boxp, xm, ym, xx, yx) \
- ((boxp)->xmin = xm, (boxp)->xmax = xx, \
- (boxp)->ymin = ym, (boxp)->ymax = yx, (boxp))
- #define opoint_copy(pd, ps) ((pd)->x = (ps)->x,(pd)->y = (ps)->y, (pd))
-
- #define ocbox_GetWidth(cboxp) ((int)(_box_GetWidth((opbox *)cboxp) + 1))
- #define ocbox_GetHeight(cboxp) ((int)(_box_GetHeight((opbox *)cboxp) + 1))
- #define ocbox_copy(dcboxp, scboxp) \
- _box_copy((opbox *)(dcboxp), (opbox *)(scboxp))
- #define ocbox_trans(cboxp, rowd, cold) \
- _box_trans((opbox *)(cboxp), (opcoord)cold, (opcoord)rowd)
- #define ocbox_equal(cboxp1, cboxp2) _box_equal((opbox *)(cboxp1), (opbox *)(cboxp2))
- #define ocbox_set(boxp, tr, lc, br, rc) \
- ((boxp)->leftcol = lc, (boxp)->rightcol = rc, \
- (boxp)->toprow = tr, (boxp)->botrow = br, (boxp))
- /* -------------------------------------------------------------------------- */
-