[DEV] update for build URI

This commit is contained in:
Edouard DUPIN 2018-09-29 21:58:25 +02:00
parent 532b64a1f0
commit dbe995abd8
27 changed files with 72 additions and 70 deletions

View File

@ -28,7 +28,7 @@ namespace ewol {
ColorFile();
void init(const etk::Uri& _uri);
public:
DECLARE_RESOURCE_NAMED_FACTORY(ColorFile);
DECLARE_RESOURCE_URI_FACTORY(ColorFile);
/**
* @brief Simple Destructor of this class (nothing specific ...)
*/

View File

@ -22,7 +22,7 @@ namespace ewol {
void init(const etk::Uri& _filename);
public:
virtual ~ConfigFile();
DECLARE_RESOURCE_NAMED_FACTORY(ConfigFile);
DECLARE_RESOURCE_URI_FACTORY(ConfigFile);
public:
void reload();

View File

@ -24,7 +24,7 @@ ewol::widget::Button::Button() :
signalEnter(this, "enter", "The cursor enter inside the button"),
signalLeave(this, "leave", "the cursor leave the button"),
signalValue(this, "value", "button value change"),
propertyShape(this, "shape", "{ewol}THEME:GUI:Button.json", "The display name for config file", &ewol::widget::Button::onChangePropertyShape),
propertyShape(this, "shape", etk::Uri("THEME_GUI://Button.json?lib=ewol"), "The display name for config file", &ewol::widget::Button::onChangePropertyShape),
propertyValue(this, "value", false, "Value of the Button", &ewol::widget::Button::onChangePropertyValue),
propertyLock(this, "lock", lockNone, "Lock the button in a special state to permit changing state only by the coder", &ewol::widget::Button::onChangePropertyLock),
propertyToggleMode(this, "toggle", false, "The Button can toogle", &ewol::widget::Button::onChangePropertyToggleMode),

View File

@ -41,7 +41,7 @@ namespace ewol {
esignal::Signal<> signalLeave;
esignal::Signal<bool> signalValue;
public: // propertie list
eproperty::Value<etk::String> propertyShape; //!< shaper name property
eproperty::Value<etk::Uri> propertyShape; //!< shaper name property
eproperty::Value<bool> propertyValue; //!< Current state of the button.
eproperty::List<enum buttonLock> propertyLock; //!< Current lock state of the button.
eproperty::Value<bool> propertyToggleMode; //!< The button is able to toggle.

View File

@ -25,7 +25,7 @@ ETK_DECLARE_TYPE(ewol::widget::ButtonColor);
ewol::widget::ButtonColor::ButtonColor() :
signalChange(this, "change", "Button color change value"),
propertyValue(this, "color", etk::color::black, "Current color", &ewol::widget::ButtonColor::onChangePropertyValue),
propertyShape(this, "shape", "{ewol}THEME:GUI:Button.json", "shape of the widget", &ewol::widget::ButtonColor::onChangePropertyShape),
propertyShape(this, "shape", etk::Uri("THEME_GUI://Button.json?lib=ewol"), "shape of the widget", &ewol::widget::ButtonColor::onChangePropertyShape),
m_widgetContextMenu(null) {
addObjectType("ewol::widget::ButtonColor");
changeStatusIn(STATUS_UP);

View File

@ -25,7 +25,7 @@ namespace ewol {
esignal::Signal<etk::Color<>> signalChange;
public: // properties
eproperty::Value<etk::Color<>> propertyValue; //!< Current color.
eproperty::Value<etk::String> propertyShape; //!< Current color.
eproperty::Value<etk::Uri> propertyShape; //!< Current color.
private:
ewol::compositing::Shaper m_shaper; //!< Compositing theme.
ewol::compositing::Text m_text; //!< Compositing Test display.

View File

@ -27,7 +27,7 @@ ewol::widget::CheckBox::CheckBox() :
"Basic value of the widget",
&ewol::widget::CheckBox::onChangePropertyValue),
propertyShape(this, "shape",
"{ewol}THEME:GUI:CheckBox.json",
etk::Uri("THEME_GUI://CheckBox.json?lib=ewol"),
"The display name for config file",
&ewol::widget::CheckBox::onChangePropertyShape),
m_mouseHover(false),

View File

@ -27,7 +27,7 @@ namespace ewol {
esignal::Signal<bool> signalValue;
public: // propertie list
eproperty::Value<bool> propertyValue; //!< Current state of the checkbox.
eproperty::Value<etk::String> propertyShape; //!< shape of the widget
eproperty::Value<etk::Uri> propertyShape; //!< shape of the widget
private:
ewol::compositing::Shaper m_shaper; //!< Compositing theme.
bool m_mouseHover; //!< Flag to know where the mouse is (inside the displayed widget (if not fill)).

View File

@ -18,7 +18,7 @@ ETK_DECLARE_TYPE(enum ewol::widget::ContextMenu::markPosition);
ewol::widget::ContextMenu::ContextMenu():
propertyShape(this, "shape",
"{ewol}THEME:GUI:ContextMenu.json",
etk::Uri("THEME_GUI://ContextMenu.json?lib=ewol"),
"the display name for config file",
&ewol::widget::ContextMenu::onChangePropertyShape),
propertyArrowPos(this, "arrow-position",

View File

@ -31,7 +31,7 @@ namespace ewol {
markNone
};
public: // properties
eproperty::Value<etk::String> propertyShape; //!< shape of the widget.
eproperty::Value<etk::Uri> propertyShape; //!< shape of the widget.
eproperty::Value<vec2> propertyArrowPos;
eproperty::List<enum markPosition> propertyArrawBorder;
protected:

View File

@ -27,7 +27,7 @@ ewol::widget::Entry::Entry() :
"Not display content in password mode",
&ewol::widget::Entry::onChangePropertyPassword),
propertyShape(this, "shape",
"{ewol}THEME:GUI:Entry.json",
etk::Uri("THEME_GUI://Entry.json?lib=ewol"),
"Shaper to display the background",
&ewol::widget::Entry::onChangePropertyShaper),
propertyValue(this, "value",

View File

@ -38,7 +38,7 @@ namespace ewol {
esignal::Signal<etk::String> signalModify; //!< data change
public: // propertie list
eproperty::Value<bool> propertyPassword; //!< Disable display of the content of the entry
eproperty::Value<etk::String> propertyShape;
eproperty::Value<etk::Uri> propertyShape;
eproperty::Value<etk::String> propertyValue; //!< string that must be displayed
eproperty::Range<int32_t> propertyMaxCharacter; //!< number max of xharacter in the list
eproperty::Value<etk::String> propertyRegex; //!< regular expression value

View File

@ -28,7 +28,7 @@ ewol::widget::Image::Image() :
m_colorId(-1) {
addObjectType("ewol::widget::Image");
m_imageRenderSize = vec2(0,0);
m_colorProperty = ewol::resource::ColorFile::create("{ewol}THEME:COLOR:Image.json");
m_colorProperty = ewol::resource::ColorFile::create(etk::Uri("THEME_COLOR://Image.json?lib=ewol"));
if (m_colorProperty != null) {
m_colorId = m_colorProperty->request("foreground");
}

View File

@ -28,7 +28,7 @@ ewol::widget::Label::Label() :
m_colorDefaultFgText(-1),
m_colorDefaultBgText(-1){
addObjectType("ewol::widget::Label");
m_colorProperty = ewol::resource::ColorFile::create("{ewol}THEME:COLOR:Label.json");
m_colorProperty = ewol::resource::ColorFile::create(etk::Uri("THEME_COLOR://Label.json?lib=ewol"));
if (m_colorProperty != null) {
m_colorDefaultFgText = m_colorProperty->request("foreground");
m_colorDefaultBgText = m_colorProperty->request("background");

View File

@ -17,7 +17,7 @@ static const char* annimationIncrease = "increase";
ewol::widget::PopUp::PopUp() :
propertyShape(this, "shaper",
"{ewol}THEME:GUI:PopUp.json",
etk::Uri("THEME_GUI://PopUp.json?lib=ewol"),
"The shaper properties",
&ewol::widget::PopUp::onChangePropertyShape),
propertyLockExpand(this, "lock",

View File

@ -23,7 +23,7 @@ namespace ewol {
*/
class PopUp : public ewol::widget::Container {
public: // properties
eproperty::Value<etk::String> propertyShape; //!< Compositing theme.
eproperty::Value<etk::Uri> propertyShape; //!< Compositing theme.
eproperty::Value<bvec2> propertyLockExpand; //!< Lock the expend of the sub widget to this one == > this permit to limit bigger subWidget
eproperty::Value<bool> propertyCloseOutEvent; //!< ratio progression of a sliding
protected:

View File

@ -18,11 +18,11 @@ ewol::widget::Scroll::Scroll() :
"Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end",
&ewol::widget::Scroll::onChangePropertyLimit),
propertyShapeVert(this, "shape-vert",
"{ewol}THEME:GUI:WidgetScrolled.json",
etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"),
"shape for the vertical display",
&ewol::widget::Scroll::onChangePropertyShapeVert),
propertyShapeHori(this, "shape-hori",
"{ewol}THEME:GUI:WidgetScrolled.json",
etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"),
"shape for the horizonal display",
&ewol::widget::Scroll::onChangePropertyShapeHori),
propertyHover(this, "hover",

View File

@ -20,8 +20,8 @@ namespace ewol {
class Scroll : public ewol::widget::Container {
public: // properties
eproperty::Range<vec2> propertyLimit; //!< Set the limitation of the ratio in the sreen
eproperty::Value<etk::String> propertyShapeVert; //!< Vertical shaper name
eproperty::Value<etk::String> propertyShapeHori; //!< Horizontal shaper name
eproperty::Value<etk::Uri> propertyShapeVert; //!< Vertical shaper name
eproperty::Value<etk::Uri> propertyShapeHori; //!< Horizontal shaper name
eproperty::Value<bool> propertyHover; //!< Horizontal shaper name
public:
enum highSpeedMode {

View File

@ -28,7 +28,7 @@ ewol::widget::Select::Select() :
&ewol::widget::Select::onChangePropertyValue) {
addObjectType("ewol::widget::Select");
// override the basic parameter:
propertyShape.setDirectCheck("{ewol}THEME:GUI:Select.json");
propertyShape.setDirectCheck(etk::Uri("THEME_GUI://Select.json?lib=ewol"));
propertySpinMode.setDirect(ewol::widget::spinPosition_noneRight);
propertySpinMode.changeDefault(ewol::widget::spinPosition_noneRight);
propertySpinMode.rename("none-none", "none");

View File

@ -38,7 +38,7 @@ ewol::widget::Spin::Spin() :
"fix-point mantis",
&ewol::widget::Spin::onChangePropertyMantis) {
addObjectType("ewol::widget::Spin");
propertyShape.setDirectCheck("{ewol}THEME:GUI:Spin.json");
propertyShape.setDirectCheck(etk::Uri("THEME_GUI://Spin.json?lib=ewol"));
}
ewol::widget::Spin::~Spin() {

View File

@ -15,11 +15,11 @@ ETK_DECLARE_TYPE(ewol::widget::WidgetScrolled);
ewol::widget::WidgetScrolled::WidgetScrolled() :
propertyShapeVert(this, "shape-vert",
"{ewol}THEME:GUI:WidgetScrolled.json",
etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"),
"shape for the vertical display",
&ewol::widget::WidgetScrolled::onChangePropertyShapeVert),
propertyShapeHori(this, "shape-hori",
"{ewol}THEME:GUI:WidgetScrolled.json",
etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"),
"shape for the horizonal display",
&ewol::widget::WidgetScrolled::onChangePropertyShapeHori),
m_shaperH(),

View File

@ -23,8 +23,8 @@ namespace ewol {
*/
class WidgetScrolled : public ewol::Widget {
public: // properties:
eproperty::Value<etk::String> propertyShapeVert; //!< Vertical shaper name
eproperty::Value<etk::String> propertyShapeHori; //!< Horizontal shaper name
eproperty::Value<etk::Uri> propertyShapeVert; //!< Vertical shaper name
eproperty::Value<etk::Uri> propertyShapeHori; //!< Horizontal shaper name
// TODO : All property
public:
enum scrollingMode {

View File

@ -18,8 +18,16 @@
ETK_DECLARE_TYPE(ewol::widget::Windows);
ewol::widget::Windows::Windows() :
propertyColorConfiguration(this, "file-color", "{ewol}THEME:COLOR:Windows.json", "color file link on the theme", &ewol::widget::Windows::onChangePropertyColor),
propertyTitle(this, "title", "No title", "Title of the windows", &ewol::widget::Windows::onChangePropertyTitle),
propertyColorConfiguration(this,
"file-color",
etk::Uri("THEME_COLOR://Windows.json?lib=ewol"),
"File color of the Windows",
&ewol::widget::Windows::onChangePropertyColor),
propertyTitle(this,
"title",
"No title",
"Title of the windows",
&ewol::widget::Windows::onChangePropertyTitle),
m_resourceColor(null),
m_colorBg(-1) {
addObjectType("ewol::widget::Windows");

View File

@ -21,7 +21,7 @@ namespace ewol {
*/
class Windows : public ewol::Widget {
public:
eproperty::Value<etk::String> propertyColorConfiguration; //!< Configuration file of the windows theme
eproperty::Value<etk::Uri> propertyColorConfiguration; //!< Configuration file of the windows theme
eproperty::Value<etk::String> propertyTitle; //!< Current title of the windows
protected:
ememory::SharedPtr<ewol::resource::ColorFile> m_resourceColor; //!< theme color property (name of file in @ref propertyColorConfiguration)

View File

@ -19,7 +19,7 @@
//#include <etk/Vector.hpp>
#include <etk/Vector.hpp>
#include <etk/tool.hpp>
#include <etk/os/FSNode.hpp>
#include <etk/path/fileSystem.hpp>
extern "C" {
// file browsing ...
@ -34,7 +34,7 @@ ewol::widget::FileChooser::FileChooser() :
signalCancel(this, "cancel", ""),
signalValidate(this, "validate", ""),
propertyPath(this, "path",
etk::getUserHomeFolder(),
etk::path::getHomePath(),
"",
&ewol::widget::FileChooser::onChangePropertyPath),
propertyFile(this, "file",
@ -72,7 +72,7 @@ void ewol::widget::FileChooser::init() {
subBind(ewol::widget::ListFileSystem, "[" + etk::toString(getId()) + "]file-shooser:list-files", signalFileSelect, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileSelectChange);
subBind(ewol::widget::ListFileSystem, "[" + etk::toString(getId()) + "]file-shooser:list-files", signalFileValidate, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileValidate);
subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-file", signalModify, sharedFromThis(), &ewol::widget::FileChooser::onCallbackEntryFileChangeValue);
subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-file", signalEnter, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileValidate);
subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-file", signalEnter, sharedFromThis(), &ewol::widget::FileChooser::onCallbackEntryFileChangeValidate);
subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-folder", signalModify, sharedFromThis(), &ewol::widget::FileChooser::onCallbackEntryFolderChangeValue);
//composerBind(ewol::widget::CheckBox, "[" + etk::toString(getId()) + "]file-shooser:entry-folder", signalEnter, sharedFromThis(), &ewol::widget::FileChooser::);
subBind(ewol::widget::Image, "[" + etk::toString(getId()) + "]file-shooser:img-home", signalPressed, sharedFromThis(), &ewol::widget::FileChooser::onCallbackHomePressed);
@ -96,7 +96,7 @@ void ewol::widget::FileChooser::onChangePropertyPath() {
}
void ewol::widget::FileChooser::onChangePropertyFile() {
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-file", "value", propertyFile);
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-file", "value", propertyFile.getString());
//updateCurrentFolder();
}
@ -118,10 +118,10 @@ void ewol::widget::FileChooser::onCallbackEntryFolderChangeValue(const etk::Stri
}
void ewol::widget::FileChooser::onCallbackEntryFileChangeValue(const etk::String& _value) {
// == > change the file name
// == > change the file name.get(.get(
propertyFile.setDirect(_value);
// update the selected file in the list :
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "select", propertyFile);
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "select", propertyFile.getString());
}
void ewol::widget::FileChooser::onCallbackButtonCancelPressed() {
@ -140,17 +140,16 @@ void ewol::widget::FileChooser::onCallbackHidenFileChangeChangeValue(const bool&
}
}
void ewol::widget::FileChooser::onCallbackListFolderSelectChange(const etk::String& _value) {
void ewol::widget::FileChooser::onCallbackListFolderSelectChange(const etk::Path& _value) {
// == > this is an internal event ...
EWOL_DEBUG(" old PATH: '" << *propertyPath << "' + '" << _value << "'");
propertyPath.setDirect(propertyPath.get() + _value);
propertyPath.setDirect(*propertyPath / _value);
EWOL_DEBUG("new PATH: '" << *propertyPath << "'");
propertyPath.setDirect(etk::simplifyPath(*propertyPath));
propertyFile.setDirect("");
updateCurrentFolder();
}
void ewol::widget::FileChooser::onCallbackListFileSelectChange(const etk::String& _value) {
void ewol::widget::FileChooser::onCallbackListFileSelectChange(const etk::Path& _value) {
propertyFile.set(_value);
/*
etk::String tmpFileCompleatName = m_folder;
@ -159,7 +158,7 @@ void ewol::widget::FileChooser::onCallbackListFileSelectChange(const etk::String
*/
}
void ewol::widget::FileChooser::onCallbackListFileValidate(const etk::String& _value) {
void ewol::widget::FileChooser::onCallbackListFileValidate(const etk::Path& _value) {
// select the file == > generate a validate
propertyFile.set(_value);
EWOL_VERBOSE(" generate a fiel opening : '" << propertyPath << "' / '" << propertyFile << "'");
@ -167,6 +166,10 @@ void ewol::widget::FileChooser::onCallbackListFileValidate(const etk::String& _v
autoDestroy();
}
void ewol::widget::FileChooser::onCallbackEntryFileChangeValidate(const etk::String& _value) {
onCallbackListFileValidate(_value);
}
void ewol::widget::FileChooser::onCallbackListValidate() {
if (propertyFile.get() == "") {
EWOL_WARNING(" Validate : '" << propertyPath << "' / '" << propertyFile << "' ==> error No name ...");
@ -178,31 +181,21 @@ void ewol::widget::FileChooser::onCallbackListValidate() {
}
void ewol::widget::FileChooser::onCallbackHomePressed() {
etk::String tmpUserFolder = etk::getUserHomeFolder();
EWOL_DEBUG("new PATH : \"" << tmpUserFolder << "\"");
propertyPath.setDirect(etk::simplifyPath(tmpUserFolder));
etk::Path tmpUserFolder = etk::path::getHomePath();
EWOL_DEBUG("new PATH: '" << tmpUserFolder << "'");
propertyPath.setDirect(tmpUserFolder);
propertyFile.setDirect("");
updateCurrentFolder();
}
void ewol::widget::FileChooser::updateCurrentFolder() {
if (*propertyPath != "") {
if (propertyPath.get()[propertyPath->size()-1] != '/') {
propertyPath.getDirect() += "/";
}
}
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "path", propertyPath);
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-folder", "path", propertyPath);
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-folder", "value", propertyPath);
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "path", propertyPath.getString());
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-folder", "path", propertyPath.getString());
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-folder", "value", propertyPath.getString());
markToRedraw();
}
etk::String ewol::widget::FileChooser::getCompleateFileName() {
etk::String tmpString = propertyPath;
tmpString += "/";
tmpString += propertyFile;
etk::FSNode node(tmpString);
return node.getName();
etk::Path ewol::widget::FileChooser::getCompleateFileName() {
return *propertyPath / *propertyFile;
}

View File

@ -66,10 +66,10 @@ namespace ewol {
class FileChooser : public ewol::widget::Composer {
public: // signals
esignal::Signal<> signalCancel; //!< abort the display of the pop-up or press cancel button
esignal::Signal<etk::String> signalValidate; //!< select file(s)
esignal::Signal<etk::Path> signalValidate; //!< select file(s)
public: // properties
eproperty::Value<etk::String> propertyPath; //!< Current path to explore
eproperty::Value<etk::String> propertyFile; //!< Selected file
eproperty::Value<etk::Path> propertyPath; //!< Current path to explore
eproperty::Value<etk::Path> propertyFile; //!< Selected file
eproperty::Value<etk::String> propertyLabelTitle; //!< Label of the pop-up (can use translation)
eproperty::Value<etk::String> propertyLabelValidate; //!< Label of validate button of the pop-up (can use translation)
eproperty::Value<etk::String> propertyLabelCancel; //!< Label of cancel/close button of the pop-up (can use translation)
@ -80,7 +80,7 @@ namespace ewol {
DECLARE_WIDGET_FACTORY(FileChooser, "FileChooser");
virtual ~FileChooser();
private:
etk::String getCompleateFileName();
etk::Path getCompleateFileName();
void updateCurrentFolder();
public:
void onGetFocus() override;
@ -88,11 +88,12 @@ namespace ewol {
// callback functions:
void onCallbackEntryFolderChangeValue(const etk::String& _value);
void onCallbackEntryFileChangeValue(const etk::String& _value);
void onCallbackEntryFileChangeValidate(const etk::String& _value);
void onCallbackButtonCancelPressed();
void onCallbackHidenFileChangeChangeValue(const bool& _value);
void onCallbackListFolderSelectChange(const etk::String& _value);
void onCallbackListFileSelectChange(const etk::String& _value);
void onCallbackListFileValidate(const etk::String& _value);
void onCallbackListFolderSelectChange(const etk::Path& _value);
void onCallbackListFileSelectChange(const etk::Path& _value);
void onCallbackListFileValidate(const etk::Path& _value);
void onCallbackListValidate();
void onCallbackHomePressed();
protected:

View File

@ -63,7 +63,7 @@ namespace ewol {
*/
class SpinBase : public ewol::widget::Sizer {
public: // properties list:
eproperty::Value<etk::String> propertyShape; //!< Shape of the widget
eproperty::Value<etk::Uri> propertyShape; //!< Shape of the widget
eproperty::List<enum ewol::widget::spinPosition> propertySpinMode; //!< How to display the spin base
public:
UN_DECLARE_FACTORY(SpinBase);