1 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gtkmm/iconfactory.h>
7 #include <gtkmm/private/iconfactory_p.h>
8
9
10 // -*- c++ -*-
11 /* $Id: iconfactory.ccg,v 1.1 2003/01/21 13:40:26 murrayc Exp $ */
12
13 /*
14 *
15 * Copyright 1998-2002 The gtkmm Development Team
16 *
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License as published by the Free Software Foundation; either
20 * version 2.1 of the License, or (at your option) any later version.
21 *
22 * This library is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * Lesser General Public License for more details.
26 *
27 * You should have received a copy of the GNU Lesser General Public
28 * License along with this library; if not, write to the Free
29 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 */
31
32 #include <gtkmm/settings.h>
33 #include <gtk/gtk.h>
34
35 namespace Gtk
36 {
37
38 // static
lookup(IconSize size,int & width,int & height)39 bool IconSize::lookup(IconSize size, int& width, int& height)
40 {
41 return gtk_icon_size_lookup((GtkIconSize) int(size), &width, &height);
42 }
43
44 // static
lookup(IconSize size,int & width,int & height,const Glib::RefPtr<Gtk::Settings> & settings)45 bool IconSize::lookup(IconSize size, int& width, int& height, const Glib::RefPtr<Gtk::Settings>& settings)
46 {
47 return gtk_icon_size_lookup_for_settings(Glib::unwrap(settings), (GtkIconSize) int(size), &width, &height);
48 }
49
50
51 // static
register_new(const Glib::ustring & name,int width,int height)52 IconSize IconSize::register_new(const Glib::ustring& name, int width, int height)
53 {
54 const int size = gtk_icon_size_register(name.c_str(), width, height);
55 return IconSize(size);
56 }
57
58 // static
register_alias(const Glib::ustring & alias,IconSize target)59 void IconSize::register_alias(const Glib::ustring& alias, IconSize target)
60 {
61 gtk_icon_size_register_alias(alias.c_str(), (GtkIconSize) int(target));
62 }
63
64 // static
from_name(const Glib::ustring & name)65 IconSize IconSize::from_name(const Glib::ustring& name)
66 {
67 const int size = gtk_icon_size_from_name(name.c_str());
68 return IconSize(size);
69 }
70
71 // static
get_name(IconSize size)72 Glib::ustring IconSize::get_name(IconSize size)
73 {
74 return gtk_icon_size_get_name((GtkIconSize) int(size));
75 }
76
77 } // namespace Gtk
78
79
80 namespace
81 {
82 } // anonymous namespace
83
84
85 namespace Glib
86 {
87
wrap(GtkIconFactory * object,bool take_copy)88 Glib::RefPtr<Gtk::IconFactory> wrap(GtkIconFactory* object, bool take_copy)
89 {
90 return Glib::RefPtr<Gtk::IconFactory>( dynamic_cast<Gtk::IconFactory*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
91 //We use dynamic_cast<> in case of multiple inheritance.
92 }
93
94 } /* namespace Glib */
95
96
97 namespace Gtk
98 {
99
100
101 /* The *_Class implementation: */
102
init()103 const Glib::Class& IconFactory_Class::init()
104 {
105 if(!gtype_) // create the GType if necessary
106 {
107 // Glib::Class has to know the class init function to clone custom types.
108 class_init_func_ = &IconFactory_Class::class_init_function;
109
110 // This is actually just optimized away, apparently with no harm.
111 // Make sure that the parent type has been created.
112 //CppClassParent::CppObjectType::get_type();
113
114 // Create the wrapper type, with the same class/instance size as the base type.
115 register_derived_type(gtk_icon_factory_get_type());
116
117 // Add derived versions of interfaces, if the C type implements any interfaces:
118
119 }
120
121 return *this;
122 }
123
124
class_init_function(void * g_class,void * class_data)125 void IconFactory_Class::class_init_function(void* g_class, void* class_data)
126 {
127 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
128 CppClassParent::class_init_function(klass, class_data);
129
130
131 }
132
133
wrap_new(GObject * object)134 Glib::ObjectBase* IconFactory_Class::wrap_new(GObject* object)
135 {
136 return new IconFactory((GtkIconFactory*)object);
137 }
138
139
140 /* The implementation: */
141
gobj_copy()142 GtkIconFactory* IconFactory::gobj_copy()
143 {
144 reference();
145 return gobj();
146 }
147
IconFactory(const Glib::ConstructParams & construct_params)148 IconFactory::IconFactory(const Glib::ConstructParams& construct_params)
149 :
150 Glib::Object(construct_params)
151 {
152
153 }
154
IconFactory(GtkIconFactory * castitem)155 IconFactory::IconFactory(GtkIconFactory* castitem)
156 :
157 Glib::Object((GObject*)(castitem))
158 {}
159
160
~IconFactory()161 IconFactory::~IconFactory()
162 {}
163
164
165 IconFactory::CppClassType IconFactory::iconfactory_class_; // initialize static member
166
get_type()167 GType IconFactory::get_type()
168 {
169 return iconfactory_class_.init().get_type();
170 }
171
172
get_base_type()173 GType IconFactory::get_base_type()
174 {
175 return gtk_icon_factory_get_type();
176 }
177
178
IconFactory()179 IconFactory::IconFactory()
180 :
181 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
182 Glib::ObjectBase(0),
183 Glib::Object(Glib::ConstructParams(iconfactory_class_.init()))
184 {
185
186
187 }
188
create()189 Glib::RefPtr<IconFactory> IconFactory::create()
190 {
191 return Glib::RefPtr<IconFactory>( new IconFactory() );
192 }
193
add(const Gtk::StockID & stock_id,const IconSet & icon_set)194 void IconFactory::add(const Gtk::StockID& stock_id, const IconSet& icon_set)
195 {
196 gtk_icon_factory_add(gobj(), (stock_id).get_c_str(), const_cast<GtkIconSet*>((icon_set).gobj()));
197 }
198
add_default()199 void IconFactory::add_default()
200 {
201 gtk_icon_factory_add_default(gobj());
202 }
203
remove_default()204 void IconFactory::remove_default()
205 {
206 gtk_icon_factory_remove_default(gobj());
207 }
208
209
210 } // namespace Gtk
211
212
213