BEAST - Free Software Audio Synthesizer and Tracker  0.10.0
bstdial.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __BST_DIAL_H__
3 #define __BST_DIAL_H__
4 
5 #include "bstutils.hh"
6 
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif /* __cplusplus */
11 
12 
13 #define BST_TYPE_DIAL (bst_dial_get_type ())
14 #define BST_DIAL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BST_TYPE_DIAL, BstDial))
15 #define BST_DIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BST_TYPE_DIAL, BstDialClass))
16 #define BST_IS_DIAL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BST_TYPE_DIAL))
17 #define BST_IS_DIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BST_TYPE_DIAL))
18 #define BST_DIAL_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((obj), BST_TYPE_DIAL, BstDialClass))
19 
20 
21 typedef struct _BstDial BstDial;
22 typedef struct _BstDialClass BstDialClass;
23 struct _BstDial
24 {
25  GtkWidget parent_object;
26 
27  /* The update policy: GTK_UPDATE_CONTINUOUS,
28  * GTK_UPDATE_DISCONTINUOUS or GTK_UPDATE_DELAYED
29  */
30  GtkUpdateType update_policy;
31 
32  GtkWidget *align_widget;
33  guint align_width : 1;
34 
35  /* The button currently pressed or 0 if none */
36  guint8 button;
37 
38  /* Dimensions of dial components */
39  gint radius;
40  gint pointer_width;
41 
42  /* ID of update timer for delayed updates, or 0 if none */
43  guint timer;
44 
45  /* Current angle of the pointer */
46  gdouble angle;
47 
48  /* Old values from GtkAdjustment, stored so we know when something changed */
49  gdouble old_value;
50  gdouble old_lower;
51  gdouble old_upper;
52  gdouble old_page_size;
53 
54  /* The adjustment object that stores the data for this dial */
55  GtkObject *adjustment;
56 };
58 {
59  GtkWidgetClass parent_class;
60 };
61 
62 
63 GtkType bst_dial_get_type (void);
64 GtkWidget* bst_dial_new (GtkAdjustment *adjustment);
65 void bst_dial_set_adjustment (BstDial *dial,
66  GtkAdjustment *adjustment);
67 GtkAdjustment* bst_dial_get_adjustment (BstDial *dial);
68 void bst_dial_set_update_policy (BstDial *dial,
69  GtkUpdateType policy);
70 void bst_dial_set_align_widget (BstDial *dial,
71  GtkWidget *widget,
72  gboolean width_align,
73  gboolean height_align);
74 
75 #ifdef __cplusplus
76 }
77 #endif /* __cplusplus */
78 
79 #endif /* __BST_DIAL_H__ */
80 
Definition: bstdial.hh:23
Definition: bstdial.hh:57