~ubuntu-branches/ubuntu/oneiric/nux/oneiric

« back to all changes in this revision

Viewing changes to Nux/RGBValuator.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-06-22 17:16:16 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20110622171616-3cyhhiwsb6ga9d30
Tags: 1.0.2-0ubuntu1
* New upstream release.
* Cherry-pick a fix for FTBFS with -fpermissive
* debian/control:
  - add new libxdamage-dev and libxcomposite-dev build-dep
  - add new libboost1.42-dev dep as well, should be transitionned to 1.46 once
    compiz is transitionned as well
* remove debian/patches/01_build_with_gcc46.patch as included upstream
* debian/rules:
  - disable google code tests while building
* debian/control, debian/rules, debian/libnux-1.0-common.install,
  debian/libnux-1.0-dev.install, debian/libnux-1.0-doc.install,
  debian/libnux-1.0-0.install:
  - change, prepare next ABI breakage and remove no more needed Breaks: with
    new soname bump
* libnux-1.0-common now replaces: libnux-0.9-common for the apport hook

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#ifndef RGBGEVALUATOR_H
24
24
#define RGBGEVALUATOR_H
25
25
 
 
26
#include "NuxCore/Color.h"
26
27
#include "HexRegExpValidator.h"
27
28
#include "IntegerValidator.h"
28
29
#include "DoubleValidator.h"
38
39
  class RGBValuator : public View //public ValuatorAbstraction
39
40
  {
40
41
  public:
41
 
 
42
 
    enum ColorFormat
43
 
    {
44
 
      COLORFORMAT_FLOAT = 0,
45
 
      COLORFORMAT_HEX,
46
 
      COLORFORMAT_INT,
47
 
    };
48
 
 
49
 
    RGBValuator (NUX_FILE_LINE_PROTO);
50
 
    RGBValuator (Color color, NUX_FILE_LINE_PROTO);
51
 
    /*!
52
 
        Create an initialize the widget with the CM_RGB color model and value.
53
 
 
54
 
        @param red
55
 
        @param green
56
 
        @param blue
57
 
        @param alpha
58
 
    */
59
 
    RGBValuator (float red, float green, float blue, float alpha, NUX_FILE_LINE_PROTO);
 
42
    RGBValuator(NUX_FILE_LINE_PROTO);
 
43
    RGBValuator(Color const& color, NUX_FILE_LINE_PROTO);
60
44
    /*!
61
45
        Create an initialize the widget with the appropriate color model and value.
62
46
 
66
50
        @param z Blue if CM_RGB, Value if CM_HSV, Saturation if CM_HLS
67
51
        @param alpha
68
52
    */
69
 
    RGBValuator (eColorModel colorModel, float x, float y, float z, float alpha, NUX_FILE_LINE_PROTO);
 
53
    RGBValuator(color::Model colorModel, float x, float y, float z, float alpha, NUX_FILE_LINE_PROTO);
70
54
 
71
55
    ~RGBValuator();
72
56
 
73
57
    // API
74
 
    void SetColorModel (eColorModel cm);
75
 
    void SetColorFormat (ColorFormat cf);
76
 
    Color GetColor();
77
 
    float GetRed();
78
 
    float GetGreen();
79
 
    float GetBlue();
80
 
    float GetAlpha();
 
58
    void SetColorModel(color::Model cm);
 
59
    void SetColorFormat(color::Format cf);
 
60
    Color GetColor() const;
81
61
    virtual long ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
82
62
 
83
63
    virtual void Draw (GraphicsEngine &GfxContext, bool force_draw);
84
64
    virtual void DrawContent (GraphicsEngine &GfxContext, bool force_draw);
85
65
    virtual void PostDraw (GraphicsEngine &GfxContext, bool force_draw);
86
66
 
87
 
    void SetRGB (Color color);
 
67
    void SetRGB (Color const& color);
88
68
    void SetRGB (float r, float g, float b);
89
69
    void SetAlpha (float alpha);
90
 
    void SetRGBA (Color color);
 
70
    void SetRGBA (Color const& color);
91
71
    void SetRGBA (float r, float g, float b, float a);
92
72
 
93
73
    void SetHSV (float h, float s, float v);
130
110
  protected:
131
111
    void InitializeWidgets();
132
112
    void InitializeLayout();
133
 
    void DestroyLayout();
134
113
 
135
114
  private:
136
115
    void DrawRedMarker (GraphicsEngine &GfxContext);
166
145
    InputArea *m_ComponentAlpha;
167
146
 
168
147
    TextureLayer *m_CheckboardLayer;
169
 
    float m_Red;
170
 
    float m_Green;
171
 
    float m_Blue;
172
 
    float m_Alpha;
173
 
 
174
 
    float m_HSVHue;
175
 
    float m_HSVSaturation;
176
 
    float m_HSVValue;
177
 
 
178
 
    float m_HLSHue;
179
 
    float m_HLSLight;
180
 
    float m_HLSSaturation;
 
148
 
 
149
    color::RedGreenBlue rgb_;
 
150
    color::HueSaturationValue hsv_;
 
151
    color::HueLightnessSaturation hls_;
 
152
    float alpha_;
181
153
 
182
154
    PushButton *m_ColorModel;
183
155
    PushButton *m_ColorFormat;
184
156
 
185
 
    enum eColorModel m_color_model;
186
 
    enum ColorFormat m_color_format;
 
157
    color::Model m_color_model;
 
158
    color::Format m_color_format;
187
159
 
188
160
    HexRegExpValidator m_HexRegExp;
189
161
    IntegerValidator m_IntRegExp;