Changeset 74fc22a for perlwrap.pm
- Timestamp:
- Jan 10, 2008, 3:48:00 PM (17 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- b68342b
- Parents:
- 635881c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perlwrap.pm
r18fb3d4f r74fc22a 14 14 15 15 package BarnOwl; 16 17 =head1 NAME 18 19 BarnOwl 20 21 =head1 DESCRIPTION 22 23 The BarnOwl module contains the core of BarnOwl's perl 24 bindings. Source in this module is also run at startup to bootstrap 25 barnowl by defining things like the default style. 26 27 =for NOTE 28 These following functions are defined in perlglue.xs. Keep the 29 documentation here in sync with the user-visible commands defined 30 there! 31 32 =head2 command STRING 33 34 Executes a BarnOwl command in the same manner as if the user had 35 executed it at the BarnOwl command prompt. If the command returns a 36 value, return it as a string, otherwise return undef. 37 38 =head2 getcurmsg 39 40 Returns the current message as a C<BarnOwl::Message> subclass, or 41 undef if there is no message selected 42 43 =head2 getnumcols 44 45 Returns the width of the display window BarnOwl is currently using 46 47 =head2 getidletime 48 49 Returns the length of time since the user has pressed a key, in 50 seconds. 51 52 =head2 zephyr_getrealm 53 54 Returns the zephyr realm barnowl is running in 55 56 =head2 zephyr_getsender 57 58 Returns the fully-qualified name of the zephyr sender barnowl is 59 running as, e.g. C<nelhage@ATHENA.MIT.EDU> 60 61 =head2 zephyr_zwrite COMMAND MESSAGE 62 63 Sends a zephyr programmatically. C<COMMAND> should be a C<zwrite> 64 command line, and C<MESSAGE> is the zephyr body to send. 65 66 =head2 ztext_stylestrip STRING 67 68 Strips zephyr formatting from a string and returns the result 69 70 =head2 queue_message MESSAGE 71 72 Enqueue a message in the BarnOwl message list, logging it and 73 processing it appropriately. C<MESSAGE> should be an instance of 74 BarnOwl::Message or a subclass. 75 76 =head2 admin_message HEADER BODY 77 78 Display a BarnOwl B<Admin> message, with the given header and body. 79 80 =head2 start_question PROMPT CALLBACK 81 82 Displays C<PROMPT> on the screen and lets the user enter a line of 83 text, and calls C<CALLBACK>, which must be a perl subroutine 84 reference, with the text the user entered 85 86 =head2 start_password PROMPT CALLBACK 87 88 Like C<start_question>, but echoes the user's input as C<*>s when they 89 input. 90 91 =head2 start_editwin PROMPT CALLBACK 92 93 Like C<start_question>, but displays C<PROMPT> on a line of its own 94 and opens the editwin. If the user cancels the edit win, C<CALLBACK> 95 is not invoked. 96 97 =head2 get_data_dir 98 99 Returns the BarnOwl system data directory, where system libraries and 100 modules are stored 101 102 =head2 get_config_dir 103 104 Returns the BarnOwl user configuration directory, where user modules 105 and configuration are stored (by default, C<$HOME/.owl>) 106 107 =head2 popless_text TEXT 108 109 Show a popup window containing the given C<TEXT> 110 111 =head2 popless_ztext TEXT 112 113 Show a popup window containing the provided zephyr-formatted C<TEXT> 114 115 =head2 error STRING 116 117 Reports an error and log it in `show errors'. Note that in any 118 callback or hook called in perl code from BarnOwl, a C<die> will be 119 caught and passed to C<error>. 120 121 =head2 getnumcolors 122 123 Returns the number of colors this BarnOwl is capable of displaying 124 125 =cut 126 16 127 17 128 BEGIN { … … 46 157 return &BarnOwl::Hooks::_receive_msg($m); 47 158 } 159 160 =head2 AUTOLOAD 161 162 BarnOwl.pm has a C<AUTOLOAD> method that translates unused names in 163 the BarnOwl:: namespace to a call to BarnOwl::command() with that 164 command. Underscores are also translated to C<->s, so you can do 165 e.g. C<BarnOwl::start_command()> and it will be translated into 166 C<start-command>. 167 168 So, if you're looking for functionality that you can't find in the 169 perl interface, check C<:show commands> or C<commands.c> in the 170 BarnOwl source tree -- there's a good chance it exists as a BarnOwl 171 command. 172 173 =head3 BUGS 174 175 There are horrible quoting issues here. The AUTOLOAD simple joins your 176 commands with spaces and passes them unmodified to C<::command> 177 178 =cut 48 179 49 180 # make BarnOwl::<command>("foo") be aliases to BarnOwl::command("<command> foo"); … … 63 194 64 195 ARGS should be a hashref containing any or all of C<summary>, 65 C<usage>, or C<description> keys. 196 C<usage>, or C<description> keys: 197 198 =over 4 199 200 =item summary 201 202 A one-line summary of the purpose of the command 203 204 =item usage 205 206 A one-line usage synopsis, showing available options and syntax 207 208 =item description 209 210 A longer description of the syntax and semantics of the command, 211 explaining usage and options 212 213 =back 66 214 67 215 =cut
Note: See TracChangeset
for help on using the changeset viewer.