/* This file is part of Machina. * Copyright 2007-2011 David Robillard * * 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 3 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 more details. * * You should have received a copy of the GNU General Public License * along with Machina. If not, see . */ #ifndef MACHINA_CANVAS_HPP_HPP #define MACHINA_CANVAS_HPP_HPP #include #include "ganv/Canvas.hpp" #include "machina/types.hpp" using namespace Ganv; namespace Machina { namespace Client { class ClientObject; } namespace GUI { class MachinaGUI; class NodeView; class MachinaCanvas : public Canvas { public: MachinaCanvas(MachinaGUI* app, int width, int height); //void build(SPtr machine, bool show_labels); //void update_edges(); void on_new_object(SPtr object); void on_erase_object(SPtr object); MachinaGUI* app() { return _app; } protected: bool on_event(GdkEvent* event); bool node_clicked(WPtr item, GdkEventButton* ev); private: //SPtr create_node_view(SPtr node); void action_create_node(double x, double y); void action_connect(SPtr port1, SPtr port2); void action_disconnect(SPtr port1, SPtr port2); MachinaGUI* _app; WPtr _last_clicked; }; } // namespace Machina } // namespace GUI #endif // MACHINA_CANVAS_HPP_HPP