ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Glib-EV/README
Revision: 1.3
Committed: Sat Dec 22 16:50:52 2007 UTC (16 years, 5 months ago) by root
Branch: MAIN
CVS Tags: rel-2_0
Changes since 1.2: +7 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 NAME
2 root 1.2 Glib::EV - Coerce Glib into using the EV module as event loop.
3 root 1.1
4     SYNOPSIS
5 root 1.2 use Glib::EV;
6 root 1.1
7     # example with Gtk2:
8     use Gtk2 -init;
9 root 1.2 use Glib::EV;
10     use EV; # any order
11     my $timer = EV::timer 1, 1, sub { print "I am here!\n" };
12 root 1.1 main Gtk2;
13     # etc., it just works
14    
15     # You can even move the glib mainloop into a coroutine:
16     use Gtk2 -init;
17     use Coro;
18 root 1.2 use Coro::EV;
19     use Glib::EV;
20 root 1.1 async { main Gtk2 };
21     # ... do other things
22    
23     DESCRIPTION
24 root 1.3 If you want to use glib/gtk+ in an EV program, then you need to look at
25     the EV::Glib module, not this one, as this module requires you to run a
26     Glib or Gtk+ main loop in your program.
27    
28     If you want to use EV in an Glib/Gtk+ program, you are at the right
29     place here.
30    
31 root 1.2 This module coerces the Glib event loop to use the EV high performance
32     event loop as underlying event loop, i.e. EV will be used by Glib for
33     all events.
34    
35     This makes Glib compatible to EV. Calls into the Glib main loop are more
36     or less equivalent to calls to "EV::loop" (but not vice versa, you
37     *have* to use the Glib mainloop functions).
38 root 1.1
39     * The Glib perl module is not used.
40     This module has no dependency on the existing Glib perl interface,
41     as it uses glib directly. The Glib module can, however, be used
42 root 1.2 without any problems (as long as evereybody uses shared libraries to
43     keep everybody else happy).
44 root 1.1
45     * The default context will be changed when the module is loaded.
46     Loading this module will automatically "patch" the default context
47     of libglib, so normally nothing more is required.
48    
49     * Glib does not allow recursive invocations.
50     This means that none of your event watchers might call into Glib
51     functions or functions that might call glib functions (basically all
52     Gtk2 functions). It might work, but that's your problem....
53    
54     BUGS
55     * No documented API to patch other main contexts.
56    
57     SEE ALSO
58 root 1.2 EV, Glib, Glib::MainLoop.
59 root 1.1
60     AUTHOR
61     Marc Lehmann <schmorp@schmorp.de>
62     http://home.schmorp.de/
63