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

  1. /*
  2.     oboxdecl.h    5/15/88
  3.  
  4.     % driver functions and other things that need attending to
  5.  
  6.     By Ted.
  7.  
  8.     OWL 1.1
  9.     Copyright (c) 1988, by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.      8/24/88 jmd    added ocbox_FindDist
  15.     10/19/88 ted    split out ocolmap stuff to ocmapdecl.h
  16.      5/09/89 ted    renamed old set's to copy's, added new set's.
  17.      5/09/89 ted    Made _point_copy a macro.
  18.      8/21/89 ted    Changed ofont and opsize widths and heights to 'odims'.
  19.      8/21/89 ted    Added ofontdesc_struct, font 'real' and 'req' elements.
  20.      9/10/89 ted    Removed ofontdesc 'seriph' element.
  21. */
  22. /* -------------------------------------------------------------------------- */
  23. /* data types */
  24.  
  25. typedef int opcoord;            /* signed pixel coordinate */
  26. typedef unsigned odim;            /* unsigned pixel dimension/distance (coord-coord) */
  27. typedef unsigned short oangle;    /* angle measurement; units of 2pi/(USHRT_MAX+1) */
  28.  
  29. typedef struct {
  30.     opcoord width;
  31.     opcoord height;
  32.     short int style;    /* An arbitrary indicator of increasing floweriness */
  33.     unsigned bold:1;
  34.     unsigned underline:1;
  35.     unsigned outline:1;
  36.     oangle slant;        /* Font angle measured clockwise from straight up */
  37. } ofontdesc_struct;
  38.  
  39. typedef struct ofont_struct {
  40.     short fontid;
  41.     ofontdesc_struct real;    /* actual font description */
  42.     ofontdesc_struct req;    /* requested font description */
  43. } *ofont_type;
  44.  
  45. typedef struct {
  46.     int        leftcol;
  47.     int        rightcol;
  48.     int        toprow;
  49.     int        botrow;
  50. } ocbox;            /* box in char coords; width = xmax-xmin + 1 */
  51.  
  52. typedef struct {
  53.     int        height;
  54.     int        width;
  55. } ocsize_struct;
  56.  
  57. /* Character position struct */
  58. typedef struct {
  59.     int        row;
  60.     int        col;
  61. } ocpos_struct;
  62.  
  63. typedef struct {
  64.     opcoord    xmin;
  65.     opcoord    xmax;
  66.     opcoord    ymin;
  67.     opcoord    ymax;
  68. } opbox;            /* box in pixel coords; width = xmax-xmin */
  69.  
  70. typedef struct {
  71.     odim    height;
  72.     odim    width;
  73. } opsize_struct;
  74.  
  75. typedef struct {
  76.     opcoord    x;
  77.     opcoord    y;
  78. } opoint;            /* point in pixel coords; */
  79. /* -------------------------------------------------------------------------- */
  80.  
  81. /* opbox.c */
  82. extern void        opbox_charcoords(_arg3(opbox *, ofont_type, ocbox *));
  83. extern void        opbox_uncover(_arg2(opbox *, opbox *));
  84. extern boolean    opbox_empty(_arg1(opbox *boxp));
  85. extern boolean    opbox_ScrollVtIn(_arg2(opbox *, int));
  86. extern boolean    opbox_ScrollHzIn(_arg2(opbox *, int));
  87. extern odim        _box_GetWidth(_arg1(opbox *boxp));
  88. extern odim        _box_GetHeight(_arg1(opbox *boxp));
  89. extern opbox *    _box_copy(_arg2(opbox *dboxp, opbox *sboxp));
  90. extern opbox *    _box_trans(_arg3(opbox *boxp, opcoord x, opcoord y));
  91. extern boolean    _box_equal(_arg2(opbox *boxp1, opbox *boxp2));
  92.  
  93. /* ocbox.c */
  94. extern void        ocbox_pixcoords(_arg3(ocbox *, ofont_type, opbox *));
  95. extern int        opcoord_GetYRow(_arg2(opcoord y, ofont_type font));
  96. extern int        opcoord_GetXCol(_arg2(opcoord x, ofont_type font));
  97. extern void        opcoord_GridRound(_arg3(opcoord *xp, opcoord *yp, ofont_type font));
  98. extern boolean    ocbox_ScrollVtIn(_arg2(ocbox *, int));
  99. extern boolean    ocbox_ScrollHzIn(_arg2(ocbox *, int));
  100.  
  101. /* oboxclip.c */
  102. extern unsigned    opbox_clipbox(_arg2(opbox *clipboxp, opbox *boxp));
  103. extern unsigned    opbox_clippoint(_arg3(opbox *clipboxp, opcoord *xp, opcoord *yp));
  104. extern unsigned    opwh_clipbox(_arg3(odim width, odim height, opbox *boxp));
  105. extern unsigned    opwh_clippoint(_arg4(odim width, odim height, opcoord *xp, opcoord *yp));
  106. extern unsigned    ocbox_clippos(_arg3(ocbox *cboxp, int *rowp, int *colp));
  107.  
  108. /* opclipst.c */
  109. extern int        opbox_clipstring(_arg5(opbox *winboxp, opcoord *xp, opcoord *yp, int *slenp, ofont_type font));
  110. /* opclipso.c */
  111. extern int        opbox_clipstrout(_arg5(opbox *winboxp, opcoord *xp, opcoord *yp, int *slenp, ofont_type font));
  112. /* oboxdist.c */
  113. extern int        ocbox_FindDist(_arg3(ocbox *, ocbox *, int));
  114. /* -------------------------------------------------------------------------- */
  115.  
  116. #define ofont_GetWidth(font)            ((font)->real.width)
  117. #define ofont_GetHeight(font)            ((font)->real.height)
  118.  
  119. #define opbox_GetWidth(boxp)             _box_GetWidth(boxp)
  120. #define opbox_GetHeight(boxp)            _box_GetHeight(boxp)
  121. #define opbox_copy(dboxp, sboxp)        _box_copy(dboxp, sboxp)
  122. #define opbox_trans(boxp, xdisp, ydisp)    _box_trans(boxp, xdisp, ydisp)
  123. #define opbox_equal(boxp1, boxp2)        _box_equal(boxp1, boxp2)
  124. #define opbox_set(boxp, xm, ym, xx, yx)                \
  125.     ((boxp)->xmin = xm, (boxp)->xmax = xx,            \
  126.      (boxp)->ymin = ym, (boxp)->ymax = yx, (boxp))
  127. #define opoint_copy(pd, ps)                ((pd)->x = (ps)->x,(pd)->y = (ps)->y, (pd))
  128.  
  129. #define ocbox_GetWidth(cboxp)            ((int)(_box_GetWidth((opbox *)cboxp) + 1))
  130. #define ocbox_GetHeight(cboxp)            ((int)(_box_GetHeight((opbox *)cboxp) + 1))
  131. #define ocbox_copy(dcboxp, scboxp)                    \
  132.     _box_copy((opbox *)(dcboxp), (opbox *)(scboxp))
  133. #define ocbox_trans(cboxp, rowd, cold)                \
  134.     _box_trans((opbox *)(cboxp), (opcoord)cold, (opcoord)rowd)
  135. #define ocbox_equal(cboxp1, cboxp2)        _box_equal((opbox *)(cboxp1), (opbox *)(cboxp2))
  136. #define ocbox_set(boxp, tr, lc, br, rc)                \
  137.     ((boxp)->leftcol = lc, (boxp)->rightcol = rc,    \
  138.      (boxp)->toprow  = tr, (boxp)->botrow   = br, (boxp))
  139. /* -------------------------------------------------------------------------- */
  140.  
  141.