1package Prima::Const;
2use Prima '';
3use Carp;
4
5sub AUTOLOAD {
6	my ($pack,$constname) = ($AUTOLOAD =~ /^(.*)::(.*)$/);
7	my $val = eval "\&${pack}::constant(\$constname)";
8	croak $@ if $@;
9	*$AUTOLOAD = sub () { $val };
10	goto &$AUTOLOAD;
11}
12
13use strict;
14use warnings;
15
16# double lines for CPAN indexer, we don't want these packages in top-level namespace
17package
18    nt; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# notification types
19package
20    kb; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# keyboard-related constants
21package
22    km; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# keyboard modifiers
23package
24    mb; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# mouse buttons & message box constants
25package
26    ta; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# text alignment
27package
28    cl; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# colors
29
30sub from_rgb { ($_[2] & 0xff) | (($_[1] & 0xff) << 8) | (($_[0] & 0xff) << 16) }
31sub to_rgb   { (( $_[0]>>16) & 0xFF, ($_[0]>>8) & 0xFF, $_[0] & 0xFF) }
32sub from_bgr { ($_[0] & 0xff) | (($_[1] & 0xff) << 8) | (($_[2] & 0xff) << 16) }
33sub to_bgr   { ($_[0] & 0xFF, ($_[0]>>8) & 0xFF, ( $_[0]>>16) & 0xFF) }
34sub premultiply { from_rgb( map { int($_ * $_[1] / 255) } to_rgb($_[0]) ) }
35
36package
37    ci; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# color indices
38package
39    wc; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# widget classes
40package
41    cm; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# commands
42package
43    rop; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# raster operations
44
45sub blend($) { alpha(rop::DstAtop, (255 - $_[0]) x 2) }
46
47sub alpha($;$$)
48{
49	my ($rop, $src_alpha, $dst_alpha) = @_;
50
51	if (defined $src_alpha) {
52		$src_alpha =   0 if $src_alpha < 0;
53		$src_alpha = 255 if $src_alpha > 255;
54		$rop |= rop::SrcAlpha | ( $src_alpha << rop::SrcAlphaShift );
55	}
56
57	if (defined $dst_alpha) {
58		$dst_alpha =   0 if $dst_alpha < 0;
59		$dst_alpha = 255 if $dst_alpha > 255;
60		$rop |= rop::DstAlpha | ( $dst_alpha << rop::DstAlphaShift );
61	}
62
63	return $rop;
64}
65
66package
67    gm; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# grow modes
68package
69    lp; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# line pen styles
70package
71    fp; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# fill styles & font pitches
72package
73    le; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# line ends
74package
75    lj; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# line joins
76package
77    fs; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# font styles
78package
79    fw; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# font weights
80package
81    bi; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# border icons
82package
83    bs; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# border styles
84package
85    ws; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# window states
86package
87    sv; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# system values
88package
89    im; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# image types
90package
91    ictp; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# Image conversion types: dithering
92package
93    ictd; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# Image conversion types: palette optimization
94package
95    ict; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# Image conversion types
96package
97    is; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# Image statistics types
98package
99    ist; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# Image scaling types
100package
101    am; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# Icon auto masking
102package
103    apc; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# OS type
104package
105    gui; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# GUI types
106package
107    dt; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# drives types & draw_text constants
108package
109    cr; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# pointer id's
110package
111    sbmp; *AUTOLOAD =\&Prima::Const::AUTOLOAD;	# system bitmaps index
112package
113    tw; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# text wrapping constants
114package
115    fds; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# find/replace dialog scope type
116package
117    fdo; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# find/replace dialog options
118package
119    fe; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# file events
120package
121    fr; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# fetch resource constants
122package
123    mt; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# modality types
124package
125    gt; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# geometry manager types
126package
127    ps; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# paint states
128package
129    scr; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# scroll() results
130package
131    dbt; *AUTOLOAD = \&Prima::Const::AUTOLOAD;	# DeviceBitmap types
132package
133    rgnop; *AUTOLOAD = \&Prima::Const::AUTOLOAD;# Region operations
134package
135    rgn; *AUTOLOAD = \&Prima::Const::AUTOLOAD;# Region.rect_inside() results
136package
137    fm; *AUTOLOAD = \&Prima::Const::AUTOLOAD;# fill modes
138package
139    ggo; *AUTOLOAD = \&Prima::Const::AUTOLOAD;# glyph outline codes
140package
141    fv; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# font vector constants
142package
143    dnd; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# drag-and-drop constants
144
145sub is_one_action { 1 == grep { $_[0] == $_ } (dnd::Copy, dnd::Move, dnd::Link) }
146
147sub pointer
148{
149	my $action = shift;
150	if ( $action == dnd::Copy ) {
151		return cr::DragCopy;
152	} elsif ( $action == dnd::Move ) {
153		return cr::DragMove;
154	} elsif ( $action == dnd::Link ) {
155		return cr::DragLink;
156	} else {
157		return cr::DragNone;
158	}
159}
160
161sub to_one_action
162{
163	my $actions = shift;
164	return dnd::Copy if $actions & dnd::Copy;
165	return dnd::Move if $actions & dnd::Move;
166	return dnd::Link if $actions & dnd::Link;
167	return dnd::None;
168}
169
170sub keymod
171{
172	my $dnd = shift;
173	return km::Ctrl  if $dnd == dnd::Move;
174	return km::Shift if $dnd == dnd::Link;
175	return 0;
176}
177
178package
179    to; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# text-out constants
180package
181    ts; *AUTOLOAD =  \&Prima::Const::AUTOLOAD;	# text-shape constants
182
1831;
184
185=pod
186
187=head1 NAME
188
189Prima::Const - predefined constants
190
191=head1 DESCRIPTION
192
193C<Prima::Const> and L<Prima::Classes> is a minimal set of perl modules needed for
194the toolkit. Since the module provides bindings for the core constants, it is required
195to be included in every Prima-related module and program.
196
197The constants are assembled under the top-level package names, with no C<Prima::>
198prefix. This violates the perl guidelines about package naming, however, it was
199considered way too inconvenient to prefix every constant with C<Prima::> string.
200
201This document provides description of all core-coded constants. The constants
202are also described in the articles together with the corresponding methods and
203properties. For example, C<nt> constants are also described in L<Prima::Object/Flow>
204article.
205
206=head1 API
207
208=head2 am::  - Prima::Icon auto masking
209
210See also L<Prima::Image/autoMasking>
211
212	am::None           - no mask update performed
213	am::MaskColor      - mask update based on Prima::Icon::maskColor property
214	am::MaskIndex      - mask update based on Prima::Icon::maskIndex property
215	am::Auto           - mask update based on corner pixel values
216
217=head2 apc:: - OS type
218
219See L<Prima::Application/get_system_info>
220
221	apc::Win32
222	apc::Unix
223
224=head2 bi::  - border icons
225
226See L<Prima::Window/borderIcons>
227
228	bi::SystemMenu  - system menu button and/or close button
229	                  ( usually with icon ) is shown
230	bi::Minimize    - minimize button
231	bi::Maximize    - maximize ( and eventual restore )
232	bi::TitleBar    - window title
233	bi::All         - all of the above
234
235=head2 bs::  - border styles
236
237See L<Prima::Window/borderStyle>
238
239	bs::None      - no border
240	bs::Single    - thin border
241	bs::Dialog    - thick border
242	bs::Sizeable  - thick border with interactive resize capabilities
243
244=head2 ci::  - color indices
245
246See L<Prima::Widget/colorIndex>
247
248	ci::NormalText or ci::Fore
249	ci::Normal or ci::Back
250	ci::HiliteText
251	ci::Hilite
252	ci::DisabledText
253	ci::Disabled
254	ci::Light3DColor
255	ci::Dark3DColor
256	ci::MaxId
257
258=head2 cl:: - colors
259
260See L<Prima::Widget/colorIndex>
261
262=over
263
264=item Direct color constants
265
266	cl::Black
267	cl::Blue
268	cl::Green
269	cl::Cyan
270	cl::Red
271	cl::Magenta
272	cl::Brown
273	cl::LightGray
274	cl::DarkGray
275	cl::LightBlue
276	cl::LightGreen
277	cl::LightCyan
278	cl::LightRed
279	cl::LightMagenta
280	cl::Yellow
281	cl::White
282	cl::Gray
283
284=item Indirect color constants
285
286	cl::NormalText, cl::Fore
287	cl::Normal, cl::Back
288	cl::HiliteText
289	cl::Hilite
290	cl::DisabledText
291	cl::Disabled
292	cl::Light3DColor
293	cl::Dark3DColor
294	cl::MaxSysColor
295
296=item Special constants
297
298See L<Prima::gp_problems/Colors>
299
300	cl::Set      - logical all-1 color
301	cl::Clear    - logical all-0 color
302	cl::Invalid  - invalid color value
303	cl::SysFlag  - indirect color constant bit set
304	cl::SysMask  - indirect color constant bit clear mask
305
306=back
307
308=head2 cm::  - commands
309
310=over
311
312=item Keyboard and mouse commands
313
314See L<Prima::Widget/key_down>, L<Prima::Widget/mouse_down>
315
316	cm::KeyDown
317	cm::KeyUp
318	cm::MouseDown
319	cm::MouseUp
320	cm::MouseClick
321	cm::MouseWheel
322	cm::MouseMove
323	cm::MouseEnter
324	cm::MouseLeave
325
326=item Internal commands ( used in core only or not used at all )
327
328	cm::Close
329	cm::Create
330	cm::Destroy
331	cm::Hide
332	cm::Show
333	cm::ReceiveFocus
334	cm::ReleaseFocus
335	cm::Paint
336	cm::Repaint
337	cm::Size
338	cm::Move
339	cm::ColorChanged
340	cm::ZOrderChanged
341	cm::Enable
342	cm::Disable
343	cm::Activate
344	cm::Deactivate
345	cm::FontChanged
346	cm::WindowState
347	cm::Timer
348	cm::Click
349	cm::CalcBounds
350	cm::Post
351	cm::Popup
352	cm::Execute
353	cm::Setup
354	cm::Hint
355	cm::DragDrop
356	cm::DragOver
357	cm::EndDrag
358	cm::Menu
359	cm::EndModal
360	cm::MenuCmd
361	cm::TranslateAccel
362	cm::DelegateKey
363
364=back
365
366=head2 cr::  - pointer cursor resources
367
368See L<Prima::Widget/pointerType>
369
370	cr::Default                 same pointer type as owner's
371	cr::Arrow                   arrow pointer
372	cr::Text                    text entry cursor-like pointer
373	cr::Wait                    hourglass
374	cr::Size                    general size action pointer
375	cr::Move                    general move action pointer
376	cr::SizeWest, cr::SizeW     right-move action pointer
377	cr::SizeEast, cr::SizeE     left-move action pointer
378	cr::SizeWE                  general horizontal-move action pointer
379	cr::SizeNorth, cr::SizeN    up-move action pointer
380	cr::SizeSouth, cr::SizeS    down-move action pointer
381	cr::SizeNS                  general vertical-move action pointer
382	cr::SizeNW                  up-right move action pointer
383	cr::SizeSE                  down-left move action pointer
384	cr::SizeNE                  up-left move action pointer
385	cr::SizeSW                  down-right move action pointer
386	cr::Invalid                 invalid action pointer
387	cr::DragNone                pointer for an invalid dragging target
388	cr::DragCopy                pointer to indicate that a dnd::Copy action can be accepted
389	cr::DragMove                pointer to indicate that a dnd::Move action can be accepted
390	cr::DragLink                pointer to indicate that a dnd::Link action can be accepted
391	cr::User                    user-defined icon
392
393=head2 dbt::  - device bitmap types
394
395        dbt::Bitmap                 monochrome 1 bit bitmap
396        dbt::Pixmap                 bitmap compatible with display format
397        dbt::Layered                bitmap compatible with display format with alpha channel
398
399=head2 dnd::  - drag and drop action constants and functions
400
401        dnd::None                   no DND action was selected or performed
402        dnd::Copy                   copy action
403        dnd::Move                   move action
404        dnd::Link                   link action
405        dnd::Mask                   combination of all valid actions
406
407=over
408
409=item is_one_action ACTIONS
410
411Returns true if C<ACTIONS> is not a combination of C<dnd::> constants.
412
413=item pointer ACTION
414
415Returns a C<cr::> constant corresponding to the C<ACTION>
416
417=item to_one_action ACTIONS
418
419Selects a best single action from combination of allowes C<ACTIONS>
420
421=item keymod ACTION
422
423Returns a C<km::> keyboard modifier constant the C<ACTION> will be selected,
424when possible, if the user presses that modifier. Return 0 for C<dnd::Copy>
425that is a standard action to be performed without any modifiers.
426
427=back
428
429=head2 dt::  - drive types
430
431See L<Prima::Utils/query_drive_type>
432
433	dt::None
434	dt::Unknown
435	dt::Floppy
436	dt::HDD
437	dt::Network
438	dt::CDROM
439	dt::Memory
440
441=head2 dt::  - Prima::Drawable::draw_text constants
442
443	dt::Left              - text is aligned to the left boundary
444	dt::Right             - text is aligned to the right boundary
445	dt::Center            - text is aligned horizontally in center
446	dt::Top               - text is aligned to the upper boundary
447	dt::Bottom            - text is aligned to the lower boundary
448	dt::VCenter           - text is aligned vertically in center
449	dt::DrawMnemonic      - tilde-escapement and underlining is used
450	dt::DrawSingleChar    - sets tw::BreakSingle option to
451				Prima::Drawable::text_wrap call
452	dt::NewLineBreak      - sets tw::NewLineBreak option to
453				Prima::Drawable::text_wrap call
454	dt::SpaceBreak        - sets tw::SpaceBreak option to
455			        Prima::Drawable::text_wrap call
456	dt::WordBreak         - sets tw::WordBreak option to
457				Prima::Drawable::text_wrap call
458	dt::ExpandTabs        - performs tab character ( \t ) expansion
459	dt::DrawPartial       - draws the last line, if it is visible partially
460	dt::UseExternalLeading- text lines positioned vertically with respect to
461				the font external leading
462	dt::UseClip           - assign ::clipRect property to the boundary rectangle
463	dt::QueryLinesDrawn   - calculates and returns number of lines drawn
464				( contrary to dt::QueryHeight )
465	dt::QueryHeight       - if set, calculates and returns vertical extension
466				of the lines drawn
467	dt::NoWordWrap        - performs no word wrapping by the width of the boundaries
468	dt::WordWrap          - performs word wrapping by the width of the boundaries
469	dt::Default           - dt::NewLineBreak|dt::WordBreak|dt::ExpandTabs|
470				dt::UseExternalLeading
471
472=head2 fdo:: - find / replace dialog options
473
474See L<Prima::FindDialog>
475
476	fdo::MatchCase
477	fdo::WordsOnly
478	fdo::RegularExpression
479	fdo::BackwardSearch
480	fdo::ReplacePrompt
481
482=head2 fds:: - find / replace dialog scope type
483
484See L<Prima::FindDialog>
485
486	fds::Cursor
487	fds::Top
488	fds::Bottom
489
490=head2 fe::  - file events constants
491
492See L<Prima::File>
493
494	fe::Read
495	fe::Write
496	fe::Exception
497
498=head2 fm::  - fill modes
499
500See L<Prima::Drawable/fillMode>
501
502	fp::Alternate
503	fp::Winding
504	fp::Overlay
505
506=head2 fp::  - standard fill pattern indices
507
508See L<Prima::Drawable/fillPattern>
509
510	fp::Empty
511	fp::Solid
512	fp::Line
513	fp::LtSlash
514	fp::Slash
515	fp::BkSlash
516	fp::LtBkSlash
517	fp::Hatch
518	fp::XHatch
519	fp::Interleave
520	fp::WideDot
521	fp::CloseDot
522	fp::SimpleDots
523	fp::Borland
524	fp::Parquet
525
526=head2 fp::  - font pitches
527
528See L<Prima::Drawable/pitch>
529
530	fp::Default
531	fp::Fixed
532	fp::Variable
533
534=head2 fr::  - fetch resource constants
535
536See L<Prima::Widget/fetch_resource>
537
538	fr::Color
539	fr::Font
540	fs::String
541
542=head2 fs::  - font styles
543
544See L<Prima::Drawable/style>
545
546	fs::Normal
547	fs::Bold
548	fs::Thin
549	fs::Italic
550	fs::Underlined
551	fs::StruckOut
552	fs::Outline
553
554=head2 fw::  - font weights
555
556See L<Prima::Drawable/weight>
557
558	fw::UltraLight
559	fw::ExtraLight
560	fw::Light
561	fw::SemiLight
562	fw::Medium
563	fw::SemiBold
564	fw::Bold
565	fw::ExtraBold
566	fw::UltraBold
567
568=head2 ggo::  - glyph outline commands
569
570	ggo::Move
571	ggo::Line
572	ggo::Conic
573	ggo::Cubic
574
575See also L<Prima::Drawable/render_glyph>
576
577=head2 gm::  - grow modes
578
579See L<Prima::Widget/growMode>
580
581=over
582
583=item Basic constants
584
585	gm::GrowLoX	widget's left side is kept in constant
586			distance from owner's right side
587	gm::GrowLoY	widget's bottom side is kept in constant
588			distance from owner's top side
589	gm::GrowHiX	widget's right side is kept in constant
590			distance from owner's right side
591	gm::GrowHiY	widget's top side is kept in constant
592			distance from owner's top side
593	gm::XCenter	widget is kept in center on its owner's
594			horizontal axis
595	gm::YCenter	widget is kept in center on its owner's
596			vertical axis
597	gm::DontCare	widgets origin is maintained constant relative
598			to the screen
599
600=item Derived or aliased constants
601
602	gm::GrowAll      gm::GrowLoX|gm::GrowLoY|gm::GrowHiX|gm::GrowHiY
603	gm::Center       gm::XCenter|gm::YCenter
604	gm::Client       gm::GrowHiX|gm::GrowHiY
605	gm::Right        gm::GrowLoX|gm::GrowHiY
606	gm::Left         gm::GrowHiY
607	gm::Floor        gm::GrowHiX
608
609=back
610
611=head2 gui:: - GUI types
612
613See L<Prima::Application/get_system_info>
614
615	gui::Default
616	gui::PM
617	gui::Windows
618	gui::XLib
619	gui::GTK
620
621=head2 le::  - line end styles
622
623See L<Prima::Drawable/lineEnd>
624
625	le::Flat
626	le::Square
627	le::Round
628
629=head2 lj::  - line join styles
630
631See L<Prima::Drawable/lineJoin>
632
633	lj::Round
634	lj::Bevel
635	lj::Miter
636
637=head2 lp::  - predefined line pattern styles
638
639See L<Prima::Drawable/linePattern>
640
641	lp::Null           #    ""              /*              */
642	lp::Solid          #    "\1"            /* ___________  */
643	lp::Dash           #    "\x9\3"         /* __ __ __ __  */
644	lp::LongDash       #    "\x16\6"        /* _____ _____  */
645	lp::ShortDash      #    "\3\3"          /* _ _ _ _ _ _  */
646	lp::Dot            #    "\1\3"          /* . . . . . .  */
647	lp::DotDot         #    "\1\1"          /* ............ */
648	lp::DashDot        #    "\x9\6\1\3"     /* _._._._._._  */
649	lp::DashDotDot     #    "\x9\3\1\3\1\3" /* _.._.._.._.. */
650
651=head2 im::  - image types
652
653See L<Prima::Image/type>.
654
655=over
656
657=item Bit depth constants
658
659	im::bpp1
660	im::bpp4
661	im::bpp8
662	im::bpp16
663	im::bpp24
664	im::bpp32
665	im::bpp64
666	im::bpp128
667
668=item Pixel format constants
669
670	im::Color
671	im::GrayScale
672	im::RealNumber
673	im::ComplexNumber
674	im::TrigComplexNumber
675	im::SignedInt
676
677
678=item Mnemonic image types
679
680	im::Mono          - im::bpp1
681	im::BW            - im::bpp1 | im::GrayScale
682	im::16            - im::bpp4
683	im::Nibble        - im::bpp4
684	im::256           - im::bpp8
685	im::RGB           - im::bpp24
686	im::Triple        - im::bpp24
687	im::Byte          - gray 8-bit unsigned integer
688	im::Short         - gray 16-bit unsigned integer
689	im::Long          - gray 32-bit unsigned integer
690	im::Float         - float
691	im::Double        - double
692	im::Complex       - dual float
693	im::DComplex      - dual double
694	im::TrigComplex   - dual float
695	im::TrigDComplex  - dual double
696
697=item Extra formats
698
699	im::fmtBGR
700	im::fmtRGBI
701	im::fmtIRGB
702	im::fmtBGRI
703	im::fmtIBGR
704
705=item Masks
706
707	im::BPP      - bit depth constants
708	im::Category - category constants
709	im::FMT      - extra format constants
710
711=back
712
713=head2 ict:: - image conversion types
714
715See L<Prima::Image/conversion>.
716
717	ict::None            - no dithering, with static palette or palette optimized by source palette
718	ict::Posterization   - no dithering, with optimized palette by source pixels
719	ict::Ordered         - 8x8 ordered halftone dithering
720	ict::ErrorDiffusion  - error diffusion dithering with static palette
721	ict::Optimized       - error diffusion dithering with optimized palette
722
723Their values are combinations of C<ictp::> and C<ictd::> constants, see below.
724
725=head2 ictd:: - image conversion types, dithering
726
727These constants select color correction (dithering) algorithm when downsampling
728an image
729
730	ictd::None            - no dithering, pure colors only
731	ictd::Ordered         - 8x8 ordered halftone dithering (checkerboard)
732	ictd::ErrorDiffusion  - error diffusion dithering (2/5 down, 2/5 right, 1/5 down/right)
733
734=head2 ictp:: - image conversion types, palette optimization
735
736These constants select how the target palette is made up when downsampling an image.
737
738	ictp::Unoptimized  - use whatever color mapping method is fastest,
739	                     image quality can be severely compromized
740	ictp::Cubic        - use static cubic palette; a bit slower,
741	                     guaranteed mediocre quality
742	ictp::Optimized    - collect available colors in the image;
743	                     slowest, gives best results
744
745Not all combination of ictp and ictd constants are valid
746
747=head2 is::  - image statistics indices
748
749See L<Prima::Image/stats>.
750
751	is::RangeLo  - minimum pixel value
752	is::RangeHi  - maximum pixel value
753	is::Mean     - mean value
754	is::Variance - variance
755	is::StdDev   - standard deviation
756	is::Sum      - sum of pixel values
757	is::Sum2     - sum of squares of pixel values
758
759=head2 ist:: - image scaling types
760
761	ist::None      - image stripped or padded with zeros
762	ist::Box       - image will be scaled using simple box transform
763	ist::BoxX      - columns behave as ist::None, rows as ist::Box
764	ist::BoxY      - rows behave as in ist::None, columns as ist::Box
765	ist::AND       - shrunken pixels AND-end together (black on white)
766	ist::OR        - shrunken pixels OR-end together (white on black)
767	ist::Triangle  - bilinear interpolation
768	ist::Quadratic - 2rd order (quadratic) B-Spline approximation of Gaussian
769	ist::Sinc      - sine function
770	ist::Hermite   - B-Spline interpolation
771	ist::Cubic     - 3rd order (cubic) B-Spline approximation of Gaussian
772	ist::Gaussian  - Gaussian transform with gamma=0.5
773
774See L<Prima::Image/scaling>.
775
776=head2 kb::  - keyboard virtual codes
777
778See also L<Prima::Widget/KeyDown>.
779
780=over
781
782=item Modificator keys
783
784	kb::ShiftL   kb::ShiftR   kb::CtrlL      kb::CtrlR
785	kb::AltL     kb::AltR     kb::MetaL      kb::MetaR
786	kb::SuperL   kb::SuperR   kb::HyperL     kb::HyperR
787	kb::CapsLock kb::NumLock  kb::ScrollLock kb::ShiftLock
788
789=item Keys with character code defined
790
791	kb::Backspace  kb::Tab    kb::Linefeed   kb::Enter
792	kb::Return     kb::Escape kb::Esc        kb::Space
793
794=item Function keys
795
796	kb::F1 .. kb::F30
797	kb::L1 .. kb::L10
798	kb::R1 .. kb::R10
799
800=item Other
801
802	kb::Clear    kb::Pause   kb::SysRq  kb::SysReq
803	kb::Delete   kb::Home    kb::Left   kb::Up
804	kb::Right    kb::Down    kb::PgUp   kb::Prior
805	kb::PageUp   kb::PgDn    kb::Next   kb::PageDown
806	kb::End      kb::Begin   kb::Select kb::Print
807	kb::PrintScr kb::Execute kb::Insert kb::Undo
808	kb::Redo     kb::Menu    kb::Find   kb::Cancel
809	kb::Help     kb::Break   kb::BackTab
810
811=item Masking constants
812
813	kb::CharMask - character codes
814	kb::CodeMask - virtual key codes ( all other kb:: values )
815	kb::ModMask  - km:: values
816
817=back
818
819=head2 km::  - keyboard modifiers
820
821See also L<Prima::Widget/KeyDown>.
822
823	km::Shift
824	km::Ctrl
825	km::Alt
826	km::KeyPad
827	km::DeadKey
828	km::Unicode
829
830=head2 mt:: - modality types
831
832See L<Prima::Window/get_modal>, L<Prima::Window/get_modal_window>
833
834	mt::None
835	mt::Shared
836	mt::Exclusive
837
838=head2 nt::  - notification types
839
840Used in C<Prima::Component::notification_types> to describe
841event flow.
842
843See also L<Prima::Object/Flow>.
844
845=over
846
847=item Starting point constants
848
849	nt::PrivateFirst
850	nt::CustomFirst
851
852=item Direction constants
853
854	nt::FluxReverse
855	nt::FluxNormal
856
857=item Complexity constants
858
859	nt::Single
860	nt::Multiple
861	nt::Event
862
863=item Composite constants
864
865	nt::Default       ( PrivateFirst | Multiple | FluxReverse)
866	nt::Property      ( PrivateFirst | Single   | FluxNormal )
867	nt::Request       ( PrivateFirst | Event    | FluxNormal )
868	nt::Notification  ( CustomFirst  | Multiple | FluxReverse )
869	nt::Action        ( CustomFirst  | Single   | FluxReverse )
870	nt::Command       ( CustomFirst  | Event    | FluxReverse )
871
872=back
873
874=head2 mb::  - mouse buttons
875
876See also L<Prima::Widget/MouseDown>.
877
878	mb::b1 or mb::Left
879	mb::b2 or mb::Middle
880	mb::b3 or mb::Right
881	mb::b4
882	mb::b5
883	mb::b6
884	mb::b7
885	mb::b8
886
887=head2 mb:: - message box constants
888
889=over
890
891=item Message box and modal result button commands
892
893See also L<Prima::Window/modalResult>, L<Prima::Button/modalResult>.
894
895	mb::OK, mb::Ok
896	mb::Cancel
897	mb::Yes
898	mb::No
899	mb::Abort
900	mb::Retry
901	mb::Ignore
902	mb::Help
903
904=item Message box composite ( multi-button ) constants
905
906	mb::OKCancel, mb::OkCancel
907	mb::YesNo
908	mb::YesNoCancel
909	mb::ChangeAll
910
911=item Message box icon and bell constants
912
913	mb::Error
914	mb::Warning
915	mb::Information
916	mb::Question
917
918=back
919
920=head2 ps:: - paint states
921
922	ps::Disabled    - can neither draw, nor get/set graphical properties on an object
923	ps::Enabled     - can both draw and get/set graphical properties on an object
924	ps::Information - can only get/set graphical properties on an object
925
926For brevity, ps::Disabled is equal to 0 so this allows for simple boolean testing whether one can
927get/set graphical properties on an object.
928
929See L<Drawable/get_paint_state>.
930
931=head2 rgn:: - result of Prima::Region.rect_inside
932
933	rgn::Inside
934	rgn::Outside    - rectangle is fully outside the region
935	rgn::Partially
936
937=head2 rgnop:: - Prima::Region.combine set operations
938
939	rgnop::Copy
940	rgnop::Intersect
941	rgnop::Union
942	rgnop::Xor
943	rgnop::Diff
944
945=head2 rop:: - raster operation codes
946
947See L<Prima::Drawable/Raster operations>
948
949        rop::Blackness      #   = 0
950        rop::NotOr          #   = !(src | dest)
951        rop::NotSrcAnd      #  &= !src
952        rop::NotPut         #   = !src
953        rop::NotDestAnd     #   = !dest & src
954        rop::Invert         #   = !dest
955        rop::XorPut         #  ^= src
956        rop::NotAnd         #   = !(src & dest)
957        rop::AndPut         #  &= src
958        rop::NotXor         #   = !(src ^ dest)
959        rop::NotSrcXor      #     alias for rop::NotXor
960        rop::NotDestXor     #     alias for rop::NotXor
961        rop::NoOper         #   = dest
962        rop::NotSrcOr       #  |= !src
963        rop::CopyPut        #   = src
964        rop::NotDestOr      #   = !dest | src
965        rop::OrPut          #  |= src
966        rop::Whiteness      #   = 1
967
96812 Porter-Duff operators
969
970        rop::Clear       # = 0
971        rop::Xor         # = src ( 1 - dstA ) + dst ( 1 - srcA )
972        rop::SrcOver     # = src + dst (1 - srcA)
973        rop::DstOver     # = dst + src (1 - dstA)
974        rop::SrcCopy     # = src
975        rop::DstCopy     # = dst
976        rop::SrcIn       # = src dstA
977        rop::DstIn       # = dst srcA
978        rop::SrcOut      # = src ( 1 - dstA )
979        rop::DstOut      # = dst ( 1 - srcA )
980        rop::SrcAtop     # = src dstA + dst ( 1 - srcA )
981        rop::DstAtop     # = dst srcA + src ( 1 - dstA )
982
983        rop::PorterDuffMask - masks out all bits but the constants above
984
985Photoshop operators
986
987	rop::Add
988	rop::Multiply
989	rop::Screen
990	rop::Overlay
991	rop::Darken
992	rop::Lighten
993	rop::ColorDodge
994	rop::ColorBurn
995	rop::HardLight
996	rop::SoftLight
997	rop::Difference
998	rop::Exclusion
999
1000Constant alpha flags
1001
1002        rop::SrcAlpha
1003        rop::SrcAlphaShift
1004        rop::DstAlpha
1005        rop::DstAlphaShift
1006	rop::ConstantAlpha
1007
1008Others
1009
1010        rop::AlphaCopy
1011
1012=head2 sbmp:: - system bitmaps indices
1013
1014See also L<Prima::StdBitmap>.
1015
1016	sbmp::Logo
1017	sbmp::CheckBoxChecked
1018	sbmp::CheckBoxCheckedPressed
1019	sbmp::CheckBoxUnchecked
1020	sbmp::CheckBoxUncheckedPressed
1021	sbmp::RadioChecked
1022	sbmp::RadioCheckedPressed
1023	sbmp::RadioUnchecked
1024	sbmp::RadioUncheckedPressed
1025	sbmp::Warning
1026	sbmp::Information
1027	sbmp::Question
1028	sbmp::OutlineCollapse
1029	sbmp::OutlineExpand
1030	sbmp::Error
1031	sbmp::SysMenu
1032	sbmp::SysMenuPressed
1033	sbmp::Max
1034	sbmp::MaxPressed
1035	sbmp::Min
1036	sbmp::MinPressed
1037	sbmp::Restore
1038	sbmp::RestorePressed
1039	sbmp::Close
1040	sbmp::ClosePressed
1041	sbmp::Hide
1042	sbmp::HidePressed
1043	sbmp::DriveUnknown
1044	sbmp::DriveFloppy
1045	sbmp::DriveHDD
1046	sbmp::DriveNetwork
1047	sbmp::DriveCDROM
1048	sbmp::DriveMemory
1049	sbmp::GlyphOK
1050	sbmp::GlyphCancel
1051	sbmp::SFolderOpened
1052	sbmp::SFolderClosed
1053	sbmp::Last
1054
1055=head2 scr:: - scroll exposure results
1056
1057C<Widget::scroll> returns one of these.
1058
1059	scr::Error           - failure
1060	scr::NoExpose        - call resulted in no new exposed areas
1061	scr::Expose          - call resulted in new exposed areas, expect a repaint
1062
1063=head2 sv::  - system value indices
1064
1065See also L<Prima::Application/get_system_value>
1066
1067	sv::YMenu            - height of menu bar in top-level windows
1068	sv::YTitleBar        - height of title bar in top-level windows
1069	sv::XIcon            - width and height of main icon dimensions,
1070	sv::YIcon              acceptable by the system
1071	sv::XSmallIcon       - width and height of alternate icon dimensions,
1072	sv::YSmallIcon         acceptable by the system
1073	sv::XPointer         - width and height of mouse pointer icon
1074	sv::YPointer           acceptable by the system
1075	sv::XScrollbar       - width of the default vertical scrollbar
1076	sv::YScrollbar       - height of the default horizontal scrollbar
1077	sv::XCursor          - width of the system cursor
1078	sv::AutoScrollFirst  - the initial and the repetitive
1079	sv::AutoScrollNext     scroll timeouts
1080	sv::InsertMode       - the system insert mode
1081	sv::XbsNone          - widths and heights of the top-level window
1082	sv::YbsNone            decorations, correspondingly, with borderStyle
1083	sv::XbsSizeable        bs::None, bs::Sizeable, bs::Single, and
1084	sv::YbsSizeable        bs::Dialog.
1085	sv::XbsSingle
1086	sv::YbsSingle
1087	sv::XbsDialog
1088	sv::YbsDialog
1089	sv::MousePresent     - 1 if the mouse is present, 0 otherwise
1090	sv::MouseButtons     - number of the mouse buttons
1091	sv::WheelPresent     - 1 if the mouse wheel is present, 0 otherwise
1092	sv::SubmenuDelay     - timeout ( in ms ) before a sub-menu shows on
1093				an implicit selection
1094	sv::FullDrag         - 1 if the top-level windows are dragged dynamically,
1095	                       0 - with marquee mode
1096	sv::DblClickDelay    - mouse double-click timeout in milliseconds
1097	sv::ShapeExtension   - 1 if Prima::Widget::shape functionality is supported,
1098	                       0 otherwise
1099	sv::ColorPointer     - 1 if system accepts color pointer icons.
1100	sv::CanUTF8_Input    - 1 if system can generate key codes in unicode
1101	sv::CanUTF8_Output   - 1 if system can output utf8 text
1102	sv::CompositeDisplay - 1 if system uses double-buffering and alpha composition for the desktop,
1103	                       0 if it doesn't, -1 if unknown
1104	sv::LayeredWidgets   - 1 if system supports layering
1105	sv::FixedPointerSize - 0 if system doesn't support arbitrary sized pointers and will resize custom icons to the system size
1106	sv::MenuCheckSize    - width and height of default menu check icon
1107	sv::FriBidi          - 1 if Prima is compiled with libfribidi and full bidi unicode support is available
1108	sv::Antialias        - 1 if system supports antialiasing and alpha layer for primitives
1109
1110=head2 ta::  - alignment constants
1111
1112Used in: L<Prima::InputLine>, L<Prima::ImageViewer>, L<Prima::Label>.
1113
1114	ta::Left
1115	ta::Right
1116	ta::Center
1117
1118	ta::Top
1119	ta::Bottom
1120	ta::Middle
1121
1122=head2 to::  - text output constants
1123
1124These constants are used in various text and glyph related functions,
1125and form a somewhat vague group of bit values that may or may not be used together
1126depending on the function
1127
1128	to::Plain         - default value, 0
1129	to::AddOverhangs  - used in C<get_text_width> and C<get_text_shape_width>
1130	                    to request text overhangs to be included in the returned
1131			    text width
1132	to::Glyphs        - used in C<get_font_abc> and C<get_font_def> to select extension of
1133	                    glyph indexes rather than text codepoints
1134	to::Unicode       - used in C<get_font_abc> and C<get_font_def> to select extension of
1135	                    unicode rather than ascii text codepoints
1136	to::RTL           - used in C<get_text_shape_width> to request RTL bidi direction.
1137	                    Also used in C<Prima::Drawable::Glyphs::indexes> values to mark
1138			    RTL characters.
1139
1140=head2 tw::  - text wrapping constants
1141
1142See L<Prima::Drawable/text_wrap>
1143
1144	tw::CalcMnemonic          - calculates tilde underline position
1145	tw::CollapseTilde         - removes escaping tilde from text
1146	tw::CalcTabs              - wraps text with respect to tab expansion
1147	tw::ExpandTabs            - expands tab characters
1148	tw::BreakSingle           - determines if text is broken to single
1149	                            characters when text cannot be fit
1150	tw::NewLineBreak          - breaks line on newline characters
1151	tw::SpaceBreak            - breaks line on space or tab characters
1152	tw::ReturnChunks          - returns wrapped text chunks
1153	tw::ReturnLines           - returns positions and lengths of wrapped
1154	                            text chunks
1155	tw::WordBreak             - defines if text break by width goes by the
1156	                            characters or by the words
1157	tw::ReturnFirstLineLength - returns length of the first wrapped line
1158	tw::Default               - tw::NewLineBreak | tw::CalcTabs | tw::ExpandTabs |
1159	                            tw::ReturnLines | tw::WordBreak
1160
1161=head2 wc::  - widget classes
1162
1163See L<Prima::Widget/widgetClass>
1164
1165	wc::Undef
1166	wc::Button
1167	wc::CheckBox
1168	wc::Combo
1169	wc::Dialog
1170	wc::Edit
1171	wc::InputLine
1172	wc::Label
1173	wc::ListBox
1174	wc::Menu
1175	wc::Popup
1176	wc::Radio
1177	wc::ScrollBar
1178	wc::Slider
1179	wc::Widget, wc::Custom
1180	wc::Window
1181	wc::Application
1182
1183=head2 ws::  - window states
1184
1185See L<Prima::Window/windowState>
1186
1187	ws::Normal
1188	ws::Minimized
1189	ws::Maximized
1190
1191=head1 AUTHOR
1192
1193Dmitry Karasik, E<lt>dmitry@karasik.eu.orgE<gt>.
1194
1195=head1 SEE ALSO
1196
1197L<Prima>, L<Prima::Classes>
1198
1199=cut
1200