/* Copyright (C) 1997, 1998, 1999, 2000 by Alex Pfaffe (Digital Dawn Graphics Inc) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _ddgUIColor_Class_ #define _ddgUIColor_Class_ #include "struct/ddgcolor.h" #include "render/ddguiobj.h" class WEXP ddgUIControl : public ddgUIObj { typedef ddgUIObj super; static unsigned int _gid; static ddgList *_guicontrollist; unsigned int _id; public: ddgUIControl(unsigned short x, unsigned short y); bool init( void ); bool draw( ddgContext *ctx ) { return false; } virtual bool update( unsigned int _id ) = 0; unsigned int id(void) { return _id; } static unsigned int genId(void); static ddgUIControl* find(unsigned int id); }; class WEXP ddgUINode : public ddgListNode { typedef ddgListNode super; public: ddgUIControl *uicontrol; ddgUINode( ddgUIControl *uic ) { uicontrol = uic; } }; class WEXP ddgUIColor : public ddgUIControl { typedef ddgUIControl super; union { ddgColor3 *_color3; ddgColor4 *_color4; }; bool _is4; unsigned int _idred; unsigned int _idgreen; unsigned int _idblue; unsigned int _idalpha; void *_slred; void *_slgreen; void *_slblue; void *_slalpha; void *_labred; void *_labgreen; void *_labblue; void *_labalpha; public: ddgUIColor( unsigned short x, unsigned short y, ddgColor3 *c = NULL); ddgUIColor( unsigned short x, unsigned short y, ddgColor4 *c = NULL); bool init(void); bool update( unsigned int id ); void color( ddgColor3 *c ) { _color3 = c; _is4 = false; } void color( ddgColor4 *c ) { _color4 = c; _is4 = true; } }; class WEXP ddgUIColorView : public ddgUIObj { typedef ddgUIObj super; union { ddgColor3 *_color3; ddgColor4 *_color4; }; bool _is4; public: ddgUIColorView( unsigned short x, unsigned short y, ddgColor3 *c = NULL) : super(x,y) { _color3 = c; _is4 = false; } ddgUIColorView( unsigned short x, unsigned short y, ddgColor4 *c = NULL) : super(x,y) { _color4 = c; _is4 = true; } bool draw( ddgContext *ctx ); void color( ddgColor3 *c ) { _color3 = c; _is4 = false; } void color( ddgColor4 *c ) { _color4 = c; _is4 = true; } }; class WEXP ddgUIColorList : public ddgUIControl { public: bool update( unsigned int id ); bool init(void); }; #endif