~hikiko/nux/arb-srgba-shader

« back to all changes in this revision

Viewing changes to Nux/ColorPreview.h

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-02 03:28:11 UTC
  • Revision ID: neil.patel@canonical.com-20100902032811-i2m18tfb6pkasnvt
Remove Win EOL chars

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 */
21
21
 
22
22
 
23
 
#ifndef COLORPREVIEW_H
24
 
#define COLORPREVIEW_H
25
 
 
26
 
#include "NuxGraphics/GLDeviceFactory.h"
27
 
#include "NuxGraphics/GLDeviceObjects.h"
28
 
 
29
 
NAMESPACE_BEGIN_GUI
30
 
 
31
 
class HLayout;
32
 
class StaticTextBox;
33
 
class ColorEditor;
34
 
class TimerFunctor;
35
 
class TimerHandle;
36
 
class ColorDialogProxy;
37
 
 
38
 
class ColorPreview : public ActiveInterfaceObject
39
 
{
40
 
public:
41
 
    ColorPreview(float red = 0.0f, float green = 0.0f, float blue = 0.0f,  eColorModel colormodel = CM_RGB);
42
 
    ~ColorPreview();
43
 
    virtual long ProcessEvent(IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
44
 
    virtual void Draw(GraphicsContext& GfxContext, bool force_draw);
45
 
    virtual void DrawContent(GraphicsContext& GfxContext, bool force_draw);
46
 
    virtual void PostDraw(GraphicsContext& GfxContext, bool force_draw);
47
 
 
48
 
    sigc::signal< void, const weaksmptr(ColorEditor) > sigColorChanged;
49
 
 
50
 
    void SetRed(double r);
51
 
    void SetGreen(double g);
52
 
    void SetBlue(double b);
53
 
 
54
 
    void SetRGB(double r, double g, double b);
55
 
    void SetRGBA(double r, double g, double b, double a);
56
 
    void SetColor(Color rgb);
57
 
    Color GetRGBColor() const;
58
 
 
59
 
private:
60
 
    void RecvTimer(void* v);
61
 
    void RecvClick(int x, int y, unsigned long button_flags, unsigned long key_flags);
62
 
 
63
 
    TimerFunctor* m_ChangeDetectionTimer;
64
 
    TimerHandle* m_ChangeTimerHandler;
65
 
 
66
 
    Color m_Color;
67
 
    smptr(HLayout) m_hlayout;
68
 
    smptr(CoreArea) m_ColorArea;
69
 
    smptr(StaticTextBox) m_ColorValue;
70
 
    ColorDialogProxy* m_DialogThreadProxy;
71
 
};
72
 
 
73
 
 
74
 
NAMESPACE_END_GUI
75
 
 
76
 
#endif // COLORPREVIEW_H
 
23
#ifndef COLORPREVIEW_H
 
24
#define COLORPREVIEW_H
 
25
 
 
26
#include "NuxGraphics/GLDeviceFactory.h"
 
27
#include "NuxGraphics/GLDeviceObjects.h"
 
28
 
 
29
NAMESPACE_BEGIN_GUI
 
30
 
 
31
class HLayout;
 
32
class StaticTextBox;
 
33
class ColorEditor;
 
34
class TimerFunctor;
 
35
class TimerHandle;
 
36
class ColorDialogProxy;
 
37
 
 
38
class ColorPreview : public ActiveInterfaceObject
 
39
{
 
40
public:
 
41
    ColorPreview(float red = 0.0f, float green = 0.0f, float blue = 0.0f,  eColorModel colormodel = CM_RGB);
 
42
    ~ColorPreview();
 
43
    virtual long ProcessEvent(IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
 
44
    virtual void Draw(GraphicsContext& GfxContext, bool force_draw);
 
45
    virtual void DrawContent(GraphicsContext& GfxContext, bool force_draw);
 
46
    virtual void PostDraw(GraphicsContext& GfxContext, bool force_draw);
 
47
 
 
48
    sigc::signal< void, const weaksmptr(ColorEditor) > sigColorChanged;
 
49
 
 
50
    void SetRed(double r);
 
51
    void SetGreen(double g);
 
52
    void SetBlue(double b);
 
53
 
 
54
    void SetRGB(double r, double g, double b);
 
55
    void SetRGBA(double r, double g, double b, double a);
 
56
    void SetColor(Color rgb);
 
57
    Color GetRGBColor() const;
 
58
 
 
59
private:
 
60
    void RecvTimer(void* v);
 
61
    void RecvClick(int x, int y, unsigned long button_flags, unsigned long key_flags);
 
62
 
 
63
    TimerFunctor* m_ChangeDetectionTimer;
 
64
    TimerHandle* m_ChangeTimerHandler;
 
65
 
 
66
    Color m_Color;
 
67
    smptr(HLayout) m_hlayout;
 
68
    smptr(CoreArea) m_ColorArea;
 
69
    smptr(StaticTextBox) m_ColorValue;
 
70
    ColorDialogProxy* m_DialogThreadProxy;
 
71
};
 
72
 
 
73
 
 
74
NAMESPACE_END_GUI
 
75
 
 
76
#endif // COLORPREVIEW_H