Commit b695c970 authored by Cosimo Cecchi's avatar Cosimo Cecchi

Remove deprecated GDK/GTK+ symbols

Remove all uses of deprecated GDK and GTK+ symbols, replacing them
with the currently supported equivalents.
Based on a patch from Tal Benavidor (#565038).
parent e2f71153
......@@ -30,11 +30,17 @@
G_BEGIN_DECLS
#define EEL_TYPE_BACKGROUND_BOX (eel_background_box_get_type ())
#define EEL_BACKGROUND_BOX(obj) (GTK_CHECK_CAST ((obj), EEL_TYPE_BACKGROUND_BOX, EelBackgroundBox))
#define EEL_BACKGROUND_BOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EEL_TYPE_BACKGROUND_BOX, EelBackgroundBoxClass))
#define EEL_IS_BACKGROUND_BOX(obj) (GTK_CHECK_TYPE ((obj), EEL_TYPE_BACKGROUND_BOX))
#define EEL_IS_BACKGROUND_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EEL_TYPE_BACKGROUND_BOX))
#define EEL_TYPE_BACKGROUND_BOX eel_background_box_get_type()
#define EEL_BACKGROUND_BOX(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_BACKGROUND_BOX, EelBackgroundBox))
#define EEL_BACKGROUND_BOX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), EEL_TYPE_BACKGROUND_BOX, EelBackgroundBoxClass))
#define EEL_IS_BACKGROUND_BOX(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEL_TYPE_BACKGROUND_BOX))
#define EEL_IS_BACKGROUND_BOX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), EEL_TYPE_BACKGROUND_BOX))
#define EEL_BACKGROUND_BOX_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), EEL_TYPE_BACKGROUND_BOX, EelBackgroundBoxClass))
typedef struct EelBackgroundBox EelBackgroundBox;
typedef struct EelBackgroundBoxClass EelBackgroundBoxClass;
......@@ -51,7 +57,7 @@ struct EelBackgroundBoxClass
GtkEventBoxClass parent_class;
};
GtkType eel_background_box_get_type (void);
GType eel_background_box_get_type (void);
GtkWidget *eel_background_box_new (void);
G_END_DECLS
......
......@@ -989,7 +989,6 @@ eel_get_widget_background (GtkWidget *widget)
/* Store the background in the widget's data. */
background = eel_background_new ();
g_object_ref (background);
gtk_object_sink (GTK_OBJECT (background));
g_object_set_data_full (G_OBJECT (widget), "eel_background",
background, g_object_unref);
background->details->widget = widget;
......@@ -1106,7 +1105,7 @@ eel_self_check_background (void)
eel_background_set_color (background, "red-blue");
eel_background_set_color (background, "red-blue:h");
gtk_object_sink (GTK_OBJECT (background));
g_object_ref_sink (background);
}
#endif
......@@ -48,16 +48,17 @@
typedef struct EelBackground EelBackground;
typedef struct EelBackgroundClass EelBackgroundClass;
#define EEL_TYPE_BACKGROUND \
(eel_background_get_type ())
#define EEL_TYPE_BACKGROUND eel_background_get_type()
#define EEL_BACKGROUND(obj) \
(GTK_CHECK_CAST ((obj), EEL_TYPE_BACKGROUND, EelBackground))
(G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_BACKGROUND, EelBackground))
#define EEL_BACKGROUND_CLASS(klass) \
(GTK_CHECK_CLASS_CAST ((klass), EEL_TYPE_BACKGROUND, EelBackgroundClass))
(G_TYPE_CHECK_CLASS_CAST ((klass), EEL_TYPE_BACKGROUND, EelBackgroundClass))
#define EEL_IS_BACKGROUND(obj) \
(GTK_CHECK_TYPE ((obj), EEL_TYPE_BACKGROUND))
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEL_TYPE_BACKGROUND))
#define EEL_IS_BACKGROUND_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), EEL_TYPE_BACKGROUND))
(G_TYPE_CHECK_CLASS_TYPE ((klass), EEL_TYPE_BACKGROUND))
#define EEL_BACKGROUND_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), EEL_TYPE_BACKGROUND, EelBackgroundClass))
typedef enum {
EEL_BACKGROUND_TILED = 0, /* zero makes this the default placement */
......@@ -67,7 +68,7 @@ typedef enum {
EEL_BACKGROUND_ZOOM
} EelBackgroundImagePlacement;
GtkType eel_background_get_type (void);
GType eel_background_get_type (void);
EelBackground * eel_background_new (void);
......
......@@ -63,14 +63,17 @@ G_BEGIN_DECLS
* will be scaled when the canvas zoom factor is changed.
*/
#define EEL_TYPE_CANVAS_RE (eel_canvas_re_get_type ())
#define EEL_CANVAS_RE(obj) (GTK_CHECK_CAST ((obj), EEL_TYPE_CANVAS_RE, EelCanvasRE))
#define EEL_CANVAS_RE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS_RE, EelCanvasREClass))
#define EEL_IS_CANVAS_RE(obj) (GTK_CHECK_TYPE ((obj), EEL_TYPE_CANVAS_RE))
#define EEL_IS_CANVAS_RE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS_RE))
#define EEL_CANVAS_RE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), EEL_TYPE_CANVAS_RE, EelCanvasREClass))
#define EEL_TYPE_CANVAS_RE eel_canvas_re_get_type()
#define EEL_CANVAS_RE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_CANVAS_RE, EelCanvasRE))
#define EEL_CANVAS_RE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS_RE, EelCanvasREClass))
#define EEL_IS_CANVAS_RE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEL_TYPE_CANVAS_RE))
#define EEL_IS_CANVAS_RE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS_RE))
#define EEL_CANVAS_RE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), EEL_TYPE_CANVAS_RE, EelCanvasREClass))
typedef struct _EelCanvasRE EelCanvasRE;
typedef struct _EelCanvasREClass EelCanvasREClass;
......@@ -113,14 +116,17 @@ GType eel_canvas_re_get_type (void) G_GNUC_CONST;
* EelCanvasRE).
*/
#define EEL_TYPE_CANVAS_RECT (eel_canvas_rect_get_type ())
#define EEL_CANVAS_RECT(obj) (GTK_CHECK_CAST ((obj), EEL_TYPE_CANVAS_RECT, EelCanvasRect))
#define EEL_CANVAS_RECT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS_RECT, EelCanvasRectClass))
#define EEL_IS_CANVAS_RECT(obj) (GTK_CHECK_TYPE ((obj), EEL_TYPE_CANVAS_RECT))
#define EEL_IS_CANVAS_RECT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS_RECT))
#define EEL_CANVAS_RECT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), EEL_TYPE_CANVAS_RECT, EelCanvasRectClass))
#define EEL_TYPE_CANVAS_RECT eel_canvas_rect_get_type()
#define EEL_CANVAS_RECT(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_CANVAS_RECT, EelCanvasRect))
#define EEL_CANVAS_RECT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS_RECT, EelCanvasRectClass))
#define EEL_IS_CANVAS_RECT(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEL_TYPE_CANVAS_RECT))
#define EEL_IS_CANVAS_RECT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS_RECT))
#define EEL_CANVAS_RECT_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), EEL_TYPE_CANVAS_RECT, EelCanvasRectClass))
typedef struct _EelCanvasRect EelCanvasRect;
typedef struct _EelCanvasRectPrivate EelCanvasRectPrivate;
......@@ -144,14 +150,17 @@ GType eel_canvas_rect_get_type (void) G_GNUC_CONST;
* EelCanvasRE).
*/
#define EEL_TYPE_CANVAS_ELLIPSE (eel_canvas_ellipse_get_type ())
#define EEL_CANVAS_ELLIPSE(obj) (GTK_CHECK_CAST ((obj), EEL_TYPE_CANVAS_ELLIPSE, EelCanvasEllipse))
#define EEL_CANVAS_ELLIPSE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS_ELLIPSE, EelCanvasEllipseClass))
#define EEL_IS_CANVAS_ELLIPSE(obj) (GTK_CHECK_TYPE ((obj), EEL_TYPE_CANVAS_ELLIPSE))
#define EEL_IS_CANVAS_ELLIPSE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS_ELLIPSE))
#define EEL_CANVAS_ELLIPSE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), EEL_TYPE_CANVAS_ELLIPSE, EelCanvasEllipseClass))
#define EEL_TYPE_CANVAS_ELLIPSE eel_canvas_ellipse_get_type()
#define EEL_CANVAS_ELLIPSE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_CANVAS_ELLIPSE, EelCanvasEllipse))
#define EEL_CANVAS_ELLIPSE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS_ELLIPSE, EelCanvasEllipseClass))
#define EEL_IS_CANVAS_ELLIPSE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEL_TYPE_CANVAS_ELLIPSE))
#define EEL_IS_CANVAS_ELLIPSE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS_ELLIPSE))
#define EEL_CANVAS_ELLIPSE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), EEL_TYPE_CANVAS_ELLIPSE, EelCanvasEllipseClass))
typedef struct _EelCanvasEllipse EelCanvasEllipse;
typedef struct _EelCanvasEllipseClass EelCanvasEllipseClass;
......
......@@ -1158,7 +1158,6 @@ static void eel_canvas_group_bounds (EelCanvasItem *item, double *x1, dou
static EelCanvasItemClass *group_parent_class;
/**
* eel_canvas_group_get_type:
*
......@@ -1208,7 +1207,7 @@ eel_canvas_group_class_init (EelCanvasGroupClass *class)
object_class = (GtkObjectClass *) class;
item_class = (EelCanvasItemClass *) class;
group_parent_class = gtk_type_class (eel_canvas_item_get_type ());
group_parent_class = g_type_class_peek (EEL_TYPE_CANVAS_ITEM);
gobject_class->set_property = eel_canvas_group_set_property;
gobject_class->get_property = eel_canvas_group_get_property;
......@@ -1630,8 +1629,7 @@ eel_canvas_group_bounds (EelCanvasItem *item, double *x1, double *y1, double *x2
static void
group_add (EelCanvasGroup *group, EelCanvasItem *item)
{
g_object_ref (GTK_OBJECT (item));
gtk_object_sink (GTK_OBJECT (item));
g_object_ref (item);
if (!group->item_list) {
group->item_list = g_list_append (group->item_list, item);
......@@ -2002,7 +2000,7 @@ eel_canvas_class_init (EelCanvasClass *klass)
object_class = (GtkObjectClass *) klass;
widget_class = (GtkWidgetClass *) klass;
canvas_parent_class = gtk_type_class (gtk_layout_get_type ());
canvas_parent_class = g_type_class_peek (GTK_TYPE_LAYOUT);
gobject_class->set_property = eel_canvas_set_property;
gobject_class->get_property = eel_canvas_get_property;
......@@ -2079,11 +2077,10 @@ eel_canvas_init (EelCanvas *canvas)
canvas->root = EEL_CANVAS_ITEM (g_object_new (eel_canvas_group_get_type (), NULL));
canvas->root->canvas = canvas;
g_object_ref (GTK_OBJECT (canvas->root));
gtk_object_sink (GTK_OBJECT (canvas->root));
g_object_ref (canvas->root);
canvas->root_destroy_id = g_signal_connect (GTK_OBJECT (canvas->root), "destroy",
(GtkSignalFunc) panic_root_destroyed,
canvas->root_destroy_id = g_signal_connect (canvas->root, "destroy",
G_CALLBACK (panic_root_destroyed),
canvas);
canvas->need_repick = TRUE;
......@@ -3938,7 +3935,7 @@ eel_canvas_item_class_init (EelCanvasItemClass *class)
gobject_class = (GObjectClass *) class;
item_parent_class = gtk_type_class (gtk_object_get_type ());
item_parent_class = g_type_class_peek (GTK_TYPE_OBJECT);
gobject_class->set_property = eel_canvas_item_set_property;
gobject_class->get_property = eel_canvas_item_get_property;
......
......@@ -101,13 +101,17 @@ enum {
EEL_CANVAS_UPDATE_DEEP = 1 << 1
};
#define EEL_TYPE_CANVAS_ITEM (eel_canvas_item_get_type ())
#define EEL_CANVAS_ITEM(obj) (GTK_CHECK_CAST ((obj), EEL_TYPE_CANVAS_ITEM, EelCanvasItem))
#define EEL_CANVAS_ITEM_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS_ITEM, EelCanvasItemClass))
#define EEL_IS_CANVAS_ITEM(obj) (GTK_CHECK_TYPE ((obj), EEL_TYPE_CANVAS_ITEM))
#define EEL_IS_CANVAS_ITEM_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS_ITEM))
#define EEL_CANVAS_ITEM_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), EEL_TYPE_CANVAS_ITEM, EelCanvasItemClass))
#define EEL_TYPE_CANVAS_ITEM eel_canvas_item_get_type()
#define EEL_CANVAS_ITEM(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_CANVAS_ITEM, EelCanvasItem))
#define EEL_CANVAS_ITEM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS_ITEM, EelCanvasItemClass))
#define EEL_IS_CANVAS_ITEM(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEL_TYPE_CANVAS_ITEM))
#define EEL_IS_CANVAS_ITEM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS_ITEM))
#define EEL_CANVAS_ITEM_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), EEL_TYPE_CANVAS_ITEM, EelCanvasItemClass))
struct _EelCanvasItem {
GtkObject object;
......@@ -304,13 +308,17 @@ void eel_canvas_item_request_redraw (EelCanvasItem *item);
*/
#define EEL_TYPE_CANVAS_GROUP (eel_canvas_group_get_type ())
#define EEL_CANVAS_GROUP(obj) (GTK_CHECK_CAST ((obj), EEL_TYPE_CANVAS_GROUP, EelCanvasGroup))
#define EEL_CANVAS_GROUP_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS_GROUP, EelCanvasGroupClass))
#define EEL_IS_CANVAS_GROUP(obj) (GTK_CHECK_TYPE ((obj), EEL_TYPE_CANVAS_GROUP))
#define EEL_IS_CANVAS_GROUP_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS_GROUP))
#define EEL_CANVAS_GROUP_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), EEL_TYPE_CANVAS_GROUP, EelCanvasGroupClass))
#define EEL_TYPE_CANVAS_GROUP eel_canvas_group_get_type()
#define EEL_CANVAS_GROUP(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_CANVAS_GROUP, EelCanvasGroup))
#define EEL_CANVAS_GROUP_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS_GROUP, EelCanvasGroupClass))
#define EEL_IS_CANVAS_GROUP(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEL_TYPE_CANVAS_GROUP))
#define EEL_IS_CANVAS_GROUP_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS_GROUP))
#define EEL_CANVAS_GROUP_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), EEL_TYPE_CANVAS_GROUP, EelCanvasGroupClass))
struct _EelCanvasGroup {
EelCanvasItem item;
......@@ -333,14 +341,17 @@ GType eel_canvas_group_get_type (void) G_GNUC_CONST;
/*** EelCanvas ***/
#define EEL_TYPE_CANVAS (eel_canvas_get_type ())
#define EEL_CANVAS(obj) (GTK_CHECK_CAST ((obj), EEL_TYPE_CANVAS, EelCanvas))
#define EEL_CANVAS_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS, EelCanvasClass))
#define EEL_IS_CANVAS(obj) (GTK_CHECK_TYPE ((obj), EEL_TYPE_CANVAS))
#define EEL_IS_CANVAS_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS))
#define EEL_CANVAS_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), EEL_TYPE_CANVAS, EelCanvasClass))
#define EEL_TYPE_CANVAS eel_canvas_get_type()
#define EEL_CANVAS(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_CANVAS, EelCanvas))
#define EEL_CANVAS_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS, EelCanvasClass))
#define EEL_IS_CANVAS(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEL_TYPE_CANVAS))
#define EEL_IS_CANVAS_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS))
#define EEL_CANVAS_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), EEL_TYPE_CANVAS, EelCanvasClass))
struct _EelCanvas {
GtkLayout layout;
......
......@@ -48,14 +48,17 @@
* We cant use EelImage for this because part of the reason
* for pixbuf debugging is to debug EelImage itself.
*/
#define DEBUG_TYPE_PIXBUF_VIEWER (debug_pixbuf_viewer_get_type ())
#define DEBUG_PIXBUF_VIEWER(obj) (GTK_CHECK_CAST ((obj), DEBUG_TYPE_PIXBUF_VIEWER, DebugPixbufViewer))
#define DEBUG_IS_PIXBUF_VIEWER(obj) (GTK_CHECK_TYPE ((obj), DEBUG_TYPE_PIXBUF_VIEWER))
#define DEBUG_TYPE_PIXBUF_VIEWER debug_pixbuf_viewer_get_type()
#define DEBUG_PIXBUF_VIEWER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), DEBUG_TYPE_PIXBUF_VIEWER, DebugPixbufViewer))
#define DEBUG_IS_PIXBUF_VIEWER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), DEBUG_TYPE_PIXBUF_VIEWER))
typedef struct DebugPixbufViewer DebugPixbufViewer;
typedef struct DebugPixbufViewerClass DebugPixbufViewerClass;
static GtkType debug_pixbuf_viewer_get_type (void);
static GType debug_pixbuf_viewer_get_type (void);
static void debug_pixbuf_viewer_set_pixbuf (DebugPixbufViewer *viewer,
GdkPixbuf *pixbuf);
......
......@@ -178,46 +178,8 @@ static GdkGC * make_cursor_gc (GtkWidget *widget,
const gchar *property_name,
GdkColor *fallback);
static GtkMiscClass *parent_class = NULL;
GType
eel_editable_label_get_type (void)
{
static GType label_type = 0;
if (!label_type)
{
const GTypeInfo label_info =
{
sizeof (EelEditableLabelClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) eel_editable_label_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (EelEditableLabel),
32, /* n_preallocs */
(GInstanceInitFunc) eel_editable_label_init,
};
const GInterfaceInfo editable_info =
{
(GInterfaceInitFunc) eel_editable_label_editable_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
label_type = g_type_register_static (GTK_TYPE_MISC, "EelEditableLabel", &label_info, 0);
g_type_add_interface_static (label_type,
GTK_TYPE_EDITABLE,
&editable_info);
}
return label_type;
}
G_DEFINE_TYPE_WITH_CODE (EelEditableLabel, eel_editable_label, GTK_TYPE_MISC,
G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, eel_editable_label_editable_init));
static void
add_move_binding (GtkBindingSet *binding_set,
......@@ -250,8 +212,6 @@ eel_editable_label_class_init (EelEditableLabelClass *class)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
GtkBindingSet *binding_set;
parent_class = gtk_type_class (GTK_TYPE_MISC);
gobject_class->set_property = eel_editable_label_set_property;
gobject_class->get_property = eel_editable_label_get_property;
gobject_class->finalize = eel_editable_label_finalize;
......@@ -903,7 +863,7 @@ eel_editable_label_finalize (GObject *object)
label->layout = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
G_OBJECT_CLASS (eel_editable_label_parent_class)->finalize (object);
}
static void
......@@ -1177,7 +1137,7 @@ static void
eel_editable_label_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
(* GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation);
(* GTK_WIDGET_CLASS (eel_editable_label_parent_class)->size_allocate) (widget, allocation);
}
static void
......@@ -1190,8 +1150,8 @@ eel_editable_label_state_changed (GtkWidget *widget,
eel_editable_label_select_region (label, 0, 0);
if (GTK_WIDGET_CLASS (parent_class)->state_changed)
GTK_WIDGET_CLASS (parent_class)->state_changed (widget, prev_state);
if (GTK_WIDGET_CLASS (eel_editable_label_parent_class)->state_changed)
GTK_WIDGET_CLASS (eel_editable_label_parent_class)->state_changed (widget, prev_state);
}
static void
......@@ -1246,7 +1206,7 @@ eel_editable_label_direction_changed (GtkWidget *widget,
if (label->layout)
pango_layout_context_changed (label->layout);
GTK_WIDGET_CLASS (parent_class)->direction_changed (widget, previous_dir);
GTK_WIDGET_CLASS (eel_editable_label_parent_class)->direction_changed (widget, previous_dir);
}
static void
......@@ -1809,19 +1769,19 @@ eel_editable_label_unrealize (GtkWidget *widget)
/* Strange. Copied from GtkEntry, should be NULL? */
gtk_im_context_set_client_window (label->im_context, NULL);
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
(* GTK_WIDGET_CLASS (eel_editable_label_parent_class)->unrealize) (widget);
}
static void
eel_editable_label_map (GtkWidget *widget)
{
(* GTK_WIDGET_CLASS (parent_class)->map) (widget);
(* GTK_WIDGET_CLASS (eel_editable_label_parent_class)->map) (widget);
}
static void
eel_editable_label_unmap (GtkWidget *widget)
{
(* GTK_WIDGET_CLASS (parent_class)->unmap) (widget);
(* GTK_WIDGET_CLASS (eel_editable_label_parent_class)->unmap) (widget);
}
static void
......@@ -2297,7 +2257,7 @@ eel_editable_label_key_press (GtkWidget *widget,
return TRUE;
}
if (GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event))
if (GTK_WIDGET_CLASS (eel_editable_label_parent_class)->key_press_event (widget, event))
/* Activate key bindings
*/
return TRUE;
......@@ -2317,7 +2277,7 @@ eel_editable_label_key_release (GtkWidget *widget,
return TRUE;
}
return GTK_WIDGET_CLASS (parent_class)->key_release_event (widget, event);
return GTK_WIDGET_CLASS (eel_editable_label_parent_class)->key_release_event (widget, event);
}
static void
......@@ -3117,8 +3077,8 @@ append_action_signal (EelEditableLabel *label,
GtkWidget *menuitem = gtk_image_menu_item_new_from_stock (stock_id, NULL);
g_object_set_data (G_OBJECT (menuitem), "gtk-signal", (char *)signal);
g_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (activate_cb), label);
g_signal_connect (menuitem, "activate",
G_CALLBACK (activate_cb), label);
gtk_widget_set_sensitive (menuitem, sensitive);
......@@ -3216,8 +3176,8 @@ popup_targets_received (GtkClipboard *clipboard,
clipboard_contains_text);
menuitem = gtk_menu_item_new_with_label (_("Select All"));
g_signal_connect_object (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (eel_editable_label_select_all), label,
g_signal_connect_object (menuitem, "activate",
G_CALLBACK (eel_editable_label_select_all), label,
G_CONNECT_SWAPPED);
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (label->popup_menu), menuitem);
......
......@@ -34,14 +34,17 @@
extern "C" {
#endif /* __cplusplus */
#define EEL_TYPE_EDITABLE_LABEL (eel_editable_label_get_type ())
#define EEL_EDITABLE_LABEL(obj) (GTK_CHECK_CAST ((obj), EEL_TYPE_EDITABLE_LABEL, EelEditableLabel))
#define EEL_EDITABLE_LABEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EEL_TYPE_EDITABLE_LABEL, EelEditableLabelClass))
#define EEL_IS_EDITABLE_LABEL(obj) (GTK_CHECK_TYPE ((obj), EEL_TYPE_EDITABLE_LABEL))
#define EEL_IS_EDITABLE_LABEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EEL_TYPE_EDITABLE_LABEL))
#define EEL_EDITABLE_LABEL_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), EEL_TYPE_EDITABLE_LABEL, EelEditableLabelClass))
#define EEL_TYPE_EDITABLE_LABEL eel_editable_label_get_type()
#define EEL_EDITABLE_LABEL(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_EDITABLE_LABEL, EelEditableLabel))
#define EEL_EDITABLE_LABEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), EEL_TYPE_EDITABLE_LABEL, EelEditableLabelClass))
#define EEL_IS_EDITABLE_LABEL(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEL_TYPE_EDITABLE_LABEL))
#define EEL_IS_EDITABLE_LABEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), EEL_TYPE_EDITABLE_LABEL))
#define EEL_EDITABLE_LABEL_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), EEL_TYPE_EDITABLE_LABEL, EelEditableLabelClass))
typedef struct _EelEditableLabel EelEditableLabel;
typedef struct _EelEditableLabelClass EelEditableLabelClass;
......
......@@ -394,7 +394,7 @@ eel_pop_up_context_menu (GtkMenu *menu,
button, /* button */
event ? event->time : GDK_CURRENT_TIME); /* activate_time */
gtk_object_sink (GTK_OBJECT (menu));
g_object_ref_sink (menu);
}
GtkMenuItem *
......@@ -539,10 +539,10 @@ alive_disconnecter (GtkObject *object, DisconnectInfo *info)
void
eel_gtk_signal_connect_full_while_alive (GtkObject *object,
const gchar *name,
GtkSignalFunc func,
GCallback func,
GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy_func,
GDestroyNotify destroy_func,
gboolean object_signal,
gboolean after,
GtkObject *alive_object)
......@@ -628,7 +628,7 @@ while_realized_disconnecter (GtkObject *object,
void
eel_gtk_signal_connect_while_realized (GtkObject *object,
const char *name,
GtkSignalFunc callback,
GCallback callback,
gpointer callback_data,
GtkWidget *realized_widget)
{
......@@ -1012,7 +1012,7 @@ eel_gtk_get_system_font (void)
font = pango_font_description_copy (label->style->font_desc);
gtk_object_sink (GTK_OBJECT (label));
g_object_ref_sink (label);
return font;
}
......@@ -1046,20 +1046,6 @@ eel_gtk_widget_get_motion_event_location (GtkWidget *widget,
eel_gtk_widget_get_button_event_location (widget, (const GdkEventButton *) event, x, y);
}
gboolean
eel_gtk_tree_view_cell_is_completely_visible (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column)
{
GdkRectangle cell_rect, visible_rect;
gtk_tree_view_get_background_area (tree_view, path, column, &cell_rect);
gtk_tree_view_widget_to_tree_coords (tree_view, cell_rect.x, cell_rect.y,
&cell_rect.x, &cell_rect.y);
gtk_tree_view_get_visible_rect (tree_view, &visible_rect);
return eel_gdk_rectangle_contains_rectangle (visible_rect, cell_rect);
}
static gboolean
tree_view_button_press_callback (GtkWidget *tree_view,
GdkEventButton *event,
......
......@@ -38,16 +38,16 @@
/* signals */
void eel_gtk_signal_connect_full_while_alive (GtkObject *object,
const gchar *name,
GtkSignalFunc func,
GCallback func,
GtkCallbackMarshal marshal,
gpointer data,
GtkDestroyNotify destroy_func,
GDestroyNotify destroy_func,
gboolean object_signal,
gboolean after,
GtkObject *alive_object);
void eel_gtk_signal_connect_while_realized (GtkObject *object,
const char *name,
GtkSignalFunc callback,
GCallback callback,
gpointer callback_data,
GtkWidget *realized_widget);
......@@ -128,9 +128,6 @@ void eel_gtk_adjustment_set_value (GtkAdjust
void eel_gtk_adjustment_clamp_value (GtkAdjustment *adjustment);
/* GtkTreeView */
gboolean eel_gtk_tree_view_cell_is_completely_visible (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column);
void eel_gtk_tree_view_set_activate_on_single_click (GtkTreeView *tree_view,
gboolean should_activate);
......
......@@ -49,11 +49,11 @@
\
static gpointer parent_class; \
\
GtkType \
GType \
prefix##_get_type (void) \
{ \
GtkType parent_type; \
static GtkType type; \
GType parent_type; \
static GType type; \
\
if (type == 0) { \
static GTypeInfo info = { \
......
......@@ -76,7 +76,7 @@ static void eel_image_table_unrealize (GtkWidget *widget)
/* GtkContainerClass methods */
static void eel_image_table_remove (GtkContainer *container,
GtkWidget *widget);
static GtkType eel_image_table_child_type (GtkContainer *container);
static GType eel_image_table_child_type (GtkContainer *container);
/* Private EelImageTable methods */
static void image_table_emit_signal (EelImageTable *image_table,
......@@ -292,7 +292,7 @@ eel_image_table_remove (GtkContainer *container,
EEL_CALL_PARENT (GTK_CONTAINER_CLASS, remove, (container, child));
}
static GtkType
static GType
eel_image_table_child_type (GtkContainer *container)
{
return EEL_TYPE_LABELED_IMAGE;
......
......@@ -29,11 +29,17 @@
G_BEGIN_DECLS
#define EEL_TYPE_IMAGE_TABLE (eel_image_table_get_type ())
#define EEL_IMAGE_TABLE(obj) (GTK_CHECK_CAST ((obj), EEL_TYPE_IMAGE_TABLE, EelImageTable))
#define EEL_IMAGE_TABLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EEL_TYPE_IMAGE_TABLE, EelImageTableClass))
#define EEL_IS_IMAGE_TABLE(obj) (GTK_CHECK_TYPE ((obj), EEL_TYPE_IMAGE_TABLE))
#define EEL_IS_IMAGE_TABLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EEL_TYPE_IMAGE_TABLE))
#define EEL_TYPE_IMAGE_TABLE eel_image_table_get_type()
#define EEL_IMAGE_TABLE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_IMAGE_TABLE, EelImageTable))
#define EEL_IMAGE_TABLE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), EEL_TYPE_IMAGE_TABLE, EelImageTableClass))
#define EEL_IS_IMAGE_TABLE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEL_TYPE_IMAGE_TABLE))
#define EEL_IS_IMAGE_TABLE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), EEL_TYPE_IMAGE_TABLE))
#define EEL_IMAGE_TABLE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), EEL_TYPE_IMAGE_TABLE, EelImageTableClass))
typedef struct EelImageTable EelImageTable;
typedef struct EelImageTableClass EelImageTableClass;
......@@ -80,7 +86,7 @@ struct EelImageTableClass
};
/* Public GtkImageTable methods */
GtkType eel_image_table_get_type (void);
GType eel_image_table_get_type (void);
GtkWidget *eel_image_table_new (gboolean homogeneous);
GtkWidget *eel_image_table_add_empty_image (EelImageTable *image_table);
......
......@@ -52,11 +52,17 @@
G_BEGIN_DECLS
#define EEL_TYPE_LABELED_IMAGE (eel_labeled_image_get_type ())
#define EEL_LABELED_IMAGE(obj) (GTK_CHECK_CAST ((obj), EEL_TYPE_LABELED_IMAGE, EelLabeledImage))
#define EEL_LABELED_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EEL_TYPE_LABELED_IMAGE, EelLabeledImageClass))
#define EEL_IS_LABELED_IMAGE(obj) (GTK_CHECK_TYPE ((obj), EEL_TYPE_LABELED_IMAGE))
#define EEL_IS_LABELED_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EEL_TYPE_LABELED_IMAGE))
#define EEL_TYPE_LABELED_IMAGE eel_labeled_image_get_type()
#define EEL_LABELED_IMAGE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_LABELED_IMAGE, EelLabeledImage))