diff options
author | David Robillard <d@drobilla.net> | 2018-09-16 16:55:21 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-16 17:08:00 +0200 |
commit | 75b11aac0bc76e459017728fb0d3f5b631a7a993 (patch) | |
tree | 6f2033a083ada31ec666632a22a2a4826681fe64 /src | |
parent | 43373dd610017d7e78672e473a36285a92254f2e (diff) | |
download | ganv-75b11aac0bc76e459017728fb0d3f5b631a7a993.tar.gz ganv-75b11aac0bc76e459017728fb0d3f5b631a7a993.tar.bz2 ganv-75b11aac0bc76e459017728fb0d3f5b631a7a993.zip |
Remove use of deprecated g_type_class_add_private()
Diffstat (limited to 'src')
-rw-r--r-- | src/Canvas.cpp | 5 | ||||
-rw-r--r-- | src/box.c | 8 | ||||
-rw-r--r-- | src/circle.c | 8 | ||||
-rw-r--r-- | src/edge.c | 8 | ||||
-rw-r--r-- | src/group.c | 8 | ||||
-rw-r--r-- | src/item.c | 8 | ||||
-rw-r--r-- | src/module.c | 8 | ||||
-rw-r--r-- | src/node.c | 8 | ||||
-rw-r--r-- | src/port.c | 8 | ||||
-rw-r--r-- | src/text.c | 8 | ||||
-rw-r--r-- | src/widget.c | 8 |
11 files changed, 32 insertions, 53 deletions
diff --git a/src/Canvas.cpp b/src/Canvas.cpp index 3b5e28d..6a18cdc 100644 --- a/src/Canvas.cpp +++ b/src/Canvas.cpp @@ -1785,7 +1785,8 @@ extern "C" { #include "./color.h" #include "./gettext.h" -G_DEFINE_TYPE(GanvCanvas, ganv_canvas, GTK_TYPE_LAYOUT) +G_DEFINE_TYPE_WITH_CODE(GanvCanvas, ganv_canvas, GTK_TYPE_LAYOUT, + G_ADD_PRIVATE(GanvCanvas)) enum { PROP_0, @@ -1885,8 +1886,6 @@ ganv_canvas_class_init(GanvCanvasClass* klass) canvas_parent_class = GTK_LAYOUT_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvCanvasPrivate)); - gobject_class->set_property = ganv_canvas_set_property; gobject_class->get_property = ganv_canvas_get_property; @@ -27,7 +27,8 @@ static const double STACKED_OFFSET = 4.0; -G_DEFINE_TYPE(GanvBox, ganv_box, GANV_TYPE_NODE) +G_DEFINE_TYPE_WITH_CODE(GanvBox, ganv_box, GANV_TYPE_NODE, + G_ADD_PRIVATE(GanvBox)) static GanvNodeClass* parent_class; @@ -48,8 +49,7 @@ enum { static void ganv_box_init(GanvBox* box) { - box->impl = G_TYPE_INSTANCE_GET_PRIVATE( - box, GANV_TYPE_BOX, GanvBoxPrivate); + box->impl = ganv_box_get_instance_private(box); memset(&box->impl->coords, '\0', sizeof(GanvBoxCoords)); @@ -385,8 +385,6 @@ ganv_box_class_init(GanvBoxClass* klass) parent_class = GANV_NODE_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvBoxPrivate)); - gobject_class->set_property = ganv_box_set_property; gobject_class->get_property = ganv_box_get_property; diff --git a/src/circle.c b/src/circle.c index 9d19971..a69c207 100644 --- a/src/circle.c +++ b/src/circle.c @@ -24,7 +24,8 @@ #include "./gettext.h" #include "./ganv-private.h" -G_DEFINE_TYPE(GanvCircle, ganv_circle, GANV_TYPE_NODE) +G_DEFINE_TYPE_WITH_CODE(GanvCircle, ganv_circle, GANV_TYPE_NODE, + G_ADD_PRIVATE(GanvCircle)) static GanvNodeClass* parent_class; @@ -38,8 +39,7 @@ enum { static void ganv_circle_init(GanvCircle* circle) { - circle->impl = G_TYPE_INSTANCE_GET_PRIVATE( - circle, GANV_TYPE_CIRCLE, GanvCirclePrivate); + circle->impl = ganv_circle_get_instance_private(circle); memset(&circle->impl->coords, '\0', sizeof(GanvCircleCoords)); circle->impl->coords.radius = 0.0; @@ -366,8 +366,6 @@ ganv_circle_class_init(GanvCircleClass* klass) parent_class = GANV_NODE_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvCirclePrivate)); - gobject_class->set_property = ganv_circle_set_property; gobject_class->get_property = ganv_circle_get_property; @@ -55,15 +55,15 @@ enum { PROP_GHOST }; -G_DEFINE_TYPE(GanvEdge, ganv_edge, GANV_TYPE_ITEM) +G_DEFINE_TYPE_WITH_CODE(GanvEdge, ganv_edge, GANV_TYPE_ITEM, + G_ADD_PRIVATE(GanvEdge)) static GanvItemClass* parent_class; static void ganv_edge_init(GanvEdge* edge) { - GanvEdgePrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( - edge, GANV_TYPE_EDGE, GanvEdgePrivate); + GanvEdgePrivate* impl = ganv_edge_get_instance_private(edge); edge->impl = impl; @@ -516,8 +516,6 @@ ganv_edge_class_init(GanvEdgeClass* klass) parent_class = GANV_ITEM_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvEdgePrivate)); - gobject_class->set_property = ganv_edge_set_property; gobject_class->get_property = ganv_edge_get_property; diff --git a/src/group.c b/src/group.c index 520c247..503e57b 100644 --- a/src/group.c +++ b/src/group.c @@ -30,15 +30,15 @@ enum { GROUP_PROP_0 }; -G_DEFINE_TYPE(GanvGroup, ganv_group, GANV_TYPE_ITEM) +G_DEFINE_TYPE_WITH_CODE(GanvGroup, ganv_group, GANV_TYPE_ITEM, + G_ADD_PRIVATE(GanvGroup)) static GanvItemClass* group_parent_class; static void ganv_group_init(GanvGroup* group) { - GanvGroupPrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( - group, GANV_TYPE_GROUP, GanvGroupPrivate); + GanvGroupPrivate* impl = ganv_group_get_instance_private(group); group->impl = impl; group->impl->item_list = NULL; @@ -428,8 +428,6 @@ ganv_group_class_init(GanvGroupClass* klass) group_parent_class = (GanvItemClass*)g_type_class_peek_parent(klass); - g_type_class_add_private(klass, sizeof(GanvGroupPrivate)); - gobject_class->set_property = ganv_group_set_property; gobject_class->get_property = ganv_group_get_property; @@ -64,7 +64,8 @@ enum { static guint item_signals[ITEM_LAST_SIGNAL]; -G_DEFINE_TYPE(GanvItem, ganv_item, GTK_TYPE_OBJECT) +G_DEFINE_TYPE_WITH_CODE(GanvItem, ganv_item, GTK_TYPE_OBJECT, + G_ADD_PRIVATE(GanvItem)) static GtkObjectClass* item_parent_class; @@ -72,8 +73,7 @@ static GtkObjectClass* item_parent_class; static void ganv_item_init(GanvItem* item) { - GanvItemPrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( - item, GANV_TYPE_ITEM, GanvItemPrivate); + GanvItemPrivate* impl = ganv_item_get_instance_private(item); item->object.flags |= GANV_ITEM_VISIBLE; item->impl = impl; @@ -653,8 +653,6 @@ ganv_item_class_init(GanvItemClass* klass) item_parent_class = (GtkObjectClass*)g_type_class_peek_parent(klass); - g_type_class_add_private(klass, sizeof(GanvItemPrivate)); - gobject_class->set_property = ganv_item_set_property; gobject_class->get_property = ganv_item_get_property; diff --git a/src/module.c b/src/module.c index 8e992c9..bad930b 100644 --- a/src/module.c +++ b/src/module.c @@ -38,7 +38,8 @@ static const double PAD = 2.0; static const double EDGE_PAD = 5.0; static const double MODULE_LABEL_PAD = 2.0; -G_DEFINE_TYPE(GanvModule, ganv_module, GANV_TYPE_BOX) +G_DEFINE_TYPE_WITH_CODE(GanvModule, ganv_module, GANV_TYPE_BOX, + G_ADD_PRIVATE(GanvModule)) static GanvBoxClass* parent_class; @@ -49,8 +50,7 @@ enum { static void ganv_module_init(GanvModule* module) { - GanvModulePrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( - module, GANV_TYPE_MODULE, GanvModulePrivate); + GanvModulePrivate* impl = ganv_module_get_instance_private(module); module->impl = impl; @@ -697,8 +697,6 @@ ganv_module_class_init(GanvModuleClass* klass) parent_class = GANV_BOX_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvModulePrivate)); - gobject_class->set_property = ganv_module_set_property; gobject_class->get_property = ganv_module_get_property; @@ -24,7 +24,8 @@ guint signal_moved; -G_DEFINE_TYPE(GanvNode, ganv_node, GANV_TYPE_ITEM) +G_DEFINE_TYPE_WITH_CODE(GanvNode, ganv_node, GANV_TYPE_ITEM, + G_ADD_PRIVATE(GanvNode)) static GanvItemClass* parent_class; @@ -51,8 +52,7 @@ enum { static void ganv_node_init(GanvNode* node) { - GanvNodePrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( - node, GANV_TYPE_NODE, GanvNodePrivate); + GanvNodePrivate* impl = ganv_node_get_instance_private(node); node->impl = impl; @@ -545,8 +545,6 @@ ganv_node_class_init(GanvNodeClass* klass) parent_class = GANV_ITEM_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvNodePrivate)); - gobject_class->set_property = ganv_node_set_property; gobject_class->get_property = ganv_node_get_property; @@ -31,7 +31,8 @@ static const double PORT_LABEL_VPAD = 1.0; static void ganv_port_update_control_slider(GanvPort* port, float value, gboolean force); -G_DEFINE_TYPE(GanvPort, ganv_port, GANV_TYPE_BOX) +G_DEFINE_TYPE_WITH_CODE(GanvPort, ganv_port, GANV_TYPE_BOX, + G_ADD_PRIVATE(GanvPort)) static GanvBoxClass* parent_class; @@ -51,8 +52,7 @@ static guint port_signals[PORT_LAST_SIGNAL]; static void ganv_port_init(GanvPort* port) { - port->impl = G_TYPE_INSTANCE_GET_PRIVATE( - port, GANV_TYPE_PORT, GanvPortPrivate); + port->impl = ganv_port_get_instance_private(port); port->impl->control = NULL; port->impl->value_label = NULL; @@ -388,8 +388,6 @@ ganv_port_class_init(GanvPortClass* klass) parent_class = GANV_BOX_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvPortPrivate)); - gobject_class->set_property = ganv_port_set_property; gobject_class->get_property = ganv_port_get_property; @@ -28,7 +28,8 @@ #include "./gettext.h" #include "./ganv-private.h" -G_DEFINE_TYPE(GanvText, ganv_text, GANV_TYPE_ITEM) +G_DEFINE_TYPE_WITH_CODE(GanvText, ganv_text, GANV_TYPE_ITEM, + G_ADD_PRIVATE(GanvText)) static GanvItemClass* parent_class; @@ -46,8 +47,7 @@ enum { static void ganv_text_init(GanvText* text) { - GanvTextPrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( - text, GANV_TYPE_TEXT, GanvTextPrivate); + GanvTextPrivate* impl = ganv_text_get_instance_private(text); text->impl = impl; @@ -306,8 +306,6 @@ ganv_text_class_init(GanvTextClass* klass) parent_class = GANV_ITEM_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvTextPrivate)); - gobject_class->set_property = ganv_text_set_property; gobject_class->get_property = ganv_text_get_property; diff --git a/src/widget.c b/src/widget.c index bf75a51..b08715b 100644 --- a/src/widget.c +++ b/src/widget.c @@ -27,7 +27,8 @@ #include "./gettext.h" #include "./ganv-private.h" -G_DEFINE_TYPE(GanvWidget, ganv_widget, GANV_TYPE_ITEM) +G_DEFINE_TYPE_WITH_CODE(GanvWidget, ganv_widget, GANV_TYPE_ITEM, + G_ADD_PRIVATE(GanvWidget)) static GanvItemClass* parent_class; @@ -45,8 +46,7 @@ enum { static void ganv_widget_init(GanvWidget* witem) { - GanvWidgetPrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( - witem, GANV_TYPE_WIDGET, GanvWidgetPrivate); + GanvWidgetPrivate* impl = ganv_widget_get_instance_private(witem); witem->impl = impl; witem->impl->x = 0.0; @@ -438,8 +438,6 @@ ganv_widget_class_init(GanvWidgetClass* klass) parent_class = (GanvItemClass*)g_type_class_peek_parent(klass); - g_type_class_add_private(klass, sizeof(GanvWidgetPrivate)); - gobject_class->set_property = ganv_widget_set_property; gobject_class->get_property = ganv_widget_get_property; |