summaryrefslogtreecommitdiffstats
path: root/ganv/Circle.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-06 21:01:38 +0000
committerDavid Robillard <d@drobilla.net>2011-12-06 21:01:38 +0000
commit0731f12beaa0cfc0de56dc05ca3814143fd394a5 (patch)
treed8a98ee48badba378172d3a1c46fba2f2e266d37 /ganv/Circle.hpp
downloadganv-0731f12beaa0cfc0de56dc05ca3814143fd394a5.tar.gz
ganv-0731f12beaa0cfc0de56dc05ca3814143fd394a5.tar.bz2
ganv-0731f12beaa0cfc0de56dc05ca3814143fd394a5.zip
FlowCanvas's successor is hereby dubbed Ganv.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@3820 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'ganv/Circle.hpp')
-rw-r--r--ganv/Circle.hpp82
1 files changed, 82 insertions, 0 deletions
diff --git a/ganv/Circle.hpp b/ganv/Circle.hpp
new file mode 100644
index 0000000..beb1be5
--- /dev/null
+++ b/ganv/Circle.hpp
@@ -0,0 +1,82 @@
+/* This file is part of Ganv.
+ * Copyright 2007-2011 David Robillard <http://drobilla.net>
+ *
+ * Ganv is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free
+ * Software Foundation, either version 3 of the License, or (at your option)
+ * any later version.
+ *
+ * Ganv is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Ganv. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GANV_CIRCLE_HPP
+#define GANV_CIRCLE_HPP
+
+#include <algorithm>
+#include <map>
+#include <string>
+#include <stdint.h>
+
+#include <gdkmm/types.h>
+
+#include "ganv/types.hpp"
+#include "ganv/Node.hpp"
+#include "ganv/circle.h"
+
+GANV_GLIB_WRAP(Circle)
+
+namespace Ganv {
+
+class Canvas;
+
+/** An elliptical Item which is Node.
+ *
+ * Unlike a Module, this doesn't contain ports, but is directly joinable itself
+ * (think your classic circles 'n' lines diagram, ala FSM).
+ *
+ * @ingroup Ganv
+ */
+class Circle : public Node
+{
+public:
+ static const uint32_t FILL_COLOUR = 0x1E2224FF;
+ static const uint32_t BORDER_COLOUR = 0xD3D7CFFF;
+
+ Circle(Canvas& canvas,
+ const std::string& name,
+ double x,
+ double y,
+ double radius,
+ bool show_title)
+ : Node(&canvas,
+ GANV_NODE(
+ gnome_canvas_item_new(
+ GNOME_CANVAS_GROUP(canvas.root()),
+ ganv_circle_get_type(),
+ "x", x,
+ "y", y,
+ "can-tail", TRUE,
+ "can-head", TRUE,
+ "radius", radius,
+ "fill-color", FILL_COLOUR,
+ "border-color", BORDER_COLOUR,
+ "label", name.c_str(),
+ "draggable", TRUE,
+ NULL)))
+ {}
+
+ RW_PROPERTY(double, radius);
+
+ GanvCircle* gobj() { return GANV_CIRCLE(_gobj); }
+ const GanvCircle* gobj() const { return GANV_CIRCLE(_gobj); }
+};
+
+} // namespace Ganv
+
+#endif // GANV_CIRCLE_HPP