summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2008-02-24 00:55:22 +0000
committerjoncruz <joncruz@users.sourceforge.net>2008-02-24 00:55:22 +0000
commit646ae07a0fcbbea4a0105c02102cdbbe3784ce1c (patch)
tree30de664be9cc9249204cee4b0b6fa64eebc6382f /src/widgets
parentM build.xml (diff)
downloadinkscape-646ae07a0fcbbea4a0105c02102cdbbe3784ce1c.tar.gz
inkscape-646ae07a0fcbbea4a0105c02102cdbbe3784ce1c.zip
Warning and whitespace cleanup
(bzr r4838)
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/sp-widget.cpp18
-rw-r--r--src/widgets/sp-xmlview-content.cpp160
2 files changed, 94 insertions, 84 deletions
diff --git a/src/widgets/sp-widget.cpp b/src/widgets/sp-widget.cpp
index cf40b2c73..40f1514cd 100644
--- a/src/widgets/sp-widget.cpp
+++ b/src/widgets/sp-widget.cpp
@@ -124,7 +124,7 @@ sp_widget_destroy (GtkObject *object)
if (spw->inkscape) {
/* Disconnect signals */
- // the checks are necessary because when destroy is caused by the the program shutting down,
+ // the checks are necessary because when destroy is caused by the the program shutting down,
// the inkscape object may already be (partly?) invalid --bb
if (G_IS_OBJECT(spw->inkscape) && G_OBJECT_GET_CLASS(G_OBJECT(spw->inkscape)))
sp_signal_disconnect_by_data (spw->inkscape, spw);
@@ -241,22 +241,32 @@ sp_widget_construct_global (SPWidget *spw, Inkscape::Application *inkscape)
}
static void
-sp_widget_modify_selection (Inkscape::Application *inkscape, Inkscape::Selection *selection, guint flags, SPWidget *spw)
+sp_widget_modify_selection (Inkscape::Application */*inkscape*/, Inkscape::Selection *selection, guint flags, SPWidget *spw)
{
g_signal_emit (G_OBJECT (spw), signals[MODIFY_SELECTION], 0, selection, flags);
}
static void
-sp_widget_change_selection (Inkscape::Application *inkscape, Inkscape::Selection *selection, SPWidget *spw)
+sp_widget_change_selection (Inkscape::Application */*inkscape*/, Inkscape::Selection *selection, SPWidget *spw)
{
g_signal_emit (G_OBJECT (spw), signals[CHANGE_SELECTION], 0, selection);
}
static void
-sp_widget_set_selection (Inkscape::Application *inkscape, Inkscape::Selection *selection, SPWidget *spw)
+sp_widget_set_selection (Inkscape::Application */*inkscape*/, Inkscape::Selection *selection, SPWidget *spw)
{
/* Emit "set_selection" signal */
g_signal_emit (G_OBJECT (spw), signals[SET_SELECTION], 0, selection);
/* Inkscape will force "change_selection" anyways */
}
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
diff --git a/src/widgets/sp-xmlview-content.cpp b/src/widgets/sp-xmlview-content.cpp
index 6f0b0dff1..393c136c7 100644
--- a/src/widgets/sp-xmlview-content.cpp
+++ b/src/widgets/sp-xmlview-content.cpp
@@ -31,138 +31,138 @@ static void event_content_changed (Inkscape::XML::Node * repr, const gchar * old
static GtkTextViewClass * parent_class = NULL;
static Inkscape::XML::NodeEventVector repr_events = {
- NULL, /* child_added */
- NULL, /* child_removed */
- NULL, /* attr_changed */
- event_content_changed,
- NULL /* order_changed */
+ NULL, /* child_added */
+ NULL, /* child_removed */
+ NULL, /* attr_changed */
+ event_content_changed,
+ NULL /* order_changed */
};
GtkWidget *
sp_xmlview_content_new (Inkscape::XML::Node * repr)
{
- GtkTextBuffer *tb;
- SPXMLViewContent *text;
+ GtkTextBuffer *tb;
+ SPXMLViewContent *text;
- tb = gtk_text_buffer_new (NULL);
- text = (SPXMLViewContent*)gtk_type_new (SP_TYPE_XMLVIEW_CONTENT);
- gtk_text_view_set_buffer (GTK_TEXT_VIEW (text), tb);
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text), GTK_WRAP_CHAR);
+ tb = gtk_text_buffer_new (NULL);
+ text = (SPXMLViewContent*)gtk_type_new (SP_TYPE_XMLVIEW_CONTENT);
+ gtk_text_view_set_buffer (GTK_TEXT_VIEW (text), tb);
+ gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text), GTK_WRAP_CHAR);
- g_signal_connect (G_OBJECT (tb), "changed", G_CALLBACK (sp_xmlview_content_changed), text);
+ g_signal_connect (G_OBJECT (tb), "changed", G_CALLBACK (sp_xmlview_content_changed), text);
- /* should we alter the scrolling adjustments here? */
+ /* should we alter the scrolling adjustments here? */
- sp_xmlview_content_set_repr (text, repr);
+ sp_xmlview_content_set_repr (text, repr);
- return (GtkWidget *) text;
+ return (GtkWidget *) text;
}
void
sp_xmlview_content_set_repr (SPXMLViewContent * text, Inkscape::XML::Node * repr)
{
- if ( repr == text->repr ) return;
- if (text->repr) {
- sp_repr_remove_listener_by_data (text->repr, text);
- Inkscape::GC::release(text->repr);
- }
- text->repr = repr;
- if (repr) {
- Inkscape::GC::anchor(repr);
- sp_repr_add_listener (repr, &repr_events, text);
- sp_repr_synthesize_events (repr, &repr_events, text);
- } else {
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)), "", 0);
- gtk_text_view_set_editable (GTK_TEXT_VIEW (text), FALSE);
- }
+ if ( repr == text->repr ) return;
+ if (text->repr) {
+ sp_repr_remove_listener_by_data (text->repr, text);
+ Inkscape::GC::release(text->repr);
+ }
+ text->repr = repr;
+ if (repr) {
+ Inkscape::GC::anchor(repr);
+ sp_repr_add_listener (repr, &repr_events, text);
+ sp_repr_synthesize_events (repr, &repr_events, text);
+ } else {
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)), "", 0);
+ gtk_text_view_set_editable (GTK_TEXT_VIEW (text), FALSE);
+ }
}
GtkType
sp_xmlview_content_get_type (void)
{
- static GtkType type = 0;
-
- if (!type) {
- static const GtkTypeInfo info = {
- "SPXMLViewContent",
- sizeof (SPXMLViewContent),
- sizeof (SPXMLViewContentClass),
- (GtkClassInitFunc) sp_xmlview_content_class_init,
- (GtkObjectInitFunc) sp_xmlview_content_init,
- NULL, NULL, NULL
- };
- type = gtk_type_unique (GTK_TYPE_TEXT_VIEW, &info);
- }
-
- return type;
+ static GtkType type = 0;
+
+ if (!type) {
+ static const GtkTypeInfo info = {
+ "SPXMLViewContent",
+ sizeof (SPXMLViewContent),
+ sizeof (SPXMLViewContentClass),
+ (GtkClassInitFunc) sp_xmlview_content_class_init,
+ (GtkObjectInitFunc) sp_xmlview_content_init,
+ NULL, NULL, NULL
+ };
+ type = gtk_type_unique (GTK_TYPE_TEXT_VIEW, &info);
+ }
+
+ return type;
}
void
sp_xmlview_content_class_init (SPXMLViewContentClass * klass)
{
- GtkObjectClass * object_class;
+ GtkObjectClass * object_class;
- object_class = (GtkObjectClass *) klass;
+ object_class = (GtkObjectClass *) klass;
- parent_class = (GtkTextViewClass*)gtk_type_class (GTK_TYPE_TEXT_VIEW);
+ parent_class = (GtkTextViewClass*)gtk_type_class (GTK_TYPE_TEXT_VIEW);
- object_class->destroy = sp_xmlview_content_destroy;
+ object_class->destroy = sp_xmlview_content_destroy;
}
void
sp_xmlview_content_init (SPXMLViewContent *text)
{
- text->repr = NULL;
- text->blocked = FALSE;
+ text->repr = NULL;
+ text->blocked = FALSE;
}
void
sp_xmlview_content_destroy (GtkObject * object)
{
- SPXMLViewContent * text;
+ SPXMLViewContent * text;
- text = SP_XMLVIEW_CONTENT (object);
+ text = SP_XMLVIEW_CONTENT (object);
- sp_xmlview_content_set_repr (text, NULL);
+ sp_xmlview_content_set_repr (text, NULL);
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
+ GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
void
-event_content_changed (Inkscape::XML::Node * repr, const gchar * old_content, const gchar * new_content, gpointer data)
+event_content_changed (Inkscape::XML::Node * /*repr*/, const gchar * /*old_content*/, const gchar * new_content, gpointer data)
{
- SPXMLViewContent * text;
- text = SP_XMLVIEW_CONTENT (data);
+ SPXMLViewContent * text;
+ text = SP_XMLVIEW_CONTENT (data);
- if (text->blocked) return;
+ if (text->blocked) return;
- text->blocked = TRUE;
+ text->blocked = TRUE;
- if (new_content) {
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)), new_content, strlen (new_content));
- } else {
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)), "", 0);
- }
- gtk_text_view_set_editable (GTK_TEXT_VIEW (text), new_content != NULL);
+ if (new_content) {
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)), new_content, strlen (new_content));
+ } else {
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)), "", 0);
+ }
+ gtk_text_view_set_editable (GTK_TEXT_VIEW (text), new_content != NULL);
- text->blocked = FALSE;
+ text->blocked = FALSE;
}
void
sp_xmlview_content_changed (GtkTextBuffer *tb, SPXMLViewContent *text)
{
- if (text->blocked) return;
-
- if (text->repr) {
- GtkTextIter start, end;
- gchar *data;
- text->blocked = TRUE;
- gtk_text_buffer_get_bounds (tb, &start, &end);
- data = gtk_text_buffer_get_text (tb, &start, &end, TRUE);
- text->repr->setContent(data);
- g_free (data);
- text->blocked = FALSE;
- sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_XML_EDITOR,
- _("Type text in a text node"));
- }
+ if (text->blocked) return;
+
+ if (text->repr) {
+ GtkTextIter start, end;
+ gchar *data;
+ text->blocked = TRUE;
+ gtk_text_buffer_get_bounds (tb, &start, &end);
+ data = gtk_text_buffer_get_text (tb, &start, &end, TRUE);
+ text->repr->setContent(data);
+ g_free (data);
+ text->blocked = FALSE;
+ sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_XML_EDITOR,
+ _("Type text in a text node"));
+ }
}