1 /** @file
2 * @brief Static style swatch (fill, stroke, opacity)
3 */
4 /* Authors:
5 * buliabyak@gmail.com
6 * Krzysztof KosiĆski <tweenk.pl@gmail.com>
7 *
8 * Copyright (C) 2005-2008 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>
22 #include <glibmm/i18n.h>
24 #include "desktop.h"
25 #include "verbs.h"
26 #include "button.h"
27 #include "preferences.h"
29 class SPUnit;
30 class SPStyle;
31 class SPCSSAttr;
33 namespace Inkscape {
34 namespace UI {
35 namespace Widget {
37 class StyleSwatch : public Gtk::HBox
38 {
39 public:
40 StyleSwatch (SPCSSAttr *attr, gchar const *main_tip);
42 ~StyleSwatch();
44 void setStyle(SPStyle *style);
45 void setStyle(SPCSSAttr *attr);
46 SPCSSAttr *getStyle();
48 void setWatchedTool (const char *path, bool synthesize);
50 void setClickVerb(sp_verb_t verb_t);
51 void setDesktop(SPDesktop *desktop);
52 bool on_click(GdkEventButton *event);
54 private:
55 class ToolObserver;
56 class StyleObserver;
58 SPDesktop *_desktop;
59 sp_verb_t _verb_t;
60 SPCSSAttr *_css;
61 ToolObserver *_tool_obs;
62 StyleObserver *_style_obs;
63 Glib::ustring _tool_path;
65 Gtk::EventBox _swatch;
66 Gtk::Table _table;
67 Gtk::Label _label[2];
68 Gtk::EventBox _place[2];
69 Gtk::EventBox _opacity_place;
70 Gtk::Label _value[2];
71 Gtk::Label _opacity_value;
72 Gtk::Widget *_color_preview[2];
73 Glib::ustring __color[2];
74 Gtk::HBox _stroke;
75 Gtk::EventBox _stroke_width_place;
76 Gtk::Label _stroke_width;
78 SPUnit *_sw_unit;
80 Gtk::Tooltips _tooltips;
82 friend class ToolObserver;
83 };
86 } // namespace Widget
87 } // namespace UI
88 } // namespace Inkscape
90 #endif // INKSCAPE_UI_WIDGET_BUTTON_H
92 /*
93 Local Variables:
94 mode:c++
95 c-file-style:"stroustrup"
96 c-file-offsets:((innamespace . 0)(inline-open . 0))
97 indent-tabs-mode:nil
98 fill-column:99
99 End:
100 */
101 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :