From: Jon A. Cruz Date: Thu, 23 Dec 2010 08:10:28 +0000 (-0800) Subject: Split SPCanvasItem and SPCanvasGroup to individual .h files. Removed forward header. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0dc33d4ce43e0bb49c63aa53b826ec4a1ff68e28;p=inkscape.git Split SPCanvasItem and SPCanvasGroup to individual .h files. Removed forward header. --- diff --git a/src/common-context.h b/src/common-context.h index 416307d58..74b6bbaef 100644 --- a/src/common-context.h +++ b/src/common-context.h @@ -21,7 +21,6 @@ #include "event-context.h" #include "display/curve.h" -#include "display/display-forward.h" #include <2geom/point.h> #define SP_TYPE_COMMON_CONTEXT (sp_common_context_get_type()) diff --git a/src/connector-context.cpp b/src/connector-context.cpp index b1061c124..f4b202451 100644 --- a/src/connector-context.cpp +++ b/src/connector-context.cpp @@ -1,12 +1,14 @@ -/* +/** * Connector creation tool * * Authors: * Michael Wybrow * Abhishek Sharma + * Jon A. Cruz * * Copyright (C) 2005-2008 Michael Wybrow * Copyright (C) 2009 Monash University + * Copyright (C) 2010 authors * * Released under GNU GPL, read the file 'COPYING' for more information * @@ -172,6 +174,7 @@ #include "inkscape.h" #include "preferences.h" #include "sp-path.h" +#include "display/sp-canvas.h" #include "display/canvas-bpath.h" #include "display/sodipodi-ctrl.h" #include diff --git a/src/connector-context.h b/src/connector-context.h index 036981f6f..b03d0fcf0 100644 --- a/src/connector-context.h +++ b/src/connector-context.h @@ -16,7 +16,6 @@ #include #include "event-context.h" #include -#include #include <2geom/point.h> #include "libavoid/connector.h" #include "connection-points.h" @@ -29,6 +28,8 @@ #define SP_IS_CONNECTOR_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), SP_TYPE_CONNECTOR_CONTEXT)) struct SPKnot; +struct SPCurve; + namespace Inkscape { class Selection; diff --git a/src/desktop-handles.cpp b/src/desktop-handles.cpp index 481bf35ea..d35df6454 100644 --- a/src/desktop-handles.cpp +++ b/src/desktop-handles.cpp @@ -1,5 +1,3 @@ -#define __SP_DESKTOP_HANDLES_C__ - /* * Frontends * @@ -13,6 +11,7 @@ */ #include "display/sp-canvas.h" +#include "display/sp-canvas-item.h" #include "desktop.h" SPEventContext * diff --git a/src/desktop-handles.h b/src/desktop-handles.h index 61ea43d1e..74001d890 100644 --- a/src/desktop-handles.h +++ b/src/desktop-handles.h @@ -13,9 +13,12 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "display/display-forward.h" #include "forward.h" +struct SPCanvas; +struct SPCanvasItem; +struct SPCanvasGroup; + namespace Inkscape { class MessageStack; class Selection; diff --git a/src/desktop.cpp b/src/desktop.cpp index 0b17fb385..bfde0ee92 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -80,6 +80,7 @@ #include "display/sp-canvas-util.h" #include "display/canvas-temporary-item-list.h" #include "display/snap-indicator.h" +#include "display/sp-canvas-group.h" #include "ui/dialog/dialog-manager.h" #include "xml/repr.h" #include "message-context.h" 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 #include -#include #include #include "helper/sp-marshal.h" #include 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 */ @@ -21,7 +19,6 @@ #include "canvas-axonomgrid.h" #include "util/mathfns.h" #include "2geom/line.h" -#include "display-forward.h" #include #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 +#include +#include + #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 +#include "libnr/nr-pixops.h" #include "helper/geom.h" -#include -#include -#include - -/** -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif -#include - -#include -**/ 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 + * Jon A. Cruz * * Copyright (C) 2001 Lauris Kaplinski and Ximian, Inc. + * Copyright (C) 2010 authors * * Released under GNU GPL * @@ -15,10 +17,11 @@ #include -#include +#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 +#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 #include -#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 +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 +#include + +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 - -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 -#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 #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 +#include "libnrtype/nrtype-forward.h" -#include -#include -#include -#include +#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 +#include +#include +#include + #include <2geom/svg-path.h> #include <2geom/svg-path-parser.h> -#include -#include -#include -#include "display/curve.h" -#include -#include -#include #include <2geom/pathvector.h> #include <2geom/curves.h> -#include -#include -#include -#include +#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 -#include #include "preferences.h" -#include #include "svg/svg.h" -#include //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 -#include "sp-canvas.h" #include #include - +#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 -#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 + * Raph Levien + * Lauris Kaplinski + * Jon A. Cruz + * + * 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 + +#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 + * Raph Levien + * Lauris Kaplinski + * Jon A. Cruz + * + * 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 +#include +#include + +#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 // for memset #include <2geom/matrix.h> #include "libnr/nr-pixops.h" +#include "sp-canvas-item.h" #include "sp-canvas-util.h" -#include /* 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 -#include -#include "display-forward.h" +#include "display/sp-canvas.h" +#include "display/sp-canvas-group.h" #include <2geom/matrix.h> -#include +#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 @@ -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" diff --git a/src/draw-context.h b/src/draw-context.h index 1364b5dad..2827714cb 100644 --- a/src/draw-context.h +++ b/src/draw-context.h @@ -17,7 +17,6 @@ #include #include "event-context.h" #include -#include #include #include "live_effects/effect.h" diff --git a/src/dropper-context.h b/src/dropper-context.h index 6f8b60b34..f2d18a507 100644 --- a/src/dropper-context.h +++ b/src/dropper-context.h @@ -12,7 +12,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "display/display-forward.h" #include "event-context.h" #define SP_TYPE_DROPPER_CONTEXT (sp_dropper_context_get_type ()) diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index 93d4262cd..7d0c7ee91 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -58,6 +58,7 @@ #include "sp-shape.h" #include "sp-path.h" #include "sp-text.h" +#include "display/sp-canvas.h" #include "display/canvas-bpath.h" #include "display/canvas-arena.h" #include "livarot/Shape.h" diff --git a/src/eraser-context.cpp b/src/eraser-context.cpp index 68c0989bc..8ac765b9e 100644 --- a/src/eraser-context.cpp +++ b/src/eraser-context.cpp @@ -34,6 +34,7 @@ #include #include "svg/svg.h" +#include "display/sp-canvas.h" #include "display/canvas-bpath.h" #include <2geom/bezier-utils.h> diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 2e9a21acf..fe8297286 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -25,6 +25,7 @@ #include "selection.h" #include "desktop.h" #include "desktop-style.h" +#include "desktop-handles.h" #include "document.h" #include "display/sp-ctrlline.h" #include "display/sp-canvas-util.h" diff --git a/src/inkview.cpp b/src/inkview.cpp index 09adb8c2d..448aa77f1 100644 --- a/src/inkview.cpp +++ b/src/inkview.cpp @@ -325,8 +325,7 @@ main (int argc, const char **argv) (ss.doc)->ensureUpToDate(); ss.view = sp_svg_view_widget_new (ss.doc); (ss.doc)->doUnref (); - sp_svg_view_widget_set_resize (SP_SVG_VIEW_WIDGET (ss.view), FALSE, - (ss.doc)->getWidth (), (ss.doc)->getHeight ()); + SP_SVG_VIEW_WIDGET(ss.view)->setResize( false, ss.doc->getWidth(), ss.doc->getHeight() ); gtk_widget_show (ss.view); gtk_container_add (GTK_CONTAINER (w), ss.view); diff --git a/src/interface.cpp b/src/interface.cpp index 0fd2b65ea..551e2bf91 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -8,6 +8,7 @@ * Jon A. Cruz * Abhishek Sharma * + * Copyright (C) 2010 authors * Copyright (C) 1999-2005 authors * Copyright (C) 2001-2002 Ximian, Inc. * Copyright (C) 2004 David Turner @@ -272,7 +273,9 @@ sp_create_window(SPViewWidget *vw, gboolean editable) win->show(); // needed because the first ACTIVATE_DESKTOP was sent when there was no window yet - inkscape_reactivate_desktop(SP_DESKTOP_WIDGET(vw)->desktop); + if ( SP_IS_DESKTOP_WIDGET(vw) ) { + inkscape_reactivate_desktop(SP_DESKTOP_WIDGET(vw)->desktop); + } } void @@ -294,20 +297,16 @@ sp_ui_new_view() /* TODO: not yet working */ /* To be re-enabled (by adding to menu) once it works. */ -void -sp_ui_new_view_preview() +void sp_ui_new_view_preview() { - SPDocument *document; - SPViewWidget *dtw; - - document = SP_ACTIVE_DOCUMENT; - if (!document) return; + SPDocument *document = SP_ACTIVE_DOCUMENT; + if ( document ) { + SPViewWidget *dtw = reinterpret_cast(sp_svg_view_widget_new(document)); + g_return_if_fail(dtw != NULL); + SP_SVG_VIEW_WIDGET(dtw)->setResize(true, 400.0, 400.0); - dtw = (SPViewWidget *) sp_svg_view_widget_new(document); - g_return_if_fail(dtw != NULL); - sp_svg_view_widget_set_resize(SP_SVG_VIEW_WIDGET(dtw), TRUE, 400.0, 400.0); - - sp_create_window(dtw, FALSE); + sp_create_window(dtw, FALSE); + } } /** diff --git a/src/knot.h b/src/knot.h index 32035d603..24a86282e 100644 --- a/src/knot.h +++ b/src/knot.h @@ -16,7 +16,6 @@ #include #include -#include "display/display-forward.h" #include "forward.h" #include <2geom/point.h> #include "knot-enums.h" @@ -24,6 +23,7 @@ class SPKnot; class SPKnotClass; +struct SPCanvasItem; #define SP_TYPE_KNOT (sp_knot_get_type()) #define SP_KNOT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SP_TYPE_KNOT, SPKnot)) diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index 681bae387..6acba000c 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -10,7 +10,6 @@ */ -#include "display/display-forward.h" #include #include #include <2geom/forward.h> @@ -29,6 +28,7 @@ class SPLPEItem; class KnotHolder; class KnotHolderEntity; class SPPath; +struct SPCurve; namespace Gtk { class Widget; diff --git a/src/pen-context.cpp b/src/pen-context.cpp index 6778d4bcc..607bdaedc 100644 --- a/src/pen-context.cpp +++ b/src/pen-context.cpp @@ -31,6 +31,7 @@ #include "message-context.h" #include "preferences.h" #include "sp-path.h" +#include "display/sp-canvas.h" #include "display/curve.h" #include "pixmaps/cursor-pen.xpm" #include "display/canvas-bpath.h" diff --git a/src/pencil-context.cpp b/src/pencil-context.cpp index 0717724de..a873eb6fc 100644 --- a/src/pencil-context.cpp +++ b/src/pencil-context.cpp @@ -41,6 +41,7 @@ #include "document.h" #include "desktop-style.h" #include "macros.h" +#include "display/sp-canvas.h" #include "display/curve.h" #include "livarot/Path.h" diff --git a/src/rubberband.cpp b/src/rubberband.cpp index 17e7102f8..398f01d3e 100644 --- a/src/rubberband.cpp +++ b/src/rubberband.cpp @@ -1,5 +1,3 @@ -#define __RUBBERBAND_C__ - /** * \file src/rubberband.cpp * \brief Rubberbanding selector @@ -16,6 +14,8 @@ #include "desktop.h" #include "desktop-handles.h" #include "rubberband.h" +#include "display/sp-canvas.h" +#include "display/sp-canvas-item.h" #include "display/canvas-bpath.h" #include "display/curve.h" diff --git a/src/rubberband.h b/src/rubberband.h index 57e4ea2a3..6c857fb63 100644 --- a/src/rubberband.h +++ b/src/rubberband.h @@ -1,5 +1,5 @@ -#ifndef __RUBBERBAND_H__ -#define __RUBBERBAND_H__ +#ifndef SEEN_RUBBERBAND_H +#define SEEN_RUBBERBAND_H /** * \file src/rubberband.h @@ -74,7 +74,7 @@ private: } -#endif +#endif // SEEN_RUBBERBAND_H /* Local Variables: diff --git a/src/select-context.cpp b/src/select-context.cpp index 96758a9f1..4a8b38c37 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -5,7 +5,9 @@ * Lauris Kaplinski * bulia byak * Abhishek Sharma + * Jon A. Cruz * + * Copyright (C) 2010 authors * Copyright (C) 2006 Johan Engelen * Copyright (C) 1999-2005 Authors * @@ -40,6 +42,7 @@ #include "selection-describer.h" #include "seltrans.h" #include "box3d.h" +#include "display/sp-canvas.h" #include "display/nr-arena-item.h" using Inkscape::DocumentUndo; diff --git a/src/seltrans-handles.cpp b/src/seltrans-handles.cpp index d3197a062..10b87aaff 100644 --- a/src/seltrans-handles.cpp +++ b/src/seltrans-handles.cpp @@ -1,5 +1,3 @@ -#define SP_SELTRANS_HANDLES_C - #include "seltrans-handles.h" diff --git a/src/seltrans-handles.h b/src/seltrans-handles.h index 4a0dd0bf7..f796a1007 100644 --- a/src/seltrans-handles.h +++ b/src/seltrans-handles.h @@ -1,5 +1,5 @@ -#ifndef __SP_SELTRANS_HANDLES_H__ -#define __SP_SELTRANS_HANDLES_H__ +#ifndef SEEN_SP_SELTRANS_HANDLES_H +#define SEEN_SP_SELTRANS_HANDLES_H /* * Seltrans knots @@ -14,6 +14,7 @@ #include "display/sodipodi-ctrl.h" #include <2geom/forward.h> +#include namespace Inkscape { @@ -50,9 +51,22 @@ struct SPSelTransHandle { gdouble x, y; }; +// TODO these must be purged: extern SPSelTransHandle const handles_scale[8]; extern SPSelTransHandle const handles_rotate[8]; extern SPSelTransHandle const handle_center; -#endif +#endif // SEEN_SP_SELTRANS_HANDLES_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/sp-conn-end-pair.h b/src/sp-conn-end-pair.h index 3b011ed17..fa585d618 100644 --- a/src/sp-conn-end-pair.h +++ b/src/sp-conn-end-pair.h @@ -22,6 +22,8 @@ class SPConnEnd; +struct SPCurve; + namespace Inkscape { namespace XML { class Node; diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp index f92d79116..a0186a37d 100644 --- a/src/sp-guide.cpp +++ b/src/sp-guide.cpp @@ -23,6 +23,7 @@ #include #include #include "desktop-handles.h" +#include "display/sp-canvas.h" #include "display/guideline.h" #include "svg/svg.h" #include "svg/stringstream.h" diff --git a/src/sp-guide.h b/src/sp-guide.h index 4fc4032db..f9f67f301 100644 --- a/src/sp-guide.h +++ b/src/sp-guide.h @@ -15,11 +15,13 @@ #include -#include "display/display-forward.h" #include <2geom/point.h> #include "sp-object.h" #include "sp-guide-attachment.h" +struct SPCanvas; +struct SPCanvasGroup; + #define SP_TYPE_GUIDE (sp_guide_get_type()) #define SP_GUIDE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SP_TYPE_GUIDE, SPGuide)) #define SP_GUIDE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SP_TYPE_GUIDE, SPGuideClass)) diff --git a/src/sp-image.h b/src/sp-image.h index 172cd7118..9618c9873 100644 --- a/src/sp-image.h +++ b/src/sp-image.h @@ -29,7 +29,6 @@ class SPImageClass; #include #include "svg/svg-length.h" #include "sp-item.h" -#include "display/display-forward.h" #define SP_IMAGE_HREF_MODIFIED_FLAG SP_OBJECT_USER_MODIFIED_FLAG_A diff --git a/src/sp-lpe-item.h b/src/sp-lpe-item.h index 1af7f2797..d1baa4309 100644 --- a/src/sp-lpe-item.h +++ b/src/sp-lpe-item.h @@ -15,7 +15,6 @@ */ #include "sp-item.h" -#include "display/display-forward.h" #include @@ -26,12 +25,17 @@ #define SP_IS_LPE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_LPE_ITEM)) struct LivePathEffectObject; +struct SPCurve; + namespace Inkscape{ +namespace Display { + class TemporaryItem; +} namespace LivePathEffect{ class LPEObjectReference; class Effect; -}; -}; +} +} typedef std::list PathEffectList; diff --git a/src/sp-path.h b/src/sp-path.h index bf294c37c..5cfa34913 100644 --- a/src/sp-path.h +++ b/src/sp-path.h @@ -1,5 +1,5 @@ -#ifndef __SP_PATH_H__ -#define __SP_PATH_H__ +#ifndef SEEN_SP_PATH_H +#define SEEN_SP_PATH_H /* * SVG implementation @@ -16,6 +16,7 @@ #include "sp-shape.h" #include "sp-conn-end-pair.h" +struct SPCurve; #define SP_TYPE_PATH (sp_path_get_type ()) #define SP_PATH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_PATH, SPPath)) @@ -39,7 +40,7 @@ SPCurve* sp_path_get_original_curve (SPPath *path); SPCurve* sp_path_get_curve_for_edit (SPPath *path); const SPCurve* sp_path_get_curve_reference (SPPath *path); -#endif +#endif // SEEN_SP_PATH_H /* Local Variables: diff --git a/src/sp-shape.h b/src/sp-shape.h index 78855c1c7..493268711 100644 --- a/src/sp-shape.h +++ b/src/sp-shape.h @@ -16,7 +16,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "display/display-forward.h" #include "sp-lpe-item.h" #include "sp-marker-loc.h" #include <2geom/forward.h> diff --git a/src/spray-context.cpp b/src/spray-context.cpp index 0cf74f59b..6d19cbce4 100644 --- a/src/spray-context.cpp +++ b/src/spray-context.cpp @@ -27,7 +27,6 @@ #include #include "svg/svg.h" -#include "display/canvas-bpath.h" #include #include "macros.h" @@ -62,6 +61,7 @@ #include "gradient-chemistry.h" #include "sp-text.h" #include "sp-flowtext.h" +#include "display/sp-canvas.h" #include "display/canvas-bpath.h" #include "display/canvas-arena.h" #include "display/curve.h" diff --git a/src/spray-context.h b/src/spray-context.h index b559fa593..edb872117 100644 --- a/src/spray-context.h +++ b/src/spray-context.h @@ -19,7 +19,6 @@ */ #include "event-context.h" -#include #include //#include "ui/widget/spray-option.h" #include "ui/dialog/dialog.h" diff --git a/src/svg-view-widget.cpp b/src/svg-view-widget.cpp index d2a31966a..777c1b496 100644 --- a/src/svg-view-widget.cpp +++ b/src/svg-view-widget.cpp @@ -5,7 +5,9 @@ * Lauris Kaplinski * Ralf Stephan * Abhishek Sharma + * Jon A. Cruz * + * Copyright (C) 2010 authors * Copyright (C) 2001-2002 Lauris Kaplinski * Copyright (C) 2001 Ximian, Inc. * @@ -13,6 +15,8 @@ */ #include +#include "display/sp-canvas.h" +#include "display/sp-canvas-group.h" #include "display/canvas-arena.h" #include "document.h" #include "svg-view.h" @@ -220,22 +224,18 @@ sp_svg_view_widget_new (SPDocument *doc) /** * Flags the SPSVGSPViewWidget to have its size renegotiated with Gtk. */ -void -sp_svg_view_widget_set_resize (SPSVGSPViewWidget *vw, bool resize, gdouble width, gdouble height) +void SPSVGSPViewWidget::setResize(bool resize, gdouble width, gdouble height) { - g_return_if_fail (vw != NULL); + g_return_if_fail( !resize || (width > 0.0) ); + g_return_if_fail( !resize || (height > 0.0) ); - g_return_if_fail (SP_IS_SVG_VIEW_WIDGET (vw)); - g_return_if_fail (!resize || (width > 0.0)); - g_return_if_fail (!resize || (height > 0.0)); + this->resize = resize; + this->maxwidth = width; + this->maxheight = height; - vw->resize = resize; - vw->maxwidth = width; - vw->maxheight = height; - - if (resize) { - gtk_widget_queue_resize (GTK_WIDGET (vw)); - } + if ( resize ) { + gtk_widget_queue_resize( GTK_WIDGET(this) ); + } } diff --git a/src/svg-view-widget.h b/src/svg-view-widget.h index cd609b07a..e732841c7 100644 --- a/src/svg-view-widget.h +++ b/src/svg-view-widget.h @@ -1,19 +1,20 @@ -#ifndef __SP_SVG_VIEW_WIDGET_H__ -#define __SP_SVG_VIEW_WIDGET_H__ +#ifndef SEEN_SP_SVG_VIEW_WIDGET_H +#define SEEN_SP_SVG_VIEW_WIDGET_H /** \file * SPSVGView, SPSVGSPViewWidget: Generic SVG view and widget * * Authors: * Lauris Kaplinski + * Jon A. Cruz * + * Copyright (C) 2010 Authors * Copyright (C) 2001-2002 Lauris Kaplinski * Copyright (C) 2001 Ximian, Inc. * * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "display/display-forward.h" #include "ui/view/view-widget.h" class SPDocument; @@ -30,33 +31,39 @@ GtkType sp_svg_view_widget_get_type (void); GtkWidget *sp_svg_view_widget_new (SPDocument *doc); -void sp_svg_view_widget_set_resize (SPSVGSPViewWidget *vw, bool resize, gdouble width, gdouble height); - /** * An SPSVGSPViewWidget is an SVG view together with a canvas. */ struct SPSVGSPViewWidget { - public: - SPViewWidget widget; +public: + SPViewWidget widget; - GtkWidget *sw; - GtkWidget *canvas; + GtkWidget *sw; + GtkWidget *canvas; - /// Whether to resize automatically - bool resize; - gdouble maxwidth, maxheight; + /// Whether to resize automatically + bool resize; + gdouble maxwidth, maxheight; // C++ Wrappers /// Flags the SPSVGSPViewWidget to have its size changed with Gtk. - void setResize(bool resize, gdouble width, gdouble height) { - sp_svg_view_widget_set_resize(this, resize, width, height); - } + void setResize(bool resize, gdouble width, gdouble height); }; /// The SPSVGSPViewWidget vtable. struct SPSVGSPViewWidgetClass { - SPViewWidgetClass parent_class; + SPViewWidgetClass parent_class; }; -#endif +#endif // SEEN_SP_SVG_VIEW_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:fileencoding=utf-8:textwidth=99 : diff --git a/src/svg-view.cpp b/src/svg-view.cpp index ef87b38ef..b35375736 100644 --- a/src/svg-view.cpp +++ b/src/svg-view.cpp @@ -14,7 +14,6 @@ */ #include "display/canvas-arena.h" -#include "display/display-forward.h" #include "document.h" #include "sp-item.h" #include "svg-view.h" diff --git a/src/text-context.h b/src/text-context.h index a6e2e8db7..2cceaebb2 100644 --- a/src/text-context.h +++ b/src/text-context.h @@ -19,7 +19,6 @@ #include #include "event-context.h" -#include #include <2geom/point.h> #include "libnrtype/Layout-TNG.h" diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp index 1d0c004a4..3b93c659b 100644 --- a/src/tweak-context.cpp +++ b/src/tweak-context.cpp @@ -20,7 +20,6 @@ #include #include "svg/svg.h" -#include "display/canvas-bpath.h" #include #include "macros.h" @@ -61,6 +60,7 @@ #include "gradient-chemistry.h" #include "sp-text.h" #include "sp-flowtext.h" +#include "display/sp-canvas.h" #include "display/canvas-bpath.h" #include "display/canvas-arena.h" #include "display/curve.h" diff --git a/src/tweak-context.h b/src/tweak-context.h index ad688b025..542254b91 100644 --- a/src/tweak-context.h +++ b/src/tweak-context.h @@ -13,7 +13,6 @@ */ #include "event-context.h" -#include #include #define SP_TYPE_TWEAK_CONTEXT (sp_tweak_context_get_type()) diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp index 8db5e7c0b..61851c56c 100644 --- a/src/ui/dialog/aboutbox.cpp +++ b/src/ui/dialog/aboutbox.cpp @@ -165,7 +165,7 @@ Gtk::Widget *build_splash_widget() { doc->doUnref(); - sp_svg_view_widget_set_resize(SP_SVG_VIEW_WIDGET(v), FALSE, (int)width, (int)height); + SP_SVG_VIEW_WIDGET(v)->setResize(false, static_cast(width), static_cast(height)); Gtk::AspectFrame *frame=new Gtk::AspectFrame(); frame->unset_label(); diff --git a/src/ui/tool/control-point-selection.h b/src/ui/tool/control-point-selection.h index 3aed6ae93..6a5b05e85 100644 --- a/src/ui/tool/control-point-selection.h +++ b/src/ui/tool/control-point-selection.h @@ -18,13 +18,13 @@ #include <2geom/forward.h> #include <2geom/point.h> #include <2geom/rect.h> -#include "display/display-forward.h" #include "util/accumulators.h" #include "util/unordered-containers.h" #include "ui/tool/commit-events.h" #include "ui/tool/manipulator.h" class SPDesktop; +struct SPCanvasGroup; namespace Inkscape { namespace UI { diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp index d5e5b7dfe..38b421553 100644 --- a/src/ui/tool/control-point.cpp +++ b/src/ui/tool/control-point.cpp @@ -14,6 +14,7 @@ #include <2geom/point.h> #include "desktop.h" #include "desktop-handles.h" +#include "display/sp-canvas.h" #include "display/snap-indicator.h" #include "event-context.h" #include "message-context.h" diff --git a/src/ui/tool/control-point.h b/src/ui/tool/control-point.h index 4de5e5847..3f5fe668d 100644 --- a/src/ui/tool/control-point.h +++ b/src/ui/tool/control-point.h @@ -17,7 +17,6 @@ #include #include <2geom/point.h> -#include "display/display-forward.h" #include "forward.h" #include "util/accumulators.h" #include "display/sodipodi-ctrl.h" diff --git a/src/ui/tool/multi-path-manipulator.h b/src/ui/tool/multi-path-manipulator.h index ddb74c1bc..aef9c1ac9 100644 --- a/src/ui/tool/multi-path-manipulator.h +++ b/src/ui/tool/multi-path-manipulator.h @@ -12,7 +12,6 @@ #define SEEN_UI_TOOL_MULTI_PATH_MANIPULATOR_H #include -#include "display/display-forward.h" #include "forward.h" #include "ui/tool/commit-events.h" #include "ui/tool/manipulator.h" diff --git a/src/ui/tool/node-tool.cpp b/src/ui/tool/node-tool.cpp index 8661e7946..e75f31370 100644 --- a/src/ui/tool/node-tool.cpp +++ b/src/ui/tool/node-tool.cpp @@ -13,6 +13,7 @@ #include #include "desktop.h" #include "desktop-handles.h" +#include "display/sp-canvas-group.h" #include "display/canvas-bpath.h" #include "display/curve.h" #include "display/sp-canvas.h" diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h index 4d38e69e2..bcf6a8d5e 100644 --- a/src/ui/tool/node-tool.h +++ b/src/ui/tool/node-tool.h @@ -17,7 +17,6 @@ #include #include "event-context.h" #include "forward.h" -#include "display/display-forward.h" #include "ui/tool/node-types.h" #define INK_TYPE_NODE_TOOL (ink_node_tool_get_type ()) @@ -30,13 +29,17 @@ class InkNodeTool; class InkNodeToolClass; namespace Inkscape { + +namespace Display { +class TemporaryItem; +} // namespace Display namespace UI { class MultiPathManipulator; class ControlPointSelection; class Selector; struct PathSharedData; -} -} +} // namespace UI +} // namespace Inkscape typedef std::auto_ptr MultiPathPtr; typedef std::auto_ptr CSelPtr; diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h index 8a0167e59..58907ea96 100644 --- a/src/ui/tool/path-manipulator.h +++ b/src/ui/tool/path-manipulator.h @@ -17,12 +17,12 @@ #include <2geom/matrix.h> #include #include -#include "display/display-forward.h" #include "forward.h" #include "ui/tool/node.h" #include "ui/tool/manipulator.h" struct SPCanvasItem; +struct SPCurve; namespace Inkscape { namespace XML { class Node; } diff --git a/src/ui/tool/selector.h b/src/ui/tool/selector.h index e61668d9e..05d72c208 100644 --- a/src/ui/tool/selector.h +++ b/src/ui/tool/selector.h @@ -14,7 +14,6 @@ #include #include #include <2geom/rect.h> -#include "display/display-forward.h" #include "ui/tool/manipulator.h" class SPDesktop; diff --git a/src/ui/tool/transform-handle-set.h b/src/ui/tool/transform-handle-set.h index 2a4df8751..b18c598ee 100644 --- a/src/ui/tool/transform-handle-set.h +++ b/src/ui/tool/transform-handle-set.h @@ -14,12 +14,11 @@ #include #include #include <2geom/forward.h> -#include "display/display-forward.h" #include "ui/tool/commit-events.h" #include "ui/tool/manipulator.h" class SPDesktop; -class CtrlRect; // this is not present in display-forward.h! +class CtrlRect; namespace Inkscape { namespace UI { diff --git a/src/ui/widget/ruler.cpp b/src/ui/widget/ruler.cpp index 107f4e8c6..1a6455ca0 100644 --- a/src/ui/widget/ruler.cpp +++ b/src/ui/widget/ruler.cpp @@ -26,6 +26,7 @@ #include "ui/widget/ruler.h" #include "xml/repr.h" +#include "display/sp-canvas.h" #include "display/guideline.h" #include "desktop.h" #include "desktop-handles.h" diff --git a/src/ui/widget/svg-canvas.cpp b/src/ui/widget/svg-canvas.cpp index 64657296d..7d37ec355 100644 --- a/src/ui/widget/svg-canvas.cpp +++ b/src/ui/widget/svg-canvas.cpp @@ -12,8 +12,8 @@ #include #include "desktop.h" #include "desktop-events.h" +#include "display/sp-canvas.h" #include "display/canvas-arena.h" -#include "display/display-forward.h" #include "ui/widget/svg-canvas.h" namespace Inkscape { diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 3509a1040..be2caa5ee 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -33,6 +33,7 @@ #include "desktop-events.h" #include "desktop-handles.h" #include "desktop-widget.h" +#include "display/sp-canvas.h" #include "display/canvas-arena.h" #include "display/nr-arena.h" #include "document.h" diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index 4edd434af..1bb10fc51 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -15,7 +15,6 @@ #include #include -#include "display/display-forward.h" #include "libnr/nr-point.h" #include "forward.h" #include "sp-object.h" @@ -27,6 +26,7 @@ // forward declaration typedef struct _EgeColorProfTracker EgeColorProfTracker; +struct SPCanvas; #define SP_TYPE_DESKTOP_WIDGET SPDesktopWidget::getType() diff --git a/src/zoom-context.cpp b/src/zoom-context.cpp index f8212069e..45de37652 100644 --- a/src/zoom-context.cpp +++ b/src/zoom-context.cpp @@ -1,5 +1,3 @@ -#define __SP_ZOOM_CONTEXT_C__ - /* * Handy zooming tool * @@ -18,6 +16,7 @@ #include "macros.h" #include "rubberband.h" +#include "display/sp-canvas-item.h" #include "display/sp-canvas-util.h" #include "desktop.h" #include "pixmaps/cursor-zoom.xpm"