summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct25
-rw-r--r--core/bind/core_bind.cpp7
-rw-r--r--core/bind/core_bind.h3
-rw-r--r--core/command_queue_mt.h2
-rw-r--r--core/globals.cpp6
-rw-r--r--core/input_map.cpp58
-rw-r--r--core/input_map.h1
-rw-r--r--core/io/config_file.cpp12
-rw-r--r--core/io/http_client.cpp11
-rw-r--r--core/io/json.cpp2
-rw-r--r--core/io/resource_format_binary.cpp3
-rw-r--r--core/io/resource_format_xml.cpp4
-rw-r--r--core/math/math_funcs.cpp10
-rw-r--r--core/message_queue.cpp104
-rw-r--r--core/message_queue.h7
-rw-r--r--core/object.cpp120
-rw-r--r--core/object.h1
-rw-r--r--core/os/file_access.h1
-rw-r--r--core/os/input.cpp4
-rw-r--r--core/os/input.h5
-rw-r--r--core/os/input_event.cpp1
-rw-r--r--core/os/os.cpp9
-rw-r--r--core/os/os.h5
-rw-r--r--core/print_string.cpp2
-rw-r--r--core/register_core_types.cpp2
-rw-r--r--core/script_debugger_remote.cpp9
-rw-r--r--core/script_language.h1
-rw-r--r--core/ustring.cpp25
-rw-r--r--core/ustring.h3
-rw-r--r--core/variant.cpp40
-rw-r--r--core/variant.h4
-rw-r--r--core/variant_call.cpp6
-rw-r--r--core/variant_op.cpp4
-rw-r--r--core/variant_parser.cpp120
-rw-r--r--core/variant_parser.h7
-rw-r--r--demos/3d/platformer/engine.cfg2
-rw-r--r--demos/3d/platformer/player.scnbin108067 -> 107922 bytes
-rw-r--r--demos/misc/joysticks/diagram.pngbin0 -> 171519 bytes
-rw-r--r--demos/misc/joysticks/engine.cfg2
-rw-r--r--demos/misc/joysticks/indicators.pngbin0 -> 1069 bytes
-rw-r--r--demos/misc/joysticks/joysticks.gd18
-rw-r--r--demos/misc/joysticks/joysticks.scnbin4016 -> 4356 bytes
-rw-r--r--demos/misc/joysticks/jsdiagram.xscn115
-rw-r--r--doc/base/classes.xml154
-rw-r--r--drivers/SCsub4
-rw-r--r--drivers/convex_decomp/b2Polygon.cpp4
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp29
-rw-r--r--drivers/gles2/rasterizer_gles2.h3
-rw-r--r--drivers/gles2/shader_gles2.h5
-rw-r--r--drivers/gles2/shaders/canvas.glsl2
-rw-r--r--drivers/jpegd/SCsub (renamed from drivers/jpg/SCsub)5
-rw-r--r--drivers/jpegd/image_loader_jpegd.cpp108
-rw-r--r--drivers/jpegd/image_loader_jpegd.h (renamed from drivers/jpg/image_loader_jpg.h)0
-rw-r--r--drivers/jpegd/jpgd.cpp3172
-rw-r--r--drivers/jpegd/jpgd.h319
-rw-r--r--drivers/jpg/image_loader_jpg.cpp93
-rw-r--r--drivers/jpg/jidctflt.c286
-rw-r--r--drivers/jpg/loadjpeg.c341
-rw-r--r--drivers/jpg/tinyjpeg-internal.h162
-rw-r--r--drivers/jpg/tinyjpeg.c2202
-rw-r--r--drivers/jpg/tinyjpeg.h74
-rw-r--r--drivers/pnm/SCsub10
-rw-r--r--drivers/pnm/bitmap_loader_pnm.cpp235
-rw-r--r--drivers/pnm/bitmap_loader_pnm.h33
-rw-r--r--drivers/register_driver_types.cpp10
-rw-r--r--drivers/rtaudio/RtAudio.cpp6
-rw-r--r--drivers/unix/file_access_unix.cpp2
-rw-r--r--drivers/unix/os_unix.cpp12
-rw-r--r--drivers/unix/os_unix.h2
-rw-r--r--drivers/unix/semaphore_posix.cpp2
-rw-r--r--drivers/unix/thread_posix.cpp11
-rw-r--r--drivers/windows/file_access_windows.cpp2
-rw-r--r--main/input_default.cpp46
-rw-r--r--main/input_default.h9
-rw-r--r--main/main.cpp41
-rwxr-xr-xmethods.py41
-rw-r--r--modules/gdscript/gd_compiler.cpp3
-rw-r--r--modules/gdscript/gd_functions.cpp66
-rw-r--r--modules/gdscript/gd_functions.h2
-rw-r--r--modules/gdscript/gd_parser.cpp7
-rw-r--r--modules/gdscript/gd_script.cpp53
-rw-r--r--modules/gdscript/gd_script.h3
-rw-r--r--modules/gdscript/gd_tokenizer.cpp6
-rw-r--r--modules/gdscript/gd_tokenizer.h1
-rw-r--r--platform/android/AndroidManifest.xml.template8
-rw-r--r--platform/android/SCsub63
-rw-r--r--platform/android/audio_driver_jandroid.cpp4
-rw-r--r--platform/android/build.gradle.template70
-rw-r--r--platform/android/detect.py4
-rw-r--r--platform/android/dir_access_jandroid.cpp4
-rw-r--r--platform/android/export/export.cpp2
-rw-r--r--platform/android/file_access_android.cpp8
-rw-r--r--platform/android/godot_android.cpp22
-rw-r--r--platform/android/java/aidl/com/android/vending/billing/IInAppBillingService.aidl144
-rw-r--r--platform/android/java/ant.properties17
-rw-r--r--platform/android/java/build.properties17
-rw-r--r--platform/android/java/build.xml92
-rw-r--r--platform/android/java/default.properties11
-rw-r--r--platform/android/java/gradle/wrapper/gradle-wrapper.jarbin0 -> 49896 bytes
-rw-r--r--platform/android/java/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xplatform/android/java/gradlew164
-rw-r--r--platform/android/java/gradlew.bat90
-rw-r--r--platform/android/java/my-release-key.keystorebin2218 -> 0 bytes
-rw-r--r--platform/android/java/proguard-project.txt20
-rw-r--r--platform/android/java/proguard.cfg36
-rw-r--r--platform/android/java/res/drawable-hdpi/notify_panel_notification_icon_bg.png (renamed from platform/android/libs/apk_expansion/res/drawable-hdpi/notify_panel_notification_icon_bg.png)bin1027 -> 1027 bytes
-rw-r--r--platform/android/java/res/drawable-mdpi/notify_panel_notification_icon_bg.png (renamed from platform/android/libs/apk_expansion/res/drawable-mdpi/notify_panel_notification_icon_bg.png)bin1125 -> 1125 bytes
-rw-r--r--platform/android/java/res/layout/status_bar_ongoing_event_progress_bar.xml (renamed from platform/android/libs/apk_expansion/res/layout/status_bar_ongoing_event_progress_bar.xml)0
-rw-r--r--platform/android/java/res/values-v11/styles.xml (renamed from platform/android/libs/apk_expansion/res/values-v11/styles.xml)0
-rw-r--r--platform/android/java/res/values-v9/styles.xml (renamed from platform/android/libs/apk_expansion/res/values-v9/styles.xml)0
-rw-r--r--platform/android/java/res/values/strings.xml42
-rw-r--r--platform/android/java/res/values/styles.xml (renamed from platform/android/libs/apk_expansion/res/values/styles.xml)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/AESObfuscator.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/AESObfuscator.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/APKExpansionPolicy.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/APKExpansionPolicy.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/DeviceLimiter.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/DeviceLimiter.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.aidl (renamed from platform/android/libs/play_licensing/aidl/ILicenseResultListener.aidl)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ILicenseResultListener.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/ILicensingService.aidl (renamed from platform/android/libs/play_licensing/aidl/ILicensingService.aidl)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/ILicensingService.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ILicensingService.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/LicenseChecker.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseChecker.java)2
-rw-r--r--platform/android/java/src/com/android/vending/licensing/LicenseCheckerCallback.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseCheckerCallback.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/LicenseValidator.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseValidator.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/NullDeviceLimiter.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/NullDeviceLimiter.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/Obfuscator.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/Obfuscator.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/Policy.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/Policy.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/PreferenceObfuscator.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/PreferenceObfuscator.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/ResponseData.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ResponseData.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/ServerManagedPolicy.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ServerManagedPolicy.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/StrictPolicy.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/StrictPolicy.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/ValidationException.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ValidationException.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/util/Base64.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/util/Base64.java)0
-rw-r--r--platform/android/java/src/com/android/vending/licensing/util/Base64DecoderException.java (renamed from platform/android/libs/play_licensing/src/com/google/android/vending/licensing/util/Base64DecoderException.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/Constants.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/Constants.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/Helpers.java)2
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/IDownloaderService.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IDownloaderService.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/IStub.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IStub.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/SystemFacade.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/SystemFacade.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java)0
-rwxr-xr-xplatform/android/java/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java (renamed from platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java)2
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java)0
-rwxr-xr-xplatform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java)0
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java (renamed from platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java)2
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java (renamed from platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java)2
-rw-r--r--platform/android/java/src/org/godotengine/godot/Dictionary.java (renamed from platform/android/java/src/com/android/godot/Dictionary.java)4
-rw-r--r--platform/android/java/src/org/godotengine/godot/Godot.java (renamed from platform/android/java/src/com/android/godot/Godot.java)6
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java (renamed from platform/android/java/src/com/android/godot/GodotDownloaderAlarmReceiver.java)2
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java (renamed from platform/android/java/src/com/android/godot/GodotDownloaderService.java)2
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotIO.java (renamed from platform/android/java/src/com/android/godot/GodotIO.java)4
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotLib.java (renamed from platform/android/java/src/com/android/godot/GodotLib.java)2
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java (renamed from platform/android/java/src/com/android/godot/GodotPaymentV3.java)4
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotView.java (renamed from platform/android/java/src/com/android/godot/GodotView.java)2
-rw-r--r--platform/android/java/src/org/godotengine/godot/input/GodotEditText.java (renamed from platform/android/java/src/com/android/godot/input/GodotEditText.java)4
-rw-r--r--platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java (renamed from platform/android/java/src/com/android/godot/input/GodotTextInputWrapper.java)4
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java (renamed from platform/android/java/src/com/android/godot/payments/ConsumeTask.java)2
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java (renamed from platform/android/java/src/com/android/godot/payments/GenericConsumeTask.java)2
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java (renamed from platform/android/java/src/com/android/godot/payments/HandlePurchaseTask.java)6
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java (renamed from platform/android/java/src/com/android/godot/payments/PaymentsCache.java)2
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java (renamed from platform/android/java/src/com/android/godot/payments/PaymentsManager.java)8
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java (renamed from platform/android/java/src/com/android/godot/payments/PurchaseTask.java)6
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java (renamed from platform/android/java/src/com/android/godot/payments/ReleaseAllConsumablesTask.java)6
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java (renamed from platform/android/java/src/com/android/godot/payments/ValidateTask.java)14
-rw-r--r--platform/android/java/src/org/godotengine/godot/utils/Crypt.java (renamed from platform/android/java/src/com/android/godot/utils/Crypt.java)2
-rw-r--r--platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java (renamed from platform/android/java/src/com/android/godot/utils/CustomSSLSocketFactory.java)2
-rw-r--r--platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java (renamed from platform/android/java/src/com/android/godot/utils/HttpRequester.java)2
-rw-r--r--platform/android/java/src/org/godotengine/godot/utils/RequestParams.java (renamed from platform/android/java/src/com/android/godot/utils/RequestParams.java)2
-rw-r--r--platform/android/java_class_wrapper.cpp2
-rw-r--r--platform/android/java_glue.cpp56
-rw-r--r--platform/android/java_glue.h36
-rw-r--r--platform/android/libs/apk_expansion/AndroidManifest.xml9
-rw-r--r--platform/android/libs/apk_expansion/build.xml92
-rw-r--r--platform/android/libs/apk_expansion/proguard-project.txt20
-rw-r--r--platform/android/libs/apk_expansion/project.properties13
-rw-r--r--platform/android/libs/apk_expansion/res/values/strings.xml41
-rw-r--r--platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java231
-rw-r--r--platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java101
-rw-r--r--platform/android/libs/downloader_library/.classpath9
-rw-r--r--platform/android/libs/downloader_library/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--platform/android/libs/downloader_library/AndroidManifest.xml9
-rw-r--r--platform/android/libs/downloader_library/build.xml92
-rw-r--r--platform/android/libs/downloader_library/proguard-project.txt20
-rw-r--r--platform/android/libs/downloader_library/project.properties13
-rw-r--r--platform/android/libs/downloader_library/res/drawable-hdpi/notify_panel_notification_icon_bg.pngbin1027 -> 0 bytes
-rw-r--r--platform/android/libs/downloader_library/res/drawable-mdpi/notify_panel_notification_icon_bg.pngbin1125 -> 0 bytes
-rw-r--r--platform/android/libs/downloader_library/res/layout/status_bar_ongoing_event_progress_bar.xml104
-rw-r--r--platform/android/libs/downloader_library/res/values-v11/styles.xml6
-rw-r--r--platform/android/libs/downloader_library/res/values-v9/styles.xml5
-rw-r--r--platform/android/libs/downloader_library/res/values/strings.xml41
-rw-r--r--platform/android/libs/downloader_library/res/values/styles.xml25
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Constants.java236
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java80
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java277
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java181
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Helpers.java306
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java126
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderService.java83
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IStub.java41
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/SystemFacade.java123
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java536
-rwxr-xr-xplatform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java112
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java30
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java92
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java963
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java1341
-rwxr-xr-xplatform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java510
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java200
-rw-r--r--platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java116
-rw-r--r--platform/android/libs/google_play_services/.classpath9
-rw-r--r--platform/android/libs/google_play_services/AndroidManifest.xml9
-rw-r--r--platform/android/libs/google_play_services/README.txt17
-rw-r--r--platform/android/libs/google_play_services/build.xml92
-rw-r--r--platform/android/libs/google_play_services/libs/google-play-services.jarbin1881748 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/libs/google-play-services.jar.properties1
-rw-r--r--platform/android/libs/google_play_services/proguard-project.txt20
-rw-r--r--platform/android/libs/google_play_services/proguard.txt20
-rw-r--r--platform/android/libs/google_play_services/project.properties15
-rw-r--r--platform/android/libs/google_play_services/res/color/common_signin_btn_text_dark.xml18
-rw-r--r--platform/android/libs/google_play_services/res/color/common_signin_btn_text_light.xml18
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_dark.9.pngbin1811 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_dark.9.pngbin1846 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_light.9.pngbin1846 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_light.9.pngbin1811 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_dark.9.pngbin2100 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_light.9.pngbin2075 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_dark.9.pngbin2050 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_light.9.pngbin2049 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_dark.9.pngbin2224 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_light.9.pngbin2331 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_dark.9.pngbin1927 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_dark.9.pngbin1957 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_light.9.pngbin1957 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_light.9.pngbin1927 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_dark.9.pngbin2206 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_light.9.pngbin2182 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_dark.9.pngbin2185 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_light.9.pngbin2158 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_dark.9.pngbin2374 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_light.9.pngbin2483 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_medium_off_client.pngbin1187 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_small_off_client.pngbin841 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_standard_off_client.pngbin1498 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_tall_off_client.pngbin1140 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_dark.9.pngbin1202 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_dark.9.pngbin1236 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_light.9.pngbin1236 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_light.9.pngbin1202 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_dark.9.pngbin1389 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_light.9.pngbin1362 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_dark.9.pngbin1369 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_light.9.pngbin1345 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_dark.9.pngbin1465 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_light.9.pngbin1521 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_dark.9.pngbin1309 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_dark.9.pngbin1316 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_light.9.pngbin1316 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_light.9.pngbin1309 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_dark.9.pngbin1461 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_light.9.pngbin1463 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_dark.9.pngbin1463 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_light.9.pngbin1455 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_dark.9.pngbin1556 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_light.9.pngbin1623 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_medium_off_client.pngbin751 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_small_off_client.pngbin581 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_standard_off_client.pngbin996 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_tall_off_client.pngbin789 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_dark.9.pngbin2438 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_dark.9.pngbin2457 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_light.9.pngbin2457 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_light.9.pngbin2438 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_dark.9.pngbin2886 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_light.9.pngbin2908 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_dark.9.pngbin2847 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_light.9.pngbin2888 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_dark.9.pngbin3133 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_light.9.pngbin3301 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_dark.9.pngbin2569 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_dark.9.pngbin2571 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_light.9.pngbin2571 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_light.9.pngbin2569 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_dark.9.pngbin2939 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_light.9.pngbin2947 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_dark.9.pngbin2931 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_light.9.pngbin2944 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_dark.9.pngbin3255 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_light.9.pngbin3384 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_medium_off_client.pngbin1598 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_small_off_client.pngbin1205 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_standard_off_client.pngbin2074 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_tall_off_client.pngbin1741 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_dark.9.pngbin4988 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_dark.9.pngbin5092 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_light.9.pngbin5092 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_light.9.pngbin4988 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_dark.9.pngbin6558 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_light.9.pngbin6216 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_dark.9.pngbin6530 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_light.9.pngbin6234 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_dark.9.pngbin7015 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_light.9.pngbin7352 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_dark.9.pngbin5637 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_dark.9.pngbin5572 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_light.9.pngbin5572 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_light.9.pngbin5637 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_dark.9.pngbin6958 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_light.9.pngbin6647 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_dark.9.pngbin6975 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_light.9.pngbin6713 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_dark.9.pngbin7569 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_light.9.pngbin7944 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_medium_off_client.pngbin5828 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_small_off_client.pngbin4279 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_standard_off_client.pngbin7439 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_tall_off_client.pngbin6204 -> 0 bytes
-rw-r--r--platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_dark.xml18
-rw-r--r--platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_light.xml18
-rw-r--r--platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_dark.xml18
-rw-r--r--platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_light.xml18
-rw-r--r--platform/android/libs/google_play_services/res/values-af/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-am/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-ar/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-be/strings.xml36
-rw-r--r--platform/android/libs/google_play_services/res/values-bg/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-ca/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-cs/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-da/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-de/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-el/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-en-rGB/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-en-rIN/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-es-rUS/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-es/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-et-rEE/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-fa/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-fi/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-fr-rCA/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-fr/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-hi/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-hr/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-hu/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-hy-rAM/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-in/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-it/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-iw/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-ja/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-ka-rGE/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-km-rKH/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-ko/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-lo-rLA/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-lt/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-lv/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-mn-rMN/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-ms-rMY/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-nb/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-nl/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-pl/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-pt-rBR/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-pt-rPT/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-pt/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-ro/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-ru/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-sk/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-sl/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-sr/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-sv/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-sw/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-th/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-tl/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-tr/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-uk/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-vi/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-zh-rCN/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-zh-rHK/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-zh-rTW/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values-zu/strings.xml31
-rw-r--r--platform/android/libs/google_play_services/res/values/ads_attrs.xml22
-rw-r--r--platform/android/libs/google_play_services/res/values/colors.xml14
-rw-r--r--platform/android/libs/google_play_services/res/values/maps_attrs.xml26
-rw-r--r--platform/android/libs/google_play_services/res/values/strings.xml111
-rw-r--r--platform/android/libs/google_play_services/res/values/version.xml4
-rw-r--r--platform/android/libs/google_play_services/src/android/UnusedStub.java21
-rw-r--r--platform/android/libs/play_licensing/AndroidManifest.xml24
-rw-r--r--platform/android/libs/play_licensing/build.xml92
-rw-r--r--platform/android/libs/play_licensing/proguard-project.txt20
-rw-r--r--platform/android/libs/play_licensing/project.properties12
-rw-r--r--platform/android/project.properties.template15
-rw-r--r--platform/haiku/audio_driver_media_kit.cpp3
-rw-r--r--platform/haiku/haiku_direct_window.cpp4
-rw-r--r--platform/nacl/os_nacl.cpp3
-rw-r--r--platform/windows/SCsub2
-rw-r--r--platform/windows/detect.py2
-rw-r--r--platform/windows/joystick.h3
-rw-r--r--platform/windows/os_windows.cpp20
-rw-r--r--platform/windows/os_windows.h5
-rw-r--r--platform/winrt/os_winrt.cpp3
-rw-r--r--platform/x11/detect.py37
-rw-r--r--platform/x11/joystick_linux.cpp13
-rw-r--r--platform/x11/joystick_linux.h1
-rw-r--r--platform/x11/os_x11.cpp26
-rw-r--r--platform/x11/os_x11.h4
-rw-r--r--platform/x11/platform_config.h1
-rw-r--r--scene/2d/area_2d.cpp8
-rw-r--r--scene/2d/canvas_item.cpp5
-rw-r--r--scene/2d/collision_polygon_2d.cpp2
-rw-r--r--scene/2d/navigation2d.cpp12
-rw-r--r--scene/2d/path_2d.cpp2
-rw-r--r--scene/2d/physics_body_2d.cpp25
-rw-r--r--scene/2d/physics_body_2d.h2
-rw-r--r--scene/2d/screen_button.cpp8
-rw-r--r--scene/3d/camera.cpp111
-rw-r--r--scene/3d/camera.h5
-rw-r--r--scene/3d/physics_body.cpp24
-rw-r--r--scene/3d/physics_body.h2
-rw-r--r--scene/3d/spatial_stream_player.cpp2
-rw-r--r--scene/audio/stream_player.cpp5
-rw-r--r--scene/gui/button.cpp4
-rw-r--r--scene/gui/control.cpp11
-rw-r--r--scene/gui/control.h2
-rw-r--r--scene/gui/file_dialog.cpp41
-rw-r--r--scene/gui/file_dialog.h2
-rw-r--r--scene/gui/line_edit.cpp63
-rw-r--r--scene/gui/range.cpp22
-rw-r--r--scene/gui/range.h4
-rw-r--r--scene/gui/tabs.cpp321
-rw-r--r--scene/gui/tabs.h22
-rw-r--r--scene/gui/text_edit.cpp84
-rw-r--r--scene/main/node.cpp2
-rw-r--r--scene/main/scene_main_loop.cpp13
-rw-r--r--scene/main/scene_main_loop.h4
-rw-r--r--scene/main/viewport.cpp4
-rw-r--r--scene/register_scene_types.cpp5
-rw-r--r--scene/resources/bit_mask.cpp54
-rw-r--r--scene/resources/bit_mask.h11
-rw-r--r--scene/resources/default_theme/default_theme.cpp1
-rw-r--r--scene/resources/default_theme/tab_close.pngbin0 -> 398 bytes
-rw-r--r--scene/resources/default_theme/theme_data.h5
-rw-r--r--scene/resources/packed_scene.cpp10
-rw-r--r--scene/resources/packed_scene.h6
-rw-r--r--scene/resources/sample.cpp6
-rw-r--r--scene/resources/scene_format_text.cpp31
-rw-r--r--scene/resources/shader_graph.cpp5
-rw-r--r--servers/physics/body_sw.cpp6
-rw-r--r--servers/physics/body_sw.h2
-rw-r--r--servers/physics/shape_sw.cpp4
-rw-r--r--servers/physics/space_sw.cpp4
-rw-r--r--servers/physics/space_sw.h2
-rw-r--r--servers/physics_2d/body_2d_sw.cpp27
-rw-r--r--servers/physics_2d/body_2d_sw.h3
-rw-r--r--servers/physics_2d/physics_2d_server_sw.cpp3
-rw-r--r--servers/physics_2d/physics_2d_server_sw.h3
-rw-r--r--servers/physics_2d/space_2d_sw.cpp8
-rw-r--r--servers/physics_server.h2
-rw-r--r--tools/doc/doc_data.cpp12
-rw-r--r--tools/editor/animation_editor.cpp8
-rw-r--r--tools/editor/code_editor.cpp1
-rw-r--r--tools/editor/editor_data.cpp4
-rw-r--r--tools/editor/editor_file_dialog.cpp45
-rw-r--r--tools/editor/editor_file_dialog.h2
-rw-r--r--tools/editor/editor_file_system.cpp948
-rw-r--r--tools/editor/editor_file_system.h87
-rw-r--r--tools/editor/editor_import_export.cpp42
-rw-r--r--tools/editor/editor_import_export.h4
-rw-r--r--tools/editor/editor_log.cpp2
-rw-r--r--tools/editor/editor_node.cpp293
-rw-r--r--tools/editor/editor_node.h14
-rw-r--r--tools/editor/icons/icon_create_new_scene_from.pngbin0 -> 588 bytes
-rw-r--r--tools/editor/io_plugins/editor_font_import_plugin.cpp22
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp64
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.h2
-rw-r--r--tools/editor/plugins/color_ramp_editor_plugin.cpp17
-rw-r--r--tools/editor/plugins/color_ramp_editor_plugin.h3
-rw-r--r--tools/editor/plugins/editor_preview_plugins.cpp76
-rw-r--r--tools/editor/plugins/editor_preview_plugins.h11
-rw-r--r--tools/editor/plugins/path_2d_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/polygon_2d_editor_plugin.cpp1
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp10
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp91
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.h1
-rw-r--r--tools/editor/plugins/sprite_frames_editor_plugin.cpp3
-rw-r--r--tools/editor/plugins/sprite_region_editor_plugin.cpp55
-rw-r--r--tools/editor/plugins/sprite_region_editor_plugin.h10
-rw-r--r--tools/editor/project_export.cpp1
-rw-r--r--tools/editor/project_manager.cpp2
-rw-r--r--tools/editor/project_settings.cpp116
-rw-r--r--tools/editor/project_settings.h9
-rw-r--r--tools/editor/property_editor.cpp254
-rw-r--r--tools/editor/property_editor.h13
-rw-r--r--tools/editor/quick_open.cpp31
-rw-r--r--tools/editor/quick_open.h5
-rw-r--r--tools/editor/reparent_dialog.cpp13
-rw-r--r--tools/editor/reparent_dialog.h7
-rw-r--r--tools/editor/scene_tree_dock.cpp166
-rw-r--r--tools/editor/scene_tree_dock.h6
-rw-r--r--tools/editor/scenes_dock.cpp2
-rw-r--r--tools/editor/script_editor_debugger.cpp3
-rw-r--r--tools/editor/settings_config_dialog.cpp46
-rw-r--r--tools/editor/settings_config_dialog.h2
-rw-r--r--tools/export/blender25/io_scene_dae/export_dae.py2
506 files changed, 7801 insertions, 13799 deletions
diff --git a/SConstruct b/SConstruct
index 95ad0010a2..b047e961f2 100644
--- a/SConstruct
+++ b/SConstruct
@@ -66,20 +66,27 @@ env_base=Environment(tools=custom_tools,ENV = {'PATH' : os.environ['PATH']});
#env_base=Environment(tools=custom_tools);
env_base.global_defaults=global_defaults
-env_base.android_source_modules=[]
-env_base.android_source_files=[]
-env_base.android_module_libraries=[]
+env_base.android_maven_repos=[]
+env_base.android_dependencies=[]
+env_base.android_java_dirs=[]
+env_base.android_res_dirs=[]
+env_base.android_aidl_dirs=[]
+env_base.android_jni_dirs=[]
env_base.android_manifest_chunk=""
env_base.android_permission_chunk=""
env_base.android_appattributes_chunk=""
env_base.disabled_modules=[]
-env_base.__class__.android_module_source = methods.android_module_source
-env_base.__class__.android_module_library = methods.android_module_library
-env_base.__class__.android_module_file = methods.android_module_file
-env_base.__class__.android_module_manifest = methods.android_module_manifest
-env_base.__class__.android_module_permission = methods.android_module_permission
-env_base.__class__.android_module_attribute = methods.android_module_attribute
+
+env_base.__class__.android_add_maven_repository=methods.android_add_maven_repository
+env_base.__class__.android_add_dependency=methods.android_add_dependency
+env_base.__class__.android_add_java_dir=methods.android_add_java_dir
+env_base.__class__.android_add_res_dir=methods.android_add_res_dir
+env_base.__class__.android_add_aidl_dir=methods.android_add_aidl_dir
+env_base.__class__.android_add_jni_dir=methods.android_add_jni_dir
+env_base.__class__.android_add_to_manifest = methods.android_add_to_manifest
+env_base.__class__.android_add_to_permissions = methods.android_add_to_permissions
+env_base.__class__.android_add_to_attributes = methods.android_add_to_attributes
env_base.__class__.disable_module = methods.disable_module
env_base.__class__.add_source_files = methods.add_source_files
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index f1edc3d7d7..f951237971 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -494,8 +494,8 @@ uint64_t _OS::get_unix_time() const {
return OS::get_singleton()->get_unix_time();
};
-uint64_t _OS::get_system_time_msec() const {
- return OS::get_singleton()->get_system_time_msec();
+uint64_t _OS::get_system_time_secs() const {
+ return OS::get_singleton()->get_system_time_secs();
}
void _OS::delay_usec(uint32_t p_usec) const {
@@ -810,7 +810,7 @@ void _OS::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_time","utc"),&_OS::get_time,DEFVAL(false));
ObjectTypeDB::bind_method(_MD("get_time_zone_info"),&_OS::get_time_zone_info);
ObjectTypeDB::bind_method(_MD("get_unix_time"),&_OS::get_unix_time);
- ObjectTypeDB::bind_method(_MD("get_system_time_msec"), &_OS::get_system_time_msec);
+ ObjectTypeDB::bind_method(_MD("get_system_time_secs"), &_OS::get_system_time_secs);
ObjectTypeDB::bind_method(_MD("set_icon","icon"),&_OS::set_icon);
@@ -1509,6 +1509,7 @@ void _File::_bind_methods() {
BIND_CONSTANT( READ );
BIND_CONSTANT( WRITE );
BIND_CONSTANT( READ_WRITE );
+ BIND_CONSTANT( WRITE_READ );
}
_File::_File(){
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 172f33dac5..62572d7761 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -208,7 +208,7 @@ public:
Dictionary get_time(bool utc) const;
Dictionary get_time_zone_info() const;
uint64_t get_unix_time() const;
- uint64_t get_system_time_msec() const;
+ uint64_t get_system_time_secs() const;
int get_static_memory_usage() const;
int get_static_memory_peak_usage() const;
@@ -329,6 +329,7 @@ public:
READ=1,
WRITE=2,
READ_WRITE=3,
+ WRITE_READ=7,
};
Error open_encrypted(const String& p_path, int p_mode_flags,const Vector<uint8_t>& p_key);
diff --git a/core/command_queue_mt.h b/core/command_queue_mt.h
index 84c3687b08..4fd33e3a55 100644
--- a/core/command_queue_mt.h
+++ b/core/command_queue_mt.h
@@ -983,7 +983,7 @@ public:
void flush_all() {
- ERR_FAIL_COND(sync);
+ //ERR_FAIL_COND(sync);
lock();
while (true) {
bool exit = !flush_one();
diff --git a/core/globals.cpp b/core/globals.cpp
index 17b139d1ad..1e60854f28 100644
--- a/core/globals.cpp
+++ b/core/globals.cpp
@@ -638,7 +638,9 @@ static Variant _decode_variant(const String& p_string) {
InputEvent ie;
ie.type=InputEvent::JOYSTICK_MOTION;
ie.device=params[0].to_int();
- ie.joy_motion.axis=params[1].to_int();
+ int axis = params[1].to_int();;
+ ie.joy_motion.axis=axis>>1;
+ ie.joy_motion.axis_value=axis&1?1:-1;
return ie;
}
@@ -1029,7 +1031,7 @@ static String _encode_variant(const Variant& p_variant) {
} break;
case InputEvent::JOYSTICK_MOTION: {
- return "jaxis("+itos(ev.device)+", "+itos(ev.joy_motion.axis)+")";
+ return "jaxis("+itos(ev.device)+", "+itos(ev.joy_motion.axis * 2 + (ev.joy_motion.axis_value<0?0:1))+")";
} break;
default: {
diff --git a/core/input_map.cpp b/core/input_map.cpp
index 6feec9af95..d4560a1e1b 100644
--- a/core/input_map.cpp
+++ b/core/input_map.cpp
@@ -204,6 +204,64 @@ bool InputMap::event_is_action(const InputEvent& p_event, const StringName& p_ac
return _find_event(E->get().inputs,p_event)!=NULL;
}
+bool InputMap::event_is_joy_motion_action_pressed(const InputEvent& p_event) const {
+
+ ERR_FAIL_COND_V(p_event.type!=InputEvent::JOYSTICK_MOTION,false);
+ bool pressed=false;
+
+ //this could be optimized by having a separate list of joymotions?
+
+ for (Map<StringName, Action>::Element *A=input_map.front();A;A=A->next()) {
+
+ for (List<InputEvent>::Element *E=A->get().inputs.front();E;E=E->next()) {
+
+ const InputEvent& e=E->get();
+ if(e.type!=p_event.type)
+ continue;
+ if (e.type!=InputEvent::KEY && e.device!=p_event.device)
+ continue;
+
+ switch(p_event.type) {
+
+ case InputEvent::KEY: {
+
+ if (e.key.scancode==p_event.key.scancode && e.key.mod == p_event.key.mod)
+ return e.key.pressed;
+
+ } break;
+ case InputEvent::JOYSTICK_BUTTON: {
+
+ if (e.joy_button.button_index==p_event.joy_button.button_index) {
+ return e.joy_button.pressed;
+ }
+
+ } break;
+ case InputEvent::MOUSE_BUTTON: {
+
+ if (e.mouse_button.button_index==p_event.mouse_button.button_index) {
+ return e.mouse_button.pressed;
+ }
+
+ } break;
+ case InputEvent::JOYSTICK_MOTION: {
+
+ if (e.joy_motion.axis==p_event.joy_motion.axis) {
+ if (
+ (e.joy_motion.axis_value * p_event.joy_motion.axis_value >0) && //same axis
+ ABS(e.joy_motion.axis_value)>0.5 && ABS(p_event.joy_motion.axis_value)>0.5 )
+ pressed=true;
+ }
+
+ } break;
+ }
+
+ }
+ }
+
+ return pressed;
+
+}
+
void InputMap::load_from_globals() {
input_map.clear();;
diff --git a/core/input_map.h b/core/input_map.h
index c803d5bf04..5cd1e41922 100644
--- a/core/input_map.h
+++ b/core/input_map.h
@@ -68,6 +68,7 @@ public:
const List<InputEvent> *get_action_list(const StringName& p_action);
bool event_is_action(const InputEvent& p_event, const StringName& p_action) const;
+ bool event_is_joy_motion_action_pressed(const InputEvent& p_event) const;
void load_from_globals();
diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp
index f32d006cba..fd20ec9404 100644
--- a/core/io/config_file.cpp
+++ b/core/io/config_file.cpp
@@ -127,6 +127,8 @@ Error ConfigFile::save(const String& p_path){
FileAccess *file = FileAccess::open(p_path,FileAccess::WRITE,&err);
if (err) {
+ if (file)
+ memdelete(file);
return err;
}
@@ -173,9 +175,15 @@ Error ConfigFile::load(const String& p_path) {
while(true) {
- err = VariantParser::parse_tag_assign_eof(&stream,lines,error_text,next_tag,assign,value,NULL);
- if (err==ERR_FILE_EOF)
+ assign=Variant();
+ next_tag.fields.clear();
+ next_tag.name=String();
+
+ err = VariantParser::parse_tag_assign_eof(&stream,lines,error_text,next_tag,assign,value,NULL,true);
+ if (err==ERR_FILE_EOF) {
+ memdelete(f);
return OK;
+ }
else if (err!=OK) {
ERR_PRINTS("ConfgFile::load - "+p_path+":"+itos(lines)+" error: "+error_text);
memdelete(f);
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 4d8cf121ee..19a7286dcf 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -248,7 +248,7 @@ Error HTTPClient::poll(){
status=STATUS_SSL_HANDSHAKE_ERROR;
return ERR_CANT_CONNECT;
}
- print_line("SSL! TURNED ON!");
+ //print_line("SSL! TURNED ON!");
connection=ssl;
}
status=STATUS_CONNECTED;
@@ -295,7 +295,7 @@ Error HTTPClient::poll(){
response_str.push_back(0);
String response;
response.parse_utf8((const char*)response_str.ptr());
- print_line("END OF RESPONSE? :\n"+response+"\n------");
+ //print_line("END OF RESPONSE? :\n"+response+"\n------");
Vector<String> responses = response.split("\n");
body_size=0;
chunked=false;
@@ -307,16 +307,17 @@ Error HTTPClient::poll(){
for(int i=0;i<responses.size();i++) {
String s = responses[i].strip_edges();
+ s = s.to_lower();
if (s.length()==0)
continue;
- if (s.begins_with("Content-Length:")) {
+ if (s.begins_with("content-length:")) {
body_size = s.substr(s.find(":")+1,s.length()).strip_edges().to_int();
body_left=body_size;
}
- if (s.begins_with("Transfer-Encoding:")) {
+ if (s.begins_with("transfer-encoding:")) {
String encoding = s.substr(s.find(":")+1,s.length()).strip_edges();
- print_line("TRANSFER ENCODING: "+encoding);
+ //print_line("TRANSFER ENCODING: "+encoding);
if (encoding=="chunked") {
chunked=true;
}
diff --git a/core/io/json.cpp b/core/io/json.cpp
index 45a97ed720..f9a8638d06 100644
--- a/core/io/json.cpp
+++ b/core/io/json.cpp
@@ -86,7 +86,7 @@ String JSON::_print_var(const Variant& p_var) {
s+="}";
return s;
};
- default: return "\""+String(p_var).c_escape()+"\"";
+ default: return "\""+String(p_var).json_escape()+"\"";
}
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 796dcde3d0..c008c3f9a4 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -725,7 +725,8 @@ Error ResourceInteractiveLoaderBinary::poll(){
}
} else {
- path=res_path;
+ if (!ResourceCache::has(res_path))
+ path=res_path;
}
uint64_t offset = internal_resources[s].offset;
diff --git a/core/io/resource_format_xml.cpp b/core/io/resource_format_xml.cpp
index 74813d24fa..8c8d79948a 100644
--- a/core/io/resource_format_xml.cpp
+++ b/core/io/resource_format_xml.cpp
@@ -1570,7 +1570,9 @@ Error ResourceInteractiveLoaderXML::poll() {
if (main) {
f->close();
resource=res;
- resource->set_path(res_path);
+ if (!ResourceCache::has(res_path)) {
+ resource->set_path(res_path);
+ }
error=ERR_FILE_EOF;
return error;
diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp
index 2f0c1a6512..20d9db3375 100644
--- a/core/math/math_funcs.cpp
+++ b/core/math/math_funcs.cpp
@@ -207,9 +207,15 @@ double Math::ceil(double p_x) {
int Math::decimals(double p_step) {
int max=4;
+ double llimit = Math::pow(0.1,max);
+ double ulimit = 1.0-llimit;
int i=0;
- while( (p_step - Math::floor(p_step)) != 0.0 && max) {
-
+ while( max) {
+
+ float d = absf(p_step) - Math::floor(absf(p_step));
+
+ if (d<llimit || d>ulimit)
+ break;
p_step*=10.0;
max--;
i++;
diff --git a/core/message_queue.cpp b/core/message_queue.cpp
index 8f2dd622ad..c69021f4f0 100644
--- a/core/message_queue.cpp
+++ b/core/message_queue.cpp
@@ -28,7 +28,7 @@
/*************************************************************************/
#include "message_queue.h"
#include "globals.h"
-
+#include "script_language.h"
MessageQueue *MessageQueue::singleton=NULL;
MessageQueue *MessageQueue::get_singleton() {
@@ -36,26 +36,11 @@ MessageQueue *MessageQueue::get_singleton() {
return singleton;
}
-Error MessageQueue::push_call(ObjectID p_id, const StringName& p_method, VARIANT_ARG_DECLARE) {
+Error MessageQueue::push_call(ObjectID p_id,const StringName& p_method,const Variant** p_args,int p_argcount,bool p_show_error) {
_THREAD_SAFE_METHOD_
- uint8_t room_needed=sizeof(Message);
- int args=0;
- if (p_arg5.get_type()!=Variant::NIL)
- args=5;
- else if (p_arg4.get_type()!=Variant::NIL)
- args=4;
- else if (p_arg3.get_type()!=Variant::NIL)
- args=3;
- else if (p_arg2.get_type()!=Variant::NIL)
- args=2;
- else if (p_arg1.get_type()!=Variant::NIL)
- args=1;
- else
- args=0;
-
- room_needed+=sizeof(Variant)*args;
+ int room_needed=sizeof(Message)+sizeof(Variant)*p_argcount;
if ((buffer_end+room_needed) >= buffer_size) {
String type;
@@ -65,53 +50,43 @@ Error MessageQueue::push_call(ObjectID p_id, const StringName& p_method, VARIANT
statistics();
}
+
ERR_FAIL_COND_V( (buffer_end+room_needed) >= buffer_size , ERR_OUT_OF_MEMORY );
Message * msg = memnew_placement( &buffer[ buffer_end ], Message );
- msg->args=args;
+ msg->args=p_argcount;
msg->instance_ID=p_id;
msg->target=p_method;
msg->type=TYPE_CALL;
- buffer_end+=sizeof(Message);
+ if (p_show_error)
+ msg->type|=FLAG_SHOW_ERROR;
+ buffer_end+=sizeof(Message);
- if (args>=1) {
+ for(int i=0;i<p_argcount;i++) {
Variant * v = memnew_placement( &buffer[ buffer_end ], Variant );
buffer_end+=sizeof(Variant);
- *v=p_arg1;
- }
-
- if (args>=2) {
+ *v=*p_args[i];
- Variant * v = memnew_placement( &buffer[ buffer_end ], Variant );
- buffer_end+=sizeof(Variant);
- *v=p_arg2;
}
- if (args>=3) {
+ return OK;
+}
- Variant * v = memnew_placement( &buffer[ buffer_end ], Variant );
- buffer_end+=sizeof(Variant);
- *v=p_arg3;
+Error MessageQueue::push_call(ObjectID p_id, const StringName& p_method, VARIANT_ARG_DECLARE) {
- }
+ VARIANT_ARGPTRS;
- if (args>=4) {
+ int argc=0;
- Variant * v = memnew_placement( &buffer[ buffer_end ], Variant );
- buffer_end+=sizeof(Variant);
- *v=p_arg4;
+ for(int i=0;i<VARIANT_ARG_MAX;i++) {
+ if (argptr[i]->get_type()==Variant::NIL)
+ break;
+ argc++;
}
- if (args>=5) {
+ return push_call(p_id,p_method,argptr,argc,false);
- Variant * v = memnew_placement( &buffer[ buffer_end ], Variant );
- buffer_end+=sizeof(Variant);
- *v=p_arg5;
- }
-
-
- return OK;
}
Error MessageQueue::push_set(ObjectID p_id, const StringName& p_prop, const Variant& p_value) {
@@ -212,7 +187,7 @@ void MessageQueue::statistics() {
if (target!=NULL) {
- switch(message->type) {
+ switch(message->type&FLAG_MASK) {
case TYPE_CALL: {
@@ -251,7 +226,7 @@ void MessageQueue::statistics() {
read_pos+=sizeof(Message);
- if (message->type!=TYPE_NOTIFICATION)
+ if ((message->type&FLAG_MASK)!=TYPE_NOTIFICATION)
read_pos+=sizeof(Variant)*message->args;
}
@@ -322,6 +297,26 @@ int MessageQueue::get_max_buffer_usage() const {
return buffer_max_used;
}
+
+void MessageQueue::_call_function(Object* p_target, const StringName& p_func, const Variant *p_args, int p_argcount,bool p_show_error) {
+
+ const Variant **argptrs=NULL;
+ if (p_argcount) {
+ argptrs = (const Variant**)alloca(sizeof(Variant*)*p_argcount);
+ for(int i=0;i<p_argcount;i++) {
+ argptrs[i]=&p_args[i];
+ }
+ }
+
+ Variant::CallError ce;
+ p_target->call(p_func,argptrs,p_argcount,ce);
+ if (p_show_error && ce.error!=Variant::CallError::CALL_OK) {
+
+ ERR_PRINTS("Error calling deferred method: "+Variant::get_call_error_text(p_target,p_func,argptrs,p_argcount,ce));
+
+ }
+}
+
void MessageQueue::flush() {
@@ -347,7 +342,7 @@ void MessageQueue::flush() {
if (target!=NULL) {
- switch(message->type) {
+ switch(message->type&FLAG_MASK) {
case TYPE_CALL: {
Variant *args= (Variant*)(message+1);
@@ -355,12 +350,7 @@ void MessageQueue::flush() {
// messages don't expect a return value
- target->call( message->target,
- (message->args>=1) ? args[0] : Variant(),
- (message->args>=2) ? args[1] : Variant(),
- (message->args>=3) ? args[2] : Variant(),
- (message->args>=4) ? args[3] : Variant(),
- (message->args>=5) ? args[4] : Variant() );
+ _call_function(target,message->target,args,message->args,message->type&FLAG_SHOW_ERROR);
for(int i=0;i<message->args;i++) {
args[i].~Variant();
@@ -386,7 +376,7 @@ void MessageQueue::flush() {
}
uint32_t advance = sizeof(Message);
- if (message->type!=TYPE_NOTIFICATION)
+ if ((message->type&FLAG_MASK)!=TYPE_NOTIFICATION)
advance+=sizeof(Variant)*message->args;
message->~Message();
@@ -423,14 +413,14 @@ MessageQueue::~MessageQueue() {
Message *message = (Message*)&buffer[ read_pos ];
Variant *args= (Variant*)(message+1);
int argc = message->args;
- if (message->type!=TYPE_NOTIFICATION) {
+ if ((message->type&FLAG_MASK)!=TYPE_NOTIFICATION) {
for (int i=0;i<argc;i++)
args[i].~Variant();
}
message->~Message();
read_pos+=sizeof(Message);
- if (message->type!=TYPE_NOTIFICATION)
+ if ((message->type&FLAG_MASK)!=TYPE_NOTIFICATION)
read_pos+=sizeof(Variant)*message->args;
}
diff --git a/core/message_queue.h b/core/message_queue.h
index b6b74d2bd2..6a3ec79732 100644
--- a/core/message_queue.h
+++ b/core/message_queue.h
@@ -46,7 +46,10 @@ class MessageQueue {
enum {
TYPE_CALL,
TYPE_NOTIFICATION,
- TYPE_SET
+ TYPE_SET,
+ FLAG_SHOW_ERROR=1<<14,
+ FLAG_MASK=FLAG_SHOW_ERROR-1
+
};
struct Message {
@@ -65,12 +68,14 @@ class MessageQueue {
uint32_t buffer_max_used;
uint32_t buffer_size;
+ void _call_function(Object* p_target,const StringName& p_func,const Variant *p_args,int p_argcount,bool p_show_error);
static MessageQueue *singleton;
public:
static MessageQueue *get_singleton();
+ Error push_call(ObjectID p_id,const StringName& p_method,const Variant** p_args,int p_argcount,bool p_show_error=false);
Error push_call(ObjectID p_id, const StringName& p_method, VARIANT_ARG_LIST);
Error push_notification(ObjectID p_id, int p_notification);
Error push_set(ObjectID p_id, const StringName& p_prop, const Variant& p_value);
diff --git a/core/object.cpp b/core/object.cpp
index ad9fdf73b9..c92fc35b24 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -512,17 +512,10 @@ Variant Object::_call_deferred_bind(const Variant** p_args, int p_argcount, Vari
r_error.error=Variant::CallError::CALL_OK;
- StringName signal = *p_args[0];
-
- Variant v[VARIANT_ARG_MAX];
-
-
- for(int i=0;i<MIN(5,p_argcount-1);i++) {
+ StringName method = *p_args[0];
- v[i]=*p_args[i+1];
- }
+ MessageQueue::get_singleton()->push_call(get_instance_ID(),method,&p_args[1],p_argcount-1);
- call_deferred(signal,v[0],v[1],v[2],v[3],v[4]);
return Variant();
}
@@ -839,6 +832,8 @@ void Object::call_multilevel(const StringName& p_name, VARIANT_ARG_DECLARE) {
Variant Object::call(const StringName& p_method,const Variant** p_args,int p_argcount,Variant::CallError &r_error) {
+ r_error.error=Variant::CallError::CALL_OK;
+
if (p_method==CoreStringNames::get_singleton()->_free) {
//free must be here, before anything, always ready
#ifdef DEBUG_ENABLED
@@ -1130,21 +1125,22 @@ Variant Object::_emit_signal(const Variant** p_args, int p_argcount, Variant::Ca
StringName signal = *p_args[0];
- Variant v[VARIANT_ARG_MAX];
-
- for(int i=0;i<MIN(5,p_argcount-1);i++) {
+ const Variant**args=NULL;
- v[i]=*p_args[i+1];
+ int argc=p_argcount-1;
+ if (argc) {
+ args=&p_args[1];
}
- emit_signal(signal,v[0],v[1],v[2],v[3],v[4]);
+ emit_signal(signal,args,argc);
+
return Variant();
-}
+}
-void Object::emit_signal(const StringName& p_name,VARIANT_ARG_DECLARE) {
+void Object::emit_signal(const StringName& p_name,const Variant** p_args,int p_argcount) {
if (_block_signals)
return; //no emit, signals blocked
@@ -1167,10 +1163,12 @@ void Object::emit_signal(const StringName& p_name,VARIANT_ARG_DECLARE) {
OBJ_DEBUG_LOCK
+ Vector<const Variant*> bind_mem;
+
+
for(int i=0;i<ssize;i++) {
const Connection &c = slot_map.getv(i).conn;
- VARIANT_ARGPTRS
Object *target;
#ifdef DEBUG_ENABLED
@@ -1181,21 +1179,37 @@ void Object::emit_signal(const StringName& p_name,VARIANT_ARG_DECLARE) {
#endif
- int bind_count=c.binds.size();
- int bind=0;
+ const Variant **args=p_args;
+ int argc=p_argcount;
- for(int i=0;bind < bind_count && i<VARIANT_ARG_MAX;i++) {
+ if (c.binds.size()) {
+ //handle binds
+ bind_mem.resize(p_argcount+c.binds.size());
- if (argptr[i]->get_type()==Variant::NIL) {
- argptr[i]=&c.binds[bind];
- bind++;
+ for(int j=0;j<p_argcount;j++) {
+ bind_mem[j]=p_args[j];
+ }
+ for(int j=0;j<c.binds.size();j++) {
+ bind_mem[p_argcount+j]=&c.binds[j];
}
+
+ args=bind_mem.ptr();
+ argc=bind_mem.size();
}
if (c.flags&CONNECT_DEFERRED) {
- MessageQueue::get_singleton()->push_call(target->get_instance_ID(),c.method,VARIANT_ARGPTRS_PASS);
+ MessageQueue::get_singleton()->push_call(target->get_instance_ID(),c.method,args,argc,true);
} else {
- target->call( c.method, VARIANT_ARGPTRS_PASS );
+ Variant::CallError ce;
+ target->call( c.method, args, argc,ce );
+ if (ce.error!=Variant::CallError::CALL_OK) {
+
+ if (ce.error==Variant::CallError::CALL_ERROR_INVALID_METHOD && !ObjectTypeDB::type_exists( target->get_type_name() ) ) {
+ //most likely object is not initialized yet, do not throw error.
+ } else {
+ ERR_PRINTS("Error calling method from signal '"+String(p_name)+"': "+Variant::get_call_error_text(target,c.method,args,argc,ce));
+ }
+ }
}
if (c.flags&CONNECT_ONESHOT) {
@@ -1208,57 +1222,29 @@ void Object::emit_signal(const StringName& p_name,VARIANT_ARG_DECLARE) {
}
-#if 0
-
- //old (deprecated and dangerous code)
- s->lock++;
- for( Map<Signal::Target,Signal::Slot>::Element *E = s->slot_map.front();E;E=E->next() ) {
-
- const Signal::Target& t = E->key();
- const Signal::Slot& s = E->get();
- const Connection &c = s.cE->get();
- VARIANT_ARGPTRS
+ while (!disconnect_data.empty()) {
- int bind_count=c.binds.size();
- int bind=0;
+ const _ObjectSignalDisconnectData &dd = disconnect_data.front()->get();
+ disconnect(dd.signal,dd.target,dd.method);
+ disconnect_data.pop_front();
+ }
- for(int i=0;bind < bind_count && i<VARIANT_ARG_MAX;i++) {
+}
- if (argptr[i]->get_type()==Variant::NIL) {
- argptr[i]=&c.binds[bind];
- bind++;
- }
- }
+void Object::emit_signal(const StringName& p_name,VARIANT_ARG_DECLARE) {
- if (c.flags&CONNECT_DEFERRED) {
- MessageQueue::get_singleton()->push_call(t._id,t.method,VARIANT_ARGPTRS_PASS);
- } else {
- Object *obj = ObjectDB::get_instance(t._id);
- ERR_CONTINUE(!obj); //yeah this should always be here
- obj->call( t.method, VARIANT_ARGPTRS_PASS );
- }
+ VARIANT_ARGPTRS;
- if (c.flags&CONNECT_ONESHOT) {
- _ObjectSignalDisconnectData dd;
- dd.signal=p_name;
- dd.target=ObjectDB::get_instance(t._id);
- dd.method=t.method;
- disconnect_data.push_back(dd);
- }
+ int argc=0;
+ for(int i=0;i<VARIANT_ARG_MAX;i++) {
+ if (argptr[i]->get_type()==Variant::NIL)
+ break;
+ argc++;
}
-
-
- s->lock--;
-#endif
- while (!disconnect_data.empty()) {
-
- const _ObjectSignalDisconnectData &dd = disconnect_data.front()->get();
- disconnect(dd.signal,dd.target,dd.method);
- disconnect_data.pop_front();
- }
+ emit_signal(p_name,argptr,argc);
}
diff --git a/core/object.h b/core/object.h
index 38a91d7898..dcebf9b2a2 100644
--- a/core/object.h
+++ b/core/object.h
@@ -593,6 +593,7 @@ public:
void add_user_signal(const MethodInfo& p_signal);
void emit_signal(const StringName& p_name,VARIANT_ARG_LIST);
+ void emit_signal(const StringName& p_name, const Variant** p_args, int p_argcount);
void get_signal_list(List<MethodInfo> *p_signals ) const;
void get_signal_connection_list(const StringName& p_signal,List<Connection> *p_connections) const;
void get_all_signal_connections(List<Connection> *p_connections) const;
diff --git a/core/os/file_access.h b/core/os/file_access.h
index 35514a129f..51cf839117 100644
--- a/core/os/file_access.h
+++ b/core/os/file_access.h
@@ -78,6 +78,7 @@ public:
READ=1,
WRITE=2,
READ_WRITE=3,
+ WRITE_READ=7,
};
virtual void close()=0; ///< close a file
diff --git a/core/os/input.cpp b/core/os/input.cpp
index d8d746c811..6e1e618d9a 100644
--- a/core/os/input.cpp
+++ b/core/os/input.cpp
@@ -53,8 +53,12 @@ void Input::_bind_methods() {
ObjectTypeDB::bind_method(_MD("is_mouse_button_pressed","button"),&Input::is_mouse_button_pressed);
ObjectTypeDB::bind_method(_MD("is_joy_button_pressed","device","button"),&Input::is_joy_button_pressed);
ObjectTypeDB::bind_method(_MD("is_action_pressed","action"),&Input::is_action_pressed);
+ ObjectTypeDB::bind_method(_MD("add_joy_mapping","mapping", "update_existing"),&Input::add_joy_mapping, DEFVAL(false));
+ ObjectTypeDB::bind_method(_MD("remove_joy_mapping","guid"),&Input::remove_joy_mapping);
+ ObjectTypeDB::bind_method(_MD("is_joy_known","device"),&Input::is_joy_known);
ObjectTypeDB::bind_method(_MD("get_joy_axis","device","axis"),&Input::get_joy_axis);
ObjectTypeDB::bind_method(_MD("get_joy_name","device"),&Input::get_joy_name);
+ ObjectTypeDB::bind_method(_MD("get_joy_guid","device"),&Input::get_joy_guid);
ObjectTypeDB::bind_method(_MD("get_accelerometer"),&Input::get_accelerometer);
//ObjectTypeDB::bind_method(_MD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want
ObjectTypeDB::bind_method(_MD("get_mouse_speed"),&Input::get_mouse_speed);
diff --git a/core/os/input.h b/core/os/input.h
index 57eaa973d9..2dd4496f26 100644
--- a/core/os/input.h
+++ b/core/os/input.h
@@ -63,7 +63,10 @@ public:
virtual float get_joy_axis(int p_device,int p_axis)=0;
virtual String get_joy_name(int p_idx)=0;
virtual void joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid)=0;
-
+ virtual void add_joy_mapping(String p_mapping, bool p_update_existing=false)=0;
+ virtual void remove_joy_mapping(String p_guid)=0;
+ virtual bool is_joy_known(int p_device)=0;
+ virtual String get_joy_guid(int p_device) const=0;
virtual Point2 get_mouse_pos() const=0;
virtual Point2 get_mouse_speed() const=0;
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index 25b10a76d3..2f39567a7e 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -156,6 +156,7 @@ bool InputEvent::is_pressed() const {
case MOUSE_BUTTON: return mouse_button.pressed;
case JOYSTICK_BUTTON: return joy_button.pressed;
case SCREEN_TOUCH: return screen_touch.pressed;
+ case JOYSTICK_MOTION: return InputMap::get_singleton()->event_is_joy_motion_action_pressed(*this);
case ACTION: return action.pressed;
default: {}
}
diff --git a/core/os/os.cpp b/core/os/os.cpp
index eb5f91167a..be447d511e 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -50,7 +50,7 @@ uint64_t OS::get_unix_time() const {
return 0;
};
-uint64_t OS::get_system_time_msec() const {
+uint64_t OS::get_system_time_secs() const {
return 0;
}
void OS::debug_break() {
@@ -507,6 +507,13 @@ float OS::get_time_scale() const {
return _time_scale;
}
+bool OS::is_joy_known(int p_device) {
+ return true;
+}
+
+String OS::get_joy_guid(int p_device) const {
+ return "Default Joystick";
+}
OS::OS() {
last_error=NULL;
diff --git a/core/os/os.h b/core/os/os.h
index 94cb1d4ea4..83ea2c2101 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -256,7 +256,7 @@ public:
virtual Time get_time(bool local=false) const=0;
virtual TimeZoneInfo get_time_zone_info() const=0;
virtual uint64_t get_unix_time() const;
- virtual uint64_t get_system_time_msec() const;
+ virtual uint64_t get_system_time_secs() const;
virtual void delay_usec(uint32_t p_usec) const=0;
virtual uint64_t get_ticks_usec() const=0;
@@ -397,6 +397,9 @@ public:
_FORCE_INLINE_ bool get_use_pixel_snap() const { return _pixel_snap; }
+ virtual bool is_joy_known(int p_device);
+ virtual String get_joy_guid(int p_device)const;
+
OS();
virtual ~OS();
diff --git a/core/print_string.cpp b/core/print_string.cpp
index 37760a66ca..e364388b7b 100644
--- a/core/print_string.cpp
+++ b/core/print_string.cpp
@@ -66,7 +66,7 @@ void remove_print_handler(PrintHandlerList *p_handler) {
l=l->next;
}
- OS::get_singleton()->print("print hanlder list is %p\n",print_handler_list);
+ OS::get_singleton()->print("print handler list is %p\n",print_handler_list);
ERR_FAIL_COND(l==NULL);
_global_unlock();
diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp
index fb17156df4..d977ea3e18 100644
--- a/core/register_core_types.cpp
+++ b/core/register_core_types.cpp
@@ -101,10 +101,12 @@ void register_core_types() {
resource_loader_binary = memnew( ResourceFormatLoaderBinary );
ResourceLoader::add_resource_format_loader(resource_loader_binary);
+#ifdef XML_ENABLED
resource_saver_xml = memnew( ResourceFormatSaverXML );
ResourceSaver::add_resource_format_saver(resource_saver_xml);
resource_loader_xml = memnew( ResourceFormatLoaderXML );
ResourceLoader::add_resource_format_loader(resource_loader_xml);
+#endif
ObjectTypeDB::register_type<Object>();
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp
index 299572fbff..b56ff4c0e1 100644
--- a/core/script_debugger_remote.cpp
+++ b/core/script_debugger_remote.cpp
@@ -30,7 +30,7 @@
#include "os/os.h"
#include "io/ip.h"
#include "globals.h"
-
+#include "os/input.h"
void ScriptDebuggerRemote::_send_video_memory() {
List<ResourceUsage> usage;
@@ -135,6 +135,10 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) {
packet_peer_stream->put_var(p_can_continue);
packet_peer_stream->put_var(p_script->debug_get_error());
+ Input::MouseMode mouse_mode=Input::get_singleton()->get_mouse_mode();
+ if (mouse_mode!=Input::MOUSE_MODE_VISIBLE)
+ Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE);
+
while(true) {
@@ -296,6 +300,9 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) {
packet_peer_stream->put_var("debug_exit");
packet_peer_stream->put_var(0);
+ if (mouse_mode!=Input::MOUSE_MODE_VISIBLE)
+ Input::get_singleton()->set_mouse_mode(mouse_mode);
+
}
diff --git a/core/script_language.h b/core/script_language.h
index a179949c19..3138c88e8e 100644
--- a/core/script_language.h
+++ b/core/script_language.h
@@ -98,6 +98,7 @@ public:
virtual bool has_script_signal(const StringName& p_signal) const=0;
virtual void get_script_signal_list(List<MethodInfo> *r_signals) const=0;
+ virtual bool get_property_default_value(const StringName& p_property,Variant& r_value) const=0;
virtual void update_exports() {} //editor tool
diff --git a/core/ustring.cpp b/core/ustring.cpp
index c93fb80ca8..ee750c39e5 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -1636,12 +1636,16 @@ int64_t String::to_int64() const {
return integer*sign;
}
-int String::to_int(const char* p_str) {
+int String::to_int(const char* p_str,int p_len) {
int to=0;
- while(p_str[to]!=0 && p_str[to]!='.')
- to++;
+ if (p_len>=0)
+ to=p_len;
+ else {
+ while(p_str[to]!=0 && p_str[to]!='.')
+ to++;
+ }
int integer=0;
@@ -3154,6 +3158,21 @@ String String::c_escape() const {
return escaped;
}
+String String::json_escape() const {
+
+ String escaped=*this;
+ escaped=escaped.replace("\\","\\\\");
+ escaped=escaped.replace("\b","\\b");
+ escaped=escaped.replace("\f","\\f");
+ escaped=escaped.replace("\n","\\n");
+ escaped=escaped.replace("\r","\\r");
+ escaped=escaped.replace("\t","\\t");
+ escaped=escaped.replace("\v","\\v");
+ escaped=escaped.replace("\"","\\\"");
+
+ return escaped;
+}
+
String String::xml_escape(bool p_escape_quotes) const {
String str=*this;
diff --git a/core/ustring.h b/core/ustring.h
index 4c76b8e863..9276afa0f7 100644
--- a/core/ustring.h
+++ b/core/ustring.h
@@ -144,7 +144,7 @@ public:
int to_int() const;
int64_t to_int64() const;
- static int to_int(const char* p_str);
+ static int to_int(const char* p_str, int p_len=-1);
static double to_double(const char* p_str);
static double to_double(const CharType* p_str, const CharType **r_end=NULL);
static int64_t to_int(const CharType* p_str,int p_len=-1);
@@ -211,6 +211,7 @@ public:
String http_unescape() const;
String c_escape() const;
String c_unescape() const;
+ String json_escape() const;
String world_wrap(int p_chars_per_line) const;
String percent_encode() const;
diff --git a/core/variant.cpp b/core/variant.cpp
index ab560e0d45..3bd8d80528 100644
--- a/core/variant.cpp
+++ b/core/variant.cpp
@@ -706,6 +706,17 @@ bool Variant::operator==(const Variant& p_variant) const {
}
+bool Variant::operator!=(const Variant& p_variant) const {
+
+ if (type!=p_variant.type) //evaluation of operator== needs to be more strict
+ return true;
+ bool v;
+ Variant r;
+ evaluate(OP_NOT_EQUAL,*this,p_variant,r,v);
+ return r;
+
+}
+
bool Variant::operator<(const Variant& p_variant) const {
if (type!=p_variant.type) //if types differ, then order by type first
return type<p_variant.type;
@@ -2981,3 +2992,32 @@ String Variant::get_construct_string() const {
return vars;
}
+
+String Variant::get_call_error_text(Object* p_base, const StringName& p_method,const Variant** p_argptrs,int p_argcount,const Variant::CallError &ce) {
+
+
+ String err_text;
+
+ if (ce.error==Variant::CallError::CALL_ERROR_INVALID_ARGUMENT) {
+ int errorarg=ce.argument;
+ err_text="Cannot convert argument "+itos(errorarg+1)+" from "+Variant::get_type_name(p_argptrs[errorarg]->get_type())+" to "+Variant::get_type_name(ce.expected)+".";
+ } else if (ce.error==Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) {
+ err_text="Expected "+itos(ce.argument)+" arguments.";
+ } else if (ce.error==Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) {
+ err_text="Expected "+itos(ce.argument)+" arguments.";
+ } else if (ce.error==Variant::CallError::CALL_ERROR_INVALID_METHOD) {
+ err_text="Method not found.";
+ } else if (ce.error==Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL) {
+ err_text="Instance is null";
+ } else if (ce.error==Variant::CallError::CALL_OK){
+ return "Call OK";
+ }
+
+ String class_name = p_base->get_type();
+ Ref<Script> script = p_base->get_script();
+ if (script.is_valid() && script->get_path().is_resource_file()) {
+
+ class_name+="("+script->get_path().get_file()+")";
+ }
+ return "'"+class_name+"::"+String(p_method)+"': "+err_text;
+}
diff --git a/core/variant.h b/core/variant.h
index 05bb5a7328..b58c781bdd 100644
--- a/core/variant.h
+++ b/core/variant.h
@@ -390,6 +390,9 @@ public:
Variant call(const StringName& p_method,const Variant** p_args,int p_argcount,CallError &r_error);
Variant call(const StringName& p_method,const Variant& p_arg1=Variant(),const Variant& p_arg2=Variant(),const Variant& p_arg3=Variant(),const Variant& p_arg4=Variant(),const Variant& p_arg5=Variant());
+
+ static String get_call_error_text(Object* p_base, const StringName& p_method,const Variant** p_argptrs,int p_argcount,const Variant::CallError &ce);
+
static Variant construct(const Variant::Type,const Variant** p_args,int p_argcount,CallError &r_error,bool p_strict=true);
void get_method_list(List<MethodInfo> *p_list) const;
@@ -411,6 +414,7 @@ public:
//argsVariant call()
bool operator==(const Variant& p_variant) const;
+ bool operator!=(const Variant& p_variant) const;
bool operator<(const Variant& p_variant) const;
uint32_t hash() const;
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 2122640be8..90f868c866 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -272,6 +272,9 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
VCALL_LOCALMEM0R(String,get_file);
VCALL_LOCALMEM0R(String,xml_escape);
VCALL_LOCALMEM0R(String,xml_unescape);
+ VCALL_LOCALMEM0R(String,c_escape);
+ VCALL_LOCALMEM0R(String,c_unescape);
+ VCALL_LOCALMEM0R(String,json_escape);
VCALL_LOCALMEM0R(String,percent_encode);
VCALL_LOCALMEM0R(String,percent_decode);
VCALL_LOCALMEM0R(String,is_valid_identifier);
@@ -1286,6 +1289,9 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
ADDFUNC0(STRING,STRING,String,get_file,varray());
ADDFUNC0(STRING,STRING,String,xml_escape,varray());
ADDFUNC0(STRING,STRING,String,xml_unescape,varray());
+ ADDFUNC0(STRING,STRING,String,c_escape,varray());
+ ADDFUNC0(STRING,STRING,String,c_unescape,varray());
+ ADDFUNC0(STRING,STRING,String,json_escape,varray());
ADDFUNC0(STRING,STRING,String,percent_encode,varray());
ADDFUNC0(STRING,STRING,String,percent_decode,varray());
ADDFUNC0(STRING,BOOL,String,is_valid_identifier,varray());
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index 9218406e0f..204a00e1d5 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -1003,7 +1003,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
return;
}
- *str = str->substr(0,idx-1)+chr+str->substr(idx+1,str->length());
+ *str = str->substr(0,idx)+chr+str->substr(idx+1,str->length());
valid=true;
return;
@@ -1364,7 +1364,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
valid=true;
v->b=float(p_value)/255.0;
return;
- } else if (*str=="a8" ) {
+ } else if (*str=="a8" ) {\
valid=true;
v->a=float(p_value)/255.0;
return;
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp
index 3c8c43f5b3..3efa87de80 100644
--- a/core/variant_parser.cpp
+++ b/core/variant_parser.cpp
@@ -52,6 +52,7 @@ const char * VariantParser::tk_name[TK_MAX] = {
"color",
"':'",
"','",
+ "'.'",
"'='",
"EOF",
"ERROR"
@@ -140,6 +141,11 @@ Error VariantParser::get_token(Stream *p_stream, Token& r_token, int &line, Stri
r_token.type=TK_COMMA;
return OK;
};
+ case '.': {
+
+ r_token.type=TK_PERIOD;
+ return OK;
+ };
case '=': {
r_token.type=TK_EQUAL;
@@ -442,7 +448,7 @@ Error VariantParser::_parse_construct(Stream *p_stream,Vector<T>& r_construct,in
if (!first) {
get_token(p_stream,token,line,r_err_str);
if (token.type==TK_COMMA) {
- //do none
+ //do none
} else if (token.type==TK_PARENTHESIS_CLOSE) {
break;
} else {
@@ -452,7 +458,10 @@ Error VariantParser::_parse_construct(Stream *p_stream,Vector<T>& r_construct,in
}
}
get_token(p_stream,token,line,r_err_str);
- if (token.type!=TK_NUMBER) {
+
+ if (first && token.type==TK_PARENTHESIS_CLOSE) {
+ break;
+ } else if (token.type!=TK_NUMBER) {
r_err_str="Expected float in constructor";
return ERR_PARSE_ERROR;
}
@@ -1072,8 +1081,24 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in
ie.joy_motion.axis = token.value;
get_token(p_stream,token,line,r_err_str);
+
+ if (token.type!=TK_COMMA) {
+ r_err_str="Expected ',' after axis index";
+ return ERR_PARSE_ERROR;
+ }
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_NUMBER) {
+ r_err_str="Expected axis sign";
+ return ERR_PARSE_ERROR;
+ }
+
+ ie.joy_motion.axis_value = token.value;
+
+ get_token(p_stream,token,line,r_err_str);
+
if (token.type!=TK_PARENTHESIS_CLOSE) {
- r_err_str="Expected ')'";
+ r_err_str="Expected ')' for jaxis";
return ERR_PARSE_ERROR;
}
@@ -1167,7 +1192,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in
get_token(p_stream,token,line,r_err_str);
if (token.type==TK_COMMA) {
//do none
- } else if (token.type!=TK_PARENTHESIS_CLOSE) {
+ } else if (token.type==TK_PARENTHESIS_CLOSE) {
break;
} else {
r_err_str="Expected ',' or ')'";
@@ -1176,11 +1201,13 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in
}
}
get_token(p_stream,token,line,r_err_str);
+
if (token.type!=TK_STRING) {
- r_err_str="Expected string";
+ r_err_str="Expected string";
return ERR_PARSE_ERROR;
}
+ first=false;
cs.push_back(token.value);
}
@@ -1339,11 +1366,35 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in
InputEvent ie;
ie.type=InputEvent::JOYSTICK_MOTION;
ie.device=params[0].to_int();
- ie.joy_motion.axis=params[1].to_int();
+ int axis=params[1].to_int();
+ ie.joy_motion.axis=axis>>1;
+ ie.joy_motion.axis_value=axis&1?1:-1;
value= ie;
return OK;
+ } else if (id=="img") { // compatibility with engine.cfg
+
+ Token token;
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_OPEN) {
+ r_err_str="Expected '(' in old-style engine.cfg construct";
+ return ERR_PARSE_ERROR;
+ }
+
+ while(true) {
+ CharType c = p_stream->get_char();
+ if (p_stream->is_eof()) {
+ r_err_str="Unexpected EOF in old style engine.cfg img()";
+ return ERR_PARSE_ERROR;
+ }
+ if (c==')')
+ break;
+ }
+
+ value=Image();
+
+ return OK;
} else {
r_err_str="Unexpected identifier: '"+id+"'.";
@@ -1534,7 +1585,7 @@ Error VariantParser::_parse_dictionary(Dictionary &object, Stream *p_stream, int
}
-Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, ResourceParser *p_res_parser) {
+Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, ResourceParser *p_res_parser,bool p_simple_tag) {
r_tag.fields.clear();
@@ -1544,6 +1595,29 @@ Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, Strin
}
+ if (p_simple_tag) {
+
+ r_tag.name="";
+ r_tag.fields.clear();
+
+ while(true) {
+
+ CharType c = p_stream->get_char();
+ if (p_stream->is_eof()) {
+ r_err_str="Unexpected EOF while parsing simple tag";
+ return ERR_PARSE_ERROR;
+ }
+ if (c==']')
+ break;
+ r_tag.name+=String::chr(c);
+ }
+
+ r_tag.name = r_tag.name.strip_edges();
+
+ return OK;
+
+ }
+
get_token(p_stream,token,line,r_err_str);
@@ -1553,6 +1627,7 @@ Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, Strin
}
r_tag.name=token.value;
+ bool parsing_tag=true;
while(true) {
@@ -1565,6 +1640,16 @@ Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, Strin
if (token.type==TK_BRACKET_CLOSE)
break;
+ if (parsing_tag && token.type==TK_PERIOD) {
+ r_tag.name+="."; //support tags such as [someprop.Anroid] for specific platforms
+ get_token(p_stream,token,line,r_err_str);
+ } else if (parsing_tag && token.type==TK_COLON) {
+ r_tag.name+=":"; //support tags such as [someprop.Anroid] for specific platforms
+ get_token(p_stream,token,line,r_err_str);
+ } else {
+ parsing_tag=false;
+ }
+
if (token.type!=TK_IDENTIFIER) {
r_err_str="Expected Identifier";
return ERR_PARSE_ERROR;
@@ -1572,10 +1657,13 @@ Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, Strin
String id=token.value;
+ if (parsing_tag) {
+ r_tag.name+=id;
+ continue;
+ }
get_token(p_stream,token,line,r_err_str);
if (token.type!=TK_EQUAL) {
- r_err_str="Expected '='";
return ERR_PARSE_ERROR;
}
@@ -1594,7 +1682,7 @@ Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, Strin
}
-Error VariantParser::parse_tag(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, ResourceParser *p_res_parser) {
+Error VariantParser::parse_tag(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, ResourceParser *p_res_parser, bool p_simple_tag) {
Token token;
get_token(p_stream,token,line,r_err_str);
@@ -1608,14 +1696,15 @@ Error VariantParser::parse_tag(Stream *p_stream, int &line, String &r_err_str, T
return ERR_PARSE_ERROR;
}
- return _parse_tag(token,p_stream,line,r_err_str,r_tag,p_res_parser);
+ return _parse_tag(token,p_stream,line,r_err_str,r_tag,p_res_parser,p_simple_tag);
}
-Error VariantParser::parse_tag_assign_eof(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, String &r_assign, Variant &r_value, ResourceParser *p_res_parser) {
+Error VariantParser::parse_tag_assign_eof(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, String &r_assign, Variant &r_value, ResourceParser *p_res_parser, bool p_simple_tag) {
//assign..
+ r_assign="";
String what;
while(true) {
@@ -1649,7 +1738,7 @@ Error VariantParser::parse_tag_assign_eof(Stream *p_stream, int &line, String &r
//it's a tag!
p_stream->saved='['; //go back one
- Error err = parse_tag(p_stream,line,r_err_str,r_tag,p_res_parser);
+ Error err = parse_tag(p_stream,line,r_err_str,r_tag,p_res_parser,p_simple_tag);
return err;
}
@@ -1715,7 +1804,10 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
} break;
case Variant::REAL: {
- p_store_string_func(p_store_string_ud, rtoss(p_variant.operator real_t()) );
+ String s = rtoss(p_variant.operator real_t());
+ if (s.find(".")==-1 && s.find("e")==-1)
+ s+=".0";
+ p_store_string_func(p_store_string_ud, s );
} break;
case Variant::STRING: {
@@ -2034,7 +2126,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i>0)
p_store_string_func(p_store_string_ud,", ");
String str=ptr[i];
- p_store_string_func(p_store_string_ud,""+str.c_escape()+"\"");
+ p_store_string_func(p_store_string_ud,"\""+str.c_escape()+"\"");
}
p_store_string_func(p_store_string_ud," )");
diff --git a/core/variant_parser.h b/core/variant_parser.h
index 16d576a6b4..00f6910b29 100644
--- a/core/variant_parser.h
+++ b/core/variant_parser.h
@@ -69,6 +69,7 @@ public:
TK_COLOR,
TK_COLON,
TK_COMMA,
+ TK_PERIOD,
TK_EQUAL,
TK_EOF,
TK_ERROR,
@@ -103,12 +104,12 @@ private:
static Error _parse_enginecfg(Stream *p_stream, Vector<String>& strings, int &line, String &r_err_str);
static Error _parse_dictionary(Dictionary &object, Stream *p_stream, int &line, String &r_err_str,ResourceParser *p_res_parser=NULL);
static Error _parse_array(Array &array, Stream *p_stream, int &line, String &r_err_str,ResourceParser *p_res_parser=NULL);
- static Error _parse_tag(Token& token,Stream *p_stream, int &line, String &r_err_str,Tag& r_tag,ResourceParser *p_res_parser=NULL);
+ static Error _parse_tag(Token& token,Stream *p_stream, int &line, String &r_err_str,Tag& r_tag,ResourceParser *p_res_parser=NULL,bool p_simple_tag=false);
public:
- static Error parse_tag(Stream *p_stream, int &line, String &r_err_str,Tag& r_tag,ResourceParser *p_res_parser=NULL);
- static Error parse_tag_assign_eof(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, String &r_assign, Variant &r_value,ResourceParser *p_res_parser=NULL);
+ static Error parse_tag(Stream *p_stream, int &line, String &r_err_str,Tag& r_tag,ResourceParser *p_res_parser=NULL,bool p_simple_tag=false);
+ static Error parse_tag_assign_eof(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, String &r_assign, Variant &r_value,ResourceParser *p_res_parser=NULL,bool p_simple_tag=false);
static Error parse_value(Token& token,Variant &value, Stream *p_stream, int &line, String &r_err_str,ResourceParser *p_res_parser=NULL);
static Error get_token(Stream *p_stream,Token& r_token,int &line,String &r_err_str);
diff --git a/demos/3d/platformer/engine.cfg b/demos/3d/platformer/engine.cfg
index 84cac52c97..84a7e8f597 100644
--- a/demos/3d/platformer/engine.cfg
+++ b/demos/3d/platformer/engine.cfg
@@ -6,7 +6,7 @@ icon="res://icon.png"
[display]
-height=450
+height=720
stretch_2d=true
[input]
diff --git a/demos/3d/platformer/player.scn b/demos/3d/platformer/player.scn
index 854a8397e4..3b24da94ec 100644
--- a/demos/3d/platformer/player.scn
+++ b/demos/3d/platformer/player.scn
Binary files differ
diff --git a/demos/misc/joysticks/diagram.png b/demos/misc/joysticks/diagram.png
new file mode 100644
index 0000000000..3f8ba1f973
--- /dev/null
+++ b/demos/misc/joysticks/diagram.png
Binary files differ
diff --git a/demos/misc/joysticks/engine.cfg b/demos/misc/joysticks/engine.cfg
index 71ac91000e..79cda1eeb4 100644
--- a/demos/misc/joysticks/engine.cfg
+++ b/demos/misc/joysticks/engine.cfg
@@ -6,5 +6,5 @@ icon="res://icon.png"
[display]
-width=260
+width=550
height=300
diff --git a/demos/misc/joysticks/indicators.png b/demos/misc/joysticks/indicators.png
new file mode 100644
index 0000000000..90fee48498
--- /dev/null
+++ b/demos/misc/joysticks/indicators.png
Binary files differ
diff --git a/demos/misc/joysticks/joysticks.gd b/demos/misc/joysticks/joysticks.gd
index 7add88573d..f5bc1bddad 100644
--- a/demos/misc/joysticks/joysticks.gd
+++ b/demos/misc/joysticks/joysticks.gd
@@ -14,8 +14,9 @@ var cur_joy
var axis_value
var btn_state
+const DEADZONE = 0.2
-func _input(event):
+func _fixed_process(delta):
# Get the joystick device number from the spinbox
joy_num = get_node("joy_num").get_value()
@@ -29,15 +30,24 @@ func _input(event):
axis_value = Input.get_joy_axis(joy_num, axis)
get_node("axis_prog" + str(axis)).set_value(100*axis_value)
get_node("axis_val" + str(axis)).set_text(str(axis_value))
+ if (axis < 4):
+ if (abs(axis_value) < DEADZONE):
+ get_node("diagram/axes/" + str(axis) + "+").hide()
+ get_node("diagram/axes/" + str(axis) + "-").hide()
+ elif (axis_value > 0):
+ get_node("diagram/axes/" + str(axis) + "+").show()
+ else:
+ get_node("diagram/axes/" + str(axis) + "-").show()
# Loop through the buttons and highlight the ones that are pressed
- for btn in range(0, 17):
+ for btn in range(0, 16):
btn_state = 1
if (Input.is_joy_button_pressed(joy_num, btn)):
get_node("btn" + str(btn)).add_color_override("font_color", Color(1, 1, 1, 1))
+ get_node("diagram/buttons/" + str(btn)).show()
else:
get_node("btn" + str(btn)).add_color_override("font_color", Color(0.2, 0.1, 0.3, 1))
-
+ get_node("diagram/buttons/" + str(btn)).hide()
func _ready():
- set_process_input(true)
+ set_fixed_process(true)
diff --git a/demos/misc/joysticks/joysticks.scn b/demos/misc/joysticks/joysticks.scn
index b78bccbf33..3e0f326a0d 100644
--- a/demos/misc/joysticks/joysticks.scn
+++ b/demos/misc/joysticks/joysticks.scn
Binary files differ
diff --git a/demos/misc/joysticks/jsdiagram.xscn b/demos/misc/joysticks/jsdiagram.xscn
new file mode 100644
index 0000000000..537ad30278
--- /dev/null
+++ b/demos/misc/joysticks/jsdiagram.xscn
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<resource_file type="PackedScene" subresource_count="3" version="2.0" version_name="Godot Engine v2.0.alpha.custom_build">
+ <ext_resource path="res://indicators.png" type="Texture" index="1"></ext_resource>
+ <ext_resource path="res://diagram.png" type="Texture" index="0"></ext_resource>
+ <main_resource>
+ <dictionary name="_bundled" shared="false">
+ <string> "conn_count" </string>
+ <int> 0 </int>
+ <string> "conns" </string>
+ <int_array len="0"> </int_array>
+ <string> "editable_instances" </string>
+ <array len="0" shared="false">
+ </array>
+ <string> "names" </string>
+ <string_array len="37">
+ <string> "diagram" </string>
+ <string> "transform/pos" </string>
+ <string> "transform/scale" </string>
+ <string> "texture" </string>
+ <string> "__meta__" </string>
+ <string> "Sprite" </string>
+ <string> "buttons" </string>
+ <string> "Node2D" </string>
+ <string> "0" </string>
+ <string> "region" </string>
+ <string> "region_rect" </string>
+ <string> "1" </string>
+ <string> "2" </string>
+ <string> "3" </string>
+ <string> "4" </string>
+ <string> "5" </string>
+ <string> "6" </string>
+ <string> "flip_h" </string>
+ <string> "7" </string>
+ <string> "8" </string>
+ <string> "9" </string>
+ <string> "10" </string>
+ <string> "11" </string>
+ <string> "12" </string>
+ <string> "13" </string>
+ <string> "flip_v" </string>
+ <string> "14" </string>
+ <string> "15" </string>
+ <string> "axes" </string>
+ <string> "0-" </string>
+ <string> "0+" </string>
+ <string> "1-" </string>
+ <string> "1+" </string>
+ <string> "3-" </string>
+ <string> "3+" </string>
+ <string> "2-" </string>
+ <string> "2+" </string>
+ </string_array>
+ <string> "node_count" </string>
+ <int> 27 </int>
+ <string> "node_paths" </string>
+ <array len="0" shared="false">
+ </array>
+ <string> "nodes" </string>
+ <int_array len="453"> -1, -1, 5, 0, -1, 4, 1, 0, 2, 1, 3, 2, 4, 3, 0, 0, 0, 7, 6, -1, 1, 4, 4, 0, 1, 0, 5, 8, -1, 5, 1, 5, 2, 6, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 11, -1, 5, 1, 10, 2, 6, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 12, -1, 5, 1, 11, 2, 6, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 13, -1, 5, 1, 12, 2, 6, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 14, -1, 5, 1, 13, 2, 14, 3, 7, 9, 8, 10, 15, 0, 1, 0, 5, 15, -1, 5, 1, 16, 2, 14, 3, 7, 9, 8, 10, 15, 0, 1, 0, 5, 16, -1, 6, 1, 17, 2, 18, 3, 7, 17, 8, 9, 8, 10, 19, 0, 1, 0, 5, 18, -1, 5, 1, 20, 2, 18, 3, 7, 9, 8, 10, 19, 0, 1, 0, 5, 19, -1, 5, 1, 21, 2, 6, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 20, -1, 5, 1, 22, 2, 6, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 21, -1, 5, 1, 23, 2, 24, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 22, -1, 5, 1, 25, 2, 24, 3, 7, 9, 8, 10, 9, 0, 1, 0, 5, 23, -1, 5, 1, 26, 2, 6, 3, 7, 9, 8, 10, 27, 0, 1, 0, 5, 24, -1, 6, 1, 28, 2, 6, 3, 7, 25, 8, 9, 8, 10, 27, 0, 1, 0, 5, 26, -1, 5, 1, 29, 2, 6, 3, 7, 9, 8, 10, 30, 0, 1, 0, 5, 27, -1, 6, 1, 31, 2, 6, 3, 7, 17, 8, 9, 8, 10, 30, 0, 0, 0, 7, 28, -1, 0, 0, 18, 0, 5, 29, -1, 5, 1, 32, 2, 6, 3, 7, 9, 8, 10, 30, 0, 18, 0, 5, 30, -1, 6, 1, 33, 2, 6, 3, 7, 17, 8, 9, 8, 10, 30, 0, 18, 0, 5, 31, -1, 5, 1, 34, 2, 6, 3, 7, 9, 8, 10, 27, 0, 18, 0, 5, 32, -1, 6, 1, 35, 2, 6, 3, 7, 25, 8, 9, 8, 10, 27, 0, 18, 0, 5, 33, -1, 5, 1, 36, 2, 6, 3, 7, 9, 8, 10, 27, 0, 18, 0, 5, 34, -1, 6, 1, 37, 2, 6, 3, 7, 25, 8, 9, 8, 10, 27, 0, 18, 0, 5, 35, -1, 5, 1, 38, 2, 6, 3, 7, 9, 8, 10, 30, 0, 18, 0, 5, 36, -1, 6, 1, 39, 2, 6, 3, 7, 17, 8, 9, 8, 10, 30, 0 </int_array>
+ <string> "variants" </string>
+ <array len="40" shared="false">
+ <vector2> 368.635, 155.289 </vector2>
+ <vector2> 0.432859, 0.446287 </vector2>
+ <resource external="0"> </resource>
+ <dictionary shared="false">
+ <string> "__editor_plugin_screen__" </string>
+ <string> "2D" </string>
+ </dictionary>
+ <dictionary shared="false">
+ <string> "_editor_collapsed" </string>
+ <bool> True </bool>
+ </dictionary>
+ <vector2> 147.73, 120.925 </vector2>
+ <vector2> 0.9, 0.9 </vector2>
+ <resource external="1"> </resource>
+ <bool> True </bool>
+ <rect2> 0, 0, 45, 45 </rect2>
+ <vector2> 185.769, 82.4874 </vector2>
+ <vector2> 112.377, 82.4874 </vector2>
+ <vector2> 149.073, 47.3293 </vector2>
+ <vector2> -161.038, -158.037 </vector2>
+ <vector2> 5.3348, 3.35512 </vector2>
+ <rect2> 10, 10, 10, 10 </rect2>
+ <vector2> 159.362, -156.977 </vector2>
+ <vector2> -159.349, -221.878 </vector2>
+ <vector2> 1.0458, 2.16952 </vector2>
+ <rect2> 0, 0, 45, 22 </rect2>
+ <vector2> 156.677, -220.11 </vector2>
+ <vector2> -67.5308, 164.422 </vector2>
+ <vector2> 75.8825, 167.363 </vector2>
+ <vector2> -46.6707, 52.702 </vector2>
+ <vector2> 0.810497, 0.57205 </vector2>
+ <vector2> 56.2581, 54.4382 </vector2>
+ <vector2> -139.402, 46.8295 </vector2>
+ <rect2> 50, 0, 54, 14 </rect2>
+ <vector2> -139.838, 115.789 </vector2>
+ <vector2> -172.262, 81.8793 </vector2>
+ <rect2> 50, 0, 14, 54 </rect2>
+ <vector2> -105.085, 81.0326 </vector2>
+ <vector2> -94.4295, 164.932 </vector2>
+ <vector2> -40.3475, 164.509 </vector2>
+ <vector2> -67.6802, 137.926 </vector2>
+ <vector2> -67.4618, 192.915 </vector2>
+ <vector2> 76.6557, 140.986 </vector2>
+ <vector2> 76.0009, 195.339 </vector2>
+ <vector2> 48.8152, 167.145 </vector2>
+ <vector2> 102.899, 167.857 </vector2>
+ </array>
+ <string> "version" </string>
+ <int> 2 </int>
+ </dictionary>
+
+ </main_resource>
+</resource_file> \ No newline at end of file
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index 1b95899729..4a1e437694 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -432,7 +432,7 @@
<method name="convert">
<return type="Object">
</return>
- <argument index="0" name="what" type="var">
+ <argument index="0" name="what" type="Variant">
</argument>
<argument index="1" name="type" type="int">
</argument>
@@ -443,9 +443,9 @@
<method name="str">
<return type="String">
</return>
- <argument index="0" name="what" type="var">
+ <argument index="0" name="what" type="Variant">
</argument>
- <argument index="1" name="..." type="var">
+ <argument index="1" name="..." type="Variant">
</argument>
<description>
Convert one or more arguments to strings in the best way possible.
@@ -454,9 +454,9 @@
<method name="str">
<return type="String">
</return>
- <argument index="0" name="what" type="var">
+ <argument index="0" name="what" type="Variant">
</argument>
- <argument index="1" name="..." type="var">
+ <argument index="1" name="..." type="Variant">
</argument>
<description>
Convert one or more arguments to strings in the best way possible.
@@ -465,9 +465,9 @@
<method name="print">
<return type="Nil">
</return>
- <argument index="0" name="what" type="var">
+ <argument index="0" name="what" type="Variant">
</argument>
- <argument index="1" name="..." type="var">
+ <argument index="1" name="..." type="Variant">
</argument>
<description>
Print one or more arguments to strings in the best way possible to a console line.
@@ -476,9 +476,9 @@
<method name="printt">
<return type="Nil">
</return>
- <argument index="0" name="what" type="var">
+ <argument index="0" name="what" type="Variant">
</argument>
- <argument index="1" name="..." type="var">
+ <argument index="1" name="..." type="Variant">
</argument>
<description>
Print one or more arguments to the console with a tab between each argument.
@@ -487,9 +487,9 @@
<method name="prints">
<return type="Nil">
</return>
- <argument index="0" name="what" type="var">
+ <argument index="0" name="what" type="Variant">
</argument>
- <argument index="1" name="..." type="var">
+ <argument index="1" name="..." type="Variant">
</argument>
<description>
</description>
@@ -497,9 +497,9 @@
<method name="printerr">
<return type="Nil">
</return>
- <argument index="0" name="what" type="var">
+ <argument index="0" name="what" type="Variant">
</argument>
- <argument index="1" name="..." type="var">
+ <argument index="1" name="..." type="Variant">
</argument>
<description>
Print one or more arguments to strings in the best way possible to standard error line.
@@ -508,9 +508,9 @@
<method name="printraw">
<return type="Nil">
</return>
- <argument index="0" name="what" type="var">
+ <argument index="0" name="what" type="Variant">
</argument>
- <argument index="1" name="..." type="var">
+ <argument index="1" name="..." type="Variant">
</argument>
<description>
Print one or more arguments to strings in the best way possible to console. No newline is added at the end.
@@ -519,25 +519,40 @@
<method name="var2str">
<return type="String">
</return>
- <argument index="0" name="var" type="var">
+ <argument index="0" name="var" type="Variant">
</argument>
<description>
Converts the value of a variable to a String.
</description>
</method>
- <method name="str2var:Variant">
- <return type="Nil">
+ <method name="str2var">
+ <return type="Variant">
</return>
<argument index="0" name="string" type="String">
</argument>
<description>
- Converts the value of a String to a Variant.
+ </description>
+ </method>
+ <method name="var2bytes">
+ <return type="RawArray">
+ </return>
+ <argument index="0" name="var" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="bytes2var">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="bytes" type="RawArray">
+ </argument>
+ <description>
</description>
</method>
<method name="range">
<return type="Array">
</return>
- <argument index="0" name="..." type="var">
+ <argument index="0" name="..." type="Variant">
</argument>
<description>
Return an array with the given range. Range can be 1 argument N (0 to N-1), two arguments (initial, final-1) or three arguments (initial,final-1,increment).
@@ -573,12 +588,26 @@
<method name="hash">
<return type="int">
</return>
- <argument index="0" name="var:Variant" type="var">
+ <argument index="0" name="var:Variant" type="Variant">
</argument>
<description>
Hashes the variable passed and returns an integer.
</description>
</method>
+ <method name="Color8">
+ <return type="Color">
+ </return>
+ <argument index="0" name="r8" type="int">
+ </argument>
+ <argument index="1" name="g8" type="int">
+ </argument>
+ <argument index="2" name="b8" type="int">
+ </argument>
+ <argument index="3" name="a8" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="print_stack">
<return type="Nil">
</return>
@@ -1371,6 +1400,10 @@
</constant>
<constant name="JOY_ANALOG_2_Y" value="5">
</constant>
+ <constant name="JOY_ANALOG_L2" value="6">
+ </constant>
+ <constant name="JOY_ANALOG_R2" value="7">
+ </constant>
<constant name="OK" value="0">
Functions that return [Error] return OK when everything went ok. Most functions don't return error anyway and/or just print errors to stdout.
</constant>
@@ -7561,6 +7594,14 @@
</member>
<member name="v" type="float">
</member>
+ <member name="r8" type="int">
+ </member>
+ <member name="g8" type="int">
+ </member>
+ <member name="b8" type="int">
+ </member>
+ <member name="a8" type="int">
+ </member>
</members>
<constants>
</constants>
@@ -7968,6 +8009,8 @@
</argument>
<argument index="1" name="key" type="String">
</argument>
+ <argument index="2" name="default" type="var" default="NULL">
+ </argument>
<description>
</description>
</method>
@@ -13625,6 +13668,7 @@ returns:= "username=user&amp;password=pass"
<argument index="1" name="button" type="int">
</argument>
<description>
+ Returns true if the joystick button at the given index is currently pressed. Returns false otherwise. (see JOY_* constans in [InputEvent])
</description>
</method>
<method name="is_action_pressed">
@@ -13635,6 +13679,31 @@ returns:= "username=user&amp;password=pass"
<description>
</description>
</method>
+ <method name="add_joy_mapping">
+ <argument index="0" name="mapping" type="String">
+ </argument>
+ <argument index="1" name="update_existing" type="bool" default="false">
+ </argument>
+ <description>
+ Add a new mapping entry (in SDL2 format) to the mapping database. Optionally update already connected devices.
+ </description>
+ </method>
+ <method name="remove_joy_mapping">
+ <argument index="0" name="guid" type="String">
+ </argument>
+ <description>
+ Removes all mappings from the internal db that match the given uid.
+ </description>
+ </method>
+ <method name="is_joy_known">
+ <return type="bool">
+ </return>
+ <argument index="0" name="device" type="int">
+ </argument>
+ <description>
+ Returns true if the specified device is known by the system. This means that it sets all button and axis indices exactly as defined in [InputEvent]. Unknown joysticks are not expected to match these constants, but you can still retrieve events from them.
+ </description>
+ </method>
<method name="get_joy_axis">
<return type="float">
</return>
@@ -13643,6 +13712,7 @@ returns:= "username=user&amp;password=pass"
<argument index="1" name="axis" type="int">
</argument>
<description>
+ Returns the current value of the joystick axis at given index (see JOY_* enum in [InputEvent])
</description>
</method>
<method name="get_joy_name">
@@ -13651,6 +13721,16 @@ returns:= "username=user&amp;password=pass"
<argument index="0" name="device" type="int">
</argument>
<description>
+ Returns the name of the joystick at the specified device index
+ </description>
+ </method>
+ <method name="get_joy_guid" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="device" type="int">
+ </argument>
+ <description>
+ Returns a SDL2 compatible device guid on platforms that use gamepad remapping. Returns "Default Gamepad" otherwise.
</description>
</method>
<method name="get_accelerometer">
@@ -15479,7 +15559,7 @@ returns:= "username=user&amp;password=pass"
</description>
</method>
<method name="get_collider_metadata" qualifiers="const">
- <return type="var">
+ <return type="Variant">
</return>
<description>
Return the metadata of the shape that collided with this body. If there is no collision, it will return 0, so collisions must be checked first with [method is_colliding]. Aditionally, this metadata can not be set with [method Object.set_meta], it must be set with [method Physics2DServer.body_set_shape_metadata].
@@ -18971,6 +19051,8 @@ returns:= "username=user&amp;password=pass"
</constant>
<constant name="NOTIFICATION_UNPAUSED" value="15">
</constant>
+ <constant name="NOTIFICATION_INSTANCED" value="20">
+ </constant>
<constant name="PAUSE_MODE_INHERIT" value="0">
</constant>
<constant name="PAUSE_MODE_STOP" value="1">
@@ -19138,7 +19220,7 @@ returns:= "username=user&amp;password=pass"
<description>
</description>
</method>
- <method name="get_relative_transform" qualifiers="const">
+ <method name="get_relative_transform_to_parent" qualifiers="const">
<return type="Matrix32">
</return>
<argument index="0" name="parent" type="Object">
@@ -20178,6 +20260,14 @@ returns:= "username=user&amp;password=pass"
Return the list of signals as an array of dictionaries.
</description>
</method>
+ <method name="get_signal_connection_list" qualifiers="const">
+ <return type="Array">
+ </return>
+ <argument index="0" name="signal" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="connect">
<return type="int">
</return>
@@ -21601,6 +21691,10 @@ returns:= "username=user&amp;password=pass"
<description>
</description>
</method>
+ <method name="reset">
+ <description>
+ </description>
+ </method>
<method name="set_use_local_space">
<argument index="0" name="enable" type="bool">
</argument>
@@ -29631,6 +29725,14 @@ This method controls whether the position between two cached points is interpola
<description>
</description>
</method>
+ <method name="has_group" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_auto_accept_quit">
<argument index="0" name="enabled" type="bool">
</argument>
@@ -33335,6 +33437,12 @@ This method controls whether the position between two cached points is interpola
</description>
</method>
</methods>
+ <signals>
+ <signal name="finished">
+ <description>
+ </description>
+ </signal>
+ </signals>
<constants>
</constants>
</class>
diff --git a/drivers/SCsub b/drivers/SCsub
index e52d6538e5..a00d7fc3f9 100644
--- a/drivers/SCsub
+++ b/drivers/SCsub
@@ -12,11 +12,13 @@ SConscript('windows/SCsub');
SConscript('gles2/SCsub');
SConscript('gl_context/SCsub');
SConscript('openssl/SCsub');
+SConscript('pnm/SCsub');
if (env["png"]=="yes"):
SConscript("png/SCsub");
if (env["jpg"]=="yes"):
- SConscript("jpg/SCsub");
+ #SConscript("jpg/SCsub");
+ SConscript("jpegd/SCsub");
if (env["webp"]=="yes"):
SConscript("webp/SCsub");
SConscript("dds/SCsub");
diff --git a/drivers/convex_decomp/b2Polygon.cpp b/drivers/convex_decomp/b2Polygon.cpp
index 775f2adfe2..73955d3573 100644
--- a/drivers/convex_decomp/b2Polygon.cpp
+++ b/drivers/convex_decomp/b2Polygon.cpp
@@ -217,8 +217,8 @@ b2Polygon::b2Polygon(b2Triangle& t) {
void b2Polygon::Set(const b2Polygon& p) {
if (nVertices != p.nVertices){
nVertices = p.nVertices;
- if (x) delete[] x;
- if (y) delete[] y;
+ delete[] x;
+ delete[] y;
x = new float32[nVertices];
y = new float32[nVertices];
}
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index a3c0bd344c..58d5c307f0 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -929,6 +929,7 @@ void RasterizerGLES2::texture_allocate(RID p_texture,int p_width, int p_height,I
texture->compressed=compressed;
texture->has_alpha=false; //by default it doesn't have alpha unless something with alpha is blitteds
texture->data_size=0;
+ texture->mipmaps=0;
glActiveTexture(GL_TEXTURE0);
@@ -1086,6 +1087,7 @@ void RasterizerGLES2::texture_set_data(RID p_texture,const Image& p_image,VS::Cu
glGenerateMipmap(texture->target);
}
+ texture->mipmaps=mipmaps;
@@ -1269,11 +1271,14 @@ void RasterizerGLES2::texture_set_flags(RID p_texture,uint32_t p_flags) {
p_flags&=VS::TEXTURE_FLAG_FILTER;//can change only filter
}
+ bool had_mipmaps = texture->flags&VS::TEXTURE_FLAG_MIPMAPS;
+
glActiveTexture(GL_TEXTURE0);
glBindTexture(texture->target, texture->tex_id);
uint32_t cube = texture->flags & VS::TEXTURE_FLAG_CUBEMAP;
texture->flags=p_flags|cube; // can't remove a cube from being a cube
+
bool force_clamp_to_edge = !(p_flags&VS::TEXTURE_FLAG_MIPMAPS && !texture->ignore_mipmaps) && (nearest_power_of_2(texture->alloc_height)!=texture->alloc_height || nearest_power_of_2(texture->alloc_width)!=texture->alloc_width);
if (!force_clamp_to_edge && (texture->flags&VS::TEXTURE_FLAG_REPEAT || texture->flags&VS::TEXTURE_FLAG_MIRRORED_REPEAT) && texture->target != GL_TEXTURE_CUBE_MAP) {
@@ -1304,9 +1309,13 @@ void RasterizerGLES2::texture_set_flags(RID p_texture,uint32_t p_flags) {
}
}
- if (texture->flags&VS::TEXTURE_FLAG_MIPMAPS && !texture->ignore_mipmaps)
+ if (texture->flags&VS::TEXTURE_FLAG_MIPMAPS && !texture->ignore_mipmaps) {
+ if (!had_mipmaps && texture->mipmaps==1) {
+ glGenerateMipmap(texture->target);
+ }
glTexParameteri(texture->target,GL_TEXTURE_MIN_FILTER,use_fast_texture_filter?GL_LINEAR_MIPMAP_NEAREST:GL_LINEAR_MIPMAP_LINEAR);
- else{
+
+ } else{
if (texture->flags&VS::TEXTURE_FLAG_FILTER) {
glTexParameteri(texture->target,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
} else {
@@ -8330,6 +8339,14 @@ void RasterizerGLES2::canvas_draw_rect(const Rect2& p_rect, int p_flags, const R
if ( texture ) {
+ bool untile=false;
+
+ if (p_flags&CANVAS_RECT_TILE && !(texture->flags&VS::TEXTURE_FLAG_REPEAT)) {
+ glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
+ glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
+ untile=true;
+ }
+
if (!(p_flags&CANVAS_RECT_REGION)) {
Rect2 region = Rect2(0,0,texture->width,texture->height);
@@ -8340,6 +8357,12 @@ void RasterizerGLES2::canvas_draw_rect(const Rect2& p_rect, int p_flags, const R
_draw_textured_quad(p_rect, p_source, Size2(texture->width,texture->height),p_flags&CANVAS_RECT_FLIP_H,p_flags&CANVAS_RECT_FLIP_V,p_flags&CANVAS_RECT_TRANSPOSE);
}
+
+ if (untile) {
+ glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
+ glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
+ }
+
} else {
//glDisable(GL_TEXTURE_2D);
@@ -10306,6 +10329,8 @@ void RasterizerGLES2::_update_framebuffer() {
return;
int scale = GLOBAL_DEF("rasterizer/framebuffer_shrink",1);
+ if (scale<1)
+ scale=1;
int dwidth = OS::get_singleton()->get_video_mode().width/scale;
int dheight = OS::get_singleton()->get_video_mode().height/scale;
diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h
index f3edc28861..0f70ceaa97 100644
--- a/drivers/gles2/rasterizer_gles2.h
+++ b/drivers/gles2/rasterizer_gles2.h
@@ -138,6 +138,8 @@ class RasterizerGLES2 : public Rasterizer {
StringName reloader_func;
Image image[6];
+ int mipmaps;
+
bool active;
GLuint tex_id;
@@ -159,6 +161,7 @@ class RasterizerGLES2 : public Rasterizer {
compressed=false;
total_data_size=0;
target=GL_TEXTURE_2D;
+ mipmaps=0;
reloader=0;
}
diff --git a/drivers/gles2/shader_gles2.h b/drivers/gles2/shader_gles2.h
index 51520cc9da..68ae8af63f 100644
--- a/drivers/gles2/shader_gles2.h
+++ b/drivers/gles2/shader_gles2.h
@@ -205,6 +205,11 @@ private:
Plane val=p_value;
glUniform4f( p_uniform, val.normal.x,val.normal.y,val.normal.z,val.d );
} break;
+ case Variant::QUAT: {
+
+ Quat val=p_value;
+ glUniform4f( p_uniform, val.x,val.y,val.z,val.w );
+ } break;
case Variant::MATRIX32: {
diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl
index 259e82d704..285abd30ff 100644
--- a/drivers/gles2/shaders/canvas.glsl
+++ b/drivers/gles2/shaders/canvas.glsl
@@ -196,7 +196,7 @@ void main() {
#ifdef USE_DISTANCE_FIELD
const float smoothing = 1.0/32.0;
float distance = texture2D(texture, uv_interp).a;
- color.a = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance);
+ color.a = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance) * color.a;
#else
color *= texture2D( texture, uv_interp );
diff --git a/drivers/jpg/SCsub b/drivers/jpegd/SCsub
index df91b10a02..dfdb19402e 100644
--- a/drivers/jpg/SCsub
+++ b/drivers/jpegd/SCsub
@@ -2,9 +2,8 @@ Import('env')
jpg_sources = [
- "jpg/tinyjpeg.c",
- "jpg/jidctflt.c",
- "jpg/image_loader_jpg.cpp"
+ "jpegd/jpgd.cpp",
+ "jpegd/image_loader_jpegd.cpp"
]
env.drivers_sources+=jpg_sources
diff --git a/drivers/jpegd/image_loader_jpegd.cpp b/drivers/jpegd/image_loader_jpegd.cpp
new file mode 100644
index 0000000000..9d1263b81b
--- /dev/null
+++ b/drivers/jpegd/image_loader_jpegd.cpp
@@ -0,0 +1,108 @@
+/*************************************************/
+/* image_loader_jpg.cpp */
+/*************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/*************************************************/
+/* Source code within this file is: */
+/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */
+/* All Rights Reserved. */
+/*************************************************/
+
+#include "image_loader_jpegd.h"
+
+#include "print_string.h"
+#include "os/os.h"
+#include "jpgd.h"
+#include <string.h>
+
+
+Error ImageLoaderJPG::load_image(Image *p_image,FileAccess *f) {
+
+
+ DVector<uint8_t> src_image;
+ int src_image_len = f->get_len();
+ ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
+ src_image.resize(src_image_len);
+
+ DVector<uint8_t>::Write w = src_image.write();
+
+ f->get_buffer(&w[0],src_image_len);
+
+ f->close();
+
+
+
+ jpgd::jpeg_decoder_mem_stream mem_stream(w.ptr(),src_image_len);
+
+ jpgd::jpeg_decoder decoder(&mem_stream);
+
+ if (decoder.get_error_code() != jpgd::JPGD_SUCCESS) {
+ return ERR_CANT_OPEN;
+ }
+
+ const int image_width = decoder.get_width();
+ const int image_height = decoder.get_height();
+ int comps = decoder.get_num_components();
+ if (comps==3)
+ comps=4; //weird
+
+ if (decoder.begin_decoding() != jpgd::JPGD_SUCCESS)
+ return ERR_FILE_CORRUPT;
+
+ const int dst_bpl = image_width * comps;
+
+ DVector<uint8_t> data;
+
+ data.resize(dst_bpl * image_height);
+
+ DVector<uint8_t>::Write dw = data.write();
+
+ jpgd::uint8 *pImage_data = (jpgd::uint8*)dw.ptr();
+
+ for (int y = 0; y < image_height; y++)
+ {
+ const jpgd::uint8* pScan_line;
+ jpgd::uint scan_line_len;
+ if (decoder.decode((const void**)&pScan_line, &scan_line_len) != jpgd::JPGD_SUCCESS)
+ {
+ return ERR_FILE_CORRUPT;
+ }
+
+ jpgd::uint8 *pDst = pImage_data + y * dst_bpl;
+ memcpy(pDst, pScan_line, dst_bpl);
+
+
+ }
+
+
+ //all good
+
+ Image::Format fmt;
+ if (comps==1)
+ fmt=Image::FORMAT_GRAYSCALE;
+ else
+ fmt=Image::FORMAT_RGBA;
+
+ dw = DVector<uint8_t>::Write();
+ w = DVector<uint8_t>::Write();
+
+ p_image->create(image_width,image_height,0,fmt,data);
+
+ return OK;
+
+}
+
+void ImageLoaderJPG::get_recognized_extensions(List<String> *p_extensions) const {
+
+ p_extensions->push_back("jpg");
+ p_extensions->push_back("jpeg");
+}
+
+
+ImageLoaderJPG::ImageLoaderJPG() {
+
+
+}
+
+
diff --git a/drivers/jpg/image_loader_jpg.h b/drivers/jpegd/image_loader_jpegd.h
index 1b2165ab47..1b2165ab47 100644
--- a/drivers/jpg/image_loader_jpg.h
+++ b/drivers/jpegd/image_loader_jpegd.h
diff --git a/drivers/jpegd/jpgd.cpp b/drivers/jpegd/jpgd.cpp
new file mode 100644
index 0000000000..fad9a37a9a
--- /dev/null
+++ b/drivers/jpegd/jpgd.cpp
@@ -0,0 +1,3172 @@
+// jpgd.cpp - C++ class for JPEG decompression.
+// Public domain, Rich Geldreich <richgel99@gmail.com>
+// Alex Evans: Linear memory allocator (taken from jpge.h).
+// v1.04, May. 19, 2012: Code tweaks to fix VS2008 static code analysis warnings (all looked harmless)
+//
+// Supports progressive and baseline sequential JPEG image files, and the most common chroma subsampling factors: Y, H1V1, H2V1, H1V2, and H2V2.
+//
+// Chroma upsampling quality: H2V2 is upsampled in the frequency domain, H2V1 and H1V2 are upsampled using point sampling.
+// Chroma upsampling reference: "Fast Scheme for Image Size Change in the Compressed Domain"
+// http://vision.ai.uiuc.edu/~dugad/research/dct/index.html
+
+#include "jpgd.h"
+#include <string.h>
+
+#include <assert.h>
+#define JPGD_ASSERT(x) assert(x)
+
+#ifdef _MSC_VER
+#pragma warning (disable : 4611) // warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable
+#endif
+
+// Set to 1 to enable freq. domain chroma upsampling on images using H2V2 subsampling (0=faster nearest neighbor sampling).
+// This is slower, but results in higher quality on images with highly saturated colors.
+#define JPGD_SUPPORT_FREQ_DOMAIN_UPSAMPLING 1
+
+#define JPGD_TRUE (1)
+#define JPGD_FALSE (0)
+
+#define JPGD_MAX(a,b) (((a)>(b)) ? (a) : (b))
+#define JPGD_MIN(a,b) (((a)<(b)) ? (a) : (b))
+
+namespace jpgd {
+
+static inline void *jpgd_malloc(size_t nSize) { return malloc(nSize); }
+static inline void jpgd_free(void *p) { free(p); }
+
+// DCT coefficients are stored in this sequence.
+static int g_ZAG[64] = { 0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63 };
+
+enum JPEG_MARKER
+{
+ M_SOF0 = 0xC0, M_SOF1 = 0xC1, M_SOF2 = 0xC2, M_SOF3 = 0xC3, M_SOF5 = 0xC5, M_SOF6 = 0xC6, M_SOF7 = 0xC7, M_JPG = 0xC8,
+ M_SOF9 = 0xC9, M_SOF10 = 0xCA, M_SOF11 = 0xCB, M_SOF13 = 0xCD, M_SOF14 = 0xCE, M_SOF15 = 0xCF, M_DHT = 0xC4, M_DAC = 0xCC,
+ M_RST0 = 0xD0, M_RST1 = 0xD1, M_RST2 = 0xD2, M_RST3 = 0xD3, M_RST4 = 0xD4, M_RST5 = 0xD5, M_RST6 = 0xD6, M_RST7 = 0xD7,
+ M_SOI = 0xD8, M_EOI = 0xD9, M_SOS = 0xDA, M_DQT = 0xDB, M_DNL = 0xDC, M_DRI = 0xDD, M_DHP = 0xDE, M_EXP = 0xDF,
+ M_APP0 = 0xE0, M_APP15 = 0xEF, M_JPG0 = 0xF0, M_JPG13 = 0xFD, M_COM = 0xFE, M_TEM = 0x01, M_ERROR = 0x100, RST0 = 0xD0
+};
+
+enum JPEG_SUBSAMPLING { JPGD_GRAYSCALE = 0, JPGD_YH1V1, JPGD_YH2V1, JPGD_YH1V2, JPGD_YH2V2 };
+
+#define CONST_BITS 13
+#define PASS1_BITS 2
+#define SCALEDONE ((int32)1)
+
+#define FIX_0_298631336 ((int32)2446) /* FIX(0.298631336) */
+#define FIX_0_390180644 ((int32)3196) /* FIX(0.390180644) */
+#define FIX_0_541196100 ((int32)4433) /* FIX(0.541196100) */
+#define FIX_0_765366865 ((int32)6270) /* FIX(0.765366865) */
+#define FIX_0_899976223 ((int32)7373) /* FIX(0.899976223) */
+#define FIX_1_175875602 ((int32)9633) /* FIX(1.175875602) */
+#define FIX_1_501321110 ((int32)12299) /* FIX(1.501321110) */
+#define FIX_1_847759065 ((int32)15137) /* FIX(1.847759065) */
+#define FIX_1_961570560 ((int32)16069) /* FIX(1.961570560) */
+#define FIX_2_053119869 ((int32)16819) /* FIX(2.053119869) */
+#define FIX_2_562915447 ((int32)20995) /* FIX(2.562915447) */
+#define FIX_3_072711026 ((int32)25172) /* FIX(3.072711026) */
+
+#define DESCALE(x,n) (((x) + (SCALEDONE << ((n)-1))) >> (n))
+#define DESCALE_ZEROSHIFT(x,n) (((x) + (128 << (n)) + (SCALEDONE << ((n)-1))) >> (n))
+
+#define MULTIPLY(var, cnst) ((var) * (cnst))
+
+#define CLAMP(i) ((static_cast<uint>(i) > 255) ? (((~i) >> 31) & 0xFF) : (i))
+
+// Compiler creates a fast path 1D IDCT for X non-zero columns
+template <int NONZERO_COLS>
+struct Row
+{
+ static void idct(int* pTemp, const jpgd_block_t* pSrc)
+ {
+ // ACCESS_COL() will be optimized at compile time to either an array access, or 0.
+ #define ACCESS_COL(x) (((x) < NONZERO_COLS) ? (int)pSrc[x] : 0)
+
+ const int z2 = ACCESS_COL(2), z3 = ACCESS_COL(6);
+
+ const int z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
+ const int tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);
+ const int tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
+
+ const int tmp0 = (ACCESS_COL(0) + ACCESS_COL(4)) << CONST_BITS;
+ const int tmp1 = (ACCESS_COL(0) - ACCESS_COL(4)) << CONST_BITS;
+
+ const int tmp10 = tmp0 + tmp3, tmp13 = tmp0 - tmp3, tmp11 = tmp1 + tmp2, tmp12 = tmp1 - tmp2;
+
+ const int atmp0 = ACCESS_COL(7), atmp1 = ACCESS_COL(5), atmp2 = ACCESS_COL(3), atmp3 = ACCESS_COL(1);
+
+ const int bz1 = atmp0 + atmp3, bz2 = atmp1 + atmp2, bz3 = atmp0 + atmp2, bz4 = atmp1 + atmp3;
+ const int bz5 = MULTIPLY(bz3 + bz4, FIX_1_175875602);
+
+ const int az1 = MULTIPLY(bz1, - FIX_0_899976223);
+ const int az2 = MULTIPLY(bz2, - FIX_2_562915447);
+ const int az3 = MULTIPLY(bz3, - FIX_1_961570560) + bz5;
+ const int az4 = MULTIPLY(bz4, - FIX_0_390180644) + bz5;
+
+ const int btmp0 = MULTIPLY(atmp0, FIX_0_298631336) + az1 + az3;
+ const int btmp1 = MULTIPLY(atmp1, FIX_2_053119869) + az2 + az4;
+ const int btmp2 = MULTIPLY(atmp2, FIX_3_072711026) + az2 + az3;
+ const int btmp3 = MULTIPLY(atmp3, FIX_1_501321110) + az1 + az4;
+
+ pTemp[0] = DESCALE(tmp10 + btmp3, CONST_BITS-PASS1_BITS);
+ pTemp[7] = DESCALE(tmp10 - btmp3, CONST_BITS-PASS1_BITS);
+ pTemp[1] = DESCALE(tmp11 + btmp2, CONST_BITS-PASS1_BITS);
+ pTemp[6] = DESCALE(tmp11 - btmp2, CONST_BITS-PASS1_BITS);
+ pTemp[2] = DESCALE(tmp12 + btmp1, CONST_BITS-PASS1_BITS);
+ pTemp[5] = DESCALE(tmp12 - btmp1, CONST_BITS-PASS1_BITS);
+ pTemp[3] = DESCALE(tmp13 + btmp0, CONST_BITS-PASS1_BITS);
+ pTemp[4] = DESCALE(tmp13 - btmp0, CONST_BITS-PASS1_BITS);
+ }
+};
+
+template <>
+struct Row<0>
+{
+ static void idct(int* pTemp, const jpgd_block_t* pSrc)
+ {
+#ifdef _MSC_VER
+ pTemp; pSrc;
+#endif
+ }
+};
+
+template <>
+struct Row<1>
+{
+ static void idct(int* pTemp, const jpgd_block_t* pSrc)
+ {
+ const int dcval = (pSrc[0] << PASS1_BITS);
+
+ pTemp[0] = dcval;
+ pTemp[1] = dcval;
+ pTemp[2] = dcval;
+ pTemp[3] = dcval;
+ pTemp[4] = dcval;
+ pTemp[5] = dcval;
+ pTemp[6] = dcval;
+ pTemp[7] = dcval;
+ }
+};
+
+// Compiler creates a fast path 1D IDCT for X non-zero rows
+template <int NONZERO_ROWS>
+struct Col
+{
+ static void idct(uint8* pDst_ptr, const int* pTemp)
+ {
+ // ACCESS_ROW() will be optimized at compile time to either an array access, or 0.
+ #define ACCESS_ROW(x) (((x) < NONZERO_ROWS) ? pTemp[x * 8] : 0)
+
+ const int z2 = ACCESS_ROW(2);
+ const int z3 = ACCESS_ROW(6);
+
+ const int z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
+ const int tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);
+ const int tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
+
+ const int tmp0 = (ACCESS_ROW(0) + ACCESS_ROW(4)) << CONST_BITS;
+ const int tmp1 = (ACCESS_ROW(0) - ACCESS_ROW(4)) << CONST_BITS;
+
+ const int tmp10 = tmp0 + tmp3, tmp13 = tmp0 - tmp3, tmp11 = tmp1 + tmp2, tmp12 = tmp1 - tmp2;
+
+ const int atmp0 = ACCESS_ROW(7), atmp1 = ACCESS_ROW(5), atmp2 = ACCESS_ROW(3), atmp3 = ACCESS_ROW(1);
+
+ const int bz1 = atmp0 + atmp3, bz2 = atmp1 + atmp2, bz3 = atmp0 + atmp2, bz4 = atmp1 + atmp3;
+ const int bz5 = MULTIPLY(bz3 + bz4, FIX_1_175875602);
+
+ const int az1 = MULTIPLY(bz1, - FIX_0_899976223);
+ const int az2 = MULTIPLY(bz2, - FIX_2_562915447);
+ const int az3 = MULTIPLY(bz3, - FIX_1_961570560) + bz5;
+ const int az4 = MULTIPLY(bz4, - FIX_0_390180644) + bz5;
+
+ const int btmp0 = MULTIPLY(atmp0, FIX_0_298631336) + az1 + az3;
+ const int btmp1 = MULTIPLY(atmp1, FIX_2_053119869) + az2 + az4;
+ const int btmp2 = MULTIPLY(atmp2, FIX_3_072711026) + az2 + az3;
+ const int btmp3 = MULTIPLY(atmp3, FIX_1_501321110) + az1 + az4;
+
+ int i = DESCALE_ZEROSHIFT(tmp10 + btmp3, CONST_BITS+PASS1_BITS+3);
+ pDst_ptr[8*0] = (uint8)CLAMP(i);
+
+ i = DESCALE_ZEROSHIFT(tmp10 - btmp3, CONST_BITS+PASS1_BITS+3);
+ pDst_ptr[8*7] = (uint8)CLAMP(i);
+
+ i = DESCALE_ZEROSHIFT(tmp11 + btmp2, CONST_BITS+PASS1_BITS+3);
+ pDst_ptr[8*1] = (uint8)CLAMP(i);
+
+ i = DESCALE_ZEROSHIFT(tmp11 - btmp2, CONST_BITS+PASS1_BITS+3);
+ pDst_ptr[8*6] = (uint8)CLAMP(i);
+
+ i = DESCALE_ZEROSHIFT(tmp12 + btmp1, CONST_BITS+PASS1_BITS+3);
+ pDst_ptr[8*2] = (uint8)CLAMP(i);
+
+ i = DESCALE_ZEROSHIFT(tmp12 - btmp1, CONST_BITS+PASS1_BITS+3);
+ pDst_ptr[8*5] = (uint8)CLAMP(i);
+
+ i = DESCALE_ZEROSHIFT(tmp13 + btmp0, CONST_BITS+PASS1_BITS+3);
+ pDst_ptr[8*3] = (uint8)CLAMP(i);
+
+ i = DESCALE_ZEROSHIFT(tmp13 - btmp0, CONST_BITS+PASS1_BITS+3);
+ pDst_ptr[8*4] = (uint8)CLAMP(i);
+ }
+};
+
+template <>
+struct Col<1>
+{
+ static void idct(uint8* pDst_ptr, const int* pTemp)
+ {
+ int dcval = DESCALE_ZEROSHIFT(pTemp[0], PASS1_BITS+3);
+ const uint8 dcval_clamped = (uint8)CLAMP(dcval);
+ pDst_ptr[0*8] = dcval_clamped;
+ pDst_ptr[1*8] = dcval_clamped;
+ pDst_ptr[2*8] = dcval_clamped;
+ pDst_ptr[3*8] = dcval_clamped;
+ pDst_ptr[4*8] = dcval_clamped;
+ pDst_ptr[5*8] = dcval_clamped;
+ pDst_ptr[6*8] = dcval_clamped;
+ pDst_ptr[7*8] = dcval_clamped;
+ }
+};
+
+static const uint8 s_idct_row_table[] =
+{
+ 1,0,0,0,0,0,0,0, 2,0,0,0,0,0,0,0, 2,1,0,0,0,0,0,0, 2,1,1,0,0,0,0,0, 2,2,1,0,0,0,0,0, 3,2,1,0,0,0,0,0, 4,2,1,0,0,0,0,0, 4,3,1,0,0,0,0,0,
+ 4,3,2,0,0,0,0,0, 4,3,2,1,0,0,0,0, 4,3,2,1,1,0,0,0, 4,3,2,2,1,0,0,0, 4,3,3,2,1,0,0,0, 4,4,3,2,1,0,0,0, 5,4,3,2,1,0,0,0, 6,4,3,2,1,0,0,0,
+ 6,5,3,2,1,0,0,0, 6,5,4,2,1,0,0,0, 6,5,4,3,1,0,0,0, 6,5,4,3,2,0,0,0, 6,5,4,3,2,1,0,0, 6,5,4,3,2,1,1,0, 6,5,4,3,2,2,1,0, 6,5,4,3,3,2,1,0,
+ 6,5,4,4,3,2,1,0, 6,5,5,4,3,2,1,0, 6,6,5,4,3,2,1,0, 7,6,5,4,3,2,1,0, 8,6,5,4,3,2,1,0, 8,7,5,4,3,2,1,0, 8,7,6,4,3,2,1,0, 8,7,6,5,3,2,1,0,
+ 8,7,6,5,4,2,1,0, 8,7,6,5,4,3,1,0, 8,7,6,5,4,3,2,0, 8,7,6,5,4,3,2,1, 8,7,6,5,4,3,2,2, 8,7,6,5,4,3,3,2, 8,7,6,5,4,4,3,2, 8,7,6,5,5,4,3,2,
+ 8,7,6,6,5,4,3,2, 8,7,7,6,5,4,3,2, 8,8,7,6,5,4,3,2, 8,8,8,6,5,4,3,2, 8,8,8,7,5,4,3,2, 8,8,8,7,6,4,3,2, 8,8,8,7,6,5,3,2, 8,8,8,7,6,5,4,2,
+ 8,8,8,7,6,5,4,3, 8,8,8,7,6,5,4,4, 8,8,8,7,6,5,5,4, 8,8,8,7,6,6,5,4, 8,8,8,7,7,6,5,4, 8,8,8,8,7,6,5,4, 8,8,8,8,8,6,5,4, 8,8,8,8,8,7,5,4,
+ 8,8,8,8,8,7,6,4, 8,8,8,8,8,7,6,5, 8,8,8,8,8,7,6,6, 8,8,8,8,8,7,7,6, 8,8,8,8,8,8,7,6, 8,8,8,8,8,8,8,6, 8,8,8,8,8,8,8,7, 8,8,8,8,8,8,8,8,
+};
+
+static const uint8 s_idct_col_table[] = { 1, 1, 2, 3, 3, 3, 3, 3, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 };
+
+void idct(const jpgd_block_t* pSrc_ptr, uint8* pDst_ptr, int block_max_zag)
+{
+ JPGD_ASSERT(block_max_zag >= 1);
+ JPGD_ASSERT(block_max_zag <= 64);
+
+ if (block_max_zag <= 1)
+ {
+ int k = ((pSrc_ptr[0] + 4) >> 3) + 128;
+ k = CLAMP(k);
+ k = k | (k<<8);
+ k = k | (k<<16);
+
+ for (int i = 8; i > 0; i--)
+ {
+ *(int*)&pDst_ptr[0] = k;
+ *(int*)&pDst_ptr[4] = k;
+ pDst_ptr += 8;
+ }
+ return;
+ }
+
+ int temp[64];
+
+ const jpgd_block_t* pSrc = pSrc_ptr;
+ int* pTemp = temp;
+
+ const uint8* pRow_tab = &s_idct_row_table[(block_max_zag - 1) * 8];
+ int i;
+ for (i = 8; i > 0; i--, pRow_tab++)
+ {
+ switch (*pRow_tab)
+ {
+ case 0: Row<0>::idct(pTemp, pSrc); break;
+ case 1: Row<1>::idct(pTemp, pSrc); break;
+ case 2: Row<2>::idct(pTemp, pSrc); break;
+ case 3: Row<3>::idct(pTemp, pSrc); break;
+ case 4: Row<4>::idct(pTemp, pSrc); break;
+ case 5: Row<5>::idct(pTemp, pSrc); break;
+ case 6: Row<6>::idct(pTemp, pSrc); break;
+ case 7: Row<7>::idct(pTemp, pSrc); break;
+ case 8: Row<8>::idct(pTemp, pSrc); break;
+ }
+
+ pSrc += 8;
+ pTemp += 8;
+ }
+
+ pTemp = temp;
+
+ const int nonzero_rows = s_idct_col_table[block_max_zag - 1];
+ for (i = 8; i > 0; i--)
+ {
+ switch (nonzero_rows)
+ {
+ case 1: Col<1>::idct(pDst_ptr, pTemp); break;
+ case 2: Col<2>::idct(pDst_ptr, pTemp); break;
+ case 3: Col<3>::idct(pDst_ptr, pTemp); break;
+ case 4: Col<4>::idct(pDst_ptr, pTemp); break;
+ case 5: Col<5>::idct(pDst_ptr, pTemp); break;
+ case 6: Col<6>::idct(pDst_ptr, pTemp); break;
+ case 7: Col<7>::idct(pDst_ptr, pTemp); break;
+ case 8: Col<8>::idct(pDst_ptr, pTemp); break;
+ }
+
+ pTemp++;
+ pDst_ptr++;
+ }
+}
+
+void idct_4x4(const jpgd_block_t* pSrc_ptr, uint8* pDst_ptr)
+{
+ int temp[64];
+ int* pTemp = temp;
+ const jpgd_block_t* pSrc = pSrc_ptr;
+
+ for (int i = 4; i > 0; i--)
+ {
+ Row<4>::idct(pTemp, pSrc);
+ pSrc += 8;
+ pTemp += 8;
+ }
+
+ pTemp = temp;
+ for (int i = 8; i > 0; i--)
+ {
+ Col<4>::idct(pDst_ptr, pTemp);
+ pTemp++;
+ pDst_ptr++;
+ }
+}
+
+// Retrieve one character from the input stream.
+inline uint jpeg_decoder::get_char()
+{
+ // Any bytes remaining in buffer?
+ if (!m_in_buf_left)
+ {
+ // Try to get more bytes.
+ prep_in_buffer();
+ // Still nothing to get?
+ if (!m_in_buf_left)
+ {
+ // Pad the end of the stream with 0xFF 0xD9 (EOI marker)
+ int t = m_tem_flag;
+ m_tem_flag ^= 1;
+ if (t)
+ return 0xD9;
+ else
+ return 0xFF;
+ }
+ }
+
+ uint c = *m_pIn_buf_ofs++;
+ m_in_buf_left--;
+
+ return c;
+}
+
+// Same as previous method, except can indicate if the character is a pad character or not.
+inline uint jpeg_decoder::get_char(bool *pPadding_flag)
+{
+ if (!m_in_buf_left)
+ {
+ prep_in_buffer();
+ if (!m_in_buf_left)
+ {
+ *pPadding_flag = true;
+ int t = m_tem_flag;
+ m_tem_flag ^= 1;
+ if (t)
+ return 0xD9;
+ else
+ return 0xFF;
+ }
+ }
+
+ *pPadding_flag = false;
+
+ uint c = *m_pIn_buf_ofs++;
+ m_in_buf_left--;
+
+ return c;
+}
+
+// Inserts a previously retrieved character back into the input buffer.
+inline void jpeg_decoder::stuff_char(uint8 q)
+{
+ *(--m_pIn_buf_ofs) = q;
+ m_in_buf_left++;
+}
+
+// Retrieves one character from the input stream, but does not read past markers. Will continue to return 0xFF when a marker is encountered.
+inline uint8 jpeg_decoder::get_octet()
+{
+ bool padding_flag;
+ int c = get_char(&padding_flag);
+
+ if (c == 0xFF)
+ {
+ if (padding_flag)
+ return 0xFF;
+
+ c = get_char(&padding_flag);
+ if (padding_flag)
+ {
+ stuff_char(0xFF);
+ return 0xFF;
+ }
+
+ if (c == 0x00)
+ return 0xFF;
+ else
+ {
+ stuff_char(static_cast<uint8>(c));
+ stuff_char(0xFF);
+ return 0xFF;
+ }
+ }
+
+ return static_cast<uint8>(c);
+}
+
+// Retrieves a variable number of bits from the input stream. Does not recognize markers.
+inline uint jpeg_decoder::get_bits(int num_bits)
+{
+ if (!num_bits)
+ return 0;
+
+ uint i = m_bit_buf >> (32 - num_bits);
+
+ if ((m_bits_left -= num_bits) <= 0)
+ {
+ m_bit_buf <<= (num_bits += m_bits_left);
+
+ uint c1 = get_char();
+ uint c2 = get_char();
+ m_bit_buf = (m_bit_buf & 0xFFFF0000) | (c1 << 8) | c2;
+
+ m_bit_buf <<= -m_bits_left;
+
+ m_bits_left += 16;
+
+ JPGD_ASSERT(m_bits_left >= 0);
+ }
+ else
+ m_bit_buf <<= num_bits;
+
+ return i;
+}
+
+// Retrieves a variable number of bits from the input stream. Markers will not be read into the input bit buffer. Instead, an infinite number of all 1's will be returned when a marker is encountered.
+inline uint jpeg_decoder::get_bits_no_markers(int num_bits)
+{
+ if (!num_bits)
+ return 0;
+
+ uint i = m_bit_buf >> (32 - num_bits);
+
+ if ((m_bits_left -= num_bits) <= 0)
+ {
+ m_bit_buf <<= (num_bits += m_bits_left);
+
+ if ((m_in_buf_left < 2) || (m_pIn_buf_ofs[0] == 0xFF) || (m_pIn_buf_ofs[1] == 0xFF))
+ {
+ uint c1 = get_octet();
+ uint c2 = get_octet();
+ m_bit_buf |= (c1 << 8) | c2;
+ }
+ else
+ {
+ m_bit_buf |= ((uint)m_pIn_buf_ofs[0] << 8) | m_pIn_buf_ofs[1];
+ m_in_buf_left -= 2;
+ m_pIn_buf_ofs += 2;
+ }
+
+ m_bit_buf <<= -m_bits_left;
+
+ m_bits_left += 16;
+
+ JPGD_ASSERT(m_bits_left >= 0);
+ }
+ else
+ m_bit_buf <<= num_bits;
+
+ return i;
+}
+
+// Decodes a Huffman encoded symbol.
+inline int jpeg_decoder::huff_decode(huff_tables *pH)
+{
+ int symbol;
+
+ // Check first 8-bits: do we have a complete symbol?
+ if ((symbol = pH->look_up[m_bit_buf >> 24]) < 0)
+ {
+ // Decode more bits, use a tree traversal to find symbol.
+ int ofs = 23;
+ do
+ {
+ symbol = pH->tree[-(int)(symbol + ((m_bit_buf >> ofs) & 1))];
+ ofs--;
+ } while (symbol < 0);
+
+ get_bits_no_markers(8 + (23 - ofs));
+ }
+ else
+ get_bits_no_markers(pH->code_size[symbol]);
+
+ return symbol;
+}
+
+// Decodes a Huffman encoded symbol.
+inline int jpeg_decoder::huff_decode(huff_tables *pH, int& extra_bits)
+{
+ int symbol;
+
+ // Check first 8-bits: do we have a complete symbol?
+ if ((symbol = pH->look_up2[m_bit_buf >> 24]) < 0)
+ {
+ // Use a tree traversal to find symbol.
+ int ofs = 23;
+ do
+ {
+ symbol = pH->tree[-(int)(symbol + ((m_bit_buf >> ofs) & 1))];
+ ofs--;
+ } while (symbol < 0);
+
+ get_bits_no_markers(8 + (23 - ofs));
+
+ extra_bits = get_bits_no_markers(symbol & 0xF);
+ }
+ else
+ {
+ JPGD_ASSERT(((symbol >> 8) & 31) == pH->code_size[symbol & 255] + ((symbol & 0x8000) ? (symbol & 15) : 0));
+
+ if (symbol & 0x8000)
+ {
+ get_bits_no_markers((symbol >> 8) & 31);
+ extra_bits = symbol >> 16;
+ }
+ else
+ {
+ int code_size = (symbol >> 8) & 31;
+ int num_extra_bits = symbol & 0xF;
+ int bits = code_size + num_extra_bits;
+ if (bits <= (m_bits_left + 16))
+ extra_bits = get_bits_no_markers(bits) & ((1 << num_extra_bits) - 1);
+ else
+ {
+ get_bits_no_markers(code_size);
+ extra_bits = get_bits_no_markers(num_extra_bits);
+ }
+ }
+
+ symbol &= 0xFF;
+ }
+
+ return symbol;
+}
+
+// Tables and macro used to fully decode the DPCM differences.
+static const int s_extend_test[16] = { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
+static const int s_extend_offset[16] = { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
+static const int s_extend_mask[] = { 0, (1<<0), (1<<1), (1<<2), (1<<3), (1<<4), (1<<5), (1<<6), (1<<7), (1<<8), (1<<9), (1<<10), (1<<11), (1<<12), (1<<13), (1<<14), (1<<15), (1<<16) };
+// The logical AND's in this macro are to shut up static code analysis (aren't really necessary - couldn't find another way to do this)
+#define JPGD_HUFF_EXTEND(x, s) (((x) < s_extend_test[s & 15]) ? ((x) + s_extend_offset[s & 15]) : (x))
+
+// Clamps a value between 0-255.
+inline uint8 jpeg_decoder::clamp(int i)
+{
+ if (static_cast<uint>(i) > 255)
+ i = (((~i) >> 31) & 0xFF);
+
+ return static_cast<uint8>(i);
+}
+
+namespace DCT_Upsample
+{
+ struct Matrix44
+ {
+ typedef int Element_Type;
+ enum { NUM_ROWS = 4, NUM_COLS = 4 };
+
+ Element_Type v[NUM_ROWS][NUM_COLS];
+
+ inline int rows() const { return NUM_ROWS; }
+ inline int cols() const { return NUM_COLS; }
+
+ inline const Element_Type & at(int r, int c) const { return v[r][c]; }
+ inline Element_Type & at(int r, int c) { return v[r][c]; }
+
+ inline Matrix44() { }
+
+ inline Matrix44& operator += (const Matrix44& a)
+ {
+ for (int r = 0; r < NUM_ROWS; r++)
+ {
+ at(r, 0) += a.at(r, 0);
+ at(r, 1) += a.at(r, 1);
+ at(r, 2) += a.at(r, 2);
+ at(r, 3) += a.at(r, 3);
+ }
+ return *this;
+ }
+
+ inline Matrix44& operator -= (const Matrix44& a)
+ {
+ for (int r = 0; r < NUM_ROWS; r++)
+ {
+ at(r, 0) -= a.at(r, 0);
+ at(r, 1) -= a.at(r, 1);
+ at(r, 2) -= a.at(r, 2);
+ at(r, 3) -= a.at(r, 3);
+ }
+ return *this;
+ }
+
+ friend inline Matrix44 operator + (const Matrix44& a, const Matrix44& b)
+ {
+ Matrix44 ret;
+ for (int r = 0; r < NUM_ROWS; r++)
+ {
+ ret.at(r, 0) = a.at(r, 0) + b.at(r, 0);
+ ret.at(r, 1) = a.at(r, 1) + b.at(r, 1);
+ ret.at(r, 2) = a.at(r, 2) + b.at(r, 2);
+ ret.at(r, 3) = a.at(r, 3) + b.at(r, 3);
+ }
+ return ret;
+ }
+
+ friend inline Matrix44 operator - (const Matrix44& a, const Matrix44& b)
+ {
+ Matrix44 ret;
+ for (int r = 0; r < NUM_ROWS; r++)
+ {
+ ret.at(r, 0) = a.at(r, 0) - b.at(r, 0);
+ ret.at(r, 1) = a.at(r, 1) - b.at(r, 1);
+ ret.at(r, 2) = a.at(r, 2) - b.at(r, 2);
+ ret.at(r, 3) = a.at(r, 3) - b.at(r, 3);
+ }
+ return ret;
+ }
+
+ static inline void add_and_store(jpgd_block_t* pDst, const Matrix44& a, const Matrix44& b)
+ {
+ for (int r = 0; r < 4; r++)
+ {
+ pDst[0*8 + r] = static_cast<jpgd_block_t>(a.at(r, 0) + b.at(r, 0));
+ pDst[1*8 + r] = static_cast<jpgd_block_t>(a.at(r, 1) + b.at(r, 1));
+ pDst[2*8 + r] = static_cast<jpgd_block_t>(a.at(r, 2) + b.at(r, 2));
+ pDst[3*8 + r] = static_cast<jpgd_block_t>(a.at(r, 3) + b.at(r, 3));
+ }
+ }
+
+ static inline void sub_and_store(jpgd_block_t* pDst, const Matrix44& a, const Matrix44& b)
+ {
+ for (int r = 0; r < 4; r++)
+ {
+ pDst[0*8 + r] = static_cast<jpgd_block_t>(a.at(r, 0) - b.at(r, 0));
+ pDst[1*8 + r] = static_cast<jpgd_block_t>(a.at(r, 1) - b.at(r, 1));
+ pDst[2*8 + r] = static_cast<jpgd_block_t>(a.at(r, 2) - b.at(r, 2));
+ pDst[3*8 + r] = static_cast<jpgd_block_t>(a.at(r, 3) - b.at(r, 3));
+ }
+ }
+ };
+
+ const int FRACT_BITS = 10;
+ const int SCALE = 1 << FRACT_BITS;
+
+ typedef int Temp_Type;
+ #define D(i) (((i) + (SCALE >> 1)) >> FRACT_BITS)
+ #define F(i) ((int)((i) * SCALE + .5f))
+
+ // Any decent C++ compiler will optimize this at compile time to a 0, or an array access.
+ #define AT(c, r) ((((c)>=NUM_COLS)||((r)>=NUM_ROWS)) ? 0 : pSrc[(c)+(r)*8])
+
+ // NUM_ROWS/NUM_COLS = # of non-zero rows/cols in input matrix
+ template<int NUM_ROWS, int NUM_COLS>
+ struct P_Q
+ {
+ static void calc(Matrix44& P, Matrix44& Q, const jpgd_block_t* pSrc)
+ {
+ // 4x8 = 4x8 times 8x8, matrix 0 is constant
+ const Temp_Type X000 = AT(0, 0);
+ const Temp_Type X001 = AT(0, 1);
+ const Temp_Type X002 = AT(0, 2);
+ const Temp_Type X003 = AT(0, 3);
+ const Temp_Type X004 = AT(0, 4);
+ const Temp_Type X005 = AT(0, 5);
+ const Temp_Type X006 = AT(0, 6);
+ const Temp_Type X007 = AT(0, 7);
+ const Temp_Type X010 = D(F(0.415735f) * AT(1, 0) + F(0.791065f) * AT(3, 0) + F(-0.352443f) * AT(5, 0) + F(0.277785f) * AT(7, 0));
+ const Temp_Type X011 = D(F(0.415735f) * AT(1, 1) + F(0.791065f) * AT(3, 1) + F(-0.352443f) * AT(5, 1) + F(0.277785f) * AT(7, 1));
+ const Temp_Type X012 = D(F(0.415735f) * AT(1, 2) + F(0.791065f) * AT(3, 2) + F(-0.352443f) * AT(5, 2) + F(0.277785f) * AT(7, 2));
+ const Temp_Type X013 = D(F(0.415735f) * AT(1, 3) + F(0.791065f) * AT(3, 3) + F(-0.352443f) * AT(5, 3) + F(0.277785f) * AT(7, 3));
+ const Temp_Type X014 = D(F(0.415735f) * AT(1, 4) + F(0.791065f) * AT(3, 4) + F(-0.352443f) * AT(5, 4) + F(0.277785f) * AT(7, 4));
+ const Temp_Type X015 = D(F(0.415735f) * AT(1, 5) + F(0.791065f) * AT(3, 5) + F(-0.352443f) * AT(5, 5) + F(0.277785f) * AT(7, 5));
+ const Temp_Type X016 = D(F(0.415735f) * AT(1, 6) + F(0.791065f) * AT(3, 6) + F(-0.352443f) * AT(5, 6) + F(0.277785f) * AT(7, 6));
+ const Temp_Type X017 = D(F(0.415735f) * AT(1, 7) + F(0.791065f) * AT(3, 7) + F(-0.352443f) * AT(5, 7) + F(0.277785f) * AT(7, 7));
+ const Temp_Type X020 = AT(4, 0);
+ const Temp_Type X021 = AT(4, 1);
+ const Temp_Type X022 = AT(4, 2);
+ const Temp_Type X023 = AT(4, 3);
+ const Temp_Type X024 = AT(4, 4);
+ const Temp_Type X025 = AT(4, 5);
+ const Temp_Type X026 = AT(4, 6);
+ const Temp_Type X027 = AT(4, 7);
+ const Temp_Type X030 = D(F(0.022887f) * AT(1, 0) + F(-0.097545f) * AT(3, 0) + F(0.490393f) * AT(5, 0) + F(0.865723f) * AT(7, 0));
+ const Temp_Type X031 = D(F(0.022887f) * AT(1, 1) + F(-0.097545f) * AT(3, 1) + F(0.490393f) * AT(5, 1) + F(0.865723f) * AT(7, 1));
+ const Temp_Type X032 = D(F(0.022887f) * AT(1, 2) + F(-0.097545f) * AT(3, 2) + F(0.490393f) * AT(5, 2) + F(0.865723f) * AT(7, 2));
+ const Temp_Type X033 = D(F(0.022887f) * AT(1, 3) + F(-0.097545f) * AT(3, 3) + F(0.490393f) * AT(5, 3) + F(0.865723f) * AT(7, 3));
+ const Temp_Type X034 = D(F(0.022887f) * AT(1, 4) + F(-0.097545f) * AT(3, 4) + F(0.490393f) * AT(5, 4) + F(0.865723f) * AT(7, 4));
+ const Temp_Type X035 = D(F(0.022887f) * AT(1, 5) + F(-0.097545f) * AT(3, 5) + F(0.490393f) * AT(5, 5) + F(0.865723f) * AT(7, 5));
+ const Temp_Type X036 = D(F(0.022887f) * AT(1, 6) + F(-0.097545f) * AT(3, 6) + F(0.490393f) * AT(5, 6) + F(0.865723f) * AT(7, 6));
+ const Temp_Type X037 = D(F(0.022887f) * AT(1, 7) + F(-0.097545f) * AT(3, 7) + F(0.490393f) * AT(5, 7) + F(0.865723f) * AT(7, 7));
+
+ // 4x4 = 4x8 times 8x4, matrix 1 is constant
+ P.at(0, 0) = X000;
+ P.at(0, 1) = D(X001 * F(0.415735f) + X003 * F(0.791065f) + X005 * F(-0.352443f) + X007 * F(0.277785f));
+ P.at(0, 2) = X004;
+ P.at(0, 3) = D(X001 * F(0.022887f) + X003 * F(-0.097545f) + X005 * F(0.490393f) + X007 * F(0.865723f));
+ P.at(1, 0) = X010;
+ P.at(1, 1) = D(X011 * F(0.415735f) + X013 * F(0.791065f) + X015 * F(-0.352443f) + X017 * F(0.277785f));
+ P.at(1, 2) = X014;
+ P.at(1, 3) = D(X011 * F(0.022887f) + X013 * F(-0.097545f) + X015 * F(0.490393f) + X017 * F(0.865723f));
+ P.at(2, 0) = X020;
+ P.at(2, 1) = D(X021 * F(0.415735f) + X023 * F(0.791065f) + X025 * F(-0.352443f) + X027 * F(0.277785f));
+ P.at(2, 2) = X024;
+ P.at(2, 3) = D(X021 * F(0.022887f) + X023 * F(-0.097545f) + X025 * F(0.490393f) + X027 * F(0.865723f));
+ P.at(3, 0) = X030;
+ P.at(3, 1) = D(X031 * F(0.415735f) + X033 * F(0.791065f) + X035 * F(-0.352443f) + X037 * F(0.277785f));
+ P.at(3, 2) = X034;
+ P.at(3, 3) = D(X031 * F(0.022887f) + X033 * F(-0.097545f) + X035 * F(0.490393f) + X037 * F(0.865723f));
+ // 40 muls 24 adds
+
+ // 4x4 = 4x8 times 8x4, matrix 1 is constant
+ Q.at(0, 0) = D(X001 * F(0.906127f) + X003 * F(-0.318190f) + X005 * F(0.212608f) + X007 * F(-0.180240f));
+ Q.at(0, 1) = X002;
+ Q.at(0, 2) = D(X001 * F(-0.074658f) + X003 * F(0.513280f) + X005 * F(0.768178f) + X007 * F(-0.375330f));
+ Q.at(0, 3) = X006;
+ Q.at(1, 0) = D(X011 * F(0.906127f) + X013 * F(-0.318190f) + X015 * F(0.212608f) + X017 * F(-0.180240f));
+ Q.at(1, 1) = X012;
+ Q.at(1, 2) = D(X011 * F(-0.074658f) + X013 * F(0.513280f) + X015 * F(0.768178f) + X017 * F(-0.375330f));
+ Q.at(1, 3) = X016;
+ Q.at(2, 0) = D(X021 * F(0.906127f) + X023 * F(-0.318190f) + X025 * F(0.212608f) + X027 * F(-0.180240f));
+ Q.at(2, 1) = X022;
+ Q.at(2, 2) = D(X021 * F(-0.074658f) + X023 * F(0.513280f) + X025 * F(0.768178f) + X027 * F(-0.375330f));
+ Q.at(2, 3) = X026;
+ Q.at(3, 0) = D(X031 * F(0.906127f) + X033 * F(-0.318190f) + X035 * F(0.212608f) + X037 * F(-0.180240f));
+ Q.at(3, 1) = X032;
+ Q.at(3, 2) = D(X031 * F(-0.074658f) + X033 * F(0.513280f) + X035 * F(0.768178f) + X037 * F(-0.375330f));
+ Q.at(3, 3) = X036;
+ // 40 muls 24 adds
+ }
+ };
+
+ template<int NUM_ROWS, int NUM_COLS>
+ struct R_S
+ {
+ static void calc(Matrix44& R, Matrix44& S, const jpgd_block_t* pSrc)
+ {
+ // 4x8 = 4x8 times 8x8, matrix 0 is constant
+ const Temp_Type X100 = D(F(0.906127f) * AT(1, 0) + F(-0.318190f) * AT(3, 0) + F(0.212608f) * AT(5, 0) + F(-0.180240f) * AT(7, 0));
+ const Temp_Type X101 = D(F(0.906127f) * AT(1, 1) + F(-0.318190f) * AT(3, 1) + F(0.212608f) * AT(5, 1) + F(-0.180240f) * AT(7, 1));
+ const Temp_Type X102 = D(F(0.906127f) * AT(1, 2) + F(-0.318190f) * AT(3, 2) + F(0.212608f) * AT(5, 2) + F(-0.180240f) * AT(7, 2));
+ const Temp_Type X103 = D(F(0.906127f) * AT(1, 3) + F(-0.318190f) * AT(3, 3) + F(0.212608f) * AT(5, 3) + F(-0.180240f) * AT(7, 3));
+ const Temp_Type X104 = D(F(0.906127f) * AT(1, 4) + F(-0.318190f) * AT(3, 4) + F(0.212608f) * AT(5, 4) + F(-0.180240f) * AT(7, 4));
+ const Temp_Type X105 = D(F(0.906127f) * AT(1, 5) + F(-0.318190f) * AT(3, 5) + F(0.212608f) * AT(5, 5) + F(-0.180240f) * AT(7, 5));
+ const Temp_Type X106 = D(F(0.906127f) * AT(1, 6) + F(-0.318190f) * AT(3, 6) + F(0.212608f) * AT(5, 6) + F(-0.180240f) * AT(7, 6));
+ const Temp_Type X107 = D(F(0.906127f) * AT(1, 7) + F(-0.318190f) * AT(3, 7) + F(0.212608f) * AT(5, 7) + F(-0.180240f) * AT(7, 7));
+ const Temp_Type X110 = AT(2, 0);
+ const Temp_Type X111 = AT(2, 1);
+ const Temp_Type X112 = AT(2, 2);
+ const Temp_Type X113 = AT(2, 3);
+ const Temp_Type X114 = AT(2, 4);
+ const Temp_Type X115 = AT(2, 5);
+ const Temp_Type X116 = AT(2, 6);
+ const Temp_Type X117 = AT(2, 7);
+ const Temp_Type X120 = D(F(-0.074658f) * AT(1, 0) + F(0.513280f) * AT(3, 0) + F(0.768178f) * AT(5, 0) + F(-0.375330f) * AT(7, 0));
+ const Temp_Type X121 = D(F(-0.074658f) * AT(1, 1) + F(0.513280f) * AT(3, 1) + F(0.768178f) * AT(5, 1) + F(-0.375330f) * AT(7, 1));
+ const Temp_Type X122 = D(F(-0.074658f) * AT(1, 2) + F(0.513280f) * AT(3, 2) + F(0.768178f) * AT(5, 2) + F(-0.375330f) * AT(7, 2));
+ const Temp_Type X123 = D(F(-0.074658f) * AT(1, 3) + F(0.513280f) * AT(3, 3) + F(0.768178f) * AT(5, 3) + F(-0.375330f) * AT(7, 3));
+ const Temp_Type X124 = D(F(-0.074658f) * AT(1, 4) + F(0.513280f) * AT(3, 4) + F(0.768178f) * AT(5, 4) + F(-0.375330f) * AT(7, 4));
+ const Temp_Type X125 = D(F(-0.074658f) * AT(1, 5) + F(0.513280f) * AT(3, 5) + F(0.768178f) * AT(5, 5) + F(-0.375330f) * AT(7, 5));
+ const Temp_Type X126 = D(F(-0.074658f) * AT(1, 6) + F(0.513280f) * AT(3, 6) + F(0.768178f) * AT(5, 6) + F(-0.375330f) * AT(7, 6));
+ const Temp_Type X127 = D(F(-0.074658f) * AT(1, 7) + F(0.513280f) * AT(3, 7) + F(0.768178f) * AT(5, 7) + F(-0.375330f) * AT(7, 7));
+ const Temp_Type X130 = AT(6, 0);
+ const Temp_Type X131 = AT(6, 1);
+ const Temp_Type X132 = AT(6, 2);
+ const Temp_Type X133 = AT(6, 3);
+ const Temp_Type X134 = AT(6, 4);
+ const Temp_Type X135 = AT(6, 5);
+ const Temp_Type X136 = AT(6, 6);
+ const Temp_Type X137 = AT(6, 7);
+ // 80 muls 48 adds
+
+ // 4x4 = 4x8 times 8x4, matrix 1 is constant
+ R.at(0, 0) = X100;
+ R.at(0, 1) = D(X101 * F(0.415735f) + X103 * F(0.791065f) + X105 * F(-0.352443f) + X107 * F(0.277785f));
+ R.at(0, 2) = X104;
+ R.at(0, 3) = D(X101 * F(0.022887f) + X103 * F(-0.097545f) + X105 * F(0.490393f) + X107 * F(0.865723f));
+ R.at(1, 0) = X110;
+ R.at(1, 1) = D(X111 * F(0.415735f) + X113 * F(0.791065f) + X115 * F(-0.352443f) + X117 * F(0.277785f));
+ R.at(1, 2) = X114;
+ R.at(1, 3) = D(X111 * F(0.022887f) + X113 * F(-0.097545f) + X115 * F(0.490393f) + X117 * F(0.865723f));
+ R.at(2, 0) = X120;
+ R.at(2, 1) = D(X121 * F(0.415735f) + X123 * F(0.791065f) + X125 * F(-0.352443f) + X127 * F(0.277785f));
+ R.at(2, 2) = X124;
+ R.at(2, 3) = D(X121 * F(0.022887f) + X123 * F(-0.097545f) + X125 * F(0.490393f) + X127 * F(0.865723f));
+ R.at(3, 0) = X130;
+ R.at(3, 1) = D(X131 * F(0.415735f) + X133 * F(0.791065f) + X135 * F(-0.352443f) + X137 * F(0.277785f));
+ R.at(3, 2) = X134;
+ R.at(3, 3) = D(X131 * F(0.022887f) + X133 * F(-0.097545f) + X135 * F(0.490393f) + X137 * F(0.865723f));
+ // 40 muls 24 adds
+ // 4x4 = 4x8 times 8x4, matrix 1 is constant
+ S.at(0, 0) = D(X101 * F(0.906127f) + X103 * F(-0.318190f) + X105 * F(0.212608f) + X107 * F(-0.180240f));
+ S.at(0, 1) = X102;
+ S.at(0, 2) = D(X101 * F(-0.074658f) + X103 * F(0.513280f) + X105 * F(0.768178f) + X107 * F(-0.375330f));
+ S.at(0, 3) = X106;
+ S.at(1, 0) = D(X111 * F(0.906127f) + X113 * F(-0.318190f) + X115 * F(0.212608f) + X117 * F(-0.180240f));
+ S.at(1, 1) = X112;
+ S.at(1, 2) = D(X111 * F(-0.074658f) + X113 * F(0.513280f) + X115 * F(0.768178f) + X117 * F(-0.375330f));
+ S.at(1, 3) = X116;
+ S.at(2, 0) = D(X121 * F(0.906127f) + X123 * F(-0.318190f) + X125 * F(0.212608f) + X127 * F(-0.180240f));
+ S.at(2, 1) = X122;
+ S.at(2, 2) = D(X121 * F(-0.074658f) + X123 * F(0.513280f) + X125 * F(0.768178f) + X127 * F(-0.375330f));
+ S.at(2, 3) = X126;
+ S.at(3, 0) = D(X131 * F(0.906127f) + X133 * F(-0.318190f) + X135 * F(0.212608f) + X137 * F(-0.180240f));
+ S.at(3, 1) = X132;
+ S.at(3, 2) = D(X131 * F(-0.074658f) + X133 * F(0.513280f) + X135 * F(0.768178f) + X137 * F(-0.375330f));
+ S.at(3, 3) = X136;
+ // 40 muls 24 adds
+ }
+ };
+} // end namespace DCT_Upsample
+
+// Unconditionally frees all allocated m_blocks.
+void jpeg_decoder::free_all_blocks()
+{
+ m_pStream = NULL;
+ for (mem_block *b = m_pMem_blocks; b; )
+ {
+ mem_block *n = b->m_pNext;
+ jpgd_free(b);
+ b = n;
+ }
+ m_pMem_blocks = NULL;
+}
+
+// This method handles all errors. It will never return.
+// It could easily be changed to use C++ exceptions.
+JPGD_NORETURN void jpeg_decoder::stop_decoding(jpgd_status status)
+{
+ m_error_code = status;
+ free_all_blocks();
+ longjmp(m_jmp_state, status);
+}
+
+void *jpeg_decoder::alloc(size_t nSize, bool zero)
+{
+ nSize = (JPGD_MAX(nSize, 1) + 3) & ~3;
+ char *rv = NULL;
+ for (mem_block *b = m_pMem_blocks; b; b = b->m_pNext)
+ {
+ if ((b->m_used_count + nSize) <= b->m_size)
+ {
+ rv = b->m_data + b->m_used_count;
+ b->m_used_count += nSize;
+ break;
+ }
+ }
+ if (!rv)
+ {
+ int capacity = JPGD_MAX(32768 - 256, (nSize + 2047) & ~2047);
+ mem_block *b = (mem_block*)jpgd_malloc(sizeof(mem_block) + capacity);
+ if (!b) { stop_decoding(JPGD_NOTENOUGHMEM); }
+ b->m_pNext = m_pMem_blocks; m_pMem_blocks = b;
+ b->m_used_count = nSize;
+ b->m_size = capacity;
+ rv = b->m_data;
+ }
+ if (zero) memset(rv, 0, nSize);
+ return rv;
+}
+
+void jpeg_decoder::word_clear(void *p, uint16 c, uint n)
+{
+ uint8 *pD = (uint8*)p;
+ const uint8 l = c & 0xFF, h = (c >> 8) & 0xFF;
+ while (n)
+ {
+ pD[0] = l; pD[1] = h; pD += 2;
+ n--;
+ }
+}
+
+// Refill the input buffer.
+// This method will sit in a loop until (A) the buffer is full or (B)
+// the stream's read() method reports and end of file condition.
+void jpeg_decoder::prep_in_buffer()
+{
+ m_in_buf_left = 0;
+ m_pIn_buf_ofs = m_in_buf;
+
+ if (m_eof_flag)
+ return;
+
+ do
+ {
+ int bytes_read = m_pStream->read(m_in_buf + m_in_buf_left, JPGD_IN_BUF_SIZE - m_in_buf_left, &m_eof_flag);
+ if (bytes_read == -1)
+ stop_decoding(JPGD_STREAM_READ);
+
+ m_in_buf_left += bytes_read;
+ } while ((m_in_buf_left < JPGD_IN_BUF_SIZE) && (!m_eof_flag));
+
+ m_total_bytes_read += m_in_buf_left;
+
+ // Pad the end of the block with M_EOI (prevents the decompressor from going off the rails if the stream is invalid).
+ // (This dates way back to when this decompressor was written in C/asm, and the all-asm Huffman decoder did some fancy things to increase perf.)
+ word_clear(m_pIn_buf_ofs + m_in_buf_left, 0xD9FF, 64);
+}
+
+// Read a Huffman code table.
+void jpeg_decoder::read_dht_marker()
+{
+ int i, index, count;
+ uint8 huff_num[17];
+ uint8 huff_val[256];
+
+ uint num_left = get_bits(16);
+
+ if (num_left < 2)
+ stop_decoding(JPGD_BAD_DHT_MARKER);
+
+ num_left -= 2;
+
+ while (num_left)
+ {
+ index = get_bits(8);
+
+ huff_num[0] = 0;
+
+ count = 0;
+
+ for (i = 1; i <= 16; i++)
+ {
+ huff_num[i] = static_cast<uint8>(get_bits(8));
+ count += huff_num[i];
+ }
+
+ if (count > 255)
+ stop_decoding(JPGD_BAD_DHT_COUNTS);
+
+ for (i = 0; i < count; i++)
+ huff_val[i] = static_cast<uint8>(get_bits(8));
+
+ i = 1 + 16 + count;
+
+ if (num_left < (uint)i)
+ stop_decoding(JPGD_BAD_DHT_MARKER);
+
+ num_left -= i;
+
+ if ((index & 0x10) > 0x10)
+ stop_decoding(JPGD_BAD_DHT_INDEX);
+
+ index = (index & 0x0F) + ((index & 0x10) >> 4) * (JPGD_MAX_HUFF_TABLES >> 1);
+
+ if (index >= JPGD_MAX_HUFF_TABLES)
+ stop_decoding(JPGD_BAD_DHT_INDEX);
+
+ if (!m_huff_num[index])
+ m_huff_num[index] = (uint8 *)alloc(17);
+
+ if (!m_huff_val[index])
+ m_huff_val[index] = (uint8 *)alloc(256);
+
+ m_huff_ac[index] = (index & 0x10) != 0;
+ memcpy(m_huff_num[index], huff_num, 17);
+ memcpy(m_huff_val[index], huff_val, 256);
+ }
+}
+
+// Read a quantization table.
+void jpeg_decoder::read_dqt_marker()
+{
+ int n, i, prec;
+ uint num_left;
+ uint temp;
+
+ num_left = get_bits(16);
+
+ if (num_left < 2)
+ stop_decoding(JPGD_BAD_DQT_MARKER);
+
+ num_left -= 2;
+
+ while (num_left)
+ {
+ n = get_bits(8);
+ prec = n >> 4;
+ n &= 0x0F;
+
+ if (n >= JPGD_MAX_QUANT_TABLES)
+ stop_decoding(JPGD_BAD_DQT_TABLE);
+
+ if (!m_quant[n])
+ m_quant[n] = (jpgd_quant_t *)alloc(64 * sizeof(jpgd_quant_t));
+
+ // read quantization entries, in zag order
+ for (i = 0; i < 64; i++)
+ {
+ temp = get_bits(8);
+
+ if (prec)
+ temp = (temp << 8) + get_bits(8);
+
+ m_quant[n][i] = static_cast<jpgd_quant_t>(temp);
+ }
+
+ i = 64 + 1;
+
+ if (prec)
+ i += 64;
+
+ if (num_left < (uint)i)
+ stop_decoding(JPGD_BAD_DQT_LENGTH);
+
+ num_left -= i;
+ }
+}
+
+// Read the start of frame (SOF) marker.
+void jpeg_decoder::read_sof_marker()
+{
+ int i;
+ uint num_left;
+
+ num_left = get_bits(16);
+
+ if (get_bits(8) != 8) /* precision: sorry, only 8-bit precision is supported right now */
+ stop_decoding(JPGD_BAD_PRECISION);
+
+ m_image_y_size = get_bits(16);
+
+ if ((m_image_y_size < 1) || (m_image_y_size > JPGD_MAX_HEIGHT))
+ stop_decoding(JPGD_BAD_HEIGHT);
+
+ m_image_x_size = get_bits(16);
+
+ if ((m_image_x_size < 1) || (m_image_x_size > JPGD_MAX_WIDTH))
+ stop_decoding(JPGD_BAD_WIDTH);
+
+ m_comps_in_frame = get_bits(8);
+
+ if (m_comps_in_frame > JPGD_MAX_COMPONENTS)
+ stop_decoding(JPGD_TOO_MANY_COMPONENTS);
+
+ if (num_left != (uint)(m_comps_in_frame * 3 + 8))
+ stop_decoding(JPGD_BAD_SOF_LENGTH);
+
+ for (i = 0; i < m_comps_in_frame; i++)
+ {
+ m_comp_ident[i] = get_bits(8);
+ m_comp_h_samp[i] = get_bits(4);
+ m_comp_v_samp[i] = get_bits(4);
+ m_comp_quant[i] = get_bits(8);
+ }
+}
+
+// Used to skip unrecognized markers.
+void jpeg_decoder::skip_variable_marker()
+{
+ uint num_left;
+
+ num_left = get_bits(16);
+
+ if (num_left < 2)
+ stop_decoding(JPGD_BAD_VARIABLE_MARKER);
+
+ num_left -= 2;
+
+ while (num_left)
+ {
+ get_bits(8);
+ num_left--;
+ }
+}
+
+// Read a define restart interval (DRI) marker.
+void jpeg_decoder::read_dri_marker()
+{
+ if (get_bits(16) != 4)
+ stop_decoding(JPGD_BAD_DRI_LENGTH);
+
+ m_restart_interval = get_bits(16);
+}
+
+// Read a start of scan (SOS) marker.
+void jpeg_decoder::read_sos_marker()
+{
+ uint num_left;
+ int i, ci, n, c, cc;
+
+ num_left = get_bits(16);
+
+ n = get_bits(8);
+
+ m_comps_in_scan = n;
+
+ num_left -= 3;
+
+ if ( (num_left != (uint)(n * 2 + 3)) || (n < 1) || (n > JPGD_MAX_COMPS_IN_SCAN) )
+ stop_decoding(JPGD_BAD_SOS_LENGTH);
+
+ for (i = 0; i < n; i++)
+ {
+ cc = get_bits(8);
+ c = get_bits(8);
+ num_left -= 2;
+
+ for (ci = 0; ci < m_comps_in_frame; ci++)
+ if (cc == m_comp_ident[ci])
+ break;
+
+ if (ci >= m_comps_in_frame)
+ stop_decoding(JPGD_BAD_SOS_COMP_ID);
+
+ m_comp_list[i] = ci;
+ m_comp_dc_tab[ci] = (c >> 4) & 15;
+ m_comp_ac_tab[ci] = (c & 15) + (JPGD_MAX_HUFF_TABLES >> 1);
+ }
+
+ m_spectral_start = get_bits(8);
+ m_spectral_end = get_bits(8);
+ m_successive_high = get_bits(4);
+ m_successive_low = get_bits(4);
+
+ if (!m_progressive_flag)
+ {
+ m_spectral_start = 0;
+ m_spectral_end = 63;
+ }
+
+ num_left -= 3;
+
+ while (num_left) /* read past whatever is num_left */
+ {
+ get_bits(8);
+ num_left--;
+ }
+}
+
+// Finds the next marker.
+int jpeg_decoder::next_marker()
+{
+ uint c, bytes;
+
+ bytes = 0;
+
+ do
+ {
+ do
+ {
+ bytes++;
+ c = get_bits(8);
+ } while (c != 0xFF);
+
+ do
+ {
+ c = get_bits(8);
+ } while (c == 0xFF);
+
+ } while (c == 0);
+
+ // If bytes > 0 here, there where extra bytes before the marker (not good).
+
+ return c;
+}
+
+// Process markers. Returns when an SOFx, SOI, EOI, or SOS marker is
+// encountered.
+int jpeg_decoder::process_markers()
+{
+ int c;
+
+ for ( ; ; )
+ {
+ c = next_marker();
+
+ switch (c)
+ {
+ case M_SOF0:
+ case M_SOF1:
+ case M_SOF2:
+ case M_SOF3:
+ case M_SOF5:
+ case M_SOF6:
+ case M_SOF7:
+// case M_JPG:
+ case M_SOF9:
+ case M_SOF10:
+ case M_SOF11:
+ case M_SOF13:
+ case M_SOF14:
+ case M_SOF15:
+ case M_SOI:
+ case M_EOI:
+ case M_SOS:
+ {
+ return c;
+ }
+ case M_DHT:
+ {
+ read_dht_marker();
+ break;
+ }
+ // No arithmitic support - dumb patents!
+ case M_DAC:
+ {
+ stop_decoding(JPGD_NO_ARITHMITIC_SUPPORT);
+ break;
+ }
+ case M_DQT:
+ {
+ read_dqt_marker();
+ break;
+ }
+ case M_DRI:
+ {
+ read_dri_marker();
+ break;
+ }
+ //case M_APP0: /* no need to read the JFIF marker */
+
+ case M_JPG:
+ case M_RST0: /* no parameters */
+ case M_RST1:
+ case M_RST2:
+ case M_RST3:
+ case M_RST4:
+ case M_RST5:
+ case M_RST6:
+ case M_RST7:
+ case M_TEM:
+ {
+ stop_decoding(JPGD_UNEXPECTED_MARKER);
+ break;
+ }
+ default: /* must be DNL, DHP, EXP, APPn, JPGn, COM, or RESn or APP0 */
+ {
+ skip_variable_marker();
+ break;
+ }
+ }
+ }
+}
+
+// Finds the start of image (SOI) marker.
+// This code is rather defensive: it only checks the first 512 bytes to avoid
+// false positives.
+void jpeg_decoder::locate_soi_marker()
+{
+ uint lastchar, thischar;
+ uint bytesleft;
+
+ lastchar = get_bits(8);
+
+ thischar = get_bits(8);
+
+ /* ok if it's a normal JPEG file without a special header */
+
+ if ((lastchar == 0xFF) && (thischar == M_SOI))
+ return;
+
+ bytesleft = 4096; //512;
+
+ for ( ; ; )
+ {
+ if (--bytesleft == 0)
+ stop_decoding(JPGD_NOT_JPEG);
+
+ lastchar = thischar;
+
+ thischar = get_bits(8);
+
+ if (lastchar == 0xFF)
+ {
+ if (thischar == M_SOI)
+ break;
+ else if (thischar == M_EOI) // get_bits will keep returning M_EOI if we read past the end
+ stop_decoding(JPGD_NOT_JPEG);
+ }
+ }
+
+ // Check the next character after marker: if it's not 0xFF, it can't be the start of the next marker, so the file is bad.
+ thischar = (m_bit_buf >> 24) & 0xFF;
+
+ if (thischar != 0xFF)
+ stop_decoding(JPGD_NOT_JPEG);
+}
+
+// Find a start of frame (SOF) marker.
+void jpeg_decoder::locate_sof_marker()
+{
+ locate_soi_marker();
+
+ int c = process_markers();
+
+ switch (c)
+ {
+ case M_SOF2:
+ m_progressive_flag = JPGD_TRUE;
+ case M_SOF0: /* baseline DCT */
+ case M_SOF1: /* extended sequential DCT */
+ {
+ read_sof_marker();
+ break;
+ }
+ case M_SOF9: /* Arithmitic coding */
+ {
+ stop_decoding(JPGD_NO_ARITHMITIC_SUPPORT);
+ break;
+ }
+ default:
+ {
+ stop_decoding(JPGD_UNSUPPORTED_MARKER);
+ break;
+ }
+ }
+}
+
+// Find a start of scan (SOS) marker.
+int jpeg_decoder::locate_sos_marker()
+{
+ int c;
+
+ c = process_markers();
+
+ if (c == M_EOI)
+ return JPGD_FALSE;
+ else if (c != M_SOS)
+ stop_decoding(JPGD_UNEXPECTED_MARKER);
+
+ read_sos_marker();
+
+ return JPGD_TRUE;
+}
+
+// Reset everything to default/uninitialized state.
+void jpeg_decoder::init(jpeg_decoder_stream *pStream)
+{
+ m_pMem_blocks = NULL;
+ m_error_code = JPGD_SUCCESS;
+ m_ready_flag = false;
+ m_image_x_size = m_image_y_size = 0;
+ m_pStream = pStream;
+ m_progressive_flag = JPGD_FALSE;
+
+ memset(m_huff_ac, 0, sizeof(m_huff_ac));
+ memset(m_huff_num, 0, sizeof(m_huff_num));
+ memset(m_huff_val, 0, sizeof(m_huff_val));
+ memset(m_quant, 0, sizeof(m_quant));
+
+ m_scan_type = 0;
+ m_comps_in_frame = 0;
+
+ memset(m_comp_h_samp, 0, sizeof(m_comp_h_samp));
+ memset(m_comp_v_samp, 0, sizeof(m_comp_v_samp));
+ memset(m_comp_quant, 0, sizeof(m_comp_quant));
+ memset(m_comp_ident, 0, sizeof(m_comp_ident));
+ memset(m_comp_h_blocks, 0, sizeof(m_comp_h_blocks));
+ memset(m_comp_v_blocks, 0, sizeof(m_comp_v_blocks));
+
+ m_comps_in_scan = 0;
+ memset(m_comp_list, 0, sizeof(m_comp_list));
+ memset(m_comp_dc_tab, 0, sizeof(m_comp_dc_tab));
+ memset(m_comp_ac_tab, 0, sizeof(m_comp_ac_tab));
+
+ m_spectral_start = 0;
+ m_spectral_end = 0;
+ m_successive_low = 0;
+ m_successive_high = 0;
+ m_max_mcu_x_size = 0;
+ m_max_mcu_y_size = 0;
+ m_blocks_per_mcu = 0;
+ m_max_blocks_per_row = 0;
+ m_mcus_per_row = 0;
+ m_mcus_per_col = 0;
+ m_expanded_blocks_per_component = 0;
+ m_expanded_blocks_per_mcu = 0;
+ m_expanded_blocks_per_row = 0;
+ m_freq_domain_chroma_upsample = false;
+
+ memset(m_mcu_org, 0, sizeof(m_mcu_org));
+
+ m_total_lines_left = 0;
+ m_mcu_lines_left = 0;
+ m_real_dest_bytes_per_scan_line = 0;
+ m_dest_bytes_per_scan_line = 0;
+ m_dest_bytes_per_pixel = 0;
+
+ memset(m_pHuff_tabs, 0, sizeof(m_pHuff_tabs));
+
+ memset(m_dc_coeffs, 0, sizeof(m_dc_coeffs));
+ memset(m_ac_coeffs, 0, sizeof(m_ac_coeffs));
+ memset(m_block_y_mcu, 0, sizeof(m_block_y_mcu));
+
+ m_eob_run = 0;
+
+ memset(m_block_y_mcu, 0, sizeof(m_block_y_mcu));
+
+ m_pIn_buf_ofs = m_in_buf;
+ m_in_buf_left = 0;
+ m_eof_flag = false;
+ m_tem_flag = 0;
+
+ memset(m_in_buf_pad_start, 0, sizeof(m_in_buf_pad_start));
+ memset(m_in_buf, 0, sizeof(m_in_buf));
+ memset(m_in_buf_pad_end, 0, sizeof(m_in_buf_pad_end));
+
+ m_restart_interval = 0;
+ m_restarts_left = 0;
+ m_next_restart_num = 0;
+
+ m_max_mcus_per_row = 0;
+ m_max_blocks_per_mcu = 0;
+ m_max_mcus_per_col = 0;
+
+ memset(m_last_dc_val, 0, sizeof(m_last_dc_val));
+ m_pMCU_coefficients = NULL;
+ m_pSample_buf = NULL;
+
+ m_total_bytes_read = 0;
+
+ m_pScan_line_0 = NULL;
+ m_pScan_line_1 = NULL;
+
+ // Ready the input buffer.
+ prep_in_buffer();
+
+ // Prime the bit buffer.
+ m_bits_left = 16;
+ m_bit_buf = 0;
+
+ get_bits(16);
+ get_bits(16);
+
+ for (int i = 0; i < JPGD_MAX_BLOCKS_PER_MCU; i++)
+ m_mcu_block_max_zag[i] = 64;
+}
+
+#define SCALEBITS 16
+#define ONE_HALF ((int) 1 << (SCALEBITS-1))
+#define FIX(x) ((int) ((x) * (1L<<SCALEBITS) + 0.5f))
+
+// Create a few tables that allow us to quickly convert YCbCr to RGB.
+void jpeg_decoder::create_look_ups()
+{
+ for (int i = 0; i <= 255; i++)
+ {
+ int k = i - 128;
+ m_crr[i] = ( FIX(1.40200f) * k + ONE_HALF) >> SCALEBITS;
+ m_cbb[i] = ( FIX(1.77200f) * k + ONE_HALF) >> SCALEBITS;
+ m_crg[i] = (-FIX(0.71414f)) * k;
+ m_cbg[i] = (-FIX(0.34414f)) * k + ONE_HALF;
+ }
+}
+
+// This method throws back into the stream any bytes that where read
+// into the bit buffer during initial marker scanning.
+void jpeg_decoder::fix_in_buffer()
+{
+ // In case any 0xFF's where pulled into the buffer during marker scanning.
+ JPGD_ASSERT((m_bits_left & 7) == 0);
+
+ if (m_bits_left == 16)
+ stuff_char( (uint8)(m_bit_buf & 0xFF));
+
+ if (m_bits_left >= 8)
+ stuff_char( (uint8)((m_bit_buf >> 8) & 0xFF));
+
+ stuff_char((uint8)((m_bit_buf >> 16) & 0xFF));
+ stuff_char((uint8)((m_bit_buf >> 24) & 0xFF));
+
+ m_bits_left = 16;
+ get_bits_no_markers(16);
+ get_bits_no_markers(16);
+}
+
+void jpeg_decoder::transform_mcu(int mcu_row)
+{
+ jpgd_block_t* pSrc_ptr = m_pMCU_coefficients;
+ uint8* pDst_ptr = m_pSample_buf + mcu_row * m_blocks_per_mcu * 64;
+
+ for (int mcu_block = 0; mcu_block < m_blocks_per_mcu; mcu_block++)
+ {
+ idct(pSrc_ptr, pDst_ptr, m_mcu_block_max_zag[mcu_block]);
+ pSrc_ptr += 64;
+ pDst_ptr += 64;
+ }
+}
+
+static const uint8 s_max_rc[64] =
+{
+ 17, 18, 34, 50, 50, 51, 52, 52, 52, 68, 84, 84, 84, 84, 85, 86, 86, 86, 86, 86,
+ 102, 118, 118, 118, 118, 118, 118, 119, 120, 120, 120, 120, 120, 120, 120, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136
+};
+
+void jpeg_decoder::transform_mcu_expand(int mcu_row)
+{
+ jpgd_block_t* pSrc_ptr = m_pMCU_coefficients;
+ uint8* pDst_ptr = m_pSample_buf + mcu_row * m_expanded_blocks_per_mcu * 64;
+
+ // Y IDCT
+ int mcu_block;
+ for (mcu_block = 0; mcu_block < m_expanded_blocks_per_component; mcu_block++)
+ {
+ idct(pSrc_ptr, pDst_ptr, m_mcu_block_max_zag[mcu_block]);
+ pSrc_ptr += 64;
+ pDst_ptr += 64;
+ }
+
+ // Chroma IDCT, with upsampling
+ jpgd_block_t temp_block[64];
+
+ for (int i = 0; i < 2; i++)
+ {
+ DCT_Upsample::Matrix44 P, Q, R, S;
+
+ JPGD_ASSERT(m_mcu_block_max_zag[mcu_block] >= 1);
+ JPGD_ASSERT(m_mcu_block_max_zag[mcu_block] <= 64);
+
+ int max_zag = m_mcu_block_max_zag[mcu_block++] - 1;
+ if (max_zag <= 0) max_zag = 0; // should never happen, only here to shut up static analysis
+ switch (s_max_rc[max_zag])
+ {
+ case 1*16+1:
+ DCT_Upsample::P_Q<1, 1>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<1, 1>::calc(R, S, pSrc_ptr);
+ break;
+ case 1*16+2:
+ DCT_Upsample::P_Q<1, 2>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<1, 2>::calc(R, S, pSrc_ptr);
+ break;
+ case 2*16+2:
+ DCT_Upsample::P_Q<2, 2>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<2, 2>::calc(R, S, pSrc_ptr);
+ break;
+ case 3*16+2:
+ DCT_Upsample::P_Q<3, 2>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<3, 2>::calc(R, S, pSrc_ptr);
+ break;
+ case 3*16+3:
+ DCT_Upsample::P_Q<3, 3>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<3, 3>::calc(R, S, pSrc_ptr);
+ break;
+ case 3*16+4:
+ DCT_Upsample::P_Q<3, 4>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<3, 4>::calc(R, S, pSrc_ptr);
+ break;
+ case 4*16+4:
+ DCT_Upsample::P_Q<4, 4>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<4, 4>::calc(R, S, pSrc_ptr);
+ break;
+ case 5*16+4:
+ DCT_Upsample::P_Q<5, 4>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<5, 4>::calc(R, S, pSrc_ptr);
+ break;
+ case 5*16+5:
+ DCT_Upsample::P_Q<5, 5>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<5, 5>::calc(R, S, pSrc_ptr);
+ break;
+ case 5*16+6:
+ DCT_Upsample::P_Q<5, 6>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<5, 6>::calc(R, S, pSrc_ptr);
+ break;
+ case 6*16+6:
+ DCT_Upsample::P_Q<6, 6>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<6, 6>::calc(R, S, pSrc_ptr);
+ break;
+ case 7*16+6:
+ DCT_Upsample::P_Q<7, 6>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<7, 6>::calc(R, S, pSrc_ptr);
+ break;
+ case 7*16+7:
+ DCT_Upsample::P_Q<7, 7>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<7, 7>::calc(R, S, pSrc_ptr);
+ break;
+ case 7*16+8:
+ DCT_Upsample::P_Q<7, 8>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<7, 8>::calc(R, S, pSrc_ptr);
+ break;
+ case 8*16+8:
+ DCT_Upsample::P_Q<8, 8>::calc(P, Q, pSrc_ptr);
+ DCT_Upsample::R_S<8, 8>::calc(R, S, pSrc_ptr);
+ break;
+ default:
+ JPGD_ASSERT(false);
+ }
+
+ DCT_Upsample::Matrix44 a(P + Q); P -= Q;
+ DCT_Upsample::Matrix44& b = P;
+ DCT_Upsample::Matrix44 c(R + S); R -= S;
+ DCT_Upsample::Matrix44& d = R;
+
+ DCT_Upsample::Matrix44::add_and_store(temp_block, a, c);
+ idct_4x4(temp_block, pDst_ptr);
+ pDst_ptr += 64;
+
+ DCT_Upsample::Matrix44::sub_and_store(temp_block, a, c);
+ idct_4x4(temp_block, pDst_ptr);
+ pDst_ptr += 64;
+
+ DCT_Upsample::Matrix44::add_and_store(temp_block, b, d);
+ idct_4x4(temp_block, pDst_ptr);
+ pDst_ptr += 64;
+
+ DCT_Upsample::Matrix44::sub_and_store(temp_block, b, d);
+ idct_4x4(temp_block, pDst_ptr);
+ pDst_ptr += 64;
+
+ pSrc_ptr += 64;
+ }
+}
+
+// Loads and dequantizes the next row of (already decoded) coefficients.
+// Progressive images only.
+void jpeg_decoder::load_next_row()
+{
+ int i;
+ jpgd_block_t *p;
+ jpgd_quant_t *q;
+ int mcu_row, mcu_block, row_block = 0;
+ int component_num, component_id;
+ int block_x_mcu[JPGD_MAX_COMPONENTS];
+
+ memset(block_x_mcu, 0, JPGD_MAX_COMPONENTS * sizeof(int));
+
+ for (mcu_row = 0; mcu_row < m_mcus_per_row; mcu_row++)
+ {
+ int block_x_mcu_ofs = 0, block_y_mcu_ofs = 0;
+
+ for (mcu_block = 0; mcu_block < m_blocks_per_mcu; mcu_block++)
+ {
+ component_id = m_mcu_org[mcu_block];
+ q = m_quant[m_comp_quant[component_id]];
+
+ p = m_pMCU_coefficients + 64 * mcu_block;
+
+ jpgd_block_t* pAC = coeff_buf_getp(m_ac_coeffs[component_id], block_x_mcu[component_id] + block_x_mcu_ofs, m_block_y_mcu[component_id] + block_y_mcu_ofs);
+ jpgd_block_t* pDC = coeff_buf_getp(m_dc_coeffs[component_id], block_x_mcu[component_id] + block_x_mcu_ofs, m_block_y_mcu[component_id] + block_y_mcu_ofs);
+ p[0] = pDC[0];
+ memcpy(&p[1], &pAC[1], 63 * sizeof(jpgd_block_t));
+
+ for (i = 63; i > 0; i--)
+ if (p[g_ZAG[i]])
+ break;
+
+ m_mcu_block_max_zag[mcu_block] = i + 1;
+
+ for ( ; i >= 0; i--)
+ if (p[g_ZAG[i]])
+ p[g_ZAG[i]] = static_cast<jpgd_block_t>(p[g_ZAG[i]] * q[i]);
+
+ row_block++;
+
+ if (m_comps_in_scan == 1)
+ block_x_mcu[component_id]++;
+ else
+ {
+ if (++block_x_mcu_ofs == m_comp_h_samp[component_id])
+ {
+ block_x_mcu_ofs = 0;
+
+ if (++block_y_mcu_ofs == m_comp_v_samp[component_id])
+ {
+ block_y_mcu_ofs = 0;
+
+ block_x_mcu[component_id] += m_comp_h_samp[component_id];
+ }
+ }
+ }
+ }
+
+ if (m_freq_domain_chroma_upsample)
+ transform_mcu_expand(mcu_row);
+ else
+ transform_mcu(mcu_row);
+ }
+
+ if (m_comps_in_scan == 1)
+ m_block_y_mcu[m_comp_list[0]]++;
+ else
+ {
+ for (component_num = 0; component_num < m_comps_in_scan; component_num++)
+ {
+ component_id = m_comp_list[component_num];
+
+ m_block_y_mcu[component_id] += m_comp_v_samp[component_id];
+ }
+ }
+}
+
+// Restart interval processing.
+void jpeg_decoder::process_restart()
+{
+ int i;
+ int c = 0;
+
+ // Align to a byte boundry
+ // FIXME: Is this really necessary? get_bits_no_markers() never reads in markers!
+ //get_bits_no_markers(m_bits_left & 7);
+
+ // Let's scan a little bit to find the marker, but not _too_ far.
+ // 1536 is a "fudge factor" that determines how much to scan.
+ for (i = 1536; i > 0; i--)
+ if (get_char() == 0xFF)
+ break;
+
+ if (i == 0)
+ stop_decoding(JPGD_BAD_RESTART_MARKER);
+
+ for ( ; i > 0; i--)
+ if ((c = get_char()) != 0xFF)
+ break;
+
+ if (i == 0)
+ stop_decoding(JPGD_BAD_RESTART_MARKER);
+
+ // Is it the expected marker? If not, something bad happened.
+ if (c != (m_next_restart_num + M_RST0))
+ stop_decoding(JPGD_BAD_RESTART_MARKER);
+
+ // Reset each component's DC prediction values.
+ memset(&m_last_dc_val, 0, m_comps_in_frame * sizeof(uint));
+
+ m_eob_run = 0;
+
+ m_restarts_left = m_restart_interval;
+
+ m_next_restart_num = (m_next_restart_num + 1) & 7;
+
+ // Get the bit buffer going again...
+
+ m_bits_left = 16;
+ get_bits_no_markers(16);
+ get_bits_no_markers(16);
+}
+
+static inline int dequantize_ac(int c, int q) { c *= q; return c; }
+
+// Decodes and dequantizes the next row of coefficients.
+void jpeg_decoder::decode_next_row()
+{
+ int row_block = 0;
+
+ for (int mcu_row = 0; mcu_row < m_mcus_per_row; mcu_row++)
+ {
+ if ((m_restart_interval) && (m_restarts_left == 0))
+ process_restart();
+
+ jpgd_block_t* p = m_pMCU_coefficients;
+ for (int mcu_block = 0; mcu_block < m_blocks_per_mcu; mcu_block++, p += 64)
+ {
+ int component_id = m_mcu_org[mcu_block];
+ jpgd_quant_t* q = m_quant[m_comp_quant[component_id]];
+
+ int r, s;
+ s = huff_decode(m_pHuff_tabs[m_comp_dc_tab[component_id]], r);
+ s = JPGD_HUFF_EXTEND(r, s);
+
+ m_last_dc_val[component_id] = (s += m_last_dc_val[component_id]);
+
+ p[0] = static_cast<jpgd_block_t>(s * q[0]);
+
+ int prev_num_set = m_mcu_block_max_zag[mcu_block];
+
+ huff_tables *pH = m_pHuff_tabs[m_comp_ac_tab[component_id]];
+
+ int k;
+ for (k = 1; k < 64; k++)
+ {
+ int extra_bits;
+ s = huff_decode(pH, extra_bits);
+
+ r = s >> 4;
+ s &= 15;
+
+ if (s)
+ {
+ if (r)
+ {
+ if ((k + r) > 63)
+ stop_decoding(JPGD_DECODE_ERROR);
+
+ if (k < prev_num_set)
+ {
+ int n = JPGD_MIN(r, prev_num_set - k);
+ int kt = k;
+ while (n--)
+ p[g_ZAG[kt++]] = 0;
+ }
+
+ k += r;
+ }
+
+ s = JPGD_HUFF_EXTEND(extra_bits, s);
+
+ JPGD_ASSERT(k < 64);
+
+ p[g_ZAG[k]] = static_cast<jpgd_block_t>(dequantize_ac(s, q[k])); //s * q[k];
+ }
+ else
+ {
+ if (r == 15)
+ {
+ if ((k + 16) > 64)
+ stop_decoding(JPGD_DECODE_ERROR);
+
+ if (k < prev_num_set)
+ {
+ int n = JPGD_MIN(16, prev_num_set - k);
+ int kt = k;
+ while (n--)
+ {
+ JPGD_ASSERT(kt <= 63);
+ p[g_ZAG[kt++]] = 0;
+ }
+ }
+
+ k += 16 - 1; // - 1 because the loop counter is k
+ JPGD_ASSERT(p[g_ZAG[k]] == 0);
+ }
+ else
+ break;
+ }
+ }
+
+ if (k < prev_num_set)
+ {
+ int kt = k;
+ while (kt < prev_num_set)
+ p[g_ZAG[kt++]] = 0;
+ }
+
+ m_mcu_block_max_zag[mcu_block] = k;
+
+ row_block++;
+ }
+
+ if (m_freq_domain_chroma_upsample)
+ transform_mcu_expand(mcu_row);
+ else
+ transform_mcu(mcu_row);
+
+ m_restarts_left--;
+ }
+}
+
+// YCbCr H1V1 (1x1:1:1, 3 m_blocks per MCU) to RGB
+void jpeg_decoder::H1V1Convert()
+{
+ int row = m_max_mcu_y_size - m_mcu_lines_left;
+ uint8 *d = m_pScan_line_0;
+ uint8 *s = m_pSample_buf + row * 8;
+
+ for (int i = m_max_mcus_per_row; i > 0; i--)
+ {
+ for (int j = 0; j < 8; j++)
+ {
+ int y = s[j];
+ int cb = s[64+j];
+ int cr = s[128+j];
+
+ d[0] = clamp(y + m_crr[cr]);
+ d[1] = clamp(y + ((m_crg[cr] + m_cbg[cb]) >> 16));
+ d[2] = clamp(y + m_cbb[cb]);
+ d[3] = 255;
+
+ d += 4;
+ }
+
+ s += 64*3;
+ }
+}
+
+// YCbCr H2V1 (2x1:1:1, 4 m_blocks per MCU) to RGB
+void jpeg_decoder::H2V1Convert()
+{
+ int row = m_max_mcu_y_size - m_mcu_lines_left;
+ uint8 *d0 = m_pScan_line_0;
+ uint8 *y = m_pSample_buf + row * 8;
+ uint8 *c = m_pSample_buf + 2*64 + row * 8;
+
+ for (int i = m_max_mcus_per_row; i > 0; i--)
+ {
+ for (int l = 0; l < 2; l++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ int cb = c[0];
+ int cr = c[64];
+
+ int rc = m_crr[cr];
+ int gc = ((m_crg[cr] + m_cbg[cb]) >> 16);
+ int bc = m_cbb[cb];
+
+ int yy = y[j<<1];
+ d0[0] = clamp(yy+rc);
+ d0[1] = clamp(yy+gc);
+ d0[2] = clamp(yy+bc);
+ d0[3] = 255;
+
+ yy = y[(j<<1)+1];
+ d0[4] = clamp(yy+rc);
+ d0[5] = clamp(yy+gc);
+ d0[6] = clamp(yy+bc);
+ d0[7] = 255;
+
+ d0 += 8;
+
+ c++;
+ }
+ y += 64;
+ }
+
+ y += 64*4 - 64*2;
+ c += 64*4 - 8;
+ }
+}
+
+// YCbCr H2V1 (1x2:1:1, 4 m_blocks per MCU) to RGB
+void jpeg_decoder::H1V2Convert()
+{
+ int row = m_max_mcu_y_size - m_mcu_lines_left;
+ uint8 *d0 = m_pScan_line_0;
+ uint8 *d1 = m_pScan_line_1;
+ uint8 *y;
+ uint8 *c;
+
+ if (row < 8)
+ y = m_pSample_buf + row * 8;
+ else
+ y = m_pSample_buf + 64*1 + (row & 7) * 8;
+
+ c = m_pSample_buf + 64*2 + (row >> 1) * 8;
+
+ for (int i = m_max_mcus_per_row; i > 0; i--)
+ {
+ for (int j = 0; j < 8; j++)
+ {
+ int cb = c[0+j];
+ int cr = c[64+j];
+
+ int rc = m_crr[cr];
+ int gc = ((m_crg[cr] + m_cbg[cb]) >> 16);
+ int bc = m_cbb[cb];
+
+ int yy = y[j];
+ d0[0] = clamp(yy+rc);
+ d0[1] = clamp(yy+gc);
+ d0[2] = clamp(yy+bc);
+ d0[3] = 255;
+
+ yy = y[8+j];
+ d1[0] = clamp(yy+rc);
+ d1[1] = clamp(yy+gc);
+ d1[2] = clamp(yy+bc);
+ d1[3] = 255;
+
+ d0 += 4;
+ d1 += 4;
+ }
+
+ y += 64*4;
+ c += 64*4;
+ }
+}
+
+// YCbCr H2V2 (2x2:1:1, 6 m_blocks per MCU) to RGB
+void jpeg_decoder::H2V2Convert()
+{
+ int row = m_max_mcu_y_size - m_mcu_lines_left;
+ uint8 *d0 = m_pScan_line_0;
+ uint8 *d1 = m_pScan_line_1;
+ uint8 *y;
+ uint8 *c;
+
+ if (row < 8)
+ y = m_pSample_buf + row * 8;
+ else
+ y = m_pSample_buf + 64*2 + (row & 7) * 8;
+
+ c = m_pSample_buf + 64*4 + (row >> 1) * 8;
+
+ for (int i = m_max_mcus_per_row; i > 0; i--)
+ {
+ for (int l = 0; l < 2; l++)
+ {
+ for (int j = 0; j < 8; j += 2)
+ {
+ int cb = c[0];
+ int cr = c[64];
+
+ int rc = m_crr[cr];
+ int gc = ((m_crg[cr] + m_cbg[cb]) >> 16);
+ int bc = m_cbb[cb];
+
+ int yy = y[j];
+ d0[0] = clamp(yy+rc);
+ d0[1] = clamp(yy+gc);
+ d0[2] = clamp(yy+bc);
+ d0[3] = 255;
+
+ yy = y[j+1];
+ d0[4] = clamp(yy+rc);
+ d0[5] = clamp(yy+gc);
+ d0[6] = clamp(yy+bc);
+ d0[7] = 255;
+
+ yy = y[j+8];
+ d1[0] = clamp(yy+rc);
+ d1[1] = clamp(yy+gc);
+ d1[2] = clamp(yy+bc);
+ d1[3] = 255;
+
+ yy = y[j+8+1];
+ d1[4] = clamp(yy+rc);
+ d1[5] = clamp(yy+gc);
+ d1[6] = clamp(yy+bc);
+ d1[7] = 255;
+
+ d0 += 8;
+ d1 += 8;
+
+ c++;
+ }
+ y += 64;
+ }
+
+ y += 64*6 - 64*2;
+ c += 64*6 - 8;
+ }
+}
+
+// Y (1 block per MCU) to 8-bit grayscale
+void jpeg_decoder::gray_convert()
+{
+ int row = m_max_mcu_y_size - m_mcu_lines_left;
+ uint8 *d = m_pScan_line_0;
+ uint8 *s = m_pSample_buf + row * 8;
+
+ for (int i = m_max_mcus_per_row; i > 0; i--)
+ {
+ *(uint *)d = *(uint *)s;
+ *(uint *)(&d[4]) = *(uint *)(&s[4]);
+
+ s += 64;
+ d += 8;
+ }
+}
+
+void jpeg_decoder::expanded_convert()
+{
+ int row = m_max_mcu_y_size - m_mcu_lines_left;
+
+ uint8* Py = m_pSample_buf + (row / 8) * 64 * m_comp_h_samp[0] + (row & 7) * 8;
+
+ uint8* d = m_pScan_line_0;
+
+ for (int i = m_max_mcus_per_row; i > 0; i--)
+ {
+ for (int k = 0; k < m_max_mcu_x_size; k += 8)
+ {
+ const int Y_ofs = k * 8;
+ const int Cb_ofs = Y_ofs + 64 * m_expanded_blocks_per_component;
+ const int Cr_ofs = Y_ofs + 64 * m_expanded_blocks_per_component * 2;
+ for (int j = 0; j < 8; j++)
+ {
+ int y = Py[Y_ofs + j];
+ int cb = Py[Cb_ofs + j];
+ int cr = Py[Cr_ofs + j];
+
+ d[0] = clamp(y + m_crr[cr]);
+ d[1] = clamp(y + ((m_crg[cr] + m_cbg[cb]) >> 16));
+ d[2] = clamp(y + m_cbb[cb]);
+ d[3] = 255;
+
+ d += 4;
+ }
+ }
+
+ Py += 64 * m_expanded_blocks_per_mcu;
+ }
+}
+
+// Find end of image (EOI) marker, so we can return to the user the exact size of the input stream.
+void jpeg_decoder::find_eoi()
+{
+ if (!m_progressive_flag)
+ {
+ // Attempt to read the EOI marker.
+ //get_bits_no_markers(m_bits_left & 7);
+
+ // Prime the bit buffer
+ m_bits_left = 16;
+ get_bits(16);
+ get_bits(16);
+
+ // The next marker _should_ be EOI
+ process_markers();
+ }
+
+ m_total_bytes_read -= m_in_buf_left;
+}
+
+int jpeg_decoder::decode(const void** pScan_line, uint* pScan_line_len)
+{
+ if ((m_error_code) || (!m_ready_flag))
+ return JPGD_FAILED;
+
+ if (m_total_lines_left == 0)
+ return JPGD_DONE;
+
+ if (m_mcu_lines_left == 0)
+ {
+ if (setjmp(m_jmp_state))
+ return JPGD_FAILED;
+
+ if (m_progressive_flag)
+ load_next_row();
+ else
+ decode_next_row();
+
+ // Find the EOI marker if that was the last row.
+ if (m_total_lines_left <= m_max_mcu_y_size)
+ find_eoi();
+
+ m_mcu_lines_left = m_max_mcu_y_size;
+ }
+
+ if (m_freq_domain_chroma_upsample)
+ {
+ expanded_convert();
+ *pScan_line = m_pScan_line_0;
+ }
+ else
+ {
+ switch (m_scan_type)
+ {
+ case JPGD_YH2V2:
+ {
+ if ((m_mcu_lines_left & 1) == 0)
+ {
+ H2V2Convert();
+ *pScan_line = m_pScan_line_0;
+ }
+ else
+ *pScan_line = m_pScan_line_1;
+
+ break;
+ }
+ case JPGD_YH2V1:
+ {
+ H2V1Convert();
+ *pScan_line = m_pScan_line_0;
+ break;
+ }
+ case JPGD_YH1V2:
+ {
+ if ((m_mcu_lines_left & 1) == 0)
+ {
+ H1V2Convert();
+ *pScan_line = m_pScan_line_0;
+ }
+ else
+ *pScan_line = m_pScan_line_1;
+
+ break;
+ }
+ case JPGD_YH1V1:
+ {
+ H1V1Convert();
+ *pScan_line = m_pScan_line_0;
+ break;
+ }
+ case JPGD_GRAYSCALE:
+ {
+ gray_convert();
+ *pScan_line = m_pScan_line_0;
+
+ break;
+ }
+ }
+ }
+
+ *pScan_line_len = m_real_dest_bytes_per_scan_line;
+
+ m_mcu_lines_left--;
+ m_total_lines_left--;
+
+ return JPGD_SUCCESS;
+}
+
+// Creates the tables needed for efficient Huffman decoding.
+void jpeg_decoder::make_huff_table(int index, huff_tables *pH)
+{
+ int p, i, l, si;
+ uint8 huffsize[257];
+ uint huffcode[257];
+ uint code;
+ uint subtree;
+ int code_size;
+ int lastp;
+ int nextfreeentry;
+ int currententry;
+
+ pH->ac_table = m_huff_ac[index] != 0;
+
+ p = 0;
+
+ for (l = 1; l <= 16; l++)
+ {
+ for (i = 1; i <= m_huff_num[index][l]; i++)
+ huffsize[p++] = static_cast<uint8>(l);
+ }
+
+ huffsize[p] = 0;
+
+ lastp = p;
+
+ code = 0;
+ si = huffsize[0];
+ p = 0;
+
+ while (huffsize[p])
+ {
+ while (huffsize[p] == si)
+ {
+ huffcode[p++] = code;
+ code++;
+ }
+
+ code <<= 1;
+ si++;
+ }
+
+ memset(pH->look_up, 0, sizeof(pH->look_up));
+ memset(pH->look_up2, 0, sizeof(pH->look_up2));
+ memset(pH->tree, 0, sizeof(pH->tree));
+ memset(pH->code_size, 0, sizeof(pH->code_size));
+
+ nextfreeentry = -1;
+
+ p = 0;
+
+ while (p < lastp)
+ {
+ i = m_huff_val[index][p];
+ code = huffcode[p];
+ code_size = huffsize[p];
+
+ pH->code_size[i] = static_cast<uint8>(code_size);
+
+ if (code_size <= 8)
+ {
+ code <<= (8 - code_size);
+
+ for (l = 1 << (8 - code_size); l > 0; l--)
+ {
+ JPGD_ASSERT(i < 256);
+
+ pH->look_up[code] = i;
+
+ bool has_extrabits = false;
+ int extra_bits = 0;
+ int num_extra_bits = i & 15;
+
+ int bits_to_fetch = code_size;
+ if (num_extra_bits)
+ {
+ int total_codesize = code_size + num_extra_bits;
+ if (total_codesize <= 8)
+ {
+ has_extrabits = true;
+ extra_bits = ((1 << num_extra_bits) - 1) & (code >> (8 - total_codesize));
+ JPGD_ASSERT(extra_bits <= 0x7FFF);
+ bits_to_fetch += num_extra_bits;
+ }
+ }
+
+ if (!has_extrabits)
+ pH->look_up2[code] = i | (bits_to_fetch << 8);
+ else
+ pH->look_up2[code] = i | 0x8000 | (extra_bits << 16) | (bits_to_fetch << 8);
+
+ code++;
+ }
+ }
+ else
+ {
+ subtree = (code >> (code_size - 8)) & 0xFF;
+
+ currententry = pH->look_up[subtree];
+
+ if (currententry == 0)
+ {
+ pH->look_up[subtree] = currententry = nextfreeentry;
+ pH->look_up2[subtree] = currententry = nextfreeentry;
+
+ nextfreeentry -= 2;
+ }
+
+ code <<= (16 - (code_size - 8));
+
+ for (l = code_size; l > 9; l--)
+ {
+ if ((code & 0x8000) == 0)
+ currententry--;
+
+ if (pH->tree[-currententry - 1] == 0)
+ {
+ pH->tree[-currententry - 1] = nextfreeentry;
+
+ currententry = nextfreeentry;
+
+ nextfreeentry -= 2;
+ }
+ else
+ currententry = pH->tree[-currententry - 1];
+
+ code <<= 1;
+ }
+
+ if ((code & 0x8000) == 0)
+ currententry--;
+
+ pH->tree[-currententry - 1] = i;
+ }
+
+ p++;
+ }
+}
+
+// Verifies the quantization tables needed for this scan are available.
+void jpeg_decoder::check_quant_tables()
+{
+ for (int i = 0; i < m_comps_in_scan; i++)
+ if (m_quant[m_comp_quant[m_comp_list[i]]] == NULL)
+ stop_decoding(JPGD_UNDEFINED_QUANT_TABLE);
+}
+
+// Verifies that all the Huffman tables needed for this scan are available.
+void jpeg_decoder::check_huff_tables()
+{
+ for (int i = 0; i < m_comps_in_scan; i++)
+ {
+ if ((m_spectral_start == 0) && (m_huff_num[m_comp_dc_tab[m_comp_list[i]]] == NULL))
+ stop_decoding(JPGD_UNDEFINED_HUFF_TABLE);
+
+ if ((m_spectral_end > 0) && (m_huff_num[m_comp_ac_tab[m_comp_list[i]]] == NULL))
+ stop_decoding(JPGD_UNDEFINED_HUFF_TABLE);
+ }
+
+ for (int i = 0; i < JPGD_MAX_HUFF_TABLES; i++)
+ if (m_huff_num[i])
+ {
+ if (!m_pHuff_tabs[i])
+ m_pHuff_tabs[i] = (huff_tables *)alloc(sizeof(huff_tables));
+
+ make_huff_table(i, m_pHuff_tabs[i]);
+ }
+}
+
+// Determines the component order inside each MCU.
+// Also calcs how many MCU's are on each row, etc.
+void jpeg_decoder::calc_mcu_block_order()
+{
+ int component_num, component_id;
+ int max_h_samp = 0, max_v_samp = 0;
+
+ for (component_id = 0; component_id < m_comps_in_frame; component_id++)
+ {
+ if (m_comp_h_samp[component_id] > max_h_samp)
+ max_h_samp = m_comp_h_samp[component_id];
+
+ if (m_comp_v_samp[component_id] > max_v_samp)
+ max_v_samp = m_comp_v_samp[component_id];
+ }
+
+ for (component_id = 0; component_id < m_comps_in_frame; component_id++)
+ {
+ m_comp_h_blocks[component_id] = ((((m_image_x_size * m_comp_h_samp[component_id]) + (max_h_samp - 1)) / max_h_samp) + 7) / 8;
+ m_comp_v_blocks[component_id] = ((((m_image_y_size * m_comp_v_samp[component_id]) + (max_v_samp - 1)) / max_v_samp) + 7) / 8;
+ }
+
+ if (m_comps_in_scan == 1)
+ {
+ m_mcus_per_row = m_comp_h_blocks[m_comp_list[0]];
+ m_mcus_per_col = m_comp_v_blocks[m_comp_list[0]];
+ }
+ else
+ {
+ m_mcus_per_row = (((m_image_x_size + 7) / 8) + (max_h_samp - 1)) / max_h_samp;
+ m_mcus_per_col = (((m_image_y_size + 7) / 8) + (max_v_samp - 1)) / max_v_samp;
+ }
+
+ if (m_comps_in_scan == 1)
+ {
+ m_mcu_org[0] = m_comp_list[0];
+
+ m_blocks_per_mcu = 1;
+ }
+ else
+ {
+ m_blocks_per_mcu = 0;
+
+ for (component_num = 0; component_num < m_comps_in_scan; component_num++)
+ {
+ int num_blocks;
+
+ component_id = m_comp_list[component_num];
+
+ num_blocks = m_comp_h_samp[component_id] * m_comp_v_samp[component_id];
+
+ while (num_blocks--)
+ m_mcu_org[m_blocks_per_mcu++] = component_id;
+ }
+ }
+}
+
+// Starts a new scan.
+int jpeg_decoder::init_scan()
+{
+ if (!locate_sos_marker())
+ return JPGD_FALSE;
+
+ calc_mcu_block_order();
+
+ check_huff_tables();
+
+ check_quant_tables();
+
+ memset(m_last_dc_val, 0, m_comps_in_frame * sizeof(uint));
+
+ m_eob_run = 0;
+
+ if (m_restart_interval)
+ {
+ m_restarts_left = m_restart_interval;
+ m_next_restart_num = 0;
+ }
+
+ fix_in_buffer();
+
+ return JPGD_TRUE;
+}
+
+// Starts a frame. Determines if the number of components or sampling factors
+// are supported.
+void jpeg_decoder::init_frame()
+{
+ int i;
+
+ if (m_comps_in_frame == 1)
+ {
+ if ((m_comp_h_samp[0] != 1) || (m_comp_v_samp[0] != 1))
+ stop_decoding(JPGD_UNSUPPORTED_SAMP_FACTORS);
+
+ m_scan_type = JPGD_GRAYSCALE;
+ m_max_blocks_per_mcu = 1;
+ m_max_mcu_x_size = 8;
+ m_max_mcu_y_size = 8;
+ }
+ else if (m_comps_in_frame == 3)
+ {
+ if ( ((m_comp_h_samp[1] != 1) || (m_comp_v_samp[1] != 1)) ||
+ ((m_comp_h_samp[2] != 1) || (m_comp_v_samp[2] != 1)) )
+ stop_decoding(JPGD_UNSUPPORTED_SAMP_FACTORS);
+
+ if ((m_comp_h_samp[0] == 1) && (m_comp_v_samp[0] == 1))
+ {
+ m_scan_type = JPGD_YH1V1;
+
+ m_max_blocks_per_mcu = 3;
+ m_max_mcu_x_size = 8;
+ m_max_mcu_y_size = 8;
+ }
+ else if ((m_comp_h_samp[0] == 2) && (m_comp_v_samp[0] == 1))
+ {
+ m_scan_type = JPGD_YH2V1;
+ m_max_blocks_per_mcu = 4;
+ m_max_mcu_x_size = 16;
+ m_max_mcu_y_size = 8;
+ }
+ else if ((m_comp_h_samp[0] == 1) && (m_comp_v_samp[0] == 2))
+ {
+ m_scan_type = JPGD_YH1V2;
+ m_max_blocks_per_mcu = 4;
+ m_max_mcu_x_size = 8;
+ m_max_mcu_y_size = 16;
+ }
+ else if ((m_comp_h_samp[0] == 2) && (m_comp_v_samp[0] == 2))
+ {
+ m_scan_type = JPGD_YH2V2;
+ m_max_blocks_per_mcu = 6;
+ m_max_mcu_x_size = 16;
+ m_max_mcu_y_size = 16;
+ }
+ else
+ stop_decoding(JPGD_UNSUPPORTED_SAMP_FACTORS);
+ }
+ else
+ stop_decoding(JPGD_UNSUPPORTED_COLORSPACE);
+
+ m_max_mcus_per_row = (m_image_x_size + (m_max_mcu_x_size - 1)) / m_max_mcu_x_size;
+ m_max_mcus_per_col = (m_image_y_size + (m_max_mcu_y_size - 1)) / m_max_mcu_y_size;
+
+ // These values are for the *destination* pixels: after conversion.
+ if (m_scan_type == JPGD_GRAYSCALE)
+ m_dest_bytes_per_pixel = 1;
+ else
+ m_dest_bytes_per_pixel = 4;
+
+ m_dest_bytes_per_scan_line = ((m_image_x_size + 15) & 0xFFF0) * m_dest_bytes_per_pixel;
+
+ m_real_dest_bytes_per_scan_line = (m_image_x_size * m_dest_bytes_per_pixel);
+
+ // Initialize two scan line buffers.
+ m_pScan_line_0 = (uint8 *)alloc(m_dest_bytes_per_scan_line, true);
+ if ((m_scan_type == JPGD_YH1V2) || (m_scan_type == JPGD_YH2V2))
+ m_pScan_line_1 = (uint8 *)alloc(m_dest_bytes_per_scan_line, true);
+
+ m_max_blocks_per_row = m_max_mcus_per_row * m_max_blocks_per_mcu;
+
+ // Should never happen
+ if (m_max_blocks_per_row > JPGD_MAX_BLOCKS_PER_ROW)
+ stop_decoding(JPGD_ASSERTION_ERROR);
+
+ // Allocate the coefficient buffer, enough for one MCU
+ m_pMCU_coefficients = (jpgd_block_t*)alloc(m_max_blocks_per_mcu * 64 * sizeof(jpgd_block_t));
+
+ for (i = 0; i < m_max_blocks_per_mcu; i++)
+ m_mcu_block_max_zag[i] = 64;
+
+ m_expanded_blocks_per_component = m_comp_h_samp[0] * m_comp_v_samp[0];
+ m_expanded_blocks_per_mcu = m_expanded_blocks_per_component * m_comps_in_frame;
+ m_expanded_blocks_per_row = m_max_mcus_per_row * m_expanded_blocks_per_mcu;
+ // Freq. domain chroma upsampling is only supported for H2V2 subsampling factor (the most common one I've seen).
+ m_freq_domain_chroma_upsample = false;
+#if JPGD_SUPPORT_FREQ_DOMAIN_UPSAMPLING
+ m_freq_domain_chroma_upsample = (m_expanded_blocks_per_mcu == 4*3);
+#endif
+
+ if (m_freq_domain_chroma_upsample)
+ m_pSample_buf = (uint8 *)alloc(m_expanded_blocks_per_row * 64);
+ else
+ m_pSample_buf = (uint8 *)alloc(m_max_blocks_per_row * 64);
+
+ m_total_lines_left = m_image_y_size;
+
+ m_mcu_lines_left = 0;
+
+ create_look_ups();
+}
+
+// The coeff_buf series of methods originally stored the coefficients
+// into a "virtual" file which was located in EMS, XMS, or a disk file. A cache
+// was used to make this process more efficient. Now, we can store the entire
+// thing in RAM.
+jpeg_decoder::coeff_buf* jpeg_decoder::coeff_buf_open(int block_num_x, int block_num_y, int block_len_x, int block_len_y)
+{
+ coeff_buf* cb = (coeff_buf*)alloc(sizeof(coeff_buf));
+
+ cb->block_num_x = block_num_x;
+ cb->block_num_y = block_num_y;
+ cb->block_len_x = block_len_x;
+ cb->block_len_y = block_len_y;
+ cb->block_size = (block_len_x * block_len_y) * sizeof(jpgd_block_t);
+ cb->pData = (uint8 *)alloc(cb->block_size * block_num_x * block_num_y, true);
+ return cb;
+}
+
+inline jpgd_block_t *jpeg_decoder::coeff_buf_getp(coeff_buf *cb, int block_x, int block_y)
+{
+ JPGD_ASSERT((block_x < cb->block_num_x) && (block_y < cb->block_num_y));
+ return (jpgd_block_t *)(cb->pData + block_x * cb->block_size + block_y * (cb->block_size * cb->block_num_x));
+}
+
+// The following methods decode the various types of m_blocks encountered
+// in progressively encoded images.
+void jpeg_decoder::decode_block_dc_first(jpeg_decoder *pD, int component_id, int block_x, int block_y)
+{
+ int s, r;
+ jpgd_block_t *p = pD->coeff_buf_getp(pD->m_dc_coeffs[component_id], block_x, block_y);
+
+ if ((s = pD->huff_decode(pD->m_pHuff_tabs[pD->m_comp_dc_tab[component_id]])) != 0)
+ {
+ r = pD->get_bits_no_markers(s);
+ s = JPGD_HUFF_EXTEND(r, s);
+ }
+
+ pD->m_last_dc_val[component_id] = (s += pD->m_last_dc_val[component_id]);
+
+ p[0] = static_cast<jpgd_block_t>(s << pD->m_successive_low);
+}
+
+void jpeg_decoder::decode_block_dc_refine(jpeg_decoder *pD, int component_id, int block_x, int block_y)
+{
+ if (pD->get_bits_no_markers(1))
+ {
+ jpgd_block_t *p = pD->coeff_buf_getp(pD->m_dc_coeffs[component_id], block_x, block_y);
+
+ p[0] |= (1 << pD->m_successive_low);
+ }
+}
+
+void jpeg_decoder::decode_block_ac_first(jpeg_decoder *pD, int component_id, int block_x, int block_y)
+{
+ int k, s, r;
+
+ if (pD->m_eob_run)
+ {
+ pD->m_eob_run--;
+ return;
+ }
+
+ jpgd_block_t *p = pD->coeff_buf_getp(pD->m_ac_coeffs[component_id], block_x, block_y);
+
+ for (k = pD->m_spectral_start; k <= pD->m_spectral_end; k++)
+ {
+ s = pD->huff_decode(pD->m_pHuff_tabs[pD->m_comp_ac_tab[component_id]]);
+
+ r = s >> 4;
+ s &= 15;
+
+ if (s)
+ {
+ if ((k += r) > 63)
+ pD->stop_decoding(JPGD_DECODE_ERROR);
+
+ r = pD->get_bits_no_markers(s);
+ s = JPGD_HUFF_EXTEND(r, s);
+
+ p[g_ZAG[k]] = static_cast<jpgd_block_t>(s << pD->m_successive_low);
+ }
+ else
+ {
+ if (r == 15)
+ {
+ if ((k += 15) > 63)
+ pD->stop_decoding(JPGD_DECODE_ERROR);
+ }
+ else
+ {
+ pD->m_eob_run = 1 << r;
+
+ if (r)
+ pD->m_eob_run += pD->get_bits_no_markers(r);
+
+ pD->m_eob_run--;
+
+ break;
+ }
+ }
+ }
+}
+
+void jpeg_decoder::decode_block_ac_refine(jpeg_decoder *pD, int component_id, int block_x, int block_y)
+{
+ int s, k, r;
+ int p1 = 1 << pD->m_successive_low;
+ int m1 = (-1) << pD->m_successive_low;
+ jpgd_block_t *p = pD->coeff_buf_getp(pD->m_ac_coeffs[component_id], block_x, block_y);
+
+ JPGD_ASSERT(pD->m_spectral_end <= 63);
+
+ k = pD->m_spectral_start;
+
+ if (pD->m_eob_run == 0)
+ {
+ for ( ; k <= pD->m_spectral_end; k++)
+ {
+ s = pD->huff_decode(pD->m_pHuff_tabs[pD->m_comp_ac_tab[component_id]]);
+
+ r = s >> 4;
+ s &= 15;
+
+ if (s)
+ {
+ if (s != 1)
+ pD->stop_decoding(JPGD_DECODE_ERROR);
+
+ if (pD->get_bits_no_markers(1))
+ s = p1;
+ else
+ s = m1;
+ }
+ else
+ {
+ if (r != 15)
+ {
+ pD->m_eob_run = 1 << r;
+
+ if (r)
+ pD->m_eob_run += pD->get_bits_no_markers(r);
+
+ break;
+ }
+ }
+
+ do
+ {
+ jpgd_block_t *this_coef = p + g_ZAG[k & 63];
+
+ if (*this_coef != 0)
+ {
+ if (pD->get_bits_no_markers(1))
+ {
+ if ((*this_coef & p1) == 0)
+ {
+ if (*this_coef >= 0)
+ *this_coef = static_cast<jpgd_block_t>(*this_coef + p1);
+ else
+ *this_coef = static_cast<jpgd_block_t>(*this_coef + m1);
+ }
+ }
+ }
+ else
+ {
+ if (--r < 0)
+ break;
+ }
+
+ k++;
+
+ } while (k <= pD->m_spectral_end);
+
+ if ((s) && (k < 64))
+ {
+ p[g_ZAG[k]] = static_cast<jpgd_block_t>(s);
+ }
+ }
+ }
+
+ if (pD->m_eob_run > 0)
+ {
+ for ( ; k <= pD->m_spectral_end; k++)
+ {
+ jpgd_block_t *this_coef = p + g_ZAG[k & 63]; // logical AND to shut up static code analysis
+
+ if (*this_coef != 0)
+ {
+ if (pD->get_bits_no_markers(1))
+ {
+ if ((*this_coef & p1) == 0)
+ {
+ if (*this_coef >= 0)
+ *this_coef = static_cast<jpgd_block_t>(*this_coef + p1);
+ else
+ *this_coef = static_cast<jpgd_block_t>(*this_coef + m1);
+ }
+ }
+ }
+ }
+
+ pD->m_eob_run--;
+ }
+}
+
+// Decode a scan in a progressively encoded image.
+void jpeg_decoder::decode_scan(pDecode_block_func decode_block_func)
+{
+ int mcu_row, mcu_col, mcu_block;
+ int block_x_mcu[JPGD_MAX_COMPONENTS], m_block_y_mcu[JPGD_MAX_COMPONENTS];
+
+ memset(m_block_y_mcu, 0, sizeof(m_block_y_mcu));
+
+ for (mcu_col = 0; mcu_col < m_mcus_per_col; mcu_col++)
+ {
+ int component_num, component_id;
+
+ memset(block_x_mcu, 0, sizeof(block_x_mcu));
+
+ for (mcu_row = 0; mcu_row < m_mcus_per_row; mcu_row++)
+ {
+ int block_x_mcu_ofs = 0, block_y_mcu_ofs = 0;
+
+ if ((m_restart_interval) && (m_restarts_left == 0))
+ process_restart();
+
+ for (mcu_block = 0; mcu_block < m_blocks_per_mcu; mcu_block++)
+ {
+ component_id = m_mcu_org[mcu_block];
+
+ decode_block_func(this, component_id, block_x_mcu[component_id] + block_x_mcu_ofs, m_block_y_mcu[component_id] + block_y_mcu_ofs);
+
+ if (m_comps_in_scan == 1)
+ block_x_mcu[component_id]++;
+ else
+ {
+ if (++block_x_mcu_ofs == m_comp_h_samp[component_id])
+ {
+ block_x_mcu_ofs = 0;
+
+ if (++block_y_mcu_ofs == m_comp_v_samp[component_id])
+ {
+ block_y_mcu_ofs = 0;
+ block_x_mcu[component_id] += m_comp_h_samp[component_id];
+ }
+ }
+ }
+ }
+
+ m_restarts_left--;
+ }
+
+ if (m_comps_in_scan == 1)
+ m_block_y_mcu[m_comp_list[0]]++;
+ else
+ {
+ for (component_num = 0; component_num < m_comps_in_scan; component_num++)
+ {
+ component_id = m_comp_list[component_num];
+ m_block_y_mcu[component_id] += m_comp_v_samp[component_id];
+ }
+ }
+ }
+}
+
+// Decode a progressively encoded image.
+void jpeg_decoder::init_progressive()
+{
+ int i;
+
+ if (m_comps_in_frame == 4)
+ stop_decoding(JPGD_UNSUPPORTED_COLORSPACE);
+
+ // Allocate the coefficient buffers.
+ for (i = 0; i < m_comps_in_frame; i++)
+ {
+ m_dc_coeffs[i] = coeff_buf_open(m_max_mcus_per_row * m_comp_h_samp[i], m_max_mcus_per_col * m_comp_v_samp[i], 1, 1);
+ m_ac_coeffs[i] = coeff_buf_open(m_max_mcus_per_row * m_comp_h_samp[i], m_max_mcus_per_col * m_comp_v_samp[i], 8, 8);
+ }
+
+ for ( ; ; )
+ {
+ int dc_only_scan, refinement_scan;
+ pDecode_block_func decode_block_func;
+
+ if (!init_scan())
+ break;
+
+ dc_only_scan = (m_spectral_start == 0);
+ refinement_scan = (m_successive_high != 0);
+
+ if ((m_spectral_start > m_spectral_end) || (m_spectral_end > 63))
+ stop_decoding(JPGD_BAD_SOS_SPECTRAL);
+
+ if (dc_only_scan)
+ {
+ if (m_spectral_end)
+ stop_decoding(JPGD_BAD_SOS_SPECTRAL);
+ }
+ else if (m_comps_in_scan != 1) /* AC scans can only contain one component */
+ stop_decoding(JPGD_BAD_SOS_SPECTRAL);
+
+ if ((refinement_scan) && (m_successive_low != m_successive_high - 1))
+ stop_decoding(JPGD_BAD_SOS_SUCCESSIVE);
+
+ if (dc_only_scan)
+ {
+ if (refinement_scan)
+ decode_block_func = decode_block_dc_refine;
+ else
+ decode_block_func = decode_block_dc_first;
+ }
+ else
+ {
+ if (refinement_scan)
+ decode_block_func = decode_block_ac_refine;
+ else
+ decode_block_func = decode_block_ac_first;
+ }
+
+ decode_scan(decode_block_func);
+
+ m_bits_left = 16;
+ get_bits(16);
+ get_bits(16);
+ }
+
+ m_comps_in_scan = m_comps_in_frame;
+
+ for (i = 0; i < m_comps_in_frame; i++)
+ m_comp_list[i] = i;
+
+ calc_mcu_block_order();
+}
+
+void jpeg_decoder::init_sequential()
+{
+ if (!init_scan())
+ stop_decoding(JPGD_UNEXPECTED_MARKER);
+}
+
+void jpeg_decoder::decode_start()
+{
+ init_frame();
+
+ if (m_progressive_flag)
+ init_progressive();
+ else
+ init_sequential();
+}
+
+void jpeg_decoder::decode_init(jpeg_decoder_stream *pStream)
+{
+ init(pStream);
+ locate_sof_marker();
+}
+
+jpeg_decoder::jpeg_decoder(jpeg_decoder_stream *pStream)
+{
+ if (setjmp(m_jmp_state))
+ return;
+ decode_init(pStream);
+}
+
+int jpeg_decoder::begin_decoding()
+{
+ if (m_ready_flag)
+ return JPGD_SUCCESS;
+
+ if (m_error_code)
+ return JPGD_FAILED;
+
+ if (setjmp(m_jmp_state))
+ return JPGD_FAILED;
+
+ decode_start();
+
+ m_ready_flag = true;
+
+ return JPGD_SUCCESS;
+}
+
+jpeg_decoder::~jpeg_decoder()
+{
+ free_all_blocks();
+}
+
+jpeg_decoder_file_stream::jpeg_decoder_file_stream()
+{
+ m_pFile = NULL;
+ m_eof_flag = false;
+ m_error_flag = false;
+}
+
+void jpeg_decoder_file_stream::close()
+{
+ if (m_pFile)
+ {
+ fclose(m_pFile);
+ m_pFile = NULL;
+ }
+
+ m_eof_flag = false;
+ m_error_flag = false;
+}
+
+jpeg_decoder_file_stream::~jpeg_decoder_file_stream()
+{
+ close();
+}
+
+bool jpeg_decoder_file_stream::open(const char *Pfilename)
+{
+ close();
+
+ m_eof_flag = false;
+ m_error_flag = false;
+
+#if defined(_MSC_VER)
+ m_pFile = NULL;
+ fopen_s(&m_pFile, Pfilename, "rb");
+#else
+ m_pFile = fopen(Pfilename, "rb");
+#endif
+ return m_pFile != NULL;
+}
+
+int jpeg_decoder_file_stream::read(uint8 *pBuf, int max_bytes_to_read, bool *pEOF_flag)
+{
+ if (!m_pFile)
+ return -1;
+
+ if (m_eof_flag)
+ {
+ *pEOF_flag = true;
+ return 0;
+ }
+
+ if (m_error_flag)
+ return -1;
+
+ int bytes_read = static_cast<int>(fread(pBuf, 1, max_bytes_to_read, m_pFile));
+ if (bytes_read < max_bytes_to_read)
+ {
+ if (ferror(m_pFile))
+ {
+ m_error_flag = true;
+ return -1;
+ }
+
+ m_eof_flag = true;
+ *pEOF_flag = true;
+ }
+
+ return bytes_read;
+}
+
+bool jpeg_decoder_mem_stream::open(const uint8 *pSrc_data, uint size)
+{
+ close();
+ m_pSrc_data = pSrc_data;
+ m_ofs = 0;
+ m_size = size;
+ return true;
+}
+
+int jpeg_decoder_mem_stream::read(uint8 *pBuf, int max_bytes_to_read, bool *pEOF_flag)
+{
+ *pEOF_flag = false;
+
+ if (!m_pSrc_data)
+ return -1;
+
+ uint bytes_remaining = m_size - m_ofs;
+ if ((uint)max_bytes_to_read > bytes_remaining)
+ {
+ max_bytes_to_read = bytes_remaining;
+ *pEOF_flag = true;
+ }
+
+ memcpy(pBuf, m_pSrc_data + m_ofs, max_bytes_to_read);
+ m_ofs += max_bytes_to_read;
+
+ return max_bytes_to_read;
+}
+
+unsigned char *decompress_jpeg_image_from_stream(jpeg_decoder_stream *pStream, int *width, int *height, int *actual_comps, int req_comps)
+{
+ if (!actual_comps)
+ return NULL;
+ *actual_comps = 0;
+
+ if ((!pStream) || (!width) || (!height) || (!req_comps))
+ return NULL;
+
+ if ((req_comps != 1) && (req_comps != 3) && (req_comps != 4))
+ return NULL;
+
+ jpeg_decoder decoder(pStream);
+ if (decoder.get_error_code() != JPGD_SUCCESS)
+ return NULL;
+
+ const int image_width = decoder.get_width(), image_height = decoder.get_height();
+ *width = image_width;
+ *height = image_height;
+ *actual_comps = decoder.get_num_components();
+
+ if (decoder.begin_decoding() != JPGD_SUCCESS)
+ return NULL;
+
+ const int dst_bpl = image_width * req_comps;
+
+ uint8 *pImage_data = (uint8*)jpgd_malloc(dst_bpl * image_height);
+ if (!pImage_data)
+ return NULL;
+
+ for (int y = 0; y < image_height; y++)
+ {
+ const uint8* pScan_line;
+ uint scan_line_len;
+ if (decoder.decode((const void**)&pScan_line, &scan_line_len) != JPGD_SUCCESS)
+ {
+ jpgd_free(pImage_data);
+ return NULL;
+ }
+
+ uint8 *pDst = pImage_data + y * dst_bpl;
+
+ if (((req_comps == 1) && (decoder.get_num_components() == 1)) || ((req_comps == 4) && (decoder.get_num_components() == 3)))
+ memcpy(pDst, pScan_line, dst_bpl);
+ else if (decoder.get_num_components() == 1)
+ {
+ if (req_comps == 3)
+ {
+ for (int x = 0; x < image_width; x++)
+ {
+ uint8 luma = pScan_line[x];
+ pDst[0] = luma;
+ pDst[1] = luma;
+ pDst[2] = luma;
+ pDst += 3;
+ }
+ }
+ else
+ {
+ for (int x = 0; x < image_width; x++)
+ {
+ uint8 luma = pScan_line[x];
+ pDst[0] = luma;
+ pDst[1] = luma;
+ pDst[2] = luma;
+ pDst[3] = 255;
+ pDst += 4;
+ }
+ }
+ }
+ else if (decoder.get_num_components() == 3)
+ {
+ if (req_comps == 1)
+ {
+ const int YR = 19595, YG = 38470, YB = 7471;
+ for (int x = 0; x < image_width; x++)
+ {
+ int r = pScan_line[x*4+0];
+ int g = pScan_line[x*4+1];
+ int b = pScan_line[x*4+2];
+ *pDst++ = static_cast<uint8>((r * YR + g * YG + b * YB + 32768) >> 16);
+ }
+ }
+ else
+ {
+ for (int x = 0; x < image_width; x++)
+ {
+ pDst[0] = pScan_line[x*4+0];
+ pDst[1] = pScan_line[x*4+1];
+ pDst[2] = pScan_line[x*4+2];
+ pDst += 3;
+ }
+ }
+ }
+ }
+
+ return pImage_data;
+}
+
+unsigned char *decompress_jpeg_image_from_memory(const unsigned char *pSrc_data, int src_data_size, int *width, int *height, int *actual_comps, int req_comps)
+{
+ jpgd::jpeg_decoder_mem_stream mem_stream(pSrc_data, src_data_size);
+ return decompress_jpeg_image_from_stream(&mem_stream, width, height, actual_comps, req_comps);
+}
+
+unsigned char *decompress_jpeg_image_from_file(const char *pSrc_filename, int *width, int *height, int *actual_comps, int req_comps)
+{
+ jpgd::jpeg_decoder_file_stream file_stream;
+ if (!file_stream.open(pSrc_filename))
+ return NULL;
+ return decompress_jpeg_image_from_stream(&file_stream, width, height, actual_comps, req_comps);
+}
+
+} // namespace jpgd \ No newline at end of file
diff --git a/drivers/jpegd/jpgd.h b/drivers/jpegd/jpgd.h
new file mode 100644
index 0000000000..150b9a0b26
--- /dev/null
+++ b/drivers/jpegd/jpgd.h
@@ -0,0 +1,319 @@
+// jpgd.h - C++ class for JPEG decompression.
+// Public domain, Rich Geldreich <richgel99@gmail.com>
+#ifndef JPEG_DECODER_H
+#define JPEG_DECODER_H
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <setjmp.h>
+
+#ifdef _MSC_VER
+ #define JPGD_NORETURN __declspec(noreturn)
+#elif defined(__GNUC__)
+ #define JPGD_NORETURN __attribute__ ((noreturn))
+#else
+ #define JPGD_NORETURN
+#endif
+
+namespace jpgd
+{
+ typedef unsigned char uint8;
+ typedef signed short int16;
+ typedef unsigned short uint16;
+ typedef unsigned int uint;
+ typedef signed int int32;
+
+ // Loads a JPEG image from a memory buffer or a file.
+ // req_comps can be 1 (grayscale), 3 (RGB), or 4 (RGBA).
+ // On return, width/height will be set to the image's dimensions, and actual_comps will be set to the either 1 (grayscale) or 3 (RGB).
+ // Notes: For more control over where and how the source data is read, see the decompress_jpeg_image_from_stream() function below, or call the jpeg_decoder class directly.
+ // Requesting a 8 or 32bpp image is currently a little faster than 24bpp because the jpeg_decoder class itself currently always unpacks to either 8 or 32bpp.
+ unsigned char *decompress_jpeg_image_from_memory(const unsigned char *pSrc_data, int src_data_size, int *width, int *height, int *actual_comps, int req_comps);
+ unsigned char *decompress_jpeg_image_from_file(const char *pSrc_filename, int *width, int *height, int *actual_comps, int req_comps);
+
+ // Success/failure error codes.
+ enum jpgd_status
+ {
+ JPGD_SUCCESS = 0, JPGD_FAILED = -1, JPGD_DONE = 1,
+ JPGD_BAD_DHT_COUNTS = -256, JPGD_BAD_DHT_INDEX, JPGD_BAD_DHT_MARKER, JPGD_BAD_DQT_MARKER, JPGD_BAD_DQT_TABLE,
+ JPGD_BAD_PRECISION, JPGD_BAD_HEIGHT, JPGD_BAD_WIDTH, JPGD_TOO_MANY_COMPONENTS,
+ JPGD_BAD_SOF_LENGTH, JPGD_BAD_VARIABLE_MARKER, JPGD_BAD_DRI_LENGTH, JPGD_BAD_SOS_LENGTH,
+ JPGD_BAD_SOS_COMP_ID, JPGD_W_EXTRA_BYTES_BEFORE_MARKER, JPGD_NO_ARITHMITIC_SUPPORT, JPGD_UNEXPECTED_MARKER,
+ JPGD_NOT_JPEG, JPGD_UNSUPPORTED_MARKER, JPGD_BAD_DQT_LENGTH, JPGD_TOO_MANY_BLOCKS,
+ JPGD_UNDEFINED_QUANT_TABLE, JPGD_UNDEFINED_HUFF_TABLE, JPGD_NOT_SINGLE_SCAN, JPGD_UNSUPPORTED_COLORSPACE,
+ JPGD_UNSUPPORTED_SAMP_FACTORS, JPGD_DECODE_ERROR, JPGD_BAD_RESTART_MARKER, JPGD_ASSERTION_ERROR,
+ JPGD_BAD_SOS_SPECTRAL, JPGD_BAD_SOS_SUCCESSIVE, JPGD_STREAM_READ, JPGD_NOTENOUGHMEM
+ };
+
+ // Input stream interface.
+ // Derive from this class to read input data from sources other than files or memory. Set m_eof_flag to true when no more data is available.
+ // The decoder is rather greedy: it will keep on calling this method until its internal input buffer is full, or until the EOF flag is set.
+ // It the input stream contains data after the JPEG stream's EOI (end of image) marker it will probably be pulled into the internal buffer.
+ // Call the get_total_bytes_read() method to determine the actual size of the JPEG stream after successful decoding.
+ class jpeg_decoder_stream
+ {
+ public:
+ jpeg_decoder_stream() { }
+ virtual ~jpeg_decoder_stream() { }
+
+ // The read() method is called when the internal input buffer is empty.
+ // Parameters:
+ // pBuf - input buffer
+ // max_bytes_to_read - maximum bytes that can be written to pBuf
+ // pEOF_flag - set this to true if at end of stream (no more bytes remaining)
+ // Returns -1 on error, otherwise return the number of bytes actually written to the buffer (which may be 0).
+ // Notes: This method will be called in a loop until you set *pEOF_flag to true or the internal buffer is full.
+ virtual int read(uint8 *pBuf, int max_bytes_to_read, bool *pEOF_flag) = 0;
+ };
+
+ // stdio FILE stream class.
+ class jpeg_decoder_file_stream : public jpeg_decoder_stream
+ {
+ jpeg_decoder_file_stream(const jpeg_decoder_file_stream &);
+ jpeg_decoder_file_stream &operator =(const jpeg_decoder_file_stream &);
+
+ FILE *m_pFile;
+ bool m_eof_flag, m_error_flag;
+
+ public:
+ jpeg_decoder_file_stream();
+ virtual ~jpeg_decoder_file_stream();
+
+ bool open(const char *Pfilename);
+ void close();
+
+ virtual int read(uint8 *pBuf, int max_bytes_to_read, bool *pEOF_flag);
+ };
+
+ // Memory stream class.
+ class jpeg_decoder_mem_stream : public jpeg_decoder_stream
+ {
+ const uint8 *m_pSrc_data;
+ uint m_ofs, m_size;
+
+ public:
+ jpeg_decoder_mem_stream() : m_pSrc_data(NULL), m_ofs(0), m_size(0) { }
+ jpeg_decoder_mem_stream(const uint8 *pSrc_data, uint size) : m_pSrc_data(pSrc_data), m_ofs(0), m_size(size) { }
+
+ virtual ~jpeg_decoder_mem_stream() { }
+
+ bool open(const uint8 *pSrc_data, uint size);
+ void close() { m_pSrc_data = NULL; m_ofs = 0; m_size = 0; }
+
+ virtual int read(uint8 *pBuf, int max_bytes_to_read, bool *pEOF_flag);
+ };
+
+ // Loads JPEG file from a jpeg_decoder_stream.
+ unsigned char *decompress_jpeg_image_from_stream(jpeg_decoder_stream *pStream, int *width, int *height, int *actual_comps, int req_comps);
+
+ enum
+ {
+ JPGD_IN_BUF_SIZE = 8192, JPGD_MAX_BLOCKS_PER_MCU = 10, JPGD_MAX_HUFF_TABLES = 8, JPGD_MAX_QUANT_TABLES = 4,
+ JPGD_MAX_COMPONENTS = 4, JPGD_MAX_COMPS_IN_SCAN = 4, JPGD_MAX_BLOCKS_PER_ROW = 8192, JPGD_MAX_HEIGHT = 16384, JPGD_MAX_WIDTH = 16384
+ };
+
+ typedef int16 jpgd_quant_t;
+ typedef int16 jpgd_block_t;
+
+ class jpeg_decoder
+ {
+ public:
+ // Call get_error_code() after constructing to determine if the stream is valid or not. You may call the get_width(), get_height(), etc.
+ // methods after the constructor is called. You may then either destruct the object, or begin decoding the image by calling begin_decoding(), then decode() on each scanline.
+ jpeg_decoder(jpeg_decoder_stream *pStream);
+
+ ~jpeg_decoder();
+
+ // Call this method after constructing the object to begin decompression.
+ // If JPGD_SUCCESS is returned you may then call decode() on each scanline.
+ int begin_decoding();
+
+ // Returns the next scan line.
+ // For grayscale images, pScan_line will point to a buffer containing 8-bit pixels (get_bytes_per_pixel() will return 1).
+ // Otherwise, it will always point to a buffer containing 32-bit RGBA pixels (A will always be 255, and get_bytes_per_pixel() will return 4).
+ // Returns JPGD_SUCCESS if a scan line has been returned.
+ // Returns JPGD_DONE if all scan lines have been returned.
+ // Returns JPGD_FAILED if an error occurred. Call get_error_code() for a more info.
+ int decode(const void** pScan_line, uint* pScan_line_len);
+
+ inline jpgd_status get_error_code() const { return m_error_code; }
+
+ inline int get_width() const { return m_image_x_size; }
+ inline int get_height() const { return m_image_y_size; }
+
+ inline int get_num_components() const { return m_comps_in_frame; }
+
+ inline int get_bytes_per_pixel() const { return m_dest_bytes_per_pixel; }
+ inline int get_bytes_per_scan_line() const { return m_image_x_size * get_bytes_per_pixel(); }
+
+ // Returns the total number of bytes actually consumed by the decoder (which should equal the actual size of the JPEG file).
+ inline int get_total_bytes_read() const { return m_total_bytes_read; }
+
+ private:
+ jpeg_decoder(const jpeg_decoder &);
+ jpeg_decoder &operator =(const jpeg_decoder &);
+
+ typedef void (*pDecode_block_func)(jpeg_decoder *, int, int, int);
+
+ struct huff_tables
+ {
+ bool ac_table;
+ uint look_up[256];
+ uint look_up2[256];
+ uint8 code_size[256];
+ uint tree[512];
+ };
+
+ struct coeff_buf
+ {
+ uint8 *pData;
+ int block_num_x, block_num_y;
+ int block_len_x, block_len_y;
+ int block_size;
+ };
+
+ struct mem_block
+ {
+ mem_block *m_pNext;
+ size_t m_used_count;
+ size_t m_size;
+ char m_data[1];
+ };
+
+ jmp_buf m_jmp_state;
+ mem_block *m_pMem_blocks;
+ int m_image_x_size;
+ int m_image_y_size;
+ jpeg_decoder_stream *m_pStream;
+ int m_progressive_flag;
+ uint8 m_huff_ac[JPGD_MAX_HUFF_TABLES];
+ uint8* m_huff_num[JPGD_MAX_HUFF_TABLES]; // pointer to number of Huffman codes per bit size
+ uint8* m_huff_val[JPGD_MAX_HUFF_TABLES]; // pointer to Huffman codes per bit size
+ jpgd_quant_t* m_quant[JPGD_MAX_QUANT_TABLES]; // pointer to quantization tables
+ int m_scan_type; // Gray, Yh1v1, Yh1v2, Yh2v1, Yh2v2 (CMYK111, CMYK4114 no longer supported)
+ int m_comps_in_frame; // # of components in frame
+ int m_comp_h_samp[JPGD_MAX_COMPONENTS]; // component's horizontal sampling factor
+ int m_comp_v_samp[JPGD_MAX_COMPONENTS]; // component's vertical sampling factor
+ int m_comp_quant[JPGD_MAX_COMPONENTS]; // component's quantization table selector
+ int m_comp_ident[JPGD_MAX_COMPONENTS]; // component's ID
+ int m_comp_h_blocks[JPGD_MAX_COMPONENTS];
+ int m_comp_v_blocks[JPGD_MAX_COMPONENTS];
+ int m_comps_in_scan; // # of components in scan
+ int m_comp_list[JPGD_MAX_COMPS_IN_SCAN]; // components in this scan
+ int m_comp_dc_tab[JPGD_MAX_COMPONENTS]; // component's DC Huffman coding table selector
+ int m_comp_ac_tab[JPGD_MAX_COMPONENTS]; // component's AC Huffman coding table selector
+ int m_spectral_start; // spectral selection start
+ int m_spectral_end; // spectral selection end
+ int m_successive_low; // successive approximation low
+ int m_successive_high; // successive approximation high
+ int m_max_mcu_x_size; // MCU's max. X size in pixels
+ int m_max_mcu_y_size; // MCU's max. Y size in pixels
+ int m_blocks_per_mcu;
+ int m_max_blocks_per_row;
+ int m_mcus_per_row, m_mcus_per_col;
+ int m_mcu_org[JPGD_MAX_BLOCKS_PER_MCU];
+ int m_total_lines_left; // total # lines left in image
+ int m_mcu_lines_left; // total # lines left in this MCU
+ int m_real_dest_bytes_per_scan_line;
+ int m_dest_bytes_per_scan_line; // rounded up
+ int m_dest_bytes_per_pixel; // 4 (RGB) or 1 (Y)
+ huff_tables* m_pHuff_tabs[JPGD_MAX_HUFF_TABLES];
+ coeff_buf* m_dc_coeffs[JPGD_MAX_COMPONENTS];
+ coeff_buf* m_ac_coeffs[JPGD_MAX_COMPONENTS];
+ int m_eob_run;
+ int m_block_y_mcu[JPGD_MAX_COMPONENTS];
+ uint8* m_pIn_buf_ofs;
+ int m_in_buf_left;
+ int m_tem_flag;
+ bool m_eof_flag;
+ uint8 m_in_buf_pad_start[128];
+ uint8 m_in_buf[JPGD_IN_BUF_SIZE + 128];
+ uint8 m_in_buf_pad_end[128];
+ int m_bits_left;
+ uint m_bit_buf;
+ int m_restart_interval;
+ int m_restarts_left;
+ int m_next_restart_num;
+ int m_max_mcus_per_row;
+ int m_max_blocks_per_mcu;
+ int m_expanded_blocks_per_mcu;
+ int m_expanded_blocks_per_row;
+ int m_expanded_blocks_per_component;
+ bool m_freq_domain_chroma_upsample;
+ int m_max_mcus_per_col;
+ uint m_last_dc_val[JPGD_MAX_COMPONENTS];
+ jpgd_block_t* m_pMCU_coefficients;
+ int m_mcu_block_max_zag[JPGD_MAX_BLOCKS_PER_MCU];
+ uint8* m_pSample_buf;
+ int m_crr[256];
+ int m_cbb[256];
+ int m_crg[256];
+ int m_cbg[256];
+ uint8* m_pScan_line_0;
+ uint8* m_pScan_line_1;
+ jpgd_status m_error_code;
+ bool m_ready_flag;
+ int m_total_bytes_read;
+
+ void free_all_blocks();
+ JPGD_NORETURN void stop_decoding(jpgd_status status);
+ void *alloc(size_t n, bool zero = false);
+ void word_clear(void *p, uint16 c, uint n);
+ void prep_in_buffer();
+ void read_dht_marker();
+ void read_dqt_marker();
+ void read_sof_marker();
+ void skip_variable_marker();
+ void read_dri_marker();
+ void read_sos_marker();
+ int next_marker();
+ int process_markers();
+ void locate_soi_marker();
+ void locate_sof_marker();
+ int locate_sos_marker();
+ void init(jpeg_decoder_stream * pStream);
+ void create_look_ups();
+ void fix_in_buffer();
+ void transform_mcu(int mcu_row);
+ void transform_mcu_expand(int mcu_row);
+ coeff_buf* coeff_buf_open(int block_num_x, int block_num_y, int block_len_x, int block_len_y);
+ inline jpgd_block_t *coeff_buf_getp(coeff_buf *cb, int block_x, int block_y);
+ void load_next_row();
+ void decode_next_row();
+ void make_huff_table(int index, huff_tables *pH);
+ void check_quant_tables();
+ void check_huff_tables();
+ void calc_mcu_block_order();
+ int init_scan();
+ void init_frame();
+ void process_restart();
+ void decode_scan(pDecode_block_func decode_block_func);
+ void init_progressive();
+ void init_sequential();
+ void decode_start();
+ void decode_init(jpeg_decoder_stream * pStream);
+ void H2V2Convert();
+ void H2V1Convert();
+ void H1V2Convert();
+ void H1V1Convert();
+ void gray_convert();
+ void expanded_convert();
+ void find_eoi();
+ inline uint get_char();
+ inline uint get_char(bool *pPadding_flag);
+ inline void stuff_char(uint8 q);
+ inline uint8 get_octet();
+ inline uint get_bits(int num_bits);
+ inline uint get_bits_no_markers(int numbits);
+ inline int huff_decode(huff_tables *pH);
+ inline int huff_decode(huff_tables *pH, int& extrabits);
+ static inline uint8 clamp(int i);
+ static void decode_block_dc_first(jpeg_decoder *pD, int component_id, int block_x, int block_y);
+ static void decode_block_dc_refine(jpeg_decoder *pD, int component_id, int block_x, int block_y);
+ static void decode_block_ac_first(jpeg_decoder *pD, int component_id, int block_x, int block_y);
+ static void decode_block_ac_refine(jpeg_decoder *pD, int component_id, int block_x, int block_y);
+ };
+
+} // namespace jpgd
+
+#endif // JPEG_DECODER_H
diff --git a/drivers/jpg/image_loader_jpg.cpp b/drivers/jpg/image_loader_jpg.cpp
deleted file mode 100644
index 62b587f61c..0000000000
--- a/drivers/jpg/image_loader_jpg.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*************************************************/
-/* image_loader_jpg.cpp */
-/*************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/*************************************************/
-/* Source code within this file is: */
-/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */
-/* All Rights Reserved. */
-/*************************************************/
-
-#include "image_loader_jpg.h"
-
-#include "print_string.h"
-#include "os/os.h"
-#include "drivers/jpg/tinyjpeg.h"
-
-
-static void* _tinyjpg_alloc(unsigned int amount) {
-
- return memalloc(amount);
-}
-
-static void _tinyjpg_free(void *ptr) {
-
- memfree(ptr);
-}
-
-Error ImageLoaderJPG::load_image(Image *p_image,FileAccess *f) {
-
-
- DVector<uint8_t> src_image;
- int src_image_len = f->get_len();
- ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT);
- src_image.resize(src_image_len);
-
- DVector<uint8_t>::Write w = src_image.write();
-
- f->get_buffer(&w[0],src_image_len);
-
- f->close();
-
- jdec_private* jdec=tinyjpeg_init(_tinyjpg_alloc,_tinyjpg_free);
- ERR_FAIL_COND_V(!jdec,ERR_UNAVAILABLE);
-
- int ret = tinyjpeg_parse_header(jdec,&w[0],src_image_len);
-
- if (ret!=0) {
- tinyjpeg_free(jdec);
- }
-
- ERR_FAIL_COND_V(ret!=0,ERR_FILE_CORRUPT);
-
- unsigned int width,height;
-
-
- tinyjpeg_get_size(jdec,&width,&height);
-
-
-
- DVector<uint8_t> imgdata;
- imgdata.resize(width*height*3);
- DVector<uint8_t>::Write imgdataw = imgdata.write();
-
-
- unsigned char *components[1]={&imgdataw[0]};
- tinyjpeg_set_components(jdec,components,1);
- tinyjpeg_decode(jdec,TINYJPEG_FMT_RGB24);
- imgdataw = DVector<uint8_t>::Write();
-
- Image dst_image(width,height,0,Image::FORMAT_RGB,imgdata);
-
- tinyjpeg_free(jdec);
-
- *p_image=dst_image;
-
- return OK;
-
-}
-
-void ImageLoaderJPG::get_recognized_extensions(List<String> *p_extensions) const {
-
- p_extensions->push_back("jpg");
- p_extensions->push_back("jpeg");
-}
-
-
-ImageLoaderJPG::ImageLoaderJPG() {
-
-
-}
-
-
diff --git a/drivers/jpg/jidctflt.c b/drivers/jpg/jidctflt.c
deleted file mode 100644
index 40a9eab83e..0000000000
--- a/drivers/jpg/jidctflt.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * jidctflt.c
- *
- * Copyright (C) 1994-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- *
- * The authors make NO WARRANTY or representation, either express or implied,
- * with respect to this software, its quality, accuracy, merchantability, or
- * fitness for a particular purpose. This software is provided "AS IS", and you,
- * its user, assume the entire risk as to its quality and accuracy.
- *
- * This software is copyright (C) 1991-1998, Thomas G. Lane.
- * All Rights Reserved except as specified below.
- *
- * Permission is hereby granted to use, copy, modify, and distribute this
- * software (or portions thereof) for any purpose, without fee, subject to these
- * conditions:
- * (1) If any part of the source code for this software is distributed, then this
- * README file must be included, with this copyright and no-warranty notice
- * unaltered; and any additions, deletions, or changes to the original files
- * must be clearly indicated in accompanying documentation.
- * (2) If only executable code is distributed, then the accompanying
- * documentation must state that "this software is based in part on the work of
- * the Independent JPEG Group".
- * (3) Permission for use of this software is granted only if the user accepts
- * full responsibility for any undesirable consequences; the authors accept
- * NO LIABILITY for damages of any kind.
- *
- * These conditions apply to any software derived from or based on the IJG code,
- * not just to the unmodified library. If you use our work, you ought to
- * acknowledge us.
- *
- * Permission is NOT granted for the use of any IJG author's name or company name
- * in advertising or publicity relating to this software or products derived from
- * it. This software may be referred to only as "the Independent JPEG Group's
- * software".
- *
- * We specifically permit and encourage the use of this software as the basis of
- * commercial products, provided that all warranty or liability claims are
- * assumed by the product vendor.
- *
- *
- * This file contains a floating-point implementation of the
- * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine
- * must also perform dequantization of the input coefficients.
- *
- * This implementation should be more accurate than either of the integer
- * IDCT implementations. However, it may not give the same results on all
- * machines because of differences in roundoff behavior. Speed will depend
- * on the hardware's floating point capacity.
- *
- * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
- * on each row (or vice versa, but it's more convenient to emit a row at
- * a time). Direct algorithms are also available, but they are much more
- * complex and seem not to be any faster when reduced to code.
- *
- * This implementation is based on Arai, Agui, and Nakajima's algorithm for
- * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in
- * Japanese, but the algorithm is described in the Pennebaker & Mitchell
- * JPEG textbook (see REFERENCES section in file README). The following code
- * is based directly on figure 4-8 in P&M.
- * While an 8-point DCT cannot be done in less than 11 multiplies, it is
- * possible to arrange the computation so that many of the multiplies are
- * simple scalings of the final outputs. These multiplies can then be
- * folded into the multiplications or divisions by the JPEG quantization
- * table entries. The AA&N method leaves only 5 multiplies and 29 adds
- * to be done in the DCT itself.
- * The primary disadvantage of this method is that with a fixed-point
- * implementation, accuracy is lost due to imprecise representation of the
- * scaled quantization values. However, that problem does not arise if
- * we use floating point arithmetic.
- */
-
-#include "tinyjpeg-internal.h"
-
-#define FAST_FLOAT float
-#define DCTSIZE 8
-#define DCTSIZE2 (DCTSIZE*DCTSIZE)
-
-#define DEQUANTIZE(coef,quantval) (((FAST_FLOAT) (coef)) * (quantval))
-
-#if 0 && defined(__GNUC__) && (defined(__i686__))
-// || defined(__x86_64__))
-
-static inline unsigned char descale_and_clamp(int x, int shift)
-{
- __asm__ (
- "add %3,%1\n"
- "\tsar %2,%1\n"
- "\tsub $-128,%1\n"
- "\tcmovl %5,%1\n" /* Use the sub to compare to 0 */
- "\tcmpl %4,%1\n"
- "\tcmovg %4,%1\n"
- : "=r"(x)
- : "0"(x), "Ir"(shift), "ir"(1UL<<(shift-1)), "r" (0xff), "r" (0)
- );
- return x;
-}
-
-#else
-static __inline unsigned char descale_and_clamp(int x, int shift)
-{
- x += (1UL<<(shift-1));
- if (x<0)
- x = (x >> shift) | ((~(0UL)) << (32-(shift)));
- else
- x >>= shift;
- x += 128;
- if (x>255)
- return 255;
- else if (x<0)
- return 0;
- else
- return x;
-}
-#endif
-
-/*
- * Perform dequantization and inverse DCT on one block of coefficients.
- */
-
-void
-tinyjpeg_idct_float (struct component *compptr, uint8_t *output_buf, int stride)
-{
- FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- FAST_FLOAT tmp10, tmp11, tmp12, tmp13;
- FAST_FLOAT z5, z10, z11, z12, z13;
- int16_t *inptr;
- FAST_FLOAT *quantptr;
- FAST_FLOAT *wsptr;
- uint8_t *outptr;
- int ctr;
- FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */
-
- /* Pass 1: process columns from input, store into work array. */
-
- inptr = compptr->DCT;
- quantptr = compptr->Q_table;
- wsptr = workspace;
- for (ctr = DCTSIZE; ctr > 0; ctr--) {
- /* Due to quantization, we will usually find that many of the input
- * coefficients are zero, especially the AC terms. We can exploit this
- * by short-circuiting the IDCT calculation for any column in which all
- * the AC terms are zero. In that case each output is equal to the
- * DC coefficient (with scale factor as needed).
- * With typical images and quantization tables, half or more of the
- * column DCT calculations can be simplified this way.
- */
-
- if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
- inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
- inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
- inptr[DCTSIZE*7] == 0) {
- /* AC terms all zero */
- FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
-
- wsptr[DCTSIZE*0] = dcval;
- wsptr[DCTSIZE*1] = dcval;
- wsptr[DCTSIZE*2] = dcval;
- wsptr[DCTSIZE*3] = dcval;
- wsptr[DCTSIZE*4] = dcval;
- wsptr[DCTSIZE*5] = dcval;
- wsptr[DCTSIZE*6] = dcval;
- wsptr[DCTSIZE*7] = dcval;
-
- inptr++; /* advance pointers to next column */
- quantptr++;
- wsptr++;
- continue;
- }
-
- /* Even part */
-
- tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
- tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
- tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
- tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
-
- tmp10 = tmp0 + tmp2; /* phase 3 */
- tmp11 = tmp0 - tmp2;
-
- tmp13 = tmp1 + tmp3; /* phases 5-3 */
- tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */
-
- tmp0 = tmp10 + tmp13; /* phase 2 */
- tmp3 = tmp10 - tmp13;
- tmp1 = tmp11 + tmp12;
- tmp2 = tmp11 - tmp12;
-
- /* Odd part */
-
- tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
- tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
- tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
- tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
-
- z13 = tmp6 + tmp5; /* phase 6 */
- z10 = tmp6 - tmp5;
- z11 = tmp4 + tmp7;
- z12 = tmp4 - tmp7;
-
- tmp7 = z11 + z13; /* phase 5 */
- tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */
-
- z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
- tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */
- tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */
-
- tmp6 = tmp12 - tmp7; /* phase 2 */
- tmp5 = tmp11 - tmp6;
- tmp4 = tmp10 + tmp5;
-
- wsptr[DCTSIZE*0] = tmp0 + tmp7;
- wsptr[DCTSIZE*7] = tmp0 - tmp7;
- wsptr[DCTSIZE*1] = tmp1 + tmp6;
- wsptr[DCTSIZE*6] = tmp1 - tmp6;
- wsptr[DCTSIZE*2] = tmp2 + tmp5;
- wsptr[DCTSIZE*5] = tmp2 - tmp5;
- wsptr[DCTSIZE*4] = tmp3 + tmp4;
- wsptr[DCTSIZE*3] = tmp3 - tmp4;
-
- inptr++; /* advance pointers to next column */
- quantptr++;
- wsptr++;
- }
-
- /* Pass 2: process rows from work array, store into output array. */
- /* Note that we must descale the results by a factor of 8 == 2**3. */
-
- wsptr = workspace;
- outptr = output_buf;
- for (ctr = 0; ctr < DCTSIZE; ctr++) {
- /* Rows of zeroes can be exploited in the same way as we did with columns.
- * However, the column calculation has created many nonzero AC terms, so
- * the simplification applies less often (typically 5% to 10% of the time).
- * And testing floats for zero is relatively expensive, so we don't bother.
- */
-
- /* Even part */
-
- tmp10 = wsptr[0] + wsptr[4];
- tmp11 = wsptr[0] - wsptr[4];
-
- tmp13 = wsptr[2] + wsptr[6];
- tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13;
-
- tmp0 = tmp10 + tmp13;
- tmp3 = tmp10 - tmp13;
- tmp1 = tmp11 + tmp12;
- tmp2 = tmp11 - tmp12;
-
- /* Odd part */
-
- z13 = wsptr[5] + wsptr[3];
- z10 = wsptr[5] - wsptr[3];
- z11 = wsptr[1] + wsptr[7];
- z12 = wsptr[1] - wsptr[7];
-
- tmp7 = z11 + z13;
- tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562);
-
- z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
- tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */
- tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */
-
- tmp6 = tmp12 - tmp7;
- tmp5 = tmp11 - tmp6;
- tmp4 = tmp10 + tmp5;
-
- /* Final output stage: scale down by a factor of 8 and range-limit */
-
- outptr[0] = descale_and_clamp((int)(tmp0 + tmp7), 3);
- outptr[7] = descale_and_clamp((int)(tmp0 - tmp7), 3);
- outptr[1] = descale_and_clamp((int)(tmp1 + tmp6), 3);
- outptr[6] = descale_and_clamp((int)(tmp1 - tmp6), 3);
- outptr[2] = descale_and_clamp((int)(tmp2 + tmp5), 3);
- outptr[5] = descale_and_clamp((int)(tmp2 - tmp5), 3);
- outptr[4] = descale_and_clamp((int)(tmp3 + tmp4), 3);
- outptr[3] = descale_and_clamp((int)(tmp3 - tmp4), 3);
-
-
- wsptr += DCTSIZE; /* advance pointer to next row */
- outptr += stride;
- }
-}
-
diff --git a/drivers/jpg/loadjpeg.c b/drivers/jpg/loadjpeg.c
deleted file mode 100644
index 82072d4272..0000000000
--- a/drivers/jpg/loadjpeg.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Small jpeg decoder library - testing application
- *
- * Copyright (c) 2006, Luc Saillard <luc@saillard.org>
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * - Neither the name of the author nor the names of its contributors may be
- * used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "tinyjpeg.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#define snprintf(buf, size, fmt, ...) sprintf(buf, fmt, __VA_ARGS__)
-
-static void exitmessage(const char *message) __attribute__((noreturn));
-static void exitmessage(const char *message)
-{
- printf("%s\n", message);
- exit(0);
-}
-
-static int filesize(FILE *fp)
-{
- long pos;
- fseek(fp, 0, SEEK_END);
- pos = ftell(fp);
- fseek(fp, 0, SEEK_SET);
- return pos;
-}
-
-/**
- * Save a buffer in 24bits Targa format
- * (BGR byte order)
- */
-static void write_tga(const char *filename, int output_format, int width, int height, unsigned char **components)
-{
- unsigned char targaheader[18];
- FILE *F;
- char temp[1024];
- unsigned int bufferlen = width * height * 3;
- unsigned char *rgb_data = components[0];
-
- sprintf(temp, sizeof(temp), filename);
-
- memset(targaheader,0,sizeof(targaheader));
-
- targaheader[12] = (unsigned char) (width & 0xFF);
- targaheader[13] = (unsigned char) (width >> 8);
- targaheader[14] = (unsigned char) (height & 0xFF);
- targaheader[15] = (unsigned char) (height >> 8);
- targaheader[17] = 0x20; /* Top-down, non-interlaced */
- targaheader[2] = 2; /* image type = uncompressed RGB */
- targaheader[16] = 24;
-
- if (output_format == TINYJPEG_FMT_RGB24)
- {
- unsigned char *data = rgb_data + bufferlen - 3;
- do
- {
- unsigned char c = data[0];
- data[0] = data[2];
- data[2] = c;
- data-=3;
- }
- while (data > rgb_data);
- }
-
- F = fopen(temp, "wb");
- fwrite(targaheader, sizeof(targaheader), 1, F);
- fwrite(rgb_data, 1, bufferlen, F);
- fclose(F);
-}
-
-/**
- * Save a buffer in three files (.Y, .U, .V) useable by yuvsplittoppm
- */
-static void write_yuv(const char *filename, int width, int height, unsigned char **components)
-{
- FILE *F;
- char temp[1024];
-
- snprintf(temp, 1024, "%s.Y", filename);
- F = fopen(temp, "wb");
- fwrite(components[0], width, height, F);
- fclose(F);
- snprintf(temp, 1024, "%s.U", filename);
- F = fopen(temp, "wb");
- fwrite(components[1], width*height/4, 1, F);
- fclose(F);
- snprintf(temp, 1024, "%s.V", filename);
- F = fopen(temp, "wb");
- fwrite(components[2], width*height/4, 1, F);
- fclose(F);
-}
-
-/**
- * Save a buffer in grey image (pgm format)
- */
-static void write_pgm(const char *filename, int width, int height, unsigned char **components)
-{
- FILE *F;
- char temp[1024];
-
- snprintf(temp, 1024, "%s", filename);
- F = fopen(temp, "wb");
- fprintf(F, "P5\n%d %d\n255\n", width, height);
- fwrite(components[0], width, height, F);
- fclose(F);
-}
-
-/**
- * Load one jpeg image, and try to decompress 1000 times, and save the result.
- * This is mainly used for benchmarking the decoder, or to test if between each
- * called of the library the DCT is corrected reset (a bug was found).
- */
-int load_multiple_times(const char *filename, const char *outfilename, int output_format)
-{
- FILE *fp;
- int count, length_of_file;
- unsigned int width, height;
- unsigned char *buf;
- struct jdec_private *jdec;
- unsigned char *components[4];
-
- jdec = tinyjpeg_init();
- count = 0;
-
- /* Load the Jpeg into memory */
- fp = fopen(filename, "rb");
- if (fp == NULL)
- exitmessage("Cannot open filename\n");
- length_of_file = filesize(fp);
- buf = (unsigned char *)malloc(length_of_file + 4);
- fread(buf, length_of_file, 1, fp);
- fclose(fp);
-
- while (count<1000)
- {
- if (tinyjpeg_parse_header(jdec, buf, length_of_file)<0)
- exitmessage(tinyjpeg_get_errorstring(jdec));
-
- tinyjpeg_decode(jdec, output_format);
-
- count++;
- }
-
- /*
- * Get address for each plane (not only max 3 planes is supported), and
- * depending of the output mode, only some components will be filled
- * RGB: 1 plane, YUV420P: 3 planes, GREY: 1 plane
- */
- tinyjpeg_get_components(jdec, components);
- tinyjpeg_get_size(jdec, &width, &height);
-
- /* Save it */
- switch (output_format)
- {
- case TINYJPEG_FMT_RGB24:
- case TINYJPEG_FMT_BGR24:
- write_tga(outfilename, output_format, width, height, components);
- break;
- case TINYJPEG_FMT_YUV420P:
- write_yuv(outfilename, width, height, components);
- break;
- case TINYJPEG_FMT_GREY:
- write_pgm(outfilename, width, height, components);
- break;
- }
-
- free(buf);
- tinyjpeg_free(jdec);
- return 0;
-}
-
-/**
- * Load one jpeg image, and decompress it, and save the result.
- */
-int convert_one_image(const char *infilename, const char *outfilename, int output_format)
-{
- FILE *fp;
- unsigned int length_of_file;
- unsigned int width, height;
- unsigned char *buf;
- struct jdec_private *jdec;
- unsigned char *components[3];
-
- /* Load the Jpeg into memory */
- fp = fopen(infilename, "rb");
- if (fp == NULL)
- exitmessage("Cannot open filename\n");
- length_of_file = filesize(fp);
- buf = (unsigned char *)malloc(length_of_file + 4);
- if (buf == NULL)
- exitmessage("Not enough memory for loading file\n");
- fread(buf, length_of_file, 1, fp);
- fclose(fp);
-
- /* Decompress it */
- jdec = tinyjpeg_init();
- if (jdec == NULL)
- exitmessage("Not enough memory to alloc the structure need for decompressing\n");
-
- if (tinyjpeg_parse_header(jdec, buf, length_of_file)<0)
- exitmessage(tinyjpeg_get_errorstring(jdec));
-
- /* Get the size of the image */
- tinyjpeg_get_size(jdec, &width, &height);
-
- printf("Decoding JPEG image...\n");
- if (tinyjpeg_decode(jdec, output_format) < 0)
- exitmessage(tinyjpeg_get_errorstring(jdec));
-
- /*
- * Get address for each plane (not only max 3 planes is supported), and
- * depending of the output mode, only some components will be filled
- * RGB: 1 plane, YUV420P: 3 planes, GREY: 1 plane
- */
- tinyjpeg_get_components(jdec, components);
-
- /* Save it */
- switch (output_format)
- {
- case TINYJPEG_FMT_RGB24:
- case TINYJPEG_FMT_BGR24:
- write_tga(outfilename, output_format, width, height, components);
- break;
- case TINYJPEG_FMT_YUV420P:
- write_yuv(outfilename, width, height, components);
- break;
- case TINYJPEG_FMT_GREY:
- write_pgm(outfilename, width, height, components);
- break;
- }
-
- /* Only called this if the buffers were allocated by tinyjpeg_decode() */
- tinyjpeg_free(jdec);
- /* else called just free(jdec); */
-
- free(buf);
- return 0;
-}
-
-static void usage(void)
-{
- fprintf(stderr, "Usage: loadjpeg [options] <input_filename.jpeg> <format> <output_filename>\n");
- fprintf(stderr, "options:\n");
- fprintf(stderr, " --benchmark - Convert 1000 times the same image\n");
- fprintf(stderr, "format:\n");
- fprintf(stderr, " yuv420p - output 3 files .Y,.U,.V\n");
- fprintf(stderr, " rgb24 - output a .tga image\n");
- fprintf(stderr, " bgr24 - output a .tga image\n");
- fprintf(stderr, " gray - output a .pgm image\n");
- exit(1);
-}
-
-/**
- * main
- *
- */
-int main(int argc, char *argv[])
-{
- int output_format = TINYJPEG_FMT_YUV420P;
- char *output_filename, *input_filename;
- clock_t start_time, finish_time;
- unsigned int duration;
- int current_argument;
- int benchmark_mode = 0;
-
- if (argc < 3)
- usage();
-
- current_argument = 1;
- while (1)
- {
- if (strcmp(argv[current_argument], "--benchmark")==0)
- benchmark_mode = 1;
- else
- break;
- current_argument++;
- }
-
- if (argc < current_argument+2)
- usage();
-
- input_filename = argv[current_argument];
- if (strcmp(argv[current_argument+1],"yuv420p")==0)
- output_format = TINYJPEG_FMT_YUV420P;
- else if (strcmp(argv[current_argument+1],"rgb24")==0)
- output_format = TINYJPEG_FMT_RGB24;
- else if (strcmp(argv[current_argument+1],"bgr24")==0)
- output_format = TINYJPEG_FMT_BGR24;
- else if (strcmp(argv[current_argument+1],"grey")==0)
- output_format = TINYJPEG_FMT_GREY;
- else
- exitmessage("Bad format: need to be one of yuv420p, rgb24, bgr24, grey\n");
- output_filename = argv[current_argument+2];
-
- start_time = clock();
-
- if (benchmark_mode)
- load_multiple_times(input_filename, output_filename, output_format);
- else
- convert_one_image(input_filename, output_filename, output_format);
-
- finish_time = clock();
- duration = finish_time - start_time;
- printf("Decoding finished in %u ticks\n", duration);
-
- return 0;
-}
-
-
-
-
diff --git a/drivers/jpg/tinyjpeg-internal.h b/drivers/jpg/tinyjpeg-internal.h
deleted file mode 100644
index b2d5fe42aa..0000000000
--- a/drivers/jpg/tinyjpeg-internal.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Small jpeg decoder library (Internal header)
- *
- * Copyright (c) 2006, Luc Saillard <luc@saillard.org>
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * - Neither the name of the author nor the names of its contributors may be
- * used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-#ifndef __TINYJPEG_INTERNAL_H_
-#define __TINYJPEG_INTERNAL_H_
-
-#ifdef _MSC_VER
-
-typedef signed __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef signed __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef signed __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef signed __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-
-#else
-
-#ifdef NO_STDINT_H
-typedef unsigned char uint8_t;
-typedef signed char int8_t;
-typedef unsigned short uint16_t;
-typedef signed short int16_t;
-typedef unsigned int uint32_t;
-typedef signed int int32_t;
-typedef long long int64_t;
-typedef unsigned long long int64_t;
-#else
-#include <stdint.h>
-#endif
-#endif
-
-
-#include <setjmp.h>
-
-#define SANITY_CHECK 1
-
-struct jdec_private;
-
-#define HUFFMAN_BITS_SIZE 256
-#define HUFFMAN_HASH_NBITS 9
-#define HUFFMAN_HASH_SIZE (1UL<<HUFFMAN_HASH_NBITS)
-#define HUFFMAN_HASH_MASK (HUFFMAN_HASH_SIZE-1)
-
-#define HUFFMAN_TABLES 4
-#define COMPONENTS 3
-#define JPEG_MAX_WIDTH 4096
-#define JPEG_MAX_HEIGHT 4096
-
-struct huffman_table
-{
- /* Fast look up table, using HUFFMAN_HASH_NBITS bits we can have directly the symbol,
- * if the symbol is <0, then we need to look into the tree table */
- short int lookup[HUFFMAN_HASH_SIZE];
- /* code size: give the number of bits of a symbol is encoded */
- unsigned char code_size[HUFFMAN_HASH_SIZE];
- /* some place to store value that is not encoded in the lookup table
- * FIXME: Calculate if 256 value is enough to store all values
- */
- uint16_t slowtable[16-HUFFMAN_HASH_NBITS][256];
-};
-
-struct component
-{
- unsigned int Hfactor;
- unsigned int Vfactor;
- float *Q_table; /* Pointer to the quantisation table to use */
- struct huffman_table *AC_table;
- struct huffman_table *DC_table;
- short int previous_DC; /* Previous DC coefficient */
- short int DCT[64]; /* DCT coef */
-#if SANITY_CHECK
- unsigned int cid;
-#endif
-};
-
-
-typedef void (*decode_MCU_fct) (struct jdec_private *priv);
-typedef void (*convert_colorspace_fct) (struct jdec_private *priv);
-
-struct jdec_private
-{
- void *(*allocate_mem)(unsigned int amount);
- void (*free_mem)(void *mem);
-
- /* Public variables */
- uint8_t *components[COMPONENTS];
- unsigned int width, height; /* Size of the image */
- unsigned int flags;
-
- /* Private variables */
- const unsigned char *stream_begin, *stream_end;
- unsigned int stream_length;
-
- const unsigned char *stream; /* Pointer to the current stream */
- unsigned int reservoir, nbits_in_reservoir;
-
- struct component component_infos[COMPONENTS];
- float Q_tables[COMPONENTS][64]; /* quantization tables */
- struct huffman_table HTDC[HUFFMAN_TABLES]; /* DC huffman tables */
- struct huffman_table HTAC[HUFFMAN_TABLES]; /* AC huffman tables */
- int default_huffman_table_initialized;
- int restart_interval;
- int restarts_to_go; /* MCUs left in this restart interval */
- int last_rst_marker_seen; /* Rst marker is incremented each time */
-
- /* Temp space used after the IDCT to store each components */
- uint8_t Y[64*4], Cr[64], Cb[64];
-
- jmp_buf jump_state;
- /* Internal Pointer use for colorspace conversion, do not modify it !!! */
- uint8_t *plane[COMPONENTS];
-
- uint8_t decomp_block[16][16*3];
-
-};
-
-#if defined(__GNUC__) && (__GNUC__ > 3) && defined(__OPTIMIZE__)
-#define __likely(x) __builtin_expect(!!(x), 1)
-#define __unlikely(x) __builtin_expect(!!(x), 0)
-#else
-#define __likely(x) (x)
-#define __unlikely(x) (x)
-#endif
-
-#define IDCT tinyjpeg_idct_float
-void tinyjpeg_idct_float (struct component *compptr, uint8_t *output_buf, int stride);
-
-#endif
-
diff --git a/drivers/jpg/tinyjpeg.c b/drivers/jpg/tinyjpeg.c
deleted file mode 100644
index 8e3c934ce0..0000000000
--- a/drivers/jpg/tinyjpeg.c
+++ /dev/null
@@ -1,2202 +0,0 @@
-/*
- * Small jpeg decoder library
- *
- * Copyright (c) 2006, Luc Saillard <luc@saillard.org>
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * - Neither the name of the author nor the names of its contributors may be
- * used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <errno.h>
-
-#include "tinyjpeg.h"
-#include "tinyjpeg-internal.h"
-
-enum std_markers {
- DQT = 0xDB, /* Define Quantization Table */
- SOF = 0xC0, /* Start of Frame (size information) */
- DHT = 0xC4, /* Huffman Table */
- SOI = 0xD8, /* Start of Image */
- SOS = 0xDA, /* Start of Scan */
- RST = 0xD0, /* Reset Marker d0 -> .. */
- RST7 = 0xD7, /* Reset Marker .. -> d7 */
- EOI = 0xD9, /* End of Image */
- DRI = 0xDD, /* Define Restart Interval */
- APP0 = 0xE0,
-};
-
-#define cY 0
-#define cCb 1
-#define cCr 2
-
-#define BLACK_Y 0
-#define BLACK_U 127
-#define BLACK_V 127
-
-#if DEBUG
-#define trace(fmt, args...) do { \
- fprintf(stderr, fmt, ## args); \
- fflush(stderr); \
-} while(0)
-#else
-#define trace(fmt, ...) do { } while (0)
-#endif
-
-#define error(fmt, ...) do { \
- sprintf(error_string, fmt, ## __VA_ARGS__); \
- return -1; \
-} while(0)
-
-
-#if 0
-static char *print_bits(unsigned int value, char *bitstr)
-{
- int i, j;
- i=31;
- while (i>0)
- {
- if (value & (1UL<<i))
- break;
- i--;
- }
- j=0;
- while (i>=0)
- {
- bitstr[j++] = (value & (1UL<<i))?'1':'0';
- i--;
- }
- bitstr[j] = 0;
- return bitstr;
-}
-
-static void print_next_16bytes(int offset, const unsigned char *stream)
-{
- trace("%4.4x: %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n",
- offset,
- stream[0], stream[1], stream[2], stream[3],
- stream[4], stream[5], stream[6], stream[7],
- stream[8], stream[9], stream[10], stream[11],
- stream[12], stream[13], stream[14], stream[15]);
-}
-
-#endif
-
-/* Global variable to return the last error found while deconding */
-static char error_string[256];
-
-static const unsigned char zigzag[64] =
-{
- 0, 1, 5, 6, 14, 15, 27, 28,
- 2, 4, 7, 13, 16, 26, 29, 42,
- 3, 8, 12, 17, 25, 30, 41, 43,
- 9, 11, 18, 24, 31, 40, 44, 53,
- 10, 19, 23, 32, 39, 45, 52, 54,
- 20, 22, 33, 38, 46, 51, 55, 60,
- 21, 34, 37, 47, 50, 56, 59, 61,
- 35, 36, 48, 49, 57, 58, 62, 63
-};
-
-/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
-/* IMPORTANT: these are only valid for 8-bit data precision! */
-static const unsigned char bits_dc_luminance[17] =
-{
- 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0
-};
-static const unsigned char val_dc_luminance[] =
-{
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
-};
-
-static const unsigned char bits_dc_chrominance[17] =
-{
- 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0
-};
-static const unsigned char val_dc_chrominance[] =
-{
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
-};
-
-static const unsigned char bits_ac_luminance[17] =
-{
- 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d
-};
-static const unsigned char val_ac_luminance[] =
-{
- 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
- 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
- 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
- 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
- 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
- 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
- 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
- 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
- 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
- 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
- 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
- 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
- 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
- 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
- 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
- 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
- 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
- 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
- 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
- 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
- 0xf9, 0xfa
-};
-
-static const unsigned char bits_ac_chrominance[17] =
-{
- 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77
-};
-
-static const unsigned char val_ac_chrominance[] =
-{
- 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
- 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
- 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
- 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
- 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
- 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
- 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
- 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
- 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
- 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
- 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
- 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
- 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
- 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
- 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
- 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
- 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
- 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
- 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
- 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
- 0xf9, 0xfa
-};
-
-
-/*
- * 4 functions to manage the stream
- *
- * fill_nbits: put at least nbits in the reservoir of bits.
- * But convert any 0xff,0x00 into 0xff
- * get_nbits: read nbits from the stream, and put it in result,
- * bits is removed from the stream and the reservoir is filled
- * automaticaly. The result is signed according to the number of
- * bits.
- * look_nbits: read nbits from the stream without marking as read.
- * skip_nbits: read nbits from the stream but do not return the result.
- *
- * stream: current pointer in the jpeg data (read bytes per bytes)
- * nbits_in_reservoir: number of bits filled into the reservoir
- * reservoir: register that contains bits information. Only nbits_in_reservoir
- * is valid.
- * nbits_in_reservoir
- * <-- 17 bits -->
- * Ex: 0000 0000 1010 0000 1111 0000 <== reservoir
- * ^
- * bit 1
- * To get two bits from this example
- * result = (reservoir >> 15) & 3
- *
- */
-#define fill_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted) do { \
- while (nbits_in_reservoir<nbits_wanted) \
- { \
- unsigned char c; \
- if (stream >= priv->stream_end) \
- longjmp(priv->jump_state, -EIO); \
- c = *stream++; \
- reservoir <<= 8; \
- if (c == 0xff && *stream == 0x00) \
- stream++; \
- reservoir |= c; \
- nbits_in_reservoir+=8; \
- } \
-} while(0);
-
-/* Signed version !!!! */
-#define get_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted,result) do { \
- fill_nbits(reservoir,nbits_in_reservoir,stream,(nbits_wanted)); \
- result = ((reservoir)>>(nbits_in_reservoir-(nbits_wanted))); \
- nbits_in_reservoir -= (nbits_wanted); \
- reservoir &= ((1U<<nbits_in_reservoir)-1); \
- if ((unsigned int)result < (1UL<<((nbits_wanted)-1))) \
- result += (0xFFFFFFFFUL<<(nbits_wanted))+1; \
-} while(0);
-
-#define look_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted,result) do { \
- fill_nbits(reservoir,nbits_in_reservoir,stream,(nbits_wanted)); \
- result = ((reservoir)>>(nbits_in_reservoir-(nbits_wanted))); \
-} while(0);
-
-/* To speed up the decoding, we assume that the reservoir have enough bit
- * slow version:
- * #define skip_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted) do { \
- * fill_nbits(reservoir,nbits_in_reservoir,stream,(nbits_wanted)); \
- * nbits_in_reservoir -= (nbits_wanted); \
- * reservoir &= ((1U<<nbits_in_reservoir)-1); \
- * } while(0);
- */
-#define skip_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted) do { \
- nbits_in_reservoir -= (nbits_wanted); \
- reservoir &= ((1U<<nbits_in_reservoir)-1); \
-} while(0);
-
-
-#define be16_to_cpu(x) (((x)[0]<<8)|(x)[1])
-
-static void resync(struct jdec_private *priv);
-
-/**
- * Get the next (valid) huffman code in the stream.
- *
- * To speedup the procedure, we look HUFFMAN_HASH_NBITS bits and the code is
- * lower than HUFFMAN_HASH_NBITS we have automaticaly the length of the code
- * and the value by using two lookup table.
- * Else if the value is not found, just search (linear) into an array for each
- * bits is the code is present.
- *
- * If the code is not present for any reason, -1 is return.
- */
-static int get_next_huffman_code(struct jdec_private *priv, struct huffman_table *huffman_table)
-{
- int value, hcode;
- unsigned int extra_nbits, nbits;
- uint16_t *slowtable;
-
- look_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, HUFFMAN_HASH_NBITS, hcode);
- value = huffman_table->lookup[hcode];
- if (__likely(value >= 0))
- {
- unsigned int code_size = huffman_table->code_size[value];
- skip_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, code_size);
- return value;
- }
-
- /* Decode more bits each time ... */
- for (extra_nbits=0; extra_nbits<16-HUFFMAN_HASH_NBITS; extra_nbits++)
- {
- nbits = HUFFMAN_HASH_NBITS + 1 + extra_nbits;
-
- look_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, nbits, hcode);
- slowtable = huffman_table->slowtable[extra_nbits];
- /* Search if the code is in this array */
- while (slowtable[0]) {
- if (slowtable[0] == hcode) {
- skip_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, nbits);
- return slowtable[1];
- }
- slowtable+=2;
- }
- }
- return 0;
-}
-
-
-
-
-/**
- *
- * Decode a single block that contains the DCT coefficients.
- * The table coefficients is already dezigzaged at the end of the operation.
- *
- */
-static void process_Huffman_data_unit(struct jdec_private *priv, int component)
-{
- unsigned char j;
- unsigned int huff_code;
- unsigned char size_val, count_0;
-
- struct component *c = &priv->component_infos[component];
- short int DCT[64];
-
-
- /* Initialize the DCT coef table */
- memset(DCT, 0, sizeof(DCT));
-
- /* DC coefficient decoding */
- huff_code = get_next_huffman_code(priv, c->DC_table);
- //trace("+ %x\n", huff_code);
- if (huff_code) {
- get_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, huff_code, DCT[0]);
- DCT[0] += c->previous_DC;
- c->previous_DC = DCT[0];
- } else {
- DCT[0] = c->previous_DC;
- }
-
- /* AC coefficient decoding */
- j = 1;
- while (j<64)
- {
- huff_code = get_next_huffman_code(priv, c->AC_table);
- //trace("- %x\n", huff_code);
-
- size_val = huff_code & 0xF;
- count_0 = huff_code >> 4;
-
- if (size_val == 0)
- { /* RLE */
- if (count_0 == 0)
- break; /* EOB found, go out */
- else if (count_0 == 0xF)
- j += 16; /* skip 16 zeros */
- }
- else
- {
- j += count_0; /* skip count_0 zeroes */
- if (__unlikely(j >= 64))
- {
- sprintf(error_string, "Bad huffman data (buffer overflow)");
- break;
- }
- get_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, size_val, DCT[j]);
- j++;
- }
- }
-
- for (j = 0; j < 64; j++)
- c->DCT[j] = DCT[zigzag[j]];
-}
-
-/*
- * Takes two array of bits, and build the huffman table for size, and code
- *
- * lookup will return the symbol if the code is less or equal than HUFFMAN_HASH_NBITS.
- * code_size will be used to known how many bits this symbol is encoded.
- * slowtable will be used when the first lookup didn't give the result.
- */
-static void build_huffman_table(const unsigned char *bits, const unsigned char *vals, struct huffman_table *table)
-{
- unsigned int i, j, code, code_size, val, nbits;
- unsigned char huffsize[HUFFMAN_BITS_SIZE+1], *hz;
- unsigned int huffcode[HUFFMAN_BITS_SIZE+1], *hc;
- int next_free_entry;
-
- /*
- * Build a temp array
- * huffsize[X] => numbers of bits to write vals[X]
- */
- hz = huffsize;
- for (i=1; i<=16; i++)
- {
- for (j=1; j<=bits[i]; j++)
- *hz++ = i;
- }
- *hz = 0;
-
- memset(table->lookup, 0xff, sizeof(table->lookup));
- for (i=0; i<(16-HUFFMAN_HASH_NBITS); i++)
- table->slowtable[i][0] = 0;
-
- /* Build a temp array
- * huffcode[X] => code used to write vals[X]
- */
- code = 0;
- hc = huffcode;
- hz = huffsize;
- nbits = *hz;
- while (*hz)
- {
- while (*hz == nbits)
- {
- *hc++ = code++;
- hz++;
- }
- code <<= 1;
- nbits++;
- }
-
- /*
- * Build the lookup table, and the slowtable if needed.
- */
- next_free_entry = -1;
- for (i=0; huffsize[i]; i++)
- {
- val = vals[i];
- code = huffcode[i];
- code_size = huffsize[i];
-
- trace("val=%2.2x code=%8.8x codesize=%2.2d\n", val, code, code_size);
-
- table->code_size[val] = code_size;
- if (code_size <= HUFFMAN_HASH_NBITS)
- {
- /*
- * Good: val can be put in the lookup table, so fill all value of this
- * column with value val
- */
- int repeat = 1UL<<(HUFFMAN_HASH_NBITS - code_size);
- code <<= HUFFMAN_HASH_NBITS - code_size;
- while ( repeat-- )
- table->lookup[code++] = val;
-
- }
- else
- {
- /* Perhaps sorting the array will be an optimization */
- uint16_t *slowtable = table->slowtable[code_size-HUFFMAN_HASH_NBITS-1];
- while(slowtable[0])
- slowtable+=2;
- slowtable[0] = code;
- slowtable[1] = val;
- slowtable[2] = 0;
- /* TODO: NEED TO CHECK FOR AN OVERFLOW OF THE TABLE */
- }
-
- }
-}
-
-static void build_default_huffman_tables(struct jdec_private *priv)
-{
- if ( (priv->flags & TINYJPEG_FLAGS_MJPEG_TABLE)
- && priv->default_huffman_table_initialized)
- return;
-
- build_huffman_table(bits_dc_luminance, val_dc_luminance, &priv->HTDC[0]);
- build_huffman_table(bits_ac_luminance, val_ac_luminance, &priv->HTAC[0]);
-
- build_huffman_table(bits_dc_chrominance, val_dc_chrominance, &priv->HTDC[1]);
- build_huffman_table(bits_ac_chrominance, val_ac_chrominance, &priv->HTAC[1]);
-
- priv->default_huffman_table_initialized = 1;
-}
-
-
-
-/*******************************************************************************
- *
- * Colorspace conversion routine
- *
- *
- * Note:
- * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
- * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
- * The conversion equations to be implemented are therefore
- * R = Y + 1.40200 * Cr
- * G = Y - 0.34414 * Cb - 0.71414 * Cr
- * B = Y + 1.77200 * Cb
- *
- ******************************************************************************/
-
-static unsigned char clamp(int i)
-{
- if (i<0)
- return 0;
- else if (i>255)
- return 255;
- else
- return i;
-}
-
-
-/**
- * YCrCb -> YUV420P (1x1)
- * .---.
- * | 1 |
- * `---'
- */
-static void YCrCB_to_YUV420P_1x1(struct jdec_private *priv)
-{
- const unsigned char *s, *y;
- unsigned char *p;
- int i,j;
-
- p = priv->plane[0];
- y = priv->Y;
- for (i=0; i<8; i++)
- {
- memcpy(p, y, 8);
- p+=priv->width;
- y+=8;
- }
-
- p = priv->plane[1];
- s = priv->Cb;
- for (i=0; i<8; i+=2)
- {
- for (j=0; j<8; j+=2, s+=2)
- *p++ = *s;
- s += 8; /* Skip one line */
- p += priv->width/2 - 4;
- }
-
- p = priv->plane[2];
- s = priv->Cr;
- for (i=0; i<8; i+=2)
- {
- for (j=0; j<8; j+=2, s+=2)
- *p++ = *s;
- s += 8; /* Skip one line */
- p += priv->width/2 - 4;
- }
-}
-
-/**
- * YCrCb -> YUV420P (2x1)
- * .-------.
- * | 1 | 2 |
- * `-------'
- */
-static void YCrCB_to_YUV420P_2x1(struct jdec_private *priv)
-{
- unsigned char *p;
- const unsigned char *s, *y1;
- unsigned int i;
-
- p = priv->plane[0];
- y1 = priv->Y;
- for (i=0; i<8; i++)
- {
- memcpy(p, y1, 16);
- p += priv->width;
- y1 += 16;
- }
-
- p = priv->plane[1];
- s = priv->Cb;
- for (i=0; i<8; i+=2)
- {
- memcpy(p, s, 8);
- s += 16; /* Skip one line */
- p += priv->width/2;
- }
-
- p = priv->plane[2];
- s = priv->Cr;
- for (i=0; i<8; i+=2)
- {
- memcpy(p, s, 8);
- s += 16; /* Skip one line */
- p += priv->width/2;
- }
-}
-
-
-/**
- * YCrCb -> YUV420P (1x2)
- * .---.
- * | 1 |
- * |---|
- * | 2 |
- * `---'
- */
-static void YCrCB_to_YUV420P_1x2(struct jdec_private *priv)
-{
- const unsigned char *s, *y;
- unsigned char *p;
- int i,j;
-
- p = priv->plane[0];
- y = priv->Y;
- for (i=0; i<16; i++)
- {
- memcpy(p, y, 8);
- p+=priv->width;
- y+=8;
- }
-
- p = priv->plane[1];
- s = priv->Cb;
- for (i=0; i<8; i++)
- {
- for (j=0; j<8; j+=2, s+=2)
- *p++ = *s;
- p += priv->width/2 - 4;
- }
-
- p = priv->plane[2];
- s = priv->Cr;
- for (i=0; i<8; i++)
- {
- for (j=0; j<8; j+=2, s+=2)
- *p++ = *s;
- p += priv->width/2 - 4;
- }
-}
-
-/**
- * YCrCb -> YUV420P (2x2)
- * .-------.
- * | 1 | 2 |
- * |---+---|
- * | 3 | 4 |
- * `-------'
- */
-static void YCrCB_to_YUV420P_2x2(struct jdec_private *priv)
-{
- unsigned char *p;
- const unsigned char *s, *y1;
- unsigned int i;
-
- p = priv->plane[0];
- y1 = priv->Y;
- for (i=0; i<16; i++)
- {
- memcpy(p, y1, 16);
- p += priv->width;
- y1 += 16;
- }
-
- p = priv->plane[1];
- s = priv->Cb;
- for (i=0; i<8; i++)
- {
- memcpy(p, s, 8);
- s += 8;
- p += priv->width/2;
- }
-
- p = priv->plane[2];
- s = priv->Cr;
- for (i=0; i<8; i++)
- {
- memcpy(p, s, 8);
- s += 8;
- p += priv->width/2;
- }
-}
-
-/**
- * YCrCb -> RGB24 (1x1)
- * .---.
- * | 1 |
- * `---'
- */
-static void YCrCB_to_RGB24_1x1(struct jdec_private *priv)
-{
- const unsigned char *Y, *Cb, *Cr;
- unsigned char *p;
- int i,j;
- int offset_to_next_row;
-
-#define SCALEBITS 10
-#define ONE_HALF (1UL << (SCALEBITS-1))
-#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5))
-
- p = priv->plane[0];
- Y = priv->Y;
- Cb = priv->Cb;
- Cr = priv->Cr;
- offset_to_next_row = priv->width*3 - 8*3;
- for (i=0; i<8; i++) {
-
- for (j=0; j<8; j++) {
-
- int y, cb, cr;
- int add_r, add_g, add_b;
- int r, g , b;
-
- y = (*Y++) << SCALEBITS;
- cb = *Cb++ - 128;
- cr = *Cr++ - 128;
- add_r = FIX(1.40200) * cr + ONE_HALF;
- add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;
- add_b = FIX(1.77200) * cb + ONE_HALF;
-
-
- r = (y + add_r) >> SCALEBITS;
- g = (y + add_g) >> SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
- priv->decomp_block[i][j*3+0]=clamp(r);
- priv->decomp_block[i][j*3+1]=clamp(g);
- priv->decomp_block[i][j*3+2]=clamp(b);
-
- }
-
-// p += offset_to_next_row;
- }
-
-#undef SCALEBITS
-#undef ONE_HALF
-#undef FIX
-
-}
-
-/**
- * YCrCb -> BGR24 (1x1)
- * .---.
- * | 1 |
- * `---'
- */
-static void YCrCB_to_BGR24_1x1(struct jdec_private *priv)
-{
- const unsigned char *Y, *Cb, *Cr;
- unsigned char *p;
- int i,j;
- int offset_to_next_row;
-
-#define SCALEBITS 10
-#define ONE_HALF (1UL << (SCALEBITS-1))
-#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5))
-
- p = priv->plane[0];
- Y = priv->Y;
- Cb = priv->Cb;
- Cr = priv->Cr;
- offset_to_next_row = priv->width*3 - 8*3;
- for (i=0; i<8; i++) {
-
- for (j=0; j<8; j++) {
-
- int y, cb, cr;
- int add_r, add_g, add_b;
- int r, g , b;
-
- y = (*Y++) << SCALEBITS;
- cb = *Cb++ - 128;
- cr = *Cr++ - 128;
- add_r = FIX(1.40200) * cr + ONE_HALF;
- add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;
- add_b = FIX(1.77200) * cb + ONE_HALF;
-
- b = (y + add_b) >> SCALEBITS;
- *p++ = clamp(b);
- g = (y + add_g) >> SCALEBITS;
- *p++ = clamp(g);
- r = (y + add_r) >> SCALEBITS;
- *p++ = clamp(r);
-
- }
-
- p += offset_to_next_row;
- }
-
-#undef SCALEBITS
-#undef ONE_HALF
-#undef FIX
-
-}
-
-
-/**
- * YCrCb -> RGB24 (2x1)
- * .-------.
- * | 1 | 2 |
- * `-------'
- */
-static void YCrCB_to_RGB24_2x1(struct jdec_private *priv)
-{
- const unsigned char *Y, *Cb, *Cr;
- unsigned char *p;
- int i,j;
- int offset_to_next_row;
-
-#define SCALEBITS 10
-#define ONE_HALF (1UL << (SCALEBITS-1))
-#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5))
-
- p = priv->plane[0];
- Y = priv->Y;
- Cb = priv->Cb;
- Cr = priv->Cr;
- offset_to_next_row = priv->width*3 - 16*3;
- for (i=0; i<8; i++) {
-
- for (j=0; j<8; j++) {
-
- int y, cb, cr;
- int add_r, add_g, add_b;
- int r, g , b;
-
- y = (*Y++) << SCALEBITS;
- cb = *Cb++ - 128;
- cr = *Cr++ - 128;
- add_r = FIX(1.40200) * cr + ONE_HALF;
- add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;
- add_b = FIX(1.77200) * cb + ONE_HALF;
-
- r = (y + add_r) >> SCALEBITS;
- g = (y + add_g) >> SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
-
- priv->decomp_block[i][j*6+0]=clamp(r);
- priv->decomp_block[i][j*6+1]=clamp(g);
- priv->decomp_block[i][j*6+2]=clamp(b);
-
- y = (*Y++) << SCALEBITS;
-
- r = (y + add_r) >> SCALEBITS;
- g = (y + add_g) >> SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
-
- priv->decomp_block[i][j*6+3]=clamp(r);
- priv->decomp_block[i][j*6+4]=clamp(g);
- priv->decomp_block[i][j*6+5]=clamp(b);
-
- }
-
- p += offset_to_next_row;
- }
-
-#undef SCALEBITS
-#undef ONE_HALF
-#undef FIX
-
-}
-
-/*
- * YCrCb -> BGR24 (2x1)
- * .-------.
- * | 1 | 2 |
- * `-------'
- */
-static void YCrCB_to_BGR24_2x1(struct jdec_private *priv)
-{
- const unsigned char *Y, *Cb, *Cr;
- unsigned char *p;
- int i,j;
- int offset_to_next_row;
-
-#define SCALEBITS 10
-#define ONE_HALF (1UL << (SCALEBITS-1))
-#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5))
-
- p = priv->plane[0];
- Y = priv->Y;
- Cb = priv->Cb;
- Cr = priv->Cr;
- offset_to_next_row = priv->width*3 - 16*3;
- for (i=0; i<8; i++) {
-
- for (j=0; j<8; j++) {
-
- int y, cb, cr;
- int add_r, add_g, add_b;
- int r, g , b;
-
- cb = *Cb++ - 128;
- cr = *Cr++ - 128;
- add_r = FIX(1.40200) * cr + ONE_HALF;
- add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;
- add_b = FIX(1.77200) * cb + ONE_HALF;
-
- y = (*Y++) << SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
- *p++ = clamp(b);
- g = (y + add_g) >> SCALEBITS;
- *p++ = clamp(g);
- r = (y + add_r) >> SCALEBITS;
- *p++ = clamp(r);
-
- y = (*Y++) << SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
- *p++ = clamp(b);
- g = (y + add_g) >> SCALEBITS;
- *p++ = clamp(g);
- r = (y + add_r) >> SCALEBITS;
- *p++ = clamp(r);
-
- }
-
- p += offset_to_next_row;
- }
-
-#undef SCALEBITS
-#undef ONE_HALF
-#undef FIX
-
-}
-
-/**
- * YCrCb -> RGB24 (1x2)
- * .---.
- * | 1 |
- * |---|
- * | 2 |
- * `---'
- */
-static void YCrCB_to_RGB24_1x2(struct jdec_private *priv)
-{
- const unsigned char *Y, *Cb, *Cr;
- unsigned char *p, *p2;
- int i,j;
- int offset_to_next_row;
-
-#define SCALEBITS 10
-#define ONE_HALF (1UL << (SCALEBITS-1))
-#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5))
-
- p = priv->plane[0];
- p2 = priv->plane[0] + priv->width*3;
- Y = priv->Y;
- Cb = priv->Cb;
- Cr = priv->Cr;
- offset_to_next_row = 2*priv->width*3 - 8*3;
- for (i=0; i<8; i++) {
-
- for (j=0; j<8; j++) {
-
- int y, cb, cr;
- int add_r, add_g, add_b;
- int r, g , b;
-
- cb = *Cb++ - 128;
- cr = *Cr++ - 128;
- add_r = FIX(1.40200) * cr + ONE_HALF;
- add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;
- add_b = FIX(1.77200) * cb + ONE_HALF;
-
- y = (*Y++) << SCALEBITS;
- r = (y + add_r) >> SCALEBITS;
- g = (y + add_g) >> SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
-
- priv->decomp_block[i*2][j*3+0]=clamp(r);
- priv->decomp_block[i*2][j*3+1]=clamp(g);
- priv->decomp_block[i*2][j*3+2]=clamp(b);
-
- y = (Y[8-1]) << SCALEBITS;
- r = (y + add_r) >> SCALEBITS;
- g = (y + add_g) >> SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
-
- priv->decomp_block[i*2+1][j*3+0]=clamp(r);
- priv->decomp_block[i*2+1][j*3+1]=clamp(g);
- priv->decomp_block[i*2+1][j*3+2]=clamp(b);
-
- }
- Y += 8;
- p += offset_to_next_row;
- p2 += offset_to_next_row;
- }
-
-#undef SCALEBITS
-#undef ONE_HALF
-#undef FIX
-
-}
-
-/*
- * YCrCb -> BGR24 (1x2)
- * .---.
- * | 1 |
- * |---|
- * | 2 |
- * `---'
- */
-static void YCrCB_to_BGR24_1x2(struct jdec_private *priv)
-{
- const unsigned char *Y, *Cb, *Cr;
- unsigned char *p, *p2;
- int i,j;
- int offset_to_next_row;
-
-#define SCALEBITS 10
-#define ONE_HALF (1UL << (SCALEBITS-1))
-#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5))
-
- p = priv->plane[0];
- p2 = priv->plane[0] + priv->width*3;
- Y = priv->Y;
- Cb = priv->Cb;
- Cr = priv->Cr;
- offset_to_next_row = 2*priv->width*3 - 8*3;
- for (i=0; i<8; i++) {
-
- for (j=0; j<8; j++) {
-
- int y, cb, cr;
- int add_r, add_g, add_b;
- int r, g , b;
-
- cb = *Cb++ - 128;
- cr = *Cr++ - 128;
- add_r = FIX(1.40200) * cr + ONE_HALF;
- add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;
- add_b = FIX(1.77200) * cb + ONE_HALF;
-
- y = (*Y++) << SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
- *p++ = clamp(b);
- g = (y + add_g) >> SCALEBITS;
- *p++ = clamp(g);
- r = (y + add_r) >> SCALEBITS;
- *p++ = clamp(r);
-
- y = (Y[8-1]) << SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
- *p2++ = clamp(b);
- g = (y + add_g) >> SCALEBITS;
- *p2++ = clamp(g);
- r = (y + add_r) >> SCALEBITS;
- *p2++ = clamp(r);
-
- }
- Y += 8;
- p += offset_to_next_row;
- p2 += offset_to_next_row;
- }
-
-#undef SCALEBITS
-#undef ONE_HALF
-#undef FIX
-
-}
-
-
-/**
- * YCrCb -> RGB24 (2x2)
- * .-------.
- * | 1 | 2 |
- * |---+---|
- * | 3 | 4 |
- * `-------'
- */
-static void YCrCB_to_RGB24_2x2(struct jdec_private *priv)
-{
- const unsigned char *Y, *Cb, *Cr;
- unsigned char *p, *p2;
- int i,j;
- int offset_to_next_row;
-
-#define SCALEBITS 10
-#define ONE_HALF (1UL << (SCALEBITS-1))
-#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5))
-
- p = priv->plane[0];
- p2 = priv->plane[0] + priv->width*3;
- Y = priv->Y;
- Cb = priv->Cb;
- Cr = priv->Cr;
- offset_to_next_row = (priv->width*3*2) - 16*3;
- for (i=0; i<8; i++) {
-
- for (j=0; j<8; j++) {
-
- int y, cb, cr;
- int add_r, add_g, add_b;
- int r, g , b;
-
- cb = *Cb++ - 128;
- cr = *Cr++ - 128;
- add_r = FIX(1.40200) * cr + ONE_HALF;
- add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;
- add_b = FIX(1.77200) * cb + ONE_HALF;
-
- y = (*Y++) << SCALEBITS;
- r = (y + add_r) >> SCALEBITS;
- g = (y + add_g) >> SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
-
- priv->decomp_block[i*2][j*6+0]=clamp(r);
- priv->decomp_block[i*2][j*6+1]=clamp(g);
- priv->decomp_block[i*2][j*6+2]=clamp(b);
-
- y = (*Y++) << SCALEBITS;
- r = (y + add_r) >> SCALEBITS;
- g = (y + add_g) >> SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
-
- priv->decomp_block[i*2][j*6+3]=clamp(r);
- priv->decomp_block[i*2][j*6+4]=clamp(g);
- priv->decomp_block[i*2][j*6+5]=clamp(b);
-
- y = (Y[16-2]) << SCALEBITS;
- r = (y + add_r) >> SCALEBITS;
- g = (y + add_g) >> SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
-
- priv->decomp_block[i*2+1][j*6+0]=clamp(r);
- priv->decomp_block[i*2+1][j*6+1]=clamp(g);
- priv->decomp_block[i*2+1][j*6+2]=clamp(b);
-
- y = (Y[16-1]) << SCALEBITS;
- r = (y + add_r) >> SCALEBITS;
- g = (y + add_g) >> SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
-
- priv->decomp_block[i*2+1][j*6+3]=clamp(r);
- priv->decomp_block[i*2+1][j*6+4]=clamp(g);
- priv->decomp_block[i*2+1][j*6+5]=clamp(b);
-
- }
- Y += 16;
- p += offset_to_next_row;
- p2 += offset_to_next_row;
- }
-
-#undef SCALEBITS
-#undef ONE_HALF
-#undef FIX
-
-}
-
-
-/*
- * YCrCb -> BGR24 (2x2)
- * .-------.
- * | 1 | 2 |
- * |---+---|
- * | 3 | 4 |
- * `-------'
- */
-static void YCrCB_to_BGR24_2x2(struct jdec_private *priv)
-{
- const unsigned char *Y, *Cb, *Cr;
- unsigned char *p, *p2;
- int i,j;
- int offset_to_next_row;
-
-#define SCALEBITS 10
-#define ONE_HALF (1UL << (SCALEBITS-1))
-#define FIX(x) ((int)((x) * (1UL<<SCALEBITS) + 0.5))
-
- p = priv->plane[0];
- p2 = priv->plane[0] + priv->width*3;
- Y = priv->Y;
- Cb = priv->Cb;
- Cr = priv->Cr;
- offset_to_next_row = (priv->width*3*2) - 16*3;
- for (i=0; i<8; i++) {
-
- for (j=0; j<8; j++) {
-
- int y, cb, cr;
- int add_r, add_g, add_b;
- int r, g , b;
-
- cb = *Cb++ - 128;
- cr = *Cr++ - 128;
- add_r = FIX(1.40200) * cr + ONE_HALF;
- add_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;
- add_b = FIX(1.77200) * cb + ONE_HALF;
-
- y = (*Y++) << SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
- *p++ = clamp(b);
- g = (y + add_g) >> SCALEBITS;
- *p++ = clamp(g);
- r = (y + add_r) >> SCALEBITS;
- *p++ = clamp(r);
-
- y = (*Y++) << SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
- *p++ = clamp(b);
- g = (y + add_g) >> SCALEBITS;
- *p++ = clamp(g);
- r = (y + add_r) >> SCALEBITS;
- *p++ = clamp(r);
-
- y = (Y[16-2]) << SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
- *p2++ = clamp(b);
- g = (y + add_g) >> SCALEBITS;
- *p2++ = clamp(g);
- r = (y + add_r) >> SCALEBITS;
- *p2++ = clamp(r);
-
- y = (Y[16-1]) << SCALEBITS;
- b = (y + add_b) >> SCALEBITS;
- *p2++ = clamp(b);
- g = (y + add_g) >> SCALEBITS;
- *p2++ = clamp(g);
- r = (y + add_r) >> SCALEBITS;
- *p2++ = clamp(r);
- }
- Y += 16;
- p += offset_to_next_row;
- p2 += offset_to_next_row;
- }
-
-#undef SCALEBITS
-#undef ONE_HALF
-#undef FIX
-
-}
-
-
-
-/**
- * YCrCb -> Grey (1x1)
- * .---.
- * | 1 |
- * `---'
- */
-static void YCrCB_to_Grey_1x1(struct jdec_private *priv)
-{
- const unsigned char *y;
- unsigned char *p;
- unsigned int i;
- int offset_to_next_row;
-
- p = priv->plane[0];
- y = priv->Y;
- offset_to_next_row = priv->width;
-
- for (i=0; i<8; i++) {
- memcpy(p, y, 8);
- y+=8;
- p += offset_to_next_row;
- }
-}
-
-/**
- * YCrCb -> Grey (2x1)
- * .-------.
- * | 1 | 2 |
- * `-------'
- */
-static void YCrCB_to_Grey_2x1(struct jdec_private *priv)
-{
- const unsigned char *y;
- unsigned char *p;
- unsigned int i;
-
- p = priv->plane[0];
- y = priv->Y;
-
- for (i=0; i<8; i++) {
- memcpy(p, y, 16);
- y += 16;
- p += priv->width;
- }
-}
-
-
-/**
- * YCrCb -> Grey (1x2)
- * .---.
- * | 1 |
- * |---|
- * | 2 |
- * `---'
- */
-static void YCrCB_to_Grey_1x2(struct jdec_private *priv)
-{
- const unsigned char *y;
- unsigned char *p;
- unsigned int i;
-
- p = priv->plane[0];
- y = priv->Y;
-
- for (i=0; i<16; i++) {
- memcpy(p, y, 8);
- y += 8;
- p += priv->width;
- }
-}
-
-/**
- * YCrCb -> Grey (2x2)
- * .-------.
- * | 1 | 2 |
- * |---+---|
- * | 3 | 4 |
- * `-------'
- */
-static void YCrCB_to_Grey_2x2(struct jdec_private *priv)
-{
- const unsigned char *y;
- unsigned char *p;
- unsigned int i;
-
- p = priv->plane[0];
- y = priv->Y;
-
- for (i=0; i<16; i++) {
- memcpy(p, y, 16);
- y += 16;
- p += priv->width;
- }
-}
-
-
-/*
- * Decode all the 3 components for 1x1
- */
-static void decode_MCU_1x1_3planes(struct jdec_private *priv)
-{
- // Y
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y, 8);
-
- // Cb
- process_Huffman_data_unit(priv, cCb);
- IDCT(&priv->component_infos[cCb], priv->Cb, 8);
-
- // Cr
- process_Huffman_data_unit(priv, cCr);
- IDCT(&priv->component_infos[cCr], priv->Cr, 8);
-}
-
-/*
- * Decode a 1x1 directly in 1 color
- */
-static void decode_MCU_1x1_1plane(struct jdec_private *priv)
-{
- // Y
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y, 8);
-
- // Cb
- process_Huffman_data_unit(priv, cCb);
- IDCT(&priv->component_infos[cCb], priv->Cb, 8);
-
- // Cr
- process_Huffman_data_unit(priv, cCr);
- IDCT(&priv->component_infos[cCr], priv->Cr, 8);
-}
-
-
-/*
- * Decode a 2x1
- * .-------.
- * | 1 | 2 |
- * `-------'
- */
-static void decode_MCU_2x1_3planes(struct jdec_private *priv)
-{
- // Y
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y, 16);
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y+8, 16);
-
- // Cb
- process_Huffman_data_unit(priv, cCb);
- IDCT(&priv->component_infos[cCb], priv->Cb, 8);
-
- // Cr
- process_Huffman_data_unit(priv, cCr);
- IDCT(&priv->component_infos[cCr], priv->Cr, 8);
-}
-
-/*
- * Decode a 2x1
- * .-------.
- * | 1 | 2 |
- * `-------'
- */
-static void decode_MCU_2x1_1plane(struct jdec_private *priv)
-{
- // Y
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y, 16);
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y+8, 16);
-
- // Cb
- process_Huffman_data_unit(priv, cCb);
-
- // Cr
- process_Huffman_data_unit(priv, cCr);
-}
-
-
-/*
- * Decode a 2x2
- * .-------.
- * | 1 | 2 |
- * |---+---|
- * | 3 | 4 |
- * `-------'
- */
-static void decode_MCU_2x2_3planes(struct jdec_private *priv)
-{
- // Y
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y, 16);
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y+8, 16);
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y+64*2, 16);
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y+64*2+8, 16);
-
- // Cb
- process_Huffman_data_unit(priv, cCb);
- IDCT(&priv->component_infos[cCb], priv->Cb, 8);
-
- // Cr
- process_Huffman_data_unit(priv, cCr);
- IDCT(&priv->component_infos[cCr], priv->Cr, 8);
-}
-
-/*
- * Decode a 2x2 directly in GREY format (8bits)
- * .-------.
- * | 1 | 2 |
- * |---+---|
- * | 3 | 4 |
- * `-------'
- */
-static void decode_MCU_2x2_1plane(struct jdec_private *priv)
-{
- // Y
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y, 16);
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y+8, 16);
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y+64*2, 16);
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y+64*2+8, 16);
-
- // Cb
- process_Huffman_data_unit(priv, cCb);
-
- // Cr
- process_Huffman_data_unit(priv, cCr);
-}
-
-/*
- * Decode a 1x2 mcu
- * .---.
- * | 1 |
- * |---|
- * | 2 |
- * `---'
- */
-static void decode_MCU_1x2_3planes(struct jdec_private *priv)
-{
- // Y
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y, 8);
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y+64, 8);
-
- // Cb
- process_Huffman_data_unit(priv, cCb);
- IDCT(&priv->component_infos[cCb], priv->Cb, 8);
-
- // Cr
- process_Huffman_data_unit(priv, cCr);
- IDCT(&priv->component_infos[cCr], priv->Cr, 8);
-}
-
-/*
- * Decode a 1x2 mcu
- * .---.
- * | 1 |
- * |---|
- * | 2 |
- * `---'
- */
-static void decode_MCU_1x2_1plane(struct jdec_private *priv)
-{
- // Y
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y, 8);
- process_Huffman_data_unit(priv, cY);
- IDCT(&priv->component_infos[cY], priv->Y+64, 8);
-
- // Cb
- process_Huffman_data_unit(priv, cCb);
-
- // Cr
- process_Huffman_data_unit(priv, cCr);
-}
-
-static void print_SOF(const unsigned char *stream)
-{
- int width, height, nr_components, precision;
-#if DEBUG
- const char *nr_components_to_string[] = {
- "????",
- "Grayscale",
- "????",
- "YCbCr",
- "CYMK"
- };
-#endif
-
- precision = stream[2];
- height = be16_to_cpu(stream+3);
- width = be16_to_cpu(stream+5);
- nr_components = stream[7];
-
- trace("> SOF marker\n");
- trace("Size:%dx%d nr_components:%d (%s) precision:%d\n",
- width, height,
- nr_components, nr_components_to_string[nr_components],
- precision);
-}
-
-/*******************************************************************************
- *
- * JPEG/JFIF Parsing functions
- *
- * Note: only a small subset of the jpeg file format is supported. No markers,
- * nor progressive stream is supported.
- *
- ******************************************************************************/
-
-static void build_quantization_table(float *qtable, const unsigned char *ref_table)
-{
- /* Taken from libjpeg. Copyright Independent JPEG Group's LLM idct.
- * For float AA&N IDCT method, divisors are equal to quantization
- * coefficients scaled by scalefactor[row]*scalefactor[col], where
- * scalefactor[0] = 1
- * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
- * We apply a further scale factor of 8.
- * What's actually stored is 1/divisor so that the inner loop can
- * use a multiplication rather than a division.
- */
- int i, j;
- static const double aanscalefactor[8] = {
- 1.0, 1.387039845, 1.306562965, 1.175875602,
- 1.0, 0.785694958, 0.541196100, 0.275899379
- };
- const unsigned char *zz = zigzag;
-
- for (i=0; i<8; i++) {
- for (j=0; j<8; j++) {
- *qtable++ = ref_table[*zz++] * aanscalefactor[i] * aanscalefactor[j];
- }
- }
-
-}
-
-static int parse_DQT(struct jdec_private *priv, const unsigned char *stream)
-{
- int qi;
- float *table;
- const unsigned char *dqt_block_end;
-
- trace("> DQT marker\n");
- dqt_block_end = stream + be16_to_cpu(stream);
- stream += 2; /* Skip length */
-
- while (stream < dqt_block_end)
- {
- qi = *stream++;
-#if SANITY_CHECK
- if (qi>>4)
- error("16 bits quantization table is not supported\n");
- if (qi>4)
- error("No more 4 quantization table is supported (got %d)\n", qi);
-#endif
- table = priv->Q_tables[qi];
- build_quantization_table(table, stream);
- stream += 64;
- }
- trace("< DQT marker\n");
- return 0;
-}
-
-static int parse_SOF(struct jdec_private *priv, const unsigned char *stream)
-{
- int i, width, height, nr_components, cid, sampling_factor;
- int Q_table;
- struct component *c;
-
- trace("> SOF marker\n");
- print_SOF(stream);
-
- height = be16_to_cpu(stream+3);
- width = be16_to_cpu(stream+5);
- nr_components = stream[7];
-#if SANITY_CHECK
- if (stream[2] != 8)
- error("Precision other than 8 is not supported\n");
- if (width>JPEG_MAX_WIDTH || height>JPEG_MAX_HEIGHT)
- error("Width and Height (%dx%d) seems suspicious\n", width, height);
- if (nr_components != 3)
- error("We only support YUV images\n");
- //if (height%16)
-// error("Height need to be a multiple of 16 (current height is %d)\n", height);
-// if (width%16)
- // error("Width need to be a multiple of 16 (current Width is %d)\n", width);
-#endif
- stream += 8;
- for (i=0; i<nr_components; i++) {
- cid = *stream++;
- sampling_factor = *stream++;
- Q_table = *stream++;
- c = &priv->component_infos[i];
-#if SANITY_CHECK
- c->cid = cid;
- if (Q_table >= COMPONENTS)
- error("Bad Quantization table index (got %d, max allowed %d)\n", Q_table, COMPONENTS-1);
-#endif
- c->Vfactor = sampling_factor&0xf;
- c->Hfactor = sampling_factor>>4;
- c->Q_table = priv->Q_tables[Q_table];
- trace("Component:%d factor:%dx%d Quantization table:%d\n",
- cid, c->Hfactor, c->Hfactor, Q_table );
-
- }
- priv->width = width;
- priv->height = height;
-
- trace("< SOF marker\n");
-
- return 0;
-}
-
-static int parse_SOS(struct jdec_private *priv, const unsigned char *stream)
-{
- unsigned int i, cid, table;
- unsigned int nr_components = stream[2];
-
- trace("> SOS marker\n");
-
-#if SANITY_CHECK
- if (nr_components != 3)
- error("We only support YCbCr image\n");
-#endif
-
- stream += 3;
- for (i=0;i<nr_components;i++) {
- cid = *stream++;
- table = *stream++;
-#if SANITY_CHECK
- if ((table&0xf)>=4)
- error("We do not support more than 2 AC Huffman table\n");
- if ((table>>4)>=4)
- error("We do not support more than 2 DC Huffman table\n");
- if (cid != priv->component_infos[i].cid)
- error("SOS cid order (%d:%d) isn't compatible with the SOF marker (%d:%d)\n",
- i, cid, i, priv->component_infos[i].cid);
- trace("ComponentId:%d tableAC:%d tableDC:%d\n", cid, table&0xf, table>>4);
-#endif
- priv->component_infos[i].AC_table = &priv->HTAC[table&0xf];
- priv->component_infos[i].DC_table = &priv->HTDC[table>>4];
- }
- priv->stream = stream+3;
- trace("< SOS marker\n");
- return 0;
-}
-
-static int parse_DHT(struct jdec_private *priv, const unsigned char *stream)
-{
- unsigned int count, i;
- unsigned char huff_bits[17];
- int length, index;
-
- length = be16_to_cpu(stream) - 2;
- stream += 2; /* Skip length */
-
- trace("> DHT marker (length=%d)\n", length);
-
- while (length>0) {
- index = *stream++;
-
- /* We need to calculate the number of bytes 'vals' will takes */
- huff_bits[0] = 0;
- count = 0;
- for (i=1; i<17; i++) {
- huff_bits[i] = *stream++;
- count += huff_bits[i];
- }
-#if SANITY_CHECK
- if (count >= HUFFMAN_BITS_SIZE)
- error("No more than %d bytes is allowed to describe a huffman table", HUFFMAN_BITS_SIZE);
- if ( (index &0xf) >= HUFFMAN_TABLES)
- error("No more than %d Huffman tables is supported (got %d)\n", HUFFMAN_TABLES, index&0xf);
- trace("Huffman table %s[%d] length=%d\n", (index&0xf0)?"AC":"DC", index&0xf, count);
-#endif
-
- if (index & 0xf0 )
- build_huffman_table(huff_bits, stream, &priv->HTAC[index&0xf]);
- else
- build_huffman_table(huff_bits, stream, &priv->HTDC[index&0xf]);
-
- length -= 1;
- length -= 16;
- length -= count;
- stream += count;
- }
- trace("< DHT marker\n");
- return 0;
-}
-
-static int parse_DRI(struct jdec_private *priv, const unsigned char *stream)
-{
- unsigned int length;
-
- trace("> DRI marker\n");
-
- length = be16_to_cpu(stream);
-
-#if SANITY_CHECK
- if (length != 4)
- error("Length of DRI marker need to be 4\n");
-#endif
-
- priv->restart_interval = be16_to_cpu(stream+2);
-
-#if DEBUG
- trace("Restart interval = %d\n", priv->restart_interval);
-#endif
-
- trace("< DRI marker\n");
-
- return 0;
-}
-
-
-
-static void resync(struct jdec_private *priv)
-{
- int i;
-
- /* Init DC coefficients */
- for (i=0; i<COMPONENTS; i++)
- priv->component_infos[i].previous_DC = 0;
-
- priv->reservoir = 0;
- priv->nbits_in_reservoir = 0;
- if (priv->restart_interval > 0)
- priv->restarts_to_go = priv->restart_interval;
- else
- priv->restarts_to_go = -1;
-}
-
-static int find_next_rst_marker(struct jdec_private *priv)
-{
- int rst_marker_found = 0;
- int marker;
- const unsigned char *stream = priv->stream;
-
- /* Parse marker */
- while (!rst_marker_found)
- {
- while (*stream++ != 0xff)
- {
- if (stream >= priv->stream_end)
- error("EOF while search for a RST marker.");
- }
- /* Skip any padding ff byte (this is normal) */
- while (*stream == 0xff)
- stream++;
-
- marker = *stream++;
- if ((RST+priv->last_rst_marker_seen) == marker)
- rst_marker_found = 1;
- else if (marker >= RST && marker <= RST7)
- error("Wrong Reset marker found, abording");
- else if (marker == EOI)
- return 0;
- }
- trace("RST Marker %d found at offset %d\n", priv->last_rst_marker_seen, stream - priv->stream_begin);
-
- priv->stream = stream;
- priv->last_rst_marker_seen++;
- priv->last_rst_marker_seen &= 7;
-
- return 0;
-}
-
-static int parse_JFIF(struct jdec_private *priv, const unsigned char *stream)
-{
- int chuck_len;
- int marker;
- int sos_marker_found = 0;
- int dht_marker_found = 0;
- const unsigned char *next_chunck;
-
- /* Parse marker */
- while (!sos_marker_found)
- {
- if (*stream++ != 0xff)
- goto bogus_jpeg_format;
- /* Skip any padding ff byte (this is normal) */
- while (*stream == 0xff)
- stream++;
-
- marker = *stream++;
- chuck_len = be16_to_cpu(stream);
- next_chunck = stream + chuck_len;
- switch (marker)
- {
- case SOF:
- if (parse_SOF(priv, stream) < 0)
- return -1;
- break;
- case DQT:
- if (parse_DQT(priv, stream) < 0)
- return -1;
- break;
- case SOS:
- if (parse_SOS(priv, stream) < 0)
- return -1;
- sos_marker_found = 1;
- break;
- case DHT:
- if (parse_DHT(priv, stream) < 0)
- return -1;
- dht_marker_found = 1;
- break;
- case DRI:
- if (parse_DRI(priv, stream) < 0)
- return -1;
- break;
- default:
- trace("> Unknown marker %2.2x\n", marker);
- break;
- }
-
- stream = next_chunck;
- }
-
- if (!dht_marker_found) {
- trace("No Huffman table loaded, using the default one\n");
- build_default_huffman_tables(priv);
- }
-
-#ifdef SANITY_CHECK
- if ( (priv->component_infos[cY].Hfactor < priv->component_infos[cCb].Hfactor)
- || (priv->component_infos[cY].Hfactor < priv->component_infos[cCr].Hfactor))
- error("Horizontal sampling factor for Y should be greater than horitontal sampling factor for Cb or Cr\n");
- if ( (priv->component_infos[cY].Vfactor < priv->component_infos[cCb].Vfactor)
- || (priv->component_infos[cY].Vfactor < priv->component_infos[cCr].Vfactor))
- error("Vertical sampling factor for Y should be greater than vertical sampling factor for Cb or Cr\n");
- if ( (priv->component_infos[cCb].Hfactor!=1)
- || (priv->component_infos[cCr].Hfactor!=1)
- || (priv->component_infos[cCb].Vfactor!=1)
- || (priv->component_infos[cCr].Vfactor!=1))
- error("Sampling other than 1x1 for Cr and Cb is not supported");
-#endif
-
- return 0;
-bogus_jpeg_format:
- trace("Bogus jpeg format\n");
- return -1;
-}
-
-/*******************************************************************************
- *
- * Functions exported of the library.
- *
- * Note: Some applications can access directly to internal pointer of the
- * structure. It's is not recommended, but if you have many images to
- * uncompress with the same parameters, some functions can be called to speedup
- * the decoding.
- *
- ******************************************************************************/
-
-/**
- * Allocate a new tinyjpeg decoder object.
- *
- * Before calling any other functions, an object need to be called.
- */
-struct jdec_private *tinyjpeg_init(void *(*allocate_mem)(unsigned int),void (*free_mem)(void *))
-{
- struct jdec_private *priv;
- unsigned int i;
-
- priv = (struct jdec_private *)allocate_mem(sizeof(struct jdec_private));
- for(i=0;i<sizeof(struct jdec_private);i++) {
- char *pzero = (char*)priv;
- pzero[i]=0;
- }
- priv->allocate_mem=allocate_mem;
- priv->free_mem=free_mem;
- if (priv == NULL)
- return NULL;
- return priv;
-}
-
-/**
- * Free a tinyjpeg object.
- *
- * No others function can be called after this one.
- */
-void tinyjpeg_free(struct jdec_private *priv)
-{
- int i;
- for (i=0; i<COMPONENTS; i++) {
- if (priv->components[i]) {
- // priv->free_mem(priv->components[i]);
- priv->components[i] = NULL;
- }
- }
- priv->free_mem(priv);
-}
-
-/**
- * Initialize the tinyjpeg object and prepare the decoding of the stream.
- *
- * Check if the jpeg can be decoded with this jpeg decoder.
- * Fill some table used for preprocessing.
- */
-int tinyjpeg_parse_header(struct jdec_private *priv, const unsigned char *buf, unsigned int size)
-{
- int ret;
-
- /* Identify the file */
- if ((buf[0] != 0xFF) || (buf[1] != SOI))
- error("Not a JPG file ?\n");
-
- priv->stream_begin = buf+2;
- priv->stream_length = size-2;
- priv->stream_end = priv->stream_begin + priv->stream_length;
-
- ret = parse_JFIF(priv, priv->stream_begin);
-
- return ret;
-}
-
-static const decode_MCU_fct decode_mcu_3comp_table[4] = {
- decode_MCU_1x1_3planes,
- decode_MCU_1x2_3planes,
- decode_MCU_2x1_3planes,
- decode_MCU_2x2_3planes,
-};
-
-static const decode_MCU_fct decode_mcu_1comp_table[4] = {
- decode_MCU_1x1_1plane,
- decode_MCU_1x2_1plane,
- decode_MCU_2x1_1plane,
- decode_MCU_2x2_1plane,
-};
-
-static const convert_colorspace_fct convert_colorspace_yuv420p[4] = {
- YCrCB_to_YUV420P_1x1,
- YCrCB_to_YUV420P_1x2,
- YCrCB_to_YUV420P_2x1,
- YCrCB_to_YUV420P_2x2,
-};
-
-static const convert_colorspace_fct convert_colorspace_rgb24[4] = {
- YCrCB_to_RGB24_1x1,
- YCrCB_to_RGB24_1x2,
- YCrCB_to_RGB24_2x1,
- YCrCB_to_RGB24_2x2,
-};
-
-static const convert_colorspace_fct convert_colorspace_bgr24[4] = {
- YCrCB_to_BGR24_1x1,
- YCrCB_to_BGR24_1x2,
- YCrCB_to_BGR24_2x1,
- YCrCB_to_BGR24_2x2,
-};
-
-static const convert_colorspace_fct convert_colorspace_grey[4] = {
- YCrCB_to_Grey_1x1,
- YCrCB_to_Grey_1x2,
- YCrCB_to_Grey_2x1,
- YCrCB_to_Grey_2x2,
-};
-
-/**
- * Decode and convert the jpeg image into @pixfmt@ image
- *
- * Note: components will be automaticaly allocated if no memory is attached.
- */
-int tinyjpeg_decode(struct jdec_private *priv, int pixfmt)
-{
- unsigned int x, y, xstride_by_mcu, ystride_by_mcu;
- unsigned int bytes_per_blocklines[3], bytes_per_mcu[3];
- decode_MCU_fct decode_MCU;
- const decode_MCU_fct *decode_mcu_table;
- const convert_colorspace_fct *colorspace_array_conv;
- convert_colorspace_fct convert_to_pixfmt;
-
- if (pixfmt!=TINYJPEG_FMT_RGB24)
- error("Only TINYJPEG_FMT_RGB24 is supported in this version");
-
- if (setjmp(priv->jump_state))
- return -1;
-
- /* To keep gcc happy initialize some array */
- bytes_per_mcu[1] = 0;
- bytes_per_mcu[2] = 0;
- bytes_per_blocklines[1] = 0;
- bytes_per_blocklines[2] = 0;
-
- decode_mcu_table = decode_mcu_3comp_table;
- switch (pixfmt) {
- case TINYJPEG_FMT_YUV420P:
- colorspace_array_conv = convert_colorspace_yuv420p;
- if (priv->components[0] == NULL)
- priv->components[0] = (uint8_t *)priv->allocate_mem(priv->width * priv->height);
- if (priv->components[1] == NULL)
- priv->components[1] = (uint8_t *)priv->allocate_mem(priv->width * priv->height/4);
- if (priv->components[2] == NULL)
- priv->components[2] = (uint8_t *)priv->allocate_mem(priv->width * priv->height/4);
- bytes_per_blocklines[0] = priv->width;
- bytes_per_blocklines[1] = priv->width/4;
- bytes_per_blocklines[2] = priv->width/4;
- bytes_per_mcu[0] = 8;
- bytes_per_mcu[1] = 4;
- bytes_per_mcu[2] = 4;
- break;
-
- case TINYJPEG_FMT_RGB24:
- colorspace_array_conv = convert_colorspace_rgb24;
- if (priv->components[0] == NULL)
- priv->components[0] = (uint8_t *)priv->allocate_mem(priv->width * priv->height * 3);
- bytes_per_blocklines[0] = priv->width * 3;
- bytes_per_mcu[0] = 3*8;
- break;
-
- case TINYJPEG_FMT_BGR24:
- colorspace_array_conv = convert_colorspace_bgr24;
- if (priv->components[0] == NULL)
- priv->components[0] = (uint8_t *)priv->allocate_mem(priv->width * priv->height * 3);
- bytes_per_blocklines[0] = priv->width * 3;
- bytes_per_mcu[0] = 3*8;
- break;
-
- case TINYJPEG_FMT_GREY:
- decode_mcu_table = decode_mcu_1comp_table;
- colorspace_array_conv = convert_colorspace_grey;
- if (priv->components[0] == NULL)
- priv->components[0] = (uint8_t *)priv->allocate_mem(priv->width * priv->height);
- bytes_per_blocklines[0] = priv->width;
- bytes_per_mcu[0] = 8;
- break;
-
- default:
- trace("Bad pixel format\n");
- return -1;
- }
-
- xstride_by_mcu = ystride_by_mcu = 8;
- if ((priv->component_infos[cY].Hfactor | priv->component_infos[cY].Vfactor) == 1) {
- decode_MCU = decode_mcu_table[0];
- convert_to_pixfmt = colorspace_array_conv[0];
- trace("Use decode 1x1 sampling\n");
- } else if (priv->component_infos[cY].Hfactor == 1) {
- decode_MCU = decode_mcu_table[1];
- convert_to_pixfmt = colorspace_array_conv[1];
- ystride_by_mcu = 16;
- trace("Use decode 1x2 sampling (not supported)\n");
- } else if (priv->component_infos[cY].Vfactor == 2) {
- decode_MCU = decode_mcu_table[3];
- convert_to_pixfmt = colorspace_array_conv[3];
- xstride_by_mcu = 16;
- ystride_by_mcu = 16;
- trace("Use decode 2x2 sampling\n");
- } else {
- decode_MCU = decode_mcu_table[2];
- convert_to_pixfmt = colorspace_array_conv[2];
- xstride_by_mcu = 16;
- trace("Use decode 2x1 sampling\n");
- }
-
- resync(priv);
-
- /* Don't forget to that block can be either 8 or 16 lines */
- bytes_per_blocklines[0] *= ystride_by_mcu;
- bytes_per_blocklines[1] *= ystride_by_mcu;
- bytes_per_blocklines[2] *= ystride_by_mcu;
-
- bytes_per_mcu[0] *= xstride_by_mcu/8;
- bytes_per_mcu[1] *= xstride_by_mcu/8;
- bytes_per_mcu[2] *= xstride_by_mcu/8;
-
- /* Just the decode the image by macroblock (size is 8x8, 8x16, or 16x16) */
-
-
-
- for (y=0; y < priv->height; y+=ystride_by_mcu)
- {
- //trace("Decoding row %d\n", y);
- /// priv->plane[0] = priv->components[0] + (y/ystride_by_mcu * bytes_per_blocklines[0]);
- /// priv->plane[1] = priv->components[1] + (y/ystride_by_mcu * bytes_per_blocklines[1]);
- /// priv->plane[2] = priv->components[2] + (y/ystride_by_mcu * bytes_per_blocklines[2]);
- for (x=0; x < priv->width; x+=xstride_by_mcu)
- {
- int i,copy_x,copy_y;
- decode_MCU(priv);
- convert_to_pixfmt(priv);
- //priv->plane[0] += bytes_per_mcu[0];
- //priv->plane[1] += bytes_per_mcu[1];
- //priv->plane[2] += bytes_per_mcu[2];
-
- copy_x=priv->width-x;
- if (copy_x>xstride_by_mcu)
- copy_x=xstride_by_mcu;
-
- copy_y=priv->height-y;
- if (copy_y>ystride_by_mcu)
- copy_y=ystride_by_mcu;
-
- for(i=0;i<copy_y;i++) {
- unsigned char *dst = &priv->components[0][((y+i)*priv->width+x)*3];
- memcpy(dst,&priv->decomp_block[i][0],copy_x*3);
- }
-
- if (priv->restarts_to_go>0)
- {
- priv->restarts_to_go--;
- if (priv->restarts_to_go == 0)
- {
- priv->stream -= (priv->nbits_in_reservoir/8);
- resync(priv);
- if (find_next_rst_marker(priv) < 0)
- return -1;
- }
- }
- }
- }
-
- trace("Input file size: %d\n", priv->stream_length+2);
- trace("Input bytes actually read: %d\n", priv->stream - priv->stream_begin + 2);
-
- return 0;
-}
-
-const char *tinyjpeg_get_errorstring(struct jdec_private *priv)
-{
- /* FIXME: the error string must be store in the context */
- priv = priv;
- return error_string;
-}
-
-void tinyjpeg_get_size(struct jdec_private *priv, unsigned int *width, unsigned int *height)
-{
- *width = priv->width;
- *height = priv->height;
-}
-
-int tinyjpeg_get_components(struct jdec_private *priv, unsigned char **components)
-{
- int i;
- for (i=0; priv->components[i] && i<COMPONENTS; i++)
- components[i] = priv->components[i];
- return 0;
-}
-
-int tinyjpeg_set_components(struct jdec_private *priv, unsigned char **components, unsigned int ncomponents)
-{
- unsigned int i;
- if (ncomponents > COMPONENTS)
- ncomponents = COMPONENTS;
- for (i=0; i<ncomponents; i++)
- priv->components[i] = components[i];
- return 0;
-}
-
-int tinyjpeg_set_flags(struct jdec_private *priv, int flags)
-{
- int oldflags = priv->flags;
- priv->flags = flags;
- return oldflags;
-}
-
diff --git a/drivers/jpg/tinyjpeg.h b/drivers/jpg/tinyjpeg.h
deleted file mode 100644
index fe4652360b..0000000000
--- a/drivers/jpg/tinyjpeg.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Small jpeg decoder library (header file)
- *
- * Copyright (c) 2006, Luc Saillard <luc@saillard.org>
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * - Neither the name of the author nor the names of its contributors may be
- * used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-#ifndef __JPEGDEC_H__
-#define __JPEGDEC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct jdec_private;
-
-/* Flags that can be set by any applications */
-#define TINYJPEG_FLAGS_MJPEG_TABLE (1<<1)
-
-/* Format accepted in outout */
-enum tinyjpeg_fmt {
- TINYJPEG_FMT_GREY = 1,
- TINYJPEG_FMT_BGR24,
- TINYJPEG_FMT_RGB24,
- TINYJPEG_FMT_YUV420P,
-};
-
-struct jdec_private *tinyjpeg_init(void *(*allocate_mem)(unsigned int),void (*free_mem)(void *));
-
-void tinyjpeg_free(struct jdec_private *priv);
-
-int tinyjpeg_parse_header(struct jdec_private *priv, const unsigned char *buf, unsigned int size);
-int tinyjpeg_decode(struct jdec_private *priv, int pixel_format);
-const char *tinyjpeg_get_errorstring(struct jdec_private *priv);
-void tinyjpeg_get_size(struct jdec_private *priv, unsigned int *width, unsigned int *height);
-int tinyjpeg_get_components(struct jdec_private *priv, unsigned char **components);
-int tinyjpeg_set_components(struct jdec_private *priv, unsigned char **components, unsigned int ncomponents);
-int tinyjpeg_set_flags(struct jdec_private *priv, int flags);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
-
diff --git a/drivers/pnm/SCsub b/drivers/pnm/SCsub
new file mode 100644
index 0000000000..28b35773a4
--- /dev/null
+++ b/drivers/pnm/SCsub
@@ -0,0 +1,10 @@
+Import('env')
+
+
+pnm_sources = [
+ "pnm/bitmap_loader_pnm.cpp"
+ ]
+
+env.drivers_sources+=pnm_sources
+
+#env.add_source_files(env.drivers_sources, pnm_sources)
diff --git a/drivers/pnm/bitmap_loader_pnm.cpp b/drivers/pnm/bitmap_loader_pnm.cpp
new file mode 100644
index 0000000000..c9298be26a
--- /dev/null
+++ b/drivers/pnm/bitmap_loader_pnm.cpp
@@ -0,0 +1,235 @@
+/*************************************************/
+/* image_loader_jpg.cpp */
+/*************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/*************************************************/
+/* Source code within this file is: */
+/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */
+/* All Rights Reserved. */
+/*************************************************/
+
+#include "bitmap_loader_pnm.h"
+#include "os/file_access.h"
+#include "scene/resources/bit_mask.h"
+
+
+static bool _get_token(FileAccessRef& f,uint8_t &saved,DVector<uint8_t>& r_token,bool p_binary=false,bool p_single_chunk=false) {
+
+
+ int token_max = r_token.size();
+ DVector<uint8_t>::Write w;
+ if (token_max)
+ w=r_token.write();
+ int ofs=0;
+ bool lf=false;
+
+
+ while(true) {
+
+ uint8_t b;
+ if (saved) {
+ b=saved;
+ saved=0;
+ } else {
+ b = f->get_8();
+ }
+ if (f->eof_reached()) {
+ if (ofs) {
+ w=DVector<uint8_t>::Write();
+ r_token.resize(ofs);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ if (!ofs && !p_binary && b=='#') {
+ //skip comment
+ while(b!='\n') {
+ if (f->eof_reached()) {
+ return false;
+ }
+
+ b = f->get_8();
+ }
+
+ lf=true;
+
+ } else if (b<=32 && !(p_binary && (ofs || lf))) {
+
+ if (b=='\n') {
+ lf=true;
+ }
+
+
+ if (ofs && !p_single_chunk) {
+ w=DVector<uint8_t>::Write();
+ r_token.resize(ofs);
+ saved=b;
+
+ return true;
+ }
+ } else {
+
+ bool resized=false;
+ while (ofs>=token_max) {
+ if (token_max)
+ token_max<<=1;
+ else
+ token_max=1;
+ resized=true;
+ }
+ if (resized) {
+ w=DVector<uint8_t>::Write();
+ r_token.resize(token_max);
+ w=r_token.write();
+ }
+ w[ofs++]=b;
+ }
+ }
+
+ return false;
+}
+
+static int _get_number_from_token(DVector<uint8_t>& r_token) {
+
+ int len = r_token.size();
+ DVector<uint8_t>::Read r = r_token.read();
+ return String::to_int((const char*)r.ptr(),len);
+
+}
+
+
+RES ResourceFormatPBM::load(const String &p_path,const String& p_original_path,Error *r_error) {
+
+#define _RETURN(m_err)\
+{\
+ if (r_error)\
+ *r_error=m_err;\
+ ERR_FAIL_V(RES());\
+}
+
+
+ FileAccessRef f=FileAccess::open(p_path,FileAccess::READ);
+ uint8_t saved=0;
+ if (!f)
+ _RETURN(ERR_CANT_OPEN);
+
+ DVector<uint8_t> token;
+
+ if (!_get_token(f,saved,token)) {
+ _RETURN(ERR_PARSE_ERROR);
+ }
+
+ if (token.size()!=2) {
+ _RETURN(ERR_FILE_CORRUPT);
+ }
+ if (token[0]!='P') {
+ _RETURN(ERR_FILE_CORRUPT);
+ }
+ if (token[1]!='1' && token[1]!='4') {
+ _RETURN(ERR_FILE_CORRUPT);
+ }
+
+ bool bits = token[1]=='4';
+
+ if (!_get_token(f,saved,token)) {
+ _RETURN(ERR_PARSE_ERROR);
+ }
+
+ int width = _get_number_from_token(token);
+ if (width<=0) {
+ _RETURN(ERR_FILE_CORRUPT);
+ }
+
+
+ if (!_get_token(f,saved,token)) {
+ _RETURN(ERR_PARSE_ERROR);
+ }
+
+ int height = _get_number_from_token(token);
+ if (height<=0) {
+ _RETURN(ERR_FILE_CORRUPT);
+ }
+
+
+ Ref<BitMap> bm;
+ bm.instance();
+ bm->create(Size2i(width,height));
+
+ if (!bits) {
+
+ int required_bytes = width*height;
+ if (!_get_token(f,saved,token,false,true)) {
+ _RETURN(ERR_PARSE_ERROR);
+ }
+
+ if (token.size()<required_bytes) {
+ _RETURN(ERR_FILE_CORRUPT);
+ }
+
+ DVector<uint8_t>::Read r=token.read();
+
+ for(int i=0;i<height;i++) {
+ for(int j=0;j<width;j++) {
+
+
+ char num = r[i*width+j];
+ bm->set_bit(Point2i(j,i),num=='0');
+ }
+
+ }
+
+
+
+ } else {
+ //a single, entire token of bits!
+ if (!_get_token(f,saved,token,true)) {
+ _RETURN(ERR_PARSE_ERROR);
+ }
+ int required_bytes = Math::ceil((width*height)/8.0);
+ if (token.size()<required_bytes) {
+ _RETURN(ERR_FILE_CORRUPT);
+ }
+
+ DVector<uint8_t>::Read r=token.read();
+ int bitwidth = width;
+ if (bitwidth % 8)
+ bitwidth+=8-(bitwidth%8);
+
+ for(int i=0;i<height;i++) {
+ for(int j=0;j<width;j++) {
+
+ int ofs = bitwidth*i+j;
+
+ uint8_t byte = r[ofs/8];
+ bool bit = (byte>>(7-(ofs%8)))&1;
+
+ bm->set_bit(Point2i(j,i),!bit);
+
+ }
+
+ }
+
+ }
+
+ return bm;
+
+
+}
+
+void ResourceFormatPBM::get_recognized_extensions(List<String> *p_extensions) const {
+ p_extensions->push_back("pbm");
+}
+bool ResourceFormatPBM::handles_type(const String& p_type) const {
+ return p_type=="BitMap";
+}
+String ResourceFormatPBM::get_resource_type(const String &p_path) const {
+
+ if (p_path.extension().to_lower()=="pbm")
+ return "BitMap";
+ return "";
+}
+
+
diff --git a/drivers/pnm/bitmap_loader_pnm.h b/drivers/pnm/bitmap_loader_pnm.h
new file mode 100644
index 0000000000..6e6c8a59c8
--- /dev/null
+++ b/drivers/pnm/bitmap_loader_pnm.h
@@ -0,0 +1,33 @@
+/*************************************************/
+/* image_loader_jpg.h */
+/*************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/*************************************************/
+/* Source code within this file is: */
+/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */
+/* All Rights Reserved. */
+/*************************************************/
+
+#ifndef BITMAP_LOADER_PNM_H
+#define BITMAP_LOADER_PNM_H
+
+#include "io/resource_loader.h"
+
+/**
+ @author Juan Linietsky <reduzio@gmail.com>
+*/
+class ResourceFormatPBM : public ResourceFormatLoader {
+
+
+public:
+
+ virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL);
+ virtual void get_recognized_extensions(List<String> *p_extensions) const;
+ virtual bool handles_type(const String& p_type) const;
+ virtual String get_resource_type(const String &p_path) const;
+};
+
+
+
+#endif
diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp
index 3248177bab..e7bbf28f01 100644
--- a/drivers/register_driver_types.cpp
+++ b/drivers/register_driver_types.cpp
@@ -14,11 +14,12 @@
#include "png/image_loader_png.h"
#include "webp/image_loader_webp.h"
#include "png/resource_saver_png.h"
-#include "jpg/image_loader_jpg.h"
+#include "jpegd/image_loader_jpegd.h"
#include "dds/texture_loader_dds.h"
#include "pvr/texture_loader_pvr.h"
#include "etc1/image_etc.h"
#include "chibi/event_stream_chibi.h"
+#include "pnm/bitmap_loader_pnm.h"
#ifdef TOOLS_ENABLED
@@ -112,6 +113,9 @@ static ResourceFormatLoaderAudioStreamMPC * mpc_stream_loader=NULL;
#include "openssl/register_openssl.h"
#endif
+
+static ResourceFormatPBM * pbm_loader=NULL;
+
void register_core_driver_types() {
#ifdef PNG_ENABLED
@@ -138,6 +142,9 @@ void register_core_driver_types() {
ImageLoader::add_image_format_loader( image_loader_jpg );
#endif
+ pbm_loader = memnew( ResourceFormatPBM );
+ ResourceLoader::add_resource_format_loader(pbm_loader);
+
ObjectTypeDB::register_type<RegEx>();
}
@@ -162,6 +169,7 @@ void unregister_core_driver_types() {
memdelete( image_loader_jpg );
#endif
+ memdelete( pbm_loader );
}
diff --git a/drivers/rtaudio/RtAudio.cpp b/drivers/rtaudio/RtAudio.cpp
index 72ca836907..86981e56d2 100644
--- a/drivers/rtaudio/RtAudio.cpp
+++ b/drivers/rtaudio/RtAudio.cpp
@@ -139,8 +139,7 @@ void RtAudio :: getCompiledApi( std::vector<RtAudio::Api> &apis ) throw()
void RtAudio :: openRtApi( RtAudio::Api api )
{
- if ( rtapi_ )
- delete rtapi_;
+ delete rtapi_;
rtapi_ = 0;
#if defined(__UNIX_JACK__)
@@ -216,8 +215,7 @@ RtAudio :: RtAudio( RtAudio::Api api )
RtAudio :: ~RtAudio() throw()
{
- if ( rtapi_ )
- delete rtapi_;
+ delete rtapi_;
}
void RtAudio :: openStream( RtAudio::StreamParameters *outputParameters,
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp
index 9843405d4a..9f24633bd4 100644
--- a/drivers/unix/file_access_unix.cpp
+++ b/drivers/unix/file_access_unix.cpp
@@ -75,6 +75,8 @@ Error FileAccessUnix::_open(const String& p_path, int p_mode_flags) {
mode_string="wb";
else if (p_mode_flags==READ_WRITE)
mode_string="rb+";
+ else if (p_mode_flags==WRITE_READ)
+ mode_string="wb+";
else
return ERR_INVALID_PARAMETER;
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index bdf7daf799..a004a116e0 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -78,11 +78,11 @@ void OS_Unix::print_error(const char* p_function,const char* p_file,int p_line,c
break;
case ERR_WARNING:
print("\E[1;33mWARNING: %s: \E[0m\E[1m%s\n",p_function,err_details);
- print("\E[0;33m At: %s:%i.\E[0m\n",p_file,p_line);
+ print("\E[0;33m At: %s:%i.\E[0m\n",p_file,p_line);
break;
case ERR_SCRIPT:
print("\E[1;35mSCRIPT ERROR: %s: \E[0m\E[1m%s\n",p_function,err_details);
- print("\E[0;35m At: %s:%i.\E[0m\n",p_file,p_line);
+ print("\E[0;35m At: %s:%i.\E[0m\n",p_file,p_line);
break;
}
}
@@ -149,8 +149,7 @@ void OS_Unix::finalize_core() {
if (mempool_dynamic)
memdelete( mempool_dynamic );
- if (mempool_static)
- delete mempool_static;
+ delete mempool_static;
}
@@ -233,13 +232,12 @@ uint64_t OS_Unix::get_unix_time() const {
return time(NULL);
};
-uint64_t OS_Unix::get_system_time_msec() const {
+uint64_t OS_Unix::get_system_time_secs() const {
struct timeval tv_now;
gettimeofday(&tv_now, NULL);
//localtime(&tv_now.tv_usec);
//localtime((const long *)&tv_now.tv_usec);
- uint64_t msec = uint64_t(tv_now.tv_sec)*1000+tv_now.tv_usec/1000;
- return msec;
+ return uint64_t(tv_now.tv_sec);
}
diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h
index 1baed9e869..a889bba0ff 100644
--- a/drivers/unix/os_unix.h
+++ b/drivers/unix/os_unix.h
@@ -95,7 +95,7 @@ public:
virtual TimeZoneInfo get_time_zone_info() const;
virtual uint64_t get_unix_time() const;
- virtual uint64_t get_system_time_msec() const;
+ virtual uint64_t get_system_time_secs() const;
virtual void delay_usec(uint32_t p_usec) const;
virtual uint64_t get_ticks_usec() const;
diff --git a/drivers/unix/semaphore_posix.cpp b/drivers/unix/semaphore_posix.cpp
index f1f50b0381..3ae94ae5d9 100644
--- a/drivers/unix/semaphore_posix.cpp
+++ b/drivers/unix/semaphore_posix.cpp
@@ -42,7 +42,7 @@ Error SemaphorePosix::wait() {
errno=0;
continue;
} else {
-perror("sem waiting");
+ perror("sem waiting");
return ERR_BUSY;
}
}
diff --git a/drivers/unix/thread_posix.cpp b/drivers/unix/thread_posix.cpp
index 21bd95eade..bd33c81298 100644
--- a/drivers/unix/thread_posix.cpp
+++ b/drivers/unix/thread_posix.cpp
@@ -30,6 +30,10 @@
#if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED)
+#ifdef PTHREAD_BSD_SET_NAME
+#include <pthread_np.h>
+#endif
+
#include "os/memory.h"
Thread::ID ThreadPosix::get_ID() const {
@@ -100,9 +104,14 @@ Error ThreadPosix::set_name(const String& p_name) {
#else
+ #ifdef PTHREAD_BSD_SET_NAME
+ pthread_set_name_np(pthread, p_name.utf8().get_data());
+ int err = 0; // Open/FreeBSD ignore errors in this function
+ #else
int err = pthread_setname_np(pthread, p_name.utf8().get_data());
+ #endif // PTHREAD_BSD_SET_NAME
- #endif
+ #endif // PTHREAD_RENAME_SELF
return err == 0 ? OK : ERR_INVALID_PARAMETER;
diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp
index 0de686ed53..66181a6f44 100644
--- a/drivers/windows/file_access_windows.cpp
+++ b/drivers/windows/file_access_windows.cpp
@@ -72,6 +72,8 @@ Error FileAccessWindows::_open(const String& p_filename, int p_mode_flags) {
mode_string=L"wb";
else if (p_mode_flags==READ_WRITE)
mode_string=L"rb+";
+ else if (p_mode_flags==WRITE_READ)
+ mode_string=L"wb+";
else
return ERR_INVALID_PARAMETER;
diff --git a/main/input_default.cpp b/main/input_default.cpp
index 68f7434d96..a79199580b 100644
--- a/main/input_default.cpp
+++ b/main/input_default.cpp
@@ -781,3 +781,49 @@ void InputDefault::parse_mapping(String p_mapping) {
map_db.push_back(mapping);
//printf("added mapping with uuid %ls\n", mapping.uid.c_str());
};
+
+void InputDefault::add_joy_mapping(String p_mapping, bool p_update_existing) {
+ parse_mapping(p_mapping);
+ if (p_update_existing) {
+ Vector<String> entry = p_mapping.split(",");
+ String uid = entry[0];
+ for (int i=0; i<joy_names.size(); i++) {
+ if (uid == joy_names[i].uid) {
+ joy_names[i].mapping = map_db.size() -1;
+ }
+ }
+ }
+}
+
+void InputDefault::remove_joy_mapping(String p_guid) {
+ for (int i=map_db.size()-1; i >= 0;i--) {
+ if (p_guid == map_db[i].uid) {
+ map_db.remove(i);
+ }
+ }
+ for (int i=0; i<joy_names.size(); i++) {
+ if (joy_names[i].uid == p_guid) {
+ joy_names[i].mapping = -1;
+ }
+ }
+}
+
+//Defaults to simple implementation for platforms with a fixed gamepad layout, like consoles.
+bool InputDefault::is_joy_known(int p_device) {
+
+ return OS::get_singleton()->is_joy_known(p_device);
+}
+
+String InputDefault::get_joy_guid(int p_device) const {
+ return OS::get_singleton()->get_joy_guid(p_device);
+}
+
+//platforms that use the remapping system can override and call to these ones
+bool InputDefault::is_joy_mapped(int p_device) {
+ return joy_names[p_device].mapping != -1 ? true : false;
+}
+
+String InputDefault::get_joy_guid_remapped(int p_device) const {
+ return joy_names[p_device].uid;
+}
+
diff --git a/main/input_default.h b/main/input_default.h
index 6645817b31..bbfd9ced2c 100644
--- a/main/input_default.h
+++ b/main/input_default.h
@@ -56,6 +56,7 @@ class InputDefault : public Input {
}
last_hat = HAT_MASK_CENTER;
filter = 0.01f;
+ mapping = -1;
}
};
@@ -161,6 +162,14 @@ public:
uint32_t joy_axis(uint32_t p_last_id, int p_device, int p_axis, const JoyAxis& p_value);
uint32_t joy_hat(uint32_t p_last_id, int p_device, int p_val);
+ virtual void add_joy_mapping(String p_mapping, bool p_update_existing=false);
+ virtual void remove_joy_mapping(String p_guid);
+ virtual bool is_joy_known(int p_device);
+ virtual String get_joy_guid(int p_device) const;
+
+ bool is_joy_mapped(int p_device);
+ String get_joy_guid_remapped(int p_device) const;
+
InputDefault();
};
diff --git a/main/main.cpp b/main/main.cpp
index 9f3b6a2f37..8319c415fc 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -124,7 +124,7 @@ static String unescape_cmdline(const String& p_str) {
void Main::print_help(const char* p_binary) {
- OS::get_singleton()->print(VERSION_FULL_NAME" (c) 2008-2015 Juan Linietsky, Ariel Manzur.\n");
+ OS::get_singleton()->print(VERSION_FULL_NAME" (c) 2008-2016 Juan Linietsky, Ariel Manzur.\n");
OS::get_singleton()->print("Usage: %s [options] [scene]\n",p_binary);
OS::get_singleton()->print("Options:\n");
OS::get_singleton()->print("\t-path [dir] : Path to a game, containing engine.cfg\n");
@@ -1327,6 +1327,30 @@ bool Main::start() {
//autoload
List<PropertyInfo> props;
Globals::get_singleton()->get_property_list(&props);
+
+ //first pass, add the constants so they exist before any script is loaded
+ for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) {
+
+ String s = E->get().name;
+ if (!s.begins_with("autoload/"))
+ continue;
+ String name = s.get_slicec('/',1);
+ String path = Globals::get_singleton()->get(s);
+ bool global_var=false;
+ if (path.begins_with("*")) {
+ global_var=true;
+ }
+
+ if (global_var) {
+ for(int i=0;i<ScriptServer::get_language_count();i++) {
+ ScriptServer::get_language(i)->add_global_constant(name,Variant());
+ }
+ }
+
+ }
+
+ //second pass, load into global constants
+ List<Node*> to_add;
for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) {
String s = E->get().name;
@@ -1350,12 +1374,13 @@ bool Main::start() {
} else if (res->is_type("Script")) {
Ref<Script> s = res;
StringName ibt = s->get_instance_base_type();
+ bool valid_type = ObjectTypeDB::is_type(ibt,"Node");
ERR_EXPLAIN("Script does not inherit a Node: "+path);
- ERR_CONTINUE( !ObjectTypeDB::is_type(ibt,"Node") );
+ ERR_CONTINUE( !valid_type );
Object *obj = ObjectTypeDB::instance(ibt);
- ERR_EXPLAIN("Cannot instance node for autoload type: "+String(ibt));
+ ERR_EXPLAIN("Cannot instance script for autoload, expected 'Node' inheritance, got: "+String(ibt));
ERR_CONTINUE( obj==NULL );
n = obj->cast_to<Node>();
@@ -1366,7 +1391,9 @@ bool Main::start() {
ERR_CONTINUE(!n);
n->set_name(name);
- sml->get_root()->add_child(n);
+ //defer so references are all valid on _ready()
+ //sml->get_root()->add_child(n);
+ to_add.push_back(n);
if (global_var) {
for(int i=0;i<ScriptServer::get_language_count();i++) {
@@ -1374,9 +1401,15 @@ bool Main::start() {
}
}
+ }
+
+ for(List<Node*>::Element *E=to_add.front();E;E=E->next()) {
+ sml->get_root()->add_child(E->get());
}
+
+
}
Node *scene=NULL;
diff --git a/methods.py b/methods.py
index 21c2293bf0..a894973e69 100755
--- a/methods.py
+++ b/methods.py
@@ -1274,30 +1274,35 @@ def win32_spawn(sh, escape, cmd, args, spawnenv):
return exit_code
"""
-def android_module_source(self,subpath,manifest=""):
- base_path = "../../../modules/"+self.current_module+"/"+subpath
- self.android_source_modules.append(base_path)
-
-def android_module_library(self,subpath,manifest=""):
- base_path = ""
- if (os.path.isabs(subpath)):
- base_path=subpath
- else:
- base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+subpath
- self.android_module_libraries.append(base_path)
-
-def android_module_file(self,file):
- base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+file
- self.android_source_files.append(base_path)
-def android_module_manifest(self,file):
+def android_add_maven_repository(self,url):
+ self.android_maven_repos.append(url)
+
+def android_add_dependency(self,depline):
+ self.android_dependencies.append(depline)
+
+def android_add_java_dir(self,subpath):
+ base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+subpath
+ self.android_java_dirs.append(base_path)
+
+def android_add_res_dir(self,subpath):
+ base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+subpath
+ self.android_res_dirs.append(base_path)
+def android_add_aidl_dir(self,file):
+ base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+subpath
+ self.android_aidl_dirs.append(base_path)
+def android_add_jni_dir(self,file):
+ base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+subpath
+ self.android_jni_dirs.append(base_path)
+
+def android_add_to_manifest(self,file):
base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+file
f = open(base_path,"rb")
self.android_manifest_chunk+=f.read()
-def android_module_permission(self,file):
+def android_add_to_permissions(self,file):
base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+file
f = open(base_path,"rb")
self.android_permission_chunk+=f.read()
-def android_module_attribute(self,file):
+def android_add_to_attributes(self,file):
base_path = self.Dir(".").abspath+"/modules/"+self.current_module+"/"+file
f = open(base_path,"rb")
self.android_appattributes_chunk+=f.read()
diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp
index 6180c668ef..53519030fc 100644
--- a/modules/gdscript/gd_compiler.cpp
+++ b/modules/gdscript/gd_compiler.cpp
@@ -1253,6 +1253,7 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode *
StringName func_name;
if (p_func) {
+
if (p_func->default_values.size()) {
codegen.opcodes.push_back(GDFunction::OPCODE_JUMP_TO_DEF_ARGUMENT);
@@ -1346,7 +1347,7 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode *
if (defarg_addr.size()) {
gdfunc->default_arguments=defarg_addr;
- gdfunc->_default_arg_count=defarg_addr.size();
+ gdfunc->_default_arg_count=defarg_addr.size()-1;
gdfunc->_default_arg_ptr=&gdfunc->default_arguments[0];
} else {
gdfunc->_default_arg_count=0;
diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp
index 11bb3a859a..e015ddb65e 100644
--- a/modules/gdscript/gd_functions.cpp
+++ b/modules/gdscript/gd_functions.cpp
@@ -34,6 +34,7 @@
#include "func_ref.h"
#include "os/os.h"
#include "variant_parser.h"
+#include "io/marshalls.h"
const char *GDFunctions::get_func_name(Function p_func) {
@@ -94,6 +95,8 @@ const char *GDFunctions::get_func_name(Function p_func) {
"printraw",
"var2str",
"str2var",
+ "var2bytes",
+ "bytes2var",
"range",
"load",
"inst2dict",
@@ -639,6 +642,57 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
}
} break;
+ case VAR_TO_BYTES: {
+ VALIDATE_ARG_COUNT(1);
+
+ ByteArray barr;
+ int len;
+ Error err = encode_variant(*p_args[0],NULL,len);
+ if (err) {
+ r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.argument=0;
+ r_error.expected=Variant::NIL;
+ r_ret=Variant();
+ return;
+ }
+
+ barr.resize(len);
+ {
+ ByteArray::Write w = barr.write();
+ encode_variant(*p_args[0],w.ptr(),len);
+
+ }
+ r_ret=barr;
+ } break;
+ case BYTES_TO_VAR: {
+ VALIDATE_ARG_COUNT(1);
+ if (p_args[0]->get_type()!=Variant::RAW_ARRAY) {
+ r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.argument=0;
+ r_error.expected=Variant::RAW_ARRAY;
+ r_ret=Variant();
+ return;
+ }
+
+ ByteArray varr=*p_args[0];
+ Variant ret;
+ {
+ ByteArray::Read r=varr.read();
+ Error err = decode_variant(ret,r.ptr(),varr.size(),NULL);
+ if (err!=OK) {
+ ERR_PRINT("Not enough bytes for decoding..");
+ r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.argument=0;
+ r_error.expected=Variant::RAW_ARRAY;
+ r_ret=Variant();
+ return;
+ }
+
+ }
+
+ r_ret=ret;
+
+ } break;
case GEN_RANGE: {
switch(p_arg_count) {
@@ -1358,6 +1412,18 @@ MethodInfo GDFunctions::get_info(Function p_func) {
mi.return_val.type=Variant::NIL;
return mi;
} break;
+ case VAR_TO_BYTES: {
+ MethodInfo mi("var2bytes",PropertyInfo(Variant::NIL,"var"));
+ mi.return_val.type=Variant::RAW_ARRAY;
+ return mi;
+
+ } break;
+ case BYTES_TO_VAR: {
+
+ MethodInfo mi("bytes2var:Variant",PropertyInfo(Variant::RAW_ARRAY,"bytes"));
+ mi.return_val.type=Variant::NIL;
+ return mi;
+ } break;
case GEN_RANGE: {
MethodInfo mi("range",PropertyInfo(Variant::NIL,"..."));
diff --git a/modules/gdscript/gd_functions.h b/modules/gdscript/gd_functions.h
index e6ef8b9ec8..8c88472567 100644
--- a/modules/gdscript/gd_functions.h
+++ b/modules/gdscript/gd_functions.h
@@ -89,6 +89,8 @@ public:
TEXT_PRINTRAW,
VAR_TO_STR,
STR_TO_VAR,
+ VAR_TO_BYTES,
+ BYTES_TO_VAR,
GEN_RANGE,
RESOURCE_LOAD,
INST2DICT,
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index 73264b0a12..c4175e048d 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -267,6 +267,13 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
constant->value=tokenizer->get_token_constant();
tokenizer->advance();
expr=constant;
+ } else if (tokenizer->get_token()==GDTokenizer::TK_CONST_PI) {
+
+ //constant defined by tokenizer
+ ConstantNode *constant = alloc_node<ConstantNode>();
+ constant->value=Math_PI;
+ tokenizer->advance();
+ expr=constant;
} else if (tokenizer->get_token()==GDTokenizer::TK_PR_PRELOAD) {
//constant defined by tokenizer
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index 9b9b0e4b8c..9a3f50d3b8 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -33,17 +33,6 @@
#include "os/file_access.h"
#include "io/file_access_encrypted.h"
-/* TODO:
-
- *populate globals
- *do checks as close to debugger as possible (but don't do debugger)
- *const check plz
- *check arguments and default arguments in GDFunction
- -get property list in instance?
- *missing opcodes
- -const checks
- -make thread safe
- */
@@ -232,6 +221,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
r_err.error=Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_err.argument=_argument_count;
+
return Variant();
} else if (p_argcount < _argument_count - _default_arg_count) {
@@ -1149,7 +1139,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
if (!GDScriptLanguage::get_singleton()->debug_break(err_text,false)) {
// debugger break did not happen
- _err_print_error(err_func.utf8().get_data(),err_file.utf8().get_data(),err_line,err_text.utf8().get_data());
+ _err_print_error(err_func.utf8().get_data(),err_file.utf8().get_data(),err_line,err_text.utf8().get_data(),ERR_HANDLER_SCRIPT);
}
@@ -1603,6 +1593,28 @@ void GDScript::_update_placeholder(PlaceHolderScriptInstance *p_placeholder) {
}*/
#endif
+
+bool GDScript::get_property_default_value(const StringName& p_property, Variant &r_value) const {
+
+#ifdef TOOLS_ENABLED
+
+ //for (const Map<StringName,Variant>::Element *I=member_default_values.front();I;I=I->next()) {
+ // print_line("\t"+String(String(I->key())+":"+String(I->get())));
+ //}
+ const Map<StringName,Variant>::Element *E=member_default_values_cache.find(p_property);
+ if (E) {
+ r_value=E->get();
+ return true;
+ }
+
+ if (base_cache.is_valid()) {
+ return base_cache->get_property_default_value(p_property,r_value);
+ }
+#endif
+ return false;
+
+}
+
ScriptInstance* GDScript::instance_create(Object *p_this) {
@@ -1740,16 +1752,21 @@ bool GDScript::_update_exports() {
}
}
- Ref<GDScript> bf = ResourceLoader::load(path);
+ if (path!=get_path()) {
+
+ Ref<GDScript> bf = ResourceLoader::load(path);
- if (bf.is_valid()) {
+ if (bf.is_valid()) {
- //print_line("parent is: "+bf->get_path());
- base_cache=bf;
- bf->inheriters_cache.insert(get_instance_ID());
+ //print_line("parent is: "+bf->get_path());
+ base_cache=bf;
+ bf->inheriters_cache.insert(get_instance_ID());
- //bf->_update_exports(p_instances,true,false);
+ //bf->_update_exports(p_instances,true,false);
+ }
+ } else {
+ ERR_PRINT(("Path extending itself in "+path).utf8().get_data());
}
}
diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h
index 173997a1fe..a69f99314a 100644
--- a/modules/gdscript/gd_script.h
+++ b/modules/gdscript/gd_script.h
@@ -352,6 +352,8 @@ public:
Vector<uint8_t> get_as_byte_code() const;
+ bool get_property_default_value(const StringName& p_property,Variant& r_value) const;
+
virtual ScriptLanguage *get_language() const;
GDScript();
@@ -532,6 +534,7 @@ public:
virtual void auto_indent_code(String& p_code,int p_from_line,int p_to_line) const;
virtual void add_global_constant(const StringName& p_variable,const Variant& p_value);
+
/* DEBUGGER FUNCTIONS */
virtual String debug_get_error() const;
diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp
index bebdef83aa..cbcb08334a 100644
--- a/modules/gdscript/gd_tokenizer.cpp
+++ b/modules/gdscript/gd_tokenizer.cpp
@@ -88,6 +88,7 @@ const char* GDTokenizer::token_names[TK_MAX]={
"func",
"class",
"extends",
+"onready",
"tool",
"static",
"export",
@@ -111,6 +112,7 @@ const char* GDTokenizer::token_names[TK_MAX]={
"'?'",
"':'",
"'\\n'",
+"PI",
"Error",
"EOF",
"Cursor"};
@@ -260,6 +262,7 @@ void GDTokenizerText::_advance() {
}
INCPOS(1);
+ line++;
while(GETCHAR(0)==' ' || GETCHAR(0)=='\t') {
INCPOS(1);
@@ -877,6 +880,7 @@ void GDTokenizerText::_advance() {
{TK_CF_RETURN,"return"},
{TK_CF_PASS,"pass"},
{TK_SELF,"self"},
+ {TK_CONST_PI,"PI"},
{TK_ERROR,NULL}
};
@@ -1043,7 +1047,7 @@ void GDTokenizerText::advance(int p_amount) {
//////////////////////////////////////////////////////////////////////////////////////////////////////
-#define BYTECODE_VERSION 8
+#define BYTECODE_VERSION 10
Error GDTokenizerBuffer::set_code_buffer(const Vector<uint8_t> & p_buffer) {
diff --git a/modules/gdscript/gd_tokenizer.h b/modules/gdscript/gd_tokenizer.h
index bbd1ec5b72..aaff573090 100644
--- a/modules/gdscript/gd_tokenizer.h
+++ b/modules/gdscript/gd_tokenizer.h
@@ -119,6 +119,7 @@ public:
TK_QUESTION_MARK,
TK_COLON,
TK_NEWLINE,
+ TK_CONST_PI,
TK_ERROR,
TK_EOF,
TK_CURSOR, //used for code completion
diff --git a/platform/android/AndroidManifest.xml.template b/platform/android/AndroidManifest.xml.template
index c95c86c060..37dee4a9a5 100644
--- a/platform/android/AndroidManifest.xml.template
+++ b/platform/android/AndroidManifest.xml.template
@@ -3,7 +3,7 @@
package="com.godot.game"
android:versionCode="1"
android:versionName="1.0"
- android:installLocation="preferExternal"
+ android:installLocation="auto"
>
<supports-screens android:smallScreens="true"
android:normalScreens="true"
@@ -11,7 +11,7 @@
android:xlargeScreens="true"/>
<application android:label="@string/godot_project_name_string" android:icon="@drawable/icon" android:allowBackup="false" $$ADD_APPATTRIBUTE_CHUNKS$$ >
- <activity android:name="com.android.godot.Godot"
+ <activity android:name="org.godotengine.godot.Godot"
android:label="@string/godot_project_name_string"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
@@ -23,7 +23,7 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
- <service android:name="com.android.godot.GodotDownloaderService" />
+ <service android:name="org.godotengine.godot.GodotDownloaderService" />
@@ -189,7 +189,7 @@ $$ADD_PERMISSION_CHUNKS$$
<uses-permission android:name="godot.custom.7"/>
<uses-permission android:name="godot.custom.8"/>
<uses-permission android:name="godot.custom.9"/>
-<uses-permission android:name="godot.custom.0"/>
+<uses-permission android:name="godot.custom.10"/>
<uses-permission android:name="godot.custom.11"/>
<uses-permission android:name="godot.custom.12"/>
<uses-permission android:name="godot.custom.13"/>
diff --git a/platform/android/SCsub b/platform/android/SCsub
index 834ee58adc..3d645de38f 100644
--- a/platform/android/SCsub
+++ b/platform/android/SCsub
@@ -37,19 +37,59 @@ prog = None
abspath=env.Dir(".").abspath
-pp_basein = open(abspath+"/project.properties.template","rb")
-pp_baseout = open(abspath+"/java/project.properties","wb")
-pp_baseout.write( pp_basein.read() )
+gradle_basein = open(abspath+"/build.gradle.template","rb")
+gradle_baseout = open(abspath+"/java/build.gradle","wb")
-refcount=1
+gradle_text = gradle_basein.read()
-for x in env.android_source_modules:
- pp_baseout.write("android.library.reference."+str(refcount)+"="+x+"\n")
- refcount+=1
+gradle_maven_repos_text=""
+if len(env.android_maven_repos) > 0:
+ gradle_maven_repos_text+="maven {\n"
+ for x in env.android_maven_repos:
+ gradle_maven_repos_text+="\t\t"+x+"\n"
+ gradle_maven_repos_text+="\t}\n"
-pp_baseout.close()
+gradle_maven_dependencies_text=""
+
+for x in env.android_dependencies:
+ gradle_maven_dependencies_text+=x+"\n"
+
+gradle_java_dirs_text=""
+
+for x in env.android_java_dirs:
+ gradle_java_dirs_text+=",'"+x+"'"
+
+
+gradle_res_dirs_text=""
+
+for x in env.android_res_dirs:
+ gradle_res_dirs_text+=",'"+x+"'"
+
+gradle_aidl_dirs_text=""
+
+for x in env.android_aidl_dirs:
+ gradle_aidl_dirs_text+=",'"+x+"'"
+
+gradle_jni_dirs_text=""
+
+for x in env.android_jni_dirs:
+ gradle_jni_dirs_text+=",'"+x+"'"
+
+gradle_asset_dirs_text=""
+
+gradle_text = gradle_text.replace("$$GRADLE_REPOSITORY_URLS$$",gradle_maven_repos_text)
+gradle_text = gradle_text.replace("$$GRADLE_DEPENDENCIES$$",gradle_maven_dependencies_text)
+gradle_text = gradle_text.replace("$$GRADLE_JAVA_DIRS$$",gradle_java_dirs_text)
+gradle_text = gradle_text.replace("$$GRADLE_RES_DIRS$$",gradle_res_dirs_text)
+gradle_text = gradle_text.replace("$$GRADLE_ASSET_DIRS$$",gradle_asset_dirs_text)
+gradle_text = gradle_text.replace("$$GRADLE_AIDL_DIRS$$",gradle_aidl_dirs_text)
+gradle_text = gradle_text.replace("$$GRADLE_JNI_DIRS$$",gradle_jni_dirs_text)
+
+
+gradle_baseout.write( gradle_text )
+gradle_baseout.close()
pp_basein = open(abspath+"/AndroidManifest.xml.template","rb")
@@ -61,13 +101,6 @@ manifest = manifest.replace("$$ADD_APPATTRIBUTE_CHUNKS$$",env.android_appattribu
pp_baseout.write( manifest )
-for x in env.android_source_files:
- shutil.copy(x,abspath+"/java/src/com/android/godot")
-
-for x in env.android_module_libraries:
- shutil.copy(x,abspath+"/java/libs")
-
-
env_android.SharedLibrary("#bin/libgodot",[android_objects],SHLIBSUFFIX=env["SHLIBSUFFIX"])
#env.Command('#bin/libgodot_android.so', '#platform/android/libgodot_android.so', Copy('bin/libgodot_android.so', 'platform/android/libgodot_android.so'))
diff --git a/platform/android/audio_driver_jandroid.cpp b/platform/android/audio_driver_jandroid.cpp
index 1ce70673b9..6d428e3fe5 100644
--- a/platform/android/audio_driver_jandroid.cpp
+++ b/platform/android/audio_driver_jandroid.cpp
@@ -147,13 +147,13 @@ void AudioDriverAndroid::setup( jobject p_io) {
void AudioDriverAndroid::thread_func(JNIEnv *env) {
- jclass cls = env->FindClass("com/android/godot/Godot");
+ jclass cls = env->FindClass("org/godotengine/godot/Godot");
if (cls) {
cls=(jclass)env->NewGlobalRef(cls);
__android_log_print(ANDROID_LOG_INFO,"godot","*******CLASS FOUND!!!");
}
- jfieldID fid = env->GetStaticFieldID(cls, "io", "Lcom/android/godot/GodotIO;");
+ jfieldID fid = env->GetStaticFieldID(cls, "io", "Lorg/godotengine/godot/GodotIO;");
jobject ob = env->GetStaticObjectField(cls,fid);
jobject gob = env->NewGlobalRef(ob);
jclass c = env->GetObjectClass(gob);
diff --git a/platform/android/build.gradle.template b/platform/android/build.gradle.template
new file mode 100644
index 0000000000..9461cd2e99
--- /dev/null
+++ b/platform/android/build.gradle.template
@@ -0,0 +1,70 @@
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.2.0'
+ }
+}
+
+apply plugin: 'com.android.application'
+
+allprojects {
+ repositories {
+ mavenCentral()
+ $$GRADLE_REPOSITORY_URLS$$
+ }
+}
+
+dependencies {
+
+ $$GRADLE_DEPENDENCIES$$
+}
+
+android {
+
+ lintOptions {
+ abortOnError false
+ }
+
+ compileSdkVersion 19
+ buildToolsVersion "19.1"
+
+ packagingOptions {
+ exclude 'META-INF/LICENSE'
+ exclude 'META-INF/NOTICE'
+ }
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 19
+ }
+ sourceSets {
+ main {
+ manifest.srcFile 'AndroidManifest.xml'
+ java.srcDirs = ['src'
+ $$GRADLE_JAVA_DIRS$$
+ ]
+ resources.srcDirs = [
+ 'res'
+ $$GRADLE_RES_DIRS$$
+ ]
+ res.srcDirs = ['res']
+ // libs.srcDirs = ['libs']
+ aidl.srcDirs = [
+ 'aidl'
+ $$GRADLE_AIDL_DIRS$$
+ ]
+ assets.srcDirs = [
+ 'assets'
+ $$GRADLE_ASSET_DIRS$$
+ ]
+ jniLibs.srcDirs = [
+ 'libs'
+ $$GRADLE_JNI_DIRS$$
+ ]
+ }
+
+ }
+
+
+}
diff --git a/platform/android/detect.py b/platform/android/detect.py
index 66097a5149..ee3dc119c2 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -106,10 +106,6 @@ def configure(env):
#env['SPAWN'] = methods.win32_spawn
env['SHLIBSUFFIX'] = '.so'
- #env.android_source_modules.append("../libs/apk_expansion")
- env.android_source_modules.append("../libs/google_play_services")
- env.android_source_modules.append("../libs/downloader_library")
- env.android_source_modules.append("../libs/play_licensing")
neon_text=""
if env["android_arch"]=="armv7" and env['android_neon']=='yes':
diff --git a/platform/android/dir_access_jandroid.cpp b/platform/android/dir_access_jandroid.cpp
index 67d1fd6956..8b7cb992d9 100644
--- a/platform/android/dir_access_jandroid.cpp
+++ b/platform/android/dir_access_jandroid.cpp
@@ -96,7 +96,7 @@ void DirAccessJAndroid::list_dir_end(){
return;
JNIEnv *env = ThreadAndroid::get_env();
- env->CallObjectMethod(io,_dir_close,id);
+ env->CallVoidMethod(io,_dir_close,id);
id=0;
@@ -143,7 +143,7 @@ Error DirAccessJAndroid::change_dir(String p_dir){
if (res<=0)
return ERR_INVALID_PARAMETER;
- env->CallObjectMethod(io,_dir_close,res);
+ env->CallVoidMethod(io,_dir_close,res);
current_dir=new_dir;
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 7d550f4fa0..c908f6729b 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -1569,7 +1569,7 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) {
args.push_back("-a");
args.push_back("android.intent.action.MAIN");
args.push_back("-n");
- args.push_back(get_package_name()+"/com.android.godot.Godot");
+ args.push_back(get_package_name()+"/org.godotengine.godot.Godot");
err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv);
if (err || rv!=0) {
diff --git a/platform/android/file_access_android.cpp b/platform/android/file_access_android.cpp
index 885c0f3806..7a038cca64 100644
--- a/platform/android/file_access_android.cpp
+++ b/platform/android/file_access_android.cpp
@@ -132,12 +132,18 @@ int FileAccessAndroid::get_buffer(uint8_t *p_dst, int p_length) const {
off_t r = AAsset_read(a,p_dst,p_length);
+
+ if (pos+p_length >len ) {
+ eof=true;
+ }
+
if (r>=0) {
+
pos+=r;
if (pos>len) {
pos=len;
- eof=true;
}
+
}
return r;
diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp
index b645847d40..f9feb3481f 100644
--- a/platform/android/godot_android.cpp
+++ b/platform/android/godot_android.cpp
@@ -50,9 +50,9 @@
extern "C" {
- JNIEXPORT void JNICALL Java_com_android_godot_Godot_registerSingleton(JNIEnv * env, jobject obj, jstring name,jobject p_object);
- JNIEXPORT void JNICALL Java_com_android_godot_Godot_registerMethod(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args);
- JNIEXPORT jstring JNICALL Java_com_android_godot_Godot_getGlobal(JNIEnv * env, jobject obj, jstring path);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerSingleton(JNIEnv * env, jobject obj, jstring name,jobject p_object);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerMethod(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args);
+ JNIEXPORT jstring JNICALL Java_org_godotengine_godot_Godot_getGlobal(JNIEnv * env, jobject obj, jstring path);
};
class JNISingleton : public Object {
@@ -671,12 +671,12 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
static JNINativeMethod methods[] = {
- {"registerSingleton", "(Ljava/lang/String;Ljava/lang/Object;)V",(void *)&Java_com_android_godot_Godot_registerSingleton},
- {"registerMethod", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V",(void *)&Java_com_android_godot_Godot_registerMethod},
- {"getGlobal", "(Ljava/lang/String;)Ljava/lang/String;", (void *)&Java_com_android_godot_Godot_getGlobal},
+ {"registerSingleton", "(Ljava/lang/String;Ljava/lang/Object;)V",(void *)&Java_org_godotengine_godot_Godot_registerSingleton},
+ {"registerMethod", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V",(void *)&Java_org_godotengine_godot_Godot_registerMethod},
+ {"getGlobal", "(Ljava/lang/String;)Ljava/lang/String;", (void *)&Java_org_godotengine_godot_Godot_getGlobal},
};
- jstring gstrClassName = engine->jni->NewStringUTF("com/android/godot/Godot");
+ jstring gstrClassName = engine->jni->NewStringUTF("org/godotengine/godot/Godot");
jclass GodotClass = (jclass)engine->jni->CallObjectMethod(cls, findClass, gstrClassName);
__android_log_print(ANDROID_LOG_INFO,"godot","godot ****^*^*?^*^*class data %x",GodotClass);
@@ -692,7 +692,7 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
jclass singletonClass = (jclass)engine->jni->CallObjectMethod(cls, findClass, strClassName);
__android_log_print(ANDROID_LOG_INFO,"godot","****^*^*?^*^*class data %x",singletonClass);
- jmethodID initialize = engine->jni->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lcom/android/godot/Godot$SingletonBase;");
+ jmethodID initialize = engine->jni->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lorg/godotengine/godot/Godot$SingletonBase;");
jobject obj = engine->jni->CallStaticObjectMethod(singletonClass,initialize,app->activity->clazz);
@@ -863,7 +863,7 @@ void android_main(struct android_app* state) {
-JNIEXPORT void JNICALL Java_com_android_godot_Godot_registerSingleton(JNIEnv * env, jobject obj, jstring name,jobject p_object){
+JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerSingleton(JNIEnv * env, jobject obj, jstring name,jobject p_object){
String singname = env->GetStringUTFChars( name, NULL );
JNISingleton *s = memnew( JNISingleton );
@@ -938,7 +938,7 @@ static const char* get_jni_sig(const String& p_type) {
return "";
}
-JNIEXPORT jstring JNICALL Java_com_android_godot_Godot_getGlobal(JNIEnv * env, jobject obj, jstring path) {
+JNIEXPORT jstring JNICALL Java_org_godotengine_godot_Godot_getGlobal(JNIEnv * env, jobject obj, jstring path) {
String js = env->GetStringUTFChars( path, NULL );
@@ -949,7 +949,7 @@ JNIEXPORT jstring JNICALL Java_com_android_godot_Godot_getGlobal(JNIEnv * env, j
-JNIEXPORT void JNICALL Java_com_android_godot_Godot_registerMethod(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args){
+JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerMethod(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args){
String singname = env->GetStringUTFChars( sname, NULL );
diff --git a/platform/android/java/aidl/com/android/vending/billing/IInAppBillingService.aidl b/platform/android/java/aidl/com/android/vending/billing/IInAppBillingService.aidl
new file mode 100644
index 0000000000..2a492f7845
--- /dev/null
+++ b/platform/android/java/aidl/com/android/vending/billing/IInAppBillingService.aidl
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.vending.billing;
+
+import android.os.Bundle;
+
+/**
+ * InAppBillingService is the service that provides in-app billing version 3 and beyond.
+ * This service provides the following features:
+ * 1. Provides a new API to get details of in-app items published for the app including
+ * price, type, title and description.
+ * 2. The purchase flow is synchronous and purchase information is available immediately
+ * after it completes.
+ * 3. Purchase information of in-app purchases is maintained within the Google Play system
+ * till the purchase is consumed.
+ * 4. An API to consume a purchase of an inapp item. All purchases of one-time
+ * in-app items are consumable and thereafter can be purchased again.
+ * 5. An API to get current purchases of the user immediately. This will not contain any
+ * consumed purchases.
+ *
+ * All calls will give a response code with the following possible values
+ * RESULT_OK = 0 - success
+ * RESULT_USER_CANCELED = 1 - user pressed back or canceled a dialog
+ * RESULT_BILLING_UNAVAILABLE = 3 - this billing API version is not supported for the type requested
+ * RESULT_ITEM_UNAVAILABLE = 4 - requested SKU is not available for purchase
+ * RESULT_DEVELOPER_ERROR = 5 - invalid arguments provided to the API
+ * RESULT_ERROR = 6 - Fatal error during the API action
+ * RESULT_ITEM_ALREADY_OWNED = 7 - Failure to purchase since item is already owned
+ * RESULT_ITEM_NOT_OWNED = 8 - Failure to consume since item is not owned
+ */
+interface IInAppBillingService {
+ /**
+ * Checks support for the requested billing API version, package and in-app type.
+ * Minimum API version supported by this interface is 3.
+ * @param apiVersion the billing version which the app is using
+ * @param packageName the package name of the calling app
+ * @param type type of the in-app item being purchased "inapp" for one-time purchases
+ * and "subs" for subscription.
+ * @return RESULT_OK(0) on success, corresponding result code on failures
+ */
+ int isBillingSupported(int apiVersion, String packageName, String type);
+
+ /**
+ * Provides details of a list of SKUs
+ * Given a list of SKUs of a valid type in the skusBundle, this returns a bundle
+ * with a list JSON strings containing the productId, price, title and description.
+ * This API can be called with a maximum of 20 SKUs.
+ * @param apiVersion billing API version that the Third-party is using
+ * @param packageName the package name of the calling app
+ * @param skusBundle bundle containing a StringArrayList of SKUs with key "ITEM_ID_LIST"
+ * @return Bundle containing the following key-value pairs
+ * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
+ * failure as listed above.
+ * "DETAILS_LIST" with a StringArrayList containing purchase information
+ * in JSON format similar to:
+ * '{ "productId" : "exampleSku", "type" : "inapp", "price" : "$5.00",
+ * "title : "Example Title", "description" : "This is an example description" }'
+ */
+ Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle);
+
+ /**
+ * Returns a pending intent to launch the purchase flow for an in-app item by providing a SKU,
+ * the type, a unique purchase token and an optional developer payload.
+ * @param apiVersion billing API version that the app is using
+ * @param packageName package name of the calling app
+ * @param sku the SKU of the in-app item as published in the developer console
+ * @param type the type of the in-app item ("inapp" for one-time purchases
+ * and "subs" for subscription).
+ * @param developerPayload optional argument to be sent back with the purchase information
+ * @return Bundle containing the following key-value pairs
+ * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
+ * failure as listed above.
+ * "BUY_INTENT" - PendingIntent to start the purchase flow
+ *
+ * The Pending intent should be launched with startIntentSenderForResult. When purchase flow
+ * has completed, the onActivityResult() will give a resultCode of OK or CANCELED.
+ * If the purchase is successful, the result data will contain the following key-value pairs
+ * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
+ * failure as listed above.
+ * "INAPP_PURCHASE_DATA" - String in JSON format similar to
+ * '{"orderId":"12999763169054705758.1371079406387615",
+ * "packageName":"com.example.app",
+ * "productId":"exampleSku",
+ * "purchaseTime":1345678900000,
+ * "purchaseToken" : "122333444455555",
+ * "developerPayload":"example developer payload" }'
+ * "INAPP_DATA_SIGNATURE" - String containing the signature of the purchase data that
+ * was signed with the private key of the developer
+ * TODO: change this to app-specific keys.
+ */
+ Bundle getBuyIntent(int apiVersion, String packageName, String sku, String type,
+ String developerPayload);
+
+ /**
+ * Returns the current SKUs owned by the user of the type and package name specified along with
+ * purchase information and a signature of the data to be validated.
+ * This will return all SKUs that have been purchased in V3 and managed items purchased using
+ * V1 and V2 that have not been consumed.
+ * @param apiVersion billing API version that the app is using
+ * @param packageName package name of the calling app
+ * @param type the type of the in-app items being requested
+ * ("inapp" for one-time purchases and "subs" for subscription).
+ * @param continuationToken to be set as null for the first call, if the number of owned
+ * skus are too many, a continuationToken is returned in the response bundle.
+ * This method can be called again with the continuation token to get the next set of
+ * owned skus.
+ * @return Bundle containing the following key-value pairs
+ * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
+ * failure as listed above.
+ * "INAPP_PURCHASE_ITEM_LIST" - StringArrayList containing the list of SKUs
+ * "INAPP_PURCHASE_DATA_LIST" - StringArrayList containing the purchase information
+ * "INAPP_DATA_SIGNATURE_LIST"- StringArrayList containing the signatures
+ * of the purchase information
+ * "INAPP_CONTINUATION_TOKEN" - String containing a continuation token for the
+ * next set of in-app purchases. Only set if the
+ * user has more owned skus than the current list.
+ */
+ Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken);
+
+ /**
+ * Consume the last purchase of the given SKU. This will result in this item being removed
+ * from all subsequent responses to getPurchases() and allow re-purchase of this item.
+ * @param apiVersion billing API version that the app is using
+ * @param packageName package name of the calling app
+ * @param purchaseToken token in the purchase information JSON that identifies the purchase
+ * to be consumed
+ * @return 0 if consumption succeeded. Appropriate error values for failures.
+ */
+ int consumePurchase(int apiVersion, String packageName, String purchaseToken);
+}
diff --git a/platform/android/java/ant.properties b/platform/android/java/ant.properties
deleted file mode 100644
index b0971e891e..0000000000
--- a/platform/android/java/ant.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
diff --git a/platform/android/java/build.properties b/platform/android/java/build.properties
deleted file mode 100644
index ee52d86d94..0000000000
--- a/platform/android/java/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked in Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-# 'source.dir' for the location of your java source folder and
-# 'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-# 'key.store' for the location of your keystore and
-# 'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
diff --git a/platform/android/java/build.xml b/platform/android/java/build.xml
deleted file mode 100644
index 424e2827dc..0000000000
--- a/platform/android/java/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="Godot" default="help">
-
- <!-- The local.properties file is created and updated by the 'android' tool.
- It contains the path to the SDK. It should *NOT* be checked into
- Version Control Systems. -->
- <property file="local.properties" />
-
- <!-- The ant.properties file can be created by you. It is only edited by the
- 'android' tool to add properties to it.
- This is the place to change some Ant specific build properties.
- Here are some properties you may want to change/update:
-
- source.dir
- The name of the source directory. Default is 'src'.
- out.dir
- The name of the output directory. Default is 'bin'.
-
- For other overridable properties, look at the beginning of the rules
- files in the SDK, at tools/ant/build.xml
-
- Properties related to the SDK location or the project target should
- be updated using the 'android' tool with the 'update' action.
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems.
-
- -->
- <property file="ant.properties" />
-
- <!-- if sdk.dir was not set from one of the property file, then
- get it from the ANDROID_HOME env var.
- This must be done before we load project.properties since
- the proguard config can use sdk.dir -->
- <property environment="env" />
- <condition property="sdk.dir" value="${env.ANDROID_HOME}">
- <isset property="env.ANDROID_HOME" />
- </condition>
-
- <!-- The project.properties file is created and updated by the 'android'
- tool, as well as ADT.
-
- This contains project specific properties such as project target, and library
- dependencies. Lower level build properties are stored in ant.properties
- (or in .classpath for Eclipse projects).
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems. -->
- <loadproperties srcFile="project.properties" />
-
- <!-- quick check on sdk.dir -->
- <fail
- message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
- unless="sdk.dir"
- />
-
- <!--
- Import per project custom build rules if present at the root of the project.
- This is the place to put custom intermediary targets such as:
- -pre-build
- -pre-compile
- -post-compile (This is typically used for code obfuscation.
- Compiled code location: ${out.classes.absolute.dir}
- If this is not done in place, override ${out.dex.input.absolute.dir})
- -post-package
- -post-build
- -pre-clean
- -->
- <import file="custom_rules.xml" optional="true" />
-
- <!-- Import the actual build file.
-
- To customize existing targets, there are two options:
- - Customize only one target:
- - copy/paste the target into this file, *before* the
- <import> task.
- - customize it to your needs.
- - Customize the whole content of build.xml
- - copy/paste the content of the rules files (minus the top node)
- into this file, replacing the <import> task.
- - customize to your needs.
-
- ***********************
- ****** IMPORTANT ******
- ***********************
- In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
- in order to avoid having your file be overridden by tools such as "android update project"
- -->
- <!-- version-tag: 1 -->
- <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
diff --git a/platform/android/java/default.properties b/platform/android/java/default.properties
deleted file mode 100644
index e2e8061f26..0000000000
--- a/platform/android/java/default.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "build.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-8
diff --git a/platform/android/java/gradle/wrapper/gradle-wrapper.jar b/platform/android/java/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000000..8c0fb64a86
--- /dev/null
+++ b/platform/android/java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/platform/android/java/gradle/wrapper/gradle-wrapper.properties b/platform/android/java/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000000..0c71e760dc
--- /dev/null
+++ b/platform/android/java/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Apr 10 15:27:10 PDT 2013
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
diff --git a/platform/android/java/gradlew b/platform/android/java/gradlew
new file mode 100755
index 0000000000..91a7e269e1
--- /dev/null
+++ b/platform/android/java/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/platform/android/java/gradlew.bat b/platform/android/java/gradlew.bat
new file mode 100644
index 0000000000..aec99730b4
--- /dev/null
+++ b/platform/android/java/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/platform/android/java/my-release-key.keystore b/platform/android/java/my-release-key.keystore
deleted file mode 100644
index 410cccd865..0000000000
--- a/platform/android/java/my-release-key.keystore
+++ /dev/null
Binary files differ
diff --git a/platform/android/java/proguard-project.txt b/platform/android/java/proguard-project.txt
deleted file mode 100644
index f2fe1559a2..0000000000
--- a/platform/android/java/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/platform/android/java/proguard.cfg b/platform/android/java/proguard.cfg
deleted file mode 100644
index 12dd0392c0..0000000000
--- a/platform/android/java/proguard.cfg
+++ /dev/null
@@ -1,36 +0,0 @@
--optimizationpasses 5
--dontusemixedcaseclassnames
--dontskipnonpubliclibraryclasses
--dontpreverify
--verbose
--optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgentHelper
--keep public class * extends android.preference.Preference
--keep public class com.android.vending.licensing.ILicensingService
-
--keepclasseswithmembernames class * {
- native <methods>;
-}
-
--keepclasseswithmembernames class * {
- public <init>(android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembernames class * {
- public <init>(android.content.Context, android.util.AttributeSet, int);
-}
-
--keepclassmembers enum * {
- public static **[] values();
- public static ** valueOf(java.lang.String);
-}
-
--keep class * implements android.os.Parcelable {
- public static final android.os.Parcelable$Creator *;
-}
diff --git a/platform/android/libs/apk_expansion/res/drawable-hdpi/notify_panel_notification_icon_bg.png b/platform/android/java/res/drawable-hdpi/notify_panel_notification_icon_bg.png
index f5b762ecf3..f5b762ecf3 100644
--- a/platform/android/libs/apk_expansion/res/drawable-hdpi/notify_panel_notification_icon_bg.png
+++ b/platform/android/java/res/drawable-hdpi/notify_panel_notification_icon_bg.png
Binary files differ
diff --git a/platform/android/libs/apk_expansion/res/drawable-mdpi/notify_panel_notification_icon_bg.png b/platform/android/java/res/drawable-mdpi/notify_panel_notification_icon_bg.png
index 9ecb8af06c..9ecb8af06c 100644
--- a/platform/android/libs/apk_expansion/res/drawable-mdpi/notify_panel_notification_icon_bg.png
+++ b/platform/android/java/res/drawable-mdpi/notify_panel_notification_icon_bg.png
Binary files differ
diff --git a/platform/android/libs/apk_expansion/res/layout/status_bar_ongoing_event_progress_bar.xml b/platform/android/java/res/layout/status_bar_ongoing_event_progress_bar.xml
index 23bac02294..23bac02294 100644
--- a/platform/android/libs/apk_expansion/res/layout/status_bar_ongoing_event_progress_bar.xml
+++ b/platform/android/java/res/layout/status_bar_ongoing_event_progress_bar.xml
diff --git a/platform/android/libs/apk_expansion/res/values-v11/styles.xml b/platform/android/java/res/values-v11/styles.xml
index f2013bc0bf..f2013bc0bf 100644
--- a/platform/android/libs/apk_expansion/res/values-v11/styles.xml
+++ b/platform/android/java/res/values-v11/styles.xml
diff --git a/platform/android/libs/apk_expansion/res/values-v9/styles.xml b/platform/android/java/res/values-v9/styles.xml
index 736e77a5d6..736e77a5d6 100644
--- a/platform/android/libs/apk_expansion/res/values-v9/styles.xml
+++ b/platform/android/java/res/values-v9/styles.xml
diff --git a/platform/android/java/res/values/strings.xml b/platform/android/java/res/values/strings.xml
index 49ebcc06f9..e1dbdfc062 100644
--- a/platform/android/java/res/values/strings.xml
+++ b/platform/android/java/res/values/strings.xml
@@ -14,4 +14,44 @@
<string name="text_button_resume">Resume Download</string>
<string name="text_button_cancel">Cancel</string>
<string name="text_button_cancel_verify">Cancel Verification</string>
-</resources>
+
+ <!-- APK Expansion Strings -->
+
+ <!-- When a download completes, a notification is displayed, and this
+ string is used to indicate that the download successfully completed.
+ Note that such a download could have been initiated by a variety of
+ applications, including (but not limited to) the browser, an email
+ application, a content marketplace. -->
+ <string name="notification_download_complete">Download complete</string>
+
+ <!-- When a download completes, a notification is displayed, and this
+ string is used to indicate that the download failed.
+ Note that such a download could have been initiated by a variety of
+ applications, including (but not limited to) the browser, an email
+ application, a content marketplace. -->
+ <string name="notification_download_failed">Download unsuccessful</string>
+
+
+ <string name="state_unknown">Starting..."</string>
+ <string name="state_idle">Waiting for download to start</string>
+ <string name="state_fetching_url">Looking for resources to download</string>
+ <string name="state_connecting">Connecting to the download server</string>
+ <string name="state_downloading">Downloading resources</string>
+ <string name="state_completed">Download finished</string>
+ <string name="state_paused_network_unavailable">Download paused because no network is available</string>
+ <string name="state_paused_network_setup_failure">Download paused. Test a website in browser</string>
+ <string name="state_paused_by_request">Download paused</string>
+ <string name="state_paused_wifi_unavailable">Download paused because wifi is unavailable</string>
+ <string name="state_paused_wifi_disabled">Download paused because wifi is disabled</string>
+ <string name="state_paused_roaming">Download paused because you are roaming</string>
+ <string name="state_paused_sdcard_unavailable">Download paused because the external storage is unavailable</string>
+ <string name="state_failed_unlicensed">Download failed because you may not have purchased this app</string>
+ <string name="state_failed_fetching_url">Download failed because the resources could not be found</string>
+ <string name="state_failed_sdcard_full">Download failed because the external storage is full</string>
+ <string name="state_failed_cancelled">Download cancelled</string>
+ <string name="state_failed">Download failed</string>
+
+ <string name="kilobytes_per_second">%1$s KB/s</string>
+ <string name="time_remaining">Time remaining: %1$s</string>
+ <string name="time_remaining_notification">%1$s left</string>
+</resources> \ No newline at end of file
diff --git a/platform/android/libs/apk_expansion/res/values/styles.xml b/platform/android/java/res/values/styles.xml
index a442f61e7e..a442f61e7e 100644
--- a/platform/android/libs/apk_expansion/res/values/styles.xml
+++ b/platform/android/java/res/values/styles.xml
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/AESObfuscator.java b/platform/android/java/src/com/android/vending/licensing/AESObfuscator.java
index ee12c68deb..ee12c68deb 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/AESObfuscator.java
+++ b/platform/android/java/src/com/android/vending/licensing/AESObfuscator.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/APKExpansionPolicy.java b/platform/android/java/src/com/android/vending/licensing/APKExpansionPolicy.java
index 17cc7a7cfd..17cc7a7cfd 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/APKExpansionPolicy.java
+++ b/platform/android/java/src/com/android/vending/licensing/APKExpansionPolicy.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/DeviceLimiter.java b/platform/android/java/src/com/android/vending/licensing/DeviceLimiter.java
index e5c5e2d7ca..e5c5e2d7ca 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/DeviceLimiter.java
+++ b/platform/android/java/src/com/android/vending/licensing/DeviceLimiter.java
diff --git a/platform/android/libs/play_licensing/aidl/ILicenseResultListener.aidl b/platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.aidl
index c816558afc..c816558afc 100644
--- a/platform/android/libs/play_licensing/aidl/ILicenseResultListener.aidl
+++ b/platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.aidl
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ILicenseResultListener.java b/platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.java
index d90d6eac7b..d90d6eac7b 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ILicenseResultListener.java
+++ b/platform/android/java/src/com/android/vending/licensing/ILicenseResultListener.java
diff --git a/platform/android/libs/play_licensing/aidl/ILicensingService.aidl b/platform/android/java/src/com/android/vending/licensing/ILicensingService.aidl
index 664510ce0c..664510ce0c 100644
--- a/platform/android/libs/play_licensing/aidl/ILicensingService.aidl
+++ b/platform/android/java/src/com/android/vending/licensing/ILicensingService.aidl
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ILicensingService.java b/platform/android/java/src/com/android/vending/licensing/ILicensingService.java
index 95599544e4..95599544e4 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ILicensingService.java
+++ b/platform/android/java/src/com/android/vending/licensing/ILicensingService.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseChecker.java b/platform/android/java/src/com/android/vending/licensing/LicenseChecker.java
index 8b53545e61..0b1c4b6cca 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseChecker.java
+++ b/platform/android/java/src/com/android/vending/licensing/LicenseChecker.java
@@ -63,7 +63,7 @@ public class LicenseChecker implements ServiceConnection {
private static final int TIMEOUT_MS = 10 * 1000;
private static final SecureRandom RANDOM = new SecureRandom();
- private static final boolean DEBUG_LICENSE_ERROR = true;
+ private static final boolean DEBUG_LICENSE_ERROR = false;
private ILicensingService mService;
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseCheckerCallback.java b/platform/android/java/src/com/android/vending/licensing/LicenseCheckerCallback.java
index b250a7147b..b250a7147b 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseCheckerCallback.java
+++ b/platform/android/java/src/com/android/vending/licensing/LicenseCheckerCallback.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseValidator.java b/platform/android/java/src/com/android/vending/licensing/LicenseValidator.java
index 61d3c7e79e..61d3c7e79e 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/LicenseValidator.java
+++ b/platform/android/java/src/com/android/vending/licensing/LicenseValidator.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/NullDeviceLimiter.java b/platform/android/java/src/com/android/vending/licensing/NullDeviceLimiter.java
index d87af3153f..d87af3153f 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/NullDeviceLimiter.java
+++ b/platform/android/java/src/com/android/vending/licensing/NullDeviceLimiter.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/Obfuscator.java b/platform/android/java/src/com/android/vending/licensing/Obfuscator.java
index b5d510d72d..b5d510d72d 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/Obfuscator.java
+++ b/platform/android/java/src/com/android/vending/licensing/Obfuscator.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/Policy.java b/platform/android/java/src/com/android/vending/licensing/Policy.java
index fa267fc71a..fa267fc71a 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/Policy.java
+++ b/platform/android/java/src/com/android/vending/licensing/Policy.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/PreferenceObfuscator.java b/platform/android/java/src/com/android/vending/licensing/PreferenceObfuscator.java
index 7c42bfc28a..7c42bfc28a 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/PreferenceObfuscator.java
+++ b/platform/android/java/src/com/android/vending/licensing/PreferenceObfuscator.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ResponseData.java b/platform/android/java/src/com/android/vending/licensing/ResponseData.java
index 2adef3709e..2adef3709e 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ResponseData.java
+++ b/platform/android/java/src/com/android/vending/licensing/ResponseData.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ServerManagedPolicy.java b/platform/android/java/src/com/android/vending/licensing/ServerManagedPolicy.java
index fbf8cf6d00..fbf8cf6d00 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ServerManagedPolicy.java
+++ b/platform/android/java/src/com/android/vending/licensing/ServerManagedPolicy.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/StrictPolicy.java b/platform/android/java/src/com/android/vending/licensing/StrictPolicy.java
index d8d83b4e4b..d8d83b4e4b 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/StrictPolicy.java
+++ b/platform/android/java/src/com/android/vending/licensing/StrictPolicy.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ValidationException.java b/platform/android/java/src/com/android/vending/licensing/ValidationException.java
index ee4df47c68..ee4df47c68 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/ValidationException.java
+++ b/platform/android/java/src/com/android/vending/licensing/ValidationException.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/util/Base64.java b/platform/android/java/src/com/android/vending/licensing/util/Base64.java
index a0d2779af2..a0d2779af2 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/util/Base64.java
+++ b/platform/android/java/src/com/android/vending/licensing/util/Base64.java
diff --git a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/util/Base64DecoderException.java b/platform/android/java/src/com/android/vending/licensing/util/Base64DecoderException.java
index 1aef1b54b8..1aef1b54b8 100644
--- a/platform/android/libs/play_licensing/src/com/google/android/vending/licensing/util/Base64DecoderException.java
+++ b/platform/android/java/src/com/android/vending/licensing/util/Base64DecoderException.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/Constants.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/Constants.java
index ff2c6f535a..ff2c6f535a 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/Constants.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/Constants.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java
index 9cb294d721..9cb294d721 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java
index 2201751254..2201751254 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java
index 054eaa9895..054eaa9895 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/Helpers.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java
index 1e84e54a0f..b4c28d36e7 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/Helpers.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/Helpers.java
@@ -16,7 +16,7 @@
package com.google.android.vending.expansion.downloader;
-import com.android.vending.expansion.downloader.R;
+import com.godot.game.R;
import android.content.Context;
import android.os.Environment;
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java
index b8511a62a0..b8511a62a0 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IDownloaderService.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/IDownloaderService.java
index 4789afe19c..4789afe19c 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IDownloaderService.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/IDownloaderService.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IStub.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/IStub.java
index d5bc3a843e..d5bc3a843e 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/IStub.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/IStub.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/SystemFacade.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/SystemFacade.java
index 12edd97ab2..12edd97ab2 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/SystemFacade.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/SystemFacade.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java
index 4667acce67..4667acce67 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java
index b77af7e085..b77af7e085 100755
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java
index 9a0ca02122..9a0ca02122 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java
index 45111b16a3..45111b16a3 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java
index eef205d7b7..d82b658bc3 100644
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java
@@ -16,7 +16,7 @@
package com.google.android.vending.expansion.downloader.impl;
-import com.android.vending.expansion.downloader.R;
+import com.godot.game.R;
import com.google.android.vending.expansion.downloader.DownloadProgressInfo;
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller;
import com.google.android.vending.expansion.downloader.Helpers;
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java
index 056d1eca0b..056d1eca0b 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java
index 627bf3eedd..627bf3eedd 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java
index 250299c400..250299c400 100755
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java
index 3f440e9893..3f440e9893 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java
index e736603e2a..2e049a4d47 100644
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java
@@ -16,7 +16,7 @@
package com.google.android.vending.expansion.downloader.impl;
-import com.android.vending.expansion.downloader.R;
+import com.godot.game.R;
import com.google.android.vending.expansion.downloader.Helpers;
import android.app.Notification;
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java
index e3666e05b9..94e21de7ca 100644
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java
@@ -16,7 +16,7 @@
package com.google.android.vending.expansion.downloader.impl;
-import com.android.vending.expansion.downloader.R;
+import com.godot.game.R;
import com.google.android.vending.expansion.downloader.Helpers;
import android.app.Notification;
diff --git a/platform/android/java/src/com/android/godot/Dictionary.java b/platform/android/java/src/org/godotengine/godot/Dictionary.java
index 0536efcd0e..34051c4bb8 100644
--- a/platform/android/java/src/com/android/godot/Dictionary.java
+++ b/platform/android/java/src/org/godotengine/godot/Dictionary.java
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -26,7 +26,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-package com.android.godot;
+package org.godotengine.godot;
import java.util.HashMap;
import java.util.Set;
diff --git a/platform/android/java/src/com/android/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java
index e104b2b8b6..c6bc6a6943 100644
--- a/platform/android/java/src/com/android/godot/Godot.java
+++ b/platform/android/java/src/org/godotengine/godot/Godot.java
@@ -26,7 +26,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-package com.android.godot;
+package org.godotengine.godot;
import android.R;
import android.app.Activity;
@@ -60,14 +60,14 @@ import java.lang.reflect.Method;
import java.util.List;
import java.util.ArrayList;
-import com.android.godot.payments.PaymentsManager;
+import org.godotengine.godot.payments.PaymentsManager;
import java.io.IOException;
import android.provider.Settings.Secure;
import android.widget.FrameLayout;
-import com.android.godot.input.*;
+import org.godotengine.godot.input.*;
import java.io.InputStream;
import javax.microedition.khronos.opengles.GL10;
diff --git a/platform/android/java/src/com/android/godot/GodotDownloaderAlarmReceiver.java b/platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java
index e82c3eb0fe..b602f4757c 100644
--- a/platform/android/java/src/com/android/godot/GodotDownloaderAlarmReceiver.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java
@@ -1,4 +1,4 @@
-package com.android.godot;
+package org.godotengine.godot;
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller;
diff --git a/platform/android/java/src/com/android/godot/GodotDownloaderService.java b/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java
index 2657edc1d2..6735d387f3 100644
--- a/platform/android/java/src/com/android/godot/GodotDownloaderService.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java
@@ -1,4 +1,4 @@
-package com.android.godot;
+package org.godotengine.godot;
import android.content.Context;
import android.content.SharedPreferences;
diff --git a/platform/android/java/src/com/android/godot/GodotIO.java b/platform/android/java/src/org/godotengine/godot/GodotIO.java
index 7e26fdce5f..3e6919c2ad 100644
--- a/platform/android/java/src/com/android/godot/GodotIO.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotIO.java
@@ -26,7 +26,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-package com.android.godot;
+package org.godotengine.godot;
import java.util.HashMap;
import java.util.Locale;
import android.net.Uri;
@@ -47,7 +47,7 @@ import android.media.*;
import android.hardware.*;
import android.content.*;
import android.content.pm.ActivityInfo;
-import com.android.godot.input.*;
+import org.godotengine.godot.input.*;
//android.os.Build
// Wrapper for native library
diff --git a/platform/android/java/src/com/android/godot/GodotLib.java b/platform/android/java/src/org/godotengine/godot/GodotLib.java
index 4633b55021..aef6591864 100644
--- a/platform/android/java/src/com/android/godot/GodotLib.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotLib.java
@@ -26,7 +26,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-package com.android.godot;
+package org.godotengine.godot;
// Wrapper for native library
diff --git a/platform/android/java/src/com/android/godot/GodotPaymentV3.java b/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java
index 0799e1e83d..6bec49410d 100644
--- a/platform/android/java/src/com/android/godot/GodotPaymentV3.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java
@@ -1,6 +1,6 @@
-package com.android.godot;
+package org.godotengine.godot;
-import com.android.godot.Dictionary;
+import org.godotengine.godot.Dictionary;
import android.app.Activity;
import android.util.Log;
diff --git a/platform/android/java/src/com/android/godot/GodotView.java b/platform/android/java/src/org/godotengine/godot/GodotView.java
index 24dc83a7d9..492eb4cb54 100644
--- a/platform/android/java/src/com/android/godot/GodotView.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotView.java
@@ -26,7 +26,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-package com.android.godot;
+package org.godotengine.godot;
import android.content.Context;
import android.graphics.PixelFormat;
import android.opengl.GLSurfaceView;
diff --git a/platform/android/java/src/com/android/godot/input/GodotEditText.java b/platform/android/java/src/org/godotengine/godot/input/GodotEditText.java
index 5898e95423..c8ffa74ecd 100644
--- a/platform/android/java/src/com/android/godot/input/GodotEditText.java
+++ b/platform/android/java/src/org/godotengine/godot/input/GodotEditText.java
@@ -1,9 +1,9 @@
-package com.android.godot.input;
+package org.godotengine.godot.input;
import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.widget.EditText;
-import com.android.godot.*;
+import org.godotengine.godot.*;
import android.os.Handler;
import android.os.Message;
import android.view.inputmethod.InputMethodManager;
diff --git a/platform/android/java/src/com/android/godot/input/GodotTextInputWrapper.java b/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java
index 537fa6aa76..64d8826b44 100644
--- a/platform/android/java/src/com/android/godot/input/GodotTextInputWrapper.java
+++ b/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java
@@ -1,4 +1,4 @@
-package com.android.godot.input;
+package org.godotengine.godot.input;
import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
@@ -8,7 +8,7 @@ import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
-import com.android.godot.*;
+import org.godotengine.godot.*;
public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListener {
// ===========================================================
diff --git a/platform/android/java/src/com/android/godot/payments/ConsumeTask.java b/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java
index c983960770..61ccb97161 100644
--- a/platform/android/java/src/com/android/godot/payments/ConsumeTask.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java
@@ -1,4 +1,4 @@
-package com.android.godot.payments;
+package org.godotengine.godot.payments;
import com.android.vending.billing.IInAppBillingService;
diff --git a/platform/android/java/src/com/android/godot/payments/GenericConsumeTask.java b/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java
index d68f029246..293e903284 100644
--- a/platform/android/java/src/com/android/godot/payments/GenericConsumeTask.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java
@@ -1,4 +1,4 @@
-package com.android.godot.payments;
+package org.godotengine.godot.payments;
import com.android.vending.billing.IInAppBillingService;
diff --git a/platform/android/java/src/com/android/godot/payments/HandlePurchaseTask.java b/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java
index 4c31704cc8..d120551e4a 100644
--- a/platform/android/java/src/com/android/godot/payments/HandlePurchaseTask.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java
@@ -1,10 +1,10 @@
-package com.android.godot.payments;
+package org.godotengine.godot.payments;
import org.json.JSONException;
import org.json.JSONObject;
-import com.android.godot.GodotLib;
-import com.android.godot.utils.Crypt;
+import org.godotengine.godot.GodotLib;
+import org.godotengine.godot.utils.Crypt;
import com.android.vending.billing.IInAppBillingService;
import android.app.Activity;
diff --git a/platform/android/java/src/com/android/godot/payments/PaymentsCache.java b/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java
index 1de772bf28..5f3d931593 100644
--- a/platform/android/java/src/com/android/godot/payments/PaymentsCache.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java
@@ -1,4 +1,4 @@
-package com.android.godot.payments;
+package org.godotengine.godot.payments;
import android.content.Context;
import android.content.SharedPreferences;
diff --git a/platform/android/java/src/com/android/godot/payments/PaymentsManager.java b/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java
index 189f7108c1..effb58aa35 100644
--- a/platform/android/java/src/com/android/godot/payments/PaymentsManager.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java
@@ -1,4 +1,4 @@
-package com.android.godot.payments;
+package org.godotengine.godot.payments;
import java.util.ArrayList;
import java.util.List;
@@ -17,9 +17,9 @@ import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONStringer;
-import com.android.godot.Dictionary;
-import com.android.godot.Godot;
-import com.android.godot.GodotPaymentV3;
+import org.godotengine.godot.Dictionary;
+import org.godotengine.godot.Godot;
+import org.godotengine.godot.GodotPaymentV3;
import com.android.vending.billing.IInAppBillingService;
public class PaymentsManager {
diff --git a/platform/android/java/src/com/android/godot/payments/PurchaseTask.java b/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java
index c1f9d164a1..8b048d8065 100644
--- a/platform/android/java/src/com/android/godot/payments/PurchaseTask.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java
@@ -1,10 +1,10 @@
-package com.android.godot.payments;
+package org.godotengine.godot.payments;
import org.json.JSONException;
import org.json.JSONObject;
-import com.android.godot.GodotLib;
-import com.android.godot.utils.Crypt;
+import org.godotengine.godot.GodotLib;
+import org.godotengine.godot.utils.Crypt;
import com.android.vending.billing.IInAppBillingService;
import android.app.Activity;
diff --git a/platform/android/java/src/com/android/godot/payments/ReleaseAllConsumablesTask.java b/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java
index c1a9c5d421..7bb5131b49 100644
--- a/platform/android/java/src/com/android/godot/payments/ReleaseAllConsumablesTask.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java
@@ -1,12 +1,12 @@
-package com.android.godot.payments;
+package org.godotengine.godot.payments;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
-import com.android.godot.Dictionary;
-import com.android.godot.Godot;
+import org.godotengine.godot.Dictionary;
+import org.godotengine.godot.Godot;
import com.android.vending.billing.IInAppBillingService;
import android.content.Context;
diff --git a/platform/android/java/src/com/android/godot/payments/ValidateTask.java b/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java
index 6ea415e8a9..2fcf7483b4 100644
--- a/platform/android/java/src/com/android/godot/payments/ValidateTask.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java
@@ -1,14 +1,14 @@
-package com.android.godot.payments;
+package org.godotengine.godot.payments;
import org.json.JSONException;
import org.json.JSONObject;
-import com.android.godot.Godot;
-import com.android.godot.GodotLib;
-import com.android.godot.GodotPaymentV3;
-import com.android.godot.utils.Crypt;
-import com.android.godot.utils.HttpRequester;
-import com.android.godot.utils.RequestParams;
+import org.godotengine.godot.Godot;
+import org.godotengine.godot.GodotLib;
+import org.godotengine.godot.GodotPaymentV3;
+import org.godotengine.godot.utils.Crypt;
+import org.godotengine.godot.utils.HttpRequester;
+import org.godotengine.godot.utils.RequestParams;
import com.android.vending.billing.IInAppBillingService;
import android.app.Activity;
diff --git a/platform/android/java/src/com/android/godot/utils/Crypt.java b/platform/android/java/src/org/godotengine/godot/utils/Crypt.java
index 7801f474b9..2fb81cef8c 100644
--- a/platform/android/java/src/com/android/godot/utils/Crypt.java
+++ b/platform/android/java/src/org/godotengine/godot/utils/Crypt.java
@@ -1,4 +1,4 @@
-package com.android.godot.utils;
+package org.godotengine.godot.utils;
import java.security.MessageDigest;
import java.util.Random;
diff --git a/platform/android/java/src/com/android/godot/utils/CustomSSLSocketFactory.java b/platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java
index 5f2b44fc8c..2db88fcc9b 100644
--- a/platform/android/java/src/com/android/godot/utils/CustomSSLSocketFactory.java
+++ b/platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java
@@ -1,4 +1,4 @@
-package com.android.godot.utils;
+package org.godotengine.godot.utils;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;
diff --git a/platform/android/java/src/com/android/godot/utils/HttpRequester.java b/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java
index 7de77881d0..14346702cc 100644
--- a/platform/android/java/src/com/android/godot/utils/HttpRequester.java
+++ b/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java
@@ -1,4 +1,4 @@
-package com.android.godot.utils;
+package org.godotengine.godot.utils;
import java.io.BufferedReader;
import java.io.IOException;
diff --git a/platform/android/java/src/com/android/godot/utils/RequestParams.java b/platform/android/java/src/org/godotengine/godot/utils/RequestParams.java
index 31bf1940ad..36753e368c 100644
--- a/platform/android/java/src/com/android/godot/utils/RequestParams.java
+++ b/platform/android/java/src/org/godotengine/godot/utils/RequestParams.java
@@ -1,4 +1,4 @@
-package com.android.godot.utils;
+package org.godotengine.godot.utils;
import java.util.ArrayList;
import java.util.Date;
diff --git a/platform/android/java_class_wrapper.cpp b/platform/android/java_class_wrapper.cpp
index d4cf848484..283ea81152 100644
--- a/platform/android/java_class_wrapper.cpp
+++ b/platform/android/java_class_wrapper.cpp
@@ -1281,7 +1281,7 @@ JavaClassWrapper::JavaClassWrapper(jobject p_activity) {
JNIEnv *env = ThreadAndroid::get_env();
- jclass activityClass = env->FindClass("com/android/godot/Godot");
+ jclass activityClass = env->FindClass("org/godotengine/godot/Godot");
jmethodID getClassLoader = env->GetMethodID(activityClass,"getClassLoader", "()Ljava/lang/ClassLoader;");
classLoader = env->CallObjectMethod(p_activity, getClassLoader);
classLoader=(jclass)env->NewGlobalRef(classLoader);
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp
index 4c0c9ed6dc..459cf4c994 100644
--- a/platform/android/java_glue.cpp
+++ b/platform/android/java_glue.cpp
@@ -138,7 +138,7 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant* p_a
case Variant::DICTIONARY: {
Dictionary dict = *p_arg;
- jclass dclass = env->FindClass("com/android/godot/Dictionary");
+ jclass dclass = env->FindClass("org/godotengine/godot/Dictionary");
jmethodID ctor = env->GetMethodID(dclass, "<init>", "()V");
jobject jdict = env->NewObject(dclass, ctor);
@@ -373,7 +373,7 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) {
return varr;
};
- if (name == "java.util.HashMap" || name == "com.android.godot.Dictionary") {
+ if (name == "java.util.HashMap" || name == "org.godotengine.godot.Dictionary") {
Dictionary ret(true);
jclass oclass = c;
@@ -765,7 +765,7 @@ static void _stop_video() {
env->CallVoidMethod(godot_io, _stopVideo);
}
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env, jobject obj, jobject activity,jboolean p_need_reload_hook, jobjectArray p_cmdline,jobject p_asset_manager) {
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * env, jobject obj, jobject activity,jboolean p_need_reload_hook, jobjectArray p_cmdline,jobject p_asset_manager) {
__android_log_print(ANDROID_LOG_INFO,"godot","**INIT EVENT! - %p\n",env);
@@ -783,7 +783,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env,
{
//setup IO Object
- jclass cls = env->FindClass("com/android/godot/Godot");
+ jclass cls = env->FindClass("org/godotengine/godot/Godot");
if (cls) {
cls=(jclass)env->NewGlobalRef(cls);
@@ -791,7 +791,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env,
}
__android_log_print(ANDROID_LOG_INFO,"godot","STEP2, %p",cls);
- jfieldID fid = env->GetStaticFieldID(cls, "io", "Lcom/android/godot/GodotIO;");
+ jfieldID fid = env->GetStaticFieldID(cls, "io", "Lorg/godotengine/godot/GodotIO;");
__android_log_print(ANDROID_LOG_INFO,"godot","STEP3 %i",fid);
jobject ob = env->GetStaticObjectField(cls,fid);
__android_log_print(ANDROID_LOG_INFO,"godot","STEP4, %p",ob);
@@ -802,7 +802,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env,
_on_video_init = env->GetMethodID(cls, "onVideoInit", "(Z)V");
- jclass clsio = env->FindClass("com/android/godot/Godot");
+ jclass clsio = env->FindClass("org/godotengine/godot/Godot");
if (cls) {
jclass c = env->GetObjectClass(gob);
_openURI = env->GetMethodID(c,"openURI","(Ljava/lang/String;)I");
@@ -905,7 +905,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env,
}
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_resize(JNIEnv * env, jobject obj, jint width, jint height, jboolean reload) {
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv * env, jobject obj, jint width, jint height, jboolean reload) {
__android_log_print(ANDROID_LOG_INFO,"godot","^_^_^_^_^ resize %lld, %i, %i\n",Thread::get_caller_ID(),width,height);
if (os_android)
@@ -920,7 +920,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_resize(JNIEnv * env, jobj
}
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_newcontext(JNIEnv * env, jobject obj,bool p_32_bits) {
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv * env, jobject obj,bool p_32_bits) {
__android_log_print(ANDROID_LOG_INFO,"godot","^_^_^_^_^ newcontext %lld\n",Thread::get_caller_ID());
@@ -937,7 +937,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_newcontext(JNIEnv * env,
}
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_quit(JNIEnv * env, jobject obj) {
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_quit(JNIEnv * env, jobject obj) {
input_mutex->lock();
quit_request=true;
@@ -958,7 +958,7 @@ static void _initialize_java_modules() {
JNIEnv *env = ThreadAndroid::get_env();
- jclass activityClass = env->FindClass("com/android/godot/Godot");
+ jclass activityClass = env->FindClass("org/godotengine/godot/Godot");
jmethodID getClassLoader = env->GetMethodID(activityClass,"getClassLoader", "()Ljava/lang/ClassLoader;");
@@ -987,7 +987,7 @@ static void _initialize_java_modules() {
//singletonClass=(jclass)env->NewGlobalRef(singletonClass);
__android_log_print(ANDROID_LOG_INFO,"godot","****^*^*?^*^*class data %x",singletonClass);
- jmethodID initialize = env->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lcom/android/godot/Godot$SingletonBase;");
+ jmethodID initialize = env->GetStaticMethodID(singletonClass, "initialize", "(Landroid/app/Activity;)Lorg/godotengine/godot/Godot$SingletonBase;");
if (!initialize) {
@@ -1007,7 +1007,7 @@ static void _initialize_java_modules() {
}
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_step(JNIEnv * env, jobject obj)
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv * env, jobject obj)
{
@@ -1074,7 +1074,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_step(JNIEnv * env, jobjec
if (os_android->main_loop_iterate()==true) {
- jclass cls = env->FindClass("com/android/godot/Godot");
+ jclass cls = env->FindClass("org/godotengine/godot/Godot");
jmethodID _finish = env->GetMethodID(cls, "forceQuit", "()V");
env->CallVoidMethod(_godot_instance, _finish);
__android_log_print(ANDROID_LOG_INFO,"godot","**FINISH REQUEST!!! - %p-%i\n",env,Thread::get_caller_ID());
@@ -1085,7 +1085,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_step(JNIEnv * env, jobjec
}
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_touch(JNIEnv * env, jobject obj, jint ev,jint pointer, jint count, jintArray positions) {
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_touch(JNIEnv * env, jobject obj, jint ev,jint pointer, jint count, jintArray positions) {
@@ -1390,7 +1390,7 @@ static int find_device(int p_device) {
return joy_device_ids.size() - 1;
};
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_joybutton(JNIEnv * env, jobject obj, jint p_device, jint p_button, jboolean p_pressed) {
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joybutton(JNIEnv * env, jobject obj, jint p_device, jint p_button, jboolean p_pressed) {
InputEvent ievent;
ievent.type = InputEvent::JOYSTICK_BUTTON;
@@ -1403,7 +1403,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_joybutton(JNIEnv * env, j
input_mutex->unlock();
};
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_joyaxis(JNIEnv * env, jobject obj, jint p_device, jint p_axis, jfloat p_value) {
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyaxis(JNIEnv * env, jobject obj, jint p_device, jint p_axis, jfloat p_value) {
InputEvent ievent;
ievent.type = InputEvent::JOYSTICK_MOTION;
@@ -1417,7 +1417,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_joyaxis(JNIEnv * env, job
};
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_key(JNIEnv * env, jobject obj, jint p_scancode, jint p_unicode_char, jboolean p_pressed) {
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_key(JNIEnv * env, jobject obj, jint p_scancode, jint p_unicode_char, jboolean p_pressed) {
InputEvent ievent;
ievent.type = InputEvent::KEY;
@@ -1455,7 +1455,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_key(JNIEnv * env, jobject
};
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_accelerometer(JNIEnv * env, jobject obj, jfloat x, jfloat y, jfloat z) {
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_accelerometer(JNIEnv * env, jobject obj, jfloat x, jfloat y, jfloat z) {
input_mutex->lock();
accelerometer=Vector3(x,y,z);
@@ -1463,7 +1463,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_accelerometer(JNIEnv * en
}
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_focusin(JNIEnv * env, jobject obj){
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusin(JNIEnv * env, jobject obj){
if (!suspend_mutex)
return;
@@ -1475,7 +1475,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_focusin(JNIEnv * env, job
suspend_mutex->unlock();
}
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_focusout(JNIEnv * env, jobject obj){
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusout(JNIEnv * env, jobject obj){
if (!suspend_mutex)
return;
@@ -1490,7 +1490,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_focusout(JNIEnv * env, jo
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_audio(JNIEnv * env, jobject obj) {
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_audio(JNIEnv * env, jobject obj) {
ThreadAndroid::setup_thread();
AudioDriverAndroid::thread_func(env);
@@ -1499,7 +1499,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_audio(JNIEnv * env, jobje
}
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_singleton(JNIEnv * env, jobject obj, jstring name,jobject p_object){
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_singleton(JNIEnv * env, jobject obj, jstring name,jobject p_object){
String singname = env->GetStringUTFChars( name, NULL );
JNISingleton *s = memnew( JNISingleton );
@@ -1528,7 +1528,7 @@ static Variant::Type get_jni_type(const String& p_type) {
{"[B",Variant::RAW_ARRAY},
{"[F",Variant::REAL_ARRAY},
{"[java.lang.String",Variant::STRING_ARRAY},
- {"com.android.godot.Dictionary", Variant::DICTIONARY},
+ {"org.godotengine.godot.Dictionary", Variant::DICTIONARY},
{NULL,Variant::NIL}
};
@@ -1559,7 +1559,7 @@ static const char* get_jni_sig(const String& p_type) {
{"float","F"},
{"double","D"},
{"java.lang.String","Ljava/lang/String;"},
- {"com.android.godot.Dictionary", "Lcom/android/godot/Dictionary;"},
+ {"org.godotengine.godot.Dictionary", "Lorg/godotengine/godot/Dictionary;"},
{"[I","[I"},
{"[B","[B"},
{"[F","[F"},
@@ -1581,7 +1581,7 @@ static const char* get_jni_sig(const String& p_type) {
return "Ljava/lang/Object;";
}
-JNIEXPORT jstring JNICALL Java_com_android_godot_GodotLib_getGlobal(JNIEnv * env, jobject obj, jstring path) {
+JNIEXPORT jstring JNICALL Java_org_godotengine_godot_GodotLib_getGlobal(JNIEnv * env, jobject obj, jstring path) {
String js = env->GetStringUTFChars( path, NULL );
@@ -1591,7 +1591,7 @@ JNIEXPORT jstring JNICALL Java_com_android_godot_GodotLib_getGlobal(JNIEnv * env
}
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_method(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args){
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_method(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args){
String singname = env->GetStringUTFChars( sname, NULL );
@@ -1632,7 +1632,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_method(JNIEnv * env, jobj
}
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_callobject(JNIEnv * env, jobject p_obj, jint ID, jstring method, jobjectArray params) {
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv * env, jobject p_obj, jint ID, jstring method, jobjectArray params) {
Object* obj = ObjectDB::get_instance(ID);
ERR_FAIL_COND(!obj);
@@ -1667,7 +1667,7 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_callobject(JNIEnv * env,
};
-JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_calldeferred(JNIEnv * env, jobject p_obj, jint ID, jstring method, jobjectArray params) {
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv * env, jobject p_obj, jint ID, jstring method, jobjectArray params) {
Object* obj = ObjectDB::get_instance(ID);
diff --git a/platform/android/java_glue.h b/platform/android/java_glue.h
index 0eae4cf418..efa5b2839d 100644
--- a/platform/android/java_glue.h
+++ b/platform/android/java_glue.h
@@ -36,24 +36,24 @@
extern "C" {
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env, jobject obj, jobject activity,jboolean p_need_reload_hook, jobjectArray p_cmdline,jobject p_asset_manager);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_resize(JNIEnv * env, jobject obj, jint width, jint height, jboolean reload);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_newcontext(JNIEnv * env, jobject obj, bool p_32_bits);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_step(JNIEnv * env, jobject obj);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_quit(JNIEnv * env, jobject obj);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_touch(JNIEnv * env, jobject obj, jint ev,jint pointer, jint count, jintArray positions);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_key(JNIEnv * env, jobject obj, jint p_scancode, jint p_unicode_char, jboolean p_pressed);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_joybutton(JNIEnv * env, jobject obj, jint p_device, jint p_button, jboolean p_pressed);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_joyaxis(JNIEnv * env, jobject obj, jint p_device, jint p_axis, jfloat p_value);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_audio(JNIEnv * env, jobject obj);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_accelerometer(JNIEnv * env, jobject obj, jfloat x, jfloat y, jfloat z);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_focusin(JNIEnv * env, jobject obj);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_focusout(JNIEnv * env, jobject obj);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_singleton(JNIEnv * env, jobject obj, jstring name,jobject p_object);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_method(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args);
- JNIEXPORT jstring JNICALL Java_com_android_godot_GodotLib_getGlobal(JNIEnv * env, jobject obj, jstring path);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_callobject(JNIEnv * env, jobject obj, jint ID, jstring method, jobjectArray params);
- JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_calldeferred(JNIEnv * env, jobject obj, jint ID, jstring method, jobjectArray params);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * env, jobject obj, jobject activity,jboolean p_need_reload_hook, jobjectArray p_cmdline,jobject p_asset_manager);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv * env, jobject obj, jint width, jint height, jboolean reload);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv * env, jobject obj, bool p_32_bits);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv * env, jobject obj);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_quit(JNIEnv * env, jobject obj);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_touch(JNIEnv * env, jobject obj, jint ev,jint pointer, jint count, jintArray positions);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_key(JNIEnv * env, jobject obj, jint p_scancode, jint p_unicode_char, jboolean p_pressed);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joybutton(JNIEnv * env, jobject obj, jint p_device, jint p_button, jboolean p_pressed);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyaxis(JNIEnv * env, jobject obj, jint p_device, jint p_axis, jfloat p_value);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_audio(JNIEnv * env, jobject obj);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_accelerometer(JNIEnv * env, jobject obj, jfloat x, jfloat y, jfloat z);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusin(JNIEnv * env, jobject obj);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusout(JNIEnv * env, jobject obj);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_singleton(JNIEnv * env, jobject obj, jstring name,jobject p_object);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_method(JNIEnv * env, jobject obj, jstring sname, jstring name, jstring ret, jobjectArray args);
+ JNIEXPORT jstring JNICALL Java_org_godotengine_godot_GodotLib_getGlobal(JNIEnv * env, jobject obj, jstring path);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_callobject(JNIEnv * env, jobject obj, jint ID, jstring method, jobjectArray params);
+ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv * env, jobject obj, jint ID, jstring method, jobjectArray params);
};
diff --git a/platform/android/libs/apk_expansion/AndroidManifest.xml b/platform/android/libs/apk_expansion/AndroidManifest.xml
deleted file mode 100644
index 20b74a2988..0000000000
--- a/platform/android/libs/apk_expansion/AndroidManifest.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.vending.expansion.downloader"
- android:versionCode="2"
- android:versionName="1.1" >
-
- <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15"/>
-
-</manifest> \ No newline at end of file
diff --git a/platform/android/libs/apk_expansion/build.xml b/platform/android/libs/apk_expansion/build.xml
deleted file mode 100644
index 5b2f2c590e..0000000000
--- a/platform/android/libs/apk_expansion/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="apk_expansion" default="help">
-
- <!-- The local.properties file is created and updated by the 'android' tool.
- It contains the path to the SDK. It should *NOT* be checked into
- Version Control Systems. -->
- <property file="local.properties" />
-
- <!-- The ant.properties file can be created by you. It is only edited by the
- 'android' tool to add properties to it.
- This is the place to change some Ant specific build properties.
- Here are some properties you may want to change/update:
-
- source.dir
- The name of the source directory. Default is 'src'.
- out.dir
- The name of the output directory. Default is 'bin'.
-
- For other overridable properties, look at the beginning of the rules
- files in the SDK, at tools/ant/build.xml
-
- Properties related to the SDK location or the project target should
- be updated using the 'android' tool with the 'update' action.
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems.
-
- -->
- <property file="ant.properties" />
-
- <!-- if sdk.dir was not set from one of the property file, then
- get it from the ANDROID_HOME env var.
- This must be done before we load project.properties since
- the proguard config can use sdk.dir -->
- <property environment="env" />
- <condition property="sdk.dir" value="${env.ANDROID_HOME}">
- <isset property="env.ANDROID_HOME" />
- </condition>
-
- <!-- The project.properties file is created and updated by the 'android'
- tool, as well as ADT.
-
- This contains project specific properties such as project target, and library
- dependencies. Lower level build properties are stored in ant.properties
- (or in .classpath for Eclipse projects).
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems. -->
- <loadproperties srcFile="project.properties" />
-
- <!-- quick check on sdk.dir -->
- <fail
- message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
- unless="sdk.dir"
- />
-
- <!--
- Import per project custom build rules if present at the root of the project.
- This is the place to put custom intermediary targets such as:
- -pre-build
- -pre-compile
- -post-compile (This is typically used for code obfuscation.
- Compiled code location: ${out.classes.absolute.dir}
- If this is not done in place, override ${out.dex.input.absolute.dir})
- -post-package
- -post-build
- -pre-clean
- -->
- <import file="custom_rules.xml" optional="true" />
-
- <!-- Import the actual build file.
-
- To customize existing targets, there are two options:
- - Customize only one target:
- - copy/paste the target into this file, *before* the
- <import> task.
- - customize it to your needs.
- - Customize the whole content of build.xml
- - copy/paste the content of the rules files (minus the top node)
- into this file, replacing the <import> task.
- - customize to your needs.
-
- ***********************
- ****** IMPORTANT ******
- ***********************
- In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
- in order to avoid having your file be overridden by tools such as "android update project"
- -->
- <!-- version-tag: 1 -->
- <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
diff --git a/platform/android/libs/apk_expansion/proguard-project.txt b/platform/android/libs/apk_expansion/proguard-project.txt
deleted file mode 100644
index f2fe1559a2..0000000000
--- a/platform/android/libs/apk_expansion/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/platform/android/libs/apk_expansion/project.properties b/platform/android/libs/apk_expansion/project.properties
deleted file mode 100644
index eda83430bf..0000000000
--- a/platform/android/libs/apk_expansion/project.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-15
-android.library=true
-android.library.reference.1=../play_licensing
diff --git a/platform/android/libs/apk_expansion/res/values/strings.xml b/platform/android/libs/apk_expansion/res/values/strings.xml
deleted file mode 100644
index b84749faf2..0000000000
--- a/platform/android/libs/apk_expansion/res/values/strings.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <!-- When a download completes, a notification is displayed, and this
- string is used to indicate that the download successfully completed.
- Note that such a download could have been initiated by a variety of
- applications, including (but not limited to) the browser, an email
- application, a content marketplace. -->
- <string name="notification_download_complete">Download complete</string>
-
- <!-- When a download completes, a notification is displayed, and this
- string is used to indicate that the download failed.
- Note that such a download could have been initiated by a variety of
- applications, including (but not limited to) the browser, an email
- application, a content marketplace. -->
- <string name="notification_download_failed">Download unsuccessful</string>
-
-
- <string name="state_unknown">Starting..."</string>
- <string name="state_idle">Waiting for download to start</string>
- <string name="state_fetching_url">Looking for resources to download</string>
- <string name="state_connecting">Connecting to the download server</string>
- <string name="state_downloading">Downloading resources</string>
- <string name="state_completed">Download finished</string>
- <string name="state_paused_network_unavailable">Download paused because no network is available</string>
- <string name="state_paused_network_setup_failure">Download paused. Test a website in browser</string>
- <string name="state_paused_by_request">Download paused</string>
- <string name="state_paused_wifi_unavailable">Download paused because wifi is unavailable</string>
- <string name="state_paused_wifi_disabled">Download paused because wifi is disabled</string>
- <string name="state_paused_roaming">Download paused because you are roaming</string>
- <string name="state_paused_sdcard_unavailable">Download paused because the external storage is unavailable</string>
- <string name="state_failed_unlicensed">Download failed because you may not have purchased this app</string>
- <string name="state_failed_fetching_url">Download failed because the resources could not be found</string>
- <string name="state_failed_sdcard_full">Download failed because the external storage is full</string>
- <string name="state_failed_cancelled">Download cancelled</string>
- <string name="state_failed">Download failed</string>
-
- <string name="kilobytes_per_second">%1$s KB/s</string>
- <string name="time_remaining">Time remaining: %1$s</string>
- <string name="time_remaining_notification">%1$s left</string>
-</resources> \ No newline at end of file
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java b/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java
deleted file mode 100644
index eef205d7b7..0000000000
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader.impl;
-
-import com.android.vending.expansion.downloader.R;
-import com.google.android.vending.expansion.downloader.DownloadProgressInfo;
-import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller;
-import com.google.android.vending.expansion.downloader.Helpers;
-import com.google.android.vending.expansion.downloader.IDownloaderClient;
-
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.content.Context;
-import android.os.Messenger;
-
-/**
- * This class handles displaying the notification associated with the download
- * queue going on in the download manager. It handles multiple status types;
- * Some require user interaction and some do not. Some of the user interactions
- * may be transient. (for example: the user is queried to continue the download
- * on 3G when it started on WiFi, but then the phone locks onto WiFi again so
- * the prompt automatically goes away)
- * <p/>
- * The application interface for the downloader also needs to understand and
- * handle these transient states.
- */
-public class DownloadNotification implements IDownloaderClient {
-
- private int mState;
- private final Context mContext;
- private final NotificationManager mNotificationManager;
- private String mCurrentTitle;
-
- private IDownloaderClient mClientProxy;
- final ICustomNotification mCustomNotification;
- private Notification mNotification;
- private Notification mCurrentNotification;
- private CharSequence mLabel;
- private String mCurrentText;
- private PendingIntent mContentIntent;
- private DownloadProgressInfo mProgressInfo;
-
- static final String LOGTAG = "DownloadNotification";
- static final int NOTIFICATION_ID = LOGTAG.hashCode();
-
- public PendingIntent getClientIntent() {
- return mContentIntent;
- }
-
- public void setClientIntent(PendingIntent mClientIntent) {
- this.mContentIntent = mClientIntent;
- }
-
- public void resendState() {
- if (null != mClientProxy) {
- mClientProxy.onDownloadStateChanged(mState);
- }
- }
-
- @Override
- public void onDownloadStateChanged(int newState) {
- if (null != mClientProxy) {
- mClientProxy.onDownloadStateChanged(newState);
- }
- if (newState != mState) {
- mState = newState;
- if (newState == IDownloaderClient.STATE_IDLE || null == mContentIntent) {
- return;
- }
- int stringDownloadID;
- int iconResource;
- boolean ongoingEvent;
-
- // get the new title string and paused text
- switch (newState) {
- case 0:
- iconResource = android.R.drawable.stat_sys_warning;
- stringDownloadID = R.string.state_unknown;
- ongoingEvent = false;
- break;
-
- case IDownloaderClient.STATE_DOWNLOADING:
- iconResource = android.R.drawable.stat_sys_download;
- stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState);
- ongoingEvent = true;
- break;
-
- case IDownloaderClient.STATE_FETCHING_URL:
- case IDownloaderClient.STATE_CONNECTING:
- iconResource = android.R.drawable.stat_sys_download_done;
- stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState);
- ongoingEvent = true;
- break;
-
- case IDownloaderClient.STATE_COMPLETED:
- case IDownloaderClient.STATE_PAUSED_BY_REQUEST:
- iconResource = android.R.drawable.stat_sys_download_done;
- stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState);
- ongoingEvent = false;
- break;
-
- case IDownloaderClient.STATE_FAILED:
- case IDownloaderClient.STATE_FAILED_CANCELED:
- case IDownloaderClient.STATE_FAILED_FETCHING_URL:
- case IDownloaderClient.STATE_FAILED_SDCARD_FULL:
- case IDownloaderClient.STATE_FAILED_UNLICENSED:
- iconResource = android.R.drawable.stat_sys_warning;
- stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState);
- ongoingEvent = false;
- break;
-
- default:
- iconResource = android.R.drawable.stat_sys_warning;
- stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState);
- ongoingEvent = true;
- break;
- }
- mCurrentText = mContext.getString(stringDownloadID);
- mCurrentTitle = mLabel.toString();
- mCurrentNotification.tickerText = mLabel + ": " + mCurrentText;
- mCurrentNotification.icon = iconResource;
- mCurrentNotification.setLatestEventInfo(mContext, mCurrentTitle, mCurrentText,
- mContentIntent);
- if (ongoingEvent) {
- mCurrentNotification.flags |= Notification.FLAG_ONGOING_EVENT;
- } else {
- mCurrentNotification.flags &= ~Notification.FLAG_ONGOING_EVENT;
- mCurrentNotification.flags |= Notification.FLAG_AUTO_CANCEL;
- }
- mNotificationManager.notify(NOTIFICATION_ID, mCurrentNotification);
- }
- }
-
- @Override
- public void onDownloadProgress(DownloadProgressInfo progress) {
- mProgressInfo = progress;
- if (null != mClientProxy) {
- mClientProxy.onDownloadProgress(progress);
- }
- if (progress.mOverallTotal <= 0) {
- // we just show the text
- mNotification.tickerText = mCurrentTitle;
- mNotification.icon = android.R.drawable.stat_sys_download;
- mNotification.setLatestEventInfo(mContext, mLabel, mCurrentText, mContentIntent);
- mCurrentNotification = mNotification;
- } else {
- mCustomNotification.setCurrentBytes(progress.mOverallProgress);
- mCustomNotification.setTotalBytes(progress.mOverallTotal);
- mCustomNotification.setIcon(android.R.drawable.stat_sys_download);
- mCustomNotification.setPendingIntent(mContentIntent);
- mCustomNotification.setTicker(mLabel + ": " + mCurrentText);
- mCustomNotification.setTitle(mLabel);
- mCustomNotification.setTimeRemaining(progress.mTimeRemaining);
- mCurrentNotification = mCustomNotification.updateNotification(mContext);
- }
- mNotificationManager.notify(NOTIFICATION_ID, mCurrentNotification);
- }
-
- public interface ICustomNotification {
- void setTitle(CharSequence title);
-
- void setTicker(CharSequence ticker);
-
- void setPendingIntent(PendingIntent mContentIntent);
-
- void setTotalBytes(long totalBytes);
-
- void setCurrentBytes(long currentBytes);
-
- void setIcon(int iconResource);
-
- void setTimeRemaining(long timeRemaining);
-
- Notification updateNotification(Context c);
- }
-
- /**
- * Called in response to onClientUpdated. Creates a new proxy and notifies
- * it of the current state.
- *
- * @param msg the client Messenger to notify
- */
- public void setMessenger(Messenger msg) {
- mClientProxy = DownloaderClientMarshaller.CreateProxy(msg);
- if (null != mProgressInfo) {
- mClientProxy.onDownloadProgress(mProgressInfo);
- }
- if (mState != -1) {
- mClientProxy.onDownloadStateChanged(mState);
- }
- }
-
- /**
- * Constructor
- *
- * @param ctx The context to use to obtain access to the Notification
- * Service
- */
- DownloadNotification(Context ctx, CharSequence applicationLabel) {
- mState = -1;
- mContext = ctx;
- mLabel = applicationLabel;
- mNotificationManager = (NotificationManager)
- mContext.getSystemService(Context.NOTIFICATION_SERVICE);
- mCustomNotification = CustomNotificationFactory
- .createCustomNotification();
- mNotification = new Notification();
- mCurrentNotification = mNotification;
-
- }
-
- @Override
- public void onServiceConnected(Messenger m) {
- }
-
-}
diff --git a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java b/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java
deleted file mode 100644
index e736603e2a..0000000000
--- a/platform/android/libs/apk_expansion/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader.impl;
-
-import com.android.vending.expansion.downloader.R;
-import com.google.android.vending.expansion.downloader.Helpers;
-
-import android.app.Notification;
-import android.app.PendingIntent;
-import android.content.Context;
-
-public class V14CustomNotification implements DownloadNotification.ICustomNotification {
-
- CharSequence mTitle;
- CharSequence mTicker;
- int mIcon;
- long mTotalKB = -1;
- long mCurrentKB = -1;
- long mTimeRemaining;
- PendingIntent mPendingIntent;
-
- @Override
- public void setIcon(int icon) {
- mIcon = icon;
- }
-
- @Override
- public void setTitle(CharSequence title) {
- mTitle = title;
- }
-
- @Override
- public void setTotalBytes(long totalBytes) {
- mTotalKB = totalBytes;
- }
-
- @Override
- public void setCurrentBytes(long currentBytes) {
- mCurrentKB = currentBytes;
- }
-
- void setProgress(Notification.Builder builder) {
-
- }
-
- @Override
- public Notification updateNotification(Context c) {
- Notification.Builder builder = new Notification.Builder(c);
- builder.setContentTitle(mTitle);
- if (mTotalKB > 0 && -1 != mCurrentKB) {
- builder.setProgress((int) (mTotalKB >> 8), (int) (mCurrentKB >> 8), false);
- } else {
- builder.setProgress(0, 0, true);
- }
- builder.setContentText(Helpers.getDownloadProgressString(mCurrentKB, mTotalKB));
- builder.setContentInfo(c.getString(R.string.time_remaining_notification,
- Helpers.getTimeRemaining(mTimeRemaining)));
- if (mIcon != 0) {
- builder.setSmallIcon(mIcon);
- } else {
- int iconResource = android.R.drawable.stat_sys_download;
- builder.setSmallIcon(iconResource);
- }
- builder.setOngoing(true);
- builder.setTicker(mTicker);
- builder.setContentIntent(mPendingIntent);
- builder.setOnlyAlertOnce(true);
-
- return builder.getNotification();
- }
-
- @Override
- public void setPendingIntent(PendingIntent contentIntent) {
- mPendingIntent = contentIntent;
- }
-
- @Override
- public void setTicker(CharSequence ticker) {
- mTicker = ticker;
- }
-
- @Override
- public void setTimeRemaining(long timeRemaining) {
- mTimeRemaining = timeRemaining;
- }
-
-}
diff --git a/platform/android/libs/downloader_library/.classpath b/platform/android/libs/downloader_library/.classpath
deleted file mode 100644
index 7bc01d9a9c..0000000000
--- a/platform/android/libs/downloader_library/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
- <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
- <classpathentry kind="output" path="bin/classes"/>
-</classpath>
diff --git a/platform/android/libs/downloader_library/.settings/org.eclipse.jdt.core.prefs b/platform/android/libs/downloader_library/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b080d2ddc8..0000000000
--- a/platform/android/libs/downloader_library/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/platform/android/libs/downloader_library/AndroidManifest.xml b/platform/android/libs/downloader_library/AndroidManifest.xml
deleted file mode 100644
index 20b74a2988..0000000000
--- a/platform/android/libs/downloader_library/AndroidManifest.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.vending.expansion.downloader"
- android:versionCode="2"
- android:versionName="1.1" >
-
- <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15"/>
-
-</manifest> \ No newline at end of file
diff --git a/platform/android/libs/downloader_library/build.xml b/platform/android/libs/downloader_library/build.xml
deleted file mode 100644
index d65c145148..0000000000
--- a/platform/android/libs/downloader_library/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="downloader_library" default="help">
-
- <!-- The local.properties file is created and updated by the 'android' tool.
- It contains the path to the SDK. It should *NOT* be checked into
- Version Control Systems. -->
- <property file="local.properties" />
-
- <!-- The ant.properties file can be created by you. It is only edited by the
- 'android' tool to add properties to it.
- This is the place to change some Ant specific build properties.
- Here are some properties you may want to change/update:
-
- source.dir
- The name of the source directory. Default is 'src'.
- out.dir
- The name of the output directory. Default is 'bin'.
-
- For other overridable properties, look at the beginning of the rules
- files in the SDK, at tools/ant/build.xml
-
- Properties related to the SDK location or the project target should
- be updated using the 'android' tool with the 'update' action.
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems.
-
- -->
- <property file="ant.properties" />
-
- <!-- if sdk.dir was not set from one of the property file, then
- get it from the ANDROID_HOME env var.
- This must be done before we load project.properties since
- the proguard config can use sdk.dir -->
- <property environment="env" />
- <condition property="sdk.dir" value="${env.ANDROID_HOME}">
- <isset property="env.ANDROID_HOME" />
- </condition>
-
- <!-- The project.properties file is created and updated by the 'android'
- tool, as well as ADT.
-
- This contains project specific properties such as project target, and library
- dependencies. Lower level build properties are stored in ant.properties
- (or in .classpath for Eclipse projects).
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems. -->
- <loadproperties srcFile="project.properties" />
-
- <!-- quick check on sdk.dir -->
- <fail
- message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
- unless="sdk.dir"
- />
-
- <!--
- Import per project custom build rules if present at the root of the project.
- This is the place to put custom intermediary targets such as:
- -pre-build
- -pre-compile
- -post-compile (This is typically used for code obfuscation.
- Compiled code location: ${out.classes.absolute.dir}
- If this is not done in place, override ${out.dex.input.absolute.dir})
- -post-package
- -post-build
- -pre-clean
- -->
- <import file="custom_rules.xml" optional="true" />
-
- <!-- Import the actual build file.
-
- To customize existing targets, there are two options:
- - Customize only one target:
- - copy/paste the target into this file, *before* the
- <import> task.
- - customize it to your needs.
- - Customize the whole content of build.xml
- - copy/paste the content of the rules files (minus the top node)
- into this file, replacing the <import> task.
- - customize to your needs.
-
- ***********************
- ****** IMPORTANT ******
- ***********************
- In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
- in order to avoid having your file be overridden by tools such as "android update project"
- -->
- <!-- version-tag: 1 -->
- <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
diff --git a/platform/android/libs/downloader_library/proguard-project.txt b/platform/android/libs/downloader_library/proguard-project.txt
deleted file mode 100644
index f2fe1559a2..0000000000
--- a/platform/android/libs/downloader_library/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/platform/android/libs/downloader_library/project.properties b/platform/android/libs/downloader_library/project.properties
deleted file mode 100644
index eda83430bf..0000000000
--- a/platform/android/libs/downloader_library/project.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-15
-android.library=true
-android.library.reference.1=../play_licensing
diff --git a/platform/android/libs/downloader_library/res/drawable-hdpi/notify_panel_notification_icon_bg.png b/platform/android/libs/downloader_library/res/drawable-hdpi/notify_panel_notification_icon_bg.png
deleted file mode 100644
index f5b762ecf3..0000000000
--- a/platform/android/libs/downloader_library/res/drawable-hdpi/notify_panel_notification_icon_bg.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/downloader_library/res/drawable-mdpi/notify_panel_notification_icon_bg.png b/platform/android/libs/downloader_library/res/drawable-mdpi/notify_panel_notification_icon_bg.png
deleted file mode 100644
index 9ecb8af06c..0000000000
--- a/platform/android/libs/downloader_library/res/drawable-mdpi/notify_panel_notification_icon_bg.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/downloader_library/res/layout/status_bar_ongoing_event_progress_bar.xml b/platform/android/libs/downloader_library/res/layout/status_bar_ongoing_event_progress_bar.xml
deleted file mode 100644
index 23bac02294..0000000000
--- a/platform/android/libs/downloader_library/res/layout/status_bar_ongoing_event_progress_bar.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2008, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<LinearLayout android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:baselineAligned="false"
- android:orientation="horizontal" android:id="@+id/notificationLayout" xmlns:android="http://schemas.android.com/apk/res/android">
-
- <RelativeLayout
- android:layout_width="35dp"
- android:layout_height="fill_parent"
- android:paddingTop="10dp"
- android:paddingBottom="8dp" >
-
- <ImageView
- android:id="@+id/appIcon"
- android:layout_width="fill_parent"
- android:layout_height="25dp"
- android:scaleType="centerInside"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:src="@android:drawable/stat_sys_download" />
-
- <TextView
- android:id="@+id/progress_text"
- style="@style/NotificationText"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentBottom="true"
- android:layout_gravity="center_horizontal"
- android:singleLine="true"
- android:gravity="center" />
- </RelativeLayout>
-
- <RelativeLayout
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1.0"
- android:clickable="true"
- android:focusable="true"
- android:paddingTop="10dp"
- android:paddingRight="8dp"
- android:paddingBottom="8dp" >
-
- <TextView
- android:id="@+id/title"
- style="@style/NotificationTitle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:singleLine="true"/>
-
- <TextView
- android:id="@+id/time_remaining"
- style="@style/NotificationText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:singleLine="true"/>
- <!-- Only one of progress_bar and paused_text will be visible. -->
-
- <FrameLayout
- android:id="@+id/progress_bar_frame"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true" >
-
- <ProgressBar
- android:id="@+id/progress_bar"
- style="?android:attr/progressBarStyleHorizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:paddingRight="25dp" />
-
- <TextView
- android:id="@+id/description"
- style="@style/NotificationTextShadow"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:paddingRight="25dp"
- android:singleLine="true" />
- </FrameLayout>
-
- </RelativeLayout>
-
-</LinearLayout> \ No newline at end of file
diff --git a/platform/android/libs/downloader_library/res/values-v11/styles.xml b/platform/android/libs/downloader_library/res/values-v11/styles.xml
deleted file mode 100644
index f2013bc0bf..0000000000
--- a/platform/android/libs/downloader_library/res/values-v11/styles.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <style name="NotificationTextSecondary" parent="NotificationText">
- <item name="android:textSize">12sp</item>
- </style>
-</resources> \ No newline at end of file
diff --git a/platform/android/libs/downloader_library/res/values-v9/styles.xml b/platform/android/libs/downloader_library/res/values-v9/styles.xml
deleted file mode 100644
index 736e77a5d6..0000000000
--- a/platform/android/libs/downloader_library/res/values-v9/styles.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <style name="NotificationText" parent="android:TextAppearance.StatusBar.EventContent" />
- <style name="NotificationTitle" parent="android:TextAppearance.StatusBar.EventContent.Title" />
-</resources> \ No newline at end of file
diff --git a/platform/android/libs/downloader_library/res/values/strings.xml b/platform/android/libs/downloader_library/res/values/strings.xml
deleted file mode 100644
index b84749faf2..0000000000
--- a/platform/android/libs/downloader_library/res/values/strings.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <!-- When a download completes, a notification is displayed, and this
- string is used to indicate that the download successfully completed.
- Note that such a download could have been initiated by a variety of
- applications, including (but not limited to) the browser, an email
- application, a content marketplace. -->
- <string name="notification_download_complete">Download complete</string>
-
- <!-- When a download completes, a notification is displayed, and this
- string is used to indicate that the download failed.
- Note that such a download could have been initiated by a variety of
- applications, including (but not limited to) the browser, an email
- application, a content marketplace. -->
- <string name="notification_download_failed">Download unsuccessful</string>
-
-
- <string name="state_unknown">Starting..."</string>
- <string name="state_idle">Waiting for download to start</string>
- <string name="state_fetching_url">Looking for resources to download</string>
- <string name="state_connecting">Connecting to the download server</string>
- <string name="state_downloading">Downloading resources</string>
- <string name="state_completed">Download finished</string>
- <string name="state_paused_network_unavailable">Download paused because no network is available</string>
- <string name="state_paused_network_setup_failure">Download paused. Test a website in browser</string>
- <string name="state_paused_by_request">Download paused</string>
- <string name="state_paused_wifi_unavailable">Download paused because wifi is unavailable</string>
- <string name="state_paused_wifi_disabled">Download paused because wifi is disabled</string>
- <string name="state_paused_roaming">Download paused because you are roaming</string>
- <string name="state_paused_sdcard_unavailable">Download paused because the external storage is unavailable</string>
- <string name="state_failed_unlicensed">Download failed because you may not have purchased this app</string>
- <string name="state_failed_fetching_url">Download failed because the resources could not be found</string>
- <string name="state_failed_sdcard_full">Download failed because the external storage is full</string>
- <string name="state_failed_cancelled">Download cancelled</string>
- <string name="state_failed">Download failed</string>
-
- <string name="kilobytes_per_second">%1$s KB/s</string>
- <string name="time_remaining">Time remaining: %1$s</string>
- <string name="time_remaining_notification">%1$s left</string>
-</resources> \ No newline at end of file
diff --git a/platform/android/libs/downloader_library/res/values/styles.xml b/platform/android/libs/downloader_library/res/values/styles.xml
deleted file mode 100644
index a442f61e7e..0000000000
--- a/platform/android/libs/downloader_library/res/values/styles.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <style name="NotificationText">
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- </style>
-
- <style name="NotificationTextShadow" parent="NotificationText">
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- <item name="android:shadowColor">@android:color/background_dark</item>
- <item name="android:shadowDx">1.0</item>
- <item name="android:shadowDy">1.0</item>
- <item name="android:shadowRadius">1</item>
- </style>
-
- <style name="NotificationTitle">
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- <item name="android:textStyle">bold</item>
- </style>
-
- <style name="ButtonBackground">
- <item name="android:background">@android:color/background_dark</item>
- </style>
-
-</resources> \ No newline at end of file
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Constants.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Constants.java
deleted file mode 100644
index ff2c6f535a..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Constants.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader;
-
-import java.io.File;
-
-
-/**
- * Contains the internal constants that are used in the download manager.
- * As a general rule, modifying these constants should be done with care.
- */
-public class Constants {
- /** Tag used for debugging/logging */
- public static final String TAG = "LVLDL";
-
- /**
- * Expansion path where we store obb files
- */
- public static final String EXP_PATH = File.separator + "Android"
- + File.separator + "obb" + File.separator;
-
- /** The intent that gets sent when the service must wake up for a retry */
- public static final String ACTION_RETRY = "android.intent.action.DOWNLOAD_WAKEUP";
-
- /** the intent that gets sent when clicking a successful download */
- public static final String ACTION_OPEN = "android.intent.action.DOWNLOAD_OPEN";
-
- /** the intent that gets sent when clicking an incomplete/failed download */
- public static final String ACTION_LIST = "android.intent.action.DOWNLOAD_LIST";
-
- /** the intent that gets sent when deleting the notification of a completed download */
- public static final String ACTION_HIDE = "android.intent.action.DOWNLOAD_HIDE";
-
- /**
- * When a number has to be appended to the filename, this string is used to separate the
- * base filename from the sequence number
- */
- public static final String FILENAME_SEQUENCE_SEPARATOR = "-";
-
- /** The default user agent used for downloads */
- public static final String DEFAULT_USER_AGENT = "Android.LVLDM";
-
- /** The buffer size used to stream the data */
- public static final int BUFFER_SIZE = 4096;
-
- /** The minimum amount of progress that has to be done before the progress bar gets updated */
- public static final int MIN_PROGRESS_STEP = 4096;
-
- /** The minimum amount of time that has to elapse before the progress bar gets updated, in ms */
- public static final long MIN_PROGRESS_TIME = 1000;
-
- /** The maximum number of rows in the database (FIFO) */
- public static final int MAX_DOWNLOADS = 1000;
-
- /**
- * The number of times that the download manager will retry its network
- * operations when no progress is happening before it gives up.
- */
- public static final int MAX_RETRIES = 5;
-
- /**
- * The minimum amount of time that the download manager accepts for
- * a Retry-After response header with a parameter in delta-seconds.
- */
- public static final int MIN_RETRY_AFTER = 30; // 30s
-
- /**
- * The maximum amount of time that the download manager accepts for
- * a Retry-After response header with a parameter in delta-seconds.
- */
- public static final int MAX_RETRY_AFTER = 24 * 60 * 60; // 24h
-
- /**
- * The maximum number of redirects.
- */
- public static final int MAX_REDIRECTS = 5; // can't be more than 7.
-
- /**
- * The time between a failure and the first retry after an IOException.
- * Each subsequent retry grows exponentially, doubling each time.
- * The time is in seconds.
- */
- public static final int RETRY_FIRST_DELAY = 30;
-
- /** Enable separate connectivity logging */
- public static final boolean LOGX = true;
-
- /** Enable verbose logging */
- public static final boolean LOGV = false;
-
- /** Enable super-verbose logging */
- private static final boolean LOCAL_LOGVV = false;
- public static final boolean LOGVV = LOCAL_LOGVV && LOGV;
-
- /**
- * This download has successfully completed.
- * Warning: there might be other status values that indicate success
- * in the future.
- * Use isSucccess() to capture the entire category.
- */
- public static final int STATUS_SUCCESS = 200;
-
- /**
- * This request couldn't be parsed. This is also used when processing
- * requests with unknown/unsupported URI schemes.
- */
- public static final int STATUS_BAD_REQUEST = 400;
-
- /**
- * This download can't be performed because the content type cannot be
- * handled.
- */
- public static final int STATUS_NOT_ACCEPTABLE = 406;
-
- /**
- * This download cannot be performed because the length cannot be
- * determined accurately. This is the code for the HTTP error "Length
- * Required", which is typically used when making requests that require
- * a content length but don't have one, and it is also used in the
- * client when a response is received whose length cannot be determined
- * accurately (therefore making it impossible to know when a download
- * completes).
- */
- public static final int STATUS_LENGTH_REQUIRED = 411;
-
- /**
- * This download was interrupted and cannot be resumed.
- * This is the code for the HTTP error "Precondition Failed", and it is
- * also used in situations where the client doesn't have an ETag at all.
- */
- public static final int STATUS_PRECONDITION_FAILED = 412;
-
- /**
- * The lowest-valued error status that is not an actual HTTP status code.
- */
- public static final int MIN_ARTIFICIAL_ERROR_STATUS = 488;
-
- /**
- * The requested destination file already exists.
- */
- public static final int STATUS_FILE_ALREADY_EXISTS_ERROR = 488;
-
- /**
- * Some possibly transient error occurred, but we can't resume the download.
- */
- public static final int STATUS_CANNOT_RESUME = 489;
-
- /**
- * This download was canceled
- */
- public static final int STATUS_CANCELED = 490;
-
- /**
- * This download has completed with an error.
- * Warning: there will be other status values that indicate errors in
- * the future. Use isStatusError() to capture the entire category.
- */
- public static final int STATUS_UNKNOWN_ERROR = 491;
-
- /**
- * This download couldn't be completed because of a storage issue.
- * Typically, that's because the filesystem is missing or full.
- * Use the more specific {@link #STATUS_INSUFFICIENT_SPACE_ERROR}
- * and {@link #STATUS_DEVICE_NOT_FOUND_ERROR} when appropriate.
- */
- public static final int STATUS_FILE_ERROR = 492;
-
- /**
- * This download couldn't be completed because of an HTTP
- * redirect response that the download manager couldn't
- * handle.
- */
- public static final int STATUS_UNHANDLED_REDIRECT = 493;
-
- /**
- * This download couldn't be completed because of an
- * unspecified unhandled HTTP code.
- */
- public static final int STATUS_UNHANDLED_HTTP_CODE = 494;
-
- /**
- * This download couldn't be completed because of an
- * error receiving or processing data at the HTTP level.
- */
- public static final int STATUS_HTTP_DATA_ERROR = 495;
-
- /**
- * This download couldn't be completed because of an
- * HttpException while setting up the request.
- */
- public static final int STATUS_HTTP_EXCEPTION = 496;
-
- /**
- * This download couldn't be completed because there were
- * too many redirects.
- */
- public static final int STATUS_TOO_MANY_REDIRECTS = 497;
-
- /**
- * This download couldn't be completed due to insufficient storage
- * space. Typically, this is because the SD card is full.
- */
- public static final int STATUS_INSUFFICIENT_SPACE_ERROR = 498;
-
- /**
- * This download couldn't be completed because no external storage
- * device was found. Typically, this is because the SD card is not
- * mounted.
- */
- public static final int STATUS_DEVICE_NOT_FOUND_ERROR = 499;
-
- /**
- * The wake duration to check to see if a download is possible.
- */
- public static final long WATCHDOG_WAKE_TIMER = 60*1000;
-
- /**
- * The wake duration to check to see if the process was killed.
- */
- public static final long ACTIVE_THREAD_WATCHDOG = 5*1000;
-
-} \ No newline at end of file
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java
deleted file mode 100644
index 9cb294d721..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-
-/**
- * This class contains progress information about the active download(s).
- *
- * When you build the Activity that initiates a download and tracks the
- * progress by implementing the {@link IDownloaderClient} interface, you'll
- * receive a DownloadProgressInfo object in each call to the {@link
- * IDownloaderClient#onDownloadProgress} method. This allows you to update
- * your activity's UI with information about the download progress, such
- * as the progress so far, time remaining and current speed.
- */
-public class DownloadProgressInfo implements Parcelable {
- public long mOverallTotal;
- public long mOverallProgress;
- public long mTimeRemaining; // time remaining
- public float mCurrentSpeed; // speed in KB/S
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel p, int i) {
- p.writeLong(mOverallTotal);
- p.writeLong(mOverallProgress);
- p.writeLong(mTimeRemaining);
- p.writeFloat(mCurrentSpeed);
- }
-
- public DownloadProgressInfo(Parcel p) {
- mOverallTotal = p.readLong();
- mOverallProgress = p.readLong();
- mTimeRemaining = p.readLong();
- mCurrentSpeed = p.readFloat();
- }
-
- public DownloadProgressInfo(long overallTotal, long overallProgress,
- long timeRemaining,
- float currentSpeed) {
- this.mOverallTotal = overallTotal;
- this.mOverallProgress = overallProgress;
- this.mTimeRemaining = timeRemaining;
- this.mCurrentSpeed = currentSpeed;
- }
-
- public static final Creator<DownloadProgressInfo> CREATOR = new Creator<DownloadProgressInfo>() {
- @Override
- public DownloadProgressInfo createFromParcel(Parcel parcel) {
- return new DownloadProgressInfo(parcel);
- }
-
- @Override
- public DownloadProgressInfo[] newArray(int i) {
- return new DownloadProgressInfo[i];
- }
- };
-
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java
deleted file mode 100644
index 2201751254..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader;
-
-import com.google.android.vending.expansion.downloader.impl.DownloaderService;
-
-import android.app.PendingIntent;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.ServiceConnection;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.RemoteException;
-import android.util.Log;
-
-
-
-/**
- * This class binds the service API to your application client. It contains the IDownloaderClient proxy,
- * which is used to call functions in your client as well as the Stub, which is used to call functions
- * in the client implementation of IDownloaderClient.
- *
- * <p>The IPC is implemented using an Android Messenger and a service Binder. The connect method
- * should be called whenever the client wants to bind to the service. It opens up a service connection
- * that ends up calling the onServiceConnected client API that passes the service messenger
- * in. If the client wants to be notified by the service, it is responsible for then passing its
- * messenger to the service in a separate call.
- *
- * <p>Critical methods are {@link #startDownloadServiceIfRequired} and {@link #CreateStub}.
- *
- * <p>When your application first starts, you should first check whether your app's expansion files are
- * already on the device. If not, you should then call {@link #startDownloadServiceIfRequired}, which
- * starts your {@link impl.DownloaderService} to download the expansion files if necessary. The method
- * returns a value indicating whether download is required or not.
- *
- * <p>If a download is required, {@link #startDownloadServiceIfRequired} begins the download through
- * the specified service and you should then call {@link #CreateStub} to instantiate a member {@link
- * IStub} object that you need in order to receive calls through your {@link IDownloaderClient}
- * interface.
- */
-public class DownloaderClientMarshaller {
- public static final int MSG_ONDOWNLOADSTATE_CHANGED = 10;
- public static final int MSG_ONDOWNLOADPROGRESS = 11;
- public static final int MSG_ONSERVICECONNECTED = 12;
-
- public static final String PARAM_NEW_STATE = "newState";
- public static final String PARAM_PROGRESS = "progress";
- public static final String PARAM_MESSENGER = DownloaderService.EXTRA_MESSAGE_HANDLER;
-
- public static final int NO_DOWNLOAD_REQUIRED = DownloaderService.NO_DOWNLOAD_REQUIRED;
- public static final int LVL_CHECK_REQUIRED = DownloaderService.LVL_CHECK_REQUIRED;
- public static final int DOWNLOAD_REQUIRED = DownloaderService.DOWNLOAD_REQUIRED;
-
- private static class Proxy implements IDownloaderClient {
- private Messenger mServiceMessenger;
-
- @Override
- public void onDownloadStateChanged(int newState) {
- Bundle params = new Bundle(1);
- params.putInt(PARAM_NEW_STATE, newState);
- send(MSG_ONDOWNLOADSTATE_CHANGED, params);
- }
-
- @Override
- public void onDownloadProgress(DownloadProgressInfo progress) {
- Bundle params = new Bundle(1);
- params.putParcelable(PARAM_PROGRESS, progress);
- send(MSG_ONDOWNLOADPROGRESS, params);
- }
-
- private void send(int method, Bundle params) {
- Message m = Message.obtain(null, method);
- m.setData(params);
- try {
- mServiceMessenger.send(m);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
-
- public Proxy(Messenger msg) {
- mServiceMessenger = msg;
- }
-
- @Override
- public void onServiceConnected(Messenger m) {
- /**
- * This is never called through the proxy.
- */
- }
- }
-
- private static class Stub implements IStub {
- private IDownloaderClient mItf = null;
- private Class<?> mDownloaderServiceClass;
- private boolean mBound;
- private Messenger mServiceMessenger;
- private Context mContext;
- /**
- * Target we publish for clients to send messages to IncomingHandler.
- */
- final Messenger mMessenger = new Messenger(new Handler() {
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_ONDOWNLOADPROGRESS:
- Bundle bun = msg.getData();
- if ( null != mContext ) {
- bun.setClassLoader(mContext.getClassLoader());
- DownloadProgressInfo dpi = (DownloadProgressInfo) msg.getData()
- .getParcelable(PARAM_PROGRESS);
- mItf.onDownloadProgress(dpi);
- }
- break;
- case MSG_ONDOWNLOADSTATE_CHANGED:
- mItf.onDownloadStateChanged(msg.getData().getInt(PARAM_NEW_STATE));
- break;
- case MSG_ONSERVICECONNECTED:
- mItf.onServiceConnected(
- (Messenger) msg.getData().getParcelable(PARAM_MESSENGER));
- break;
- }
- }
- });
-
- public Stub(IDownloaderClient itf, Class<?> downloaderService) {
- mItf = itf;
- mDownloaderServiceClass = downloaderService;
- }
-
- /**
- * Class for interacting with the main interface of the service.
- */
- private ServiceConnection mConnection = new ServiceConnection() {
- public void onServiceConnected(ComponentName className, IBinder service) {
- // This is called when the connection with the service has been
- // established, giving us the object we can use to
- // interact with the service. We are communicating with the
- // service using a Messenger, so here we get a client-side
- // representation of that from the raw IBinder object.
- mServiceMessenger = new Messenger(service);
- mItf.onServiceConnected(
- mServiceMessenger);
- }
-
- public void onServiceDisconnected(ComponentName className) {
- // This is called when the connection with the service has been
- // unexpectedly disconnected -- that is, its process crashed.
- mServiceMessenger = null;
- }
- };
-
- @Override
- public void connect(Context c) {
- mContext = c;
- Intent bindIntent = new Intent(c, mDownloaderServiceClass);
- bindIntent.putExtra(PARAM_MESSENGER, mMessenger);
- if ( !c.bindService(bindIntent, mConnection, Context.BIND_DEBUG_UNBIND) ) {
- if ( Constants.LOGVV ) {
- Log.d(Constants.TAG, "Service Unbound");
- }
- } else {
- mBound = true;
- }
-
- }
-
- @Override
- public void disconnect(Context c) {
- if (mBound) {
- c.unbindService(mConnection);
- mBound = false;
- }
- mContext = null;
- }
-
- @Override
- public Messenger getMessenger() {
- return mMessenger;
- }
- }
-
- /**
- * Returns a proxy that will marshal calls to IDownloaderClient methods
- *
- * @param msg
- * @return
- */
- public static IDownloaderClient CreateProxy(Messenger msg) {
- return new Proxy(msg);
- }
-
- /**
- * Returns a stub object that, when connected, will listen for marshaled
- * {@link IDownloaderClient} methods and translate them into calls to the supplied
- * interface.
- *
- * @param itf An implementation of IDownloaderClient that will be called
- * when remote method calls are unmarshaled.
- * @param downloaderService The class for your implementation of {@link
- * impl.DownloaderService}.
- * @return The {@link IStub} that allows you to connect to the service such that
- * your {@link IDownloaderClient} receives status updates.
- */
- public static IStub CreateStub(IDownloaderClient itf, Class<?> downloaderService) {
- return new Stub(itf, downloaderService);
- }
-
- /**
- * Starts the download if necessary. This function starts a flow that does `
- * many things. 1) Checks to see if the APK version has been checked and
- * the metadata database updated 2) If the APK version does not match,
- * checks the new LVL status to see if a new download is required 3) If the
- * APK version does match, then checks to see if the download(s) have been
- * completed 4) If the downloads have been completed, returns
- * NO_DOWNLOAD_REQUIRED The idea is that this can be called during the
- * startup of an application to quickly ascertain if the application needs
- * to wait to hear about any updated APK expansion files. Note that this does
- * mean that the application MUST be run for the first time with a network
- * connection, even if Market delivers all of the files.
- *
- * @param context Your application Context.
- * @param notificationClient A PendingIntent to start the Activity in your application
- * that shows the download progress and which will also start the application when download
- * completes.
- * @param serviceClass the class of your {@link imp.DownloaderService} implementation
- * @return whether the service was started and the reason for starting the service.
- * Either {@link #NO_DOWNLOAD_REQUIRED}, {@link #LVL_CHECK_REQUIRED}, or {@link
- * #DOWNLOAD_REQUIRED}.
- * @throws NameNotFoundException
- */
- public static int startDownloadServiceIfRequired(Context context, PendingIntent notificationClient,
- Class<?> serviceClass)
- throws NameNotFoundException {
- return DownloaderService.startDownloadServiceIfRequired(context, notificationClient,
- serviceClass);
- }
-
- /**
- * This version assumes that the intent contains the pending intent as a parameter. This
- * is used for responding to alarms.
- * <p>The pending intent must be in an extra with the key {@link
- * impl.DownloaderService#EXTRA_PENDING_INTENT}.
- *
- * @param context
- * @param notificationClient
- * @param serviceClass the class of the service to start
- * @return
- * @throws NameNotFoundException
- */
- public static int startDownloadServiceIfRequired(Context context, Intent notificationClient,
- Class<?> serviceClass)
- throws NameNotFoundException {
- return DownloaderService.startDownloadServiceIfRequired(context, notificationClient,
- serviceClass);
- }
-
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java
deleted file mode 100644
index 054eaa9895..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader;
-
-import com.google.android.vending.expansion.downloader.impl.DownloaderService;
-
-import android.content.Context;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.RemoteException;
-
-
-
-/**
- * This class is used by the client activity to proxy requests to the Downloader
- * Service.
- *
- * Most importantly, you must call {@link #CreateProxy} during the {@link
- * IDownloaderClient#onServiceConnected} callback in your activity in order to instantiate
- * an {@link IDownloaderService} object that you can then use to issue commands to the {@link
- * DownloaderService} (such as to pause and resume downloads).
- */
-public class DownloaderServiceMarshaller {
-
- public static final int MSG_REQUEST_ABORT_DOWNLOAD =
- 1;
- public static final int MSG_REQUEST_PAUSE_DOWNLOAD =
- 2;
- public static final int MSG_SET_DOWNLOAD_FLAGS =
- 3;
- public static final int MSG_REQUEST_CONTINUE_DOWNLOAD =
- 4;
- public static final int MSG_REQUEST_DOWNLOAD_STATE =
- 5;
- public static final int MSG_REQUEST_CLIENT_UPDATE =
- 6;
-
- public static final String PARAMS_FLAGS = "flags";
- public static final String PARAM_MESSENGER = DownloaderService.EXTRA_MESSAGE_HANDLER;
-
- private static class Proxy implements IDownloaderService {
- private Messenger mMsg;
-
- private void send(int method, Bundle params) {
- Message m = Message.obtain(null, method);
- m.setData(params);
- try {
- mMsg.send(m);
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
-
- public Proxy(Messenger msg) {
- mMsg = msg;
- }
-
- @Override
- public void requestAbortDownload() {
- send(MSG_REQUEST_ABORT_DOWNLOAD, new Bundle());
- }
-
- @Override
- public void requestPauseDownload() {
- send(MSG_REQUEST_PAUSE_DOWNLOAD, new Bundle());
- }
-
- @Override
- public void setDownloadFlags(int flags) {
- Bundle params = new Bundle();
- params.putInt(PARAMS_FLAGS, flags);
- send(MSG_SET_DOWNLOAD_FLAGS, params);
- }
-
- @Override
- public void requestContinueDownload() {
- send(MSG_REQUEST_CONTINUE_DOWNLOAD, new Bundle());
- }
-
- @Override
- public void requestDownloadStatus() {
- send(MSG_REQUEST_DOWNLOAD_STATE, new Bundle());
- }
-
- @Override
- public void onClientUpdated(Messenger clientMessenger) {
- Bundle bundle = new Bundle(1);
- bundle.putParcelable(PARAM_MESSENGER, clientMessenger);
- send(MSG_REQUEST_CLIENT_UPDATE, bundle);
- }
- }
-
- private static class Stub implements IStub {
- private IDownloaderService mItf = null;
- final Messenger mMessenger = new Messenger(new Handler() {
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_REQUEST_ABORT_DOWNLOAD:
- mItf.requestAbortDownload();
- break;
- case MSG_REQUEST_CONTINUE_DOWNLOAD:
- mItf.requestContinueDownload();
- break;
- case MSG_REQUEST_PAUSE_DOWNLOAD:
- mItf.requestPauseDownload();
- break;
- case MSG_SET_DOWNLOAD_FLAGS:
- mItf.setDownloadFlags(msg.getData().getInt(PARAMS_FLAGS));
- break;
- case MSG_REQUEST_DOWNLOAD_STATE:
- mItf.requestDownloadStatus();
- break;
- case MSG_REQUEST_CLIENT_UPDATE:
- mItf.onClientUpdated((Messenger) msg.getData().getParcelable(
- PARAM_MESSENGER));
- break;
- }
- }
- });
-
- public Stub(IDownloaderService itf) {
- mItf = itf;
- }
-
- @Override
- public Messenger getMessenger() {
- return mMessenger;
- }
-
- @Override
- public void connect(Context c) {
-
- }
-
- @Override
- public void disconnect(Context c) {
-
- }
- }
-
- /**
- * Returns a proxy that will marshall calls to IDownloaderService methods
- *
- * @param ctx
- * @return
- */
- public static IDownloaderService CreateProxy(Messenger msg) {
- return new Proxy(msg);
- }
-
- /**
- * Returns a stub object that, when connected, will listen for marshalled
- * IDownloaderService methods and translate them into calls to the supplied
- * interface.
- *
- * @param itf An implementation of IDownloaderService that will be called
- * when remote method calls are unmarshalled.
- * @return
- */
- public static IStub CreateStub(IDownloaderService itf) {
- return new Stub(itf);
- }
-
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Helpers.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Helpers.java
deleted file mode 100644
index 1e84e54a0f..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/Helpers.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader;
-
-import com.android.vending.expansion.downloader.R;
-
-import android.content.Context;
-import android.os.Environment;
-import android.os.StatFs;
-import android.os.SystemClock;
-import android.util.Log;
-
-import java.io.File;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-import java.util.Random;
-import java.util.TimeZone;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Some helper functions for the download manager
- */
-public class Helpers {
-
- public static Random sRandom = new Random(SystemClock.uptimeMillis());
-
- /** Regex used to parse content-disposition headers */
- private static final Pattern CONTENT_DISPOSITION_PATTERN = Pattern
- .compile("attachment;\\s*filename\\s*=\\s*\"([^\"]*)\"");
-
- private Helpers() {
- }
-
- /*
- * Parse the Content-Disposition HTTP Header. The format of the header is
- * defined here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html This
- * header provides a filename for content that is going to be downloaded to
- * the file system. We only support the attachment type.
- */
- static String parseContentDisposition(String contentDisposition) {
- try {
- Matcher m = CONTENT_DISPOSITION_PATTERN.matcher(contentDisposition);
- if (m.find()) {
- return m.group(1);
- }
- } catch (IllegalStateException ex) {
- // This function is defined as returning null when it can't parse
- // the header
- }
- return null;
- }
-
- /**
- * @return the root of the filesystem containing the given path
- */
- public static File getFilesystemRoot(String path) {
- File cache = Environment.getDownloadCacheDirectory();
- if (path.startsWith(cache.getPath())) {
- return cache;
- }
- File external = Environment.getExternalStorageDirectory();
- if (path.startsWith(external.getPath())) {
- return external;
- }
- throw new IllegalArgumentException(
- "Cannot determine filesystem root for " + path);
- }
-
- public static boolean isExternalMediaMounted() {
- if (!Environment.getExternalStorageState().equals(
- Environment.MEDIA_MOUNTED)) {
- // No SD card found.
- if ( Constants.LOGVV ) {
- Log.d(Constants.TAG, "no external storage");
- }
- return false;
- }
- return true;
- }
-
- /**
- * @return the number of bytes available on the filesystem rooted at the
- * given File
- */
- public static long getAvailableBytes(File root) {
- StatFs stat = new StatFs(root.getPath());
- // put a bit of margin (in case creating the file grows the system by a
- // few blocks)
- long availableBlocks = (long) stat.getAvailableBlocks() - 4;
- return stat.getBlockSize() * availableBlocks;
- }
-
- /**
- * Checks whether the filename looks legitimate
- */
- public static boolean isFilenameValid(String filename) {
- filename = filename.replaceFirst("/+", "/"); // normalize leading
- // slashes
- return filename.startsWith(Environment.getDownloadCacheDirectory().toString())
- || filename.startsWith(Environment.getExternalStorageDirectory().toString());
- }
-
- /*
- * Delete the given file from device
- */
- /* package */static void deleteFile(String path) {
- try {
- File file = new File(path);
- file.delete();
- } catch (Exception e) {
- Log.w(Constants.TAG, "file: '" + path + "' couldn't be deleted", e);
- }
- }
-
- /**
- * Showing progress in MB here. It would be nice to choose the unit (KB, MB,
- * GB) based on total file size, but given what we know about the expected
- * ranges of file sizes for APK expansion files, it's probably not necessary.
- *
- * @param overallProgress
- * @param overallTotal
- * @return
- */
-
- static public String getDownloadProgressString(long overallProgress, long overallTotal) {
- if (overallTotal == 0) {
- if ( Constants.LOGVV ) {
- Log.e(Constants.TAG, "Notification called when total is zero");
- }
- return "";
- }
- return String.format("%.2f",
- (float) overallProgress / (1024.0f * 1024.0f))
- + "MB /" +
- String.format("%.2f", (float) overallTotal /
- (1024.0f * 1024.0f)) + "MB";
- }
-
- /**
- * Adds a percentile to getDownloadProgressString.
- *
- * @param overallProgress
- * @param overallTotal
- * @return
- */
- static public String getDownloadProgressStringNotification(long overallProgress,
- long overallTotal) {
- if (overallTotal == 0) {
- if ( Constants.LOGVV ) {
- Log.e(Constants.TAG, "Notification called when total is zero");
- }
- return "";
- }
- return getDownloadProgressString(overallProgress, overallTotal) + " (" +
- getDownloadProgressPercent(overallProgress, overallTotal) + ")";
- }
-
- public static String getDownloadProgressPercent(long overallProgress, long overallTotal) {
- if (overallTotal == 0) {
- if ( Constants.LOGVV ) {
- Log.e(Constants.TAG, "Notification called when total is zero");
- }
- return "";
- }
- return Long.toString(overallProgress * 100 / overallTotal) + "%";
- }
-
- public static String getSpeedString(float bytesPerMillisecond) {
- return String.format("%.2f", bytesPerMillisecond * 1000 / 1024);
- }
-
- public static String getTimeRemaining(long durationInMilliseconds) {
- SimpleDateFormat sdf;
- if (durationInMilliseconds > 1000 * 60 * 60) {
- sdf = new SimpleDateFormat("HH:mm", Locale.getDefault());
- } else {
- sdf = new SimpleDateFormat("mm:ss", Locale.getDefault());
- }
- return sdf.format(new Date(durationInMilliseconds - TimeZone.getDefault().getRawOffset()));
- }
-
- /**
- * Returns the file name (without full path) for an Expansion APK file from
- * the given context.
- *
- * @param c the context
- * @param mainFile true for main file, false for patch file
- * @param versionCode the version of the file
- * @return String the file name of the expansion file
- */
- public static String getExpansionAPKFileName(Context c, boolean mainFile, int versionCode) {
- return (mainFile ? "main." : "patch.") + versionCode + "." + c.getPackageName() + ".obb";
- }
-
- /**
- * Returns the filename (where the file should be saved) from info about a
- * download
- */
- static public String generateSaveFileName(Context c, String fileName) {
- String path = getSaveFilePath(c)
- + File.separator + fileName;
- return path;
- }
-
- static public String getSaveFilePath(Context c) {
- File root = Environment.getExternalStorageDirectory();
- String path = root.toString() + Constants.EXP_PATH + c.getPackageName();
- return path;
- }
-
- /**
- * Helper function to ascertain the existence of a file and return
- * true/false appropriately
- *
- * @param c the app/activity/service context
- * @param fileName the name (sans path) of the file to query
- * @param fileSize the size that the file must match
- * @param deleteFileOnMismatch if the file sizes do not match, delete the
- * file
- * @return true if it does exist, false otherwise
- */
- static public boolean doesFileExist(Context c, String fileName, long fileSize,
- boolean deleteFileOnMismatch) {
- // the file may have been delivered by Market --- let's make sure
- // it's the size we expect
- File fileForNewFile = new File(Helpers.generateSaveFileName(c, fileName));
- if (fileForNewFile.exists()) {
- if (fileForNewFile.length() == fileSize) {
- return true;
- }
- if (deleteFileOnMismatch) {
- // delete the file --- we won't be able to resume
- // because we cannot confirm the integrity of the file
- fileForNewFile.delete();
- }
- }
- return false;
- }
-
- /**
- * Converts download states that are returned by the {@link
- * IDownloaderClient#onDownloadStateChanged} callback into usable strings.
- * This is useful if using the state strings built into the library to display user messages.
- * @param state One of the STATE_* constants from {@link IDownloaderClient}.
- * @return string resource ID for the corresponding string.
- */
- static public int getDownloaderStringResourceIDFromState(int state) {
- switch (state) {
- case IDownloaderClient.STATE_IDLE:
- return R.string.state_idle;
- case IDownloaderClient.STATE_FETCHING_URL:
- return R.string.state_fetching_url;
- case IDownloaderClient.STATE_CONNECTING:
- return R.string.state_connecting;
- case IDownloaderClient.STATE_DOWNLOADING:
- return R.string.state_downloading;
- case IDownloaderClient.STATE_COMPLETED:
- return R.string.state_completed;
- case IDownloaderClient.STATE_PAUSED_NETWORK_UNAVAILABLE:
- return R.string.state_paused_network_unavailable;
- case IDownloaderClient.STATE_PAUSED_BY_REQUEST:
- return R.string.state_paused_by_request;
- case IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION:
- return R.string.state_paused_wifi_disabled;
- case IDownloaderClient.STATE_PAUSED_NEED_CELLULAR_PERMISSION:
- return R.string.state_paused_wifi_unavailable;
- case IDownloaderClient.STATE_PAUSED_WIFI_DISABLED:
- return R.string.state_paused_wifi_disabled;
- case IDownloaderClient.STATE_PAUSED_NEED_WIFI:
- return R.string.state_paused_wifi_unavailable;
- case IDownloaderClient.STATE_PAUSED_ROAMING:
- return R.string.state_paused_roaming;
- case IDownloaderClient.STATE_PAUSED_NETWORK_SETUP_FAILURE:
- return R.string.state_paused_network_setup_failure;
- case IDownloaderClient.STATE_PAUSED_SDCARD_UNAVAILABLE:
- return R.string.state_paused_sdcard_unavailable;
- case IDownloaderClient.STATE_FAILED_UNLICENSED:
- return R.string.state_failed_unlicensed;
- case IDownloaderClient.STATE_FAILED_FETCHING_URL:
- return R.string.state_failed_fetching_url;
- case IDownloaderClient.STATE_FAILED_SDCARD_FULL:
- return R.string.state_failed_sdcard_full;
- case IDownloaderClient.STATE_FAILED_CANCELED:
- return R.string.state_failed_cancelled;
- default:
- return R.string.state_unknown;
- }
- }
-
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java
deleted file mode 100644
index b8511a62a0..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderClient.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader;
-
-import android.os.Messenger;
-
-/**
- * This interface should be implemented by the client activity for the
- * downloader. It is used to pass status from the service to the client.
- */
-public interface IDownloaderClient {
- static final int STATE_IDLE = 1;
- static final int STATE_FETCHING_URL = 2;
- static final int STATE_CONNECTING = 3;
- static final int STATE_DOWNLOADING = 4;
- static final int STATE_COMPLETED = 5;
-
- static final int STATE_PAUSED_NETWORK_UNAVAILABLE = 6;
- static final int STATE_PAUSED_BY_REQUEST = 7;
-
- /**
- * Both STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION and
- * STATE_PAUSED_NEED_CELLULAR_PERMISSION imply that Wi-Fi is unavailable and
- * cellular permission will restart the service. Wi-Fi disabled means that
- * the Wi-Fi manager is returning that Wi-Fi is not enabled, while in the
- * other case Wi-Fi is enabled but not available.
- */
- static final int STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION = 8;
- static final int STATE_PAUSED_NEED_CELLULAR_PERMISSION = 9;
-
- /**
- * Both STATE_PAUSED_WIFI_DISABLED and STATE_PAUSED_NEED_WIFI imply that
- * Wi-Fi is unavailable and cellular permission will NOT restart the
- * service. Wi-Fi disabled means that the Wi-Fi manager is returning that
- * Wi-Fi is not enabled, while in the other case Wi-Fi is enabled but not
- * available.
- * <p>
- * The service does not return these values. We recommend that app
- * developers with very large payloads do not allow these payloads to be
- * downloaded over cellular connections.
- */
- static final int STATE_PAUSED_WIFI_DISABLED = 10;
- static final int STATE_PAUSED_NEED_WIFI = 11;
-
- static final int STATE_PAUSED_ROAMING = 12;
-
- /**
- * Scary case. We were on a network that redirected us to another website
- * that delivered us the wrong file.
- */
- static final int STATE_PAUSED_NETWORK_SETUP_FAILURE = 13;
-
- static final int STATE_PAUSED_SDCARD_UNAVAILABLE = 14;
-
- static final int STATE_FAILED_UNLICENSED = 15;
- static final int STATE_FAILED_FETCHING_URL = 16;
- static final int STATE_FAILED_SDCARD_FULL = 17;
- static final int STATE_FAILED_CANCELED = 18;
-
- static final int STATE_FAILED = 19;
-
- /**
- * Called internally by the stub when the service is bound to the client.
- * <p>
- * Critical implementation detail. In onServiceConnected we create the
- * remote service and marshaler. This is how we pass the client information
- * back to the service so the client can be properly notified of changes. We
- * must do this every time we reconnect to the service.
- * <p>
- * That is, when you receive this callback, you should call
- * {@link DownloaderServiceMarshaller#CreateProxy} to instantiate a member
- * instance of {@link IDownloaderService}, then call
- * {@link IDownloaderService#onClientUpdated} with the Messenger retrieved
- * from your {@link IStub} proxy object.
- *
- * @param m the service Messenger. This Messenger is used to call the
- * service API from the client.
- */
- void onServiceConnected(Messenger m);
-
- /**
- * Called when the download state changes. Depending on the state, there may
- * be user requests. The service is free to change the download state in the
- * middle of a user request, so the client should be able to handle this.
- * <p>
- * The Downloader Library includes a collection of string resources that
- * correspond to each of the states, which you can use to provide users a
- * useful message based on the state provided in this callback. To fetch the
- * appropriate string for a state, call
- * {@link Helpers#getDownloaderStringResourceIDFromState}.
- * <p>
- * What this means to the developer: The application has gotten a message
- * that the download has paused due to lack of WiFi. The developer should
- * then show UI asking the user if they want to enable downloading over
- * cellular connections with appropriate warnings. If the application
- * suddenly starts downloading, the application should revert to showing the
- * progress again, rather than leaving up the download over cellular UI up.
- *
- * @param newState one of the STATE_* values defined in IDownloaderClient
- */
- void onDownloadStateChanged(int newState);
-
- /**
- * Shows the download progress. This is intended to be used to fill out a
- * client UI. This progress should only be shown in a few states such as
- * STATE_DOWNLOADING.
- *
- * @param progress the DownloadProgressInfo object containing the current
- * progress of all downloads.
- */
- void onDownloadProgress(DownloadProgressInfo progress);
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderService.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderService.java
deleted file mode 100644
index 4789afe19c..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IDownloaderService.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader;
-
-import com.google.android.vending.expansion.downloader.impl.DownloaderService;
-import android.os.Messenger;
-
-/**
- * This interface is implemented by the DownloaderService and by the
- * DownloaderServiceMarshaller. It contains functions to control the service.
- * When a client binds to the service, it must call the onClientUpdated
- * function.
- * <p>
- * You can acquire a proxy that implements this interface for your service by
- * calling {@link DownloaderServiceMarshaller#CreateProxy} during the
- * {@link IDownloaderClient#onServiceConnected} callback. At which point, you
- * should immediately call {@link #onClientUpdated}.
- */
-public interface IDownloaderService {
- /**
- * Set this flag in response to the
- * IDownloaderClient.STATE_PAUSED_NEED_CELLULAR_PERMISSION state and then
- * call RequestContinueDownload to resume a download
- */
- public static final int FLAGS_DOWNLOAD_OVER_CELLULAR = 1;
-
- /**
- * Request that the service abort the current download. The service should
- * respond by changing the state to {@link IDownloaderClient.STATE_ABORTED}.
- */
- void requestAbortDownload();
-
- /**
- * Request that the service pause the current download. The service should
- * respond by changing the state to
- * {@link IDownloaderClient.STATE_PAUSED_BY_REQUEST}.
- */
- void requestPauseDownload();
-
- /**
- * Request that the service continue a paused download, when in any paused
- * or failed state, including
- * {@link IDownloaderClient.STATE_PAUSED_BY_REQUEST}.
- */
- void requestContinueDownload();
-
- /**
- * Set the flags for this download (e.g.
- * {@link DownloaderService.FLAGS_DOWNLOAD_OVER_CELLULAR}).
- *
- * @param flags
- */
- void setDownloadFlags(int flags);
-
- /**
- * Requests that the download status be sent to the client.
- */
- void requestDownloadStatus();
-
- /**
- * Call this when you get {@link
- * IDownloaderClient.onServiceConnected(Messenger m)} from the
- * DownloaderClient to register the client with the service. It will
- * automatically send the current status to the client.
- *
- * @param clientMessenger
- */
- void onClientUpdated(Messenger clientMessenger);
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IStub.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IStub.java
deleted file mode 100644
index d5bc3a843e..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/IStub.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader;
-
-import android.content.Context;
-import android.os.Messenger;
-
-/**
- * This is the interface that is used to connect/disconnect from the downloader
- * service.
- * <p>
- * You should get a proxy object that implements this interface by calling
- * {@link DownloaderClientMarshaller#CreateStub} in your activity when the
- * downloader service starts. Then, call {@link #connect} during your activity's
- * onResume() and call {@link #disconnect} during onStop().
- * <p>
- * Then during the {@link IDownloaderClient#onServiceConnected} callback, you
- * should call {@link #getMessenger} to pass the stub's Messenger object to
- * {@link IDownloaderService#onClientUpdated}.
- */
-public interface IStub {
- Messenger getMessenger();
-
- void connect(Context c);
-
- void disconnect(Context c);
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/SystemFacade.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/SystemFacade.java
deleted file mode 100644
index 12edd97ab2..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/SystemFacade.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader;
-
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.net.ConnectivityManager;
-import android.net.NetworkInfo;
-import android.telephony.TelephonyManager;
-import android.util.Log;
-
-/**
- * Contains useful helper functions, typically tied to the application context.
- */
-class SystemFacade {
- private Context mContext;
- private NotificationManager mNotificationManager;
-
- public SystemFacade(Context context) {
- mContext = context;
- mNotificationManager = (NotificationManager)
- mContext.getSystemService(Context.NOTIFICATION_SERVICE);
- }
-
- public long currentTimeMillis() {
- return System.currentTimeMillis();
- }
-
- public Integer getActiveNetworkType() {
- ConnectivityManager connectivity =
- (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
- if (connectivity == null) {
- Log.w(Constants.TAG, "couldn't get connectivity manager");
- return null;
- }
-
- NetworkInfo activeInfo = connectivity.getActiveNetworkInfo();
- if (activeInfo == null) {
- if (Constants.LOGVV) {
- Log.v(Constants.TAG, "network is not available");
- }
- return null;
- }
- return activeInfo.getType();
- }
-
- public boolean isNetworkRoaming() {
- ConnectivityManager connectivity =
- (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
- if (connectivity == null) {
- Log.w(Constants.TAG, "couldn't get connectivity manager");
- return false;
- }
-
- NetworkInfo info = connectivity.getActiveNetworkInfo();
- boolean isMobile = (info != null && info.getType() == ConnectivityManager.TYPE_MOBILE);
- TelephonyManager tm = (TelephonyManager) mContext
- .getSystemService(Context.TELEPHONY_SERVICE);
- if (null == tm) {
- Log.w(Constants.TAG, "couldn't get telephony manager");
- return false;
- }
- boolean isRoaming = isMobile && tm.isNetworkRoaming();
- if (Constants.LOGVV && isRoaming) {
- Log.v(Constants.TAG, "network is roaming");
- }
- return isRoaming;
- }
-
- public Long getMaxBytesOverMobile() {
- return (long) Integer.MAX_VALUE;
- }
-
- public Long getRecommendedMaxBytesOverMobile() {
- return 2097152L;
- }
-
- public void sendBroadcast(Intent intent) {
- mContext.sendBroadcast(intent);
- }
-
- public boolean userOwnsPackage(int uid, String packageName) throws NameNotFoundException {
- return mContext.getPackageManager().getApplicationInfo(packageName, 0).uid == uid;
- }
-
- public void postNotification(long id, Notification notification) {
- /**
- * TODO: The system notification manager takes ints, not longs, as IDs,
- * but the download manager uses IDs take straight from the database,
- * which are longs. This will have to be dealt with at some point.
- */
- mNotificationManager.notify((int) id, notification);
- }
-
- public void cancelNotification(long id) {
- mNotificationManager.cancel((int) id);
- }
-
- public void cancelAllNotifications() {
- mNotificationManager.cancelAll();
- }
-
- public void startThread(Thread thread) {
- thread.start();
- }
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java
deleted file mode 100644
index 4667acce67..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java
+++ /dev/null
@@ -1,536 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * This is a port of AndroidHttpClient to pre-Froyo devices, that takes advantage of
- * the SSLSessionCache added Froyo devices using reflection.
- */
-
-package com.google.android.vending.expansion.downloader.impl;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.GZIPOutputStream;
-
-import org.apache.http.Header;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpEntityEnclosingRequest;
-import org.apache.http.HttpException;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpRequestInterceptor;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.ResponseHandler;
-import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.client.params.HttpClientParams;
-import org.apache.http.client.protocol.ClientContext;
-import org.apache.http.conn.ClientConnectionManager;
-import org.apache.http.conn.scheme.PlainSocketFactory;
-import org.apache.http.conn.scheme.Scheme;
-import org.apache.http.conn.scheme.SchemeRegistry;
-import org.apache.http.conn.scheme.SocketFactory;
-import org.apache.http.conn.ssl.SSLSocketFactory;
-import org.apache.http.entity.AbstractHttpEntity;
-import org.apache.http.entity.ByteArrayEntity;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.impl.client.RequestWrapper;
-import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
-import org.apache.http.params.BasicHttpParams;
-import org.apache.http.params.HttpConnectionParams;
-import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
-import org.apache.http.protocol.BasicHttpContext;
-import org.apache.http.protocol.BasicHttpProcessor;
-import org.apache.http.protocol.HttpContext;
-
-import android.content.ContentResolver;
-import android.content.Context;
-import android.net.SSLCertificateSocketFactory;
-import android.os.Looper;
-import android.util.Log;
-
-/**
- * Subclass of the Apache {@link DefaultHttpClient} that is configured with
- * reasonable default settings and registered schemes for Android, and
- * also lets the user add {@link HttpRequestInterceptor} classes.
- * Don't create this directly, use the {@link #newInstance} factory method.
- *
- * <p>This client processes cookies but does not retain them by default.
- * To retain cookies, simply add a cookie store to the HttpContext:</p>
- *
- * <pre>context.setAttribute(ClientContext.COOKIE_STORE, cookieStore);</pre>
- */
-public final class AndroidHttpClient implements HttpClient {
-
- static Class<?> sSslSessionCacheClass;
- static {
- // if we are on Froyo+ devices, we can take advantage of the SSLSessionCache
- try {
- sSslSessionCacheClass = Class.forName("android.net.SSLSessionCache");
- } catch (Exception e) {
-
- }
- }
-
- // Gzip of data shorter than this probably won't be worthwhile
- public static long DEFAULT_SYNC_MIN_GZIP_BYTES = 256;
-
- // Default connection and socket timeout of 60 seconds. Tweak to taste.
- private static final int SOCKET_OPERATION_TIMEOUT = 60 * 1000;
-
- private static final String TAG = "AndroidHttpClient";
-
-
- /** Interceptor throws an exception if the executing thread is blocked */
- private static final HttpRequestInterceptor sThreadCheckInterceptor =
- new HttpRequestInterceptor() {
- public void process(HttpRequest request, HttpContext context) {
- // Prevent the HttpRequest from being sent on the main thread
- if (Looper.myLooper() != null && Looper.myLooper() == Looper.getMainLooper() ) {
- throw new RuntimeException("This thread forbids HTTP requests");
- }
- }
- };
-
- /**
- * Create a new HttpClient with reasonable defaults (which you can update).
- *
- * @param userAgent to report in your HTTP requests
- * @param context to use for caching SSL sessions (may be null for no caching)
- * @return AndroidHttpClient for you to use for all your requests.
- */
- public static AndroidHttpClient newInstance(String userAgent, Context context) {
- HttpParams params = new BasicHttpParams();
-
- // Turn off stale checking. Our connections break all the time anyway,
- // and it's not worth it to pay the penalty of checking every time.
- HttpConnectionParams.setStaleCheckingEnabled(params, false);
-
- HttpConnectionParams.setConnectionTimeout(params, SOCKET_OPERATION_TIMEOUT);
- HttpConnectionParams.setSoTimeout(params, SOCKET_OPERATION_TIMEOUT);
- HttpConnectionParams.setSocketBufferSize(params, 8192);
-
- // Don't handle redirects -- return them to the caller. Our code
- // often wants to re-POST after a redirect, which we must do ourselves.
- HttpClientParams.setRedirecting(params, false);
-
- Object sessionCache = null;
- // Use a session cache for SSL sockets -- Froyo only
- if ( null != context && null != sSslSessionCacheClass ) {
- Constructor<?> ct;
- try {
- ct = sSslSessionCacheClass.getConstructor(Context.class);
- sessionCache = ct.newInstance(context);
- } catch (SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InstantiationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- // Set the specified user agent and register standard protocols.
- HttpProtocolParams.setUserAgent(params, userAgent);
- SchemeRegistry schemeRegistry = new SchemeRegistry();
- schemeRegistry.register(new Scheme("http",
- PlainSocketFactory.getSocketFactory(), 80));
- SocketFactory sslCertificateSocketFactory = null;
- if ( null != sessionCache ) {
- Method getHttpSocketFactoryMethod;
- try {
- getHttpSocketFactoryMethod = SSLCertificateSocketFactory.class.getDeclaredMethod("getHttpSocketFactory",Integer.TYPE, sSslSessionCacheClass);
- sslCertificateSocketFactory = (SocketFactory)getHttpSocketFactoryMethod.invoke(null, SOCKET_OPERATION_TIMEOUT, sessionCache);
- } catch (SecurityException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- if ( null == sslCertificateSocketFactory ) {
- sslCertificateSocketFactory = SSLSocketFactory.getSocketFactory();
- }
- schemeRegistry.register(new Scheme("https",
- sslCertificateSocketFactory, 443));
-
- ClientConnectionManager manager =
- new ThreadSafeClientConnManager(params, schemeRegistry);
-
- // We use a factory method to modify superclass initialization
- // parameters without the funny call-a-static-method dance.
- return new AndroidHttpClient(manager, params);
- }
-
- /**
- * Create a new HttpClient with reasonable defaults (which you can update).
- * @param userAgent to report in your HTTP requests.
- * @return AndroidHttpClient for you to use for all your requests.
- */
- public static AndroidHttpClient newInstance(String userAgent) {
- return newInstance(userAgent, null /* session cache */);
- }
-
- private final HttpClient delegate;
-
- private RuntimeException mLeakedException = new IllegalStateException(
- "AndroidHttpClient created and never closed");
-
- private AndroidHttpClient(ClientConnectionManager ccm, HttpParams params) {
- this.delegate = new DefaultHttpClient(ccm, params) {
- @Override
- protected BasicHttpProcessor createHttpProcessor() {
- // Add interceptor to prevent making requests from main thread.
- BasicHttpProcessor processor = super.createHttpProcessor();
- processor.addRequestInterceptor(sThreadCheckInterceptor);
- processor.addRequestInterceptor(new CurlLogger());
-
- return processor;
- }
-
- @Override
- protected HttpContext createHttpContext() {
- // Same as DefaultHttpClient.createHttpContext() minus the
- // cookie store.
- HttpContext context = new BasicHttpContext();
- context.setAttribute(
- ClientContext.AUTHSCHEME_REGISTRY,
- getAuthSchemes());
- context.setAttribute(
- ClientContext.COOKIESPEC_REGISTRY,
- getCookieSpecs());
- context.setAttribute(
- ClientContext.CREDS_PROVIDER,
- getCredentialsProvider());
- return context;
- }
- };
- }
-
- @Override
- protected void finalize() throws Throwable {
- super.finalize();
- if (mLeakedException != null) {
- Log.e(TAG, "Leak found", mLeakedException);
- mLeakedException = null;
- }
- }
-
- /**
- * Modifies a request to indicate to the server that we would like a
- * gzipped response. (Uses the "Accept-Encoding" HTTP header.)
- * @param request the request to modify
- * @see #getUngzippedContent
- */
- public static void modifyRequestToAcceptGzipResponse(HttpRequest request) {
- request.addHeader("Accept-Encoding", "gzip");
- }
-
- /**
- * Gets the input stream from a response entity. If the entity is gzipped
- * then this will get a stream over the uncompressed data.
- *
- * @param entity the entity whose content should be read
- * @return the input stream to read from
- * @throws IOException
- */
- public static InputStream getUngzippedContent(HttpEntity entity)
- throws IOException {
- InputStream responseStream = entity.getContent();
- if (responseStream == null) return responseStream;
- Header header = entity.getContentEncoding();
- if (header == null) return responseStream;
- String contentEncoding = header.getValue();
- if (contentEncoding == null) return responseStream;
- if (contentEncoding.contains("gzip")) responseStream
- = new GZIPInputStream(responseStream);
- return responseStream;
- }
-
- /**
- * Release resources associated with this client. You must call this,
- * or significant resources (sockets and memory) may be leaked.
- */
- public void close() {
- if (mLeakedException != null) {
- getConnectionManager().shutdown();
- mLeakedException = null;
- }
- }
-
- public HttpParams getParams() {
- return delegate.getParams();
- }
-
- public ClientConnectionManager getConnectionManager() {
- return delegate.getConnectionManager();
- }
-
- public HttpResponse execute(HttpUriRequest request) throws IOException {
- return delegate.execute(request);
- }
-
- public HttpResponse execute(HttpUriRequest request, HttpContext context)
- throws IOException {
- return delegate.execute(request, context);
- }
-
- public HttpResponse execute(HttpHost target, HttpRequest request)
- throws IOException {
- return delegate.execute(target, request);
- }
-
- public HttpResponse execute(HttpHost target, HttpRequest request,
- HttpContext context) throws IOException {
- return delegate.execute(target, request, context);
- }
-
- public <T> T execute(HttpUriRequest request,
- ResponseHandler<? extends T> responseHandler)
- throws IOException, ClientProtocolException {
- return delegate.execute(request, responseHandler);
- }
-
- public <T> T execute(HttpUriRequest request,
- ResponseHandler<? extends T> responseHandler, HttpContext context)
- throws IOException, ClientProtocolException {
- return delegate.execute(request, responseHandler, context);
- }
-
- public <T> T execute(HttpHost target, HttpRequest request,
- ResponseHandler<? extends T> responseHandler) throws IOException,
- ClientProtocolException {
- return delegate.execute(target, request, responseHandler);
- }
-
- public <T> T execute(HttpHost target, HttpRequest request,
- ResponseHandler<? extends T> responseHandler, HttpContext context)
- throws IOException, ClientProtocolException {
- return delegate.execute(target, request, responseHandler, context);
- }
-
- /**
- * Compress data to send to server.
- * Creates a Http Entity holding the gzipped data.
- * The data will not be compressed if it is too short.
- * @param data The bytes to compress
- * @return Entity holding the data
- */
- public static AbstractHttpEntity getCompressedEntity(byte data[], ContentResolver resolver)
- throws IOException {
- AbstractHttpEntity entity;
- if (data.length < getMinGzipSize(resolver)) {
- entity = new ByteArrayEntity(data);
- } else {
- ByteArrayOutputStream arr = new ByteArrayOutputStream();
- OutputStream zipper = new GZIPOutputStream(arr);
- zipper.write(data);
- zipper.close();
- entity = new ByteArrayEntity(arr.toByteArray());
- entity.setContentEncoding("gzip");
- }
- return entity;
- }
-
- /**
- * Retrieves the minimum size for compressing data.
- * Shorter data will not be compressed.
- */
- public static long getMinGzipSize(ContentResolver resolver) {
- return DEFAULT_SYNC_MIN_GZIP_BYTES; // For now, this is just a constant.
- }
-
- /* cURL logging support. */
-
- /**
- * Logging tag and level.
- */
- private static class LoggingConfiguration {
-
- private final String tag;
- private final int level;
-
- private LoggingConfiguration(String tag, int level) {
- this.tag = tag;
- this.level = level;
- }
-
- /**
- * Returns true if logging is turned on for this configuration.
- */
- private boolean isLoggable() {
- return Log.isLoggable(tag, level);
- }
-
- /**
- * Prints a message using this configuration.
- */
- private void println(String message) {
- Log.println(level, tag, message);
- }
- }
-
- /** cURL logging configuration. */
- private volatile LoggingConfiguration curlConfiguration;
-
- /**
- * Enables cURL request logging for this client.
- *
- * @param name to log messages with
- * @param level at which to log messages (see {@link android.util.Log})
- */
- public void enableCurlLogging(String name, int level) {
- if (name == null) {
- throw new NullPointerException("name");
- }
- if (level < Log.VERBOSE || level > Log.ASSERT) {
- throw new IllegalArgumentException("Level is out of range ["
- + Log.VERBOSE + ".." + Log.ASSERT + "]");
- }
-
- curlConfiguration = new LoggingConfiguration(name, level);
- }
-
- /**
- * Disables cURL logging for this client.
- */
- public void disableCurlLogging() {
- curlConfiguration = null;
- }
-
- /**
- * Logs cURL commands equivalent to requests.
- */
- private class CurlLogger implements HttpRequestInterceptor {
- public void process(HttpRequest request, HttpContext context)
- throws HttpException, IOException {
- LoggingConfiguration configuration = curlConfiguration;
- if (configuration != null
- && configuration.isLoggable()
- && request instanceof HttpUriRequest) {
- // Never print auth token -- we used to check ro.secure=0 to
- // enable that, but can't do that in unbundled code.
- configuration.println(toCurl((HttpUriRequest) request, false));
- }
- }
- }
-
- /**
- * Generates a cURL command equivalent to the given request.
- */
- private static String toCurl(HttpUriRequest request, boolean logAuthToken) throws IOException {
- StringBuilder builder = new StringBuilder();
-
- builder.append("curl ");
-
- for (Header header: request.getAllHeaders()) {
- if (!logAuthToken
- && (header.getName().equals("Authorization") ||
- header.getName().equals("Cookie"))) {
- continue;
- }
- builder.append("--header \"");
- builder.append(header.toString().trim());
- builder.append("\" ");
- }
-
- URI uri = request.getURI();
-
- // If this is a wrapped request, use the URI from the original
- // request instead. getURI() on the wrapper seems to return a
- // relative URI. We want an absolute URI.
- if (request instanceof RequestWrapper) {
- HttpRequest original = ((RequestWrapper) request).getOriginal();
- if (original instanceof HttpUriRequest) {
- uri = ((HttpUriRequest) original).getURI();
- }
- }
-
- builder.append("\"");
- builder.append(uri);
- builder.append("\"");
-
- if (request instanceof HttpEntityEnclosingRequest) {
- HttpEntityEnclosingRequest entityRequest =
- (HttpEntityEnclosingRequest) request;
- HttpEntity entity = entityRequest.getEntity();
- if (entity != null && entity.isRepeatable()) {
- if (entity.getContentLength() < 1024) {
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- entity.writeTo(stream);
- String entityString = stream.toString();
-
- // TODO: Check the content type, too.
- builder.append(" --data-ascii \"")
- .append(entityString)
- .append("\"");
- } else {
- builder.append(" [TOO MUCH DATA TO INCLUDE]");
- }
- }
- }
-
- return builder.toString();
- }
-
- /**
- * Returns the date of the given HTTP date string. This method can identify
- * and parse the date formats emitted by common HTTP servers, such as
- * <a href="http://www.ietf.org/rfc/rfc0822.txt">RFC 822</a>,
- * <a href="http://www.ietf.org/rfc/rfc0850.txt">RFC 850</a>,
- * <a href="http://www.ietf.org/rfc/rfc1036.txt">RFC 1036</a>,
- * <a href="http://www.ietf.org/rfc/rfc1123.txt">RFC 1123</a> and
- * <a href="http://www.opengroup.org/onlinepubs/007908799/xsh/asctime.html">ANSI
- * C's asctime()</a>.
- *
- * @return the number of milliseconds since Jan. 1, 1970, midnight GMT.
- * @throws IllegalArgumentException if {@code dateString} is not a date or
- * of an unsupported format.
- */
- public static long parseDate(String dateString) {
- return HttpDateTime.parse(dateString);
- }
-} \ No newline at end of file
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java
deleted file mode 100755
index b77af7e085..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader.impl;
-
-import android.app.Service;
-import android.content.Intent;
-import android.os.Handler;
-import android.os.HandlerThread;
-import android.os.IBinder;
-import android.os.Looper;
-import android.os.Message;
-import android.util.Log;
-
-/**
- * This service differs from IntentService in a few minor ways/ It will not
- * auto-stop itself after the intent is handled unless the target returns "true"
- * in should stop. Since the goal of this service is to handle a single kind of
- * intent, it does not queue up batches of intents of the same type.
- */
-public abstract class CustomIntentService extends Service {
- private String mName;
- private boolean mRedelivery;
- private volatile ServiceHandler mServiceHandler;
- private volatile Looper mServiceLooper;
- private static final String LOG_TAG = "CancellableIntentService";
- private static final int WHAT_MESSAGE = -10;
-
- public CustomIntentService(String paramString) {
- this.mName = paramString;
- }
-
- @Override
- public IBinder onBind(Intent paramIntent) {
- return null;
- }
-
- @Override
- public void onCreate() {
- super.onCreate();
- HandlerThread localHandlerThread = new HandlerThread("IntentService["
- + this.mName + "]");
- localHandlerThread.start();
- this.mServiceLooper = localHandlerThread.getLooper();
- this.mServiceHandler = new ServiceHandler(this.mServiceLooper);
- }
-
- @Override
- public void onDestroy() {
- Thread localThread = this.mServiceLooper.getThread();
- if ((localThread != null) && (localThread.isAlive())) {
- localThread.interrupt();
- }
- this.mServiceLooper.quit();
- Log.d(LOG_TAG, "onDestroy");
- }
-
- protected abstract void onHandleIntent(Intent paramIntent);
-
- protected abstract boolean shouldStop();
-
- @Override
- public void onStart(Intent paramIntent, int startId) {
- if (!this.mServiceHandler.hasMessages(WHAT_MESSAGE)) {
- Message localMessage = this.mServiceHandler.obtainMessage();
- localMessage.arg1 = startId;
- localMessage.obj = paramIntent;
- localMessage.what = WHAT_MESSAGE;
- this.mServiceHandler.sendMessage(localMessage);
- }
- }
-
- @Override
- public int onStartCommand(Intent paramIntent, int flags, int startId) {
- onStart(paramIntent, startId);
- return mRedelivery ? START_REDELIVER_INTENT : START_NOT_STICKY;
- }
-
- public void setIntentRedelivery(boolean enabled) {
- this.mRedelivery = enabled;
- }
-
- private final class ServiceHandler extends Handler {
- public ServiceHandler(Looper looper) {
- super(looper);
- }
-
- @Override
- public void handleMessage(Message paramMessage) {
- CustomIntentService.this
- .onHandleIntent((Intent) paramMessage.obj);
- if (shouldStop()) {
- Log.d(LOG_TAG, "stopSelf");
- CustomIntentService.this.stopSelf(paramMessage.arg1);
- Log.d(LOG_TAG, "afterStopSelf");
- }
- }
- }
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java
deleted file mode 100644
index 9a0ca02122..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader.impl;
-
-/**
- * Uses the class-loader model to utilize the updated notification builders in
- * Honeycomb while maintaining a compatible version for older devices.
- */
-public class CustomNotificationFactory {
- static public DownloadNotification.ICustomNotification createCustomNotification() {
- if (android.os.Build.VERSION.SDK_INT > 13)
- return new V14CustomNotification();
- else
- return new V3CustomNotification();
- }
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java
deleted file mode 100644
index 45111b16a3..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader.impl;
-
-import com.google.android.vending.expansion.downloader.Constants;
-import com.google.android.vending.expansion.downloader.Helpers;
-
-import android.util.Log;
-
-/**
- * Representation of information about an individual download from the database.
- */
-public class DownloadInfo {
- public String mUri;
- public final int mIndex;
- public final String mFileName;
- public String mETag;
- public long mTotalBytes;
- public long mCurrentBytes;
- public long mLastMod;
- public int mStatus;
- public int mControl;
- public int mNumFailed;
- public int mRetryAfter;
- public int mRedirectCount;
-
- boolean mInitialized;
-
- public int mFuzz;
-
- public DownloadInfo(int index, String fileName, String pkg) {
- mFuzz = Helpers.sRandom.nextInt(1001);
- mFileName = fileName;
- mIndex = index;
- }
-
- public void resetDownload() {
- mCurrentBytes = 0;
- mETag = "";
- mLastMod = 0;
- mStatus = 0;
- mControl = 0;
- mNumFailed = 0;
- mRetryAfter = 0;
- mRedirectCount = 0;
- }
-
- /**
- * Returns the time when a download should be restarted.
- */
- public long restartTime(long now) {
- if (mNumFailed == 0) {
- return now;
- }
- if (mRetryAfter > 0) {
- return mLastMod + mRetryAfter;
- }
- return mLastMod +
- Constants.RETRY_FIRST_DELAY *
- (1000 + mFuzz) * (1 << (mNumFailed - 1));
- }
-
- public void logVerboseInfo() {
- Log.v(Constants.TAG, "Service adding new entry");
- Log.v(Constants.TAG, "FILENAME: " + mFileName);
- Log.v(Constants.TAG, "URI : " + mUri);
- Log.v(Constants.TAG, "FILENAME: " + mFileName);
- Log.v(Constants.TAG, "CONTROL : " + mControl);
- Log.v(Constants.TAG, "STATUS : " + mStatus);
- Log.v(Constants.TAG, "FAILED_C: " + mNumFailed);
- Log.v(Constants.TAG, "RETRY_AF: " + mRetryAfter);
- Log.v(Constants.TAG, "REDIRECT: " + mRedirectCount);
- Log.v(Constants.TAG, "LAST_MOD: " + mLastMod);
- Log.v(Constants.TAG, "TOTAL : " + mTotalBytes);
- Log.v(Constants.TAG, "CURRENT : " + mCurrentBytes);
- Log.v(Constants.TAG, "ETAG : " + mETag);
- }
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java
deleted file mode 100644
index 056d1eca0b..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java
+++ /dev/null
@@ -1,963 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader.impl;
-
-import com.google.android.vending.expansion.downloader.Constants;
-import com.google.android.vending.expansion.downloader.Helpers;
-import com.google.android.vending.expansion.downloader.IDownloaderClient;
-
-import org.apache.http.Header;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.conn.params.ConnRouteParams;
-
-import android.content.Context;
-import android.net.Proxy;
-import android.os.PowerManager;
-import android.os.Process;
-import android.util.Log;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.SyncFailedException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Locale;
-
-/**
- * Runs an actual download
- */
-public class DownloadThread {
-
- private Context mContext;
- private DownloadInfo mInfo;
- private DownloaderService mService;
- private final DownloadsDB mDB;
- private final DownloadNotification mNotification;
- private String mUserAgent;
-
- public DownloadThread(DownloadInfo info, DownloaderService service,
- DownloadNotification notification) {
- mContext = service;
- mInfo = info;
- mService = service;
- mNotification = notification;
- mDB = DownloadsDB.getDB(service);
- mUserAgent = "APKXDL (Linux; U; Android " + android.os.Build.VERSION.RELEASE + ";"
- + Locale.getDefault().toString() + "; " + android.os.Build.DEVICE + "/"
- + android.os.Build.ID + ")" +
- service.getPackageName();
- }
-
- /**
- * Returns the default user agent
- */
- private String userAgent() {
- return mUserAgent;
- }
-
- /**
- * State for the entire run() method.
- */
- private static class State {
- public String mFilename;
- public FileOutputStream mStream;
- public boolean mCountRetry = false;
- public int mRetryAfter = 0;
- public int mRedirectCount = 0;
- public String mNewUri;
- public boolean mGotData = false;
- public String mRequestUri;
-
- public State(DownloadInfo info, DownloaderService service) {
- mRedirectCount = info.mRedirectCount;
- mRequestUri = info.mUri;
- mFilename = service.generateTempSaveFileName(info.mFileName);
- }
- }
-
- /**
- * State within executeDownload()
- */
- private static class InnerState {
- public int mBytesSoFar = 0;
- public int mBytesThisSession = 0;
- public String mHeaderETag;
- public boolean mContinuingDownload = false;
- public String mHeaderContentLength;
- public String mHeaderContentDisposition;
- public String mHeaderContentLocation;
- public int mBytesNotified = 0;
- public long mTimeLastNotification = 0;
- }
-
- /**
- * Raised from methods called by run() to indicate that the current request
- * should be stopped immediately. Note the message passed to this exception
- * will be logged and therefore must be guaranteed not to contain any PII,
- * meaning it generally can't include any information about the request URI,
- * headers, or destination filename.
- */
- private class StopRequest extends Throwable {
- /**
- *
- */
- private static final long serialVersionUID = 6338592678988347973L;
- public int mFinalStatus;
-
- public StopRequest(int finalStatus, String message) {
- super(message);
- mFinalStatus = finalStatus;
- }
-
- public StopRequest(int finalStatus, String message, Throwable throwable) {
- super(message, throwable);
- mFinalStatus = finalStatus;
- }
- }
-
- /**
- * Raised from methods called by executeDownload() to indicate that the
- * download should be retried immediately.
- */
- private class RetryDownload extends Throwable {
-
- /**
- *
- */
- private static final long serialVersionUID = 6196036036517540229L;
- }
-
- /**
- * Returns the preferred proxy to be used by clients. This is a wrapper
- * around {@link android.net.Proxy#getHost()}. Currently no proxy will be
- * returned for localhost or if the active network is Wi-Fi.
- *
- * @param context the context which will be passed to
- * {@link android.net.Proxy#getHost()}
- * @param url the target URL for the request
- * @note Calling this method requires permission
- * android.permission.ACCESS_NETWORK_STATE
- * @return The preferred proxy to be used by clients, or null if there is no
- * proxy.
- */
- public HttpHost getPreferredHttpHost(Context context,
- String url) {
- if (!isLocalHost(url) && !mService.isWiFi()) {
- final String proxyHost = Proxy.getHost(context);
- if (proxyHost != null) {
- return new HttpHost(proxyHost, Proxy.getPort(context), "http");
- }
- }
-
- return null;
- }
-
- static final private boolean isLocalHost(String url) {
- if (url == null) {
- return false;
- }
-
- try {
- final URI uri = URI.create(url);
- final String host = uri.getHost();
- if (host != null) {
- // TODO: InetAddress.isLoopbackAddress should be used to check
- // for localhost. However no public factory methods exist which
- // can be used without triggering DNS lookup if host is not
- // localhost.
- if (host.equalsIgnoreCase("localhost") ||
- host.equals("127.0.0.1") ||
- host.equals("[::1]")) {
- return true;
- }
- }
- } catch (IllegalArgumentException iex) {
- // Ignore (URI.create)
- }
-
- return false;
- }
-
- /**
- * Executes the download in a separate thread
- */
- public void run() {
- Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
-
- State state = new State(mInfo, mService);
- AndroidHttpClient client = null;
- PowerManager.WakeLock wakeLock = null;
- int finalStatus = DownloaderService.STATUS_UNKNOWN_ERROR;
-
- try {
- PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
- wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Constants.TAG);
- wakeLock.acquire();
-
- if (Constants.LOGV) {
- Log.v(Constants.TAG, "initiating download for " + mInfo.mFileName);
- Log.v(Constants.TAG, " at " + mInfo.mUri);
- }
-
- client = AndroidHttpClient.newInstance(userAgent(), mContext);
-
- boolean finished = false;
- while (!finished) {
- if (Constants.LOGV) {
- Log.v(Constants.TAG, "initiating download for " + mInfo.mFileName);
- Log.v(Constants.TAG, " at " + mInfo.mUri);
- }
- // Set or unset proxy, which may have changed since last GET
- // request.
- // setDefaultProxy() supports null as proxy parameter.
- ConnRouteParams.setDefaultProxy(client.getParams(),
- getPreferredHttpHost(mContext, state.mRequestUri));
- HttpGet request = new HttpGet(state.mRequestUri);
- try {
- executeDownload(state, client, request);
- finished = true;
- } catch (RetryDownload exc) {
- // fall through
- } finally {
- request.abort();
- request = null;
- }
- }
-
- if (Constants.LOGV) {
- Log.v(Constants.TAG, "download completed for " + mInfo.mFileName);
- Log.v(Constants.TAG, " at " + mInfo.mUri);
- }
- finalizeDestinationFile(state);
- finalStatus = DownloaderService.STATUS_SUCCESS;
- } catch (StopRequest error) {
- // remove the cause before printing, in case it contains PII
- Log.w(Constants.TAG,
- "Aborting request for download " + mInfo.mFileName + ": " + error.getMessage());
- error.printStackTrace();
- finalStatus = error.mFinalStatus;
- // fall through to finally block
- } catch (Throwable ex) { // sometimes the socket code throws unchecked
- // exceptions
- Log.w(Constants.TAG, "Exception for " + mInfo.mFileName + ": " + ex);
- finalStatus = DownloaderService.STATUS_UNKNOWN_ERROR;
- // falls through to the code that reports an error
- } finally {
- if (wakeLock != null) {
- wakeLock.release();
- wakeLock = null;
- }
- if (client != null) {
- client.close();
- client = null;
- }
- cleanupDestination(state, finalStatus);
- notifyDownloadCompleted(finalStatus, state.mCountRetry, state.mRetryAfter,
- state.mRedirectCount, state.mGotData, state.mFilename);
- }
- }
-
- /**
- * Fully execute a single download request - setup and send the request,
- * handle the response, and transfer the data to the destination file.
- */
- private void executeDownload(State state, AndroidHttpClient client, HttpGet request)
- throws StopRequest, RetryDownload {
- InnerState innerState = new InnerState();
- byte data[] = new byte[Constants.BUFFER_SIZE];
-
- checkPausedOrCanceled(state);
-
- setupDestinationFile(state, innerState);
- addRequestHeaders(innerState, request);
-
- // check just before sending the request to avoid using an invalid
- // connection at all
- checkConnectivity(state);
-
- mNotification.onDownloadStateChanged(IDownloaderClient.STATE_CONNECTING);
- HttpResponse response = sendRequest(state, client, request);
- handleExceptionalStatus(state, innerState, response);
-
- if (Constants.LOGV) {
- Log.v(Constants.TAG, "received response for " + mInfo.mUri);
- }
-
- processResponseHeaders(state, innerState, response);
- InputStream entityStream = openResponseEntity(state, response);
- mNotification.onDownloadStateChanged(IDownloaderClient.STATE_DOWNLOADING);
- transferData(state, innerState, data, entityStream);
- }
-
- /**
- * Check if current connectivity is valid for this request.
- */
- private void checkConnectivity(State state) throws StopRequest {
- switch (mService.getNetworkAvailabilityState(mDB)) {
- case DownloaderService.NETWORK_OK:
- return;
- case DownloaderService.NETWORK_NO_CONNECTION:
- throw new StopRequest(DownloaderService.STATUS_WAITING_FOR_NETWORK,
- "waiting for network to return");
- case DownloaderService.NETWORK_TYPE_DISALLOWED_BY_REQUESTOR:
- throw new StopRequest(
- DownloaderService.STATUS_QUEUED_FOR_WIFI_OR_CELLULAR_PERMISSION,
- "waiting for wifi or for download over cellular to be authorized");
- case DownloaderService.NETWORK_CANNOT_USE_ROAMING:
- throw new StopRequest(DownloaderService.STATUS_WAITING_FOR_NETWORK,
- "roaming is not allowed");
- case DownloaderService.NETWORK_UNUSABLE_DUE_TO_SIZE:
- throw new StopRequest(DownloaderService.STATUS_QUEUED_FOR_WIFI, "waiting for wifi");
- }
- }
-
- /**
- * Transfer as much data as possible from the HTTP response to the
- * destination file.
- *
- * @param data buffer to use to read data
- * @param entityStream stream for reading the HTTP response entity
- */
- private void transferData(State state, InnerState innerState, byte[] data,
- InputStream entityStream) throws StopRequest {
- for (;;) {
- int bytesRead = readFromResponse(state, innerState, data, entityStream);
- if (bytesRead == -1) { // success, end of stream already reached
- handleEndOfStream(state, innerState);
- return;
- }
-
- state.mGotData = true;
- writeDataToDestination(state, data, bytesRead);
- innerState.mBytesSoFar += bytesRead;
- innerState.mBytesThisSession += bytesRead;
- reportProgress(state, innerState);
-
- checkPausedOrCanceled(state);
- }
- }
-
- /**
- * Called after a successful completion to take any necessary action on the
- * downloaded file.
- */
- private void finalizeDestinationFile(State state) throws StopRequest {
- syncDestination(state);
- String tempFilename = state.mFilename;
- String finalFilename = Helpers.generateSaveFileName(mService, mInfo.mFileName);
- if (!state.mFilename.equals(finalFilename)) {
- File startFile = new File(tempFilename);
- File destFile = new File(finalFilename);
- if (mInfo.mTotalBytes != -1 && mInfo.mCurrentBytes == mInfo.mTotalBytes) {
- if (!startFile.renameTo(destFile)) {
- throw new StopRequest(DownloaderService.STATUS_FILE_ERROR,
- "unable to finalize destination file");
- }
- } else {
- throw new StopRequest(DownloaderService.STATUS_FILE_DELIVERED_INCORRECTLY,
- "file delivered with incorrect size. probably due to network not browser configured");
- }
- }
- }
-
- /**
- * Called just before the thread finishes, regardless of status, to take any
- * necessary action on the downloaded file.
- */
- private void cleanupDestination(State state, int finalStatus) {
- closeDestination(state);
- if (state.mFilename != null && DownloaderService.isStatusError(finalStatus)) {
- new File(state.mFilename).delete();
- state.mFilename = null;
- }
- }
-
- /**
- * Sync the destination file to storage.
- */
- private void syncDestination(State state) {
- FileOutputStream downloadedFileStream = null;
- try {
- downloadedFileStream = new FileOutputStream(state.mFilename, true);
- downloadedFileStream.getFD().sync();
- } catch (FileNotFoundException ex) {
- Log.w(Constants.TAG, "file " + state.mFilename + " not found: " + ex);
- } catch (SyncFailedException ex) {
- Log.w(Constants.TAG, "file " + state.mFilename + " sync failed: " + ex);
- } catch (IOException ex) {
- Log.w(Constants.TAG, "IOException trying to sync " + state.mFilename + ": " + ex);
- } catch (RuntimeException ex) {
- Log.w(Constants.TAG, "exception while syncing file: ", ex);
- } finally {
- if (downloadedFileStream != null) {
- try {
- downloadedFileStream.close();
- } catch (IOException ex) {
- Log.w(Constants.TAG, "IOException while closing synced file: ", ex);
- } catch (RuntimeException ex) {
- Log.w(Constants.TAG, "exception while closing file: ", ex);
- }
- }
- }
- }
-
- /**
- * Close the destination output stream.
- */
- private void closeDestination(State state) {
- try {
- // close the file
- if (state.mStream != null) {
- state.mStream.close();
- state.mStream = null;
- }
- } catch (IOException ex) {
- if (Constants.LOGV) {
- Log.v(Constants.TAG, "exception when closing the file after download : " + ex);
- }
- // nothing can really be done if the file can't be closed
- }
- }
-
- /**
- * Check if the download has been paused or canceled, stopping the request
- * appropriately if it has been.
- */
- private void checkPausedOrCanceled(State state) throws StopRequest {
- if (mService.getControl() == DownloaderService.CONTROL_PAUSED) {
- int status = mService.getStatus();
- switch (status) {
- case DownloaderService.STATUS_PAUSED_BY_APP:
- throw new StopRequest(mService.getStatus(),
- "download paused");
- }
- }
- }
-
- /**
- * Report download progress through the database if necessary.
- */
- private void reportProgress(State state, InnerState innerState) {
- long now = System.currentTimeMillis();
- if (innerState.mBytesSoFar - innerState.mBytesNotified
- > Constants.MIN_PROGRESS_STEP
- && now - innerState.mTimeLastNotification
- > Constants.MIN_PROGRESS_TIME) {
- // we store progress updates to the database here
- mInfo.mCurrentBytes = innerState.mBytesSoFar;
- mDB.updateDownloadCurrentBytes(mInfo);
-
- innerState.mBytesNotified = innerState.mBytesSoFar;
- innerState.mTimeLastNotification = now;
-
- long totalBytesSoFar = innerState.mBytesThisSession + mService.mBytesSoFar;
-
- if (Constants.LOGVV) {
- Log.v(Constants.TAG, "downloaded " + mInfo.mCurrentBytes + " out of "
- + mInfo.mTotalBytes);
- Log.v(Constants.TAG, " total " + totalBytesSoFar + " out of "
- + mService.mTotalLength);
- }
-
- mService.notifyUpdateBytes(totalBytesSoFar);
- }
- }
-
- /**
- * Write a data buffer to the destination file.
- *
- * @param data buffer containing the data to write
- * @param bytesRead how many bytes to write from the buffer
- */
- private void writeDataToDestination(State state, byte[] data, int bytesRead)
- throws StopRequest {
- for (;;) {
- try {
- if (state.mStream == null) {
- state.mStream = new FileOutputStream(state.mFilename, true);
- }
- state.mStream.write(data, 0, bytesRead);
- // we close after every write --- this may be too inefficient
- closeDestination(state);
- return;
- } catch (IOException ex) {
- if (!Helpers.isExternalMediaMounted()) {
- throw new StopRequest(DownloaderService.STATUS_DEVICE_NOT_FOUND_ERROR,
- "external media not mounted while writing destination file");
- }
-
- long availableBytes =
- Helpers.getAvailableBytes(Helpers.getFilesystemRoot(state.mFilename));
- if (availableBytes < bytesRead) {
- throw new StopRequest(DownloaderService.STATUS_INSUFFICIENT_SPACE_ERROR,
- "insufficient space while writing destination file", ex);
- }
- throw new StopRequest(DownloaderService.STATUS_FILE_ERROR,
- "while writing destination file: " + ex.toString(), ex);
- }
- }
- }
-
- /**
- * Called when we've reached the end of the HTTP response stream, to update
- * the database and check for consistency.
- */
- private void handleEndOfStream(State state, InnerState innerState) throws StopRequest {
- mInfo.mCurrentBytes = innerState.mBytesSoFar;
- // this should always be set from the market
- // if ( innerState.mHeaderContentLength == null ) {
- // mInfo.mTotalBytes = innerState.mBytesSoFar;
- // }
- mDB.updateDownload(mInfo);
-
- boolean lengthMismatched = (innerState.mHeaderContentLength != null)
- && (innerState.mBytesSoFar != Integer.parseInt(innerState.mHeaderContentLength));
- if (lengthMismatched) {
- if (cannotResume(innerState)) {
- throw new StopRequest(DownloaderService.STATUS_CANNOT_RESUME,
- "mismatched content length");
- } else {
- throw new StopRequest(getFinalStatusForHttpError(state),
- "closed socket before end of file");
- }
- }
- }
-
- private boolean cannotResume(InnerState innerState) {
- return innerState.mBytesSoFar > 0 && innerState.mHeaderETag == null;
- }
-
- /**
- * Read some data from the HTTP response stream, handling I/O errors.
- *
- * @param data buffer to use to read data
- * @param entityStream stream for reading the HTTP response entity
- * @return the number of bytes actually read or -1 if the end of the stream
- * has been reached
- */
- private int readFromResponse(State state, InnerState innerState, byte[] data,
- InputStream entityStream) throws StopRequest {
- try {
- return entityStream.read(data);
- } catch (IOException ex) {
- logNetworkState();
- mInfo.mCurrentBytes = innerState.mBytesSoFar;
- mDB.updateDownload(mInfo);
- if (cannotResume(innerState)) {
- String message = "while reading response: " + ex.toString()
- + ", can't resume interrupted download with no ETag";
- throw new StopRequest(DownloaderService.STATUS_CANNOT_RESUME,
- message, ex);
- } else {
- throw new StopRequest(getFinalStatusForHttpError(state),
- "while reading response: " + ex.toString(), ex);
- }
- }
- }
-
- /**
- * Open a stream for the HTTP response entity, handling I/O errors.
- *
- * @return an InputStream to read the response entity
- */
- private InputStream openResponseEntity(State state, HttpResponse response)
- throws StopRequest {
- try {
- return response.getEntity().getContent();
- } catch (IOException ex) {
- logNetworkState();
- throw new StopRequest(getFinalStatusForHttpError(state),
- "while getting entity: " + ex.toString(), ex);
- }
- }
-
- private void logNetworkState() {
- if (Constants.LOGX) {
- Log.i(Constants.TAG,
- "Net "
- + (mService.getNetworkAvailabilityState(mDB) == DownloaderService.NETWORK_OK ? "Up"
- : "Down"));
- }
- }
-
- /**
- * Read HTTP response headers and take appropriate action, including setting
- * up the destination file and updating the database.
- */
- private void processResponseHeaders(State state, InnerState innerState, HttpResponse response)
- throws StopRequest {
- if (innerState.mContinuingDownload) {
- // ignore response headers on resume requests
- return;
- }
-
- readResponseHeaders(state, innerState, response);
-
- try {
- state.mFilename = mService.generateSaveFile(mInfo.mFileName, mInfo.mTotalBytes);
- } catch (DownloaderService.GenerateSaveFileError exc) {
- throw new StopRequest(exc.mStatus, exc.mMessage);
- }
- try {
- state.mStream = new FileOutputStream(state.mFilename);
- } catch (FileNotFoundException exc) {
- // make sure the directory exists
- File pathFile = new File(Helpers.getSaveFilePath(mService));
- try {
- if (pathFile.mkdirs()) {
- state.mStream = new FileOutputStream(state.mFilename);
- }
- } catch (Exception ex) {
- throw new StopRequest(DownloaderService.STATUS_FILE_ERROR,
- "while opening destination file: " + exc.toString(), exc);
- }
- }
- if (Constants.LOGV) {
- Log.v(Constants.TAG, "writing " + mInfo.mUri + " to " + state.mFilename);
- }
-
- updateDatabaseFromHeaders(state, innerState);
- // check connectivity again now that we know the total size
- checkConnectivity(state);
- }
-
- /**
- * Update necessary database fields based on values of HTTP response headers
- * that have been read.
- */
- private void updateDatabaseFromHeaders(State state, InnerState innerState) {
- mInfo.mETag = innerState.mHeaderETag;
- mDB.updateDownload(mInfo);
- }
-
- /**
- * Read headers from the HTTP response and store them into local state.
- */
- private void readResponseHeaders(State state, InnerState innerState, HttpResponse response)
- throws StopRequest {
- Header header = response.getFirstHeader("Content-Disposition");
- if (header != null) {
- innerState.mHeaderContentDisposition = header.getValue();
- }
- header = response.getFirstHeader("Content-Location");
- if (header != null) {
- innerState.mHeaderContentLocation = header.getValue();
- }
- header = response.getFirstHeader("ETag");
- if (header != null) {
- innerState.mHeaderETag = header.getValue();
- }
- String headerTransferEncoding = null;
- header = response.getFirstHeader("Transfer-Encoding");
- if (header != null) {
- headerTransferEncoding = header.getValue();
- }
- String headerContentType = null;
- header = response.getFirstHeader("Content-Type");
- if (header != null) {
- headerContentType = header.getValue();
- if (!headerContentType.equals("application/vnd.android.obb")) {
- throw new StopRequest(DownloaderService.STATUS_FILE_DELIVERED_INCORRECTLY,
- "file delivered with incorrect Mime type");
- }
- }
-
- if (headerTransferEncoding == null) {
- header = response.getFirstHeader("Content-Length");
- if (header != null) {
- innerState.mHeaderContentLength = header.getValue();
- // this is always set from Market
- long contentLength = Long.parseLong(innerState.mHeaderContentLength);
- if (contentLength != -1 && contentLength != mInfo.mTotalBytes) {
- // we're most likely on a bad wifi connection -- we should
- // probably
- // also look at the mime type --- but the size mismatch is
- // enough
- // to tell us that something is wrong here
- Log.e(Constants.TAG, "Incorrect file size delivered.");
- }
- }
- } else {
- // Ignore content-length with transfer-encoding - 2616 4.4 3
- if (Constants.LOGVV) {
- Log.v(Constants.TAG,
- "ignoring content-length because of xfer-encoding");
- }
- }
- if (Constants.LOGVV) {
- Log.v(Constants.TAG, "Content-Disposition: " +
- innerState.mHeaderContentDisposition);
- Log.v(Constants.TAG, "Content-Length: " + innerState.mHeaderContentLength);
- Log.v(Constants.TAG, "Content-Location: " + innerState.mHeaderContentLocation);
- Log.v(Constants.TAG, "ETag: " + innerState.mHeaderETag);
- Log.v(Constants.TAG, "Transfer-Encoding: " + headerTransferEncoding);
- }
-
- boolean noSizeInfo = innerState.mHeaderContentLength == null
- && (headerTransferEncoding == null
- || !headerTransferEncoding.equalsIgnoreCase("chunked"));
- if (noSizeInfo) {
- throw new StopRequest(DownloaderService.STATUS_HTTP_DATA_ERROR,
- "can't know size of download, giving up");
- }
- }
-
- /**
- * Check the HTTP response status and handle anything unusual (e.g. not
- * 200/206).
- */
- private void handleExceptionalStatus(State state, InnerState innerState, HttpResponse response)
- throws StopRequest, RetryDownload {
- int statusCode = response.getStatusLine().getStatusCode();
- if (statusCode == 503 && mInfo.mNumFailed < Constants.MAX_RETRIES) {
- handleServiceUnavailable(state, response);
- }
- if (statusCode == 301 || statusCode == 302 || statusCode == 303 || statusCode == 307) {
- handleRedirect(state, response, statusCode);
- }
-
- int expectedStatus = innerState.mContinuingDownload ? 206
- : DownloaderService.STATUS_SUCCESS;
- if (statusCode != expectedStatus) {
- handleOtherStatus(state, innerState, statusCode);
- } else {
- // no longer redirected
- state.mRedirectCount = 0;
- }
- }
-
- /**
- * Handle a status that we don't know how to deal with properly.
- */
- private void handleOtherStatus(State state, InnerState innerState, int statusCode)
- throws StopRequest {
- int finalStatus;
- if (DownloaderService.isStatusError(statusCode)) {
- finalStatus = statusCode;
- } else if (statusCode >= 300 && statusCode < 400) {
- finalStatus = DownloaderService.STATUS_UNHANDLED_REDIRECT;
- } else if (innerState.mContinuingDownload && statusCode == DownloaderService.STATUS_SUCCESS) {
- finalStatus = DownloaderService.STATUS_CANNOT_RESUME;
- } else {
- finalStatus = DownloaderService.STATUS_UNHANDLED_HTTP_CODE;
- }
- throw new StopRequest(finalStatus, "http error " + statusCode);
- }
-
- /**
- * Handle a 3xx redirect status.
- */
- private void handleRedirect(State state, HttpResponse response, int statusCode)
- throws StopRequest, RetryDownload {
- if (Constants.LOGVV) {
- Log.v(Constants.TAG, "got HTTP redirect " + statusCode);
- }
- if (state.mRedirectCount >= Constants.MAX_REDIRECTS) {
- throw new StopRequest(DownloaderService.STATUS_TOO_MANY_REDIRECTS, "too many redirects");
- }
- Header header = response.getFirstHeader("Location");
- if (header == null) {
- return;
- }
- if (Constants.LOGVV) {
- Log.v(Constants.TAG, "Location :" + header.getValue());
- }
-
- String newUri;
- try {
- newUri = new URI(mInfo.mUri).resolve(new URI(header.getValue())).toString();
- } catch (URISyntaxException ex) {
- if (Constants.LOGV) {
- Log.d(Constants.TAG, "Couldn't resolve redirect URI " + header.getValue()
- + " for " + mInfo.mUri);
- }
- throw new StopRequest(DownloaderService.STATUS_HTTP_DATA_ERROR,
- "Couldn't resolve redirect URI");
- }
- ++state.mRedirectCount;
- state.mRequestUri = newUri;
- if (statusCode == 301 || statusCode == 303) {
- // use the new URI for all future requests (should a retry/resume be
- // necessary)
- state.mNewUri = newUri;
- }
- throw new RetryDownload();
- }
-
- /**
- * Add headers for this download to the HTTP request to allow for resume.
- */
- private void addRequestHeaders(InnerState innerState, HttpGet request) {
- if (innerState.mContinuingDownload) {
- if (innerState.mHeaderETag != null) {
- request.addHeader("If-Match", innerState.mHeaderETag);
- }
- request.addHeader("Range", "bytes=" + innerState.mBytesSoFar + "-");
- }
- }
-
- /**
- * Handle a 503 Service Unavailable status by processing the Retry-After
- * header.
- */
- private void handleServiceUnavailable(State state, HttpResponse response) throws StopRequest {
- if (Constants.LOGVV) {
- Log.v(Constants.TAG, "got HTTP response code 503");
- }
- state.mCountRetry = true;
- Header header = response.getFirstHeader("Retry-After");
- if (header != null) {
- try {
- if (Constants.LOGVV) {
- Log.v(Constants.TAG, "Retry-After :" + header.getValue());
- }
- state.mRetryAfter = Integer.parseInt(header.getValue());
- if (state.mRetryAfter < 0) {
- state.mRetryAfter = 0;
- } else {
- if (state.mRetryAfter < Constants.MIN_RETRY_AFTER) {
- state.mRetryAfter = Constants.MIN_RETRY_AFTER;
- } else if (state.mRetryAfter > Constants.MAX_RETRY_AFTER) {
- state.mRetryAfter = Constants.MAX_RETRY_AFTER;
- }
- state.mRetryAfter += Helpers.sRandom.nextInt(Constants.MIN_RETRY_AFTER + 1);
- state.mRetryAfter *= 1000;
- }
- } catch (NumberFormatException ex) {
- // ignored - retryAfter stays 0 in this case.
- }
- }
- throw new StopRequest(DownloaderService.STATUS_WAITING_TO_RETRY,
- "got 503 Service Unavailable, will retry later");
- }
-
- /**
- * Send the request to the server, handling any I/O exceptions.
- */
- private HttpResponse sendRequest(State state, AndroidHttpClient client, HttpGet request)
- throws StopRequest {
- try {
- return client.execute(request);
- } catch (IllegalArgumentException ex) {
- throw new StopRequest(DownloaderService.STATUS_HTTP_DATA_ERROR,
- "while trying to execute request: " + ex.toString(), ex);
- } catch (IOException ex) {
- logNetworkState();
- throw new StopRequest(getFinalStatusForHttpError(state),
- "while trying to execute request: " + ex.toString(), ex);
- }
- }
-
- private int getFinalStatusForHttpError(State state) {
- if (mService.getNetworkAvailabilityState(mDB) != DownloaderService.NETWORK_OK) {
- return DownloaderService.STATUS_WAITING_FOR_NETWORK;
- } else if (mInfo.mNumFailed < Constants.MAX_RETRIES) {
- state.mCountRetry = true;
- return DownloaderService.STATUS_WAITING_TO_RETRY;
- } else {
- Log.w(Constants.TAG, "reached max retries for " + mInfo.mNumFailed);
- return DownloaderService.STATUS_HTTP_DATA_ERROR;
- }
- }
-
- /**
- * Prepare the destination file to receive data. If the file already exists,
- * we'll set up appropriately for resumption.
- */
- private void setupDestinationFile(State state, InnerState innerState)
- throws StopRequest {
- if (state.mFilename != null) { // only true if we've already run a
- // thread for this download
- if (!Helpers.isFilenameValid(state.mFilename)) {
- // this should never happen
- throw new StopRequest(DownloaderService.STATUS_FILE_ERROR,
- "found invalid internal destination filename");
- }
- // We're resuming a download that got interrupted
- File f = new File(state.mFilename);
- if (f.exists()) {
- long fileLength = f.length();
- if (fileLength == 0) {
- // The download hadn't actually started, we can restart from
- // scratch
- f.delete();
- state.mFilename = null;
- } else if (mInfo.mETag == null) {
- // This should've been caught upon failure
- f.delete();
- throw new StopRequest(DownloaderService.STATUS_CANNOT_RESUME,
- "Trying to resume a download that can't be resumed");
- } else {
- // All right, we'll be able to resume this download
- try {
- state.mStream = new FileOutputStream(state.mFilename, true);
- } catch (FileNotFoundException exc) {
- throw new StopRequest(DownloaderService.STATUS_FILE_ERROR,
- "while opening destination for resuming: " + exc.toString(), exc);
- }
- innerState.mBytesSoFar = (int) fileLength;
- if (mInfo.mTotalBytes != -1) {
- innerState.mHeaderContentLength = Long.toString(mInfo.mTotalBytes);
- }
- innerState.mHeaderETag = mInfo.mETag;
- innerState.mContinuingDownload = true;
- }
- }
- }
-
- if (state.mStream != null) {
- closeDestination(state);
- }
- }
-
- /**
- * Stores information about the completed download, and notifies the
- * initiating application.
- */
- private void notifyDownloadCompleted(
- int status, boolean countRetry, int retryAfter, int redirectCount, boolean gotData,
- String filename) {
- updateDownloadDatabase(
- status, countRetry, retryAfter, redirectCount, gotData, filename);
- if (DownloaderService.isStatusCompleted(status)) {
- // TBD: send status update?
- }
- }
-
- private void updateDownloadDatabase(
- int status, boolean countRetry, int retryAfter, int redirectCount, boolean gotData,
- String filename) {
- mInfo.mStatus = status;
- mInfo.mRetryAfter = retryAfter;
- mInfo.mRedirectCount = redirectCount;
- mInfo.mLastMod = System.currentTimeMillis();
- if (!countRetry) {
- mInfo.mNumFailed = 0;
- } else if (gotData) {
- mInfo.mNumFailed = 1;
- } else {
- mInfo.mNumFailed++;
- }
- mDB.updateDownload(mInfo);
- }
-
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java
deleted file mode 100644
index 627bf3eedd..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java
+++ /dev/null
@@ -1,1341 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader.impl;
-
-import com.google.android.vending.expansion.downloader.Constants;
-import com.google.android.vending.expansion.downloader.DownloadProgressInfo;
-import com.google.android.vending.expansion.downloader.DownloaderServiceMarshaller;
-import com.google.android.vending.expansion.downloader.Helpers;
-import com.google.android.vending.expansion.downloader.IDownloaderClient;
-import com.google.android.vending.expansion.downloader.IDownloaderService;
-import com.google.android.vending.expansion.downloader.IStub;
-import com.google.android.vending.licensing.AESObfuscator;
-import com.google.android.vending.licensing.APKExpansionPolicy;
-import com.google.android.vending.licensing.LicenseChecker;
-import com.google.android.vending.licensing.LicenseCheckerCallback;
-import com.google.android.vending.licensing.Policy;
-
-import android.app.AlarmManager;
-import android.app.PendingIntent;
-import android.app.Service;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.net.ConnectivityManager;
-import android.net.NetworkInfo;
-import android.net.wifi.WifiManager;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Messenger;
-import android.os.SystemClock;
-import android.provider.Settings.Secure;
-import android.telephony.TelephonyManager;
-import android.util.Log;
-
-import java.io.File;
-
-/**
- * Performs the background downloads requested by applications that use the
- * Downloads provider. This service does not run as a foreground task, so
- * Android may kill it off at will, but it will try to restart itself if it can.
- * Note that Android by default will kill off any process that has an open file
- * handle on the shared (SD Card) partition if the partition is unmounted.
- */
-public abstract class DownloaderService extends CustomIntentService implements IDownloaderService {
-
- public DownloaderService() {
- super("LVLDownloadService");
- }
-
- private static final String LOG_TAG = "LVLDL";
-
- // the following NETWORK_* constants are used to indicates specific reasons
- // for disallowing a
- // download from using a network, since specific causes can require special
- // handling
-
- /**
- * The network is usable for the given download.
- */
- public static final int NETWORK_OK = 1;
-
- /**
- * There is no network connectivity.
- */
- public static final int NETWORK_NO_CONNECTION = 2;
-
- /**
- * The download exceeds the maximum size for this network.
- */
- public static final int NETWORK_UNUSABLE_DUE_TO_SIZE = 3;
-
- /**
- * The download exceeds the recommended maximum size for this network, the
- * user must confirm for this download to proceed without WiFi.
- */
- public static final int NETWORK_RECOMMENDED_UNUSABLE_DUE_TO_SIZE = 4;
-
- /**
- * The current connection is roaming, and the download can't proceed over a
- * roaming connection.
- */
- public static final int NETWORK_CANNOT_USE_ROAMING = 5;
-
- /**
- * The app requesting the download specific that it can't use the current
- * network connection.
- */
- public static final int NETWORK_TYPE_DISALLOWED_BY_REQUESTOR = 6;
-
- /**
- * For intents used to notify the user that a download exceeds a size
- * threshold, if this extra is true, WiFi is required for this download
- * size; otherwise, it is only recommended.
- */
- public static final String EXTRA_IS_WIFI_REQUIRED = "isWifiRequired";
- public static final String EXTRA_FILE_NAME = "downloadId";
-
- /**
- * Used with DOWNLOAD_STATUS
- */
- public static final String EXTRA_STATUS_STATE = "ESS";
- public static final String EXTRA_STATUS_TOTAL_SIZE = "ETS";
- public static final String EXTRA_STATUS_CURRENT_FILE_SIZE = "CFS";
- public static final String EXTRA_STATUS_TOTAL_PROGRESS = "TFP";
- public static final String EXTRA_STATUS_CURRENT_PROGRESS = "CFP";
-
- public static final String ACTION_DOWNLOADS_CHANGED = "downloadsChanged";
-
- /**
- * Broadcast intent action sent by the download manager when a download
- * completes.
- */
- public final static String ACTION_DOWNLOAD_COMPLETE = "lvldownloader.intent.action.DOWNLOAD_COMPLETE";
-
- /**
- * Broadcast intent action sent by the download manager when download status
- * changes.
- */
- public final static String ACTION_DOWNLOAD_STATUS = "lvldownloader.intent.action.DOWNLOAD_STATUS";
-
- /*
- * Lists the states that the download manager can set on a download to
- * notify applications of the download progress. The codes follow the HTTP
- * families:<br> 1xx: informational<br> 2xx: success<br> 3xx: redirects (not
- * used by the download manager)<br> 4xx: client errors<br> 5xx: server
- * errors
- */
-
- /**
- * Returns whether the status is informational (i.e. 1xx).
- */
- public static boolean isStatusInformational(int status) {
- return (status >= 100 && status < 200);
- }
-
- /**
- * Returns whether the status is a success (i.e. 2xx).
- */
- public static boolean isStatusSuccess(int status) {
- return (status >= 200 && status < 300);
- }
-
- /**
- * Returns whether the status is an error (i.e. 4xx or 5xx).
- */
- public static boolean isStatusError(int status) {
- return (status >= 400 && status < 600);
- }
-
- /**
- * Returns whether the status is a client error (i.e. 4xx).
- */
- public static boolean isStatusClientError(int status) {
- return (status >= 400 && status < 500);
- }
-
- /**
- * Returns whether the status is a server error (i.e. 5xx).
- */
- public static boolean isStatusServerError(int status) {
- return (status >= 500 && status < 600);
- }
-
- /**
- * Returns whether the download has completed (either with success or
- * error).
- */
- public static boolean isStatusCompleted(int status) {
- return (status >= 200 && status < 300)
- || (status >= 400 && status < 600);
- }
-
- /**
- * This download hasn't stated yet
- */
- public static final int STATUS_PENDING = 190;
-
- /**
- * This download has started
- */
- public static final int STATUS_RUNNING = 192;
-
- /**
- * This download has been paused by the owning app.
- */
- public static final int STATUS_PAUSED_BY_APP = 193;
-
- /**
- * This download encountered some network error and is waiting before
- * retrying the request.
- */
- public static final int STATUS_WAITING_TO_RETRY = 194;
-
- /**
- * This download is waiting for network connectivity to proceed.
- */
- public static final int STATUS_WAITING_FOR_NETWORK = 195;
-
- /**
- * This download is waiting for a Wi-Fi connection to proceed or for
- * permission to download over cellular.
- */
- public static final int STATUS_QUEUED_FOR_WIFI_OR_CELLULAR_PERMISSION = 196;
-
- /**
- * This download is waiting for a Wi-Fi connection to proceed.
- */
- public static final int STATUS_QUEUED_FOR_WIFI = 197;
-
- /**
- * This download has successfully completed. Warning: there might be other
- * status values that indicate success in the future. Use isSucccess() to
- * capture the entire category.
- *
- * @hide
- */
- public static final int STATUS_SUCCESS = 200;
-
- /**
- * The requested URL is no longer available
- */
- public static final int STATUS_FORBIDDEN = 403;
-
- /**
- * The file was delivered incorrectly
- */
- public static final int STATUS_FILE_DELIVERED_INCORRECTLY = 487;
-
- /**
- * The requested destination file already exists.
- */
- public static final int STATUS_FILE_ALREADY_EXISTS_ERROR = 488;
-
- /**
- * Some possibly transient error occurred, but we can't resume the download.
- */
- public static final int STATUS_CANNOT_RESUME = 489;
-
- /**
- * This download was canceled
- *
- * @hide
- */
- public static final int STATUS_CANCELED = 490;
-
- /**
- * This download has completed with an error. Warning: there will be other
- * status values that indicate errors in the future. Use isStatusError() to
- * capture the entire category.
- */
- public static final int STATUS_UNKNOWN_ERROR = 491;
-
- /**
- * This download couldn't be completed because of a storage issue.
- * Typically, that's because the filesystem is missing or full. Use the more
- * specific {@link #STATUS_INSUFFICIENT_SPACE_ERROR} and
- * {@link #STATUS_DEVICE_NOT_FOUND_ERROR} when appropriate.
- *
- * @hide
- */
- public static final int STATUS_FILE_ERROR = 492;
-
- /**
- * This download couldn't be completed because of an HTTP redirect response
- * that the download manager couldn't handle.
- *
- * @hide
- */
- public static final int STATUS_UNHANDLED_REDIRECT = 493;
-
- /**
- * This download couldn't be completed because of an unspecified unhandled
- * HTTP code.
- *
- * @hide
- */
- public static final int STATUS_UNHANDLED_HTTP_CODE = 494;
-
- /**
- * This download couldn't be completed because of an error receiving or
- * processing data at the HTTP level.
- *
- * @hide
- */
- public static final int STATUS_HTTP_DATA_ERROR = 495;
-
- /**
- * This download couldn't be completed because of an HttpException while
- * setting up the request.
- *
- * @hide
- */
- public static final int STATUS_HTTP_EXCEPTION = 496;
-
- /**
- * This download couldn't be completed because there were too many
- * redirects.
- *
- * @hide
- */
- public static final int STATUS_TOO_MANY_REDIRECTS = 497;
-
- /**
- * This download couldn't be completed due to insufficient storage space.
- * Typically, this is because the SD card is full.
- *
- * @hide
- */
- public static final int STATUS_INSUFFICIENT_SPACE_ERROR = 498;
-
- /**
- * This download couldn't be completed because no external storage device
- * was found. Typically, this is because the SD card is not mounted.
- *
- * @hide
- */
- public static final int STATUS_DEVICE_NOT_FOUND_ERROR = 499;
-
- /**
- * This download is allowed to run.
- *
- * @hide
- */
- public static final int CONTROL_RUN = 0;
-
- /**
- * This download must pause at the first opportunity.
- *
- * @hide
- */
- public static final int CONTROL_PAUSED = 1;
-
- /**
- * This download is visible but only shows in the notifications while it's
- * in progress.
- *
- * @hide
- */
- public static final int VISIBILITY_VISIBLE = 0;
-
- /**
- * This download is visible and shows in the notifications while in progress
- * and after completion.
- *
- * @hide
- */
- public static final int VISIBILITY_VISIBLE_NOTIFY_COMPLETED = 1;
-
- /**
- * This download doesn't show in the UI or in the notifications.
- *
- * @hide
- */
- public static final int VISIBILITY_HIDDEN = 2;
-
- /**
- * Bit flag for {@link #setAllowedNetworkTypes} corresponding to
- * {@link ConnectivityManager#TYPE_MOBILE}.
- */
- public static final int NETWORK_MOBILE = 1 << 0;
-
- /**
- * Bit flag for {@link #setAllowedNetworkTypes} corresponding to
- * {@link ConnectivityManager#TYPE_WIFI}.
- */
- public static final int NETWORK_WIFI = 1 << 1;
-
- private final static String TEMP_EXT = ".tmp";
-
- /**
- * Service thread status
- */
- private static boolean sIsRunning;
-
- @Override
- public IBinder onBind(Intent paramIntent) {
- Log.d(Constants.TAG, "Service Bound");
- return this.mServiceMessenger.getBinder();
- }
-
- /**
- * Network state.
- */
- private boolean mIsConnected;
- private boolean mIsFailover;
- private boolean mIsCellularConnection;
- private boolean mIsRoaming;
- private boolean mIsAtLeast3G;
- private boolean mIsAtLeast4G;
- private boolean mStateChanged;
-
- /**
- * Download state
- */
- private int mControl;
- private int mStatus;
-
- public boolean isWiFi() {
- return mIsConnected && !mIsCellularConnection;
- }
-
- /**
- * Bindings to important services
- */
- private ConnectivityManager mConnectivityManager;
- private WifiManager mWifiManager;
-
- /**
- * Package we are downloading for (defaults to package of application)
- */
- private PackageInfo mPackageInfo;
-
- /**
- * Byte counts
- */
- long mBytesSoFar;
- long mTotalLength;
- int mFileCount;
-
- /**
- * Used for calculating time remaining and speed
- */
- long mBytesAtSample;
- long mMillisecondsAtSample;
- float mAverageDownloadSpeed;
-
- /**
- * Our binding to the network state broadcasts
- */
- private BroadcastReceiver mConnReceiver;
- final private IStub mServiceStub = DownloaderServiceMarshaller.CreateStub(this);
- final private Messenger mServiceMessenger = mServiceStub.getMessenger();
- private Messenger mClientMessenger;
- private DownloadNotification mNotification;
- private PendingIntent mPendingIntent;
- private PendingIntent mAlarmIntent;
-
- /**
- * Updates the network type based upon the type and subtype returned from
- * the connectivity manager. Subtype is only used for cellular signals.
- *
- * @param type
- * @param subType
- */
- private void updateNetworkType(int type, int subType) {
- switch (type) {
- case ConnectivityManager.TYPE_WIFI:
- case ConnectivityManager.TYPE_ETHERNET:
- case ConnectivityManager.TYPE_BLUETOOTH:
- mIsCellularConnection = false;
- mIsAtLeast3G = false;
- mIsAtLeast4G = false;
- break;
- case ConnectivityManager.TYPE_WIMAX:
- mIsCellularConnection = true;
- mIsAtLeast3G = true;
- mIsAtLeast4G = true;
- break;
- case ConnectivityManager.TYPE_MOBILE:
- mIsCellularConnection = true;
- switch (subType) {
- case TelephonyManager.NETWORK_TYPE_1xRTT:
- case TelephonyManager.NETWORK_TYPE_CDMA:
- case TelephonyManager.NETWORK_TYPE_EDGE:
- case TelephonyManager.NETWORK_TYPE_GPRS:
- case TelephonyManager.NETWORK_TYPE_IDEN:
- mIsAtLeast3G = false;
- mIsAtLeast4G = false;
- break;
- case TelephonyManager.NETWORK_TYPE_HSDPA:
- case TelephonyManager.NETWORK_TYPE_HSUPA:
- case TelephonyManager.NETWORK_TYPE_HSPA:
- case TelephonyManager.NETWORK_TYPE_EVDO_0:
- case TelephonyManager.NETWORK_TYPE_EVDO_A:
- case TelephonyManager.NETWORK_TYPE_UMTS:
- mIsAtLeast3G = true;
- mIsAtLeast4G = false;
- break;
- case TelephonyManager.NETWORK_TYPE_LTE: // 4G
- case TelephonyManager.NETWORK_TYPE_EHRPD: // 3G ++ interop
- // with 4G
- case TelephonyManager.NETWORK_TYPE_HSPAP: // 3G ++ but
- // marketed as
- // 4G
- mIsAtLeast3G = true;
- mIsAtLeast4G = true;
- break;
- default:
- mIsCellularConnection = false;
- mIsAtLeast3G = false;
- mIsAtLeast4G = false;
- }
- }
- }
-
- private void updateNetworkState(NetworkInfo info) {
- boolean isConnected = mIsConnected;
- boolean isFailover = mIsFailover;
- boolean isCellularConnection = mIsCellularConnection;
- boolean isRoaming = mIsRoaming;
- boolean isAtLeast3G = mIsAtLeast3G;
- if (null != info) {
- mIsRoaming = info.isRoaming();
- mIsFailover = info.isFailover();
- mIsConnected = info.isConnected();
- updateNetworkType(info.getType(), info.getSubtype());
- } else {
- mIsRoaming = false;
- mIsFailover = false;
- mIsConnected = false;
- updateNetworkType(-1, -1);
- }
- mStateChanged = (mStateChanged || isConnected != mIsConnected
- || isFailover != mIsFailover
- || isCellularConnection != mIsCellularConnection
- || isRoaming != mIsRoaming || isAtLeast3G != mIsAtLeast3G);
- if (Constants.LOGVV) {
- if (mStateChanged) {
- Log.v(LOG_TAG, "Network state changed: ");
- Log.v(LOG_TAG, "Starting State: " +
- (isConnected ? "Connected " : "Not Connected ") +
- (isCellularConnection ? "Cellular " : "WiFi ") +
- (isRoaming ? "Roaming " : "Local ") +
- (isAtLeast3G ? "3G+ " : "<3G "));
- Log.v(LOG_TAG, "Ending State: " +
- (mIsConnected ? "Connected " : "Not Connected ") +
- (mIsCellularConnection ? "Cellular " : "WiFi ") +
- (mIsRoaming ? "Roaming " : "Local ") +
- (mIsAtLeast3G ? "3G+ " : "<3G "));
-
- if (isServiceRunning()) {
- if (mIsRoaming) {
- mStatus = STATUS_WAITING_FOR_NETWORK;
- mControl = CONTROL_PAUSED;
- } else if (mIsCellularConnection) {
- DownloadsDB db = DownloadsDB.getDB(this);
- int flags = db.getFlags();
- if (0 == (flags & FLAGS_DOWNLOAD_OVER_CELLULAR)) {
- mStatus = STATUS_QUEUED_FOR_WIFI;
- mControl = CONTROL_PAUSED;
- }
- }
- }
-
- }
- }
- }
-
- /**
- * Polls the network state, setting the flags appropriately.
- */
- void pollNetworkState() {
- if (null == mConnectivityManager) {
- mConnectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
- }
- if (null == mWifiManager) {
- mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
- }
- if (mConnectivityManager == null) {
- Log.w(Constants.TAG,
- "couldn't get connectivity manager to poll network state");
- } else {
- NetworkInfo activeInfo = mConnectivityManager
- .getActiveNetworkInfo();
- updateNetworkState(activeInfo);
- }
- }
-
- public static final int NO_DOWNLOAD_REQUIRED = 0;
- public static final int LVL_CHECK_REQUIRED = 1;
- public static final int DOWNLOAD_REQUIRED = 2;
-
- public static final String EXTRA_PACKAGE_NAME = "EPN";
- public static final String EXTRA_PENDING_INTENT = "EPI";
- public static final String EXTRA_MESSAGE_HANDLER = "EMH";
-
- /**
- * Returns true if the LVL check is required
- *
- * @param db a downloads DB synchronized with the latest state
- * @param pi the package info for the project
- * @return returns true if the filenames need to be returned
- */
- private static boolean isLVLCheckRequired(DownloadsDB db, PackageInfo pi) {
- // we need to update the LVL check and get a successful status to
- // proceed
- if (db.mVersionCode != pi.versionCode) {
- return true;
- }
- return false;
- }
-
- /**
- * Careful! Only use this internally.
- *
- * @return whether we think the service is running
- */
- private static synchronized boolean isServiceRunning() {
- return sIsRunning;
- }
-
- private static synchronized void setServiceRunning(boolean isRunning) {
- sIsRunning = isRunning;
- }
-
- public static int startDownloadServiceIfRequired(Context context,
- Intent intent, Class<?> serviceClass) throws NameNotFoundException {
- final PendingIntent pendingIntent = (PendingIntent) intent
- .getParcelableExtra(EXTRA_PENDING_INTENT);
- return startDownloadServiceIfRequired(context, pendingIntent,
- serviceClass);
- }
-
- public static int startDownloadServiceIfRequired(Context context,
- PendingIntent pendingIntent, Class<?> serviceClass)
- throws NameNotFoundException
- {
- String packageName = context.getPackageName();
- String className = serviceClass.getName();
-
- return startDownloadServiceIfRequired(context, pendingIntent,
- packageName, className);
- }
-
- /**
- * Starts the download if necessary. This function starts a flow that does `
- * many things. 1) Checks to see if the APK version has been checked and the
- * metadata database updated 2) If the APK version does not match, checks
- * the new LVL status to see if a new download is required 3) If the APK
- * version does match, then checks to see if the download(s) have been
- * completed 4) If the downloads have been completed, returns
- * NO_DOWNLOAD_REQUIRED The idea is that this can be called during the
- * startup of an application to quickly ascertain if the application needs
- * to wait to hear about any updated APK expansion files. Note that this
- * does mean that the application MUST be run for the first time with a
- * network connection, even if Market delivers all of the files.
- *
- * @param context
- * @param thisIntent
- * @return true if the app should wait for more guidance from the
- * downloader, false if the app can continue
- * @throws NameNotFoundException
- */
- public static int startDownloadServiceIfRequired(Context context,
- PendingIntent pendingIntent, String classPackage, String className)
- throws NameNotFoundException {
- // first: do we need to do an LVL update?
- // we begin by getting our APK version from the package manager
- final PackageInfo pi = context.getPackageManager().getPackageInfo(
- context.getPackageName(), 0);
-
- int status = NO_DOWNLOAD_REQUIRED;
-
- // the database automatically reads the metadata for version code
- // and download status when the instance is created
- DownloadsDB db = DownloadsDB.getDB(context);
-
- // we need to update the LVL check and get a successful status to
- // proceed
- if (isLVLCheckRequired(db, pi)) {
- status = LVL_CHECK_REQUIRED;
- }
- // we don't have to update LVL. do we still have a download to start?
- if (db.mStatus == 0) {
- DownloadInfo[] infos = db.getDownloads();
- if (null != infos) {
- for (DownloadInfo info : infos) {
- if (!Helpers.doesFileExist(context, info.mFileName, info.mTotalBytes, true)) {
- status = DOWNLOAD_REQUIRED;
- db.updateStatus(-1);
- break;
- }
- }
- }
- } else {
- status = DOWNLOAD_REQUIRED;
- }
- switch (status) {
- case DOWNLOAD_REQUIRED:
- case LVL_CHECK_REQUIRED:
- Intent fileIntent = new Intent();
- fileIntent.setClassName(classPackage, className);
- fileIntent.putExtra(EXTRA_PENDING_INTENT, pendingIntent);
- context.startService(fileIntent);
- break;
- }
- return status;
- }
-
- @Override
- public void requestAbortDownload() {
- mControl = CONTROL_PAUSED;
- mStatus = STATUS_CANCELED;
- }
-
- @Override
- public void requestPauseDownload() {
- mControl = CONTROL_PAUSED;
- mStatus = STATUS_PAUSED_BY_APP;
- }
-
- @Override
- public void setDownloadFlags(int flags) {
- DownloadsDB.getDB(this).updateFlags(flags);
- }
-
- @Override
- public void requestContinueDownload() {
- if (mControl == CONTROL_PAUSED) {
- mControl = CONTROL_RUN;
- }
- Intent fileIntent = new Intent(this, this.getClass());
- fileIntent.putExtra(EXTRA_PENDING_INTENT, mPendingIntent);
- this.startService(fileIntent);
- }
-
- public abstract String getPublicKey();
-
- public abstract byte[] getSALT();
-
- public abstract String getAlarmReceiverClassName();
-
- private class LVLRunnable implements Runnable {
- LVLRunnable(Context context, PendingIntent intent) {
- mContext = context;
- mPendingIntent = intent;
- }
-
- final Context mContext;
-
- @Override
- public void run() {
- setServiceRunning(true);
- mNotification.onDownloadStateChanged(IDownloaderClient.STATE_FETCHING_URL);
- String deviceId = Secure.getString(mContext.getContentResolver(),
- Secure.ANDROID_ID);
-
- final APKExpansionPolicy aep = new APKExpansionPolicy(mContext,
- new AESObfuscator(getSALT(), mContext.getPackageName(), deviceId));
-
- // reset our policy back to the start of the world to force a
- // re-check
- aep.resetPolicy();
-
- // let's try and get the OBB file from LVL first
- // Construct the LicenseChecker with a Policy.
- final LicenseChecker checker = new LicenseChecker(mContext, aep,
- getPublicKey() // Your public licensing key.
- );
- checker.checkAccess(new LicenseCheckerCallback() {
-
- @Override
- public void allow(int reason) {
- try {
- int count = aep.getExpansionURLCount();
- DownloadsDB db = DownloadsDB.getDB(mContext);
- int status = 0;
- if (count != 0) {
- for (int i = 0; i < count; i++) {
- String currentFileName = aep
- .getExpansionFileName(i);
- if (null != currentFileName) {
- DownloadInfo di = new DownloadInfo(i,
- currentFileName, mContext.getPackageName());
-
- long fileSize = aep.getExpansionFileSize(i);
- if (handleFileUpdated(db, i, currentFileName,
- fileSize)) {
- status |= -1;
- di.resetDownload();
- di.mUri = aep.getExpansionURL(i);
- di.mTotalBytes = fileSize;
- di.mStatus = status;
- db.updateDownload(di);
- } else {
- // we need to read the download
- // information
- // from
- // the database
- DownloadInfo dbdi = db
- .getDownloadInfoByFileName(di.mFileName);
- if (null == dbdi) {
- // the file exists already and is
- // the
- // correct size
- // was delivered by Market or
- // through
- // another mechanism
- Log.d(LOG_TAG, "file " + di.mFileName
- + " found. Not downloading.");
- di.mStatus = STATUS_SUCCESS;
- di.mTotalBytes = fileSize;
- di.mCurrentBytes = fileSize;
- di.mUri = aep.getExpansionURL(i);
- db.updateDownload(di);
- } else if (dbdi.mStatus != STATUS_SUCCESS) {
- // we just update the URL
- dbdi.mUri = aep.getExpansionURL(i);
- db.updateDownload(dbdi);
- status |= -1;
- }
- }
- }
- }
- }
- // first: do we need to do an LVL update?
- // we begin by getting our APK version from the package
- // manager
- PackageInfo pi;
- try {
- pi = mContext.getPackageManager().getPackageInfo(
- mContext.getPackageName(), 0);
- db.updateMetadata(pi.versionCode, status);
- Class<?> serviceClass = DownloaderService.this.getClass();
- switch (startDownloadServiceIfRequired(mContext, mPendingIntent,
- serviceClass)) {
- case NO_DOWNLOAD_REQUIRED:
- mNotification
- .onDownloadStateChanged(IDownloaderClient.STATE_COMPLETED);
- break;
- case LVL_CHECK_REQUIRED:
- // DANGER WILL ROBINSON!
- Log.e(LOG_TAG, "In LVL checking loop!");
- mNotification
- .onDownloadStateChanged(IDownloaderClient.STATE_FAILED_UNLICENSED);
- throw new RuntimeException(
- "Error with LVL checking and database integrity");
- case DOWNLOAD_REQUIRED:
- // do nothing. the download will notify the
- // application
- // when things are done
- break;
- }
- } catch (NameNotFoundException e1) {
- e1.printStackTrace();
- throw new RuntimeException(
- "Error with getting information from package name");
- }
- } finally {
- setServiceRunning(false);
- }
- }
-
- @Override
- public void dontAllow(int reason) {
- try
- {
- switch (reason) {
- case Policy.NOT_LICENSED:
- mNotification
- .onDownloadStateChanged(IDownloaderClient.STATE_FAILED_UNLICENSED);
- break;
- case Policy.RETRY:
- mNotification
- .onDownloadStateChanged(IDownloaderClient.STATE_FAILED_FETCHING_URL);
- break;
- }
- } finally {
- setServiceRunning(false);
- }
-
- }
-
- @Override
- public void applicationError(int errorCode) {
- try {
- mNotification
- .onDownloadStateChanged(IDownloaderClient.STATE_FAILED_FETCHING_URL);
- } finally {
- setServiceRunning(false);
- }
- }
-
- });
-
- }
-
- };
-
- /**
- * Updates the LVL information from the server.
- *
- * @param context
- */
- public void updateLVL(final Context context) {
- Context c = context.getApplicationContext();
- Handler h = new Handler(c.getMainLooper());
- h.post(new LVLRunnable(c, mPendingIntent));
- }
-
- /**
- * The APK has been updated and a filename has been sent down from the
- * Market call. If the file has the same name as the previous file, we do
- * nothing as the file is guaranteed to be the same. If the file does not
- * have the same name, we download it if it hasn't already been delivered by
- * Market.
- *
- * @param index the index of the file from market (0 = main, 1 = patch)
- * @param filename the name of the new file
- * @param fileSize the size of the new file
- * @return
- */
- public boolean handleFileUpdated(DownloadsDB db, int index,
- String filename, long fileSize) {
- DownloadInfo di = db.getDownloadInfoByFileName(filename);
- if (null != di) {
- String oldFile = di.mFileName;
- // cleanup
- if (null != oldFile) {
- if (filename.equals(oldFile)) {
- return false;
- }
-
- // remove partially downloaded file if it is there
- String deleteFile = Helpers.generateSaveFileName(this, oldFile);
- File f = new File(deleteFile);
- if (f.exists())
- f.delete();
- }
- }
- return !Helpers.doesFileExist(this, filename, fileSize, true);
- }
-
- private void scheduleAlarm(long wakeUp) {
- AlarmManager alarms = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
- if (alarms == null) {
- Log.e(Constants.TAG, "couldn't get alarm manager");
- return;
- }
-
- if (Constants.LOGV) {
- Log.v(Constants.TAG, "scheduling retry in " + wakeUp + "ms");
- }
-
- String className = getAlarmReceiverClassName();
- Intent intent = new Intent(Constants.ACTION_RETRY);
- intent.putExtra(EXTRA_PENDING_INTENT, mPendingIntent);
- intent.setClassName(this.getPackageName(),
- className);
- mAlarmIntent = PendingIntent.getBroadcast(this, 0, intent,
- PendingIntent.FLAG_ONE_SHOT);
- alarms.set(
- AlarmManager.RTC_WAKEUP,
- System.currentTimeMillis() + wakeUp, mAlarmIntent
- );
- }
-
- private void cancelAlarms() {
- if (null != mAlarmIntent) {
- AlarmManager alarms = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
- if (alarms == null) {
- Log.e(Constants.TAG, "couldn't get alarm manager");
- return;
- }
- alarms.cancel(mAlarmIntent);
- mAlarmIntent = null;
- }
- }
-
- /**
- * We use this to track network state, such as when WiFi, Cellular, etc. is
- * enabled when downloads are paused or in progress.
- */
- private class InnerBroadcastReceiver extends BroadcastReceiver {
- final Service mService;
-
- InnerBroadcastReceiver(Service service) {
- mService = service;
- }
-
- @Override
- public void onReceive(Context context, Intent intent) {
- pollNetworkState();
- if (mStateChanged
- && !isServiceRunning()) {
- Log.d(Constants.TAG, "InnerBroadcastReceiver Called");
- Intent fileIntent = new Intent(context, mService.getClass());
- fileIntent.putExtra(EXTRA_PENDING_INTENT, mPendingIntent);
- // send a new intent to the service
- context.startService(fileIntent);
- }
- }
- };
-
- /**
- * This is the main thread for the Downloader. This thread is responsible
- * for queuing up downloads and other goodness.
- */
- @Override
- protected void onHandleIntent(Intent intent) {
- setServiceRunning(true);
- try {
- // the database automatically reads the metadata for version code
- // and download status when the instance is created
- DownloadsDB db = DownloadsDB.getDB(this);
- final PendingIntent pendingIntent = (PendingIntent) intent
- .getParcelableExtra(EXTRA_PENDING_INTENT);
-
- if (null != pendingIntent)
- {
- mNotification.setClientIntent(pendingIntent);
- mPendingIntent = pendingIntent;
- } else if (null != mPendingIntent) {
- mNotification.setClientIntent(mPendingIntent);
- } else {
- Log.e(LOG_TAG, "Downloader started in bad state without notification intent.");
- return;
- }
-
- // when the LVL check completes, a successful response will update
- // the service
- if (isLVLCheckRequired(db, mPackageInfo)) {
- updateLVL(this);
- return;
- }
-
- // get each download
- DownloadInfo[] infos = db.getDownloads();
- mBytesSoFar = 0;
- mTotalLength = 0;
- mFileCount = infos.length;
- for (DownloadInfo info : infos) {
- // We do an (simple) integrity check on each file, just to make
- // sure
- if (info.mStatus == STATUS_SUCCESS) {
- // verify that the file matches the state
- if (!Helpers.doesFileExist(this, info.mFileName, info.mTotalBytes, true)) {
- info.mStatus = 0;
- info.mCurrentBytes = 0;
- }
- }
- // get aggregate data
- mTotalLength += info.mTotalBytes;
- mBytesSoFar += info.mCurrentBytes;
- }
-
- // loop through all downloads and fetch them
- pollNetworkState();
- if (null == mConnReceiver) {
-
- /**
- * We use this to track network state, such as when WiFi,
- * Cellular, etc. is enabled when downloads are paused or in
- * progress.
- */
- mConnReceiver = new InnerBroadcastReceiver(this);
- IntentFilter intentFilter = new IntentFilter(
- ConnectivityManager.CONNECTIVITY_ACTION);
- intentFilter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
- registerReceiver(mConnReceiver, intentFilter);
- }
-
- for (DownloadInfo info : infos) {
- long startingCount = info.mCurrentBytes;
-
- if (info.mStatus != STATUS_SUCCESS) {
- DownloadThread dt = new DownloadThread(info, this, mNotification);
- cancelAlarms();
- scheduleAlarm(Constants.ACTIVE_THREAD_WATCHDOG);
- dt.run();
- cancelAlarms();
- }
- db.updateFromDb(info);
- boolean setWakeWatchdog = false;
- int notifyStatus;
- switch (info.mStatus) {
- case STATUS_FORBIDDEN:
- // the URL is out of date
- updateLVL(this);
- return;
- case STATUS_SUCCESS:
- mBytesSoFar += info.mCurrentBytes - startingCount;
- db.updateMetadata(mPackageInfo.versionCode, 0);
- continue;
- case STATUS_FILE_DELIVERED_INCORRECTLY:
- // we may be on a network that is returning us a web
- // page on redirect
- notifyStatus = IDownloaderClient.STATE_PAUSED_NETWORK_SETUP_FAILURE;
- info.mCurrentBytes = 0;
- db.updateDownload(info);
- setWakeWatchdog = true;
- break;
- case STATUS_PAUSED_BY_APP:
- notifyStatus = IDownloaderClient.STATE_PAUSED_BY_REQUEST;
- break;
- case STATUS_WAITING_FOR_NETWORK:
- case STATUS_WAITING_TO_RETRY:
- notifyStatus = IDownloaderClient.STATE_PAUSED_NETWORK_UNAVAILABLE;
- setWakeWatchdog = true;
- break;
- case STATUS_QUEUED_FOR_WIFI_OR_CELLULAR_PERMISSION:
- case STATUS_QUEUED_FOR_WIFI:
- // look for more detail here
- if (null != mWifiManager) {
- if (!mWifiManager.isWifiEnabled()) {
- notifyStatus = IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION;
- setWakeWatchdog = true;
- break;
- }
- }
- notifyStatus = IDownloaderClient.STATE_PAUSED_NEED_CELLULAR_PERMISSION;
- setWakeWatchdog = true;
- break;
- case STATUS_CANCELED:
- notifyStatus = IDownloaderClient.STATE_FAILED_CANCELED;
- setWakeWatchdog = true;
- break;
-
- case STATUS_INSUFFICIENT_SPACE_ERROR:
- notifyStatus = IDownloaderClient.STATE_FAILED_SDCARD_FULL;
- setWakeWatchdog = true;
- break;
-
- case STATUS_DEVICE_NOT_FOUND_ERROR:
- notifyStatus = IDownloaderClient.STATE_PAUSED_SDCARD_UNAVAILABLE;
- setWakeWatchdog = true;
- break;
-
- default:
- notifyStatus = IDownloaderClient.STATE_FAILED;
- break;
- }
- if (setWakeWatchdog) {
- scheduleAlarm(Constants.WATCHDOG_WAKE_TIMER);
- } else {
- cancelAlarms();
- }
- // failure or pause state
- mNotification.onDownloadStateChanged(notifyStatus);
- return;
- }
-
- // all downloads complete
- mNotification.onDownloadStateChanged(IDownloaderClient.STATE_COMPLETED);
- } finally {
- setServiceRunning(false);
- }
- }
-
- @Override
- public void onDestroy() {
- if (null != mConnReceiver) {
- unregisterReceiver(mConnReceiver);
- mConnReceiver = null;
- }
- mServiceStub.disconnect(this);
- super.onDestroy();
- }
-
- public int getNetworkAvailabilityState(DownloadsDB db) {
- if (mIsConnected) {
- if (!mIsCellularConnection)
- return NETWORK_OK;
- int flags = db.mFlags;
- if (mIsRoaming)
- return NETWORK_CANNOT_USE_ROAMING;
- if (0 != (flags & FLAGS_DOWNLOAD_OVER_CELLULAR)) {
- return NETWORK_OK;
- } else {
- return NETWORK_TYPE_DISALLOWED_BY_REQUESTOR;
- }
- }
- return NETWORK_NO_CONNECTION;
- }
-
- @Override
- public void onCreate() {
- super.onCreate();
- try {
- mPackageInfo = getPackageManager().getPackageInfo(
- getPackageName(), 0);
- ApplicationInfo ai = getApplicationInfo();
- CharSequence applicationLabel = getPackageManager().getApplicationLabel(ai);
- mNotification = new DownloadNotification(this, applicationLabel);
-
- } catch (NameNotFoundException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Exception thrown from methods called by generateSaveFile() for any fatal
- * error.
- */
- public static class GenerateSaveFileError extends Exception {
- private static final long serialVersionUID = 3465966015408936540L;
- int mStatus;
- String mMessage;
-
- public GenerateSaveFileError(int status, String message) {
- mStatus = status;
- mMessage = message;
- }
- }
-
- /**
- * Returns the filename (where the file should be saved) from info about a
- * download
- */
- public String generateTempSaveFileName(String fileName) {
- String path = Helpers.getSaveFilePath(this)
- + File.separator + fileName + TEMP_EXT;
- return path;
- }
-
- /**
- * Creates a filename (where the file should be saved) from info about a
- * download.
- */
- public String generateSaveFile(String filename, long filesize)
- throws GenerateSaveFileError {
- String path = generateTempSaveFileName(filename);
- File expPath = new File(path);
- if (!Helpers.isExternalMediaMounted()) {
- Log.d(Constants.TAG, "External media not mounted: " + path);
- throw new GenerateSaveFileError(STATUS_DEVICE_NOT_FOUND_ERROR,
- "external media is not yet mounted");
-
- }
- if (expPath.exists()) {
- Log.d(Constants.TAG, "File already exists: " + path);
- throw new GenerateSaveFileError(STATUS_FILE_ALREADY_EXISTS_ERROR,
- "requested destination file already exists");
- }
- if (Helpers.getAvailableBytes(Helpers.getFilesystemRoot(path)) < filesize) {
- throw new GenerateSaveFileError(STATUS_INSUFFICIENT_SPACE_ERROR,
- "insufficient space on external storage");
- }
- return path;
- }
-
- /**
- * @return a non-localized string appropriate for logging corresponding to
- * one of the NETWORK_* constants.
- */
- public String getLogMessageForNetworkError(int networkError) {
- switch (networkError) {
- case NETWORK_RECOMMENDED_UNUSABLE_DUE_TO_SIZE:
- return "download size exceeds recommended limit for mobile network";
-
- case NETWORK_UNUSABLE_DUE_TO_SIZE:
- return "download size exceeds limit for mobile network";
-
- case NETWORK_NO_CONNECTION:
- return "no network connection available";
-
- case NETWORK_CANNOT_USE_ROAMING:
- return "download cannot use the current network connection because it is roaming";
-
- case NETWORK_TYPE_DISALLOWED_BY_REQUESTOR:
- return "download was requested to not use the current network type";
-
- default:
- return "unknown error with network connectivity";
- }
- }
-
- public int getControl() {
- return mControl;
- }
-
- public int getStatus() {
- return mStatus;
- }
-
- /**
- * Calculating a moving average for the speed so we don't get jumpy
- * calculations for time etc.
- */
- static private final float SMOOTHING_FACTOR = 0.005f;
-
- public void notifyUpdateBytes(long totalBytesSoFar) {
- long timeRemaining;
- long currentTime = SystemClock.uptimeMillis();
- if (0 != mMillisecondsAtSample) {
- // we have a sample.
- long timePassed = currentTime - mMillisecondsAtSample;
- long bytesInSample = totalBytesSoFar - mBytesAtSample;
- float currentSpeedSample = (float) bytesInSample / (float) timePassed;
- if (0 != mAverageDownloadSpeed) {
- mAverageDownloadSpeed = SMOOTHING_FACTOR * currentSpeedSample
- + (1 - SMOOTHING_FACTOR) * mAverageDownloadSpeed;
- } else {
- mAverageDownloadSpeed = currentSpeedSample;
- }
- timeRemaining = (long) ((mTotalLength - totalBytesSoFar) / mAverageDownloadSpeed);
- } else {
- timeRemaining = -1;
- }
- mMillisecondsAtSample = currentTime;
- mBytesAtSample = totalBytesSoFar;
- mNotification.onDownloadProgress(
- new DownloadProgressInfo(mTotalLength,
- totalBytesSoFar,
- timeRemaining,
- mAverageDownloadSpeed)
- );
-
- }
-
- @Override
- protected boolean shouldStop() {
- // the database automatically reads the metadata for version code
- // and download status when the instance is created
- DownloadsDB db = DownloadsDB.getDB(this);
- if (db.mStatus == 0) {
- return true;
- }
- return false;
- }
-
- @Override
- public void requestDownloadStatus() {
- mNotification.resendState();
- }
-
- @Override
- public void onClientUpdated(Messenger clientMessenger) {
- this.mClientMessenger = clientMessenger;
- mNotification.setMessenger(mClientMessenger);
- }
-
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java
deleted file mode 100755
index 250299c400..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java
+++ /dev/null
@@ -1,510 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader.impl;
-
-import android.content.ContentValues;
-import android.content.Context;
-import android.database.Cursor;
-import android.database.sqlite.SQLiteDatabase;
-import android.database.sqlite.SQLiteDoneException;
-import android.database.sqlite.SQLiteOpenHelper;
-import android.database.sqlite.SQLiteStatement;
-import android.provider.BaseColumns;
-import android.util.Log;
-
-public class DownloadsDB {
- private static final String DATABASE_NAME = "DownloadsDB";
- private static final int DATABASE_VERSION = 7;
- public static final String LOG_TAG = DownloadsDB.class.getName();
- final SQLiteOpenHelper mHelper;
- SQLiteStatement mGetDownloadByIndex;
- SQLiteStatement mUpdateCurrentBytes;
- private static DownloadsDB mDownloadsDB;
- long mMetadataRowID = -1;
- int mVersionCode = -1;
- int mStatus = -1;
- int mFlags;
-
- static public synchronized DownloadsDB getDB(Context paramContext) {
- if (null == mDownloadsDB) {
- return new DownloadsDB(paramContext);
- }
- return mDownloadsDB;
- }
-
- private SQLiteStatement getDownloadByIndexStatement() {
- if (null == mGetDownloadByIndex) {
- mGetDownloadByIndex = mHelper.getReadableDatabase().compileStatement(
- "SELECT " + BaseColumns._ID + " FROM "
- + DownloadColumns.TABLE_NAME + " WHERE "
- + DownloadColumns.INDEX + " = ?");
- }
- return mGetDownloadByIndex;
- }
-
- private SQLiteStatement getUpdateCurrentBytesStatement() {
- if (null == mUpdateCurrentBytes) {
- mUpdateCurrentBytes = mHelper.getReadableDatabase().compileStatement(
- "UPDATE " + DownloadColumns.TABLE_NAME + " SET " + DownloadColumns.CURRENTBYTES
- + " = ?" +
- " WHERE " + DownloadColumns.INDEX + " = ?");
- }
- return mUpdateCurrentBytes;
- }
-
- private DownloadsDB(Context paramContext) {
- this.mHelper = new DownloadsContentDBHelper(paramContext);
- final SQLiteDatabase sqldb = mHelper.getReadableDatabase();
- // Query for the version code, the row ID of the metadata (for future
- // updating) the status and the flags
- Cursor cur = sqldb.rawQuery("SELECT " +
- MetadataColumns.APKVERSION + "," +
- BaseColumns._ID + "," +
- MetadataColumns.DOWNLOAD_STATUS + "," +
- MetadataColumns.FLAGS +
- " FROM "
- + MetadataColumns.TABLE_NAME + " LIMIT 1", null);
- if (null != cur && cur.moveToFirst()) {
- mVersionCode = cur.getInt(0);
- mMetadataRowID = cur.getLong(1);
- mStatus = cur.getInt(2);
- mFlags = cur.getInt(3);
- cur.close();
- }
- mDownloadsDB = this;
- }
-
- protected DownloadInfo getDownloadInfoByFileName(String fileName) {
- final SQLiteDatabase sqldb = mHelper.getReadableDatabase();
- Cursor itemcur = null;
- try {
- itemcur = sqldb.query(DownloadColumns.TABLE_NAME, DC_PROJECTION,
- DownloadColumns.FILENAME + " = ?",
- new String[] {
- fileName
- }, null, null, null);
- if (null != itemcur && itemcur.moveToFirst()) {
- return getDownloadInfoFromCursor(itemcur);
- }
- } finally {
- if (null != itemcur)
- itemcur.close();
- }
- return null;
- }
-
- public long getIDForDownloadInfo(final DownloadInfo di) {
- return getIDByIndex(di.mIndex);
- }
-
- public long getIDByIndex(int index) {
- SQLiteStatement downloadByIndex = getDownloadByIndexStatement();
- downloadByIndex.clearBindings();
- downloadByIndex.bindLong(1, index);
- try {
- return downloadByIndex.simpleQueryForLong();
- } catch (SQLiteDoneException e) {
- return -1;
- }
- }
-
- public void updateDownloadCurrentBytes(final DownloadInfo di) {
- SQLiteStatement downloadCurrentBytes = getUpdateCurrentBytesStatement();
- downloadCurrentBytes.clearBindings();
- downloadCurrentBytes.bindLong(1, di.mCurrentBytes);
- downloadCurrentBytes.bindLong(2, di.mIndex);
- downloadCurrentBytes.execute();
- }
-
- public void close() {
- this.mHelper.close();
- }
-
- protected static class DownloadsContentDBHelper extends SQLiteOpenHelper {
- DownloadsContentDBHelper(Context paramContext) {
- super(paramContext, DATABASE_NAME, null, DATABASE_VERSION);
- }
-
- private String createTableQueryFromArray(String paramString,
- String[][] paramArrayOfString) {
- StringBuilder localStringBuilder = new StringBuilder();
- localStringBuilder.append("CREATE TABLE ");
- localStringBuilder.append(paramString);
- localStringBuilder.append(" (");
- int i = paramArrayOfString.length;
- for (int j = 0;; j++) {
- if (j >= i) {
- localStringBuilder
- .setLength(localStringBuilder.length() - 1);
- localStringBuilder.append(");");
- return localStringBuilder.toString();
- }
- String[] arrayOfString = paramArrayOfString[j];
- localStringBuilder.append(' ');
- localStringBuilder.append(arrayOfString[0]);
- localStringBuilder.append(' ');
- localStringBuilder.append(arrayOfString[1]);
- localStringBuilder.append(',');
- }
- }
-
- /**
- * These two arrays must match and have the same order. For every Schema
- * there must be a corresponding table name.
- */
- static final private String[][][] sSchemas = {
- DownloadColumns.SCHEMA, MetadataColumns.SCHEMA
- };
-
- static final private String[] sTables = {
- DownloadColumns.TABLE_NAME, MetadataColumns.TABLE_NAME
- };
-
- /**
- * Goes through all of the tables in sTables and drops each table if it
- * exists. Altered to no longer make use of reflection.
- */
- private void dropTables(SQLiteDatabase paramSQLiteDatabase) {
- for (String table : sTables) {
- try {
- paramSQLiteDatabase.execSQL("DROP TABLE IF EXISTS " + table);
- } catch (Exception localException) {
- localException.printStackTrace();
- }
- }
- }
-
- /**
- * Goes through all of the tables in sTables and creates a database with
- * the corresponding schema described in sSchemas. Altered to no longer
- * make use of reflection.
- */
- public void onCreate(SQLiteDatabase paramSQLiteDatabase) {
- int numSchemas = sSchemas.length;
- for (int i = 0; i < numSchemas; i++) {
- try {
- String[][] schema = (String[][]) sSchemas[i];
- paramSQLiteDatabase.execSQL(createTableQueryFromArray(
- sTables[i], schema));
- } catch (Exception localException) {
- while (true)
- localException.printStackTrace();
- }
- }
- }
-
- public void onUpgrade(SQLiteDatabase paramSQLiteDatabase,
- int paramInt1, int paramInt2) {
- Log.w(DownloadsContentDBHelper.class.getName(),
- "Upgrading database from version " + paramInt1 + " to "
- + paramInt2 + ", which will destroy all old data");
- dropTables(paramSQLiteDatabase);
- onCreate(paramSQLiteDatabase);
- }
- }
-
- public static class MetadataColumns implements BaseColumns {
- public static final String APKVERSION = "APKVERSION";
- public static final String DOWNLOAD_STATUS = "DOWNLOADSTATUS";
- public static final String FLAGS = "DOWNLOADFLAGS";
-
- public static final String[][] SCHEMA = {
- {
- BaseColumns._ID, "INTEGER PRIMARY KEY"
- },
- {
- APKVERSION, "INTEGER"
- }, {
- DOWNLOAD_STATUS, "INTEGER"
- },
- {
- FLAGS, "INTEGER"
- }
- };
- public static final String TABLE_NAME = "MetadataColumns";
- public static final String _ID = "MetadataColumns._id";
- }
-
- public static class DownloadColumns implements BaseColumns {
- public static final String INDEX = "FILEIDX";
- public static final String URI = "URI";
- public static final String FILENAME = "FN";
- public static final String ETAG = "ETAG";
-
- public static final String TOTALBYTES = "TOTALBYTES";
- public static final String CURRENTBYTES = "CURRENTBYTES";
- public static final String LASTMOD = "LASTMOD";
-
- public static final String STATUS = "STATUS";
- public static final String CONTROL = "CONTROL";
- public static final String NUM_FAILED = "FAILCOUNT";
- public static final String RETRY_AFTER = "RETRYAFTER";
- public static final String REDIRECT_COUNT = "REDIRECTCOUNT";
-
- public static final String[][] SCHEMA = {
- {
- BaseColumns._ID, "INTEGER PRIMARY KEY"
- },
- {
- INDEX, "INTEGER UNIQUE"
- }, {
- URI, "TEXT"
- },
- {
- FILENAME, "TEXT UNIQUE"
- }, {
- ETAG, "TEXT"
- },
- {
- TOTALBYTES, "INTEGER"
- }, {
- CURRENTBYTES, "INTEGER"
- },
- {
- LASTMOD, "INTEGER"
- }, {
- STATUS, "INTEGER"
- },
- {
- CONTROL, "INTEGER"
- }, {
- NUM_FAILED, "INTEGER"
- },
- {
- RETRY_AFTER, "INTEGER"
- }, {
- REDIRECT_COUNT, "INTEGER"
- }
- };
- public static final String TABLE_NAME = "DownloadColumns";
- public static final String _ID = "DownloadColumns._id";
- }
-
- private static final String[] DC_PROJECTION = {
- DownloadColumns.FILENAME,
- DownloadColumns.URI, DownloadColumns.ETAG,
- DownloadColumns.TOTALBYTES, DownloadColumns.CURRENTBYTES,
- DownloadColumns.LASTMOD, DownloadColumns.STATUS,
- DownloadColumns.CONTROL, DownloadColumns.NUM_FAILED,
- DownloadColumns.RETRY_AFTER, DownloadColumns.REDIRECT_COUNT,
- DownloadColumns.INDEX
- };
-
- private static final int FILENAME_IDX = 0;
- private static final int URI_IDX = 1;
- private static final int ETAG_IDX = 2;
- private static final int TOTALBYTES_IDX = 3;
- private static final int CURRENTBYTES_IDX = 4;
- private static final int LASTMOD_IDX = 5;
- private static final int STATUS_IDX = 6;
- private static final int CONTROL_IDX = 7;
- private static final int NUM_FAILED_IDX = 8;
- private static final int RETRY_AFTER_IDX = 9;
- private static final int REDIRECT_COUNT_IDX = 10;
- private static final int INDEX_IDX = 11;
-
- /**
- * This function will add a new file to the database if it does not exist.
- *
- * @param di DownloadInfo that we wish to store
- * @return the row id of the record to be updated/inserted, or -1
- */
- public boolean updateDownload(DownloadInfo di) {
- ContentValues cv = new ContentValues();
- cv.put(DownloadColumns.INDEX, di.mIndex);
- cv.put(DownloadColumns.FILENAME, di.mFileName);
- cv.put(DownloadColumns.URI, di.mUri);
- cv.put(DownloadColumns.ETAG, di.mETag);
- cv.put(DownloadColumns.TOTALBYTES, di.mTotalBytes);
- cv.put(DownloadColumns.CURRENTBYTES, di.mCurrentBytes);
- cv.put(DownloadColumns.LASTMOD, di.mLastMod);
- cv.put(DownloadColumns.STATUS, di.mStatus);
- cv.put(DownloadColumns.CONTROL, di.mControl);
- cv.put(DownloadColumns.NUM_FAILED, di.mNumFailed);
- cv.put(DownloadColumns.RETRY_AFTER, di.mRetryAfter);
- cv.put(DownloadColumns.REDIRECT_COUNT, di.mRedirectCount);
- return updateDownload(di, cv);
- }
-
- public boolean updateDownload(DownloadInfo di, ContentValues cv) {
- long id = di == null ? -1 : getIDForDownloadInfo(di);
- try {
- final SQLiteDatabase sqldb = mHelper.getWritableDatabase();
- if (id != -1) {
- if (1 != sqldb.update(DownloadColumns.TABLE_NAME,
- cv, DownloadColumns._ID + " = " + id, null)) {
- return false;
- }
- } else {
- return -1 != sqldb.insert(DownloadColumns.TABLE_NAME,
- DownloadColumns.URI, cv);
- }
- } catch (android.database.sqlite.SQLiteException ex) {
- ex.printStackTrace();
- }
- return false;
- }
-
- public int getLastCheckedVersionCode() {
- return mVersionCode;
- }
-
- public boolean isDownloadRequired() {
- final SQLiteDatabase sqldb = mHelper.getReadableDatabase();
- Cursor cur = sqldb.rawQuery("SELECT Count(*) FROM "
- + DownloadColumns.TABLE_NAME + " WHERE "
- + DownloadColumns.STATUS + " <> 0", null);
- try {
- if (null != cur && cur.moveToFirst()) {
- return 0 == cur.getInt(0);
- }
- } finally {
- if (null != cur)
- cur.close();
- }
- return true;
- }
-
- public int getFlags() {
- return mFlags;
- }
-
- public boolean updateFlags(int flags) {
- if (mFlags != flags) {
- ContentValues cv = new ContentValues();
- cv.put(MetadataColumns.FLAGS, flags);
- if (updateMetadata(cv)) {
- mFlags = flags;
- return true;
- } else {
- return false;
- }
- } else {
- return true;
- }
- };
-
- public boolean updateStatus(int status) {
- if (mStatus != status) {
- ContentValues cv = new ContentValues();
- cv.put(MetadataColumns.DOWNLOAD_STATUS, status);
- if (updateMetadata(cv)) {
- mStatus = status;
- return true;
- } else {
- return false;
- }
- } else {
- return true;
- }
- };
-
- public boolean updateMetadata(ContentValues cv) {
- final SQLiteDatabase sqldb = mHelper.getWritableDatabase();
- if (-1 == this.mMetadataRowID) {
- long newID = sqldb.insert(MetadataColumns.TABLE_NAME,
- MetadataColumns.APKVERSION, cv);
- if (-1 == newID)
- return false;
- mMetadataRowID = newID;
- } else {
- if (0 == sqldb.update(MetadataColumns.TABLE_NAME, cv,
- BaseColumns._ID + " = " + mMetadataRowID, null))
- return false;
- }
- return true;
- }
-
- public boolean updateMetadata(int apkVersion, int downloadStatus) {
- ContentValues cv = new ContentValues();
- cv.put(MetadataColumns.APKVERSION, apkVersion);
- cv.put(MetadataColumns.DOWNLOAD_STATUS, downloadStatus);
- if (updateMetadata(cv)) {
- mVersionCode = apkVersion;
- mStatus = downloadStatus;
- return true;
- } else {
- return false;
- }
- };
-
- public boolean updateFromDb(DownloadInfo di) {
- final SQLiteDatabase sqldb = mHelper.getReadableDatabase();
- Cursor cur = null;
- try {
- cur = sqldb.query(DownloadColumns.TABLE_NAME, DC_PROJECTION,
- DownloadColumns.FILENAME + "= ?",
- new String[] {
- di.mFileName
- }, null, null, null);
- if (null != cur && cur.moveToFirst()) {
- setDownloadInfoFromCursor(di, cur);
- return true;
- }
- return false;
- } finally {
- if (null != cur) {
- cur.close();
- }
- }
- }
-
- public void setDownloadInfoFromCursor(DownloadInfo di, Cursor cur) {
- di.mUri = cur.getString(URI_IDX);
- di.mETag = cur.getString(ETAG_IDX);
- di.mTotalBytes = cur.getLong(TOTALBYTES_IDX);
- di.mCurrentBytes = cur.getLong(CURRENTBYTES_IDX);
- di.mLastMod = cur.getLong(LASTMOD_IDX);
- di.mStatus = cur.getInt(STATUS_IDX);
- di.mControl = cur.getInt(CONTROL_IDX);
- di.mNumFailed = cur.getInt(NUM_FAILED_IDX);
- di.mRetryAfter = cur.getInt(RETRY_AFTER_IDX);
- di.mRedirectCount = cur.getInt(REDIRECT_COUNT_IDX);
- }
-
- public DownloadInfo getDownloadInfoFromCursor(Cursor cur) {
- DownloadInfo di = new DownloadInfo(cur.getInt(INDEX_IDX),
- cur.getString(FILENAME_IDX), this.getClass().getPackage()
- .getName());
- setDownloadInfoFromCursor(di, cur);
- return di;
- }
-
- public DownloadInfo[] getDownloads() {
- final SQLiteDatabase sqldb = mHelper.getReadableDatabase();
- Cursor cur = null;
- try {
- cur = sqldb.query(DownloadColumns.TABLE_NAME, DC_PROJECTION, null,
- null, null, null, null);
- if (null != cur && cur.moveToFirst()) {
- DownloadInfo[] retInfos = new DownloadInfo[cur.getCount()];
- int idx = 0;
- do {
- DownloadInfo di = getDownloadInfoFromCursor(cur);
- retInfos[idx++] = di;
- } while (cur.moveToNext());
- return retInfos;
- }
- return null;
- } finally {
- if (null != cur) {
- cur.close();
- }
- }
- }
-
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java
deleted file mode 100644
index 3f440e9893..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader.impl;
-
-import android.text.format.Time;
-
-import java.util.Calendar;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Helper for parsing an HTTP date.
- */
-public final class HttpDateTime {
-
- /*
- * Regular expression for parsing HTTP-date. Wdy, DD Mon YYYY HH:MM:SS GMT
- * RFC 822, updated by RFC 1123 Weekday, DD-Mon-YY HH:MM:SS GMT RFC 850,
- * obsoleted by RFC 1036 Wdy Mon DD HH:MM:SS YYYY ANSI C's asctime() format
- * with following variations Wdy, DD-Mon-YYYY HH:MM:SS GMT Wdy, (SP)D Mon
- * YYYY HH:MM:SS GMT Wdy,DD Mon YYYY HH:MM:SS GMT Wdy, DD-Mon-YY HH:MM:SS
- * GMT Wdy, DD Mon YYYY HH:MM:SS -HHMM Wdy, DD Mon YYYY HH:MM:SS Wdy Mon
- * (SP)D HH:MM:SS YYYY Wdy Mon DD HH:MM:SS YYYY GMT HH can be H if the first
- * digit is zero. Mon can be the full name of the month.
- */
- private static final String HTTP_DATE_RFC_REGEXP =
- "([0-9]{1,2})[- ]([A-Za-z]{3,9})[- ]([0-9]{2,4})[ ]"
- + "([0-9]{1,2}:[0-9][0-9]:[0-9][0-9])";
-
- private static final String HTTP_DATE_ANSIC_REGEXP =
- "[ ]([A-Za-z]{3,9})[ ]+([0-9]{1,2})[ ]"
- + "([0-9]{1,2}:[0-9][0-9]:[0-9][0-9])[ ]([0-9]{2,4})";
-
- /**
- * The compiled version of the HTTP-date regular expressions.
- */
- private static final Pattern HTTP_DATE_RFC_PATTERN =
- Pattern.compile(HTTP_DATE_RFC_REGEXP);
- private static final Pattern HTTP_DATE_ANSIC_PATTERN =
- Pattern.compile(HTTP_DATE_ANSIC_REGEXP);
-
- private static class TimeOfDay {
- TimeOfDay(int h, int m, int s) {
- this.hour = h;
- this.minute = m;
- this.second = s;
- }
-
- int hour;
- int minute;
- int second;
- }
-
- public static long parse(String timeString)
- throws IllegalArgumentException {
-
- int date = 1;
- int month = Calendar.JANUARY;
- int year = 1970;
- TimeOfDay timeOfDay;
-
- Matcher rfcMatcher = HTTP_DATE_RFC_PATTERN.matcher(timeString);
- if (rfcMatcher.find()) {
- date = getDate(rfcMatcher.group(1));
- month = getMonth(rfcMatcher.group(2));
- year = getYear(rfcMatcher.group(3));
- timeOfDay = getTime(rfcMatcher.group(4));
- } else {
- Matcher ansicMatcher = HTTP_DATE_ANSIC_PATTERN.matcher(timeString);
- if (ansicMatcher.find()) {
- month = getMonth(ansicMatcher.group(1));
- date = getDate(ansicMatcher.group(2));
- timeOfDay = getTime(ansicMatcher.group(3));
- year = getYear(ansicMatcher.group(4));
- } else {
- throw new IllegalArgumentException();
- }
- }
-
- // FIXME: Y2038 BUG!
- if (year >= 2038) {
- year = 2038;
- month = Calendar.JANUARY;
- date = 1;
- }
-
- Time time = new Time(Time.TIMEZONE_UTC);
- time.set(timeOfDay.second, timeOfDay.minute, timeOfDay.hour, date,
- month, year);
- return time.toMillis(false /* use isDst */);
- }
-
- private static int getDate(String dateString) {
- if (dateString.length() == 2) {
- return (dateString.charAt(0) - '0') * 10
- + (dateString.charAt(1) - '0');
- } else {
- return (dateString.charAt(0) - '0');
- }
- }
-
- /*
- * jan = 9 + 0 + 13 = 22 feb = 5 + 4 + 1 = 10 mar = 12 + 0 + 17 = 29 apr = 0
- * + 15 + 17 = 32 may = 12 + 0 + 24 = 36 jun = 9 + 20 + 13 = 42 jul = 9 + 20
- * + 11 = 40 aug = 0 + 20 + 6 = 26 sep = 18 + 4 + 15 = 37 oct = 14 + 2 + 19
- * = 35 nov = 13 + 14 + 21 = 48 dec = 3 + 4 + 2 = 9
- */
- private static int getMonth(String monthString) {
- int hash = Character.toLowerCase(monthString.charAt(0)) +
- Character.toLowerCase(monthString.charAt(1)) +
- Character.toLowerCase(monthString.charAt(2)) - 3 * 'a';
- switch (hash) {
- case 22:
- return Calendar.JANUARY;
- case 10:
- return Calendar.FEBRUARY;
- case 29:
- return Calendar.MARCH;
- case 32:
- return Calendar.APRIL;
- case 36:
- return Calendar.MAY;
- case 42:
- return Calendar.JUNE;
- case 40:
- return Calendar.JULY;
- case 26:
- return Calendar.AUGUST;
- case 37:
- return Calendar.SEPTEMBER;
- case 35:
- return Calendar.OCTOBER;
- case 48:
- return Calendar.NOVEMBER;
- case 9:
- return Calendar.DECEMBER;
- default:
- throw new IllegalArgumentException();
- }
- }
-
- private static int getYear(String yearString) {
- if (yearString.length() == 2) {
- int year = (yearString.charAt(0) - '0') * 10
- + (yearString.charAt(1) - '0');
- if (year >= 70) {
- return year + 1900;
- } else {
- return year + 2000;
- }
- } else if (yearString.length() == 3) {
- // According to RFC 2822, three digit years should be added to 1900.
- int year = (yearString.charAt(0) - '0') * 100
- + (yearString.charAt(1) - '0') * 10
- + (yearString.charAt(2) - '0');
- return year + 1900;
- } else if (yearString.length() == 4) {
- return (yearString.charAt(0) - '0') * 1000
- + (yearString.charAt(1) - '0') * 100
- + (yearString.charAt(2) - '0') * 10
- + (yearString.charAt(3) - '0');
- } else {
- return 1970;
- }
- }
-
- private static TimeOfDay getTime(String timeString) {
- // HH might be H
- int i = 0;
- int hour = timeString.charAt(i++) - '0';
- if (timeString.charAt(i) != ':')
- hour = hour * 10 + (timeString.charAt(i++) - '0');
- // Skip ':'
- i++;
-
- int minute = (timeString.charAt(i++) - '0') * 10
- + (timeString.charAt(i++) - '0');
- // Skip ':'
- i++;
-
- int second = (timeString.charAt(i++) - '0') * 10
- + (timeString.charAt(i++) - '0');
-
- return new TimeOfDay(hour, minute, second);
- }
-}
diff --git a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java b/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java
deleted file mode 100644
index e3666e05b9..0000000000
--- a/platform/android/libs/downloader_library/src/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.vending.expansion.downloader.impl;
-
-import com.android.vending.expansion.downloader.R;
-import com.google.android.vending.expansion.downloader.Helpers;
-
-import android.app.Notification;
-import android.app.PendingIntent;
-import android.content.Context;
-import android.graphics.BitmapFactory;
-import android.view.View;
-import android.widget.RemoteViews;
-
-public class V3CustomNotification implements DownloadNotification.ICustomNotification {
-
- CharSequence mTitle;
- CharSequence mTicker;
- int mIcon;
- long mTotalBytes = -1;
- long mCurrentBytes = -1;
- long mTimeRemaining;
- PendingIntent mPendingIntent;
- Notification mNotification = new Notification();
-
- @Override
- public void setIcon(int icon) {
- mIcon = icon;
- }
-
- @Override
- public void setTitle(CharSequence title) {
- mTitle = title;
- }
-
- @Override
- public void setTotalBytes(long totalBytes) {
- mTotalBytes = totalBytes;
- }
-
- @Override
- public void setCurrentBytes(long currentBytes) {
- mCurrentBytes = currentBytes;
- }
-
- @Override
- public Notification updateNotification(Context c) {
- Notification n = mNotification;
-
- n.icon = mIcon;
-
- n.flags |= Notification.FLAG_ONGOING_EVENT;
-
- if (android.os.Build.VERSION.SDK_INT > 10) {
- n.flags |= Notification.FLAG_ONLY_ALERT_ONCE; // only matters for
- // Honeycomb
- }
-
- // Build the RemoteView object
- RemoteViews expandedView = new RemoteViews(
- c.getPackageName(),
- R.layout.status_bar_ongoing_event_progress_bar);
-
- expandedView.setTextViewText(R.id.title, mTitle);
- // look at strings
- expandedView.setViewVisibility(R.id.description, View.VISIBLE);
- expandedView.setTextViewText(R.id.description,
- Helpers.getDownloadProgressString(mCurrentBytes, mTotalBytes));
- expandedView.setViewVisibility(R.id.progress_bar_frame, View.VISIBLE);
- expandedView.setProgressBar(R.id.progress_bar,
- (int) (mTotalBytes >> 8),
- (int) (mCurrentBytes >> 8),
- mTotalBytes <= 0);
- expandedView.setViewVisibility(R.id.time_remaining, View.VISIBLE);
- expandedView.setTextViewText(
- R.id.time_remaining,
- c.getString(R.string.time_remaining_notification,
- Helpers.getTimeRemaining(mTimeRemaining)));
- expandedView.setTextViewText(R.id.progress_text,
- Helpers.getDownloadProgressPercent(mCurrentBytes, mTotalBytes));
- expandedView.setImageViewResource(R.id.appIcon, mIcon);
- n.contentView = expandedView;
- n.contentIntent = mPendingIntent;
- return n;
- }
-
- @Override
- public void setPendingIntent(PendingIntent contentIntent) {
- mPendingIntent = contentIntent;
- }
-
- @Override
- public void setTicker(CharSequence ticker) {
- mTicker = ticker;
- }
-
- @Override
- public void setTimeRemaining(long timeRemaining) {
- mTimeRemaining = timeRemaining;
- }
-
-}
diff --git a/platform/android/libs/google_play_services/.classpath b/platform/android/libs/google_play_services/.classpath
deleted file mode 100644
index 7bc01d9a9c..0000000000
--- a/platform/android/libs/google_play_services/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
- <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
- <classpathentry kind="output" path="bin/classes"/>
-</classpath>
diff --git a/platform/android/libs/google_play_services/AndroidManifest.xml b/platform/android/libs/google_play_services/AndroidManifest.xml
deleted file mode 100644
index aecd02b5d0..0000000000
--- a/platform/android/libs/google_play_services/AndroidManifest.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.google.android.gms"
- android:versionCode="4323030"
- android:versionName="4.3.23 (1069729-030)" >
-
- <uses-sdk android:minSdkVersion="9"/>
-
-</manifest>
diff --git a/platform/android/libs/google_play_services/README.txt b/platform/android/libs/google_play_services/README.txt
deleted file mode 100644
index 32f8d5eb85..0000000000
--- a/platform/android/libs/google_play_services/README.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-Library Project including Google Play services client jar.
-
-This can be used by an Android project to use the API's provided
-by Google Play services.
-
-There is technically no source, but the src folder is necessary
-to ensure that the build system works. The content is actually
-located in the libs/ directory.
-
-
-USAGE:
-
-Make sure you import this Android library project into your IDE
-and set this project as a dependency.
-
-Note that if you use proguard, you will want to include the
-options from proguard.txt in your configuration. \ No newline at end of file
diff --git a/platform/android/libs/google_play_services/build.xml b/platform/android/libs/google_play_services/build.xml
deleted file mode 100644
index 22ccf3aaf4..0000000000
--- a/platform/android/libs/google_play_services/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="google_play_services" default="help">
-
- <!-- The local.properties file is created and updated by the 'android' tool.
- It contains the path to the SDK. It should *NOT* be checked into
- Version Control Systems. -->
- <property file="local.properties" />
-
- <!-- The ant.properties file can be created by you. It is only edited by the
- 'android' tool to add properties to it.
- This is the place to change some Ant specific build properties.
- Here are some properties you may want to change/update:
-
- source.dir
- The name of the source directory. Default is 'src'.
- out.dir
- The name of the output directory. Default is 'bin'.
-
- For other overridable properties, look at the beginning of the rules
- files in the SDK, at tools/ant/build.xml
-
- Properties related to the SDK location or the project target should
- be updated using the 'android' tool with the 'update' action.
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems.
-
- -->
- <property file="ant.properties" />
-
- <!-- if sdk.dir was not set from one of the property file, then
- get it from the ANDROID_HOME env var.
- This must be done before we load project.properties since
- the proguard config can use sdk.dir -->
- <property environment="env" />
- <condition property="sdk.dir" value="${env.ANDROID_HOME}">
- <isset property="env.ANDROID_HOME" />
- </condition>
-
- <!-- The project.properties file is created and updated by the 'android'
- tool, as well as ADT.
-
- This contains project specific properties such as project target, and library
- dependencies. Lower level build properties are stored in ant.properties
- (or in .classpath for Eclipse projects).
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems. -->
- <loadproperties srcFile="project.properties" />
-
- <!-- quick check on sdk.dir -->
- <fail
- message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
- unless="sdk.dir"
- />
-
- <!--
- Import per project custom build rules if present at the root of the project.
- This is the place to put custom intermediary targets such as:
- -pre-build
- -pre-compile
- -post-compile (This is typically used for code obfuscation.
- Compiled code location: ${out.classes.absolute.dir}
- If this is not done in place, override ${out.dex.input.absolute.dir})
- -post-package
- -post-build
- -pre-clean
- -->
- <import file="custom_rules.xml" optional="true" />
-
- <!-- Import the actual build file.
-
- To customize existing targets, there are two options:
- - Customize only one target:
- - copy/paste the target into this file, *before* the
- <import> task.
- - customize it to your needs.
- - Customize the whole content of build.xml
- - copy/paste the content of the rules files (minus the top node)
- into this file, replacing the <import> task.
- - customize to your needs.
-
- ***********************
- ****** IMPORTANT ******
- ***********************
- In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
- in order to avoid having your file be overridden by tools such as "android update project"
- -->
- <!-- version-tag: 1 -->
- <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
diff --git a/platform/android/libs/google_play_services/libs/google-play-services.jar b/platform/android/libs/google_play_services/libs/google-play-services.jar
deleted file mode 100644
index 67d56476b6..0000000000
--- a/platform/android/libs/google_play_services/libs/google-play-services.jar
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/libs/google-play-services.jar.properties b/platform/android/libs/google_play_services/libs/google-play-services.jar.properties
deleted file mode 100644
index 429687b792..0000000000
--- a/platform/android/libs/google_play_services/libs/google-play-services.jar.properties
+++ /dev/null
@@ -1 +0,0 @@
-doc=../../../docs/reference
diff --git a/platform/android/libs/google_play_services/proguard-project.txt b/platform/android/libs/google_play_services/proguard-project.txt
deleted file mode 100644
index f2fe1559a2..0000000000
--- a/platform/android/libs/google_play_services/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/platform/android/libs/google_play_services/proguard.txt b/platform/android/libs/google_play_services/proguard.txt
deleted file mode 100644
index 0c9693a2c0..0000000000
--- a/platform/android/libs/google_play_services/proguard.txt
+++ /dev/null
@@ -1,20 +0,0 @@
--keep class * extends java.util.ListResourceBundle {
- protected Object[][] getContents();
-}
-
-# Keep SafeParcelable value, needed for reflection. This is required to support backwards
-# compatibility of some classes.
--keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
- public static final *** NULL;
-}
-
-# Keep the names of classes/members we need for client functionality.
--keepnames @com.google.android.gms.common.annotation.KeepName class *
--keepclassmembernames class * {
- @com.google.android.gms.common.annotation.KeepName *;
-}
-
-# Needed for Parcelable/SafeParcelable Creators to not get stripped
--keepnames class * implements android.os.Parcelable {
- public static final ** CREATOR;
-} \ No newline at end of file
diff --git a/platform/android/libs/google_play_services/project.properties b/platform/android/libs/google_play_services/project.properties
deleted file mode 100644
index 36f15941e2..0000000000
--- a/platform/android/libs/google_play_services/project.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-15
-android.library=true
diff --git a/platform/android/libs/google_play_services/res/color/common_signin_btn_text_dark.xml b/platform/android/libs/google_play_services/res/color/common_signin_btn_text_dark.xml
deleted file mode 100644
index a615ba2747..0000000000
--- a/platform/android/libs/google_play_services/res/color/common_signin_btn_text_dark.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:state_pressed="true"
- android:color="@color/common_signin_btn_dark_text_pressed" />
- <item
- android:state_enabled="false"
- android:state_focused="true"
- android:color="@color/common_signin_btn_dark_text_disabled" />
- <item
- android:state_focused="true"
- android:color="@color/common_signin_btn_dark_text_focused" />
- <item
- android:state_enabled="false"
- android:color="@color/common_signin_btn_dark_text_disabled" />
- <item
- android:color="@color/common_signin_btn_dark_text_default" />
-</selector>
diff --git a/platform/android/libs/google_play_services/res/color/common_signin_btn_text_light.xml b/platform/android/libs/google_play_services/res/color/common_signin_btn_text_light.xml
deleted file mode 100644
index 662066899b..0000000000
--- a/platform/android/libs/google_play_services/res/color/common_signin_btn_text_light.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:state_pressed="true"
- android:color="@color/common_signin_btn_light_text_pressed" />
- <item
- android:state_enabled="false"
- android:state_focused="true"
- android:color="@color/common_signin_btn_light_text_disabled" />
- <item
- android:state_focused="true"
- android:color="@color/common_signin_btn_light_text_focused" />
- <item
- android:state_enabled="false"
- android:color="@color/common_signin_btn_light_text_disabled" />
- <item
- android:color="@color/common_signin_btn_light_text_default" />
-</selector>
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_dark.9.png
deleted file mode 100644
index 0f9e7917e0..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_dark.9.png
deleted file mode 100644
index 570e432252..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_light.9.png
deleted file mode 100644
index 570e432252..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_light.9.png
deleted file mode 100644
index 0f9e7917e0..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_disabled_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_dark.9.png
deleted file mode 100644
index f507b9f7da..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_light.9.png
deleted file mode 100644
index d5625e5fc1..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_dark.9.png
deleted file mode 100644
index aea3c0d168..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_light.9.png
deleted file mode 100644
index 849e89f3aa..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_normal_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_dark.9.png
deleted file mode 100644
index f4ab2f2a51..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_light.9.png
deleted file mode 100644
index 9fe611d684..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_icon_pressed_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_dark.9.png
deleted file mode 100644
index bbcde39cf0..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_dark.9.png
deleted file mode 100644
index 53957b698f..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_light.9.png
deleted file mode 100644
index 53957b698f..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_light.9.png
deleted file mode 100644
index bbcde39cf0..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_disabled_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_dark.9.png
deleted file mode 100644
index 000d12e8e3..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_light.9.png
deleted file mode 100644
index d9279405c6..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_dark.9.png
deleted file mode 100644
index 67f263c80e..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_light.9.png
deleted file mode 100644
index 96324c52f9..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_normal_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_dark.9.png
deleted file mode 100644
index e4503128f6..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_light.9.png
deleted file mode 100644
index fb94b77616..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/common_signin_btn_text_pressed_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_medium_off_client.png b/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_medium_off_client.png
deleted file mode 100644
index 894f1b9f93..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_medium_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_small_off_client.png b/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_small_off_client.png
deleted file mode 100644
index ac777614e6..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_small_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_standard_off_client.png b/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_standard_off_client.png
deleted file mode 100644
index f1c32d3b9e..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_standard_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_tall_off_client.png b/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_tall_off_client.png
deleted file mode 100644
index 08a4670c47..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-hdpi/ic_plusone_tall_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_dark.9.png
deleted file mode 100644
index dddcbebf12..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_dark.9.png
deleted file mode 100644
index 58b75bd7de..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_light.9.png
deleted file mode 100644
index 58b75bd7de..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_light.9.png
deleted file mode 100644
index dddcbebf12..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_disabled_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_dark.9.png
deleted file mode 100644
index 7d9ed7834d..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_light.9.png
deleted file mode 100644
index 0ca401d376..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_dark.9.png
deleted file mode 100644
index f2c3f55717..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_light.9.png
deleted file mode 100644
index 83b4fc9d6d..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_normal_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_dark.9.png
deleted file mode 100644
index dd74fe8761..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_light.9.png
deleted file mode 100644
index b7dc7aac7e..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_icon_pressed_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_dark.9.png
deleted file mode 100644
index efdfe2e616..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_dark.9.png
deleted file mode 100644
index c7650b09e3..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_light.9.png
deleted file mode 100644
index c7650b09e3..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_light.9.png
deleted file mode 100644
index efdfe2e616..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_disabled_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_dark.9.png
deleted file mode 100644
index 8c76283e50..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_light.9.png
deleted file mode 100644
index abd26bcd41..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_dark.9.png
deleted file mode 100644
index 28181c338b..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_light.9.png
deleted file mode 100644
index 34957fad5f..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_normal_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_dark.9.png
deleted file mode 100644
index e923ee9c75..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_light.9.png
deleted file mode 100644
index 34cf6bbad5..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/common_signin_btn_text_pressed_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_medium_off_client.png b/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_medium_off_client.png
deleted file mode 100644
index d7e5777153..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_medium_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_small_off_client.png b/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_small_off_client.png
deleted file mode 100644
index af301c2dc9..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_small_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_standard_off_client.png b/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_standard_off_client.png
deleted file mode 100644
index f43e965fb8..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_standard_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_tall_off_client.png b/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_tall_off_client.png
deleted file mode 100644
index 0b2b5c9a98..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-mdpi/ic_plusone_tall_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_dark.9.png
deleted file mode 100644
index 9044a118af..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_dark.9.png
deleted file mode 100644
index e94a49b0ae..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_light.9.png
deleted file mode 100644
index e94a49b0ae..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_light.9.png
deleted file mode 100644
index 9044a118af..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_disabled_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_dark.9.png
deleted file mode 100644
index bfe4f04639..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_light.9.png
deleted file mode 100644
index 876884fad7..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_dark.9.png
deleted file mode 100644
index b3e6dd5b40..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_light.9.png
deleted file mode 100644
index 5a888f28f5..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_normal_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_dark.9.png
deleted file mode 100644
index d0f7b4cbf3..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_light.9.png
deleted file mode 100644
index 0db6b06450..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_icon_pressed_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_dark.9.png
deleted file mode 100644
index d182b5e2c3..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_dark.9.png
deleted file mode 100644
index 47e2aeaf32..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_light.9.png
deleted file mode 100644
index 47e2aeaf32..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_light.9.png
deleted file mode 100644
index d182b5e2c3..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_disabled_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_dark.9.png
deleted file mode 100644
index 64e9706874..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_light.9.png
deleted file mode 100644
index 0fd8cdda14..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_dark.9.png
deleted file mode 100644
index 3427b47681..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_light.9.png
deleted file mode 100644
index 31e38c4c12..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_normal_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_dark.9.png
deleted file mode 100644
index e6a7880730..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_light.9.png
deleted file mode 100644
index 972962dcfd..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/common_signin_btn_text_pressed_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_medium_off_client.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_medium_off_client.png
deleted file mode 100644
index bb933092be..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_medium_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_small_off_client.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_small_off_client.png
deleted file mode 100644
index 6174fcd9b1..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_small_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_standard_off_client.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_standard_off_client.png
deleted file mode 100644
index 6a4c298e2d..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_standard_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_tall_off_client.png b/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_tall_off_client.png
deleted file mode 100644
index f68e9133bb..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xhdpi/ic_plusone_tall_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_dark.9.png
deleted file mode 100644
index c97f349fae..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_dark.9.png
deleted file mode 100644
index 34cbff115c..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_light.9.png
deleted file mode 100644
index 34cbff115c..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_light.9.png
deleted file mode 100644
index c97f349fae..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_disabled_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_dark.9.png
deleted file mode 100644
index 702c49b74c..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_light.9.png
deleted file mode 100644
index 06ad5a5ae7..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_dark.9.png
deleted file mode 100644
index af160fc73b..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_light.9.png
deleted file mode 100644
index c647fb4ce8..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_normal_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_dark.9.png
deleted file mode 100644
index fd0a4312b4..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_light.9.png
deleted file mode 100644
index f8ce5a6aca..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_icon_pressed_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_dark.9.png
deleted file mode 100644
index b491f629fd..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_dark.9.png
deleted file mode 100644
index 777c8d6408..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_light.9.png
deleted file mode 100644
index 777c8d6408..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_light.9.png
deleted file mode 100644
index b491f629fd..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_disabled_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_dark.9.png
deleted file mode 100644
index c8a8f1cbdf..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_light.9.png
deleted file mode 100644
index bcd0d0caf4..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_focus_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_dark.9.png
deleted file mode 100644
index ac75dad52e..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_light.9.png
deleted file mode 100644
index c19afad669..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_normal_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_dark.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_dark.9.png
deleted file mode 100644
index c49044185a..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_light.9.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_light.9.png
deleted file mode 100644
index c52be7455e..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/common_signin_btn_text_pressed_light.9.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_medium_off_client.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_medium_off_client.png
deleted file mode 100644
index 4f23739dc3..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_medium_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_small_off_client.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_small_off_client.png
deleted file mode 100644
index 8ffa1d72e6..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_small_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_standard_off_client.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_standard_off_client.png
deleted file mode 100644
index 4d81cf40cd..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_standard_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_tall_off_client.png b/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_tall_off_client.png
deleted file mode 100644
index fab5a79b45..0000000000
--- a/platform/android/libs/google_play_services/res/drawable-xxhdpi/ic_plusone_tall_off_client.png
+++ /dev/null
Binary files differ
diff --git a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_dark.xml b/platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_dark.xml
deleted file mode 100644
index dd1cf679fe..0000000000
--- a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_dark.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:state_pressed="true"
- android:drawable="@drawable/common_signin_btn_icon_pressed_dark" />
- <item
- android:state_enabled="false"
- android:state_focused="true"
- android:drawable="@drawable/common_signin_btn_icon_disabled_focus_dark" />
- <item
- android:state_focused="true"
- android:drawable="@drawable/common_signin_btn_icon_focus_dark" />
- <item
- android:state_enabled="false"
- android:drawable="@drawable/common_signin_btn_icon_disabled_dark" />
- <item
- android:drawable="@drawable/common_signin_btn_icon_normal_dark" />
-</selector>
diff --git a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_light.xml b/platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_light.xml
deleted file mode 100644
index abf412bda8..0000000000
--- a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_icon_light.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:state_pressed="true"
- android:drawable="@drawable/common_signin_btn_icon_pressed_light" />
- <item
- android:state_enabled="false"
- android:state_focused="true"
- android:drawable="@drawable/common_signin_btn_icon_disabled_focus_light" />
- <item
- android:state_focused="true"
- android:drawable="@drawable/common_signin_btn_icon_focus_light" />
- <item
- android:state_enabled="false"
- android:drawable="@drawable/common_signin_btn_icon_disabled_light" />
- <item
- android:drawable="@drawable/common_signin_btn_icon_normal_light" />
-</selector>
diff --git a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_dark.xml b/platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_dark.xml
deleted file mode 100644
index 2d92217cdf..0000000000
--- a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_dark.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:state_pressed="true"
- android:drawable="@drawable/common_signin_btn_text_pressed_dark" />
- <item
- android:state_enabled="false"
- android:state_focused="true"
- android:drawable="@drawable/common_signin_btn_text_disabled_focus_dark" />
- <item
- android:state_focused="true"
- android:drawable="@drawable/common_signin_btn_text_focus_dark" />
- <item
- android:state_enabled="false"
- android:drawable="@drawable/common_signin_btn_text_disabled_dark" />
- <item
- android:drawable="@drawable/common_signin_btn_text_normal_dark" />
-</selector>
diff --git a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_light.xml b/platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_light.xml
deleted file mode 100644
index 810c02112d..0000000000
--- a/platform/android/libs/google_play_services/res/drawable/common_signin_btn_text_light.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:state_pressed="true"
- android:drawable="@drawable/common_signin_btn_text_pressed_light" />
- <item
- android:state_enabled="false"
- android:state_focused="true"
- android:drawable="@drawable/common_signin_btn_text_disabled_focus_light" />
- <item
- android:state_focused="true"
- android:drawable="@drawable/common_signin_btn_text_focus_light" />
- <item
- android:state_enabled="false"
- android:drawable="@drawable/common_signin_btn_text_disabled_light" />
- <item
- android:drawable="@drawable/common_signin_btn_text_normal_light" />
-</selector>
diff --git a/platform/android/libs/google_play_services/res/values-af/strings.xml b/platform/android/libs/google_play_services/res/values-af/strings.xml
deleted file mode 100644
index 1b211f5076..0000000000
--- a/platform/android/libs/google_play_services/res/values-af/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Kry Google Play-dienste"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Hierdie program sal nie loop sonder Google Play-dienste nie, wat nie op jou foon is nie."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Hierdie program sal nie loop sonder Google Play-dienste nie, wat nie op jou tablet is nie."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Kry Google Play-dienste"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Aktiveer Google Play-dienste"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Hierdie program sal nie werk tensy jy Google Play-dienste aktiveer nie."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Aktiveer Google Play-dienste"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Dateer Google Play-dienste op"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Hierdie program sal nie loop nie, tensy jy Google Play-dienste opdateer."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Netwerkfout"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"\'n Dataverbinding is nodig om aan Google Play-dienste te koppel."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Ongeldige rekening"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Die gespesifiseerde rekening bestaan nie op hierdie toestel nie. Kies asseblief \'n ander rekening."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Onbekende probleem met Google Play-dienste."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play-dienste"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play-dienste, waarop sommige van jou programme staatmaak, werk nie met jou toestel nie. Kontak asseblief die vervaardiger vir bystand."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Dit lyk of die datum op die toestel verkeerd is. Gaan asseblief die datum op die toestel na."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Dateer op"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Meld aan"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Meld aan met Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"\'n Program het probeer om \'n slegte weergawe van Google Play-dienste te gebruik."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"\'n Program vereis dat Google Play-dienste geaktiveer word."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"\'n Program vereis dat Google Play-dienste geïnstalleer word."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"\'n Program vereis \'n opdatering vir Google Play-dienste."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play-dienstefout"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Versoek deur <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-am/strings.xml b/platform/android/libs/google_play_services/res/values-am/strings.xml
deleted file mode 100644
index 2585210fe0..0000000000
--- a/platform/android/libs/google_play_services/res/values-am/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play አገልግሎቶችን አግኝ"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"ይህ መተግበሪያ ያለ Google Play አገልግሎቶች አይሰራም፣ እነሱ ደግሞ ስልክዎ ላይ የሉም።"</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"ይህ መተግበሪያ ያለ Google Play አገልግሎቶች አይሰራም፣ እነሱ ደግሞ ጡባዊዎ ላይ የሉም።"</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play አገልግሎቶችን አግኝ"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play አገልግሎቶችን አንቃ"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Google Play አገልግሎቶችን እስካላነቁ ድረስ ይህ መተግበሪያ አይሰራም።"</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play አገልግሎቶችን አንቃ"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play አገልግሎቶችን ያዘምኑ"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Google Play አገልግሎቶችን እስኪያዘምኑ ድረስ ይህ መተግበሪያ አይሰራም።"</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"የአውታረ መረብ ስህተት"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"ከGoogle Play አገልግሎቶች ጋር ለመገናኘት የውሂብ ግንኙነት ያስፈልጋል።"</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"ልክ ያልሆነ መለያ"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"የተገለጸው መለያ በዚህ መሣሪያ ላይ የለም። እባክው የተለየ መለያ ይምረጡ።"</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"በGoogle Play አገልግሎቶች ላይ ያልታወቀ ችግር።"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play አገልግሎቶች"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"የGoogle Play አገልግሎቶች፣ አንዳንድ መተግበሪያዎችዎ በእሱ ላይ ጥገኛ የሆኑት፣ በመሣሪያዎ አይደገፍም። እባክዎ ለእርዳታ አምራቹን ያግኙ።"</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"በመሣሪያው ላይ ያለው ቀን ትክክል አይመስልም። እባክዎ በመሣሪያው ላይ ያለውን ቀን ያረጋግጡ።"</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"ያዘምኑ"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"ግባ"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"በGoogle ይግቡ"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"መተግበሪያው የGoogle Play አገልግሎቶችን መጥፎ ስሪት ለመጠቀም ሞክሯል።"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"መተግበሪያው Google Play አገልግሎቶች እንዲነቁ ይፈልጋል።"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"መተግበሪያው Google Play አገልግሎቶች እንዲጫኑ ይፈልጋል።"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"መተግበሪያው Google Play አገልግሎቶች እንዲዘምን ይፈልጋል።"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"የGoogle Play አገልግሎቶች ስህተት"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"በ<xliff:g id="APP_NAME">%1$s</xliff:g> የተጠየቀ"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-ar/strings.xml b/platform/android/libs/google_play_services/res/values-ar/strings.xml
deleted file mode 100644
index 9451b37181..0000000000
--- a/platform/android/libs/google_play_services/res/values-ar/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"‏الحصول على خدمات Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"‏لن يتم تشغيل هذا التطبيق بدون خدمات Google Play، والتي لا تتوفر في هاتفك."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"‏لن يتم تشغيل هذا التطبيق بدون خدمات Google Play، والتي لا تتوفر في جهازك اللوحي."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"‏الحصول على خدمات Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"‏تمكين خدمات Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"‏لن يعمل هذا التطبيق ما لم يتم تمكين خدمات Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"‏تمكين خدمات Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"‏تحديث خدمات Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"‏لن يتم تشغيل هذا التطبيق ما لم تحدِّث خدمات Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"خطأ في الشبكة"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"‏يتطلب الاتصال بخدمات Google Play وجود اتصال بيانات."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"حساب غير صالح"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"الحساب الذي تمّ تحديده غير موجود على الجهاز. يُرجى اختيار حساب آخر."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"‏حدثت مشكلة غير معروفة في خدمات Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"‏خدمات Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"‏خدمات Google Play التي تستجيب لها بعض تطبيقاتك لا تعمل على جهازك. يُرجى الاتصال بجهة التصنيع للحصول على المساعدة."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"يبدو أن التاريخ على الجهاز غير صحيح. الرجاء التحقق من التاريخ على الجهاز."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"تحديث"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"تسجيل الدخول"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"‏تسجيل الدخول باستخدام Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"‏يحاول أحد التطبيقات استخدام إصدار غير صالح من خدمات Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"‏يتطلب أحد التطبيقات تمكين خدمات Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"‏يتطلب أحد التطبيقات تثبيت خدمات Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"‏يتطلب أحد التطبيقات تحديث خدمات Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"‏خطأ في خدمات Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"تم الطلب عن طريق <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-be/strings.xml b/platform/android/libs/google_play_services/res/values-be/strings.xml
deleted file mode 100644
index 81382d1c0f..0000000000
--- a/platform/android/libs/google_play_services/res/values-be/strings.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Атрымаць службы Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Гэта прыкладанне не будзе працаваць без службаў Google Play, якіх няма ў вашым тэлефоне."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Гэта прыкладанне не будзе працаваць без службаў Google Play, якіх няма на вашым планшэце."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Атрымаць службы Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Уключыць службы Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Гэта прыкладанне не будзе працаваць, пакуль вы не ўключыце службы Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Уключыць службы Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Абнаўленне службаў Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Гэта прыкладанне не будзе працаваць падчас абнаўлення службаў Google Play."</string>
- <!-- no translation found for common_google_play_services_network_error_title (3827284619958211114) -->
- <skip />
- <!-- no translation found for common_google_play_services_network_error_text (9038847255613537209) -->
- <skip />
- <!-- no translation found for common_google_play_services_invalid_account_title (1066672360770936753) -->
- <skip />
- <!-- no translation found for common_google_play_services_invalid_account_text (4983316348021735578) -->
- <skip />
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Невядомая праблема са службамі Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Службы Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Службы Google Play, да якiх прывязаны некаторыя прыкладаннi, не падтрымлiваюцца на вашай прыладзе. Па дапамогу звярнiцеся да вытворцы."</string>
- <!-- no translation found for common_google_play_services_unsupported_date_text (4725396522367789365) -->
- <skip />
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Абнавіць"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Увайсцi"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Увайсці ў Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Прыкладанне паспрабавала скарыстацца сапсаванай версіяй службаў Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Прыкладанне патрабуе ўключэння службаў Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Прыкладанне патрабуе ўсталявання службаў Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Прыкладанне патрабуе абнаўлення службаў Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Памылка службаў Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Запытана прыкладаннем <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-bg/strings.xml b/platform/android/libs/google_play_services/res/values-bg/strings.xml
deleted file mode 100644
index bb8da3c105..0000000000
--- a/platform/android/libs/google_play_services/res/values-bg/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Изтегляне на услугите за Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Това приложение няма да се изпълнява без услугите за Google Play, които липсват в телефона ви."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Това приложение няма да се изпълнява без услугите за Google Play, които липсват в таблета ви."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Услуги за Google Play: Изтегл."</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Активиране на услугите за Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Това приложение няма да работи, освен ако не активирате услугите за Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Услуги за Google Play: Актив."</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Актуализиране на услугите за Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Това приложение няма да се изпълнява, освен ако не актуализирате услугите за Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Грешка в мрежата"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"За свързване с услугите за Google Play се изисква връзка за данни."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Невалиден профил"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Посоченият профил не съществува на това устройство. Моля, изберете друг."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Неизвестен проблем с услугите за Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Услуги за Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Услугите за Google Play, на които разчитат някои от приложенията ви, не се поддържат от устройството ви. Моля, свържете се с производителя за помощ."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Изглежда, че датата на устройството е неправилна. Моля, проверете я."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Актуализиране"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Вход"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Вход с Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Приложение опита да ползва неправилна версия на услуг. за Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Приложение изисква активирането на услугите за Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Приложение изисква инсталирането на услугите за Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Приложение изисква актуализирането на услугите за Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Грешка в услугите за Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Заявено от <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-ca/strings.xml b/platform/android/libs/google_play_services/res/values-ca/strings.xml
deleted file mode 100644
index 5b63e86af7..0000000000
--- a/platform/android/libs/google_play_services/res/values-ca/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Baixa els serveis de Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Aquesta aplicació no s\'executarà si el telèfon no té instal·lats els serveis de Google Play."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Aquesta aplicació no funcionarà si la tauleta no té instal·lats els serveis de Google Play."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Baixa els serveis de Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Activa els serveis de Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Aquesta aplicació no funcionarà si no actives els serveis de Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Activa els serveis de Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Actualitza els serveis de Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Aquesta aplicació no s\'executarà si no actualitzes els serveis de Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Error de xarxa"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Es requereix una connexió de dades per connectar amb els serveis de Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Compte no vàlid"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"El compte especificat no existeix en aquest dispositiu. Tria un compte diferent."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Error desconegut relacionat amb els serveis de Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Serveis de Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"El teu dispositiu no és compatible amb els serveis de Google Play, en què es basen les teves aplicacions. Per obtenir assistència, contacta amb el fabricant."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Sembla que la data del dispositiu no és correcta. Comprova-la."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Actualitza"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Inicia sessió"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Inicia sessió amb Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Una aplic. ha intentat utilitzar una versió errònia de serveis de Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Una aplicació requereix que s\'activin els serveis de Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Una aplicació requereix que s\'instal·lin els serveis de Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Una aplicació requereix que s\'actualitzin els serveis de Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Error dels serveis de Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Sol·licitada per <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-cs/strings.xml b/platform/android/libs/google_play_services/res/values-cs/strings.xml
deleted file mode 100644
index 1b5423b039..0000000000
--- a/platform/android/libs/google_play_services/res/values-cs/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Instalovat služby Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ke spuštění této aplikace jsou potřeba služby Google Play, které v telefonu nemáte."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ke spuštění této aplikace jsou potřeba služby Google Play, které v tabletu nemáte."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Instalovat služby Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Aktivovat služby Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ke spuštění této aplikace je třeba aktivovat služby Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Aktivovat služby Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Aktualizace služeb Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ke spuštění této aplikace je třeba aktualizovat služby Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Chyba sítě"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Připojení ke službám Google Play vyžaduje datové připojení."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Neplatný účet"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Zadaný účet v tomto zařízení neexistuje. Zvolte prosím jiný účet."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Nastal neznámý problém se službami Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Služby Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Některé vaše aplikace vyžadují služby Google Play, které ve vašem zařízení nejsou podporovány. S žádostí o pomoc se prosím obraťte na výrobce."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Datum v zařízení není správně nastaveno. Zkontrolujte prosím datum."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Aktualizovat"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Přihlásit se"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Přihlásit se účtem Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikace se pokusila použít nesprávnou verzi Služeb Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Aplikace vyžaduje aktivované Služby Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Aplikace vyžaduje instalaci Služeb Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Aplikace vyžaduje aktualizaci Služeb Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Chyba služeb Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Požadováno aplikací <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-da/strings.xml b/platform/android/libs/google_play_services/res/values-da/strings.xml
deleted file mode 100644
index daa2160d3b..0000000000
--- a/platform/android/libs/google_play_services/res/values-da/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Hent Google Play-tjenester"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Denne app kan ikke køre uden Google Play-tjenester, som mangler på din telefon."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Denne app kan ikke køre uden Google Play-tjenester, som mangler på din tablet."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Hent Google Play-tjenester"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Aktivér Google Play-tjenester"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Denne app virker ikke, medmindre du aktiverer Google Play-tjenester."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Aktivér Google Play-tjenester"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Opdater Google Play-tjenester"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Denne app kan ikke køre, medmindre du opdaterer Google Play-tjenester."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Netværksfejl"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Der kræves en dataforbindelse for at oprette forbindelse til Google Play-tjenester."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Ugyldig konto"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Den angivne konto findes ikke på denne enhed. Vælg en anden konto."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Ukendt problem med Google Play-tjenester."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play-tjenester"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play-tjenester, som nogle af dine applikationer er afhængige af, understøttes ikke af din enhed. Kontakt producenten for at få hjælp."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Datoen på enheden ser ud til at være forkert. Husk at kontrollere datoen på enheden."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Opdater"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Log ind"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Log ind med Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"En applikation forsøgte at bruge en defekt version af Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"En applikation kræver, at Google Play er aktiveret."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"En applikation kræver, at Google Play er installeret."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"En applikation kræver en opdatering af Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Fejl i Google Play-tjenester"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Anmodning fra <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-de/strings.xml b/platform/android/libs/google_play_services/res/values-de/strings.xml
deleted file mode 100644
index df8e88e9e2..0000000000
--- a/platform/android/libs/google_play_services/res/values-de/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play-Dienste installieren"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Zur Nutzung dieser App sind Google Play-Dienste erforderlich, die auf Ihrem Telefon nicht installiert sind."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Zur Nutzung dieser App sind Google Play-Dienste erforderlich, die auf Ihrem Tablet nicht installiert sind."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play-Dienste installieren"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play-Dienste aktivieren"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Diese App funktioniert nur, wenn Sie die Google Play-Dienste aktivieren."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play-Dienste aktivieren"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play-Dienste aktualisieren"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Diese App wird nur ausgeführt, wenn Sie die Google Play-Dienste aktualisieren."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Netzwerkfehler"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Um eine Verbindung zu den Google Play-Diensten herzustellen, ist eine Datenverbindung erforderlich."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Ungültiges Konto"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Das angegebene Konto ist auf diesem Gerät nicht vorhanden. Bitte wählen Sie ein anderes Konto aus."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Unbekanntes Problem mit Google Play-Diensten"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play-Dienste"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play-Dienste, auf denen einige Ihrer Apps basieren, werden von diesem Gerät nicht unterstützt. Wenden Sie sich für weitere Informationen an den Hersteller."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Das Datum auf dem Gerät scheint falsch zu sein. Bitte überprüfen Sie das Datum auf dem Gerät."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Aktualisieren"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Anmelden"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Über Google anmelden"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"App versuchte, defekte Google Play-Dienste-Version zu verwenden"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"App erfordert aktivierte Google Play-Dienste"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"App erfordert die Installation von Google Play-Diensten"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"App erfordert ein Update für Google Play-Dienste"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Fehler bei Google Play-Diensten"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Angefordert von <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-el/strings.xml b/platform/android/libs/google_play_services/res/values-el/strings.xml
deleted file mode 100644
index 13a5dc5ef3..0000000000
--- a/platform/android/libs/google_play_services/res/values-el/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Λήψη υπηρεσιών Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Αυτή η εφαρμογή δεν θα εκτελεστεί χωρίς τις υπηρεσίες Google Play, οι οποίες λείπουν από το τηλέφωνό σας."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Αυτή η εφαρμογή δεν θα εκτελεστεί χωρίς τις υπηρεσίες Google Play, οι οποίες λείπουν από το tablet σας."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Λήψη υπηρεσιών Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Ενεργοποίηση υπηρεσιών Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Αυτή η εφαρμογή δεν θα λειτουργήσει εάν δεν έχετε ενεργοποιήσει τις υπηρεσίες Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Ενεργοπ. υπηρεσιών Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Ενημέρωση υπηρεσιών Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Αυτή η εφαρμογή θα εκτελεστεί αφού ενημερώσετε τις υπηρεσίες Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Σφάλμα δικτύου"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Απαιτείται σύνδεση δεδομένων για να συνδεθείτε με τις Υπηρεσίες Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Μη έγκυρος λογαριασμός"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Ο συγκεκριμένος λογαριασμός δεν υπάρχει σε αυτήν τη συσκευή. Επιλέξτε έναν διαφορετικό λογαριασμό."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Άγνωστο πρόβλημα με τις υπηρεσίες Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Υπηρεσίες Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Οι υπηρεσίες Google Play, στις οποίες βασίζονται ορισμένες από τις εφαρμογές σας, δεν υποστηρίζονται στη συσκευή σας. Επικοινωνήστε με τον κατασκευαστή για υποστήριξη."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Η ημερομηνία στη συσκευή φαίνεται λανθασμένη. Ελέγξτε την ημερομηνία στη συσκευή."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Ενημέρωση"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Σύνδεση"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Συνδεθείτε στο Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Απόπειρα χρήσης ακατάλληλης έκδοσης Υπηρεσιών Google Play από εφαρμογή"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Μια εφαρμογή απαιτεί τις Υπηρεσίες Google Play για ενεργοποίηση."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Μια εφαρμογή απαιτεί την εγκατάσταση των Υπηρεσιών Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Μια εφαρμογή απαιτεί μια ενημέρωση για τις Υπηρεσίες Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Σφάλμα υπηρεσιών Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Υποβλήθηκε αίτημα από την εφαρμογή <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-en-rGB/strings.xml b/platform/android/libs/google_play_services/res/values-en-rGB/strings.xml
deleted file mode 100644
index 106d390b3e..0000000000
--- a/platform/android/libs/google_play_services/res/values-en-rGB/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Get Google Play services"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"This app won\'t run without Google Play services, which are missing from your phone."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"This app won\'t run without Google Play services, which are missing from your tablet."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Get Google Play services"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Enable Google Play services"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"This app won\'t work unless you enable Google Play services."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Enable Google Play services"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Update Google Play services"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"This app won\'t run unless you update Google Play services."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Network Error"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"A data connection is required to connect to Google Play services."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Invalid Account"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"The specified account does not exist on this device. Please choose a different account."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Unknown issue with Google Play services."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play services"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistance."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"The date on the device appears to be incorrect. Please check the date on the device."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Update"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Sign in"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Sign in with Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"An application attempted to use a bad version of Google Play Services."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"An application requires Google Play Services to be enabled."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"An application requires installation of Google Play Services."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"An application requires an update for Google Play Services."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play services error"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Requested by <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-en-rIN/strings.xml b/platform/android/libs/google_play_services/res/values-en-rIN/strings.xml
deleted file mode 100644
index 106d390b3e..0000000000
--- a/platform/android/libs/google_play_services/res/values-en-rIN/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Get Google Play services"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"This app won\'t run without Google Play services, which are missing from your phone."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"This app won\'t run without Google Play services, which are missing from your tablet."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Get Google Play services"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Enable Google Play services"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"This app won\'t work unless you enable Google Play services."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Enable Google Play services"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Update Google Play services"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"This app won\'t run unless you update Google Play services."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Network Error"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"A data connection is required to connect to Google Play services."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Invalid Account"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"The specified account does not exist on this device. Please choose a different account."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Unknown issue with Google Play services."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play services"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistance."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"The date on the device appears to be incorrect. Please check the date on the device."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Update"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Sign in"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Sign in with Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"An application attempted to use a bad version of Google Play Services."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"An application requires Google Play Services to be enabled."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"An application requires installation of Google Play Services."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"An application requires an update for Google Play Services."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play services error"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Requested by <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-es-rUS/strings.xml b/platform/android/libs/google_play_services/res/values-es-rUS/strings.xml
deleted file mode 100644
index 6be905908c..0000000000
--- a/platform/android/libs/google_play_services/res/values-es-rUS/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Obtener Google Play Services"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Esta aplicación no se ejecutará si no instalasGoogle Play Services en tu dispositivo."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Esta aplicación no se ejecutará si no instalas Google Play Services en tu tablet."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Descargar Google Play Services"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Activar Google Play Services"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Esta aplicación no funcionará si no activas Google Play Services."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Activar Google Play Services"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Actualizar Google Play Services"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Esta aplicación no se ejecutará si no actualizas Google Play Services."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Error de red"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Se necesita una conexión de datos para establecer conexión con Google Play Services."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Cuenta no válida"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"La cuenta especificada no existe en este dispositivo. Elige otra cuenta."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Error desconocido relacionado con Google Play Services"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play Services"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play Services, del cual dependen algunas de tus aplicaciones, no es compatible con tu dispositivo. Comunícate con el fabricante para obtener ayuda."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Parece que la fecha del dispositivo es incorrecta. ¿Puedes revisarla?"</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Actualizar"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Acceder"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Acceder con Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Una aplic. intentó usar una versión no válida de Google Play Services"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Una aplicación requiere que se active Google Play Services"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Una aplicación requiere que se instale Google Play Services"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Una aplicación requiere que se actualice Google Play Services"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Error de Google Play Services"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Solicitada por <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-es/strings.xml b/platform/android/libs/google_play_services/res/values-es/strings.xml
deleted file mode 100644
index ed32995cf2..0000000000
--- a/platform/android/libs/google_play_services/res/values-es/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Descargar servicios de Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Esta aplicación no se ejecutará si tu teléfono no tiene instalados los servicios de Google Play."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Esta aplicación no se ejecutará si tu tablet no tiene instalados los servicios de Google Play."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Descargar servicios de Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Habilitar servicios de Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Esta aplicación no funcionará si no habilitas los servicios de Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Habilitar servicios de Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Actualizar servicios de Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Esta aplicación no se ejecutará si no actualizas los servicios de Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Error de red"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Se necesita una conexión de datos para establecer conexión con los servicios de Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Cuenta no válida"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"La cuenta especificada no existe en este dispositivo. Selecciona otra cuenta."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Error desconocido relacionado con los servicios de Google Play"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Servicios de Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Tu dispositivo no es compatible con los servicios de Google Play, de los cuales dependen tus aplicaciones. Para obtener asistencia, ponte en contacto el fabricante."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Parece que la fecha del dispositivo es incorrecta. Compruébala."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Actualizar"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Iniciar sesión"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Iniciar sesión con Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Una aplicación intentó usar versión incorrecta de servicios de Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Una aplicación requiere que se habiliten los servicios de Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Una aplicación requiere que se instalen los servicios de Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Una aplicación requiere que se actualicen los servicios de Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Error de los servicios de Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Solicitada por <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-et-rEE/strings.xml b/platform/android/libs/google_play_services/res/values-et-rEE/strings.xml
deleted file mode 100644
index 281caff497..0000000000
--- a/platform/android/libs/google_play_services/res/values-et-rEE/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Hankige Google Play teenused"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Selle rakenduse käitamiseks on vaja Google Play teenuseid, mida teie telefonis pole."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Selle rakenduse käitamiseks on vaja Google Play teenuseid, mida teie tahvelarvutis pole."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Hankige Google Play teenused"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Lubage Google Play teenused"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"See rakendus ei tööta, kui te ei luba Google Play teenuseid."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Lubage Google Play teenused"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Värskendage Google Play teenuseid"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Seda rakendust ei saa käitada, kui te ei värskenda Google Play teenuseid."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Võrgu viga"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play teenustega ühenduse loomiseks on vajalik andmesideühendus."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Vale konto"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Määratud kontot pole selles seadmes olemas. Valige muu konto."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play teenuste tundmatu probleem."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play teenused"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Teie seade ei toeta Google Play teenuseid, millele mõni teie rakendustest toetub. Abi saamiseks võtke ühendust tootjaga."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Seadme kuupäev paistab olevat vale. Kontrollige seadme kuupäeva."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Värskenda"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Logi sisse"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Logi sisse Google\'iga"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Rakendus püüdis kasutada Google Play teenuste sobimatut versiooni."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Rakenduse kasutamiseks peavad olema lubatud Google Play teenused."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Rakenduse kasutamiseks peavad olema installitud Google Play teenused."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Rakenduse kasutamiseks tuleb värskendada Google Play teenuseid."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Viga Google Play teenustes"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Päringu esitas: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-fa/strings.xml b/platform/android/libs/google_play_services/res/values-fa/strings.xml
deleted file mode 100644
index 87e10d189c..0000000000
--- a/platform/android/libs/google_play_services/res/values-fa/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"‏دریافت خدمات Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"‏این برنامه بدون خدمات Google Play اجرا نمی‌شود، این خدمات در تلفن شما وجود ندارد."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"‏این برنامه بدون خدمات Google Play اجرا نمی‌شود، این خدمات در رایانهٔ لوحی شما وجود ندارد."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"‏دریافت خدمات Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"‏فعال کردن خدمات Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"‏تا زمانی‌که خدمات Google Play را فعال نکنید این برنامه کار نمی‌کند."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"‏فعال کردن خدمات Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"‏به‌روزرسانی خدمات Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"‏تا زمانی‌که خدمات Google Play را به‌روز نکنید این برنامه کار نمی‌کند."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"خطای شبکه"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"‏برای اتصال به خدمات Google Play اتصال داده لازم است."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"حساب نامعتبر"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"حسابی که تعیین کردید در این دستگاه وجود ندارد. لطفاً حساب دیگری را انتخاب کنید."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"‏مشکل نامشخص در خدمات Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"‏خدمات Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"‏خدمات Google Play، که برخی از برنامه‌های شما به آن وابسته است، توسط دستگاه شما پشتیبانی نمی‌شود. لطفاً برای دریافت کمک با سازنده تماس بگیرید."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"تاریخ روی دستگاه ظاهراً اشتباه است. لطفاً تاریخ روی دستگاه را بررسی کنید."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"به‌روزرسانی"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"ورود به سیستم"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"‏ورود به سیستم با Google‎"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"‏برنامه‌ای تلاش کرد از نسخه نادرستی از خدمات Google Play استفاده کند."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"‏برنامه‌ای به فعال کردن خدمات Google Play نیاز دارد."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"‏برنامه‌ای به نصب خدمات Google Play نیاز دارد."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"‏برنامه‌ای به به‌روزرسانی خدمات Google Play نیاز دارد."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"‏خطا در خدمات Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"درخواست توسط <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-fi/strings.xml b/platform/android/libs/google_play_services/res/values-fi/strings.xml
deleted file mode 100644
index 00d3ceb215..0000000000
--- a/platform/android/libs/google_play_services/res/values-fi/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Asenna Google Play -palvelut"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Tämä sovellus ei toimi ilman Google Play -palveluita, jotka puuttuvat puhelimesta."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Tämä sovellus ei toimi ilman Google Play -palveluita, jotka puuttuvat tablet-laitteesta."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Asenna Google Play -palvelut"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Ota Google Play -palvelut käyttöön"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Tämä sovellus ei toimi, ellet ota Google Play -palveluita käyttöön."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Ota Google Play -palv. käyttöön"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Päivitä Google Play -palvelut"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Tämä sovellus ei toimi, ellet päivitä Google Play -palveluita."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Verkkovirhe"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play -palveluiden käyttöön tarvitaan tietoliikenneyhteys."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Tili ei kelpaa"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Kyseistä tiliä ei ole tällä laitteella. Valitse toinen tili."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Tuntematon ongelma käytettäessä Google Play -palveluita."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play -palvelut"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play -palveluita, joita osa sovelluksistasi käyttää, ei tueta laitteellasi. Pyydä ohjeita laitteen valmistajalta."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Laitteen päivämäärä vaikuttaa virheelliseltä. Tarkista laitteen päivämäärä."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Päivitä"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Kirjaudu"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Kirjaudu Google-tiliin"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Sovellus yritti käyttää virheellistä Google Play -palveluiden versiota"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Ota käyttöön Google Play -palvelut, jotta sovellus toimii."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Asenna Google Play -palvelut, jotta sovellus toimii."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Päivitä Google Play -palvelut, jotta sovellus toimii."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Virhe Google Play -palveluissa"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Pyynnön teki <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-fr-rCA/strings.xml b/platform/android/libs/google_play_services/res/values-fr-rCA/strings.xml
deleted file mode 100644
index e915fe4067..0000000000
--- a/platform/android/libs/google_play_services/res/values-fr-rCA/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Installer les services Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre téléphone."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre tablette."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Installer les services Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Activer les services Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Cette application ne fonctionnera pas tant que vous n\'aurez pas activé les services Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Activer les services Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Mettre à jour les services Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Cette application ne fonctionnera pas tant que vous n\'aurez pas mis à jour les services Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Erreur réseau"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Vous devez disposer d\'une connexion de données pour utiliser les services Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Compte erroné"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Le compte indiqué n\'existe pas sur cet appareil. Veuillez sélectionner un autre compte."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problème inconnu avec les services Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Services Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Les services Google Play, dont dépendent certaines de vos applications, ne sont pas compatibles avec votre appareil. Veuillez contacter le fabricant pour obtenir de l\'aide."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"La date sur l\'appareil semble incorrecte. Veuillez la vérifier."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Mettre à jour"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Connexion"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Se connecter via Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Une application requiert une version valide des services Google Play"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Une application requiert l\'activation des services Google Play"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Une application requiert l\'installation des services Google Play"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Une application requiert la mise à jour des services Google Play"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Erreur liée aux services Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Demandée par <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-fr/strings.xml b/platform/android/libs/google_play_services/res/values-fr/strings.xml
deleted file mode 100644
index 321b28370b..0000000000
--- a/platform/android/libs/google_play_services/res/values-fr/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Installer les services Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre téléphone."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre tablette."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Installer services Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Activer les services Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Cette application ne fonctionnera pas tant que vous n\'aurez pas activé les services Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Activer services Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Mettre à jour les services Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Cette application ne fonctionnera pas tant que vous n\'aurez pas mis à jour les services Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Erreur réseau"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Vous devez disposer d\'une connexion de données pour utiliser les services Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Compte erroné"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Le compte indiqué n\'existe pas sur cet appareil. Veuillez sélectionner un autre compte."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problème inconnu avec les services Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Services Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Les services Google Play, dont dépendent certaines de vos applications, ne sont pas compatibles avec votre appareil. Veuillez contacter le fabricant pour obtenir de l\'aide."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"La date sur l\'appareil semble incorrecte. Veuillez la vérifier."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Mettre à jour"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Connexion"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Se connecter avec Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Une application requiert une version valide des services Google Play"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Une application requiert l\'activation des services Google Play"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Une application requiert l\'installation des services Google Play"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Une application requiert la mise à jour des services Google Play"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Erreur liée aux services Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Demandée par <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-hi/strings.xml b/platform/android/libs/google_play_services/res/values-hi/strings.xml
deleted file mode 100644
index b36feb00a7..0000000000
--- a/platform/android/libs/google_play_services/res/values-hi/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play सेवाएं पाएं"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"यह ऐप्स Google Play सेवाओं के बिना नहीं चलेगा, जो आपके फ़ोन में नहीं हैं."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"यह ऐप्स Google Play सेवाओं के बिना नहीं चलेगा, जो आपके टेबलेट में नहीं हैं."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play सेवाएं पाएं"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play सेवाएं सक्षम करें"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"जब तक आप Google Play सेवाएं सक्षम नहीं करते, तब तक यह ऐप्स कार्य नहीं करेगा."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play सेवाएं सक्षम करें"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play सेवाएं से नई जानकारी"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"जब तक आप Google Play सेवाओं से नई जानकारी नहीं लेते हैं, तब तक यह ऐप्स नहीं चलेगा."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"नेटवर्क त्रुटि"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play सेवाओं से कनेक्ट करने के लिए डेटा कनेक्शन की आवश्यकता है."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"अमान्य खाता"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"निर्दिष्ट खाता इस उपकरण पर मौजूद नहीं है. कृपया कोई भिन्न खाता चुनें."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play सेवाओं के साथ अज्ञात समस्या."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play सेवाएं"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play सेवाएं, जिन पर आपके कुछ ऐप्स निर्भर करते हैं, आपके उपकरण द्वारा समर्थित नहीं हैं. कृपया सहायता के लिए निर्माता से संपर्क करें."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"उपकरण का दिनांक गलत प्रतीत हो रहा है. कृपया उपकरण का दिनांक जांचें."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"नई जानकारी पाएं"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"प्रवेश करें"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google से प्रवेश करें"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"ऐप्स ने Google Play सेवाओं के खराब संस्करण के उपयोग का प्रयास किया."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"ऐप्स के लिए Google Play सेवाओं को सक्षम किए जाने की आवश्यकता है."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"ऐप्स के लिए Google Play सेवाओं के इंस्टॉलेशन की आवश्यकता है."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"ऐप्स के लिए Google Play सेवाओं में Google Play से नई जानकारी की आवश्यकता है."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play सेवाएं त्रुटि"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"<xliff:g id="APP_NAME">%1$s</xliff:g> द्वारा अनुरोधित"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-hr/strings.xml b/platform/android/libs/google_play_services/res/values-hr/strings.xml
deleted file mode 100644
index b7d462d882..0000000000
--- a/platform/android/libs/google_play_services/res/values-hr/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Preuzmi usluge za Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ova aplikacija neće funkcionirati bez usluga za Google Play, koje nisu instalirane na vašem telefonu."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ova aplikacija neće funkcionirati bez usluga za Google Play, koje nisu instalirane na vašem tabletnom računalu."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Preuzmi usluge za Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Omogući usluge za Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ova aplikacija neće raditi ako ne omogućite usluge za Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Omogući usluge za Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Ažuriraj usluge za Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ova se aplikacija neće pokrenuti ako ne ažurirate usluge za Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Mrežna pogreška"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Potrebna je podatkovna veza za povezivanje s uslugama Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Nevažeći račun"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Navedeni račun ne postoji na ovom uređaju. Odaberite neki drugi račun."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Nepoznata poteškoća s uslugama za Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Usluge za Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Usluge za Google Play, koje su potrebne za funkcioniranje nekih vaših aplikacija, nisu podržane na vašem uređaju. Pomoć potražite od proizvođača."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Čini se da datum na uređaju nije točan. Provjerite datum na uređaju."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Ažuriranje"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Prijava"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Prijava uslugom Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikacija je pokušala upotrijebiti lošu verziju Usluga za Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Aplikacija zahtijeva omogućavanje Usluga za Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Aplikacija zahtijeva instaliranje Usluga za Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Aplikacija zahtijeva ažuriranje Usluga za Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Pogreška usluga za Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Zahtijeva aplikacija <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-hu/strings.xml b/platform/android/libs/google_play_services/res/values-hu/strings.xml
deleted file mode 100644
index cd15ad328f..0000000000
--- a/platform/android/libs/google_play_services/res/values-hu/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Play Szolgáltatások telepítése"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Az alkalmazás működéséhez a Google Play Szolgáltatások szükségesek, ezek nincsenek telepítve a telefonon."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Az alkalmazás működéséhez a Google Play Szolgáltatások szükségesek, ezek nincsenek telepítve a táblagépen."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Play Szolgáltatások telepítése"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play Szolgáltatások aktiválása"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Az alkalmazás csak akkor fog működni, ha engedélyezi a Google Play Szolgáltatásokat."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Play Szolgáltatások aktiválása"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Play Szolgáltatások frissítése"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Az alkalmazás csak akkor fog működni, ha frissíti a Google Play Szolgáltatásokat."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Hálózati hiba"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"A Google Play Szolgáltatásokhoz történő kapcsolódáshoz adatkapcsolat szükséges."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Érvénytelen fiók"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"A megadott fiók nem létezik ezen az eszközön. Kérjük, válasszon másik fiókot."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Ismeretlen hiba a Google Play Szolgáltatásokban."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play Szolgáltatások"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"A Google Play Szolgáltatásokat, amelyre egyes alkalmazások támaszkodnak, nem támogatja az eszköz. Segítségért forduljon az eszköz gyártójához."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Az eszközön beállított dátum helytelen. Kérjük, ellenőrizze azt."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Frissítés"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Belépés"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google-bejelentkezés"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Egy alkalmazás a Play Szolgáltatások rossz verzióját akarta használni."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Egy alkalmazás kéri a Google Play Szolgáltatások engedélyezését."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Egy alkalmazás kéri a Google Play Szolgáltatások telepítését."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Egy alkalmazás kéri a Google Play Szolgáltatások frissítését."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play szolgáltatási hiba"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Igénylő: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-hy-rAM/strings.xml b/platform/android/libs/google_play_services/res/values-hy-rAM/strings.xml
deleted file mode 100644
index d89be9bf64..0000000000
--- a/platform/android/libs/google_play_services/res/values-hy-rAM/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Տեղադրեք Google Play ծառայությունները"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Այս հավելվածը չի գործարկվի առանց Google Play ծառայությունների, որոնք բացակայում են ձեր հեռախոսում:"</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Այս հավելվածը չի գործարկվի առանց Google Play ծառայությունների, որոնք բացակայում են ձեր գրասալիկում:"</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Տեղադրել Google Play ծառայությունները"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Միացնել Google Play ծառայությունները"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Այս ծրագիրը չի աշխատի, եթե դուք չմիացնեք Google Play ծառայությունները:"</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Միացնել Google Play ծառայությունները"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Նորացրեք Google Play ծառայությունները"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Այս ծրագիրը չի գործարկվի, եթե դուք չնորացնեք Google Play ծառայությունները:"</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Ցանցի սխալ կա"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Պահանջվում է տվյալների կապ` Google Play ծառայություններին միանալու համար:"</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Հաշիվն անվավեր է"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Նշված հաշիվը գոյություն չունի այս սարքում: Ընտրեք այլ հաշիվ:"</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Անհայտ խնդիր՝ Google Play ծառայություններում:"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play ծառայություններ"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play ծառայությունները, որոնց ապավինում են ձեր ծրագրերից որոշները, չեն աջակցվում ձեր սարքի կողմից: Խնդրում ենք կապվել արտադրողի հետ օգնության համար:"</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Սարքի ամսաթիվը կարծես սխալ է: Ստուգեք սարքի ամսաթիվը:"</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Նորացնել"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Մուտք գործել"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Մուտք գործեք Google-ով"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Հավելվածը փորձել է կիրառել Google Play ծառայությունների վատ տարբերակը:"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Հավելվածը պահանջում է միացնել Google Play ծառայությունները:"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Հավելվածը պահանջում է տեղադրել Google Play ծառայությունները:"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Հավելվածը պահանջում է թարմացնել Google Play ծառայությունները:"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play ծառայությունների սխալ"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"<xliff:g id="APP_NAME">%1$s</xliff:g>-ի հարցմամբ"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-in/strings.xml b/platform/android/libs/google_play_services/res/values-in/strings.xml
deleted file mode 100644
index 526b84a816..0000000000
--- a/platform/android/libs/google_play_services/res/values-in/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Dapatkan layanan Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Aplikasi ini tidak akan berjalan tanpa layanan Google Play, yang tidak ada di ponsel Anda."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Aplikasi ini tidak akan berjalan tanpa layanan Google Play, yang tidak ada di tablet Anda."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Dapatkan layanan Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Aktifkan layanan Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Aplikasi ini tidak akan bekerja sampai Anda mengaktifkan layanan Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Aktifkan layanan Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Perbarui layanan Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Aplikasi ini tidak akan berjalan sampai Anda memperbarui layanan Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Kesalahan Jaringan"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Sambungan data diperlukan untuk tersambung ke layanan Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Akun Tidak Valid"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Akun yang ditentukan tidak ada di perangkat ini. Pilih akun lain."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Masalah tidak diketahui pada layanan Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Layanan Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Layanan Google Play, yang diandalkan oleh beberapa aplikasi Anda, tidak didukung oleh perangkat Anda. Hubungi pabrikan untuk mendapatkan bantuan."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Tampaknya tanggal di perangkat salah. Periksa tanggal di perangkat."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Perbarui"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Masuk"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Masuk dengan Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikasi mencoba menggunakan versi Layanan Google Play yang rusak."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Aplikasi membutuhkan Layanan Google Play untuk dapat diaktifkan."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Aplikasi membutuhkan pemasangan Layanan Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Aplikasi membutuhkan pembaruan untuk Layanan Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Kesalahan layanan Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Diminta oleh <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-it/strings.xml b/platform/android/libs/google_play_services/res/values-it/strings.xml
deleted file mode 100644
index f3c9f1fa5c..0000000000
--- a/platform/android/libs/google_play_services/res/values-it/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Installa Google Play Services"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"L\'app non funzionerà senza Google Play Services, non presente sul tuo telefono."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"L\'app non funzionerà senza Google Play Services, non presente sul tuo tablet."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Installa Google Play Services"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Attiva Google Play Services"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"L\'app non funzionerà se non attivi Google Play Services."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Attiva Google Play Services"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Aggiorna Google Play Services"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"L\'app non funzionerà se non aggiorni Google Play Services."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Errore di rete"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"È necessaria una connessione dati per connettersi a Google Play Services."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Account non valido"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"L\'account specificato non esiste su questo dispositivo. Scegli un altro account."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problema sconosciuto con Google Play Services."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play Services"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"La piattaforma Google Play Services, su cui sono basate alcune delle tue applicazioni, non è supportata dal dispositivo in uso. Per assistenza, contatta il produttore."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"La data sul dispositivo sembra sbagliata. Controllala."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Aggiorna"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Accedi"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Accedi con Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Un\'app ha tentato di usare una versione non valida di Play Services."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Un\'applicazione richiede l\'attivazione di Google Play Services."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Un\'applicazione richiede l\'installazione di Google Play Services."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Un\'applicazione richiede un aggiornamento di Google Play Services."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Errore Google Play Services"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Richiesta da <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-iw/strings.xml b/platform/android/libs/google_play_services/res/values-iw/strings.xml
deleted file mode 100644
index 7474e53506..0000000000
--- a/platform/android/libs/google_play_services/res/values-iw/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"‏קבל את שירותי Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"‏אפליקציה זו לא תפעל ללא שירותי Google Play, החסרים בטלפון שלך."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"‏אפליקציה זו לא תפעל ללא שירותי Google Play, החסרים בטאבלט שלך."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"‏קבל את שירותי Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"‏הפעלת שירותי Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"‏אפליקציה זו לא תעבוד אם לא תפעיל את שירותי Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"‏הפעל את שירותי Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"‏עדכון שירותי Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"‏אפליקציה זו לא תפעל אם לא תעדכן את שירותי Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"שגיאת רשת."</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"‏דרוש חיבור נתונים כדי להתחבר לשירותי Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"חשבון לא חוקי"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"החשבון שצוין לא קיים במכשיר זה. בחר חשבון אחר."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"‏בעיה לא ידועה בשירותי Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"‏שירותי Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"‏שירותי Google Play, שחלק מהאפליקציות שלך מתבססות עליהם, אינם נתמכים על ידי המכשיר שברשותך. צור קשר עם היצרן לקבלת סיוע."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"נראה שהתאריך במכשיר שגוי. בדוק את התאריך במכשיר."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"עדכן"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"היכנס"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"‏היכנס באמצעות Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"‏יש אפליקציה שניסתה להשתמש בגרסה שגויה של שירותי Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"‏יש אפליקציה המחייבת הפעלה של שירותי Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"‏יש אפליקציה המחייבת התקנה של שירותי Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"‏יש אפליקציה המחייבת עדכון של שירותי Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"‏שגיאה בשירותי Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"התבקשה על ידי <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-ja/strings.xml b/platform/android/libs/google_play_services/res/values-ja/strings.xml
deleted file mode 100644
index 0d8b606230..0000000000
--- a/platform/android/libs/google_play_services/res/values-ja/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Play開発者サービスの入手"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"このアプリの実行にはGoogle Play開発者サービスが必要ですが、お使いの携帯端末にはインストールされていません。"</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"このアプリの実行にはGoogle Play開発者サービスが必要ですが、お使いのタブレットにはインストールされていません。"</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Play開発者サービスの入手"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Play開発者サービスの有効化"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"このアプリの実行には、Google Play開発者サービスの有効化が必要です。"</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Play開発者サービスの有効化"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Play開発者サービスの更新"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"このアプリの実行には、Google Play開発者サービスの更新が必要です。"</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"ネットワークエラー"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play開発者サービスに接続するには、データ接続が必要です。"</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"無効なアカウント"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"指定したアカウントはこの端末上に存在しません。別のアカウントを選択してください。"</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play開発者サービスで原因不明の問題が発生しました。"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play開発者サービス"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"一部のアプリが使用しているGoogle Play開発者サービスは、お使いの端末ではサポートされていません。詳しくは、端末メーカーまでお問い合わせください。"</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"端末上の日付が正しくないようです。端末上の日付をご確認ください。"</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"更新"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"ログイン"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Googleでログイン"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"アプリはGoogle Play開発者サービスの不適切なバージョンを使用しようとしました。"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"アプリではGoogle Play開発者サービスを有効にする必要があります。"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"アプリではGoogle Play開発者サービスをインストールする必要があります。"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"アプリではGoogle Play開発者サービスをアップデートする必要があります。"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play開発者サービスのエラー"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"<xliff:g id="APP_NAME">%1$s</xliff:g>によるリクエスト"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-ka-rGE/strings.xml b/platform/android/libs/google_play_services/res/values-ka-rGE/strings.xml
deleted file mode 100644
index 8a2c74aa98..0000000000
--- a/platform/android/libs/google_play_services/res/values-ka-rGE/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play სერვისების მიღება"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"ეს აპი ვერ გაეშვება Google Play სერვისების გარეშე, რაც თქვენს ტელეფონზე ვერ იძებნება."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"ეს აპი ვერ გაეშვება Google Play სერვისების გარეშე, რაც თქვენს ტელეფონზე ვერ იძებნება."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play სერვისების მიღება"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play სერვისების გააქტიურება"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"ეს აპი არ იმუშავებს, თუ არ გაააქტიურებთ Google Play სერვისებს."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play სერვისების გააქტიურება"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play სერვისების განახლება"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"ეს აპი ვერ გაეშვება, თუ Google Play სერვისებს არ განაახლებთ."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"ქსელის შეცდომა"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play Services-თან დასაკავშირებლად მონაცემთა გადაცემა აუცილებელია."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"ანგარიში არასწორია"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"მითითებული ანგარიში ამ მოწყობილობაზე არ არსებობს. გთხოვთ, აირჩიოთ სხვა ანგარიში."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play სერვისებთან დაკავშირებით უცნობი შეფერხება წარმოიშვა."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play სერვისები"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play სერვისები, რაც თქვენს ზოგიერთ აპს ჭირდება, თქვენს მოწყობილობაზე მხარდაჭერილი არ არის. გთხოვთ, დაუკავშირდეთ მწარმოებელს დახმარებისათვის."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"როგორც ჩანს, მოწყობილობის თარიღი არასწორია. გთხოვთ, შეამოწმოთ მოწყობილობის თარიღი."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"განახლება"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"შესვლა"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google-ით შესვლა"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"აპლიკაცია შეეცადა გამოეყენებინა Google Play სერვისების არასწორი ვერსია."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"აპლიკაცია საჭიროებს გააქტიურებულ Google Play Services."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"აპლიკაცია საჭიროებს Google Play Services-ის ინსტალაციას."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"აპლიკაცია საჭიროებს Google Play Services-ის განახლებას."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play სერვისების შეცდომა"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"მომთხოვნი: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-km-rKH/strings.xml b/platform/android/libs/google_play_services/res/values-km-rKH/strings.xml
deleted file mode 100644
index afebf30875..0000000000
--- a/platform/android/libs/google_play_services/res/values-km-rKH/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"ទទួល​សេវាកម្ម​កម្សាន្ត Google"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"កម្មវិធី​នេះ​នឹង​មិន​ដំណើរការ​​ទេ​បើ​គ្មាន​​សេវាកម្ម​កម្សាន្ត​ Google ដែល​ទូរស័ព្ទ​របស់​​អ្នក​មិន​មាន។"</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"​​កម្មវិធី​នេះ​នឹង​មិន​ដំណើរការ​​ទេ​បើ​គ្មាន​​សេវាកម្ម​កម្សាន្ត​ Google ដែល​​កុំព្យូទ័រ​បន្ទះ​របស់​អ្នក​មិន​មាន។"</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"ទទួល​សេវាកម្ម​កម្សាន្ត Google"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"បើក​សេវាកម្ម​កម្សាន្ត Google"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"កម្ម​វិធី​នេះ​នឹង​មិន​ដំណើរការ​ទេ​ លុះត្រាតែ​អ្នក​បើក​សេវាកម្ម​​កម្សាន្ត​ Google ។"</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"បើក​សេវាកម្ម​កម្សាន្ត Google"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"ធ្វើ​បច្ចុប្បន្នភាព​សេវាកម្ម​កម្សាន្ត Google"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"កម្មវិធី​នេះ​នឹង​មិន​ដំណើរការ​ទេ​ លុះត្រាតែ​អ្នក​ធ្វើ​បច្ចុប្បន្នភាព​សេវាកម្ម​កម្សាន្ត Google ។"</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"កំហុស​​បណ្ដាញ"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"បាន​ទាមទារ​ការ​តភ្ជាប់​ទិន្នន័យ ដើម្បី​ភ្ជាប់​សេវាកម្ម​ឃ្លាំង​កម្មវិធី។"</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"គណនី​មិន​ត្រឹមត្រូវ"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"គណនី​ដែល​បាន​បញ្ជាក់​មិន​មាន​នៅ​លើ​ឧបករណ៍​នេះ​ទេ។ សូម​ជ្រើស​គណនី​ផ្សេង​។"</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"មិន​ស្គាល់​បញ្ហា​ជាមួយ​សេវាកម្ម​កម្សាន្ត Google ។"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"សេវាកម្ម​កម្សាន្ត​ Google"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"សេវាកម្ម​កម្សាន្ត Google អាស្រ័យ​លើ​កម្មវិធី​របស់​អ្នក មិន​ត្រូវ​បាន​គាំទ្រ​ដោយ​ឧបករណ៍​របស់​អ្នក។ សូម​ទាក់ទង​ក្រុមហ៊ុន​ផលិត​សម្រាប់​ជំនួយ។"</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"កាលបរិច្ឆេទ​លើ​ឧបករណ៍​បង្ហាញ​ថា​មិន​ត្រឹមត្រូវ។ សូម​ពិនិត្យ​កាលបរិច្ឆេទ​លើ​ឧបករណ៍។"</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"ធ្វើ​បច្ចុប្បន្នភាព"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"ចូល"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"ចូល​ដោយ​ប្រើ​ Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"កម្មវិធី​​​ព្យាយាម​ប្រើ​កំណែ​មិនល្អ​របស់​សេវា​កម្ម​ឃ្លាំ​កម្មវិធី។"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"កម្មវិធី​ទាមទារ​​បើក​សេវាកម្ម​ឃ្លាំង​កម្មវិធី។"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"កម្មវិធី​ទាមទារ​ការ​ដំឡើង​សេវាកម្ម​ឃ្លាំង​កម្មវិធី។"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"កម្មវិធី​ទាមទារ​​ធ្វើ​បច្ចុប្បន្នភាព​សេវាកម្ម​ឃ្លាំង​កម្មវិធី។"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"កំហុស​សេវា​កម្ម​កម្សាន្ត Google"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"បាន​ស្នើ​ដោយ <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-ko/strings.xml b/platform/android/libs/google_play_services/res/values-ko/strings.xml
deleted file mode 100644
index e37f1fd02a..0000000000
--- a/platform/android/libs/google_play_services/res/values-ko/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play 서비스 설치"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"휴대전화에 Google Play 서비스가 설치되어 있어야 이 앱이 실행됩니다."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"태블릿에 Google Play 서비스가 설치되어 있어야 이 앱이 실행됩니다."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play 서비스 설치"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play 서비스 사용"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Google Play 서비스를 사용하도록 설정해야 이 앱이 작동합니다."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play 서비스 사용"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play 서비스 업데이트"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Google Play 서비스를 업데이트해야만 이 앱이 실행됩니다."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"네트워크 오류"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play 서비스에 연결하려면 데이터 연결이 필요합니다."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"올바르지 않은 계정"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"지정한 계정이 이 기기에 존재하지 않습니다. 다른 계정을 선택하세요."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play 서비스에 알 수 없는 문제가 발생했습니다."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play 서비스"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"일부 사용자 애플리케이션에 필요한 Google Play 서비스가 사용자 기기에서 지원되지 않습니다. 기기 제조업체에 문의하시기 바랍니다."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"기기의 날짜가 잘못된 것 같습니다. 기기의 날짜를 확인해 주세요."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"업데이트"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"로그인"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google 계정으로 로그인"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"애플리케이션에서 잘못된 버전의 Google Play 서비스를 사용하려고 했습니다."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Google Play 서비스를 사용하도록 설정해야 하는 애플리케이션입니다."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Google Play 서비스를 설치해야 하는 애플리케이션입니다."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Google Play 서비스를 업데이트해야 하는 애플리케이션입니다."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play 서비스 오류"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"<xliff:g id="APP_NAME">%1$s</xliff:g>에서 요청"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-lo-rLA/strings.xml b/platform/android/libs/google_play_services/res/values-lo-rLA/strings.xml
deleted file mode 100644
index 32bcb0b92b..0000000000
--- a/platform/android/libs/google_play_services/res/values-lo-rLA/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"ຕິດຕັ້ງບໍລິການ Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"ແອັບຯນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້ໂດຍທີ່ບໍ່ມີບໍລິການ Google Play ເຊິ່ງຂາດຫາຍໄປໃນໂທລະສັບຂອງທ່ານ."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"ແອັບຯນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້ໂດຍທີ່ບໍ່ມີບໍລິການ Google Play ເຊິ່ງຂາດຫາຍໄປໃນແທັບເລັດຂອງທ່ານ."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"ຕິດຕັ້ງບໍລິການ Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"ເປີດໃຊ້ບໍລິການ Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"ແອັບຯນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້ຈົນກວ່າທ່ານຈະເປີດໃຊ້ບໍລິການ Google Play"</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"ເປີດໃຊ້ບໍລິການ Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"ອັບເດດບໍລິການ Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"ແອັບຯນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້ຈົນກວ່າທ່ານຈະອັບເດດບໍລິການ Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"ເຄືອຂ່າຍຜິດພາດ"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"ຕ້ອງໃຊ້ການເຊື່ອມຕໍ່ອິນເຕີເນັດເພື່ອໃຊ້ Google Play Services."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"ບັນຊີບໍ່ຖືກຕ້ອງ"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"ບັນຊີທີ່ເລືອກບໍ່ມີໃນອຸປະກອນນີ້. ກະລຸນາເລືອກບັນຊີອື່ນ."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"ມີປັນຫາທີ່ບໍ່ຄາດຄິດໃນບໍລິການ Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"ບໍລິການ Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"ບໍລິການ Google Play ທີ່ບາງແອັບພລິເຄຊັນຂອງທ່ານຕ້ອງອາໄສນັ້ນ ບໍ່ຖືກຮອງຮັບໃນອຸປະກອນຂອງທ່ານ. ກະລຸນາຕິດຕໍ່ຜູ້ຜະລິດສຳລັບການແນະນຳ."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"ວັນທີຂອງອຸປະກອນບໍ່ຖືກຕ້ອງ. ກະລຸນາກວດສອບວັນທີຂອງອຸປະກອນຂອງທ່ານ."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"ອັບເດດ"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"ເຂົ້າສູ່ລະບົບ"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"ເຂົ້າສູ່ລະບົບດ້ວຍ Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"ແອັບພລິເຄຊັນໄດ້ພະຍາຍາມໃຊ້ Google Play Services ເວີຊັນທີ່ບໍ່ສາມາດໃຊ້ໄດ້."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"ແອັບພລິເຄຊັນຕ້ອງການເປີດນຳໃຊ້ Google Play Services."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"ແອັບພລິເຄຊັນຕ້ອງການໃຫ້ຕິດຕັ້ງ Google Play Services."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"ແອັບພລິເຄຊັນຕ້ອງການອັບເດດ Google Play Services."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"ບໍລິການ Google Play ຜິດພາດ"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"ຮ້ອງຂໍໂດຍ <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-lt/strings.xml b/platform/android/libs/google_play_services/res/values-lt/strings.xml
deleted file mode 100644
index 73de5fa9aa..0000000000
--- a/platform/android/libs/google_play_services/res/values-lt/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Gauti „Google Play“ paslaugų"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ši programa neveiks be „Google Play“ paslaugų, kurios neįdiegtos telefone."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ši programa neveiks be „Google Play“ paslaugų, kurios neįdiegtos planšetiniame kompiuteryje."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Gauti „Google Play“ paslaugų"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Įgalinti „Google Play“ paslaugas"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ši programa neveiks, jei neįgalinsite „Google Play“ paslaugų."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Įgal. „Google Play“ paslaugas"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Atnaujinti „Google Play“ paslaugas"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ši programa neveiks, jei neatnaujinsite „Google Play“ paslaugų."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Tinklo klaida"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Norint prisijungti prie „Google Play“ paslaugų reikia duomenų ryšio."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Netinkama paskyra"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Nurodytos paskyros šiame įrenginyje nėra. Pasirinkite kitą paskyrą."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Nežinoma „Google Play“ paslaugų problema."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"„Google Play“ paslaugos"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Jūsų įrenginys nepalaiko „Google Play“ paslaugų, kuriomis remiasi kai kurios programos. Jei reikia pagalbos, susisiekite su gamintoju."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Įrenginyje nurodyta data neteisinga. Patikrinkite įrenginyje nurodytą datą."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Atnaujinti"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Prisij."</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Prisij. naud. „Google“"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Programa bandė naudotis netinkama „Google Play“ paslaugų versija."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Norint naudoti programą būtina įgalinti „Google Play“ paslaugas."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Norint naudoti programą būtina įdiegti „Google Play“ paslaugas."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Norint naudoti programą būtina atnaujinti „Google Play“ paslaugas."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"„Google Play“ paslaugų klaida"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Užklausą pateikė „<xliff:g id="APP_NAME">%1$s</xliff:g>“"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-lv/strings.xml b/platform/android/libs/google_play_services/res/values-lv/strings.xml
deleted file mode 100644
index 9e4b6ee6bd..0000000000
--- a/platform/android/libs/google_play_services/res/values-lv/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play pakalpojumu iegūšana"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Lai šī lietotne darbotos, tālrunī ir jāinstalē Google Play pakalpojumi."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Lai šī lietotne darbotos, planšetdatorā ir jāinstalē Google Play pakalpojumi."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Iegūt Google Play pakalpojumus"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play pakalpojumu iespējošana"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Lai šī lietotne darbotos, iespējojiet Google Play pakalpojumus."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Iespējot Google Play pakalpojumus"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play pakalpojumu atjaunināšana"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Lai šī lietotne darbotos, atjauniniet Google Play pakalpojumus."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Tīkla kļūda"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Lai izveidotu savienojumu ar Google Play pakalpojumiem, ir nepieciešams datu savienojums."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Nederīgs konts"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Norādītais konts šajā ierīcē nepastāv. Lūdzu, izvēlieties citu kontu."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Nezināma problēma ar Google Play pakalpojumiem."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play pakalpojumi"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Jūsu ierīce neatbalsta Google Play pakalpojumus, kuri nepieciešami dažu jūsu lietojumprogrammu darbībai. Lūdzu, sazinieties ar ražotāju, lai saņemtu palīdzību."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Šķiet, ka ierīcē ir iestatīts nepareizs datums. Lūdzu, pārbaudiet ierīces datumu."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Atjaunināt"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Pierakst."</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Pierakstīties Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Lietojumpr. mēģināja izmantot nederīgu Google Play pakalp. versiju."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Lai lietojumprogramma darbotos, ir jāiespējo Google Play pakalpojumi."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Lai lietojumprogramma darbotos, ir jāinstalē Google Play pakalpojumi."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Lai lietojumprogramma darbotos, jāatjaunina Google Play pakalpojumi."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play pakalpojumu kļūda"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Pieprasījums no lietotnes <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-mn-rMN/strings.xml b/platform/android/libs/google_play_services/res/values-mn-rMN/strings.xml
deleted file mode 100644
index 1743256a11..0000000000
--- a/platform/android/libs/google_play_services/res/values-mn-rMN/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play үйлчилгээ авах"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Таны утсанд байхгүй байгаа Google Play үйлчилгээг идэвхжүүлж байж энэ апп-г ажиллуулах боломжтой."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Таны таблетэд байхгүй Google Play үйлчилгээг идэвхжүүлж байж энэ апп-г ажиллуулах боломжтой."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play үйлчилгээ авах"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play үйлчилгээг идэвхжүүлэх"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Та Google Play үйлчилгээг идэвхжүүлж байж энэ апп-г ажиллуулах боломжтой."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play үйлчилгээг идэвхжүүлэх"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play үйлчилгээг шинэчлэх"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Та Google Play үйлчилгээг шинэчлэхгүй бол энэ апп ажиллах боломжгүй."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Сүлжээний алдаа"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play үйлчилгээнд холбогдохын тулд дата холболт шаардлагатай."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Буруу акаунт"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Заасан акаунт энэ төхөөрөмж дээр байхгүй байна. Өөр акаунт сонгоно уу."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play үйлчилгээтэй холбоотой тодорхойгүй алдаа."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play үйлчилгээ"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Таны зарим аппликешнүүдийн хамаардаг Google Play үйлчилгээ таны төхөөрөмжид дэмжигдэхгүй байна. Тусламж авахын тулд үйлдвэрлэгчтэй холбоо барина уу."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Төхөөрөмжийн огноо буруу байгаа бололтой. Төхөөрөмжийн огноог шалгана уу."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Шинэчлэх"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Нэвтрэх"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google-р нэвтрэх:"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Аппликешн Google Play Үйлчилгээний муу хувилбарыг ашиглахыг оролдлоо."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Аппликешн Google Play Үйлчилгээг идэвхжүүлсэн байхыг шаардана."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Аппликешн Google Play Үйлчилгээг суулгахыг шаардана."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Аппликешн Google Play Үйлчилгээг шинэчлэхийг шаардана."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play үйлчилгээний алдаа"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Хүсэлт гаргасан <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-ms-rMY/strings.xml b/platform/android/libs/google_play_services/res/values-ms-rMY/strings.xml
deleted file mode 100644
index 8e8a4b9b8a..0000000000
--- a/platform/android/libs/google_play_services/res/values-ms-rMY/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Dapatkan perkhidmatan Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Apl ini tidak akan berfungsi tanpa perkhidmatan Google Play dan apl ini tiada pada telefon anda."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Apl ini tidak akan berfungsi tanpa perkhidmatan Google Play dan apl ini tiada pada tablet anda."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Dapatkan perkhidmatan Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Dayakan perkhidmatan Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Apl ini tidak akan berfungsi kecuali anda mendayakan perkhidmatan Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Dayakan perkhidmatan Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Kemas kini perkhidmatan Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Apl ini tidak akan berfungsi kecuali anda mengemas kini perkhidmatan Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Ralat Rangkaian"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Sambungan data diperlukan untuk menyambung ke perkhidmatan Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Akaun Tidak Sah"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Akaun yang dinyatakan tidak wujud pada peranti ini. Sila pilih akaun yang lain."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Isu tidak diketahui dengan perkhidmatan Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Perkhidmatan Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Peranti anda tidak menyokong perkhidmatan Google Play, sedangkan sesetengah aplikasi anda memerlukannya. Sila hubungi pengilang untuk bantuan."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Tarikh pada peranti kelihatan tidak betul. Sila semak tarikh pada peranti."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Kemas kini"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Log masuk"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Log masuk dengan Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikasi cuba menggunakan versi Perkhidmatan Google Play yang rosak."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Perkhidmatan Google Play perlu didayakan untuk menggunakan aplikasi."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Perkhidmatan Google Play perlu dipasang untuk mengguankan aplikasi."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Perkhidmatan Google Play perlu dikemas kini untuk menggunakan aplikasi."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Ralat perkhidmatan Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Diminta oleh <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-nb/strings.xml b/platform/android/libs/google_play_services/res/values-nb/strings.xml
deleted file mode 100644
index 1e16bbb6d2..0000000000
--- a/platform/android/libs/google_play_services/res/values-nb/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Installer Google Play Tjenester"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Denne appen kan ikke kjøres uten Google Play Tjenester, som ikke er installert på telefonen din."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Denne appen kan ikke kjøres uten Google Play Tjenester, som ikke er installert på nettbrettet ditt."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Installer Google Play Tjenester"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Aktiver Google Play Tjenester"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Denne appen fungerer ikke med mindre du aktiverer Google Play Tjenester."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Aktiver Google Play Tjenester"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Oppdater Google Play Tjenester"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Denne appen kan ikke kjøres før du oppdaterer Google Play Tjenester."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Nettverksfeil"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Du må ha datatilkobling for å koble deg til Google Play-tjenester."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Ugyldig konto"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Den angitte kontoen finnes ikke på enheten. Velg en annen konto."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Det oppsto et ukjent problem med Google Play Tjenester."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play-tjenester"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play Tjenester, som noen av appene er avhengige av, støttes ikke av enheten. Ta kontakt med produsenten for å få hjelp."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Datoen på enheten ser ut til å være feil. Sjekk datoen på enheten."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Oppdater"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Logg på"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Logg inn med Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"En app prøvde å bruke en skadet versjon av Google Play Tjenester."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"En app krever Google Play Tjenester for å aktiveres."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"En app krever at Google Play Tjenester installeres."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"En app krever at Google Play Tjenester oppdateres."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play Tjenester-feil"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Forespurt av <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-nl/strings.xml b/platform/android/libs/google_play_services/res/values-nl/strings.xml
deleted file mode 100644
index f38db5fcdb..0000000000
--- a/platform/android/libs/google_play_services/res/values-nl/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play-services ophalen"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Deze app kan niet worden uitgevoerd zonder Google Play-services die ontbreken op uw telefoon."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Deze app kan niet worden uitgevoerd zonder Google Play-services die ontbreken op uw tablet."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play-services ophalen"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play-services inschakelen"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Deze app werkt niet, tenzij u Google Play-services inschakelt."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play-services inschak."</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play-services bijwerken"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Deze app kan niet worden uitgevoerd, tenzij u Google Play-services bijwerkt."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Netwerkfout"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Er is een gegevensverbinding nodig om verbinding te kunnen maken met Google Play-services."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Ongeldig account"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Het gespecificeerde account bestaat niet op dit apparaat. Kies een ander account."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Onbekend probleem met Google Play-services."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play-services"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play-services, dat vereist is voor een aantal van uw applicaties, wordt niet ondersteund door uw apparaat. Neem contact op met de fabrikant voor ondersteuning."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"De datum op het apparaat lijkt onjuist. Controleer de datum op het apparaat."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Bijwerken"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Inloggen"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Inloggen met Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Onjuiste versie van Google Play-services wordt gebruikt."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Google Play-services moet zijn ingeschakeld voor een applicatie."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Google Play-services moet zijn geïnstalleerd voor een applicatie."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Google Play-services moet worden geüpdatet voor een applicatie."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Fout met Google Play-services"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Aangevraagd door <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-pl/strings.xml b/platform/android/libs/google_play_services/res/values-pl/strings.xml
deleted file mode 100644
index 5eba15ff3a..0000000000
--- a/platform/android/libs/google_play_services/res/values-pl/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Pobierz Usługi Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ta aplikacja nie będzie działać bez Usług Google Play, których nie masz na telefonie."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ta aplikacja nie będzie działać bez Usług Google Play, których nie masz na tablecie."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Pobierz Usługi Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Włącz Usługi Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ta aplikacja nie będzie działać, jeśli nie włączysz Usług Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Włącz Usługi Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Aktualizuj Usługi Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ta aplikacja nie będzie działać, jeśli nie zaktualizujesz Usług Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Błąd sieci"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Korzystanie z usług Google Play wymaga połączenia z internetem."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Nieprawidłowe konto"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Podanego konta nie ma na tym urządzeniu. Wybierz inne konto."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Nieznany problem z Usługami Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Usługi Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Usługi Google Play, od których zależy działanie niektórych aplikacji, nie są obsługiwane na Twoim urządzeniu. Skontaktuj się z producentem, by uzyskać pomoc."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Data ustawiona na urządzeniu wydaje się nieprawidłowa. Sprawdź datę ustawioną na urządzeniu."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Aktualizuj"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Zaloguj się"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Zaloguj się przez Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikacja próbowała skorzystać z nieprawidłowej wersji Usług Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Aplikacja wymaga włączenia Usług Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Aplikacja wymaga zainstalowania Usług Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Aplikacja wymaga aktualizacji Usług Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Błąd usług Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Żądanie z aplikacji <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-pt-rBR/strings.xml b/platform/android/libs/google_play_services/res/values-pt-rBR/strings.xml
deleted file mode 100644
index 6db462d709..0000000000
--- a/platform/android/libs/google_play_services/res/values-pt-rBR/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Instale o Google Play Services"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu telefone."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu tablet."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Instalar o Google Play Services"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Ative o Google Play Services"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Este aplicativo só funciona com o Google Play Services ativado."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Ativar o Google Play Services"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Atualize o Google Play Services"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Este aplicativo só funciona com uma versão atualizada do Google Play Services."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Erro na rede"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"É necessária uma conexão de dados para conectar ao Google Play Services."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Conta inválida"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"A conta especificada não existe no dispositivo. Escolha outra conta."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problema desconhecido com o Google Play Services."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Play Services"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"O Google Play Services, necessário para alguns dos aplicativos, não é compatível com seu dispositivo. Entre em contato com o fabricante para obter assistência."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"A data no dispositivo parece incorreta. Verifique a data no dispositivo."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Atualizar"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Login"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Fazer login com o Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Um aplicativo tentou usar uma versão errada do Google Play Services."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Um aplicativo requer a ativação do Google Play Services."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Um aplicativo requer a instalação do Google Play Services."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Um aplicativo requer a atualização do Google Play Services."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Ocorreu um erro no Google Play Services"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Solicitado por <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-pt-rPT/strings.xml b/platform/android/libs/google_play_services/res/values-pt-rPT/strings.xml
deleted file mode 100644
index 0ceafcb95f..0000000000
--- a/platform/android/libs/google_play_services/res/values-pt-rPT/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Obter serviços do Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Esta aplicação não será executada sem os serviços do Google Play, que estão em falta no seu telemóvel."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Esta aplicação não será executada sem os serviços do Google Play, que estão em falta no seu tablet."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Obter serviços do Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Ativar serviços do Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Esta aplicação não funcionará enquanto não ativar os serviços do Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Ativar serviços do Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Atualizar serviços do Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Esta aplicação não será executada enquanto não atualizar os serviços do Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Erro de Rede"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"É necessária uma ligação de dados para se ligar aos Serviços do Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Conta Inválida"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"A conta especificada não existe neste dispositivo. Escolha uma conta diferente."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problema desconhecido nos serviços do Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Serviços do Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Os serviços do Google Play, dos quais dependem algumas das suas aplicações, não são suportados pelo seu dispositivo. Contacte o fabricante para obter assistência."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"A data no dispositivo parece estar incorreta. Verifique a data no dispositivo."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Atualizar"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Inic. ses."</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Inic. sessão com o Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplicação tentou utiliz. versão incorreta dos Serviços do Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Uma aplicação necessita da ativação dos Serviços do Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Uma aplicação necessita da instalação dos Serviços do Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Uma aplicação necessita da atualização dos Serviços do Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Erro dos serviços do Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Solicitado por <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-pt/strings.xml b/platform/android/libs/google_play_services/res/values-pt/strings.xml
deleted file mode 100644
index 6db462d709..0000000000
--- a/platform/android/libs/google_play_services/res/values-pt/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Instale o Google Play Services"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu telefone."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu tablet."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Instalar o Google Play Services"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Ative o Google Play Services"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Este aplicativo só funciona com o Google Play Services ativado."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Ativar o Google Play Services"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Atualize o Google Play Services"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Este aplicativo só funciona com uma versão atualizada do Google Play Services."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Erro na rede"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"É necessária uma conexão de dados para conectar ao Google Play Services."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Conta inválida"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"A conta especificada não existe no dispositivo. Escolha outra conta."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problema desconhecido com o Google Play Services."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Play Services"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"O Google Play Services, necessário para alguns dos aplicativos, não é compatível com seu dispositivo. Entre em contato com o fabricante para obter assistência."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"A data no dispositivo parece incorreta. Verifique a data no dispositivo."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Atualizar"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Login"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Fazer login com o Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Um aplicativo tentou usar uma versão errada do Google Play Services."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Um aplicativo requer a ativação do Google Play Services."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Um aplicativo requer a instalação do Google Play Services."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Um aplicativo requer a atualização do Google Play Services."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Ocorreu um erro no Google Play Services"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Solicitado por <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-ro/strings.xml b/platform/android/libs/google_play_services/res/values-ro/strings.xml
deleted file mode 100644
index eb428964ec..0000000000
--- a/platform/android/libs/google_play_services/res/values-ro/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Descărcaţi Servicii Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Această aplicaţie nu poate rula fără Servicii Google Play, care lipsesc de pe telefon."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Această aplicaţie nu poate rula fără Servicii Google Play, care lipsesc de pe tabletă."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Obţineţi Servicii Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Activaţi Servicii Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Această aplicaţie nu va funcţiona decât dacă activaţi Servicii Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Activaţi Servicii Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Actualizaţi Servicii Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Această aplicaţie nu poate rula decât dacă actualizaţi Servicii Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Eroare de reţea"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Este necesară o conexiune de date pentru a vă conecta la serviciile Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Cont nevalid"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Contul menționat nu există pe acest dispozitiv. Alegeți alt cont."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Problemă necunoscută privind Servicii Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Servicii Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Gadgetul nu acceptă serviciile Google Play, pe care se bazează unele dintre aplicații. Pentru asistență, contactați producătorul gadgetului."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Data de pe dispozitiv pare să fie incorectă. Verificați data de pe dispozitiv."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Actualizaţi"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Conectați"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Conectați-vă cu Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplicația a încercat să utilizeze o vers. Servicii Google Play greșită"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"O aplicație necesită activarea Serviciilor Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"O aplicație necesită instalarea Serviciilor Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"O aplicație necesită o actualizare pentru Servicii Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Eroare Servicii Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Solicitată de <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-ru/strings.xml b/platform/android/libs/google_play_services/res/values-ru/strings.xml
deleted file mode 100644
index c784aae95c..0000000000
--- a/platform/android/libs/google_play_services/res/values-ru/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Установите Сервисы Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Для работы этого приложения требуется установить Сервисы Google Play."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Для работы этого приложения требуется установить Сервисы Google Play."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Установить"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Включите Сервисы Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Для работы этого приложения требуется включить Сервисы Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Включить"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Обновите Сервисы Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Для работы этого приложения требуется обновить Сервисы Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Ошибка сети"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Для работы с Google Play требуется подключение к сети."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Недействительный аккаунт"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Этого аккаунта нет на устройстве. Выберите другой."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Неизвестная ошибка с Сервисами Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Сервисы Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Сервисы Google Play, необходимые для работы некоторых приложений, не поддерживаются на вашем устройстве. Обратитесь к производителю."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Проверьте правильность даты, указанной на устройстве."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Обновить"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Войти"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Войти в аккаунт Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Версия сервисов Google Play неисправна"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Для работы приложения требуется включить сервисы Google Play"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Для работы приложения требуется установить сервисы Google Play"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Для работы приложения требуется обновить сервисы Google Play"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Ошибка сервисов Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Запрос от приложения \"<xliff:g id="APP_NAME">%1$s</xliff:g>\""</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-sk/strings.xml b/platform/android/libs/google_play_services/res/values-sk/strings.xml
deleted file mode 100644
index 125d87f6da..0000000000
--- a/platform/android/libs/google_play_services/res/values-sk/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Inštalovať služby Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Na spustenie tejto aplikácie sa vyžadujú služby Google Play, ktoré v telefóne nemáte."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Na spustenie tejto aplikácie sa vyžadujú služby Google Play, ktoré v tablete nemáte."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Inštalovať služby Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Povoliť služby Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Táto aplikácia bude fungovať až po povolení služieb Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Povoliť služby Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Aktualizovať služby Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Túto aplikáciu bude možné spustiť až po aktualizácii služieb Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Chyba siete"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Pripojenie k službám Google Play si vyžaduje dátové pripojenie."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Neplatný účet"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Zadaný účet v tomto zariadení neexistuje. Vyberte iný účet."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Neznámy problém so službami Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Služby Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Niektoré vaše aplikácie vyžadujú služby Google Play, ktoré vo vašom zariadení nie sú podporované. Ak potrebujete pomoc, kontaktujte výrobcu."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Dátum nastavený v zariadení sa zdá byť nesprávny. Skontrolujte ho."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Aktualizovať"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Prihlásiť sa"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Prihlásiť sa do účtu Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikácia sa pokúsila použiť nesprávnu verziu služieb Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Aplikácia vyžaduje povolenie služieb Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Aplikácia vyžaduje inštaláciu služieb Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Aplikácia vyžaduje aktualizáciu služieb Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Chyba služieb Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Vyžiadané aplikáciou <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-sl/strings.xml b/platform/android/libs/google_play_services/res/values-sl/strings.xml
deleted file mode 100644
index df5821f94c..0000000000
--- a/platform/android/libs/google_play_services/res/values-sl/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Namestite storitve Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ta aplikacija ne deluje brez storitev Google Play, ki jih ni v telefonu."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ta aplikacija ne deluje brez storitev Google Play, ki jih ni v tabličnem računalniku."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Namestite storitve Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Omogočite storitve Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Aplikacija ne bo delovala, če ne omogočite storitev Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Omogočite storitve Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Posodobite storitve Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ta aplikacija ne deluje, če ne posodobite storitev Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Omrežna napaka"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Za povezavo s storitvami Google Play potrebujete internetno povezavo."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Neveljaven račun"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"V tej napravi ne obstaja navedeni račun. Izberite drugega."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Neznana težava s storitvami Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Storitve Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Vaša naprava na podpira storitev Google Play, ki jih potrebujejo nekatere od vaših aplikacij. Za pomoč se obrnite na izdelovalca."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Videti je, da je datum v napravi napačen. Preverite ga."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Posodobi"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Prijava"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Prijavite se v Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Aplikacija je poskusila uporabiti napačno različico Storitev Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Za delovanje aplikacije morate omogočiti Storitve Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Za delovanje aplikacije morate namestiti Storitve Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Za delovanje aplikacije morate posodobiti Storitve Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Napaka storitev Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Zahtevala aplikacija <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-sr/strings.xml b/platform/android/libs/google_play_services/res/values-sr/strings.xml
deleted file mode 100644
index ad0b549547..0000000000
--- a/platform/android/libs/google_play_services/res/values-sr/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Преузимање Google Play услуга"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ова апликација не може да се покрене без Google Play услуга, које недостају на телефону."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ова апликација не може да се покрене без Google Play услуга, које недостају на таблету."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Преузми Google Play услуге"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Омогућавање Google Play услуга"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ова апликација неће функционисати ако не омогућите Google Play услуге."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Омогући Google Play услуге"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Ажурирање Google Play услуга"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ова апликација не може да се покрене ако не ажурирате Google Play услуге."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Грешка на мрежи"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"За повезивање са Google Play услугама потребна је веза за пренос података."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Неважећи налог"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Наведени налог не постоји на овом уређају. Одаберите други налог."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Непознат проблем са Google Play услугама."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play услуге"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Google Play услуге, које су потребне за функционисање неких од апликација, нису подржане на уређају. Контактирајте произвођача да бисте добили помоћ."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Изгледа да су подаци на уређају нетачни. Проверите датум на уређају."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Ажурирај"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Пријави ме"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Пријави ме преко Google-а"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Апликација је покушала да користи лошу верзију Google Play услуга."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Апликација захтева да Google Play услуге буду омогућене."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Апликација захтева инсталирање Google Play услуга."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Апликација захтева ажурирање Google Play услуга."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Грешка Google Play услуга"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Захтева <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-sv/strings.xml b/platform/android/libs/google_play_services/res/values-sv/strings.xml
deleted file mode 100644
index 6a10395f4b..0000000000
--- a/platform/android/libs/google_play_services/res/values-sv/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Hämta Google Play Tjänster"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Den här appen kan inte köras utan Google Play Tjänster, som saknas på mobilen."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Den här appen kan inte köras utan Google Play Tjänster, som saknas på surfplattan."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Hämta Google Play Tjänster"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Aktivera Google Play Tjänster"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Du måste aktivera Google Play Tjänster för att den här appen ska fungera."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Aktivera Google Play Tjänster"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Uppdatera Google Play Tjänster"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Du måste uppdatera Google Play Tjänster innan du kan köra den här appen."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Nätverksfel"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"En dataanslutning krävs för att ansluta till Google Plays tjänster."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Ogiltigt konto"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Det angivna kontot finns inte på den här enheten. Välj ett annat konto."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Okänt problem med Google Play Tjänster"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play-tjänster"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Några av dina appar använder Google Play-tjänster som inte stöds av din enhet. Kontakta tillverkaren om du vill ha hjälp."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Datumet på enheten verkar inte vara rätt. Kontrollera datumet på enheten."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Uppdatera"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Logga in"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Logga in med Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"En olämplig version av Google Play Tjänster anropades av en app."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Google Play Tjänster måste aktiveras för en att app ska fungera."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Google Play Tjänster måste installeras för att en app ska fungera."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Google Play Tjänster måste uppdateras för en app ska fungera."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Fel på Google Play Tjänster"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Begärdes av <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-sw/strings.xml b/platform/android/libs/google_play_services/res/values-sw/strings.xml
deleted file mode 100644
index 7f29bf5f2e..0000000000
--- a/platform/android/libs/google_play_services/res/values-sw/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Pata huduma za Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Programu hii haiwezi kuendeshwa bila huduma za Google Play, ambazo hazipo kwenye simu yako."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Programu hii haiwezi kufanya kazi bila huduma za Google Play, ambazo hazipatikani kwenye kompyuta kibao yako."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Pata huduma za Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Wezesha huduma za Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Programu hii haitafanya kazi mpaka utakapowezesha huduma za Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Wezesha huduma za Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Sasisha huduma za Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Programu hii haiwezi kuendeshwa mpaka utakaposasisha huduma za Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Hitilafu ya Mtandao"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Muunganisho wa data unahitajika ili kuunganisha kwenye huduma za Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Akaunti Batili"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Akaunti iliyobainishwa haipo kwenye kifaa hiki. Tafadhali chagua akaunti tofauti."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Suala lisilojulikana na huduma za Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Huduma za Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Huduma za Google Play, ambazo baadhi ya programu zako zinategemea, si linganifu na kifaa chako. Tafadhali wasiliana na mtengenezaji kwa usaidizi."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Inaeonekana tarehe ya kifaa sio sahihi. Tafadhali angalia tarehe ya kifaa."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Sasisha"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Ingia"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Ingia ukitumia Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Programu ilijaribu kutumia toleo baya la Huduma za Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Programu inahitaji Huduma za Google Play ili kuwashwa."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Programu inahitaji usakinishaji wa Huduma za Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Programu inahitaji sasisho la Huduma za Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Hitilafu kwenye Huduma za Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Imeombwa na <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-th/strings.xml b/platform/android/libs/google_play_services/res/values-th/strings.xml
deleted file mode 100644
index 6f098fe801..0000000000
--- a/platform/android/libs/google_play_services/res/values-th/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"รับบริการ Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"แอปพลิเคชันนี้จะไม่ทำงานหากไม่มีบริการ Google Play ซึ่งไม่มีในโทรศัพท์ของคุณ"</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"แอปพลิเคชันนี้จะไม่ทำงานหากไม่มีบริการ Google Play ซึ่งไม่มีในแท็บเล็ตของคุณ"</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"รับบริการ Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"เปิดใช้งานบริการ Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"แอปพลิเคชันนี้จะไม่ทำงานจนกว่าคุณจะเปิดใช้งานบริการ Google Play"</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"เปิดใช้งานบริการ Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"อัปเดตบริการ Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"แอปพลิเคชันนี้จะไม่ทำงานจนกว่าคุณจะอัปเดตบริการ Google Play"</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"ข้อผิดพลาดของเครือข่าย"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"ต้องมีการเขื่อมต่อข้อมูลเพื่อเชื่อมต่อกับบริการ Google Play"</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"บัญชีไม่ถูกต้อง"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"บัญชีที่ระบุไม่มีอยู่บนอุปกรณ์นี้ โปรดเลือกบัญชีอื่น"</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"ปัญหาที่ไม่รู้จักของบริการ Google Play"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"บริการ Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"บริการ Google Play ซึ่งใช้งานในบางแอปพลิเคชัน ไม่ได้รับการสนับสนุนโดยอุปกรณ์ของคุณ โปรดติดต่อผู้ผลิตเพื่อขอรับความช่วยเหลือ"</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"วันที่บนอุปกรณ์ไม่ถูกต้อง โปรดตรวจสอบวันที่บนอุปกรณ์"</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"อัปเดต"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"ลงชื่อใช้"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"ลงชื่อเข้าใช้ด้วย Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"แอปพลิเคชันหนึ่งพยายามใช้เวอร์ชันที่ไม่เหมาะสมของบริการ Google Play"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"แอปพลิเคชันหนึ่งจำเป็นต้องมีบริการ Google Play เพื่อเปิดใช้งาน"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"แอปพลิเคชันหนึ่งจำเป็นต้องมีการติดตั้งบริการ Google Play"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"แอปพลิเคชันหนึ่งจำเป็นต้องมีการอัปเดตสำหรับบริการ Google Play"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"ข้อผิดพลาดของบริการ Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"ขอโดย <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-tl/strings.xml b/platform/android/libs/google_play_services/res/values-tl/strings.xml
deleted file mode 100644
index 337f73c0cd..0000000000
--- a/platform/android/libs/google_play_services/res/values-tl/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Kumuha ng mga serbisyo ng Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Hindi tatakbo ang app na ito nang wala ang mga serbisyo ng Google Play, na wala sa iyong telepono."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Hindi gagana ang app na ito nang wala ang mga serbisyo ng Google Play, na wala sa iyong tablet."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Kumuha ng Google Play services"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Paganahin ang Google Play services"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Hindi gagana ang app na ito maliban kung papaganahin mo ang mga serbisyo ng Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Enable Google Play services"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"I-update ang mga serbisyo ng Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Hindi gagana ang app na ito maliban kung i-a-update mo ang mga serbisyo ng Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"May Error sa Network"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Kailangan ng koneksyon ng data upang makakonekta sa mga serbisyo ng Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Di-wasto ang Account"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Hindi umiiral ang tinukoy na account sa device na ito. Mangyaring pumili ng ibang account."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"May hindi alam na isyu sa mga serbisyo ng Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Mga serbisyo ng Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Ang mga serbisyo ng Google Play, kung saan nakadepende ang ilan sa iyong mga application, ay hindi sinusuportahan ng iyong device. Mangyaring makipag-ugnay sa manufacturer para sa tulong."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Mukhang hindi tama ang petsa sa device. Pakisuri ang petsa sa device."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"I-update"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Sign in"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Mag-sign in sa Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"May app na sumubok ng maling bersyon ng Mga Serbisyo ng Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Kailangan ng application na na-enable ang Mga Serbisyo ng Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Kailangan ng application na ma-install ang Serbisyo ng Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Kailangan ng application na i-update ang Mga Serbisyo ng Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Error sa mga serbisyo ng Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Hiniling ng <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-tr/strings.xml b/platform/android/libs/google_play_services/res/values-tr/strings.xml
deleted file mode 100644
index 17e61e5fcb..0000000000
--- a/platform/android/libs/google_play_services/res/values-tr/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Google Play hizmetlerini edinin"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Google Play Hizmetleri telefonunuzda yok ve bu uygulama Google Play Hizmetleri olmadan çalışmaz."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Google Play Hizmetleri tabletinizde yok ve bu uygulama Google Play Hizmetleri olmadan çalışmaz."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Google Play hizmetlerini edin"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Google Play hizmetlerini etkinleştir"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Bu uygulama, Google Play Hizmetleri etkinleştirilmeden çalışmaz"</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Google Play hizmetlerini etkinleştir"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Google Play hizmetlerini güncelle"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Bu uygulama Google Play Hizmetleri güncellenmeden çalışmaz."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Ağ Hatası"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Google Play hizmetlerine bağlanmak için bir veri bağlantısı gerekiyor."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Geçersiz Hesap"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Belirtilen hesap bu cihazda mevcut değil. Lütfen farklı bir hesap seçin."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play hizmetleriyle ilgili bilinmeyen sorun."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play hizmetleri"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Cihazınız, uygulamalarınızdan bazıları için gerekli olan Google Play hizmetlerini desteklemiyor. Lütfen yardım için üreticiyle iletişim kurun."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Cihazdaki tarih doğru görünmüyor. Lütfen cihazda ayarlı tarihi kontrol edin."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Güncelle"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Oturum aç"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Google\'da oturum aç"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Bir uygulama, Google Play Hizmetleri\'nin bozuk bir sürümünü kullanmayı denedi."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Bir uygulama, Google Play Hizmetleri\'nin etkin olmasını gerektiriyor."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Bir uygulama, Google Play Hizmetleri\'nin yüklenmesini gerektiriyor."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Bir uygulama, Google Play Hizmetleri için bir güncelleme gerektiriyor."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play hizmetleri hatası"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"İstekte bulunan: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-uk/strings.xml b/platform/android/libs/google_play_services/res/values-uk/strings.xml
deleted file mode 100644
index d657aea68d..0000000000
--- a/platform/android/libs/google_play_services/res/values-uk/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Установити Google Play Послуги"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ця програма не запуститься без Google Play Послуг, яких немає у вашому телефоні."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ця програма не запуститься без Google Play Послуг, яких немає на вашому планшетному ПК."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Установити Google Play Послуги"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Увімкнути Google Play Послуги"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ця програма не працюватиме, поки ви не ввімкнете Google Play Послуги."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Увімкнути Google Play Послуги"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Оновити Google Play Послуги"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ця програма не запуститься, поки ви не оновите Google Play Послуги."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Помилка мережі"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Для під’єднання до сервісів Google Play потрібне з’єднання з мережею."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Недійсний обліковий запис"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Указаний обліковий запис не існує на цьому пристрої. Виберіть інший обліковий запис."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play Послуги – невідома проблема."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Сервіси Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Ваш пристрій не підтримує Сервіси Google Play, від яких залежить робота деяких програм. Зверніться по допомогу до виробника."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Схоже, на пристрої вказано неправильну дату. Перевірте її."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Оновити"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Увійти"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Увійти в обл.запис Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Програма спробувала застосувати хибну версію Сервісів Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Щоб програма працювала, потрібно ввімкнути Сервіси Google Play."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Щоб програма працювала, потрібно встановити Сервіси Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Щоб програма працювала, потрібно оновити Сервіси Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Помилка Сервісів Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Запит від програми <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-vi/strings.xml b/platform/android/libs/google_play_services/res/values-vi/strings.xml
deleted file mode 100644
index a0434a08ac..0000000000
--- a/platform/android/libs/google_play_services/res/values-vi/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Cài đặt dịch vụ của Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Ứng dụng này sẽ không chạy nếu không có dịch vụ của Google Play. Điện thoại của bạn bị thiếu dịch vụ này."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Ứng dụng này sẽ không chạy nếu không có dịch vụ của Google Play. Máy tính bảng của bạn bị thiếu dịch vụ này."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Cài đặt dịch vụ của Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Bật dịch vụ của Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Ứng dụng này sẽ không hoạt động trừ khi bạn bật dịch vụ của Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Bật dịch vụ của Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Cập nhật dịch vụ của Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Ứng dụng này sẽ không chạy trừ khi bạn cập nhật dịch vụ của Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Lỗi mạng"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Cần có kết nối dữ liệu để kết nối với các dịch vụ của Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"Tài khoản không hợp lệ"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"Tài khoản đã chỉ định không tồn tại trên thiết bị này. Vui lòng chọn một tài khoản khác."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Sự cố không xác định với dịch vụ của Google Play."</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Dịch vụ của Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Các dịch vụ của Google Play mà một số ứng dụng của bạn dựa vào không được thiết bị của bạn hỗ trợ. Vui lòng liên hệ với nhà sản xuất để được hỗ trợ."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Ngày trên thiết bị có vẻ không chính xác. Vui lòng kiểm tra ngày trên thiết bị."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Cập nhật"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Đăng nhập"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Đăng nhập bằng Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Ứng dụng đã cố sử dụng phiên bản không đúng của Dịch vụ của Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Ứng dụng yêu cầu Dịch vụ của Google Play phải được bật."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Ứng dụng yêu cầu cài đặt Dịch vụ của Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Ứng dụng yêu cầu cập nhật dành cho Dịch vụ Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Lỗi dịch vụ của Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Được yêu cầu bởi <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-zh-rCN/strings.xml b/platform/android/libs/google_play_services/res/values-zh-rCN/strings.xml
deleted file mode 100644
index 4339e3eb01..0000000000
--- a/platform/android/libs/google_play_services/res/values-zh-rCN/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"获取 Google Play 服务"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"您的手机中没有 Google Play 服务,您必须先安装该服务才能运行此应用。"</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"您的平板电脑中没有 Google Play 服务,您必须先安装该服务才能运行此应用。"</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"获取 Google Play 服务"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"启用 Google Play 服务"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"您必须先启用 Google Play 服务才能运行此应用。"</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"启用 Google Play 服务"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"更新 Google Play 服务"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"您必须先更新 Google Play 服务才能运行此应用。"</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"网络错误"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"您必须有数据网络连接才能接入 Google Play 服务。"</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"无效帐户"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"此设备上不存在指定的帐户,请选择其他帐户。"</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play 服务出现未知问题。"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play 服务"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"您的设备不支持部分应用所依赖的 Google Play 服务。请与设备制造商联系,以寻求帮助。"</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"设备上的日期似乎不正确,请在设备上检查日期。"</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"更新"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"登录"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"使用 Google 帐户登录"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"某个应用尝试使用的 Google Play 服务版本有误。"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"某个应用要求启用 Google Play 服务。"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"某个应用要求安装 Google Play 服务。"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"某个应用要求更新 Google Play 服务。"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play 服务出错"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"由“<xliff:g id="APP_NAME">%1$s</xliff:g>”发出"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-zh-rHK/strings.xml b/platform/android/libs/google_play_services/res/values-zh-rHK/strings.xml
deleted file mode 100644
index abe6cf1457..0000000000
--- a/platform/android/libs/google_play_services/res/values-zh-rHK/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"取得 Google Play 服務"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"您的手機未安裝 Google Play 服務,安裝後才能執行這個應用程式。"</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"您的平板電腦未安裝 Google Play 服務,安裝後才能執行這個應用程式。"</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"取得 Google Play 服務"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"啟用 Google Play 服務"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"您必須啟用 Google Play 服務,才能執行這個應用程式。"</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"啟用 Google Play 服務"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"更新 Google Play 服務"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"您必須更新 Google Play 服務,才能執行這個應用程式。"</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"網絡錯誤"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"要連接 Google Play 服務,必需數據連線。"</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"無效的帳戶"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"這個裝置上沒有您指定的帳戶,請選擇其他帳戶。"</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play 服務出現不明問題。"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play 服務"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"您的裝置不支援部分應用程式所需的 Google Play 服務。如需協助,請與您的裝置製造商聯絡。"</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"裝置上的日期看來不正確,請檢查裝置上的日期。"</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"更新"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"登入"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"登入 Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"應用程式嘗試使用錯誤版本的「Google Play 服務」。"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"必須啟用「Google Play 服務」,才能使用應用程式。"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"必須安裝「Google Play 服務」,才能使用應用程式。"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"必須更新「Google Play 服務」,才能使用應用程式。"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play 服務錯誤"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"「<xliff:g id="APP_NAME">%1$s</xliff:g>」提出要求"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-zh-rTW/strings.xml b/platform/android/libs/google_play_services/res/values-zh-rTW/strings.xml
deleted file mode 100644
index a66018ab52..0000000000
--- a/platform/android/libs/google_play_services/res/values-zh-rTW/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"取得 Google Play 服務"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"您的手機並未安裝 Google Play 服務,所以無法執行這個應用程式。"</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"您的平板電腦並未安裝 Google Play 服務,所以無法執行這個應用程式。"</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"取得 Google Play 服務"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"啟用 Google Play 服務"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"您必須啟用 Google Play 服務,這個應用程式才能運作。"</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"啟用 Google Play 服務"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"更新 Google Play 服務"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"您必須更新 Google Play 服務,才能執行這個應用程式。"</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"網路錯誤"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"需要數據連線才能連上 Google Play 服務。"</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"無效的帳戶"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"這個裝置上沒有您所指定的帳戶,請選擇其他帳戶。"</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Google Play 服務發生不明問題。"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Google Play 服務"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"您的裝置不支援部分應用程式所需的 Google Play 服務。如需協助,請與您的裝置製造商聯絡。"</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"裝置上的日期似乎不正確,請檢查裝置上的日期。"</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"更新"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"登入"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"使用 Google 帳戶登入"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"應用程式嘗試使用的 Google Play 服務版本有誤。"</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"應用程式需要啟用 Google Play 服務。"</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"應用程式需要安裝 Google Play 服務。"</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"應用程式需要更新 Google Play 服務。"</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Google Play 服務錯誤"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"提出要求的應用程式:<xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values-zu/strings.xml b/platform/android/libs/google_play_services/res/values-zu/strings.xml
deleted file mode 100644
index 572d9a52c4..0000000000
--- a/platform/android/libs/google_play_services/res/values-zu/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="common_google_play_services_install_title" msgid="26645092511305524">"Thola amasevisi e-Google Play"</string>
- <string name="common_google_play_services_install_text_phone" msgid="8685301130651051380">"Lolu hlelo lokusebenza ngeke lusebenze ngaphandle kwamasevisi e-Google Play, angekho efonini yakho."</string>
- <string name="common_google_play_services_install_text_tablet" msgid="1589957570365247855">"Lolu hlelo lokusebenza ngeke lusebenze ngaphandle kwamasevisi e-Google Play, angekho kuthebulethi yakho."</string>
- <string name="common_google_play_services_install_button" msgid="8515591849428043265">"Thola amasevisi e-Google Play"</string>
- <string name="common_google_play_services_enable_title" msgid="529078775174559253">"Nika amandla amasevisi e-Google Play"</string>
- <string name="common_google_play_services_enable_text" msgid="7627896071867667758">"Lolu hlelo lokusebenza ngeke lusebenze ngaphandle nje kokuthi unike amandla amasevisi e-Google Play."</string>
- <string name="common_google_play_services_enable_button" msgid="4181637455539816337">"Nika amandla amasevisi e-Google Play"</string>
- <string name="common_google_play_services_update_title" msgid="6006316683626838685">"Buyekeza amasevisi e-Google Play"</string>
- <string name="common_google_play_services_update_text" msgid="448354684997260580">"Lolu hlelo lokusebenza ngeke lusebenze ngaphandle nje kokuthi ubuyekeze amasevisi e-Google Play."</string>
- <string name="common_google_play_services_network_error_title" msgid="3827284619958211114">"Iphutha lenethiwekhi"</string>
- <string name="common_google_play_services_network_error_text" msgid="9038847255613537209">"Kudingeka ukuxhumeka kwedatha ukuze kuxhunyekwe kumasevisi we-Google Play."</string>
- <string name="common_google_play_services_invalid_account_title" msgid="1066672360770936753">"I-Akhawunti engavumelekile"</string>
- <string name="common_google_play_services_invalid_account_text" msgid="4983316348021735578">"I-Akhawunti ecacisiwe ayikho kule divayisi. Sicela ukhethe i-akhawunti ehlukile."</string>
- <string name="common_google_play_services_unknown_issue" msgid="4762332809710093730">"Indaba engaziwa yamasevisi we-Google Play"</string>
- <string name="common_google_play_services_unsupported_title" msgid="6334768798839376943">"Amasevisi we-Google Play"</string>
- <string name="common_google_play_services_unsupported_text" msgid="3542578567569488671">"Amasevisi we-Google Play, okungukuthi ezinye izinhlelo zakho zithembele kuwo, awasekelwe yidivayisi yakho. Sicela uxhumane nomkhiqizi ukuze uthole usizo."</string>
- <string name="common_google_play_services_unsupported_date_text" msgid="4725396522367789365">"Idethi kudivayisi ibonakala ingalungile. Sicela uhlole idethi kudivayisi."</string>
- <string name="common_google_play_services_update_button" msgid="8932944190611227642">"Isibuyekezo"</string>
- <string name="common_signin_button_text" msgid="9071884888741449141">"Ngena ngemvume"</string>
- <string name="common_signin_button_text_long" msgid="2429381841831957106">"Ngena ngemvume nge-Google"</string>
-
- <string name="auth_client_using_bad_version_title" msgid="2534454398764507874">"Uhlelo lokusebenza luzame ukusebenzisa inguqulo embi yamasevisi we-Google Play."</string>
- <string name="auth_client_needs_enabling_title" msgid="3983201110833868073">"Uhlelo lokusebenza ludinga amasevisi we-Google Play ukuze anikwe amandla."</string>
- <string name="auth_client_needs_installation_title" msgid="7999585836145154206">"Uhlelo lokusebenza ludinga ukufakwa kwamasevisi we-Google Play."</string>
- <string name="auth_client_needs_update_title" msgid="6488605506794595966">"Uhlelo lokusebenza ludinga isibuyekezo samasevisi we-Google Play."</string>
- <string name="auth_client_play_services_err_notification_msg" msgid="3635065018897986478">"Iphutha lamasevisi we-Google Play"</string>
- <string name="auth_client_requested_by_msg" msgid="6304135633531965756">"Kucelwe yi-<xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values/ads_attrs.xml b/platform/android/libs/google_play_services/res/values/ads_attrs.xml
deleted file mode 100644
index 4e97a734a6..0000000000
--- a/platform/android/libs/google_play_services/res/values/ads_attrs.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2013 Google Inc. All Rights Reserved. -->
-<resources>
- <declare-styleable name="AdsAttrs">
- <!--
- The size of the ad. It must be one of BANNER, FULL_BANNER, LEADERBOARD,
- MEDIUM_RECTANGLE, SMART_BANNER, WIDE_SKYSCRAPER, or
- &lt;width&gt;x&lt;height&gt;.
- -->
- <attr name="adSize" format="string"/>
-
- <!--
- A comma-separated list of the supported ad sizes. The sizes must be one of
- BANNER, FULL_BANNER, LEADERBOARD, MEDIUM_RECTANGLE, SMART_BANNER,
- WIDE_SKYSCRAPER, or &lt;width&gt;x&lt;height&gt;.
- -->
- <attr name="adSizes" format="string"/>
-
- <!-- The ad unit ID. -->
- <attr name="adUnitId" format="string"/>
- </declare-styleable>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values/colors.xml b/platform/android/libs/google_play_services/res/values/colors.xml
deleted file mode 100644
index 6b2740a509..0000000000
--- a/platform/android/libs/google_play_services/res/values/colors.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources>
- <!-- Sign-in Button Colors -->
- <color name="common_signin_btn_dark_text_default">@android:color/white</color>
- <color name="common_signin_btn_dark_text_pressed">@android:color/white</color>
- <color name="common_signin_btn_dark_text_disabled">#FFAAAAAA</color>
- <color name="common_signin_btn_dark_text_focused">@android:color/white</color>
- <color name="common_signin_btn_light_text_default">#FF737373</color>
- <color name="common_signin_btn_light_text_pressed">@android:color/white</color>
- <color name="common_signin_btn_light_text_disabled">#FFAAAAAA</color>
- <color name="common_signin_btn_light_text_focused">#FF737373</color>
- <color name="common_signin_btn_default_background">#FFDD4B39</color>
- <color name="common_action_bar_splitter">#d2d2d2</color>
-</resources> \ No newline at end of file
diff --git a/platform/android/libs/google_play_services/res/values/maps_attrs.xml b/platform/android/libs/google_play_services/res/values/maps_attrs.xml
deleted file mode 100644
index aaf65c529e..0000000000
--- a/platform/android/libs/google_play_services/res/values/maps_attrs.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2012 Google Inc. All Rights Reserved. -->
-<resources>
- <declare-styleable name="MapAttrs">
- <attr name="mapType" format="enum">
- <enum name="none" value="0"/>
- <enum name="normal" value="1"/>
- <enum name="satellite" value="2"/>
- <enum name="terrain" value="3"/>
- <enum name="hybrid" value="4"/>
- </attr>
- <attr name="cameraBearing" format="float"/>
- <attr name="cameraTargetLat" format="float"/>
- <attr name="cameraTargetLng" format="float"/>
- <attr name="cameraTilt" format="float"/>
- <attr name="cameraZoom" format="float"/>
- <attr name="uiCompass" format="boolean"/>
- <attr name="uiRotateGestures" format="boolean"/>
- <attr name="uiScrollGestures" format="boolean"/>
- <attr name="uiTiltGestures" format="boolean"/>
- <attr name="uiZoomControls" format="boolean"/>
- <attr name="uiZoomGestures" format="boolean"/>
- <attr name="useViewLifecycle" format="boolean"/>
- <attr name="zOrderOnTop" format="boolean"/>
- </declare-styleable>
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values/strings.xml b/platform/android/libs/google_play_services/res/values/strings.xml
deleted file mode 100644
index 3e8731e056..0000000000
--- a/platform/android/libs/google_play_services/res/values/strings.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-
- <!-- Title of confirmation dialog informing user that they need to install
- Google Play services (from Play Store) [CHAR LIMIT=40] -->
- <string name="common_google_play_services_install_title" msgid="7215213145546190223">Get Google Play services</string>
-
- <!-- (For phones) Message in confirmation dialog informing user that
- they need to install Google Play services (from Play Store) [CHAR LIMIT=NONE] -->
- <string name="common_google_play_services_install_text_phone" msgid="2122112764540849864">This app won\'t run without Google Play services, which are missing from your phone.</string>
-
- <!-- (For tablets) Message in confirmation dialog informing user that
- they need to install Google Play services (from Play Store) [CHAR LIMIT=NONE] -->
- <string name="common_google_play_services_install_text_tablet" msgid="7351599665250191022">This app won\'t run without Google Play services, which are missing from your tablet.</string>
-
- <!-- Button in confirmation dialog for installing Google Play services [CHAR LIMIT=40] -->
- <string name="common_google_play_services_install_button" msgid="7153882981874058840">Get Google Play services</string>
-
- <!-- Title of confirmation dialog informing user they need to enable
- Google Play services in application settings [CHAR LIMIT=40] -->
- <string name="common_google_play_services_enable_title" msgid="5122002158466380389">Enable Google Play services</string>
-
- <!-- Message in confirmation dialog informing user they need to enable
- Google Play services in application settings [CHAR LIMIT=NONE] -->
- <string name="common_google_play_services_enable_text" msgid="227660514972886228">This app won\'t work unless you enable Google Play services.</string>
-
- <!-- Button in confirmation dialog to enable Google Play services. Clicking it
- will direct user to application settings of Google Play services where they
- can enable it [CHAR LIMIT=40] -->
- <string name="common_google_play_services_enable_button" msgid="2523291102206661146">Enable Google Play services</string>
-
- <!-- Title of confirmation dialog informing user that they need to update
- Google Play services (from Play Store) [CHAR LIMIT=40] -->
- <string name="common_google_play_services_update_title" msgid="1788179980625863495">Update Google Play services</string>
-
- <!-- Message in confirmation dialog informing user that they need to update
- Google Play services (from Play Store) [CHAR LIMIT=NONE] -->
- <string name="common_google_play_services_update_text" msgid="9053896323427875356">This app won\'t run unless you update Google Play services.</string>
-
- <!-- Title of confirmation dialog informing the user that a network error occurred. [CHAR LIMIT=40] -->
- <string name="common_google_play_services_network_error_title">Network Error</string>
-
- <!-- Message in confirmation dialog informing the user that a network error occurred. [CHAR LIMIT=NONE] -->
- <string name="common_google_play_services_network_error_text">A data connection is required to connect to Google Play services.</string>
-
- <!-- Title of confirmation dialog informing the user that they provided an invalid account. [CHAR LIMIT=40] -->
- <string name="common_google_play_services_invalid_account_title">Invalid Account</string>
-
- <!-- Message in confirmation dialog informing the user that they provided an invalid account. [CHAR LIMIT=NONE] -->
- <string name="common_google_play_services_invalid_account_text">The specified account does not exist on this device. Please choose a different account.</string>
-
- <!-- Message in confirmation dialog informing user there is an unknown issue in Google Play
- services [CHAR LIMIT=NONE] -->
- <string name="common_google_play_services_unknown_issue">Unknown issue with Google Play services.</string>
-
- <!-- Title of confirmation dialog informing user that Google Play services is not supported on their device [CHAR LIMIT=40] -->
- <string name="common_google_play_services_unsupported_title">Google Play services</string>
-
- <!-- Message in confirmation dialog informing user that Google Play services is not supported on their device [CHAR LIMIT=NONE] -->
- <string name="common_google_play_services_unsupported_text">Google Play services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistance.</string>
-
- <!-- Message in confirmation dialog informing user that date on the device is not correct,
- causing certificate checks to fail. [CHAR LIMIT=NONE] -->
- <string name="common_google_play_services_unsupported_date_text">The date on the device appears to be incorrect. Please check the date on the device.</string>
-
- <!-- Button in confirmation dialog for updating Google Play services [CHAR LIMIT=40] -->
- <string name="common_google_play_services_update_button" msgid="6556509956452265614">Update</string>
-
- <!-- Sign-in button text [CHAR LIMIT=15] -->
- <string name="common_signin_button_text">Sign in</string>
-
- <!-- Long form sign-in button text [CHAR LIMIT=30] -->
- <string name="common_signin_button_text_long">Sign in with Google</string>
-
-
- <!-- Auth client code resources (prefix with auth_client --><skip />
- <!-- Title for notification shown when a bad version of GooglePlayServices
- has been installed and needs correction for an application to work.
- [CHAR LIMIT=70] -->
- <string name="auth_client_using_bad_version_title">
- An application attempted to use a bad version of Google Play Services.
- </string>
- <!-- Title for notification shown when GooglePlayServices needs to be
- enabled for a application to work. [CHAR LIMIT=70] -->
- <string name="auth_client_needs_enabling_title">
- An application requires Google Play Services to be enabled.
- </string>
- <!-- Title for notification shown when GooglePlayServices needs to be
- installed for a application to work. [CHAR LIMIT=70] -->
- <string name="auth_client_needs_installation_title">
- An application requires installation of Google Play Services.
- </string>
- <!-- Title for notification shown when GooglePlayServices needs to be
- udpated for a application to work. [CHAR LIMIT=70] -->
- <string name="auth_client_needs_update_title">
- An application requires an update for Google Play Services.
- </string>
-
- <!-- Title for notification shown when GooglePlayServices is unavailable [CHAR LIMIT=42] -->
- <string name="auth_client_play_services_err_notification_msg">Google Play services error</string>
-
- <!-- Requested by string saying which app requested the notification. [CHAR LIMIT=42] -->
- <string name="auth_client_requested_by_msg">Requested by <xliff:g id="app_name">%1$s</xliff:g></string>
- <!-- End Auth client resources --><skip />
-
- <!-- Location client code resources (prefix with location_client) -->
-
- <string name="location_client_powered_by_google">Powered by Google</string>
-
- <!-- End location client resources -->
-</resources>
diff --git a/platform/android/libs/google_play_services/res/values/version.xml b/platform/android/libs/google_play_services/res/values/version.xml
deleted file mode 100644
index 1e7fd4e7ef..0000000000
--- a/platform/android/libs/google_play_services/res/values/version.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <integer name="google_play_services_version">4323000</integer>
-</resources>
diff --git a/platform/android/libs/google_play_services/src/android/UnusedStub.java b/platform/android/libs/google_play_services/src/android/UnusedStub.java
deleted file mode 100644
index d546b0ba9f..0000000000
--- a/platform/android/libs/google_play_services/src/android/UnusedStub.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package android;
-
-// Stub java file to make inclusion into some IDE's work.
-public final class UnusedStub {
- private UnusedStub() { }
-}
diff --git a/platform/android/libs/play_licensing/AndroidManifest.xml b/platform/android/libs/play_licensing/AndroidManifest.xml
deleted file mode 100644
index c7849130c3..0000000000
--- a/platform/android/libs/play_licensing/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.google.android.vending.licensing"
- android:versionCode="2"
- android:versionName="1.5">
- <!-- Devices >= 3 have version of Android Market that supports licensing. -->
- <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="15" />
- <!-- Required permission to check licensing. -->
- <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
-</manifest>
diff --git a/platform/android/libs/play_licensing/build.xml b/platform/android/libs/play_licensing/build.xml
deleted file mode 100644
index 0e800d6b9b..0000000000
--- a/platform/android/libs/play_licensing/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="play_licensing" default="help">
-
- <!-- The local.properties file is created and updated by the 'android' tool.
- It contains the path to the SDK. It should *NOT* be checked into
- Version Control Systems. -->
- <property file="local.properties" />
-
- <!-- The ant.properties file can be created by you. It is only edited by the
- 'android' tool to add properties to it.
- This is the place to change some Ant specific build properties.
- Here are some properties you may want to change/update:
-
- source.dir
- The name of the source directory. Default is 'src'.
- out.dir
- The name of the output directory. Default is 'bin'.
-
- For other overridable properties, look at the beginning of the rules
- files in the SDK, at tools/ant/build.xml
-
- Properties related to the SDK location or the project target should
- be updated using the 'android' tool with the 'update' action.
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems.
-
- -->
- <property file="ant.properties" />
-
- <!-- if sdk.dir was not set from one of the property file, then
- get it from the ANDROID_HOME env var.
- This must be done before we load project.properties since
- the proguard config can use sdk.dir -->
- <property environment="env" />
- <condition property="sdk.dir" value="${env.ANDROID_HOME}">
- <isset property="env.ANDROID_HOME" />
- </condition>
-
- <!-- The project.properties file is created and updated by the 'android'
- tool, as well as ADT.
-
- This contains project specific properties such as project target, and library
- dependencies. Lower level build properties are stored in ant.properties
- (or in .classpath for Eclipse projects).
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems. -->
- <loadproperties srcFile="project.properties" />
-
- <!-- quick check on sdk.dir -->
- <fail
- message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
- unless="sdk.dir"
- />
-
- <!--
- Import per project custom build rules if present at the root of the project.
- This is the place to put custom intermediary targets such as:
- -pre-build
- -pre-compile
- -post-compile (This is typically used for code obfuscation.
- Compiled code location: ${out.classes.absolute.dir}
- If this is not done in place, override ${out.dex.input.absolute.dir})
- -post-package
- -post-build
- -pre-clean
- -->
- <import file="custom_rules.xml" optional="true" />
-
- <!-- Import the actual build file.
-
- To customize existing targets, there are two options:
- - Customize only one target:
- - copy/paste the target into this file, *before* the
- <import> task.
- - customize it to your needs.
- - Customize the whole content of build.xml
- - copy/paste the content of the rules files (minus the top node)
- into this file, replacing the <import> task.
- - customize to your needs.
-
- ***********************
- ****** IMPORTANT ******
- ***********************
- In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
- in order to avoid having your file be overridden by tools such as "android update project"
- -->
- <!-- version-tag: 1 -->
- <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
diff --git a/platform/android/libs/play_licensing/proguard-project.txt b/platform/android/libs/play_licensing/proguard-project.txt
deleted file mode 100644
index f2fe1559a2..0000000000
--- a/platform/android/libs/play_licensing/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/platform/android/libs/play_licensing/project.properties b/platform/android/libs/play_licensing/project.properties
deleted file mode 100644
index f28bc833e1..0000000000
--- a/platform/android/libs/play_licensing/project.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-android.library=true
-# Project target.
-target=android-15
diff --git a/platform/android/project.properties.template b/platform/android/project.properties.template
deleted file mode 100644
index 00cacd72bc..0000000000
--- a/platform/android/project.properties.template
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-#android.library=true
-target=android-19
diff --git a/platform/haiku/audio_driver_media_kit.cpp b/platform/haiku/audio_driver_media_kit.cpp
index 96fd868a81..c7eed1c7cd 100644
--- a/platform/haiku/audio_driver_media_kit.cpp
+++ b/platform/haiku/audio_driver_media_kit.cpp
@@ -118,8 +118,7 @@ void AudioDriverMediaKit::unlock() {
}
void AudioDriverMediaKit::finish() {
- if (player)
- delete player;
+ delete player;
if (samples_in) {
memdelete_arr(samples_in);
diff --git a/platform/haiku/haiku_direct_window.cpp b/platform/haiku/haiku_direct_window.cpp
index 3914ee272a..184d64f840 100644
--- a/platform/haiku/haiku_direct_window.cpp
+++ b/platform/haiku/haiku_direct_window.cpp
@@ -16,9 +16,7 @@ HaikuDirectWindow::HaikuDirectWindow(BRect p_frame)
HaikuDirectWindow::~HaikuDirectWindow() {
- if (update_runner) {
- delete update_runner;
- }
+ delete update_runner;
}
void HaikuDirectWindow::SetHaikuGLView(HaikuGLView* p_view) {
diff --git a/platform/nacl/os_nacl.cpp b/platform/nacl/os_nacl.cpp
index 43f6bd9c01..de6a15525b 100644
--- a/platform/nacl/os_nacl.cpp
+++ b/platform/nacl/os_nacl.cpp
@@ -144,8 +144,7 @@ void OSNacl::finalize_core() {
if (mempool_dynamic)
memdelete( mempool_dynamic );
- if (mempool_static)
- delete mempool_static;
+ delete mempool_static;
};
diff --git a/platform/windows/SCsub b/platform/windows/SCsub
index 2db3d0f51e..914cee0fa1 100644
--- a/platform/windows/SCsub
+++ b/platform/windows/SCsub
@@ -24,4 +24,4 @@ env.Program('#bin/godot',['godot_win.cpp']+common_win,PROGSUFFIX=env["PROGSUFFIX
if (env['vsproj'])=="yes":
env.vs_srcs = env.vs_srcs + ["platform/windows/godot_win.cpp"]
for x in common_win:
- env.vs_srcs = env.vs_srcs + ["platform/windows/" + x]
+ env.vs_srcs = env.vs_srcs + ["platform/windows/" + str(x)]
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index a1366e7630..c00d94a4fb 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -262,7 +262,7 @@ def configure(env):
env.Append(CCFLAGS=["/I"+DIRECTX_PATH+"/Include"])
env.Append(LIBPATH=[DIRECTX_PATH+"/Lib/x86"])
env['ENV'] = os.environ;
- env["x86_opt_vc"]=True
+ env["x86_opt_vc"]=env["bits"]!="64"
else:
# Workaround for MinGW. See:
diff --git a/platform/windows/joystick.h b/platform/windows/joystick.h
index ad62059a73..332e86fbb8 100644
--- a/platform/windows/joystick.h
+++ b/platform/windows/joystick.h
@@ -44,6 +44,9 @@ if(x != NULL) \
}
#endif
+#ifndef XUSER_MAX_COUNT
+#define XUSER_MAX_COUNT 4
+#endif
class joystick_windows
{
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 95bfa2ea94..6f19f8bdfe 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1144,8 +1144,7 @@ void OS_Windows::finalize_core() {
if (mempool_dynamic)
memdelete( mempool_dynamic );
- if (mempool_static)
- delete mempool_static;
+ delete mempool_static;
TCPServerWinsock::cleanup();
@@ -1681,10 +1680,16 @@ uint64_t OS_Windows::get_unix_time() const {
return (*(uint64_t*)&ft - *(uint64_t*)&fep) / 10000000;
};
-uint64_t OS_Windows::get_system_time_msec() const {
+uint64_t OS_Windows::get_system_time_secs() const {
SYSTEMTIME st;
GetSystemTime(&st);
- return st.wMilliseconds;
+ FILETIME ft;
+ SystemTimeToFileTime(&st,&ft);
+ uint64_t ret;
+ ret=ft.dwHighDateTime;
+ ret<<=32;
+ ret|=ft.dwLowDateTime;
+ return ret;
}
void OS_Windows::delay_usec(uint32_t p_usec) const {
@@ -2099,6 +2104,13 @@ String OS_Windows::get_data_dir() const {
}
+bool OS_Windows::is_joy_known(int p_device) {
+ return input->is_joy_mapped(p_device);
+}
+
+String OS_Windows::get_joy_guid(int p_device) const {
+ return input->get_joy_guid_remapped(p_device);
+}
OS_Windows::OS_Windows(HINSTANCE _hInstance) {
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index dfa2b40595..e433d5cc11 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -231,7 +231,7 @@ public:
virtual Time get_time(bool utc) const;
virtual TimeZoneInfo get_time_zone_info() const;
virtual uint64_t get_unix_time() const;
- virtual uint64_t get_system_time_msec() const;
+ virtual uint64_t get_system_time_secs() const;
virtual bool can_draw() const;
virtual Error set_cwd(const String& p_cwd);
@@ -270,6 +270,9 @@ public:
virtual bool get_swap_ok_cancel() { return true; }
+ virtual bool is_joy_known(int p_device);
+ virtual String get_joy_guid(int p_device) const;
+
OS_Windows(HINSTANCE _hInstance);
~OS_Windows();
diff --git a/platform/winrt/os_winrt.cpp b/platform/winrt/os_winrt.cpp
index 7c4b2dc661..f507c1aae7 100644
--- a/platform/winrt/os_winrt.cpp
+++ b/platform/winrt/os_winrt.cpp
@@ -345,8 +345,7 @@ void OSWinrt::finalize_core() {
if (mempool_dynamic)
memdelete( mempool_dynamic );
- if (mempool_static)
- delete mempool_static;
+ delete mempool_static;
}
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 0226c8b8c0..e035c72993 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -55,6 +55,7 @@ def get_opts():
('use_sanitizer','Use llvm compiler sanitize address','no'),
('use_leak_sanitizer','Use llvm compiler sanitize memory leaks','no'),
('pulseaudio','Detect & Use pulseaudio','yes'),
+ ('gamepad','Gamepad support, requires libudev and libevdev','yes'),
('new_wm_api', 'Use experimental window management API','no'),
('debug_release', 'Add debug symbols to release version','no'),
]
@@ -145,23 +146,33 @@ def configure(env):
env.Append(CPPPATH=['#tools/freetype/freetype/include'])
-
-
env.Append(CPPFLAGS=['-DOPENGL_ENABLED','-DGLEW_ENABLED'])
- if platform.system() == 'Linux':
+
+ if os.system("pkg-config --exists alsa")==0:
+ print("Enabling ALSA")
env.Append(CPPFLAGS=["-DALSA_ENABLED"])
env.Append(LIBS=['asound'])
-
- if not os.system("pkg-config --exists libudev"):
- if not os.system("pkg-config --exists libevdev"):
- print("Enabling udev/evdev")
- env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"])
- env.ParseConfig('pkg-config libudev --cflags --libs')
- env.ParseConfig('pkg-config libevdev --cflags --libs')
- else:
- print("libevdev development libraries not found, disabling gamepad support")
+ else:
+ print("ALSA libraries not found, disabling driver")
+
+ if (env["gamepad"]=="yes" and platform.system() == "Linux"):
+ # pkg-config returns 0 when the lib exists...
+ found_udev = not os.system("pkg-config --exists libudev")
+ found_evdev = not os.system("pkg-config --exists libevdev")
+
+ if (found_udev and found_evdev):
+ print("Enabling gamepad support with udev/evdev")
+ env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"])
+ env.ParseConfig('pkg-config libudev --cflags --libs')
+ env.ParseConfig('pkg-config libevdev --cflags --libs')
else:
- print("libudev development libraries not found, disabling gamepad support")
+ if (not found_udev):
+ print("libudev development libraries not found")
+ if (not found_evdev):
+ print("libevdev development libraries not found")
+ print("Some libraries are missing for the required gamepad support, aborting!")
+ print("Install the mentioned libraries or build with 'gamepad=no' to disable gamepad support.")
+ sys.exit(255)
if (env["pulseaudio"]=="yes"):
if not os.system("pkg-config --exists libpulse-simple"):
diff --git a/platform/x11/joystick_linux.cpp b/platform/x11/joystick_linux.cpp
index 050fdac2b8..6eb3671bc0 100644
--- a/platform/x11/joystick_linux.cpp
+++ b/platform/x11/joystick_linux.cpp
@@ -52,8 +52,13 @@ joystick_linux::Joystick::Joystick() {
void joystick_linux::Joystick::reset() {
dpad = 0;
fd = -1;
+
+ InputDefault::JoyAxis jx;
+ jx.min = -1;
+ jx.value = 0.0f;
for (int i=0; i < MAX_ABS; i++) {
abs_map[i] = -1;
+ curr_axis[i] = jx;
}
}
@@ -390,7 +395,7 @@ uint32_t joystick_linux::process_joysticks(uint32_t p_event_id) {
default:
if (joy->abs_map[ev.code] != -1) {
InputDefault::JoyAxis value = axis_correct(libevdev_get_abs_info(dev, ev.code), ev.value);
- p_event_id = input->joy_axis(p_event_id, i, joy->abs_map[ev.code], value);
+ joy->curr_axis[joy->abs_map[ev.code]] = value;
}
break;
}
@@ -398,6 +403,12 @@ uint32_t joystick_linux::process_joysticks(uint32_t p_event_id) {
}
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
}
+ for (int j = 0; j < MAX_ABS; j++) {
+ int index = joy->abs_map[j];
+ if (index != -1) {
+ p_event_id = input->joy_axis(p_event_id, i, index, joy->curr_axis[index]);
+ }
+ }
}
joy_mutex->unlock();
return p_event_id;
diff --git a/platform/x11/joystick_linux.h b/platform/x11/joystick_linux.h
index 9d22a6c754..ee9bd0352a 100644
--- a/platform/x11/joystick_linux.h
+++ b/platform/x11/joystick_linux.h
@@ -54,6 +54,7 @@ private:
};
struct Joystick {
+ InputDefault::JoyAxis curr_axis[MAX_ABS];
int key_map[MAX_KEY - BT_MISC];
int abs_map[MAX_ABS];
int dpad;
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 0887fd9df2..82df8dff60 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -447,6 +447,9 @@ void OS_X11::finalize() {
// memdelete(debugger_connection_console);
//}
+#ifdef JOYDEV_ENABLED
+ memdelete(joystick);
+#endif
memdelete(input);
memdelete(sample_manager);
@@ -463,9 +466,6 @@ void OS_X11::finalize() {
physics_2d_server->finish();
memdelete(physics_2d_server);
-#ifdef JOYDEV_ENABLED
- memdelete(joystick);
-#endif
XUnmapWindow( x11_display, x11_window );
XDestroyWindow( x11_display, x11_window );
@@ -619,6 +619,7 @@ void OS_X11::set_wm_fullscreen(bool p_enabled) {
xev.xclient.data.l[2] = 0;
XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);
+
}
int OS_X11::get_screen_count() const {
@@ -887,7 +888,16 @@ void OS_X11::set_window_maximized(bool p_enabled) {
XGetWindowAttributes(x11_display,DefaultRootWindow(x11_display),&xwa);
current_videomode.width = xwa.width;
current_videomode.height = xwa.height;
-*/
+//*/
+
+// current_videomode.width = wm_max_horz;
+// current_videomode.height = wm_max_vert;
+
+ //Size2 ss = get_screen_size(get_current_screen());
+ //current_videomode.width=ss.width;
+ //current_videomode.height=ss.height;
+
+
maximized = p_enabled;
}
@@ -1764,6 +1774,14 @@ void OS_X11::run() {
main_loop->finish();
}
+bool OS_X11::is_joy_known(int p_device) {
+ return input->is_joy_mapped(p_device);
+}
+
+String OS_X11::get_joy_guid(int p_device) const {
+ return input->get_joy_guid_remapped(p_device);
+}
+
OS_X11::OS_X11() {
#ifdef RTAUDIO_ENABLED
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index a556ba49e3..91dbeac284 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -222,6 +222,10 @@ public:
virtual void move_window_to_foreground();
virtual void alert(const String& p_alert,const String& p_title="ALERT!");
+
+ virtual bool is_joy_known(int p_device);
+ virtual String get_joy_guid(int p_device) const;
+
void run();
OS_X11();
diff --git a/platform/x11/platform_config.h b/platform/x11/platform_config.h
index 5a333f4a0d..aac50c27c2 100644
--- a/platform/x11/platform_config.h
+++ b/platform/x11/platform_config.h
@@ -31,6 +31,7 @@
#endif
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <stdlib.h>
+#define PTHREAD_BSD_SET_NAME
#endif
#define GLES2_INCLUDE_H "gl_context/glew.h"
diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp
index 464553b982..50a115174d 100644
--- a/scene/2d/area_2d.cpp
+++ b/scene/2d/area_2d.cpp
@@ -420,13 +420,13 @@ void Area2D::_notification(int p_what) {
void Area2D::set_enable_monitoring(bool p_enable) {
- if (locked) {
- ERR_EXPLAIN("This function can't be used during the in/out signal.");
- }
- ERR_FAIL_COND(locked);
if (p_enable==monitoring)
return;
+ if (locked) {
+ ERR_EXPLAIN("Function blocked during in/out signal. Use call_deferred(\"set_enable_monitoring\",true/false)");
+ }
+ ERR_FAIL_COND(locked);
monitoring=p_enable;
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp
index 8f6df43c76..35b453d71d 100644
--- a/scene/2d/canvas_item.cpp
+++ b/scene/2d/canvas_item.cpp
@@ -389,8 +389,8 @@ Matrix32 CanvasItem::get_global_transform_with_canvas() const {
if (last_valid->canvas_layer)
return last_valid->canvas_layer->get_transform() * xform;
- else
- return xform;
+ else if (is_inside_tree())
+ return get_viewport()->get_canvas_transform() * xform;
}
Matrix32 CanvasItem::get_global_transform() const {
@@ -548,6 +548,7 @@ void CanvasItem::_notification(int p_what) {
get_parent()->cast_to<CanvasItem>()->children_items.erase(C);
C=NULL;
}
+ global_invalid=true;
} break;
case NOTIFICATION_DRAW: {
diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp
index 386c7b9dd0..2a40a6207d 100644
--- a/scene/2d/collision_polygon_2d.cpp
+++ b/scene/2d/collision_polygon_2d.cpp
@@ -197,7 +197,7 @@ void CollisionPolygon2D::_notification(int p_what) {
Vector2 n = polygon[(i+1)%polygon.size()];
draw_line(p,n,Color(0.9,0.2,0.0,0.8),3);
}
-//#define DEBUG_DECOMPOSE
+#define DEBUG_DECOMPOSE
#if defined(TOOLS_ENABLED) && defined (DEBUG_DECOMPOSE)
Vector< Vector<Vector2> > decomp = _decompose_in_convex();
diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp
index e2a4de5fac..c7542407cb 100644
--- a/scene/2d/navigation2d.cpp
+++ b/scene/2d/navigation2d.cpp
@@ -508,7 +508,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
points+=", ";
points+=_get_vertex(p->edges[i].point);
}
- print_line("poly "+itos(idx++)+" - "+points);
+ //print_line("poly "+itos(idx++)+" - "+points);
p = p->edges[prev].C;
if (p==begin_poly)
break;
@@ -557,6 +557,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
bool skip=false;
+ /*
print_line("-----\nAPEX: "+(apex_point-end_point));
print_line("LEFT:");
print_line("\tPortal: "+(portal_left-end_point));
@@ -570,6 +571,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
print_line("\tRight Tangent: "+rtos(CLOCK_TANGENT(apex_point,portal_right,right)));
print_line("\tRight Distance: "+rtos(portal_right.distance_squared_to(apex_point)));
print_line("\tRight Test: "+rtos(CLOCK_TANGENT(apex_point,right,portal_left)));
+ */
if (CLOCK_TANGENT(apex_point,portal_left,left) >= 0){
@@ -577,7 +579,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
if (portal_left.distance_squared_to(apex_point)<CMP_EPSILON || CLOCK_TANGENT(apex_point,left,portal_right) > 0) {
left_poly=p;
portal_left=left;
- print_line("***ADVANCE LEFT");
+ //print_line("***ADVANCE LEFT");
} else {
//_clip_path(path,apex_poly,portal_right,right_poly);
@@ -592,7 +594,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
path.push_back(apex_point);
skip=true;
//print_line("addpoint left");
- print_line("***CLIP LEFT");
+ //print_line("***CLIP LEFT");
}
}
@@ -601,7 +603,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
if (portal_right.distance_squared_to(apex_point)<CMP_EPSILON || CLOCK_TANGENT(apex_point,right,portal_left) < 0) {
right_poly=p;
portal_right=right;
- print_line("***ADVANCE RIGHT");
+ //print_line("***ADVANCE RIGHT");
} else {
//_clip_path(path,apex_poly,portal_left,left_poly);
@@ -615,7 +617,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect
if (path[path.size()-1].distance_to(apex_point)>CMP_EPSILON)
path.push_back(apex_point);
//print_line("addpoint right");
- print_line("***CLIP RIGHT");
+ //print_line("***CLIP RIGHT");
}
}
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp
index f135864098..bd7415aa04 100644
--- a/scene/2d/path_2d.cpp
+++ b/scene/2d/path_2d.cpp
@@ -74,6 +74,8 @@ void Path2D::set_curve(const Ref<Curve2D>& p_curve) {
curve->connect("changed",this,"_curve_changed");
}
+ _curve_changed();
+
}
Ref<Curve2D> Path2D::get_curve() const{
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index dd8aa9e8b1..cc2e5c0d72 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -310,14 +310,20 @@ void RigidBody2D::_body_enter_tree(ObjectID p_id) {
ERR_FAIL_COND(!E);
ERR_FAIL_COND(E->get().in_scene);
+ contact_monitor->locked=true;
+
E->get().in_scene=true;
emit_signal(SceneStringNames::get_singleton()->body_enter,node);
+
for(int i=0;i<E->get().shapes.size();i++) {
emit_signal(SceneStringNames::get_singleton()->body_enter_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape);
}
+ contact_monitor->locked=false;
+
+
}
void RigidBody2D::_body_exit_tree(ObjectID p_id) {
@@ -329,11 +335,18 @@ void RigidBody2D::_body_exit_tree(ObjectID p_id) {
ERR_FAIL_COND(!E);
ERR_FAIL_COND(!E->get().in_scene);
E->get().in_scene=false;
+
+ contact_monitor->locked=true;
+
emit_signal(SceneStringNames::get_singleton()->body_exit,node);
+
for(int i=0;i<E->get().shapes.size();i++) {
emit_signal(SceneStringNames::get_singleton()->body_exit_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape);
}
+
+ contact_monitor->locked=false;
+
}
void RigidBody2D::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,int p_local_shape) {
@@ -439,6 +452,8 @@ void RigidBody2D::_direct_state_changed(Object *p_state) {
if (contact_monitor) {
+ contact_monitor->locked=true;
+
//untag all
int rc=0;
for( Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) {
@@ -520,6 +535,8 @@ void RigidBody2D::_direct_state_changed(Object *p_state) {
_body_inout(1,toadd[i].id,toadd[i].shape,toadd[i].local_shape);
}
+ contact_monitor->locked=false;
+
}
set_block_transform_notify(true); // don't want notify (would feedback loop)
@@ -803,6 +820,11 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) {
if (!p_enabled) {
+ if (contact_monitor->locked) {
+ ERR_EXPLAIN("Can't disable contact monitoring during in/out callback. Use call_deferred(\"set_contact_monitor\",false) instead");
+ }
+ ERR_FAIL_COND(contact_monitor->locked);
+
for(Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) {
//clean up mess
@@ -813,6 +835,7 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) {
} else {
contact_monitor = memnew( ContactMonitor );
+ contact_monitor->locked=false;
}
}
@@ -1250,7 +1273,7 @@ void KinematicBody2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_collider_velocity"),&KinematicBody2D::get_collider_velocity);
ObjectTypeDB::bind_method(_MD("get_collider:Object"),&KinematicBody2D::_get_collider);
ObjectTypeDB::bind_method(_MD("get_collider_shape"),&KinematicBody2D::get_collider_shape);
- ObjectTypeDB::bind_method(_MD("get_collider_metadata"),&KinematicBody2D::get_collider_metadata);
+ ObjectTypeDB::bind_method(_MD("get_collider_metadata:Variant"),&KinematicBody2D::get_collider_metadata);
ObjectTypeDB::bind_method(_MD("set_collision_margin","pixels"),&KinematicBody2D::set_collision_margin);
ObjectTypeDB::bind_method(_MD("get_collision_margin","pixels"),&KinematicBody2D::get_collision_margin);
diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h
index fc337915c5..999e63dd5d 100644
--- a/scene/2d/physics_body_2d.h
+++ b/scene/2d/physics_body_2d.h
@@ -190,7 +190,7 @@ private:
struct ContactMonitor {
-
+ bool locked;
Map<ObjectID,BodyState> body_map;
};
diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp
index 0254eb2836..fac94f19dc 100644
--- a/scene/2d/screen_button.cpp
+++ b/scene/2d/screen_button.cpp
@@ -102,6 +102,10 @@ void TouchScreenButton::_notification(int p_what) {
action_id=-1;
}
} break;
+ case NOTIFICATION_EXIT_TREE: {
+ if (is_pressed())
+ Input::get_singleton()->action_release(action);
+ } break;
}
}
@@ -161,7 +165,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
if (finger_pressed==-1 || p_event.screen_touch.index==finger_pressed) {
- Point2 coord = (get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y));
+ Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y));
bool touched=false;
if (bitmask.is_valid()) {
@@ -238,7 +242,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) {
if (finger_pressed!=-1)
return; //already fingering
- Point2 coord = (get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y));
+ Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y));
bool touched=false;
if (bitmask.is_valid()) {
diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp
index 644129db89..3e78fef147 100644
--- a/scene/3d/camera.cpp
+++ b/scene/3d/camera.cpp
@@ -125,7 +125,7 @@ bool Camera::_get(const StringName& p_name,Variant &r_ret) const {
r_ret= int(keep_aspect);
else if (p_name=="current") {
- if (is_inside_tree() && get_tree()->is_editor_hint()) {
+ if (is_inside_tree() && get_tree()->is_node_being_edited(this)) {
r_ret=current;
} else {
r_ret=is_current();
@@ -192,12 +192,11 @@ void Camera::_update_camera() {
// here goes listener stuff
// if (viewport_ptr && is_inside_scene() && is_current())
-// viewport_ptr->_camera_transform_changed_notify();
+// get_viewport()->_camera_transform_changed_notify();
if (is_inside_tree() && is_current()) {
- if (viewport_ptr) {
- viewport_ptr->_camera_transform_changed_notify();
- }
+ get_viewport()->_camera_transform_changed_notify();
+
}
if (is_current() && get_world().is_valid()) {
@@ -213,29 +212,10 @@ void Camera::_notification(int p_what) {
case NOTIFICATION_ENTER_WORLD: {
- viewport_ptr=NULL;
-
- { //find viewport stuff
- Node *parent=get_parent();
- while(parent) {
-
- Viewport* viewport = parent->cast_to<Viewport>();
-
- if (viewport) {
- viewport_ptr=viewport;
- break;
- }
- parent=parent->get_parent();
- }
-
- }
-
- camera_group = "_vp_cameras"+itos(get_viewport()->get_instance_ID());
- add_to_group(camera_group);
- if (viewport_ptr)
- viewport_ptr->cameras.insert(this);
- if (current)
+ bool first_camera = get_viewport()->cameras.size()==0;
+ get_viewport()->cameras.insert(this);
+ if (!get_tree()->is_node_being_edited(this) && (current || first_camera))
make_current();
@@ -246,17 +226,17 @@ void Camera::_notification(int p_what) {
} break;
case NOTIFICATION_EXIT_WORLD: {
- if (is_current()) {
- clear_current();
- current=true; //keep it true
+ if (!get_tree()->is_node_being_edited(this)) {
+ if (is_current()) {
+ clear_current();
+ current=true; //keep it true
- } else {
- current=false;
+ } else {
+ current=false;
+ }
}
- if (viewport_ptr)
- viewport_ptr->cameras.erase(this);
- viewport_ptr=NULL;
- remove_from_group(camera_group);
+
+ get_viewport()->cameras.erase(this);
} break;
@@ -324,25 +304,12 @@ void Camera::make_current() {
if (!is_inside_tree())
return;
- if (viewport_ptr) {
- viewport_ptr->_set_camera(this);
- }
+ get_viewport()->_set_camera(this);
//get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,camera_group,"_camera_make_current",this);
}
-void Camera::_camera_make_next_current(Node *p_exclude) {
-
- if (this==p_exclude)
- return;
- if (!is_inside_tree())
- return;
- if (get_viewport()->get_camera()!=NULL)
- return;
-
- make_current();
-}
void Camera::clear_current() {
@@ -351,12 +318,20 @@ void Camera::clear_current() {
if (!is_inside_tree())
return;
- if (viewport_ptr) {
- if (viewport_ptr->get_camera()==this) {
- viewport_ptr->_set_camera(NULL);
- //a group is used beause this needs to be in order to be deterministic
- get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,camera_group,"_camera_make_next_current",this);
+ if (get_viewport()->get_camera()==this) {
+ get_viewport()->_set_camera(NULL);
+ //a group is used beause this needs to be in order to be deterministic
+
+ for (Set<Camera*>::Element *E=get_viewport()->cameras.front();E;E=E->next()) {
+ if (this==E->get())
+ continue;
+ if (!E->get()->is_inside_tree())
+ continue;
+ if (get_viewport()->get_camera()!=NULL)
+ return;
+
+ E->get()->make_current();
}
}
@@ -364,9 +339,9 @@ void Camera::clear_current() {
bool Camera::is_current() const {
- if (is_inside_tree()) {
- if (viewport_ptr)
- return viewport_ptr->get_camera()==this;
+ if (is_inside_tree() && !get_tree()->is_node_being_edited(this)) {
+
+ return get_viewport()->get_camera()==this;
} else
return current;
@@ -481,12 +456,12 @@ Vector3 Camera::project_local_ray_normal(const Point2& p_pos) const {
#if 0
- Size2 viewport_size = viewport_ptr->get_visible_rect().size;
+ Size2 viewport_size = get_viewport()->get_visible_rect().size;
Vector2 cpos = p_pos;
#else
- Size2 viewport_size = viewport_ptr->get_camera_rect_size();
- Vector2 cpos = viewport_ptr->get_camera_coords(p_pos);
+ Size2 viewport_size = get_viewport()->get_camera_rect_size();
+ Vector2 cpos = get_viewport()->get_camera_coords(p_pos);
#endif
Vector3 ray;
@@ -514,12 +489,12 @@ Vector3 Camera::project_ray_origin(const Point2& p_pos) const {
}
#if 0
- Size2 viewport_size = viewport_ptr->get_visible_rect().size;
+ Size2 viewport_size = get_viewport()->get_visible_rect().size;
Vector2 cpos = p_pos;
#else
- Size2 viewport_size = viewport_ptr->get_camera_rect_size();
- Vector2 cpos = viewport_ptr->get_camera_coords(p_pos);
+ Size2 viewport_size = get_viewport()->get_camera_rect_size();
+ Vector2 cpos = get_viewport()->get_camera_coords(p_pos);
#endif
ERR_FAIL_COND_V( viewport_size.y == 0, Vector3() );
@@ -566,7 +541,7 @@ Point2 Camera::unproject_position(const Vector3& p_pos) const {
ERR_FAIL_COND_V(!is_inside_tree(),Vector2());
}
- Size2 viewport_size = viewport_ptr->get_visible_rect().size;
+ Size2 viewport_size = get_viewport()->get_visible_rect().size;
CameraMatrix cm;
@@ -597,7 +572,7 @@ Vector3 Camera::project_position(const Point2& p_point) const {
ERR_FAIL_COND_V(!is_inside_tree(),Vector3());
}
- Size2 viewport_size = viewport_ptr->get_visible_rect().size;
+ Size2 viewport_size = get_viewport()->get_visible_rect().size;
CameraMatrix cm;
@@ -692,7 +667,6 @@ void Camera::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_environment:Environment"),&Camera::get_environment);
ObjectTypeDB::bind_method(_MD("set_keep_aspect_mode","mode"),&Camera::set_keep_aspect_mode);
ObjectTypeDB::bind_method(_MD("get_keep_aspect_mode"),&Camera::get_keep_aspect_mode);
- ObjectTypeDB::bind_method(_MD("_camera_make_next_current"),&Camera::_camera_make_next_current);
//ObjectTypeDB::bind_method( _MD("_camera_make_current"),&Camera::_camera_make_current );
BIND_CONSTANT( PROJECTION_PERSPECTIVE );
@@ -745,7 +719,7 @@ Vector<Plane> Camera::get_frustum() const {
ERR_FAIL_COND_V(!is_inside_world(),Vector<Plane>());
- Size2 viewport_size = viewport_ptr->get_visible_rect().size;
+ Size2 viewport_size = get_viewport()->get_visible_rect().size;
CameraMatrix cm;
if (mode==PROJECTION_PERSPECTIVE)
cm.set_perspective(fov,viewport_size.get_aspect(),near,far,keep_aspect==KEEP_WIDTH);
@@ -789,7 +763,6 @@ Camera::Camera() {
near=0;
far=0;
current=false;
- viewport_ptr=NULL;
force_change=false;
mode=PROJECTION_PERSPECTIVE;
set_perspective(60.0,0.1,100.0);
diff --git a/scene/3d/camera.h b/scene/3d/camera.h
index dcb7a21961..02ca6ffb9a 100644
--- a/scene/3d/camera.h
+++ b/scene/3d/camera.h
@@ -68,18 +68,15 @@ private:
RID camera;
RID scenario_id;
- String camera_group;
+ //String camera_group;
uint32_t layers;
- Viewport *viewport_ptr;
Ref<Environment> environment;
virtual bool _can_gizmo_scale() const;
virtual RES _get_gizmo_geometry() const;
- void _camera_make_next_current(Node *p_exclude);
-
//void _camera_make_current(Node *p_camera);
friend class Viewport;
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index de777604b0..1a2665b6ad 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -207,6 +207,9 @@ void RigidBody::_body_enter_tree(ObjectID p_id) {
ERR_FAIL_COND(E->get().in_tree);
E->get().in_tree=true;
+
+ contact_monitor->locked=true;
+
emit_signal(SceneStringNames::get_singleton()->body_enter,node);
for(int i=0;i<E->get().shapes.size();i++) {
@@ -214,6 +217,9 @@ void RigidBody::_body_enter_tree(ObjectID p_id) {
emit_signal(SceneStringNames::get_singleton()->body_enter_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape);
}
+ contact_monitor->locked=false;
+
+
}
void RigidBody::_body_exit_tree(ObjectID p_id) {
@@ -225,11 +231,18 @@ void RigidBody::_body_exit_tree(ObjectID p_id) {
ERR_FAIL_COND(!E);
ERR_FAIL_COND(!E->get().in_tree);
E->get().in_tree=false;
+
+ contact_monitor->locked=true;
+
emit_signal(SceneStringNames::get_singleton()->body_exit,node);
+
for(int i=0;i<E->get().shapes.size();i++) {
emit_signal(SceneStringNames::get_singleton()->body_exit_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape);
}
+
+ contact_monitor->locked=false;
+
}
void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,int p_local_shape) {
@@ -317,6 +330,8 @@ void RigidBody::_direct_state_changed(Object *p_state) {
if (contact_monitor) {
+ contact_monitor->locked=true;
+
//untag all
int rc=0;
for( Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) {
@@ -396,6 +411,8 @@ void RigidBody::_direct_state_changed(Object *p_state) {
_body_inout(1,toadd[i].id,toadd[i].shape,toadd[i].local_shape);
}
+ contact_monitor->locked=false;
+
}
set_ignore_transform_notification(true);
@@ -648,6 +665,11 @@ void RigidBody::set_contact_monitor(bool p_enabled) {
if (!p_enabled) {
+ if (contact_monitor->locked) {
+ ERR_EXPLAIN("Can't disable contact monitoring during in/out callback. Use call_deferred(\"set_contact_monitor\",false) instead");
+ }
+ ERR_FAIL_COND(contact_monitor->locked);
+
for(Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) {
//clean up mess
@@ -658,6 +680,8 @@ void RigidBody::set_contact_monitor(bool p_enabled) {
} else {
contact_monitor = memnew( ContactMonitor );
+ contact_monitor->locked=false;
+
}
}
diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h
index 0d6c358e28..da79d63f00 100644
--- a/scene/3d/physics_body.h
+++ b/scene/3d/physics_body.h
@@ -175,7 +175,7 @@ private:
struct ContactMonitor {
-
+ bool locked;
Map<ObjectID,BodyState> body_map;
};
diff --git a/scene/3d/spatial_stream_player.cpp b/scene/3d/spatial_stream_player.cpp
index 048c9e78ac..dfef0faf4b 100644
--- a/scene/3d/spatial_stream_player.cpp
+++ b/scene/3d/spatial_stream_player.cpp
@@ -60,7 +60,7 @@ void SpatialStreamPlayer::sp_set_mix_rate(int p_rate){
bool SpatialStreamPlayer::sp_mix(int32_t *p_buffer,int p_frames) {
- if (resampler.is_ready()) {
+ if (resampler.is_ready() && !paused) {
return resampler.mix(p_buffer,p_frames);
}
diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp
index 74d84b8b08..f7cfc31b03 100644
--- a/scene/audio/stream_player.cpp
+++ b/scene/audio/stream_player.cpp
@@ -58,7 +58,7 @@ void StreamPlayer::sp_set_mix_rate(int p_rate){
bool StreamPlayer::sp_mix(int32_t *p_buffer,int p_frames) {
- if (resampler.is_ready()) {
+ if (resampler.is_ready() && !paused) {
return resampler.mix(p_buffer,p_frames);
}
@@ -170,6 +170,7 @@ void StreamPlayer::stop() {
stop_request=false;
playback->stop();
resampler.flush();
+ emit_signal("finished");
//set_idle_process(false);
}
@@ -378,6 +379,8 @@ void StreamPlayer::_bind_methods() {
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") );
ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") );
ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") );
+
+ ADD_SIGNAL(MethodInfo("finished"));
}
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index 59f2f34b82..b9ce46d738 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -137,8 +137,10 @@ void Button::_notification(int p_what) {
text_ofs.y+=font->get_ascent();
font->draw( ci, text_ofs.floor(), text, color,clip_text?text_clip:-1);
if (!_icon.is_null()) {
+
+ int valign = size.height-style->get_minimum_size().y;
- _icon->draw(ci,Point2(style->get_offset().x, Math::floor( (size.height-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) );
+ _icon->draw(ci,style->get_offset()+Point2(0, Math::floor( (valign-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) );
}
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 23a7ae00da..5a8ecfeffe 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -862,6 +862,13 @@ bool Control::window_has_modal_stack() const {
return data.window->window->modal_stack.size();
}
+bool Control::is_window_modal_on_top() const {
+
+ if (window_has_modal_stack())
+ return data.window->window->modal_stack.back()->get()==this;
+ return false;
+}
+
void Control::_window_cancel_tooltip() {
window->tooltip=NULL;
@@ -916,7 +923,7 @@ void Control::_window_show_tooltip() {
void Control::_window_call_input(Control *p_control,const InputEvent& p_input) {
- _block();
+// _block();
while(p_control) {
@@ -934,7 +941,7 @@ void Control::_window_call_input(Control *p_control,const InputEvent& p_input) {
p_control=p_control->data.parent;
}
- _unblock();
+ //_unblock();
}
diff --git a/scene/gui/control.h b/scene/gui/control.h
index 280e88e85d..0ead632aab 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -270,6 +270,8 @@ public:
void set_custom_minimum_size(const Size2& p_custom);
Size2 get_custom_minimum_size() const;
+ bool is_window_modal_on_top() const;
+
bool is_window() const;
Control *get_window() const;
Control *get_parent_control() const;
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 955a02d0f9..5b57395e58 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -56,7 +56,42 @@ void FileDialog::_notification(int p_what) {
//RID ci = get_canvas_item();
//get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
- }
+ }
+
+ if (p_what==NOTIFICATION_POPUP_HIDE) {
+
+ set_process_unhandled_input(false);
+ }
+}
+
+void FileDialog::_unhandled_input(const InputEvent& p_event) {
+
+ if (p_event.type==InputEvent::KEY && is_window_modal_on_top()) {
+
+ const InputEventKey &k=p_event.key;
+
+ if (k.pressed) {
+
+ bool handled=true;
+
+ switch (k.scancode) {
+
+ case KEY_H: {
+
+ if (k.mod.command) {
+ set_show_hidden_files(!show_hidden_files);
+ } else {
+ handled=false;
+ }
+
+ } break;
+ default: { handled=false; }
+ }
+
+ if (handled)
+ accept_event();
+ }
+ }
}
void FileDialog::set_enable_multiple_selection(bool p_enable) {
@@ -114,6 +149,8 @@ void FileDialog::_post_popup() {
else
tree->grab_focus();
+ set_process_unhandled_input(true);
+
}
void FileDialog::_action_pressed() {
@@ -628,6 +665,8 @@ bool FileDialog::default_show_hidden_files=false;
void FileDialog::_bind_methods() {
+ ObjectTypeDB::bind_method(_MD("_unhandled_input"),&FileDialog::_unhandled_input);
+
ObjectTypeDB::bind_method(_MD("_tree_selected"),&FileDialog::_tree_selected);
ObjectTypeDB::bind_method(_MD("_tree_db_selected"),&FileDialog::_tree_dc_selected);
ObjectTypeDB::bind_method(_MD("_dir_entered"),&FileDialog::_dir_entered);
diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h
index 491655e4ce..b71a157fa7 100644
--- a/scene/gui/file_dialog.h
+++ b/scene/gui/file_dialog.h
@@ -117,6 +117,8 @@ private:
void _update_drives();
+ void _unhandled_input(const InputEvent& p_event);
+
virtual void _post_popup();
protected:
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index db463c133b..fdced3f62f 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -245,12 +245,26 @@ void LineEdit::_input_event(InputEvent p_event) {
delete_char();
}
} break;
+ case KEY_KP_4: {
+ if (k.unicode != 0) {
+ handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_left
+ }
case KEY_LEFT: {
shift_selection_check_pre(k.mod.shift);
set_cursor_pos(get_cursor_pos()-1);
shift_selection_check_post(k.mod.shift);
} break;
+ case KEY_KP_6: {
+ if (k.unicode != 0) {
+ handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_right
+ }
case KEY_RIGHT: {
shift_selection_check_pre(k.mod.shift);
@@ -271,12 +285,26 @@ void LineEdit::_input_event(InputEvent p_event) {
}
} break;
+ case KEY_KP_7: {
+ if (k.unicode != 0) {
+ handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_home
+ }
case KEY_HOME: {
shift_selection_check_pre(k.mod.shift);
set_cursor_pos(0);
shift_selection_check_post(k.mod.shift);
} break;
+ case KEY_KP_1: {
+ if (k.unicode != 0) {
+ handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_end
+ }
case KEY_END: {
shift_selection_check_pre(k.mod.shift);
@@ -287,26 +315,29 @@ void LineEdit::_input_event(InputEvent p_event) {
default: {
- if (k.unicode>=32 && k.scancode!=KEY_DELETE) {
-
- if (editable) {
- selection_delete();
- CharType ucodestr[2]={(CharType)k.unicode,0};
- append_at_cursor(ucodestr);
- emit_signal("text_changed",text);
- _change_notify("text");
- }
-
- } else {
- handled=false;
- }
+ handled=false;
} break;
}
- if (handled)
+ if (handled) {
accept_event();
- else
- return;
+ } else {
+ if (k.unicode>=32 && k.scancode!=KEY_DELETE) {
+
+ if (editable) {
+ selection_delete();
+ CharType ucodestr[2]={(CharType)k.unicode,0};
+ append_at_cursor(ucodestr);
+ emit_signal("text_changed",text);
+ _change_notify("text");
+
+ accept_event();
+ }
+
+ } else {
+ return;
+ }
+ }
selection.old_shift=k.mod.shift;
diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp
index 25b7952da1..ffcdf98519 100644
--- a/scene/gui/range.cpp
+++ b/scene/gui/range.cpp
@@ -48,20 +48,20 @@ void Range::Shared::emit_value_changed() {
}
}
-void Range::_changed_notify() {
+void Range::_changed_notify(const char *p_what) {
emit_signal("changed",shared->val);
update();
- _change_notify();
+ _change_notify(p_what);
}
-void Range::Shared::emit_changed() {
+void Range::Shared::emit_changed(const char *p_what) {
for (Set<Range*>::Element *E=owners.front();E;E=E->next()) {
Range *r=E->get();
if (!r->is_inside_tree())
continue;
- r->_changed_notify();
+ r->_changed_notify(p_what);
}
}
@@ -77,7 +77,11 @@ void Range::set_val(double p_val) {
if (p_val<shared->min)
p_val=shared->min;
-
+
+ //avoid to set -0
+ if (p_val == 0)
+ p_val = 0;
+
if (shared->val==p_val)
return;
@@ -90,20 +94,20 @@ void Range::set_min(double p_min) {
shared->min=p_min;
set_val(shared->val);
- shared->emit_changed();
+ shared->emit_changed("range/min");
}
void Range::set_max(double p_max) {
shared->max=p_max;
set_val(shared->val);
- shared->emit_changed();
+ shared->emit_changed("range/max");
}
void Range::set_step(double p_step) {
shared->step=p_step;
- shared->emit_changed();
+ shared->emit_changed("range/step");
}
void Range::set_page(double p_page) {
@@ -111,7 +115,7 @@ void Range::set_page(double p_page) {
shared->page=p_page;
set_val(shared->val);
- shared->emit_changed();
+ shared->emit_changed("range/page");
}
double Range::get_val() const {
diff --git a/scene/gui/range.h b/scene/gui/range.h
index 2967c2790c..d96ecdfb0b 100644
--- a/scene/gui/range.h
+++ b/scene/gui/range.h
@@ -44,7 +44,7 @@ class Range : public Control {
bool exp_unit_value;
Set<Range*> owners;
void emit_value_changed();
- void emit_changed();
+ void emit_changed(const char *p_what="");
};
Shared *shared;
@@ -55,7 +55,7 @@ class Range : public Control {
void _share(Node *p_range);
void _value_changed_notify();
- void _changed_notify();
+ void _changed_notify(const char *p_what="");
protected:
diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp
index 6a677e7de0..a26acc9c05 100644
--- a/scene/gui/tabs.cpp
+++ b/scene/gui/tabs.cpp
@@ -65,8 +65,8 @@ Size2 Tabs::get_minimum_size() const {
ms.height=MAX(bms.height+tab_bg->get_minimum_size().height,ms.height);
}
- if (tabs[i].close_button.is_valid()) {
- Ref<Texture> cb=tabs[i].close_button;
+ if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i==current)) {
+ Ref<Texture> cb=get_icon("close");
Size2 bms = cb->get_size();//+get_stylebox("button")->get_minimum_size();
bms.width+=get_constant("hseparation");
ms.width+=bms.width;
@@ -108,14 +108,6 @@ void Tabs::_input_event(const InputEvent& p_event) {
for(int i=0;i<tabs.size();i++) {
// test hovering tab to display close button if policy says so
- if (cb_displaypolicy == SHOW_HOVER) {
- int ofs=tabs[i].ofs_cache;
- int size = tabs[i].ofs_cache;
- if (pos.x >=tabs[i].ofs_cache && pos.x<tabs[i].ofs_cache+tabs[i].size_cache) {
- hover=i;
- }
- }
-
// test hovering right button and close button
if (tabs[i].rb_rect.has_point(pos)) {
@@ -260,12 +252,14 @@ void Tabs::_notification(int p_what) {
Ref<Font> font = get_font("font");
Color color_fg = get_color("font_color_fg");
Color color_bg = get_color("font_color_bg");
+ Ref<Texture> close=get_icon("close");
int h = get_size().height;
int label_valign_fg = get_constant("label_valign_fg");
int label_valign_bg = get_constant("label_valign_bg");
+
int w=0;
int mw = 0;
@@ -277,32 +271,12 @@ void Tabs::_notification(int p_what) {
for(int i=0;i<tabs.size();i++) {
- Ref<Texture> tex = tabs[i].icon;
- if (tex.is_valid()) {
- if (tabs[i].text!="")
- mw+=get_constant("hseparation");
+ int sz = get_tab_width(i);
+
+ tabs[i].ofs_cache=mw;
+ mw+=sz;
- }
- mw+=font->get_string_size(tabs[i].text).width;
- if (current==i)
- mw+=tab_fg->get_minimum_size().width;
- else
- mw+=tab_bg->get_minimum_size().width;
-
- if (tabs[i].right_button.is_valid()) {
- Ref<Texture> rb=tabs[i].right_button;
- Size2 bms = rb->get_size();//+get_stylebox("button")->get_minimum_size();
- bms.width+=get_constant("hseparation");
-
- mw+=bms.width;
- }
- if (tabs[i].close_button.is_valid()) {
- Ref<Texture> cb=tabs[i].close_button;
- Size2 bms = cb->get_size();//+get_stylebox("button")->get_minimum_size();
- bms.width+=get_constant("hseparation");
- mw+=bms.width;
- }
}
}
@@ -364,56 +338,15 @@ void Tabs::_notification(int p_what) {
}
- // Close button
- switch (cb_displaypolicy) {
- case SHOW_ALWAYS: {
- if (tabs[i].close_button.is_valid()) {
- Ref<StyleBox> style = get_stylebox("button");
- Ref<Texture> rb=tabs[i].close_button;
-
- lsize+=get_constant("hseparation");
- //lsize+=style->get_margin(MARGIN_LEFT);
- lsize+=rb->get_width();
- //lsize+=style->get_margin(MARGIN_RIGHT);
- }
- } break;
- case SHOW_ACTIVE_ONLY: {
- if (i==current) {
- if (tabs[i].close_button.is_valid()) {
- Ref<StyleBox> style = get_stylebox("button");
- Ref<Texture> rb=tabs[i].close_button;
-
- lsize+=get_constant("hseparation");
- //lsize+=style->get_margin(MARGIN_LEFT);
- lsize+=rb->get_width();
- //lsize+=style->get_margin(MARGIN_RIGHT);
-
- }
- }
- } break;
- case SHOW_HOVER: {
- if (i==current || i==hover) {
- if (tabs[i].close_button.is_valid()) {
- Ref<StyleBox> style = get_stylebox("button");
- Ref<Texture> rb=tabs[i].close_button;
-
- lsize+=get_constant("hseparation");
- //lsize+=style->get_margin(MARGIN_LEFT);
- lsize+=rb->get_width();
- //lsize+=style->get_margin(MARGIN_RIGHT);
-
- }
- }
- } break;
- case SHOW_NEVER: // by default, never show close button
- default: {
- // do nothing
- } break;
+ if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i==current)) {
+ lsize+=get_constant("hseparation");
+ //lsize+=style->get_margin(MARGIN_LEFT);
+ lsize+=close->get_width();
+ //lsize+=style->get_margin(MARGIN_RIGHT);
}
-
if (w+lsize > limit) {
max_drawn_tab=i-1;
missing_right=true;
@@ -487,100 +420,31 @@ void Tabs::_notification(int p_what) {
}
+ if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i==current)) {
+ Ref<StyleBox> style = get_stylebox("button");
+ Ref<Texture> cb=close;
- // Close button
- switch (cb_displaypolicy) {
- case SHOW_ALWAYS: {
- if (tabs[i].close_button.is_valid()) {
- Ref<StyleBox> style = get_stylebox("button");
- Ref<Texture> cb=tabs[i].close_button;
-
- w+=get_constant("hseparation");
-
- Rect2 cb_rect;
- cb_rect.size=style->get_minimum_size()+cb->get_size();
- cb_rect.pos.x=w;
- cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2;
-
- if (cb_hover==i) {
- if (cb_pressing)
- get_stylebox("button_pressed")->draw(ci,cb_rect);
- else
- style->draw(ci,cb_rect);
- }
+ w+=get_constant("hseparation");
- //w+=style->get_margin(MARGIN_LEFT);
+ Rect2 cb_rect;
+ cb_rect.size=style->get_minimum_size()+cb->get_size();
+ cb_rect.pos.x=w;
+ cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2;
- cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) ));
- w+=cb->get_width();
- //w+=style->get_margin(MARGIN_RIGHT);
- tabs[i].cb_rect=cb_rect;
- }
- } break;
- case SHOW_ACTIVE_ONLY: {
- if (current==i) {
- if (tabs[i].close_button.is_valid()) {
- Ref<StyleBox> style = get_stylebox("button");
- Ref<Texture> cb=tabs[i].close_button;
-
- w+=get_constant("hseparation");
-
- Rect2 cb_rect;
- cb_rect.size=style->get_minimum_size()+cb->get_size();
- cb_rect.pos.x=w;
- cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2;
-
- if (cb_hover==i) {
- if (cb_pressing)
- get_stylebox("button_pressed")->draw(ci,cb_rect);
- else
- style->draw(ci,cb_rect);
- }
-
- //w+=style->get_margin(MARGIN_LEFT);
-
- cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) ));
- w+=cb->get_width();
- //w+=style->get_margin(MARGIN_RIGHT);
- tabs[i].cb_rect=cb_rect;
- }
- }
- } break;
- case SHOW_HOVER: {
- if (current==i || hover==i) {
- if (tabs[i].close_button.is_valid()) {
- Ref<StyleBox> style = get_stylebox("button");
- Ref<Texture> cb=tabs[i].close_button;
-
- w+=get_constant("hseparation");
-
- Rect2 cb_rect;
- cb_rect.size=style->get_minimum_size()+cb->get_size();
- cb_rect.pos.x=w;
- cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2;
-
- if (cb_hover==i) {
- if (cb_pressing)
- get_stylebox("button_pressed")->draw(ci,cb_rect);
- else
- style->draw(ci,cb_rect);
- }
-
- //w+=style->get_margin(MARGIN_LEFT);
-
- cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) ));
- w+=cb->get_width();
- //w+=style->get_margin(MARGIN_RIGHT);
- tabs[i].cb_rect=cb_rect;
- }
+ if (cb_hover==i) {
+ if (cb_pressing)
+ get_stylebox("button_pressed")->draw(ci,cb_rect);
+ else
+ style->draw(ci,cb_rect);
}
- } break;
- case SHOW_NEVER:
- default: {
- // show nothing
- } break;
+ //w+=style->get_margin(MARGIN_LEFT);
+
+ cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) ));
+ w+=cb->get_width();
+ //w+=style->get_margin(MARGIN_RIGHT);
+ tabs[i].cb_rect=cb_rect;
}
w+=sb->get_margin(MARGIN_RIGHT);
@@ -687,20 +551,6 @@ Ref<Texture> Tabs::get_tab_right_button(int p_tab) const{
}
-void Tabs::set_tab_close_button(int p_tab, const Ref<Texture>& p_close_button) {
- ERR_FAIL_INDEX(p_tab, tabs.size());
- tabs[p_tab].close_button=p_close_button;
- update();
- minimum_size_changed();
-}
-
-
-Ref<Texture> Tabs::get_tab_close_button(int p_tab) const{
-
- ERR_FAIL_INDEX_V(p_tab,tabs.size(),Ref<Texture>());
- return tabs[p_tab].close_button;
-
-}
void Tabs::add_tab(const String& p_str,const Ref<Texture>& p_icon) {
@@ -708,8 +558,6 @@ void Tabs::add_tab(const String& p_str,const Ref<Texture>& p_icon) {
t.text=p_str;
t.icon=p_icon;
- t.close_button = get_icon("Close","EditorIcons");
-
tabs.push_back(t);
update();
@@ -741,10 +589,6 @@ void Tabs::remove_tab(int p_idx) {
}
-void Tabs::set_tab_close_display_policy(CloseButtonDisplayPolicy p_cb_displaypolicy) {
- cb_displaypolicy = p_cb_displaypolicy;
-}
-
void Tabs::set_tab_align(TabAlign p_align) {
@@ -757,6 +601,94 @@ Tabs::TabAlign Tabs::get_tab_align() const {
return tab_align;
}
+int Tabs::get_tab_width(int p_idx) const {
+
+ ERR_FAIL_INDEX_V(p_idx,tabs.size(),0);
+
+ Ref<StyleBox> tab_bg = get_stylebox("tab_bg");
+ Ref<StyleBox> tab_fg = get_stylebox("tab_fg");
+ Ref<Font> font = get_font("font");
+ Ref<Texture> close=get_icon("close");
+
+ int x=0;
+
+ Ref<Texture> tex = tabs[p_idx].icon;
+ if (tex.is_valid()) {
+ if (tabs[p_idx].text!="")
+ x+=get_constant("hseparation");
+
+ }
+
+
+ x+=font->get_string_size(tabs[p_idx].text).width;
+ if (current==p_idx)
+ x+=tab_fg->get_minimum_size().width;
+ else
+ x+=tab_bg->get_minimum_size().width;
+
+ if (tabs[p_idx].right_button.is_valid()) {
+ print_line("has right");
+ Ref<Texture> rb=tabs[p_idx].right_button;
+ Size2 bms = rb->get_size();//+get_stylebox("button")->get_minimum_size();
+ bms.width+=get_constant("hseparation");
+
+ x+=bms.width;
+ }
+
+ if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && p_idx==current)) {
+
+ Size2 bms = close->get_size();//+get_stylebox("button")->get_minimum_size();
+ bms.width+=get_constant("hseparation");
+ x+=bms.width;
+ }
+
+ return x;
+}
+
+void Tabs::ensure_tab_visible(int p_idx) {
+
+ if (!is_inside_tree())
+ return;
+
+ ERR_FAIL_INDEX(p_idx,tabs.size());
+
+ if (p_idx<=offset) {
+ offset=p_idx;
+ update();
+ return;
+ }
+
+ Ref<Texture> incr = get_icon("increment");
+ Ref<Texture> decr = get_icon("decrement");
+
+ int limit=get_size().width-incr->get_width()-decr->get_width();
+
+
+
+ int x=0;
+ for(int i=0;i<tabs.size();i++) {
+
+ if (i<offset)
+ continue;
+
+ int sz = get_tab_width(i);
+ tabs[i].x_cache=x;
+ tabs[i].x_size_cache=sz;
+ x+=sz;
+
+ }
+
+ while(offset<tabs.size() && ( (tabs[p_idx].x_cache + tabs[p_idx].x_size_cache) - tabs[offset].x_cache) > limit) {
+ offset++;
+ }
+
+ update();
+}
+
+void Tabs::set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy) {
+ cb_displaypolicy=p_policy;
+ update();
+}
void Tabs::_bind_methods() {
@@ -772,6 +704,7 @@ void Tabs::_bind_methods() {
ObjectTypeDB::bind_method(_MD("add_tab","title","icon:Texture"),&Tabs::add_tab);
ObjectTypeDB::bind_method(_MD("set_tab_align","align"),&Tabs::set_tab_align);
ObjectTypeDB::bind_method(_MD("get_tab_align"),&Tabs::get_tab_align);
+ ObjectTypeDB::bind_method(_MD("ensure_tab_visible","idx"),&Tabs::ensure_tab_visible);
ADD_SIGNAL(MethodInfo("tab_changed",PropertyInfo(Variant::INT,"tab")));
ADD_SIGNAL(MethodInfo("right_button_pressed",PropertyInfo(Variant::INT,"tab")));
@@ -784,10 +717,10 @@ void Tabs::_bind_methods() {
BIND_CONSTANT( ALIGN_CENTER );
BIND_CONSTANT( ALIGN_RIGHT );
- BIND_CONSTANT( SHOW_ACTIVE_ONLY );
- BIND_CONSTANT( SHOW_ALWAYS );
- BIND_CONSTANT( SHOW_HOVER );
- BIND_CONSTANT( SHOW_NEVER );
+ BIND_CONSTANT( CLOSE_BUTTON_SHOW_ACTIVE_ONLY );
+ BIND_CONSTANT( CLOSE_BUTTON_SHOW_ALWAYS );
+ BIND_CONSTANT( CLOSE_BUTTON_SHOW_NEVER );
+
}
@@ -801,7 +734,9 @@ Tabs::Tabs() {
cb_hover=-1;
cb_pressing=false;
- cb_displaypolicy = SHOW_NEVER; // Default : no close button
+ cb_displaypolicy = CLOSE_BUTTON_SHOW_NEVER; // Default : no close button
offset=0;
max_drawn_tab=0;
+
+
}
diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h
index efcb291a52..7f85280853 100644
--- a/scene/gui/tabs.h
+++ b/scene/gui/tabs.h
@@ -45,10 +45,9 @@ public:
enum CloseButtonDisplayPolicy {
- SHOW_ALWAYS,
- SHOW_ACTIVE_ONLY,
- SHOW_HOVER,
- SHOW_NEVER
+ CLOSE_BUTTON_SHOW_NEVER,
+ CLOSE_BUTTON_SHOW_ACTIVE_ONLY,
+ CLOSE_BUTTON_SHOW_ALWAYS,
};
private:
@@ -59,10 +58,13 @@ private:
Ref<Texture> icon;
int ofs_cache;
int size_cache;
+ int x_cache;
+ int x_size_cache;
+
Ref<Texture> right_button;
Rect2 rb_rect;
- Ref<Texture> close_button;
Rect2 cb_rect;
+
};
@@ -85,6 +87,8 @@ private:
int hover; // hovered tab
+ int get_tab_width(int p_idx) const;
+
protected:
void _input_event(const InputEvent& p_event);
@@ -104,13 +108,11 @@ public:
void set_tab_right_button(int p_tab,const Ref<Texture>& p_right_button);
Ref<Texture> get_tab_right_button(int p_tab) const;
- void set_tab_close_button(int p_tab, const Ref<Texture>& p_close_button);
- Ref<Texture> get_tab_close_button(int p_tab) const;
- void set_tab_close_display_policy(CloseButtonDisplayPolicy p_cb_displaypolicy);
-
void set_tab_align(TabAlign p_align);
TabAlign get_tab_align() const;
+ void set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy);
+
int get_tab_count() const;
void set_current_tab(int p_current);
int get_current_tab() const;
@@ -119,6 +121,8 @@ public:
void clear_tabs();
+ void ensure_tab_visible(int p_idx);
+
Size2 get_minimum_size() const;
Tabs();
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 70da7e39a4..7f7c8c023c 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -839,7 +839,7 @@ void TextEdit::_notification(int p_what) {
}
- if (cursor.column==str.length() && cursor.line==line) {
+ if (cursor.column==str.length() && cursor.line==line && (char_ofs+char_margin)>=xmargin_beg) {
cursor_pos=Point2i( char_ofs+char_margin, ofs_y );
VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(1,get_row_height())),cache.font_color);
@@ -1740,6 +1740,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
}
} break;
+ case KEY_KP_4: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_left
+ }
case KEY_LEFT: {
if (k.mod.shift)
@@ -1786,6 +1793,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
_post_shift_selection();
} break;
+ case KEY_KP_6: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_right
+ }
case KEY_RIGHT: {
if (k.mod.shift)
@@ -1829,6 +1843,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
_post_shift_selection();
} break;
+ case KEY_KP_8: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_up
+ }
case KEY_UP: {
if (k.mod.shift)
@@ -1849,6 +1870,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
_cancel_code_hint();
} break;
+ case KEY_KP_2: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_down
+ }
case KEY_DOWN: {
if (k.mod.shift)
@@ -1937,6 +1965,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
update();
} break;
+ case KEY_KP_7: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_home
+ }
#ifdef APPLE_STYLE_KEYS
case KEY_HOME: {
@@ -1950,18 +1985,6 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
_post_shift_selection();
} break;
- case KEY_END: {
-
- if (k.mod.shift)
- _pre_shift_selection();
-
- cursor_set_line(text.size()-1);
-
- if (k.mod.shift)
- _post_shift_selection();
-
- } break;
-
#else
case KEY_HOME: {
@@ -1992,6 +2015,27 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
completion_hint="";
} break;
+#endif
+ case KEY_KP_1: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_end
+ }
+#ifdef APPLE_STYLE_KEYS
+ case KEY_END: {
+
+ if (k.mod.shift)
+ _pre_shift_selection();
+
+ cursor_set_line(text.size()-1);
+
+ if (k.mod.shift)
+ _post_shift_selection();
+
+ } break;
+#else
case KEY_END: {
if (k.mod.shift)
@@ -2009,6 +2053,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
} break;
#endif
+ case KEY_KP_9: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_pageup
+ }
case KEY_PAGEUP: {
if (k.mod.shift)
@@ -2024,6 +2075,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
} break;
+ case KEY_KP_3: {
+ if (k.unicode != 0) {
+ scancode_handled = false;
+ break;
+ }
+ // numlock disabled. fallthrough to key_pageup
+ }
case KEY_PAGEDOWN: {
if (k.mod.shift)
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 95b79cc940..0780a4bdaf 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -2067,6 +2067,8 @@ void Node::_bind_methods() {
BIND_CONSTANT( NOTIFICATION_UNPARENTED );
BIND_CONSTANT( NOTIFICATION_PAUSED );
BIND_CONSTANT( NOTIFICATION_UNPAUSED );
+ BIND_CONSTANT( NOTIFICATION_INSTANCED );
+
BIND_CONSTANT( PAUSE_MODE_INHERIT );
diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp
index da1d6b3204..a18eb1249f 100644
--- a/scene/main/scene_main_loop.cpp
+++ b/scene/main/scene_main_loop.cpp
@@ -620,6 +620,14 @@ void SceneTree::set_editor_hint(bool p_enabled) {
editor_hint=p_enabled;
}
+bool SceneTree::is_node_being_edited(const Node* p_node) const {
+#ifdef TOOLS_ENABLED
+ return editor_hint && edited_scene_root && edited_scene_root->is_a_parent_of(p_node);
+#else
+ return false;
+#endif
+}
+
bool SceneTree::is_editor_hint() const {
return editor_hint;
@@ -965,6 +973,10 @@ Array SceneTree::_get_nodes_in_group(const StringName& p_group) {
return ret;
}
+bool SceneTree::has_group(const StringName& p_identifier) const {
+
+ return group_map.has(p_identifier);
+}
void SceneTree::get_nodes_in_group(const StringName& p_group,List<Node*> *p_list) {
@@ -1589,6 +1601,7 @@ void SceneTree::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_nodes_in_group","group"),&SceneTree::_get_nodes_in_group);
ObjectTypeDB::bind_method(_MD("get_root:Viewport"),&SceneTree::get_root);
+ ObjectTypeDB::bind_method(_MD("has_group","name"),&SceneTree::has_group);
ObjectTypeDB::bind_method(_MD("set_auto_accept_quit","enabled"),&SceneTree::set_auto_accept_quit);
diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h
index 9ff9bb5747..c6fc124345 100644
--- a/scene/main/scene_main_loop.h
+++ b/scene/main/scene_main_loop.h
@@ -279,6 +279,8 @@ public:
void set_editor_hint(bool p_enabled);
bool is_editor_hint() const;
+ bool is_node_being_edited(const Node* p_node) const;
+
void set_pause(bool p_enabled);
bool is_paused() const;
@@ -318,6 +320,8 @@ public:
void queue_delete(Object *p_object);
void get_nodes_in_group(const StringName& p_group,List<Node*> *p_list);
+ bool has_group(const StringName& p_identifier) const;
+
void set_screen_stretch(StretchMode p_mode,StretchAspect p_aspect,const Size2 p_minsize);
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 6d18a53c9f..330f855006 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -577,7 +577,7 @@ void Viewport::_notification(int p_what) {
PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space());
if (space) {
- bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF);
+ bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF,true);
ObjectID new_collider=0;
if (col) {
@@ -617,7 +617,7 @@ void Viewport::_notification(int p_what) {
PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space());
if (space) {
- bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF);
+ bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF,true);
ObjectID new_collider=0;
if (col) {
if (result.collider) {
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 84b65fc4d6..6c4fe1be79 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -221,7 +221,7 @@
static ResourceFormatLoaderImage *resource_loader_image=NULL;
static ResourceFormatLoaderWAV *resource_loader_wav=NULL;
-static ResourceFormatLoaderBitMap *resource_loader_bitmap=NULL;
+
#ifdef TOOLS_ENABLED
@@ -249,8 +249,6 @@ void register_scene_types() {
resource_loader_wav = memnew( ResourceFormatLoaderWAV );
ResourceLoader::add_resource_format_loader( resource_loader_wav );
- resource_loader_bitmap = memnew( ResourceFormatLoaderBitMap );
- ResourceLoader::add_resource_format_loader( resource_loader_bitmap );
#ifdef TOOLS_ENABLED
@@ -631,7 +629,6 @@ void unregister_scene_types() {
memdelete( resource_loader_image );
memdelete( resource_loader_wav );
- memdelete( resource_loader_bitmap );
#ifdef TOOLS_ENABLED
diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp
index 7cbc145084..f5bfce3ef8 100644
--- a/scene/resources/bit_mask.cpp
+++ b/scene/resources/bit_mask.cpp
@@ -204,57 +204,3 @@ BitMap::BitMap() {
//////////////////////////////////////
-
-RES ResourceFormatLoaderBitMap::load(const String &p_path, const String& p_original_path, Error *r_error) {
-
- if (r_error)
- *r_error=ERR_FILE_CANT_OPEN;
-
- BitMap* ptr = memnew(BitMap);
- Ref<BitMap> bitmap( ptr );
-
-
- Image image;
-
- Error err = ImageLoader::load_image(p_path,&image);
-
- ERR_EXPLAIN("Failed loading image for BitMap: "+p_path);
- ERR_FAIL_COND_V(err, RES());
-
- bitmap->create_from_image_alpha(image);
- if (r_error)
- *r_error=OK;
-
- return bitmap;
-
-}
-
-bool ResourceFormatLoaderBitMap::handles_type(const String& p_type) const {
-
- return (p_type=="BitMap");
-}
-
-void ResourceFormatLoaderBitMap::get_recognized_extensions(List<String> *p_extensions) const {
-
- ImageLoader::get_recognized_extensions(p_extensions);
-}
-
-String ResourceFormatLoaderBitMap::get_resource_type(const String &p_path) const {
-
- List<String> extensions;
- ImageLoader::get_recognized_extensions(&extensions);
- String ext=p_path.extension().to_lower();
- for(List<String>::Element *E=extensions.front();E;E=E->next()) {
- if (E->get()==ext)
- return "BitMap";
- }
- return "";
-}
-
-
-ResourceFormatLoaderBitMap::ResourceFormatLoaderBitMap() {
-
-
-}
-
-
diff --git a/scene/resources/bit_mask.h b/scene/resources/bit_mask.h
index 66623f55c8..b245ea1542 100644
--- a/scene/resources/bit_mask.h
+++ b/scene/resources/bit_mask.h
@@ -62,16 +62,5 @@ public:
BitMap();
};
-class ResourceFormatLoaderBitMap : public ResourceFormatLoader {
-
-public:
-
- virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL);
- virtual void get_recognized_extensions(List<String> *p_extensions) const;
- virtual bool handles_type(const String& p_type) const;
- virtual String get_resource_type(const String &p_path) const;
-
- ResourceFormatLoaderBitMap();
-};
#endif // BIT_MASK_H
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 6076292bfb..f0b3519b4a 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -717,6 +717,7 @@ void make_default_theme() {
t->set_icon("increment_hilite","Tabs",make_icon( scroll_button_right_hl_png));
t->set_icon("decrement","Tabs",make_icon( scroll_button_left_png));
t->set_icon("decrement_hilite","Tabs",make_icon( scroll_button_left_hl_png));
+ t->set_icon("close","Tabs",make_icon( tab_close_png));
t->set_font("font","Tabs", default_font );
diff --git a/scene/resources/default_theme/tab_close.png b/scene/resources/default_theme/tab_close.png
new file mode 100644
index 0000000000..10e56d5bb8
--- /dev/null
+++ b/scene/resources/default_theme/tab_close.png
Binary files differ
diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h
index c1fac47724..e0b5736d99 100644
--- a/scene/resources/default_theme/theme_data.h
+++ b/scene/resources/default_theme/theme_data.h
@@ -399,6 +399,11 @@ static const unsigned char tab_behind_png[]={
};
+static const unsigned char tab_close_png[]={
+0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0,0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x1,0x1b,0x49,0x44,0x41,0x54,0x38,0x8d,0xcd,0x52,0xbb,0x4e,0xc4,0x40,0xc,0x9c,0x73,0xd2,0x50,0x38,0xd1,0x8a,0x82,0x36,0x3d,0x8,0xc4,0x43,0x88,0x13,0x12,0x20,0xf8,0x67,0x8a,0xfb,0x1,0xe,0x89,0x13,0x3d,0x47,0xb1,0x7f,0xb0,0x85,0x53,0x41,0xce,0xa6,0xd9,0x45,0xbe,0x24,0x1f,0x70,0x96,0x56,0x96,0xed,0x9d,0x91,0x3d,0x36,0x70,0x50,0x96,0x52,0xaa,0xbd,0x1f,0xd5,0xaa,0xb9,0x1a,0x79,0xb0,0x99,0x9d,0xc4,0x18,0x4d,0x55,0x2f,0xfd,0xc7,0x94,0x12,0xa9,0xea,0x53,0x8c,0xd1,0xcc,0xac,0xf1,0xb5,0x85,0x67,0x8b,0x31,0x1a,0x0,0x5,0x40,0xcc,0x7c,0x4b,0x44,0x9f,0x0,0x54,0x55,0x5f,0x44,0x64,0x5,0x60,0x7,0xa0,0xea,0xba,0x6e,0x31,0x21,0x48,0x29,0xd5,0xaa,0x7a,0x25,0x22,0xef,0x25,0xc7,0xcc,0x4b,0x33,0xb,0x7d,0xdf,0xbf,0xba,0xdc,0x29,0x11,0x7d,0x85,0x10,0x86,0x49,0x7,0x99,0xe4,0x5a,0x44,0xd6,0x73,0x1a,0x65,0xf0,0x77,0x8,0xe1,0x67,0xa2,0x1,0x0,0x84,0x10,0x6,0x22,0xda,0x30,0xf3,0x7d,0x4e,0x59,0x7e,0x60,0xe6,0xb,0x22,0xda,0x7a,0xf0,0x84,0x20,0x9b,0x9a,0x59,0xeb,0xe2,0xd2,0x65,0x53,0xc8,0x30,0x53,0x2c,0x23,0x54,0xaa,0xfa,0x9c,0x5,0x9b,0x1b,0xe1,0x8e,0x88,0x36,0x65,0xfe,0xbd,0xe,0x32,0xf8,0xd1,0x83,0x99,0xf9,0x9c,0x99,0x1f,0x4a,0x2c,0x22,0xeb,0xf1,0x8a,0xe7,0xd6,0xb8,0x3,0x50,0x65,0xc1,0xb6,0x0,0x4c,0x55,0x6f,0x44,0xe4,0xd,0xc0,0x0,0xa0,0xf6,0x6b,0xdc,0x3b,0xa4,0xa6,0x69,0x8e,0x33,0xf8,0x2c,0xab,0xfd,0x9b,0x85,0xfd,0x60,0xe6,0x25,0x80,0xaa,0x6d,0xdb,0xa3,0xb9,0x4b,0xfd,0x27,0xf1,0x7e,0xac,0x8f,0xf7,0x87,0x63,0x7f,0xc3,0xca,0xa9,0x49,0x35,0x25,0x97,0x14,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
+};
+
+
static const unsigned char tab_container_bg_png[]={
0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0xa,0x45,0x69,0x43,0x43,0x50,0x49,0x43,0x43,0x20,0x70,0x72,0x6f,0x66,0x69,0x6c,0x65,0x0,0x0,0x78,0xda,0x9d,0x53,0x67,0x54,0x53,0xe9,0x16,0x3d,0xf7,0xde,0xf4,0x42,0x4b,0x88,0x80,0x94,0x4b,0x6f,0x52,0x15,0x8,0x20,0x52,0x42,0x8b,0x80,0x14,0x91,0x26,0x2a,0x21,0x9,0x10,0x4a,0x88,0x21,0xa1,0xd9,0x15,0x51,0xc1,0x11,0x45,0x45,0x4,0x1b,0xc8,0xa0,0x88,0x3,0x8e,0x8e,0x80,0x8c,0x15,0x51,0x2c,0xc,0x8a,0xa,0xd8,0x7,0xe4,0x21,0xa2,0x8e,0x83,0xa3,0x88,0x8a,0xca,0xfb,0xe1,0x7b,0xa3,0x6b,0xd6,0xbc,0xf7,0xe6,0xcd,0xfe,0xb5,0xd7,0x3e,0xe7,0xac,0xf3,0x9d,0xb3,0xcf,0x7,0xc0,0x8,0xc,0x96,0x48,0x33,0x51,0x35,0x80,0xc,0xa9,0x42,0x1e,0x11,0xe0,0x83,0xc7,0xc4,0xc6,0xe1,0xe4,0x2e,0x40,0x81,0xa,0x24,0x70,0x0,0x10,0x8,0xb3,0x64,0x21,0x73,0xfd,0x23,0x1,0x0,0xf8,0x7e,0x3c,0x3c,0x2b,0x22,0xc0,0x7,0xbe,0x0,0x1,0x78,0xd3,0xb,0x8,0x0,0xc0,0x4d,0x9b,0xc0,0x30,0x1c,0x87,0xff,0xf,0xea,0x42,0x99,0x5c,0x1,0x80,0x84,0x1,0xc0,0x74,0x91,0x38,0x4b,0x8,0x80,0x14,0x0,0x40,0x7a,0x8e,0x42,0xa6,0x0,0x40,0x46,0x1,0x80,0x9d,0x98,0x26,0x53,0x0,0xa0,0x4,0x0,0x60,0xcb,0x63,0x62,0xe3,0x0,0x50,0x2d,0x0,0x60,0x27,0x7f,0xe6,0xd3,0x0,0x80,0x9d,0xf8,0x99,0x7b,0x1,0x0,0x5b,0x94,0x21,0x15,0x1,0xa0,0x91,0x0,0x20,0x13,0x65,0x88,0x44,0x0,0x68,0x3b,0x0,0xac,0xcf,0x56,0x8a,0x45,0x0,0x58,0x30,0x0,0x14,0x66,0x4b,0xc4,0x39,0x0,0xd8,0x2d,0x0,0x30,0x49,0x57,0x66,0x48,0x0,0xb0,0xb7,0x0,0xc0,0xce,0x10,0xb,0xb2,0x0,0x8,0xc,0x0,0x30,0x51,0x88,0x85,0x29,0x0,0x4,0x7b,0x0,0x60,0xc8,0x23,0x23,0x78,0x0,0x84,0x99,0x0,0x14,0x46,0xf2,0x57,0x3c,0xf1,0x2b,0xae,0x10,0xe7,0x2a,0x0,0x0,0x78,0x99,0xb2,0x3c,0xb9,0x24,0x39,0x45,0x81,0x5b,0x8,0x2d,0x71,0x7,0x57,0x57,0x2e,0x1e,0x28,0xce,0x49,0x17,0x2b,0x14,0x36,0x61,0x2,0x61,0x9a,0x40,0x2e,0xc2,0x79,0x99,0x19,0x32,0x81,0x34,0xf,0xe0,0xf3,0xcc,0x0,0x0,0xa0,0x91,0x15,0x11,0xe0,0x83,0xf3,0xfd,0x78,0xce,0xe,0xae,0xce,0xce,0x36,0x8e,0xb6,0xe,0x5f,0x2d,0xea,0xbf,0x6,0xff,0x22,0x62,0x62,0xe3,0xfe,0xe5,0xcf,0xab,0x70,0x40,0x0,0x0,0xe1,0x74,0x7e,0xd1,0xfe,0x2c,0x2f,0xb3,0x1a,0x80,0x3b,0x6,0x80,0x6d,0xfe,0xa2,0x25,0xee,0x4,0x68,0x5e,0xb,0xa0,0x75,0xf7,0x8b,0x66,0xb2,0xf,0x40,0xb5,0x0,0xa0,0xe9,0xda,0x57,0xf3,0x70,0xf8,0x7e,0x3c,0x3c,0x45,0xa1,0x90,0xb9,0xd9,0xd9,0xe5,0xe4,0xe4,0xd8,0x4a,0xc4,0x42,0x5b,0x61,0xca,0x57,0x7d,0xfe,0x67,0xc2,0x5f,0xc0,0x57,0xfd,0x6c,0xf9,0x7e,0x3c,0xfc,0xf7,0xf5,0xe0,0xbe,0xe2,0x24,0x81,0x32,0x5d,0x81,0x47,0x4,0xf8,0xe0,0xc2,0xcc,0xf4,0x4c,0xa5,0x1c,0xcf,0x92,0x9,0x84,0x62,0xdc,0xe6,0x8f,0x47,0xfc,0xb7,0xb,0xff,0xfc,0x1d,0xd3,0x22,0xc4,0x49,0x62,0xb9,0x58,0x2a,0x14,0xe3,0x51,0x12,0x71,0x8e,0x44,0x9a,0x8c,0xf3,0x32,0xa5,0x22,0x89,0x42,0x92,0x29,0xc5,0x25,0xd2,0xff,0x64,0xe2,0xdf,0x2c,0xfb,0x3,0x3e,0xdf,0x35,0x0,0xb0,0x6a,0x3e,0x1,0x7b,0x91,0x2d,0xa8,0x5d,0x63,0x3,0xf6,0x4b,0x27,0x10,0x58,0x74,0xc0,0xe2,0xf7,0x0,0x0,0xf2,0xbb,0x6f,0xc1,0xd4,0x28,0x8,0x3,0x80,0x68,0x83,0xe1,0xcf,0x77,0xff,0xef,0x3f,0xfd,0x47,0xa0,0x25,0x0,0x80,0x66,0x49,0x92,0x71,0x0,0x0,0x5e,0x44,0x24,0x2e,0x54,0xca,0xb3,0x3f,0xc7,0x8,0x0,0x0,0x44,0xa0,0x81,0x2a,0xb0,0x41,0x1b,0xf4,0xc1,0x18,0x2c,0xc0,0x6,0x1c,0xc1,0x5,0xdc,0xc1,0xb,0xfc,0x60,0x36,0x84,0x42,0x24,0xc4,0xc2,0x42,0x10,0x42,0xa,0x64,0x80,0x1c,0x72,0x60,0x29,0xac,0x82,0x42,0x28,0x86,0xcd,0xb0,0x1d,0x2a,0x60,0x2f,0xd4,0x40,0x1d,0x34,0xc0,0x51,0x68,0x86,0x93,0x70,0xe,0x2e,0xc2,0x55,0xb8,0xe,0x3d,0x70,0xf,0xfa,0x61,0x8,0x9e,0xc1,0x28,0xbc,0x81,0x9,0x4,0x41,0xc8,0x8,0x13,0x61,0x21,0xda,0x88,0x1,0x62,0x8a,0x58,0x23,0x8e,0x8,0x17,0x99,0x85,0xf8,0x21,0xc1,0x48,0x4,0x12,0x8b,0x24,0x20,0xc9,0x88,0x14,0x51,0x22,0x4b,0x91,0x35,0x48,0x31,0x52,0x8a,0x54,0x20,0x55,0x48,0x1d,0xf2,0x3d,0x72,0x2,0x39,0x87,0x5c,0x46,0xba,0x91,0x3b,0xc8,0x0,0x32,0x82,0xfc,0x86,0xbc,0x47,0x31,0x94,0x81,0xb2,0x51,0x3d,0xd4,0xc,0xb5,0x43,0xb9,0xa8,0x37,0x1a,0x84,0x46,0xa2,0xb,0xd0,0x64,0x74,0x31,0x9a,0x8f,0x16,0xa0,0x9b,0xd0,0x72,0xb4,0x1a,0x3d,0x8c,0x36,0xa1,0xe7,0xd0,0xab,0x68,0xf,0xda,0x8f,0x3e,0x43,0xc7,0x30,0xc0,0xe8,0x18,0x7,0x33,0xc4,0x6c,0x30,0x2e,0xc6,0xc3,0x42,0xb1,0x38,0x2c,0x9,0x93,0x63,0xcb,0xb1,0x22,0xac,0xc,0xab,0xc6,0x1a,0xb0,0x56,0xac,0x3,0xbb,0x89,0xf5,0x63,0xcf,0xb1,0x77,0x4,0x12,0x81,0x45,0xc0,0x9,0x36,0x4,0x77,0x42,0x20,0x61,0x1e,0x41,0x48,0x58,0x4c,0x58,0x4e,0xd8,0x48,0xa8,0x20,0x1c,0x24,0x34,0x11,0xda,0x9,0x37,0x9,0x3,0x84,0x51,0xc2,0x27,0x22,0x93,0xa8,0x4b,0xb4,0x26,0xba,0x11,0xf9,0xc4,0x18,0x62,0x32,0x31,0x87,0x58,0x48,0x2c,0x23,0xd6,0x12,0x8f,0x13,0x2f,0x10,0x7b,0x88,0x43,0xc4,0x37,0x24,0x12,0x89,0x43,0x32,0x27,0xb9,0x90,0x2,0x49,0xb1,0xa4,0x54,0xd2,0x12,0xd2,0x46,0xd2,0x6e,0x52,0x23,0xe9,0x2c,0xa9,0x9b,0x34,0x48,0x1a,0x23,0x93,0xc9,0xda,0x64,0x6b,0xb2,0x7,0x39,0x94,0x2c,0x20,0x2b,0xc8,0x85,0xe4,0x9d,0xe4,0xc3,0xe4,0x33,0xe4,0x1b,0xe4,0x21,0xf2,0x5b,0xa,0x9d,0x62,0x40,0x71,0xa4,0xf8,0x53,0xe2,0x28,0x52,0xca,0x6a,0x4a,0x19,0xe5,0x10,0xe5,0x34,0xe5,0x6,0x65,0x98,0x32,0x41,0x55,0xa3,0x9a,0x52,0xdd,0xa8,0xa1,0x54,0x11,0x35,0x8f,0x5a,0x42,0xad,0xa1,0xb6,0x52,0xaf,0x51,0x87,0xa8,0x13,0x34,0x75,0x9a,0x39,0xcd,0x83,0x16,0x49,0x4b,0xa5,0xad,0xa2,0x95,0xd3,0x1a,0x68,0x17,0x68,0xf7,0x69,0xaf,0xe8,0x74,0xba,0x11,0xdd,0x95,0x1e,0x4e,0x97,0xd0,0x57,0xd2,0xcb,0xe9,0x47,0xe8,0x97,0xe8,0x3,0xf4,0x77,0xc,0xd,0x86,0x15,0x83,0xc7,0x88,0x67,0x28,0x19,0x9b,0x18,0x7,0x18,0x67,0x19,0x77,0x18,0xaf,0x98,0x4c,0xa6,0x19,0xd3,0x8b,0x19,0xc7,0x54,0x30,0x37,0x31,0xeb,0x98,0xe7,0x99,0xf,0x99,0x6f,0x55,0x58,0x2a,0xb6,0x2a,0x7c,0x15,0x91,0xca,0xa,0x95,0x4a,0x95,0x26,0x95,0x1b,0x2a,0x2f,0x54,0xa9,0xaa,0xa6,0xaa,0xde,0xaa,0xb,0x55,0xf3,0x55,0xcb,0x54,0x8f,0xa9,0x5e,0x53,0x7d,0xae,0x46,0x55,0x33,0x53,0xe3,0xa9,0x9,0xd4,0x96,0xab,0x55,0xaa,0x9d,0x50,0xeb,0x53,0x1b,0x53,0x67,0xa9,0x3b,0xa8,0x87,0xaa,0x67,0xa8,0x6f,0x54,0x3f,0xa4,0x7e,0x59,0xfd,0x89,0x6,0x59,0xc3,0x4c,0xc3,0x4f,0x43,0xa4,0x51,0xa0,0xb1,0x5f,0xe3,0xbc,0xc6,0x20,0xb,0x63,0x19,0xb3,0x78,0x2c,0x21,0x6b,0xd,0xab,0x86,0x75,0x81,0x35,0xc4,0x26,0xb1,0xcd,0xd9,0x7c,0x76,0x2a,0xbb,0x98,0xfd,0x1d,0xbb,0x8b,0x3d,0xaa,0xa9,0xa1,0x39,0x43,0x33,0x4a,0x33,0x57,0xb3,0x52,0xf3,0x94,0x66,0x3f,0x7,0xe3,0x98,0x71,0xf8,0x9c,0x74,0x4e,0x9,0xe7,0x28,0xa7,0x97,0xf3,0x7e,0x8a,0xde,0x14,0xef,0x29,0xe2,0x29,0x1b,0xa6,0x34,0x4c,0xb9,0x31,0x65,0x5c,0x6b,0xaa,0x96,0x97,0x96,0x58,0xab,0x48,0xab,0x51,0xab,0x47,0xeb,0xbd,0x36,0xae,0xed,0xa7,0x9d,0xa6,0xbd,0x45,0xbb,0x59,0xfb,0x81,0xe,0x41,0xc7,0x4a,0x27,0x5c,0x27,0x47,0x67,0x8f,0xce,0x5,0x9d,0xe7,0x53,0xd9,0x53,0xdd,0xa7,0xa,0xa7,0x16,0x4d,0x3d,0x3a,0xf5,0xae,0x2e,0xaa,0x6b,0xa5,0x1b,0xa1,0xbb,0x44,0x77,0xbf,0x6e,0xa7,0xee,0x98,0x9e,0xbe,0x5e,0x80,0x9e,0x4c,0x6f,0xa7,0xde,0x79,0xbd,0xe7,0xfa,0x1c,0x7d,0x2f,0xfd,0x54,0xfd,0x6d,0xfa,0xa7,0xf5,0x47,0xc,0x58,0x6,0xb3,0xc,0x24,0x6,0xdb,0xc,0xce,0x18,0x3c,0xc5,0x35,0x71,0x6f,0x3c,0x1d,0x2f,0xc7,0xdb,0xf1,0x51,0x43,0x5d,0xc3,0x40,0x43,0xa5,0x61,0x95,0x61,0x97,0xe1,0x84,0x91,0xb9,0xd1,0x3c,0xa3,0xd5,0x46,0x8d,0x46,0xf,0x8c,0x69,0xc6,0x5c,0xe3,0x24,0xe3,0x6d,0xc6,0x6d,0xc6,0xa3,0x26,0x6,0x26,0x21,0x26,0x4b,0x4d,0xea,0x4d,0xee,0x9a,0x52,0x4d,0xb9,0xa6,0x29,0xa6,0x3b,0x4c,0x3b,0x4c,0xc7,0xcd,0xcc,0xcd,0xa2,0xcd,0xd6,0x99,0x35,0x9b,0x3d,0x31,0xd7,0x32,0xe7,0x9b,0xe7,0x9b,0xd7,0x9b,0xdf,0xb7,0x60,0x5a,0x78,0x5a,0x2c,0xb6,0xa8,0xb6,0xb8,0x65,0x49,0xb2,0xe4,0x5a,0xa6,0x59,0xee,0xb6,0xbc,0x6e,0x85,0x5a,0x39,0x59,0xa5,0x58,0x55,0x5a,0x5d,0xb3,0x46,0xad,0x9d,0xad,0x25,0xd6,0xbb,0xad,0xbb,0xa7,0x11,0xa7,0xb9,0x4e,0x93,0x4e,0xab,0x9e,0xd6,0x67,0xc3,0xb0,0xf1,0xb6,0xc9,0xb6,0xa9,0xb7,0x19,0xb0,0xe5,0xd8,0x6,0xdb,0xae,0xb6,0x6d,0xb6,0x7d,0x61,0x67,0x62,0x17,0x67,0xb7,0xc5,0xae,0xc3,0xee,0x93,0xbd,0x93,0x7d,0xba,0x7d,0x8d,0xfd,0x3d,0x7,0xd,0x87,0xd9,0xe,0xab,0x1d,0x5a,0x1d,0x7e,0x73,0xb4,0x72,0x14,0x3a,0x56,0x3a,0xde,0x9a,0xce,0x9c,0xee,0x3f,0x7d,0xc5,0xf4,0x96,0xe9,0x2f,0x67,0x58,0xcf,0x10,0xcf,0xd8,0x33,0xe3,0xb6,0x13,0xcb,0x29,0xc4,0x69,0x9d,0x53,0x9b,0xd3,0x47,0x67,0x17,0x67,0xb9,0x73,0x83,0xf3,0x88,0x8b,0x89,0x4b,0x82,0xcb,0x2e,0x97,0x3e,0x2e,0x9b,0x1b,0xc6,0xdd,0xc8,0xbd,0xe4,0x4a,0x74,0xf5,0x71,0x5d,0xe1,0x7a,0xd2,0xf5,0x9d,0x9b,0xb3,0x9b,0xc2,0xed,0xa8,0xdb,0xaf,0xee,0x36,0xee,0x69,0xee,0x87,0xdc,0x9f,0xcc,0x34,0x9f,0x29,0x9e,0x59,0x33,0x73,0xd0,0xc3,0xc8,0x43,0xe0,0x51,0xe5,0xd1,0x3f,0xb,0x9f,0x95,0x30,0x6b,0xdf,0xac,0x7e,0x4f,0x43,0x4f,0x81,0x67,0xb5,0xe7,0x23,0x2f,0x63,0x2f,0x91,0x57,0xad,0xd7,0xb0,0xb7,0xa5,0x77,0xaa,0xf7,0x61,0xef,0x17,0x3e,0xf6,0x3e,0x72,0x9f,0xe3,0x3e,0xe3,0x3c,0x37,0xde,0x32,0xde,0x59,0x5f,0xcc,0x37,0xc0,0xb7,0xc8,0xb7,0xcb,0x4f,0xc3,0x6f,0x9e,0x5f,0x85,0xdf,0x43,0x7f,0x23,0xff,0x64,0xff,0x7a,0xff,0xd1,0x0,0xa7,0x80,0x25,0x1,0x67,0x3,0x89,0x81,0x41,0x81,0x5b,0x2,0xfb,0xf8,0x7a,0x7c,0x21,0xbf,0x8e,0x3f,0x3a,0xdb,0x65,0xf6,0xb2,0xd9,0xed,0x41,0x8c,0xa0,0xb9,0x41,0x15,0x41,0x8f,0x82,0xad,0x82,0xe5,0xc1,0xad,0x21,0x68,0xc8,0xec,0x90,0xad,0x21,0xf7,0xe7,0x98,0xce,0x91,0xce,0x69,0xe,0x85,0x50,0x7e,0xe8,0xd6,0xd0,0x7,0x61,0xe6,0x61,0x8b,0xc3,0x7e,0xc,0x27,0x85,0x87,0x85,0x57,0x86,0x3f,0x8e,0x70,0x88,0x58,0x1a,0xd1,0x31,0x97,0x35,0x77,0xd1,0xdc,0x43,0x73,0xdf,0x44,0xfa,0x44,0x96,0x44,0xde,0x9b,0x67,0x31,0x4f,0x39,0xaf,0x2d,0x4a,0x35,0x2a,0x3e,0xaa,0x2e,0x6a,0x3c,0xda,0x37,0xba,0x34,0xba,0x3f,0xc6,0x2e,0x66,0x59,0xcc,0xd5,0x58,0x9d,0x58,0x49,0x6c,0x4b,0x1c,0x39,0x2e,0x2a,0xae,0x36,0x6e,0x6c,0xbe,0xdf,0xfc,0xed,0xf3,0x87,0xe2,0x9d,0xe2,0xb,0xe3,0x7b,0x17,0x98,0x2f,0xc8,0x5d,0x70,0x79,0xa1,0xce,0xc2,0xf4,0x85,0xa7,0x16,0xa9,0x2e,0x12,0x2c,0x3a,0x96,0x40,0x4c,0x88,0x4e,0x38,0x94,0xf0,0x41,0x10,0x2a,0xa8,0x16,0x8c,0x25,0xf2,0x13,0x77,0x25,0x8e,0xa,0x79,0xc2,0x1d,0xc2,0x67,0x22,0x2f,0xd1,0x36,0xd1,0x88,0xd8,0x43,0x5c,0x2a,0x1e,0x4e,0xf2,0x48,0x2a,0x4d,0x7a,0x92,0xec,0x91,0xbc,0x35,0x79,0x24,0xc5,0x33,0xa5,0x2c,0xe5,0xb9,0x84,0x27,0xa9,0x90,0xbc,0x4c,0xd,0x4c,0xdd,0x9b,0x3a,0x9e,0x16,0x9a,0x76,0x20,0x6d,0x32,0x3d,0x3a,0xbd,0x31,0x83,0x92,0x91,0x90,0x71,0x42,0xaa,0x21,0x4d,0x93,0xb6,0x67,0xea,0x67,0xe6,0x66,0x76,0xcb,0xac,0x65,0x85,0xb2,0xfe,0xc5,0x6e,0x8b,0xb7,0x2f,0x1e,0x95,0x7,0xc9,0x6b,0xb3,0x90,0xac,0x5,0x59,0x2d,0xa,0xb6,0x42,0xa6,0xe8,0x54,0x5a,0x28,0xd7,0x2a,0x7,0xb2,0x67,0x65,0x57,0x66,0xbf,0xcd,0x89,0xca,0x39,0x96,0xab,0x9e,0x2b,0xcd,0xed,0xcc,0xb3,0xca,0xdb,0x90,0x37,0x9c,0xef,0x9f,0xff,0xed,0x12,0xc2,0x12,0xe1,0x92,0xb6,0xa5,0x86,0x4b,0x57,0x2d,0x1d,0x58,0xe6,0xbd,0xac,0x6a,0x39,0xb2,0x3c,0x71,0x79,0xdb,0xa,0xe3,0x15,0x5,0x2b,0x86,0x56,0x6,0xac,0x3c,0xb8,0x8a,0xb6,0x2a,0x6d,0xd5,0x4f,0xab,0xed,0x57,0x97,0xae,0x7e,0xbd,0x26,0x7a,0x4d,0x6b,0x81,0x5e,0xc1,0xca,0x82,0xc1,0xb5,0x1,0x6b,0xeb,0xb,0x55,0xa,0xe5,0x85,0x7d,0xeb,0xdc,0xd7,0xed,0x5d,0x4f,0x58,0x2f,0x59,0xdf,0xb5,0x61,0xfa,0x86,0x9d,0x1b,0x3e,0x15,0x89,0x8a,0xae,0x14,0xdb,0x17,0x97,0x15,0x7f,0xd8,0x28,0xdc,0x78,0xe5,0x1b,0x87,0x6f,0xca,0xbf,0x99,0xdc,0x94,0xb4,0xa9,0xab,0xc4,0xb9,0x64,0xcf,0x66,0xd2,0x66,0xe9,0xe6,0xde,0x2d,0x9e,0x5b,0xe,0x96,0xaa,0x97,0xe6,0x97,0xe,0x6e,0xd,0xd9,0xda,0xb4,0xd,0xdf,0x56,0xb4,0xed,0xf5,0xf6,0x45,0xdb,0x2f,0x97,0xcd,0x28,0xdb,0xbb,0x83,0xb6,0x43,0xb9,0xa3,0xbf,0x3c,0xb8,0xbc,0x65,0xa7,0xc9,0xce,0xcd,0x3b,0x3f,0x54,0xa4,0x54,0xf4,0x54,0xfa,0x54,0x36,0xee,0xd2,0xdd,0xb5,0x61,0xd7,0xf8,0x6e,0xd1,0xee,0x1b,0x7b,0xbc,0xf6,0x34,0xec,0xd5,0xdb,0x5b,0xbc,0xf7,0xfd,0x3e,0xc9,0xbe,0xdb,0x55,0x1,0x55,0x4d,0xd5,0x66,0xd5,0x65,0xfb,0x49,0xfb,0xb3,0xf7,0x3f,0xae,0x89,0xaa,0xe9,0xf8,0x96,0xfb,0x6d,0x5d,0xad,0x4e,0x6d,0x71,0xed,0xc7,0x3,0xd2,0x3,0xfd,0x7,0x23,0xe,0xb6,0xd7,0xb9,0xd4,0xd5,0x1d,0xd2,0x3d,0x54,0x52,0x8f,0xd6,0x2b,0xeb,0x47,0xe,0xc7,0x1f,0xbe,0xfe,0x9d,0xef,0x77,0x2d,0xd,0x36,0xd,0x55,0x8d,0x9c,0xc6,0xe2,0x23,0x70,0x44,0x79,0xe4,0xe9,0xf7,0x9,0xdf,0xf7,0x1e,0xd,0x3a,0xda,0x76,0x8c,0x7b,0xac,0xe1,0x7,0xd3,0x1f,0x76,0x1d,0x67,0x1d,0x2f,0x6a,0x42,0x9a,0xf2,0x9a,0x46,0x9b,0x53,0x9a,0xfb,0x5b,0x62,0x5b,0xba,0x4f,0xcc,0x3e,0xd1,0xd6,0xea,0xde,0x7a,0xfc,0x47,0xdb,0x1f,0xf,0x9c,0x34,0x3c,0x59,0x79,0x4a,0xf3,0x54,0xc9,0x69,0xda,0xe9,0x82,0xd3,0x93,0x67,0xf2,0xcf,0x8c,0x9d,0x95,0x9d,0x7d,0x7e,0x2e,0xf9,0xdc,0x60,0xdb,0xa2,0xb6,0x7b,0xe7,0x63,0xce,0xdf,0x6a,0xf,0x6f,0xef,0xba,0x10,0x74,0xe1,0xd2,0x45,0xff,0x8b,0xe7,0x3b,0xbc,0x3b,0xce,0x5c,0xf2,0xb8,0x74,0xf2,0xb2,0xdb,0xe5,0x13,0x57,0xb8,0x57,0x9a,0xaf,0x3a,0x5f,0x6d,0xea,0x74,0xea,0x3c,0xfe,0x93,0xd3,0x4f,0xc7,0xbb,0x9c,0xbb,0x9a,0xae,0xb9,0x5c,0x6b,0xb9,0xee,0x7a,0xbd,0xb5,0x7b,0x66,0xf7,0xe9,0x1b,0x9e,0x37,0xce,0xdd,0xf4,0xbd,0x79,0xf1,0x16,0xff,0xd6,0xd5,0x9e,0x39,0x3d,0xdd,0xbd,0xf3,0x7a,0x6f,0xf7,0xc5,0xf7,0xf5,0xdf,0x16,0xdd,0x7e,0x72,0x27,0xfd,0xce,0xcb,0xbb,0xd9,0x77,0x27,0xee,0xad,0xbc,0x4f,0xbc,0x5f,0xf4,0x40,0xed,0x41,0xd9,0x43,0xdd,0x87,0xd5,0x3f,0x5b,0xfe,0xdc,0xd8,0xef,0xdc,0x7f,0x6a,0xc0,0x77,0xa0,0xf3,0xd1,0xdc,0x47,0xf7,0x6,0x85,0x83,0xcf,0xfe,0x91,0xf5,0x8f,0xf,0x43,0x5,0x8f,0x99,0x8f,0xcb,0x86,0xd,0x86,0xeb,0x9e,0x38,0x3e,0x39,0x39,0xe2,0x3f,0x72,0xfd,0xe9,0xfc,0xa7,0x43,0xcf,0x64,0xcf,0x26,0x9e,0x17,0xfe,0xa2,0xfe,0xcb,0xae,0x17,0x16,0x2f,0x7e,0xf8,0xd5,0xeb,0xd7,0xce,0xd1,0x98,0xd1,0xa1,0x97,0xf2,0x97,0x93,0xbf,0x6d,0x7c,0xa5,0xfd,0xea,0xc0,0xeb,0x19,0xaf,0xdb,0xc6,0xc2,0xc6,0x1e,0xbe,0xc9,0x78,0x33,0x31,0x5e,0xf4,0x56,0xfb,0xed,0xc1,0x77,0xdc,0x77,0x1d,0xef,0xa3,0xdf,0xf,0x4f,0xe4,0x7c,0x20,0x7f,0x28,0xff,0x68,0xf9,0xb1,0xf5,0x53,0xd0,0xa7,0xfb,0x93,0x19,0x93,0x93,0xff,0x4,0x3,0x98,0xf3,0xfc,0xef,0x35,0x94,0x82,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xdf,0xa,0x15,0x0,0x5,0x21,0x33,0xd5,0x5f,0x4d,0x0,0x0,0x1,0x3a,0x49,0x44,0x41,0x54,0x38,0xcb,0xa5,0x93,0x41,0x4a,0x3,0x51,0xc,0x86,0xbf,0x37,0xef,0xd1,0x11,0x5d,0x74,0x40,0xc1,0x5a,0xea,0x45,0xc4,0xa5,0x27,0xf0,0x34,0x73,0x84,0xe2,0x61,0x3c,0x81,0xee,0xc4,0x8b,0x8,0x76,0xd3,0xea,0x14,0x5a,0xe8,0x74,0xde,0x4b,0x5c,0x4c,0x46,0x2a,0xd4,0x3a,0xc5,0x40,0x20,0x8b,0xe4,0x4f,0xfe,0xf0,0xff,0xe,0x8,0xc0,0x0,0xc8,0x81,0x13,0xab,0x3d,0x90,0xf1,0x33,0x4,0x48,0xc0,0x16,0xd8,0x0,0x35,0xb0,0xed,0x86,0xcf,0x80,0x2,0x18,0x5a,0x9d,0x3,0xce,0x12,0x40,0x2d,0x6b,0x60,0xd,0x2c,0x81,0xa,0xdb,0x9e,0x3,0xc5,0xed,0xcd,0xdd,0xfd,0xf8,0xea,0xba,0x8c,0x29,0x16,0xaa,0xec,0xd,0xe7,0x20,0xf8,0x50,0xbd,0xcf,0xde,0xa6,0x2f,0xaf,0x4f,0x8f,0x40,0xc,0x76,0xf6,0x70,0x3c,0x9a,0x94,0xd5,0xe7,0xa2,0x88,0x31,0xa2,0xec,0x47,0x70,0x38,0x42,0x8,0xc5,0x78,0x34,0x29,0x81,0x67,0x60,0xf5,0x4d,0xa1,0x89,0x4d,0xd1,0xc4,0xe6,0xd7,0xe1,0x96,0x87,0xd2,0xc4,0x86,0x26,0x36,0x85,0x51,0x1d,0x4,0x7b,0x58,0x2e,0x22,0x88,0xa,0x7f,0x85,0xa2,0x88,0x8,0x46,0xdd,0x7,0xfb,0xb6,0x53,0x51,0x54,0x94,0x3e,0x61,0x7d,0xe,0xc8,0x42,0x47,0x2f,0x69,0xea,0x75,0x1,0x40,0xd2,0xd4,0x1,0x10,0x76,0x51,0x55,0x8f,0xba,0x80,0x5d,0x0,0x55,0x3d,0x2,0xa0,0xed,0xd3,0xe,0x40,0x5a,0xd0,0x84,0xf6,0xa4,0x20,0x2d,0x5,0x5,0x24,0x98,0x3c,0x6b,0x84,0xde,0x4f,0xa4,0xdd,0x53,0x3,0x29,0x33,0x6d,0xaf,0x71,0x59,0x95,0x79,0x8f,0xa8,0x1e,0xcc,0xcc,0x7b,0x70,0x59,0x65,0x92,0xde,0x6,0x33,0xc6,0x72,0xbe,0x98,0x4d,0x2f,0xce,0x2f,0xcb,0x24,0xa9,0xe0,0x80,0x96,0x7d,0x16,0x3e,0xe6,0x8b,0xd9,0x83,0xf9,0x61,0xe3,0x80,0xd3,0x7f,0x98,0x69,0x1d,0x8c,0x2,0x40,0x4,0x56,0xc7,0xda,0xf9,0xb,0x57,0x2d,0xbb,0xf5,0x2d,0xe4,0x89,0x1b,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
};
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index d2795bddb8..03127620f7 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -1597,6 +1597,16 @@ Node *PackedScene::instance(bool p_gen_edit_state) const {
return s;
}
+void PackedScene::replace_state(Ref<SceneState> p_by) {
+
+ state=p_by;
+ state->set_path(get_path());
+#ifdef TOOLS_ENABLED
+ state->set_last_modified_time(get_last_modified_time());
+#endif
+
+}
+
void PackedScene::recreate_state() {
state = Ref<SceneState>( memnew( SceneState ));
diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h
index 911ffd2542..00a812f16a 100644
--- a/scene/resources/packed_scene.h
+++ b/scene/resources/packed_scene.h
@@ -50,7 +50,6 @@ class SceneState : public Reference {
FLAG_INSTANCE_IS_PLACEHOLDER=(1<<30),
FLAG_MASK=(1<<24)-1,
NO_PARENT_SAVED=0x7FFFFFFF,
- TYPE_INSTANCED=0x7FFFFFFF,
};
@@ -106,6 +105,10 @@ class SceneState : public Reference {
static bool disable_placeholders;
public:
+ enum {
+ TYPE_INSTANCED=0x7FFFFFFF
+ };
+
static void set_disable_placeholders(bool p_disable);
int find_node_by_path(const NodePath& p_node) const;
@@ -195,6 +198,7 @@ public:
Node *instance(bool p_gen_edit_state=false) const;
void recreate_state();
+ void replace_state(Ref<SceneState> p_by);
virtual void set_path(const String& p_path,bool p_take_over=false);
#ifdef TOOLS_ENABLED
diff --git a/scene/resources/sample.cpp b/scene/resources/sample.cpp
index 0354cbc3b2..4b25a2c490 100644
--- a/scene/resources/sample.cpp
+++ b/scene/resources/sample.cpp
@@ -210,11 +210,11 @@ void Sample::_bind_methods(){
ADD_PROPERTY( PropertyInfo( Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"), _SCS("_get_data") );
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "stereo"), _SCS(""), _SCS("is_stereo") );
- ADD_PROPERTY( PropertyInfo( Variant::INT, "length"), _SCS(""), _SCS("get_length") );
+ ADD_PROPERTY( PropertyInfo( Variant::INT, "length",PROPERTY_HINT_RANGE,"0,999999999"), _SCS(""), _SCS("get_length") );
ADD_PROPERTY( PropertyInfo( Variant::INT, "mix_rate", PROPERTY_HINT_RANGE,"1,192000,1" ), _SCS("set_mix_rate"), _SCS("get_mix_rate") );
ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_format", PROPERTY_HINT_ENUM,"None,Forward,PingPong" ), _SCS("set_loop_format"), _SCS("get_loop_format") );
- ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_begin", PROPERTY_HINT_RANGE,"0,"+itos(99999999)+",1"), _SCS("set_loop_begin"), _SCS("get_loop_begin") );
- ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_end", PROPERTY_HINT_RANGE,"0,"+itos(99999999)+",1"), _SCS("set_loop_end"), _SCS("get_loop_end") );
+ ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_begin", PROPERTY_HINT_RANGE,"0,"+itos(999999999)+",1"), _SCS("set_loop_begin"), _SCS("get_loop_begin") );
+ ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_end", PROPERTY_HINT_RANGE,"0,"+itos(999999999)+",1"), _SCS("set_loop_end"), _SCS("get_loop_end") );
BIND_CONSTANT( FORMAT_PCM8 );
BIND_CONSTANT( FORMAT_PCM16 );
diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp
index aef11433dc..5450b9e2ac 100644
--- a/scene/resources/scene_format_text.cpp
+++ b/scene/resources/scene_format_text.cpp
@@ -302,6 +302,10 @@ Error ResourceInteractiveLoaderText::poll() {
if (error) {
if (error!=ERR_FILE_EOF) {
_printerr();
+ } else {
+ if (!ResourceCache::has(res_path)) {
+ resource->set_path(res_path);
+ }
}
return error;
}
@@ -362,18 +366,15 @@ Error ResourceInteractiveLoaderText::poll() {
parent=packed_scene->get_state()->add_node_path(next_tag.fields["parent"]);
}
- if (next_tag.fields.has("owner")) {
- owner=packed_scene->get_state()->add_node_path(next_tag.fields["owner"]);
- } else {
- if (parent!=-1)
- owner=0; //if no owner, owner is root
- }
if (next_tag.fields.has("type")) {
type=packed_scene->get_state()->add_name(next_tag.fields["type"]);
+ } else {
+ type=SceneState::TYPE_INSTANCED; //no type? assume this was instanced
}
+
if (next_tag.fields.has("instance")) {
instance=packed_scene->get_state()->add_value(next_tag.fields["instance"]);
@@ -384,6 +385,13 @@ Error ResourceInteractiveLoaderText::poll() {
}
}
+ if (next_tag.fields.has("owner")) {
+ owner=packed_scene->get_state()->add_node_path(next_tag.fields["owner"]);
+ } else {
+ if (parent!=-1 && !(type==SceneState::TYPE_INSTANCED && instance==-1))
+ owner=0; //if no owner, owner is root
+ }
+
int node_id = packed_scene->get_state()->add_node(parent,owner,type,name,instance);
@@ -399,6 +407,9 @@ Error ResourceInteractiveLoaderText::poll() {
_printerr();
} else {
resource=packed_scene;
+ if (!ResourceCache::has(res_path)) {
+ packed_scene->set_path(res_path);
+ }
}
return error;
}
@@ -473,8 +484,8 @@ Error ResourceInteractiveLoaderText::poll() {
}
Vector<int> bind_ints;
- for(int i=9;i<binds.size();i++) {
- bind_ints.push_back( packed_scene->get_state()->add_value( bind_ints[i] ) );
+ for(int i=0;i<binds.size();i++) {
+ bind_ints.push_back( packed_scene->get_state()->add_value( binds[i] ) );
}
packed_scene->get_state()->add_connection(
@@ -1366,10 +1377,10 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re
Array binds=state->get_connection_binds(i);
f->store_string(connstr);
- if (binds.size()) {
+ if (binds.size()) {
String vars;
VariantWriter::write_to_string(binds,vars,_write_resources,this);
- f->store_string("binds= "+vars);
+ f->store_string(" binds= "+vars);
}
diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp
index e485379182..eabc84c41e 100644
--- a/scene/resources/shader_graph.cpp
+++ b/scene/resources/shader_graph.cpp
@@ -1533,7 +1533,7 @@ const ShaderGraph::NodeSlotInfo ShaderGraph::node_slot_info[]= {
{NODE_CURVE_MAP,{SLOT_TYPE_SCALAR,SLOT_MAX},{SLOT_TYPE_SCALAR,SLOT_MAX}}, // vec3 interpolation (with optional curve)
{NODE_SCALAR_INPUT,{SLOT_MAX},{SLOT_TYPE_SCALAR,SLOT_MAX}}, // scalar uniform (assignable in material)
{NODE_VEC_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_MAX}}, // vec3 uniform (assignable in material)
- {NODE_RGB_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_MAX}}, // color uniform (assignable in material)
+ {NODE_RGB_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // color uniform (assignable in material)
{NODE_XFORM_INPUT,{SLOT_MAX},{SLOT_TYPE_XFORM,SLOT_MAX}}, // mat4 uniform (assignable in material)
{NODE_TEXTURE_INPUT,{SLOT_TYPE_VEC,SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // texture input (assignable in material)
{NODE_CUBEMAP_INPUT,{SLOT_TYPE_VEC,SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // cubemap input (assignable in material)
@@ -2576,8 +2576,9 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vector<Str
String name = p_node->param1;
Color dv= p_node->param2;
- code +="uniform color "+name+"=vec4("+rtos(dv.r)+","+rtos(dv.g)+","+rtos(dv.g)+","+rtos(dv.a)+");\n";
+ code +="uniform color "+name+"=vec4("+rtos(dv.r)+","+rtos(dv.g)+","+rtos(dv.b)+","+rtos(dv.a)+");\n";
code += OUTNAME(p_node->id,0)+"="+name+".rgb;\n";
+ code += OUTNAME(p_node->id,1)+"="+name+".a;\n";
}break;
case NODE_XFORM_INPUT: {
diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp
index bfac852481..b0ed99cb48 100644
--- a/servers/physics/body_sw.cpp
+++ b/servers/physics/body_sw.cpp
@@ -380,6 +380,8 @@ void BodySW::set_space(SpaceSW *p_space){
}
+ first_integration=true;
+
}
void BodySW::_compute_area_gravity_and_dampenings(const AreaSW *p_area) {
@@ -479,7 +481,7 @@ void BodySW::integrate_forces(real_t p_step) {
do_motion=true;
} else {
- if (!omit_force_integration) {
+ if (!omit_force_integration && !first_integration) {
//overriden by direct state query
Vector3 force=gravity*mass;
@@ -512,6 +514,7 @@ void BodySW::integrate_forces(real_t p_step) {
applied_force=Vector3();
applied_torque=Vector3();
+ first_integration=false;
//motion=linear_velocity*p_step;
@@ -749,6 +752,7 @@ BodySW::BodySW() : CollisionObjectSW(TYPE_BODY), active_list(this), inertia_upda
island_next=NULL;
island_list_next=NULL;
first_time_kinematic=false;
+ first_integration=false;
_set_static(false);
contact_count=0;
diff --git a/servers/physics/body_sw.h b/servers/physics/body_sw.h
index 7369b4cecf..c958177a19 100644
--- a/servers/physics/body_sw.h
+++ b/servers/physics/body_sw.h
@@ -79,6 +79,8 @@ class BodySW : public CollisionObjectSW {
bool omit_force_integration;
bool active;
+ bool first_integration;
+
bool continuous_cd;
bool can_sleep;
bool first_time_kinematic;
diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp
index d289510cb6..5923f89120 100644
--- a/servers/physics/shape_sw.cpp
+++ b/servers/physics/shape_sw.cpp
@@ -1354,6 +1354,10 @@ void ConcavePolygonShapeSW::_fill_bvh(_VolumeSW_BVH* p_bvh_tree,BVH* p_bvh_array
void ConcavePolygonShapeSW::_setup(DVector<Vector3> p_faces) {
int src_face_count=p_faces.size();
+ if (src_face_count==0) {
+ configure(AABB());
+ return;
+ }
ERR_FAIL_COND(src_face_count%3);
src_face_count/=3;
diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp
index c85e5a85e9..08f280a976 100644
--- a/servers/physics/space_sw.cpp
+++ b/servers/physics/space_sw.cpp
@@ -47,7 +47,7 @@ _FORCE_INLINE_ static bool _match_object_type_query(CollisionObjectSW *p_object,
}
-bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3& p_from, const Vector3& p_to,RayResult &r_result,const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) {
+bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3& p_from, const Vector3& p_to, RayResult &r_result, const Set<RID>& p_exclude, uint32_t p_layer_mask, uint32_t p_object_type_mask, bool p_pick_ray) {
ERR_FAIL_COND_V(space->locked,false);
@@ -77,7 +77,7 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3& p_from, const Vecto
if (!_match_object_type_query(space->intersection_query_results[i],p_layer_mask,p_object_type_mask))
continue;
- if (!(static_cast<CollisionObjectSW*>(space->intersection_query_results[i])->is_ray_pickable()))
+ if (p_pick_ray && !(static_cast<CollisionObjectSW*>(space->intersection_query_results[i])->is_ray_pickable()))
continue;
if (p_exclude.has( space->intersection_query_results[i]->get_self()))
diff --git a/servers/physics/space_sw.h b/servers/physics/space_sw.h
index 9c73565381..6300c206d8 100644
--- a/servers/physics/space_sw.h
+++ b/servers/physics/space_sw.h
@@ -46,7 +46,7 @@ public:
SpaceSW *space;
- virtual bool intersect_ray(const Vector3& p_from, const Vector3& p_to,RayResult &r_result,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION);
+ virtual bool intersect_ray(const Vector3& p_from, const Vector3& p_to,RayResult &r_result,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION,bool p_pick_ray=false);
virtual int intersect_shape(const RID& p_shape, const Transform& p_xform,float p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION);
virtual bool cast_motion(const RID& p_shape, const Transform& p_xform,const Vector3& p_motion,float p_margin,float &p_closest_safe,float &p_closest_unsafe, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION,ShapeRestInfo *r_info=NULL);
virtual bool collide_shape(RID p_shape, const Transform& p_shape_xform,float p_margin,Vector3 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION);
diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp
index 129ce708d7..f1f94f3485 100644
--- a/servers/physics_2d/body_2d_sw.cpp
+++ b/servers/physics_2d/body_2d_sw.cpp
@@ -29,6 +29,7 @@
#include "body_2d_sw.h"
#include "space_2d_sw.h"
#include "area_2d_sw.h"
+#include "physics_2d_server_sw.h"
void Body2DSW::_update_inertia() {
@@ -378,6 +379,7 @@ void Body2DSW::set_space(Space2DSW *p_space){
}
+ first_integration=false;
}
void Body2DSW::_compute_area_gravity_and_dampenings(const Area2DSW *p_area) {
@@ -471,7 +473,7 @@ void Body2DSW::integrate_forces(real_t p_step) {
//}
} else {
- if (!omit_force_integration) {
+ if (!omit_force_integration && !first_integration) {
//overriden by direct state query
Vector2 force=gravity*mass;
@@ -506,6 +508,7 @@ void Body2DSW::integrate_forces(real_t p_step) {
//motion=linear_velocity*p_step;
+ first_integration=false;
biased_angular_velocity=0;
biased_linear_velocity=Vector2();
@@ -681,6 +684,7 @@ Body2DSW::Body2DSW() : CollisionObject2DSW(TYPE_BODY), active_list(this), inerti
gravity_scale=1.0;
using_one_way_cache=false;
one_way_collision_max_depth=0.1;
+ first_integration=false;
still_time=0;
continuous_cd_mode=Physics2DServer::CCD_MODE_DISABLED;
@@ -701,3 +705,24 @@ Physics2DDirectSpaceState* Physics2DDirectBodyStateSW::get_space_state() {
return body->get_space()->get_direct_state();
}
+
+
+Variant Physics2DDirectBodyStateSW::get_contact_collider_shape_metadata(int p_contact_idx) const {
+
+ ERR_FAIL_INDEX_V(p_contact_idx,body->contact_count,Variant());
+
+ if (!Physics2DServerSW::singletonsw->body_owner.owns(body->contacts[p_contact_idx].collider)) {
+
+ return Variant();
+ }
+ Body2DSW *other = Physics2DServerSW::singletonsw->body_owner.get(body->contacts[p_contact_idx].collider);
+
+ int sidx = body->contacts[p_contact_idx].collider_shape;
+ if (sidx<0 || sidx>=other->get_shape_count()) {
+
+ return Variant();
+ }
+
+
+ return other->get_shape_metadata(sidx);
+}
diff --git a/servers/physics_2d/body_2d_sw.h b/servers/physics_2d/body_2d_sw.h
index ae64875567..4bd462ac00 100644
--- a/servers/physics_2d/body_2d_sw.h
+++ b/servers/physics_2d/body_2d_sw.h
@@ -81,6 +81,7 @@ class Body2DSW : public CollisionObject2DSW {
bool active;
bool can_sleep;
bool first_time_kinematic;
+ bool first_integration;
bool using_one_way_cache;
void _update_inertia();
virtual void _shapes_changed();
@@ -369,7 +370,7 @@ public:
virtual Vector2 get_contact_collider_pos(int p_contact_idx) const { ERR_FAIL_INDEX_V(p_contact_idx,body->contact_count,Vector2()); return body->contacts[p_contact_idx].collider_pos; }
virtual ObjectID get_contact_collider_id(int p_contact_idx) const { ERR_FAIL_INDEX_V(p_contact_idx,body->contact_count,0); return body->contacts[p_contact_idx].collider_instance_id; }
virtual int get_contact_collider_shape(int p_contact_idx) const { ERR_FAIL_INDEX_V(p_contact_idx,body->contact_count,0); return body->contacts[p_contact_idx].collider_shape; }
- virtual Variant get_contact_collider_shape_metadata(int p_contact_idx) const { ERR_FAIL_INDEX_V(p_contact_idx,body->contact_count,Variant()); return body->get_shape_metadata(body->contacts[p_contact_idx].collider_shape); }
+ virtual Variant get_contact_collider_shape_metadata(int p_contact_idx) const;
virtual Vector2 get_contact_collider_velocity_at_pos(int p_contact_idx) const { ERR_FAIL_INDEX_V(p_contact_idx,body->contact_count,Vector2()); return body->contacts[p_contact_idx].collider_velocity_at_pos; }
diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp
index d17d499723..c571331498 100644
--- a/servers/physics_2d/physics_2d_server_sw.cpp
+++ b/servers/physics_2d/physics_2d_server_sw.cpp
@@ -1322,8 +1322,11 @@ int Physics2DServerSW::get_process_info(ProcessInfo p_info) {
}
+Physics2DServerSW *Physics2DServerSW::singletonsw=NULL;
+
Physics2DServerSW::Physics2DServerSW() {
+ singletonsw=this;
BroadPhase2DSW::create_func=BroadPhase2DHashGrid::_create;
// BroadPhase2DSW::create_func=BroadPhase2DBasic::_create;
diff --git a/servers/physics_2d/physics_2d_server_sw.h b/servers/physics_2d/physics_2d_server_sw.h
index 5cdcf9225a..28acf4e2d1 100644
--- a/servers/physics_2d/physics_2d_server_sw.h
+++ b/servers/physics_2d/physics_2d_server_sw.h
@@ -42,6 +42,7 @@ class Physics2DServerSW : public Physics2DServer {
OBJ_TYPE( Physics2DServerSW, Physics2DServer );
friend class Physics2DDirectSpaceStateSW;
+friend class Physics2DDirectBodyStateSW;
bool active;
int iterations;
bool doing_sync;
@@ -65,7 +66,7 @@ friend class Physics2DDirectSpaceStateSW;
mutable RID_Owner<Body2DSW> body_owner;
mutable RID_Owner<Joint2DSW> joint_owner;
-
+ static Physics2DServerSW *singletonsw;
// void _clear_query(Query2DSW *p_query);
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp
index 90174d48ee..9ba6bdd5ba 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -192,7 +192,7 @@ int Physics2DDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Matri
if (p_result_max<=0)
return 0;
- Shape2DSW *shape = static_cast<Physics2DServerSW*>(Physics2DServer::get_singleton())->shape_owner.get(p_shape);
+ Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.get(p_shape);
ERR_FAIL_COND_V(!shape,0);
Rect2 aabb = p_xform.xform(shape->get_aabb());
@@ -239,7 +239,7 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Matrix32
- Shape2DSW *shape = static_cast<Physics2DServerSW*>(Physics2DServer::get_singleton())->shape_owner.get(p_shape);
+ Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.get(p_shape);
ERR_FAIL_COND_V(!shape,false);
Rect2 aabb = p_xform.xform(shape->get_aabb());
@@ -367,7 +367,7 @@ bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Matrix32& p_s
if (p_result_max<=0)
return 0;
- Shape2DSW *shape = static_cast<Physics2DServerSW*>(Physics2DServer::get_singleton())->shape_owner.get(p_shape);
+ Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.get(p_shape);
ERR_FAIL_COND_V(!shape,0);
Rect2 aabb = p_shape_xform.xform(shape->get_aabb());
@@ -474,7 +474,7 @@ static void _rest_cbk_result(const Vector2& p_point_A,const Vector2& p_point_B,v
bool Physics2DDirectSpaceStateSW::rest_info(RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) {
- Shape2DSW *shape = static_cast<Physics2DServerSW*>(Physics2DServer::get_singleton())->shape_owner.get(p_shape);
+ Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.get(p_shape);
ERR_FAIL_COND_V(!shape,0);
Rect2 aabb = p_shape_xform.xform(shape->get_aabb());
diff --git a/servers/physics_server.h b/servers/physics_server.h
index e04765633d..8e302bf363 100644
--- a/servers/physics_server.h
+++ b/servers/physics_server.h
@@ -170,7 +170,7 @@ public:
int shape;
};
- virtual bool intersect_ray(const Vector3& p_from, const Vector3& p_to,RayResult &r_result,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0;
+ virtual bool intersect_ray(const Vector3& p_from, const Vector3& p_to,RayResult &r_result,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION,bool p_pick_ray=false)=0;
struct ShapeResult {
diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp
index 96fd3f6b68..11e4797747 100644
--- a/tools/doc/doc_data.cpp
+++ b/tools/doc/doc_data.cpp
@@ -190,10 +190,10 @@ void DocData::generate(bool p_basic_types) {
#ifdef DEBUG_METHODS_ENABLED
if (m && m->get_return_type()!=StringName())
method.return_type=m->get_return_type();
- else if (arginfo.type!=Variant::NIL) {
+ else if (arginfo.type!=Variant::NIL) // {
#endif
method.return_type=(arginfo.hint==PROPERTY_HINT_RESOURCE_TYPE)?arginfo.hint_string:Variant::get_type_name(arginfo.type);
- }
+// }
} else {
@@ -584,7 +584,10 @@ void DocData::generate(bool p_basic_types) {
md.name=mi.name;
if (mi.return_val.name!="")
md.return_type=mi.return_val.name;
- else
+ else if (mi.name.find(":")!=-1) {
+ md.return_type=mi.name.get_slice(":",1);
+ md.name=mi.name.get_slice(":",0);
+ } else
md.return_type=Variant::get_type_name(mi.return_val.type);
for(int i=0;i<mi.arguments.size();i++) {
@@ -594,8 +597,9 @@ void DocData::generate(bool p_basic_types) {
ArgumentDoc ad;
ad.name=pi.name;
+
if (pi.type==Variant::NIL)
- ad.type="var";
+ ad.type="Variant";
else
ad.type=Variant::get_type_name( pi.type );
diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp
index 2d274dc91b..9a0dde783b 100644
--- a/tools/editor/animation_editor.cpp
+++ b/tools/editor/animation_editor.cpp
@@ -1702,7 +1702,7 @@ bool AnimationKeyEditor::_edit_if_single_selection() {
if (selection.size()==0) {
curve_edit->set_mode(AnimationCurveEdit::MODE_DISABLED);
- print_line("disable");
+ //print_line("disable");
} else {
curve_edit->set_mode(AnimationCurveEdit::MODE_MULTIPLE);
@@ -1713,13 +1713,13 @@ bool AnimationKeyEditor::_edit_if_single_selection() {
curve_edit->set_multiple(animation->track_get_key_transition(E->key().track,E->key().key));
}
- print_line("multiple");
+ //print_line("multiple");
}
return false;
}
curve_edit->set_mode(AnimationCurveEdit::MODE_SINGLE);
- print_line("regular");
+ //print_line("regular");
int idx = selection.front()->key().track;
int key = selection.front()->key().key;
@@ -3017,7 +3017,7 @@ void AnimationKeyEditor::set_keying(bool p_enabled) {
keying=p_enabled;
_update_menu();
- emit_signal("keying_changed",p_enabled);
+ emit_signal("keying_changed");
}
diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp
index 59167abc22..fe863bfebc 100644
--- a/tools/editor/code_editor.cpp
+++ b/tools/editor/code_editor.cpp
@@ -612,6 +612,7 @@ CodeTextEditor::CodeTextEditor() {
if (!font_overrode)
text_editor->add_font_override("font",get_font("source","Fonts"));
+
text_editor->set_show_line_numbers(true);
text_editor->set_brace_matching(true);
text_editor->set_auto_indent(true);
diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp
index d79c1ff466..5e613c658b 100644
--- a/tools/editor/editor_data.cpp
+++ b/tools/editor/editor_data.cpp
@@ -499,8 +499,8 @@ void EditorData::remove_scene(int p_idx){
bool EditorData::_find_updated_instances(Node* p_root,Node *p_node,Set<String> &checked_paths) {
- if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner()))
- return false;
+// if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner()))
+// return false;
Ref<SceneState> ss;
diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp
index 28a9b63412..22cd3845e1 100644
--- a/tools/editor/editor_file_dialog.cpp
+++ b/tools/editor/editor_file_dialog.cpp
@@ -53,13 +53,52 @@ void EditorFileDialog::_notification(int p_what) {
//RID ci = get_canvas_item();
//get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
+ } else if (p_what==NOTIFICATION_POPUP_HIDE) {
+
+ set_process_unhandled_input(false);
+
} else if (p_what==EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
- set_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files"));
+ bool show_hidden=EditorSettings::get_singleton()->get("file_dialog/show_hidden_files");
+ if (show_hidden_files!=show_hidden)
+ set_show_hidden_files(show_hidden);
set_display_mode((DisplayMode)EditorSettings::get_singleton()->get("file_dialog/display_mode").operator int());
}
}
+void EditorFileDialog::_unhandled_input(const InputEvent& p_event) {
+
+ if (p_event.type==InputEvent::KEY && is_window_modal_on_top()) {
+
+ const InputEventKey &k=p_event.key;
+
+ if (k.pressed) {
+
+ bool handled=true;
+
+ switch (k.scancode) {
+
+ case KEY_H: {
+
+ if (k.mod.command) {
+
+ bool show=!show_hidden_files;
+ set_show_hidden_files(show);
+ EditorSettings::get_singleton()->set("file_dialog/show_hidden_files",show);
+ } else {
+ handled=false;
+ }
+
+ } break;
+ default: { handled=false; }
+ }
+
+ if (handled)
+ accept_event();
+ }
+ }
+}
+
void EditorFileDialog::set_enable_multiple_selection(bool p_enable) {
item_list->set_select_mode(p_enable?ItemList::SELECT_MULTI:ItemList::SELECT_SINGLE);
@@ -151,6 +190,8 @@ void EditorFileDialog::_post_popup() {
_update_favorites();
}
+ set_process_unhandled_input(true);
+
}
void EditorFileDialog::_thumbnail_result(const String& p_path,const Ref<Texture>& p_preview, const Variant& p_udata) {
@@ -1049,6 +1090,8 @@ EditorFileDialog::DisplayMode EditorFileDialog::get_display_mode() const{
void EditorFileDialog::_bind_methods() {
+ ObjectTypeDB::bind_method(_MD("_unhandled_input"),&EditorFileDialog::_unhandled_input);
+
ObjectTypeDB::bind_method(_MD("_item_selected"),&EditorFileDialog::_item_selected);
ObjectTypeDB::bind_method(_MD("_item_db_selected"),&EditorFileDialog::_item_dc_selected);
ObjectTypeDB::bind_method(_MD("_dir_entered"),&EditorFileDialog::_dir_entered);
diff --git a/tools/editor/editor_file_dialog.h b/tools/editor/editor_file_dialog.h
index db3201e5c4..3590964a51 100644
--- a/tools/editor/editor_file_dialog.h
+++ b/tools/editor/editor_file_dialog.h
@@ -176,6 +176,8 @@ private:
void _thumbnail_done(const String& p_path,const Ref<Texture>& p_preview, const Variant& p_udata);
void _request_single_thumbnail(const String& p_path);
+ void _unhandled_input(const InputEvent& p_event);
+
protected:
void _notification(int p_what);
diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp
index 673607706a..c7c1a48e34 100644
--- a/tools/editor/editor_file_system.cpp
+++ b/tools/editor/editor_file_system.cpp
@@ -37,6 +37,31 @@
EditorFileSystem *EditorFileSystem::singleton=NULL;
+void EditorFileSystemDirectory::sort_files() {
+
+ files.sort_custom<FileInfoSort>();
+}
+
+int EditorFileSystemDirectory::find_file_index(const String& p_file) const {
+
+ for(int i=0;i<files.size();i++) {
+ if (files[i]->file==p_file)
+ return i;
+ }
+ return -1;
+
+}
+int EditorFileSystemDirectory::find_dir_index(const String& p_dir) const{
+
+
+ for(int i=0;i<subdirs.size();i++) {
+ if (subdirs[i]->name==p_dir)
+ return i;
+ }
+
+ return -1;
+}
+
int EditorFileSystemDirectory::get_subdir_count() const {
@@ -59,7 +84,7 @@ String EditorFileSystemDirectory::get_file(int p_idx) const{
ERR_FAIL_INDEX_V(p_idx,files.size(),"");
- return files[p_idx].file;
+ return files[p_idx]->file;
}
String EditorFileSystemDirectory::get_path() const {
@@ -91,22 +116,22 @@ String EditorFileSystemDirectory::get_file_path(int p_idx) const {
bool EditorFileSystemDirectory::get_file_meta(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,files.size(),"");
- return files[p_idx].meta.enabled;
+ return files[p_idx]->meta.enabled;
}
Vector<String> EditorFileSystemDirectory::get_file_deps(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,files.size(),Vector<String>());
- return files[p_idx].meta.deps;
+ return files[p_idx]->meta.deps;
}
Vector<String> EditorFileSystemDirectory::get_missing_sources(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,files.size(),Vector<String>());
Vector<String> missing;
- for(int i=0;i<files[p_idx].meta.sources.size();i++) {
- if (files[p_idx].meta.sources[i].missing)
- missing.push_back(files[p_idx].meta.sources[i].path);
+ for(int i=0;i<files[p_idx]->meta.sources.size();i++) {
+ if (files[p_idx]->meta.sources[i].missing)
+ missing.push_back(files[p_idx]->meta.sources[i].path);
}
return missing;
@@ -116,8 +141,8 @@ Vector<String> EditorFileSystemDirectory::get_missing_sources(int p_idx) const {
bool EditorFileSystemDirectory::is_missing_sources(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,files.size(),false);
- for(int i=0;i<files[p_idx].meta.sources.size();i++) {
- if (files[p_idx].meta.sources[i].missing)
+ for(int i=0;i<files[p_idx]->meta.sources.size();i++) {
+ if (files[p_idx]->meta.sources[i].missing)
return true;
}
@@ -127,7 +152,7 @@ bool EditorFileSystemDirectory::is_missing_sources(int p_idx) const {
StringName EditorFileSystemDirectory::get_file_type(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,files.size(),"");
- return files[p_idx].type;
+ return files[p_idx]->type;
}
String EditorFileSystemDirectory::get_name() {
@@ -157,11 +182,17 @@ void EditorFileSystemDirectory::_bind_methods() {
EditorFileSystemDirectory::EditorFileSystemDirectory() {
+ modified_time=0;
parent=NULL;
}
EditorFileSystemDirectory::~EditorFileSystemDirectory() {
+ for(int i=0;i<files.size();i++) {
+
+ memdelete(files[i]);
+ }
+
for(int i=0;i<subdirs.size();i++) {
memdelete(subdirs[i]);
@@ -173,19 +204,6 @@ EditorFileSystemDirectory::~EditorFileSystemDirectory() {
-
-
-EditorFileSystem::DirItem::~DirItem() {
-
- for(int i=0;i<dirs.size();i++) {
- memdelete(dirs[i]);
- }
-
- for(int i=0;i<files.size();i++) {
- memdelete(files[i]);
- }
-}
-
EditorFileSystemDirectory::ImportMeta EditorFileSystem::_get_meta(const String& p_path) {
Ref<ResourceImportMetadata> imd = ResourceLoader::load_import_metadata(p_path);
@@ -214,160 +232,16 @@ EditorFileSystemDirectory::ImportMeta EditorFileSystem::_get_meta(const String&
return m;
}
-EditorFileSystem::DirItem* EditorFileSystem::_scan_dir(DirAccess *da,Set<String> &extensions,String p_name,float p_from,float p_range,const String& p_path,HashMap<String,FileCache> &file_cache,HashMap<String,DirCache> &dir_cache,EditorProgressBG& p_prog) {
- if (abort_scan)
- return NULL;
-
- if (p_path!=String()) {
- if (FileAccess::exists(("res://"+p_path).plus_file("engine.cfg"))) {
- return NULL;
- }
- }
-
- List<String> dirs;
- List<String> files;
- Set<String> pngs;
-
- String path=p_path;
- if (path.ends_with("/"))
- path=path.substr(0,path.length()-1);
- String global_path = Globals::get_singleton()->get_resource_path().plus_file(path);
-
- path="res://"+path;
- uint64_t mtime = FileAccess::get_modified_time(global_path);
-
- DirCache *dc = dir_cache.getptr(path);
-
-
- if (false && dc && dc->modification_time==mtime) {
- //use the cached files, since directory did not change
- for (Set<String>::Element *E=dc->subdirs.front();E;E=E->next()) {
- dirs.push_back(E->get());
- }
- for (Set<String>::Element *E=dc->files.front();E;E=E->next()) {
- files.push_back(E->get());
- }
-
- } else {
- //use the filesystem, some files may have changed
- Error err = da->change_dir(global_path);
- if (err!=OK) {
- print_line("Can't change to: "+path);
- ERR_FAIL_COND_V(err!=OK,NULL);
- }
+void EditorFileSystem::_scan_filesystem() {
-
- da->list_dir_begin();
- while (true) {
-
- bool isdir;
- String f = da->get_next(&isdir);
- if (f=="")
- break;
- if (isdir) {
- dirs.push_back(f);
- } else {
- String ext = f.extension().to_lower();
- if (extensions.has(ext))
- files.push_back(f);
-
- }
-
- }
-
- da->list_dir_end();
- files.sort();
- dirs.sort();
-
- }
-
-
-
- //print_line(da->get_current_dir()+": dirs: "+itos(dirs.size())+" files:"+itos(files.size()) );
-
- //find subdirs
- Vector<DirItem*> subdirs;
-
- //String current = da->get_current_dir();
- float idx=0;
- for (List<String>::Element *E=dirs.front();E;E=E->next(),idx+=1.0) {
-
- String d = E->get();
- if (d.begins_with(".")) //ignore hidden and . / ..
- continue;
-
- //ERR_CONTINUE( da->change_dir(d)!= OK );
- DirItem *sdi = _scan_dir(da,extensions,d,p_from+(idx/dirs.size())*p_range,p_range/dirs.size(),p_path+d+"/",file_cache,dir_cache,p_prog);
- if (sdi) {
- subdirs.push_back(sdi);
- }
- //da->change_dir(current);
- }
-
-
- if (subdirs.empty() && files.empty()) {
- total=p_from+p_range;
- p_prog.step(total*100);
- return NULL; //give up, nothing to do here
- }
-
- DirItem *di = memnew( DirItem );
- di->path=path;
- di->name=p_name;
- di->dirs=subdirs;
- di->modified_time=mtime;
-
- //add files
- for (List<String>::Element *E=files.front();E;E=E->next()) {
-
- SceneItem * si = memnew( SceneItem );
- si->file=E->get();
- si->path="res://"+p_path+si->file;
- FileCache *fc = file_cache.getptr(si->path);
- uint64_t mt = FileAccess::get_modified_time(si->path);
-
- if (fc && fc->modification_time == mt) {
-
- si->meta=fc->meta;
- si->type=fc->type;
- si->modified_time=fc->modification_time;
- } else {
- si->meta=_get_meta(si->path);
- si->type=ResourceLoader::get_resource_type(si->path);
- si->modified_time=mt;
-
- }
-
- if (si->meta.enabled) {
- md_count++;
- if (_check_meta_sources(si->meta)) {
- sources_changed.push_back(si->path);
- }
- }
- di->files.push_back(si);
- }
-
- total=p_from+p_range;
- p_prog.step(total*100);
-
- return di;
-}
-
-
-void EditorFileSystem::_scan_scenes() {
-
- ERR_FAIL_COND(!scanning || scandir);
+ ERR_FAIL_COND(!scanning || new_filesystem);
//read .fscache
- HashMap<String,FileCache> file_cache;
- HashMap<String,DirCache> dir_cache;
- DirCache *dc=NULL;
String cpath;
sources_changed.clear();
-
-
+ file_cache.clear();
String project=Globals::get_singleton()->get_resource_path();
@@ -387,26 +261,7 @@ void EditorFileSystem::_scan_scenes() {
ERR_CONTINUE( split.size() != 3);
String name = split[1];
- dir_cache[name]=DirCache();
- dc=&dir_cache[name];
- dc->modification_time=split[2].to_int64();
-
- if (name!="res://") {
-
- cpath=name+"/";
-
- int sp=name.find_last("/");
- if (sp==5)
- sp=6;
- String pd = name.substr(0,sp);
- DirCache *dcp = dir_cache.getptr(pd);
- ERR_CONTINUE(!dcp);
- dcp->subdirs.insert(name.get_file());
- } else {
-
- cpath=name;
- }
-
+ cpath=name;
} else {
Vector<String> split = l.split("::");
@@ -414,12 +269,8 @@ void EditorFileSystem::_scan_scenes() {
String name = split[0];
String file;
- if (!name.begins_with("res://")) {
- file=name;
- name=cpath+name;
- } else {
- file=name.get_file();
- }
+ file=name;
+ name=cpath.plus_file(name);
FileCache fc;
fc.type=split[1];
@@ -453,8 +304,6 @@ void EditorFileSystem::_scan_scenes() {
file_cache[name]=fc;
- ERR_CONTINUE(!dc);
- dc->files.insert(file);
}
}
@@ -465,39 +314,31 @@ void EditorFileSystem::_scan_scenes() {
+ EditorProgressBG scan_progress("efs","ScanFS",1000);
+ ScanProgress sp;
+ sp.low=0;
+ sp.hi=1;
+ sp.progress=&scan_progress;
- total=0;
- DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
- //da->change_dir( Globals::get_singleton()->get_resource_path() );
+ new_filesystem = memnew( EditorFileSystemDirectory );
+ new_filesystem->parent=NULL;
+ DirAccess *d = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ d->change_dir("res://");
+ _scan_new_dir(new_filesystem,d,sp);
- List<String> extensionsl;
- ResourceLoader::get_recognized_extensions_for_type("",&extensionsl);
- Set<String> extensions;
- for(List<String>::Element *E = extensionsl.front();E;E=E->next()) {
+ file_cache.clear(); //clear caches, no longer needed
- extensions.insert(E->get());
- }
-
- EditorProgressBG scan_progress("efs","ScanFS",100);
-
- md_count=0;
- scandir=_scan_dir(da,extensions,"",0,1,"",file_cache,dir_cache,scan_progress);
- memdelete(da);
- if (abort_scan && scandir) {
- memdelete(scandir);
- scandir=NULL;
-
- }
+ memdelete(d);
//save back the findings
// String fscache = EditorSettings::get_singleton()->get_project_settings_path().plus_file("file_cache");
f=FileAccess::open(fscache,FileAccess::WRITE);
- _save_type_cache_fs(scandir,f);
+ _save_filesystem_cache(new_filesystem,f);
f->close();
memdelete(f);
@@ -510,7 +351,95 @@ void EditorFileSystem::_scan_scenes() {
void EditorFileSystem::_thread_func(void *_userdata) {
EditorFileSystem *sd = (EditorFileSystem*)_userdata;
- sd->_scan_scenes();
+ sd->_scan_filesystem();
+
+}
+
+bool EditorFileSystem::_update_scan_actions() {
+
+ sources_changed.clear();
+
+ bool fs_changed=false;
+
+ for (List<ItemAction>::Element *E=scan_actions.front();E;E=E->next()) {
+
+ ItemAction&ia = E->get();
+
+ switch(ia.action) {
+ case ItemAction::ACTION_NONE: {
+
+ } break;
+ case ItemAction::ACTION_DIR_ADD: {
+
+ //print_line("*ACTION ADD DIR: "+ia.new_dir->get_name());
+ int idx=0;
+ for(int i=0;i<ia.dir->subdirs.size();i++) {
+
+ if (ia.new_dir->name<ia.dir->subdirs[i]->name)
+ break;
+ idx++;
+ }
+ if (idx==ia.dir->subdirs.size()) {
+ ia.dir->subdirs.push_back(ia.new_dir);
+ } else {
+ ia.dir->subdirs.insert(idx,ia.new_dir);
+ }
+
+ fs_changed=true;
+ } break;
+ case ItemAction::ACTION_DIR_REMOVE: {
+
+ ERR_CONTINUE(!ia.dir->parent);
+ //print_line("*ACTION REMOVE DIR: "+ia.dir->get_name());
+ ia.dir->parent->subdirs.erase(ia.dir);
+ memdelete( ia.dir );
+ fs_changed=true;
+ } break;
+ case ItemAction::ACTION_FILE_ADD: {
+
+ int idx=0;
+ for(int i=0;i<ia.dir->files.size();i++) {
+
+ if (ia.new_file->file<ia.dir->files[i]->file)
+ break;
+ idx++;
+ }
+ if (idx==ia.dir->files.size()) {
+ ia.dir->files.push_back(ia.new_file);
+ } else {
+ ia.dir->files.insert(idx,ia.new_file);
+ }
+
+ fs_changed=true;
+ //print_line("*ACTION ADD FILE: "+ia.new_file->file);
+
+ } break;
+ case ItemAction::ACTION_FILE_REMOVE: {
+
+ int idx = ia.dir->find_file_index(ia.file);
+ ERR_CONTINUE(idx==-1);
+ memdelete( ia.dir->files[idx] );
+ ia.dir->files.remove(idx);
+
+ fs_changed=true;
+ //print_line("*ACTION REMOVE FILE: "+ia.file);
+
+ } break;
+ case ItemAction::ACTION_FILE_SOURCES_CHANGED: {
+
+ int idx = ia.dir->find_file_index(ia.file);
+ ERR_CONTINUE(idx==-1);
+ String full_path = ia.dir->get_file_path(idx);
+ sources_changed.push_back(full_path);
+
+ } break;
+
+ }
+ }
+
+ scan_actions.clear();
+
+ return fs_changed;
}
@@ -526,19 +455,15 @@ void EditorFileSystem::scan() {
abort_scan=false;
if (!use_threads) {
scanning=true;
- _scan_scenes();
- if (rootdir)
- memdelete(rootdir);
- rootdir=scandir;
+ scan_total=0;
+ _scan_filesystem();
if (filesystem)
memdelete(filesystem);
// file_type_cache.clear();
- filesystem=_update_tree(rootdir);
-
- if (rootdir)
- memdelete(rootdir);
- rootdir=NULL;
- scanning=false;
+ filesystem=new_filesystem;
+ new_filesystem=NULL;
+ _update_scan_actions();
+ scanning=false;
emit_signal("filesystem_changed");
emit_signal("sources_changed",sources_changed.size()>0);
@@ -548,6 +473,7 @@ void EditorFileSystem::scan() {
set_process(true);
Thread::Settings s;
scanning=true;
+ scan_total=0;
s.priority=Thread::PRIORITY_LOW;
thread = Thread::create(_thread_func,this,s);
//tree->hide();
@@ -559,14 +485,10 @@ void EditorFileSystem::scan() {
}
-bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta & p_meta,EditorProgressBG *ep) {
+bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta & p_meta) {
if (p_meta.enabled) {
- if (ep) {
- ep->step(ss_amount++);
- }
-
for(int j=0;j<p_meta.sources.size();j++) {
@@ -584,9 +506,9 @@ bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta
if (mt!=p_meta.sources[j].modified_time) {
//scan
String md5 = FileAccess::get_md5(src);
- print_line("checking: "+src);
- print_line("md5: "+md5);
- print_line("vs: "+p_meta.sources[j].md5);
+ //print_line("checking: "+src);
+ //print_line("md5: "+md5);
+ //print_line("vs: "+p_meta.sources[j].md5);
if (md5!=p_meta.sources[j].md5) {
//really changed
return true;
@@ -599,18 +521,300 @@ bool EditorFileSystem::_check_meta_sources(EditorFileSystemDirectory::ImportMeta
return false;
}
-void EditorFileSystem::_scan_sources(EditorFileSystemDirectory *p_dir,EditorProgressBG *ep) {
+void EditorFileSystem::ScanProgress::update(int p_current,int p_total) const {
+
+ float ratio = low + ((hi-low)/p_total)*p_current;
+ progress->step(ratio*1000);
+ EditorFileSystem::singleton->scan_total=ratio;
+}
+
+EditorFileSystem::ScanProgress EditorFileSystem::ScanProgress::get_sub(int p_current,int p_total) const{
+
+ ScanProgress sp=*this;
+ float slice = (sp.hi-sp.low)/p_total;
+ sp.low+=slice*p_current;
+ sp.hi=slice;
+ return sp;
+
+
+}
+
+
+void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess *da,const ScanProgress& p_progress) {
+
+ List<String> dirs;
+ List<String> files;
+
+ String cd = da->get_current_dir();
+
+ p_dir->modified_time = FileAccess::get_modified_time(cd);
+
+
+ da->list_dir_begin();
+ while (true) {
+
+ bool isdir;
+ String f = da->get_next(&isdir);
+ if (f=="")
+ break;
+
+ if (isdir) {
+
+ if (f.begins_with(".")) //ignore hidden and . / ..
+ continue;
+
+ if (FileAccess::exists(cd.plus_file(f).plus_file("engine.cfg"))) // skip if another project inside this
+ continue;
+
+ dirs.push_back(f);
+
+ } else {
+
+ files.push_back(f);
+ }
+
+ }
+
+ da->list_dir_end();
+
+ dirs.sort();
+ files.sort();
+
+ int total = dirs.size()+files.size();
+ int idx=0;
+
+ for (List<String>::Element *E=dirs.front();E;E=E->next(),idx++) {
+
+ if (da->change_dir(E->get())==OK) {
+
+ EditorFileSystemDirectory *efd = memnew( EditorFileSystemDirectory );
+
+ efd->parent=p_dir;
+ efd->name=E->get();
+
+ _scan_new_dir(efd,da,p_progress.get_sub(idx,total));
+
+ int idx=0;
+ for(int i=0;i<p_dir->subdirs.size();i++) {
+
+ if (efd->name<p_dir->subdirs[i]->name)
+ break;
+ idx++;
+ }
+ if (idx==p_dir->subdirs.size()) {
+ p_dir->subdirs.push_back(efd);
+ } else {
+ p_dir->subdirs.insert(idx,efd);
+ }
+
+ da->change_dir("..");
+ } else {
+ ERR_PRINTS("Can't go into subdir: "+E->get());
+ }
+
+ p_progress.update(idx,total);
+
+ }
+
+ for (List<String>::Element*E=files.front();E;E=E->next(),idx++) {
+
+ String ext = E->get().extension().to_lower();
+ if (!valid_extensions.has(ext))
+ continue; //invalid
+
+ EditorFileSystemDirectory::FileInfo *fi = memnew( EditorFileSystemDirectory::FileInfo );
+ fi->file=E->get();
+
+ String path = cd.plus_file(fi->file);
+
+ FileCache *fc = file_cache.getptr(path);
+ uint64_t mt = FileAccess::get_modified_time(path);
+
+ if (fc && fc->modification_time == mt) {
+
+ fi->meta=fc->meta;
+ fi->type=fc->type;
+ fi->modified_time=fc->modification_time;
+ } else {
+ fi->meta=_get_meta(path);
+ fi->type=ResourceLoader::get_resource_type(path);
+ fi->modified_time=mt;
+
+ }
+
+ if (fi->meta.enabled) {
+ if (_check_meta_sources(fi->meta)) {
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_FILE_SOURCES_CHANGED;
+ ia.dir=p_dir;
+ ia.file=E->get();
+ scan_actions.push_back(ia);
+ }
+ }
+
+ p_dir->files.push_back(fi);
+ p_progress.update(idx,total);
+ }
+
+}
+
+
+void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const ScanProgress& p_progress) {
+
+ uint64_t current_mtime = FileAccess::get_modified_time(p_dir->get_path());
+
+ bool updated_dir=false;
+
+ //print_line("dir: "+p_dir->get_path()+" MODTIME: "+itos(p_dir->modified_time)+" CTIME: "+itos(current_mtime));
+
+ if (current_mtime!=p_dir->modified_time) {
+
+ updated_dir=true;
+ p_dir->modified_time=current_mtime;
+ //ooooops, dir changed, see what's going on
+
+ //first mark everything as veryfied
+
+ for(int i=0;i<p_dir->files.size();i++) {
+
+ p_dir->files[i]->verified=false;
+ }
+
+ for(int i=0;i<p_dir->subdirs.size();i++) {
+
+ p_dir->get_subdir(i)->verified=false;
+ }
+
+ //then scan files and directories and check what's different
+
+ DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ String cd = p_dir->get_path();
+ da->change_dir(cd);
+ da->list_dir_begin();
+ while (true) {
+
+ bool isdir;
+ String f = da->get_next(&isdir);
+ if (f=="")
+ break;
+
+ if (isdir) {
+
+ if (f.begins_with(".")) //ignore hidden and . / ..
+ continue;
+
+ int idx = p_dir->find_dir_index(f);
+ if (idx==-1) {
+
+ if (FileAccess::exists(cd.plus_file(f).plus_file("engine.cfg"))) // skip if another project inside this
+ continue;
+
+ EditorFileSystemDirectory *efd = memnew( EditorFileSystemDirectory );
+
+ efd->parent=p_dir;
+ efd->name=f;
+ DirAccess *d = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ d->change_dir(cd.plus_file(f));
+ _scan_new_dir(efd,d,p_progress.get_sub(1,1));
+ memdelete(d);
+
+
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_DIR_ADD;
+ ia.dir=p_dir;
+ ia.file=f;
+ ia.new_dir=efd;
+ scan_actions.push_back(ia);
+ } else {
+ p_dir->subdirs[idx]->verified=true;
+ }
+
+
+ } else {
+ String ext = f.extension().to_lower();
+ if (!valid_extensions.has(ext))
+ continue; //invalid
+
+ int idx = p_dir->find_file_index(f);
+
+ if (idx==-1) {
+ //never seen this file, add actition to add it
+ EditorFileSystemDirectory::FileInfo *fi = memnew( EditorFileSystemDirectory::FileInfo );
+ fi->file=f;
+
+ String path = cd.plus_file(fi->file);
+ fi->modified_time=FileAccess::get_modified_time(path);
+ fi->meta=_get_meta(path);
+ fi->type=ResourceLoader::get_resource_type(path);
+
+ {
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_FILE_ADD;
+ ia.dir=p_dir;
+ ia.file=f;
+ ia.new_file=fi;
+ scan_actions.push_back(ia);
+ }
+
+ //take the chance and scan sources
+ if (_check_meta_sources(fi->meta)) {
+
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_FILE_SOURCES_CHANGED;
+ ia.dir=p_dir;
+ ia.file=f;
+ scan_actions.push_back(ia);
+ }
+
+ } else {
+ p_dir->files[idx]->verified=true;
+ }
+
+
+ }
+
+ }
+ da->list_dir_end();
+ memdelete(da);
+
+
+
+
+ }
for(int i=0;i<p_dir->files.size();i++) {
- if (_check_meta_sources(p_dir->files[i].meta,ep)) {
- sources_changed.push_back(p_dir->get_file_path(i));
+ if (updated_dir && !p_dir->files[i]->verified) {
+ //this file was removed, add action to remove it
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_FILE_REMOVE;
+ ia.dir=p_dir;
+ ia.file=p_dir->files[i]->file;
+ scan_actions.push_back(ia);
+ continue;
+
+ }
+ if (_check_meta_sources(p_dir->files[i]->meta)) {
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_FILE_SOURCES_CHANGED;
+ ia.dir=p_dir;
+ ia.file=p_dir->files[i]->file;
+ scan_actions.push_back(ia);
}
}
for(int i=0;i<p_dir->subdirs.size();i++) {
- _scan_sources(p_dir->get_subdir(i),ep);
+ if (updated_dir && !p_dir->subdirs[i]->verified) {
+ //this directory was removed, add action to remove it
+ ItemAction ia;
+ ia.action=ItemAction::ACTION_DIR_REMOVE;
+ ia.dir=p_dir->subdirs[i];
+ scan_actions.push_back(ia);
+ continue;
+
+ }
+ _scan_fs_changes(p_dir->get_subdir(i),p_progress);
}
}
@@ -619,9 +823,12 @@ void EditorFileSystem::_thread_func_sources(void *_userdata) {
EditorFileSystem *efs = (EditorFileSystem*)_userdata;
if (efs->filesystem) {
- EditorProgressBG pr("sources","ScanSources",efs->md_count);
- efs->ss_amount=0;
- efs->_scan_sources(efs->filesystem,&pr);
+ EditorProgressBG pr("sources","ScanSources",1000);
+ ScanProgress sp;
+ sp.progress=&pr;
+ sp.hi=1;
+ sp.low=0;
+ efs->_scan_fs_changes(efs->filesystem,sp);
}
efs->scanning_sources_done=true;
}
@@ -643,8 +850,17 @@ void EditorFileSystem::scan_sources() {
abort_scan=false;
if (!use_threads) {
- if (filesystem)
- _scan_sources(filesystem,NULL);
+ if (filesystem) {
+ EditorProgressBG pr("sources","ScanSources",1000);
+ ScanProgress sp;
+ sp.progress=&pr;
+ sp.hi=1;
+ sp.low=0;
+ scan_total=0;
+ _scan_fs_changes(filesystem,sp);
+ if (_update_scan_actions())
+ emit_signal("filesystem_changed");
+ }
scanning_sources=false;
scanning_sources_done=true;
emit_signal("sources_changed",sources_changed.size()>0);
@@ -652,8 +868,8 @@ void EditorFileSystem::scan_sources() {
ERR_FAIL_COND(thread_sources);
set_process(true);
+ scan_total=0;
Thread::Settings s;
- ss_amount=0;
s.priority=Thread::PRIORITY_LOW;
thread_sources = Thread::create(_thread_func_sources,this,s);
//tree->hide();
@@ -665,53 +881,14 @@ void EditorFileSystem::scan_sources() {
}
-EditorFileSystemDirectory* EditorFileSystem::_update_tree(DirItem *p_item) {
-
- EditorFileSystemDirectory *efd = memnew( EditorFileSystemDirectory );
-
- if (!p_item)
- return efd; //empty likely
- efd->name=p_item->name;
-
- for(int i=0;i<p_item->files.size();i++) {
-
- String s = p_item->files[i]->type;
- //if (p_item->files[i]->meta)
- // s="*"+s;
-
-// file_type_cache[p_item->files[i]->path]=s;
- if (p_item->files[i]->type=="")
- continue; //ignore because it's invalid
- EditorFileSystemDirectory::FileInfo fi;
- fi.file=p_item->files[i]->file;
- fi.type=p_item->files[i]->type;
- fi.meta=p_item->files[i]->meta;
- fi.modified_time=p_item->files[i]->modified_time;
-
- efd->files.push_back(fi);
-
- }
-
- for(int i=0;i<p_item->dirs.size();i++) {
-
- EditorFileSystemDirectory *efsd =_update_tree(p_item->dirs[i]);
- efsd->parent=efd;
- efd->subdirs.push_back( efsd );
-
- }
-
-
- return efd;
-}
-
void EditorFileSystem::_notification(int p_what) {
switch(p_what) {
case NOTIFICATION_ENTER_TREE: {
- _load_type_cache();
- scan();
+
+ scan();
} break;
case NOTIFICATION_EXIT_TREE: {
if (use_threads && thread) {
@@ -727,13 +904,13 @@ void EditorFileSystem::_notification(int p_what) {
set_process(false);
}
- if (rootdir)
- memdelete(rootdir);
- rootdir=NULL;
if (filesystem)
memdelete(filesystem);
+ if (new_filesystem)
+ memdelete(new_filesystem);
filesystem=NULL;
+ new_filesystem=NULL;
} break;
case NOTIFICATION_PROCESS: {
@@ -751,6 +928,8 @@ void EditorFileSystem::_notification(int p_what) {
Thread::wait_to_finish(thread_sources);
memdelete(thread_sources);
thread_sources=NULL;
+ if (_update_scan_actions())
+ emit_signal("filesystem_changed");
//print_line("sources changed: "+itos(sources_changed.size()));
emit_signal("sources_changed",sources_changed.size()>0);
}
@@ -758,21 +937,14 @@ void EditorFileSystem::_notification(int p_what) {
set_process(false);
- if (rootdir)
- memdelete(rootdir);
if (filesystem)
memdelete(filesystem);
- rootdir=scandir;
- scandir=NULL;
-// file_type_cache.clear();
- filesystem=_update_tree(rootdir);
-
- if (rootdir)
- memdelete(rootdir);
- rootdir=NULL;
+ filesystem=new_filesystem;
+ new_filesystem=NULL;
Thread::wait_to_finish(thread);
memdelete(thread);
thread=NULL;
+ _update_scan_actions();
emit_signal("filesystem_changed");
emit_signal("sources_changed",sources_changed.size()>0);
//print_line("initial sources changed: "+itos(sources_changed.size()));
@@ -794,7 +966,7 @@ bool EditorFileSystem::is_scanning() const {
}
float EditorFileSystem::get_scanning_progress() const {
- return total;
+ return scan_total;
}
EditorFileSystemDirectory *EditorFileSystem::get_filesystem() {
@@ -802,12 +974,12 @@ EditorFileSystemDirectory *EditorFileSystem::get_filesystem() {
return filesystem;
}
-void EditorFileSystem::_save_type_cache_fs(DirItem *p_dir,FileAccess *p_file) {
+void EditorFileSystem::_save_filesystem_cache(EditorFileSystemDirectory*p_dir,FileAccess *p_file) {
if (!p_dir)
return; //none
- p_file->store_line("::"+p_dir->path+"::"+String::num(p_dir->modified_time));
+ p_file->store_line("::"+p_dir->get_path()+"::"+String::num(p_dir->modified_time));
for(int i=0;i<p_dir->files.size();i++) {
@@ -832,126 +1004,96 @@ void EditorFileSystem::_save_type_cache_fs(DirItem *p_dir,FileAccess *p_file) {
p_file->store_line(s);
}
- for(int i=0;i<p_dir->dirs.size();i++) {
+ for(int i=0;i<p_dir->subdirs.size();i++) {
- _save_type_cache_fs(p_dir->dirs[i],p_file);
+ _save_filesystem_cache(p_dir->subdirs[i],p_file);
}
}
-void EditorFileSystem::_load_type_cache(){
-
- GLOBAL_LOCK_FUNCTION
-
-
-#if 0
- //this is not good, removed for now as it interferes with metadata stored in files
-
- String project=Globals::get_singleton()->get_resource_path();
- FileAccess *f =FileAccess::open(project+"/types.cache",FileAccess::READ);
-
- if (!f) {
-
- WARN_PRINT("Can't open types.cache.");
- return;
- }
-
- file_type_cache.clear();
- while(!f->eof_reached()) {
-
- String path=f->get_line();
- if (f->eof_reached())
- break;
- String type=f->get_line();
- file_type_cache[path]=type;
- }
-
- memdelete(f);
-#endif
-}
bool EditorFileSystem::_find_file(const String& p_file,EditorFileSystemDirectory ** r_d, int &r_file_pos) const {
//todo make faster
- if (!filesystem || scanning)
- return false;
+ if (!filesystem || scanning)
+ return false;
- String f = Globals::get_singleton()->localize_path(p_file);
+ String f = Globals::get_singleton()->localize_path(p_file);
- if (!f.begins_with("res://"))
- return false;
- f=f.substr(6,f.length());
- f=f.replace("\\","/");
+ if (!f.begins_with("res://"))
+ return false;
+ f=f.substr(6,f.length());
+ f=f.replace("\\","/");
- Vector<String> path = f.split("/");
+ Vector<String> path = f.split("/");
- if (path.size()==0)
- return false;
- String file=path[path.size()-1];
- path.resize(path.size()-1);
+ if (path.size()==0)
+ return false;
+ String file=path[path.size()-1];
+ path.resize(path.size()-1);
- EditorFileSystemDirectory *fs=filesystem;
+ EditorFileSystemDirectory *fs=filesystem;
- for(int i=0;i<path.size();i++) {
+ for(int i=0;i<path.size();i++) {
- int idx=-1;
- for(int j=0;j<fs->get_subdir_count();j++) {
+ int idx=-1;
+ for(int j=0;j<fs->get_subdir_count();j++) {
- if (fs->get_subdir(j)->get_name()==path[i]) {
- idx=j;
- break;
- }
- }
+ if (fs->get_subdir(j)->get_name()==path[i]) {
+ idx=j;
+ break;
+ }
+ }
- if (idx==-1) {
- //does not exist, create i guess?
- EditorFileSystemDirectory *efsd = memnew( EditorFileSystemDirectory );
- efsd->name=path[i];
- int idx2=0;
- for(int j=0;j<fs->get_subdir_count();j++) {
+ if (idx==-1) {
+ //does not exist, create i guess?
+ EditorFileSystemDirectory *efsd = memnew( EditorFileSystemDirectory );
+ efsd->name=path[i];
+ int idx2=0;
+ for(int j=0;j<fs->get_subdir_count();j++) {
- if (efsd->name<fs->get_subdir(j)->get_name())
- break;
- idx2++;
- }
+ if (efsd->name<fs->get_subdir(j)->get_name())
+ break;
+ idx2++;
+ }
- if (idx2==fs->get_subdir_count())
- fs->subdirs.push_back(efsd);
- else
- fs->subdirs.insert(idx2,efsd);
- fs=efsd;
- } else {
+ if (idx2==fs->get_subdir_count())
+ fs->subdirs.push_back(efsd);
+ else
+ fs->subdirs.insert(idx2,efsd);
+ fs=efsd;
+ } else {
- fs=fs->get_subdir(idx);
+ fs=fs->get_subdir(idx);
+ }
}
- }
- int cpos=-1;
- for(int i=0;i<fs->files.size();i++) {
+ int cpos=-1;
+ for(int i=0;i<fs->files.size();i++) {
- if (fs->files[i].file==file) {
- cpos=i;
- break;
+ if (fs->files[i]->file==file) {
+ cpos=i;
+ break;
+ }
}
- }
r_file_pos=cpos;
*r_d=fs;
- if (cpos!=-1) {
+ if (cpos!=-1) {
- return true;
- } else {
+ return true;
+ } else {
- return false;
- }
+ return false;
+ }
}
@@ -967,7 +1109,7 @@ String EditorFileSystem::get_file_type(const String& p_file) const {
}
- return fs->files[cpos].type;
+ return fs->files[cpos]->type;
}
@@ -1024,16 +1166,16 @@ EditorFileSystemDirectory *EditorFileSystem::get_path(const String& p_path) {
void EditorFileSystem::_resource_saved(const String& p_path){
- print_line("resource saved: "+p_path);
+ //print_line("resource saved: "+p_path);
EditorFileSystem::get_singleton()->update_file(p_path);
}
String EditorFileSystem::_find_first_from_source(EditorFileSystemDirectory* p_dir,const String &p_src) const {
for(int i=0;i<p_dir->files.size();i++) {
- for(int j=0;j<p_dir->files[i].meta.sources.size();j++) {
+ for(int j=0;j<p_dir->files[i]->meta.sources.size();j++) {
- if (p_dir->files[i].meta.sources[j].path==p_src)
+ if (p_dir->files[i]->meta.sources[j].path==p_src)
return p_dir->get_file_path(i);
}
}
@@ -1070,6 +1212,7 @@ void EditorFileSystem::update_file(const String& p_file) {
if (!FileAccess::exists(p_file)) {
//was removed
+ memdelete( fs->files[cpos] );
fs->files.remove(cpos);
call_deferred("emit_signal","filesystem_changed"); //update later
return;
@@ -1083,13 +1226,13 @@ void EditorFileSystem::update_file(const String& p_file) {
int idx=0;
for(int i=0;i<fs->files.size();i++) {
- if (p_file<fs->files[i].file)
+ if (p_file<fs->files[i]->file)
break;
idx++;
}
- EditorFileSystemDirectory::FileInfo fi;
- fi.file=p_file.get_file();
+ EditorFileSystemDirectory::FileInfo *fi = memnew( EditorFileSystemDirectory::FileInfo );
+ fi->file=p_file.get_file();
if (idx==fs->files.size()) {
fs->files.push_back(fi);
@@ -1102,10 +1245,10 @@ void EditorFileSystem::update_file(const String& p_file) {
}
- print_line("UPDATING: "+p_file);
- fs->files[cpos].type=type;
- fs->files[cpos].modified_time=FileAccess::get_modified_time(p_file);
- fs->files[cpos].meta=_get_meta(p_file);
+ //print_line("UPDATING: "+p_file);
+ fs->files[cpos]->type=type;
+ fs->files[cpos]->modified_time=FileAccess::get_modified_time(p_file);
+ fs->files[cpos]->meta=_get_meta(p_file);
call_deferred("emit_signal","filesystem_changed"); //update later
@@ -1128,15 +1271,22 @@ EditorFileSystem::EditorFileSystem() {
thread = NULL;
scanning=false;
- scandir=NULL;
- rootdir=NULL;
use_threads=true;
thread_sources=NULL;
+ new_filesystem=NULL;
scanning_sources=false;
ResourceSaver::set_save_callback(_resource_saved);
+ List<String> extensionsl;
+ ResourceLoader::get_recognized_extensions_for_type("",&extensionsl);
+ for(List<String>::Element *E = extensionsl.front();E;E=E->next()) {
+
+ valid_extensions.insert(E->get());
+ }
+
+ scan_total=0;
}
EditorFileSystem::~EditorFileSystem() {
diff --git a/tools/editor/editor_file_system.h b/tools/editor/editor_file_system.h
index 0db2dc150e..d11fa0cfb1 100644
--- a/tools/editor/editor_file_system.h
+++ b/tools/editor/editor_file_system.h
@@ -42,6 +42,8 @@ class EditorFileSystemDirectory : public Object {
OBJ_TYPE( EditorFileSystemDirectory,Object );
String name;
+ uint64_t modified_time;
+ bool verified; //used for checking changes
EditorFileSystemDirectory *parent;
Vector<EditorFileSystemDirectory*> subdirs;
@@ -68,11 +70,20 @@ class EditorFileSystemDirectory : public Object {
String file;
StringName type;
uint64_t modified_time;
-
ImportMeta meta;
+ bool verified; //used for checking changes
+
+ };
+
+ struct FileInfoSort {
+ bool operator()(const FileInfo *p_a,const FileInfo *p_b) const {
+ return p_a->file<p_b->file;
+ }
};
- Vector<FileInfo> files;
+ void sort_files();
+
+ Vector<FileInfo*> files;
static void _bind_methods();
@@ -96,6 +107,9 @@ public:
EditorFileSystemDirectory *get_parent();
+ int find_file_index(const String& p_file) const;
+ int find_dir_index(const String& p_dir) const;
+
EditorFileSystemDirectory();
~EditorFileSystemDirectory();
@@ -107,45 +121,47 @@ class EditorFileSystem : public Node {
_THREAD_SAFE_CLASS_
- struct SceneItem {
+
+ struct ItemAction {
+
+ enum Action {
+ ACTION_NONE,
+ ACTION_DIR_ADD,
+ ACTION_DIR_REMOVE,
+ ACTION_FILE_ADD,
+ ACTION_FILE_REMOVE,
+ ACTION_FILE_SOURCES_CHANGED
+ };
+
+ Action action;
+ EditorFileSystemDirectory *dir;
String file;
- String path;
- String type;
- uint64_t modified_time;
- EditorFileSystemDirectory::ImportMeta meta;
- };
+ EditorFileSystemDirectory *new_dir;
+ EditorFileSystemDirectory::FileInfo *new_file;
- struct DirItem {
+ ItemAction() { action=ACTION_NONE; dir=NULL; new_dir=NULL; new_file=NULL; }
- uint64_t modified_time;
- String path;
- String name;
- Vector<DirItem*> dirs;
- Vector<SceneItem*> files;
- ~DirItem();
};
- float total;
bool use_threads;
Thread *thread;
static void _thread_func(void *_userdata);
- DirItem *scandir;
- DirItem *rootdir;
+ EditorFileSystemDirectory *new_filesystem;
bool abort_scan;
bool scanning;
+ float scan_total;
- EditorFileSystemDirectory* _update_tree(DirItem *p_item);
- void _scan_scenes();
- void _load_type_cache();
+ void _scan_filesystem();
EditorFileSystemDirectory *filesystem;
static EditorFileSystem *singleton;
+ /* Used for reading the filesystem cache file */
struct FileCache {
String type;
@@ -154,34 +170,43 @@ class EditorFileSystem : public Node {
Vector<String> deps;
};
- struct DirCache {
+ HashMap<String,FileCache> file_cache;
- uint64_t modification_time;
- Set<String> files;
- Set<String> subdirs;
- };
+ struct ScanProgress {
+ float low;
+ float hi;
+ mutable EditorProgressBG *progress;
+ void update(int p_current,int p_total) const;
+ ScanProgress get_sub(int p_current,int p_total) const;
+ };
static EditorFileSystemDirectory::ImportMeta _get_meta(const String& p_path);
- bool _check_meta_sources(EditorFileSystemDirectory::ImportMeta & p_meta,EditorProgressBG *ep=NULL);
+ bool _check_meta_sources(EditorFileSystemDirectory::ImportMeta & p_meta);
- DirItem* _scan_dir(DirAccess *da,Set<String> &extensions,String p_name,float p_from,float p_range,const String& p_path,HashMap<String,FileCache> &file_cache,HashMap<String,DirCache> &dir_cache,EditorProgressBG& p_prog);
- void _save_type_cache_fs(DirItem *p_dir,FileAccess *p_file);
+ void _save_filesystem_cache(EditorFileSystemDirectory *p_dir,FileAccess *p_file);
bool _find_file(const String& p_file,EditorFileSystemDirectory ** r_d, int &r_file_pos) const;
- void _scan_sources(EditorFileSystemDirectory *p_dir,EditorProgressBG *ep);
+ void _scan_fs_changes(EditorFileSystemDirectory *p_dir, const ScanProgress &p_progress);
int md_count;
+ Set<String> valid_extensions;
+
+ void _scan_new_dir(EditorFileSystemDirectory *p_dir,DirAccess *da,const ScanProgress& p_progress);
Thread *thread_sources;
bool scanning_sources;
bool scanning_sources_done;
- int ss_amount;
+
static void _thread_func_sources(void *_userdata);
+
List<String> sources_changed;
+ List<ItemAction> scan_actions;
+
+ bool _update_scan_actions();
static void _resource_saved(const String& p_path);
String _find_first_from_source(EditorFileSystemDirectory* p_dir,const String &p_src) const;
diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp
index bcac82fc1b..5203ace125 100644
--- a/tools/editor/editor_import_export.cpp
+++ b/tools/editor/editor_import_export.cpp
@@ -455,6 +455,9 @@ bool EditorExportPlatformPC::_set(const StringName& p_name, const Variant& p_val
} else if (n=="resources/pack_mode") {
export_mode=ExportMode(int(p_value));
+ } else if (n=="resources/bundle_dependencies_(for_optical_disc)") {
+
+ bundle=p_value;
} else if (n=="binary/64_bits") {
use64=p_value;
@@ -478,6 +481,9 @@ bool EditorExportPlatformPC::_get(const StringName& p_name,Variant &r_ret) const
} else if (n=="resources/pack_mode") {
r_ret=export_mode;
+ } else if (n=="resources/bundle_dependencies_(for_optical_disc)") {
+
+ r_ret=bundle;
} else if (n=="binary/64_bits") {
r_ret=use64;
@@ -492,7 +498,8 @@ void EditorExportPlatformPC::_get_property_list( List<PropertyInfo> *p_list) con
p_list->push_back( PropertyInfo( Variant::STRING, "custom_binary/debug", PROPERTY_HINT_GLOBAL_FILE,binary_extension));
p_list->push_back( PropertyInfo( Variant::STRING, "custom_binary/release", PROPERTY_HINT_GLOBAL_FILE,binary_extension));
- p_list->push_back( PropertyInfo( Variant::INT, "resources/pack_mode", PROPERTY_HINT_ENUM,"Single Exec.,Exec+Pack (.pck),Copy,Bundles (Optical)"));
+ p_list->push_back( PropertyInfo( Variant::INT, "resources/pack_mode", PROPERTY_HINT_ENUM,"Pack into executable,Pack into binary file (.pck),Pack into archive file (.zip)"));
+ p_list->push_back( PropertyInfo( Variant::BOOL, "resources/bundle_dependencies_(for_optical_disc)"));
p_list->push_back( PropertyInfo( Variant::BOOL, "binary/64_bits"));
}
@@ -1274,26 +1281,32 @@ Error EditorExportPlatformPC::export_project(const String& p_path, bool p_debug,
}
}
+ String dstfile = p_path.replace_first("res://","").replace("\\","/");
if (export_mode!=EXPORT_EXE) {
- String dstfile=p_path.replace_first("res://","").replace("\\","/");
+ String dstfile_extension=export_mode==EXPORT_ZIP?".zip":".pck";
if (dstfile.find("/")!=-1)
- dstfile=dstfile.get_base_dir()+"/data.pck";
+ dstfile=dstfile.get_base_dir()+"/data"+dstfile_extension;
else
- dstfile="data.pck";
+ dstfile="data"+dstfile_extension;
+ if (export_mode==EXPORT_PACK) {
+
+ memdelete(dst);
- memdelete(dst);
- dst=FileAccess::open(dstfile,FileAccess::WRITE);
- if (!dst) {
+ dst=FileAccess::open(dstfile,FileAccess::WRITE);
+ if (!dst) {
- EditorNode::add_io_error("Can't write data pack to:\n "+p_path);
- return ERR_FILE_CANT_WRITE;
+ EditorNode::add_io_error("Can't write data pack to:\n "+p_path);
+ return ERR_FILE_CANT_WRITE;
+ }
}
}
+
+
memdelete(src_exe);
- Error err = save_pack(dst,export_mode==EXPORT_BUNDLES);
+ Error err = export_mode==EXPORT_ZIP?save_zip(dstfile,bundle):save_pack(dst,bundle);
memdelete(dst);
return err;
}
@@ -1836,6 +1849,15 @@ void EditorImportExport::load_config() {
if (cf->has_section("convert_samples")) {
+ if (cf->has_section_key("convert_samples","action")) {
+ String action = cf->get_value("convert_samples","action");
+ if (action=="none") {
+ sample_action=SAMPLE_ACTION_NONE;
+ } else if (action=="compress_ram") {
+ sample_action=SAMPLE_ACTION_COMPRESS_RAM;
+ }
+ }
+
if (cf->has_section_key("convert_samples","max_hz"))
sample_action_max_hz=cf->get_value("convert_samples","max_hz");
diff --git a/tools/editor/editor_import_export.h b/tools/editor/editor_import_export.h
index 3dc78c88aa..1a0686fb50 100644
--- a/tools/editor/editor_import_export.h
+++ b/tools/editor/editor_import_export.h
@@ -175,8 +175,7 @@ public:
enum ExportMode {
EXPORT_EXE,
EXPORT_PACK,
- EXPORT_COPY,
- EXPORT_BUNDLES
+ EXPORT_ZIP
};
@@ -198,6 +197,7 @@ private:
Ref<Texture> logo;
ExportMode export_mode;
+ bool bundle;
protected:
bool _set(const StringName& p_name, const Variant& p_value);
diff --git a/tools/editor/editor_log.cpp b/tools/editor/editor_log.cpp
index 48f7c90066..601e53eabb 100644
--- a/tools/editor/editor_log.cpp
+++ b/tools/editor/editor_log.cpp
@@ -243,7 +243,7 @@ EditorLog::EditorLog() {
log->set_selection_enabled(true);
log->set_focus_mode(FOCUS_CLICK);
pc->add_child(log);
- add_message(VERSION_FULL_NAME" (c) 2008-2015 Juan Linietsky, Ariel Manzur.");
+ add_message(VERSION_FULL_NAME" (c) 2008-2016 Juan Linietsky, Ariel Manzur.");
//log->add_text("Initialization Complete.\n"); //because it looks cool.
add_style_override("panel",get_stylebox("panelf","Panel"));
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 9151e63df6..d664a91c47 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -143,6 +143,7 @@ void EditorNode::_update_scene_tabs() {
}
scene_tabs->set_current_tab(editor_data.get_edited_scene());
+ scene_tabs->ensure_tab_visible(editor_data.get_edited_scene());
}
@@ -415,7 +416,7 @@ void EditorNode::_rebuild_import_menu()
{
PopupMenu* p = import_menu->get_popup();
p->clear();
- p->add_item("Sub-Scene", FILE_IMPORT_SUBSCENE);
+ p->add_item("Node from scene", FILE_IMPORT_SUBSCENE);
p->add_separator();
for (int i = 0; i < editor_import_export->get_import_plugin_count(); i++) {
p->add_item(editor_import_export->get_import_plugin(i)->get_visible_name(), IMPORT_PLUGIN_BASE + i);
@@ -520,7 +521,7 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource) {
List<String> preferred;
for(int i=0;i<extensions.size();i++) {
- if (p_resource->is_type("Script") && extensions[i]=="tres" || extensions[i]=="res" || extensions[i]=="xml") {
+ if (p_resource->is_type("Script") && (extensions[i]=="tres" || extensions[i]=="res" || extensions[i]=="xml")) {
//this serves no purpose and confused people
continue;
}
@@ -1193,75 +1194,6 @@ void EditorNode::_dialog_action(String p_file) {
save_translatable_strings(p_file);
} break;
- case FILE_SAVE_SUBSCENE: {
-
- List<Node*> selection = editor_selection->get_selected_node_list();
-
- if (selection.size()!=1) {
-
- current_option=-1;
- //confirmation->get_cancel()->hide();
- accept->get_ok()->set_text("I see..");
- accept->set_text("This operation requieres a single selected node.");
- accept->popup_centered_minsize();
- break;
- }
-
- Node *base = selection.front()->get();
-
- Map<Node*,Node*> reown;
- reown[editor_data.get_edited_scene_root()]=base;
- Node *copy = base->duplicate_and_reown(reown);
- if (copy) {
-
- Ref<PackedScene> sdata = memnew( PackedScene );
- Error err = sdata->pack(copy);
- memdelete(copy);
-
- if (err!=OK) {
-
-
- current_option=-1;
- //accept->get_cancel()->hide();
- accept->get_ok()->set_text("I see..");
- accept->set_text("Couldn't save subscene. Likely dependencies (instances) couldn't be satisfied.");
- accept->popup_centered_minsize();
- return;
- }
-
- int flg=0;
- if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources"))
- flg|=ResourceSaver::FLAG_COMPRESS;
- if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative"))
- flg|=ResourceSaver::FLAG_RELATIVE_PATHS;
-
-
- err = ResourceSaver::save(p_file,sdata,flg);
- if (err!=OK) {
-
- current_option=-1;
- //confirmation->get_cancel()->hide();
- accept->get_ok()->set_text("I see..");
- accept->set_text("Error saving scene.");
- accept->popup_centered_minsize();
- break;
- }
- //EditorFileSystem::get_singleton()->update_file(p_file,sdata->get_type());
-
- } else {
-
- current_option=-1;
- //confirmation->get_cancel()->hide();
- accept->get_ok()->set_text("I see..");
- accept->set_text("Error duplicating scene to save it.");
- accept->popup_centered_minsize();
- break;
-
- }
-
-
- } break;
-
case FILE_SAVE_SCENE:
case FILE_SAVE_AS_SCENE: {
@@ -1321,10 +1253,18 @@ void EditorNode::_dialog_action(String p_file) {
case FILE_EXPORT_TILESET: {
Ref<TileSet> ml;
- if (file_export_lib_merge->is_pressed() && FileAccess::exists(p_file)) {
+ if (FileAccess::exists(p_file)) {
ml=ResourceLoader::load(p_file,"TileSet");
- if (ml.is_null()) {
+ if (!file_export_lib_merge->is_pressed()) {
+ ml->clear();
+ }
+
+ }
+
+ if (ml.is_null()) {
+
+ if (file_export_lib_merge->is_pressed()) {
current_option=-1;
//accept->get_cancel()->hide();
accept->get_ok()->set_text("I see..");
@@ -1333,9 +1273,6 @@ void EditorNode::_dialog_action(String p_file) {
return;
}
- }
-
- if (ml.is_null()) {
ml = Ref<TileSet>( memnew( TileSet ));
}
@@ -1445,17 +1382,15 @@ void EditorNode::_dialog_action(String p_file) {
if (p_file.empty())
return;
- if (p_file=="Default") {
- confirm_error->set_text("Cannot overwrite default layout!");
- confirm_error->popup_centered_minsize();
- return;
- }
-
Ref<ConfigFile> config;
config.instance();
Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
- if (err!=OK && err!=ERR_FILE_NOT_FOUND) {
- return; //no config
+
+ if (err==ERR_CANT_OPEN) {
+ config.instance(); // new config
+ } else if (err!=OK) {
+ show_warning("Error trying to save layout!");
+ return;
}
_save_docks_to_config(config, p_file);
@@ -1465,28 +1400,22 @@ void EditorNode::_dialog_action(String p_file) {
layout_dialog->hide();
_update_layouts_menu();
+ if (p_file=="Default") {
+ show_warning("Default editor layout overridden.");
+ }
+
} break;
case SETTINGS_LAYOUT_DELETE: {
if (p_file.empty())
return;
- if (p_file=="Default") {
- confirm_error->set_text("Cannot delete default layout!");
- confirm_error->popup_centered_minsize();
- return;
- }
-
Ref<ConfigFile> config;
config.instance();
Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
- if (err!=OK) {
- return; //no config
- }
- if (!config->has_section(p_file)) {
- confirm_error->set_text("Layout name not found!");
- confirm_error->popup_centered_minsize();
+ if (err!=OK || !config->has_section(p_file)) {
+ show_warning("Layout name not found!");
return;
}
@@ -1502,6 +1431,10 @@ void EditorNode::_dialog_action(String p_file) {
layout_dialog->hide();
_update_layouts_menu();
+ if (p_file=="Default") {
+ show_warning("Restored Default layout to base settings.");
+ }
+
} break;
default: { //save scene?
@@ -2074,21 +2007,21 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
} break;
case FILE_QUICK_OPEN_SCENE: {
- quick_open->popup("PackedScene");
+ quick_open->popup("PackedScene", true);
quick_open->set_title("Quick Open Scene..");
} break;
case FILE_QUICK_OPEN_SCRIPT: {
- quick_open->popup("Script");
+ quick_open->popup("Script", true);
quick_open->set_title("Quick Open Script..");
} break;
case FILE_QUICK_OPEN_FILE: {
- quick_open->popup("Resource",false,true);
+ quick_open->popup("Resource", false, true);
quick_open->set_title("Quick Search File..");
} break;
@@ -2106,7 +2039,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
} break;
case FILE_CLOSE: {
- if (!p_confirmed) {
+ if (!p_confirmed && unsaved_cache) {
confirmation->get_ok()->set_text("Yes");
//confirmation->get_cancel()->show();
confirmation->set_text("Close scene? (Unsaved changes will be lost)");
@@ -2239,70 +2172,6 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
file->set_title("Save Translatable Strings");
file->popup_centered_ratio();
-
- } break;
-
- case FILE_SAVE_SUBSCENE: {
-
- Node *scene = editor_data.get_edited_scene_root();
-
- if (!scene) {
-
- current_option=-1;
- //confirmation->get_cancel()->hide();
- accept->get_ok()->set_text("I see..");
- accept->set_text("This operation can't be done without a scene.");
- accept->popup_centered_minsize();
- break;
- }
-
-
- List<Node*> selection = editor_selection->get_selected_node_list();
-
- if (selection.size()!=1) {
-
- current_option=-1;
- //confirmation->get_cancel()->hide();
- accept->get_ok()->set_text("I see..");
- accept->set_text("This operation requieres a single selected node.");
- accept->popup_centered_minsize();
- break;
- }
-
- Node *tocopy = selection.front()->get();
-
- if (tocopy!=editor_data.get_edited_scene_root() && tocopy->get_filename()!="") {
-
-
- current_option=-1;
- //confirmation->get_cancel()->hide();
- accept->get_ok()->set_text("I see..");
- accept->set_text("This operation can't be done on instanced scenes.");
- accept->popup_centered_minsize();
- break;
- }
-
- file->set_mode(EditorFileDialog::MODE_SAVE_FILE);
-
- List<String> extensions;
- Ref<PackedScene> sd = memnew( PackedScene );
- ResourceSaver::get_recognized_extensions(sd,&extensions);
- file->clear_filters();
- for(int i=0;i<extensions.size();i++) {
-
- file->add_filter("*."+extensions[i]+" ; "+extensions[i].to_upper());
- }
-
-
- String existing;
- if (extensions.size()) {
- existing="new_scene."+extensions.front()->get().to_lower();
- }
- file->set_current_path(existing);
-
-
- file->popup_centered_ratio();
- file->set_title("Save Sub-Scene As..");
} break;
case FILE_SAVE_OPTIMIZED: {
Node *scene = editor_data.get_edited_scene_root();
@@ -3167,7 +3036,7 @@ Error EditorNode::save_translatable_strings(const String& p_to_file) {
OS::Time time = OS::get_singleton()->get_time();
f->store_line("# Translation Strings Dump.");
f->store_line("# Created By.");
- f->store_line("# \t" VERSION_FULL_NAME " (c) 2008-2015 Juan Linietsky, Ariel Manzur.");
+ f->store_line("# \t" VERSION_FULL_NAME " (c) 2008-2016 Juan Linietsky, Ariel Manzur.");
f->store_line("# From Scene: ");
f->store_line("# \t"+get_edited_scene()->get_filename());
f->store_line("");
@@ -3533,11 +3402,13 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo
}
- for(int i=0;i<editor_data.get_edited_scene_count();i++) {
+ if(!p_set_inherited) {
+ for(int i=0;i<editor_data.get_edited_scene_count();i++) {
- if (editor_data.get_scene_path(i)==p_scene) {
- _scene_tab_changed(i);
- return OK;
+ if (editor_data.get_scene_path(i)==p_scene) {
+ _scene_tab_changed(i);
+ return OK;
+ }
}
}
@@ -3619,7 +3490,18 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo
add_io_error(txt);
}
- sdata->set_path(lpath,true); //take over path
+ if (ResourceCache::has(lpath)) {
+ //used from somewhere else? no problem! update state and replace sdata
+ Ref<PackedScene> ps = Ref<PackedScene>( ResourceCache::get(lpath)->cast_to<PackedScene>() );
+ if (ps.is_valid()) {
+ ps->replace_state( sdata->get_state() );
+ ps->set_last_modified_time( sdata->get_last_modified_time() );
+ sdata=ps;
+ }
+
+ } else {
+ sdata->set_path(lpath,true); //take over path
+ }
Node*new_scene=sdata->instance(true);
@@ -3822,7 +3704,6 @@ void EditorNode::animation_editor_make_visible(bool p_visible) {
}
animation_editor->set_keying(p_visible);
- _update_keying();
}
@@ -3923,19 +3804,26 @@ void EditorNode::hide_animation_player_editors() {
emit_signal("hide_animation_player_editors");
}
-void EditorNode::_quick_opened(const String& p_resource) {
+void EditorNode::_quick_opened() {
if (current_option==FILE_QUICK_OPEN_FILE) {
- scenes_dock->open(p_resource);
+ String res_path = quick_open->get_selected();
+
+ scenes_dock->open(res_path);
return;
}
- if (quick_open->get_base_type()=="PackedScene") {
- open_request(p_resource);
- } else {
- load_resource(p_resource);
- }
+ Vector<String> files = quick_open->get_selected_files();
+ for (int i = 0; i < files.size(); i++) {
+ String res_path = files[i];
+
+ if (quick_open->get_base_type()=="PackedScene") {
+ open_request(res_path);
+ } else {
+ load_resource(res_path);
+ }
+ }
}
void EditorNode::_quick_run(const String& p_resource) {
@@ -4503,7 +4391,11 @@ void EditorNode::_load_docks() {
config.instance();
Error err = config->load(EditorSettings::get_singleton()->get_project_settings_path().plus_file("editor_layout.cfg"));
if (err!=OK) {
- return; //no config
+ //no config
+ if (overridden_default_layout>=0) {
+ _layout_menu_option(overridden_default_layout);
+ }
+ return;
}
_load_docks_from_config(config, "docks");
@@ -4605,6 +4497,8 @@ void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String&
void EditorNode::_update_layouts_menu() {
editor_layouts->clear();
+ overridden_default_layout=-1;
+
editor_layouts->set_size(Vector2());
editor_layouts->add_item("Save Layout", SETTINGS_LAYOUT_SAVE);
editor_layouts->add_item("Delete Layout", SETTINGS_LAYOUT_DELETE);
@@ -4625,8 +4519,12 @@ void EditorNode::_update_layouts_menu() {
String layout=E->get();
- if (layout!="Default")
- editor_layouts->add_item(layout);
+ if (layout=="Default") {
+ editor_layouts->remove_item(editor_layouts->get_item_index(SETTINGS_LAYOUT_DEFAULT));
+ overridden_default_layout=editor_layouts->get_item_count();
+ }
+
+ editor_layouts->add_item(layout);
}
}
@@ -4651,7 +4549,7 @@ void EditorNode::_layout_menu_option(int p_id) {
} break;
case SETTINGS_LAYOUT_DEFAULT: {
- _load_docks_from_config(default_theme, "docks");
+ _load_docks_from_config(default_layout, "docks");
_save_docks();
} break;
default: {
@@ -4665,7 +4563,6 @@ void EditorNode::_layout_menu_option(int p_id) {
_load_docks_from_config(config, editor_layouts->get_item_text(p_id));
_save_docks();
-
}
}
@@ -4715,11 +4612,13 @@ void EditorNode::_scene_tab_changed(int p_tab) {
editor_data.get_undo_redo().add_do_method(this,"set_current_version",unsaved?saved_version:0);
editor_data.get_undo_redo().add_do_method(this,"set_current_scene",p_tab);
editor_data.get_undo_redo().add_do_method(scene_tabs,"set_current_tab",p_tab);
+ editor_data.get_undo_redo().add_do_method(scene_tabs,"ensure_tab_visible",p_tab);
editor_data.get_undo_redo().add_do_method(this,"set_current_version",next_scene_version==0?editor_data.get_undo_redo().get_version()+1:next_scene_version);
editor_data.get_undo_redo().add_undo_method(this,"set_current_version",next_scene_version);
editor_data.get_undo_redo().add_undo_method(this,"set_current_scene",editor_data.get_edited_scene());
editor_data.get_undo_redo().add_undo_method(scene_tabs,"set_current_tab",editor_data.get_edited_scene());
+ editor_data.get_undo_redo().add_undo_method(scene_tabs,"ensure_tab_visible",p_tab,editor_data.get_edited_scene());
editor_data.get_undo_redo().add_undo_method(this,"set_current_version",saved_version);
editor_data.get_undo_redo().commit_action();
@@ -5035,7 +4934,7 @@ EditorNode::EditorNode() {
scene_tabs=memnew( Tabs );
scene_tabs->add_tab("unsaved");
scene_tabs->set_tab_align(Tabs::ALIGN_CENTER);
- scene_tabs->set_tab_close_display_policy(Tabs::SHOW_ACTIVE_ONLY);
+ scene_tabs->set_tab_close_display_policy(Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY);
scene_tabs->connect("tab_changed",this,"_scene_tab_changed");
scene_tabs->connect("right_button_pressed",this,"_scene_tab_script_edited");
scene_tabs->connect("tab_close", this, "_scene_tab_closed");
@@ -5170,7 +5069,6 @@ EditorNode::EditorNode() {
pm_export->set_name("Export");
p->add_child(pm_export);
p->add_submenu_item("Convert To..","Export");
- pm_export->add_item("Subscene..",FILE_SAVE_SUBSCENE);
pm_export->add_item("Translatable Strings..",FILE_DUMP_STRINGS);
pm_export->add_separator();
pm_export->add_item("MeshLibrary..",FILE_EXPORT_MESH_LIBRARY);
@@ -5187,7 +5085,11 @@ EditorNode::EditorNode() {
p->add_separator();
p->add_item("Revert Scene",EDIT_REVERT);
p->add_separator();
+#ifdef OSX_ENABLED
p->add_item("Quit to Project List",RUN_PROJECT_MANAGER,KEY_MASK_SHIFT+KEY_MASK_ALT+KEY_Q);
+#else
+ p->add_item("Quit to Project List",RUN_PROJECT_MANAGER,KEY_MASK_SHIFT+KEY_MASK_CTRL+KEY_Q);
+#endif
p->add_item("Quit",FILE_QUIT,KEY_MASK_CMD+KEY_Q);
recent_scenes = memnew( PopupMenu );
@@ -5444,8 +5346,6 @@ EditorNode::EditorNode() {
gui_base->add_child(layout_dialog);
layout_dialog->set_hide_on_ok(false);
layout_dialog->set_size(Size2(175, 70));
- confirm_error = memnew( AcceptDialog );
- layout_dialog->add_child(confirm_error);
layout_dialog->connect("name_confirmed", this,"_dialog_action");
sources_button = memnew( ToolButton );
@@ -5636,15 +5536,16 @@ EditorNode::EditorNode() {
const String docks_section = "docks";
- default_theme.instance();
- default_theme->set_value(docks_section, "dock_3", "Scene");
- default_theme->set_value(docks_section, "dock_4", "FileSystem");
- default_theme->set_value(docks_section, "dock_5", "Inspector");
+ overridden_default_layout=-1;
+ default_layout.instance();
+ default_layout->set_value(docks_section, "dock_3", "Scene");
+ default_layout->set_value(docks_section, "dock_4", "FileSystem");
+ default_layout->set_value(docks_section, "dock_5", "Inspector");
for(int i=0;i<DOCK_SLOT_MAX/2;i++)
- default_theme->set_value(docks_section, "dock_hsplit_"+itos(i+1), 0);
+ default_layout->set_value(docks_section, "dock_hsplit_"+itos(i+1), 0);
for(int i=0;i<DOCK_SLOT_MAX/2;i++)
- default_theme->set_value(docks_section, "dock_split_"+itos(i+1), 0);
+ default_layout->set_value(docks_section, "dock_split_"+itos(i+1), 0);
_update_layouts_menu();
@@ -5787,7 +5688,7 @@ EditorNode::EditorNode() {
about->get_ok()->set_text("Thanks!");
about->set_hide_on_ok(true);
Label *about_text = memnew( Label );
- about_text->set_text(VERSION_FULL_NAME"\n(c) 2008-2015 Juan Linietsky, Ariel Manzur.\n");
+ about_text->set_text(VERSION_FULL_NAME"\n(c) 2008-2016 Juan Linietsky, Ariel Manzur.\n");
about_text->set_pos(Point2(gui_base->get_icon("Logo","EditorIcons")->get_size().width+30,20));
gui_base->add_child(about);
about->add_child(about_text);
@@ -5940,7 +5841,8 @@ EditorNode::EditorNode() {
add_editor_plugin( memnew( Polygon2DEditorPlugin(this) ) );
add_editor_plugin( memnew( LightOccluder2DEditorPlugin(this) ) );
add_editor_plugin( memnew( NavigationPolygonEditorPlugin(this) ) );
- add_editor_plugin( memnew( ColorRampEditorPlugin(this) ) );
+ add_editor_plugin( memnew( ColorRampEditorPlugin(this,true) ) );
+ add_editor_plugin( memnew( ColorRampEditorPlugin(this,false) ) );
add_editor_plugin( memnew( CollisionShape2DEditorPlugin(this) ) );
for(int i=0;i<EditorPlugins::get_plugin_count();i++)
@@ -5953,6 +5855,7 @@ EditorNode::EditorNode() {
resource_preview->add_preview_generator( Ref<EditorScriptPreviewPlugin>( memnew(EditorScriptPreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorSamplePreviewPlugin>( memnew(EditorSamplePreviewPlugin )));
resource_preview->add_preview_generator( Ref<EditorMeshPreviewPlugin>( memnew(EditorMeshPreviewPlugin )));
+ resource_preview->add_preview_generator( Ref<EditorBitmapPreviewPlugin>( memnew(EditorBitmapPreviewPlugin )));
circle_step_msec=OS::get_singleton()->get_ticks_msec();
circle_step_frame=OS::get_singleton()->get_frames_drawn();
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index 2228e0948b..976c55a924 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -100,13 +100,12 @@ typedef void (*EditorNodeInitCallback)();
class EditorNode : public Node {
OBJ_TYPE( EditorNode, Node );
-
+
enum {
-
- HISTORY_SIZE=64
+ HISTORY_SIZE=64
};
+
enum MenuOptions {
-
FILE_NEW_SCENE,
FILE_NEW_INHERITED_SCENE,
FILE_OPEN_SCENE,
@@ -119,7 +118,6 @@ class EditorNode : public Node {
FILE_EXPORT_MESH_LIBRARY,
FILE_EXPORT_TILESET,
FILE_SAVE_OPTIMIZED,
- FILE_SAVE_SUBSCENE,
FILE_DUMP_STRINGS,
FILE_OPEN_RECENT,
FILE_OPEN_OLD_SCENE,
@@ -288,10 +286,10 @@ class EditorNode : public Node {
AcceptDialog *about;
AcceptDialog *warning;
- Ref<ConfigFile> default_theme;
+ int overridden_default_layout;
+ Ref<ConfigFile> default_layout;
PopupMenu *editor_layouts;
EditorNameDialog *layout_dialog;
- AcceptDialog *confirm_error;
//OptimizedPresetsDialog *optimized_presets;
EditorSettingsDialog *settings_config_dialog;
@@ -440,7 +438,7 @@ class EditorNode : public Node {
void _update_keying();
void _hide_top_editors();
- void _quick_opened(const String& p_resource);
+ void _quick_opened();
void _quick_run(const String& p_resource);
void _run(bool p_current=false, const String &p_custom="");
diff --git a/tools/editor/icons/icon_create_new_scene_from.png b/tools/editor/icons/icon_create_new_scene_from.png
new file mode 100644
index 0000000000..e747c4f59f
--- /dev/null
+++ b/tools/editor/icons/icon_create_new_scene_from.png
Binary files differ
diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp
index 7bb2b5b77d..9b4ca246e7 100644
--- a/tools/editor/io_plugins/editor_font_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp
@@ -621,6 +621,7 @@ public:
source->get_file_dialog()->set_mode(EditorFileDialog::MODE_OPEN_FILE);
source->get_file_dialog()->add_filter("*.ttf;TrueType");
source->get_file_dialog()->add_filter("*.otf;OpenType");
+ source->get_file_dialog()->add_filter("*.fnt;BMFont");
source->get_line_edit()->connect("text_entered",this,"_src_changed");
vbl->add_margin_child("Source Font:",source);
@@ -876,10 +877,31 @@ static unsigned char get_SDF_radial(
Ref<Font> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMetadata>& p_from, const String &p_existing) {
+
+
Ref<ResourceImportMetadata> from = p_from;
ERR_FAIL_COND_V(from->get_source_count()!=1,Ref<Font>());
String src_path = EditorImportPlugin::expand_source_path(from->get_source_path(0));
+
+ if (src_path.extension().to_lower()=="fnt") {
+
+ if (ResourceLoader::load(src_path).is_valid()) {
+ EditorNode::get_singleton()->show_warning("Path: "+src_path+"\nIs a Godot font file, please supply a BMFont type file instead.");
+ return Ref<Font>();
+ }
+
+ Ref<Font> font;
+ font.instance();
+ Error err = font->create_from_fnt(src_path);
+ if (err) {
+ EditorNode::get_singleton()->show_warning("Path: "+src_path+"\nFailed opening as BMFont file.");
+ return Ref<Font>();
+ }
+
+ return font;
+ }
+
int size = from->get_option("font/size");
#ifdef FREETYPE_ENABLED
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp
index f3cf53cbdf..2eaf017d08 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp
@@ -194,7 +194,7 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) {
void CanvasItemEditor::_unhandled_key_input(const InputEvent& p_ev) {
- if (!is_visible())
+ if (!is_visible() || window_has_modal_stack())
return;
if (p_ev.key.mod.control)
// prevent to change tool mode when control key is pressed
@@ -405,9 +405,9 @@ void CanvasItemEditor::_node_removed(Node *p_node) {
#endif
}
-void CanvasItemEditor::_keying_changed(bool p_changed) {
+void CanvasItemEditor::_keying_changed() {
- if (p_changed)
+ if (editor->get_animation_editor()->has_keying())
animation_hb->show();
else
animation_hb->hide();
@@ -1541,6 +1541,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
continue;
}
+
dfrom = drag_point_from;
dto = snap_point(dto - (drag == DRAG_ALL ? drag_from - drag_point_from : Vector2(0, 0)), drag_point_from);
@@ -1548,30 +1549,35 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
canvas_item->get_global_transform_with_canvas().affine_inverse().xform(dto) -
canvas_item->get_global_transform_with_canvas().affine_inverse().xform(dfrom);
-
Rect2 local_rect = canvas_item->get_item_rect();
-
- if (false && drag!=DRAG_ALL && m.mod.alt) {
- float aspect = local_rect.size.get_aspect();
- if (aspect!=0) {
- if (ABS(drag_vector.x) > ABS(drag_vector.y)) {
-
- drag_vector.y = ABS(drag_vector.x)/aspect * SGN(drag_vector.y);
- } else {
-
- drag_vector.x = ABS(drag_vector.y)*aspect * SGN(drag_vector.x);
- }
- }
- }
-
-
-
Vector2 begin=local_rect.pos;
Vector2 end=local_rect.pos+local_rect.size;
Vector2 minsize = canvas_item->edit_get_minimum_size();
bool uniform = m.mod.shift;
bool symmetric=m.mod.alt;
+ if (uniform) {
+ float aspect = local_rect.size.get_aspect();
+ switch(drag) {
+ case DRAG_BOTTOM_LEFT:
+ case DRAG_TOP_RIGHT: {
+ if (aspect > 1.0) { // width > height, take x as reference
+ drag_vector.y = -drag_vector.x/aspect;
+ } else { // height > width, take y as reference
+ drag_vector.x = -drag_vector.y*aspect;
+ }
+ } break;
+ case DRAG_BOTTOM_RIGHT:
+ case DRAG_TOP_LEFT: {
+ if (aspect > 1.0) { // width > height, take x as reference
+ drag_vector.y = drag_vector.x/aspect;
+ } else { // height > width, take y as reference
+ drag_vector.x = drag_vector.y*aspect;
+ }
+ } break;
+ default: {}
+ }
+ }
switch(drag) {
case DRAG_ALL: {
@@ -1590,19 +1596,11 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
} break;
case DRAG_BOTTOM_RIGHT: {
- if (uniform) {
- drag_vector.y=drag_vector.x;
- minsize.y=minsize.x;
- }
incend(begin.x,end.x,drag_vector.x,minsize.x,symmetric);
incend(begin.y,end.y,drag_vector.y,minsize.y,symmetric);
- } break;
+ } break;
case DRAG_TOP_LEFT: {
- if (uniform) {
- drag_vector.y=drag_vector.x;
- minsize.y=minsize.x;
- }
incbeg(begin.x,end.x,drag_vector.x,minsize.x,symmetric);
incbeg(begin.y,end.y,drag_vector.y,minsize.y,symmetric);
} break;
@@ -1618,20 +1616,12 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
} break;
case DRAG_TOP_RIGHT: {
- if (uniform) {
- drag_vector.x=-drag_vector.y;
- minsize.x=minsize.y;
- }
incbeg(begin.y,end.y,drag_vector.y,minsize.y,symmetric);
incend(begin.x,end.x,drag_vector.x,minsize.x,symmetric);
} break;
case DRAG_BOTTOM_LEFT: {
- if (uniform) {
- drag_vector.x=-drag_vector.y;
- minsize.x=minsize.y;
- }
incbeg(begin.x,end.x,drag_vector.x,minsize.x,symmetric);
incend(begin.y,end.y,drag_vector.y,minsize.y,symmetric);
} break;
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.h b/tools/editor/plugins/canvas_item_editor_plugin.h
index 91cfab9863..df24734fd7 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.h
+++ b/tools/editor/plugins/canvas_item_editor_plugin.h
@@ -344,7 +344,7 @@ class CanvasItemEditor : public VBoxContainer {
CanvasItem *get_single_item();
int get_item_count();
- void _keying_changed(bool p_changed);
+ void _keying_changed();
void _unhandled_key_input(const InputEvent& p_ev);
diff --git a/tools/editor/plugins/color_ramp_editor_plugin.cpp b/tools/editor/plugins/color_ramp_editor_plugin.cpp
index df50535402..42ff1b1de9 100644
--- a/tools/editor/plugins/color_ramp_editor_plugin.cpp
+++ b/tools/editor/plugins/color_ramp_editor_plugin.cpp
@@ -3,14 +3,20 @@
*/
#include "color_ramp_editor_plugin.h"
+#include "spatial_editor_plugin.h"
+#include "canvas_item_editor_plugin.h"
-ColorRampEditorPlugin::ColorRampEditorPlugin(EditorNode *p_node) {
+ColorRampEditorPlugin::ColorRampEditorPlugin(EditorNode *p_node, bool p_2d) {
editor=p_node;
ramp_editor = memnew( ColorRampEdit );
- add_custom_control(CONTAINER_CANVAS_EDITOR_BOTTOM,ramp_editor);
- //add_custom_control(CONTAINER_SPATIAL_EDITOR_BOTTOM,ramp_editor);
+ _2d=p_2d;
+ if (p_2d)
+ add_custom_control(CONTAINER_CANVAS_EDITOR_BOTTOM,ramp_editor);
+ else
+ add_custom_control(CONTAINER_SPATIAL_EDITOR_BOTTOM,ramp_editor);
+
ramp_editor->set_custom_minimum_size(Size2(100, 48));
ramp_editor->hide();
ramp_editor->connect("ramp_changed", this, "ramp_changed");
@@ -27,7 +33,10 @@ void ColorRampEditorPlugin::edit(Object *p_object) {
bool ColorRampEditorPlugin::handles(Object *p_object) const {
- return p_object->is_type("ColorRamp");
+ if (_2d)
+ return p_object->is_type("ColorRamp") && CanvasItemEditor::get_singleton()->is_visible() == true;
+ else
+ return p_object->is_type("ColorRamp") && SpatialEditor::get_singleton()->is_visible() == true;
}
void ColorRampEditorPlugin::make_visible(bool p_visible) {
diff --git a/tools/editor/plugins/color_ramp_editor_plugin.h b/tools/editor/plugins/color_ramp_editor_plugin.h
index e39a5d65fe..f07dbabeb3 100644
--- a/tools/editor/plugins/color_ramp_editor_plugin.h
+++ b/tools/editor/plugins/color_ramp_editor_plugin.h
@@ -13,6 +13,7 @@ class ColorRampEditorPlugin : public EditorPlugin {
OBJ_TYPE( ColorRampEditorPlugin, EditorPlugin );
+ bool _2d;
Ref<ColorRamp> color_ramp_ref;
ColorRampEdit *ramp_editor;
EditorNode *editor;
@@ -29,7 +30,7 @@ public:
virtual bool handles(Object *p_node) const;
virtual void make_visible(bool p_visible);
- ColorRampEditorPlugin(EditorNode *p_node);
+ ColorRampEditorPlugin(EditorNode *p_node, bool p_2d);
~ColorRampEditorPlugin();
};
diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/tools/editor/plugins/editor_preview_plugins.cpp
index 5f52d4c3e7..a0ce294219 100644
--- a/tools/editor/plugins/editor_preview_plugins.cpp
+++ b/tools/editor/plugins/editor_preview_plugins.cpp
@@ -6,6 +6,7 @@
#include "scene/resources/material.h"
#include "scene/resources/sample.h"
#include "scene/resources/mesh.h"
+#include "scene/resources/bit_mask.h"
bool EditorTexturePreviewPlugin::handles(const String& p_type) const {
@@ -58,6 +59,81 @@ EditorTexturePreviewPlugin::EditorTexturePreviewPlugin() {
}
+////////////////////////////////////////////////////////////////////////////
+
+bool EditorBitmapPreviewPlugin::handles(const String& p_type) const {
+
+ return ObjectTypeDB::is_type(p_type,"BitMap");
+}
+
+Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES& p_from) {
+
+ Ref<BitMap> bm =p_from;
+
+ if (bm->get_size()==Size2()) {
+ return Ref<Texture>();
+ }
+
+ DVector<uint8_t> data;
+
+ data.resize(bm->get_size().width*bm->get_size().height);
+
+ {
+ DVector<uint8_t>::Write w=data.write();
+
+ for(int i=0;i<bm->get_size().width;i++) {
+ for(int j=0;j<bm->get_size().height;j++) {
+ if (bm->get_bit(Point2i(i,j))) {
+ w[j*bm->get_size().width+i]=255;
+ } else {
+ w[j*bm->get_size().width+i]=0;
+
+ }
+ }
+
+ }
+ }
+
+
+ Image img(bm->get_size().width,bm->get_size().height,0,Image::FORMAT_GRAYSCALE,data);
+
+ int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ if (img.is_compressed()) {
+ if (img.decompress()!=OK)
+ return Ref<Texture>();
+ } else if (img.get_format()!=Image::FORMAT_RGB && img.get_format()!=Image::FORMAT_RGBA) {
+ img.convert(Image::FORMAT_RGBA);
+ }
+
+ int width,height;
+ if (img.get_width() > thumbnail_size && img.get_width() >= img.get_height()) {
+
+ width=thumbnail_size;
+ height = img.get_height() * thumbnail_size / img.get_width();
+ } else if (img.get_height() > thumbnail_size && img.get_height() >= img.get_width()) {
+
+ height=thumbnail_size;
+ width = img.get_width() * thumbnail_size / img.get_height();
+ } else {
+
+ width=img.get_width();
+ height=img.get_height();
+ }
+
+ img.resize(width,height);
+
+ Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture ));
+
+ ptex->create_from_image(img,0);
+ return ptex;
+
+}
+
+EditorBitmapPreviewPlugin::EditorBitmapPreviewPlugin() {
+
+
+}
+
///////////////////////////////////////////////////////////////////////////
diff --git a/tools/editor/plugins/editor_preview_plugins.h b/tools/editor/plugins/editor_preview_plugins.h
index 98071e2a0e..b3bfda8045 100644
--- a/tools/editor/plugins/editor_preview_plugins.h
+++ b/tools/editor/plugins/editor_preview_plugins.h
@@ -13,6 +13,17 @@ public:
};
+class EditorBitmapPreviewPlugin : public EditorResourcePreviewGenerator {
+public:
+
+ virtual bool handles(const String& p_type) const;
+ virtual Ref<Texture> generate(const RES& p_from);
+
+ EditorBitmapPreviewPlugin();
+};
+
+
+
class EditorPackedScenePreviewPlugin : public EditorResourcePreviewGenerator {
Ref<Texture> _gen_from_imd(Ref<ResourceImportMetadata> p_imd);
diff --git a/tools/editor/plugins/path_2d_editor_plugin.cpp b/tools/editor/plugins/path_2d_editor_plugin.cpp
index a2cc0ed09c..509edbe5f8 100644
--- a/tools/editor/plugins/path_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/path_2d_editor_plugin.cpp
@@ -534,6 +534,7 @@ void Path2DEditor::edit(Node *p_path2d) {
if (!node->is_connected("visibility_changed", this, "_node_visibility_changed"))
node->connect("visibility_changed", this, "_node_visibility_changed");
+
} else {
if (canvas_item_editor->get_viewport_control()->is_connected("draw",this,"_canvas_draw"))
@@ -614,6 +615,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) {
editor=p_editor;
undo_redo = editor->get_undo_redo();
+ mode=MODE_EDIT;
action=ACTION_NONE;
#if 0
diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/tools/editor/plugins/polygon_2d_editor_plugin.cpp
index fc71a64dbd..3e9c58d604 100644
--- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -755,7 +755,6 @@ void Polygon2DEditor::edit(Node *p_collision_polygon) {
canvas_item_editor=CanvasItemEditor::get_singleton();
}
-
if (p_collision_polygon) {
node=p_collision_polygon->cast_to<Polygon2D>();
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index ded27d1fef..8adfe9d2cf 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -327,7 +327,11 @@ void ScriptTextEditor::_load_theme_settings() {
for(List<StringName>::Element *E=types.front();E;E=E->next()) {
- get_text_edit()->add_keyword_color(E->get(),type_color);
+ String n = E->get();
+ if (n.begins_with("_"))
+ n = n.substr(1, n.length());
+
+ get_text_edit()->add_keyword_color(n,type_color);
}
//colorize comments
@@ -2327,7 +2331,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
script_list = memnew( ItemList );
script_split->add_child(script_list);
- script_list->set_custom_minimum_size(Size2(70,0));
+ script_list->set_custom_minimum_size(Size2(0,0));
script_split->set_split_offset(70);
tab_container = memnew( TabContainer );
@@ -2413,7 +2417,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
debug_menu->get_popup()->add_item("Continue",DEBUG_CONTINUE);
debug_menu->get_popup()->add_separator();
debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW);
- debug_menu->get_popup()->add_check_item("Keep Debuger Open",DEBUG_SHOW_KEEP_OPEN);
+ debug_menu->get_popup()->add_check_item("Keep Debugger Open",DEBUG_SHOW_KEEP_OPEN);
debug_menu->get_popup()->connect("item_pressed", this,"_menu_option");
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true);
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index f536077f9a..e47dcbf30f 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -1617,6 +1617,8 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
case InputEvent::KEY: {
const InputEventKey &k = p_event.key;
+ if (!k.pressed)
+ break;
switch(k.scancode) {
case KEY_S: {
@@ -1677,7 +1679,8 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
} break;
case KEY_KP_5: {
- orthogonal = !orthogonal;
+
+ //orthogonal = !orthogonal;
_menu_option(orthogonal?VIEW_PERSPECTIVE:VIEW_ORTHOGONAL);
_update_name();
@@ -2626,6 +2629,13 @@ Dictionary SpatialEditor::get_state() const {
Dictionary d;
+ d["snap_enabled"]=snap_enabled;
+ d["translate_snap"]=get_translate_snap();
+ d["rotate_snap"]=get_rotate_snap();
+ d["scale_snap"]=get_scale_snap();
+
+ int local_coords_index=transform_menu->get_popup()->get_item_index(MENU_TRANSFORM_LOCAL_COORDS);
+ d["local_coords"]=transform_menu->get_popup()->is_item_checked( local_coords_index );
int vc=0;
if (view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT) ))
@@ -2667,37 +2677,52 @@ void SpatialEditor::set_state(const Dictionary& p_state) {
Dictionary d = p_state;
- ERR_FAIL_COND(!d.has("viewport_mode"));
- ERR_FAIL_COND(!d.has("viewports"));
- ERR_FAIL_COND(!d.has("default_light"));
- ERR_FAIL_COND(!d.has("show_grid"));
- ERR_FAIL_COND(!d.has("show_origin"));
- ERR_FAIL_COND(!d.has("fov"));
- ERR_FAIL_COND(!d.has("znear"));
- ERR_FAIL_COND(!d.has("zfar"));
+ if (d.has("snap_enabled")) {
+ snap_enabled=d["snap_enabled"];
+ int snap_enabled_idx=transform_menu->get_popup()->get_item_index(MENU_TRANSFORM_USE_SNAP);
+ transform_menu->get_popup()->set_item_checked( snap_enabled_idx, snap_enabled );
+ }
- int vc = d["viewport_mode"];
+ if (d.has("translate_snap"))
+ snap_translate->set_text(d["translate_snap"]);
- if (vc==1)
- _menu_item_pressed(MENU_VIEW_USE_1_VIEWPORT);
- else if (vc==2)
- _menu_item_pressed(MENU_VIEW_USE_2_VIEWPORTS);
- else if (vc==3)
- _menu_item_pressed(MENU_VIEW_USE_3_VIEWPORTS);
- else if (vc==4)
- _menu_item_pressed(MENU_VIEW_USE_4_VIEWPORTS);
- else if (vc==5)
- _menu_item_pressed(MENU_VIEW_USE_2_VIEWPORTS_ALT);
- else if (vc==6)
- _menu_item_pressed(MENU_VIEW_USE_3_VIEWPORTS_ALT);
-
- Array vp = d["viewports"];
- ERR_FAIL_COND(vp.size()>4);
+ if (d.has("rotate_snap"))
+ snap_rotate->set_text(d["rotate_snap"]);
- for(int i=0;i<4;i++) {
- viewports[i]->set_state(vp[i]);
+ if (d.has("scale_snap"))
+ snap_scale->set_text(d["scale_snap"]);
+
+ if (d.has("local_coords")) {
+ int local_coords_idx=transform_menu->get_popup()->get_item_index(MENU_TRANSFORM_LOCAL_COORDS);
+ transform_menu->get_popup()->set_item_checked( local_coords_idx, d["local_coords"] );
+ update_transform_gizmo();
+ }
+
+ if (d.has("viewport_mode")) {
+ int vc = d["viewport_mode"];
+
+ if (vc==1)
+ _menu_item_pressed(MENU_VIEW_USE_1_VIEWPORT);
+ else if (vc==2)
+ _menu_item_pressed(MENU_VIEW_USE_2_VIEWPORTS);
+ else if (vc==3)
+ _menu_item_pressed(MENU_VIEW_USE_3_VIEWPORTS);
+ else if (vc==4)
+ _menu_item_pressed(MENU_VIEW_USE_4_VIEWPORTS);
+ else if (vc==5)
+ _menu_item_pressed(MENU_VIEW_USE_2_VIEWPORTS_ALT);
+ else if (vc==6)
+ _menu_item_pressed(MENU_VIEW_USE_3_VIEWPORTS_ALT);
}
+ if (d.has("viewports")) {
+ Array vp = d["viewports"];
+ ERR_FAIL_COND(vp.size()>4);
+
+ for(int i=0;i<4;i++) {
+ viewports[i]->set_state(vp[i]);
+ }
+ }
if (d.has("zfar"))
settings_zfar->set_val(float(d["zfar"]));
@@ -3501,19 +3526,13 @@ void SpatialEditor::_instance_scene() {
undo_redo->commit_action();
#endif
}
-/*
-void SpatialEditor::_update_selection() {
-
-
-}
-*/
void SpatialEditor::_unhandled_key_input(InputEvent p_event) {
- if (!is_visible())
+ if (!is_visible() || window_has_modal_stack())
return;
- {
+ {
EditorNode *en = editor;
EditorPlugin *over_plugin = en->get_editor_plugin_over();
@@ -3712,7 +3731,6 @@ void SpatialEditor::_bind_methods() {
ObjectTypeDB::bind_method("_menu_item_pressed",&SpatialEditor::_menu_item_pressed);
ObjectTypeDB::bind_method("_xform_dialog_action",&SpatialEditor::_xform_dialog_action);
ObjectTypeDB::bind_method("_instance_scene",&SpatialEditor::_instance_scene);
-// ObjectTypeDB::bind_method("_update_selection",&SpatialEditor::_update_selection);
ObjectTypeDB::bind_method("_get_editor_data",&SpatialEditor::_get_editor_data);
ObjectTypeDB::bind_method("_request_gizmo",&SpatialEditor::_request_gizmo);
ObjectTypeDB::bind_method("_default_light_angle_input",&SpatialEditor::_default_light_angle_input);
@@ -3814,7 +3832,6 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
editor=p_editor;
editor_selection=editor->get_editor_selection();
editor_selection->add_editor_plugin(this);
- editor_selection->connect("selection_changed",this,"_update_selection");
snap_enabled=false;
tool_mode = TOOL_MODE_SELECT;
diff --git a/tools/editor/plugins/spatial_editor_plugin.h b/tools/editor/plugins/spatial_editor_plugin.h
index e8856d5a8f..b0e366b140 100644
--- a/tools/editor/plugins/spatial_editor_plugin.h
+++ b/tools/editor/plugins/spatial_editor_plugin.h
@@ -137,7 +137,6 @@ private:
Vector3 _get_screen_to_space(const Vector3& p_vector3);
void _select_region();
- void _update_selection();
bool _gizmo_select(const Vector2& p_screenpos,bool p_hilite_only=false);
float get_znear() const;
diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
index 7b8f1535be..048df2d682 100644
--- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -338,7 +338,6 @@ void SpriteFramesEditor::_update_library() {
TreeItem *ti = tree->create_item(root);
ti->set_cell_mode(0,TreeItem::CELL_MODE_STRING);
- ti->set_editable(0,true);
ti->set_selectable(0,true);
if (frames->get_frame(i).is_null()) {
@@ -346,7 +345,7 @@ void SpriteFramesEditor::_update_library() {
ti->set_text(0,"Frame "+itos(i)+" (empty)");
} else {
- ti->set_text(0,"Frame "+itos(i));
+ ti->set_text(0,"Frame "+itos(i)+" ("+frames->get_frame(i)->get_name()+")");
ti->set_icon(0,frames->get_frame(i));
}
if (frames->get_frame(i).is_valid())
diff --git a/tools/editor/plugins/sprite_region_editor_plugin.cpp b/tools/editor/plugins/sprite_region_editor_plugin.cpp
index 2653973226..725de19dd7 100644
--- a/tools/editor/plugins/sprite_region_editor_plugin.cpp
+++ b/tools/editor/plugins/sprite_region_editor_plugin.cpp
@@ -411,6 +411,7 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor)
snap_step=Vector2(10,10);
use_snap=false;
snap_show_grid=false;
+ drag=false;
add_child( memnew( VSeparator ));
edit_node = memnew( ToolButton );
@@ -449,7 +450,7 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor)
hb_tools->add_child( memnew( VSeparator ));
hb_tools->add_child( memnew( Label("Grid Offset:") ) );
- SpinBox *sb_off_x = memnew( SpinBox );
+ sb_off_x = memnew( SpinBox );
sb_off_x->set_min(-256);
sb_off_x->set_max(256);
sb_off_x->set_step(1);
@@ -458,7 +459,7 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor)
sb_off_x->connect("value_changed", this, "_set_snap_off_x");
hb_tools->add_child(sb_off_x);
- SpinBox *sb_off_y = memnew( SpinBox );
+ sb_off_y = memnew( SpinBox );
sb_off_y->set_min(-256);
sb_off_y->set_max(256);
sb_off_y->set_step(1);
@@ -470,7 +471,7 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor)
hb_tools->add_child( memnew( VSeparator ));
hb_tools->add_child( memnew( Label("Grid Step:") ) );
- SpinBox *sb_step_x = memnew( SpinBox );
+ sb_step_x = memnew( SpinBox );
sb_step_x->set_min(-256);
sb_step_x->set_max(256);
sb_step_x->set_step(1);
@@ -479,7 +480,7 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor)
sb_step_x->connect("value_changed", this, "_set_snap_step_x");
hb_tools->add_child(sb_step_x);
- SpinBox *sb_step_y = memnew( SpinBox );
+ sb_step_y = memnew( SpinBox );
sb_step_y->set_min(-256);
sb_step_y->set_max(256);
sb_step_y->set_step(1);
@@ -488,8 +489,6 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor)
sb_step_y->connect("value_changed", this, "_set_snap_step_y");
hb_tools->add_child(sb_step_y);
-// MARIANOGNU::TODO: Add more tools?
-
HBoxContainer *main_hb = memnew( HBoxContainer );
main_vb->add_child(main_hb);
edit_draw = memnew( Control );
@@ -554,6 +553,50 @@ void SpriteRegionEditorPlugin::make_visible(bool p_visible)
}
}
+
+Dictionary SpriteRegionEditorPlugin::get_state() const {
+
+ Dictionary state;
+ state["zoom"]=region_editor->zoom->get_val();
+ state["snap_offset"]=region_editor->snap_offset;
+ state["snap_step"]=region_editor->snap_step;
+ state["use_snap"]=region_editor->use_snap;
+ state["snap_show_grid"]=region_editor->snap_show_grid;
+ return state;
+}
+
+void SpriteRegionEditorPlugin::set_state(const Dictionary& p_state){
+
+ Dictionary state=p_state;
+ if (state.has("zoom")) {
+ region_editor->zoom->set_val(p_state["zoom"]);
+ }
+
+ if (state.has("snap_step")) {
+ Vector2 s = state["snap_step"];
+ region_editor->sb_step_x->set_val(s.x);
+ region_editor->sb_step_y->set_val(s.y);
+ region_editor->snap_step = s;
+ }
+
+ if (state.has("snap_offset")) {
+ Vector2 ofs = state["snap_offset"];
+ region_editor->sb_off_x->set_val(ofs.x);
+ region_editor->sb_off_y->set_val(ofs.y);
+ region_editor->snap_offset = ofs;
+ }
+
+ if (state.has("use_snap")) {
+ region_editor->use_snap=state["use_snap"];
+ region_editor->b_snap_enable->set_pressed(state["use_snap"]);
+ }
+
+ if (state.has("snap_show_grid")) {
+ region_editor->snap_show_grid=state["snap_show_grid"];
+ region_editor->b_snap_grid->set_pressed(state["snap_show_grid"]);
+ }
+}
+
SpriteRegionEditorPlugin::SpriteRegionEditorPlugin(EditorNode *p_node)
{
editor = p_node;
diff --git a/tools/editor/plugins/sprite_region_editor_plugin.h b/tools/editor/plugins/sprite_region_editor_plugin.h
index fafa2e119b..47cb210863 100644
--- a/tools/editor/plugins/sprite_region_editor_plugin.h
+++ b/tools/editor/plugins/sprite_region_editor_plugin.h
@@ -41,6 +41,8 @@ class SpriteRegionEditor : public HBoxContainer {
OBJ_TYPE(SpriteRegionEditor, HBoxContainer );
+ friend class SpriteRegionEditorPlugin;
+
ToolButton *edit_node;
// Button *use_region;
ToolButton *b_snap_enable;
@@ -48,6 +50,10 @@ class SpriteRegionEditor : public HBoxContainer {
TextureFrame *icon_zoom;
HSlider *zoom;
SpinBox *zoom_value;
+ SpinBox *sb_step_y;
+ SpinBox *sb_step_x;
+ SpinBox *sb_off_y;
+ SpinBox *sb_off_x;
Control *edit_draw;
VScrollBar *vscroll;
@@ -113,11 +119,13 @@ class SpriteRegionEditorPlugin : public EditorPlugin
EditorNode *editor;
public:
- virtual String get_name() const { return "Sprite"; }
+ virtual String get_name() const { return "SpriteRegion"; }
bool has_main_screen() const { return false; }
virtual void edit(Object *p_node);
virtual bool handles(Object *p_node) const;
virtual void make_visible(bool p_visible);
+ void set_state(const Dictionary &p_state);
+ Dictionary get_state() const;
SpriteRegionEditorPlugin(EditorNode *p_node);
};
diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp
index d034edc80d..7690d31e7b 100644
--- a/tools/editor/project_export.cpp
+++ b/tools/editor/project_export.cpp
@@ -258,6 +258,7 @@ void ProjectExportDialog::_sample_convert_edited(int what) {
EditorImportExport::get_singleton()->sample_set_action( EditorImportExport::SampleAction(sample_mode->get_selected()));
EditorImportExport::get_singleton()->sample_set_max_hz( sample_max_hz->get_val() );
EditorImportExport::get_singleton()->sample_set_trim( sample_trim->is_pressed() );
+ _save_export_cfg();
}
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp
index 5fd9118a32..589d9d3d99 100644
--- a/tools/editor/project_manager.cpp
+++ b/tools/editor/project_manager.cpp
@@ -964,7 +964,7 @@ ProjectManager::ProjectManager() {
String cp;
cp.push_back(0xA9);
cp.push_back(0);
- l->set_text(cp+" 2008-2015 Juan Linietsky, Ariel Manzur.");
+ l->set_text(cp+" 2008-2016 Juan Linietsky, Ariel Manzur.");
l->set_align(Label::ALIGN_CENTER);
vb->add_child(l);
diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp
index 09d2e4bd01..26e8919375 100644
--- a/tools/editor/project_settings.cpp
+++ b/tools/editor/project_settings.cpp
@@ -60,9 +60,6 @@ void ProjectSettings::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) {
- search_button->set_icon(get_icon("Zoom","EditorIcons"));
- clear_button->set_icon(get_icon("Close","EditorIcons"));
-
translation_list->connect("button_pressed",this,"_translation_delete");
_update_actions();
popup_add->add_icon_item(get_icon("Keyboard","EditorIcons"),"Key",InputEvent::KEY);
@@ -93,7 +90,9 @@ void ProjectSettings::_notification(int p_what) {
autoload_file_open->add_filter("*."+E->get());
}
+ } else if (p_what==NOTIFICATION_POST_POPUP) {
+ globals_editor->clear_search_box();
}
}
@@ -107,6 +106,8 @@ void ProjectSettings::_action_persist_toggle() {
String name="input/"+ti->get_text(0);
bool prev = Globals::get_singleton()->is_persisting(name);
+ print_line("prev persist: "+itos(prev));
+ print_line("new persist: "+itos(ti->is_checked(0)));
if (prev==ti->is_checked(0))
return;
@@ -156,12 +157,14 @@ void ProjectSettings::_device_input_add() {
} break;
case InputEvent::JOYSTICK_MOTION: {
- ie.joy_motion.axis = device_index->get_selected();
+ ie.joy_motion.axis = device_index->get_selected()>>1;
+ ie.joy_motion.axis_value = device_index->get_selected()&1?1:-1;
+
for(int i=0;i<arr.size();i++) {
InputEvent aie=arr[i];
- if (aie.device == ie.device && aie.type==InputEvent::JOYSTICK_MOTION && aie.joy_motion.axis==ie.joy_motion.axis) {
+ if (aie.device == ie.device && aie.type==InputEvent::JOYSTICK_MOTION && aie.joy_motion.axis==ie.joy_motion.axis && aie.joy_motion.axis_value==ie.joy_motion.axis_value) {
return;
}
}
@@ -295,9 +298,10 @@ void ProjectSettings::_add_item(int p_item){
device_id->set_val(0);
device_index_label->set_text("Joy Button Axis:");
device_index->clear();
- for(int i=0;i<8;i++) {
+ for(int i=0;i<24;i++) {
+
- device_index->add_item("Axis "+itos(i));
+ device_index->add_item("Axis "+itos(i/2)+" "+(i&1?"+":"-"));
}
device_input->popup_centered(Size2(350,95));
@@ -425,7 +429,7 @@ void ProjectSettings::_update_actions() {
continue;
TreeItem *item=input_editor->create_item(root);
- item->set_cell_mode(0,TreeItem::CELL_MODE_CHECK);
+ //item->set_cell_mode(0,TreeItem::CELL_MODE_CHECK);
item->set_text(0,name);
item->add_button(0,get_icon("Add","EditorIcons"),1);
if (!Globals::get_singleton()->get_input_presets().find(pi.name)) {
@@ -434,7 +438,7 @@ void ProjectSettings::_update_actions() {
}
item->set_custom_bg_color(0,get_color("prop_subsection","Editor"));
item->set_editable(0,true);
- item->set_checked(0,pi.usage&PROPERTY_USAGE_CHECKED);
+ //item->set_checked(0,pi.usage&PROPERTY_USAGE_CHECKED);
@@ -494,7 +498,7 @@ void ProjectSettings::_update_actions() {
} break;
case InputEvent::JOYSTICK_MOTION: {
- String str = "Device "+itos(ie.device)+", Axis "+itos(ie.joy_motion.axis)+".";
+ String str = "Device "+itos(ie.device)+", Axis "+itos(ie.joy_motion.axis)+" "+(ie.joy_motion.axis_value<0?"-.":"+.");
action->set_text(0,str);
action->set_icon(0,get_icon("JoyAxis","EditorIcons"));
} break;
@@ -525,7 +529,7 @@ void ProjectSettings::_item_selected() {
return;
if (!ti->get_parent())
return;
- category->set_text(ti->get_parent()->get_text(0));
+ category->set_text(globals_editor->get_current_section());
property->set_text(ti->get_text(0));
popup_platform->set_disabled(false);
@@ -564,7 +568,8 @@ void ProjectSettings::_item_add() {
String name = catname+"/"+propname;
Globals::get_singleton()->set(name,value);
- globals_editor->get_property_editor()->update_tree();
+ globals_editor->edit(NULL);
+ globals_editor->edit(Globals::get_singleton());
}
void ProjectSettings::_item_del() {
@@ -696,9 +701,20 @@ void ProjectSettings::_save() {
void ProjectSettings::_settings_prop_edited(const String& p_name) {
- if (!Globals::get_singleton()->is_persisting(p_name)) {
- String full_item = globals_editor->get_full_item_path(p_name);
+ String full_item = globals_editor->get_full_item_path(p_name);
+
+ if (!Globals::get_singleton()->is_persisting(full_item)) {
Globals::get_singleton()->set_persisting(full_item,true);
+
+ {
+ //small usability workaround, if anything related to resolution scaling or size is modified, change all of them together
+ if (full_item=="display/width" || full_item=="display/height" || full_item=="display/stretch_mode") {
+ Globals::get_singleton()->set_persisting("display/height",true);
+ Globals::get_singleton()->set_persisting("display/width",true);
+ }
+ }
+
+
// globals_editor->update_property(p_name);
globals_editor->get_property_editor()->update_tree();
}
@@ -1322,32 +1338,6 @@ void ProjectSettings::_update_autoload() {
}
-void ProjectSettings::_toggle_search_bar(bool p_pressed) {
-
- globals_editor->get_property_editor()->set_use_filter(p_pressed);
-
- if (p_pressed) {
-
- search_bar->show();
- add_prop_bar->hide();
- search_box->grab_focus();
- search_box->select_all();
- } else {
-
- search_bar->hide();
- add_prop_bar->show();
- }
-}
-
-void ProjectSettings::_clear_search_box() {
-
- if (search_box->get_text()=="")
- return;
-
- search_box->clear();
- globals_editor->get_property_editor()->update_tree();
-}
-
void ProjectSettings::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_item_selected"),&ProjectSettings::_item_selected);
@@ -1390,9 +1380,6 @@ void ProjectSettings::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_autoload_delete"),&ProjectSettings::_autoload_delete);
ObjectTypeDB::bind_method(_MD("_autoload_edited"),&ProjectSettings::_autoload_edited);
- ObjectTypeDB::bind_method(_MD("_clear_search_box"),&ProjectSettings::_clear_search_box);
- ObjectTypeDB::bind_method(_MD("_toggle_search_bar"),&ProjectSettings::_toggle_search_bar);
-
}
ProjectSettings::ProjectSettings(EditorData *p_data) {
@@ -1423,77 +1410,50 @@ ProjectSettings::ProjectSettings(EditorData *p_data) {
hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
props_base->add_child(hbc);
- search_button = memnew( ToolButton );
- search_button->set_toggle_mode(true);
- search_button->set_pressed(false);
- search_button->set_text("Search");
- hbc->add_child(search_button);
- search_button->connect("toggled",this,"_toggle_search_bar");
-
- hbc->add_child( memnew( VSeparator ) );
-
- add_prop_bar = memnew( HBoxContainer );
- add_prop_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- hbc->add_child(add_prop_bar);
-
Label *l = memnew( Label );
- add_prop_bar->add_child(l);
+ hbc->add_child(l);
l->set_text("Category:");
category = memnew( LineEdit );
category->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- add_prop_bar->add_child(category);
+ hbc->add_child(category);
category->connect("text_entered",this,"_item_adds");
l = memnew( Label );
- add_prop_bar->add_child(l);
+ hbc->add_child(l);
l->set_text("Property:");
property = memnew( LineEdit );
property->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- add_prop_bar->add_child(property);
+ hbc->add_child(property);
property->connect("text_entered",this,"_item_adds");
l = memnew( Label );
- add_prop_bar->add_child(l);
+ hbc->add_child(l);
l->set_text("Type:");
type = memnew( OptionButton );
type->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- add_prop_bar->add_child(type);
+ hbc->add_child(type);
type->add_item("bool");
type->add_item("int");
type->add_item("float");
type->add_item("string");
Button *add = memnew( Button );
- add_prop_bar->add_child(add);
+ hbc->add_child(add);
add->set_text("Add");
add->connect("pressed",this,"_item_add");
Button *del = memnew( Button );
- add_prop_bar->add_child(del);
+ hbc->add_child(del);
del->set_text("Del");
del->connect("pressed",this,"_item_del");
- search_bar = memnew( HBoxContainer );
- search_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- hbc->add_child(search_bar);
- search_bar->hide();
-
- search_box = memnew( LineEdit );
- search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- search_bar->add_child(search_box);
-
- clear_button = memnew( ToolButton );
- search_bar->add_child(clear_button);
- clear_button->connect("pressed",this,"_clear_search_box");
-
globals_editor = memnew( SectionedPropertyEditor );
props_base->add_child(globals_editor);
//globals_editor->hide_top_label();
globals_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- globals_editor->get_property_editor()->register_text_enter(search_box);
globals_editor->get_property_editor()->set_capitalize_paths(false);
globals_editor->get_property_editor()->get_scene_tree()->connect("cell_selected",this,"_item_selected");
globals_editor->get_property_editor()->connect("property_toggled",this,"_item_checked",varray(),CONNECT_DEFERRED);
diff --git a/tools/editor/project_settings.h b/tools/editor/project_settings.h
index b689340fdf..cbf24e7bfd 100644
--- a/tools/editor/project_settings.h
+++ b/tools/editor/project_settings.h
@@ -48,12 +48,6 @@ class ProjectSettings : public AcceptDialog {
UndoRedo *undo_redo;
SectionedPropertyEditor *globals_editor;
- HBoxContainer *search_bar;
- ToolButton *search_button;
- LineEdit *search_box;
- ToolButton *clear_button;
-
- HBoxContainer *add_prop_bar;
ConfirmationDialog *message;
LineEdit *category;
LineEdit *property;
@@ -142,9 +136,6 @@ class ProjectSettings : public AcceptDialog {
void _translation_res_option_changed();
void _translation_res_option_delete(Object *p_item,int p_column, int p_button);
- void _toggle_search_bar(bool p_pressed);
- void _clear_search_box();
-
ProjectSettings();
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 6b56f2adf0..cc7db57145 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -727,7 +727,17 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
RES cb=EditorSettings::get_singleton()->get_resource_clipboard();
- bool paste_valid=cb.is_valid() && (hint_text=="" || ObjectTypeDB::is_type(cb->get_type(),hint_text));
+ bool paste_valid=false;
+ if (cb.is_valid()) {
+ if (hint_text=="")
+ paste_valid=true;
+ else
+ for (int i = 0; i < hint_text.get_slice_count(",");i++)
+ if (ObjectTypeDB::is_type(cb->get_type(),hint_text.get_slice(",",i))) {
+ paste_valid=true;
+ break;
+ }
+ }
if (!RES(v).is_null() || paste_valid) {
menu->add_separator();
@@ -927,6 +937,7 @@ void CustomPropertyEditor::_node_path_selected(NodePath p_path) {
if (!node) {
v=p_path;
emit_signal("variant_changed");
+ call_deferred("hide"); //to not mess with dialogs
return;
}
@@ -938,6 +949,7 @@ void CustomPropertyEditor::_node_path_selected(NodePath p_path) {
v=p_path;
emit_signal("variant_changed");
+ call_deferred("hide"); //to not mess with dialogs
}
@@ -1040,6 +1052,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
v=NodePath();
emit_signal("variant_changed");
+ hide();
}
} break;
case Variant::OBJECT: {
@@ -2110,6 +2123,65 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p
}
+void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) {
+
+ bool has_reload=false;
+ int found=-1;
+
+ for(int i=0;i<item->get_button_count(1);i++) {
+
+ if (item->get_button_id(1,i)==3) {
+ found=i;
+ break;
+ }
+ }
+
+ if (_might_be_in_instance()) {
+
+
+ Variant vorig;
+ Dictionary d=item->get_metadata(0);
+ int usage = d.has("usage")?int(int(d["usage"])&(PROPERTY_USAGE_STORE_IF_NONONE|PROPERTY_USAGE_STORE_IF_NONZERO)):0;
+
+
+ if (_get_instanced_node_original_property(p_name,vorig) || usage) {
+ Variant v = obj->get(p_name);
+
+ bool changed = _is_property_different(v,vorig,usage);
+
+ if ((found!=-1)!=changed) {
+
+ if (changed) {
+
+ has_reload=true;
+ } else {
+
+ }
+
+ }
+
+ }
+
+
+
+ }
+
+ if (!has_reload && !obj->get_script().is_null()) {
+ Ref<Script> scr = obj->get_script();
+ Variant orig_value;
+ if (scr->get_property_default_value(p_name,orig_value)) {
+ if (orig_value!=obj->get(p_name)) {
+ has_reload=true;
+ }
+ }
+ }
+
+ if (found!=-1 && !has_reload) {
+ item->erase_button(1,found);
+ } else if (found==-1 && has_reload) {
+ item->add_button(1,get_icon("Reload","EditorIcons"),3);
+ }
+}
void PropertyEditor::_notification(int p_what) {
@@ -2151,43 +2223,8 @@ void PropertyEditor::_notification(int p_what) {
if (!item)
continue;
- if (_might_be_in_instance()) {
-
-
- Variant vorig;
- Dictionary d=item->get_metadata(0);
- int usage = d.has("usage")?int(int(d["usage"])&(PROPERTY_USAGE_STORE_IF_NONONE|PROPERTY_USAGE_STORE_IF_NONZERO)):0;
-
-
- if (_get_instanced_node_original_property(*k,vorig) || usage) {
- Variant v = obj->get(*k);
-
- int found=-1;
- for(int i=0;i<item->get_button_count(1);i++) {
-
- if (item->get_button_id(1,i)==3) {
- found=i;
- break;
- }
- }
-
- bool changed = _is_property_different(v,vorig,usage);
-
- if ((found!=-1)!=changed) {
-
- if (changed) {
-
- item->add_button(1,get_icon("Reload","EditorIcons"),3);
- } else {
-
- item->erase_button(1,found);
- }
+ _check_reload_status(*k,item);
- }
-
- }
-
- }
Dictionary d=item->get_metadata(0);
set_item_text(item,d["type"],d["name"],d["hint"],d["hint_text"]);
}
@@ -2254,23 +2291,30 @@ void PropertyEditor::_refresh_item(TreeItem *p_item) {
if (name!=String()) {
+
+ _check_reload_status(name,p_item);
+#if 0
+ bool has_reload=false;
+
+ int found=-1;
+ for(int i=0;i<p_item->get_button_count(1);i++) {
+
+ if (p_item->get_button_id(1,i)==3) {
+ found=i;
+ break;
+ }
+ }
+
if (_might_be_in_instance()) {
Variant vorig;
Dictionary d=p_item->get_metadata(0);
int usage = d.has("usage")?int(int(d["usage"])&(PROPERTY_USAGE_STORE_IF_NONONE|PROPERTY_USAGE_STORE_IF_NONZERO)):0;
+
if (_get_instanced_node_original_property(name,vorig) || usage) {
Variant v = obj->get(name);
- int found=-1;
- for(int i=0;i<p_item->get_button_count(1);i++) {
-
- if (p_item->get_button_id(1,i)==3) {
- found=i;
- break;
- }
- }
bool changed = _is_property_different(v,vorig,usage);
@@ -2278,10 +2322,11 @@ void PropertyEditor::_refresh_item(TreeItem *p_item) {
if (changed) {
- p_item->add_button(1,get_icon("Reload","EditorIcons"),3);
+ has_reload=true;
+
} else {
- p_item->erase_button(1,found);
+ //p_item->erase_button(1,found);
}
}
@@ -2290,6 +2335,22 @@ void PropertyEditor::_refresh_item(TreeItem *p_item) {
}
+ if (!has_reload && !obj->get_script().is_null()) {
+ Ref<Script> scr = obj->get_script();
+ Variant orig_value;
+ if (scr->get_property_default_value(name,orig_value)) {
+ if (orig_value!=obj->get(name)) {
+ has_reload=true;
+ }
+ }
+ }
+
+ if (!has_reload && found!=-1) {
+ p_item->erase_button(1,found);
+ } else if (has_reload && found==-1) {
+ p_item->add_button(1,get_icon("Reload","EditorIcons"),3);
+ }
+#endif
Dictionary d=p_item->get_metadata(0);
set_item_text(p_item,d["type"],d["name"],d["hint"],d["hint_text"]);
}
@@ -3030,6 +3091,7 @@ void PropertyEditor::update_tree() {
}
}
+ bool has_reload=false;
if (_might_be_in_instance()) {
Variant vorig;
@@ -3042,11 +3104,24 @@ void PropertyEditor::update_tree() {
if (_is_property_different(v,vorig,usage)) {
//print_line("FOR "+String(p.name)+" RELOAD WITH: "+String(v)+"("+Variant::get_type_name(v.get_type())+")=="+String(vorig)+"("+Variant::get_type_name(vorig.get_type())+")");
item->add_button(1,get_icon("Reload","EditorIcons"),3);
+ has_reload=true;
}
}
}
+ if (!has_reload && !obj->get_script().is_null()) {
+ Ref<Script> scr = obj->get_script();
+ Variant orig_value;
+ if (scr->get_property_default_value(p.name,orig_value)) {
+ if (orig_value!=obj->get(p.name)) {
+ item->add_button(1,get_icon("Reload","EditorIcons"),3);
+ }
+ }
+ }
+
+
+
}
}
@@ -3337,8 +3412,6 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
call_deferred("_set_range_def",ti,prop,ti->get_range(p_column)+1.0);
} else if (p_button==3) {
- if (!_might_be_in_instance())
- return;
if (!d.has("name"))
return;
@@ -3346,11 +3419,21 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) {
Variant vorig;
- if (_get_instanced_node_original_property(prop,vorig)) {
+ if (_might_be_in_instance() && _get_instanced_node_original_property(prop,vorig)) {
_edit_set(prop,vorig);
+ return;
}
+ if (!obj->get_script().is_null()) {
+ Ref<Script> scr = obj->get_script();
+ Variant orig_value;
+ if (scr->get_property_default_value(prop,orig_value)) {
+ _edit_set(prop,orig_value);
+ }
+ }
+
+
} else {
Dictionary d = ti->get_metadata(0);
@@ -3694,6 +3777,10 @@ class SectionedPropertyEditorFilter : public Object {
for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) {
PropertyInfo pi=E->get();
+
+ if (section=="")
+ p_list->push_back(pi);
+
int sp = pi.name.find("/");
if (sp!=-1) {
String ss = pi.name.substr(0,sp);
@@ -3703,7 +3790,7 @@ class SectionedPropertyEditorFilter : public Object {
p_list->push_back(pi);
}
} else {
- if (section=="")
+ if (section=="global")
p_list->push_back(pi);
}
}
@@ -3728,10 +3815,18 @@ public:
};
+void SectionedPropertyEditor::_notification(int p_what) {
+
+ if (p_what==NOTIFICATION_ENTER_TREE) {
+
+ clear_button->set_icon(get_icon("Close", "EditorIcons"));
+ }
+}
void SectionedPropertyEditor::_bind_methods() {
ObjectTypeDB::bind_method("_section_selected",&SectionedPropertyEditor::_section_selected);
+ ObjectTypeDB::bind_method("_clear_search_box",&SectionedPropertyEditor::clear_search_box);
}
void SectionedPropertyEditor::_section_selected(int p_which) {
@@ -3739,6 +3834,32 @@ void SectionedPropertyEditor::_section_selected(int p_which) {
filter->set_section( sections->get_item_metadata(p_which) );
}
+void SectionedPropertyEditor::clear_search_box() {
+
+ if (search_box->get_text().strip_edges()=="")
+ return;
+
+ search_box->clear();
+ editor->update_tree();
+}
+
+
+String SectionedPropertyEditor::get_current_section() const {
+
+ String section = sections->get_item_metadata( sections->get_current() );
+
+ if (section=="") {
+ String name = editor->get_selected_path();
+
+ int sp = name.find("/");
+ if (sp!=-1)
+ section = name.substr(0, sp);
+
+ }
+
+ return section;
+}
+
String SectionedPropertyEditor::get_full_item_path(const String& p_item) {
String base = sections->get_item_metadata( sections->get_current() );
@@ -3756,11 +3877,20 @@ void SectionedPropertyEditor::edit(Object* p_object) {
sections->clear();
Set<String> existing_sections;
+
+ existing_sections.insert("");
+ sections->add_item("All");
+ sections->set_item_metadata(0, "");
+
for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) {
PropertyInfo pi=E->get();
+
if (pi.usage&PROPERTY_USAGE_CATEGORY)
continue;
+ if ( !(pi.usage&PROPERTY_USAGE_EDITOR) )
+ continue;
+
if (pi.name.find(":")!=-1 || pi.name=="script/script")
continue;
int sp = pi.name.find("/");
@@ -3773,10 +3903,10 @@ void SectionedPropertyEditor::edit(Object* p_object) {
}
} else {
- if (!existing_sections.has("")) {
- existing_sections.insert("");
+ if (!existing_sections.has("global")) {
+ existing_sections.insert("global");
sections->add_item("Global");
- sections->set_item_metadata(sections->get_item_count()-1,"");
+ sections->set_item_metadata(sections->get_item_count()-1,"global");
}
}
@@ -3801,6 +3931,8 @@ PropertyEditor *SectionedPropertyEditor::get_property_editor() {
SectionedPropertyEditor::SectionedPropertyEditor() {
+ add_constant_override("separation", 8);
+
VBoxContainer *left_vb = memnew( VBoxContainer);
left_vb->set_custom_minimum_size(Size2(160,0));
add_child(left_vb);
@@ -3815,7 +3947,21 @@ SectionedPropertyEditor::SectionedPropertyEditor() {
add_child(right_vb);
filter = memnew( SectionedPropertyEditorFilter );
+
+ HBoxContainer *hbc = memnew( HBoxContainer );
+ right_vb->add_margin_child("Search:",hbc);
+
+ search_box = memnew( LineEdit );
+ search_box->set_h_size_flags(SIZE_EXPAND_FILL);
+ hbc->add_child(search_box);
+
+ clear_button = memnew( ToolButton );
+ hbc->add_child(clear_button);
+ clear_button->connect("pressed", this, "_clear_search_box");
+
editor = memnew( PropertyEditor );
+ editor->register_text_enter(search_box);
+ editor->set_use_filter(true);
editor->set_v_size_flags(SIZE_EXPAND_FILL);
right_vb->add_margin_child("Properties:",editor,true);
diff --git a/tools/editor/property_editor.h b/tools/editor/property_editor.h
index f76b76c3a2..5dc2f6d154 100644
--- a/tools/editor/property_editor.h
+++ b/tools/editor/property_editor.h
@@ -114,6 +114,7 @@ class CustomPropertyEditor : public Popup {
void _action_pressed(int p_which);
void _type_create_selected(int p_idx);
+
void _color_changed(const Color& p_color);
void _draw_easing();
void _menu_option(int p_which);
@@ -192,6 +193,7 @@ class PropertyEditor : public Control {
virtual void _changed_callback(Object *p_changed,const char * p_what);
virtual void _changed_callbacks(Object *p_changed,const String& p_callback);
+ void _check_reload_status(const String&p_name,TreeItem* item);
void _edit_button(Object *p_item, int p_column, int p_button);
@@ -257,17 +259,24 @@ class SectionedPropertyEditor : public HBoxContainer {
OBJ_TYPE(SectionedPropertyEditor,HBoxContainer);
ItemList *sections;
SectionedPropertyEditorFilter *filter;
+ LineEdit *search_box;
+ ToolButton *clear_button;
PropertyEditor *editor;
-
- static void _bind_methods();
void _section_selected(int p_which);
+protected:
+
+ void _notification(int p_what);
+ static void _bind_methods();
public:
PropertyEditor *get_property_editor();
void edit(Object* p_object);
String get_full_item_path(const String& p_item);
+ String get_current_section() const;
+
+ void clear_search_box();
SectionedPropertyEditor();
~SectionedPropertyEditor();
diff --git a/tools/editor/quick_open.cpp b/tools/editor/quick_open.cpp
index bfbcb739ac..22f4a40c83 100644
--- a/tools/editor/quick_open.cpp
+++ b/tools/editor/quick_open.cpp
@@ -30,7 +30,7 @@
#include "os/keyboard.h"
-void EditorQuickOpen::popup(const StringName &p_base, bool p_dontclear, bool p_add_dirs) {
+void EditorQuickOpen::popup(const StringName &p_base, bool p_enable_multi, bool p_add_dirs, bool p_dontclear) {
add_directories=p_add_dirs;
popup_centered_ratio(0.6);
@@ -38,13 +38,38 @@ void EditorQuickOpen::popup(const StringName &p_base, bool p_dontclear, bool p_a
search_box->select_all();
else
search_box->clear();
+ if (p_enable_multi)
+ search_options->set_select_mode(Tree::SELECT_MULTI);
+ else
+ search_options->set_select_mode(Tree::SELECT_SINGLE);
search_box->grab_focus();
base_type=p_base;
_update_search();
+}
+
+String EditorQuickOpen::get_selected() const {
+ TreeItem *ti = search_options->get_selected();
+ if (!ti)
+ return String();
+ return "res://" + ti->get_text(0);
}
+Vector<String> EditorQuickOpen::get_selected_files() const {
+
+ Vector<String> files;
+
+ TreeItem* item = search_options->get_next_selected(search_options->get_root());
+ while (item) {
+
+ files.push_back("res://"+item->get_text(0));
+
+ item = search_options->get_next_selected(item);
+ }
+
+ return files;
+}
void EditorQuickOpen::_text_changed(const String& p_newtext) {
@@ -132,7 +157,7 @@ void EditorQuickOpen::_confirmed() {
TreeItem *ti = search_options->get_selected();
if (!ti)
return;
- emit_signal("quick_open","res://"+ti->get_text(0));
+ emit_signal("quick_open");
hide();
}
@@ -156,7 +181,7 @@ void EditorQuickOpen::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_confirmed"),&EditorQuickOpen::_confirmed);
ObjectTypeDB::bind_method(_MD("_sbox_input"),&EditorQuickOpen::_sbox_input);
- ADD_SIGNAL(MethodInfo("quick_open",PropertyInfo(Variant::STRING,"respath")));
+ ADD_SIGNAL(MethodInfo("quick_open"));
}
diff --git a/tools/editor/quick_open.h b/tools/editor/quick_open.h
index 7f2091e5d1..520f7e569d 100644
--- a/tools/editor/quick_open.h
+++ b/tools/editor/quick_open.h
@@ -61,7 +61,10 @@ public:
StringName get_base_type() const;
- void popup(const StringName& p_base,bool p_dontclear=false,bool p_add_dirs=false);
+ String get_selected() const;
+ Vector<String> get_selected_files() const;
+
+ void popup(const StringName& p_base,bool p_enable_multi=false,bool p_add_dirs=false,bool p_dontclear=false);
EditorQuickOpen();
};
diff --git a/tools/editor/reparent_dialog.cpp b/tools/editor/reparent_dialog.cpp
index 0bbf461029..97b27603b2 100644
--- a/tools/editor/reparent_dialog.cpp
+++ b/tools/editor/reparent_dialog.cpp
@@ -62,7 +62,7 @@ void ReparentDialog::_reparent() {
if (tree->get_selected()) {
- emit_signal("reparent",tree->get_selected()->get_path(),node_only->is_pressed());
+ emit_signal("reparent",tree->get_selected()->get_path(),keep_transform->is_pressed());
hide();
}
}
@@ -78,7 +78,7 @@ void ReparentDialog::_bind_methods() {
ObjectTypeDB::bind_method("_reparent",&ReparentDialog::_reparent);
ObjectTypeDB::bind_method("_cancel",&ReparentDialog::_cancel);
- ADD_SIGNAL( MethodInfo("reparent",PropertyInfo(Variant::NODE_PATH,"path"),PropertyInfo(Variant::BOOL,"only_node")));
+ ADD_SIGNAL( MethodInfo("reparent",PropertyInfo(Variant::NODE_PATH,"path"),PropertyInfo(Variant::BOOL,"keep_global_xform")));
}
@@ -101,15 +101,18 @@ ReparentDialog::ReparentDialog() {
//label->set_pos( Point2( 15,8) );
//label->set_text("Reparent Location (Select new Parent):");
- node_only = memnew( CheckButton );
- add_child(node_only);
- node_only->hide();
+ keep_transform = memnew( CheckBox );
+ keep_transform->set_text("Keep Global Transform");
+ keep_transform->set_pressed(true);
+ vbc->add_child(keep_transform);
+
//vbc->add_margin_child("Options:",node_only);;
//cancel->connect("pressed", this,"_cancel");
get_ok()->set_text("Reparent");
+
}
diff --git a/tools/editor/reparent_dialog.h b/tools/editor/reparent_dialog.h
index a55be57c16..296102e4b9 100644
--- a/tools/editor/reparent_dialog.h
+++ b/tools/editor/reparent_dialog.h
@@ -32,6 +32,7 @@
#include "scene/gui/dialogs.h"
#include "scene/gui/button.h"
#include "scene/gui/check_button.h"
+#include "scene/gui/check_box.h"
#include "tools/editor/scene_tree_editor.h"
#include "scene/gui/line_edit.h"
/**
@@ -42,12 +43,14 @@ class ReparentDialog : public ConfirmationDialog {
OBJ_TYPE( ReparentDialog, ConfirmationDialog );
SceneTreeEditor *tree;
- CheckButton *node_only;
+ CheckBox *keep_transform;
+
void update_tree();
void _reparent();
void _cancel();
-
+
+
protected:
void _notification(int p_what);
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index 35219a7c63..0acd308fe6 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -35,6 +35,7 @@
#include "tools/editor/plugins/canvas_item_editor_plugin.h"
#include "script_editor_debugger.h"
#include "tools/editor/plugins/script_editor_plugin.h"
+#include "core/io/resource_saver.h"
#include "multi_node_edit.h"
void SceneTreeDock::_unhandled_key_input(InputEvent p_event) {
@@ -485,7 +486,54 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
delete_dialog->popup_centered_minsize();
}
+ } break;
+ case TOOL_NEW_SCENE_FROM: {
+
+ Node *scene = editor_data->get_edited_scene_root();
+
+ if (!scene) {
+ accept->get_ok()->set_text("I see..");
+ accept->set_text("This operation can't be done without a scene.");
+ accept->popup_centered_minsize();
+ break;
+ }
+
+ List<Node*> selection = editor_selection->get_selected_node_list();
+
+ if (selection.size()!=1) {
+ accept->get_ok()->set_text("I see..");
+ accept->set_text("This operation requires a single selected node.");
+ accept->popup_centered_minsize();
+ break;
+ }
+
+ Node *tocopy = selection.front()->get();
+
+ if (tocopy!=editor_data->get_edited_scene_root() && tocopy->get_filename()!="") {
+ accept->get_ok()->set_text("I see..");
+ accept->set_text("This operation can't be done on instanced scenes.");
+ accept->popup_centered_minsize();
+ break;
+ }
+
+ new_scene_from_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE);
+
+ List<String> extensions;
+ Ref<PackedScene> sd = memnew( PackedScene );
+ ResourceSaver::get_recognized_extensions(sd,&extensions);
+ new_scene_from_dialog->clear_filters();
+ for(int i=0;i<extensions.size();i++) {
+ new_scene_from_dialog->add_filter("*."+extensions[i]+" ; "+extensions[i].to_upper());
+ }
+ String existing;
+ if (extensions.size()) {
+ existing="new_scene."+extensions.front()->get().to_lower();
+ }
+ new_scene_from_dialog->set_current_path(existing);
+
+ new_scene_from_dialog->popup_centered_ratio();
+ new_scene_from_dialog->set_title("Save New Scene As..");
} break;
@@ -520,6 +568,7 @@ void SceneTreeDock::_notification(int p_what) {
"MoveDown",
"Duplicate",
"Reparent",
+ "CreateNewSceneFrom",
"MultiNodeEdit",
"Remove",
};
@@ -889,7 +938,7 @@ bool SceneTreeDock::_validate_no_foreign() {
return true;
}
-void SceneTreeDock::_node_reparent(NodePath p_path,bool p_node_only) {
+void SceneTreeDock::_node_reparent(NodePath p_path,bool p_keep_global_xform) {
Node *node = scene_tree->get_selected();
@@ -948,6 +997,23 @@ void SceneTreeDock::_node_reparent(NodePath p_path,bool p_node_only) {
editor_data->get_undo_redo().add_do_method(sed,"live_debug_reparent_node",edited_scene->get_path_to(node),edited_scene->get_path_to(new_parent),new_name,-1);
editor_data->get_undo_redo().add_undo_method(sed,"live_debug_reparent_node",NodePath(String(edited_scene->get_path_to(new_parent))+"/"+new_name),edited_scene->get_path_to(node->get_parent()),node->get_name(),node->get_index());
+ if (p_keep_global_xform) {
+ if (node->cast_to<Node2D>())
+ editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to<Node2D>()->get_global_transform());
+ if (node->cast_to<Spatial>())
+ editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to<Spatial>()->get_global_transform());
+ if (node->cast_to<Control>()) {
+ bool can_do_it=false;
+ Control *c=node->cast_to<Control>();
+ if (c->get_parent()->cast_to<Container>())
+ can_do_it=false;
+ for(int i=0;i<4;i++) {
+ if (c->get_anchor(Margin(i))!=ANCHOR_BEGIN)
+ can_do_it=false;
+ }
+ editor_data->get_undo_redo().add_do_method(node,"set_global_pos",node->cast_to<Control>()->get_global_pos());
+ }
+ }
editor_data->get_undo_redo().add_do_method(this,"_set_owners",edited_scene,owners);
@@ -982,6 +1048,26 @@ void SceneTreeDock::_node_reparent(NodePath p_path,bool p_node_only) {
if (editor->get_animation_editor()->get_root()==node)
editor_data->get_undo_redo().add_undo_method(editor->get_animation_editor(),"set_root",node);
+ if (p_keep_global_xform) {
+ if (node->cast_to<Node2D>())
+ editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to<Node2D>()->get_transform());
+ if (node->cast_to<Spatial>())
+ editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to<Spatial>()->get_transform());
+ if (node->cast_to<Control>()) {
+ bool can_do_it=false;
+ Control *c=node->cast_to<Control>();
+ if (c->get_parent()->cast_to<Container>())
+ can_do_it=false;
+ for(int i=0;i<4;i++) {
+ if (c->get_anchor(Margin(i))!=ANCHOR_BEGIN)
+ can_do_it=false;
+ }
+ editor_data->get_undo_redo().add_undo_method(node,"set_pos",node->cast_to<Control>()->get_pos());
+ }
+ }
+
+
+
}
perform_node_renames(NULL,&path_renames);
@@ -1103,6 +1189,7 @@ void SceneTreeDock::_update_tool_buttons() {
tool_buttons[TOOL_DUPLICATE]->set_disabled(disable_root);
tool_buttons[TOOL_REPARENT]->set_disabled(disable_root);
tool_buttons[TOOL_ERASE]->set_disabled(disable);
+ tool_buttons[TOOL_NEW_SCENE_FROM]->set_disabled(disable_root);
tool_buttons[TOOL_MULTI_EDIT]->set_disabled(EditorNode::get_singleton()->get_editor_selection()->get_selection().size()<2);
@@ -1231,6 +1318,11 @@ void SceneTreeDock::_create() {
editor->set_edited_scene(newnode);
}
+ //small hack to make collisionshapes and other kind of nodes to work
+ for(int i=0;i<newnode->get_child_count();i++) {
+ Node *c=newnode->get_child(i);
+ c->call("set_transform", c->call("get_transform") );
+ }
editor_data->get_undo_redo().clear_history();
newnode->set_name(newname);
@@ -1284,6 +1376,59 @@ void SceneTreeDock::_import_subscene() {
*/
}
+void SceneTreeDock::_new_scene_from(String p_file) {
+
+ List<Node*> selection = editor_selection->get_selected_node_list();
+
+ if (selection.size()!=1) {
+ accept->get_ok()->set_text("I see..");
+ accept->set_text("This operation requires a single selected node.");
+ accept->popup_centered_minsize();
+ return;
+ }
+
+ Node *base = selection.front()->get();
+
+ Map<Node*,Node*> reown;
+ reown[editor_data->get_edited_scene_root()]=base;
+ Node *copy = base->duplicate_and_reown(reown);
+ if (copy) {
+
+ Ref<PackedScene> sdata = memnew( PackedScene );
+ Error err = sdata->pack(copy);
+ memdelete(copy);
+
+ if (err!=OK) {
+ accept->get_ok()->set_text("I see..");
+ accept->set_text("Couldn't save new scene. Likely dependencies (instances) couldn't be satisfied.");
+ accept->popup_centered_minsize();
+ return;
+ }
+
+ int flg=0;
+ if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources"))
+ flg|=ResourceSaver::FLAG_COMPRESS;
+ if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative"))
+ flg|=ResourceSaver::FLAG_RELATIVE_PATHS;
+
+
+ err = ResourceSaver::save(p_file,sdata,flg);
+ if (err!=OK) {
+ accept->get_ok()->set_text("I see..");
+ accept->set_text("Error saving scene.");
+ accept->popup_centered_minsize();
+ return;
+ }
+
+ } else {
+ accept->get_ok()->set_text("I see..");
+ accept->set_text("Error duplicating scene to save it.");
+ accept->popup_centered_minsize();
+ return;
+ }
+
+}
+
void SceneTreeDock::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_tool_selected"),&SceneTreeDock::_tool_selected);
@@ -1301,6 +1446,7 @@ void SceneTreeDock::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_node_prerenamed"),&SceneTreeDock::_node_prerenamed);
ObjectTypeDB::bind_method(_MD("_import_subscene"),&SceneTreeDock::_import_subscene);
ObjectTypeDB::bind_method(_MD("_selection_changed"),&SceneTreeDock::_selection_changed);
+ ObjectTypeDB::bind_method(_MD("_new_scene_from"),&SceneTreeDock::_new_scene_from);
ObjectTypeDB::bind_method(_MD("instance"),&SceneTreeDock::instance);
}
@@ -1373,9 +1519,10 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec
scene_tree->set_undo_redo(&editor_data->get_undo_redo());
scene_tree->set_editor_selection(editor_selection);
+
HBoxContainer *hbc_bottom = memnew( HBoxContainer );
vbc->add_child(hbc_bottom);
-
+ hbc_bottom->add_constant_override("separation", 0);
tb = memnew( ToolButton );
tb->connect("pressed",this,"_tool_selected",make_binds(TOOL_MOVE_UP, false));
@@ -1404,6 +1551,12 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec
hbc_bottom->add_spacer();
tb = memnew( ToolButton );
+ tb->connect("pressed",this,"_tool_selected",make_binds(TOOL_NEW_SCENE_FROM, false));
+ tb->set_tooltip("Create New Scene From Node(s)");
+ hbc_bottom->add_child(tb);
+ tool_buttons[TOOL_NEW_SCENE_FROM]=tb;
+
+ tb = memnew( ToolButton );
tb->connect("pressed",this,"_tool_selected",make_binds(TOOL_MULTI_EDIT, false));
tb->set_tooltip("Multi-Edit Selected Nodes");
hbc_bottom->add_child(tb);
@@ -1423,12 +1576,15 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec
groups_editor = memnew( GroupsEditor );
add_child(groups_editor);
groups_editor->set_undo_redo(&editor_data->get_undo_redo());
+
connect_dialog = memnew( ConnectionsDialog(p_editor) );
add_child(connect_dialog);
connect_dialog->set_undoredo(&editor_data->get_undo_redo());
+
script_create_dialog = memnew( ScriptCreateDialog );
add_child(script_create_dialog);
script_create_dialog->connect("script_created",this,"_script_created");
+
reparent_dialog = memnew( ReparentDialog );
add_child(reparent_dialog);
reparent_dialog->connect("reparent",this,"_node_reparent");
@@ -1444,10 +1600,16 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec
delete_dialog = memnew( ConfirmationDialog );
add_child(delete_dialog);
delete_dialog->connect("confirmed",this,"_delete_confirm");
+
import_subscene_dialog = memnew( EditorSubScene );
add_child(import_subscene_dialog);
import_subscene_dialog->connect("subscene_selected",this,"_import_subscene");
+ new_scene_from_dialog = memnew( EditorFileDialog );
+ new_scene_from_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE);
+ add_child(new_scene_from_dialog);
+ new_scene_from_dialog->connect("file_selected",this,"_new_scene_from");
+
first_enter=true;
diff --git a/tools/editor/scene_tree_dock.h b/tools/editor/scene_tree_dock.h
index b7e96be5c7..114e2c5c97 100644
--- a/tools/editor/scene_tree_dock.h
+++ b/tools/editor/scene_tree_dock.h
@@ -62,6 +62,7 @@ class SceneTreeDock : public VBoxContainer {
TOOL_MOVE_DOWN,
TOOL_DUPLICATE,
TOOL_REPARENT,
+ TOOL_NEW_SCENE_FROM,
TOOL_MULTI_EDIT,
TOOL_ERASE,
TOOL_BUTTON_MAX
@@ -90,6 +91,7 @@ class SceneTreeDock : public VBoxContainer {
ReparentDialog *reparent_dialog;
EditorFileDialog *file;
EditorSubScene *import_subscene_dialog;
+ EditorFileDialog *new_scene_from_dialog;
bool first_enter;
@@ -99,7 +101,7 @@ class SceneTreeDock : public VBoxContainer {
EditorNode *editor;
Node *_duplicate(Node *p_node, Map<Node*,Node*> &duplimap);
- void _node_reparent(NodePath p_path,bool p_node_only);
+ void _node_reparent(NodePath p_path, bool p_keep_global_xform);
void _set_owners(Node *p_owner, const Array& p_nodes);
void _load_request(const String& p_path);
void _script_open_request(const Ref<Script>& p_script);
@@ -119,6 +121,8 @@ class SceneTreeDock : public VBoxContainer {
void _import_subscene();
+ void _new_scene_from(String p_file);
+
bool _validate_no_foreign();
void _selection_changed();
diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp
index cdc0bf0d25..5abc4992df 100644
--- a/tools/editor/scenes_dock.cpp
+++ b/tools/editor/scenes_dock.cpp
@@ -1254,6 +1254,8 @@ ScenesDock::ScenesDock(EditorNode *p_editor) {
history_pos=0;
tree_mode=true;
+ path="res://";
+
}
diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp
index fb821573f9..aad89d1272 100644
--- a/tools/editor/script_editor_debugger.cpp
+++ b/tools/editor/script_editor_debugger.cpp
@@ -569,8 +569,8 @@ void ScriptEditorDebugger::_notification(int p_what) {
ppeer->set_stream_peer(connection);
-
show();
+ emit_signal("show_debugger",true);
dobreak->set_disabled(false);
tabs->set_current_tab(0);
@@ -770,6 +770,7 @@ void ScriptEditorDebugger::_stack_dump_frame_selected() {
void ScriptEditorDebugger::_hide_request() {
+ hide();
emit_signal("show_debugger",false);
}
diff --git a/tools/editor/settings_config_dialog.cpp b/tools/editor/settings_config_dialog.cpp
index ebbc488ff2..3d30b3882d 100644
--- a/tools/editor/settings_config_dialog.cpp
+++ b/tools/editor/settings_config_dialog.cpp
@@ -73,9 +73,6 @@ void EditorSettingsDialog::popup_edit_settings() {
property_editor->edit(EditorSettings::get_singleton());
property_editor->get_property_editor()->update_tree();
- search_box->select_all();
- search_box->grab_focus();
-
popup_centered_ratio(0.7);
}
@@ -248,22 +245,15 @@ void EditorSettingsDialog::_update_plugins() {
}
-void EditorSettingsDialog::_clear_search_box() {
-
- if (search_box->get_text()=="")
- return;
-
- search_box->clear();
- property_editor->get_property_editor()->update_tree();
-}
-
void EditorSettingsDialog::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) {
rescan_plugins->set_icon(get_icon("Reload","EditorIcons"));
- clear_button->set_icon(get_icon("Close","EditorIcons"));
_update_plugins();
+ } else if (p_what==NOTIFICATION_POST_POPUP) {
+
+ property_editor->clear_search_box();
}
}
@@ -275,7 +265,6 @@ void EditorSettingsDialog::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_plugin_settings"),&EditorSettingsDialog::_plugin_settings);
ObjectTypeDB::bind_method(_MD("_plugin_edited"),&EditorSettingsDialog::_plugin_edited);
ObjectTypeDB::bind_method(_MD("_plugin_install"),&EditorSettingsDialog::_plugin_install);
- ObjectTypeDB::bind_method(_MD("_clear_search_box"),&EditorSettingsDialog::_clear_search_box);
}
EditorSettingsDialog::EditorSettingsDialog() {
@@ -286,38 +275,17 @@ EditorSettingsDialog::EditorSettingsDialog() {
add_child(tabs);
set_child_rect(tabs);
- VBoxContainer *vbc = memnew( VBoxContainer );
- tabs->add_child(vbc);
- vbc->set_name("General");
-
- HBoxContainer *hbc = memnew( HBoxContainer );
- hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- vbc->add_child(hbc);
-
- Label *l = memnew( Label );
- l->set_text("Search: ");
- hbc->add_child(l);
-
- search_box = memnew( LineEdit );
- search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- hbc->add_child(search_box);
-
- clear_button = memnew( ToolButton );
- hbc->add_child(clear_button);
- clear_button->connect("pressed",this,"_clear_search_box");
-
property_editor = memnew( SectionedPropertyEditor );
//property_editor->hide_top_label();
- property_editor->get_property_editor()->set_use_filter(true);
- property_editor->get_property_editor()->register_text_enter(search_box);
+ property_editor->set_name("General");
property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- vbc->add_child(property_editor);
+ tabs->add_child(property_editor);
- vbc = memnew( VBoxContainer );
+ VBoxContainer *vbc = memnew( VBoxContainer );
tabs->add_child(vbc);
vbc->set_name("Plugins");
- hbc = memnew( HBoxContainer );
+ HBoxContainer *hbc = memnew( HBoxContainer );
vbc->add_child(hbc);
hbc->add_child( memnew( Label("Plugin List: ")));
hbc->add_spacer();
diff --git a/tools/editor/settings_config_dialog.h b/tools/editor/settings_config_dialog.h
index e1c3238a64..119b4035ca 100644
--- a/tools/editor/settings_config_dialog.h
+++ b/tools/editor/settings_config_dialog.h
@@ -51,8 +51,6 @@ class EditorSettingsDialog : public AcceptDialog {
Button *rescan_plugins;
Tree *plugins;
- LineEdit *search_box;
- ToolButton *clear_button;
SectionedPropertyEditor *property_editor;
Timer *timer;
diff --git a/tools/export/blender25/io_scene_dae/export_dae.py b/tools/export/blender25/io_scene_dae/export_dae.py
index b846f0e2d8..7ee0e179b8 100644
--- a/tools/export/blender25/io_scene_dae/export_dae.py
+++ b/tools/export/blender25/io_scene_dae/export_dae.py
@@ -921,7 +921,7 @@ class DaeExporter:
if (node.parent.type=="ARMATURE"):
armature=node.parent
if (armcount>1):
- self.operator.report({'WARNING'},'Object "'+node.name+'" refers to more than one armature! This is unsopported.')
+ self.operator.report({'WARNING'},'Object "'+node.name+'" refers to more than one armature! This is unsupported.')
if (armcount==0):
self.operator.report({'WARNING'},'Object "'+node.name+'" is child of an armature, but has no armature modifier.')