Some clean and normalisation

This commit is contained in:
Edouard Dupin 2012-03-08 18:08:25 +01:00
parent 6d221b4de1
commit c4b70a4bdc
20 changed files with 256 additions and 133 deletions

View File

@ -10,12 +10,22 @@ LOCAL_C_INCLUDES := -I$(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_LDLIBS :=
ifeq ($(DEBUG),1)
LOCAL_CFLAGS := -D__PLATFORM__Linux \
-Wno-write-strings \
-DETK_DEBUG_LEVEL=3 \
-DEWOL_DEBUG_LEVEL=3 \
-DEWOL_VERSION_TAG_NAME="\"UNKNOW-debug\"" \
-DVERSION_BUILD_TIME="\"pasd_heure\""
else
LOCAL_CFLAGS := -D__PLATFORM__Linux \
-Wno-write-strings \
-DETK_DEBUG_LEVEL=1 \
-DEWOL_DEBUG_LEVEL=1 \
-DEWOL_VERSION_TAG_NAME="\"UNKNOW-debug\"" \
-DVERSION_BUILD_TIME="\"pasd_heure\""
endif
# load the common sources file of the platform
include $(LOCAL_PATH)/file.mk

View File

@ -124,6 +124,31 @@ namespace etk{
}
return *this;
}
CCout& operator << (coord2D_ts t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%f,%f)", t.x, t.y);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (coord3D_ts t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "(%f,%f,%f)", t.x, t.y, t.z);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (texCoord_ts t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "{%f,%f}", t.u, t.v);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (color_ts t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "(r=%f,g=%f,b=%f,a=%f)", t.red, t.green, t.blue, t.alpha);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (clipping_ts t) {
snprintf(tmp, MAX_LOG_SIZE_TMP, "origin=(%f,%f) size=(%f,%f)", t.x, t.y, t.w, t.h);
strncat(m_tmpChar, tmp, MAX_LOG_SIZE);
return *this;
}
CCout& operator << (CStart ccc) {
pthread_mutex_lock(&m_mutex);
return *this;

View File

@ -25,9 +25,7 @@
#ifndef __ETK_TYPES_H__
#define __ETK_TYPES_H__
// includes system, malloc, EXIT_SUCCESS
#include <stdlib.h>
// includes fopen, fwrite, fseek, ftell
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
@ -72,30 +70,17 @@ extern "C"
#define oglTypeFloat_t GL_FLOAT
#endif
struct etkPointAndPositionDouble{
etkFloat_t x;
etkFloat_t y;
};
struct etkPointAndPositionInt{
int32_t x;
int32_t y;
};
typedef etkPointAndPositionDouble point_ts;
typedef etkPointAndPositionDouble position_ts;
typedef etkPointAndPositionDouble size_ts;
typedef etkPointAndPositionInt intSize_ts;
typedef struct {
etkFloat_t x;
etkFloat_t y;
etkFloat_t z;
}coord3D_ts;
typedef struct {
etkFloat_t x;
etkFloat_t y;
}coord2D_ts;
typedef struct {
etkFloat_t u;
etkFloat_t v;

View File

@ -10,6 +10,7 @@ LOCAL_C_INCLUDES := -I$(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_LDLIBS := -lGL -lGLU -lz -lX11
ifeq ($(DEBUG),1)
LOCAL_CFLAGS := -D__PLATFORM__Linux \
-Wno-write-strings \
-DETK_DEBUG_LEVEL=3 \
@ -17,8 +18,15 @@ LOCAL_CFLAGS := -D__PLATFORM__Linux \
-DEWOL_VERSION_TAG_NAME="\"UNKNOW-debug\"" \
-DVERSION_BUILD_TIME="\"pasd_heure\"" \
-DEWOL_USE_FREE_TYPE
# `pkg-config --cflags freetype2`
else
LOCAL_CFLAGS := -D__PLATFORM__Linux \
-Wno-write-strings \
-DETK_DEBUG_LEVEL=1 \
-DEWOL_DEBUG_LEVEL=1 \
-DEWOL_VERSION_TAG_NAME="\"UNKNOW-debug\"" \
-DVERSION_BUILD_TIME="\"pasd_heure\"" \
-DEWOL_USE_FREE_TYPE
endif
# load the common sources file of the platform
include $(LOCAL_PATH)/file.mk

View File

@ -133,22 +133,17 @@ ewol::Widget * ewol::Widget::GetWidgetAtPos(coord2D_ts pos)
return this;
}
bool ewol::Widget::GenEventInput(int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos)
{
eventPosition_ts eventPos;
eventPos.abs = pos;
eventPos.local.x = pos.x - m_origin.x;
eventPos.local.y = pos.y - m_origin.y;
//EWOL_DEBUG(" event on abs=(" << eventPos.abs.x << "," << eventPos.abs.y << ") local=(" << eventPos.local.x << "," << eventPos.local.y << ")");
return OnEventInput(IdInput, typeEvent, eventPos);
}
bool ewol::Widget::GenEventShortCut(bool shift, bool control, bool alt, bool meta, uint32_t unicodeValue)
{
return false;
}
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
void ewol::Widget::OnFlipFlopEvent(void)
{
if (true == m_needFlipFlop) {

View File

@ -170,11 +170,7 @@ namespace ewol {
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
// external acces to set an input event on this widget.
// TODO : deprecated ...
bool GenEventInput(int32_t IdInput, eventInputType_te typeEvent, coord2D_ts pos); // call when input event arrive and call OnEventInput, if no event detected
virtual bool GenEventShortCut(bool shift, bool control, bool alt, bool meta, uint32_t unicodeValue);
// TODO : Remasterised ...
/**
* @brief Manage input event of this Widget
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
@ -202,6 +198,11 @@ namespace ewol {
void MarkToReedraw(void) { m_needRegenerateDisplay = true; };
bool NeedRedraw(void) { bool tmpData=m_needRegenerateDisplay; m_needRegenerateDisplay=false; return tmpData; };
public:
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
virtual void OnFlipFlopEvent(void);
public:
bool GenDraw(void);

View File

@ -290,7 +290,11 @@ void ewol::Windows::KeyboardHide(void)
}
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
void ewol::Windows::OnFlipFlopEvent(void)
{
bool needFlipFlop = m_needFlipFlop;

View File

@ -87,6 +87,11 @@ namespace ewol {
public:
void KeyboardShow(ewol::keyboardMode_te mode);
void KeyboardHide(void);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
virtual void OnFlipFlopEvent(void);
/**
* @brief Inform object that an other object is removed ...

View File

@ -151,10 +151,6 @@ static void* BaseAppEntry(void* param)
//EWOL_DEBUG("Receive MSG : THREAD_INPUT_STATE");
{
eventInputState_ts * tmpData = (eventInputState_ts*)data.data;
bool isdown = true;
if (true==tmpData->state) {
isdown = false;
}
coord2D_ts pos;
pos.x = tmpData->x;
pos.y = tmpData->y;

View File

@ -26,8 +26,8 @@ typedef struct {
coord2D_ts origin;
coord2D_ts size;
coord2D_ts downStart;
coord2D_ts lastEventPos;
bool isDown;
bool isInside;
int32_t nbClickEvent; // 0 .. 1 .. 2 .. 3
} InputPoperty_ts;
@ -37,7 +37,7 @@ InputPoperty_ts eventInputSaved[MAX_MANAGE_INPUT];
/**
* @brief Inform object that an other object is removed ...
* @param[in] removeObject Pointer on the EObject remeved ==> the user must remove all reference on this EObject
* @param[in] removeObject Pointer on the EObject removed ==> the user must remove all reference on this EObject
* @note : Sub classes must call this class
* @return ---
*/
@ -58,18 +58,18 @@ static void CleanInputElement(int32_t idInput)
eventInputSaved[idInput].curentWidgetEvent = NULL;
eventInputSaved[idInput].origin.x = 0;
eventInputSaved[idInput].origin.y = 0;
eventInputSaved[idInput].size.x = 0;
eventInputSaved[idInput].size.y = 0;
eventInputSaved[idInput].size.x = 99999999;
eventInputSaved[idInput].size.y = 99999999;
eventInputSaved[idInput].downStart.x = 0;
eventInputSaved[idInput].downStart.y = 0;
eventInputSaved[idInput].lastEventPos.x = 0;
eventInputSaved[idInput].lastEventPos.y = 0;
eventInputSaved[idInput].isDown = false;
eventInputSaved[idInput].isInside = true;
eventInputSaved[idInput].nbClickEvent = 0;
}
void ewol::eventInput::Init(void)
{
EWOL_INFO("Init");
for(int32_t iii=0; iii<MAX_MANAGE_INPUT; iii++) {
eventInputSaved[iii].isUsed = false;
eventInputSaved[iii].destinationInputId = 0;
@ -77,20 +77,19 @@ void ewol::eventInput::Init(void)
eventInputSaved[iii].curentWidgetEvent = NULL;
eventInputSaved[iii].origin.x = 0;
eventInputSaved[iii].origin.y = 0;
eventInputSaved[iii].size.x = 0;
eventInputSaved[iii].size.y = 0;
eventInputSaved[iii].size.x = 99999999;
eventInputSaved[iii].size.y = 99999999;
eventInputSaved[iii].downStart.x = 0;
eventInputSaved[iii].downStart.y = 0;
eventInputSaved[iii].lastEventPos.x = 0;
eventInputSaved[iii].lastEventPos.y = 0;
eventInputSaved[iii].isDown = false;
eventInputSaved[iii].isInside = true;
eventInputSaved[iii].nbClickEvent = 0;
}
}
void ewol::eventInput::UnInit(void)
{
EWOL_INFO("Un-Init");
}
@ -98,7 +97,7 @@ void ewol::eventInput::UnInit(void)
extern ewol::Windows* gui_uniqueWindows;
bool localEventInput(ewol::Widget* destWidget, int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos)
static bool localEventInput(ewol::Widget* destWidget, int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos)
{
if (NULL != destWidget) {
ewol::eventPosition_ts tmpEventPosition;
@ -109,6 +108,35 @@ bool localEventInput(ewol::Widget* destWidget, int32_t IdInput, ewol::eventInput
return false;
}
/**
* @brief Convert the system event id in the correct EWOL id depending of the system management mode
*
* This function find the next input id unused on the specifiic widget ==> on PC, the ID does not change (IHM is not the same
*
* @param[in] destWidget Pointer of the widget destination
* @param[in] realInputId System Id
*
* @return the ewol input id
*/
static int32_t localGetDestinationId(ewol::Widget* destWidget, int32_t realInputId)
{
#ifdef __MODE__Touch
int32_t lastMinimum = 0;
for(int32_t iii=0; iii<MAX_MANAGE_INPUT; iii++) {
if (true==eventInputSaved[iii].isUsed) {
if (eventInputSaved[iii].curentWidgetEvent == destWidget) {
if (iii != realInputId) {
lastMinimum = etk_max(lastMinimum, eventInputSaved[iii].destinationInputId);
}
}
}
}
return lastMinimum+1;
#else
return realInputId;
#endif
}
// defined by the platform specific file :
@ -119,20 +147,40 @@ extern int32_t offsetMoveClickedDouble;
void ewol::eventInput::Motion(int pointerID, coord2D_ts pos)
{
if( pointerID > MAX_MANAGE_INPUT
|| pointerID < 0) {
|| pointerID <= 0) {
// not manage input
return;
}
if (true == eventInputSaved[pointerID].isUsed) {
EWOL_DEBUG("GUI : Input ID=" << pointerID << " [MOVE] (" << pos.x << "," << pos.y << ")");
localEventInput(eventInputSaved[pointerID].curentWidgetEvent, pointerID, ewol::EVENT_INPUT_TYPE_MOVE, pos);
if (true == eventInputSaved[pointerID].isInside) {
if( eventInputSaved[pointerID].origin.x > pos.x
|| eventInputSaved[pointerID].origin.y > pos.y
|| (eventInputSaved[pointerID].origin.x + eventInputSaved[pointerID].size.x) < pos.x
|| (eventInputSaved[pointerID].origin.y + eventInputSaved[pointerID].size.y) < pos.y) {
eventInputSaved[pointerID].isInside = false;
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventInputSaved[pointerID].destinationInputId << " [LEAVE] " << pos);
localEventInput(eventInputSaved[pointerID].curentWidgetEvent, eventInputSaved[pointerID].destinationInputId, ewol::EVENT_INPUT_TYPE_LEAVE, pos);
}
} else {
if( ( eventInputSaved[pointerID].origin.x <= pos.x
&& (eventInputSaved[pointerID].origin.x + eventInputSaved[pointerID].size.x) >= pos.x )
&& ( eventInputSaved[pointerID].origin.y <= pos.y
&& (eventInputSaved[pointerID].origin.y + eventInputSaved[pointerID].size.y) >= pos.y ) ) {
eventInputSaved[pointerID].isInside = true;
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventInputSaved[pointerID].destinationInputId << " [ENTER] " << pos);
localEventInput(eventInputSaved[pointerID].curentWidgetEvent, eventInputSaved[pointerID].destinationInputId, ewol::EVENT_INPUT_TYPE_ENTER, pos);
}
}
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventInputSaved[pointerID].destinationInputId << " [MOVE] " << pos);
localEventInput(eventInputSaved[pointerID].curentWidgetEvent, eventInputSaved[pointerID].destinationInputId, ewol::EVENT_INPUT_TYPE_MOVE, pos);
}
}
void ewol::eventInput::State(int pointerID, bool isDown, coord2D_ts pos)
{
if( pointerID > MAX_MANAGE_INPUT
|| pointerID < 0) {
|| pointerID <= 0) {
// not manage input
return;
}
@ -140,9 +188,22 @@ void ewol::eventInput::State(int pointerID, bool isDown, coord2D_ts pos)
int64_t currentTime = GetCurrentTime();
if (true == isDown) {
EWOL_VERBOSE("GUI : Input ID=" << pointerID << " [DOWN] x=" << pos.x << " y=" << pos.y);
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventInputSaved[pointerID].destinationInputId << " [DOWN] " << pos);
if(true == eventInputSaved[pointerID].isUsed) {
// bad case ... ???
// we have an event previously ... check delay between click and offset position
if (currentTime - eventInputSaved[pointerID].lastTimeEvent > separateClickTime) {
CleanInputElement(pointerID);
} else if( abs(eventInputSaved[pointerID].downStart.x - pos.x) >= offsetMoveClicked
|| abs(eventInputSaved[pointerID].downStart.y - pos.y) >= offsetMoveClicked ){
CleanInputElement(pointerID);
}
}
if(true == eventInputSaved[pointerID].isUsed) {
// save start time
eventInputSaved[pointerID].lastTimeEvent = currentTime;
// generate DOWN Event
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventInputSaved[pointerID].destinationInputId << " [DOWN] " << pos);
localEventInput(eventInputSaved[pointerID].curentWidgetEvent, eventInputSaved[pointerID].destinationInputId, ewol::EVENT_INPUT_TYPE_DOWN, pos);
} else {
// Mark it used :
eventInputSaved[pointerID].isUsed = true;
@ -150,28 +211,37 @@ void ewol::eventInput::State(int pointerID, bool isDown, coord2D_ts pos)
eventInputSaved[pointerID].downStart = pos;
// save start time
eventInputSaved[pointerID].lastTimeEvent = currentTime;
// Set the element inside ...
eventInputSaved[pointerID].isInside = true;
// get destination widget :
if(NULL != gui_uniqueWindows) {
eventInputSaved[pointerID].curentWidgetEvent = gui_uniqueWindows->GetWidgetAtPos(pos);
} else {
eventInputSaved[pointerID].curentWidgetEvent = NULL;
}
if (NULL != eventInputSaved[pointerID].curentWidgetEvent) {
eventInputSaved[pointerID].origin = eventInputSaved[pointerID].curentWidgetEvent->GetOrigin();
eventInputSaved[pointerID].size = eventInputSaved[pointerID].curentWidgetEvent->GetSize();
eventInputSaved[pointerID].destinationInputId = localGetDestinationId(eventInputSaved[pointerID].curentWidgetEvent, pointerID);
} else {
eventInputSaved[pointerID].destinationInputId = -1;
}
// generate DOWN Event
EWOL_DEBUG("GUI : Input ID=" << pointerID << " [DOWN] (" << pos.x << "," << pos.y << ")");
localEventInput(eventInputSaved[pointerID].curentWidgetEvent, pointerID, ewol::EVENT_INPUT_TYPE_DOWN, pos);
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventInputSaved[pointerID].destinationInputId << " [DOWN] " << pos);
localEventInput(eventInputSaved[pointerID].curentWidgetEvent, eventInputSaved[pointerID].destinationInputId, ewol::EVENT_INPUT_TYPE_DOWN, pos);
}
} else {
EWOL_VERBOSE("GUI : Input ID=" << pointerID << " [UP] (" << pos.x << "," << pos.y << ")");
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventInputSaved[pointerID].destinationInputId << " [UP] " << pos);
if(false == eventInputSaved[pointerID].isUsed) {
// bad case ... ???
EWOL_WARNING("Up event without previous down ... ");
EWOL_VERBOSE("Up event without previous down ... ");
// Mark it un-used :
eventInputSaved[pointerID].isUsed = false;
// revove the widget ...
eventInputSaved[pointerID].curentWidgetEvent = NULL;
} else {
// generate UP Event
EWOL_DEBUG("GUI : Input ID=" << pointerID << " [UP] (" << pos.x << "," << pos.y << ")");
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventInputSaved[pointerID].destinationInputId << " [UP] " << pos);
localEventInput(eventInputSaved[pointerID].curentWidgetEvent, pointerID, ewol::EVENT_INPUT_TYPE_UP, pos);
// generate event (single)
if( abs(eventInputSaved[pointerID].downStart.x - pos.x) < offsetMoveClicked
@ -180,14 +250,33 @@ void ewol::eventInput::State(int pointerID, bool isDown, coord2D_ts pos)
eventInputSaved[pointerID].downStart = pos;
// save start time
eventInputSaved[pointerID].lastTimeEvent = currentTime;
// generate event :
EWOL_DEBUG("GUI : Input ID=" << pointerID << " [SINGLE] (" << pos.x << "," << pos.y << ")");
localEventInput(eventInputSaved[pointerID].curentWidgetEvent, pointerID, ewol::EVENT_INPUT_TYPE_SINGLE, pos);
if (eventInputSaved[pointerID].nbClickEvent == 0) {
// generate event SINGLE :
eventInputSaved[pointerID].nbClickEvent++;
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventInputSaved[pointerID].destinationInputId << " [SINGLE] " << pos);
localEventInput(eventInputSaved[pointerID].curentWidgetEvent, eventInputSaved[pointerID].destinationInputId, ewol::EVENT_INPUT_TYPE_SINGLE, pos);
} else if (eventInputSaved[pointerID].nbClickEvent == 1) {
// generate event DOUBLE :
eventInputSaved[pointerID].nbClickEvent++;
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventInputSaved[pointerID].destinationInputId << " [DOUBLE] " << pos);
localEventInput(eventInputSaved[pointerID].curentWidgetEvent, eventInputSaved[pointerID].destinationInputId, ewol::EVENT_INPUT_TYPE_DOUBLE, pos);
} else if (eventInputSaved[pointerID].nbClickEvent == 2) {
// generate event TRIPLE :
eventInputSaved[pointerID].nbClickEvent++;
EWOL_VERBOSE("GUI : Input ID=" << pointerID << "==>" << eventInputSaved[pointerID].destinationInputId << " [TRIPLE] " << pos);
localEventInput(eventInputSaved[pointerID].curentWidgetEvent, eventInputSaved[pointerID].destinationInputId, ewol::EVENT_INPUT_TYPE_TRIPLE, pos);
} else {
#if 0
eventInputSaved[pointerID].nbClickEvent++;
EWOL_DEBUG("GUI : Input ID=" << pointerID << "==>" << eventInputSaved[pointerID].destinationInputId << " [" << eventInputSaved[pointerID].nbClickEvent <<"] (" << pos.x << "," << pos.y << ")");
#else
eventInputSaved[pointerID].nbClickEvent = 0;
#endif
}
}
// Mark it un-used :
eventInputSaved[pointerID].isUsed = false;
// revove the widget ...
eventInputSaved[pointerID].curentWidgetEvent = NULL;
#ifdef __MODE__Touch
CleanInputElement(pointerID);
#endif
}
}
}

View File

@ -318,6 +318,12 @@ void ewol::ContextMenu::SetPositionMark(markPosition_te position, coord2D_ts arr
MarkToReedraw();
}
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
void ewol::ContextMenu::OnFlipFlopEvent(void)
{
//EWOL_DEBUG("Flip-Flop");

View File

@ -74,6 +74,11 @@ namespace ewol {
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, eventPosition_ts pos);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
virtual void OnFlipFlopEvent(void);
};
};

View File

@ -205,30 +205,18 @@ ewol::Widget * ewol::PopUp::GetWidgetAtPos(coord2D_ts pos)
return this;
}
bool ewol::PopUp::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, eventPosition_ts pos)
{
/*
if (NULL != m_subWidget[m_currentCreateId]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId]->GetSize();
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId]->GetOrigin();
if( (tmpOrigin.x <= pos.local.x && tmpOrigin.x + tmpSize.x >= pos.local.x)
&& (tmpOrigin.y <= pos.local.y && tmpOrigin.y + tmpSize.y >= pos.local.y) )
{
return m_subWidget[m_currentCreateId]->GenEventInput(IdInput, typeEvent, pos.abs);
} else {
//EWOL_INFO("Event ouside the Pop-up");
}
}
*/
return true;
}
void ewol::PopUp::SetDisplayRatio(etkFloat_t ratio)
{
m_displayRatio = ratio;
}
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
void ewol::PopUp::OnFlipFlopEvent(void)
{
bool needFlipFlop = m_needFlipFlop;

View File

@ -63,7 +63,11 @@ namespace ewol {
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, eventPosition_ts pos);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
virtual void OnFlipFlopEvent(void);
/**
* @brief Inform object that an other object is removed ...

View File

@ -259,25 +259,11 @@ ewol::Widget * ewol::SizerHori::GetWidgetAtPos(coord2D_ts pos)
}
bool ewol::SizerHori::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, eventPosition_ts pos)
{
/*
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
if (NULL != m_subWidget[m_currentCreateId][iii]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetSize();
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId][iii]->GetOrigin();
if( (tmpOrigin.x <= pos.abs.x && tmpOrigin.x + tmpSize.x >= pos.abs.x)
&& (tmpOrigin.y <= pos.abs.y && tmpOrigin.y + tmpSize.y >= pos.abs.y) )
{
return m_subWidget[m_currentCreateId][iii]->GenEventInput(IdInput, typeEvent, pos.abs);
}
}
}
*/
return true;
}
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
void ewol::SizerHori::OnFlipFlopEvent(void)
{
bool needFlipFlop = m_needFlipFlop;

View File

@ -63,7 +63,11 @@ namespace ewol {
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, eventPosition_ts pos);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
virtual void OnFlipFlopEvent(void);
/**
* @brief Inform object that an other object is removed ...

View File

@ -258,24 +258,12 @@ ewol::Widget * ewol::SizerVert::GetWidgetAtPos(coord2D_ts pos)
return this;
}
bool ewol::SizerVert::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, eventPosition_ts pos)
{
/*
for (int32_t iii=0; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
if (NULL != m_subWidget[m_currentCreateId][iii]) {
coord2D_ts tmpSize = m_subWidget[m_currentCreateId][iii]->GetSize();
coord2D_ts tmpOrigin = m_subWidget[m_currentCreateId][iii]->GetOrigin();
if( (tmpOrigin.x <= pos.abs.x && tmpOrigin.x + tmpSize.x >= pos.abs.x)
&& (tmpOrigin.y <= pos.abs.y && tmpOrigin.y + tmpSize.y >= pos.abs.y) )
{
return m_subWidget[m_currentCreateId][iii]->GenEventInput(IdInput, typeEvent, pos.abs);
}
}
}
*/
return true;
}
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
void ewol::SizerVert::OnFlipFlopEvent(void)
{
bool needFlipFlop = m_needFlipFlop;
@ -293,6 +281,7 @@ void ewol::SizerVert::OnFlipFlopEvent(void)
}
}
/**
* @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

View File

@ -64,8 +64,11 @@ namespace ewol {
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, eventPosition_ts pos);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
virtual void OnFlipFlopEvent(void);
/**
* @brief Inform object that an other object is removed ...

View File

@ -313,16 +313,21 @@ void ewol::Keyboard::OnRegenerateDisplay(void)
}
}
bool ewol::Keyboard::OnEventInput(int32_t IdInput, eventInputType_te typeEvent, eventPosition_ts pos)
/**
* @brief Get the widget at the specific windows absolute position
* @param[in] pos gAbsolute position of the requested widget knowledge
* @return NULL No widget found
* @return pointer on the widget found
*/
ewol::Widget * ewol::Keyboard::GetWidgetAtPos(coord2D_ts pos)
{
if (NULL != m_subWidget[m_currentCreateId]) {
return m_subWidget[m_currentCreateId]->GenEventInput(IdInput, typeEvent, pos.abs);
return m_subWidget[m_currentCreateId]->GetWidgetAtPos(pos);
}
return false;
return this;
}
/**
* @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
@ -339,7 +344,11 @@ void ewol::Keyboard::OnObjectRemove(ewol::EObject * removeObject)
}
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
void ewol::Keyboard::OnFlipFlopEvent(void)
{
bool needFlipFlop = m_needFlipFlop;

View File

@ -43,6 +43,11 @@ namespace ewol {
public:
Keyboard(void);
~Keyboard(void);
/**
* @brief Event generated to inform a flip-flop has occured on the current widget
* @param ---
* @return ---
*/
virtual void OnFlipFlopEvent(void);
/**
* @brief Receive a message from an other EObject with a specific eventId and data
@ -59,6 +64,13 @@ namespace ewol {
* @return ---
*/
virtual void OnObjectRemove(ewol::EObject * removeObject);
/**
* @brief Get the widget at the specific windows absolute position
* @param[in] pos gAbsolute position of the requested widget knowledge
* @return NULL No widget found
* @return pointer on the widget found
*/
virtual ewol::Widget * GetWidgetAtPos(coord2D_ts pos);
void SetMode(keyboardMode_te mode);
bool IsHide(void) { return m_isHide; };
void Hide(void) { m_isHide=true; };
@ -77,7 +89,6 @@ namespace ewol {
virtual void SetMinSise(etkFloat_t x=-1, etkFloat_t y=-1);
virtual void SetExpendX(bool newExpend=false);
virtual void SetExpendY(bool newExpend=false);
virtual bool OnEventInput(int32_t IdInput, eventInputType_te typeEvent, eventPosition_ts pos);
};
};