summaryrefslogtreecommitdiffstats
path: root/src/widgets/sp-xmlview-content.cpp
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2014-03-27 01:33:44 +0000
committerMartin Owens <doctormo@gmail.com>2014-03-27 01:33:44 +0000
commit5a4fb2325f60d292b47330f540b26a3279341c90 (patch)
treed2aa7967be25450b83e625025366c618101ae49f /src/widgets/sp-xmlview-content.cpp
parentThe Polar Arrange Tab of the Arrange Dialog now hides the parametric (diff)
parentRemove Snap menu item and improve grid menu item text (diff)
downloadinkscape-5a4fb2325f60d292b47330f540b26a3279341c90.tar.gz
inkscape-5a4fb2325f60d292b47330f540b26a3279341c90.zip
Commit a merge to trunk, with probabal errors
(bzr r11073.1.36)
Diffstat (limited to 'src/widgets/sp-xmlview-content.cpp')
-rw-r--r--src/widgets/sp-xmlview-content.cpp51
1 files changed, 29 insertions, 22 deletions
diff --git a/src/widgets/sp-xmlview-content.cpp b/src/widgets/sp-xmlview-content.cpp
index d30f0bbe6..ac64dabdb 100644
--- a/src/widgets/sp-xmlview-content.cpp
+++ b/src/widgets/sp-xmlview-content.cpp
@@ -25,7 +25,12 @@ using Inkscape::DocumentUndo;
static void sp_xmlview_content_class_init (SPXMLViewContentClass * klass);
static void sp_xmlview_content_init (SPXMLViewContent * text);
-static void sp_xmlview_content_destroy (GtkObject * object);
+
+#if GTK_CHECK_VERSION(3,0,0)
+static void sp_xmlview_content_destroy(GtkWidget * object);
+#else
+static void sp_xmlview_content_destroy(GtkObject * object);
+#endif
void sp_xmlview_content_changed (GtkTextBuffer *tb, SPXMLViewContent *text);
@@ -41,14 +46,10 @@ static Inkscape::XML::NodeEventVector repr_events = {
NULL /* order_changed */
};
-GtkWidget *
-sp_xmlview_content_new (Inkscape::XML::Node * repr)
+GtkWidget *sp_xmlview_content_new(Inkscape::XML::Node * repr)
{
- GtkTextBuffer *tb;
- SPXMLViewContent *text;
-
- tb = gtk_text_buffer_new (NULL);
- text = (SPXMLViewContent*)g_object_new (SP_TYPE_XMLVIEW_CONTENT, NULL);
+ GtkTextBuffer *tb = gtk_text_buffer_new(NULL);
+ SPXMLViewContent *text = SP_XMLVIEW_CONTENT(g_object_new(SP_TYPE_XMLVIEW_CONTENT, NULL));
gtk_text_view_set_buffer (GTK_TEXT_VIEW (text), tb);
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text), GTK_WRAP_CHAR);
@@ -58,7 +59,7 @@ sp_xmlview_content_new (Inkscape::XML::Node * repr)
sp_xmlview_content_set_repr (text, repr);
- return (GtkWidget *) text;
+ return GTK_WIDGET(text);
}
void
@@ -103,16 +104,17 @@ GType sp_xmlview_content_get_type(void)
return type;
}
-void
-sp_xmlview_content_class_init (SPXMLViewContentClass * klass)
+void sp_xmlview_content_class_init(SPXMLViewContentClass * klass)
{
- GtkObjectClass * object_class;
-
- object_class = (GtkObjectClass *) klass;
-
- parent_class = (GtkTextViewClass*)g_type_class_peek_parent (klass);
-
+#if GTK_CHECK_VERSION(3,0,0)
+ GtkWidgetClass * widget_class = GTK_WIDGET_CLASS(klass);
+ widget_class->destroy = sp_xmlview_content_destroy;
+#else
+ GtkObjectClass * object_class = GTK_OBJECT_CLASS(klass);
object_class->destroy = sp_xmlview_content_destroy;
+#endif
+
+ parent_class = GTK_TEXT_VIEW_CLASS(g_type_class_peek_parent (klass));
}
void
@@ -122,16 +124,21 @@ sp_xmlview_content_init (SPXMLViewContent *text)
text->blocked = FALSE;
}
-void
-sp_xmlview_content_destroy (GtkObject * object)
+#if GTK_CHECK_VERSION(3,0,0)
+void sp_xmlview_content_destroy(GtkWidget * object)
+#else
+void sp_xmlview_content_destroy(GtkObject * object)
+#endif
{
- SPXMLViewContent * text;
-
- text = SP_XMLVIEW_CONTENT (object);
+ SPXMLViewContent * text = SP_XMLVIEW_CONTENT (object);
sp_xmlview_content_set_repr (text, NULL);
+#if GTK_CHECK_VERSION(3,0,0)
+ GTK_WIDGET_CLASS (parent_class)->destroy (object);
+#else
GTK_OBJECT_CLASS (parent_class)->destroy (object);
+#endif
}
void