- Main Page
- Related Pages
- Namespaces
- Classes
- Files

# dockable.h

Go to the documentation of this file.

    00001 /* === S Y N F I G ========================================================= */
    00021 /* ========================================================================= */
    00022
    00023 /* === S T A R T =========================================================== */
    00024
    00025 #ifndef __SYNFIG_STUDIO_DOCKABLE_H
    00026 #define __SYNFIG_STUDIO_DOCKABLE_H
    00027
    00028 /* === H E A D E R S ======================================================= */
    00029
    00030 #include <gtkmm/stockid.h>
    00031 #include <gtkmm/button.h>
    00032 #include "dialogsettings.h"
    00033 #include <synfig/string.h>
    00034 #include <gtkmm/table.h>
    00035 #include <gtkmm/tooltips.h>
    00036 #include <gtkmm/label.h>
    00037 #include <gtkmm/frame.h>
    00038 #include <gtkmm/handlebox.h>
    00039 #include <gtkmm/box.h>
    00040 #include <gtkmm/scrolledwindow.h>
    00041 #include <gtkmm/toolbar.h>
    00042 #include <gtkmm/toolbutton.h>
    00043
    00044 /* === M A C R O S ========================================================= */
    00045
    00046 /* === T Y P E D E F S ===================================================== */
    00047
    00048 /* === C L A S S E S & S T R U C T S ======================================= */
    00049
    00050 namespace studio {
    00051
    00052 class DockManager;
    00053 class DockBook;
    00054
    00055 class Dockable : public Gtk::Table
    00056 {
    00057     friend class DockManager;
    00058     friend class DockBook;
    00059
    00060
    00061     sigc::signal<void> signal_stock_id_changed_;
    00062     sigc::connection prev_widget_delete_connection;
    00063 protected:
    00064
    00065 //  DialogSettings dialog_settings;
    00066
    00067
    00068 private:
    00069
    00070     Gtk::Toolbar *toolbar_;
    00071
    00072     synfig::String name_;
    00073     synfig::String local_name_;
    00074     Gtk::Tooltips tooltips_;
    00075     Gtk::Frame frame_;
    00076     Gtk::Label title_label_;
    00077     //Gtk::HBox button_box_;
    00078     Gtk::HBox header_box_;
    00079     //Gtk::VBox vbox_;
    00080
    00081     //Gtk::HandleBox handle_box_;
    00082     Gtk::ScrolledWindow *scrolled_;
    00083     Gtk::Widget *prev_widget_;
    00084
    00085     bool use_scrolled_;
    00086
    00087     Gtk::StockID stock_id_;
    00088
    00089     DockBook* parent_;
    00090
    00091     bool dnd_success_;
    00092
    00093 public:
    00094     //Gtk::VBox* get_vbox() { return &vbox_; }
    00095
    00096     void set_toolbar(Gtk::Toolbar& toolbar);
    00097
    00098     void set_use_scrolled(bool x) { use_scrolled_=x; }
    00099
    00100     Dockable(const synfig::String& name,const synfig::String& local_name,Gtk::StockID stock_id_=Gtk::StockID(" "));
    00101     ~Dockable();
    00102
    00103     sigc::signal<void>& signal_stock_id_changed() { return signal_stock_id_changed_; }
    00104
    00105     const synfig::String& get_name()const { return name_; }
    00106     const synfig::String& get_local_name()const { return local_name_; }
    00107
    00108     const Gtk::StockID& get_stock_id()const { return stock_id_; }
    00109     void set_stock_id(Gtk::StockID x) { stock_id_=x; signal_stock_id_changed()(); }
    00110
    00111     void set_local_name(const synfig::String&);
    00112
    00113     void clear();
    00114
    00115     Gtk::Tooltips& get_tooltips() { return tooltips_; }
    00116
    00117     //DialogSettings& settings() { return dialog_settings; }
    00118     //const DialogSettings& settings()const { return dialog_settings; }
    00119
    00120     void add(Gtk::Widget& x);
    00121
    00122     Gtk::ToolButton* add_button(const Gtk::StockID& stock_id, const synfig::String& tooltip=synfig::String());
    00123
    00124     void detach();
    00125
    00126     void present();
    00127
    00128     void attach_dnd_to(Gtk::Widget& widget);
    00129
    00130     bool clear_previous();
    00131     virtual Gtk::Widget* create_tab_label();
    00132
    00133 private:
    00134
    00135     void on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, Gtk::SelectionData& selection_data, guint info, guint time);
    00136     void on_drag_end(const Glib::RefPtr<Gdk::DragContext>&context);
    00137     void on_drag_begin(const Glib::RefPtr<Gdk::DragContext>&context);
    00138     void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int, int, const Gtk::SelectionData& selection_data, guint, guint time);
    00139
    00140 }; // END of studio::Dockable
    00141
    00142 }; // END of namespace studio
    00143
    00144 /* === E N D =============================================================== */
    00145
    00146 #endif