diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2009-03-04 09:11:28 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2009-03-04 09:11:28 +0000 |
| commit | 112ae1a9b695d21a4e6a7ad32bad36bb6584e494 (patch) | |
| tree | 7cff1037371a8f354105606b6e9a093cbfc0d718 /src/widgets | |
| parent | Cleanup and prep for more work (diff) | |
| download | inkscape-112ae1a9b695d21a4e6a7ad32bad36bb6584e494.tar.gz inkscape-112ae1a9b695d21a4e6a7ad32bad36bb6584e494.zip | |
Removed boolean "remove" from swatch, used new type enum in ColorDef.
(bzr r7411)
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/eek-color-def.cpp | 6 | ||||
| -rw-r--r-- | src/widgets/eek-color-def.h | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/widgets/eek-color-def.cpp b/src/widgets/eek-color-def.cpp index 85b00b251..d7cb41b38 100644 --- a/src/widgets/eek-color-def.cpp +++ b/src/widgets/eek-color-def.cpp @@ -54,20 +54,20 @@ namespace eek ColorDef::ColorDef() : descr(_("none")), + type(NONE), r(0), g(0), b(0), - none(true), editable(false) { } ColorDef::ColorDef( unsigned int r, unsigned int g, unsigned int b, const std::string& description ) : descr(description), + type(RGB), r(r), g(g), b(b), - none(false), editable(false) { } @@ -87,11 +87,11 @@ ColorDef& ColorDef::operator=( ColorDef const &other ) { if ( this != & other ) { + type = other.type; r = other.r; g = other.g; b = other.b; descr = other.descr; - none = other.none; editable = other.editable; } return *this; diff --git a/src/widgets/eek-color-def.h b/src/widgets/eek-color-def.h index 63cd096be..764a28b12 100644 --- a/src/widgets/eek-color-def.h +++ b/src/widgets/eek-color-def.h @@ -52,6 +52,8 @@ typedef void (*ColorCallback)( void* data ); class ColorDef { public: + enum ColorType{CLEAR, NONE, RGB}; + ColorDef(); ColorDef( unsigned int r, unsigned int g, unsigned int b, const std::string& description ); virtual ~ColorDef(); @@ -59,6 +61,8 @@ public: ColorDef( ColorDef const &other ); virtual ColorDef& operator=( ColorDef const &other ); + ColorType getType() const { return type; } + void setRGB( unsigned int r, unsigned int g, unsigned int b ); unsigned int getR() const { return r; } unsigned int getG() const { return g; } @@ -73,10 +77,10 @@ public: std::string descr; protected: + ColorType type; unsigned int r; unsigned int g; unsigned int b; - bool none; bool editable; private: |
