]> Pileus Git - ~andy/gtk/blob - gdk/gdkgc.h
got rid of gtk_widget_popup(), a function that bad needs to be nuked, not
[~andy/gtk] / gdk / gdkgc.h
1 #ifndef __GDK_GC_H__
2 #define __GDK_GC_H__
3
4 #include <gdk/gdkcolor.h>
5 #include <gdk/gdktypes.h>
6
7 #ifdef __cplusplus
8 extern "C" {
9 #endif /* __cplusplus */
10
11 typedef struct _GdkGCValues           GdkGCValues;
12 typedef struct _GdkGCClass            GdkGCClass;
13
14 /* GC cap styles
15  *  CapNotLast:
16  *  CapButt:
17  *  CapRound:
18  *  CapProjecting:
19  */
20 typedef enum
21 {
22   GDK_CAP_NOT_LAST,
23   GDK_CAP_BUTT,
24   GDK_CAP_ROUND,
25   GDK_CAP_PROJECTING
26 } GdkCapStyle;
27
28 /* GC fill types.
29  *  Solid:
30  *  Tiled:
31  *  Stippled:
32  *  OpaqueStippled:
33  */
34 typedef enum
35 {
36   GDK_SOLID,
37   GDK_TILED,
38   GDK_STIPPLED,
39   GDK_OPAQUE_STIPPLED
40 } GdkFill;
41
42 /* GC function types.
43  *   Copy: Overwrites destination pixels with the source pixels.
44  *   Invert: Inverts the destination pixels.
45  *   Xor: Xor's the destination pixels with the source pixels.
46  *   Clear: set pixels to 0
47  *   And: source AND destination
48  *   And Reverse: source AND (NOT destination)
49  *   And Invert: (NOT source) AND destination
50  *   Noop: destination
51  *   Or: source OR destination
52  *   Nor: (NOT source) AND (NOT destination)
53  *   Equiv: (NOT source) XOR destination
54  *   Xor Reverse: source OR (NOT destination)
55  *   Copy Inverted: NOT source
56  *   Xor Inverted: (NOT source) OR destination
57  *   Nand: (NOT source) OR (NOT destination)
58  *   Set: set pixels to 1
59  */
60 typedef enum
61 {
62   GDK_COPY,
63   GDK_INVERT,
64   GDK_XOR,
65   GDK_CLEAR,
66   GDK_AND,
67   GDK_AND_REVERSE,
68   GDK_AND_INVERT,
69   GDK_NOOP,
70   GDK_OR,
71   GDK_EQUIV,
72   GDK_OR_REVERSE,
73   GDK_COPY_INVERT,
74   GDK_OR_INVERT,
75   GDK_NAND,
76   GDK_NOR,
77   GDK_SET
78 } GdkFunction;
79
80 /* GC join styles
81  *  JoinMiter:
82  *  JoinRound:
83  *  JoinBevel:
84  */
85 typedef enum
86 {
87   GDK_JOIN_MITER,
88   GDK_JOIN_ROUND,
89   GDK_JOIN_BEVEL
90 } GdkJoinStyle;
91
92 /* GC line styles
93  *  Solid:
94  *  OnOffDash:
95  *  DoubleDash:
96  */
97 typedef enum
98 {
99   GDK_LINE_SOLID,
100   GDK_LINE_ON_OFF_DASH,
101   GDK_LINE_DOUBLE_DASH
102 } GdkLineStyle;
103
104 typedef enum
105 {
106   GDK_CLIP_BY_CHILDREN  = 0,
107   GDK_INCLUDE_INFERIORS = 1
108 } GdkSubwindowMode;
109
110 typedef enum
111 {
112   GDK_GC_FOREGROUND    = 1 << 0,
113   GDK_GC_BACKGROUND    = 1 << 1,
114   GDK_GC_FONT          = 1 << 2,
115   GDK_GC_FUNCTION      = 1 << 3,
116   GDK_GC_FILL          = 1 << 4,
117   GDK_GC_TILE          = 1 << 5,
118   GDK_GC_STIPPLE       = 1 << 6,
119   GDK_GC_CLIP_MASK     = 1 << 7,
120   GDK_GC_SUBWINDOW     = 1 << 8,
121   GDK_GC_TS_X_ORIGIN   = 1 << 9,
122   GDK_GC_TS_Y_ORIGIN   = 1 << 10,
123   GDK_GC_CLIP_X_ORIGIN = 1 << 11,
124   GDK_GC_CLIP_Y_ORIGIN = 1 << 12,
125   GDK_GC_EXPOSURES     = 1 << 13,
126   GDK_GC_LINE_WIDTH    = 1 << 14,
127   GDK_GC_LINE_STYLE    = 1 << 15,
128   GDK_GC_CAP_STYLE     = 1 << 16,
129   GDK_GC_JOIN_STYLE    = 1 << 17
130 } GdkGCValuesMask;
131
132 struct _GdkGCValues
133 {
134   GdkColor          foreground;
135   GdkColor          background;
136   GdkFont          *font;
137   GdkFunction       function;
138   GdkFill           fill;
139   GdkPixmap        *tile;
140   GdkPixmap        *stipple;
141   GdkPixmap        *clip_mask;
142   GdkSubwindowMode  subwindow_mode;
143   gint              ts_x_origin;
144   gint              ts_y_origin;
145   gint              clip_x_origin;
146   gint              clip_y_origin;
147   gint              graphics_exposures;
148   gint              line_width;
149   GdkLineStyle      line_style;
150   GdkCapStyle       cap_style;
151   GdkJoinStyle      join_style;
152 };
153
154 #define GDK_TYPE_GC              (gdk_gc_get_type ())
155 #define GDK_GC(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC, GdkGC))
156 #define GDK_GC_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC, GdkGCClass))
157 #define GDK_IS_GC(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC))
158 #define GDK_IS_GC_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC))
159 #define GDK_GC_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC, GdkGCClass))
160
161 struct _GdkGC
162 {
163   GObject parent_instance;
164
165   gint clip_x_origin;
166   gint clip_y_origin;
167   gint ts_x_origin;
168   gint ts_y_origin;
169
170   GdkColormap *colormap;
171 };
172
173 struct _GdkGCClass 
174 {
175   GObjectClass parent_class;
176   
177   void (*get_values)     (GdkGC          *gc,
178                           GdkGCValues    *values);
179   void (*set_values)     (GdkGC          *gc,
180                           GdkGCValues    *values,
181                           GdkGCValuesMask mask);
182   void (*set_dashes)     (GdkGC          *gc,
183                           gint            dash_offset,
184                           gint8           dash_list[],
185                           gint            n);
186 };
187
188
189 GType  gdk_gc_get_type            (void) G_GNUC_CONST;
190 GdkGC *gdk_gc_new                 (GdkDrawable      *drawable);
191 GdkGC *gdk_gc_new_with_values     (GdkDrawable      *drawable,
192                                    GdkGCValues      *values,
193                                    GdkGCValuesMask   values_mask);
194 GdkGC *gdk_gc_ref                 (GdkGC            *gc);
195 void   gdk_gc_unref               (GdkGC            *gc);
196 void   gdk_gc_get_values          (GdkGC            *gc,
197                                    GdkGCValues      *values);
198 void   gdk_gc_set_values          (GdkGC           *gc,
199                                    GdkGCValues     *values,
200                                    GdkGCValuesMask  values_mask);
201 void   gdk_gc_set_foreground      (GdkGC            *gc,
202                                    GdkColor         *color);
203 void   gdk_gc_set_background      (GdkGC            *gc,
204                                    GdkColor         *color);
205 void   gdk_gc_set_font            (GdkGC            *gc,
206                                    GdkFont          *font);
207 void   gdk_gc_set_function        (GdkGC            *gc,
208                                    GdkFunction       function);
209 void   gdk_gc_set_fill            (GdkGC            *gc,
210                                    GdkFill           fill);
211 void   gdk_gc_set_tile            (GdkGC            *gc,
212                                    GdkPixmap        *tile);
213 void   gdk_gc_set_stipple         (GdkGC            *gc,
214                                    GdkPixmap        *stipple);
215 void   gdk_gc_set_ts_origin       (GdkGC            *gc,
216                                    gint              x,
217                                    gint              y);
218 void   gdk_gc_set_clip_origin     (GdkGC            *gc,
219                                    gint              x,
220                                    gint              y);
221 void   gdk_gc_set_clip_mask       (GdkGC            *gc,
222                                    GdkBitmap        *mask);
223 void   gdk_gc_set_clip_rectangle  (GdkGC            *gc,
224                                    GdkRectangle     *rectangle);
225 void   gdk_gc_set_clip_region     (GdkGC            *gc,
226                                    GdkRegion        *region);
227 void   gdk_gc_set_subwindow       (GdkGC            *gc,
228                                    GdkSubwindowMode  mode);
229 void   gdk_gc_set_exposures       (GdkGC            *gc,
230                                    gboolean          exposures);
231 void   gdk_gc_set_line_attributes (GdkGC            *gc,
232                                    gint              line_width,
233                                    GdkLineStyle      line_style,
234                                    GdkCapStyle       cap_style,
235                                    GdkJoinStyle      join_style);
236 void   gdk_gc_set_dashes          (GdkGC            *gc,
237                                    gint              dash_offset,
238                                    gint8             dash_list[],
239                                    gint              n);
240 void   gdk_gc_copy                (GdkGC            *dst_gc,
241                                    GdkGC            *src_gc);
242
243
244 void         gdk_gc_set_colormap     (GdkGC       *gc,
245                                       GdkColormap *colormap);
246 GdkColormap *gdk_gc_get_colormap     (GdkGC       *gc);
247 void         gdk_gc_set_rgb_fg_color (GdkGC       *gc,
248                                       GdkColor    *color);
249 void         gdk_gc_set_rgb_bg_color (GdkGC       *gc,
250                                       GdkColor    *color);
251
252 #ifdef __cplusplus
253 }
254 #endif /* __cplusplus */
255
256 #endif /* __GDK_DRAWABLE_H__ */