The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Prima::Const - predefined constants

DESCRIPTION

Prima::Const and Prima::Classes is a minimal set of perl modules needed for the toolkit. Since the module provides bindings for the core constants, it is required to be included in every Prima-related module and program.

The constants are assembled under the top-level package names, with no Prima:: prefix. This violates the perl guidelines about package naming, however, it was considered way too inconvenient to prefix every constant with Prima:: string.

This document provides description of all core-coded constants. The constants are also described in the articles together with the corresponding methods and properties. For example, nt constants are also described in "Flow" in Prima::Object article.

API

am:: - Prima::Icon auto masking

See also "autoMasking" in Prima::Image

        am::None           - no mask update performed
        am::MaskColor      - mask update based on Prima::Icon::maskColor property
        am::MaskIndex      - mask update based on Prima::Icon::maskIndex property
        am::Auto           - mask update based on corner pixel values

apc:: - OS type

See "get_system_info" in Prima::Application

        apc::Win32
        apc::Unix

bi:: - border icons

See "borderIcons" in Prima::Window

        bi::SystemMenu  - system menu button and/or close button
                          ( usually with icon ) is shown
        bi::Minimize    - minimize button
        bi::Maximize    - maximize ( and eventual restore )
        bi::TitleBar    - window title
        bi::All         - all of the above

bs:: - border styles

See "borderStyle" in Prima::Window

        bs::None      - no border
        bs::Single    - thin border
        bs::Dialog    - thick border
        bs::Sizeable  - thick border with interactive resize capabilities

ci:: - color indices

See "colorIndex" in Prima::Widget

        ci::NormalText or ci::Fore
        ci::Normal or ci::Back
        ci::HiliteText
        ci::Hilite
        ci::DisabledText
        ci::Disabled
        ci::Light3DColor
        ci::Dark3DColor
        ci::MaxId

cl:: - colors

See "colorIndex" in Prima::Widget

Direct color constants
        cl::Black
        cl::Blue
        cl::Green
        cl::Cyan
        cl::Red
        cl::Magenta
        cl::Brown
        cl::LightGray
        cl::DarkGray
        cl::LightBlue
        cl::LightGreen
        cl::LightCyan
        cl::LightRed
        cl::LightMagenta
        cl::Yellow
        cl::White
        cl::Gray
Indirect color constants
        cl::NormalText, cl::Fore
        cl::Normal, cl::Back
        cl::HiliteText
        cl::Hilite
        cl::DisabledText
        cl::Disabled
        cl::Light3DColor
        cl::Dark3DColor
        cl::MaxSysColor
Special constants

See "Colors" in Prima::gp_problems

        cl::Set      - logical all-1 color
        cl::Clear    - logical all-0 color
        cl::Invalid  - invalid color value
        cl::SysFlag  - indirect color constant bit set
        cl::SysMask  - indirect color constant bit clear mask

cm:: - commands

Keyboard and mouse commands

See "key_down" in Prima::Widget, "mouse_down" in Prima::Widget

        cm::KeyDown
        cm::KeyUp
        cm::MouseDown
        cm::MouseUp
        cm::MouseClick
        cm::MouseWheel
        cm::MouseMove
        cm::MouseEnter
        cm::MouseLeave
Internal commands ( used in core only or not used at all )
        cm::Close
        cm::Create
        cm::Destroy
        cm::Hide
        cm::Show
        cm::ReceiveFocus
        cm::ReleaseFocus
        cm::Paint
        cm::Repaint
        cm::Size
        cm::Move
        cm::ColorChanged
        cm::ZOrderChanged
        cm::Enable
        cm::Disable
        cm::Activate
        cm::Deactivate
        cm::FontChanged
        cm::WindowState
        cm::Timer
        cm::Click
        cm::CalcBounds
        cm::Post
        cm::Popup
        cm::Execute
        cm::Setup
        cm::Hint
        cm::DragDrop
        cm::DragOver
        cm::EndDrag
        cm::Menu
        cm::EndModal
        cm::MenuCmd
        cm::TranslateAccel
        cm::DelegateKey

cr:: - pointer cursor resources

