diff --git a/build b/build index 3cfc489b..8478e412 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 3cfc489b02d62600898973b1a4a29543fc8a691a +Subproject commit 8478e412ae1d3a80c463f5f4bec7f9b846be33ef diff --git a/external/etk b/external/etk index c7ece69d..61bd6002 160000 --- a/external/etk +++ b/external/etk @@ -1 +1 @@ -Subproject commit c7ece69d4e1018107b4d6c0b5f99764e06df0827 +Subproject commit 61bd6002d03ac065c40ac581661495fe9e237706 diff --git a/sources/android/PROJECT_NAME.java b/sources/android/PROJECT_NAME.java deleted file mode 100644 index c145f734..00000000 --- a/sources/android/PROJECT_NAME.java +++ /dev/null @@ -1,34 +0,0 @@ -/** -******************************************************************************* -* @file __PROJECT_NAME__.java -* @brief Java __PROJECT_NAME__ code. -* @author Edouard DUPIN, Kevin BILLONNEAU -* @date 11/07/2012 -* @par Project -* ewol -* -* @par Copyright -* Copyright 2011 Edouard DUPIN, all right reserved -* -* This software is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY. -* -* Licence summary : -* You can modify and redistribute the sources code and binaries. -* You can send me the bug-fix -* -* Term of the licence in in the file licence.txt. -* -******************************************************************************* -*/ - -package __PROJECT_ORG_TYPE__.__PROJECT_VENDOR__.__PROJECT_PACKAGE__; - -import org.ewol.EwolActivity; - -public class __PROJECT_NAME__ extends EwolActivity { - public void onCreate(android.os.Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - initApkPath("__PROJECT_ORG_TYPE__", "__PROJECT_VENDOR__", "__PROJECT_PACKAGE__"); - } -} diff --git a/sources/android/src/org/ewol/Ewol.java b/sources/android/src/org/ewol/Ewol.java index 8ef5fb1d..7ed29632 100644 --- a/sources/android/src/org/ewol/Ewol.java +++ b/sources/android/src/org/ewol/Ewol.java @@ -1,26 +1,10 @@ /** -******************************************************************************* -* @file Ewol.java -* @brief Java interface to the CPP code. -* @author Edouard DUPIN, Kevin BILLONNEAU -* @date 20/04/2012 -* @par Project -* ewol -* -* @par Copyright -* Copyright 2011 Edouard DUPIN, all right reserved -* -* This software is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY. -* -* Licence summary : -* You can modify and redistribute the sources code and binaries. -* You can send me the bug-fix -* -* Term of the licence in in the file licence.txt. -* -******************************************************************************* -*/ + * @author Edouard DUPIN, Kevin BILLONNEAU + * + * @copyright 2011, Edouard DUPIN, all right reserved + * + * @license BSD v3 (see license file) + */ package org.ewol; diff --git a/sources/android/src/org/ewol/EwolActivity.java b/sources/android/src/org/ewol/EwolActivity.java index ff22fad5..1a6d6fcd 100644 --- a/sources/android/src/org/ewol/EwolActivity.java +++ b/sources/android/src/org/ewol/EwolActivity.java @@ -1,26 +1,10 @@ /** -******************************************************************************* -* @file EwolActivity.java -* @brief Java EwolActivity code. -* @author Edouard DUPIN, Kevin BILLONNEAU -* @date 20/04/2012 -* @par Project -* ewol -* -* @par Copyright -* Copyright 2011 Edouard DUPIN, all right reserved -* -* This software is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY. -* -* Licence summary : -* You can modify and redistribute the sources code and binaries. -* You can send me the bug-fix -* -* Term of the licence in in the file licence.txt. -* -******************************************************************************* -*/ + * @author Edouard DUPIN, Kevin BILLONNEAU + * + * @copyright 2011, Edouard DUPIN, all right reserved + * + * @license BSD v3 (see license file) + */ package org.ewol; @@ -105,9 +89,6 @@ public abstract class EwolActivity extends Activity implements EwolCallback, Ewo //packageManager.checkPermission("android.permission.READ_SMS", myPackage) == PERMISSION_GRANTED; //Ewol.paramSetArchiveDir(3, getExternalCacheDir().toString()); - // return apk file path (or null on error) - //initApkPath("__PROJECT_ORG_TYPE__", "__PROJECT_VENDOR__", "__PROJECT_PACKAGE__"); - DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); EWOL.displayPropertyMetrics(metrics.xdpi, metrics.ydpi); diff --git a/sources/android/src/org/ewol/EwolAudioTask.java b/sources/android/src/org/ewol/EwolAudioTask.java index 0c0cdf34..0db147f1 100644 --- a/sources/android/src/org/ewol/EwolAudioTask.java +++ b/sources/android/src/org/ewol/EwolAudioTask.java @@ -1,26 +1,10 @@ /** -******************************************************************************* -* @file EwolAudioTask.java -* @brief Java Audio interface code. -* @author Edouard DUPIN, Kevin BILLONNEAU -* @date 29/06/2012 -* @par Project -* ewol -* -* @par Copyright -* Copyright 2011 Edouard DUPIN, all right reserved -* -* This software is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY. -* -* Licence summary : -* You can modify and redistribute the sources code and binaries. -* You can send me the bug-fix -* -* Term of the licence in in the file licence.txt. -* -******************************************************************************* -*/ + * @author Edouard DUPIN, Kevin BILLONNEAU + * + * @copyright 2011, Edouard DUPIN, all right reserved + * + * @license BSD v3 (see license file) + */ package org.ewol; diff --git a/sources/android/src/org/ewol/EwolCallback.java b/sources/android/src/org/ewol/EwolCallback.java index bcc23896..d60ab86a 100644 --- a/sources/android/src/org/ewol/EwolCallback.java +++ b/sources/android/src/org/ewol/EwolCallback.java @@ -1,26 +1,10 @@ /** -******************************************************************************* -* @file EwolCallback.java -* @brief CPP callback. -* @author Edouard DUPIN, Kevin BILLONNEAU -* @date 20/04/2012 -* @par Project -* ewol -* -* @par Copyright -* Copyright 2011 Edouard DUPIN, all right reserved -* -* This software is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY. -* -* Licence summary : -* You can modify and redistribute the sources code and binaries. -* You can send me the bug-fix -* -* Term of the licence in in the file licence.txt. -* -******************************************************************************* -*/ + * @author Edouard DUPIN, Kevin BILLONNEAU + * + * @copyright 2011, Edouard DUPIN, all right reserved + * + * @license BSD v3 (see license file) + */ package org.ewol; diff --git a/sources/android/src/org/ewol/EwolConstants.java b/sources/android/src/org/ewol/EwolConstants.java index 55234c59..890ff4b6 100644 --- a/sources/android/src/org/ewol/EwolConstants.java +++ b/sources/android/src/org/ewol/EwolConstants.java @@ -1,31 +1,13 @@ /** -******************************************************************************* -* @file EwolConstants.java -* @brief Java Contants interface. -* @author Edouard DUPIN, Kevin BILLONNEAU -* @date 29/06/2012 -* @par Project -* ewol -* -* @par Copyright -* Copyright 2011 Edouard DUPIN, all right reserved -* -* This software is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY. -* -* Licence summary : -* You can modify and redistribute the sources code and binaries. -* You can send me the bug-fix -* -* Term of the licence in in the file licence.txt. -* -******************************************************************************* -*/ + * @author Edouard DUPIN, Kevin BILLONNEAU + * + * @copyright 2011, Edouard DUPIN, all right reserved + * + * @license BSD v3 (see license file) + */ package org.ewol; - - public interface EwolConstants { public static final int NATIVE_AUDIO_BUFFER_SIZE = 512; public static final int EWOL_SYSTEM_KEY_VOLUME_UP = 1; diff --git a/sources/android/src/org/ewol/EwolRendererGL.java b/sources/android/src/org/ewol/EwolRendererGL.java index bf9d1e35..a4ab9a11 100644 --- a/sources/android/src/org/ewol/EwolRendererGL.java +++ b/sources/android/src/org/ewol/EwolRendererGL.java @@ -1,26 +1,10 @@ /** -******************************************************************************* -* @file EwolRendererGL.java -* @brief Java openGl interface code. -* @author Edouard DUPIN, Kevin BILLONNEAU -* @date 20/04/2012 -* @par Project -* ewol -* -* @par Copyright -* Copyright 2011 Edouard DUPIN, all right reserved -* -* This software is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY. -* -* Licence summary : -* You can modify and redistribute the sources code and binaries. -* You can send me the bug-fix -* -* Term of the licence in in the file licence.txt. -* -******************************************************************************* -*/ + * @author Edouard DUPIN, Kevin BILLONNEAU + * + * @copyright 2011, Edouard DUPIN, all right reserved + * + * @license BSD v3 (see license file) + */ package org.ewol; diff --git a/sources/android/src/org/ewol/EwolSurfaceViewGL.java b/sources/android/src/org/ewol/EwolSurfaceViewGL.java index 568c9a63..0371c29a 100644 --- a/sources/android/src/org/ewol/EwolSurfaceViewGL.java +++ b/sources/android/src/org/ewol/EwolSurfaceViewGL.java @@ -1,26 +1,10 @@ /** -******************************************************************************* -* @file EwolSurfaceViewGL.java -* @brief Java interface of the java Surface viewer code. -* @author Edouard DUPIN, Kevin BILLONNEAU -* @date 20/04/2012 -* @par Project -* ewol -* -* @par Copyright -* Copyright 2011 Edouard DUPIN, all right reserved -* -* This software is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY. -* -* Licence summary : -* You can modify and redistribute the sources code and binaries. -* You can send me the bug-fix -* -* Term of the licence in in the file licence.txt. -* -******************************************************************************* -*/ + * @author Edouard DUPIN, Kevin BILLONNEAU + * + * @copyright 2011, Edouard DUPIN, all right reserved + * + * @license BSD v3 (see license file) + */ package org.ewol; diff --git a/sources/ewol/Dimension.cpp b/sources/ewol/Dimension.cpp index 53b16f0c..1a430be2 100644 --- a/sources/ewol/Dimension.cpp +++ b/sources/ewol/Dimension.cpp @@ -14,32 +14,38 @@ // TODO : Set this in a super class acced in a statin fuction... // ratio in milimeter : +static bool isInit = false; static vec2 ratio(9999999,888888); static vec2 invRatio(1,1); static ewol::Dimension windowsSize(vec2(9999999,888888), ewol::Dimension::Pixel); -static const float inchToMillimeter = 25.4f; -static const float footToMillimeter = 304.8f; -static const float meterToMillimeter = 1000.0f; -static const float centimeterToMillimeter = 10.0f; -static const float kilometerToMillimeter = 1000000.0f; -static const float millimeterToInch = 1.0f/25.4f; -static const float millimeterToFoot = 1.0f/304.8f; -static const float millimeterToMeter = 1.0f/1000.0f; -static const float millimeterToCentimeter = 1.0f/10.0f; -static const float millimeterToKilometer = 1.0f/1000000.0f; +static const float inchToMillimeter = 1.0f/25.4f; +static const float footToMillimeter = 1.0f/304.8f; +static const float meterToMillimeter = 1.0f/1000.0f; +static const float centimeterToMillimeter = 1.0f/10.0f; +static const float kilometerToMillimeter = 1.0f/1000000.0f; +static const float millimeterToInch = 25.4f; +static const float millimeterToFoot = 304.8f; +static const float millimeterToMeter =1000.0f; +static const float millimeterToCentimeter = 10.0f; +static const float millimeterToKilometer = 1000000.0f; void ewol::dimension::Init(void) { + if (true==isInit) { + return; + } ewol::Dimension conversion(vec2(72,72), ewol::Dimension::Inch); ratio = conversion.GetMillimeter(); invRatio.setValue(1.0f/ratio.x(),1.0f/ratio.y()); windowsSize.Set(vec2(200,200), ewol::Dimension::Pixel); + isInit = true; } void ewol::dimension::UnInit(void) { + isInit = false; ratio.setValue(9999999,888888); invRatio.setValue(1.0f/ratio.x(),1.0f/ratio.y()); windowsSize.Set(vec2(9999999,88888), ewol::Dimension::Pixel); @@ -47,7 +53,10 @@ void ewol::dimension::UnInit(void) void ewol::dimension::SetPixelRatio(const vec2& _ratio, ewol::Dimension::distance_te _type) { + ewol::dimension::Init(); + EWOL_INFO("Set a new screen ratio for the screen : ratio=" << _ratio << " type=" << _type); ewol::Dimension conversion(_ratio, _type); + EWOL_INFO(" ==> " << conversion); ratio = conversion.GetMillimeter(); invRatio.setValue(1.0f/ratio.x(),1.0f/ratio.y()); EWOL_INFO("Set a new screen ratio for the screen : ratioMm=" << ratio); diff --git a/sources/ewol/renderer/ResourceManager.cpp b/sources/ewol/renderer/ResourceManager.cpp index bcd84dcb..5717120b 100644 --- a/sources/ewol/renderer/ResourceManager.cpp +++ b/sources/ewol/renderer/ResourceManager.cpp @@ -297,41 +297,53 @@ static int32_t nextP2(int32_t value) } val *=2; } - EWOL_CRITICAL("impossible CASE...."); + EWOL_CRITICAL("impossible CASE.... request P2 of " << value); return val; } -bool ewol::resource::Keep(const etk::UString& filename, ewol::TextureFile*& object, ivec2 size) +bool ewol::resource::Keep(const etk::UString& _filename, ewol::TextureFile*& _object, ivec2 _size) { - etk::UString TmpFilename = filename; - if (false == filename.EndWith(".svg") ) { - size = ivec2(-1,-1); + EWOL_ERROR("11111111111111 " << _filename << " " << _size); + if (_size.x()==0) { + _size.setX(-1); + EWOL_ERROR("Error Request the image size.x() =0 ???"); } + if (_size.y()==0) { + _size.setY(-1); + EWOL_ERROR("Error Request the image size.y() =0 ???"); + } + EWOL_ERROR("222222222222222222 " << _size); + etk::UString TmpFilename = _filename; + if (false == _filename.EndWith(".svg") ) { + _size = ivec2(-1,-1); + } + EWOL_ERROR("3333333333333333 " << _size); #ifdef __TARGET_OS__MacOs EWOL_WARNING("TODO : Remove this strange hack"); - size = ivec2(64,64); + _size = ivec2(64,64); #endif - if (size.x()>0 && size.y()>0) { - ivec2 size2(nextP2(size.x()), nextP2(size.y())); + if (_size.x()>0 && _size.y()>0) { + EWOL_ERROR("44444444444444 " << _size); + ivec2 size2(nextP2(_size.x()), nextP2(_size.y())); TmpFilename += ":"; TmpFilename += size2.x(); TmpFilename += "x"; TmpFilename += size2.y(); } - EWOL_INFO("KEEP : TextureFile : file : \"" << TmpFilename << "\" basic size=" << size); - object = static_cast(LocalKeep(TmpFilename)); - if (NULL != object) { + EWOL_INFO("KEEP : TextureFile : file : \"" << TmpFilename << "\" basic size=" << _size); + _object = static_cast(LocalKeep(TmpFilename)); + if (NULL != _object) { return true; } EWOL_INFO(" ==> create new one..."); // need to crate a new one ... - object = new ewol::TextureFile(TmpFilename, filename, size); - if (NULL == object) { - EWOL_ERROR("allocation error of a resource : " << filename); + _object = new ewol::TextureFile(TmpFilename, _filename, _size); + if (NULL == _object) { + EWOL_ERROR("allocation error of a resource : " << _filename); return false; } - LocalAdd(object); + LocalAdd(_object); return true; } diff --git a/sources/ewol/renderer/resources/Image.cpp b/sources/ewol/renderer/resources/Image.cpp index 29d70873..b3956081 100644 --- a/sources/ewol/renderer/resources/Image.cpp +++ b/sources/ewol/renderer/resources/Image.cpp @@ -20,7 +20,7 @@ ewol::TextureFile::TextureFile(etk::UString _genName, const etk::UString& _tmpfileName, const ivec2& _size) : Texture(_genName) { - if (true == egami::Load(m_data, _tmpfileName, _size)) { + if (false == egami::Load(m_data, _tmpfileName, _size)) { EWOL_ERROR("ERROR when loading the image : " << _tmpfileName); } ivec2 tmp = m_data.GetSize(); diff --git a/sources/ewol/renderer/resources/TexturedFont.cpp b/sources/ewol/renderer/resources/TexturedFont.cpp index 9e71c166..786dd0dd 100644 --- a/sources/ewol/renderer/resources/TexturedFont.cpp +++ b/sources/ewol/renderer/resources/TexturedFont.cpp @@ -51,7 +51,7 @@ static int32_t nextP2(int32_t value) } val *=2; } - EWOL_CRITICAL("impossible CASE...."); + EWOL_CRITICAL("impossible CASE.... request power 2 of "<< value); return val; } @@ -122,76 +122,83 @@ ewol::TexturedFont::TexturedFont(etk::UString fontName) : m_name = fontName.Extract(0, (tmpPos - tmpData)); m_size = tmpSize; - etk::UString fontBaseFolder("DATA:fonts"); + etk::Vector folderList; if (true==GetFontInSystem()) { #if defined(__TARGET_OS__Android) - fontBaseFolder = "/system/font"; + folderList.PushBack("/system/fonts"); #elif defined(__TARGET_OS__Linux) - fontBaseFolder = "/usr/share/fonts/truetype"; + folderList.PushBack("/usr/share/fonts/truetype"); #endif } - etk::FSNode myFolder(fontBaseFolder); - // find the real Font name : - etk::Vector output; - myFolder.FolderGetRecursiveFiles(output); - etk::Vector split = m_name.Split(';'); - EWOL_INFO("try to find font named : '" << split << "' in : '" << myFolder <<"'"); - //EWOL_CRITICAL("parse string : " << split); - - for (int32_t jjj=0; jjj output; + myFolder.FolderGetRecursiveFiles(output); + etk::Vector split = m_name.Split(';'); + EWOL_INFO("try to find font named : '" << split << "' in : '" << myFolder <<"'"); + //EWOL_CRITICAL("parse string : " << split); bool hasFindAFont = false; - for (int32_t iii=0; iii=0; iii--) { diff --git a/sources/ewol/widget/Image.cpp b/sources/ewol/widget/Image.cpp index 74499a3f..ce84c48e 100644 --- a/sources/ewol/widget/Image.cpp +++ b/sources/ewol/widget/Image.cpp @@ -54,16 +54,19 @@ widget::Image::Image(const etk::UString& _file, const ewol::Dimension& _border) void widget::Image::SetFile(const etk::UString& _file) { + EWOL_DEBUG("Set Image : " << _file); // copy data : m_fileName = _file; // Force redraw all : MarkToRedraw(); ewol::RequestUpdateSize(); + EWOL_DEBUG("Set sources : " << m_fileName << " size=" << vec2(64,64)); m_compositing.SetSource(m_fileName, vec2(64,64)); } void widget::Image::SetBorder(const ewol::Dimension& _border) { + EWOL_DEBUG("Set border=" << _border); // copy data : m_border = _border; // Force redraw all : @@ -85,20 +88,24 @@ void widget::Image::SetKeepRatio(bool _keep) void widget::Image::SetImageSize(const ewol::Dimension& _size) { + EWOL_DEBUG("Set Image size : " << _size); m_imageSize = _size; MarkToRedraw(); ewol::RequestUpdateSize(); + EWOL_DEBUG("Set sources : " << m_fileName << " size=" << m_imageSize); m_compositing.SetSource(m_fileName, m_imageSize.GetPixel()); } void widget::Image::Set(const etk::UString& _file, const ewol::Dimension& _border) { + EWOL_DEBUG("Set Image : " << _file << " border=" << _border); // copy data : m_border = _border; m_fileName = _file; // Force redraw all : MarkToRedraw(); ewol::RequestUpdateSize(); + EWOL_DEBUG("Set sources : " << m_fileName << " size=" << m_imageSize); m_compositing.SetSource(m_fileName, m_imageSize.GetPixel()); } diff --git a/sources/lutin_ewol.py b/sources/lutin_ewol.py index 68da7e99..3c2c2326 100755 --- a/sources/lutin_ewol.py +++ b/sources/lutin_ewol.py @@ -195,8 +195,8 @@ def Create(target): java_tmp_src = java_tmp_dir + "org/ewol/EwolConstants" lutinMultiprocess.RunCommand("javac " + java_tmp_src + ".java") lutinMultiprocess.RunCommand("cd " + java_tmp_dir + " && javah org.ewol.EwolConstants") - lutinMultiprocess.RunCommand("mv " + java_tmp_dir + "org_ewol_EwolConstants.h " + cpp_tmp_dir) - lutinMultiprocess.RunCommand("rm " + java_tmp_src + ".class") + lutinTools.CopyFile(java_tmp_dir + "org_ewol_EwolConstants.h", cpp_tmp_dir + "org_ewol_EwolConstants.h", True) + lutinTools.RemoveFile(java_tmp_src + ".class") myModule.AddSrcFile("ewol/renderer/os/gui.Android.cpp")