1 /* === S Y N F I G ========================================================= */
2 /*! \file docks/dockable.h
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_STUDIO_DOCKABLE_H
26 #define __SYNFIG_STUDIO_DOCKABLE_H
28 /* === H E A D E R S ======================================================= */
30 #include <gtkmm/stockid.h>
31 #include <gtkmm/button.h>
32 #include "dialogsettings.h"
33 #include <synfig/string.h>
34 #include <gtkmm/table.h>
35 #include <gtkmm/tooltips.h>
36 #include <gtkmm/label.h>
37 #include <gtkmm/frame.h>
38 #include <gtkmm/handlebox.h>
39 #include <gtkmm/box.h>
40 #include <gtkmm/scrolledwindow.h>
41 #include <gtkmm/toolbar.h>
42 #include <gtkmm/toolbutton.h>
44 /* === M A C R O S ========================================================= */
46 /* === T Y P E D E F S ===================================================== */
48 /* === C L A S S E S & S T R U C T S ======================================= */
55 class Dockable : public Gtk::Table
57 friend class DockManager;
58 friend class DockBook;
61 sigc::signal<void> signal_stock_id_changed_;
62 sigc::connection prev_widget_delete_connection;
65 // DialogSettings dialog_settings;
70 Gtk::Toolbar *toolbar_;
73 synfig::String local_name_;
74 Gtk::Tooltips tooltips_;
76 Gtk::Label title_label_;
77 //Gtk::HBox button_box_;
78 Gtk::HBox header_box_;
80 //Gtk::HandleBox handle_box_;
81 Gtk::ScrolledWindow *scrolled_;
82 Gtk::Widget *prev_widget_;
86 Gtk::StockID stock_id_;
94 void set_toolbar(Gtk::Toolbar& toolbar);
96 void set_use_scrolled(bool x) { use_scrolled_=x; }
98 Dockable(const synfig::String& name,const synfig::String& local_name,Gtk::StockID stock_id_=Gtk::StockID(" "));
101 sigc::signal<void>& signal_stock_id_changed() { return signal_stock_id_changed_; }
103 const synfig::String& get_name()const { return name_; }
104 const synfig::String& get_local_name()const { return local_name_; }
106 const Gtk::StockID& get_stock_id()const { return stock_id_; }
107 void set_stock_id(Gtk::StockID x) { stock_id_=x; signal_stock_id_changed()(); }
109 void set_local_name(const synfig::String&);
113 Gtk::Tooltips& get_tooltips() { return tooltips_; }
115 //DialogSettings& settings() { return dialog_settings; }
116 //const DialogSettings& settings()const { return dialog_settings; }
118 void add(Gtk::Widget& x);
120 Gtk::ToolButton* add_button(const Gtk::StockID& stock_id, const synfig::String& tooltip=synfig::String());
126 void attach_dnd_to(Gtk::Widget& widget);
128 bool clear_previous();
129 virtual Gtk::Widget* create_tab_label();
133 void on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, Gtk::SelectionData& selection_data, guint info, guint time);
134 void on_drag_end(const Glib::RefPtr<Gdk::DragContext>&context);
135 void on_drag_begin(const Glib::RefPtr<Gdk::DragContext>&context);
136 void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int, int, const Gtk::SelectionData& selection_data, guint, guint time);
138 }; // END of studio::Dockable
140 }; // END of namespace studio
142 /* === E N D =============================================================== */