[DEV] change enum naming
This commit is contained in:
parent
fa21a34b0a
commit
ff1f2692de
2
external/egami
vendored
2
external/egami
vendored
@ -1 +1 @@
|
||||
Subproject commit 9ead15a4d1cb533db919dfe5f6638dae7f788479
|
||||
Subproject commit 59738fd521534c9f71146513905b42ad56407fed
|
2
external/ejson
vendored
2
external/ejson
vendored
@ -1 +1 @@
|
||||
Subproject commit 9644468f6eef81d635adafcf6396a02189a49521
|
||||
Subproject commit a94a1c6e600fcbbfe706cda6cc7e4e2c939c8f09
|
2
external/etk
vendored
2
external/etk
vendored
@ -1 +1 @@
|
||||
Subproject commit 8806c4e44ff918b1be25e1bd8958512e11ffe27e
|
||||
Subproject commit 51606313ab962db03eb0642be06e52ef70e6e6d8
|
2
external/exml
vendored
2
external/exml
vendored
@ -1 +1 @@
|
||||
Subproject commit 5009e90a1e66a91b97a579e4be8409eb738bb4e6
|
||||
Subproject commit c9f7abcd96f2decebe4968fe10071c6e861a4d85
|
@ -49,7 +49,7 @@ void ewol::dimension::unInit(void) {
|
||||
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_INFO("Set a new screen ratio for the screen : ratio=" << _ratio << " type=" << _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");
|
||||
}
|
||||
|
||||
vec2 ewol::dimension::getWindowsSize(ewol::Dimension::distance_te _type) {
|
||||
vec2 ewol::dimension::getWindowsSize(enum ewol::Dimension::distance _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);
|
||||
return size.length();
|
||||
}
|
||||
@ -79,7 +79,7 @@ ewol::Dimension::Dimension(void) :
|
||||
// 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_type(ewol::Dimension::Pixel) {
|
||||
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) {
|
||||
m_data.setValue(0,0);
|
||||
m_type = ewol::Dimension::Pixel;
|
||||
distance_te type = ewol::Dimension::Pixel;
|
||||
enum distance type = ewol::Dimension::Pixel;
|
||||
if (_config.endWith("%",false) == true) {
|
||||
type = ewol::Dimension::Pourcent;
|
||||
_config.remove(_config.size()-1, 1);
|
||||
@ -159,7 +159,7 @@ ewol::Dimension::operator etk::UString(void) const {
|
||||
return str;
|
||||
}
|
||||
|
||||
vec2 ewol::Dimension::get(ewol::Dimension::distance_te _type) const {
|
||||
vec2 ewol::Dimension::get(enum ewol::Dimension::distance _type) const {
|
||||
switch(_type) {
|
||||
case ewol::Dimension::Pourcent:
|
||||
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 :
|
||||
vec2 size(etk_avg(0.0f,_size.x(),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;
|
||||
}
|
||||
|
||||
etk::CCout& ewol::operator <<(etk::CCout &os, const ewol::Dimension::distance_te& obj) {
|
||||
switch(obj) {
|
||||
etk::CCout& ewol::operator <<(etk::CCout& _os, enum ewol::Dimension::distance _obj) {
|
||||
switch(_obj) {
|
||||
case ewol::Dimension::Pourcent:
|
||||
os << "%";
|
||||
_os << "%";
|
||||
break;
|
||||
case ewol::Dimension::Pixel:
|
||||
os << "px";
|
||||
_os << "px";
|
||||
break;
|
||||
case ewol::Dimension::Meter:
|
||||
os << "m";
|
||||
_os << "m";
|
||||
break;
|
||||
case ewol::Dimension::Centimeter:
|
||||
os << "cm";
|
||||
_os << "cm";
|
||||
break;
|
||||
case ewol::Dimension::Millimeter:
|
||||
os << "mm";
|
||||
_os << "mm";
|
||||
break;
|
||||
case ewol::Dimension::Kilometer:
|
||||
os << "km";
|
||||
_os << "km";
|
||||
break;
|
||||
case ewol::Dimension::Inch:
|
||||
os << "in";
|
||||
_os << "in";
|
||||
break;
|
||||
case ewol::Dimension::foot:
|
||||
os << "ft";
|
||||
_os << "ft";
|
||||
break;
|
||||
}
|
||||
return os;
|
||||
return _os;
|
||||
}
|
||||
|
||||
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::Dimension& _obj) {
|
||||
|
@ -20,7 +20,7 @@ namespace ewol {
|
||||
*/
|
||||
class Dimension {
|
||||
public:
|
||||
typedef enum {
|
||||
enum distance {
|
||||
Pourcent=0,
|
||||
Pixel,
|
||||
Meter,
|
||||
@ -29,10 +29,10 @@ namespace ewol {
|
||||
Kilometer,
|
||||
Inch,
|
||||
foot,
|
||||
} distance_te;
|
||||
};
|
||||
private:
|
||||
vec2 m_data;
|
||||
distance_te m_type;
|
||||
enum distance m_type;
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor (default :0,0 mode pixel)
|
||||
@ -43,17 +43,25 @@ namespace ewol {
|
||||
* @param[in] _size Requested 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
|
||||
* @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
|
||||
* @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
|
||||
*/
|
||||
@ -69,13 +77,13 @@ namespace ewol {
|
||||
* @param[in] _type Type of unit 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
|
||||
* @param[in] _size Dimention to set
|
||||
* @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:
|
||||
/**
|
||||
@ -158,9 +166,11 @@ namespace ewol {
|
||||
* @breif get the dimension 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);
|
||||
|
||||
namespace dimension {
|
||||
@ -179,7 +189,7 @@ namespace ewol {
|
||||
* @param[in] type Unit type requested.
|
||||
* @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
|
||||
* @param[in] size size of the current windows in pixel.
|
||||
@ -190,13 +200,13 @@ namespace ewol {
|
||||
* @param[in] type Unit type requested.
|
||||
* @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
|
||||
* @param[in] type Unit type requested.
|
||||
* @return the requested size
|
||||
*/
|
||||
float getWindowsDiag(ewol::Dimension::distance_te _type);
|
||||
float getWindowsDiag(enum ewol::Dimension::distance _type);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -41,7 +41,7 @@ static const char* clipboardDescriptionString[ewol::clipBoard::clipboardCount+1]
|
||||
"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) {
|
||||
_os << clipboardDescriptionString[_obj];
|
||||
} 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
|
||||
if(0 == _data.size()) {
|
||||
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) {
|
||||
EWOL_WARNING("request ClickBoard id error");
|
||||
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) {
|
||||
EWOL_WARNING("request ClickBoard id error");
|
||||
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("");
|
||||
if(_clipboardID >= ewol::clipBoard::clipboardCount) {
|
||||
EWOL_WARNING("request ClickBoard id error");
|
||||
|
@ -16,7 +16,7 @@
|
||||
namespace ewol {
|
||||
namespace clipBoard
|
||||
{
|
||||
typedef enum {
|
||||
enum clipboardListe {
|
||||
clipboard0, //!< internal clipboard 0
|
||||
clipboard1, //!< internal clipboard 1
|
||||
clipboard2, //!< internal clipboard 2
|
||||
@ -30,19 +30,19 @@ namespace ewol {
|
||||
clipboardStd, //!< External clipboard represent the Copy/Cut/Past buffer
|
||||
clipboardSelection, //!< External or internal clipboard depending on the OS, represent the middle button
|
||||
clipboardCount, //!< Total number of clipboard
|
||||
} clipboardListe_te;
|
||||
};
|
||||
|
||||
/**
|
||||
* @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
|
||||
* @param[in] _clipboardID Select the specific ID of 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.
|
||||
* @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
|
||||
* @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
|
||||
* Gui abstraction to set the buffer we receive. The end user must not use it.
|
||||
* @param[in] _clipboardID selected clipboard ID
|
||||
* @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
|
||||
* 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
|
||||
* @return the requested buffer
|
||||
*/
|
||||
const etk::UString& get(ewol::clipBoard::clipboardListe_te _clipboardID);
|
||||
const etk::UString& get(enum ewol::clipBoard::clipboardListe _clipboardID);
|
||||
|
||||
// internal section
|
||||
|
||||
|
@ -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) {
|
||||
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;
|
||||
}
|
||||
|
||||
@ -864,7 +864,7 @@ void ewol::Text::forceLineReturn(void) {
|
||||
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_stopTextPos = _stopTextPos+1;
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace ewol {
|
||||
public:
|
||||
etk::Color<> m_colorBg; //!< display background 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) {
|
||||
m_colorBg = etk::color::blue;
|
||||
m_colorBg = etk::color::green;
|
||||
@ -36,13 +36,13 @@ namespace ewol {
|
||||
|
||||
class Text : public ewol::Compositing {
|
||||
public:
|
||||
typedef enum {
|
||||
enum aligneMode {
|
||||
alignDisable,
|
||||
alignRight,
|
||||
alignLeft,
|
||||
alignCenter,
|
||||
alignJustify
|
||||
} aligneMode_te;
|
||||
};
|
||||
private:
|
||||
ewol::Drawing m_vectorialDraw; //!< This is used to draw background selection and other things ...
|
||||
public:
|
||||
@ -64,14 +64,14 @@ namespace ewol {
|
||||
etk::Color<> m_colorCursor; //!< The text cursor color
|
||||
etk::Color<> m_colorSelection; //!< The text Selection color
|
||||
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_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
|
||||
private:
|
||||
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)
|
||||
aligneMode_te m_alignement; //!< Current Alignement mode (justify/left/right ...)
|
||||
enum aligneMode m_alignement; //!< Current Alignement mode (justify/left/right ...)
|
||||
private:
|
||||
ewol::Program* m_GLprogram; //!< pointer on the opengl display program
|
||||
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
|
||||
* @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
|
||||
* @return The font mode applied
|
||||
*/
|
||||
ewol::font::mode_te getFontMode(void);
|
||||
enum ewol::font::mode getFontMode(void);
|
||||
/**
|
||||
* @brief enable or disable the bold mode
|
||||
* @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.
|
||||
* @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
|
||||
*/
|
||||
@ -334,7 +334,7 @@ namespace ewol {
|
||||
* @brief get the current alignement property
|
||||
* @return the curent alignement type
|
||||
*/
|
||||
ewol::Text::aligneMode_te getAlignement(void);
|
||||
enum ewol::Text::aligneMode getAlignement(void);
|
||||
/**
|
||||
* @brief calculate a theoric text size
|
||||
* @param[in] _text The string to calculate dimention.
|
||||
|
@ -33,7 +33,7 @@ static const char* cursorDescriptionString[ewol::cursorCount+1] = {
|
||||
"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) {
|
||||
_os << cursorDescriptionString[_obj];
|
||||
} else {
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <etk/Stream.h>
|
||||
namespace ewol
|
||||
{
|
||||
typedef enum {
|
||||
enum cursorDisplay {
|
||||
cursorArrow, // this is the normal arrow ...
|
||||
cursorLeftArrow,
|
||||
cursorInfo,
|
||||
@ -37,11 +37,11 @@ namespace ewol
|
||||
cursorNone,
|
||||
// just for the count:
|
||||
cursorCount
|
||||
} cursorDisplay_te;
|
||||
};
|
||||
/**
|
||||
* @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
|
||||
|
@ -25,7 +25,7 @@ static const char* statusDescriptionString[ewol::keyEvent::statusCount+1] = {
|
||||
"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) {
|
||||
_os << statusDescriptionString[_obj];
|
||||
} else {
|
||||
@ -76,7 +76,7 @@ static const char* keyboardDescriptionString[ewol::keyEvent::keyboardCount+1] =
|
||||
"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) {
|
||||
_os << keyboardDescriptionString[_obj];
|
||||
} else {
|
||||
@ -93,7 +93,7 @@ static const char* typeDescriptionString[ewol::keyEvent::typeCount+1] = {
|
||||
"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) {
|
||||
_os << typeDescriptionString[_obj];
|
||||
} else {
|
||||
|
@ -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
|
||||
*/
|
||||
typedef enum {
|
||||
enum type {
|
||||
typeUnknow = 0, //!< Unknow input Type
|
||||
typeMouse, //!< Mouse type
|
||||
typeFinger, //!< Finger type
|
||||
typeStylet, //!< Stylet type
|
||||
typeCount //!< number of types
|
||||
} type_te;
|
||||
};
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
typedef enum {
|
||||
enum status {
|
||||
statusUnknow = 0,
|
||||
statusDown, // availlable on Keyboard too
|
||||
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)
|
||||
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
|
||||
} status_te;
|
||||
};
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
typedef enum {
|
||||
enum keyboard {
|
||||
keyboardUnknow = 0, //!< Unknown keyboard key
|
||||
keyboardChar, //!< Char input is arrived ...
|
||||
keyboardLeft, //!< Left key <--
|
||||
@ -93,11 +93,11 @@ namespace ewol {
|
||||
keyboardContextMenu, //!< Contextual menu key.
|
||||
keyboardNumLock, //!< Numerical Lock key.
|
||||
keyboardCount //!< number of posible key
|
||||
} keyboard_te;
|
||||
};
|
||||
/**
|
||||
* @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);
|
||||
|
||||
};
|
||||
|
||||
|
@ -22,14 +22,22 @@ namespace ewol {
|
||||
virtual bool parse(const char* _line);
|
||||
virtual void display(void) {};
|
||||
public:
|
||||
virtual type_te getType(void) { return ewol::PhysicsShape::box; };
|
||||
virtual enum type getType(void) {
|
||||
return ewol::PhysicsShape::box;
|
||||
};
|
||||
private:
|
||||
vec3 m_size; // Box size property in X, Y and Z
|
||||
public:
|
||||
const vec3& getSize(void) const { return m_size; };
|
||||
const vec3& getSize(void) const {
|
||||
return m_size;
|
||||
};
|
||||
public:
|
||||
virtual const PhysicsBox* toBox(void) const { return this; };
|
||||
virtual PhysicsBox* toBox(void) { return this; };
|
||||
virtual const PhysicsBox* toBox(void) const {
|
||||
return this;
|
||||
};
|
||||
virtual PhysicsBox* toBox(void) {
|
||||
return this;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -23,18 +23,28 @@ namespace ewol {
|
||||
virtual bool parse(const char* _line);
|
||||
virtual void display(void) {};
|
||||
public:
|
||||
virtual type_te getType(void) { return ewol::PhysicsShape::capsule; };
|
||||
virtual enum type getType(void) {
|
||||
return ewol::PhysicsShape::capsule;
|
||||
};
|
||||
private:
|
||||
float m_radius;
|
||||
public:
|
||||
float getRadius(void) const { return m_radius; };
|
||||
float getRadius(void) const {
|
||||
return m_radius;
|
||||
};
|
||||
private:
|
||||
float m_height;
|
||||
public:
|
||||
float getHeight(void) const { return m_height; };
|
||||
float getHeight(void) const {
|
||||
return m_height;
|
||||
};
|
||||
public:
|
||||
virtual const PhysicsCapsule* toCapsule(void) const { return this; };
|
||||
virtual PhysicsCapsule* toCapsule(void) { return this; };
|
||||
virtual const PhysicsCapsule* toCapsule(void) const {
|
||||
return this;
|
||||
};
|
||||
virtual PhysicsCapsule* toCapsule(void) {
|
||||
return this;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -23,18 +23,28 @@ namespace ewol {
|
||||
virtual bool parse(const char* _line);
|
||||
virtual void display(void) {};
|
||||
public:
|
||||
virtual type_te getType(void) { return ewol::PhysicsShape::cone; };
|
||||
virtual enum type getType(void) {
|
||||
return ewol::PhysicsShape::cone;
|
||||
};
|
||||
private:
|
||||
float m_radius;
|
||||
public:
|
||||
float getRadius(void) const { return m_radius; };
|
||||
float getRadius(void) const {
|
||||
return m_radius;
|
||||
};
|
||||
private:
|
||||
float m_height;
|
||||
public:
|
||||
float getHeight(void) const { return m_height; };
|
||||
float getHeight(void) const {
|
||||
return m_height;
|
||||
};
|
||||
public:
|
||||
virtual const PhysicsCone* toCone(void) const { return this; };
|
||||
virtual PhysicsCone* toCone(void) { return this; };
|
||||
virtual const PhysicsCone* toCone(void) const {
|
||||
return this;
|
||||
};
|
||||
virtual PhysicsCone* toCone(void) {
|
||||
return this;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -23,18 +23,28 @@ namespace ewol {
|
||||
virtual bool parse(const char* _line);
|
||||
virtual void display(void) {};
|
||||
public:
|
||||
virtual type_te getType(void) { return ewol::PhysicsShape::convexHull; };
|
||||
virtual enum type getType(void) {
|
||||
return ewol::PhysicsShape::convexHull;
|
||||
};
|
||||
private:
|
||||
vec3 m_scale;
|
||||
public:
|
||||
vec3 getScale(void) const { return m_scale; };
|
||||
vec3 getScale(void) const {
|
||||
return m_scale;
|
||||
};
|
||||
private:
|
||||
etk::Vector<vec3> m_points;
|
||||
public:
|
||||
const etk::Vector<vec3>& getPointList(void) const { return m_points; };
|
||||
const etk::Vector<vec3>& getPointList(void) const {
|
||||
return m_points;
|
||||
};
|
||||
public:
|
||||
virtual const PhysicsConvexHull* toConvexHull(void) const { return this; };
|
||||
virtual PhysicsConvexHull* toConvexHull(void) { return this; };
|
||||
virtual const PhysicsConvexHull* toConvexHull(void) const {
|
||||
return this;
|
||||
};
|
||||
virtual PhysicsConvexHull* toConvexHull(void) {
|
||||
return this;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -23,14 +23,22 @@ namespace ewol {
|
||||
virtual bool parse(const char* _line);
|
||||
virtual void display(void) {};
|
||||
public:
|
||||
virtual type_te getType(void) { return ewol::PhysicsShape::cylinder; };
|
||||
virtual enum type getType(void) {
|
||||
return ewol::PhysicsShape::cylinder;
|
||||
};
|
||||
private:
|
||||
vec3 m_size;
|
||||
public:
|
||||
vec3 getSize(void) const { return m_size; };
|
||||
vec3 getSize(void) const {
|
||||
return m_size;
|
||||
};
|
||||
public:
|
||||
virtual const PhysicsCylinder* toCylinder(void) const { return this; };
|
||||
virtual PhysicsCylinder* toCylinder(void) { return this; };
|
||||
virtual const PhysicsCylinder* toCylinder(void) const {
|
||||
return this;
|
||||
};
|
||||
virtual PhysicsCylinder* toCylinder(void) {
|
||||
return this;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace ewol {
|
||||
public:
|
||||
static PhysicsShape* create(const etk::UString& _name);
|
||||
public:
|
||||
typedef enum {
|
||||
enum type {
|
||||
unknow,
|
||||
box,
|
||||
capsule,
|
||||
@ -36,50 +36,97 @@ namespace ewol {
|
||||
convexHull,
|
||||
cylinder,
|
||||
sphere
|
||||
} type_te;
|
||||
};
|
||||
public:
|
||||
PhysicsShape(void) : m_quaternion(1,0,0,0), m_origin(0,0,0) {};
|
||||
virtual ~PhysicsShape(void) {};
|
||||
PhysicsShape(void) : m_quaternion(1,0,0,0), m_origin(0,0,0) {
|
||||
|
||||
};
|
||||
virtual ~PhysicsShape(void) {
|
||||
|
||||
};
|
||||
public:
|
||||
virtual type_te getType(void) { return ewol::PhysicsShape::unknow; };
|
||||
virtual enum type getType(void) {
|
||||
return ewol::PhysicsShape::unknow;
|
||||
};
|
||||
|
||||
public:
|
||||
virtual bool parse(const char* _line);
|
||||
virtual void display(void) {};
|
||||
virtual void display(void) {
|
||||
|
||||
};
|
||||
private:
|
||||
vec4 m_quaternion;
|
||||
public:
|
||||
vec4 getQuaternion(void) const { return m_quaternion; };
|
||||
const vec4& getQuaternion(void) const {
|
||||
return m_quaternion;
|
||||
};
|
||||
private:
|
||||
vec3 m_origin;
|
||||
public:
|
||||
vec3 getOrigin(void) const { return m_origin; };
|
||||
const vec3& getOrigin(void) const {
|
||||
return m_origin;
|
||||
};
|
||||
public:
|
||||
bool isBox(void) { return getType() == ewol::PhysicsShape::box; };
|
||||
bool isCylinder(void) { return getType() == ewol::PhysicsShape::cylinder; };
|
||||
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; };
|
||||
bool isBox(void) {
|
||||
return getType() == ewol::PhysicsShape::box;
|
||||
};
|
||||
bool isCylinder(void) {
|
||||
return getType() == ewol::PhysicsShape::cylinder;
|
||||
};
|
||||
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 PhysicsBox* toBox(void) { return NULL; };
|
||||
virtual const PhysicsBox* toBox(void) const {
|
||||
return NULL;
|
||||
};
|
||||
virtual PhysicsBox* toBox(void) {
|
||||
return NULL;
|
||||
};
|
||||
|
||||
virtual const PhysicsCylinder* toCylinder(void) const { return NULL; };
|
||||
virtual PhysicsCylinder* toCylinder(void) { return NULL; };
|
||||
virtual const PhysicsCylinder* toCylinder(void) const {
|
||||
return NULL;
|
||||
};
|
||||
virtual PhysicsCylinder* toCylinder(void) {
|
||||
return NULL;
|
||||
};
|
||||
|
||||
virtual const PhysicsCapsule* toCapsule(void) const { return NULL; };
|
||||
virtual PhysicsCapsule* toCapsule(void) { return NULL; };
|
||||
virtual const PhysicsCapsule* toCapsule(void) const {
|
||||
return NULL;
|
||||
};
|
||||
virtual PhysicsCapsule* toCapsule(void) {
|
||||
return NULL;
|
||||
};
|
||||
|
||||
virtual const PhysicsCone* toCone(void) const { return NULL; };
|
||||
virtual PhysicsCone* toCone(void) { return NULL; };
|
||||
virtual const PhysicsCone* toCone(void) const {
|
||||
return NULL;
|
||||
};
|
||||
virtual PhysicsCone* toCone(void) {
|
||||
return NULL;
|
||||
};
|
||||
|
||||
virtual const PhysicsConvexHull* toConvexHull(void) const { return NULL; };
|
||||
virtual PhysicsConvexHull* toConvexHull(void) { return NULL; };
|
||||
|
||||
virtual const PhysicsSphere* toSphere(void) const { return NULL; };
|
||||
virtual PhysicsSphere* toSphere(void) { return NULL; };
|
||||
virtual const PhysicsConvexHull* toConvexHull(void) const {
|
||||
return NULL;
|
||||
};
|
||||
virtual PhysicsConvexHull* toConvexHull(void) {
|
||||
return NULL;
|
||||
};
|
||||
|
||||
virtual const PhysicsSphere* toSphere(void) const {
|
||||
return NULL;
|
||||
};
|
||||
virtual PhysicsSphere* toSphere(void) {
|
||||
return NULL;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -23,14 +23,20 @@ namespace ewol {
|
||||
virtual bool parse(const char* _line);
|
||||
virtual void display(void) {};
|
||||
public:
|
||||
virtual type_te getType(void) { return ewol::PhysicsShape::sphere; };
|
||||
virtual enum type getType(void) {
|
||||
return ewol::PhysicsShape::sphere;
|
||||
};
|
||||
private:
|
||||
float m_radius; // props["radius"] = obj.scale.x
|
||||
public:
|
||||
float getRadius(void) const { return m_radius; };
|
||||
private:
|
||||
virtual const PhysicsSphere* toSphere(void) const { return this; };
|
||||
virtual PhysicsSphere* toSphere(void) { return this; };
|
||||
virtual const PhysicsSphere* toSphere(void) const {
|
||||
return this;
|
||||
};
|
||||
virtual PhysicsSphere* toSphere(void) {
|
||||
return this;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -42,13 +42,13 @@ void java_check_exception(JNIEnv* _env) {
|
||||
|
||||
class AndroidContext : public ewol::eContext {
|
||||
public:
|
||||
typedef enum {
|
||||
enum application {
|
||||
appl_unknow,
|
||||
appl_application,
|
||||
appl_wallpaper
|
||||
} application_te;
|
||||
};
|
||||
private:
|
||||
application_te m_javaApplicationType;
|
||||
enum application m_javaApplicationType;
|
||||
// get a resources from the java environement :
|
||||
JNIEnv* m_JavaVirtualMachinePointer; //!< the JVM
|
||||
jclass m_javaClassEwol; //!< main activity class (android ...)
|
||||
@ -75,7 +75,7 @@ class AndroidContext : public ewol::eContext {
|
||||
return true;
|
||||
}
|
||||
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_JavaVirtualMachinePointer(NULL),
|
||||
m_javaClassEwol(0),
|
||||
@ -200,7 +200,7 @@ class AndroidContext : public ewol::eContext {
|
||||
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
|
||||
// TODO : remove this 2 line when code will be writen
|
||||
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) {
|
||||
case ewol::clipBoard::clipboardSelection:
|
||||
// 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
|
||||
void forceOrientation(ewol::orientation_te _orientation) {
|
||||
void forceOrientation(enum ewol::orientation _orientation) {
|
||||
#ifndef __ANDROID_PERMISSION__SET_ORIENTATION__
|
||||
EWOL_ERROR("C->java : call set orientation without Allow application to do it ... Break...");
|
||||
return;
|
||||
|
@ -15,13 +15,13 @@
|
||||
namespace ewol {
|
||||
class EventEntry {
|
||||
private:
|
||||
ewol::keyEvent::keyboard_te m_type; //!< type of hardware event
|
||||
ewol::keyEvent::status_te m_status; //!< status of hardware event
|
||||
enum ewol::keyEvent::keyboard m_type; //!< type of hardware event
|
||||
enum ewol::keyEvent::status m_status; //!< status of hardware event
|
||||
ewol::SpecialKey m_specialKey; //!< input key status (prevent change in time..)
|
||||
etk::UChar m_unicodeData; //!< Unicode data (in some case)
|
||||
public:
|
||||
EventEntry(ewol::keyEvent::keyboard_te _type,
|
||||
ewol::keyEvent::status_te _status,
|
||||
EventEntry(enum ewol::keyEvent::keyboard _type,
|
||||
enum ewol::keyEvent::status _status,
|
||||
ewol::SpecialKey _specialKey,
|
||||
etk::UChar _char) :
|
||||
m_type(_type),
|
||||
@ -29,16 +29,16 @@ namespace ewol {
|
||||
m_specialKey(_specialKey),
|
||||
m_unicodeData(_char)
|
||||
{ };
|
||||
void setType(ewol::keyEvent::keyboard_te _type) {
|
||||
void setType(enum ewol::keyEvent::keyboard _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;
|
||||
};
|
||||
void setStatus(ewol::keyEvent::status_te _status) {
|
||||
void setStatus(enum ewol::keyEvent::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;
|
||||
};
|
||||
void setSpecialKey(const ewol::SpecialKey& _specialKey) {
|
||||
@ -58,8 +58,8 @@ namespace ewol {
|
||||
|
||||
class EventEntrySystem {
|
||||
public:
|
||||
EventEntrySystem(ewol::keyEvent::keyboard_te _type,
|
||||
ewol::keyEvent::status_te _status,
|
||||
EventEntrySystem(enum ewol::keyEvent::keyboard _type,
|
||||
enum ewol::keyEvent::status _status,
|
||||
ewol::SpecialKey _specialKey,
|
||||
etk::UChar _char) :
|
||||
m_event(_type, _status, _specialKey, _char)
|
||||
|
@ -14,13 +14,13 @@
|
||||
namespace ewol {
|
||||
class EventInput {
|
||||
private:
|
||||
ewol::keyEvent::type_te m_type;
|
||||
ewol::keyEvent::status_te m_status;
|
||||
enum ewol::keyEvent::type m_type;
|
||||
enum ewol::keyEvent::status m_status;
|
||||
uint8_t m_inputId;
|
||||
vec2 m_pos;
|
||||
public:
|
||||
EventInput(ewol::keyEvent::type_te _type,
|
||||
ewol::keyEvent::status_te _status,
|
||||
EventInput(enum ewol::keyEvent::type _type,
|
||||
enum ewol::keyEvent::status _status,
|
||||
uint8_t _id,
|
||||
const vec2& _pos):
|
||||
m_type(_type),
|
||||
@ -28,16 +28,16 @@ namespace ewol {
|
||||
m_inputId(_id),
|
||||
m_pos(_pos)
|
||||
{ };
|
||||
void setType(ewol::keyEvent::type_te _type) {
|
||||
void setType(enum ewol::keyEvent::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;
|
||||
};
|
||||
void setStatus(ewol::keyEvent::status_te _status) {
|
||||
void setStatus(enum ewol::keyEvent::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;
|
||||
};
|
||||
void setId(uint8_t _id) {
|
||||
@ -57,8 +57,8 @@ namespace ewol {
|
||||
|
||||
class EventInputSystem {
|
||||
public:
|
||||
EventInputSystem(ewol::keyEvent::type_te _type,
|
||||
ewol::keyEvent::status_te _status,
|
||||
EventInputSystem(enum ewol::keyEvent::type _type,
|
||||
enum ewol::keyEvent::status _status,
|
||||
uint8_t _id,
|
||||
const vec2& _pos,
|
||||
ewol::Widget* _dest,
|
||||
|
@ -130,7 +130,7 @@ class WindowsContext : public ewol::eContext {
|
||||
// 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
|
||||
// TODO : remove this 2 line when code will be writen
|
||||
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)
|
||||
{
|
||||
case ewol::clipBoard::clipboardSelection:
|
||||
@ -278,7 +278,7 @@ class WindowsContext : public ewol::eContext {
|
||||
buttonIsDown = false;
|
||||
case WM_KEYDOWN: {
|
||||
etk::UChar tmpChar = 0;
|
||||
ewol::keyEvent::keyboard_te keyInput;
|
||||
enum ewol::keyEvent::keyboard keyInput;
|
||||
switch (_wParam) {
|
||||
//case 80: // keypad
|
||||
case VK_UP: keyInput = ewol::keyEvent::keyboardUp; break;
|
||||
|
@ -138,7 +138,7 @@ class X11Interface : public ewol::eContext {
|
||||
Atom XAtomeTargetTarget;
|
||||
Atom XAtomeEWOL;
|
||||
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:
|
||||
X11Interface(int32_t _argc, const char* _argv[]) :
|
||||
ewol::eContext(_argc, _argv),
|
||||
@ -558,7 +558,7 @@ class X11Interface : public ewol::eContext {
|
||||
m_guiKeyBoardMode.altGr = false;
|
||||
}
|
||||
bool find = true;
|
||||
ewol::keyEvent::keyboard_te keyInput;
|
||||
enum ewol::keyEvent::keyboard keyInput;
|
||||
switch (event.xkey.keycode) {
|
||||
//case 80: // keypad
|
||||
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) {
|
||||
X11_DEBUG("X11-API: set New Cursor : " << _newCursor);
|
||||
// undefine previous cursors ...
|
||||
@ -1220,9 +1220,8 @@ class X11Interface : public ewol::eContext {
|
||||
X11_INFO("X11: set Title (END)");
|
||||
}
|
||||
/****************************************************************************************/
|
||||
void clipBoardGet(ewol::clipBoard::clipboardListe_te _clipboardID) {
|
||||
switch (_clipboardID)
|
||||
{
|
||||
void clipBoardGet(enum ewol::clipBoard::clipboardListe _clipboardID) {
|
||||
switch (_clipboardID) {
|
||||
case ewol::clipBoard::clipboardSelection:
|
||||
if (false == m_clipBoardOwnerPrimary) {
|
||||
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)
|
||||
{
|
||||
case ewol::clipBoard::clipboardSelection:
|
||||
|
@ -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 : ...
|
||||
}
|
||||
|
||||
|
||||
void guiInterface::ClipBoardSet(ewol::clipBoard::clipboardListe_te _clipboardID) {
|
||||
void guiInterface::ClipBoardSet(enum ewol::clipBoard::clipboardListe _clipboardID) {
|
||||
// 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 : ...
|
||||
}
|
||||
|
||||
@ -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 ...
|
||||
}
|
||||
|
||||
|
@ -90,29 +90,29 @@ void ewol::eContext::processEvents(void) {
|
||||
m_msgSystem.wait(data);
|
||||
//EWOL_DEBUG("EVENT");
|
||||
switch (data.TypeMessage) {
|
||||
case THREAD_INIT:
|
||||
case eSystemMessage::msgInit:
|
||||
// this is due to the openGL context
|
||||
/*bool returnVal = */APP_Init(*this);
|
||||
break;
|
||||
case THREAD_RECALCULATE_SIZE:
|
||||
case eSystemMessage::msgRecalculateSize:
|
||||
forceRedrawAll();
|
||||
break;
|
||||
case THREAD_RESIZE:
|
||||
case eSystemMessage::msgResize:
|
||||
//EWOL_DEBUG("Receive MSG : THREAD_RESIZE");
|
||||
m_windowsSize = data.dimention;
|
||||
ewol::dimension::setPixelWindowsSize(m_windowsSize);
|
||||
forceRedrawAll();
|
||||
break;
|
||||
case THREAD_INPUT_MOTION:
|
||||
case eSystemMessage::msgInputMotion:
|
||||
//EWOL_DEBUG("Receive MSG : THREAD_INPUT_MOTION");
|
||||
m_input.motion(data.inputType, data.inputId, data.dimention);
|
||||
break;
|
||||
case THREAD_INPUT_STATE:
|
||||
case eSystemMessage::msgInputState:
|
||||
//EWOL_DEBUG("Receive MSG : THREAD_INPUT_STATE");
|
||||
m_input.state(data.inputType, data.inputId, data.stateIsDown, data.dimention);
|
||||
break;
|
||||
case THREAD_KEYBORAD_KEY:
|
||||
case THREAD_KEYBORAD_MOVE:
|
||||
case eSystemMessage::msgKeyboardKey:
|
||||
case eSystemMessage::msgKeyboardMove:
|
||||
//EWOL_DEBUG("Receive MSG : THREAD_KEYBORAD_KEY");
|
||||
if (NULL != m_windowsCurrent) {
|
||||
if (false == m_windowsCurrent->onEventShortCut(data.keyboardSpecial,
|
||||
@ -133,7 +133,7 @@ void ewol::eContext::processEvents(void) {
|
||||
data.keyboardMove,
|
||||
data.stateIsDown) ) {
|
||||
// generate the direct event ...
|
||||
if (data.TypeMessage == THREAD_KEYBORAD_KEY) {
|
||||
if (data.TypeMessage == eSystemMessage::msgKeyboardKey) {
|
||||
ewol::EventEntrySystem tmpEntryEvent(ewol::keyEvent::keyboardChar,
|
||||
ewol::keyEvent::statusUp,
|
||||
data.keyboardSpecial,
|
||||
@ -161,7 +161,7 @@ void ewol::eContext::processEvents(void) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case THREAD_CLIPBOARD_ARRIVE:
|
||||
case eSystemMessage::msgClipboardArrive:
|
||||
{
|
||||
ewol::Widget * tmpWidget = m_widgetManager.focusGet();
|
||||
if (tmpWidget != NULL) {
|
||||
@ -169,13 +169,13 @@ void ewol::eContext::processEvents(void) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case THREAD_HIDE:
|
||||
EWOL_DEBUG("Receive MSG : THREAD_HIDE");
|
||||
case eSystemMessage::msgHide:
|
||||
EWOL_DEBUG("Receive MSG : msgHide");
|
||||
//guiAbstraction::SendKeyboardEventMove(tmpData->isDown, tmpData->move);
|
||||
//gui_uniqueWindows->SysOnHide();
|
||||
break;
|
||||
case THREAD_SHOW:
|
||||
EWOL_DEBUG("Receive MSG : THREAD_SHOW");
|
||||
case eSystemMessage::msgShow:
|
||||
EWOL_DEBUG("Receive MSG : msgShow");
|
||||
//guiAbstraction::SendKeyboardEventMove(tmpData->isDown, tmpData->move);
|
||||
//gui_uniqueWindows->SysOnShow();
|
||||
break;
|
||||
@ -232,22 +232,22 @@ ewol::eContext::eContext(int32_t _argc, const char* _argv[]) :
|
||||
// parse the debug level:
|
||||
for(esize_t iii=m_commandLine.size()-1 ; iii >= 0 ; --iii) {
|
||||
if (m_commandLine.get(iii) == "-l0") {
|
||||
debug::setGeneralLevel(etk::LOG_LEVEL_NONE);
|
||||
debug::setGeneralLevel(etk::logLevelNone);
|
||||
} else if (m_commandLine.get(iii) == "-l1") {
|
||||
debug::setGeneralLevel(etk::LOG_LEVEL_CRITICAL);
|
||||
debug::setGeneralLevel(etk::logLevelCritical);
|
||||
} else if (m_commandLine.get(iii) == "-l2") {
|
||||
debug::setGeneralLevel(etk::LOG_LEVEL_ERROR);
|
||||
debug::setGeneralLevel(etk::logLevelError);
|
||||
} else if (m_commandLine.get(iii) == "-l3") {
|
||||
debug::setGeneralLevel(etk::LOG_LEVEL_WARNING);
|
||||
debug::setGeneralLevel(etk::logLevelWarning);
|
||||
} else if (m_commandLine.get(iii) == "-l4") {
|
||||
debug::setGeneralLevel(etk::LOG_LEVEL_INFO);
|
||||
debug::setGeneralLevel(etk::logLevelInfo);
|
||||
} else if (m_commandLine.get(iii) == "-l5") {
|
||||
debug::setGeneralLevel(etk::LOG_LEVEL_DEBUG);
|
||||
debug::setGeneralLevel(etk::logLevelDebug);
|
||||
} else if( m_commandLine.get(iii) == "-l6"
|
||||
|| m_commandLine.get(iii) == "-l7"
|
||||
|| m_commandLine.get(iii) == "-l8"
|
||||
|| m_commandLine.get(iii) == "-l9") {
|
||||
debug::setGeneralLevel(etk::LOG_LEVEL_VERBOSE);
|
||||
debug::setGeneralLevel(etk::logLevelVerbose);
|
||||
} else if (m_commandLine.get(iii) == "-fps") {
|
||||
m_displayFps=true;
|
||||
} 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 ...
|
||||
{
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_INIT;
|
||||
data.TypeMessage = eSystemMessage::msgInit;
|
||||
m_msgSystem.post(data);
|
||||
}
|
||||
// force a recalculation
|
||||
requestUpdateSize();
|
||||
#if defined(__EWOL_ANDROID_ORIENTATION_LANDSCAPE__)
|
||||
forceOrientation(ewol::SCREEN_ORIENTATION_LANDSCAPE);
|
||||
forceOrientation(ewol::screenLandscape);
|
||||
#elif defined(__EWOL_ANDROID_ORIENTATION_PORTRAIT__)
|
||||
forceOrientation(ewol::SCREEN_ORIENTATION_PORTRAIT);
|
||||
forceOrientation(ewol::screenPortrait);
|
||||
#else
|
||||
forceOrientation(ewol::SCREEN_ORIENTATION_AUTO);
|
||||
forceOrientation(ewol::screenAuto);
|
||||
#endif
|
||||
// release the curent interface :
|
||||
unLockContext();
|
||||
@ -302,7 +302,7 @@ ewol::eContext::~eContext(void) {
|
||||
|
||||
void ewol::eContext::requestUpdateSize(void) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_RECALCULATE_SIZE;
|
||||
data.TypeMessage = eSystemMessage::msgRecalculateSize;
|
||||
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 ...
|
||||
ewol::dimension::setPixelWindowsSize(_size);
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_RESIZE;
|
||||
data.TypeMessage = eSystemMessage::msgResize;
|
||||
data.dimention = _size;
|
||||
m_msgSystem.post(data);
|
||||
}
|
||||
void ewol::eContext::OS_Move(const vec2& _pos) {
|
||||
/*
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_RESIZE;
|
||||
data.TypeMessage = eSystemMessage::msgResize;
|
||||
data.resize.w = w;
|
||||
data.resize.h = h;
|
||||
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 ) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_INPUT_MOTION;
|
||||
data.TypeMessage = eSystemMessage::msgInputMotion;
|
||||
data.inputType = ewol::keyEvent::typeFinger;
|
||||
data.inputId = _pointerID;
|
||||
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 ) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_INPUT_STATE;
|
||||
data.TypeMessage = eSystemMessage::msgInputState;
|
||||
data.inputType = ewol::keyEvent::typeFinger;
|
||||
data.inputId = _pointerID;
|
||||
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 ) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_INPUT_MOTION;
|
||||
data.TypeMessage = eSystemMessage::msgInputMotion;
|
||||
data.inputType = ewol::keyEvent::typeMouse;
|
||||
data.inputId = _pointerID;
|
||||
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 ) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_INPUT_STATE;
|
||||
data.TypeMessage = eSystemMessage::msgInputState;
|
||||
data.inputType = ewol::keyEvent::typeMouse;
|
||||
data.inputId = _pointerID;
|
||||
data.stateIsDown = _isDown;
|
||||
@ -367,7 +367,7 @@ void ewol::eContext::OS_SetKeyboard(ewol::SpecialKey& _special,
|
||||
bool _isDown,
|
||||
bool _isARepeateKey) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_KEYBORAD_KEY;
|
||||
data.TypeMessage = eSystemMessage::msgKeyboardKey;
|
||||
data.stateIsDown = _isDown;
|
||||
data.keyboardChar = _myChar;
|
||||
data.keyboardSpecial = _special;
|
||||
@ -376,11 +376,11 @@ void ewol::eContext::OS_SetKeyboard(ewol::SpecialKey& _special,
|
||||
}
|
||||
|
||||
void ewol::eContext::OS_SetKeyboardMove(ewol::SpecialKey& _special,
|
||||
ewol::keyEvent::keyboard_te _move,
|
||||
enum ewol::keyEvent::keyboard _move,
|
||||
bool _isDown,
|
||||
bool _isARepeateKey) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_KEYBORAD_MOVE;
|
||||
data.TypeMessage = eSystemMessage::msgKeyboardMove;
|
||||
data.stateIsDown = _isDown;
|
||||
data.keyboardMove = _move;
|
||||
data.keyboardSpecial = _special;
|
||||
@ -390,20 +390,20 @@ void ewol::eContext::OS_SetKeyboardMove(ewol::SpecialKey& _special,
|
||||
|
||||
void ewol::eContext::OS_Hide(void) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_HIDE;
|
||||
data.TypeMessage = eSystemMessage::msgHide;
|
||||
m_msgSystem.post(data);
|
||||
}
|
||||
|
||||
void ewol::eContext::OS_Show(void) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_SHOW;
|
||||
data.TypeMessage = eSystemMessage::msgShow;
|
||||
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;
|
||||
data.TypeMessage = THREAD_CLIPBOARD_ARRIVE;
|
||||
data.TypeMessage = eSystemMessage::msgClipboardArrive;
|
||||
data.clipboardID = _clipboardID;
|
||||
m_msgSystem.post(data);
|
||||
}
|
||||
|
@ -23,33 +23,32 @@
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/commandLine.h>
|
||||
|
||||
|
||||
// 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 ...
|
||||
// TODO : Remove this from here ...
|
||||
class eSystemMessage {
|
||||
public:
|
||||
enum theadMessage {
|
||||
msgNone,
|
||||
msgInit,
|
||||
msgRecalculateSize,
|
||||
msgResize,
|
||||
msgHide,
|
||||
msgShow,
|
||||
|
||||
msgInputMotion,
|
||||
msgInputState,
|
||||
|
||||
msgKeyboardKey,
|
||||
msgKeyboardMove,
|
||||
|
||||
msgClipboardArrive
|
||||
};
|
||||
public :
|
||||
// specify the message type
|
||||
theadMessage_te TypeMessage;
|
||||
enum theadMessage TypeMessage;
|
||||
// can not set a union ...
|
||||
ewol::clipBoard::clipboardListe_te clipboardID;
|
||||
enum ewol::clipBoard::clipboardListe clipboardID;
|
||||
// InputId
|
||||
ewol::keyEvent::type_te inputType;
|
||||
enum ewol::keyEvent::type inputType;
|
||||
int32_t inputId;
|
||||
// generic dimentions
|
||||
vec2 dimention;
|
||||
@ -57,11 +56,11 @@ class eSystemMessage {
|
||||
bool repeateKey; //!< special flag for the repeating key on the PC interface
|
||||
bool stateIsDown;
|
||||
etk::UChar keyboardChar;
|
||||
ewol::keyEvent::keyboard_te keyboardMove;
|
||||
enum ewol::keyEvent::keyboard keyboardMove;
|
||||
ewol::SpecialKey keyboardSpecial;
|
||||
|
||||
eSystemMessage(void) :
|
||||
TypeMessage(THREAD_NONE),
|
||||
TypeMessage(msgNone),
|
||||
clipboardID(ewol::clipBoard::clipboardStd),
|
||||
inputType(ewol::keyEvent::typeUnknow),
|
||||
inputId(-1),
|
||||
@ -76,33 +75,43 @@ class eSystemMessage {
|
||||
};
|
||||
|
||||
namespace ewol {
|
||||
typedef enum {
|
||||
SCREEN_ORIENTATION_AUTO = 0,
|
||||
SCREEN_ORIENTATION_LANDSCAPE,
|
||||
SCREEN_ORIENTATION_PORTRAIT,
|
||||
} orientation_te;
|
||||
enum orientation{
|
||||
screenAuto = 0,
|
||||
screenLandscape,
|
||||
screenPortrait
|
||||
};
|
||||
|
||||
class eContext {
|
||||
private:
|
||||
ewol::CommandLine m_commandLine; //!< Start command line information
|
||||
public:
|
||||
ewol::CommandLine& getCmd(void) { return m_commandLine; };
|
||||
ewol::CommandLine& getCmd(void) {
|
||||
return m_commandLine;
|
||||
};
|
||||
private:
|
||||
ewol::ConfigFont m_configFont; //!< global font configuration
|
||||
public:
|
||||
ewol::ConfigFont& getFontDefault(void) { return m_configFont; };
|
||||
ewol::ConfigFont& getFontDefault(void) {
|
||||
return m_configFont;
|
||||
};
|
||||
private:
|
||||
ewol::WidgetManager m_widgetManager; //!< global widget manager
|
||||
public:
|
||||
ewol::WidgetManager& getWidgetManager(void) { return m_widgetManager; };
|
||||
ewol::WidgetManager& getWidgetManager(void) {
|
||||
return m_widgetManager;
|
||||
};
|
||||
private:
|
||||
ewol::EObjectManager m_EObjectManager; //!< eObject Manager main instance
|
||||
public:
|
||||
ewol::EObjectManager& getEObjectManager(void) { return m_EObjectManager; };
|
||||
ewol::EObjectManager& getEObjectManager(void) {
|
||||
return m_EObjectManager;
|
||||
};
|
||||
private:
|
||||
ewol::ResourceManager m_resourceManager; //!< global resources Manager
|
||||
public:
|
||||
ewol::ResourceManager& getResourcesManager(void) { return m_resourceManager; };
|
||||
ewol::ResourceManager& getResourcesManager(void) {
|
||||
return m_resourceManager;
|
||||
};
|
||||
public:
|
||||
eContext(int32_t _argc=0, const char* _argv[]=NULL);
|
||||
virtual ~eContext(void);
|
||||
@ -134,7 +143,6 @@ namespace ewol {
|
||||
|
||||
virtual void setArchiveDir(int _mode, const char* _str);
|
||||
|
||||
|
||||
virtual void OS_SetInputMotion(int _pointerID, const vec2& _pos);
|
||||
virtual void OS_SetInputState(int _pointerID, bool _isDown, const vec2& _pos);
|
||||
|
||||
@ -146,7 +154,7 @@ namespace ewol {
|
||||
bool _isDown,
|
||||
bool _isARepeateKey=false);
|
||||
virtual void OS_SetKeyboardMove(ewol::SpecialKey& _special,
|
||||
ewol::keyEvent::keyboard_te _move,
|
||||
enum ewol::keyEvent::keyboard _move,
|
||||
bool _isDown,
|
||||
bool _isARepeateKey=false);
|
||||
/**
|
||||
@ -158,8 +166,6 @@ namespace ewol {
|
||||
*/
|
||||
virtual void OS_Resume(void);
|
||||
|
||||
//virtual void OS_SetClipBoard(ewol::clipBoard::clipboardListe_te _clipboardID);
|
||||
|
||||
void requestUpdateSize(void);
|
||||
|
||||
// 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
|
||||
* @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
|
||||
*/
|
||||
@ -282,17 +288,17 @@ namespace ewol {
|
||||
* @brief Inform the Gui that we want to have a copy of the clipboard
|
||||
* @param[in] _clipboardID ID of the clipboard (STD/SELECTION) only apear here
|
||||
*/
|
||||
virtual void clipBoardGet(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
|
||||
* @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)
|
||||
* @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
|
||||
* @param[in] title New desired title
|
||||
@ -302,7 +308,7 @@ namespace ewol {
|
||||
* @brief force the screen orientation (availlable on portable elements ...
|
||||
* @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
|
||||
* @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.
|
||||
* @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
|
||||
* @param[in] _inputFile new filename icon of the curent program.
|
||||
|
@ -41,11 +41,11 @@ void ewol::eInput::setDpi(int32_t newDPI) {
|
||||
calculateLimit();
|
||||
}
|
||||
|
||||
bool ewol::eInput::localEventInput(ewol::keyEvent::type_te _type,
|
||||
ewol::Widget* _destWidget,
|
||||
int32_t _IdInput,
|
||||
ewol::keyEvent::status_te _status,
|
||||
vec2 _pos) {
|
||||
bool ewol::eInput::localEventInput(enum ewol::keyEvent::type _type,
|
||||
ewol::Widget* _destWidget,
|
||||
int32_t _IdInput,
|
||||
enum ewol::keyEvent::status _status,
|
||||
vec2 _pos) {
|
||||
if (NULL != _destWidget) {
|
||||
if (_type == ewol::keyEvent::typeMouse || _type == ewol::keyEvent::typeFinger) {
|
||||
// create the system Event :
|
||||
@ -61,7 +61,7 @@ bool ewol::eInput::localEventInput(ewol::keyEvent::type_te _type,
|
||||
|
||||
void ewol::eInput::abortElement(InputPoperty_ts *_eventTable,
|
||||
int32_t _idInput,
|
||||
ewol::keyEvent::type_te _type) {
|
||||
enum ewol::keyEvent::type _type) {
|
||||
if (NULL == _eventTable) {
|
||||
return;
|
||||
}
|
||||
@ -179,7 +179,7 @@ ewol::eInput::~eInput(void) {
|
||||
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,
|
||||
int32_t _realInputId) {
|
||||
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 ...
|
||||
void ewol::eInput::motion(ewol::keyEvent::type_te _type,
|
||||
void ewol::eInput::motion(enum ewol::keyEvent::type _type,
|
||||
int _pointerID,
|
||||
vec2 _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,
|
||||
bool _isDown,
|
||||
vec2 _pos)
|
||||
@ -472,7 +472,7 @@ void ewol::eInput::state(ewol::keyEvent::type_te _type,
|
||||
localEventInput(_type,
|
||||
eventTable[_pointerID].curentWidgetEvent,
|
||||
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);
|
||||
if( eventTable[_pointerID].nbClickEvent >= nbClickMax) {
|
||||
eventTable[_pointerID].nbClickEvent = 0;
|
||||
|
@ -37,41 +37,42 @@ namespace ewol {
|
||||
class eInput {
|
||||
// special grab pointer mode :
|
||||
private:
|
||||
ewol::Widget* m_grabWidget; //!< widget that grab the curent pointer.
|
||||
ewol::Widget* m_grabWidget; //!< widget that grab the curent pointer.
|
||||
private:
|
||||
int32_t m_dpi;
|
||||
inputLimit_ts m_eventInputLimit;
|
||||
inputLimit_ts m_eventMouseLimit;
|
||||
int32_t m_dpi;
|
||||
inputLimit_ts m_eventInputLimit;
|
||||
inputLimit_ts m_eventMouseLimit;
|
||||
void calculateLimit(void);
|
||||
InputPoperty_ts m_eventInputSaved[MAX_MANAGE_INPUT];
|
||||
InputPoperty_ts m_eventMouseSaved[MAX_MANAGE_INPUT];
|
||||
void abortElement(InputPoperty_ts *eventTable, int32_t idInput, ewol::keyEvent::type_te _type);
|
||||
void cleanElement(InputPoperty_ts *eventTable, int32_t idInput);
|
||||
void abortElement(InputPoperty_ts* _eventTable, int32_t _idInput, enum ewol::keyEvent::type _type);
|
||||
void cleanElement(InputPoperty_ts* _eventTable, int32_t _idInput);
|
||||
/**
|
||||
* @brief generate the event on the destinated widget.
|
||||
* @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] IdInput Id of the event (PC : [0..9] and touch : [1..9])
|
||||
* @param[in] typeEvent type of the eventg generated
|
||||
* @param[in] pos position of the event
|
||||
* @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] _IdInput Id of the event (PC : [0..9] and touch : [1..9])
|
||||
* @param[in] _typeEvent type of the eventg generated
|
||||
* @param[in] _pos position of the event
|
||||
* @return true if event has been greped
|
||||
*/
|
||||
bool localEventInput(ewol::keyEvent::type_te type,
|
||||
ewol::Widget* destWidget,
|
||||
int32_t IdInput,
|
||||
ewol::keyEvent::status_te typeEvent,
|
||||
vec2 pos);
|
||||
bool localEventInput(enum ewol::keyEvent::type _type,
|
||||
ewol::Widget* _destWidget,
|
||||
int32_t _IdInput,
|
||||
enum ewol::keyEvent::status _typeEvent,
|
||||
vec2 _pos);
|
||||
/**
|
||||
* @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
|
||||
* == > on PC, the ID does not change (GUI is not the same)
|
||||
* @param[in] destWidget Pointer of the widget destination
|
||||
* @param[in] realInputId system Id
|
||||
* @param[in] _type Type of the kay event.
|
||||
* @param[in] _destWidget Pointer of the widget destination
|
||||
* @param[in] _realInputId system Id
|
||||
* @return the ewol input id
|
||||
*/
|
||||
int32_t localGetDestinationId(ewol::keyEvent::type_te type,
|
||||
ewol::Widget* destWidget,
|
||||
int32_t realInputId);
|
||||
int32_t localGetDestinationId(enum ewol::keyEvent::type _type,
|
||||
ewol::Widget* _destWidget,
|
||||
int32_t _realInputId);
|
||||
private:
|
||||
ewol::eContext& m_context;
|
||||
public:
|
||||
@ -80,34 +81,30 @@ namespace ewol {
|
||||
void setDpi(int32_t newDPI);
|
||||
|
||||
// note if id<0 == > the it was finger event ...
|
||||
void motion(ewol::keyEvent::type_te type, int pointerID, vec2 pos );
|
||||
void state(ewol::keyEvent::type_te type, int pointerID, bool isDown, vec2 pos);
|
||||
void motion(enum ewol::keyEvent::type _type, int _pointerID, vec2 _pos );
|
||||
void state(enum ewol::keyEvent::type _type, int _pointerID, bool _isDown, vec2 _pos);
|
||||
|
||||
/**
|
||||
* @brief Inform object that an other object is removed ...
|
||||
* @param[in] removeObject Pointer on the EObject remeved == > the user must remove all reference on this EObject
|
||||
* @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 ...
|
||||
* @param ---
|
||||
* @return ---
|
||||
*/
|
||||
void newLayerSet(void);
|
||||
/**
|
||||
* @brief This is to transfert the event from one widget to another one
|
||||
* @param source the widget where the event came from
|
||||
* @param destination the widget where the event mitgh be generated now
|
||||
* @return ---
|
||||
* @param _source the widget where the event came from
|
||||
* @param _destination the widget where the event mitgh be generated now
|
||||
*/
|
||||
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
|
||||
* @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
|
||||
*/
|
||||
|
@ -182,7 +182,7 @@ static correspondenceTable_ts basicFlag[] = {
|
||||
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
|
||||
for (int32_t iii=0; iii<basicFlagCount ; iii++) {
|
||||
if ( basicFlag[iii].curentFlag == (uint32_t)_flagID ) {
|
||||
@ -196,7 +196,7 @@ void ewol::openGL::enable(ewol::openGL::openGlFlags_te _flagID) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void ewol::openGL::disable(ewol::openGL::openGlFlags_te _flagID) {
|
||||
void ewol::openGL::disable(enum ewol::openGL::openGlFlags _flagID) {
|
||||
#ifdef DIRECT_MODE
|
||||
for (int32_t iii=0; iii<basicFlagCount ; iii++) {
|
||||
if ( basicFlag[iii].curentFlag == (uint32_t)_flagID ) {
|
||||
|
@ -110,7 +110,7 @@ namespace ewol {
|
||||
*/
|
||||
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_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.
|
||||
@ -140,18 +140,18 @@ namespace ewol {
|
||||
FLAG_TEXTURE_2D = 1<<26, //!<
|
||||
FLAG_ALPHA_TEST = 1<<27, //!<
|
||||
FLAG_FOG = 1<<28, //!<
|
||||
} openGlFlags_te;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief enable a flag on the system
|
||||
* @param[in] flagID The flag requested
|
||||
*/
|
||||
void enable(openGlFlags_te _flagID);
|
||||
void enable(enum openGlFlags _flagID);
|
||||
/**
|
||||
* @brief disable a flag on the system
|
||||
* @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 ...
|
||||
*/
|
||||
|
@ -607,7 +607,7 @@ void removeEndLine(char* _val) {
|
||||
}
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
enum emfModuleMode {
|
||||
EMFModuleNone,
|
||||
EMFModuleMesh,
|
||||
EMFModuleMeshNamed,
|
||||
@ -623,7 +623,7 @@ typedef enum {
|
||||
EMFModuleMaterial,
|
||||
EMFModuleMaterialNamed,
|
||||
EMFModuleMaterial_END,
|
||||
} emfModuleMode_te;
|
||||
};
|
||||
|
||||
bool ewol::Mesh::loadEMF(const etk::UString& _fileName) {
|
||||
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 << "'");
|
||||
return false;
|
||||
}
|
||||
emfModuleMode_te currentMode = EMFModuleNone;
|
||||
enum emfModuleMode currentMode = EMFModuleNone;
|
||||
EWOL_VERBOSE("Start parsing Mesh file : " << fileName);
|
||||
// mesh global param :
|
||||
etk::UString currentMeshName = "";
|
||||
|
@ -72,13 +72,13 @@ namespace ewol {
|
||||
};
|
||||
class Mesh : public ewol::Resource {
|
||||
public:
|
||||
typedef enum {
|
||||
enum normalMode {
|
||||
normalModeNone,
|
||||
normalModeFace,
|
||||
normalModeVertex,
|
||||
} normalMode_te;
|
||||
};
|
||||
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
|
||||
protected:
|
||||
ewol::Program* m_GLprogram;
|
||||
|
@ -18,7 +18,7 @@
|
||||
#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) {
|
||||
default :
|
||||
_os << "error";
|
||||
@ -162,10 +162,10 @@ ewol::TexturedFont::TexturedFont(const etk::UString& _fontName) :
|
||||
}
|
||||
}
|
||||
// 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--) {
|
||||
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
|
||||
for(int32_t iii=3; iii >= 0; iii--) {
|
||||
if (m_fileName[iii].isEmpty() == false) {
|
||||
m_modeWraping[iii] = (ewol::font::mode_te)iii;
|
||||
m_modeWraping[iii] = (enum ewol::font::mode)iii;
|
||||
} else {
|
||||
m_modeWraping[iii] = refMode;
|
||||
}
|
||||
@ -297,7 +297,7 @@ bool ewol::TexturedFont::addGlyph(const etk::UChar& _val) {
|
||||
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) {
|
||||
return 0;
|
||||
} else if (_charcode.get() < 0x80) {
|
||||
@ -323,7 +323,7 @@ int32_t ewol::TexturedFont::getIndex(const etk::UChar& _charcode, const ewol::fo
|
||||
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]);
|
||||
int32_t index = getIndex(_charcode, _displayMode);
|
||||
if( index < 0
|
||||
|
@ -15,14 +15,14 @@
|
||||
|
||||
namespace ewol {
|
||||
namespace font {
|
||||
typedef enum {
|
||||
enum mode {
|
||||
Regular=0,
|
||||
Italic,
|
||||
Bold,
|
||||
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 {
|
||||
private:
|
||||
@ -33,7 +33,7 @@ namespace ewol {
|
||||
// == > otherwise I can just generate italic ...
|
||||
// == > Bold is a little more complicated (maybe with the bordersize)
|
||||
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:
|
||||
etk::Vector<GlyphProperty> m_listElement[4];
|
||||
private:
|
||||
@ -52,7 +52,7 @@ namespace ewol {
|
||||
* @param[in] _displayMode Mode to display the currrent font
|
||||
* @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];
|
||||
};
|
||||
/**
|
||||
@ -68,21 +68,21 @@ namespace ewol {
|
||||
* @param[in] _displayMode Mode to display the currrent font
|
||||
* @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
|
||||
* @param[in] _charcode The unicodeValue
|
||||
* @param[in] _displayMode Mode to display the currrent font
|
||||
* @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.
|
||||
* For exemple when a blod mode does not exist, this resend a regular mode.
|
||||
* @param[in] _source The requested mode.
|
||||
* @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];
|
||||
};
|
||||
public:
|
||||
|
@ -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) {
|
||||
m_lock = _lock;
|
||||
if(widget::Button::lockAccess == _lock) {
|
||||
@ -463,7 +463,7 @@ bool widget::Button::onSetConfig(const ewol::EConfig& _conf) {
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == configLock) {
|
||||
buttonLock_te tmpLock = lockNone;
|
||||
enum buttonLock tmpLock = lockNone;
|
||||
if( true == _conf.getData().compareNoCase("true")
|
||||
|| true == _conf.getData().compareNoCase("1")) {
|
||||
tmpLock = lockAccess;
|
||||
|
@ -39,12 +39,12 @@ namespace widget {
|
||||
static const char* const configLock;
|
||||
static const char* const configValue;
|
||||
static const char* const configShaper;
|
||||
typedef enum {
|
||||
enum buttonLock{
|
||||
lockNone, //!< normal status of the button
|
||||
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
|
||||
lockAccess, //!< all event are trashed == > acctivity of the button is disable
|
||||
} buttonLock_te;
|
||||
};
|
||||
private:
|
||||
ewol::Shaper m_shaper; //!< Compositing theme.
|
||||
public:
|
||||
@ -107,18 +107,18 @@ namespace widget {
|
||||
return m_value;
|
||||
};
|
||||
protected:
|
||||
buttonLock_te m_lock; //!< Current lock state of the button.
|
||||
enum buttonLock m_lock; //!< Current lock state of the button.
|
||||
public:
|
||||
/**
|
||||
* @brief set the button lock state.
|
||||
* @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.
|
||||
* @return The requested lock mode
|
||||
*/
|
||||
buttonLock_te getLock(void) const {
|
||||
enum buttonLock getLock(void) const {
|
||||
return m_lock;
|
||||
};
|
||||
protected:
|
||||
|
@ -181,7 +181,7 @@ bool widget::ButtonColor::onEventInput(const ewol::EventInput& _event) {
|
||||
}
|
||||
vec2 tmpPos = m_origin + m_selectableAreaPos + m_selectableAreaSize;
|
||||
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();
|
||||
myColorChooser->setColor(m_textColorFg);
|
||||
|
@ -19,16 +19,16 @@ widget::Composer::Composer(void) {
|
||||
// nothing to do ...
|
||||
}
|
||||
|
||||
widget::Composer::Composer(widget::Composer::composerMode_te mode, const etk::UString& fileName) {
|
||||
switch(mode) {
|
||||
widget::Composer::Composer(enum composerMode _mode, const etk::UString& _fileName) {
|
||||
switch(_mode) {
|
||||
case widget::Composer::None:
|
||||
// nothing to do ...
|
||||
break;
|
||||
case widget::Composer::String:
|
||||
loadFromString(fileName);
|
||||
loadFromString(_fileName);
|
||||
break;
|
||||
case widget::Composer::file:
|
||||
loadFromFile(fileName);
|
||||
loadFromFile(_fileName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -22,11 +22,11 @@ namespace widget
|
||||
class Composer : public widget::Container
|
||||
{
|
||||
public:
|
||||
typedef enum {
|
||||
enum composerMode {
|
||||
None,
|
||||
String,
|
||||
file
|
||||
} composerMode_te;
|
||||
};
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
@ -34,24 +34,24 @@ namespace widget
|
||||
Composer(void);
|
||||
/**
|
||||
* @brief Constructor
|
||||
* @param[in] mode mode of parsing the string
|
||||
* @param[in] data file/directString data to generate compositing of the widget..
|
||||
* @param[in] _mode mode of parsing the string
|
||||
* @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
|
||||
*/
|
||||
~Composer(void);
|
||||
/**
|
||||
* @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 false == > some error occured
|
||||
*/
|
||||
bool loadFromFile(const etk::UString& _fileName);
|
||||
/**
|
||||
* @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 false == > some error occured
|
||||
*/
|
||||
|
@ -47,7 +47,7 @@ widget::ContextMenu::ContextMenu(const etk::UString& _shaperName) :
|
||||
m_colorBorder.setA(0x7F);
|
||||
|
||||
m_arrowPos.setValue(0,0);
|
||||
m_arrawBorder = widget::CONTEXT_MENU_MARK_TOP;
|
||||
m_arrawBorder = markTop;
|
||||
setMouseLimit(1);
|
||||
}
|
||||
|
||||
@ -85,16 +85,16 @@ void widget::ContextMenu::calculateSize(const vec2& _availlable) {
|
||||
|
||||
// set config to the Sub-widget
|
||||
switch (m_arrawBorder) {
|
||||
case widget::CONTEXT_MENU_MARK_TOP:
|
||||
case markTop:
|
||||
subWidgetOrigin.setX((int32_t)(m_arrowPos.x() - subWidgetSize.x()/2));
|
||||
subWidgetOrigin.setY((int32_t)(m_arrowPos.y() - m_offset - subWidgetSize.y()));
|
||||
break;
|
||||
case widget::CONTEXT_MENU_MARK_BOTTOM:
|
||||
case markButtom:
|
||||
subWidgetOrigin.setX((int32_t)(m_arrowPos.x() - subWidgetSize.x()/2));
|
||||
subWidgetOrigin.setY((int32_t)(m_arrowPos.y() + m_offset));
|
||||
break;
|
||||
case widget::CONTEXT_MENU_MARK_RIGHT:
|
||||
case widget::CONTEXT_MENU_MARK_LEFT:
|
||||
case markRight:
|
||||
case markLeft:
|
||||
default:
|
||||
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());
|
||||
@ -108,14 +108,14 @@ void widget::ContextMenu::calculateSize(const vec2& _availlable) {
|
||||
switch (m_arrawBorder)
|
||||
{
|
||||
default:
|
||||
case widget::CONTEXT_MENU_MARK_TOP:
|
||||
case widget::CONTEXT_MENU_MARK_BOTTOM:
|
||||
case markTop:
|
||||
case markButtom:
|
||||
if (m_arrowPos.x() <= m_offset ) {
|
||||
subWidgetOrigin.setX(m_arrowPos.x()+padding.x());
|
||||
}
|
||||
break;
|
||||
case widget::CONTEXT_MENU_MARK_RIGHT:
|
||||
case widget::CONTEXT_MENU_MARK_LEFT:
|
||||
case markRight:
|
||||
case markLeft:
|
||||
if (m_arrowPos.y() <= m_offset ) {
|
||||
subWidgetOrigin.setY(m_arrowPos.y()+padding.y());
|
||||
}
|
||||
@ -160,7 +160,7 @@ void widget::ContextMenu::onRegenerateDisplay(void) {
|
||||
// display border ...
|
||||
m_compositing.setColor(m_colorBorder);
|
||||
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.addVertex();
|
||||
if (m_arrowPos.x() <= tmpOrigin.x() ) {
|
||||
@ -177,7 +177,7 @@ void widget::ContextMenu::onRegenerateDisplay(void) {
|
||||
m_compositing.addVertex();
|
||||
}
|
||||
break;
|
||||
case widget::CONTEXT_MENU_MARK_BOTTOM:
|
||||
case markButtom:
|
||||
m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y(), 0) );
|
||||
m_compositing.addVertex();
|
||||
if (m_arrowPos.x() <= tmpOrigin.x() ) {
|
||||
@ -195,8 +195,8 @@ void widget::ContextMenu::onRegenerateDisplay(void) {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case widget::CONTEXT_MENU_MARK_RIGHT:
|
||||
case widget::CONTEXT_MENU_MARK_LEFT:
|
||||
case markRight:
|
||||
case markLeft:
|
||||
EWOL_TODO("later");
|
||||
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);
|
||||
m_arrawBorder = _position;
|
||||
m_arrowPos = _arrowPos;
|
||||
@ -257,15 +257,15 @@ bool widget::ContextMenu::onSetConfig(const ewol::EConfig& _conf) {
|
||||
}
|
||||
if (_conf.getConfig() == configArrowMode) {
|
||||
if(true == _conf.getData().compareNoCase("top")) {
|
||||
m_arrawBorder = CONTEXT_MENU_MARK_TOP;
|
||||
m_arrawBorder = markTop;
|
||||
} else if(true == _conf.getData().compareNoCase("right")) {
|
||||
m_arrawBorder = CONTEXT_MENU_MARK_RIGHT;
|
||||
m_arrawBorder = markRight;
|
||||
} else if(true == _conf.getData().compareNoCase("buttom")) {
|
||||
m_arrawBorder = CONTEXT_MENU_MARK_BOTTOM;
|
||||
m_arrawBorder = markButtom;
|
||||
} else if(true == _conf.getData().compareNoCase("left")) {
|
||||
m_arrawBorder = CONTEXT_MENU_MARK_LEFT;
|
||||
m_arrawBorder = markLeft;
|
||||
} else {
|
||||
m_arrawBorder = CONTEXT_MENU_MARK_NONE;
|
||||
m_arrawBorder = markNone;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -286,20 +286,20 @@ bool widget::ContextMenu::onGetConfig(const char* _config, etk::UString& _result
|
||||
}
|
||||
if (_config == configArrowMode) {
|
||||
switch(m_arrawBorder) {
|
||||
case CONTEXT_MENU_MARK_TOP:
|
||||
case markTop:
|
||||
_result = "top";
|
||||
break;
|
||||
case CONTEXT_MENU_MARK_RIGHT:
|
||||
case markRight:
|
||||
_result = "right";
|
||||
break;
|
||||
case CONTEXT_MENU_MARK_BOTTOM:
|
||||
case markButtom:
|
||||
_result = "buttom";
|
||||
break;
|
||||
case CONTEXT_MENU_MARK_LEFT:
|
||||
case markLeft:
|
||||
_result = "left";
|
||||
break;
|
||||
default:
|
||||
case CONTEXT_MENU_MARK_NONE:
|
||||
case markNone:
|
||||
_result = "none";
|
||||
break;
|
||||
}
|
||||
|
@ -18,17 +18,18 @@
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
|
||||
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
|
||||
*/
|
||||
class ContextMenu : public widget::Container {
|
||||
public:
|
||||
enum markPosition {
|
||||
markTop,
|
||||
markRight,
|
||||
markButtom,
|
||||
markLeft,
|
||||
markNone
|
||||
};
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
// Config list of properties
|
||||
@ -55,9 +56,9 @@ namespace widget {
|
||||
float m_offset;
|
||||
private:
|
||||
vec2 m_arrowPos;
|
||||
markPosition_te m_arrawBorder;
|
||||
enum markPosition m_arrawBorder;
|
||||
public:
|
||||
void setPositionMark(markPosition_te position, vec2 arrowPos);
|
||||
void setPositionMark(enum markPosition position, vec2 arrowPos);
|
||||
protected: // Derived function
|
||||
virtual void onDraw(void);
|
||||
virtual bool onSetConfig(const ewol::EConfig& _conf);
|
||||
|
@ -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) {
|
||||
// nothing to cut ...
|
||||
return;
|
||||
@ -441,7 +441,7 @@ void widget::Entry::setInternalValue(const etk::UString& _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 ...
|
||||
removeSelected();
|
||||
// get current selection / Copy :
|
||||
|
@ -140,7 +140,7 @@ namespace widget {
|
||||
* @brief Copy the selected data on the specify 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
|
||||
* @note This request a regeneration of the display
|
||||
@ -199,7 +199,7 @@ namespace widget {
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventEntry(const ewol::EventEntry& _event);
|
||||
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) {
|
||||
return "widget::Entry";
|
||||
};
|
||||
|
@ -30,7 +30,7 @@ widget::Joystick::Joystick(void) {
|
||||
addEventId(ewolEventJoystickMove);
|
||||
// by default the joy does not lock when free out
|
||||
m_lock = false;
|
||||
m_displayMode = widget::JOYSTICK_NORMAL_MODE;
|
||||
m_displayMode = modeNormal;
|
||||
|
||||
m_colorFg = draw::color::blue;
|
||||
|
||||
|
@ -19,14 +19,15 @@ extern const char * const ewolEventJoystickDisable;
|
||||
extern const char * const ewolEventJoystickMove;
|
||||
|
||||
namespace widget {
|
||||
typedef enum {
|
||||
JOYSTICK_NORMAL_MODE,
|
||||
JOYSTICK_ARROW_MODE,
|
||||
} joystickMode_te;
|
||||
/**
|
||||
* @ingroup ewolWidgetGroup
|
||||
*/
|
||||
class Joystick :public ewol::Widget {
|
||||
public:
|
||||
enum joystickMode {
|
||||
modeNormal,
|
||||
modeArrow,
|
||||
};
|
||||
private:
|
||||
draw::Color m_colorFg; //!< Forground color
|
||||
draw::Color m_colorBg; //!< Background color
|
||||
@ -34,7 +35,7 @@ namespace widget {
|
||||
float m_distance; //!< dintance from the center
|
||||
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
|
||||
joystickMode_te m_displayMode; //!< Type of fonctionnal mode of the joystick
|
||||
enum joystickMode m_displayMode; //!< Type of fonctionnal mode of the joystick
|
||||
private:
|
||||
// generic property of the joystick:
|
||||
bool m_displayBackground;
|
||||
@ -44,41 +45,43 @@ namespace widget {
|
||||
public:
|
||||
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) {
|
||||
return "widget::Joystick";
|
||||
};
|
||||
virtual void calculateSize(const vec2& availlable);
|
||||
virtual void calculateSize(const vec2& _availlable);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
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);
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -69,7 +69,7 @@ namespace widget {
|
||||
}
|
||||
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;
|
||||
}
|
||||
/**
|
||||
|
@ -180,7 +180,7 @@ bool widget::ListFileSystem::getElement(int32_t _colomn, int32_t _raw, etk::UStr
|
||||
|
||||
|
||||
bool widget::ListFileSystem::onItemEvent(int32_t _IdInput,
|
||||
ewol::keyEvent::status_te _typeEvent,
|
||||
enum ewol::keyEvent::status _typeEvent,
|
||||
int32_t _colomn,
|
||||
int32_t _raw,
|
||||
float _x,
|
||||
|
@ -39,7 +39,7 @@ namespace widget {
|
||||
bool getTitle(int32_t _colomn, etk::UString& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||
uint32_t getNuberOfRaw(void);
|
||||
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) {
|
||||
return "widget::ListFileSystem";
|
||||
};
|
||||
|
@ -165,7 +165,7 @@ void widget::Menu::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
tmpOri.y() );
|
||||
}
|
||||
|
||||
m_widgetContextMenu->setPositionMark(widget::CONTEXT_MENU_MARK_TOP, newPosition );
|
||||
m_widgetContextMenu->setPositionMark(widget::ContextMenu::markTop, newPosition );
|
||||
|
||||
widget::Sizer * mySizer = NULL;
|
||||
widget::Button * myButton = NULL;
|
||||
|
@ -235,7 +235,7 @@ bool widget::PopUp::onEventInput(const ewol::EventInput& _event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void widget::PopUp::setAnimationMode(animation_te _animation) {
|
||||
void widget::PopUp::setAnimationMode(enum animation _animation) {
|
||||
m_animation = _animation;
|
||||
if (true == m_shaper.changeStatusIn((int32_t)_animation) ) {
|
||||
periodicCallEnable();
|
||||
|
@ -74,23 +74,23 @@ namespace widget {
|
||||
private:
|
||||
//float m_slidingProgress; //!< ratio progression of a sliding
|
||||
public:
|
||||
typedef enum {
|
||||
enum animation {
|
||||
animationNone, //!< No annimation
|
||||
animationIncrease, //!< element came strart with no size and increase with the corect size.
|
||||
} animation_te;
|
||||
};
|
||||
private:
|
||||
animation_te m_animation; //!< Methode add and remove element (animation)
|
||||
enum animation m_animation; //!< Methode add and remove element (animation)
|
||||
public:
|
||||
/**
|
||||
* @brief set an animation mode for the new element set in the Widget container.
|
||||
* @param[in] _animation The new animation mode.
|
||||
*/
|
||||
void setAnimationMode(animation_te _animation);
|
||||
void setAnimationMode(enum animation _animation);
|
||||
/**
|
||||
* @brief get the current animation mode.
|
||||
* @return The animation mode.
|
||||
*/
|
||||
animation_te getAnimationMode(void) const {
|
||||
enum animation getAnimationMode(void) const {
|
||||
return m_animation;
|
||||
};
|
||||
|
||||
|
@ -28,7 +28,7 @@ widget::Scroll::Scroll(void) :
|
||||
m_limit(0.15,0.5),
|
||||
m_pixelScrolling(20),
|
||||
m_highSpeedStartPos(0,0),
|
||||
m_highSpeedMode(SCROLL_DISABLE),
|
||||
m_highSpeedMode(speedModeDisable),
|
||||
m_highSpeedButton(-1),
|
||||
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");
|
||||
@ -132,7 +132,7 @@ bool widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
if (relativePos.x() >= (m_size.x()-SCROLL_BAR_SPACE)) {
|
||||
if( m_size.y() < scrollSize.y()
|
||||
|| scrollOffset.y() != 0) {
|
||||
m_highSpeedMode = widget::SCROLL_ENABLE_VERTICAL;
|
||||
m_highSpeedMode = speedModeEnableVertical;
|
||||
m_highSpeedType = ewol::keyEvent::typeMouse;
|
||||
m_highSpeedStartPos.setX(relativePos.x());
|
||||
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)) {
|
||||
if( m_size.x() < scrollSize.x()
|
||||
|| scrollOffset.x()!=0) {
|
||||
m_highSpeedMode = widget::SCROLL_ENABLE_HORIZONTAL;
|
||||
m_highSpeedMode = speedModeEnableHorizontal;
|
||||
m_highSpeedType = ewol::keyEvent::typeMouse;
|
||||
m_highSpeedStartPos.setX(scrollOffset.x() / scrollSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2));
|
||||
m_highSpeedStartPos.setY(relativePos.y());
|
||||
@ -189,41 +189,42 @@ bool widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
}
|
||||
}else if (_event.getId() == 2) {
|
||||
if (_event.getStatus() == ewol::keyEvent::statusDown) {
|
||||
m_highSpeedMode = widget::SCROLL_INIT;
|
||||
m_highSpeedMode = speedModeInit;
|
||||
m_highSpeedType = ewol::keyEvent::typeMouse;
|
||||
m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y());
|
||||
m_highSpeedButton = 2;
|
||||
// not really use... == > just keep some informations
|
||||
return false;
|
||||
}
|
||||
} else if( widget::SCROLL_DISABLE!=m_highSpeedMode
|
||||
} else if( m_highSpeedMode != speedModeDisable
|
||||
&& _event.getStatus() == ewol::keyEvent::statusLeave) {
|
||||
m_highSpeedMode = widget::SCROLL_DISABLE;
|
||||
m_highSpeedMode = speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
markToRedraw();
|
||||
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 (widget::SCROLL_INIT == m_highSpeedMode) {
|
||||
if (m_highSpeedMode == speedModeInit) {
|
||||
// TODO : generate back the down event ...
|
||||
m_highSpeedMode = widget::SCROLL_DISABLE;
|
||||
m_highSpeedMode = speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
return false;
|
||||
} else {
|
||||
m_highSpeedMode = widget::SCROLL_GREP_END_EVENT;
|
||||
m_highSpeedMode = speedModeGrepEndEvent;
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
} else if (widget::SCROLL_GREP_END_EVENT == m_highSpeedMode) {
|
||||
} else if (m_highSpeedMode == speedModeGrepEndEvent) {
|
||||
if (_event.getStatus() == ewol::keyEvent::statusSingle) {
|
||||
m_highSpeedMode = widget::SCROLL_DISABLE;
|
||||
m_highSpeedMode = speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
m_highSpeedButton = -1;
|
||||
markToRedraw();
|
||||
}
|
||||
return true;
|
||||
} else if( widget::SCROLL_INIT == m_highSpeedMode
|
||||
} else if( m_highSpeedMode == speedModeInit
|
||||
&& _event.getStatus() == ewol::keyEvent::statusMove) {
|
||||
// wait that the cursor move more than 10 px to enable it :
|
||||
if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10
|
||||
@ -231,18 +232,18 @@ bool widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
// the scrooling can start :
|
||||
// select the direction :
|
||||
if (relativePos.x() == m_highSpeedStartPos.x()) {
|
||||
m_highSpeedMode = widget::SCROLL_ENABLE_VERTICAL;
|
||||
m_highSpeedMode = speedModeEnableVertical;
|
||||
} else if (relativePos.y() == m_highSpeedStartPos.y()) {
|
||||
m_highSpeedMode = widget::SCROLL_ENABLE_HORIZONTAL;
|
||||
m_highSpeedMode = speedModeEnableHorizontal;
|
||||
} else {
|
||||
float coef = (relativePos.y() - m_highSpeedStartPos.y()) / (relativePos.x() - m_highSpeedStartPos.x());
|
||||
if (abs(coef) <= 1 ) {
|
||||
m_highSpeedMode = widget::SCROLL_ENABLE_HORIZONTAL;
|
||||
m_highSpeedMode = speedModeEnableHorizontal;
|
||||
} 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));
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
if( widget::SCROLL_ENABLE_HORIZONTAL == m_highSpeedMode
|
||||
if( m_highSpeedMode == speedModeEnableHorizontal
|
||||
&& _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(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;
|
||||
}
|
||||
if( widget::SCROLL_ENABLE_VERTICAL == m_highSpeedMode
|
||||
if( m_highSpeedMode == speedModeEnableVertical
|
||||
&& _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(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()) {
|
||||
//EWOL_VERBOSE("event 1 << " << (int32_t)typeEvent << "(" << x << "," << y << ")");
|
||||
if (ewol::keyEvent::statusDown == _event.getStatus()) {
|
||||
m_highSpeedMode = widget::SCROLL_INIT;
|
||||
m_highSpeedMode = speedModeInit;
|
||||
m_highSpeedType = ewol::keyEvent::typeFinger;
|
||||
m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y());
|
||||
EWOL_VERBOSE("SCROOL == > INIT");
|
||||
return true;
|
||||
} else if (ewol::keyEvent::statusUp == _event.getStatus()) {
|
||||
m_highSpeedMode = widget::SCROLL_DISABLE;
|
||||
m_highSpeedMode = speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
EWOL_VERBOSE("SCROOL == > DISABLE");
|
||||
markToRedraw();
|
||||
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 :
|
||||
if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10
|
||||
|| abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) {
|
||||
// the scrooling can start :
|
||||
// select the direction :
|
||||
m_highSpeedMode = widget::SCROLL_ENABLE_FINGER;
|
||||
m_highSpeedMode = speedModeEnableFinger;
|
||||
EWOL_VERBOSE("SCROOL == > ENABLE");
|
||||
markToRedraw();
|
||||
}
|
||||
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.setX(scrollOffset.x() - relativePos.x() - m_highSpeedStartPos.x());
|
||||
scrollOffset.setY(scrollOffset.y() - relativePos.y() - m_highSpeedStartPos.y());
|
||||
@ -315,8 +319,9 @@ bool widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
} else if (widget::SCROLL_DISABLE!=m_highSpeedMode && ewol::keyEvent::statusLeave == _event.getStatus()) {
|
||||
m_highSpeedMode = widget::SCROLL_DISABLE;
|
||||
} else if ( m_highSpeedMode != speedModeDisable
|
||||
&& ewol::keyEvent::statusLeave == _event.getStatus()) {
|
||||
m_highSpeedMode = speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
EWOL_VERBOSE("SCROOL == > DISABLE");
|
||||
markToRedraw();
|
||||
|
@ -17,19 +17,19 @@
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
|
||||
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
|
||||
*/
|
||||
class Scroll : public widget::Container {
|
||||
public:
|
||||
enum highSpeedMode {
|
||||
speedModeDisable,
|
||||
speedModeInit,
|
||||
speedModeEnableFinger, // Specific for touchpad
|
||||
speedModeEnableHorizontal, // Specific for mouse
|
||||
speedModeEnableVertical, // Specific for mouse
|
||||
speedModeGrepEndEvent
|
||||
};
|
||||
public:
|
||||
// Cinfig parameter list:
|
||||
static const char* const configLimit;
|
||||
@ -42,9 +42,9 @@ namespace widget {
|
||||
private:
|
||||
float m_pixelScrolling;
|
||||
vec2 m_highSpeedStartPos;
|
||||
highSpeedMode_te m_highSpeedMode;
|
||||
enum highSpeedMode m_highSpeedMode;
|
||||
int32_t m_highSpeedButton;
|
||||
ewol::keyEvent::type_te m_highSpeedType;
|
||||
enum ewol::keyEvent::type m_highSpeedType;
|
||||
public:
|
||||
Scroll(void);
|
||||
virtual ~Scroll(void);
|
||||
|
@ -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_borderSize(),
|
||||
m_animation(animationNone),
|
||||
@ -44,13 +44,13 @@ void widget::Sizer::setBorderSize(const ewol::Dimension& _newBorderSize) {
|
||||
requestUpdateSize();
|
||||
}
|
||||
|
||||
void widget::Sizer::setMode(widget::Sizer::displayMode_te _mode) {
|
||||
void widget::Sizer::setMode(enum displayMode _mode) {
|
||||
m_mode = _mode;
|
||||
markToRedraw();
|
||||
requestUpdateSize();
|
||||
}
|
||||
|
||||
widget::Sizer::displayMode_te widget::Sizer::getMode(void) {
|
||||
enum widget::Sizer::displayMode widget::Sizer::getMode(void) {
|
||||
return m_mode;
|
||||
}
|
||||
|
||||
|
@ -25,18 +25,18 @@ namespace widget {
|
||||
*/
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
public:
|
||||
typedef enum {
|
||||
enum displayMode {
|
||||
modeVert, //!< Vertical mode
|
||||
modeHori, //!< Horizontal mode
|
||||
} displayMode_te;
|
||||
};
|
||||
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:
|
||||
/**
|
||||
* @brief Constructor
|
||||
* @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
|
||||
*/
|
||||
@ -45,12 +45,12 @@ namespace widget {
|
||||
* @brief set the mode to display 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.
|
||||
* @return The current mode to display the elements.
|
||||
*/
|
||||
displayMode_te getMode(void);
|
||||
enum displayMode getMode(void);
|
||||
private:
|
||||
ewol::Dimension m_borderSize; //!< Border size needed for all the display
|
||||
public:
|
||||
@ -67,29 +67,29 @@ namespace widget {
|
||||
return m_borderSize;
|
||||
};
|
||||
public:
|
||||
typedef enum {
|
||||
enum animation {
|
||||
animationNone, //!< No annimation
|
||||
animationTop, //!< element came from the top
|
||||
animationbuttom, //!< element came from the buttom
|
||||
animationLeft, //!< element came from the Left
|
||||
animationRight //!< element came from the right
|
||||
//animationZoom //!< element came from zooming
|
||||
} animation_te;
|
||||
};
|
||||
private:
|
||||
animation_te m_animation; //!< Methode add and remove element (animation)
|
||||
enum animation m_animation; //!< Methode add and remove element (animation)
|
||||
public:
|
||||
/**
|
||||
* @brief set an animation mode for the new element set in the Widget container.
|
||||
* @param[in] _animation The new animation mode.
|
||||
*/
|
||||
void setAnimationMode(animation_te _animation) {
|
||||
void setAnimationMode(enum animation _animation) {
|
||||
m_animation = _animation;
|
||||
};
|
||||
/**
|
||||
* @brief get the current animation mode.
|
||||
* @return The animation mode.
|
||||
*/
|
||||
animation_te getAnimationMode(void) {
|
||||
enum animation getAnimationMode(void) {
|
||||
return m_animation;
|
||||
};
|
||||
private:
|
||||
|
@ -15,7 +15,7 @@ static const char* l_listsladingMode[widget::WSlider::sladingTransition_count] =
|
||||
"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];
|
||||
return _os;
|
||||
}
|
||||
@ -161,7 +161,7 @@ void widget::WSlider::subWidgetSelectSet(const etk::UString& _widgetName) {
|
||||
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) {
|
||||
m_transitionSlide = _mode;
|
||||
markToRedraw();
|
||||
@ -269,7 +269,7 @@ bool widget::WSlider::onSetConfig(const ewol::EConfig& _conf) {
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == configMode) {
|
||||
sladingMode_te tmpTransition = sladingTransitionHori;
|
||||
enum sladingMode tmpTransition = sladingTransitionHori;
|
||||
if(true == _conf.getData().compareNoCase("vert")) {
|
||||
tmpTransition = sladingTransitionVert;
|
||||
} else if(true == _conf.getData().compareNoCase("hori")) {
|
||||
|
@ -27,11 +27,11 @@ namespace widget {
|
||||
static const char* const eventStopSlide;
|
||||
// Config list of properties
|
||||
static const char* const configMode;
|
||||
typedef enum {
|
||||
enum sladingMode {
|
||||
sladingTransitionVert,
|
||||
sladingTransitionHori,
|
||||
sladingTransition_count,
|
||||
} sladingMode_te;
|
||||
};
|
||||
public:
|
||||
WSlider(void);
|
||||
virtual ~WSlider(void);
|
||||
@ -74,18 +74,18 @@ namespace widget {
|
||||
return m_transitionSpeed;
|
||||
};
|
||||
private:
|
||||
sladingMode_te m_transitionSlide; //!< mode to slide the widgets
|
||||
enum sladingMode m_transitionSlide; //!< mode to slide the widgets
|
||||
public:
|
||||
/**
|
||||
* @brief set a new mode of sliding element
|
||||
* @param[in] _mode new display mode
|
||||
*/
|
||||
void setTransitionMode(sladingMode_te _mode);
|
||||
void setTransitionMode(enum sladingMode _mode);
|
||||
/**
|
||||
* @brief get a new mode of sliding element
|
||||
* @return The current sliding mode
|
||||
*/
|
||||
sladingMode_te getTransitionMode(void) {
|
||||
enum sladingMode getTransitionMode(void) {
|
||||
return m_transitionSlide;
|
||||
};
|
||||
public: // Derived function
|
||||
@ -101,7 +101,7 @@ namespace widget {
|
||||
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
|
||||
|
@ -31,7 +31,7 @@ void ewol::DrawProperty::limit(const vec2& _origin, const vec2& _size) {
|
||||
#undef __class__
|
||||
#define __class__ "gravity"
|
||||
|
||||
etk::UString ewol::gravityToString(const ewol::gravity_te _obj) {
|
||||
etk::UString ewol::gravityToString(const enum ewol::gravity _obj) {
|
||||
switch(_obj) {
|
||||
case ewol::gravityCenter:
|
||||
return "center";
|
||||
@ -55,7 +55,7 @@ etk::UString ewol::gravityToString(const ewol::gravity_te _obj) {
|
||||
return "unknow";
|
||||
}
|
||||
|
||||
ewol::gravity_te ewol::stringToGravity(const etk::UString& _obj) {
|
||||
enum ewol::gravity ewol::stringToGravity(const etk::UString& _obj) {
|
||||
if (_obj == "center") {
|
||||
return ewol::gravityCenter;
|
||||
} else if (_obj == "top-left") {
|
||||
@ -78,7 +78,7 @@ ewol::gravity_te ewol::stringToGravity(const etk::UString& _obj) {
|
||||
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);
|
||||
return _os;
|
||||
}
|
||||
@ -606,7 +606,7 @@ void ewol::Widget::shortCutClean(void) {
|
||||
|
||||
bool ewol::Widget::onEventShortCut(ewol::SpecialKey& _special,
|
||||
etk::UChar _unicodeValue,
|
||||
ewol::keyEvent::keyboard_te _kbMove,
|
||||
enum ewol::keyEvent::keyboard _kbMove,
|
||||
bool _isDown) {
|
||||
if (_unicodeValue >= 'A' && _unicodeValue <= 'Z') {
|
||||
_unicodeValue += 'a' - 'A';
|
||||
@ -658,13 +658,13 @@ bool ewol::Widget::getGrabStatus(void) {
|
||||
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);
|
||||
m_cursorDisplay = _newCursor;
|
||||
getContext().setCursor(m_cursorDisplay);
|
||||
}
|
||||
|
||||
ewol::cursorDisplay_te ewol::Widget::getCursor(void) {
|
||||
enum ewol::cursorDisplay ewol::Widget::getCursor(void) {
|
||||
return m_cursorDisplay;
|
||||
}
|
||||
|
||||
@ -701,8 +701,7 @@ bool ewol::Widget::systemEventInput(ewol::EventInputSystem& _event) {
|
||||
return onEventInput(_event.m_event);
|
||||
}
|
||||
|
||||
|
||||
void ewol::Widget::setGravity(gravity_te _gravity) {
|
||||
void ewol::Widget::setGravity(enum gravity _gravity) {
|
||||
m_gravity = _gravity;
|
||||
markToRedraw();
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ namespace ewol {
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::DrawProperty& _obj);
|
||||
|
||||
typedef enum {
|
||||
enum gravity {
|
||||
gravityCenter=0x00,
|
||||
gravityTopLeft=0x05,
|
||||
gravityTop=0x01,
|
||||
@ -74,10 +74,10 @@ namespace ewol {
|
||||
gravityButtom=0x04,
|
||||
gravityButtomLeft=0x0C,
|
||||
gravityLeft=0x08,
|
||||
}gravity_te;
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::gravity_te _obj);
|
||||
etk::UString gravityToString(const ewol::gravity_te _obj);
|
||||
ewol::gravity_te stringToGravity(const etk::UString& _obj);
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const enum ewol::gravity _obj);
|
||||
etk::UString gravityToString(const enum ewol::gravity _obj);
|
||||
enum ewol::gravity stringToGravity(const etk::UString& _obj);
|
||||
|
||||
class EventShortCut {
|
||||
public:
|
||||
@ -86,7 +86,7 @@ namespace ewol {
|
||||
etk::UString eventData; //!< data link with the event
|
||||
ewol::SpecialKey specialKey; //!< special board key
|
||||
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) {
|
||||
broadcastEvent = false;
|
||||
generateEventId = NULL;
|
||||
@ -346,21 +346,23 @@ namespace ewol {
|
||||
* @brief get the visibility of the widget
|
||||
* @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:
|
||||
gravity_te m_gravity; //!< Gravity of the widget
|
||||
enum gravity m_gravity; //!< Gravity of the widget
|
||||
public:
|
||||
/**
|
||||
* @brief set the widget gravity
|
||||
* @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
|
||||
* @return the gravity type
|
||||
*/
|
||||
virtual gravity_te getGravity(void) {
|
||||
virtual enum gravity getGravity(void) {
|
||||
return m_gravity;
|
||||
};
|
||||
// ----------------------------------------------------------------------------------------------------------------
|
||||
@ -577,7 +579,7 @@ namespace ewol {
|
||||
* @note : need to have focus ...
|
||||
* @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
|
||||
@ -611,7 +613,7 @@ namespace ewol {
|
||||
*/
|
||||
virtual bool onEventShortCut(ewol::SpecialKey& _special,
|
||||
etk::UChar _unicodeValue,
|
||||
ewol::keyEvent::keyboard_te _kbMove,
|
||||
enum ewol::keyEvent::keyboard _kbMove,
|
||||
bool _isDown);
|
||||
// ----------------------------------------------------------------------------------------------------------------
|
||||
// -- 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);
|
||||
private:
|
||||
ewol::cursorDisplay_te m_cursorDisplay;
|
||||
enum ewol::cursorDisplay m_cursorDisplay;
|
||||
public:
|
||||
/**
|
||||
* @brief set the cursor display type.
|
||||
* @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.
|
||||
* @return the type of the cursor.
|
||||
*/
|
||||
virtual ewol::cursorDisplay_te getCursor(void);
|
||||
virtual enum ewol::cursorDisplay getCursor(void);
|
||||
public: // Derived function
|
||||
virtual void onObjectRemove(ewol::EObject* _removeObject);
|
||||
virtual bool loadXML(exml::Element* _node);
|
||||
|
@ -18,8 +18,8 @@
|
||||
widget::WidgetScrooled::WidgetScrooled(void) {
|
||||
m_originScrooled.setValue(0,0);
|
||||
m_pixelScrolling = 20;
|
||||
m_highSpeedMode = SCROLL_DISABLE;
|
||||
m_scroollingMode = SCROLL_MODE_NORMAL;
|
||||
m_highSpeedMode = widget::Scroll::speedModeDisable;
|
||||
m_scroollingMode = scroolModeNormal;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
m_highSpeedButton = -1;
|
||||
m_limitScrolling = 0.5;
|
||||
@ -34,7 +34,7 @@ widget::WidgetScrooled::~WidgetScrooled(void) {
|
||||
|
||||
void widget::WidgetScrooled::onRegenerateDisplay(void) {
|
||||
clearOObjectList();
|
||||
if (SCROLL_MODE_GAME == m_scroollingMode) {
|
||||
if (m_scroollingMode == scroolModeGame) {
|
||||
|
||||
} else {
|
||||
ewol::Drawing* tmpDraw = NULL;
|
||||
@ -79,16 +79,17 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
|
||||
vec2 relativePos = relativePosition(_event.getPos());
|
||||
// corection due to the open Gl invertion ...
|
||||
relativePos.setY(m_size.y() - relativePos.y());
|
||||
if (SCROLL_MODE_NORMAL == m_scroollingMode) {
|
||||
if( ewol::keyEvent::typeMouse == _event.getType()
|
||||
&& ( ewol::keyEvent::typeUnknow == m_highSpeedType
|
||||
|| ewol::keyEvent::typeMouse == m_highSpeedType ) ) {
|
||||
if (1 == _event.getId() && ewol::keyEvent::statusDown == _event.getStatus()) {
|
||||
if (m_scroollingMode == scroolModeNormal) {
|
||||
if ( _event.getType() == ewol::keyEvent::typeMouse
|
||||
&& ( m_highSpeedType == ewol::keyEvent::typeUnknow
|
||||
|| m_highSpeedType == ewol::keyEvent::typeMouse) ) {
|
||||
if ( _event.getId() == 1
|
||||
&& _event.getStatus() == ewol::keyEvent::statusDown) {
|
||||
// check if selected the scrolling position whth the scrolling bar ...
|
||||
if (relativePos.x() >= (m_size.x()-SCROLL_BAR_SPACE)) {
|
||||
if( m_size.y() < m_maxSize.y()
|
||||
|| m_originScrooled.y() != 0) {
|
||||
m_highSpeedMode = widget::SCROLL_ENABLE_VERTICAL;
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableVertical;
|
||||
m_highSpeedType = ewol::keyEvent::typeMouse;
|
||||
m_highSpeedStartPos.setX(relativePos.x());
|
||||
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)) {
|
||||
if( m_size.x() < m_maxSize.x()
|
||||
|| m_originScrooled.x()!=0) {
|
||||
m_highSpeedMode = widget::SCROLL_ENABLE_HORIZONTAL;
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableHorizontal;
|
||||
m_highSpeedType = ewol::keyEvent::typeMouse;
|
||||
m_highSpeedStartPos.setX(m_originScrooled.x() / m_maxSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2));
|
||||
m_highSpeedStartPos.setY(relativePos.y());
|
||||
@ -115,7 +116,8 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
|
||||
}
|
||||
}
|
||||
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()) {
|
||||
float zoom = getZoom()*1.1;
|
||||
@ -129,7 +131,8 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
|
||||
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()) {
|
||||
float zoom = getZoom()*0.9;
|
||||
@ -143,7 +146,7 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}else if (2 == _event.getId()) {
|
||||
}else if (_event.getId() == 2) {
|
||||
/*
|
||||
if (true == ewol::isSetCtrl()) {
|
||||
if (ewol::keyEvent::statusDown == typeEvent) {
|
||||
@ -151,59 +154,62 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
|
||||
setZoom(zoom);
|
||||
}
|
||||
} else */{
|
||||
if (ewol::keyEvent::statusDown == _event.getStatus()) {
|
||||
m_highSpeedMode = widget::SCROLL_INIT;
|
||||
if (_event.getStatus() == ewol::keyEvent::statusDown) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeInit;
|
||||
m_highSpeedType = ewol::keyEvent::typeMouse;
|
||||
m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y());
|
||||
m_highSpeedButton = 2;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if (widget::SCROLL_DISABLE!=m_highSpeedMode && ewol::keyEvent::statusLeave == _event.getStatus()) {
|
||||
m_highSpeedMode = widget::SCROLL_DISABLE;
|
||||
} else if ( m_highSpeedMode != widget::Scroll::speedModeDisable
|
||||
&& _event.getStatus() == ewol::keyEvent::statusLeave) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
if (_event.getId() == m_highSpeedButton && widget::SCROLL_DISABLE!=m_highSpeedMode) {
|
||||
if (ewol::keyEvent::statusUp == _event.getStatus()) {
|
||||
if (widget::SCROLL_INIT == m_highSpeedMode) {
|
||||
if ( _event.getId() == m_highSpeedButton
|
||||
&& m_highSpeedMode != widget::Scroll::speedModeDisable) {
|
||||
if (_event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
if (m_highSpeedMode == widget::Scroll::speedModeInit) {
|
||||
// TODO : generate back the down event ...
|
||||
m_highSpeedMode = widget::SCROLL_DISABLE;
|
||||
m_highSpeedMode = widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
return false;
|
||||
} else {
|
||||
m_highSpeedMode = widget::SCROLL_GREP_END_EVENT;
|
||||
m_highSpeedMode = widget::Scroll::speedModeGrepEndEvent;
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
} else if (widget::SCROLL_GREP_END_EVENT == m_highSpeedMode) {
|
||||
if (ewol::keyEvent::statusSingle == _event.getStatus()) {
|
||||
m_highSpeedMode = widget::SCROLL_DISABLE;
|
||||
} else if (m_highSpeedMode == widget::Scroll::speedModeGrepEndEvent) {
|
||||
if (_event.getStatus() == ewol::keyEvent::statusSingle) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
m_highSpeedButton = -1;
|
||||
markToRedraw();
|
||||
}
|
||||
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 :
|
||||
if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10
|
||||
|| abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) {
|
||||
// the scrooling can start :
|
||||
// select the direction :
|
||||
if (relativePos.x() == m_highSpeedStartPos.x()) {
|
||||
m_highSpeedMode = widget::SCROLL_ENABLE_VERTICAL;
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableVertical;
|
||||
} else if (relativePos.y() == m_highSpeedStartPos.y()) {
|
||||
m_highSpeedMode = widget::SCROLL_ENABLE_HORIZONTAL;
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableHorizontal;
|
||||
} else {
|
||||
float coef = (relativePos.y() - m_highSpeedStartPos.y()) / (relativePos.x() - m_highSpeedStartPos.x());
|
||||
if (abs(coef) <= 1 ) {
|
||||
m_highSpeedMode = widget::SCROLL_ENABLE_HORIZONTAL;
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableHorizontal;
|
||||
} 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));
|
||||
} else {
|
||||
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)));
|
||||
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(etk_avg(0, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling)));
|
||||
markToRedraw();
|
||||
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(etk_avg(0, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling)));
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if( ewol::keyEvent::typeFinger == _event.getType()
|
||||
&& ( ewol::keyEvent::typeUnknow == m_highSpeedType
|
||||
|| ewol::keyEvent::typeFinger == m_highSpeedType ) ) {
|
||||
if (1 == _event.getId()) {
|
||||
} else if ( _event.getType() == ewol::keyEvent::typeFinger
|
||||
&& ( m_highSpeedType == ewol::keyEvent::typeUnknow
|
||||
|| m_highSpeedType == ewol::keyEvent::typeFinger) ) {
|
||||
if (_event.getId() == 1) {
|
||||
EWOL_VERBOSE("event 1 " << _event);
|
||||
if (ewol::keyEvent::statusDown == _event.getStatus()) {
|
||||
m_highSpeedMode = widget::SCROLL_INIT;
|
||||
if (_event.getStatus() == ewol::keyEvent::statusDown) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeInit;
|
||||
m_highSpeedType = ewol::keyEvent::typeFinger;
|
||||
m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y());
|
||||
EWOL_DEBUG("SCROOL == > INIT");
|
||||
return true;
|
||||
} else if (ewol::keyEvent::statusUp == _event.getStatus()) {
|
||||
m_highSpeedMode = widget::SCROLL_DISABLE;
|
||||
} else if (_event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
EWOL_DEBUG("SCROOL == > DISABLE");
|
||||
markToRedraw();
|
||||
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 :
|
||||
if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10
|
||||
|| abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) {
|
||||
// the scrooling can start :
|
||||
// select the direction :
|
||||
m_highSpeedMode = widget::SCROLL_ENABLE_FINGER;
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableFinger;
|
||||
EWOL_DEBUG("SCROOL == > ENABLE");
|
||||
markToRedraw();
|
||||
}
|
||||
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.setX(m_originScrooled.x() - (relativePos.x() - m_highSpeedStartPos.x()));
|
||||
m_originScrooled.setY(m_originScrooled.y() - (relativePos.y() - m_highSpeedStartPos.y()));
|
||||
@ -263,21 +275,23 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
} else if (widget::SCROLL_DISABLE!=m_highSpeedMode && ewol::keyEvent::statusLeave == _event.getStatus()) {
|
||||
m_highSpeedMode = widget::SCROLL_DISABLE;
|
||||
} else if ( m_highSpeedMode == widget::Scroll::speedModeDisable
|
||||
&& _event.getStatus() == ewol::keyEvent::statusLeave) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
EWOL_DEBUG("SCROOL == > DISABLE");
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if (SCROLL_MODE_CENTER == m_scroollingMode) {
|
||||
if (ewol::keyEvent::typeMouse == _event.getType()) {
|
||||
} else if (m_scroollingMode == scroolModeCenter) {
|
||||
if (_event.getType() == ewol::keyEvent::typeMouse) {
|
||||
float tmp1=m_size.x() / m_maxSize.y();
|
||||
float tmp2=m_size.y() / m_maxSize.x();
|
||||
//EWOL_INFO(" elements Zoom : " << 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;
|
||||
if (tmp1 < 1.0) {
|
||||
m_zoom = etk_max(tmp1, m_zoom);
|
||||
@ -286,7 +300,8 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
|
||||
}
|
||||
markToRedraw();
|
||||
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;
|
||||
if (tmp1 > 1.0) {
|
||||
m_zoom = etk_min(tmp1, m_zoom);
|
||||
@ -297,7 +312,7 @@ bool widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if (SCROLL_MODE_GAME == m_scroollingMode) {
|
||||
} else if (m_scroollingMode == scroolModeGame) {
|
||||
|
||||
} else {
|
||||
EWOL_ERROR("Scrolling mode unknow ... " << m_scroollingMode );
|
||||
@ -335,7 +350,7 @@ void widget::WidgetScrooled::onDraw(void) {
|
||||
|
||||
void widget::WidgetScrooled::systemDraw(const ewol::DrawProperty& _displayProp) {
|
||||
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
|
||||
glViewport( m_origin.x(),
|
||||
m_origin.y(),
|
||||
@ -349,7 +364,7 @@ void widget::WidgetScrooled::systemDraw(const ewol::DrawProperty& _displayProp)
|
||||
ewol::openGL::setMatrix(tmpMat);
|
||||
// Call the widget drawing methode
|
||||
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
|
||||
glViewport( m_origin.x(),
|
||||
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;
|
||||
if (SCROLL_MODE_GAME == m_scroollingMode) {
|
||||
if (m_scroollingMode == scroolModeGame) {
|
||||
// set the scene maximum size :
|
||||
m_maxSize.setValue(etk_max(m_size.x(), m_size.y()),
|
||||
m_maxSize.x());
|
||||
|
@ -16,15 +16,16 @@
|
||||
#include <ewol/compositing/Compositing.h>
|
||||
|
||||
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
|
||||
*/
|
||||
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:
|
||||
etk::Vector<ewol::Compositing*> m_listOObject; //!< generic element to display...
|
||||
void addOObject(ewol::Compositing* _newObject, int32_t _pos=-1);
|
||||
@ -34,12 +35,12 @@ namespace widget {
|
||||
vec2 m_maxSize;
|
||||
float m_limitScrolling;
|
||||
private:
|
||||
scrollingMode_te m_scroollingMode; //!< mode of management of the scrooling
|
||||
enum scrollingMode m_scroollingMode; //!< mode of management of the scrooling
|
||||
float m_pixelScrolling;
|
||||
vec2 m_highSpeedStartPos;
|
||||
highSpeedMode_te m_highSpeedMode;
|
||||
enum Scroll::highSpeedMode m_highSpeedMode;
|
||||
int32_t m_highSpeedButton;
|
||||
ewol::keyEvent::type_te m_highSpeedType;
|
||||
enum ewol::keyEvent::type m_highSpeedType;
|
||||
public:
|
||||
WidgetScrooled(void);
|
||||
virtual ~WidgetScrooled(void);
|
||||
@ -64,7 +65,7 @@ namespace widget {
|
||||
* @brief Specify the mode of scrolling for this windows
|
||||
* @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
|
||||
* @param[in] _localSize new Maximum size
|
||||
|
@ -18,11 +18,11 @@ namespace ewol {
|
||||
/**
|
||||
* @ingroup ewolWidgetGroup
|
||||
*/
|
||||
class Windows :public ewol::Widget {
|
||||
class Windows : public ewol::Widget {
|
||||
public:
|
||||
Windows(void);
|
||||
virtual ~Windows(void);
|
||||
// internal event at ewol system :
|
||||
// internal event at ewol system :
|
||||
public:
|
||||
void sysDraw(void);
|
||||
void sysOnShow(void) {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user