Top | ![]() |
![]() |
![]() |
![]() |
GCutEventLoopはイベントループをカプセル化します。イベントループはGCutProcessで使われています。GCutProcessはデフォルトではGLibのデフォルトGMainContextを使います。
ふつうはカスタムGCutEventLoopは必要ありません。必要になるのは特別な場合だけです。例えば、イベントループのバックエンドにGLibのGMainLoopではなく、libevのイベントループに使っている場合です。
GCutterはGLibのGMainContextとGMainLoop用のGCutEventLoopであるGCutGLibEventLoopを提供します。
void
gcut_event_loop_run (GCutEventLoop *loop
);
gcut_event_loop_quit()
が呼ばれるまでイベントループを回します。
Since: 1.1.6
gboolean gcut_event_loop_iterate (GCutEventLoop *loop
,gboolean may_block
);
イベントループを1回だけ回します。もし、イベントがなくmay_block
がTRUE
なら、イベントがくるまで待ちつづけます。may_block
がFALSE
なら、イベントがくるのを待ちません。
Since: 1.1.6
void
gcut_event_loop_quit (GCutEventLoop *loop
);
実行中のloop
を止めます。
Since: 1.1.6
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
.
Since: 1.1.6
guint gcut_event_loop_watch_child (GCutEventLoop *loop
,GPid pid
,GChildWatchFunc function
,gpointer data
);
pid
の子プロセスが終了した時に呼ばれるfunction
をデフォルトの優先度でloop
に追加します。
Since: 1.1.6
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
.
loop |
||
priority |
このイベントの優先度。 |
|
pid |
監視するプロセスのID |
|
function |
呼び出される関数 |
|
data |
|
|
notify |
このイベントが削除された時に呼ばれる関数または |
Since: 1.1.6
guint gcut_event_loop_add_timeout (GCutEventLoop *loop
,gdouble interval_in_seconds
,GSourceFunc function
,gpointer data
);
一定間隔で呼び出されるfunction
をデフォルト優先度で追加します。
loop |
||
interval_in_seconds |
the time between calls to the |
|
function |
呼び出される関数 |
|
data |
|
Since: 1.1.6
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
.
loop |
||
priority |
このイベントの優先度。 |
|
interval_in_seconds |
the time between calls to the |
|
function |
呼び出される関数 |
|
data |
|
|
notify |
このイベントが削除された時に呼ばれる関数または |
Since: 1.1.6
guint gcut_event_loop_add_idle (GCutEventLoop *loop
,GSourceFunc function
,gpointer data
);
デフォルト優先度より高い優先度がない場合に呼び出される関数function
を追加します。
Since: 1.1.6
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
.
loop |
||
priority |
このイベントの優先度。 |
|
function |
呼び出される関数 |
|
data |
|
|
notify |
このイベントが削除された時に呼ばれる関数または |
Since: 1.1.6
gboolean gcut_event_loop_remove (GCutEventLoop *loop
,guint tag
);
Removes the event with the given ID, tag
.
Since: 1.1.6