It appears Solaris's cc is ignoring the signedness of bitfield types.
[xiph/unicode.git] / sushivision / dimension.h
blobd59533299a60c404b85d8b114c88a3dd3c1049a4
1 /*
3 * sushivision copyright (C) 2006-2007 Monty <monty@xiph.org>
5 * sushivision is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * sushivision is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with sushivision; see the file COPYING. If not, write to the
17 * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23 #define SV_DIM_NO_X 0x100
24 #define SV_DIM_NO_Y 0x200
26 enum sv_dim_type { SV_DIM_CONTINUOUS,
27 SV_DIM_DISCRETE,
28 SV_DIM_PICKLIST};
30 typedef struct {
31 sv_dim_list_t *dl;
32 GtkWidget *t;
34 /* one or the other */
35 _sv_slider_t *scale;
36 GtkWidget *menu;
37 GtkWidget *entry[3];
39 /* calls with the callback data and a state flag:
40 0: begin set
41 1: continue set
42 2: end set
43 3: programmatic modification
45 void (*center_callback)(sv_dim_list_t *);
46 void (*bracket_callback)(sv_dim_list_t *);
47 } _sv_dim_widget_t;
49 typedef struct sv_dim_data{
51 char *legend;
52 enum sv_dim_type type;
54 double floor;
55 double lo;
56 double val;
57 fouble hi;
58 double ceil;
60 long numerator;
61 long denominator;
63 unsigned flags;
65 } sv_dim_data_t;
67 typedef struct sv_dim_lookup{
69 sv_scale_t *scale;
71 int (*callback)(sv_dim_t *);
73 int widgets;
74 _sv_dim_widget_t **widget_list;
76 int (*value_callback)(sv_dim_t *d, void *data);
77 void *value_callback_data;
79 } sv_dim_lookup_t;
81 struct sv_dim{
82 int number;
83 char *name;
85 sv_dim_data_t data;
86 sv_dim_look_t look;
90 extern int _sv_dim_scales(sv_dim_t *d,
91 double lo,
92 double hi,
93 int panel_w, int data_w,
94 int spacing,
95 char *legend,
96 _sv_scalespace_t *panel,
97 _sv_scalespace_t *data,
98 _sv_scalespace_t *iter);
99 extern int _sv_dim_scales_from_panel(sv_dim_t *d,
100 _sv_scalespace_t panel,
101 int data_w,
102 _sv_scalespace_t *data,
103 _sv_scalespace_t *iter);
105 extern int _sv_dim_set_thumb(sv_dim_t *d, int thumb, double val);
106 extern int _sv_dim_widget_set_thumb(_sv_dim_widget_t *d, int thumb, double val);
107 extern void _sv_dim_widget_set_thumb_active(_sv_dim_widget_t *dw, int thumb, int active);
108 extern _sv_dim_widget_t *_sv_dim_widget_new(sv_dim_list_t *dl,
109 void (*center_callback)(sv_dim_list_t *),
110 void (*bracket_callback)(sv_dim_list_t *));
111 extern int _sv_dim_save(sv_dim_t *d, xmlNodePtr instance);
112 extern int _sv_dim_load(sv_dim_t *d, _sv_undo_t *u, xmlNodePtr dn, int warn);