1 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
2 
3 
4 #include <glibmm.h>
5 
6 #include <gdkmm/gc.h>
7 #include <gdkmm/private/gc_p.h>
8 
9 
10 // -*- c++ -*-
11 /* $Id: gc.ccg,v 1.1 2003/01/21 13:38:08 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 <gdk/gdk.h>
33 #include <gdkmm/color.h>
34 //#include <gdkmm/font.h>
35 //#include <gdkmm/pixmap.h>
36 #include <gdkmm/bitmap.h>
37 #include <gdkmm/colormap.h>
38 
39 namespace Gdk
40 {
41 
GC(const Glib::RefPtr<Drawable> & drawable)42 GC::GC(const Glib::RefPtr<Drawable>& drawable)
43 : Object( G_OBJECT( gdk_gc_new(Glib::unwrap(drawable)) ) )
44 {
45   //We need a construct function if we really want to use our own GClass. Bug #86867
46 }
47 
48 
49 }
50 
51 
52 namespace
53 {
54 } // anonymous namespace
55 
56 // static
value_type()57 GType Glib::Value<Gdk::LineStyle>::value_type()
58 {
59   return gdk_line_style_get_type();
60 }
61 
62 // static
value_type()63 GType Glib::Value<Gdk::CapStyle>::value_type()
64 {
65   return gdk_cap_style_get_type();
66 }
67 
68 // static
value_type()69 GType Glib::Value<Gdk::JoinStyle>::value_type()
70 {
71   return gdk_join_style_get_type();
72 }
73 
74 // static
value_type()75 GType Glib::Value<Gdk::Fill>::value_type()
76 {
77   return gdk_fill_get_type();
78 }
79 
80 // static
value_type()81 GType Glib::Value<Gdk::Function>::value_type()
82 {
83   return gdk_function_get_type();
84 }
85 
86 // static
value_type()87 GType Glib::Value<Gdk::SubwindowMode>::value_type()
88 {
89   return gdk_subwindow_mode_get_type();
90 }
91 
92 // static
value_type()93 GType Glib::Value<Gdk::GCValuesMask>::value_type()
94 {
95   return gdk_gc_values_mask_get_type();
96 }
97 
98 
99 namespace Glib
100 {
101 
wrap(GdkGC * object,bool take_copy)102 Glib::RefPtr<Gdk::GC> wrap(GdkGC* object, bool take_copy)
103 {
104   return Glib::RefPtr<Gdk::GC>( dynamic_cast<Gdk::GC*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
105   //We use dynamic_cast<> in case of multiple inheritance.
106 }
107 
108 } /* namespace Glib */
109 
110 
111 namespace Gdk
112 {
113 
114 
115 /* The *_Class implementation: */
116 
init()117 const Glib::Class& GC_Class::init()
118 {
119   if(!gtype_) // create the GType if necessary
120   {
121     // Glib::Class has to know the class init function to clone custom types.
122     class_init_func_ = &GC_Class::class_init_function;
123 
124     // This is actually just optimized away, apparently with no harm.
125     // Make sure that the parent type has been created.
126     //CppClassParent::CppObjectType::get_type();
127 
128     // Create the wrapper type, with the same class/instance size as the base type.
129     register_derived_type(gdk_gc_get_type());
130 
131     // Add derived versions of interfaces, if the C type implements any interfaces:
132 
133   }
134 
135   return *this;
136 }
137 
138 
class_init_function(void * g_class,void * class_data)139 void GC_Class::class_init_function(void* g_class, void* class_data)
140 {
141   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
142   CppClassParent::class_init_function(klass, class_data);
143 
144 
145 }
146 
147 
wrap_new(GObject * object)148 Glib::ObjectBase* GC_Class::wrap_new(GObject* object)
149 {
150   return new GC((GdkGC*)object);
151 }
152 
153 
154 /* The implementation: */
155 
gobj_copy()156 GdkGC* GC::gobj_copy()
157 {
158   reference();
159   return gobj();
160 }
161 
GC(const Glib::ConstructParams & construct_params)162 GC::GC(const Glib::ConstructParams& construct_params)
163 :
164   Glib::Object(construct_params)
165 {
166 
167 }
168 
GC(GdkGC * castitem)169 GC::GC(GdkGC* castitem)
170 :
171   Glib::Object((GObject*)(castitem))
172 {}
173 
174 
~GC()175 GC::~GC()
176 {}
177 
178 
179 GC::CppClassType GC::gc_class_; // initialize static member
180 
get_type()181 GType GC::get_type()
182 {
183   return gc_class_.init().get_type();
184 }
185 
186 
get_base_type()187 GType GC::get_base_type()
188 {
189   return gdk_gc_get_type();
190 }
191 
192 
GC()193 GC::GC()
194 :
195   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
196   Glib::ObjectBase(0),
197   Glib::Object(Glib::ConstructParams(gc_class_.init()))
198 {
199 
200 
201 }
202 
create()203 Glib::RefPtr<GC> GC::create()
204 {
205   return Glib::RefPtr<GC>( new GC() );
206 }
207 
create(const Glib::RefPtr<Drawable> & drawable)208 Glib::RefPtr<GC> GC::create(const Glib::RefPtr<Drawable>& drawable)
209 {
210   return Glib::RefPtr<GC>( new GC(drawable) );
211 }
212 
set_foreground(const Color & color)213 void GC::set_foreground(const Color& color)
214 {
215   gdk_gc_set_foreground(gobj(), (color).gobj());
216 }
217 
set_background(const Color & color)218 void GC::set_background(const Color& color)
219 {
220   gdk_gc_set_background(gobj(), (color).gobj());
221 }
222 
set_function(Function function)223 void GC::set_function(Function function)
224 {
225   gdk_gc_set_function(gobj(), ((GdkFunction)(function)));
226 }
227 
set_fill(Fill fill)228 void GC::set_fill(Fill fill)
229 {
230   gdk_gc_set_fill(gobj(), ((GdkFill)(fill)));
231 }
232 
set_tile(const Glib::RefPtr<Pixmap> & tile)233 void GC::set_tile(const Glib::RefPtr<Pixmap>& tile)
234 {
235   gdk_gc_set_tile(gobj(), Glib::unwrap(tile));
236 }
237 
set_stipple(const Glib::RefPtr<Pixmap> & stipple)238 void GC::set_stipple(const Glib::RefPtr<Pixmap>& stipple)
239 {
240   gdk_gc_set_stipple(gobj(), Glib::unwrap(stipple));
241 }
242 
set_ts_origin(int x,int y)243 void GC::set_ts_origin(int x, int y)
244 {
245   gdk_gc_set_ts_origin(gobj(), x, y);
246 }
247 
set_clip_origin(int x,int y)248 void GC::set_clip_origin(int x, int y)
249 {
250   gdk_gc_set_clip_origin(gobj(), x, y);
251 }
252 
set_clip_mask(const Glib::RefPtr<Bitmap> & mask)253 void GC::set_clip_mask(const Glib::RefPtr<Bitmap>& mask)
254 {
255   gdk_gc_set_clip_mask(gobj(), Glib::unwrap(mask));
256 }
257 
258 #ifndef GDKMM_DISABLE_DEPRECATED
259 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
set_clip_rectangle(Rectangle & rectangle)260 void GC::set_clip_rectangle(Rectangle& rectangle)
261 {
262   gdk_gc_set_clip_rectangle(gobj(), (rectangle).gobj());
263 }
264 G_GNUC_END_IGNORE_DEPRECATIONS
265 #endif // GDKMM_DISABLE_DEPRECATED
266 
set_clip_rectangle(const Rectangle & rectangle)267 void GC::set_clip_rectangle(const Rectangle& rectangle)
268 {
269   gdk_gc_set_clip_rectangle(gobj(), (rectangle).gobj());
270 }
271 
set_clip_region(const Region & region)272 void GC::set_clip_region(const Region& region)
273 {
274   gdk_gc_set_clip_region(gobj(), (region).gobj());
275 }
276 
set_subwindow(SubwindowMode mode)277 void GC::set_subwindow(SubwindowMode mode)
278 {
279   gdk_gc_set_subwindow(gobj(), ((GdkSubwindowMode)(mode)));
280 }
281 
set_exposures(bool exposures)282 void GC::set_exposures(bool exposures)
283 {
284   gdk_gc_set_exposures(gobj(), static_cast<int>(exposures));
285 }
286 
set_line_attributes(int line_width,LineStyle line_style,CapStyle cap_style,JoinStyle join_style)287 void GC::set_line_attributes(int line_width, LineStyle line_style, CapStyle cap_style, JoinStyle join_style)
288 {
289   gdk_gc_set_line_attributes(gobj(), line_width, ((GdkLineStyle)(line_style)), ((GdkCapStyle)(cap_style)), ((GdkJoinStyle)(join_style)));
290 }
291 
set_dashes(int dash_offset,gint8 * dash_list,int n)292 void GC::set_dashes(int dash_offset, gint8* dash_list, int n)
293 {
294   gdk_gc_set_dashes(gobj(), dash_offset, dash_list, n);
295 }
296 
offset(int x_offset,int y_offset)297 void GC::offset(int x_offset, int y_offset)
298 {
299   gdk_gc_offset(gobj(), x_offset, y_offset);
300 }
301 
set_colormap(const Glib::RefPtr<Colormap> & colormap)302 void GC::set_colormap(const Glib::RefPtr<Colormap>& colormap)
303 {
304   gdk_gc_set_colormap(gobj(), Glib::unwrap(colormap));
305 }
306 
get_colormap()307 Glib::RefPtr<Colormap> GC::get_colormap()
308 {
309   Glib::RefPtr<Colormap> retvalue = Glib::wrap(gdk_gc_get_colormap(gobj()));
310   if(retvalue)
311     retvalue->reference(); //The function does not do a ref for us.
312   return retvalue;
313 }
314 
set_rgb_fg_color(const Color & color)315 void GC::set_rgb_fg_color(const Color& color)
316 {
317   gdk_gc_set_rgb_fg_color(gobj(), (color).gobj());
318 }
319 
set_rgb_bg_color(const Color & color)320 void GC::set_rgb_bg_color(const Color& color)
321 {
322   gdk_gc_set_rgb_bg_color(gobj(), (color).gobj());
323 }
324 
get_screen()325 Glib::RefPtr<Screen> GC::get_screen()
326 {
327   Glib::RefPtr<Screen> retvalue = Glib::wrap(gdk_gc_get_screen(gobj()));
328   if(retvalue)
329     retvalue->reference(); //The function does not do a ref for us.
330   return retvalue;
331 }
332 
get_screen() const333 Glib::RefPtr<const Screen> GC::get_screen() const
334 {
335   return const_cast<GC*>(this)->get_screen();
336 }
337 
338 
339 } // namespace Gdk
340 
341 
342