Safer handling of Booleans.
[AROS.git] / workbench / libs / muimaster / imspec_intern.h
blobe31dc6191bdc517247501586d061830e77b78883
1 /*
2 Copyright 2003, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 #ifndef MUI_IMSPEC_INTERN_H
9 #define MUI_IMSPEC_INTERN_H
11 /* This header contains the definition of the internal ImageSpec
12 * structure (ie. parsed, in memory).
13 * It's private, used only by imspec implementation, and shouldnt
14 * be included by other Zune components, which should refer to
15 * the public imspec API in imspec.h
18 #ifndef LIBRARIES_MUI_H
19 #include "mui.h"
20 #endif
22 #include "muimaster_intern.h"
23 #include "penspec.h"
25 typedef enum {
26 IST_PATTERN, /* "0:%ld" = a dithered mix of MUI pens */
27 IST_VECTOR, /* "1:%ld" = builtin code to draw vector image */
28 IST_COLOR, /* "2:" + PenSpec = a pen */
29 IST_BOOPSI, /* "3:%s" = boopsi image class */
30 IST_BRUSH, /* "3:%s", "4:%s" = small brushes */
31 IST_BITMAP, /* "5:%s" = a picture to tile in background */
32 IST_CONFIG, /* "6:%ld" = a configured image/background (indirection) */
33 IST_SCALED_GRADIENT, /* "7:([Hh]|[Vv]|angle),<IST_COLOR>-<IST_COLOR>" = a scaled gradient */
34 IST_TILED_GRADIENT, /* "8:([Hh]|[Vv]|angle),<IST_COLOR>-<IST_COLOR>" = a tiled gradient */
35 } ImageSpecType;
37 #define CHECKBOX_IMAGE 4
39 #if 0
40 enum MUI_ImageSpec_Flags {
41 IMF_SETUP = 1, /* struct is between _setup and _cleanup */
42 IMF_SHOW = 2, /* struct is between _show and _hide */
44 #endif
46 struct MUI_ImageSpec_intern;
48 typedef void (*VECTOR_DRAW_FUNC)(struct MUI_RenderInfo *mri, LONG left, LONG top, LONG width, LONG height, LONG state);
50 /* should really contain an union */
51 struct MUI_ImageSpec_intern /* _intern */
53 ImageSpecType type;
54 /* UWORD flags; */ /* see MUI_ImageSpec_Flags */
55 /* struct MUI_RenderInfo *mri; */
56 union {
57 /* IST_PATTERN */
58 LONG pattern;
59 /* IST_VECTOR */
60 struct {
61 LONG type;
62 VECTOR_DRAW_FUNC draw;
63 } vect;
64 /* IST_COLOR */
65 struct MUI_PenSpec_intern penspec;
66 /* IST_BOOPSI */
67 struct {
68 CONST_STRPTR filename;
69 Object *obj;
70 } boopsi;
71 /* IST_BRUSH */
72 struct {
73 CONST_STRPTR filename[2];
74 struct dt_node *dt[2];
75 } brush;
76 /* IST_BITMAP */
77 struct {
78 CONST_STRPTR filename;
79 struct dt_node *dt;
80 } bitmap;
81 /* IST_CONFIG */
82 struct {
83 LONG muiimg; /* index in prefs->imagespecs[] */
84 } cfg;
85 struct {
86 struct MUI_RenderInfo *mri;
87 UWORD angle; /* integer values in [0,360) */
88 Object *obj;
89 ULONG start_rgb[3];
90 ULONG end_rgb[3];
91 ULONG start_pen;
92 ULONG end_pen;
93 BOOL start_pen_is_allocated;
94 BOOL end_pen_is_allocated;
95 } gradient;
96 } u;
100 struct MUI_ImageSpec_intern *zune_imspec_create_vector(LONG vect);
101 BOOL zune_imspec_vector_get_minmax(struct MUI_ImageSpec_intern *spec, struct MUI_MinMax *minmax);
103 VOID zune_scaled_gradient_intern_to_string(struct MUI_ImageSpec_intern *spec,
104 STRPTR buf);
105 VOID zune_tiled_gradient_intern_to_string(struct MUI_ImageSpec_intern *spec,
106 STRPTR buf);
107 BOOL zune_gradient_string_to_intern(CONST_STRPTR str,
108 struct MUI_ImageSpec_intern *spec);
109 VOID zune_gradient_draw
111 struct MUI_ImageSpec_intern *spec,
112 struct MUI_RenderInfo *mri,
113 WORD x1, WORD y1, WORD x2, WORD y2,
114 WORD xoff, WORD yoff
117 VOID zune_gradient_drawfast
119 struct MUI_ImageSpec_intern *spec,
120 struct RastPort *rp,
121 struct MUI_RenderInfo *mri,
122 WORD mode, WORD abs_l, WORD abs_t, WORD abs_r, WORD abs_b,
123 WORD x1, WORD y1, WORD x2, WORD y2,
124 WORD xoff, WORD yoff
127 BOOL zune_gradientspec_setup(struct MUI_ImageSpec_intern *spec, struct MUI_RenderInfo *mri);
128 VOID zune_gradientspec_cleanup(struct MUI_ImageSpec_intern *spec);
130 #endif