From 43373dd610017d7e78672e473a36285a92254f2e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 16 Sep 2018 16:36:44 +0200 Subject: Rename private implementation types according to new Gtk conventions --- ganv/box.h | 8 ++++---- ganv/canvas.h | 6 +++--- ganv/circle.h | 10 +++++----- ganv/edge.h | 8 ++++---- ganv/group.h | 10 +++++----- ganv/item.h | 10 +++++----- ganv/module.h | 8 ++++---- ganv/node.h | 8 ++++---- ganv/port.h | 8 ++++---- ganv/text.h | 10 +++++----- ganv/widget.h | 10 +++++----- src/Canvas.cpp | 8 ++++---- src/box.c | 30 +++++++++++++++--------------- src/circle.c | 14 +++++++------- src/edge.c | 36 ++++++++++++++++++------------------ src/ganv-private.h | 20 ++++++++++---------- src/group.c | 6 +++--- src/item.c | 6 +++--- src/module.c | 40 ++++++++++++++++++++-------------------- src/node.c | 22 +++++++++++----------- src/port.c | 24 ++++++++++++------------ src/text.c | 38 +++++++++++++++++++------------------- src/widget.c | 6 +++--- 23 files changed, 173 insertions(+), 173 deletions(-) diff --git a/ganv/box.h b/ganv/box.h index 203be69..ab166bf 100644 --- a/ganv/box.h +++ b/ganv/box.h @@ -27,12 +27,12 @@ G_BEGIN_DECLS #define GANV_IS_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_BOX)) #define GANV_BOX_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_BOX, GanvBoxClass)) -typedef struct _GanvBoxClass GanvBoxClass; -typedef struct _GanvBoxImpl GanvBoxImpl; +typedef struct _GanvBoxClass GanvBoxClass; +typedef struct _GanvBoxPrivate GanvBoxPrivate; struct _GanvBox { - GanvNode node; - GanvBoxImpl* impl; + GanvNode node; + GanvBoxPrivate* impl; }; /** diff --git a/ganv/canvas.h b/ganv/canvas.h index fc42c6f..3ffb55c 100644 --- a/ganv/canvas.h +++ b/ganv/canvas.h @@ -35,7 +35,7 @@ G_BEGIN_DECLS #define GANV_IS_CANVAS_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_CANVAS)) #define GANV_CANVAS_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_CANVAS, GanvCanvasClass)) -typedef struct GanvCanvasImpl GanvCanvasImpl; +typedef struct GanvCanvasImpl GanvCanvasPrivate; typedef struct _GanvCanvasClass GanvCanvasClass; /** @@ -52,8 +52,8 @@ typedef enum { } GanvDirection; struct _GanvCanvas { - GtkLayout layout; - GanvCanvasImpl* impl; + GtkLayout layout; + GanvCanvasPrivate* impl; }; struct _GanvCanvasClass { diff --git a/ganv/circle.h b/ganv/circle.h index cca9e5f..f181b54 100644 --- a/ganv/circle.h +++ b/ganv/circle.h @@ -27,9 +27,9 @@ G_BEGIN_DECLS #define GANV_IS_CIRCLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_CIRCLE)) #define GANV_CIRCLE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_CIRCLE, GanvCircleClass)) -typedef struct _GanvCircle GanvCircle; -typedef struct _GanvCircleClass GanvCircleClass; -typedef struct _GanvCircleImpl GanvCircleImpl; +typedef struct _GanvCircle GanvCircle; +typedef struct _GanvCircleClass GanvCircleClass; +typedef struct _GanvCirclePrivate GanvCirclePrivate; /** * GanvCircle: @@ -38,8 +38,8 @@ typedef struct _GanvCircleImpl GanvCircleImpl; * any child nodes (though, like any #GanvNode, it may have a label). */ struct _GanvCircle { - GanvNode node; - GanvCircleImpl* impl; + GanvNode node; + GanvCirclePrivate* impl; }; struct _GanvCircleClass { diff --git a/ganv/edge.h b/ganv/edge.h index d135bad..bf0fb14 100644 --- a/ganv/edge.h +++ b/ganv/edge.h @@ -29,12 +29,12 @@ G_BEGIN_DECLS #define GANV_IS_EDGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_EDGE)) #define GANV_EDGE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_EDGE, GanvEdgeClass)) -typedef struct _GanvEdgeClass GanvEdgeClass; -typedef struct _GanvEdgeImpl GanvEdgeImpl; +typedef struct _GanvEdgeClass GanvEdgeClass; +typedef struct _GanvEdgePrivate GanvEdgePrivate; struct _GanvEdge { - GanvItem item; - GanvEdgeImpl* impl; + GanvItem item; + GanvEdgePrivate* impl; }; struct _GanvEdgeClass { diff --git a/ganv/group.h b/ganv/group.h index 42ad5df..0f835e4 100644 --- a/ganv/group.h +++ b/ganv/group.h @@ -32,13 +32,13 @@ G_BEGIN_DECLS #define GANV_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GANV_TYPE_GROUP)) #define GANV_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GANV_TYPE_GROUP, GanvGroupClass)) -typedef struct _GanvGroup GanvGroup; -typedef struct _GanvGroupImpl GanvGroupImpl; -typedef struct _GanvGroupClass GanvGroupClass; +typedef struct _GanvGroup GanvGroup; +typedef struct _GanvGroupPrivate GanvGroupPrivate; +typedef struct _GanvGroupClass GanvGroupClass; struct _GanvGroup { - GanvItem item; - GanvGroupImpl* impl; + GanvItem item; + GanvGroupPrivate* impl; }; struct _GanvGroupClass { diff --git a/ganv/item.h b/ganv/item.h index 2da061b..4605ffb 100644 --- a/ganv/item.h +++ b/ganv/item.h @@ -30,9 +30,9 @@ G_BEGIN_DECLS struct _GanvCanvas; -typedef struct _GanvItem GanvItem; -typedef struct _GanvItemImpl GanvItemImpl; -typedef struct _GanvItemClass GanvItemClass; +typedef struct _GanvItem GanvItem; +typedef struct _GanvItemPrivate GanvItemPrivate; +typedef struct _GanvItemClass GanvItemClass; /* Object flags for items */ enum { @@ -52,8 +52,8 @@ enum { #define GANV_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GANV_TYPE_ITEM, GanvItemClass)) struct _GanvItem { - GtkObject object; - GanvItemImpl* impl; + GtkObject object; + GanvItemPrivate* impl; }; struct _GanvItemClass { diff --git a/ganv/module.h b/ganv/module.h index 6314383..37fcf96 100644 --- a/ganv/module.h +++ b/ganv/module.h @@ -30,14 +30,14 @@ G_BEGIN_DECLS #define GANV_IS_MODULE_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_MODULE)) #define GANV_MODULE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_MODULE, GanvModuleClass)) -typedef struct _GanvModuleClass GanvModuleClass; -typedef struct _GanvModuleImpl GanvModuleImpl; +typedef struct _GanvModuleClass GanvModuleClass; +typedef struct _GanvModulePrivate GanvModulePrivate; typedef void (*GanvPortFunc)(GanvPort* port, void* data); struct _GanvModule { - GanvBox box; - GanvModuleImpl* impl; + GanvBox box; + GanvModulePrivate* impl; }; struct _GanvModuleClass { diff --git a/ganv/node.h b/ganv/node.h index c98e2b2..b0dd82f 100644 --- a/ganv/node.h +++ b/ganv/node.h @@ -29,12 +29,12 @@ G_BEGIN_DECLS #define GANV_IS_NODE_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_NODE)) #define GANV_NODE_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_NODE, GanvNodeClass)) -typedef struct _GanvNodeClass GanvNodeClass; -typedef struct _GanvNodeImpl GanvNodeImpl; +typedef struct _GanvNodeClass GanvNodeClass; +typedef struct _GanvNodePrivate GanvNodePrivate; struct _GanvNode { - GanvItem item; - GanvNodeImpl* impl; + GanvItem item; + GanvNodePrivate* impl; }; struct _GanvNodeClass { diff --git a/ganv/port.h b/ganv/port.h index 70e801e..03f4bb3 100644 --- a/ganv/port.h +++ b/ganv/port.h @@ -29,12 +29,12 @@ G_BEGIN_DECLS #define GANV_IS_PORT_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_PORT)) #define GANV_PORT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_PORT, GanvPortClass)) -typedef struct _GanvPortClass GanvPortClass; -typedef struct _GanvPortImpl GanvPortImpl; +typedef struct _GanvPortClass GanvPortClass; +typedef struct _GanvPortPrivate GanvPortPrivate; struct _GanvPort { - GanvBox box; - GanvPortImpl* impl; + GanvBox box; + GanvPortPrivate* impl; }; struct _GanvPortClass { diff --git a/ganv/text.h b/ganv/text.h index 52d87d6..6f03a1b 100644 --- a/ganv/text.h +++ b/ganv/text.h @@ -27,13 +27,13 @@ G_BEGIN_DECLS #define GANV_IS_TEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GANV_TYPE_TEXT)) #define GANV_TEXT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), GANV_TYPE_TEXT, GanvTextClass)) -typedef struct _GanvText GanvText; -typedef struct _GanvTextClass GanvTextClass; -typedef struct _GanvTextImpl GanvTextImpl; +typedef struct _GanvText GanvText; +typedef struct _GanvTextClass GanvTextClass; +typedef struct _GanvTextPrivate GanvTextPrivate; struct _GanvText { - GanvItem item; - GanvTextImpl* impl; + GanvItem item; + GanvTextPrivate* impl; }; struct _GanvTextClass { diff --git a/ganv/widget.h b/ganv/widget.h index 5aa81e9..5b54ba4 100644 --- a/ganv/widget.h +++ b/ganv/widget.h @@ -31,13 +31,13 @@ G_BEGIN_DECLS #define GANV_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GANV_TYPE_WIDGET)) #define GANV_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GANV_TYPE_WIDGET, GanvWidgetClass)) -typedef struct _GanvWidget GanvWidget; -typedef struct _GanvWidgetImpl GanvWidgetImpl; -typedef struct _GanvWidgetClass GanvWidgetClass; +typedef struct _GanvWidget GanvWidget; +typedef struct _GanvWidgetPrivate GanvWidgetPrivate; +typedef struct _GanvWidgetClass GanvWidgetClass; struct _GanvWidget { - GanvItem item; - GanvWidgetImpl* impl; + GanvItem item; + GanvWidgetPrivate* impl; }; struct _GanvWidgetClass { diff --git a/src/Canvas.cpp b/src/Canvas.cpp index 988f4f0..3b5e28d 100644 --- a/src/Canvas.cpp +++ b/src/Canvas.cpp @@ -477,9 +477,9 @@ struct GanvCanvasImpl { }; typedef struct { - GanvItem item; - GanvEdgeImpl* impl; - GanvEdgeImpl impl_data; + GanvItem item; + GanvEdgePrivate* impl; + GanvEdgePrivate impl_data; } GanvEdgeKey; static void @@ -1885,7 +1885,7 @@ 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(GanvCanvasImpl)); + g_type_class_add_private(klass, sizeof(GanvCanvasPrivate)); gobject_class->set_property = ganv_canvas_set_property; gobject_class->get_property = ganv_canvas_get_property; diff --git a/src/box.c b/src/box.c index 78afe69..b2c92a1 100644 --- a/src/box.c +++ b/src/box.c @@ -49,7 +49,7 @@ static void ganv_box_init(GanvBox* box) { box->impl = G_TYPE_INSTANCE_GET_PRIVATE( - box, GANV_TYPE_BOX, GanvBoxImpl); + box, GANV_TYPE_BOX, GanvBoxPrivate); memset(&box->impl->coords, '\0', sizeof(GanvBoxCoords)); @@ -82,9 +82,9 @@ ganv_box_set_property(GObject* object, g_return_if_fail(object != NULL); g_return_if_fail(GANV_IS_BOX(object)); - GanvBox* box = GANV_BOX(object); - GanvBoxImpl* impl = box->impl; - GanvBoxCoords* coords = &impl->coords; + GanvBox* box = GANV_BOX(object); + GanvBoxPrivate* impl = box->impl; + GanvBoxCoords* coords = &impl->coords; switch (prop_id) { SET_CASE(X1, double, coords->x1); @@ -112,9 +112,9 @@ ganv_box_get_property(GObject* object, g_return_if_fail(object != NULL); g_return_if_fail(GANV_IS_BOX(object)); - GanvBox* box = GANV_BOX(object); - GanvBoxImpl* impl = box->impl; - GanvBoxCoords* coords = &impl->coords; + GanvBox* box = GANV_BOX(object); + GanvBoxPrivate* impl = box->impl; + GanvBoxCoords* coords = &impl->coords; switch (prop_id) { GET_CASE(X1, double, coords->x1); @@ -179,8 +179,8 @@ ganv_box_bounds(GanvItem* item, static void ganv_box_update(GanvItem* item, int flags) { - GanvBox* box = GANV_BOX(item); - GanvBoxImpl* impl = box->impl; + GanvBox* box = GANV_BOX(item); + GanvBoxPrivate* impl = box->impl; impl->coords.border_width = box->node.impl->border_width; // Request redraw of old location @@ -210,7 +210,7 @@ ganv_box_path(GanvBox* box, { static const double degrees = G_PI / 180.0; - GanvBoxImpl* impl = box->impl; + GanvBoxPrivate* impl = box->impl; if (impl->radius_tl == 0.0 && impl->radius_tr == 0.0 && impl->radius_br == 0.0 && impl->radius_bl == 0.0) { @@ -253,8 +253,8 @@ static void ganv_box_draw(GanvItem* item, cairo_t* cr, double cx, double cy, double cw, double ch) { - GanvBox* box = GANV_BOX(item); - GanvBoxImpl* impl = box->impl; + GanvBox* box = GANV_BOX(item); + GanvBoxPrivate* impl = box->impl; double x1 = impl->coords.x1; double y1 = impl->coords.y1; @@ -303,8 +303,8 @@ ganv_box_draw(GanvItem* item, static double ganv_box_point(GanvItem* item, double x, double y, GanvItem** actual_item) { - GanvBox* box = GANV_BOX(item); - GanvBoxImpl* impl = box->impl; + GanvBox* box = GANV_BOX(item); + GanvBoxPrivate* impl = box->impl; *actual_item = NULL; @@ -385,7 +385,7 @@ ganv_box_class_init(GanvBoxClass* klass) parent_class = GANV_NODE_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvBoxImpl)); + 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 87cc59f..9d19971 100644 --- a/src/circle.c +++ b/src/circle.c @@ -39,7 +39,7 @@ static void ganv_circle_init(GanvCircle* circle) { circle->impl = G_TYPE_INSTANCE_GET_PRIVATE( - circle, GANV_TYPE_CIRCLE, GanvCircleImpl); + circle, GANV_TYPE_CIRCLE, GanvCirclePrivate); memset(&circle->impl->coords, '\0', sizeof(GanvCircleCoords)); circle->impl->coords.radius = 0.0; @@ -257,8 +257,8 @@ ganv_circle_bounds(GanvItem* item, static void ganv_circle_update(GanvItem* item, int flags) { - GanvCircle* circle = GANV_CIRCLE(item); - GanvCircleImpl* impl = circle->impl; + GanvCircle* circle = GANV_CIRCLE(item); + GanvCirclePrivate* impl = circle->impl; impl->coords.width = circle->node.impl->border_width; // Request redraw of old location @@ -283,9 +283,9 @@ static void ganv_circle_draw(GanvItem* item, cairo_t* cr, double cx, double cy, double cw, double ch) { - GanvNode* node = GANV_NODE(item); - GanvCircle* circle = GANV_CIRCLE(item); - GanvCircleImpl* impl = circle->impl; + GanvNode* node = GANV_NODE(item); + GanvCircle* circle = GANV_CIRCLE(item); + GanvCirclePrivate* impl = circle->impl; double r, g, b, a; @@ -366,7 +366,7 @@ ganv_circle_class_init(GanvCircleClass* klass) parent_class = GANV_NODE_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvCircleImpl)); + g_type_class_add_private(klass, sizeof(GanvCirclePrivate)); gobject_class->set_property = ganv_circle_set_property; gobject_class->get_property = ganv_circle_get_property; diff --git a/src/edge.c b/src/edge.c index c609e01..b61ce85 100644 --- a/src/edge.c +++ b/src/edge.c @@ -62,8 +62,8 @@ static GanvItemClass* parent_class; static void ganv_edge_init(GanvEdge* edge) { - GanvEdgeImpl* impl = G_TYPE_INSTANCE_GET_PRIVATE( - edge, GANV_TYPE_EDGE, GanvEdgeImpl); + GanvEdgePrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( + edge, GANV_TYPE_EDGE, GanvEdgePrivate); edge->impl = impl; @@ -110,10 +110,10 @@ ganv_edge_set_property(GObject* object, g_return_if_fail(object != NULL); g_return_if_fail(GANV_IS_EDGE(object)); - GanvItem* item = GANV_ITEM(object); - GanvEdge* edge = GANV_EDGE(object); - GanvEdgeImpl* impl = edge->impl; - GanvEdgeCoords* coords = &impl->coords; + GanvItem* item = GANV_ITEM(object); + GanvEdge* edge = GANV_EDGE(object); + GanvEdgePrivate* impl = edge->impl; + GanvEdgeCoords* coords = &impl->coords; switch (prop_id) { SET_CASE(WIDTH, double, coords->width); @@ -158,8 +158,8 @@ ganv_edge_get_property(GObject* object, g_return_if_fail(object != NULL); g_return_if_fail(GANV_IS_EDGE(object)); - GanvEdge* edge = GANV_EDGE(object); - GanvEdgeImpl* impl = edge->impl; + GanvEdge* edge = GANV_EDGE(object); + GanvEdgePrivate* impl = edge->impl; switch (prop_id) { GET_CASE(TAIL, object, impl->tail); @@ -250,10 +250,10 @@ ganv_edge_bounds(GanvItem* item, double* x1, double* y1, double* x2, double* y2) { - GanvEdge* edge = GANV_EDGE(item); - GanvEdgeImpl* impl = edge->impl; - GanvEdgeCoords* coords = &impl->coords; - const double w = coords->width; + GanvEdge* edge = GANV_EDGE(item); + GanvEdgePrivate* impl = edge->impl; + GanvEdgeCoords* coords = &impl->coords; + const double w = coords->width; if (coords->curved) { *x1 = MIN(coords->x1, MIN(coords->cx1, MIN(coords->x2, coords->cx2))) - w; @@ -271,7 +271,7 @@ ganv_edge_bounds(GanvItem* item, void ganv_edge_get_coords(const GanvEdge* edge, GanvEdgeCoords* coords) { - GanvEdgeImpl* impl = edge->impl; + GanvEdgePrivate* impl = edge->impl; GANV_NODE_GET_CLASS(impl->tail)->tail_vector( impl->tail, impl->head, @@ -298,8 +298,8 @@ ganv_edge_get_coords(const GanvEdge* edge, GanvEdgeCoords* coords) static void ganv_edge_update(GanvItem* item, int flags) { - GanvEdge* edge = GANV_EDGE(item); - GanvEdgeImpl* impl = edge->impl; + GanvEdge* edge = GANV_EDGE(item); + GanvEdgePrivate* impl = edge->impl; // Request redraw of old location ganv_edge_request_redraw(item, &impl->old_coords); @@ -339,8 +339,8 @@ static void ganv_edge_draw(GanvItem* item, cairo_t* cr, double cx, double cy, double cw, double ch) { - GanvEdge* edge = GANV_EDGE(item); - GanvEdgeImpl* impl = edge->impl; + GanvEdge* edge = GANV_EDGE(item); + GanvEdgePrivate* impl = edge->impl; double src_x = impl->coords.x1; double src_y = impl->coords.y1; @@ -516,7 +516,7 @@ ganv_edge_class_init(GanvEdgeClass* klass) parent_class = GANV_ITEM_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvEdgeImpl)); + 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/ganv-private.h b/src/ganv-private.h index 39824ba..df611a9 100644 --- a/src/ganv-private.h +++ b/src/ganv-private.h @@ -38,7 +38,7 @@ typedef struct { gboolean stacked; } GanvBoxCoords; -struct _GanvBoxImpl { +struct _GanvBoxPrivate { GanvBoxCoords coords; GanvBoxCoords old_coords; double radius_tl; @@ -55,7 +55,7 @@ typedef struct { double width; } GanvCircleCoords; -struct _GanvCircleImpl { +struct _GanvCirclePrivate { GanvCircleCoords coords; GanvCircleCoords old_coords; gboolean fit_label; @@ -73,7 +73,7 @@ typedef struct { gboolean arrowhead; } GanvEdgeCoords; -struct _GanvEdgeImpl +struct _GanvEdgePrivate { GanvNode* tail; GanvNode* head; @@ -89,7 +89,7 @@ struct _GanvEdgeImpl /* Module */ -struct _GanvModuleImpl +struct _GanvModulePrivate { GPtrArray* ports; GanvItem* embed_item; @@ -109,7 +109,7 @@ typedef struct { } Vector; #endif -struct _GanvNodeImpl { +struct _GanvNodePrivate { struct _GanvNode* partner; GanvText* label; double dash_length; @@ -135,7 +135,7 @@ struct _GanvNodeImpl { /* Widget */ -struct _GanvWidgetImpl { +struct _GanvWidgetPrivate { GtkWidget* widget; /* The child widget */ double x, y; /* Position at anchor */ @@ -152,13 +152,13 @@ struct _GanvWidgetImpl { }; /* Group */ -struct _GanvGroupImpl { +struct _GanvGroupPrivate { GList* item_list; GList* item_list_end; }; /* Item */ -struct _GanvItemImpl { +struct _GanvItemPrivate { /* Parent canvas for this item */ struct _GanvCanvas* canvas; @@ -224,7 +224,7 @@ typedef struct { gboolean is_integer; } GanvPortControl; -struct _GanvPortImpl { +struct _GanvPortPrivate { GanvPortControl* control; GanvText* value_label; gboolean is_input; @@ -241,7 +241,7 @@ typedef struct double height; } GanvTextCoords; -struct _GanvTextImpl +struct _GanvTextPrivate { PangoLayout* layout; char* text; diff --git a/src/group.c b/src/group.c index b13dc13..520c247 100644 --- a/src/group.c +++ b/src/group.c @@ -37,8 +37,8 @@ static GanvItemClass* group_parent_class; static void ganv_group_init(GanvGroup* group) { - GanvGroupImpl* impl = G_TYPE_INSTANCE_GET_PRIVATE( - group, GANV_TYPE_GROUP, GanvGroupImpl); + GanvGroupPrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( + group, GANV_TYPE_GROUP, GanvGroupPrivate); group->impl = impl; group->impl->item_list = NULL; @@ -428,7 +428,7 @@ ganv_group_class_init(GanvGroupClass* klass) group_parent_class = (GanvItemClass*)g_type_class_peek_parent(klass); - g_type_class_add_private(klass, sizeof(GanvGroupImpl)); + g_type_class_add_private(klass, sizeof(GanvGroupPrivate)); gobject_class->set_property = ganv_group_set_property; gobject_class->get_property = ganv_group_get_property; diff --git a/src/item.c b/src/item.c index f3ee636..85d7511 100644 --- a/src/item.c +++ b/src/item.c @@ -72,8 +72,8 @@ static GtkObjectClass* item_parent_class; static void ganv_item_init(GanvItem* item) { - GanvItemImpl* impl = G_TYPE_INSTANCE_GET_PRIVATE( - item, GANV_TYPE_ITEM, GanvItemImpl); + GanvItemPrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( + item, GANV_TYPE_ITEM, GanvItemPrivate); item->object.flags |= GANV_ITEM_VISIBLE; item->impl = impl; @@ -653,7 +653,7 @@ ganv_item_class_init(GanvItemClass* klass) item_parent_class = (GtkObjectClass*)g_type_class_peek_parent(klass); - g_type_class_add_private(klass, sizeof(GanvItemImpl)); + 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 5310191..8e992c9 100644 --- a/src/module.c +++ b/src/module.c @@ -49,8 +49,8 @@ enum { static void ganv_module_init(GanvModule* module) { - GanvModuleImpl* impl = G_TYPE_INSTANCE_GET_PRIVATE( - module, GANV_TYPE_MODULE, GanvModuleImpl); + GanvModulePrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( + module, GANV_TYPE_MODULE, GanvModulePrivate); module->impl = impl; @@ -72,8 +72,8 @@ ganv_module_destroy(GtkObject* object) g_return_if_fail(object != NULL); g_return_if_fail(GANV_IS_MODULE(object)); - GanvModule* module = GANV_MODULE(object); - GanvModuleImpl* impl = module->impl; + GanvModule* module = GANV_MODULE(object); + GanvModulePrivate* impl = module->impl; if (impl->ports) { FOREACH_PORT(impl->ports, p) { @@ -155,9 +155,9 @@ measure(GanvModule* module, Metrics* m) double title_w, title_h; title_size(module, &title_w, &title_h); - GanvCanvas* canvas = ganv_item_get_canvas(GANV_ITEM(module)); - GanvText* canvas_title = GANV_NODE(module)->impl->label; - GanvModuleImpl* impl = module->impl; + GanvCanvas* canvas = ganv_item_get_canvas(GANV_ITEM(module)); + GanvText* canvas_title = GANV_NODE(module)->impl->label; + GanvModulePrivate* impl = module->impl; if (ganv_canvas_get_direction(canvas) == GANV_DIRECTION_DOWN) { double contents_width = 0.0; @@ -273,8 +273,8 @@ place_title(GanvModule* module, GanvDirection dir) static void resize_right(GanvModule* module) { - GanvCanvas* canvas = ganv_item_get_canvas(GANV_ITEM(module)); - GanvModuleImpl* impl = module->impl; + GanvCanvas* canvas = ganv_item_get_canvas(GANV_ITEM(module)); + GanvModulePrivate* impl = module->impl; Metrics m; measure(module, &m); @@ -349,8 +349,8 @@ resize_right(GanvModule* module) static void resize_down(GanvModule* module) { - GanvCanvas* canvas = ganv_item_get_canvas(GANV_ITEM(module)); - GanvModuleImpl* impl = module->impl; + GanvCanvas* canvas = ganv_item_get_canvas(GANV_ITEM(module)); + GanvModulePrivate* impl = module->impl; Metrics m; measure(module, &m); @@ -410,7 +410,7 @@ resize_down(GanvModule* module) static void measure_ports(GanvModule* module) { - GanvModuleImpl* impl = module->impl; + GanvModulePrivate* impl = module->impl; impl->widest_input = 0.0; impl->widest_output = 0.0; @@ -480,7 +480,7 @@ static void ganv_module_add_port(GanvModule* module, GanvPort* port) { - GanvModuleImpl* impl = module->impl; + GanvModulePrivate* impl = module->impl; // Update widest input/output measurements if necessary const double width = ganv_port_get_natural_width(port); @@ -697,7 +697,7 @@ ganv_module_class_init(GanvModuleClass* klass) parent_class = GANV_BOX_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvModuleImpl)); + g_type_class_add_private(klass, sizeof(GanvModulePrivate)); gobject_class->set_property = ganv_module_set_property; gobject_class->get_property = ganv_module_get_property; @@ -763,8 +763,8 @@ on_embed_size_request(GtkWidget* widget, GtkRequisition* r, void* user_data) { - GanvModule* module = GANV_MODULE(user_data); - GanvModuleImpl* impl = module->impl; + GanvModule* module = GANV_MODULE(user_data); + GanvModulePrivate* impl = module->impl; if (impl->embed_width == r->width && impl->embed_height == r->height) { return; } @@ -788,7 +788,7 @@ void ganv_module_embed(GanvModule* module, GtkWidget* widget) { - GanvModuleImpl* impl = module->impl; + GanvModulePrivate* impl = module->impl; if (!widget && !impl->embed_item) { return; } @@ -848,9 +848,9 @@ ganv_module_for_each_port(GanvModule* module, GanvPortFunc f, void* data) { - GanvModuleImpl* impl = module->impl; - const int len = impl->ports->len; - GanvPort** copy = (GanvPort**)malloc(sizeof(GanvPort*) * len); + GanvModulePrivate* impl = module->impl; + const int len = impl->ports->len; + GanvPort** copy = (GanvPort**)malloc(sizeof(GanvPort*) * len); memcpy(copy, impl->ports->pdata, sizeof(GanvPort*) * len); for (int i = 0; i < len; ++i) { diff --git a/src/node.c b/src/node.c index be7cc24..9955c74 100644 --- a/src/node.c +++ b/src/node.c @@ -51,8 +51,8 @@ enum { static void ganv_node_init(GanvNode* node) { - GanvNodeImpl* impl = G_TYPE_INSTANCE_GET_PRIVATE( - node, GANV_TYPE_NODE, GanvNodeImpl); + GanvNodePrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( + node, GANV_TYPE_NODE, GanvNodePrivate); node->impl = impl; @@ -94,8 +94,8 @@ ganv_node_destroy(GtkObject* object) g_return_if_fail(object != NULL); g_return_if_fail(GANV_IS_NODE(object)); - GanvNode* node = GANV_NODE(object); - GanvNodeImpl* impl = node->impl; + GanvNode* node = GANV_NODE(object); + GanvNodePrivate* impl = node->impl; if (impl->label) { g_object_unref(impl->label); impl->label = NULL; @@ -150,8 +150,8 @@ ganv_node_set_property(GObject* object, g_return_if_fail(object != NULL); g_return_if_fail(GANV_IS_NODE(object)); - GanvNode* node = GANV_NODE(object); - GanvNodeImpl* impl = node->impl; + GanvNode* node = GANV_NODE(object); + GanvNodePrivate* impl = node->impl; switch (prop_id) { SET_CASE(DASH_LENGTH, double, impl->dash_length); @@ -212,8 +212,8 @@ ganv_node_get_property(GObject* object, g_return_if_fail(object != NULL); g_return_if_fail(GANV_IS_NODE(object)); - GanvNode* node = GANV_NODE(object); - GanvNodeImpl* impl = node->impl; + GanvNode* node = GANV_NODE(object); + GanvNodePrivate* impl = node->impl; switch (prop_id) { GET_CASE(PARTNER, object, impl->partner); @@ -299,7 +299,7 @@ ganv_node_get_draw_properties(const GanvNode* node, double* border_color, double* fill_color) { - GanvNodeImpl* impl = node->impl; + GanvNodePrivate* impl = node->impl; *dash_length = impl->dash_length; *border_color = impl->border_color; @@ -319,7 +319,7 @@ ganv_node_get_draw_properties(const GanvNode* node, void ganv_node_set_label(GanvNode* node, const char* str) { - GanvNodeImpl* impl = node->impl; + GanvNodePrivate* impl = node->impl; if (!str || str[0] == '\0') { if (impl->label) { gtk_object_destroy(GTK_OBJECT(impl->label)); @@ -545,7 +545,7 @@ ganv_node_class_init(GanvNodeClass* klass) parent_class = GANV_ITEM_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvNodeImpl)); + g_type_class_add_private(klass, sizeof(GanvNodePrivate)); gobject_class->set_property = ganv_node_set_property; gobject_class->get_property = ganv_node_get_property; diff --git a/src/port.c b/src/port.c index 4e11b18..5c1df4c 100644 --- a/src/port.c +++ b/src/port.c @@ -52,7 +52,7 @@ static void ganv_port_init(GanvPort* port) { port->impl = G_TYPE_INSTANCE_GET_PRIVATE( - port, GANV_TYPE_PORT, GanvPortImpl); + port, GANV_TYPE_PORT, GanvPortPrivate); port->impl->control = NULL; port->impl->value_label = NULL; @@ -127,8 +127,8 @@ ganv_port_get_property(GObject* object, static void ganv_port_update(GanvItem* item, int flags) { - GanvPort* port = GANV_PORT(item); - GanvPortImpl* impl = port->impl; + GanvPort* port = GANV_PORT(item); + GanvPortPrivate* impl = port->impl; if (impl->control) { ganv_item_invoke_update(GANV_ITEM(impl->control->rect), flags); @@ -260,12 +260,12 @@ ganv_port_head_vector(const GanvNode* self, static void ganv_port_place_labels(GanvPort* port) { - GanvCanvas* canvas = ganv_item_get_canvas(GANV_ITEM(port)); - GanvPortImpl* impl = port->impl; - GanvText* label = GANV_NODE(port)->impl->label; - const double port_w = ganv_box_get_width(&port->box); - const double port_h = ganv_box_get_height(&port->box); - double vlabel_w = 0.0; + GanvCanvas* canvas = ganv_item_get_canvas(GANV_ITEM(port)); + GanvPortPrivate* impl = port->impl; + GanvText* label = GANV_NODE(port)->impl->label; + const double port_w = ganv_box_get_width(&port->box); + const double port_h = ganv_box_get_height(&port->box); + double vlabel_w = 0.0; if (impl->value_label) { const double vlabel_h = impl->value_label->impl->coords.height; vlabel_w = impl->value_label->impl->coords.width; @@ -388,7 +388,7 @@ ganv_port_class_init(GanvPortClass* klass) parent_class = GANV_BOX_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvPortImpl)); + g_type_class_add_private(klass, sizeof(GanvPortPrivate)); gobject_class->set_property = ganv_port_set_property; gobject_class->get_property = ganv_port_get_property; @@ -537,7 +537,7 @@ void ganv_port_set_value_label(GanvPort* port, const char* str) { - GanvPortImpl* impl = port->impl; + GanvPortPrivate* impl = port->impl; if (!str || str[0] == '\0') { if (impl->value_label) { @@ -561,7 +561,7 @@ ganv_port_set_value_label(GanvPort* port, static void ganv_port_update_control_slider(GanvPort* port, float value, gboolean force) { - GanvPortImpl* impl = port->impl; + GanvPortPrivate* impl = port->impl; if (!impl->control) { return; } diff --git a/src/text.c b/src/text.c index d519186..ba7f19e 100644 --- a/src/text.c +++ b/src/text.c @@ -46,8 +46,8 @@ enum { static void ganv_text_init(GanvText* text) { - GanvTextImpl* impl = G_TYPE_INSTANCE_GET_PRIVATE( - text, GANV_TYPE_TEXT, GanvTextImpl); + GanvTextPrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( + text, GANV_TYPE_TEXT, GanvTextPrivate); text->impl = impl; @@ -69,8 +69,8 @@ ganv_text_destroy(GtkObject* object) g_return_if_fail(object != NULL); g_return_if_fail(GANV_IS_TEXT(object)); - GanvText* text = GANV_TEXT(object); - GanvTextImpl* impl = text->impl; + GanvText* text = GANV_TEXT(object); + GanvTextPrivate* impl = text->impl; if (impl->text) { g_free(impl->text); @@ -90,12 +90,12 @@ ganv_text_destroy(GtkObject* object) void ganv_text_layout(GanvText* text) { - GanvTextImpl* impl = text->impl; - GanvItem* item = GANV_ITEM(text); - GanvCanvas* canvas = ganv_item_get_canvas(item); - GtkWidget* widget = GTK_WIDGET(canvas); - double points = impl->font_size; - GtkStyle* style = gtk_rc_get_style(widget); + GanvTextPrivate* impl = text->impl; + GanvItem* item = GANV_ITEM(text); + GanvCanvas* canvas = ganv_item_get_canvas(item); + GtkWidget* widget = GTK_WIDGET(canvas); + double points = impl->font_size; + GtkStyle* style = gtk_rc_get_style(widget); if (impl->font_size == 0.0) { points = ganv_canvas_get_font_size(canvas); @@ -136,8 +136,8 @@ ganv_text_set_property(GObject* object, g_return_if_fail(object != NULL); g_return_if_fail(GANV_IS_TEXT(object)); - GanvText* text = GANV_TEXT(object); - GanvTextImpl* impl = text->impl; + GanvText* text = GANV_TEXT(object); + GanvTextPrivate* impl = text->impl; switch (prop_id) { case PROP_X: @@ -179,8 +179,8 @@ ganv_text_get_property(GObject* object, g_return_if_fail(object != NULL); g_return_if_fail(GANV_IS_TEXT(object)); - GanvText* text = GANV_TEXT(object); - GanvTextImpl* impl = text->impl; + GanvText* text = GANV_TEXT(object); + GanvTextPrivate* impl = text->impl; if (impl->needs_layout && (prop_id == PROP_WIDTH || prop_id == PROP_HEIGHT)) { @@ -205,8 +205,8 @@ ganv_text_bounds_item(GanvItem* item, double* x1, double* y1, double* x2, double* y2) { - GanvText* text = GANV_TEXT(item); - GanvTextImpl* impl = text->impl; + GanvText* text = GANV_TEXT(item); + GanvTextPrivate* impl = text->impl; if (impl->needs_layout) { ganv_text_layout(text); @@ -278,8 +278,8 @@ static void ganv_text_draw(GanvItem* item, cairo_t* cr, double cx, double cy, double cw, double ch) { - GanvText* text = GANV_TEXT(item); - GanvTextImpl* impl = text->impl; + GanvText* text = GANV_TEXT(item); + GanvTextPrivate* impl = text->impl; double wx = impl->coords.x; double wy = impl->coords.y; @@ -306,7 +306,7 @@ ganv_text_class_init(GanvTextClass* klass) parent_class = GANV_ITEM_CLASS(g_type_class_peek_parent(klass)); - g_type_class_add_private(klass, sizeof(GanvTextImpl)); + 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 075896e..bf75a51 100644 --- a/src/widget.c +++ b/src/widget.c @@ -45,8 +45,8 @@ enum { static void ganv_widget_init(GanvWidget* witem) { - GanvWidgetImpl* impl = G_TYPE_INSTANCE_GET_PRIVATE( - witem, GANV_TYPE_WIDGET, GanvWidgetImpl); + GanvWidgetPrivate* impl = G_TYPE_INSTANCE_GET_PRIVATE( + witem, GANV_TYPE_WIDGET, GanvWidgetPrivate); witem->impl = impl; witem->impl->x = 0.0; @@ -438,7 +438,7 @@ ganv_widget_class_init(GanvWidgetClass* klass) parent_class = (GanvItemClass*)g_type_class_peek_parent(klass); - g_type_class_add_private(klass, sizeof(GanvWidgetImpl)); + g_type_class_add_private(klass, sizeof(GanvWidgetPrivate)); gobject_class->set_property = ganv_widget_set_property; gobject_class->get_property = ganv_widget_get_property; -- cgit v1.2.1