2
* \brief Generic Panel widget - A generic dockable container.
5
* Bryce Harrington <bryce@bryceharrington.org>
6
* Jon A. Cruz <jon@joncruz.org>
8
* Copyright (C) 2004 Bryce Harrington
9
* Copyright (C) 2005 Jon A. Cruz
11
* Released under GNU GPL. Read the file 'COPYING' for more information.
14
#ifndef SEEN_INKSCAPE_UI_WIDGET_PANEL_H
15
#define SEEN_INKSCAPE_UI_WIDGET_PANEL_H
18
#include <gtkmm/arrow.h>
19
#include <gtkmm/box.h>
20
#include <gtkmm/button.h>
21
#include <gtkmm/buttonbox.h>
22
#include <gtkmm/eventbox.h>
23
#include <gtkmm/frame.h>
24
#include <gtkmm/label.h>
25
#include <gtkmm/menu.h>
26
#include <gtkmm/optionmenu.h>
27
#include <gtkmm/table.h>
28
#include <gtkmm/tooltips.h>
31
#include "ui/previewfillable.h"
32
#include "selection.h"
38
class Panel : public Gtk::VBox {
44
Panel(Glib::ustring const &label = "", gchar const *prefs_path = 0,
45
int verb_num = 0, Glib::ustring const &apply_label = "",
46
bool menu_desired = false);
48
gchar const *getPrefsPath() const;
49
void setLabel(Glib::ustring const &label);
50
Glib::ustring const &getLabel() const;
51
int const &getVerb() const;
52
Glib::ustring const &getApplyLabel() const;
54
virtual void setOrientation(Gtk::AnchorType how);
56
virtual void present(); //< request to be present
58
void restorePanelPrefs();
60
virtual void setDesktop(SPDesktop *desktop);
61
SPDesktop *getDesktop() { return _desktop; }
63
/** Signal accessors */
64
virtual sigc::signal<void, int> &signalResponse();
65
virtual sigc::signal<void> &signalPresent();
67
/** Methods providing a Gtk::Dialog like interface for adding buttons that emit Gtk::RESPONSE
68
* signals on click. */
69
Gtk::Button* addResponseButton (const Glib::ustring &button_text, int response_id);
70
Gtk::Button* addResponseButton (const Gtk::StockID &stock_id, int response_id);
71
void setDefaultResponse(int response_id);
72
void setResponseSensitive(int response_id, bool setting);
74
virtual sigc::signal<void, SPDesktop *, SPDocument *> &signalDocumentReplaced();
75
virtual sigc::signal<void, Inkscape::Application *, SPDesktop *> &signalActivateDesktop();
76
virtual sigc::signal<void, Inkscape::Application *, SPDesktop *> &signalDeactiveDesktop();
79
Gtk::Box *_getContents() { return &_contents; }
80
void _setTargetFillable(PreviewFillable *target);
81
void _regItem(Gtk::MenuItem* item, int group, int id);
83
virtual void _handleAction(int set_id, int item_id);
84
virtual void _apply();
86
virtual void _handleResponse(int response_id);
89
void _addResponseButton(Gtk::Button *button, int response_id);
90
Inkscape::Selection *_getSelection();
92
/** Tooltips object for all descendants to use */
93
Gtk::Tooltips _tooltips;
95
Glib::ustring const _prefs_path;
98
Gtk::AnchorType _anchor;
101
sigc::signal<void, int> _signal_response;
102
sigc::signal<void> _signal_present;
103
sigc::signal<void, SPDesktop *, SPDocument *> _signal_document_replaced;
104
sigc::signal<void, Inkscape::Application *, SPDesktop *> _signal_activate_desktop;
105
sigc::signal<void, Inkscape::Application *, SPDesktop *> _signal_deactive_desktop;
109
void _bounceCall(int i, int j);
111
void _popper(GdkEventButton *btn);
112
void _wrapToggled(Gtk::CheckMenuItem *toggler);
116
Glib::ustring _label;
117
Glib::ustring _apply_label;
121
Gtk::VBox _right_bar;
123
Gtk::Label _tab_title;
124
Gtk::Arrow _temp_arrow;
125
Gtk::EventBox _menu_popper;
126
Gtk::Button _close_button;
128
Gtk::HButtonBox *_action_area; //< stores response buttons
129
std::vector<Gtk::Widget *> _non_horizontal;
130
std::vector<Gtk::Widget *> _non_vertical;
131
PreviewFillable *_fillable;
133
/** A map to store which widget that emits a certain response signal */
134
typedef std::map<int, Gtk::Widget *> ResponseMap;
135
ResponseMap _response_map;
138
} // namespace Widget
140
} // namespace Inkscape
142
#endif // SEEN_INKSCAPE_UI_WIDGET_PANEL_H
147
c-file-style:"stroustrup"
148
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
153
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :