|
Carlos Lopez |
a09598 |
/* === S Y N F I G ========================================================= */
|
|
Nikita Kitaev |
5fe12e |
/*! \file docks/dockable.h
|
|
Carlos Lopez |
a09598 |
** \brief Template Header
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** $Id$
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** \legal
|
|
Carlos Lopez |
a09598 |
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** This package is free software; you can redistribute it and/or
|
|
Carlos Lopez |
a09598 |
** modify it under the terms of the GNU General Public License as
|
|
Carlos Lopez |
a09598 |
** published by the Free Software Foundation; either version 2 of
|
|
Carlos Lopez |
a09598 |
** the License, or (at your option) any later version.
|
|
Carlos Lopez |
a09598 |
**
|
|
Carlos Lopez |
a09598 |
** This package is distributed in the hope that it will be useful,
|
|
Carlos Lopez |
a09598 |
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Carlos Lopez |
a09598 |
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Carlos Lopez |
a09598 |
** General Public License for more details.
|
|
Carlos Lopez |
a09598 |
** \endlegal
|
|
Carlos Lopez |
a09598 |
*/
|
|
Carlos Lopez |
a09598 |
/* ========================================================================= */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === S T A R T =========================================================== */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
#ifndef __SYNFIG_STUDIO_DOCKABLE_H
|
|
Carlos Lopez |
a09598 |
#define __SYNFIG_STUDIO_DOCKABLE_H
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === H E A D E R S ======================================================= */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
#include "dialogsettings.h"
|
|
|
fda829 |
|
|
Carlos Lopez |
a09598 |
#include <synfig string.h=""></synfig>
|
|
|
fda829 |
|
|
|
fda829 |
#include <gtkmm stockid.h=""></gtkmm>
|
|
|
fda829 |
#include <gtkmm grid.h=""></gtkmm>
|
|
|
fda829 |
#include <gtkmm eventbox.h=""></gtkmm>
|
|
Carlos Lopez |
a09598 |
#include <gtkmm scrolledwindow.h=""></gtkmm>
|
|
Carlos Lopez |
a09598 |
#include <gtkmm toolbar.h=""></gtkmm>
|
|
Carlos Lopez |
a09598 |
#include <gtkmm toolbutton.h=""></gtkmm>
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === M A C R O S ========================================================= */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === T Y P E D E F S ===================================================== */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === C L A S S E S & S T R U C T S ======================================= */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
namespace studio {
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
class DockManager;
|
|
Carlos Lopez |
a09598 |
class DockBook;
|
|
Carlos Lopez |
a09598 |
|
|
|
fda829 |
class Dockable : public Gtk::Grid
|
|
Carlos Lopez |
a09598 |
{
|
|
|
fda829 |
private:
|
|
Carlos Lopez |
a09598 |
friend class DockManager;
|
|
Carlos Lopez |
a09598 |
friend class DockBook;
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
sigc::signal<void> signal_stock_id_changed_;</void>
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
synfig::String name_;
|
|
Carlos Lopez |
a09598 |
synfig::String local_name_;
|
|
Rodolfo Ribeiro Gomes |
563a05 |
|
|
Carlos Lopez |
a09598 |
Gtk::StockID stock_id_;
|
|
|
28a5c6 |
bool use_scrolled;
|
|
Carlos Lopez |
a09598 |
|
|
|
28a5c6 |
Gtk::ScrolledWindow *container;
|
|
|
28a5c6 |
Gtk::EventBox *toolbar_container;
|
|
Carlos Lopez |
a09598 |
bool dnd_success_;
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
public:
|
|
|
fda829 |
sigc::signal<void>& signal_stock_id_changed() { return signal_stock_id_changed_; }</void>
|
|
Carlos Lopez |
a09598 |
|
|
|
fda829 |
public:
|
|
|
fda829 |
Dockable(const synfig::String& name,const synfig::String& local_name, Gtk::StockID stock_id = Gtk::StockID(" "));
|
|
Carlos Lopez |
a09598 |
~Dockable();
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
const synfig::String& get_name()const { return name_; }
|
|
|
fda829 |
|
|
Carlos Lopez |
a09598 |
const synfig::String& get_local_name()const { return local_name_; }
|
|
Carlos Lopez |
a09598 |
void set_local_name(const synfig::String&);
|
|
Carlos Lopez |
a09598 |
|
|
|
fda829 |
bool get_use_scrolled() const;
|
|
|
fda829 |
void set_use_scrolled(bool x);
|
|
Carlos Lopez |
a09598 |
|
|
|
fda829 |
const Gtk::StockID& get_stock_id()const { return stock_id_; }
|
|
|
fda829 |
void set_stock_id(Gtk::StockID x) { stock_id_=x; signal_stock_id_changed()(); }
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
void add(Gtk::Widget& x);
|
|
|
fda829 |
void set_toolbar(Gtk::Toolbar& toolbar);
|
|
|
fda829 |
Gtk::ToolButton* add_button(const Gtk::StockID& stock_id, const synfig::String& tooltip = synfig::String());
|
|
Carlos Lopez |
a09598 |
|
|
|
28a5c6 |
void reset_container();
|
|
|
28a5c6 |
void reset_toolbar();
|
|
|
fda829 |
void clear();
|
|
Carlos Lopez |
a09598 |
|
|
|
aeb01c |
Gtk::ScrolledWindow* get_container() const
|
|
|
aeb01c |
{ return container; }
|
|
|
aeb01c |
|
|
Carlos Lopez |
a09598 |
void attach_dnd_to(Gtk::Widget& widget);
|
|
|
fda829 |
virtual void present();
|
|
Carlos Lopez |
a09598 |
virtual Gtk::Widget* create_tab_label();
|
|
Carlos Lopez |
a09598 |
|
|
Rodolfo Ribeiro Gomes |
9277d9 |
/// Appends serialized extra layout info of this dockable
|
|
Rodolfo Ribeiro Gomes |
9277d9 |
/// \param params[out] serialized data. It must not have ']' or '|' characters.
|
|
Rodolfo Ribeiro Gomes |
9277d9 |
virtual void write_layout_string(std::string ¶ms) const;
|
|
Rodolfo Ribeiro Gomes |
9277d9 |
virtual void read_layout_string(const std::string ¶ms) const;
|
|
Rodolfo Ribeiro Gomes |
9277d9 |
|
|
Carlos Lopez |
a09598 |
private:
|
|
Carlos Lopez |
a09598 |
void on_drag_data_get(const Glib::RefPtr<gdk::dragcontext>&, Gtk::SelectionData& selection_data, guint info, guint time);</gdk::dragcontext>
|
|
Carlos Lopez |
a09598 |
void on_drag_end(const Glib::RefPtr<gdk::dragcontext>&context);</gdk::dragcontext>
|
|
Carlos Lopez |
a09598 |
void on_drag_begin(const Glib::RefPtr<gdk::dragcontext>&context);</gdk::dragcontext>
|
|
Carlos Lopez |
a09598 |
void on_drag_data_received(const Glib::RefPtr<gdk::dragcontext>& context, int, int, const Gtk::SelectionData& selection_data, guint, guint time);</gdk::dragcontext>
|
|
Carlos Lopez |
a09598 |
}; // END of studio::Dockable
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
}; // END of namespace studio
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
/* === E N D =============================================================== */
|
|
Carlos Lopez |
a09598 |
|
|
Carlos Lopez |
a09598 |
#endif
|