diff options
Diffstat (limited to 'mobile')
| -rw-r--r-- | mobile/CMakeLists.txt | 101 | ||||
| -rw-r--r-- | mobile/main.cpp | 54 | ||||
| -rw-r--r-- | mobile/maincontroler.cpp | 7 | ||||
| -rw-r--r-- | mobile/maincontroler.h | 17 | ||||
| -rw-r--r-- | mobile/mainwindow.cpp | 6 | ||||
| -rw-r--r-- | mobile/mainwindow.h | 17 |
6 files changed, 202 insertions, 0 deletions
diff --git a/mobile/CMakeLists.txt b/mobile/CMakeLists.txt new file mode 100644 index 0000000..12e629a --- /dev/null +++ b/mobile/CMakeLists.txt @@ -0,0 +1,101 @@ +cmake_minimum_required(VERSION 2.8) + +option(UPDATE_TRANSLATIONS "update Translation" OFF) +MESSAGE(STATUS "UPDATE TRANSLATIONS: ${UPDATE_TRANSLATIONS}") + + +project(diceGui) + + +# Find includes in corresponding build directories +set(CMAKE_INCLUDE_CURRENT_DIR ON) +# Instruct CMake to run moc automatically when needed. +set(CMAKE_AUTOMOC ON) + +# Find the QtWidgets library +find_package(Qt5 COMPONENTS Quick Qml Core Widgets Gui) +#find_package(Qt5QuickCompiler) + +set(EXECUTABLE_OUTPUT_PATH bin/) + +include_directories(${Qt5Core_INCLUDES} ${Qt5Widgets_INCLUDES} ${Qt5Gui_INCLUDES} ${Qt5Qml_INCLUDES} ${Qt5Quick_INCLUDES}../) +add_definitions(${Qt5Core_DEFINITIONS} ${Qt5Qml_DEFINITIONS} ${Qt5Quick_DEFINITIONS} ${Qt5Widgets_DEFINITIONS} ${Qt5Gui_DEFINITIONS} ) + +ADD_DEFINITIONS( + -std=c++11 +) + +set(diceGui_RESOURCES diceparser.qrc) +FIND_PACKAGE(Qt5LinguistTools) + + +IF(UPDATE_TRANSLATIONS) + MESSAGE( update Translation ) + FILE(GLOB_RECURSE translate_diceGui_SRCS ../*.cpp ../*.h) + SET(translate_SRCS ${translate_dice_SRCS}) + SET(diceGui_TS "${CMAKE_CURRENT_SOURCE_DIR}/i18n/diceGui_en.ts" "${CMAKE_CURRENT_SOURCE_DIR}/i18n/diceGui_fr.ts") +ELSE() + MESSAGE( NO updates for translations) + FILE(GLOB diceGui_TS "${CMAKE_CURRENT_SOURCE_DIR}/i18n/*.ts") +ENDIF(UPDATE_TRANSLATIONS) + +if(Qt5Core_FOUND) + + IF(UPDATE_TRANSLATIONS) + MESSAGE(status "find" ${diceGui_TS} ${translate_SRCS} ) + QT5_CREATE_TRANSLATION(diceGui_QM ${translate_SRCS} ${diceGui_TS}) + ELSE() + QT5_ADD_TRANSLATION(diceGui_QM ${diceGui_TS}) + ENDIF() + + QT5_ADD_RESOURCES(diceGui_RESOURCES_RCC ${diceGui_RESOURCES}) + + # guess plugins and libraries directory + set(QT_PLUGINS_DIR "${Qt5Core_DIR}/../../../plugins") + get_target_property(QT_LIBRARY_DIR Qt5::Core LOCATION) + get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH) +endif() + +SET( diceGui_sources + ../diceparser.cpp + ../range.cpp + ../booleancondition.cpp + ../validator.cpp + ../compositevalidator.cpp + ../operationcondition.cpp + ../die.cpp + ../parsingtoolbox.cpp + ../dicealias.cpp + ../result/result.cpp + ../result/scalarresult.cpp + ../result/stringresult.cpp + ../result/diceresult.cpp + ../node/countexecutenode.cpp + ../node/dicerollernode.cpp + ../node/executionnode.cpp + ../node/explosedicenode.cpp + ../node/helpnode.cpp + ../node/mergenode.cpp + ../node/jumpbackwardnode.cpp + ../node/keepdiceexecnode.cpp + ../node/listaliasnode.cpp + ../node/listsetrollnode.cpp + ../node/numbernode.cpp + ../node/parenthesesnode.cpp + ../node/paintnode.cpp + ../node/rerolldicenode.cpp + ../node/scalaroperatornode.cpp + ../node/sortresult.cpp + ../node/startingnode.cpp + ../node/ifnode.cpp + main.cpp + maincontroler.cpp + ../highlightdice.cpp +) + +add_executable( diceGui ${diceGui_sources} ${diceGui_QM} ) + +target_link_libraries(diceGui ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Qml_LIBRARIES} ${Qt5Quick_LIBRARIES}) +INSTALL_TARGETS(/bin diceGui) + +#qt5_use_modules() diff --git a/mobile/main.cpp b/mobile/main.cpp new file mode 100644 index 0000000..b450d5a --- /dev/null +++ b/mobile/main.cpp @@ -0,0 +1,54 @@ +/*************************************************************************** +* Copyright (C) 2016 by Renaud Guezennec * +* http://www.rolisteam.org/contact * +* * +* This file is part of DiceParser * +* * +* DiceParser is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ + + + + + +#include <QApplication> +#include <QQuickWindow> + +/** + * @page DiceGui + * The QML client for DiceParser the new dice system from rolisteam. + * It is dedicated to be used on smartphone. + * @section Build and install + * To build this program, type these command: + * - mkdir build + * - cd build + * - cmake ../ + * - make + * - make install + * @return + */ +int main(int argc, char *argv[]) +{ + QApplication app(argc,argv); + QApplication::setApplicationName("dice"); + QApplication::setApplicationVersion("1.0"); + + QQuickWindow* m_window; + + + + return 0; +} diff --git a/mobile/maincontroler.cpp b/mobile/maincontroler.cpp new file mode 100644 index 0000000..d6197e1 --- /dev/null +++ b/mobile/maincontroler.cpp @@ -0,0 +1,7 @@ +#include "maincontroler.h" + +MainControler::MainControler(QObject *parent) + : QObject(parent) +{ + +} diff --git a/mobile/maincontroler.h b/mobile/maincontroler.h new file mode 100644 index 0000000..98d68ff --- /dev/null +++ b/mobile/maincontroler.h @@ -0,0 +1,17 @@ +#ifndef MAINCONTROLER_H +#define MAINCONTROLER_H + +#include <QObject> + +class MainControler : public QObject +{ + Q_OBJECT +public: + explicit MainControler(QObject *parent = 0); + +signals: + +public slots: +}; + +#endif // MAINCONTROLER_H diff --git a/mobile/mainwindow.cpp b/mobile/mainwindow.cpp new file mode 100644 index 0000000..ec0bd08 --- /dev/null +++ b/mobile/mainwindow.cpp @@ -0,0 +1,6 @@ +#include "mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) +{ + +} diff --git a/mobile/mainwindow.h b/mobile/mainwindow.h new file mode 100644 index 0000000..df67bfe --- /dev/null +++ b/mobile/mainwindow.h @@ -0,0 +1,17 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include <QMainWindow> + +class MainWindow : public QMainWindow +{ + Q_OBJECT +public: + explicit MainWindow(QWidget *parent = 0); + +signals: + +public slots: +}; + +#endif // MAINWINDOW_H
\ No newline at end of file |