~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to packages/extra/palmunits/window.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
(******************************************************************************
2
 
 *
3
 
 * Copyright (c) 1994-2000 Palm, Inc. or its subsidiaries.
4
 
 * All rights reserved.
5
 
 *
6
 
 * File: Window.h
7
 
 *
8
 
 * Release: Palm OS SDK 4.0 (63220)
9
 
 *
10
 
 * Description:
11
 
 *        This file defines window structures and routines that support color.
12
 
 *
13
 
 * History:
14
 
 *    January 20, 1999  Created by Bob Ebert
15
 
 *       Name  Date     Description
16
 
 *       ----  ----     -----------
17
 
 *       bob   1/20/99  Branch off WindowNew.h
18
 
 *       BS    4/20/99  Re-design of the screen driver
19
 
 *       bob   5/26/99  Cleanup/reorg
20
 
 *       jmp   12/23/99 Fix <> vs. "" problem.
21
 
 *
22
 
 *****************************************************************************)
23
 
{$MACRO ON}
24
 
unit window;
25
 
 
26
 
interface
27
 
 
28
 
uses palmos, coretraps, rect, errorbase, bitmap;
29
 
 
30
 
const
31
 
  kWinVersion = 3;
32
 
 
33
 
// enum for WinScrollRectangle
34
 
type
35
 
  WinDirectionType = Enum;
36
 
 
37
 
const
38
 
  winUp = 0;
39
 
  winDown = Succ(winUp);
40
 
  winLeft = Succ(winDown);
41
 
  winRight = Succ(winLeft);
42
 
 
43
 
// enum for WinCreateOffscreenWindow
44
 
type
45
 
  WindowFormatType = Enum;
46
 
 
47
 
const
48
 
  screenFormat = 0;
49
 
  genericFormat = Succ(screenFormat);
50
 
 
51
 
// enum for WinLockScreen
52
 
type
53
 
  WinLockInitType = Enum;
54
 
 
55
 
const
56
 
  winLockCopy = 0;
57
 
  winLockErase = Succ(winLockCopy);
58
 
  winLockDontCare = Succ(winLockErase);
59
 
 
60
 
// operations for the WinScreenMode function
61
 
type
62
 
  WinScreenModeOperation = Enum;
63
 
 
64
 
const
65
 
  winScreenModeGetDefaults = 0;
66
 
  winScreenModeGet = Succ(winScreenModeGetDefaults);
67
 
  winScreenModeSetToDefaults = Succ(winScreenModeGet);
68
 
  winScreenModeSet = Succ(winScreenModeSetToDefaults);
69
 
  winScreenModeGetSupportedDepths = Succ(winScreenModeSet);
70
 
  winScreenModeGetSupportsColor = Succ(winScreenModeGetSupportedDepths);
71
 
 
72
 
// Operations for the WinPalette function
73
 
const
74
 
  winPaletteGet = 0;
75
 
  winPaletteSet = 1;
76
 
  winPaletteSetToDefault = 2;
77
 
  winPaletteInit = 3; // for internal use only
78
 
 
79
 
// transfer modes for color drawing
80
 
type
81
 
  WinDrawOperation = Enum;
82
 
 
83
 
const
84
 
  winPaint = 0;
85
 
  winErase = Succ(winPaint);
86
 
  winMask = Succ(winErase);
87
 
  winInvert = Succ(winMask);
88
 
  winOverlay = Succ(winInvert);
89
 
  winPaintInverse = Succ(winOverlay);
90
 
  winSwap = Succ(winPaintInverse);
91
 
 
92
 
type
93
 
  PatternType = Enum;
94
 
 
95
 
const
96
 
  blackPattern = 0;
97
 
  whitePattern = Succ(blackPattern);
98
 
  grayPattern = Succ(whitePattern);
99
 
  customPattern = Succ(grayPattern);
100
 
 
101
 
const
102
 
  noPattern = blackPattern;
103
 
  grayHLinePattern = $AA;
104
 
  grayHLinePatternOdd = $55;
