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

« back to all changes in this revision

Viewing changes to fpcsrc/packages/extra/palmunits/field.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: Field.h
 
7
 *
 
8
 * Release: Palm OS SDK 4.0 (63220)
 
9
 *
 
10
 * Description:
 
11
 *   This file defines field structures and routines.
 
12
 *
 
13
 * History:
 
14
 *    August 29, 1994   Created by Art Lamb
 
15
 *
 
16
 *****************************************************************************)
 
17
unit field;
 
18
 
 
19
interface
 
20
 
 
21
uses palmos, coretraps, rect, font, window, control;
 
22
 
 
23
const
 
24
  maxFieldTextLen = $7fff;
 
25
 
 
26
// default maximun number of line the a dynamicly sizing field will expand to.
 
27
// Can be changed with FldSetMaxVisibleLines
 
28
 
 
29
  maxFieldLines = 11;
 
30
 
 
31
// kind alignment values
 
32
type
 
33
  justifications = Enum;
 
34
 
 
35
const
 
36
  leftAlign = 0;
 
37
  centerAlign = Succ(leftAlign);
 
38
  rightAlign = Succ(centerAlign);
 
39
 
 
40
type
 
41
  JustificationType = justifications;
 
42
 
 
43
const
 
44
  undoBufferSize = 100;
 
45
 
 
46
type
 
47
  UndoMode = enum;
 
48
 
 
49
const
 
50
  undoNone = 0;
 
51
  undoTyping = Succ(undoNone);
 
52
  undoBackspace = Succ(undoTyping);
 
53
  undoDelete = Succ(undoBackspace);
 
54
  undoPaste = Succ(undoDelete);
 
55
  undoCut = Succ(undoPaste);
 
56
  undoInput = Succ(undoCut);
 
57
 
 
58
type
 
59
  FieldUndoType = record
 
60
  {$ifdef ALLOW_ACCESS_TO_INTERNALS_OF_FIELDS} // These fields will not be available in the next OS release!
 
61
    mode: UndoMode;
 
62
    reserved: UInt8;
 
63
    start: UInt16;
 
64
    end_: UInt16;
 
65
    bufferLen: UInt16;
 
66
    buffer: PChar;
 
67
  {$endif}
 
68
  end;
 
69
  FieldUndoTag = FieldUndoType;
 
70
 
 
71
  FieldAttrType = record
 
72
    Bits: UInt16;
 
73
{
 
74
 UInt16 usable   :1; // Set if part of ui
 
75
 UInt16 visible   :1; // Set if drawn, used internally
 
76
 UInt16 editable  :1; // Set if editable
 
77
 UInt16 singleLine  :1; // Set if only a single line is displayed
 
78
 UInt16 hasFocus      :1;   // Set if the field has the focus
 
79
 UInt16 dynamicSize :1;   // Set if height expands as text is entered
 
80
 UInt16 insPtVisible :1; // Set if the ins pt is scolled into view
 
81
 UInt16 dirty   :1; // Set if user modified
 
82
 UInt16 underlined  :2; // text underlined mode
 
83
 UInt16 justification :2; // text alignment
 
84
 UInt16 autoShift  :1; // Set if auto case shift
 
85
 UInt16 hasScrollBar :1; // Set if the field has a scroll bar
 
86
 UInt16 numeric   :1; // Set if numeric, digits and secimal separator only
 
87
 UInt16 reserved  :1;   // Reserved for future use
 
88
}
 
89
  end;
 
90
  FieldAttrTag = FieldAttrType;
 
91
  FieldAttrPtr = ^FieldAttrType;
 
92
 
 
93
  LineInfoType = record
 
94
  {$ifdef ALLOW_ACCESS_TO_INTERNALS_OF_FIELDS} // These fields will not be available in the next OS release!
 
95
    start: UInt16;  // position in text string of first char.
 
96
    length: UInt16; // number of character in the line
 
97
  {$endif}
 
98
  end;
 
99
  LineInfoTag = LineInfoType;
 
100
  LineInfoPtr = ^LineInfoType;
 
101
 
 
102
  FieldType = record
 
103
  {$ifdef ALLOW_ACCESS_TO_INTERNALS_OF_FIELDS} // These fields will not be available in the next OS release!
 
104
    id: UInt16;
 
105
    rect: RectangleType;
 
106
    attr: FieldAttrType;
 
107
    text: PChar; // pointer to the start of text string
 
108
    textHandle: MemHandle; // block the contains the text string
 
109
    lines: LineInfoPtr;
 
