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

« back to all changes in this revision

Viewing changes to packages/extra/palmunits/sysevtmgr.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
 
{$MACRO ON}
2
 
 
3
 
{$define Rsc := }
4
 
(******************************************************************************
5
 
 *
6
 
 * Copyright (c) 1994-2000 Palm, Inc. or its subsidiaries.
7
 
 * All rights reserved.
8
 
 *
9
 
 * File: SysEvtMgr.h
10
 
 *
11
 
 * Release: Palm OS SDK 4.0 (63220)
12
 
 *
13
 
 * Description:
14
 
 *    Header for the System Event Manager
15
 
 *
16
 
 * History:
17
 
 *    03/22/95 RM    Created by Ron Marianetti
18
 
 *    07/23/98 kwk   Changed UInt16 param in EvtEnqueueKey to WChar.
19
 
 *
20
 
 *****************************************************************************)
21
 
 
22
 
unit sysevtmgr;
23
 
 
24
 
interface
25
 
 
26
 
uses palmos, coretraps, rect, errorbase, sysevent;
27
 
 
28
 
(************************************************************
29
 
 * System Event Manager Errors
30
 
 *************************************************************)
31
 
 
32
 
const
33
 
  evtErrParamErr   = evtErrorClass or 1;
34
 
  evtErrQueueFull  = evtErrorClass or 2;
35
 
  evtErrQueueEmpty = evtErrorClass or 3;
36
 
 
37
 
(************************************************************
38
 
 * Commands for EvtSetAutoOffTimer()
39
 
 *************************************************************)
40
 
type
41
 
  EvtSetAutoOffCmd = Enum;
42
 
 
43
 
const
44
 
  SetAtLeast = 0;    // turn off in at least xxx seconds
45
 
  SetExactly = Succ(SetAtLeast);    // turn off in xxx seconds
46
 
  SetAtMost  = Succ(SetExactly);     // turn off in at most xxx seconds
47
 
  SetDefault = Succ(SetAtMost);    // change default auto-off timeout to xxx seconds
48
 
  ResetTimer = Succ(SetDefault);    // reset the timer to the default auto-off timeout
49
 
 
50
 
(************************************************************
51
 
 * Pen button info structure. This structure is used
52
 
 *  to hold the bounds of each button on the silk screen and
53
 
 *  the ascii code and modifiers byte that each will generate
54
 
 *  when tapped by the user.
55
 
 *************************************************************)
56
 
 
57
 
type
58
 
  PenBtnInfoType = record
59
 
    boundsR: RectangleType;        // bounding rectangle of button
60
 
    asciiCode: WChar;              // ascii code for key event
61
 
    keyCode: UInt16;               // virtual key code for key event
62
 
    modifiers: UInt16;             // modifiers for key event
63
 
  end;
64
 
  PenBtnInfoPtr = ^PenBtnInfoType;
65
 
 
66
 
type
67
 
  PenBtnListType = record
68
 
    numButtons: UInt16;                      // Count of number of buttons
69
 
    buttons: array [0..0] of PenBtnInfoType; // Placeholder for one or more buttons
70
 
  end;
71
 
 
72
 
(************************************************************
73
 
 * Silkscreen area info structure. An array of these structures
74
 
 * is returned by the EvtGetSilkscreenAreaList function.
75
 
 *************************************************************)
76
 
 
77
 
// Different types of rectangles on the display. For new vendor areas,
78
 
// the type should be set to the vendor's creator code, as assigned
79
 
// by 3Com's Partner Engineering group.
80
 
 
81
 
const
82
 
  silkscreenRectScreen    = Rsc('scrn');
83
 
  silkscreenRectGraffiti  = Rsc('graf');
84
 
 
85
 
// Values for SilkscreenAreaType.index if areaType = silkscreenRectGraffiti
86
 
  alphaGraffitiSilkscreenArea   = 0;
87
 
  numericGraffitiSilkscreenArea = 1;
88
 
 
89
 
// One silkscreen area. The areaType field tells us which type of
90
 
// area it is, while the index field has different meanings depending
91
 
// on the area type.
92
 
 
93
 
type
94
 
  SilkscreenAreaType = record
95
 
    bounds: RectangleType;
96
 
    areaType: UInt32; // four byte creator code.
97
 
    index: UInt16;
98
 
  end;
99
 
  SilkscreenAreaPtr = ^SilkscreenAreaType;
100
 
 
101
 
(************************************************************
102
 
 * System Event Manager procedures
103
 
 *************************************************************)
104
 
 
105
 
//-----------------------------------------------------------------
106
 
// High Level Calls
107
 
//------------------------------------------------------------------
108
 
 
109
 
function EvtSysInit: Err; syscall sysTrapEvtSysInit;
110
 
 
111
 
// Return next "System" event. This routine will send strokes to Graffiti as necessary
112
 
//  and return a key event. Otherwise, it will return a simple pen down or pen
113
 
//  up event, or put the processor to sleep for a max time of 'timeout' if
114
 
// no events are available.
115
 
procedure EvtGetSysEvent(var eventP: SysEventType; timeout: Int32); syscall sysTrapEvtGetSysEvent;
116
 
 
117
 
// Return true if there is a low level system event (pen or key) available
118
 
function EvtSysEventAvail(ignorePenUps: Boolean): Boolean; syscall sysTrapEvtSysEventAvail;
119
 
 
120
 
// Translate a stroke in the silk screen area to a key event
121
 
function EvtProcessSoftKeyStroke(var startPtP, endPtP: PointType): Err; syscall sysTrapEvtProcessSoftKeyStroke;
122
 
 
123
 
//-----------------------------------------------------------------
124
 
// Pen Queue Utilties
125
 
//------------------------------------------------------------------
126
 
 
127
 
// Replace current pen queue with another of the given size
128
 
function EvtSetPenQueuePtr(penQueueP: MemPtr; size: UInt32): Err; syscall sysTrapEvtSetPenQueuePtr;
129
 
 
130
 
// Return size of current pen queue in bytes
131
 
function EvtPenQueueSize: UInt32; syscall sysTrapEvtPenQueueSize;
132
 
 
133
 
// Flush the pen queue
134
 
function EvtFlushPenQueue: Err; syscall sysTrapEvtFlushPenQueue;
135
 
 
136
 
// Append a point to the pen queue. Passing -1 for x and y means
137
 
//  pen-up (terminate the current stroke). Called by digitizer interrupt routine
138
 
function EvtEnqueuePenPoint(var ptP: PointType): Err; syscall sysTrapEvtEnqueuePenPoint;
139
 
 
140
 
// Return the stroke info for the next stroke in the pen queue. This MUST
141
 
//  be the first call when removing a stroke from the queue
142
 
function EvtDequeuePenStrokeInfo(var startPtP, endPtP: PointType): Err; syscall sysTrapEvtDequeuePenStrokeInfo;
143
 
 
144
 
// Dequeue the next point from the pen queue. Returns non-0 if no
145
 
//  more points. The point returned will be (-1,-1) at the end
146
 
//  of the stroke.
147
 
function EvtDequeuePenPoint(var retP: PointType): Err; syscall sysTrapEvtDequeuePenPoint;
148
 
 
149
 
// Flush the entire stroke from the pen queue and dispose it
150
 
function EvtFlushNextPenStroke: Err; syscall sysTrapEvtFlushNextPenStroke;
151
 
 
152
 
//-----------------------------------------------------------------
153
 
// Key Queue Utilties
154
 
//------------------------------------------------------------------
155
 
 
156
 
// Replace current key queue with another of the given size. This routine will
157
 
//  intialize the given key queue before installing it
158
 
function EvtSetKeyQueuePtr(keyQueueP: MemPtr; size: UInt32): Err; syscall sysTrapEvtSetKeyQueuePtr;
159
 
 
160
 
// Return size of current key queue in bytes
161
 
function EvtKeyQueueSize: UInt32; syscall sysTrapEvtKeyQueueSize;
162
 
 
163
 
// Flush the key queue
164
 
function EvtFlushKeyQueue: Err; syscall sysTrapEvtFlushKeyQueue;
165
 
 
166
 
// Append a key to the key queue.
167
 
function EvtEnqueueKey(ascii: WChar; keycode, modifiers: UInt16): Err; syscall sysTrapEvtEnqueueKey;
168
 
 
169
 
// Return true of key queue empty.
170
 
function EvtKeyQueueEmpty: Boolean; syscall sysTrapEvtKeyQueueEmpty;
171
 
 
172
 
// Pop off the next key event from the key queue and fill in the given
173
 
//  event record structure. Returns non-zero if there aren't any keys in the
174
 
//  key queue. If peek is non-zero, key will be left in key queue.
175
 
function EvtDequeueKeyEvent(var eventP: SysEventType; peek: UInt16): Err; syscall sysTrapEvtDequeueKeyEvent;
176
 
 
177
 
//-----------------------------------------------------------------
178
 
// Silkscreen information calls
179
 
//------------------------------------------------------------------
180
 
 
181
 
// Return pointer to the pen based button list
182
 
function EvtGetPenBtnList(var numButtons: UInt16): PenBtnInfoPtr; syscall sysTrapEvtGetPenBtnList;
183
 
 
184
 
// Return pointer to the silkscreen area list
185
 
function EvtGetSilkscreenAreaList(var numAreas: UInt16): SilkscreenAreaPtr; syscall sysTrapEvtGetSilkscreenAreaList;
186
 
 
187
 
//-----------------------------------------------------------------
188
 
// General Utilities
189
 
//------------------------------------------------------------------
190
 
// Force the system to wake-up. This will result in a null event being
191
 
//  sent to the current app.
192
 
function EvtWakeup: Err; syscall sysTrapEvtWakeup;
193
 
 
194
 
// Force the system to wake-up. This will NOT result in a null event being
195
 
//  sent to the current app.
196
 
function EvtWakeupWithoutNilEvent: Err; syscall sysTrapEvtWakeupWithoutNilEvent;
197
 
 
198
 
// Reset the auto-off timer. This is called by the SerialLink Manager in order
199
 
//  so we don't auto-off while receiving data over the serial port.
200
 
function EvtResetAutoOffTimer: Err; syscall sysTrapEvtResetAutoOffTimer;
201
 
 
202
 
function EvtSetAutoOffTimer(cmd: EvtSetAutoOffCmd; timeout: UInt16): Err; syscall sysTrapEvtSetAutoOffTimer;
203
 
 
204
 
// Set Graffiti enabled or disabled.
205
 
procedure EvtEnableGraffiti(enable: Boolean); syscall sysTrapEvtEnableGraffiti;
206
 
 
207
 
// Force a NullEvent at or before tick
208
 
function EvtSetNullEventTick(tick: UInt32): Boolean; syscall sysTrapEvtSetNullEventTick;
209
 
 
210
 
(************************************************************
211
 
 * Assembly Function Prototypes
212
 
 *************************************************************)
213
 
 
214
 
//#define  _EvtEnqueuePenPoint ASM_SYS_TRAP(sysTrapEvtEnqueuePenPoint)
215
 
 
216
 
implementation
217
 
 
218
 
end.