From 3b63d9fa3114f0292561484f299d9d45ec451c17 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 15 Mar 2014 22:35:18 +0000 Subject: Clean up public canvas interface. Eliminate thin C wrappers around C++ methods (move actual implementation into C). git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5338 a436a847-0d15-0410-975c-d299462d15a1 --- ganv/Canvas.hpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'ganv/Canvas.hpp') diff --git a/ganv/Canvas.hpp b/ganv/Canvas.hpp index 7b71642..b3281ad 100644 --- a/ganv/Canvas.hpp +++ b/ganv/Canvas.hpp @@ -61,7 +61,6 @@ public: 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) @@ -71,7 +70,10 @@ public: METHOD2(ganv_canvas, resize, double, width, double, height); 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, GanvEdgeFunc, f, void*, data) + METHOD2(ganv_canvas, for_each_selected_edge, GanvEdgeFunc, f, void*, data) METHODRET0(ganv_canvas, gboolean, empty) + METHOD2(ganv_canvas, scroll_to, int, x, int, y); METHOD3(ganv_canvas, for_each_edge_from, const GanvNode*, tail, @@ -95,7 +97,9 @@ public: RW_PROPERTY(double, height) RW_PROPERTY(GanvDirection, direction); - Gtk::Layout& widget(); + Gtk::Layout& widget() { + return *Glib::wrap(&_gobj->layout); + } /** Get the edge from @c tail to @c head if one exists. */ Edge* get_edge(Node* tail, Node* head) const; @@ -105,18 +109,18 @@ public: void remove_edge(Edge* edge); - void for_each_edge(GanvEdgeFunc f, void* data); - void for_each_selected_edge(GanvEdgeFunc f, void* data); - - void get_scroll_offsets(int& cx, int& cy) const; - void scroll_to(int x, int y); + void get_scroll_offsets(int& cx, int& cy) const { + ganv_canvas_get_scroll_offsets(gobj(), &cx, &cy); + } GQuark wrapper_key(); - GanvItem* root(); + GanvItem* root() { + return ganv_canvas_root(gobj()); + } - GanvCanvas* gobj(); - const GanvCanvas* gobj() const; + GanvCanvas* gobj() { return GANV_CANVAS(_gobj); } + const GanvCanvas* gobj() const { return GANV_CANVAS(_gobj); } sigc::signal signal_event; sigc::signal signal_connect; @@ -126,11 +130,6 @@ private: Canvas(const Canvas&); ///< Noncopyable const Canvas& operator=(const Canvas&); ///< Noncopyable - inline GanvCanvasImpl* impl() { return _gobj->impl; } - inline const GanvCanvasImpl* impl() const { return _gobj->impl; } - - sigc::connection _animate_connection; - GanvCanvas* const _gobj; }; -- cgit v1.2.1