00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AUDACIOUS_PREFERENCES_H
00021 #define AUDACIOUS_PREFERENCES_H
00022
00023 #include <glib.h>
00024 #include <audacious/types.h>
00025
00026 typedef enum {
00027 WIDGET_NONE,
00028 WIDGET_CHK_BTN,
00029 WIDGET_LABEL,
00030 WIDGET_RADIO_BTN,
00031 WIDGET_SPIN_BTN,
00032 WIDGET_CUSTOM,
00033 WIDGET_FONT_BTN,
00034 WIDGET_TABLE,
00035 WIDGET_ENTRY,
00036 WIDGET_COMBO_BOX,
00037 WIDGET_BOX,
00038 WIDGET_NOTEBOOK,
00039 WIDGET_SEPARATOR,
00040 } WidgetType;
00041
00042 typedef enum {
00043 VALUE_INT,
00044 VALUE_FLOAT,
00045 VALUE_BOOLEAN,
00046 VALUE_STRING,
00047 VALUE_CFG_BOOLEAN,
00048 VALUE_CFG_STRING,
00049 VALUE_NULL,
00050 } ValueType;
00051
00052 typedef struct {
00053 gpointer value;
00054 const gchar *label;
00055 } ComboBoxElements;
00056
00057 struct _NotebookTab;
00058
00059 struct _PreferencesWidget {
00060 WidgetType type;
00061 char *label;
00062 gpointer cfg;
00063 void (*callback) (void);
00064 char *tooltip;
00065 gboolean child;
00066 union {
00067 struct {
00068 gdouble min, max, step;
00069 char *right_label;
00070 } spin_btn;
00071
00072 struct {
00073 struct _PreferencesWidget *elem;
00074 gint rows;
00075 } table;
00076
00077 struct {
00078 char *stock_id;
00079 gboolean single_line;
00080 } label;
00081
00082 struct {
00083 char *title;
00084 } font_btn;
00085
00086 struct {
00087 gboolean password;
00088 } entry;
00089
00090 struct {
00091 ComboBoxElements *elements;
00092 gint n_elements;
00093 gboolean enabled;
00094 } combo;
00095
00096 struct {
00097 struct _PreferencesWidget *elem;
00098 gint n_elem;
00099
00100 gboolean horizontal;
00101 gboolean frame;
00102 } box;
00103
00104 struct {
00105 struct _NotebookTab *tabs;
00106 gint n_tabs;
00107 } notebook;
00108
00109 struct {
00110 gboolean horizontal;
00111 } separator;
00112
00113
00114
00115 void * (* populate) (void);
00116 } data;
00117 ValueType cfg_type;
00118 };
00119
00120 typedef struct _NotebookTab {
00121 gchar *name;
00122 PreferencesWidget *settings;
00123 gint n_settings;
00124 } NotebookTab;
00125
00126 typedef enum {
00127 PREFERENCES_WINDOW,
00128 PREFERENCES_PAGE,
00129 } PreferencesType;
00130
00131 struct _PluginPreferences {
00132 gchar *title;
00133 gchar *imgurl;
00134
00135 PreferencesWidget *prefs;
00136 gint n_prefs;
00137
00138 PreferencesType type;
00139
00140 void (*init)(void);
00141 void (*apply)(void);
00142 void (*cancel)(void);
00143 void (*cleanup)(void);
00144
00145 gpointer data;
00146 };
00147
00148 #endif