summaryrefslogtreecommitdiffstats
path: root/src/sp-guide.cpp
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-04-01 23:41:30 +0000
committerMarkus Engel <markus.engel@tum.de>2013-04-01 23:41:30 +0000
commit69f3b6f1abb2bb422935d43262e1e99aab359954 (patch)
treee1e2d2b0504d22e81b04501155995f5694a4cd7b /src/sp-guide.cpp
parentAdded experimental constructor to SPRect. Memory leaks because of non-virtual... (diff)
downloadinkscape-69f3b6f1abb2bb422935d43262e1e99aab359954.tar.gz
inkscape-69f3b6f1abb2bb422935d43262e1e99aab359954.zip
Added constructors to SP classes.
(bzr r11608.1.67)
Diffstat (limited to 'src/sp-guide.cpp')
-rw-r--r--src/sp-guide.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp
index 9083a6ef7..c1fbb1d65 100644
--- a/src/sp-guide.cpp
+++ b/src/sp-guide.cpp
@@ -56,7 +56,7 @@ enum {
static void sp_guide_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void sp_guide_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-G_DEFINE_TYPE(SPGuide, sp_guide, SP_TYPE_OBJECT);
+G_DEFINE_TYPE(SPGuide, sp_guide, G_TYPE_OBJECT);
static void sp_guide_class_init(SPGuideClass *gc)
{
@@ -89,20 +89,29 @@ CGuide::CGuide(SPGuide* guide) : CObject(guide) {
CGuide::~CGuide() {
}
-static void sp_guide_init(SPGuide *guide)
-{
+SPGuide::SPGuide() : SPObject() {
+ SPGuide* guide = this;
+
guide->cguide = new CGuide(guide);
guide->typeHierarchy.insert(typeid(SPGuide));
delete guide->cobject;
guide->cobject = guide->cguide;
+ guide->label = NULL;
+ guide->views = NULL;
+
guide->normal_to_line = Geom::Point(0.,1.);
guide->point_on_line = Geom::Point(0.,0.);
guide->color = 0x0000ff7f;
guide->hicolor = 0xff00007f;
}
+static void sp_guide_init(SPGuide *guide)
+{
+ new (guide) SPGuide();
+}
+
static void sp_guide_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec */*pspec*/)
{
SPGuide &guide = *SP_GUIDE(object);