[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,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

View File

@ -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) {

View File

@ -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)