missing commit in generator.h
[galan.git] / include / gtkknob.h
blob8bdc1f9e225c90e5c14725995ea5200c7890aca8
1 /* gAlan - Graphical Audio Language
2 * Copyright (C) 1999 Tony Garnock-Jones
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __GTK_KNOB_H__
20 #define __GTK_KNOB_H__
22 #include <gdk/gdk.h>
23 #include <gtk/gtkadjustment.h>
24 #include <gtk/gtkwidget.h>
25 #include <gdk-pixbuf/gdk-pixbuf.h>
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
31 #define PIXMAPDIRIFY(filename) \
32 (SITE_PKGDATA_DIR G_DIR_SEPARATOR_S "pixmaps" G_DIR_SEPARATOR_S filename)
34 #define GTK_KNOB(obj) GTK_CHECK_CAST(obj, gtk_knob_get_type(), GtkKnob)
35 #define GTK_KNOB_CLASS(klass) GTK_CHECK_CLASS_CAST(klass, gtk_knob_get_type(), GtkKnobClass)
36 #define GTK_IS_KNOB(obj) GTK_CHECK_TYPE(obj, gtk_knob_get_type())
38 typedef struct _GtkKnob GtkKnob;
39 typedef struct _GtkKnobClass GtkKnobClass;
41 struct _GtkKnob {
42 GtkWidget widget;
44 /* update policy (GTK_UPDATE_[CONTINUOUS/DELAYED/DISCONTINUOUS]) */
45 guint policy : 2;
47 /* State of widget (to do with user interaction) */
48 guint8 state;
49 gint saved_x, saved_y;
51 /* ID of update timer, or 0 if none */
52 guint32 timer;
54 /* Pixmap for knob */
55 GdkPixbuf *pixbuf;
56 /* Animation for knob... from animated gif */
57 GList *anim_list;
59 /* Old values from adjustment stored so we know when something changes */
60 gfloat old_value;
61 gfloat old_lower;
62 gfloat old_upper;
64 /* The adjustment object that stores the data for this knob */
65 GtkAdjustment *adjustment;
68 struct _GtkKnobClass
70 GtkWidgetClass parent_class;
73 extern GtkWidget *gtk_knob_new(GtkAdjustment *adjustment);
74 extern guint gtk_knob_get_type(void);
76 extern GtkAdjustment *gtk_knob_get_adjustment(GtkKnob *knob);
77 extern void gtk_knob_set_update_policy(GtkKnob *knob, GtkUpdateType policy);
79 extern void gtk_knob_set_adjustment(GtkKnob *knob, GtkAdjustment *adjustment);
81 #ifdef __cplusplus
83 #endif
85 #endif