Remove color management and start rework of texture system management ==> not tested

This commit is contained in:
Edouard DUPIN 2012-08-21 18:14:58 +02:00
parent 99b30494dd
commit a89f8c09f5
59 changed files with 553 additions and 1322 deletions

@ -1 +1 @@
Subproject commit 7d902650c3195ccd5e6d71daf0d7aa1908fa0fab Subproject commit 6f05d8dc715c3a8c022def84d63bed8bc255ca8d

View File

@ -1,609 +0,0 @@
/**
*******************************************************************************
* @file etk/Color.h
* @brief Ewol Tool Kit : basic colors
* @author Edouard DUPIN
* @date 23/04/2012
* @par Project
* Ewol TK
*
* @par Copyright
* Copyright 2011 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
*
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#include <etk/Types.h>
#include <etk/Color.h>
#include <etk/DebugInternal.h>
#include <etk/tool.h>
const etk::Color etk::color::none((uint32_t)0x00000000);
const etk::Color etk::color::aliceBlue((uint32_t)0xF0F8FFFF);
const etk::Color etk::color::antiqueWhite((uint32_t)0xFAEBD7FF);
const etk::Color etk::color::aqua((uint32_t)0x00FFFFFF);
const etk::Color etk::color::aquamarine((uint32_t)0x7FFFD4FF);
const etk::Color etk::color::azure((uint32_t)0xF0FFFFFF);
const etk::Color etk::color::beige((uint32_t)0xF5F5DCFF);
const etk::Color etk::color::bisque((uint32_t)0xFFE4C4FF);
const etk::Color etk::color::black((uint32_t)0x000000FF);
const etk::Color etk::color::blanchedAlmond((uint32_t)0xFFEBCDFF);
const etk::Color etk::color::blue((uint32_t)0x0000FFFF);
const etk::Color etk::color::blueViolet((uint32_t)0x8A2BE2FF);
const etk::Color etk::color::brown((uint32_t)0xA52A2AFF);
const etk::Color etk::color::burlyWood((uint32_t)0xDEB887FF);
const etk::Color etk::color::cadetBlue((uint32_t)0x5F9EA0FF);
const etk::Color etk::color::chartreuse((uint32_t)0x7FFF00FF);
const etk::Color etk::color::chocolate((uint32_t)0xD2691EFF);
const etk::Color etk::color::coral((uint32_t)0xFF7F50FF);
const etk::Color etk::color::cornflowerBlue((uint32_t)0x6495EDFF);
const etk::Color etk::color::cornsilk((uint32_t)0xFFF8DCFF);
const etk::Color etk::color::crimson((uint32_t)0xDC143CFF);
const etk::Color etk::color::cyan((uint32_t)0x00FFFFFF);
const etk::Color etk::color::darkBlue((uint32_t)0x00008BFF);
const etk::Color etk::color::darkCyan((uint32_t)0x008B8BFF);
const etk::Color etk::color::darkGoldenRod((uint32_t)0xB8860BFF);
const etk::Color etk::color::darkGray((uint32_t)0xA9A9A9FF);
const etk::Color etk::color::darkGrey((uint32_t)0xA9A9A9FF);
const etk::Color etk::color::darkGreen((uint32_t)0x006400FF);
const etk::Color etk::color::darkKhaki((uint32_t)0xBDB76BFF);
const etk::Color etk::color::darkMagenta((uint32_t)0x8B008BFF);
const etk::Color etk::color::darkOliveGreen((uint32_t)0x556B2FFF);
const etk::Color etk::color::darkorange((uint32_t)0xFF8C00FF);
const etk::Color etk::color::darkOrchid((uint32_t)0x9932CCFF);
const etk::Color etk::color::darkRed((uint32_t)0x8B0000FF);
const etk::Color etk::color::darkSalmon((uint32_t)0xE9967AFF);
const etk::Color etk::color::darkSeaGreen((uint32_t)0x8FBC8FFF);
const etk::Color etk::color::darkSlateBlue((uint32_t)0x483D8BFF);
const etk::Color etk::color::darkSlateGray((uint32_t)0x2F4F4FFF);
const etk::Color etk::color::darkSlateGrey((uint32_t)0x2F4F4FFF);
const etk::Color etk::color::darkTurquoise((uint32_t)0x00CED1FF);
const etk::Color etk::color::darkViolet((uint32_t)0x9400D3FF);
const etk::Color etk::color::deepPink((uint32_t)0xFF1493FF);
const etk::Color etk::color::deepSkyBlue((uint32_t)0x00BFFFFF);
const etk::Color etk::color::dimGray((uint32_t)0x696969FF);
const etk::Color etk::color::dimGrey((uint32_t)0x696969FF);
const etk::Color etk::color::dodgerBlue((uint32_t)0x1E90FFFF);
const etk::Color etk::color::fireBrick((uint32_t)0xB22222FF);
const etk::Color etk::color::floralWhite((uint32_t)0xFFFAF0FF);
const etk::Color etk::color::forestGreen((uint32_t)0x228B22FF);
const etk::Color etk::color::fuchsia((uint32_t)0xFF00FFFF);
const etk::Color etk::color::gainsboro((uint32_t)0xDCDCDCFF);
const etk::Color etk::color::ghostWhite((uint32_t)0xF8F8FFFF);
const etk::Color etk::color::gold((uint32_t)0xFFD700FF);
const etk::Color etk::color::goldenRod((uint32_t)0xDAA520FF);
const etk::Color etk::color::gray((uint32_t)0x808080FF);
const etk::Color etk::color::grey((uint32_t)0x808080FF);
const etk::Color etk::color::green((uint32_t)0x008000FF);
const etk::Color etk::color::greenYellow((uint32_t)0xADFF2FFF);
const etk::Color etk::color::honeyDew((uint32_t)0xF0FFF0FF);
const etk::Color etk::color::hotPink((uint32_t)0xFF69B4FF);
const etk::Color etk::color::indianRed ((uint32_t)0xCD5C5CFF);
const etk::Color etk::color::indigo ((uint32_t)0x4B0082FF);
const etk::Color etk::color::ivory((uint32_t)0xFFFFF0FF);
const etk::Color etk::color::khaki((uint32_t)0xF0E68CFF);
const etk::Color etk::color::lavender((uint32_t)0xE6E6FAFF);
const etk::Color etk::color::lavenderBlush((uint32_t)0xFFF0F5FF);
const etk::Color etk::color::lawnGreen((uint32_t)0x7CFC00FF);
const etk::Color etk::color::lemonChiffon((uint32_t)0xFFFACDFF);
const etk::Color etk::color::lightBlue((uint32_t)0xADD8E6FF);
const etk::Color etk::color::lightCoral((uint32_t)0xF08080FF);
const etk::Color etk::color::lightCyan((uint32_t)0xE0FFFFFF);
const etk::Color etk::color::lightGoldenRodYellow((uint32_t)0xFAFAD2FF);
const etk::Color etk::color::lightGray((uint32_t)0xD3D3D3FF);
const etk::Color etk::color::lightGrey((uint32_t)0xD3D3D3FF);
const etk::Color etk::color::lightGreen((uint32_t)0x90EE90FF);
const etk::Color etk::color::lightPink((uint32_t)0xFFB6C1FF);
const etk::Color etk::color::lightSalmon((uint32_t)0xFFA07AFF);
const etk::Color etk::color::lightSeaGreen((uint32_t)0x20B2AAFF);
const etk::Color etk::color::lightSkyBlue((uint32_t)0x87CEFAFF);
const etk::Color etk::color::lightSlateGray((uint32_t)0x778899FF);
const etk::Color etk::color::lightSlateGrey((uint32_t)0x778899FF);
const etk::Color etk::color::lightSteelBlue((uint32_t)0xB0C4DEFF);
const etk::Color etk::color::lightYellow((uint32_t)0xFFFFE0FF);
const etk::Color etk::color::lime((uint32_t)0x00FF00FF);
const etk::Color etk::color::limeGreen((uint32_t)0x32CD32FF);
const etk::Color etk::color::linen((uint32_t)0xFAF0E6FF);
const etk::Color etk::color::magenta((uint32_t)0xFF00FFFF);
const etk::Color etk::color::maroon((uint32_t)0x800000FF);
const etk::Color etk::color::mediumAquaMarine((uint32_t)0x66CDAAFF);
const etk::Color etk::color::mediumBlue((uint32_t)0x0000CDFF);
const etk::Color etk::color::mediumOrchid((uint32_t)0xBA55D3FF);
const etk::Color etk::color::mediumPurple((uint32_t)0x9370D8FF);
const etk::Color etk::color::mediumSeaGreen((uint32_t)0x3CB371FF);
const etk::Color etk::color::mediumSlateBlue((uint32_t)0x7B68EEFF);
const etk::Color etk::color::mediumSpringGreen((uint32_t)0x00FA9AFF);
const etk::Color etk::color::mediumTurquoise((uint32_t)0x48D1CCFF);
const etk::Color etk::color::mediumVioletRed((uint32_t)0xC71585FF);
const etk::Color etk::color::midnightBlue((uint32_t)0x191970FF);
const etk::Color etk::color::mintCream((uint32_t)0xF5FFFAFF);
const etk::Color etk::color::mistyRose((uint32_t)0xFFE4E1FF);
const etk::Color etk::color::moccasin((uint32_t)0xFFE4B5FF);
const etk::Color etk::color::navajoWhite((uint32_t)0xFFDEADFF);
const etk::Color etk::color::navy((uint32_t)0x000080FF);
const etk::Color etk::color::oldLace((uint32_t)0xFDF5E6FF);
const etk::Color etk::color::olive((uint32_t)0x808000FF);
const etk::Color etk::color::oliveDrab((uint32_t)0x6B8E23FF);
const etk::Color etk::color::orange((uint32_t)0xFFA500FF);
const etk::Color etk::color::orangeRed((uint32_t)0xFF4500FF);
const etk::Color etk::color::orchid((uint32_t)0xDA70D6FF);
const etk::Color etk::color::paleGoldenRod((uint32_t)0xEEE8AAFF);
const etk::Color etk::color::paleGreen((uint32_t)0x98FB98FF);
const etk::Color etk::color::paleTurquoise((uint32_t)0xAFEEEEFF);
const etk::Color etk::color::paleVioletRed((uint32_t)0xD87093FF);
const etk::Color etk::color::papayaWhip((uint32_t)0xFFEFD5FF);
const etk::Color etk::color::peachPuff((uint32_t)0xFFDAB9FF);
const etk::Color etk::color::peru((uint32_t)0xCD853FFF);
const etk::Color etk::color::pink((uint32_t)0xFFC0CBFF);
const etk::Color etk::color::plum((uint32_t)0xDDA0DDFF);
const etk::Color etk::color::powderBlue((uint32_t)0xB0E0E6FF);
const etk::Color etk::color::purple((uint32_t)0x800080FF);
const etk::Color etk::color::red((uint32_t)0xFF0000FF);
const etk::Color etk::color::rosyBrown((uint32_t)0xBC8F8FFF);
const etk::Color etk::color::royalBlue((uint32_t)0x4169E1FF);
const etk::Color etk::color::saddleBrown((uint32_t)0x8B4513FF);
const etk::Color etk::color::salmon((uint32_t)0xFA8072FF);
const etk::Color etk::color::sandyBrown((uint32_t)0xF4A460FF);
const etk::Color etk::color::seaGreen((uint32_t)0x2E8B57FF);
const etk::Color etk::color::seaShell((uint32_t)0xFFF5EEFF);
const etk::Color etk::color::sienna((uint32_t)0xA0522DFF);
const etk::Color etk::color::silver((uint32_t)0xC0C0C0FF);
const etk::Color etk::color::skyBlue((uint32_t)0x87CEEBFF);
const etk::Color etk::color::slateBlue((uint32_t)0x6A5ACDFF);
const etk::Color etk::color::slateGray((uint32_t)0x708090FF);
const etk::Color etk::color::slateGrey((uint32_t)0x708090FF);
const etk::Color etk::color::snow((uint32_t)0xFFFAFAFF);
const etk::Color etk::color::springGreen((uint32_t)0x00FF7FFF);
const etk::Color etk::color::steelBlue((uint32_t)0x4682B4FF);
const etk::Color etk::color::tan((uint32_t)0xD2B48CFF);
const etk::Color etk::color::teal((uint32_t)0x008080FF);
const etk::Color etk::color::thistle((uint32_t)0xD8BFD8FF);
const etk::Color etk::color::tomato((uint32_t)0xFF6347FF);
const etk::Color etk::color::turquoise((uint32_t)0x40E0D0FF);
const etk::Color etk::color::violet((uint32_t)0xEE82EEFF);
const etk::Color etk::color::wheat((uint32_t)0xF5DEB3FF);
const etk::Color etk::color::white((uint32_t)0xFFFFFFFF);
const etk::Color etk::color::whiteSmoke((uint32_t)0xF5F5F5FF);
const etk::Color etk::color::yellow((uint32_t)0xFFFF00FF);
const etk::Color etk::color::yellowGreen((uint32_t)0x9ACD32FF);
typedef struct {
const char * colorName;
etk::Color color;
} colorList_ts;
static const colorList_ts listOfColor[] = {
{ "none", etk::color::none},
{ "AliceBlue", etk::color::aliceBlue},
{ "AntiqueWhite", etk::color::antiqueWhite},
{ "Aqua", etk::color::aqua},
{ "Aquamarine", etk::color::aquamarine},
{ "Azure", etk::color::azure},
{ "Beige", etk::color::beige},
{ "Bisque", etk::color::bisque},
{ "Black", etk::color::black},
{ "BlanchedAlmond", etk::color::blanchedAlmond},
{ "Blue", etk::color::blue},
{ "BlueViolet", etk::color::blueViolet},
{ "Brown", etk::color::brown},
{ "BurlyWood", etk::color::burlyWood},
{ "CadetBlue", etk::color::cadetBlue},
{ "Chartreuse", etk::color::chartreuse},
{ "Chocolate", etk::color::chocolate},
{ "Coral", etk::color::coral},
{ "CornflowerBlue", etk::color::cornflowerBlue},
{ "Cornsilk", etk::color::cornsilk},
{ "Crimson", etk::color::crimson},
{ "Cyan", etk::color::cyan},
{ "DarkBlue", etk::color::darkBlue},
{ "DarkCyan", etk::color::darkCyan},
{ "DarkGoldenRod", etk::color::darkGoldenRod},
{ "DarkGray", etk::color::darkGray},
{ "DarkGrey", etk::color::darkGrey},
{ "DarkGreen", etk::color::darkGreen},
{ "DarkKhaki", etk::color::darkKhaki},
{ "DarkMagenta", etk::color::darkMagenta},
{ "DarkOliveGreen", etk::color::darkOliveGreen},
{ "Darkorange", etk::color::darkorange},
{ "DarkOrchid", etk::color::darkOrchid},
{ "DarkRed", etk::color::darkRed},
{ "DarkSalmon", etk::color::darkSalmon},
{ "DarkSeaGreen", etk::color::darkSeaGreen},
{ "DarkSlateBlue", etk::color::darkSlateBlue},
{ "DarkSlateGray", etk::color::darkSlateGray},
{ "DarkSlateGrey", etk::color::darkSlateGrey},
{ "DarkTurquoise", etk::color::darkTurquoise},
{ "DarkViolet", etk::color::darkViolet},
{ "DeepPink", etk::color::deepPink},
{ "DeepSkyBlue", etk::color::deepSkyBlue},
{ "DimGray", etk::color::dimGray},
{ "DimGrey", etk::color::dimGrey},
{ "DodgerBlue", etk::color::dodgerBlue},
{ "FireBrick", etk::color::fireBrick},
{ "FloralWhite", etk::color::floralWhite},
{ "ForestGreen", etk::color::forestGreen},
{ "Fuchsia", etk::color::fuchsia},
{ "Gainsboro", etk::color::gainsboro},
{ "GhostWhite", etk::color::ghostWhite},
{ "Gold", etk::color::gold},
{ "GoldenRod", etk::color::goldenRod},
{ "Gray", etk::color::gray},
{ "Grey", etk::color::grey},
{ "Green", etk::color::green},
{ "GreenYellow", etk::color::greenYellow},
{ "HoneyDew", etk::color::honeyDew},
{ "HotPink", etk::color::hotPink},
{ "IndianRed", etk::color::indianRed},
{ "Indigo", etk::color::indigo},
{ "Ivory", etk::color::ivory},
{ "Khaki", etk::color::khaki},
{ "Lavender", etk::color::lavender},
{ "LavenderBlush", etk::color::lavenderBlush},
{ "LawnGreen", etk::color::lawnGreen},
{ "LemonChiffon", etk::color::lemonChiffon},
{ "LightBlue", etk::color::lightBlue},
{ "LightCoral", etk::color::lightCoral},
{ "LightCyan", etk::color::lightCyan},
{ "LightGoldenRodYellow", etk::color::lightGoldenRodYellow},
{ "LightGray", etk::color::lightGray},
{ "LightGrey", etk::color::lightGrey},
{ "LightGreen", etk::color::lightGreen},
{ "LightPink", etk::color::lightPink},
{ "LightSalmon", etk::color::lightSalmon},
{ "LightSeaGreen", etk::color::lightSeaGreen},
{ "LightSkyBlue", etk::color::lightSkyBlue},
{ "LightSlateGray", etk::color::lightSlateGray},
{ "LightSlateGrey", etk::color::lightSlateGrey},
{ "LightSteelBlue", etk::color::lightSteelBlue},
{ "LightYellow", etk::color::lightYellow},
{ "Lime", etk::color::lime},
{ "LimeGreen", etk::color::limeGreen},
{ "Linen", etk::color::linen},
{ "Magenta", etk::color::magenta},
{ "Maroon", etk::color::maroon},
{ "MediumAquaMarine", etk::color::mediumAquaMarine},
{ "MediumBlue", etk::color::mediumBlue},
{ "MediumOrchid", etk::color::mediumOrchid},
{ "MediumPurple", etk::color::mediumPurple},
{ "MediumSeaGreen", etk::color::mediumSeaGreen},
{ "MediumSlateBlue", etk::color::mediumSlateBlue},
{ "MediumSpringGreen", etk::color::mediumSpringGreen},
{ "MediumTurquoise", etk::color::mediumTurquoise},
{ "MediumVioletRed", etk::color::mediumVioletRed},
{ "MidnightBlue", etk::color::midnightBlue},
{ "MintCream", etk::color::mintCream},
{ "MistyRose", etk::color::mistyRose},
{ "Moccasin", etk::color::moccasin},
{ "NavajoWhite", etk::color::navajoWhite},
{ "Navy", etk::color::navy},
{ "OldLace", etk::color::oldLace},
{ "Olive", etk::color::olive},
{ "OliveDrab", etk::color::oliveDrab},
{ "Orange", etk::color::orange},
{ "OrangeRed", etk::color::orangeRed},
{ "Orchid", etk::color::orchid},
{ "PaleGoldenRod", etk::color::paleGoldenRod},
{ "PaleGreen", etk::color::paleGreen},
{ "PaleTurquoise", etk::color::paleTurquoise},
{ "PaleVioletRed", etk::color::paleVioletRed},
{ "PapayaWhip", etk::color::papayaWhip},
{ "PeachPuff", etk::color::peachPuff},
{ "Peru", etk::color::peru},
{ "Pink", etk::color::pink},
{ "Plum", etk::color::plum},
{ "PowderBlue", etk::color::powderBlue},
{ "Purple", etk::color::purple},
{ "Red", etk::color::red},
{ "RosyBrown", etk::color::rosyBrown},
{ "RoyalBlue", etk::color::royalBlue},
{ "SaddleBrown", etk::color::saddleBrown},
{ "Salmon", etk::color::salmon},
{ "SandyBrown", etk::color::sandyBrown},
{ "SeaGreen", etk::color::seaGreen},
{ "SeaShell", etk::color::seaShell},
{ "Sienna", etk::color::sienna},
{ "Silver", etk::color::silver},
{ "SkyBlue", etk::color::skyBlue},
{ "SlateBlue", etk::color::slateBlue},
{ "SlateGray", etk::color::slateGray},
{ "SlateGrey", etk::color::slateGrey},
{ "Snow", etk::color::snow},
{ "SpringGreen", etk::color::springGreen},
{ "SteelBlue", etk::color::steelBlue},
{ "Tan", etk::color::tan},
{ "Teal", etk::color::teal},
{ "Thistle", etk::color::thistle},
{ "Tomato", etk::color::tomato},
{ "Turquoise", etk::color::turquoise},
{ "Violet", etk::color::violet},
{ "Wheat", etk::color::wheat},
{ "White", etk::color::white},
{ "WhiteSmoke", etk::color::whiteSmoke},
{ "Yellow", etk::color::yellow},
{ "YellowGreen", etk::color::yellowGreen}
};
static const int32_t listOfColorSize = sizeof(listOfColor) / sizeof(colorList_ts);
etk::Color::Color(void)
{
red = 0xFF;
green = 0xFF;
blue = 0xFF;
alpha = 0xFF;
}
etk::Color::Color(const uint32_t _input)
{
red = (uint8_t)((_input&0xFF000000)>>24);
green = (uint8_t)((_input&0x00FF0000)>>16);
blue = (uint8_t)((_input&0x0000FF00)>>8);
alpha = (uint8_t)((_input&0x000000FF));
}
uint32_t etk::Color::Get(void) const
{
uint32_t directData = red<<24;
directData += green<<16;
directData += blue<<8;
directData += alpha;
return directData;
};
etk::Color::Color(const etk::Color& data)
{
if( this != &data ) {
red = data.red;
green = data.green;
blue = data.blue;
alpha = data.alpha;
}
}
etk::Color::Color(float _red, float _green, float _blue, float _alpha)
{
_red = etk_avg(0.0, _red, 1.0);
_green = etk_avg(0.0, _green, 1.0);
_blue = etk_avg(0.0, _blue, 1.0);
_alpha = etk_avg(0.0, _alpha, 1.0);
red = (uint8_t)(_red*256.0);
green = (uint8_t)(_green*256.0);
blue = (uint8_t)(_blue*256.0);
alpha = (uint8_t)(_alpha*256.0);
}
etk::Color::Color(uint8_t _red, uint8_t _green, uint8_t _blue, uint8_t _alpha)
{
red = _red;
green = _green;
blue = _blue;
alpha = _alpha;
}
etk::Color::Color(const char * _input)
{
etk::UString tmpVal = _input;
Set(tmpVal);
}
etk::Color::Color(etk::UString _input)
{
Set(_input);
}
void etk::Color::Set(etk::UString _input)
{
const char * inputData = _input.c_str();
*this = etk::color::white;
uint32_t _red, _green, _blue, _alpha;
float fred, fgreen, fblue, falpha;
size_t len = strlen(inputData);
if( len >=1
&& inputData[0] == '#') {
if(len == 4) {
if (sscanf(inputData + 1, "%1x%1x%1x", &red, &green, &blue) == 3) {
red = (red | red << 4);
green= (green | green << 4);
blue = (blue | blue << 4);
} else {
TK_ERROR(" pb in parsing the color : \"" << inputData << "\"");
}
} else if (len==5) {
if (sscanf(inputData + 1, "%1x%1x%1x%1x", &_red, &_green, &_blue, &_alpha) == 4) {
red = (_red | _red << 4);
green = (_green | _green << 4);
blue = (_blue | _blue << 4);
alpha = (_alpha | _alpha << 4);
} else {
TK_ERROR(" pb in parsing the color : \"" << inputData << "\"");
}
} else if (len == 7) {
if (sscanf(inputData + 1, "%2x%2x%2x", &_red, &_green, &_blue) == 3) {
red = _red;
green= _green;
blue = _blue;
} else {
TK_ERROR(" pb in parsing the color : \"" << inputData << "\"");
}
} else if (len == 9) {
if (sscanf(inputData + 1, "%2x%2x%2x%2x", &_red, &_green, &_blue, &_alpha) == 4) {
red = _red;
green= _green;
blue = _blue;
alpha = _alpha;
} else {
TK_ERROR(" pb in parsing the color : \"" << inputData << "\"");
}
} else {
TK_ERROR(" pb in parsing the color : \"" << inputData << "\" ==> unknown methode ...");
}
} else if( 4 <= len
&& inputData[0] == 'r'
&& inputData[1] == 'g'
&& inputData[2] == 'b'
&& inputData[3] == '(' ) {
if (sscanf(inputData + 4, "%u,%u,%u,%u", &_red, &_green, &_blue, &_alpha) == 4) {
red = etk_min(0xFF, _red);
green= etk_min(0xFF, _green);
blue = etk_min(0xFF, _blue);
alpha = etk_min(0xFF, _alpha);
} else if (sscanf(inputData + 4, "%u,%u,%u", &_red, &_green, &_blue) == 3) {
red = etk_min(0xFF, _red);
green= etk_min(0xFF, _green);
blue = etk_min(0xFF, _blue);
} else if (sscanf(inputData + 4, "%f%%,%f%%,%f%%,%f%%", &fred, &fgreen, &fblue, &falpha) == 4) {
fred = etk_avg(0.0, fred, 1.0);
fgreen= etk_avg(0.0, fgreen, 1.0);
fblue = etk_avg(0.0, fblue, 1.0);
falpha = etk_avg(0.0, falpha, 1.0);
red = (uint8_t)(fred * 255.);
green= (uint8_t)(fgreen * 255.);
blue = (uint8_t)(fblue * 255.);
alpha = (uint8_t)(falpha * 255.);
} else if (sscanf(inputData + 4, "%f%%,%f%%,%f%%", &fred, &fgreen, &fblue) == 3) {
fred = etk_avg(0.0, fred, 1.0);
fgreen= etk_avg(0.0, fgreen, 1.0);
fblue = etk_avg(0.0, fblue, 1.0);
red = (uint8_t)(fred * 255.);
green= (uint8_t)(fgreen * 255.);
blue = (uint8_t)(fblue * 255.);
} else {
TK_ERROR(" pb in parsing the color : \"" << inputData << "\" ==> unknown methode ...");
}
} else {
bool findIt = false;
// direct named color ...
for (int32_t iii=0; iii<listOfColorSize; iii++) {
if (etk::tool::strnCmpNoCase(listOfColor[iii].colorName, inputData, strlen(listOfColor[iii].colorName)) == true) {
findIt = true;
*this = listOfColor[iii].color;
// stop searching
break;
}
}
// not find color ...
if (findIt == false) {
TK_ERROR(" pb in parsing the color : \"" << inputData << "\" not find ...");
}
}
TK_VERBOSE("Parse color : \"" << inputData << "\" ==> " << *this);
}
etk::CCout& etk::operator <<(etk::CCout &os, const etk::Color &obj)
{
char tmpData[256];
snprintf(tmpData, 256, "#%02X%02X%02X%02X", obj.red, obj.green, obj.blue, obj.alpha);
os << tmpData;
return os;
}
etk::Color etk::Color::operator *(const etk::Color& _input)
{
etk::Color tmp(*this);
tmp *= _input;
return tmp;
}
etk::Color etk::Color::operator +(const etk::Color& _input)
{
etk::Color tmp(*this);
tmp += _input;
return tmp;
}
etk::Color etk::Color::operator -(const etk::Color& _input)
{
etk::Color tmp(*this);
tmp -= _input;
return tmp;
}
etk::Color& etk::Color::operator *=(const etk::Color& _input)
{
red = (int32_t)red * (int32_t)_input.red / 255;
green = (int32_t)green * (int32_t)_input.green / 255;
blue = (int32_t)blue * (int32_t)_input.blue / 255;
alpha = (int32_t)alpha * (int32_t)_input.alpha / 255;
return *this;
}
etk::Color& etk::Color::operator +=(const etk::Color& _input)
{
red = etk_min((int32_t)red + (int32_t)_input.red, 255);
green = etk_min((int32_t)green + (int32_t)_input.green, 255);
blue = etk_min((int32_t)blue + (int32_t)_input.blue, 255);
alpha = etk_min((int32_t)alpha + (int32_t)_input.alpha, 255);
return *this;
}
etk::Color& etk::Color::operator -=(const etk::Color& _input)
{
red = etk_min((int32_t)red - (int32_t)_input.red, 255);
green = etk_min((int32_t)green - (int32_t)_input.green, 255);
blue = etk_min((int32_t)blue - (int32_t)_input.blue, 255);
alpha = etk_min((int32_t)alpha - (int32_t)_input.alpha, 255);
return *this;
}
etk::Color& etk::Color::operator= (const etk::Color &_input )
{
//TK_INFO("OPERATOR de recopie");
if( this != &_input ) {
red = _input.red;
green = _input.green;
blue = _input.blue;
alpha = _input.alpha;
}
return *this;
}
etk::Color& etk::Color::operator= (const uint32_t _input )
{
red = (uint8_t)((_input&0xFF000000)>>24);
green = (uint8_t)((_input&0x00FF0000)>>16);
blue = (uint8_t)((_input&0x0000FF00)>>8);
alpha = (uint8_t)((_input&0x000000FF));
return *this;
}
bool etk::Color::operator==(const Color& _input) const
{
if( red != _input.red
|| green != _input.green
|| blue != _input.blue
|| alpha != _input.alpha ) {
return false;
}
return true;
}
bool etk::Color::operator!=(const Color& _input) const
{
if( red != _input.red
|| green != _input.green
|| blue != _input.blue
|| alpha != _input.alpha ) {
return true;
}
return false;
}

View File

@ -1,228 +0,0 @@
/**
*******************************************************************************
* @file etk/Color.h
* @brief Ewol Tool Kit : basic colors
* @author Edouard DUPIN
* @date 23/04/2012
* @par Project
* Ewol TK
*
* @par Copyright
* Copyright 2011 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
*
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __ETK_COLOR_H__
#define __ETK_COLOR_H__
#include <etk/UString.h>
#ifndef __ETK_USTRING_H__
namespace etk {
class UString;
};
#endif
namespace etk {
class Color {
public:
uint8_t red;
uint8_t green;
uint8_t blue;
uint8_t alpha;
// constructor :
Color(void);
Color(const etk::Color& data);
Color(const uint32_t data);
Color(uint8_t _red, uint8_t _green, uint8_t _blue, uint8_t _alpha = 255);
Color(float _red, float _green, float _blue, float _alpha = 1.0);
Color(etk::UString data);
Color(const char * data);
// operator :
etk::Color operator *(const etk::Color& _input);
etk::Color operator +(const etk::Color& _input);
etk::Color operator -(const etk::Color& _input);
etk::Color& operator *=(const etk::Color& _input);
etk::Color& operator +=(const etk::Color& _input);
etk::Color& operator -=(const etk::Color& _input);
etk::Color& operator=(const uint32_t _input);
etk::Color& operator=(const etk::Color& _input);
bool operator==(const etk::Color& _input) const;
bool operator!=(const etk::Color& _input) const;
// access :
void Set(etk::UString _input);
uint32_t Get(void) const;
/*****************************************************
* Cout << operator
*****************************************************/
friend etk::CCout& operator <<( etk::CCout &os,const etk::Color &obj);
};
etk::CCout& operator <<(etk::CCout &os, const etk::Color &obj);
namespace color {
extern const Color none;
extern const Color aliceBlue;
extern const Color antiqueWhite;
extern const Color aqua;
extern const Color aquamarine;
extern const Color azure;
extern const Color beige;
extern const Color bisque;
extern const Color black;
extern const Color blanchedAlmond;
extern const Color blue;
extern const Color blueViolet;
extern const Color brown;
extern const Color burlyWood;
extern const Color cadetBlue;
extern const Color chartreuse;
extern const Color chocolate;
extern const Color coral;
extern const Color cornflowerBlue;
extern const Color cornsilk;
extern const Color crimson;
extern const Color cyan;
extern const Color darkBlue;
extern const Color darkCyan;
extern const Color darkGoldenRod;
extern const Color darkGray;
extern const Color darkGrey;
extern const Color darkGreen;
extern const Color darkKhaki;
extern const Color darkMagenta;
extern const Color darkOliveGreen;
extern const Color darkorange;
extern const Color darkOrchid;
extern const Color darkRed;
extern const Color darkSalmon;
extern const Color darkSeaGreen;
extern const Color darkSlateBlue;
extern const Color darkSlateGray;
extern const Color darkSlateGrey;
extern const Color darkTurquoise;
extern const Color darkViolet;
extern const Color deepPink;
extern const Color deepSkyBlue;
extern const Color dimGray;
extern const Color dimGrey;
extern const Color dodgerBlue;
extern const Color fireBrick;
extern const Color floralWhite;
extern const Color forestGreen;
extern const Color fuchsia;
extern const Color gainsboro;
extern const Color ghostWhite;
extern const Color gold;
extern const Color goldenRod;
extern const Color gray;
extern const Color grey;
extern const Color green;
extern const Color greenYellow;
extern const Color honeyDew;
extern const Color hotPink;
extern const Color indianRed;
extern const Color indigo;
extern const Color ivory;
extern const Color khaki;
extern const Color lavender;
extern const Color lavenderBlush;
extern const Color lawnGreen;
extern const Color lemonChiffon;
extern const Color lightBlue;
extern const Color lightCoral;
extern const Color lightCyan;
extern const Color lightGoldenRodYellow;
extern const Color lightGray;
extern const Color lightGrey;
extern const Color lightGreen;
extern const Color lightPink;
extern const Color lightSalmon;
extern const Color lightSeaGreen;
extern const Color lightSkyBlue;
extern const Color lightSlateGray;
extern const Color lightSlateGrey;
extern const Color lightSteelBlue;
extern const Color lightYellow;
extern const Color lime;
extern const Color limeGreen;
extern const Color linen;
extern const Color magenta;
extern const Color maroon;
extern const Color mediumAquaMarine;
extern const Color mediumBlue;
extern const Color mediumOrchid;
extern const Color mediumPurple;
extern const Color mediumSeaGreen;
extern const Color mediumSlateBlue;
extern const Color mediumSpringGreen;
extern const Color mediumTurquoise;
extern const Color mediumVioletRed;
extern const Color midnightBlue;
extern const Color mintCream;
extern const Color mistyRose;
extern const Color moccasin;
extern const Color navajoWhite;
extern const Color navy;
extern const Color oldLace;
extern const Color olive;
extern const Color oliveDrab;
extern const Color orange;
extern const Color orangeRed;
extern const Color orchid;
extern const Color paleGoldenRod;
extern const Color paleGreen;
extern const Color paleTurquoise;
extern const Color paleVioletRed;
extern const Color papayaWhip;
extern const Color peachPuff;
extern const Color peru;
extern const Color pink;
extern const Color plum;
extern const Color powderBlue;
extern const Color purple;
extern const Color red;
extern const Color rosyBrown;
extern const Color royalBlue;
extern const Color saddleBrown;
extern const Color salmon;
extern const Color sandyBrown;
extern const Color seaGreen;
extern const Color seaShell;
extern const Color sienna;
extern const Color silver;
extern const Color skyBlue;
extern const Color slateBlue;
extern const Color slateGray;
extern const Color slateGrey;
extern const Color snow;
extern const Color springGreen;
extern const Color steelBlue;
extern const Color tan;
extern const Color teal;
extern const Color thistle;
extern const Color tomato;
extern const Color turquoise;
extern const Color violet;
extern const Color wheat;
extern const Color white;
extern const Color whiteSmoke;
extern const Color yellow;
extern const Color yellowGreen;
};
};
#endif

