lib/TUI/Views/Const.pm

filter: Statementstmt 100% 114 / 114 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 34 / 34 Podpod n/a totaltotal 100% 148 / 148 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/TUI/Validate/Const.pm ↑ Summary
1 package TUI::Views::Const;
2 # ABSTRACT: defines various constants used throughout views and windows
3
4 130 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 130 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 130 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 130 our $VERSION = '2.000002';
9 130 $VERSION =~ tr/_//d;
10 130 our $AUTHORITY = 'cpan:BRICKPOOL';
11
12 130 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 130 our @EXPORT_OK = qw(
14 maxViewWidth
15 );
16
17 130 our %EXPORT_TAGS = (
18
19 phaseType => [qw(
20 phFocused
21 phPreProcess
22 phPostProcess
23 )],
24
25 selectMode => [qw(
26 normalSelect
27 enterSelect
28 leaveSelect
29 )],
30
31 cmXXXX => [qw(
32 cmValid
33 cmQuit
34 cmError
35 cmMenu
36 cmClose
37 cmZoom
38 cmResize
39 cmNext
40 cmPrev
41 cmHelp
42
43 cmOK
44 cmCancel
45 cmYes
46 cmNo
47 cmDefault
48
49 cmNew
50 cmOpen
51 cmSave
52 cmSaveAs
53 cmSaveAll
54 cmChDir
55 cmDosShell
56 cmCloseAll
57
58 cmCut
59 cmCopy
60 cmPaste
61 cmUndo
62 cmClear
63 cmTile
64 cmCascade
65
66 cmReceivedFocus
67 cmReleasedFocus
68 cmCommandSetChanged
69 cmScrollBarChanged
70 cmScrollBarClicked
71 cmSelectWindowNum
72 cmListItemSelected
73
74 cmScreenChanged
75 )],
76
77 sfXXXX => [qw(
78 sfVisible
79 sfCursorVis
80 sfCursorIns
81 sfShadow
82 sfActive
83 sfSelected
84 sfFocused
85 sfDragging
86 sfDisabled
87 sfModal
88 sfDefault
89 sfExposed
90 )],
91
92 ofXXXX => [qw(
93 ofSelectable
94 ofTopSelect
95 ofFirstClick
96 ofFramed
97 ofPreProcess
98 ofPostProcess
99 ofBuffered
100 ofTileable
101 ofCenterX
102 ofCenterY
103 ofCentered
104 ofValidate
105 )],
106
107 gfXXXX => [qw(
108 gfGrowLoX
109 gfGrowLoY
110 gfGrowHiX
111 gfGrowHiY
112 gfGrowAll
113 gfGrowRel
114 gfFixed
115 )],
116
117 dmXXXX => [qw(
118 dmDragMove
119 dmDragGrow
120 dmLimitLoX
121 dmLimitLoY
122 dmLimitHiX
123 dmLimitHiY
124 dmLimitAll
125 )],
126
127 hcXXXX => [qw(
128 hcNoContext
129 hcDragging
130 )],
131
132 sbXXXX => [qw(
133 sbLeftArrow
134 sbRightArrow
135 sbPageLeft
136 sbPageRight
137 sbUpArrow
138 sbDownArrow
139 sbPageUp
140 sbPageDown
141 sbIndicator
142 sbHorizontal
143 sbVertical
144 sbHandleKeyboard
145 )],
146
147 wfXXXX => [qw(
148 wfMove
149 wfGrow
150 wfClose
151 wfZoom
152 )],
153
154 noXXXX => [qw(
155 noMenuBar
156 noDeskTop
157 noStatusLine
158 noBackground
159 noFrame
160 noViewer
161 noHistory
162 )],
163
164 wnXXXX => [qw(
165 wnNoNumber
166 )],
167
168 wpXXXX => [qw(
169 wpBlueWindow
170 wpCyanWindow
171 wpGrayWindow
172 )],
173
174 evXXXX => [qw(
175 positionalEvents
176 focusedEvents
177 )],
178
179 cpXXXX => [qw(
180 cpFrame
181 cpScroller
182 cpScrollBar
183 cpBlueWindow
184 cpCyanWindow
185 cpGrayWindow
186 cpListViewer
187 )],
188
189 );
190
191 130 ▶use TUI::Drivers::Const qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
192 evMouse
193 evKeyboard
194 evCommand
195 130 );
196
197 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
198 130 maxViewWidth => 132,
199 130 };
200
201 # Constants for phaseType
202 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
203 130 phFocused => 0,
204 phPreProcess => 1,
205 phPostProcess => 2,
206 130 };
207
208 # Constants for selectMode
209 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
210 130 normalSelect => 0,
211 enterSelect => 1,
212 leaveSelect => 2,
213 130 };
214
215 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
216 # Standard command codes
217 130 cmValid => 0,
218 cmQuit => 1,
219 cmError => 2,
220 cmMenu => 3,
221 cmClose => 4,
222 cmZoom => 5,
223 cmResize => 6,
224 cmNext => 7,
225 cmPrev => 8,
226 cmHelp => 9,
227 130 };
228
229 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
230 # TDialog standard commands
231 130 cmOK => 10,
232 cmCancel => 11,
233 cmYes => 12,
234 cmNo => 13,
235 cmDefault => 14,
236 130 };
237
238 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
239 # Standard application commands
240 130 cmNew => 30,
241 cmOpen => 31,
242 cmSave => 32,
243 cmSaveAs => 33,
244 cmSaveAll => 34,
245 cmChDir => 35,
246 cmDosShell => 36,
247 cmCloseAll => 37,
248 130 };
249
250 # TProgram messages
251 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
252 130 cmScreenChanged => 57,
253 130 };
254
255 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
256 # TView State masks
257 130 sfVisible => 0x001,
258 sfCursorVis => 0x002,
259 sfCursorIns => 0x004,
260 sfShadow => 0x008,
261 sfActive => 0x010,
262 sfSelected => 0x020,
263 sfFocused => 0x040,
264 sfDragging => 0x080,
265 sfDisabled => 0x100,
266 sfModal => 0x200,
267 sfDefault => 0x400,
268 sfExposed => 0x800,
269 130 };
270
271 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
272 # TView Option masks
273 130 ofSelectable => 0x001,
274 ofTopSelect => 0x002,
275 ofFirstClick => 0x004,
276 ofFramed => 0x008,
277 ofPreProcess => 0x010,
278 ofPostProcess => 0x020,
279 ofBuffered => 0x040,
280 ofTileable => 0x080,
281 ofCenterX => 0x100,
282 ofCenterY => 0x200,
283 ofCentered => 0x300,
284 ofValidate => 0x400,
285 130 };
286
287 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
288 # TView GrowMode masks
289 130 gfGrowLoX => 0x01,
290 gfGrowLoY => 0x02,
291 gfGrowHiX => 0x04,
292 gfGrowHiY => 0x08,
293 gfGrowAll => 0x0f,
294 gfGrowRel => 0x10,
295 gfFixed => 0x20,
296 130 };
297
298 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
299 # TView DragMode masks
300 130 dmDragMove => 0x01,
301 dmDragGrow => 0x02,
302 dmLimitLoX => 0x10,
303 dmLimitLoY => 0x20,
304 dmLimitHiX => 0x40,
305 dmLimitHiY => 0x80,
306 dmLimitAll => 0xF0,
307 130 };
308
309 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
310 # TView Help context codes
311 130 hcNoContext => 0,
312 hcDragging => 1,
313 130 };
314
315 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
316 # TScrollBar part codes
317 130 sbLeftArrow => 0,
318 sbRightArrow => 1,
319 sbPageLeft => 2,
320 sbPageRight => 3,
321 sbUpArrow => 4,
322 sbDownArrow => 5,
323 sbPageUp => 6,
324 sbPageDown => 7,
325 sbIndicator => 8,
326 130 };
327
328 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
329 # TScrollBar options for TWindow->standardScrollBar
330 130 sbHorizontal => 0x000,
331 sbVertical => 0x001,
332 sbHandleKeyboard => 0x002,
333 130 };
334
335 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
336 # TWindow Flags masks
337 130 wfMove => 0x01,
338 wfGrow => 0x02,
339 wfClose => 0x04,
340 wfZoom => 0x08,
341 130 };
342
343 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
344 # TView inhibit flags
345 130 noMenuBar => 0x0001,
346 noDeskTop => 0x0002,
347 noStatusLine => 0x0004,
348 noBackground => 0x0008,
349 noFrame => 0x0010,
350 noViewer => 0x0020,
351 noHistory => 0x0040,
352 130 };
353
354 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
355 # TWindow number constants
356 130 wnNoNumber => 0,
357 130 };
358
359 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
360 # TWindow palette entries
361 130 wpBlueWindow => 0,
362 wpCyanWindow => 1,
363 wpGrayWindow => 2,
364 130 };
365
366 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
367 # Application command codes
368 130 cmCut => 20,
369 cmCopy => 21,
370 cmPaste => 22,
371 cmUndo => 23,
372 cmClear => 24,
373 cmTile => 25,
374 cmCascade => 26,
375 130 };
376
377 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
378 # Standard messages
379 130 cmReceivedFocus => 50,
380 cmReleasedFocus => 51,
381 cmCommandSetChanged => 52,
382 130 };
383
384 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
385 # TScrollBar messages
386 130 cmScrollBarChanged => 53,
387 cmScrollBarClicked => 54,
388 130 };
389
390 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
391 # TWindow select messages
392 130 cmSelectWindowNum => 55,
393 130 };
394
395 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
396 # TListViewer messages
397 130 cmListItemSelected => 56,
398 130 };
399
400 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
401 # Event masks
402 130 positionalEvents => evMouse,
403 focusedEvents => evKeyboard | evCommand,
404 130 };
405
406 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
407 # TFrame palette
408 130 cpFrame => "\x01\x01\x02\x02\x03",
409 130 };
410
411 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
412 # cpScroller palette
413 130 cpScroller => "\x06\x07",
414 130 };
415
416 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
417 # TScrollBar palette
418 130 cpScrollBar => "\x04\x05\x05",
419 130 };
420
421 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
422 # TWindow palettes
423 130 cpBlueWindow => "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
424 cpCyanWindow => "\x10\x11\x12\x13\x14\x15\x16\x17",
425 cpGrayWindow => "\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F",
426 130 };
427
428 130 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
429 # TListViewer palette
430 130 cpListViewer => "\x1A\x1A\x1B\x1C\x1D",
431 130 };
432
433 # add all the other %EXPORT_TAGS ":class" tags to the ":all" class and
434 # @EXPORT_OK, deleting duplicates
435 {
436 130 my %seen;
437 push
438 @EXPORT_OK,
439 15600 grep {!$seen{$_}++} @{$EXPORT_TAGS{$_}}
440 130 foreach keys %EXPORT_TAGS;
441 push
442 130 @{$EXPORT_TAGS{all}},
443 @EXPORT_OK;
444 }
445
446 1
447
448 130 __END__
« lib/TUI/Validate/Const.pm ↑ Summary