Audacious
$Id:Doxyfile42802007-03-2104:39:00Znenolod$
Main Page
Related Pages
Classes
Files
File List
File Members
src
audacious
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
{
26
WIDGET_NONE
,
27
WIDGET_CHK_BTN
,
28
WIDGET_LABEL
,
29
WIDGET_RADIO_BTN
,
30
WIDGET_SPIN_BTN
,
31
WIDGET_CUSTOM
,
/* 'custom' widget, you hand back the widget you want to add --nenolod */
32
WIDGET_FONT_BTN
,
33
WIDGET_TABLE
,
34
WIDGET_ENTRY
,
35
WIDGET_COMBO_BOX
,
36
WIDGET_BOX
,
37
WIDGET_NOTEBOOK
,
38
WIDGET_SEPARATOR
,
39
}
WidgetType
;
40
41
typedef
enum
{
42
VALUE_INT
,
43
VALUE_FLOAT
,
44
VALUE_BOOLEAN
,
45
VALUE_STRING
,
46
VALUE_NULL
,
47
}
ValueType
;
48
49
typedef
struct
{
50
void
*
value
;
51
const
char
*
label
;
52
}
ComboBoxElements
;
53
54
struct
_NotebookTab;
55
56
struct
_PreferencesWidget
{
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 */
62
bool_t
child
;
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
{
78
struct
_PreferencesWidget
*
elem
;
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
{
92
bool_t
password
;
93
}
entry
;
94
95
struct
{
96
const
ComboBoxElements
*
elements
;
97
int
n_elements
;
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
;
126
int
n_widgets
;
127
}
NotebookTab
;
128
129
struct
_PluginPreferences
{
130
const
PreferencesWidget *
widgets
;
131
int
n_widgets
;
132
133
void (*
init
)(void);
134
void (*
apply
)(void);
135
void (*
cleanup
)(void);
136
};
137
138
#endif
/* AUDACIOUS_PREFERENCES_H */
Generated by
1.8.1.1