diff --git a/.gitignore b/.gitignore index 9356fe2f..f5694a45 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,7 @@ doxygen/ALL/ *.so *.pyc tags -ewol +#ewol out ewol_debug ewol_release diff --git a/Makefile b/Makefile index 2870f7c7..a7ed2844 100644 --- a/Makefile +++ b/Makefile @@ -199,6 +199,20 @@ CXXFILES += ewol/widget/Button.cpp \ ewol/widget/SizerVert.cpp # only to test son internal element ... CXXFILES += ewol/widget/Test.cpp +# theme management : +CXXFILES += ewol/themeManager.cpp \ + ewol/theme/Theme.cpp \ + ewol/theme/EolElement.cpp \ + ewol/theme/EolElementFrame.cpp \ + ewol/theme/EolColor.cpp \ + ewol/theme/EolBase.cpp \ + ewol/theme/EolBaseCircle.cpp \ + ewol/theme/EolBaseCirclePart.cpp \ + ewol/theme/EolBaseLine.cpp \ + ewol/theme/EolBasePolygone.cpp \ + ewol/theme/EolBaseRect.cpp \ + ewol/theme/EolBaseTriangle.cpp + # Ewol Test Software : @@ -244,7 +258,7 @@ build: .encadrer .versionFile $(OUTPUT_NAME) .versionFile: - @rm -f $(OBJECT_DIRECTORY)/ewol.o + @rm -f $(OBJECT_DIRECTORY)/ewol/ewol.o # build C++ $(OBJECT_DIRECTORY)/%.o: $(FILE_DIRECTORY)/%.cpp $(MAKE_DEPENDENCE) diff --git a/Sources/ewol/ewol.cpp b/Sources/ewol/ewol.cpp index 97305ce9..78ea5333 100644 --- a/Sources/ewol/ewol.cpp +++ b/Sources/ewol/ewol.cpp @@ -23,22 +23,23 @@ */ -#include "ewol/ewol.h" -#include "ewol/Font.h" -#include "ewol/WidgetManager.h" +#include +#include +#include +#include #if __PLATFORM__ == X11 - #include "base/guiX11.h" + #include #elif __PLATFORM__ == DoubleBuffer - #include "base/guiDoubleBuffer.h" + #include #elif __PLATFORM__ == Android - #include "base/guiAndroid.h" + #include #elif __PLATFORM__ == AndroidTablet - #include "base/guiAndroidTablet.h" + #include #elif __PLATFORM__ == IPhone - #include "base/guiIPhone.h" + #include #elif __PLATFORM__ == IPad - #include "base/guiIPad.h" + #include #else #error you need to specify a platform ... #endif @@ -51,6 +52,7 @@ void ewol::Init(int argc, char *argv[]) EWOL_INFO("v" EWOL_VERSION_TAG_NAME); EWOL_INFO("Build Date: " VERSION_BUILD_TIME); guiAbstraction::Init(argc, argv); + ewol::theme::Init(); ewol::widgetManager::Init(); ewol::InitFont(); } @@ -65,6 +67,7 @@ void ewol::UnInit(void) guiAbstraction::UnInit(); ewol::UnInitFont(); ewol::widgetManager::UnInit(); + ewol::theme::UnInit(); } diff --git a/Sources/ewol/theme/EolBase.cpp b/Sources/ewol/theme/EolBase.cpp new file mode 100644 index 00000000..2320fd35 --- /dev/null +++ b/Sources/ewol/theme/EolBase.cpp @@ -0,0 +1,28 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBase.cpp + * @brief basic ewol theme eol file basic element Virtual Classes (Sources) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#undef __class__ +#define __class__ "ewol::theme::EolBase" + diff --git a/Sources/ewol/theme/EolBase.h b/Sources/ewol/theme/EolBase.h new file mode 100644 index 00000000..cfb9d85d --- /dev/null +++ b/Sources/ewol/theme/EolBase.h @@ -0,0 +1,31 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBase.h + * @brief basic ewol theme eol file basic element virtual Classes (Header) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + + +#ifndef __EWOL_THEME_EOL_BASE__H__ +#define __EWOL_THEME_EOL_BASE__H__ + +#endif + diff --git a/Sources/ewol/theme/EolBaseCircle.cpp b/Sources/ewol/theme/EolBaseCircle.cpp new file mode 100644 index 00000000..f8fab341 --- /dev/null +++ b/Sources/ewol/theme/EolBaseCircle.cpp @@ -0,0 +1,28 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBasicCircle.cpp + * @brief basic ewol theme eol file basic element type=Circle (Sources) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#undef __class__ +#define __class__ "ewol::theme::EolBaseCircle" + diff --git a/Sources/ewol/theme/EolBaseCircle.h b/Sources/ewol/theme/EolBaseCircle.h new file mode 100644 index 00000000..323d5ad5 --- /dev/null +++ b/Sources/ewol/theme/EolBaseCircle.h @@ -0,0 +1,31 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBasicCircle.h + * @brief basic ewol theme eol file basic element type=Circle (Header) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + +#include + +#ifndef __EWOL_THEME_EOL_BASE_CIRCLE_H__ +#define __EWOL_THEME_EOL_BASE_CIRCLE_H__ + +#endif + diff --git a/Sources/ewol/theme/EolBaseCirclePart.cpp b/Sources/ewol/theme/EolBaseCirclePart.cpp new file mode 100644 index 00000000..d2060b5c --- /dev/null +++ b/Sources/ewol/theme/EolBaseCirclePart.cpp @@ -0,0 +1,28 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBasicCirclePart.cpp + * @brief basic ewol theme eol file basic element type=CirclePart (Sources) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#undef __class__ +#define __class__ "ewol::theme::EolBaseCirclePart" + diff --git a/Sources/ewol/theme/EolBaseCirclePart.h b/Sources/ewol/theme/EolBaseCirclePart.h new file mode 100644 index 00000000..f690c81b --- /dev/null +++ b/Sources/ewol/theme/EolBaseCirclePart.h @@ -0,0 +1,32 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBasicCirclePart.h + * @brief basic ewol theme eol file basic element type=CirclePart (Header) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#include + +#ifndef __EWOL_THEME_EOL_BASE_CIRCLE_PART_H__ +#define __EWOL_THEME_EOL_BASE_CIRCLE_PART_H__ + +#endif + diff --git a/Sources/ewol/theme/EolBaseLine.cpp b/Sources/ewol/theme/EolBaseLine.cpp new file mode 100644 index 00000000..b43d78eb --- /dev/null +++ b/Sources/ewol/theme/EolBaseLine.cpp @@ -0,0 +1,28 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBaseLine.cpp + * @brief basic ewol theme eol file basic element type=Line (Sources) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#undef __class__ +#define __class__ "ewol::theme::EolBaseLine" + diff --git a/Sources/ewol/theme/EolBaseLine.h b/Sources/ewol/theme/EolBaseLine.h new file mode 100644 index 00000000..0f766c3b --- /dev/null +++ b/Sources/ewol/theme/EolBaseLine.h @@ -0,0 +1,32 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBaseLine.h + * @brief basic ewol theme eol file basic element type=Line (Header) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#include + +#ifndef __EWOL_THEME_EOL_BASE_LINE_H__ +#define __EWOL_THEME_EOL_BASE_LINE_H__ + +#endif + diff --git a/Sources/ewol/theme/EolBasePolygone.cpp b/Sources/ewol/theme/EolBasePolygone.cpp new file mode 100644 index 00000000..014678d5 --- /dev/null +++ b/Sources/ewol/theme/EolBasePolygone.cpp @@ -0,0 +1,28 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBasePolygone.cpp + * @brief basic ewol theme eol file basic element type=polygone (Sources) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#undef __class__ +#define __class__ "ewol::theme::EolBasePolygone" + diff --git a/Sources/ewol/theme/EolBasePolygone.h b/Sources/ewol/theme/EolBasePolygone.h new file mode 100644 index 00000000..3dd52bb3 --- /dev/null +++ b/Sources/ewol/theme/EolBasePolygone.h @@ -0,0 +1,32 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBasePolygone.h + * @brief basic ewol theme eol file basic element type=polygone (Header) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#include + +#ifndef __EWOL_THEME_EOL_BASE_POLYGONE_H__ +#define __EWOL_THEME_EOL_BASE_POLYGONE_H__ + +#endif + diff --git a/Sources/ewol/theme/EolBaseRect.cpp b/Sources/ewol/theme/EolBaseRect.cpp new file mode 100644 index 00000000..8c772157 --- /dev/null +++ b/Sources/ewol/theme/EolBaseRect.cpp @@ -0,0 +1,28 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBaseRect.cpp + * @brief basic ewol theme eol file basic element type=rectangle (Sources) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#undef __class__ +#define __class__ "ewol::theme::EolBaseRect" + diff --git a/Sources/ewol/theme/EolBaseRect.h b/Sources/ewol/theme/EolBaseRect.h new file mode 100644 index 00000000..ab8b2157 --- /dev/null +++ b/Sources/ewol/theme/EolBaseRect.h @@ -0,0 +1,32 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBaseRect.h + * @brief basic ewol theme eol file basic element type=rectangle (Header) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#include + +#ifndef __EWOL_THEME_EOL_BASE_RECT_H__ +#define __EWOL_THEME_EOL_BASE_RECT_H__ + +#endif + diff --git a/Sources/ewol/theme/EolBaseTriangle.cpp b/Sources/ewol/theme/EolBaseTriangle.cpp new file mode 100644 index 00000000..e0f88713 --- /dev/null +++ b/Sources/ewol/theme/EolBaseTriangle.cpp @@ -0,0 +1,28 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBaseTriangle.cpp + * @brief basic ewol theme eol file basic element type=triangle (Sources) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#undef __class__ +#define __class__ "ewol::theme::EolBaseTriangle" + diff --git a/Sources/ewol/theme/EolBaseTriangle.h b/Sources/ewol/theme/EolBaseTriangle.h new file mode 100644 index 00000000..4e0226f5 --- /dev/null +++ b/Sources/ewol/theme/EolBaseTriangle.h @@ -0,0 +1,32 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolBaseTriangle.h + * @brief basic ewol theme eol file basic element type=triangle (Header) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#include + +#ifndef __EWOL_THEME_EOL_BASE_TRIANGLE_H__ +#define __EWOL_THEME_EOL_BASE_TRIANGLE_H__ + +#endif + diff --git a/Sources/ewol/theme/EolColor.cpp b/Sources/ewol/theme/EolColor.cpp new file mode 100644 index 00000000..802a4ec7 --- /dev/null +++ b/Sources/ewol/theme/EolColor.cpp @@ -0,0 +1,29 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolColor.cpp + * @brief basic ewol theme eol file color (Sources) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#undef __class__ +#define __class__ "ewol::theme::EolColor" + + diff --git a/Sources/ewol/theme/EolColor.h b/Sources/ewol/theme/EolColor.h new file mode 100644 index 00000000..068ec705 --- /dev/null +++ b/Sources/ewol/theme/EolColor.h @@ -0,0 +1,30 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolColor.h + * @brief basic ewol theme eol file color (Header) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#ifndef __EWOL_THEME_EOL_COLOR_H__ +#define __EWOL_THEME_EOL_COLOR_H__ + +#endif + diff --git a/Sources/ewol/theme/EolElement.cpp b/Sources/ewol/theme/EolElement.cpp new file mode 100644 index 00000000..81aae2b9 --- /dev/null +++ b/Sources/ewol/theme/EolElement.cpp @@ -0,0 +1,29 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolElement.cpp + * @brief basic ewol theme eol file element (Sources) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#undef __class__ +#define __class__ "ewol::theme::EolElement" + + diff --git a/Sources/ewol/theme/EolElement.h b/Sources/ewol/theme/EolElement.h new file mode 100644 index 00000000..224c9dce --- /dev/null +++ b/Sources/ewol/theme/EolElement.h @@ -0,0 +1,56 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolElement.h + * @brief basic ewol theme eol file element (Header) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + + +#ifndef __EWOL_THEME_EOL_ELEMENT_H__ +#define __EWOL_THEME_EOL_ELEMENT_H__ + +/* +namespace ewol { + namespace theme { + class EolElement { + public: + EolElement(void) { }; + virtual ~EolElement(void) { }; + /* + void Load(etk::File & newFile) { }; + void Generate(int32_t id, int32_t frameId, OObject2DTextured & newObject, etkFloat_t posX, etkFloat_t posY, etkFloat_t sizeX, etkFloat_t sizeY) {}; + int32_t GetNbFrame(int32_t id) {return 0;}; + int32_t GetFrameId(int32_t id, etk::String & frameName) {return 0;}; + int32_t GetObjectId(etk::String name) { return -1; }; + * / + private: + //etk::VectorType m_listColor; + //etk::VectorType m_listGroup; + //etk::VectorType m_listElement; + public: + // acces to manage and create object ==> drawing system + + }; + }; +}; +*/ +#endif + diff --git a/Sources/ewol/theme/EolElementFrame.cpp b/Sources/ewol/theme/EolElementFrame.cpp new file mode 100644 index 00000000..95045bd2 --- /dev/null +++ b/Sources/ewol/theme/EolElementFrame.cpp @@ -0,0 +1,29 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolElementFrame.cpp + * @brief basic ewol theme eol file element (specific frame) (Sources) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#undef __class__ +#define __class__ "ewol::theme::EolElementFrame" + + diff --git a/Sources/ewol/theme/EolElementFrame.h b/Sources/ewol/theme/EolElementFrame.h new file mode 100644 index 00000000..9bc7e485 --- /dev/null +++ b/Sources/ewol/theme/EolElementFrame.h @@ -0,0 +1,31 @@ +/** + ******************************************************************************* + * @file ewol/theme/EolElementFrame.h + * @brief basic ewol theme eol file element (specific frame) (Header) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + + +#ifndef __EWOL_THEME_EOL_ELEMENT_FRAME_H__ +#define __EWOL_THEME_EOL_ELEMENT_FRAME_H__ + +#endif + diff --git a/Sources/ewol/theme/Theme.cpp b/Sources/ewol/theme/Theme.cpp new file mode 100644 index 00000000..77cb546f --- /dev/null +++ b/Sources/ewol/theme/Theme.cpp @@ -0,0 +1,27 @@ +/** + ******************************************************************************* + * @file ewol/theme/Theme.cpp + * @brief basic ewol Theme basic class (Sources) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + +#undef __class__ +#define __class__ "ewol::theme::Theme" \ No newline at end of file diff --git a/Sources/ewol/theme/Theme.h b/Sources/ewol/theme/Theme.h new file mode 100644 index 00000000..113a6f1d --- /dev/null +++ b/Sources/ewol/theme/Theme.h @@ -0,0 +1,63 @@ +/** + ******************************************************************************* + * @file ewol/theme/Theme.h + * @brief basic ewol Theme basic class (Header) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + + +#ifndef __EWOL_EOL_THEME_H__ +#define __EWOL_EOL_THEME_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ewol { + namespace theme { + class Theme { + public: + Theme(void) { }; + virtual ~Theme(void) { }; + void Load(etk::File & newFile) { }; + void Generate(int32_t id, int32_t frameId, OObject2DTextured & newObject, etkFloat_t posX, etkFloat_t posY, etkFloat_t sizeX, etkFloat_t sizeY) {}; + int32_t GetNbFrame(int32_t id) {return 0;}; + int32_t GetFrameId(int32_t id, etk::String & frameName) {return 0;}; + int32_t GetObjectId(etk::String name) { return -1; }; + private: + //etk::VectorType m_listColor; + //etk::VectorType m_listGroup; + //etk::VectorType m_listElement; + public: + // acces to manage and create object ==> drawing system + + }; + }; +}; + +#endif + diff --git a/Sources/ewol/themeManager.cpp b/Sources/ewol/themeManager.cpp new file mode 100644 index 00000000..63cd39d3 --- /dev/null +++ b/Sources/ewol/themeManager.cpp @@ -0,0 +1,113 @@ +/** + ******************************************************************************* + * @file ewol/themeManager.cpp + * @brief basic ewol theme Manager (Sources) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + +#include +#include + + +#undef __class__ +#define __class__ "ewol::theme::" + +static ewol::theme::Theme defaultTheme; +static ewol::theme::Theme userTheme; + +void ewol::theme::Init(void) +{ + +} + + +void ewol::theme::UnInit(void) +{ + +} + + +void ewol::theme::LoadDefault(etk::File filename) +{ + defaultTheme.Load(filename); +} + + +void ewol::theme::Load(etk::File filename) +{ + userTheme.Load(filename); +} + +// if 0 ==> error not fined ... +// if <0 ==> default theme +// if >0 ==> user theme +int32_t ewol::theme::GetObjectId(etk::String name) +{ + int32_t val = userTheme.GetObjectId(name); + if (-1 == val) { + val = defaultTheme.GetObjectId(name); + if (-1 == val) { + return 0; + } else { + return val*(-1); + } + } + return val+1; +} + +// ???? GetObjectType(int32_t id); + + +void ewol::theme::Generate(int32_t id, int32_t frameId, OObject2DTextured & newObject, etkFloat_t posX, etkFloat_t posY, etkFloat_t sizeX, etkFloat_t sizeY) +{ + if (id<=0) { + id *= -1; + defaultTheme.Generate(id, frameId, newObject, posX, posY, sizeX, sizeY); + } else { + userTheme.Generate(id+1, frameId, newObject, posX, posY, sizeX, sizeY); + } +} + + +int32_t ewol::theme::GetNbFrame(int32_t id) +{ + if (id==0) { + return 0; + } else if (id<=0) { + id *= -1; + return defaultTheme.GetNbFrame(id); + } else { + return userTheme.GetNbFrame(id+1); + } +} + + +int32_t ewol::theme::GetFrameId(int32_t id, etk::String & frameName) +{ + if (id==0) { + return 0; + } else if (id<=0) { + id *= -1; + return defaultTheme.GetFrameId(id, frameName); + } else { + return userTheme.GetFrameId(id+1, frameName); + } +} + diff --git a/Sources/ewol/themeManager.h b/Sources/ewol/themeManager.h new file mode 100644 index 00000000..8336d237 --- /dev/null +++ b/Sources/ewol/themeManager.h @@ -0,0 +1,52 @@ +/** + ******************************************************************************* + * @file ewol/themeManager.h + * @brief basic ewol theme Manager (Header) + * @author Edouard DUPIN + * @date 23/11/2011 + * @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. + * + ******************************************************************************* + */ + + + +#ifndef __EWOL_THEME_MANAGER_H__ +#define __EWOL_THEME_MANAGER_H__ + +#include +#include +#include +#include + +namespace ewol { + namespace theme { + void Init(void); + void UnInit(void); + void LoadDefault(etk::File filename); // default system theme ==> when an element in not find in the user theme, it is search in this one ... not needed + void Load(etk::File filename); // add a user theme at the list ==> this remove previous declaration by the user... + int32_t GetObjectId(etk::String name); + // ???? GetObjectType(int32_t id); + void Generate(int32_t id, int32_t frameId, OObject2DTextured & newObject, etkFloat_t posX, etkFloat_t posY, etkFloat_t sizeX, etkFloat_t sizeY); + int32_t GetNbFrame(int32_t id); + int32_t GetFrameId(int32_t id, etk::String & frameName); + + }; +}; + + +#endif +