synfig-core
1.0.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
synfig
paramdesc.h
Go to the documentation of this file.
1
/* === S Y N F I G ========================================================= */
21
/* ========================================================================= */
22
23
/* === S T A R T =========================================================== */
24
25
#ifndef __SYNFIG_PARAMDESC_H
26
#define __SYNFIG_PARAMDESC_H
27
28
/* === H E A D E R S ======================================================= */
29
30
#include "
string.h
"
31
#include "
real.h
"
32
#include "
color.h
"
33
#include "
interpolation.h
"
34
#include <list>
35
36
/* === M A C R O S ========================================================= */
37
38
/* === T Y P E D E F S ===================================================== */
39
40
/* === C L A S S E S & S T R U C T S ======================================= */
41
42
namespace
synfig {
43
44
class
ValueBase;
45
50
class
ParamDesc
51
{
52
public
:
53
55
struct
EnumData
56
{
57
int
value
;
58
String
name
;
59
String
local_name
;
60
EnumData
(
int
value
,
const
String
&
name
,
const
String
&
local_name
):
61
value(value),
62
name(name),
63
local_name(local_name)
64
{
65
}
66
};
67
68
/*
69
-- ** -- D A T A -------------------------------------------------------------
70
*/
71
72
private
:
73
String
name_;
74
String
local_name_;
75
String
desc_;
76
String
group_;
77
String
hint_;
78
String
origin_;
79
String
connect_;
80
String
box_;
81
Real
scalar_;
82
bool
exponential_;
83
bool
critical_;
84
bool
hidden_;
85
bool
invisible_duck_;
86
bool
is_distance_;
87
bool
animation_only_;
88
bool
static_;
89
Interpolation
interpolation_;
90
91
std::list<EnumData> enum_list_;
92
93
/*
94
-- ** -- C O N S T R U C T O R S ---------------------------------------------
95
*/
96
97
public
:
98
99
ParamDesc
(
const
String
&a=
"IM_A_BUG_SO_REPORT_ME"
):
100
name_ (a),
101
local_name_ (a),
102
scalar_ (1.0),
103
exponential_ (false),
104
critical_ (true),
105
hidden_ (false),
106
invisible_duck_ (false),
107
is_distance_ (false),
108
animation_only_ (false),
109
static_ (false),
110
interpolation_ (
INTERPOLATION_UNDEFINED
)
111
{ }
112
113
ParamDesc
(
const
ValueBase
&,
const
String
&a);
114
115
/*
116
-- ** -- M E M B E R F U N C T I O N S -------------------------------------
117
*/
118
119
public
:
120
122
const
std::list<EnumData> &
get_enum_list
()
const
{
return
enum_list_; }
123
125
ParamDesc
&
set_local_name
(
const
String
&n) { local_name_=n;
return
*
this
; }
126
128
ParamDesc
&
set_description
(
const
String
&d) { desc_=d;
return
*
this
; }
129
131
ParamDesc
&
set_group
(
const
String
&n) { group_=n;
return
*
this
; }
132
134
ParamDesc
&
set_hint
(
const
String
&h) { hint_=h;
return
*
this
; }
135
137
ParamDesc
&
set_connect
(
const
String
&h) { connect_=h;
return
*
this
; }
138
140
ParamDesc
&
set_box
(
const
String
&h) { box_=h;
return
*
this
; }
141
143
ParamDesc
&
set_invisible_duck
(
bool
x=
true
) { invisible_duck_=x;
return
*
this
; }
144
146
bool
get_invisible_duck
() {
return
invisible_duck_; }
147
148
150
ParamDesc
&
set_animation_only
(
bool
x=
true
) { animation_only_=x;
return
*
this
; }
151
153
bool
get_animation_only
() {
return
animation_only_; }
154
155
157
ParamDesc
&
set_origin
(
const
String
&h) { origin_=h;
return
*
this
; }
158
160
162
ParamDesc
&
set_scalar
(
const
Real
&n) { scalar_=n;
return
*
this
; }
163
165
166
ParamDesc
&
set_exponential
(
bool
x=
true
) { exponential_=x;
return
*
this
; }
167
169
ParamDesc
&
not_critical
() { critical_=
false
;
return
*
this
; }
170
172
ParamDesc
&
hidden
() { hidden_=
true
;
return
*
this
; }
173
175
176
ParamDesc
&
read_only
() {
return
*
this
; }
177
179
180
ParamDesc
&
write_only
() {
return
*
this
; }
181
183
184
ParamDesc
&
add_enum_value
(
int
val,
const
String
&enum_name,
const
String
&enum_local_name)
185
{ enum_list_.push_back(
EnumData
(val,enum_name,enum_local_name));
return
*
this
; }
186
188
const
String
&
get_local_name
()
const
{
return
local_name_; }
189
191
const
String
&
get_name
()
const
{
return
name_; }
192
194
const
String
&
get_description
()
const
{
return
desc_; }
195
197
const
String
&
get_group
()
const
{
return
group_; }
198
200
const
String
&
get_hint
()
const
{
return
hint_; }
201
203
const
String
&
get_origin
()
const
{
return
origin_; }
204
206
const
String
&
get_connect
()
const
{
return
connect_; }
207
209
const
String
&
get_box
()
const
{
return
box_; }
210
212
const
Real
&
get_scalar
()
const
{
return
scalar_; }
213
215
216
bool
get_exponential
()
const
{
return
exponential_; }
217
219
bool
get_critical
()
const
{
return
critical_; }
220
222
bool
get_hidden
()
const
{
return
hidden_; }
223
224
bool
get_static
()
const
{
return
static_; }
225
ParamDesc
&
set_static
(
bool
s) { static_=s;
return
*
this
; }
226
227
Interpolation
get_interpolation
()
const
{
return
interpolation_; }
228
ParamDesc
&
set_interpolation
(
Interpolation
i) { interpolation_=i;
return
*
this
; }
229
230
ParamDesc
&
set_is_distance
(
bool
x=
true
) { is_distance_=x;
return
*
this
;}
231
bool
get_is_distance
()
const
{
return
is_distance_; }
232
};
// END of class ParamDesc
233
234
class
ParamVocab
:
public
std::list< ParamDesc >
235
{
236
};
237
238
};
// END of namespace synfig
239
240
/* === E N D =============================================================== */
241
242
#endif
Generated on Mon Nov 16 2015 15:33:48 for synfig-core by
1.8.1.2