View File

@ -325,6 +325,26 @@ namespace etk
return m_size; return m_size;
} }
/**
* @brief Get the number of element in the vector
* @return The number requested
*/
void ReSize(int32_t newSize, MY_TYPE& basicElement)
{
int32_t idx = m_size;
Resize(newSize);
if (m_size != newSize) {
TK_CRITICAL("error to resize vector");
return;
}
if (newSize > idx) {
// initialize data ...
for(int32_t iii=idx; iii<newSize; iii++) {
m_data[iii] = basicElement;
}
}
}
/** /**
* @brief Get the Allocated size in the vector * @brief Get the Allocated size in the vector
* @return The size of allocation * @return The size of allocation

View File

@ -10,7 +10,6 @@ FILE_LIST = \
etk/Stream.cpp \ etk/Stream.cpp \
etk/File.cpp \ etk/File.cpp \
etk/RegExp.cpp \ etk/RegExp.cpp \
etk/Color.cpp \
etk/tool.cpp etk/tool.cpp
ifeq ("$(TARGET_OS)","Windows") ifeq ("$(TARGET_OS)","Windows")

View File

@ -298,7 +298,7 @@ void ewol::OObject2DColored::GenerateTriangle(void)
} }
void ewol::OObject2DColored::SetColor(etk::Color color) void ewol::OObject2DColored::SetColor(draw::Color color)
{ {
if (m_triElement < 1) { if (m_triElement < 1) {
m_color[0] = color; m_color[0] = color;
@ -315,13 +315,13 @@ void ewol::OObject2DColored::SetColor(etk::Color color)
void ewol::OObject2DColored::SetColor(float red, float green, float blue, float alpha) void ewol::OObject2DColored::SetColor(float red, float green, float blue, float alpha)
{ {
if (m_triElement < 1) { if (m_triElement < 1) {
m_color[0] = etk::Color(red, green, blue, alpha); m_color[0] = draw::Color(red, green, blue, alpha);
} }
if (m_triElement < 2) { if (m_triElement < 2) {
m_color[1] = etk::Color(red, green, blue, alpha); m_color[1] = draw::Color(red, green, blue, alpha);
} }
if (m_triElement < 3) { if (m_triElement < 3) {
m_color[2] = etk::Color(red, green, blue, alpha); m_color[2] = draw::Color(red, green, blue, alpha);
} }
} }

View File

@ -37,17 +37,17 @@ namespace ewol {
virtual void Draw(void); virtual void Draw(void);
protected: protected:
etk::Vector<Vector2D<float> > m_coord; //!< internal coord of the object etk::Vector<Vector2D<float> > m_coord; //!< internal coord of the object
etk::Vector<etk::Color> m_coordColor; //!< internal color of the different point etk::Vector<draw::Color> m_coordColor; //!< internal color of the different point
//etk::Vector<linkCoord_ts> m_linkCoord; //!< internal link between point to generate triangle //etk::Vector<linkCoord_ts> m_linkCoord; //!< internal link between point to generate triangle
int32_t m_triElement; int32_t m_triElement;
etk::Color m_color[3]; draw::Color m_color[3];
Vector2D<float> m_triangle[3]; Vector2D<float> m_triangle[3];
void GenerateTriangle(void); void GenerateTriangle(void);
void ResetCount(void); void ResetCount(void);
public: public:
void Clear(void); void Clear(void);
void SetColor(float red, float green, float blue, float alpha = 1.0); void SetColor(float red, float green, float blue, float alpha = 1.0);
void SetColor(etk::Color color); void SetColor(draw::Color color);
void SetPoint(Vector2D<float> point); void SetPoint(Vector2D<float> point);
void SetPoint(float x, float y); void SetPoint(float x, float y);
void Line(float sx, float sy, float ex, float ey, float thickness); void Line(float sx, float sy, float ex, float ey, float thickness);

View File

@ -29,7 +29,7 @@
#undef __class__ #undef __class__
#define __class__ "ewol::OObject2DText" #define __class__ "ewol::OObject2DText"
ewol::OObject2DText::OObject2DText(etk::UString FontName, int32_t size, etk::Color textColorFg) ewol::OObject2DText::OObject2DText(etk::UString FontName, int32_t size, draw::Color textColorFg)
{ {
m_textColorFg = textColorFg; m_textColorFg = textColorFg;
if (FontName == "") { if (FontName == "") {
@ -60,7 +60,7 @@ void ewol::OObject2DText::Draw(void)
//EWOL_WARNING("Nothink to draw..."); //EWOL_WARNING("Nothink to draw...");
return; return;
} }
glColor4ub(m_textColorFg.red, m_textColorFg.green, m_textColorFg.blue, m_textColorFg.alpha); glColor4ub(m_textColorFg.r, m_textColorFg.g, m_textColorFg.b, m_textColorFg.a);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, ewol::texture::GetGLID(m_FontTextureId)); glBindTexture(GL_TEXTURE_2D, ewol::texture::GetGLID(m_FontTextureId));
glEnableClientState( GL_VERTEX_ARRAY ); // Enable Vertex Arrays glEnableClientState( GL_VERTEX_ARRAY ); // Enable Vertex Arrays

View File

@ -32,7 +32,7 @@ namespace ewol {
class OObject2DText :public ewol::OObject class OObject2DText :public ewol::OObject
{ {
public: public:
OObject2DText(etk::UString FontName, int32_t size, etk::Color textColorFg); OObject2DText(etk::UString FontName, int32_t size, draw::Color textColorFg);
OObject2DText(void); OObject2DText(void);
virtual ~OObject2DText(void); virtual ~OObject2DText(void);
public: public:
@ -43,10 +43,10 @@ namespace ewol {
int32_t Text(Vector2D<float> textPos, clipping_ts drawClipping, const uniChar_t unicodeChar); int32_t Text(Vector2D<float> textPos, clipping_ts drawClipping, const uniChar_t unicodeChar);
protected: protected:
int32_t m_FontId; //!< font internal ID int32_t m_FontId; //!< font internal ID
etk::Color m_textColorFg; //!< text color ... draw::Color m_textColorFg; //!< text color ...
int32_t m_FontTextureId; //!< font internal Texture ID int32_t m_FontTextureId; //!< font internal Texture ID
etk::Vector<Vector2D<float> > m_coord; //!< internal coord of the object etk::Vector<Vector2D<float> > m_coord; //!< internal coord of the object
etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point
}; };
}; };

View File

@ -31,7 +31,7 @@
ewol::OObject2DTextColored::OObject2DTextColored(etk::UString FontName, int32_t size) ewol::OObject2DTextColored::OObject2DTextColored(etk::UString FontName, int32_t size)
{ {
m_color = etk::color::black; m_color = draw::color::black;
if (FontName == "") { if (FontName == "") {
m_FontId = GetDefaultFontId(); m_FontId = GetDefaultFontId();
} else { } else {
@ -48,7 +48,7 @@ ewol::OObject2DTextColored::OObject2DTextColored(etk::UString FontName, int32_t
ewol::OObject2DTextColored::OObject2DTextColored(int32_t fontID) ewol::OObject2DTextColored::OObject2DTextColored(int32_t fontID)
{ {
m_color = etk::color::black; m_color = draw::color::black;
if (fontID < 0) { if (fontID < 0) {
m_FontId = GetDefaultFontId(); m_FontId = GetDefaultFontId();
} else { } else {
@ -60,7 +60,7 @@ ewol::OObject2DTextColored::OObject2DTextColored(int32_t fontID)
// open with default font ... // open with default font ...
ewol::OObject2DTextColored::OObject2DTextColored(void) ewol::OObject2DTextColored::OObject2DTextColored(void)
{ {
m_color = etk::color::black; m_color = draw::color::black;
m_FontId = GetDefaultFontId(); m_FontId = GetDefaultFontId();
} }
@ -140,7 +140,7 @@ int32_t ewol::OObject2DTextColored::Text(Vector2D<float> textPos, const uniChar_
} }
void ewol::OObject2DTextColored::SetColor(etk::Color color) void ewol::OObject2DTextColored::SetColor(draw::Color color)
{ {
m_color = color; m_color = color;
} }
@ -148,7 +148,7 @@ void ewol::OObject2DTextColored::SetColor(etk::Color color)
void ewol::OObject2DTextColored::SetColor(float red, float green, float blue, float alpha) void ewol::OObject2DTextColored::SetColor(float red, float green, float blue, float alpha)
{ {
m_color = etk::Color(red, green, blue, alpha); m_color = draw::Color(red, green, blue, alpha);
} }

View File

@ -38,18 +38,18 @@ namespace ewol {
public: public:
virtual void Draw(void); virtual void Draw(void);
void SetColor(float red, float green, float blue, float alpha = 1.0); void SetColor(float red, float green, float blue, float alpha = 1.0);
void SetColor(etk::Color color); void SetColor(draw::Color color);
// set a specific text // set a specific text
void Clear(void); void Clear(void);
int32_t Text(Vector2D<float> textPos, const etk::UString& unicodeString); int32_t Text(Vector2D<float> textPos, const etk::UString& unicodeString);
int32_t Text(Vector2D<float> textPos, const uniChar_t unicodeChar); int32_t Text(Vector2D<float> textPos, const uniChar_t unicodeChar);
protected: protected:
int32_t m_FontId; //!< font internal ID int32_t m_FontId; //!< font internal ID
etk::Color m_color; //!< tmp text color ... draw::Color m_color; //!< tmp text color ...
int32_t m_FontTextureId; //!< font internal Texture ID int32_t m_FontTextureId; //!< font internal Texture ID
etk::Vector<Vector2D<float> > m_coord; //!< internal coord of the object etk::Vector<Vector2D<float> > m_coord; //!< internal coord of the object
etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point
etk::Vector<etk::Color> m_coordColor; //!< internal color of the different point etk::Vector<draw::Color> m_coordColor; //!< internal color of the different point
public: public:
void SetFontID(int32_t fontID) { m_FontId = fontID; }; void SetFontID(int32_t fontID) { m_FontId = fontID; };
int32_t GetFontID(void) { return m_FontId; }; int32_t GetFontID(void) { return m_FontId; };

View File

@ -84,12 +84,12 @@ void ewol::OObject2DTextured::Clear(void)
m_coordColor.Clear(); m_coordColor.Clear();
} }
void ewol::OObject2DTextured::Rectangle(float x, float y, float w, float h, etk::Color tmpColor) void ewol::OObject2DTextured::Rectangle(float x, float y, float w, float h, draw::Color tmpColor)
{ {
Rectangle(x, y, w, h, 0.0, 0.0, 1.0, 1.0, tmpColor); Rectangle(x, y, w, h, 0.0, 0.0, 1.0, 1.0, tmpColor);
} }
void ewol::OObject2DTextured::Rectangle(float x, float y, float w, float h, float texX, float texY, float texSX, float texSY, etk::Color tmpColor) void ewol::OObject2DTextured::Rectangle(float x, float y, float w, float h, float texX, float texY, float texSX, float texSY, draw::Color tmpColor)
{ {
//EWOL_DEBUG("Add rectangle : ..."); //EWOL_DEBUG("Add rectangle : ...");
Vector2D<float> point; Vector2D<float> point;

View File

@ -37,13 +37,13 @@ namespace ewol {
public: public:
virtual void Draw(void); virtual void Draw(void);
void Clear(void); void Clear(void);
void Rectangle(float x, float y, float w, float h, float texX=0.0, float texY=0.0, float texSX=1.0, float texSY=1.0, etk::Color tmpColor=etk::color::white); void Rectangle(float x, float y, float w, float h, float texX=0.0, float texY=0.0, float texSX=1.0, float texSY=1.0, draw::Color tmpColor=draw::color::white);
void Rectangle(float x, float y, float w, float h, etk::Color tmpColor); void Rectangle(float x, float y, float w, float h, draw::Color tmpColor);
protected: protected:
int32_t m_textureId; //!< texture internal ID int32_t m_textureId; //!< texture internal ID
etk::Vector<Vector2D<float> > m_coord; //!< internal coord of the object etk::Vector<Vector2D<float> > m_coord; //!< internal coord of the object
etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point
etk::Vector<etk::Color> m_coordColor; //!< internal color of the different point etk::Vector<draw::Color> m_coordColor; //!< internal color of the different point
}; };
}; };

View File

@ -26,7 +26,7 @@
#define __EWOL_O_OBJECT_H__ #define __EWOL_O_OBJECT_H__
#include <etk/Types.h> #include <etk/Types.h>
#include <etk/Color.h> #include <draw/Color.h>
#include <etk/File.h> #include <etk/File.h>
#include <ewol/Debug.h> #include <ewol/Debug.h>
#include <ewol/font/Font.h> #include <ewol/font/Font.h>

View File

@ -90,7 +90,7 @@ void ewol::Sprite::Clear(void)
void ewol::Sprite::Element(Vector2D<float> pos, float size, float angle) void ewol::Sprite::Element(Vector2D<float> pos, float size, float angle)
{ {
etk::Color tmpColor(0xFFFFFFFF); draw::Color tmpColor(0xFFFFFFFF);
Vector3D<float> pos2; Vector3D<float> pos2;
pos2.x = pos.x; pos2.x = pos.x;
pos2.y = pos.y; pos2.y = pos.y;
@ -100,11 +100,11 @@ void ewol::Sprite::Element(Vector2D<float> pos, float size, float angle)
void ewol::Sprite::Element(Vector3D<float> pos, float size, float angle) void ewol::Sprite::Element(Vector3D<float> pos, float size, float angle)
{ {
etk::Color tmpColor(0xFFFFFFFF); draw::Color tmpColor(0xFFFFFFFF);
Element(pos, size, angle, tmpColor); Element(pos, size, angle, tmpColor);
} }
void ewol::Sprite::Element(Vector2D<float> pos, float size, float angle, etk::Color tmpColor) void ewol::Sprite::Element(Vector2D<float> pos, float size, float angle, draw::Color tmpColor)
{ {
Vector3D<float> pos2; Vector3D<float> pos2;
pos2.x = pos.x; pos2.x = pos.x;
@ -114,7 +114,7 @@ void ewol::Sprite::Element(Vector2D<float> pos, float size, float angle, etk::Co
} }
void ewol::Sprite::Element(Vector3D<float> pos, float size, float angle, etk::Color tmpColor) void ewol::Sprite::Element(Vector3D<float> pos, float size, float angle, draw::Color tmpColor)
{ {
angle -= M_PI/4; angle -= M_PI/4;
size *= 0.7; size *= 0.7;

View File

@ -40,14 +40,14 @@ namespace ewol {
void Clear(void); void Clear(void);
void Element(Vector2D<float> pos, float size, float angle); void Element(Vector2D<float> pos, float size, float angle);
void Element(Vector3D<float> pos, float size, float angle); void Element(Vector3D<float> pos, float size, float angle);
void Element(Vector2D<float> pos, float size, float angle, etk::Color tmpColor); void Element(Vector2D<float> pos, float size, float angle, draw::Color tmpColor);
void Element(Vector3D<float> pos, float size, float angle, etk::Color tmpColor); void Element(Vector3D<float> pos, float size, float angle, draw::Color tmpColor);
bool HasName(etk::UString& name) { return name == m_name; }; bool HasName(etk::UString& name) { return name == m_name; };
protected: protected:
int32_t m_textureId; //!< texture internal ID int32_t m_textureId; //!< texture internal ID
etk::Vector<Vector3D<float> > m_coord; //!< internal coord of the object etk::Vector<Vector3D<float> > m_coord; //!< internal coord of the object
etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point etk::Vector<texCoord_ts> m_coordTex; //!< internal texture coordinate for every point
etk::Vector<etk::Color> m_coordColor; //!< internal color of the different point etk::Vector<draw::Color> m_coordColor; //!< internal color of the different point
}; };
}; };

View File

@ -30,7 +30,7 @@
#include <etk/MessageFifo.h> #include <etk/MessageFifo.h>
#include <ewol/os/eSystem.h> #include <ewol/os/eSystem.h>
#include <ewol/os/gui.h> #include <ewol/os/gui.h>
#include <ewol/texture/Texture.h> #include <ewol/texture/TextureManager.h>
#include <ewol/eObject/EObject.h> #include <ewol/eObject/EObject.h>
#include <ewol/eObject/EObjectManager.h> #include <ewol/eObject/EObjectManager.h>
#include <ewol/widget/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
@ -242,8 +242,8 @@ void eSystem::Init(void)
ewol::EObjectManager::Init(); ewol::EObjectManager::Init();
ewol::EObjectMessageMultiCast::Init(); ewol::EObjectMessageMultiCast::Init();
l_managementInput.Reset(); l_managementInput.Reset();
ewol::textureManager::Init();
ewol::widgetManager::Init(); ewol::widgetManager::Init();
ewol::texture::Init();
ewol::InitFont(); ewol::InitFont();
ewol::shortCut::Init(); ewol::shortCut::Init();
APP_Init(); APP_Init();
@ -265,11 +265,11 @@ void eSystem::UnInit(void)
// call application to uninit // call application to uninit
APP_UnInit(); APP_UnInit();
ewol::shortCut::UnInit(); ewol::shortCut::UnInit();
ewol::texture::UnInit();
ewol::UnInitFont(); ewol::UnInitFont();
ewol::widgetManager::UnInit(); ewol::widgetManager::UnInit();
ewol::EObjectMessageMultiCast::UnInit(); ewol::EObjectMessageMultiCast::UnInit();
ewol::EObjectManager::UnInit(); ewol::EObjectManager::UnInit();
ewol::textureManager::UnInit();
l_managementInput.Reset(); l_managementInput.Reset();
l_msgSystem.Clean(); l_msgSystem.Clean();
} }
@ -542,7 +542,7 @@ bool eSystem::Draw(bool displayEveryTime)
// check if the regenerate is needed ... // check if the regenerate is needed ...
if( true == ewol::widgetManager::IsDrawingNeeded() if( true == ewol::widgetManager::IsDrawingNeeded()
|| true == displayEveryTime) { || true == displayEveryTime) {
ewol::texture::UpdateContext(); ewol::textureManager::UpdateContext();
l_FpsSystem.IncrementCounter(); l_FpsSystem.IncrementCounter();
tmpWindows->SysDraw(); tmpWindows->SysDraw();
} }
@ -583,7 +583,7 @@ void eSystem::ResetIOEvent(void)
*/ */
void eSystem::OpenGlContextDestroy(void) void eSystem::OpenGlContextDestroy(void)
{ {
ewol::texture::UpdateContextIsDestroy(); ewol::textureManager::OpenGlContextHasBeenDestroyed();
} }

View File

@ -30,8 +30,7 @@
#include <ewol/widget/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
#include <ewol/os/gui.h> #include <ewol/os/gui.h>
#include <ewol/texture/Texture.h> #include <ewol/texture/TextureManager.h>
#include <ewol/texture/TextureBMP.h>
#include <ewol/os/eSystem.h> #include <ewol/os/eSystem.h>
#include <unistd.h> #include <unistd.h>

View File

@ -27,210 +27,7 @@
#include <ewol/texture/Texture.h> #include <ewol/texture/Texture.h>
#include <ewol/openGl.h> #include <ewol/openGl.h>
#include <ewol/ewol.h> #include <ewol/ewol.h>
#include <ewol/texture/TextureBMP.h>
#include <ewol/texture/TextureSVG.h>
#include <ewol/texture/TexturePNG.h>
//! One Texture element
class LoadedTexture
{
public:
etk::UString m_filename;
int32_t m_nbTimeLoaded;
// openGl configuration :
uint32_t m_openGlTextureID;
int32_t m_target;
int32_t m_level;
int32_t m_internalFormat;
int32_t m_width;
int32_t m_height;
int32_t m_border;
int32_t m_format;
int32_t m_type;
char* m_data;
int32_t m_nbBytes;
bool m_loaded;
bool m_destroy;
};
//! List of all Texture loaded ...
etk::Vector<LoadedTexture*> l_listLoadedTexture;
#undef __class__
#define __class__ "texture"
/**
* @brief Initialise the texture namespace (init a mutex)
* @param ---
* @return ---
*/
void ewol::texture::Init(void)
{
EWOL_DEBUG("==> Init Texture-Manager");
}
/**
* @brief Un-Initialise the Texture namespace (Remove all loaded texture and temporary data and remove Mutex)
* @param ---
* @return ---
*/
void ewol::texture::UnInit(void)
{
EWOL_DEBUG("==> Un-Init Texture-Manager");
for (int32_t iii=0; iii<l_listLoadedTexture.Size(); iii++) {
if (l_listLoadedTexture[iii] != NULL) {
delete(l_listLoadedTexture[iii]);
}
l_listLoadedTexture[iii] = NULL;
}
l_listLoadedTexture.Clear();
}
/**
* @brief Specific for Android, some configuration restart openGl context when the screen is rotate, then,
* Android inform us that the openGl context has been destroy. We mark all the texture like not loaded
* To load it again when a new context will be enable (@ref UpdateContext)
* @param ---
* @return ---
*/
void ewol::texture::UpdateContextIsDestroy(void)
{
for (int32_t iii=0; iii < l_listLoadedTexture.Size(); iii++) {
if( NULL != l_listLoadedTexture[iii]
&& NULL != l_listLoadedTexture[iii]->m_data)
{
l_listLoadedTexture[iii]->m_loaded = false;
EWOL_INFO("TEXTURE: Disable [" << iii << "]=(" << l_listLoadedTexture[iii]->m_width << "px," <<
l_listLoadedTexture[iii]->m_height << "px) in file:" <<
l_listLoadedTexture[iii]->m_filename << " OGl_Id=" <<l_listLoadedTexture[iii]->m_openGlTextureID);
// note : the context might be destroy... we can not remove the textures ...
//glDeleteTextures(1, &l_listLoadedTexture[iii]->m_openGlTextureID);
}
}
}
/**
* @brief Check all texture and load/Remove/Reload all texture that has been Add/Remove/Change from the previous display cycle
* @param ---
* @return ---
*/
void ewol::texture::UpdateContext(void)
{
bool needRedraw = false;
for (int32_t iii=0; iii < l_listLoadedTexture.Size(); iii++) {
if( NULL != l_listLoadedTexture[iii]
&& NULL != l_listLoadedTexture[iii]->m_data)
{
if( false == l_listLoadedTexture[iii]->m_destroy
&& false == l_listLoadedTexture[iii]->m_loaded)
{
GLuint textureid;
glGenTextures(1, &textureid);
glBindTexture(l_listLoadedTexture[iii]->m_target, textureid);
//glTexParameteri(tmpTex->m_target, GL_TEXTURE_WRAP_S, GL_REPEAT);
//glTexParameteri(tmpTex->m_target, GL_TEXTURE_WRAP_T, GL_REPEAT);
//--- mode nearest
//glTexParameteri(tmpTex->m_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
//glTexParameteri(tmpTex->m_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
//--- Mode linear
glTexParameteri(l_listLoadedTexture[iii]->m_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(l_listLoadedTexture[iii]->m_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
EWOL_INFO("TEXTURE: Add [" << iii << "]=(" << l_listLoadedTexture[iii]->m_width << "px," <<
l_listLoadedTexture[iii]->m_height << "px) in file:" <<
l_listLoadedTexture[iii]->m_filename << " OGl_Id=" <<textureid);
glTexImage2D(l_listLoadedTexture[iii]->m_target,
l_listLoadedTexture[iii]->m_level,
l_listLoadedTexture[iii]->m_internalFormat,
l_listLoadedTexture[iii]->m_width,
l_listLoadedTexture[iii]->m_height,
l_listLoadedTexture[iii]->m_border,
l_listLoadedTexture[iii]->m_format,
l_listLoadedTexture[iii]->m_type,
l_listLoadedTexture[iii]->m_data);
l_listLoadedTexture[iii]->m_openGlTextureID = textureid;
l_listLoadedTexture[iii]->m_loaded = true;
needRedraw = true;
} else if ( true == l_listLoadedTexture[iii]->m_destroy
&& true == l_listLoadedTexture[iii]->m_loaded)
{
// Request remove texture ...
EWOL_INFO("TEXTURE: Rm [" << iii << "] file:" << l_listLoadedTexture[iii]->m_filename);
glDeleteTextures(1, &l_listLoadedTexture[iii]->m_openGlTextureID);
l_listLoadedTexture[iii]->m_loaded = false;
l_listLoadedTexture[iii]->m_openGlTextureID = -1;
if (NULL != l_listLoadedTexture[iii]->m_data) {
delete[] l_listLoadedTexture[iii]->m_data;
l_listLoadedTexture[iii]->m_data = NULL;
}
delete(l_listLoadedTexture[iii]);
l_listLoadedTexture[iii] = NULL;
}
}
}
if (true == needRedraw) {
ewol::ForceRedrawAll();
}
}
/**
* @brief Register a texture in the automatic system to load and reload
* @param[in] target Standard element of OpenGL target
* @param[in] level Standard element of OpenGL level
* @param[in] internalFormat Standard element of OpenGL internalFormat
* @param[in] width Standard element of OpenGL width
* @param[in] height Standard element of OpenGL height
* @param[in] border Standard element of OpenGL border
* @param[in] format Standard element of OpenGL format
* @param[in] type Standard element of OpenGL type
* @param[in] data Pointer on the buffer where are contain the data (a copy is done automaticly)
* @param[in] nbBytes Number of byte in the buffer
* @param[in] filename File Name of the texture or "---" if it is an internal loaded texture
* @return The Internal ID of the texture, or -1 if an error occured ...
*/
int32_t ewol::texture::Load(int32_t target, int32_t level, int32_t internalFormat, int32_t width, int32_t height,
int32_t border, int32_t format, int32_t type,
const void* data, int32_t nbBytes, etk::UString filename)
{
LoadedTexture *tmpTex = new LoadedTexture();
int32_t outTextureID = -1;
if (NULL == tmpTex){
EWOL_ERROR("Texture : Allocation ERROR... " << filename);
return -1;
}
if (NULL == data){
EWOL_ERROR("Texture : Input pointer of the data texture =NULL... " << filename);
return -1;
}
tmpTex->m_filename = filename;
tmpTex->m_nbTimeLoaded = 1;
tmpTex->m_openGlTextureID = -1;
tmpTex->m_target = target;
tmpTex->m_level = level;
tmpTex->m_internalFormat = internalFormat;
tmpTex->m_width = width;
tmpTex->m_height = height;
tmpTex->m_border = border;
tmpTex->m_format = format;
tmpTex->m_type = type;
tmpTex->m_nbBytes = nbBytes;
tmpTex->m_data = new char[tmpTex->m_nbBytes+4096];
tmpTex->m_loaded = false;
tmpTex->m_destroy = false;
if (NULL == tmpTex->m_data) {
EWOL_ERROR("Texture : Data Allocation ERROR... " << filename);
return -1;
}
memcpy(tmpTex->m_data, data, sizeof(char) * tmpTex->m_nbBytes);
l_listLoadedTexture.PushBack(tmpTex);
outTextureID = l_listLoadedTexture.Size()-1;
return outTextureID;
}
/** /**
@ -252,6 +49,96 @@ static int32_t nextP2(int32_t value)
} }
ewol::Texture::Texture(void)
{
// add it to the texture manager
m_uniqueId = ewol::textureManager::Add(this);
m_loaded = false;
m_texId = 0;
m_endPointSize.x = 1.0;
m_endPointSize.y = 1.0;
}
ewol::Texture::~Texture(void)
{
// unregister from the texture manager
ewol::textureManager::Rm(this);
RemoveContext();
}
void ewol::Texture::UpdateContext(void)
{
if (false == m_loaded) {
// Request a new texture at OpenGl :
glGenTextures(1, &m_texId);
// TODO : check error ???
glBindTexture(GL_TEXTURE_2D, m_texId);
// TODO : Check error ???
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
//--- mode nearest
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
//--- Mode linear
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
EWOL_INFO("TEXTURE: Add [" << m_uniqueId << "]=" << m_data.GetSize() << " OGl_Id=" <<m_texId);
glTexImage2D(GL_TEXTURE_2D, // Target
0, // Level
GL_RGBA, // Format internal
m_data.GetWidth(),
m_data.GetHeight(),
0, // Border
GL_RGBA, // format
GL_UNSIGNED_BYTE, // type
m_data.GetTextureDataPointer() );
// now the data is loaded
m_loaded = true;
} else {
EWOL_TODO("UPDATE Texture ...")
}
}
// really remove the texture
void ewol::Texture::RemoveContext(void)
{
if (true == m_loaded) {
// Request remove texture ...
EWOL_INFO("TEXTURE: Rm [" << m_uniqueId << "] texId=" << m_texId);
glDeleteTextures(1, &m_texId);
m_loaded = false;
}
}
// the OpenGl context is destroy, it is too late to remo it from nothing ... special case for Android
void ewol::Texture::RemoveContextToLate(void)
{
m_loaded = false;
}
void ewol::Texture::Flush(void)
{
// request to the manager to be call at the next update ...
ewol::textureManager::Update(this);
}
/*
#include <ewol/texture/TextureBMP.h>
#include <ewol/texture/TextureSVG.h>
#include <ewol/texture/TexturePNG.h>
*/
/** /**
* @brief Load a specific file texture * @brief Load a specific file texture
* @note : dimention must be a power of 2, otherwise, the display can be wrong... For the SVG, the texture automaticly generate the power of 2 dimention ... * @note : dimention must be a power of 2, otherwise, the display can be wrong... For the SVG, the texture automaticly generate the power of 2 dimention ...
@ -261,6 +148,7 @@ static int32_t nextP2(int32_t value)
*/ */
// TODO : Load non square texture ... // TODO : Load non square texture ...
// TODO : Check the size to regenerate the texture if the size change // TODO : Check the size to regenerate the texture if the size change
#if 0
int32_t ewol::texture::Load(etk::UString tmpfileName, int32_t requestedWidth) int32_t ewol::texture::Load(etk::UString tmpfileName, int32_t requestedWidth)
{ {
int32_t outTextureID = -1; int32_t outTextureID = -1;
@ -328,67 +216,4 @@ int32_t ewol::texture::Load(etk::UString tmpfileName, int32_t requestedWidth)
} }
return outTextureID; return outTextureID;
} }
#endif
/**
* @brief Remove a specific texture ID from the system
* @note A texture can be loaded as many time we want, the texture will be destroy only when nobody want the texture anymore
* @param[in] textureID The internal texture ID that might be remove
* @return ---
*/
void ewol::texture::UnLoad(uint32_t textureID)
{
//EWOL_INFO("Unload a specific tecture ID=" << textureID);
if ((int32_t)textureID<l_listLoadedTexture.Size()) {
if (NULL == l_listLoadedTexture[textureID]) {
EWOL_ERROR("Texture : " << textureID << " does not existe anymore...");
return;
}
l_listLoadedTexture[textureID]->m_nbTimeLoaded--;
if (0 == l_listLoadedTexture[textureID]->m_nbTimeLoaded) {
EWOL_DEBUG("Remove openGL texture ID=" << textureID << " file:" << l_listLoadedTexture[textureID]->m_filename);
l_listLoadedTexture[textureID]->m_destroy = true;
}
return;
}
EWOL_CRITICAL("Can not find TextureId=" << (int)textureID << " in the list of texture loaded...==> to remove it ...");
}
/**
* @brief Get the openGL texture ID whith the internal ID
* @param textureID the internal texture ID
* @return the OpenGl texture ID (or 0 if an error occured...)
*/
uint32_t ewol::texture::GetGLID(uint32_t textureID)
{
if ((int32_t)textureID<l_listLoadedTexture.Size()) {
if (l_listLoadedTexture[textureID]!=NULL) {
return l_listLoadedTexture[textureID]->m_openGlTextureID;
} else {
EWOL_ERROR("Texture has been removed previously : " << textureID);
}
}
return 0;
}
/**
* @brief Get the size of the specific texture
* @param[in] textureID the internal texture ID
* @return the width of the texture
*/
int32_t ewol::texture::GetSize(uint32_t textureID)
{
for (int32_t iii=0; iii<l_listLoadedTexture.Size(); iii++) {
if (l_listLoadedTexture[textureID]!=NULL) {
if (l_listLoadedTexture[iii]->m_openGlTextureID == textureID) {
return l_listLoadedTexture[iii]->m_width;
}
} else {
EWOL_ERROR("Texture has been removed previously : " << textureID);
}
}
EWOL_ERROR("Can not find TextureId=" << textureID << " in the list of texture loaded...");
return -1;
}

