[DEV] new archi main part ended
This commit is contained in:
parent
01f409de3a
commit
916c7f31a3
2
build
2
build
@ -1 +1 @@
|
||||
Subproject commit 3498be99a18dd11444dbe87f1557471e65529bbc
|
||||
Subproject commit f52e3e6f5e20c2dc24fe4838af8b843270feeb13
|
@ -32,11 +32,11 @@ Then the first question, is where is the input of the application:
|
||||
|
||||
[code style=c++]
|
||||
// application start:
|
||||
bool APP_Init(ewol::eContext& _context) {
|
||||
bool APP_Init(ewol::Context& _context) {
|
||||
return true;
|
||||
}
|
||||
// application stop:
|
||||
void APP_UnInit(ewol::eContext& _context) {
|
||||
void APP_UnInit(ewol::Context& _context) {
|
||||
}
|
||||
[/code]
|
||||
|
||||
@ -70,7 +70,7 @@ For this point we will create a class that herited form the basic windows class:
|
||||
#include <ewol/widget/Windows.h>
|
||||
|
||||
namespace appl {
|
||||
class Windows : public ewol::Windows {
|
||||
class Windows : public ewol::widget::Windows {
|
||||
public:
|
||||
Windows(void);
|
||||
public:
|
||||
@ -91,7 +91,7 @@ For this point we will create a class that herited form the basic windows class:
|
||||
|
||||
appl::Windows::Windows(void) {
|
||||
setTitle("example 001_HelloWord");
|
||||
widget::Label* tmpWidget = new widget::Label();
|
||||
ewol::widget::Label* tmpWidget = new ewol::widget::Label();
|
||||
if (NULL == tmpWidget) {
|
||||
APPL_ERROR("Can not allocate widget ==> display might be in error");
|
||||
} else {
|
||||
@ -110,7 +110,7 @@ The fist basic property to set is the Title:
|
||||
After we simple create a [class[widget::Label]] in the main windows constructor.
|
||||
And we set the widget property (label).
|
||||
[code style=c++]
|
||||
widget::Label* tmpWidget = new widget::Label();
|
||||
ewol::widget::Label* tmpWidget = new ewol::widget::Label();
|
||||
tmpWidget->setLabel("Hello <font color=\"blue\">Word</font>");
|
||||
tmpWidget->setExpand(bvec2(true,true));
|
||||
[/code]
|
||||
@ -146,7 +146,7 @@ Then we create windows and set it in the main contect main (in the APPL_init()):
|
||||
|
||||
Then the init fuction is :
|
||||
[code style=c++]
|
||||
bool APP_Init(ewol::eContext& _context) {
|
||||
bool APP_Init(ewol::Context& _context) {
|
||||
// select internal data for font ...
|
||||
_context.getFontDefault().setUseExternal(true);
|
||||
_context.getFontDefault().set("FreeSerif;DejaVuSansMono", 19);
|
||||
@ -161,14 +161,7 @@ bool APP_Init(ewol::eContext& _context) {
|
||||
To un-init the application, the context call a generic function [b]APP_UnInit[/b].
|
||||
In this function we just need to remove the windows and un-init all needed by the system.
|
||||
[code style=c++]
|
||||
void APP_UnInit(ewol::eContext& _context) {
|
||||
// Remove windows :
|
||||
ewol::Windows* basicWindows = _context.getWindows();
|
||||
|
||||
if (NULL != basicWindows) {
|
||||
delete(basicWindows);
|
||||
basicWindows = NULL;
|
||||
}
|
||||
_context.setWindows(NULL);
|
||||
void APP_UnInit(ewol::Context& _context) {
|
||||
// The main windows will be auto-remove after this call if it is not done...
|
||||
}
|
||||
[/code]
|
||||
|
2
external/ege
vendored
2
external/ege
vendored
@ -1 +1 @@
|
||||
Subproject commit 2c54a551b4a007d79a9f7a4367e019f11bc94f7b
|
||||
Subproject commit 58596f179adbc3c0362f7cd802028ced2f5836aa
|
@ -12,7 +12,7 @@
|
||||
#include <stdint.h>
|
||||
#include <pthread.h>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
#include <ewol/context/Context.h>
|
||||
#include <ewol/renderer/audio/audio.h>
|
||||
#include <ewol/Dimension.h>
|
||||
/* include auto generated file */
|
||||
@ -200,17 +200,17 @@ class AndroidContext : public ewol::eContext {
|
||||
java_detach_current_thread(status);
|
||||
}
|
||||
|
||||
void clipBoardGet(enum ewol::clipBoard::clipboardListe _clipboardID) {
|
||||
void clipBoardGet(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||
// this is to force the local system to think we have the buffer
|
||||
// TODO : remove this 2 line when code will be writen
|
||||
m_clipBoardOwnerStd = true;
|
||||
switch (_clipboardID) {
|
||||
case ewol::clipBoard::clipboardSelection:
|
||||
case ewol::context::clipBoard::clipboardSelection:
|
||||
// NOTE : Windows does not support the middle button the we do it internaly
|
||||
// just transmit an event , we have the data in the system
|
||||
OS_ClipBoardArrive(_clipboardID);
|
||||
break;
|
||||
case ewol::clipBoard::clipboardStd:
|
||||
case ewol::context::clipBoard::clipboardStd:
|
||||
if (false == m_clipBoardOwnerStd) {
|
||||
// generate a request TO the OS
|
||||
// TODO : Send the message to the OS "We disire to receive the copy buffer ...
|
||||
@ -225,12 +225,12 @@ class AndroidContext : public ewol::eContext {
|
||||
}
|
||||
}
|
||||
|
||||
void clipBoardSet(enum ewol::clipBoard::clipboardListe _clipboardID) {
|
||||
void clipBoardSet(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||
switch (_clipboardID) {
|
||||
case ewol::clipBoard::clipboardSelection:
|
||||
case ewol::context::clipBoard::clipboardSelection:
|
||||
// NOTE : nothing to do : Windows deas ot supported Middle button
|
||||
break;
|
||||
case ewol::clipBoard::clipboardStd:
|
||||
case ewol::context::clipBoard::clipboardStd:
|
||||
// Request the clipBoard :
|
||||
if (false == m_clipBoardOwnerStd) {
|
||||
// TODO : Inform the OS that we have the current buffer of copy ...
|
||||
|
@ -351,14 +351,15 @@ ewol::Context::~Context(void) {
|
||||
lockContext();
|
||||
// call application to uninit
|
||||
APP_UnInit(*this);
|
||||
if (NULL!=m_windowsCurrent) {
|
||||
EWOL_ERROR("Main windows has not been removed... == > memory leek");
|
||||
if (m_windowsCurrent != NULL) {
|
||||
EWOL_DEBUG("Main windows has not been auto-removed...");
|
||||
m_windowsCurrent->removeObject();
|
||||
m_windowsCurrent = NULL;
|
||||
}
|
||||
// unset all windows
|
||||
m_windowsCurrent = NULL;
|
||||
m_msgSystem.clean();
|
||||
|
||||
m_EObjectManager.unInit();
|
||||
m_objectManager.unInit();
|
||||
m_resourceManager.unInit();
|
||||
// release the curent interface :
|
||||
unLockContext();
|
||||
@ -544,7 +545,7 @@ bool ewol::Context::OS_Draw(bool _displayEveryTime) {
|
||||
m_widgetManager.periodicCall(currentTime);
|
||||
// remove all widget that they are no more usefull (these who decided to destroy themself)
|
||||
//! ewol::ObjectManager::removeAllAutoRemove();
|
||||
m_EObjectManager.removeAllAutoRemove();
|
||||
m_objectManager.removeAllAutoRemove();
|
||||
// check if the user selected a windows
|
||||
if (NULL != m_windowsCurrent) {
|
||||
// Redraw all needed elements
|
||||
|
@ -57,10 +57,10 @@ namespace ewol {
|
||||
return m_widgetManager;
|
||||
};
|
||||
private:
|
||||
ewol::object::Manager m_EObjectManager; //!< eObject Manager main instance
|
||||
ewol::object::Manager m_objectManager; //!< Object Manager main instance
|
||||
public:
|
||||
ewol::object::Manager& getEObjectManager(void) {
|
||||
return m_EObjectManager;
|
||||
return m_objectManager;
|
||||
};
|
||||
private:
|
||||
ewol::resource::Manager m_resourceManager; //!< global resources Manager
|
||||
|
@ -14,10 +14,10 @@
|
||||
#include <etk/UString.h>
|
||||
#include <etk/unicode.h>
|
||||
#include <etk/os/FSNode.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
#include <ewol/context/Context.h>
|
||||
|
||||
#include <ewol/renderer/MacOs/Interface.h>
|
||||
#include <ewol/renderer/MacOs/Context.h>
|
||||
@ -88,19 +88,19 @@ class MacOSInterface : public ewol::eContext {
|
||||
}
|
||||
//EWOL_DEBUG("key: " << _unichar << " up=" << !_isDown);
|
||||
if (_unichar <= 4) {
|
||||
enum ewol::keyEvent::keyboard move;
|
||||
enum ewol::key::keyboard move;
|
||||
switch(_unichar) {
|
||||
case 0:
|
||||
move = ewol::keyEvent::keyboardUp;
|
||||
move = ewol::key::keyboardUp;
|
||||
break;
|
||||
case 1:
|
||||
move = ewol::keyEvent::keyboardDown;
|
||||
move = ewol::key::keyboardDown;
|
||||
break;
|
||||
case 2:
|
||||
move = ewol::keyEvent::keyboardLeft;
|
||||
move = ewol::key::keyboardLeft;
|
||||
break;
|
||||
case 3:
|
||||
move = ewol::keyEvent::keyboardRight;
|
||||
move = ewol::key::keyboardRight;
|
||||
break;
|
||||
}
|
||||
OS_SetKeyboardMove(_keyboardMode, move, !_isDown, _isAReapeateKey);
|
||||
@ -109,7 +109,7 @@ class MacOSInterface : public ewol::eContext {
|
||||
}
|
||||
}
|
||||
void MAC_SetKeyboardMove(ewol::SpecialKey& _special,
|
||||
enum ewol::keyEvent::keyboard _move,
|
||||
enum ewol::key::keyboard _move,
|
||||
bool _isDown) {
|
||||
OS_SetKeyboardMove(_special, _move, _isDown);
|
||||
}
|
||||
@ -156,7 +156,7 @@ void MacOs::setKeyboard(ewol::SpecialKey _keyboardMode, int32_t _unichar, bool _
|
||||
interface->MAC_SetKeyboard(_keyboardMode, _unichar, _isDown, _isAReapeateKey);
|
||||
}
|
||||
|
||||
void MacOs::setKeyboardMove(ewol::SpecialKey& _keyboardMode, enum ewol::keyEvent::keyboard _move, bool _isDown) {
|
||||
void MacOs::setKeyboardMove(ewol::SpecialKey& _keyboardMode, enum ewol::key::keyboard _move, bool _isDown) {
|
||||
if (interface == NULL) {
|
||||
return;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ namespace MacOs {
|
||||
void setMouseState(int32_t _id, bool _isDown, float _x, float _y);
|
||||
void setMouseMotion(int32_t _id, float _x, float _y);
|
||||
void setKeyboard(ewol::SpecialKey _keyboardMode, int32_t _unichar, bool _isDown, bool _isAReapeateKey);
|
||||
void setKeyboardMove(ewol::SpecialKey& _keyboardMode, enum ewol::keyEvent::keyboard _move, bool _isDown);
|
||||
void setKeyboardMove(ewol::SpecialKey& _keyboardMode, enum ewol::key::keyboard _move, bool _isDown);
|
||||
};
|
||||
|
||||
#endif
|
@ -14,12 +14,12 @@
|
||||
#include <etk/math/Vector3D.h>
|
||||
#include <etk/UString.h>
|
||||
#include <etk/unicode.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
#include <ewol/resources/Texture.h>
|
||||
#include <ewol/resources/Image.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
#include <ewol/renderer/openGL.h>
|
||||
#include <ewol/context/Context.h>
|
||||
#include <ewol/openGL/openGL.h>
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <windows.h>
|
||||
@ -130,18 +130,18 @@ class WindowsContext : public ewol::eContext {
|
||||
// TODO : Later
|
||||
}
|
||||
|
||||
void ClipBoardGet(enum ewol::clipBoard::clipboardListe _clipboardID) {
|
||||
void ClipBoardGet(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||
// this is to force the local system to think we have the buffer
|
||||
// TODO : remove this 2 line when code will be writen
|
||||
l_clipBoardOwnerStd = true;
|
||||
switch (_clipboardID)
|
||||
{
|
||||
case ewol::clipBoard::clipboardSelection:
|
||||
case ewol::context::clipBoard::clipboardSelection:
|
||||
// NOTE : Windows does not support the middle button the we do it internaly
|
||||
// just transmit an event , we have the data in the system
|
||||
ClipBoardArrive(_clipboardID);
|
||||
break;
|
||||
case ewol::clipBoard::clipboardStd:
|
||||
case ewol::context::clipBoard::clipboardStd:
|
||||
if (false == l_clipBoardOwnerStd) {
|
||||
// generate a request TO the OS
|
||||
// TODO : Send the message to the OS "We disire to receive the copy buffer ...
|
||||
@ -156,13 +156,13 @@ class WindowsContext : public ewol::eContext {
|
||||
}
|
||||
}
|
||||
|
||||
void ClipBoardSet(enum ewol::clipBoard::clipboardListe _clipboardID) {
|
||||
void ClipBoardSet(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||
switch (_clipboardID)
|
||||
{
|
||||
case ewol::clipBoard::clipboardSelection:
|
||||
case ewol::context::clipBoard::clipboardSelection:
|
||||
// NOTE : nothing to do : Windows deas ot supported Middle button
|
||||
break;
|
||||
case ewol::clipBoard::clipboardStd:
|
||||
case ewol::context::clipBoard::clipboardStd:
|
||||
// Request the clipBoard :
|
||||
if (false == m_clipBoardOwnerStd) {
|
||||
// TODO : Inform the OS that we have the current buffer of copy ...
|
||||
@ -278,42 +278,42 @@ class WindowsContext : public ewol::eContext {
|
||||
buttonIsDown = false;
|
||||
case WM_KEYDOWN: {
|
||||
char32_t tmpChar = 0;
|
||||
enum ewol::keyEvent::keyboard keyInput;
|
||||
enum ewol::key::keyboard keyInput;
|
||||
switch (_wParam) {
|
||||
//case 80: // keypad
|
||||
case VK_UP: keyInput = ewol::keyEvent::keyboardUp; break;
|
||||
case VK_UP: keyInput = ewol::key::keyboardUp; break;
|
||||
//case 83: // keypad
|
||||
case VK_LEFT: keyInput = ewol::keyEvent::keyboardLeft; break;
|
||||
case VK_LEFT: keyInput = ewol::key::keyboardLeft; break;
|
||||
//case 85: // keypad
|
||||
case VK_RIGHT: keyInput = ewol::keyEvent::keyboardRight; break;
|
||||
case VK_RIGHT: keyInput = ewol::key::keyboardRight; break;
|
||||
//case 88: // keypad
|
||||
case VK_DOWN: keyInput = ewol::keyEvent::keyboardDown; break;
|
||||
case VK_DOWN: keyInput = ewol::key::keyboardDown; break;
|
||||
//case 81: // keypad
|
||||
case VK_PRIOR: keyInput = ewol::keyEvent::keyboardPageUp; break;
|
||||
case VK_PRIOR: keyInput = ewol::key::keyboardPageUp; break;
|
||||
//case 89: // keypad
|
||||
case VK_NEXT: keyInput = ewol::keyEvent::keyboardPageDown; break;
|
||||
case VK_NEXT: keyInput = ewol::key::keyboardPageDown; break;
|
||||
//case 79: // keypad
|
||||
case VK_HOME: keyInput = ewol::keyEvent::keyboardStart; break;
|
||||
case VK_HOME: keyInput = ewol::key::keyboardStart; break;
|
||||
//case 87: // keypad
|
||||
case VK_END: keyInput = ewol::keyEvent::keyboardEnd; break;
|
||||
//case VK_: keyInput = ewol::keyEvent::keyboardStopDefil; break;
|
||||
case VK_PAUSE: keyInput = ewol::keyEvent::keyboardWait; break;
|
||||
case VK_END: keyInput = ewol::key::keyboardEnd; break;
|
||||
//case VK_: keyInput = ewol::key::keyboardStopDefil; break;
|
||||
case VK_PAUSE: keyInput = ewol::key::keyboardWait; break;
|
||||
//case 90: // keypad
|
||||
case VK_INSERT:
|
||||
keyInput = ewol::keyEvent::keyboardInsert;
|
||||
keyInput = ewol::key::keyboardInsert;
|
||||
guiKeyBoardMode.insert = buttonIsDown;
|
||||
break;
|
||||
case VK_F1: keyInput = ewol::keyEvent::keyboardF1; break;
|
||||
case VK_F2: keyInput = ewol::keyEvent::keyboardF2; break;
|
||||
case VK_F3: keyInput = ewol::keyEvent::keyboardF3; break;
|
||||
case VK_F4: keyInput = ewol::keyEvent::keyboardF4; break;
|
||||
case VK_F5: keyInput = ewol::keyEvent::keyboardF5; break;
|
||||
case VK_F6: keyInput = ewol::keyEvent::keyboardF6; break;
|
||||
case VK_F7: keyInput = ewol::keyEvent::keyboardF7; break;
|
||||
case VK_F8: keyInput = ewol::keyEvent::keyboardF8; break;
|
||||
case VK_F9: keyInput = ewol::keyEvent::keyboardF9; break;
|
||||
case VK_F10: keyInput = ewol::keyEvent::keyboardF10; break;
|
||||
case VK_F11: keyInput = ewol::keyEvent::keyboardF11; break;
|
||||
case VK_F1: keyInput = ewol::key::keyboardF1; break;
|
||||
case VK_F2: keyInput = ewol::key::keyboardF2; break;
|
||||
case VK_F3: keyInput = ewol::key::keyboardF3; break;
|
||||
case VK_F4: keyInput = ewol::key::keyboardF4; break;
|
||||
case VK_F5: keyInput = ewol::key::keyboardF5; break;
|
||||
case VK_F6: keyInput = ewol::key::keyboardF6; break;
|
||||
case VK_F7: keyInput = ewol::key::keyboardF7; break;
|
||||
case VK_F8: keyInput = ewol::key::keyboardF8; break;
|
||||
case VK_F9: keyInput = ewol::key::keyboardF9; break;
|
||||
case VK_F10: keyInput = ewol::key::keyboardF10; break;
|
||||
case VK_F11: keyInput = ewol::key::keyboardF11; break;
|
||||
case VK_F12:
|
||||
case VK_F13:
|
||||
case VK_F14:
|
||||
@ -326,25 +326,25 @@ class WindowsContext : public ewol::eContext {
|
||||
case VK_F21:
|
||||
case VK_F22:
|
||||
case VK_F23:
|
||||
case VK_F24: keyInput = ewol::keyEvent::keyboardF12; break;
|
||||
case VK_CAPITAL: keyInput = ewol::keyEvent::keyboardCapLock; guiKeyBoardMode.capLock = buttonIsDown; break;
|
||||
case VK_F24: keyInput = ewol::key::keyboardF12; break;
|
||||
case VK_CAPITAL: keyInput = ewol::key::keyboardCapLock; guiKeyBoardMode.capLock = buttonIsDown; break;
|
||||
|
||||
case VK_SHIFT:
|
||||
case VK_LSHIFT: keyInput = ewol::keyEvent::keyboardShiftLeft; guiKeyBoardMode.shift = buttonIsDown; break;
|
||||
case VK_RSHIFT: keyInput = ewol::keyEvent::keyboardShiftRight; guiKeyBoardMode.shift = buttonIsDown; break;
|
||||
case VK_LSHIFT: keyInput = ewol::key::keyboardShiftLeft; guiKeyBoardMode.shift = buttonIsDown; break;
|
||||
case VK_RSHIFT: keyInput = ewol::key::keyboardShiftRight; guiKeyBoardMode.shift = buttonIsDown; break;
|
||||
|
||||
case VK_CONTROL:
|
||||
case VK_LCONTROL: keyInput = ewol::keyEvent::keyboardCtrlLeft; guiKeyBoardMode.ctrl = buttonIsDown; break;
|
||||
case VK_RCONTROL: keyInput = ewol::keyEvent::keyboardCtrlRight; guiKeyBoardMode.ctrl = buttonIsDown; break;
|
||||
case VK_LCONTROL: keyInput = ewol::key::keyboardCtrlLeft; guiKeyBoardMode.ctrl = buttonIsDown; break;
|
||||
case VK_RCONTROL: keyInput = ewol::key::keyboardCtrlRight; guiKeyBoardMode.ctrl = buttonIsDown; break;
|
||||
|
||||
case VK_LWIN: keyInput = ewol::keyEvent::keyboardMetaLeft; guiKeyBoardMode.meta = buttonIsDown; break;
|
||||
case VK_RWIN: keyInput = ewol::keyEvent::keyboardMetaRight; guiKeyBoardMode.meta = buttonIsDown; break;
|
||||
case VK_LWIN: keyInput = ewol::key::keyboardMetaLeft; guiKeyBoardMode.meta = buttonIsDown; break;
|
||||
case VK_RWIN: keyInput = ewol::key::keyboardMetaRight; guiKeyBoardMode.meta = buttonIsDown; break;
|
||||
|
||||
case VK_MENU:
|
||||
case VK_LMENU: keyInput = ewol::keyEvent::keyboardAlt; guiKeyBoardMode.alt = buttonIsDown; break;
|
||||
case VK_RMENU: keyInput = ewol::keyEvent::keyboardAltGr; guiKeyBoardMode.altGr = buttonIsDown; break;
|
||||
//case : keyInput = ewol::keyEvent::keyboardContextMenu; break;
|
||||
case VK_NUMLOCK: keyInput = ewol::keyEvent::keyboardNumLock; guiKeyBoardMode.numLock = buttonIsDown; break;
|
||||
case VK_LMENU: keyInput = ewol::key::keyboardAlt; guiKeyBoardMode.alt = buttonIsDown; break;
|
||||
case VK_RMENU: keyInput = ewol::key::keyboardAltGr; guiKeyBoardMode.altGr = buttonIsDown; break;
|
||||
//case : keyInput = ewol::key::keyboardContextMenu; break;
|
||||
case VK_NUMLOCK: keyInput = ewol::key::keyboardNumLock; guiKeyBoardMode.numLock = buttonIsDown; break;
|
||||
case VK_BACK: // DEL
|
||||
tmpChar.set(0x08);
|
||||
break;
|
||||
|
@ -56,7 +56,7 @@ namespace ewol {
|
||||
/**
|
||||
* @brief get the ewol internal buffer of the curent clipboard. The end user can use it when he receive the event in
|
||||
* the widget : @ref onEventClipboard == > we can nothe this function is the only one which permit it.
|
||||
* @note if we call this fuction withoutcallin @ref ewol::clipBoard::Request, we only get the previous clipboard
|
||||
* @note if we call this fuction withoutcallin @ref ewol::context::clipBoard::Request, we only get the previous clipboard
|
||||
* @param[in] _clipboardID selected clipboard ID
|
||||
* @return the requested buffer
|
||||
*/
|
||||
|
@ -32,11 +32,11 @@
|
||||
#include <ewol/commandLine.h>
|
||||
#include <etk/UString.h>
|
||||
#include <etk/unicode.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
#include <ewol/renderer/ResourceManager.h>
|
||||
#include <ewol/renderer/eSystem.h>
|
||||
#include <ewol/renderer/openGL.h>
|
||||
#include <ewol/openGL/openGL.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
@ -369,12 +369,12 @@ void DirectFB_Run(void) {
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
|
||||
void guiInterface::ClipBoardGet(enum ewol::clipBoard::clipboardListe _clipboardID) {
|
||||
void guiInterface::ClipBoardGet(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||
// TODO : ...
|
||||
}
|
||||
|
||||
|
||||
void guiInterface::ClipBoardSet(enum ewol::clipBoard::clipboardListe _clipboardID) {
|
||||
void guiInterface::ClipBoardSet(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||
// TODO : ...
|
||||
}
|
||||
|
||||
|
@ -9,9 +9,9 @@
|
||||
#include <ewol/widget/Widget.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "EventEntry"
|
||||
#define __class__ "event::Entry"
|
||||
|
||||
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::event::Entry& _obj) {
|
||||
etk::CCout& ewol::event::operator <<(etk::CCout& _os, const ewol::event::Entry& _obj) {
|
||||
_os << "{type=" << _obj.getType();
|
||||
_os << " status=" << _obj.getStatus();
|
||||
if (_obj.getType() == ewol::key::keyboardChar) {
|
||||
@ -21,7 +21,7 @@ etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::event::Entry& _obj) {
|
||||
return _os;
|
||||
}
|
||||
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::event::EntrySystem& _obj) {
|
||||
etk::CCout& ewol::event::operator <<(etk::CCout& _os, const ewol::event::EntrySystem& _obj) {
|
||||
_os << _obj.m_event;
|
||||
return _os;
|
||||
}
|
||||
|
@ -56,6 +56,7 @@ namespace ewol {
|
||||
return m_unicodeData;
|
||||
};
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::event::Entry& _obj);
|
||||
|
||||
class EntrySystem {
|
||||
public:
|
||||
@ -68,9 +69,8 @@ namespace ewol {
|
||||
};
|
||||
ewol::event::Entry m_event;
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::event::EntrySystem& _obj);
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::event::Entry& _obj);
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::event::EntrySystem& _obj);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -9,9 +9,9 @@
|
||||
#include <ewol/widget/Widget.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "EventInput"
|
||||
#define __class__ "event::Input"
|
||||
|
||||
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::event::Input& _obj) {
|
||||
etk::CCout& ewol::event::operator <<(etk::CCout& _os, const ewol::event::Input& _obj) {
|
||||
_os << "{type=" << _obj.getType();
|
||||
_os << " status=" << _obj.getStatus();
|
||||
_os << " id=" << _obj.getId();
|
||||
@ -20,7 +20,7 @@ etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::event::Input& _obj) {
|
||||
return _os;
|
||||
}
|
||||
|
||||
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::event::InputSystem& _obj) {
|
||||
etk::CCout& ewol::event::operator <<(etk::CCout& _os, const ewol::event::InputSystem& _obj) {
|
||||
_os << _obj.m_event;
|
||||
return _os;
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ namespace ewol {
|
||||
return m_pos;
|
||||
};
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::event::Input& _obj);
|
||||
|
||||
class InputSystem {
|
||||
public:
|
||||
@ -85,9 +86,8 @@ namespace ewol {
|
||||
return m_realIdEvent;
|
||||
};
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::event::InputSystem& _obj);
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::event::Input& _obj);
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::event::InputSystem& _obj);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -11,7 +11,7 @@
|
||||
#undef __class__
|
||||
#define __class__ "event::Time"
|
||||
|
||||
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::event::Time& _obj) {
|
||||
etk::CCout& ewol::event::operator <<(etk::CCout& _os, const ewol::event::Time& _obj) {
|
||||
_os << "{time=" << _obj.getTime();
|
||||
_os << " uptime=" << _obj.getApplUpTime();
|
||||
_os << " delta=" << _obj.getDelta();
|
||||
|
@ -59,8 +59,8 @@ namespace ewol {
|
||||
return m_timeDeltaCall;
|
||||
};
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::event::Time& _obj);
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::event::Time& _obj);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -11,12 +11,12 @@
|
||||
#undef __class__
|
||||
#define __class__ "object/Message"
|
||||
|
||||
etk::CCout& ewol::operator <<(etk::CCout& _os, const ewol::object::Message& _obj) {
|
||||
etk::CCout& ewol::object::operator <<(etk::CCout& _os, const ewol::object::Message& _obj) {
|
||||
_os << "{";
|
||||
if (NULL != _obj.getMessage()) {
|
||||
_os << "msg=\"" << _obj.getMessage() << "\"";
|
||||
} else {
|
||||
_os << "msg=\"NULL\"";
|
||||
_os << "msg={NULL}";
|
||||
}
|
||||
_os << " data=\"" << _obj.getData() << "\"}";
|
||||
return _os;
|
||||
|
@ -47,8 +47,8 @@ namespace ewol {
|
||||
return m_data;
|
||||
};
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::object::Message& _obj);
|
||||
};
|
||||
etk::CCout& operator <<(etk::CCout& _os, const ewol::object::Message& _obj);
|
||||
};
|
||||
|
||||
|
||||
|
@ -7,8 +7,8 @@
|
||||
*/
|
||||
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/resources/Colored3DObject.h>
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/resource/Colored3DObject.h>
|
||||
#include <ewol/resource/Manager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "resource::Colored3DObject"
|
||||
@ -19,7 +19,7 @@ ewol::resource::Colored3DObject::Colored3DObject(void) :
|
||||
addObjectType("ewol::Colored3DObject");
|
||||
// get the shader resource :
|
||||
m_GLPosition = 0;
|
||||
m_GLprogram = ewol::Program::keep("DATA:simple3D.prog");
|
||||
m_GLprogram = ewol::resource::Program::keep("DATA:simple3D.prog");
|
||||
if (NULL != m_GLprogram ) {
|
||||
m_GLPosition = m_GLprogram->getAttribute("EW_coord3d");
|
||||
m_GLColor = m_GLprogram->getUniform("EW_color");
|
||||
@ -29,7 +29,7 @@ ewol::resource::Colored3DObject::Colored3DObject(void) :
|
||||
|
||||
ewol::resource::Colored3DObject::~Colored3DObject(void) {
|
||||
// remove dynamics dependencies :
|
||||
ewol::Program::release(m_GLprogram);
|
||||
ewol::resource::Program::release(m_GLprogram);
|
||||
}
|
||||
|
||||
|
||||
@ -155,7 +155,7 @@ void ewol::resource::Colored3DObject::drawLine(std::vector<vec3>& _vertices,
|
||||
}
|
||||
}
|
||||
|
||||
ewol::resource::Colored3DObject* ewol::Colored3DObject::keep(void) {
|
||||
ewol::resource::Colored3DObject* ewol::resource::Colored3DObject::keep(void) {
|
||||
EWOL_VERBOSE("KEEP : direct Colored3DObject");
|
||||
// need to crate a new one ...
|
||||
ewol::resource::Colored3DObject* object = new ewol::resource::Colored3DObject();
|
||||
@ -171,7 +171,7 @@ void ewol::resource::Colored3DObject::release(ewol::resource::Colored3DObject*&
|
||||
if (NULL == _object) {
|
||||
return;
|
||||
}
|
||||
ewol::resource::Resource* object2 = static_cast<ewol::resource::Resource*>(_object);
|
||||
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
|
||||
getManager().release(object2);
|
||||
_object = NULL;
|
||||
}
|
||||
|
@ -10,16 +10,16 @@
|
||||
#define __COLORED_3D_OBJECT_H__
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <ewol/resources/Resource.h>
|
||||
#include <ewol/resources/Image.h>
|
||||
#include <ewol/resources/Shader.h>
|
||||
#include <ewol/resources/Program.h>
|
||||
#include <ewol/resource/Resource.h>
|
||||
#include <ewol/resource/Image.h>
|
||||
#include <ewol/resource/Shader.h>
|
||||
#include <ewol/resource/Program.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace resource {
|
||||
class Colored3DObject : public ewol::resource::Resource {
|
||||
class Colored3DObject : public ewol::Resource {
|
||||
protected:
|
||||
ewol::Program* m_GLprogram;
|
||||
ewol::resource::Program* m_GLprogram;
|
||||
int32_t m_GLPosition;
|
||||
int32_t m_GLMatrix;
|
||||
int32_t m_GLColor;
|
||||
@ -27,7 +27,6 @@ namespace ewol {
|
||||
Colored3DObject(void);
|
||||
virtual ~Colored3DObject(void);
|
||||
public:
|
||||
virtual const char* getType(void) { return "ewol::Colored3DObject"; };
|
||||
virtual void draw(std::vector<vec3>& _vertices,
|
||||
const etk::Color<float>& _color,
|
||||
bool _updateDepthBuffer=true,
|
||||
@ -48,12 +47,12 @@ namespace ewol {
|
||||
* @note Never free this pointer by your own...
|
||||
* @return pointer on the resource or NULL if an error occured.
|
||||
*/
|
||||
static ewol::Colored3DObject* keep(void);
|
||||
static ewol::resource::Colored3DObject* keep(void);
|
||||
/**
|
||||
* @brief release the keeped resources
|
||||
* @param[in,out] reference on the object pointer
|
||||
*/
|
||||
static void release(ewol::Colored3DObject*& _object);
|
||||
static void release(ewol::resource::Colored3DObject*& _object);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
#include <etk/os/FSNode.h>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/resources/ConfigFile.h>
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/resource/ConfigFile.h>
|
||||
#include <ewol/resource/Manager.h>
|
||||
#include <stdexcept>
|
||||
|
||||
#undef __class__
|
||||
@ -37,7 +37,7 @@ void ewol::resource::SimpleConfigElement::parse(const std::string& _value) {
|
||||
|
||||
|
||||
ewol::resource::ConfigFile::ConfigFile(const std::string& _filename) :
|
||||
ewol::resource::Resource(_filename) {
|
||||
ewol::Resource(_filename) {
|
||||
addObjectType("ewol::ConfigFile");
|
||||
EWOL_DEBUG("SFP : load \"" << _filename << "\"");
|
||||
reload();
|
||||
@ -124,7 +124,7 @@ void ewol::resource::ConfigFile::reload(void) {
|
||||
}
|
||||
}
|
||||
if (false == findParam) {
|
||||
ewol::SimpleConfigElement* tmpElement = new ewol::SimpleConfigElement(paramName);
|
||||
ewol::resource::SimpleConfigElement* tmpElement = new ewol::resource::SimpleConfigElement(paramName);
|
||||
if (NULL == tmpElement) {
|
||||
EWOL_DEBUG("error while allocation");
|
||||
} else {
|
||||
@ -177,7 +177,7 @@ void ewol::resource::ConfigFile::release(ewol::resource::ConfigFile*& _object) {
|
||||
if (NULL == _object) {
|
||||
return;
|
||||
}
|
||||
ewol::resource::Resource* object2 = static_cast<ewol::resource::Resource*>(_object);
|
||||
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
|
||||
getManager().release(object2);
|
||||
_object = NULL;
|
||||
}
|
||||
|
@ -11,12 +11,12 @@
|
||||
#include <etk/os/FSNode.h>
|
||||
|
||||
|
||||
#include <ewol/renderer/openGL.h>
|
||||
#include <ewol/openGL/openGL.h>
|
||||
|
||||
#include <ewol/resources/Texture.h>
|
||||
#include <ewol/resources/FontFreeType.h>
|
||||
#include <ewol/resources/font/FontBase.h>
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/resource/Texture.h>
|
||||
#include <ewol/resource/FontFreeType.h>
|
||||
#include <ewol/resource/font/FontBase.h>
|
||||
#include <ewol/resource/Manager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "resource::FontFreeType"
|
||||
@ -163,7 +163,7 @@ bool ewol::resource::FontFreeType::getGlyphProperty(int32_t _fontSize, ewol::Gly
|
||||
bool ewol::resource::FontFreeType::drawGlyph(egami::Image& _imageOut,
|
||||
int32_t _fontSize,
|
||||
ivec2 _glyphPosition,
|
||||
ewol::resource::GlyphProperty& _property,
|
||||
ewol::GlyphProperty& _property,
|
||||
int8_t _posInImage) {
|
||||
if(false == m_init) {
|
||||
return false;
|
||||
@ -362,7 +362,7 @@ void ewol::resource::FontFreeType::release(ewol::resource::FontBase*& _object) {
|
||||
if (NULL == _object) {
|
||||
return;
|
||||
}
|
||||
ewol::resource::Resource* object2 = static_cast<ewol::resource::Resource*>(_object);
|
||||
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
|
||||
getManager().release(object2);
|
||||
_object = NULL;
|
||||
}
|
||||
|
@ -9,9 +9,9 @@
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <egami/egami.h>
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/resources/Image.h>
|
||||
#include <ewol/resources/Texture.h>
|
||||
#include <ewol/resource/Manager.h>
|
||||
#include <ewol/resource/Image.h>
|
||||
#include <ewol/resource/Texture.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
@ -25,7 +25,7 @@ ewol::resource::TextureFile::TextureFile(const std::string& _genName) :
|
||||
|
||||
ewol::resource::TextureFile::TextureFile(std::string _genName, const std::string& _tmpfileName, const ivec2& _size) :
|
||||
ewol::resource::Texture(_genName) {
|
||||
addObjectType("ewol::TextureFile");
|
||||
addObjectType("ewol::compositing::TextureFile");
|
||||
if (false == egami::load(m_data, _tmpfileName, _size)) {
|
||||
EWOL_ERROR("ERROR when loading the image : " << _tmpfileName);
|
||||
}
|
||||
@ -115,7 +115,7 @@ void ewol::resource::TextureFile::release(ewol::resource::TextureFile*& _object)
|
||||
if (NULL == _object) {
|
||||
return;
|
||||
}
|
||||
ewol::resource::Resource* object2 = static_cast<ewol::resource::Resource*>(_object);
|
||||
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
|
||||
getManager().release(object2);
|
||||
_object = NULL;
|
||||
}
|
||||
|
@ -25,8 +25,9 @@ namespace ewol {
|
||||
TextureFile(std::string _genName, const std::string& _fileName, const ivec2& _size);
|
||||
~TextureFile(void) { };
|
||||
public:
|
||||
virtual const char* getType(void) { return "ewol::TextureFile"; };
|
||||
const vec2& getRealSize(void) { return m_realImageSize; };
|
||||
const vec2& getRealSize(void) {
|
||||
return m_realImageSize;
|
||||
};
|
||||
public:
|
||||
/**
|
||||
* @brief keep the resource pointer.
|
||||
|
@ -8,11 +8,11 @@
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/resources/FontFreeType.h>
|
||||
#include <ewol/resource/Manager.h>
|
||||
#include <ewol/resource/FontFreeType.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/renderer/openGL.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
#include <ewol/openGL/openGL.h>
|
||||
#include <ewol/context/Context.h>
|
||||
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ void ewol::resource::Manager::reLoadResources(void) {
|
||||
EWOL_INFO("------------- Resources -------------");
|
||||
}
|
||||
|
||||
void ewol::resource::Manager::update(ewol::resource::Resource* _object) {
|
||||
void ewol::resource::Manager::update(ewol::Resource* _object) {
|
||||
// chek if not added before
|
||||
for (size_t iii=0; iii<m_resourceListToUpdate.size(); iii++) {
|
||||
if (m_resourceListToUpdate[iii] != NULL) {
|
||||
@ -149,7 +149,7 @@ void ewol::resource::Manager::contextHasBeenDestroyed(void) {
|
||||
}
|
||||
|
||||
// internal generic keeper ...
|
||||
ewol::resource::Resource* ewol::resource::Manager::localKeep(const std::string& _filename) {
|
||||
ewol::Resource* ewol::resource::Manager::localKeep(const std::string& _filename) {
|
||||
EWOL_VERBOSE("KEEP (DEFAULT) : file : \"" << _filename << "\"");
|
||||
for (size_t iii=0; iii<m_resourceList.size(); iii++) {
|
||||
if (m_resourceList[iii] != NULL) {
|
||||
@ -164,7 +164,7 @@ ewol::resource::Resource* ewol::resource::Manager::localKeep(const std::string&
|
||||
}
|
||||
|
||||
// internal generic keeper ...
|
||||
void ewol::resource::Manager::localAdd(ewol::resource::Resource* _object) {
|
||||
void ewol::resource::Manager::localAdd(ewol::Resource* _object) {
|
||||
//Add ... find empty slot
|
||||
for (size_t iii=0; iii<m_resourceList.size(); iii++) {
|
||||
if (m_resourceList[iii] == NULL) {
|
||||
@ -176,7 +176,7 @@ void ewol::resource::Manager::localAdd(ewol::resource::Resource* _object) {
|
||||
m_resourceList.push_back(_object);
|
||||
}
|
||||
|
||||
bool ewol::resource::Manager::release(ewol::resource::Resource*& _object) {
|
||||
bool ewol::resource::Manager::release(ewol::Resource*& _object) {
|
||||
if (NULL == _object) {
|
||||
EWOL_ERROR("Try to remove a resource that have null pointer ...");
|
||||
return false;
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/resources/Program.h>
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/resource/Program.h>
|
||||
#include <ewol/resource/Manager.h>
|
||||
#include <etk/os/FSNode.h>
|
||||
#include <ewol/ewol.h>
|
||||
|
||||
@ -19,13 +19,13 @@
|
||||
#undef __class__
|
||||
#define __class__ "resource::Program"
|
||||
|
||||
ewol::resource::resource::Program::Program(const std::string& _filename) :
|
||||
ewol::resource::Resource(_filename),
|
||||
ewol::resource::Program::Program(const std::string& _filename) :
|
||||
ewol::Resource(_filename),
|
||||
m_exist(false),
|
||||
m_program(0),
|
||||
m_hasTexture(false),
|
||||
m_hasTexture1(false) {
|
||||
addObjectType("ewol::Program");
|
||||
addObjectType("ewol::resource::Program");
|
||||
m_resourceLevel = 1;
|
||||
EWOL_DEBUG("OGL : load PROGRAM '" << m_name << "'");
|
||||
// load data from file "all the time ..."
|
||||
@ -36,7 +36,7 @@ ewol::resource::resource::Program::Program(const std::string& _filename) :
|
||||
std::string tmpFilename = m_name;
|
||||
// remove extention ...
|
||||
tmpFilename.erase(tmpFilename.size()-4, 4);
|
||||
ewol::Shader* tmpShader = ewol::Shader::keep(tmpFilename+"vert");
|
||||
ewol::resource::Shader* tmpShader = ewol::resource::Shader::keep(tmpFilename+"vert");
|
||||
if (NULL == tmpShader) {
|
||||
EWOL_CRITICAL("Error while getting a specific shader filename : " << tmpFilename);
|
||||
return;
|
||||
@ -44,7 +44,7 @@ ewol::resource::resource::Program::Program(const std::string& _filename) :
|
||||
EWOL_DEBUG("Add shader on program : "<< tmpFilename << "vert");
|
||||
m_shaderList.push_back(tmpShader);
|
||||
}
|
||||
tmpShader = ewol::Shader::keep(tmpFilename+"frag");
|
||||
tmpShader = ewol::resource::Shader::keep(tmpFilename+"frag");
|
||||
if (NULL == tmpShader) {
|
||||
EWOL_CRITICAL("Error while getting a specific shader filename : " << tmpFilename);
|
||||
return;
|
||||
@ -80,7 +80,7 @@ ewol::resource::resource::Program::Program(const std::string& _filename) :
|
||||
}
|
||||
// get it with relative position :
|
||||
std::string tmpFilename = file.getRelativeFolder() + tmpData;
|
||||
ewol::Shader* tmpShader = ewol::Shader::keep(tmpFilename);
|
||||
ewol::resource::Shader* tmpShader = ewol::resource::Shader::keep(tmpFilename);
|
||||
if (NULL == tmpShader) {
|
||||
EWOL_CRITICAL("Error while getting a specific shader filename : " << tmpFilename);
|
||||
} else {
|
||||
@ -97,7 +97,7 @@ ewol::resource::resource::Program::Program(const std::string& _filename) :
|
||||
|
||||
ewol::resource::Program::~Program(void) {
|
||||
for (size_t iii=0; iii<m_shaderList.size(); iii++) {
|
||||
ewol::Shader::release(m_shaderList[iii]);
|
||||
ewol::resource::Shader::release(m_shaderList[iii]);
|
||||
m_shaderList[iii] = 0;
|
||||
}
|
||||
m_shaderList.clear();
|
||||
@ -781,7 +781,7 @@ ewol::resource::Program* ewol::resource::Program::keep(const std::string& _filen
|
||||
return object;
|
||||
}
|
||||
// need to crate a new one ...
|
||||
object = new ewol::Program(_filename);
|
||||
object = new ewol::resource::Program(_filename);
|
||||
if (NULL == object) {
|
||||
EWOL_ERROR("allocation error of a resource : " << _filename);
|
||||
return NULL;
|
||||
@ -795,7 +795,7 @@ void ewol::resource::Program::release(ewol::resource::Program*& _object) {
|
||||
if (NULL == _object) {
|
||||
return;
|
||||
}
|
||||
ewol::resource::Resource* object2 = static_cast<ewol::resource::Resource*>(_object);
|
||||
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
|
||||
getManager().release(object2);
|
||||
_object = NULL;
|
||||
}
|
@ -8,11 +8,10 @@
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/resources/Resource.h>
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/resource/Resource.h>
|
||||
#include <ewol/resource/Manager.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/renderer/openGL.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
#include <ewol/context/Context.h>
|
||||
|
||||
|
||||
void ewol::Resource::updateContext(void) {
|
||||
|
@ -9,14 +9,14 @@
|
||||
#include <etk/types.h>
|
||||
#include <etk/os/FSNode.h>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/resources/Shader.h>
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/resource/Shader.h>
|
||||
#include <ewol/resource/Manager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "resource::Shader"
|
||||
|
||||
ewol::resource::Shader::Shader(const std::string& _filename) :
|
||||
ewol::resource::Resource(_filename),
|
||||
ewol::Resource(_filename),
|
||||
m_exist(false),
|
||||
m_fileData(NULL),
|
||||
m_shader(0),
|
||||
@ -169,7 +169,7 @@ void ewol::resource::Shader::release(ewol::resource::Shader*& _object) {
|
||||
if (NULL == _object) {
|
||||
return;
|
||||
}
|
||||
ewol::resource::Resource* object2 = static_cast<ewol::resource::Resource*>(_object);
|
||||
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
|
||||
getManager().release(object2);
|
||||
_object = NULL;
|
||||
}
|
||||
|
@ -8,10 +8,9 @@
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/renderer/openGL.h>
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/resources/Texture.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
#include <ewol/openGL/openGL.h>
|
||||
#include <ewol/resource/Manager.h>
|
||||
#include <ewol/resource/Texture.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "resource::Texture"
|
||||
@ -35,15 +34,15 @@ static int32_t nextP2(int32_t _value) {
|
||||
|
||||
|
||||
ewol::resource::Texture::Texture(const std::string& _filename) :
|
||||
ewol::resource::Resource(_filename) {
|
||||
addObjectType("ewol::Texture");
|
||||
ewol::Resource(_filename) {
|
||||
addObjectType("ewol::compositing::Texture");
|
||||
m_loaded = false;
|
||||
m_texId = 0;
|
||||
m_endPointSize.setValue(1.0,1.0);
|
||||
}
|
||||
|
||||
ewol::resource::Texture::Texture(void) {
|
||||
addObjectType("ewol::Texture");
|
||||
addObjectType("ewol::compositing::Texture");
|
||||
m_loaded = false;
|
||||
m_texId = 0;
|
||||
m_endPointSize.setValue(1.0,1.0);
|
||||
@ -123,7 +122,7 @@ void ewol::resource::Texture::release(ewol::resource::Texture*& _object) {
|
||||
if (NULL == _object) {
|
||||
return;
|
||||
}
|
||||
ewol::Resource* object2 = static_cast<ewol::resource::Resource*>(_object);
|
||||
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
|
||||
getManager().release(object2);
|
||||
_object = NULL;
|
||||
}
|
||||
|
@ -10,12 +10,12 @@
|
||||
#include <etk/os/FSNode.h>
|
||||
#include <egami/egami.h>
|
||||
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
#include <ewol/resource/Manager.h>
|
||||
|
||||
#include <ewol/resources/font/FontBase.h>
|
||||
#include <ewol/resources/TexturedFont.h>
|
||||
#include <ewol/resources/FontFreeType.h>
|
||||
#include <ewol/resource/font/FontBase.h>
|
||||
#include <ewol/resource/TexturedFont.h>
|
||||
#include <ewol/resource/FontFreeType.h>
|
||||
#include <ewol/context/Context.h>
|
||||
|
||||
|
||||
etk::CCout& ewol::operator <<(etk::CCout& _os, enum ewol::font::mode _obj) {
|
||||
@ -44,7 +44,7 @@ etk::CCout& ewol::operator <<(etk::CCout& _os, enum ewol::font::mode _obj) {
|
||||
|
||||
ewol::resource::TexturedFont::TexturedFont(const std::string& _fontName) :
|
||||
ewol::resource::Texture(_fontName) {
|
||||
addObjectType("ewol::TexturedFont");
|
||||
addObjectType("ewol::compositing::TexturedFont");
|
||||
m_font[0] = NULL;
|
||||
m_font[1] = NULL;
|
||||
m_font[2] = NULL;
|
||||
@ -186,7 +186,7 @@ ewol::resource::TexturedFont::TexturedFont(const std::string& _fontName) :
|
||||
continue;
|
||||
}
|
||||
EWOL_INFO("Load FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" == > size=" << m_size);
|
||||
m_font[iiiFontId] = ewol::FontFreeType::keep(m_fileName[iiiFontId]);
|
||||
m_font[iiiFontId] = ewol::resource::FontFreeType::keep(m_fileName[iiiFontId]);
|
||||
if (m_font[iiiFontId] == NULL) {
|
||||
EWOL_DEBUG("error in loading FONT [" << iiiFontId << "] name : \"" << m_fileName[iiiFontId] << "\" == > size=" << m_size );
|
||||
}
|
||||
@ -219,7 +219,7 @@ ewol::resource::TexturedFont::TexturedFont(const std::string& _fontName) :
|
||||
|
||||
ewol::resource::TexturedFont::~TexturedFont(void) {
|
||||
for (int32_t iiiFontId=0; iiiFontId<4 ; iiiFontId++) {
|
||||
ewol::FontFreeType::release(m_font[iiiFontId]);
|
||||
ewol::resource::FontFreeType::release(m_font[iiiFontId]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ int32_t ewol::resource::TexturedFont::getIndex(char32_t _charcode, const enum ew
|
||||
return 0;
|
||||
}
|
||||
|
||||
ewol::resource::GlyphProperty* ewol::resource::TexturedFont::getGlyphPointer(const char32_t& _charcode, const enum ewol::font::mode _displayMode) {
|
||||
ewol::GlyphProperty* ewol::resource::TexturedFont::getGlyphPointer(const char32_t& _charcode, const enum ewol::font::mode _displayMode) {
|
||||
//EWOL_DEBUG("Get glyph property for mode: " << _displayMode << " == > wrapping index : " << m_modeWraping[_displayMode]);
|
||||
int32_t index = getIndex(_charcode, _displayMode);
|
||||
if( index < 0
|
||||
@ -359,7 +359,7 @@ void ewol::resource::TexturedFont::release(ewol::resource::TexturedFont*& _objec
|
||||
}
|
||||
std::string name = _object->getName();
|
||||
int32_t count = _object->getCounter() - 1;
|
||||
ewol::resource::Resource* object2 = static_cast<ewol::resource::Resource*>(_object);
|
||||
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
|
||||
if (getManager().release(object2) == true) {
|
||||
EWOL_DEBUG("REMOVE: TexturedFont : file : '" << name << "' count=" << count);
|
||||
//etk::displayBacktrace(false);
|
||||
|
@ -48,9 +48,6 @@ namespace ewol {
|
||||
TexturedFont(const std::string& _fontName);
|
||||
~TexturedFont(void);
|
||||
public:
|
||||
const char* getType(void) {
|
||||
return "ewol::TexturedFont";
|
||||
};
|
||||
/**
|
||||
* @brief get the display height of this font
|
||||
* @param[in] _displayMode Mode to display the currrent font
|
||||
|
@ -8,9 +8,8 @@
|
||||
|
||||
#include <etk/types.h>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/resources/ResourceManager.h>
|
||||
#include <ewol/resources/VirtualBufferObject.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
#include <ewol/resource/Manager.h>
|
||||
#include <ewol/resource/VirtualBufferObject.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "resource::VirtualBufferObject"
|
||||
@ -83,7 +82,7 @@ void ewol::resource::VirtualBufferObject::reload(void) {
|
||||
|
||||
void ewol::resource::VirtualBufferObject::flush(void) {
|
||||
// request to the manager to be call at the next update ...
|
||||
ewol::getContext().getResourcesManager().update(this);
|
||||
getManager().update(this);
|
||||
}
|
||||
|
||||
void ewol::resource::VirtualBufferObject::pushOnBuffer(int32_t _id, const vec3& _data) {
|
||||
@ -139,7 +138,7 @@ void ewol::resource::VirtualBufferObject::release(ewol::resource::VirtualBufferO
|
||||
if (NULL == _object) {
|
||||
return;
|
||||
}
|
||||
ewol::resource::Resource* object2 = static_cast<ewol::resource::Resource*>(_object);
|
||||
ewol::Resource* object2 = static_cast<ewol::Resource*>(_object);
|
||||
getManager().release(object2);
|
||||
_object = NULL;
|
||||
}
|
||||
|
@ -40,11 +40,6 @@ namespace ewol {
|
||||
*/
|
||||
virtual ~VirtualBufferObject(void);
|
||||
public:
|
||||
/**
|
||||
* @brief Generic function that get the resouces name of his type.
|
||||
* @return The define char of his name.
|
||||
*/
|
||||
const char* getType(void) { return "ewol::VirtualBufferObject"; };
|
||||
/**
|
||||
* @brief get the real openGL ID.
|
||||
* @return the Ogl id reference of this VBO.
|
||||
|
@ -38,7 +38,7 @@ static ewol::Widget* Create(void) {
|
||||
return new ewol::widget::Button();
|
||||
}
|
||||
|
||||
void ewol::widget::Button::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::Button::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&Create);
|
||||
}
|
||||
|
||||
@ -260,14 +260,14 @@ void ewol::widget::Button::setToggleMode(bool _togg) {
|
||||
}
|
||||
}
|
||||
|
||||
bool ewol::widget::Button::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::Button::onEventInput(const ewol::event::Input& _event) {
|
||||
// disable event in the lock access mode :
|
||||
if(ewol::widget::Button::lockAccess == m_lock) {
|
||||
return false;
|
||||
}
|
||||
bool previousHoverState = m_mouseHover;
|
||||
if( ewol::keyEvent::statusLeave == _event.getStatus()
|
||||
|| ewol::keyEvent::statusAbort == _event.getStatus()) {
|
||||
if( ewol::key::statusLeave == _event.getStatus()
|
||||
|| ewol::key::statusAbort == _event.getStatus()) {
|
||||
m_mouseHover = false;
|
||||
m_buttonPressed = false;
|
||||
} else {
|
||||
@ -287,19 +287,19 @@ bool ewol::widget::Button::onEventInput(const ewol::EventInput& _event) {
|
||||
//EWOL_DEBUG("Event on BT ... mouse position : " << m_mouseHover);
|
||||
if (true == m_mouseHover) {
|
||||
if (1 == _event.getId()) {
|
||||
if(ewol::keyEvent::statusDown == _event.getStatus()) {
|
||||
if(ewol::key::statusDown == _event.getStatus()) {
|
||||
//EWOL_DEBUG("Generate event : " << eventDown);
|
||||
generateEventId(eventDown);
|
||||
m_buttonPressed = true;
|
||||
markToRedraw();
|
||||
}
|
||||
if(ewol::keyEvent::statusUp == _event.getStatus()) {
|
||||
if(ewol::key::statusUp == _event.getStatus()) {
|
||||
//EWOL_DEBUG("Generate event : " << eventUp);
|
||||
generateEventId(eventUp);
|
||||
m_buttonPressed = false;
|
||||
markToRedraw();
|
||||
}
|
||||
if(ewol::keyEvent::statusSingle == _event.getStatus()) {
|
||||
if(ewol::key::statusSingle == _event.getStatus()) {
|
||||
if( ( m_value == true
|
||||
&& ewol::widget::Button::lockWhenPressed == m_lock)
|
||||
|| ( m_value == false
|
||||
@ -332,10 +332,10 @@ bool ewol::widget::Button::onEventInput(const ewol::EventInput& _event) {
|
||||
}
|
||||
|
||||
|
||||
bool ewol::widget::Button::onEventEntry(const ewol::EventEntry& _event) {
|
||||
bool ewol::widget::Button::onEventEntry(const ewol::event::Entry& _event) {
|
||||
//EWOL_DEBUG("BT PRESSED : \"" << UTF8_data << "\" size=" << strlen(UTF8_data));
|
||||
if( _event.getType() == ewol::keyEvent::keyboardChar
|
||||
&& _event.getStatus() == ewol::keyEvent::statusDown
|
||||
if( _event.getType() == ewol::key::keyboardChar
|
||||
&& _event.getStatus() == ewol::key::statusDown
|
||||
&& _event.getChar() == '\r') {
|
||||
generateEventId(eventEnter);
|
||||
return true;
|
||||
@ -367,7 +367,7 @@ void ewol::widget::Button::changeStatusIn(int32_t _newStatusId) {
|
||||
}
|
||||
|
||||
|
||||
void ewol::widget::Button::periodicCall(const ewol::EventTime& _event) {
|
||||
void ewol::widget::Button::periodicCall(const ewol::event::Time& _event) {
|
||||
if (false == m_shaper.periodicCall(_event) ) {
|
||||
periodicCallDisable();
|
||||
}
|
||||
@ -447,7 +447,7 @@ bool ewol::widget::Button::loadXML(exml::Element* _element) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ewol::widget::Button::onSetConfig(const ewol::EConfig& _conf) {
|
||||
bool ewol::widget::Button::onSetConfig(const ewol::object::Config& _conf) {
|
||||
if (true == ewol::Widget::onSetConfig(_conf)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <ewol/compositing/Text.h>
|
||||
#include <ewol/compositing/Image.h>
|
||||
#include <ewol/compositing/Shaper.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
|
||||
namespace ewol {
|
||||
@ -27,7 +27,7 @@ namespace ewol {
|
||||
*/
|
||||
class Button : public ewol::Widget {
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
// Event list of properties
|
||||
static const char* const eventPressed;
|
||||
static const char* const eventDown;
|
||||
@ -47,7 +47,7 @@ namespace ewol {
|
||||
lockAccess, //!< all event are trashed == > acctivity of the button is disable
|
||||
};
|
||||
private:
|
||||
ewol::Shaper m_shaper; //!< Compositing theme.
|
||||
ewol::compositing::Shaper m_shaper; //!< Compositing theme.
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
@ -155,20 +155,21 @@ namespace ewol {
|
||||
void CheckStatus(void);
|
||||
protected: // Derived function
|
||||
virtual void onDraw(void);
|
||||
virtual bool onSetConfig(const ewol::EConfig& _conf);
|
||||
virtual bool onSetConfig(const ewol::object::Config& _conf);
|
||||
virtual bool onGetConfig(const char* _config, std::string& _result) const;
|
||||
public: // Derived function
|
||||
virtual void calculateMinMaxSize(void);
|
||||
virtual void calculateSize(const vec2& _availlable);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual void systemDraw(const ewol::DrawProperty& _displayProp);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventEntry(const ewol::EventEntry& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
virtual bool onEventEntry(const ewol::event::Entry& _event);
|
||||
virtual bool loadXML(exml::Element* _node);
|
||||
virtual ewol::Widget* getWidgetNamed(const std::string& _widgetName);
|
||||
private: // derived function
|
||||
virtual void periodicCall(const ewol::EventTime& _event);
|
||||
virtual void periodicCall(const ewol::event::Time& _event);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <ewol/widget/ButtonColor.h>
|
||||
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/widget/meta/ColorChooser.h>
|
||||
#include <ewol/widget/Windows.h>
|
||||
#include <ewol/ewol.h>
|
||||
@ -34,7 +34,7 @@ static ewol::Widget* Create(void) {
|
||||
return new ewol::widget::ButtonColor();
|
||||
}
|
||||
|
||||
void ewol::widget::ButtonColor::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::ButtonColor::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&Create);
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ void ewol::widget::ButtonColor::onRegenerateDisplay(void) {
|
||||
}
|
||||
m_text.setPos(tmpTextOrigin);
|
||||
m_text.setColorBg(m_textColorFg);
|
||||
m_text.setTextAlignement(tmpTextOrigin.x(), tmpTextOrigin.x()+localSize.x(), ewol::Text::alignCenter);
|
||||
m_text.setTextAlignement(tmpTextOrigin.x(), tmpTextOrigin.x()+localSize.x(), ewol::compositing::Text::alignCenter);
|
||||
m_text.print(label);
|
||||
|
||||
|
||||
@ -143,9 +143,9 @@ void ewol::widget::ButtonColor::onRegenerateDisplay(void) {
|
||||
}
|
||||
|
||||
|
||||
bool ewol::widget::ButtonColor::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::ButtonColor::onEventInput(const ewol::event::Input& _event) {
|
||||
bool previousHoverState = m_mouseHover;
|
||||
if(ewol::keyEvent::statusLeave == _event.getStatus()) {
|
||||
if(ewol::key::statusLeave == _event.getStatus()) {
|
||||
m_mouseHover = false;
|
||||
m_buttonPressed = false;
|
||||
} else {
|
||||
@ -165,33 +165,33 @@ bool ewol::widget::ButtonColor::onEventInput(const ewol::EventInput& _event) {
|
||||
//EWOL_DEBUG("Event on BT ... mouse position : " << m_mouseHover);
|
||||
if (true == m_mouseHover) {
|
||||
if (1 == _event.getId()) {
|
||||
if(ewol::keyEvent::statusDown == _event.getStatus()) {
|
||||
if(ewol::key::statusDown == _event.getStatus()) {
|
||||
m_buttonPressed = true;
|
||||
markToRedraw();
|
||||
}
|
||||
if(ewol::keyEvent::statusUp == _event.getStatus()) {
|
||||
if(ewol::key::statusUp == _event.getStatus()) {
|
||||
m_buttonPressed = false;
|
||||
markToRedraw();
|
||||
}
|
||||
if(ewol::keyEvent::statusSingle == _event.getStatus()) {
|
||||
if(ewol::key::statusSingle == _event.getStatus()) {
|
||||
m_buttonPressed = false;
|
||||
m_mouseHover = false;
|
||||
// create a context menu :
|
||||
m_widgetContextMenu = new widget::ContextMenu();
|
||||
m_widgetContextMenu = new ewol::widget::ContextMenu();
|
||||
if (NULL == m_widgetContextMenu) {
|
||||
EWOL_ERROR("Allocation Error");
|
||||
return true;
|
||||
}
|
||||
vec2 tmpPos = m_origin + m_selectableAreaPos + m_selectableAreaSize;
|
||||
tmpPos.setX( tmpPos.x() - m_minSize.x()/2.0);
|
||||
m_widgetContextMenu->setPositionMark(widget::ContextMenu::markButtom, tmpPos );
|
||||
m_widgetContextMenu->setPositionMark(ewol::widget::ContextMenu::markButtom, tmpPos );
|
||||
|
||||
widget::ColorChooser * myColorChooser = new widget::ColorChooser();
|
||||
ewol::widget::ColorChooser * myColorChooser = new widget::ColorChooser();
|
||||
myColorChooser->setColor(m_textColorFg);
|
||||
// set it in the pop-up-system :
|
||||
m_widgetContextMenu->setSubWidget(myColorChooser);
|
||||
myColorChooser->registerOnEvent(this, ewolEventColorChooserChange, ewolEventColorChooserChange);
|
||||
ewol::Windows* currentWindows = getWindows();
|
||||
ewol::widget::Windows* currentWindows = getWindows();
|
||||
if (NULL == currentWindows) {
|
||||
EWOL_ERROR("Can not get the curent Windows...");
|
||||
delete(m_widgetContextMenu);
|
||||
@ -229,7 +229,7 @@ etk::Color<> ewol::widget::ButtonColor::getValue(void) {
|
||||
}
|
||||
|
||||
|
||||
void ewol::widget::ButtonColor::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
void ewol::widget::ButtonColor::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
EWOL_INFO("Receive MSG : " << _msg.getData());
|
||||
if (_msg.getMessage() == ewolEventColorChooserChange) {
|
||||
m_textColorFg = _msg.getData();
|
||||
@ -248,7 +248,7 @@ void ewol::widget::ButtonColor::changeStatusIn(int32_t _newStatusId) {
|
||||
|
||||
|
||||
|
||||
void ewol::widget::ButtonColor::periodicCall(const ewol::EventTime& _event) {
|
||||
void ewol::widget::ButtonColor::periodicCall(const ewol::event::Time& _event) {
|
||||
if (false == m_shaper.periodicCall(_event) ) {
|
||||
periodicCallDisable();
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <ewol/compositing/Text.h>
|
||||
#include <ewol/compositing/Shaper.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
extern const char * const ewolEventButtonColorChange;
|
||||
|
||||
@ -27,12 +27,12 @@ namespace ewol {
|
||||
*/
|
||||
class ButtonColor : public ewol::Widget {
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
private:
|
||||
ewol::Shaper m_shaper; //!< Compositing theme.
|
||||
ewol::Text m_text; //!< Compositing Test display.
|
||||
ewol::compositing::Shaper m_shaper; //!< Compositing theme.
|
||||
ewol::compositing::Text m_text; //!< Compositing Test display.
|
||||
etk::Color<> m_textColorFg; //!< Current color.
|
||||
widget::ContextMenu* m_widgetContextMenu; //!< Specific context menu.
|
||||
ewol::widget::ContextMenu* m_widgetContextMenu; //!< Specific context menu.
|
||||
bool m_mouseHover; //!< Flag to know where the mouse is (inside the displayed widget (if not fill)).
|
||||
bool m_buttonPressed; //!< Flag to know if the button is curently pressed.
|
||||
// hover area :
|
||||
@ -69,8 +69,8 @@ namespace ewol {
|
||||
public: // Derived function
|
||||
virtual void calculateMinMaxSize(void);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual void onReceiveMessage(const ewol::EMessage& _msg);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||
private:
|
||||
/**
|
||||
* @brief internal system to change the property of the current status
|
||||
@ -78,7 +78,7 @@ namespace ewol {
|
||||
*/
|
||||
void changeStatusIn(int32_t _newStatusId);
|
||||
// Derived function
|
||||
virtual void periodicCall(const ewol::EventTime& _event);
|
||||
virtual void periodicCall(const ewol::event::Time& _event);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <ewol/widget/CheckBox.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
|
||||
extern const char * const ewolEventCheckBoxClicked = "ewol CheckBox Clicked";
|
||||
@ -19,7 +19,7 @@ static ewol::Widget* Create(void) {
|
||||
return new ewol::widget::CheckBox();
|
||||
}
|
||||
|
||||
void ewol::widget::CheckBox::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::CheckBox::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&Create);
|
||||
}
|
||||
|
||||
@ -99,10 +99,10 @@ void ewol::widget::CheckBox::onRegenerateDisplay(void) {
|
||||
}
|
||||
}
|
||||
|
||||
bool ewol::widget::CheckBox::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::CheckBox::onEventInput(const ewol::event::Input& _event) {
|
||||
//EWOL_DEBUG("Event on checkbox ...");
|
||||
if (1 == _event.getId()) {
|
||||
if (ewol::keyEvent::statusSingle == _event.getStatus()) {
|
||||
if (ewol::key::statusSingle == _event.getStatus()) {
|
||||
if(true == m_value) {
|
||||
m_value = false;
|
||||
generateEventId(ewolEventCheckBoxClicked, "false");
|
||||
@ -118,10 +118,10 @@ bool ewol::widget::CheckBox::onEventInput(const ewol::EventInput& _event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ewol::widget::CheckBox::onEventEntry(const ewol::EventEntry& _event) {
|
||||
bool ewol::widget::CheckBox::onEventEntry(const ewol::event::Entry& _event) {
|
||||
//EWOL_DEBUG("BT PRESSED : \"" << UTF8_data << "\" size=" << strlen(UTF8_data));
|
||||
if( _event.getType() == ewol::keyEvent::keyboardChar
|
||||
&& _event.getStatus() == ewol::keyEvent::statusDown
|
||||
if( _event.getType() == ewol::key::keyboardChar
|
||||
&& _event.getStatus() == ewol::key::statusDown
|
||||
&& ( _event.getChar() == '\r'
|
||||
|| _event.getChar() == ' ')
|
||||
) {
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <ewol/compositing/Text.h>
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
extern const char* const ewolEventCheckBoxClicked;
|
||||
|
||||
@ -25,7 +25,7 @@ namespace ewol {
|
||||
*/
|
||||
class CheckBox : public ewol::Widget {
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
public:
|
||||
CheckBox(const std::string& newLabel = "No Label");
|
||||
virtual ~CheckBox(void);
|
||||
@ -33,8 +33,8 @@ namespace ewol {
|
||||
void setValue(bool val);
|
||||
bool getValue(void);
|
||||
private:
|
||||
ewol::Text m_oObjectText;
|
||||
ewol::Drawing m_oObjectDecoration;
|
||||
ewol::compositing::Text m_oObjectText;
|
||||
ewol::compositing::Drawing m_oObjectDecoration;
|
||||
std::string m_label;
|
||||
bool m_value;
|
||||
etk::Color<> m_textColorFg; //!< Text color
|
||||
@ -44,8 +44,8 @@ namespace ewol {
|
||||
public: // Derived function
|
||||
virtual void calculateMinMaxSize(void);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventEntry(const ewol::EventEntry& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
virtual bool onEventEntry(const ewol::event::Entry& _event);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <ewol/widget/ColorBar.h>
|
||||
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
#include <etk/Color.h>
|
||||
|
||||
@ -165,14 +165,14 @@ void ewol::widget::ColorBar::onRegenerateDisplay(void) {
|
||||
}
|
||||
|
||||
|
||||
bool ewol::widget::ColorBar::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::ColorBar::onEventInput(const ewol::event::Input& _event) {
|
||||
vec2 relativePos = relativePosition(_event.getPos());
|
||||
//EWOL_DEBUG("Event on BT ...");
|
||||
if (1 == _event.getId()) {
|
||||
relativePos.setValue( etk_max(etk_min(relativePos.x(), m_size.x()),0),
|
||||
etk_max(etk_min(relativePos.y(), m_size.y()),0));
|
||||
if( ewol::keyEvent::statusSingle == _event.getStatus()
|
||||
|| ewol::keyEvent::statusMove == _event.getStatus()) {
|
||||
if( ewol::key::statusSingle == _event.getStatus()
|
||||
|| ewol::key::statusMove == _event.getStatus()) {
|
||||
// nothing to do ...
|
||||
m_currentUserPos.setValue( relativePos.x()/m_size.x(),
|
||||
relativePos.y()/m_size.y() );
|
||||
|
@ -29,7 +29,7 @@ namespace ewol {
|
||||
etk::Color<> getCurrentColor(void);
|
||||
void setCurrentColor(etk::Color<> _newOne);
|
||||
private:
|
||||
ewol::Drawing m_draw; //!< Compositing drawing element
|
||||
ewol::compositing::Drawing m_draw; //!< Compositing drawing element
|
||||
etk::Color<> m_currentColor;
|
||||
vec2 m_currentUserPos;
|
||||
protected: // Derived function
|
||||
@ -37,7 +37,7 @@ namespace ewol {
|
||||
public: // Derived function
|
||||
virtual void calculateMinMaxSize(void);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/widget/Composer.h>
|
||||
#include <etk/os/FSNode.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "ewol::widget::Composer"
|
||||
@ -58,7 +58,7 @@ bool ewol::widget::Composer::loadFromFile(const std::string& _fileName) {
|
||||
}
|
||||
}
|
||||
// call upper class to parse his elements ...
|
||||
widget::Container::loadXML(root);
|
||||
ewol::widget::Container::loadXML(root);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -83,7 +83,7 @@ bool ewol::widget::Composer::loadFromString(const std::string& _composerXmlStrin
|
||||
}
|
||||
}
|
||||
// call upper class to parse his elements ...
|
||||
widget::Container::loadXML(root);
|
||||
ewol::widget::Container::loadXML(root);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -96,7 +96,7 @@ void ewol::widget::Composer::registerOnEventNameWidget(const std::string& _subWi
|
||||
registerOnEventNameWidget(this, _subWidgetName, _eventId, _eventIdgenerated, _overloadData);
|
||||
}
|
||||
|
||||
void ewol::widget::Composer::registerOnEventNameWidget(ewol::EObject * _destinationObject,
|
||||
void ewol::widget::Composer::registerOnEventNameWidget(ewol::Object * _destinationObject,
|
||||
const std::string& _subWidgetName,
|
||||
const char * _eventId,
|
||||
const char * _eventIdgenerated,
|
||||
|
@ -19,7 +19,7 @@ namespace ewol {
|
||||
* @ingroup ewolWidgetGroup
|
||||
* @brief the composer widget is a widget that create a link on a string.file to parse the data and generate some widget tree
|
||||
*/
|
||||
class Composer : public widget::Container {
|
||||
class Composer : public ewol::widget::Container {
|
||||
public:
|
||||
enum composerMode {
|
||||
None,
|
||||
@ -76,7 +76,7 @@ namespace ewol {
|
||||
* @param[in] _overloadData When the user prever to receive a data specificly for this event ...
|
||||
* @note : To used when NOT herited from this object.
|
||||
*/
|
||||
void registerOnEventNameWidget(ewol::EObject * _destinationObject,
|
||||
void registerOnEventNameWidget(ewol::Object * _destinationObject,
|
||||
const std::string& _subWidgetName,
|
||||
const char * _eventId,
|
||||
const char * _eventIdgenerated = NULL,
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/widget/Container.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
@ -77,7 +77,7 @@ ewol::Widget* ewol::widget::Container::getWidgetNamed(const std::string& _widget
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ewol::widget::Container::onObjectRemove(ewol::EObject* _removeObject) {
|
||||
void ewol::widget::Container::onObjectRemove(ewol::Object* _removeObject) {
|
||||
if (m_subWidget == _removeObject) {
|
||||
m_subWidget=NULL;
|
||||
markToRedraw();
|
||||
|
@ -54,7 +54,7 @@ namespace ewol {
|
||||
public: // Derived function
|
||||
virtual void systemDraw(const ewol::DrawProperty& _displayProp);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual void onObjectRemove(ewol::EObject* _removeObject);
|
||||
virtual void onObjectRemove(ewol::Object* _removeObject);
|
||||
virtual void calculateSize(const vec2& _availlable);
|
||||
virtual void calculateMinMaxSize(void);
|
||||
virtual ewol::Widget* getWidgetAtPos(const vec2& _pos);
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/widget/ContainerN.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "ContainerN"
|
||||
@ -170,7 +170,7 @@ ewol::Widget* ewol::widget::ContainerN::getWidgetNamed(const std::string& _widge
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ewol::widget::ContainerN::onObjectRemove(ewol::EObject* _removeObject) {
|
||||
void ewol::widget::ContainerN::onObjectRemove(ewol::Object* _removeObject) {
|
||||
// First step call parrent :
|
||||
ewol::Widget::onObjectRemove(_removeObject);
|
||||
// second step find if in all the elements ...
|
||||
|
@ -85,7 +85,7 @@ namespace ewol {
|
||||
public:// Derived function
|
||||
virtual void systemDraw(const ewol::DrawProperty& _displayProp);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual void onObjectRemove(ewol::EObject* _removeObject);
|
||||
virtual void onObjectRemove(ewol::Object* _removeObject);
|
||||
virtual void calculateSize(const vec2& _availlable);
|
||||
virtual void calculateMinMaxSize(void);
|
||||
virtual ewol::Widget* getWidgetAtPos(const vec2& _pos);
|
||||
|
@ -7,10 +7,10 @@
|
||||
*/
|
||||
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/widget/ContextMenu.h>
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "ContextMenu"
|
||||
@ -24,7 +24,7 @@ static ewol::Widget* Create(void) {
|
||||
return new ewol::widget::ContextMenu();
|
||||
}
|
||||
|
||||
void ewol::widget::ContextMenu::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::ContextMenu::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&Create);
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ void ewol::widget::ContextMenu::calculateSize(const vec2& _availlable) {
|
||||
|
||||
void ewol::widget::ContextMenu::calculateMinMaxSize(void) {
|
||||
// call main class to calculate the min size...
|
||||
widget::Container::calculateMinMaxSize();
|
||||
ewol::widget::Container::calculateMinMaxSize();
|
||||
// add padding of the display
|
||||
m_minSize += m_shaper.getPadding();
|
||||
//EWOL_DEBUG("CalculateMinSize=>>" << m_minSize);
|
||||
@ -148,7 +148,7 @@ void ewol::widget::ContextMenu::onDraw(void) {
|
||||
|
||||
void ewol::widget::ContextMenu::onRegenerateDisplay(void) {
|
||||
// call upper class :
|
||||
widget::Container::onRegenerateDisplay();
|
||||
ewol::widget::Container::onRegenerateDisplay();
|
||||
if (needRedraw() == false) {
|
||||
return;
|
||||
}
|
||||
@ -214,17 +214,17 @@ void ewol::widget::ContextMenu::onRegenerateDisplay(void) {
|
||||
m_shaper.setInsideSize(vec2ClipInt32(shaperSize-padding*2.0f));
|
||||
}
|
||||
|
||||
bool ewol::widget::ContextMenu::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::ContextMenu::onEventInput(const ewol::event::Input& _event) {
|
||||
if (_event.getId() > 0) {
|
||||
if (NULL != widget::Container::getWidgetAtPos(_event.getPos())) {
|
||||
if (NULL != ewol::widget::Container::getWidgetAtPos(_event.getPos())) {
|
||||
return false;
|
||||
}
|
||||
if( _event.getStatus() == ewol::keyEvent::statusDown
|
||||
|| _event.getStatus() == ewol::keyEvent::statusMove
|
||||
|| _event.getStatus() == ewol::keyEvent::statusSingle
|
||||
|| _event.getStatus() == ewol::keyEvent::statusUp
|
||||
|| _event.getStatus() == ewol::keyEvent::statusEnter
|
||||
|| _event.getStatus() == ewol::keyEvent::statusLeave ) {
|
||||
if( _event.getStatus() == ewol::key::statusDown
|
||||
|| _event.getStatus() == ewol::key::statusMove
|
||||
|| _event.getStatus() == ewol::key::statusSingle
|
||||
|| _event.getStatus() == ewol::key::statusUp
|
||||
|| _event.getStatus() == ewol::key::statusEnter
|
||||
|| _event.getStatus() == ewol::key::statusLeave ) {
|
||||
// Auto-remove ...
|
||||
autoDestroy();
|
||||
return true;
|
||||
@ -242,7 +242,7 @@ void ewol::widget::ContextMenu::setPositionMark(enum markPosition _position, vec
|
||||
}
|
||||
|
||||
ewol::Widget* ewol::widget::ContextMenu::getWidgetAtPos(const vec2& _pos) {
|
||||
ewol::Widget* val = widget::Container::getWidgetAtPos(_pos);
|
||||
ewol::Widget* val = ewol::widget::Container::getWidgetAtPos(_pos);
|
||||
if (NULL != val) {
|
||||
return val;
|
||||
}
|
||||
@ -250,8 +250,8 @@ ewol::Widget* ewol::widget::ContextMenu::getWidgetAtPos(const vec2& _pos) {
|
||||
}
|
||||
|
||||
|
||||
bool ewol::widget::ContextMenu::onSetConfig(const ewol::EConfig& _conf) {
|
||||
if (true == widget::Container::onSetConfig(_conf)) {
|
||||
bool ewol::widget::ContextMenu::onSetConfig(const ewol::object::Config& _conf) {
|
||||
if (true == ewol::widget::Container::onSetConfig(_conf)) {
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == configArrowPosition) {
|
||||
@ -280,7 +280,7 @@ bool ewol::widget::ContextMenu::onSetConfig(const ewol::EConfig& _conf) {
|
||||
}
|
||||
|
||||
bool ewol::widget::ContextMenu::onGetConfig(const char* _config, std::string& _result) const {
|
||||
if (true == widget::Container::onGetConfig(_config, _result)) {
|
||||
if (true == ewol::widget::Container::onGetConfig(_config, _result)) {
|
||||
return true;
|
||||
}
|
||||
if (_config == configArrowPosition) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <ewol/widget/Container.h>
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/compositing/Shaper.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace widget {
|
||||
@ -32,7 +32,7 @@ namespace ewol {
|
||||
markNone
|
||||
};
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
// Config list of properties
|
||||
static const char* const configArrowPosition;
|
||||
static const char* const configArrowMode;
|
||||
@ -41,7 +41,7 @@ namespace ewol {
|
||||
ContextMenu(const std::string& _shaperName="THEME:GUI:widgetContextMenu.conf");
|
||||
virtual ~ContextMenu(void);
|
||||
private:
|
||||
ewol::Shaper m_shaper; //!< Compositing theme.
|
||||
ewol::compositing::Shaper m_shaper; //!< Compositing theme.
|
||||
public:
|
||||
/**
|
||||
* @brief set the shaper name (use the contructer one this permit to not noad unused shaper)
|
||||
@ -50,7 +50,7 @@ namespace ewol {
|
||||
void setShaperName(const std::string& _shaperName);
|
||||
private:
|
||||
// TODO : Rework the displayer ....
|
||||
ewol::Drawing m_compositing;
|
||||
ewol::compositing::Drawing m_compositing;
|
||||
etk::Color<> m_colorBackGroung;
|
||||
etk::Color<> m_colorBorder;
|
||||
|
||||
@ -62,11 +62,11 @@ namespace ewol {
|
||||
void setPositionMark(enum markPosition position, vec2 arrowPos);
|
||||
protected: // Derived function
|
||||
virtual void onDraw(void);
|
||||
virtual bool onSetConfig(const ewol::EConfig& _conf);
|
||||
virtual bool onSetConfig(const ewol::object::Config& _conf);
|
||||
virtual bool onGetConfig(const char* _config, std::string& _result) const;
|
||||
public: // Derived function
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
virtual void calculateSize(const vec2& availlable);
|
||||
virtual void calculateMinMaxSize(void);
|
||||
virtual ewol::Widget* getWidgetAtPos(const vec2& pos);
|
||||
|
@ -8,9 +8,9 @@
|
||||
|
||||
#include <etk/unicode.h>
|
||||
#include <ewol/widget/Entry.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
#include <ewol/context/Context.h>
|
||||
|
||||
|
||||
const char * const ewolEventEntryCut = "ewol-widget-entry-event-internal-cut";
|
||||
@ -32,7 +32,7 @@ static ewol::Widget* create(void) {
|
||||
return new ewol::widget::Entry();
|
||||
}
|
||||
|
||||
void ewol::widget::Entry::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::Entry::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&create);
|
||||
}
|
||||
|
||||
@ -242,7 +242,7 @@ void ewol::widget::Entry::removeSelected(void) {
|
||||
}
|
||||
|
||||
|
||||
void ewol::widget::Entry::copySelectionToClipBoard(enum ewol::clipBoard::clipboardListe _clipboardID) {
|
||||
void ewol::widget::Entry::copySelectionToClipBoard(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||
if (m_displayCursorPosSelection == m_displayCursorPos) {
|
||||
// nothing to cut ...
|
||||
return;
|
||||
@ -255,19 +255,19 @@ void ewol::widget::Entry::copySelectionToClipBoard(enum ewol::clipBoard::clipboa
|
||||
}
|
||||
// Copy
|
||||
std::string tmpData = std::string(m_data, pos1, pos2);
|
||||
ewol::clipBoard::set(_clipboardID, tmpData);
|
||||
ewol::context::clipBoard::set(_clipboardID, tmpData);
|
||||
}
|
||||
|
||||
|
||||
bool ewol::widget::Entry::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::Entry::onEventInput(const ewol::event::Input& _event) {
|
||||
//EWOL_DEBUG("Event on Entry ... type=" << (int32_t)type << " id=" << IdInput);
|
||||
if (1 == _event.getId()) {
|
||||
if (ewol::keyEvent::statusSingle == _event.getStatus()) {
|
||||
if (ewol::key::statusSingle == _event.getStatus()) {
|
||||
keepFocus();
|
||||
generateEventId(eventClick);
|
||||
//nothing to do ...
|
||||
return true;
|
||||
} else if (ewol::keyEvent::statusDouble == _event.getStatus()) {
|
||||
} else if (ewol::key::statusDouble == _event.getStatus()) {
|
||||
keepFocus();
|
||||
// select word
|
||||
m_displayCursorPosSelection = m_displayCursorPos-1;
|
||||
@ -310,51 +310,51 @@ bool ewol::widget::Entry::onEventInput(const ewol::EventInput& _event) {
|
||||
}
|
||||
}
|
||||
// Copy to clipboard Middle ...
|
||||
copySelectionToClipBoard(ewol::clipBoard::clipboardSelection);
|
||||
copySelectionToClipBoard(ewol::context::clipBoard::clipboardSelection);
|
||||
markToRedraw();
|
||||
} else if (ewol::keyEvent::statusTriple == _event.getStatus()) {
|
||||
} else if (ewol::key::statusTriple == _event.getStatus()) {
|
||||
keepFocus();
|
||||
m_displayCursorPosSelection = 0;
|
||||
m_displayCursorPos = m_data.size();
|
||||
} else if (ewol::keyEvent::statusDown == _event.getStatus()) {
|
||||
} else if (ewol::key::statusDown == _event.getStatus()) {
|
||||
keepFocus();
|
||||
updateCursorPosition(_event.getPos());
|
||||
markToRedraw();
|
||||
} else if (ewol::keyEvent::statusMove == _event.getStatus()) {
|
||||
} else if (ewol::key::statusMove == _event.getStatus()) {
|
||||
keepFocus();
|
||||
updateCursorPosition(_event.getPos(), true);
|
||||
markToRedraw();
|
||||
} else if (ewol::keyEvent::statusUp == _event.getStatus()) {
|
||||
} else if (ewol::key::statusUp == _event.getStatus()) {
|
||||
keepFocus();
|
||||
updateCursorPosition(_event.getPos(), true);
|
||||
// Copy to clipboard Middle ...
|
||||
copySelectionToClipBoard(ewol::clipBoard::clipboardSelection);
|
||||
copySelectionToClipBoard(ewol::context::clipBoard::clipboardSelection);
|
||||
markToRedraw();
|
||||
}
|
||||
}
|
||||
else if( ewol::keyEvent::typeMouse == _event.getType()
|
||||
else if( ewol::key::typeMouse == _event.getType()
|
||||
&& 2 == _event.getId()) {
|
||||
if( _event.getStatus() == ewol::keyEvent::statusDown
|
||||
|| _event.getStatus() == ewol::keyEvent::statusMove
|
||||
|| _event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
if( _event.getStatus() == ewol::key::statusDown
|
||||
|| _event.getStatus() == ewol::key::statusMove
|
||||
|| _event.getStatus() == ewol::key::statusUp) {
|
||||
keepFocus();
|
||||
// updatethe cursor position :
|
||||
updateCursorPosition(_event.getPos());
|
||||
}
|
||||
// Paste current selection only when up button
|
||||
if (_event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
if (_event.getStatus() == ewol::key::statusUp) {
|
||||
keepFocus();
|
||||
// middle button => past data...
|
||||
ewol::clipBoard::request(ewol::clipBoard::clipboardSelection);
|
||||
ewol::context::clipBoard::request(ewol::context::clipBoard::clipboardSelection);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool ewol::widget::Entry::onEventEntry(const ewol::EventEntry& _event) {
|
||||
if (_event.getType() == ewol::keyEvent::keyboardChar) {
|
||||
if(_event.getStatus() == ewol::keyEvent::statusDown) {
|
||||
bool ewol::widget::Entry::onEventEntry(const ewol::event::Entry& _event) {
|
||||
if (_event.getType() == ewol::key::keyboardChar) {
|
||||
if(_event.getStatus() == ewol::key::statusDown) {
|
||||
//EWOL_DEBUG("Entry input data ... : \"" << unicodeData << "\" " );
|
||||
//return GenEventInputExternal(eventEnter, -1, -1);
|
||||
// remove curent selected data ...
|
||||
@ -397,19 +397,19 @@ bool ewol::widget::Entry::onEventEntry(const ewol::EventEntry& _event) {
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
if(_event.getStatus() == ewol::keyEvent::statusDown) {
|
||||
if(_event.getStatus() == ewol::key::statusDown) {
|
||||
switch (_event.getType())
|
||||
{
|
||||
case ewol::keyEvent::keyboardLeft:
|
||||
case ewol::key::keyboardLeft:
|
||||
m_displayCursorPos--;
|
||||
break;
|
||||
case ewol::keyEvent::keyboardRight:
|
||||
case ewol::key::keyboardRight:
|
||||
m_displayCursorPos++;
|
||||
break;
|
||||
case ewol::keyEvent::keyboardStart:
|
||||
case ewol::key::keyboardStart:
|
||||
m_displayCursorPos = 0;
|
||||
break;
|
||||
case ewol::keyEvent::keyboardEnd:
|
||||
case ewol::key::keyboardEnd:
|
||||
m_displayCursorPos = m_data.size();
|
||||
break;
|
||||
default:
|
||||
@ -442,7 +442,7 @@ void ewol::widget::Entry::setInternalValue(const std::string& _newData) {
|
||||
m_data = _newData;
|
||||
}
|
||||
|
||||
void ewol::widget::Entry::onEventClipboard(enum ewol::clipBoard::clipboardListe _clipboardID) {
|
||||
void ewol::widget::Entry::onEventClipboard(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||
// remove curent selected data ...
|
||||
removeSelected();
|
||||
// get current selection / Copy :
|
||||
@ -466,7 +466,7 @@ void ewol::widget::Entry::onEventClipboard(enum ewol::clipBoard::clipboardListe
|
||||
}
|
||||
|
||||
|
||||
void ewol::widget::Entry::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
void ewol::widget::Entry::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
ewol::Widget::onReceiveMessage(_msg);
|
||||
if(_msg.getMessage() == ewolEventEntryClean) {
|
||||
m_data = "";
|
||||
@ -475,13 +475,13 @@ void ewol::widget::Entry::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
m_displayCursorPosSelection = m_displayCursorPos;
|
||||
markToRedraw();
|
||||
} else if(_msg.getMessage() == ewolEventEntryCut) {
|
||||
copySelectionToClipBoard(ewol::clipBoard::clipboardStd);
|
||||
copySelectionToClipBoard(ewol::context::clipBoard::clipboardStd);
|
||||
removeSelected();
|
||||
generateEventId(eventModify, m_data);
|
||||
} else if(_msg.getMessage() == ewolEventEntryCopy) {
|
||||
copySelectionToClipBoard(ewol::clipBoard::clipboardStd);
|
||||
copySelectionToClipBoard(ewol::context::clipBoard::clipboardStd);
|
||||
} else if(_msg.getMessage() == ewolEventEntryPaste) {
|
||||
ewol::clipBoard::request(ewol::clipBoard::clipboardStd);
|
||||
ewol::context::clipBoard::request(ewol::context::clipBoard::clipboardStd);
|
||||
} else if(_msg.getMessage() == ewolEventEntrySelect) {
|
||||
if(_msg.getData() == "ALL") {
|
||||
m_displayCursorPosSelection = 0;
|
||||
@ -553,7 +553,7 @@ void ewol::widget::Entry::changeStatusIn(int32_t _newStatusId) {
|
||||
}
|
||||
}
|
||||
|
||||
void ewol::widget::Entry::periodicCall(const ewol::EventTime& _event) {
|
||||
void ewol::widget::Entry::periodicCall(const ewol::event::Time& _event) {
|
||||
if (false == m_shaper.periodicCall(_event) ) {
|
||||
periodicCallDisable();
|
||||
}
|
||||
@ -585,7 +585,7 @@ void ewol::widget::Entry::setEmptyText(const std::string& _text) {
|
||||
markToRedraw();
|
||||
}
|
||||
|
||||
bool ewol::widget::Entry::onSetConfig(const ewol::EConfig& _conf) {
|
||||
bool ewol::widget::Entry::onSetConfig(const ewol::object::Config& _conf) {
|
||||
if (true == ewol::Widget::onSetConfig(_conf)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <ewol/compositing/Shaper.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <etk/Color.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace widget {
|
||||
@ -44,10 +44,10 @@ namespace ewol {
|
||||
static const char* const configColorBg;
|
||||
static const char* const configEmptyMessage;
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
private:
|
||||
ewol::Shaper m_shaper;
|
||||
ewol::Text m_oObjectText; //!< text display m_text
|
||||
ewol::compositing::Shaper m_shaper;
|
||||
ewol::compositing::Text m_oObjectText; //!< text display m_text
|
||||
public:
|
||||
/**
|
||||
* @brief Contuctor
|
||||
@ -139,7 +139,7 @@ namespace ewol {
|
||||
* @brief Copy the selected data on the specify clipboard
|
||||
* @param[in] _clipboardID Selected clipboard
|
||||
*/
|
||||
virtual void copySelectionToClipBoard(enum ewol::clipBoard::clipboardListe _clipboardID);
|
||||
virtual void copySelectionToClipBoard(enum ewol::context::clipBoard::clipboardListe _clipboardID);
|
||||
/**
|
||||
* @brief remove the selected area
|
||||
* @note This request a regeneration of the display
|
||||
@ -195,18 +195,18 @@ namespace ewol {
|
||||
};
|
||||
public: // Derived function
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventEntry(const ewol::EventEntry& _event);
|
||||
virtual void onReceiveMessage(const ewol::EMessage& _msg);
|
||||
virtual void onEventClipboard(enum ewol::clipBoard::clipboardListe _clipboardID);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
virtual bool onEventEntry(const ewol::event::Entry& _event);
|
||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||
virtual void onEventClipboard(enum ewol::context::clipBoard::clipboardListe _clipboardID);
|
||||
virtual void calculateMinMaxSize(void);
|
||||
protected: // Derived function
|
||||
virtual void onDraw(void);
|
||||
virtual void onGetFocus(void);
|
||||
virtual void onLostFocus(void);
|
||||
virtual void changeStatusIn(int32_t _newStatusId);
|
||||
virtual void periodicCall(const ewol::EventTime& _event);
|
||||
virtual bool onSetConfig(const ewol::EConfig& _conf);
|
||||
virtual void periodicCall(const ewol::event::Time& _event);
|
||||
virtual bool onSetConfig(const ewol::object::Config& _conf);
|
||||
virtual bool onGetConfig(const char* _config, std::string& _result) const;
|
||||
};
|
||||
};
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/widget/Gird.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
@ -19,7 +19,7 @@ static ewol::Widget* create(void) {
|
||||
return new ewol::widget::Gird();
|
||||
}
|
||||
|
||||
void ewol::widget::Gird::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::Gird::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&create);
|
||||
}
|
||||
|
||||
@ -382,7 +382,7 @@ ewol::Widget * ewol::widget::Gird::getWidgetAtPos(const vec2& _pos) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ewol::widget::Gird::onObjectRemove(ewol::EObject * _removeObject) {
|
||||
void ewol::widget::Gird::onObjectRemove(ewol::Object * _removeObject) {
|
||||
// First step call parrent :
|
||||
ewol::Widget::onObjectRemove(_removeObject);
|
||||
// second step find if in all the elements ...
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <vector>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace widget {
|
||||
@ -22,7 +22,7 @@ namespace ewol {
|
||||
*/
|
||||
class Gird :public ewol::Widget {
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
private:
|
||||
class GirdProperties {
|
||||
public:
|
||||
@ -137,7 +137,7 @@ namespace ewol {
|
||||
virtual void systemDraw(const ewol::DrawProperty& _displayProp);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual ewol::Widget* getWidgetAtPos(const vec2& pos);
|
||||
virtual void onObjectRemove(ewol::EObject* _removeObject);
|
||||
virtual void onObjectRemove(ewol::Object* _removeObject);
|
||||
virtual void calculateSize(const vec2& _availlable);
|
||||
virtual void calculateMinMaxSize(void);
|
||||
};
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <ewol/widget/Image.h>
|
||||
#include <ewol/compositing/Image.h>
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/ewol.h>
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ static ewol::Widget* create(void) {
|
||||
return new ewol::widget::Image();
|
||||
}
|
||||
|
||||
void ewol::widget::Image::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::Image::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&create);
|
||||
}
|
||||
|
||||
@ -170,10 +170,10 @@ void ewol::widget::Image::calculateMinMaxSize(void) {
|
||||
}
|
||||
|
||||
|
||||
bool ewol::widget::Image::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::Image::onEventInput(const ewol::event::Input& _event) {
|
||||
//EWOL_DEBUG("Event on BT ...");
|
||||
if (1 == _event.getId()) {
|
||||
if(ewol::keyEvent::statusSingle == _event.getStatus()) {
|
||||
if(ewol::key::statusSingle == _event.getStatus()) {
|
||||
generateEventId(eventPressed);
|
||||
return true;
|
||||
}
|
||||
@ -220,7 +220,7 @@ bool ewol::widget::Image::loadXML(exml::Element* _node) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ewol::widget::Image::onSetConfig(const ewol::EConfig& _conf) {
|
||||
bool ewol::widget::Image::onSetConfig(const ewol::object::Config& _conf) {
|
||||
if (true == ewol::Widget::onSetConfig(_conf)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -36,9 +36,9 @@ namespace ewol {
|
||||
/**
|
||||
* @brief Main call of recording the widget on the List of "widget named creator"
|
||||
*/
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
protected:
|
||||
ewol::Image m_compositing; //!< compositing element of the image.
|
||||
ewol::compositing::Image m_compositing; //!< compositing element of the image.
|
||||
public:
|
||||
/**
|
||||
* @brief
|
||||
@ -117,12 +117,12 @@ namespace ewol {
|
||||
};
|
||||
protected: // Derived function
|
||||
virtual void onDraw(void);
|
||||
virtual bool onSetConfig(const ewol::EConfig& _conf);
|
||||
virtual bool onSetConfig(const ewol::object::Config& _conf);
|
||||
virtual bool onGetConfig(const char* _config, std::string& _result) const;
|
||||
public: // Derived function
|
||||
virtual void calculateMinMaxSize(void);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
virtual bool loadXML(exml::Element* _node);
|
||||
};
|
||||
};
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <math.h>
|
||||
|
||||
#include <ewol/compositing/Image.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
extern const char * const ewolEventJoystickEnable = "ewol-joystick-enable";
|
||||
extern const char * const ewolEventJoystickDisable = "ewol-joystick-disable";
|
||||
@ -114,11 +114,11 @@ Sine Function: sin(teta) = Opposite / Hypotenuse
|
||||
Cosine Function: cos(teta) = Adjacent / Hypotenuse
|
||||
Tangent Function: tan(teta) = Opposite / Adjacent
|
||||
*/
|
||||
bool ewol::widget::Joystick::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::Joystick::onEventInput(const ewol::event::Input& _event) {
|
||||
/*
|
||||
if (1 == IdInput) {
|
||||
if( ewol::keyEvent::statusDown == typeEvent
|
||||
|| ewol::keyEvent::statusMove == typeEvent) {
|
||||
if( ewol::key::statusDown == typeEvent
|
||||
|| ewol::key::statusMove == typeEvent) {
|
||||
// get local relative position
|
||||
vec2 relativePos = relativePosition(pos);
|
||||
float sizeElement = m_size.x*m_ratio;
|
||||
@ -143,7 +143,7 @@ bool ewol::widget::Joystick::onEventInput(const ewol::EventInput& _event) {
|
||||
m_displayPos.y = sin(m_angle)*m_distance;
|
||||
}
|
||||
markToRedraw();
|
||||
if(ewol::keyEvent::statusDown == typeEvent) {
|
||||
if(ewol::key::statusDown == typeEvent) {
|
||||
generateEventId(ewolEventJoystickEnable);
|
||||
} else {
|
||||
std::string tmp = std::string("distance=") + std::string(m_distance) + std::string("angle=") + std::string(m_angle+M_PI/2);
|
||||
@ -152,7 +152,7 @@ bool ewol::widget::Joystick::onEventInput(const ewol::EventInput& _event) {
|
||||
//teta += M_PI/2;
|
||||
//EWOL_DEBUG("TETA = " << (m_angle*180/M_PI) << " deg distance = " << m_distance);
|
||||
return true;
|
||||
} else if( ewol::keyEvent::statusUp == typeEvent) {
|
||||
} else if( ewol::key::statusUp == typeEvent) {
|
||||
if( true == m_lock
|
||||
&& m_distance == 1) {
|
||||
// nothing to do ...
|
||||
|
@ -79,7 +79,7 @@ namespace ewol {
|
||||
public: // Derived function
|
||||
virtual void calculateSize(const vec2& _availlable);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <ewol/widget/Label.h>
|
||||
|
||||
#include <ewol/compositing/Text.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/ewol.h>
|
||||
|
||||
#undef __class__
|
||||
@ -21,7 +21,7 @@ static ewol::Widget* create(void) {
|
||||
return new ewol::widget::Label();
|
||||
}
|
||||
|
||||
void ewol::widget::Label::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::Label::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&create);
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ void ewol::widget::Label::calculateMinMaxSize(void) {
|
||||
vec2 tmpMax = m_userMaxSize.getPixel();
|
||||
//EWOL_DEBUG("[" << getId() << "] {" << getObjectType() << "} tmpMax : " << tmpMax);
|
||||
if (tmpMax.x() <= 999999) {
|
||||
m_text.setTextAlignement(0, tmpMax.x()-4, ewol::Text::alignLeft);
|
||||
m_text.setTextAlignement(0, tmpMax.x()-4, ewol::compositing::Text::alignLeft);
|
||||
//EWOL_DEBUG("[" << getId() << "] {" << getObjectType() << "} forcez Alignement ");
|
||||
}
|
||||
vec3 minSize = m_text.calculateSizeDecorated(m_label);
|
||||
@ -70,7 +70,7 @@ void ewol::widget::Label::onRegenerateDisplay(void) {
|
||||
// to know the size of one line :
|
||||
vec3 minSize = m_text.calculateSize(char32_t('A'));
|
||||
if (tmpMax.x() <= 999999) {
|
||||
m_text.setTextAlignement(0, tmpMax.x()-2*paddingSize, ewol::Text::alignLeft);
|
||||
m_text.setTextAlignement(0, tmpMax.x()-2*paddingSize, ewol::compositing::Text::alignLeft);
|
||||
}
|
||||
vec3 curentTextSize = m_text.calculateSizeDecorated(m_label);
|
||||
|
||||
@ -104,16 +104,16 @@ void ewol::widget::Label::onRegenerateDisplay(void) {
|
||||
// clean the element
|
||||
m_text.reset();
|
||||
m_text.setPos(tmpTextOrigin);
|
||||
m_text.setTextAlignement(tmpTextOrigin.x(), tmpTextOrigin.x()+localSize.x(), ewol::Text::alignLeft);
|
||||
m_text.setTextAlignement(tmpTextOrigin.x(), tmpTextOrigin.x()+localSize.x(), ewol::compositing::Text::alignLeft);
|
||||
m_text.setClipping(drawClippingPos, drawClippingSize);
|
||||
m_text.printDecorated(m_label);
|
||||
}
|
||||
}
|
||||
|
||||
bool ewol::widget::Label::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::Label::onEventInput(const ewol::event::Input& _event) {
|
||||
//EWOL_DEBUG("Event on Label ...");
|
||||
if (1 == _event.getId()) {
|
||||
if (ewol::keyEvent::statusSingle == _event.getStatus()) {
|
||||
if (ewol::key::statusSingle == _event.getStatus()) {
|
||||
// nothing to do ...
|
||||
generateEventId(eventPressed);
|
||||
return true;
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/compositing/Text.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace widget {
|
||||
@ -27,9 +27,9 @@ namespace ewol {
|
||||
/**
|
||||
* @brief Main call of recording the widget on the List of "widget named creator"
|
||||
*/
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
private:
|
||||
ewol::Text m_text; //!< Compositing text element.
|
||||
ewol::compositing::Text m_text; //!< Compositing text element.
|
||||
std::string m_label; //!< decorated text to display.
|
||||
public:
|
||||
/**
|
||||
@ -64,7 +64,7 @@ namespace ewol {
|
||||
public: // Derived function
|
||||
virtual void calculateMinMaxSize(void);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
virtual bool loadXML(exml::Element* _node);
|
||||
};
|
||||
};
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <ewol/widget/Layer.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
|
||||
#undef __class__
|
||||
@ -17,7 +17,7 @@ static ewol::Widget* create(void) {
|
||||
return new ewol::widget::Layer();
|
||||
}
|
||||
|
||||
void ewol::widget::Layer::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::Layer::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&create);
|
||||
}
|
||||
|
||||
|
@ -12,19 +12,19 @@
|
||||
#include <etk/types.h>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/widget/ContainerN.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace widget {
|
||||
/**
|
||||
* @ingroup ewolWidgetGroup
|
||||
*/
|
||||
class Layer : public widget::ContainerN {
|
||||
class Layer : public ewol::widget::ContainerN {
|
||||
public:
|
||||
/**
|
||||
* @brief Main call of recording the widget on the List of "widget named creator"
|
||||
*/
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/compositing/Text.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "List"
|
||||
@ -131,7 +131,7 @@ void ewol::widget::List::onRegenerateDisplay(void) {
|
||||
|
||||
std::vector<int32_t> listSizeColomn;
|
||||
|
||||
ewol::Drawing * BGOObjects = new ewol::Drawing();
|
||||
ewol::compositing::Drawing * BGOObjects = new ewol::compositing::Drawing();
|
||||
etk::Color<> basicBG = getBasicBG();
|
||||
BGOObjects->setColor(basicBG);
|
||||
BGOObjects->setPos(vec3(0, 0, 0) );
|
||||
@ -173,7 +173,7 @@ void ewol::widget::List::onRegenerateDisplay(void) {
|
||||
etk::Color<> bg;
|
||||
getElement(jjj, iii, myTextToWrite, fg, bg);
|
||||
|
||||
ewol::Text * tmpText = new ewol::Text();
|
||||
ewol::compositing::Text * tmpText = new ewol::compositing::Text();
|
||||
if (NULL != tmpText) {
|
||||
// get font size :
|
||||
int32_t tmpFontHeight = tmpText->calculateSize(char32_t('A')).y();
|
||||
@ -212,7 +212,7 @@ void ewol::widget::List::onRegenerateDisplay(void) {
|
||||
}
|
||||
}
|
||||
|
||||
bool ewol::widget::List::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::List::onEventInput(const ewol::event::Input& _event) {
|
||||
vec2 relativePos = relativePosition(_event.getPos());
|
||||
|
||||
if (true == WidgetScrooled::onEventInput(_event)) {
|
||||
|
@ -20,7 +20,7 @@ namespace ewol {
|
||||
/**
|
||||
* @ingroup ewolWidgetGroup
|
||||
*/
|
||||
class List : public widget::WidgetScrooled {
|
||||
class List : public ewol::widget::WidgetScrooled {
|
||||
public:
|
||||
List(void);
|
||||
virtual ~List(void);
|
||||
@ -66,7 +66,7 @@ namespace ewol {
|
||||
}
|
||||
return false;
|
||||
};
|
||||
virtual bool onItemEvent(int32_t _IdInput, enum ewol::keyEvent::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) {
|
||||
virtual bool onItemEvent(int32_t _IdInput, enum ewol::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y) {
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
@ -80,7 +80,7 @@ namespace ewol {
|
||||
virtual void onDraw(void);
|
||||
public: // Derived function
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -181,7 +181,7 @@ bool ewol::widget::ListFileSystem::getElement(int32_t _colomn, int32_t _raw, std
|
||||
|
||||
|
||||
bool ewol::widget::ListFileSystem::onItemEvent(int32_t _IdInput,
|
||||
enum ewol::keyEvent::status _typeEvent,
|
||||
enum ewol::key::status _typeEvent,
|
||||
int32_t _colomn,
|
||||
int32_t _raw,
|
||||
float _x,
|
||||
@ -190,7 +190,7 @@ bool ewol::widget::ListFileSystem::onItemEvent(int32_t _IdInput,
|
||||
if (true == m_showFolder) {
|
||||
offset = 2;
|
||||
}
|
||||
if (_typeEvent == ewol::keyEvent::statusSingle) {
|
||||
if (_typeEvent == ewol::key::statusSingle) {
|
||||
EWOL_INFO("Event on List : IdInput=" << _IdInput << " colomn=" << _colomn << " raw=" << _raw );
|
||||
if (1 == _IdInput) {
|
||||
int32_t previousRaw = m_selectedLine;
|
||||
|
@ -22,7 +22,7 @@ namespace ewol {
|
||||
/**
|
||||
* @ingroup ewolWidgetGroup
|
||||
*/
|
||||
class ListFileSystem : public widget::List {
|
||||
class ListFileSystem : public ewol::widget::List {
|
||||
private:
|
||||
std::vector<etk::FSNode *> m_list;
|
||||
std::string m_folder;
|
||||
@ -40,7 +40,7 @@ namespace ewol {
|
||||
bool getTitle(int32_t _colomn, std::string& _myTitle, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||
uint32_t getNuberOfRaw(void);
|
||||
bool getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg);
|
||||
bool onItemEvent(int32_t _IdInput, enum ewol::keyEvent::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
|
||||
bool onItemEvent(int32_t _IdInput, enum ewol::key::status _typeEvent, int32_t _colomn, int32_t _raw, float _x, float _y);
|
||||
public:
|
||||
// extern API :
|
||||
void setFolder(std::string _newFolder);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/widget/Joystick.h>
|
||||
#include <ewol/widget/Button.h>
|
||||
#include <ewol/widget/ContextMenu.h>
|
||||
@ -41,21 +41,21 @@ ewol::widget::Manager::Manager(void) :
|
||||
m_applWakeUpTime = ewol::getTime();
|
||||
m_lastPeriodicCallTime = ewol::getTime();
|
||||
|
||||
widget::Button::init(*this);
|
||||
widget::ButtonColor::init(*this);
|
||||
widget::Spacer::init(*this);
|
||||
widget::Slider::init(*this);
|
||||
widget::Sizer::init(*this);
|
||||
widget::ProgressBar::init(*this);
|
||||
widget::Layer::init(*this);
|
||||
widget::Label::init(*this);
|
||||
widget::Image::init(*this);
|
||||
widget::Gird::init(*this);
|
||||
widget::Entry::init(*this);
|
||||
widget::CheckBox::init(*this);
|
||||
widget::Scroll::init(*this);
|
||||
widget::ContextMenu::init(*this);
|
||||
widget::PopUp::init(*this);
|
||||
ewol::widget::Button::init(*this);
|
||||
ewol::widget::ButtonColor::init(*this);
|
||||
ewol::widget::Spacer::init(*this);
|
||||
ewol::widget::Slider::init(*this);
|
||||
ewol::widget::Sizer::init(*this);
|
||||
ewol::widget::ProgressBar::init(*this);
|
||||
ewol::widget::Layer::init(*this);
|
||||
ewol::widget::Label::init(*this);
|
||||
ewol::widget::Image::init(*this);
|
||||
ewol::widget::Gird::init(*this);
|
||||
ewol::widget::Entry::init(*this);
|
||||
ewol::widget::CheckBox::init(*this);
|
||||
ewol::widget::Scroll::init(*this);
|
||||
ewol::widget::ContextMenu::init(*this);
|
||||
ewol::widget::PopUp::init(*this);
|
||||
}
|
||||
|
||||
ewol::widget::Manager::~Manager(void) {
|
||||
@ -195,7 +195,7 @@ void ewol::widget::Manager::periodicCall(int64_t _localTime) {
|
||||
}
|
||||
float deltaTime = (float)(_localTime - previousTime)/1000000.0;
|
||||
|
||||
EventTime myTime(_localTime, m_applWakeUpTime, deltaTime, deltaTime);
|
||||
ewol::event::Time myTime(_localTime, m_applWakeUpTime, deltaTime, deltaTime);
|
||||
|
||||
EWOL_VERBOSE("periodic : " << _localTime);
|
||||
for (int32_t iii=m_listOfPeriodicWidget.size()-1; iii >= 0 ; iii--) {
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/widget/Menu.h>
|
||||
#include <ewol/widget/Button.h>
|
||||
#include <ewol/widget/ContextMenu.h>
|
||||
@ -30,7 +30,7 @@ ewol::widget::Menu::~Menu(void) {
|
||||
|
||||
void ewol::widget::Menu::subWidgetRemoveAll(void) {
|
||||
clear();
|
||||
widget::Sizer::subWidgetRemoveAll();
|
||||
ewol::widget::Sizer::subWidgetRemoveAll();
|
||||
}
|
||||
|
||||
int32_t ewol::widget::Menu::subWidgetAdd(ewol::Widget* _newWidget) {
|
||||
@ -82,15 +82,15 @@ int32_t ewol::widget::Menu::add(int32_t _parent,
|
||||
tmpObject->m_message = _message;
|
||||
m_listElement.push_back(tmpObject);
|
||||
if (-1 == tmpObject->m_parentId) {
|
||||
widget::Button *myButton = NULL;
|
||||
myButton = new widget::Button();
|
||||
ewol::widget::Button *myButton = NULL;
|
||||
myButton = new ewol::widget::Button();
|
||||
if (NULL == myButton) {
|
||||
EWOL_ERROR("Allocation button error");
|
||||
return tmpObject->m_localId;
|
||||
}
|
||||
if (tmpObject->m_image.size()!=0) {
|
||||
myButton->setSubWidget(
|
||||
new widget::Composer(widget::Composer::String,
|
||||
new ewol::widget::Composer(widget::Composer::String,
|
||||
std::string("<composer>\n") +
|
||||
" <sizer mode=\"hori\">\n"
|
||||
" <image src=\"" + tmpObject->m_image + "\" size=\"8,8mm\"/>\n"
|
||||
@ -98,13 +98,13 @@ int32_t ewol::widget::Menu::add(int32_t _parent,
|
||||
" </sizer>\n"
|
||||
"</composer>\n"));
|
||||
} else {
|
||||
myButton->setSubWidget( new widget::Label(tmpObject->m_label) );
|
||||
myButton->setSubWidget( new ewol::widget::Label(tmpObject->m_label) );
|
||||
}
|
||||
|
||||
// add it in the widget list
|
||||
widget::Sizer::subWidgetAdd(myButton);
|
||||
ewol::widget::Sizer::subWidgetAdd(myButton);
|
||||
// keep the specific event ...
|
||||
myButton->registerOnEvent(this, widget::Button::eventPressed, widget::Button::eventPressed);
|
||||
myButton->registerOnEvent(this, ewol::widget::Button::eventPressed, widget::Button::eventPressed);
|
||||
tmpObject->m_widgetPointer = myButton;
|
||||
}
|
||||
return tmpObject->m_localId;
|
||||
@ -115,14 +115,14 @@ void ewol::widget::Menu::addSpacer(void) {
|
||||
}
|
||||
|
||||
|
||||
void ewol::widget::Menu::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
void ewol::widget::Menu::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
/*
|
||||
if (true == ewol::sizer::onReceiveMessage(_msg) {
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
EWOL_ERROR(" receive message : " << _msg);
|
||||
if (_msg.getMessage() == widget::Button::eventPressed) {
|
||||
if (_msg.getMessage() == ewol::widget::Button::eventPressed) {
|
||||
for (size_t iii=0; iii<m_listElement.size(); iii++) {
|
||||
if (_msg.getCaller() == m_listElement[iii]->m_widgetPointer) {
|
||||
// 2 posible case (have a message or have a child ...
|
||||
@ -150,7 +150,7 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
return;
|
||||
}
|
||||
// create a context menu :
|
||||
m_widgetContextMenu = new widget::ContextMenu();
|
||||
m_widgetContextMenu = new ewol::widget::ContextMenu();
|
||||
if (NULL == m_widgetContextMenu) {
|
||||
EWOL_ERROR("Allocation Error");
|
||||
return;
|
||||
@ -166,12 +166,12 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
tmpOri.y() );
|
||||
}
|
||||
|
||||
m_widgetContextMenu->setPositionMark(widget::ContextMenu::markTop, newPosition );
|
||||
m_widgetContextMenu->setPositionMark(ewol::widget::ContextMenu::markTop, newPosition );
|
||||
|
||||
widget::Sizer * mySizer = NULL;
|
||||
widget::Button * myButton = NULL;
|
||||
ewol::widget::Sizer * mySizer = NULL;
|
||||
ewol::widget::Button * myButton = NULL;
|
||||
|
||||
mySizer = new widget::Sizer(widget::Sizer::modeVert);
|
||||
mySizer = new ewol::widget::Sizer(widget::Sizer::modeVert);
|
||||
if (NULL != mySizer) {
|
||||
mySizer->lockExpand(vec2(true,true));
|
||||
// set it in the pop-up-system :
|
||||
@ -191,13 +191,13 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
for (int64_t jjj=m_listElement.size()-1; jjj >= 0; jjj--) {
|
||||
if (m_listElement[iii]!=NULL) {
|
||||
if (m_listElement[iii]->m_localId == m_listElement[jjj]->m_parentId) {
|
||||
myButton = new widget::Button();
|
||||
myButton = new ewol::widget::Button();
|
||||
if (NULL == myButton) {
|
||||
EWOL_ERROR("Allocation Error");
|
||||
} else {
|
||||
if (m_listElement[jjj]->m_image.size()!=0) {
|
||||
myButton->setSubWidget(
|
||||
new widget::Composer(widget::Composer::String,
|
||||
new ewol::widget::Composer(widget::Composer::String,
|
||||
std::string("<composer expand=\"true,false\" fill=\"true,true\">\n") +
|
||||
" <sizer mode=\"hori\" expand=\"true,false\" fill=\"true,true\" lock=\"true\">\n"
|
||||
" <image src=\"" + m_listElement[jjj]->m_image + "\" size=\"8,8mm\"/>\n"
|
||||
@ -207,7 +207,7 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
} else {
|
||||
if (true == menuHaveImage) {
|
||||
myButton->setSubWidget(
|
||||
new widget::Composer(widget::Composer::String,
|
||||
new ewol::widget::Composer(widget::Composer::String,
|
||||
std::string("<composer expand=\"true,false\" fill=\"true,true\">\n") +
|
||||
" <sizer mode=\"hori\" expand=\"true,false\" fill=\"true,true\" lock=\"true\">\n"
|
||||
" <spacer min-size=\"8,0mm\"/>\n"
|
||||
@ -215,7 +215,7 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
" </sizer>\n"
|
||||
"</composer>\n"));
|
||||
} else {
|
||||
widget::Label* tmpLabel = new widget::Label(std::string("<left>") + m_listElement[jjj]->m_label + "</left>\n");
|
||||
ewol::widget::Label* tmpLabel = new widget::Label(std::string("<left>") + m_listElement[jjj]->m_label + "</left>\n");
|
||||
if (NULL != tmpLabel) {
|
||||
tmpLabel->setExpand(bvec2(true,false));
|
||||
tmpLabel->setFill(bvec2(true,true));
|
||||
@ -224,7 +224,7 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
}
|
||||
}
|
||||
// set the image if one is present ...
|
||||
myButton->registerOnEvent(this, widget::Button::eventPressed, widget::Button::eventPressed);
|
||||
myButton->registerOnEvent(this, ewol::widget::Button::eventPressed, widget::Button::eventPressed);
|
||||
myButton->setExpand(bvec2(true,false));
|
||||
myButton->setFill(bvec2(true,false));
|
||||
// add it in the widget list
|
||||
@ -235,7 +235,7 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
}
|
||||
}
|
||||
}
|
||||
ewol::Windows* currentWindows = getWindows();
|
||||
ewol::widget::Windows* currentWindows = getWindows();
|
||||
if (NULL == currentWindows) {
|
||||
EWOL_ERROR("Can not get the curent Windows...");
|
||||
delete(m_widgetContextMenu);
|
||||
@ -251,8 +251,8 @@ void ewol::widget::Menu::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
}
|
||||
|
||||
|
||||
void ewol::widget::Menu::onObjectRemove(ewol::EObject * _removeObject) {
|
||||
widget::Sizer::onObjectRemove(_removeObject);
|
||||
void ewol::widget::Menu::onObjectRemove(ewol::Object * _removeObject) {
|
||||
ewol::widget::Sizer::onObjectRemove(_removeObject);
|
||||
if (m_widgetContextMenu == _removeObject) {
|
||||
m_widgetContextMenu = NULL;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ namespace ewol {
|
||||
MenuElement(void) : m_widgetPointer(NULL) { };
|
||||
int32_t m_localId;
|
||||
int32_t m_parentId;
|
||||
ewol::EObject* m_widgetPointer;
|
||||
ewol::Object* m_widgetPointer;
|
||||
std::string m_label;
|
||||
std::string m_image;
|
||||
const char *m_generateEvent;
|
||||
@ -32,7 +32,7 @@ namespace ewol {
|
||||
/**
|
||||
* @ingroup ewolWidgetGroup
|
||||
*/
|
||||
class Menu :public widget::Sizer {
|
||||
class Menu :public ewol::widget::Sizer {
|
||||
public:
|
||||
Menu(void);
|
||||
virtual ~Menu(void);
|
||||
@ -42,17 +42,17 @@ namespace ewol {
|
||||
virtual void subWidgetRemove(ewol::Widget* _newWidget);
|
||||
virtual void subWidgetUnLink(ewol::Widget* _newWidget);
|
||||
private:
|
||||
std::vector<widget::MenuElement*> m_listElement;
|
||||
std::vector<ewol::widget::MenuElement*> m_listElement;
|
||||
int32_t m_staticId; // unique ID for every element of the menu ...
|
||||
widget::ContextMenu* m_widgetContextMenu;
|
||||
ewol::widget::ContextMenu* m_widgetContextMenu;
|
||||
public:
|
||||
void clear(void);
|
||||
int32_t addTitle(std::string _label, std::string _image="", const char * _generateEvent = NULL, const std::string _message = "");
|
||||
int32_t add(int32_t parent, std::string _label, std::string _image="", const char * _generateEvent = NULL, const std::string _message = "");
|
||||
void addSpacer(void);
|
||||
// Derived function
|
||||
virtual void onReceiveMessage(const ewol::EMessage& _msg);
|
||||
virtual void onObjectRemove(ewol::EObject * _removeObject);
|
||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||
virtual void onObjectRemove(ewol::Object * _removeObject);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -7,9 +7,9 @@
|
||||
*/
|
||||
|
||||
#include <ewol/widget/PopUp.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/ewol.h>
|
||||
|
||||
#undef __class__
|
||||
@ -26,7 +26,7 @@ static ewol::Widget* create(void) {
|
||||
return new ewol::widget::PopUp();
|
||||
}
|
||||
|
||||
void ewol::widget::PopUp::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::PopUp::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&create);
|
||||
}
|
||||
|
||||
@ -148,15 +148,15 @@ void ewol::widget::PopUp::onRegenerateDisplay(void) {
|
||||
}
|
||||
|
||||
ewol::Widget* ewol::widget::PopUp::getWidgetAtPos(const vec2& _pos) {
|
||||
ewol::Widget* val = widget::Container::getWidgetAtPos(_pos);
|
||||
ewol::Widget* val = ewol::widget::Container::getWidgetAtPos(_pos);
|
||||
if (NULL != val) {
|
||||
return val;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
bool ewol::widget::PopUp::onSetConfig(const ewol::EConfig& _conf) {
|
||||
if (true == widget::Container::onSetConfig(_conf)) {
|
||||
bool ewol::widget::PopUp::onSetConfig(const ewol::object::Config& _conf) {
|
||||
if (true == ewol::widget::Container::onSetConfig(_conf)) {
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == configShaper) {
|
||||
@ -175,7 +175,7 @@ bool ewol::widget::PopUp::onSetConfig(const ewol::EConfig& _conf) {
|
||||
}
|
||||
|
||||
bool ewol::widget::PopUp::onGetConfig(const char* _config, std::string& _result) const {
|
||||
if (true == widget::Container::onGetConfig(_config, _result)) {
|
||||
if (true == ewol::widget::Container::onGetConfig(_config, _result)) {
|
||||
return true;
|
||||
}
|
||||
if (_config == configShaper) {
|
||||
@ -197,7 +197,7 @@ bool ewol::widget::PopUp::onGetConfig(const char* _config, std::string& _result)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ewol::widget::PopUp::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::PopUp::onEventInput(const ewol::event::Input& _event) {
|
||||
if (0 != _event.getId()) {
|
||||
if (true == m_closeOutEvent) {
|
||||
vec2 padding = m_shaper.getPadding();
|
||||
@ -239,7 +239,7 @@ void ewol::widget::PopUp::onStopAnnimation(void) {
|
||||
periodicCallDisable();
|
||||
}
|
||||
|
||||
void ewol::widget::PopUp::periodicCall(const ewol::EventTime& _event) {
|
||||
void ewol::widget::PopUp::periodicCall(const ewol::event::Time& _event) {
|
||||
if (false == m_shaper.periodicCall(_event) ) {
|
||||
stopAnnimation();
|
||||
}
|
||||
|
@ -15,23 +15,23 @@
|
||||
#include <ewol/widget/Container.h>
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/compositing/Shaper.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace widget {
|
||||
/**
|
||||
* @ingroup ewolWidgetGroup
|
||||
*/
|
||||
class PopUp : public widget::Container {
|
||||
class PopUp : public ewol::widget::Container {
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
// Config list of properties
|
||||
static const char* const configShaper;
|
||||
static const char* const configRemoveOnExternClick;
|
||||
static const char* const configAnimation;
|
||||
static const char* const configLockExpand;
|
||||
private:
|
||||
ewol::Shaper m_shaper; //!< Compositing theme.
|
||||
ewol::compositing::Shaper m_shaper; //!< Compositing theme.
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
@ -74,14 +74,14 @@ namespace ewol {
|
||||
};
|
||||
protected: // Derived function
|
||||
virtual void onDraw(void);
|
||||
virtual bool onSetConfig(const ewol::EConfig& _conf);
|
||||
virtual bool onSetConfig(const ewol::object::Config& _conf);
|
||||
virtual bool onGetConfig(const char* _config, std::string& _result) const;
|
||||
public: // Derived function
|
||||
virtual void periodicCall(const ewol::EventTime& _event);
|
||||
virtual void periodicCall(const ewol::event::Time& _event);
|
||||
virtual void systemDraw(const ewol::DrawProperty& _displayProp);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual void calculateSize(const vec2& _available);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
virtual ewol::Widget* getWidgetAtPos(const vec2& pos);
|
||||
protected:
|
||||
virtual bool onStartAnnimation(enum ewol::Widget::annimationMode _mode);
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <ewol/widget/ProgressBar.h>
|
||||
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "ProgressBar"
|
||||
@ -18,7 +18,7 @@ static ewol::Widget* create(void) {
|
||||
return new ewol::widget::ProgressBar();
|
||||
}
|
||||
|
||||
void ewol::widget::ProgressBar::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::ProgressBar::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&create);
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ void ewol::widget::ProgressBar::onRegenerateDisplay(void) {
|
||||
|
||||
|
||||
|
||||
bool ewol::widget::ProgressBar::onSetConfig(const ewol::EConfig& _conf) {
|
||||
bool ewol::widget::ProgressBar::onSetConfig(const ewol::object::Config& _conf) {
|
||||
if (true == ewol::Widget::onSetConfig(_conf)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace widget {
|
||||
@ -23,14 +23,14 @@ namespace ewol {
|
||||
*/
|
||||
class ProgressBar : public ewol::Widget {
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
// Config list of properties
|
||||
static const char* const configColorBg;
|
||||
static const char* const configColorFgOn;
|
||||
static const char* const configColorFgOff;
|
||||
static const char* const configValue;
|
||||
private:
|
||||
ewol::Drawing m_draw; // basic drawing element
|
||||
ewol::compositing::Drawing m_draw; // basic drawing element
|
||||
public:
|
||||
ProgressBar(void);
|
||||
virtual ~ProgressBar(void);
|
||||
@ -48,7 +48,7 @@ namespace ewol {
|
||||
etk::Color<> m_textColorBgOff; //!< bar color disable
|
||||
protected: // Derived function
|
||||
virtual void onDraw(void);
|
||||
virtual bool onSetConfig(const ewol::EConfig& _conf);
|
||||
virtual bool onSetConfig(const ewol::object::Config& _conf);
|
||||
virtual bool onGetConfig(const char* _config, std::string& _result) const;
|
||||
public: // Derived function
|
||||
virtual void onRegenerateDisplay(void);
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include <ewol/widget/Scroll.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/debug.h>
|
||||
|
||||
#undef __class__
|
||||
@ -18,7 +18,7 @@ static ewol::Widget* create(void) {
|
||||
return new ewol::widget::Scroll();
|
||||
}
|
||||
|
||||
void ewol::widget::Scroll::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::Scroll::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&create);
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ ewol::widget::Scroll::Scroll(void) :
|
||||
m_highSpeedStartPos(0,0),
|
||||
m_highSpeedMode(speedModeDisable),
|
||||
m_highSpeedButton(-1),
|
||||
m_highSpeedType(ewol::keyEvent::typeUnknow) {
|
||||
m_highSpeedType(ewol::key::typeUnknow) {
|
||||
addObjectType("ewol::widget::Scroll");
|
||||
registerConfig(configLimit, "vec2", NULL, "Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end");
|
||||
}
|
||||
@ -73,7 +73,7 @@ void ewol::widget::Scroll::onDraw(void) {
|
||||
|
||||
void ewol::widget::Scroll::onRegenerateDisplay(void) {
|
||||
// call upper class
|
||||
widget::Container::onRegenerateDisplay();
|
||||
ewol::widget::Container::onRegenerateDisplay();
|
||||
if (true == needRedraw()) {
|
||||
// clear all previous display
|
||||
m_draw.clear();
|
||||
@ -115,7 +115,7 @@ void ewol::widget::Scroll::onRegenerateDisplay(void) {
|
||||
}
|
||||
}
|
||||
|
||||
bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::Scroll::onEventInput(const ewol::event::Input& _event) {
|
||||
vec2 relativePos = relativePosition(_event.getPos());
|
||||
vec2 scrollOffset(0,0);
|
||||
vec2 scrollSize(0,0);
|
||||
@ -124,17 +124,17 @@ bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
scrollSize = m_subWidget->getSize();
|
||||
}
|
||||
relativePos.setY(m_size.y() - relativePos.y());
|
||||
if( _event.getType() == ewol::keyEvent::typeMouse
|
||||
&& ( ewol::keyEvent::typeUnknow == m_highSpeedType
|
||||
|| ewol::keyEvent::typeMouse == m_highSpeedType ) ) {
|
||||
if( _event.getType() == ewol::key::typeMouse
|
||||
&& ( ewol::key::typeUnknow == m_highSpeedType
|
||||
|| ewol::key::typeMouse == m_highSpeedType ) ) {
|
||||
if( _event.getId() == 1
|
||||
&& _event.getStatus() == ewol::keyEvent::statusDown) {
|
||||
&& _event.getStatus() == ewol::key::statusDown) {
|
||||
// check if selected the scrolling position whth the scrolling bar ...
|
||||
if (relativePos.x() >= (m_size.x()-SCROLL_BAR_SPACE)) {
|
||||
if( m_size.y() < scrollSize.y()
|
||||
|| scrollOffset.y() != 0) {
|
||||
m_highSpeedMode = speedModeEnableVertical;
|
||||
m_highSpeedType = ewol::keyEvent::typeMouse;
|
||||
m_highSpeedType = ewol::key::typeMouse;
|
||||
m_highSpeedStartPos.setX(relativePos.x());
|
||||
m_highSpeedStartPos.setY(scrollOffset.y() / scrollSize.y() * (m_size.y()-SCROLL_BAR_SPACE*2));
|
||||
m_highSpeedButton = 1;
|
||||
@ -151,7 +151,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
if( m_size.x() < scrollSize.x()
|
||||
|| scrollOffset.x()!=0) {
|
||||
m_highSpeedMode = speedModeEnableHorizontal;
|
||||
m_highSpeedType = ewol::keyEvent::typeMouse;
|
||||
m_highSpeedType = ewol::key::typeMouse;
|
||||
m_highSpeedStartPos.setX(scrollOffset.x() / scrollSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2));
|
||||
m_highSpeedStartPos.setY(relativePos.y());
|
||||
m_highSpeedButton = 1;
|
||||
@ -167,7 +167,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
}
|
||||
return false;
|
||||
} else if( _event.getId() == 4
|
||||
&& _event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
&& _event.getStatus() == ewol::key::statusUp) {
|
||||
if(m_size.y() < scrollSize.y()) {
|
||||
scrollOffset.setY(scrollOffset.y()-m_pixelScrolling);
|
||||
scrollOffset.setY(etk_avg(0, scrollOffset.y(), (scrollSize.y() - m_size.y()*m_limit.y())));
|
||||
@ -178,7 +178,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
return true;
|
||||
}
|
||||
} else if( _event.getId() == 5
|
||||
&& _event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
&& _event.getStatus() == ewol::key::statusUp) {
|
||||
if(m_size.y() < scrollSize.y()) {
|
||||
scrollOffset.setY(scrollOffset.y()+m_pixelScrolling);
|
||||
scrollOffset.setY(etk_avg(0, scrollOffset.y(), (scrollSize.y() - m_size.y()*m_limit.y())));
|
||||
@ -189,28 +189,28 @@ bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
return true;
|
||||
}
|
||||
}else if (_event.getId() == 2) {
|
||||
if (_event.getStatus() == ewol::keyEvent::statusDown) {
|
||||
if (_event.getStatus() == ewol::key::statusDown) {
|
||||
m_highSpeedMode = speedModeInit;
|
||||
m_highSpeedType = ewol::keyEvent::typeMouse;
|
||||
m_highSpeedType = ewol::key::typeMouse;
|
||||
m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y());
|
||||
m_highSpeedButton = 2;
|
||||
// not really use... == > just keep some informations
|
||||
return false;
|
||||
}
|
||||
} else if( m_highSpeedMode != speedModeDisable
|
||||
&& _event.getStatus() == ewol::keyEvent::statusLeave) {
|
||||
&& _event.getStatus() == ewol::key::statusLeave) {
|
||||
m_highSpeedMode = speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
m_highSpeedType = ewol::key::typeUnknow;
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
if ( _event.getId() == m_highSpeedButton
|
||||
&& m_highSpeedMode != speedModeDisable) {
|
||||
if (_event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
if (_event.getStatus() == ewol::key::statusUp) {
|
||||
if (m_highSpeedMode == speedModeInit) {
|
||||
// TODO : generate back the down event ...
|
||||
m_highSpeedMode = speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
m_highSpeedType = ewol::key::typeUnknow;
|
||||
return false;
|
||||
} else {
|
||||
m_highSpeedMode = speedModeGrepEndEvent;
|
||||
@ -218,15 +218,15 @@ bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
return true;
|
||||
}
|
||||
} else if (m_highSpeedMode == speedModeGrepEndEvent) {
|
||||
if (_event.getStatus() == ewol::keyEvent::statusSingle) {
|
||||
if (_event.getStatus() == ewol::key::statusSingle) {
|
||||
m_highSpeedMode = speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
m_highSpeedType = ewol::key::typeUnknow;
|
||||
m_highSpeedButton = -1;
|
||||
markToRedraw();
|
||||
}
|
||||
return true;
|
||||
} else if( m_highSpeedMode == speedModeInit
|
||||
&& _event.getStatus() == ewol::keyEvent::statusMove) {
|
||||
&& _event.getStatus() == ewol::key::statusMove) {
|
||||
// wait that the cursor move more than 10 px to enable it :
|
||||
if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10
|
||||
|| abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) {
|
||||
@ -258,7 +258,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
return true;
|
||||
}
|
||||
if( m_highSpeedMode == speedModeEnableHorizontal
|
||||
&& _event.getStatus() == ewol::keyEvent::statusMove) {
|
||||
&& _event.getStatus() == ewol::key::statusMove) {
|
||||
scrollOffset.setX((int32_t)(scrollSize.x() * (relativePos.x()-SCROLL_BAR_SPACE) / (m_size.x()-SCROLL_BAR_SPACE*2)));
|
||||
scrollOffset.setX(etk_avg(0, scrollOffset.x(), (scrollSize.x() - m_size.x()*m_limit.x() )));
|
||||
markToRedraw();
|
||||
@ -268,7 +268,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
return true;
|
||||
}
|
||||
if( m_highSpeedMode == speedModeEnableVertical
|
||||
&& _event.getStatus() == ewol::keyEvent::statusMove) {
|
||||
&& _event.getStatus() == ewol::key::statusMove) {
|
||||
scrollOffset.setY((int32_t)(scrollSize.y() * (relativePos.y()-SCROLL_BAR_SPACE) / (m_size.y()-SCROLL_BAR_SPACE*2)));
|
||||
scrollOffset.setY(etk_avg(0, scrollOffset.y(), (scrollSize.y() - m_size.y()*m_limit.x())));
|
||||
markToRedraw();
|
||||
@ -278,25 +278,25 @@ bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if( ewol::keyEvent::typeFinger == _event.getType()
|
||||
&& ( ewol::keyEvent::typeUnknow == m_highSpeedType
|
||||
|| ewol::keyEvent::typeFinger == m_highSpeedType ) ) {
|
||||
} else if( ewol::key::typeFinger == _event.getType()
|
||||
&& ( ewol::key::typeUnknow == m_highSpeedType
|
||||
|| ewol::key::typeFinger == m_highSpeedType ) ) {
|
||||
if (1 == _event.getId()) {
|
||||
//EWOL_VERBOSE("event 1 << " << (int32_t)typeEvent << "(" << x << "," << y << ")");
|
||||
if (ewol::keyEvent::statusDown == _event.getStatus()) {
|
||||
if (ewol::key::statusDown == _event.getStatus()) {
|
||||
m_highSpeedMode = speedModeInit;
|
||||
m_highSpeedType = ewol::keyEvent::typeFinger;
|
||||
m_highSpeedType = ewol::key::typeFinger;
|
||||
m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y());
|
||||
EWOL_VERBOSE("SCROOL == > INIT");
|
||||
return true;
|
||||
} else if (ewol::keyEvent::statusUp == _event.getStatus()) {
|
||||
} else if (ewol::key::statusUp == _event.getStatus()) {
|
||||
m_highSpeedMode = speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
m_highSpeedType = ewol::key::typeUnknow;
|
||||
EWOL_VERBOSE("SCROOL == > DISABLE");
|
||||
markToRedraw();
|
||||
return true;
|
||||
} else if ( m_highSpeedMode == speedModeInit
|
||||
&& ewol::keyEvent::statusMove == _event.getStatus()) {
|
||||
&& ewol::key::statusMove == _event.getStatus()) {
|
||||
// wait that the cursor move more than 10 px to enable it :
|
||||
if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10
|
||||
|| abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) {
|
||||
@ -309,7 +309,7 @@ bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
return true;
|
||||
}
|
||||
if ( m_highSpeedMode == speedModeEnableFinger
|
||||
&& ewol::keyEvent::statusMove == _event.getStatus()) {
|
||||
&& ewol::key::statusMove == _event.getStatus()) {
|
||||
//scrollOffset.x = (int32_t)(scrollSize.x * x / m_size.x);
|
||||
scrollOffset.setX(scrollOffset.x() - relativePos.x() - m_highSpeedStartPos.x());
|
||||
scrollOffset.setY(scrollOffset.y() - relativePos.y() - m_highSpeedStartPos.y());
|
||||
@ -321,9 +321,9 @@ bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
return true;
|
||||
}
|
||||
} else if ( m_highSpeedMode != speedModeDisable
|
||||
&& ewol::keyEvent::statusLeave == _event.getStatus()) {
|
||||
&& ewol::key::statusLeave == _event.getStatus()) {
|
||||
m_highSpeedMode = speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
m_highSpeedType = ewol::key::typeUnknow;
|
||||
EWOL_VERBOSE("SCROOL == > DISABLE");
|
||||
markToRedraw();
|
||||
return true;
|
||||
@ -333,15 +333,15 @@ bool ewol::widget::Scroll::onEventInput(const ewol::EventInput& _event) {
|
||||
}
|
||||
|
||||
ewol::Widget* ewol::widget::Scroll::getWidgetAtPos(const vec2& _pos) {
|
||||
ewol::Widget* tmpWidget = widget::Container::getWidgetAtPos(_pos);
|
||||
ewol::Widget* tmpWidget = ewol::widget::Container::getWidgetAtPos(_pos);
|
||||
if (NULL != tmpWidget) {
|
||||
return tmpWidget;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
bool ewol::widget::Scroll::onSetConfig(const ewol::EConfig& _conf) {
|
||||
if (true == widget::Container::onSetConfig(_conf)) {
|
||||
bool ewol::widget::Scroll::onSetConfig(const ewol::object::Config& _conf) {
|
||||
if (true == ewol::widget::Container::onSetConfig(_conf)) {
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == configLimit) {
|
||||
@ -352,7 +352,7 @@ bool ewol::widget::Scroll::onSetConfig(const ewol::EConfig& _conf) {
|
||||
}
|
||||
|
||||
bool ewol::widget::Scroll::onGetConfig(const char* _config, std::string& _result) const {
|
||||
if (true == widget::Container::onGetConfig(_config, _result)) {
|
||||
if (true == ewol::widget::Container::onGetConfig(_config, _result)) {
|
||||
return true;
|
||||
}
|
||||
if (_config == configLimit) {
|
||||
|
@ -14,14 +14,14 @@
|
||||
#include <ewol/widget/Container.h>
|
||||
#include <ewol/compositing/Compositing.h>
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace widget {
|
||||
/**
|
||||
* @ingroup ewolWidgetGroup
|
||||
*/
|
||||
class Scroll : public widget::Container {
|
||||
class Scroll : public ewol::widget::Container {
|
||||
public:
|
||||
enum highSpeedMode {
|
||||
speedModeDisable,
|
||||
@ -35,9 +35,9 @@ namespace ewol {
|
||||
// Cinfig parameter list:
|
||||
static const char* const configLimit;
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
private:
|
||||
ewol::Drawing m_draw; // TODO : change in shaper ... == > better for annimation and dynamic display ...
|
||||
ewol::compositing::Drawing m_draw; // TODO : change in shaper ... == > better for annimation and dynamic display ...
|
||||
protected:
|
||||
vec2 m_limit;
|
||||
private:
|
||||
@ -45,7 +45,7 @@ namespace ewol {
|
||||
vec2 m_highSpeedStartPos;
|
||||
enum highSpeedMode m_highSpeedMode;
|
||||
int32_t m_highSpeedButton;
|
||||
enum ewol::keyEvent::type m_highSpeedType;
|
||||
enum ewol::key::type m_highSpeedType;
|
||||
public:
|
||||
Scroll(void);
|
||||
virtual ~Scroll(void);
|
||||
@ -64,12 +64,12 @@ namespace ewol {
|
||||
public: // Derived function
|
||||
void calculateMinMaxSize(void);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
virtual void systemDraw(const ewol::DrawProperty& _displayProp);
|
||||
virtual ewol::Widget* getWidgetAtPos(const vec2& _pos);
|
||||
protected: // Derived function
|
||||
virtual void onDraw(void);
|
||||
virtual bool onSetConfig(const ewol::EConfig& _conf);
|
||||
virtual bool onSetConfig(const ewol::object::Config& _conf);
|
||||
virtual bool onGetConfig(const char* _config, std::string& _result) const;
|
||||
};
|
||||
};
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/widget/Sizer.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "Sizer"
|
||||
@ -17,7 +17,7 @@ static ewol::Widget* create(void) {
|
||||
return new ewol::widget::Sizer();
|
||||
}
|
||||
|
||||
void ewol::widget::Sizer::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::Sizer::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&create);
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ bool ewol::widget::Sizer::loadXML(exml::Element* _node) {
|
||||
return false;
|
||||
}
|
||||
// parse generic properties :
|
||||
widget::ContainerN::loadXML(_node);
|
||||
ewol::widget::ContainerN::loadXML(_node);
|
||||
|
||||
std::string tmpAttributeValue = _node->getAttribute("border");
|
||||
if (tmpAttributeValue.size()!=0) {
|
||||
@ -188,36 +188,36 @@ bool ewol::widget::Sizer::loadXML(exml::Element* _node) {
|
||||
|
||||
int32_t ewol::widget::Sizer::subWidgetAdd(ewol::Widget* _newWidget) {
|
||||
if (m_animation == animationNone) {
|
||||
return widget::ContainerN::subWidgetAdd(_newWidget);
|
||||
return ewol::widget::ContainerN::subWidgetAdd(_newWidget);
|
||||
}
|
||||
// TODO : ...
|
||||
return widget::ContainerN::subWidgetAdd(_newWidget);
|
||||
return ewol::widget::ContainerN::subWidgetAdd(_newWidget);
|
||||
}
|
||||
|
||||
int32_t ewol::widget::Sizer::subWidgetAddStart(ewol::Widget* _newWidget) {
|
||||
if (m_animation == animationNone) {
|
||||
return widget::ContainerN::subWidgetAddStart(_newWidget);
|
||||
return ewol::widget::ContainerN::subWidgetAddStart(_newWidget);
|
||||
}
|
||||
// TODO : ...
|
||||
return widget::ContainerN::subWidgetAddStart(_newWidget);
|
||||
return ewol::widget::ContainerN::subWidgetAddStart(_newWidget);
|
||||
}
|
||||
|
||||
void ewol::widget::Sizer::subWidgetRemove(ewol::Widget* _newWidget) {
|
||||
if (m_animation == animationNone) {
|
||||
widget::ContainerN::subWidgetRemove(_newWidget);
|
||||
ewol::widget::ContainerN::subWidgetRemove(_newWidget);
|
||||
return;
|
||||
}
|
||||
// TODO : ...
|
||||
widget::ContainerN::subWidgetRemove(_newWidget);
|
||||
ewol::widget::ContainerN::subWidgetRemove(_newWidget);
|
||||
}
|
||||
|
||||
void ewol::widget::Sizer::subWidgetUnLink(ewol::Widget* _newWidget) {
|
||||
if (m_animation == animationNone) {
|
||||
widget::ContainerN::subWidgetUnLink(_newWidget);
|
||||
ewol::widget::ContainerN::subWidgetUnLink(_newWidget);
|
||||
return;
|
||||
}
|
||||
// TODO : ...
|
||||
widget::ContainerN::subWidgetUnLink(_newWidget);
|
||||
ewol::widget::ContainerN::subWidgetUnLink(_newWidget);
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,19 +12,19 @@
|
||||
#include <etk/types.h>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/widget/ContainerN.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace widget {
|
||||
/**
|
||||
* @ingroup ewolWidgetGroup
|
||||
*/
|
||||
class Sizer : public widget::ContainerN {
|
||||
class Sizer : public ewol::widget::ContainerN {
|
||||
public:
|
||||
/**
|
||||
* @brief Main call of recording the widget on the List of "widget named creator"
|
||||
*/
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
public:
|
||||
enum displayMode {
|
||||
modeVert, //!< Vertical mode
|
||||
@ -37,7 +37,7 @@ namespace ewol {
|
||||
* @brief Constructor
|
||||
* @param[in] _mode The mode to display the elements
|
||||
*/
|
||||
Sizer(enum displayMode _mode=widget::Sizer::modeHori);
|
||||
Sizer(enum displayMode _mode=ewol::widget::Sizer::modeHori);
|
||||
/**
|
||||
* @brief Desstructor
|
||||
*/
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include <ewol/widget/Slider.h>
|
||||
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
extern const char * const ewolEventSliderChange = "ewol-event-slider-change";
|
||||
|
||||
@ -19,7 +19,7 @@ static ewol::Widget* create(void) {
|
||||
return new ewol::widget::Slider();
|
||||
}
|
||||
|
||||
void ewol::widget::Slider::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::Slider::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&create);
|
||||
}
|
||||
|
||||
@ -100,12 +100,12 @@ void ewol::widget::Slider::onRegenerateDisplay(void) {
|
||||
m_draw.circle(dotRadius/1.6);
|
||||
}
|
||||
|
||||
bool ewol::widget::Slider::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::Slider::onEventInput(const ewol::event::Input& _event) {
|
||||
vec2 relativePos = relativePosition(_event.getPos());
|
||||
//EWOL_DEBUG("Event on Slider ...");
|
||||
if (1 == _event.getId()) {
|
||||
if( ewol::keyEvent::statusSingle == _event.getStatus()
|
||||
|| ewol::keyEvent::statusMove == _event.getStatus()) {
|
||||
if( ewol::key::statusSingle == _event.getStatus()
|
||||
|| ewol::key::statusMove == _event.getStatus()) {
|
||||
// get the new position :
|
||||
EWOL_VERBOSE("Event on Slider (" << relativePos.x() << "," << relativePos.y() << ")");
|
||||
int32_t oldValue = m_value;
|
||||
|
@ -24,7 +24,7 @@ namespace ewol {
|
||||
*/
|
||||
class Slider :public ewol::Widget {
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
public:
|
||||
Slider(void);
|
||||
virtual ~Slider(void);
|
||||
@ -36,7 +36,7 @@ namespace ewol {
|
||||
m_textColorFg = _newColor;
|
||||
};
|
||||
protected:
|
||||
ewol::Drawing m_draw; //!< drawing tool.
|
||||
ewol::compositing::Drawing m_draw; //!< drawing tool.
|
||||
int32_t m_value;
|
||||
int32_t m_min;
|
||||
int32_t m_max;
|
||||
@ -46,7 +46,7 @@ namespace ewol {
|
||||
virtual void onDraw(void);
|
||||
virtual void calculateMinMaxSize(void);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <ewol/widget/Spacer.h>
|
||||
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "Spacer"
|
||||
@ -20,7 +20,7 @@ static ewol::Widget* create(void) {
|
||||
return new ewol::widget::Spacer();
|
||||
}
|
||||
|
||||
void ewol::widget::Spacer::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::Spacer::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&create);
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ void ewol::widget::Spacer::onRegenerateDisplay(void) {
|
||||
m_draw.rectangleWidth(vec3(m_size.x(), m_size.y(),0) );
|
||||
}
|
||||
|
||||
bool ewol::widget::Spacer::onSetConfig(const ewol::EConfig& _conf) {
|
||||
bool ewol::widget::Spacer::onSetConfig(const ewol::object::Config& _conf) {
|
||||
if (true == ewol::Widget::onSetConfig(_conf)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace widget {
|
||||
@ -23,11 +23,11 @@ namespace ewol {
|
||||
*/
|
||||
class Spacer :public ewol::Widget {
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
// Config list of properties
|
||||
static const char* const configColor;
|
||||
private:
|
||||
ewol::Drawing m_draw; //!< Compositing drawing element
|
||||
ewol::compositing::Drawing m_draw; //!< Compositing drawing element
|
||||
public:
|
||||
/**
|
||||
* @brief Main constructer
|
||||
@ -49,7 +49,7 @@ namespace ewol {
|
||||
virtual ewol::Widget * getWidgetAtPos(const vec2& _pos) { return NULL; };
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual void onDraw(void);
|
||||
virtual bool onSetConfig(const ewol::EConfig& _conf);
|
||||
virtual bool onSetConfig(const ewol::object::Config& _conf);
|
||||
virtual bool onGetConfig(const char* _config, std::string& _result) const;
|
||||
};
|
||||
};
|
||||
|
@ -33,7 +33,7 @@ static ewol::Widget* create(void) {
|
||||
return new ewol::widget::WSlider();
|
||||
}
|
||||
|
||||
void ewol::widget::WSlider::init(ewol::WidgetManager& _widgetManager) {
|
||||
void ewol::widget::WSlider::init(ewol::widget::Manager& _widgetManager) {
|
||||
_widgetManager.addWidgetCreator(__class__,&create);
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ ewol::widget::WSlider::~WSlider(void) {
|
||||
|
||||
void ewol::widget::WSlider::calculateSize(const vec2& _availlable) {
|
||||
//EWOL_DEBUG("Update size");
|
||||
widget::ContainerN::calculateSize(_availlable);
|
||||
ewol::widget::ContainerN::calculateSize(_availlable);
|
||||
|
||||
if (m_windowsDestination == m_windowsSources) {
|
||||
int32_t iii = m_windowsDestination;
|
||||
@ -169,7 +169,7 @@ void ewol::widget::WSlider::setTransitionMode(enum sladingMode _mode) {
|
||||
}
|
||||
}
|
||||
|
||||
void ewol::widget::WSlider::periodicCall(const ewol::EventTime& _event) {
|
||||
void ewol::widget::WSlider::periodicCall(const ewol::event::Time& _event) {
|
||||
if (m_slidingProgress >= 1.0) {
|
||||
m_windowsSources = m_windowsDestination;
|
||||
if( m_windowsRequested != -1
|
||||
@ -265,8 +265,8 @@ void ewol::widget::WSlider::onRegenerateDisplay(void) {
|
||||
}
|
||||
}
|
||||
|
||||
bool ewol::widget::WSlider::onSetConfig(const ewol::EConfig& _conf) {
|
||||
if (true == widget::ContainerN::onSetConfig(_conf)) {
|
||||
bool ewol::widget::WSlider::onSetConfig(const ewol::object::Config& _conf) {
|
||||
if (true == ewol::widget::ContainerN::onSetConfig(_conf)) {
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == configMode) {
|
||||
@ -283,7 +283,7 @@ bool ewol::widget::WSlider::onSetConfig(const ewol::EConfig& _conf) {
|
||||
}
|
||||
|
||||
bool ewol::widget::WSlider::onGetConfig(const char* _config, std::string& _result) const {
|
||||
if (true == widget::ContainerN::onGetConfig(_config, _result)) {
|
||||
if (true == ewol::widget::ContainerN::onGetConfig(_config, _result)) {
|
||||
return true;
|
||||
}
|
||||
if (_config == configMode) {
|
||||
|
@ -12,16 +12,16 @@
|
||||
#include <etk/types.h>
|
||||
#include <ewol/debug.h>
|
||||
#include <ewol/widget/ContainerN.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
namespace ewol {
|
||||
namespace widget {
|
||||
/**
|
||||
* @ingroup ewolWidgetGroup
|
||||
*/
|
||||
class WSlider :public widget::ContainerN {
|
||||
class WSlider :public ewol::widget::ContainerN {
|
||||
public:
|
||||
static void init(ewol::WidgetManager& _widgetManager);
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
// Event list of properties
|
||||
static const char* const eventStartSlide;
|
||||
static const char* const eventStopSlide;
|
||||
@ -93,8 +93,8 @@ namespace ewol {
|
||||
virtual void systemDraw(const ewol::DrawProperty& _displayProp);
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual ewol::Widget* getWidgetAtPos(const vec2& _pos);
|
||||
virtual void periodicCall(const ewol::EventTime& _event);
|
||||
virtual bool onSetConfig(const ewol::EConfig& _conf);
|
||||
virtual void periodicCall(const ewol::event::Time& _event);
|
||||
virtual bool onSetConfig(const ewol::object::Config& _conf);
|
||||
virtual bool onGetConfig(const char* _config, std::string& _result) const;
|
||||
};
|
||||
};
|
||||
|
@ -7,11 +7,11 @@
|
||||
*/
|
||||
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <ewol/renderer/EObjectManager.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/object/Manager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/renderer/openGL.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
#include <ewol/openGL/openGL.h>
|
||||
#include <ewol/context/Context.h>
|
||||
|
||||
#undef __class__
|
||||
#define __class__ "DrawProperty"
|
||||
@ -126,7 +126,7 @@ ewol::Widget::Widget(void) :
|
||||
m_periodicCallTime(0),
|
||||
m_needRegenerateDisplay(true),
|
||||
m_grabCursor(false),
|
||||
m_cursorDisplay(ewol::cursorArrow),
|
||||
m_cursorDisplay(ewol::context::cursorArrow),
|
||||
m_annimationMode(annimationModeDisable),
|
||||
m_annimationratio(0.0f) {
|
||||
m_annimationType[0] = NULL;
|
||||
@ -171,7 +171,7 @@ void ewol::Widget::setUpperWidget(ewol::Widget* _upper) {
|
||||
m_up = _upper;
|
||||
}
|
||||
|
||||
void ewol::Widget::onObjectRemove(ewol::EObject* _removeObject) {
|
||||
void ewol::Widget::onObjectRemove(ewol::Object* _removeObject) {
|
||||
if (_removeObject == m_up) {
|
||||
EWOL_WARNING("[" << getId() << "] remove upper widget befor removing this widget ...");
|
||||
m_up = NULL;
|
||||
@ -549,74 +549,74 @@ void ewol::Widget::shortCutAdd(const char * _descriptiveString,
|
||||
//"ctrl+shift+alt+meta+s"
|
||||
const char * tmp = strstr(_descriptiveString, "ctrl");
|
||||
if(NULL != tmp) {
|
||||
tmpElement->specialKey.ctrl = true;
|
||||
tmpElement->specialKey.setCtrl(true);
|
||||
}
|
||||
tmp = strstr(_descriptiveString, "shift");
|
||||
if(NULL != tmp) {
|
||||
tmpElement->specialKey.shift = true;
|
||||
tmpElement->specialKey.setShift(true);
|
||||
}
|
||||
tmp = strstr(_descriptiveString, "alt");
|
||||
if(NULL != tmp) {
|
||||
tmpElement->specialKey.alt = true;
|
||||
tmpElement->specialKey.setAlt(true);
|
||||
}
|
||||
tmp = strstr(_descriptiveString, "meta");
|
||||
if(NULL != tmp) {
|
||||
tmpElement->specialKey.meta = true;
|
||||
tmpElement->specialKey.setMeta(true);
|
||||
}
|
||||
if(NULL != strstr(_descriptiveString, "F12") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardF12;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardF12;
|
||||
} else if(NULL != strstr(_descriptiveString, "F11") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardF11;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardF11;
|
||||
} else if(NULL != strstr(_descriptiveString, "F10") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardF10;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardF10;
|
||||
} else if(NULL != strstr(_descriptiveString, "F9") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardF9;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardF9;
|
||||
} else if(NULL != strstr(_descriptiveString, "F8") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardF8;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardF8;
|
||||
} else if(NULL != strstr(_descriptiveString, "F7") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardF7;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardF7;
|
||||
} else if(NULL != strstr(_descriptiveString, "F6") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardF6;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardF6;
|
||||
} else if(NULL != strstr(_descriptiveString, "F5") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardF5;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardF5;
|
||||
} else if(NULL != strstr(_descriptiveString, "F4") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardF4;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardF4;
|
||||
} else if(NULL != strstr(_descriptiveString, "F3") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardF3;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardF3;
|
||||
} else if(NULL != strstr(_descriptiveString, "F2") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardF2;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardF2;
|
||||
} else if(NULL != strstr(_descriptiveString, "F1") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardF1;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardF1;
|
||||
} else if(NULL != strstr(_descriptiveString, "LEFT") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardLeft;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardLeft;
|
||||
} else if(NULL != strstr(_descriptiveString, "RIGHT") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardRight;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardRight;
|
||||
} else if(NULL != strstr(_descriptiveString, "UP") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardUp;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardUp;
|
||||
} else if(NULL != strstr(_descriptiveString, "DOWN") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardDown;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardDown;
|
||||
} else if(NULL != strstr(_descriptiveString, "PAGE_UP") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardPageUp;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardPageUp;
|
||||
} else if(NULL != strstr(_descriptiveString, "PAGE_DOWN") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardPageDown;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardPageDown;
|
||||
} else if(NULL != strstr(_descriptiveString, "START") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardStart;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardStart;
|
||||
} else if(NULL != strstr(_descriptiveString, "END") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardEnd;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardEnd;
|
||||
} else if(NULL != strstr(_descriptiveString, "PRINT") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardPrint;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardPrint;
|
||||
} else if(NULL != strstr(_descriptiveString, "ARRET_DEFIL") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardStopDefil;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardStopDefil;
|
||||
} else if(NULL != strstr(_descriptiveString, "WAIT") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardWait;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardWait;
|
||||
} else if(NULL != strstr(_descriptiveString, "INSERT") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardInsert;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardInsert;
|
||||
} else if(NULL != strstr(_descriptiveString, "CAPLOCK") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardCapLock;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardCapLock;
|
||||
} else if(NULL != strstr(_descriptiveString, "CONTEXT_MENU") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardContextMenu;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardContextMenu;
|
||||
} else if(NULL != strstr(_descriptiveString, "NUM_LOCK") ) {
|
||||
tmpElement->keyboardMoveValue = ewol::keyEvent::keyboardNumLock;
|
||||
tmpElement->keyboardMoveValue = ewol::key::keyboardNumLock;
|
||||
} else {
|
||||
tmpElement->unicodeValue = _descriptiveString[strlen(_descriptiveString) -1];
|
||||
}
|
||||
@ -634,9 +634,9 @@ void ewol::Widget::shortCutClean(void) {
|
||||
m_localShortcut.clear();
|
||||
}
|
||||
|
||||
bool ewol::Widget::onEventShortCut(ewol::SpecialKey& _special,
|
||||
bool ewol::Widget::onEventShortCut(ewol::key::Special& _special,
|
||||
char32_t _unicodeValue,
|
||||
enum ewol::keyEvent::keyboard _kbMove,
|
||||
enum ewol::key::keyboard _kbMove,
|
||||
bool _isDown) {
|
||||
if (_unicodeValue >= 'A' && _unicodeValue <= 'Z') {
|
||||
_unicodeValue += 'a' - 'A';
|
||||
@ -644,11 +644,11 @@ bool ewol::Widget::onEventShortCut(ewol::SpecialKey& _special,
|
||||
//EWOL_INFO("Try to find generic shortcut ...");
|
||||
for(int32_t iii=m_localShortcut.size()-1; iii >= 0; iii--) {
|
||||
if(NULL != m_localShortcut[iii]) {
|
||||
if( m_localShortcut[iii]->specialKey.shift == _special.shift
|
||||
&& m_localShortcut[iii]->specialKey.ctrl == _special.ctrl
|
||||
&& m_localShortcut[iii]->specialKey.alt == _special.alt
|
||||
&& m_localShortcut[iii]->specialKey.meta == _special.meta
|
||||
&& ( ( m_localShortcut[iii]->keyboardMoveValue == ewol::keyEvent::keyboardUnknow
|
||||
if( m_localShortcut[iii]->specialKey.getShift() == _special.getShift()
|
||||
&& m_localShortcut[iii]->specialKey.getCtrl() == _special.getCtrl()
|
||||
&& m_localShortcut[iii]->specialKey.getAlt() == _special.getAlt()
|
||||
&& m_localShortcut[iii]->specialKey.getMeta() == _special.getMeta()
|
||||
&& ( ( m_localShortcut[iii]->keyboardMoveValue == ewol::key::keyboardUnknow
|
||||
&& m_localShortcut[iii]->unicodeValue == _unicodeValue)
|
||||
|| ( m_localShortcut[iii]->keyboardMoveValue == _kbMove
|
||||
&& m_localShortcut[iii]->unicodeValue == 0)
|
||||
@ -659,7 +659,7 @@ bool ewol::Widget::onEventShortCut(ewol::SpecialKey& _special,
|
||||
sendMultiCast(m_localShortcut[iii]->generateEventId, m_localShortcut[iii]->eventData);
|
||||
}
|
||||
// send message direct to the current widget (in every case, really useful for some generic windows shortcut)
|
||||
ewol::EMessage tmpMsg(this, m_localShortcut[iii]->generateEventId, m_localShortcut[iii]->eventData);
|
||||
ewol::object::Message tmpMsg(this, m_localShortcut[iii]->generateEventId, m_localShortcut[iii]->eventData);
|
||||
onReceiveMessage(tmpMsg);
|
||||
} // no else
|
||||
return true;
|
||||
@ -688,19 +688,19 @@ bool ewol::Widget::getGrabStatus(void) {
|
||||
return m_grabCursor;
|
||||
}
|
||||
|
||||
void ewol::Widget::setCursor(enum ewol::cursorDisplay _newCursor) {
|
||||
void ewol::Widget::setCursor(enum ewol::context::cursorDisplay _newCursor) {
|
||||
EWOL_DEBUG("Change Cursor in " << _newCursor);
|
||||
m_cursorDisplay = _newCursor;
|
||||
getContext().setCursor(m_cursorDisplay);
|
||||
}
|
||||
|
||||
enum ewol::cursorDisplay ewol::Widget::getCursor(void) {
|
||||
enum ewol::context::cursorDisplay ewol::Widget::getCursor(void) {
|
||||
return m_cursorDisplay;
|
||||
}
|
||||
|
||||
bool ewol::Widget::loadXML(exml::Element* _node) {
|
||||
// Call EObject basic parser
|
||||
ewol::EObject::loadXML(_node); // note : load standard parameters (attribute in XML)
|
||||
ewol::Object::loadXML(_node); // note : load standard parameters (attribute in XML)
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
@ -713,7 +713,7 @@ ewol::Widget* ewol::Widget::getWidgetNamed(const std::string& _widgetName) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool ewol::Widget::systemEventEntry(ewol::EventEntrySystem& _event) {
|
||||
bool ewol::Widget::systemEventEntry(ewol::event::EntrySystem& _event) {
|
||||
if (NULL != m_up) {
|
||||
if (true == m_up->systemEventEntry(_event)) {
|
||||
return true;
|
||||
@ -722,7 +722,7 @@ bool ewol::Widget::systemEventEntry(ewol::EventEntrySystem& _event) {
|
||||
return onEventEntry(_event.m_event);
|
||||
}
|
||||
|
||||
bool ewol::Widget::systemEventInput(ewol::EventInputSystem& _event) {
|
||||
bool ewol::Widget::systemEventInput(ewol::event::InputSystem& _event) {
|
||||
if (NULL != m_up) {
|
||||
if (true == m_up->systemEventInput(_event)) {
|
||||
return true;
|
||||
@ -736,8 +736,8 @@ void ewol::Widget::setGravity(enum gravity _gravity) {
|
||||
markToRedraw();
|
||||
}
|
||||
|
||||
bool ewol::Widget::onSetConfig(const ewol::EConfig& _conf) {
|
||||
if (true == ewol::EObject::onSetConfig(_conf)) {
|
||||
bool ewol::Widget::onSetConfig(const ewol::object::Config& _conf) {
|
||||
if (true == ewol::Object::onSetConfig(_conf)) {
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == ewol::Widget::configFill) {
|
||||
@ -796,7 +796,7 @@ bool ewol::Widget::onSetConfig(const ewol::EConfig& _conf) {
|
||||
}
|
||||
|
||||
bool ewol::Widget::onGetConfig(const char* _config, std::string& _result) const {
|
||||
if (true == ewol::EObject::onGetConfig(_config, _result)) {
|
||||
if (true == ewol::Object::onGetConfig(_config, _result)) {
|
||||
return true;
|
||||
}
|
||||
if (_config == ewol::Widget::configFill) {
|
||||
@ -861,11 +861,11 @@ void ewol::Widget::requestUpdateSize(void) {
|
||||
getContext().requestUpdateSize();
|
||||
}
|
||||
|
||||
ewol::WidgetManager& ewol::Widget::getWidgetManager(void) {
|
||||
ewol::widget::Manager& ewol::Widget::getWidgetManager(void) {
|
||||
return getContext().getWidgetManager();
|
||||
}
|
||||
|
||||
ewol::Windows* ewol::Widget::getWindows(void) {
|
||||
ewol::widget::Windows* ewol::Widget::getWindows(void) {
|
||||
return getContext().getWindows();
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
#include <ewol/widget/WidgetScrolled.h>
|
||||
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/renderer/openGL.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/openGL/openGL.h>
|
||||
#include <ewol/ewol.h>
|
||||
|
||||
|
||||
@ -19,9 +19,9 @@ ewol::widget::WidgetScrooled::WidgetScrooled(void) {
|
||||
addObjectType("ewol::widget::WidgetScrooled");
|
||||
m_originScrooled.setValue(0,0);
|
||||
m_pixelScrolling = 20;
|
||||
m_highSpeedMode = widget::Scroll::speedModeDisable;
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeDisable;
|
||||
m_scroollingMode = scroolModeNormal;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
m_highSpeedType = ewol::key::typeUnknow;
|
||||
m_highSpeedButton = -1;
|
||||
m_limitScrolling = 0.5;
|
||||
}
|
||||
@ -67,23 +67,23 @@ void ewol::widget::WidgetScrooled::onRegenerateDisplay(void) {
|
||||
}
|
||||
}
|
||||
|
||||
bool ewol::widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::WidgetScrooled::onEventInput(const ewol::event::Input& _event) {
|
||||
EWOL_VERBOSE("event XXX " << _event);
|
||||
vec2 relativePos = relativePosition(_event.getPos());
|
||||
// corection due to the open Gl invertion ...
|
||||
relativePos.setY(m_size.y() - relativePos.y());
|
||||
if (m_scroollingMode == scroolModeNormal) {
|
||||
if ( _event.getType() == ewol::keyEvent::typeMouse
|
||||
&& ( m_highSpeedType == ewol::keyEvent::typeUnknow
|
||||
|| m_highSpeedType == ewol::keyEvent::typeMouse) ) {
|
||||
if ( _event.getType() == ewol::key::typeMouse
|
||||
&& ( m_highSpeedType == ewol::key::typeUnknow
|
||||
|| m_highSpeedType == ewol::key::typeMouse) ) {
|
||||
if ( _event.getId() == 1
|
||||
&& _event.getStatus() == ewol::keyEvent::statusDown) {
|
||||
&& _event.getStatus() == ewol::key::statusDown) {
|
||||
// check if selected the scrolling position whth the scrolling bar ...
|
||||
if (relativePos.x() >= (m_size.x()-SCROLL_BAR_SPACE)) {
|
||||
if( m_size.y() < m_maxSize.y()
|
||||
|| m_originScrooled.y() != 0) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableVertical;
|
||||
m_highSpeedType = ewol::keyEvent::typeMouse;
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeEnableVertical;
|
||||
m_highSpeedType = ewol::key::typeMouse;
|
||||
m_highSpeedStartPos.setX(relativePos.x());
|
||||
m_highSpeedStartPos.setY(m_originScrooled.y() / m_maxSize.y() * (m_size.y()-SCROLL_BAR_SPACE*2));
|
||||
m_highSpeedButton = 1;
|
||||
@ -96,8 +96,8 @@ bool ewol::widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event)
|
||||
} else if (relativePos.y() >= (m_size.y()-SCROLL_BAR_SPACE)) {
|
||||
if( m_size.x() < m_maxSize.x()
|
||||
|| m_originScrooled.x()!=0) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableHorizontal;
|
||||
m_highSpeedType = ewol::keyEvent::typeMouse;
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeEnableHorizontal;
|
||||
m_highSpeedType = ewol::key::typeMouse;
|
||||
m_highSpeedStartPos.setX(m_originScrooled.x() / m_maxSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2));
|
||||
m_highSpeedStartPos.setY(relativePos.y());
|
||||
m_highSpeedButton = 1;
|
||||
@ -110,7 +110,7 @@ bool ewol::widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event)
|
||||
}
|
||||
return false;
|
||||
} else if ( _event.getId() == 4
|
||||
&& _event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
&& _event.getStatus() == ewol::key::statusUp) {
|
||||
/*
|
||||
if (true == ewol::isSetCtrl()) {
|
||||
float zoom = getZoom()*1.1;
|
||||
@ -127,7 +127,7 @@ bool ewol::widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event)
|
||||
}
|
||||
}
|
||||
} else if ( _event.getId() == 5
|
||||
&& _event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
&& _event.getStatus() == ewol::key::statusUp) {
|
||||
/*
|
||||
if (true == ewol::isSetCtrl()) {
|
||||
float zoom = getZoom()*0.9;
|
||||
@ -144,7 +144,7 @@ bool ewol::widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event)
|
||||
}
|
||||
}
|
||||
} else if ( _event.getId() == 11
|
||||
&& _event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
&& _event.getStatus() == ewol::key::statusUp) {
|
||||
// Scrool Left
|
||||
if(m_size.x() < m_maxSize.x()
|
||||
|| m_originScrooled.x()!=0
|
||||
@ -155,7 +155,7 @@ bool ewol::widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event)
|
||||
return true;
|
||||
}
|
||||
} else if ( _event.getId() == 10
|
||||
&& _event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
&& _event.getStatus() == ewol::key::statusUp) {
|
||||
// Scrool Right
|
||||
if(m_size.x() < m_maxSize.x()
|
||||
|| m_originScrooled.x()!=0
|
||||
@ -168,67 +168,67 @@ bool ewol::widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event)
|
||||
}else if (_event.getId() == 2) {
|
||||
/*
|
||||
if (true == ewol::isSetCtrl()) {
|
||||
if (ewol::keyEvent::statusDown == typeEvent) {
|
||||
if (ewol::key::statusDown == typeEvent) {
|
||||
float zoom = 1.0;
|
||||
setZoom(zoom);
|
||||
}
|
||||
} else */{
|
||||
if (_event.getStatus() == ewol::keyEvent::statusDown) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeInit;
|
||||
m_highSpeedType = ewol::keyEvent::typeMouse;
|
||||
if (_event.getStatus() == ewol::key::statusDown) {
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeInit;
|
||||
m_highSpeedType = ewol::key::typeMouse;
|
||||
m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y());
|
||||
m_highSpeedButton = 2;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if ( m_highSpeedMode != widget::Scroll::speedModeDisable
|
||||
&& _event.getStatus() == ewol::keyEvent::statusLeave) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
} else if ( m_highSpeedMode != ewol::widget::Scroll::speedModeDisable
|
||||
&& _event.getStatus() == ewol::key::statusLeave) {
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::key::typeUnknow;
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
if ( _event.getId() == m_highSpeedButton
|
||||
&& m_highSpeedMode != widget::Scroll::speedModeDisable) {
|
||||
if (_event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
if (m_highSpeedMode == widget::Scroll::speedModeInit) {
|
||||
&& m_highSpeedMode != ewol::widget::Scroll::speedModeDisable) {
|
||||
if (_event.getStatus() == ewol::key::statusUp) {
|
||||
if (m_highSpeedMode == ewol::widget::Scroll::speedModeInit) {
|
||||
// TODO : generate back the down event ...
|
||||
m_highSpeedMode = widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::key::typeUnknow;
|
||||
return false;
|
||||
} else {
|
||||
m_highSpeedMode = widget::Scroll::speedModeGrepEndEvent;
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeGrepEndEvent;
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
} else if (m_highSpeedMode == widget::Scroll::speedModeGrepEndEvent) {
|
||||
if (_event.getStatus() == ewol::keyEvent::statusSingle) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
} else if (m_highSpeedMode == ewol::widget::Scroll::speedModeGrepEndEvent) {
|
||||
if (_event.getStatus() == ewol::key::statusSingle) {
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::key::typeUnknow;
|
||||
m_highSpeedButton = -1;
|
||||
markToRedraw();
|
||||
}
|
||||
return true;
|
||||
} else if ( m_highSpeedMode == widget::Scroll::speedModeInit
|
||||
&& _event.getStatus() == ewol::keyEvent::statusMove) {
|
||||
} else if ( m_highSpeedMode == ewol::widget::Scroll::speedModeInit
|
||||
&& _event.getStatus() == ewol::key::statusMove) {
|
||||
// wait that the cursor move more than 10 px to enable it :
|
||||
if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10
|
||||
|| abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) {
|
||||
// the scrooling can start :
|
||||
// select the direction :
|
||||
if (relativePos.x() == m_highSpeedStartPos.x()) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableVertical;
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeEnableVertical;
|
||||
} else if (relativePos.y() == m_highSpeedStartPos.y()) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableHorizontal;
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeEnableHorizontal;
|
||||
} else {
|
||||
float coef = (relativePos.y() - m_highSpeedStartPos.y()) / (relativePos.x() - m_highSpeedStartPos.x());
|
||||
if (abs(coef) <= 1 ) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableHorizontal;
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeEnableHorizontal;
|
||||
} else {
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableVertical;
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeEnableVertical;
|
||||
}
|
||||
}
|
||||
if (m_highSpeedMode == widget::Scroll::speedModeEnableHorizontal) {
|
||||
if (m_highSpeedMode == ewol::widget::Scroll::speedModeEnableHorizontal) {
|
||||
m_highSpeedStartPos.setX(m_originScrooled.x() / m_maxSize.x() * (m_size.x()-SCROLL_BAR_SPACE*2));
|
||||
} else {
|
||||
m_highSpeedStartPos.setY(m_originScrooled.y() / m_maxSize.y() * (m_size.y()-SCROLL_BAR_SPACE*2));
|
||||
@ -238,52 +238,52 @@ bool ewol::widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event)
|
||||
m_originScrooled.setY(etk_avg(0, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling)));
|
||||
return true;
|
||||
}
|
||||
if ( m_highSpeedMode == widget::Scroll::speedModeEnableHorizontal
|
||||
&& _event.getStatus() == ewol::keyEvent::statusMove) {
|
||||
if ( m_highSpeedMode == ewol::widget::Scroll::speedModeEnableHorizontal
|
||||
&& _event.getStatus() == ewol::key::statusMove) {
|
||||
m_originScrooled.setX((int32_t)(m_maxSize.x() * (relativePos.x()-SCROLL_BAR_SPACE) / (m_size.x()-SCROLL_BAR_SPACE*2)));
|
||||
m_originScrooled.setX(etk_avg(0, m_originScrooled.x(), (m_maxSize.x() - m_size.x()*m_limitScrolling)));
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
if ( m_highSpeedMode == widget::Scroll::speedModeEnableVertical
|
||||
&& _event.getStatus() == ewol::keyEvent::statusMove) {
|
||||
if ( m_highSpeedMode == ewol::widget::Scroll::speedModeEnableVertical
|
||||
&& _event.getStatus() == ewol::key::statusMove) {
|
||||
m_originScrooled.setY((int32_t)(m_maxSize.y() * (relativePos.y()-SCROLL_BAR_SPACE) / (m_size.y()-SCROLL_BAR_SPACE*2)));
|
||||
m_originScrooled.setY(etk_avg(0, m_originScrooled.y(), (m_maxSize.y() - m_size.y()*m_limitScrolling)));
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if ( _event.getType() == ewol::keyEvent::typeFinger
|
||||
&& ( m_highSpeedType == ewol::keyEvent::typeUnknow
|
||||
|| m_highSpeedType == ewol::keyEvent::typeFinger) ) {
|
||||
} else if ( _event.getType() == ewol::key::typeFinger
|
||||
&& ( m_highSpeedType == ewol::key::typeUnknow
|
||||
|| m_highSpeedType == ewol::key::typeFinger) ) {
|
||||
if (_event.getId() == 1) {
|
||||
EWOL_VERBOSE("event 1 " << _event);
|
||||
if (_event.getStatus() == ewol::keyEvent::statusDown) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeInit;
|
||||
m_highSpeedType = ewol::keyEvent::typeFinger;
|
||||
if (_event.getStatus() == ewol::key::statusDown) {
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeInit;
|
||||
m_highSpeedType = ewol::key::typeFinger;
|
||||
m_highSpeedStartPos.setValue(relativePos.x(), relativePos.y());
|
||||
EWOL_DEBUG("SCROOL == > INIT");
|
||||
return true;
|
||||
} else if (_event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
} else if (_event.getStatus() == ewol::key::statusUp) {
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::key::typeUnknow;
|
||||
EWOL_DEBUG("SCROOL == > DISABLE");
|
||||
markToRedraw();
|
||||
return true;
|
||||
} else if ( m_highSpeedMode == widget::Scroll::speedModeInit
|
||||
&& _event.getStatus() == ewol::keyEvent::statusMove) {
|
||||
} else if ( m_highSpeedMode == ewol::widget::Scroll::speedModeInit
|
||||
&& _event.getStatus() == ewol::key::statusMove) {
|
||||
// wait that the cursor move more than 10 px to enable it :
|
||||
if( abs(relativePos.x() - m_highSpeedStartPos.x()) > 10
|
||||
|| abs(relativePos.y() - m_highSpeedStartPos.y()) > 10 ) {
|
||||
// the scrooling can start :
|
||||
// select the direction :
|
||||
m_highSpeedMode = widget::Scroll::speedModeEnableFinger;
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeEnableFinger;
|
||||
EWOL_DEBUG("SCROOL == > ENABLE");
|
||||
markToRedraw();
|
||||
}
|
||||
return true;
|
||||
} if ( m_highSpeedMode == widget::Scroll::speedModeEnableFinger
|
||||
&& _event.getStatus() == ewol::keyEvent::statusMove) {
|
||||
} if ( m_highSpeedMode == ewol::widget::Scroll::speedModeEnableFinger
|
||||
&& _event.getStatus() == ewol::key::statusMove) {
|
||||
//m_originScrooled.x = (int32_t)(m_maxSize.x * x / m_size.x);
|
||||
m_originScrooled.setX(m_originScrooled.x() - (relativePos.x() - m_highSpeedStartPos.x()));
|
||||
m_originScrooled.setY(m_originScrooled.y() - (relativePos.y() - m_highSpeedStartPos.y()));
|
||||
@ -294,23 +294,23 @@ bool ewol::widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event)
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
} else if ( m_highSpeedMode == widget::Scroll::speedModeDisable
|
||||
&& _event.getStatus() == ewol::keyEvent::statusLeave) {
|
||||
m_highSpeedMode = widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::keyEvent::typeUnknow;
|
||||
} else if ( m_highSpeedMode == ewol::widget::Scroll::speedModeDisable
|
||||
&& _event.getStatus() == ewol::key::statusLeave) {
|
||||
m_highSpeedMode = ewol::widget::Scroll::speedModeDisable;
|
||||
m_highSpeedType = ewol::key::typeUnknow;
|
||||
EWOL_DEBUG("SCROOL == > DISABLE");
|
||||
markToRedraw();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if (m_scroollingMode == scroolModeCenter) {
|
||||
if (_event.getType() == ewol::keyEvent::typeMouse) {
|
||||
if (_event.getType() == ewol::key::typeMouse) {
|
||||
float tmp1=m_size.x() / m_maxSize.y();
|
||||
float tmp2=m_size.y() / m_maxSize.x();
|
||||
//EWOL_INFO(" elements Zoom : " << tmp1 << " " << tmp2);
|
||||
tmp1 = etk_min(tmp1, tmp2);
|
||||
if ( _event.getId() == 4
|
||||
&& _event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
&& _event.getStatus() == ewol::key::statusUp) {
|
||||
m_zoom -= 0.1;
|
||||
if (tmp1 < 1.0) {
|
||||
m_zoom = etk_max(tmp1, m_zoom);
|
||||
@ -320,7 +320,7 @@ bool ewol::widget::WidgetScrooled::onEventInput(const ewol::EventInput& _event)
|
||||
markToRedraw();
|
||||
return true;
|
||||
} else if ( _event.getId() == 5
|
||||
&& _event.getStatus() == ewol::keyEvent::statusUp) {
|
||||
&& _event.getStatus() == ewol::key::statusUp) {
|
||||
m_zoom += 0.1;
|
||||
if (tmp1 > 1.0) {
|
||||
m_zoom = etk_min(tmp1, m_zoom);
|
||||
|
@ -28,7 +28,7 @@ namespace ewol {
|
||||
scroolModeGame, //!< Zoom enable, no move left and right
|
||||
};
|
||||
private:
|
||||
ewol::Drawing m_drawing; //!< generic element to display...
|
||||
ewol::compositing::Drawing m_drawing; //!< generic element to display...
|
||||
protected:
|
||||
vec2 m_originScrooled; //!< pixel distance from the origin of the display (Bottum left)
|
||||
vec2 m_maxSize; //!< Maximum size of the Widget ==> to display scrollbar
|
||||
@ -39,7 +39,7 @@ namespace ewol {
|
||||
vec2 m_highSpeedStartPos;
|
||||
enum Scroll::highSpeedMode m_highSpeedMode;
|
||||
int32_t m_highSpeedButton;
|
||||
enum ewol::keyEvent::type m_highSpeedType;
|
||||
enum ewol::key::type m_highSpeedType;
|
||||
public:
|
||||
/**
|
||||
* @brief Scroll Widget main constructor to be herited from an other widget (this is not a stand-alone widget)
|
||||
@ -53,7 +53,7 @@ namespace ewol {
|
||||
virtual void onDraw(void);
|
||||
public: // Derived function
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
virtual void systemDraw(const ewol::DrawProperty& _displayProp);
|
||||
protected:
|
||||
/**
|
||||
|
@ -9,11 +9,11 @@
|
||||
#include <etk/types.h>
|
||||
#include <etk/UString.h>
|
||||
#include <ewol/ewol.h>
|
||||
#include <ewol/renderer/openGL.h>
|
||||
#include <ewol/renderer/eContext.h>
|
||||
#include <ewol/openGL/openGL.h>
|
||||
#include <ewol/context/Context.h>
|
||||
#include <ewol/widget/Widget.h>
|
||||
#include <ewol/widget/Windows.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/widget/meta/StdPopUp.h>
|
||||
|
||||
#undef __class__
|
||||
@ -188,7 +188,7 @@ void ewol::widget::Windows::popUpWidgetPush(ewol::Widget* _widget) {
|
||||
getContext().resetIOEvent();
|
||||
}
|
||||
|
||||
void ewol::widget::Windows::onObjectRemove(ewol::EObject* _removeObject) {
|
||||
void ewol::widget::Windows::onObjectRemove(ewol::Object* _removeObject) {
|
||||
// First step call parrent :
|
||||
ewol::Widget::onObjectRemove(_removeObject);
|
||||
// second step find if in all the elements ...
|
||||
@ -222,7 +222,7 @@ void ewol::widget::Windows::setTitle(const std::string& _title) {
|
||||
|
||||
void ewol::widget::Windows::createPopUpMessage(enum popUpMessageType _type, const std::string& _message)
|
||||
{
|
||||
widget::StdPopUp* tmpPopUp = new widget::StdPopUp();
|
||||
ewol::widget::StdPopUp* tmpPopUp = new widget::StdPopUp();
|
||||
if (tmpPopUp == NULL) {
|
||||
EWOL_ERROR("Can not create a simple pop-up");
|
||||
return;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <ewol/widget/Sizer.h>
|
||||
#include <ewol/widget/List.h>
|
||||
#include <ewol/widget/Spacer.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
//#include <vector>
|
||||
#include <vector>
|
||||
|
||||
@ -123,7 +123,7 @@ etk::Color<> ewol::widget::ColorChooser::getColor(void) {
|
||||
}
|
||||
|
||||
|
||||
void ewol::widget::ColorChooser::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
void ewol::widget::ColorChooser::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
if (NULL == _msg.getCaller()) {
|
||||
return;
|
||||
}
|
||||
@ -171,7 +171,7 @@ void ewol::widget::ColorChooser::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
};
|
||||
|
||||
|
||||
void ewol::widget::ColorChooser::onObjectRemove(ewol::EObject * _removeObject) {
|
||||
void ewol::widget::ColorChooser::onObjectRemove(ewol::Object * _removeObject) {
|
||||
// First step call parrent :
|
||||
ewol::widget::Sizer::onObjectRemove(_removeObject);
|
||||
// second step find if in all the elements ...
|
||||
|
@ -31,8 +31,8 @@ namespace ewol {
|
||||
ColorChooser(void);
|
||||
~ColorChooser(void);
|
||||
public: // Derived function
|
||||
virtual void onReceiveMessage(const ewol::EMessage& _msg);
|
||||
virtual void onObjectRemove(ewol::EObject* _removeObject);
|
||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||
virtual void onObjectRemove(ewol::Object* _removeObject);
|
||||
public:
|
||||
void setColor(etk::Color<> _newColor);
|
||||
etk::Color<> getColor(void);
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <ewol/widget/Spacer.h>
|
||||
#include <ewol/widget/Image.h>
|
||||
#include <ewol/widget/Composer.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
//#include <vector>
|
||||
#include <vector>
|
||||
#include <etk/tool.h>
|
||||
@ -73,7 +73,7 @@ ewol::widget::FileChooser::FileChooser(void) {
|
||||
m_file = "";
|
||||
|
||||
/*
|
||||
SubWidgetSet(new widget::Composer(widget::Composer::String,
|
||||
SubWidgetSet(new ewol::widget::Composer(widget::Composer::String,
|
||||
"<composer>\n"
|
||||
" <sizer mode=\"vert\" lock=\"true\">\n"
|
||||
" <sizer mode=\"hori\">\n"
|
||||
@ -120,7 +120,7 @@ ewol::widget::FileChooser::FileChooser(void) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
mySizerVert->subWidgetAdd(mySizerHori);
|
||||
m_widgetCheckBox = new widget::CheckBox("Show hiden files");
|
||||
m_widgetCheckBox = new ewol::widget::CheckBox("Show hiden files");
|
||||
if (NULL == m_widgetCheckBox) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
@ -147,7 +147,7 @@ ewol::widget::FileChooser::FileChooser(void) {
|
||||
" <label>Validate</label>\n"
|
||||
" </sizer>\n"
|
||||
"</composer>\n"));
|
||||
m_widgetValidate->registerOnEvent(this, widget::Button::eventPressed, eventValidate);
|
||||
m_widgetValidate->registerOnEvent(this, ewol::widget::Button::eventPressed, eventValidate);
|
||||
mySizerHori->subWidgetAdd(m_widgetValidate);
|
||||
}
|
||||
m_widgetCancel = new ewol::widget::Button();
|
||||
@ -162,7 +162,7 @@ ewol::widget::FileChooser::FileChooser(void) {
|
||||
" <label>Cancel</label>\n"
|
||||
" </sizer>\n"
|
||||
"</composer>\n"));
|
||||
m_widgetCancel->registerOnEvent(this, widget::Button::eventPressed, eventCancel);
|
||||
m_widgetCancel->registerOnEvent(this, ewol::widget::Button::eventPressed, eventCancel);
|
||||
mySizerHori->subWidgetAdd(m_widgetCancel);
|
||||
}
|
||||
}
|
||||
@ -178,7 +178,7 @@ ewol::widget::FileChooser::FileChooser(void) {
|
||||
mySpacer->setMinSize(vec2(2,2));
|
||||
mySizerHori->subWidgetAdd(mySpacer);
|
||||
}
|
||||
m_widgetListFolder = new widget::ListFileSystem();
|
||||
m_widgetListFolder = new ewol::widget::ListFileSystem();
|
||||
if (NULL == m_widgetListFolder) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
@ -235,8 +235,8 @@ ewol::widget::FileChooser::FileChooser(void) {
|
||||
if (NULL == m_widgetCurrentFileName) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
m_widgetCurrentFileName->registerOnEvent(this, widget::Entry::eventModify, ewolEventFileChooserEntryFile);
|
||||
m_widgetCurrentFileName->registerOnEvent(this, widget::Entry::eventEnter, ewolEventFileChooserEntryFileEnter);
|
||||
m_widgetCurrentFileName->registerOnEvent(this, ewol::widget::Entry::eventModify, ewolEventFileChooserEntryFile);
|
||||
m_widgetCurrentFileName->registerOnEvent(this, ewol::widget::Entry::eventEnter, ewolEventFileChooserEntryFileEnter);
|
||||
m_widgetCurrentFileName->setExpand(bvec2(true,false));
|
||||
m_widgetCurrentFileName->setFill(bvec2(true,false));
|
||||
//m_widgetCurrentFileName->setWidth(200);
|
||||
@ -261,8 +261,8 @@ ewol::widget::FileChooser::FileChooser(void) {
|
||||
if (NULL == m_widgetCurrentFolder) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
m_widgetCurrentFolder->registerOnEvent(this, widget::Entry::eventModify, ewolEventFileChooserEntryFolder);
|
||||
m_widgetCurrentFolder->registerOnEvent(this, widget::Entry::eventEnter, ewolEventFileChooserEntryFolderEnter);
|
||||
m_widgetCurrentFolder->registerOnEvent(this, ewol::widget::Entry::eventModify, ewolEventFileChooserEntryFolder);
|
||||
m_widgetCurrentFolder->registerOnEvent(this, ewol::widget::Entry::eventEnter, ewolEventFileChooserEntryFolderEnter);
|
||||
m_widgetCurrentFolder->setExpand(bvec2(true,false));
|
||||
m_widgetCurrentFolder->setFill(bvec2(true,false));
|
||||
//m_widgetCurrentFolder->setWidth(200);
|
||||
@ -273,7 +273,7 @@ ewol::widget::FileChooser::FileChooser(void) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
myImage->setImageSize(ewol::Dimension(vec2(8,8),ewol::Dimension::Millimeter));
|
||||
myImage->registerOnEvent(this, widget::Image::eventPressed, ewolEventFileChooserHome);
|
||||
myImage->registerOnEvent(this, ewol::widget::Image::eventPressed, ewolEventFileChooserHome);
|
||||
//myImage->setExpand(bvec2(false,true));
|
||||
mySizerHori->subWidgetAdd(myImage);
|
||||
}
|
||||
@ -335,7 +335,7 @@ void ewol::widget::FileChooser::setFileName(const std::string& _filename) {
|
||||
m_widgetCurrentFileName->setValue(_filename);
|
||||
}
|
||||
|
||||
void ewol::widget::FileChooser::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
void ewol::widget::FileChooser::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
EWOL_INFO("Receive Event from the LIST ... : " << _msg);
|
||||
if (ewolEventFileChooserEntryFolder == _msg.getMessage()) {
|
||||
// == > change the folder name
|
||||
@ -434,9 +434,9 @@ std::string ewol::widget::FileChooser::getCompleateFileName(void) {
|
||||
* @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 ewol::widget::FileChooser::onObjectRemove(ewol::EObject * removeObject) {
|
||||
void ewol::widget::FileChooser::onObjectRemove(ewol::Object * removeObject) {
|
||||
// First step call parrent :
|
||||
widget::PopUp::onObjectRemove(removeObject);
|
||||
ewol::widget::PopUp::onObjectRemove(removeObject);
|
||||
// second step find if in all the elements ...
|
||||
if(removeObject == m_widgetTitle) {
|
||||
m_widgetTitle = NULL;
|
||||
|
@ -52,8 +52,8 @@ namespace ewol {
|
||||
std::string getCompleateFileName(void);
|
||||
void updateCurrentFolder(void);
|
||||
public: // Derived function
|
||||
virtual void onReceiveMessage(const ewol::EMessage& _msg);
|
||||
virtual void onObjectRemove(ewol::EObject* _removeObject);
|
||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||
virtual void onObjectRemove(ewol::Object* _removeObject);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <ewol/widget/List.h>
|
||||
#include <ewol/widget/Spacer.h>
|
||||
#include <ewol/widget/Image.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/widget/Composer.h>
|
||||
#include <vector>
|
||||
|
||||
@ -35,16 +35,16 @@ ewol::widget::Parameter::Parameter(void) :
|
||||
addObjectType("ewol::widget::Parameter");
|
||||
addEventId(ewolEventParameterClose);
|
||||
|
||||
widget::Sizer * mySizerVert = NULL;
|
||||
widget::Sizer * mySizerHori = NULL;
|
||||
widget::Spacer * mySpacer = NULL;
|
||||
ewol::widget::Sizer * mySizerVert = NULL;
|
||||
ewol::widget::Sizer * mySizerHori = NULL;
|
||||
ewol::widget::Spacer * mySpacer = NULL;
|
||||
#ifdef __TARGET_OS__Android
|
||||
setMinSize(ewol::Dimension(vec2(90, 90), ewol::Dimension::Pourcent));
|
||||
#else
|
||||
setMinSize(ewol::Dimension(vec2(80, 80), ewol::Dimension::Pourcent));
|
||||
#endif
|
||||
|
||||
mySizerVert = new widget::Sizer(widget::Sizer::modeVert);
|
||||
mySizerVert = new ewol::widget::Sizer(widget::Sizer::modeVert);
|
||||
if (NULL == mySizerVert) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
@ -54,13 +54,13 @@ ewol::widget::Parameter::Parameter(void) :
|
||||
// set it in the pop-up-system :
|
||||
setSubWidget(mySizerVert);
|
||||
|
||||
mySizerHori = new widget::Sizer(widget::Sizer::modeHori);
|
||||
mySizerHori = new ewol::widget::Sizer(widget::Sizer::modeHori);
|
||||
if (NULL == mySizerHori) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
mySizerVert->subWidgetAdd(mySizerHori);
|
||||
|
||||
mySpacer = new widget::Spacer();
|
||||
mySpacer = new ewol::widget::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
@ -68,23 +68,23 @@ ewol::widget::Parameter::Parameter(void) :
|
||||
mySizerHori->subWidgetAdd(mySpacer);
|
||||
}
|
||||
|
||||
widget::Button* tmpButton = new widget::Button();
|
||||
ewol::widget::Button* tmpButton = new widget::Button();
|
||||
if (NULL == tmpButton) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
tmpButton->setSubWidget(
|
||||
new widget::Composer(widget::Composer::String,
|
||||
new ewol::widget::Composer(widget::Composer::String,
|
||||
"<composer>\n"
|
||||
" <sizer mode=\"hori\">\n"
|
||||
" <image src=\"THEME:GUI:Save.svg\" expand=\"true\" size=\"8,8mm\"/>\n"
|
||||
" <label>Save</label>\n"
|
||||
" </sizer>\n"
|
||||
"</composer>\n"));
|
||||
tmpButton->registerOnEvent(this, widget::Button::eventPressed, ewolEventParameterSave);
|
||||
tmpButton->registerOnEvent(this, ewol::widget::Button::eventPressed, ewolEventParameterSave);
|
||||
mySizerHori->subWidgetAdd(tmpButton);
|
||||
}
|
||||
|
||||
mySpacer = new widget::Spacer();
|
||||
mySpacer = new ewol::widget::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
@ -93,24 +93,24 @@ ewol::widget::Parameter::Parameter(void) :
|
||||
mySizerHori->subWidgetAdd(mySpacer);
|
||||
}
|
||||
|
||||
tmpButton = new widget::Button();
|
||||
tmpButton = new ewol::widget::Button();
|
||||
if (NULL == tmpButton) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
tmpButton->setSubWidget(
|
||||
new widget::Composer(widget::Composer::String,
|
||||
new ewol::widget::Composer(widget::Composer::String,
|
||||
"<composer>\n"
|
||||
" <sizer mode=\"hori\">\n"
|
||||
" <image src=\"THEME:GUI:Remove.svg\" expand=\"true\" size=\"8,8mm\"/>\n"
|
||||
" <label>Close</label>\n"
|
||||
" </sizer>\n"
|
||||
"</composer>\n"));
|
||||
tmpButton->registerOnEvent(this, widget::Button::eventPressed, ewolEventParameterClose);
|
||||
tmpButton->registerOnEvent(this, ewol::widget::Button::eventPressed, ewolEventParameterClose);
|
||||
mySizerHori->subWidgetAdd(tmpButton);
|
||||
}
|
||||
}
|
||||
|
||||
mySizerHori = new widget::Sizer(widget::Sizer::modeHori);
|
||||
mySizerHori = new ewol::widget::Sizer(widget::Sizer::modeHori);
|
||||
if (NULL == mySizerHori) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
@ -126,7 +126,7 @@ ewol::widget::Parameter::Parameter(void) :
|
||||
m_paramList->setExpand(bvec2(false,true));
|
||||
mySizerHori->subWidgetAdd(m_paramList);
|
||||
}
|
||||
mySpacer = new widget::Spacer();
|
||||
mySpacer = new ewol::widget::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
@ -136,13 +136,13 @@ ewol::widget::Parameter::Parameter(void) :
|
||||
mySizerHori->subWidgetAdd(mySpacer);
|
||||
}
|
||||
|
||||
widget::Sizer * mySizerVert2 = new widget::Sizer(widget::Sizer::modeVert);
|
||||
ewol::widget::Sizer * mySizerVert2 = new widget::Sizer(widget::Sizer::modeVert);
|
||||
if (NULL == mySizerVert2) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
mySizerHori->subWidgetAdd(mySizerVert2);
|
||||
|
||||
mySpacer = new widget::Spacer();
|
||||
mySpacer = new ewol::widget::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
@ -152,19 +152,19 @@ ewol::widget::Parameter::Parameter(void) :
|
||||
mySizerVert2->subWidgetAdd(mySpacer);
|
||||
}
|
||||
|
||||
m_wSlider = new widget::WSlider();
|
||||
m_wSlider = new ewol::widget::WSlider();
|
||||
if (NULL == m_wSlider) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
m_wSlider->setTransitionSpeed(0.5);
|
||||
m_wSlider->setTransitionMode(widget::WSlider::sladingTransitionVert);
|
||||
m_wSlider->setTransitionMode(ewol::widget::WSlider::sladingTransitionVert);
|
||||
m_wSlider->setExpand(bvec2(true,true));
|
||||
mySizerVert2->subWidgetAdd(m_wSlider);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mySpacer = new widget::Spacer();
|
||||
mySpacer = new ewol::widget::Spacer();
|
||||
if (NULL == mySpacer) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
@ -174,7 +174,7 @@ ewol::widget::Parameter::Parameter(void) :
|
||||
mySizerVert->subWidgetAdd(mySpacer);
|
||||
}
|
||||
|
||||
m_widgetTitle = new widget::Label("File chooser ...");
|
||||
m_widgetTitle = new ewol::widget::Label("File chooser ...");
|
||||
if (NULL == m_widgetTitle) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
@ -196,8 +196,8 @@ void ewol::widget::Parameter::setTitle(std::string _label) {
|
||||
m_widgetTitle->setLabel(_label);
|
||||
}
|
||||
|
||||
void ewol::widget::Parameter::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
widget::PopUp::onReceiveMessage(_msg);
|
||||
void ewol::widget::Parameter::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
ewol::widget::PopUp::onReceiveMessage(_msg);
|
||||
EWOL_DEBUG("event on the parameter : " << _msg);
|
||||
if (_msg.getMessage() == ewolEventParameterClose) {
|
||||
// inform that the parameter windows is closed
|
||||
@ -218,9 +218,9 @@ void ewol::widget::Parameter::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
return;
|
||||
}
|
||||
|
||||
void ewol::widget::Parameter::onObjectRemove(ewol::EObject * _removeObject) {
|
||||
void ewol::widget::Parameter::onObjectRemove(ewol::Object * _removeObject) {
|
||||
// First step call parrent :
|
||||
widget::PopUp::onObjectRemove(_removeObject);
|
||||
ewol::widget::PopUp::onObjectRemove(_removeObject);
|
||||
// second step find if in all the elements ...
|
||||
if(_removeObject == m_widgetTitle) {
|
||||
m_widgetTitle = NULL;
|
||||
@ -241,7 +241,7 @@ void ewol::widget::Parameter::menuAdd(std::string _label, std::string _image, ew
|
||||
m_wSlider->subWidgetAdd(_associateWidget);
|
||||
} else {
|
||||
EWOL_DEBUG("Associate an empty widget on it ...");
|
||||
widget::Label * myLabel = new widget::Label((std::string("No widget for : ") + _label));
|
||||
ewol::widget::Label * myLabel = new widget::Label((std::string("No widget for : ") + _label));
|
||||
if (NULL == myLabel) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
|
@ -32,8 +32,8 @@ namespace ewol {
|
||||
Parameter(void);
|
||||
~Parameter(void);
|
||||
public: // Derived function
|
||||
virtual void onReceiveMessage(const ewol::EMessage& _msg);
|
||||
virtual void onObjectRemove(ewol::EObject * _removeObject);
|
||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||
virtual void onObjectRemove(ewol::Object * _removeObject);
|
||||
public:
|
||||
void setTitle(std::string _label);
|
||||
void menuAdd(std::string _label, std::string _image, ewol::Widget* _associateWidget);
|
||||
@ -42,9 +42,9 @@ namespace ewol {
|
||||
void menuSeparator(void);
|
||||
private:
|
||||
int32_t m_currentIdList;
|
||||
widget::Label* m_widgetTitle;
|
||||
widget::ParameterList* m_paramList;
|
||||
widget::WSlider* m_wSlider;
|
||||
ewol::widget::Label* m_widgetTitle;
|
||||
ewol::widget::ParameterList* m_paramList;
|
||||
ewol::widget::WSlider* m_wSlider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include <ewol/compositing/Drawing.h>
|
||||
#include <ewol/compositing/Text.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
|
||||
extern const char * const ewolEventParameterListSelect = "ewol-event-parameter-list-select";
|
||||
|
||||
@ -120,7 +120,7 @@ void ewol::widget::ParameterList::onRegenerateDisplay(void) {
|
||||
std::vector<int32_t> listSizeColomn;
|
||||
|
||||
// set background color :
|
||||
ewol::Drawing * tmpDraw = new ewol::Drawing();
|
||||
ewol::compositing::Drawing * tmpDraw = new ewol::compositing::Drawing();
|
||||
tmpDraw->setColor(0xFFFFFFFF);
|
||||
tmpDraw->setPos(vec3(0,0,0) );
|
||||
tmpDraw->rectangleWidth(vec3(m_size.x(), m_size.y(), 0) );
|
||||
@ -145,7 +145,7 @@ void ewol::widget::ParameterList::onRegenerateDisplay(void) {
|
||||
myTextToWrite = m_list[iii]->m_label;
|
||||
}
|
||||
|
||||
ewol::Text * tmpText = new ewol::Text();
|
||||
ewol::compositing::Text * tmpText = new ewol::compositing::Text();
|
||||
|
||||
vec3 textPos;
|
||||
textPos.setX((int32_t)tmpOriginX);
|
||||
@ -162,18 +162,18 @@ void ewol::widget::ParameterList::onRegenerateDisplay(void) {
|
||||
addOObject(tmpDraw, 0);
|
||||
|
||||
// call the herited class...
|
||||
widget::WidgetScrooled::onRegenerateDisplay();
|
||||
ewol::widget::WidgetScrooled::onRegenerateDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool ewol::widget::ParameterList::onEventInput(const ewol::EventInput& _event) {
|
||||
bool ewol::widget::ParameterList::onEventInput(const ewol::event::Input& _event) {
|
||||
if (true == WidgetScrooled::onEventInput(_event)) {
|
||||
keepFocus();
|
||||
// nothing to do ... done on upper widet ...
|
||||
return true;
|
||||
}
|
||||
if (_event.getId() == 1 && _event.getStatus() == ewol::keyEvent::statusSingle) {
|
||||
if (_event.getId() == 1 && _event.getStatus() == ewol::key::statusSingle) {
|
||||
vec2 relativePos = relativePosition(_event.getPos());
|
||||
// corection for the openGl abstraction
|
||||
relativePos.setY(m_size.y() - relativePos.y());
|
||||
@ -209,7 +209,7 @@ void ewol::widget::ParameterList::onLostFocus(void) {
|
||||
}
|
||||
|
||||
void ewol::widget::ParameterList::menuAdd(std::string& _label, int32_t _refId, std::string& _image) {
|
||||
widget::elementPL* tmpEmement = new widget::elementPL(_label, _refId, _image, false);
|
||||
ewol::widget::elementPL* tmpEmement = new widget::elementPL(_label, _refId, _image, false);
|
||||
if (NULL != tmpEmement) {
|
||||
m_list.push_back(tmpEmement);
|
||||
if (m_idSelected == -1 && _label != "---" && _refId>0) {
|
||||
@ -221,7 +221,7 @@ void ewol::widget::ParameterList::menuAdd(std::string& _label, int32_t _refId, s
|
||||
|
||||
void ewol::widget::ParameterList::menuAddGroup(std::string& _label) {
|
||||
std::string image = "";
|
||||
widget::elementPL* tmpEmement = new widget::elementPL(_label, -1, image, true);
|
||||
ewol::widget::elementPL* tmpEmement = new widget::elementPL(_label, -1, image, true);
|
||||
if (NULL != tmpEmement) {
|
||||
m_list.push_back(tmpEmement);
|
||||
markToRedraw();
|
||||
|
@ -40,16 +40,16 @@ namespace ewol {
|
||||
class ParameterList :public ewol::widget::WidgetScrooled {
|
||||
private:
|
||||
int32_t m_idSelected;
|
||||
std::vector<widget::elementPL *> m_list;
|
||||
std::vector<ewol::widget::elementPL *> m_list;
|
||||
public:
|
||||
ParameterList(void);
|
||||
virtual ~ParameterList(void);
|
||||
void setLabel(std::string _newLabel);
|
||||
// drawing capabilities ....
|
||||
private:
|
||||
std::vector<ewol::compositing::Compose*> m_listOObject; //!< generic element to display...
|
||||
std::vector<ewol::Compositing*> m_listOObject; //!< generic element to display...
|
||||
public:
|
||||
void addOObject(ewol::compositing::Compose* _newObject, int32_t _pos=-1);
|
||||
void addOObject(ewol::Compositing* _newObject, int32_t _pos=-1);
|
||||
void clearOObjectList(void);
|
||||
// list properties ...
|
||||
private:
|
||||
@ -65,7 +65,7 @@ namespace ewol {
|
||||
|
||||
public: // Derived function
|
||||
virtual void onRegenerateDisplay(void);
|
||||
virtual bool onEventInput(const ewol::EventInput& _event);
|
||||
virtual bool onEventInput(const ewol::event::Input& _event);
|
||||
virtual void calculateMinMaxSize(void);
|
||||
protected: // Derived function
|
||||
virtual void onGetFocus(void);
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <ewol/widget/Sizer.h>
|
||||
#include <ewol/widget/Spacer.h>
|
||||
#include <ewol/widget/Label.h>
|
||||
#include <ewol/widget/WidgetManager.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <vector>
|
||||
|
||||
#undef __class__
|
||||
@ -18,65 +18,65 @@
|
||||
|
||||
static const char * const eventButtonExit = "ewol-event-pop-up-exit-button";
|
||||
|
||||
widget::StdPopUp::StdPopUp(void) :
|
||||
ewol::widget::StdPopUp::StdPopUp(void) :
|
||||
m_title(NULL),
|
||||
m_comment(NULL),
|
||||
m_subBar(NULL) {
|
||||
addObjectType("widget::StdPopUp");
|
||||
addObjectType("ewol::widget::StdPopUp");
|
||||
setMinSize(ewol::Dimension(vec2(20,10),ewol::Dimension::Pourcent));
|
||||
|
||||
widget::Sizer* mySizerVert = NULL;
|
||||
widget::Spacer* mySpacer = NULL;
|
||||
ewol::widget::Sizer* mySizerVert = NULL;
|
||||
ewol::widget::Spacer* mySpacer = NULL;
|
||||
|
||||
mySizerVert = new widget::Sizer(widget::Sizer::modeVert);
|
||||
mySizerVert = new ewol::widget::Sizer(widget::Sizer::modeVert);
|
||||
// set it in the pop-up-system :
|
||||
setSubWidget(mySizerVert);
|
||||
|
||||
m_subBar = new widget::Sizer(widget::Sizer::modeHori);
|
||||
m_subBar = new ewol::widget::Sizer(widget::Sizer::modeHori);
|
||||
m_subBar->lockExpand(bvec2(true,true));
|
||||
m_subBar->setExpand(bvec2(true,false));
|
||||
mySizerVert->subWidgetAdd(m_subBar);
|
||||
mySpacer = new widget::Spacer();
|
||||
mySpacer = new ewol::widget::Spacer();
|
||||
mySpacer->setExpand(bvec2(true,false));
|
||||
m_subBar->subWidgetAdd(mySpacer);
|
||||
|
||||
mySpacer = new widget::Spacer();
|
||||
mySpacer = new ewol::widget::Spacer();
|
||||
mySpacer->setExpand(bvec2(true,false));
|
||||
mySpacer->setColor(etk::Color<>(0x888888FF));
|
||||
mySpacer->setMinSize(ewol::Dimension(vec2(0,3),ewol::Dimension::Pixel));
|
||||
mySizerVert->subWidgetAdd(mySpacer);
|
||||
|
||||
mySpacer = new widget::Spacer();
|
||||
mySpacer = new ewol::widget::Spacer();
|
||||
mySpacer->setExpand(bvec2(true,false));
|
||||
mySpacer->setMinSize(ewol::Dimension(vec2(0,5),ewol::Dimension::Pixel));
|
||||
mySizerVert->subWidgetAdd(mySpacer);
|
||||
|
||||
m_comment = new widget::Label("No Label");
|
||||
m_comment = new ewol::widget::Label("No Label");
|
||||
m_comment->setExpand(bvec2(true,true));
|
||||
mySizerVert->subWidgetAdd(m_comment);
|
||||
|
||||
mySpacer = new widget::Spacer();
|
||||
mySpacer = new ewol::widget::Spacer();
|
||||
mySpacer->setExpand(bvec2(true,false));
|
||||
mySpacer->setMinSize(ewol::Dimension(vec2(0,5),ewol::Dimension::Pixel));
|
||||
mySizerVert->subWidgetAdd(mySpacer);
|
||||
|
||||
mySpacer = new widget::Spacer();
|
||||
mySpacer = new ewol::widget::Spacer();
|
||||
mySpacer->setExpand(bvec2(true,false));
|
||||
mySpacer->setColor(etk::Color<>(0x888888FF));
|
||||
mySpacer->setMinSize(ewol::Dimension(vec2(0,3),ewol::Dimension::Pixel));
|
||||
mySizerVert->subWidgetAdd(mySpacer);
|
||||
|
||||
m_title = new widget::Label("<bold>Message</bold>");
|
||||
m_title = new ewol::widget::Label("<bold>Message</bold>");
|
||||
m_title->setExpand(bvec2(true,false));
|
||||
m_title->setFill(bvec2(true,true));
|
||||
mySizerVert->subWidgetAdd(m_title);
|
||||
}
|
||||
|
||||
widget::StdPopUp::~StdPopUp(void) {
|
||||
ewol::widget::StdPopUp::~StdPopUp(void) {
|
||||
|
||||
}
|
||||
|
||||
void widget::StdPopUp::setTitle(const std::string& _text) {
|
||||
void ewol::widget::StdPopUp::setTitle(const std::string& _text) {
|
||||
if (m_title == NULL) {
|
||||
return;
|
||||
}
|
||||
@ -84,7 +84,7 @@ void widget::StdPopUp::setTitle(const std::string& _text) {
|
||||
markToRedraw();
|
||||
}
|
||||
|
||||
void widget::StdPopUp::setComment(const std::string& _text) {
|
||||
void ewol::widget::StdPopUp::setComment(const std::string& _text) {
|
||||
if (m_comment == NULL) {
|
||||
return;
|
||||
}
|
||||
@ -92,28 +92,28 @@ void widget::StdPopUp::setComment(const std::string& _text) {
|
||||
markToRedraw();
|
||||
}
|
||||
|
||||
widget::Button* widget::StdPopUp::addButton(const std::string& _text, bool _autoExit) {
|
||||
ewol::widget::Button* ewol::widget::StdPopUp::addButton(const std::string& _text, bool _autoExit) {
|
||||
if (m_subBar == NULL) {
|
||||
EWOL_ERROR("button-bar does not existed ...");
|
||||
return NULL;
|
||||
}
|
||||
widget::Button* myButton = new widget::Button();
|
||||
ewol::widget::Button* myButton = new widget::Button();
|
||||
if (myButton == NULL) {
|
||||
EWOL_ERROR("Can not allocate new button ...");
|
||||
return NULL;
|
||||
}
|
||||
myButton->setSubWidget(new widget::Label(_text));
|
||||
myButton->setSubWidget(new ewol::widget::Label(_text));
|
||||
if(_autoExit == true) {
|
||||
myButton->registerOnEvent(this, widget::Button::eventPressed, eventButtonExit);
|
||||
myButton->registerOnEvent(this, ewol::widget::Button::eventPressed, eventButtonExit);
|
||||
}
|
||||
m_subBar->subWidgetAdd(myButton);
|
||||
markToRedraw();
|
||||
return myButton;
|
||||
}
|
||||
|
||||
void widget::StdPopUp::onObjectRemove(ewol::EObject* _removeObject) {
|
||||
void ewol::widget::StdPopUp::onObjectRemove(ewol::Object* _removeObject) {
|
||||
// call parent:
|
||||
widget::PopUp::onObjectRemove(_removeObject);
|
||||
ewol::widget::PopUp::onObjectRemove(_removeObject);
|
||||
if (_removeObject == m_subBar) {
|
||||
m_subBar = NULL;
|
||||
markToRedraw();
|
||||
@ -131,9 +131,9 @@ void widget::StdPopUp::onObjectRemove(ewol::EObject* _removeObject) {
|
||||
}
|
||||
}
|
||||
|
||||
void widget::StdPopUp::onReceiveMessage(const ewol::EMessage& _msg) {
|
||||
void ewol::widget::StdPopUp::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
// call parent:
|
||||
widget::PopUp::onReceiveMessage(_msg);
|
||||
ewol::widget::PopUp::onReceiveMessage(_msg);
|
||||
if (_msg.getMessage() == eventButtonExit) {
|
||||
autoDestroy();
|
||||
}
|
||||
|
@ -72,10 +72,10 @@ namespace ewol {
|
||||
* @brief Add a buttom button.
|
||||
* @param[in] _text Decorated text to diplay in button.
|
||||
*/
|
||||
widget::Button* addButton(const std::string& _text, bool _autoExit=false);
|
||||
ewol::widget::Button* addButton(const std::string& _text, bool _autoExit=false);
|
||||
public: // Derived function
|
||||
virtual void onObjectRemove(ewol::EObject* _removeObject);
|
||||
virtual void onReceiveMessage(const ewol::EMessage& _msg);
|
||||
virtual void onObjectRemove(ewol::Object* _removeObject);
|
||||
virtual void onReceiveMessage(const ewol::object::Message& _msg);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -60,6 +60,13 @@ def Create(target):
|
||||
else:
|
||||
debug.error("unknow mode...")
|
||||
|
||||
# event properties :
|
||||
myModule.AddSrcFile([
|
||||
'ewol/event/Entry.cpp',
|
||||
'ewol/event/Time.cpp',
|
||||
'ewol/event/Input.cpp'
|
||||
])
|
||||
|
||||
# Key properties :
|
||||
myModule.AddSrcFile([
|
||||
'ewol/key/keyboard.cpp',
|
||||
@ -129,6 +136,7 @@ def Create(target):
|
||||
'ewol/widget/Sizer.cpp',
|
||||
'ewol/widget/Slider.cpp',
|
||||
'ewol/widget/Spacer.cpp',
|
||||
'ewol/widget/Widget.cpp',
|
||||
'ewol/widget/WidgetScrolled.cpp',
|
||||
'ewol/widget/Windows.cpp',
|
||||
'ewol/widget/WSlider.cpp',
|
||||
|
Loading…
x
Reference in New Issue
Block a user