BEAST/BSE - Better Audio System and Sound Engine  0.8.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
bstdial.hh
Go to the documentation of this file.
00001  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
00002 #ifndef __BST_DIAL_H__
00003 #define __BST_DIAL_H__
00004 
00005 #include <gtk/gtkadjustment.h>
00006 #include <gtk/gtkwidget.h>
00007 
00008 
00009 #ifdef __cplusplus
00010 extern "C" {
00011 #endif /* __cplusplus */
00012 
00013 
00014 #define BST_TYPE_DIAL                   (bst_dial_get_type ())
00015 #define BST_DIAL(object)                (G_TYPE_CHECK_INSTANCE_CAST ((object), BST_TYPE_DIAL, BstDial))
00016 #define BST_DIAL_CLASS(klass)           (G_TYPE_CHECK_CLASS_CAST ((klass), BST_TYPE_DIAL, BstDialClass))
00017 #define BST_IS_DIAL(object)             (G_TYPE_CHECK_INSTANCE_TYPE ((object), BST_TYPE_DIAL))
00018 #define BST_IS_DIAL_CLASS(klass)        (G_TYPE_CHECK_CLASS_TYPE ((klass), BST_TYPE_DIAL))
00019 #define BST_DIAL_GET_CLASS(object)      (G_TYPE_INSTANCE_GET_CLASS ((obj), BST_TYPE_DIAL, BstDialClass))
00020 
00021 
00022 typedef struct _BstDial      BstDial;
00023 typedef struct _BstDialClass BstDialClass;
00024 struct _BstDial
00025 {
00026   GtkWidget parent_object;
00027 
00028   /* The update policy: GTK_UPDATE_CONTINUOUS,
00029    * GTK_UPDATE_DISCONTINUOUS or GTK_UPDATE_DELAYED
00030    */
00031   GtkUpdateType update_policy;
00032 
00033   GtkWidget *align_widget;
00034   guint      align_width : 1;
00035 
00036   /* The button currently pressed or 0 if none */
00037   guint8 button;
00038 
00039   /* Dimensions of dial components */
00040   gint radius;
00041   gint pointer_width;
00042 
00043   /* ID of update timer for delayed updates, or 0 if none */
00044   guint timer;
00045 
00046   /* Current angle of the pointer */
00047   gdouble angle;
00048 
00049   /* Old values from GtkAdjustment, stored so we know when something changed */
00050   gdouble old_value;
00051   gdouble old_lower;
00052   gdouble old_upper;
00053   gdouble old_page_size;
00054 
00055   /* The adjustment object that stores the data for this dial */
00056   GtkObject *adjustment;
00057 };
00058 struct _BstDialClass
00059 {
00060   GtkWidgetClass parent_class;
00061 };
00062 
00063 
00064 GtkType        bst_dial_get_type               (void);
00065 GtkWidget*     bst_dial_new                    (GtkAdjustment *adjustment);
00066 void           bst_dial_set_adjustment         (BstDial       *dial,
00067                                                 GtkAdjustment *adjustment);
00068 GtkAdjustment* bst_dial_get_adjustment         (BstDial       *dial);
00069 void           bst_dial_set_update_policy      (BstDial       *dial,
00070                                                 GtkUpdateType  policy);
00071 void           bst_dial_set_align_widget       (BstDial       *dial,
00072                                                 GtkWidget     *widget,
00073                                                 gboolean       width_align,
00074                                                 gboolean       height_align);
00075 
00076 #ifdef __cplusplus
00077 }
00078 #endif /* __cplusplus */
00079 
00080 #endif /* __BST_DIAL_H__ */
00081 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines