diff options
Diffstat (limited to 'gdk/gdkdrawable.h')
-rw-r--r-- | gdk/gdkdrawable.h | 70 |
1 files changed, 34 insertions, 36 deletions
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h index c7a6ef41eb..0091858ef5 100644 --- a/gdk/gdkdrawable.h +++ b/gdk/gdkdrawable.h @@ -10,45 +10,22 @@ extern "C" { typedef struct _GdkDrawableClass GdkDrawableClass; -/* Types of windows. - * Root: There is only 1 root window and it is initialized - * at startup. Creating a window of type GDK_WINDOW_ROOT - * is an error. - * Toplevel: Windows which interact with the window manager. - * Child: Windows which are children of some other type of window. - * (Any other type of window). Most windows are child windows. - * Dialog: A special kind of toplevel window which interacts with - * the window manager slightly differently than a regular - * toplevel window. Dialog windows should be used for any - * transient window. - * Pixmap: Pixmaps are really just another kind of window which - * doesn't actually appear on the screen. It can't have - * children, either and is really just a convenience so - * that the drawing functions can work on both windows - * and pixmaps transparently. (ie. You shouldn't pass a - * pixmap to any procedure which accepts a window with the - * exception of the drawing functions). - * Foreign: A window that actually belongs to another application - */ -typedef enum -{ - GDK_WINDOW_ROOT, - GDK_WINDOW_TOPLEVEL, - GDK_WINDOW_CHILD, - GDK_WINDOW_DIALOG, - GDK_WINDOW_TEMP, - GDK_DRAWABLE_PIXMAP, - GDK_WINDOW_FOREIGN -} GdkDrawableType; +#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)) struct _GdkDrawable { - gpointer user_data; + GObject parent_instance; }; struct _GdkDrawableClass { - void (*destroy) (GdkDrawable *drawable); + GObjectClass parent_class; + GdkGC *(*create_gc) (GdkDrawable *drawable, GdkGCValues *values, GdkGCValuesMask mask); @@ -108,19 +85,40 @@ struct _GdkDrawableClass GdkGC *gc, GdkPoint *points, gint npoints); + void (*draw_glyphs) (GdkDrawable *drawable, GdkGC *gc, PangoFont *font, gint x, gint y, PangoGlyphString *glyphs); + + 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); + + GdkColormap* (*get_colormap) (GdkDrawable *drawable); + GdkVisual* (*get_visual) (GdkDrawable *drawable); }; +GType gdk_drawable_get_type (void); + /* Manipulation of drawables */ -GdkDrawable * gdk_drawable_alloc (void); - -GdkDrawableType gdk_drawable_get_type (GdkDrawable *window); void gdk_drawable_set_data (GdkDrawable *drawable, const gchar *key, @@ -129,7 +127,7 @@ void gdk_drawable_set_data (GdkDrawable *drawable, gpointer gdk_drawable_get_data (GdkDrawable *drawable, const gchar *key); -void gdk_drawable_get_size (GdkWindow *drawable, +void gdk_drawable_get_size (GdkDrawable *drawable, gint *width, gint *height); void gdk_drawable_set_colormap (GdkDrawable *drawable, |