gmain.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /* GLIB - Library of useful routines for C programming
  2. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 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. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  16. */
  17. /*
  18. * Modified by the GLib Team and others 1997-2000. See the AUTHORS
  19. * file for a list of people on the GLib Team. See the ChangeLog
  20. * files for a list of changes. These files are distributed with
  21. * GLib at ftp://ftp.gtk.org/pub/gtk/.
  22. */
  23. #ifndef __G_DEPRECATED_MAIN_H__
  24. #define __G_DEPRECATED_MAIN_H__
  25. #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
  26. #error "Only <glib.h> can be included directly."
  27. #endif
  28. #include <glib/gmain.h>
  29. G_BEGIN_DECLS
  30. /* ============== Compat main loop stuff ================== */
  31. /**
  32. * g_main_new:
  33. * @is_running: set to %TRUE to indicate that the loop is running. This
  34. * is not very important since calling g_main_run() will set this
  35. * to %TRUE anyway.
  36. *
  37. * Creates a new #GMainLoop for th default main context.
  38. *
  39. * Returns: a new #GMainLoop
  40. *
  41. * Deprecated: 2.2: Use g_main_loop_new() instead
  42. */
  43. #define g_main_new(is_running) g_main_loop_new (NULL, is_running) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_new)
  44. /**
  45. * g_main_run:
  46. * @loop: a #GMainLoop
  47. *
  48. * Runs a main loop until it stops running.
  49. *
  50. * Deprecated: 2.2: Use g_main_loop_run() instead
  51. */
  52. #define g_main_run(loop) g_main_loop_run(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_run)
  53. /**
  54. * g_main_quit:
  55. * @loop: a #GMainLoop
  56. *
  57. * Stops the #GMainLoop.
  58. * If g_main_run() was called to run the #GMainLoop, it will now return.
  59. *
  60. * Deprecated: 2.2: Use g_main_loop_quit() instead
  61. */
  62. #define g_main_quit(loop) g_main_loop_quit(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_quit)
  63. /**
  64. * g_main_destroy:
  65. * @loop: a #GMainLoop
  66. *
  67. * Frees the memory allocated for the #GMainLoop.
  68. *
  69. * Deprecated: 2.2: Use g_main_loop_unref() instead
  70. */
  71. #define g_main_destroy(loop) g_main_loop_unref(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_unref)
  72. /**
  73. * g_main_is_running:
  74. * @loop: a #GMainLoop
  75. *
  76. * Checks if the main loop is running.
  77. *
  78. * Returns: %TRUE if the main loop is running
  79. *
  80. * Deprecated: 2.2: Use g_main_loop_is_running() instead
  81. */
  82. #define g_main_is_running(loop) g_main_loop_is_running(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_is_running)
  83. /**
  84. * g_main_iteration:
  85. * @may_block: set to %TRUE if it should block (i.e. wait) until an event
  86. * source becomes ready. It will return after an event source has been
  87. * processed. If set to %FALSE it will return immediately if no event
  88. * source is ready to be processed.
  89. *
  90. * Runs a single iteration for the default #GMainContext.
  91. *
  92. * Returns: %TRUE if more events are pending.
  93. *
  94. * Deprecated: 2.2: Use g_main_context_iteration() instead.
  95. */
  96. #define g_main_iteration(may_block) g_main_context_iteration (NULL, may_block) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_iteration)
  97. /**
  98. * g_main_pending:
  99. *
  100. * Checks if any events are pending for the default #GMainContext
  101. * (i.e. ready to be processed).
  102. *
  103. * Returns: %TRUE if any events are pending.
  104. *
  105. * Deprected: 2.2: Use g_main_context_pending() instead.
  106. */
  107. #define g_main_pending() g_main_context_pending (NULL) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_pending)
  108. /**
  109. * g_main_set_poll_func:
  110. * @func: the function to call to poll all file descriptors
  111. *
  112. * Sets the function to use for the handle polling of file descriptors
  113. * for the default main context.
  114. *
  115. * Deprecated: 2.2: Use g_main_context_set_poll_func() again
  116. */
  117. #define g_main_set_poll_func(func) g_main_context_set_poll_func (NULL, func) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_set_poll_func)
  118. G_END_DECLS
  119. #endif /* __G_DEPRECATED_MAIN_H__ */