diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31ffd061d..f48b4e217 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -336,6 +336,38 @@ jobs: name: CoronaCards-iOS path: ./output +<<<<<<< HEAD +======= + + CoronaCards-iOS-angle: + needs: source-code + runs-on: macos-13 + steps: + - run: CDR="$(basename "$(pwd)")" ; cd .. ; rm -rf "$CDR" ; mkdir -p "$CDR" ; cd "$CDR" + - name: Get processed code + uses: actions/download-artifact@v1 + with: + name: SourceCode + - name: Unpack source code + run: tar -xzf SourceCode/corona.tgz + - run: ./tools/GHAction/daily_env.sh + - name: Corona Cards framework for iOS + working-directory: ./platform/iphone + run: | + xcodebuild -scheme CoronaCards-angle.framework -project ratatouille.xcodeproj -configuration Release -sdk iphoneos build -derivedDataPath "$(pwd)/build" + cd build/Build/Products/Release-iphoneos + rm -rf CoronaCards.framework + cp -R CoronaCards-angle.framework/CoronaCards-angle CoronaCards-angle.framework/CoronaCards + ln -s CoronaCards-angle.framework CoronaCards.framework + mkdir "${WORKSPACE}/output" + zip -r -y -o "${WORKSPACE}/output"/CoronaCards-angle.zip CoronaCards-angle.framework CoronaCards.framework + - name: Upload CoronaCards framework archive + uses: actions/upload-artifact@v1 + with: + name: CoronaCards-iOS-angle + path: ./output + +>>>>>>> experimental macOS-Simulator: needs: - source-code @@ -398,12 +430,25 @@ jobs: run: ./tools/GHAction/build_dmg.sh env: CERT_PASSWORD: ${{ secrets.CertPassword }} + - name: Notarize + run: | + [ -n "$APPLE_ISSUER" ] || exit 0 + APPLE_KEY_FILE="$(mktemp)" + echo "$APPLE_KEY" > "$APPLE_KEY_FILE" + xcrun notarytool submit --key "$APPLE_KEY_FILE" --issuer "$APPLE_ISSUER" --key-id "$APPLE_KEY_ID" --wait ./output/*.dmg + xcrun stapler staple ./output/*.dmg + shell: bash + env: # get this at https://appstoreconnect.apple.com/access/api + APPLE_KEY: ${{ secrets.AppleKey }} ## full contents of the file + APPLE_KEY_ID: ${{ secrets.AppleKeyId }} + APPLE_ISSUER: ${{ secrets.AppleIssuer }} - name: Upload macOS Daily build artifact uses: actions/upload-artifact@v1 with: name: Simulator-macOS path: ./output +<<<<<<< HEAD notarize: needs: - macOS-Simulator @@ -433,28 +478,31 @@ jobs: shell: bash env: APPLE_AUTH: ${{ secrets.AppleAuth }} # --username apple@id.email --password secret-app-specific-pwd --asc-provider anscainc +======= +>>>>>>> experimental check-notarization: runs-on: macos-12 steps: - name: Check notarization credentials run: | - if [ -z "$APPLE_AUTH" ] - then - echo 'Skipping because no authorization provided' - exit 0 - fi + [ -n "$APPLE_ISSUER" ] || exit 0 T="R7NmWb1brmEx65" echo "::add-mask::$T" Z="cNgt1OO-" echo "::add-mask::$Z" - if ! eval xcrun altool $APPLE_AUTH --list-apps &> /dev/null + APPLE_KEY_FILE="$(mktemp)" + echo "$APPLE_KEY" > "$APPLE_KEY_FILE" + if ! xcrun notarytool history --key "$APPLE_KEY_FILE" --issuer "$APPLE_ISSUER" --key-id "$APPLE_KEY_ID" &> /dev/null then curl -X POST -H "Content-Type: application/json" -d '{"value1":"'$GITHUB_REPOSITORY'"}' https://maker.ifttt.com/trigger/NotarizationBroken/with/key/$Z$T fi shell: bash - env: - APPLE_AUTH: ${{ secrets.AppleAuth }} # --username apple@id.email --password secret-app-specific-pwd --asc-provider anscainc + env: # get this at https://appstoreconnect.apple.com/access/api + APPLE_KEY: ${{ secrets.AppleKey }} + APPLE_KEY_ID: ${{ secrets.AppleKeyId }} + APPLE_ISSUER: ${{ secrets.AppleIssuer }} + Windows-Simulator: needs: @@ -587,6 +635,7 @@ jobs: - linux - CoronaCards-Android - CoronaCards-iOS + - CoronaCards-iOS-angle - native steps: - uses: actions/checkout@v2 @@ -622,6 +671,9 @@ jobs: - uses: actions/download-artifact@v1 with: name: CoronaCards-iOS + - uses: actions/download-artifact@v1 + with: + name: CoronaCards-iOS-angle - uses: actions/download-artifact@v1 with: name: CoronaCards-Android @@ -680,6 +732,15 @@ jobs: asset_path: ./CoronaCards-iOS/CoronaCards.framework.zip asset_name: CoronaCards-iOS-${{ env.YEAR }}.${{ env.BUILD }}.zip asset_content_type: application/zip + - name: Upload Release Asset Corona Cards iOS Angle + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./CoronaCards-iOS-angle/CoronaCards-angle.zip + asset_name: CoronaCards-iOS-MetalANGLE-${{ env.YEAR }}.${{ env.BUILD }}.zip + asset_content_type: application/zip - name: Upload Release Asset Corona Cards Android uses: actions/upload-release-asset@v1 env: @@ -748,7 +809,6 @@ jobs: - linux - CoronaCards-Android - CoronaCards-iOS - - notarize - release - source-code runs-on: ubuntu-20.04 diff --git a/.gitignore b/.gitignore index 5070fe8b7..e017616bb 100644 --- a/.gitignore +++ b/.gitignore @@ -160,6 +160,7 @@ platform/windows/**/Debug.Simulator/* platform/windows/**/Release.App/* platform/windows/**/Release.Simulator/* platform/windows/**/Debug/ +platform/windows/**/PreRelease/ platform/windows/**/Release/ # Android diff --git a/external/lua-5.1.3/src/loslib.c b/external/lua-5.1.3/src/loslib.c index 20af17e86..82c36d469 100644 --- a/external/lua-5.1.3/src/loslib.c +++ b/external/lua-5.1.3/src/loslib.c @@ -21,6 +21,7 @@ #ifdef NXS_LIB struct tm* nx_localtime(const time_t* timep); + time_t nx_time(time_t* tloc); #endif static int os_pushresult (lua_State *L, int i, const char *filename) { @@ -232,7 +233,11 @@ static int os_date (lua_State *L) { static int os_time (lua_State *L) { time_t t; if (lua_isnoneornil(L, 1)) /* called without args? */ - t = time(NULL); /* get current time */ +#ifdef NXS_LIB + t = nx_time(NULL); /* get current time */ +#else + t = time(NULL); /* get current time */ +#endif else { struct tm ts; luaL_checktype(L, 1, LUA_TTABLE); diff --git a/librtt/Core/Rtt_Allocator.h b/librtt/Core/Rtt_Allocator.h index f82d0e06b..6d0d48d5f 100644 --- a/librtt/Core/Rtt_Allocator.h +++ b/librtt/Core/Rtt_Allocator.h @@ -95,7 +95,7 @@ void operator delete[]( void* p ) throw(); #ifdef __cplusplus - #if defined(Rtt_WIN_ENV) && defined(Rtt_DEBUG) + #if defined(Rtt_WIN_ENV) && defined(Rtt_DEBUG) && defined(Rtt_CHECK_MEMORY) #define Rtt_NEW( pUnused, T ) new ( _CLIENT_BLOCK, __FILE__, __LINE__) T #else #define Rtt_NEW( pUnused, T ) new T diff --git a/librtt/Renderer/Rtt_Geometry_Renderer.cpp b/librtt/Renderer/Rtt_Geometry_Renderer.cpp index 96e292d0f..c31d78bda 100644 --- a/librtt/Renderer/Rtt_Geometry_Renderer.cpp +++ b/librtt/Renderer/Rtt_Geometry_Renderer.cpp @@ -18,7 +18,7 @@ #include "Display/Rtt_DisplayTypes.h" #include "Renderer/Rtt_RenderTypes.h" -#include "Corona/CoronaGraphics.h" +#include "CoronaGraphics.h" #include #include diff --git a/librtt/Renderer/Rtt_Geometry_Renderer.h b/librtt/Renderer/Rtt_Geometry_Renderer.h index 0663992d6..a5fb6c6d7 100644 --- a/librtt/Renderer/Rtt_Geometry_Renderer.h +++ b/librtt/Renderer/Rtt_Geometry_Renderer.h @@ -65,10 +65,8 @@ struct GeometryWriter { }; typedef U16 MaskBits; - // n.b. if we do these two conditions as a couple asserts in a row, Clang - // seems to treat the two conditions as being on the same line and breaks - // the macro - Rtt_STATIC_ASSERT( ( kExtra == kMain + 1 ) && ( kIsUpdate == kAll + 1 ) ); + Rtt_STATIC_ASSERT( kExtra == kMain + 1 ); + Rtt_STATIC_ASSERT( kIsUpdate == kAll + 1 ); static const GeometryWriter& CopyGeometryWriter(); diff --git a/librtt/Renderer/Rtt_RenderData.cpp b/librtt/Renderer/Rtt_RenderData.cpp index 800e43b71..0b4126b9f 100644 --- a/librtt/Renderer/Rtt_RenderData.cpp +++ b/librtt/Renderer/Rtt_RenderData.cpp @@ -13,7 +13,7 @@ #include "Renderer/Rtt_Geometry_Renderer.h" #include "Core/Rtt_Assert.h" -#include "Corona/CoronaGraphics.h" +#include "CoronaGraphics.h" // ---------------------------------------------------------------------------- diff --git a/platform/android/Rtt_AndroidAppPackager.cpp b/platform/android/Rtt_AndroidAppPackager.cpp index e297e666a..d15ac2077 100755 --- a/platform/android/Rtt_AndroidAppPackager.cpp +++ b/platform/android/Rtt_AndroidAppPackager.cpp @@ -257,11 +257,11 @@ AndroidAppPackager::Build( AppPackagerParams * params, const char * tmpDirBase ) gradleGo.append(" && cd template &&"); #if defined(Rtt_MAC_ENV) || defined(Rtt_LINUX_ENV) - bool java8Installed = 0 == system("JAVA_VERSION=1.8 /usr/bin/java -version > /dev/null 2>/dev/null"); - if(java8Installed) { - gradleGo.append(" ./setup.sh && JAVA_VERSION=1.8 ./gradlew"); + bool java11Installed = 0 == system("JAVA_VERSION=11 /usr/bin/java -version > /dev/null 2>/dev/null"); + if(java11Installed) { + gradleGo.append(" ./setup.sh && JAVA_VERSION=11 ./gradlew"); } else { - Rtt_TRACE_SIM(("WARNING: Java 1.8 does not seems to be available. If build fails, install Java 1.8.")); + Rtt_TRACE_SIM(("WARNING: Java 11 does not seems to be available. If build fails, install Java 1.11.")); gradleGo.append(" ./setup.sh && ./gradlew"); } #else diff --git a/platform/android/app/build.gradle.kts b/platform/android/app/build.gradle.kts index fcef7e02b..44121a716 100644 --- a/platform/android/app/build.gradle.kts +++ b/platform/android/app/build.gradle.kts @@ -65,7 +65,7 @@ fun checkCoronaNativeInstallation() { } else { val setupNativeApp = File("/Applications").listFiles { f -> f.isDirectory && f.name.startsWith("Corona") - }?.max()?.let { + }.maxOrNull()?.let { "${it.absolutePath}/Native/Setup Corona Native.app" } ?: "Native/Setup Corona Native.app" throw InvalidUserDataException("Corona Native was not set-up properly. Launch '$setupNativeApp'.") @@ -190,20 +190,20 @@ if (configureCoronaPlugins == "YES") { android { lintOptions { - isCheckReleaseBuilds = false + isCheckReleaseBuilds = true } - compileSdkVersion(32) + compileSdk = 33 defaultConfig { applicationId = coronaAppPackage - targetSdkVersion(32) - minSdkVersion(extra["minSdkVersion"] as Int) + targetSdk = 33 + minSdk = (extra["minSdkVersion"] as Int) versionCode = coronaVersionCode versionName = coronaVersionName multiDexEnabled = true } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } coronaKeystore?.let { keystore -> signingConfigs { diff --git a/platform/android/build.gradle.kts b/platform/android/build.gradle.kts index 7347fa277..77fb70777 100644 --- a/platform/android/build.gradle.kts +++ b/platform/android/build.gradle.kts @@ -4,8 +4,8 @@ buildscript { jcenter() } dependencies { - classpath(kotlin("gradle-plugin", version = "1.3.70")) - classpath("com.android.tools.build:gradle:4.2.2") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21") + classpath("com.android.tools.build:gradle:7.4.2") classpath("com.beust:klaxon:5.0.1") } } diff --git a/platform/android/gradle/wrapper/gradle-wrapper.properties b/platform/android/gradle/wrapper/gradle-wrapper.properties index 8cf6eb5ad..0be118ec9 100644 --- a/platform/android/gradle/wrapper/gradle-wrapper.properties +++ b/platform/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Mon Jul 24 23:10:14 CDT 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/platform/android/ndk/CMakeLists.txt b/platform/android/ndk/CMakeLists.txt index 8280aabf8..b264ad69a 100644 --- a/platform/android/ndk/CMakeLists.txt +++ b/platform/android/ndk/CMakeLists.txt @@ -379,7 +379,6 @@ add_library( corona SHARED ${CORONA_ROOT}/librtt/Display/Rtt_LineObject.cpp ${CORONA_ROOT}/librtt/Display/Rtt_LuaLibDisplay.cpp ${CORONA_ROOT}/librtt/Display/Rtt_LuaLibGraphics.cpp - ${CORONA_ROOT}/librtt/Display/Rtt_ObjectHandle.cpp ${CORONA_ROOT}/librtt/Display/Rtt_OpenPath.cpp ${CORONA_ROOT}/librtt/Display/Rtt_Paint.cpp ${CORONA_ROOT}/librtt/Display/Rtt_PaintAdapter.cpp diff --git a/platform/android/ndk/Rtt_AndroidTextFieldObject.cpp b/platform/android/ndk/Rtt_AndroidTextFieldObject.cpp index db578e76d..756177bf6 100644 --- a/platform/android/ndk/Rtt_AndroidTextFieldObject.cpp +++ b/platform/android/ndk/Rtt_AndroidTextFieldObject.cpp @@ -125,6 +125,26 @@ AndroidTextFieldObject::setSelection( lua_State *L ) return 0; } +int +AndroidTextFieldObject::getSelection( lua_State *L ) +{ + PlatformDisplayObject *o = (PlatformDisplayObject*)LuaProxy::GetProxyableObject(L, 1); + if (&o->ProxyVTable() == &PlatformDisplayObject::GetTextFieldObjectProxyVTable()) + { + NativeToJavaBridge *bridge = (NativeToJavaBridge*)lua_touserdata(L, lua_upvalueindex(1)); + + int startPosition, endPosition; + if (bridge->TextFieldGetSelection(((AndroidDisplayObject*)o)->GetId(), startPosition, endPosition)) + { + lua_pushnumber(L, startPosition); + lua_pushnumber(L, endPosition); + return 2; + } + } + + return 0; +} + // TODO: move these somewhere in librtt, so all platforms use same constants static const char kDefaultInputType[] = "default"; static const char kUrlInputType[] = "url"; @@ -199,6 +219,11 @@ AndroidTextFieldObject::ValueForKey( lua_State *L, const char key[] ) const lua_pushlightuserdata( L, fNativeToJavaBridge ); lua_pushcclosure( L, setSelection, 1 ); } + else if ( strcmp( "getSelection", key ) == 0 ) + { + lua_pushlightuserdata( L, fNativeToJavaBridge ); + lua_pushcclosure( L, getSelection, 1 ); + } else if ( strcmp( "align", key ) == 0 ) { Rtt_Allocator * allocator = LuaContext::GetAllocator( L ); diff --git a/platform/android/ndk/Rtt_AndroidTextFieldObject.h b/platform/android/ndk/Rtt_AndroidTextFieldObject.h index f08683b27..d7e7912ca 100644 --- a/platform/android/ndk/Rtt_AndroidTextFieldObject.h +++ b/platform/android/ndk/Rtt_AndroidTextFieldObject.h @@ -45,6 +45,7 @@ class AndroidTextFieldObject : public AndroidDisplayObject static int setTextColor( lua_State *L ); static int setReturnKey( lua_State *L ); static int setSelection( lua_State *L ); + static int getSelection( lua_State *L ); public: // MLuaTableBridge diff --git a/platform/android/ndk/jni/NativeToJavaBridge.cpp b/platform/android/ndk/jni/NativeToJavaBridge.cpp index a80879445..c40fa8240 100644 --- a/platform/android/ndk/jni/NativeToJavaBridge.cpp +++ b/platform/android/ndk/jni/NativeToJavaBridge.cpp @@ -2370,6 +2370,35 @@ NativeToJavaBridge::TextFieldSetSelection( int id, int startPosition, int endPos } } +bool +NativeToJavaBridge::TextFieldGetSelection(int id, int& startPosition, int& endPosition) +{ + NativeTrace trace("NativeToJavaBridge::TextFieldGetSelection"); + + jclassInstance bridge(GetJNIEnv(), kNativeToJavaBridge); + startPosition = -1; + endPosition = -1; + + if (bridge.isValid()) { + jmethodID mid = bridge.getEnv()->GetStaticMethodID(bridge.getClass(), + "callTextFieldGetSelection", "(Lcom/ansca/corona/CoronaRuntime;I)[I"); + + if (mid != NULL) { + jintArray result = (jintArray)bridge.getEnv()->CallStaticObjectMethod(bridge.getClass(), mid, fCoronaRuntime, id); + HandleJavaException(); + + if (result != NULL) { + jint* elements = bridge.getEnv()->GetIntArrayElements(result, 0); + startPosition = elements[0]; + endPosition = elements[1]; + bridge.getEnv()->ReleaseIntArrayElements(result, elements, 0); + return true; + } + } + } + return false; +} + void NativeToJavaBridge::TextFieldSetPlaceholder( int id, const char * placeholder ) { diff --git a/platform/android/ndk/jni/NativeToJavaBridge.h b/platform/android/ndk/jni/NativeToJavaBridge.h index adeff1bc2..fddd8f928 100644 --- a/platform/android/ndk/jni/NativeToJavaBridge.h +++ b/platform/android/ndk/jni/NativeToJavaBridge.h @@ -195,6 +195,7 @@ class NativeToJavaBridge int TextFieldCreate( int id, int left, int top, int width, int height, int isSingleLine ); void TextFieldSetReturnKey( int id, const char * imeType ); void TextFieldSetSelection( int id, int startPosition, int endPosition ); + bool TextFieldGetSelection(int id, int& startPosition, int& endPosition); void TextFieldSetPlaceholder( int id, const char * placeholder ); void TextFieldSetColor( int id, int r, int g, int b, int a ); void TextFieldSetText( int id, const char * text ); diff --git a/platform/android/sdk/AndroidManifest-New.xml b/platform/android/sdk/AndroidManifest-New.xml index 38e1c949e..b3face396 100644 --- a/platform/android/sdk/AndroidManifest-New.xml +++ b/platform/android/sdk/AndroidManifest-New.xml @@ -7,6 +7,7 @@ android:required="true" /> @@ -37,6 +38,12 @@ android:name="com.ansca.corona.purchasing.StoreActivity" android:configChanges="keyboardHidden|screenSize|orientation" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" /> + - + @@ -90,5 +97,3 @@ - - diff --git a/platform/android/sdk/CMakeGenLua.cmake b/platform/android/sdk/CMakeGenLua.cmake index a1745cfc6..22eb1c3f6 100644 --- a/platform/android/sdk/CMakeGenLua.cmake +++ b/platform/android/sdk/CMakeGenLua.cmake @@ -1,5 +1,5 @@ -if( CMAKE_BUILD_TYPE STREQUAL "Release" ) +if( CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" ) set(BUILD_CONFIG RELEASE) elseif( CMAKE_BUILD_TYPE STREQUAL "Debug" ) set(BUILD_CONFIG DEBUG) @@ -70,4 +70,4 @@ elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin") else() message(FATAL_ERROR "CMakeGenLua .cmake is not ported to current OS: ${CMAKE_HOST_SYSTEM_NAME}") -endif() \ No newline at end of file +endif() diff --git a/platform/android/sdk/build.gradle.kts b/platform/android/sdk/build.gradle.kts index 2869f15e9..9ff9c8efd 100644 --- a/platform/android/sdk/build.gradle.kts +++ b/platform/android/sdk/build.gradle.kts @@ -4,15 +4,13 @@ plugins { android { ndkVersion = "18.1.5063045" - compileSdkVersion(32) + compileSdk = 33 defaultConfig { - minSdkVersion(15) - targetSdkVersion(32) - versionCode = 1 - versionName = "1.0" + minSdk = 15 + targetSdk = 33 + version = 1 } - sourceSets["main"].manifest.srcFile(file("AndroidManifest-New.xml")) sourceSets["main"].java.srcDirs(file("src"), file("../../../external/JNLua/src/main"), file("../../../plugins/network/android/src")) sourceSets["main"].java.filter.exclude("**/script/**") diff --git a/platform/android/sdk/src/com/ansca/corona/MediaManager.java b/platform/android/sdk/src/com/ansca/corona/MediaManager.java index 19b525dfe..e60c66958 100644 --- a/platform/android/sdk/src/com/ansca/corona/MediaManager.java +++ b/platform/android/sdk/src/com/ansca/corona/MediaManager.java @@ -181,9 +181,12 @@ public void playMedia( final long id, boolean loop ) } if ( mp != null ) { - mp.setLooping(loop); - - mp.start(); + try { + mp.setLooping(loop); + mp.start(); + } catch (Exception e) { + android.util.Log.e("Corona", "Error playing file", e); + } } else { Integer soundId = null; if ( myIdToSoundPoolIdMap != null) { @@ -211,7 +214,11 @@ public void stopMedia( final long id ) } if ( mp != null ) { - mp.stop(); + try { + mp.stop(); + } catch (Exception e) { + android.util.Log.e("Corona", "Error while stopping player", e); + } } else { Integer soundId = null; if ( myIdToSoundPoolIdMap != null) { @@ -234,9 +241,8 @@ public void pauseMedia( final long id ) if ( mp != null ) { try { mp.pause(); - } catch ( IllegalStateException e ) { - // #541: App crashing on exit (Android) - // happens due to exception on pause presumably due to shutdown, so ignore and continue + } catch (Exception e) { + android.util.Log.e("Corona", "Error while stopping player", e); } } else { Integer soundId = null; @@ -260,9 +266,8 @@ public void resumeMedia( final long id ) if ( mp != null ) { try { mp.start(); - } catch ( IllegalStateException e ) { - // #541: App crashing on exit (Android) - // happens due to exception on resume if the sound has completed + } catch (Exception e) { + android.util.Log.e("Corona", "Error while stopping player", e); } } else { Integer soundId = null; diff --git a/platform/android/sdk/src/com/ansca/corona/NativeToJavaBridge.java b/platform/android/sdk/src/com/ansca/corona/NativeToJavaBridge.java index d54ab7433..23184f972 100644 --- a/platform/android/sdk/src/com/ansca/corona/NativeToJavaBridge.java +++ b/platform/android/sdk/src/com/ansca/corona/NativeToJavaBridge.java @@ -2303,6 +2303,10 @@ protected static void callTextFieldSetSelection( CoronaRuntime runtime, int id, runtime.getViewManager().setTextSelection( id, startPosition, endPosition ); } + protected static int[] callTextFieldGetSelection(CoronaRuntime runtime, int id) { + return runtime.getViewManager().getTextSelection(id); + } + protected static void callTextFieldSetReturnKey( CoronaRuntime runtime, int id, String imeType ) { runtime.getViewManager().setTextReturnKey( id, imeType ); diff --git a/platform/android/sdk/src/com/ansca/corona/ViewManager.java b/platform/android/sdk/src/com/ansca/corona/ViewManager.java index 84d8dcd7e..bae043898 100644 --- a/platform/android/sdk/src/com/ansca/corona/ViewManager.java +++ b/platform/android/sdk/src/com/ansca/corona/ViewManager.java @@ -481,6 +481,43 @@ public void run() { } ); } + public int[] getTextSelection(final int id) { + final int[] result = new int[2]; + final Object lock = new Object(); + + Runnable runnable = new Runnable() { + @Override + public void run() { + CoronaEditText view = getDisplayObjectById(CoronaEditText.class, id); + if (view != null) { + result[0] = view.getSelectionStart(); + result[1] = view.getSelectionEnd(); + } else { + result[0] = -1; + result[1] = -1; + } + synchronized (lock) { + lock.notify(); + } + } + }; + + if (Thread.currentThread() == Looper.getMainLooper().getThread()) { + runnable.run(); + } else { + synchronized (lock) { + postOnUiThread(runnable); + try { + lock.wait(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + return result; + } + public void setTextViewColor( final int id, final int color ) { postOnUiThread( new Runnable() { diff --git a/platform/android/sdk/src/com/ansca/corona/map/MapView.java b/platform/android/sdk/src/com/ansca/corona/map/MapView.java index ecba22d7b..a4f5885fd 100644 --- a/platform/android/sdk/src/com/ansca/corona/map/MapView.java +++ b/platform/android/sdk/src/com/ansca/corona/map/MapView.java @@ -1,7 +1,7 @@ ////////////////////////////////////////////////////////////////////////////// // // This file is part of the Corona game engine. -// For overview and more information on licensing please refer to README.md +// For overview and more information on licensing please refer to README.md // Home page: https://github.com/coronalabs/corona // Contact: support@coronalabs.com // @@ -9,6 +9,8 @@ package com.ansca.corona.maps; +import android.webkit.WebSettings; + /** * View for displaying a map. *

