home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / perl5 / Glib / Utils.pod < prev    next >
Encoding:
Text File  |  2008-11-04  |  4.5 KB  |  259 lines

  1. =head1 NAME
  2.  
  3. Glib::Utils -  Miscellaneous utility functions
  4.  
  5. =for position SYNOPSIS
  6.  
  7. =head1 SYNOPSIS
  8.  
  9.   use Glib;
  10.   Glib::set_application_name (Glib::get_real_name."'s Cool Program");
  11.  
  12.   print "app name is ".Glib::get_application_name()."\n";
  13.  
  14. =for position DESCRIPTION
  15.  
  16. =head1 DESCRIPTION
  17.  
  18. Here are some useful miscellaneous utilities.
  19. GLib is a portability library, providing portable utility functions for
  20. C programs.  As such, most of these functions seem to violate the Glib
  21. binding principle of not duplicating functionality that Perl already
  22. provides, but there's a distinction for each one, i swear.  The functions
  23. for dealing with user information are provided on all GLib-supported
  24. platforms, not just where POSIX (which provides similar information) is
  25. available, and even work on platforms where %ENV may not include the
  26. expected information.  Also, the "application name" referred to by
  27. (set|get)_application_name is a human readable name, distinct from the
  28. actual program name provided by Perl's own $0.
  29.  
  30. =cut
  31.  
  32.  
  33.  
  34. =for object Glib::Utils Miscellaneous utility functions
  35. =cut
  36.  
  37.  
  38.  
  39.  
  40. =head1 METHODS
  41.  
  42. =head2 string = Glib::get_application_name 
  43.  
  44. =over
  45.  
  46. Get the human-readable application name set by C<set_application_name>.
  47.  
  48. Since: glib 2.2
  49.  
  50. =back
  51.  
  52. =head2 Glib::set_application_name ($application_name)
  53.  
  54. =over
  55.  
  56. =over
  57.  
  58. =item * $application_name (string) 
  59.  
  60. =back
  61.  
  62. Set the human-readable application name.
  63.  
  64. Since: glib 2.2
  65.  
  66. =back
  67.  
  68. =head2 string = Glib::get_home_dir 
  69.  
  70. =over
  71.  
  72. Find the current user's home directory, by system-dependent/appropriate
  73. means.
  74.  
  75. =back
  76.  
  77. =head2 list = Glib::get_language_names 
  78.  
  79. =over
  80.  
  81. Computes a list of applicable locale names, which can be used to e.g. construct
  82. locale-dependent filenames or search paths. The returned list is sorted from
  83. most desirable to least desirable and always contains the default locale "C".
  84.  
  85. Since: glib 2.6
  86.  
  87. =back
  88.  
  89. =head2 string = Glib::get_real_name 
  90.  
  91. =over
  92.  
  93. Get the current user's real name.
  94.  
  95. =back
  96.  
  97. =head2 string = Glib::strerror ($err)
  98.  
  99. =over
  100.  
  101. =over
  102.  
  103. =item * $err (integer) 
  104.  
  105. =back
  106.  
  107. Return a string describing the given errno value, like "No such file
  108. or directory" for ENOENT.  This is translated into the user's
  109. preferred language and is a utf8 wide-char string (unlike a $!
  110. string (L<perlvar>) or POSIX::strerror (L<POSIX>) which are locale
  111. codeset bytes).
  112.  
  113. =back
  114.  
  115. =head2 string = Glib::strsignal ($signum)
  116.  
  117. =over
  118.  
  119. =over
  120.  
  121. =item * $signum (integer) 
  122.  
  123. =back
  124.  
  125. Return a string describing the given signal number, like "Segmentation
  126. violation" for SIGSEGV.  This is translated into the user's preferred
  127. language and is a utf8 wide-char string.
  128.  
  129. =back
  130.  
  131. =head2 list = Glib::get_system_config_dirs 
  132.  
  133. =over
  134.  
  135. Returns an ordered list of base directories in which to access system-wide
  136. configuration information.
  137.  
  138. Since: glib 2.6
  139.  
  140. =back
  141.  
  142. =head2 list = Glib::get_system_data_dirs 
  143.  
  144. =over
  145.  
  146. Returns an ordered list of base directories in which to access system-wide
  147. application data.
  148.  
  149. Since: glib 2.6
  150.  
  151. =back
  152.  
  153. =head2 string = Glib::get_tmp_dir 
  154.  
  155. =over
  156.  
  157. Get the temp dir as appropriate for the current system.  See the GLib docs
  158. for info on how it works.
  159.  
  160. =back
  161.  
  162. =head2 string = Glib::get_user_cache_dir 
  163.  
  164. =over
  165.  
  166. Gets the base directory in which to store non-essential, cached data specific
  167. to particular user.
  168.  
  169. Since: glib 2.6
  170.  
  171. =back
  172.  
  173. =head2 string = Glib::get_user_config_dir 
  174.  
  175. =over
  176.  
  177. Gets the base directory in which to store user-specific application
  178. configuration information such as user preferences and settings.
  179.  
  180. Since: glib 2.6
  181.  
  182. =back
  183.  
  184. =head2 string = Glib::get_user_data_dir 
  185.  
  186. =over
  187.  
  188. Get the base directory for application data such as icons that is customized
  189. for a particular user.
  190.  
  191. Since: glib 2.6
  192.  
  193. =back
  194.  
  195. =head2 string = Glib::get_user_name 
  196.  
  197. =over
  198.  
  199. Get the current user's name by whatever system-dependent means necessary.
  200.  
  201. =back
  202.  
  203. =head2 string = Glib::get_user_special_dir ($directory)
  204.  
  205. =over
  206.  
  207. =over
  208.  
  209. =item * $directory (Glib::UserDirectory) 
  210.  
  211. =back
  212.  
  213. Returns the full path of a special directory using its logical id.
  214.  
  215. Since: glib 2.14
  216.  
  217. =back
  218.  
  219.  
  220. =head1 ENUMS AND FLAGS
  221.  
  222. =head2 enum Glib::UserDirectory
  223.  
  224. =over
  225.  
  226. =item * 'desktop' / 'G_USER_DIRECTORY_DESKTOP'
  227.  
  228. =item * 'documents' / 'G_USER_DIRECTORY_DOCUMENTS'
  229.  
  230. =item * 'download' / 'G_USER_DIRECTORY_DOWNLOAD'
  231.  
  232. =item * 'music' / 'G_USER_DIRECTORY_MUSIC'
  233.  
  234. =item * 'pictures' / 'G_USER_DIRECTORY_PICTURES'
  235.  
  236. =item * 'public-share' / 'G_USER_DIRECTORY_PUBLIC_SHARE'
  237.  
  238. =item * 'templates' / 'G_USER_DIRECTORY_TEMPLATES'
  239.  
  240. =item * 'videos' / 'G_USER_DIRECTORY_VIDEOS'
  241.  
  242. =back
  243.  
  244.  
  245.  
  246. =head1 SEE ALSO
  247.  
  248. L<Glib>
  249.  
  250. =head1 COPYRIGHT
  251.  
  252. Copyright (C) 2003-2008 by the gtk2-perl team.
  253.  
  254. This software is licensed under the LGPL.  See L<Glib> for a full notice.
  255.  
  256.  
  257. =cut
  258.  
  259.