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_NULL,
00048 } ValueType;
00049
00050 typedef struct {
00051 gpointer value;
00052 const gchar *label;
00053 } ComboBoxElements;
00054
00055 struct _NotebookTab;
00056
00057 struct _PreferencesWidget {
00058 WidgetType type;
00059 char *label;
00060 gpointer cfg;
00061 void (*callback) (void);
00062 char *tooltip;
00063 gboolean child;
00064 union {
00065 struct {
00066 gdouble min, max, step;
00067 char *right_label;
00068 } spin_btn;
00069
00070 struct {
00071 struct _PreferencesWidget *elem;
00072 gint rows;
00073 } table;
00074
00075 struct {
00076 char *stock_id;
00077 gboolean single_line;
00078 } label;
00079
00080 struct {
00081 char *title;
00082 } font_btn;
00083
00084 struct {
00085 gboolean password;
00086 } entry;
00087
00088 struct {
00089 ComboBoxElements *elements;
00090 gint n_elements;
00091 gboolean enabled;
00092 } combo;
00093
00094 struct {
00095 struct _PreferencesWidget *elem;
00096 gint n_elem;
00097
00098 gboolean horizontal;
00099 gboolean frame;
00100 } box;
00101
00102 struct {
00103 struct _NotebookTab *tabs;
00104 gint n_tabs;
00105 } notebook;
00106
00107 struct {
00108 gboolean horizontal;
00109 } separator;
00110
00111
00112
00113 void * (* populate) (void);
00114 } data;
00115 ValueType cfg_type;
00116 };
00117
00118 typedef struct _NotebookTab {
00119 gchar *name;
00120 PreferencesWidget *settings;
00121 gint n_settings;
00122 } NotebookTab;
00123
00124 typedef enum {
00125 PREFERENCES_WINDOW,
00126 } PreferencesType;
00127
00128 struct _PluginPreferences {
00129 const gchar * domain;
00130 const gchar * title;
00131 const gchar * imgurl;
00132
00133 PreferencesWidget *prefs;
00134 gint n_prefs;
00135
00136 PreferencesType type;
00137
00138 void (*init)(void);
00139 void (*apply)(void);
00140 void (*cancel)(void);
00141 void (*cleanup)(void);
00142
00143 gpointer data;
00144 };
00145
00146 #endif