diff options
Diffstat (limited to 'src/sp-offset.h')
| -rw-r--r-- | src/sp-offset.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/sp-offset.h b/src/sp-offset.h index 904f8607c..360bfbf94 100644 --- a/src/sp-offset.h +++ b/src/sp-offset.h @@ -16,11 +16,8 @@ #include <stddef.h> #include <sigc++/sigc++.h> -#define SP_TYPE_OFFSET (sp_offset_get_type ()) -#define SP_OFFSET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_OFFSET, SPOffset)) -#define SP_OFFSET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_OFFSET, SPOffsetClass)) -#define SP_IS_OFFSET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_OFFSET)) -#define SP_IS_OFFSET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_OFFSET)) +#define SP_OFFSET(obj) (dynamic_cast<SPOffset*>((SPObject*)obj)) +#define SP_IS_OFFSET(obj) (dynamic_cast<const SPOffset*>((SPObject*)obj) != NULL) class SPUseReference; @@ -52,7 +49,11 @@ class SPUseReference; * points, or more precisely one control point, that's enough to define the * radius (look in object-edit). */ -struct SPOffset : public SPShape { +class SPOffset : public SPShape { +public: + SPOffset(); + virtual ~SPOffset(); + void *originalPath; ///< will be a livarot Path, just don't declare it here to please the gcc linker char *original; ///< SVG description of the source path float rad; ///< offset radius @@ -73,17 +74,19 @@ struct SPOffset : public SPShape { sigc::connection _delete_connection; sigc::connection _changed_connection; sigc::connection _transformed_connection; -}; -/// The SPOffset vtable. -struct SPOffsetClass -{ - SPShapeClass parent_class; -}; + virtual void build(SPDocument *document, Inkscape::XML::Node *repr); + virtual void set(unsigned int key, gchar const* value); + virtual void update(SPCtx *ctx, guint flags); + virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags); + virtual void release(); + virtual void snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs); + virtual const char* display_name(); + virtual gchar* description(); -/* Standard Gtk function */ -GType sp_offset_get_type (void); + virtual void set_shape(); +}; double sp_offset_distance_to_original (SPOffset * offset, Geom::Point px); void sp_offset_top_point (SPOffset const *offset, Geom::Point *px); |
