gdkdrawable.h 11.5 KB
Newer Older
Owen Taylor's avatar
Started  
Owen Taylor committed
1 2 3
#ifndef __GDK_DRAWABLE_H__
#define __GDK_DRAWABLE_H__

4
#include <gdk/gdktypes.h>
5
#include <gdk/gdkgc.h>
6 7
#include <gdk/gdkrgb.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
Owen Taylor's avatar
Started  
Owen Taylor committed
8 9 10 11 12

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

13 14
typedef struct _GdkDrawableClass GdkDrawableClass;

15 16 17 18 19 20
#define GDK_TYPE_DRAWABLE              (gdk_drawable_get_type ())
#define GDK_DRAWABLE(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAWABLE, GdkDrawable))
#define GDK_DRAWABLE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWABLE, GdkDrawableClass))
#define GDK_IS_DRAWABLE(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAWABLE))
#define GDK_IS_DRAWABLE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAWABLE))
#define GDK_DRAWABLE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAWABLE, GdkDrawableClass))
Owen Taylor's avatar
Started  
Owen Taylor committed
21

22
struct _GdkDrawable
Owen Taylor's avatar
Started  
Owen Taylor committed
23
{
24
  GObject parent_instance;
Owen Taylor's avatar
Started  
Owen Taylor committed
25
};
26 27 28
 
struct _GdkDrawableClass 
{
29 30
  GObjectClass parent_class;
  
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
  GdkGC *(*create_gc)    (GdkDrawable    *drawable,
		          GdkGCValues    *values,
		          GdkGCValuesMask mask);
  void (*draw_rectangle) (GdkDrawable  *drawable,
			  GdkGC	       *gc,
			  gint		filled,
			  gint		x,
			  gint		y,
			  gint		width,
			  gint		height);
  void (*draw_arc)       (GdkDrawable  *drawable,
			  GdkGC	       *gc,
			  gint		filled,
			  gint		x,
			  gint		y,
			  gint		width,
			  gint		height,
			  gint		angle1,
			  gint		angle2);
  void (*draw_polygon)   (GdkDrawable  *drawable,
			  GdkGC	       *gc,
			  gint		filled,
			  GdkPoint     *points,
			  gint		npoints);
  void (*draw_text)      (GdkDrawable  *drawable,
			  GdkFont      *font,
			  GdkGC	       *gc,
			  gint		x,
			  gint		y,
			  const gchar  *text,
			  gint		text_length);
  void (*draw_text_wc)   (GdkDrawable	 *drawable,
			  GdkFont	 *font,
			  GdkGC		 *gc,
			  gint		  x,
			  gint		  y,
			  const GdkWChar *text,
			  gint		  text_length);
  void (*draw_drawable)  (GdkDrawable  *drawable,
			  GdkGC	       *gc,
			  GdkDrawable  *src,
			  gint		xsrc,
			  gint		ysrc,
			  gint		xdest,
			  gint		ydest,
			  gint		width,
			  gint		height);
  void (*draw_points)	 (GdkDrawable  *drawable,
			  GdkGC	       *gc,
			  GdkPoint     *points,
			  gint		npoints);
  void (*draw_segments)	 (GdkDrawable  *drawable,
			  GdkGC	       *gc,
			  GdkSegment   *segs,
			  gint		nsegs);
86
 void (*draw_lines)     (GdkDrawable  *drawable,
87 88 89
			  GdkGC        *gc,
			  GdkPoint     *points,
			  gint          npoints);
90

91 92 93 94 95 96
  void (*draw_glyphs)    (GdkDrawable      *drawable,
			  GdkGC	           *gc,
			  PangoFont        *font,
			  gint              x,
			  gint              y,
			  PangoGlyphString *glyphs);
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115

  void (*draw_image)     (GdkDrawable *drawable,
                          GdkGC	      *gc,
                          GdkImage    *image,
                          gint	       xsrc,
                          gint	       ysrc,
                          gint	       xdest,
                          gint	       ydest,
                          gint	       width,
                          gint	       height);
  
  gint (*get_depth)      (GdkDrawable  *drawable);
  void (*get_size)       (GdkDrawable  *drawable,
                          gint         *width,
                          gint         *height);

  void (*set_colormap)   (GdkDrawable  *drawable,
                          GdkColormap  *cmap);

116 117 118
  GdkColormap* (*get_colormap)	(GdkDrawable  *drawable);
  GdkVisual*   (*get_visual)	(GdkDrawable  *drawable);
  GdkScreen*   (*get_screen)	(GdkDrawable  *drawable);
Havoc Pennington's avatar
Havoc Pennington committed
119 120 121 122 123 124 125

