1 // Generated by gtkmmproc -- DO NOT MODIFY!
4 #include <gdkmm/image.h>
5 #include <gdkmm/private/image_p.h>
7 #include <gdk/gdkenumtypes.h>
13 * Copyright 1998-2002 The gtkmm Development Team
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Library General Public
17 * License as published by the Free Software Foundation; either
18 * version 2 of the License, or (at your option) any later version.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Library General Public License for more details.
25 * You should have received a copy of the GNU Library General Public
26 * License along with this library; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
33 Image::Image(ImageType type, const Glib::RefPtr<Visual>& visual, int width, int height)
35 Object( G_OBJECT( gdk_image_new((GdkImageType)type, visual->gobj(), width, height) ) )
43 } // anonymous namespace
46 GType Glib::Value<Gdk::ImageType>::value_type()
48 return gdk_image_type_get_type();
55 Glib::RefPtr<Gdk::Image> wrap(GdkImage* object, bool take_copy)
57 return Glib::RefPtr<Gdk::Image>( dynamic_cast<Gdk::Image*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
58 //We use dynamic_cast<> in case of multiple inheritance.
61 } /* namespace Glib */
68 /* The *_Class implementation: */
70 const Glib::Class& Image_Class::init()
72 if(!gtype_) // create the GType if necessary
74 // Glib::Class has to know the class init function to clone custom types.
75 class_init_func_ = &Image_Class::class_init_function;
77 // This is actually just optimized away, apparently with no harm.
78 // Make sure that the parent type has been created.
79 //CppClassParent::CppObjectType::get_type();
81 // Create the wrapper type, with the same class/instance size as the base type.
82 register_derived_type(gdk_image_get_type());
84 // Add derived versions of interfaces, if the C type implements any interfaces:
90 void Image_Class::class_init_function(void* g_class, void* class_data)
92 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
93 CppClassParent::class_init_function(klass, class_data);
95 #ifdef GLIBMM_VFUNCS_ENABLED
96 #endif //GLIBMM_VFUNCS_ENABLED
98 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
99 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
102 #ifdef GLIBMM_VFUNCS_ENABLED
103 #endif //GLIBMM_VFUNCS_ENABLED
105 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
106 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
109 Glib::ObjectBase* Image_Class::wrap_new(GObject* object)
111 return new Image((GdkImage*)object);
115 /* The implementation: */
117 GdkImage* Image::gobj_copy()
123 Image::Image(const Glib::ConstructParams& construct_params)
125 Glib::Object(construct_params)
128 Image::Image(GdkImage* castitem)
130 Glib::Object((GObject*)(castitem))
137 Image::CppClassType Image::image_class_; // initialize static member
139 GType Image::get_type()
141 return image_class_.init().get_type();
144 GType Image::get_base_type()
146 return gdk_image_get_type();
150 Glib::RefPtr<Image> Image::create(ImageType type, const Glib::RefPtr<Visual>& visual, int width, int height)
152 return Glib::RefPtr<Image>( new Image(type, visual, width, height) );
154 void Image::put_pixel(int x, int y, guint32 pixel)
156 gdk_image_put_pixel(gobj(), x, y, pixel);
159 guint32 Image::get_pixel(int x, int y) const
161 return gdk_image_get_pixel(const_cast<GdkImage*>(gobj()), x, y);
164 void Image::set_colormap(const Glib::RefPtr<Colormap>& colormap)
166 gdk_image_set_colormap(gobj(), Glib::unwrap(colormap));
169 Glib::RefPtr<Colormap> Image::get_colormap()
172 Glib::RefPtr<Colormap> retvalue = Glib::wrap(gdk_image_get_colormap(gobj()));
174 retvalue->reference(); //The function does not do a ref for us.
179 Glib::RefPtr<const Colormap> Image::get_colormap() const
181 return const_cast<Image*>(this)->get_colormap();
184 ImageType Image::get_image_type() const
186 return ((ImageType)(gobj()->type));
189 Glib::RefPtr<Visual> Image::get_visual()
191 Glib::RefPtr<Visual> ref_ptr(Glib::wrap(gobj()->visual));
194 ref_ptr->reference();
199 Glib::RefPtr<const Visual> Image::get_visual() const
201 Glib::RefPtr<const Visual> ref_ptr(Glib::wrap(gobj()->visual));
204 ref_ptr->reference();
209 ByteOrder Image::get_byte_order() const
211 return ((ByteOrder)(gobj()->byte_order));
214 int Image::get_width() const
216 return gobj()->width;
219 int Image::get_height() const
221 return gobj()->height;
224 guint16 Image::get_bpp() const
229 guint16 Image::get_bpl() const
234 guint16 Image::get_bits_per_pixel() const
236 return gobj()->bits_per_pixel;
239 void* Image::get_mem()
244 const void* Image::get_mem() const
246 return (const void*)(gobj()->mem);
249 void* Image::get_windowing_data() const
251 return gobj()->windowing_data;
255 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
256 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
258 #ifdef GLIBMM_VFUNCS_ENABLED
259 #endif //GLIBMM_VFUNCS_ENABLED