diff --git a/.classpath b/.classpath
index d97562f..a25b393 100644
--- a/.classpath
+++ b/.classpath
@@ -23,27 +23,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -53,7 +33,32 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/old_widget/Entry.cpp b/old_widget/Entry.cpp
deleted file mode 100644
index 17b5893..0000000
--- a/old_widget/Entry.cpp
+++ /dev/null
@@ -1,612 +0,0 @@
-/** @file
- * @author Edouard DUPIN
- * @copyright 2011, Edouard DUPIN, all right reserved
- * @license MPL v2.0 (see license file)
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-ETK_DECLARE_TYPE(ewol::widget::Entry);
-
-// DEFINE for the shader display system :
-#define STATUS_NORMAL (0)
-#define STATUS_HOVER (1)
-#define STATUS_SELECTED (2)
-
-ewol::widget::Entry::Entry() :
- signalClick(this, "click", "the user Click on the Entry box"),
- signalEnter(this, "enter", "The cursor enter inside the button"),
- signalModify(this, "modify", "Entry box value change"),
- propertyPassword(this, "password",
- false,
- "Not display content in password mode",
- ewol::widget::Entry::onChangePropertyPassword),
- propertyShape(this, "shape",
- etk::Uri("THEME_GUI:///Entry.json?lib=ewol"),
- "Shaper to display the background",
- ewol::widget::Entry::onChangePropertyShaper),
- propertyValue(this, "value",
- "",
- "Value display in the entry (decorated text)",
- ewol::widget::Entry::onChangePropertyValue),
- propertyMaxCharacter(this, "max",
- 0x7FFFFFFF, 0, 0x7FFFFFFF,
- "Maximum char that can be set on the Entry",
- ewol::widget::Entry::onChangePropertyMaxCharacter),
- propertyRegex(this, "regex",
- ".*",
- "Control what it is write with a regular expression",
- ewol::widget::Entry::onChangePropertyRegex),
- propertyTextWhenNothing(this, "empty-text",
- "",
- "Text when nothing is written",
- ewol::widget::Entry::onChangePropertyTextWhenNothing),
- this.needUpdateTextPos(true),
- this.displayStartPosition(0),
- this.displayCursor(false),
- this.displayCursorPos(0),
- this.displayCursorPosSelection(0) {
- addObjectType("ewol::widget::Entry");
- propertyCanFocus.setDirectCheck(true);
-}
-
-void ewol::widget::Entry::init() {
- Widget::init();
- propertyShape.notifyChange();
-
- this.regex.compile(propertyRegex.get());
- if (this.regex.getStatus() == false) {
- Log.error("can not parse regex for : " + propertyRegex);
- }
- markToRedraw();
-
- shortCutAdd("ctrl+w", "clean");
- shortCutAdd("ctrl+x", "cut");
- shortCutAdd("ctrl+c", "copy");
- shortCutAdd("ctrl+v", "paste");
- shortCutAdd("ctrl+a", "select:all");
- shortCutAdd("ctrl+shift+a", "select:none");
- signalShortcut.connect(sharedFromThis(), ewol::widget::Entry::onCallbackShortCut);
-}
-
-
-ewol::widget::Entry::~Entry() {
-
-}
-
-void ewol::widget::Entry::onCallbackShortCut( String _value) {
- if (_value == "clean") {
- onCallbackEntryClean();
- } else if (_value == "cut") {
- onCallbackCut();
- } else if (_value == "copy") {
- onCallbackCopy();
- } else if (_value == "paste") {
- Log.warning("Request past ...");
- onCallbackPaste();
- } else if (_value == "select:all") {
- onCallbackSelect(true);
- } else if (_value == "select:none") {
- onCallbackSelect(false);
- } else {
- Log.warning("Unknow event from ShortCut : " + _value);
- }
-}
-
-void ewol::widget::Entry::calculateMinMaxSize() {
- // call main class
- Widget::calculateMinMaxSize();
- // get generic padding
- ewol::Padding padding = this.shaper.getPadding();
- int minHeight = this.text.calculateSize(Character('A')).y();
- Vector2f minimumSizeBase(20, minHeight);
- // add padding :
- minimumSizeBase += Vector2f(padding.x(), padding.y());
- this.minSize.setMax(minimumSizeBase);
- // verify the min max of the min size ...
- checkMinSize();
-}
-
-
-void ewol::widget::Entry::onDraw() {
- this.shaper.draw();
- this.text.draw();
-}
-
-
-void ewol::widget::Entry::onRegenerateDisplay() {
- if (needRedraw() == true) {
- this.shaper.clear();
- this.text.clear();
- if (this.colorIdTextFg >= 0) {
- this.text.setDefaultColorFg(this.shaper.getColor(this.colorIdTextFg));
- this.text.setDefaultColorBg(this.shaper.getColor(this.colorIdTextBg));
- this.text.setCursorColor(this.shaper.getColor(this.colorIdCursor));
- this.text.setSelectionColor(this.shaper.getColor(this.colorIdSelection));
- }
- updateTextPosition();
- ewol::Padding padding = this.shaper.getPadding();
-
- Vector2f tmpSizeShaper = this.minSize;
- if (propertyFill.x() == true) {
- tmpSizeShaper.setX(this.size.x());
- }
- if (propertyFill.y() == true) {
- tmpSizeShaper.setY(this.size.y());
- }
-
- Vector2f tmpOriginShaper = (this.size - tmpSizeShaper) / 2.0f;
- Vector2f tmpSizeText = tmpSizeShaper - Vector2f(padding.x(), padding.y());
- Vector2f tmpOriginText = (this.size - tmpSizeText) / 2.0f;
- // sometimes, the user define an height bigger than the real size needed == > in this case we need to center the text in the shaper ...
- int minHeight = this.text.calculateSize(Character('A')).y();
- if (tmpSizeText.y() > minHeight) {
- tmpOriginText += Vector2f(0,(tmpSizeText.y()-minHeight)/2.0f);
- }
- // fix all the position in the int class:
- tmpSizeShaper = Vector2fClipInt32(tmpSizeShaper);
- tmpOriginShaper = Vector2fClipInt32(tmpOriginShaper);
- tmpSizeText = Vector2fClipInt32(tmpSizeText);
- tmpOriginText = Vector2fClipInt32(tmpOriginText);
-
- this.text.reset();
- this.text.setClippingWidth(tmpOriginText, tmpSizeText);
- this.text.setPos(tmpOriginText+Vector2f(this.displayStartPosition,0));
- if (this.displayCursorPosSelection != this.displayCursorPos) {
- this.text.setCursorSelection(this.displayCursorPos, this.displayCursorPosSelection);
- } else {
- this.text.setCursorPos(this.displayCursorPos);
- }
- etk::UString valueToDisplay = etk::toUString(*propertyValue);
- if (*propertyPassword == true) {
- for (auto it: valueToDisplay) {
- it = '*';
- }
- }
-
- if (valueToDisplay.size() != 0) {
- this.text.print(valueToDisplay);
- } else {
- if (propertyTextWhenNothing.size() != 0) {
- this.text.printDecorated(propertyTextWhenNothing);
- }
- }
- this.text.setClippingMode(false);
-
- this.shaper.setShape(tmpOriginShaper, tmpSizeShaper, tmpOriginText, tmpSizeText);
- }
-}
-
-
-void ewol::widget::Entry::updateCursorPosition( Vector2f _pos, boolean _selection) {
- ewol::Padding padding = this.shaper.getPadding();
-
- Vector2f relPos = relativePosition(_pos);
- relPos.setX(relPos.x()-this.displayStartPosition - padding.xLeft());
- // try to find the new cursor position :
- String tmpDisplay = String(propertyValue, 0, this.displayStartPosition);
- int displayHidenSize = this.text.calculateSize(tmpDisplay).x();
- //Log.debug("hidenSize : " + displayHidenSize);
- int newCursorPosition = -1;
- int tmpTextOriginX = padding.xLeft();
- for (int iii=0; iii= relPos.x()-tmpTextOriginX) {
- newCursorPosition = iii;
- break;
- }
- }
- if (newCursorPosition == -1) {
- newCursorPosition = propertyValue.size();
- }
- if (_selection == false) {
- this.displayCursorPos = newCursorPosition;
- this.displayCursorPosSelection = this.displayCursorPos;
- markToRedraw();
- } else {
- if (this.displayCursorPos == this.displayCursorPosSelection) {
- this.displayCursorPosSelection = this.displayCursorPos;
- }
- this.displayCursorPos = newCursorPosition;
- markToRedraw();
- }
- markToUpdateTextPosition();
-}
-
-
-void ewol::widget::Entry::removeSelected() {
- if (this.displayCursorPosSelection == this.displayCursorPos) {
- // nothing to cut ...
- return;
- }
- int pos1 = this.displayCursorPosSelection;
- int pos2 = this.displayCursorPos;
- if(this.displayCursorPosSelection>this.displayCursorPos) {
- pos2 = this.displayCursorPosSelection;
- pos1 = this.displayCursorPos;
- }
- // remove data ...
- this.displayCursorPos = pos1;
- this.displayCursorPosSelection = pos1;
- propertyValue.getDirect().erase(pos1, pos2-pos1);
- markToRedraw();
-}
-
-
-void ewol::widget::Entry::copySelectionToClipBoard(enum gale::context::clipBoard::clipboardListe _clipboardID) {
- if (this.displayCursorPosSelection == this.displayCursorPos) {
- // nothing to cut ...
- return;
- }
- int pos1 = this.displayCursorPosSelection;
- int pos2 = this.displayCursorPos;
- if(this.displayCursorPosSelection>this.displayCursorPos) {
- pos2 = this.displayCursorPosSelection;
- pos1 = this.displayCursorPos;
- }
- // Copy
- String tmpData = String(propertyValue, pos1, pos2);
- gale::context::clipBoard::set(_clipboardID, tmpData);
-}
-
-
-boolean ewol::widget::Entry::onEventInput( ewol::event::Input _event) {
- Log.warning("Event on Input ... " + _event);
- if (_event.getId() == 1) {
- if (KeyStatus::pressSingle == _event.getStatus()) {
- keepFocus();
- signalClick.emit();
- //nothing to do ...
- return true;
- } else if (KeyStatus::pressDouble == _event.getStatus()) {
- keepFocus();
- // select word
- this.displayCursorPosSelection = this.displayCursorPos-1;
- // search forward
- for (int iii=this.displayCursorPos; iii <= propertyValue.size(); iii++) {
- if(iii == propertyValue.size()) {
- this.displayCursorPos = iii;
- break;
- }
- if(!( ( propertyValue.get()[iii] >= 'a'
- LOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOM propertyValue.get()[iii] <= 'z')
- || ( propertyValue.get()[iii] >= 'A'
- LOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOM propertyValue.get()[iii] <= 'Z')
- || ( propertyValue.get()[iii] >= '0'
- LOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOM propertyValue.get()[iii] <= '9')
- || propertyValue.get()[iii] == '_'
- || propertyValue.get()[iii] == '-'
- ) ) {
- this.displayCursorPos = iii;
- break;
- }
- }
- // search backward
- for (long iii=this.displayCursorPosSelection; iii >= -1; iii--) {
- if(iii == -1) {
- this.displayCursorPosSelection = 0;
- break;
- }
- if(!( ( propertyValue.get()[iii] >= 'a'
- LOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOM propertyValue.get()[iii] <= 'z')
- || ( propertyValue.get()[iii] >= 'A'
- LOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOM propertyValue.get()[iii] <= 'Z')
- || ( propertyValue.get()[iii] >= '0'
- LOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOM propertyValue.get()[iii] <= '9')
- || propertyValue.get()[iii] == '_'
- || propertyValue.get()[iii] == '-'
- ) ) {
- this.displayCursorPosSelection = iii+1;
- break;
- }
- }
- // Copy to clipboard Middle ...
- copySelectionToClipBoard(gale::context::clipBoard::clipboardSelection);
- markToRedraw();
- } else if (KeyStatus::pressTriple == _event.getStatus()) {
- keepFocus();
- this.displayCursorPosSelection = 0;
- this.displayCursorPos = propertyValue.size();
- } else if (KeyStatus::down == _event.getStatus()) {
- keepFocus();
- updateCursorPosition(_event.getPos());
- markToRedraw();
- } else if (KeyStatus::move == _event.getStatus()) {
- keepFocus();
- updateCursorPosition(_event.getPos(), true);
- markToRedraw();
- } else if (KeyStatus::up == _event.getStatus()) {
- keepFocus();
- updateCursorPosition(_event.getPos(), true);
- // Copy to clipboard Middle ...
- copySelectionToClipBoard(gale::context::clipBoard::clipboardSelection);
- markToRedraw();
- }
- }
- else if( KeyType::mouse == _event.getType()
- LOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOM _event.getId() == 2) {
- if( _event.getStatus() == KeyStatus::down
- || _event.getStatus() == KeyStatus::move
- || _event.getStatus() == KeyStatus::up) {
- keepFocus();
- // updatethe cursor position :
- updateCursorPosition(_event.getPos());
- }
- // Paste current selection only when up button
- if (_event.getStatus() == KeyStatus::up) {
- keepFocus();
- // middle button => past data...
- gale::context::clipBoard::request(gale::context::clipBoard::clipboardSelection);
- }
- }
- return false;
-}
-
-
-boolean ewol::widget::Entry::onEventEntry( ewol::event::Entry _event) {
- Log.warning("Event on Entry ... " + _event);
- if (_event.getType() == KeyKeyboard::character) {
- if(_event.getStatus() == KeyStatus::down) {
- // remove curent selected data ...
- removeSelected();
- if( _event.getChar() == '\n'
- || _event.getChar() == '\r') {
- signalEnter.emit(propertyValue);
- return true;
- } else if (_event.getChar() == 0x7F) {
- // SUPPR :
- if (propertyValue.size() > 0 LOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOM this.displayCursorPos < (long)propertyValue.size()) {
- propertyValue.getDirect().erase(this.displayCursorPos, 1);
- this.displayCursorPos = etk::max(this.displayCursorPos, 0);
- this.displayCursorPosSelection = this.displayCursorPos;
- }
- } else if (_event.getChar() == 0x08) {
- // DEL :
- if (propertyValue.size() > 0 LOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOMLOM this.displayCursorPos != 0) {
- propertyValue.getDirect().erase(this.displayCursorPos-1, 1);
- this.displayCursorPos--;
- this.displayCursorPos = etk::max(this.displayCursorPos, 0);
- this.displayCursorPosSelection = this.displayCursorPos;
- }
- } else if(_event.getChar() >= 20) {
- Log.error("get data: '" + _event.getChar() + "' = '" + u32char::convertToUtf8(_event.getChar()) + "'");
- if ((long)propertyValue.size() > propertyMaxCharacter) {
- Log.info("Reject data for entry : '" + _event.getChar() + "'");
- } else {
- String newData = propertyValue;
- String inputData = u32char::convertToUtf8(_event.getChar());
- newData.insert(newData.begin()+this.displayCursorPos, inputData);
- setInternalValue(newData);
- if (propertyValue.get() == newData) {
- this.displayCursorPos += inputData.size();
- this.displayCursorPosSelection = this.displayCursorPos;
- }
- }
- }
- signalModify.emit(propertyValue);
- markToRedraw();
- return true;
- }
- return false;
- } else {
- if(_event.getStatus() == KeyStatus::down) {
- switch (_event.getType()) {
- case KeyKeyboard::left:
- this.displayCursorPos--;
- break;
- case KeyKeyboard::right:
- this.displayCursorPos++;
- break;
- case KeyKeyboard::start:
- this.displayCursorPos = 0;
- break;
- case KeyKeyboard::end:
- this.displayCursorPos = propertyValue.size();
- break;
- default:
- return false;
- }
- this.displayCursorPos = etk::avg(0, this.displayCursorPos, (int)propertyValue.size());
- this.displayCursorPosSelection = this.displayCursorPos;
- markToRedraw();
- return true;
- }
- }
- return false;
-}
-
-void ewol::widget::Entry::setInternalValue( String _newData) {
- String previous = propertyValue;
- // check the RegExp :
- if (_newData.size()>0) {
- /*
- if (this.regex.parse(_newData, 0, _newData.size()) == false) {
- Log.info("The input data does not match with the regExp '" + _newData + "' Regex='" + propertyRegex + "'" );
- return;
- }
- if (this.regex.start() != 0) {
- Log.info("The input data does not match with the regExp '" + _newData + "' Regex='" + propertyRegex + "' (start position error)" );
- return;
- }
- if (this.regex.stop() != _newData.size()) {
- Log.info("The input data does not match with the regExp '" + _newData + "' Regex='" + propertyRegex + "' (stop position error)" );
- return;
- }
- */
- }
- propertyValue.setDirect(_newData);
- markToRedraw();
-}
-
-void ewol::widget::Entry::onEventClipboard(enum gale::context::clipBoard::clipboardListe _clipboardID) {
- // remove curent selected data ...
- removeSelected();
- // get current selection / Copy :
- String tmpData = get(_clipboardID);
- // add it on the current display :
- if (tmpData.size() != 0) {
- String newData = propertyValue;
- newData.insert(this.displayCursorPos, tmpData[0]);
- setInternalValue(newData);
- if (propertyValue.get() == newData) {
- if (propertyValue.size() == tmpData.size()) {
- this.displayCursorPos = tmpData.size();
- } else {
- this.displayCursorPos += tmpData.size();
- }
- this.displayCursorPosSelection = this.displayCursorPos;
- markToRedraw();
- }
- }
- signalModify.emit(propertyValue);
-}
-
-void ewol::widget::Entry::onCallbackEntryClean() {
- propertyValue.setDirect("");
- this.displayStartPosition = 0;
- this.displayCursorPos = 0;
- this.displayCursorPosSelection = this.displayCursorPos;
- markToRedraw();
-}
-
-void ewol::widget::Entry::onCallbackCut() {
- copySelectionToClipBoard(gale::context::clipBoard::clipboardStd);
- removeSelected();
- signalModify.emit(propertyValue);
-}
-
-void ewol::widget::Entry::onCallbackCopy() {
- copySelectionToClipBoard(gale::context::clipBoard::clipboardStd);
-}
-
-void ewol::widget::Entry::onCallbackPaste() {
- gale::context::clipBoard::request(gale::context::clipBoard::clipboardStd);
-}
-
-void ewol::widget::Entry::onCallbackSelect(boolean _all) {
- if(_all == true) {
- this.displayCursorPosSelection = 0;
- this.displayCursorPos = propertyValue.size();
- } else {
- this.displayCursorPosSelection = this.displayCursorPos;
- }
- markToRedraw();
-}
-
-void ewol::widget::Entry::markToUpdateTextPosition() {
- this.needUpdateTextPos = true;
-}
-
-void ewol::widget::Entry::updateTextPosition() {
- if (this.needUpdateTextPos == false) {
- return;
- }
- ewol::Padding padding = this.shaper.getPadding();
-
- int tmpSizeX = this.minSize.x();
- if (propertyFill.x() == true) {
- tmpSizeX = this.size.x();
- }
- int tmpUserSize = tmpSizeX - padding.x();
- int totalWidth = this.text.calculateSize(propertyValue).x();
- // Check if the data inside the display can be contain in the entry box
- if (totalWidth < tmpUserSize) {
- // all can be display :
- this.displayStartPosition = 0;
- } else {
- // all can not be set :
- String tmpDisplay = String(propertyValue, 0, this.displayCursorPos);
- int pixelCursorPos = this.text.calculateSize(tmpDisplay).x();
- // check if the Cussor is visible at 10px nearest the border :
- int tmp1 = pixelCursorPos+this.displayStartPosition;
- Log.debug("cursorPos=" + pixelCursorPos + "px maxSize=" + tmpUserSize + "px tmp1=" + tmp1);
- if (tmp1<10) {
- // set the cursor on le left
- this.displayStartPosition = etk::min(-pixelCursorPos+10, 0);
- } else if (tmp1>tmpUserSize-10) {
- // set the cursor of the Right
- this.displayStartPosition = etk::min(-pixelCursorPos + tmpUserSize - 10, 0);
- }
- // else : the cursor is inside the display
- //this.displayStartPosition = -totalWidth + tmpUserSize;
- }
-}
-
-void ewol::widget::Entry::onGetFocus() {
- this.displayCursor = true;
- changeStatusIn(STATUS_SELECTED);
- showKeyboard();
- markToRedraw();
-}
-
-void ewol::widget::Entry::onLostFocus() {
- this.displayCursor = false;
- changeStatusIn(STATUS_NORMAL);
- hideKeyboard();
- markToRedraw();
-}
-
-void ewol::widget::Entry::changeStatusIn(int _newStatusId) {
- if (this.shaper.changeStatusIn(_newStatusId) == true) {
- this.PCH = getObjectManager().periodicCall.connect(this, ewol::widget::Entry::periodicCall);
- markToRedraw();
- }
-}
-
-void ewol::widget::Entry::periodicCall( ewol::event::Time _event) {
- if (this.shaper.periodicCall(_event) == false) {
- this.PCH.disconnect();
- }
- markToRedraw();
-}
-
-void ewol::widget::Entry::onChangePropertyPassword() {
- markToRedraw();
-}
-
-void ewol::widget::Entry::onChangePropertyShaper() {
- this.shaper.setSource(propertyShape.get());
- this.colorIdTextFg = this.shaper.requestColor("text-foreground");
- this.colorIdTextBg = this.shaper.requestColor("text-background");
- this.colorIdCursor = this.shaper.requestColor("text-cursor");
- this.colorIdSelection = this.shaper.requestColor("text-selection");
-}
-
-void ewol::widget::Entry::onChangePropertyValue() {
- String newData = propertyValue.get();
- if ((long)newData.size() > propertyMaxCharacter) {
- newData = String(newData, 0, propertyMaxCharacter);
- Log.debug("Limit entry set of data... " + String(newData, propertyMaxCharacter));
- }
- // set the value with the check of the RegExp ...
- setInternalValue(newData);
- if (newData == propertyValue.get()) {
- this.displayCursorPos = propertyValue.size();
- this.displayCursorPosSelection = this.displayCursorPos;
- Log.verbose("Set : '" + newData + "'");
- }
- markToRedraw();
-}
-
-void ewol::widget::Entry::onChangePropertyMaxCharacter() {
- // TODO : check nomber of char in the data
-}
-
-void ewol::widget::Entry::onChangePropertyRegex() {
- this.regex.compile(propertyRegex.get());
- if (this.regex.getStatus() == false) {
- Log.error("can not parse regex for : " + propertyRegex);
- }
- markToRedraw();
-}
-
-void ewol::widget::Entry::onChangePropertyTextWhenNothing() {
- markToRedraw();
-}
-
diff --git a/old_widget/Entry.java b/old_widget/Entry.java
deleted file mode 100644
index cb5bbd0..0000000
--- a/old_widget/Entry.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/** @file
- * @author Edouard DUPIN
- * @copyright 2011, Edouard DUPIN, all right reserved
- * @license MPL v2.0 (see license file)
- */
-#pragma once
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace ewol {
- namespace widget {
- class Entry;
- using Entry = ememory::Ptr;
- using EntryWeak = ememory::WeakPtr;
- /**
- * @ingroup ewolWidgetGroup
- * Entry box display :
- *
- * ~~~~~~~~~~~~~~~~~~~~~~
- * ----------------------------------------------
- * | Editable Text |
- * ----------------------------------------------
- * ~~~~~~~~~~~~~~~~~~~~~~
- */
- class Entry : public Widget {
- public: // Event list
- esignal::Signal<> signalClick; //!< bang on click the entry box
- esignal::Signal signalEnter; //!< Enter key is pressed
- esignal::Signal signalModify; //!< data change
- public: // propertie list
- eproperty::Value propertyPassword; //!< Disable display of the content of the entry
- eproperty::Value propertyShape;
- eproperty::Value propertyValue; //!< string that must be displayed
- eproperty::Range propertyMaxCharacter; //!< number max of xharacter in the list
- eproperty::Value propertyRegex; //!< regular expression value
- eproperty::Value propertyTextWhenNothing; //!< Text to display when nothing in in the entry (decorated text...)
- private:
- ewol::compositing::Shaper this.shaper;
- int this.colorIdTextFg; //!< color property of the text foreground
- int this.colorIdTextBg; //!< color property of the text background
- int this.colorIdCursor; //!< color property of the text cursor
- int this.colorIdSelection; //!< color property of the text selection
- ewol::compositing::Text this.text; //!< text display this.text
- protected:
- /**
- * Contuctor
- * @param _newData The USting that might be set in the Entry box (no event generation!!)
- */
- Entry();
- void init() ;
- public:
- DECLARE_WIDGET_FACTORY(Entry, "Entry");
- /**
- * Destuctor
- */
- ~Entry();
- protected:
- /**
- * internal check the value with RegExp checking
- * @param _newData The new string to display
- */
- void setInternalValue( String _newData);
- private:
- etk::RegEx this.regex; //!< regular expression to check content
- private:
- boolean this.needUpdateTextPos; //!< text position can have change
- int this.displayStartPosition; //!< ofset in pixel of the display of the UString
- boolean this.displayCursor; //!< Cursor must be display only when the widget has the focus
- int this.displayCursorPos; //!< Cursor position in number of Char
- int this.displayCursorPosSelection; //!< Selection position end (can be befor or after cursor and == this.displayCursorPos chan no selection availlable
- protected:
- /**
- * informe the system thet the text change and the start position change
- */
- void markToUpdateTextPosition();
- /**
- * update the display position start == > depending of the position of the Cursor and the size of the Data inside
- * @change this.displayStartPosition < == updated
- */
- void updateTextPosition();
- /**
- * change the cursor position with the curent position requested on the display
- * @param _pos Absolute position of the event
- * @note The display is automaticly requested when change apear.
- */
- void updateCursorPosition( Vector2f _pos, boolean _Selection=false);
- public:
- /**
- * Copy the selected data on the specify clipboard
- * @param _clipboardID Selected clipboard
- */
- void copySelectionToClipBoard(enum gale::context::clipBoard::clipboardListe _clipboardID);
- /**
- * remove the selected area
- * @note This request a regeneration of the display
- */
- void removeSelected();
- public:
- void onRegenerateDisplay() ;
- boolean onEventInput( ewol::event::Input _event) ;
- boolean onEventEntry( ewol::event::Entry _event) ;
- void onEventClipboard(enum gale::context::clipBoard::clipboardListe _clipboardID) ;
- void calculateMinMaxSize() ;
- protected:
- void onDraw() ;
- void onGetFocus() ;
- void onLostFocus() ;
- void changeStatusIn(int _newStatusId);
- protected:
- esignal::Connection this.PCH; //!< Periodic call handle to remove it when needed
- /**
- * Periodic call to update grapgic display
- * @param _event Time generic event
- */
- void periodicCall( ewol::event::Time _event);
- private: // callback functions
- void onCallbackShortCut( String _value);
- void onCallbackEntryClean();
- void onCallbackCut();
- void onCallbackCopy();
- void onCallbackPaste();
- void onCallbackSelect(boolean _all);
- protected:
- void onChangePropertyPassword();
- void onChangePropertyShaper();
- void onChangePropertyValue();
- void onChangePropertyMaxCharacter();
- void onChangePropertyRegex();
- void onChangePropertyTextWhenNothing();
- };
- };
-};
diff --git a/resources/resources/ewol/data/color3.vert b/resources/resources/ewol/data/color3.vert
index 5134b3b..c71c43e 100644
--- a/resources/resources/ewol/data/color3.vert
+++ b/resources/resources/ewol/data/color3.vert
@@ -8,15 +8,13 @@ precision mediump int;
// Input :
layout (location = 0) in vec3 in_position;
layout (location = 3) in vec4 in_colors;
-uniform mat4 in_MatrixTransformation;
-uniform mat4 in_MatrixPosition;
-
+uniform mat4 in_matrixTransformation;
+uniform mat4 in_matrixProjection;
+uniform mat4 in_matrixView;
// output :
varying vec4 io_color;
void main(void) {
- gl_Position = in_MatrixTransformation * in_MatrixPosition * vec4(in_position, 1.0);
- gl_Position = in_MatrixTransformation * vec4(in_position, 1.0);
- //gl_Position = vec4(in_position, 1.0);
+ gl_Position = in_matrixProjection * in_matrixView * in_matrixTransformation * vec4(in_position, 1.0);
io_color = in_colors;
}
diff --git a/resources/resources/ewol/data/text.vert b/resources/resources/ewol/data/text.vert
index 80c5212..740b2f4 100644
--- a/resources/resources/ewol/data/text.vert
+++ b/resources/resources/ewol/data/text.vert
@@ -9,7 +9,9 @@ precision mediump int;
layout (location = 0) in vec3 in_position;
layout (location = 1) in vec2 in_textureCoords;
layout (location = 3) in vec4 in_colors;
-uniform mat4 in_MatrixTransformation;
+uniform mat4 in_matrixTransformation;
+uniform mat4 in_matrixProjection;
+uniform mat4 in_matrixView;
// output :
varying vec4 io_color;
@@ -26,8 +28,7 @@ void main(void) {
*/
varying vec4 io_patern;
void main(void) {
- gl_Position = in_MatrixTransformation * vec4(in_position, 1.0);
- //gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * vec4(in_coord2d, 0.0, 1.0);
+ gl_Position = in_matrixProjection * in_matrixView * in_matrixTransformation * vec4(in_position, 1.0);
// set output color :
io_color = in_colors;
if (in_textureCoords.x<1.0) {
diff --git a/resources/resources/ewol/theme/shape/Button.json b/resources/resources/ewol/theme/shape/Button.json
index b2a5ce8..a50972f 100644
--- a/resources/resources/ewol/theme/shape/Button.json
+++ b/resources/resources/ewol/theme/shape/Button.json
@@ -1,7 +1,4 @@
{
- mode:2,
- display-outside:false,
-
padding-out-left:1,
padding-out-right:1,
padding-out-top:1,
@@ -17,7 +14,6 @@
padding-in-top:1,
padding-in-buttom:1,
- change-time:356,
- program:"THEME_GUI:///Button.prog?lib=ewol",
- color:"THEME_COLOR:///Button.json?lib=ewol"
+ object-file:"THEME:///Button.obj?lib=ewol",
+ object-size:"1,1,1"
}
diff --git a/resources/resources/ewol/theme/shape/Entry.blend b/resources/resources/ewol/theme/shape/Entry.blend
new file mode 100644
index 0000000..d46e150
Binary files /dev/null and b/resources/resources/ewol/theme/shape/Entry.blend differ
diff --git a/resources/resources/ewol/theme/shape/Entry.blend1 b/resources/resources/ewol/theme/shape/Entry.blend1
new file mode 100644
index 0000000..facffdf
Binary files /dev/null and b/resources/resources/ewol/theme/shape/Entry.blend1 differ
diff --git a/resources/resources/ewol/theme/shape/Entry.emf b/resources/resources/ewol/theme/shape/Entry.emf
new file mode 100644
index 0000000..b60b908
--- /dev/null
+++ b/resources/resources/ewol/theme/shape/Entry.emf
@@ -0,0 +1,2 @@
+EMF(STRING)
+# Blender v2.92.0 EMF File: 'Entry.blend'
diff --git a/resources/resources/ewol/theme/shape/Entry.frag b/resources/resources/ewol/theme/shape/Entry.frag
deleted file mode 100644
index bf5d7f2..0000000
--- a/resources/resources/ewol/theme/shape/Entry.frag
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifdef GL_ES
-precision mediump float;
-precision mediump int;
-#endif
-
-uniform vec4 EW_background;
-uniform vec4 EW_border;
-
-
-// transmit from the vertex shader
-varying vec2 v_position; // interpolated position ...
-varying vec2 v_propPos;
-varying vec4 v_colorTansition;
-
-void main(void) {
- // prevent origin moving ...
- gl_FragColor = vec4(v_propPos.y, v_propPos.x, 1.0, 1.0);
- if( v_propPos.x == 1.0
- && v_propPos.y == 1.0) {
- gl_FragColor = v_colorTansition;
- } else if ( v_propPos.x == 0.0
- || v_propPos.y == 0.0) {
- gl_FragColor = EW_background;
- } else {
- gl_FragColor = EW_border;
- }
-}
\ No newline at end of file
diff --git a/resources/resources/ewol/theme/shape/Entry.json b/resources/resources/ewol/theme/shape/Entry.json
index 79eedd2..82f95f4 100644
--- a/resources/resources/ewol/theme/shape/Entry.json
+++ b/resources/resources/ewol/theme/shape/Entry.json
@@ -1,23 +1,25 @@
{
- mode:2,
- display-outside:false,
-
+ # padding "outside" the object in pixel ==> prevent bad display
padding-out-left:2,
padding-out-right:2,
padding-out-top:2,
padding-out-buttom:2,
- border-left:1,
- border-right:1,
- border-top:1,
- border-buttom:1,
-
+ # padding "inside" the object in piuxel ==> prevent bad display
padding-in-left:2,
padding-in-right:2,
padding-in-top:2,
padding-in-buttom:2,
- change-time:356,
- program:"THEME_GUI:///Entry.prog?lib=ewol",
- color:"THEME_COLOR:///Entry.json?lib=ewol"
+ # render program:
+ program-vert:"THEME:shape/aaRenderShape.vert?lib=ewol",
+ program-frag:"THEME:shape/aaRenderShape.frag?lib=ewol",
+
+ # Object to render (with modification)
+ object-file:"THEME:shape/Entry.obj?lib=ewol",
+
+ # Theme Image (pallete)
+ image-palette:"THEME:shape/GuiPaletteColor.png?lib=ewol",
+ # read mode: 'nearest', 'linear'
+ image-palette-load-mode: "nearest",
}
diff --git a/resources/resources/ewol/theme/shape/Entry.mtl b/resources/resources/ewol/theme/shape/Entry.mtl
new file mode 100644
index 0000000..4f7a6c4
--- /dev/null
+++ b/resources/resources/ewol/theme/shape/Entry.mtl
@@ -0,0 +1,24 @@
+# Blender MTL File: 'Entry.blend'
+# Material Count: 2
+
+newmtl TextArea
+Ns 225.000000
+Ka 1.000000 1.000000 1.000000
+Kd 0.800000 0.800000 0.800000
+Ks 0.500000 0.500000 0.500000
+Ke 0.000000 0.000000 0.000000
+Ni 1.450000
+d 1.000000
+illum 2
+map_Kd empty_area.png
+
+newmtl center
+Ns 225.000000
+Ka 1.000000 1.000000 1.000000
+Kd 0.800000 0.800000 0.800000
+Ks 0.500000 0.500000 0.500000
+Ke 0.000000 0.000000 0.000000
+Ni 1.450000
+d 1.000000
+illum 2
+map_Kd GuiPaletteColor.png
diff --git a/resources/resources/ewol/theme/shape/Entry.obj b/resources/resources/ewol/theme/shape/Entry.obj
new file mode 100644
index 0000000..62398b4
--- /dev/null
+++ b/resources/resources/ewol/theme/shape/Entry.obj
@@ -0,0 +1,99 @@
+# Blender v2.92.0 OBJ File: 'Entry.blend'
+# www.blender.org
+mtllib Entry.mtl
+o Cube
+v 20.042355 20.042355 -7.751226
+v 20.042355 -20.042355 -7.751226
+v 20.042355 20.042355 4.633502
+v 20.042355 -20.042355 4.633502
+v -20.042355 20.042355 -7.751226
+v -20.042355 -20.042355 -7.751226
+v -20.042355 20.042355 4.633502
+v -20.042355 -20.042355 4.633502
+v 10.127714 10.127714 7.726907
+v 10.127714 -10.127714 7.726907
+v -10.127714 10.127714 7.726907
+v -10.127714 -10.127714 7.726907
+v -10.127714 -10.127714 9.146553
+v -10.127714 10.127714 9.146553
+v 10.127714 10.127714 9.146553
+v 10.127714 -10.127714 9.146553
+vt 0.174907 0.947863
+vt 0.131613 0.991157
+vt 0.132843 0.945402
+vt 0.074219 0.995849
+vt 0.120606 0.943115
+vt 0.121582 0.993408
+vt 0.178368 0.944941
+vt 0.137534 0.984544
+vt 0.142456 0.948632
+vt 0.171985 0.949093
+vt 0.136074 0.991157
+vt 0.137304 0.950323
+vt 0.174677 0.949093
+vt 0.135074 0.992387
+vt 0.136304 0.949093
+vt 0.112927 0.992387
+vt 0.078245 0.948093
+vt 0.073324 0.991157
+vt 0.101769 0.970961
+vt 0.080974 0.959440
+vt 0.102023 0.957458
+vt 0.111927 0.985005
+vt 0.078476 0.953015
+vt 0.082167 0.983774
+vt 0.137534 0.988235
+vt 0.177138 0.947863
+vt 0.135074 0.947862
+vt 0.013265 0.951784
+vt 0.051868 0.992387
+vt 0.013034 0.993618
+vt 0.178598 0.993618
+vt 0.074219 0.944092
+vt 0.178368 0.988235
+vt 0.173216 0.991157
+vt 0.175907 0.989926
+vt 0.111696 0.944402
+vt 0.080720 0.975385
+vt 0.113157 0.949323
+vt 0.172446 0.988465
+vt 0.054098 0.951784
+vt 0.000100 0.000100
+vt 0.999900 0.999900
+vt 0.000100 0.999900
+vt 0.999900 0.000100
+vn 0.0000 1.0000 0.0000
+vn -0.2978 0.0000 0.9546
+vn -1.0000 0.0000 0.0000
+vn 0.0000 -1.0000 0.0000
+vn 1.0000 0.0000 0.0000
+vn 0.0000 -0.2978 0.9546
+vn 0.0000 0.2978 0.9546
+vn 0.2978 0.0000 0.9546
+vn 0.0000 0.0000 -1.0000
+vn 0.0000 0.0000 1.0000
+usemtl center
+s off
+f 5/1/1 3/2/1 1/3/1
+f 8/4/2 11/5/2 7/6/2
+f 7/7/3 6/8/3 8/9/3
+f 2/10/4 8/11/4 6/12/4
+f 1/13/5 4/14/5 2/15/5
+f 4/16/6 12/17/6 8/18/6
+f 7/19/7 9/20/7 3/21/7
+f 3/22/8 10/23/8 4/24/8
+f 6/25/9 1/26/9 2/27/9
+f 10/28/10 11/29/10 12/30/10
+f 5/1/1 7/31/1 3/2/1
+f 8/4/2 12/32/2 11/5/2
+f 7/7/3 5/33/3 6/8/3
+f 2/10/4 4/34/4 8/11/4
+f 1/13/5 3/35/5 4/14/5
+f 4/16/6 10/36/6 12/17/6
+f 7/19/7 11/37/7 9/20/7
+f 3/22/8 9/38/8 10/23/8
+f 6/25/9 5/39/9 1/26/9
+f 10/28/10 9/40/10 11/29/10
+usemtl TextArea
+f 15/41/10 13/42/10 16/43/10
+f 15/41/10 14/44/10 13/42/10
diff --git a/resources/resources/ewol/theme/shape/Entry.vert b/resources/resources/ewol/theme/shape/Entry.vert
deleted file mode 100644
index d02de34..0000000
--- a/resources/resources/ewol/theme/shape/Entry.vert
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifdef GL_ES
-precision mediump float;
-precision mediump int;
-#endif
-
-struct widgetStateProperty {
- int stateOld;
- int stateNew;
- float transition;
-};
-
-// Input :
-attribute vec2 EW_coord2d;
-attribute vec2 EW_widgetPropertyPos;
-uniform mat4 EW_MatrixTransformation;
-uniform widgetStateProperty EW_status;
-uniform vec4 EW_foreground;
-uniform vec4 EW_foregroundSelected;
-uniform vec4 EW_foregroundHover;
-
-// output :
-varying vec2 v_position; // This will be passed into the fragment shader.
-varying vec2 v_propPos;
-varying vec4 v_colorTansition;
-
-void main(void) {
-
- gl_Position = EW_MatrixTransformation * vec4(EW_coord2d, 0.0, 1.0);
- // transmit position of the curent element (intermolated ...)
- v_position = EW_coord2d;
- v_propPos = EW_widgetPropertyPos;
-
-
- vec4 colorOld = EW_foreground;
- if(EW_status.stateOld==1) {
- colorOld = EW_foregroundSelected;
- } else if(EW_status.stateOld==2) {
- colorOld = EW_foregroundHover;
- }
- vec4 colorNew = EW_foreground;
- if(EW_status.stateNew==1) {
- colorNew = EW_foregroundSelected;
- } else if(EW_status.stateNew==2) {
- colorNew = EW_foregroundHover;
- }
-
- // note : int() is needed for the OpenGL ES platform
- v_colorTansition = colorOld*(1.0-EW_status.transition)
- + colorNew*EW_status.transition;
-}
diff --git a/resources/resources/ewol/theme/shape/GuiPaletteColor.png b/resources/resources/ewol/theme/shape/GuiPaletteColor.png
new file mode 100644
index 0000000..4d37379
Binary files /dev/null and b/resources/resources/ewol/theme/shape/GuiPaletteColor.png differ
diff --git a/resources/resources/ewol/theme/shape/aaRenderShape.frag b/resources/resources/ewol/theme/shape/aaRenderShape.frag
new file mode 100644
index 0000000..13d2aa8
--- /dev/null
+++ b/resources/resources/ewol/theme/shape/aaRenderShape.frag
@@ -0,0 +1,17 @@
+#version 400 core
+
+#ifdef GL_ES
+precision mediump float;
+precision mediump int;
+#endif
+
+in vec2 io_textureCoords;
+
+uniform sampler2D in_textureBase;
+
+// output:
+out vec4 out_Color;
+
+void main(void) {
+ out_Color = texture(in_textureBase, io_textureCoords);
+}
diff --git a/resources/resources/ewol/theme/shape/aaRenderShape.vert b/resources/resources/ewol/theme/shape/aaRenderShape.vert
new file mode 100644
index 0000000..e7b436b
--- /dev/null
+++ b/resources/resources/ewol/theme/shape/aaRenderShape.vert
@@ -0,0 +1,22 @@
+#version 400 core
+
+#ifdef GL_ES
+precision mediump float;
+precision mediump int;
+#endif
+
+// Input:
+layout (location = 0) in vec3 in_position;
+layout (location = 1) in vec2 in_textureCoords;
+
+uniform mat4 in_matrixTransformation;
+uniform mat4 in_matrixProjection;
+uniform mat4 in_matrixView;
+
+// output:
+out vec2 io_textureCoords;
+
+void main(void) {
+ gl_Position = in_matrixProjection * in_matrixView * in_matrixTransformation * vec4(in_position, 1.0);
+ io_textureCoords = in_textureCoords;
+}
diff --git a/resources/resources/ewol/theme/shape/empty_area.png b/resources/resources/ewol/theme/shape/empty_area.png
new file mode 100644
index 0000000..80bb9cc
Binary files /dev/null and b/resources/resources/ewol/theme/shape/empty_area.png differ
diff --git a/resources/resources/ewol/theme/shape/pot.blend b/resources/resources/ewol/theme/shape/pot.blend
new file mode 100644
index 0000000..95aeb3a
Binary files /dev/null and b/resources/resources/ewol/theme/shape/pot.blend differ
diff --git a/resources/resources/ewol/theme/shape/pot.blend1 b/resources/resources/ewol/theme/shape/pot.blend1
new file mode 100644
index 0000000..9631f6c
Binary files /dev/null and b/resources/resources/ewol/theme/shape/pot.blend1 differ
diff --git a/samples/src/sample/atriasoft/ewol/ComplexWindiows1/Appl.java b/samples/src/sample/atriasoft/ewol/ComplexWindiows1/Appl.java
new file mode 100644
index 0000000..21be3a3
--- /dev/null
+++ b/samples/src/sample/atriasoft/ewol/ComplexWindiows1/Appl.java
@@ -0,0 +1,80 @@
+package sample.atriasoft.ewol.ComplexWindiows1;
+
+import org.atriasoft.etk.Configs;
+import org.atriasoft.etk.math.Vector2f;
+import org.atriasoft.ewol.context.EwolApplication;
+import org.atriasoft.ewol.context.EwolContext;
+
+public class Appl implements EwolApplication {
+
+ //! [ewol_sample_HW_main_application]
+ private void localCreate(final EwolContext context) {
+ //! [ewol_sample_HW_main_parse_arguments]
+ // parse all the argument of the application
+ for (int iii = 0; iii < context.getCmd().size(); iii++) {
+ String tmpppp = context.getCmd().get(iii);
+ if (tmpppp == "-h" || tmpppp == "--help") {
+ Log.print(" -h/--help display this help");
+ System.exit(0);
+ }
+ }
+ //! [ewol_sample_HW_main_parse_arguments]
+ //! [ewol_sample_HW_main_set_windows_size]
+ // TODO : Remove this: Move if in the windows properties
+ context.setSize(new Vector2f(800, 600));
+ //! [ewol_sample_HW_main_set_windows_size]
+ //! [ewol_sample_HW_main_set_font_property]
+ // select font preference of der with a basic application size
+ Configs.getConfigFonts().set("FreeSherif", 12);
+ //! [ewol_sample_HW_main_set_font_property]
+ //! [ewol_sample_HW_main_set_windows]
+ // Create the windows
+ MainWindows basicWindows = new MainWindows();
+ // configure the ewol context to use the new windows
+ context.setWindows(basicWindows);
+ //! [ewol_sample_HW_main_set_windows]
+ }
+
+ @Override
+ public void onCreate(final EwolContext context) {
+ Log.info("Application onCreate: [BEGIN]");
+ localCreate(context);
+ Log.info("Application onCreate: [ END ]");
+ }
+
+ @Override
+ public void onDestroy(final EwolContext context) {
+ Log.info("Application onDestroy: [BEGIN]");
+
+ Log.info("Application onDestroy: [ END ]");
+ }
+
+ @Override
+ public void onPause(final EwolContext context) {
+ Log.info("Application onPause: [BEGIN]");
+
+ Log.info("Application onPause: [ END ]");
+ }
+
+ @Override
+ public void onResume(final EwolContext context) {
+ Log.info("Application onResume: [BEGIN]");
+
+ Log.info("Application onResume: [ END ]");
+ }
+
+ @Override
+ public void onStart(final EwolContext context) {
+ Log.info("Application onStart: [BEGIN]");
+
+ Log.info("Application onStart: [ END ]");
+ }
+
+ @Override
+ public void onStop(final EwolContext context) {
+ Log.info("Application onStop: [BEGIN]");
+
+ Log.info("Application onStop: [ END ]");
+ }
+
+}
\ No newline at end of file
diff --git a/samples/src/sample/atriasoft/ewol/ComplexWindiows1/ComplexeWindows1Main.java b/samples/src/sample/atriasoft/ewol/ComplexWindiows1/ComplexeWindows1Main.java
new file mode 100644
index 0000000..e1367cd
--- /dev/null
+++ b/samples/src/sample/atriasoft/ewol/ComplexWindiows1/ComplexeWindows1Main.java
@@ -0,0 +1,15 @@
+package sample.atriasoft.ewol.ComplexWindiows1;
+
+import org.atriasoft.etk.Uri;
+import org.atriasoft.ewol.Ewol;
+
+public class ComplexeWindows1Main {
+ public static void main(final String[] args) {
+ Ewol.init();
+ //Uri.addLibrary("ne", MainCollisionTest.class, "testDataLoxelEngine/");
+ Uri.setApplication(ComplexeWindows1Main.class);
+ Ewol.run(new Appl(), args);
+ }
+
+ private ComplexeWindows1Main() {}
+}
diff --git a/samples/src/sample/atriasoft/ewol/ComplexWindiows1/Log.java b/samples/src/sample/atriasoft/ewol/ComplexWindiows1/Log.java
new file mode 100644
index 0000000..a0581e6
--- /dev/null
+++ b/samples/src/sample/atriasoft/ewol/ComplexWindiows1/Log.java
@@ -0,0 +1,39 @@
+package sample.atriasoft.ewol.ComplexWindiows1;
+
+public class Log {
+ private static final String LIBNAME = "LoxelEngine";
+
+ public static void critical(final String data) {
+ System.out.println("[C] " + Log.LIBNAME + " | " + data);
+ }
+
+ public static void debug(final String data) {
+ System.out.println("[D] " + Log.LIBNAME + " | " + data);
+ }
+
+ public static void error(final String data) {
+ System.out.println("[E] " + Log.LIBNAME + " | " + data);
+ }
+
+ public static void info(final String data) {
+ System.out.println("[I] " + Log.LIBNAME + " | " + data);
+ }
+
+ public static void print(final String data) {
+ System.out.println(data);
+ }
+
+ public static void todo(final String data) {
+ System.out.println("[TODO] " + Log.LIBNAME + " | " + data);
+ }
+
+ public static void verbose(final String data) {
+ System.out.println("[V] " + Log.LIBNAME + " | " + data);
+ }
+
+ public static void warning(final String data) {
+ System.out.println("[W] " + Log.LIBNAME + " | " + data);
+ }
+
+ private Log() {}
+}
diff --git a/samples/src/sample/atriasoft/ewol/ComplexWindiows1/MainWindows.java b/samples/src/sample/atriasoft/ewol/ComplexWindiows1/MainWindows.java
new file mode 100644
index 0000000..8a50c98
--- /dev/null
+++ b/samples/src/sample/atriasoft/ewol/ComplexWindiows1/MainWindows.java
@@ -0,0 +1,71 @@
+package sample.atriasoft.ewol.ComplexWindiows1;
+
+import org.atriasoft.etk.Color;
+import org.atriasoft.etk.Dimension;
+import org.atriasoft.etk.Distance;
+import org.atriasoft.etk.math.Vector2b;
+import org.atriasoft.etk.math.Vector2f;
+import org.atriasoft.ewol.widget.Sizer;
+import org.atriasoft.ewol.widget.Sizer.DisplayMode;
+import org.atriasoft.ewol.widget.Spacer;
+import org.atriasoft.ewol.widget.Windows;
+
+public class MainWindows extends Windows {
+
+ public MainWindows() {
+ //! [ewol_sample_HW_windows_title]
+ setPropertyTitle("Simple sample test");
+ //EwolObject.getContext().getFontDefault().setName("FreeSans");
+ Sizer sizerMain = new Sizer(DisplayMode.modeVert);
+ sizerMain.setPropertyExpand(new Vector2b(true, true));
+ sizerMain.setPropertyFill(new Vector2b(true, true));
+ setSubWidget(sizerMain);
+
+ Sizer sizerHori1 = new Sizer(DisplayMode.modeHori);
+ sizerHori1.setPropertyExpand(new Vector2b(true, true));
+ sizerHori1.setPropertyFill(new Vector2b(true, true));
+ sizerMain.subWidgetAdd(sizerHori1);
+
+ Sizer sizerHori2 = new Sizer(DisplayMode.modeHori);
+ sizerHori2.setPropertyExpand(new Vector2b(true, true));
+ sizerHori2.setPropertyFill(new Vector2b(true, true));
+ sizerMain.subWidgetAdd(sizerHori2);
+
+ {
+ Spacer simpleSpacer = new Spacer();
+ simpleSpacer.setPropertyMinSize(new Dimension(new Vector2f(100, 100), Distance.PIXEL));
+ simpleSpacer.setPropertyColor(Color.ALICE_BLUE);
+ simpleSpacer.setPropertyExpand(new Vector2b(true, true));
+ simpleSpacer.setPropertyFill(new Vector2b(true, true));
+ sizerHori1.subWidgetAdd(simpleSpacer);
+ }
+ {
+ Spacer simpleSpacer = new Spacer();
+ simpleSpacer.setPropertyColor(Color.DARK_GREEN);
+ simpleSpacer.setPropertyExpand(new Vector2b(true, true));
+ simpleSpacer.setPropertyFill(new Vector2b(true, true));
+ sizerHori1.subWidgetAdd(simpleSpacer);
+ }
+ {
+ Spacer simpleSpacer = new Spacer();
+ simpleSpacer.setPropertyColor(Color.CHOCOLATE);
+ simpleSpacer.setPropertyExpand(new Vector2b(true, true));
+ simpleSpacer.setPropertyFill(new Vector2b(true, true));
+ sizerHori1.subWidgetAdd(simpleSpacer);
+ }
+ {
+ Spacer simpleSpacer = new Spacer();
+ simpleSpacer.setPropertyColor(Color.GREEN_YELLOW);
+ simpleSpacer.setPropertyExpand(new Vector2b(true, true));
+ simpleSpacer.setPropertyFill(new Vector2b(true, true));
+ sizerHori2.subWidgetAdd(simpleSpacer);
+ }
+ {
+ Spacer simpleSpacer = new Spacer();
+ simpleSpacer.setPropertyColor(Color.PINK);
+ simpleSpacer.setPropertyExpand(new Vector2b(true, true));
+ simpleSpacer.setPropertyFill(new Vector2b(true, true));
+ sizerHori2.subWidgetAdd(simpleSpacer);
+ }
+ }
+}
diff --git a/samples/src/sample/atriasoft/ewol/sampleEntry/Appl.java b/samples/src/sample/atriasoft/ewol/sampleEntry/Appl.java
new file mode 100644
index 0000000..8c77041
--- /dev/null
+++ b/samples/src/sample/atriasoft/ewol/sampleEntry/Appl.java
@@ -0,0 +1,80 @@
+package sample.atriasoft.ewol.sampleEntry;
+
+import org.atriasoft.etk.Configs;
+import org.atriasoft.etk.math.Vector2f;
+import org.atriasoft.ewol.context.EwolApplication;
+import org.atriasoft.ewol.context.EwolContext;
+
+public class Appl implements EwolApplication {
+
+ //! [ewol_sample_HW_main_application]
+ private void localCreate(final EwolContext context) {
+ //! [ewol_sample_HW_main_parse_arguments]
+ // parse all the argument of the application
+ for (int iii = 0; iii < context.getCmd().size(); iii++) {
+ String tmpppp = context.getCmd().get(iii);
+ if (tmpppp == "-h" || tmpppp == "--help") {
+ Log.print(" -h/--help display this help");
+ System.exit(0);
+ }
+ }
+ //! [ewol_sample_HW_main_parse_arguments]
+ //! [ewol_sample_HW_main_set_windows_size]
+ // TODO : Remove this: Move if in the windows properties
+ context.setSize(new Vector2f(800, 600));
+ //! [ewol_sample_HW_main_set_windows_size]
+ //! [ewol_sample_HW_main_set_font_property]
+ // select font preference of der with a basic application size
+ Configs.getConfigFonts().set("FreeSherif", 48);
+ //! [ewol_sample_HW_main_set_font_property]
+ //! [ewol_sample_HW_main_set_windows]
+ // Create the windows
+ MainWindows basicWindows = new MainWindows();
+ // configure the ewol context to use the new windows
+ context.setWindows(basicWindows);
+ //! [ewol_sample_HW_main_set_windows]
+ }
+
+ @Override
+ public void onCreate(final EwolContext context) {
+ Log.info("Application onCreate: [BEGIN]");
+ localCreate(context);
+ Log.info("Application onCreate: [ END ]");
+ }
+
+ @Override
+ public void onDestroy(final EwolContext context) {
+ Log.info("Application onDestroy: [BEGIN]");
+
+ Log.info("Application onDestroy: [ END ]");
+ }
+
+ @Override
+ public void onPause(final EwolContext context) {
+ Log.info("Application onPause: [BEGIN]");
+
+ Log.info("Application onPause: [ END ]");
+ }
+
+ @Override
+ public void onResume(final EwolContext context) {
+ Log.info("Application onResume: [BEGIN]");
+
+ Log.info("Application onResume: [ END ]");
+ }
+
+ @Override
+ public void onStart(final EwolContext context) {
+ Log.info("Application onStart: [BEGIN]");
+
+ Log.info("Application onStart: [ END ]");
+ }
+
+ @Override
+ public void onStop(final EwolContext context) {
+ Log.info("Application onStop: [BEGIN]");
+
+ Log.info("Application onStop: [ END ]");
+ }
+
+}
\ No newline at end of file
diff --git a/samples/src/sample/atriasoft/ewol/sampleEntry/Log.java b/samples/src/sample/atriasoft/ewol/sampleEntry/Log.java
new file mode 100644
index 0000000..ea6a16d
--- /dev/null
+++ b/samples/src/sample/atriasoft/ewol/sampleEntry/Log.java
@@ -0,0 +1,39 @@
+package sample.atriasoft.ewol.sampleEntry;
+
+public class Log {
+ private static final String LIBNAME = "sampleEntry";
+
+ public static void critical(final String data) {
+ System.out.println("[C] " + Log.LIBNAME + " | " + data);
+ }
+
+ public static void debug(final String data) {
+ System.out.println("[D] " + Log.LIBNAME + " | " + data);
+ }
+
+ public static void error(final String data) {
+ System.out.println("[E] " + Log.LIBNAME + " | " + data);
+ }
+
+ public static void info(final String data) {
+ System.out.println("[I] " + Log.LIBNAME + " | " + data);
+ }
+
+ public static void print(final String data) {
+ System.out.println(data);
+ }
+
+ public static void todo(final String data) {
+ System.out.println("[TODO] " + Log.LIBNAME + " | " + data);
+ }
+
+ public static void verbose(final String data) {
+ System.out.println("[V] " + Log.LIBNAME + " | " + data);
+ }
+
+ public static void warning(final String data) {
+ System.out.println("[W] " + Log.LIBNAME + " | " + data);
+ }
+
+ private Log() {}
+}
diff --git a/samples/src/sample/atriasoft/ewol/sampleEntry/MainWindows.java b/samples/src/sample/atriasoft/ewol/sampleEntry/MainWindows.java
new file mode 100644
index 0000000..c33f8c4
--- /dev/null
+++ b/samples/src/sample/atriasoft/ewol/sampleEntry/MainWindows.java
@@ -0,0 +1,17 @@
+package sample.atriasoft.ewol.sampleEntry;
+
+import org.atriasoft.etk.math.Vector2b;
+import org.atriasoft.ewol.widget.Entry;
+import org.atriasoft.ewol.widget.Windows;
+
+public class MainWindows extends Windows {
+
+ public MainWindows() {
+ setPropertyTitle("Simple sample test");
+ //EwolObject.getContext().getFontDefault().setName("FreeSans");
+ Entry simpleEntry = new Entry();
+ simpleEntry.setPropertyExpand(new Vector2b(true, true));
+ simpleEntry.setPropertyFill(new Vector2b(true, false));
+ setSubWidget(simpleEntry);
+ }
+}
diff --git a/samples/src/sample/atriasoft/ewol/sampleEntry/SampleEntryMain.java b/samples/src/sample/atriasoft/ewol/sampleEntry/SampleEntryMain.java
new file mode 100644
index 0000000..4784170
--- /dev/null
+++ b/samples/src/sample/atriasoft/ewol/sampleEntry/SampleEntryMain.java
@@ -0,0 +1,15 @@
+package sample.atriasoft.ewol.sampleEntry;
+
+import org.atriasoft.etk.Uri;
+import org.atriasoft.ewol.Ewol;
+
+public class SampleEntryMain {
+ public static void main(final String[] args) {
+ Ewol.init();
+ //Uri.addLibrary("ne", MainCollisionTest.class, "testDataLoxelEngine/");
+ Uri.setApplication(MainWindows.class);
+ Ewol.run(new Appl(), args);
+ }
+
+ private SampleEntryMain() {}
+}
diff --git a/samples/src/sample/atriasoft/ewol/simpleWindowsWithImage/Appl.java b/samples/src/sample/atriasoft/ewol/simpleWindowsWithImage/Appl.java
index 4631833..94895eb 100644
--- a/samples/src/sample/atriasoft/ewol/simpleWindowsWithImage/Appl.java
+++ b/samples/src/sample/atriasoft/ewol/simpleWindowsWithImage/Appl.java
@@ -1,5 +1,6 @@
package sample.atriasoft.ewol.simpleWindowsWithImage;
+import org.atriasoft.etk.Configs;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.ewol.context.EwolApplication;
import org.atriasoft.ewol.context.EwolContext;
@@ -24,7 +25,7 @@ public class Appl implements EwolApplication {
//! [ewol_sample_HW_main_set_windows_size]
//! [ewol_sample_HW_main_set_font_property]
// select font preference of der with a basic application size
- context.getFontDefault().set("FreeSherif", 12);
+ Configs.getConfigFonts().set("FreeSherif", 12);
//! [ewol_sample_HW_main_set_font_property]
//! [ewol_sample_HW_main_set_windows]
// Create the windows
diff --git a/src/module-info.java b/src/module-info.java
index 0f4a25f..c857ebe 100644
--- a/src/module-info.java
+++ b/src/module-info.java
@@ -26,4 +26,6 @@ open module org.atriasoft.ewol {
requires transitive org.atriasoft.exml;
requires transitive org.atriasoft.ejson;
requires transitive io.scenarium.logger;
+ requires org.atriasoft.loader3d;
+ requires org.atriasoft.egami;
}
diff --git a/src/org/atriasoft/esignal/Connection.java b/src/org/atriasoft/esignal/Connection.java
index 2e5f4e3..1282723 100644
--- a/src/org/atriasoft/esignal/Connection.java
+++ b/src/org/atriasoft/esignal/Connection.java
@@ -2,4 +2,9 @@ package org.atriasoft.esignal;
public class Connection {
+ public void disconnect() {
+ // TODO Auto-generated method stub
+
+ }
+
}
diff --git a/src/org/atriasoft/esignal/Signal.java b/src/org/atriasoft/esignal/Signal.java
index 853ea1e..04af838 100644
--- a/src/org/atriasoft/esignal/Signal.java
+++ b/src/org/atriasoft/esignal/Signal.java
@@ -7,8 +7,8 @@ import java.util.List;
import java.util.function.Consumer;
class ConnectedElement {
- private final WeakReference