105
 
 
106
 
// grayUnderline means dotted current foreground color
107
 
// solidUnderline means solid current foreground color
108
 
// colorUnderline redundant, use solidUnderline instead
109
 
type
110
 
  UnderlineModeType = Enum;
111
 
 
112
 
const
113
 
  noUnderline = 0;
114
 
  grayUnderline = Succ(noUnderline);
115
 
  solidUnderline = Succ(grayUnderline);
116
 
  colorUnderline = Succ(solidUnderline);
117
 
 
118
 
const
119
 
  WinMaxSupportedDepth = 8;
120
 
  WinNumSupportedColors = 4;
121
 
 
122
 
type
123
 
  IndexedColorType = UInt8; // 1-, 2-, 4-, or 8-bit index
124
 
  CustomPatternType = array [0..7] of UInt8; // 8x8 1-bit deep pattern
125
 
  CustomPatternPtr = ^CustomPatternType;
126
 
 
127
 
// for WinPalette startIndex value, respect indexes in passed table
128
 
const
129
 
  WinUseTableIndexes = -1;
130
 
 
131
 
//-----------------------------------------------
132
 
// Draw state structures.
133
 
//-----------------------------------------------
134
 
 
135
 
type
136
 
  DrawStateType = record
137
 
  {$ifdef ALLOW_ACCESS_TO_INTERNALS_OF_WINDOWS} // These fields will not be available in the next OS release!
138
 
    transferMode: WinDrawOperation;
139
 
    pattern: PatternType;
140
 
    underlineMode: UnderlineModeType;
141
 
    fontId: FontID;
142
 
    font: FontPtr;
143
 
    patternData: CustomPatternType;
144
 
 
145
 
    // These are only valid for indexed color bitmaps
146
 
 
147
 
    foreColor: IndexedColorType;
148
 
    backColor: IndexedColorType;
149
 
    textColor: IndexedColorType;
150
 
    reserved: UInt8;
151
 
 
152
 
    // These are only valid for direct color bitmaps
153
 
    foreColorRGB: RGBColorType;
154
 
    backColorRGB: RGBColorType;
155
 
    textColorRGB: RGBColorType;
156
 
  {$endif}
157
 
  end;
158
 
 
159
 
const
160
 
  DrawStateStackSize = 5; // enough for a control in a field in a window
161
 
 
162
 
//-----------------------------------------------
163
 
// The Window Structures.
164
 
//-----------------------------------------------
165
 
 
166
 
type
167
 
  FrameBitsType = record
168
 
    case Integer of
169
 
      1: (bits: UInt16);
170
 
{
171
 
       (
172
 
          UInt16 cornerDiam  : 8;    // corner diameter, max 38
173
 
          UInt16 reserved_3  : 3;
174
 
          UInt16 threeD   : 1;    // Draw 3D button
175
 
          UInt16 shadowWidth : 2;    // Width of shadow
176
 
          UInt16 width   : 2;    // Width frame
177
 
       ) bits;
178
 
}
179
 
      2: (word: UInt16);         // IMPORTANT: INITIALIZE word to zero before setting bits!
180
 
  end;
181
 
 
182
 
  FrameType = UInt16;
183
 
 
184
 
//  Standard Frame Types
185
 
const
186
 
  noFrame        = 0;
187
 
  simpleFrame    = 1;
188
 
  rectangleFrame = 1;
189
 
  simple3DFrame  = $0012; // 3d, frame = 2
190
 
  roundFrame     = $0401; // corner = 7, frame = 1
191
 
  boldRoundFrame = $0702; // corner = 7, frame = 2
192
 
  popupFrame     = $0205; // corner = 2,  frame = 1, shadow = 1
193
 
  dialogFrame    = $0302; // corner = 3,  frame = 2
194
 
  menuFrame      = popupFrame;
195
 
 
196
 
  winDefaultDepthFlag = $FF;
197
 
 
198
 
type
199
 
  WindowFlagsType = record
200
 
  {$ifdef ALLOW_ACCESS_TO_INTERNALS_OF_WINDOWS} // These fields will not be available in the next OS release!
201
 
    Bits: UInt16;
202
 
{
203
 
 UInt16 format:1;      // window format:  0=screen mode; 1=generic mode
204
 
 UInt16 offscreen:1;   // offscreen flag: 0=onscreen ; 1=offscreen
205
 
 UInt16 modal:1;       // modal flag:     0=modeless window; 1=modal window
206
 
 UInt16 focusable:1;   // focusable flag: 0=non-focusable; 1=focusable
207
 
 UInt16 enabled:1;     // enabled flag:   0=disabled; 1=enabled
208
 
 UInt16 visible:1;     // visible flag:   0-invisible; 1=visible
209
 
 UInt16 dialog:1;      // dialog flag:    0=non-dialog; 1=dialog
210
 
 UInt16 freeBitmap:1;  // free bitmap w/window: 0=don't free, 1=free
211
 
 UInt16 reserved :8;
212
 
}
213
 
  {$endif}
214
 
  end;
215
 
 
216
 
  WindowType = record
217
 
  {$ifdef ALLOW_ACCESS_TO_INTERNALS_OF_WINDOWS} // These fields will not be available in the next OS release!
218
 
    displayWidthV20: Coord; // use WinGetDisplayExtent instead
219
 
    displayHeightV20: Coord; // use WinGetDisplayExtent instead
220
 
    displayAddrV20: Pointer; // use the drawing functions instead
221
 
    windowFlags: WindowFlagsType;
222
 
    windowBounds: RectangleType;
223
 
    clippingBounds: AbsRectType;
224
 
    bitmapP: BitmapPtr;
225
 
    frameType: FrameBitsType;
226
 
    drawStateP: ^DrawStateType; // was GraphicStatePtr
227
 
    nextWindow: ^WindowType;
228
 
  {$endif}
229
 
  end;
230
 
 
231
 
  WinPtr = ^WindowType;
232
 
  WinHandle = ^WindowType;
233
 
 
234
 
//-----------------------------------------------
235
 
//  More graphics shapes
236
 
//-----------------------------------------------
237
 
 
238
 
  WinLineType = record
239
 
    x1: Coord;
240
 
    y1: Coord;
241
 
    x2: Coord;
242
 
    y2: Coord;
243
 
  end;
244
 
  WinLinePtr = ^WinLineType;
245
 
 
246
 
// Rectangles, Points defined in Rect.h
247
 
 
248
 
//-----------------------------------------------
249
 
//  Low Memory Globals
250
 
//-----------------------------------------------
251
 
 
252
 
// This is the structure of a low memory global reserved for the Window Manager
253
 
// In GRAPHIC_VERSION_2, it held a single drawing state.  In this version, it
254
 
// holds stack information for structures that are allocated from the dynamic heap
255
 
 
256
 
  GraphicStateType = record
257
 
  {$ifdef ALLOW_ACCESS_TO_INTERNALS_OF_WINDOWS} // These fields will not be available in the next OS release!
258
 
    drawStateP: ^DrawStateType;
259
 
    drawStateStackP: ^DrawStateType;
260
 
    drawStateIndex: Int16;
261
 
    unused: UInt16; //was screenLockCount
262
 
  {$endif}
263
 
  end;
264
 
 
265
 
// ----------------------
266
 
// Window manager errors
267
 
// ----------------------
268
 
 
269
 
const
270
 
  winErrPalette = winErrorClass or 1;
271
 
 
272
 
//-----------------------------------------------
273
 
//  Macros
274
 
//-----------------------------------------------
275
 
 
276
 
// For now, the window handle is a pointer to a window structure,
277
 
// this however may change, so use the following macros.
278
 
 
279
 
function WinGetWindowPointer(winHandle: WinHandle): WinPtr;
280
 
 
281
 
function WinGetWindowHandle(winPtr: WinPtr): WinHandle;
282
 
 
283
 
//-----------------------------------------------
284
 
// Routines relating to windows management
285
 
//-----------------------------------------------
286
 
 
287
 
function WinValidateHandle(winHandle: WinHandle): Boolean; syscall sysTrapWinValidateHandle;
288
 
 
289
 
function WinCreateWindow({const} var bounds: RectangleType; frame: FrameType; modal, focusable: Boolean;
290
 
                         var error: UInt16): WinHandle; syscall sysTrapWinCreateWindow;
291
 
 
292
 
function WinCreateOffscreenWindow(width, height: Coord; format: WindowFormatType; var error: UInt16): WinHandle; syscall sysTrapWinCreateOffscreenWindow;
293
 
 
294
 
function WinCreateBitmapWindow(bitmapP: BitmapPtr; var error: UInt16): WinHandle; syscall sysTrapWinCreateBitmapWindow;
295
 
 
296
 
procedure WinDeleteWindow(winHandle: WinHandle; eraseIt: Boolean); syscall sysTrapWinDeleteWindow;
297
 
 
298
 
procedure WinInitializeWindow(winHandle: WinHandle); syscall sysTrapWinInitializeWindow;
299
 
 
300
 
procedure WinAddWindow(winHandle: WinHandle); syscall sysTrapWinAddWindow;
301
 
 
302
 
procedure WinRemoveWindow(winHandle: WinHandle); syscall sysTrapWinRemoveWindow;
303
 
 
304
 
procedure WinMoveWindowAddr(oldLocationP, newLocationP: WinPtr); syscall sysTrapWinMoveWindowAddr;
305
 
 
306
 
procedure WinSetActiveWindow(winHandle: WinHandle); syscall sysTrapWinSetActiveWindow;
307
 
 
308
 
function WinSetDrawWindow(winHandle: WinHandle): WinHandle; syscall sysTrapWinSetDrawWindow;
309
 
 
310
 
function WinGetDrawWindow: WinHandle; syscall sysTrapWinGetDrawWindow;
311
 
 
312
 
function WinGetActiveWindow: WinHandle; syscall sysTrapWinGetActiveWindow;
313
 
 
314
 
function WinGetDisplayWindow: WinHandle; syscall sysTrapWinGetDisplayWindow;
315
 
 
316
 
function WinGetFirstWindow: WinHandle; syscall sysTrapWinGetFirstWindow;
317
 
 
318
 
procedure WinEnableWindow(winHandle: WinHandle); syscall sysTrapWinEnableWindow;
319
 
 
320
 
procedure WinDisableWindow(winHandle: WinHandle); syscall sysTrapWinDisableWindow;
321
 
 
322
 
procedure WinGetWindowFrameRect(winHandle: WinHandle; var r: RectangleType); syscall sysTrapWinGetWindowFrameRect;
323
 
 
324
 
procedure WinDrawWindowFrame; syscall sysTrapWinDrawWindowFrame;
325
 
 
326
 
procedure WinEraseWindow; syscall sysTrapWinEraseWindow;
327
 
 
328
 
function WinSaveBits({const} var source: RectangleType; var error: UInt16): WinHandle; syscall sysTrapWinSaveBits;
329
 
 
330
 
procedure WinRestoreBits(winHandle: WinHandle; destX, destY: Coord); syscall sysTrapWinRestoreBits;
331
 
 
332
 
procedure WinCopyRectangle(srcWin, dstWin: WinHandle; {const} var srcRect: RectangleType;
333
 
                           destX, destY: Coord; mode: WinDrawOperation); syscall sysTrapWinCopyRectangle;
334
 
 
335
 
procedure WinScrollRectangle({const} var  rP: RectangleType; direction: WinDirectionType;
336
 
                             distance: Coord; var vacatedP: RectangleType); syscall sysTrapWinScrollRectangle;
337
 
 
338
 
procedure WinGetDisplayExtent(var extentX, extentY: Coord); syscall sysTrapWinGetDisplayExtent;
339
 
 
340
 
procedure WinGetDrawWindowBounds(var rP: RectangleType); syscall sysTrapWinGetDrawWindowBounds;
341
 
 
342
 
procedure WinGetBounds(winH: WinHandle; var rP: RectangleType); syscall sysTrapWinGetBounds;
343
 
 
344
 
procedure WinSetBounds(winHandle: WinHandle; {const} var rP: RectangleType); syscall sysTrapWinSetBounds;
345
 
 
346
 
{$ifdef ALLOW_OLD_API_NAMES}
347
 
procedure WinGetWindowBounds(var rP: RectangleType); syscall sysTrapWinGetWindowBounds;
348
 
 
349
 
procedure WinSetWindowBounds(winHandle: WinHandle; {const} var rP: RectangleType); syscall WinSetWindowBounds;
350
 
{$endif}
351
 
 
352
 
procedure WinGetWindowExtent(var extentX, extentY: Coord); syscall sysTrapWinGetWindowExtent;
353
 
 
354
 
procedure WinDisplayToWindowPt(var extentX, extentY: Coord); syscall sysTrapWinDisplayToWindowPt;
355
 
 
356
 
procedure WinWindowToDisplayPt(var extentX, extentY: Coord); syscall sysTrapWinWindowToDisplayPt;
357
 
 
358
 
function WinGetBitmap(winHandle: WinHandle): BitmapPtr; syscall sysTrapWinGetBitmap;
359
 
 
360
 
procedure WinGetClip(var rP: RectangleType); syscall sysTrapWinGetClip;
361
 
 
362
 
procedure WinSetClip({const} var rP: RectangleType); syscall sysTrapWinSetClip;
363
 
 
364
 
procedure WinResetClip; syscall sysTrapWinResetClip;
365
 
 
366
 
procedure WinClipRectangle(var rP: RectangleType); syscall sysTrapWinClipRectangle;
367
 
 
368
 
function WinModal(winHandle: WinHandle): Boolean; syscall sysTrapWinModal;
369
 
 
370
 
//-----------------------------------------------
371
 
// Routines to draw shapes or frames shapes
372
 
//-----------------------------------------------
373
 
 
374
 
// Pixel(s)
375
 
function WinGetPixel(x, y: Coord): IndexedColorType; syscall sysTrapWinGetPixel;
376
 
 
377
 
procedure WinPaintPixel(x, y: Coord); syscall sysTrapWinPaintPixel; // uses drawing mode
378
 
 
379
 
function WinGetPixelRGB (x, y: Coord; var rgbP: RGBColorType): Err; syscall sysTrapWinGetPixelRGB; // Direct color version
380
 
 
381
 
procedure WinDrawPixel(x, y: Coord); syscall sysTrapWinDrawPixel;
382
 
 
383
 
procedure WinErasePixel(x, y: Coord); syscall sysTrapWinErasePixel;
384
 
 
385
 
procedure WinInvertPixel(x, y: Coord); syscall sysTrapWinInvertPixel;
386
 
 
387
 
procedure WinPaintPixels(numPoints: UInt16; pts: PointPtr); syscall sysTrapWinPaintPixels;
388
 
 
389
 
// Line(s)
390
 
procedure WinPaintLines(numLines: UInt16; lines: WinLinePtr); syscall sysTrapWinPaintLines;
391
 
 
392
 
procedure WinPaintLine(x1, y1, x2, y2: Coord); syscall sysTrapWinPaintLine;
393
 
 
394
 
procedure WinDrawLine(x1, y1, x2, y2: Coord); syscall sysTrapWinDrawLine;
395
 
 
396
 
procedure WinDrawGrayLine(x1, y1, x2, y2: Coord); syscall sysTrapWinDrawGrayLine;
397
 
 
398
 
procedure WinEraseLine(x1, y1, x2, y2: Coord); syscall sysTrapWinEraseLine;
399
 
 
400
 
procedure WinInvertLine(x1, y1, x2, y2: Coord); syscall sysTrapWinInvertLine;
401
 
 
402
 
procedure WinFillLine(x1, y1, x2, y2: Coord); syscall sysTrapWinFillLine;
403
 
 
404
 
// Rectangle
405
 
procedure WinPaintRectangle({const} var rP: RectangleType; cornerDiam: UInt16); syscall sysTrapWinPaintRectangle;
406
 
 
407
 
procedure WinDrawRectangle({const} var rP: RectangleType; cornerDiam: UInt16); syscall sysTrapWinDrawRectangle;
408
 
 
409
 
procedure WinEraseRectangle({const} var rP: RectangleType; cornerDiam: UInt16); syscall sysTrapWinEraseRectangle;
410
 
 
411
 
procedure WinInvertRectangle({const} var rP: RectangleType; cornerDiam: UInt16); syscall sysTrapWinInvertRectangle;
412
 
 
413
 
procedure WinFillRectangle({const} var rP: RectangleType; cornerDiam: UInt16); syscall sysTrapWinFillRectangle;
414
 
 
415
 
// Rectangle frames
416
 
procedure WinPaintRectangleFrame(frame: FrameType; {const} var rP: RectangleType); syscall sysTrapWinPaintRectangleFrame;
417
 
 
418
 
procedure WinDrawRectangleFrame(frame: FrameType; {const} var rP: RectangleType); syscall sysTrapWinDrawRectangleFrame;
419
 
 
420
 
procedure WinDrawGrayRectangleFrame(frame: FrameType; {const} var rP: RectangleType); syscall sysTrapWinDrawGrayRectangleFrame;
421
 
 
422
 
procedure WinEraseRectangleFrame(frame: FrameType; {const} var rP: RectangleType); syscall sysTrapWinEraseRectangleFrame;
423
 
 
424
 
procedure WinInvertRectangleFrame(frame: FrameType; {const} var rP: RectangleType); syscall sysTrapWinInvertRectangleFrame;
425
 
 
426
 
procedure WinGetFramesRectangle(frame: FrameType; {const} var rP, obscuredRect: RectangleType); syscall sysTrapWinGetFramesRectangle;
427
 
 
428
 
// Bitmap
429
 
procedure WinDrawBitmap(bitmapP: BitmapPtr; x, y: Coord); syscall sysTrapWinDrawBitmap;
430
 
 
431
 
procedure WinPaintBitmap(bitmapP: BitmapPtr; x, y: Coord); syscall sysTrapWinPaintBitmap;
432
 
 
433
 
// Characters
434
 
procedure WinDrawChar(theChar: WChar; x, y: Coord); syscall sysTrapWinDrawChar;
435
 
 
436
 
procedure WinDrawChars(const chars: PChar; len: Int16; x, y: Coord); syscall sysTrapWinDrawChars;
437
 
 
438
 
procedure WinPaintChar(theChar: WChar; x, y: Coord); syscall sysTrapWinPaintChar;
439
 
 
440
 
procedure WinPaintChars(const chars: PChar; len: Int16; x, y: Coord); syscall sysTrapWinPaintChars;
441
 
 
442
 
procedure WinDrawInvertedChars(const chars: PChar; len: Int16; x, y: Coord); syscall sysTrapWinDrawInvertedChars;
443
 
 
444
 
procedure WinDrawTruncChars(const chars: PChar; len: Int16; x, y, maxWidth: Coord); syscall sysTrapWinDrawTruncChars;
445
 
 
446
 
procedure WinEraseChars(const chars: PChar; len: Int16; x, y: Coord); syscall sysTrapWinEraseChars;
447
 
 
448
 
procedure WinInvertChars(const chars: PChar; len: Int16; x, y: Coord); syscall sysTrapWinInvertChars;
449
 
 
450
 
function WinSetUnderlineMode(mode: UnderlineModeType): UnderlineModeType; syscall sysTrapWinSetUnderlineMode;
451
 
 
452
 
//-----------------------------------------------
453
 
// Routines for patterns and colors
454
 
//-----------------------------------------------
455
 
 
456
 
procedure WinPushDrawState; syscall sysTrapWinPushDrawState; // "save" fore, back, text color, pattern, underline mode, font
457
 
 
458
 
