summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/attr-widget.h
diff options
context:
space:
mode:
authorFelipe Corr??a da Silva Sanches <juca@members.fsf.org>2008-02-19 20:57:06 +0000
committerjucablues <jucablues@users.sourceforge.net>2008-02-19 20:57:06 +0000
commit3a44b1daa97af92fa1be4f7199641ae003065532 (patch)
tree15518ba471a241da224fbe45189626630c0ec5e9 /src/ui/widget/attr-widget.h
parentr18035@shi: ted | 2008-02-19 12:54:20 -0800 (diff)
downloadinkscape-3a44b1daa97af92fa1be4f7199641ae003065532.tar.gz
inkscape-3a44b1daa97af92fa1be4f7199641ae003065532.zip
* use enums to deal with displacementmap channel selectors
* set default values explicitly for all combobox filter settings at the filters dialog. (bzr r4781)
Diffstat (limited to 'src/ui/widget/attr-widget.h')
-rw-r--r--src/ui/widget/attr-widget.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/ui/widget/attr-widget.h b/src/ui/widget/attr-widget.h
index c87e860d5..34aae7db9 100644
--- a/src/ui/widget/attr-widget.h
+++ b/src/ui/widget/attr-widget.h
@@ -26,7 +26,8 @@ enum DefaultValueType
T_NONE,
T_DOUBLE,
T_VECT_DOUBLE,
- T_BOOL
+ T_BOOL,
+ T_UINT
};
class DefaultValueHolder
@@ -36,6 +37,7 @@ class DefaultValueHolder
double d_val;
std::vector<double>* vt_val;
bool b_val;
+ unsigned int uint_val;
} value;
//FIXME remove copy ctor and assignment operator as private to avoid double free of the vector
@@ -59,11 +61,21 @@ public:
value.b_val = d;
}
+ DefaultValueHolder (unsigned int ui) {
+ type = T_UINT;
+ value.uint_val = ui;
+ }
+
~DefaultValueHolder() {
if (type == T_VECT_DOUBLE)
delete value.vt_val;
}
+ unsigned int as_uint() {
+ g_assert (type == T_UINT);
+ return value.uint_val;
+ }
+
bool as_bool() {
g_assert (type == T_BOOL);
return value.b_val;
@@ -83,6 +95,11 @@ public:
class AttrWidget
{
public:
+ AttrWidget(const SPAttributeEnum a, unsigned int value)
+ : _attr(a),
+ _default(value)
+ {}
+
AttrWidget(const SPAttributeEnum a, double value)
: _attr(a),
_default(value)