[gtk+/gtk-2-90: 110/127] Remove gtkmain stuff from docs and tutorial.



commit 7240e239874719f8c039eae49bdc3e0e022ba22d
Author: Javier Jardón <jjardon gnome org>
Date:   Thu Oct 22 05:17:29 2009 +0200

    Remove gtkmain stuff from docs and tutorial.
    
    Also, substitue the deprecated functions with the new ones in
    documentation and in tests code

 docs/reference/gtk/gtk-sections.txt  |   22 ----
 docs/reference/gtk/tmpl/gtkmain.sgml |  191 +---------------------------------
 docs/tutorial/gtk-tut.sgml           |    8 +-
 docs/tutorial/gtk_tut.sgml           |   48 ++++----
 gtk/gtkmain.c                        |    7 --
 modules/other/gail/tests/testcombo.c |    4 +-
 tests/testgtk.c                      |   12 +-
 tests/testselection.c                |    2 +-
 tests/testtext.c                     |    2 +-
 9 files changed, 39 insertions(+), 257 deletions(-)
---
diff --git a/docs/reference/gtk/gtk-sections.txt b/docs/reference/gtk/gtk-sections.txt
index 709e731..3c12977 100644
--- a/docs/reference/gtk/gtk-sections.txt
+++ b/docs/reference/gtk/gtk-sections.txt
@@ -5747,7 +5747,6 @@ gtk_init
 gtk_init_check
 gtk_init_with_args
 gtk_get_option_group
-gtk_exit
 gtk_events_pending
 gtk_main
 gtk_main_level
@@ -5777,28 +5776,7 @@ gtk_quit_remove
 gtk_quit_remove_by_data
 
 <SUBSECTION>
-gtk_timeout_add_full
-gtk_timeout_add
-gtk_timeout_remove
-
-<SUBSECTION>
-gtk_idle_add
-gtk_idle_add_priority
-gtk_idle_add_full
-gtk_idle_remove
-gtk_idle_remove_by_data
-
-<SUBSECTION>
-gtk_input_add_full
-gtk_input_remove
-
-<SUBSECTION>
-GTK_PRIORITY_REDRAW
 GTK_PRIORITY_RESIZE
-GTK_PRIORITY_HIGH
-GTK_PRIORITY_INTERNAL
-GTK_PRIORITY_DEFAULT
-GTK_PRIORITY_LOW
 
 <SUBSECTION>
 gtk_key_snooper_install
diff --git a/docs/reference/gtk/tmpl/gtkmain.sgml b/docs/reference/gtk/tmpl/gtkmain.sgml
index a0b461f..b7af513 100644
--- a/docs/reference/gtk/tmpl/gtkmain.sgml
+++ b/docs/reference/gtk/tmpl/gtkmain.sgml
@@ -162,18 +162,6 @@ functions such as g_signal_connect().
 @Returns: 
 
 
-<!-- ##### FUNCTION gtk_exit ##### -->
-<para>
-Terminates the program and returns the given exit code to the caller. 
-This function will shut down the GUI and free all resources allocated 
-for GTK+.
-</para>
-
- error_code: Return value to pass to the caller. This is dependent on the
-target system but at least on Unix systems %0 means success.
- Deprecated: Use the standard exit() function instead.
-
-
 <!-- ##### FUNCTION gtk_events_pending ##### -->
 <para>
 Checks if any events are pending. This can be used to update the GUI 
@@ -485,191 +473,14 @@ Removes a quit handler identified by its @data field.
 @data: The pointer passed as @data to gtk_quit_add() or gtk_quit_add_full().
 
 
