ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Glib-Event/Event.pm
Revision: 1.3
Committed: Tue Nov 29 15:30:55 2005 UTC (20 years, 9 months ago) by root
Branch: MAIN
Changes since 1.2: +6 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 =head1 NAME
2    
3 root 1.2 Glib::Event - Coerce Glib into using the Event module as event loop.
4 root 1.1
5     =head1 SYNOPSIS
6    
7     use Glib::Event;
8    
9 root 1.2 # example with Gtk2:
10     use Gtk2;
11     use Glib::Event;
12     use Event; # any order
13     Event->timer (after => 1, interval => 1, cb => sub { print "I am here!\n" });
14     main Gtk2;
15     # etc., it just works
16    
17 root 1.1 =head1 DESCRIPTION
18    
19     This module coerces the Glib event loop to use the Event module as
20     underlying event loop, i.e. Event will be used by Glib for all events.
21    
22     This makes Glib compatible to Event. Calls into the Glib main loop
23     are more or less equivalent to calls to C<Event::loop>.
24    
25     =over 4
26    
27     =item * The Glib perl module is not used.
28    
29     This module has no dependency on the existing Glib perl interface, as it
30     uses glib directly. The Glib module can, however, be used without any
31     problems.
32    
33     =item * The default context will be changed when the module is loaded.
34    
35     Loading this module will automatically "patch" the default context of
36     libglib, so normally nothing more is required.
37    
38 root 1.3 =item * Glib does not allow recursive invocations.
39    
40     This means that none of your event watchers might call into Glib
41     functions or functions that might call glib functions (basically all Gtk2
42     functions).
43    
44 root 1.1 =cut
45    
46     package Glib::Event;
47    
48     use Carp ();
49     use Event ();
50    
51     our $default_poll_func;
52    
53     BEGIN {
54     $VERSION = 0.1;
55    
56     require XSLoader;
57 root 1.2 XSLoader::load (Glib::Event, $VERSION);
58 root 1.1
59     $default_poll_func = install (undef);
60     }
61    
62     =back
63    
64     =cut
65    
66 root 1.2 =head1 BUGS
67    
68     * No documented API to patch other main contexts.
69     * Uses one_event, which is inefficient.
70    
71 root 1.1 =head1 SEE ALSO
72    
73     L<Event>, L<Glib>, L<Glib::MainLoop>.
74    
75     =head1 AUTHOR
76    
77     Marc Lehmann <schmorp@schmorp.de>
78     http://home.schmorp.de/
79    
80     =cut
81    
82     1
83