Top | ![]() |
![]() |
![]() |
![]() |
Abstracted event loopAbstracted event loop — Abstracted event loop API for customizing event loop in GCutter. |
Functions
GQuark | gcut_event_loop_error_quark () |
void | gcut_event_loop_run () |
gboolean | gcut_event_loop_iterate () |
void | gcut_event_loop_quit () |
guint | gcut_event_loop_watch_io () |
guint | gcut_event_loop_watch_child () |
guint | gcut_event_loop_watch_child_full () |
guint | gcut_event_loop_add_timeout () |
guint | gcut_event_loop_add_timeout_full () |
guint | gcut_event_loop_add_idle () |
guint | gcut_event_loop_add_idle_full () |
gboolean | gcut_event_loop_remove () |
Description
GCutEventLoop encapsulates event loop. For example, event loop is used in GCutProcess. It uses the GLib's default main context for it.
Normally, a custom GCutEventLoop isn't required. It is needed some special case. For example, using libev as event loop backend instead of GLib's main loop.
GCutter provides GCutEventLoop for GLib's main context and main loop, GCutGLibEventLoop.
Functions
gcut_event_loop_run ()
void
gcut_event_loop_run (GCutEventLoop *loop
);
Runs the given event loop until gcut_event_loop_quit()
is
called on the loop.
Since: 1.1.6
gcut_event_loop_iterate ()
gboolean gcut_event_loop_iterate (GCutEventLoop *loop
,gboolean may_block
);
Runs a single iteration for the given event loop. If no
events are ready and may_block
is TRUE
, waiting
for a event become ready. Otherwise, if may_block
is
FALSE
, events are not waited to become ready.
Since: 1.1.6
gcut_event_loop_quit ()
void
gcut_event_loop_quit (GCutEventLoop *loop
);
Stops the loop
from running.
Since: 1.1.6
gcut_event_loop_watch_io ()
guint gcut_event_loop_watch_io (GCutEventLoop *loop
,GIOChannel *channel
,GIOCondition condition
,GIOFunc function
,gpointer data
);
Adds the channel
into loop
with the default
priority. function
is called when condition
is met for
the given channel
.
Parameters
loop |
||
channel |
a GIOChannel |
|
condition |
conditions to watch for |
|
function |
function to call |
|
data |
data to pass to |
Since: 1.1.6
gcut_event_loop_watch_child ()
guint gcut_event_loop_watch_child (GCutEventLoop *loop
,GPid pid
,GChildWatchFunc function
,gpointer data
);
Adds the function
to be called when the child indicated
by pid
exits into loop
with the default priority.
Since: 1.1.6
gcut_event_loop_watch_child_full ()
guint gcut_event_loop_watch_child_full (GCutEventLoop *loop
,gint priority
,GPid pid
,GChildWatchFunc function
,gpointer data
,GDestroyNotify notify
);
Adds the function
to be called when the child indicated
by pid
exits into loop
with the priority
.
Parameters
loop |
||
priority |
the priority of the event. |
|
pid |
process ID to watch |
|
function |
function to call |
|
data |
data to pass to |
|
notify |
function to call when the event is removed, or |
Since: 1.1.6
gcut_event_loop_add_timeout ()
guint gcut_event_loop_add_timeout (GCutEventLoop *loop
,gdouble interval_in_seconds
,GSourceFunc function
,gpointer data
);
Adds the function
to be called at regular intervals,
with the default priority.
Parameters
loop |
||
interval_in_seconds |
the time between calls to the |
|
function |
function to call |
|
data |
data to pass to |
Since: 1.1.6
gcut_event_loop_add_timeout_full ()
guint gcut_event_loop_add_timeout_full (GCutEventLoop *loop
,gint priority
,gdouble interval_in_seconds
,GSourceFunc function
,gpointer data
,GDestroyNotify notify
);
Adds the function
to be called at regular intervals,
with the priority
.
Parameters
loop |
||
priority |
the priority of the event. |
|
interval_in_seconds |
the time between calls to the |
|
function |
function to call |
|
data |
data to pass to |
|
notify |
function to call when the event is removed, or |
Since: 1.1.6
gcut_event_loop_add_idle ()
guint gcut_event_loop_add_idle (GCutEventLoop *loop
,GSourceFunc function
,gpointer data
);
Adds the function
to be called whenever there are no
higher priority events pending with the default priority.
Since: 1.1.6
gcut_event_loop_add_idle_full ()
guint gcut_event_loop_add_idle_full (GCutEventLoop *loop
,gint priority
,GSourceFunc function
,gpointer data
,GDestroyNotify notify
);
Adds the function
to be called whenever there are no
higher priority events pending with the priority
.
Parameters
loop |
||
priority |
the priority of the event. |
|
function |
function to call |
|
data |
data to pass to |
|
notify |
function to call when the event is removed, or |
Since: 1.1.6
gcut_event_loop_remove ()
gboolean gcut_event_loop_remove (GCutEventLoop *loop
,guint tag
);
Removes the event with the given ID, tag
.
Since: 1.1.6