diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2009-03-20 06:50:37 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2009-03-20 06:50:37 +0000 |
| commit | dde4ae2586249c04da8277135cc5ea35915474aa (patch) | |
| tree | 65fbf6a92a0358d192f0e99a1cee53434803f58c /src/widgets | |
| parent | change color of LPE helperpaths in nodetool (diff) | |
| download | inkscape-dde4ae2586249c04da8277135cc5ea35915474aa.tar.gz inkscape-dde4ae2586249c04da8277135cc5ea35915474aa.zip | |
Renamed ColorDef to PaintDef to prep for expanded functionality.
(bzr r7528)
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/Makefile_insert | 4 | ||||
| -rw-r--r-- | src/widgets/ege-paint-def.cpp (renamed from src/widgets/eek-color-def.cpp) | 44 | ||||
| -rw-r--r-- | src/widgets/ege-paint-def.h (renamed from src/widgets/eek-color-def.h) | 26 |
3 files changed, 37 insertions, 37 deletions
diff --git a/src/widgets/Makefile_insert b/src/widgets/Makefile_insert index 13f2b33eb..08b2433ea 100644 --- a/src/widgets/Makefile_insert +++ b/src/widgets/Makefile_insert @@ -7,10 +7,10 @@ ink_common_sources += \ widgets/dash-selector.h \ widgets/desktop-widget.cpp \ widgets/desktop-widget.h \ - widgets/eek-color-def.cpp \ - widgets/eek-color-def.h \ widgets/eek-preview.cpp \ widgets/eek-preview.h \ + widgets/ege-paint-def.cpp \ + widgets/ege-paint-def.h \ widgets/fill-style.cpp \ widgets/fill-style.h \ widgets/font-selector.cpp \ diff --git a/src/widgets/eek-color-def.cpp b/src/widgets/ege-paint-def.cpp index 8542e5593..dc1579c8e 100644 --- a/src/widgets/eek-color-def.cpp +++ b/src/widgets/ege-paint-def.cpp @@ -1,5 +1,5 @@ /** @file - * @brief EEK color definition + * @brief EGE paint definition */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -54,9 +54,9 @@ #define _(s) gettext(s) #endif // !defined(_) -#include "eek-color-def.h" +#include "ege-paint-def.h" -namespace eek +namespace ege { static std::string mimeTEXT("text/plain"); @@ -65,7 +65,7 @@ static std::string mimeOSWB_COLOR("application/x-oswb-color"); static std::string doubleToStr(double d); -ColorDef::ColorDef() : +PaintDef::PaintDef() : descr(_("none")), type(NONE), r(0), @@ -75,7 +75,7 @@ ColorDef::ColorDef() : { } -ColorDef::ColorDef( ColorType type ) : +PaintDef::PaintDef( ColorType type ) : descr(), type(type), r(0), @@ -96,7 +96,7 @@ ColorDef::ColorDef( ColorType type ) : } } -ColorDef::ColorDef( unsigned int r, unsigned int g, unsigned int b, const std::string& description ) : +PaintDef::PaintDef( unsigned int r, unsigned int g, unsigned int b, const std::string& description ) : descr(description), type(RGB), r(r), @@ -106,18 +106,18 @@ ColorDef::ColorDef( unsigned int r, unsigned int g, unsigned int b, const std::s { } -ColorDef::~ColorDef() +PaintDef::~PaintDef() { } -ColorDef::ColorDef( ColorDef const &other ) +PaintDef::PaintDef( PaintDef const &other ) { if ( this != &other ) { *this = other; } } -ColorDef& ColorDef::operator=( ColorDef const &other ) +PaintDef& PaintDef::operator=( PaintDef const &other ) { if ( this != & other ) { @@ -131,7 +131,7 @@ ColorDef& ColorDef::operator=( ColorDef const &other ) return *this; } -class ColorDef::HookData { +class PaintDef::HookData { public: HookData( ColorCallback cb, void* data ) {_cb = cb; _data = data;} ColorCallback _cb; @@ -139,7 +139,7 @@ public: }; -std::vector<std::string> ColorDef::getMIMETypes() +std::vector<std::string> PaintDef::getMIMETypes() { std::vector<std::string> listing; listing.push_back(mimeOSWB_COLOR); @@ -148,7 +148,7 @@ std::vector<std::string> ColorDef::getMIMETypes() return listing; } -void ColorDef::getMIMEData(std::string const & type, char*& dest, int& len, int& format) +void PaintDef::getMIMEData(std::string const & type, char*& dest, int& len, int& format) { if ( type == mimeTEXT ) { dest = new char[8]; @@ -168,12 +168,12 @@ void ColorDef::getMIMEData(std::string const & type, char*& dest, int& len, int& } else if ( type == mimeOSWB_COLOR ) { std::string tmp("<paint>"); switch ( getType() ) { - case eek::ColorDef::NONE: + case ege::PaintDef::NONE: { tmp += "<nocolor/>"; } break; - case eek::ColorDef::CLEAR: + case ege::PaintDef::CLEAR: { tmp += "<clear/>"; } @@ -204,7 +204,7 @@ void ColorDef::getMIMEData(std::string const & type, char*& dest, int& len, int& } } -bool ColorDef::fromMIMEData(std::string const & type, char const * data, int len, int /*format*/) +bool PaintDef::fromMIMEData(std::string const & type, char const * data, int len, int /*format*/) { bool worked = false; bool changed = false; @@ -213,11 +213,11 @@ bool ColorDef::fromMIMEData(std::string const & type, char const * data, int len } else if ( type == mimeOSWB_COLOR ) { std::string xml(data, len); if ( xml.find("<nocolor/>") != std::string::npos ) { - if ( (this->type != eek::ColorDef::NONE) + if ( (this->type != ege::PaintDef::NONE) || (this->r != 0) || (this->g != 0) || (this->b != 0) ) { - this->type = eek::ColorDef::NONE; + this->type = ege::PaintDef::NONE; this->r = 0; this->g = 0; this->b = 0; @@ -229,7 +229,7 @@ bool ColorDef::fromMIMEData(std::string const & type, char const * data, int len if ( pos != std::string::npos ) { size_t endPos = xml.find(">", pos); std::string srgb = xml.substr(pos, endPos); - this->type = eek::ColorDef::RGB; + this->type = ege::PaintDef::RGB; size_t numPos = srgb.find("r="); if (numPos != std::string::npos) { char* endPtr = 0; @@ -279,7 +279,7 @@ bool ColorDef::fromMIMEData(std::string const & type, char const * data, int len return worked; } -void ColorDef::setRGB( unsigned int r, unsigned int g, unsigned int b ) +void PaintDef::setRGB( unsigned int r, unsigned int g, unsigned int b ) { if ( r != this->r || g != this->g || b != this->b ) { this->r = r; @@ -297,12 +297,12 @@ void ColorDef::setRGB( unsigned int r, unsigned int g, unsigned int b ) } } -void ColorDef::addCallback( ColorCallback cb, void* data ) +void PaintDef::addCallback( ColorCallback cb, void* data ) { _listeners.push_back( new HookData(cb, data) ); } -void ColorDef::removeCallback( ColorCallback /*cb*/, void* /*data*/ ) +void PaintDef::removeCallback( ColorCallback /*cb*/, void* /*data*/ ) { } @@ -314,7 +314,7 @@ static std::string doubleToStr(double d) return out.str(); } -} // namespace eek +} // namespace ege /* Local Variables: diff --git a/src/widgets/eek-color-def.h b/src/widgets/ege-paint-def.h index 2f6117d54..b47aec8aa 100644 --- a/src/widgets/eek-color-def.h +++ b/src/widgets/ege-paint-def.h @@ -1,5 +1,5 @@ /** @file - * @brief EEK color definition + * @brief EGE paint definition */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -37,30 +37,30 @@ * * ***** END LICENSE BLOCK ***** */ -#ifndef SEEN_EEK_COLOR_DEF_H -#define SEEN_EEK_COLOR_DEF_H +#ifndef SEEN_EGE_PAINT_DEF_H +#define SEEN_EGE_PAINT_DEF_H #include <string> #include <vector> -namespace eek +namespace ege { typedef void (*ColorCallback)( void* data ); -class ColorDef +class PaintDef { public: enum ColorType{CLEAR, NONE, RGB}; - ColorDef(); - ColorDef(ColorType type); - ColorDef( unsigned int r, unsigned int g, unsigned int b, const std::string& description ); - virtual ~ColorDef(); + PaintDef(); + PaintDef(ColorType type); + PaintDef( unsigned int r, unsigned int g, unsigned int b, const std::string& description ); + virtual ~PaintDef(); - ColorDef( ColorDef const &other ); - virtual ColorDef& operator=( ColorDef const &other ); + PaintDef( PaintDef const &other ); + virtual PaintDef& operator=( PaintDef const &other ); ColorType getType() const { return type; } @@ -95,9 +95,9 @@ private: }; -} // namespace eek +} // namespace ege -#endif // SEEN_EEK_COLOR_DEF_H +#endif // SEEN_EGE_PAINT_DEF_H /* Local Variables: |
