iconhelper: Turn into gadget

This is just the basic conversion to inheriting from
GTK_TYPE_CSS_GADGET.
This commit is contained in:
Benjamin Otte 2015-12-09 14:01:46 +01:00 committed by Matthias Clasen
parent c0fd106019
commit 25ecd8cd37
2 changed files with 10 additions and 9 deletions

View File

@ -47,7 +47,7 @@ struct _GtkIconHelperPrivate {
gint last_surface_scale;
};
G_DEFINE_TYPE_WITH_PRIVATE (GtkIconHelper, _gtk_icon_helper, G_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (GtkIconHelper, gtk_icon_helper, GTK_TYPE_CSS_GADGET)
static void
gtk_icon_helper_take_definition (GtkIconHelper *self,
@ -94,11 +94,11 @@ gtk_icon_helper_finalize (GObject *object)
_gtk_icon_helper_clear (self);
gtk_image_definition_unref (self->priv->def);
G_OBJECT_CLASS (_gtk_icon_helper_parent_class)->finalize (object);
G_OBJECT_CLASS (gtk_icon_helper_parent_class)->finalize (object);
}
static void
_gtk_icon_helper_class_init (GtkIconHelperClass *klass)
gtk_icon_helper_class_init (GtkIconHelperClass *klass)
{
GObjectClass *oclass;
@ -107,9 +107,9 @@ _gtk_icon_helper_class_init (GtkIconHelperClass *klass)
}
static void
_gtk_icon_helper_init (GtkIconHelper *self)
gtk_icon_helper_init (GtkIconHelper *self)
{
self->priv = _gtk_icon_helper_get_instance_private (self);
self->priv = gtk_icon_helper_get_instance_private (self);
self->priv->def = gtk_image_definition_new_empty ();

View File

@ -23,11 +23,12 @@
#include "gtk/gtkimage.h"
#include "gtk/gtktypes.h"
#include "gtkcssgadgetprivate.h"
#include "gtkimagedefinitionprivate.h"
G_BEGIN_DECLS
#define GTK_TYPE_ICON_HELPER _gtk_icon_helper_get_type()
#define GTK_TYPE_ICON_HELPER gtk_icon_helper_get_type()
#define GTK_ICON_HELPER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
@ -55,17 +56,17 @@ typedef struct _GtkIconHelperPrivate GtkIconHelperPrivate;
struct _GtkIconHelper
{
GObject parent;
GtkCssGadget parent;
GtkIconHelperPrivate *priv;
};
struct _GtkIconHelperClass
{
GObjectClass parent_class;
GtkCssGadgetClass parent_class;
};
GType _gtk_icon_helper_get_type (void) G_GNUC_CONST;
GType gtk_icon_helper_get_type (void) G_GNUC_CONST;
GtkIconHelper *_gtk_icon_helper_new (GtkWidget *owner);