From 3ca36a49d739434a30e1c0caeee7b882c7a1ba2d Mon Sep 17 00:00:00 2001 From: CatalystG Date: Sun, 14 Apr 2013 13:11:19 -0400 Subject: [PATCH] (BlackBerry) Add an initial BB10 UI with no backend logic yet. --- blackberry-qnx/bb10/.cproject | 41 ------- blackberry-qnx/bb10/RetroArch-Cascades.pro | 3 +- blackberry-qnx/bb10/assets/images/file.png | Bin 0 -> 1678 bytes blackberry-qnx/bb10/assets/images/icon.png | Bin 0 -> 2941 bytes blackberry-qnx/bb10/assets/images/open.png | Bin 0 -> 669 bytes blackberry-qnx/bb10/assets/mainPage.qml | 116 +++++++++++++++--- blackberry-qnx/bb10/bar-descriptor.xml | 7 +- .../bb10/src/RetroArch-Cascades.cpp | 29 ++++- blackberry-qnx/bb10/src/RetroArch-Cascades.h | 35 +++--- 9 files changed, 151 insertions(+), 80 deletions(-) create mode 100644 blackberry-qnx/bb10/assets/images/file.png create mode 100644 blackberry-qnx/bb10/assets/images/icon.png create mode 100644 blackberry-qnx/bb10/assets/images/open.png diff --git a/blackberry-qnx/bb10/.cproject b/blackberry-qnx/bb10/.cproject index 39b4c35d4b..e6ecda9067 100644 --- a/blackberry-qnx/bb10/.cproject +++ b/blackberry-qnx/bb10/.cproject @@ -126,47 +126,6 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/blackberry-qnx/bb10/RetroArch-Cascades.pro b/blackberry-qnx/bb10/RetroArch-Cascades.pro index 414a4f47ad..e147755860 100644 --- a/blackberry-qnx/bb10/RetroArch-Cascades.pro +++ b/blackberry-qnx/bb10/RetroArch-Cascades.pro @@ -2,6 +2,7 @@ APP_NAME = RetroArch-Cascades CONFIG += qt warn_on cascades10 -LIBS += -lscreen +LIBS += -lscreen +LIBS += -lbbcascadespickers include(config.pri) diff --git a/blackberry-qnx/bb10/assets/images/file.png b/blackberry-qnx/bb10/assets/images/file.png new file mode 100644 index 0000000000000000000000000000000000000000..cd10d50581913bcbca63392a0f0b8ffdb0157858 GIT binary patch literal 1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q1aC-B?;rpo z5P^t*2t*(P5djg1K(twnX9g*y60cn@m!@$vBxYC?ftL48^Q^+C`Z2|apUB@Dq zNKBL5vAJdLe0e?WiAC*+uc+N_E7KsH&u6WoDv?-)NVK6cuDb>zk;682#?A zVt_?vXTQoIP07xVOf>qXl}@uZ5}#48*K?)&NVjdk2t0SEd7b)a5&85 z^`!$e_K76~m=b|LcGd^@Su2RIX3+h9pJw3*V87pA7HwypQ$VB0$%X)L5qM{^5x~J< zu*_ngveM3RfJqT}16aH4EDL{F6xi){k%g5~)&VTU&LO}@79I|V%dC$b)*Nx-0Fxr{ z9>A3M>lhn}+wHa~R?PBGKhFUCTeR?Hyk~M^S%iQ3(JdfcTUdyA7=bb-UbF~%$Mhpk zrV%(AjUHN9#-tW4>iop=6hJGpb5@yhJRVyIu<$3As*3NO>t^S;Hk(a=olCY*o?5Th z;i2Bc&i|J?nM^z*>|9lV(i~&#EO%SkLLNJtoSkhFk!Tvk)oRtLGekFw%r~7*z1l*& z*7jVD8lszLJ+N#kk_L$dh(JU@1R@ZDh=7=negzl+{}R5g{ao8100000NkvXXu0mjf D-nJ_( literal 0 HcmV?d00001 diff --git a/blackberry-qnx/bb10/assets/mainPage.qml b/blackberry-qnx/bb10/assets/mainPage.qml index 1405ae4dde..66c9824cf7 100644 --- a/blackberry-qnx/bb10/assets/mainPage.qml +++ b/blackberry-qnx/bb10/assets/mainPage.qml @@ -1,25 +1,109 @@ -/* 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 +import bb.cascades.pickers 1.0 TabbedPane { Tab { Page { - Container { - + actions: [ + ActionItem { + title: "Play" + ActionBar.placement: ActionBarPlacement.OnBar + imageSource: "asset:///images/open.png" + onTriggered: { + if(RetroArch.rom == "" || RetroArch.core == ""){ + //Do something to focus on select rom box + } else { + OrientationSupport.supportedDisplayOrientation = + SupportedDisplayOrientation.DisplayLandscape; + } + } + } + ] + + titleBar: TitleBar { + id: titleBar + title: "RetroArch" } + + Container { + horizontalAlignment: HorizontalAlignment.Fill + verticalAlignment: VerticalAlignment.Fill + rightPadding: 20 + leftPadding: 20 + + layout: DockLayout {} + + Container { + preferredWidth: 680 + horizontalAlignment: HorizontalAlignment.Center + verticalAlignment: VerticalAlignment.Center + + ImageView + { + horizontalAlignment: HorizontalAlignment.Center + imageSource: "asset:///images/icon.png" + preferredWidth: 200 + preferredHeight: 200 + } + + DropDown + { + id: _core + objectName: "dropdown_core" + horizontalAlignment: HorizontalAlignment.Center + title: "Core Selection" + } + + Container { + horizontalAlignment: HorizontalAlignment.Center + preferredWidth: 680 + + layout: StackLayout { + orientation: LayoutOrientation.LeftToRight + } + + DropDown + { + id: romName + verticalAlignment: VerticalAlignment.Center + horizontalAlignment: HorizontalAlignment.Center + preferredWidth: 600 + enabled: false + //hintText: "Select a ROM" + title: if(picker.selectedFile) + picker.selectedFile + else + "Rom Selection" + } + + ImageButton { + horizontalAlignment: HorizontalAlignment.Right + defaultImageSource: "asset:///images/file.png" + onClicked: { + picker.open(); + } + } + } + } + } + attachedObjects: [ + FilePicker { + id: picker + + property string selectedFile + + title: "Rom Selector" + filter: [] + type: FileType.Other + directories: ["/accounts/1000/shared/documents/roms"] + + onFileSelected: { + RetroArch.rom = selectedFiles[0]; + selectedFile = RetroArch.rom.substr(RetroArch.rom.lastIndexOf('/')+1); + picker.directories = [RetroArch.rom.substr(0, RetroArch.rom.lastIndexOf('/'))]; + } + } + ] } } Tab { diff --git a/blackberry-qnx/bb10/bar-descriptor.xml b/blackberry-qnx/bb10/bar-descriptor.xml index cef7222445..dda123717e 100644 --- a/blackberry-qnx/bb10/bar-descriptor.xml +++ b/blackberry-qnx/bb10/bar-descriptor.xml @@ -9,7 +9,7 @@ - com.example.helloforeignwindow + com.example.RetroArch @@ -30,8 +30,7 @@ - landscape - false + true none false @@ -68,7 +67,7 @@ - bright + dark run_native diff --git a/blackberry-qnx/bb10/src/RetroArch-Cascades.cpp b/blackberry-qnx/bb10/src/RetroArch-Cascades.cpp index 086b9aca7b..0a2559644e 100644 --- a/blackberry-qnx/bb10/src/RetroArch-Cascades.cpp +++ b/blackberry-qnx/bb10/src/RetroArch-Cascades.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -26,6 +27,9 @@ using namespace bb::cascades; RetroArch::RetroArch() { + qmlRegisterType("bb.cascades.pickers", 1, 0, "FilePicker"); + qmlRegisterUncreatableType("bb.cascades.pickers", 1, 0, "FileType", ""); + // Create a QML document and load the main UI QML file, using build patterns. QmlDocument *qml = QmlDocument::create("asset:///mainPage.qml"); @@ -58,6 +62,29 @@ RetroArch::~RetroArch() void RetroArch::run() { while (true) { - + sleep(1); } } + +/* + * Properties + */ + +QString RetroArch::getRom() +{ + return rom; +} + +void RetroArch::setRom(QString rom) +{ + this->rom = rom; +} + +QString RetroArch::getCore() +{ + return core; +} +void RetroArch::setCore(QString core) +{ + this->core = core; +} diff --git a/blackberry-qnx/bb10/src/RetroArch-Cascades.h b/blackberry-qnx/bb10/src/RetroArch-Cascades.h index 6030771ad8..4d1efe74b9 100644 --- a/blackberry-qnx/bb10/src/RetroArch-Cascades.h +++ b/blackberry-qnx/bb10/src/RetroArch-Cascades.h @@ -1,19 +1,5 @@ -/* 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. - */ -#ifndef _HELLOFOREIGNWINDOW_H_ -#define _HELLOFOREIGNWINDOW_H_ +#ifndef _RETROARCHCASCADES_H_ +#define _RETROARCHCASCADES_H_ #include #include @@ -33,10 +19,17 @@ class RetroArch: public QThread { Q_OBJECT + Q_PROPERTY(QString rom READ getRom WRITE setRom NOTIFY romChanged) + Q_PROPERTY(QString core READ getCore WRITE setCore NOTIFY coreChanged) + public: RetroArch(); ~ RetroArch(); +signals: + void romChanged(QString); + void coreChanged(QString); + private: /** * This QThread-run function runs the custom window rendering in a separate thread to avoid lag @@ -44,6 +37,14 @@ private: */ void run(); + QString rom; + QString getRom(); + void setRom(QString rom); + + QString core; + QString getCore(); + void setCore(QString core); + }; -#endif // ifndef _HELLOFOREIGNWINDOW_H_ +#endif