-<!-- ##### FUNCTION gtk_timeout_add_full ##### -->
-<para>
-Registers a function to be called periodically. The function will be called
-repeatedly after @interval milliseconds until it returns %FALSE at which 
-point the timeout is destroyed and will not be called again.
-</para>
-
- interval: The time between calls to the function, in milliseconds 
-	(1/1000ths of a second.)
- function: The function to call periodically.
- marshal: The marshaller to use instead of the function (if non-%NULL).
- data: The data to pass to the function.
- destroy: Function to call when the timeout is destroyed or %NULL.
- Returns: A unique id for the event source.
- Deprecated: 2.4: Use g_timeout_add_full() instead.
-
-
-<!-- ##### FUNCTION gtk_timeout_add ##### -->
-<para>
-Registers a function to be called periodically. The function will be called
-repeatedly after @interval milliseconds until it returns %FALSE at which 
-point the timeout is destroyed and will not be called again.
-</para>
-
- interval: The time between calls to the function, in milliseconds 
-	(1/1000ths of a second.)
- function: The function to call periodically.
- data: The data to pass to the function.
- Returns: A unique id for the event source.
- Deprecated: 2.4: Use g_timeout_add() instead.
-
-
-<!-- ##### FUNCTION gtk_timeout_remove ##### -->
-<para>
-Removes the given timeout destroying all information about it.
-</para>
-
- timeout_handler_id: The identifier returned when installing the timeout.
- Deprecated: 2.4: Use g_source_remove() instead.
-
-
-<!-- ##### FUNCTION gtk_idle_add ##### -->
-<para>
-Causes the mainloop to call the given function whenever no events with 
-higher priority are to be processed. The default priority is 
-%GTK_PRIORITY_DEFAULT, which is rather low.
-</para>
-
- function: The function to call.
- data: The information to pass to the function.
- Returns: a unique handle for this registration.
- Deprecated: 2.4: Use g_idle_add() instead.
-
-
-<!-- ##### FUNCTION gtk_idle_add_priority ##### -->
-<para>
-Like gtk_idle_add() this function allows you to have a function called
-when the event loop is idle. The difference is that you can give a 
-priority different from %GTK_PRIORITY_DEFAULT to the idle function.
-</para>
-
- priority: The priority which should not be above %G_PRIORITY_HIGH_IDLE.
-Note that you will interfere with GTK+ if you use a priority above
-%GTK_PRIORITY_RESIZE.
- function: The function to call.
- data: Data to pass to that function.
- Returns: A unique id for the event source.
- Deprecated: 2.4: Use g_idle_add_full() instead.
-
-
-<!-- ##### FUNCTION gtk_idle_add_full ##### -->
-<para>
-Like gtk_idle_add() this function allows you to have a function called
-when the event loop is idle. The difference is that you can give a 
-priority different from %GTK_PRIORITY_DEFAULT to the idle function.
-</para>
-
- priority: The priority which should not be above %G_PRIORITY_HIGH_IDLE.
-Note that you will interfere with GTK+ if you use a priority above
-%GTK_PRIORITY_RESIZE.
- function: The function to call.
- marshal: The marshaller to use instead of the function (if non-%NULL).
- data: Data to pass to that function.
- destroy: Function to call when the timeout is destroyed or %NULL.
- Returns: A unique id for the event source.
- Deprecated: 2.4: Use g_idle_add_full() instead.
-
-
-<!-- ##### FUNCTION gtk_idle_remove ##### -->
-<para>
-Removes the idle function with the given id.
-</para>
-
- idle_handler_id: Identifies the idle function to remove.
- Deprecated: 2.4: Use g_source_remove() instead.
-
-
-<!-- ##### FUNCTION gtk_idle_remove_by_data ##### -->
-<para>
-Removes the idle function identified by the user data.
-</para>
-
- data: remove the idle function which was registered with this user data.
- Deprecated: 2.4: Use g_idle_remove_by_data() instead.
-
-
-<!-- ##### FUNCTION gtk_input_add_full ##### -->
-<para>
-Registers a function to be called when a condition becomes true 
-on a file descriptor.
-</para>
-
- source: a file descriptor.
- condition: the condition.
- function: The function to call.
- marshal: The marshaller to use instead of the function (if non-%NULL).
- data: callback data passed to @function.
- destroy: callback function to call with @data when the input
-  handler is removed, or %NULL.
- Returns: A unique id for the event source; to be used with gtk_input_remove().
- Deprecated: 2.4: Use g_io_add_watch_full() instead.
-
-
-<!-- ##### FUNCTION gtk_input_remove ##### -->
-<para>
-Removes the function with the given id.
-</para>
-
- input_handler_id: Identifies the function to remove.
- Deprecated: 2.4: Use g_source_remove() instead.
-
-
-<!-- ##### MACRO GTK_PRIORITY_REDRAW ##### -->
-<para>
-Use this priority for redrawing related stuff. It is used internally by
-GTK+ to do pending redraws. This priority is lower than %GTK_PRIORITY_RESIZE
-to avoid redrawing a widget just before resizing (and therefore redrawing
-it again).
-</para>
-
- Deprecated: 2.4: This macro is deprecated. You should use %GDK_PRIORITY_REDRAW instead.
-
-
 <!-- ##### MACRO GTK_PRIORITY_RESIZE ##### -->
 <para>
 Use this priority for resizing related stuff. It is used internally by
 GTK+ to compute the sizes of widgets. This priority is higher than 
-%GTK_PRIORITY_REDRAW to avoid resizing a widget which was just redrawn.
+%GDK_PRIORITY_REDRAW to avoid resizing a widget which was just redrawn.
 </para>
 
 
-
-<!-- ##### MACRO GTK_PRIORITY_HIGH ##### -->
-<para>
-Use this for high priority timeouts. This priority is never used inside
-GTK+ so everything running at this priority will be running before anything
-inside the toolkit.
-</para>
-
- Deprecated: 2.4: This macro is deprecated. You should use %G_PRIORITY_HIGH instead.
-
-
-<!-- ##### MACRO GTK_PRIORITY_INTERNAL ##### -->
-<para>
-This priority is for GTK+ internal stuff. Don't use it in your applications.
-</para>
-
-
-
-<!-- ##### MACRO GTK_PRIORITY_DEFAULT ##### -->
-<para>
-Default priority for idle functions.
-</para>
-
- Deprecated: 2.4: This macro is deprecated. You should use %G_PRIORITY_DEFAULT_IDLE instead.
-
-
-<!-- ##### MACRO GTK_PRIORITY_LOW ##### -->
-<para>
-Priority for very unimportant background tasks.
-</para>
-
- Deprecated: 2.4: This macro is deprecated. You should use %G_PRIORITY_LOW instead.
-
-
 <!-- ##### FUNCTION gtk_key_snooper_install ##### -->
 <para>
 Installs a key snooper function, which will get called on all key events
diff --git a/docs/tutorial/gtk-tut.sgml b/docs/tutorial/gtk-tut.sgml
index bf97305..cba2b65 100755
--- a/docs/tutorial/gtk-tut.sgml
+++ b/docs/tutorial/gtk-tut.sgml
@@ -9374,20 +9374,20 @@ What if you have a function which you want to be called when nothing
 else is happening ?</para>
 
 <programlisting role="C">
-gint gtk_idle_add( GtkFunction function,
-                   gpointer    data );
+guint g_idle_add( GSourceFunc function,
+                  gpointer    data );
 </programlisting>
 
 <para>This causes GTK to call the specified function whenever nothing else
 is happening.</para>
 
 <programlisting role="C">
-void gtk_idle_remove( gint tag );
+void g_source_remove( guint tag );
 </programlisting>
 
 <para>I won't explain the meaning of the arguments as they follow very much
 like the ones above. The function pointed to by the first argument to
-gtk_idle_add will be called whenever the opportunity arises. As with
+g_idle_add will be called whenever the opportunity arises. As with
 the others, returning FALSE will stop the idle function from being
 called.</para>
 
