home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource1 / program3 / pmord.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-23  |  30KB  |  932 lines

  1. {| Unit: pmord
  2.  | Version: 1.00
  3.  | translated from file pmord.H
  4.  | Original translation: Peter Sawatzki (ps)
  5.  | Contributing:
  6.  |   (fill in)
  7.  |
  8.  | change history:
  9.  | Date:    Ver: Author:
  10.  | 11/19/93 1.00 ps     original translation by ps
  11. }
  12. Unit pmord;
  13. Interface
  14. Uses
  15.   Os2Def,
  16.   PmGpi;
  17. {***************************** Module Header ******************************\
  18. *
  19. * This is the include file which defines all the structures and constants
  20. * that can be used to build or intepret GOCA orders for the GPI
  21. *
  22. * ==========================================================================
  23. *
  24. * The orders fall into 4 categories :-
  25. *
  26. * 1) 1-byte orders
  27. *
  28. * 2) 2-byte orders    - second byte contains the value
  29. *
  30. * 3) Long orders      - second byte gives the order length, subsequent bytes
  31. *                       contain the values
  32. *
  33. * 4) Very long orders - third and fourth bytes gives the order length,
  34. *                       subsequent bytes contain the values
  35. *
  36. \**************************************************************************}
  37.  
  38. {**************************************************************************\
  39. *
  40. * Miscellaneous structures used in this file
  41. *
  42. \**************************************************************************}
  43.  
  44. { form of RECTL with shorts instead of longs }
  45.  
  46. Type
  47.   RECT1S = Record                       { rcs }
  48.     xLeft,
  49.     yBottom,
  50.     xRight,
  51.     yTop: SHORT
  52.   End;
  53.  
  54. { form of POINTL with 1 byte offsets instead of longs }
  55.   ODPOINT = Record                      { odpt }
  56.     dx,
  57.     dy: Char
  58.   End;
  59.  
  60. { form of SIZEL with shorts instead of longs }
  61.   SIZES = Record                        { sizs }
  62.     cx,
  63.     cy: SHORT
  64.   End;
  65.  
  66. { unsigned two-byte swapped integer }
  67.   SWPUSHORT = Record                    { swpus }
  68.     HiByte,
  69.     LoByte: UCHAR
  70.   End;
  71.  
  72. {**************************************************************************\
  73. *
  74. * 1-byte orders
  75. *
  76. \**************************************************************************}
  77.  
  78. { macro to tell whether this is a 1-byte order }
  79. { UNSURE #define BYTE_ORDER(oc)   ((oc)==OCODE_GNOP1 || (oc)==OCODE_GESD) }
  80.  
  81. { 1-byte order codes }
  82.  
  83. Const
  84.   OCODE_GNOP1             =  $00;                  { No-operation                }
  85.   OCODE_GESD                       =  $FF;                  { End symbol definition       }
  86.  
  87. {**************************************************************************\
  88. *
  89. * 2-byte orders
  90. *
  91. \**************************************************************************}
  92.  
  93. { definitions to help determine whether an order code is a 2-byte order }
  94.   OCODE2_1                         =  $80;
  95.   OCODE2_2                         =  $88;
  96.  
  97. { UNSURE #define SHORT_ORDER(oc)  ((((oc)^OCODE2_1)&OCODE2_2)==OCODE2_2)}
  98.  
  99. { General 2-byte order structure }
  100.  
  101. Type
  102.   ORDER = Record                        { ord }
  103.     idCode,
  104.     uchData: UCHAR
  105.   End;
  106.  
  107. { 2-byte order codes }
  108.  
  109. Const
  110.   OCODE_GBAR              =  $68;                  { Begin area                  }
  111.   OCODE_GCFIG                      =  $7D;                  { Close figure                }
  112.   OCODE_GEEL                       =  $49;                  { End element                 }
  113.   OCODE_GEPTH                      =  $7F;                  { End path                    }
  114.   OCODE_GEPROL                     =  $3E;                  { End prologue                }
  115.   OCODE_GPOP                       =  $3F;                  { Pop                         }
  116.   OCODE_GSBMX                      =  $0D;                  { Set background mix          }
  117.   OCODE_GPSBMX                     =  $4D;                  { Push & set b/g mix          }
  118.   OCODE_GSCD                       =  $3A;                  { Set char direction          }
  119.   OCODE_GPSCD                      =  $7A;                  { Push & set char direction   }
  120.   OCODE_GSCR                       =  $39;                  { Set char precision          }
  121.   OCODE_GPSCR                      =  $79;                  { Push & set char precision   }
  122.   OCODE_GSCS                       =  $38;                  { Set char set                }
  123.   OCODE_GPSCS                      =  $78;                  { Push & set char set         }
  124.   OCODE_GSCOL                      =  $0A;                  { Set color                   }
  125.   OCODE_GPSCOL                     =  $4A;                  { Push & set color            }
  126.   OCODE_GSLE                       =  $1A;                  { Set line end                }
  127.   OCODE_GPSLE                      =  $5A;                  { Push & set line end         }
  128.   OCODE_GSLJ                       =  $1B;                  { Set line join               }
  129.   OCODE_GPSLJ                      =  $5B;                  { Push & set line join        }
  130.   OCODE_GSLT                       =  $18;                  { Set line type               }
  131.   OCODE_GPSLT                      =  $58;                  { Push & set line type        }
  132.   OCODE_GSLW                       =  $19;                  { Set line width              }
  133.   OCODE_GPSLW                      =  $59;                  { Push & set line width       }
  134.   OCODE_GSMP                       =  $3B;                  { Set marker precision        }
  135.   OCODE_GPSMP                      =  $7B;                  { Push & set marker precision }
  136.   OCODE_GSMS                       =  $3C;                  { Set marker set              }
  137.   OCODE_GPSMS                      =  $7C;                  { Push & set marker set       }
  138.   OCODE_GSMT                       =  $29;                  { Set marker symbol           }
  139.   OCODE_GPSMT                      =  $69;                  { Push & set marker symbol    }
  140.   OCODE_GSMX                       =  $0C;                  { Set mix                     }
  141.   OCODE_GPSMX                      =  $4C;                  { Push & set mix              }
  142.   OCODE_GSPS                       =  $08;                  { Set pattern set             }
  143.   OCODE_GPSPS                      =  $48;                  { Push & set pattern set      }
  144.   OCODE_GSPT                       =  $28;                  { Set pattern symbol          }
  145.   OCODE_GPSPT                      =  $09;                  { Push & set pattern symbol   }
  146.  
  147. { constants for 2-byte orders }
  148.  
  149. { Begin area }
  150.   GBAR_RESERVED                    =  $80;
  151.   GBAR_BOUNDARY                    =  $C0;
  152.   GBAR_NOBOUNDARY                  =  $80;
  153.   GBAR_WINDING                     =  $A0;
  154.   GBAR_ALTERNATE                   =  $80;
  155.  
  156. { Set Character Precision }
  157.   GSCR_PRECISION                   =  $0F;
  158.  
  159. {**************************************************************************\
  160. *
  161. * Long orders
  162. *
  163. \**************************************************************************}
  164.  
  165. { definitions to help determine whether an order code is a long order }
  166.  
  167.   OCODE_VLONG                      =  $FE;
  168.  
  169. { UNSURE #define LONG_ORDER(oc) (!((oc)==OCODE_VLONG||BYTE_ORDER(oc)||SHORT_ORDER(oc)))}
  170.  
  171. { long order structure }
  172.   LORDER_ML                        = 253;
  173.  
  174. Type
  175.   LORDER = Record                       { lord }
  176.     idCode,
  177.     uchLength: UCHAR;
  178.     uchData: Array [0..LORDER_ML-1] Of UCHAR
  179.   End;
  180.  
  181. { Long orders for which the length of data is normally zero }
  182.  
  183. Const
  184.   OCODE_GEAR              =  $60;                  { End Area                    }
  185.   OCODE_GEIMG                      =  $93;                  { End Image                   }
  186.  
  187. { Long orders for which the data is contained in a type already defined }
  188.  
  189. { Character String }
  190.   OCODE_GCCHST                     = $83;                   { char string at curr posn    }
  191.   GCCHST_MC                        = 255;                   { Max len of string in bytes  }
  192.  
  193.   OCODE_GCHST                      = $C3;                   { char string at given pos    }
  194.   GCHST_SMC                        = 251;                   { Max len of string (S)       }
  195.   GCHST_LMC                        = 247;                   { Max len of string (L)       }
  196.  
  197. { Character String Move }
  198.   OCODE_GCCHSTM                    =  $B1;                  { char string