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 142 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 142 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 142 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 142 our $VERSION = '2.000003';
9 142 $VERSION =~ tr/_//d;
10 142 our $AUTHORITY = 'cpan:BRICKPOOL';
11
12 142 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 142 our @EXPORT_OK = qw(
14 maxViewWidth
15 );
16
17 142 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 142 ▶use TUI::Drivers::Const qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
192 evMouse
193 evKeyboard
194 evCommand
195 142 );
196
197 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
198 142 maxViewWidth => 132,
199 142 };
200
201 # Constants for phaseType
202 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
203 142 phFocused => 0,
204 phPreProcess => 1,
205 phPostProcess => 2,
206 142 };
207
208 # Constants for selectMode
209 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
210 142 normalSelect => 0,
211 enterSelect => 1,
212 leaveSelect => 2,
213 142 };
214
215 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
216 # Standard command codes
217 142 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 142 };
228
229 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
230 # TDialog standard commands
231 142 cmOK => 10,
232 cmCancel => 11,
233 cmYes => 12,
234 cmNo => 13,
235 cmDefault => 14,
236 142 };
237
238 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
239 # Standard application commands
240 142 cmNew => 30,
241 cmOpen => 31,
242 cmSave => 32,
243 cmSaveAs => 33,
244 cmSaveAll => 34,
245 cmChDir => 35,
246 cmDosShell => 36,
247 cmCloseAll => 37,
248 142 };
249
250 # TProgram messages
251 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
252 142 cmScreenChanged => 57,
253 142 };
254
255 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
256 # TView State masks
257 142 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 142 };
270
271 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
272 # TView Option masks
273 142 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 142 };
286
287 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
288 # TView GrowMode masks
289 142 gfGrowLoX => 0x01,
290 gfGrowLoY => 0x02,
291 gfGrowHiX => 0x04,
292 gfGrowHiY => 0x08,
293 gfGrowAll => 0x0f,
294 gfGrowRel => 0x10,
295 gfFixed => 0x20,
296 142 };
297
298 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
299 # TView DragMode masks
300 142 dmDragMove => 0x01,
301 dmDragGrow => 0x02,
302 dmLimitLoX => 0x10,
303 dmLimitLoY => 0x20,
304 dmLimitHiX => 0x40,
305 dmLimitHiY => 0x80,
306 dmLimitAll => 0xF0,
307 142 };
308
309 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
310 # TView Help context codes
311 142 hcNoContext => 0,
312 hcDragging => 1,
313 142 };
314
315 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
316 # TScrollBar part codes
317 142 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 142 };
327
328 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
329 # TScrollBar options for TWindow->standardScrollBar
330 142 sbHorizontal => 0x000,
331 sbVertical => 0x001,
332 sbHandleKeyboard => 0x002,
333 142 };
334
335 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
336 # TWindow Flags masks
337 142 wfMove => 0x01,
338 wfGrow => 0x02,
339 wfClose => 0x04,
340 wfZoom => 0x08,
341 142 };
342
343 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
344 # TView inhibit flags
345 142 noMenuBar => 0x0001,
346 noDeskTop => 0x0002,
347 noStatusLine => 0x0004,
348 noBackground => 0x0008,
349 noFrame => 0x0010,
350 noViewer => 0x0020,
351 noHistory => 0x0040,
352 142 };
353
354 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
355 # TWindow number constants
356 142 wnNoNumber => 0,
357 142 };
358
359 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
360 # TWindow palette entries
361 142 wpBlueWindow => 0,
362 wpCyanWindow => 1,
363 wpGrayWindow => 2,
364 142 };
365
366 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
367 # Application command codes
368 142 cmCut => 20,
369 cmCopy => 21,
370 cmPaste => 22,
371 cmUndo => 23,
372 cmClear => 24,
373 cmTile => 25,
374 cmCascade => 26,
375 142 };
376
377 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
378 # Standard messages
379 142 cmReceivedFocus => 50,
380 cmReleasedFocus => 51,
381 cmCommandSetChanged => 52,
382 142 };
383
384 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
385 # TScrollBar messages
386 142 cmScrollBarChanged => 53,
387 cmScrollBarClicked => 54,
388 142 };
389
390 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
391 # TWindow select messages
392 142 cmSelectWindowNum => 55,
393 142 };
394
395 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
396 # TListViewer messages
397 142 cmListItemSelected => 56,
398 142 };
399
400 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
401 # Event masks
402 142 positionalEvents => evMouse,
403 focusedEvents => evKeyboard | evCommand,
404 142 };
405
406 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
407 # TFrame palette
408 142 cpFrame => "\x01\x01\x02\x02\x03",
409 142 };
410
411 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
412 # cpScroller palette
413 142 cpScroller => "\x06\x07",
414 142 };
415
416 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
417 # TScrollBar palette
418 142 cpScrollBar => "\x04\x05\x05",
419 142 };
420
421 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
422 # TWindow palettes
423 142 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 142 };
427
428 142 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
429 # TListViewer palette
430 142 cpListViewer => "\x1A\x1A\x1B\x1C\x1D",
431 142 };
432
433 # add all the other %EXPORT_TAGS ":class" tags to the ":all" class and
434 # @EXPORT_OK, deleting duplicates
435 {
436 142 my %seen;
437 push
438 @EXPORT_OK,
439 17040 grep {!$seen{$_}++} @{$EXPORT_TAGS{$_}}
440 142 foreach keys %EXPORT_TAGS;
441 push
442 142 @{$EXPORT_TAGS{all}},
443 @EXPORT_OK;
444 }
445
446 1
447
448 142 __END__
« lib/TUI/Validate/Const.pm ↑ Summary