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