diff options
| author | Markus Engel <markus.engel@tum.de> | 2013-04-06 20:16:05 +0000 |
|---|---|---|
| committer | Markus Engel <markus.engel@tum.de> | 2013-04-06 20:16:05 +0000 |
| commit | 7b7e0294b0c06a8d3ec19b73486a91e12cf67adf (patch) | |
| tree | 842fb9e8768d87c73b35c0e10f5c69f10c154e09 /src/sp-glyph.cpp | |
| parent | Merged ObjectGroup and subclasses. (diff) | |
| download | inkscape-7b7e0294b0c06a8d3ec19b73486a91e12cf67adf.tar.gz inkscape-7b7e0294b0c06a8d3ec19b73486a91e12cf67adf.zip | |
Merged more classes.
(bzr r11608.1.84)
Diffstat (limited to 'src/sp-glyph.cpp')
| -rw-r--r-- | src/sp-glyph.cpp | 66 |
1 files changed, 23 insertions, 43 deletions
diff --git a/src/sp-glyph.cpp b/src/sp-glyph.cpp index 85c7beb4f..6acef4db9 100644 --- a/src/sp-glyph.cpp +++ b/src/sp-glyph.cpp @@ -32,51 +32,31 @@ namespace { bool glyphRegistered = SPFactory::instance().registerObject("svg:glyph", createGlyph); } -G_DEFINE_TYPE(SPGlyph, sp_glyph, G_TYPE_OBJECT); - -static void sp_glyph_class_init(SPGlyphClass *gc) -{ -} - -CGlyph::CGlyph(SPGlyph* glyph) : CObject(glyph) { - this->spglyph = glyph; -} - -CGlyph::~CGlyph() { -} - -SPGlyph::SPGlyph() : SPObject() { - SPGlyph* glyph = this; - - glyph->cglyph = new CGlyph(glyph); - glyph->typeHierarchy.insert(typeid(SPGlyph)); - - delete glyph->cobject; - glyph->cobject = glyph->cglyph; +SPGlyph::SPGlyph() : SPObject(), CObject(this) { + delete this->cobject; + this->cobject = this; //TODO: correct these values: - new (&glyph->unicode) Glib::ustring(); - new (&glyph->glyph_name) Glib::ustring(); - glyph->d = NULL; - glyph->orientation = GLYPH_ORIENTATION_BOTH; - glyph->arabic_form = GLYPH_ARABIC_FORM_INITIAL; - glyph->lang = NULL; - glyph->horiz_adv_x = 0; - glyph->vert_origin_x = 0; - glyph->vert_origin_y = 0; - glyph->vert_adv_y = 0; + new (&this->unicode) Glib::ustring(); + new (&this->glyph_name) Glib::ustring(); + this->d = NULL; + this->orientation = GLYPH_ORIENTATION_BOTH; + this->arabic_form = GLYPH_ARABIC_FORM_INITIAL; + this->lang = NULL; + this->horiz_adv_x = 0; + this->vert_origin_x = 0; + this->vert_origin_y = 0; + this->vert_adv_y = 0; } -static void sp_glyph_init(SPGlyph *glyph) -{ - new (glyph) SPGlyph(); +SPGlyph::~SPGlyph() { } -void CGlyph::build(SPDocument *document, Inkscape::XML::Node *repr) { +void SPGlyph::build(SPDocument *document, Inkscape::XML::Node *repr) { CObject::build(document, repr); - SPGlyph* object = this->spglyph; + SPGlyph* object = this; object->readAttr( "unicode" ); object->readAttr( "glyph-name" ); @@ -90,7 +70,7 @@ void CGlyph::build(SPDocument *document, Inkscape::XML::Node *repr) { object->readAttr( "vert-adv-y" ); } -void CGlyph::release() { +void SPGlyph::release() { CObject::release(); } @@ -125,8 +105,8 @@ static glyphOrientation sp_glyph_read_orientation(gchar const *value){ return GLYPH_ORIENTATION_BOTH; } -void CGlyph::set(unsigned int key, const gchar *value) { - SPGlyph* object = this->spglyph; +void SPGlyph::set(unsigned int key, const gchar *value) { + SPGlyph* object = this; SPGlyph *glyph = SP_GLYPH(object); @@ -224,8 +204,8 @@ void CGlyph::set(unsigned int key, const gchar *value) { /** * * Receives update notifications. * */ -void CGlyph::update(SPCtx *ctx, guint flags) { - SPGlyph* object = this->spglyph; +void SPGlyph::update(SPCtx *ctx, guint flags) { + SPGlyph* object = this; SPGlyph *glyph = SP_GLYPH(object); (void)glyph; @@ -249,8 +229,8 @@ void CGlyph::update(SPCtx *ctx, guint flags) { #define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key)); -Inkscape::XML::Node* CGlyph::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { - SPGlyph* object = this->spglyph; +Inkscape::XML::Node* SPGlyph::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + SPGlyph* object = this; // SPGlyph *glyph = SP_GLYPH(object); |
