00001 #ifndef K3DSDK_NGUI_DOCUMENT_STATE_H 00002 #define K3DSDK_NGUI_DOCUMENT_STATE_H 00003 00004 // K-3D 00005 // Copyright (c) 1995-2006, Timothy M. Shead 00006 // 00007 // Contact: tshead@k-3d.com 00008 // 00009 // This program is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU General Public 00011 // License as published by the Free Software Foundation; either 00012 // version 2 of the License, or (at your option) any later version. 00013 // 00014 // This program is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 // General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU General Public 00020 // License along with this program; if not, write to the Free Software 00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 00027 #include <k3dsdk/data.h> 00028 #include <k3dsdk/iproperty_collection.h> 00029 #include <k3dsdk/selection.h> 00030 00031 #include <glibmm/refptr.h> 00032 #include <glibmm/ustring.h> 00033 00034 #include <gdk/gdkglcontext.h> 00035 00036 namespace Gdk { class Pixbuf; } 00037 namespace Gtk { class Window; } 00038 namespace k3d { class ianimation_render_engine; } 00039 namespace k3d { class idocument; } 00040 namespace k3d { class inode; } 00041 namespace k3d { class ipreview_render_engine; } 00042 namespace k3d { class istill_render_engine; } 00043 namespace k3d { namespace ngui { class unsaved_document; } } 00044 00045 namespace k3d 00046 { 00047 00048 namespace ngui 00049 { 00050 00051 class tool; 00052 namespace viewport { class control; } 00053 00055 class document_state : 00056 public sigc::trackable 00057 { 00058 public: 00059 document_state(k3d::idocument& Document); 00060 ~document_state(); 00061 00063 k3d::idocument& document(); 00064 00066 sigc::connection connect_safe_close_signal(const sigc::slot<unsaved_document*>& Slot); 00068 bool safe_close(Gtk::Window& Parent); 00069 00071 GdkGLContext* gdkgl_share_list(); 00072 00074 typedef sigc::signal<void> document_selection_change_signal_t; 00076 document_selection_change_signal_t& document_selection_change_signal(); 00077 00079 tool& active_tool(); 00081 void set_active_tool(tool& ActiveTool); 00083 sigc::connection connect_active_tool_changed_signal(const sigc::slot<void>& Slot); 00084 00086 tool* get_tool(const k3d::string_t& Name); 00087 00089 tool& selection_tool(); 00091 tool& move_tool(); 00093 tool& rotate_tool(); 00095 tool& scale_tool(); 00096 00098 bool pick_backfacing(); 00099 00101 bool paint_backfacing(); 00102 00104 bool rubber_band_backfacing(); 00105 00107 typedef sigc::signal<void, const Glib::RefPtr<Gdk::Pixbuf> > set_cursor_signal_t; 00109 set_cursor_signal_t& set_cursor_signal(); 00111 typedef sigc::signal<void> clear_cursor_signal_t; 00113 clear_cursor_signal_t& clear_cursor_signal(); 00114 00116 viewport::control* get_focus_viewport() { return m_focus_viewport; } 00118 void set_focus_viewport(viewport::control* Viewport) { m_focus_viewport = Viewport; } 00119 00121 void popup_context_menu(const bool UserAction = true); 00122 00123 private: 00124 class implementation; 00125 implementation* const m_implementation; 00126 00127 void on_document_close(); 00128 00130 viewport::control* m_focus_viewport; 00131 }; 00132 00133 } // namespace ngui 00134 00135 } // namespace k3d 00136 00137 #endif // !K3DSDK_NGUI_DOCUMENT_STATE_H 00138
1.6.3