From bbb34d52a9053518d212ce7ff2064eeb39197637 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 24 Aug 2015 22:50:08 +0200 Subject: [PATCH] [DEV] update application handle --- .travis.yml | 42 ++++++++++++++++++------------------------ gale/Application.cpp | 32 ++++++++++++++++++++++---------- gale/Application.h | 8 ++++++++ 3 files changed, 48 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index 224a287..b90271d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,26 @@ -# language type: language: -- cpp -- Objective-c + - cpp + - Objective-c + +sudo: false -# compilator system: compiler: -- clang -- gcc + - clang + - gcc -# build branch requested branches: only: - master - dev -# previous actions: -before_script: +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.9 + +before_script: - cd .. - mkdir bin - curl https://storage.googleapis.com/git-repo-downloads/repo > bin/repo @@ -33,25 +38,14 @@ before_script: - pwd - ls -l - if [ "$CXX" == "clang++" ]; then BUILDER=clang; else BUILDER=gcc; fi + - if [ "$CXX" == "g++" ]; then COMPILATOR_OPTION="--compilator-version=4.9"; else COMPILATOR_OPTION=""; fi install: - - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - - sudo apt-get update -qq - - sudo apt-get install -qq libstdc++-4.9-dev - - sudo apt-get install -qq g++-4.9 - - sudo rm /usr/bin/gcc /usr/bin/g++ - - sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc - - sudo ln -s /usr/bin/g++-4.9 /usr/bin/g++ - - sudo pip install lutin + - pip install --user lutin -# build sequence with Lutin : -script: - - lutin -C -P -c$BUILDER -mdebug -p ewol etk-test exml-test ejson-test enet-test 0XX_customwidget 001_HelloWord - - ./out/Linux_x86_64/debug/staging/$BUILDER/etk-test/usr/bin/etk-test - - ./out/Linux_x86_64/debug/staging/$BUILDER/ejson-test/usr/bin/ejson-test - - ./out/Linux_x86_64/debug/staging/$BUILDER/exml-test/usr/bin/exml-test +script: + - lutin -C -P -c$BUILDER $COMPILATOR_OPTION -mdebug -p gale gale-sample-basic -#send e-mail on compilation result: notifications: email: - yui.heero@gmail.com diff --git a/gale/Application.cpp b/gale/Application.cpp index b968081..76db6d0 100644 --- a/gale/Application.cpp +++ b/gale/Application.cpp @@ -12,7 +12,11 @@ gale::Application::Application() : - m_needRedraw(true) { + m_needRedraw(true), + m_title("gale"), + m_iconName(""), + m_cursor(gale::context::cursor_arrow), + m_orientation(gale::orientation_screenAuto) { GALE_VERBOSE("Constructor Gale Application"); } @@ -112,40 +116,48 @@ vec2 gale::Application::getPosition() const { } void gale::Application::setTitle(const std::string& _title) { - + m_title = _title; + gale::Context& context = gale::getContext(); + context.setTitle(m_title); } std::string gale::Application::getTitle() { - return ""; + return m_title; } void gale::Application::setIcon(const std::string& _iconFile) { + m_iconName = _iconFile; gale::Context& context = gale::getContext(); - context.setIcon(_iconFile); + context.setIcon(m_iconName); } std::string gale::Application::getIcon() { - return ""; + return m_iconName; } void gale::Application::setCursor(enum gale::context::cursor _newCursor) { - + m_cursor = _newCursor; + gale::Context& context = gale::getContext(); + context.setCursor(m_cursor); } enum gale::context::cursor gale::Application::getCursor() { - return gale::context::cursor_arrow; + return m_cursor; } void gale::Application::openURL(const std::string& _url) { - + gale::Context& context = gale::getContext(); + context.openURL(_url); } void gale::Application::setOrientation(enum gale::orientation _orientation) { - + m_orientation = _orientation; + gale::Context& context = gale::getContext(); + context.forceOrientation(m_orientation); } enum gale::orientation gale::Application::getOrientation() { - return gale::orientation_screenAuto; + return m_orientation; } void gale::Application::onClipboardEvent(enum gale::context::clipBoard::clipboardListe _clipboardId) { diff --git a/gale/Application.h b/gale/Application.h index 7923901..410709a 100644 --- a/gale/Application.h +++ b/gale/Application.h @@ -138,6 +138,8 @@ namespace gale { * @return Current position of the window. */ virtual vec2 getPosition() const; + private: + std::string m_title; public: /** * @brief Set the title of the application @@ -149,6 +151,8 @@ namespace gale { * @return Current title */ virtual std::string getTitle(); + private: + std::string m_iconName; public: /** * @brief set the Icon of the application. @@ -160,6 +164,8 @@ namespace gale { * @return Filename of the icon. */ virtual std::string getIcon(); + private: + enum gale::context::cursor m_cursor; public: /** * @brief Set the cursor type. @@ -177,6 +183,8 @@ namespace gale { * @param[in] _url URL to open. */ virtual void openURL(const std::string& _url); + private: + enum gale::orientation m_orientation; public: /** * @brief set the screen orientation (if possible : only on iOs/Android)