.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Prima::Utils 3" .TH Prima::Utils 3 "2009-02-24" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Prima::Utils \- miscellanneous routines .SH "DESCRIPTION" .IX Header "DESCRIPTION" The module contains several helper routines, implemented in both C and perl. Whereas the C\-coded parts are accessible only if 'use Prima;' statement was issued prior to the 'use Prima::Utils' invocation, the perl-coded are always available. This makes the module valuable when used without the rest of toolkit code. .SH "API" .IX Header "API" .ie n .IP "alarm $TIMEOUT, $SUB, @PARAMS" 4 .el .IP "alarm \f(CW$TIMEOUT\fR, \f(CW$SUB\fR, \f(CW@PARAMS\fR" 4 .IX Item "alarm $TIMEOUT, $SUB, @PARAMS" Calls \s-1SUB\s0 with \s-1PARAMS\s0 after \s-1TIMEOUT\s0 milliseconds. .IP "beep [ \s-1FLAGS\s0 = mb::Error ]" 4 .IX Item "beep [ FLAGS = mb::Error ]" Invokes the system-depended sound and/or visual bell, corresponding to one of following constants: .Sp .Vb 4 \& mb::Error \& mb::Warning \& mb::Information \& mb::Question .Ve .IP "get_gui" 4 .IX Item "get_gui" Returns one of \f(CW\*(C`gui::XXX\*(C'\fR constants, reflecting the graphic user interface used in the system: .Sp .Vb 5 \& gui::Default \& gui::PM \& gui::Windows \& gui::XLib \& gui::GTK2 .Ve .IP "get_os" 4 .IX Item "get_os" Returns one of \f(CW\*(C`apc::XXX\*(C'\fR constants, reflecting the platfrom. Currently, the list of the supported platforms is: .Sp .Vb 3 \& apc::Os2 \& apc::Win32 \& apc::Unix .Ve .IP "ceil \s-1DOUBLE\s0" 4 .IX Item "ceil DOUBLE" Obsolete function. .Sp Returns stdlib's \fIceil()\fR of \s-1DOUBLE\s0 .IP "find_image \s-1PATH\s0" 4 .IX Item "find_image PATH" Converts \s-1PATH\s0 from perl module notation into a file path, and searches for the file in \f(CW@INC\fR paths set. If a file is found, its full filename is returned; otherwise \f(CW\*(C`undef\*(C'\fR is returned. .IP "floor \s-1DOUBLE\s0" 4 .IX Item "floor DOUBLE" Obsolete function. .Sp Returns stdlib's \fIfloor()\fR of \s-1DOUBLE\s0 .IP "getdir \s-1PATH\s0" 4 .IX Item "getdir PATH" Reads content of \s-1PATH\s0 directory and returns array of string pairs, where the first item is a file name, and the second is a file type. .Sp The file type is a string, one of the following: .Sp .Vb 8 \& "fifo" \- named pipe \& "chr" \- character special file \& "dir" \- directory \& "blk" \- block special file \& "reg" \- regular file \& "lnk" \- symbolic link \& "sock" \- socket \& "wht" \- whiteout .Ve .Sp This function was implemented for faster directory reading, to avoid successive call of \f(CW\*(C`stat\*(C'\fR for every file. .IP "path [ \s-1FILE\s0 ]" 4 .IX Item "path [ FILE ]" If called with no parameters, returns path to a directory, usually \fI~/.prima\fR, that can be used to contain the user settings of a toolkit module or a program. If \s-1FILE\s0 is specified, appends it to the path and returns the full file name. In the latter case the path is automatically created by \f(CW\*(C`File::Path::mkpath\*(C'\fR unless it already exists. .ie n .IP "post $SUB, @PARAMS" 4 .el .IP "post \f(CW$SUB\fR, \f(CW@PARAMS\fR" 4 .IX Item "post $SUB, @PARAMS" Postpones a call to \s-1SUB\s0 with \s-1PARAMS\s0 until the next event loop tick. .ie n .IP "query_drives_map [ \s-1FIRST_DRIVE\s0 = ""A:"" ]" 4 .el .IP "query_drives_map [ \s-1FIRST_DRIVE\s0 = ``A:'' ]" 4 .IX Item "query_drives_map [ FIRST_DRIVE = A: ]" Returns anonymous array to drive letters, used by the system. \&\s-1FIRST_DRIVE\s0 can be set to other value to start enumeration from. Some OSes can probe eventual diskette drives inside the drive enumeration routines, so there is a chance to increase responsiveness of the function it might be reasonable to set \s-1FIRST_DRIVE\s0 to \f(CW\*(C`C:\*(C'\fR string. .Sp If the system supports no drive letters, empty array reference is returned ( unix ). .IP "query_drive_type \s-1DRIVE\s0" 4 .IX Item "query_drive_type DRIVE" Returns one of \f(CW\*(C`dt::XXX\*(C'\fR constants, describing the type of drive, where \s-1DRIVE\s0 is a 1\-character string. If there is no such drive, or the system supports no drive letters ( unix ), \f(CW\*(C`dt::None\*(C'\fR is returned. .Sp .Vb 7 \& dt::None \& dt::Unknown \& dt::Floppy \& dt::HDD \& dt::Network \& dt::CDROM \& dt::Memory .Ve .IP "sound [ \s-1FREQUENCY\s0 = 2000, \s-1DURATION\s0 = 100 ]" 4 .IX Item "sound [ FREQUENCY = 2000, DURATION = 100 ]" Issues a tone of \s-1FREQUENCY\s0 in Hz with \s-1DURATION\s0 in milliseconds. .IP "username" 4 .IX Item "username" Returns the login name of the user. Sometimes is preferred to the perl-provided \f(CW\*(C`getlogin\*(C'\fR ( see \*(L"getlogin\*(R" in perlfunc ) . .IP "xcolor \s-1COLOR\s0" 4 .IX Item "xcolor COLOR" Accepts \s-1COLOR\s0 string on one of the three formats: .Sp .Vb 3 \& #rgb \& #rrggbb \& #rrrgggbbb .Ve .Sp and returns 24\-bit \s-1RGB\s0 integer value. .SH "AUTHOR" .IX Header "AUTHOR" Dmitry Karasik, . .SH "SEE ALSO" .IX Header "SEE ALSO" Prima