summaryrefslogtreecommitdiffstats
path: root/src/sp-switch.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp-switch.h')
-rw-r--r--src/sp-switch.h49
1 files changed, 14 insertions, 35 deletions
diff --git a/src/sp-switch.h b/src/sp-switch.h
index 24a204731..210cd0ddc 100644
--- a/src/sp-switch.h
+++ b/src/sp-switch.h
@@ -17,52 +17,31 @@
#include <stddef.h>
#include <sigc++/connection.h>
-G_BEGIN_DECLS
+#define SP_SWITCH(obj) (dynamic_cast<SPSwitch*>((SPObject*)obj))
+#define SP_IS_SWITCH(obj) (dynamic_cast<const SPSwitch*>((SPObject*)obj) != NULL)
-#define SP_TYPE_SWITCH (sp_switch_get_type())
-#define SP_SWITCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_SWITCH, SPSwitch))
-#define SP_SWITCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_SWITCH, SPSwitchClass))
-#define SP_IS_SWITCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_SWITCH))
-#define SP_IS_SWITCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_SWITCH))
-
-GType sp_switch_get_type() G_GNUC_CONST;
-
-/*
- * Virtual methods of SPSwitch
- */
-class CSwitch : public CGroup {
+class SPSwitch : public SPGroup {
public:
- CSwitch(SPGroup *group);
- virtual ~CSwitch();
+ SPSwitch();
+ virtual ~SPSwitch();
+
+ void resetChildEvaluated() { _reevaluate(); }
- friend struct SPSwitch;
-
- virtual void onChildAdded(Inkscape::XML::Node *child);
- virtual void onChildRemoved(Inkscape::XML::Node *child);
- virtual void onOrderChanged(Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref);
- virtual gchar *getDescription();
+ GSList *_childList(bool add_ref, SPObject::Action action);
+ void _showChildren (Inkscape::Drawing &drawing, Inkscape::DrawingItem *ai, unsigned int key, unsigned int flags);
-protected:
- virtual GSList *_childList(bool add_ref, SPObject::Action action);
- virtual void _showChildren (Inkscape::Drawing &drawing, Inkscape::DrawingItem *ai, unsigned int key, unsigned int flags);
-
SPObject *_evaluateFirst();
void _reevaluate(bool add_to_arena = false);
- static void _releaseItem(SPObject *obj, CSwitch *selection);
+ static void _releaseItem(SPObject *obj, SPSwitch *selection);
void _releaseLastItem(SPObject *obj);
-private:
SPObject *_cached_item;
sigc::connection _release_connection;
-};
-
-struct SPSwitch : public SPGroup {
- void resetChildEvaluated() { (static_cast<CSwitch *>(group))->_reevaluate(); }
-};
-struct SPSwitchClass : public SPGroupClass {
+ virtual void child_added(Inkscape::XML::Node* child, Inkscape::XML::Node* ref);
+ virtual void remove_child(Inkscape::XML::Node *child);
+ virtual void order_changed(Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref);
+ virtual gchar *description();
};
-G_END_DECLS
-
#endif