1 /* This file is part of the GNU libxmi package. Copyright (C) 1998, 1999, 2 2000, 2005, Free Software Foundation, Inc. 3 4 The GNU libxmi package is free software. You may redistribute it 5 and/or modify it under the terms of the GNU General Public License as 6 published by the Free Software foundation; either version 2, or (at your 7 option) any later version. 8 9 The GNU libxmi package is distributed in the hope that it will be 10 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along 15 with the GNU plotutils package; see the file COPYING. If not, write to 16 the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, 17 Boston, MA 02110-1301, USA. */ 18 19 /* A miGC structure contains high-level drawing parameters. Such 20 structures are created, modified, and destroyed by functions in mi_gc.c. 21 miGC is typedef'd as lib_miGC in xmi.h. lib_miGC is defined here, 22 privately, so that an miGC will be opaque. 23 24 The chief difference between libxmi and X11 is that libxmi supports 25 painting with interpolated colors (e.g., `gradient fill'). Several 26 types of interpolation are supported. 27 28 Other significant differences from X11 are (1) the dash array is an 29 array of unsigned int's rather than char's, so that much longer dashes 30 may be drawn, and (2) the miter limit is a GC attribute like any other 31 (in X11, it is fixed at 10.43, and may not be altered). */ 32 33 /* Values for an miGC's miGCPaintStyle attribute (default=MI_PAINT_SOLID). */ 34 enum { MI_PAINT_SOLID, MI_PAINT_INTERPOLATED_PARALLEL, MI_PAINT_INTERPOLATED_TRIANGULAR, MI_PAINT_INTERPOLATED_ELLIPTICAL, MI_PAINT_CUSTOM }; 35 36 struct lib_miGC 37 { 38 /* paint style (either solid or an interpolated [`gradient'] style) */ 39 int paintStyle; /* default = miPaintSolid */ 40 41 /* array of pixel types, used if paintStyle = miPaintSolid */ 42 miPixel *pixels; /* array of pixel types */ 43 int numPixels; /* number of pixel types (must be >=2) */ 44 45 /* arrays of pixel types, used if paintStyle is an interpolated style */ 46 miPixel triangularInterpPixels[3]; 47 miPixel parallelInterpPixels[2]; 48 miPixel ellipticalInterpPixels[3]; 49 50 /* parameters for libxmi's core drawing functions (dash-related) */ 51 unsigned int *dash; /* dash array (lengths of dashes in pixels) */ 52 int numInDashList; /* length of dash array */ 53 int dashOffset; /* pixel offset of first dash (nonnegative) */ 54 55 /* parameters for libxmi's core drawing functions (not dash-related) */ 56 int lineStyle; /* default = miLineSolid */ 57 unsigned int lineWidth; /* line thickness in pixels (default = 0) */ 58 int joinStyle; /* default = miJoinMiter */ 59 int capStyle; /* default = miCapButt */ 60 double miterLimit; /* default = 10.43, as in X11 */ 61 62 /* parameters for libxmi's core filling functions */ 63 int fillRule; /* default = miEvenOddRule */ 64 int arcMode; /* default = miArcPieSlice */ 65 }; 66