Ardour  9.0-pre0-582-g084a23a80d
gc.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GDKMM_GC_H
4 #define _GDKMM_GC_H
5 
6 
7 #include <glibmm/ustring.h>
8 #include <sigc++/sigc++.h>
9 
10 /* $Id: gc.hg,v 1.8 2006/04/12 11:11:24 murrayc Exp $ */
11 
12 /* gc.h
13  *
14  * Copyright (C) 1998-2002 The gtkmm Development Team
15  *
16  * This library is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU Lesser General Public
18  * License as published by the Free Software Foundation; either
19  * version 2.1 of the License, or (at your option) any later version.
20  *
21  * This library is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24  * Lesser General Public License for more details.
25  *
26  * You should have received a copy of the GNU Lesser General Public
27  * License along with this library; if not, write to the Free
28  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29  */
30 
31 #include <glibmm/object.h>
32 #include <gdkmm/region.h>
33 #include <gdkmm/drawable.h>
34 #include <gdkmm/types.h>
35 #include <gdkmm/rectangle.h>
36 #include <gdkmm/screen.h>
37 
38 
39 #ifndef DOXYGEN_SHOULD_SKIP_THIS
40 typedef struct _GdkGC GdkGC;
41 typedef struct _GdkGCClass GdkGCClass;
42 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
43 
44 
45 #ifndef DOXYGEN_SHOULD_SKIP_THIS
46 namespace Gdk
47 { class GC_Class; } // namespace Gdk
48 #endif //DOXYGEN_SHOULD_SKIP_THIS
49 
50 namespace Gdk
51 {
52 
60 {
64 };
65 
66 } // namespace Gdk
67 
68 
69 #ifndef DOXYGEN_SHOULD_SKIP_THIS
70 namespace Glib
71 {
72 
73 template <>
74 class Value<Gdk::LineStyle> : public Glib::Value_Enum<Gdk::LineStyle>
75 {
76 public:
77  static GType value_type() G_GNUC_CONST;
78 };
79 
80 } // namespace Glib
81 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
82 
83 
84 namespace Gdk
85 {
86 
92 {
97 };
98 
99 } // namespace Gdk
100 
101 
102 #ifndef DOXYGEN_SHOULD_SKIP_THIS
103 namespace Glib
104 {
105 
106 template <>
107 class Value<Gdk::CapStyle> : public Glib::Value_Enum<Gdk::CapStyle>
108 {
109 public:
110  static GType value_type() G_GNUC_CONST;
111 };
112 
113 } // namespace Glib
114 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
115 
116 
117 namespace Gdk
118 {
119 
125 {
128  JOIN_BEVEL
129 };
130 
131 } // namespace Gdk
132 
133 
134 #ifndef DOXYGEN_SHOULD_SKIP_THIS
135 namespace Glib
136 {
137 
138 template <>
139 class Value<Gdk::JoinStyle> : public Glib::Value_Enum<Gdk::JoinStyle>
140 {
141 public:
142  static GType value_type() G_GNUC_CONST;
143 };
144 
145 } // namespace Glib
146 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
147 
148 
149 namespace Gdk
150 {
151 
156 enum Fill
157 {
162 };
163 
164 } // namespace Gdk
165 
166 
167 #ifndef DOXYGEN_SHOULD_SKIP_THIS
168 namespace Glib
169 {
170 
171 template <>
172 class Value<Gdk::Fill> : public Glib::Value_Enum<Gdk::Fill>
173 {
174 public:
175  static GType value_type() G_GNUC_CONST;
176 };
177 
178 } // namespace Glib
179 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
180 
181 
182 namespace Gdk
183 {
184 
190 {
199  OR,
206  SET
207 };
208 
209 } // namespace Gdk
210 
211 
212 #ifndef DOXYGEN_SHOULD_SKIP_THIS
213 namespace Glib
214 {
215 
216 template <>
217 class Value<Gdk::Function> : public Glib::Value_Enum<Gdk::Function>
218 {
219 public:
220  static GType value_type() G_GNUC_CONST;
221 };
222 
223 } // namespace Glib
224 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
225 
226 
227 namespace Gdk
228 {
229 
235 {
238 };
239 
240 } // namespace Gdk
241 
242 
243 #ifndef DOXYGEN_SHOULD_SKIP_THIS
244 namespace Glib
245 {
246 
247 template <>
248 class Value<Gdk::SubwindowMode> : public Glib::Value_Enum<Gdk::SubwindowMode>
249 {
250 public:
251  static GType value_type() G_GNUC_CONST;
252 };
253 
254 } // namespace Glib
255 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
256 
257 
258 namespace Gdk
259 {
260 
274 {
275  GC_FOREGROUND = 1 << 0,
276  GC_BACKGROUND = 1 << 1,
277  GC_FONT = 1 << 2,
278  GC_FUNCTION = 1 << 3,
279  GC_FILL = 1 << 4,
280  GC_TILE = 1 << 5,
281  GC_STIPPLE = 1 << 6,
282  GC_CLIP_MASK = 1 << 7,
283  GC_SUBWINDOW = 1 << 8,
284  GC_TS_X_ORIGIN = 1 << 9,
285  GC_TS_Y_ORIGIN = 1 << 10,
286  GC_CLIP_X_ORIGIN = 1 << 11,
287  GC_CLIP_Y_ORIGIN = 1 << 12,
288  GC_EXPOSURES = 1 << 13,
289  GC_LINE_WIDTH = 1 << 14,
290  GC_LINE_STYLE = 1 << 15,
291  GC_CAP_STYLE = 1 << 16,
292  GC_JOIN_STYLE = 1 << 17
293 };
294 
297  { return static_cast<GCValuesMask>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
298 
301  { return static_cast<GCValuesMask>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
302 
305  { return static_cast<GCValuesMask>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
306 
309  { return static_cast<GCValuesMask>(~static_cast<unsigned>(flags)); }
310 
313  { return (lhs = static_cast<GCValuesMask>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
314 
317  { return (lhs = static_cast<GCValuesMask>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
318 
321  { return (lhs = static_cast<GCValuesMask>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
322 
323 } // namespace Gdk
324 
325 
326 #ifndef DOXYGEN_SHOULD_SKIP_THIS
327 namespace Glib
328 {
329 
330 template <>
331 class Value<Gdk::GCValuesMask> : public Glib::Value_Flags<Gdk::GCValuesMask>
332 {
333 public:
334  static GType value_type() G_GNUC_CONST;
335 };
336 
337 } // namespace Glib
338 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
339 
340 
341 namespace Gdk
342 {
343 
344 
345 class Drawable;
346 
353 class GC : public Glib::Object
354 {
355 
356 #ifndef DOXYGEN_SHOULD_SKIP_THIS
357 
358 public:
359  typedef GC CppObjectType;
360  typedef GC_Class CppClassType;
361  typedef GdkGC BaseObjectType;
362  typedef GdkGCClass BaseClassType;
363 
364 private: friend class GC_Class;
365  static CppClassType gc_class_;
366 
367 private:
368  // noncopyable
369  GC(const GC&);
370  GC& operator=(const GC&);
371 
372 protected:
373  explicit GC(const Glib::ConstructParams& construct_params);
374  explicit GC(GdkGC* castitem);
375 
376 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
377 
378 public:
379  virtual ~GC();
380 
383  static GType get_type() G_GNUC_CONST;
384 
385 #ifndef DOXYGEN_SHOULD_SKIP_THIS
386 
387 
388  static GType get_base_type() G_GNUC_CONST;
389 #endif
390 
392  GdkGC* gobj() { return reinterpret_cast<GdkGC*>(gobject_); }
393 
395  const GdkGC* gobj() const { return reinterpret_cast<GdkGC*>(gobject_); }
396 
399 
400 private:
401 
402 
403 protected:
404  GC();
405  explicit GC(const Glib::RefPtr<Drawable>& drawable);
406 
407 public:
408 
409  static Glib::RefPtr<GC> create();
410 
411 
412  static Glib::RefPtr<GC> create(const Glib::RefPtr<Drawable>& drawable);
413 
414 
415  // Custom wrap these?, maybe with a Gdk::GC::Value class. Need to do take care of refcounts of GdkGCValue's fields.
416  // Actually, I don't see the need for these methods. murrayc.
417  //_WRAP_METHOD(void get_values(GdkGCValues& values) const, gdk_gc_get_values)
418  //_WRAP_METHOD(void set_values(const GdkGCValues& values, GCValuesMask values_mask), gdk_gc_set_values)
419  //__IGNORE(gdk_gc_get_values, gdk_gc_set_values)
420 
421 
432  void set_foreground(const Color& color);
433 
446  void set_background(const Color& color);
447 
456  void set_function(Function function);
457 
466  void set_fill(Fill fill);
467 
479  void set_tile(const Glib::RefPtr<Pixmap>& tile);
480 
493  void set_stipple(const Glib::RefPtr<Pixmap>& stipple);
494 
508  void set_ts_origin(int x, int y);
509 
520  void set_clip_origin(int x, int y);
521 
530  void set_clip_mask(const Glib::RefPtr<Bitmap>& mask);
531 
532 //Note: The rectangle parameter was made const in GTK+ 2.16, but we can't change that in our C++ API. TODO: Change it when we can do an ABI break.
533 
534 
535 #ifndef GDKMM_DISABLE_DEPRECATED
536 
548 #endif // GDKMM_DISABLE_DEPRECATED
549 
550 
560 
561 
571 
583 
596  void set_exposures(bool exposures);
597 
613  void set_line_attributes(int line_width, LineStyle line_style, CapStyle cap_style, JoinStyle join_style);
614 
632  void set_dashes(int dash_offset, gint8* dash_list, int n);
633 
645  void offset(int x_offset, int y_offset);
646 
656  void set_colormap(const Glib::RefPtr<Colormap>& colormap);
657 
668  Glib::RefPtr<Colormap> get_colormap();
669 
683 
697 
698 
703  Glib::RefPtr<Screen> get_screen();
704 
709  Glib::RefPtr<const Screen> get_screen() const;
710 
711 
712 public:
713 
714 public:
715  //C++ methods used to invoke GTK+ virtual functions:
716 
717 protected:
718  //GTK+ Virtual Functions (override these to change behaviour):
719 
720  //Default Signal Handlers::
721 
722 
723 };
724 
725 } /* namespace Gdk */
726 
727 
728 namespace Glib
729 {
738  Glib::RefPtr<Gdk::GC> wrap(GdkGC* object, bool take_copy = false);
739 }
740 
741 
742 #endif /* _GDKMM_GC_H */
743 
Definition: gc.h:354
GC(const Glib::RefPtr< Drawable > &drawable)
void set_colormap(const Glib::RefPtr< Colormap > &colormap)
void offset(int x_offset, int y_offset)
void set_subwindow(SubwindowMode mode)
Glib::RefPtr< Gdk::GC > wrap(GdkGC *object, bool take_copy=false)
Glib::RefPtr< Screen > get_screen()
GdkGC * gobj_copy()
Provides access to the underlying C instance. The caller is responsible for unrefing it....
const GdkGC * gobj() const
Provides access to the underlying C GObject.
Definition: gc.h:395
virtual ~GC()
void set_clip_region(const Region &region)
static Glib::RefPtr< GC > create()
void set_line_attributes(int line_width, LineStyle line_style, CapStyle cap_style, JoinStyle join_style)
GdkGC * gobj()
Provides access to the underlying C GObject.
Definition: gc.h:392
void set_ts_origin(int x, int y)
void set_exposures(bool exposures)
void set_clip_rectangle(const Rectangle &rectangle)
Glib::RefPtr< const Screen > get_screen() const
static Glib::RefPtr< GC > create(const Glib::RefPtr< Drawable > &drawable)
void set_clip_rectangle(Rectangle &rectangle)
Glib::RefPtr< Colormap > get_colormap()
void set_tile(const Glib::RefPtr< Pixmap > &tile)
void set_dashes(int dash_offset, gint8 *dash_list, int n)
static GType get_type() G_GNUC_CONST
void set_clip_mask(const Glib::RefPtr< Bitmap > &mask)
void set_rgb_bg_color(const Color &color)
void set_background(const Color &color)
void set_function(Function function)
void set_foreground(const Color &color)
void set_fill(Fill fill)
void set_stipple(const Glib::RefPtr< Pixmap > &stipple)
void set_clip_origin(int x, int y)
void set_rgb_fg_color(const Color &color)
GCValuesMask
Definition: gc.h:274
CapStyle
Definition: gc.h:92
JoinStyle
Definition: gc.h:125
DragAction operator&(DragAction lhs, DragAction rhs)
Definition: dragcontext.h:82
DragAction & operator|=(DragAction &lhs, DragAction rhs)
Definition: dragcontext.h:94
DragAction operator~(DragAction flags)
Definition: dragcontext.h:90
SubwindowMode
Definition: gc.h:235
DragAction & operator^=(DragAction &lhs, DragAction rhs)
Definition: dragcontext.h:102
LineStyle
Definition: gc.h:60
DragAction & operator&=(DragAction &lhs, DragAction rhs)
Definition: dragcontext.h:98
DragAction operator^(DragAction lhs, DragAction rhs)
Definition: dragcontext.h:86
Function
Definition: gc.h:190
DragAction operator|(DragAction lhs, DragAction rhs)
Definition: dragcontext.h:78
Fill
Definition: gc.h:157
@ GC_CAP_STYLE
Definition: gc.h:291
@ GC_CLIP_MASK
Definition: gc.h:282
@ GC_TILE
Definition: gc.h:280
@ GC_CLIP_X_ORIGIN
Definition: gc.h:286
@ GC_TS_Y_ORIGIN
Definition: gc.h:285
@ GC_FOREGROUND
Definition: gc.h:275
@ GC_FONT
Definition: gc.h:277
@ GC_TS_X_ORIGIN
Definition: gc.h:284
@ GC_BACKGROUND
Definition: gc.h:276
@ GC_LINE_STYLE
Definition: gc.h:290
@ GC_STIPPLE
Definition: gc.h:281
@ GC_SUBWINDOW
Definition: gc.h:283
@ GC_LINE_WIDTH
Definition: gc.h:289
@ GC_EXPOSURES
Definition: gc.h:288
@ GC_FILL
Definition: gc.h:279
@ GC_FUNCTION
Definition: gc.h:278
@ GC_CLIP_Y_ORIGIN
Definition: gc.h:287
@ GC_JOIN_STYLE
Definition: gc.h:292
@ CAP_NOT_LAST
Definition: gc.h:93
@ CAP_ROUND
Definition: gc.h:95
@ CAP_PROJECTING
Definition: gc.h:96
@ CAP_BUTT
Definition: gc.h:94
@ JOIN_BEVEL
Definition: gc.h:128
@ JOIN_MITER
Definition: gc.h:126
@ JOIN_ROUND
Definition: gc.h:127
@ INCLUDE_INFERIORS
Definition: gc.h:237
@ CLIP_BY_CHILDREN
Definition: gc.h:236
@ LINE_DOUBLE_DASH
Definition: gc.h:63
@ LINE_SOLID
Definition: gc.h:61
@ LINE_ON_OFF_DASH
Definition: gc.h:62
@ AND_REVERSE
Definition: gc.h:196
@ CLEAR
Definition: gc.h:194
@ XOR
Definition: gc.h:193
@ NOR
Definition: gc.h:205
@ OR
Definition: gc.h:199
@ NAND
Definition: gc.h:204
@ SET
Definition: gc.h:206
@ EQUIV
Definition: gc.h:200
@ COPY_INVERT
Definition: gc.h:202
@ OR_INVERT
Definition: gc.h:203
@ OR_REVERSE
Definition: gc.h:201
@ INVERT
Definition: gc.h:192
@ AND
Definition: gc.h:195
@ COPY
Definition: gc.h:191
@ AND_INVERT
Definition: gc.h:197
@ NOOP
Definition: gc.h:198
@ OPAQUE_STIPPLED
Definition: gc.h:161
@ TILED
Definition: gc.h:159
@ STIPPLED
Definition: gc.h:160
@ SOLID
Definition: gc.h:158
PBD::PropertyDescriptor< uint32_t > color
PBD::PropertyDescriptor< bool > region
void rectangle(Cairo::RefPtr< Cairo::Context > context, double x, double y, double w, double h, double r=10)
Definition: gdkgc.h:190
Definition: lobject.h:100