diff --git a/base/project.js b/base/project.js index 096d9ffb..2c22bd82 100644 --- a/base/project.js +++ b/base/project.js @@ -192,6 +192,7 @@ if (!flags.lite) { add_gpu_backend("metal"); project.add_cfiles("sources/backends/data/ios.plist"); project.add_cfiles("sources/backends/data/LaunchScreen.storyboard"); + project.add_cfiles("sources/backends/ios_file_dialog.m"); project.add_define("IRON_METAL"); project.add_lib("Metal"); project.add_lib("UIKit"); @@ -211,6 +212,7 @@ if (!flags.lite) { add_net_backend("posix"); add_thread_backend("posix"); add_gpu_backend("vulkan"); + project.add_cfiles("sources/backends/android_file_dialog.c"); project.add_define("IRON_ANDROID"); project.add_define("IRON_VULKAN"); project.add_define("IRON_ANDROID_API=24"); diff --git a/base/sources/backends/ios_system.m b/base/sources/backends/ios_system.m index 815fb35c..0df54333 100644 --- a/base/sources/backends/ios_system.m +++ b/base/sources/backends/ios_system.m @@ -69,7 +69,7 @@ int iron_window_height() { float x = point.x * self.contentScaleFactor; float y = point.y * self.contentScaleFactor; // Pencil hover - iron_internal_pen_trigger_move(0, x, y, 0.0); + iron_internal_pen_trigger_move(x, y, 0.0); } - (id)initWithFrame:(CGRect)frame { @@ -131,12 +131,12 @@ void iron_internal_call_resize_callback(int width, int height); float x = point.x * self.contentScaleFactor; float y = point.y * self.contentScaleFactor; if (index == 0) { - iron_internal_mouse_trigger_press(0, event.buttonMask == UIEventButtonMaskSecondary ? 1 : 0, x, y); + iron_internal_mouse_trigger_press(event.buttonMask == UIEventButtonMaskSecondary ? 1 : 0, x, y); } iron_internal_surface_trigger_touch_start(index, x, y); if (touch.type == UITouchTypePencil) { - iron_internal_pen_trigger_press(0, x, y, 0.0); + iron_internal_pen_trigger_press(x, y, 0.0); } } } @@ -150,7 +150,7 @@ void iron_internal_call_resize_callback(int width, int height); float x = point.x * self.contentScaleFactor; float y = point.y * self.contentScaleFactor; if (index == 0) { - iron_internal_mouse_trigger_move(0, x, y); + iron_internal_mouse_trigger_move(x, y); } iron_internal_surface_trigger_move(index, x, y); } @@ -163,7 +163,7 @@ void iron_internal_call_resize_callback(int width, int height); CGPoint point = [touch locationInView:self]; float x = point.x * self.contentScaleFactor; float y = point.y * self.contentScaleFactor; - iron_internal_pen_trigger_move(0, x, y, touch.force); + iron_internal_pen_trigger_move(x, y, touch.force); } } } @@ -176,12 +176,12 @@ void iron_internal_call_resize_callback(int width, int height); float x = point.x * self.contentScaleFactor; float y = point.y * self.contentScaleFactor; if (index == 0) { - iron_internal_mouse_trigger_release(0, event.buttonMask == UIEventButtonMaskSecondary ? 1 : 0, x, y); + iron_internal_mouse_trigger_release(event.buttonMask == UIEventButtonMaskSecondary ? 1 : 0, x, y); } iron_internal_surface_trigger_touch_end(index, x, y); if (touch.type == UITouchTypePencil) { - iron_internal_pen_trigger_release(0, x, y, 0.0); + iron_internal_pen_trigger_release(x, y, 0.0); } } } @@ -195,12 +195,12 @@ void iron_internal_call_resize_callback(int width, int height); float x = point.x * self.contentScaleFactor; float y = point.y * self.contentScaleFactor; if (index == 0) { - iron_internal_mouse_trigger_release(0, event.buttonMask == UIEventButtonMaskSecondary ? 1 : 0, x, y); + iron_internal_mouse_trigger_release(event.buttonMask == UIEventButtonMaskSecondary ? 1 : 0, x, y); } iron_internal_surface_trigger_touch_end(index, x, y); if (touch.type == UITouchTypePencil) { - iron_internal_pen_trigger_release(0, x, y, 0.0); + iron_internal_pen_trigger_release(x, y, 0.0); } } } @@ -398,7 +398,7 @@ void importFile(NSURL *url) { CGPoint point = [session locationInView:self.view]; float x = point.x * glView.contentScaleFactor; float y = point.y * glView.contentScaleFactor; - iron_internal_mouse_trigger_move(0, x, y); + iron_internal_mouse_trigger_move(x, y); iron_internal_surface_trigger_move(0, x, y); for (UIDragItem *item in session.items) { diff --git a/base/sources/iron.h b/base/sources/iron.h index 402c212d..8495d32a 100644 --- a/base/sources/iron.h +++ b/base/sources/iron.h @@ -334,11 +334,11 @@ extern bool waitAfterNextDraw; #ifdef WITH_NFD #include #elif defined(IRON_ANDROID) -#include "android_file_dialog.h" -#include "android_http_request.h" +#include "backends/android_file_dialog.h" +#include "backends/android_http_request.h" #elif defined(IRON_IOS) #include -#include +#include "backends/ios_file_dialog.h" #endif #ifdef WITH_IMAGE_WRITE #ifdef WITH_COMPRESS