See "pointerType" in Prima::Widget

        cr::Default                 same pointer type as owner's
        cr::Arrow                   arrow pointer
        cr::Text                    text entry cursor-like pointer
        cr::Wait                    hourglass
        cr::Size                    general size action pointer
        cr::Move                    general move action pointer
        cr::SizeWest, cr::SizeW     right-move action pointer
        cr::SizeEast, cr::SizeE     left-move action pointer
        cr::SizeWE                  general horizontal-move action pointer
        cr::SizeNorth, cr::SizeN    up-move action pointer
        cr::SizeSouth, cr::SizeS    down-move action pointer
        cr::SizeNS                  general vertical-move action pointer
        cr::SizeNW                  up-right move action pointer
        cr::SizeSE                  down-left move action pointer
        cr::SizeNE                  up-left move action pointer
        cr::SizeSW                  down-right move action pointer
        cr::Invalid                 invalid action pointer
        cr::User                    user-defined icon

dbt:: - device bitmap types

        dbt::Bitmap                 monochrome 1 bit bitmap
        dbt::Pixmap                 bitmap compatible with display format
        dbt::Layered                bitmap compatible with display format with alpha channel

dt:: - drive types

See "query_drive_type" in Prima::Utils

        dt::None
        dt::Unknown
        dt::Floppy
        dt::HDD
        dt::Network
        dt::CDROM
        dt::Memory

dt:: - Prima::Drawable::draw_text constants

        dt::Left              - text is aligned to the left boundary
        dt::Right             - text is aligned to the right boundary
        dt::Center            - text is aligned horizontally in center
        dt::Top               - text is aligned to the upper boundary
        dt::Bottom            - text is aligned to the lower boundary
        dt::VCenter           - text is aligned vertically in center
        dt::DrawMnemonic      - tilde-escapement and underlining is used
        dt::DrawSingleChar    - sets tw::BreakSingle option to
                                Prima::Drawable::text_wrap call
        dt::NewLineBreak      - sets tw::NewLineBreak option to
                                Prima::Drawable::text_wrap call
        dt::SpaceBreak        - sets tw::SpaceBreak option to
                                Prima::Drawable::text_wrap call
        dt::WordBreak         - sets tw::WordBreak option to
                                Prima::Drawable::text_wrap call
        dt::ExpandTabs        - performs tab character ( \t ) expansion
        dt::DrawPartial       - draws the last line, if it is visible partially
        dt::UseExternalLeading- text lines positioned vertically with respect to
                                the font external leading
        dt::UseClip           - assign ::clipRect property to the boundary rectangle
        dt::QueryLinesDrawn   - calculates and returns number of lines drawn
                                ( contrary to dt::QueryHeight )
        dt::QueryHeight       - if set, calculates and returns vertical extension
                                of the lines drawn
        dt::NoWordWrap        - performs no word wrapping by the width of the boundaries
        dt::WordWrap          - performs word wrapping by the width of the boundaries
        dt::BidiText          - use bidirectional formatting, if available
        dt::Default           - dt::NewLineBreak|dt::WordBreak|dt::ExpandTabs|
                                dt::UseExternalLeading

fdo:: - find / replace dialog options

See Prima::EditDialog

        fdo::MatchCase
        fdo::WordsOnly
        fdo::RegularExpression
        fdo::BackwardSearch
        fdo::ReplacePrompt

fds:: - find / replace dialog scope type

See Prima::EditDialog

        fds::Cursor
        fds::Top
        fds::Bottom

fe:: - file events constants

See Prima::File

        fe::Read
        fe::Write
        fe::Exception

fp:: - standard fill pattern indices

See "fillPattern" in Prima::Drawable

        fp::Empty
        fp::Solid
        fp::Line
        fp::LtSlash
        fp::Slash
        fp::BkSlash
        fp::LtBkSlash
        fp::Hatch
        fp::XHatch
        fp::Interleave
        fp::WideDot
        fp::CloseDot
        fp::SimpleDots
        fp::Borland
        fp::Parquet

fp:: - font pitches

See "pitch" in Prima::Drawable

        fp::Default
        fp::Fixed
        fp::Variable

fr:: - fetch resource constants

See "fetch_resource" in Prima::Widget

        fr::Color
        fr::Font
        fs::String

fs:: - font styles

