summaryrefslogtreecommitdiff
path: root/gio/src/themedicon.hg
blob: 2616aad6d59a7e74fbfc3ebc4abf6626f6c9b1ef (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
// -*- 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 Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library 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.
 *
 * @newin2p16
 */
class ThemedIcon
: public Glib::Object,
  public Icon
{
  _CLASS_GOBJECT(ThemedIcon, GThemedIcon, G_THEMED_ICON, Glib::Object, GObject)
  _IMPLEMENTS_INTERFACE(Icon)

protected:
  _WRAP_CTOR(ThemedIcon(const std::string& iconname), g_themed_icon_new)

public:
  _WRAP_CREATE(const std::string& iconname)

  //See http://bugzilla.gnome.org/show_bug.cgi?id=517676 about the constructors. murrayc.
  //TODO: GIcon *g_themed_icon_new_with_default_fallbacks (const char *iconname);
  //TODO: GIcon *g_themed_icon_new_from_names (char **iconnames, int len);

  _WRAP_METHOD(void append_name(const std::string& iconname), g_themed_icon_append_name)

#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)


  //There are no signals or properties.
};

} // namespace Gio