procedure WinPopDrawState; syscall sysTrapWinPopDrawState; // "restore" saved drawing variables
459
 
 
460
 
function WinSetDrawMode(newMode: WinDrawOperation): WinDrawOperation; syscall sysTrapWinSetDrawMode;
461
 
 
462
 
function WinSetForeColor(foreColor: IndexedColorType): IndexedColorType; syscall sysTrapWinSetForeColor;
463
 
 
464
 
function WinSetBackColor(backColor: IndexedColorType): IndexedColorType; syscall sysTrapWinSetBackColor;
465
 
 
466
 
function WinSetTextColor(textColor: IndexedColorType): IndexedColorType; syscall sysTrapWinSetTextColor;
467
 
 
468
 
// Direct color versions
469
 
procedure WinSetForeColorRGB(const newRgbP: RGBColorPtr; prevRgbP: RGBColorPtr); syscall sysTrapWinSetForeColorRGB;
470
 
 
471
 
procedure WinSetBackColorRGB(const newRgbP: RGBColorPtr; prevRgbP: RGBColorPtr); syscall sysTrapWinSetBackColorRGB;
472
 
 
473
 
procedure WinSetTextColorRGB(const newRgbP: RGBColorPtr; prevRgbP: RGBColorPtr); syscall sysTrapWinSetTextColorRGB;
474
 
 
475
 
procedure WinGetPattern(patternP: CustomPatternPtr); syscall sysTrapWinGetPattern;
476
 
 
477
 
function WinGetPatternType: PatternType; syscall sysTrapWinGetPatternType;
478
 
 
479
 
procedure WinSetPattern(const patternP: CustomPatternPtr); syscall sysTrapWinSetPattern;
480
 
 
481
 
procedure WinSetPatternType(newPattern: PatternType); syscall sysTrapWinSetPatternType;
482
 
 
483
 
function WinPalette(operation: UInt8; startIndex: Int16; paletteEntries: UInt16; tableP: RGBColorPtr): Err; syscall sysTrapWinPalette;
484
 
 
485
 
function WinRGBToIndex(const rgbP: RGBColorPtr): IndexedColorType; syscall sysTrapWinRGBToIndex;
486
 
 
487
 
procedure WinIndexToRGB(i: IndexedColorType; rgbP: RGBColorPtr); syscall sysTrapWinIndexToRGB;
488
 
 
489
 
// "obsolete" color call, supported for backwards compatibility
490
 
 
491
 
procedure WinSetColors(const newForeColorP: RGBColorPtr; oldForeColorP: RGBColorPtr;
492
 
                       const newBackColorP: RGBColorPtr; oldBackColorP: RGBColorPtr); syscall sysTrapWinSetColors;
493
 
 
494
 
 
495
 
//-----------------------------------------------
496
 
// WinScreen functions
497
 
//-----------------------------------------------
498
 
 
499
 
procedure WinScreenInit; syscall sysTrapWinScreenInit;
500
 
 
501
 
function WinScreenMode(operation: WinScreenModeOperation; var widthP, heightP, depthP: UInt32;
502
 
                       var enableColorP: Boolean): Err; syscall sysTrapWinScreenMode;
503
 
 
504
 
//-----------------------------------------------
505
 
// Screen tracking (double buffering) support
506
 
//-----------------------------------------------
507
 
 
508
 
function WinScreenLock(initMode: WinLockInitType): UInt8Ptr; syscall sysTrapWinScreenLock;
509
 
 
510
 
procedure WinScreenUnlock; syscall sysTrapWinScreenUnlock;
511
 
 
512
 
implementation
513
 
 
514
 
function WinGetWindowPointer(winHandle: WinHandle): WinPtr;
515
 
begin
516
 
  WinGetWindowPointer := winHandle;
517
 
end;
518
 
 
519
 
function WinGetWindowHandle(winPtr: WinPtr): WinHandle;
520
 
begin
521
 
  WinGetWindowHandle := winPtr
522
 
end;
523
 
 
524
 
end.
 
 
b'\\ No newline at end of file'