See "style" in Prima::Drawable

        fs::Normal
        fs::Bold
        fs::Thin
        fs::Italic
        fs::Underlined
        fs::StruckOut
        fs::Outline

fw:: - font weights

See "weight" in Prima::Drawable

        fw::UltraLight
        fw::ExtraLight
        fw::Light
        fw::SemiLight
        fw::Medium
        fw::SemiBold
        fw::Bold
        fw::ExtraBold
        fw::UltraBold

gm:: - grow modes

See "growMode" in Prima::Widget

Basic constants
        gm::GrowLoX     widget's left side is kept in constant
                        distance from owner's right side
        gm::GrowLoY     widget's bottom side is kept in constant
                        distance from owner's top side
        gm::GrowHiX     widget's right side is kept in constant
                        distance from owner's right side
        gm::GrowHiY     widget's top side is kept in constant
                        distance from owner's top side
        gm::XCenter     widget is kept in center on its owner's
                        horizontal axis
        gm::YCenter     widget is kept in center on its owner's
                        vertical axis
        gm::DontCare    widgets origin is maintained constant relative
                        to the screen
Derived or aliased constants
        gm::GrowAll      gm::GrowLoX|gm::GrowLoY|gm::GrowHiX|gm::GrowHiY
        gm::Center       gm::XCenter|gm::YCenter
        gm::Client       gm::GrowHiX|gm::GrowHiY
        gm::Right        gm::GrowLoX|gm::GrowHiY
        gm::Left         gm::GrowHiY
        gm::Floor        gm::GrowHiX

gui:: - GUI types

See "get_system_info" in Prima::Application

        gui::Default
        gui::PM
        gui::Windows
        gui::XLib
        gui::GTK

le:: - line end styles

See "lineEnd" in Prima::Drawable

        le::Flat
        le::Square
        le::Round

lj:: - line join styles

See "lineJoin" in Prima::Drawable

        lj::Round
        lj::Bevel
        lj::Miter

lp:: - predefined line pattern styles

See "linePattern" in Prima::Drawable

        lp::Null           #    ""              /*              */
        lp::Solid          #    "\1"            /* ___________  */
        lp::Dash           #    "\x9\3"         /* __ __ __ __  */
        lp::LongDash       #    "\x16\6"        /* _____ _____  */
        lp::ShortDash      #    "\3\3"          /* _ _ _ _ _ _  */
        lp::Dot            #    "\1\3"          /* . . . . . .  */
        lp::DotDot         #    "\1\1"          /* ............ */
        lp::DashDot        #    "\x9\6\1\3"     /* _._._._._._  */
        lp::DashDotDot     #    "\x9\3\1\3\1\3" /* _.._.._.._.. */

im:: - image types

See "type" in Prima::Image.

Bit depth constants
        im::bpp1
        im::bpp4
        im::bpp8
        im::bpp16
        im::bpp24
        im::bpp32
        im::bpp64
        im::bpp128
Pixel format constants
        im::Color
        im::GrayScale
        im::RealNumber
        im::ComplexNumber
        im::TrigComplexNumber
        im::SignedInt
Mnemonic image types
        im::Mono          - im::bpp1
        im::BW            - im::bpp1 | im::GrayScale
        im::16            - im::bpp4
        im::Nibble        - im::bpp4
        im::256           - im::bpp8
        im::RGB           - im::bpp24
        im::Triple        - im::bpp24
        im::Byte          - gray 8-bit unsigned integer
        im::Short         - gray 16-bit unsigned integer
        im::Long          - gray 32-bit unsigned integer
        im::Float         - float
        im::Double        - double
        im::Complex       - dual float
        im::DComplex      - dual double
        im::TrigComplex   - dual float
        im::TrigDComplex  - dual double
Extra formats
        im::fmtBGR
        im::fmtRGBI
        im::fmtIRGB
        im::fmtBGRI
        im::fmtIBGR
Masks
        im::BPP      - bit depth constants
        im::Category - category constants
        im::FMT      - extra format constants

ict:: - image conversion types