  GdkImage*    (*get_image)  (GdkDrawable  *drawable,
                              gint          x,
                              gint          y,
                              gint          width,
                              gint          height);

126 127 128
  GdkRegion*   (*get_clip_region)    (GdkDrawable  *drawable);
  GdkRegion*   (*get_visible_region) (GdkDrawable  *drawable);

Havoc Pennington's avatar
Havoc Pennington committed
129 130 131 132 133 134 135
  GdkDrawable* (*get_composite_drawable) (GdkDrawable *drawable,
                                          gint         x,
                                          gint         y,
                                          gint         width,
                                          gint         height,
                                          gint        *composite_x_offset,
                                          gint        *composite_y_offset);
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157

  void         (*_draw_pixbuf) (GdkDrawable *drawable,
			        GdkGC       *gc,
			        GdkPixbuf   *pixbuf,
			        gint         src_x,
			        gint         src_y,
			        gint         dest_x,
			        gint         dest_y,
			        gint         width,
			        gint         height,
			        GdkRgbDither dither,
			        gint         x_dither,
			        gint         y_dither);
  GdkImage*    (*_copy_to_image) (GdkDrawable    *drawable,
				  GdkImage       *image,
				  gint            src_x,
				  gint            src_y,
				  gint            dest_x,
				  gint            dest_y,
				  gint            width,
				  gint            height);

158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
  /* Padding for future expansion */
  void         (*_gdk_reserved1)  (void);
  void         (*_gdk_reserved2)  (void);
  void         (*_gdk_reserved3)  (void);
  void         (*_gdk_reserved4)  (void);
  void         (*_gdk_reserved5)  (void);
  void         (*_gdk_reserved6)  (void);
  void         (*_gdk_reserved7)  (void);
  void         (*_gdk_reserved9)  (void);
  void         (*_gdk_reserved10) (void);
  void         (*_gdk_reserved11) (void);
  void         (*_gdk_reserved12) (void);
  void         (*_gdk_reserved13) (void);
  void         (*_gdk_reserved14) (void);
  void         (*_gdk_reserved15) (void);
  void         (*_gdk_reserved16) (void);
174
};
Owen Taylor's avatar
Started  
Owen Taylor committed
175

176 177
GType           gdk_drawable_get_type     (void);

178 179 180
/* Manipulation of drawables
 */

Havoc Pennington's avatar
Havoc Pennington committed
181
#ifndef GDK_DISABLE_DEPRECATED
182 183 184 185
void            gdk_drawable_set_data     (GdkDrawable    *drawable,
					   const gchar    *key,
					   gpointer	  data,
					   GDestroyNotify  destroy_func);
186
gpointer        gdk_drawable_get_data     (GdkDrawable    *drawable,
187
					   const gchar    *key);
Havoc Pennington's avatar
Havoc Pennington committed
188
#endif /* GDK_DISABLE_DEPRECATED */
189

190
void            gdk_drawable_get_size     (GdkDrawable	  *drawable,
191 192 193 194 195 196
					   gint	          *width,
					   gint  	  *height);
void	        gdk_drawable_set_colormap (GdkDrawable	  *drawable,
					   GdkColormap	  *colormap);
GdkColormap*    gdk_drawable_get_colormap (GdkDrawable	  *drawable);
GdkVisual*      gdk_drawable_get_visual   (GdkDrawable	  *drawable);
197
gint            gdk_drawable_get_depth    (GdkDrawable	  *drawable);
198 199
GdkScreen*	gdk_drawable_get_screen   (GdkDrawable    *drawable);
GdkDisplay*	gdk_drawable_get_display  (GdkDrawable    *drawable);
Matthias Clasen's avatar
Matthias Clasen committed
200 201

#ifndef GDK_DISABLE_DEPRECATED
202 203
GdkDrawable*    gdk_drawable_ref          (GdkDrawable    *drawable);
void            gdk_drawable_unref        (GdkDrawable    *drawable);
Matthias Clasen's avatar
Matthias Clasen committed
204
#endif /* GDK_DISABLE_DEPRECATED */
205

Owen Taylor's avatar
Started  
Owen Taylor committed
206 207
/* Drawing
 */
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
void gdk_draw_point     (GdkDrawable      *drawable,
			 GdkGC            *gc,
			 gint              x,
			 gint              y);
