diff options
author | David Robillard <d@drobilla.net> | 2012-04-26 15:49:05 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-26 15:49:05 +0000 |
commit | 549647b61924ea8bcd55ad243ff9c6fce6d634cb (patch) | |
tree | e81e6deed0864f84e0295dadf53b7a9fc6c22021 /ganv | |
parent | f10ce40c6a382f8f2721e2b7a4cbf8ad379c8826 (diff) | |
download | ganv-549647b61924ea8bcd55ad243ff9c6fce6d634cb.tar.gz ganv-549647b61924ea8bcd55ad243ff9c6fce6d634cb.tar.bz2 ganv-549647b61924ea8bcd55ad243ff9c6fce6d634cb.zip |
Tidy.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@4274 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'ganv')
-rw-r--r-- | ganv/Canvas.hpp | 61 | ||||
-rw-r--r-- | ganv/Item.hpp | 4 | ||||
-rw-r--r-- | ganv/Module.hpp | 6 | ||||
-rw-r--r-- | ganv/canvas.h | 40 | ||||
-rw-r--r-- | ganv/module.h | 8 | ||||
-rw-r--r-- | ganv/wrap.hpp | 2 |
6 files changed, 52 insertions, 69 deletions
diff --git a/ganv/Canvas.hpp b/ganv/Canvas.hpp index 7b38af5..08a1140 100644 --- a/ganv/Canvas.hpp +++ b/ganv/Canvas.hpp @@ -55,70 +55,55 @@ public: Canvas(double width, double height); virtual ~Canvas(); - Gtk::Layout& widget(); - METHOD0(ganv_canvas, destroy); - - /** Get the edge from @c tail to @c head if one exists. */ - Edge* get_edge(Node* tail, Node* head) const; - - /** Delete the edge from @c tail to @c head. */ - void remove_edge(Node* tail, Node* head); - METHOD0(ganv_canvas, clear_selection); METHOD0(ganv_canvas, select_all); - - RW_PROPERTY(gboolean, locked); - METHOD0(ganv_canvas, get_zoom); - METHOD1(ganv_canvas, set_zoom, double, pix_per_unit); METHOD1(ganv_canvas, set_font_size, double, points); METHOD2(ganv_canvas, set_scale, double, zoom, double, points); - METHOD0(ganv_canvas, zoom_full); - METHODRET0(ganv_canvas, double, get_font_size) METHODRET0(ganv_canvas, double, get_default_font_size) - METHOD1(ganv_canvas, export_dot, const char*, filename); - METHOD0(ganv_canvas, arrange); - METHOD2(ganv_canvas, move_contents_to, double, x, double, y); - - RW_PROPERTY(double, width) - RW_PROPERTY(double, height) - METHOD2(ganv_canvas, resize, double, width, double, height); - - RW_PROPERTY(GanvDirection, direction); - - METHOD2(ganv_canvas, for_each_node, - GanvNodeFunction, f, void*, data) - - METHOD2(ganv_canvas, for_each_selected_node, - GanvNodeFunction, f, void*, data) - - typedef void (*EdgePtrFunction)(GanvEdge* edge, void* data); - - void for_each_edge(EdgePtrFunction f, void* data); - void for_each_selected_edge(EdgePtrFunction f, void* data); + METHOD2(ganv_canvas, for_each_node, GanvNodeFunc, f, void*, data) + METHOD2(ganv_canvas, for_each_selected_node, GanvNodeFunc, f, void*, data) METHOD2(ganv_canvas, for_each_edge_from, const GanvNode*, tail, - GanvEdgeFunction, f); + GanvEdgeFunc, f); METHOD2(ganv_canvas, for_each_edge_to, const GanvNode*, head, - GanvEdgeFunction, f); + GanvEdgeFunc, f); METHOD2(ganv_canvas, for_each_edge_on, const GanvNode*, node, - GanvEdgeFunction, f); + GanvEdgeFunc, f); METHOD0(ganv_canvas, get_move_cursor); + RW_PROPERTY(gboolean, locked); + RW_PROPERTY(double, width) + RW_PROPERTY(double, height) + RW_PROPERTY(GanvDirection, direction); + + Gtk::Layout& widget(); + + /** Get the edge from @c tail to @c head if one exists. */ + Edge* get_edge(Node* tail, Node* head) const; + + /** Delete the edge from @c tail to @c head. */ + void remove_edge(Node* tail, Node* head); + + typedef void (*EdgePtrFunc)(GanvEdge* edge, void* data); + + void for_each_edge(EdgePtrFunc f, void* data); + void for_each_selected_edge(EdgePtrFunc f, void* data); + void get_scroll_offsets(int& cx, int& cy) const; void scroll_to(int x, int y); diff --git a/ganv/Item.hpp b/ganv/Item.hpp index 831f402..08ad2d3 100644 --- a/ganv/Item.hpp +++ b/ganv/Item.hpp @@ -70,8 +70,8 @@ public: GanvItem* gobj() const { return _gobj; } - SIGNAL(event, GdkEvent*) - SIGNAL(click, GdkEventButton*) + SIGNAL1(event, GdkEvent*) + SIGNAL1(click, GdkEventButton*) protected: GanvItem* const _gobj; diff --git a/ganv/Module.hpp b/ganv/Module.hpp index f313bb2..6984a70 100644 --- a/ganv/Module.hpp +++ b/ganv/Module.hpp @@ -116,11 +116,9 @@ public: } } - void for_each_port(GanvPortFunction f, void* data) { - ganv_module_for_each_port(gobj(), f, data); - } + METHOD2(ganv_module, for_each_port, GanvPortFunc, f, void*, data); - guint num_ports() const { return ganv_module_num_ports(gobj()); } + METHODRET0(ganv_module, guint, num_ports); RW_PROPERTY(gboolean, stacked) diff --git a/ganv/canvas.h b/ganv/canvas.h index 0b3583a..b7e4dd3 100644 --- a/ganv/canvas.h +++ b/ganv/canvas.h @@ -116,9 +116,9 @@ ganv_canvas_arrange(GanvCanvas* canvas); void ganv_canvas_export_dot(GanvCanvas* canvas, const char* filename); -typedef void (*GanvNodeFunction)(GanvNode* node, void* data); +typedef void (*GanvNodeFunc)(GanvNode* node, void* data); -typedef void (*GanvEdgeFunction)(GanvEdge* edge); +typedef void (*GanvEdgeFunc)(GanvEdge* edge); /** * ganv_canvas_for_each_node: @@ -127,14 +127,14 @@ typedef void (*GanvEdgeFunction)(GanvEdge* edge); * @data: Data to pass to @f. */ void -ganv_canvas_for_each_node(GanvCanvas* canvas, - GanvNodeFunction f, - void* data); +ganv_canvas_for_each_node(GanvCanvas* canvas, + GanvNodeFunc f, + void* data); void -ganv_canvas_for_each_selected_node(GanvCanvas* canvas, - GanvNodeFunction f, - void* data); +ganv_canvas_for_each_selected_node(GanvCanvas* canvas, + GanvNodeFunc f, + void* data); /** * ganv_canvas_for_each_edge: @@ -143,9 +143,9 @@ ganv_canvas_for_each_selected_node(GanvCanvas* canvas, * @data: Data to pass to @f. */ void -ganv_canvas_for_each_edge(GanvCanvas* canvas, - GanvEdgeFunction f, - void* data); +ganv_canvas_for_each_edge(GanvCanvas* canvas, + GanvEdgeFunc f, + void* data); /** * ganv_canvas_for_each_edge_from: @@ -154,9 +154,9 @@ ganv_canvas_for_each_edge(GanvCanvas* canvas, * @f: (scope call): A function to call on every edge leaving @tail. */ void -ganv_canvas_for_each_edge_from(GanvCanvas* canvas, - const GanvNode* tail, - GanvEdgeFunction f); +ganv_canvas_for_each_edge_from(GanvCanvas* canvas, + const GanvNode* tail, + GanvEdgeFunc f); /** * ganv_canvas_for_each_edge_to: @@ -165,9 +165,9 @@ ganv_canvas_for_each_edge_from(GanvCanvas* canvas, * @f: (scope call): A function to call on every edge entering @head. */ void -ganv_canvas_for_each_edge_to(GanvCanvas* canvas, - const GanvNode* head, - GanvEdgeFunction f); +ganv_canvas_for_each_edge_to(GanvCanvas* canvas, + const GanvNode* head, + GanvEdgeFunc f); /** * ganv_canvas_for_each_edge_on: @@ -176,9 +176,9 @@ ganv_canvas_for_each_edge_to(GanvCanvas* canvas, * @f: (scope call): A function to call on every edge attached to @node. */ void -ganv_canvas_for_each_edge_on(GanvCanvas* canvas, - const GanvNode* node, - GanvEdgeFunction f); +ganv_canvas_for_each_edge_on(GanvCanvas* canvas, + const GanvNode* node, + GanvEdgeFunc f); /** * ganv_canvas_destroy: diff --git a/ganv/module.h b/ganv/module.h index 375be67..31b76b1 100644 --- a/ganv/module.h +++ b/ganv/module.h @@ -33,7 +33,7 @@ G_BEGIN_DECLS typedef struct _GanvModuleClass GanvModuleClass; typedef struct _GanvModuleImpl GanvModuleImpl; -typedef void (*GanvPortFunction)(GanvPort* port, void* data); +typedef void (*GanvPortFunc)(GanvPort* port, void* data); struct _GanvModule { GanvBox box; @@ -86,9 +86,9 @@ ganv_module_set_direction(GanvModule* module, * @data: User data to pass to @f. */ void -ganv_module_for_each_port(GanvModule* module, - GanvPortFunction f, - void* data); +ganv_module_for_each_port(GanvModule* module, + GanvPortFunc f, + void* data); G_END_DECLS diff --git a/ganv/wrap.hpp b/ganv/wrap.hpp index 353c700..f0b95bb 100644 --- a/ganv/wrap.hpp +++ b/ganv/wrap.hpp @@ -70,7 +70,7 @@ prefix##_##name(gobj(), a1, a2); \ } -#define SIGNAL(name, argtype) \ +#define SIGNAL1(name, argtype) \ public: \ virtual bool on_##name(argtype arg) { \ return _signal_##name.emit(arg); \ |