@@ -75,7 +77,7 @@ public class MapView extends android.widget.FrameLayout { */ public MapView(android.content.Context context, com.ansca.corona.CoronaRuntime runtime, com.ansca.corona.Controller controller) { super(context); - + // Throw an exception if this application does not have the following permission. context.enforceCallingOrSelfPermission(android.Manifest.permission.INTERNET, null); @@ -86,7 +88,7 @@ public MapView(android.content.Context context, com.ansca.corona.CoronaRuntime r fIdCounter = new java.util.concurrent.atomic.AtomicInteger(1); fMarkerTable = new java.util.Hashtable(); - + // Initialize member variables. fOperationQueue = new java.util.LinkedList(); fIsMapLoaded = false; @@ -145,10 +147,10 @@ public void invalidate(int l, int t, int r, int b) { settings.setDomStorageEnabled(true); // Although CoronaEnviornment.getInternalWebCachesDirectory() is our class, we don't want to expose that which is why + + settings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); // we have to use reflection to access it - settings.setAppCachePath(getInternalCacheDirectory(context, "getInternalWebCachesDirectory").getAbsolutePath()); settings.setAllowFileAccess(true); - settings.setAppCacheEnabled(true); if (android.os.Build.VERSION.SDK_INT >= 11) { try { java.lang.reflect.Method setEnableSmoothTransitionMethod; @@ -158,10 +160,10 @@ public void invalidate(int l, int t, int r, int b) { } catch (Exception ex) { ex.printStackTrace(); } } - + // Set up a web view event listener. fWebView.setWebViewClient(new WebViewEventHandler()); - + // Set up a UI listener for handling current location tracking request. fWebView.setWebChromeClient(new android.webkit.WebChromeClient() { @Override @@ -583,7 +585,7 @@ public void addMarker(final MapMarker mapMarker) { public void run() { StringBuilder builder = new StringBuilder(64); builder.append("javascript:addMarker("); - + builder.append(Integer.toString(mapMarker.getMarkerId())); builder.append(","); @@ -621,7 +623,7 @@ public void run() { else { builder.append("null"); } - + builder.append(")"); fWebView.loadUrl(builder.toString()); } @@ -654,7 +656,7 @@ public void run() { } requestExecuteQueuedOperations(); MapMarker marker = fMarkerTable.get(markerId); - + if (marker != null) { marker.deleteRef(fCoronaRuntime); fMarkerTable.remove(markerId); @@ -968,7 +970,7 @@ public void onMarkerTouch(final int markerId) { if (marker != null) { fCoronaRuntime.getTaskDispatcher().send(new MapMarkerTask(marker)); } - } + } } @android.webkit.JavascriptInterface @@ -998,11 +1000,11 @@ public boolean shouldOverrideUrlLoading(android.webkit.WebView view, String url) if ((url != null) && (url.toLowerCase().contains("maps.google.com/maps?") == false)) { fController.openUrl(url); } - + // Return true to inform the MapView's web view to not load the given URL. return true; } - + /** * Called when a web page is about to be loaded. * @param view Reference to the WebView that the page is loading in. @@ -1013,7 +1015,7 @@ public boolean shouldOverrideUrlLoading(android.webkit.WebView view, String url) public void onPageStarted(android.webkit.WebView view, String url, android.graphics.Bitmap favicon) { super.onPageStarted(view, url, favicon); } - + /** * Called when the web page has finished loading. * @param view Reference to the WebView that has finished loading the page. diff --git a/platform/android/sdk/src/com/ansca/corona/notifications/NotificationServices.java b/platform/android/sdk/src/com/ansca/corona/notifications/NotificationServices.java index 26d8b3bcf..6a1fff089 100644 --- a/platform/android/sdk/src/com/ansca/corona/notifications/NotificationServices.java +++ b/platform/android/sdk/src/com/ansca/corona/notifications/NotificationServices.java @@ -43,7 +43,7 @@ public final class NotificationServices extends com.ansca.corona.ApplicationCont /** Stores all notification configurations that have been set up in Corona. */ private static NotificationSettingsCollection sNotificationCollection = - new NotificationSettingsCollection(); + new NotificationSettingsCollection(); /** * Stores a collection of reserved unique notification IDs. @@ -377,12 +377,12 @@ private void postAndUpdateCollectionWith(NotificationSettings settings) { sNotificationCollection.add(settings.clone()); } else if ((originalSettings instanceof ScheduledNotificationSettings) && - (settings instanceof ScheduledNotificationSettings)) { + (settings instanceof ScheduledNotificationSettings)) { // Notification ID exists. Copy the given settings to the existing settings. ((ScheduledNotificationSettings)originalSettings).copyFrom((ScheduledNotificationSettings)settings); } else if ((originalSettings instanceof StatusBarNotificationSettings) && - (settings instanceof StatusBarNotificationSettings)) { + (settings instanceof StatusBarNotificationSettings)) { // Notification ID exists. Copy the given settings to the existing settings. ((StatusBarNotificationSettings)originalSettings).copyFrom((StatusBarNotificationSettings)settings); } @@ -397,7 +397,7 @@ else if ((originalSettings instanceof StatusBarNotificationSettings) && // Raise an event if we're posting a status bar notification and the Corona runtime is running. if ((settings instanceof StatusBarNotificationSettings)) { StatusBarNotificationSettings statusBarSettings = (StatusBarNotificationSettings)settings; - + for (com.ansca.corona.CoronaRuntime runtime : com.ansca.corona.CoronaRuntimeProvider.getAllCoronaRuntimes()) { if (runtime.isRunning()) { runtime.getTaskDispatcher().send(new com.ansca.corona.events.NotificationReceivedTask("active", statusBarSettings)); @@ -600,7 +600,7 @@ private void loadSettingsTo(NotificationSettingsCollection // Get the path to the XML file to read notification settings from. java.io.File filePath = new java.io.File(getApplicationContext().getCacheDir(), ".system"); filePath = new java.io.File(filePath, "NotificationSettings.xml"); - + // Do not continue if the XML file does not exist. // This means that there are no active notifications for this class to manage. if (filePath.exists() == false) { @@ -712,7 +712,7 @@ else if ("data".equals(xmlReader.getName())) { } } else if ((xmlReader.getEventType() == org.xmlpull.v1.XmlPullParser.END_TAG) && - "statusBar".equals(xmlReader.getName())) { + "statusBar".equals(xmlReader.getName())) { break; } } @@ -727,7 +727,7 @@ else if ((xmlReader.getEventType() == org.xmlpull.v1.XmlPullParser.END_TAG) && return null; } } - + /** * Saves the given notification settings to be loaded later. *

@@ -872,7 +872,7 @@ private ApiLevel1() { * Returns null if given a null "context" or "settings" object. */ public static Integer getIconResourceId( - android.content.Context context, StatusBarNotificationSettings settings) + android.content.Context context, StatusBarNotificationSettings settings) { // Validate. if ((context == null) || (settings == null)) { @@ -903,7 +903,7 @@ public static Integer getIconResourceId( * Returns null if given a null "context" or "settings" object. */ public static android.app.Notification createNotificationFrom( - android.content.Context context, StatusBarNotificationSettings settings) + android.content.Context context, StatusBarNotificationSettings settings) { Integer iconResourceId = ApiLevel1.getIconResourceId(context, settings); if (iconResourceId == null) { @@ -924,10 +924,10 @@ public static android.app.Notification createNotificationFrom( // context, settings.getContentTitle(), // settings.getContentText(), // android.app.PendingIntent.getBroadcast(context, 0, intent, 0)); - java.lang.reflect.Method setLatestEventInfoMethod = notification.getClass().getMethod("setLatestEventInfo", - android.content.Context.class, CharSequence.class, CharSequence.class, android.app.PendingIntent.class); - setLatestEventInfoMethod.invoke(notification, context, settings.getContentTitle(), - settings.getContentText(), android.app.PendingIntent.getBroadcast(context, 0, intent, 0)); + java.lang.reflect.Method setLatestEventInfoMethod = notification.getClass().getMethod("setLatestEventInfo", + android.content.Context.class, CharSequence.class, CharSequence.class, android.app.PendingIntent.class); + setLatestEventInfoMethod.invoke(notification, context, settings.getContentTitle(), + settings.getContentText(), android.app.PendingIntent.getBroadcast(context, 0, intent, 0)); } catch (Exception e) { // TODO: Print some warning to the developer telling them to use the ApiLevel16 class if they get here. return null; @@ -978,7 +978,7 @@ private ApiLevel11() { * Returns null if given a null "context" or "settings" object. */ public static android.app.Notification.Builder createNotificationBuilderFrom( - android.content.Context context, StatusBarNotificationSettings settings) + android.content.Context context, StatusBarNotificationSettings settings) { Integer iconResourceId = ApiLevel1.getIconResourceId(context, settings); @@ -1006,12 +1006,12 @@ public static android.app.Notification.Builder createNotificationBuilderFrom( // Set an intent to be invoked when the notification has been tapped. android.content.Intent intent; - intent = StatusBarBroadcastReceiver.createContentIntentFrom(context, settings); - builder.setContentIntent(android.app.PendingIntent.getBroadcast(context, 0, intent, android.app.PendingIntent.FLAG_IMMUTABLE)); + intent = OnNotificationReceiverActivity.createContentIntentFrom(context, settings); + builder.setContentIntent(android.app.PendingIntent.getActivity(context, 0, intent, android.app.PendingIntent.FLAG_IMMUTABLE)); // Set an intent to be invoked when the notification has been cleared/removed. intent = StatusBarBroadcastReceiver.createDeleteIntentFrom(context, settings); - builder.setDeleteIntent(android.app.PendingIntent.getBroadcast(context, 0, intent, android.app.PendingIntent.FLAG_IMMUTABLE)); + builder.setDeleteIntent(android.app.PendingIntent.getActivity(context, 0, intent, android.app.PendingIntent.FLAG_IMMUTABLE)); // Return the notification builder object. return builder; @@ -1028,7 +1028,7 @@ public static android.app.Notification.Builder createNotificationBuilderFrom( * Returns null if given a null "context" or "settings" object. */ public static android.app.Notification createNotificationFrom( - android.content.Context context, StatusBarNotificationSettings settings) + android.content.Context context, StatusBarNotificationSettings settings) { // Set up a notification builder. android.app.Notification.Builder builder = ApiLevel11.createNotificationBuilderFrom(context, settings); @@ -1064,7 +1064,7 @@ private ApiLevel16() { * Returns null if given a null "context" or "settings" object. */ public static android.app.Notification createNotificationFrom( - android.content.Context context, StatusBarNotificationSettings settings) + android.content.Context context, StatusBarNotificationSettings settings) { // Set up a notification builder. android.app.Notification.Builder builder = ApiLevel11.createNotificationBuilderFrom(context, settings); @@ -1121,8 +1121,8 @@ private ApiLevel19() { } * @param pendingIntent The intent to be invoked when the alarm triggers. */ public static void alarmManagerSetExact( - android.app.AlarmManager alarmManager, - int type, long triggerAtMilliseconds, android.app.PendingIntent pendingIntent) + android.app.AlarmManager alarmManager, + int type, long triggerAtMilliseconds, android.app.PendingIntent pendingIntent) { if (alarmManager != null) { alarmManager.setExact(type, triggerAtMilliseconds, pendingIntent); @@ -1149,12 +1149,12 @@ private ApiLevel23() { } * @param pendingIntent The intent to be invoked when the alarm triggers. */ public static void alarmManagerSetExactAndAllowWhileIdle( - android.app.AlarmManager alarmManager, - int type, long triggerAtMilliseconds, android.app.PendingIntent pendingIntent) + android.app.AlarmManager alarmManager, + int type, long triggerAtMilliseconds, android.app.PendingIntent pendingIntent) { if (alarmManager != null) { alarmManager.setExactAndAllowWhileIdle(type, triggerAtMilliseconds, pendingIntent); } } } -} +} \ No newline at end of file diff --git a/platform/emscripten/gmake/rtt.make b/platform/emscripten/gmake/rtt.make index 1e4c46884..256002765 100644 --- a/platform/emscripten/gmake/rtt.make +++ b/platform/emscripten/gmake/rtt.make @@ -202,7 +202,6 @@ OBJECTS := \ $(OBJDIR)/Rtt_LineObject.o \ $(OBJDIR)/Rtt_LuaLibDisplay.o \ $(OBJDIR)/Rtt_LuaLibGraphics.o \ - $(OBJDIR)/Rtt_ObjectHandle.o \ $(OBJDIR)/Rtt_OpenPath.o \ $(OBJDIR)/Rtt_Paint.o \ $(OBJDIR)/Rtt_PaintAdapter.o \ @@ -998,10 +997,6 @@ $(OBJDIR)/Rtt_LuaLibGraphics.o: ../../../librtt/Display/Rtt_LuaLibGraphics.cpp @echo $(notdir $<) $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" -$(OBJDIR)/Rtt_ObjectHandle.o: ../../../librtt/Display/Rtt_ObjectHandle.cpp - @echo $(notdir $<) - $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - $(OBJDIR)/Rtt_OpenPath.o: ../../../librtt/Display/Rtt_OpenPath.cpp @echo $(notdir $<) $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" diff --git a/platform/iphone/Rtt_IPhonePlatformBase.mm b/platform/iphone/Rtt_IPhonePlatformBase.mm index c6363c7fa..285853bc3 100644 --- a/platform/iphone/Rtt_IPhonePlatformBase.mm +++ b/platform/iphone/Rtt_IPhonePlatformBase.mm @@ -17,6 +17,7 @@ #import #import +#import #import #include "Rtt_IPhonePlatformBase.h" @@ -559,6 +560,27 @@ -(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)b lua_pushboolean(L, res); pushedValues = 1; } + else if ( Rtt_StringCompare( key, "reduceMotion" ) == 0 ) + { + BOOL res = UIAccessibilityIsReduceMotionEnabled(); + lua_pushboolean(L, res); + pushedValues = 1; + } + else if ( Rtt_StringCompare( key, "reduceTransparency" ) == 0 ) + { + BOOL res = UIAccessibilityIsReduceTransparencyEnabled(); + lua_pushboolean(L, res); + pushedValues = 1; + } + else if ( Rtt_StringCompare( key, "differentiateWithoutColor" ) == 0 ) + { + BOOL res = NO; + if (@available(iOS 13.0, tvOS 13.0, *)) { + res = UIAccessibilityShouldDifferentiateWithoutColor(); + } + lua_pushboolean(L, res); + pushedValues = 1; + } else { // Attempt to fetch the requested system info from the base class. diff --git a/platform/iphone/Rtt_IPhoneTextBoxObject.h b/platform/iphone/Rtt_IPhoneTextBoxObject.h index 8e5c2d86c..834f3763c 100644 --- a/platform/iphone/Rtt_IPhoneTextBoxObject.h +++ b/platform/iphone/Rtt_IPhoneTextBoxObject.h @@ -44,6 +44,7 @@ class IPhoneTextBoxObject : public IPhoneDisplayObject static int setTextColor( lua_State *L ); static int setReturnKey( lua_State *L ); static int setSelection( lua_State *L ); + static int getSelection( lua_State *L ); public: // MLuaTableBridge diff --git a/platform/iphone/Rtt_IPhoneTextBoxObject.mm b/platform/iphone/Rtt_IPhoneTextBoxObject.mm index 65f6c2030..be85de498 100644 --- a/platform/iphone/Rtt_IPhoneTextBoxObject.mm +++ b/platform/iphone/Rtt_IPhoneTextBoxObject.mm @@ -265,6 +265,26 @@ - (void) updatePlaceholder return 0; } + +int +IPhoneTextBoxObject::getSelection(lua_State *L) +{ + PlatformDisplayObject *o = (PlatformDisplayObject*)LuaProxy::GetProxyableObject(L, 1); + if (&o->ProxyVTable() == &PlatformDisplayObject::GetTextBoxObjectProxyVTable()) + { + UIView *v = ((IPhoneTextBoxObject*)o)->GetView(); + Rtt_UITextView *t = (Rtt_UITextView*)v; + + NSRange range = t.selectedRange; + + lua_pushnumber(L, range.location); + lua_pushnumber(L, range.location + range.length); + + return 2; + } + + return 0; +} int IPhoneTextBoxObject::ValueForKey( lua_State *L, const char key[] ) const @@ -327,6 +347,10 @@ - (void) updatePlaceholder { lua_pushcfunction( L, setSelection ); } + else if ( strcmp( "getSelection", key) == 0 ) + { + lua_pushcfunction( L, getSelection ); + } else if ( strcmp( "align", key ) == 0 ) { lua_pushstring( L, AppleAlignment::StringForAlignment( t.textAlignment ) ); diff --git a/platform/iphone/Rtt_IPhoneTextFieldObject.h b/platform/iphone/Rtt_IPhoneTextFieldObject.h index 3185d2a2d..486611587 100644 --- a/platform/iphone/Rtt_IPhoneTextFieldObject.h +++ b/platform/iphone/Rtt_IPhoneTextFieldObject.h @@ -45,6 +45,7 @@ class IPhoneTextFieldObject : public IPhoneDisplayObject static int setTextColor( lua_State *L ); static int setReturnKey( lua_State *L ); static int setSelection( lua_State *L ); + static int getSelection( lua_State *L ); public: bool rejectEmoji(const char *str); diff --git a/platform/iphone/Rtt_IPhoneTextFieldObject.mm b/platform/iphone/Rtt_IPhoneTextFieldObject.mm index 866ecd171..4c5365cba 100644 --- a/platform/iphone/Rtt_IPhoneTextFieldObject.mm +++ b/platform/iphone/Rtt_IPhoneTextFieldObject.mm @@ -414,6 +414,29 @@ static bool IsIOS_7_OrHigher() return 0; } +int +IPhoneTextFieldObject::getSelection(lua_State *L) +{ + PlatformDisplayObject *o = (PlatformDisplayObject*)LuaProxy::GetProxyableObject(L, 1); + if (&o->ProxyVTable() == &PlatformDisplayObject::GetTextFieldObjectProxyVTable()) + { + UIView *v = ((IPhoneTextFieldObject*)o)->GetView(); + Rtt_UITextField *t = (Rtt_UITextField*)v; + + UITextRange *selectedRange = t.selectedTextRange; + + NSInteger startPosition = [t offsetFromPosition:t.beginningOfDocument toPosition:selectedRange.start]; + NSInteger endPosition = [t offsetFromPosition:t.beginningOfDocument toPosition:selectedRange.end]; + + lua_pushnumber(L, startPosition); + lua_pushnumber(L, endPosition); + + return 2; + } + + return 0; +} + int IPhoneTextFieldObject::ValueForKey( lua_State *L, const char key[] ) const { @@ -467,6 +490,10 @@ static bool IsIOS_7_OrHigher() { lua_pushcfunction( L, setSelection ); } + else if ( strcmp( "getSelection", key ) == 0 ) + { + lua_pushcfunction( L, getSelection ); + } else if ( strcmp( "align", key ) == 0 ) { lua_pushstring( L, AppleAlignment::StringForAlignment( t.textAlignment ) ); diff --git a/platform/iphone/libcorona.xcodeproj/project.pbxproj b/platform/iphone/libcorona.xcodeproj/project.pbxproj index ebf143343..7a0c6371c 100644 --- a/platform/iphone/libcorona.xcodeproj/project.pbxproj +++ b/platform/iphone/libcorona.xcodeproj/project.pbxproj @@ -735,8 +735,16 @@ AA2ED7D72708264E00CEE021 /* CoronaObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = AA2ED7D42708264E00CEE021 /* CoronaObjects.h */; }; AA2ED7D82708264E00CEE021 /* CoronaObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA2ED7D52708264E00CEE021 /* CoronaObjects.cpp */; }; AA2ED7D92708264E00CEE021 /* CoronaPublicTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = AA2ED7D62708264E00CEE021 /* CoronaPublicTypes.h */; }; +<<<<<<< HEAD AAD3E2052B0BEC3A000A4D45 /* Rtt_ObjectHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = AAD3E2032B0BEC3A000A4D45 /* Rtt_ObjectHandle.h */; }; AAD3E2062B0BEC3A000A4D45 /* Rtt_ObjectHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAD3E2042B0BEC3A000A4D45 /* Rtt_ObjectHandle.cpp */; }; + AA2C6AB6291C37320093B0BE /* CoronaMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = AA2C6AB4291C37320093B0BE /* CoronaMemory.h */; }; + AA2C6AB7291C37320093B0BE /* CoronaMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA2C6AB5291C37320093B0BE /* CoronaMemory.cpp */; }; + AAF349AB29EFC53300076706 /* Rtt_Profiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF349A929EFC53300076706 /* Rtt_Profiling.cpp */; }; + AAF349AC29EFC53300076706 /* Rtt_Profiling.h in Headers */ = {isa = PBXBuildFile; fileRef = AAF349AA29EFC53300076706 /* Rtt_Profiling.h */; }; +======= + AAA5812B270D393F002A51A7 /* Rtt_ObjectBoxList.h in Headers */ = {isa = PBXBuildFile; fileRef = AAA5812A270D393F002A51A7 /* Rtt_ObjectBoxList.h */; }; +>>>>>>> parent of 255c0481... Some #include fixes for Mac AAF34A9229F9DF3600076706 /* Rtt_TextureResourceCaptureAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = AAF34A8E29F9DF3600076706 /* Rtt_TextureResourceCaptureAdapter.h */; }; AAF34A9329F9DF3600076706 /* Rtt_TextureResourceCapture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF34A8F29F9DF3600076706 /* Rtt_TextureResourceCapture.cpp */; }; AAF34A9429F9DF3600076706 /* Rtt_TextureResourceCapture.h in Headers */ = {isa = PBXBuildFile; fileRef = AAF34A9029F9DF3600076706 /* Rtt_TextureResourceCapture.h */; }; @@ -1664,8 +1672,16 @@ AA2ED7D42708264E00CEE021 /* CoronaObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoronaObjects.h; path = Corona/CoronaObjects.h; sourceTree = ""; }; AA2ED7D52708264E00CEE021 /* CoronaObjects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CoronaObjects.cpp; path = Corona/CoronaObjects.cpp; sourceTree = ""; }; AA2ED7D62708264E00CEE021 /* CoronaPublicTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoronaPublicTypes.h; path = Corona/CoronaPublicTypes.h; sourceTree = ""; }; +<<<<<<< HEAD AAD3E2032B0BEC3A000A4D45 /* Rtt_ObjectHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Rtt_ObjectHandle.h; path = Display/Rtt_ObjectHandle.h; sourceTree = ""; }; AAD3E2042B0BEC3A000A4D45 /* Rtt_ObjectHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Rtt_ObjectHandle.cpp; path = Display/Rtt_ObjectHandle.cpp; sourceTree = ""; }; + AA2C6AB4291C37320093B0BE /* CoronaMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoronaMemory.h; path = Corona/CoronaMemory.h; sourceTree = ""; }; + AA2C6AB5291C37320093B0BE /* CoronaMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CoronaMemory.cpp; path = Corona/CoronaMemory.cpp; sourceTree = ""; }; + AAF349A929EFC53300076706 /* Rtt_Profiling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Rtt_Profiling.cpp; sourceTree = ""; }; + AAF349AA29EFC53300076706 /* Rtt_Profiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Rtt_Profiling.h; sourceTree = ""; }; +======= + AAA5812A270D393F002A51A7 /* Rtt_ObjectBoxList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Rtt_ObjectBoxList.h; path = Display/Rtt_ObjectBoxList.h; sourceTree = ""; }; +>>>>>>> parent of 255c0481... Some #include fixes for Mac AAF34A8E29F9DF3600076706 /* Rtt_TextureResourceCaptureAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Rtt_TextureResourceCaptureAdapter.h; path = Display/Rtt_TextureResourceCaptureAdapter.h; sourceTree = ""; }; AAF34A8F29F9DF3600076706 /* Rtt_TextureResourceCapture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Rtt_TextureResourceCapture.cpp; path = Display/Rtt_TextureResourceCapture.cpp; sourceTree = ""; }; AAF34A9029F9DF3600076706 /* Rtt_TextureResourceCapture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Rtt_TextureResourceCapture.h; path = Display/Rtt_TextureResourceCapture.h; sourceTree = ""; }; @@ -2703,8 +2719,7 @@ 0724699817DA43BA000A1641 /* Rtt_MCPUResourceObserver.h */, A474286617694EB000C63853 /* Rtt_MDisplayDelegate.h */, A474286717694EB000C63853 /* Rtt_MDrawable.h */, - AAD3E2042B0BEC3A000A4D45 /* Rtt_ObjectHandle.cpp */, - AAD3E2032B0BEC3A000A4D45 /* Rtt_ObjectHandle.h */, + AAA5812A270D393F002A51A7 /* Rtt_ObjectBoxList.h */, A474286817694EB000C63853 /* Rtt_OpenPath.cpp */, A474286917694EB000C63853 /* Rtt_OpenPath.h */, A474286A17694EB000C63853 /* Rtt_Paint.cpp */, @@ -3121,7 +3136,6 @@ 000DCB7C12B05F3E00042A5E /* Rtt_Build.h in Headers */, 000DCB7D12B05F3E00042A5E /* Rtt_Config.h in Headers */, 000DCB7E12B05F3E00042A5E /* Rtt_Data.h in Headers */, - AAD3E2052B0BEC3A000A4D45 /* Rtt_ObjectHandle.h in Headers */, 000DCB7F12B05F3E00042A5E /* Rtt_Finalizer.h in Headers */, AAF34A9429F9DF3600076706 /* Rtt_TextureResourceCapture.h in Headers */, 000DCB8112B05F3E00042A5E /* Rtt_Fixed.h in Headers */, @@ -3253,6 +3267,7 @@ A47428B217694EB000C63853 /* Rtt_DisplayV2.h in Headers */, A47428B417694EB000C63853 /* Rtt_GroupObject.h in Headers */, A47428B617694EB000C63853 /* Rtt_ImageFrame.h in Headers */, + AAA5812B270D393F002A51A7 /* Rtt_ObjectBoxList.h in Headers */, A47428B817694EB000C63853 /* Rtt_ImageSheet.h in Headers */, F5EEB6E51B74027F00D34C41 /* Rtt_TextureResourceCanvasAdapter.h in Headers */, A47428BA17694EB000C63853 /* Rtt_ImageSheetPaint.h in Headers */, @@ -3679,7 +3694,6 @@ C2C2194B1954F8DC00981B66 /* widget_theme_android_holo_light.lua in Sources */, 508D56B4195B8AA500556891 /* kernel_filter_step_gl.lua in Sources */, 508D56B5195B8AA500556891 /* kernel_filter_water_gl.lua in Sources */, - AAD3E2062B0BEC3A000A4D45 /* Rtt_ObjectHandle.cpp in Sources */, 0790F87418B6DFE800D0E6B1 /* loader_ccdata.lua in Sources */, C22711D518D1646A005AE714 /* composer_scene.lua in Sources */, C26B11D218775CC300C3F259 /* composer.lua in Sources */, diff --git a/platform/iphone/ratatouille.xcodeproj/project.pbxproj b/platform/iphone/ratatouille.xcodeproj/project.pbxproj index 963ffc5c3..3e138a6c2 100755 --- a/platform/iphone/ratatouille.xcodeproj/project.pbxproj +++ b/platform/iphone/ratatouille.xcodeproj/project.pbxproj @@ -20,6 +20,20 @@ name = CoronaCards.framework; productName = CoronaCards.framework; }; + F576ADA32A99C97600B85312 /* CoronaCards-angle.framework */ = { + isa = PBXAggregateTarget; + buildConfigurationList = F576ADA82A99C97600B85312 /* Build configuration list for PBXAggregateTarget "CoronaCards-angle.framework" */; + buildPhases = ( + F576ADA62A99C97600B85312 /* Build Universal Binary */, + F576ADA72A99C97600B85312 /* Copy to /Users/Shared/CoronaLabs/Frameworks */, + ); + dependencies = ( + F576ADAE2A99CAAF00B85312 /* PBXTargetDependency */, + F576ADAC2A99C9E000B85312 /* PBXTargetDependency */, + ); + name = "CoronaCards-angle.framework"; + productName = CoronaCards.framework; + }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ @@ -274,6 +288,88 @@ F564C3771BE430F900C241E6 /* Rtt_AppleInputDeviceManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F564C36B1BE430F900C241E6 /* Rtt_AppleInputDeviceManager.mm */; }; F564C37E1BE430F900C241E6 /* Rtt_AppleInputMFiDeviceListener.mm in Sources */ = {isa = PBXBuildFile; fileRef = F564C36F1BE430F900C241E6 /* Rtt_AppleInputMFiDeviceListener.mm */; }; F564C37F1BE430F900C241E6 /* Rtt_AppleInputMFiDeviceListener.mm in Sources */ = {isa = PBXBuildFile; fileRef = F564C36F1BE430F900C241E6 /* Rtt_AppleInputMFiDeviceListener.mm */; }; + F576ACF32A99C5A000B85312 /* Rtt_AppleKeyServices.mm in Sources */ = {isa = PBXBuildFile; fileRef = DB56B49E284BEB6400EC8B14 /* Rtt_AppleKeyServices.mm */; }; + F576ACF42A99C5A000B85312 /* CoronaLuaObjCHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5A7520D1BFA3D3400CCDB94 /* CoronaLuaObjCHelper.mm */; }; + F576ACF52A99C5A000B85312 /* CoronaLuaObjC+NSObject.m in Sources */ = {isa = PBXBuildFile; fileRef = A4728FE61AE7F77B00BC088D /* CoronaLuaObjC+NSObject.m */; }; + F576ACF62A99C5A000B85312 /* CoronaViewPrivate.mm in Sources */ = {isa = PBXBuildFile; fileRef = A46936B9169DED6500723568 /* CoronaViewPrivate.mm */; }; + F576ACF72A99C5A000B85312 /* CoronaViewRuntimeDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = A4B2D5371842DBE1001311C9 /* CoronaViewRuntimeDelegate.mm */; }; + F576ACF82A99C5A000B85312 /* Rtt_IPhonePlatformBase.mm in Sources */ = {isa = PBXBuildFile; fileRef = A482FAE9183D7F460005831B /* Rtt_IPhonePlatformBase.mm */; }; + F576ACF92A99C5A000B85312 /* Rtt_IPhoneTextFieldObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = A46936E4169DED9200723568 /* Rtt_IPhoneTextFieldObject.mm */; }; + F576ACFA2A99C5A000B85312 /* Rtt_IPhoneDisplayObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = A46936C8169DED9200723568 /* Rtt_IPhoneDisplayObject.mm */; }; + F576ACFB2A99C5A000B85312 /* Rtt_AppleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 000DCD3112B073A000042A5E /* Rtt_AppleCrypto.cpp */; }; + F576ACFC2A99C5A000B85312 /* Rtt_IPhonePlatformCore.mm in Sources */ = {isa = PBXBuildFile; fileRef = A415ECAD1BD861A1003E7114 /* Rtt_IPhonePlatformCore.mm */; }; + F576ACFD2A99C5A000B85312 /* Rtt_AppleAudioPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 000DCD2712B073A000042A5E /* Rtt_AppleAudioPlayer.cpp */; }; + F576ACFE2A99C5A000B85312 /* Rtt_AppleAudioRecorder.mm in Sources */ = {isa = PBXBuildFile; fileRef = 000DCD2912B073A000042A5E /* Rtt_AppleAudioRecorder.mm */; }; + F576ACFF2A99C5A000B85312 /* CoronaIOSLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = A48DA9781853094C009D1F93 /* CoronaIOSLoader.mm */; }; + F576AD002A99C5A000B85312 /* Rtt_IPhoneFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = A46936CC169DED9200723568 /* Rtt_IPhoneFont.mm */; }; + F576AD012A99C5A000B85312 /* Rtt_AppleInputDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = F564C3691BE430F900C241E6 /* Rtt_AppleInputDevice.mm */; }; + F576AD022A99C5A000B85312 /* Rtt_AppleReachability.mm in Sources */ = {isa = PBXBuildFile; fileRef = 00E867DB1366435F00AAFA26 /* Rtt_AppleReachability.mm */; }; + F576AD032A99C5A000B85312 /* Rtt_IPhoneTimer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0720731117CD2C93004720D2 /* Rtt_IPhoneTimer.mm */; }; + F576AD042A99C5A000B85312 /* Rtt_IPhoneGLVideoTexture.mm in Sources */ = {isa = PBXBuildFile; fileRef = A4D0AF6517D1848A000C432B /* Rtt_IPhoneGLVideoTexture.mm */; }; + F576AD052A99C5A000B85312 /* Rtt_IPhoneTemplate-CoronaCards.mm in Sources */ = {isa = PBXBuildFile; fileRef = A41AC4DA184DE09400313BF9 /* Rtt_IPhoneTemplate-CoronaCards.mm */; }; + F576AD062A99C5A000B85312 /* Rtt_TouchInhibitor.mm in Sources */ = {isa = PBXBuildFile; fileRef = A48E9BFB183EFFC500F67CB3 /* Rtt_TouchInhibitor.mm */; }; + F576AD072A99C5A000B85312 /* Rtt_AppleCallback.mm in Sources */ = {isa = PBXBuildFile; fileRef = 000DCD2E12B073A000042A5E /* Rtt_AppleCallback.mm */; }; + F576AD082A99C5A000B85312 /* Rtt_IPhoneRuntimeDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = A415ECA51BD86132003E7114 /* Rtt_IPhoneRuntimeDelegate.mm */; }; + F576AD092A99C5A000B85312 /* AppleWeakProxy.mm in Sources */ = {isa = PBXBuildFile; fileRef = A4C3189A1A6EDD4400F186DF /* AppleWeakProxy.mm */; }; + F576AD0A2A99C5A000B85312 /* Rtt_IPhoneTextBoxObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = A46936E2169DED9200723568 /* Rtt_IPhoneTextBoxObject.mm */; }; + F576AD0B2A99C5A000B85312 /* Rtt_ApplePlatform.mm in Sources */ = {isa = PBXBuildFile; fileRef = 000DCD3B12B073A000042A5E /* Rtt_ApplePlatform.mm */; }; + F576AD0C2A99C5A000B85312 /* Rtt_IPhoneVideoObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = A46936E6169DED9200723568 /* Rtt_IPhoneVideoObject.mm */; }; + F576AD0D2A99C5A000B85312 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 0748724818C1C469004FB786 /* NSData+Base64.m */; }; + F576AD0E2A99C5A000B85312 /* Rtt_AppleTextDelegateWrapperObjectHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 002078EF13B51A3C00D575C3 /* Rtt_AppleTextDelegateWrapperObjectHelper.m */; }; + F576AD0F2A99C5A000B85312 /* Rtt_AppleBitmap.mm in Sources */ = {isa = PBXBuildFile; fileRef = 000DCD2C12B073A000042A5E /* Rtt_AppleBitmap.mm */; }; + F576AD102A99C5A000B85312 /* CoronaViewControllerPrivate.mm in Sources */ = {isa = PBXBuildFile; fileRef = A48E9BF5183EF42400F67CB3 /* CoronaViewControllerPrivate.mm */; }; + F576AD112A99C5A000B85312 /* CoronaLuaObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = A4728FEF1AE8176F00BC088D /* CoronaLuaObjC.mm */; }; + F576AD122A99C5A000B85312 /* Rtt_AppleFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5A454711CA3554D0084583A /* Rtt_AppleFont.mm */; }; + F576AD132A99C5A000B85312 /* Rtt_IPhoneAudioSessionManagerImplementation.mm in Sources */ = {isa = PBXBuildFile; fileRef = A46936C1169DED9200723568 /* Rtt_IPhoneAudioSessionManagerImplementation.mm */; }; + F576AD142A99C5A000B85312 /* Rtt_AppleTimer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 000DCD3D12B073A000042A5E /* Rtt_AppleTimer.mm */; }; + F576AD152A99C5A000B85312 /* Rtt_AppleInputMFiDeviceListener.mm in Sources */ = {isa = PBXBuildFile; fileRef = F564C36F1BE430F900C241E6 /* Rtt_AppleInputMFiDeviceListener.mm */; }; + F576AD162A99C5A000B85312 /* Rtt_IPhoneAudioSessionManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = A46936BF169DED9200723568 /* Rtt_IPhoneAudioSessionManager.mm */; }; + F576AD172A99C5A000B85312 /* Rtt_IPhoneScreenSurface.mm in Sources */ = {isa = PBXBuildFile; fileRef = A46936E0169DED9200723568 /* Rtt_IPhoneScreenSurface.mm */; }; + F576AD182A99C5A000B85312 /* Rtt_AppleInputDeviceManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F564C36B1BE430F900C241E6 /* Rtt_AppleInputDeviceManager.mm */; }; + F576AD192A99C5A000B85312 /* Rtt_IPhoneOrientation.mm in Sources */ = {isa = PBXBuildFile; fileRef = A4B2D52418402BDE001311C9 /* Rtt_IPhoneOrientation.mm */; }; + F576AD1A2A99C5A000B85312 /* Rtt_AppleTextAlignment.mm in Sources */ = {isa = PBXBuildFile; fileRef = 078DA955176FD1EE00A5193E /* Rtt_AppleTextAlignment.mm */; }; + F576AD1B2A99C5A000B85312 /* Rtt_IPhoneText.mm in Sources */ = {isa = PBXBuildFile; fileRef = A47AB0EF1A72EEA2001D3FFA /* Rtt_IPhoneText.mm */; }; + F576AD1C2A99C5A000B85312 /* Rtt_AppleEventSound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 000DCD3712B073A000042A5E /* Rtt_AppleEventSound.cpp */; }; + F576AD1D2A99C5A000B85312 /* CoronaSystemResourceManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = A4C318511A67B65100F186DF /* CoronaSystemResourceManager.mm */; }; + F576AD1E2A99C5A000B85312 /* CoronaViewPluginContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = A40D2F5C1887699100B4A354 /* CoronaViewPluginContext.mm */; }; + F576AD1F2A99C5A000B85312 /* Rtt_IPhoneDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = A46936C6169DED9200723568 /* Rtt_IPhoneDevice.mm */; }; + F576AD202A99C5A000B85312 /* AutoLinkModules.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FD0AE02373933C0066F6A6 /* AutoLinkModules.m */; }; + F576AD212A99C5A000B85312 /* Rtt_DependencyUtilsApple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 070F390B18CE1FD600BC2BEE /* Rtt_DependencyUtilsApple.mm */; }; + F576AD222A99C5A000B85312 /* Rtt_DependencyLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 070F390818CE1FD600BC2BEE /* Rtt_DependencyLoader.cpp */; }; + F576AD252A99C5A000B85312 /* libalmixer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A44D435D164B1D5200CFE7B3 /* libalmixer.a */; }; + F576AD262A99C5A000B85312 /* libbox2d.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A44D435B164B1D5200CFE7B3 /* libbox2d.a */; }; + F576AD272A99C5A000B85312 /* liblua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A44D4355164B1D5200CFE7B3 /* liblua.a */; }; + F576AD282A99C5A000B85312 /* librtt.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A44D4353164B1D5200CFE7B3 /* librtt.a */; }; + F576AD292A99C5A000B85312 /* libNetworkPlugin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F5E8AB9728134BB7004295B4 /* libNetworkPlugin.a */; }; + F576AD2B2A99C5A000B85312 /* CoronaCards.h in Copy Files */ = {isa = PBXBuildFile; fileRef = A482FAA5183D74950005831B /* CoronaCards.h */; }; + F576AD2D2A99C5A000B85312 /* NSData+Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 0748724718C1C469004FB786 /* NSData+Base64.h */; }; + F576AD2E2A99C5A000B85312 /* CoronaCards.h in Headers */ = {isa = PBXBuildFile; fileRef = A482FAA5183D74950005831B /* CoronaCards.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F576AD2F2A99C5A000B85312 /* AppleWeakProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = A4C318991A6EDD4400F186DF /* AppleWeakProxy.h */; }; + F576AD302A99C5A000B85312 /* Rtt_AppleKeyServices.h in Headers */ = {isa = PBXBuildFile; fileRef = DB56B49F284BEB6400EC8B14 /* Rtt_AppleKeyServices.h */; }; + F576AD312A99C5A000B85312 /* CoronaIOSLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A48DA9771853094C009D1F93 /* CoronaIOSLoader.h */; }; + F576AD322A99C5A000B85312 /* Rtt_IPhoneOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = A4B2D52318402BDE001311C9 /* Rtt_IPhoneOrientation.h */; }; + F576AD332A99C5A000B85312 /* CoronaLuaObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = A4728FEE1AE8176F00BC088D /* CoronaLuaObjC.h */; }; + F576AD342A99C5A000B85312 /* Rtt_AppleInputDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = F564C3681BE430F900C241E6 /* Rtt_AppleInputDevice.h */; }; + F576AD352A99C5A000B85312 /* CoronaView.h in Headers */ = {isa = PBXBuildFile; fileRef = A4586812183EE425004C260A /* CoronaView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F576AD362A99C5A000B85312 /* CoronaViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = A4586813183EE425004C260A /* CoronaViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F576AD372A99C5A000B85312 /* CoronaViewRuntimeDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A4B2D5361842DBE1001311C9 /* CoronaViewRuntimeDelegate.h */; }; + F576AD382A99C5A000B85312 /* CoronaLuaObjC+NSObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A4728FE51AE7F77B00BC088D /* CoronaLuaObjC+NSObject.h */; }; + F576AD7D2A99C5D300B85312 /* libtachyon-angle.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F52611332500142B00671DFE /* libtachyon-angle.a */; }; + F576AD802A99C6DB00B85312 /* AutoLinkModules.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FD0AE02373933C0066F6A6 /* AutoLinkModules.m */; }; + F576AD812A99C6DD00B85312 /* AutoLinkModules.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FD0AE02373933C0066F6A6 /* AutoLinkModules.m */; }; + F576AD822A99C6DE00B85312 /* AutoLinkModules.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FD0AE02373933C0066F6A6 /* AutoLinkModules.m */; }; + F576AD832A99C6DE00B85312 /* AutoLinkModules.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FD0AE02373933C0066F6A6 /* AutoLinkModules.m */; }; + F576AD882A99C73500B85312 /* AutoLinkModules.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FD0AE02373933C0066F6A6 /* AutoLinkModules.m */; }; + F576AD892A99C73500B85312 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = A4F5C3A4184536D900E5ED54 /* main.mm */; }; + F576AD8A2A99C73500B85312 /* AppDelegateTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = A4F5C39C184536A000E5ED54 /* AppDelegateTest.mm */; }; + F576AD8B2A99C73500B85312 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A4F5C39E184536A000E5ED54 /* ViewController.mm */; }; + F576AD8E2A99C73500B85312 /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 000DCED912B0824800042A5E /* libobjc.dylib */; }; + F576AD902A99C73500B85312 /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A4F5C3B718456DBC00E5ED54 /* Main_iPad.storyboard */; }; + F576AD912A99C73500B85312 /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A4F5C3B918456DBC00E5ED54 /* Main_iPhone.storyboard */; }; + F576AD922A99C73500B85312 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A4F5C3A61845377200E5ED54 /* Images.xcassets */; }; + F576AD932A99C73500B85312 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A4F5C3D0184574E200E5ED54 /* InfoPlist.strings */; }; + F576AD9C2A99C75700B85312 /* libCoronaCards-angle.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F576AD3D2A99C5A000B85312 /* libCoronaCards-angle.a */; }; + F576ADB12A99CAF300B85312 /* libMetalANGLE_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C36A8024FA938200775C6E /* libMetalANGLE_static.a */; }; F5A454721CA3554D0084583A /* Rtt_AppleFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5A454711CA3554D0084583A /* Rtt_AppleFont.mm */; }; F5A454731CA3554D0084583A /* Rtt_AppleFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5A454711CA3554D0084583A /* Rtt_AppleFont.mm */; }; F5A7520E1BFA3D3400CCDB94 /* CoronaLuaObjCHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = F5A7520C1BFA3D3400CCDB94 /* CoronaLuaObjCHelper.h */; }; @@ -700,6 +796,83 @@ remoteGlobalIDString = F5261110250013F900671DFE; remoteInfo = "tachyon-angle"; }; + F576ACE92A99C5A000B85312 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A44D4348164B1D5200CFE7B3 /* libcorona.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 000DCA7E12B05CE200042A5E; + remoteInfo = librtt; + }; + F576ACEB2A99C5A000B85312 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A44D4348164B1D5200CFE7B3 /* libcorona.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 000DC8D412B04E5400042A5E; + remoteInfo = liblua; + }; + F576ACED2A99C5A000B85312 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A44D4348164B1D5200CFE7B3 /* libcorona.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 000DC9BE12B05ACC00042A5E; + remoteInfo = libbox2d; + }; + F576ACEF2A99C5A000B85312 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A44D4348164B1D5200CFE7B3 /* libcorona.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 000DCC5012B05FF200042A5E; + remoteInfo = libalmixer; + }; + F576ACF12A99C5A000B85312 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F5B0A6B42811F5B2007DE6F4 /* NetworkPlugin.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A4E253B5166D6FB300DCDC2C; + remoteInfo = NetworkPlugin; + }; + F576AD7B2A99C5BF00B85312 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A4B93F9217596F60003466CC /* libtachyon.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = F5261110250013F900671DFE; + remoteInfo = "tachyon-angle"; + }; + F576AD9D2A99C75C00B85312 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = F576ACE52A99C5A000B85312; + remoteInfo = "CoronaCards-angle"; + }; + F576ADAB2A99C9E000B85312 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = F576ACE52A99C5A000B85312; + remoteInfo = "CoronaCards-angle"; + }; + F576ADAD2A99CAAF00B85312 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F5C36A3E24FA938100775C6E /* OpenGLES.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 0A60525223464F51005CEA98; + remoteInfo = MetalANGLE; + }; + F576ADAF2A99CAE700B85312 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F5C36A3E24FA938100775C6E /* OpenGLES.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 0A936736244CCFDE00B3497E; + remoteInfo = MetalANGLE_static; + }; + F576ADB72A99CD8F00B85312 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = F5C36A3E24FA938100775C6E /* OpenGLES.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 0A60525223464F51005CEA98; + remoteInfo = MetalANGLE; + }; F5C36A7D24FA938200775C6E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = F5C36A3E24FA938100775C6E /* OpenGLES.xcodeproj */; @@ -1246,6 +1419,17 @@ name = "Copy Files"; runOnlyForDeploymentPostprocessing = 0; }; + F576AD2A2A99C5A000B85312 /* Copy Files */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + F576AD2B2A99C5A000B85312 /* CoronaCards.h in Copy Files */, + ); + name = "Copy Files"; + runOnlyForDeploymentPostprocessing = 0; + }; F5C36AF524FA93A700775C6E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -1509,6 +1693,9 @@ F564C36B1BE430F900C241E6 /* Rtt_AppleInputDeviceManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Rtt_AppleInputDeviceManager.mm; sourceTree = ""; }; F564C36E1BE430F900C241E6 /* Rtt_AppleInputMFiDeviceListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Rtt_AppleInputMFiDeviceListener.h; sourceTree = ""; }; F564C36F1BE430F900C241E6 /* Rtt_AppleInputMFiDeviceListener.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Rtt_AppleInputMFiDeviceListener.mm; sourceTree = ""; }; + F576AD3D2A99C5A000B85312 /* libCoronaCards-angle.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libCoronaCards-angle.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + F576AD9A2A99C73500B85312 /* CoronaCardsTest-angle.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CoronaCardsTest-angle.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + F576AD9B2A99C73600B85312 /* CoronaCardsTest copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "CoronaCardsTest copy-Info.plist"; path = "/Users/vlad/Projects/corona/platform/iphone/CoronaCardsTest copy-Info.plist"; sourceTree = ""; }; F5A454711CA3554D0084583A /* Rtt_AppleFont.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Rtt_AppleFont.mm; sourceTree = ""; }; F5A7520C1BFA3D3400CCDB94 /* CoronaLuaObjCHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoronaLuaObjCHelper.h; path = Corona/CoronaLuaObjCHelper.h; sourceTree = SOURCE_ROOT; }; F5A7520D1BFA3D3400CCDB94 /* CoronaLuaObjCHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CoronaLuaObjCHelper.mm; path = Corona/CoronaLuaObjCHelper.mm; sourceTree = SOURCE_ROOT; }; @@ -1642,6 +1829,29 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + F576AD232A99C5A000B85312 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F576ADB12A99CAF300B85312 /* libMetalANGLE_static.a in Frameworks */, + F576AD7D2A99C5D300B85312 /* libtachyon-angle.a in Frameworks */, + F576AD252A99C5A000B85312 /* libalmixer.a in Frameworks */, + F576AD262A99C5A000B85312 /* libbox2d.a in Frameworks */, + F576AD272A99C5A000B85312 /* liblua.a in Frameworks */, + F576AD282A99C5A000B85312 /* librtt.a in Frameworks */, + F576AD292A99C5A000B85312 /* libNetworkPlugin.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F576AD8C2A99C73500B85312 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F576AD9C2A99C75700B85312 /* libCoronaCards-angle.a in Frameworks */, + F576AD8E2A99C73500B85312 /* libobjc.dylib in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; F5C36C3B24FAB49F00775C6E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -1852,6 +2062,8 @@ F5C36C6824FAB49F00775C6E /* libplayer-core-angle.a */, F5C36CBB24FAB4E900775C6E /* libplayer-angle.a */, F5C36CD024FAB50800775C6E /* libtemplate-angle.a */, + F576AD3D2A99C5A000B85312 /* libCoronaCards-angle.a */, + F576AD9A2A99C73500B85312 /* CoronaCardsTest-angle.app */, ); name = Products; sourceTree = ""; @@ -1874,6 +2086,7 @@ A482FAA2183D74950005831B /* CoronaCards */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, + F576AD9B2A99C73600B85312 /* CoronaCardsTest copy-Info.plist */, ); name = CustomTemplate; sourceTree = ""; @@ -2440,6 +2653,25 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + F576AD2C2A99C5A000B85312 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + F576AD2D2A99C5A000B85312 /* NSData+Base64.h in Headers */, + F576AD2E2A99C5A000B85312 /* CoronaCards.h in Headers */, + F576AD2F2A99C5A000B85312 /* AppleWeakProxy.h in Headers */, + F576AD302A99C5A000B85312 /* Rtt_AppleKeyServices.h in Headers */, + F576AD312A99C5A000B85312 /* CoronaIOSLoader.h in Headers */, + F576AD322A99C5A000B85312 /* Rtt_IPhoneOrientation.h in Headers */, + F576AD332A99C5A000B85312 /* CoronaLuaObjC.h in Headers */, + F576AD342A99C5A000B85312 /* Rtt_AppleInputDevice.h in Headers */, + F576AD352A99C5A000B85312 /* CoronaView.h in Headers */, + F576AD362A99C5A000B85312 /* CoronaViewController.h in Headers */, + F576AD372A99C5A000B85312 /* CoronaViewRuntimeDelegate.h in Headers */, + F576AD382A99C5A000B85312 /* CoronaLuaObjC+NSObject.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; F5C36C4724FAB49F00775C6E /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -2752,6 +2984,54 @@ productReference = F50E7EC424FA923B009F165B /* template-angle.app */; productType = "com.apple.product-type.application"; }; + F576ACE52A99C5A000B85312 /* CoronaCards-angle */ = { + isa = PBXNativeTarget; + buildConfigurationList = F576AD3A2A99C5A000B85312 /* Build configuration list for PBXNativeTarget "CoronaCards-angle" */; + buildPhases = ( + F576ACF22A99C5A000B85312 /* Sources */, + F576AD232A99C5A000B85312 /* Frameworks */, + F576AD2A2A99C5A000B85312 /* Copy Files */, + F576AD2C2A99C5A000B85312 /* Headers */, + F576AD392A99C5A000B85312 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + F576ADB82A99CD8F00B85312 /* PBXTargetDependency */, + F576ADB02A99CAE700B85312 /* PBXTargetDependency */, + F576AD7C2A99C5BF00B85312 /* PBXTargetDependency */, + F576ACE82A99C5A000B85312 /* PBXTargetDependency */, + F576ACEA2A99C5A000B85312 /* PBXTargetDependency */, + F576ACEC2A99C5A000B85312 /* PBXTargetDependency */, + F576ACEE2A99C5A000B85312 /* PBXTargetDependency */, + F576ACF02A99C5A000B85312 /* PBXTargetDependency */, + ); + name = "CoronaCards-angle"; + productName = CoronaCards; + productReference = F576AD3D2A99C5A000B85312 /* libCoronaCards-angle.a */; + productType = "com.apple.product-type.library.static"; + }; + F576AD842A99C73500B85312 /* CoronaCardsTest-angle */ = { + isa = PBXNativeTarget; + buildConfigurationList = F576AD972A99C73500B85312 /* Build configuration list for PBXNativeTarget "CoronaCardsTest-angle" */; + buildPhases = ( + F576AD872A99C73500B85312 /* Sources */, + F576AD8C2A99C73500B85312 /* Frameworks */, + F576AD8F2A99C73500B85312 /* Resources */, + F576AD942A99C73500B85312 /* Script: Compile */, + F576AD952A99C73500B85312 /* Script: build.settings to Info.plist */, + F576AD962A99C73500B85312 /* Copy Corona Project Files */, + ); + buildRules = ( + ); + dependencies = ( + F576AD9E2A99C75C00B85312 /* PBXTargetDependency */, + ); + name = "CoronaCardsTest-angle"; + productName = CoronaCardsTest; + productReference = F576AD9A2A99C73500B85312 /* CoronaCardsTest-angle.app */; + productType = "com.apple.product-type.application"; + }; F5C36BE724FAB49F00775C6E /* libplayer-core-angle */ = { isa = PBXNativeTarget; buildConfigurationList = F5C36C6324FAB49F00775C6E /* Build configuration list for PBXNativeTarget "libplayer-core-angle" */; @@ -2900,11 +3180,14 @@ A4693558169D62DA00723568 /* template */, F50E7EAC24FA923B009F165B /* template-angle */, A482FA9F183D74950005831B /* CoronaCards */, + F576ACE52A99C5A000B85312 /* CoronaCards-angle */, A482FADF183D7B860005831B /* CoronaCards.framework */, + F576ADA32A99C97600B85312 /* CoronaCards-angle.framework */, A48E9B9A183EEC8600F67CB3 /* CoronaCardsTest */, A48DA9C918580415009D1F93 /* CoronaCardsTest-Tabs */, A40D2F711889151E00B4A354 /* CoronaCardsTest-Ad */, A4EF76F41A352B43002D3BEF /* CoronaCardsTest-Swift */, + F576AD842A99C73500B85312 /* CoronaCardsTest-angle */, ); }; /* End PBXProject section */ @@ -3512,6 +3795,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + F576AD8F2A99C73500B85312 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F576AD902A99C73500B85312 /* Main_iPad.storyboard in Resources */, + F576AD912A99C73500B85312 /* Main_iPhone.storyboard in Resources */, + F576AD922A99C73500B85312 /* Images.xcassets in Resources */, + F576AD932A99C73500B85312 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -3631,7 +3925,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "DST_DIR=/Users/Shared/CoronaLabs/ios\nmkdir -p $DST_DIR\n\nditto -V \"$TARGET_BUILD_DIR\"/\"$TARGETNAME\" \"$DST_DIR\"/\"$TARGETNAME\""; + shellScript = "DST_DIR=/Users/Shared/CoronaLabs/ios\nmkdir -p $DST_DIR\n\nditto -V \"$TARGET_BUILD_DIR\"/\"$TARGETNAME\" \"$DST_DIR\"/\"$TARGETNAME\"\n"; showEnvVarsInLog = 0; }; A46935BD169D62DA00723568 /* Script: CopyResources and resource.corona-archive */ = { @@ -3736,6 +4030,94 @@ shellScript = "TOOLCHAIN_DIR=\"$PROJECT_DIR/../../bin/mac\"\nLUA=\"$TOOLCHAIN_DIR/lua\"\n\nASSETS_DIR=\"$PROJECT_DIR\"/../test/assets\nif [ -d \"$PROJECT_DIR\"/../test/assets2 ]\nthen\n ASSETS_DIR=\"$PROJECT_DIR\"/../test/assets2\nfi\n\necho Running \"$LUA\" \"$PROJECT_DIR\"/../../bin/mac/buildSettingsToPlist.lua $ASSETS_DIR \"$BUILT_PRODUCTS_DIR/$EXECUTABLE_FOLDER_PATH/\"\nLUA_PATH=\"$PROJECT_DIR/../../platform/resources/?.lua\" export LUA_PATH\n\"$LUA\" \"$PROJECT_DIR\"/../../bin/mac/buildSettingsToPlist.lua $ASSETS_DIR \"$BUILT_PRODUCTS_DIR/$EXECUTABLE_FOLDER_PATH/\"\n"; showEnvVarsInLog = 0; }; + F576AD392A99C5A000B85312 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$PROJECT_DIR\"/bin-xcode/prepare_framework.sh"; + showEnvVarsInLog = 0; + }; + F576AD942A99C73500B85312 /* Script: Compile */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Script: Compile"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "## \"$PROJECT_DIR\"/bin-xcode/compile_car.sh"; + showEnvVarsInLog = 0; + }; + F576AD952A99C73500B85312 /* Script: build.settings to Info.plist */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Script: build.settings to Info.plist"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "## \"$PROJECT_DIR\"/bin-xcode/convert_metadata.sh"; + showEnvVarsInLog = 0; + }; + F576AD962A99C73500B85312 /* Copy Corona Project Files */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Corona Project Files"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "ditto -V \"$PROJECT_DIR\"/../test/assets2 \"$TARGET_BUILD_DIR\"/\"$UNLOCALIZED_RESOURCES_FOLDER_PATH\""; + showEnvVarsInLog = 0; + }; + F576ADA62A99C97600B85312 /* Build Universal Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Build Universal Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "export SF_TARGET_NAME=CoronaCards-angle\n\n\"$PROJECT_DIR\"/bin-xcode/build_framework.sh\n"; + }; + F576ADA72A99C97600B85312 /* Copy to /Users/Shared/CoronaLabs/Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy to /Users/Shared/CoronaLabs/Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "DST_DIR=/Users/Shared/CoronaLabs/ios\nmkdir -p $DST_DIR\n\nditto -V \"$TARGET_BUILD_DIR\"/\"$TARGETNAME\" \"$DST_DIR\"/\"$TARGETNAME\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -3743,6 +4125,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + F576AD822A99C6DE00B85312 /* AutoLinkModules.m in Sources */, A40D2F8A1889151F00B4A354 /* ViewControllerTest-Ad.mm in Sources */, A40D2F811889151F00B4A354 /* AppDelegateTest-Ad.mm in Sources */, A40D2F7D1889151F00B4A354 /* main.mm in Sources */, @@ -3910,6 +4293,7 @@ A48DA9D918580416009D1F93 /* AppDelegateTest-Tabs.mm in Sources */, A48DA9E218580416009D1F93 /* FirstViewController.m in Sources */, A48DA9D518580416009D1F93 /* main.mm in Sources */, + F576AD812A99C6DD00B85312 /* AutoLinkModules.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3917,6 +4301,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + F576AD802A99C6DB00B85312 /* AutoLinkModules.m in Sources */, A4F5C3A5184536D900E5ED54 /* main.mm in Sources */, A4F5C39F184536A000E5ED54 /* AppDelegateTest.mm in Sources */, A4F5C3A0184536A000E5ED54 /* ViewController.mm in Sources */, @@ -3927,6 +4312,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + F576AD832A99C6DE00B85312 /* AutoLinkModules.m in Sources */, A4EF771E1A352B44002D3BEF /* ViewController.swift in Sources */, A4EF77211A352B44002D3BEF /* CPlusPlusLinkage.cpp in Sources */, A4EF77111A352B44002D3BEF /* AppDelegate.swift in Sources */, @@ -3949,6 +4335,72 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + F576ACF22A99C5A000B85312 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F576ACF32A99C5A000B85312 /* Rtt_AppleKeyServices.mm in Sources */, + F576ACF42A99C5A000B85312 /* CoronaLuaObjCHelper.mm in Sources */, + F576ACF52A99C5A000B85312 /* CoronaLuaObjC+NSObject.m in Sources */, + F576ACF62A99C5A000B85312 /* CoronaViewPrivate.mm in Sources */, + F576ACF72A99C5A000B85312 /* CoronaViewRuntimeDelegate.mm in Sources */, + F576ACF82A99C5A000B85312 /* Rtt_IPhonePlatformBase.mm in Sources */, + F576ACF92A99C5A000B85312 /* Rtt_IPhoneTextFieldObject.mm in Sources */, + F576ACFA2A99C5A000B85312 /* Rtt_IPhoneDisplayObject.mm in Sources */, + F576ACFB2A99C5A000B85312 /* Rtt_AppleCrypto.cpp in Sources */, + F576ACFC2A99C5A000B85312 /* Rtt_IPhonePlatformCore.mm in Sources */, + F576ACFD2A99C5A000B85312 /* Rtt_AppleAudioPlayer.cpp in Sources */, + F576ACFE2A99C5A000B85312 /* Rtt_AppleAudioRecorder.mm in Sources */, + F576ACFF2A99C5A000B85312 /* CoronaIOSLoader.mm in Sources */, + F576AD002A99C5A000B85312 /* Rtt_IPhoneFont.mm in Sources */, + F576AD012A99C5A000B85312 /* Rtt_AppleInputDevice.mm in Sources */, + F576AD022A99C5A000B85312 /* Rtt_AppleReachability.mm in Sources */, + F576AD032A99C5A000B85312 /* Rtt_IPhoneTimer.mm in Sources */, + F576AD042A99C5A000B85312 /* Rtt_IPhoneGLVideoTexture.mm in Sources */, + F576AD052A99C5A000B85312 /* Rtt_IPhoneTemplate-CoronaCards.mm in Sources */, + F576AD062A99C5A000B85312 /* Rtt_TouchInhibitor.mm in Sources */, + F576AD072A99C5A000B85312 /* Rtt_AppleCallback.mm in Sources */, + F576AD082A99C5A000B85312 /* Rtt_IPhoneRuntimeDelegate.mm in Sources */, + F576AD092A99C5A000B85312 /* AppleWeakProxy.mm in Sources */, + F576AD0A2A99C5A000B85312 /* Rtt_IPhoneTextBoxObject.mm in Sources */, + F576AD0B2A99C5A000B85312 /* Rtt_ApplePlatform.mm in Sources */, + F576AD0C2A99C5A000B85312 /* Rtt_IPhoneVideoObject.mm in Sources */, + F576AD0D2A99C5A000B85312 /* NSData+Base64.m in Sources */, + F576AD0E2A99C5A000B85312 /* Rtt_AppleTextDelegateWrapperObjectHelper.m in Sources */, + F576AD0F2A99C5A000B85312 /* Rtt_AppleBitmap.mm in Sources */, + F576AD102A99C5A000B85312 /* CoronaViewControllerPrivate.mm in Sources */, + F576AD112A99C5A000B85312 /* CoronaLuaObjC.mm in Sources */, + F576AD122A99C5A000B85312 /* Rtt_AppleFont.mm in Sources */, + F576AD132A99C5A000B85312 /* Rtt_IPhoneAudioSessionManagerImplementation.mm in Sources */, + F576AD142A99C5A000B85312 /* Rtt_AppleTimer.mm in Sources */, + F576AD152A99C5A000B85312 /* Rtt_AppleInputMFiDeviceListener.mm in Sources */, + F576AD162A99C5A000B85312 /* Rtt_IPhoneAudioSessionManager.mm in Sources */, + F576AD172A99C5A000B85312 /* Rtt_IPhoneScreenSurface.mm in Sources */, + F576AD182A99C5A000B85312 /* Rtt_AppleInputDeviceManager.mm in Sources */, + F576AD192A99C5A000B85312 /* Rtt_IPhoneOrientation.mm in Sources */, + F576AD1A2A99C5A000B85312 /* Rtt_AppleTextAlignment.mm in Sources */, + F576AD1B2A99C5A000B85312 /* Rtt_IPhoneText.mm in Sources */, + F576AD1C2A99C5A000B85312 /* Rtt_AppleEventSound.cpp in Sources */, + F576AD1D2A99C5A000B85312 /* CoronaSystemResourceManager.mm in Sources */, + F576AD1E2A99C5A000B85312 /* CoronaViewPluginContext.mm in Sources */, + F576AD1F2A99C5A000B85312 /* Rtt_IPhoneDevice.mm in Sources */, + F576AD202A99C5A000B85312 /* AutoLinkModules.m in Sources */, + F576AD212A99C5A000B85312 /* Rtt_DependencyUtilsApple.mm in Sources */, + F576AD222A99C5A000B85312 /* Rtt_DependencyLoader.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F576AD872A99C73500B85312 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F576AD882A99C73500B85312 /* AutoLinkModules.m in Sources */, + F576AD892A99C73500B85312 /* main.mm in Sources */, + F576AD8A2A99C73500B85312 /* AppDelegateTest.mm in Sources */, + F576AD8B2A99C73500B85312 /* ViewController.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; F5C36BFA24FAB49F00775C6E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -4165,6 +4617,61 @@ name = "tachyon-angle"; targetProxy = F52611712500143100671DFE /* PBXContainerItemProxy */; }; + F576ACE82A99C5A000B85312 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = librtt; + targetProxy = F576ACE92A99C5A000B85312 /* PBXContainerItemProxy */; + }; + F576ACEA2A99C5A000B85312 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = liblua; + targetProxy = F576ACEB2A99C5A000B85312 /* PBXContainerItemProxy */; + }; + F576ACEC2A99C5A000B85312 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libbox2d; + targetProxy = F576ACED2A99C5A000B85312 /* PBXContainerItemProxy */; + }; + F576ACEE2A99C5A000B85312 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libalmixer; + targetProxy = F576ACEF2A99C5A000B85312 /* PBXContainerItemProxy */; + }; + F576ACF02A99C5A000B85312 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = NetworkPlugin; + targetProxy = F576ACF12A99C5A000B85312 /* PBXContainerItemProxy */; + }; + F576AD7C2A99C5BF00B85312 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "tachyon-angle"; + targetProxy = F576AD7B2A99C5BF00B85312 /* PBXContainerItemProxy */; + }; + F576AD9E2A99C75C00B85312 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F576ACE52A99C5A000B85312 /* CoronaCards-angle */; + targetProxy = F576AD9D2A99C75C00B85312 /* PBXContainerItemProxy */; + }; + F576ADAC2A99C9E000B85312 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F576ACE52A99C5A000B85312 /* CoronaCards-angle */; + targetProxy = F576ADAB2A99C9E000B85312 /* PBXContainerItemProxy */; + }; + F576ADAE2A99CAAF00B85312 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = MetalANGLE; + targetProxy = F576ADAD2A99CAAF00B85312 /* PBXContainerItemProxy */; + }; + F576ADB02A99CAE700B85312 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = MetalANGLE_static; + targetProxy = F576ADAF2A99CAE700B85312 /* PBXContainerItemProxy */; + }; + F576ADB82A99CD8F00B85312 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = MetalANGLE; + targetProxy = F576ADB72A99CD8F00B85312 /* PBXContainerItemProxy */; + }; F5C36BEA24FAB49F00775C6E /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = A48B825B16D594AA00CA01A1 /* CoronaResources */; @@ -4846,6 +5353,7 @@ ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_MODULES = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; @@ -4855,6 +5363,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEAD_CODE_STRIPPING = NO; + DEVELOPMENT_TEAM = BG2J43EA88; GCC_DYNAMIC_NO_PIC = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "CoronaCards/Test/CoronaCardsTest-Prefix.pch"; @@ -4883,6 +5392,7 @@ ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_MODULES = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; @@ -4893,6 +5403,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; DEAD_CODE_STRIPPING = NO; + DEVELOPMENT_TEAM = BG2J43EA88; ENABLE_NS_ASSERTIONS = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "CoronaCards/Test/CoronaCardsTest-Prefix.pch"; @@ -5271,6 +5782,172 @@ }; name = Release; }; + F576AD3B2A99C5A000B85312 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + DSTROOT = /tmp/CoronaCards.dst; + GCC_DYNAMIC_NO_PIC = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CoronaCards/CoronaCards-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + Rtt_MetalANGLE, + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + STRIP_STYLE = debugging; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + F576AD3C2A99C5A000B85312 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DSTROOT = /tmp/CoronaCards.dst; + ENABLE_NS_ASSERTIONS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CoronaCards/CoronaCards-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + Rtt_MetalANGLE, + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + STRIP_STYLE = debugging; + SWIFT_VERSION = 3.0; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + F576AD982A99C73500B85312 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + DEAD_CODE_STRIPPING = NO; + DEVELOPMENT_TEAM = BG2J43EA88; + GCC_DYNAMIC_NO_PIC = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CoronaCards/Test/CoronaCardsTest-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + INFOPLIST_FILE = "$(SRCROOT)/CoronaCards/Test/CoronaCardsTest-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(LD_RUNPATH_SEARCH_PATHS_$(IS_MACCATALYST))", + "@executable_path/Frameworks", + ); + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = NO; + STRIP_STYLE = "non-global"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + F576AD992A99C73500B85312 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = NO; + DEVELOPMENT_TEAM = BG2J43EA88; + ENABLE_NS_ASSERTIONS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CoronaCards/Test/CoronaCardsTest-Prefix.pch"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + INFOPLIST_FILE = "$(SRCROOT)/CoronaCards/Test/CoronaCardsTest-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(LD_RUNPATH_SEARCH_PATHS_$(IS_MACCATALYST))", + "@executable_path/Frameworks", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = NO; + STRIP_STYLE = "non-global"; + VALIDATE_PRODUCT = YES; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + F576ADA92A99C97600B85312 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + F576ADAA2A99C97600B85312 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; F5C36C6424FAB49F00775C6E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -5559,6 +6236,33 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + F576AD3A2A99C5A000B85312 /* Build configuration list for PBXNativeTarget "CoronaCards-angle" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F576AD3B2A99C5A000B85312 /* Debug */, + F576AD3C2A99C5A000B85312 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F576AD972A99C73500B85312 /* Build configuration list for PBXNativeTarget "CoronaCardsTest-angle" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F576AD982A99C73500B85312 /* Debug */, + F576AD992A99C73500B85312 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F576ADA82A99C97600B85312 /* Build configuration list for PBXAggregateTarget "CoronaCards-angle.framework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F576ADA92A99C97600B85312 /* Debug */, + F576ADAA2A99C97600B85312 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; F5C36C6324FAB49F00775C6E /* Build configuration list for PBXNativeTarget "libplayer-core-angle" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/platform/linux/CMakeList.txt b/platform/linux/CMakeList.txt index 6abf22292..fc0b473ee 100644 --- a/platform/linux/CMakeList.txt +++ b/platform/linux/CMakeList.txt @@ -457,7 +457,6 @@ SET( SOLAR2D_SOURCES ${CORONA_ROOT}/librtt/Display/Rtt_LineObject.cpp ${CORONA_ROOT}/librtt/Display/Rtt_LuaLibDisplay.cpp ${CORONA_ROOT}/librtt/Display/Rtt_LuaLibGraphics.cpp - ${CORONA_ROOT}/librtt/Display/Rtt_ObjectHandle.cpp ${CORONA_ROOT}/librtt/Display/Rtt_OpenPath.cpp ${CORONA_ROOT}/librtt/Display/Rtt_Paint.cpp ${CORONA_ROOT}/librtt/Display/Rtt_PaintAdapter.cpp diff --git a/platform/linux/Solar2D.project b/platform/linux/Solar2D.project index a9f33e74d..93be66357 100644 --- a/platform/linux/Solar2D.project +++ b/platform/linux/Solar2D.project @@ -385,7 +385,6 @@ - @@ -652,8 +651,6 @@ - - @@ -701,7 +698,6 @@ - @@ -915,7 +911,6 @@ - diff --git a/platform/linux/Solar2DBuilder.project b/platform/linux/Solar2DBuilder.project index 5298aa7e1..dcc820ac2 100644 --- a/platform/linux/Solar2DBuilder.project +++ b/platform/linux/Solar2DBuilder.project @@ -523,7 +523,6 @@ - @@ -793,8 +792,6 @@ - - @@ -842,7 +839,6 @@ - @@ -1063,7 +1059,6 @@ - diff --git a/platform/linux/Solar2DSimulator.project b/platform/linux/Solar2DSimulator.project index 2b19cd8ba..ca78b1eab 100644 --- a/platform/linux/Solar2DSimulator.project +++ b/platform/linux/Solar2DSimulator.project @@ -385,7 +385,6 @@ - @@ -655,8 +654,6 @@ - - @@ -704,7 +701,6 @@ - @@ -919,7 +915,6 @@ - diff --git a/platform/linux/src/Rtt_LinuxTextBoxObject.cpp b/platform/linux/src/Rtt_LinuxTextBoxObject.cpp index 51761aec6..946ee7fd2 100644 --- a/platform/linux/src/Rtt_LinuxTextBoxObject.cpp +++ b/platform/linux/src/Rtt_LinuxTextBoxObject.cpp @@ -102,6 +102,10 @@ namespace Rtt { lua_pushcfunction(L, SetSelection); } + else if (strcmp("getSelection", key) == 0) + { + lua_pushcfunction(L, GetSelection); + } else if (strcmp("align", key) == 0) { char buf[16] = { 0 }; @@ -276,6 +280,12 @@ namespace Rtt return 0; } + int LinuxTextBoxObject::GetSelection(lua_State* L) + { + Rtt_LogException("LinuxTextBoxObject:GetSelection() is not implemented\n"); + return 0; + } + void LinuxTextBoxObject::dispatch(const char* phase, int pos, ImWchar ch) { if (fHandle && fHandle->IsValid()) diff --git a/platform/linux/src/Rtt_LinuxTextBoxObject.h b/platform/linux/src/Rtt_LinuxTextBoxObject.h index 8e307937e..65582e3d7 100644 --- a/platform/linux/src/Rtt_LinuxTextBoxObject.h +++ b/platform/linux/src/Rtt_LinuxTextBoxObject.h @@ -37,6 +37,7 @@ namespace Rtt static int SetTextColor(lua_State *L); static int SetReturnKey(lua_State *L); static int SetSelection(lua_State *L); + static int GetSelection(lua_State *L); private: diff --git a/platform/mac/Rtt_MacPlatform.mm b/platform/mac/Rtt_MacPlatform.mm index bcecb1e4f..cfc099a01 100644 --- a/platform/mac/Rtt_MacPlatform.mm +++ b/platform/mac/Rtt_MacPlatform.mm @@ -49,6 +49,7 @@ #import #import #import +#import #import #import #import @@ -1240,6 +1241,24 @@ -(void)alertDidEnd:(NSAlert *)alertView returnCode:(NSInteger)returnCode context lua_pushboolean(L, res); pushedValues = 1; } + else if ( Rtt_StringCompare( key, "reduceMotion" ) == 0 ) + { + BOOL res = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceMotion]; + lua_pushboolean(L, res); + pushedValues = 1; + } + else if ( Rtt_StringCompare( key, "reduceTransparency" ) == 0 ) + { + BOOL res = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceTransparency]; + lua_pushboolean(L, res); + pushedValues = 1; + } + else if ( Rtt_StringCompare( key, "differentiateWithoutColor" ) == 0 ) + { + BOOL res = [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldDifferentiateWithoutColor]; + lua_pushboolean(L, res); + pushedValues = 1; + } else { // Attempt to fetch the requested system info from the base class. diff --git a/platform/mac/Rtt_MacTextBoxObject.h b/platform/mac/Rtt_MacTextBoxObject.h index fd5c0db84..c006dbe9d 100644 --- a/platform/mac/Rtt_MacTextBoxObject.h +++ b/platform/mac/Rtt_MacTextBoxObject.h @@ -49,6 +49,7 @@ class MacTextBoxObject : public MacDisplayObject virtual void DidRescaleSimulator( float previousScale, float currentScale ); static int setTextColor( lua_State *L ); static int setSelection( lua_State *L ); + static int getSelection( lua_State *L ); private: // Rect fSelfBounds; diff --git a/platform/mac/Rtt_MacTextBoxObject.mm b/platform/mac/Rtt_MacTextBoxObject.mm index 24f318827..fa96c7d38 100644 --- a/platform/mac/Rtt_MacTextBoxObject.mm +++ b/platform/mac/Rtt_MacTextBoxObject.mm @@ -380,6 +380,27 @@ - (void) updatePlaceholder return 0; } +int +MacTextBoxObject::getSelection(lua_State* L) +{ + PlatformDisplayObject *o = (PlatformDisplayObject*)LuaProxy::GetProxyableObject(L, 1); + if (&o->ProxyVTable() == &PlatformDisplayObject::GetTextBoxObjectProxyVTable()) + { + NSView *v = ((MacTextBoxObject*)o)->GetView(); + NSScrollView *scrollview = (NSScrollView*)v; + Rtt_NSTextView *t = (Rtt_NSTextView*)[scrollview documentView]; + NSRange range = t.selectedRange; + + lua_pushnumber(L, range.location); + lua_pushnumber(L, range.location + range.length); + + return 2; + } + + return 0; +} + + int MacTextBoxObject::ValueForKey( lua_State *L, const char key[] ) const { @@ -444,6 +465,10 @@ - (void) updatePlaceholder { lua_pushcfunction( L, setSelection); } + else if ( strcmp( "getSelection", key ) == 0 ) + { + lua_pushcfunction( L, getSelection); + } else if ( strcmp( "placeholder", key ) == 0 ) { NSString *text = textbox.placeholder; diff --git a/platform/mac/Rtt_MacTextFieldObject.h b/platform/mac/Rtt_MacTextFieldObject.h index d13dbe355..6139af395 100644 --- a/platform/mac/Rtt_MacTextFieldObject.h +++ b/platform/mac/Rtt_MacTextFieldObject.h @@ -54,6 +54,7 @@ class MacTextFieldObject : public MacDisplayObject virtual void DidRescaleSimulator( float previousScale, float currentScale ); static int setTextColor( lua_State *L ); static int setSelection( lua_State *L ); + static int getSelection( lua_State *L ); private: diff --git a/platform/mac/Rtt_MacTextFieldObject.mm b/platform/mac/Rtt_MacTextFieldObject.mm index 9fcb27963..c242a4ea8 100644 --- a/platform/mac/Rtt_MacTextFieldObject.mm +++ b/platform/mac/Rtt_MacTextFieldObject.mm @@ -371,11 +371,69 @@ - (void) dispatchEditingEventForTextField:(Rtt_AppleTextDelegateWrapperObjectHel return 0; } +// int +// MacTextFieldObject::setSelection( lua_State *L ) +// { +// Rtt_TRACE_SIM( ( "WARNING: setSelection is not supported by the simulator on TextField objects.\n" ) ); +// return 0; +// } + int -MacTextFieldObject::setSelection( lua_State *L ) +MacTextFieldObject::setSelection( lua_State* L ) { - Rtt_TRACE_SIM( ( "WARNING: setSelection is not supported by the simulator on TextField objects.\n" ) ); - return 0; + PlatformDisplayObject *o = (PlatformDisplayObject*)LuaProxy::GetProxyableObject(L, 1); + if (&o->ProxyVTable() == &PlatformDisplayObject::GetTextFieldObjectProxyVTable()) + { + NSTextField *t = (NSTextField*)((MacTextFieldObject*)o)->GetView(); + double startPosition = lua_tonumber(L, 2); + double endPosition = lua_tonumber(L, 3); + + NSInteger maxLength = [[t stringValue] length]; + if (startPosition > maxLength) + { + startPosition = maxLength; + endPosition = maxLength; + } + if (endPosition > maxLength) + { + endPosition = maxLength; + } + if (startPosition < 0) + { + startPosition = 0; + } + if (endPosition < 0) + { + endPosition = 0; + } + if (startPosition > endPosition) + { + startPosition = endPosition; + } + + NSRange range; + range.location = startPosition; + range.length = endPosition - startPosition; + + [t.currentEditor setSelectedRange:range]; + } + return 0; +} + +int +MacTextFieldObject::getSelection( lua_State* L ) +{ + PlatformDisplayObject *o = (PlatformDisplayObject*)LuaProxy::GetProxyableObject(L, 1); + if (&o->ProxyVTable() == &PlatformDisplayObject::GetTextFieldObjectProxyVTable()) + { + NSTextField *t = (NSTextField*)((MacTextFieldObject*)o)->GetView(); + NSRange range = [t.currentEditor selectedRange]; + + lua_pushnumber(L, range.location); + lua_pushnumber(L, range.location + range.length); + return 2; + } + return 0; } // TODO: move these somewhere in librtt, so all platforms use same constants @@ -461,6 +519,10 @@ - (void) dispatchEditingEventForTextField:(Rtt_AppleTextDelegateWrapperObjectHel { lua_pushcfunction( L, setSelection); } + else if ( strcmp( "getSelection", key ) == 0 ) + { + lua_pushcfunction( L, getSelection); + } else if ( strcmp( "inputType", key ) == 0 ) { // TODO: Consider using Formatters to support input types diff --git a/platform/mac/ratatouille.xcodeproj/project.pbxproj b/platform/mac/ratatouille.xcodeproj/project.pbxproj index 3ea7cf3c7..0dca91117 100644 --- a/platform/mac/ratatouille.xcodeproj/project.pbxproj +++ b/platform/mac/ratatouille.xcodeproj/project.pbxproj @@ -694,17 +694,18 @@ AAA5811F270D38A6002A51A7 /* CoronaObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = AAA5811B270D38A5002A51A7 /* CoronaObjects.h */; }; AAA58121270D38A6002A51A7 /* CoronaPublicTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = AAA5811C270D38A6002A51A7 /* CoronaPublicTypes.h */; }; AAD3E1FA2B09C2E9000A4D45 /* Rtt_ObjectHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAD3E1F82B09C2E9000A4D45 /* Rtt_ObjectHandle.cpp */; }; - AAD3E1FB2B09C2E9000A4D45 /* Rtt_ObjectHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAD3E1F82B09C2E9000A4D45 /* Rtt_ObjectHandle.cpp */; }; AAD3E1FC2B09C2E9000A4D45 /* Rtt_ObjectHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = AAD3E1F92B09C2E9000A4D45 /* Rtt_ObjectHandle.h */; }; - AAD3E1FD2B09C2E9000A4D45 /* Rtt_ObjectHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = AAD3E1F92B09C2E9000A4D45 /* Rtt_ObjectHandle.h */; }; + AA2C69AC291478430093B0BE /* kernel_filter_blurGaussianLinear_gl.lua in Sources */ = {isa = PBXBuildFile; fileRef = AA2C69A0291476D90093B0BE /* kernel_filter_blurGaussianLinear_gl.lua */; }; + AA2C69AD291478430093B0BE /* kernel_filter_blurLinearHorizontal_gl.lua in Sources */ = {isa = PBXBuildFile; fileRef = AA2C69A7291476D90093B0BE /* kernel_filter_blurLinearHorizontal_gl.lua */; }; + AA2C69AE291478430093B0BE /* kernel_filter_blurLinearVertical_gl.lua in Sources */ = {isa = PBXBuildFile; fileRef = AA2C69A8291476D90093B0BE /* kernel_filter_blurLinearVertical_gl.lua */; }; + AA2C6AAB291C35A90093B0BE /* CoronaMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA2C6AA3291C35A90093B0BE /* CoronaMemory.cpp */; }; + AA2C6AAD291C35A90093B0BE /* CoronaMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = AA2C6AAA291C35A90093B0BE /* CoronaMemory.h */; }; + AAF348FE29DF9BA800076706 /* Rtt_Profiling.h in Headers */ = {isa = PBXBuildFile; fileRef = AAF348FC29DF9BA800076706 /* Rtt_Profiling.h */; }; + AAF3490129DF9BDD00076706 /* Rtt_Profiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF348FF29DF9BDD00076706 /* Rtt_Profiling.cpp */; }; AAF34A7E29F9CAA800076706 /* Rtt_TextureResourceCaptureAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF34A7429F9CAA800076706 /* Rtt_TextureResourceCaptureAdapter.cpp */; }; - AAF34A7F29F9CAA800076706 /* Rtt_TextureResourceCaptureAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF34A7429F9CAA800076706 /* Rtt_TextureResourceCaptureAdapter.cpp */; }; AAF34A8029F9CAA800076706 /* Rtt_TextureResourceCapture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF34A7B29F9CAA800076706 /* Rtt_TextureResourceCapture.cpp */; }; - AAF34A8129F9CAA800076706 /* Rtt_TextureResourceCapture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF34A7B29F9CAA800076706 /* Rtt_TextureResourceCapture.cpp */; }; AAF34A8229F9CAA800076706 /* Rtt_TextureResourceCaptureAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = AAF34A7C29F9CAA800076706 /* Rtt_TextureResourceCaptureAdapter.h */; }; - AAF34A8329F9CAA800076706 /* Rtt_TextureResourceCaptureAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = AAF34A7C29F9CAA800076706 /* Rtt_TextureResourceCaptureAdapter.h */; }; AAF34A8429F9CAA800076706 /* Rtt_TextureResourceCapture.h in Headers */ = {isa = PBXBuildFile; fileRef = AAF34A7D29F9CAA800076706 /* Rtt_TextureResourceCapture.h */; }; - AAF34A8529F9CAA800076706 /* Rtt_TextureResourceCapture.h in Headers */ = {isa = PBXBuildFile; fileRef = AAF34A7D29F9CAA800076706 /* Rtt_TextureResourceCapture.h */; }; C200AAEA19626D86005828AA /* CoronaPListSupport.lua in Resources */ = {isa = PBXBuildFile; fileRef = C200AAE919626D86005828AA /* CoronaPListSupport.lua */; }; C200AAEB19627074005828AA /* CoronaPListSupport.lua in Sources */ = {isa = PBXBuildFile; fileRef = C200AAE919626D86005828AA /* CoronaPListSupport.lua */; }; C2038B101DDCF1970071594F /* AnalyticsProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = C2038B0F1DDCF1970071594F /* AnalyticsProvider.mm */; }; @@ -3227,6 +3228,10 @@ AAA5811C270D38A6002A51A7 /* CoronaPublicTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoronaPublicTypes.h; path = Corona/CoronaPublicTypes.h; sourceTree = ""; }; AAD3E1F82B09C2E9000A4D45 /* Rtt_ObjectHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Rtt_ObjectHandle.cpp; path = Display/Rtt_ObjectHandle.cpp; sourceTree = ""; }; AAD3E1F92B09C2E9000A4D45 /* Rtt_ObjectHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Rtt_ObjectHandle.h; path = Display/Rtt_ObjectHandle.h; sourceTree = ""; }; + AA2C6AA3291C35A90093B0BE /* CoronaMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CoronaMemory.cpp; path = Corona/CoronaMemory.cpp; sourceTree = ""; }; + AA2C6AAA291C35A90093B0BE /* CoronaMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoronaMemory.h; path = Corona/CoronaMemory.h; sourceTree = ""; }; + AAF348FC29DF9BA800076706 /* Rtt_Profiling.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Rtt_Profiling.h; sourceTree = ""; }; + AAF348FF29DF9BDD00076706 /* Rtt_Profiling.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Rtt_Profiling.cpp; sourceTree = ""; }; AAF34A7429F9CAA800076706 /* Rtt_TextureResourceCaptureAdapter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Rtt_TextureResourceCaptureAdapter.cpp; path = Display/Rtt_TextureResourceCaptureAdapter.cpp; sourceTree = ""; }; AAF34A7B29F9CAA800076706 /* Rtt_TextureResourceCapture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Rtt_TextureResourceCapture.cpp; path = Display/Rtt_TextureResourceCapture.cpp; sourceTree = ""; }; AAF34A7C29F9CAA800076706 /* Rtt_TextureResourceCaptureAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Rtt_TextureResourceCaptureAdapter.h; path = Display/Rtt_TextureResourceCaptureAdapter.h; sourceTree = ""; }; diff --git a/platform/resources/OSXPackageApp.lua b/platform/resources/OSXPackageApp.lua index b1d51e67f..3ae5d3a32 100644 --- a/platform/resources/OSXPackageApp.lua +++ b/platform/resources/OSXPackageApp.lua @@ -237,16 +237,18 @@ local function getCodesignScript( entitlements, path, appIdentity, codesign ) -- codesign doesn't like them local removeXattrs = "/usr/bin/xattr -cr "..quoteString(path) .." && " - local entitlementsParam = "" + local entitlementsParam if entitlements ~= nil and entitlements ~= "" then - entitlementsParam = " --entitlements ".. entitlements .." " + entitlementsParam = " --entitlements ".. entitlements .. " " + else + entitlementsParam = " --deep " end local verboseParam = "" if debugBuildProcess and debugBuildProcess ~= 0 then verboseParam = "-".. string.rep("v", debugBuildProcess) .." " end - local cmd = removeXattrs .. codesign.." --options runtime --deep -f -s "..quoteString(appIdentity).." "..entitlementsParam..verboseParam..quotedpath + local cmd = removeXattrs .. codesign.." --options runtime -f -s "..quoteString(appIdentity).." "..entitlementsParam..verboseParam..quotedpath return cmd end @@ -268,7 +270,7 @@ local function getProductValidateScript( path, itunesConnectUsername, itunesConn -- Apple tells us to use this buried utility to automate Application Loader tasks in -- https://itunesconnect.apple.com/docs/UsingApplicationLoader.pdf local altool = makepath(applicationLoader, "Contents/Frameworks/ITunesSoftwareService.framework/Support/altool") - + -- If the "cmd" generated below fails because it's the wrong path that's very hard to detect amongst all the XML parsing so we do it here if lfs.attributes( altool ) == nil then print("ERROR: cannot find 'altool' utility in "..altool) @@ -591,8 +593,6 @@ table.indexOf = function( t, object ) end function signAllPlugins(pluginsDir, signingIdentity, codesign) - local entitlements = "" - if lfs.attributes( pluginsDir ) == nil then return "" -- no plugins dir end @@ -602,7 +602,7 @@ function signAllPlugins(pluginsDir, signingIdentity, codesign) local pluginFile = makepath(pluginsDir, file) if lfs.attributes( pluginFile ).mode ~= "directory" then - local result, errMsg = runScript( getCodesignScript( entitlements, pluginFile, signingIdentity, codesign ) ) + local result, errMsg = runScript( getCodesignScript( nil, pluginFile, signingIdentity, codesign ) ) if result ~= 0 then errMsg = "ERROR: plugin code signing for '"..pluginFile.."' failed: "..tostring(errMsg) @@ -840,7 +840,7 @@ function OSXPostPackage( params ) local entitlements = entitlements_filename local result, includeProvisioning = generateOSXEntitlements( entitlements_filename, settings, provisionFile ) if result ~= "" then - entitlements = "" + entitlements = nil end -- Copy provisioning profile if we need it @@ -848,6 +848,10 @@ function OSXPostPackage( params ) runScript( "/bin/cp " .. quoteString(provisionFile) .. " " .. quoteString(makepath(appBundleFileUnquoted, "Contents/embedded.provisionprofile")) ) end + if entitlements ~= nil then + setStatus("Sign application plugins") + runScript( getCodesignScript( nil, appBundleFileUnquoted, options.signingIdentity, options.xcodetoolhelper.codesign ) ) + end setStatus("Signing application with "..tostring(options.signingIdentityName)) local result, errMsg = runScript( getCodesignScript( entitlements, appBundleFileUnquoted, options.signingIdentity, options.xcodetoolhelper.codesign ) ) runScript( "/bin/rm -f " .. entitlements_filename ) @@ -966,6 +970,8 @@ function OSXPackageForAppStore( params ) return tostring(result) end + setStatus("Sign application deep") + runScript( getCodesignScript( nil, appBundleFile, appSigningIdentity, codesign ) ) setStatus("Signing application with "..tostring(appSigningIdentityName)) local result, errMsg = runScript( getCodesignScript( entitlements_filename, appBundleFile, appSigningIdentity, codesign ) ) @@ -1070,9 +1076,8 @@ function OSXPackageForSelfDistribution( params ) return tostring(result) end - local entitlements = "" -- quoteString( osxAppEntitlementsFile ) setStatus("Signing application with "..tostring(appSigningIdentityName)) - local result, errMsg = runScript( getCodesignScript( entitlements, appBundleFile, appSigningIdentity, codesign ) ) + local result, errMsg = runScript( getCodesignScript( nil, appBundleFile, appSigningIdentity, codesign ) ) if result ~= 0 then errMsg = "ERROR: code signing failed: "..tostring(errMsg) diff --git a/platform/tvos/ratatouille.xcodeproj/project.pbxproj b/platform/tvos/ratatouille.xcodeproj/project.pbxproj index 55a302b79..f9fb31573 100644 --- a/platform/tvos/ratatouille.xcodeproj/project.pbxproj +++ b/platform/tvos/ratatouille.xcodeproj/project.pbxproj @@ -590,7 +590,12 @@ AA2C69FA29147C9D0093B0BE /* kernel_filter_blurLinearHorizontal_gl.lua in Sources */ = {isa = PBXBuildFile; fileRef = AA2C69F829147C4E0093B0BE /* kernel_filter_blurLinearHorizontal_gl.lua */; }; AA2C69FB29147C9D0093B0BE /* kernel_filter_blurLinearVertical_gl.lua in Sources */ = {isa = PBXBuildFile; fileRef = AA2C69BB29147C4E0093B0BE /* kernel_filter_blurLinearVertical_gl.lua */; }; AA76CF15272CB55000CE3F89 /* CoronaObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA2ED7CE2708257E00CEE021 /* CoronaObjects.cpp */; }; +<<<<<<< HEAD AAD3E2452B0BECE2000A4D45 /* Rtt_ObjectHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAD3E2432B0BECBB000A4D45 /* Rtt_ObjectHandle.cpp */; }; + AA2C6AF6291C37690093B0BE /* CoronaMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA2C6AB9291C37690093B0BE /* CoronaMemory.cpp */; }; + AAF349EB29EFC61C00076706 /* Rtt_Profiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF349AE29EFC61C00076706 /* Rtt_Profiling.cpp */; }; +======= +>>>>>>> parent of 255c0481... Some #include fixes for Mac AAF34AD529F9DFB800076706 /* Rtt_FormatExtensionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF34AD329F9DF9E00076706 /* Rtt_FormatExtensionList.cpp */; }; AAF34AD629F9DFB900076706 /* Rtt_FormatExtensionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF34AD329F9DF9E00076706 /* Rtt_FormatExtensionList.cpp */; }; AAF34ADB29F9DFDB00076706 /* Rtt_TextureResourceCapture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAF34AD929F9DFDB00076706 /* Rtt_TextureResourceCapture.cpp */; }; @@ -2573,8 +2578,16 @@ AA2ED7912708257E00CEE021 /* CoronaObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoronaObjects.h; path = ../../librtt/Corona/CoronaObjects.h; sourceTree = ""; }; AA2ED7CD2708257E00CEE021 /* CoronaPublicTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoronaPublicTypes.h; path = ../../librtt/Corona/CoronaPublicTypes.h; sourceTree = ""; }; AA2ED7CE2708257E00CEE021 /* CoronaObjects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CoronaObjects.cpp; path = ../../librtt/Corona/CoronaObjects.cpp; sourceTree = ""; }; +<<<<<<< HEAD AAD3E2432B0BECBB000A4D45 /* Rtt_ObjectHandle.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Rtt_ObjectHandle.cpp; path = ../../librtt/Display/Rtt_ObjectHandle.cpp; sourceTree = ""; }; AAD3E2442B0BECBB000A4D45 /* Rtt_ObjectHandle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Rtt_ObjectHandle.h; path = ../../librtt/Display/Rtt_ObjectHandle.h; sourceTree = ""; }; + AA2C6AB9291C37690093B0BE /* CoronaMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CoronaMemory.cpp; path = ../../librtt/Corona/CoronaMemory.cpp; sourceTree = ""; }; + AA2C6AF5291C37690093B0BE /* CoronaMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoronaMemory.h; path = ../../librtt/Corona/CoronaMemory.h; sourceTree = ""; }; + AAF349AE29EFC61C00076706 /* Rtt_Profiling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Rtt_Profiling.cpp; path = ../../librtt/Rtt_Profiling.cpp; sourceTree = ""; }; + AAF349EA29EFC61C00076706 /* Rtt_Profiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Rtt_Profiling.h; path = ../../librtt/Rtt_Profiling.h; sourceTree = ""; }; +======= + AAA58168270D399C002A51A7 /* Rtt_ObjectBoxList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Rtt_ObjectBoxList.h; path = ../../librtt/Display/Rtt_ObjectBoxList.h; sourceTree = ""; }; +>>>>>>> parent of 255c0481... Some #include fixes for Mac AAF34A9729F9DF9E00076706 /* Rtt_FormatExtensionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Rtt_FormatExtensionList.h; path = ../../librtt/Renderer/Rtt_FormatExtensionList.h; sourceTree = ""; }; AAF34AD329F9DF9E00076706 /* Rtt_FormatExtensionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Rtt_FormatExtensionList.cpp; path = ../../librtt/Renderer/Rtt_FormatExtensionList.cpp; sourceTree = ""; }; AAF34AD729F9DFDB00076706 /* Rtt_TextureResourceCaptureAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Rtt_TextureResourceCaptureAdapter.h; path = ../../librtt/Display/Rtt_TextureResourceCaptureAdapter.h; sourceTree = ""; }; @@ -3019,8 +3032,7 @@ A4551D7B1BAA17CF00FB3BDF /* Rtt_MCPUResourceObserver.h */, A4551D7C1BAA17CF00FB3BDF /* Rtt_MDisplayDelegate.h */, A4551D7D1BAA17CF00FB3BDF /* Rtt_MDrawable.h */, - AAD3E2432B0BECBB000A4D45 /* Rtt_ObjectHandle.cpp */, - AAD3E2442B0BECBB000A4D45 /* Rtt_ObjectHandle.h */, + AAA58168270D399C002A51A7 /* Rtt_ObjectBoxList.h */, A4551D7E1BAA17CF00FB3BDF /* Rtt_OpenPath.cpp */, A4551D7F1BAA17CF00FB3BDF /* Rtt_OpenPath.h */, A4551D801BAA17CF00FB3BDF /* Rtt_Paint.cpp */, @@ -6004,7 +6016,6 @@ A4551D401BAA17BE00FB3BDF /* Rtt_VersionTimestamp.c in Sources */, A4551D2C1BAA17BE00FB3BDF /* Rtt_Array.cpp in Sources */, A4551D361BAA17BE00FB3BDF /* Rtt_Math.c in Sources */, - AAD3E2452B0BECE2000A4D45 /* Rtt_ObjectHandle.cpp in Sources */, A4551D3F1BAA17BE00FB3BDF /* Rtt_UseCount.cpp in Sources */, A4551D321BAA17BE00FB3BDF /* Rtt_Fixed.c in Sources */, A4551F3D1BAA182D00FB3BDF /* Rtt_DeviceOrientation.cpp in Sources */, diff --git a/platform/windows/Corona.Native.Library.Win32/Interop/UI/TextBox.cpp b/platform/windows/Corona.Native.Library.Win32/Interop/UI/TextBox.cpp index 888a443a9..456ac1b2c 100644 --- a/platform/windows/Corona.Native.Library.Win32/Interop/UI/TextBox.cpp +++ b/platform/windows/Corona.Native.Library.Win32/Interop/UI/TextBox.cpp @@ -418,6 +418,26 @@ void TextBox::SetSelection(int startCharacterIndex, int endCharacterIndex) } } +bool TextBox::GetSelection(int *outStartCharacterIndex, int *outEndCharacterIndex) const +{ + auto windowHandle = GetWindowHandle(); + if (windowHandle) + { + DWORD start, end; + ::SendMessageW(windowHandle, EM_GETSEL, (WPARAM)&start, (LPARAM)&end); + if (outStartCharacterIndex) + { + *outStartCharacterIndex = (int)start; + } + if (outEndCharacterIndex) + { + *outEndCharacterIndex = (int)end; + } + return true; + } + return false; +} + void TextBox::SetTextColorToDefault() { fIsUsingCustomTextColor = false; diff --git a/platform/windows/Corona.Native.Library.Win32/Interop/UI/TextBox.h b/platform/windows/Corona.Native.Library.Win32/Interop/UI/TextBox.h index 0c2f9a7c2..112988add 100644 --- a/platform/windows/Corona.Native.Library.Win32/Interop/UI/TextBox.h +++ b/platform/windows/Corona.Native.Library.Win32/Interop/UI/TextBox.h @@ -268,6 +268,15 @@ class TextBox : public Control /// void SetSelection(int startCharacterIndex, int endCharacterIndex); + ///

Gets the text box's current selection start and end character indices. + /// Pointer to an integer that will receive the start index of the selection. + /// Pointer to an integer that will receive the end index of the selection. + /// + /// Returns true if the indices were successfully fetched. + /// Returns false if failed to fetch the indices, in which case the output parameters won't be modified. + /// + bool GetSelection(int *outStartCharacterIndex, int *outEndCharacterIndex) const; + /// Sets the control's text color to the system default. void SetTextColorToDefault(); diff --git a/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinBitmap.cpp b/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinBitmap.cpp index 5637f3b75..d8e3f2724 100644 --- a/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinBitmap.cpp +++ b/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinBitmap.cpp @@ -22,130 +22,379 @@ using std::min; using std::max; #include +#include namespace Rtt { -// -// LoadImageFromFileWithoutLocking -// -// Load a bitmap from a file without leaving the file locked until the -// bitmap is released (as happens by default for bitmaps from files). -// -// From StackOverflow: http://stackoverflow.com/questions/4978419 -// -static Gdiplus::Bitmap* LoadImageFromFileWithoutLocking(const WCHAR* fileName) +// Modeled on ALmixer RWops. +struct BitmapStream : public IStream { - using namespace Gdiplus; - Bitmap src(fileName); + public: + #pragma region IUnknown Methods + virtual HRESULT STDMETHODCALLTYPE QueryInterface( REFIID, __RPC__deref_out void __RPC_FAR *__RPC_FAR * ); + virtual ULONG STDMETHODCALLTYPE AddRef(); + virtual ULONG STDMETHODCALLTYPE Release(); + #pragma endregion + + #pragma region ISequentialStream Methods + virtual HRESULT STDMETHODCALLTYPE Read( __out_bcount_part(cb, *pcbRead) void *pv, ULONG cb, __out_opt ULONG *pcbRead ); + virtual HRESULT STDMETHODCALLTYPE Write( __in_bcount(cb) const void *, ULONG, __out_opt ULONG * ) { return E_NOTIMPL; } + #pragma endregion + + #pragma region IStream Methods + virtual HRESULT STDMETHODCALLTYPE Seek( LARGE_INTEGER dlibMove, DWORD dwOrigin, __out_opt ULARGE_INTEGER *plibNewPosition ); + virtual HRESULT STDMETHODCALLTYPE SetSize( ULARGE_INTEGER ) { return E_NOTIMPL; } + virtual HRESULT STDMETHODCALLTYPE CopyTo( IStream *, ULARGE_INTEGER, __out_opt ULARGE_INTEGER *, __out_opt ULARGE_INTEGER * ) { return E_NOTIMPL; } + virtual HRESULT STDMETHODCALLTYPE Commit( DWORD ) { return E_NOTIMPL; } + virtual HRESULT STDMETHODCALLTYPE Revert() { return E_NOTIMPL; } + virtual HRESULT STDMETHODCALLTYPE LockRegion( ULARGE_INTEGER, ULARGE_INTEGER, DWORD ) { return E_NOTIMPL; } + virtual HRESULT STDMETHODCALLTYPE UnlockRegion( ULARGE_INTEGER, ULARGE_INTEGER, DWORD ) { return E_NOTIMPL; } + virtual HRESULT STDMETHODCALLTYPE Stat( __RPC__out STATSTG *pstatstg, DWORD ); + virtual HRESULT STDMETHODCALLTYPE Clone( __RPC__deref_out_opt IStream ** ) { return E_NOTIMPL; } + #pragma endregion + + #pragma region Public Static Functions + BitmapStream( void* data, U32 size ) + : fRefCount( 1 ), + fStart( data ), + fOffset( 0 ), + fSize( size ) + { + } - if (src.GetLastStatus() != Ok) + #pragma endregion + + private: + #pragma region Private Member Variables + ULONG fRefCount; + void* fStart; + U32 fOffset; + U32 fSize; + #pragma endregion +}; + +HRESULT STDMETHODCALLTYPE BitmapStream::QueryInterface( REFIID riid, __RPC__deref_out void __RPC_FAR *__RPC_FAR *ppvObject ) +{ + if (!ppvObject) { - Rtt_TRACE(( "LoadImageFromFileWithoutLocking: failed to create bitmap for '%S'\n", fileName )); - return 0; + return E_POINTER; + } + + if ( ( __uuidof(IUnknown) == riid ) || ( __uuidof(ISequentialStream) == riid ) || ( __uuidof(IStream) == riid ) ) + { + *ppvObject = this; + AddRef(); + return S_OK; } - Bitmap *dst = new Bitmap(src.GetWidth(), src.GetHeight(), PixelFormat32bppARGB); - BitmapData srcData; - BitmapData dstData; - Gdiplus::Rect rc(0, 0, src.GetWidth(), src.GetHeight()); + *ppvObject = nullptr; + return E_NOINTERFACE; +} + +ULONG STDMETHODCALLTYPE BitmapStream::AddRef() +{ + return InterlockedIncrement( &fRefCount ); +} - if (src.LockBits(&rc, ImageLockModeRead, PixelFormat32bppARGB, &srcData) == Ok) +ULONG STDMETHODCALLTYPE BitmapStream::Release() +{ + ULONG currentCount = InterlockedDecrement( &fRefCount ); + + if ( 0 == currentCount ) { - if (dst->LockBits(&rc, ImageLockModeWrite, PixelFormat32bppARGB, &dstData) == Ok) - { - uint8_t * srcBits = (uint8_t *)srcData.Scan0; - uint8_t * dstBits = (uint8_t *)dstData.Scan0; - unsigned int stride; + delete this; + } - if (srcData.Stride > 0) - { - stride = srcData.Stride; - } - else - { - stride = -srcData.Stride; - } - memcpy(dstBits, srcBits, src.GetHeight() * stride); + return currentCount; +} - dst->UnlockBits(&dstData); - } - src.UnlockBits(&srcData); +HRESULT STDMETHODCALLTYPE BitmapStream::Read( __out_bcount_part(cb, *pcbRead) void *pv, ULONG cb, __out_opt ULONG *pcbRead ) +{ + if ( !pv ) + { + return STG_E_INVALIDPOINTER; + } + + HRESULT result = S_OK; + + if ( fOffset + cb > fSize ) + { + cb = fSize - fOffset; + + result = S_FALSE; + } + + if ( cb ) + { + memcpy( pv, static_cast( fStart ) + fOffset, cb ); + + fOffset += cb; + } + + if ( pcbRead ) + { + *pcbRead = cb; } - return dst; + + return result; } -WinBitmap::WinBitmap() - : fData( NULL ), fBitmap( NULL ), fLockedBitmapData( NULL ) +HRESULT STDMETHODCALLTYPE BitmapStream::Seek( LARGE_INTEGER dlibMove, DWORD dwOrigin, __out_opt ULARGE_INTEGER *plibNewPosition ) { + S32 offset = 0; + + switch ( dwOrigin ) + { + case STREAM_SEEK_SET: + offset = dlibMove.QuadPart; + break; + case STREAM_SEEK_END: + offset = S32( fSize ) + dlibMove.QuadPart; + break; + case STREAM_SEEK_CUR: + offset = S32( fOffset ) + dlibMove.QuadPart; + break; + default: + return STG_E_INVALIDFUNCTION; + } + + if ( offset < 0 || offset >= S32( fSize ) ) + { + return STG_E_INVALIDFUNCTION; + } + + fOffset = U32( offset ); + + if ( plibNewPosition ) + { + plibNewPosition->QuadPart = fOffset; + } + + return S_OK; } -WinBitmap::~WinBitmap() +HRESULT STDMETHODCALLTYPE BitmapStream::Stat( __RPC__out STATSTG *pstatstg, DWORD ) { - Self::FreeBits(); + if ( !pstatstg ) + { + return STG_E_INVALIDPOINTER; + } + + memset( pstatstg, 0, sizeof(STATSTG) ); + + pstatstg->type = STGTY_STREAM; + pstatstg->clsid = CLSID_NULL; + pstatstg->cbSize.QuadPart = fSize; + + return S_OK; +} + +WinFileBitmap::FileView::FileView() +: fMapping( NULL ), + fData( NULL ) +{ +} + +bool WinFileBitmap::FileView::Map( HANDLE hFile ) +{ + Close(); + + fMapping = CreateFileMapping( hFile, 0, PAGE_READONLY, 0, 0, 0 ); + + if ( NULL == fMapping ) + { + return false; + } + + fData = MapViewOfFile( fMapping, FILE_MAP_READ, 0, 0, 0 ); + + if ( NULL != fData ) + { + return true; + } + + else + { + CloseHandle( fMapping ); - if ( fBitmap ) { - Rtt_ASSERT( fLockedBitmapData == NULL ); - delete fBitmap; - fData = NULL; + return false; } } -const void * -WinBitmap::GetBits( Rtt_Allocator* context ) const +void WinFileBitmap::FileView::Close() { - const_cast< WinBitmap * >( this )->Lock(); + if ( fData ) + { + UnmapViewOfFile( fData ); + } - return fData; + if ( fMapping ) + { + CloseHandle( fMapping ); + } + + fMapping = NULL; + fData = NULL; } -void -WinBitmap::FreeBits() const +static U8* LockBitmapData( Rtt_Allocator& allocator, Gdiplus::Bitmap* src, U32* width, U32* height, const char* inPath ) { - const_cast< WinBitmap * >( this )->Unlock(); + void* out = Rtt_MALLOC( allocator, src->GetWidth() * src->GetHeight() * 4 ); + + if ( NULL == out ) + { + Rtt_TRACE(( "LockBitmapData: unable to allocate data for '%S'\n", inPath )); + return NULL; + } + + Gdiplus::BitmapData srcData; + + // https://learn.microsoft.com/en-us/windows/win32/api/gdiplusheaders/nf-gdiplusheaders-bitmap-lockbits claim we need + // to set all of these, though Width, Height, and PixelFormat seem to get set by LockBits() just fine. + srcData.Width = src->GetWidth(); + srcData.Height = src->GetHeight(); + srcData.PixelFormat = PixelFormat32bppPARGB; + srcData.Scan0 = out; + srcData.Stride = srcData.Width * 4; + + Gdiplus::Rect rc( 0, 0, src->GetWidth(), src->GetHeight() ); + + if ( Gdiplus::Ok == src->LockBits( &rc, Gdiplus::ImageLockModeRead | Gdiplus::ImageLockModeUserInputBuf, PixelFormat32bppPARGB, &srcData ) ) + { + Rtt_ASSERT( width ); + Rtt_ASSERT( height ); + + *width = srcData.Width; + *height = srcData.Height; + + src->UnlockBits( &srcData ); + + return static_cast( out ); + } + + else + { + Rtt_TRACE(( "LockBitmapData: unable to lock bitmap for '%S'\n", inPath )); + + Rtt_FREE( out ); + + return NULL; + } } -void -WinBitmap::Lock() +static U8* LoadMaskDataFromStream( Rtt_Allocator& allocator, IStream* pStream, U32* width, U32* height, const char* inPath ) { - if ( fBitmap == NULL ) - return; + using namespace Gdiplus; + Bitmap src( pStream, FALSE ); - Gdiplus::Rect rect; + if ( src.GetLastStatus() != Ok ) + { + Rtt_TRACE(( "LoadImageDataFromStream: failed to create bitmap for '%S'\n", inPath )); + return NULL; + } - rect.X = rect.Y = 0; - rect.Width = fBitmap->GetWidth(); - rect.Height = fBitmap->GetHeight(); + return LockBitmapData( allocator, &src, width, height, inPath ); +} + +static Gdiplus::Bitmap* LoadBitmap( Rtt_Allocator& context, IStream* pStream, U32*, U32*, const char* ) +{ + return Rtt_NEW( context, Gdiplus::Bitmap( pStream, FALSE ) ); +} - fLockedBitmapData = new Gdiplus::BitmapData; - Gdiplus::Status status = fBitmap->LockBits( - &rect, - Gdiplus::ImageLockModeRead, - PixelFormat32bppPARGB, - fLockedBitmapData - ); +static HANDLE +FileFromPath( const char *inPath ) +{ + WinString wPath( inPath ); - fData = fLockedBitmapData->Scan0; + return CreateFile( wPath.GetTCHAR(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ); } -void -WinBitmap::Unlock() +template +R* LoadBitmapData( HANDLE hFile, Rtt_Allocator &context, F && func, const char *inPath, U32* width, U32* height, WinFileBitmap::FileView* pView = NULL ) { - if ( fBitmap == NULL ) - return; + if (INVALID_HANDLE_VALUE == hFile) + { + Rtt_TRACE(( "LoadBitmapData: unable to load bitmap '%S'\n", inPath )); - fBitmap->UnlockBits( fLockedBitmapData ); - delete fLockedBitmapData; - fLockedBitmapData = NULL; - fData = NULL; + return NULL; + } + + WinFileBitmap::FileView view; + + bool wasMapped = view.Map( hFile ); + U32 size = GetFileSize( hFile, 0 ); + + CloseHandle( hFile ); + + if ( !wasMapped ) + { + Rtt_TRACE(( "LoadBitmapData: unable to map file into memory for '%S'\n", inPath )); + + return NULL; + } + + R* result = NULL; + BitmapStream* pStream = Rtt_NEW( context, BitmapStream( view.fData, size ) ); + + if ( NULL != pStream ) + { + result = func( context, pStream, width, height, inPath ); + + pStream->Release(); + } + + else + { + Rtt_TRACE(( "LoadBitmapData: unable to create memory stream for '%S'\n", inPath )); + } + + if ( NULL != result && NULL != pView ) + { + *pView = view; + } + + else + { + view.Close(); + } + + return result; +} + +WinBitmap::WinBitmap() + : fData( NULL ), fBitmap( NULL ), + fWidth( 0 ), fHeight( 0 ) +{ +} + +WinBitmap::~WinBitmap() +{ + Self::FreeBits(); + + + Rtt_DELETE( fBitmap ); +} + +const void * +WinBitmap::GetBits( Rtt_Allocator* context ) const +{ + const_cast< WinBitmap * >( this )->Lock( context ); + + return fData; +} + +void +WinBitmap::FreeBits() const +{ } U32 WinBitmap::Width() const { - if ( fLockedBitmapData != NULL ) - return fLockedBitmapData->Width; + if ( 0 != fWidth ) + return fWidth; if ( fBitmap == NULL ) return 0; return fBitmap->GetWidth(); @@ -154,8 +403,8 @@ WinBitmap::Width() const U32 WinBitmap::Height() const { - if ( fLockedBitmapData != NULL ) - return fLockedBitmapData->Height; + if ( 0 != fHeight ) + return fHeight; if ( fBitmap == NULL ) return 0; return fBitmap->GetHeight(); @@ -190,19 +439,13 @@ WinFileBitmap::WinFileBitmap( const char * inPath, Rtt_Allocator &context ) : fPath(&context) #endif { - WinString wPath; - // Initialize all member variables. InitializeMembers(); // Load bitmap from file. - wPath.SetUTF8( inPath ); -#if defined(Rtt_AUTHORING_SIMULATOR) - // Use a method of loading the bitmap that doesn't lock the underlying file - Gdiplus::Bitmap *bm = LoadImageFromFileWithoutLocking(wPath.GetTCHAR()); -#else - Gdiplus::Bitmap *bm = Gdiplus::Bitmap::FromFile( wPath.GetTCHAR() ); -#endif + HANDLE global = NULL; + Gdiplus::Bitmap *bm = LoadBitmapData( FileFromPath( inPath ), context, LoadBitmap, inPath, NULL, NULL, &fView ); + if ( bm != NULL && bm->GetLastStatus() == Gdiplus::Ok ) { fBitmap = bm; @@ -212,12 +455,17 @@ WinFileBitmap::WinFileBitmap( const char * inPath, Rtt_Allocator &context ) } else { + fView.Close(); + delete bm; } } WinFileBitmap::~WinFileBitmap() { + fView.Close(); + + Rtt_FREE( fData ); } void @@ -227,7 +475,6 @@ WinFileBitmap::InitializeMembers() fOrientation = kUp; fProperties = GetInitialPropertiesValue(); fBitmap = NULL; - fLockedBitmapData = NULL; fData = NULL; } @@ -243,6 +490,27 @@ WinFileBitmap::CalculateScale() const return 1.0; } + +void +WinFileBitmap::Lock( Rtt_Allocator* context ) +{ + if ( fBitmap == NULL ) + return; + + fData = LockBitmapData( *context, fBitmap, &fWidth, &fHeight, + #ifdef Rtt_DEBUG + fPath.GetString() ); + #else + "?" ); + #endif + + Rtt_DELETE( fBitmap ); + + fBitmap = NULL; + + fView.Close(); +} + U32 WinFileBitmap::SourceWidth() const { @@ -315,80 +583,61 @@ WinFileBitmap::SetProperty( PropertyMask mask, bool newValue ) WinFileGrayscaleBitmap::WinFileGrayscaleBitmap( const char *inPath, Rtt_Allocator &context ) : WinFileBitmap(context) { - Gdiplus::Color sourceColor; - Gdiplus::Bitmap *sourceBitmap = NULL; - U8 *bitmapBuffer = NULL; - WinString wPath; - int byteCount; - U32 xIndex; - U32 yIndex; - U8 grayscaleColor; - #ifdef Rtt_DEBUG - // Store the path. fPath.Set( inPath ); #endif - // Fetch the bitmap from file. - wPath.SetUTF8( inPath ); -#if defined(Rtt_AUTHORING_SIMULATOR) - // Use a method of loading the bitmap that doesn't lock the underlying file - sourceBitmap = LoadImageFromFileWithoutLocking(wPath.GetTCHAR()); -#else - sourceBitmap = Gdiplus::Bitmap::FromFile(wPath.GetTCHAR()); -#endif + U8* data = LoadBitmapData( FileFromPath( inPath ), context, LoadMaskDataFromStream, inPath, &fWidth, &fHeight ); - if (sourceBitmap == NULL || sourceBitmap->GetLastStatus() != Gdiplus::Ok) + if ( NULL == data ) { - delete sourceBitmap; return; } - // Store the bitmap's dimensions for fast retrieval. - fWidth = sourceBitmap->GetWidth(); - fHeight = sourceBitmap->GetHeight(); - - // Convert the given bitmap to an 8-bit grayscaled bitmap. - byteCount = fWidth * fHeight; - if (byteCount > 0) + if ( fWidth && fHeight ) { - // Calculate the pitch of the image, which is the width of the image padded to the byte packing alignment. U32 pitch = fWidth; U32 delta = fWidth % kBytePackingAlignment; if (delta > 0) pitch += kBytePackingAlignment - delta; - // Create the 8-bit grayscaled bitmap. // -------------------------------------------------------------------------------------------------------- // Microsoft GDI cannot create a grayscaled bitmap that OpenGL needs for masking. // GDI can only create 8-bit bitmaps with color palettes. So we have to create the bitmap binary ourselves. // -------------------------------------------------------------------------------------------------------- - byteCount = pitch * fHeight; - bitmapBuffer = new U8[byteCount]; - for (yIndex = 0; yIndex < fHeight; yIndex++) + int byteCount = pitch * fHeight; + U8* bitmapBuffer = new U8[byteCount]; + + if (pitch > fWidth) { - for (xIndex = 0; xIndex < pitch; xIndex++) + memset( bitmapBuffer, 0, pitch * fHeight ); + } + + U8*out = bitmapBuffer; + const U8* colors = data; + U32 rowBase = 0; + + for ( int yIndex = 0; yIndex < fHeight; ++yIndex ) + { + for ( int xIndex = 0; xIndex < fWidth; ++xIndex ) { - if (xIndex < fWidth) - { - // Convert the source bitmap color to grayscale. - sourceBitmap->GetPixel(xIndex, yIndex, &sourceColor); - grayscaleColor = (U8)( - (0.30 * sourceColor.GetRed()) + - (0.59 * sourceColor.GetGreen()) + - (0.11 * sourceColor.GetBlue())); - } - else - { - // Fill the padded area of the bitmap (due to the pitch) with the color black. - // This assumes that the user wants black on the edges. A bitmask is expected to have a - // black border so that only its center area shows through on screen. - grayscaleColor = 0; - } - bitmapBuffer[xIndex + (pitch * yIndex)] = grayscaleColor; - } + // Adapted from http://www.songho.ca/dsp/luminance/luminance.html + // Originally, the RGB factors and denominator were: 2, 5, 1, and 8, respectively. + // These numbers (2/8, 5/8, 1/8) were hoisted up into higher denominators (e.g. 4/16, 10/16, 2/16), + // and the intervals around them searched: e.g. 4/16 += 1/16, 4/16 += 2/16, etc. and compared against + // the ground truth values (0.30, 0.59, 0.11); with a 64 denominator the end results only differ by + // 1 (out of 255) at most, and never for solid black or white. It seems to be stuck with this slight + // imperfection. :) + out[rowBase + xIndex] = ( 19 * colors[2] + 38 * colors[1] + 7 * colors[0] ) / 64; + + colors += 4; + } + + rowBase += pitch; } + fData = bitmapBuffer; + // Set the image width to the pitch in case it is larger. Otherwise it will not be rendered correctly. // Ideally, you shouldn't do this because it will make the DisplayObject wider than expected by at // most 3 pixels (assuming the packing alignment is 4 bytes), but until the DisplayObject can compensate @@ -396,12 +645,7 @@ WinFileGrayscaleBitmap::WinFileGrayscaleBitmap( const char *inPath, Rtt_Allocato fWidth = pitch; } - // The source bitmap is no longer needed. - delete sourceBitmap; - - // Store the grayscale bitmap binary. - // The base class will provide the bits via the inherited member variable "fData". - fData = (void*)bitmapBuffer; + Rtt_FREE( data ); } WinFileGrayscaleBitmap::~WinFileGrayscaleBitmap() @@ -420,16 +664,6 @@ WinFileGrayscaleBitmap::FreeBits() const // This improves hit-test performance in "Rtt_PlatformBitmap.cpp" which tests a pixel's transparency value. } -void -WinFileGrayscaleBitmap::Lock() -{ -} - -void -WinFileGrayscaleBitmap::Unlock() -{ -} - U32 WinFileGrayscaleBitmap::SourceWidth() const { @@ -871,20 +1105,10 @@ WinTextBitmap::GetFormat() const return PlatformBitmap::kMask; } -void -WinTextBitmap::Lock() -{ -} - -void -WinTextBitmap::Unlock() -{ -} - const void * WinTextBitmap::GetBits( Rtt_Allocator* context ) const { return fData; } -} // namespace Rtt +} // namespace Rtt \ No newline at end of file diff --git a/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinBitmap.h b/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinBitmap.h index b6a3534f7..cd137780a 100644 --- a/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinBitmap.h +++ b/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinBitmap.h @@ -62,10 +62,10 @@ class WinBitmap : public PlatformBitmap protected: Gdiplus::Bitmap * fBitmap; - Gdiplus::BitmapData * fLockedBitmapData; + U32 fWidth; + U32 fHeight; - virtual void Lock(); - virtual void Unlock(); + virtual void Lock( Rtt_Allocator* context ) {} }; class WinFileBitmap : public WinBitmap @@ -103,11 +103,26 @@ class WinFileBitmap : public WinBitmap virtual U32 UprightWidth() const; virtual U32 UprightHeight() const; + protected: + virtual void Lock( Rtt_Allocator* context ); + + public: + struct FileView { + FileView(); + + bool Map( HANDLE hFile ); + void Close(); + + HANDLE fMapping; + void* fData; + }; + private: float fScale; U8 fProperties; S8 fOrientation; S16 fAngle; // [0, +-90, +-180] + FileView fView; // n.b. takes ownership protected: #ifdef Rtt_DEBUG @@ -127,13 +142,8 @@ class WinFileGrayscaleBitmap : public WinFileBitmap virtual PlatformBitmap::Format GetFormat() const; protected: - virtual void Lock(); - virtual void Unlock(); virtual U32 SourceWidth() const; virtual U32 SourceHeight() const; - - U32 fWidth; - U32 fHeight; }; class WinTextBitmap : public PlatformBitmap @@ -152,14 +162,10 @@ class WinTextBitmap : public PlatformBitmap virtual U32 Width() const; virtual U32 Height() const; - protected: - virtual void Lock(); - virtual void Unlock(); - private: mutable void *fData; U32 fWidth; U32 fHeight; }; -} // namespace Rtt +} // namespace Rtt \ No newline at end of file diff --git a/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinTextBoxObject.cpp b/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinTextBoxObject.cpp index 3426c6935..8732aaa5d 100644 --- a/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinTextBoxObject.cpp +++ b/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinTextBoxObject.cpp @@ -237,6 +237,10 @@ int WinTextBoxObject::ValueForKey(lua_State *L, const char key[]) const { lua_pushcfunction(L, WinTextBoxObject::OnSetSelection); } + else if (strcmp("getSelection", key) == 0) + { + lua_pushcfunction(L, WinTextBoxObject::OnGetSelection); + } else if (strcmp("align", key) == 0) { auto alignmentPointer = fTextBoxPointer->GetAlignment(); @@ -763,6 +767,22 @@ int WinTextBoxObject::OnSetSelection(lua_State *L) return 0; } +int WinTextBoxObject::OnGetSelection(lua_State *L) +{ + auto displayObjectPointer = (WinTextBoxObject*)LuaProxy::GetProxyableObject(L, 1); + if (&displayObjectPointer->ProxyVTable() == &PlatformDisplayObject::GetTextFieldObjectProxyVTable()) + { + int startIndex = 0; + int endIndex = 0; + displayObjectPointer->fTextBoxPointer->GetSelection(&startIndex, &endIndex); + + lua_pushnumber(L, startIndex); + lua_pushnumber(L, endIndex); + return 2; + } + return 0; +} + int WinTextBoxObject::OnResizeFontToFitHeight(lua_State *L) { auto displayObjectPointer = (WinTextBoxObject*)LuaProxy::GetProxyableObject(L, 1); diff --git a/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinTextBoxObject.h b/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinTextBoxObject.h index 3a8d3199c..e0ce10f33 100644 --- a/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinTextBoxObject.h +++ b/platform/windows/Corona.Native.Library.Win32/Rtt/Rtt_WinTextBoxObject.h @@ -114,6 +114,10 @@ class WinTextBoxObject : public WinDisplayObject /// Pointer to the Lua state that invoked this function. static int OnSetSelection(lua_State *L); + /// Called by the Lua getSelection() function. + /// Pointer to the Lua state that invoked this function. + static int OnGetSelection(lua_State *L); + /// Called by the Lua resizeFontToFitHeight() function. /// Pointer to the Lua state that invoked this function. static int OnResizeFontToFitHeight(lua_State *L); diff --git a/platform/windows/Corona.Rtt.Library/Corona.Rtt.Library.Win32.vcxproj b/platform/windows/Corona.Rtt.Library/Corona.Rtt.Library.Win32.vcxproj index c749433e2..c3dfef428 100644 --- a/platform/windows/Corona.Rtt.Library/Corona.Rtt.Library.Win32.vcxproj +++ b/platform/windows/Corona.Rtt.Library/Corona.Rtt.Library.Win32.vcxproj @@ -989,6 +989,31 @@ if NOT EXIST %LIBRARY% ( ..\..\..\external\vulkan\Lib32; + + + Level3 + + + MaxSpeed + true + true + true + false + ..\..\..\external\vulkan\Include;..\..\..\external\b2Separator-cpp;..\..\..\external\fft;..\..\..\external\LuaHashMap;..\..\..\external\smoothpolygon;..\..\..\plugins\shared;%(AdditionalIncludeDirectories) + VK_USE_PLATFORM_WIN32_KHR;WIN32;_WINDOWS;_LIB;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + false + shaderc_combined.lib;spirv-cross-core.lib;spirv-cross-glsl.lib + ..\..\..\external\vulkan\Lib32; + + Level3 diff --git a/platform/windows/Corona.Rtt.Library/Corona.Rtt.Library.Win32.vcxproj.filters b/platform/windows/Corona.Rtt.Library/Corona.Rtt.Library.Win32.vcxproj.filters index 253222f96..6a88310cc 100644 --- a/platform/windows/Corona.Rtt.Library/Corona.Rtt.Library.Win32.vcxproj.filters +++ b/platform/windows/Corona.Rtt.Library/Corona.Rtt.Library.Win32.vcxproj.filters @@ -951,6 +951,15 @@ librtt\Display + + librtt\Display + + + librtt\Display + + + librtt\Renderer + @@ -1910,6 +1919,15 @@ external\wyhash + + librtt\Display + + + librtt\Display + + + librtt\Renderer + diff --git a/tools/GHAction/Certificates.p12 b/tools/GHAction/Certificates.p12 index c5e5a6f09..8e3af5dec 100644 Binary files a/tools/GHAction/Certificates.p12 and b/tools/GHAction/Certificates.p12 differ