Commit e7093923 authored by James Henstridge's avatar James Henstridge Committed by James Henstridge

commiting patch after comments from Alex on IRC

2001-07-15  James Henstridge  <james@daa.com.au>

	* gtk/gtkwindow.c (gtk_window_add_accel_group): cast to GObject.
	(gtk_window_remove_accel_group): same here.
	(gtk_window_key_press_event): same here.

	* gtk/gtkwidget.c (gtk_widget_add_accelerator): cast to GObject.
	(gtk_widget_remove_accelerator): same here.
	(gtk_widget_remove_accelerators): same here.

	* gtk/gtkplug.c (gtk_plug_accel_entries_changed): same here.

	* gtk/gtkmenushell.c (gtk_menu_shell_key_press): cast to GObject
	instead of GtkObject.

	* gtk/gtkmenu.c (gtk_menu_key_press): update since GtkAccelGroup
	now takes GObjects.

	* gtk/gtkitemfactory.c (gtk_item_factory_propagate_accelerator):
	pass a GObject to gtk_accel_group_entries_from_object.
	(gtk_item_factory_create_item): s/accel_widget/accel_object/

	* gtk/gtk-boxed.defs: remove GtkAccelGroup boxed def.

	* gtk/gtkaccellabel.c: convert to handle GObject accel objects.

	* gtk/gtkaccellabel.h: fix header to reflect that arbitrary
	GObjects can have accelerators set now.  Add compatibility
	defines.

	* gtk/gtkmarshal.list: add missing marshallers.

	* gtk/gtkaccelgroup.[ch]: convert to a GObject, and allow setting
	accelerators on plain GObjects.  gtk_accel_group_object_destroy
	has been converted into a weak reference, and
	gtk_accel_group_delete_entries is now a destroy notify for that
	piece of data.
parent afacc246
2001-07-15 James Henstridge <james@daa.com.au>
* gtk/gtkwindow.c (gtk_window_add_accel_group): cast to GObject.
(gtk_window_remove_accel_group): same here.
(gtk_window_key_press_event): same here.
* gtk/gtkwidget.c (gtk_widget_add_accelerator): cast to GObject.
(gtk_widget_remove_accelerator): same here.
(gtk_widget_remove_accelerators): same here.
* gtk/gtkplug.c (gtk_plug_accel_entries_changed): same here.
* gtk/gtkmenushell.c (gtk_menu_shell_key_press): cast to GObject
instead of GtkObject.
* gtk/gtkmenu.c (gtk_menu_key_press): update since GtkAccelGroup
now takes GObjects.
* gtk/gtkitemfactory.c (gtk_item_factory_propagate_accelerator):
pass a GObject to gtk_accel_group_entries_from_object.
(gtk_item_factory_create_item): s/accel_widget/accel_object/
* gtk/gtk-boxed.defs: remove GtkAccelGroup boxed def.
* gtk/gtkaccellabel.c: convert to handle GObject accel objects.
* gtk/gtkaccellabel.h: fix header to reflect that arbitrary
GObjects can have accelerators set now. Add compatibility
defines.
* gtk/gtkmarshal.list: add missing marshallers.
* gtk/gtkaccelgroup.[ch]: convert to a GObject, and allow setting
accelerators on plain GObjects. gtk_accel_group_object_destroy
has been converted into a weak reference, and
gtk_accel_group_delete_entries is now a destroy notify for that
piece of data.
2001-07-23 Ron Steinke <rsteinke@w-link.net>
* gdk/gdkdraw.c: Added a check on the colormap depth to
......
2001-07-15 James Henstridge <james@daa.com.au>
* gtk/gtkwindow.c (gtk_window_add_accel_group): cast to GObject.
(gtk_window_remove_accel_group): same here.
(gtk_window_key_press_event): same here.
* gtk/gtkwidget.c (gtk_widget_add_accelerator): cast to GObject.
(gtk_widget_remove_accelerator): same here.
(gtk_widget_remove_accelerators): same here.
* gtk/gtkplug.c (gtk_plug_accel_entries_changed): same here.
* gtk/gtkmenushell.c (gtk_menu_shell_key_press): cast to GObject
instead of GtkObject.
* gtk/gtkmenu.c (gtk_menu_key_press): update since GtkAccelGroup
now takes GObjects.
* gtk/gtkitemfactory.c (gtk_item_factory_propagate_accelerator):
pass a GObject to gtk_accel_group_entries_from_object.
(gtk_item_factory_create_item): s/accel_widget/accel_object/
* gtk/gtk-boxed.defs: remove GtkAccelGroup boxed def.
* gtk/gtkaccellabel.c: convert to handle GObject accel objects.
* gtk/gtkaccellabel.h: fix header to reflect that arbitrary
GObjects can have accelerators set now. Add compatibility
defines.
* gtk/gtkmarshal.list: add missing marshallers.
* gtk/gtkaccelgroup.[ch]: convert to a GObject, and allow setting
accelerators on plain GObjects. gtk_accel_group_object_destroy
has been converted into a weak reference, and
gtk_accel_group_delete_entries is now a destroy notify for that
piece of data.
2001-07-23 Ron Steinke <rsteinke@w-link.net>
* gdk/gdkdraw.c: Added a check on the colormap depth to
......
2001-07-15 James Henstridge <james@daa.com.au>
* gtk/gtkwindow.c (gtk_window_add_accel_group): cast to GObject.
(gtk_window_remove_accel_group): same here.
(gtk_window_key_press_event): same here.
* gtk/gtkwidget.c (gtk_widget_add_accelerator): cast to GObject.
(gtk_widget_remove_accelerator): same here.
(gtk_widget_remove_accelerators): same here.
* gtk/gtkplug.c (gtk_plug_accel_entries_changed): same here.
* gtk/gtkmenushell.c (gtk_menu_shell_key_press): cast to GObject
instead of GtkObject.
* gtk/gtkmenu.c (gtk_menu_key_press): update since GtkAccelGroup
now takes GObjects.
* gtk/gtkitemfactory.c (gtk_item_factory_propagate_accelerator):
pass a GObject to gtk_accel_group_entries_from_object.
(gtk_item_factory_create_item): s/accel_widget/accel_object/
* gtk/gtk-boxed.defs: remove GtkAccelGroup boxed def.
* gtk/gtkaccellabel.c: convert to handle GObject accel objects.
* gtk/gtkaccellabel.h: fix header to reflect that arbitrary
GObjects can have accelerators set now. Add compatibility
defines.
* gtk/gtkmarshal.list: add missing marshallers.
* gtk/gtkaccelgroup.[ch]: convert to a GObject, and allow setting
accelerators on plain GObjects. gtk_accel_group_object_destroy
has been converted into a weak reference, and
gtk_accel_group_delete_entries is now a destroy notify for that
piece of data.
2001-07-23 Ron Steinke <rsteinke@w-link.net>
* gdk/gdkdraw.c: Added a check on the colormap depth to
......
2001-07-15 James Henstridge <james@daa.com.au>
* gtk/gtkwindow.c (gtk_window_add_accel_group): cast to GObject.
(gtk_window_remove_accel_group): same here.
(gtk_window_key_press_event): same here.
* gtk/gtkwidget.c (gtk_widget_add_accelerator): cast to GObject.
(gtk_widget_remove_accelerator): same here.
(gtk_widget_remove_accelerators): same here.
* gtk/gtkplug.c (gtk_plug_accel_entries_changed): same here.
* gtk/gtkmenushell.c (gtk_menu_shell_key_press): cast to GObject
instead of GtkObject.
* gtk/gtkmenu.c (gtk_menu_key_press): update since GtkAccelGroup
now takes GObjects.
* gtk/gtkitemfactory.c (gtk_item_factory_propagate_accelerator):
pass a GObject to gtk_accel_group_entries_from_object.
(gtk_item_factory_create_item): s/accel_widget/accel_object/
* gtk/gtk-boxed.defs: remove GtkAccelGroup boxed def.
* gtk/gtkaccellabel.c: convert to handle GObject accel objects.
* gtk/gtkaccellabel.h: fix header to reflect that arbitrary
GObjects can have accelerators set now. Add compatibility
defines.
* gtk/gtkmarshal.list: add missing marshallers.
* gtk/gtkaccelgroup.[ch]: convert to a GObject, and allow setting
accelerators on plain GObjects. gtk_accel_group_object_destroy
has been converted into a weak reference, and
gtk_accel_group_delete_entries is now a destroy notify for that
piece of data.
2001-07-23 Ron Steinke <rsteinke@w-link.net>
* gdk/gdkdraw.c: Added a check on the colormap depth to
......
2001-07-15 James Henstridge <james@daa.com.au>
* gtk/gtkwindow.c (gtk_window_add_accel_group): cast to GObject.
(gtk_window_remove_accel_group): same here.
(gtk_window_key_press_event): same here.
* gtk/gtkwidget.c (gtk_widget_add_accelerator): cast to GObject.
(gtk_widget_remove_accelerator): same here.
(gtk_widget_remove_accelerators): same here.
* gtk/gtkplug.c (gtk_plug_accel_entries_changed): same here.
* gtk/gtkmenushell.c (gtk_menu_shell_key_press): cast to GObject
instead of GtkObject.
* gtk/gtkmenu.c (gtk_menu_key_press): update since GtkAccelGroup
now takes GObjects.
* gtk/gtkitemfactory.c (gtk_item_factory_propagate_accelerator):
pass a GObject to gtk_accel_group_entries_from_object.
(gtk_item_factory_create_item): s/accel_widget/accel_object/
* gtk/gtk-boxed.defs: remove GtkAccelGroup boxed def.
* gtk/gtkaccellabel.c: convert to handle GObject accel objects.
* gtk/gtkaccellabel.h: fix header to reflect that arbitrary
GObjects can have accelerators set now. Add compatibility
defines.
* gtk/gtkmarshal.list: add missing marshallers.
* gtk/gtkaccelgroup.[ch]: convert to a GObject, and allow setting
accelerators on plain GObjects. gtk_accel_group_object_destroy
has been converted into a weak reference, and
gtk_accel_group_delete_entries is now a destroy notify for that
piece of data.
2001-07-23 Ron Steinke <rsteinke@w-link.net>
* gdk/gdkdraw.c: Added a check on the colormap depth to
......
2001-07-15 James Henstridge <james@daa.com.au>
* gtk/gtkwindow.c (gtk_window_add_accel_group): cast to GObject.
(gtk_window_remove_accel_group): same here.
(gtk_window_key_press_event): same here.
* gtk/gtkwidget.c (gtk_widget_add_accelerator): cast to GObject.
(gtk_widget_remove_accelerator): same here.
(gtk_widget_remove_accelerators): same here.
* gtk/gtkplug.c (gtk_plug_accel_entries_changed): same here.
* gtk/gtkmenushell.c (gtk_menu_shell_key_press): cast to GObject
instead of GtkObject.
* gtk/gtkmenu.c (gtk_menu_key_press): update since GtkAccelGroup
now takes GObjects.
* gtk/gtkitemfactory.c (gtk_item_factory_propagate_accelerator):
pass a GObject to gtk_accel_group_entries_from_object.
(gtk_item_factory_create_item): s/accel_widget/accel_object/
* gtk/gtk-boxed.defs: remove GtkAccelGroup boxed def.
* gtk/gtkaccellabel.c: convert to handle GObject accel objects.
* gtk/gtkaccellabel.h: fix header to reflect that arbitrary
GObjects can have accelerators set now. Add compatibility
defines.
* gtk/gtkmarshal.list: add missing marshallers.
* gtk/gtkaccelgroup.[ch]: convert to a GObject, and allow setting
accelerators on plain GObjects. gtk_accel_group_object_destroy
has been converted into a weak reference, and
gtk_accel_group_delete_entries is now a destroy notify for that
piece of data.
2001-07-23 Ron Steinke <rsteinke@w-link.net>
* gdk/gdkdraw.c: Added a check on the colormap depth to
......
2001-07-15 James Henstridge <james@daa.com.au>
* gtk/gtkwindow.c (gtk_window_add_accel_group): cast to GObject.
(gtk_window_remove_accel_group): same here.
(gtk_window_key_press_event): same here.
* gtk/gtkwidget.c (gtk_widget_add_accelerator): cast to GObject.
(gtk_widget_remove_accelerator): same here.
(gtk_widget_remove_accelerators): same here.
* gtk/gtkplug.c (gtk_plug_accel_entries_changed): same here.
* gtk/gtkmenushell.c (gtk_menu_shell_key_press): cast to GObject
instead of GtkObject.
* gtk/gtkmenu.c (gtk_menu_key_press): update since GtkAccelGroup
now takes GObjects.
* gtk/gtkitemfactory.c (gtk_item_factory_propagate_accelerator):
pass a GObject to gtk_accel_group_entries_from_object.
(gtk_item_factory_create_item): s/accel_widget/accel_object/
* gtk/gtk-boxed.defs: remove GtkAccelGroup boxed def.
* gtk/gtkaccellabel.c: convert to handle GObject accel objects.
* gtk/gtkaccellabel.h: fix header to reflect that arbitrary
GObjects can have accelerators set now. Add compatibility
defines.
* gtk/gtkmarshal.list: add missing marshallers.
* gtk/gtkaccelgroup.[ch]: convert to a GObject, and allow setting
accelerators on plain GObjects. gtk_accel_group_object_destroy
has been converted into a weak reference, and
gtk_accel_group_delete_entries is now a destroy notify for that
piece of data.
2001-07-23 Ron Steinke <rsteinke@w-link.net>
* gdk/gdkdraw.c: Added a check on the colormap depth to
......
......@@ -9,10 +9,6 @@
;;; Gtk boxed types
(define-boxed GtkAccelGroup
gtk_accel_group_ref
gtk_accel_group_unref)
(define-boxed GtkBorder
gtk_border_copy
gtk_border_free
......
This diff is collapsed.
......@@ -36,13 +36,20 @@
#include <gtk/gtkenums.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
G_BEGIN_DECLS
typedef struct _GtkAccelGroup GtkAccelGroup;
typedef struct _GtkAccelEntry GtkAccelEntry;
#define GTK_TYPE_ACCEL_GROUP (gtk_accel_group_get_type ())
#define GTK_ACCEL_GROUP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_ACCEL_GROUP, GtkAccelGroup))
#define GTK_ACCEL_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACCEL_GROUP, GtkAccelGroupClass))
#define GTK_IS_ACCEL_GROUP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_ACCEL_GROUP))
#define GTK_IS_ACCEL_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACCEL_GROUP))
#define GTK_ACCEL_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ACCEL_GROUP, GtkAccelGroupClass))
typedef struct _GtkAccelGroup GtkAccelGroup;
typedef struct _GtkAccelGroupClass GtkAccelGroupClass;
typedef struct _GtkAccelEntry GtkAccelEntry;
typedef enum
{
......@@ -63,12 +70,17 @@ typedef enum
struct _GtkAccelGroup
{
guint ref_count;
GObject parent;
guint lock_count;
GdkModifierType modifier_mask;
GSList *attach_objects;
};
struct _GtkAccelGroupClass
{
GObjectClass parent_class;
};
struct _GtkAccelEntry
{
/* key portion
......@@ -78,7 +90,7 @@ struct _GtkAccelEntry
GdkModifierType accelerator_mods;
GtkAccelFlags accel_flags;
GtkObject *object;
GObject *object;
guint signal_id;
};
......@@ -98,13 +110,14 @@ guint gtk_accelerator_get_default_mod_mask (void);
/* Accelerator Groups
*/
GType gtk_accel_group_get_type (void);
GtkAccelGroup* gtk_accel_group_new (void);
GtkAccelGroup* gtk_accel_group_get_default (void);
GtkAccelGroup* gtk_accel_group_ref (GtkAccelGroup *accel_group);
void gtk_accel_group_unref (GtkAccelGroup *accel_group);
void gtk_accel_group_lock (GtkAccelGroup *accel_group);
void gtk_accel_group_unlock (GtkAccelGroup *accel_group);
gboolean gtk_accel_groups_activate (GtkObject *object,
gboolean gtk_accel_groups_activate (GObject *object,
guint accel_key,
GdkModifierType accel_mods);
......@@ -114,9 +127,9 @@ gboolean gtk_accel_group_activate (GtkAccelGroup *accel_group,
guint accel_key,
GdkModifierType accel_mods);
void gtk_accel_group_attach (GtkAccelGroup *accel_group,
GtkObject *object);
GObject *object);
void gtk_accel_group_detach (GtkAccelGroup *accel_group,
GtkObject *object);
GObject *object);
/* Accelerator Group Entries (internal)
*/
......@@ -133,42 +146,39 @@ void gtk_accel_group_add (GtkAccelGroup *accel_group,
guint accel_key,
GdkModifierType accel_mods,
GtkAccelFlags accel_flags,
GtkObject *object,
GObject *object,
const gchar *accel_signal);
void gtk_accel_group_remove (GtkAccelGroup *accel_group,
guint accel_key,
GdkModifierType accel_mods,
GtkObject *object);
GObject *object);
/* Accelerator Signals (internal)
*/
void gtk_accel_group_handle_add (GtkObject *object,
void gtk_accel_group_handle_add (GObject *object,
guint accel_signal_id,
GtkAccelGroup *accel_group,
guint accel_key,
GdkModifierType accel_mods,
GtkAccelFlags accel_flags);
void gtk_accel_group_handle_remove (GtkObject *object,
void gtk_accel_group_handle_remove (GObject *object,
GtkAccelGroup *accel_group,
guint accel_key,
GdkModifierType accel_mods);
guint gtk_accel_group_create_add (GtkType class_type,
GtkSignalRunType signal_flags,
guint gtk_accel_group_create_add (GType class_type,
GSignalFlags signal_flags,
guint handler_offset);
guint gtk_accel_group_create_remove (GtkType class_type,
GtkSignalRunType signal_flags,
guint gtk_accel_group_create_remove (GType class_type,
GSignalFlags signal_flags,
guint handler_offset);
/* Miscellaneous (internal)
*/
GSList* gtk_accel_groups_from_object (GtkObject *object);
GSList* gtk_accel_group_entries_from_object (GtkObject *object);
GSList* gtk_accel_groups_from_object (GObject *object);
GSList* gtk_accel_group_entries_from_object (GObject *object);
#ifdef __cplusplus
}
#endif /* __cplusplus */
G_END_DECLS
#endif /* __GTK_ACCEL_GROUP_H__ */
......@@ -36,7 +36,7 @@
enum {
PROP_0,
PROP_ACCEL_WIDGET
PROP_ACCEL_OBJECT
};
static void gtk_accel_label_class_init (GtkAccelLabelClass *klass);
......@@ -110,11 +110,11 @@ gtk_accel_label_class_init (GtkAccelLabelClass *class)
object_class->destroy = gtk_accel_label_destroy;
g_object_class_install_property (G_OBJECT_CLASS(object_class),
PROP_ACCEL_WIDGET,
g_param_spec_object ("accel_widget",
_("Accelerator widget"),
_("The widget monitored by this accelerator label"),
GTK_TYPE_WIDGET,
PROP_ACCEL_OBJECT,
g_param_spec_object ("accel_object",
_("Accelerator object"),
_("The object monitored by this accelerator label"),
G_TYPE_OBJECT,
G_PARAM_READABLE | G_PARAM_WRITABLE));
......@@ -143,8 +143,8 @@ gtk_accel_label_set_property (GObject *object,
switch (prop_id)
{
case PROP_ACCEL_WIDGET:
gtk_accel_label_set_accel_widget (accel_label, (GtkWidget*) g_value_get_object (value));
case PROP_ACCEL_OBJECT:
gtk_accel_label_set_accel_object (accel_label, g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -163,8 +163,8 @@ static void gtk_accel_label_get_property (GObject *object,
switch (prop_id)
{
case PROP_ACCEL_WIDGET:
g_value_set_object (value, G_OBJECT (accel_label->accel_widget));
case PROP_ACCEL_OBJECT:
g_value_set_object (value, accel_label->accel_object);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -177,7 +177,7 @@ gtk_accel_label_init (GtkAccelLabel *accel_label)
{
accel_label->queue_id = 0;
accel_label->accel_padding = 3;
accel_label->accel_widget = NULL;
accel_label->accel_object = NULL;
accel_label->accel_string = NULL;
gtk_accel_label_refetch (accel_label);
......@@ -206,7 +206,7 @@ gtk_accel_label_destroy (GtkObject *object)
accel_label = GTK_ACCEL_LABEL (object);
gtk_accel_label_set_accel_widget (accel_label, NULL);
gtk_accel_label_set_accel_object (accel_label, NULL);
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
......@@ -226,21 +226,21 @@ gtk_accel_label_finalize (GObject *object)
}
/**
* gtk_accel_label_get_accel_widget:
* gtk_accel_label_get_accel_object:
* @accel_label: a #GtkAccelLabel
*
* Fetches the widget monitored by this accelerator label. See
* gtk_accel_label_set_accel_widget().
* gtk_accel_label_set_accel_object().
*
* Return value: the widget monitored by the accelerator label,
* Return value: the object monitored by the accelerator label,
* or %NULL.
**/
GtkWidget *
gtk_accel_label_get_accel_widget (GtkAccelLabel *accel_label)
GObject *
gtk_accel_label_get_accel_object (GtkAccelLabel *accel_label)
{
g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), NULL);
return accel_label->accel_widget;
return accel_label->accel_object;
}
guint
......@@ -348,41 +348,42 @@ gtk_accel_label_queue_refetch (GtkAccelLabel *accel_label)
}
void
gtk_accel_label_set_accel_widget (GtkAccelLabel *accel_label,
GtkWidget *accel_widget)
gtk_accel_label_set_accel_object (GtkAccelLabel *accel_label,
GObject *accel_object)
{
g_return_if_fail (GTK_IS_ACCEL_LABEL (accel_label));
if (accel_widget != NULL)
g_return_if_fail (GTK_IS_WIDGET (accel_widget));
if (accel_widget != accel_label->accel_widget)
g_return_if_fail (accel_object == NULL || G_IS_OBJECT (accel_object));
if (accel_object != accel_label->accel_object)
{
if (accel_label->accel_widget)
if (accel_label->accel_object)
{
gtk_signal_disconnect_by_func (GTK_OBJECT (accel_label->accel_widget),
GTK_SIGNAL_FUNC (gtk_accel_label_queue_refetch),
accel_label);
gtk_widget_unref (accel_label->accel_widget);
g_signal_handlers_disconnect_by_func (accel_label->accel_object,
G_CALLBACK (gtk_accel_label_queue_refetch),
accel_object);
g_object_unref (accel_label->accel_object);
}
if (accel_label->queue_id)
{
gtk_idle_remove (accel_label->queue_id);
accel_label->queue_id = 0;
}
accel_label->accel_widget = accel_widget;
if (accel_label->accel_widget)
accel_label->accel_object = accel_object;
if (accel_label->accel_object)
{
gtk_widget_ref (accel_label->accel_widget);
gtk_signal_connect_object_after (GTK_OBJECT (accel_label->accel_widget),
"add-accelerator",
GTK_SIGNAL_FUNC (gtk_accel_label_queue_refetch),
GTK_OBJECT (accel_label));
gtk_signal_connect_object_after (GTK_OBJECT (accel_label->accel_widget),
"remove-accelerator",
GTK_SIGNAL_FUNC (gtk_accel_label_queue_refetch),
GTK_OBJECT (accel_label));
g_object_ref (accel_label->accel_object);
g_signal_connect_object (accel_label->accel_object,
"add-accelerator",
G_CALLBACK (gtk_accel_label_queue_refetch),
accel_label,
G_CONNECT_AFTER | G_CONNECT_SWAPPED);
g_signal_connect_object (accel_label->accel_object,
"remove-accelerator",
G_CALLBACK (gtk_accel_label_queue_refetch),
accel_label,
G_CONNECT_AFTER | G_CONNECT_SWAPPED);
}
g_object_notify (G_OBJECT (accel_label), "accel_widget");
g_object_notify (G_OBJECT (accel_label), "accel_object");
}
}
......@@ -410,12 +411,12 @@ gtk_accel_label_refetch (GtkAccelLabel *accel_label)
g_free (accel_label->accel_string);
accel_label->accel_string = NULL;
if (accel_label->accel_widget)
if (accel_label->accel_object)
{
GtkAccelEntry *entry = NULL;
GSList *slist;
slist = gtk_accel_group_entries_from_object (GTK_OBJECT (accel_label->accel_widget));
slist = gtk_accel_group_entries_from_object (accel_label->accel_object);
for (; slist; slist = slist->next)
{
entry = slist->data;
......
......@@ -56,7 +56,7 @@ struct _GtkAccelLabel
guint queue_id;
guint accel_padding;
GtkWidget *accel_widget;
GObject *accel_object;
gchar *accel_string;
guint16 accel_string_width;
};
......@@ -77,13 +77,19 @@ struct _GtkAccelLabelClass
GtkType gtk_accel_label_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_accel_label_new (const gchar *string);
GtkWidget* gtk_accel_label_get_accel_widget (GtkAccelLabel *accel_label);
GtkWidget *gtk_accel_label_new (const gchar *string);
GObject *gtk_accel_label_get_accel_object (GtkAccelLabel *accel_label);
guint gtk_accel_label_get_accel_width (GtkAccelLabel *accel_label);
void gtk_accel_label_set_accel_widget (GtkAccelLabel *accel_label,
GtkWidget *accel_widget);
void gtk_accel_label_set_accel_object (GtkAccelLabel *accel_label,
GObject *accel_object);
gboolean gtk_accel_label_refetch (GtkAccelLabel *accel_label);
#ifndef GTK_DISABLE_DEPRECATED
#define gtk_accel_label_get_accel_widget(accel_label) \
GTK_WIDGET(gtk_accel_label_get_accel_object(acel_label))
#define gtk_accel_label_set_accel_widget(accel_label, accel_widget) \
gtk_accel_label_set_accel_object((accel_label), G_OBJECT(accel_widget))
#endif
#ifdef __cplusplus
}
......
......@@ -335,7 +335,7 @@ gtk_item_factory_propagate_accelerator (GtkItemFactoryItem *item,
{
GSList *work;
work = gtk_accel_group_entries_from_object (GTK_OBJECT (widget));
work = gtk_accel_group_entries_from_object (G_OBJECT (widget));
while (work)
{
GtkAccelEntry *ac_entry;
......@@ -1266,7 +1266,7 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
label = gtk_widget_new (GTK_TYPE_ACCEL_LABEL,
"GtkWidget::visible", TRUE,
"GtkWidget::parent", widget,
"GtkAccelLabel::accel_widget", widget,
"GtkAccelLabel::accel_object", widget,
"GtkMisc::xalign", 0.0,
NULL);
......
......@@ -70,6 +70,7 @@ VOID:OBJECT,INT,INT,BOXED,UINT,UINT
VOID:OBJECT,OBJECT
VOID:OBJECT,STRING,STRING
</