diff options
| author | Tomasz Boczkowski <penginsbacon@gmail.com> | 2014-05-30 16:47:23 +0000 |
|---|---|---|
| committer | Tomasz Boczkowski <penginsbacon@gmail.com> | 2014-05-30 16:47:23 +0000 |
| commit | 7a205911659013dea26f1554158cc050fdff20bc (patch) | |
| tree | b101bce97366e56d8dfdb47308c3689e91597477 /src | |
| parent | SPColorNotebok c++-sification - removed trackerList, commented out unused pop... (diff) | |
| download | inkscape-7a205911659013dea26f1554158cc050fdff20bc.tar.gz inkscape-7a205911659013dea26f1554158cc050fdff20bc.zip | |
changed coding style of SelectedColor
(bzr r13341.6.30)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/selected-color.cpp | 32 | ||||
| -rw-r--r-- | src/ui/selected-color.h | 46 |
2 files changed, 48 insertions, 30 deletions
diff --git a/src/ui/selected-color.cpp b/src/ui/selected-color.cpp index f61c3b7f8..296b15796 100644 --- a/src/ui/selected-color.cpp +++ b/src/ui/selected-color.cpp @@ -19,7 +19,7 @@ namespace Inkscape { namespace UI { -double SelectedColor::_epsilon = 1e-4; +double const SelectedColor::_EPSILON = 1e-4; SelectedColor::SelectedColor() : _color(0) @@ -33,28 +33,28 @@ SelectedColor::~SelectedColor() { } -void SelectedColor::set_color(const SPColor& color) +void SelectedColor::setColor(SPColor const &color) { - set_color_alpha( color, _alpha ); + setColorAlpha( color, _alpha ); } -SPColor SelectedColor::get_color() const +SPColor SelectedColor::color() const { return _color; } -void SelectedColor::set_alpha(gfloat alpha) +void SelectedColor::setAlpha(gfloat alpha) { g_return_if_fail( ( 0.0 <= alpha ) && ( alpha <= 1.0 ) ); - set_color_alpha( _color, alpha ); + setColorAlpha( _color, alpha ); } -gfloat SelectedColor::get_alpha() const +gfloat SelectedColor::alpha() const { return _alpha; } -void SelectedColor::set_color_alpha(const SPColor& color, gfloat alpha, bool emit) +void SelectedColor::setColorAlpha(SPColor const &color, gfloat alpha, bool emit) { #ifdef DUMP_CHANGE_INFO g_message("SelectedColor::setColorAlpha( this=%p, %f, %f, %f, %s, %f, %s) in %s", this, color.v.c[0], color.v.c[1], color.v.c[2], (color.icc?color.icc->colorProfile.c_str():"<null>"), alpha, (emit?"YES":"no"), FOO_NAME(_csel)); @@ -70,8 +70,8 @@ void SelectedColor::set_color_alpha(const SPColor& color, gfloat alpha, bool emi ); #endif - if ( _virgin || !color.isClose( _color, _epsilon ) || - (fabs((_alpha) - (alpha)) >= _epsilon )) { + if ( _virgin || !color.isClose( _color, _EPSILON ) || + (fabs((_alpha) - (alpha)) >= _EPSILON )) { _virgin = false; @@ -89,7 +89,7 @@ void SelectedColor::set_color_alpha(const SPColor& color, gfloat alpha, bool emi } } -void SelectedColor::get_color_alpha(SPColor &color, gfloat &alpha) const { +void SelectedColor::colorAlpha(SPColor &color, gfloat &alpha) const { color = _color; alpha = _alpha; } @@ -97,3 +97,13 @@ void SelectedColor::get_color_alpha(SPColor &color, gfloat &alpha) const { } } +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/ui/selected-color.h b/src/ui/selected-color.h index a56ee6afb..08b84b66c 100644 --- a/src/ui/selected-color.h +++ b/src/ui/selected-color.h @@ -33,47 +33,55 @@ public: SelectedColor(); virtual ~SelectedColor(); - void set_color( const SPColor& color ); - SPColor get_color() const; + void setColor(SPColor const &color); + SPColor color() const; - void set_alpha( gfloat alpha ); - gfloat get_alpha() const; + void setAlpha(gfloat alpha); + gfloat alpha() const; - void set_color_alpha( const SPColor& color, gfloat alpha, bool emit = false ); - void get_color_alpha( SPColor &color, gfloat &alpha ) const; + void setColorAlpha(SPColor const &color, gfloat alpha, bool emit = false); + void colorAlpha(SPColor &color, gfloat &alpha) const; sigc::signal<void> signal_changed; private: // By default, disallow copy constructor and assignment operator - SelectedColor( const SelectedColor& obj ); - SelectedColor& operator=( const SelectedColor& obj ); + SelectedColor(SelectedColor const &obj); + SelectedColor& operator=(SelectedColor const &obj); - SPColor _color; - /** - * Color alpha value guaranteed to be in [0, 1]. - */ - gfloat _alpha; + SPColor _color; + /** + * Color alpha value guaranteed to be in [0, 1]. + */ + gfloat _alpha; /** * This flag is true if no color is set yet */ bool _virgin; - static double _epsilon; + static double const _EPSILON; }; - class ColorSelectorFactory { public: - virtual ~ColorSelectorFactory() {} + virtual ~ColorSelectorFactory() { + } - virtual Gtk::Widget* createWidget(SelectedColor& color) const = 0; + virtual Gtk::Widget* createWidget(SelectedColor &color) const = 0; virtual Glib::ustring modeName() const = 0; }; - } } #endif - +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : |
