From 01f409de3a128aa86994e8dc9cf5f1d6fe0b9e25 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 12 Dec 2013 22:59:31 +0100 Subject: [PATCH] [DEV] update new archi --- sources/ewol/{context => }/Dimension.cpp | 164 ++++++++--------- sources/ewol/Dimension.h | 212 ++++++++++++++++++++++ sources/ewol/compositing/Text.cpp | 48 ++--- sources/ewol/context/ConfigFont.cpp | 8 +- sources/ewol/context/Context.cpp | 149 ++++++++-------- sources/ewol/context/Context.h | 30 ++-- sources/ewol/context/Dimension.h | 214 ----------------------- sources/ewol/context/InputManager.cpp | 88 +++++----- sources/ewol/context/InputManager.h | 23 +-- sources/ewol/context/X11/Context.cpp | 212 +++++++++++----------- sources/ewol/context/clipBoard.cpp | 8 +- sources/ewol/context/commandLine.cpp | 2 +- sources/ewol/context/cursor.cpp | 2 +- sources/ewol/ewol.cpp | 6 +- sources/ewol/key/Special.cpp | 2 +- sources/ewol/object/Config.cpp | 2 + sources/ewol/object/Manager.cpp | 2 +- sources/ewol/object/MultiCast.cpp | 2 +- sources/ewol/object/Object.cpp | 27 +-- sources/ewol/object/Object.h | 4 +- sources/ewol/openGL/openGL.cpp | 2 +- sources/ewol/resource/FontFreeType.h | 6 +- sources/ewol/widget/Widget.h | 36 ++-- sources/ewol/widget/Windows.h | 4 +- sources/lutin_ewol.py | 24 +-- 25 files changed, 632 insertions(+), 645 deletions(-) rename sources/ewol/{context => }/Dimension.cpp (54%) create mode 100644 sources/ewol/Dimension.h delete mode 100644 sources/ewol/context/Dimension.h diff --git a/sources/ewol/context/Dimension.cpp b/sources/ewol/Dimension.cpp similarity index 54% rename from sources/ewol/context/Dimension.cpp rename to sources/ewol/Dimension.cpp index 8237a534..c6f2145e 100644 --- a/sources/ewol/context/Dimension.cpp +++ b/sources/ewol/Dimension.cpp @@ -17,7 +17,7 @@ static bool isInit = false; static vec2 ratio(9999999,888888); static vec2 invRatio(1,1); -static ewol::context::Dimension windowsSize(vec2(9999999,888888), ewol::Dimension::Pixel); +static ewol::Dimension windowsSize(vec2(9999999,888888), ewol::Dimension::Pixel); static const float inchToMillimeter = 1.0f/25.4f; static const float footToMillimeter = 1.0f/304.8f; @@ -31,87 +31,87 @@ static const float millimeterToCentimeter = 10.0f; static const float millimeterToKilometer = 1000000.0f; -void ewol::context::Dimension::init(void) { +void ewol::Dimension::init(void) { if (true == isInit) { return; } - ewol::context::Dimension conversion(vec2(72,72), ewol::context::Dimension::Inch); + ewol::Dimension conversion(vec2(72,72), ewol::Dimension::Inch); ratio = conversion.getMillimeter(); invRatio.setValue(1.0f/ratio.x(),1.0f/ratio.y()); - windowsSize.set(vec2(200,200), ewol::context::Dimension::Pixel); + windowsSize.set(vec2(200,200), ewol::Dimension::Pixel); isInit = true; } -void ewol::context::Dimension::unInit(void) { +void ewol::Dimension::unInit(void) { isInit = false; ratio.setValue(9999999,888888); invRatio.setValue(1.0f/ratio.x(),1.0f/ratio.y()); - windowsSize.set(vec2(9999999,88888), ewol::context::Dimension::Pixel); + windowsSize.set(vec2(9999999,88888), ewol::Dimension::Pixel); } -void ewol::context::Dimension::setPixelRatio(const vec2& _ratio, enum ewol::context::Dimension::distance _type) { - ewol::context::Dimension::init(); +void ewol::Dimension::setPixelRatio(const vec2& _ratio, enum ewol::Dimension::distance _type) { + ewol::Dimension::init(); EWOL_INFO("Set a new screen ratio for the screen : ratio=" << _ratio << " type=" << _type); - ewol::context::Dimension conversion(_ratio, _type); + ewol::Dimension conversion(_ratio, _type); EWOL_INFO(" == > " << conversion); ratio = conversion.getMillimeter(); invRatio.setValue(1.0f/ratio.x(),1.0f/ratio.y()); EWOL_INFO("Set a new screen ratio for the screen : ratioMm=" << ratio); } -void ewol::context::Dimension::setPixelWindowsSize(const vec2& _size) { +void ewol::Dimension::setPixelWindowsSize(const vec2& _size) { windowsSize = _size; EWOL_VERBOSE("Set a new Windows property size " << windowsSize << "px"); } -vec2 ewol::context::Dimension::getWindowsSize(enum ewol::context::Dimension::distance _type) { +vec2 ewol::Dimension::getWindowsSize(enum ewol::Dimension::distance _type) { return windowsSize.get(_type); } -float ewol::context::Dimension::getWindowsDiag(enum ewol::context::Dimension::distance _type) { - vec2 size = ewol::context::Dimension::getWindowsSize(_type); +float ewol::Dimension::getWindowsDiag(enum ewol::Dimension::distance _type) { + vec2 size = ewol::Dimension::getWindowsSize(_type); return size.length(); } -ewol::context::Dimension::Dimension(void) : +ewol::Dimension::Dimension(void) : m_data(0,0), - m_type(ewol::context::Dimension::Pixel) { + m_type(ewol::Dimension::Pixel) { // notinh to do ... } -ewol::context::Dimension::Dimension(const vec2& _size, enum ewol::context::Dimension::distance _type) : +ewol::Dimension::Dimension(const vec2& _size, enum ewol::Dimension::distance _type) : m_data(0,0), - m_type(ewol::context::Dimension::Pixel) { + m_type(ewol::Dimension::Pixel) { set(_size, _type); } -void ewol::context::Dimension::set(std::string _config) { +void ewol::Dimension::set(std::string _config) { m_data.setValue(0,0); - m_type = ewol::context::Dimension::Pixel; - enum distance type = ewol::context::Dimension::Pixel; + m_type = ewol::Dimension::Pixel; + enum distance type = ewol::Dimension::Pixel; if (end_with(_config, "%", false) == true) { - type = ewol::context::Dimension::Pourcent; + type = ewol::Dimension::Pourcent; _config.erase(_config.size()-1, 1); } else if (end_with(_config, "px",false) == true) { - type = ewol::context::Dimension::Pixel; + type = ewol::Dimension::Pixel; _config.erase(_config.size()-2, 2); } else if (end_with(_config, "ft",false) == true) { - type = ewol::context::Dimension::foot; + type = ewol::Dimension::foot; _config.erase(_config.size()-2, 2); } else if (end_with(_config, "in",false) == true) { - type = ewol::context::Dimension::Inch; + type = ewol::Dimension::Inch; _config.erase(_config.size()-2, 2); } else if (end_with(_config, "km",false) == true) { - type = ewol::context::Dimension::Kilometer; + type = ewol::Dimension::Kilometer; _config.erase(_config.size()-2, 2); } else if (end_with(_config, "mm",false) == true) { - type = ewol::context::Dimension::Millimeter; + type = ewol::Dimension::Millimeter; _config.erase(_config.size()-2, 2); } else if (end_with(_config, "cm",false) == true) { - type = ewol::context::Dimension::Centimeter; + type = ewol::Dimension::Centimeter; _config.erase(_config.size()-2, 2); } else if (end_with(_config, "m",false) == true) { - type = ewol::context::Dimension::Meter; + type = ewol::Dimension::Meter; _config.erase(_config.size()-1, 1); } else { EWOL_CRITICAL("Can not parse dimention : \"" << _config << "\""); @@ -122,104 +122,104 @@ void ewol::context::Dimension::set(std::string _config) { EWOL_VERBOSE(" config dimention : \"" << _config << "\" == > " << *this ); } -ewol::context::Dimension::~Dimension(void) { +ewol::Dimension::~Dimension(void) { // nothing to do ... } -ewol::context::Dimension::operator std::string(void) const { +ewol::Dimension::operator std::string(void) const { std::string str; str = get(getType()); switch(getType()) { - case ewol::context::Dimension::Pourcent: + case ewol::Dimension::Pourcent: str += "%"; break; - case ewol::context::Dimension::Pixel: + case ewol::Dimension::Pixel: str += "px"; break; - case ewol::context::Dimension::Meter: + case ewol::Dimension::Meter: str += "m"; break; - case ewol::context::Dimension::Centimeter: + case ewol::Dimension::Centimeter: str += "cm"; break; - case ewol::context::Dimension::Millimeter: + case ewol::Dimension::Millimeter: str += "mm"; break; - case ewol::context::Dimension::Kilometer: + case ewol::Dimension::Kilometer: str += "km"; break; - case ewol::context::Dimension::Inch: + case ewol::Dimension::Inch: str += "in"; break; - case ewol::context::Dimension::foot: + case ewol::Dimension::foot: str += "ft"; break; } return str; } -vec2 ewol::context::Dimension::get(enum ewol::context::Dimension::distance _type) const { +vec2 ewol::Dimension::get(enum ewol::Dimension::distance _type) const { switch(_type) { - case ewol::context::Dimension::Pourcent: + case ewol::Dimension::Pourcent: return getPourcent(); - case ewol::context::Dimension::Pixel: + case ewol::Dimension::Pixel: return getPixel(); - case ewol::context::Dimension::Meter: + case ewol::Dimension::Meter: return getMeter(); - case ewol::context::Dimension::Centimeter: + case ewol::Dimension::Centimeter: return getCentimeter(); - case ewol::context::Dimension::Millimeter: + case ewol::Dimension::Millimeter: return getMillimeter(); - case ewol::context::Dimension::Kilometer: + case ewol::Dimension::Kilometer: return getKilometer(); - case ewol::context::Dimension::Inch: + case ewol::Dimension::Inch: return getInch(); - case ewol::context::Dimension::foot: + case ewol::Dimension::foot: return getFoot(); } return vec2(0,0); } -void ewol::context::Dimension::set(const vec2& _size, enum ewol::context::Dimension::distance _type) { +void ewol::Dimension::set(const vec2& _size, enum ewol::Dimension::distance _type) { // set min max on input to limit error : vec2 size(etk_avg(0.0f,_size.x(),9999999.0f), etk_avg(0.0f,_size.y(),9999999.0f)); switch(_type) { - case ewol::context::Dimension::Pourcent: { + case ewol::Dimension::Pourcent: { vec2 size2(etk_avg(0.0f,_size.x(),100.0f), etk_avg(0.0f,_size.y(),100.0f)); m_data = vec2(size2.x()*0.01f, size2.y()*0.01f); //EWOL_VERBOSE("Set % : " << size2 << " == > " << m_data); break; } - case ewol::context::Dimension::Pixel: + case ewol::Dimension::Pixel: m_data = size; break; - case ewol::context::Dimension::Meter: + case ewol::Dimension::Meter: m_data = vec2(size.x()*meterToMillimeter*ratio.x(), size.y()*meterToMillimeter*ratio.y()); break; - case ewol::context::Dimension::Centimeter: + case ewol::Dimension::Centimeter: m_data = vec2(size.x()*centimeterToMillimeter*ratio.x(), size.y()*centimeterToMillimeter*ratio.y()); break; - case ewol::context::Dimension::Millimeter: + case ewol::Dimension::Millimeter: m_data = vec2(size.x()*ratio.x(), size.y()*ratio.y()); break; - case ewol::context::Dimension::Kilometer: + case ewol::Dimension::Kilometer: m_data = vec2(size.x()*kilometerToMillimeter*ratio.x(), size.y()*kilometerToMillimeter*ratio.y()); break; - case ewol::context::Dimension::Inch: + case ewol::Dimension::Inch: m_data = vec2(size.x()*inchToMillimeter*ratio.x(), size.y()*inchToMillimeter*ratio.y()); break; - case ewol::context::Dimension::foot: + case ewol::Dimension::foot: m_data = vec2(size.x()*footToMillimeter*ratio.x(), size.y()*footToMillimeter*ratio.y()); break; } m_type = _type; } -vec2 ewol::context::Dimension::getPixel(void) const { - if (m_type!=ewol::context::Dimension::Pourcent) { +vec2 ewol::Dimension::getPixel(void) const { + if (m_type!=ewol::Dimension::Pourcent) { return m_data; } else { vec2 windDim = windowsSize.getPixel(); @@ -229,8 +229,8 @@ vec2 ewol::context::Dimension::getPixel(void) const { } } -vec2 ewol::context::Dimension::getPourcent(void) const { - if (m_type!=ewol::context::Dimension::Pourcent) { +vec2 ewol::Dimension::getPourcent(void) const { + if (m_type!=ewol::Dimension::Pourcent) { vec2 windDim = windowsSize.getPixel(); //EWOL_DEBUG(" windows dimention : " /*<< windowsSize*/ << " == > " << windDim << "px"); // ==> infinite loop ... //printf(" windows dimention : %f,%f", windDim.x(),windDim.y()); @@ -240,61 +240,61 @@ vec2 ewol::context::Dimension::getPourcent(void) const { return vec2(m_data.x()*100.0f, m_data.y()*100.0f);; } -vec2 ewol::context::Dimension::getMeter(void) const { - return ewol::context::Dimension::getMillimeter()*millimeterToMeter; +vec2 ewol::Dimension::getMeter(void) const { + return ewol::Dimension::getMillimeter()*millimeterToMeter; } -vec2 ewol::context::Dimension::getCentimeter(void) const { - return ewol::context::Dimension::getMillimeter()*millimeterToCentimeter; +vec2 ewol::Dimension::getCentimeter(void) const { + return ewol::Dimension::getMillimeter()*millimeterToCentimeter; } -vec2 ewol::context::Dimension::getMillimeter(void) const { - return ewol::context::Dimension::getPixel()*invRatio; +vec2 ewol::Dimension::getMillimeter(void) const { + return ewol::Dimension::getPixel()*invRatio; } -vec2 ewol::context::Dimension::getKilometer(void) const { - return ewol::context::Dimension::getMillimeter()*millimeterToKilometer; +vec2 ewol::Dimension::getKilometer(void) const { + return ewol::Dimension::getMillimeter()*millimeterToKilometer; } -vec2 ewol::context::Dimension::getInch(void) const { - return ewol::context::Dimension::getMillimeter()*millimeterToInch; +vec2 ewol::Dimension::getInch(void) const { + return ewol::Dimension::getMillimeter()*millimeterToInch; } -vec2 ewol::context::Dimension::getFoot(void) const { - return ewol::context::Dimension::getMillimeter()*millimeterToFoot; +vec2 ewol::Dimension::getFoot(void) const { + return ewol::Dimension::getMillimeter()*millimeterToFoot; } -etk::CCout& ewol::operator <<(etk::CCout& _os, enum ewol::context::Dimension::distance _obj) { +etk::CCout& ewol::operator <<(etk::CCout& _os, enum ewol::Dimension::distance _obj) { switch(_obj) { - case ewol::context::Dimension::Pourcent: + case ewol::Dimension::Pourcent: _os << "%"; break; - case ewol::context::Dimension::Pixel: + case ewol::Dimension::Pixel: _os << "px"; break; - case ewol::context::Dimension::Meter: + case ewol::Dimension::Meter: _os << "m"; break; - case ewol::context::Dimension::Centimeter: + case ewol::Dimension::Centimeter: _os << "cm"; break; - case ewol::context::Dimension::Millimeter: + case ewol::Dimension::Millimeter: _os << "mm"; break; - case ewol::context::Dimension::Kilometer: + case ewol::Dimension::Kilometer: _os << "km"; break; - case ewol::context::Dimension::Inch: + case ewol::Dimension::Inch: _os << "in"; break; - case ewol::context::Dimension::foot: + case ewol::Dimension::foot: _os << "ft"; break; } return _os; } -etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::context::Dimension& _obj) { +etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::Dimension& _obj) { _os << _obj.get(_obj.getType()) << _obj.getType(); return _os; } diff --git a/sources/ewol/Dimension.h b/sources/ewol/Dimension.h new file mode 100644 index 00000000..ac213f98 --- /dev/null +++ b/sources/ewol/Dimension.h @@ -0,0 +1,212 @@ +/** + * @author Edouard DUPIN + * + * @copyright 2011, Edouard DUPIN, all right reserved + * + * @license BSD v3 (see license file) + */ + +#ifndef __EWOL_DIMENSION_H__ +#define __EWOL_DIMENSION_H__ + +#include +#include +#include + +namespace ewol { + /** + * @brief in the dimention class we store the data as the more usefull unit (pixel) + * but one case need to be dynamic the %, then when requested in % the register the % value + */ + class Dimension { + public: + enum distance { + Pourcent=0, + Pixel, + Meter, + Centimeter, + Millimeter, + Kilometer, + Inch, + foot, + }; + private: + vec2 m_data; + enum distance m_type; + public: + /** + * @brief Constructor (default :0,0 mode pixel) + */ + Dimension(void); + /** + * @brief Constructor + * @param[in] _size Requested dimention + * @param[in] _type Unit of the Dimention + */ + Dimension(const vec2& _size, enum ewol::Dimension::distance _type=ewol::Dimension::Pixel); + /** + * @brief Constructor + * @param[in] _config dimension configuration. + */ + Dimension(const std::string& _config) : + m_data(0,0), + m_type(ewol::Dimension::Pixel) { + set(_config); + }; + /** + * @brief Constructor + * @param[in] _config dimension configuration. + */ + Dimension(const char* _config) : + m_data(0,0), + m_type(ewol::Dimension::Pixel) { + set(_config); + }; + /** + * @brief Destructor + */ + ~Dimension(void); + + /** + * @brief string cast : + */ + operator std::string(void) const; + + /** + * @brief get the current dimention in requested type + * @param[in] _type Type of unit requested. + * @return dimention requested. + */ + vec2 get(enum distance _type) const; + /** + * @brief set the current dimention in requested type + * @param[in] _size Dimention to set + * @param[in] _type Type of unit requested. + */ + void set(const vec2& _size, enum distance _type); + + private: + /** + * @brief set the current dimention in requested type + * @param[in] _config dimension configuration. + */ + void set(std::string _config); + public: + /** + * @brief get the current dimention in pixel + * @return dimention in Pixel + */ + vec2 getPixel(void) const; + /** + * @brief get the current dimention in Pourcent + * @return dimention in Pourcent + */ + vec2 getPourcent(void) const; + /** + * @brief get the current dimention in Meter + * @return dimention in Meter + */ + vec2 getMeter(void) const; + /** + * @brief get the current dimention in Centimeter + * @return dimention in Centimeter + */ + vec2 getCentimeter(void) const; + /** + * @brief get the current dimention in Millimeter + * @return dimention in Millimeter + */ + vec2 getMillimeter(void) const; + /** + * @brief get the current dimention in Kilometer + * @return dimention in Kilometer + */ + vec2 getKilometer(void) const; + /** + * @brief get the current dimention in Inch + * @return dimention in Inch + */ + vec2 getInch(void) const; + /** + * @brief get the current dimention in Foot + * @return dimention in Foot + */ + vec2 getFoot(void) const; + /***************************************************** + * = assigment + *****************************************************/ + const Dimension& operator= (const Dimension& _obj ) { + if (this!=&_obj) { + m_data = _obj.m_data; + m_type = _obj.m_type; + } + return *this; + } + /***************************************************** + * == operator + *****************************************************/ + bool operator == (const Dimension& _obj) const { + if( m_data == _obj.m_data + && m_type == _obj.m_type) { + return true; + } + return false; + } + /***************************************************** + * != operator + *****************************************************/ + bool operator!= (const Dimension& _obj) const { + if( m_data != _obj.m_data + || m_type != _obj.m_type) { + return true; + } + return false; + } + /** + * @breif get the dimension type + * @return the type + */ + enum distance getType(void) const { + return m_type; + }; + public : // Global static access : + /** + * @brief basic init + */ + static void init(void); + /** + * @brief basic un-init + */ + static void unInit(void); + /** + * @brief set the Milimeter ratio for calculation + * @param[in] Ratio Milimeter ration for the screen calculation interpolation + * @param[in] type Unit type requested. + * @note: same as @ref setPixelPerInch (internal manage convertion) + */ + static void setPixelRatio(const vec2& _ratio, enum ewol::Dimension::distance _type); + /** + * @brief set the current Windows size + * @param[in] size size of the current windows in pixel. + */ + static void setPixelWindowsSize(const vec2& _size); + /** + * @brief get the Windows size in the request unit + * @param[in] type Unit type requested. + * @return the requested size + */ + static vec2 getWindowsSize(enum ewol::Dimension::distance _type); + /** + * @brief get the Windows diagonal size in the request unit + * @param[in] type Unit type requested. + * @return the requested size + */ + static float getWindowsDiag(enum ewol::Dimension::distance _type); + + }; + etk::CCout& operator <<(etk::CCout& _os, enum ewol::Dimension::distance _obj); + etk::CCout& operator <<(etk::CCout& _os, const ewol::Dimension& _obj); +}; + +#endif + diff --git a/sources/ewol/compositing/Text.cpp b/sources/ewol/compositing/Text.cpp index e59cbccc..96f904bf 100644 --- a/sources/ewol/compositing/Text.cpp +++ b/sources/ewol/compositing/Text.cpp @@ -183,7 +183,7 @@ void ewol::compositing::Text::reset(void) { m_previousCharcode = 0; m_startTextpos = 0; m_stopTextPos = 0; - m_alignement = ewol::Text::alignDisable; + m_alignement = alignDisable; m_htmlCurrrentLine = ""; m_selectionStartPos = -100; m_cursorPos = -100; @@ -289,7 +289,7 @@ void ewol::compositing::Text::setFontName(const std::string& _fontName) { void ewol::compositing::Text::setFont(std::string _fontName, int32_t _fontSize) { clear(); // remove old one - ewol::TexturedFont * previousFont = m_font; + ewol::resource::TexturedFont * previousFont = m_font; if (_fontSize <= 0) { _fontSize = ewol::getContext().getFontDefault().getSize(); } @@ -300,12 +300,12 @@ void ewol::compositing::Text::setFont(std::string _fontName, int32_t _fontSize) _fontName += std::to_string(_fontSize); EWOL_VERBOSE("plop : " << _fontName << " size=" << _fontSize << " result :" << _fontName); // link to new one - m_font = ewol::TexturedFont::keep(_fontName); + m_font = ewol::resource::TexturedFont::keep(_fontName); if (m_font == NULL) { EWOL_ERROR("Can not get font resource"); m_font = previousFont; } else { - ewol::TexturedFont::release(previousFont); + ewol::resource::TexturedFont::release(previousFont); } } @@ -315,7 +315,7 @@ void ewol::compositing::Text::setFontMode(enum ewol::font::mode _mode) { } } -enum ewol::font::mode ewol::Text::getFontMode(void) { +enum ewol::font::mode ewol::compositing::Text::getFontMode(void) { return m_mode; } @@ -440,29 +440,29 @@ void ewol::compositing::Text::parseHtmlNode(exml::Element* _element) { || compare_no_case(elem->getValue(), "paragraph") == true) { EWOL_VERBOSE("XML paragraph ..."); htmlFlush(); - m_alignement = ewol::Text::alignLeft; + m_alignement = alignLeft; forceLineReturn(); parseHtmlNode(elem); forceLineReturn(); } else if (compare_no_case(elem->getValue(), "center") == true) { EWOL_VERBOSE("XML center ..."); htmlFlush(); - m_alignement = ewol::Text::alignCenter; + m_alignement = alignCenter; parseHtmlNode(elem); } else if (compare_no_case(elem->getValue(), "left") == true) { EWOL_VERBOSE("XML left ..."); htmlFlush(); - m_alignement = ewol::Text::alignLeft; + m_alignement = alignLeft; parseHtmlNode(elem); } else if (compare_no_case(elem->getValue(), "right") == true) { EWOL_VERBOSE("XML right ..."); htmlFlush(); - m_alignement = ewol::Text::alignRight; + m_alignement = alignRight; parseHtmlNode(elem); } else if (compare_no_case(elem->getValue(), "justify") == true) { EWOL_VERBOSE("XML justify ..."); htmlFlush(); - m_alignement = ewol::Text::alignJustify; + m_alignement = alignJustify; parseHtmlNode(elem); } else { EWOL_ERROR("(l "<< elem->getPos() << ") node not suported type : " << elem->getType() << " val=\""<< elem->getValue() << "\"" ); @@ -513,7 +513,7 @@ void ewol::compositing::Text::print(const std::string& _text, const std::vector< } etk::Color<> tmpFg(m_color); etk::Color<> tmpBg(m_colorBg); - if (m_alignement == ewol::Text::alignDisable) { + if (m_alignement == alignDisable) { //EWOL_DEBUG(" 1 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); // display the cursor if needed (if it is at the start position...) if (m_needDisplay == true) { @@ -581,16 +581,16 @@ void ewol::compositing::Text::print(const std::string& _text, const std::vector< bool needNoJustify = extrapolateLastId(_text, currentId, stop, space, freeSpace); float interpolation = basicSpaceWidth; switch (m_alignement) { - case ewol::Text::alignJustify: + case alignJustify: if (needNoJustify == false) { interpolation += (float)freeSpace / (float)(space-1); } break; - case ewol::Text::alignDisable: // must not came from here ... - case ewol::Text::alignLeft: + case alignDisable: // must not came from here ... + case alignLeft: // nothing to do ... break; - case ewol::Text::alignRight: + case alignRight: if (m_needDisplay == true) { // Move the first char at the right : setPos(vec3(m_position.x() + freeSpace, @@ -598,7 +598,7 @@ void ewol::compositing::Text::print(const std::string& _text, const std::vector< m_position.z()) ); } break; - case ewol::Text::alignCenter: + case alignCenter: if (m_needDisplay == true) { // Move the first char at the right : setPos(vec3(m_position.x() + freeSpace/2, @@ -702,7 +702,7 @@ void ewol::compositing::Text::print(const std::u32string& _text, const std::vect } etk::Color<> tmpFg(m_color); etk::Color<> tmpBg(m_colorBg); - if (m_alignement == ewol::Text::alignDisable) { + if (m_alignement == alignDisable) { //EWOL_DEBUG(" 1 print in not alligned mode : start=" << m_sizeDisplayStart << " stop=" << m_sizeDisplayStop << " pos=" << m_position); // display the cursor if needed (if it is at the start position...) if (m_needDisplay == true) { @@ -770,16 +770,16 @@ void ewol::compositing::Text::print(const std::u32string& _text, const std::vect bool needNoJustify = extrapolateLastId(_text, currentId, stop, space, freeSpace); float interpolation = basicSpaceWidth; switch (m_alignement) { - case ewol::Text::alignJustify: + case alignJustify: if (needNoJustify == false) { interpolation += (float)freeSpace / (float)(space-1); } break; - case ewol::Text::alignDisable: // must not came from here ... - case ewol::Text::alignLeft: + case alignDisable: // must not came from here ... + case alignLeft: // nothing to do ... break; - case ewol::Text::alignRight: + case alignRight: if (m_needDisplay == true) { // Move the first char at the right : setPos(vec3(m_position.x() + freeSpace, @@ -787,7 +787,7 @@ void ewol::compositing::Text::print(const std::u32string& _text, const std::vect m_position.z()) ); } break; - case ewol::Text::alignCenter: + case alignCenter: if (m_needDisplay == true) { // Move the first char at the right : setPos(vec3(m_position.x() + freeSpace/2, @@ -1061,7 +1061,7 @@ void ewol::compositing::Text::forceLineReturn(void) { setPos(vec3(m_startTextpos, m_position.y() - m_font->getHeight(m_mode), 0) ); } -void ewol::compositing::Text::setTextAlignement(float _startTextpos, float _stopTextPos, enum ewol::Text::aligneMode _alignement) { +void ewol::compositing::Text::setTextAlignement(float _startTextpos, float _stopTextPos, enum ewol::compositing::Text::aligneMode _alignement) { m_startTextpos = _startTextpos; m_stopTextPos = _stopTextPos+1; m_alignement = _alignement; @@ -1075,7 +1075,7 @@ enum ewol::compositing::Text::aligneMode ewol::compositing::Text::getAlignement( } void ewol::compositing::Text::disableAlignement(void) { - m_alignement = ewol::Text::alignDisable; + m_alignement = alignDisable; } vec3 ewol::compositing::Text::calculateSizeHTML(const std::string& _text) { diff --git a/sources/ewol/context/ConfigFont.cpp b/sources/ewol/context/ConfigFont.cpp index 9e603c59..2a47236f 100644 --- a/sources/ewol/context/ConfigFont.cpp +++ b/sources/ewol/context/ConfigFont.cpp @@ -6,8 +6,8 @@ * @license BSD v3 (see license file) */ -#include -#include +#include +#include #undef __class__ #define __class__ "context::ConfigFont" @@ -17,12 +17,12 @@ ewol::context::ConfigFont::ConfigFont(void) : m_name("Arial;Helvetica"), m_size(10), m_useExternal(false) { - ewol::freeTypeInit(); + ewol::resource::freeTypeInit(); } ewol::context::ConfigFont::~ConfigFont(void) { // UnInit FreeTypes - ewol::freeTypeUnInit(); + ewol::resource::freeTypeUnInit(); } void ewol::context::ConfigFont::set(const std::string& _fontName, int32_t _size) { diff --git a/sources/ewol/context/Context.cpp b/sources/ewol/context/Context.cpp index d72f7b4d..70c632bd 100644 --- a/sources/ewol/context/Context.cpp +++ b/sources/ewol/context/Context.cpp @@ -10,24 +10,25 @@ #include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include - #include #include #include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + + /** * @brief get the main ewol mutex (event or periodic call mutex). * @note due ti the fact that the system can be called for multiple instance, for naw we just limit the acces to one process at a time. @@ -39,8 +40,8 @@ static etk::Mutex& mutexInterface(void) { } -static ewol::eContext* l_curentInterface=NULL; -ewol::eContext& ewol::getContext(void) { +static ewol::Context* l_curentInterface=NULL; +ewol::Context& ewol::getContext(void) { #if DEBUG_LEVEL > 2 if(NULL == l_curentInterface){ EWOL_CRITICAL("[CRITICAL] try acces at an empty interface"); @@ -53,7 +54,7 @@ ewol::eContext& ewol::getContext(void) { * @brief set the curent interface. * @note this lock the main mutex */ -void ewol::eContext::lockContext(void) { +void ewol::Context::lockContext(void) { mutexInterface().lock(); l_curentInterface = this; } @@ -62,7 +63,7 @@ void ewol::eContext::lockContext(void) { * @brief set the curent interface at NULL. * @note this un-lock the main mutex */ -void ewol::eContext::unLockContext(void) { +void ewol::Context::unLockContext(void) { l_curentInterface = NULL; mutexInterface().unLock(); } @@ -91,9 +92,9 @@ namespace ewol { // specify the message type enum theadMessage TypeMessage; // can not set a union ... - enum ewol::clipBoard::clipboardListe clipboardID; + enum ewol::context::clipBoard::clipboardListe clipboardID; // InputId - enum ewol::keyEvent::type inputType; + enum ewol::key::type inputType; int32_t inputId; // generic dimentions vec2 dimention; @@ -101,19 +102,19 @@ namespace ewol { bool repeateKey; //!< special flag for the repeating key on the PC interface bool stateIsDown; char32_t keyboardChar; - enum ewol::keyEvent::keyboard keyboardMove; - ewol::SpecialKey keyboardSpecial; + enum ewol::key::keyboard keyboardMove; + ewol::key::Special keyboardSpecial; eSystemMessage(void) : TypeMessage(msgNone), - clipboardID(ewol::clipBoard::clipboardStd), - inputType(ewol::keyEvent::typeUnknow), + clipboardID(ewol::context::clipBoard::clipboardStd), + inputType(ewol::key::typeUnknow), inputId(-1), dimention(0,0), repeateKey(false), stateIsDown(false), keyboardChar(0), - keyboardMove(ewol::keyEvent::keyboardUnknow) + keyboardMove(ewol::key::keyboardUnknow) { } @@ -121,21 +122,21 @@ namespace ewol { }; -void ewol::eContext::inputEventTransfertWidget(ewol::Widget* _source, +void ewol::Context::inputEventTransfertWidget(ewol::Widget* _source, ewol::Widget* _destination) { m_input.transfertEvent(_source, _destination); } -void ewol::eContext::inputEventGrabPointer(ewol::Widget* _widget) { +void ewol::Context::inputEventGrabPointer(ewol::Widget* _widget) { m_input.grabPointer(_widget); } -void ewol::eContext::inputEventUnGrabPointer(void) { +void ewol::Context::inputEventUnGrabPointer(void) { m_input.unGrabPointer(); } -void ewol::eContext::processEvents(void) { +void ewol::Context::processEvents(void) { int32_t nbEvent = 0; //EWOL_DEBUG(" ******** Event"); ewol::eSystemMessage* data = NULL; @@ -159,7 +160,7 @@ void ewol::eContext::processEvents(void) { case eSystemMessage::msgResize: //EWOL_DEBUG("Receive MSG : THREAD_RESIZE"); m_windowsSize = data->dimention; - ewol::dimension::setPixelWindowsSize(m_windowsSize); + ewol::Dimension::setPixelWindowsSize(m_windowsSize); forceRedrawAll(); break; case eSystemMessage::msgInputMotion: @@ -193,22 +194,22 @@ void ewol::eContext::processEvents(void) { data->stateIsDown) ) { // generate the direct event ... if (data->TypeMessage == eSystemMessage::msgKeyboardKey) { - ewol::EventEntrySystem tmpEntryEvent(ewol::keyEvent::keyboardChar, - ewol::keyEvent::statusUp, + ewol::event::EntrySystem tmpEntryEvent(ewol::key::keyboardChar, + ewol::key::statusUp, data->keyboardSpecial, data->keyboardChar); if(true == data->stateIsDown) { - tmpEntryEvent.m_event.setStatus(ewol::keyEvent::statusDown); + tmpEntryEvent.m_event.setStatus(ewol::key::statusDown); } tmpWidget->systemEventEntry(tmpEntryEvent); } else { // THREAD_KEYBORAD_MOVE EWOL_DEBUG("THREAD_KEYBORAD_MOVE" << data->keyboardMove << " " << data->stateIsDown); - ewol::EventEntrySystem tmpEntryEvent(data->keyboardMove, - ewol::keyEvent::statusUp, + ewol::event::EntrySystem tmpEntryEvent(data->keyboardMove, + ewol::key::statusUp, data->keyboardSpecial, 0); if(true == data->stateIsDown) { - tmpEntryEvent.m_event.setStatus(ewol::keyEvent::statusDown); + tmpEntryEvent.m_event.setStatus(ewol::key::statusDown); } tmpWidget->systemEventEntry(tmpEntryEvent); } @@ -245,7 +246,7 @@ void ewol::eContext::processEvents(void) { } } -void ewol::eContext::setArchiveDir(int _mode, const char* _str) { +void ewol::Context::setArchiveDir(int _mode, const char* _str) { switch(_mode) { case 0: EWOL_DEBUG("Directory APK : path=" << _str); @@ -270,7 +271,7 @@ void ewol::eContext::setArchiveDir(int _mode, const char* _str) { -ewol::eContext::eContext(int32_t _argc, const char* _argv[]) : +ewol::Context::Context(int32_t _argc, const char* _argv[]) : m_previousDisplayTime(0), m_input(*this), #if defined(__TARGET_OS__Android) @@ -343,7 +344,7 @@ ewol::eContext::eContext(int32_t _argc, const char* _argv[]) : EWOL_INFO(" == > Ewol system init (END)"); } -ewol::eContext::~eContext(void) { +ewol::Context::~Context(void) { EWOL_INFO(" == > Ewol system Un-Init (BEGIN)"); // TODO : Clean the message list ... // set the curent interface : @@ -364,7 +365,7 @@ ewol::eContext::~eContext(void) { EWOL_INFO(" == > Ewol system Un-Init (END)"); } -void ewol::eContext::requestUpdateSize(void) { +void ewol::Context::requestUpdateSize(void) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); if (data == NULL) { EWOL_ERROR("allocationerror of message"); @@ -374,9 +375,9 @@ void ewol::eContext::requestUpdateSize(void) { m_msgSystem.post(data); } -void ewol::eContext::OS_Resize(const vec2& _size) { +void ewol::Context::OS_Resize(const vec2& _size) { // TODO : Better in the thread ... == > but generate some init error ... - ewol::dimension::setPixelWindowsSize(_size); + ewol::Dimension::setPixelWindowsSize(_size); ewol::eSystemMessage *data = new ewol::eSystemMessage(); if (data == NULL) { EWOL_ERROR("allocationerror of message"); @@ -386,7 +387,7 @@ void ewol::eContext::OS_Resize(const vec2& _size) { data->dimention = _size; m_msgSystem.post(data); } -void ewol::eContext::OS_Move(const vec2& _pos) { +void ewol::Context::OS_Move(const vec2& _pos) { /* ewol::eSystemMessage *data = new ewol::eSystemMessage(); data->TypeMessage = eSystemMessage::msgResize; @@ -396,61 +397,61 @@ void ewol::eContext::OS_Move(const vec2& _pos) { */ } -void ewol::eContext::OS_SetInputMotion(int _pointerID, const vec2& _pos ) { +void ewol::Context::OS_SetInputMotion(int _pointerID, const vec2& _pos ) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); if (data == NULL) { EWOL_ERROR("allocationerror of message"); return; } data->TypeMessage = eSystemMessage::msgInputMotion; - data->inputType = ewol::keyEvent::typeFinger; + data->inputType = ewol::key::typeFinger; data->inputId = _pointerID; data->dimention = _pos; m_msgSystem.post(data); } -void ewol::eContext::OS_SetInputState(int _pointerID, bool _isDown, const vec2& _pos ) { +void ewol::Context::OS_SetInputState(int _pointerID, bool _isDown, const vec2& _pos ) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); if (data == NULL) { EWOL_ERROR("allocationerror of message"); return; } data->TypeMessage = eSystemMessage::msgInputState; - data->inputType = ewol::keyEvent::typeFinger; + data->inputType = ewol::key::typeFinger; data->inputId = _pointerID; data->stateIsDown = _isDown; data->dimention = _pos; m_msgSystem.post(data); } -void ewol::eContext::OS_SetMouseMotion(int _pointerID, const vec2& _pos ) { +void ewol::Context::OS_SetMouseMotion(int _pointerID, const vec2& _pos ) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); if (data == NULL) { EWOL_ERROR("allocationerror of message"); return; } data->TypeMessage = eSystemMessage::msgInputMotion; - data->inputType = ewol::keyEvent::typeMouse; + data->inputType = ewol::key::typeMouse; data->inputId = _pointerID; data->dimention = _pos; m_msgSystem.post(data); } -void ewol::eContext::OS_SetMouseState(int _pointerID, bool _isDown, const vec2& _pos ) { +void ewol::Context::OS_SetMouseState(int _pointerID, bool _isDown, const vec2& _pos ) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); if (data == NULL) { EWOL_ERROR("allocationerror of message"); return; } data->TypeMessage = eSystemMessage::msgInputState; - data->inputType = ewol::keyEvent::typeMouse; + data->inputType = ewol::key::typeMouse; data->inputId = _pointerID; data->stateIsDown = _isDown; data->dimention = _pos; m_msgSystem.post(data); } -void ewol::eContext::OS_SetKeyboard(ewol::SpecialKey& _special, +void ewol::Context::OS_SetKeyboard(ewol::key::Special& _special, char32_t _myChar, bool _isDown, bool _isARepeateKey) { @@ -467,8 +468,8 @@ void ewol::eContext::OS_SetKeyboard(ewol::SpecialKey& _special, m_msgSystem.post(data); } -void ewol::eContext::OS_SetKeyboardMove(ewol::SpecialKey& _special, - enum ewol::keyEvent::keyboard _move, +void ewol::Context::OS_SetKeyboardMove(ewol::key::Special& _special, + enum ewol::key::keyboard _move, bool _isDown, bool _isARepeateKey) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); @@ -484,7 +485,7 @@ void ewol::eContext::OS_SetKeyboardMove(ewol::SpecialKey& _special, m_msgSystem.post(data); } -void ewol::eContext::OS_Hide(void) { +void ewol::Context::OS_Hide(void) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); if (data == NULL) { EWOL_ERROR("allocationerror of message"); @@ -494,7 +495,7 @@ void ewol::eContext::OS_Hide(void) { m_msgSystem.post(data); } -void ewol::eContext::OS_Show(void) { +void ewol::Context::OS_Show(void) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); if (data == NULL) { EWOL_ERROR("allocationerror of message"); @@ -505,7 +506,7 @@ void ewol::eContext::OS_Show(void) { } -void ewol::eContext::OS_ClipBoardArrive(enum ewol::clipBoard::clipboardListe _clipboardID) { +void ewol::Context::OS_ClipBoardArrive(enum ewol::context::clipBoard::clipboardListe _clipboardID) { ewol::eSystemMessage *data = new ewol::eSystemMessage(); if (data == NULL) { EWOL_ERROR("allocationerror of message"); @@ -516,7 +517,7 @@ void ewol::eContext::OS_ClipBoardArrive(enum ewol::clipBoard::clipboardListe _cl m_msgSystem.post(data); } -bool ewol::eContext::OS_Draw(bool _displayEveryTime) { +bool ewol::Context::OS_Draw(bool _displayEveryTime) { int64_t currentTime = ewol::getTime(); // this is to prevent the multiple display at the a high frequency ... #if (!defined(__TARGET_OS__Android) && !defined(__TARGET_OS__Windows)) @@ -542,7 +543,7 @@ bool ewol::eContext::OS_Draw(bool _displayEveryTime) { //! ewol::widgetManager::periodicCall(currentTime); m_widgetManager.periodicCall(currentTime); // remove all widget that they are no more usefull (these who decided to destroy themself) - //! ewol::EObjectManager::removeAllAutoRemove(); + //! ewol::ObjectManager::removeAllAutoRemove(); m_EObjectManager.removeAllAutoRemove(); // check if the user selected a windows if (NULL != m_windowsCurrent) { @@ -609,20 +610,20 @@ bool ewol::eContext::OS_Draw(bool _displayEveryTime) { return hasDisplayDone; } -void ewol::eContext::onObjectRemove(ewol::EObject * _removeObject) { +void ewol::Context::onObjectRemove(ewol::Object * _removeObject) { //EWOL_CRITICAL("element removed"); m_input.onObjectRemove(_removeObject); } -void ewol::eContext::resetIOEvent(void) { +void ewol::Context::resetIOEvent(void) { m_input.newLayerSet(); } -void ewol::eContext::OS_OpenGlContextDestroy(void) { +void ewol::Context::OS_OpenGlContextDestroy(void) { m_resourceManager.contextHasBeenDestroyed(); } -void ewol::eContext::setWindows(ewol::Windows* _windows) { +void ewol::Context::setWindows(ewol::widget::Windows* _windows) { // remove current focus : m_widgetManager.focusSetDefault(NULL); m_widgetManager.focusRelease(); @@ -634,57 +635,57 @@ void ewol::eContext::setWindows(ewol::Windows* _windows) { forceRedrawAll(); } -void ewol::eContext::forceRedrawAll(void) { +void ewol::Context::forceRedrawAll(void) { if (NULL != m_windowsCurrent) { m_windowsCurrent->calculateSize(vec2(m_windowsSize.x(), m_windowsSize.y())); } } -void ewol::eContext::OS_Stop(void) { +void ewol::Context::OS_Stop(void) { if (NULL != m_windowsCurrent) { m_windowsCurrent->sysOnKill(); } } -void ewol::eContext::OS_Suspend(void) { +void ewol::Context::OS_Suspend(void) { m_previousDisplayTime = -1; } -void ewol::eContext::OS_Resume(void) { +void ewol::Context::OS_Resume(void) { m_previousDisplayTime = ewol::getTime(); m_widgetManager.periodicCallResume(m_previousDisplayTime); } -void ewol::eContext::stop(void) { +void ewol::Context::stop(void) { } -void ewol::eContext::setSize(const vec2& _size) { +void ewol::Context::setSize(const vec2& _size) { EWOL_INFO("setSize: NOT implemented ..."); }; -void ewol::eContext::setPos(const vec2& _pos) { +void ewol::Context::setPos(const vec2& _pos) { EWOL_INFO("setPos: NOT implemented ..."); } -void ewol::eContext::hide(void) { +void ewol::Context::hide(void) { EWOL_INFO("hide: NOT implemented ..."); }; -void ewol::eContext::show(void) { +void ewol::Context::show(void) { EWOL_INFO("show: NOT implemented ..."); } -void ewol::eContext::setTitle(const std::string& _title) { +void ewol::Context::setTitle(const std::string& _title) { EWOL_INFO("setTitle: NOT implemented ..."); } -void ewol::eContext::keyboardShow(void) { +void ewol::Context::keyboardShow(void) { EWOL_INFO("keyboardShow: NOT implemented ..."); } -void ewol::eContext::keyboardHide(void) { +void ewol::Context::keyboardHide(void) { EWOL_INFO("keyboardHide: NOT implemented ..."); } diff --git a/sources/ewol/context/Context.h b/sources/ewol/context/Context.h index 9d012232..1c674e44 100644 --- a/sources/ewol/context/Context.h +++ b/sources/ewol/context/Context.h @@ -24,6 +24,10 @@ #include namespace ewol { + /** + * @not-in-doc + */ + class eSystemMessage; /** * @not-in-doc */ @@ -80,7 +84,7 @@ namespace ewol { void unLockContext(void); private: int64_t m_previousDisplayTime; // this is to limit framerate ... in case... - ewol::InputManager m_input; + ewol::context::InputManager m_input; etk::MessageFifo m_msgSystem; bool m_displayFps; ewol::context::Fps m_FpsSystemEvent; @@ -101,12 +105,12 @@ namespace ewol { virtual void OS_SetMouseMotion(int _pointerID, const vec2& _pos); virtual void OS_SetMouseState(int _pointerID, bool _isDown, const vec2& _pos); - virtual void OS_SetKeyboard(ewol::SpecialKey& _special, + virtual void OS_SetKeyboard(ewol::key::Special& _special, char32_t _myChar, bool _isDown, bool _isARepeateKey=false); - virtual void OS_SetKeyboardMove(ewol::SpecialKey& _special, - enum ewol::keyEvent::keyboard _move, + virtual void OS_SetKeyboardMove(ewol::key::Special& _special, + enum ewol::key::keyboard _move, bool _isDown, bool _isARepeateKey=false); /** @@ -127,7 +131,7 @@ namespace ewol { * @param[in] removeObject Pointer on the EObject removed == > the user must remove all reference on this EObject * @note : Sub classes must call this class */ - void onObjectRemove(ewol::EObject* _removeObject); + void onObjectRemove(ewol::Object* _removeObject); /** * @brief reset event management for the IO like Input ou Mouse or keyborad */ @@ -145,18 +149,18 @@ namespace ewol { */ virtual void stop(void); private: - ewol::Windows* m_windowsCurrent; //!< curent displayed windows + ewol::widget::Windows* m_windowsCurrent; //!< curent displayed windows public: /** * @brief set the current windows to display : * @param _windows Windows that might be displayed */ - void setWindows(ewol::Windows* _windows); + void setWindows(ewol::widget::Windows* _windows); /** * @brief get the current windows that is displayed * @return the current handle on the windows (can be null) */ - ewol::Windows* getWindows(void) { + ewol::widget::Windows* getWindows(void) { return m_windowsCurrent; }; private: @@ -240,17 +244,17 @@ namespace ewol { * @brief Inform the Gui that we want to have a copy of the clipboard * @param[in] _clipboardID ID of the clipboard (STD/SELECTION) only apear here */ - virtual void clipBoardGet(enum ewol::clipBoard::clipboardListe _clipboardID) { }; + virtual void clipBoardGet(enum ewol::context::clipBoard::clipboardListe _clipboardID) { }; /** * @brief Inform the Gui that we are the new owner of the clipboard * @param[in] _clipboardID ID of the clipboard (STD/SELECTION) only apear here */ - virtual void clipBoardSet(enum ewol::clipBoard::clipboardListe _clipboardID) { }; + virtual void clipBoardSet(enum ewol::context::clipBoard::clipboardListe _clipboardID) { }; /** * @brief Call by the OS when a clipboard arrive to US (previously requested by a widget) * @param[in] Id of the clipboard */ - void OS_ClipBoardArrive(enum ewol::clipBoard::clipboardListe _clipboardID); + void OS_ClipBoardArrive(enum ewol::context::clipBoard::clipboardListe _clipboardID); /** * @brief set the new title of the windows * @param[in] title New desired title @@ -271,7 +275,7 @@ namespace ewol { * @brief set the cursor display type. * @param[in] _newCursor selected new cursor. */ - virtual void setCursor(enum ewol::cursorDisplay _newCursor) { }; + virtual void setCursor(enum ewol::context::cursorDisplay _newCursor) { }; /** * @brief set the Icon of the program * @param[in] _inputFile new filename icon of the curent program. @@ -310,7 +314,7 @@ namespace ewol { //!< must be define in CPP by the application ... this are the main init and unInit of the Application // return false if an error occured -bool APP_Init(ewol::eContext& _context); +bool APP_Init(ewol::Context& _context); void APP_UnInit(ewol::Context& _context); diff --git a/sources/ewol/context/Dimension.h b/sources/ewol/context/Dimension.h deleted file mode 100644 index 0b6c9308..00000000 --- a/sources/ewol/context/Dimension.h +++ /dev/null @@ -1,214 +0,0 @@ -/** - * @author Edouard DUPIN - * - * @copyright 2011, Edouard DUPIN, all right reserved - * - * @license BSD v3 (see license file) - */ - -#ifndef __EWOL_DIMENSION_H__ -#define __EWOL_DIMENSION_H__ - -#include -#include -#include - -namespace ewol { - namespace context { - /** - * @brief in the dimention class we store the data as the more usefull unit (pixel) - * but one case need to be dynamic the %, then when requested in % the register the % value - */ - class Dimension { - public: - enum distance { - Pourcent=0, - Pixel, - Meter, - Centimeter, - Millimeter, - Kilometer, - Inch, - foot, - }; - private: - vec2 m_data; - enum distance m_type; - public: - /** - * @brief Constructor (default :0,0 mode pixel) - */ - Dimension(void); - /** - * @brief Constructor - * @param[in] _size Requested dimention - * @param[in] _type Unit of the Dimention - */ - Dimension(const vec2& _size, enum ewol::context::Dimension::distance _type=ewol::context::Dimension::Pixel); - /** - * @brief Constructor - * @param[in] _config dimension configuration. - */ - Dimension(const std::string& _config) : - m_data(0,0), - m_type(ewol::context::Dimension::Pixel) { - set(_config); - }; - /** - * @brief Constructor - * @param[in] _config dimension configuration. - */ - Dimension(const char* _config) : - m_data(0,0), - m_type(ewol::context::Dimension::Pixel) { - set(_config); - }; - /** - * @brief Destructor - */ - ~Dimension(void); - - /** - * @brief string cast : - */ - operator std::string(void) const; - - /** - * @brief get the current dimention in requested type - * @param[in] _type Type of unit requested. - * @return dimention requested. - */ - vec2 get(enum distance _type) const; - /** - * @brief set the current dimention in requested type - * @param[in] _size Dimention to set - * @param[in] _type Type of unit requested. - */ - void set(const vec2& _size, enum distance _type); - - private: - /** - * @brief set the current dimention in requested type - * @param[in] _config dimension configuration. - */ - void set(std::string _config); - public: - /** - * @brief get the current dimention in pixel - * @return dimention in Pixel - */ - vec2 getPixel(void) const; - /** - * @brief get the current dimention in Pourcent - * @return dimention in Pourcent - */ - vec2 getPourcent(void) const; - /** - * @brief get the current dimention in Meter - * @return dimention in Meter - */ - vec2 getMeter(void) const; - /** - * @brief get the current dimention in Centimeter - * @return dimention in Centimeter - */ - vec2 getCentimeter(void) const; - /** - * @brief get the current dimention in Millimeter - * @return dimention in Millimeter - */ - vec2 getMillimeter(void) const; - /** - * @brief get the current dimention in Kilometer - * @return dimention in Kilometer - */ - vec2 getKilometer(void) const; - /** - * @brief get the current dimention in Inch - * @return dimention in Inch - */ - vec2 getInch(void) const; - /** - * @brief get the current dimention in Foot - * @return dimention in Foot - */ - vec2 getFoot(void) const; - /***************************************************** - * = assigment - *****************************************************/ - const Dimension& operator= (const Dimension& _obj ) { - if (this!=&_obj) { - m_data = _obj.m_data; - m_type = _obj.m_type; - } - return *this; - } - /***************************************************** - * == operator - *****************************************************/ - bool operator == (const Dimension& _obj) const { - if( m_data == _obj.m_data - && m_type == _obj.m_type) { - return true; - } - return false; - } - /***************************************************** - * != operator - *****************************************************/ - bool operator!= (const Dimension& _obj) const { - if( m_data != _obj.m_data - || m_type != _obj.m_type) { - return true; - } - return false; - } - /** - * @breif get the dimension type - * @return the type - */ - enum distance getType(void) const { - return m_type; - }; - public : // Global static access : - /** - * @brief basic init - */ - static void init(void); - /** - * @brief basic un-init - */ - static void unInit(void); - /** - * @brief set the Milimeter ratio for calculation - * @param[in] Ratio Milimeter ration for the screen calculation interpolation - * @param[in] type Unit type requested. - * @note: same as @ref setPixelPerInch (internal manage convertion) - */ - static void setPixelRatio(const vec2& _ratio, enum ewol::context::Dimension::distance _type); - /** - * @brief set the current Windows size - * @param[in] size size of the current windows in pixel. - */ - static void setPixelWindowsSize(const vec2& _size); - /** - * @brief get the Windows size in the request unit - * @param[in] type Unit type requested. - * @return the requested size - */ - static vec2 getWindowsSize(enum ewol::context::Dimension::distance _type); - /** - * @brief get the Windows diagonal size in the request unit - * @param[in] type Unit type requested. - * @return the requested size - */ - static float getWindowsDiag(enum ewol::context::Dimension::distance _type); - - }; - }; - etk::CCout& operator <<(etk::CCout& _os, enum ewol::context::Dimension::distance _obj); - etk::CCout& operator <<(etk::CCout& _os, const ewol::context::Dimension& _obj); -}; - -#endif - diff --git a/sources/ewol/context/InputManager.cpp b/sources/ewol/context/InputManager.cpp index 0b82e142..771badbc 100644 --- a/sources/ewol/context/InputManager.cpp +++ b/sources/ewol/context/InputManager.cpp @@ -13,15 +13,15 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include -#include +#include @@ -41,15 +41,15 @@ void ewol::context::InputManager::setDpi(int32_t newDPI) { calculateLimit(); } -bool ewol::context::InputManager::localEventInput(enum ewol::keyEvent::type _type, +bool ewol::context::InputManager::localEventInput(enum ewol::key::type _type, ewol::Widget* _destWidget, int32_t _IdInput, - enum ewol::keyEvent::status _status, + enum ewol::key::status _status, vec2 _pos) { if (NULL != _destWidget) { - if (_type == ewol::keyEvent::typeMouse || _type == ewol::keyEvent::typeFinger) { + if (_type == ewol::key::typeMouse || _type == ewol::key::typeFinger) { // create the system Event : - ewol::EventInputSystem tmpEventSystem(_type, _status, _IdInput, _pos, _destWidget, 0); // TODO : set the real ID ... + ewol::event::InputSystem tmpEventSystem(_type, _status, _IdInput, _pos, _destWidget, 0); // TODO : set the real ID ... // generate the event : return _destWidget->systemEventInput(tmpEventSystem); } else { @@ -61,7 +61,7 @@ bool ewol::context::InputManager::localEventInput(enum ewol::keyEvent::type _typ void ewol::context::InputManager::abortElement(InputPoperty *_eventTable, int32_t _idInput, - enum ewol::keyEvent::type _type) { + enum ewol::key::type _type) { if (NULL == _eventTable) { return; } @@ -69,7 +69,7 @@ void ewol::context::InputManager::abortElement(InputPoperty *_eventTable, localEventInput(_type, _eventTable[_idInput].curentWidgetEvent, _eventTable[_idInput].destinationInputId, - ewol::keyEvent::statusAbort, + ewol::key::statusAbort, _eventTable[_idInput].posEvent); } } @@ -103,22 +103,22 @@ void ewol::context::InputManager::transfertEvent(ewol::Widget* _source, ewol::Wi if (m_eventInputSaved[iii].curentWidgetEvent == _source) { // inform the widget that it does not receive the event now EVENT_DEBUG("GUI : Input ID=" << iii << " == >" << m_eventInputSaved[iii].destinationInputId << " [EVENT_INPUT_TYPE_ABORT] " << m_eventInputSaved[iii].posEvent); - localEventInput(ewol::keyEvent::typeFinger, m_eventInputSaved[iii].curentWidgetEvent, m_eventInputSaved[iii].destinationInputId, ewol::keyEvent::statusAbort, m_eventInputSaved[iii].posEvent); + localEventInput(ewol::key::typeFinger, m_eventInputSaved[iii].curentWidgetEvent, m_eventInputSaved[iii].destinationInputId, ewol::key::statusAbort, m_eventInputSaved[iii].posEvent); // set the new widget ... m_eventInputSaved[iii].curentWidgetEvent = _destination; // inform the widget that he receive the event property now... EVENT_DEBUG("GUI : Input ID=" << iii << " == >" << m_eventInputSaved[iii].destinationInputId << " [EVENT_INPUT_TYPE_TRANSFERT] " << m_eventInputSaved[iii].posEvent); - localEventInput(ewol::keyEvent::typeFinger, m_eventInputSaved[iii].curentWidgetEvent, m_eventInputSaved[iii].destinationInputId, ewol::keyEvent::statusTransfert, m_eventInputSaved[iii].posEvent); + localEventInput(ewol::key::typeFinger, m_eventInputSaved[iii].curentWidgetEvent, m_eventInputSaved[iii].destinationInputId, ewol::key::statusTransfert, m_eventInputSaved[iii].posEvent); } if (m_eventMouseSaved[iii].curentWidgetEvent == _source) { // inform the widget that it does not receive the event now EVENT_DEBUG("GUI : Input ID=" << iii << " == >" << m_eventMouseSaved[iii].destinationInputId << " [EVENT_INPUT_TYPE_ABORT] " << m_eventMouseSaved[iii].posEvent); - localEventInput(ewol::keyEvent::typeMouse, m_eventMouseSaved[iii].curentWidgetEvent, m_eventMouseSaved[iii].destinationInputId, ewol::keyEvent::statusAbort, m_eventMouseSaved[iii].posEvent); + localEventInput(ewol::key::typeMouse, m_eventMouseSaved[iii].curentWidgetEvent, m_eventMouseSaved[iii].destinationInputId, ewol::key::statusAbort, m_eventMouseSaved[iii].posEvent); // set the new widget ... m_eventMouseSaved[iii].curentWidgetEvent = _destination; // inform the widget that he receive the event property now... EVENT_DEBUG("GUI : Input ID=" << iii << " == >" << m_eventMouseSaved[iii].destinationInputId << " [EVENT_INPUT_TYPE_TRANSFERT] " << m_eventMouseSaved[iii].posEvent); - localEventInput(ewol::keyEvent::typeMouse, m_eventMouseSaved[iii].curentWidgetEvent, m_eventMouseSaved[iii].destinationInputId, ewol::keyEvent::statusTransfert, m_eventMouseSaved[iii].posEvent); + localEventInput(ewol::key::typeMouse, m_eventMouseSaved[iii].curentWidgetEvent, m_eventMouseSaved[iii].destinationInputId, ewol::key::statusTransfert, m_eventMouseSaved[iii].posEvent); } } } @@ -138,7 +138,7 @@ void ewol::context::InputManager::unGrabPointer(void) { m_context.grabPointerEvents(false, vec2(0,0)); } -void ewol::context::InputManager::onObjectRemove(ewol::EObject * removeObject) { +void ewol::context::InputManager::onObjectRemove(ewol::Object * removeObject) { for(int32_t iii=0; iii the it was finger event ... -void ewol::context::InputManager::motion(enum ewol::keyEvent::type _type, +void ewol::context::InputManager::motion(enum ewol::key::type _type, int _pointerID, vec2 _pos) { EVENT_DEBUG("motion event : " << _type << " " << _pointerID << " " << _pos); @@ -208,9 +208,9 @@ void ewol::context::InputManager::motion(enum ewol::keyEvent::type _type, return; } InputPoperty *eventTable = NULL; - if (_type == ewol::keyEvent::typeMouse) { + if (_type == ewol::key::typeMouse) { eventTable = m_eventMouseSaved; - } else if (_type == ewol::keyEvent::typeFinger) { + } else if (_type == ewol::key::typeFinger) { eventTable = m_eventInputSaved; } else { EWOL_ERROR("Unknown type of event"); @@ -221,9 +221,9 @@ void ewol::context::InputManager::motion(enum ewol::keyEvent::type _type, // not manage input return; } - ewol::Windows* tmpWindows = m_context.getWindows(); + ewol::widget::Windows* tmpWindows = m_context.getWindows(); // special case for the mouse event 0 that represent the hover event of the system : - if (_type == ewol::keyEvent::typeMouse && _pointerID == 0) { + if (_type == ewol::key::typeMouse && _pointerID == 0) { // this event is all time on the good widget ... and manage the enter and leave ... // NOTE : the "layer widget" force us to get the widget at the specific position all the time : ewol::Widget* tmpWidget = NULL; @@ -247,7 +247,7 @@ void ewol::context::InputManager::motion(enum ewol::keyEvent::type _type, localEventInput(_type, eventTable[_pointerID].curentWidgetEvent, eventTable[_pointerID].destinationInputId, - ewol::keyEvent::statusLeave, + ewol::key::statusLeave, _pos); } if (false == eventTable[_pointerID].isInside) { @@ -270,7 +270,7 @@ void ewol::context::InputManager::motion(enum ewol::keyEvent::type _type, localEventInput(_type, eventTable[_pointerID].curentWidgetEvent, eventTable[_pointerID].destinationInputId, - ewol::keyEvent::statusEnter, + ewol::key::statusEnter, _pos); } EVENT_DEBUG("GUI : Input ID=" << _pointerID @@ -280,7 +280,7 @@ void ewol::context::InputManager::motion(enum ewol::keyEvent::type _type, localEventInput(_type, eventTable[_pointerID].curentWidgetEvent, eventTable[_pointerID].destinationInputId, - ewol::keyEvent::statusMove, + ewol::key::statusMove, _pos); } else if (true == eventTable[_pointerID].isUsed) { if (true == eventTable[_pointerID].isInside) { @@ -296,7 +296,7 @@ void ewol::context::InputManager::motion(enum ewol::keyEvent::type _type, localEventInput(_type, eventTable[_pointerID].curentWidgetEvent, eventTable[_pointerID].destinationInputId, - ewol::keyEvent::statusLeave, + ewol::key::statusLeave, _pos); } } else { @@ -312,7 +312,7 @@ void ewol::context::InputManager::motion(enum ewol::keyEvent::type _type, localEventInput(_type, eventTable[_pointerID].curentWidgetEvent, eventTable[_pointerID].destinationInputId, - ewol::keyEvent::statusEnter, + ewol::key::statusEnter, _pos); } } @@ -323,12 +323,12 @@ void ewol::context::InputManager::motion(enum ewol::keyEvent::type _type, localEventInput(_type, eventTable[_pointerID].curentWidgetEvent, eventTable[_pointerID].destinationInputId, - ewol::keyEvent::statusMove, + ewol::key::statusMove, _pos); } } -void ewol::context::InputManager::state(enum ewol::keyEvent::type _type, +void ewol::context::InputManager::state(enum ewol::key::type _type, int _pointerID, bool _isDown, vec2 _pos) @@ -341,10 +341,10 @@ void ewol::context::InputManager::state(enum ewol::keyEvent::type _type, // convert position in open-GL coordonates ... InputPoperty *eventTable = NULL; InputLimit localLimit; - if (_type == ewol::keyEvent::typeMouse) { + if (_type == ewol::key::typeMouse) { eventTable = m_eventMouseSaved; localLimit = m_eventMouseLimit; - } else if (_type == ewol::keyEvent::typeFinger) { + } else if (_type == ewol::key::typeFinger) { eventTable = m_eventInputSaved; localLimit = m_eventInputLimit; } else { @@ -358,7 +358,7 @@ void ewol::context::InputManager::state(enum ewol::keyEvent::type _type, } // get the curent time ... int64_t currentTime = ewol::getTime(); - ewol::Windows* tmpWindows = m_context.getWindows(); + ewol::widget::Windows* tmpWindows = m_context.getWindows(); if (true == _isDown) { EVENT_DEBUG("GUI : Input ID=" << _pointerID @@ -384,7 +384,7 @@ void ewol::context::InputManager::state(enum ewol::keyEvent::type _type, localEventInput(_type, eventTable[_pointerID].curentWidgetEvent, eventTable[_pointerID].destinationInputId, - ewol::keyEvent::statusDown, + ewol::key::statusDown, _pos); } else { // Mark it used : @@ -397,7 +397,7 @@ void ewol::context::InputManager::state(enum ewol::keyEvent::type _type, eventTable[_pointerID].isInside = true; // get destination widget : if(NULL != tmpWindows) { - if (m_grabWidget != NULL && _type == ewol::keyEvent::typeMouse) { + if (m_grabWidget != NULL && _type == ewol::key::typeMouse) { eventTable[_pointerID].curentWidgetEvent = m_grabWidget; } else { eventTable[_pointerID].curentWidgetEvent = tmpWindows->getWidgetAtPos(_pos); @@ -420,7 +420,7 @@ void ewol::context::InputManager::state(enum ewol::keyEvent::type _type, localEventInput(_type, eventTable[_pointerID].curentWidgetEvent, eventTable[_pointerID].destinationInputId, - ewol::keyEvent::statusDown, + ewol::key::statusDown, _pos); } } else { @@ -443,7 +443,7 @@ void ewol::context::InputManager::state(enum ewol::keyEvent::type _type, localEventInput(_type, eventTable[_pointerID].curentWidgetEvent, _pointerID, - ewol::keyEvent::statusUp, + ewol::key::statusUp, _pos); // generate event (single) if( abs(eventTable[_pointerID].downStart.x() - _pos.x()) < localLimit.DpiOffset @@ -461,7 +461,7 @@ void ewol::context::InputManager::state(enum ewol::keyEvent::type _type, } // in grab mode the single to quinte event are not generated .... if( ( m_grabWidget == NULL - || _type != ewol::keyEvent::typeMouse ) + || _type != ewol::key::typeMouse ) && eventTable[_pointerID].nbClickEvent < nbClickMax) { // generate event SINGLE : eventTable[_pointerID].nbClickEvent++; @@ -472,7 +472,7 @@ void ewol::context::InputManager::state(enum ewol::keyEvent::type _type, localEventInput(_type, eventTable[_pointerID].curentWidgetEvent, eventTable[_pointerID].destinationInputId, - (enum ewol::keyEvent::status)(ewol::keyEvent::statusSingle + eventTable[_pointerID].nbClickEvent-1), + (enum ewol::key::status)(ewol::key::statusSingle + eventTable[_pointerID].nbClickEvent-1), _pos); if( eventTable[_pointerID].nbClickEvent >= nbClickMax) { eventTable[_pointerID].nbClickEvent = 0; @@ -482,7 +482,7 @@ void ewol::context::InputManager::state(enum ewol::keyEvent::type _type, } } // specific for tuch event - if (_type == ewol::keyEvent::typeFinger) { + if (_type == ewol::key::typeFinger) { cleanElement(eventTable, _pointerID); } } diff --git a/sources/ewol/context/InputManager.h b/sources/ewol/context/InputManager.h index 27e3e312..2ff90282 100644 --- a/sources/ewol/context/InputManager.h +++ b/sources/ewol/context/InputManager.h @@ -39,8 +39,9 @@ namespace ewol { * @not-in-doc */ class InputLimit { - int32_t sepatateTime; - int32_t DpiOffset; + public: + int32_t sepatateTime; + int32_t DpiOffset; }; class Context; class InputManager { @@ -65,10 +66,10 @@ namespace ewol { * @param[in] _pos position of the event * @return true if event has been greped */ - bool localEventInput(enum ewol::keyEvent::type _type, + bool localEventInput(enum ewol::key::type _type, ewol::Widget* _destWidget, int32_t _IdInput, - enum ewol::keyEvent::status _typeEvent, + enum ewol::key::status _typeEvent, vec2 _pos); /** * @brief convert the system event id in the correct EWOL id depending of the system management mode @@ -79,26 +80,26 @@ namespace ewol { * @param[in] _realInputId system Id * @return the ewol input id */ - int32_t localGetDestinationId(enum ewol::keyEvent::type _type, + int32_t localGetDestinationId(enum ewol::key::type _type, ewol::Widget* _destWidget, int32_t _realInputId); private: - ewol::eContext& m_context; + ewol::Context& m_context; public: - InputManager(ewol::eContext& _context); + InputManager(ewol::Context& _context); ~InputManager(void); void setDpi(int32_t newDPI); // note if id<0 == > the it was finger event ... - void motion(enum ewol::keyEvent::type _type, int _pointerID, vec2 _pos ); - void state(enum ewol::keyEvent::type _type, int _pointerID, bool _isDown, vec2 _pos); + void motion(enum ewol::key::type _type, int _pointerID, vec2 _pos ); + void state(enum ewol::key::type _type, int _pointerID, bool _isDown, vec2 _pos); /** * @brief Inform object that an other object is removed ... - * @param[in] removeObject Pointer on the EObject remeved == > the user must remove all reference on this EObject + * @param[in] removeObject Pointer on the Object remeved == > the user must remove all reference on this Object * @note : Sub classes must call this class */ - void onObjectRemove(ewol::EObject* _removeObject); + void onObjectRemove(ewol::Object* _removeObject); /** * @brief a new layer on the windows is set == > might remove all the property of the current element ... */ diff --git a/sources/ewol/context/X11/Context.cpp b/sources/ewol/context/X11/Context.cpp index 0b6af371..0554c678 100644 --- a/sources/ewol/context/X11/Context.cpp +++ b/sources/ewol/context/X11/Context.cpp @@ -7,24 +7,26 @@ */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include #include #include #include #include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + + #if defined(__TARGET_OS__Linux) #include #elif defined(__TARGET_OS__MacOs) @@ -102,9 +104,9 @@ extern "C" { #undef __class__ #define __class__ "x11Interface" -class X11Interface : public ewol::eContext { +class X11Interface : public ewol::Context { private: - ewol::SpecialKey m_guiKeyBoardMode; + ewol::key::Special m_guiKeyBoardMode; // for double and triple click selection, we need to save the previous click up and down position , and the previous time ... Atom m_delAtom; Display* m_display; @@ -138,11 +140,11 @@ class X11Interface : public ewol::eContext { Atom XAtomeTargetTarget; Atom XAtomeEWOL; Atom XAtomeDeleteWindows; - enum ewol::cursorDisplay m_currentCursor; //!< select the current cursor to display : + enum ewol::context::cursorDisplay m_currentCursor; //!< select the current cursor to display : char32_t m_lastKeyPressed; //!< The last element key presed... public: X11Interface(int32_t _argc, const char* _argv[]) : - ewol::eContext(_argc, _argv), + ewol::Context(_argc, _argv), m_display(NULL), m_originX(0), m_originY(0), @@ -167,7 +169,7 @@ class X11Interface : public ewol::eContext { XAtomeTargetTarget(0), XAtomeEWOL(0), XAtomeDeleteWindows(0), - m_currentCursor(ewol::cursorArrow), + m_currentCursor(ewol::context::cursorArrow), m_lastKeyPressed(0) { X11_INFO("X11:INIT"); for (int32_t iii=0; iiiselection == XAtomeSelection) { - tmpData = ewol::clipBoard::get(ewol::clipBoard::clipboardSelection); + tmpData = ewol::context::clipBoard::get(ewol::context::clipBoard::clipboardSelection); } else if (req->selection == XAtomeClipBoard) { - tmpData = ewol::clipBoard::get(ewol::clipBoard::clipboardStd); + tmpData = ewol::context::clipBoard::get(ewol::context::clipBoard::clipboardStd); } const char * magatTextToSend = tmpData.c_str(); Atom listOfAtom[4]; @@ -515,108 +517,108 @@ class X11Interface : public ewol::eContext { X11_DEBUG("eventKey : " << event.xkey.keycode << " state : " << event.xkey.state); if (event.xkey.state & (1<<0) ) { //EWOL_DEBUG(" Special Key : SHIFT"); - m_guiKeyBoardMode.shift = true; + m_guiKeyBoardMode.setShift(true); } else { - m_guiKeyBoardMode.shift = false; + m_guiKeyBoardMode.setShift(false); } if (event.xkey.state & (1<<1) ) { //EWOL_DEBUG(" Special Key : CAPS_LOCK"); - m_guiKeyBoardMode.capLock = true; + m_guiKeyBoardMode.setCapsLock(true); } else { - m_guiKeyBoardMode.capLock = false; + m_guiKeyBoardMode.setCapsLock(false); } if (event.xkey.state & (1<<2) ) { //EWOL_DEBUG(" Special Key : Ctrl"); - m_guiKeyBoardMode.ctrl = true; + m_guiKeyBoardMode.setCtrl(true); } else { - m_guiKeyBoardMode.ctrl = false; + m_guiKeyBoardMode.setCtrl(false); } if (event.xkey.state & (1<<3) ) { //EWOL_DEBUG(" Special Key : Alt"); - m_guiKeyBoardMode.alt = true; + m_guiKeyBoardMode.setAlt(true); } else { - m_guiKeyBoardMode.alt = false; + m_guiKeyBoardMode.setAlt(false); } if (event.xkey.state & (1<<4) ) { //EWOL_DEBUG(" Special Key : VER_num"); - m_guiKeyBoardMode.numLock = true; + m_guiKeyBoardMode.setNumLock(true); } else { - m_guiKeyBoardMode.numLock = false; + m_guiKeyBoardMode.setNumLock(false); } if (event.xkey.state & (1<<5) ) { EWOL_DEBUG(" Special Key : MOD"); } if (event.xkey.state & (1<<6) ) { //EWOL_DEBUG(" Special Key : META"); - m_guiKeyBoardMode.meta = true; + m_guiKeyBoardMode.setMeta(true); } else { - m_guiKeyBoardMode.meta = false; + m_guiKeyBoardMode.setMeta(false); } if (event.xkey.state & (1<<7) ) { //EWOL_DEBUG(" Special Key : ALT_GR"); - m_guiKeyBoardMode.altGr = true; + m_guiKeyBoardMode.setAltGr(true); } else { - m_guiKeyBoardMode.altGr = false; + m_guiKeyBoardMode.setAltGr(false); } bool find = true; - enum ewol::keyEvent::keyboard keyInput; + enum ewol::key::keyboard keyInput; switch (event.xkey.keycode) { //case 80: // keypad - case 111: keyInput = ewol::keyEvent::keyboardUp; break; + case 111: keyInput = ewol::key::keyboardUp; break; //case 83: // keypad - case 113: keyInput = ewol::keyEvent::keyboardLeft; break; + case 113: keyInput = ewol::key::keyboardLeft; break; //case 85: // keypad - case 114: keyInput = ewol::keyEvent::keyboardRight; break; + case 114: keyInput = ewol::key::keyboardRight; break; //case 88: // keypad - case 116: keyInput = ewol::keyEvent::keyboardDown; break; + case 116: keyInput = ewol::key::keyboardDown; break; //case 81: // keypad - case 112: keyInput = ewol::keyEvent::keyboardPageUp; break; + case 112: keyInput = ewol::key::keyboardPageUp; break; //case 89: // keypad - case 117: keyInput = ewol::keyEvent::keyboardPageDown; break; + case 117: keyInput = ewol::key::keyboardPageDown; break; //case 79: // keypad - case 110: keyInput = ewol::keyEvent::keyboardStart; break; + case 110: keyInput = ewol::key::keyboardStart; break; //case 87: // keypad - case 115: keyInput = ewol::keyEvent::keyboardEnd; break; - case 78: keyInput = ewol::keyEvent::keyboardStopDefil; break; - case 127: keyInput = ewol::keyEvent::keyboardWait; break; + case 115: keyInput = ewol::key::keyboardEnd; break; + case 78: keyInput = ewol::key::keyboardStopDefil; break; + case 127: keyInput = ewol::key::keyboardWait; break; //case 90: // keypad case 118: - keyInput = ewol::keyEvent::keyboardInsert; + keyInput = ewol::key::keyboardInsert; if(event.type == KeyRelease) { - if (true == m_guiKeyBoardMode.insert) { - m_guiKeyBoardMode.insert = false; + if (true == m_guiKeyBoardMode.getInsert()) { + m_guiKeyBoardMode.setInsert(false); } else { - m_guiKeyBoardMode.insert = true; + m_guiKeyBoardMode.setInsert(true); } } break; - //case 84: keyInput = ewol::keyEvent::keyboardCenter; break; // Keypad - case 67: keyInput = ewol::keyEvent::keyboardF1; break; - case 68: keyInput = ewol::keyEvent::keyboardF2; break; - case 69: keyInput = ewol::keyEvent::keyboardF3; break; - case 70: keyInput = ewol::keyEvent::keyboardF4; break; - case 71: keyInput = ewol::keyEvent::keyboardF5; break; - case 72: keyInput = ewol::keyEvent::keyboardF6; break; - case 73: keyInput = ewol::keyEvent::keyboardF7; break; - case 74: keyInput = ewol::keyEvent::keyboardF8; break; - case 75: keyInput = ewol::keyEvent::keyboardF9; break; - case 76: keyInput = ewol::keyEvent::keyboardF10; break; - case 95: keyInput = ewol::keyEvent::keyboardF11; break; - case 96: keyInput = ewol::keyEvent::keyboardF12; break; - case 66: keyInput = ewol::keyEvent::keyboardCapLock; m_guiKeyBoardMode.capLock = (event.type == KeyPress) ? true : false; break; - case 50: keyInput = ewol::keyEvent::keyboardShiftLeft; m_guiKeyBoardMode.shift = (event.type == KeyPress) ? true : false; break; - case 62: keyInput = ewol::keyEvent::keyboardShiftRight; m_guiKeyBoardMode.shift = (event.type == KeyPress) ? true : false; break; - case 37: keyInput = ewol::keyEvent::keyboardCtrlLeft; m_guiKeyBoardMode.ctrl = (event.type == KeyPress) ? true : false; break; - case 105: keyInput = ewol::keyEvent::keyboardCtrlRight; m_guiKeyBoardMode.ctrl = (event.type == KeyPress) ? true : false; break; - case 133: keyInput = ewol::keyEvent::keyboardMetaLeft; m_guiKeyBoardMode.meta = (event.type == KeyPress) ? true : false; break; - case 134: keyInput = ewol::keyEvent::keyboardMetaRight; m_guiKeyBoardMode.meta = (event.type == KeyPress) ? true : false; break; - case 64: keyInput = ewol::keyEvent::keyboardAlt; m_guiKeyBoardMode.alt = (event.type == KeyPress) ? true : false; break; - case 108: keyInput = ewol::keyEvent::keyboardAltGr; m_guiKeyBoardMode.altGr = (event.type == KeyPress) ? true : false; break; - case 135: keyInput = ewol::keyEvent::keyboardContextMenu; break; - case 77: keyInput = ewol::keyEvent::keyboardNumLock; m_guiKeyBoardMode.numLock = (event.type == KeyPress) ? true : false; break; + //case 84: keyInput = ewol::key::keyboardCenter; break; // Keypad + case 67: keyInput = ewol::key::keyboardF1; break; + case 68: keyInput = ewol::key::keyboardF2; break; + case 69: keyInput = ewol::key::keyboardF3; break; + case 70: keyInput = ewol::key::keyboardF4; break; + case 71: keyInput = ewol::key::keyboardF5; break; + case 72: keyInput = ewol::key::keyboardF6; break; + case 73: keyInput = ewol::key::keyboardF7; break; + case 74: keyInput = ewol::key::keyboardF8; break; + case 75: keyInput = ewol::key::keyboardF9; break; + case 76: keyInput = ewol::key::keyboardF10; break; + case 95: keyInput = ewol::key::keyboardF11; break; + case 96: keyInput = ewol::key::keyboardF12; break; + case 66: keyInput = ewol::key::keyboardCapLock; m_guiKeyBoardMode.setCapsLock( (event.type == KeyPress) ? true : false); break; + case 50: keyInput = ewol::key::keyboardShiftLeft; m_guiKeyBoardMode.setShift ( (event.type == KeyPress) ? true : false); break; + case 62: keyInput = ewol::key::keyboardShiftRight; m_guiKeyBoardMode.setShift ( (event.type == KeyPress) ? true : false); break; + case 37: keyInput = ewol::key::keyboardCtrlLeft; m_guiKeyBoardMode.setCtrl ( (event.type == KeyPress) ? true : false); break; + case 105: keyInput = ewol::key::keyboardCtrlRight; m_guiKeyBoardMode.setCtrl ( (event.type == KeyPress) ? true : false); break; + case 133: keyInput = ewol::key::keyboardMetaLeft; m_guiKeyBoardMode.setMeta ( (event.type == KeyPress) ? true : false); break; + case 134: keyInput = ewol::key::keyboardMetaRight; m_guiKeyBoardMode.setMeta ( (event.type == KeyPress) ? true : false); break; + case 64: keyInput = ewol::key::keyboardAlt; m_guiKeyBoardMode.setAlt ( (event.type == KeyPress) ? true : false); break; + case 108: keyInput = ewol::key::keyboardAltGr; m_guiKeyBoardMode.setAltGr ( (event.type == KeyPress) ? true : false); break; + case 135: keyInput = ewol::key::keyboardContextMenu; break; + case 77: keyInput = ewol::key::keyboardNumLock; m_guiKeyBoardMode.setNumLock ( (event.type == KeyPress) ? true : false); break; case 91: // Suppr on keypad find = false; - if(m_guiKeyBoardMode.numLock == true){ + if(m_guiKeyBoardMode.getNumLock() == true){ OS_SetKeyboard(m_guiKeyBoardMode, '.', (event.type == KeyPress), thisIsAReapeateKey); if (true == thisIsAReapeateKey) { OS_SetKeyboard(m_guiKeyBoardMode, '.', !(event.type == KeyPress), thisIsAReapeateKey); @@ -744,7 +746,7 @@ class X11Interface : public ewol::eContext { } */ /****************************************************************************************/ - virtual void setCursor(enum ewol::cursorDisplay _newCursor) { + virtual void setCursor(enum ewol::context::cursorDisplay _newCursor) { if (_newCursor != m_currentCursor) { X11_DEBUG("X11-API: set New Cursor : " << _newCursor); // undefine previous cursors ... @@ -753,7 +755,7 @@ class X11Interface : public ewol::eContext { m_currentCursor = _newCursor; Cursor myCursor = None; switch (m_currentCursor) { - case ewol::cursorNone: + case ewol::context::cursorNone: { Pixmap bitmapNoData; XColor black; @@ -766,61 +768,61 @@ class X11Interface : public ewol::eContext { &black, &black, 0, 0); } break; - case ewol::cursorLeftArrow: + case ewol::context::cursorLeftArrow: myCursor = XCreateFontCursor(m_display, XC_top_left_arrow); break; - case ewol::cursorInfo: + case ewol::context::cursorInfo: myCursor = XCreateFontCursor(m_display, XC_hand1); break; - case ewol::cursorDestroy: + case ewol::context::cursorDestroy: myCursor = XCreateFontCursor(m_display, XC_pirate); break; - case ewol::cursorHelp: + case ewol::context::cursorHelp: myCursor = XCreateFontCursor(m_display, XC_question_arrow); break; - case ewol::cursorCycle: + case ewol::context::cursorCycle: myCursor = XCreateFontCursor(m_display, XC_exchange); break; - case ewol::cursorSpray: + case ewol::context::cursorSpray: myCursor = XCreateFontCursor(m_display, XC_spraycan); break; - case ewol::cursorWait: + case ewol::context::cursorWait: myCursor = XCreateFontCursor(m_display, XC_watch); break; - case ewol::cursorText: + case ewol::context::cursorText: myCursor = XCreateFontCursor(m_display, XC_xterm); break; - case ewol::cursorCrossHair: + case ewol::context::cursorCrossHair: myCursor = XCreateFontCursor(m_display, XC_crosshair); break; - case ewol::cursorSlideUpDown: + case ewol::context::cursorSlideUpDown: myCursor = XCreateFontCursor(m_display, XC_sb_v_double_arrow); break; - case ewol::cursorSlideLeftRight: + case ewol::context::cursorSlideLeftRight: myCursor = XCreateFontCursor(m_display, XC_sb_h_double_arrow); break; - case ewol::cursorResizeUp: + case ewol::context::cursorResizeUp: myCursor = XCreateFontCursor(m_display, XC_top_side); break; - case ewol::cursorResizeDown: + case ewol::context::cursorResizeDown: myCursor = XCreateFontCursor(m_display, XC_bottom_side); break; - case ewol::cursorResizeLeft: + case ewol::context::cursorResizeLeft: myCursor = XCreateFontCursor(m_display, XC_left_side); break; - case ewol::cursorResizeRight: + case ewol::context::cursorResizeRight: myCursor = XCreateFontCursor(m_display, XC_right_side); break; - case ewol::cursorCornerTopLeft: + case ewol::context::cursorCornerTopLeft: myCursor = XCreateFontCursor(m_display, XC_top_left_corner); break; - case ewol::cursorCornerTopRight: + case ewol::context::cursorCornerTopRight: myCursor = XCreateFontCursor(m_display, XC_top_right_corner); break; - case ewol::cursorCornerButtomLeft: + case ewol::context::cursorCornerButtomLeft: myCursor = XCreateFontCursor(m_display, XC_bottom_right_corner); break; - case ewol::cursorCornerButtomRight: + case ewol::context::cursorCornerButtomRight: myCursor = XCreateFontCursor(m_display, XC_bottom_left_corner); break; default : @@ -904,7 +906,7 @@ class X11Interface : public ewol::eContext { } int Xscreen = DefaultScreen(m_display); // set the DPI for the current screen : - ewol::dimension::setPixelRatio(vec2((float)DisplayWidth(m_display, Xscreen)/(float)DisplayWidthMM(m_display, Xscreen), + ewol::Dimension::setPixelRatio(vec2((float)DisplayWidth(m_display, Xscreen)/(float)DisplayWidthMM(m_display, Xscreen), (float)DisplayHeight(m_display, Xscreen)/(float)DisplayHeightMM(m_display, Xscreen)), ewol::Dimension::Millimeter); // get an appropriate visual @@ -1222,9 +1224,9 @@ class X11Interface : public ewol::eContext { X11_INFO("X11: set Title (END)"); } /****************************************************************************************/ - void clipBoardGet(enum ewol::clipBoard::clipboardListe _clipboardID) { + void clipBoardGet(enum ewol::context::clipBoard::clipboardListe _clipboardID) { switch (_clipboardID) { - case ewol::clipBoard::clipboardSelection: + case ewol::context::clipBoard::clipboardSelection: if (false == m_clipBoardOwnerPrimary) { m_clipBoardRequestPrimary = true; // generate a request on X11 @@ -1239,7 +1241,7 @@ class X11Interface : public ewol::eContext { OS_ClipBoardArrive(_clipboardID); } break; - case ewol::clipBoard::clipboardStd: + case ewol::context::clipBoard::clipboardStd: if (false == m_clipBoardOwnerStd) { m_clipBoardRequestPrimary = false; // generate a request on X11 @@ -1260,17 +1262,17 @@ class X11Interface : public ewol::eContext { } } /****************************************************************************************/ - void clipBoardSet(enum ewol::clipBoard::clipboardListe _clipboardID) { + void clipBoardSet(enum ewol::context::clipBoard::clipboardListe _clipboardID) { switch (_clipboardID) { - case ewol::clipBoard::clipboardSelection: + case ewol::context::clipBoard::clipboardSelection: // Request the selection : if (false == m_clipBoardOwnerPrimary) { XSetSelectionOwner(m_display, XAtomeSelection, m_WindowHandle, CurrentTime); m_clipBoardOwnerPrimary = true; } break; - case ewol::clipBoard::clipboardStd: + case ewol::context::clipBoard::clipboardStd: // Request the clipBoard : if (false == m_clipBoardOwnerStd) { XSetSelectionOwner(m_display, XAtomeClipBoard, m_WindowHandle, CurrentTime); diff --git a/sources/ewol/context/clipBoard.cpp b/sources/ewol/context/clipBoard.cpp index 534db4da..65565456 100644 --- a/sources/ewol/context/clipBoard.cpp +++ b/sources/ewol/context/clipBoard.cpp @@ -9,8 +9,8 @@ #include #include -#include -#include +#include +#include #undef __class__ #define __class__ "ClipBoard" @@ -23,9 +23,9 @@ note: la copy dans le : 10 : bouton du milieux */ //!< Local copy of the clipboards -static std::string mesCopy[ewol::clipBoard::context::clipboardCount]; +static std::string mesCopy[ewol::context::clipBoard::clipboardCount]; -static const char* clipboardDescriptionString[ewol::clipBoard::context::clipboardCount+1] = { +static const char* clipboardDescriptionString[ewol::context::clipBoard::clipboardCount+1] = { "clipboard0", "clipboard1", "clipboard2", diff --git a/sources/ewol/context/commandLine.cpp b/sources/ewol/context/commandLine.cpp index 7ce3801e..24cd54de 100644 --- a/sources/ewol/context/commandLine.cpp +++ b/sources/ewol/context/commandLine.cpp @@ -7,7 +7,7 @@ */ #include -#include +#include #include void ewol::context::CommandLine::parse(int32_t _argc, const char* _argv[]) { diff --git a/sources/ewol/context/cursor.cpp b/sources/ewol/context/cursor.cpp index 30f70c9d..721b9269 100644 --- a/sources/ewol/context/cursor.cpp +++ b/sources/ewol/context/cursor.cpp @@ -6,7 +6,7 @@ * @license BSD v3 (see license file) */ -#include +#include static const char* cursorDescriptionString[ewol::context::cursorCount+1] = { "cursorArrow", diff --git a/sources/ewol/ewol.cpp b/sources/ewol/ewol.cpp index 7c16c02d..784dadd3 100644 --- a/sources/ewol/ewol.cpp +++ b/sources/ewol/ewol.cpp @@ -7,10 +7,10 @@ */ #include -#include -#include +#include +#include -#include +#include #include #include #include diff --git a/sources/ewol/key/Special.cpp b/sources/ewol/key/Special.cpp index 64ef75f5..885d12d7 100644 --- a/sources/ewol/key/Special.cpp +++ b/sources/ewol/key/Special.cpp @@ -18,7 +18,7 @@ #define EWOL_FLAG_KEY_INSERT 0x00000080 -ewol::key::Special::SpecialKey(void) : +ewol::key::Special::Special(void) : m_value(0) { } diff --git a/sources/ewol/object/Config.cpp b/sources/ewol/object/Config.cpp index 51f6f270..7c7ecd77 100644 --- a/sources/ewol/object/Config.cpp +++ b/sources/ewol/object/Config.cpp @@ -7,6 +7,8 @@ */ #include +#include + #undef __class__ #define __class__ "object::Config" diff --git a/sources/ewol/object/Manager.cpp b/sources/ewol/object/Manager.cpp index cce76954..bd00cec3 100644 --- a/sources/ewol/object/Manager.cpp +++ b/sources/ewol/object/Manager.cpp @@ -7,7 +7,7 @@ */ #include -#include +#include #include #undef __class__ diff --git a/sources/ewol/object/MultiCast.cpp b/sources/ewol/object/MultiCast.cpp index ac0f5065..21595dcf 100644 --- a/sources/ewol/object/MultiCast.cpp +++ b/sources/ewol/object/MultiCast.cpp @@ -65,7 +65,7 @@ void ewol::object::MultiCast::send(ewol::Object* _object, const char* const _mes if (NULL != m_messageList[iii].m_object) { EWOL_VERBOSE(" id = " << m_messageList[iii].m_object->getId() << " type=" << m_messageList[iii].m_object->getObjectType()); // generate event ... (create message before ... - ewol::EMessage tmpMsg(_object, m_messageList[iii].m_message, _data); + ewol::object::Message tmpMsg(_object, m_messageList[iii].m_message, _data); m_messageList[iii].m_object->onReceiveMessage(tmpMsg); } } diff --git a/sources/ewol/object/Object.cpp b/sources/ewol/object/Object.cpp index a082dc76..d77b66ea 100644 --- a/sources/ewol/object/Object.cpp +++ b/sources/ewol/object/Object.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #undef __class__ #define __class__ "ewol::Object" @@ -92,7 +93,7 @@ void ewol::Object::autoDestroy(void) { getObjectManager().autoRemove(this); } -void ewol::Object::removObject(void) { +void ewol::Object::removeObject(void) { getObjectManager().autoRemove(this); } @@ -111,12 +112,12 @@ void ewol::Object::generateEventId(const char * _generateEventId, const std::str if (m_externEvent[iii]->localEventId == _generateEventId) { if (NULL != m_externEvent[iii]->destObject) { if (m_externEvent[iii]->overloadData.size() <= 0){ - ewol::EMessage tmpMsg(this, m_externEvent[iii]->destEventId, _data); + ewol::object::Message tmpMsg(this, m_externEvent[iii]->destEventId, _data); EWOL_VERBOSE("send message " << tmpMsg); m_externEvent[iii]->destObject->onReceiveMessage(tmpMsg); } else { // set the user requested data ... - ewol::EMessage tmpMsg(this, m_externEvent[iii]->destEventId, m_externEvent[iii]->overloadData); + ewol::object::Message tmpMsg(this, m_externEvent[iii]->destEventId, m_externEvent[iii]->overloadData); EWOL_VERBOSE("send message " << tmpMsg); m_externEvent[iii]->destObject->onReceiveMessage(tmpMsg); } @@ -240,7 +241,7 @@ void ewol::Object::registerConfig(const char* _config, } } } - m_listConfig.push_back(ewol::EConfigElement(_config, _type, _control, _description, _default)); + m_listConfig.push_back(ewol::object::ConfigElement(_config, _type, _control, _description, _default)); } @@ -258,7 +259,7 @@ bool ewol::Object::loadXML(exml::Element* _node) { if (value.size() == 0) { continue; } - if (false == setConfig(ewol::EConfig(m_listConfig[iii].getConfig(), value) ) ) { + if (false == setConfig(ewol::object::Config(m_listConfig[iii].getConfig(), value) ) ) { errorOccured = false; } } @@ -288,7 +289,7 @@ bool ewol::Object::storeXML(exml::Element* _node) const { } -bool ewol::Object::onSetConfig(const ewol::EConfig& _conf) { +bool ewol::Object::onSetConfig(const ewol::object::Config& _conf) { EWOL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} set config : " << _conf); if (_conf.getConfig() == ewol::Object::configName) { EWOL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} set config name : \"" << _conf.getData() << "\""); @@ -311,7 +312,7 @@ bool ewol::Object::setConfig(const std::string& _config, const std::string& _val if (NULL != m_listConfig[iii].getConfig()) { if (_config == m_listConfig[iii].getConfig() ) { // call config with standard parameter - return setConfig(ewol::EConfig(m_listConfig[iii].getConfig(), _value)); + return setConfig(ewol::object::Config(m_listConfig[iii].getConfig(), _value)); } } } @@ -340,7 +341,7 @@ std::string ewol::Object::getConfig(const std::string& _config) const { return ""; } -bool ewol::Object::setConfigNamed(const std::string& _objectName, const ewol::EConfig& _conf) { +bool ewol::Object::setConfigNamed(const std::string& _objectName, const ewol::object::Config& _conf) { ewol::Object* object = getObjectManager().get(_objectName); if (object == NULL) { return false; @@ -356,14 +357,14 @@ bool ewol::Object::setConfigNamed(const std::string& _objectName, const std::str return object->setConfig(_config, _value); } -ewol::ObjectManager& ewol::Object::getObjectManager(void) { - return ewol::getContext().getObjectManager(); +ewol::object::Manager& ewol::Object::getObjectManager(void) { + return ewol::getContext().getEObjectManager(); } -ewol::EMultiCast& ewol::Object::getMultiCast(void) { - return ewol::getContext().getObjectManager().multiCast(); +ewol::object::MultiCast& ewol::Object::getMultiCast(void) { + return ewol::getContext().getEObjectManager().multiCast(); } -ewol::eContext& ewol::Object::getContext(void) { +ewol::Context& ewol::Object::getContext(void) { return ewol::getContext(); } diff --git a/sources/ewol/object/Object.h b/sources/ewol/object/Object.h index 9a530afe..d6dd75ff 100644 --- a/sources/ewol/object/Object.h +++ b/sources/ewol/object/Object.h @@ -19,8 +19,6 @@ namespace ewol { class Object; namespace object { class Manager; - }; - namespace context { class MultiCast; }; class Context; @@ -279,7 +277,7 @@ namespace ewol { * @breif get the current Object Message Multicast manager. * @return the requested object manager. */ - ewol::context::MultiCast& getMultiCast(void); + ewol::object::MultiCast& getMultiCast(void); /** * @brief get the curent the system inteface. * @return current reference on the instance. diff --git a/sources/ewol/openGL/openGL.cpp b/sources/ewol/openGL/openGL.cpp index 7c6c4693..ab67ea45 100644 --- a/sources/ewol/openGL/openGL.cpp +++ b/sources/ewol/openGL/openGL.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include /** * @brief get the draw mutex (ewol render). diff --git a/sources/ewol/resource/FontFreeType.h b/sources/ewol/resource/FontFreeType.h index e7fef67f..a2b4d3b3 100644 --- a/sources/ewol/resource/FontFreeType.h +++ b/sources/ewol/resource/FontFreeType.h @@ -10,7 +10,7 @@ #define __EWOL_FONT_FREE_TYPE_H__ #include -#include +#include extern "C" { #include @@ -53,12 +53,12 @@ namespace ewol { * @param[in] _filename Name of the base font. * @return pointer on the resource or NULL if an error occured. */ - static ewol::FontBase* keep(const std::string& _filename); + static ewol::resource::FontBase* keep(const std::string& _filename); /** * @brief release the keeped resources * @param[in,out] reference on the object pointer */ - static void release(ewol::FontBase*& _object); + static void release(ewol::resource::FontBase*& _object); }; void freeTypeInit(void); void freeTypeUnInit(void); diff --git a/sources/ewol/widget/Widget.h b/sources/ewol/widget/Widget.h index a3ed33b9..ad5790b5 100644 --- a/sources/ewol/widget/Widget.h +++ b/sources/ewol/widget/Widget.h @@ -10,7 +10,7 @@ #define __EWOL_WIDGET_H__ #include -#include +#include namespace ewol { class Widget; @@ -510,7 +510,7 @@ namespace ewol { * @brief periodic call of this widget * @param _event Current time property */ - virtual void periodicCall(const ewol::EventTime& _event) { + virtual void periodicCall(const ewol::event::Time& _event) { }; public: @@ -542,7 +542,7 @@ namespace ewol { * @return true the event is used * @return false the event is not used */ - virtual bool systemEventInput(ewol::EventInputSystem& _event); + virtual bool systemEventInput(ewol::event::InputSystem& _event); protected: /** * @brief Event on an input of this Widget (finger, mouse, stilet) @@ -550,7 +550,7 @@ namespace ewol { * @return true the event is used * @return false the event is not used */ - virtual bool onEventInput(const ewol::EventInput& _event) { + virtual bool onEventInput(const ewol::event::Input& _event) { return false; }; public: @@ -560,7 +560,7 @@ namespace ewol { * @return true if the event has been used * @return false if the event has not been used */ - virtual bool systemEventEntry(ewol::EventEntrySystem& _event); + virtual bool systemEventEntry(ewol::event::EntrySystem& _event); protected: /** * @brief Entry event. @@ -572,7 +572,7 @@ namespace ewol { * @return true if the event has been used * @return false if the event has not been used */ - virtual bool onEventEntry(const ewol::EventEntry& _event) { + virtual bool onEventEntry(const ewol::event::Entry& _event) { return false; }; public: @@ -581,7 +581,7 @@ namespace ewol { * @note : need to have focus ... * @param[in] mode Mode of data requested */ - virtual void onEventClipboard(enum ewol::clipBoard::clipboardListe _clipboardID) { }; + virtual void onEventClipboard(enum ewol::context::clipBoard::clipboardListe _clipboardID) { }; // ---------------------------------------------------------------------------------------------------------------- // -- Shortcut : management of the shortcut @@ -613,9 +613,9 @@ namespace ewol { * @return false if the event has not been used. * @note To prevent some error when you get an event get it if it is down and Up ... == > like this it could not generate some ununderstanding error. */ - virtual bool onEventShortCut(ewol::SpecialKey& _special, + virtual bool onEventShortCut(ewol::key::Special& _special, char32_t _unicodeValue, - enum ewol::keyEvent::keyboard _kbMove, + enum ewol::key::keyboard _kbMove, bool _isDown); // ---------------------------------------------------------------------------------------------------------------- // -- drawing : All drawing must be done in 2 separate buffer 1 for the current display and 1 for the working... @@ -632,8 +632,8 @@ namespace ewol { * @return false if we have no need to redraw */ virtual bool needRedraw(void) { - bool tmpData=m_needRegenerateDisplay; - m_needRegenerateDisplay=false; + bool tmpData = m_needRegenerateDisplay; + m_needRegenerateDisplay = false; return tmpData; }; public: @@ -675,23 +675,23 @@ namespace ewol { */ virtual bool getGrabStatus(void); private: - enum ewol::cursorDisplay m_cursorDisplay; + enum ewol::context::cursorDisplay m_cursorDisplay; public: /** * @brief set the cursor display type. * @param[in] _newCursor selected new cursor. */ - virtual void setCursor(enum ewol::cursorDisplay _newCursor); + virtual void setCursor(enum ewol::context::cursorDisplay _newCursor); /** * @brief get the currrent cursor. * @return the type of the cursor. */ - virtual enum ewol::cursorDisplay getCursor(void); + virtual enum ewol::context::cursorDisplay getCursor(void); public: // Derived function - virtual void onObjectRemove(ewol::EObject* _removeObject); + virtual void onObjectRemove(ewol::Object* _removeObject); virtual bool loadXML(exml::Element* _node); protected: // Derived function - virtual bool onSetConfig(const ewol::EConfig& _conf); + virtual bool onSetConfig(const ewol::object::Config& _conf); virtual bool onGetConfig(const char* _config, std::string& _result) const; public: /** @@ -701,11 +701,11 @@ namespace ewol { /** * @brief get the current Widget Manager */ - ewol::WidgetManager& getWidgetManager(void); + ewol::widget::Manager& getWidgetManager(void); /** * @brief get the curent Windows */ - ewol::Windows* getWindows(void); + ewol::widget::Windows* getWindows(void); /* * Annimation section : */ diff --git a/sources/ewol/widget/Windows.h b/sources/ewol/widget/Windows.h index f48f4e34..beb156d2 100644 --- a/sources/ewol/widget/Windows.h +++ b/sources/ewol/widget/Windows.h @@ -19,7 +19,7 @@ namespace ewol { /** * @ingroup ewolWidgetGroup */ - class Windows : public ewol::widget::Widget { + class Windows : public ewol::Widget { public: Windows(void); virtual ~Windows(void); @@ -72,7 +72,7 @@ namespace ewol { virtual void systemDraw(const ewol::DrawProperty& _displayProp); public: // Derived function virtual void onRegenerateDisplay(void); - virtual void onObjectRemove(ewol::EObject * _removeObject); + virtual void onObjectRemove(ewol::Object * _removeObject); virtual void calculateSize(const vec2& _availlable); virtual ewol::Widget * getWidgetAtPos(const vec2& _pos); void setTitle(const std::string& _title); diff --git a/sources/lutin_ewol.py b/sources/lutin_ewol.py index 3a644bcc..869fd94f 100755 --- a/sources/lutin_ewol.py +++ b/sources/lutin_ewol.py @@ -21,7 +21,8 @@ def Create(target): # add the file to compile: myModule.AddSrcFile([ 'ewol/ewol.cpp', - 'ewol/debug.cpp' + 'ewol/debug.cpp', + 'ewol/Dimension.cpp' ]) # compositing : @@ -42,7 +43,6 @@ def Create(target): 'ewol/context/ConfigFont.cpp', 'ewol/context/Context.cpp', 'ewol/context/cursor.cpp', - 'ewol/context/Dimension.cpp', 'ewol/context/InputManager.cpp' ]) if target.name=="Linux": @@ -180,14 +180,6 @@ def Create(target): #ifeq ("$(CONFIG_BUILD_PORTAUDIO)","y") #myModule.AddSrcFile('ewol/renderer/audio/interfacePortAudio.cpp') #endif - - #ifeq ("$(CONFIG___EWOL_LINUX_GUI_MODE_X11__)","y") - myModule.AddSrcFile('ewol/renderer/X11/Context.cpp') - #endif - #ifeq ("$(CONFIG___EWOL_LINUX_GUI_MODE_DIRECT_FB__)","y") - #myModule.CompileFlags_CC('-I/usr/local/include/directfb') - #myModule.AddSrcFile('ewol/renderer/os/gui.directFB.cpp') - #endif elif target.name=="Android": myModule.AddExportflag_LD("-lGLESv2") @@ -195,7 +187,6 @@ def Create(target): myModule.AddExportflag_LD("-ldl") myModule.AddExportflag_LD("-llog") myModule.AddExportflag_LD("-landroid") - java_tmp_dir = lutinTools.GetCurrentPath(__file__) + "/../../ewol/sources/android/src/" cpp_tmp_dir = lutinTools.GetCurrentPath(__file__) + "/ewol/renderer/Android/" java_tmp_src = java_tmp_dir + "org/ewol/EwolConstants" @@ -203,25 +194,14 @@ def Create(target): lutinMultiprocess.RunCommand("cd " + java_tmp_dir + " && javah org.ewol.EwolConstants") lutinTools.CopyFile(java_tmp_dir + "org_ewol_EwolConstants.h", cpp_tmp_dir + "org_ewol_EwolConstants.h", True) lutinTools.RemoveFile(java_tmp_src + ".class") - - myModule.AddSrcFile("ewol/renderer/Android/Context.cpp") - elif target.name=="Windows": myModule.AddModuleDepend("glew") - myModule.AddSrcFile("ewol/renderer/Windows/Context.cpp") elif target.name=="MacOs": myModule.AddExportflag_LD([ "-framework Cocoa", "-framework OpenGL", "-framework QuartzCore", "-framework AppKit"]) - myModule.AddSrcFile([ - "ewol/renderer/MacOs/Context.cpp", - "ewol/renderer/MacOs/Interface.mm", - "ewol/renderer/MacOs/AppDelegate.mm", - "ewol/renderer/MacOs/OpenglView.mm"]) - else: - debug.error("unknow mode...") # add the currrent module at the return myModule