comparison ios/dw.m @ 2542:bb75e64e6138

Android: Implement dw_screen_* and dw_environment_query(). Minor code cleanup in dwtest and ios.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 13 May 2021 07:43:31 +0000
parents 2ee4df2c50bf
children 97b30df25fd1
comparison
equal deleted inserted replaced
2541:2ee4df2c50bf 2542:bb75e64e6138
8940 */ 8940 */
8941 void API dw_window_get_pos_size(HWND handle, LONG *x, LONG *y, ULONG *width, ULONG *height) 8941 void API dw_window_get_pos_size(HWND handle, LONG *x, LONG *y, ULONG *width, ULONG *height)
8942 { 8942 {
8943 NSObject *object = handle; 8943 NSObject *object = handle;
8944 8944
8945 if([ object isKindOfClass:[ UIWindow class ] ]) 8945 if([object isKindOfClass:[UIWindow class]])
8946 { 8946 {
8947 UIWindow *window = handle; 8947 UIWindow *window = handle;
8948 CGRect rect = [window frame]; 8948 CGRect rect = [window frame];
8949 if(x) 8949 if(x)
8950 *x = rect.origin.x; 8950 *x = rect.origin.x;
8954 *width = rect.size.width; 8954 *width = rect.size.width;
8955 if(height) 8955 if(height)
8956 *height = rect.size.height; 8956 *height = rect.size.height;
8957 return; 8957 return;
8958 } 8958 }
8959 else if([ object isKindOfClass:[ UIControl class ] ]) 8959 else if([object isKindOfClass:[UIControl class]])
8960 { 8960 {
8961 UIControl *control = handle; 8961 UIControl *control = handle;
8962 CGRect rect = [control frame]; 8962 CGRect rect = [control frame];
8963 if(x) 8963 if(x)
8964 *x = rect.origin.x; 8964 *x = rect.origin.x;
9096 memset(env, '\0', sizeof(DWEnv)); 9096 memset(env, '\0', sizeof(DWEnv));
9097 strcpy(env->osName, "iOS"); 9097 strcpy(env->osName, "iOS");
9098 9098
9099 strncpy(env->buildDate, __DATE__, sizeof(env->buildDate)-1); 9099 strncpy(env->buildDate, __DATE__, sizeof(env->buildDate)-1);
9100 strncpy(env->buildTime, __TIME__, sizeof(env->buildTime)-1); 9100 strncpy(env->buildTime, __TIME__, sizeof(env->buildTime)-1);
9101 strncpy(env->htmlEngine, "WEBKIT", sizeof(env->htmlEngine)-1); 9101 strncpy(env->htmlEngine, "WEBKIT", sizeof(env->htmlEngine)-1);
9102 env->DWMajorVersion = DW_MAJOR_VERSION; 9102 env->DWMajorVersion = DW_MAJOR_VERSION;
9103 env->DWMinorVersion = DW_MINOR_VERSION; 9103 env->DWMinorVersion = DW_MINOR_VERSION;
9104 #ifdef VER_REV 9104 #ifdef VER_REV
9105 env->DWSubVersion = VER_REV; 9105 env->DWSubVersion = VER_REV;
9106 #else 9106 #else