Fix crash on startup if an LV2 plugin has a bad .ttl file.
[ardour.git] / libs / glibmm2 / gio / giomm / icon.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GIOMM_ICON_H
4 #define _GIOMM_ICON_H
5
6
7 #include <glibmm.h>
8
9 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
10
11 /* Copyright (C) 2007 The giomm Development Team
12  *
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.
17  *
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.
22  *
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.
26  */
27
28 #include <glibmm/interface.h>
29
30
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 typedef struct _GIconIface GIconIface;
33 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
34
35 #ifndef DOXYGEN_SHOULD_SKIP_THIS
36 typedef struct _GIcon GIcon;
37 typedef struct _GIconClass GIconClass;
38 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39
40
41 namespace Gio
42 { class Icon_Class; } // namespace Gio
43 namespace Gio
44 {
45
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).
49  *
50  * To obtain a hash of an Icon instance, see hash().
51  *
52  * To check if two Icon instances are equal, see equal().
53  *
54  * @newin2p16
55  */
56
57 class Icon : public Glib::Interface
58 {
59   
60 #ifndef DOXYGEN_SHOULD_SKIP_THIS
61
62 public:
63   typedef Icon CppObjectType;
64   typedef Icon_Class CppClassType;
65   typedef GIcon BaseObjectType;
66   typedef GIconIface BaseClassType;
67
68 private:
69   friend class Icon_Class;
70   static CppClassType icon_class_;
71
72   // noncopyable
73   Icon(const Icon&);
74   Icon& operator=(const Icon&);
75
76 protected:
77   Icon(); // you must derive from this class
78
79   /** Called by constructors of derived classes. Provide the result of 
80    * the Class init() function to ensure that it is properly 
81    * initialized.
82    * 
83    * @param interface_class The Class object for the derived type.
84    */
85   explicit Icon(const Glib::Interface_Class& interface_class);
86
87 public:
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);
92
93 protected:
94 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
95
96 public:
97   virtual ~Icon();
98
99   static void add_interface(GType gtype_implementer);
100
101 #ifndef DOXYGEN_SHOULD_SKIP_THIS
102   static GType get_type()      G_GNUC_CONST;
103   static GType get_base_type() G_GNUC_CONST;
104 #endif
105
106   ///Provides access to the underlying C GObject.
107   GIcon*       gobj()       { return reinterpret_cast<GIcon*>(gobject_); }
108
109   ///Provides access to the underlying C GObject.  
110   const GIcon* gobj() const { return reinterpret_cast<GIcon*>(gobject_); }
111
112 private:
113
114
115 public:
116   
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.
121    */
122   guint hash() const;
123
124   
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;
128
129   //_WRAP_VFUNC(guint hash() const, "hash")
130
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...
134
135
136 public:
137
138 public:
139   //C++ methods used to invoke GTK+ virtual functions:
140 #ifdef GLIBMM_VFUNCS_ENABLED
141 #endif //GLIBMM_VFUNCS_ENABLED
142
143 protected:
144   //GTK+ Virtual Functions (override these to change behaviour):
145 #ifdef GLIBMM_VFUNCS_ENABLED
146 #endif //GLIBMM_VFUNCS_ENABLED
147
148   //Default Signal Handlers::
149 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
150 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
151
152
153 };
154
155 } // namespace Gio
156
157
158 namespace Glib
159 {
160   /** A Glib::wrap() method for this object.
161    * 
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.
165    *
166    * @relates Gio::Icon
167    */
168   Glib::RefPtr<Gio::Icon> wrap(GIcon* object, bool take_copy = false);
169
170 } // namespace Glib
171
172
173 #endif /* _GIOMM_ICON_H */
174