~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/widgets/sp-xmlview-content.cpp

  • Committer: JazzyNico
  • Date: 2011-08-29 20:25:30 UTC
  • Revision ID: nicoduf@yahoo.fr-20110829202530-6deuoz11q90usldv
Code refactoring and merging with trunk (revision 10599).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#define __SP_XMLVIEW_CONTENT_C__
2
 
 
3
1
/*
4
2
 * Specialization of GtkTextView for the XML tree view
5
3
 *
7
5
 *   MenTaLguY <mental@rydia.net>
8
6
 *
9
7
 * Copyright (C) 2002 MenTaLguY
 
8
 *   Abhishek Sharma
10
9
 *
11
10
 * Released under the GNU GPL; see COPYING for details
12
11
 */
20
19
#include "document-private.h"
21
20
#include "inkscape.h"
22
21
 
 
22
using Inkscape::DocumentUndo;
 
23
 
23
24
static void sp_xmlview_content_class_init (SPXMLViewContentClass * klass);
24
25
static void sp_xmlview_content_init (SPXMLViewContent * text);
25
26
static void sp_xmlview_content_destroy (GtkObject * object);
45
46
    SPXMLViewContent *text;
46
47
 
47
48
    tb = gtk_text_buffer_new (NULL);
48
 
    text = (SPXMLViewContent*)gtk_type_new (SP_TYPE_XMLVIEW_CONTENT);
 
49
    text = (SPXMLViewContent*)g_object_new (SP_TYPE_XMLVIEW_CONTENT, NULL);
49
50
    gtk_text_view_set_buffer (GTK_TEXT_VIEW (text), tb);
50
51
    gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text), GTK_WRAP_CHAR);
51
52
 
79
80
 
80
81
GType sp_xmlview_content_get_type(void)
81
82
{
82
 
    static GtkType type = 0;
 
83
    static GType type = 0;
83
84
 
84
85
    if (!type) {
85
86
        GTypeInfo info = {
107
108
 
108
109
    object_class = (GtkObjectClass *) klass;
109
110
 
110
 
    parent_class = (GtkTextViewClass*)gtk_type_class (GTK_TYPE_TEXT_VIEW);
 
111
    parent_class = (GtkTextViewClass*)g_type_class_peek_parent (klass);
111
112
 
112
113
    object_class->destroy = sp_xmlview_content_destroy;
113
114
}
165
166
        text->repr->setContent(data);
166
167
        g_free (data);
167
168
        text->blocked = FALSE;
168
 
        sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_XML_EDITOR,
169
 
                          _("Type text in a text node"));
 
169
        DocumentUndo::done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_XML_EDITOR,
 
170
                           _("Type text in a text node"));
170
171
    }
171
172
}