void gdk_draw_line      (GdkDrawable      *drawable,
			 GdkGC            *gc,
			 gint              x1,
			 gint              y1,
			 gint              x2,
			 gint              y2);
void gdk_draw_rectangle (GdkDrawable      *drawable,
			 GdkGC            *gc,
			 gint              filled,
			 gint              x,
			 gint              y,
			 gint              width,
			 gint              height);
void gdk_draw_arc       (GdkDrawable      *drawable,
			 GdkGC            *gc,
			 gint              filled,
			 gint              x,
			 gint              y,
			 gint              width,
			 gint              height,
			 gint              angle1,
			 gint              angle2);
void gdk_draw_polygon   (GdkDrawable      *drawable,
			 GdkGC            *gc,
			 gint              filled,
			 GdkPoint         *points,
			 gint              npoints);
239
#ifndef GDK_DISABLE_DEPRECATED
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
void gdk_draw_string    (GdkDrawable      *drawable,
			 GdkFont          *font,
			 GdkGC            *gc,
			 gint              x,
			 gint              y,
			 const gchar      *string);
void gdk_draw_text      (GdkDrawable      *drawable,
			 GdkFont          *font,
			 GdkGC            *gc,
			 gint              x,
			 gint              y,
			 const gchar      *text,
			 gint              text_length);
void gdk_draw_text_wc   (GdkDrawable      *drawable,
			 GdkFont          *font,
			 GdkGC            *gc,
			 gint              x,
			 gint              y,
			 const GdkWChar   *text,
			 gint              text_length);
260
#endif /* GDK_DISABLE_DEPRECATED */
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
void gdk_draw_drawable  (GdkDrawable      *drawable,
			 GdkGC            *gc,
			 GdkDrawable      *src,
			 gint              xsrc,
			 gint              ysrc,
			 gint              xdest,
			 gint              ydest,
			 gint              width,
			 gint              height);
void gdk_draw_image     (GdkDrawable      *drawable,
			 GdkGC            *gc,
			 GdkImage         *image,
			 gint              xsrc,
			 gint              ysrc,
			 gint              xdest,
			 gint              ydest,
			 gint              width,
			 gint              height);
void gdk_draw_points    (GdkDrawable      *drawable,
			 GdkGC            *gc,
			 GdkPoint         *points,
			 gint              npoints);
void gdk_draw_segments  (GdkDrawable      *drawable,
			 GdkGC            *gc,
			 GdkSegment       *segs,
			 gint              nsegs);
void gdk_draw_lines     (GdkDrawable      *drawable,
			 GdkGC            *gc,
			 GdkPoint         *points,
			 gint              npoints);

void gdk_draw_glyphs      (GdkDrawable      *drawable,
			   GdkGC            *gc,
			   PangoFont        *font,
			   gint              x,
			   gint              y,
			   PangoGlyphString *glyphs);
void gdk_draw_layout_line (GdkDrawable      *drawable,
			   GdkGC            *gc,
			   gint              x,
			   gint              y,
			   PangoLayoutLine  *line);
void gdk_draw_layout      (GdkDrawable      *drawable,
			   GdkGC            *gc,
			   gint              x,
			   gint              y,
			   PangoLayout      *layout);

309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
void gdk_draw_layout_line_with_colors (GdkDrawable     *drawable,
                                       GdkGC           *gc,
                                       gint             x,
                                       gint             y,
                                       PangoLayoutLine *line,
                                       GdkColor        *foreground,
                                       GdkColor        *background);
void gdk_draw_layout_with_colors      (GdkDrawable     *drawable,
                                       GdkGC           *gc,
                                       gint             x,
                                       gint             y,
                                       PangoLayout     *layout,
                                       GdkColor        *foreground,
                                       GdkColor        *background);

324 325 326 327 328
#ifndef GDK_DISABLE_DEPRECATED
#define gdk_draw_pixmap                gdk_draw_drawable
#define gdk_draw_bitmap                gdk_draw_drawable
#endif /* GDK_DISABLE_DEPRECATED */

Havoc Pennington's avatar
Havoc Pennington committed
329 330 331 332 333 334
GdkImage* gdk_drawable_get_image (GdkDrawable *drawable,
                                  gint         x,
                                  gint         y,
                                  gint         width,
                                  gint         height);

335 336 337
GdkRegion *gdk_drawable_get_clip_region    (GdkDrawable *drawable);
GdkRegion *gdk_drawable_get_visible_region (GdkDrawable *drawable);

Owen Taylor's avatar
Started  
Owen Taylor committed
338 339 340 341 342
#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __GDK_DRAWABLE_H__ */