View File

@ -27,22 +27,40 @@
#include <etk/Types.h> #include <etk/Types.h>
#include <ewol/Debug.h> #include <ewol/Debug.h>
#include <etk/File.h> #include <draw/Image.h>
#include <ewol/openGl.h>
namespace ewol namespace ewol {
{ class Texture {
namespace texture { private:
void Init(void); uint32_t m_uniqueId;
void UnInit(void); // openGl Context propoerties :
int32_t Load(etk::UString fileName, int32_t requestedWidth=-1); draw::Image m_data;
int32_t Load(int32_t target, int32_t level, int32_t internalFormat, int32_t width, int32_t height, int32_t border, int32_t format, int32_t type, const void* data, int32_t nbBytes, etk::UString filename); // OpenGl textureID :
void UnLoad(uint32_t textureID); GLuint m_texId;
int32_t GetSize(uint32_t textureID); // some image are not square ==> we need to sqared it to prevent some openGl api error the the displayable size is not all the time 0.0 -> 1.0
uint32_t GetGLID(uint32_t textureID); Vector2D<float> m_endPointSize;
void UpdateContext(void); // internal state of the openGl system :
void UpdateContextIsDestroy(void); bool m_loaded;
void OGLContext(bool enable); // Ewol internal API:
public:
void UpdateContext(void);
void RemoveContext(void);
void RemoveContextToLate(void);
// middleware interface:
public:
GLuint GetId(void) { return m_texId; };
Vector2D<float> GetUsableSize(void) { return m_endPointSize; };
// Public API:
public:
Texture(void);
~Texture(void);
// get the reference on this image to draw nomething on it ...
inline draw::Image& Get(void) { return m_data; };
// Flush the data to send it at the OpenGl system
void Flush(void);
}; };
}; };
#endif #endif

