1Prima::Utils(3)       User Contributed Perl Documentation      Prima::Utils(3)
2
3
4

NAME

6       Prima::Utils - miscellanneous routines
7

DESCRIPTION

9       The module contains several helper routines, implemented in both C and
10       perl.  Whereas the C-coded parts are accessible only if 'use Prima;'
11       statement was issued prior to the 'use Prima::Utils' invocation, the
12       perl-coded are always available.  This makes the module valuable when
13       used without the rest of toolkit code.
14

API

16       alarm $TIMEOUT, $SUB, @PARAMS
17           Calls SUB with PARAMS after TIMEOUT milliseconds.
18
19       beep [ FLAGS = mb::Error ]
20           Invokes the system-depended sound and/or visual bell, corresponding
21           to one of following constants:
22
23                   mb::Error
24                   mb::Warning
25                   mb::Information
26                   mb::Question
27
28       get_gui
29           Returns one of "gui::XXX" constants, reflecting the graphic user
30           interface used in the system:
31
32                   gui::Default
33                   gui::PM
34                   gui::Windows
35                   gui::XLib
36                   gui::GTK2
37
38       get_os
39           Returns one of "apc::XXX" constants, reflecting the platfrom.
40           Currently, the list of the supported platforms is:
41
42                   apc::Win32
43                   apc::Unix
44
45       ceil DOUBLE
46           Obsolete function.
47
48           Returns stdlib's ceil() of DOUBLE
49
50       find_image PATH
51           Converts PATH from perl module notation into a file path, and
52           searches for the file in @INC paths set. If a file is found, its
53           full filename is returned; otherwise "undef" is returned.
54
55       floor DOUBLE
56           Obsolete function.
57
58           Returns stdlib's floor() of DOUBLE
59
60       getdir PATH
61           Reads content of PATH directory and returns array of string pairs,
62           where the first item is a file name, and the second is a file type.
63
64           The file type is a string, one of the following:
65
66                   "fifo" - named pipe
67                   "chr"  - character special file
68                   "dir"  - directory
69                   "blk"  - block special file
70                   "reg"  - regular file
71                   "lnk"  - symbolic link
72                   "sock" - socket
73                   "wht"  - whiteout
74
75           This function was implemented for faster directory reading, to
76           avoid successive call of "stat" for every file.
77
78       last_error
79           Returns last system error, if any
80
81       path [ FILE ]
82           If called with no parameters, returns path to a directory, usually
83           ~/.prima, that can be used to contain the user settings of a
84           toolkit module or a program. If FILE is specified, appends it to
85           the path and returns the full file name. In the latter case the
86           path is automatically created by "File::Path::mkpath" unless it
87           already exists.
88
89       post $SUB, @PARAMS
90           Postpones a call to SUB with PARAMS until the next event loop tick.
91
92       query_drives_map [ FIRST_DRIVE = "A:" ]
93           Returns anonymous array to drive letters, used by the system.
94           FIRST_DRIVE can be set to other value to start enumeration from.
95           Some OSes can probe eventual diskette drives inside the drive
96           enumeration routines, so there is a chance to increase
97           responsiveness of the function it might be reasonable to set
98           FIRST_DRIVE to "C:" string.
99
100           If the system supports no drive letters, empty array reference is
101           returned ( unix ).
102
103       query_drive_type DRIVE
104           Returns one of "dt::XXX" constants, describing the type of drive,
105           where DRIVE is a 1-character string. If there is no such drive, or
106           the system supports no drive letters ( unix ), "dt::None" is
107           returned.
108
109                   dt::None
110                   dt::Unknown
111                   dt::Floppy
112                   dt::HDD
113                   dt::Network
114                   dt::CDROM
115                   dt::Memory
116
117       sound [ FREQUENCY = 2000, DURATION = 100 ]
118           Issues a tone of FREQUENCY in Hz with DURATION in milliseconds.
119
120       username
121           Returns the login name of the user.  Sometimes is preferred to the
122           perl-provided "getlogin" ( see "getlogin" in perlfunc ) .
123
124       xcolor COLOR
125           Accepts COLOR string on one of the three formats:
126
127                   #rgb
128                   #rrggbb
129                   #rrrgggbbb
130
131           and returns 24-bit RGB integer value.
132

AUTHOR

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

SEE ALSO

137       Prima
138
139
140
141perl v5.28.0                      2017-02-28                   Prima::Utils(3)
Impressum