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