View File

@ -0,0 +1,158 @@
/**
*******************************************************************************
* @file ewol/texture/textureManager.cpp
* @brief ewol Texture manager system (Sources)
* @author Edouard DUPIN
* @date 21/08/2012
* @par Project
* ewol
*
* @par Copyright
* Copyright 2011 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
*
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __EWOL_TEXTURE_MANAGER_H__
#define __EWOL_TEXTURE_MANAGER_H__
#include <etk/Types.h>
#include <ewol/Debug.h>
#include <etk/File.h>
#include <etk/Vector.h>
#include <ewol/texture/TextureManager.h>
static etk::Vector<ewol::Texture *object> l_textureList;
static etk::Vector<ewol::Texture *object> l_textureListToUpdate;
static uint32_t l_uniqueIdTexture = 0;
static bool l_contextHasBeenRemoved = true;
void ewol::textureManager::Init(void)
{
// nothing to do in théory then, we clean the buffers :
// NOTE : If we do domething here, then the system does not work corectly
l_textureList.Clear();
l_textureListToUpdate.Clear();
l_uniqueIdTexture = 0;
l_contextHasBeenRemoved = true;
}
void ewol::textureManager::UnInit(void)
{
l_textureListToUpdate.Clear();
for (int32_t iii=0; iii<l_textureList.Size(); iii++) {
if (l_textureList[iii] != NULL) {
l_textureList[iii]->RemoveContext();
}
}
}
// note : Return the UniqueID ...
uint32_t ewol::textureManager::Add(ewol::Texture *object)
{
if (object==NULL) {
EWOL_CRITICAL("try to add a texture with NULL pointer ...");
return 0;
}
for (int32_t iii=0; iii<l_textureList.Size(); iii++) {
if (l_textureList[iii] != NULL) {
if (l_textureList[iii] == object) {
EWOL_CRITICAL("try to add a texture a second time ...");
return 0;
}
}
}
l_uniqueIdTexture ++;
// add it in the list
l_textureList.PushBack(object);
// add it to be regenerated at the next update :
l_textureListToUpdate.PushBack(object);
// return his ID ...
return l_uniqueIdTexture;
}
void ewol::textureManager::Rm(ewol::Texture *object)
{
if (object==NULL) {
EWOL_CRITICAL("try to remove a texture with NULL pointer ...");
return;
}
for (int32_t iii=l_textureListToUpdate.Size()-1; iii>=0; iii--) {
if (l_textureListToUpdate[iii] != NULL) {
if (l_textureListToUpdate[iii] == object) {
// we find the texture :
l_textureListToUpdate.Erase(iii);
}
}
}
for (int32_t iii=l_textureList.Size()-1; iii>=0; iii--) {
if (l_textureList[iii] != NULL) {
if (l_textureList[iii] == object) {
// we find the texture :
l_textureList.Erase(iii);
return;
}
}
}
EWOL_CRITICAL("Try to remove a texture that is not present in the texture pool");
}
void ewol::textureManager::Update(ewol::Texture *object)
{
// chek if not added before
for (int32_t iii=0; iii<l_textureListToUpdate.Size(); iii++) {
if (l_textureListToUpdate[iii] != NULL) {
if (l_textureListToUpdate[iii] == object) {
// just prevent some double add ...
return;
}
}
}
// add it ...
l_textureListToUpdate.pushBack(object);
}
// Specific to load or update the data in the openGl context ==> system use only
void ewol::textureManager::UpdateContext(void)
{
if (true == l_contextHasBeenRemoved) {
// need to update all ...
l_contextHasBeenRemoved = false;
for (int32_t iii=0; iii<l_textureList.Size(); iii++) {
if (l_textureList[iii] != NULL) {
l_textureList[iii]->UpdateContext();
}
}
}else {
for (int32_t iii=0; iii<l_textureListToUpdate.Size(); iii++) {
if (l_textureListToUpdate[iii] != NULL) {
l_textureListToUpdate[iii]->UpdateContext();
}
}
}
// Clean the update list
l_textureListToUpdate.Clear();
}
void ewol::textureManager::OpenGlContextHasBeenDestroyed(void)
{
for (int32_t iii=0; iii<l_textureList.Size(); iii++) {
if (l_textureList[iii] != NULL) {
l_textureList[iii]->UpdateContext();
}
}
// no context preent ...
l_contextHasBeenRemoved = true;
}

View File

@ -0,0 +1,47 @@
/**
*******************************************************************************
* @file ewol/texture/textureManager.h
* @brief ewol Texture manager system (header)
* @author Edouard DUPIN
* @date 21/08/2012
* @par Project
* ewol
*
* @par Copyright
* Copyright 2011 Edouard DUPIN, all right reserved
*
* This software is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY.
*
* Licence summary :
* You can modify and redistribute the sources code and binaries.
* You can send me the bug-fix
*
* Term of the licence in in the file licence.txt.
*
*******************************************************************************
*/
#ifndef __EWOL_TEXTURE_MANAGER_H__
#define __EWOL_TEXTURE_MANAGER_H__
#include <etk/Types.h>
#include <ewol/Debug.h>
#include <etk/File.h>
#include <ewol/texture/Texture.h>
namespace ewol
{
namespace textureManager {
void Init(void);
void UnInit(void);
uint32_t Add(ewol::Texture *object); // note : Return the UniqueID ...
void Rm(ewol::Texture *object);
void Update(ewol::Texture *object);
// Specific to load or update the data in the openGl context ==> system use only
void UpdateContext(void);
void OpenGlContextHasBeenDestroyed(void);
};
};
#endif

View File

@ -68,10 +68,10 @@ void ewol::Button::Init(void)
m_padding.x = 4; m_padding.x = 4;
#endif #endif
m_textColorFg = etk::color::black; m_textColorFg = draw::color::black;
m_textColorBg = etk::color::black; m_textColorBg = draw::color::black;
m_textColorBg.alpha = 0x3F; m_textColorBg.a = 0x3F;
SetCanHaveFocus(true); SetCanHaveFocus(true);
} }

View File

