diff --git a/TouchTicTacTen/.cproject b/TouchTicTacTen/.cproject index e4c8cd4..c9ae9cd 100644 --- a/TouchTicTacTen/.cproject +++ b/TouchTicTacTen/.cproject @@ -3,8 +3,8 @@ - - + + @@ -14,32 +14,24 @@ - - - - - - + + @@ -60,32 +52,24 @@ - - - - - - + + @@ -106,32 +90,24 @@ - - - - - - + + @@ -152,32 +128,24 @@ - - - - - + - + - + - + - + diff --git a/TouchTicTacTen/.project b/TouchTicTacTen/.project index 27355d5..3d24b98 100644 --- a/TouchTicTacTen/.project +++ b/TouchTicTacTen/.project @@ -62,6 +62,11 @@ + + com.rim.tad.tools.wst.jsdt.core.javascriptValidator + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder full,incremental, diff --git a/TouchTicTacTen/.settings/org.eclipse.cdt.core.prefs b/TouchTicTacTen/.settings/org.eclipse.cdt.core.prefs new file mode 100644 index 0000000..7b3ee46 --- /dev/null +++ b/TouchTicTacTen/.settings/org.eclipse.cdt.core.prefs @@ -0,0 +1,33 @@ +eclipse.preferences.version=1 +environment/project/com.qnx.qcc.toolChain.1734555494/CPULIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.1734555494/CPULIST/operation=append +environment/project/com.qnx.qcc.toolChain.1734555494/CPULIST/value=x86 +environment/project/com.qnx.qcc.toolChain.1734555494/VARIANTLIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.1734555494/VARIANTLIST/operation=append +environment/project/com.qnx.qcc.toolChain.1734555494/VARIANTLIST/value=g +environment/project/com.qnx.qcc.toolChain.1734555494/append=true +environment/project/com.qnx.qcc.toolChain.1734555494/appendContributed=true +environment/project/com.qnx.qcc.toolChain.438719540/CPULIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.438719540/CPULIST/operation=append +environment/project/com.qnx.qcc.toolChain.438719540/CPULIST/value=arm +environment/project/com.qnx.qcc.toolChain.438719540/EXCLUDE_VARIANTLIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.438719540/EXCLUDE_VARIANTLIST/operation=append +environment/project/com.qnx.qcc.toolChain.438719540/EXCLUDE_VARIANTLIST/value=r +environment/project/com.qnx.qcc.toolChain.438719540/append=true +environment/project/com.qnx.qcc.toolChain.438719540/appendContributed=true +environment/project/com.qnx.qcc.toolChain.681787606/CPULIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.681787606/CPULIST/operation=append +environment/project/com.qnx.qcc.toolChain.681787606/CPULIST/value=arm +environment/project/com.qnx.qcc.toolChain.681787606/VARIANTLIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.681787606/VARIANTLIST/operation=append +environment/project/com.qnx.qcc.toolChain.681787606/VARIANTLIST/value=g +environment/project/com.qnx.qcc.toolChain.681787606/append=true +environment/project/com.qnx.qcc.toolChain.681787606/appendContributed=true +environment/project/com.qnx.qcc.toolChain.768170920/CPULIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.768170920/CPULIST/operation=append +environment/project/com.qnx.qcc.toolChain.768170920/CPULIST/value=arm +environment/project/com.qnx.qcc.toolChain.768170920/EXCLUDE_VARIANTLIST/delimiter=, +environment/project/com.qnx.qcc.toolChain.768170920/EXCLUDE_VARIANTLIST/operation=append +environment/project/com.qnx.qcc.toolChain.768170920/EXCLUDE_VARIANTLIST/value=p +environment/project/com.qnx.qcc.toolChain.768170920/append=true +environment/project/com.qnx.qcc.toolChain.768170920/appendContributed=true diff --git a/TouchTicTacTen/Makefile b/TouchTicTacTen/Makefile index 331e408..943eed8 100644 --- a/TouchTicTacTen/Makefile +++ b/TouchTicTacTen/Makefile @@ -1,35 +1,6 @@ QMAKE_TARGET = TouchTicTacTen -QMAKE = $(QNX_HOST)/usr/bin/qmake -TARGET = $(QMAKE_TARGET) +PROJECT_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) +I18N_DIR := $(PROJECT_DIR)/translations +include mk/cs-base.mk -all: Makefile $(QMAKE_TARGET) - -clean: - $(MAKE) -C ./arm -f Makefile sureclean - $(MAKE) -C ./x86 -f Makefile sureclean - - -Makefile: FORCE - $(QMAKE) -spec unsupported/blackberry-armv7le-qcc -o arm/Makefile $(QMAKE_TARGET).pro CONFIG+=device - $(QMAKE) -spec unsupported/blackberry-x86-qcc -o x86/Makefile $(QMAKE_TARGET).pro CONFIG+=simulator - $(MAKE) -C ./translations -f Makefile update release - -FORCE: - -$(QMAKE_TARGET): device simulator - -device: - $(MAKE) -C ./arm -f Makefile all - -Device-Debug: Makefile - $(MAKE) -C ./arm -f Makefile debug - -Device-Release: Makefile - $(MAKE) -C ./arm -f Makefile release - -simulator: - $(MAKE) -C ./x86 -f Makefile all - -Simulator-Debug: Makefile - $(MAKE) -C ./x86 -f Makefile debug diff --git a/TouchTicTacTen/README.md b/TouchTicTacTen/README.md index e96f9cb..771a6ae 100644 --- a/TouchTicTacTen/README.md +++ b/TouchTicTacTen/README.md @@ -2,14 +2,14 @@ The purpose of this application is to demonstrate how NFC peer to peer mode can be used in games. This is known as "Proximity Gaming". -Note that there is a Java version of this application for BlackBerry 7.1 devices and games can be played between Blackberry 7 devices and BlackBerry 10 devices. See https://github.com/blackberry/Samples-for-Java/tree/master/NFC/TouchTicTacToe +Note that there is a Java version of this application for BlackBerry 7.1 devices and games can be played between Blackberry 7 devices and BlackBerry 10 devices. See [BlackBerry 7 version](https://github.com/blackberry/Samples-for-Java/tree/master/NFC/TouchTicTacToe) The sample code for this application is Open Source under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html). **Applies To** -* [Cascades for BlackBerry 10](https://bdsc.webapps.blackberry.com/cascades/) +* [Cascades for BlackBerry 10](https://developer.blackberry.com/cascades/) * [BlackBerry Native SDK](http://developer.blackberry.com/native/) **Author(s)** @@ -19,6 +19,8 @@ the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html). **Release History** + +* **V1.0.2** - Support for latest NDK ( Gold) and 720x720 screen size * **V1** - Initial release **Known Issues** @@ -26,16 +28,17 @@ the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html). **Dependencies** -1. BlackBerry Dev Alpha Device Software **10.0.9** -2. BlackBerry 10 Native SDK **10.0.9** +1. BlackBerry 10 Device Software **10.0.9** +2. BlackBerry 10 Native SDK **10.0.9** (Gold) **I don't want to build it myself** If you don't want to build this sample application yourself we've included a -pre-build and signed BAR files for each version. You can find them in the +pre-build and signed BAR file for each version. You can find them in the folder "installable-bar-files": +* **TouchTicTacTen-1\_0\_2\_18.bar** -- Signed BAR file for Version 1.0.2 (V1.0.2) of the application ( requires BlackBerry 10 Software 10.0.9 ) **To contribute code to this repository you must be [signed up as an official contributor](http://blackberry.github.com/howToContribute.html).** diff --git a/TouchTicTacTen/TouchTicTacTen.pro b/TouchTicTacTen/TouchTicTacTen.pro index 84f125f..18563c3 100644 --- a/TouchTicTacTen/TouchTicTacTen.pro +++ b/TouchTicTacTen/TouchTicTacTen.pro @@ -1,51 +1,6 @@ -TEMPLATE = app -TARGET = TouchTicTacTen +APP_NAME = TouchTicTacTen -CONFIG += qt warn_on debug_and_release cascades - -INCLUDEPATH += ../src -SOURCES += ../src/*.cpp -HEADERS += ../src/*.hpp ../src/*.h +CONFIG += qt warn_on cascades10 LIBS += -lnfc -lnfc_bps -lupdate_inclusion { - SOURCES += ../assets/*.qml -} - -device { - CONFIG(release, debug|release) { - DESTDIR = o.le-v7 - } - CONFIG(debug, debug|release) { - DESTDIR = o.le-v7-g - } -} - -simulator { - CONFIG(release, debug|release) { - DESTDIR = o - } - CONFIG(debug, debug|release) { - DESTDIR = o-g - } -} - -OBJECTS_DIR = $${DESTDIR}/.obj -MOC_DIR = $${DESTDIR}/.moc -RCC_DIR = $${DESTDIR}/.rcc -UI_DIR = $${DESTDIR}/.ui - -suredelete.target = sureclean -suredelete.commands = $(DEL_FILE) $${MOC_DIR}/*; $(DEL_FILE) $${RCC_DIR}/*; $(DEL_FILE) $${UI_DIR}/* -suredelete.depends = distclean - -QMAKE_EXTRA_TARGETS += suredelete - -TRANSLATIONS = \ - $${TARGET}_en_GB.ts \ - $${TARGET}_fr.ts \ - $${TARGET}_it.ts \ - $${TARGET}_de.ts \ - $${TARGET}_es.ts \ - $${TARGET}.ts - +include(config.pri) diff --git a/TouchTicTacTen/assets/720x720/main.qml b/TouchTicTacTen/assets/720x720/main.qml new file mode 100644 index 0000000..e4cbc1e --- /dev/null +++ b/TouchTicTacTen/assets/720x720/main.qml @@ -0,0 +1,122 @@ +/* Copyright (c) 2012 Research In Motion Limited. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */import bb.cascades 1.0 + +Page { + Container { + background: backgroundPaint.imagePaint + attachedObjects: [ + ImagePaintDefinition { + id: backgroundPaint + imageSource: "asset:///images/background.png" + } + ] + layout: StackLayout { + } + Container { + layout: StackLayout { + orientation: LayoutOrientation.LeftToRight + } + horizontalAlignment: HorizontalAlignment.Center + Label { + text: "Touch Tic Tac Toe:" + textStyle { + base: SystemDefaults.TextStyles.TitleText + fontWeight: FontWeight.Bold + color: Color.create("#E6E9F8") + } + layoutProperties: StackLayoutProperties { + } + } + Label { + id: propertytime + + // ttt.numMoves is a property that we keep track on in cpp code + // every time it's changed the text will be updated. + text: " Moves: " + ttt.numMoves + textStyle { + base: SystemDefaults.TextStyles.TitleText + fontWeight: FontWeight.Bold + color: Color.create("#E6E9F8") + } + } + } + Label { + id: message + + // ttt.message is a property that we keep track on in cpp code + // every time it's changed the text will be updated. + text: ttt.message + textStyle { + base: SystemDefaults.TextStyles.SubtitleText + fontWeight: FontWeight.Bold + color: Color.Yellow + } + layoutProperties: StackLayoutProperties { + } + horizontalAlignment: HorizontalAlignment.Center + } + + // Here we group the containers player area, a background and a nice flare on top + Container { + layout: DockLayout { + } + layoutProperties: StackLayoutProperties { + } + horizontalAlignment: HorizontalAlignment.Center + //This container is the one we find from CPP and add all the tiles to + // It's so much easier to do that from C++. + Container { + objectName: "playArea" + //The dark gray is an average trick, we can use it to see where we put our player area when layouting. + background: Color.DarkGray + preferredWidth: 600 + preferredHeight: preferredWidth + layout: StackLayout { + orientation: LayoutOrientation.LeftToRight + } + layoutProperties: StackLayoutProperties { + } + horizontalAlignment: HorizontalAlignment.Center + verticalAlignment: VerticalAlignment.Center + } + } + Container { + layout: StackLayout { + orientation: LayoutOrientation.LeftToRight + } + layoutProperties: StackLayoutProperties { + } + horizontalAlignment: HorizontalAlignment.Center + Button { + text: "Reset" + onClicked: { + ttt.resetTiles(); + } + } + } + Label { + id: about1 + text: "Martin Woolley (@mdwrim) and John Murray (@jcmrim) V1.02" + textStyle { + base: SystemDefaults.TextStyles.SmallText + fontWeight: FontWeight.Bold + color: Color.create("#E6E9F8") + } + layoutProperties: StackLayoutProperties { + } + horizontalAlignment: HorizontalAlignment.Center + } + } +} diff --git a/TouchTicTacTen/assets/main.qml b/TouchTicTacTen/assets/main.qml index e3560ec..4257ad4 100644 --- a/TouchTicTacTen/assets/main.qml +++ b/TouchTicTacTen/assets/main.qml @@ -111,7 +111,7 @@ Page { } Label { id: about1 - text: "Martin Woolley (@mdwrim) and John Murray (@jcmrim) V1.01" + text: "Martin Woolley (@mdwrim) and John Murray (@jcmrim) V1.02" textStyle { base: SystemDefaults.TextStyles.SmallText fontWeight: FontWeight.Bold diff --git a/TouchTicTacTen/bar-descriptor.xml b/TouchTicTacTen/bar-descriptor.xml index 2ca3fd2..e080830 100644 --- a/TouchTicTacTen/bar-descriptor.xml +++ b/TouchTicTacTen/bar-descriptor.xml @@ -35,7 +35,7 @@ - 1.0.0 + 1.0.2 buildnum - Martin Woolley - gYAAgLMrXMtcNrv1o1MfhJyK8bg + John Murray + gYAAgFPCViUqswOvaRvSwB1Mf2w @@ -65,19 +65,20 @@ core.games - + armle-v7 TouchTicTacTen - + + Qnx/Cascades armle-v7 - TouchTicTacTen + TouchTicTacTen.so - + armle-v7 - TouchTicTacTen + TouchTicTacTen - + x86 TouchTicTacTen @@ -98,8 +99,8 @@ run_native - - + + invoke_across_perimeters APPLICATION diff --git a/TouchTicTacTen/buildnum b/TouchTicTacTen/buildnum new file mode 100644 index 0000000..dec2bf5 --- /dev/null +++ b/TouchTicTacTen/buildnum @@ -0,0 +1 @@ +19 \ No newline at end of file diff --git a/TouchTicTacTen/config.pri b/TouchTicTacTen/config.pri new file mode 100644 index 0000000..6bab8a7 --- /dev/null +++ b/TouchTicTacTen/config.pri @@ -0,0 +1,32 @@ +# Auto-generated by IDE. All changes by user will be lost! +# Created at 13/02/13 14:39 + +BASEDIR = $$_PRO_FILE_PWD_ + +INCLUDEPATH += \ + $$BASEDIR/src + +SOURCES += \ + $$BASEDIR/src/GameState.cpp \ + $$BASEDIR/src/NfcManager.cpp \ + $$BASEDIR/src/NfcWorker.cpp \ + $$BASEDIR/src/app.cpp \ + $$BASEDIR/src/main.cpp + +HEADERS += \ + $$BASEDIR/src/GameState.hpp \ + $$BASEDIR/src/NfcManager.hpp \ + $$BASEDIR/src/NfcWorker.hpp \ + $$BASEDIR/src/app.hpp + +CONFIG += precompile_header +PRECOMPILED_HEADER = $$BASEDIR/precompiled.h + +lupdate_inclusion { + SOURCES += \ + $$BASEDIR/../assets/*.qml +} + +TRANSLATIONS = \ + $${TARGET}.ts + diff --git a/TouchTicTacTen/installable-bar-files/TouchTicTacTen-1_0_0_1.bar b/TouchTicTacTen/installable-bar-files/TouchTicTacTen-1_0_0_1.bar deleted file mode 100644 index 5feea0d..0000000 Binary files a/TouchTicTacTen/installable-bar-files/TouchTicTacTen-1_0_0_1.bar and /dev/null differ diff --git a/TouchTicTacTen/installable-bar-files/TouchTicTacTen-1_0_2_18.bar b/TouchTicTacTen/installable-bar-files/TouchTicTacTen-1_0_2_18.bar new file mode 100644 index 0000000..2263065 Binary files /dev/null and b/TouchTicTacTen/installable-bar-files/TouchTicTacTen-1_0_2_18.bar differ diff --git a/TouchTicTacTen/precompiled.h b/TouchTicTacTen/precompiled.h new file mode 100644 index 0000000..6213dc4 --- /dev/null +++ b/TouchTicTacTen/precompiled.h @@ -0,0 +1,2 @@ +// This file is used to store precompiled headers. +// It is intentionally left blank. It is up to you to decide which headers should be included here. diff --git a/TouchTicTacTen/src/main.cpp b/TouchTicTacTen/src/main.cpp index 18c839e..86c43f9 100644 --- a/TouchTicTacTen/src/main.cpp +++ b/TouchTicTacTen/src/main.cpp @@ -19,13 +19,14 @@ #include #include +#include #include "App.hpp" using ::bb::cascades::Application; -int main(int argc, char **argv) +Q_DECL_EXPORT int main(int argc, char **argv) { //-- this is where the server is started etc Application app(argc, argv);