Code

New widget helperclass for Gtk:Entry
[inkscape.git] / src / ui / widget / selected-style.h
1 /**
2  * \brief Selected style indicator (fill, stroke, opacity)
3  *
4  * Authors:
5  *   buliabyak@gmail.com
6  *   scislac@users.sf.net
7  *
8  * Copyright (C) 2005 authors
9  *
10  * Released under GNU GPL.  Read the file 'COPYING' for more information.
11  */
13 #ifndef INKSCAPE_UI_CURRENT_STYLE_H
14 #define INKSCAPE_UI_CURRENT_STYLE_H
16 #include <gtkmm/table.h>
17 #include <gtkmm/label.h>
18 #include <gtkmm/box.h>
19 #include <gtkmm/eventbox.h>
20 #include <gtkmm/enums.h>
21 #include <gtkmm/menu.h>
22 #include <gtkmm/menuitem.h>
23 #include <gtkmm/adjustment.h>
24 #include <gtkmm/spinbutton.h>
26 #include <sigc++/sigc++.h>
28 #include <glibmm/i18n.h>
30 #include <desktop.h>
32 #include "button.h"
34 class SPUnit;
36 namespace Inkscape {
37 namespace UI {
38 namespace Widget {
40 enum {
41     SS_NA,
42     SS_NONE,
43     SS_UNSET,
44     SS_PATTERN,
45     SS_LGRADIENT,
46     SS_RGRADIENT,
47     SS_MANY,
48     SS_COLOR
49 };
51 enum {
52     SS_FILL,
53     SS_STROKE
54 };
56 class SelectedStyle : public Gtk::HBox
57 {
58 public:
59     SelectedStyle(bool layout = true);
61     ~SelectedStyle();
63     void setDesktop(SPDesktop *desktop);
64     void update();
66 protected:
67     SPDesktop *_desktop;
69     Gtk::Table _table;
71     Gtk::Label _fill_label;
72     Gtk::Label _stroke_label;
73     Gtk::Label _opacity_label;
75     Gtk::EventBox _fill_place;
76     Gtk::EventBox _stroke_place;
78     Gtk::EventBox _fill_flag_place;
79     Gtk::EventBox _stroke_flag_place;
81     Gtk::EventBox _opacity_place;
82     Gtk::Adjustment _opacity_adjustment;
83     Gtk::SpinButton _opacity_sb;
85     Gtk::Label _na[2];
86     Glib::ustring __na[2];
88     Gtk::Label _none[2];
89     Glib::ustring __none[2];
91     Gtk::Label _pattern[2];
92     Glib::ustring __pattern[2];
94     Gtk::Label _lgradient[2];
95     Glib::ustring __lgradient[2];
97     Gtk::Label _rgradient[2];
98     Glib::ustring __rgradient[2];
100     Gtk::Label _many[2];
101     Glib::ustring __many[2];
103     Gtk::Label _unset[2];
104     Glib::ustring __unset[2];
106     Gtk::Widget *_color_preview[2];
107     Glib::ustring __color[2];
109     Gtk::Label _averaged[2];
110     Glib::ustring __averaged[2];
111     Gtk::Label _multiple[2];
112     Glib::ustring __multiple[2];
114     Gtk::HBox _stroke;
115     Gtk::EventBox _stroke_width_place;
116     Gtk::Label _stroke_width;
118     guint32 _lastselected[2];
119     guint32 _thisselected[2];
120     Glib::ustring _paintserver_id[2];
122     guint _mode[2];
124     sigc::connection *selection_changed_connection;
125     sigc::connection *selection_modified_connection;
126     sigc::connection *subselection_changed_connection;
128     static void dragDataReceived( GtkWidget *widget,
129                                   GdkDragContext *drag_context,
130                                   gint x, gint y,
131                                   GtkSelectionData *data,
132                                   guint info,
133                                   guint event_time,
134                                   gpointer user_data );
136     bool on_fill_click(GdkEventButton *event);
137     bool on_stroke_click(GdkEventButton *event);
138     bool on_opacity_click(GdkEventButton *event);
139     bool on_sw_click(GdkEventButton *event);
141     bool _opacity_blocked;
142     void on_opacity_changed();
143     void on_opacity_menu(Gtk::Menu *menu);
144     void opacity_0();
145     void opacity_025();
146     void opacity_05();
147     void opacity_075();
148     void opacity_1();
150     void on_fill_remove();
151     void on_stroke_remove();
152     void on_fill_lastused();
153     void on_stroke_lastused();
154     void on_fill_lastselected();
155     void on_stroke_lastselected();
156     void on_fill_unset();
157     void on_stroke_unset();
158     void on_fill_edit();
159     void on_stroke_edit();
160     void on_fillstroke_swap();
161     void on_fill_invert();
162     void on_stroke_invert();
163     void on_fill_white();
164     void on_stroke_white();
165     void on_fill_black();
166     void on_stroke_black();
167     void on_fill_copy();
168     void on_stroke_copy();
169     void on_fill_paste();
170     void on_stroke_paste();
171     void on_fill_opaque();
172     void on_stroke_opaque();
174     Gtk::Menu _popup[2];
175     Gtk::MenuItem _popup_edit[2];
176     Gtk::MenuItem _popup_lastused[2];
177     Gtk::MenuItem _popup_lastselected[2];
178     Gtk::MenuItem _popup_invert[2];
179     Gtk::MenuItem _popup_white[2];
180     Gtk::MenuItem _popup_black[2];
181     Gtk::MenuItem _popup_copy[2];
182     Gtk::MenuItem _popup_paste[2];
183     Gtk::MenuItem _popup_swap[2];
184     Gtk::MenuItem _popup_opaque[2];
185     Gtk::MenuItem _popup_unset[2];
186     Gtk::MenuItem _popup_remove[2];
188     Gtk::Menu _popup_sw; 
189     Gtk::RadioButtonGroup _sw_group;
190     Gtk::RadioMenuItem _popup_px; 
191     void on_popup_px();
192     Gtk::RadioMenuItem _popup_pt; 
193     void on_popup_pt();
194     Gtk::RadioMenuItem _popup_mm;
195     void on_popup_mm();
196     void on_popup_preset(int i);
197     Gtk::MenuItem _popup_sw_remove;
199     SPUnit *_sw_unit;
201     Gtk::Tooltips _tooltips;
203     void *_drop[2];
204     bool _dropEnabled[2];
205 };
208 } // namespace Widget
209 } // namespace UI
210 } // namespace Inkscape
212 #endif // INKSCAPE_UI_WIDGET_BUTTON_H
214 /* 
215   Local Variables:
216   mode:c++
217   c-file-style:"stroustrup"
218   c-file-offsets:((innamespace . 0)(inline-open . 0))
219   indent-tabs-mode:nil
220   fill-column:99
221   End:
222 */
223 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :