summaryrefslogtreecommitdiffstats
path: root/src/display/sodipodi-ctrlrect.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-11-23 23:36:49 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-11-23 23:36:49 +0000
commit0969085ddf607a7a98cf7fd6d9b10da5fbebe62d (patch)
tree59b2bc9ed3412ab2de4c703ef30342dfe2401704 /src/display/sodipodi-ctrlrect.cpp
parentrefactor from lastApplied (diff)
parentFixed a bug pointed by suv running from comand line, also removed another des... (diff)
downloadinkscape-0969085ddf607a7a98cf7fd6d9b10da5fbebe62d.tar.gz
inkscape-0969085ddf607a7a98cf7fd6d9b10da5fbebe62d.zip
fixing to trunk
(bzr r12588.1.34)
Diffstat (limited to 'src/display/sodipodi-ctrlrect.cpp')
-rw-r--r--src/display/sodipodi-ctrlrect.cpp38
1 files changed, 6 insertions, 32 deletions
diff --git a/src/display/sodipodi-ctrlrect.cpp b/src/display/sodipodi-ctrlrect.cpp
index e6e427047..75789ff50 100644
--- a/src/display/sodipodi-ctrlrect.cpp
+++ b/src/display/sodipodi-ctrlrect.cpp
@@ -26,45 +26,19 @@
* Corner coords can be in any order - i.e. x1 < x0 is allowed
*/
-static void sp_ctrlrect_class_init(SPCtrlRectClass *c);
-static void sp_ctrlrect_init(CtrlRect *ctrlrect);
static void sp_ctrlrect_destroy(SPCanvasItem *object);
static void sp_ctrlrect_update(SPCanvasItem *item, Geom::Affine const &affine, unsigned int flags);
static void sp_ctrlrect_render(SPCanvasItem *item, SPCanvasBuf *buf);
-static SPCanvasItemClass *parent_class;
-
static const guint DASH_LENGTH = 4;
-GType sp_ctrlrect_get_type()
-{
- static GType type = 0;
-
- if (!type) {
- GTypeInfo info = {
- sizeof(SPCtrlRectClass),
- 0, // base_init
- 0, // base_finalize
- (GClassInitFunc)sp_ctrlrect_class_init,
- 0, // class_finalize
- 0, // class_data
- sizeof(CtrlRect),
- 0, // n_preallocs
- (GInstanceInitFunc)sp_ctrlrect_init,
- 0 // value_table
- };
- type = g_type_register_static(SP_TYPE_CANVAS_ITEM, "SPCtrlRect", &info, static_cast<GTypeFlags>(0));
- }
- return type;
-}
+G_DEFINE_TYPE(CtrlRect, sp_ctrlrect, SP_TYPE_CANVAS_ITEM);
-static void sp_ctrlrect_class_init(SPCtrlRectClass *c)
+static void sp_ctrlrect_class_init(CtrlRectClass *c)
{
SPCanvasItemClass *item_class = SP_CANVAS_ITEM_CLASS(c);
- parent_class = SP_CANVAS_ITEM_CLASS(g_type_class_peek_parent(c));
-
item_class->destroy = sp_ctrlrect_destroy;
item_class->update = sp_ctrlrect_update;
item_class->render = sp_ctrlrect_render;
@@ -77,8 +51,8 @@ static void sp_ctrlrect_init(CtrlRect *cr)
static void sp_ctrlrect_destroy(SPCanvasItem *object)
{
- if (SP_CANVAS_ITEM_CLASS(parent_class)->destroy) {
- (* SP_CANVAS_ITEM_CLASS(parent_class)->destroy)(object);
+ if (SP_CANVAS_ITEM_CLASS(sp_ctrlrect_parent_class)->destroy) {
+ (* SP_CANVAS_ITEM_CLASS(sp_ctrlrect_parent_class)->destroy)(object);
}
}
@@ -171,8 +145,8 @@ void CtrlRect::update(Geom::Affine const &affine, unsigned int flags)
using Geom::X;
using Geom::Y;
- if ((SP_CANVAS_ITEM_CLASS(parent_class))->update) {
- (SP_CANVAS_ITEM_CLASS(parent_class))->update(this, affine, flags);
+ if ((SP_CANVAS_ITEM_CLASS(sp_ctrlrect_parent_class))->update) {
+ (SP_CANVAS_ITEM_CLASS(sp_ctrlrect_parent_class))->update(this, affine, flags);
}
sp_canvas_item_reset_bounds(this);