1 // Generated by gmmproc 2.60.0 -- DO NOT MODIFY!
2 
3 
4 #include <glibmm.h>
5 
6 #include <gdkmm/drawingcontext.h>
7 #include <gdkmm/private/drawingcontext_p.h>
8 
9 
10 /* Copyright (C) 2016 The gtkmm Development Team
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
24  */
25 
26 #include <gdkmm/window.h>
27 
28 namespace
29 {
30 } // anonymous namespace
31 
32 
33 namespace Glib
34 {
35 
wrap(GdkDrawingContext * object,bool take_copy)36 Glib::RefPtr<Gdk::DrawingContext> wrap(GdkDrawingContext* object, bool take_copy)
37 {
38   return Glib::RefPtr<Gdk::DrawingContext>( dynamic_cast<Gdk::DrawingContext*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
39   //We use dynamic_cast<> in case of multiple inheritance.
40 }
41 
42 } /* namespace Glib */
43 
44 
45 namespace Gdk
46 {
47 
48 
49 /* The *_Class implementation: */
50 
init()51 const Glib::Class& DrawingContext_Class::init()
52 {
53   if(!gtype_) // create the GType if necessary
54   {
55     // Glib::Class has to know the class init function to clone custom types.
56     class_init_func_ = &DrawingContext_Class::class_init_function;
57 
58     // This is actually just optimized away, apparently with no harm.
59     // Make sure that the parent type has been created.
60     //CppClassParent::CppObjectType::get_type();
61 
62     // Create the wrapper type, with the same class/instance size as the base type.
63     register_derived_type(gdk_drawing_context_get_type());
64 
65     // Add derived versions of interfaces, if the C type implements any interfaces:
66 
67   }
68 
69   return *this;
70 }
71 
72 
class_init_function(void * g_class,void * class_data)73 void DrawingContext_Class::class_init_function(void* g_class, void* class_data)
74 {
75   const auto klass = static_cast<BaseClassType*>(g_class);
76   CppClassParent::class_init_function(klass, class_data);
77 
78 
79 }
80 
81 
wrap_new(GObject * object)82 Glib::ObjectBase* DrawingContext_Class::wrap_new(GObject* object)
83 {
84   return new DrawingContext((GdkDrawingContext*)object);
85 }
86 
87 
88 /* The implementation: */
89 
gobj_copy()90 GdkDrawingContext* DrawingContext::gobj_copy()
91 {
92   reference();
93   return gobj();
94 }
95 
DrawingContext(const Glib::ConstructParams & construct_params)96 DrawingContext::DrawingContext(const Glib::ConstructParams& construct_params)
97 :
98   Glib::Object(construct_params)
99 {
100 
101 }
102 
DrawingContext(GdkDrawingContext * castitem)103 DrawingContext::DrawingContext(GdkDrawingContext* castitem)
104 :
105   Glib::Object((GObject*)(castitem))
106 {}
107 
108 
DrawingContext(DrawingContext && src)109 DrawingContext::DrawingContext(DrawingContext&& src) noexcept
110 : Glib::Object(std::move(src))
111 {}
112 
operator =(DrawingContext && src)113 DrawingContext& DrawingContext::operator=(DrawingContext&& src) noexcept
114 {
115   Glib::Object::operator=(std::move(src));
116   return *this;
117 }
118 
119 
~DrawingContext()120 DrawingContext::~DrawingContext() noexcept
121 {}
122 
123 
124 DrawingContext::CppClassType DrawingContext::drawingcontext_class_; // initialize static member
125 
get_type()126 GType DrawingContext::get_type()
127 {
128   return drawingcontext_class_.init().get_type();
129 }
130 
131 
get_base_type()132 GType DrawingContext::get_base_type()
133 {
134   return gdk_drawing_context_get_type();
135 }
136 
137 
DrawingContext()138 DrawingContext::DrawingContext()
139 :
140   // Mark this class as non-derived to allow C++ vfuncs to be skipped.
141   Glib::ObjectBase(nullptr),
142   Glib::Object(Glib::ConstructParams(drawingcontext_class_.init()))
143 {
144 
145 
146 }
147 
get_window()148 Glib::RefPtr<Window> DrawingContext::get_window()
149 {
150   Glib::RefPtr<Window> retvalue = Glib::wrap(gdk_drawing_context_get_window(gobj()));
151   if(retvalue)
152     retvalue->reference(); //The function does not do a ref for us.
153   return retvalue;
154 }
155 
get_window() const156 Glib::RefPtr<const Window> DrawingContext::get_window() const
157 {
158   return const_cast<DrawingContext*>(this)->get_window();
159 }
160 
get_clip() const161 ::Cairo::RefPtr< ::Cairo::Region> DrawingContext::get_clip() const
162 {
163   return ::Cairo::RefPtr< ::Cairo::Region>(new ::Cairo::Region(gdk_drawing_context_get_clip(const_cast<GdkDrawingContext*>(gobj())), true /* do not take ref */));
164 }
165 
is_valid() const166 bool DrawingContext::is_valid() const
167 {
168   return gdk_drawing_context_is_valid(const_cast<GdkDrawingContext*>(gobj()));
169 }
170 
get_cairo_context()171 ::Cairo::RefPtr< ::Cairo::Context> DrawingContext::get_cairo_context()
172 {
173   return ::Cairo::RefPtr< ::Cairo::Context>(new ::Cairo::Context(gdk_drawing_context_get_cairo_context(gobj()), false /* take reference */));
174 }
175 
get_cairo_context() const176 ::Cairo::RefPtr<const ::Cairo::Context> DrawingContext::get_cairo_context() const
177 {
178   return const_cast<DrawingContext*>(this)->get_cairo_context();
179 }
180 
get_drawing_context_from_cairo_context(const::Cairo::RefPtr<::Cairo::Context> & cr)181 Glib::RefPtr<DrawingContext> DrawingContext::get_drawing_context_from_cairo_context(const ::Cairo::RefPtr< ::Cairo::Context>& cr)
182 {
183 
184   Glib::RefPtr<DrawingContext> retvalue = Glib::wrap(gdk_cairo_get_drawing_context((cr)->cobj()));
185   if(retvalue)
186     retvalue->reference(); //The function does not do a ref for us
187   return retvalue;
188 }
189 
190 
property_window() const191 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Window> > DrawingContext::property_window() const
192 {
193   return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Window> >(this, "window");
194 }
195 
196 
197 } // namespace Gdk
198 
199 
200