summaryrefslogtreecommitdiffstats
path: root/src/widgets/icon.h
blob: 3f6aa245573fb682c658e75af936ca981ead0298 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef SEEN_SP_ICON_H
#define SEEN_SP_ICON_H

/*
 * Generic icon widget
 *
 * Author:
 *   Lauris Kaplinski <lauris@kaplinski.com>
 *   Jon A. Cruz <jon@joncruz.org>
 *
 * Copyright (C) 2002 Lauris Kaplinski
 * Copyright (C) 2010 Authors
 *
 * Released under GNU GPL, read the file 'COPYING' for more information
 */

#include <gtkmm/widget.h>
#include "icon-size.h"

#define SP_TYPE_ICON SPIcon::getType()
#define SP_ICON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SP_TYPE_ICON, SPIcon))
#define SP_IS_ICON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SP_TYPE_ICON))

namespace Glib {
class ustring;
}

struct SPIconClass {
    GtkWidgetClass parent_class;
};

struct SPIcon {
    GtkWidget widget;

    Inkscape::IconSize lsize;
    int psize;
    gchar *name;

    GdkPixbuf *pb;

    static GType getType(void);

    friend class SPIconImpl;
};


GtkWidget *sp_icon_new( Inkscape::IconSize size, const gchar *name );


// Might return a wrapped SPIcon, or Gtk::Image
Gtk::Widget *sp_icon_get_icon( const Glib::ustring &oid, Inkscape::IconSize size = Inkscape::ICON_SIZE_BUTTON );

void sp_icon_fetch_pixbuf( SPIcon *icon );
int sp_icon_get_phys_size(int size);

namespace Inkscape {
    void queueIconPrerender( Glib::ustring const &oid, Inkscape::IconSize size = Inkscape::ICON_SIZE_BUTTON );
}

#endif // SEEN_SP_ICON_H

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :