1 // Generated by gmmproc 2.60.0 -- DO NOT MODIFY! 2 #ifndef _GDKMM_DRAWINGCONTEXT_H 3 #define _GDKMM_DRAWINGCONTEXT_H 4 5 6 #include <glibmm/ustring.h> 7 #include <sigc++/sigc++.h> 8 9 /* Copyright (C) 2016 The gtkmm Development Team 10 * 11 * This library is free software; you can redistribute it and/or 12 * modify it under the terms of the GNU Lesser General Public 13 * License as published by the Free Software Foundation; either 14 * version 2.1 of the License, or (at your option) any later version. 15 * 16 * This library is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * Lesser General Public License for more details. 20 * 21 * You should have received a copy of the GNU Lesser General Public 22 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 23 */ 24 25 #include <glibmm/object.h> 26 #include <cairomm/context.h> 27 #include <cairomm/region.h> 28 29 30 #ifndef DOXYGEN_SHOULD_SKIP_THIS 31 using GdkDrawingContext = struct _GdkDrawingContext; 32 using GdkDrawingContextClass = struct _GdkDrawingContextClass; 33 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 34 35 36 #ifndef DOXYGEN_SHOULD_SKIP_THIS 37 namespace Gdk 38 { class DrawingContext_Class; } // namespace Gdk 39 #endif //DOXYGEN_SHOULD_SKIP_THIS 40 41 namespace Gdk 42 { 43 class Window; 44 45 /** Drawing context for GDK windows. 46 * 47 * Gdk::DrawingContext is an object that represents the current drawing 48 * state of a Gdk::Window. 49 * 50 * It's possible to use a Gdk::DrawingContext to draw on a Gdk::Window 51 * via rendering API like Cairo or OpenGL. 52 * 53 * A Gdk::DrawingContext can only be created by calling Gdk::Window::begin_draw_frame() 54 * and will be valid until a call to Gdk::Window::end_draw_frame(). 55 * 56 * @newin{3,22} 57 */ 58 59 class DrawingContext : public Glib::Object 60 { 61 62 #ifndef DOXYGEN_SHOULD_SKIP_THIS 63 64 public: 65 using CppObjectType = DrawingContext; 66 using CppClassType = DrawingContext_Class; 67 using BaseObjectType = GdkDrawingContext; 68 using BaseClassType = GdkDrawingContextClass; 69 70 // noncopyable 71 DrawingContext(const DrawingContext&) = delete; 72 DrawingContext& operator=(const DrawingContext&) = delete; 73 74 private: friend class DrawingContext_Class; 75 static CppClassType drawingcontext_class_; 76 77 protected: 78 explicit DrawingContext(const Glib::ConstructParams& construct_params); 79 explicit DrawingContext(GdkDrawingContext* castitem); 80 81 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 82 83 public: 84 85 DrawingContext(DrawingContext&& src) noexcept; 86 DrawingContext& operator=(DrawingContext&& src) noexcept; 87 88 ~DrawingContext() noexcept override; 89 90 /** Get the GType for this class, for use with the underlying GObject type system. 91 */ 92 static GType get_type() G_GNUC_CONST; 93 94 #ifndef DOXYGEN_SHOULD_SKIP_THIS 95 96 97 static GType get_base_type() G_GNUC_CONST; 98 #endif 99 100 ///Provides access to the underlying C GObject. gobj()101 GdkDrawingContext* gobj() { return reinterpret_cast<GdkDrawingContext*>(gobject_); } 102 103 ///Provides access to the underlying C GObject. gobj()104 const GdkDrawingContext* gobj() const { return reinterpret_cast<GdkDrawingContext*>(gobject_); } 105 106 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. 107 GdkDrawingContext* gobj_copy(); 108 109 private: 110 111 112 protected: 113 DrawingContext(); 114 115 public: 116 117 /** Retrieves the window that created the drawing @a context. 118 * 119 * @newin{3,22} 120 * 121 * @return A Gdk::Window. 122 */ 123 Glib::RefPtr<Window> get_window(); 124 125 /** Retrieves the window that created the drawing @a context. 126 * 127 * @newin{3,22} 128 * 129 * @return A Gdk::Window. 130 */ 131 Glib::RefPtr<const Window> get_window() const; 132 133 134 // This is const because it returns a copy. 135 136 /** Retrieves a copy of the clip region used when creating the @a context. 137 * 138 * @newin{3,22} 139 * 140 * @return A Cairo region. 141 */ 142 ::Cairo::RefPtr< ::Cairo::Region> get_clip() const; 143 144 145 /** Checks whether the given Gdk::DrawingContext is valid. 146 * 147 * @newin{3,22} 148 * 149 * @return <tt>true</tt> if the context is valid. 150 */ 151 bool is_valid() const; 152 153 154 /** Retrieves a Cairo context to be used to draw on the Gdk::Window 155 * that created the Gdk::DrawingContext. 156 * 157 * The returned context is guaranteed to be valid as long as the 158 * Gdk::DrawingContext is valid, that is between a call to 159 * Gdk::Window::begin_draw_frame() and Gdk::Window::end_draw_frame(). 160 * 161 * @newin{3,22} 162 * 163 * @return A Cairo context to be used to draw 164 * the contents of the Gdk::Window. The context is owned by the 165 * Gdk::DrawingContext and should not be destroyed. 166 */ 167 ::Cairo::RefPtr< ::Cairo::Context> get_cairo_context(); 168 169 /** Retrieves a Cairo context to be used to draw on the Gdk::Window 170 * that created the Gdk::DrawingContext. 171 * 172 * The returned context is guaranteed to be valid as long as the 173 * Gdk::DrawingContext is valid, that is between a call to 174 * Gdk::Window::begin_draw_frame() and Gdk::Window::end_draw_frame(). 175 * 176 * @newin{3,22} 177 * 178 * @return A Cairo context to be used to draw 179 * the contents of the Gdk::Window. The context is owned by the 180 * Gdk::DrawingContext and should not be destroyed. 181 */ 182 ::Cairo::RefPtr<const ::Cairo::Context> get_cairo_context() const; 183 184 185 /** Retrieves the Gdk::DrawingContext that created the Cairo 186 * context @a cr. 187 * 188 * @newin{3,22} 189 * 190 * @param cr A Cairo context. 191 * @return A Gdk::DrawingContext, if any is set. 192 */ 193 static Glib::RefPtr<DrawingContext> get_drawing_context_from_cairo_context(const ::Cairo::RefPtr< ::Cairo::Context>& cr); 194 195 /** The Gdk::Window that created the drawing context. 196 * 197 * @newin{3,22} 198 * 199 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 200 * or receive notification when the value of the property changes. 201 */ 202 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Window> > property_window() const; 203 204 205 // A wrapped property_clip() would require a template specialization 206 // Glib::Value<Cairo::RefPtr<T>>. 207 //_WRAP_PROPERTY("clip", ::Cairo::RefPtr< ::Cairo::Region>) 208 209 // There are no signals or vfuncs. 210 211 212 public: 213 214 public: 215 //C++ methods used to invoke GTK+ virtual functions: 216 217 protected: 218 //GTK+ Virtual Functions (override these to change behaviour): 219 220 //Default Signal Handlers:: 221 222 223 }; 224 225 } // namespace Gdk 226 227 228 namespace Glib 229 { 230 /** A Glib::wrap() method for this object. 231 * 232 * @param object The C instance. 233 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. 234 * @result A C++ instance that wraps this C instance. 235 * 236 * @relates Gdk::DrawingContext 237 */ 238 Glib::RefPtr<Gdk::DrawingContext> wrap(GdkDrawingContext* object, bool take_copy = false); 239 } 240 241 242 #endif /* _GDKMM_DRAWINGCONTEXT_H */ 243 244