See "conversion" in Prima::Image.

        ict::None            - no dithering, with static palette or palette optimized by source palette
        ict::Posterization   - no dithering, with optimized palette by source pixels
        ict::Ordered         - 8x8 ordered halftone dithering
        ict::ErrorDiffusion  - error diffusion dithering with static palette
        ict::Optimized       - error diffusion dithering with optimized palette

Their values are combinations of ictp:: and ictd:: constants, see below.

ictd:: - image conversion types, dithering

These constants select color correction (dithering) algorithm when downsampling an image

        ictd::None            - no dithering, pure colors only
        ictd::Ordered         - 8x8 ordered halftone dithering (checkerboard)
        ictd::ErrorDiffusion  - error diffusion dithering (2/5 down, 2/5 right, 1/5 down/right)

ictp:: - image conversion types, palette optimization

These constants select how the target palette is made up when downsampling an image.

        ictp::Unoptimized  - use whatever color mapping method is fastest,
                             image quality can be severely compromized
        ictp::Cubic        - use static cubic palette; a bit slower,
                             guaranteed mediocre quality
        ictp::Optimized    - collect available colors in the image;
                             slowest, gives best results

Not all combination of ictp and ictd constants are valid

is:: - image statistics indices

See "stats" in Prima::Image.

        is::RangeLo  - minimum pixel value
        is::RangeHi  - maximum pixel value
        is::Mean     - mean value
        is::Variance - variance
        is::StdDev   - standard deviation
        is::Sum      - sum of pixel values
        is::Sum2     - sum of squares of pixel values

kb:: - keyboard virtual codes

See also "KeyDown" in Prima::Widget.

Modificator keys
        kb::ShiftL   kb::ShiftR   kb::CtrlL      kb::CtrlR
        kb::AltL     kb::AltR     kb::MetaL      kb::MetaR
        kb::SuperL   kb::SuperR   kb::HyperL     kb::HyperR
        kb::CapsLock kb::NumLock  kb::ScrollLock kb::ShiftLock
Keys with character code defined
        kb::Backspace  kb::Tab    kb::Linefeed   kb::Enter
        kb::Return     kb::Escape kb::Esc        kb::Space
Function keys
        kb::F1 .. kb::F30
        kb::L1 .. kb::L10
        kb::R1 .. kb::R10
Other
        kb::Clear    kb::Pause   kb::SysRq  kb::SysReq
        kb::Delete   kb::Home    kb::Left   kb::Up
        kb::Right    kb::Down    kb::PgUp   kb::Prior
        kb::PageUp   kb::PgDn    kb::Next   kb::PageDown
        kb::End      kb::Begin   kb::Select kb::Print
        kb::PrintScr kb::Execute kb::Insert kb::Undo
        kb::Redo     kb::Menu    kb::Find   kb::Cancel
        kb::Help     kb::Break   kb::BackTab
Masking constants
        kb::CharMask - character codes
        kb::CodeMask - virtual key codes ( all other kb:: values )
        kb::ModMask  - km:: values

km:: - keyboard modifiers

See also "KeyDown" in Prima::Widget.

        km::Shift
        km::Ctrl
        km::Alt
        km::KeyPad
        km::DeadKey
        km::Unicode

mt:: - modality types

See "get_modal" in Prima::Window, "get_modal_window" in Prima::Window

        mt::None
        mt::Shared
        mt::Exclusive

nt:: - notification types

Used in Prima::Component::notification_types to describe event flow.

See also "Flow" in Prima::Object.

Starting point constants
        nt::PrivateFirst
        nt::CustomFirst
Direction constants
        nt::FluxReverse
        nt::FluxNormal
Complexity constants
        nt::Single
        nt::Multiple
        nt::Event
Composite constants
        nt::Default       ( PrivateFirst | Multiple | FluxReverse)
        nt::Property      ( PrivateFirst | Single   | FluxNormal )
        nt::Request       ( PrivateFirst | Event    | FluxNormal )
        nt::Notification  ( CustomFirst  | Multiple | FluxReverse )
        nt::Action        ( CustomFirst  | Single   | FluxReverse )
        nt::Command       ( CustomFirst  | Event    | FluxReverse )

mb:: - mouse buttons

See also "MouseDown" in Prima::Widget.

        mb::b1 or mb::Left
        mb::b2 or mb::Middle
        mb::b3 or mb::Right
        mb::b4
        mb::b5
        mb::b6
        mb::b7
        mb::b8

