diff --git a/ChangeLog b/ChangeLog index fb08736ec1..b5641e14f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +Wed Nov 21 11:41:29 2001 Owen Taylor + + * tests/testgtk.c (create_tooltips): Ref-sink the tooltips object. + + * gtk/gtktoolbar.c (gtk_toolbar_init): Ref-sink the tooltips object. + + * gtk/gtkfilesel.c (open_new_dir): Fix some constness warnings. + + * gtk/gtkaccelgroup.c: Rename gtk_accel_groups_from_acceleratable() + back to gtk_accel_groups_from_object(), change @acceleratable + parameter to gtk_accel_groups_activate() accordingly. + + * gtk/gtkaccelmap.c (gtk_accel_map_lookup_entry): Remove + left-over comment about quark return. + + * gtk/gtkaccelmap.h: Fix spelling of gtk_accel_map_foreach_unfiltered(). + + * gtk/gtk-boxed.defs (GtkIconSource): added as a boxed type. + (Patch from Matt Wilson) + + * gtk/gtkobject.c (gtk_object_finalize): Warn if a floating + object is finalized. + Tue Nov 20 21:25:08 2001 Tim Janik * applied patch from owen to get rid of accel map notifiers. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index fb08736ec1..b5641e14f8 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,26 @@ +Wed Nov 21 11:41:29 2001 Owen Taylor + + * tests/testgtk.c (create_tooltips): Ref-sink the tooltips object. + + * gtk/gtktoolbar.c (gtk_toolbar_init): Ref-sink the tooltips object. + + * gtk/gtkfilesel.c (open_new_dir): Fix some constness warnings. + + * gtk/gtkaccelgroup.c: Rename gtk_accel_groups_from_acceleratable() + back to gtk_accel_groups_from_object(), change @acceleratable + parameter to gtk_accel_groups_activate() accordingly. + + * gtk/gtkaccelmap.c (gtk_accel_map_lookup_entry): Remove + left-over comment about quark return. + + * gtk/gtkaccelmap.h: Fix spelling of gtk_accel_map_foreach_unfiltered(). + + * gtk/gtk-boxed.defs (GtkIconSource): added as a boxed type. + (Patch from Matt Wilson) + + * gtk/gtkobject.c (gtk_object_finalize): Warn if a floating + object is finalized. + Tue Nov 20 21:25:08 2001 Tim Janik * applied patch from owen to get rid of accel map notifiers. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index fb08736ec1..b5641e14f8 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,26 @@ +Wed Nov 21 11:41:29 2001 Owen Taylor + + * tests/testgtk.c (create_tooltips): Ref-sink the tooltips object. + + * gtk/gtktoolbar.c (gtk_toolbar_init): Ref-sink the tooltips object. + + * gtk/gtkfilesel.c (open_new_dir): Fix some constness warnings. + + * gtk/gtkaccelgroup.c: Rename gtk_accel_groups_from_acceleratable() + back to gtk_accel_groups_from_object(), change @acceleratable + parameter to gtk_accel_groups_activate() accordingly. + + * gtk/gtkaccelmap.c (gtk_accel_map_lookup_entry): Remove + left-over comment about quark return. + + * gtk/gtkaccelmap.h: Fix spelling of gtk_accel_map_foreach_unfiltered(). + + * gtk/gtk-boxed.defs (GtkIconSource): added as a boxed type. + (Patch from Matt Wilson) + + * gtk/gtkobject.c (gtk_object_finalize): Warn if a floating + object is finalized. + Tue Nov 20 21:25:08 2001 Tim Janik * applied patch from owen to get rid of accel map notifiers. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index fb08736ec1..b5641e14f8 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,26 @@ +Wed Nov 21 11:41:29 2001 Owen Taylor + + * tests/testgtk.c (create_tooltips): Ref-sink the tooltips object. + + * gtk/gtktoolbar.c (gtk_toolbar_init): Ref-sink the tooltips object. + + * gtk/gtkfilesel.c (open_new_dir): Fix some constness warnings. + + * gtk/gtkaccelgroup.c: Rename gtk_accel_groups_from_acceleratable() + back to gtk_accel_groups_from_object(), change @acceleratable + parameter to gtk_accel_groups_activate() accordingly. + + * gtk/gtkaccelmap.c (gtk_accel_map_lookup_entry): Remove + left-over comment about quark return. + + * gtk/gtkaccelmap.h: Fix spelling of gtk_accel_map_foreach_unfiltered(). + + * gtk/gtk-boxed.defs (GtkIconSource): added as a boxed type. + (Patch from Matt Wilson) + + * gtk/gtkobject.c (gtk_object_finalize): Warn if a floating + object is finalized. + Tue Nov 20 21:25:08 2001 Tim Janik * applied patch from owen to get rid of accel map notifiers. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index fb08736ec1..b5641e14f8 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,26 @@ +Wed Nov 21 11:41:29 2001 Owen Taylor + + * tests/testgtk.c (create_tooltips): Ref-sink the tooltips object. + + * gtk/gtktoolbar.c (gtk_toolbar_init): Ref-sink the tooltips object. + + * gtk/gtkfilesel.c (open_new_dir): Fix some constness warnings. + + * gtk/gtkaccelgroup.c: Rename gtk_accel_groups_from_acceleratable() + back to gtk_accel_groups_from_object(), change @acceleratable + parameter to gtk_accel_groups_activate() accordingly. + + * gtk/gtkaccelmap.c (gtk_accel_map_lookup_entry): Remove + left-over comment about quark return. + + * gtk/gtkaccelmap.h: Fix spelling of gtk_accel_map_foreach_unfiltered(). + + * gtk/gtk-boxed.defs (GtkIconSource): added as a boxed type. + (Patch from Matt Wilson) + + * gtk/gtkobject.c (gtk_object_finalize): Warn if a floating + object is finalized. + Tue Nov 20 21:25:08 2001 Tim Janik * applied patch from owen to get rid of accel map notifiers. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index fb08736ec1..b5641e14f8 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,26 @@ +Wed Nov 21 11:41:29 2001 Owen Taylor + + * tests/testgtk.c (create_tooltips): Ref-sink the tooltips object. + + * gtk/gtktoolbar.c (gtk_toolbar_init): Ref-sink the tooltips object. + + * gtk/gtkfilesel.c (open_new_dir): Fix some constness warnings. + + * gtk/gtkaccelgroup.c: Rename gtk_accel_groups_from_acceleratable() + back to gtk_accel_groups_from_object(), change @acceleratable + parameter to gtk_accel_groups_activate() accordingly. + + * gtk/gtkaccelmap.c (gtk_accel_map_lookup_entry): Remove + left-over comment about quark return. + + * gtk/gtkaccelmap.h: Fix spelling of gtk_accel_map_foreach_unfiltered(). + + * gtk/gtk-boxed.defs (GtkIconSource): added as a boxed type. + (Patch from Matt Wilson) + + * gtk/gtkobject.c (gtk_object_finalize): Warn if a floating + object is finalized. + Tue Nov 20 21:25:08 2001 Tim Janik * applied patch from owen to get rid of accel map notifiers. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index fb08736ec1..b5641e14f8 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,26 @@ +Wed Nov 21 11:41:29 2001 Owen Taylor + + * tests/testgtk.c (create_tooltips): Ref-sink the tooltips object. + + * gtk/gtktoolbar.c (gtk_toolbar_init): Ref-sink the tooltips object. + + * gtk/gtkfilesel.c (open_new_dir): Fix some constness warnings. + + * gtk/gtkaccelgroup.c: Rename gtk_accel_groups_from_acceleratable() + back to gtk_accel_groups_from_object(), change @acceleratable + parameter to gtk_accel_groups_activate() accordingly. + + * gtk/gtkaccelmap.c (gtk_accel_map_lookup_entry): Remove + left-over comment about quark return. + + * gtk/gtkaccelmap.h: Fix spelling of gtk_accel_map_foreach_unfiltered(). + + * gtk/gtk-boxed.defs (GtkIconSource): added as a boxed type. + (Patch from Matt Wilson) + + * gtk/gtkobject.c (gtk_object_finalize): Warn if a floating + object is finalized. + Tue Nov 20 21:25:08 2001 Tim Janik * applied patch from owen to get rid of accel map notifiers. diff --git a/gtk/gtk-boxed.defs b/gtk/gtk-boxed.defs index 1f1a997b5c..fce8686816 100644 --- a/gtk/gtk-boxed.defs +++ b/gtk/gtk-boxed.defs @@ -28,6 +28,11 @@ gtk_icon_set_unref "sizeof(GtkIconSet)") +(define-boxed GtkIconSource + gtk_icon_source_copy + gtk_icon_source_free + "sizeof(GtkIconSource)") + ;; TextView (define-boxed GtkTextIter diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c index 8106f813e1..a502943223 100644 --- a/gtk/gtkaccelgroup.c +++ b/gtk/gtkaccelgroup.c @@ -242,7 +242,7 @@ _gtk_accel_group_detach (GtkAccelGroup *accel_group, } GSList* -gtk_accel_groups_from_acceleratable (GObject *object) +gtk_accel_groups_from_object (GObject *object) { g_return_val_if_fail (G_IS_OBJECT (object), NULL); @@ -706,23 +706,24 @@ _gtk_accel_group_activate (GtkAccelGroup *accel_group, /** * gtk_accel_groups_activate: - * @acceleratable: usually a #GtkWindow + * @object: the #Gobject, usually a #GtkWindow, on which + * to activate the accelerator. * @accel_key: accelerator keyval from a key event * @accel_mods: keyboard state mask from a key event * @returns: %TRUE if the accelerator was handled, %FALSE otherwise * * Finds the first accelerator in any #GtkAccelGroup attached - * to @acceleratable that matches @accel_key and @accel_mods, and + * to @object that matches @accel_key and @accel_mods, and * activates that accelerator. * If an accelerator was activated and handled this keypress, %TRUE * is returned. */ gboolean -gtk_accel_groups_activate (GObject *acceleratable, +gtk_accel_groups_activate (GObject *object, guint accel_key, GdkModifierType accel_mods) { - g_return_val_if_fail (G_IS_OBJECT (acceleratable), FALSE); + g_return_val_if_fail (G_IS_OBJECT (object), FALSE); if (gtk_accelerator_valid (accel_key, accel_mods)) { @@ -734,8 +735,8 @@ gtk_accel_groups_activate (GObject *acceleratable, accel_quark = g_quark_from_string (accel_name); g_free (accel_name); - for (slist = gtk_accel_groups_from_acceleratable (acceleratable); slist; slist = slist->next) - if (_gtk_accel_group_activate (slist->data, accel_quark, acceleratable, accel_key, accel_mods)) + for (slist = gtk_accel_groups_from_object (object); slist; slist = slist->next) + if (_gtk_accel_group_activate (slist->data, accel_quark, object, accel_key, accel_mods)) return TRUE; } diff --git a/gtk/gtkaccelgroup.h b/gtk/gtkaccelgroup.h index cfb207f8a7..47d50cebae 100644 --- a/gtk/gtkaccelgroup.h +++ b/gtk/gtkaccelgroup.h @@ -112,10 +112,10 @@ void _gtk_accel_group_attach (GtkAccelGroup *accel_group, GObject *object); void _gtk_accel_group_detach (GtkAccelGroup *accel_group, GObject *object); -gboolean gtk_accel_groups_activate (GObject *acceleratable, +gboolean gtk_accel_groups_activate (GObject *object, guint accel_key, GdkModifierType accel_mods); -GSList* gtk_accel_groups_from_acceleratable (GObject *object); +GSList* gtk_accel_groups_from_object (GObject *object); GtkAccelKey* gtk_accel_group_find (GtkAccelGroup *accel_group, gboolean (*find_func) (GtkAccelKey *key, GClosure *closure, diff --git a/gtk/gtkaccelmap.c b/gtk/gtkaccelmap.c index 7fe375c606..00131a5bb5 100644 --- a/gtk/gtkaccelmap.c +++ b/gtk/gtkaccelmap.c @@ -169,9 +169,7 @@ gtk_accel_map_add_entry (const gchar *accel_path, * @key: accelerator key to be filled in (optional) * @returns: %TRUE if @accel_path is known, %FALSE otherwise * - * Lookup the accelerator entry for @accel_path and fill in @key. - * If the lookup revealed no results, (0) is returned, the entry's - * #GQuark otherwise. + * Looks up the accelerator entry for @accel_path and fills in @key. */ gboolean gtk_accel_map_lookup_entry (const gchar *accel_path, @@ -279,7 +277,7 @@ internal_change_entry (const gchar *accel_path, win_list = g_hash_table_slist_values (win_hm); g_hash_table_destroy (win_hm); for (slist = win_list; slist; slist = slist->next) - for (node = gtk_accel_groups_from_acceleratable (slist->data); node; node = node->next) + for (node = gtk_accel_groups_from_object (slist->data); node; node = node->next) g_hash_table_insert (group_hm, node->data, node->data); group_list = g_hash_table_slist_values (group_hm); g_hash_table_destroy (group_hm); diff --git a/gtk/gtkaccelmap.h b/gtk/gtkaccelmap.h index 7a59b2d808..7321079ed6 100644 --- a/gtk/gtkaccelmap.h +++ b/gtk/gtkaccelmap.h @@ -53,9 +53,9 @@ void gtk_accel_map_save_fd (gint fd); /* --- filter functions --- */ -void gtk_accel_map_add_filter (const gchar *filter_pattern); -void gtk_accel_map_foreach_unfilterd (gpointer data, - GtkAccelMapForeach foreach_func); +void gtk_accel_map_add_filter (const gchar *filter_pattern); +void gtk_accel_map_foreach_unfiltered (gpointer data, + GtkAccelMapForeach foreach_func); /* --- internal API --- */ diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index 19fb7ab9e8..1190154c4e 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -2590,7 +2590,7 @@ open_new_dir (gchar *dir_name, { CompletionDirSent *sent; GDir *directory; - char *dirent; + const char *dirent; GError *error; gint entry_count = 0; gint n_entries = 0; diff --git a/gtk/gtkobject.c b/gtk/gtkobject.c index 0c47368369..70e1eda4a7 100644 --- a/gtk/gtkobject.c +++ b/gtk/gtkobject.c @@ -389,6 +389,15 @@ gtk_object_finalize (GObject *gobject) { GtkObject *object = GTK_OBJECT (gobject); + if (GTK_OBJECT_FLOATING (object)) + { + g_warning ("A floating object was finalized. This means that someone\n" + "called g_object_unref() on an object that had only a floating\n" + "reference; the initial floating reference is not owned by anyone\n" + "and must be removed with gtk_object_sink() after a normal\n" + "reference is obtained with g_object_ref()."); + } + gtk_object_notify_weaks (object); G_OBJECT_CLASS (parent_class)->finalize (gobject); diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index 7bf325e2d7..9ee939a72d 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -340,6 +340,9 @@ gtk_toolbar_init (GtkToolbar *toolbar) toolbar->orientation = GTK_ORIENTATION_HORIZONTAL; toolbar->icon_size = DEFAULT_ICON_SIZE; toolbar->tooltips = gtk_tooltips_new (); + g_object_ref (toolbar->tooltips); + gtk_object_sink (GTK_OBJECT (toolbar->tooltips)); + toolbar->button_maxw = 0; toolbar->button_maxh = 0; diff --git a/tests/testgtk.c b/tests/testgtk.c index 8f22c514dc..f893412e72 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -2823,6 +2823,8 @@ create_tooltips (void) &window); tooltips=gtk_tooltips_new(); + g_object_ref (tooltips); + gtk_object_sink (GTK_OBJECT (tooltips)); gtk_object_set_data (GTK_OBJECT (window), "tooltips", tooltips); box1 = gtk_vbox_new (FALSE, 0);