[DEV] start a compleate rework of the lib to support the multiple instance in one binary ==> not win at all (BREAK)

This commit is contained in:
Edouard DUPIN 2013-08-28 21:35:24 +02:00
parent 8668ac9dd0
commit 1fd451961e
12 changed files with 1729 additions and 1886 deletions

View File

@ -89,7 +89,8 @@ void ewol::clipBoard::Set(ewol::clipBoard::clipboardListe_te _clipboardID, const
if( ewol::clipBoard::clipboardStd == _clipboardID if( ewol::clipBoard::clipboardStd == _clipboardID
|| ewol::clipBoard::clipboardSelection == _clipboardID) { || ewol::clipBoard::clipboardSelection == _clipboardID) {
guiInterface::ClipBoardSet(_clipboardID); //guiInterface::ClipBoardSet(_clipboardID);
EWOL_TODO("Set ClipBoard");
} }
} }
@ -103,10 +104,12 @@ void ewol::clipBoard::Request(ewol::clipBoard::clipboardListe_te _clipboardID)
if( ewol::clipBoard::clipboardStd == _clipboardID if( ewol::clipBoard::clipboardStd == _clipboardID
|| ewol::clipBoard::clipboardSelection == _clipboardID) { || ewol::clipBoard::clipboardSelection == _clipboardID) {
guiInterface::ClipBoardGet(_clipboardID); //guiInterface::ClipBoardGet(_clipboardID);
EWOL_TODO("Get ClipBoard");
} else { } else {
// generate an event on the main thread ... // generate an event on the main thread ...
eSystem::ClipBoardArrive(_clipboardID); //eSystem::ClipBoardArrive(_clipboardID);
EWOL_TODO("ClipBoard arrive");
} }
} }

View File

