summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-08-18 20:19:55 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-08-18 20:19:55 +0000
commitdce3466274e04364e25c47b0b71007a65c9cf9dd (patch)
tree37d21bcfbc010d83221de713fb83d6e15e1546cf /src/widgets
parentFix accidental regression in previous commit (diff)
downloadinkscape-dce3466274e04364e25c47b0b71007a65c9cf9dd.tar.gz
inkscape-dce3466274e04364e25c47b0b71007a65c9cf9dd.zip
Code cleanup.
(bzr r13341.1.145)
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/button.cpp377
-rw-r--r--src/widgets/button.h19
-rw-r--r--src/widgets/font-selector.cpp6
-rw-r--r--src/widgets/font-selector.h4
-rw-r--r--src/widgets/gradient-image.cpp22
-rw-r--r--src/widgets/gradient-image.h27
-rw-r--r--src/widgets/sp-xmlview-tree.cpp8
-rw-r--r--src/widgets/sp-xmlview-tree.h17
8 files changed, 236 insertions, 244 deletions
diff --git a/src/widgets/button.cpp b/src/widgets/button.cpp
index a1bd9b792..04426e734 100644
--- a/src/widgets/button.cpp
+++ b/src/widgets/button.cpp
@@ -1,6 +1,4 @@
-#define __SP_BUTTON_C__
-
-/*
+/**
* Generic button widget
*
* Authors:
@@ -13,282 +11,255 @@
* This code is in public domain
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "button.h"
+#include "helper/action-context.h"
#include "icon.h"
-#include "shortcuts.h"
#include "interface.h"
-#include "helper/action-context.h"
+#include "shortcuts.h"
#include <gdk/gdkkeysyms.h>
-#include "button.h"
-
static void sp_button_dispose(GObject *object);
-#if GTK_CHECK_VERSION(3,0,0)
-static void sp_button_get_preferred_width(GtkWidget *widget,
- gint *minimal_width,
- gint *natural_width);
+#if GTK_CHECK_VERSION(3, 0, 0)
+static void sp_button_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width);
-static void sp_button_get_preferred_height(GtkWidget *widget,
- gint *minimal_height,
- gint *natural_height);
+static void sp_button_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height);
#else
-static void sp_button_size_request (GtkWidget *widget, GtkRequisition *requisition);
+static void sp_button_size_request(GtkWidget *widget, GtkRequisition *requisition);
#endif
-static void sp_button_clicked (GtkButton *button);
-static void sp_button_perform_action (SPButton *button, gpointer data);
-static gint sp_button_process_event (SPButton *button, GdkEvent *event);
+static void sp_button_clicked(GtkButton *button);
+static void sp_button_perform_action(SPButton *button, gpointer data);
+static gint sp_button_process_event(SPButton *button, GdkEvent *event);
-static void sp_button_set_action (SPButton *button, SPAction *action);
-static void sp_button_set_doubleclick_action (SPButton *button, SPAction *action);
-static void sp_button_action_set_active (SPButton *button, bool active);
-static void sp_button_set_composed_tooltip (GtkWidget *widget, SPAction *action);
+static void sp_button_set_action(SPButton *button, SPAction *action);
+static void sp_button_set_doubleclick_action(SPButton *button, SPAction *action);
+static void sp_button_action_set_active(SPButton *button, bool active);
+static void sp_button_set_composed_tooltip(GtkWidget *widget, SPAction *action);
G_DEFINE_TYPE(SPButton, sp_button, GTK_TYPE_TOGGLE_BUTTON);
-static void
-sp_button_class_init (SPButtonClass *klass)
+static void sp_button_class_init(SPButtonClass *klass)
{
- GObjectClass *object_class=G_OBJECT_CLASS(klass);
- GtkWidgetClass *widget_class=GTK_WIDGET_CLASS(klass);
- GtkButtonClass *button_class=GTK_BUTTON_CLASS(klass);
-
- object_class->dispose = sp_button_dispose;
-#if GTK_CHECK_VERSION(3,0,0)
- widget_class->get_preferred_width = sp_button_get_preferred_width;
- widget_class->get_preferred_height = sp_button_get_preferred_height;
+ GObjectClass *object_class = G_OBJECT_CLASS(klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+ GtkButtonClass *button_class = GTK_BUTTON_CLASS(klass);
+
+ object_class->dispose = sp_button_dispose;
+#if GTK_CHECK_VERSION(3, 0, 0)
+ widget_class->get_preferred_width = sp_button_get_preferred_width;
+ widget_class->get_preferred_height = sp_button_get_preferred_height;
#else
- widget_class->size_request = sp_button_size_request;
+ widget_class->size_request = sp_button_size_request;
#endif
- button_class->clicked = sp_button_clicked;
+ button_class->clicked = sp_button_clicked;
}
-static void
-sp_button_init (SPButton *button)
+static void sp_button_init(SPButton *button)
{
- button->action = NULL;
- button->doubleclick_action = NULL;
- new (&button->c_set_active) sigc::connection();
- new (&button->c_set_sensitive) sigc::connection();
+ button->action = NULL;
+ button->doubleclick_action = NULL;
+ new (&button->c_set_active) sigc::connection();
+ new (&button->c_set_sensitive) sigc::connection();
- gtk_container_set_border_width (GTK_CONTAINER (button), 0);
+ gtk_container_set_border_width(GTK_CONTAINER(button), 0);
- gtk_widget_set_can_focus (GTK_WIDGET (button), FALSE);
- gtk_widget_set_can_default (GTK_WIDGET (button), FALSE);
+ gtk_widget_set_can_focus(GTK_WIDGET(button), FALSE);
+ gtk_widget_set_can_default(GTK_WIDGET(button), FALSE);
- g_signal_connect_after (G_OBJECT (button), "clicked", G_CALLBACK (sp_button_perform_action), NULL);
- g_signal_connect_after (G_OBJECT (button), "event", G_CALLBACK (sp_button_process_event), NULL);
+ g_signal_connect_after(G_OBJECT(button), "clicked", G_CALLBACK(sp_button_perform_action), NULL);
+ g_signal_connect_after(G_OBJECT(button), "event", G_CALLBACK(sp_button_process_event), NULL);
}
static void sp_button_dispose(GObject *object)
{
- SPButton *button = SP_BUTTON (object);
+ SPButton *button = SP_BUTTON(object);
- if (button->action) {
- sp_button_set_action (button, NULL);
- }
- if (button->doubleclick_action) {
- sp_button_set_doubleclick_action (button, NULL);
- }
+ if (button->action) {
+ sp_button_set_action(button, NULL);
+ }
+ if (button->doubleclick_action) {
+ sp_button_set_doubleclick_action(button, NULL);
+ }
- button->c_set_active.~connection();
- button->c_set_sensitive.~connection();
+ button->c_set_active.~connection();
+ button->c_set_sensitive.~connection();
- (G_OBJECT_CLASS(sp_button_parent_class))->dispose(object);
+ (G_OBJECT_CLASS(sp_button_parent_class))->dispose(object);
}
-
-
-#if GTK_CHECK_VERSION(3,0,0)
+#if GTK_CHECK_VERSION(3, 0, 0)
static void sp_button_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width)
{
- GtkWidget *child = gtk_bin_get_child(GTK_BIN (widget));
- GtkStyle *style = gtk_widget_get_style(widget);
-
- if (child) {
- gtk_widget_get_preferred_width(GTK_WIDGET(child), minimal_width, natural_width);
- } else {
- *minimal_width = 0;
- *natural_width = 0;
- }
-
- *minimal_width += 2 + 2 * MAX(2, style->xthickness);
- *natural_width += 2 + 2 * MAX(2, style->xthickness);
+ GtkWidget *child = gtk_bin_get_child(GTK_BIN(widget));
+ GtkStyle *style = gtk_widget_get_style(widget);
+
+ if (child) {
+ gtk_widget_get_preferred_width(GTK_WIDGET(child), minimal_width, natural_width);
+ } else {
+ *minimal_width = 0;
+ *natural_width = 0;
+ }
+
+ *minimal_width += 2 + 2 * MAX(2, style->xthickness);
+ *natural_width += 2 + 2 * MAX(2, style->xthickness);
}
static void sp_button_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height)
{
- GtkWidget *child = gtk_bin_get_child(GTK_BIN (widget));
- GtkStyle *style = gtk_widget_get_style(widget);
-
- if (child) {
- gtk_widget_get_preferred_height(GTK_WIDGET(child), minimal_height, natural_height);
- } else {
- *minimal_height = 0;
- *natural_height = 0;
- }
+ GtkWidget *child = gtk_bin_get_child(GTK_BIN(widget));
+ GtkStyle *style = gtk_widget_get_style(widget);
- *minimal_height += 2 + 2 * MAX(2, style->ythickness);
- *natural_height += 2 + 2 * MAX(2, style->ythickness);
+ if (child) {
+ gtk_widget_get_preferred_height(GTK_WIDGET(child), minimal_height, natural_height);
+ } else {
+ *minimal_height = 0;
+ *natural_height = 0;
+ }
+ *minimal_height += 2 + 2 * MAX(2, style->ythickness);
+ *natural_height += 2 + 2 * MAX(2, style->ythickness);
}
#else
static void sp_button_size_request(GtkWidget *widget, GtkRequisition *requisition)
{
- GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
- GtkStyle *style = gtk_widget_get_style (widget);
-
- if (child) {
- gtk_widget_size_request (GTK_WIDGET (child), requisition);
- } else {
- requisition->width = 0;
- requisition->height = 0;
- }
-
- requisition->width += 2 + 2 * MAX (2, style->xthickness);
- requisition->height += 2 + 2 * MAX (2, style->ythickness);
+ GtkWidget *child = gtk_bin_get_child(GTK_BIN(widget));
+ GtkStyle *style = gtk_widget_get_style(widget);
+
+ if (child) {
+ gtk_widget_size_request(GTK_WIDGET(child), requisition);
+ } else {
+ requisition->width = 0;
+ requisition->height = 0;
+ }
+
+ requisition->width += 2 + 2 * MAX(2, style->xthickness);
+ requisition->height += 2 + 2 * MAX(2, style->ythickness);
}
#endif
-static void
-sp_button_clicked (GtkButton *button)
+static void sp_button_clicked(GtkButton *button)
{
- SPButton *sp_button=SP_BUTTON (button);
+ SPButton *sp_button = SP_BUTTON(button);
- if (sp_button->type == SP_BUTTON_TYPE_TOGGLE) {
- (GTK_BUTTON_CLASS(sp_button_parent_class))->clicked (button);
- }
+ if (sp_button->type == SP_BUTTON_TYPE_TOGGLE) {
+ (GTK_BUTTON_CLASS(sp_button_parent_class))->clicked(button);
+ }
}
-static gint
-sp_button_process_event (SPButton *button, GdkEvent *event)
+static gint sp_button_process_event(SPButton *button, GdkEvent *event)
{
- switch (event->type) {
- case GDK_2BUTTON_PRESS:
- if (button->doubleclick_action) {
- sp_action_perform (button->doubleclick_action, NULL);
- }
- return TRUE;
- break;
- default:
- break;
- }
-
- return FALSE;
+ switch (event->type) {
+ case GDK_2BUTTON_PRESS:
+ if (button->doubleclick_action) {
+ sp_action_perform(button->doubleclick_action, NULL);
+ }
+ return TRUE;
+ break;
+ default:
+ break;
+ }
+
+ return FALSE;
}
-static void
-sp_button_perform_action (SPButton *button, gpointer /*data*/)
+static void sp_button_perform_action(SPButton *button, gpointer /*data*/)
{
- if (button->action) {
- sp_action_perform (button->action, NULL);
- }
+ if (button->action) {
+ sp_action_perform(button->action, NULL);
+ }
}
-
-GtkWidget *
-sp_button_new( Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action )
+GtkWidget *sp_button_new(Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action)
{
- SPButton *button = SP_BUTTON(g_object_new(SP_TYPE_BUTTON, NULL));
+ SPButton *button = SP_BUTTON(g_object_new(SP_TYPE_BUTTON, NULL));
- button->type = type;
- button->lsize = CLAMP( size, Inkscape::ICON_SIZE_MENU, Inkscape::ICON_SIZE_DECORATION );
+ button->type = type;
+ button->lsize = CLAMP(size, Inkscape::ICON_SIZE_MENU, Inkscape::ICON_SIZE_DECORATION);
- sp_button_set_action (button, action);
- if (doubleclick_action)
- sp_button_set_doubleclick_action (button, doubleclick_action);
+ sp_button_set_action(button, action);
+ if (doubleclick_action)
+ sp_button_set_doubleclick_action(button, doubleclick_action);
- // The Inkscape style is no-relief buttons
- gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+ // The Inkscape style is no-relief buttons
+ gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
- return GTK_WIDGET(button);
+ return GTK_WIDGET(button);
}
-void
-sp_button_toggle_set_down (SPButton *button, gboolean down)
+void sp_button_toggle_set_down(SPButton *button, gboolean down)
{
- g_return_if_fail (button->type == SP_BUTTON_TYPE_TOGGLE);
- g_signal_handlers_block_by_func (G_OBJECT (button), (gpointer)G_CALLBACK (sp_button_perform_action), NULL);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), (unsigned int)down);
- g_signal_handlers_unblock_by_func (G_OBJECT (button), (gpointer)G_CALLBACK (sp_button_perform_action), NULL);
+ g_return_if_fail(button->type == SP_BUTTON_TYPE_TOGGLE);
+ g_signal_handlers_block_by_func(G_OBJECT(button), (gpointer)G_CALLBACK(sp_button_perform_action), NULL);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (unsigned int)down);
+ g_signal_handlers_unblock_by_func(G_OBJECT(button), (gpointer)G_CALLBACK(sp_button_perform_action), NULL);
}
-static void
-sp_button_set_doubleclick_action (SPButton *button, SPAction *action)
+static void sp_button_set_doubleclick_action(SPButton *button, SPAction *action)
{
- if (button->doubleclick_action) {
- g_object_unref (button->doubleclick_action);
- }
- button->doubleclick_action = action;
- if (action) {
- g_object_ref(action);
- }
-
+ if (button->doubleclick_action) {
+ g_object_unref(button->doubleclick_action);
+ }
+ button->doubleclick_action = action;
+ if (action) {
+ g_object_ref(action);
+ }
}
-static void
-sp_button_set_action (SPButton *button, SPAction *action)
+static void sp_button_set_action(SPButton *button, SPAction *action)
{
- GtkWidget *child;
-
- if (button->action) {
- button->c_set_active.disconnect();
- button->c_set_sensitive.disconnect();
- child = gtk_bin_get_child (GTK_BIN (button));
- if (child) {
- gtk_container_remove (GTK_CONTAINER (button), child);
- }
- g_object_unref(button->action);
- }
- button->action = action;
- if (action) {
- g_object_ref(action);
- button->c_set_active = action->signal_set_active.connect(
- sigc::bind<0>(
- sigc::ptr_fun(&sp_button_action_set_active),
- SP_BUTTON(button)));
- button->c_set_sensitive = action->signal_set_sensitive.connect(
- sigc::bind<0>(
- sigc::ptr_fun(&gtk_widget_set_sensitive),
- GTK_WIDGET(button)));
- if (action->image) {
- child = sp_icon_new (button->lsize, action->image);
- gtk_widget_show (child);
- gtk_container_add (GTK_CONTAINER (button), child);
- }
- }
-
- sp_button_set_composed_tooltip(GTK_WIDGET(button), action);
+ GtkWidget *child;
+
+ if (button->action) {
+ button->c_set_active.disconnect();
+ button->c_set_sensitive.disconnect();
+ child = gtk_bin_get_child(GTK_BIN(button));
+ if (child) {
+ gtk_container_remove(GTK_CONTAINER(button), child);
+ }
+ g_object_unref(button->action);
+ }
+ button->action = action;
+ if (action) {
+ g_object_ref(action);
+ button->c_set_active = action->signal_set_active.connect(
+ sigc::bind<0>(sigc::ptr_fun(&sp_button_action_set_active), SP_BUTTON(button)));
+ button->c_set_sensitive = action->signal_set_sensitive.connect(
+ sigc::bind<0>(sigc::ptr_fun(&gtk_widget_set_sensitive), GTK_WIDGET(button)));
+ if (action->image) {
+ child = sp_icon_new(button->lsize, action->image);
+ gtk_widget_show(child);
+ gtk_container_add(GTK_CONTAINER(button), child);
+ }
+ }
+
+ sp_button_set_composed_tooltip(GTK_WIDGET(button), action);
}
-static void
-sp_button_action_set_active (SPButton *button, bool active)
+static void sp_button_action_set_active(SPButton *button, bool active)
{
- if (button->type != SP_BUTTON_TYPE_TOGGLE) {
- return;
- }
-
- /* temporarily lobotomized until SPActions are per-view */
- if (0 && !active != !SP_BUTTON_IS_DOWN (button)) {
- sp_button_toggle_set_down (button, active);
- }
+ if (button->type != SP_BUTTON_TYPE_TOGGLE) {
+ return;
+ }
+
+ /* temporarily lobotomized until SPActions are per-view */
+ if (0 && !active != !SP_BUTTON_IS_DOWN(button)) {
+ sp_button_toggle_set_down(button, active);
+ }
}
static void sp_button_set_composed_tooltip(GtkWidget *widget, SPAction *action)
{
if (action) {
- unsigned int shortcut = sp_shortcut_get_primary (action->verb);
+ unsigned int shortcut = sp_shortcut_get_primary(action->verb);
if (shortcut != GDK_KEY_VoidSymbol) {
// there's both action and shortcut
gchar *key = sp_shortcut_get_label(shortcut);
- gchar *tip = g_strdup_printf ("%s (%s)", action->tip, key);
+ gchar *tip = g_strdup_printf("%s (%s)", action->tip, key);
gtk_widget_set_tooltip_text(widget, tip);
g_free(tip);
g_free(key);
@@ -302,18 +273,14 @@ static void sp_button_set_composed_tooltip(GtkWidget *widget, SPAction *action)
}
}
-GtkWidget *
-sp_button_new_from_data( Inkscape::IconSize size,
- SPButtonType type,
- Inkscape::UI::View::View *view,
- const gchar *name,
- const gchar *tip )
+GtkWidget *sp_button_new_from_data(Inkscape::IconSize size, SPButtonType type, Inkscape::UI::View::View *view,
+ const gchar *name, const gchar *tip)
{
- GtkWidget *button;
- SPAction *action=sp_action_new(Inkscape::ActionContext(view), name, name, tip, name, 0);
- button = sp_button_new (size, type, action, NULL);
- g_object_unref(action);
- return button;
+ GtkWidget *button;
+ SPAction *action = sp_action_new(Inkscape::ActionContext(view), name, name, tip, name, 0);
+ button = sp_button_new(size, type, action, NULL);
+ g_object_unref(action);
+ return button;
}
/*
@@ -325,4 +292,4 @@ sp_button_new_from_data( Inkscape::IconSize size,
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :
diff --git a/src/widgets/button.h b/src/widgets/button.h
index 41863357d..d5e29da1a 100644
--- a/src/widgets/button.h
+++ b/src/widgets/button.h
@@ -1,7 +1,7 @@
-#ifndef __SP_BUTTON_H__
-#define __SP_BUTTON_H__
+#ifndef SEEN_SP_BUTTON_H
+#define SEEN_SP_BUTTON_H
-/*
+/**
* Generic button widget
*
* Author:
@@ -61,6 +61,15 @@ GtkWidget *sp_button_new_from_data (Inkscape::IconSize size,
const gchar *name,
const gchar *tip);
+#endif // !SEEN_SP_BUTTON_H
-
-#endif
+/*
+ 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:fileencoding=utf-8 :
diff --git a/src/widgets/font-selector.cpp b/src/widgets/font-selector.cpp
index 327349844..d4a174a0d 100644
--- a/src/widgets/font-selector.cpp
+++ b/src/widgets/font-selector.cpp
@@ -1,6 +1,4 @@
-#define __SP_FONT_SELECTOR_C__
-
-/*
+/**
* Font selection widgets
*
* Authors:
@@ -554,4 +552,4 @@ double sp_font_selector_get_size(SPFontSelector *fsel)
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :
diff --git a/src/widgets/font-selector.h b/src/widgets/font-selector.h
index 66715f048..ff5472d2d 100644
--- a/src/widgets/font-selector.h
+++ b/src/widgets/font-selector.h
@@ -54,7 +54,7 @@ Glib::ustring sp_font_selector_get_fontspec (SPFontSelector *fsel);
double sp_font_selector_get_size (SPFontSelector *fsel);
-#endif // SP_FONT_SELECTOR_H
+#endif // !SP_FONT_SELECTOR_H
/*
Local Variables:
@@ -65,4 +65,4 @@ double sp_font_selector_get_size (SPFontSelector *fsel);
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :
diff --git a/src/widgets/gradient-image.cpp b/src/widgets/gradient-image.cpp
index 64b058f62..2e2c5423b 100644
--- a/src/widgets/gradient-image.cpp
+++ b/src/widgets/gradient-image.cpp
@@ -1,6 +1,4 @@
-#define __SP_GRADIENT_IMAGE_C__
-
-/*
+/**
* A simple gradient preview
*
* Author:
@@ -12,14 +10,13 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include "macros.h"
+#include <sigc++/signal.h>
+
#include "display/cairo-utils.h"
#include "gradient-image.h"
+#include "macros.h"
#include "sp-gradient.h"
-#include <sigc++/functors/ptr_fun.h>
-#include <sigc++/adaptors/bind.h>
-
#define VBLOCK 16
static void sp_gradient_image_class_init (SPGradientImageClass *klass);
@@ -269,3 +266,14 @@ sp_gradient_image_update (SPGradientImage *image)
gtk_widget_queue_draw (GTK_WIDGET (image));
}
}
+
+/*
+ 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:fileencoding=utf-8 :
diff --git a/src/widgets/gradient-image.h b/src/widgets/gradient-image.h
index 904ce4cac..cd7e0ed70 100644
--- a/src/widgets/gradient-image.h
+++ b/src/widgets/gradient-image.h
@@ -1,7 +1,7 @@
-#ifndef __SP_GRADIENT_IMAGE_H__
-#define __SP_GRADIENT_IMAGE_H__
+#ifndef SEEN_SP_GRADIENT_IMAGE_H
+#define SEEN_SP_GRADIENT_IMAGE_H
-/*
+/**
* A simple gradient preview
*
* Author:
@@ -29,15 +29,15 @@ class SPGradient;
#define SP_IS_GRADIENT_IMAGE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), SP_TYPE_GRADIENT_IMAGE))
struct SPGradientImage {
- GtkWidget widget;
- SPGradient *gradient;
+ GtkWidget widget;
+ SPGradient *gradient;
- sigc::connection release_connection;
- sigc::connection modified_connection;
+ sigc::connection release_connection;
+ sigc::connection modified_connection;
};
struct SPGradientImageClass {
- GtkWidgetClass parent_class;
+ GtkWidgetClass parent_class;
};
GType sp_gradient_image_get_type (void);
@@ -47,3 +47,14 @@ GdkPixbuf *sp_gradient_to_pixbuf (SPGradient *gr, int width, int height);
void sp_gradient_image_set_gradient (SPGradientImage *gi, SPGradient *gr);
#endif
+
+/*
+ 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:fileencoding=utf-8 :
diff --git a/src/widgets/sp-xmlview-tree.cpp b/src/widgets/sp-xmlview-tree.cpp
index 43b7dc289..9b3775a34 100644
--- a/src/widgets/sp-xmlview-tree.cpp
+++ b/src/widgets/sp-xmlview-tree.cpp
@@ -1,6 +1,4 @@
-#define __SP_XMLVIEW_TREE_C__
-
-/*
+/**
* Specialization of GtkTreeView for the XML tree view
*
* Authors:
@@ -14,7 +12,7 @@
#include <cstring>
#include <string>
-#include "../xml/node-event-vector.h"
+#include "xml/node-event-vector.h"
#include "sp-xmlview-tree.h"
struct NodeData {
@@ -734,4 +732,4 @@ gboolean search_equal_func(GtkTreeModel *model, gint /*column*/, const gchar *ke
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :
diff --git a/src/widgets/sp-xmlview-tree.h b/src/widgets/sp-xmlview-tree.h
index 69228fa88..7ecbcb471 100644
--- a/src/widgets/sp-xmlview-tree.h
+++ b/src/widgets/sp-xmlview-tree.h
@@ -1,9 +1,4 @@
-#ifndef __SP_XMLVIEW_TREE_H__
-#define __SP_XMLVIEW_TREE_H__
-
-/*
- * Specialization of GtkTreeView for the XML editor
- *
+/**
* Authors:
* MenTaLguY <mental@rydia.net>
*
@@ -12,9 +7,15 @@
* Released under the GNU GPL; see COPYING for details
*/
+#ifndef SEEN_SP_XMLVIEW_TREE_H
+#define SEEN_SP_XMLVIEW_TREE_H
+
#include <gtk/gtk.h>
#include <glib.h>
+/**
+ * Specialization of GtkTreeView for the XML editor
+ */
#define SP_TYPE_XMLVIEW_TREE (sp_xmlview_tree_get_type ())
#define SP_XMLVIEW_TREE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SP_TYPE_XMLVIEW_TREE, SPXMLViewTree))
@@ -49,7 +50,7 @@ Inkscape::XML::Node * sp_xmlview_tree_node_get_repr (GtkTreeModel *model, GtkTre
gboolean sp_xmlview_tree_get_repr_node (SPXMLViewTree * tree, Inkscape::XML::Node * repr, GtkTreeIter *node);
-#endif
+#endif // !SEEN_SP_XMLVIEW_TREE_H
/*
Local Variables:
@@ -60,4 +61,4 @@ gboolean sp_xmlview_tree_get_repr_node (SPXMLViewTree * tree, Inkscape::XML::Nod
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :