source: synfigstudio/trunk/fuentes/src/gui/docks/dockable.h @ 481

Last change on this file since 481 was 481, checked in by jrpelegrina, 4 years ago

First release to xenial

File size: 3.8 KB
Line 
1/* === S Y N F I G ========================================================= */
2/*!     \file docks/dockable.h
3**      \brief Template Header
4**
5**      $Id$
6**
7**      \legal
8**      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9**
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.
14**
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.
19**      \endlegal
20*/
21/* ========================================================================= */
22
23/* === S T A R T =========================================================== */
24
25#ifndef __SYNFIG_STUDIO_DOCKABLE_H
26#define __SYNFIG_STUDIO_DOCKABLE_H
27
28/* === H E A D E R S ======================================================= */
29
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/tooltip.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>
43
44/* === M A C R O S ========================================================= */
45
46/* === T Y P E D E F S ===================================================== */
47
48/* === C L A S S E S & S T R U C T S ======================================= */
49
50namespace studio {
51
52class DockManager;
53class DockBook;
54
55class Dockable : public Gtk::Table
56{
57        friend class DockManager;
58        friend class DockBook;
59
60
61        sigc::signal<void> signal_stock_id_changed_;
62        sigc::connection prev_widget_delete_connection;
63protected:
64
65//      DialogSettings dialog_settings;
66
67
68private:
69
70        Gtk::Toolbar *toolbar_;
71
72        synfig::String name_;
73        synfig::String local_name_;
74        Gtk::Frame frame_;
75        Gtk::Label title_label_;
76        //Gtk::HBox button_box_;
77        Gtk::HBox header_box_;
78
79        //Gtk::HandleBox handle_box_;
80        Gtk::ScrolledWindow *scrolled_;
81        Gtk::Widget *prev_widget_;
82
83        bool use_scrolled_;
84
85        Gtk::StockID stock_id_;
86
87        bool dnd_success_;
88
89public:
90
91        void set_toolbar(Gtk::Toolbar& toolbar);
92
93        void set_use_scrolled(bool x) { use_scrolled_=x; }
94
95        Dockable(const synfig::String& name,const synfig::String& local_name,Gtk::StockID stock_id_=Gtk::StockID(" "));
96        ~Dockable();
97
98        sigc::signal<void>& signal_stock_id_changed() { return signal_stock_id_changed_; }
99
100        const synfig::String& get_name()const { return name_; }
101        const synfig::String& get_local_name()const { return local_name_; }
102
103        const Gtk::StockID& get_stock_id()const { return stock_id_; }
104        void set_stock_id(Gtk::StockID x) { stock_id_=x; signal_stock_id_changed()(); }
105
106        void set_local_name(const synfig::String&);
107
108        void clear();
109
110        //DialogSettings& settings() { return dialog_settings; }
111        //const DialogSettings& settings()const { return dialog_settings; }
112
113        void add(Gtk::Widget& x);
114
115        Gtk::ToolButton* add_button(const Gtk::StockID& stock_id, const synfig::String& tooltip=synfig::String());
116
117        virtual void present();
118
119        void attach_dnd_to(Gtk::Widget& widget);
120
121        bool clear_previous();
122        virtual Gtk::Widget* create_tab_label();
123
124private:
125
126        void on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, Gtk::SelectionData& selection_data, guint info, guint time);
127        void on_drag_end(const Glib::RefPtr<Gdk::DragContext>&context);
128        void on_drag_begin(const Glib::RefPtr<Gdk::DragContext>&context);
129        void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int, int, const Gtk::SelectionData& selection_data, guint, guint time);
130
131}; // END of studio::Dockable
132
133}; // END of namespace studio
134
135/* === E N D =============================================================== */
136
137#endif
Note: See TracBrowser for help on using the repository browser.