1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
28 #error "Only <gdk/gdk.h> can be included directly."
34 #include <gdk/gdkcolor.h>
35 #include <gdk/gdktypes.h>
39 typedef struct _GdkGCValues GdkGCValues;
40 typedef struct _GdkGCClass GdkGCClass;
71 * Copy: Overwrites destination pixels with the source pixels.
72 * Invert: Inverts the destination pixels.
73 * Xor: Xor's the destination pixels with the source pixels.
74 * Clear: set pixels to 0
75 * And: source AND destination
76 * And Reverse: source AND (NOT destination)
77 * And Invert: (NOT source) AND destination
79 * Or: source OR destination
80 * Nor: (NOT source) AND (NOT destination)
81 * Equiv: (NOT source) XOR destination
82 * Xor Reverse: source OR (NOT destination)
83 * Copy Inverted: NOT source
84 * Xor Inverted: (NOT source) OR destination
85 * Nand: (NOT source) OR (NOT destination)
86 * Set: set pixels to 1
128 GDK_LINE_ON_OFF_DASH,
134 GDK_CLIP_BY_CHILDREN = 0,
135 GDK_INCLUDE_INFERIORS = 1
140 GDK_GC_FOREGROUND = 1 << 0,
141 GDK_GC_BACKGROUND = 1 << 1,
142 GDK_GC_FONT = 1 << 2,
143 GDK_GC_FUNCTION = 1 << 3,
144 GDK_GC_FILL = 1 << 4,
145 GDK_GC_TILE = 1 << 5,
146 GDK_GC_STIPPLE = 1 << 6,
147 GDK_GC_CLIP_MASK = 1 << 7,
148 GDK_GC_SUBWINDOW = 1 << 8,
149 GDK_GC_TS_X_ORIGIN = 1 << 9,
150 GDK_GC_TS_Y_ORIGIN = 1 << 10,
151 GDK_GC_CLIP_X_ORIGIN = 1 << 11,
152 GDK_GC_CLIP_Y_ORIGIN = 1 << 12,
153 GDK_GC_EXPOSURES = 1 << 13,
154 GDK_GC_LINE_WIDTH = 1 << 14,
155 GDK_GC_LINE_STYLE = 1 << 15,
156 GDK_GC_CAP_STYLE = 1 << 16,
157 GDK_GC_JOIN_STYLE = 1 << 17
165 GdkFunction function;
169 GdkPixmap *clip_mask;
170 GdkSubwindowMode subwindow_mode;
175 gint graphics_exposures;
177 GdkLineStyle line_style;
178 GdkCapStyle cap_style;
179 GdkJoinStyle join_style;
182 #define GDK_TYPE_GC (gdk_gc_get_type ())
183 #define GDK_GC(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC, GdkGC))
184 #define GDK_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC, GdkGCClass))
185 #define GDK_IS_GC(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC))
186 #define GDK_IS_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC))
187 #define GDK_GC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC, GdkGCClass))
191 GObject parent_instance;
193 gint GSEAL (clip_x_origin);
194 gint GSEAL (clip_y_origin);
195 gint GSEAL (ts_x_origin);
196 gint GSEAL (ts_y_origin);
198 GdkColormap *GSEAL (colormap);
203 GObjectClass parent_class;
205 void (*get_values) (GdkGC *gc,
206 GdkGCValues *values);
207 void (*set_values) (GdkGC *gc,
209 GdkGCValuesMask mask);
210 void (*set_dashes) (GdkGC *gc,
215 /* Padding for future expansion */
216 void (*_gdk_reserved1) (void);
217 void (*_gdk_reserved2) (void);
218 void (*_gdk_reserved3) (void);
219 void (*_gdk_reserved4) (void);
223 GType gdk_gc_get_type (void) G_GNUC_CONST;
224 GdkGC *gdk_gc_new (GdkDrawable *drawable);
225 GdkGC *gdk_gc_new_with_values (GdkDrawable *drawable,
227 GdkGCValuesMask values_mask);
229 void gdk_gc_get_values (GdkGC *gc,
230 GdkGCValues *values);
231 void gdk_gc_set_values (GdkGC *gc,
233 GdkGCValuesMask values_mask);
234 void gdk_gc_set_foreground (GdkGC *gc,
235 const GdkColor *color);
236 void gdk_gc_set_background (GdkGC *gc,
237 const GdkColor *color);
238 void gdk_gc_set_function (GdkGC *gc,
239 GdkFunction function);
240 void gdk_gc_set_fill (GdkGC *gc,
242 void gdk_gc_set_tile (GdkGC *gc,
244 void gdk_gc_set_stipple (GdkGC *gc,
246 void gdk_gc_set_ts_origin (GdkGC *gc,
249 void gdk_gc_set_clip_origin (GdkGC *gc,
252 void gdk_gc_set_clip_mask (GdkGC *gc,
254 void gdk_gc_set_clip_rectangle (GdkGC *gc,
255 const GdkRectangle *rectangle);
256 void gdk_gc_set_clip_region (GdkGC *gc,
257 const GdkRegion *region);
258 void gdk_gc_set_subwindow (GdkGC *gc,
259 GdkSubwindowMode mode);
260 void gdk_gc_set_exposures (GdkGC *gc,
262 void gdk_gc_set_line_attributes (GdkGC *gc,
264 GdkLineStyle line_style,
265 GdkCapStyle cap_style,
266 GdkJoinStyle join_style);
267 void gdk_gc_set_dashes (GdkGC *gc,
271 void gdk_gc_offset (GdkGC *gc,
274 void gdk_gc_copy (GdkGC *dst_gc,
278 void gdk_gc_set_colormap (GdkGC *gc,
279 GdkColormap *colormap);
280 GdkColormap *gdk_gc_get_colormap (GdkGC *gc);
281 void gdk_gc_set_rgb_fg_color (GdkGC *gc,
282 const GdkColor *color);
283 void gdk_gc_set_rgb_bg_color (GdkGC *gc,
284 const GdkColor *color);
285 GdkScreen * gdk_gc_get_screen (GdkGC *gc);
290 #endif /* __GDK_DRAWABLE_H__ */