diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2010-12-23 08:10:28 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2010-12-23 08:10:28 +0000 |
| commit | 3cc158ecff4f2420590ab102d7f3a84d7ca2a711 (patch) | |
| tree | 186a3a85cb4288c754504a737b502233e6b54875 /src/display | |
| parent | German translation update (diff) | |
| download | inkscape-3cc158ecff4f2420590ab102d7f3a84d7ca2a711.tar.gz inkscape-3cc158ecff4f2420590ab102d7f3a84d7ca2a711.zip | |
Split SPCanvasItem and SPCanvasGroup to individual .h files. Removed forward header.
(bzr r9978.1.1)
Diffstat (limited to 'src/display')
35 files changed, 275 insertions, 216 deletions
diff --git a/src/display/Makefile_insert b/src/display/Makefile_insert index 58e667402..b50a71033 100644 --- a/src/display/Makefile_insert +++ b/src/display/Makefile_insert @@ -35,7 +35,6 @@ ink_common_sources += \ display/canvas-text.cpp \ display/curve.cpp \ display/curve.h \ - display/display-forward.h \ display/gnome-canvas-acetate.cpp \ display/gnome-canvas-acetate.h \ display/guideline.cpp \ @@ -53,6 +52,8 @@ ink_common_sources += \ display/sodipodi-ctrl.h \ display/sodipodi-ctrlrect.cpp \ display/sodipodi-ctrlrect.h \ + display/sp-canvas-group.h \ + display/sp-canvas-item.h \ display/sp-canvas-util.cpp \ display/sp-canvas-util.h \ display/sp-canvas.cpp \ diff --git a/src/display/canvas-arena.cpp b/src/display/canvas-arena.cpp index af9a38281..fb7ca9d78 100644 --- a/src/display/canvas-arena.cpp +++ b/src/display/canvas-arena.cpp @@ -1,5 +1,3 @@ -#define __SP_CANVAS_ARENA_C__ - /* * RGBA display list system for inkscape * @@ -15,7 +13,6 @@ #include <libnr/nr-blit.h> #include <gtk/gtksignal.h> -#include <display/display-forward.h> #include <display/sp-canvas-util.h> #include "helper/sp-marshal.h" #include <display/nr-arena.h> diff --git a/src/display/canvas-arena.h b/src/display/canvas-arena.h index 34bc19946..7267583f0 100644 --- a/src/display/canvas-arena.h +++ b/src/display/canvas-arena.h @@ -13,7 +13,7 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "../display/sp-canvas.h" +#include "sp-canvas-item.h" #include "nr-arena-item.h" G_BEGIN_DECLS diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index 9dfde969d..550fd3559 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -1,5 +1,3 @@ -#define CANVAS_AXONOMGRID_C - /* * Copyright (C) 2006-2008 Johan Engelen <johan@shouraizou.nl> */ @@ -21,7 +19,6 @@ #include "canvas-axonomgrid.h" #include "util/mathfns.h" #include "2geom/line.h" -#include "display-forward.h" #include <libnr/nr-pixops.h> #include "canvas-grid.h" diff --git a/src/display/canvas-bpath.cpp b/src/display/canvas-bpath.cpp index 063bdab66..f8a8ef22c 100644 --- a/src/display/canvas-bpath.cpp +++ b/src/display/canvas-bpath.cpp @@ -1,5 +1,3 @@ -#define __SP_CANVAS_BPATH_C__ - /* * Simple bezier bpath CanvasItem for inkscape * @@ -15,28 +13,20 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif +#include <sstream> +#include <string.h> +#include <desktop.h> + #include "color.h" #include "sp-canvas-util.h" #include "inkscape-cairo.h" #include "canvas-bpath.h" -#include "display/display-forward.h" +#include "display/sp-canvas-group.h" #include "display/curve.h" #include "display/inkscape-cairo.h" -#include <libnr/nr-pixops.h> +#include "libnr/nr-pixops.h" #include "helper/geom.h" -#include <sstream> -#include <string.h> -#include <desktop.h> - -/** -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif -#include <color.h> - -#include <libnr/nr-pixops.h> -**/ void nr_pixblock_render_bpath_rgba (Shape* theS,uint32_t color,NRRectL &area,char* destBuf,int stride); diff --git a/src/display/canvas-bpath.h b/src/display/canvas-bpath.h index 65ad4aa00..0760baef6 100644 --- a/src/display/canvas-bpath.h +++ b/src/display/canvas-bpath.h @@ -1,13 +1,15 @@ -#ifndef __SP_CANVAS_BPATH_H__ -#define __SP_CANVAS_BPATH_H__ +#ifndef SEEN_SP_CANVAS_BPATH_H +#define SEEN_SP_CANVAS_BPATH_H /* * Simple bezier bpath CanvasItem for inkscape * * Authors: * Lauris Kaplinski <lauris@ximian.com> + * Jon A. Cruz <jon@joncruz.org> * * Copyright (C) 2001 Lauris Kaplinski and Ximian, Inc. + * Copyright (C) 2010 authors * * Released under GNU GPL * @@ -15,10 +17,11 @@ #include <glib/gtypes.h> -#include <display/sp-canvas.h> +#include "sp-canvas-item.h" struct SPCanvasBPath; struct SPCanvasBPathClass; +struct SPCanvasGroup; struct SPCurve; #define SP_TYPE_CANVAS_BPATH (sp_canvas_bpath_get_type ()) diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index df73eb78e..5892e1dc7 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -12,10 +12,10 @@ * Don't be shy to correct things. */ +#include "sp-canvas-group.h" #include "sp-canvas-util.h" #include "util/mathfns.h" -#include "display-forward.h" -#include <libnr/nr-pixops.h> +#include "libnr/nr-pixops.h" #include "desktop-handles.h" #include "helper/units.h" #include "svg/svg-color.h" diff --git a/src/display/canvas-grid.h b/src/display/canvas-grid.h index a11d77d1d..b8f313948 100644 --- a/src/display/canvas-grid.h +++ b/src/display/canvas-grid.h @@ -14,7 +14,7 @@ #include <gtkmm/box.h> #include <gtkmm.h> -#include "display/sp-canvas.h" +#include "sp-canvas-item.h" #include "xml/repr.h" #include "ui/widget/color-picker.h" #include "ui/widget/scalar-unit.h" @@ -26,6 +26,7 @@ struct SPDesktop; struct SPNamedView; +struct SPCanvasBuf; class SPDocument; namespace Inkscape { diff --git a/src/display/canvas-temporary-item-list.h b/src/display/canvas-temporary-item-list.h index 4d712e216..47556b9f1 100644 --- a/src/display/canvas-temporary-item-list.h +++ b/src/display/canvas-temporary-item-list.h @@ -13,9 +13,10 @@ */ #include "forward.h" -#include "display/display-forward.h" #include <list> +struct SPCanvasItem; + namespace Inkscape { namespace Display { diff --git a/src/display/canvas-temporary-item.h b/src/display/canvas-temporary-item.h index 5077fb55b..692f9d85b 100644 --- a/src/display/canvas-temporary-item.h +++ b/src/display/canvas-temporary-item.h @@ -12,9 +12,11 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "display/display-forward.h" #include <sigc++/sigc++.h> +#include <glib/gtypes.h> + +struct SPCanvasItem; namespace Inkscape { namespace Display { diff --git a/src/display/canvas-text.cpp b/src/display/canvas-text.cpp index 94312bacb..e2bc09679 100644 --- a/src/display/canvas-text.cpp +++ b/src/display/canvas-text.cpp @@ -13,7 +13,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "display-forward.h" #include "sp-canvas-util.h" #include "canvas-text.h" #include "display/inkscape-cairo.h" diff --git a/src/display/canvas-text.h b/src/display/canvas-text.h index e5d634985..cc194ccc4 100644 --- a/src/display/canvas-text.h +++ b/src/display/canvas-text.h @@ -1,5 +1,5 @@ -#ifndef __SP_CANVASTEXT_H__ -#define __SP_CANVASTEXT_H__ +#ifndef SEEN_SP_CANVASTEXT_H +#define SEEN_SP_CANVASTEXT_H /* * Canvas text. @@ -14,10 +14,7 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -/* - * FIXME: The following code should actually be in a separate file called display/canvas-text.h. It - * temporarily had to be moved here because of linker errors. - */ +#include "sp-canvas-item.h" struct SPItem; struct SPDesktop; @@ -26,7 +23,7 @@ struct SPDesktop; #define SP_CANVASTEXT(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_CANVASTEXT, SPCanvasText)) #define SP_IS_CANVASTEXT(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CANVASTEXT)) -struct SPCanvasText : public SPCanvasItem{ +struct SPCanvasText : public SPCanvasItem { SPItem *item; // the item to which this line belongs in some sense; may be NULL for some users guint32 rgba; guint32 rgba_stroke; @@ -53,7 +50,7 @@ void sp_canvastext_set_number_as_text (SPCanvasText *ct, int num); void sp_canvastext_set_fontsize (SPCanvasText *ct, double size); void sp_canvastext_set_anchor (SPCanvasText *ct, double anchor_x, double anchor_y); -#endif +#endif // SEEN_SP_CANVASTEXT_H /* diff --git a/src/display/display-forward.h b/src/display/display-forward.h deleted file mode 100644 index 25c4a6e3d..000000000 --- a/src/display/display-forward.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef SEEN_DISPLAY_DISPLAY_FORWARD_H -#define SEEN_DISPLAY_DISPLAY_FORWARD_H - -#include <glib-object.h> - -struct SPCanvas; -struct SPCanvasClass; -struct SPCanvasItem; -typedef struct _SPCanvasItemClass SPCanvasItemClass; -struct SPCanvasGroup; -struct SPCanvasGroupClass; -class SPCurve; - -namespace Inkscape { -namespace Display { - class TemporaryItem; - class TemporaryItemList; -} -} - -#define SP_TYPE_CANVAS_ITEM (sp_canvas_item_get_type()) -#define SP_CANVAS_ITEM(obj) (GTK_CHECK_CAST((obj), SP_TYPE_CANVAS_ITEM, SPCanvasItem)) -#define SP_IS_CANVAS_ITEM(obj) (GTK_CHECK_TYPE((obj), SP_TYPE_CANVAS_ITEM)) -#define SP_CANVAS_ITEM_GET_CLASS(o) (GTK_CHECK_GET_CLASS((o), SP_TYPE_CANVAS_ITEM, SPCanvasItemClass)) - -GType sp_canvas_item_get_type(); - -#define SP_TYPE_CANVAS_GROUP (sp_canvas_group_get_type()) -#define SP_CANVAS_GROUP(obj) (GTK_CHECK_CAST((obj), SP_TYPE_CANVAS_GROUP, SPCanvasGroup)) -#define SP_IS_CANVAS_GROUP(obj) (GTK_CHECK_TYPE((obj), SP_TYPE_CANVAS_GROUP)) - -GType sp_canvas_group_get_type(); - -#define SP_TYPE_CANVAS (sp_canvas_get_type()) -#define SP_CANVAS(obj) (GTK_CHECK_CAST((obj), SP_TYPE_CANVAS, SPCanvas)) -#define SP_IS_CANVAS(obj) (GTK_CHECK_TYPE((obj), SP_TYPE_CANVAS)) - -GType sp_canvas_get_type(); - - -#endif /* !SEEN_DISPLAY_DISPLAY_FORWARD_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 : diff --git a/src/display/gnome-canvas-acetate.cpp b/src/display/gnome-canvas-acetate.cpp index fdb137e27..c257f1f92 100644 --- a/src/display/gnome-canvas-acetate.cpp +++ b/src/display/gnome-canvas-acetate.cpp @@ -14,7 +14,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "display-forward.h" #include "gnome-canvas-acetate.h" static void sp_canvas_acetate_class_init (SPCanvasAcetateClass *klass); diff --git a/src/display/gnome-canvas-acetate.h b/src/display/gnome-canvas-acetate.h index 40574e1bf..8c284291c 100644 --- a/src/display/gnome-canvas-acetate.h +++ b/src/display/gnome-canvas-acetate.h @@ -1,5 +1,5 @@ -#ifndef __SP_CANVAS_ACETATE_H__ -#define __SP_CANVAS_ACETATE_H__ +#ifndef SEEN_SP_CANVAS_ACETATE_H +#define SEEN_SP_CANVAS_ACETATE_H /* * Infinite invisible canvas item @@ -16,7 +16,7 @@ */ #include <glib/gtypes.h> -#include "display/sp-canvas.h" +#include "display/sp-canvas-item.h" #define GNOME_TYPE_CANVAS_ACETATE (sp_canvas_acetate_get_type ()) @@ -38,4 +38,15 @@ GtkType sp_canvas_acetate_get_type (void); -#endif +#endif // SEEN_SP_CANVAS_ACETATE_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 : diff --git a/src/display/guideline.cpp b/src/display/guideline.cpp index 0141692f2..ce1289faf 100644 --- a/src/display/guideline.cpp +++ b/src/display/guideline.cpp @@ -1,5 +1,3 @@ -#define __SP_GUIDELINE_C__ - /* * Horizontal/vertical but can also be angled line * @@ -18,7 +16,6 @@ #include <libnr/nr-pixops.h> #include <2geom/transforms.h> -#include "display-forward.h" #include "sp-canvas-util.h" #include "sp-ctrlpoint.h" #include "guideline.h" diff --git a/src/display/guideline.h b/src/display/guideline.h index a6ce57113..9654d04a1 100644 --- a/src/display/guideline.h +++ b/src/display/guideline.h @@ -1,5 +1,5 @@ -#ifndef __SP_GUIDELINE_H__ -#define __SP_GUIDELINE_H__ +#ifndef SEEN_SP_GUIDELINE_H +#define SEEN_SP_GUIDELINE_H /* * The visual representation of SPGuide. @@ -14,8 +14,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "sp-canvas.h" #include <2geom/point.h> +#include "sp-canvas-item.h" #define SP_TYPE_GUIDELINE (sp_guideline_get_type()) #define SP_GUIDELINE(o) (GTK_CHECK_CAST((o), SP_TYPE_GUIDELINE, SPGuideLine)) @@ -53,7 +53,7 @@ void sp_guideline_set_color(SPGuideLine *gl, unsigned int rgba); void sp_guideline_set_sensitive(SPGuideLine *gl, int sensitive); void sp_guideline_delete(SPGuideLine *gl); -#endif +#endif // SEEN_SP_GUIDELINE_H /* Local Variables: diff --git a/src/display/nr-arena-glyphs.h b/src/display/nr-arena-glyphs.h index 5bf94f3fc..1d15fef81 100644 --- a/src/display/nr-arena-glyphs.h +++ b/src/display/nr-arena-glyphs.h @@ -1,5 +1,5 @@ -#ifndef __NR_ARENA_GLYPHS_H__ -#define __NR_ARENA_GLYPHS_H__ +#ifndef SEEN_NR_ARENA_GLYPHS_H +#define SEEN_NR_ARENA_GLYPHS_H /* * RGBA display list system for inkscape @@ -17,15 +17,15 @@ #define NR_ARENA_GLYPHS(obj) (NR_CHECK_INSTANCE_CAST ((obj), NR_TYPE_ARENA_GLYPHS, NRArenaGlyphs)) #define NR_IS_ARENA_GLYPHS(obj) (NR_CHECK_INSTANCE_TYPE ((obj), NR_TYPE_ARENA_GLYPHS)) -#include <libnrtype/nrtype-forward.h> +#include "libnrtype/nrtype-forward.h" -#include <display/display-forward.h> -#include <forward.h> -#include <sp-paint-server.h> -#include <display/nr-arena-item.h> +#include "forward.h" +#include "sp-paint-server.h" +#include "display/nr-arena-item.h" #define test_glyph_liv +struct SPCurve; class Shape; NRType nr_arena_glyphs_get_type (void); @@ -106,4 +106,15 @@ void nr_arena_glyphs_group_set_style (NRArenaGlyphsGroup *group, SPStyle *style) void nr_arena_glyphs_group_set_paintbox (NRArenaGlyphsGroup *group, const NRRect *pbox); -#endif +#endif // SEEN_NR_ARENA_GLYPHS_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 : diff --git a/src/display/nr-arena-shape.cpp b/src/display/nr-arena-shape.cpp index 6aaf395b3..6f38fd97d 100644 --- a/src/display/nr-arena-shape.cpp +++ b/src/display/nr-arena-shape.cpp @@ -1,5 +1,3 @@ -#define __NR_ARENA_SHAPE_C__ - /* * RGBA display list system for inkscape * @@ -12,34 +10,36 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include <glib.h> +#include <fenv.h> +#include <typeinfo> +#include <cairo.h> + #include <2geom/svg-path.h> #include <2geom/svg-path-parser.h> -#include <display/canvas-arena.h> -#include <display/nr-arena.h> -#include <display/nr-arena-shape.h> -#include "display/curve.h" -#include <libnr/nr-pixops.h> -#include <libnr/nr-blit.h> -#include <libnr/nr-convert2geom.h> #include <2geom/pathvector.h> #include <2geom/curves.h> -#include <livarot/Path.h> -#include <livarot/float-line.h> -#include <livarot/int-line.h> -#include <style.h> +#include "display/sp-canvas.h" +#include "display/canvas-arena.h" +#include "display/nr-arena.h" +#include "display/nr-arena-shape.h" +#include "display/curve.h" +#include "libnr/nr-pixops.h" +#include "libnr/nr-blit.h" +#include "libnr/nr-convert2geom.h" +#include "livarot/Path.h" +#include "livarot/float-line.h" +#include "livarot/int-line.h" +#include "style.h" #include "inkscape-cairo.h" #include "helper/geom.h" #include "helper/geom-curves.h" #include "sp-filter.h" #include "sp-filter-reference.h" #include "display/nr-filter.h" -#include <typeinfo> -#include <cairo.h> #include "preferences.h" -#include <glib.h> #include "svg/svg.h" -#include <fenv.h> //int showRuns=0; void nr_pixblock_render_shape_mask_or(NRPixBlock &m,Shape* theS); diff --git a/src/display/nr-arena-shape.h b/src/display/nr-arena-shape.h index 03505cfc2..d484615a9 100644 --- a/src/display/nr-arena-shape.h +++ b/src/display/nr-arena-shape.h @@ -17,7 +17,6 @@ #define NR_ARENA_SHAPE(obj) (NR_CHECK_INSTANCE_CAST ((obj), NR_TYPE_ARENA_SHAPE, NRArenaShape)) #define NR_IS_ARENA_SHAPE(obj) (NR_CHECK_INSTANCE_TYPE ((obj), NR_TYPE_ARENA_SHAPE)) -#include "display/display-forward.h" #include "display/canvas-bpath.h" #include "forward.h" #include "sp-paint-server.h" diff --git a/src/display/snap-indicator.h b/src/display/snap-indicator.h index 5475f9f60..d60ff1481 100644 --- a/src/display/snap-indicator.h +++ b/src/display/snap-indicator.h @@ -15,12 +15,13 @@ */ #include "forward.h" -#include "display/display-forward.h" #include "snapped-point.h" namespace Inkscape { namespace Display { +class TemporaryItem; + class SnapIndicator { public: SnapIndicator(SPDesktop *desktop); diff --git a/src/display/sodipodi-ctrl.cpp b/src/display/sodipodi-ctrl.cpp index 6084ff898..a63f570cf 100644 --- a/src/display/sodipodi-ctrl.cpp +++ b/src/display/sodipodi-ctrl.cpp @@ -10,7 +10,6 @@ #include <2geom/transforms.h> #include "sp-canvas-util.h" -#include "display-forward.h" #include "sodipodi-ctrl.h" #include "libnr/nr-pixops.h" diff --git a/src/display/sodipodi-ctrl.h b/src/display/sodipodi-ctrl.h index 945d94807..a708ad41b 100644 --- a/src/display/sodipodi-ctrl.h +++ b/src/display/sodipodi-ctrl.h @@ -8,10 +8,9 @@ */ #include <gtk/gtkenums.h> -#include "sp-canvas.h" #include <gdk-pixbuf/gdk-pixbuf.h> #include <libnr/nr-rect-l.h> - +#include "sp-canvas-item.h" #define SP_TYPE_CTRL (sp_ctrl_get_type ()) @@ -35,7 +34,7 @@ typedef enum { SP_CTRL_MODE_XOR } SPCtrlModeType; -struct SPCtrl : public SPCanvasItem{ +struct SPCtrl : public SPCanvasItem { SPCtrlShapeType shape; SPCtrlModeType mode; GtkAnchorType anchor; diff --git a/src/display/sodipodi-ctrlrect.cpp b/src/display/sodipodi-ctrlrect.cpp index 46d83c208..6d9c40858 100644 --- a/src/display/sodipodi-ctrlrect.cpp +++ b/src/display/sodipodi-ctrlrect.cpp @@ -15,7 +15,6 @@ * */ -#include "display-forward.h" #include "sp-canvas-util.h" #include "sodipodi-ctrlrect.h" #include "libnr/nr-pixops.h" diff --git a/src/display/sodipodi-ctrlrect.h b/src/display/sodipodi-ctrlrect.h index 70dcf1f30..9ecba47c8 100644 --- a/src/display/sodipodi-ctrlrect.h +++ b/src/display/sodipodi-ctrlrect.h @@ -1,5 +1,5 @@ -#ifndef __INKSCAPE_CTRLRECT_H__ -#define __INKSCAPE_CTRLRECT_H__ +#ifndef SEEN_INKSCAPE_CTRLRECT_H +#define SEEN_INKSCAPE_CTRLRECT_H /** * \file sodipodi-ctrlrect.h @@ -17,7 +17,10 @@ */ #include <glib/gtypes.h> -#include "sp-canvas.h" +#include "sp-canvas-item.h" +#include "libnr/nr-rect-l.h" + +struct SPCanvasBuf; #define SP_TYPE_CTRLRECT (sp_ctrlrect_get_type ()) #define SP_CTRLRECT(obj) (GTK_CHECK_CAST((obj), SP_TYPE_CTRLRECT, CtrlRect)) @@ -56,7 +59,7 @@ struct SPCtrlRectClass : public SPCanvasItemClass {}; GtkType sp_ctrlrect_get_type(); -#endif +#endif // SEEN_RUBBERBAND_H /* Local Variables: diff --git a/src/display/sp-canvas-group.h b/src/display/sp-canvas-group.h new file mode 100644 index 000000000..10bf0fa6c --- /dev/null +++ b/src/display/sp-canvas-group.h @@ -0,0 +1,45 @@ +#ifndef SEEN_SP_CANVAS_GROUP_H +#define SEEN_SP_CANVAS_GROUP_H + +/** \file + * SPCanvasGroup + * + * Authors: + * Federico Mena <federico@nuclecu.unam.mx> + * Raph Levien <raph@gimp.org> + * Lauris Kaplinski <lauris@kaplinski.com> + * Jon A. Cruz <jon@joncruz.org> + * + * Copyright (C) 1998 The Free Software Foundation + * Copyright (C) 2002 Lauris Kaplinski + * Copyright (C) 2010 authors + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib-object.h> + +#define SP_TYPE_CANVAS_GROUP (sp_canvas_group_get_type()) +#define SP_CANVAS_GROUP(obj) (GTK_CHECK_CAST((obj), SP_TYPE_CANVAS_GROUP, SPCanvasGroup)) +#define SP_IS_CANVAS_GROUP(obj) (GTK_CHECK_TYPE((obj), SP_TYPE_CANVAS_GROUP)) + +GType sp_canvas_group_get_type(); + + + +#endif // SEEN_SP_CANVAS_GROUP_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 : diff --git a/src/display/sp-canvas-item.h b/src/display/sp-canvas-item.h new file mode 100644 index 000000000..1ae2ff2d1 --- /dev/null +++ b/src/display/sp-canvas-item.h @@ -0,0 +1,110 @@ +#ifndef SEEN_SP_CANVAS_ITEM_H +#define SEEN_SP_CANVAS_ITEM_H + +/** \file + * SPCanvasItem. + * + * Authors: + * Federico Mena <federico@nuclecu.unam.mx> + * Raph Levien <raph@gimp.org> + * Lauris Kaplinski <lauris@kaplinski.com> + * Jon A. Cruz <jon@joncruz.org> + * + * Copyright (C) 1998 The Free Software Foundation + * Copyright (C) 2002 Lauris Kaplinski + * Copyright (C) 2010 authors + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib-object.h> +#include <gtk/gtkobject.h> +#include <gdk/gdkevents.h> + +#include "2geom/rect.h" + +G_BEGIN_DECLS + +struct SPCanvas; +struct SPCanvasBuf; +struct SPCanvasGroup; + +typedef struct _SPCanvasItemClass SPCanvasItemClass; + +#define SP_TYPE_CANVAS_ITEM (sp_canvas_item_get_type()) +#define SP_CANVAS_ITEM(obj) (GTK_CHECK_CAST((obj), SP_TYPE_CANVAS_ITEM, SPCanvasItem)) +#define SP_IS_CANVAS_ITEM(obj) (GTK_CHECK_TYPE((obj), SP_TYPE_CANVAS_ITEM)) +#define SP_CANVAS_ITEM_GET_CLASS(o) (GTK_CHECK_GET_CLASS((o), SP_TYPE_CANVAS_ITEM, SPCanvasItemClass)) + +GType sp_canvas_item_get_type(); + +/** + * An SPCanvasItem refers to a SPCanvas and to its parent item; it has + * four coordinates, a bounding rectangle, and a transformation matrix. + */ +struct SPCanvasItem : public GtkObject { + SPCanvas *canvas; + SPCanvasItem *parent; + + double x1, y1, x2, y2; + Geom::Rect bounds; + Geom::Matrix xform; +}; + +/** + * The vtable of an SPCanvasItem. + */ +struct _SPCanvasItemClass : public GtkObjectClass { + void (* update) (SPCanvasItem *item, Geom::Matrix const &affine, unsigned int flags); + + void (* render) (SPCanvasItem *item, SPCanvasBuf *buf); + double (* point) (SPCanvasItem *item, Geom::Point p, SPCanvasItem **actual_item); + + int (* event) (SPCanvasItem *item, GdkEvent *event); +}; + +SPCanvasItem *sp_canvas_item_new(SPCanvasGroup *parent, GtkType type, const gchar *first_arg_name, ...); + +G_END_DECLS + + +#define sp_canvas_item_set gtk_object_set + +void sp_canvas_item_affine_absolute(SPCanvasItem *item, Geom::Matrix const &aff); + +void sp_canvas_item_raise(SPCanvasItem *item, int positions); +void sp_canvas_item_lower(SPCanvasItem *item, int positions); +bool sp_canvas_item_is_visible(SPCanvasItem *item); +void sp_canvas_item_show(SPCanvasItem *item); +void sp_canvas_item_hide(SPCanvasItem *item); +int sp_canvas_item_grab(SPCanvasItem *item, unsigned int event_mask, GdkCursor *cursor, guint32 etime); +void sp_canvas_item_ungrab(SPCanvasItem *item, guint32 etime); + +Geom::Matrix sp_canvas_item_i2w_affine(SPCanvasItem const *item); + +void sp_canvas_item_grab_focus(SPCanvasItem *item); + +void sp_canvas_item_request_update(SPCanvasItem *item); + +/* get item z-order in parent group */ + +gint sp_canvas_item_order(SPCanvasItem * item); + + + +#endif // SEEN_SP_CANVAS_ITEM_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 : diff --git a/src/display/sp-canvas-util.cpp b/src/display/sp-canvas-util.cpp index a06d93074..af80eed44 100644 --- a/src/display/sp-canvas-util.cpp +++ b/src/display/sp-canvas-util.cpp @@ -13,10 +13,11 @@ */ +#include <string.h> // for memset #include <2geom/matrix.h> #include "libnr/nr-pixops.h" +#include "sp-canvas-item.h" #include "sp-canvas-util.h" -#include <string.h> /* for memset */ void diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index 2319f82f6..fc68bcfc0 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -1,5 +1,3 @@ -#define __SP_CANVAS_C__ - /** \file * Port of GnomeCanvas for Inkscape needs * @@ -30,10 +28,10 @@ #include "helper/sp-marshal.h" #include <helper/recthull.h> -#include <display/sp-canvas.h> -#include "display-forward.h" +#include "display/sp-canvas.h" +#include "display/sp-canvas-group.h" #include <2geom/matrix.h> -#include <libnr/nr-convex-hull.h> +#include "libnr/nr-convex-hull.h" #include "preferences.h" #include "inkscape.h" #include "sodipodi-ctrlrect.h" diff --git a/src/display/sp-canvas.h b/src/display/sp-canvas.h index 5cd201618..9c8b19982 100644 --- a/src/display/sp-canvas.h +++ b/src/display/sp-canvas.h @@ -2,7 +2,7 @@ #define SEEN_SP_CANVAS_H /** \file - * SPCanvas, SPCanvasBuf, and SPCanvasItem. + * SPCanvas, SPCanvasBuf. * * Authors: * Federico Mena <federico@nuclecu.unam.mx> @@ -42,9 +42,15 @@ G_BEGIN_DECLS +#define SP_TYPE_CANVAS sp_canvas_get_type() +#define SP_CANVAS(obj) (GTK_CHECK_CAST((obj), SP_TYPE_CANVAS, SPCanvas)) +#define SP_IS_CANVAS(obj) (GTK_CHECK_TYPE((obj), SP_TYPE_CANVAS)) + +GType sp_canvas_get_type(); + struct SPCanvas; +struct SPCanvasItem; struct SPCanvasGroup; -typedef struct _SPCanvasItemClass SPCanvasItemClass; enum { SP_CANVAS_UPDATE_REQUESTED = 1 << 0, @@ -66,58 +72,8 @@ struct SPCanvasBuf{ cairo_t *ct; }; -/** - * An SPCanvasItem refers to a SPCanvas and to its parent item; it has - * four coordinates, a bounding rectangle, and a transformation matrix. - */ -struct SPCanvasItem : public GtkObject { - SPCanvas *canvas; - SPCanvasItem *parent; - - double x1, y1, x2, y2; - Geom::Rect bounds; - Geom::Matrix xform; -}; - -/** - * The vtable of an SPCanvasItem. - */ -struct _SPCanvasItemClass : public GtkObjectClass { - void (* update) (SPCanvasItem *item, Geom::Matrix const &affine, unsigned int flags); - - void (* render) (SPCanvasItem *item, SPCanvasBuf *buf); - double (* point) (SPCanvasItem *item, Geom::Point p, SPCanvasItem **actual_item); - - int (* event) (SPCanvasItem *item, GdkEvent *event); -}; - -SPCanvasItem *sp_canvas_item_new(SPCanvasGroup *parent, GtkType type, const gchar *first_arg_name, ...); - G_END_DECLS -#define sp_canvas_item_set gtk_object_set - -void sp_canvas_item_affine_absolute(SPCanvasItem *item, Geom::Matrix const &aff); - -void sp_canvas_item_raise(SPCanvasItem *item, int positions); -void sp_canvas_item_lower(SPCanvasItem *item, int positions); -bool sp_canvas_item_is_visible(SPCanvasItem *item); -void sp_canvas_item_show(SPCanvasItem *item); -void sp_canvas_item_hide(SPCanvasItem *item); -int sp_canvas_item_grab(SPCanvasItem *item, unsigned int event_mask, GdkCursor *cursor, guint32 etime); -void sp_canvas_item_ungrab(SPCanvasItem *item, guint32 etime); - -Geom::Matrix sp_canvas_item_i2w_affine(SPCanvasItem const *item); - -void sp_canvas_item_grab_focus(SPCanvasItem *item); - -void sp_canvas_item_request_update(SPCanvasItem *item); - -/* get item z-order in parent group */ - -gint sp_canvas_item_order(SPCanvasItem * item); - - // SPCanvas ------------------------------------------------- /** * Port of GnomeCanvas for inkscape needs. diff --git a/src/display/sp-ctrlline.cpp b/src/display/sp-ctrlline.cpp index d8a622d90..0ef23812e 100644 --- a/src/display/sp-ctrlline.cpp +++ b/src/display/sp-ctrlline.cpp @@ -19,7 +19,6 @@ * */ -#include "display-forward.h" #include "sp-canvas-util.h" #include "sp-ctrlline.h" diff --git a/src/display/sp-ctrlline.h b/src/display/sp-ctrlline.h index 64497c464..a13907a70 100644 --- a/src/display/sp-ctrlline.h +++ b/src/display/sp-ctrlline.h @@ -1,5 +1,5 @@ -#ifndef __INKSCAPE_CTRLLINE_H__ -#define __INKSCAPE_CTRLLINE_H__ +#ifndef SEEN_INKSCAPE_CTRLLINE_H +#define SEEN_INKSCAPE_CTRLLINE_H /* * Simple straight line @@ -14,7 +14,7 @@ * Released under GNU GPL */ -#include "sp-canvas.h" +#include "sp-canvas-item.h" struct SPItem; @@ -38,7 +38,7 @@ void sp_ctrlline_set_coords (SPCtrlLine *cl, const Geom::Point start, const Geom -#endif +#endif // SEEN_INKSCAPE_CTRLLINE_H /* Local Variables: diff --git a/src/display/sp-ctrlpoint.cpp b/src/display/sp-ctrlpoint.cpp index 1f8c145a8..ba40192a9 100644 --- a/src/display/sp-ctrlpoint.cpp +++ b/src/display/sp-ctrlpoint.cpp @@ -11,7 +11,6 @@ * Released under GNU GPL */ -#include "display-forward.h" #include "sp-canvas-util.h" #include "sp-ctrlpoint.h" diff --git a/src/display/sp-ctrlpoint.h b/src/display/sp-ctrlpoint.h index d0e72f518..1b7b7ba1e 100644 --- a/src/display/sp-ctrlpoint.h +++ b/src/display/sp-ctrlpoint.h @@ -1,5 +1,5 @@ -#ifndef __INKSCAPE_CTRLPOINT_H__ -#define __INKSCAPE_CTRLPOINT_H__ +#ifndef SEEN_INKSCAPE_CTRLPOINT_H +#define SEEN_INKSCAPE_CTRLPOINT_H /* * A simple point @@ -12,7 +12,7 @@ * Released under GNU GPL */ -#include "sp-canvas.h" +#include "sp-canvas-item.h" struct SPItem; @@ -20,7 +20,7 @@ struct SPItem; #define SP_CTRLPOINT(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_CTRLPOINT, SPCtrlPoint)) #define SP_IS_CTRLPOINT(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CTRLPOINT)) -struct SPCtrlPoint : public SPCanvasItem{ +struct SPCtrlPoint : public SPCanvasItem { SPItem *item; // the item to which this line belongs in some sense; may be NULL for some users guint32 rgba; Geom::Point pt; @@ -38,7 +38,7 @@ void sp_ctrlpoint_set_radius (SPCtrlPoint *cp, const double r); -#endif +#endif // SEEN_INKSCAPE_CTRLPOINT_H /* Local Variables: diff --git a/src/display/sp-ctrlquadr.cpp b/src/display/sp-ctrlquadr.cpp index 54b9bc3e1..c29aecb96 100644 --- a/src/display/sp-ctrlquadr.cpp +++ b/src/display/sp-ctrlquadr.cpp @@ -1,5 +1,3 @@ -#define __INKSCAPE_CTRLQUADR_C__ - /* * Quadrilateral * @@ -11,13 +9,12 @@ * Released under GNU GPL */ -#include "display-forward.h" -#include "sp-canvas-util.h" -#include "sp-ctrlquadr.h" - #ifdef HAVE_CONFIG_H # include "config.h" #endif +#include "sp-canvas-util.h" +#include "sp-canvas-item.h" +#include "sp-ctrlquadr.h" #include "display/inkscape-cairo.h" #include "color.h" |