mb:: - message box constants

Message box and modal result button commands

See also "modalResult" in Prima::Window, "modalResult" in Prima::Button.

        mb::OK, mb::Ok
        mb::Cancel
        mb::Yes
        mb::No
        mb::Abort
        mb::Retry
        mb::Ignore
        mb::Help
Message box composite ( multi-button ) constants
        mb::OKCancel, mb::OkCancel
        mb::YesNo
        mb::YesNoCancel
Message box icon and bell constants
        mb::Error
        mb::Warning
        mb::Information
        mb::Question

ps:: - paint states

        ps::Disabled    - can neither draw, nor get/set graphical properties on an object
        ps::Enabled     - can both draw and get/set graphical properties on an object
        ps::Information - can only get/set graphical properties on an object

For brevity, ps::Disabled is equal to 0 so this allows for simple boolean testing whether one can get/set graphical properties on an object.

See "get_paint_state" in Drawable.

rgn:: - result of Prima::Region.rect_inside

        rgn::Inside
        rgn::Outside    - rectangle is fully outside the region
        rgn::Partially

rgnop:: - Prima::Region.combine set operations

        rgnop::Copy
        rgnop::Intersect
        rgnop::Union
        rgnop::Xor
        rgnop::Diff

rop:: - raster operation codes

See "Raster operations" in Prima::Drawable

        rop::Blackness      #   = 0
        rop::NotOr          #   = !(src | dest)
        rop::NotSrcAnd      #  &= !src
        rop::NotPut         #   = !src
        rop::NotDestAnd     #   = !dest & src
        rop::Invert         #   = !dest
        rop::XorPut         #  ^= src
        rop::NotAnd         #   = !(src & dest)
        rop::AndPut         #  &= src
        rop::NotXor         #   = !(src ^ dest)
        rop::NotSrcXor      #     alias for rop::NotXor
        rop::NotDestXor     #     alias for rop::NotXor
        rop::NoOper         #   = dest
        rop::NotSrcOr       #  |= !src
        rop::CopyPut        #   = src
        rop::NotDestOr      #   = !dest | src
        rop::OrPut          #  |= src
        rop::Whiteness      #   = 1

12 Porter-Duff operators

        rop::Clear
        rop::Xor
        rop::SrcOver
        rop::DstOver
        rop::SrcCopy
        rop::DstCopy
        rop::SrcIn
        rop::DstIn
        rop::SrcOut
        rop::DstOut
        rop::SrcAtop
        rop::DstAtop

        rop::PorterDuffMask - masks out all bits but the constants above

Constant alpha flags

        rop::SrcAlpha
        rop::SrcAlphaShift
        rop::DstAlpha
        rop::DstAlphaShift
        rop::ConstantAlpha

Others

        rop::AlphaCopy

sbmp:: - system bitmaps indices

See also Prima::StdBitmap.

        sbmp::Logo
        sbmp::CheckBoxChecked
        sbmp::CheckBoxCheckedPressed
        sbmp::CheckBoxUnchecked
        sbmp::CheckBoxUncheckedPressed
        sbmp::RadioChecked
        sbmp::RadioCheckedPressed
        sbmp::RadioUnchecked
        sbmp::RadioUncheckedPressed
        sbmp::Warning
        sbmp::Information
        sbmp::Question
        sbmp::OutlineCollapse
        sbmp::OutlineExpand
        sbmp::Error
        sbmp::SysMenu
        sbmp::SysMenuPressed
        sbmp::Max
        sbmp::MaxPressed
        sbmp::Min
        sbmp::MinPressed
        sbmp::Restore
        sbmp::RestorePressed
        sbmp::Close
        sbmp::ClosePressed
        sbmp::Hide
        sbmp::HidePressed
        sbmp::DriveUnknown
        sbmp::DriveFloppy
        sbmp::DriveHDD
        sbmp::DriveNetwork
        sbmp::DriveCDROM
        sbmp::DriveMemory
        sbmp::GlyphOK
        sbmp::GlyphCancel
        sbmp::SFolderOpened
        sbmp::SFolderClosed
        sbmp::Last

sv:: - system value indices

