1 #ifndef GNOME_CANVAS_SHAPE_PRIVATE_H 2 #define GNOME_CANVAS_SHAPE_PRIVATE_H 3 4 /* Bpath item type for GnomeCanvas widget 5 * 6 * GnomeCanvas is basically a port of the Tk toolkit's most excellent canvas widget. Tk is 7 * copyrighted by the Regents of the University of California, Sun Microsystems, and other parties. 8 * 9 * Copyright (C) 1998,1999 The Free Software Foundation 10 * 11 * Authors: Federico Mena <federico@nuclecu.unam.mx> 12 * Raph Levien <raph@acm.org> 13 * Lauris Kaplinski <lauris@ariman.ee> 14 */ 15 16 #include <gdk/gdk.h> 17 #include <libart_lgpl/art_vpath.h> 18 #include <libart_lgpl/art_svp.h> 19 #include <libart_lgpl/art_vpath_dash.h> 20 #include <libart_lgpl/art_svp_wind.h> 21 #include <libgnomecanvas/gnome-canvas.h> 22 23 #include <libgnomecanvas/gnome-canvas-path-def.h> 24 25 G_BEGIN_DECLS 26 27 typedef struct _GnomeCanvasShapePrivGdk GnomeCanvasShapePrivGdk; 28 typedef struct _GCBPDrawCtx GCBPDrawCtx; 29 30 /* Per canvas private structure, holding necessary data for rendering 31 * temporary masks, which are needed for drawing multipart bpaths. 32 * As canvas cannot multithread, we can be sure, that masks are used 33 * serially, also one set of masks per canvas is sufficent to guarantee, 34 * that masks are created on needed X server. Masks grow as needed. 35 * Full structure is refcounted in Bpath implementation 36 */ 37 38 struct _GCBPDrawCtx { 39 gint refcount; 40 41 GnomeCanvas * canvas; 42 43 gint width; 44 gint height; 45 46 GdkBitmap * mask; 47 GdkBitmap * clip; 48 49 GdkGC * clear_gc; 50 GdkGC * xor_gc; 51 }; 52 53 /* Per Bpath private structure, holding Gdk specific data */ 54 55 struct _GnomeCanvasShapePrivGdk { 56 gulong fill_pixel; /* Color for fill */ 57 gulong outline_pixel; /* Color for outline */ 58 59 GdkBitmap *fill_stipple; /* Stipple for fill */ 60 GdkBitmap *outline_stipple; /* Stipple for outline */ 61 62 GdkGC * fill_gc; /* GC for filling */ 63 GdkGC * outline_gc; /* GC for outline */ 64 65 gint len_points; /* Size of allocated points array */ 66 gint num_points; /* Gdk points in canvas coords */ 67 GdkPoint * points; /* Ivariant: closed paths are before open ones */ 68 GSList * closed_paths; /* List of lengths */ 69 GSList * open_paths; /* List of lengths */ 70 71 GCBPDrawCtx * ctx; /* Pointer to per-canvas drawing context */ 72 }; 73 74 struct _GnomeCanvasShapePriv { 75 GnomeCanvasPathDef * path; /* Our bezier path representation */ 76 77 gdouble scale; /* CTM scaling (for pen) */ 78 79 guint fill_set : 1; /* Is fill color set? */ 80 guint outline_set : 1; /* Is outline color set? */ 81 guint width_pixels : 1; /* Is outline width specified in pixels or units? */ 82 83 double width; /* Width of outline, in user coords */ 84 85 guint32 fill_rgba; /* Fill color, RGBA */ 86 guint32 outline_rgba; /* Outline color, RGBA */ 87 88 GdkCapStyle cap; /* Cap style for line */ 89 GdkJoinStyle join; /* Join style for line */ 90 ArtWindRule wind; /* Winding rule */ 91 double miterlimit; /* Miter limit */ 92 93 ArtVpathDash dash; /* Dashing pattern */ 94 95 ArtSVP * fill_svp; /* The SVP for the filled shape */ 96 ArtSVP * outline_svp; /* The SVP for the outline shape */ 97 98 GnomeCanvasShapePrivGdk * gdk; /* Gdk specific things */ 99 }; 100 101 G_END_DECLS 102 103 #endif 104