gmain.h 4.3 KB

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