It appears Solaris's cc is ignoring the signedness of bitfield types.
[xiph/unicode.git] / sushivision / slider.h
blob4793bbd361dbed8782cbe2e8aa70562e2879f5d4
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.
22 #include <sys/types.h>
24 struct _sv_slider {
25 GtkWidget **slices;
26 int num_slices;
27 int realized;
28 int flip; // native is horizontal
30 u_int32_t *backdata;
31 cairo_surface_t *background;
32 cairo_surface_t *foreground;
33 int w;
34 int h;
35 int gradient;
36 int xpad;
37 int ypad;
39 char **label;
40 float *label_vals;
41 int labels;
42 int neg;
43 int flags;
45 // computation helpers
46 float lodel;
47 float idelrange;
49 float quant_num;
50 float quant_denom;
53 typedef struct {
54 int n;
55 int neg;
56 float al;
57 float lo;
58 float hi;
59 float *vals;
60 float *muls;
61 float *offs;
62 } slider_map_t;
64 #define _SV_SLIDER_FLAG_INDEPENDENT_MIDDLE 0x1
65 #define _SV_SLIDER_FLAG_VERTICAL 0x80
67 extern void _sv_slider_realize(_sv_slider_t *s);
68 extern void _sv_slider_draw(_sv_slider_t *s);
69 extern void _sv_slider_expose_slice(_sv_slider_t *s, int slicenum);
70 extern void _sv_slider_expose(_sv_slider_t *s);
71 extern void _sv_slider_size_request_slice(_sv_slider_t *s,GtkRequisition *requisition);
72 extern float _sv_slider_pixel_to_val(_sv_slider_t *slider,float x);
73 extern float _sv_slider_pixel_to_del(_sv_slider_t *slider,float x);
74 extern float _sv_slider_pixel_to_mapdel(_sv_slider_t *s,float x);
75 extern float _sv_slider_val_to_del(_sv_slider_t *slider,float v);
76 extern float _sv_slider_val_to_mapdel(_sv_slider_t *slider,float v);
77 extern void _sv_slider_vals_bound(_sv_slider_t *slider,int slicenum);
78 extern int _sv_slider_lightme(_sv_slider_t *slider,int slicenum,int x,int y);
79 extern void _sv_slider_unlight(_sv_slider_t *slider);
80 extern void _sv_slider_button_press(_sv_slider_t *slider,int slicenum,int x,int y);
81 extern void _sv_slider_button_release(_sv_slider_t *s,int slicenum,int x,int y);
82 extern void _sv_slider_motion(_sv_slider_t *s,int slicenum,int x,int y);
83 extern gboolean _sv_slider_key_press(_sv_slider_t *slider,GdkEventKey *event,int slicenum);
84 extern _sv_slider_t *_sv_slider_new(_sv_slice_t **slices, int num_slices,
85 char **labels, float *label_vals, int num_labels,
86 unsigned flags);
87 extern void _sv_slider_set_thumb_active(_sv_slider_t *s, int thumbnum, int activep);
88 extern void _sv_slider_set_gradient(_sv_slider_t *s, int m);
89 extern float _sv_slider_get_value(_sv_slider_t *s, int thumbnum);
90 extern void _sv_slider_set_value(_sv_slider_t *s, int thumbnum, float v);
91 extern float _sv_slider_del_to_val(_sv_slider_t *s, float del);
92 extern void _sv_slider_set_quant(_sv_slider_t *s, float n, float d);
94 extern void _sv_slider_print(_sv_slider_t *s, cairo_t *c, int w, int h);
95 extern float _sv_slider_print_height(_sv_slider_t *s);
96 extern void _sv_slidermap_init(slider_map_t *m, sv_slider_t *s);
97 extern void _sv_slidermap_partial_update(slider_map_t *m, sv_slider_t *s);
98 extern void _sv_slidermap_clear(slider_map_t *m);
99 extern float _sv_slidermap_to_mapdel(slider_map_t *s,float v);