1 /**
2 * \brief Static style swatch (fill, stroke, opacity)
3 *
4 * Author:
5 * buliabyak@gmail.com
6 *
7 * Copyright (C) 2005 author
8 *
9 * Released under GNU GPL. Read the file 'COPYING' for more information.
10 */
12 #ifndef INKSCAPE_UI_CURRENT_STYLE_H
13 #define INKSCAPE_UI_CURRENT_STYLE_H
15 #include <gtkmm/table.h>
16 #include <gtkmm/label.h>
17 #include <gtkmm/box.h>
18 #include <gtkmm/eventbox.h>
19 #include <gtkmm/enums.h>
21 #include <glibmm/i18n.h>
23 #include <desktop.h>
24 #include <verbs.h>
26 #include "button.h"
28 class SPUnit;
29 class SPStyle;
30 class SPCSSAttr;
32 namespace Inkscape {
33 namespace XML {
34 class Node;
35 }
36 }
38 namespace Inkscape {
39 namespace UI {
40 namespace Widget {
42 class StyleSwatch : public Gtk::HBox
43 {
44 public:
45 StyleSwatch (SPCSSAttr *attr, gchar const *main_tip);
47 ~StyleSwatch();
49 void setStyle(SPStyle *style);
50 void setStyle(SPCSSAttr *attr);
51 SPCSSAttr *getStyle();
53 void setWatched (Inkscape::XML::Node *watched, Inkscape::XML::Node *secondary);
54 void setWatchedTool (const char *path, bool synthesize);
56 void setClickVerb(sp_verb_t verb_t);
57 void setDesktop(SPDesktop *desktop);
58 bool on_click(GdkEventButton *event);
60 char *_tool_path;
62 protected:
63 SPDesktop *_desktop;
65 sp_verb_t _verb_t;
67 SPCSSAttr *_css;
69 Inkscape::XML::Node *_watched;
70 Inkscape::XML::Node *_watched_tool;
72 Gtk::EventBox _swatch;
74 Gtk::Table _table;
76 Gtk::Label _label[2];
78 Gtk::EventBox _place[2];
79 Gtk::EventBox _opacity_place;
81 Gtk::Label _value[2];
82 Gtk::Label _opacity_value;
84 Gtk::Widget *_color_preview[2];
85 Glib::ustring __color[2];
87 Gtk::HBox _stroke;
88 Gtk::EventBox _stroke_width_place;
89 Gtk::Label _stroke_width;
91 SPUnit *_sw_unit;
93 Gtk::Tooltips _tooltips;
94 };
97 } // namespace Widget
98 } // namespace UI
99 } // namespace Inkscape
101 #endif // INKSCAPE_UI_WIDGET_BUTTON_H
103 /*
104 Local Variables:
105 mode:c++
106 c-file-style:"stroustrup"
107 c-file-offsets:((innamespace . 0)(inline-open . 0))
108 indent-tabs-mode:nil
109 fill-column:99
110 End:
111 */
112 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :