home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource1
/
program3
/
pmgpi.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-11-23
|
63KB
|
1,460 lines
{ **************************************************************************\
*
* Module Name: PMGPI.H
*
* OS/2 Presentation Manager GPI constants, types and function declarations
*
* Copyright (c) International Business Machines Corporation 1981, 1988-1990
*
* =============================================================================
*
* The following symbols are used in this file for conditional sections.
*
* INCL_GPI Include all of the GPI
* INCL_GPICONTROL Basic PS control
* INCL_GPICORRELATION Picking, Boundary and Correlation
* INCL_GPISEGMENTS Segment Control and Drawing
* INCL_GPISEGEDITING Segment Editing via Elements
* INCL_GPITRANSFORMS Transform and Transform Conversion
* INCL_GPIPATHS Paths and Clipping with Paths
* INCL_GPILOGCOLORTABLE Logical Color Tables
* INCL_GPIPRIMITIVES Drawing Primitives and Primitive Attributes
* INCL_GPILCIDS Phyical and Logical Fonts with Lcids
* INCL_GPIBITMAPS Bitmaps and Pel Operations
* INCL_GPIREGIONS Regions and Clipping with Regions
* INCL_GPIMETAFILES Metafiles
* INCL_GPIDEFAULTS Default Primitive Attributes
* INCL_GPIERRORS defined if INCL_ERRORS defined
*
* There is a symbol used in this file called INCL_DDIDEFS. This is used to
* include only the definitions for the DDI. The programmer using the GPI
* can ignore this symbol
*
* There is a symbol used in this file called INCL_SAADEFS. This is used to
* include only the definitions for the SAA. The programmer using the GPI
* can ignore this symbol
*
\**************************************************************************}
{| Version: 1.00
| Original translation: Peter Singer (PSi)
}
Unit PmGPI;
Interface
Uses
Os2Def;
CONST
{ General GPI return values }
GPI_ERROR = 0;
GPI_OK = 1;
GPI_ALTERROR = -1;
{ fixed point number - implicit binary point between 2 and 3 hex digits }
TYPE
FIXED = LONG; { fx }
PFIXED = ^FIXED;
{ fixed point number - implicit binary point between 1st and 2nd hex digits }
FIXED88 = USHORT; { fx88 }
{ fixed point signed number - implicit binary point between bits 14 and 13. }
{ Bit 15 is the sign bit. }
{ Thus 1.0 is represented by 16384 (0x4000) }
{ and -1.0 is represented by -16384 (0xc000) }
FIXED114 = USHORT; { fx114 }
{ make FIXED number from SHORT integer part and USHORT fractional part }
{***MC #define MAKEFIXED(intpart,fractpart) MAKELONG(fractpart,intpart)}
{ extract fractional part from a fixed quantity }
{****MC #define FIXEDFRAC(fx) (LOUSHORT(fx))}
{ extract integer part from a fixed quantity }
{****MV #define FIXEDINT(fx) ((SHORT)HIUSHORT(fx))}
{ structure for size parameters e.g. for GpiCreatePS }
TYPE
SIZEL = record { sizl }
cx,
cy: LONG;
end;
PSIZEL =^SIZEL;
CONST
{ return code on GpiQueryLogColorTable,GpiQueryRealColors and GpiQueryPel }
CLR_NOINDEX = -254;
{ units for GpiCreatePS and others }
PU_ARBITRARY = $0004;
PU_PELS = $0008;
PU_LOMETRIC = $000C;
PU_HIMETRIC = $0010;
PU_LOENGLISH = $0014;
PU_HIENGLISH = $0018;
PU_TWIPS = $001C;
{ format for GpiCreatePS }
GPIF_DEFAULT = 0;
GPIF_SHORT = $0100;
GPIF_LONG = $0200;
{ PS type for GpiCreatePS }
GPIT_NORMAL = 0;
GPIT_MICRO = $1000;
{ implicit associate flag for GpiCreatePS }
GPIA_NOASSOC = 0;
GPIA_ASSOC = $4000;
{ return error for GpiQueryDevice }
HDC_ERROR = HDC(-1);
{ common GPICONTROL functions }
Function GpiCreatePS(hab: HAB; hdc: HDC; psizlSize: PSIZEL; flOptions: ULONG): HPS;
Function GpiDestroyPS(hps: HPS): BOOL;
Function GpiAssociate(hps: HPS; hdc: HDC): BOOL;
Function GpiRestorePS(hps: HPS; lPSid: LONG): BOOL;
Function GpiSavePS(hps: HPS): LONG;
Function GpiErase(hps: HPS): BOOL;
Function GpiQueryDevice(hps: HPS): HDC;
CONST
{ options for GpiResetPS }
GRES_ATTRS = $0001;
GRES_SEGMENTS = $0002;
GRES_ALL = $0004;
{ option masks for PS options used by GpiQueryPs }
PS_UNITS = $00FC;
PS_FORMAT = $0F00;
PS_TYPE = $1000;
PS_MODE = $2000;
PS_ASSOCIATE = $4000;
PS_NORESET = $8000;
{ error context returned by GpiErrorSegmentData }
GPIE_SEGMENT = 0;
GPIE_ELEMENT = 1;
GPIE_DATA = 2;
{ control parameter for GpiSetDrawControl }
DCTL_ERASE = 1;
DCTL_DISPLAY = 2;
DCTL_BOUNDARY = 3;
DCTL_DYNAMIC = 4;
DCTL_CORRELATE = 5;
{ constants for GpiSet/QueryDrawControl }
DCTL_ERROR = -1;
DCTL_OFF = 0;
DCTL_ON = 1;
{ constants for GpiSet/QueryStopDraw }
SDW_ERROR = -1;
SDW_OFF = 0;
SDW_ON = 1;
{ drawing for GpiSet/QueryDrawingMode }
DM_ERROR = 0;
DM_DRAW = 1;
DM_RETAIN = 2;
DM_DRAWANDRETAIN = 3;
{ ** other GPICONTROL functions }
Function GpiResetPS(hps: HPS; flOptions: ULONG): BOOL;
Function GpiSetPS(hps: HPS; psizlsize: PSIZEL; flOptions: ULONG): BOOL;
Function GpiQueryPS(hps: HPS; psizlSize: PSIZEL): ULONG;
Function GpiErrorSegmentData(hps: HPS; plSegment, plContext: PLONG): LONG;
Function GpiQueryDrawControl(hps: HPS; lControl: LONG): LONG;
Function GpiSetDrawControl(hps: HPS; lControl, lValue: LONG): BOOL;
Function GpiQueryDrawingMode(hps: HPS): LONG;
Function GpiSetDrawingMode(hps: HPS; lMode: LONG): BOOL;
Function GpiQueryStopDraw(hps: HPS): LONG;
Function GpiSetStopDraw(hps: HPS; lValue: LONG): BOOL;
CONST
{ options for GpiSetPickApertureSize }
PICKAP_DEFAULT = 0;
PICKAP_REC = 2;
{ type of correlation for GpiCorrelateChain }
PICKSEL_VISIBLE = 0;
PICKSEL_ALL = 1;
{ return code to indicate correlate hit(s) }
GPI_HITS = 2;
{ ** picking, correlation and boundary functions }
Function GpiCorrelateChain(hps: HPS; lType: LONG; pptlPick: PPOINTL;
lMaxHits, lMaxDepth: LONG; pl2: PLONG): LONG;
Function GpiQueryTag(hps: HPS; plTag: PLONG): BOOL;
Function GpiSetTag(hps: HPS; lTag: LONG): BOOL;
Function GpiQueryPickApertureSize(hps: HPS; psizlSize: PSIZEL): BOOL;
Function GpiSetPickApertureSize(hps: HPS; lOptions: LONG; psizlSize: PSIZEL): BOOL;
Function GpiQueryPickAperturePosition(hps: HPS; pptlPoint: PPOINTL): BOOL;
Function GpiSetPickAperturePosition(hps: HPS; pptlPick: PPOINTL): BOOL;
Function GpiQueryBoundaryData(hps: HPS; prclBoundary: PRECTL): BOOL;
Function GpiResetBoundaryData(hps: HPS): BOOL;
Function GpiCorrelateFrom(hps: HPS; lFirstSegment, lLastSegment: LONG;
lType: LONG; pptlPick: PPOINTL;
lMaxHits, lMaxDepth: LONG; plSegTag: PLONG): LONG;
Function GpiCorrelateSegment(hps: HPS; lSegment, lType: LONG;
pptlPick: PPOINTL; lMaxHits, lMaxDepth: LONG;
alSegTag: PLONG): LONG;
CONST
{ data formats for GpiPutData and GpiGetData }
DFORM_NOCONV = 0;
DFORM_S370SHORT = 1;
DFORM_PCSHORT = 2;
DFORM_PCLONG = 4;
{ segment attributes used by GpiSet/QuerySegmentAttrs and others