gmain.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /* gmain.h - the GLib Main loop
  2. * Copyright (C) 1998-2000 Red Hat, Inc.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef __G_MAIN_H__
  18. #define __G_MAIN_H__
  19. #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
  20. #error "Only <glib.h> can be included directly."
  21. #endif
  22. #include <glib/gpoll.h>
  23. #include <glib/gslist.h>
  24. #include <glib/gthread.h>
  25. G_BEGIN_DECLS
  26. typedef enum /*< flags >*/
  27. {
  28. G_IO_IN GLIB_SYSDEF_POLLIN,
  29. G_IO_OUT GLIB_SYSDEF_POLLOUT,
  30. G_IO_PRI GLIB_SYSDEF_POLLPRI,
  31. G_IO_ERR GLIB_SYSDEF_POLLERR,
  32. G_IO_HUP GLIB_SYSDEF_POLLHUP,
  33. G_IO_NVAL GLIB_SYSDEF_POLLNVAL
  34. } GIOCondition;
  35. /**
  36. * GMainContext:
  37. *
  38. * The `GMainContext` struct is an opaque data
  39. * type representing a set of sources to be handled in a main loop.
  40. */
  41. typedef struct _GMainContext GMainContext;
  42. /**
  43. * GMainLoop:
  44. *
  45. * The `GMainLoop` struct is an opaque data type
  46. * representing the main event loop of a GLib or GTK+ application.
  47. */
  48. typedef struct _GMainLoop GMainLoop;
  49. /**
  50. * GSource:
  51. *
  52. * The `GSource` struct is an opaque data type
  53. * representing an event source.
  54. */
  55. typedef struct _GSource GSource;
  56. typedef struct _GSourcePrivate GSourcePrivate;
  57. /**
  58. * GSourceCallbackFuncs:
  59. * @ref: Called when a reference is added to the callback object
  60. * @unref: Called when a reference to the callback object is dropped
  61. * @get: Called to extract the callback function and data from the
  62. * callback object.
  63. * The `GSourceCallbackFuncs` struct contains
  64. * functions for managing callback objects.
  65. */
  66. typedef struct _GSourceCallbackFuncs GSourceCallbackFuncs;
  67. /**
  68. * GSourceFuncs:
  69. * @prepare: Called before all the file descriptors are polled. If the
  70. * source can determine that it is ready here (without waiting for the
  71. * results of the poll() call) it should return %TRUE. It can also return
  72. * a @timeout_ value which should be the maximum timeout (in milliseconds)
  73. * which should be passed to the poll() call. The actual timeout used will
  74. * be -1 if all sources returned -1, or it will be the minimum of all
  75. * the @timeout_ values returned which were >= 0. Since 2.36 this may
  76. * be %NULL, in which case the effect is as if the function always returns
  77. * %FALSE with a timeout of -1. If @prepare returns a
  78. * timeout and the source also has a 'ready time' set then the
  79. * nearer of the two will be used.
  80. * @check: Called after all the file descriptors are polled. The source
  81. * should return %TRUE if it is ready to be dispatched. Note that some
  82. * time may have passed since the previous prepare function was called,
  83. * so the source should be checked again here. Since 2.36 this may
  84. * be %NULL, in which case the effect is as if the function always returns
  85. * %FALSE.
  86. * @dispatch: Called to dispatch the event source, after it has returned
  87. * %TRUE in either its @prepare or its @check function. The @dispatch
  88. * function is passed in a callback function and data. The callback
  89. * function may be %NULL if the source was never connected to a callback
  90. * using g_source_set_callback(). The @dispatch function should call the
  91. * callback function with @user_data and whatever additional parameters
  92. * are needed for this type of event source. The return value of the
  93. * @dispatch function should be #G_SOURCE_REMOVE if the source should be
  94. * removed or #G_SOURCE_CONTINUE to keep it.
  95. * @finalize: Called when the source is finalized.
  96. *
  97. * The `GSourceFuncs` struct contains a table of
  98. * functions used to handle event sources in a generic manner.
  99. *
  100. * For idle sources, the prepare and check functions always return %TRUE
  101. * to indicate that the source is always ready to be processed. The prepare
  102. * function also returns a timeout value of 0 to ensure that the poll() call
  103. * doesn't block (since that would be time wasted which could have been spent
  104. * running the idle function).
  105. *
  106. * For timeout sources, the prepare and check functions both return %TRUE
  107. * if the timeout interval has expired. The prepare function also returns
  108. * a timeout value to ensure that the poll() call doesn't block too long
  109. * and miss the next timeout.
  110. *
  111. * For file descriptor sources, the prepare function typically returns %FALSE,
  112. * since it must wait until poll() has been called before it knows whether
  113. * any events need to be processed. It sets the returned timeout to -1 to
  114. * indicate that it doesn't mind how long the poll() call blocks. In the
  115. * check function, it tests the results of the poll() call to see if the
  116. * required condition has been met, and returns %TRUE if so.
  117. */
  118. typedef struct _GSourceFuncs GSourceFuncs;
  119. /**
  120. * GPid:
  121. *
  122. * A type which is used to hold a process identification.
  123. *
  124. * On UNIX, processes are identified by a process id (an integer),
  125. * while Windows uses process handles (which are pointers).
  126. *
  127. * GPid is used in GLib only for descendant processes spawned with
  128. * the g_spawn functions.
  129. */
  130. /**
  131. * GSourceFunc:
  132. * @user_data: data passed to the function, set when the source was
  133. * created with one of the above functions
  134. *
  135. * Specifies the type of function passed to g_timeout_add(),
  136. * g_timeout_add_full(), g_idle_add(), and g_idle_add_full().
  137. *
  138. * Returns: %FALSE if the source should be removed. #G_SOURCE_CONTINUE and
  139. * #G_SOURCE_REMOVE are more memorable names for the return value.
  140. */
  141. typedef gboolean (*GSourceFunc) (gpointer user_data);
  142. /**
  143. * GChildWatchFunc:
  144. * @pid: the process id of the child process
  145. * @status: Status information about the child process, encoded
  146. * in a platform-specific manner
  147. * @user_data: user data passed to g_child_watch_add()
  148. *
  149. * Prototype of a #GChildWatchSource callback, called when a child
  150. * process has exited. To interpret @status, see the documentation
  151. * for g_spawn_check_exit_status().
  152. */
  153. typedef void (*GChildWatchFunc) (GPid pid,
  154. gint status,
  155. gpointer user_data);
  156. struct _GSource
  157. {
  158. /*< private >*/
  159. gpointer callback_data;
  160. GSourceCallbackFuncs *callback_funcs;
  161. const GSourceFuncs *source_funcs;
  162. guint ref_count;
  163. GMainContext *context;
  164. gint priority;
  165. guint flags;
  166. guint source_id;
  167. GSList *poll_fds;
  168. GSource *prev;
  169. GSource *next;
  170. char *name;
  171. GSourcePrivate *priv;
  172. };
  173. struct _GSourceCallbackFuncs
  174. {
  175. void (*ref) (gpointer cb_data);
  176. void (*unref) (gpointer cb_data);
  177. void (*get) (gpointer cb_data,
  178. GSource *source,
  179. GSourceFunc *func,
  180. gpointer *data);
  181. };
  182. /**
  183. * GSourceDummyMarshal:
  184. *
  185. * This is just a placeholder for #GClosureMarshal,
  186. * which cannot be used here for dependency reasons.
  187. */
  188. typedef void (*GSourceDummyMarshal) (void);
  189. struct _GSourceFuncs
  190. {
  191. gboolean (*prepare) (GSource *source,
  192. gint *timeout_);
  193. gboolean (*check) (GSource *source);
  194. gboolean (*dispatch) (GSource *source,
  195. GSourceFunc callback,
  196. gpointer user_data);
  197. void (*finalize) (GSource *source); /* Can be NULL */
  198. /*< private >*/
  199. /* For use by g_source_set_closure */
  200. GSourceFunc closure_callback;
  201. GSourceDummyMarshal closure_marshal; /* Really is of type GClosureMarshal */
  202. };
  203. /* Standard priorities */
  204. /**
  205. * G_PRIORITY_HIGH:
  206. *
  207. * Use this for high priority event sources.
  208. *
  209. * It is not used within GLib or GTK+.
  210. */
  211. #define G_PRIORITY_HIGH -100
  212. /**
  213. * G_PRIORITY_DEFAULT:
  214. *
  215. * Use this for default priority event sources.
  216. *
  217. * In GLib this priority is used when adding timeout functions
  218. * with g_timeout_add(). In GDK this priority is used for events
  219. * from the X server.
  220. */
  221. #define G_PRIORITY_DEFAULT 0
  222. /**
  223. * G_PRIORITY_HIGH_IDLE:
  224. *
  225. * Use this for high priority idle functions.
  226. *
  227. * GTK+ uses #G_PRIORITY_HIGH_IDLE + 10 for resizing operations,
  228. * and #G_PRIORITY_HIGH_IDLE + 20 for redrawing operations. (This is
  229. * done to ensure that any pending resizes are processed before any
  230. * pending redraws, so that widgets are not redrawn twice unnecessarily.)
  231. */
  232. #define G_PRIORITY_HIGH_IDLE 100
  233. /**
  234. * G_PRIORITY_DEFAULT_IDLE:
  235. *
  236. * Use this for default priority idle functions.
  237. *
  238. * In GLib this priority is used when adding idle functions with
  239. * g_idle_add().
  240. */
  241. #define G_PRIORITY_DEFAULT_IDLE 200
  242. /**
  243. * G_PRIORITY_LOW:
  244. *
  245. * Use this for very low priority background tasks.
  246. *
  247. * It is not used within GLib or GTK+.
  248. */
  249. #define G_PRIORITY_LOW 300
  250. /**
  251. * G_SOURCE_REMOVE:
  252. *
  253. * Use this macro as the return value of a #GSourceFunc to remove
  254. * the #GSource from the main loop.
  255. *
  256. * Since: 2.32
  257. */
  258. #define G_SOURCE_REMOVE FALSE
  259. /**
  260. * G_SOURCE_CONTINUE:
  261. *
  262. * Use this macro as the return value of a #GSourceFunc to leave
  263. * the #GSource in the main loop.
  264. *
  265. * Since: 2.32
  266. */
  267. #define G_SOURCE_CONTINUE TRUE
  268. /* GMainContext: */
  269. GLIB_AVAILABLE_IN_ALL
  270. GMainContext *g_main_context_new (void);
  271. GLIB_AVAILABLE_IN_ALL
  272. GMainContext *g_main_context_ref (GMainContext *context);
  273. GLIB_AVAILABLE_IN_ALL
  274. void g_main_context_unref (GMainContext *context);
  275. GLIB_AVAILABLE_IN_ALL
  276. GMainContext *g_main_context_default (void);
  277. GLIB_AVAILABLE_IN_ALL
  278. gboolean g_main_context_iteration (GMainContext *context,
  279. gboolean may_block);
  280. GLIB_AVAILABLE_IN_ALL
  281. gboolean g_main_context_pending (GMainContext *context);
  282. /* For implementation of legacy interfaces
  283. */
  284. GLIB_AVAILABLE_IN_ALL
  285. GSource *g_main_context_find_source_by_id (GMainContext *context,
  286. guint source_id);
  287. GLIB_AVAILABLE_IN_ALL
  288. GSource *g_main_context_find_source_by_user_data (GMainContext *context,
  289. gpointer user_data);
  290. GLIB_AVAILABLE_IN_ALL
  291. GSource *g_main_context_find_source_by_funcs_user_data (GMainContext *context,
  292. GSourceFuncs *funcs,
  293. gpointer user_data);
  294. /* Low level functions for implementing custom main loops.
  295. */
  296. GLIB_AVAILABLE_IN_ALL
  297. void g_main_context_wakeup (GMainContext *context);
  298. GLIB_AVAILABLE_IN_ALL
  299. gboolean g_main_context_acquire (GMainContext *context);
  300. GLIB_AVAILABLE_IN_ALL
  301. void g_main_context_release (GMainContext *context);
  302. GLIB_AVAILABLE_IN_ALL
  303. gboolean g_main_context_is_owner (GMainContext *context);
  304. GLIB_AVAILABLE_IN_ALL
  305. gboolean g_main_context_wait (GMainContext *context,
  306. GCond *cond,
  307. GMutex *mutex);
  308. GLIB_AVAILABLE_IN_ALL
  309. gboolean g_main_context_prepare (GMainContext *context,
  310. gint *priority);
  311. GLIB_AVAILABLE_IN_ALL
  312. gint g_main_context_query (GMainContext *context,
  313. gint max_priority,
  314. gint *timeout_,
  315. GPollFD *fds,
  316. gint n_fds);
  317. GLIB_AVAILABLE_IN_ALL
  318. gint g_main_context_check (GMainContext *context,
  319. gint max_priority,
  320. GPollFD *fds,
  321. gint n_fds);
  322. GLIB_AVAILABLE_IN_ALL
  323. void g_main_context_dispatch (GMainContext *context);
  324. GLIB_AVAILABLE_IN_ALL
  325. void g_main_context_set_poll_func (GMainContext *context,
  326. GPollFunc func);
  327. GLIB_AVAILABLE_IN_ALL
  328. GPollFunc g_main_context_get_poll_func (GMainContext *context);
  329. /* Low level functions for use by source implementations
  330. */
  331. GLIB_AVAILABLE_IN_ALL
  332. void g_main_context_add_poll (GMainContext *context,
  333. GPollFD *fd,
  334. gint priority);
  335. GLIB_AVAILABLE_IN_ALL
  336. void g_main_context_remove_poll (GMainContext *context,
  337. GPollFD *fd);
  338. GLIB_AVAILABLE_IN_ALL
  339. gint g_main_depth (void);
  340. GLIB_AVAILABLE_IN_ALL
  341. GSource *g_main_current_source (void);
  342. /* GMainContexts for other threads
  343. */
  344. GLIB_AVAILABLE_IN_ALL
  345. void g_main_context_push_thread_default (GMainContext *context);
  346. GLIB_AVAILABLE_IN_ALL
  347. void g_main_context_pop_thread_default (GMainContext *context);
  348. GLIB_AVAILABLE_IN_ALL
  349. GMainContext *g_main_context_get_thread_default (void);
  350. GLIB_AVAILABLE_IN_ALL
  351. GMainContext *g_main_context_ref_thread_default (void);
  352. /* GMainLoop: */
  353. GLIB_AVAILABLE_IN_ALL
  354. GMainLoop *g_main_loop_new (GMainContext *context,
  355. gboolean is_running);
  356. GLIB_AVAILABLE_IN_ALL
  357. void g_main_loop_run (GMainLoop *loop);
  358. GLIB_AVAILABLE_IN_ALL
  359. void g_main_loop_quit (GMainLoop *loop);
  360. GLIB_AVAILABLE_IN_ALL
  361. GMainLoop *g_main_loop_ref (GMainLoop *loop);
  362. GLIB_AVAILABLE_IN_ALL
  363. void g_main_loop_unref (GMainLoop *loop);
  364. GLIB_AVAILABLE_IN_ALL
  365. gboolean g_main_loop_is_running (GMainLoop *loop);
  366. GLIB_AVAILABLE_IN_ALL
  367. GMainContext *g_main_loop_get_context (GMainLoop *loop);
  368. /* GSource: */
  369. GLIB_AVAILABLE_IN_ALL
  370. GSource *g_source_new (GSourceFuncs *source_funcs,
  371. guint struct_size);
  372. GLIB_AVAILABLE_IN_ALL
  373. GSource *g_source_ref (GSource *source);
  374. GLIB_AVAILABLE_IN_ALL
  375. void g_source_unref (GSource *source);
  376. GLIB_AVAILABLE_IN_ALL
  377. guint g_source_attach (GSource *source,
  378. GMainContext *context);
  379. GLIB_AVAILABLE_IN_ALL
  380. void g_source_destroy (GSource *source);
  381. GLIB_AVAILABLE_IN_ALL
  382. void g_source_set_priority (GSource *source,
  383. gint priority);
  384. GLIB_AVAILABLE_IN_ALL
  385. gint g_source_get_priority (GSource *source);
  386. GLIB_AVAILABLE_IN_ALL
  387. void g_source_set_can_recurse (GSource *source,
  388. gboolean can_recurse);
  389. GLIB_AVAILABLE_IN_ALL
  390. gboolean g_source_get_can_recurse (GSource *source);
  391. GLIB_AVAILABLE_IN_ALL
  392. guint g_source_get_id (GSource *source);
  393. GLIB_AVAILABLE_IN_ALL
  394. GMainContext *g_source_get_context (GSource *source);
  395. GLIB_AVAILABLE_IN_ALL
  396. void g_source_set_callback (GSource *source,
  397. GSourceFunc func,
  398. gpointer data,
  399. GDestroyNotify notify);
  400. GLIB_AVAILABLE_IN_ALL
  401. void g_source_set_funcs (GSource *source,
  402. GSourceFuncs *funcs);
  403. GLIB_AVAILABLE_IN_ALL
  404. gboolean g_source_is_destroyed (GSource *source);
  405. GLIB_AVAILABLE_IN_ALL
  406. void g_source_set_name (GSource *source,
  407. const char *name);
  408. GLIB_AVAILABLE_IN_ALL
  409. const char * g_source_get_name (GSource *source);
  410. GLIB_AVAILABLE_IN_ALL
  411. void g_source_set_name_by_id (guint tag,
  412. const char *name);
  413. GLIB_AVAILABLE_IN_2_36
  414. void g_source_set_ready_time (GSource *source,
  415. gint64 ready_time);
  416. GLIB_AVAILABLE_IN_2_36
  417. gint64 g_source_get_ready_time (GSource *source);
  418. #ifdef G_OS_UNIX
  419. GLIB_AVAILABLE_IN_2_36
  420. gpointer g_source_add_unix_fd (GSource *source,
  421. gint fd,
  422. GIOCondition events);
  423. GLIB_AVAILABLE_IN_2_36
  424. void g_source_modify_unix_fd (GSource *source,
  425. gpointer tag,
  426. GIOCondition new_events);
  427. GLIB_AVAILABLE_IN_2_36
  428. void g_source_remove_unix_fd (GSource *source,
  429. gpointer tag);
  430. GLIB_AVAILABLE_IN_2_36
  431. GIOCondition g_source_query_unix_fd (GSource *source,
  432. gpointer tag);
  433. #endif
  434. /* Used to implement g_source_connect_closure and internally*/
  435. GLIB_AVAILABLE_IN_ALL
  436. void g_source_set_callback_indirect (GSource *source,
  437. gpointer callback_data,
  438. GSourceCallbackFuncs *callback_funcs);
  439. GLIB_AVAILABLE_IN_ALL
  440. void g_source_add_poll (GSource *source,
  441. GPollFD *fd);
  442. GLIB_AVAILABLE_IN_ALL
  443. void g_source_remove_poll (GSource *source,
  444. GPollFD *fd);
  445. GLIB_AVAILABLE_IN_ALL
  446. void g_source_add_child_source (GSource *source,
  447. GSource *child_source);
  448. GLIB_AVAILABLE_IN_ALL
  449. void g_source_remove_child_source (GSource *source,
  450. GSource *child_source);
  451. GLIB_DEPRECATED_IN_2_28_FOR(g_source_get_time)
  452. void g_source_get_current_time (GSource *source,
  453. GTimeVal *timeval);
  454. GLIB_AVAILABLE_IN_ALL
  455. gint64 g_source_get_time (GSource *source);
  456. /* void g_source_connect_closure (GSource *source,
  457. GClosure *closure);
  458. */
  459. /* Specific source types
  460. */
  461. GLIB_AVAILABLE_IN_ALL
  462. GSource *g_idle_source_new (void);
  463. GLIB_AVAILABLE_IN_ALL
  464. GSource *g_child_watch_source_new (GPid pid);
  465. GLIB_AVAILABLE_IN_ALL
  466. GSource *g_timeout_source_new (guint interval);
  467. GLIB_AVAILABLE_IN_ALL
  468. GSource *g_timeout_source_new_seconds (guint interval);
  469. /* Miscellaneous functions
  470. */
  471. GLIB_AVAILABLE_IN_ALL
  472. void g_get_current_time (GTimeVal *result);
  473. GLIB_AVAILABLE_IN_ALL
  474. gint64 g_get_monotonic_time (void);
  475. GLIB_AVAILABLE_IN_ALL
  476. gint64 g_get_real_time (void);
  477. /* Source manipulation by ID */
  478. GLIB_AVAILABLE_IN_ALL
  479. gboolean g_source_remove (guint tag);
  480. GLIB_AVAILABLE_IN_ALL
  481. gboolean g_source_remove_by_user_data (gpointer user_data);
  482. GLIB_AVAILABLE_IN_ALL
  483. gboolean g_source_remove_by_funcs_user_data (GSourceFuncs *funcs,
  484. gpointer user_data);
  485. /* Idles, child watchers and timeouts */
  486. GLIB_AVAILABLE_IN_ALL
  487. guint g_timeout_add_full (gint priority,
  488. guint interval,
  489. GSourceFunc function,
  490. gpointer data,
  491. GDestroyNotify notify);
  492. GLIB_AVAILABLE_IN_ALL
  493. guint g_timeout_add (guint interval,
  494. GSourceFunc function,
  495. gpointer data);
  496. GLIB_AVAILABLE_IN_ALL
  497. guint g_timeout_add_seconds_full (gint priority,
  498. guint interval,
  499. GSourceFunc function,
  500. gpointer data,
  501. GDestroyNotify notify);
  502. GLIB_AVAILABLE_IN_ALL
  503. guint g_timeout_add_seconds (guint interval,
  504. GSourceFunc function,
  505. gpointer data);
  506. GLIB_AVAILABLE_IN_ALL
  507. guint g_child_watch_add_full (gint priority,
  508. GPid pid,
  509. GChildWatchFunc function,
  510. gpointer data,
  511. GDestroyNotify notify);
  512. GLIB_AVAILABLE_IN_ALL
  513. guint g_child_watch_add (GPid pid,
  514. GChildWatchFunc function,
  515. gpointer data);
  516. GLIB_AVAILABLE_IN_ALL
  517. guint g_idle_add (GSourceFunc function,
  518. gpointer data);
  519. GLIB_AVAILABLE_IN_ALL
  520. guint g_idle_add_full (gint priority,
  521. GSourceFunc function,
  522. gpointer data,
  523. GDestroyNotify notify);
  524. GLIB_AVAILABLE_IN_ALL
  525. gboolean g_idle_remove_by_data (gpointer data);
  526. GLIB_AVAILABLE_IN_ALL
  527. void g_main_context_invoke_full (GMainContext *context,
  528. gint priority,
  529. GSourceFunc function,
  530. gpointer data,
  531. GDestroyNotify notify);
  532. GLIB_AVAILABLE_IN_ALL
  533. void g_main_context_invoke (GMainContext *context,
  534. GSourceFunc function,
  535. gpointer data);
  536. /* Hook for GClosure / GSource integration. Don't touch */
  537. GLIB_VAR GSourceFuncs g_timeout_funcs;
  538. GLIB_VAR GSourceFuncs g_child_watch_funcs;
  539. GLIB_VAR GSourceFuncs g_idle_funcs;
  540. #ifdef G_OS_UNIX
  541. GLIB_VAR GSourceFuncs g_unix_signal_funcs;
  542. GLIB_VAR GSourceFuncs g_unix_fd_source_funcs;
  543. #endif
  544. G_END_DECLS
  545. #endif /* __G_MAIN_H__ */