mi_gc.h 3.0 KB

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