Audacious  $Id:Doxyfile42802007-03-2104:39:00Znenolod$
preferences.h
Go to the documentation of this file.
1 /*
2  * preferences.h
3  * Copyright 2007-2011 Tomasz Moń, William Pitcock, and John Lindgren
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions, and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions, and the following disclaimer in the documentation
13  * provided with the distribution.
14  *
15  * This software is provided "as is" and without any warranty, express or
16  * implied. In no event shall the authors be liable for any damages arising from
17  * the use of this software.
18  */
19 
20 #ifndef AUDACIOUS_PREFERENCES_H
21 #define AUDACIOUS_PREFERENCES_H
22 
23 #include <audacious/types.h>
24 
25 typedef enum {
31  WIDGET_CUSTOM, /* 'custom' widget, you hand back the widget you want to add --nenolod */
39 } WidgetType;
40 
41 typedef enum {
47 } ValueType;
48 
49 typedef struct {
50  void * value;
51  const char * label;
53 
54 struct _NotebookTab;
55 
57  WidgetType type; /* widget type */
58  const char * label; /* widget title (for SPIN_BTN it's text left to widget) */
59  void * cfg; /* connected config value */
60  void (* callback) (void); /* this func will be called after value change, can be NULL */
61  const char * tooltip; /* widget tooltip, can be NULL */
63  ValueType cfg_type; /* connected value type */
64  const char * csect; /* config file section */
65  const char * cname; /* config file key name */
66 
67  union {
68  struct {
69  int value;
70  } radio_btn;
71 
72  struct {
73  double min, max, step;
74  const char * right_label; /* text right to widget */
75  } spin_btn;
76 
77  struct {
79  int rows;
80  } table;
81 
82  struct {
83  const char * stock_id;
84  bool_t single_line; /* FALSE to enable line wrap */
85  } label;
86 
87  struct {
88  const char * title;
89  } font_btn;
90 
91  struct {
93  } entry;
94 
95  struct {
98  } combo;
99 
100  struct {
101  const struct _PreferencesWidget * elem;
102  int n_elem;
103 
104  bool_t horizontal; /* FALSE gives vertical, TRUE gives horizontal aligment of child widgets */
105  bool_t frame; /* whether to draw frame around box */
106  } box;
107 
108  struct {
109  const struct _NotebookTab * tabs;
110  int n_tabs;
111  } notebook;
112 
113  struct {
114  bool_t horizontal; /* FALSE gives vertical, TRUE gives horizontal separator */
115  } separator;
116 
117  /* for WIDGET_CUSTOM --nenolod */
118  /* GtkWidget * (* populate) (void); */
119  void * (* populate) (void);
120  } data;
121 };
122 
123 typedef struct _NotebookTab {
124  const char * name;
125  const PreferencesWidget * widgets;
127 } NotebookTab;
128 
130  const PreferencesWidget * widgets;
132 
133  void (*init)(void);
134  void (*apply)(void);
135  void (*cleanup)(void);
136 };
137 
138 #endif /* AUDACIOUS_PREFERENCES_H */
const PreferencesWidget * widgets
Definition: preferences.h:130
struct _PreferencesWidget::@23::@31 box
struct _PreferencesWidget * elem
Definition: preferences.h:78
const char * stock_id
Definition: preferences.h:83
void(* cleanup)(void)
Definition: preferences.h:135
struct _PreferencesWidget::@23::@28 font_btn
const char * title
Definition: preferences.h:88
union _PreferencesWidget::@23 data
void(* apply)(void)
Definition: preferences.h:134
struct _PreferencesWidget::@23::@33 separator
struct _PreferencesWidget::@23::@26 table
void(* init)(void)
Definition: preferences.h:133
Index Index bool_t
Definition: playlist-api.h:122
struct _NotebookTab * tabs
Definition: preferences.h:109
const ComboBoxElements * elements
Definition: preferences.h:96
const char * cname
Definition: preferences.h:65
struct _PreferencesWidget::@23::@24 radio_btn
struct _PreferencesWidget::@23::@25 spin_btn
const PreferencesWidget * widgets
Definition: preferences.h:125
const char * name
Definition: preferences.h:124
const char * csect
Definition: preferences.h:64
struct _PreferencesWidget::@23::@30 combo
struct _PreferencesWidget::@23::@29 entry
ValueType cfg_type
Definition: preferences.h:63
const char * right_label
Definition: preferences.h:74
void(* callback)(void)
Definition: preferences.h:60
const char * tooltip
Definition: preferences.h:61
WidgetType type
Definition: preferences.h:57
ValueType
Definition: preferences.h:41
const char * label
Definition: preferences.h:51
WidgetType
Definition: preferences.h:25
const char * label
Definition: preferences.h:58
struct _PreferencesWidget::@23::@32 notebook