diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2012-05-20 04:15:14 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2012-05-20 04:15:14 +0000 |
| commit | ecc909cacae644cbea32c0a847ee00b592d5f67c (patch) | |
| tree | adea307d9254b4322427a85a10ef8cbfd7048e4b /src/widgets/sp-widget.h | |
| parent | Revert r11370. Fix crash with grid in default template (diff) | |
| download | inkscape-ecc909cacae644cbea32c0a847ee00b592d5f67c.tar.gz inkscape-ecc909cacae644cbea32c0a847ee00b592d5f67c.zip | |
C++ification of SPWidget.
(bzr r11387)
Diffstat (limited to 'src/widgets/sp-widget.h')
| -rw-r--r-- | src/widgets/sp-widget.h | 64 |
1 files changed, 44 insertions, 20 deletions
diff --git a/src/widgets/sp-widget.h b/src/widgets/sp-widget.h index 66320cd4d..d2177f486 100644 --- a/src/widgets/sp-widget.h +++ b/src/widgets/sp-widget.h @@ -1,52 +1,76 @@ -#ifndef __SP_WIDGET_H__ -#define __SP_WIDGET_H__ +#ifndef SEEN_SP_WIDGET_H +#define SEEN_SP_WIDGET_H /* * Abstract base class for dynamic control widgets * * Authors: * Lauris Kaplinski <lauris@kaplinski.com> + * Jon A. Cruz <jon@joncruz.org> * * Copyright (C) 1999-2002 Lauris Kaplinski * Copyright (C) 2000-2001 Ximian, Inc. + * Copyright (C) 2012 Authors * * Released under GNU GPL, read the file 'COPYING' for more information */ #include <glib.h> +#include <gtk/gtk.h> -#define SP_TYPE_WIDGET (sp_widget_get_type ()) +#define SP_TYPE_WIDGET (SPWidget::getType()) #define SP_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_WIDGET, SPWidget)) #define SP_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_WIDGET, SPWidgetClass)) #define SP_IS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_WIDGET)) #define SP_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_WIDGET)) -#include <gtk/gtk.h> namespace Inkscape { - class Application; - class Selection; + +class Application; +class Selection; +class SPWidgetImpl; + } struct SPWidget { - GtkBin bin; - Inkscape::Application *inkscape; + friend class Inkscape::SPWidgetImpl; + + static GType getType(); + + // + + GtkBin bin; + Inkscape::Application *inkscape; + +private: + Inkscape::SPWidgetImpl *_impl; }; struct SPWidgetClass { - GtkBinClass bin_class; - void (* construct) (SPWidget *spw); - /* Selection change handlers */ - void (* modify_selection) (SPWidget *spw, Inkscape::Selection *selection, guint flags); - void (* change_selection) (SPWidget *spw, Inkscape::Selection *selection); - void (* set_selection) (SPWidget *spw, Inkscape::Selection *selection); -}; + GtkBinClass bin_class; + + void (* construct) (SPWidget *spw); -GType sp_widget_get_type (void); + // Selection change handlers + void (* modify_selection) (SPWidget *spw, Inkscape::Selection *selection, guint flags); + void (* change_selection) (SPWidget *spw, Inkscape::Selection *selection); + void (* set_selection) (SPWidget *spw, Inkscape::Selection *selection); +}; /* fixme: Think (Lauris) */ -/* Generic constructor for global widget */ -GtkWidget *sp_widget_new_global (Inkscape::Application *inkscape); -GtkWidget *sp_widget_construct_global (SPWidget *spw, Inkscape::Application *inkscape); -#endif +/** Generic constructor for global widget. */ +GtkWidget *sp_widget_new_global(Inkscape::Application *inkscape); + +#endif // SEEN_SP_WIDGET_H +/* + 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 : |
