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