home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mod201j.zip / modula2.exe / os2api / gpidef.def < prev    next >
Text File  |  1994-05-03  |  3KB  |  65 lines

  1. DEFINITION MODULE GPIDEF;
  2.  
  3. (************************************************************************
  4.   OS/2 2.0 interface for GPI general types, constants and functions.
  5.  
  6.   Copyright (c) 1992 by Juergen Neuhoff
  7. *************************************************************************)
  8.  
  9. (*$XL+       Modula-2 language extensions: '_' allowed for symbol names *)
  10. (*$CDECL+    C-style procedures                                         *)
  11. (*$A         default alignment for record fields                        *)
  12.  
  13. IMPORT SYSTEM;
  14. FROM   OS2DEF  IMPORT TYPEPREFIX;
  15.  
  16. CONST (* General GPI return values *)
  17.   GPI_ERROR      = 0;
  18.   GPI_OK         = 1;
  19.   GPI_ALTERROR   = -1;
  20.  
  21. TYPE
  22.   (* fixed point number types:                                      *)
  23.   (*                                                                *)
  24.   (* name:     description:                                         *)
  25.   (*                                                                *)
  26.   (* FIXED     implicit binary point between 2 and 3 hex digits.    *)
  27.   (* FIXED88   implicit binary point between 1st and 2nd hex digits *)
  28.   (* FIXED114  implicit binary point between bits 14 and 13.        *)
  29.   (*           Bit 15 is the sign bit.                              *)
  30.   (*           Thus 1.0 is represented by 16384 (0x4000)            *)
  31.   (*           and -1.0 is represented by -16384 (0xc000)           *)
  32.   (*                                                                *)
  33.   FIXED          = LONGINT;             (* fx *)
  34.   PFIXED         = POINTER TO FIXED;
  35.   FIXED88        = CARDINAL;            (* fx88 *)
  36.   FIXED114       = CARDINAL;            (* fx114 *)
  37.  
  38.  
  39. (* make FIXED number from SHORT integer part and USHORT fractional part *)
  40. PROCEDURE MAKEFIXED( intpart,fractpart:SYSTEM.WORD ):FIXED;
  41.  
  42. (* extract fractional part from a fixed quantity *)
  43. PROCEDURE FIXEDFRAC( fx:SYSTEM.LONGWORD ):CARDINAL;
  44.  
  45. (* extract integer part from a fixed quantity *)
  46. PROCEDURE FIXEDINT( fx:SYSTEM.LONGWORD ):INTEGER;
  47.  
  48. TYPE (* structure for size parameters e.g. for GpiCreatePS *)
  49.   SIZEL            = RECORD  (* sizl *)
  50.     CASE             : TYPEPREFIX OF
  51.     | TRUE           :
  52.       cx             : LONGINT;
  53.       cy             : LONGINT;
  54.     | FALSE          :
  55.       xSize          : LONGINT;
  56.       ySize          : LONGINT;
  57.     END;             END;
  58.   PSIZEL           = POINTER TO SIZEL;
  59.  
  60. CONST
  61.   (* return code on GpiQueryLogColorTable,GpiQueryRealColors,GpiQueryPel *)
  62.   CLR_NOINDEX      = LONGINT(-254);
  63.  
  64. END GPIDEF.
  65.