1 // SPDX-License-Identifier: GPL-2.0-or-later
2 #ifndef __UI_DIALOG_HIGHLIGHT_PICKER_H__
3 #define __UI_DIALOG_HIGHLIGHT_PICKER_H__
4 /*
5  * Authors:
6  *   Theodore Janeczko
7  *
8  * Copyright (C) Theodore Janeczko 2012 <flutterguy317@gmail.com>
9  *
10  * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11  */
12 
13 #include <gtkmm/cellrendererpixbuf.h>
14 #include <gtkmm/widget.h>
15 #include <glibmm/property.h>
16 
17 namespace Inkscape {
18 namespace UI {
19 namespace Widget {
20 
21 class HighlightPicker : public Gtk::CellRendererPixbuf {
22 public:
23     HighlightPicker();
24     ~HighlightPicker() override;
25 
property_active()26     Glib::PropertyProxy<guint32> property_active() { return _property_active.get_proxy(); }
27 
28 protected:
29     void render_vfunc( const Cairo::RefPtr<Cairo::Context>& cr,
30                                Gtk::Widget& widget,
31                                const Gdk::Rectangle& background_area,
32                                const Gdk::Rectangle& cell_area,
33                                Gtk::CellRendererState flags ) override;
34 
35     void get_preferred_width_vfunc(Gtk::Widget& widget,
36                                            int& min_w,
37                                            int& nat_w) const override;
38 
39     void get_preferred_height_vfunc(Gtk::Widget& widget,
40                                             int& min_h,
41                                             int& nat_h) const override;
42 
43     bool activate_vfunc(GdkEvent *event,
44                                 Gtk::Widget &widget,
45                                 const Glib::ustring &path,
46                                 const Gdk::Rectangle &background_area,
47                                 const Gdk::Rectangle &cell_area,
48                                 Gtk::CellRendererState flags) override;
49 
50 private:
51 
52     Glib::Property<guint32> _property_active;
53 };
54 
55 
56 
57 } // namespace Widget
58 } // namespace UI
59 } // namespace Inkscape
60 
61 
62 #endif /* __UI_DIALOG_IMAGETOGGLER_H__ */
63 
64 /*
65   Local Variables:
66   mode:c++
67   c-file-style:"stroustrup"
68   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
69   indent-tabs-mode:nil
70   fill-column:99
71   End:
72 */
73 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
74