110
    textLen: UInt16;
 
111
    textBlockSize: UInt16;
 
112
    maxChars: UInt16;
 
113
    selFirstPos: UInt16;
 
114
    selLastPos: UInt16;
 
115
    insPtXPos: UInt16;
 
116
    insPtYPos: UInt16;
 
117
    fontID: FontID;
 
118
    maxVisibleLines: UInt8; // added in 4.0 to support FldSetMaxVisibleLines
 
119
  {$endif}
 
120
  end;
 
121
 
 
122
  FieldPtr = ^FieldType; // deprecated, use FieldType *
 
123
 
 
124
//---------------------------------------------------------------------
 
125
// Field Functions
 
126
//---------------------------------------------------------------------
 
127
 
 
128
procedure FldCopy(const fldP: FieldPtr); syscall sysTrapFldCopy;
 
129
 
 
130
procedure FldCut(fldP: FieldPtr); syscall sysTrapFldCut;
 
131
 
 
132
procedure FldDrawField(fldP: FieldPtr); syscall sysTrapFldDrawField;
 
133
 
 
134
procedure FldEraseField(fldP: FieldPtr); syscall sysTrapFldEraseField;
 
135
 
 
136
procedure FldFreeMemory(fldP: FieldPtr); syscall sysTrapFldFreeMemory;
 
137
 
 
138
procedure FldGetBounds(const fldP: FieldPtr; rect: RectanglePtr); syscall sysTrapFldGetBounds;
 
139
 
 
140
function FldGetFont(const fldP: FieldPtr): FontID; syscall sysTrapFldGetFont;
 
141
 
 
142
procedure FldGetSelection(const fldP: FieldPtr; var startPosition, endPosition: UInt16); syscall sysTrapFldGetSelection;
 
143
 
 
144
function FldGetTextHandle(const fldP: FieldPtr): MemHandle; syscall sysTrapFldGetTextHandle;
 
145
 
 
146
function FldGetTextPtr(const fldP: FieldPtr): PChar; syscall sysTrapFldGetTextPtr;
 
147
 
 
148
function FldHandleEvent(fldP: FieldPtr; eventP: EventPtr): Boolean; syscall sysTrapFldHandleEvent;
 
149
 
 
150
procedure FldPaste(fldP: FieldPtr); syscall sysTrapFldPaste;
 
151
 
 
152
procedure FldRecalculateField(fldP: FieldPtr; redraw: Boolean); syscall sysTrapFldRecalculateField;
 
153
 
 
154
procedure FldSetBounds(fldP: FieldPtr; const rP: RectanglePtr); syscall sysTrapFldSetBounds;
 
155
 
 
156
procedure FldSetFont(fldP: FieldPtr; fontID: FontID); syscall sysTrapFldSetFont;
 
157
 
 
158
procedure FldSetText(fldP: FieldPtr; textHandle: MemHandle; offset, size: UInt16); syscall sysTrapFldSetText;
 
159
 
 
160
procedure FldSetTextHandle(fldP: FieldPtr; textHandle: MemHandle); syscall sysTrapFldSetTextHandle;
 
161
 
 
162
procedure FldSetTextPtr(fldP: FieldPtr; textP: PChar); syscall sysTrapFldSetTextPtr;
 
163
 
 
164
procedure FldSetUsable(fldP: FieldPtr; usable: Boolean); syscall sysTrapFldSetUsable;
 
165
 
 
166
procedure FldSetSelection(fldP: FieldPtr; startPosition, endPosition: UInt16); syscall sysTrapFldSetSelection;
 
167
 
 
168
procedure FldGrabFocus(fldP: FieldPtr); syscall sysTrapFldGrabFocus;
 
169
 
 
170
procedure FldReleaseFocus(fldP: FieldPtr); syscall sysTrapFldReleaseFocus;
 
171
 
 
172
function FldGetInsPtPosition(const fldP: FieldPtr): UInt16; syscall sysTrapFldGetInsPtPosition;
 
173
 
 
174
procedure FldSetInsPtPosition(fldP: FieldPtr; pos: UInt16); syscall sysTrapFldSetInsPtPosition;
 
175
 
 
176
procedure FldSetInsertionPoint(fldP: FieldPtr; pos: UInt16); syscall sysTrapFldSetInsertionPoint;
 
177
 
 
178
function FldGetScrollPosition(const fldP: FieldPtr): UInt16; syscall sysTrapFldGetScrollPosition;
 
179
 
 
180
procedure FldSetScrollPosition(fldP: FieldPtr; pos: UInt16); syscall sysTrapFldSetScrollPosition;
 
181
 
 
182
procedure FldGetScrollValues(const fldP: FieldPtr; var scrollPosP, textHeightP, fieldHeightP: UInt16); syscall sysTrapFldGetScrollValues;
 
183
 
 
184
function FldGetTextLength(const fldP: FieldPtr): UInt16; syscall sysTrapFldGetTextLength;
 
185
 
 
186
procedure FldScrollField(fldP: FieldPtr; linesToScroll: UInt16; direction: WinDirectionType); syscall sysTrapFldScrollField;
 
187
 
 
188
function FldScrollable(const fldP: FieldPtr; direction: WinDirectionType): Boolean; syscall sysTrapFldScrollable;
 
189
 
 
190
function FldGetVisibleLines(const fldP: FieldPtr): UInt16; syscall sysTrapFldGetVisibleLines;
 
191
 
 
192
function FldGetTextHeight(const fldP: FieldPtr): UInt16; syscall sysTrapFldGetTextHeight;
 
193
 
 
194
function FldCalcFieldHeight(const chars: PChar; maxWidth: UInt16): UInt16; syscall sysTrapFldCalcFieldHeight;
 
195
 
 
196
function FldWordWrap(const chars: PChar; maxWidth: Int16): UInt16; syscall sysTrapFldWordWrap;
 
197
 
 
198
procedure FldCompactText(fldP: FieldPtr); syscall sysTrapFldCompactText;
 
199
 
 
200
function FldDirty(const fldP: FieldPtr): Boolean; syscall sysTrapFldDirty;
 
201
 
 
202
procedure FldSetDirty(fldP: FieldPtr; dirty: Boolean); syscall sysTrapFldSetDirty;
 
203
 
 
204
function FldGetMaxChars(const fldP: FieldPtr): UInt16; syscall sysTrapFldGetMaxChars;
 
205
 
 
206
procedure FldSetMaxChars(fldP: FieldPtr; maxChars: UInt16); syscall sysTrapFldSetMaxChars;
 
207
 
 
208
function FldInsert(fldP: FieldPtr; const insertChars: PChar; insertLen: UInt16): Boolean; syscall sysTrapFldInsert;
 
209
 
 
210
procedure FldDelete(fldP: FieldPtr; start, end_: UInt16); syscall sysTrapFldDelete;
 
211
 
 
212
procedure FldUndo(fldP: FieldPtr); syscall sysTrapFldUndo;
 
213
 
 
214
function FldGetTextAllocatedSize(const fldP: FieldPtr): UInt16; syscall sysTrapFldGetTextAllocatedSize;
 
215
 
 
216
procedure FldSetTextAllocatedSize(fldP: FieldPtr; allocatedSize: UInt16); syscall sysTrapFldSetTextAllocatedSize;
 
217
 
 
218
procedure FldGetAttributes(const fldP: FieldPtr; attrP: FieldAttrPtr); syscall sysTrapFldGetAttributes;
 
219
 
 
220
procedure FldSetAttributes(fldP: FieldPtr; const attrP: FieldAttrPtr); syscall sysTrapFldSetAttributes;
 
221
 
 
222
procedure FldSendChangeNotification(const fldP: FieldPtr); syscall sysTrapFldSendChangeNotification;
 
223
 
 
224
procedure FldSendHeightChangeNotification(const fldP: FieldPtr; pos: UInt16; numLines: Int16); syscall sysTrapFldSendHeightChangeNotification;
 
225
 
 
226
function FldMakeFullyVisible(fldP: FieldPtr): Boolean; syscall sysTrapFldMakeFullyVisible;
 
227
 
 
228
function FldGetNumberOfBlankLines(const fldP: FieldPtr): UInt16; syscall sysTrapFldGetNumberOfBlankLines;
 
229
 
 
230
function  FldNewField(formPP: PointerPtr; id: UInt16; x, y, width, height: Coord;
 
231
                      font: FontID; maxChars: UInt32; editable, underlined, singleLine, dynamicSize: Boolean;
 
232
                      justification: JustificationType; autoShift, hasScrollBar, numeric: Boolean): FieldPtr; syscall sysTrapFldNewField;
 
233
 
 
234
// added in 4.0
 
235
procedure FldSetMaxVisibleLines(fldP: FieldPtr; maxLines: UInt8); syscall sysTrapFldSetMaxVisibleLines;
 
236
 
 
237
implementation
 
238
 
 
239
end.