summaryrefslogtreecommitdiffstats
path: root/src/draw-context.h
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-04-20 21:19:46 +0000
committerMarkus Engel <markus.engel@tum.de>2013-04-20 21:19:46 +0000
commit65ba6ad9a82f8f47974eb10665478fd783692bb5 (patch)
tree21ecad9197b19c636e7950503ea8f2a9a5366194 /src/draw-context.h
parentFurther changes to EventContexts; they work without GObject (diff)
downloadinkscape-65ba6ad9a82f8f47974eb10665478fd783692bb5.tar.gz
inkscape-65ba6ad9a82f8f47974eb10665478fd783692bb5.zip
Merging of EventContext classes complete.
(bzr r11608.1.98)
Diffstat (limited to 'src/draw-context.h')
-rw-r--r--src/draw-context.h27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/draw-context.h b/src/draw-context.h
index 25165eb27..4bc61461a 100644
--- a/src/draw-context.h
+++ b/src/draw-context.h
@@ -20,16 +20,10 @@
#include "event-context.h"
#include "live_effects/effect.h"
-G_BEGIN_DECLS
/* Freehand context */
-#define SP_TYPE_DRAW_CONTEXT (sp_draw_context_get_type())
-//#define SP_DRAW_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST((o), SP_TYPE_DRAW_CONTEXT, SPDrawContext))
-#define SP_DRAW_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), SP_TYPE_DRAW_CONTEXT, SPDrawContextClass))
-//#define SP_IS_DRAW_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SP_TYPE_DRAW_CONTEXT))
-#define SP_IS_DRAW_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), SP_TYPE_DRAW_CONTEXT))
#define SP_DRAW_CONTEXT(obj) ((SPDrawContext*)obj)
-#define SP_IS_DRAW_CONTEXT(obj) (((SPEventContext*)obj)->types.count(typeid(SPDrawContext)))
+#define SP_IS_DRAW_CONTEXT(obj) (dynamic_cast<const SPDrawContext*>((const SPEventContext*)obj))
struct SPDrawAnchor;
namespace Inkscape
@@ -37,12 +31,10 @@ namespace Inkscape
class Selection;
}
-class CDrawContext;
-
-class SPDrawContext : public SPEventContext{
+class SPDrawContext : public SPEventContext {
public:
SPDrawContext();
- CDrawContext* cdrawcontext;
+ virtual ~SPDrawContext();
Inkscape::Selection *selection;
SPCanvasItem *grab;
@@ -87,25 +79,13 @@ public:
bool red_curve_is_valid;
bool anchor_statusbar;
-};
-
-struct SPDrawContextClass : public SPEventContextClass{};
-
-class CDrawContext : public CEventContext {
-public:
- CDrawContext(SPDrawContext* drawcontext);
virtual void setup();
virtual void finish();
virtual void set(Inkscape::Preferences::Entry* val);
virtual gint root_handler(GdkEvent* event);
-
-protected:
- SPDrawContext* spdrawcontext;
};
-GType sp_draw_context_get_type(void) G_GNUC_CONST;
-
/**
* Returns FIRST active anchor (the activated one).
*/
@@ -141,7 +121,6 @@ void spdc_check_for_and_apply_waiting_LPE(SPDrawContext *dc, SPItem *item);
*/
void spdc_create_single_dot(SPEventContext *ec, Geom::Point const &pt, char const *tool, guint event_state);
-G_END_DECLS
#endif // SEEN_SP_DRAW_CONTEXT_H
/*