diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2012-12-25 22:50:08 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@googlemail.com> | 2012-12-25 22:50:08 +0000 |
| commit | 8ee9827502fadcae0b02fec434799e94ee115357 (patch) | |
| tree | a2cac37646ad35f34b9eef93d3247e5468b66032 /src/widgets/icon.cpp | |
| parent | Stop using UNUSED_PIXELS hack in ruler. This was only required because of th... (diff) | |
| download | inkscape-8ee9827502fadcae0b02fec434799e94ee115357.tar.gz inkscape-8ee9827502fadcae0b02fec434799e94ee115357.zip | |
Convert a load more C-style pointer casts to GObject or C++ casts (merry christmas\!)
(bzr r11986)
Diffstat (limited to 'src/widgets/icon.cpp')
| -rw-r--r-- | src/widgets/icon.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index d3b7e2dbb..ff443504d 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -164,13 +164,10 @@ GType SPIcon::getType() void IconImpl::classInit(SPIconClass *klass) { - GObjectClass *object_class; - GtkWidgetClass *widget_class; + GObjectClass *object_class = G_OBJECT_CLASS(klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); - object_class = (GObjectClass *) klass; - widget_class = (GtkWidgetClass *) klass; - - parent_class = (GtkWidgetClass*)g_type_class_peek_parent(klass); + parent_class = GTK_WIDGET_CLASS(g_type_class_peek_parent(klass)); object_class->dispose = IconImpl::dispose; @@ -205,7 +202,7 @@ void IconImpl::dispose(GObject *object) icon->name = 0; } - ((GObjectClass *) (parent_class))->dispose(object); + (G_OBJECT_CLASS(parent_class))->dispose(object); } void IconImpl::reset( SPIcon *icon ) @@ -865,7 +862,7 @@ GtkWidget *IconImpl::newFull( Inkscape::IconSize lsize, gchar const *name ) if ( dump ) { g_message( "skipped gtk '%s' %d (not GTK_IMAGE_STOCK)", name, lsize ); } - //g_object_unref( (GObject *)img ); + //g_object_unref(G_OBJECT(img)); img = 0; } } @@ -1022,7 +1019,7 @@ int IconImpl::getPhysSize(int size) "inkscape-decoration" }; - GtkWidget *icon = (GtkWidget *)g_object_new(SP_TYPE_ICON, NULL); + GtkWidget *icon = GTK_WIDGET(g_object_new(SP_TYPE_ICON, NULL)); for (unsigned i = 0; i < G_N_ELEMENTS(gtkSizes); ++i) { guint const val_ix = (gtkSizes[i] <= GTK_ICON_SIZE_DIALOG) ? (guint)gtkSizes[i] : (guint)Inkscape::ICON_SIZE_DECORATION; @@ -1075,7 +1072,7 @@ int IconImpl::getPhysSize(int size) GdkPixbuf *IconImpl::loadPixmap(gchar const *name, unsigned /*lsize*/, unsigned psize) { - gchar *path = (gchar *) g_strdup_printf("%s/%s.png", INKSCAPE_PIXMAPDIR, name); + gchar *path = g_strdup_printf("%s/%s.png", INKSCAPE_PIXMAPDIR, name); // TODO: bulia, please look over gsize bytesRead = 0; gsize bytesWritten = 0; @@ -1089,7 +1086,7 @@ GdkPixbuf *IconImpl::loadPixmap(gchar const *name, unsigned /*lsize*/, unsigned g_free(localFilename); g_free(path); if (!pb) { - path = (gchar *) g_strdup_printf("%s/%s.xpm", INKSCAPE_PIXMAPDIR, name); + path = g_strdup_printf("%s/%s.xpm", INKSCAPE_PIXMAPDIR, name); // TODO: bulia, please look over gsize bytesRead = 0; gsize bytesWritten = 0; |
