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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/* Copyright (C) 2007 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glibmm/object.h>
#include <giomm/file.h>
#include <giomm/icon.h>
#include <giomm/loadableicon.h>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)
namespace Gio
{
/** Icon theming support
* ThemedIcon is an implementation of Gio::Icon that supports icon themes.
* ThemedIcon contains a list of all of the icons present in an icon
* theme, so that icons can be looked up quickly. ThemedIcon does
* not provide actual pixmaps for icons, just the icon names.
* Ideally something like Gtk::IconTheme::choose_icon() should be used to
* resolve the list of names so that fallback icons work nicely with
* themes that inherit other themes.
*
* @newin{2,16}
*/
class ThemedIcon
: public Glib::Object,
public Icon
{
_CLASS_GOBJECT(ThemedIcon, GThemedIcon, G_THEMED_ICON, Glib::Object, GObject)
_IMPLEMENTS_INTERFACE(Icon)
protected:
/** Creates a new themed icon for @ iconname, and optionally all the names that can be created by shortening @a iconname at '-' characters.
*
* @param iconname A string containing an icon name.
* use_default_callbacks Whether to use all the names that can be created by shortening @a iconname at '-' characters.
*/
explicit ThemedIcon(const std::string& iconname, bool use_default_callbacks = false);
_IGNORE(g_themed_icon_new, g_themed_icon_new_with_default_fallbacks)
public:
/** Creates a new themed icon for @ iconname, and optionally all the names that can be created by shortening @a iconname at '-' characters.
*
* @param iconname A string containing an icon name.
* use_default_callbacks Whether to use all the names that can be created by shortening @a iconname at '-' characters.
*/
_WRAP_CREATE(const std::string& iconname, bool use_default_callbacks = false)
//TODO: GIcon *g_themed_icon_new_from_names (char **iconnames, int len);
_WRAP_METHOD(void prepend_name(const std::string& iconname), g_themed_icon_prepend_name)
_WRAP_METHOD(void append_name(const std::string& iconname), g_themed_icon_append_name)
//TODO: Use _WRAP_METHOD() instead, but:
//#m4 _CONVERSION(`const char*const*',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
//TODO: gmmproc complains about the wrong number of arguments, but I can't see why. murrayc.
//_WRAP_METHOD(Glib::StringArrayHandle get_names() const, g_themed_icon_get_names)
Glib::StringArrayHandle get_names() const;
_IGNORE(g_themed_icon_get_names)
//There are no signals.
//TODO: Remove these when we can break ABI. They are write-only and construct-only.
_WRAP_PROPERTY("name", std::string)
//An array: This is awkward to wrap_WRAP_PROPERTY("names", )
_WRAP_PROPERTY("use-default-fallbacks", bool)
};
} // namespace Gio
|