1 /**
2 * \brief Icon Widget - General image widget (including SVG icons)
3 *
4 * Author:
5 * Bryce Harrington <bryce@bryceharrington.org>
6 *
7 * Copyright (C) 2004 Bryce Harrington
8 *
9 * Released under GNU GPL. Read the file 'COPYING' for more information
10 */
12 #ifndef INKSCAPE_UI_WIDGET_ICON_H
13 #define INKSCAPE_UI_WIDGET_ICON_H
15 #include <gtkmm/image.h>
16 #include <gdkmm/rectangle.h>
18 namespace Inkscape {
19 namespace UI {
20 namespace Widget {
22 class IconWidget : public Gtk::Widget
23 {
24 public:
25 IconWidget();
26 IconWidget(int unsigned size, int unsigned scale, gchar const *name);
27 IconWidget(int unsigned size, guchar const *px);
28 virtual ~IconWidget();
30 // Overrides of Gtk::Widget functions
31 void size_request(Gtk::Requisition &requisition);
32 void size_allocate(Gtk::Allocation const &allocation);
34 int expose(GdkEventExpose *event);
35 void paint(GdkRectangle const *area);
36 guchar* image_load(gchar const *name, int unsigned size, int unsigned scale);
37 guchar* image_load_pixmap(gchar const *name, int unsigned size, int unsigned scale);
38 guchar* image_load_svg(gchar const *name, int unsigned size, int unsigned scale);
39 guchar* image_load_gtk(gchar const *name, int unsigned size, int unsigned scale);
41 protected:
42 int _size;
43 GdkPixbuf *_pb;
44 bool _do_bitmap_icons;
45 };
48 } // namespace Widget
49 } // namespace UI
50 } // namespace Inkscape
52 #endif // INKSCAPE_UI_WIDGET_ICON_H
54 /*
55 Local Variables:
56 mode:c++
57 c-file-style:"stroustrup"
58 c-file-offsets:((innamespace . 0)(inline-open . 0))
59 indent-tabs-mode:nil
60 fill-column:99
61 End:
62 */
63 // vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :