aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui/NodeView.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-02-12 03:52:47 +0000
committerDavid Robillard <d@drobilla.net>2007-02-12 03:52:47 +0000
commita795ba2553d1663bc29b8e8fa3186efb516f27d4 (patch)
tree16f03f2ed3d1560f2af89b8e5ba4e85612cc6b30 /src/gui/NodeView.cpp
parent547d2e751fe03b6c2e81beef8fad27a31b5905e8 (diff)
downloadmachina-a795ba2553d1663bc29b8e8fa3186efb516f27d4.tar.gz
machina-a795ba2553d1663bc29b8e8fa3186efb516f27d4.tar.bz2
machina-a795ba2553d1663bc29b8e8fa3186efb516f27d4.zip
Added missing files.
git-svn-id: http://svn.drobilla.net/lad/machina@305 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/NodeView.cpp')
-rw-r--r--src/gui/NodeView.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/gui/NodeView.cpp b/src/gui/NodeView.cpp
new file mode 100644
index 0000000..62be95b
--- /dev/null
+++ b/src/gui/NodeView.cpp
@@ -0,0 +1,54 @@
+/* This file is part of Machina.
+ * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
+ *
+ * Machina 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 2 of the License, or (at your option) any later
+ * version.
+ *
+ * Machina 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "NodeView.hpp"
+#include <iostream>
+
+NodeView::NodeView(SharedPtr<Machina::Node> node,
+ SharedPtr<LibFlowCanvas::FlowCanvas> canvas,
+ const std::string& name,
+ double x,
+ double y)
+ : LibFlowCanvas::Ellipse(canvas, name, x, y, 20, 20, false)
+ , _node(node)
+{
+ //signal_double_clicked.connect(sigc::mem_fun(this, &NodeView::on_double_click));
+}
+
+
+void
+NodeView::on_double_click(GdkEventButton*)
+{
+ bool is_initial = _node->is_initial();
+ std::cerr << "INITIAL " << is_initial;
+ _node->set_initial( ! is_initial );
+}
+
+void
+NodeView::update_state()
+{
+ static const uint32_t active_color = 0x80808AFF;
+
+ if (_node->is_active()) {
+ if (_color != active_color) {
+ _old_color = _color;
+ set_base_color(active_color);
+ }
+ } else if (_color == active_color) {
+ set_base_color(_old_color);
+ }
+}