diff --git a/configuration.c b/configuration.c index 4bdaa69509..423399f7ad 100644 --- a/configuration.c +++ b/configuration.c @@ -1646,6 +1646,7 @@ static struct config_path_setting *populate_settings_path( #endif SETTING_ARRAY("log_dir", settings->paths.log_dir, true, NULL, true); + SETTING_ARRAY("app_icon", settings->paths.app_icon, true, NULL, true); *size = count; diff --git a/configuration.h b/configuration.h index 786f1f439c..5b961c03bc 100644 --- a/configuration.h +++ b/configuration.h @@ -563,6 +563,7 @@ typedef struct settings char directory_bottom_assets[PATH_MAX_LENGTH]; #endif char log_dir[PATH_MAX_LENGTH]; + char app_icon[PATH_MAX_LENGTH]; } paths; bool modified; diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 530d73d95c..632c0ae7c4 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -335,6 +335,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_views_settings_list, MENU_ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_views_settings_list, MENU_ENUM_SUBLABEL_QUICK_MENU_VIEWS_SETTINGS) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_settings_views_settings_list, MENU_ENUM_SUBLABEL_SETTINGS_VIEWS_SETTINGS) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_settings_list, MENU_ENUM_SUBLABEL_MENU_SETTINGS) +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_appicon_settings_list, MENU_ENUM_SUBLABEL_APPICON_SETTINGS) #ifdef _3DS DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_bottom_settings_list, MENU_ENUM_SUBLABEL_MENU_BOTTOM_SETTINGS) #endif @@ -4821,6 +4822,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_MENU_SETTINGS: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_settings_list); break; + case MENU_ENUM_LABEL_APPICON_SETTINGS: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_appicon_settings_list); + break; #ifdef _3DS case MENU_ENUM_LABEL_MENU_BOTTOM_SETTINGS: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_bottom_settings_list); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index ee71e2dc8e..fc503218b6 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -8989,8 +8989,10 @@ unsigned menu_displaylist_build_list( (enum menu_screensaver_effect) settings->uints.menu_screensaver_animation; #endif + uico_driver_state_t *uico_st = uico_state_get_ptr(); menu_displaylist_build_info_selective_t build_list[] = { + {MENU_ENUM_LABEL_APPICON_SETTINGS, PARSE_ONLY_STRING_OPTIONS, false}, {MENU_ENUM_LABEL_ONSCREEN_DISPLAY_SETTINGS, PARSE_ACTION, true}, {MENU_ENUM_LABEL_MENU_FILE_BROWSER_SETTINGS, PARSE_ACTION, true}, {MENU_ENUM_LABEL_MENU_VIEWS_SETTINGS, PARSE_ACTION, true}, @@ -9032,6 +9034,9 @@ unsigned menu_displaylist_build_list( { switch (build_list[i].enum_idx) { + case MENU_ENUM_LABEL_APPICON_SETTINGS: + build_list[i].checked = (uico_st->drv && uico_st->drv->set_app_icon); + break; case MENU_ENUM_LABEL_ONSCREEN_DISPLAY_SETTINGS: build_list[i].checked = settings->bools.settings_show_onscreen_display; break; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 80a43f75c7..cc4ff76001 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -9001,6 +9001,16 @@ static void timezone_change_handler(rarch_setting_t *setting) } #endif +static void appicon_change_handler(rarch_setting_t *setting) +{ + uico_driver_state_t *uico_st = uico_state_get_ptr(); + if (!setting) + return; + if (!uico_st->drv || !uico_st->drv->set_app_icon) + return; + uico_st->drv->set_app_icon(setting->value.target.string); +} + #ifdef _3DS static void new3ds_speedup_change_handler(rarch_setting_t *setting) { @@ -19504,6 +19514,36 @@ static bool setting_append_list( START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group); + { + uico_driver_state_t *uico_st = uico_state_get_ptr(); + struct string_list *icons; + if (uico_st->drv && uico_st->drv->get_app_icons && (icons = uico_st->drv->get_app_icons()) && icons->size) + { + char *options; + int len = 0, i = 0; + for (; i < icons->size; i++) + len += strlen(icons->elems[i].data) + 1; + options = (char*)calloc(len, sizeof(char)); + string_list_join_concat(options, len, icons, "|"); + CONFIG_STRING_OPTIONS( + list, list_info, + settings->paths.app_icon, + sizeof(settings->paths.app_icon), + MENU_ENUM_LABEL_APPICON_SETTINGS, + MENU_ENUM_LABEL_VALUE_APPICON_SETTINGS, + icons->elems[0].data, + options, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler); + SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_IS_DRIVER); + (*list)[list_info->index - 1].action_ok = setting_action_ok_uint; + (*list)[list_info->index - 1].change_handler = appicon_change_handler; + } + } + CONFIG_BOOL( list, list_info, &settings->bools.pause_nonactive, diff --git a/pkg/apple/RetroArch_iOS13.xcodeproj/project.pbxproj b/pkg/apple/RetroArch_iOS13.xcodeproj/project.pbxproj index 15e1f4ce10..9a2a471f06 100644 --- a/pkg/apple/RetroArch_iOS13.xcodeproj/project.pbxproj +++ b/pkg/apple/RetroArch_iOS13.xcodeproj/project.pbxproj @@ -73,7 +73,7 @@ 9292D6ED28F549D200E47A75 /* RetroArchWidgetExtension.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 9292D6E928F549D100E47A75 /* RetroArchWidgetExtension.intentdefinition */; }; 9292D6EE28F549D200E47A75 /* RetroArchWidgetExtension.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 9292D6E928F549D100E47A75 /* RetroArchWidgetExtension.intentdefinition */; }; 9292D6F128F549D200E47A75 /* RetroArchWidgetExtensionExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 9292D6E128F549D000E47A75 /* RetroArchWidgetExtensionExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - 929784502200EEE400989A60 /* iOS/Resources/Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 69D31DE31A547EC800EF4C92 /* iOS/Resources/Media.xcassets */; }; + 929784502200EEE400989A60 /* iOS/Resources/Icons.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 69D31DE31A547EC800EF4C92 /* iOS/Resources/Icons.xcassets */; }; 92A1F81827006CAE00DEAD2A /* JITSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 92A1F81727006CAE00DEAD2A /* JITSupport.m */; }; 92CC05A221FE3C1700FF79F0 /* GCDWebServerResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 92CC058221FE3C1700FF79F0 /* GCDWebServerResponse.m */; }; 92CC05A321FE3C1700FF79F0 /* GCDWebServerResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 92CC058221FE3C1700FF79F0 /* GCDWebServerResponse.m */; }; @@ -175,7 +175,7 @@ 50CCC827185E0E7D001F5BC8 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; 50E7189E184B88AA001956CE /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; 696012F119F3389A006A1088 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; }; - 69D31DE31A547EC800EF4C92 /* iOS/Resources/Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = iOS/Resources/Media.xcassets; sourceTree = SOURCE_ROOT; }; + 69D31DE31A547EC800EF4C92 /* iOS/Resources/Icons.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = iOS/Resources/Icons.xcassets; sourceTree = SOURCE_ROOT; }; 83EB675F19EEAF050096F441 /* iOS/modules */ = {isa = PBXFileReference; lastKnownFileType = folder; path = iOS/modules; sourceTree = SOURCE_ROOT; }; 9204BE2B1D319EF300BD49DB /* RetroArch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RetroArch.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9210C2F024B3A19100E6FE7C /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; }; @@ -517,7 +517,7 @@ 07F7FB012A2DA8B800037C04 /* filters */, 9222F20A2315DD3D0097C0FD /* retroarch_logo.png */, 83EB675F19EEAF050096F441 /* iOS/modules */, - 69D31DE31A547EC800EF4C92 /* iOS/Resources/Media.xcassets */, + 69D31DE31A547EC800EF4C92 /* iOS/Resources/Icons.xcassets */, ); name = iOS; path = Resources; @@ -1540,7 +1540,8 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ARCHS = "$(ARCHS_STANDARD)"; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_APPICON_NAME = Default; + ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -1614,7 +1615,8 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ARCHS = "$(ARCHS_STANDARD)"; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_APPICON_NAME = Default; + ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Arcade 1.appiconset/Contents.json b/pkg/apple/iOS/Resources/Icons.xcassets/Arcade 1.appiconset/Contents.json new file mode 100644 index 0000000000..fdf71a79de --- /dev/null +++ b/pkg/apple/iOS/Resources/Icons.xcassets/Arcade 1.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "RetroArch_Arcade_1.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Arcade 1.appiconset/RetroArch_Arcade_1.png b/pkg/apple/iOS/Resources/Icons.xcassets/Arcade 1.appiconset/RetroArch_Arcade_1.png new file mode 100644 index 0000000000..a19f7ba978 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/Arcade 1.appiconset/RetroArch_Arcade_1.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Arcade 2.appiconset/Contents.json b/pkg/apple/iOS/Resources/Icons.xcassets/Arcade 2.appiconset/Contents.json new file mode 100644 index 0000000000..b035f92968 --- /dev/null +++ b/pkg/apple/iOS/Resources/Icons.xcassets/Arcade 2.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "RetroArch_Arcade_2.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Arcade 2.appiconset/RetroArch_Arcade_2.png b/pkg/apple/iOS/Resources/Icons.xcassets/Arcade 2.appiconset/RetroArch_Arcade_2.png new file mode 100644 index 0000000000..d4a9322641 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/Arcade 2.appiconset/RetroArch_Arcade_2.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Contents.json b/pkg/apple/iOS/Resources/Icons.xcassets/Contents.json new file mode 100644 index 0000000000..73c00596a7 --- /dev/null +++ b/pkg/apple/iOS/Resources/Icons.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Default.appiconset/Contents.json b/pkg/apple/iOS/Resources/Icons.xcassets/Default.appiconset/Contents.json new file mode 100644 index 0000000000..0d778b4709 --- /dev/null +++ b/pkg/apple/iOS/Resources/Icons.xcassets/Default.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "Icon-83.5-3.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Default.appiconset/Icon-83.5-3.png b/pkg/apple/iOS/Resources/Icons.xcassets/Default.appiconset/Icon-83.5-3.png new file mode 100644 index 0000000000..02fbb5c7b9 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/Default.appiconset/Icon-83.5-3.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Glow.appiconset/Contents.json b/pkg/apple/iOS/Resources/Icons.xcassets/Glow.appiconset/Contents.json new file mode 100644 index 0000000000..ec9a144133 --- /dev/null +++ b/pkg/apple/iOS/Resources/Icons.xcassets/Glow.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "Retroarch.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Glow.appiconset/Retroarch.png b/pkg/apple/iOS/Resources/Icons.xcassets/Glow.appiconset/Retroarch.png new file mode 100644 index 0000000000..3282888156 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/Glow.appiconset/Retroarch.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Gruvbox.appiconset/Contents.json b/pkg/apple/iOS/Resources/Icons.xcassets/Gruvbox.appiconset/Contents.json new file mode 100644 index 0000000000..be6a1312fa --- /dev/null +++ b/pkg/apple/iOS/Resources/Icons.xcassets/Gruvbox.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "Retroarch_Gruvbox.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Gruvbox.appiconset/Retroarch_Gruvbox.png b/pkg/apple/iOS/Resources/Icons.xcassets/Gruvbox.appiconset/Retroarch_Gruvbox.png new file mode 100644 index 0000000000..6ce263c06b Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/Gruvbox.appiconset/Retroarch_Gruvbox.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/Contents.json b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000000..bd47cf5a39 --- /dev/null +++ b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,212 @@ +{ + "images" : [ + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "2688h", + "filename" : "portrait-1252x2688-1.png", + "minimum-system-version" : "12.0", + "orientation" : "portrait", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "2688h", + "filename" : "landscape-2688x1242-1.png", + "minimum-system-version" : "12.0", + "orientation" : "landscape", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "1792h", + "filename" : "portrait-828x1792.png", + "minimum-system-version" : "12.0", + "orientation" : "portrait", + "scale" : "2x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "1792h", + "filename" : "landscape-1792x828-1.png", + "minimum-system-version" : "12.0", + "orientation" : "landscape", + "scale" : "2x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "2436h", + "filename" : "portrait-1125x2436-1.png", + "minimum-system-version" : "11.0", + "orientation" : "portrait", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "2436h", + "filename" : "landscape-2436x1125-1.png", + "minimum-system-version" : "11.0", + "orientation" : "landscape", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "736h", + "filename" : "portrait-1242x2208.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "736h", + "filename" : "landscape-2208x1242.png", + "minimum-system-version" : "8.0", + "orientation" : "landscape", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "667h", + "filename" : "portrait-750x1334.png", + "minimum-system-version" : "8.0", + "orientation" : "portrait", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "portrait-640x960-1.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "retina4", + "filename" : "portrait-640x1136.png", + "minimum-system-version" : "7.0", + "orientation" : "portrait", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "portrait-768x1024.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "landscape-1024x768.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "portrait-1536x2048.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "landscape-2048x1536.png", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "portrait-320x480.png", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "portrait-640x960.png", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "portrait-640x1136-1.png", + "extent" : "full-screen", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "portrait-768x1004.png", + "extent" : "to-status-bar", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "landscape-1024x748.png", + "extent" : "to-status-bar", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "filename" : "portrait-1536x2008.png", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "filename" : "landscape-2048x1496.png", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-1024x748.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-1024x748.png new file mode 100644 index 0000000000..ac791b844f Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-1024x748.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-1024x768.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-1024x768.png new file mode 100644 index 0000000000..935eb096a4 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-1024x768.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-1792x828-1.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-1792x828-1.png new file mode 100644 index 0000000000..682e44d325 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-1792x828-1.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2048x1496.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2048x1496.png new file mode 100644 index 0000000000..340b5cd301 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2048x1496.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2048x1536.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2048x1536.png new file mode 100644 index 0000000000..1f216c4930 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2048x1536.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2208x1242.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2208x1242.png new file mode 100644 index 0000000000..9cb0fd5e8c Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2208x1242.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2436x1125-1.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2436x1125-1.png new file mode 100644 index 0000000000..2ca0228571 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2436x1125-1.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2688x1242-1.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2688x1242-1.png new file mode 100644 index 0000000000..1df4c64631 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/landscape-2688x1242-1.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1125x2436-1.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1125x2436-1.png new file mode 100644 index 0000000000..386d112258 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1125x2436-1.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1242x2208.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1242x2208.png new file mode 100644 index 0000000000..843a44b15f Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1242x2208.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1252x2688-1.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1252x2688-1.png new file mode 100644 index 0000000000..d9ef902289 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1252x2688-1.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1536x2008.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1536x2008.png new file mode 100644 index 0000000000..e96db48282 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1536x2008.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1536x2048.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1536x2048.png new file mode 100644 index 0000000000..1a6766d3cf Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-1536x2048.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-320x480.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-320x480.png new file mode 100644 index 0000000000..6baa00def2 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-320x480.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-640x1136-1.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-640x1136-1.png new file mode 100644 index 0000000000..5005ec32b0 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-640x1136-1.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-640x1136.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-640x1136.png new file mode 100644 index 0000000000..5005ec32b0 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-640x1136.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-640x960-1.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-640x960-1.png new file mode 100644 index 0000000000..0545bdaf41 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-640x960-1.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-640x960.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-640x960.png new file mode 100644 index 0000000000..0545bdaf41 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-640x960.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-750x1334.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-750x1334.png new file mode 100644 index 0000000000..0ffa3b5e94 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-750x1334.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-768x1004.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-768x1004.png new file mode 100644 index 0000000000..6a7f7dc439 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-768x1004.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-768x1024.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-768x1024.png new file mode 100644 index 0000000000..4cdfd5882d Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-768x1024.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-828x1792.png b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-828x1792.png new file mode 100644 index 0000000000..1f969be734 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/LaunchImage.launchimage/portrait-828x1792.png differ diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Light.appiconset/Contents.json b/pkg/apple/iOS/Resources/Icons.xcassets/Light.appiconset/Contents.json new file mode 100644 index 0000000000..d70a1bf7d0 --- /dev/null +++ b/pkg/apple/iOS/Resources/Icons.xcassets/Light.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "Retroarch_Light.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/pkg/apple/iOS/Resources/Icons.xcassets/Light.appiconset/Retroarch_Light.png b/pkg/apple/iOS/Resources/Icons.xcassets/Light.appiconset/Retroarch_Light.png new file mode 100644 index 0000000000..78227e25c9 Binary files /dev/null and b/pkg/apple/iOS/Resources/Icons.xcassets/Light.appiconset/Retroarch_Light.png differ diff --git a/retroarch.c b/retroarch.c index 896598c990..cd5b4fe7a2 100644 --- a/retroarch.c +++ b/retroarch.c @@ -7552,6 +7552,7 @@ bool retroarch_main_init(int argc, char *argv[]) #endif ); #endif + ui_companion_driver_init_first(); drivers_init(settings, DRIVERS_CMD_ALL, 0, verbosity_enabled); #ifdef HAVE_COMMAND input_driver_deinit_command(input_st); diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 213cade792..6db48a0aca 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -1111,6 +1111,8 @@ ui_companion_driver_t ui_companion_cocoa = { ui_companion_cocoa_get_main_window, NULL, /* log_msg */ NULL, /* is_active */ + NULL, /* get_app_icons */ + NULL, /* set_app_icon */ &ui_browser_window_cocoa, &ui_msg_window_cocoa, &ui_window_cocoa, diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index d19e035657..fcd4c0a5ae 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -41,6 +41,7 @@ #endif #import +#import #import #import @@ -56,6 +57,46 @@ static CFRunLoopObserverRef iterate_observer; static void ui_companion_cocoatouch_event_command( void *data, enum event_command cmd) { } +static struct string_list *ui_companion_cocoatouch_get_app_icons(void) +{ + static struct string_list *list = NULL; + static dispatch_once_t onceToken; + + dispatch_once(&onceToken, ^{ + union string_list_elem_attr attr; + attr.i = 0; + NSDictionary *iconfiles = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIcons"]; + NSString *primary; +#if TARGET_OS_TV + primary = iconfiles[@"CFBundlePrimaryIcon"]; +#else + primary = iconfiles[@"CFBundlePrimaryIcon"][@"CFBundleIconName"]; +#endif + list = string_list_new(); + string_list_append(list, [primary cStringUsingEncoding:kCFStringEncodingUTF8], attr); + + NSArray *alts; +#if TARGET_OS_TV + alts = iconfiles[@"CFBundleAlternateIcons"]; +#else + alts = [iconfiles[@"CFBundleAlternateIcons"] allKeys]; +#endif + NSArray *sorted = [alts sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; + for (NSString *str in sorted) + string_list_append(list, [str cStringUsingEncoding:kCFStringEncodingUTF8], attr); + }); + + return list; +} + +static void ui_companion_cocoatouch_set_app_icon(const char *iconName) +{ + NSString *str; + if (!string_is_equal(iconName, "Default")) + str = [NSString stringWithCString:iconName encoding:NSUTF8StringEncoding]; + [[UIApplication sharedApplication] setAlternateIconName:str completionHandler:nil]; +} + static void rarch_draw_observer(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) { @@ -457,6 +498,22 @@ enum } } +- (NSData *)pngForIcon:(NSString *)iconName +{ + UIImage *img; + NSData *png; + img = [UIImage imageNamed:iconName]; + if (!img) + NSLog(@"could not load %@\n", iconName); + else + { + png = UIImagePNGRepresentation(img); + if (!png) + NSLog(@"could not get png for %@\n", iconName); + } + return png; +} + - (void)applicationDidFinishLaunching:(UIApplication *)application { char arguments[] = "retroarch"; @@ -599,6 +656,26 @@ enum @end +ui_companion_driver_t ui_companion_cocoatouch = { + NULL, /* init */ + NULL, /* deinit */ + NULL, /* toggle */ + ui_companion_cocoatouch_event_command, + NULL, /* notify_refresh */ + NULL, /* msg_queue_push */ + NULL, /* render_messagebox */ + NULL, /* get_main_window */ + NULL, /* log_msg */ + NULL, /* is_active */ + ui_companion_cocoatouch_get_app_icons, + ui_companion_cocoatouch_set_app_icon, + NULL, /* browser_window */ + NULL, /* msg_window */ + NULL, /* window */ + NULL, /* application */ + "cocoatouch", +}; + int main(int argc, char *argv[]) { #if TARGET_OS_IOS diff --git a/ui/drivers/ui_qt.cpp b/ui/drivers/ui_qt.cpp index 53485619e5..93edf9a075 100644 --- a/ui/drivers/ui_qt.cpp +++ b/ui/drivers/ui_qt.cpp @@ -4940,6 +4940,8 @@ ui_companion_driver_t ui_companion_qt = { NULL, ui_companion_qt_log_msg, ui_companion_qt_is_active, + NULL, /* get_app_icons */ + NULL, /* set_app_icon */ &ui_browser_window_qt, &ui_msg_window_qt, &ui_window_qt, diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index cebd5b6f94..fd4520270c 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -336,6 +336,8 @@ ui_companion_driver_t ui_companion_win32 = { NULL, NULL, /* log_msg */ NULL, /* is_active */ + NULL, /* get_app_icons */ + NULL, /* set_app_icon */ &ui_browser_window_win32, &ui_msg_window_win32, &ui_window_win32, diff --git a/ui/ui_companion_driver.c b/ui/ui_companion_driver.c index f8b16fdf86..92408eaf2b 100644 --- a/ui/ui_companion_driver.c +++ b/ui/ui_companion_driver.c @@ -38,6 +38,8 @@ static ui_companion_driver_t ui_companion_null = { NULL, /* get_main_window */ NULL, /* log_msg */ NULL, /* is_active */ + NULL, /* get_app_icons */ + NULL, /* set_app_icon */ NULL, /* browser_window */ NULL, /* msg_window */ NULL, /* window */ @@ -51,6 +53,9 @@ static const ui_companion_driver_t *ui_companion_drivers[] = { #endif #if defined(OSX) &ui_companion_cocoa, +#endif +#if defined(IOS) + &ui_companion_cocoatouch, #endif &ui_companion_null, NULL diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index f0071b2a2b..0e5f8c21e3 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -22,6 +22,7 @@ #include #include #include +#include #ifdef HAVE_CONFIG_H #include "../config.h" @@ -130,6 +131,8 @@ typedef struct ui_companion_driver void *(*get_main_window)(void *data); void (*log_msg)(void *data, const char *msg); bool (*is_active)(void *data); + struct string_list *(*get_app_icons)(void); + void (*set_app_icon)(const char *icon); ui_browser_window_t *browser_window; ui_msg_window_t *msg_window; ui_window_t *window; @@ -181,6 +184,7 @@ void ui_companion_driver_toggle( uico_driver_state_t *uico_state_get_ptr(void); extern ui_companion_driver_t ui_companion_cocoa; +extern ui_companion_driver_t ui_companion_cocoatouch; extern ui_companion_driver_t ui_companion_qt; extern ui_companion_driver_t ui_companion_win32;