gc->meth.gc_set_background(gc->priv, c);
}
+
+/**
+ * FIXME
+ * @param <>
+ * @returns <>
+ * @author Martin Schaller (04/2008)
+*/
+void graphics_gc_set_stipple(struct graphics_gc *gc, struct graphics_image *img)
+{
+ gc->meth.gc_set_stipple(gc->priv, img ? img->priv : NULL);
+}
+
+
/**
* FIXME
* @param <>
void (*gc_set_dashes)(struct graphics_gc_priv *gc, int width, int offset, unsigned char dash_list[], int n);
void (*gc_set_foreground)(struct graphics_gc_priv *gc, struct color *c);
void (*gc_set_background)(struct graphics_gc_priv *gc, struct color *c);
+ void (*gc_set_stipple)(struct graphics_gc_priv *gc, struct graphics_image_priv *img);
};
struct graphics_gc {
struct graphics_gc_priv {
GdkGC *gc;
+ GdkPixmap *pixmap;
struct graphics_priv *gr;
int level;
unsigned char r,g,b,a;
gc_set_color(gc, c, 0);
}
+static void
+gc_set_stipple(struct graphics_gc_priv *gc, struct graphics_image *img)
+{
+ char data[2]={0x2,0x1};
+ gdk_gc_set_fill(gc->gc, GDK_STIPPLED);
+ gc->pixmap=gdk_bitmap_create_from_data(gc->gr->widget->window, data, 2, 2);
+ gdk_gc_set_stipple(gc->gc, gc->pixmap);
+}
+
static struct graphics_gc_methods gc_methods = {
gc_destroy,
gc_set_linewidth,
gc_set_dashes,
gc_set_foreground,
- gc_set_background
+ gc_set_background,
+ gc_set_stipple,
};
static struct graphics_gc_priv *gc_new(struct graphics_priv *gr, struct graphics_gc_methods *meth)
}
+
static struct graphics_image_priv *
image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *name, int *w, int *h, struct point *hot, int rotation)
{