diff --git a/docs/tutorial/gtk_tut.sgml b/docs/tutorial/gtk_tut.sgml
index 4833db8..a814c41 100644
--- a/docs/tutorial/gtk_tut.sgml
+++ b/docs/tutorial/gtk_tut.sgml
@@ -1195,7 +1195,7 @@ int main( int   argc,
     if (argc != 2) {
 	fprintf (stderr, "usage: packbox num, where num is 1, 2, or 3.\n");
 	/* This just does cleanup in GTK and exits with an exit status of 1. */
-	gtk_exit (1);
+	exit (1);
     }
     
     which = atoi (argv[1]);
@@ -1396,7 +1396,7 @@ int main( int   argc,
     gtk_main ();
 
     /* Control returns here when gtk_main_quit() is called, but not when 
-     * gtk_exit is used. */
+     * exit is used. */
     
     return(0);
 }
@@ -3786,7 +3786,7 @@ void set_discrete_mode( GtkWidget    *widget,
 void destroy_progress( GtkWidget     *widget,
 		       ProgressData *pdata)
 {
-    gtk_timeout_remove (pdata->timer);
+    g_source_remove (pdata->timer);
     pdata->timer = 0;
     pdata->window = NULL;
     g_free(pdata);
@@ -3848,7 +3848,7 @@ int main( int   argc,
     gtk_widget_show(pdata->pbar);
 
     /* Add a timer callback to update the value of the progress bar */
-    pdata->timer = gtk_timeout_add (100, progress_timeout, pdata->pbar);
+    pdata->timer = g_timeout_add (100, (GSourceFunc)progress_timeout, pdata->pbar);
 
     separator = gtk_hseparator_new ();
     gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
@@ -11378,9 +11378,9 @@ create a timeout function that will be called every "interval"
 milliseconds.
 
 <tscreen><verb>
-gint gtk_timeout_add( guint32     interval,
-                      GtkFunction function,
-                      gpointer    data );
+gint g_timeout_add( guint       interval,
+                    GSourceFunc function,
+                    gpointer    data );
 </verb></tscreen>
 
 The first argument is the number of milliseconds between calls to your
@@ -11390,7 +11390,7 @@ value is an integer "tag" which may be used to stop the timeout by
 calling:
 
 <tscreen><verb>
-void gtk_timeout_remove( gint tag );
+gboolean g_source_remove( guint tag );
 </verb></tscreen>
 
 You may also stop the timeout function by returning zero or FALSE from
@@ -11460,20 +11460,20 @@ What if you have a function which you want to be called when nothing
 else is happening ?
 
 <tscreen><verb>
-gint gtk_idle_add( GtkFunction function,
-                   gpointer    data );
+gint g_idle_add( GSourceFunc function,
+                 gpointer    data );
 </verb></tscreen>
 
 This causes GTK to call the specified function whenever nothing else
 is happening.
 
 <tscreen><verb>
-void gtk_idle_remove( gint tag );
+void g_idle_remove( guint tag );
 </verb></tscreen>
 
 I won't explain the meaning of the arguments as they follow very much
 like the ones above. The function pointed to by the first argument to
-gtk_idle_add will be called whenever the opportunity arises. As with
+g_idle_add will be called whenever the opportunity arises. As with
 the others, returning FALSE will stop the idle function from being
 called.
 
@@ -13860,7 +13860,7 @@ value of the control to be recomputed (by the function
 <tt/gtk_dial_update_mouse/). Depending on the policy that has been
 set, "value_changed" events are either generated instantly
 (<tt/GTK_UPDATE_CONTINUOUS/), after a delay in a timer added with
-<tt/gtk_timeout_add()/ (<tt/GTK_UPDATE_DELAYED/), or only when the
+<tt/g_timeout_add()/ (<tt/GTK_UPDATE_DELAYED/), or only when the
 button is released (<tt/GTK_UPDATE_DISCONTINUOUS/).
 
 <tscreen><verb>
@@ -13927,7 +13927,7 @@ gtk_dial_button_release (GtkWidget      *widget,
       dial->button = 0;
 
       if (dial->policy == GTK_UPDATE_DELAYED)
-	gtk_timeout_remove (dial->timer);
+	g_source_remove (dial->timer);
       
       if ((dial->policy != GTK_UPDATE_CONTINUOUS) &&
 	  (dial->old_value != dial->adjustment->value))
@@ -14034,11 +14034,11 @@ gtk_dial_update_mouse (GtkDial *dial, gint x, gint y)
 	  if (dial->policy == GTK_UPDATE_DELAYED)
 	    {
 	      if (dial->timer)
-		gtk_timeout_remove (dial->timer);
+		g_source_remove (dial->timer);
 
-	      dial->timer = gtk_timeout_add (SCROLL_DELAY_LENGTH,
-					     (GtkFunction) gtk_dial_timer,
-					     (gpointer) dial);
+	      dial->timer = g_timeout_add (SCROLL_DELAY_LENGTH,
+					   (GSourceFunc) gtk_dial_timer,
+					   dial);
 	    }
 	}
     }
@@ -17094,7 +17094,7 @@ gtk_dial_button_release (GtkWidget      *widget,
       dial->button = 0;
 
       if (dial->policy == GTK_UPDATE_DELAYED)
-	gtk_timeout_remove (dial->timer);
+	g_source_remove (dial->timer);
       
       if ((dial->policy != GTK_UPDATE_CONTINUOUS) &amp;&amp;
 	  (dial->old_value != dial->adjustment->value))
@@ -17201,11 +17201,11 @@ gtk_dial_update_mouse (GtkDial *dial, gint x, gint y)
 	  if (dial->policy == GTK_UPDATE_DELAYED)
 	    {
 	      if (dial->timer)
-		gtk_timeout_remove (dial->timer);
+		g_source_remove (dial->timer);
 
-	      dial->timer = gtk_timeout_add (SCROLL_DELAY_LENGTH,
-					     (GtkFunction) gtk_dial_timer,
-					     (gpointer) dial);
+	      dial->timer = g_timeout_add (SCROLL_DELAY_LENGTH,
+					   (GSourceFunc) gtk_dial_timer,
+					   dial);
 	    }
 	}
     }
@@ -17740,7 +17740,7 @@ create_input_dialog ()
 void
 quit ()
 {
-  gtk_exit (0);
+  exit (0);
 }
 
 int
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 4f1db6a..05d3f1e 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1060,13 +1060,6 @@ gtk_init_check_abi_check (int *argc, char ***argv, int num_checks, size_t sizeof
 
 #endif
 
-void
-gtk_exit (gint errorcode)
-{
-  exit (errorcode);
-}
-
-
 /**
  * gtk_set_locale:
  *
diff --git a/modules/other/gail/tests/testcombo.c b/modules/other/gail/tests/testcombo.c
index 03d5381..33559bb 100644
--- a/modules/other/gail/tests/testcombo.c
+++ b/modules/other/gail/tests/testcombo.c
@@ -135,7 +135,7 @@ static void _check_combo_box (AtkObject *obj)
  
   if (!done)
   {
-    gtk_idle_add (_open_combo_list, obj);
+    g_idle_add ((GSourceFunc)_open_combo_list, obj);
     done = TRUE;
   }
   else
@@ -150,7 +150,7 @@ static gint _open_combo_list (gpointer data)
   g_print ("_open_combo_list\n");
   atk_action_do_action (ATK_ACTION (obj), 0);
 
-  gtk_timeout_add (5000, _close_combo_list, obj);
+  g_timeout_add (5000, _close_combo_list, obj);
   return FALSE;
 }
 
diff --git a/tests/testgtk.c b/tests/testgtk.c
index ac66dad..18b3b2d 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -9840,7 +9840,7 @@ static void
 destroy_progress (GtkWidget     *widget,
 		  ProgressData **pdata)
 {
-  gtk_timeout_remove ((*pdata)->timer);
+  g_source_remove ((*pdata)->timer);
   (*pdata)->timer = 0;
   (*pdata)->window = NULL;
   g_free (*pdata);
@@ -10054,7 +10054,7 @@ create_progress_bar (GtkWidget *widget)
       gtk_progress_set_format_string (GTK_PROGRESS (pdata->pbar),
 				      "%v from [%l,%u] (=%p%%)");
       gtk_container_add (GTK_CONTAINER (align), pdata->pbar);
-      pdata->timer = gtk_timeout_add (100, progress_timeout, pdata->pbar);
+      pdata->timer = g_timeout_add (100, (GSourceFunc)progress_timeout, pdata->pbar);
 
       align = gtk_alignment_new (0.5, 0.5, 0, 0);
       gtk_box_pack_start (GTK_BOX (vbox2), align, FALSE, FALSE, 5);
@@ -11060,7 +11060,7 @@ start_timeout_test (GtkWidget *widget,
 {
   if (!timer)
     {
-      timer = gtk_timeout_add (100, (GtkFunction) timeout_test, label);
+      timer = g_timeout_add (100, (GSourceFunc)timeout_test, label);
     }
 }
 
@@ -11070,7 +11070,7 @@ stop_timeout_test (GtkWidget *widget,
 {
   if (timer)
     {
-      gtk_timeout_remove (timer);
+      g_source_remove (timer);
       timer = 0;
     }
 }
@@ -11170,7 +11170,7 @@ start_idle_test (GtkWidget *widget,
 {
   if (!idle_id)
     {
-      idle_id = gtk_idle_add ((GtkFunction) idle_test, label);
+      idle_id = g_idle_add ((GSourceFunc) idle_test, label);
     }
 }
 
@@ -11180,7 +11180,7 @@ stop_idle_test (GtkWidget *widget,
 {
   if (idle_id)
     {
-      gtk_idle_remove (idle_id);
+      g_source_remove (idle_id);
       idle_id = 0;
     }
 }
diff --git a/tests/testselection.c b/tests/testselection.c
index cd18173..8230ace 100644
--- a/tests/testselection.c
+++ b/tests/testselection.c
@@ -378,7 +378,7 @@ paste (GtkWidget *widget, GtkWidget *entry)
 void
 quit (void)
 {
-  gtk_exit (0);
+  exit (0);
 }
 
 int
diff --git a/tests/testtext.c b/tests/testtext.c
index 1224f75..1b0d7de 100644
--- a/tests/testtext.c
+++ b/tests/testtext.c
@@ -472,7 +472,7 @@ fill_example_buffer (GtkTextBuffer *buffer)
   tag = gtk_text_buffer_create_tag (buffer, "fg_blue", NULL);
 
 #ifdef DO_BLINK
-  gtk_timeout_add (1000, blink_timeout, tag);
+  g_timeout_add (1000, (GSourceFunc)blink_timeout, tag);
 #endif     
  
   setup_tag (tag);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]