Don't use G_DISABLE_DEPRECATED guards around deprecated functions
[platform/upstream/glib.git] / glib / gmain.h
index bd94651..d30b45c 100644 (file)
@@ -17,7 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
 #error "Only <glib.h> can be included directly."
 #endif
 
@@ -123,20 +123,30 @@ typedef struct _GSourceFuncs            GSourceFuncs;
  * while Windows uses process handles (which are pointers).
  */
 
-typedef gboolean (*GSourceFunc)       (gpointer data);
+/**
+ * GSourceFunc:
+ * @user_data: data passed to the function, set when the source was
+ *     created with one of the above functions
+ *
+ * Specifies the type of function passed to g_timeout_add(),
+ * g_timeout_add_full(), g_idle_add(), and g_idle_add_full().
+ *
+ * Returns: %FALSE if the source should be removed
+ */
+typedef gboolean (*GSourceFunc)       (gpointer user_data);
 
 /**
  * GChildWatchFunc:
  * @pid: the process id of the child process
  * @status: Status information about the child process,
  *     see waitpid(2) for more information about this field
- * @data: user data passed to g_child_watch_add()
+ * @user_data: user data passed to g_child_watch_add()
  *
  * The type of functions to be called when a child exists.
  */
 typedef void     (*GChildWatchFunc)   (GPid     pid,
                                        gint     status,
-                                       gpointer data);
+                                       gpointer user_data);
 struct _GSource
 {
   /*< private >*/
@@ -172,6 +182,12 @@ struct _GSourceCallbackFuncs
                  gpointer    *data);
 };
 
+/**
+ * GSourceDummyMarshal:
+ *
+ * This is just a placeholder for #GClosureMarshal,
+ * which cannot be used here for dependency reasons.
+ */
 typedef void (*GSourceDummyMarshal) (void);
 
 struct _GSourceFuncs
@@ -242,6 +258,26 @@ struct _GSourceFuncs
  */
 #define G_PRIORITY_LOW              300
 
+/**
+ * G_SOURCE_REMOVE:
+ *
+ * Use this macro as the return value of a #GSourceFunc to remove
+ * the #GSource from the main loop.
+ *
+ * Since: 2.28
+ */
+#define G_SOURCE_REMOVE         FALSE
+
+/**
+ * G_SOURCE_CONTINUE:
+ *
+ * Use this macro as the return value of a #GSourceFunc to leave
+ * the #GSource in the main loop.
+ *
+ * Since: 2.28
+ */
+#define G_SOURCE_CONTINUE       TRUE
+
 /* GMainContext: */
 
 GMainContext *g_main_context_new       (void);
@@ -306,6 +342,7 @@ GSource *g_main_current_source      (void);
 void          g_main_context_push_thread_default (GMainContext *context);
 void          g_main_context_pop_thread_default  (GMainContext *context);
 GMainContext *g_main_context_get_thread_default  (void);
+GMainContext *g_main_context_ref_thread_default  (void);
 
 /* GMainLoop: */
 
@@ -350,7 +387,7 @@ gboolean g_source_is_destroyed    (GSource        *source);
 
 void                 g_source_set_name       (GSource        *source,
                                               const char     *name);
-G_CONST_RETURN char* g_source_get_name       (GSource        *source);
+const char *         g_source_get_name       (GSource        *source);
 void                 g_source_set_name_by_id (guint           tag,
                                               const char     *name);
 
@@ -370,10 +407,10 @@ void     g_source_add_child_source    (GSource        *source,
 void     g_source_remove_child_source (GSource        *source,
                                       GSource        *child_source);
 
-#ifndef G_DISABLE_DEPRECATED
+GLIB_DEPRECATED_FOR(g_source_get_time)
 void     g_source_get_current_time (GSource        *source,
                                     GTimeVal       *timeval);
-#endif
+
 gint64   g_source_get_time         (GSource        *source);
 
  /* void g_source_connect_closure (GSource        *source,