[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:
parent
8668ac9dd0
commit
1fd451961e
@ -89,7 +89,8 @@ void ewol::clipBoard::Set(ewol::clipBoard::clipboardListe_te _clipboardID, const
|
||||
|
||||
if( ewol::clipBoard::clipboardStd == _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
|
||||
|| ewol::clipBoard::clipboardSelection == _clipboardID) {
|
||||
guiInterface::ClipBoardGet(_clipboardID);
|
||||
//guiInterface::ClipBoardGet(_clipboardID);
|
||||
EWOL_TODO("Get ClipBoard");
|
||||
} else {
|
||||
// generate an event on the main thread ...
|
||||
eSystem::ClipBoardArrive(_clipboardID);
|
||||
//eSystem::ClipBoardArrive(_clipboardID);
|
||||
EWOL_TODO("ClipBoard arrive");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,15 +13,7 @@
|
||||
#undef __class__
|
||||
#define __class__ "EObjectManager"
|
||||
|
||||
static bool IsInit = false;
|
||||
|
||||
// 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::EObjectManager::EObjectManager(void)
|
||||
{
|
||||
EWOL_DEBUG("==> Init EObject-Manager");
|
||||
// Can create mlemory leak ... ==> but not predictable comportement otherwise ...
|
||||
@ -30,7 +22,7 @@ void ewol::EObjectManager::Init(void)
|
||||
IsInit = true;
|
||||
}
|
||||
|
||||
void ewol::EObjectManager::UnInit(void)
|
||||
ewol::EObjectManager::~EObjectManager(void)
|
||||
{
|
||||
EWOL_DEBUG("==> Un-Init EObject-Manager");
|
||||
RemoveAllAutoRemove();
|
||||
|
@ -12,10 +12,16 @@
|
||||
#include <etk/types.h>
|
||||
#include <ewol/eObject/EObject.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace EObjectManager {
|
||||
void Init(void);
|
||||
void UnInit(void);
|
||||
namespace ewol
|
||||
{
|
||||
class EObjectManager
|
||||
{
|
||||
private:
|
||||
etk::Vector<ewol::EObject*> m_eObjectList; // all widget allocated ==> all time increment ... never removed ...
|
||||
etk::Vector<ewol::EObject*> m_eObjectAutoRemoveList; // all widget allocated
|
||||
public:
|
||||
EObjectManager(void);
|
||||
~EObjectManager(void);
|
||||
void Add(ewol::EObject* _object);
|
||||
void Rm(ewol::EObject* _object);
|
||||
int32_t GetNumberObject(void);
|
||||
|
@ -19,12 +19,12 @@
|
||||
#include <ewol/UserConfig.h>
|
||||
#undef __class__
|
||||
#define __class__ "ewol"
|
||||
|
||||
/*
|
||||
void ewol::SetFontSourcesFolder(bool _inOsSystem)
|
||||
{
|
||||
ewol::font::SetFontPropety(_inOsSystem);
|
||||
}
|
||||
|
||||
*/
|
||||
int32_t ewol::Run(int32_t _argc, const char* _argv[])
|
||||
{
|
||||
if (NULL!=_argv) {
|
||||
@ -60,14 +60,14 @@ int32_t ewol::Run(int32_t _argc, const char* _argv[])
|
||||
}
|
||||
}
|
||||
// call standard RUN ...
|
||||
int32_t error = guiInterface::main(_argc, _argv);
|
||||
int32_t error = ewol::eSystem::main(_argc, _argv);
|
||||
|
||||
ewol::commandLine::Clean();
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void ewol::Stop(void)
|
||||
{
|
||||
guiInterface::Stop();
|
||||
@ -126,7 +126,7 @@ void ewol::SetTitle(const etk::UString& _title)
|
||||
etk::UString title = _title;
|
||||
guiInterface::SetTitle(title);
|
||||
}
|
||||
|
||||
*/
|
||||
etk::UString ewol::GetVersion(void)
|
||||
{
|
||||
#define FIRST_YEAR (2011)
|
||||
@ -140,9 +140,9 @@ etk::UString ewol::GetVersion(void)
|
||||
|
||||
int64_t ewol::GetTime(void)
|
||||
{
|
||||
return guiInterface::GetTime();
|
||||
return ewol::eSystem::GetTime();
|
||||
}
|
||||
|
||||
/*
|
||||
void ewol::InputEventTransfertWidget(ewol::Widget* _source, ewol::Widget* _destination)
|
||||
{
|
||||
eSystem::InputEventTransfertWidget(_source, _destination);
|
||||
@ -158,7 +158,7 @@ void ewol::SetIcon(const etk::UString& _icon)
|
||||
{
|
||||
guiInterface::SetIcon(_icon);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -11,8 +11,6 @@
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <etk/UString.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <ewol/widget/Windows.h>
|
||||
|
||||
namespace ewol
|
||||
{
|
||||
@ -28,51 +26,6 @@ namespace ewol
|
||||
* @return normal error int for the application error management
|
||||
*/
|
||||
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
|
||||
* @return The string that describe ewol version
|
||||
@ -83,33 +36,18 @@ namespace ewol
|
||||
* @return The current time
|
||||
*/
|
||||
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 {
|
||||
SCREEN_ORIENTATION_AUTO = 0,
|
||||
SCREEN_ORIENTATION_LANDSCAPE,
|
||||
SCREEN_ORIENTATION_PORTRAIT,
|
||||
} orientation_te;
|
||||
/*
|
||||
/ **
|
||||
* @brief Force a specific orientation for mobile devices
|
||||
* @param[in] orientation the requested position.
|
||||
* /
|
||||
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
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <etk/MessageFifo.h>
|
||||
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/Dimension.h>
|
||||
@ -25,105 +24,41 @@
|
||||
#include <ewol/renderer/ResourceManager.h>
|
||||
#include <ewol/renderer/os/eSystemInput.h>
|
||||
#include <ewol/renderer/openGL.h>
|
||||
#include <ewol/renderer/os/Fps.h>
|
||||
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
|
||||
#include <etk/os/FSNode.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 {
|
||||
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)
|
||||
void ewol::eSystem::ProcessEvents(void)
|
||||
{
|
||||
int32_t nbEvent = 0;
|
||||
//EWOL_DEBUG(" ******** Event");
|
||||
eSystemMessage data;
|
||||
while (l_msgSystem.Count()>0)
|
||||
while (m_msgSystem.Count()>0)
|
||||
{
|
||||
nbEvent++;
|
||||
l_msgSystem.Wait(data);
|
||||
m_msgSystem.Wait(data);
|
||||
//EWOL_DEBUG("EVENT");
|
||||
switch (data.TypeMessage) {
|
||||
case THREAD_INIT:
|
||||
@ -135,17 +70,17 @@ void ewolProcessEvents(void)
|
||||
break;
|
||||
case THREAD_RESIZE:
|
||||
//EWOL_DEBUG("Receive MSG : THREAD_RESIZE");
|
||||
windowsSize = data.dimention;
|
||||
ewol::dimension::SetPixelWindowsSize(vec2(windowsSize.x(),windowsSize.y()));
|
||||
m_windowsSize = data.dimention;
|
||||
ewol::dimension::SetPixelWindowsSize(m_windowsSize);
|
||||
eSystem::ForceRedrawAll();
|
||||
break;
|
||||
case 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;
|
||||
case 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;
|
||||
case THREAD_KEYBORAD_KEY:
|
||||
case THREAD_KEYBORAD_MOVE:
|
||||
@ -155,8 +90,8 @@ void ewolProcessEvents(void)
|
||||
specialCurrentKey = data.keyboardSpecial;
|
||||
//EWOL_DEBUG("newStatus Key" << specialCurrentKey);
|
||||
}
|
||||
if (NULL != windowsCurrent) {
|
||||
if (false==windowsCurrent->OnEventShortCut(data.keyboardSpecial,
|
||||
if (NULL != m_windowsCurrent) {
|
||||
if (false==m_windowsCurrent->OnEventShortCut(data.keyboardSpecial,
|
||||
data.keyboardChar,
|
||||
data.keyboardMove,
|
||||
data.stateIsDown) ) {
|
||||
@ -221,9 +156,7 @@ void ewolProcessEvents(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void eSystem::SetArchiveDir(int mode, const char* str)
|
||||
void ewol::eSystem::SetArchiveDir(int mode, const char* str)
|
||||
{
|
||||
switch(mode)
|
||||
{
|
||||
@ -250,240 +183,206 @@ void eSystem::SetArchiveDir(int mode, const char* str)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void RequestInit(void)
|
||||
{
|
||||
if (true == isGlobalSystemInit) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_INIT;
|
||||
l_msgSystem.Post(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void eSystem::Init(void)
|
||||
ewol::eSystem::eSystem(void) :
|
||||
m_previousDisplayTime(0),
|
||||
m_managementInput(*this),
|
||||
m_FpsSystemEvent( "Event ", false),
|
||||
m_FpsSystemContext("Context ", false),
|
||||
m_FpsSystem( "Draw ", true),
|
||||
m_FpsFlush( "Flush ", false),
|
||||
m_windowsCurrent(NULL),
|
||||
m_windowsSize(320,480)
|
||||
{
|
||||
EWOL_INFO("==> Ewol System Init (BEGIN)");
|
||||
if (false == isGlobalSystemInit) {
|
||||
l_msgSystem.Clean();
|
||||
requestEndProcessing = false;
|
||||
|
||||
EWOL_INFO("v:" << ewol::GetVersion());
|
||||
EWOL_INFO("Build Date: " << date::GetYear() << "/" << date::GetMonth() << "/" << date::GetDay() << " " << date::GetHour() << "h" << date::GetMinute());
|
||||
// TODO : Remove this ...
|
||||
etk::InitDefaultFolder("ewolApplNoName");
|
||||
// TODO : Remove all of this gloabals ...
|
||||
ewol::openGL::Init();
|
||||
ewol::EObjectManager::Init();
|
||||
ewol::EObjectMessageMultiCast::Init();
|
||||
l_managementInput.Reset();
|
||||
m_managementInput.Reset();
|
||||
ewol::resource::Init();
|
||||
ewol::widgetManager::Init();
|
||||
ewol::config::Init();
|
||||
isGlobalSystemInit = true;
|
||||
// request the init of the application in the main context of openGL ...
|
||||
RequestInit();
|
||||
// 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
|
||||
{
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_INIT;
|
||||
m_msgSystem.Post(data);
|
||||
}
|
||||
// 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)");
|
||||
}
|
||||
|
||||
void eSystem::UnInit(void)
|
||||
ewol::eSystem::~eSystem(void)
|
||||
{
|
||||
EWOL_INFO("==> Ewol System Un-Init (BEGIN)");
|
||||
if (true == isGlobalSystemInit) {
|
||||
isGlobalSystemInit = false;
|
||||
requestEndProcessing = true;
|
||||
// unset all windows
|
||||
ewol::WindowsSet(NULL);
|
||||
// call application to uninit
|
||||
APP_UnInit();
|
||||
// unset all windows
|
||||
SetCurrentWindows(NULL);
|
||||
ewol::widgetManager::UnInit();
|
||||
ewol::config::UnInit();
|
||||
ewol::EObjectMessageMultiCast::UnInit();
|
||||
ewol::EObjectManager::UnInit();
|
||||
ewol::resource::UnInit();
|
||||
ewol::openGL::UnInit();
|
||||
l_managementInput.Reset();
|
||||
l_msgSystem.Clean();
|
||||
}
|
||||
m_managementInput.Reset();
|
||||
m_msgSystem.Clean();
|
||||
EWOL_INFO("==> Ewol System Un-Init (END)");
|
||||
}
|
||||
|
||||
|
||||
void eSystem::RequestUpdateSize(void)
|
||||
void ewol::eSystem::RequestUpdateSize(void)
|
||||
{
|
||||
if (true == isGlobalSystemInit) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_RECALCULATE_SIZE;
|
||||
l_msgSystem.Post(data);
|
||||
}
|
||||
m_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 ...
|
||||
ewol::dimension::SetPixelWindowsSize(vec2(w,h));
|
||||
if (true == isGlobalSystemInit) {
|
||||
ewol::dimension::SetPixelWindowsSize(_size);
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_RESIZE;
|
||||
data.dimention.setValue(w,h);
|
||||
l_msgSystem.Post(data);
|
||||
data.dimention = _size;
|
||||
m_msgSystem.Post(data);
|
||||
}
|
||||
}
|
||||
void eSystem::Move(int w, int h )
|
||||
void ewol::eSystem::OS_Move(const vec2& _pos)
|
||||
{
|
||||
if (true == isGlobalSystemInit) {
|
||||
/*
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_RESIZE;
|
||||
data.resize.w = w;
|
||||
data.resize.h = h;
|
||||
l_msgSystem.Post(data);
|
||||
m_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;
|
||||
data.TypeMessage = THREAD_INPUT_MOTION;
|
||||
data.inputType = ewol::keyEvent::typeFinger;
|
||||
data.inputId = pointerID;
|
||||
data.dimention.setValue(x,y);
|
||||
l_msgSystem.Post(data);
|
||||
}
|
||||
data.inputId = _pointerID;
|
||||
data.dimention = _pos;
|
||||
m_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;
|
||||
data.TypeMessage = THREAD_INPUT_STATE;
|
||||
data.inputType = ewol::keyEvent::typeFinger;
|
||||
data.inputId = pointerID;
|
||||
data.stateIsDown = isDown;
|
||||
data.dimention.setValue(x,y);
|
||||
l_msgSystem.Post(data);
|
||||
}
|
||||
data.inputId = _pointerID;
|
||||
data.stateIsDown = _isDown;
|
||||
data.dimention = _pos;
|
||||
m_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;
|
||||
data.TypeMessage = THREAD_INPUT_MOTION;
|
||||
data.inputType = ewol::keyEvent::typeMouse;
|
||||
data.inputId = pointerID;
|
||||
data.dimention.setValue(x,y);
|
||||
l_msgSystem.Post(data);
|
||||
}
|
||||
data.inputId = _pointerID;
|
||||
data.dimention = _pos;
|
||||
m_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;
|
||||
data.TypeMessage = THREAD_INPUT_STATE;
|
||||
data.inputType = ewol::keyEvent::typeMouse;
|
||||
data.inputId = pointerID;
|
||||
data.stateIsDown = isDown;
|
||||
data.dimention.setValue(x,y);
|
||||
l_msgSystem.Post(data);
|
||||
}
|
||||
data.inputId = _pointerID;
|
||||
data.stateIsDown = _isDown;
|
||||
data.dimention = _pos;
|
||||
m_msgSystem.Post(data);
|
||||
}
|
||||
|
||||
|
||||
void eSystem::SetKeyboard(ewol::SpecialKey& special,
|
||||
uniChar_t myChar,
|
||||
bool isDown,
|
||||
bool isARepeateKey)
|
||||
void ewol::eSystem::OS_SetKeyboard(ewol::SpecialKey& _special,
|
||||
uniChar_t _myChar,
|
||||
bool _isDown,
|
||||
bool _isARepeateKey)
|
||||
{
|
||||
if (true == isGlobalSystemInit) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_KEYBORAD_KEY;
|
||||
data.stateIsDown = isDown;
|
||||
data.keyboardChar = myChar;
|
||||
data.keyboardSpecial = special;
|
||||
data.repeateKey = isARepeateKey;
|
||||
l_msgSystem.Post(data);
|
||||
}
|
||||
data.stateIsDown = _isDown;
|
||||
data.keyboardChar = _myChar;
|
||||
data.keyboardSpecial = _special;
|
||||
data.repeateKey = _isARepeateKey;
|
||||
m_msgSystem.Post(data);
|
||||
}
|
||||
|
||||
void eSystem::SetKeyboardMove(ewol::SpecialKey& special,
|
||||
ewol::keyEvent::keyboard_te move,
|
||||
bool isDown,
|
||||
bool isARepeateKey)
|
||||
void ewol::eSystem::OS_SetKeyboardMove(ewol::SpecialKey& _special,
|
||||
ewol::keyEvent::keyboard_te _move,
|
||||
bool _isDown,
|
||||
bool _isARepeateKey)
|
||||
{
|
||||
if (true == isGlobalSystemInit) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_KEYBORAD_MOVE;
|
||||
data.stateIsDown = isDown;
|
||||
data.keyboardMove = move;
|
||||
data.keyboardSpecial = special;
|
||||
data.repeateKey = isARepeateKey;
|
||||
l_msgSystem.Post(data);
|
||||
}
|
||||
data.stateIsDown = _isDown;
|
||||
data.keyboardMove = _move;
|
||||
data.keyboardSpecial = _special;
|
||||
data.repeateKey = _isARepeateKey;
|
||||
m_msgSystem.Post(data);
|
||||
}
|
||||
|
||||
|
||||
void eSystem::Hide(void)
|
||||
void ewol::eSystem::OS_Hide(void)
|
||||
{
|
||||
if (true == isGlobalSystemInit) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_HIDE;
|
||||
l_msgSystem.Post(data);
|
||||
}
|
||||
m_msgSystem.Post(data);
|
||||
}
|
||||
|
||||
void eSystem::Show(void)
|
||||
void ewol::eSystem::OS_Show(void)
|
||||
{
|
||||
if (true == isGlobalSystemInit) {
|
||||
eSystemMessage data;
|
||||
data.TypeMessage = THREAD_SHOW;
|
||||
l_msgSystem.Post(data);
|
||||
}
|
||||
m_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;
|
||||
data.TypeMessage = THREAD_CLIPBOARD_ARRIVE;
|
||||
data.clipboardID = clipboardID;
|
||||
l_msgSystem.Post(data);
|
||||
}
|
||||
data.clipboardID = _clipboardID;
|
||||
m_msgSystem.Post(data);
|
||||
}
|
||||
|
||||
bool eSystem::Draw(bool displayEveryTime)
|
||||
bool ewol::eSystem::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))
|
||||
if(currentTime - previousDisplayTime < 1000000/120) {
|
||||
if(currentTime - m_previousDisplayTime < 1000000/120) {
|
||||
usleep(1000);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
previousDisplayTime = currentTime;
|
||||
m_previousDisplayTime = currentTime;
|
||||
|
||||
if (true == isGlobalSystemInit) {
|
||||
// process the events
|
||||
l_FpsSystemEvent.Tic();
|
||||
ewolProcessEvents();
|
||||
m_FpsSystemEvent.Tic();
|
||||
ProcessEvents();
|
||||
// call all the widget that neded to do something periodicly
|
||||
ewol::widgetManager::PeriodicCall(currentTime);
|
||||
// Remove all widget that they are no more usefull (these who decided to destroy themself)
|
||||
@ -494,101 +393,85 @@ l_FpsSystemEvent.Tic();
|
||||
// Redraw all needed elements
|
||||
tmpWindows->OnRegenerateDisplay();
|
||||
}
|
||||
l_FpsSystemEvent.IncrementCounter();
|
||||
l_FpsSystemEvent.Toc();
|
||||
m_FpsSystemEvent.IncrementCounter();
|
||||
m_FpsSystemEvent.Toc();
|
||||
bool needRedraw = ewol::widgetManager::IsDrawingNeeded();
|
||||
|
||||
l_FpsSystemContext.Tic();
|
||||
m_FpsSystemContext.Tic();
|
||||
if (NULL != tmpWindows) {
|
||||
if( true == needRedraw
|
||||
|| true == displayEveryTime) {
|
||||
|| true == _displayEveryTime) {
|
||||
ewol::resource::UpdateContext();
|
||||
l_FpsSystemContext.IncrementCounter();
|
||||
m_FpsSystemContext.IncrementCounter();
|
||||
}
|
||||
}
|
||||
l_FpsSystemContext.Toc();
|
||||
m_FpsSystemContext.Toc();
|
||||
bool hasDisplayDone = false;
|
||||
l_FpsSystem.Tic();
|
||||
m_FpsSystem.Tic();
|
||||
if (NULL != tmpWindows) {
|
||||
if( true == needRedraw
|
||||
|| true == displayEveryTime) {
|
||||
l_FpsSystem.IncrementCounter();
|
||||
|| true == _displayEveryTime) {
|
||||
m_FpsSystem.IncrementCounter();
|
||||
tmpWindows->SysDraw();
|
||||
hasDisplayDone = true;
|
||||
}
|
||||
}
|
||||
l_FpsSystem.Toc();
|
||||
m_FpsSystem.Toc();
|
||||
|
||||
l_FpsFlush.Tic();
|
||||
l_FpsFlush.IncrementCounter();
|
||||
m_FpsFlush.Tic();
|
||||
m_FpsFlush.IncrementCounter();
|
||||
glFlush();
|
||||
//glFinish();
|
||||
l_FpsFlush.Toc();
|
||||
m_FpsFlush.Toc();
|
||||
|
||||
l_FpsSystemEvent.Draw();
|
||||
l_FpsSystemContext.Draw();
|
||||
l_FpsSystem.Draw();
|
||||
l_FpsFlush.Draw();
|
||||
m_FpsSystemEvent.Draw();
|
||||
m_FpsSystemContext.Draw();
|
||||
m_FpsSystem.Draw();
|
||||
m_FpsFlush.Draw();
|
||||
return hasDisplayDone;
|
||||
}
|
||||
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)
|
||||
{
|
||||
l_managementInput.NewLayerSet();
|
||||
}
|
||||
|
||||
|
||||
void eSystem::OpenGlContextDestroy(void)
|
||||
void ewol::eSystem::OS_OpenGlContextDestroy(void)
|
||||
{
|
||||
ewol::resource::ContextHasBeenDestroyed();
|
||||
}
|
||||
|
||||
|
||||
void eSystem::SetCurrentWindows(ewol::Windows * windows)
|
||||
void ewol::eSystem::SetCurrentWindows(ewol::Windows* _windows)
|
||||
{
|
||||
// set the new pointer as windows system
|
||||
windowsCurrent = windows;
|
||||
m_windowsCurrent = _windows;
|
||||
// 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)
|
||||
void ewol::eSystem::OS_Stop(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)
|
||||
{
|
||||
ewol::Windows* tmpWindows = eSystem::GetCurrentWindows();
|
||||
if (NULL != tmpWindows) {
|
||||
tmpWindows->SysOnKill();
|
||||
if (NULL != m_windowsCurrent) {
|
||||
m_windowsCurrent->SysOnKill();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,42 +11,110 @@
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <ewol/key.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/clipBoard.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 ...
|
||||
typedef enum {
|
||||
THREAD_NONE,
|
||||
THREAD_INIT,
|
||||
THREAD_RECALCULATE_SIZE,
|
||||
THREAD_RESIZE,
|
||||
THREAD_HIDE,
|
||||
THREAD_SHOW,
|
||||
|
||||
THREAD_INPUT_MOTION,
|
||||
THREAD_INPUT_STATE,
|
||||
|
||||
THREAD_KEYBORAD_KEY,
|
||||
THREAD_KEYBORAD_MOVE,
|
||||
|
||||
THREAD_CLIPBOARD_ARRIVE,
|
||||
} theadMessage_te;
|
||||
// TODO : Remove this from here ...
|
||||
class eSystemMessage {
|
||||
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)
|
||||
{
|
||||
void Init(void);
|
||||
void UnInit(void);
|
||||
|
||||
void SetArchiveDir(int mode, const char* str);
|
||||
}
|
||||
};
|
||||
|
||||
void Resize(int w, int h );
|
||||
void Move(int x, int y );
|
||||
void Hide(void);
|
||||
void Show(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 SetInputMotion(int pointerID, float x, float y);
|
||||
void SetInputState(int pointerID, bool isDown, float x, float y);
|
||||
void SetArchiveDir(int _mode, const char* _str);
|
||||
|
||||
void SetMouseMotion(int pointerID, float x, float y);
|
||||
void SetMouseState(int pointerID, bool isDown, float x, float y);
|
||||
|
||||
void SetKeyboard(ewol::SpecialKey& special,
|
||||
uniChar_t myChar,
|
||||
bool isDown,
|
||||
bool isARepeateKey=false);
|
||||
void SetKeyboardMove(ewol::SpecialKey& special,
|
||||
ewol::keyEvent::keyboard_te move,
|
||||
bool isDown,
|
||||
bool isARepeateKey=false);
|
||||
void OS_SetInputMotion(int _pointerID, const vec2& _pos);
|
||||
void OS_SetInputState(int _pointerID, bool _isDown, const vec2& _pos);
|
||||
|
||||
void ClipBoardArrive(ewol::clipBoard::clipboardListe_te clipboardID);
|
||||
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 Draw(bool displayEveryTime);
|
||||
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
|
||||
@ -58,48 +126,176 @@ namespace eSystem
|
||||
*/
|
||||
void ResetIOEvent(void);
|
||||
/**
|
||||
* @brief Inform the system that the OpenGL constext has been destroy ==> use to automaticly reload the texture and other thinks ...
|
||||
* @brief The OS inform that the OpenGL constext has been destroy ==> use to automaticly reload the texture and other thinks ...
|
||||
*/
|
||||
void OpenGlContextDestroy(void);
|
||||
void OS_OpenGlContextDestroy(void);
|
||||
/**
|
||||
* @brief Inform the system that the Application has been killed
|
||||
* @brief The OS Inform that the Window has been killed
|
||||
*/
|
||||
void OnKill(void);
|
||||
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
|
||||
* @param _windows Windows that might be displayed
|
||||
*/
|
||||
void SetCurrentWindows(ewol::Windows * windows);
|
||||
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);
|
||||
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 ...
|
||||
*/
|
||||
ivec2 GetSize(void);
|
||||
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);
|
||||
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);
|
||||
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
|
||||
|
@ -136,13 +136,13 @@ void ewol::eSystemInput::GrabPointer(ewol::Widget* widget)
|
||||
return;
|
||||
}
|
||||
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)
|
||||
{
|
||||
m_grabWidget = NULL;
|
||||
guiInterface::GrabPointerEvents(false, vec2(0,0));
|
||||
m_system.GrabPointerEvents(false, vec2(0,0));
|
||||
}
|
||||
|
||||
void ewol::eSystemInput::OnObjectRemove(ewol::EObject * removeObject)
|
||||
@ -179,8 +179,9 @@ void ewol::eSystemInput::Reset(void)
|
||||
}
|
||||
}
|
||||
|
||||
ewol::eSystemInput::eSystemInput(void) :
|
||||
m_grabWidget(NULL)
|
||||
ewol::eSystemInput::eSystemInput(ewol::eSystem& _system) :
|
||||
m_grabWidget(NULL),
|
||||
m_system(_system)
|
||||
{
|
||||
SetDpi(200);
|
||||
EWOL_INFO("Init (start)");
|
||||
@ -236,7 +237,7 @@ void ewol::eSystemInput::Motion(ewol::keyEvent::type_te type, int pointerID, vec
|
||||
// not manage input
|
||||
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 :
|
||||
if (type == ewol::keyEvent::typeMouse && pointerID == 0) {
|
||||
// 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 ...
|
||||
int64_t currentTime = ewol::GetTime();
|
||||
ewol::Windows* tmpWindows = eSystem::GetCurrentWindows();
|
||||
ewol::Windows* tmpWindows = m_system.GetCurrentWindows();
|
||||
|
||||
if (true == isDown) {
|
||||
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventTable[pointerID].destinationInputId << " [DOWN] " << pos);
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
#include <ewol/widget/Widget.h>
|
||||
|
||||
#define MAX_MANAGE_INPUT (15)
|
||||
|
||||
namespace ewol
|
||||
{
|
||||
|
||||
@ -33,7 +35,7 @@ namespace ewol
|
||||
int32_t sepatateTime;
|
||||
int32_t DpiOffset;
|
||||
} inputLimit_ts;
|
||||
|
||||
class eSystem;
|
||||
class eSystemInput
|
||||
{
|
||||
// special grab pointer mode :
|
||||
@ -44,7 +46,6 @@ namespace ewol
|
||||
inputLimit_ts m_eventInputLimit;
|
||||
inputLimit_ts m_eventMouseLimit;
|
||||
void CalculateLimit(void);
|
||||
#define MAX_MANAGE_INPUT (15)
|
||||
InputPoperty_ts m_eventInputSaved[MAX_MANAGE_INPUT];
|
||||
InputPoperty_ts m_eventMouseSaved[MAX_MANAGE_INPUT];
|
||||
void AbortElement(InputPoperty_ts *eventTable, int32_t idInput, ewol::keyEvent::type_te _type);
|
||||
@ -74,8 +75,10 @@ namespace ewol
|
||||
int32_t localGetDestinationId(ewol::keyEvent::type_te type,
|
||||
ewol::Widget* destWidget,
|
||||
int32_t realInputId);
|
||||
private:
|
||||
ewol::eSystem& m_system;
|
||||
public:
|
||||
eSystemInput(void);
|
||||
eSystemInput(ewol::eSystem& _system);
|
||||
~eSystemInput(void);
|
||||
void Reset(void);
|
||||
void SetDpi(int32_t newDPI);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
@ -42,7 +42,7 @@ def Create(target):
|
||||
myModule.AddSrcFile([
|
||||
'ewol/renderer/os/eSystem.cpp',
|
||||
'ewol/renderer/os/eSystemInput.cpp'])
|
||||
|
||||
"""
|
||||
# renderer :
|
||||
myModule.AddSrcFile([
|
||||
'ewol/renderer/resources/Shader.cpp',
|
||||
@ -121,7 +121,7 @@ def Create(target):
|
||||
myModule.AddSrcFile([
|
||||
'ewol/widget/Scene.cpp',
|
||||
'ewol/game/Camera.cpp'])
|
||||
|
||||
"""
|
||||
|
||||
myModule.CopyFolder('../data/theme/default/widgetEntry.*','theme/default')
|
||||
myModule.CopyFolder('../data/theme/rounded/widgetEntry.*','theme/rounded')
|
||||
@ -140,15 +140,9 @@ def Create(target):
|
||||
myModule.CopyFolder('../data/textured3D2.*','')
|
||||
myModule.CopyFolder('../data/textured3D.*','')
|
||||
|
||||
# add the configuration files
|
||||
#myModule.SetConfig(['Config.in','ConfigLinux.in'])
|
||||
|
||||
# name of the dependency
|
||||
myModule.AddModuleDepend(['etk', 'freetype', 'exml', 'ejson', 'egami', 'date'])
|
||||
|
||||
#ifeq ("$(CONFIG_BUILD_BULLET)","y")
|
||||
#myModule.AddModuleDepend('bullet')
|
||||
#endif
|
||||
#ifeq ("$(CONFIG_BUILD_LUA)","y")
|
||||
#myModule.AddModuleDepend('lua')
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user