Audacious  $Id:Doxyfile42802007-03-2104:39:00Znenolod$
preferences.h
Go to the documentation of this file.
1 /* Audacious - Cross-platform multimedia player
2  * Copyright (C) 2008 Audacious development team.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; under version 3 of the License.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses>.
15  *
16  * The Audacious team does not consider modular code linking to
17  * Audacious or using our public API to be a derived work.
18  */
19 
20 #ifndef AUDACIOUS_PREFERENCES_H
21 #define AUDACIOUS_PREFERENCES_H
22 
23 typedef enum {
29  WIDGET_CUSTOM, /* 'custom' widget, you hand back the widget you want to add --nenolod */
37 } WidgetType;
38 
39 typedef enum {
45 } ValueType;
46 
47 typedef struct {
48  gpointer value;
49  const char *label;
51 
52 struct _NotebookTab;
53 
55  WidgetType type; /* widget type */
56  char *label; /* widget title (for SPIN_BTN it's text left to widget) */
57  gpointer cfg; /* connected config value */
58  void (*callback) (void); /* this func will be called after value change, can be NULL */
59  char *tooltip; /* widget tooltip, can be NULL */
61  ValueType cfg_type; /* connected value type */
62  const char * csect; /* config file section */
63  const char * cname; /* config file key name */
64 
65  union {
66  struct {
67  double min, max, step;
68  char *right_label; /* text right to widget */
69  } spin_btn;
70 
71  struct {
73  int rows;
74  } table;
75 
76  struct {
77  char *stock_id;
78  bool_t single_line; /* FALSE to enable line wrap */
79  } label;
80 
81  struct {
82  char *title;
83  } font_btn;
84 
85  struct {
87  } entry;
88 
89  struct {
93  } combo;
94 
95  struct {
96  struct _PreferencesWidget *elem;
97  int n_elem;
98 
99  bool_t horizontal; /* FALSE gives vertical, TRUE gives horizontal aligment of child widgets */
100  bool_t frame; /* whether to draw frame around box */
101  } box;
102 
103  struct {
104  struct _NotebookTab *tabs;
105  int n_tabs;
106  } notebook;
107 
108  struct {
109  bool_t horizontal; /* FALSE gives vertical, TRUE gives horizontal separator */
110  } separator;
111 
112  /* for WIDGET_CUSTOM --nenolod */
113  /* GtkWidget * (* populate) (void); */
114  void * (* populate) (void);
115  } data;
116 };
117 
118 typedef struct _NotebookTab {
119  char *name;
120  PreferencesWidget *settings;
122 } NotebookTab;
123 
124 typedef enum {
125  PREFERENCES_WINDOW, /* displayed in seperate window */
127 
129  const char * domain;
130  const char * title;
131  const char * imgurl;
132 
133  PreferencesWidget *prefs;
134  int n_prefs;
135 
137 
138  void (*init)(void);
139  void (*apply)(void);
140  void (*cancel)(void);
141  void (*cleanup)(void);
142 
143  gpointer data; /* for internal interface use only */
144 };
145 
146 #endif /* AUDACIOUS_PREFERENCES_H */