gtk+ r20963 - in trunk: . gtk



Author: mitch
Date: Mon Aug  4 11:08:33 2008
New Revision: 20963
URL: http://svn.gnome.org/viewvc/gtk+?rev=20963&view=rev

Log:
2008-08-04  Michael Natterer  <mitch imendio com>

	* gtk/gtkbindings.c: move the code of the deprecated
	gtk_binding_entry_clear() to a new private function
	gtk_binding_entry_clear_internal() and call it from
	gtk_binding_entry_clear().

	(_gtk_binding_entry_add_signall)
	(gtk_binding_parse_bind): use the new internal function in order
	to avoid our own deprecated public API.



Modified:
   trunk/ChangeLog
   trunk/gtk/gtkbindings.c

Modified: trunk/gtk/gtkbindings.c
==============================================================================
--- trunk/gtk/gtkbindings.c	(original)
+++ trunk/gtk/gtkbindings.c	Mon Aug  4 11:08:33 2008
@@ -689,6 +689,23 @@
   return FALSE;
 }
 
+static void
+gtk_binding_entry_clear_internal (GtkBindingSet  *binding_set,
+                                  guint           keyval,
+                                  GdkModifierType modifiers)
+{
+  GtkBindingEntry *entry;
+
+  keyval = gdk_keyval_to_lower (keyval);
+  modifiers = modifiers & BINDING_MOD_MASK ();
+
+  entry = binding_ht_lookup_entry (binding_set, keyval, modifiers);
+  if (entry)
+    binding_entry_destroy (entry);
+
+  entry = binding_entry_new (binding_set, keyval, modifiers);
+}
+
 /**
  * gtk_binding_entry_clear:
  * @binding_set:
@@ -702,18 +719,9 @@
 			 guint		 keyval,
 			 GdkModifierType modifiers)
 {
-  GtkBindingEntry *entry;
-  
   g_return_if_fail (binding_set != NULL);
-  
-  keyval = gdk_keyval_to_lower (keyval);
-  modifiers = modifiers & BINDING_MOD_MASK ();
-  
-  entry = binding_ht_lookup_entry (binding_set, keyval, modifiers);
-  if (entry)
-    binding_entry_destroy (entry);
 
-  entry = binding_entry_new (binding_set, keyval, modifiers);
+  gtk_binding_entry_clear_internal (binding_set, keyval, modifiers);
 }
 
 /**
@@ -865,7 +873,7 @@
   entry = binding_ht_lookup_entry (binding_set, keyval, modifiers);
   if (!entry)
     {
-      gtk_binding_entry_clear (binding_set, keyval, modifiers);
+      gtk_binding_entry_clear_internal (binding_set, keyval, modifiers);
       entry = binding_ht_lookup_entry (binding_set, keyval, modifiers);
     }
   signal_p = &entry->signals;
@@ -1536,8 +1544,8 @@
   if (scanner->token != '{')
     return '{';
 
-  gtk_binding_entry_clear (binding_set, keyval, modifiers);
-  
+  gtk_binding_entry_clear_internal (binding_set, keyval, modifiers);
+
   g_scanner_peek_next_token (scanner);
   while (scanner->next_token != '}')
     {



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