dd checks/rejection for absurdly huge codebooks.
[xiph/unicode.git] / postfish / multibar.h
blob804d54e17d78cc001c9a8409d10cfbb9801a012f
1 /*
3 * postfish
4 *
5 * Copyright (C) 2002-2005 Monty
7 * Postfish is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
12 * Postfish is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Postfish; see the file COPYING. If not, write to the
19 * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef __MULTIBAR_H__
25 #define __MULTIBAR_H__
27 #include <sys/time.h>
28 #include <time.h>
29 #include <glib.h>
30 #include <glib-object.h>
31 #include <gtk/gtkcontainer.h>
32 #include <gtk/gtksignal.h>
33 #include <gtk/gtkdrawingarea.h>
35 G_BEGIN_DECLS
37 #define MULTIBAR_TYPE (multibar_get_type ())
38 #define MULTIBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MULTIBAR_TYPE, Multibar))
39 #define MULTIBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MULTIBAR_TYPE, MultibarClass))
40 #define IS_MULTIBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MULTIBAR_TYPE))
41 #define IS_MULTIBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MULTIBAR_TYPE))
43 typedef struct _Multibar Multibar;
44 typedef struct _MultibarClass MultibarClass;
46 typedef struct bartack {
47 float pixelposhi;
48 float pixelposlo;
49 float pixeldeltahi;
50 float pixeldeltalo;
51 } bartrack;
53 #define HI_ATTACK (1<<0)
54 #define LO_ATTACK (1<<1)
55 #define HI_DECAY (1<<2)
56 #define LO_DECAY (1<<3)
57 #define ZERO_DAMP (1<<4)
58 #define PEAK_FOLLOW (1<<5)
61 struct _Multibar{
63 GtkDrawingArea canvas;
64 GdkPixmap *backing;
66 int labels;
67 int readout;
68 PangoLayout **layout;
69 float *levels;
71 GdkGC *boxcolor;
72 float peak;
73 int peakdelay;
74 float peakdelta;
76 int clipdelay;
78 bartrack *bartrackers;
79 int bars;
80 int dampen_flags;
82 int thumbs;
83 float thumbval[3];
84 int thumbpixel[3];
86 GtkStateType thumbstate[3];
87 int thumbfocus;
88 int thumbgrab;
89 int widgetfocus;
91 int thumbx;
92 float thumblo;
93 float thumbhi;
94 float thumbsmall;
95 float thumblarge;
97 int thumblo_x;
98 int thumbhi_x;
100 int xpad;
102 void (*callback)(GtkWidget *,gpointer);
103 gpointer callbackp;
106 struct _MultibarClass{
108 GtkDrawingAreaClass parent_class;
109 void (* multibar) (Multibar *m);
112 GType multibar_get_type (void);
113 GtkWidget* multibar_new (int n, char **labels, float *levels,
114 int thumbs, int flags);
115 GtkWidget* multibar_slider_new (int n, char **labels, float *levels,
116 int thumbs);
118 void multibar_clear (Multibar *m);
119 void multibar_set (Multibar *m,float *lo,float *hi, int n,int drawp);
120 void multibar_thumb_set (Multibar *m,float v, int n);
121 void multibar_setwarn (Multibar *m,int drawp);
122 void multibar_reset (Multibar *m);
123 void multibar_callback (Multibar *m,
124 void (*callback)
125 (GtkWidget *,gpointer),
126 gpointer);
127 float multibar_get_value (Multibar *m,int n);
128 void multibar_thumb_bounds (Multibar *m,float lo, float hi);
129 void multibar_thumb_increment (Multibar *m,float small, float large);
130 int multibar_thumb_grab_p (Multibar *m);
131 int multibar_thumb_focus (Multibar *m);
133 G_END_DECLS
135 #endif