[DEV] change enum naming

This commit is contained in:
Edouard DUPIN 2013-11-10 14:47:53 +01:00
parent fa21a34b0a
commit ff1f2692de
65 changed files with 710 additions and 573 deletions

2
external/egami vendored

@ -1 +1 @@
Subproject commit 9ead15a4d1cb533db919dfe5f6638dae7f788479 Subproject commit 59738fd521534c9f71146513905b42ad56407fed

2
external/ejson vendored

@ -1 +1 @@
Subproject commit 9644468f6eef81d635adafcf6396a02189a49521 Subproject commit a94a1c6e600fcbbfe706cda6cc7e4e2c939c8f09

2
external/etk vendored

@ -1 +1 @@
Subproject commit 8806c4e44ff918b1be25e1bd8958512e11ffe27e Subproject commit 51606313ab962db03eb0642be06e52ef70e6e6d8

2
external/exml vendored

@ -1 +1 @@
Subproject commit 5009e90a1e66a91b97a579e4be8409eb738bb4e6 Subproject commit c9f7abcd96f2decebe4968fe10071c6e861a4d85

View File

@ -49,7 +49,7 @@ void ewol::dimension::unInit(void) {
windowsSize.set(vec2(9999999,88888), ewol::Dimension::Pixel); windowsSize.set(vec2(9999999,88888), ewol::Dimension::Pixel);
} }
void ewol::dimension::setPixelRatio(const vec2& _ratio, ewol::Dimension::distance_te _type) { void ewol::dimension::setPixelRatio(const vec2& _ratio, enum ewol::Dimension::distance _type) {
ewol::dimension::init(); ewol::dimension::init();
EWOL_INFO("Set a new screen ratio for the screen : ratio=" << _ratio << " type=" << _type); EWOL_INFO("Set a new screen ratio for the screen : ratio=" << _ratio << " type=" << _type);
ewol::Dimension conversion(_ratio, _type); ewol::Dimension conversion(_ratio, _type);
@ -64,11 +64,11 @@ void ewol::dimension::setPixelWindowsSize(const vec2& _size) {
EWOL_VERBOSE("Set a new Windows property size " << windowsSize << "px"); EWOL_VERBOSE("Set a new Windows property size " << windowsSize << "px");
} }
vec2 ewol::dimension::getWindowsSize(ewol::Dimension::distance_te _type) { vec2 ewol::dimension::getWindowsSize(enum ewol::Dimension::distance _type) {
return windowsSize.get(_type); return windowsSize.get(_type);
} }
float ewol::dimension::getWindowsDiag(ewol::Dimension::distance_te _type) { float ewol::dimension::getWindowsDiag(enum ewol::Dimension::distance _type) {
vec2 size = ewol::dimension::getWindowsSize(_type); vec2 size = ewol::dimension::getWindowsSize(_type);
return size.length(); return size.length();
} }
@ -79,7 +79,7 @@ ewol::Dimension::Dimension(void) :
// notinh to do ... // notinh to do ...
} }
ewol::Dimension::Dimension(const vec2& _size, ewol::Dimension::distance_te _type) : ewol::Dimension::Dimension(const vec2& _size, enum ewol::Dimension::distance _type) :
m_data(0,0), m_data(0,0),
m_type(ewol::Dimension::Pixel) { m_type(ewol::Dimension::Pixel) {
set(_size, _type); set(_size, _type);
@ -88,7 +88,7 @@ ewol::Dimension::Dimension(const vec2& _size, ewol::Dimension::distance_te _type
void ewol::Dimension::set(etk::UString _config) { void ewol::Dimension::set(etk::UString _config) {
m_data.setValue(0,0); m_data.setValue(0,0);
m_type = ewol::Dimension::Pixel; m_type = ewol::Dimension::Pixel;
distance_te type = ewol::Dimension::Pixel; enum distance type = ewol::Dimension::Pixel;
if (_config.endWith("%",false) == true) { if (_config.endWith("%",false) == true) {
type = ewol::Dimension::Pourcent; type = ewol::Dimension::Pourcent;
_config.remove(_config.size()-1, 1); _config.remove(_config.size()-1, 1);
@ -159,7 +159,7 @@ ewol::Dimension::operator etk::UString(void) const {
return str; return str;
} }
vec2 ewol::Dimension::get(ewol::Dimension::distance_te _type) const { vec2 ewol::Dimension::get(enum ewol::Dimension::distance _type) const {
switch(_type) { switch(_type) {
case ewol::Dimension::Pourcent: case ewol::Dimension::Pourcent:
return getPourcent(); return getPourcent();
@ -180,7 +180,7 @@ vec2 ewol::Dimension::get(ewol::Dimension::distance_te _type) const {
} }
} }
void ewol::Dimension::set(const vec2& _size, ewol::Dimension::distance_te _type) { void ewol::Dimension::set(const vec2& _size, enum ewol::Dimension::distance _type) {
// set min max on input to limit error : // set min max on input to limit error :
vec2 size(etk_avg(0.0f,_size.x(),9999999.0f), vec2 size(etk_avg(0.0f,_size.x(),9999999.0f),
etk_avg(0.0f,_size.y(),9999999.0f)); etk_avg(0.0f,_size.y(),9999999.0f));
@ -263,34 +263,34 @@ vec2 ewol::Dimension::getFoot(void) const {
return ewol::Dimension::getMillimeter()*millimeterToFoot; return ewol::Dimension::getMillimeter()*millimeterToFoot;
} }
etk::CCout& ewol::operator <<(etk::CCout &os, const ewol::Dimension::distance_te& obj) { etk::CCout& ewol::operator <<(etk::CCout& _os, enum ewol::Dimension::distance _obj) {
switch(obj) { switch(_obj) {
case ewol::Dimension::Pourcent: case ewol::Dimension::Pourcent:
os << "%"; _os << "%";
break; break;
case ewol::Dimension::Pixel: case ewol::Dimension::Pixel:
os << "px"; _os << "px";
break; break;
case ewol::Dimension::Meter: case ewol::Dimension::Meter:
os << "m"; _os << "m";
break; break;
case ewol::Dimension::Centimeter: case ewol::Dimension::Centimeter:
os << "cm"; _os << "cm";
break; break;
case ewol::Dimension::Millimeter: case ewol::Dimension::Millimeter:
os << "mm"; _os << "mm";
break; break;
case ewol::Dimension::Kilometer: case ewol::Dimension::Kilometer:
os << "km"; _os << "km";
break; break;
case ewol::Dimension::Inch: case ewol::Dimension::Inch:
os << "in"; _os << "in";
break; break;
case ewol::Dimension::foot: case ewol::Dimension::foot:
os << "ft"; _os << "ft";
break; break;
} }
return os; return _os;
} }
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::Dimension& _obj) { etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::Dimension& _obj) {

View File

@ -20,7 +20,7 @@ namespace ewol {
*/ */
class Dimension { class Dimension {
public: public:
typedef enum { enum distance {
Pourcent=0, Pourcent=0,
Pixel, Pixel,
Meter, Meter,
@ -29,10 +29,10 @@ namespace ewol {
Kilometer, Kilometer,
Inch, Inch,
foot, foot,
} distance_te; };
private: private:
vec2 m_data; vec2 m_data;
distance_te m_type; enum distance m_type;
public: public:
/** /**
* @brief Constructor (default :0,0 mode pixel) * @brief Constructor (default :0,0 mode pixel)
@ -43,17 +43,25 @@ namespace ewol {
* @param[in] _size Requested dimention * @param[in] _size Requested dimention
* @param[in] _type Unit of the Dimention * @param[in] _type Unit of the Dimention
*/ */
Dimension(const vec2& _size, ewol::Dimension::distance_te _type=ewol::Dimension::Pixel); Dimension(const vec2& _size, enum ewol::Dimension::distance _type=ewol::Dimension::Pixel);
/** /**
* @brief Constructor * @brief Constructor
* @param[in] _config dimension configuration. * @param[in] _config dimension configuration.
*/ */
Dimension(const etk::UString& _config) : m_data(0,0),m_type(ewol::Dimension::Pixel) { set(_config); }; Dimension(const etk::UString& _config) :
m_data(0,0),
m_type(ewol::Dimension::Pixel) {
set(_config);
};
/** /**
* @brief Constructor * @brief Constructor
* @param[in] _config dimension configuration. * @param[in] _config dimension configuration.
*/ */
Dimension(const char* _config) : m_data(0,0),m_type(ewol::Dimension::Pixel) { set(_config); }; Dimension(const char* _config) :
m_data(0,0),
m_type(ewol::Dimension::Pixel) {
set(_config);
};
/** /**
* @brief Destructor * @brief Destructor
*/ */
@ -69,13 +77,13 @@ namespace ewol {
* @param[in] _type Type of unit requested. * @param[in] _type Type of unit requested.
* @return dimention requested. * @return dimention requested.
*/ */
vec2 get(ewol::Dimension::distance_te _type) const; vec2 get(enum distance _type) const;
/** /**
* @brief set the current dimention in requested type * @brief set the current dimention in requested type
* @param[in] _size Dimention to set * @param[in] _size Dimention to set
* @param[in] _type Type of unit requested. * @param[in] _type Type of unit requested.
*/ */
void set(const vec2& _size, ewol::Dimension::distance_te _type); void set(const vec2& _size, enum distance _type);
private: private:
/** /**
@ -158,9 +166,11 @@ namespace ewol {
* @breif get the dimension type * @breif get the dimension type
* @return the type * @return the type
*/ */
ewol::Dimension::distance_te getType(void) const { return m_type; }; enum distance getType(void) const {
return m_type;
}; };
etk::CCout& operator <<(etk::CCout& _os, const ewol::Dimension::distance_te& _obj); };
etk::CCout& operator <<(etk::CCout& _os, enum ewol::Dimension::distance _obj);
etk::CCout& operator <<(etk::CCout& _os, const ewol::Dimension& _obj); etk::CCout& operator <<(etk::CCout& _os, const ewol::Dimension& _obj);
namespace dimension { namespace dimension {
@ -179,7 +189,7 @@ namespace ewol {
* @param[in] type Unit type requested. * @param[in] type Unit type requested.
* @note: same as @ref setPixelPerInch (internal manage convertion) * @note: same as @ref setPixelPerInch (internal manage convertion)
*/ */
void setPixelRatio(const vec2& _ratio, ewol::Dimension::distance_te _type); void setPixelRatio(const vec2& _ratio, enum ewol::Dimension::distance _type);
/** /**
* @brief set the current Windows size * @brief set the current Windows size
* @param[in] size size of the current windows in pixel. * @param[in] size size of the current windows in pixel.
@ -190,13 +200,13 @@ namespace ewol {
* @param[in] type Unit type requested. * @param[in] type Unit type requested.
* @return the requested size * @return the requested size
*/ */
vec2 getWindowsSize(ewol::Dimension::distance_te _type); vec2 getWindowsSize(enum ewol::Dimension::distance _type);
/** /**
* @brief get the Windows diagonal size in the request unit * @brief get the Windows diagonal size in the request unit
* @param[in] type Unit type requested. * @param[in] type Unit type requested.
* @return the requested size * @return the requested size
*/ */
float getWindowsDiag(ewol::Dimension::distance_te _type); float getWindowsDiag(enum ewol::Dimension::distance _type);
}; };
}; };

View File

@ -41,7 +41,7 @@ static const char* clipboardDescriptionString[ewol::clipBoard::clipboardCount+1]
"clipboardCount" "clipboardCount"
}; };
etk::CCout& ewol::clipBoard::operator <<(etk::CCout& _os, const ewol::clipBoard::clipboardListe_te _obj) { etk::CCout& ewol::clipBoard::operator <<(etk::CCout& _os, const enum ewol::clipBoard::clipboardListe _obj) {
if (_obj >= 0 && _obj <ewol::clipBoard::clipboardCount) { if (_obj >= 0 && _obj <ewol::clipBoard::clipboardCount) {
_os << clipboardDescriptionString[_obj]; _os << clipboardDescriptionString[_obj];
} else { } else {
@ -67,7 +67,7 @@ void ewol::clipBoard::unInit(void) {
} }
void ewol::clipBoard::set(ewol::clipBoard::clipboardListe_te _clipboardID, const etk::UString& _data) { void ewol::clipBoard::set(enum ewol::clipBoard::clipboardListe _clipboardID, const etk::UString& _data) {
// check if ID is correct // check if ID is correct
if(0 == _data.size()) { if(0 == _data.size()) {
EWOL_INFO("request a copy of nothing"); EWOL_INFO("request a copy of nothing");
@ -89,7 +89,7 @@ void ewol::clipBoard::set(ewol::clipBoard::clipboardListe_te _clipboardID, const
} }
void ewol::clipBoard::request(ewol::clipBoard::clipboardListe_te _clipboardID) { void ewol::clipBoard::request(enum ewol::clipBoard::clipboardListe _clipboardID) {
if(_clipboardID >= ewol::clipBoard::clipboardCount) { if(_clipboardID >= ewol::clipBoard::clipboardCount) {
EWOL_WARNING("request ClickBoard id error"); EWOL_WARNING("request ClickBoard id error");
return; return;
@ -107,7 +107,7 @@ void ewol::clipBoard::request(ewol::clipBoard::clipboardListe_te _clipboardID) {
} }
void ewol::clipBoard::setSystem(ewol::clipBoard::clipboardListe_te _clipboardID, const etk::UString& _data) { void ewol::clipBoard::setSystem(enum ewol::clipBoard::clipboardListe _clipboardID, const etk::UString& _data) {
if(_clipboardID >= ewol::clipBoard::clipboardCount) { if(_clipboardID >= ewol::clipBoard::clipboardCount) {
EWOL_WARNING("request ClickBoard id error"); EWOL_WARNING("request ClickBoard id error");
return; return;
@ -117,7 +117,7 @@ void ewol::clipBoard::setSystem(ewol::clipBoard::clipboardListe_te _clipboardID,
} }
const etk::UString& ewol::clipBoard::get(ewol::clipBoard::clipboardListe_te _clipboardID) { const etk::UString& ewol::clipBoard::get(enum ewol::clipBoard::clipboardListe _clipboardID) {
static const etk::UString emptyString(""); static const etk::UString emptyString("");
if(_clipboardID >= ewol::clipBoard::clipboardCount) { if(_clipboardID >= ewol::clipBoard::clipboardCount) {
EWOL_WARNING("request ClickBoard id error"); EWOL_WARNING("request ClickBoard id error");

View File

@ -16,7 +16,7 @@
namespace ewol { namespace ewol {
namespace clipBoard namespace clipBoard
{ {
typedef enum { enum clipboardListe {
clipboard0, //!< internal clipboard 0 clipboard0, //!< internal clipboard 0
clipboard1, //!< internal clipboard 1 clipboard1, //!< internal clipboard 1
clipboard2, //!< internal clipboard 2 clipboard2, //!< internal clipboard 2
@ -30,19 +30,19 @@ namespace ewol {
clipboardStd, //!< External clipboard represent the Copy/Cut/Past buffer clipboardStd, //!< External clipboard represent the Copy/Cut/Past buffer
clipboardSelection, //!< External or internal clipboard depending on the OS, represent the middle button clipboardSelection, //!< External or internal clipboard depending on the OS, represent the middle button
clipboardCount, //!< Total number of clipboard clipboardCount, //!< Total number of clipboard
} clipboardListe_te; };
/** /**
* @brief Debug operator To display the curent element in a Human redeable information * @brief Debug operator To display the curent element in a Human redeable information
*/ */
etk::CCout& operator <<(etk::CCout& _os, const ewol::clipBoard::clipboardListe_te _obj); etk::CCout& operator <<(etk::CCout& _os, const enum ewol::clipBoard::clipboardListe _obj);
/** /**
* @brief set the string data on a specific clipboard. The Gui system is notify that the clipboard "SELECTION" and "COPY" are change * @brief set the string data on a specific clipboard. The Gui system is notify that the clipboard "SELECTION" and "COPY" are change
* @param[in] _clipboardID Select the specific ID of the clipboard * @param[in] _clipboardID Select the specific ID of the clipboard
* @param[in] _data The string that might be send to the clipboard * @param[in] _data The string that might be send to the clipboard
*/ */
void set(ewol::clipBoard::clipboardListe_te _clipboardID, const etk::UString& _data); void set(enum ewol::clipBoard::clipboardListe _clipboardID, const etk::UString& _data);
/** /**
* @brief Call system to request the current clipboard. * @brief Call system to request the current clipboard.
* @note Due to some system that manage the clipboard request asynchronous (like X11) and ewol managing the system with only one thread, * @note Due to some system that manage the clipboard request asynchronous (like X11) and ewol managing the system with only one thread,
@ -50,14 +50,14 @@ namespace ewol {
* notification of the arrival of this buffer id * notification of the arrival of this buffer id
* @param[in] _clipboardID the needed clipboard ID * @param[in] _clipboardID the needed clipboard ID
*/ */
void request(ewol::clipBoard::clipboardListe_te _clipboardID); void request(enum ewol::clipBoard::clipboardListe _clipboardID);
/** /**
* @brief set the ewol internal buffer (no notification at the GUI). This fuction might be use by the * @brief set the ewol internal buffer (no notification at the GUI). This fuction might be use by the
* Gui abstraction to set the buffer we receive. The end user must not use it. * Gui abstraction to set the buffer we receive. The end user must not use it.
* @param[in] _clipboardID selected clipboard ID * @param[in] _clipboardID selected clipboard ID
* @param[in] _data new buffer data * @param[in] _data new buffer data
*/ */
void setSystem(ewol::clipBoard::clipboardListe_te _clipboardID,const etk::UString& _data); void setSystem(enum ewol::clipBoard::clipboardListe _clipboardID,const etk::UString& _data);
/** /**
* @brief get the ewol internal buffer of the curent clipboard. The end user can use it when he receive the event in * @brief get the ewol internal buffer of the curent clipboard. The end user can use it when he receive the event in
* the widget : @ref onEventClipboard == > we can nothe this function is the only one which permit it. * the widget : @ref onEventClipboard == > we can nothe this function is the only one which permit it.
@ -65,7 +65,7 @@ namespace ewol {
* @param[in] _clipboardID selected clipboard ID * @param[in] _clipboardID selected clipboard ID
* @return the requested buffer * @return the requested buffer
*/ */
const etk::UString& get(ewol::clipBoard::clipboardListe_te _clipboardID); const etk::UString& get(enum ewol::clipBoard::clipboardListe _clipboardID);
// internal section // internal section

View File

@ -307,13 +307,13 @@ void ewol::Text::setFont(etk::UString _fontName, int32_t _fontSize) {
} }
} }
void ewol::Text::setFontMode(ewol::font::mode_te _mode) { void ewol::Text::setFontMode(enum ewol::font::mode _mode) {
if (m_font != NULL) { if (m_font != NULL) {
m_mode = m_font->getWrappingMode(_mode); m_mode = m_font->getWrappingMode(_mode);
} }
} }
ewol::font::mode_te ewol::Text::getFontMode(void) { enum ewol::font::mode ewol::Text::getFontMode(void) {
return m_mode; return m_mode;
} }
@ -864,7 +864,7 @@ void ewol::Text::forceLineReturn(void) {
setPos(vec3(m_startTextpos, m_position.y() - m_font->getHeight(m_mode), 0) ); setPos(vec3(m_startTextpos, m_position.y() - m_font->getHeight(m_mode), 0) );
} }
void ewol::Text::setTextAlignement(float _startTextpos, float _stopTextPos, ewol::Text::aligneMode_te _alignement) { void ewol::Text::setTextAlignement(float _startTextpos, float _stopTextPos, enum ewol::Text::aligneMode _alignement) {
m_startTextpos = _startTextpos; m_startTextpos = _startTextpos;
m_stopTextPos = _stopTextPos+1; m_stopTextPos = _stopTextPos+1;
m_alignement = _alignement; m_alignement = _alignement;
@ -873,7 +873,7 @@ void ewol::Text::setTextAlignement(float _startTextpos, float _stopTextPos, ewol
} }
} }
ewol::Text::aligneMode_te ewol::Text::getAlignement(void) { enum ewol::Text::aligneMode ewol::Text::getAlignement(void) {
return m_alignement; return m_alignement;
} }

View File

@ -25,7 +25,7 @@ namespace ewol {
public: public:
etk::Color<> m_colorBg; //!< display background color etk::Color<> m_colorBg; //!< display background color
etk::Color<> m_colorFg; //!< display foreground color etk::Color<> m_colorFg; //!< display foreground color
ewol::font::mode_te m_mode; //!< display mode Regular/Bold/Italic/BoldItalic enum ewol::font::mode m_mode; //!< display mode Regular/Bold/Italic/BoldItalic
TextDecoration(void) { TextDecoration(void) {
m_colorBg = etk::color::blue; m_colorBg = etk::color::blue;
m_colorBg = etk::color::green; m_colorBg = etk::color::green;
@ -36,13 +36,13 @@ namespace ewol {
class Text : public ewol::Compositing { class Text : public ewol::Compositing {
public: public:
typedef enum { enum aligneMode {
alignDisable, alignDisable,
alignRight, alignRight,
alignLeft, alignLeft,
alignCenter, alignCenter,
alignJustify alignJustify
} aligneMode_te; };
private: private:
ewol::Drawing m_vectorialDraw; //!< This is used to draw background selection and other things ... ewol::Drawing m_vectorialDraw; //!< This is used to draw background selection and other things ...
public: public:
@ -64,14 +64,14 @@ namespace ewol {
etk::Color<> m_colorCursor; //!< The text cursor color etk::Color<> m_colorCursor; //!< The text cursor color
etk::Color<> m_colorSelection; //!< The text Selection color etk::Color<> m_colorSelection; //!< The text Selection color
private: private:
ewol::font::mode_te m_mode; //!< font display property : Regular/Bold/Italic/BoldItalic enum ewol::font::mode m_mode; //!< font display property : Regular/Bold/Italic/BoldItalic
bool m_kerning; //!< Kerning enable or disable on the next elements displayed bool m_kerning; //!< Kerning enable or disable on the next elements displayed
bool m_distanceField; //!< Texture in distance Field mode == > maybe move this in the font property. bool m_distanceField; //!< Texture in distance Field mode == > maybe move this in the font property.
etk::UChar m_previousCharcode; //!< we remember the previous charcode to perform the kerning. @ref Kerning etk::UChar m_previousCharcode; //!< we remember the previous charcode to perform the kerning. @ref Kerning
private: private:
float m_startTextpos; //!< start position of the Alignement (when \n the text return at this position) float m_startTextpos; //!< start position of the Alignement (when \n the text return at this position)
float m_stopTextPos; //!< end of the alignement (when a string is too hight it cut at the word previously this virtual line and the center is perform with this one) float m_stopTextPos; //!< end of the alignement (when a string is too hight it cut at the word previously this virtual line and the center is perform with this one)
aligneMode_te m_alignement; //!< Current Alignement mode (justify/left/right ...) enum aligneMode m_alignement; //!< Current Alignement mode (justify/left/right ...)
private: private:
ewol::Program* m_GLprogram; //!< pointer on the opengl display program ewol::Program* m_GLprogram; //!< pointer on the opengl display program
int32_t m_GLPosition; //!< openGL id on the element (vertex buffer) int32_t m_GLPosition; //!< openGL id on the element (vertex buffer)
@ -204,12 +204,12 @@ namespace ewol {
* @brief Specify the font mode for the next @ref print * @brief Specify the font mode for the next @ref print
* @param[in] mode The font mode requested * @param[in] mode The font mode requested
*/ */
void setFontMode(ewol::font::mode_te _mode); void setFontMode(enum ewol::font::mode _mode);
/** /**
* @brief get the current font mode * @brief get the current font mode
* @return The font mode applied * @return The font mode applied
*/ */
ewol::font::mode_te getFontMode(void); enum ewol::font::mode getFontMode(void);
/** /**
* @brief enable or disable the bold mode * @brief enable or disable the bold mode
* @param[in] _status The new status for this display property * @param[in] _status The new status for this display property
@ -325,7 +325,7 @@ namespace ewol {
* @param[in] _alignement mode of alignement for the Text. * @param[in] _alignement mode of alignement for the Text.
* @note The text align in center change of line every display done (even if it was just a char) * @note The text align in center change of line every display done (even if it was just a char)
*/ */
void setTextAlignement(float _startTextpos, float _stopTextPos, ewol::Text::aligneMode_te _alignement=ewol::Text::alignDisable); void setTextAlignement(float _startTextpos, float _stopTextPos, enum ewol::Text::aligneMode _alignement=ewol::Text::alignDisable);
/** /**
* @brief disable the alignement system * @brief disable the alignement system
*/ */
@ -334,7 +334,7 @@ namespace ewol {
* @brief get the current alignement property * @brief get the current alignement property
* @return the curent alignement type * @return the curent alignement type
*/ */
ewol::Text::aligneMode_te getAlignement(void); enum ewol::Text::aligneMode getAlignement(void);
/** /**
* @brief calculate a theoric text size * @brief calculate a theoric text size
* @param[in] _text The string to calculate dimention. * @param[in] _text The string to calculate dimention.

View File

@ -33,7 +33,7 @@ static const char* cursorDescriptionString[ewol::cursorCount+1] = {
"cursorCount" "cursorCount"
}; };
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::cursorDisplay_te _obj) { etk::CCout& ewol::operator <<(etk::CCout& _os, const enum ewol::cursorDisplay _obj) {
if (_obj >= 0 && _obj <ewol::cursorCount) { if (_obj >= 0 && _obj <ewol::cursorCount) {
_os << cursorDescriptionString[_obj]; _os << cursorDescriptionString[_obj];
} else { } else {

View File

@ -13,7 +13,7 @@
#include <etk/Stream.h> #include <etk/Stream.h>
namespace ewol namespace ewol
{ {
typedef enum { enum cursorDisplay {
cursorArrow, // this is the normal arrow ... cursorArrow, // this is the normal arrow ...
cursorLeftArrow, cursorLeftArrow,
cursorInfo, cursorInfo,
@ -37,11 +37,11 @@ namespace ewol
cursorNone, cursorNone,
// just for the count: // just for the count:
cursorCount cursorCount
} cursorDisplay_te; };
/** /**
* @brief Debug operator To display the curent element in a Human readable information * @brief Debug operator To display the curent element in a Human readable information
*/ */
etk::CCout& operator <<(etk::CCout& _os, const ewol::cursorDisplay_te _obj); etk::CCout& operator <<(etk::CCout& _os, const enum ewol::cursorDisplay _obj);
}; };
#endif #endif

View File

@ -25,7 +25,7 @@ static const char* statusDescriptionString[ewol::keyEvent::statusCount+1] = {
"statusCount" "statusCount"
}; };
etk::CCout& ewol::keyEvent::operator <<(etk::CCout& _os, const ewol::keyEvent::status_te _obj) { etk::CCout& ewol::keyEvent::operator <<(etk::CCout& _os, const enum ewol::keyEvent::status _obj) {
if (_obj >= 0 && _obj <ewol::keyEvent::statusCount) { if (_obj >= 0 && _obj <ewol::keyEvent::statusCount) {
_os << statusDescriptionString[_obj]; _os << statusDescriptionString[_obj];
} else { } else {
@ -76,7 +76,7 @@ static const char* keyboardDescriptionString[ewol::keyEvent::keyboardCount+1] =
"keyboardCount" "keyboardCount"
}; };
etk::CCout& ewol::keyEvent::operator <<(etk::CCout& _os, const ewol::keyEvent::keyboard_te _obj) { etk::CCout& ewol::keyEvent::operator <<(etk::CCout& _os, const enum ewol::keyEvent::keyboard _obj) {
if (_obj >= 0 && _obj <ewol::keyEvent::keyboardCount) { if (_obj >= 0 && _obj <ewol::keyEvent::keyboardCount) {
_os << keyboardDescriptionString[_obj]; _os << keyboardDescriptionString[_obj];
} else { } else {
@ -93,7 +93,7 @@ static const char* typeDescriptionString[ewol::keyEvent::typeCount+1] = {
"typeCount" "typeCount"
}; };
etk::CCout& ewol::keyEvent::operator <<(etk::CCout& _os, const ewol::keyEvent::type_te _obj) { etk::CCout& ewol::keyEvent::operator <<(etk::CCout& _os, const enum ewol::keyEvent::type _obj) {
if (_obj >= 0 && _obj < ewol::keyEvent::typeCount) { if (_obj >= 0 && _obj < ewol::keyEvent::typeCount) {
_os << typeDescriptionString[_obj]; _os << typeDescriptionString[_obj];
} else { } else {

View File

@ -17,21 +17,21 @@ namespace ewol {
/** /**
* @brief type of input : Note that the keyboard is not prevent due to the fact that data is too different * @brief type of input : Note that the keyboard is not prevent due to the fact that data is too different
*/ */
typedef enum { enum type {
typeUnknow = 0, //!< Unknow input Type typeUnknow = 0, //!< Unknow input Type
typeMouse, //!< Mouse type typeMouse, //!< Mouse type
typeFinger, //!< Finger type typeFinger, //!< Finger type
typeStylet, //!< Stylet type typeStylet, //!< Stylet type
typeCount //!< number of types typeCount //!< number of types
} type_te; };
/** /**
* @brief Debug operator To display the curent element in a Human redeable information * @brief Debug operator To display the curent element in a Human redeable information
*/ */
etk::CCout& operator <<(etk::CCout& _os, const ewol::keyEvent::type_te _obj); etk::CCout& operator <<(etk::CCout& _os, const enum ewol::keyEvent::type _obj);
/** /**
* @brief Keybord event or joyestick event * @brief Keybord event or joyestick event
*/ */
typedef enum { enum status {
statusUnknow = 0, statusUnknow = 0,
statusDown, // availlable on Keyboard too statusDown, // availlable on Keyboard too
statusMove, statusMove,
@ -46,15 +46,15 @@ namespace ewol {
statusAbort, // Appeare when an event is tranfert betwwen widgets (the widget which receive this has lost the events) statusAbort, // Appeare when an event is tranfert betwwen widgets (the widget which receive this has lost the events)
statusTransfert, // Appeare when an event is tranfert betwwen widgets (the widget which receive this has receive the transfert of the event) statusTransfert, // Appeare when an event is tranfert betwwen widgets (the widget which receive this has receive the transfert of the event)
statusCount, // number max of imput possible statusCount, // number max of imput possible
} status_te; };
/** /**
* @brief Debug operator To display the curent element in a Human redeable information * @brief Debug operator To display the curent element in a Human redeable information
*/ */
etk::CCout& operator <<(etk::CCout& _os, const ewol::keyEvent::status_te _obj); etk::CCout& operator <<(etk::CCout& _os, const enum ewol::keyEvent::status _obj);
/** /**
* @brief Keybord event or joyestick event * @brief Keybord event or joyestick event
*/ */
typedef enum { enum keyboard {
keyboardUnknow = 0, //!< Unknown keyboard key keyboardUnknow = 0, //!< Unknown keyboard key
keyboardChar, //!< Char input is arrived ... keyboardChar, //!< Char input is arrived ...
keyboardLeft, //!< Left key <-- keyboardLeft, //!< Left key <--
@ -93,11 +93,11 @@ namespace ewol {
keyboardContextMenu, //!< Contextual menu key. keyboardContextMenu, //!< Contextual menu key.
keyboardNumLock, //!< Numerical Lock key. keyboardNumLock, //!< Numerical Lock key.
keyboardCount //!< number of posible key keyboardCount //!< number of posible key
} keyboard_te; };
/** /**
* @brief Debug operator To display the curent element in a Human redeable information * @brief Debug operator To display the curent element in a Human redeable information
*/ */
etk::CCout& operator <<(etk::CCout& _os, const ewol::keyEvent::keyboard_te _obj); etk::CCout& operator <<(etk::CCout& _os, const enum ewol::keyEvent::keyboard _obj);
}; };

View File

@ -22,14 +22,22 @@ namespace ewol {
virtual bool parse(const char* _line); virtual bool parse(const char* _line);
virtual void display(void) {}; virtual void display(void) {};
public: public:
virtual type_te getType(void) { return ewol::PhysicsShape::box; }; virtual enum type getType(void) {
return ewol::PhysicsShape::box;
};
private: private:
vec3 m_size; // Box size property in X, Y and Z vec3 m_size; // Box size property in X, Y and Z
public: public:
const vec3& getSize(void) const { return m_size; }; const vec3& getSize(void) const {
return m_size;
};
public: public:
virtual const PhysicsBox* toBox(void) const { return this; }; virtual const PhysicsBox* toBox(void) const {
virtual PhysicsBox* toBox(void) { return this; }; return this;
};
virtual PhysicsBox* toBox(void) {
return this;
};
}; };
}; };

View File

@ -23,18 +23,28 @@ namespace ewol {
virtual bool parse(const char* _line); virtual bool parse(const char* _line);
virtual void display(void) {}; virtual void display(void) {};
public: public:
virtual type_te getType(void) { return ewol::PhysicsShape::capsule; }; virtual enum type getType(void) {
return ewol::PhysicsShape::capsule;
};
private: private:
float m_radius; float m_radius;
public: public:
float getRadius(void) const { return m_radius; }; float getRadius(void) const {
return m_radius;
};
private: private:
float m_height; float m_height;
public: public:
float getHeight(void) const { return m_height; }; float getHeight(void) const {
return m_height;
};
public: public:
virtual const PhysicsCapsule* toCapsule(void) const { return this; }; virtual const PhysicsCapsule* toCapsule(void) const {
virtual PhysicsCapsule* toCapsule(void) { return this; }; return this;
};
virtual PhysicsCapsule* toCapsule(void) {
return this;
};
}; };
}; };

View File

@ -23,18 +23,28 @@ namespace ewol {
virtual bool parse(const char* _line); virtual bool parse(const char* _line);
virtual void display(void) {}; virtual void display(void) {};
public: public:
virtual type_te getType(void) { return ewol::PhysicsShape::cone; }; virtual enum type getType(void) {
return ewol::PhysicsShape::cone;
};
private: private:
float m_radius; float m_radius;
public: public:
float getRadius(void) const { return m_radius; }; float getRadius(void) const {
return m_radius;
};
private: private:
float m_height; float m_height;
public: public:
float getHeight(void) const { return m_height; }; float getHeight(void) const {
return m_height;
};
public: public:
virtual const PhysicsCone* toCone(void) const { return this; }; virtual const PhysicsCone* toCone(void) const {
virtual PhysicsCone* toCone(void) { return this; }; return this;
};
virtual PhysicsCone* toCone(void) {
return this;
};
}; };
}; };

View File

@ -23,18 +23,28 @@ namespace ewol {
virtual bool parse(const char* _line); virtual bool parse(const char* _line);
virtual void display(void) {}; virtual void display(void) {};
public: public:
virtual type_te getType(void) { return ewol::PhysicsShape::convexHull; }; virtual enum type getType(void) {
return ewol::PhysicsShape::convexHull;
};
private: private:
vec3 m_scale; vec3 m_scale;
public: public:
vec3 getScale(void) const { return m_scale; }; vec3 getScale(void) const {
return m_scale;
};
private: private:
etk::Vector<vec3> m_points; etk::Vector<vec3> m_points;
public: public:
const etk::Vector<vec3>& getPointList(void) const { return m_points; }; const etk::Vector<vec3>& getPointList(void) const {
return m_points;
};
public: public:
virtual const PhysicsConvexHull* toConvexHull(void) const { return this; }; virtual const PhysicsConvexHull* toConvexHull(void) const {
virtual PhysicsConvexHull* toConvexHull(void) { return this; }; return this;
};
virtual PhysicsConvexHull* toConvexHull(void) {
return this;
};
}; };
}; };

View File

@ -23,14 +23,22 @@ namespace ewol {
virtual bool parse(const char* _line); virtual bool parse(const char* _line);
virtual void display(void) {}; virtual void display(void) {};
public: public:
virtual type_te getType(void) { return ewol::PhysicsShape::cylinder; }; virtual enum type getType(void) {
return ewol::PhysicsShape::cylinder;
};
private: private:
vec3 m_size; vec3 m_size;
public: public:
vec3 getSize(void) const { return m_size; }; vec3 getSize(void) const {
return m_size;
};
public: public:
virtual const PhysicsCylinder* toCylinder(void) const { return this; }; virtual const PhysicsCylinder* toCylinder(void) const {
virtual PhysicsCylinder* toCylinder(void) { return this; }; return this;
};
virtual PhysicsCylinder* toCylinder(void) {
return this;
};
}; };
}; };

View File

@ -28,7 +28,7 @@ namespace ewol {
public: public:
static PhysicsShape* create(const etk::UString& _name); static PhysicsShape* create(const etk::UString& _name);
public: public:
typedef enum { enum type {
unknow, unknow,
box, box,
capsule, capsule,
@ -36,50 +36,97 @@ namespace ewol {
convexHull, convexHull,
cylinder, cylinder,
sphere sphere
} type_te; };
public: public:
PhysicsShape(void) : m_quaternion(1,0,0,0), m_origin(0,0,0) {}; PhysicsShape(void) : m_quaternion(1,0,0,0), m_origin(0,0,0) {
virtual ~PhysicsShape(void) {};
};
virtual ~PhysicsShape(void) {
};
public: public:
virtual type_te getType(void) { return ewol::PhysicsShape::unknow; }; virtual enum type getType(void) {
return ewol::PhysicsShape::unknow;
};
public: public:
virtual bool parse(const char* _line); virtual bool parse(const char* _line);
virtual void display(void) {}; virtual void display(void) {
};
private: private:
vec4 m_quaternion; vec4 m_quaternion;
public: public:
vec4 getQuaternion(void) const { return m_quaternion; }; const vec4& getQuaternion(void) const {
return m_quaternion;
};
private: private:
vec3 m_origin; vec3 m_origin;
public: public:
vec3 getOrigin(void) const { return m_origin; }; const vec3& getOrigin(void) const {
return m_origin;
};
public: public:
bool isBox(void) { return getType() == ewol::PhysicsShape::box; }; bool isBox(void) {
bool isCylinder(void) { return getType() == ewol::PhysicsShape::cylinder; }; return getType() == ewol::PhysicsShape::box;
bool isCapsule(void) { return getType() == ewol::PhysicsShape::capsule; }; };
bool isCone(void) { return getType() == ewol::PhysicsShape::cone; }; bool isCylinder(void) {
bool isConvexHull(void) { return getType() == ewol::PhysicsShape::convexHull; }; return getType() == ewol::PhysicsShape::cylinder;
bool isSphere(void) { return getType() == ewol::PhysicsShape::sphere; }; };
bool isCapsule(void) {
return getType() == ewol::PhysicsShape::capsule;
};
bool isCone(void) {
return getType() == ewol::PhysicsShape::cone;
};
bool isConvexHull(void) {
return getType() == ewol::PhysicsShape::convexHull;
};
bool isSphere(void) {
return getType() == ewol::PhysicsShape::sphere;
};
virtual const PhysicsBox* toBox(void) const { return NULL; }; virtual const PhysicsBox* toBox(void) const {
virtual PhysicsBox* toBox(void) { return NULL; }; return NULL;
};
virtual PhysicsBox* toBox(void) {
return NULL;
};
virtual const PhysicsCylinder* toCylinder(void) const { return NULL; }; virtual const PhysicsCylinder* toCylinder(void) const {
virtual PhysicsCylinder* toCylinder(void) { return NULL; }; return NULL;
};
virtual PhysicsCylinder* toCylinder(void) {
return NULL;
};
virtual const PhysicsCapsule* toCapsule(void) const { return NULL; }; virtual const PhysicsCapsule* toCapsule(void) const {
virtual PhysicsCapsule* toCapsule(void) { return NULL; }; return NULL;
};
virtual PhysicsCapsule* toCapsule(void) {
return NULL;
};
virtual const PhysicsCone* toCone(void) const { return NULL; }; virtual const PhysicsCone* toCone(void) const {
virtual PhysicsCone* toCone(void) { return NULL; }; return NULL;
};
virtual PhysicsCone* toCone(void) {
return NULL;
};
virtual const PhysicsConvexHull* toConvexHull(void) const { return NULL; }; virtual const PhysicsConvexHull* toConvexHull(void) const {
virtual PhysicsConvexHull* toConvexHull(void) { return NULL; }; return NULL;
};
virtual const PhysicsSphere* toSphere(void) const { return NULL; }; virtual PhysicsConvexHull* toConvexHull(void) {
virtual PhysicsSphere* toSphere(void) { return NULL; }; return NULL;
};
virtual const PhysicsSphere* toSphere(void) const {
return NULL;
};
virtual PhysicsSphere* toSphere(void) {
return NULL;
};
}; };
}; };

View File

@ -23,14 +23,20 @@ namespace ewol {
virtual bool parse(const char* _line); virtual bool parse(const char* _line);
virtual void display(void) {}; virtual void display(void) {};
public: public:
virtual type_te getType(void) { return ewol::PhysicsShape::sphere; }; virtual enum type getType(void) {
return ewol::PhysicsShape::sphere;
};
private: private:
float m_radius; // props["radius"] = obj.scale.x float m_radius; // props["radius"] = obj.scale.x
public: public:
float getRadius(void) const { return m_radius; }; float getRadius(void) const { return m_radius; };
private: private:
virtual const PhysicsSphere* toSphere(void) const { return this; }; virtual const PhysicsSphere* toSphere(void) const {
virtual PhysicsSphere* toSphere(void) { return this; }; return this;
};
virtual PhysicsSphere* toSphere(void) {
return this;
};
}; };
}; };

View File

@ -42,13 +42,13 @@ void java_check_exception(JNIEnv* _env) {
class AndroidContext : public ewol::eContext { class AndroidContext : public ewol::eContext {
public: public:
typedef enum { enum application {
appl_unknow, appl_unknow,
appl_application, appl_application,
appl_wallpaper appl_wallpaper
} application_te; };
private: private:
application_te m_javaApplicationType; enum application m_javaApplicationType;
// get a resources from the java environement : // get a resources from the java environement :
JNIEnv* m_JavaVirtualMachinePointer; //!< the JVM JNIEnv* m_JavaVirtualMachinePointer; //!< the JVM
jclass m_javaClassEwol; //!< main activity class (android ...) jclass m_javaClassEwol; //!< main activity class (android ...)
@ -75,7 +75,7 @@ class AndroidContext : public ewol::eContext {
return true; return true;
} }
public: public:
AndroidContext(JNIEnv* _env, jclass _classBase, jobject _objCallback, application_te _typeAPPL) : AndroidContext(JNIEnv* _env, jclass _classBase, jobject _objCallback, enum application _typeAPPL) :
m_javaApplicationType(_typeAPPL), m_javaApplicationType(_typeAPPL),
m_JavaVirtualMachinePointer(NULL), m_JavaVirtualMachinePointer(NULL),
m_javaClassEwol(0), m_javaClassEwol(0),
@ -200,7 +200,7 @@ class AndroidContext : public ewol::eContext {
java_detach_current_thread(status); java_detach_current_thread(status);
} }
void clipBoardGet(ewol::clipBoard::clipboardListe_te _clipboardID) { void clipBoardGet(enum ewol::clipBoard::clipboardListe _clipboardID) {
// this is to force the local system to think we have the buffer // this is to force the local system to think we have the buffer
// TODO : remove this 2 line when code will be writen // TODO : remove this 2 line when code will be writen
m_clipBoardOwnerStd = true; m_clipBoardOwnerStd = true;
@ -225,7 +225,7 @@ class AndroidContext : public ewol::eContext {
} }
} }
void clipBoardSet(ewol::clipBoard::clipboardListe_te _clipboardID) { void clipBoardSet(enum ewol::clipBoard::clipboardListe _clipboardID) {
switch (_clipboardID) { switch (_clipboardID) {
case ewol::clipBoard::clipboardSelection: case ewol::clipBoard::clipboardSelection:
// NOTE : nothing to do : Windows deas ot supported Middle button // NOTE : nothing to do : Windows deas ot supported Middle button
@ -293,7 +293,7 @@ class AndroidContext : public ewol::eContext {
}; };
// mode 0 : auto; 1 landscape, 2 portrait // mode 0 : auto; 1 landscape, 2 portrait
void forceOrientation(ewol::orientation_te _orientation) { void forceOrientation(enum ewol::orientation _orientation) {
#ifndef __ANDROID_PERMISSION__SET_ORIENTATION__ #ifndef __ANDROID_PERMISSION__SET_ORIENTATION__
EWOL_ERROR("C->java : call set orientation without Allow application to do it ... Break..."); EWOL_ERROR("C->java : call set orientation without Allow application to do it ... Break...");
return; return;

View File

@ -15,13 +15,13 @@
namespace ewol { namespace ewol {
class EventEntry { class EventEntry {
private: private:
ewol::keyEvent::keyboard_te m_type; //!< type of hardware event enum ewol::keyEvent::keyboard m_type; //!< type of hardware event
ewol::keyEvent::status_te m_status; //!< status of hardware event enum ewol::keyEvent::status m_status; //!< status of hardware event
ewol::SpecialKey m_specialKey; //!< input key status (prevent change in time..) ewol::SpecialKey m_specialKey; //!< input key status (prevent change in time..)
etk::UChar m_unicodeData; //!< Unicode data (in some case) etk::UChar m_unicodeData; //!< Unicode data (in some case)
public: public:
EventEntry(ewol::keyEvent::keyboard_te _type, EventEntry(enum ewol::keyEvent::keyboard _type,
ewol::keyEvent::status_te _status, enum ewol::keyEvent::status _status,
ewol::SpecialKey _specialKey, ewol::SpecialKey _specialKey,
etk::UChar _char) : etk::UChar _char) :
m_type(_type), m_type(_type),
@ -29,16 +29,16 @@ namespace ewol {
m_specialKey(_specialKey), m_specialKey(_specialKey),
m_unicodeData(_char) m_unicodeData(_char)
{ }; { };
void setType(ewol::keyEvent::keyboard_te _type) { void setType(enum ewol::keyEvent::keyboard _type) {
m_type = _type; m_type = _type;
}; };
inline const ewol::keyEvent::keyboard_te& getType(void) const { inline const enum ewol::keyEvent::keyboard& getType(void) const {
return m_type; return m_type;
}; };
void setStatus(ewol::keyEvent::status_te _status) { void setStatus(enum ewol::keyEvent::status _status) {
m_status = _status; m_status = _status;
}; };
inline const ewol::keyEvent::status_te& getStatus(void) const { inline const enum ewol::keyEvent::status& getStatus(void) const {
return m_status; return m_status;
}; };
void setSpecialKey(const ewol::SpecialKey& _specialKey) { void setSpecialKey(const ewol::SpecialKey& _specialKey) {
@ -58,8 +58,8 @@ namespace ewol {
class EventEntrySystem { class EventEntrySystem {
public: public:
EventEntrySystem(ewol::keyEvent::keyboard_te _type, EventEntrySystem(enum ewol::keyEvent::keyboard _type,
ewol::keyEvent::status_te _status, enum ewol::keyEvent::status _status,
ewol::SpecialKey _specialKey, ewol::SpecialKey _specialKey,
etk::UChar _char) : etk::UChar _char) :
m_event(_type, _status, _specialKey, _char) m_event(_type, _status, _specialKey, _char)

View File

@ -14,13 +14,13 @@
namespace ewol { namespace ewol {
class EventInput { class EventInput {
private: private:
ewol::keyEvent::type_te m_type; enum ewol::keyEvent::type m_type;
ewol::keyEvent::status_te m_status; enum ewol::keyEvent::status m_status;
uint8_t m_inputId; uint8_t m_inputId;
vec2 m_pos; vec2 m_pos;
public: public:
EventInput(ewol::keyEvent::type_te _type, EventInput(enum ewol::keyEvent::type _type,
ewol::keyEvent::status_te _status, enum ewol::keyEvent::status _status,
uint8_t _id, uint8_t _id,
const vec2& _pos): const vec2& _pos):
m_type(_type), m_type(_type),
@ -28,16 +28,16 @@ namespace ewol {
m_inputId(_id), m_inputId(_id),
m_pos(_pos) m_pos(_pos)
{ }; { };
void setType(ewol::keyEvent::type_te _type) { void setType(enum ewol::keyEvent::type _type) {
m_type = _type; m_type = _type;
}; };
inline const ewol::keyEvent::type_te& getType(void) const { inline const enum ewol::keyEvent::type& getType(void) const {
return m_type; return m_type;
}; };
void setStatus(ewol::keyEvent::status_te _status) { void setStatus(enum ewol::keyEvent::status _status) {
m_status = _status; m_status = _status;
}; };
inline const ewol::keyEvent::status_te& getStatus(void) const { inline const enum ewol::keyEvent::status& getStatus(void) const {
return m_status; return m_status;
}; };
void setId(uint8_t _id) { void setId(uint8_t _id) {
@ -57,8 +57,8 @@ namespace ewol {
class EventInputSystem { class EventInputSystem {
public: public:
EventInputSystem(ewol::keyEvent::type_te _type, EventInputSystem(enum ewol::keyEvent::type _type,
ewol::keyEvent::status_te _status, enum ewol::keyEvent::status _status,
uint8_t _id, uint8_t _id,
const vec2& _pos, const vec2& _pos,
ewol::Widget* _dest, ewol::Widget* _dest,

View File

@ -130,7 +130,7 @@ class WindowsContext : public ewol::eContext {
// TODO : Later // TODO : Later
} }
void ClipBoardGet(ewol::clipBoard::clipboardListe_te _clipboardID) { void ClipBoardGet(enum ewol::clipBoard::clipboardListe _clipboardID) {
// this is to force the local system to think we have the buffer // this is to force the local system to think we have the buffer
// TODO : remove this 2 line when code will be writen // TODO : remove this 2 line when code will be writen
l_clipBoardOwnerStd = true; l_clipBoardOwnerStd = true;
@ -156,7 +156,7 @@ class WindowsContext : public ewol::eContext {
} }
} }
void ClipBoardSet(ewol::clipBoard::clipboardListe_te _clipboardID) { void ClipBoardSet(enum ewol::clipBoard::clipboardListe _clipboardID) {
switch (_clipboardID) switch (_clipboardID)
{ {
case ewol::clipBoard::clipboardSelection: case ewol::clipBoard::clipboardSelection:
@ -278,7 +278,7 @@ class WindowsContext : public ewol::eContext {
buttonIsDown = false; buttonIsDown = false;
case WM_KEYDOWN: { case WM_KEYDOWN: {
etk::UChar tmpChar = 0; etk::UChar tmpChar = 0;
ewol::keyEvent::keyboard_te keyInput; enum ewol::keyEvent::keyboard keyInput;
switch (_wParam) { switch (_wParam) {
//case 80: // keypad //case 80: // keypad
case VK_UP: keyInput = ewol::keyEvent::keyboardUp; break; case VK_UP: keyInput = ewol::keyEvent::keyboardUp; break;

View File

@ -138,7 +138,7 @@ class X11Interface : public ewol::eContext {
Atom XAtomeTargetTarget; Atom XAtomeTargetTarget;
Atom XAtomeEWOL; Atom XAtomeEWOL;
Atom XAtomeDeleteWindows; Atom XAtomeDeleteWindows;
ewol::cursorDisplay_te m_currentCursor; //!< select the current cursor to display : enum ewol::cursorDisplay m_currentCursor; //!< select the current cursor to display :
public: public:
X11Interface(int32_t _argc, const char* _argv[]) : X11Interface(int32_t _argc, const char* _argv[]) :
ewol::eContext(_argc, _argv), ewol::eContext(_argc, _argv),
@ -558,7 +558,7 @@ class X11Interface : public ewol::eContext {
m_guiKeyBoardMode.altGr = false; m_guiKeyBoardMode.altGr = false;
} }
bool find = true; bool find = true;
ewol::keyEvent::keyboard_te keyInput; enum ewol::keyEvent::keyboard keyInput;
switch (event.xkey.keycode) { switch (event.xkey.keycode) {
//case 80: // keypad //case 80: // keypad
case 111: keyInput = ewol::keyEvent::keyboardUp; break; case 111: keyInput = ewol::keyEvent::keyboardUp; break;
@ -741,7 +741,7 @@ class X11Interface : public ewol::eContext {
} }
*/ */
/****************************************************************************************/ /****************************************************************************************/
virtual void setCursor(ewol::cursorDisplay_te _newCursor) { virtual void setCursor(enum ewol::cursorDisplay _newCursor) {
if (_newCursor != m_currentCursor) { if (_newCursor != m_currentCursor) {
X11_DEBUG("X11-API: set New Cursor : " << _newCursor); X11_DEBUG("X11-API: set New Cursor : " << _newCursor);
// undefine previous cursors ... // undefine previous cursors ...
@ -1220,9 +1220,8 @@ class X11Interface : public ewol::eContext {
X11_INFO("X11: set Title (END)"); X11_INFO("X11: set Title (END)");
} }
/****************************************************************************************/ /****************************************************************************************/
void clipBoardGet(ewol::clipBoard::clipboardListe_te _clipboardID) { void clipBoardGet(enum ewol::clipBoard::clipboardListe _clipboardID) {
switch (_clipboardID) switch (_clipboardID) {
{
case ewol::clipBoard::clipboardSelection: case ewol::clipBoard::clipboardSelection:
if (false == m_clipBoardOwnerPrimary) { if (false == m_clipBoardOwnerPrimary) {
m_clipBoardRequestPrimary = true; m_clipBoardRequestPrimary = true;
@ -1259,7 +1258,7 @@ class X11Interface : public ewol::eContext {
} }
} }
/****************************************************************************************/ /****************************************************************************************/
void clipBoardSet(ewol::clipBoard::clipboardListe_te _clipboardID) { void clipBoardSet(enum ewol::clipBoard::clipboardListe _clipboardID) {
switch (_clipboardID) switch (_clipboardID)
{ {
case ewol::clipBoard::clipboardSelection: case ewol::clipBoard::clipboardSelection:

View File

@ -369,12 +369,12 @@ void DirectFB_Run(void) {
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
void guiInterface::ClipBoardGet(ewol::clipBoard::clipboardListe_te _clipboardID) { void guiInterface::ClipBoardGet(enum ewol::clipBoard::clipboardListe _clipboardID) {
// TODO : ... // TODO : ...
} }
void guiInterface::ClipBoardSet(ewol::clipBoard::clipboardListe_te _clipboardID) { void guiInterface::ClipBoardSet(enum ewol::clipBoard::clipboardListe _clipboardID) {
// TODO : ... // TODO : ...
} }
@ -414,7 +414,7 @@ void guiInterface::getAbsPos(ivec2& _pos) {
} }
void guiInterface::setCursor(ewol::cursorDisplay_te _newCursor) { void guiInterface::setCursor(enum ewol::cursorDisplay _newCursor) {
// TODO : ... // TODO : ...
} }
@ -451,7 +451,7 @@ int guiInterface::main(int argc, const char *argv[]) {
} }
void guiInterface::forceOrientation(ewol::orientation_te orientation) { void guiInterface::forceOrientation(enum ewol::orientation _orientation) {
// nothing to do ... // nothing to do ...
} }

View File

@ -90,29 +90,29 @@ void ewol::eContext::processEvents(void) {
m_msgSystem.wait(data); m_msgSystem.wait(data);
//EWOL_DEBUG("EVENT"); //EWOL_DEBUG("EVENT");
switch (data.TypeMessage) { switch (data.TypeMessage) {
case THREAD_INIT: case eSystemMessage::msgInit:
// this is due to the openGL context // this is due to the openGL context
/*bool returnVal = */APP_Init(*this); /*bool returnVal = */APP_Init(*this);
break; break;
case THREAD_RECALCULATE_SIZE: case eSystemMessage::msgRecalculateSize:
forceRedrawAll(); forceRedrawAll();
break; break;
case THREAD_RESIZE: case eSystemMessage::msgResize:
//EWOL_DEBUG("Receive MSG : THREAD_RESIZE"); //EWOL_DEBUG("Receive MSG : THREAD_RESIZE");
m_windowsSize = data.dimention; m_windowsSize = data.dimention;
ewol::dimension::setPixelWindowsSize(m_windowsSize); ewol::dimension::setPixelWindowsSize(m_windowsSize);
forceRedrawAll(); forceRedrawAll();
break; break;
case THREAD_INPUT_MOTION: case eSystemMessage::msgInputMotion:
//EWOL_DEBUG("Receive MSG : THREAD_INPUT_MOTION"); //EWOL_DEBUG("Receive MSG : THREAD_INPUT_MOTION");
m_input.motion(data.inputType, data.inputId, data.dimention); m_input.motion(data.inputType, data.inputId, data.dimention);
break; break;
case THREAD_INPUT_STATE: case eSystemMessage::msgInputState:
//EWOL_DEBUG("Receive MSG : THREAD_INPUT_STATE"); //EWOL_DEBUG("Receive MSG : THREAD_INPUT_STATE");
m_input.state(data.inputType, data.inputId, data.stateIsDown, data.dimention); m_input.state(data.inputType, data.inputId, data.stateIsDown, data.dimention);
break; break;
case THREAD_KEYBORAD_KEY: case eSystemMessage::msgKeyboardKey:
case THREAD_KEYBORAD_MOVE: case eSystemMessage::msgKeyboardMove:
//EWOL_DEBUG("Receive MSG : THREAD_KEYBORAD_KEY"); //EWOL_DEBUG("Receive MSG : THREAD_KEYBORAD_KEY");
if (NULL != m_windowsCurrent) { if (NULL != m_windowsCurrent) {
if (false == m_windowsCurrent->onEventShortCut(data.keyboardSpecial, if (false == m_windowsCurrent->onEventShortCut(data.keyboardSpecial,
@ -133,7 +133,7 @@ void ewol::eContext::processEvents(void) {
data.keyboardMove, data.keyboardMove,
data.stateIsDown) ) { data.stateIsDown) ) {
// generate the direct event ... // generate the direct event ...
if (data.TypeMessage == THREAD_KEYBORAD_KEY) { if (data.TypeMessage == eSystemMessage::msgKeyboardKey) {
ewol::EventEntrySystem tmpEntryEvent(ewol::keyEvent::keyboardChar, ewol::EventEntrySystem tmpEntryEvent(ewol::keyEvent::keyboardChar,
ewol::keyEvent::statusUp, ewol::keyEvent::statusUp,
data.keyboardSpecial, data.keyboardSpecial,
@ -161,7 +161,7 @@ void ewol::eContext::processEvents(void) {
} }
} }
break; break;
case THREAD_CLIPBOARD_ARRIVE: case eSystemMessage::msgClipboardArrive:
{ {
ewol::Widget * tmpWidget = m_widgetManager.focusGet(); ewol::Widget * tmpWidget = m_widgetManager.focusGet();
if (tmpWidget != NULL) { if (tmpWidget != NULL) {
@ -169,13 +169,13 @@ void ewol::eContext::processEvents(void) {
} }
} }
break; break;
case THREAD_HIDE: case eSystemMessage::msgHide:
EWOL_DEBUG("Receive MSG : THREAD_HIDE"); EWOL_DEBUG("Receive MSG : msgHide");
//guiAbstraction::SendKeyboardEventMove(tmpData->isDown, tmpData->move); //guiAbstraction::SendKeyboardEventMove(tmpData->isDown, tmpData->move);
//gui_uniqueWindows->SysOnHide(); //gui_uniqueWindows->SysOnHide();
break; break;
case THREAD_SHOW: case eSystemMessage::msgShow:
EWOL_DEBUG("Receive MSG : THREAD_SHOW"); EWOL_DEBUG("Receive MSG : msgShow");
//guiAbstraction::SendKeyboardEventMove(tmpData->isDown, tmpData->move); //guiAbstraction::SendKeyboardEventMove(tmpData->isDown, tmpData->move);
//gui_uniqueWindows->SysOnShow(); //gui_uniqueWindows->SysOnShow();
break; break;
@ -232,22 +232,22 @@ ewol::eContext::eContext(int32_t _argc, const char* _argv[]) :
// parse the debug level: // parse the debug level:
for(esize_t iii=m_commandLine.size()-1 ; iii >= 0 ; --iii) { for(esize_t iii=m_commandLine.size()-1 ; iii >= 0 ; --iii) {
if (m_commandLine.get(iii) == "-l0") { if (m_commandLine.get(iii) == "-l0") {
debug::setGeneralLevel(etk::LOG_LEVEL_NONE); debug::setGeneralLevel(etk::logLevelNone);
} else if (m_commandLine.get(iii) == "-l1") { } else if (m_commandLine.get(iii) == "-l1") {
debug::setGeneralLevel(etk::LOG_LEVEL_CRITICAL); debug::setGeneralLevel(etk::logLevelCritical);
} else if (m_commandLine.get(iii) == "-l2") { } else if (m_commandLine.get(iii) == "-l2") {
debug::setGeneralLevel(etk::LOG_LEVEL_ERROR); debug::setGeneralLevel(etk::logLevelError);
} else if (m_commandLine.get(iii) == "-l3") { } else if (m_commandLine.get(iii) == "-l3") {
debug::setGeneralLevel(etk::LOG_LEVEL_WARNING); debug::setGeneralLevel(etk::logLevelWarning);
} else if (m_commandLine.get(iii) == "-l4") { } else if (m_commandLine.get(iii) == "-l4") {
debug::setGeneralLevel(etk::LOG_LEVEL_INFO); debug::setGeneralLevel(etk::logLevelInfo);
} else if (m_commandLine.get(iii) == "-l5") { } else if (m_commandLine.get(iii) == "-l5") {
debug::setGeneralLevel(etk::LOG_LEVEL_DEBUG); debug::setGeneralLevel(etk::logLevelDebug);
} else if( m_commandLine.get(iii) == "-l6" } else if( m_commandLine.get(iii) == "-l6"
|| m_commandLine.get(iii) == "-l7" || m_commandLine.get(iii) == "-l7"
|| m_commandLine.get(iii) == "-l8" || m_commandLine.get(iii) == "-l8"
|| m_commandLine.get(iii) == "-l9") { || m_commandLine.get(iii) == "-l9") {
debug::setGeneralLevel(etk::LOG_LEVEL_VERBOSE); debug::setGeneralLevel(etk::logLevelVerbose);
} else if (m_commandLine.get(iii) == "-fps") { } else if (m_commandLine.get(iii) == "-fps") {
m_displayFps=true; m_displayFps=true;
} else { } else {
@ -263,17 +263,17 @@ ewol::eContext::eContext(int32_t _argc, const char* _argv[]) :
// request the init of the application in the main context of openGL ... // request the init of the application in the main context of openGL ...
{ {
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_INIT; data.TypeMessage = eSystemMessage::msgInit;
m_msgSystem.post(data); m_msgSystem.post(data);
} }
// force a recalculation // force a recalculation
requestUpdateSize(); requestUpdateSize();
#if defined(__EWOL_ANDROID_ORIENTATION_LANDSCAPE__) #if defined(__EWOL_ANDROID_ORIENTATION_LANDSCAPE__)
forceOrientation(ewol::SCREEN_ORIENTATION_LANDSCAPE); forceOrientation(ewol::screenLandscape);
#elif defined(__EWOL_ANDROID_ORIENTATION_PORTRAIT__) #elif defined(__EWOL_ANDROID_ORIENTATION_PORTRAIT__)
forceOrientation(ewol::SCREEN_ORIENTATION_PORTRAIT); forceOrientation(ewol::screenPortrait);
#else #else
forceOrientation(ewol::SCREEN_ORIENTATION_AUTO); forceOrientation(ewol::screenAuto);
#endif #endif
// release the curent interface : // release the curent interface :
unLockContext(); unLockContext();
@ -302,7 +302,7 @@ ewol::eContext::~eContext(void) {
void ewol::eContext::requestUpdateSize(void) { void ewol::eContext::requestUpdateSize(void) {
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_RECALCULATE_SIZE; data.TypeMessage = eSystemMessage::msgRecalculateSize;
m_msgSystem.post(data); m_msgSystem.post(data);
} }
@ -310,14 +310,14 @@ void ewol::eContext::OS_Resize(const vec2& _size) {
// TODO : Better in the thread ... == > but generate some init error ... // TODO : Better in the thread ... == > but generate some init error ...
ewol::dimension::setPixelWindowsSize(_size); ewol::dimension::setPixelWindowsSize(_size);
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_RESIZE; data.TypeMessage = eSystemMessage::msgResize;
data.dimention = _size; data.dimention = _size;
m_msgSystem.post(data); m_msgSystem.post(data);
} }
void ewol::eContext::OS_Move(const vec2& _pos) { void ewol::eContext::OS_Move(const vec2& _pos) {
/* /*
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_RESIZE; data.TypeMessage = eSystemMessage::msgResize;
data.resize.w = w; data.resize.w = w;
data.resize.h = h; data.resize.h = h;
m_msgSystem.Post(data); m_msgSystem.Post(data);
@ -326,7 +326,7 @@ void ewol::eContext::OS_Move(const vec2& _pos) {
void ewol::eContext::OS_SetInputMotion(int _pointerID, const vec2& _pos ) { void ewol::eContext::OS_SetInputMotion(int _pointerID, const vec2& _pos ) {
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_INPUT_MOTION; data.TypeMessage = eSystemMessage::msgInputMotion;
data.inputType = ewol::keyEvent::typeFinger; data.inputType = ewol::keyEvent::typeFinger;
data.inputId = _pointerID; data.inputId = _pointerID;
data.dimention = _pos; data.dimention = _pos;
@ -335,7 +335,7 @@ void ewol::eContext::OS_SetInputMotion(int _pointerID, const vec2& _pos ) {
void ewol::eContext::OS_SetInputState(int _pointerID, bool _isDown, const vec2& _pos ) { void ewol::eContext::OS_SetInputState(int _pointerID, bool _isDown, const vec2& _pos ) {
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_INPUT_STATE; data.TypeMessage = eSystemMessage::msgInputState;
data.inputType = ewol::keyEvent::typeFinger; data.inputType = ewol::keyEvent::typeFinger;
data.inputId = _pointerID; data.inputId = _pointerID;
data.stateIsDown = _isDown; data.stateIsDown = _isDown;
@ -345,7 +345,7 @@ void ewol::eContext::OS_SetInputState(int _pointerID, bool _isDown, const vec2&
void ewol::eContext::OS_SetMouseMotion(int _pointerID, const vec2& _pos ) { void ewol::eContext::OS_SetMouseMotion(int _pointerID, const vec2& _pos ) {
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_INPUT_MOTION; data.TypeMessage = eSystemMessage::msgInputMotion;
data.inputType = ewol::keyEvent::typeMouse; data.inputType = ewol::keyEvent::typeMouse;
data.inputId = _pointerID; data.inputId = _pointerID;
data.dimention = _pos; data.dimention = _pos;
@ -354,7 +354,7 @@ void ewol::eContext::OS_SetMouseMotion(int _pointerID, const vec2& _pos ) {
void ewol::eContext::OS_SetMouseState(int _pointerID, bool _isDown, const vec2& _pos ) { void ewol::eContext::OS_SetMouseState(int _pointerID, bool _isDown, const vec2& _pos ) {
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_INPUT_STATE; data.TypeMessage = eSystemMessage::msgInputState;
data.inputType = ewol::keyEvent::typeMouse; data.inputType = ewol::keyEvent::typeMouse;
data.inputId = _pointerID; data.inputId = _pointerID;
data.stateIsDown = _isDown; data.stateIsDown = _isDown;
@ -367,7 +367,7 @@ void ewol::eContext::OS_SetKeyboard(ewol::SpecialKey& _special,
bool _isDown, bool _isDown,
bool _isARepeateKey) { bool _isARepeateKey) {
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_KEYBORAD_KEY; data.TypeMessage = eSystemMessage::msgKeyboardKey;
data.stateIsDown = _isDown; data.stateIsDown = _isDown;
data.keyboardChar = _myChar; data.keyboardChar = _myChar;
data.keyboardSpecial = _special; data.keyboardSpecial = _special;
@ -376,11 +376,11 @@ void ewol::eContext::OS_SetKeyboard(ewol::SpecialKey& _special,
} }
void ewol::eContext::OS_SetKeyboardMove(ewol::SpecialKey& _special, void ewol::eContext::OS_SetKeyboardMove(ewol::SpecialKey& _special,
ewol::keyEvent::keyboard_te _move, enum ewol::keyEvent::keyboard _move,
bool _isDown, bool _isDown,
bool _isARepeateKey) { bool _isARepeateKey) {
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_KEYBORAD_MOVE; data.TypeMessage = eSystemMessage::msgKeyboardMove;
data.stateIsDown = _isDown; data.stateIsDown = _isDown;
data.keyboardMove = _move; data.keyboardMove = _move;
data.keyboardSpecial = _special; data.keyboardSpecial = _special;
@ -390,20 +390,20 @@ void ewol::eContext::OS_SetKeyboardMove(ewol::SpecialKey& _special,
void ewol::eContext::OS_Hide(void) { void ewol::eContext::OS_Hide(void) {
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_HIDE; data.TypeMessage = eSystemMessage::msgHide;
m_msgSystem.post(data); m_msgSystem.post(data);
} }
void ewol::eContext::OS_Show(void) { void ewol::eContext::OS_Show(void) {
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_SHOW; data.TypeMessage = eSystemMessage::msgShow;
m_msgSystem.post(data); m_msgSystem.post(data);
} }
void ewol::eContext::OS_ClipBoardArrive(ewol::clipBoard::clipboardListe_te _clipboardID) { void ewol::eContext::OS_ClipBoardArrive(enum ewol::clipBoard::clipboardListe _clipboardID) {
eSystemMessage data; eSystemMessage data;
data.TypeMessage = THREAD_CLIPBOARD_ARRIVE; data.TypeMessage = eSystemMessage::msgClipboardArrive;
data.clipboardID = _clipboardID; data.clipboardID = _clipboardID;
m_msgSystem.post(data); m_msgSystem.post(data);
} }

View File

@ -23,33 +23,32 @@
#include <ewol/resources/ResourceManager.h> #include <ewol/resources/ResourceManager.h>
#include <ewol/commandLine.h> #include <ewol/commandLine.h>
// TODO : Remove this from here ...
// TODO : remove this from here ...
typedef enum {
THREAD_NONE,
THREAD_INIT,
THREAD_RECALCULATE_SIZE,
THREAD_RESIZE,
THREAD_HIDE,
THREAD_SHOW,
THREAD_INPUT_MOTION,
THREAD_INPUT_STATE,
THREAD_KEYBORAD_KEY,
THREAD_KEYBORAD_MOVE,
THREAD_CLIPBOARD_ARRIVE,
} theadMessage_te;
// TODO : remove this from here ...
class eSystemMessage { class eSystemMessage {
public:
enum theadMessage {
msgNone,
msgInit,
msgRecalculateSize,
msgResize,
msgHide,
msgShow,
msgInputMotion,
msgInputState,
msgKeyboardKey,
msgKeyboardMove,
msgClipboardArrive
};
public : public :
// specify the message type // specify the message type
theadMessage_te TypeMessage; enum theadMessage TypeMessage;
// can not set a union ... // can not set a union ...
ewol::clipBoard::clipboardListe_te clipboardID; enum ewol::clipBoard::clipboardListe clipboardID;
// InputId // InputId
ewol::keyEvent::type_te inputType; enum ewol::keyEvent::type inputType;
int32_t inputId; int32_t inputId;
// generic dimentions // generic dimentions
vec2 dimention; vec2 dimention;
@ -57,11 +56,11 @@ class eSystemMessage {
bool repeateKey; //!< special flag for the repeating key on the PC interface bool repeateKey; //!< special flag for the repeating key on the PC interface
bool stateIsDown; bool stateIsDown;
etk::UChar keyboardChar; etk::UChar keyboardChar;
ewol::keyEvent::keyboard_te keyboardMove; enum ewol::keyEvent::keyboard keyboardMove;
ewol::SpecialKey keyboardSpecial; ewol::SpecialKey keyboardSpecial;
eSystemMessage(void) : eSystemMessage(void) :
TypeMessage(THREAD_NONE), TypeMessage(msgNone),
clipboardID(ewol::clipBoard::clipboardStd), clipboardID(ewol::clipBoard::clipboardStd),
inputType(ewol::keyEvent::typeUnknow), inputType(ewol::keyEvent::typeUnknow),
inputId(-1), inputId(-1),
@ -76,33 +75,43 @@ class eSystemMessage {
}; };
namespace ewol { namespace ewol {
typedef enum { enum orientation{
SCREEN_ORIENTATION_AUTO = 0, screenAuto = 0,
SCREEN_ORIENTATION_LANDSCAPE, screenLandscape,
SCREEN_ORIENTATION_PORTRAIT, screenPortrait
} orientation_te; };
class eContext { class eContext {
private: private:
ewol::CommandLine m_commandLine; //!< Start command line information ewol::CommandLine m_commandLine; //!< Start command line information
public: public:
ewol::CommandLine& getCmd(void) { return m_commandLine; }; ewol::CommandLine& getCmd(void) {
return m_commandLine;
};
private: private:
ewol::ConfigFont m_configFont; //!< global font configuration ewol::ConfigFont m_configFont; //!< global font configuration
public: public:
ewol::ConfigFont& getFontDefault(void) { return m_configFont; }; ewol::ConfigFont& getFontDefault(void) {
return m_configFont;
};
private: private:
ewol::WidgetManager m_widgetManager; //!< global widget manager ewol::WidgetManager m_widgetManager; //!< global widget manager
public: public:
ewol::WidgetManager& getWidgetManager(void) { return m_widgetManager; }; ewol::WidgetManager& getWidgetManager(void) {
return m_widgetManager;
};
private: private:
ewol::EObjectManager m_EObjectManager; //!< eObject Manager main instance ewol::EObjectManager m_EObjectManager; //!< eObject Manager main instance
public: public:
ewol::EObjectManager& getEObjectManager(void) { return m_EObjectManager; }; ewol::EObjectManager& getEObjectManager(void) {
return m_EObjectManager;
};
private: private:
ewol::ResourceManager m_resourceManager; //!< global resources Manager ewol::ResourceManager m_resourceManager; //!< global resources Manager
public: public:
ewol::ResourceManager& getResourcesManager(void) { return m_resourceManager; }; ewol::ResourceManager& getResourcesManager(void) {
return m_resourceManager;
};
public: public:
eContext(int32_t _argc=0, const char* _argv[]=NULL); eContext(int32_t _argc=0, const char* _argv[]=NULL);
virtual ~eContext(void); virtual ~eContext(void);
@ -134,7 +143,6 @@ namespace ewol {
virtual void setArchiveDir(int _mode, const char* _str); virtual void setArchiveDir(int _mode, const char* _str);
virtual void OS_SetInputMotion(int _pointerID, const vec2& _pos); virtual void OS_SetInputMotion(int _pointerID, const vec2& _pos);
virtual void OS_SetInputState(int _pointerID, bool _isDown, const vec2& _pos); virtual void OS_SetInputState(int _pointerID, bool _isDown, const vec2& _pos);
@ -146,7 +154,7 @@ namespace ewol {
bool _isDown, bool _isDown,
bool _isARepeateKey=false); bool _isARepeateKey=false);
virtual void OS_SetKeyboardMove(ewol::SpecialKey& _special, virtual void OS_SetKeyboardMove(ewol::SpecialKey& _special,
ewol::keyEvent::keyboard_te _move, enum ewol::keyEvent::keyboard _move,
bool _isDown, bool _isDown,
bool _isARepeateKey=false); bool _isARepeateKey=false);
/** /**
@ -158,8 +166,6 @@ namespace ewol {
*/ */
virtual void OS_Resume(void); virtual void OS_Resume(void);
//virtual void OS_SetClipBoard(ewol::clipBoard::clipboardListe_te _clipboardID);
void requestUpdateSize(void); void requestUpdateSize(void);
// return true if a flush is needed // return true if a flush is needed
@ -169,7 +175,7 @@ namespace ewol {
* @param[in] removeObject Pointer on the EObject removed == > the user must remove all reference on this EObject * @param[in] removeObject Pointer on the EObject removed == > the user must remove all reference on this EObject
* @note : Sub classes must call this class * @note : Sub classes must call this class
*/ */
void onObjectRemove(ewol::EObject * removeObject); void onObjectRemove(ewol::EObject* _removeObject);
/** /**
* @brief reset event management for the IO like Input ou Mouse or keyborad * @brief reset event management for the IO like Input ou Mouse or keyborad
*/ */
@ -282,17 +288,17 @@ namespace ewol {
* @brief Inform the Gui that we want to have a copy of the clipboard * @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 * @param[in] _clipboardID ID of the clipboard (STD/SELECTION) only apear here
*/ */
virtual void clipBoardGet(ewol::clipBoard::clipboardListe_te _clipboardID) { }; virtual void clipBoardGet(enum ewol::clipBoard::clipboardListe _clipboardID) { };
/** /**
* @brief Inform the Gui that we are the new owner of the clipboard * @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 * @param[in] _clipboardID ID of the clipboard (STD/SELECTION) only apear here
*/ */
virtual void clipBoardSet(ewol::clipBoard::clipboardListe_te _clipboardID) { }; virtual void clipBoardSet(enum ewol::clipBoard::clipboardListe _clipboardID) { };
/** /**
* @brief Call by the OS when a clipboard arrive to US (previously requested by a widget) * @brief Call by the OS when a clipboard arrive to US (previously requested by a widget)
* @param[in] Id of the clipboard * @param[in] Id of the clipboard
*/ */
void OS_ClipBoardArrive(ewol::clipBoard::clipboardListe_te _clipboardID); void OS_ClipBoardArrive(enum ewol::clipBoard::clipboardListe _clipboardID);
/** /**
* @brief set the new title of the windows * @brief set the new title of the windows
* @param[in] title New desired title * @param[in] title New desired title
@ -302,7 +308,7 @@ namespace ewol {
* @brief force the screen orientation (availlable on portable elements ... * @brief force the screen orientation (availlable on portable elements ...
* @param[in] _orientation Selected orientation. * @param[in] _orientation Selected orientation.
*/ */
virtual void forceOrientation(ewol::orientation_te _orientation) { }; virtual void forceOrientation(enum ewol::orientation _orientation) { };
/** /**
* @brief get all the event from the X system * @brief get all the event from the X system
* @param[in] _isGrabbed "true" if all the event will be get, false if we want only ours. * @param[in] _isGrabbed "true" if all the event will be get, false if we want only ours.
@ -313,7 +319,7 @@ namespace ewol {
* @brief set the cursor display type. * @brief set the cursor display type.
* @param[in] _newCursor selected new cursor. * @param[in] _newCursor selected new cursor.
*/ */
virtual void setCursor(ewol::cursorDisplay_te _newCursor) { }; virtual void setCursor(enum ewol::cursorDisplay _newCursor) { };
/** /**
* @brief set the Icon of the program * @brief set the Icon of the program
* @param[in] _inputFile new filename icon of the curent program. * @param[in] _inputFile new filename icon of the curent program.

View File

@ -41,10 +41,10 @@ void ewol::eInput::setDpi(int32_t newDPI) {
calculateLimit(); calculateLimit();
} }
bool ewol::eInput::localEventInput(ewol::keyEvent::type_te _type, bool ewol::eInput::localEventInput(enum ewol::keyEvent::type _type,
ewol::Widget* _destWidget, ewol::Widget* _destWidget,
int32_t _IdInput, int32_t _IdInput,
ewol::keyEvent::status_te _status, enum ewol::keyEvent::status _status,
vec2 _pos) { vec2 _pos) {
if (NULL != _destWidget) { if (NULL != _destWidget) {
if (_type == ewol::keyEvent::typeMouse || _type == ewol::keyEvent::typeFinger) { if (_type == ewol::keyEvent::typeMouse || _type == ewol::keyEvent::typeFinger) {
@ -61,7 +61,7 @@ bool ewol::eInput::localEventInput(ewol::keyEvent::type_te _type,
void ewol::eInput::abortElement(InputPoperty_ts *_eventTable, void ewol::eInput::abortElement(InputPoperty_ts *_eventTable,
int32_t _idInput, int32_t _idInput,
ewol::keyEvent::type_te _type) { enum ewol::keyEvent::type _type) {
if (NULL == _eventTable) { if (NULL == _eventTable) {
return; return;
} }
@ -179,7 +179,7 @@ ewol::eInput::~eInput(void) {
EWOL_INFO("Un-Init (end)"); EWOL_INFO("Un-Init (end)");
} }
int32_t ewol::eInput::localGetDestinationId(ewol::keyEvent::type_te _type, int32_t ewol::eInput::localGetDestinationId(enum ewol::keyEvent::type _type,
ewol::Widget* _destWidget, ewol::Widget* _destWidget,
int32_t _realInputId) { int32_t _realInputId) {
if (_type == ewol::keyEvent::typeFinger) { if (_type == ewol::keyEvent::typeFinger) {
@ -199,7 +199,7 @@ int32_t ewol::eInput::localGetDestinationId(ewol::keyEvent::type_te _type,
} }
// note if id<0 == > the it was finger event ... // note if id<0 == > the it was finger event ...
void ewol::eInput::motion(ewol::keyEvent::type_te _type, void ewol::eInput::motion(enum ewol::keyEvent::type _type,
int _pointerID, int _pointerID,
vec2 _pos) { vec2 _pos) {
EVENT_DEBUG("motion event : " << _type << " " << _pointerID << " " << _pos); EVENT_DEBUG("motion event : " << _type << " " << _pointerID << " " << _pos);
@ -328,7 +328,7 @@ void ewol::eInput::motion(ewol::keyEvent::type_te _type,
} }
} }
void ewol::eInput::state(ewol::keyEvent::type_te _type, void ewol::eInput::state(enum ewol::keyEvent::type _type,
int _pointerID, int _pointerID,
bool _isDown, bool _isDown,
vec2 _pos) vec2 _pos)
@ -472,7 +472,7 @@ void ewol::eInput::state(ewol::keyEvent::type_te _type,
localEventInput(_type, localEventInput(_type,
eventTable[_pointerID].curentWidgetEvent, eventTable[_pointerID].curentWidgetEvent,
eventTable[_pointerID].destinationInputId, eventTable[_pointerID].destinationInputId,
(ewol::keyEvent::status_te)(ewol::keyEvent::statusSingle + eventTable[_pointerID].nbClickEvent-1), (enum ewol::keyEvent::status)(ewol::keyEvent::statusSingle + eventTable[_pointerID].nbClickEvent-1),
_pos); _pos);
if( eventTable[_pointerID].nbClickEvent >= nbClickMax) { if( eventTable[_pointerID].nbClickEvent >= nbClickMax) {
eventTable[_pointerID].nbClickEvent = 0; eventTable[_pointerID].nbClickEvent = 0;

View File

@ -45,33 +45,34 @@ namespace ewol {
void calculateLimit(void); void calculateLimit(void);
InputPoperty_ts m_eventInputSaved[MAX_MANAGE_INPUT]; InputPoperty_ts m_eventInputSaved[MAX_MANAGE_INPUT];
InputPoperty_ts m_eventMouseSaved[MAX_MANAGE_INPUT]; InputPoperty_ts m_eventMouseSaved[MAX_MANAGE_INPUT];
void abortElement(InputPoperty_ts *eventTable, int32_t idInput, ewol::keyEvent::type_te _type); void abortElement(InputPoperty_ts* _eventTable, int32_t _idInput, enum ewol::keyEvent::type _type);
void cleanElement(InputPoperty_ts *eventTable, int32_t idInput); void cleanElement(InputPoperty_ts* _eventTable, int32_t _idInput);
/** /**
* @brief generate the event on the destinated widget. * @brief generate the event on the destinated widget.
* @param[in] type Type of the event that might be sended. * @param[in] _type Type of the event that might be sended.
* @param[in] destWidget Pointer on the requested widget that element might be sended * @param[in] _destWidget Pointer on the requested widget that element might be sended
* @param[in] IdInput Id of the event (PC : [0..9] and touch : [1..9]) * @param[in] _IdInput Id of the event (PC : [0..9] and touch : [1..9])
* @param[in] typeEvent type of the eventg generated * @param[in] _typeEvent type of the eventg generated
* @param[in] pos position of the event * @param[in] _pos position of the event
* @return true if event has been greped * @return true if event has been greped
*/ */
bool localEventInput(ewol::keyEvent::type_te type, bool localEventInput(enum ewol::keyEvent::type _type,
ewol::Widget* destWidget, ewol::Widget* _destWidget,
int32_t IdInput, int32_t _IdInput,
ewol::keyEvent::status_te typeEvent, enum ewol::keyEvent::status _typeEvent,
vec2 pos); vec2 _pos);
/** /**
* @brief convert the system event id in the correct EWOL id depending of the system management mode * @brief convert the system event id in the correct EWOL id depending of the system management mode
* This function find the next input id unused on the specifiic widget * This function find the next input id unused on the specifiic widget
* == > on PC, the ID does not change (GUI is not the same) * == > on PC, the ID does not change (GUI is not the same)
* @param[in] destWidget Pointer of the widget destination * @param[in] _type Type of the kay event.
* @param[in] realInputId system Id * @param[in] _destWidget Pointer of the widget destination
* @param[in] _realInputId system Id
* @return the ewol input id * @return the ewol input id
*/ */
int32_t localGetDestinationId(ewol::keyEvent::type_te type, int32_t localGetDestinationId(enum ewol::keyEvent::type _type,
ewol::Widget* destWidget, ewol::Widget* _destWidget,
int32_t realInputId); int32_t _realInputId);
private: private:
ewol::eContext& m_context; ewol::eContext& m_context;
public: public:
@ -80,34 +81,30 @@ namespace ewol {
void setDpi(int32_t newDPI); void setDpi(int32_t newDPI);
// note if id<0 == > the it was finger event ... // note if id<0 == > the it was finger event ...
void motion(ewol::keyEvent::type_te type, int pointerID, vec2 pos ); void motion(enum ewol::keyEvent::type _type, int _pointerID, vec2 _pos );
void state(ewol::keyEvent::type_te type, int pointerID, bool isDown, vec2 pos); void state(enum ewol::keyEvent::type _type, int _pointerID, bool _isDown, vec2 _pos);
/** /**
* @brief Inform object that an other object is removed ... * @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 EObject remeved == > the user must remove all reference on this EObject
* @note : Sub classes must call this class * @note : Sub classes must call this class
* @return ---
*/ */
void onObjectRemove(ewol::EObject * removeObject); void onObjectRemove(ewol::EObject* _removeObject);
/** /**
* @brief a new layer on the windows is set == > might remove all the property of the current element ... * @brief a new layer on the windows is set == > might remove all the property of the current element ...
* @param ---
* @return ---
*/ */
void newLayerSet(void); void newLayerSet(void);
/** /**
* @brief This is to transfert the event from one widget to another one * @brief This is to transfert the event from one widget to another one
* @param source the widget where the event came from * @param _source the widget where the event came from
* @param destination the widget where the event mitgh be generated now * @param _destination the widget where the event mitgh be generated now
* @return ---
*/ */
void transfertEvent(ewol::Widget* source, ewol::Widget* destination); void transfertEvent(ewol::Widget* _source, ewol::Widget* _destination);
/** /**
* @brief This fonction lock the pointer properties to move in relative instead of absolute * @brief This fonction lock the pointer properties to move in relative instead of absolute
* @param[in] widget The widget that lock the pointer events * @param[in] _widget The widget that lock the pointer events
*/ */
void grabPointer(ewol::Widget* widget); void grabPointer(ewol::Widget* _widget);
/** /**
* @brief This fonction un-lock the pointer properties to move in relative instead of absolute * @brief This fonction un-lock the pointer properties to move in relative instead of absolute
*/ */

View File

@ -182,7 +182,7 @@ static correspondenceTable_ts basicFlag[] = {
static int32_t basicFlagCount = sizeof(basicFlag) / sizeof(correspondenceTable_ts); static int32_t basicFlagCount = sizeof(basicFlag) / sizeof(correspondenceTable_ts);
void ewol::openGL::enable(ewol::openGL::openGlFlags_te _flagID) { void ewol::openGL::enable(enum ewol::openGL::openGlFlags _flagID) {
#ifdef DIRECT_MODE #ifdef DIRECT_MODE
for (int32_t iii=0; iii<basicFlagCount ; iii++) { for (int32_t iii=0; iii<basicFlagCount ; iii++) {
if ( basicFlag[iii].curentFlag == (uint32_t)_flagID ) { if ( basicFlag[iii].curentFlag == (uint32_t)_flagID ) {
@ -196,7 +196,7 @@ void ewol::openGL::enable(ewol::openGL::openGlFlags_te _flagID) {
#endif #endif
} }
void ewol::openGL::disable(ewol::openGL::openGlFlags_te _flagID) { void ewol::openGL::disable(enum ewol::openGL::openGlFlags _flagID) {
#ifdef DIRECT_MODE #ifdef DIRECT_MODE
for (int32_t iii=0; iii<basicFlagCount ; iii++) { for (int32_t iii=0; iii<basicFlagCount ; iii++) {
if ( basicFlag[iii].curentFlag == (uint32_t)_flagID ) { if ( basicFlag[iii].curentFlag == (uint32_t)_flagID ) {

View File

@ -110,7 +110,7 @@ namespace ewol {
*/ */
void swap(void); void swap(void);
typedef enum { enum openGlFlags {
FLAG_BLEND = 1<<0, //!< If enabled, blend the computed fragment color values with the values in the color buffers. See glBlendFunc. FLAG_BLEND = 1<<0, //!< If enabled, blend the computed fragment color values with the values in the color buffers. See glBlendFunc.
FLAG_CLIP_DISTANCE_I = 1<<1, //!< If enabled, clip geometry against user-defined half space i. FLAG_CLIP_DISTANCE_I = 1<<1, //!< If enabled, clip geometry against user-defined half space i.
FLAG_COLOR_LOGIC_OP = 1<<2, //!< If enabled, apply the currently selected logical operation to the computed fragment color and color buffer values. See glLogicOp. FLAG_COLOR_LOGIC_OP = 1<<2, //!< If enabled, apply the currently selected logical operation to the computed fragment color and color buffer values. See glLogicOp.
@ -140,18 +140,18 @@ namespace ewol {
FLAG_TEXTURE_2D = 1<<26, //!< FLAG_TEXTURE_2D = 1<<26, //!<
FLAG_ALPHA_TEST = 1<<27, //!< FLAG_ALPHA_TEST = 1<<27, //!<
FLAG_FOG = 1<<28, //!< FLAG_FOG = 1<<28, //!<
} openGlFlags_te; };
/** /**
* @brief enable a flag on the system * @brief enable a flag on the system
* @param[in] flagID The flag requested * @param[in] flagID The flag requested
*/ */
void enable(openGlFlags_te _flagID); void enable(enum openGlFlags _flagID);
/** /**
* @brief disable a flag on the system * @brief disable a flag on the system
* @param[in] flagID The flag requested * @param[in] flagID The flag requested
*/ */
void disable(openGlFlags_te _flagID); void disable(enum openGlFlags _flagID);
/** /**
* @brieg update all the internal flag needed to be set from tre previous element set ... * @brieg update all the internal flag needed to be set from tre previous element set ...
*/ */

View File

@ -607,7 +607,7 @@ void removeEndLine(char* _val) {
} }
} }
typedef enum { enum emfModuleMode {
EMFModuleNone, EMFModuleNone,
EMFModuleMesh, EMFModuleMesh,
EMFModuleMeshNamed, EMFModuleMeshNamed,
@ -623,7 +623,7 @@ typedef enum {
EMFModuleMaterial, EMFModuleMaterial,
EMFModuleMaterialNamed, EMFModuleMaterialNamed,
EMFModuleMaterial_END, EMFModuleMaterial_END,
} emfModuleMode_te; };
bool ewol::Mesh::loadEMF(const etk::UString& _fileName) { bool ewol::Mesh::loadEMF(const etk::UString& _fileName) {
m_checkNormal = true; m_checkNormal = true;
@ -651,7 +651,7 @@ bool ewol::Mesh::loadEMF(const etk::UString& _fileName) {
EWOL_ERROR(" file mode is not supported now : 'EMF(? ? ?)' = '" << inputDataLine << "'"); EWOL_ERROR(" file mode is not supported now : 'EMF(? ? ?)' = '" << inputDataLine << "'");
return false; return false;
} }
emfModuleMode_te currentMode = EMFModuleNone; enum emfModuleMode currentMode = EMFModuleNone;
EWOL_VERBOSE("Start parsing Mesh file : " << fileName); EWOL_VERBOSE("Start parsing Mesh file : " << fileName);
// mesh global param : // mesh global param :
etk::UString currentMeshName = ""; etk::UString currentMeshName = "";

View File

@ -72,13 +72,13 @@ namespace ewol {
}; };
class Mesh : public ewol::Resource { class Mesh : public ewol::Resource {
public: public:
typedef enum { enum normalMode {
normalModeNone, normalModeNone,
normalModeFace, normalModeFace,
normalModeVertex, normalModeVertex,
} normalMode_te; };
protected: protected:
normalMode_te m_normalMode; // select the normal mode of display enum normalMode m_normalMode; // select the normal mode of display
bool m_checkNormal; //!< when enable, this check the normal of the mesh before sending it at the 3d card bool m_checkNormal; //!< when enable, this check the normal of the mesh before sending it at the 3d card
protected: protected:
ewol::Program* m_GLprogram; ewol::Program* m_GLprogram;

View File

@ -18,7 +18,7 @@
#include <ewol/resources/FontFreeType.h> #include <ewol/resources/FontFreeType.h>
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::font::mode_te& _obj) { etk::CCout& ewol::operator <<(etk::CCout& _os, enum ewol::font::mode _obj) {
switch(_obj) { switch(_obj) {
default : default :
_os << "error"; _os << "error";
@ -162,10 +162,10 @@ ewol::TexturedFont::TexturedFont(const etk::UString& _fontName) :
} }
} }
// try to find the reference mode : // try to find the reference mode :
ewol::font::mode_te refMode = ewol::font::Regular; enum ewol::font::mode refMode = ewol::font::Regular;
for(int32_t iii=3; iii >= 0; iii--) { for(int32_t iii=3; iii >= 0; iii--) {
if (m_fileName[iii].isEmpty() == false) { if (m_fileName[iii].isEmpty() == false) {
refMode = (ewol::font::mode_te)iii; refMode = (enum ewol::font::mode)iii;
} }
} }
@ -173,7 +173,7 @@ ewol::TexturedFont::TexturedFont(const etk::UString& _fontName) :
// generate the wrapping on the preventing error // generate the wrapping on the preventing error
for(int32_t iii=3; iii >= 0; iii--) { for(int32_t iii=3; iii >= 0; iii--) {
if (m_fileName[iii].isEmpty() == false) { if (m_fileName[iii].isEmpty() == false) {
m_modeWraping[iii] = (ewol::font::mode_te)iii; m_modeWraping[iii] = (enum ewol::font::mode)iii;
} else { } else {
m_modeWraping[iii] = refMode; m_modeWraping[iii] = refMode;
} }
@ -297,7 +297,7 @@ bool ewol::TexturedFont::addGlyph(const etk::UChar& _val) {
return hasChange; return hasChange;
} }
int32_t ewol::TexturedFont::getIndex(const etk::UChar& _charcode, const ewol::font::mode_te _displayMode) { int32_t ewol::TexturedFont::getIndex(const etk::UChar& _charcode, const enum ewol::font::mode _displayMode) {
if (_charcode.get() < 0x20) { if (_charcode.get() < 0x20) {
return 0; return 0;
} else if (_charcode.get() < 0x80) { } else if (_charcode.get() < 0x80) {
@ -323,7 +323,7 @@ int32_t ewol::TexturedFont::getIndex(const etk::UChar& _charcode, const ewol::fo
return 0; return 0;
} }
ewol::GlyphProperty* ewol::TexturedFont::getGlyphPointer(const etk::UChar& _charcode, const ewol::font::mode_te _displayMode) { ewol::GlyphProperty* ewol::TexturedFont::getGlyphPointer(const etk::UChar& _charcode, const enum ewol::font::mode _displayMode) {
//EWOL_DEBUG("Get glyph property for mode: " << _displayMode << " == > wrapping index : " << m_modeWraping[_displayMode]); //EWOL_DEBUG("Get glyph property for mode: " << _displayMode << " == > wrapping index : " << m_modeWraping[_displayMode]);
int32_t index = getIndex(_charcode, _displayMode); int32_t index = getIndex(_charcode, _displayMode);
if( index < 0 if( index < 0

View File

@ -15,14 +15,14 @@
namespace ewol { namespace ewol {
namespace font { namespace font {
typedef enum { enum mode {
Regular=0, Regular=0,
Italic, Italic,
Bold, Bold,
BoldItalic, BoldItalic,
} mode_te;
}; };
etk::CCout& operator <<(etk::CCout& _os, const ewol::font::mode_te& _obj); };
etk::CCout& operator <<(etk::CCout& _os, enum ewol::font::mode _obj);
class TexturedFont : public ewol::Texture { class TexturedFont : public ewol::Texture {
private: private:
@ -33,7 +33,7 @@ namespace ewol {
// == > otherwise I can just generate italic ... // == > otherwise I can just generate italic ...
// == > Bold is a little more complicated (maybe with the bordersize) // == > Bold is a little more complicated (maybe with the bordersize)
ewol::FontBase* m_font[4]; ewol::FontBase* m_font[4];
ewol::font::mode_te m_modeWraping[4]; //!< This is a wrapping mode to prevent the fact that no font is define for a specific mode enum ewol::font::mode m_modeWraping[4]; //!< This is a wrapping mode to prevent the fact that no font is define for a specific mode
public: public:
etk::Vector<GlyphProperty> m_listElement[4]; etk::Vector<GlyphProperty> m_listElement[4];
private: private:
@ -52,7 +52,7 @@ namespace ewol {
* @param[in] _displayMode Mode to display the currrent font * @param[in] _displayMode Mode to display the currrent font
* @return Dimention of the font need between 2 lines * @return Dimention of the font need between 2 lines
*/ */
int32_t getHeight(const ewol::font::mode_te _displayMode = ewol::font::Regular) { int32_t getHeight(const enum ewol::font::mode _displayMode = ewol::font::Regular) {
return m_height[_displayMode]; return m_height[_displayMode];
}; };
/** /**
@ -68,21 +68,21 @@ namespace ewol {
* @param[in] _displayMode Mode to display the currrent font * @param[in] _displayMode Mode to display the currrent font
* @return The ID in the table (if it does not exist : return 0) * @return The ID in the table (if it does not exist : return 0)
*/ */
int32_t getIndex(const etk::UChar& _charcode, const ewol::font::mode_te _displayMode); int32_t getIndex(const etk::UChar& _charcode, const enum ewol::font::mode _displayMode);
/** /**
* @brief get the pointer on the coresponding glyph * @brief get the pointer on the coresponding glyph
* @param[in] _charcode The unicodeValue * @param[in] _charcode The unicodeValue
* @param[in] _displayMode Mode to display the currrent font * @param[in] _displayMode Mode to display the currrent font
* @return The pointer on the glyph == > never NULL * @return The pointer on the glyph == > never NULL
*/ */
ewol::GlyphProperty* getGlyphPointer(const etk::UChar& _charcode, const ewol::font::mode_te _displayMode); ewol::GlyphProperty* getGlyphPointer(const etk::UChar& _charcode, const enum ewol::font::mode _displayMode);
/** /**
* @brief The wrapping mode is used to prevent the non existance of a specific mode. * @brief The wrapping mode is used to prevent the non existance of a specific mode.
* For exemple when a blod mode does not exist, this resend a regular mode. * For exemple when a blod mode does not exist, this resend a regular mode.
* @param[in] _source The requested mode. * @param[in] _source The requested mode.
* @return the best mode we have in stock. * @return the best mode we have in stock.
*/ */
ewol::font::mode_te getWrappingMode(ewol::font::mode_te _source) { enum ewol::font::mode getWrappingMode(const enum ewol::font::mode _source) {
return m_modeWraping[_source]; return m_modeWraping[_source];
}; };
public: public:

View File

@ -235,7 +235,7 @@ void widget::Button::onRegenerateDisplay(void) {
} }
} }
void widget::Button::setLock(buttonLock_te _lock) { void widget::Button::setLock(enum buttonLock _lock) {
if (m_lock != _lock) { if (m_lock != _lock) {
m_lock = _lock; m_lock = _lock;
if(widget::Button::lockAccess == _lock) { if(widget::Button::lockAccess == _lock) {
@ -463,7 +463,7 @@ bool widget::Button::onSetConfig(const ewol::EConfig& _conf) {
return true; return true;
} }
if (_conf.getConfig() == configLock) { if (_conf.getConfig() == configLock) {
buttonLock_te tmpLock = lockNone; enum buttonLock tmpLock = lockNone;
if( true == _conf.getData().compareNoCase("true") if( true == _conf.getData().compareNoCase("true")
|| true == _conf.getData().compareNoCase("1")) { || true == _conf.getData().compareNoCase("1")) {
tmpLock = lockAccess; tmpLock = lockAccess;

View File

@ -39,12 +39,12 @@ namespace widget {
static const char* const configLock; static const char* const configLock;
static const char* const configValue; static const char* const configValue;
static const char* const configShaper; static const char* const configShaper;
typedef enum { enum buttonLock{
lockNone, //!< normal status of the button lockNone, //!< normal status of the button
lockWhenPressed, //!< When the state is set in pressed, the status stay in this one lockWhenPressed, //!< When the state is set in pressed, the status stay in this one
lockWhenReleased, //!< When the state is set in not pressed, the status stay in this one lockWhenReleased, //!< When the state is set in not pressed, the status stay in this one
lockAccess, //!< all event are trashed == > acctivity of the button is disable lockAccess, //!< all event are trashed == > acctivity of the button is disable
} buttonLock_te; };
private: private:
ewol::Shaper m_shaper; //!< Compositing theme. ewol::Shaper m_shaper; //!< Compositing theme.
public: public:
@ -107,18 +107,18 @@ namespace widget {
return m_value; return m_value;
}; };
protected: protected:
buttonLock_te m_lock; //!< Current lock state of the button. enum buttonLock m_lock; //!< Current lock state of the button.
public: public:
/** /**
* @brief set the button lock state. * @brief set the button lock state.
* @param[in] _lock New lock mode of the button * @param[in] _lock New lock mode of the button
*/ */
void setLock(buttonLock_te _lock); void setLock(enum buttonLock _lock);
/** /**
* @brief get the current button lock value. * @brief get the current button lock value.
* @return The requested lock mode * @return The requested lock mode
*/ */
buttonLock_te getLock(void) const { enum buttonLock getLock(void) const {
return m_lock; return m_lock;
}; };
protected: protected:

View File

@ -181,7 +181,7 @@ bool widget::ButtonColor::onEventInput(const ewol::EventInput& _event) {
} }
vec2 tmpPos = m_origin + m_selectableAreaPos + m_selectableAreaSize; vec2 tmpPos = m_origin + m_selectableAreaPos + m_selectableAreaSize;
tmpPos.setX( tmpPos.x() - m_minSize.x()/2.0); tmpPos.setX( tmpPos.x() - m_minSize.x()/2.0);
m_widgetContextMenu->setPositionMark(widget::CONTEXT_MENU_MARK_BOTTOM, tmpPos ); m_widgetContextMenu->setPositionMark(widget::ContextMenu::markButtom, tmpPos );
widget::ColorChooser * myColorChooser = new widget::ColorChooser(); widget::ColorChooser * myColorChooser = new widget::ColorChooser();
myColorChooser->setColor(m_textColorFg); myColorChooser->setColor(m_textColorFg);

View File

@ -19,16 +19,16 @@ widget::Composer::Composer(void) {
// nothing to do ... // nothing to do ...
} }
widget::Composer::Composer(widget::Composer::composerMode_te mode, const etk::UString& fileName) { widget::Composer::Composer(enum composerMode _mode, const etk::UString& _fileName) {
switch(mode) { switch(_mode) {
case widget::Composer::None: case widget::Composer::None:
// nothing to do ... // nothing to do ...
break; break;
case widget::Composer::String: case widget::Composer::String:
loadFromString(fileName); loadFromString(_fileName);
break; break;
case widget::Composer::file: case widget::Composer::file:
loadFromFile(fileName); loadFromFile(_fileName);
break; break;
} }
} }

View File

@ -22,11 +22,11 @@ namespace widget
class Composer : public widget::Container class Composer : public widget::Container
{ {
public: public:
typedef enum { enum composerMode {
None, None,
String, String,
file file
} composerMode_te; };
public: public:
/** /**
* @brief Constructor * @brief Constructor
@ -34,24 +34,24 @@ namespace widget
Composer(void); Composer(void);
/** /**
* @brief Constructor * @brief Constructor
* @param[in] mode mode of parsing the string * @param[in] _mode mode of parsing the string
* @param[in] data file/directString data to generate compositing of the widget.. * @param[in] _data file/directString data to generate compositing of the widget..
*/ */
Composer(composerMode_te _mode, const etk::UString& _data); Composer(enum composerMode _mode, const etk::UString& _data);
/** /**
* @brief Destructor * @brief Destructor
*/ */
~Composer(void); ~Composer(void);
/** /**
* @brief load a composition with a file * @brief load a composition with a file
* @param[in] fileName Name of the file * @param[in] _fileName Name of the file
* @return true == > all done OK * @return true == > all done OK
* @return false == > some error occured * @return false == > some error occured
*/ */
bool loadFromFile(const etk::UString& _fileName); bool loadFromFile(const etk::UString& _fileName);
/** /**
* @brief load a composition with a file * @brief load a composition with a file
* @param[in] composerXmlString xml to parse directly * @param[in] _composerXmlString xml to parse directly
* @return true == > all done OK * @return true == > all done OK
* @return false == > some error occured * @return false == > some error occured
*/ */

View File

@ -47,7 +47,7 @@ widget::ContextMenu::ContextMenu(const etk::UString& _shaperName) :
m_colorBorder.setA(0x7F); m_colorBorder.setA(0x7F);
m_arrowPos.setValue(0,0); m_arrowPos.setValue(0,0);
m_arrawBorder = widget::CONTEXT_MENU_MARK_TOP; m_arrawBorder = markTop;
setMouseLimit(1); setMouseLimit(1);
} }
@ -85,16 +85,16 @@ void widget::ContextMenu::calculateSize(const vec2& _availlable) {
// set config to the Sub-widget // set config to the Sub-widget
switch (m_arrawBorder) { switch (m_arrawBorder) {
case widget::CONTEXT_MENU_MARK_TOP: case markTop:
subWidgetOrigin.setX((int32_t)(m_arrowPos.x() - subWidgetSize.x()/2)); subWidgetOrigin.setX((int32_t)(m_arrowPos.x() - subWidgetSize.x()/2));
subWidgetOrigin.setY((int32_t)(m_arrowPos.y() - m_offset - subWidgetSize.y())); subWidgetOrigin.setY((int32_t)(m_arrowPos.y() - m_offset - subWidgetSize.y()));
break; break;
case widget::CONTEXT_MENU_MARK_BOTTOM: case markButtom:
subWidgetOrigin.setX((int32_t)(m_arrowPos.x() - subWidgetSize.x()/2)); subWidgetOrigin.setX((int32_t)(m_arrowPos.x() - subWidgetSize.x()/2));
subWidgetOrigin.setY((int32_t)(m_arrowPos.y() + m_offset)); subWidgetOrigin.setY((int32_t)(m_arrowPos.y() + m_offset));
break; break;
case widget::CONTEXT_MENU_MARK_RIGHT: case markRight:
case widget::CONTEXT_MENU_MARK_LEFT: case markLeft:
default: default:
subWidgetOrigin.setX((int32_t)(m_size.x() - m_origin.x() - subWidgetSize.x())/2 + m_origin.x()); subWidgetOrigin.setX((int32_t)(m_size.x() - m_origin.x() - subWidgetSize.x())/2 + m_origin.x());
subWidgetOrigin.setY((int32_t)(m_size.y() - m_origin.y() - subWidgetSize.y())/2 + m_origin.y()); subWidgetOrigin.setY((int32_t)(m_size.y() - m_origin.y() - subWidgetSize.y())/2 + m_origin.y());
@ -108,14 +108,14 @@ void widget::ContextMenu::calculateSize(const vec2& _availlable) {
switch (m_arrawBorder) switch (m_arrawBorder)
{ {
default: default:
case widget::CONTEXT_MENU_MARK_TOP: case markTop:
case widget::CONTEXT_MENU_MARK_BOTTOM: case markButtom:
if (m_arrowPos.x() <= m_offset ) { if (m_arrowPos.x() <= m_offset ) {
subWidgetOrigin.setX(m_arrowPos.x()+padding.x()); subWidgetOrigin.setX(m_arrowPos.x()+padding.x());
} }
break; break;
case widget::CONTEXT_MENU_MARK_RIGHT: case markRight:
case widget::CONTEXT_MENU_MARK_LEFT: case markLeft:
if (m_arrowPos.y() <= m_offset ) { if (m_arrowPos.y() <= m_offset ) {
subWidgetOrigin.setY(m_arrowPos.y()+padding.y()); subWidgetOrigin.setY(m_arrowPos.y()+padding.y());
} }
@ -160,7 +160,7 @@ void widget::ContextMenu::onRegenerateDisplay(void) {
// display border ... // display border ...
m_compositing.setColor(m_colorBorder); m_compositing.setColor(m_colorBorder);
switch (m_arrawBorder) { switch (m_arrawBorder) {
case widget::CONTEXT_MENU_MARK_TOP: case markTop:
m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y(), 0.0f) ); m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y(), 0.0f) );
m_compositing.addVertex(); m_compositing.addVertex();
if (m_arrowPos.x() <= tmpOrigin.x() ) { if (m_arrowPos.x() <= tmpOrigin.x() ) {
@ -177,7 +177,7 @@ void widget::ContextMenu::onRegenerateDisplay(void) {
m_compositing.addVertex(); m_compositing.addVertex();
} }
break; break;
case widget::CONTEXT_MENU_MARK_BOTTOM: case markButtom:
m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y(), 0) ); m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y(), 0) );
m_compositing.addVertex(); m_compositing.addVertex();
if (m_arrowPos.x() <= tmpOrigin.x() ) { if (m_arrowPos.x() <= tmpOrigin.x() ) {
@ -195,8 +195,8 @@ void widget::ContextMenu::onRegenerateDisplay(void) {
} }
break; break;
default: default:
case widget::CONTEXT_MENU_MARK_RIGHT: case markRight:
case widget::CONTEXT_MENU_MARK_LEFT: case markLeft:
EWOL_TODO("later"); EWOL_TODO("later");
break; break;
} }
@ -231,7 +231,7 @@ bool widget::ContextMenu::onEventInput(const ewol::EventInput& _event) {
} }
void widget::ContextMenu::setPositionMark(markPosition_te _position, vec2 _arrowPos) { void widget::ContextMenu::setPositionMark(enum markPosition _position, vec2 _arrowPos) {
EWOL_DEBUG("set context menu at the position : " << _arrowPos); EWOL_DEBUG("set context menu at the position : " << _arrowPos);
m_arrawBorder = _position; m_arrawBorder = _position;
m_arrowPos = _arrowPos; m_arrowPos = _arrowPos;
@ -257,15 +257,15 @@ bool widget::ContextMenu::onSetConfig(const ewol::EConfig& _conf) {
} }
if (_conf.getConfig() == configArrowMode) { if (_conf.getConfig() == configArrowMode) {
if(true == _conf.getData().compareNoCase("top")) { if(true == _conf.getData().compareNoCase("top")) {
m_arrawBorder = CONTEXT_MENU_MARK_TOP; m_arrawBorder = markTop;
} else if(true == _conf.getData().compareNoCase("right")) { } else if(true == _conf.getData().compareNoCase("right")) {
m_arrawBorder = CONTEXT_MENU_MARK_RIGHT; m_arrawBorder = markRight;
} else if(true == _conf.getData().compareNoCase("buttom")) { } else if(true == _conf.getData().compareNoCase("buttom")) {
m_arrawBorder = CONTEXT_MENU_MARK_BOTTOM; m_arrawBorder = markButtom;
} else if(true == _conf.getData().compareNoCase("left")) { } else if(true == _conf.getData().compareNoCase("left")) {
m_arrawBorder = CONTEXT_MENU_MARK_LEFT; m_arrawBorder = markLeft;
} else { } else {
m_arrawBorder = CONTEXT_MENU_MARK_NONE; m_arrawBorder = markNone;
} }
return true; return true;
} }
@ -286,20 +286,20 @@ bool widget::ContextMenu::onGetConfig(const char* _config, etk::UString& _result
} }
if (_config == configArrowMode) { if (_config == configArrowMode) {
switch(m_arrawBorder) { switch(m_arrawBorder) {
case CONTEXT_MENU_MARK_TOP: case markTop:
_result = "top"; _result = "top";
break; break;
case CONTEXT_MENU_MARK_RIGHT: case markRight:
_result = "right"; _result = "right";
break; break;
case CONTEXT_MENU_MARK_BOTTOM: case markButtom:
_result = "buttom"; _result = "buttom";
break; break;
case CONTEXT_MENU_MARK_LEFT: case markLeft:
_result = "left"; _result = "left";
break; break;
default: default:
case CONTEXT_MENU_MARK_NONE: case markNone:
_result = "none"; _result = "none";
break; break;
} }

View File

@ -18,17 +18,18 @@
#include <ewol/widget/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
namespace widget { namespace widget {
typedef enum {
CONTEXT_MENU_MARK_TOP,
CONTEXT_MENU_MARK_RIGHT,
CONTEXT_MENU_MARK_BOTTOM,
CONTEXT_MENU_MARK_LEFT,
CONTEXT_MENU_MARK_NONE
}markPosition_te;
/** /**
* @ingroup ewolWidgetGroup * @ingroup ewolWidgetGroup
*/ */
class ContextMenu : public widget::Container { class ContextMenu : public widget::Container {
public:
enum markPosition {
markTop,
markRight,
markButtom,
markLeft,
markNone
};
public: public:
static void init(ewol::WidgetManager& _widgetManager); static void init(ewol::WidgetManager& _widgetManager);
// Config list of properties // Config list of properties
@ -55,9 +56,9 @@ namespace widget {
float m_offset; float m_offset;
private: private:
vec2 m_arrowPos; vec2 m_arrowPos;
markPosition_te m_arrawBorder; enum markPosition m_arrawBorder;
public: public:
void setPositionMark(markPosition_te position, vec2 arrowPos); void setPositionMark(enum markPosition position, vec2 arrowPos);
protected: // Derived function protected: // Derived function
virtual void onDraw(void); virtual void onDraw(void);
virtual bool onSetConfig(const ewol::EConfig& _conf); virtual bool onSetConfig(const ewol::EConfig& _conf);

View File

@ -241,7 +241,7 @@ void widget::Entry::removeSelected(void) {
} }
void widget::Entry::copySelectionToClipBoard(ewol::clipBoard::clipboardListe_te _clipboardID) { void widget::Entry::copySelectionToClipBoard(enum ewol::clipBoard::clipboardListe _clipboardID) {
if (m_displayCursorPosSelection == m_displayCursorPos) { if (m_displayCursorPosSelection == m_displayCursorPos) {
// nothing to cut ... // nothing to cut ...
return; return;
@ -441,7 +441,7 @@ void widget::Entry::setInternalValue(const etk::UString& _newData) {
m_data = _newData; m_data = _newData;
} }
void widget::Entry::onEventClipboard(ewol::clipBoard::clipboardListe_te _clipboardID) { void widget::Entry::onEventClipboard(enum ewol::clipBoard::clipboardListe _clipboardID) {
// remove curent selected data ... // remove curent selected data ...
removeSelected(); removeSelected();
// get current selection / Copy : // get current selection / Copy :

View File

@ -140,7 +140,7 @@ namespace widget {
* @brief Copy the selected data on the specify clipboard * @brief Copy the selected data on the specify clipboard
* @param[in] _clipboardID Selected clipboard * @param[in] _clipboardID Selected clipboard
*/ */
virtual void copySelectionToClipBoard(ewol::clipBoard::clipboardListe_te _clipboardID); virtual void copySelectionToClipBoard(enum ewol::clipBoard::clipboardListe _clipboardID);
/** /**
* @brief remove the selected area * @brief remove the selected area
* @note This request a regeneration of the display * @note This request a regeneration of the display
@ -199,7 +199,7 @@ namespace widget {
virtual bool onEventInput(const ewol::EventInput& _event); virtual bool onEventInput(const ewol::EventInput& _event);
virtual bool onEventEntry(const ewol::EventEntry& _event); virtual bool onEventEntry(const ewol::EventEntry& _event);
virtual void onReceiveMessage(const ewol::EMessage& _msg); virtual void onReceiveMessage(const ewol::EMessage& _msg);
virtual void onEventClipboard(ewol::clipBoard::clipboardListe_te _clipboardID); virtual void onEventClipboard(enum ewol::clipBoard::clipboardListe _clipboardID);
virtual const char * const getObjectType(void) { virtual const char * const getObjectType(void) {
return "widget::Entry"; return "widget::Entry";
}; };

View File

@ -30,7 +30,7 @@ widget::Joystick::Joystick(void) {
addEventId(ewolEventJoystickMove); addEventId(ewolEventJoystickMove);
// by default the joy does not lock when free out // by default the joy does not lock when free out
m_lock = false; m_lock = false;
m_displayMode = widget::JOYSTICK_NORMAL_MODE; m_displayMode = modeNormal;
m_colorFg = draw::color::blue; m_colorFg = draw::color::blue;

View File

@ -19,14 +19,15 @@ extern const char * const ewolEventJoystickDisable;
extern const char * const ewolEventJoystickMove; extern const char * const ewolEventJoystickMove;
namespace widget { namespace widget {
typedef enum {
JOYSTICK_NORMAL_MODE,
JOYSTICK_ARROW_MODE,
} joystickMode_te;
/** /**
* @ingroup ewolWidgetGroup * @ingroup ewolWidgetGroup
*/ */
class Joystick :public ewol::Widget { class Joystick :public ewol::Widget {
public:
enum joystickMode {
modeNormal,
modeArrow,
};
private: private:
draw::Color m_colorFg; //!< Forground color draw::Color m_colorFg; //!< Forground color
draw::Color m_colorBg; //!< Background color draw::Color m_colorBg; //!< Background color
@ -34,7 +35,7 @@ namespace widget {
float m_distance; //!< dintance from the center float m_distance; //!< dintance from the center
float m_angle; //!< angle of the arraw (if < 0 : No arraw...) 0 is the TOP ... float m_angle; //!< angle of the arraw (if < 0 : No arraw...) 0 is the TOP ...
bool m_lock; //!< flag to mark the lock when the cursor is free when we are outside the circle bool m_lock; //!< flag to mark the lock when the cursor is free when we are outside the circle
joystickMode_te m_displayMode; //!< Type of fonctionnal mode of the joystick enum joystickMode m_displayMode; //!< Type of fonctionnal mode of the joystick
private: private:
// generic property of the joystick: // generic property of the joystick:
bool m_displayBackground; bool m_displayBackground;
@ -44,41 +45,43 @@ namespace widget {
public: public:
Joystick(void); Joystick(void);
virtual ~Joystick(void); virtual ~Joystick(void);
// Derived function public:
void setLockMode(bool _lockWhenOut) {
m_lock = _lockWhenOut;
};
void setDisplayMode(enum joystickMode _newMode) {
m_displayMode = _newMode;
};
/**
* @brief set the ratio of the widget joystick
* @param[in] _newRatio the new ratio that might be set
*/
void ratio(float _newRatio);
/**
* @brief set the Background of the widget joystick
* @param[in] _imageNameInData the new rbackground that might be set
* @param[in] _display
*/
void background(etk::UString _imageNameInData, bool _display=true);
/**
* @brief set the Foreground of the widget joystick
* @param[in] _imageNameInData the new Foreground that might be set
*/
void foreground(etk::UString _imageNameInData);
/**
* @brief get the property of the joystick
* @param[out] _distance distance to the center
* @param[out] _angle angle of the joy
*/
void getProperty(float& _distance, float& _angle);
public: // Derived function
virtual const char * const getObjectType(void) { virtual const char * const getObjectType(void) {
return "widget::Joystick"; return "widget::Joystick";
}; };
virtual void calculateSize(const vec2& availlable); virtual void calculateSize(const vec2& _availlable);
virtual void onRegenerateDisplay(void); virtual void onRegenerateDisplay(void);
virtual bool onEventInput(const ewol::EventInput& _event); virtual bool onEventInput(const ewol::EventInput& _event);
void setLockMode(bool lockWhenOut) { m_lock = lockWhenOut; };
void setDisplayMode(joystickMode_te newMode) { m_displayMode = newMode; };
/**
* @brief set the ratio of the widget joystick
* @param[in] newRatio the new ratio that might be set
*/
void ratio(float newRatio);
/**
* @brief set the Background of the widget joystick
* @param[in] imageNameInData the new rbackground that might be set
*/
void background(etk::UString imageNameInData, bool display=true);
/**
* @brief set the Foreground of the widget joystick
* @param[in] imageNameInData the new Foreground that might be set
*/
void foreground(etk::UString imageNameInData);
/**
* @brief get the property of the joystick
* @param[out] distance distance to the center
* @param[out] angle angle of the joy
*/
void getProperty(float& distance, float& angle);
}; };
}; };

View File

@ -69,7 +69,7 @@ namespace widget {
} }
return false; return false;
}; };
virtual bool onItemEvent(int32_t _IdInput, ewol::keyEvent::status_te _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) { virtual bool onItemEvent(int32_t _IdInput, enum ewol::keyEvent::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) {
return false; return false;
} }
/** /**

View File

@ -180,7 +180,7 @@ bool widget::ListFileSystem::getElement(int32_t _colomn, int32_t _raw, etk::UStr
bool widget::ListFileSystem::onItemEvent(int32_t _IdInput, bool widget::ListFileSystem::onItemEvent(int32_t _IdInput,
ewol::keyEvent::status_te _typeEvent, enum ewol::keyEvent::status _typeEvent,
int32_t _colomn, int32_t _colomn,
int32_t _raw, int32_t _raw,
float _x, float _x,

View File

@ -39,7 +39,7 @@ namespace widget {
bool getTitle(int32_t _colomn, etk::UString& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg); bool getTitle(int32_t _colomn, etk::UString& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
uint32_t getNuberOfRaw(void); uint32_t getNuberOfRaw(void);
bool getElement(int32_t _colomn, int32_t _raw, etk::UString& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg); bool getElement(int32_t _colomn, int32_t _raw, etk::UString& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
bool onItemEvent(int32_t _IdInput, ewol::keyEvent::status_te _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y); bool onItemEvent(int32_t _IdInput, enum ewol::keyEvent::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
const char * const getObjectType(void) { const char * const getObjectType(void) {
return "widget::ListFileSystem"; return "widget::ListFileSystem";
}; };

View File

@ -165,7 +165,7 @@ void widget::Menu::onReceiveMessage(const ewol::EMessage& _msg) {
tmpOri.y() ); tmpOri.y() );
} }
m_widgetContextMenu->setPositionMark(widget::CONTEXT_MENU_MARK_TOP, newPosition ); m_widgetContextMenu->setPositionMark(widget::ContextMenu::markTop, newPosition );
widget::Sizer * mySizer = NULL; widget::Sizer * mySizer = NULL;
widget::Button * myButton = NULL; widget::Button * myButton = NULL;

View File

@ -235,7 +235,7 @@ bool widget::PopUp::onEventInput(const ewol::EventInput& _event) {
return false; return false;
} }
void widget::PopUp::setAnimationMode(animation_te _animation) { void widget::PopUp::setAnimationMode(enum animation _animation) {
m_animation = _animation; m_animation = _animation;
if (true == m_shaper.changeStatusIn((int32_t)_animation) ) { if (true == m_shaper.changeStatusIn((int32_t)_animation) ) {
periodicCallEnable(); periodicCallEnable();

View File

@ -74,23 +74,23 @@ namespace widget {
private: private:
//float m_slidingProgress; //!< ratio progression of a sliding //float m_slidingProgress; //!< ratio progression of a sliding
public: public:
typedef enum { enum animation {
animationNone, //!< No annimation animationNone, //!< No annimation
animationIncrease, //!< element came strart with no size and increase with the corect size. animationIncrease, //!< element came strart with no size and increase with the corect size.
} animation_te; };
private: private:
animation_te m_animation; //!< Methode add and remove element (animation) enum animation m_animation; //!< Methode add and remove element (animation)
public: public:
/** /**
* @brief set an animation mode for the new element set in the Widget container. * @brief set an animation mode for the new element set in the Widget container.
* @param[in] _animation The new animation mode. * @param[in] _animation The new animation mode.
*/ */
void setAnimationMode(animation_te _animation); void setAnimationMode(enum animation _animation);
/** /**
* @brief get the current animation mode. * @brief get the current animation mode.
* @return The animation mode. * @return The animation mode.
*/ */
animation_te getAnimationMode(void) const { enum animation getAnimationMode(void) const {
return m_animation; return m_animation;
}; };

View File

@ -28,7 +28,7 @@ widget::Scroll::Scroll(void) :
m_limit(0.15,0.5), m_limit(0.15,0.5),
m_pixelScrolling(20), m_pixelScrolling(20),
m_highSpeedStartPos(0,0), m_highSpeedStartPos(0,0),
m_highSpeedMode(SCROLL_DISABLE), m_highSpeedMode(speedModeDisable),
m_highSpeedButton(-1), m_highSpeedButton(-1),
m_highSpeedType(ewol::keyEvent::typeUnknow) { m_highSpeedType(ewol::keyEvent::typeUnknow) {
registerConfig(configLimit, "vec2", NULL, "Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end"); registerConfig(configLimit, "vec2", NULL, "Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end");
@ -132,7 +132,7 @@ bool widget::Scroll::onEventInput(const ewol::EventInput& _event) {
if (relativePos.x() >= (m_size.x()-SCROLL_BAR_SPACE)) { if (relativePos.x() >= (m_size.x()-SCROLL_BAR_SPACE)) {
if( m_size.y() < scrollSize.y() if( m_size.y() < scrollSize.y()
|| scrollOffset.y() != 0) { || scrollOffset.y() != 0) {
m_highSpeedMode = widget::SCROLL_ENABLE_VERTICAL; m_highSpeedMode = speedModeEnableVertical;
m_highSpeedType = ewol::keyEvent::typeMouse; m_highSpeedType = ewol::keyEvent::typeMouse;
m_highSpeedStartPos.setX(relativePos.x()); m_highSpeedStartPos.setX(relativePos.x());
m_highSpeedStartPos.setY(scrollOffset.y() / scrollSize.y() * (m_size.y()-SCROLL_BAR_SPACE*2)); m_highSpeedStartPos.setY(scrollOffset.y() / scrollSize.y() * (m_size.y()-SCROLL_BAR_SPACE*2));
@ -149,7 +149,7 @@ bool widget::Scroll::onEventInput(const ewol::EventInput& _event) {
} else if (relativePos.y() >= (m_size.y()-SCROLL_BAR_SPACE)) { } else if (relativePos.y() >= (m_size.y()-SCROLL_BAR_SPACE)) {
if( m_size.x() < scrollSize.x() if( m_size.x() < scrollSize.x()
|| scrollOffset.x()!=0) { || scrollOffset.x()!=0) {
m_highSpeedMode = widget::SCROLL_ENABLE_HORIZONTAL; m_highSpeedMode = speedModeEnableHorizontal;
m_highSpeedType = ewol::keyEvent::typeMouse; m_highSpeedType = ewol::keyEvent::typeMouse;
m_highSpeedStartPos.setX(scrollOffset.x() / scrollSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2)); m_highSpeedStartPos.setX(scrollOffset.x() / scrollSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2));
m_highSpeedStartPos.setY(relativePos.y()); m_highSpeedStartPos.setY(relativePos.y());
@ -189,41 +189,42 @@ bool widget::Scroll::onEventInput(const ewol::EventInput& _event) {
} }
}else if (_event.getId() == 2) { }else if (_event.getId() == 2) {
if (_event.getStatus() == ewol::keyEvent::statusDown) { if (_event.getStatus() == ewol::keyEvent::statusDown) {
m_highSpeedMode = widget::SCROLL_INIT; m_highSpeedMode = speedModeInit;
m_highSpeedType = ewol::keyEvent::typeMouse; m_highSpeedType = ewol::keyEvent::typeMouse;
m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y()); m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y());
m_highSpeedButton = 2; m_highSpeedButton = 2;
// not really use... == > just keep some informations // not really use... == > just keep some informations
return false; return false;
} }
} else if( widget::SCROLL_DISABLE!=m_highSpeedMode } else if( m_highSpeedMode != speedModeDisable
&& _event.getStatus() == ewol::keyEvent::statusLeave) { && _event.getStatus() == ewol::keyEvent::statusLeave) {
m_highSpeedMode = widget::SCROLL_DISABLE; m_highSpeedMode = speedModeDisable;
m_highSpeedType = ewol::keyEvent::typeUnknow; m_highSpeedType = ewol::keyEvent::typeUnknow;
markToRedraw(); markToRedraw();
return true; return true;
} }
if (_event.getId() == m_highSpeedButton && widget::SCROLL_DISABLE!=m_highSpeedMode) { if ( _event.getId() == m_highSpeedButton
&& m_highSpeedMode != speedModeDisable) {
if (_event.getStatus() == ewol::keyEvent::statusUp) { if (_event.getStatus() == ewol::keyEvent::statusUp) {
if (widget::SCROLL_INIT == m_highSpeedMode) { if (m_highSpeedMode == speedModeInit) {
// TODO : generate back the down event ... // TODO : generate back the down event ...
m_highSpeedMode = widget::SCROLL_DISABLE; m_highSpeedMode = speedModeDisable;
m_highSpeedType = ewol::keyEvent::typeUnknow; m_highSpeedType = ewol::keyEvent::typeUnknow;
return false; return false;
} else { } else {
m_highSpeedMode = widget::SCROLL_GREP_END_EVENT; m_highSpeedMode = speedModeGrepEndEvent;
markToRedraw(); markToRedraw();
return true; return true;
} }
} else if (widget::SCROLL_GREP_END_EVENT == m_highSpeedMode) { } else if (m_highSpeedMode == speedModeGrepEndEvent) {
if (_event.getStatus() == ewol::keyEvent::statusSingle) { if (_event.getStatus() == ewol::keyEvent::statusSingle) {
m_highSpeedMode = widget::SCROLL_DISABLE; m_highSpeedMode = speedModeDisable;
m_highSpeedType = ewol::keyEvent::typeUnknow; m_highSpeedType = ewol::keyEvent::typeUnknow;
m_highSpeedButton = -1; m_highSpeedButton = -1;
markToRedraw(); markToRedraw();
} }
return true; return true;
} else if( widget::SCROLL_INIT == m_highSpeedMode } else if( m_highSpeedMode == speedModeInit
&& _event.getStatus() == ewol::keyEvent::statusMove) { && _event.getStatus() == ewol::keyEvent::statusMove) {
// wait that the cursor move more than 10 px to enable it : // wait that the cursor move more than 10 px to enable it :
if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10 if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10
@ -231,18 +232,18 @@ bool widget::Scroll::onEventInput(const ewol::EventInput& _event) {
// the scrooling can start : // the scrooling can start :
// select the direction : // select the direction :
if (relativePos.x() == m_highSpeedStartPos.x()) { if (relativePos.x() == m_highSpeedStartPos.x()) {
m_highSpeedMode = widget::SCROLL_ENABLE_VERTICAL; m_highSpeedMode = speedModeEnableVertical;
} else if (relativePos.y() == m_highSpeedStartPos.y()) { } else if (relativePos.y() == m_highSpeedStartPos.y()) {
m_highSpeedMode = widget::SCROLL_ENABLE_HORIZONTAL; m_highSpeedMode = speedModeEnableHorizontal;
} else { } else {
float coef = (relativePos.y() - m_highSpeedStartPos.y()) / (relativePos.x() - m_highSpeedStartPos.x()); float coef = (relativePos.y() - m_highSpeedStartPos.y()) / (relativePos.x() - m_highSpeedStartPos.x());
if (abs(coef) <= 1 ) { if (abs(coef) <= 1 ) {
m_highSpeedMode = widget::SCROLL_ENABLE_HORIZONTAL; m_highSpeedMode = speedModeEnableHorizontal;
} else { } else {
m_highSpeedMode = widget::SCROLL_ENABLE_VERTICAL; m_highSpeedMode = speedModeEnableVertical;
} }
} }
if (m_highSpeedMode == widget::SCROLL_ENABLE_HORIZONTAL) { if (m_highSpeedMode == speedModeEnableHorizontal) {
m_highSpeedStartPos.setX(scrollOffset.x() / scrollSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2)); m_highSpeedStartPos.setX(scrollOffset.x() / scrollSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2));
} else { } else {
m_highSpeedStartPos.setY(scrollOffset.y() / scrollSize.y() * (m_size.y()-SCROLL_BAR_SPACE*2)); m_highSpeedStartPos.setY(scrollOffset.y() / scrollSize.y() * (m_size.y()-SCROLL_BAR_SPACE*2));
@ -255,7 +256,7 @@ bool widget::Scroll::onEventInput(const ewol::EventInput& _event) {
} }
return true; return true;
} }
if( widget::SCROLL_ENABLE_HORIZONTAL == m_highSpeedMode if( m_highSpeedMode == speedModeEnableHorizontal
&& _event.getStatus() == ewol::keyEvent::statusMove) { && _event.getStatus() == ewol::keyEvent::statusMove) {
scrollOffset.setX((int32_t)(scrollSize.x() * (relativePos.x()-SCROLL_BAR_SPACE) / (m_size.x()-SCROLL_BAR_SPACE*2))); scrollOffset.setX((int32_t)(scrollSize.x() * (relativePos.x()-SCROLL_BAR_SPACE) / (m_size.x()-SCROLL_BAR_SPACE*2)));
scrollOffset.setX(etk_avg(0, scrollOffset.x(), (scrollSize.x() - m_size.x()*m_limit.x() ))); scrollOffset.setX(etk_avg(0, scrollOffset.x(), (scrollSize.x() - m_size.x()*m_limit.x() )));
@ -265,7 +266,7 @@ bool widget::Scroll::onEventInput(const ewol::EventInput& _event) {
} }
return true; return true;
} }
if( widget::SCROLL_ENABLE_VERTICAL == m_highSpeedMode if( m_highSpeedMode == speedModeEnableVertical
&& _event.getStatus() == ewol::keyEvent::statusMove) { && _event.getStatus() == ewol::keyEvent::statusMove) {
scrollOffset.setY((int32_t)(scrollSize.y() * (relativePos.y()-SCROLL_BAR_SPACE) / (m_size.y()-SCROLL_BAR_SPACE*2))); scrollOffset.setY((int32_t)(scrollSize.y() * (relativePos.y()-SCROLL_BAR_SPACE) / (m_size.y()-SCROLL_BAR_SPACE*2)));
scrollOffset.setY(etk_avg(0, scrollOffset.y(), (scrollSize.y() - m_size.y()*m_limit.x()))); scrollOffset.setY(etk_avg(0, scrollOffset.y(), (scrollSize.y() - m_size.y()*m_limit.x())));
@ -282,29 +283,32 @@ bool widget::Scroll::onEventInput(const ewol::EventInput& _event) {
if (1 == _event.getId()) { if (1 == _event.getId()) {
//EWOL_VERBOSE("event 1 << " << (int32_t)typeEvent << "(" << x << "," << y << ")"); //EWOL_VERBOSE("event 1 << " << (int32_t)typeEvent << "(" << x << "," << y << ")");
if (ewol::keyEvent::statusDown == _event.getStatus()) { if (ewol::keyEvent::statusDown == _event.getStatus()) {
m_highSpeedMode = widget::SCROLL_INIT; m_highSpeedMode = speedModeInit;
m_highSpeedType = ewol::keyEvent::typeFinger; m_highSpeedType = ewol::keyEvent::typeFinger;
m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y()); m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y());
EWOL_VERBOSE("SCROOL == > INIT"); EWOL_VERBOSE("SCROOL == > INIT");
return true; return true;
} else if (ewol::keyEvent::statusUp == _event.getStatus()) { } else if (ewol::keyEvent::statusUp == _event.getStatus()) {
m_highSpeedMode = widget::SCROLL_DISABLE; m_highSpeedMode = speedModeDisable;
m_highSpeedType = ewol::keyEvent::typeUnknow; m_highSpeedType = ewol::keyEvent::typeUnknow;
EWOL_VERBOSE("SCROOL == > DISABLE"); EWOL_VERBOSE("SCROOL == > DISABLE");
markToRedraw(); markToRedraw();
return true; return true;
} else if (widget::SCROLL_INIT == m_highSpeedMode && ewol::keyEvent::statusMove == _event.getStatus()) { } else if ( m_highSpeedMode == speedModeInit
&& ewol::keyEvent::statusMove == _event.getStatus()) {
// wait that the cursor move more than 10 px to enable it : // wait that the cursor move more than 10 px to enable it :
if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10 if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10
|| abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) { || abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) {
// the scrooling can start : // the scrooling can start :
// select the direction : // select the direction :
m_highSpeedMode = widget::SCROLL_ENABLE_FINGER; m_highSpeedMode = speedModeEnableFinger;
EWOL_VERBOSE("SCROOL == > ENABLE"); EWOL_VERBOSE("SCROOL == > ENABLE");
markToRedraw(); markToRedraw();
} }
return true; return true;
} if (widget::SCROLL_ENABLE_FINGER == m_highSpeedMode && ewol::keyEvent::statusMove == _event.getStatus()) { }
if ( m_highSpeedMode == speedModeEnableFinger
&& ewol::keyEvent::statusMove == _event.getStatus()) {
//scrollOffset.x = (int32_t)(scrollSize.x * x / m_size.x); //scrollOffset.x = (int32_t)(scrollSize.x * x / m_size.x);
scrollOffset.setX(scrollOffset.x() - relativePos.x() - m_highSpeedStartPos.x()); scrollOffset.setX(scrollOffset.x() - relativePos.x() - m_highSpeedStartPos.x());
scrollOffset.setY(scrollOffset.y() - relativePos.y() - m_highSpeedStartPos.y()); scrollOffset.setY(scrollOffset.y() - relativePos.y() - m_highSpeedStartPos.y());
@ -315,8 +319,9 @@ bool widget::Scroll::onEventInput(const ewol::EventInput& _event) {
markToRedraw(); markToRedraw();
return true; return true;
} }
} else if (widget::SCROLL_DISABLE!=m_highSpeedMode && ewol::keyEvent::statusLeave == _event.getStatus()) { } else if ( m_highSpeedMode != speedModeDisable
m_highSpeedMode = widget::SCROLL_DISABLE; && ewol::keyEvent::statusLeave == _event.getStatus()) {
m_highSpeedMode = speedModeDisable;
m_highSpeedType = ewol::keyEvent::typeUnknow; m_highSpeedType = ewol::keyEvent::typeUnknow;
EWOL_VERBOSE("SCROOL == > DISABLE"); EWOL_VERBOSE("SCROOL == > DISABLE");
markToRedraw(); markToRedraw();

View File

@ -17,19 +17,19 @@
#include <ewol/widget/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
namespace widget { namespace widget {
typedef enum {
SCROLL_DISABLE,
SCROLL_INIT,
SCROLL_ENABLE_FINGER, // Specific for touchpad
SCROLL_ENABLE_HORIZONTAL, // Specific for mouse
SCROLL_ENABLE_VERTICAL, // Specific for mouse
SCROLL_GREP_END_EVENT,
}highSpeedMode_te;
/** /**
* @ingroup ewolWidgetGroup * @ingroup ewolWidgetGroup
*/ */
class Scroll : public widget::Container { class Scroll : public widget::Container {
public:
enum highSpeedMode {
speedModeDisable,
speedModeInit,
speedModeEnableFinger, // Specific for touchpad
speedModeEnableHorizontal, // Specific for mouse
speedModeEnableVertical, // Specific for mouse
speedModeGrepEndEvent
};
public: public:
// Cinfig parameter list: // Cinfig parameter list:
static const char* const configLimit; static const char* const configLimit;
@ -42,9 +42,9 @@ namespace widget {
private: private:
float m_pixelScrolling; float m_pixelScrolling;
vec2 m_highSpeedStartPos; vec2 m_highSpeedStartPos;
highSpeedMode_te m_highSpeedMode; enum highSpeedMode m_highSpeedMode;
int32_t m_highSpeedButton; int32_t m_highSpeedButton;
ewol::keyEvent::type_te m_highSpeedType; enum ewol::keyEvent::type m_highSpeedType;
public: public:
Scroll(void); Scroll(void);
virtual ~Scroll(void); virtual ~Scroll(void);

View File

@ -22,7 +22,7 @@ void widget::Sizer::init(ewol::WidgetManager& _widgetManager) {
} }
widget::Sizer::Sizer(widget::Sizer::displayMode_te _mode): widget::Sizer::Sizer(enum displayMode _mode):
m_mode(_mode), m_mode(_mode),
m_borderSize(), m_borderSize(),
m_animation(animationNone), m_animation(animationNone),
@ -44,13 +44,13 @@ void widget::Sizer::setBorderSize(const ewol::Dimension& _newBorderSize) {
requestUpdateSize(); requestUpdateSize();
} }
void widget::Sizer::setMode(widget::Sizer::displayMode_te _mode) { void widget::Sizer::setMode(enum displayMode _mode) {
m_mode = _mode; m_mode = _mode;
markToRedraw(); markToRedraw();
requestUpdateSize(); requestUpdateSize();
} }
widget::Sizer::displayMode_te widget::Sizer::getMode(void) { enum widget::Sizer::displayMode widget::Sizer::getMode(void) {
return m_mode; return m_mode;
} }

View File

@ -25,18 +25,18 @@ namespace widget {
*/ */
static void init(ewol::WidgetManager& _widgetManager); static void init(ewol::WidgetManager& _widgetManager);
public: public:
typedef enum { enum displayMode {
modeVert, //!< Vertical mode modeVert, //!< Vertical mode
modeHori, //!< Horizontal mode modeHori, //!< Horizontal mode
} displayMode_te; };
private: private:
displayMode_te m_mode; //!< Methode to display the widget list (vert/hory ...) enum displayMode m_mode; //!< Methode to display the widget list (vert/hory ...)
public: public:
/** /**
* @brief Constructor * @brief Constructor
* @param[in] _mode The mode to display the elements * @param[in] _mode The mode to display the elements
*/ */
Sizer(displayMode_te _mode=widget::Sizer::modeHori); Sizer(enum displayMode _mode=widget::Sizer::modeHori);
/** /**
* @brief Desstructor * @brief Desstructor
*/ */
@ -45,12 +45,12 @@ namespace widget {
* @brief set the mode to display elements. * @brief set the mode to display elements.
* @param[in] _mode The mode to display the elements. * @param[in] _mode The mode to display the elements.
*/ */
void setMode(displayMode_te _mode); void setMode(enum displayMode _mode);
/** /**
* @brief get the mode to display elements. * @brief get the mode to display elements.
* @return The current mode to display the elements. * @return The current mode to display the elements.
*/ */
displayMode_te getMode(void); enum displayMode getMode(void);
private: private:
ewol::Dimension m_borderSize; //!< Border size needed for all the display ewol::Dimension m_borderSize; //!< Border size needed for all the display
public: public:
@ -67,29 +67,29 @@ namespace widget {
return m_borderSize; return m_borderSize;
}; };
public: public:
typedef enum { enum animation {
animationNone, //!< No annimation animationNone, //!< No annimation
animationTop, //!< element came from the top animationTop, //!< element came from the top
animationbuttom, //!< element came from the buttom animationbuttom, //!< element came from the buttom
animationLeft, //!< element came from the Left animationLeft, //!< element came from the Left
animationRight //!< element came from the right animationRight //!< element came from the right
//animationZoom //!< element came from zooming //animationZoom //!< element came from zooming
} animation_te; };
private: private:
animation_te m_animation; //!< Methode add and remove element (animation) enum animation m_animation; //!< Methode add and remove element (animation)
public: public:
/** /**
* @brief set an animation mode for the new element set in the Widget container. * @brief set an animation mode for the new element set in the Widget container.
* @param[in] _animation The new animation mode. * @param[in] _animation The new animation mode.
*/ */
void setAnimationMode(animation_te _animation) { void setAnimationMode(enum animation _animation) {
m_animation = _animation; m_animation = _animation;
}; };
/** /**
* @brief get the current animation mode. * @brief get the current animation mode.
* @return The animation mode. * @return The animation mode.
*/ */
animation_te getAnimationMode(void) { enum animation getAnimationMode(void) {
return m_animation; return m_animation;
}; };
private: private:

View File

@ -15,7 +15,7 @@ static const char* l_listsladingMode[widget::WSlider::sladingTransition_count] =
"transition horisantal" "transition horisantal"
}; };
etk::CCout& operator <<(etk::CCout& _os, const widget::WSlider::sladingMode_te _obj) { etk::CCout& operator <<(etk::CCout& _os, const enum widget::WSlider::sladingMode _obj) {
_os << l_listsladingMode[_obj]; _os << l_listsladingMode[_obj];
return _os; return _os;
} }
@ -161,7 +161,7 @@ void widget::WSlider::subWidgetSelectSet(const etk::UString& _widgetName) {
EWOL_ERROR("Can not change to a widget not present"); EWOL_ERROR("Can not change to a widget not present");
} }
void widget::WSlider::setTransitionMode(widget::WSlider::sladingMode_te _mode) { void widget::WSlider::setTransitionMode(enum sladingMode _mode) {
if (m_transitionSlide != _mode) { if (m_transitionSlide != _mode) {
m_transitionSlide = _mode; m_transitionSlide = _mode;
markToRedraw(); markToRedraw();
@ -269,7 +269,7 @@ bool widget::WSlider::onSetConfig(const ewol::EConfig& _conf) {
return true; return true;
} }
if (_conf.getConfig() == configMode) { if (_conf.getConfig() == configMode) {
sladingMode_te tmpTransition = sladingTransitionHori; enum sladingMode tmpTransition = sladingTransitionHori;
if(true == _conf.getData().compareNoCase("vert")) { if(true == _conf.getData().compareNoCase("vert")) {
tmpTransition = sladingTransitionVert; tmpTransition = sladingTransitionVert;
} else if(true == _conf.getData().compareNoCase("hori")) { } else if(true == _conf.getData().compareNoCase("hori")) {

View File

@ -27,11 +27,11 @@ namespace widget {
static const char* const eventStopSlide; static const char* const eventStopSlide;
// Config list of properties // Config list of properties
static const char* const configMode; static const char* const configMode;
typedef enum { enum sladingMode {
sladingTransitionVert, sladingTransitionVert,
sladingTransitionHori, sladingTransitionHori,
sladingTransition_count, sladingTransition_count,
} sladingMode_te; };
public: public:
WSlider(void); WSlider(void);
virtual ~WSlider(void); virtual ~WSlider(void);
@ -74,18 +74,18 @@ namespace widget {
return m_transitionSpeed; return m_transitionSpeed;
}; };
private: private:
sladingMode_te m_transitionSlide; //!< mode to slide the widgets enum sladingMode m_transitionSlide; //!< mode to slide the widgets
public: public:
/** /**
* @brief set a new mode of sliding element * @brief set a new mode of sliding element
* @param[in] _mode new display mode * @param[in] _mode new display mode
*/ */
void setTransitionMode(sladingMode_te _mode); void setTransitionMode(enum sladingMode _mode);
/** /**
* @brief get a new mode of sliding element * @brief get a new mode of sliding element
* @return The current sliding mode * @return The current sliding mode
*/ */
sladingMode_te getTransitionMode(void) { enum sladingMode getTransitionMode(void) {
return m_transitionSlide; return m_transitionSlide;
}; };
public: // Derived function public: // Derived function
@ -101,7 +101,7 @@ namespace widget {
virtual bool onGetConfig(const char* _config, etk::UString& _result) const; virtual bool onGetConfig(const char* _config, etk::UString& _result) const;
}; };
etk::CCout& operator <<(etk::CCout& _os, const widget::WSlider::sladingMode_te _obj); etk::CCout& operator <<(etk::CCout& _os, const enum widget::WSlider::sladingMode _obj);
}; };
#endif #endif

View File

@ -31,7 +31,7 @@ void ewol::DrawProperty::limit(const vec2& _origin, const vec2& _size) {
#undef __class__ #undef __class__
#define __class__ "gravity" #define __class__ "gravity"
etk::UString ewol::gravityToString(const ewol::gravity_te _obj) { etk::UString ewol::gravityToString(const enum ewol::gravity _obj) {
switch(_obj) { switch(_obj) {
case ewol::gravityCenter: case ewol::gravityCenter:
return "center"; return "center";
@ -55,7 +55,7 @@ etk::UString ewol::gravityToString(const ewol::gravity_te _obj) {
return "unknow"; return "unknow";
} }
ewol::gravity_te ewol::stringToGravity(const etk::UString& _obj) { enum ewol::gravity ewol::stringToGravity(const etk::UString& _obj) {
if (_obj == "center") { if (_obj == "center") {
return ewol::gravityCenter; return ewol::gravityCenter;
} else if (_obj == "top-left") { } else if (_obj == "top-left") {
@ -78,7 +78,7 @@ ewol::gravity_te ewol::stringToGravity(const etk::UString& _obj) {
return ewol::gravityCenter; return ewol::gravityCenter;
} }
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::gravity_te _obj) { etk::CCout& ewol::operator <<(etk::CCout& _os, const enum ewol::gravity _obj) {
_os << ewol::gravityToString(_obj); _os << ewol::gravityToString(_obj);
return _os; return _os;
} }
@ -606,7 +606,7 @@ void ewol::Widget::shortCutClean(void) {
bool ewol::Widget::onEventShortCut(ewol::SpecialKey& _special, bool ewol::Widget::onEventShortCut(ewol::SpecialKey& _special,
etk::UChar _unicodeValue, etk::UChar _unicodeValue,
ewol::keyEvent::keyboard_te _kbMove, enum ewol::keyEvent::keyboard _kbMove,
bool _isDown) { bool _isDown) {
if (_unicodeValue >= 'A' && _unicodeValue <= 'Z') { if (_unicodeValue >= 'A' && _unicodeValue <= 'Z') {
_unicodeValue += 'a' - 'A'; _unicodeValue += 'a' - 'A';
@ -658,13 +658,13 @@ bool ewol::Widget::getGrabStatus(void) {
return m_grabCursor; return m_grabCursor;
} }
void ewol::Widget::setCursor(ewol::cursorDisplay_te _newCursor) { void ewol::Widget::setCursor(enum ewol::cursorDisplay _newCursor) {
EWOL_DEBUG("Change Cursor in " << _newCursor); EWOL_DEBUG("Change Cursor in " << _newCursor);
m_cursorDisplay = _newCursor; m_cursorDisplay = _newCursor;
getContext().setCursor(m_cursorDisplay); getContext().setCursor(m_cursorDisplay);
} }
ewol::cursorDisplay_te ewol::Widget::getCursor(void) { enum ewol::cursorDisplay ewol::Widget::getCursor(void) {
return m_cursorDisplay; return m_cursorDisplay;
} }
@ -701,8 +701,7 @@ bool ewol::Widget::systemEventInput(ewol::EventInputSystem& _event) {
return onEventInput(_event.m_event); return onEventInput(_event.m_event);
} }
void ewol::Widget::setGravity(enum gravity _gravity) {
void ewol::Widget::setGravity(gravity_te _gravity) {
m_gravity = _gravity; m_gravity = _gravity;
markToRedraw(); markToRedraw();
} }

View File

@ -64,7 +64,7 @@ namespace ewol {
}; };
etk::CCout& operator <<(etk::CCout& _os, const ewol::DrawProperty& _obj); etk::CCout& operator <<(etk::CCout& _os, const ewol::DrawProperty& _obj);
typedef enum { enum gravity {
gravityCenter=0x00, gravityCenter=0x00,
gravityTopLeft=0x05, gravityTopLeft=0x05,
gravityTop=0x01, gravityTop=0x01,
@ -74,10 +74,10 @@ namespace ewol {
gravityButtom=0x04, gravityButtom=0x04,
gravityButtomLeft=0x0C, gravityButtomLeft=0x0C,
gravityLeft=0x08, gravityLeft=0x08,
}gravity_te; };
etk::CCout& operator <<(etk::CCout& _os, const ewol::gravity_te _obj); etk::CCout& operator <<(etk::CCout& _os, const enum ewol::gravity _obj);
etk::UString gravityToString(const ewol::gravity_te _obj); etk::UString gravityToString(const enum ewol::gravity _obj);
ewol::gravity_te stringToGravity(const etk::UString& _obj); enum ewol::gravity stringToGravity(const etk::UString& _obj);
class EventShortCut { class EventShortCut {
public: public:
@ -86,7 +86,7 @@ namespace ewol {
etk::UString eventData; //!< data link with the event etk::UString eventData; //!< data link with the event
ewol::SpecialKey specialKey; //!< special board key ewol::SpecialKey specialKey; //!< special board key
etk::UChar unicodeValue; //!< 0 if not used etk::UChar unicodeValue; //!< 0 if not used
ewol::keyEvent::keyboard_te keyboardMoveValue; //!< ewol::EVENT_KB_MOVE_TYPE_NONE if not used enum ewol::keyEvent::keyboard keyboardMoveValue; //!< ewol::EVENT_KB_MOVE_TYPE_NONE if not used
EventShortCut(void) { EventShortCut(void) {
broadcastEvent = false; broadcastEvent = false;
generateEventId = NULL; generateEventId = NULL;
@ -346,21 +346,23 @@ namespace ewol {
* @brief get the visibility of the widget * @brief get the visibility of the widget
* @return true: if the widget is hiden, false: it is visible * @return true: if the widget is hiden, false: it is visible
*/ */
virtual bool isHide(void) { return m_hide; }; virtual bool isHide(void) {
return m_hide;
};
protected: protected:
gravity_te m_gravity; //!< Gravity of the widget enum gravity m_gravity; //!< Gravity of the widget
public: public:
/** /**
* @brief set the widget gravity * @brief set the widget gravity
* @param[in] _gravity New gravity of the widget * @param[in] _gravity New gravity of the widget
*/ */
virtual void setGravity(gravity_te _gravity); virtual void setGravity(enum gravity _gravity);
/** /**
* @brief get the widget gravity * @brief get the widget gravity
* @return the gravity type * @return the gravity type
*/ */
virtual gravity_te getGravity(void) { virtual enum gravity getGravity(void) {
return m_gravity; return m_gravity;
}; };
// ---------------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------------
@ -577,7 +579,7 @@ namespace ewol {
* @note : need to have focus ... * @note : need to have focus ...
* @param[in] mode Mode of data requested * @param[in] mode Mode of data requested
*/ */
virtual void onEventClipboard(ewol::clipBoard::clipboardListe_te _clipboardID) { }; virtual void onEventClipboard(enum ewol::clipBoard::clipboardListe _clipboardID) { };
// ---------------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------------
// -- Shortcut : management of the shortcut // -- Shortcut : management of the shortcut
@ -611,7 +613,7 @@ namespace ewol {
*/ */
virtual bool onEventShortCut(ewol::SpecialKey& _special, virtual bool onEventShortCut(ewol::SpecialKey& _special,
etk::UChar _unicodeValue, etk::UChar _unicodeValue,
ewol::keyEvent::keyboard_te _kbMove, enum ewol::keyEvent::keyboard _kbMove,
bool _isDown); bool _isDown);
// ---------------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------------
// -- drawing : All drawing must be done in 2 separate buffer 1 for the current display and 1 for the working... // -- drawing : All drawing must be done in 2 separate buffer 1 for the current display and 1 for the working...
@ -671,18 +673,18 @@ namespace ewol {
*/ */
virtual bool getGrabStatus(void); virtual bool getGrabStatus(void);
private: private:
ewol::cursorDisplay_te m_cursorDisplay; enum ewol::cursorDisplay m_cursorDisplay;
public: public:
/** /**
* @brief set the cursor display type. * @brief set the cursor display type.
* @param[in] _newCursor selected new cursor. * @param[in] _newCursor selected new cursor.
*/ */
virtual void setCursor(ewol::cursorDisplay_te _newCursor); virtual void setCursor(enum ewol::cursorDisplay _newCursor);
/** /**
* @brief get the currrent cursor. * @brief get the currrent cursor.
* @return the type of the cursor. * @return the type of the cursor.
*/ */
virtual ewol::cursorDisplay_te getCursor(void); virtual enum ewol::cursorDisplay getCursor(void);
public: // Derived function public: // Derived function
virtual void onObjectRemove(ewol::EObject* _removeObject); virtual void onObjectRemove(ewol::EObject* _removeObject);
virtual bool loadXML(exml::Element* _node); virtual bool loadXML(exml::Element* _node);

View File

@ -18,8 +18,8 @@
widget::WidgetScrooled::WidgetScrooled(void) { widget::WidgetScrooled::WidgetScrooled(void) {
m_originScrooled.setValue(0,0); m_originScrooled.setValue(0,0);
m_pixelScrolling = 20; m_pixelScrolling = 20;
m_highSpeedMode = SCROLL_DISABLE; m_highSpeedMode = widget::Scroll::speedModeDisable;
m_scroollingMode = SCROLL_MODE_NORMAL; m_scroollingMode = scroolModeNormal;
m_highSpeedType = ewol::keyEvent::typeUnknow; m_highSpeedType = ewol::keyEvent::typeUnknow;
m_highSpeedButton = -1; m_highSpeedButton = -1;
m_limitScrolling = 0.5; m_limitScrolling = 0.5;
@ -34,7 +34,7 @@ widget::WidgetScrooled::~WidgetScrooled(void) {
void widget::WidgetScrooled::onRegenerateDisplay(void) { void widget::WidgetScrooled::onRegenerateDisplay(void) {
clearOObjectList(); clearOObjectList();
if (SCROLL_MODE_GAME == m_scroollingMode) { if (m_scroollingMode == scroolModeGame) {
} else { } else {
ewol::Drawing* tmpDraw = NULL; ewol::Drawing* tmpDraw = NULL;
@ -79,16 +79,17 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
vec2 relativePos = relativePosition(_event.getPos()); vec2 relativePos = relativePosition(_event.getPos());
// corection due to the open Gl invertion ... // corection due to the open Gl invertion ...
relativePos.setY(m_size.y() - relativePos.y()); relativePos.setY(m_size.y() - relativePos.y());
if (SCROLL_MODE_NORMAL == m_scroollingMode) { if (m_scroollingMode == scroolModeNormal) {
if( ewol::keyEvent::typeMouse == _event.getType() if ( _event.getType() == ewol::keyEvent::typeMouse
&& ( ewol::keyEvent::typeUnknow == m_highSpeedType && ( m_highSpeedType == ewol::keyEvent::typeUnknow
|| ewol::keyEvent::typeMouse == m_highSpeedType ) ) { || m_highSpeedType == ewol::keyEvent::typeMouse) ) {
if (1 == _event.getId() && ewol::keyEvent::statusDown == _event.getStatus()) { if ( _event.getId() == 1
&& _event.getStatus() == ewol::keyEvent::statusDown) {
// check if selected the scrolling position whth the scrolling bar ... // check if selected the scrolling position whth the scrolling bar ...
if (relativePos.x() >= (m_size.x()-SCROLL_BAR_SPACE)) { if (relativePos.x() >= (m_size.x()-SCROLL_BAR_SPACE)) {
if( m_size.y() < m_maxSize.y() if( m_size.y() < m_maxSize.y()
|| m_originScrooled.y() != 0) { || m_originScrooled.y() != 0) {
m_highSpeedMode = widget::SCROLL_ENABLE_VERTICAL; m_highSpeedMode = widget::Scroll::speedModeEnableVertical;
m_highSpeedType = ewol::keyEvent::typeMouse; m_highSpeedType = ewol::keyEvent::typeMouse;
m_highSpeedStartPos.setX(relativePos.x()); m_highSpeedStartPos.setX(relativePos.x());
m_highSpeedStartPos.setY(m_originScrooled.y() / m_maxSize.y() * (m_size.y()-SCROLL_BAR_SPACE*2)); m_highSpeedStartPos.setY(m_originScrooled.y() / m_maxSize.y() * (m_size.y()-SCROLL_BAR_SPACE*2));
@ -102,7 +103,7 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
} else if (relativePos.y() >= (m_size.y()-SCROLL_BAR_SPACE)) { } else if (relativePos.y() >= (m_size.y()-SCROLL_BAR_SPACE)) {
if( m_size.x() < m_maxSize.x() if( m_size.x() < m_maxSize.x()
|| m_originScrooled.x()!=0) { || m_originScrooled.x()!=0) {
m_highSpeedMode = widget::SCROLL_ENABLE_HORIZONTAL; m_highSpeedMode = widget::Scroll::speedModeEnableHorizontal;
m_highSpeedType = ewol::keyEvent::typeMouse; m_highSpeedType = ewol::keyEvent::typeMouse;
m_highSpeedStartPos.setX(m_originScrooled.x() / m_maxSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2)); m_highSpeedStartPos.setX(m_originScrooled.x() / m_maxSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2));
m_highSpeedStartPos.setY(relativePos.y()); m_highSpeedStartPos.setY(relativePos.y());
@ -115,7 +116,8 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
} }
} }
return false; return false;
} else if (4 == _event.getId() && ewol::keyEvent::statusUp == _event.getStatus()) { } else if ( _event.getId() == 4
&& _event.getStatus() == ewol::keyEvent::statusUp) {
/* /*
if (true == ewol::isSetCtrl()) { if (true == ewol::isSetCtrl()) {
float zoom = getZoom()*1.1; float zoom = getZoom()*1.1;
@ -129,7 +131,8 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
return true; return true;
} }
} }
} else if (5 == _event.getId() && ewol::keyEvent::statusUp == _event.getStatus()) { } else if ( _event.getId() == 5
&& _event.getStatus() == ewol::keyEvent::statusUp) {
/* /*
if (true == ewol::isSetCtrl()) { if (true == ewol::isSetCtrl()) {
float zoom = getZoom()*0.9; float zoom = getZoom()*0.9;
@ -143,7 +146,7 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
return true; return true;
} }
} }
}else if (2 == _event.getId()) { }else if (_event.getId() == 2) {
/* /*
if (true == ewol::isSetCtrl()) { if (true == ewol::isSetCtrl()) {
if (ewol::keyEvent::statusDown == typeEvent) { if (ewol::keyEvent::statusDown == typeEvent) {
@ -151,59 +154,62 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
setZoom(zoom); setZoom(zoom);
} }
} else */{ } else */{
if (ewol::keyEvent::statusDown == _event.getStatus()) { if (_event.getStatus() == ewol::keyEvent::statusDown) {
m_highSpeedMode = widget::SCROLL_INIT; m_highSpeedMode = widget::Scroll::speedModeInit;
m_highSpeedType = ewol::keyEvent::typeMouse; m_highSpeedType = ewol::keyEvent::typeMouse;
m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y()); m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y());
m_highSpeedButton = 2; m_highSpeedButton = 2;
return true; return true;
} }
} }
} else if (widget::SCROLL_DISABLE!=m_highSpeedMode && ewol::keyEvent::statusLeave == _event.getStatus()) { } else if ( m_highSpeedMode != widget::Scroll::speedModeDisable
m_highSpeedMode = widget::SCROLL_DISABLE; && _event.getStatus() == ewol::keyEvent::statusLeave) {
m_highSpeedMode = widget::Scroll::speedModeDisable;
m_highSpeedType = ewol::keyEvent::typeUnknow; m_highSpeedType = ewol::keyEvent::typeUnknow;
markToRedraw(); markToRedraw();
return true; return true;
} }
if (_event.getId() == m_highSpeedButton && widget::SCROLL_DISABLE!=m_highSpeedMode) { if ( _event.getId() == m_highSpeedButton
if (ewol::keyEvent::statusUp == _event.getStatus()) { && m_highSpeedMode != widget::Scroll::speedModeDisable) {
if (widget::SCROLL_INIT == m_highSpeedMode) { if (_event.getStatus() == ewol::keyEvent::statusUp) {
if (m_highSpeedMode == widget::Scroll::speedModeInit) {
// TODO : generate back the down event ... // TODO : generate back the down event ...
m_highSpeedMode = widget::SCROLL_DISABLE; m_highSpeedMode = widget::Scroll::speedModeDisable;
m_highSpeedType = ewol::keyEvent::typeUnknow; m_highSpeedType = ewol::keyEvent::typeUnknow;
return false; return false;
} else { } else {
m_highSpeedMode = widget::SCROLL_GREP_END_EVENT; m_highSpeedMode = widget::Scroll::speedModeGrepEndEvent;
markToRedraw(); markToRedraw();
return true; return true;
} }
} else if (widget::SCROLL_GREP_END_EVENT == m_highSpeedMode) { } else if (m_highSpeedMode == widget::Scroll::speedModeGrepEndEvent) {
if (ewol::keyEvent::statusSingle == _event.getStatus()) { if (_event.getStatus() == ewol::keyEvent::statusSingle) {
m_highSpeedMode = widget::SCROLL_DISABLE; m_highSpeedMode = widget::Scroll::speedModeDisable;
m_highSpeedType = ewol::keyEvent::typeUnknow; m_highSpeedType = ewol::keyEvent::typeUnknow;
m_highSpeedButton = -1; m_highSpeedButton = -1;
markToRedraw(); markToRedraw();
} }
return true; return true;
} else if (widget::SCROLL_INIT == m_highSpeedMode && ewol::keyEvent::statusMove == _event.getStatus()) { } else if ( m_highSpeedMode == widget::Scroll::speedModeInit
&& _event.getStatus() == ewol::keyEvent::statusMove) {
// wait that the cursor move more than 10 px to enable it : // wait that the cursor move more than 10 px to enable it :
if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10 if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10
|| abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) { || abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) {
// the scrooling can start : // the scrooling can start :
// select the direction : // select the direction :
if (relativePos.x() == m_highSpeedStartPos.x()) { if (relativePos.x() == m_highSpeedStartPos.x()) {
m_highSpeedMode = widget::SCROLL_ENABLE_VERTICAL; m_highSpeedMode = widget::Scroll::speedModeEnableVertical;
} else if (relativePos.y() == m_highSpeedStartPos.y()) { } else if (relativePos.y() == m_highSpeedStartPos.y()) {
m_highSpeedMode = widget::SCROLL_ENABLE_HORIZONTAL; m_highSpeedMode = widget::Scroll::speedModeEnableHorizontal;
} else { } else {
float coef = (relativePos.y() - m_highSpeedStartPos.y()) / (relativePos.x() - m_highSpeedStartPos.x()); float coef = (relativePos.y() - m_highSpeedStartPos.y()) / (relativePos.x() - m_highSpeedStartPos.x());
if (abs(coef) <= 1 ) { if (abs(coef) <= 1 ) {
m_highSpeedMode = widget::SCROLL_ENABLE_HORIZONTAL; m_highSpeedMode = widget::Scroll::speedModeEnableHorizontal;
} else { } else {
m_highSpeedMode = widget::SCROLL_ENABLE_VERTICAL; m_highSpeedMode = widget::Scroll::speedModeEnableVertical;
} }
} }
if (m_highSpeedMode == widget::SCROLL_ENABLE_HORIZONTAL) { if (m_highSpeedMode == widget::Scroll::speedModeEnableHorizontal) {
m_highSpeedStartPos.setX(m_originScrooled.x() / m_maxSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2)); m_highSpeedStartPos.setX(m_originScrooled.x() / m_maxSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2));
} else { } else {
m_highSpeedStartPos.setY(m_originScrooled.y() / m_maxSize.y() * (m_size.y()-SCROLL_BAR_SPACE*2)); m_highSpeedStartPos.setY(m_originScrooled.y() / m_maxSize.y() * (m_size.y()-SCROLL_BAR_SPACE*2));
@ -212,47 +218,53 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
} }
m_originScrooled.setY(etk_avg(0, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling))); m_originScrooled.setY(etk_avg(0, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling)));
return true; return true;
} if (widget::SCROLL_ENABLE_HORIZONTAL == m_highSpeedMode && ewol::keyEvent::statusMove == _event.getStatus()) { }
if ( m_highSpeedMode == widget::Scroll::speedModeEnableHorizontal
&& _event.getStatus() == ewol::keyEvent::statusMove) {
m_originScrooled.setX((int32_t)(m_maxSize.x() * (relativePos.x()-SCROLL_BAR_SPACE) / (m_size.x()-SCROLL_BAR_SPACE*2))); m_originScrooled.setX((int32_t)(m_maxSize.x() * (relativePos.x()-SCROLL_BAR_SPACE) / (m_size.x()-SCROLL_BAR_SPACE*2)));
m_originScrooled.setX(etk_avg(0, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling))); m_originScrooled.setX(etk_avg(0, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling)));
markToRedraw(); markToRedraw();
return true; return true;
} if (widget::SCROLL_ENABLE_VERTICAL == m_highSpeedMode && ewol::keyEvent::statusMove == _event.getStatus()) { }
if ( m_highSpeedMode == widget::Scroll::speedModeEnableVertical
&& _event.getStatus() == ewol::keyEvent::statusMove) {
m_originScrooled.setY((int32_t)(m_maxSize.y() * (relativePos.y()-SCROLL_BAR_SPACE) / (m_size.y()-SCROLL_BAR_SPACE*2))); m_originScrooled.setY((int32_t)(m_maxSize.y() * (relativePos.y()-SCROLL_BAR_SPACE) / (m_size.y()-SCROLL_BAR_SPACE*2)));
m_originScrooled.setY(etk_avg(0, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling))); m_originScrooled.setY(etk_avg(0, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling)));
markToRedraw(); markToRedraw();
return true; return true;
} }
} }
} else if( ewol::keyEvent::typeFinger == _event.getType() } else if ( _event.getType() == ewol::keyEvent::typeFinger
&& ( ewol::keyEvent::typeUnknow == m_highSpeedType && ( m_highSpeedType == ewol::keyEvent::typeUnknow
|| ewol::keyEvent::typeFinger == m_highSpeedType ) ) { || m_highSpeedType == ewol::keyEvent::typeFinger) ) {
if (1 == _event.getId()) { if (_event.getId() == 1) {
EWOL_VERBOSE("event 1 " << _event); EWOL_VERBOSE("event 1 " << _event);
if (ewol::keyEvent::statusDown == _event.getStatus()) { if (_event.getStatus() == ewol::keyEvent::statusDown) {
m_highSpeedMode = widget::SCROLL_INIT; m_highSpeedMode = widget::Scroll::speedModeInit;
m_highSpeedType = ewol::keyEvent::typeFinger; m_highSpeedType = ewol::keyEvent::typeFinger;
m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y()); m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y());
EWOL_DEBUG("SCROOL == > INIT"); EWOL_DEBUG("SCROOL == > INIT");
return true; return true;
} else if (ewol::keyEvent::statusUp == _event.getStatus()) { } else if (_event.getStatus() == ewol::keyEvent::statusUp) {
m_highSpeedMode = widget::SCROLL_DISABLE; m_highSpeedMode = widget::Scroll::speedModeDisable;
m_highSpeedType = ewol::keyEvent::typeUnknow; m_highSpeedType = ewol::keyEvent::typeUnknow;
EWOL_DEBUG("SCROOL == > DISABLE"); EWOL_DEBUG("SCROOL == > DISABLE");
markToRedraw(); markToRedraw();
return true; return true;
} else if (widget::SCROLL_INIT == m_highSpeedMode && ewol::keyEvent::statusMove == _event.getStatus()) { } else if ( m_highSpeedMode == widget::Scroll::speedModeInit
&& _event.getStatus() == ewol::keyEvent::statusMove) {
// wait that the cursor move more than 10 px to enable it : // wait that the cursor move more than 10 px to enable it :
if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10 if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10
|| abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) { || abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) {
// the scrooling can start : // the scrooling can start :
// select the direction : // select the direction :
m_highSpeedMode = widget::SCROLL_ENABLE_FINGER; m_highSpeedMode = widget::Scroll::speedModeEnableFinger;
EWOL_DEBUG("SCROOL == > ENABLE"); EWOL_DEBUG("SCROOL == > ENABLE");
markToRedraw(); markToRedraw();
} }
return true; return true;
} if (widget::SCROLL_ENABLE_FINGER == m_highSpeedMode && ewol::keyEvent::statusMove == _event.getStatus()) { } if ( m_highSpeedMode == widget::Scroll::speedModeEnableFinger
&& _event.getStatus() == ewol::keyEvent::statusMove) {
//m_originScrooled.x = (int32_t)(m_maxSize.x * x / m_size.x); //m_originScrooled.x = (int32_t)(m_maxSize.x * x / m_size.x);
m_originScrooled.setX(m_originScrooled.x() - (relativePos.x() - m_highSpeedStartPos.x())); m_originScrooled.setX(m_originScrooled.x() - (relativePos.x() - m_highSpeedStartPos.x()));
m_originScrooled.setY(m_originScrooled.y() - (relativePos.y() - m_highSpeedStartPos.y())); m_originScrooled.setY(m_originScrooled.y() - (relativePos.y() - m_highSpeedStartPos.y()));
@ -263,21 +275,23 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
markToRedraw(); markToRedraw();
return true; return true;
} }
} else if (widget::SCROLL_DISABLE!=m_highSpeedMode && ewol::keyEvent::statusLeave == _event.getStatus()) { } else if ( m_highSpeedMode == widget::Scroll::speedModeDisable
m_highSpeedMode = widget::SCROLL_DISABLE; && _event.getStatus() == ewol::keyEvent::statusLeave) {
m_highSpeedMode = widget::Scroll::speedModeDisable;
m_highSpeedType = ewol::keyEvent::typeUnknow; m_highSpeedType = ewol::keyEvent::typeUnknow;
EWOL_DEBUG("SCROOL == > DISABLE"); EWOL_DEBUG("SCROOL == > DISABLE");
markToRedraw(); markToRedraw();
return true; return true;
} }
} }
} else if (SCROLL_MODE_CENTER == m_scroollingMode) { } else if (m_scroollingMode == scroolModeCenter) {
if (ewol::keyEvent::typeMouse == _event.getType()) { if (_event.getType() == ewol::keyEvent::typeMouse) {
float tmp1=m_size.x() / m_maxSize.y(); float tmp1=m_size.x() / m_maxSize.y();
float tmp2=m_size.y() / m_maxSize.x(); float tmp2=m_size.y() / m_maxSize.x();
//EWOL_INFO(" elements Zoom : " << tmp1 << " " << tmp2); //EWOL_INFO(" elements Zoom : " << tmp1 << " " << tmp2);
tmp1 = etk_min(tmp1, tmp2); tmp1 = etk_min(tmp1, tmp2);
if (4 == _event.getId() && ewol::keyEvent::statusUp == _event.getStatus()) { if ( _event.getId() == 4
&& _event.getStatus() == ewol::keyEvent::statusUp) {
m_zoom -= 0.1; m_zoom -= 0.1;
if (tmp1 < 1.0) { if (tmp1 < 1.0) {
m_zoom = etk_max(tmp1, m_zoom); m_zoom = etk_max(tmp1, m_zoom);
@ -286,7 +300,8 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
} }
markToRedraw(); markToRedraw();
return true; return true;
} else if (5 == _event.getId() && ewol::keyEvent::statusUp == _event.getStatus()) { } else if ( _event.getId() == 5
&& _event.getStatus() == ewol::keyEvent::statusUp) {
m_zoom += 0.1; m_zoom += 0.1;
if (tmp1 > 1.0) { if (tmp1 > 1.0) {
m_zoom = etk_min(tmp1, m_zoom); m_zoom = etk_min(tmp1, m_zoom);
@ -297,7 +312,7 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
return true; return true;
} }
} }
} else if (SCROLL_MODE_GAME == m_scroollingMode) { } else if (m_scroollingMode == scroolModeGame) {
} else { } else {
EWOL_ERROR("Scrolling mode unknow ... " << m_scroollingMode ); EWOL_ERROR("Scrolling mode unknow ... " << m_scroollingMode );
@ -335,7 +350,7 @@ void widget::WidgetScrooled::onDraw(void) {
void widget::WidgetScrooled::systemDraw(const ewol::DrawProperty& _displayProp) { void widget::WidgetScrooled::systemDraw(const ewol::DrawProperty& _displayProp) {
ewol::openGL::push(); ewol::openGL::push();
if (SCROLL_MODE_CENTER == m_scroollingMode) { if (m_scroollingMode == scroolModeCenter) {
// here we invert the reference of the standard openGl view because the reference in the common display is Top left and not buttom left // here we invert the reference of the standard openGl view because the reference in the common display is Top left and not buttom left
glViewport( m_origin.x(), glViewport( m_origin.x(),
m_origin.y(), m_origin.y(),
@ -349,7 +364,7 @@ void widget::WidgetScrooled::systemDraw(const ewol::DrawProperty& _displayProp)
ewol::openGL::setMatrix(tmpMat); ewol::openGL::setMatrix(tmpMat);
// Call the widget drawing methode // Call the widget drawing methode
onDraw(); onDraw();
} if (SCROLL_MODE_GAME == m_scroollingMode) { } if (m_scroollingMode == scroolModeGame) {
// here we invert the reference of the standard openGl view because the reference in the common display is Top left and not buttom left // here we invert the reference of the standard openGl view because the reference in the common display is Top left and not buttom left
glViewport( m_origin.x(), glViewport( m_origin.x(),
m_origin.y(), m_origin.y(),
@ -392,9 +407,9 @@ void widget::WidgetScrooled::setScrollingPositionDynamic(vec2 _borderWidth, vec2
} }
} }
void widget::WidgetScrooled::scroolingMode(scrollingMode_te _newMode) { void widget::WidgetScrooled::scroolingMode(enum scrollingMode _newMode) {
m_scroollingMode = _newMode; m_scroollingMode = _newMode;
if (SCROLL_MODE_GAME == m_scroollingMode) { if (m_scroollingMode == scroolModeGame) {
// set the scene maximum size : // set the scene maximum size :
m_maxSize.setValue(etk_max(m_size.x(), m_size.y()), m_maxSize.setValue(etk_max(m_size.x(), m_size.y()),
m_maxSize.x()); m_maxSize.x());

View File

@ -16,15 +16,16 @@
#include <ewol/compositing/Compositing.h> #include <ewol/compositing/Compositing.h>
namespace widget { namespace widget {
typedef enum {
SCROLL_MODE_NORMAL, //!< No Zoom , can UP and down, left and right
SCROLL_MODE_CENTER, //!< Zoom enable, no move left and right
SCROLL_MODE_GAME, //!< Zoom enable, no move left and right
} scrollingMode_te;
/** /**
* @ingroup ewolWidgetGroup * @ingroup ewolWidgetGroup
*/ */
class WidgetScrooled : public ewol::Widget { class WidgetScrooled : public ewol::Widget {
public:
enum scrollingMode {
scroolModeNormal, //!< No Zoom , can UP and down, left and right
scroolModeCenter, //!< Zoom enable, no move left and right
scroolModeGame, //!< Zoom enable, no move left and right
};
private: private:
etk::Vector<ewol::Compositing*> m_listOObject; //!< generic element to display... etk::Vector<ewol::Compositing*> m_listOObject; //!< generic element to display...
void addOObject(ewol::Compositing* _newObject, int32_t _pos=-1); void addOObject(ewol::Compositing* _newObject, int32_t _pos=-1);
@ -34,12 +35,12 @@ namespace widget {
vec2 m_maxSize; vec2 m_maxSize;
float m_limitScrolling; float m_limitScrolling;
private: private:
scrollingMode_te m_scroollingMode; //!< mode of management of the scrooling enum scrollingMode m_scroollingMode; //!< mode of management of the scrooling
float m_pixelScrolling; float m_pixelScrolling;
vec2 m_highSpeedStartPos; vec2 m_highSpeedStartPos;
highSpeedMode_te m_highSpeedMode; enum Scroll::highSpeedMode m_highSpeedMode;
int32_t m_highSpeedButton; int32_t m_highSpeedButton;
ewol::keyEvent::type_te m_highSpeedType; enum ewol::keyEvent::type m_highSpeedType;
public: public:
WidgetScrooled(void); WidgetScrooled(void);
virtual ~WidgetScrooled(void); virtual ~WidgetScrooled(void);
@ -64,7 +65,7 @@ namespace widget {
* @brief Specify the mode of scrolling for this windows * @brief Specify the mode of scrolling for this windows
* @param[in] _newMode the selected mode for the scrolling... * @param[in] _newMode the selected mode for the scrolling...
*/ */
void scroolingMode(scrollingMode_te _newMode); void scroolingMode(enum scrollingMode _newMode);
/** /**
* @brief set the specific mawimum size of the widget * @brief set the specific mawimum size of the widget
* @param[in] _localSize new Maximum size * @param[in] _localSize new Maximum size

View File

@ -18,7 +18,7 @@ namespace ewol {
/** /**
* @ingroup ewolWidgetGroup * @ingroup ewolWidgetGroup
*/ */
class Windows :public ewol::Widget { class Windows : public ewol::Widget {
public: public:
Windows(void); Windows(void);
virtual ~Windows(void); virtual ~Windows(void);