changeset 2472:206a0643add6

iOS: Move scrollbox functions into thread safety.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 15 Apr 2021 02:11:04 +0000
parents ed955edc7204
children aa420e366b2b
files ios/dw.m
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ios/dw.m	Thu Apr 15 01:29:32 2021 +0000
+++ b/ios/dw.m	Thu Apr 15 02:11:04 2021 +0000
@@ -3512,7 +3512,10 @@
  *          handle: Handle to the scrollbox to be queried.
  *          orient: The vertical or horizontal scrollbar.
  */
-int API dw_scrollbox_get_pos(HWND handle, int orient)
+DW_FUNCTION_DEFINITION(dw_scrollbox_get_pos, int, HWND handle, int orient)
+DW_FUNCTION_ADD_PARAM2(handle, orient)
+DW_FUNCTION_RETURN(dw_scrollbox_get_pos, int)
+DW_FUNCTION_RESTORE_PARAM2(handle, HWND, orient, int)
 {
     DWScrollBox *scrollbox = handle;
     NSArray *subviews = [scrollbox subviews];
@@ -3535,7 +3538,7 @@
     {
         val = range;
     }
-    return val;
+    DW_FUNCTION_RETURN_THIS(val);
 }
 
 /*
@@ -3544,7 +3547,10 @@
  *          handle: Handle to the scrollbox to be queried.
  *          orient: The vertical or horizontal scrollbar.
  */
-int API dw_scrollbox_get_range(HWND handle, int orient)
+DW_FUNCTION_DEFINITION(dw_scrollbox_get_range, int, HWND handle, int orient)
+DW_FUNCTION_ADD_PARAM2(handle, orient)
+DW_FUNCTION_RETURN(dw_scrollbox_get_range, int)
+DW_FUNCTION_RESTORE_PARAM2(handle, HWND, orient, int)
 {
     DWScrollBox *scrollbox = handle;
     NSArray *subviews = [scrollbox subviews];
@@ -3558,7 +3564,7 @@
     {
         range = [view bounds].size.width;
     }
-    return range;
+    DW_FUNCTION_RETURN_THIS(range);
 }
 
 /* Return the handle to the text object */
@@ -3770,13 +3776,13 @@
     }
 
     /* Query the objects */
-    if([ object isKindOfClass:[ UIWindow class ] ])
+    if([object isKindOfClass:[UIWindow class]])
     {
         UIWindow *window = box;
         NSArray *subviews = [window subviews];
         view = [subviews firstObject];
     }
-    else if([ object isMemberOfClass:[ DWScrollBox class ] ])
+    else if([object isMemberOfClass:[DWScrollBox class]])
     {
         DWScrollBox *scrollbox = box;
         view = [scrollbox box];