initial version
[synfig.git] / synfig-studio / trunk / src / gtkmm / layeractionmanager.h
diff --git a/synfig-studio/trunk/src/gtkmm/layeractionmanager.h b/synfig-studio/trunk/src/gtkmm/layeractionmanager.h
new file mode 100644 (file)
index 0000000..4e6a1ee
--- /dev/null
@@ -0,0 +1,107 @@
+/* === S I N F G =========================================================== */
+/*!    \file template.h
+**     \brief Template Header
+**
+**     $Id: layeractionmanager.h,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
+**
+**     \legal
+**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**
+**     This software and associated documentation
+**     are CONFIDENTIAL and PROPRIETARY property of
+**     the above-mentioned copyright holder.
+**
+**     You may not copy, print, publish, or in any
+**     other way distribute this software without
+**     a prior written agreement with
+**     the copyright holder.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SINFG_LAYER_ACTION_MANAGER_H
+#define __SINFG_LAYER_ACTION_MANAGER_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <gtkmm/uimanager.h>
+#include <gtkmm/treeview.h>
+#include <sinfgapp/canvasinterface.h>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace studio {
+
+class LayerTree;
+
+class LayerActionManager
+{
+       Glib::RefPtr<Gtk::UIManager> ui_manager_;
+       //Glib::RefPtr<Gtk::TreeSelection> tree_selection_;
+       LayerTree* layer_tree_;
+       etl::handle<sinfgapp::CanvasInterface> canvas_interface_;
+
+       Glib::RefPtr<Gtk::ActionGroup>  action_group_;
+       Gtk::UIManager::ui_merge_id     popup_id_;
+       
+
+       Glib::RefPtr<Gtk::ActionGroup> action_group_copy_paste;
+
+       Glib::RefPtr<Gtk::Action>       action_cut_;
+       Glib::RefPtr<Gtk::Action>       action_copy_;
+       Glib::RefPtr<Gtk::Action>       action_paste_;
+
+       Glib::RefPtr<Gtk::Action>       action_amount_inc_;
+       Glib::RefPtr<Gtk::Action>       action_amount_dec_;
+       Glib::RefPtr<Gtk::Action>       action_amount_;
+
+
+       std::list<sinfg::Layer::Handle> clipboard_;
+
+       
+       sigc::connection selection_changed_connection;
+
+       bool queued;
+       sigc::connection queue_refresh_connection;
+
+       std::list<sigc::connection> update_connection_list;
+
+       void cut();
+       void copy();
+       void paste();
+
+       void amount_inc();
+       void amount_dec();
+
+public:
+       void queue_refresh();
+
+       LayerActionManager();
+       ~LayerActionManager();
+
+       void set_ui_manager(const Glib::RefPtr<Gtk::UIManager> &x);
+       Glib::RefPtr<Gtk::UIManager> get_ui_manager()const { return ui_manager_; }
+
+       void set_layer_tree(LayerTree* x);
+       LayerTree* get_layer_tree()const { return layer_tree_; }
+
+       void set_canvas_interface(const etl::handle<sinfgapp::CanvasInterface> &x);
+       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const { return canvas_interface_; }
+
+       etl::loose_handle<sinfgapp::Instance> get_instance()const { return canvas_interface_->get_instance(); }
+
+       void refresh();
+       void clear();
+}; // END of LayerActionManager
+
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif