Ref-sink the tooltips object. Ref-sink the tooltips object. Fix some

Wed Nov 21 11:41:29 2001  Owen Taylor  <otaylor@redhat.com>
	* 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.
This commit is contained in:
Owen Taylor 2001-11-21 17:04:35 +00:00 committed by Owen Taylor
parent d5db986a0b
commit c860866dd7
16 changed files with 196 additions and 17 deletions

View File

@ -1,3 +1,26 @@
Wed Nov 21 11:41:29 2001 Owen Taylor <otaylor@redhat.com>
* 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 <timj@gtk.org>
* applied patch from owen to get rid of accel map notifiers.

View File

@ -1,3 +1,26 @@
Wed Nov 21 11:41:29 2001 Owen Taylor <otaylor@redhat.com>
* 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 <timj@gtk.org>
* applied patch from owen to get rid of accel map notifiers.

View File

@ -1,3 +1,26 @@
Wed Nov 21 11:41:29 2001 Owen Taylor <otaylor@redhat.com>
* 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 <timj@gtk.org>
* applied patch from owen to get rid of accel map notifiers.

View File

@ -1,3 +1,26 @@
Wed Nov 21 11:41:29 2001 Owen Taylor <otaylor@redhat.com>
* 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 <timj@gtk.org>
* applied patch from owen to get rid of accel map notifiers.

View File

@ -1,3 +1,26 @@
Wed Nov 21 11:41:29 2001 Owen Taylor <otaylor@redhat.com>
* 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 <timj@gtk.org>
* applied patch from owen to get rid of accel map notifiers.

View File

@ -1,3 +1,26 @@
Wed Nov 21 11:41:29 2001 Owen Taylor <otaylor@redhat.com>
* 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 <timj@gtk.org>
* applied patch from owen to get rid of accel map notifiers.

View File

@ -1,3 +1,26 @@
Wed Nov 21 11:41:29 2001 Owen Taylor <otaylor@redhat.com>
* 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 <timj@gtk.org>
* applied patch from owen to get rid of accel map notifiers.

View File

@ -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

View File

@ -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;
}

View File

@ -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,

View File

@ -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);

View File

@ -54,7 +54,7 @@ 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,
void gtk_accel_map_foreach_unfiltered (gpointer data,
GtkAccelMapForeach foreach_func);

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);