diff options
| author | Markus Engel <markus.engel@tum.de> | 2013-04-05 19:07:38 +0000 |
|---|---|---|
| committer | Markus Engel <markus.engel@tum.de> | 2013-04-05 19:07:38 +0000 |
| commit | 61003d31ea058fdf94f4f80c753c3e38426f35e4 (patch) | |
| tree | de30fe5c58fc71682c9544448f8ef7f79de673cf /src/sp-flowdiv.h | |
| parent | Merged more classes. (diff) | |
| download | inkscape-61003d31ea058fdf94f4f80c753c3e38426f35e4.tar.gz inkscape-61003d31ea058fdf94f4f80c753c3e38426f35e4.zip | |
Merged FlowX classes.
(bzr r11608.1.79)
Diffstat (limited to 'src/sp-flowdiv.h')
| -rw-r--r-- | src/sp-flowdiv.h | 124 |
1 files changed, 20 insertions, 104 deletions
diff --git a/src/sp-flowdiv.h b/src/sp-flowdiv.h index f95c81a69..a4973cb9d 100644 --- a/src/sp-flowdiv.h +++ b/src/sp-flowdiv.h @@ -7,89 +7,26 @@ #include "sp-object.h" #include "sp-item.h" -#define SP_TYPE_FLOWDIV (sp_flowdiv_get_type ()) #define SP_FLOWDIV(obj) ((SPFlowdiv*)obj) -#define SP_IS_FLOWDIV(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPFlowdiv))) +#define SP_IS_FLOWDIV(obj) (dynamic_cast<const SPFlowdiv*>((SPObject*)obj)) -#define SP_TYPE_FLOWTSPAN (sp_flowtspan_get_type ()) #define SP_FLOWTSPAN(obj) ((SPFlowtspan*)obj) -#define SP_IS_FLOWTSPAN(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPFlowtspan))) +#define SP_IS_FLOWTSPAN(obj) (dynamic_cast<const SPFlowtspan*>((SPObject*)obj)) -#define SP_TYPE_FLOWPARA (sp_flowpara_get_type ()) #define SP_FLOWPARA(obj) ((SPFlowpara*)obj) -#define SP_IS_FLOWPARA(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPFlowpara))) +#define SP_IS_FLOWPARA(obj) (dynamic_cast<const SPFlowpara*>((SPObject*)obj)) -#define SP_TYPE_FLOWLINE (sp_flowline_get_type ()) #define SP_FLOWLINE(obj) ((SPFlowline*)obj) -#define SP_IS_FLOWLINE(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPFlowline))) +#define SP_IS_FLOWLINE(obj) (dynamic_cast<const SPFlowline*>((SPObject*)obj)) -#define SP_TYPE_FLOWREGIONBREAK (sp_flowregionbreak_get_type ()) #define SP_FLOWREGIONBREAK(obj) ((SPFlowregionbreak*)obj) -#define SP_IS_FLOWREGIONBREAK(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPFlowregionbreak))) - -class CFlowdiv; -class CFlowtspan; -class CFlowpara; -class CFlowline; -class CFlowregionbreak; +#define SP_IS_FLOWREGIONBREAK(obj) (dynamic_cast<const SPFlowregionbreak*>((SPObject*)obj)) // these 3 are derivatives of SPItem to get the automatic style handling -class SPFlowdiv : public SPItem { +class SPFlowdiv : public SPItem, public CItem { public: SPFlowdiv(); - CFlowdiv* cflowdiv; -}; - -class SPFlowtspan : public SPItem { -public: - SPFlowtspan(); - CFlowtspan* cflowtspan; -}; - -class SPFlowpara : public SPItem { -public: - SPFlowpara(); - CFlowpara* cflowpara; -}; - -// these do not need any style -class SPFlowline : public SPObject { -public: - SPFlowline(); - CFlowline* cflowline; -}; - -class SPFlowregionbreak : public SPObject { -public: - SPFlowregionbreak(); - CFlowregionbreak* cflowregionbreak; -}; - -struct SPFlowdivClass { - SPItemClass parent_class; -}; - -struct SPFlowtspanClass { - SPItemClass parent_class; -}; - -struct SPFlowparaClass { - SPItemClass parent_class; -}; - -struct SPFlowlineClass { - SPObjectClass parent_class; -}; - -struct SPFlowregionbreakClass { - SPObjectClass parent_class; -}; - - -class CFlowdiv : public CItem { -public: - CFlowdiv(SPFlowdiv* flowdiv); - virtual ~CFlowdiv(); + virtual ~SPFlowdiv(); virtual void build(SPDocument *document, Inkscape::XML::Node *repr); virtual void release(); @@ -98,15 +35,12 @@ public: virtual void set(unsigned int key, gchar const* value); virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags); - -protected: - SPFlowdiv* spflowdiv; }; -class CFlowtspan : public CItem { +class SPFlowtspan : public SPItem, public CItem { public: - CFlowtspan(SPFlowtspan* flowtspan); - virtual ~CFlowtspan(); + SPFlowtspan(); + virtual ~SPFlowtspan(); virtual void build(SPDocument *document, Inkscape::XML::Node *repr); virtual void release(); @@ -115,15 +49,12 @@ public: virtual void set(unsigned int key, gchar const* value); virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags); - -protected: - SPFlowtspan* spflowtspan; }; -class CFlowpara : public CItem { +class SPFlowpara : public SPItem, public CItem { public: - CFlowpara(SPFlowpara* flowpara); - virtual ~CFlowpara(); + SPFlowpara(); + virtual ~SPFlowpara(); virtual void build(SPDocument *document, Inkscape::XML::Node *repr); virtual void release(); @@ -132,44 +63,29 @@ public: virtual void set(unsigned int key, gchar const* value); virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags); - -protected: - SPFlowpara* spflowpara; }; -class CFlowline : public CObject { +// these do not need any style +class SPFlowline : public SPObject, public CObject { public: - CFlowline(SPFlowline* flowline); - virtual ~CFlowline(); + SPFlowline(); + virtual ~SPFlowline(); virtual void release(); virtual void modified(unsigned int flags); virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags); - -protected: - SPFlowline* spflowline; }; -class CFlowregionbreak : public CObject { +class SPFlowregionbreak : public SPObject, public CObject { public: - CFlowregionbreak(SPFlowregionbreak* flowregionbreak); - virtual ~CFlowregionbreak(); + SPFlowregionbreak(); + virtual ~SPFlowregionbreak(); virtual void release(); virtual void modified(unsigned int flags); virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags); - -protected: - SPFlowregionbreak* spflowregionbreak; }; - -GType sp_flowdiv_get_type (void); -GType sp_flowtspan_get_type (void); -GType sp_flowpara_get_type (void); -GType sp_flowline_get_type (void); -GType sp_flowregionbreak_get_type (void); - #endif |
