[DEV] update application handle

This commit is contained in:
Edouard DUPIN 2015-08-24 22:50:08 +02:00
parent 33c4783bac
commit bbb34d52a9
3 changed files with 48 additions and 34 deletions

View File

@ -1,20 +1,25 @@
# language type:
language: language:
- cpp - cpp
- Objective-c - Objective-c
# compilator system: sudo: false
compiler: compiler:
- clang - clang
- gcc - gcc
# build branch requested
branches: branches:
only: only:
- master - master
- dev - dev
# previous actions: addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
before_script: before_script:
- cd .. - cd ..
- mkdir bin - mkdir bin
@ -33,25 +38,14 @@ before_script:
- pwd - pwd
- ls -l - ls -l
- if [ "$CXX" == "clang++" ]; then BUILDER=clang; else BUILDER=gcc; fi - 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: install:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - pip install --user lutin
- 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
# build sequence with Lutin :
script: script:
- lutin -C -P -c$BUILDER -mdebug -p ewol etk-test exml-test ejson-test enet-test 0XX_customwidget 001_HelloWord - lutin -C -P -c$BUILDER $COMPILATOR_OPTION -mdebug -p gale gale-sample-basic
- ./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
#send e-mail on compilation result:
notifications: notifications:
email: email:
- yui.heero@gmail.com - yui.heero@gmail.com

View File

@ -12,7 +12,11 @@
gale::Application::Application() : 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"); GALE_VERBOSE("Constructor Gale Application");
} }
@ -112,40 +116,48 @@ vec2 gale::Application::getPosition() const {
} }
void gale::Application::setTitle(const std::string& _title) { 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() { std::string gale::Application::getTitle() {
return ""; return m_title;
} }
void gale::Application::setIcon(const std::string& _iconFile) { void gale::Application::setIcon(const std::string& _iconFile) {
m_iconName = _iconFile;
gale::Context& context = gale::getContext(); gale::Context& context = gale::getContext();
context.setIcon(_iconFile); context.setIcon(m_iconName);
} }
std::string gale::Application::getIcon() { std::string gale::Application::getIcon() {
return ""; return m_iconName;
} }
void gale::Application::setCursor(enum gale::context::cursor _newCursor) { 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() { enum gale::context::cursor gale::Application::getCursor() {
return gale::context::cursor_arrow; return m_cursor;
} }
void gale::Application::openURL(const std::string& _url) { void gale::Application::openURL(const std::string& _url) {
gale::Context& context = gale::getContext();
context.openURL(_url);
} }
void gale::Application::setOrientation(enum gale::orientation _orientation) { 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() { enum gale::orientation gale::Application::getOrientation() {
return gale::orientation_screenAuto; return m_orientation;
} }
void gale::Application::onClipboardEvent(enum gale::context::clipBoard::clipboardListe _clipboardId) { void gale::Application::onClipboardEvent(enum gale::context::clipBoard::clipboardListe _clipboardId) {

View File

@ -138,6 +138,8 @@ namespace gale {
* @return Current position of the window. * @return Current position of the window.
*/ */
virtual vec2 getPosition() const; virtual vec2 getPosition() const;
private:
std::string m_title;
public: public:
/** /**
* @brief Set the title of the application * @brief Set the title of the application
@ -149,6 +151,8 @@ namespace gale {
* @return Current title * @return Current title
*/ */
virtual std::string getTitle(); virtual std::string getTitle();
private:
std::string m_iconName;
public: public:
/** /**
* @brief set the Icon of the application. * @brief set the Icon of the application.
@ -160,6 +164,8 @@ namespace gale {
* @return Filename of the icon. * @return Filename of the icon.
*/ */
virtual std::string getIcon(); virtual std::string getIcon();
private:
enum gale::context::cursor m_cursor;
public: public:
/** /**
* @brief Set the cursor type. * @brief Set the cursor type.
@ -177,6 +183,8 @@ namespace gale {
* @param[in] _url URL to open. * @param[in] _url URL to open.
*/ */
virtual void openURL(const std::string& _url); virtual void openURL(const std::string& _url);
private:
enum gale::orientation m_orientation;
public: public:
/** /**
* @brief set the screen orientation (if possible : only on iOs/Android) * @brief set the screen orientation (if possible : only on iOs/Android)