@ -62,16 +62,16 @@ namespace ewol {
bool GetValue(void); bool GetValue(void);
void SetAlignement(textAlignement_te typeAlign); void SetAlignement(textAlignement_te typeAlign);
void SetPadding(Vector2D<float> newPadding); void SetPadding(Vector2D<float> newPadding);
void SetColorBg(etk::Color newColor) { m_textColorBg = newColor; }; void SetColorBg(draw::Color newColor) { m_textColorBg = newColor; };
void SetColorFg(etk::Color newColor) { m_textColorFg = newColor; }; void SetColorFg(draw::Color newColor) { m_textColorFg = newColor; };
private: private:
bool m_hasAnImage; bool m_hasAnImage;
etk::UString m_imageSelected; etk::UString m_imageSelected;
textAlignement_te m_alignement; textAlignement_te m_alignement;
Vector2D<float> m_padding; Vector2D<float> m_padding;
etk::UString m_label; etk::UString m_label;
etk::Color m_textColorFg; //!< Text color draw::Color m_textColorFg; //!< Text color
etk::Color m_textColorBg; //!< Background color draw::Color m_textColorBg; //!< Background color
public: public:
virtual void OnRegenerateDisplay(void); virtual void OnRegenerateDisplay(void);
/** /**

View File

@ -63,8 +63,8 @@ void ewol::ButtonColor::Init(void)
#endif #endif
m_textColorBg = etk::color::black; m_textColorBg = draw::color::black;
m_textColorBg.alpha = 0x3F; m_textColorBg.a = 0x3F;
m_widgetContextMenu = NULL; m_widgetContextMenu = NULL;
SetCanHaveFocus(true); SetCanHaveFocus(true);
} }
@ -159,10 +159,10 @@ void ewol::ButtonColor::OnRegenerateDisplay(void)
tmpSizeX -= 2*m_padding.x; tmpSizeX -= 2*m_padding.x;
tmpSizeY -= 2*m_padding.y; tmpSizeY -= 2*m_padding.y;
if ((m_textColorBg.red>0.5) || (m_textColorBg.green>0.5) || (m_textColorBg.blue > 0.8) ) { if ((m_textColorBg.r>0.5) || (m_textColorBg.g>0.5) || (m_textColorBg.b > 0.8) ) {
m_textColorFg = etk::color::black; m_textColorFg = draw::color::black;
} else { } else {
m_textColorFg = etk::color::white; m_textColorFg = draw::color::white;
} }
ewol::OObject2DText * tmpText = new ewol::OObject2DText("", -1, m_textColorFg); ewol::OObject2DText * tmpText = new ewol::OObject2DText("", -1, m_textColorFg);
/* /*
@ -241,7 +241,7 @@ bool ewol::ButtonColor::OnEventInput(ewol::inputType_te type, int32_t IdInput, e
} }
void ewol::ButtonColor::SetCurrentColor(etk::Color color) void ewol::ButtonColor::SetCurrentColor(draw::Color color)
{ {
m_selectedColor = color; m_selectedColor = color;
m_textColorBg = m_selectedColor; m_textColorBg = m_selectedColor;
@ -262,8 +262,8 @@ void ewol::ButtonColor::OnReceiveMessage(ewol::EObject * CallerObject, const cha
{ {
if (eventId == ewolEventColorChooserChange) { if (eventId == ewolEventColorChooserChange) {
// TODO : Parse the input color ... // TODO : Parse the input color ...
//etk::Color tmpColor(data); //draw::Color tmpColor(data);
etk::Color tmpColor; draw::Color tmpColor;
m_selectedColor = tmpColor; m_selectedColor = tmpColor;
m_textColorBg = m_selectedColor; m_textColorBg = m_selectedColor;
char colorText[256]; char colorText[256];

View File

@ -59,9 +59,9 @@ namespace ewol {
textAlignement_te m_alignement; textAlignement_te m_alignement;
Vector2D<float> m_padding; Vector2D<float> m_padding;
etk::UString m_label; etk::UString m_label;
etk::Color m_textColorFg; //!< Text color draw::Color m_textColorFg; //!< Text color
etk::Color m_textColorBg; //!< Background color draw::Color m_textColorBg; //!< Background color
etk::Color m_selectedColor; //!< user current selected Color draw::Color m_selectedColor; //!< user current selected Color
ewol::ContextMenu* m_widgetContextMenu; ewol::ContextMenu* m_widgetContextMenu;
public: public:
virtual void OnRegenerateDisplay(void); virtual void OnRegenerateDisplay(void);
@ -76,8 +76,8 @@ namespace ewol {
* @return false the event is not used * @return false the event is not used
*/ */
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos); virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
etk::Color GetCurrentColor(void) { return m_selectedColor; }; draw::Color GetCurrentColor(void) { return m_selectedColor; };
void SetCurrentColor(etk::Color color); void SetCurrentColor(draw::Color color);
/** /**
* @brief Receive a message from an other EObject with a specific eventId and data * @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from * @param[in] CallerObject Pointer on the EObject that information came from

View File

@ -41,7 +41,7 @@ void ewol::WIDGET_ButtonImageInit(void)
#undef __class__ #undef __class__
#define __class__ "ButtonImage" #define __class__ "ButtonImage"
ewol::ButtonImage::ButtonImage(etk::UString imageName, etk::Color col) ewol::ButtonImage::ButtonImage(etk::UString imageName, draw::Color col)
{ {
AddEventId(ewolEventButtonPressed); AddEventId(ewolEventButtonPressed);
AddEventId(ewolEventButtonDown); AddEventId(ewolEventButtonDown);
@ -68,7 +68,7 @@ ewol::ButtonImage::~ButtonImage(void)
} }
void ewol::ButtonImage::SetImage(etk::UString imageName, etk::Color col) void ewol::ButtonImage::SetImage(etk::UString imageName, draw::Color col)
{ {
m_image = imageName; m_image = imageName;
m_color = col; m_color = col;
@ -76,7 +76,7 @@ void ewol::ButtonImage::SetImage(etk::UString imageName, etk::Color col)
MarkToRedraw(); MarkToRedraw();
} }
void ewol::ButtonImage::SetImageBG(etk::UString imageName, etk::Color col) void ewol::ButtonImage::SetImageBG(etk::UString imageName, draw::Color col)
{ {
m_imageBg1 = imageName; m_imageBg1 = imageName;
m_colorBg1 = col; m_colorBg1 = col;
@ -84,7 +84,7 @@ void ewol::ButtonImage::SetImageBG(etk::UString imageName, etk::Color col)
MarkToRedraw(); MarkToRedraw();
} }
void ewol::ButtonImage::SetImageSelected(etk::UString imageName, etk::Color col) void ewol::ButtonImage::SetImageSelected(etk::UString imageName, draw::Color col)
{ {
m_imageBg2 = imageName; m_imageBg2 = imageName;
m_colorBg2 = col; m_colorBg2 = col;

View File

@ -34,7 +34,7 @@ namespace ewol {
class ButtonImage :public ewol::Widget class ButtonImage :public ewol::Widget
{ {
public: public:
ButtonImage(etk::UString image, etk::Color col=0xFFFFFFFF); ButtonImage(etk::UString image, draw::Color col=0xFFFFFFFF);
/** /**
* @brief Get the current Object type of the EObject * @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it * @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
@ -44,9 +44,9 @@ namespace ewol {
virtual const char * const GetObjectType(void) { return "EwolButtonImage"; }; virtual const char * const GetObjectType(void) { return "EwolButtonImage"; };
void Init(void); void Init(void);
virtual ~ButtonImage(void); virtual ~ButtonImage(void);
void SetImage(etk::UString imageName, etk::Color col=0xFFFFFFFF); void SetImage(etk::UString imageName, draw::Color col=0xFFFFFFFF);
void SetImageBG(etk::UString imageName, etk::Color col=0xFFFFFFFF); void SetImageBG(etk::UString imageName, draw::Color col=0xFFFFFFFF);
void SetImageSelected(etk::UString imageName, etk::Color col=0xFFFFFFFF); void SetImageSelected(etk::UString imageName, draw::Color col=0xFFFFFFFF);
void SetValue(bool val); void SetValue(bool val);
bool GetValue(void); bool GetValue(void);
void SetToggleMode(bool val); void SetToggleMode(bool val);
@ -55,15 +55,15 @@ namespace ewol {
etk::UString m_image; etk::UString m_image;
bool m_resetNeeded; bool m_resetNeeded;
ewol::OObject2DTextured* m_OOImage; ewol::OObject2DTextured* m_OOImage;
etk::Color m_color; draw::Color m_color;
etk::UString m_imageBg1; etk::UString m_imageBg1;
ewol::OObject2DTextured* m_OOImageBg1; ewol::OObject2DTextured* m_OOImageBg1;
etk::Color m_colorBg1; draw::Color m_colorBg1;
etk::UString m_imageBg2; etk::UString m_imageBg2;
ewol::OObject2DTextured* m_OOImageBG2; ewol::OObject2DTextured* m_OOImageBG2;
etk::Color m_colorBg2; draw::Color m_colorBg2;
bool m_over; bool m_over;
bool m_down; bool m_down;

View File

@ -38,8 +38,8 @@ extern const char * const ewolEventCheckBoxClicked = "ewol CheckBox Clicked";
void ewol::CheckBox::Init(void) void ewol::CheckBox::Init(void)
{ {
AddEventId(ewolEventCheckBoxClicked); AddEventId(ewolEventCheckBoxClicked);
m_textColorFg = etk::color::black; m_textColorFg = draw::color::black;
m_textColorBg = etk::color::white; m_textColorBg = draw::color::white;
m_value = false; m_value = false;
SetCanHaveFocus(true); SetCanHaveFocus(true);
SetMouseLimit(1); SetMouseLimit(1);

View File

@ -53,8 +53,8 @@ namespace ewol {
private: private:
etk::UString m_label; etk::UString m_label;
bool m_value; bool m_value;
etk::Color m_textColorFg; //!< Text color draw::Color m_textColorFg; //!< Text color
etk::Color m_textColorBg; //!< Background color draw::Color m_textColorBg; //!< Background color
public: public:
virtual void OnRegenerateDisplay(void); virtual void OnRegenerateDisplay(void);
public: public:

View File

@ -27,7 +27,7 @@
#include <ewol/oObject/OObject.h> #include <ewol/oObject/OObject.h>
#include <ewol/widget/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
#include <etk/Color.h> #include <draw/Color.h>
extern const char * const ewolEventColorBarChange = "ewol-color-bar-change"; extern const char * const ewolEventColorBarChange = "ewol-color-bar-change";
@ -49,7 +49,7 @@ ewol::ColorBar::ColorBar(void)
#endif #endif
m_currentUserPos.x=0; m_currentUserPos.x=0;
m_currentUserPos.y=0; m_currentUserPos.y=0;
m_currentColor = etk::color::black; m_currentColor = draw::color::black;
SetCanHaveFocus(true); SetCanHaveFocus(true);
} }
@ -66,10 +66,10 @@ bool ewol::ColorBar::CalculateMinSize(void)
MarkToRedraw(); MarkToRedraw();
return true; return true;
} }
static etk::Color s_listColorWhite(0xFFFFFFFF); static draw::Color s_listColorWhite(0xFFFFFFFF);
static etk::Color s_listColorBlack(0x000000FF); static draw::Color s_listColorBlack(0x000000FF);
#define NB_BAND_COLOR (6) #define NB_BAND_COLOR (6)
static etk::Color s_listColor[NB_BAND_COLOR+1] = { static draw::Color s_listColor[NB_BAND_COLOR+1] = {
0xFF0000FF, 0xFF0000FF,
0xFFFF00FF, 0xFFFF00FF,
0x00FF00FF, 0x00FF00FF,
@ -79,14 +79,14 @@ static etk::Color s_listColor[NB_BAND_COLOR+1] = {
0xFF0000FF 0xFF0000FF
}; };
etk::Color ewol::ColorBar::GetCurrentColor(void) draw::Color ewol::ColorBar::GetCurrentColor(void)
{ {
return m_currentColor; return m_currentColor;
} }
void ewol::ColorBar::SetCurrentColor(etk::Color newOne) void ewol::ColorBar::SetCurrentColor(draw::Color newOne)
{ {
m_currentColor = newOne; m_currentColor = newOne;
m_currentColor.alpha = 0xFF; m_currentColor.a = 0xFF;
// estimate the cursor position : // estimate the cursor position :
// TODO : Later when really needed ... // TODO : Later when really needed ...
} }
@ -193,11 +193,11 @@ void ewol::ColorBar::OnRegenerateDisplay(void)
tmpOObjects->SetPoint(tmpOriginX + (iii+0.5)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY); tmpOObjects->SetPoint(tmpOriginX + (iii+0.5)*(tmpSizeX/NB_BAND_COLOR), tmpOriginY+tmpSizeY);
*/ */
} }
etk::Color tmpColor; draw::Color tmpColor;
if (m_currentUserPos.y > 0.5) { if (m_currentUserPos.y > 0.5) {
tmpColor = etk::color::white; tmpColor = draw::color::white;
} else { } else {
tmpColor = etk::color::black; tmpColor = draw::color::black;
} }
tmpOObjects->SetColor(tmpColor); tmpOObjects->SetColor(tmpColor);
tmpOObjects->Circle(m_currentUserPos.x*m_size.x, m_currentUserPos.y*m_size.y, 3.0, 1.0); tmpOObjects->Circle(m_currentUserPos.x*m_size.x, m_currentUserPos.y*m_size.y, 3.0, 1.0);
@ -236,49 +236,49 @@ bool ewol::ColorBar::OnEventInput(ewol::inputType_te type, int32_t IdInput, even
float localPos = relativePos.x - (m_size.x/6) * bandID; float localPos = relativePos.x - (m_size.x/6) * bandID;
float poroportionnalPos = localPos/(m_size.x/6); float poroportionnalPos = localPos/(m_size.x/6);
EWOL_VERBOSE("bandId=" << bandID << " relative pos=" << localPos); EWOL_VERBOSE("bandId=" << bandID << " relative pos=" << localPos);
etk::Color estimateColor = etk::color::white; draw::Color estimateColor = draw::color::white;
if (s_listColor[bandID].red == s_listColor[bandID+1].red) { if (s_listColor[bandID].r == s_listColor[bandID+1].r) {
estimateColor.red = s_listColor[bandID].red; estimateColor.r = s_listColor[bandID].r;
} else if (s_listColor[bandID].red < s_listColor[bandID+1].red) { } else if (s_listColor[bandID].r < s_listColor[bandID+1].r) {
estimateColor.red = s_listColor[bandID].red + (s_listColor[bandID+1].red-s_listColor[bandID].red)*poroportionnalPos; estimateColor.r = s_listColor[bandID].r + (s_listColor[bandID+1].r-s_listColor[bandID].r)*poroportionnalPos;
} else { } else {
estimateColor.red = s_listColor[bandID+1].red + (s_listColor[bandID].red-s_listColor[bandID+1].red)*(1-poroportionnalPos); estimateColor.r = s_listColor[bandID+1].r + (s_listColor[bandID].r-s_listColor[bandID+1].r)*(1-poroportionnalPos);
} }
if (s_listColor[bandID].green == s_listColor[bandID+1].green) { if (s_listColor[bandID].g == s_listColor[bandID+1].g) {
estimateColor.green = s_listColor[bandID].green; estimateColor.g = s_listColor[bandID].g;
} else if (s_listColor[bandID].green < s_listColor[bandID+1].green) { } else if (s_listColor[bandID].g < s_listColor[bandID+1].g) {
estimateColor.green = s_listColor[bandID].green + (s_listColor[bandID+1].green-s_listColor[bandID].green)*poroportionnalPos; estimateColor.g = s_listColor[bandID].g + (s_listColor[bandID+1].g-s_listColor[bandID].g)*poroportionnalPos;
} else { } else {
estimateColor.green = s_listColor[bandID+1].green + (s_listColor[bandID].green-s_listColor[bandID+1].green)*(1-poroportionnalPos); estimateColor.g = s_listColor[bandID+1].g + (s_listColor[bandID].g-s_listColor[bandID+1].g)*(1-poroportionnalPos);
} }
if (s_listColor[bandID].blue == s_listColor[bandID+1].blue) { if (s_listColor[bandID].b == s_listColor[bandID+1].b) {
estimateColor.blue = s_listColor[bandID].blue; estimateColor.b = s_listColor[bandID].b;
} else if (s_listColor[bandID].blue < s_listColor[bandID+1].blue) { } else if (s_listColor[bandID].b < s_listColor[bandID+1].b) {
estimateColor.blue = s_listColor[bandID].blue + (s_listColor[bandID+1].blue-s_listColor[bandID].blue)*poroportionnalPos; estimateColor.b = s_listColor[bandID].b + (s_listColor[bandID+1].b-s_listColor[bandID].b)*poroportionnalPos;
} else { } else {
estimateColor.blue = s_listColor[bandID+1].blue + (s_listColor[bandID].blue-s_listColor[bandID+1].blue)*(1-poroportionnalPos); estimateColor.b = s_listColor[bandID+1].b + (s_listColor[bandID].b-s_listColor[bandID+1].b)*(1-poroportionnalPos);
} }
// step 2 generate the white and black ... // step 2 generate the white and black ...
if (relativePos.y == (m_size.y/2)) { if (relativePos.y == (m_size.y/2)) {
// nothing to do ... just get the current color ... // nothing to do ... just get the current color ...
} else if (relativePos.y < (m_size.y/2)) { } else if (relativePos.y < (m_size.y/2)) {
float poroportionnalWhite = 1.0-relativePos.y/(m_size.y/2); float poroportionnalWhite = 1.0-relativePos.y/(m_size.y/2);
estimateColor.red = estimateColor.red + (1.0 - estimateColor.red )*poroportionnalWhite; estimateColor.r = estimateColor.r + (1.0 - estimateColor.r)*poroportionnalWhite;
estimateColor.green = estimateColor.green + (1.0 - estimateColor.green)*poroportionnalWhite; estimateColor.g = estimateColor.g + (1.0 - estimateColor.g)*poroportionnalWhite;
estimateColor.blue = estimateColor.blue + (1.0 - estimateColor.blue )*poroportionnalWhite; estimateColor.b = estimateColor.b + (1.0 - estimateColor.b)*poroportionnalWhite;
} else { } else {
float poroportionnalBlack = (relativePos.y-(m_size.y/2))/(m_size.y/2); float poroportionnalBlack = (relativePos.y-(m_size.y/2))/(m_size.y/2);
estimateColor.red = estimateColor.red - (estimateColor.red )*poroportionnalBlack; estimateColor.r = estimateColor.r - (estimateColor.r)*poroportionnalBlack;
estimateColor.green = estimateColor.green - (estimateColor.green)*poroportionnalBlack; estimateColor.g = estimateColor.g - (estimateColor.g)*poroportionnalBlack;
estimateColor.blue = estimateColor.blue - (estimateColor.blue )*poroportionnalBlack; estimateColor.b = estimateColor.b - (estimateColor.b)*poroportionnalBlack;
} }
/* /*
char colorText[256]; char colorText[256];
sprintf(colorText, "#%02X%02X%02X%02X", sprintf(colorText, "#%02X%02X%02X%02X",
(uint8_t)(estimateColor.red * 0xFF), (uint8_t)(estimateColor.r * 0xFF),
(uint8_t)(estimateColor.green * 0xFF), (uint8_t)(estimateColor.g * 0xFF),
(uint8_t)(estimateColor.blue * 0xFF), (uint8_t)(estimateColor.b * 0xFF),
(uint8_t)(estimateColor.alpha * 0xFF)); (uint8_t)(estimateColor.a * 0xFF));
EWOL_DEBUG("new color : " << colorText); EWOL_DEBUG("new color : " << colorText);
*/ */
if( m_currentColor != estimateColor) { if( m_currentColor != estimateColor) {

View File

@ -45,10 +45,10 @@ namespace ewol {
*/ */
virtual const char * const GetObjectType(void) { return "EwolColorBar"; }; virtual const char * const GetObjectType(void) { return "EwolColorBar"; };
virtual bool CalculateMinSize(void); virtual bool CalculateMinSize(void);
etk::Color GetCurrentColor(void); draw::Color GetCurrentColor(void);
void SetCurrentColor(etk::Color newOne); void SetCurrentColor(draw::Color newOne);
private: private:
etk::Color m_currentColor; draw::Color m_currentColor;
Vector2D<float> m_currentUserPos; Vector2D<float> m_currentUserPos;
Vector2D<float> m_padding; Vector2D<float> m_padding;
public: public:

View File

@ -40,10 +40,10 @@ ewol::ContextMenu::ContextMenu(void)
m_padding.y = 4; m_padding.y = 4;
m_offset = 20; m_offset = 20;
m_colorBackGroung = etk::color::white; m_colorBackGroung = draw::color::white;
m_colorBorder = etk::color::black; m_colorBorder = draw::color::black;
m_colorBorder.alpha = 0x7F; m_colorBorder.a = 0x7F;
m_arrowPos.x = 0; m_arrowPos.x = 0;
m_arrowPos.y = 0; m_arrowPos.y = 0;

View File

@ -57,8 +57,8 @@ namespace ewol {
virtual void SetExpendX(bool newExpend=false); virtual void SetExpendX(bool newExpend=false);
virtual void SetExpendY(bool newExpend=false); virtual void SetExpendY(bool newExpend=false);
private: private:
etk::Color m_colorBackGroung; draw::Color m_colorBackGroung;
etk::Color m_colorBorder; draw::Color m_colorBorder;
Vector2D<float> m_padding; Vector2D<float> m_padding;
Vector2D<float> m_arrowPos; Vector2D<float> m_arrowPos;
float m_offset; float m_offset;

View File

@ -51,10 +51,10 @@ void ewol::Entry::Init(void)
m_borderSize = 2; m_borderSize = 2;
m_paddingSize = 3; m_paddingSize = 3;
m_displayCursor = false; m_displayCursor = false;
m_textColorFg = etk::color::black; m_textColorFg = draw::color::black;
m_textColorBg = etk::color::white; m_textColorBg = draw::color::white;
m_textColorBg.alpha = 0xAF; m_textColorBg.a = 0xAF;
SetCanHaveFocus(true); SetCanHaveFocus(true);
} }

View File

@ -57,8 +57,8 @@ namespace ewol {
} }
private: private:
etk::UString m_data; etk::UString m_data;
etk::Color m_textColorFg; //!< Text color draw::Color m_textColorFg; //!< Text color
etk::Color m_textColorBg; //!< Background color draw::Color m_textColorBg; //!< Background color
int32_t m_userSize; int32_t m_userSize;
int32_t m_displayStartPosition; int32_t m_displayStartPosition;
int32_t m_displayCursorPos; int32_t m_displayCursorPos;

View File

@ -58,8 +58,8 @@ void ewol::Image::Init(void)
m_padding.x = 4; m_padding.x = 4;
#endif #endif
m_textColorBg = etk::color::black; m_textColorBg = draw::color::black;
m_textColorBg.alpha = 0x00; m_textColorBg.a = 0x00;
m_imageSize = 32; m_imageSize = 32;
} }

View File

@ -51,7 +51,7 @@ namespace ewol {
private: private:
etk::UString m_imageSelected; etk::UString m_imageSelected;
Vector2D<float> m_padding; Vector2D<float> m_padding;
etk::Color m_textColorBg; //!< Background color draw::Color m_textColorBg; //!< Background color
int32_t m_imageSize; int32_t m_imageSize;
public: public:
virtual void OnRegenerateDisplay(void); virtual void OnRegenerateDisplay(void);

View File

@ -103,10 +103,10 @@ ewol::Joystick::Joystick(void)
m_lock = false; m_lock = false;
m_displayMode = ewol::JOYSTICK_NORMAL_MODE; m_displayMode = ewol::JOYSTICK_NORMAL_MODE;
m_colorFg = etk::color::blue; m_colorFg = draw::color::blue;
m_colorBg = etk::color::black; m_colorBg = draw::color::black;
m_colorBg.alpha = 0x3F; m_colorBg.a = 0x3F;
m_displayPos.x = 0.0; m_displayPos.x = 0.0;
m_displayPos.y = 0.0; m_displayPos.y = 0.0;

View File

@ -41,8 +41,8 @@ namespace ewol {
class Joystick :public ewol::Drawable class Joystick :public ewol::Drawable
{ {
private: private:
etk::Color m_colorFg; //!< Forground color draw::Color m_colorFg; //!< Forground color
etk::Color m_colorBg; //!< Background color draw::Color m_colorBg; //!< Background color
Vector2D<float> m_displayPos; //!< direction of the cursor ... Vector2D<float> m_displayPos; //!< direction of the cursor ...
float m_distance; //!< dintance from the center float m_distance; //!< dintance from the center
float m_angle; //!< angle of the arraw (if < 0 : No arraw...) 0 is the TOP ... float m_angle; //!< angle of the arraw (if < 0 : No arraw...) 0 is the TOP ...

View File

@ -39,7 +39,7 @@ extern const char * const ewolEventLabelPressed = "ewol Label Pressed";
void ewol::Label::Init(void) void ewol::Label::Init(void)
{ {
AddEventId(ewolEventLabelPressed); AddEventId(ewolEventLabelPressed);
m_textColorFg = etk::color::black; m_textColorFg = draw::color::black;
SetCanHaveFocus(false); SetCanHaveFocus(false);
} }

View File

@ -50,7 +50,7 @@ namespace ewol {
void SetLabel(etk::UString newLabel); void SetLabel(etk::UString newLabel);
private: private:
etk::UString m_label; etk::UString m_label;
etk::Color m_textColorFg; //!< Text color draw::Color m_textColorFg; //!< Text color
public: public:
virtual void OnRegenerateDisplay(void); virtual void OnRegenerateDisplay(void);
public: public:

View File

@ -144,7 +144,7 @@ void ewol::List::OnRegenerateDisplay(void)
etk::Vector<int32_t> listSizeColomn; etk::Vector<int32_t> listSizeColomn;
ewol::OObject2DColored * BGOObjects = new ewol::OObject2DColored(); ewol::OObject2DColored * BGOObjects = new ewol::OObject2DColored();
etk::Color basicBG = GetBasicBG(); draw::Color basicBG = GetBasicBG();
BGOObjects->SetColor(basicBG); BGOObjects->SetColor(basicBG);
BGOObjects->Rectangle(0, 0, m_size.x, m_size.y); BGOObjects->Rectangle(0, 0, m_size.x, m_size.y);
@ -172,8 +172,8 @@ void ewol::List::OnRegenerateDisplay(void)
for(int32_t iii=startRaw; iii<nbRaw && iii<(startRaw+displayableRaw); iii++) { for(int32_t iii=startRaw; iii<nbRaw && iii<(startRaw+displayableRaw); iii++) {
etk::UString myTextToWrite; etk::UString myTextToWrite;
etk::Color fg; draw::Color fg;
etk::Color bg; draw::Color bg;
GetElement(0, iii, myTextToWrite, fg, bg); GetElement(0, iii, myTextToWrite, fg, bg);
BGOObjects->SetColor(bg); BGOObjects->SetColor(bg);
BGOObjects->Rectangle(0, m_size.y - tmpOriginY, m_size.x, minHeight+2*m_paddingSizeY); BGOObjects->Rectangle(0, m_size.y - tmpOriginY, m_size.x, minHeight+2*m_paddingSizeY);

View File

@ -74,21 +74,21 @@ namespace ewol {
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos); virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, eventInputType_te typeEvent, Vector2D<float> pos);
protected: protected:
// function call to display the list : // function call to display the list :
virtual etk::Color GetBasicBG(void) { virtual draw::Color GetBasicBG(void) {
etk::Color bg(0xFFFFFFFF); draw::Color bg(0xFFFFFFFF);
return bg; return bg;
} }
virtual uint32_t GetNuberOfColomn(void) { virtual uint32_t GetNuberOfColomn(void) {
return 0; return 0;
}; };
virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color &fg, etk::Color &bg) { virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg) {
myTitle = ""; myTitle = "";
return false; return false;
}; };
virtual uint32_t GetNuberOfRaw(void) { virtual uint32_t GetNuberOfRaw(void) {
return 0; return 0;
}; };
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color &fg, etk::Color &bg) { virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg) {
myTextToWrite = ""; myTextToWrite = "";
bg = 0xFFFFFFFF; bg = 0xFFFFFFFF;
fg = 0x000000FF; fg = 0x000000FF;

View File

@ -86,8 +86,8 @@ ewol::ListFileSystem::~ListFileSystem(void)
} }
}; };
etk::Color ewol::ListFileSystem::GetBasicBG(void) { draw::Color ewol::ListFileSystem::GetBasicBG(void) {
etk::Color bg(0x00000010); draw::Color bg(0x00000010);
return bg; return bg;
} }
@ -267,20 +267,20 @@ void ewol::ListFileSystem::SetSelect( etk::UString data) {
uint32_t ewol::ListFileSystem::GetNuberOfColomn(void) { uint32_t ewol::ListFileSystem::GetNuberOfColomn(void) {
return 1; return 1;
}; };
bool ewol::ListFileSystem::GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color &fg, etk::Color &bg) { bool ewol::ListFileSystem::GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg) {
myTitle = "title"; myTitle = "title";
return true; return true;
}; };
uint32_t ewol::ListFileSystem::GetNuberOfRaw(void) { uint32_t ewol::ListFileSystem::GetNuberOfRaw(void) {
return m_list.Size(); return m_list.Size();
}; };
bool ewol::ListFileSystem::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color &fg, etk::Color &bg) { bool ewol::ListFileSystem::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg) {
if (raw >= 0 && raw < m_list.Size() && NULL != m_list[raw]) { if (raw >= 0 && raw < m_list.Size() && NULL != m_list[raw]) {
myTextToWrite = m_list[raw]->m_name; myTextToWrite = m_list[raw]->m_name;
} else { } else {
myTextToWrite = "ERROR"; myTextToWrite = "ERROR";
} }
fg = etk::color::black; fg = draw::color::black;
if (raw % 2) { if (raw % 2) {
bg = 0xFFFFFF00; bg = 0xFFFFFF00;
} else { } else {

View File

@ -66,11 +66,11 @@ namespace ewol {
ListFileSystem(void); ListFileSystem(void);
~ListFileSystem(void); ~ListFileSystem(void);
// display API : // display API :
virtual etk::Color GetBasicBG(void); virtual draw::Color GetBasicBG(void);
uint32_t GetNuberOfColomn(void); uint32_t GetNuberOfColomn(void);
bool GetTitle(int32_t colomn, etk::UString &myTitle, etk::Color &fg, etk::Color &bg); bool GetTitle(int32_t colomn, etk::UString &myTitle, draw::Color &fg, draw::Color &bg);
uint32_t GetNuberOfRaw(void); uint32_t GetNuberOfRaw(void);
bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, etk::Color &fg, etk::Color &bg); bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, draw::Color &fg, draw::Color &bg);
bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y); bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
/** /**
* @brief Get the current Object type of the EObject * @brief Get the current Object type of the EObject

View File

@ -36,13 +36,13 @@ ewol::PopUp::PopUp(void) :
m_userExpendX = true; m_userExpendX = true;
m_userExpendY = true; m_userExpendY = true;
m_colorBackGroung = etk::color::white; m_colorBackGroung = draw::color::white;
m_colorEmptyArea = etk::color::black; m_colorEmptyArea = draw::color::black;
m_colorEmptyArea.alpha = 0x7F; m_colorEmptyArea.a = 0x7F;
m_colorBorder = etk::color::black; m_colorBorder = draw::color::black;
m_colorBorder.alpha = 0x7F; m_colorBorder.a = 0x7F;
m_subWidget = 0; m_subWidget = 0;
} }

View File

@ -51,9 +51,9 @@ namespace ewol {
virtual void SetExpendY(bool newExpend=false); virtual void SetExpendY(bool newExpend=false);
void SetDisplayRatio(float ratio); void SetDisplayRatio(float ratio);
private: private:
etk::Color m_colorBackGroung; draw::Color m_colorBackGroung;
etk::Color m_colorBorder; draw::Color m_colorBorder;
etk::Color m_colorEmptyArea; draw::Color m_colorEmptyArea;
ewol::Widget* m_subWidgetNext; ewol::Widget* m_subWidgetNext;
ewol::Widget* m_subWidget; ewol::Widget* m_subWidget;
float m_displayRatio; float m_displayRatio;

View File

@ -36,12 +36,12 @@ ewol::ProgressBar::ProgressBar(void)
{ {
m_value = 0.0; m_value = 0.0;
m_textColorFg = etk::color::black; m_textColorFg = draw::color::black;
m_textColorBgOn = 0x00FF00FF; m_textColorBgOn = 0x00FF00FF;
m_textColorBgOff = etk::color::black; m_textColorBgOff = draw::color::black;
m_textColorBgOff.alpha = 0x3F; m_textColorBgOff.a = 0x3F;
SetCanHaveFocus(true); SetCanHaveFocus(true);
} }

View File

@ -46,12 +46,12 @@ namespace ewol {
virtual bool CalculateMinSize(void); virtual bool CalculateMinSize(void);
void ValueSet(float val); void ValueSet(float val);
float ValueGet(void); float ValueGet(void);
void SetColor(etk::Color newColor) { m_textColorFg = newColor; }; void SetColor(draw::Color newColor) { m_textColorFg = newColor; };
private: private:
float m_value; //!< % used float m_value; //!< % used
etk::Color m_textColorFg; //!< forder bar color draw::Color m_textColorFg; //!< forder bar color
etk::Color m_textColorBgOn; //!< bar color enable draw::Color m_textColorBgOn; //!< bar color enable
etk::Color m_textColorBgOff; //!< bar color disable draw::Color m_textColorBgOff; //!< bar color disable
public: public:
virtual void OnRegenerateDisplay(void); virtual void OnRegenerateDisplay(void);
}; };

View File

@ -45,10 +45,10 @@ ewol::Slider::Slider(void)
m_min = 0; m_min = 0;
m_max = 10; m_max = 10;
m_textColorFg = etk::color::black; m_textColorFg = draw::color::black;
m_textColorBg = etk::color::black; m_textColorBg = draw::color::black;
m_textColorBg.alpha = 0x3F; m_textColorBg.a = 0x3F;
SetCanHaveFocus(true); SetCanHaveFocus(true);
} }
@ -107,8 +107,8 @@ void ewol::Slider::OnRegenerateDisplay(void)
tmpOObjects->SetColor(m_textColorFg); tmpOObjects->SetColor(m_textColorFg);
// draw a line : // draw a line :
tmpOObjects->Line(dotRadius, m_size.y/2, m_size.x-dotRadius, m_size.y/2, 1); tmpOObjects->Line(dotRadius, m_size.y/2, m_size.x-dotRadius, m_size.y/2, 1);
etk::Color borderDot = m_textColorFg; draw::Color borderDot = m_textColorFg;
borderDot.alpha /= 2; borderDot.a /= 2;
tmpOObjects->SetColor(borderDot); tmpOObjects->SetColor(borderDot);
tmpOObjects->Disc(4+((float)(m_value-m_min)/(float)(m_max-m_min))*(float)(m_size.x-2*dotRadius), m_size.y/2, dotRadius); tmpOObjects->Disc(4+((float)(m_value-m_min)/(float)(m_max-m_min))*(float)(m_size.x-2*dotRadius), m_size.y/2, dotRadius);

View File

@ -49,13 +49,13 @@ namespace ewol {
int32_t GetValue(void); int32_t GetValue(void);
void SetMin(int32_t val); void SetMin(int32_t val);
void SetMax(int32_t val); void SetMax(int32_t val);
void SetColor(etk::Color newColor) { m_textColorFg = newColor; }; void SetColor(draw::Color newColor) { m_textColorFg = newColor; };
private: private:
int32_t m_value; int32_t m_value;
int32_t m_min; int32_t m_min;
int32_t m_max; int32_t m_max;
etk::Color m_textColorFg; //!< Text color draw::Color m_textColorFg; //!< Text color
etk::Color m_textColorBg; //!< Background color draw::Color m_textColorBg; //!< Background color
public: public:
virtual void OnRegenerateDisplay(void); virtual void OnRegenerateDisplay(void);
public: public:

View File

@ -36,7 +36,8 @@ ewol::Spacer::Spacer(void)
{ {
m_localSize = 10; m_localSize = 10;
SetCanHaveFocus(false); SetCanHaveFocus(false);
m_color = 0x00000000; m_color = draw::color::black;
m_color.a = 0;
} }
ewol::Spacer::~Spacer(void) ewol::Spacer::~Spacer(void)
@ -67,7 +68,7 @@ void ewol::Spacer::OnRegenerateDisplay(void)
} }
// generate a white background and take gray on other surfaces // generate a white background and take gray on other surfaces
ClearOObjectList(); ClearOObjectList();
if (m_color.alpha == 0) { if (m_color.a == 0) {
return; return;
} }
ewol::OObject2DColored * BGOObjects = new ewol::OObject2DColored(); ewol::OObject2DColored * BGOObjects = new ewol::OObject2DColored();

View File

@ -53,10 +53,10 @@ namespace ewol {
*/ */
virtual ewol::Widget * GetWidgetAtPos(Vector2D<float> pos) { return NULL; }; virtual ewol::Widget * GetWidgetAtPos(Vector2D<float> pos) { return NULL; };
virtual void OnRegenerateDisplay(void); virtual void OnRegenerateDisplay(void);
void SetColor(etk::Color newColor) { m_color = newColor; MarkToRedraw(); }; void SetColor(draw::Color newColor) { m_color = newColor; MarkToRedraw(); };
private: private:
float m_localSize; float m_localSize;
etk::Color m_color; draw::Color m_color;
}; };
}; };

View File

@ -71,8 +71,8 @@ ewol::ColorChooser::ColorChooser(void)
*/ */
SubWidgetAdd(m_widgetColorBar); SubWidgetAdd(m_widgetColorBar);
etk::Color sliderColor; draw::Color sliderColor;
sliderColor = etk::color::black; sliderColor = draw::color::black;
m_widgetRed = new ewol::Slider(); m_widgetRed = new ewol::Slider();
m_widgetRed->RegisterOnEvent(this, ewolEventSliderChange, eventColorSpecificHasChange); m_widgetRed->RegisterOnEvent(this, ewolEventSliderChange, eventColorSpecificHasChange);
@ -109,7 +109,7 @@ ewol::ColorChooser::ColorChooser(void)
m_widgetAlpha->SetMax(255); m_widgetAlpha->SetMax(255);
SubWidgetAdd(m_widgetAlpha); SubWidgetAdd(m_widgetAlpha);
m_currentColor = etk::color::white; m_currentColor = draw::color::white;
} }
@ -119,20 +119,20 @@ ewol::ColorChooser::~ColorChooser(void)
} }
void ewol::ColorChooser::SetColor(etk::Color newColor) void ewol::ColorChooser::SetColor(draw::Color newColor)
{ {
m_currentColor = newColor; m_currentColor = newColor;
if (NULL != m_widgetRed) { if (NULL != m_widgetRed) {
m_widgetRed->SetValue(m_currentColor.red); m_widgetRed->SetValue(m_currentColor.r);
} }
if (NULL != m_widgetGreen) { if (NULL != m_widgetGreen) {
m_widgetGreen->SetValue(m_currentColor.green); m_widgetGreen->SetValue(m_currentColor.g);
} }
if (NULL != m_widgetBlue) { if (NULL != m_widgetBlue) {
m_widgetBlue->SetValue(m_currentColor.blue); m_widgetBlue->SetValue(m_currentColor.b);
} }
if (NULL != m_widgetAlpha) { if (NULL != m_widgetAlpha) {
m_widgetAlpha->SetValue(m_currentColor.alpha); m_widgetAlpha->SetValue(m_currentColor.a);
} }
if (NULL != m_widgetColorBar) { if (NULL != m_widgetColorBar) {
m_widgetColorBar->SetCurrentColor(m_currentColor); m_widgetColorBar->SetCurrentColor(m_currentColor);
@ -140,7 +140,7 @@ void ewol::ColorChooser::SetColor(etk::Color newColor)
} }
etk::Color ewol::ColorChooser::GetColor(void) draw::Color ewol::ColorChooser::GetColor(void)
{ {
return m_currentColor; return m_currentColor;
} }
@ -161,39 +161,39 @@ void ewol::ColorChooser::OnReceiveMessage(ewol::EObject * CallerObject, const ch
//EWOL_INFO("Receive Extern Event ... : widgetPointer=" << CallerObject << "\"" << eventId << "\" ==> data=\"" << data << "\"" ); //EWOL_INFO("Receive Extern Event ... : widgetPointer=" << CallerObject << "\"" << eventId << "\" ==> data=\"" << data << "\"" );
if (eventColorBarHasChange == eventId) { if (eventColorBarHasChange == eventId) {
//==> colorBar has change ... //==> colorBar has change ...
uint8_t tmpAlpha = m_currentColor.alpha; uint8_t tmpAlpha = m_currentColor.a;
// the colorbar has no notion of the alpha ==> keep it ... // the colorbar has no notion of the alpha ==> keep it ...
if (NULL != m_widgetColorBar) { if (NULL != m_widgetColorBar) {
m_currentColor = m_widgetColorBar->GetCurrentColor(); m_currentColor = m_widgetColorBar->GetCurrentColor();
} }
m_currentColor.alpha = tmpAlpha; m_currentColor.a = tmpAlpha;
if (NULL != m_widgetRed) { if (NULL != m_widgetRed) {
m_widgetRed->SetValue(m_currentColor.red); m_widgetRed->SetValue(m_currentColor.r);
} }
if (NULL != m_widgetGreen) { if (NULL != m_widgetGreen) {
m_widgetGreen->SetValue(m_currentColor.green); m_widgetGreen->SetValue(m_currentColor.g);
} }
if (NULL != m_widgetBlue) { if (NULL != m_widgetBlue) {
m_widgetBlue->SetValue(m_currentColor.blue); m_widgetBlue->SetValue(m_currentColor.b);
} }
if (NULL != m_widgetAlpha) { if (NULL != m_widgetAlpha) {
m_widgetAlpha->SetValue(m_currentColor.alpha); m_widgetAlpha->SetValue(m_currentColor.a);
} }
// TODO : send the real color ... // TODO : send the real color ...
GenerateEventId(ewolEventColorChooserChange, "0x51452563"); GenerateEventId(ewolEventColorChooserChange, "0x51452563");
} else if (eventColorSpecificHasChange == eventId) { } else if (eventColorSpecificHasChange == eventId) {
// Slider has changes his color ==> get the one change ... // Slider has changes his color ==> get the one change ...
if (CallerObject == m_widgetRed) { if (CallerObject == m_widgetRed) {
m_currentColor.red = m_widgetRed->GetValue(); m_currentColor.r = m_widgetRed->GetValue();
} }
if (CallerObject == m_widgetGreen) { if (CallerObject == m_widgetGreen) {
m_currentColor.green = m_widgetGreen->GetValue(); m_currentColor.g = m_widgetGreen->GetValue();
} }
if (CallerObject == m_widgetBlue) { if (CallerObject == m_widgetBlue) {
m_currentColor.blue = m_widgetBlue->GetValue(); m_currentColor.b = m_widgetBlue->GetValue();
} }
if (CallerObject == m_widgetAlpha) { if (CallerObject == m_widgetAlpha) {
m_currentColor.alpha = m_widgetAlpha->GetValue(); m_currentColor.a = m_widgetAlpha->GetValue();
} }
if (NULL != m_widgetColorBar) { if (NULL != m_widgetColorBar) {
m_widgetColorBar->SetCurrentColor(m_currentColor); m_widgetColorBar->SetCurrentColor(m_currentColor);

View File

@ -66,15 +66,15 @@ namespace ewol {
*/ */
virtual void OnObjectRemove(ewol::EObject * removeObject); virtual void OnObjectRemove(ewol::EObject * removeObject);
void SetColor(etk::Color newColor); void SetColor(draw::Color newColor);
etk::Color GetColor(void); draw::Color GetColor(void);
private:; private:;
ewol::ColorBar* m_widgetColorBar; ewol::ColorBar* m_widgetColorBar;
ewol::Slider* m_widgetRed; ewol::Slider* m_widgetRed;
ewol::Slider* m_widgetGreen; ewol::Slider* m_widgetGreen;
ewol::Slider* m_widgetBlue; ewol::Slider* m_widgetBlue;
ewol::Slider* m_widgetAlpha; ewol::Slider* m_widgetAlpha;
etk::Color m_currentColor; draw::Color m_currentColor;
}; };
}; };

View File

@ -176,7 +176,7 @@ void ewol::ParameterList::OnRegenerateDisplay(void)
for(int32_t iii=startRaw; iii<nbRaw && iii<(startRaw+displayableRaw); iii++) { for(int32_t iii=startRaw; iii<nbRaw && iii<(startRaw+displayableRaw); iii++) {
etk::UString myTextToWrite = "???"; etk::UString myTextToWrite = "???";
etk::Color fg(0x000000FF); draw::Color fg(0x000000FF);
if (m_list[iii] != NULL) { if (m_list[iii] != NULL) {
myTextToWrite = m_list[iii]->m_label; myTextToWrite = m_list[iii]->m_label;
} }

View File

@ -29,6 +29,7 @@ FILE_LIST+= ewol/oObject/OObject.cpp \
# texture management # texture management
FILE_LIST+= ewol/texture/Texture.cpp \ FILE_LIST+= ewol/texture/Texture.cpp \
ewol/texture/TextureManager.cpp \
ewol/texture/TextureBMP.cpp \ ewol/texture/TextureBMP.cpp \
ewol/texture/TexturePNG.cpp \ ewol/texture/TexturePNG.cpp \
ewol/texture/TextureSVG.cpp ewol/texture/TextureSVG.cpp

@ -1 +1 @@
Subproject commit fc100697e315ac17c7fc6e3e4afa9e24e945ef7b Subproject commit 2037fb3efc117050ef7d32385f93cad3eec3e822