2 // Generated by gtkmmproc -- DO NOT MODIFY!
9 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
11 /* Copyright (C) 2007 The giomm Development Team
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <glibmm/interface.h>
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 typedef struct _GIconIface GIconIface;
33 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
35 #ifndef DOXYGEN_SHOULD_SKIP_THIS
36 typedef struct _GIcon GIcon;
37 typedef struct _GIconClass GIconClass;
38 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
42 { class Icon_Class; } // namespace Gio
46 /** This is a very minimal interface for icons. It provides functions for checking the equality of two icons and hashing of icons.
47 * Glib::Icon does not provide the actual pixmap for the icon as this is out of GIO's scope. However implementations of Icon may contain the name of an
48 * icon (see ThemedIcon), or the path to an icon (see LoadableIcon).
50 * To obtain a hash of an Icon instance, see hash().
52 * To check if two Icon instances are equal, see equal().
57 class Icon : public Glib::Interface
60 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63 typedef Icon CppObjectType;
64 typedef Icon_Class CppClassType;
65 typedef GIcon BaseObjectType;
66 typedef GIconIface BaseClassType;
69 friend class Icon_Class;
70 static CppClassType icon_class_;
74 Icon& operator=(const Icon&);
77 Icon(); // you must derive from this class
79 /** Called by constructors of derived classes. Provide the result of
80 * the Class init() function to ensure that it is properly
83 * @param interface_class The Class object for the derived type.
85 explicit Icon(const Glib::Interface_Class& interface_class);
88 // This is public so that C++ wrapper instances can be
89 // created for C instances of unwrapped types.
90 // For instance, if an unexpected C type implements the C interface.
91 explicit Icon(GIcon* castitem);
94 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
99 static void add_interface(GType gtype_implementer);
101 #ifndef DOXYGEN_SHOULD_SKIP_THIS
102 static GType get_type() G_GNUC_CONST;
103 static GType get_base_type() G_GNUC_CONST;
106 ///Provides access to the underlying C GObject.
107 GIcon* gobj() { return reinterpret_cast<GIcon*>(gobject_); }
109 ///Provides access to the underlying C GObject.
110 const GIcon* gobj() const { return reinterpret_cast<GIcon*>(gobject_); }
117 /** Gets a hash for an icon.
118 * @param icon #gconstpointer to an icon object.
119 * @return A <tt>unsigned int</tt> containing a hash for the @a icon, suitable for
120 * use in a HashTable or similar data structure.
125 // TODO: should this, and File's equal(), be virtual, in order to
126 // be available to derived classes?
127 bool equal(const Glib::RefPtr<Icon>& other) const;
129 //_WRAP_VFUNC(guint hash() const, "hash")
131 // TODO: also kind of related to equal() being virtual or not,
132 // do we need to have equal_vfunc()? Or rather, why would we want
133 // to have it generally...
139 //C++ methods used to invoke GTK+ virtual functions:
140 #ifdef GLIBMM_VFUNCS_ENABLED
141 #endif //GLIBMM_VFUNCS_ENABLED
144 //GTK+ Virtual Functions (override these to change behaviour):
145 #ifdef GLIBMM_VFUNCS_ENABLED
146 #endif //GLIBMM_VFUNCS_ENABLED
148 //Default Signal Handlers::
149 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
150 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
160 /** A Glib::wrap() method for this object.
162 * @param object The C instance.
163 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
164 * @result A C++ instance that wraps this C instance.
168 Glib::RefPtr<Gio::Icon> wrap(GIcon* object, bool take_copy = false);
173 #endif /* _GIOMM_ICON_H */