@ -13,15 +13,7 @@
#undef __class__ #undef __class__
#define __class__ "EObjectManager" #define __class__ "EObjectManager"
static bool IsInit = false; ewol::EObjectManager::EObjectManager(void)
// internal element of the widget manager :
static etk::Vector<ewol::EObject*> m_eObjectList; // all widget allocated ==> all time increment ... never removed ...
static etk::Vector<ewol::EObject*> m_eObjectAutoRemoveList; // all widget allocated
void ewol::EObjectManager::Init(void)
{ {
EWOL_DEBUG("==> Init EObject-Manager"); EWOL_DEBUG("==> Init EObject-Manager");
// Can create mlemory leak ... ==> but not predictable comportement otherwise ... // Can create mlemory leak ... ==> but not predictable comportement otherwise ...
@ -30,7 +22,7 @@ void ewol::EObjectManager::Init(void)
IsInit = true; IsInit = true;
} }
void ewol::EObjectManager::UnInit(void) ewol::EObjectManager::~EObjectManager(void)
{ {
EWOL_DEBUG("==> Un-Init EObject-Manager"); EWOL_DEBUG("==> Un-Init EObject-Manager");
RemoveAllAutoRemove(); RemoveAllAutoRemove();

View File

@ -12,18 +12,24 @@
#include <etk/types.h> #include <etk/types.h>
#include <ewol/eObject/EObject.h> #include <ewol/eObject/EObject.h>
namespace ewol { namespace ewol
namespace EObjectManager { {
void Init(void); class EObjectManager
void UnInit(void); {
void Add(ewol::EObject* _object); private:
void Rm(ewol::EObject* _object); etk::Vector<ewol::EObject*> m_eObjectList; // all widget allocated ==> all time increment ... never removed ...
int32_t GetNumberObject(void); etk::Vector<ewol::EObject*> m_eObjectAutoRemoveList; // all widget allocated
public:
void AutoRemove(ewol::EObject* _object); EObjectManager(void);
void RemoveAllAutoRemove(void); ~EObjectManager(void);
void Add(ewol::EObject* _object);
ewol::EObject* Get(const etk::UString& _name); void Rm(ewol::EObject* _object);
int32_t GetNumberObject(void);
void AutoRemove(ewol::EObject* _object);
void RemoveAllAutoRemove(void);
ewol::EObject* Get(const etk::UString& _name);
}; };
}; };

View File

@ -19,12 +19,12 @@
#include <ewol/UserConfig.h> #include <ewol/UserConfig.h>
#undef __class__ #undef __class__
#define __class__ "ewol" #define __class__ "ewol"
/*
void ewol::SetFontSourcesFolder(bool _inOsSystem) void ewol::SetFontSourcesFolder(bool _inOsSystem)
{ {
ewol::font::SetFontPropety(_inOsSystem); ewol::font::SetFontPropety(_inOsSystem);
} }
*/
int32_t ewol::Run(int32_t _argc, const char* _argv[]) int32_t ewol::Run(int32_t _argc, const char* _argv[])
{ {
if (NULL!=_argv) { if (NULL!=_argv) {
@ -60,14 +60,14 @@ int32_t ewol::Run(int32_t _argc, const char* _argv[])
} }
} }
// call standard RUN ... // call standard RUN ...
int32_t error = guiInterface::main(_argc, _argv); int32_t error = ewol::eSystem::main(_argc, _argv);
ewol::commandLine::Clean(); ewol::commandLine::Clean();
return error; return error;
} }
/*
void ewol::Stop(void) void ewol::Stop(void)
{ {
guiInterface::Stop(); guiInterface::Stop();
@ -126,7 +126,7 @@ void ewol::SetTitle(const etk::UString& _title)
etk::UString title = _title; etk::UString title = _title;
guiInterface::SetTitle(title); guiInterface::SetTitle(title);
} }
*/
etk::UString ewol::GetVersion(void) etk::UString ewol::GetVersion(void)
{ {
#define FIRST_YEAR (2011) #define FIRST_YEAR (2011)
@ -140,9 +140,9 @@ etk::UString ewol::GetVersion(void)
int64_t ewol::GetTime(void) int64_t ewol::GetTime(void)
{ {
return guiInterface::GetTime(); return ewol::eSystem::GetTime();
} }
/*
void ewol::InputEventTransfertWidget(ewol::Widget* _source, ewol::Widget* _destination) void ewol::InputEventTransfertWidget(ewol::Widget* _source, ewol::Widget* _destination)
{ {
eSystem::InputEventTransfertWidget(_source, _destination); eSystem::InputEventTransfertWidget(_source, _destination);
@ -158,7 +158,7 @@ void ewol::SetIcon(const etk::UString& _icon)
{ {
guiInterface::SetIcon(_icon); guiInterface::SetIcon(_icon);
} }
*/

View File

@ -11,8 +11,6 @@
#include <etk/types.h> #include <etk/types.h>
#include <etk/UString.h> #include <etk/UString.h>
#include <ewol/widget/Widget.h>
#include <ewol/widget/Windows.h>
namespace ewol namespace ewol
{ {
@ -28,51 +26,6 @@ namespace ewol
* @return normal error int for the application error management * @return normal error int for the application error management
*/ */
int32_t Run(int32_t _argc, const char* _argv[]); int32_t Run(int32_t _argc, const char* _argv[]);
/**
* @brief Request the stop of the program (teminate all the process) no more call at hte application without APP_UnInit();
*/
void Stop(void);
/**
* @brief Set a windows to diaplay
* @param[in] _windows The requested windows that migt be use for the display
*/
void WindowsSet(ewol::Windows* _windows);
/**
* @brief Add a PopUp at the current windows ==> this widget is display over the current element
* @param[in] _tmpWidget A pointer on the pop-up widget that might be displayed
*/
void WindowsPopUpAdd(ewol::Widget* _tmpWidget);
/**
* @brief Change the windows size
* @note work only on computer
* @param[in] _size The new windows size
*/
void ChangeSize(const ivec2& _size);
/**
* @brief Change the windows curent position
* @note work only on computer
* @param[in] _pos The new windows position
*/
void ChangePos(const ivec2& _pos);
/**
* @brief Generate the action of redrawing all the display.
*/
void ForceRedrawAll(void);
/**
* @brief Force the calculation of all the size of the widgets
*/
void RequestUpdateSize(void);
/**
* @brief Change the status of the Keyboard displat
* @note Specific for mobile platform
* @param[in] _hide Status of the visibility of the keyboard
*/
void Keyboard(bool _hide);
/**
* @brief Change the title display.
* @param[in] title the new title that might be displayed
*/
void SetTitle(const etk::UString& _title);
/** /**
* @brief Get EWOL version * @brief Get EWOL version
* @return The string that describe ewol version * @return The string that describe ewol version
@ -83,33 +36,18 @@ namespace ewol
* @return The current time * @return The current time
*/ */
int64_t GetTime(void); int64_t GetTime(void);
/**
* @brief This is to transfert the event from one widget to another one
* @param _source the widget where the event came from
* @param _destination the widget where the event mitgh be generated now
*/
void InputEventTransfertWidget(ewol::Widget* _source, ewol::Widget* _destination);
typedef enum { typedef enum {
SCREEN_ORIENTATION_AUTO = 0, SCREEN_ORIENTATION_AUTO = 0,
SCREEN_ORIENTATION_LANDSCAPE, SCREEN_ORIENTATION_LANDSCAPE,
SCREEN_ORIENTATION_PORTRAIT, SCREEN_ORIENTATION_PORTRAIT,
} orientation_te; } orientation_te;
/** /*
/ **
* @brief Force a specific orientation for mobile devices * @brief Force a specific orientation for mobile devices
* @param[in] orientation the requested position. * @param[in] orientation the requested position.
*/ * /
void ForceOrientation(ewol::orientation_te _orientation); void ForceOrientation(ewol::orientation_te _orientation);
/** */
* @brief Set the Icon of the program
* @param[in] _icon new filename icon of the curent program.
* @note Does not work on Andoid
*/
void SetIcon(const etk::UString& _icon);
/**
* @brief Select the position of the font folder (in the OS path or in the DATA: path)
* @param[in] _inOsSystem Set at true if you want to select the os system folder.
*/
void SetFontSourcesFolder(bool _inOsSystem);
}; };
#endif #endif

View File

@ -9,7 +9,6 @@
#include <unistd.h> #include <unistd.h>
#include <etk/types.h> #include <etk/types.h>
#include <etk/MessageFifo.h>
#include <ewol/ewol.h> #include <ewol/ewol.h>
#include <ewol/Dimension.h> #include <ewol/Dimension.h>
@ -25,105 +24,41 @@
#include <ewol/renderer/ResourceManager.h> #include <ewol/renderer/ResourceManager.h>
#include <ewol/renderer/os/eSystemInput.h> #include <ewol/renderer/os/eSystemInput.h>
#include <ewol/renderer/openGL.h> #include <ewol/renderer/openGL.h>
#include <ewol/renderer/os/Fps.h>
#include <ewol/widget/WidgetManager.h> #include <ewol/widget/WidgetManager.h>
#include <etk/os/FSNode.h>
#include <date/date.h> #include <date/date.h>
static bool requestEndProcessing = false;
static bool isGlobalSystemInit = false;
static ewol::Windows* windowsCurrent = NULL;
static int64_t previousDisplayTime = 0; // this is to limit framerate ... in case...
static ivec2 windowsSize(320, 480);
static ewol::eSystemInput l_managementInput;
static ewol::Fps l_FpsSystemEvent( "Event ", false);
static ewol::Fps l_FpsSystemContext( "Context ", false);
static ewol::Fps l_FpsSystem( "Draw ", true);
static ewol::Fps l_FpsFlush( "Flush ", false);
void eSystem::InputEventTransfertWidget(ewol::Widget* source, ewol::Widget* destination) void ewol::eSystem::InputEventTransfertWidget(ewol::Widget* source, ewol::Widget* destination)
{ {
l_managementInput.TransfertEvent(source, destination); m_managementInput.TransfertEvent(source, destination);
} }
void eSystem::InputEventGrabPointer(ewol::Widget* widget) void ewol::eSystem::InputEventGrabPointer(ewol::Widget* widget)
{ {
l_managementInput.GrabPointer(widget); m_managementInput.GrabPointer(widget);
} }
void eSystem::InputEventUnGrabPointer(void) void ewol::eSystem::InputEventUnGrabPointer(void)
{ {
l_managementInput.UnGrabPointer(); m_managementInput.UnGrabPointer();
} }
typedef enum { void ewol::eSystem::ProcessEvents(void)
THREAD_NONE,
THREAD_INIT,
THREAD_RECALCULATE_SIZE,
THREAD_RESIZE,
THREAD_HIDE,
THREAD_SHOW,
THREAD_INPUT_MOTION,
THREAD_INPUT_STATE,
THREAD_KEYBORAD_KEY,
THREAD_KEYBORAD_MOVE,
THREAD_CLIPBOARD_ARRIVE,
} theadMessage_te;
class eSystemMessage {
public :
// specify the message type
theadMessage_te TypeMessage;
// can not set a union ...
ewol::clipBoard::clipboardListe_te clipboardID;
// InputId
ewol::keyEvent::type_te inputType;
int32_t inputId;
// generic dimentions
vec2 dimention;
// keyboard events :
bool repeateKey; //!< special flag for the repeating key on the PC interface
bool stateIsDown;
uniChar_t keyboardChar;
ewol::keyEvent::keyboard_te keyboardMove;
ewol::SpecialKey keyboardSpecial;
eSystemMessage(void) :
TypeMessage(THREAD_NONE),
clipboardID(ewol::clipBoard::clipboardStd),
inputType(ewol::keyEvent::typeUnknow),
inputId(-1),
dimention(0,0),
repeateKey(false),
stateIsDown(false),
keyboardChar(0),
keyboardMove(ewol::keyEvent::keyboardUnknow)
{
}
};
static etk::MessageFifo<eSystemMessage> l_msgSystem;
void ewolProcessEvents(void)
{ {
int32_t nbEvent = 0; int32_t nbEvent = 0;
//EWOL_DEBUG(" ******** Event"); //EWOL_DEBUG(" ******** Event");
eSystemMessage data; eSystemMessage data;
while (l_msgSystem.Count()>0) while (m_msgSystem.Count()>0)
{ {
nbEvent++; nbEvent++;
l_msgSystem.Wait(data); m_msgSystem.Wait(data);
//EWOL_DEBUG("EVENT"); //EWOL_DEBUG("EVENT");
switch (data.TypeMessage) { switch (data.TypeMessage) {
case THREAD_INIT: case THREAD_INIT:
@ -135,17 +70,17 @@ void ewolProcessEvents(void)
break; break;
case THREAD_RESIZE: case THREAD_RESIZE:
//EWOL_DEBUG("Receive MSG : THREAD_RESIZE"); //EWOL_DEBUG("Receive MSG : THREAD_RESIZE");
windowsSize = data.dimention; m_windowsSize = data.dimention;
ewol::dimension::SetPixelWindowsSize(vec2(windowsSize.x(),windowsSize.y())); ewol::dimension::SetPixelWindowsSize(m_windowsSize);
eSystem::ForceRedrawAll(); eSystem::ForceRedrawAll();
break; break;
case THREAD_INPUT_MOTION: case THREAD_INPUT_MOTION:
//EWOL_DEBUG("Receive MSG : THREAD_INPUT_MOTION"); //EWOL_DEBUG("Receive MSG : THREAD_INPUT_MOTION");
l_managementInput.Motion(data.inputType, data.inputId, data.dimention); m_managementInput.Motion(data.inputType, data.inputId, data.dimention);
break; break;
case THREAD_INPUT_STATE: case THREAD_INPUT_STATE:
//EWOL_DEBUG("Receive MSG : THREAD_INPUT_STATE"); //EWOL_DEBUG("Receive MSG : THREAD_INPUT_STATE");
l_managementInput.State(data.inputType, data.inputId, data.stateIsDown, data.dimention); m_managementInput.State(data.inputType, data.inputId, data.stateIsDown, data.dimention);
break; break;
case THREAD_KEYBORAD_KEY: case THREAD_KEYBORAD_KEY:
case THREAD_KEYBORAD_MOVE: case THREAD_KEYBORAD_MOVE:
@ -155,11 +90,11 @@ void ewolProcessEvents(void)
specialCurrentKey = data.keyboardSpecial; specialCurrentKey = data.keyboardSpecial;
//EWOL_DEBUG("newStatus Key" << specialCurrentKey); //EWOL_DEBUG("newStatus Key" << specialCurrentKey);
} }
if (NULL != windowsCurrent) { if (NULL != m_windowsCurrent) {
if (false==windowsCurrent->OnEventShortCut(data.keyboardSpecial, if (false==m_windowsCurrent->OnEventShortCut(data.keyboardSpecial,
data.keyboardChar, data.keyboardChar,
data.keyboardMove, data.keyboardMove,
data.stateIsDown) ) { data.stateIsDown) ) {
// Get the current Focused Widget : // Get the current Focused Widget :
ewol::Widget * tmpWidget = ewol::widgetManager::FocusGet(); ewol::Widget * tmpWidget = ewol::widgetManager::FocusGet();
if (NULL != tmpWidget) { if (NULL != tmpWidget) {
@ -221,9 +156,7 @@ void ewolProcessEvents(void)
} }
} }
void ewol::eSystem::SetArchiveDir(int mode, const char* str)
void eSystem::SetArchiveDir(int mode, const char* str)
{ {
switch(mode) switch(mode)
{ {
@ -250,345 +183,295 @@ void eSystem::SetArchiveDir(int mode, const char* str)
ewol::eSystem::eSystem(void) :
m_previousDisplayTime(0),
m_managementInput(*this),
void RequestInit(void) m_FpsSystemEvent( "Event ", false),
{ m_FpsSystemContext("Context ", false),
if (true == isGlobalSystemInit) { m_FpsSystem( "Draw ", true),
eSystemMessage data; m_FpsFlush( "Flush ", false),
data.TypeMessage = THREAD_INIT; m_windowsCurrent(NULL),
l_msgSystem.Post(data); m_windowsSize(320,480)
}
}
void eSystem::Init(void)
{ {
EWOL_INFO("==> Ewol System Init (BEGIN)"); EWOL_INFO("==> Ewol System Init (BEGIN)");
if (false == isGlobalSystemInit) { EWOL_INFO("v:" << ewol::GetVersion());
l_msgSystem.Clean(); EWOL_INFO("Build Date: " << date::GetYear() << "/" << date::GetMonth() << "/" << date::GetDay() << " " << date::GetHour() << "h" << date::GetMinute());
requestEndProcessing = false; // TODO : Remove this ...
etk::InitDefaultFolder("ewolApplNoName");
EWOL_INFO("v:" << ewol::GetVersion()); // TODO : Remove all of this gloabals ...
EWOL_INFO("Build Date: " << date::GetYear() << "/" << date::GetMonth() << "/" << date::GetDay() << " " << date::GetHour() << "h" << date::GetMinute()); ewol::openGL::Init();
etk::InitDefaultFolder("ewolApplNoName"); ewol::EObjectManager::Init();
ewol::openGL::Init(); ewol::EObjectMessageMultiCast::Init();
ewol::EObjectManager::Init(); m_managementInput.Reset();
ewol::EObjectMessageMultiCast::Init(); ewol::resource::Init();
l_managementInput.Reset(); ewol::widgetManager::Init();
ewol::resource::Init(); ewol::config::Init();
ewol::widgetManager::Init(); // request the init of the application in the main context of openGL ...
ewol::config::Init(); {
isGlobalSystemInit = true; eSystemMessage data;
// request the init of the application in the main context of openGL ... data.TypeMessage = THREAD_INIT;
RequestInit(); m_msgSystem.Post(data);
// force a recalculation
ewol::RequestUpdateSize();
#if defined(__EWOL_ANDROID_ORIENTATION_LANDSCAPE__)
ewol::ForceOrientation(ewol::SCREEN_ORIENTATION_LANDSCAPE);
#elif defined(__EWOL_ANDROID_ORIENTATION_PORTRAIT__)
ewol::ForceOrientation(ewol::SCREEN_ORIENTATION_PORTRAIT);
#else
ewol::ForceOrientation(ewol::SCREEN_ORIENTATION_AUTO);
#endif
} }
// force a recalculation
RequestUpdateSize();
#if defined(__EWOL_ANDROID_ORIENTATION_LANDSCAPE__)
ForceOrientation(ewol::SCREEN_ORIENTATION_LANDSCAPE);
#elif defined(__EWOL_ANDROID_ORIENTATION_PORTRAIT__)
ForceOrientation(ewol::SCREEN_ORIENTATION_PORTRAIT);
#else
ForceOrientation(ewol::SCREEN_ORIENTATION_AUTO);
#endif
EWOL_INFO("==> Ewol System Init (END)"); EWOL_INFO("==> Ewol System Init (END)");
} }
void eSystem::UnInit(void) ewol::eSystem::~eSystem(void)
{ {
EWOL_INFO("==> Ewol System Un-Init (BEGIN)"); EWOL_INFO("==> Ewol System Un-Init (BEGIN)");
if (true == isGlobalSystemInit) { // call application to uninit
isGlobalSystemInit = false; APP_UnInit();
requestEndProcessing = true; // unset all windows
// unset all windows SetCurrentWindows(NULL);
ewol::WindowsSet(NULL); ewol::widgetManager::UnInit();
// call application to uninit ewol::config::UnInit();
APP_UnInit(); ewol::EObjectMessageMultiCast::UnInit();
ewol::widgetManager::UnInit(); ewol::EObjectManager::UnInit();
ewol::config::UnInit(); ewol::resource::UnInit();
ewol::EObjectMessageMultiCast::UnInit(); ewol::openGL::UnInit();
ewol::EObjectManager::UnInit(); m_managementInput.Reset();
ewol::resource::UnInit(); m_msgSystem.Clean();
ewol::openGL::UnInit();
l_managementInput.Reset();
l_msgSystem.Clean();
}
EWOL_INFO("==> Ewol System Un-Init (END)"); EWOL_INFO("==> Ewol System Un-Init (END)");
} }
void eSystem::RequestUpdateSize(void) void ewol::eSystem::RequestUpdateSize(void)
{ {
if (true == isGlobalSystemInit) { eSystemMessage data;
eSystemMessage data; data.TypeMessage = THREAD_RECALCULATE_SIZE;
data.TypeMessage = THREAD_RECALCULATE_SIZE; m_msgSystem.Post(data);
l_msgSystem.Post(data);
}
} }
void eSystem::Resize(int w, int h ) void ewol::eSystem::OS_Resize(const vec2& _size)
{ {
// TODO : Better in the thread ... ==> but generate some init error ... // TODO : Better in the thread ... ==> but generate some init error ...
ewol::dimension::SetPixelWindowsSize(vec2(w,h)); ewol::dimension::SetPixelWindowsSize(_size);
if (true == isGlobalSystemInit) { eSystemMessage data;
eSystemMessage data; data.TypeMessage = THREAD_RESIZE;
data.TypeMessage = THREAD_RESIZE; data.dimention = _size;
data.dimention.setValue(w,h); m_msgSystem.Post(data);
l_msgSystem.Post(data);
}
} }
void eSystem::Move(int w, int h ) void ewol::eSystem::OS_Move(const vec2& _pos)
{ {
if (true == isGlobalSystemInit) { /*
/* eSystemMessage data;
eSystemMessage data; data.TypeMessage = THREAD_RESIZE;
data.TypeMessage = THREAD_RESIZE; data.resize.w = w;
data.resize.w = w; data.resize.h = h;
data.resize.h = h; m_msgSystem.Post(data);
l_msgSystem.Post(data); */
*/
}
} }
void eSystem::SetInputMotion(int pointerID, float x, float y ) void ewol::eSystem::OS_SetInputMotion(int _pointerID, const vec2& _pos )
{ {
if (true == isGlobalSystemInit) { eSystemMessage data;
eSystemMessage data; data.TypeMessage = THREAD_INPUT_MOTION;
data.TypeMessage = THREAD_INPUT_MOTION; data.inputType = ewol::keyEvent::typeFinger;
data.inputType = ewol::keyEvent::typeFinger; data.inputId = _pointerID;
data.inputId = pointerID; data.dimention = _pos;
data.dimention.setValue(x,y); m_msgSystem.Post(data);
l_msgSystem.Post(data);
}
} }
void eSystem::SetInputState(int pointerID, bool isDown, float x, float y ) void ewol::eSystem::OS_SetInputState(int _pointerID, bool _isDown, const vec2& _pos )
{ {
if (true == isGlobalSystemInit) { eSystemMessage data;
eSystemMessage data; data.TypeMessage = THREAD_INPUT_STATE;
data.TypeMessage = THREAD_INPUT_STATE; data.inputType = ewol::keyEvent::typeFinger;
data.inputType = ewol::keyEvent::typeFinger; data.inputId = _pointerID;
data.inputId = pointerID; data.stateIsDown = _isDown;
data.stateIsDown = isDown; data.dimention = _pos;
data.dimention.setValue(x,y); m_msgSystem.Post(data);
l_msgSystem.Post(data);
}
} }
void eSystem::SetMouseMotion(int pointerID, float x, float y ) void ewol::eSystem::OS_SetMouseMotion(int _pointerID, const vec2& _pos )
{ {
if (true == isGlobalSystemInit) { eSystemMessage data;
eSystemMessage data; data.TypeMessage = THREAD_INPUT_MOTION;
data.TypeMessage = THREAD_INPUT_MOTION; data.inputType = ewol::keyEvent::typeMouse;
data.inputType = ewol::keyEvent::typeMouse; data.inputId = _pointerID;
data.inputId = pointerID; data.dimention = _pos;
data.dimention.setValue(x,y); m_msgSystem.Post(data);
l_msgSystem.Post(data);
}
} }
void eSystem::SetMouseState(int pointerID, bool isDown, float x, float y ) void ewol::eSystem::OS_SetMouseState(int _pointerID, bool _isDown, const vec2& _pos )
{ {
if (true == isGlobalSystemInit) { eSystemMessage data;
eSystemMessage data; data.TypeMessage = THREAD_INPUT_STATE;
data.TypeMessage = THREAD_INPUT_STATE; data.inputType = ewol::keyEvent::typeMouse;
data.inputType = ewol::keyEvent::typeMouse; data.inputId = _pointerID;
data.inputId = pointerID; data.stateIsDown = _isDown;
data.stateIsDown = isDown; data.dimention = _pos;
data.dimention.setValue(x,y); m_msgSystem.Post(data);
l_msgSystem.Post(data);
}
} }
void eSystem::SetKeyboard(ewol::SpecialKey& special, void ewol::eSystem::OS_SetKeyboard(ewol::SpecialKey& _special,
uniChar_t myChar, uniChar_t _myChar,
bool isDown, bool _isDown,
bool isARepeateKey) bool _isARepeateKey)
{ {
if (true == isGlobalSystemInit) { eSystemMessage data;
eSystemMessage data; data.TypeMessage = THREAD_KEYBORAD_KEY;
data.TypeMessage = THREAD_KEYBORAD_KEY; data.stateIsDown = _isDown;
data.stateIsDown = isDown; data.keyboardChar = _myChar;
data.keyboardChar = myChar; data.keyboardSpecial = _special;
data.keyboardSpecial = special; data.repeateKey = _isARepeateKey;
data.repeateKey = isARepeateKey; m_msgSystem.Post(data);
l_msgSystem.Post(data);
}
} }
void eSystem::SetKeyboardMove(ewol::SpecialKey& special, void ewol::eSystem::OS_SetKeyboardMove(ewol::SpecialKey& _special,
ewol::keyEvent::keyboard_te move, ewol::keyEvent::keyboard_te _move,
bool isDown, bool _isDown,
bool isARepeateKey) bool _isARepeateKey)
{ {
if (true == isGlobalSystemInit) { eSystemMessage data;
eSystemMessage data; data.TypeMessage = THREAD_KEYBORAD_MOVE;
data.TypeMessage = THREAD_KEYBORAD_MOVE; data.stateIsDown = _isDown;
data.stateIsDown = isDown; data.keyboardMove = _move;
data.keyboardMove = move; data.keyboardSpecial = _special;
data.keyboardSpecial = special; data.repeateKey = _isARepeateKey;
data.repeateKey = isARepeateKey; m_msgSystem.Post(data);
l_msgSystem.Post(data);
}
} }
void eSystem::Hide(void) void ewol::eSystem::OS_Hide(void)
{ {
if (true == isGlobalSystemInit) { eSystemMessage data;
eSystemMessage data; data.TypeMessage = THREAD_HIDE;
data.TypeMessage = THREAD_HIDE; m_msgSystem.Post(data);
l_msgSystem.Post(data);
}
} }
void eSystem::Show(void) void ewol::eSystem::OS_Show(void)
{ {
if (true == isGlobalSystemInit) { eSystemMessage data;
eSystemMessage data; data.TypeMessage = THREAD_SHOW;
data.TypeMessage = THREAD_SHOW; m_msgSystem.Post(data);
l_msgSystem.Post(data);
}
} }
void eSystem::ClipBoardArrive(ewol::clipBoard::clipboardListe_te clipboardID) void ewol::eSystem::OS_ClipBoardArrive(ewol::clipBoard::clipboardListe_te _clipboardID)
{ {
if (true == isGlobalSystemInit) { eSystemMessage data;
eSystemMessage data; data.TypeMessage = THREAD_CLIPBOARD_ARRIVE;
data.TypeMessage = THREAD_CLIPBOARD_ARRIVE; data.clipboardID = _clipboardID;
data.clipboardID = clipboardID; m_msgSystem.Post(data);
l_msgSystem.Post(data);
}
} }
bool eSystem::Draw(bool displayEveryTime) bool ewol::eSystem::OS_Draw(bool _displayEveryTime)
{ {
int64_t currentTime = ewol::GetTime(); int64_t currentTime = ewol::GetTime();
// this is to prevent the multiple display at the a high frequency ... // this is to prevent the multiple display at the a high frequency ...
#if (!defined(__TARGET_OS__Android) && !defined(__TARGET_OS__Windows)) #if (!defined(__TARGET_OS__Android) && !defined(__TARGET_OS__Windows))
if(currentTime - previousDisplayTime < 1000000/120) { if(currentTime - m_previousDisplayTime < 1000000/120) {
usleep(1000); usleep(1000);
return false; return false;
} }
#endif #endif
previousDisplayTime = currentTime; m_previousDisplayTime = currentTime;
if (true == isGlobalSystemInit) { // process the events
// process the events m_FpsSystemEvent.Tic();
l_FpsSystemEvent.Tic(); ProcessEvents();
ewolProcessEvents(); // call all the widget that neded to do something periodicly
// call all the widget that neded to do something periodicly ewol::widgetManager::PeriodicCall(currentTime);
ewol::widgetManager::PeriodicCall(currentTime); // Remove all widget that they are no more usefull (these who decided to destroy themself)
// Remove all widget that they are no more usefull (these who decided to destroy themself) ewol::EObjectManager::RemoveAllAutoRemove();
ewol::EObjectManager::RemoveAllAutoRemove(); ewol::Windows* tmpWindows = eSystem::GetCurrentWindows();
ewol::Windows* tmpWindows = eSystem::GetCurrentWindows(); // check if the user selected a windows
// check if the user selected a windows if (NULL != tmpWindows) {
if (NULL != tmpWindows) { // Redraw all needed elements
// Redraw all needed elements tmpWindows->OnRegenerateDisplay();
tmpWindows->OnRegenerateDisplay();
}
l_FpsSystemEvent.IncrementCounter();
l_FpsSystemEvent.Toc();
bool needRedraw = ewol::widgetManager::IsDrawingNeeded();
l_FpsSystemContext.Tic();
if (NULL != tmpWindows) {
if( true == needRedraw
|| true == displayEveryTime) {
ewol::resource::UpdateContext();
l_FpsSystemContext.IncrementCounter();
}
}
l_FpsSystemContext.Toc();
bool hasDisplayDone = false;
l_FpsSystem.Tic();
if (NULL != tmpWindows) {
if( true == needRedraw
|| true == displayEveryTime) {
l_FpsSystem.IncrementCounter();
tmpWindows->SysDraw();
hasDisplayDone = true;
}
}
l_FpsSystem.Toc();
l_FpsFlush.Tic();
l_FpsFlush.IncrementCounter();
glFlush();
//glFinish();
l_FpsFlush.Toc();
l_FpsSystemEvent.Draw();
l_FpsSystemContext.Draw();
l_FpsSystem.Draw();
l_FpsFlush.Draw();
return hasDisplayDone;
} }
m_FpsSystemEvent.IncrementCounter();
m_FpsSystemEvent.Toc();
bool needRedraw = ewol::widgetManager::IsDrawingNeeded();
m_FpsSystemContext.Tic();
if (NULL != tmpWindows) {
if( true == needRedraw
|| true == _displayEveryTime) {
ewol::resource::UpdateContext();
m_FpsSystemContext.IncrementCounter();
}
}
m_FpsSystemContext.Toc();
bool hasDisplayDone = false;
m_FpsSystem.Tic();
if (NULL != tmpWindows) {
if( true == needRedraw
|| true == _displayEveryTime) {
m_FpsSystem.IncrementCounter();
tmpWindows->SysDraw();
hasDisplayDone = true;
}
}
m_FpsSystem.Toc();
m_FpsFlush.Tic();
m_FpsFlush.IncrementCounter();
glFlush();
//glFinish();
m_FpsFlush.Toc();
m_FpsSystemEvent.Draw();
m_FpsSystemContext.Draw();
m_FpsSystem.Draw();
m_FpsFlush.Draw();
return hasDisplayDone;
return false; return false;
} }
/*
void eSystem::OnObjectRemove(ewol::EObject * removeObject) void ewol::eSystem::OnObjectRemove(ewol::EObject * removeObject)
{ {
l_managementInput.OnObjectRemove(removeObject); m_managementInput.OnObjectRemove(removeObject);
}
*/
void ewol::eSystem::ResetIOEvent(void)
{
m_managementInput.NewLayerSet();
} }
void eSystem::ResetIOEvent(void) void ewol::eSystem::OS_OpenGlContextDestroy(void)
{
l_managementInput.NewLayerSet();
}
void eSystem::OpenGlContextDestroy(void)
{ {
ewol::resource::ContextHasBeenDestroyed(); ewol::resource::ContextHasBeenDestroyed();
} }
void eSystem::SetCurrentWindows(ewol::Windows * windows) void ewol::eSystem::SetCurrentWindows(ewol::Windows* _windows)
{ {
// set the new pointer as windows system // set the new pointer as windows system
windowsCurrent = windows; m_windowsCurrent = _windows;
// request all the widget redrawing // request all the widget redrawing
eSystem::ForceRedrawAll(); ForceRedrawAll();
} }
ewol::Windows* eSystem::GetCurrentWindows(void) void ewol::eSystem::ForceRedrawAll(void)
{ {
return windowsCurrent; if (NULL != m_windowsCurrent) {
} m_windowsCurrent->CalculateSize(vec2(m_windowsSize.x(), m_windowsSize.y()));
ivec2 eSystem::GetSize(void)
{
return windowsSize;
}
void eSystem::ForceRedrawAll(void)
{
ewol::Windows* tmpWindows = eSystem::GetCurrentWindows();
if (NULL != tmpWindows) {
ivec2 systemSize = eSystem::GetSize();
tmpWindows->CalculateSize(vec2(systemSize.x(), systemSize.y()));
} }
} }
void eSystem::OnKill(void) void ewol::eSystem::OS_Stop(void)
{ {
ewol::Windows* tmpWindows = eSystem::GetCurrentWindows(); if (NULL != m_windowsCurrent) {
if (NULL != tmpWindows) { m_windowsCurrent->SysOnKill();
tmpWindows->SysOnKill();
} }
} }

View File

@ -11,96 +11,292 @@
#include <etk/types.h> #include <etk/types.h>
#include <ewol/key.h> #include <ewol/key.h>
#include <ewol/ewol.h>
#include <ewol/clipBoard.h> #include <ewol/clipBoard.h>
#include <ewol/widget/Windows.h> #include <ewol/widget/Windows.h>
#include <ewol/renderer/os/eSystemInput.h>
#include <ewol/renderer/os/Fps.h>
#include <etk/MessageFifo.h>
namespace eSystem
{ // TODO : Remove this from here ...
void Init(void); typedef enum {
void UnInit(void); THREAD_NONE,
THREAD_INIT,
THREAD_RECALCULATE_SIZE,
THREAD_RESIZE,
THREAD_HIDE,
THREAD_SHOW,
void SetArchiveDir(int mode, const char* str); THREAD_INPUT_MOTION,
THREAD_INPUT_STATE,
void Resize(int w, int h ); THREAD_KEYBORAD_KEY,
void Move(int x, int y ); THREAD_KEYBORAD_MOVE,
void Hide(void);
void Show(void);
void SetInputMotion(int pointerID, float x, float y); THREAD_CLIPBOARD_ARRIVE,
void SetInputState(int pointerID, bool isDown, float x, float y); } theadMessage_te;
// TODO : Remove this from here ...
void SetMouseMotion(int pointerID, float x, float y); class eSystemMessage {
void SetMouseState(int pointerID, bool isDown, float x, float y); public :
// specify the message type
void SetKeyboard(ewol::SpecialKey& special, theadMessage_te TypeMessage;
uniChar_t myChar, // can not set a union ...
bool isDown, ewol::clipBoard::clipboardListe_te clipboardID;
bool isARepeateKey=false); // InputId
void SetKeyboardMove(ewol::SpecialKey& special, ewol::keyEvent::type_te inputType;
ewol::keyEvent::keyboard_te move, int32_t inputId;
bool isDown, // generic dimentions
bool isARepeateKey=false); vec2 dimention;
// keyboard events :
void ClipBoardArrive(ewol::clipBoard::clipboardListe_te clipboardID); bool repeateKey; //!< special flag for the repeating key on the PC interface
bool stateIsDown;
void RequestUpdateSize(void); uniChar_t keyboardChar;
ewol::keyEvent::keyboard_te keyboardMove;
// return true if a flush is needed ewol::SpecialKey keyboardSpecial;
bool Draw(bool displayEveryTime);
/** eSystemMessage(void) :
* @brief Inform object that an other object is removed ... TypeMessage(THREAD_NONE),
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject clipboardID(ewol::clipBoard::clipboardStd),
* @note : Sub classes must call this class inputType(ewol::keyEvent::typeUnknow),
*/ inputId(-1),
void OnObjectRemove(ewol::EObject * removeObject); dimention(0,0),
/** repeateKey(false),
* @brief reset event management for the IO like Input ou Mouse or keyborad stateIsDown(false),
*/ keyboardChar(0),
void ResetIOEvent(void); keyboardMove(ewol::keyEvent::keyboardUnknow)
/** {
* @brief Inform the system that the OpenGL constext has been destroy ==> use to automaticly reload the texture and other thinks ...
*/ }
void OpenGlContextDestroy(void);
/**
* @brief Inform the system that the Application has been killed
*/
void OnKill(void);
/**
* @brief set the current windows to display :
* @param windows windows that might be displayed
*/
void SetCurrentWindows(ewol::Windows * windows);
/**
* @brief Get the current windows that is displayed
* @return the current handle on the windows (can be null)
*/
ewol::Windows* GetCurrentWindows(void);
/**
* @brief Get the current windows size
* @return the current size ...
*/
ivec2 GetSize(void);
/**
* @brief Redraw all the windows
*/
void ForceRedrawAll(void);
/**
* @brief This is to transfert the event from one widget to another one
* @param source the widget where the event came from
* @param destination the widget where the event mitgh be generated now
*/
void InputEventTransfertWidget(ewol::Widget* source, ewol::Widget* destination);
/**
* @brief This fonction lock the pointer properties to move in relative instead of absolute
* @param[in] widget The widget that lock the pointer events
*/
void InputEventGrabPointer(ewol::Widget* widget);
/**
* @brief This fonction un-lock the pointer properties to move in relative instead of absolute
*/
void InputEventUnGrabPointer(void);
}; };
namespace ewol
{
class eSystem
{
public:
eSystem(void);
virtual ~eSystem(void);
private:
int64_t m_previousDisplayTime; // this is to limit framerate ... in case...
ewol::eSystemInput m_managementInput;
etk::MessageFifo<eSystemMessage> m_msgSystem;
ewol::Fps m_FpsSystemEvent;
ewol::Fps m_FpsSystemContext;
ewol::Fps m_FpsSystem;
ewol::Fps m_FpsFlush;
/**
* @brief Processing all the event arrived ... (commoly called in draw function)
*/
void ProcessEvents(void);
public:
void SetArchiveDir(int _mode, const char* _str);
void OS_SetInputMotion(int _pointerID, const vec2& _pos);
void OS_SetInputState(int _pointerID, bool _isDown, const vec2& _pos);
void OS_SetMouseMotion(int _pointerID, const vec2& _pos);
void OS_SetMouseState(int _pointerID, bool _isDown, const vec2& _pos);
void OS_SetKeyboard(ewol::SpecialKey& _special,
uniChar_t _myChar,
bool _isDown,
bool _isARepeateKey=false);
void OS_SetKeyboardMove(ewol::SpecialKey& _special,
ewol::keyEvent::keyboard_te _move,
bool _isDown,
bool _isARepeateKey=false);
void OS_SetClipBoard(ewol::clipBoard::clipboardListe_te _clipboardID);
void RequestUpdateSize(void);
// return true if a flush is needed
bool OS_Draw(bool _displayEveryTime);
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
*/
void OnObjectRemove(ewol::EObject * removeObject);
/**
* @brief reset event management for the IO like Input ou Mouse or keyborad
*/
void ResetIOEvent(void);
/**
* @brief The OS inform that the OpenGL constext has been destroy ==> use to automaticly reload the texture and other thinks ...
*/
void OS_OpenGlContextDestroy(void);
/**
* @brief The OS Inform that the Window has been killed
*/
void OS_Stop(void);
/**
* @brief The application request that the Window will be killed
*/
virtual void Stop(void);
private:
ewol::Windows* m_windowsCurrent; //!< curent displayed windows
public:
/**
* @brief set the current windows to display :
* @param _windows Windows that might be displayed
*/
void SetCurrentWindows(ewol::Windows* _windows);
/**
* @brief Get the current windows that is displayed
* @return the current handle on the windows (can be null)
*/
ewol::Windows* GetCurrentWindows(void) { return m_windowsCurrent; };
private:
vec2 m_windowsSize; //!< current size of the system
public:
/**
* @brief Get the current windows size
* @return the current size ...
*/
const vec2& GetSize(void) { return m_windowsSize; };
/**
* @brief The OS inform that the current windows has change his size.
* @param[in] _size new size of the windows.
*/
void OS_Resize(const vec2& _size);
/**
* @brief The application request a change of his curent size.
* @param[in] _size new Requested size of the windows.
*/
virtual void SetSize(const vec2& _size) { };
/**
* @brief The OS inform that the current windows has change his position.
* @param[in] _pos New position of the Windows.
*/
void OS_Move(const vec2& _pos);
/**
* @brief The Application request that the current windows will change his position.
* @param[in] _pos New position of the Windows requested.
*/
virtual void SetPos(const vec2& _pos) { };
/**
* @brief The OS inform that the Windows is now Hidden.
*/
void OS_Hide(void);
/**
* @brief The Application request that the Windows will be Hidden.
*/
virtual void Hide(void) { };
/**
* @brief The OS inform that the Windows is now visible.
*/
void OS_Show(void);
/**
* @brief The Application request that the Windows will be visible.
*/
virtual void Show(void) { };
/**
* @brief Redraw all the windows
*/
void ForceRedrawAll(void);
// TODO : Later ...
/**
* @brief This is to transfert the event from one widget to another one
* @param source the widget where the event came from
* @param destination the widget where the event mitgh be generated now
*/
void InputEventTransfertWidget(ewol::Widget* _source, ewol::Widget* _destination);
/**
* @brief This fonction lock the pointer properties to move in relative instead of absolute
* @param[in] widget The widget that lock the pointer events
*/
void InputEventGrabPointer(ewol::Widget* _widget);
/**
* @brief This fonction un-lock the pointer properties to move in relative instead of absolute
*/
void InputEventUnGrabPointer(void);
/**
* @brief Display the virtal keyboard (for touch system only)
*/
void KeyboardShow(void);
/**
* @brief Hide the virtal keyboard (for touch system only)
*/
void KeyboardHide(void);
/**
* @brief Inform the Gui that we want to have a copy of the clipboard
* @param[in] _clipboardID ID of the clipboard (STD/SELECTION) only apear here
*/
virtual void ClipBoardGet(ewol::clipBoard::clipboardListe_te _clipboardID) { };
/**
* @brief Inform the Gui that we are the new owner of the clipboard
* @param[in] _clipboardID ID of the clipboard (STD/SELECTION) only apear here
*/
virtual void ClipBoardSet(ewol::clipBoard::clipboardListe_te _clipboardID) { };
/**
* @brief Call by the OS when a clipboard arrive to US (previously requested by a widget)
* @param[in] Id of the clipboard
*/
void OS_ClipBoardArrive(ewol::clipBoard::clipboardListe_te _clipboardID);
/**
* @brief Set the new title of the windows
* @param[in] title New desired title
*/
virtual void SetTitle(etk::UString& _title) { };
/**
* @brief Force the screen orientation (availlable on portable elements ...
* @param[in] _orientation Selected orientation.
*/
virtual void ForceOrientation(ewol::orientation_te _orientation) { };
/**
* @brief Get all the event from the X system
* @param[in] _isGrabbed "true" if all the event will be get, false if we want only ours.
* @param[in] _forcedPosition the position where the mouse might be reset at every events ...
*/
virtual void GrabPointerEvents(bool _isGrabbed, const vec2& _forcedPosition) { };
/**
* @brief Set the cursor display type.
* @param[in] _newCursor selected new cursor.
*/
virtual void SetCursor(ewol::cursorDisplay_te _newCursor) { };
/**
* @brief Set the Icon of the program
* @param[in] _inputFile new filename icon of the curent program.
*/
virtual void SetIcon(const etk::UString& _inputFile) { };
/**
* @brief Get the curent time in micro-second
* @note : must be implemented in all system OS implementation
* @return The curent time of the process
*/
static int64_t GetTime(void);
private:
// TODO : Set user argument here ....
public:
/**
* @brief This is the only one things the User might done in his main();
* @note : must be implemented in all system OPS implementation
* @note To answare you before you ask the question, this is really simple:
* Due to the fect that the current system is multiple-platform, you "main"
* Does not exist in the android platform, then ewol call other start
* and stop function, to permit to have only one code
* @note The main can not be in the ewol, due to the fact thet is an librairy
* @param[in] _argc Standard argc
* @param[in] _argv Standard argv
* @return normal error int for the application error management
*/
static int main(int _argc, const char *_argv[]);
};
};
//!< must be define in CPP by the application ... this are the main init and unInit of the Application
ewol::Windows* APP_Init(void);
void APP_UnInit(void);
#endif #endif

View File

@ -136,13 +136,13 @@ void ewol::eSystemInput::GrabPointer(ewol::Widget* widget)
return; return;
} }
m_grabWidget = widget; m_grabWidget = widget;
guiInterface::GrabPointerEvents(true, widget->GetOrigin() + ivec2(widget->GetSize().x()/2.0f, widget->GetSize().y()/2.0f) ); m_system.GrabPointerEvents(true, widget->GetOrigin() + ivec2(widget->GetSize().x()/2.0f, widget->GetSize().y()/2.0f) );
} }
void ewol::eSystemInput::UnGrabPointer(void) void ewol::eSystemInput::UnGrabPointer(void)
{ {
m_grabWidget = NULL; m_grabWidget = NULL;
guiInterface::GrabPointerEvents(false, vec2(0,0)); m_system.GrabPointerEvents(false, vec2(0,0));
} }
void ewol::eSystemInput::OnObjectRemove(ewol::EObject * removeObject) void ewol::eSystemInput::OnObjectRemove(ewol::EObject * removeObject)
@ -179,8 +179,9 @@ void ewol::eSystemInput::Reset(void)
} }
} }
ewol::eSystemInput::eSystemInput(void) : ewol::eSystemInput::eSystemInput(ewol::eSystem& _system) :
m_grabWidget(NULL) m_grabWidget(NULL),
m_system(_system)
{ {
SetDpi(200); SetDpi(200);
EWOL_INFO("Init (start)"); EWOL_INFO("Init (start)");
@ -236,7 +237,7 @@ void ewol::eSystemInput::Motion(ewol::keyEvent::type_te type, int pointerID, vec
// not manage input // not manage input
return; return;
} }
ewol::Windows* tmpWindows = eSystem::GetCurrentWindows(); ewol::Windows* tmpWindows = m_system.GetCurrentWindows();
// special case for the mouse event 0 that represent the hover event of the system : // 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::keyEvent::typeMouse && pointerID == 0) {
// this event is all time on the good widget ... and manage the enter and leave ... // this event is all time on the good widget ... and manage the enter and leave ...
@ -336,7 +337,7 @@ void ewol::eSystemInput::State(ewol::keyEvent::type_te type, int pointerID, bool
} }
// get the curent time ... // get the curent time ...
int64_t currentTime = ewol::GetTime(); int64_t currentTime = ewol::GetTime();
ewol::Windows* tmpWindows = eSystem::GetCurrentWindows(); ewol::Windows* tmpWindows = m_system.GetCurrentWindows();
if (true == isDown) { if (true == isDown) {
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventTable[pointerID].destinationInputId << " [DOWN] " << pos); EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventTable[pointerID].destinationInputId << " [DOWN] " << pos);

View File

@ -11,6 +11,8 @@
#include <ewol/widget/Widget.h> #include <ewol/widget/Widget.h>
#define MAX_MANAGE_INPUT (15)
namespace ewol namespace ewol
{ {
@ -33,7 +35,7 @@ namespace ewol
int32_t sepatateTime; int32_t sepatateTime;
int32_t DpiOffset; int32_t DpiOffset;
} inputLimit_ts; } inputLimit_ts;
class eSystem;
class eSystemInput class eSystemInput
{ {
// special grab pointer mode : // special grab pointer mode :
@ -44,7 +46,6 @@ namespace ewol
inputLimit_ts m_eventInputLimit; inputLimit_ts m_eventInputLimit;
inputLimit_ts m_eventMouseLimit; inputLimit_ts m_eventMouseLimit;
void CalculateLimit(void); void CalculateLimit(void);
#define MAX_MANAGE_INPUT (15)
InputPoperty_ts m_eventInputSaved[MAX_MANAGE_INPUT]; InputPoperty_ts m_eventInputSaved[MAX_MANAGE_INPUT];
InputPoperty_ts m_eventMouseSaved[MAX_MANAGE_INPUT]; InputPoperty_ts m_eventMouseSaved[MAX_MANAGE_INPUT];
void AbortElement(InputPoperty_ts *eventTable, int32_t idInput, ewol::keyEvent::type_te _type); void AbortElement(InputPoperty_ts *eventTable, int32_t idInput, ewol::keyEvent::type_te _type);
@ -74,8 +75,10 @@ namespace ewol
int32_t localGetDestinationId(ewol::keyEvent::type_te type, int32_t localGetDestinationId(ewol::keyEvent::type_te type,
ewol::Widget* destWidget, ewol::Widget* destWidget,
int32_t realInputId); int32_t realInputId);
private:
ewol::eSystem& m_system;
public: public:
eSystemInput(void); eSystemInput(ewol::eSystem& _system);
~eSystemInput(void); ~eSystemInput(void);
void Reset(void); void Reset(void);
void SetDpi(int32_t newDPI); void SetDpi(int32_t newDPI);

File diff suppressed because it is too large Load Diff

View File

@ -1,99 +0,0 @@
/**
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
*
* @license BSD v3 (see license file)
*/
#ifndef __GUI_INTERFACE_H__
#define __GUI_INTERFACE_H__
#include <etk/types.h>
#include <etk/UString.h>
#include <ewol/widget/Windows.h>
#include <ewol/ewol.h>
#include <ewol/clipBoard.h>
#include <etk/os/FSNode.h>
namespace guiInterface
{
int main(int argc, const char *argv[]);
/**
* @brief Get the curent time in micro-second
*/
int64_t GetTime(void);
/**
* @brief Stop the current program
*/
void Stop(void);
/**
* @brief Change the current Windows size
* @param size The requested size
*/
void ChangeSize(ivec2 size);
/**
* @brief Change the current Windows position
* @param pos The position where the winsdows might be placed.
*/
void ChangePos(ivec2 pos);
/**
* @brief Get the current Windows position
* @param pos The position where the winsdows is.
*/
void GetAbsPos(ivec2& pos);
/**
* @brief Display the virtal keyboard (for touch system only)
*/
void KeyboardShow(void);
/**
* @brief Hide the virtal keyboard (for touch system only)
*/
void KeyboardHide(void);
/**
* @brief Inform the Gui that we want to have a copy of the clipboard
* @param ID of the clipboard (STD/SELECTION) only apear here
*/
void ClipBoardGet(ewol::clipBoard::clipboardListe_te clipboardID);
/**
* @brief Inform the Gui that we are the new owner of the clipboard
* @param ID of the clipboard (STD/SELECTION) only apear here
*/
void ClipBoardSet(ewol::clipBoard::clipboardListe_te clipboardID);
/**
* @brief Set the new title of the windows
* @param title New desired title
*/
void SetTitle(etk::UString& title);
/**
* @brief Force the screen orientation (availlable on portable elements ...
* @param orientation Selected orientation.
*/
void ForceOrientation(ewol::orientation_te orientation);
/**
* @brief Get all the event from the X system
* @param[in] isGrabbed "true" if all the event will be get, false if we want only ours.
* @param[in] forcedPosition the position where the mouse might be reset at every events ...
*/
void GrabPointerEvents(bool isGrabbed, vec2 forcedPosition);
/**
* @brief Set the cursor display type.
* @param[in] newCursor selected new cursor.
*/
void SetCursor(ewol::cursorDisplay_te newCursor);
/**
* @brief Set the Icon of the program
* @param[in] inputFile new filename icon of the curent program.
*/
void SetIcon(etk::UString inputFile);
};
//!< must be define in CPP by the application ... this are the main init and unInit of the Application
void APP_Init(void);
void APP_UnInit(void);
#define NB_MAX_INPUT (20)
#endif

View File

@ -42,7 +42,7 @@ def Create(target):
myModule.AddSrcFile([ myModule.AddSrcFile([
'ewol/renderer/os/eSystem.cpp', 'ewol/renderer/os/eSystem.cpp',
'ewol/renderer/os/eSystemInput.cpp']) 'ewol/renderer/os/eSystemInput.cpp'])
"""
# renderer : # renderer :
myModule.AddSrcFile([ myModule.AddSrcFile([
'ewol/renderer/resources/Shader.cpp', 'ewol/renderer/resources/Shader.cpp',
@ -121,7 +121,7 @@ def Create(target):
myModule.AddSrcFile([ myModule.AddSrcFile([
'ewol/widget/Scene.cpp', 'ewol/widget/Scene.cpp',
'ewol/game/Camera.cpp']) 'ewol/game/Camera.cpp'])
"""
myModule.CopyFolder('../data/theme/default/widgetEntry.*','theme/default') myModule.CopyFolder('../data/theme/default/widgetEntry.*','theme/default')
myModule.CopyFolder('../data/theme/rounded/widgetEntry.*','theme/rounded') myModule.CopyFolder('../data/theme/rounded/widgetEntry.*','theme/rounded')
@ -140,15 +140,9 @@ def Create(target):
myModule.CopyFolder('../data/textured3D2.*','') myModule.CopyFolder('../data/textured3D2.*','')
myModule.CopyFolder('../data/textured3D.*','') myModule.CopyFolder('../data/textured3D.*','')
# add the configuration files
#myModule.SetConfig(['Config.in','ConfigLinux.in'])
# name of the dependency # name of the dependency
myModule.AddModuleDepend(['etk', 'freetype', 'exml', 'ejson', 'egami', 'date']) myModule.AddModuleDepend(['etk', 'freetype', 'exml', 'ejson', 'egami', 'date'])
#ifeq ("$(CONFIG_BUILD_BULLET)","y")
#myModule.AddModuleDepend('bullet')
#endif
#ifeq ("$(CONFIG_BUILD_LUA)","y") #ifeq ("$(CONFIG_BUILD_LUA)","y")
#myModule.AddModuleDepend('lua') #myModule.AddModuleDepend('lua')
#endif #endif