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 typedef enum {
00024 WIDGET_NONE,
00025 WIDGET_CHK_BTN,
00026 WIDGET_LABEL,
00027 WIDGET_RADIO_BTN,
00028 WIDGET_SPIN_BTN,
00029 WIDGET_CUSTOM,
00030 WIDGET_FONT_BTN,
00031 WIDGET_TABLE,
00032 WIDGET_ENTRY,
00033 WIDGET_COMBO_BOX,
00034 WIDGET_BOX,
00035 WIDGET_NOTEBOOK,
00036 WIDGET_SEPARATOR,
00037 } WidgetType;
00038
00039 typedef enum {
00040 VALUE_INT,
00041 VALUE_FLOAT,
00042 VALUE_BOOLEAN,
00043 VALUE_STRING,
00044 VALUE_NULL,
00045 } ValueType;
00046
00047 typedef struct {
00048 gpointer value;
00049 const char *label;
00050 } ComboBoxElements;
00051
00052 struct _NotebookTab;
00053
00054 struct _PreferencesWidget {
00055 WidgetType type;
00056 char *label;
00057 gpointer cfg;
00058 void (*callback) (void);
00059 char *tooltip;
00060 bool_t child;
00061 ValueType cfg_type;
00062 const char * csect;
00063 const char * cname;
00064
00065 union {
00066 struct {
00067 double min, max, step;
00068 char *right_label;
00069 } spin_btn;
00070
00071 struct {
00072 struct _PreferencesWidget *elem;
00073 int rows;
00074 } table;
00075
00076 struct {
00077 char *stock_id;
00078 bool_t single_line;
00079 } label;
00080
00081 struct {
00082 char *title;
00083 } font_btn;
00084
00085 struct {
00086 bool_t password;
00087 } entry;
00088
00089 struct {
00090 ComboBoxElements *elements;
00091 int n_elements;
00092 bool_t enabled;
00093 } combo;
00094
00095 struct {
00096 struct _PreferencesWidget *elem;
00097 int n_elem;
00098
00099 bool_t horizontal;
00100 bool_t frame;
00101 } box;
00102
00103 struct {
00104 struct _NotebookTab *tabs;
00105 int n_tabs;
00106 } notebook;
00107
00108 struct {
00109 bool_t horizontal;
00110 } separator;
00111
00112
00113
00114 void * (* populate) (void);
00115 } data;
00116 };
00117
00118 typedef struct _NotebookTab {
00119 char *name;
00120 PreferencesWidget *settings;
00121 int n_settings;
00122 } NotebookTab;
00123
00124 typedef enum {
00125 PREFERENCES_WINDOW,
00126 } PreferencesType;
00127
00128 struct _PluginPreferences {
00129 const char * domain;
00130 const char * title;
00131 const char * imgurl;
00132
00133 PreferencesWidget *prefs;
00134 int 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