See also "get_system_value" in Prima::Application

        sv::YMenu            - height of menu bar in top-level windows
        sv::YTitleBar        - height of title bar in top-level windows
        sv::XIcon            - width and height of main icon dimensions,
        sv::YIcon              acceptable by the system
        sv::XSmallIcon       - width and height of alternate icon dimensions,
        sv::YSmallIcon         acceptable by the system
        sv::XPointer         - width and height of mouse pointer icon
        sv::YPointer           acceptable by the system
        sv::XScrollbar       - width of the default vertical scrollbar
        sv::YScrollbar       - height of the default horizontal scrollbar
        sv::XCursor          - width of the system cursor
        sv::AutoScrollFirst  - the initial and the repetitive
        sv::AutoScrollNext     scroll timeouts
        sv::InsertMode       - the system insert mode
        sv::XbsNone          - widths and heights of the top-level window
        sv::YbsNone            decorations, correspondingly, with borderStyle
        sv::XbsSizeable        bs::None, bs::Sizeable, bs::Single, and
        sv::YbsSizeable        bs::Dialog.
        sv::XbsSingle
        sv::YbsSingle
        sv::XbsDialog
        sv::YbsDialog
        sv::MousePresent     - 1 if the mouse is present, 0 otherwise
        sv::MouseButtons     - number of the mouse buttons
        sv::WheelPresent     - 1 if the mouse wheel is present, 0 otherwise
        sv::SubmenuDelay     - timeout ( in ms ) before a sub-menu shows on
                                an implicit selection
        sv::FullDrag         - 1 if the top-level windows are dragged dynamically,
                               0 - with marquee mode
        sv::DblClickDelay    - mouse double-click timeout in milliseconds
        sv::ShapeExtension   - 1 if Prima::Widget::shape functionality is supported,
                               0 otherwise
        sv::ColorPointer     - 1 if system accepts color pointer icons.
        sv::CanUTF8_Input    - 1 if system can generate key codes in unicode
        sv::CanUTF8_Output   - 1 if system can output utf8 text
        sv::CompositeDisplay - 1 if system uses double-buffering and alpha composition for the desktop,
                               0 if it doesn't, -1 if unknown
        sv::LayeredWidgets   - 1 if system supports layering
        sv::DWM              - 1 if system supports DWM API

ta:: - alignment constants

Used in: Prima::InputLine, Prima::ImageViewer, Prima::Label.

        ta::Left
        ta::Right
        ta::Center

        ta::Top
        ta::Bottom
        ta::Middle

tw:: - text wrapping constants

See "text_wrap" in Prima::Drawable

        tw::CalcMnemonic          - calculates tilde underline position
        tw::CollapseTilde         - removes escaping tilde from text
        tw::CalcTabs              - wraps text with respect to tab expansion
        tw::ExpandTabs            - expands tab characters
        tw::BreakSingle           - determines if text is broken to single
                                    characters when text cannot be fit
        tw::NewLineBreak          - breaks line on newline characters
        tw::SpaceBreak            - breaks line on space or tab characters
        tw::ReturnChunks          - returns wrapped text chunks
        tw::ReturnLines           - returns positions and lengths of wrapped
                                    text chunks
        tw::WordBreak             - defines if text break by width goes by the
                                    characters or by the words
        tw::ReturnFirstLineLength - returns length of the first wrapped line
        tw::Default               - tw::NewLineBreak | tw::CalcTabs | tw::ExpandTabs |
                                    tw::ReturnLines | tw::WordBreak

wc:: - widget classes

See "widgetClass" in Prima::Widget

        wc::Undef
        wc::Button
        wc::CheckBox
        wc::Combo
        wc::Dialog
        wc::Edit
        wc::InputLine
        wc::Label
        wc::ListBox
        wc::Menu
        wc::Popup
        wc::Radio
        wc::ScrollBar
        wc::Slider
        wc::Widget, wc::Custom
        wc::Window
        wc::Application

ws:: - window states

See "windowState" in Prima::Window

        ws::Normal
        ws::Minimized
        ws::Maximized

AUTHOR

Dmitry Karasik, <dmitry@karasik.eu.org>.

SEE ALSO

Prima, Prima::Classes