mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Rename some system functions, merge the Launch* ones.
android launchurl buildfix
This commit is contained in:
parent
a9eaa4fdc8
commit
d3955b42bb
32 changed files with 178 additions and 207 deletions
|
@ -4,6 +4,16 @@
|
|||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
// Platform integration
|
||||
|
||||
// To run the PPSSPP core, a platform needs to implement all the System_ functions in this file,
|
||||
// plus derive an object from Host (see Host.h). The latter will be phased out.
|
||||
// Failure to implement all of these will simply cause linker failures. There are a few that are
|
||||
// only implemented on specific platforms, but they're also only called on those platforms.
|
||||
|
||||
// The platform then calls the entry points from NativeApp.h as appropriate. That's basically it,
|
||||
// disregarding build system complexities.
|
||||
|
||||
enum SystemPermission {
|
||||
SYSTEM_PERMISSION_STORAGE,
|
||||
};
|
||||
|
@ -18,7 +28,7 @@ enum PermissionStatus {
|
|||
// These APIs must be implemented by every port (for example app-android.cpp, SDLMain.cpp).
|
||||
// Ideally these should be safe to call from any thread.
|
||||
void System_Toast(const char *text);
|
||||
void ShowKeyboard();
|
||||
void System_ShowKeyboard();
|
||||
|
||||
// Vibrate either takes a number of milliseconds to vibrate unconditionally,
|
||||
// or you can specify these constants for "standard" feedback. On Android,
|
||||
|
@ -30,11 +40,16 @@ enum {
|
|||
HAPTIC_VIRTUAL_KEY = -2,
|
||||
HAPTIC_LONG_PRESS_ACTIVATED = -3,
|
||||
};
|
||||
void Vibrate(int length_ms);
|
||||
void OpenDirectory(const char *path);
|
||||
void LaunchBrowser(const char *url);
|
||||
void LaunchMarket(const char *url);
|
||||
void LaunchEmail(const char *email_address);
|
||||
|
||||
enum class LaunchUrlType {
|
||||
BROWSER_URL,
|
||||
MARKET_URL,
|
||||
EMAIL_ADDRESS,
|
||||
};
|
||||
|
||||
void System_Vibrate(int length_ms);
|
||||
void System_ShowFileInFolder(const char *path);
|
||||
void System_LaunchUrl(LaunchUrlType urlType, const char *url);
|
||||
void System_InputBoxGetString(const std::string &title, const std::string &defaultValue, std::function<void(bool, const std::string &)> cb);
|
||||
void System_SendMessage(const char *command, const char *parameter);
|
||||
PermissionStatus System_GetPermissionStatus(SystemPermission permission);
|
||||
|
@ -123,6 +138,6 @@ int System_GetPropertyInt(SystemProperty prop);
|
|||
float System_GetPropertyFloat(SystemProperty prop);
|
||||
bool System_GetPropertyBool(SystemProperty prop);
|
||||
|
||||
std::vector<std::string> __cameraGetDeviceList();
|
||||
bool audioRecording_Available();
|
||||
bool audioRecording_State();
|
||||
std::vector<std::string> System_GetCameraDeviceList();
|
||||
bool System_AudioRecordingIsAvailable();
|
||||
bool System_AudioRecordingState();
|
||||
|
|
|
@ -332,7 +332,7 @@ std::vector<std::string> Camera::getDeviceList() {
|
|||
return winCamera->getDeviceList();
|
||||
}
|
||||
#elif PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(IOS)
|
||||
return __cameraGetDeviceList();
|
||||
return System_GetCameraDeviceList();
|
||||
#elif defined(USING_QT_UI) // Qt:macOS / Qt:Linux
|
||||
return __qt_getDeviceList();
|
||||
#elif PPSSPP_PLATFORM(LINUX) // SDL:Linux
|
||||
|
|
|
@ -349,7 +349,7 @@ bool Microphone::isHaveDevice() {
|
|||
#ifdef HAVE_WIN32_MICROPHONE
|
||||
return winMic->getDeviceCounts() >= 1;
|
||||
#elif PPSSPP_PLATFORM(ANDROID)
|
||||
return audioRecording_Available();
|
||||
return System_AudioRecordingIsAvailable();
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ public:
|
|||
//this is sent from EMU thread! Make sure that Host handles it properly!
|
||||
virtual void BootDone() {}
|
||||
|
||||
virtual bool IsDebuggingEnabled() {return true;}
|
||||
virtual bool AttemptLoadSymbolMap();
|
||||
virtual void SaveSymbolMap() {}
|
||||
virtual void NotifySymbolMapUpdated() {}
|
||||
|
|
|
@ -56,13 +56,6 @@ public:
|
|||
mainWindow->Notify(MainWindowMsg::BOOT_DONE);
|
||||
}
|
||||
|
||||
bool IsDebuggingEnabled() override {
|
||||
#ifdef _DEBUG
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
bool AttemptLoadSymbolMap() override {
|
||||
auto fn = SymbolMapFilename(PSP_CoreParameter().fileToStart);
|
||||
return g_symbolMap->LoadSymbolMap(fn);
|
||||
|
|
|
@ -295,18 +295,18 @@ void System_InputBoxGetString(const std::string &title, const std::string &defau
|
|||
}
|
||||
}
|
||||
|
||||
void Vibrate(int length_ms) {
|
||||
void System_Vibrate(int length_ms) {
|
||||
if (length_ms == -1 || length_ms == -3)
|
||||
length_ms = 50;
|
||||
else if (length_ms == -2)
|
||||
length_ms = 25;
|
||||
}
|
||||
|
||||
void OpenDirectory(const char *path) {
|
||||
void System_ShowFileInFolder(const char *path) {
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromUtf8(path)));
|
||||
}
|
||||
|
||||
void LaunchBrowser(const char *url)
|
||||
void System_LaunchUrl(LaunchUrlType urlType, const char *url)
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl(url));
|
||||
}
|
||||
|
|
|
@ -158,11 +158,11 @@ void System_Toast(const char *text) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void ShowKeyboard() {
|
||||
void System_ShowKeyboard() {
|
||||
// Irrelevant on PC
|
||||
}
|
||||
|
||||
void Vibrate(int length_ms) {
|
||||
void System_Vibrate(int length_ms) {
|
||||
// Ignore on PC
|
||||
}
|
||||
|
||||
|
@ -205,7 +205,7 @@ void System_SendMessage(const char *command, const char *parameter) {
|
|||
void System_AskForPermission(SystemPermission permission) {}
|
||||
PermissionStatus System_GetPermissionStatus(SystemPermission permission) { return PERMISSION_STATUS_GRANTED; }
|
||||
|
||||
void OpenDirectory(const char *path) {
|
||||
void System_ShowFileInFolder(const char *path) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS)
|
||||
SFGAOF flags;
|
||||
PIDLIST_ABSOLUTE pidl = nullptr;
|
||||
|
@ -231,7 +231,11 @@ void OpenDirectory(const char *path) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void LaunchBrowser(const char *url) {
|
||||
void System_LaunchUrl(LaunchUrlType urlType, const char *url) {
|
||||
switch (urlType) {
|
||||
case LaunchUrlType::BROWSER_URL:
|
||||
case LaunchUrlType::MARKET_URL:
|
||||
{
|
||||
#if PPSSPP_PLATFORM(SWITCH)
|
||||
Uuid uuid = { 0 };
|
||||
WebWifiConfig conf;
|
||||
|
@ -252,47 +256,28 @@ void LaunchBrowser(const char *url) {
|
|||
INFO_LOG(SYSTEM, "Would have gone to %s but xdg-utils seems not to be installed", url);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void LaunchMarket(const char *url) {
|
||||
#if PPSSPP_PLATFORM(SWITCH)
|
||||
Uuid uuid = { 0 };
|
||||
WebWifiConfig conf;
|
||||
webWifiCreate(&conf, NULL, url, uuid, 0);
|
||||
webWifiShow(&conf, NULL);
|
||||
#elif defined(MOBILE_DEVICE)
|
||||
INFO_LOG(SYSTEM, "Would have gone to %s but LaunchMarket is not implemented on this platform", url);
|
||||
break;
|
||||
}
|
||||
case LaunchUrlType::EMAIL_ADDRESS:
|
||||
{
|
||||
#if defined(MOBILE_DEVICE)
|
||||
INFO_LOG(SYSTEM, "Would have opened your email client for %s but LaunchEmail is not implemented on this platform", url);
|
||||
#elif defined(_WIN32)
|
||||
std::wstring wurl = ConvertUTF8ToWString(url);
|
||||
ShellExecute(NULL, L"open", wurl.c_str(), NULL, NULL, SW_SHOWNORMAL);
|
||||
std::wstring mailto = std::wstring(L"mailto:") + ConvertUTF8ToWString(url);
|
||||
ShellExecute(NULL, L"open", mailto.c_str(), NULL, NULL, SW_SHOWNORMAL);
|
||||
#elif defined(__APPLE__)
|
||||
std::string command = std::string("open ") + url;
|
||||
std::string command = std::string("open mailto:") + url;
|
||||
system(command.c_str());
|
||||
#else
|
||||
std::string command = std::string("xdg-open ") + url;
|
||||
std::string command = std::string("xdg-email ") + url;
|
||||
int err = system(command.c_str());
|
||||
if (err) {
|
||||
INFO_LOG(SYSTEM, "Would have gone to %s but xdg-utils seems not to be installed", url);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void LaunchEmail(const char *email_address) {
|
||||
#if defined(MOBILE_DEVICE)
|
||||
INFO_LOG(SYSTEM, "Would have opened your email client for %s but LaunchEmail is not implemented on this platform", email_address);
|
||||
#elif defined(_WIN32)
|
||||
std::wstring mailto = std::wstring(L"mailto:") + ConvertUTF8ToWString(email_address);
|
||||
ShellExecute(NULL, L"open", mailto.c_str(), NULL, NULL, SW_SHOWNORMAL);
|
||||
#elif defined(__APPLE__)
|
||||
std::string command = std::string("open mailto:") + email_address;
|
||||
system(command.c_str());
|
||||
#else
|
||||
std::string command = std::string("xdg-email ") + email_address;
|
||||
int err = system(command.c_str());
|
||||
if (err) {
|
||||
INFO_LOG(SYSTEM, "Would have gone to %s but xdg-utils seems not to be installed", email_address);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string System_GetProperty(SystemProperty prop) {
|
||||
|
|
|
@ -173,7 +173,7 @@ UI::EventReturn CwCheatScreen::OnEditCheatFile(UI::EventParams ¶ms) {
|
|||
}
|
||||
if (engine_) {
|
||||
#if PPSSPP_PLATFORM(UWP)
|
||||
LaunchBrowser(engine_->CheatFilename().c_str());
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, engine_->CheatFilename().c_str());
|
||||
#else
|
||||
File::OpenFileInEditor(engine_->CheatFilename());
|
||||
#endif
|
||||
|
|
|
@ -328,7 +328,7 @@ void GameScreen::render() {
|
|||
}
|
||||
|
||||
UI::EventReturn GameScreen::OnShowInFolder(UI::EventParams &e) {
|
||||
OpenDirectory(gamePath_.c_str());
|
||||
System_ShowFileInFolder(gamePath_.c_str());
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -965,7 +965,7 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
|
|||
|
||||
if (System_GetPropertyBool(SYSPROP_HAS_OPEN_DIRECTORY)) {
|
||||
systemSettings->Add(new Choice(sy->T("Show Memory Stick folder")))->OnClick.Add([](UI::EventParams &p) {
|
||||
OpenDirectory(File::ResolvePath(g_Config.memStickDirectory.ToString()).c_str());
|
||||
System_ShowFileInFolder(File::ResolvePath(g_Config.memStickDirectory.ToString()).c_str());
|
||||
return UI::EVENT_DONE;
|
||||
});
|
||||
}
|
||||
|
@ -1213,7 +1213,7 @@ void RecreateActivity() {
|
|||
|
||||
UI::EventReturn GameSettingsScreen::OnAdhocGuides(UI::EventParams &e) {
|
||||
auto n = GetI18NCategory("Networking");
|
||||
LaunchBrowser(n->T("MultiplayerHowToURL", "https://github.com/hrydgard/ppsspp/wiki/How-to-play-multiplayer-games-with-PPSSPP"));
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, n->T("MultiplayerHowToURL", "https://github.com/hrydgard/ppsspp/wiki/How-to-play-multiplayer-games-with-PPSSPP"));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ bool PSPButton::Touch(const TouchInput &input) {
|
|||
bool down = pointerDownMask_ != 0;
|
||||
if (down && !lastDown) {
|
||||
if (g_Config.bHapticFeedback) {
|
||||
Vibrate(HAPTIC_VIRTUAL_KEY);
|
||||
System_Vibrate(HAPTIC_VIRTUAL_KEY);
|
||||
}
|
||||
__CtrlButtonDown(pspButtonBit_);
|
||||
} else if (lastDown && !down) {
|
||||
|
@ -210,7 +210,7 @@ bool ComboKey::Touch(const TouchInput &input) {
|
|||
|
||||
if (down && !lastDown) {
|
||||
if (g_Config.bHapticFeedback)
|
||||
Vibrate(HAPTIC_VIRTUAL_KEY);
|
||||
System_Vibrate(HAPTIC_VIRTUAL_KEY);
|
||||
|
||||
if (!repeat_) {
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++) {
|
||||
|
@ -359,7 +359,7 @@ void PSPDpad::ProcessTouch(float x, float y, bool down) {
|
|||
for (int i = 0; i < 4; i++) {
|
||||
if (pressed & dir[i]) {
|
||||
if (g_Config.bHapticFeedback) {
|
||||
Vibrate(HAPTIC_VIRTUAL_KEY);
|
||||
System_Vibrate(HAPTIC_VIRTUAL_KEY);
|
||||
}
|
||||
__CtrlButtonDown(dir[i]);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@ public:
|
|||
// this is sent from EMU thread! Make sure that Host handles it properly!
|
||||
void BootDone() override {}
|
||||
|
||||
bool IsDebuggingEnabled() override {return false;}
|
||||
bool AttemptLoadSymbolMap() override {return false;}
|
||||
void NotifySymbolMapUpdated() override {}
|
||||
void SetWindowTitle(const char *message) override {}
|
||||
|
|
|
@ -533,7 +533,7 @@ UI::EventReturn GameBrowser::LayoutChange(UI::EventParams &e) {
|
|||
}
|
||||
|
||||
UI::EventReturn GameBrowser::LastClick(UI::EventParams &e) {
|
||||
LaunchBrowser(lastLink_.c_str());
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, lastLink_.c_str());
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
|
@ -1226,16 +1226,16 @@ UI::EventReturn MainScreen::OnDownloadUpgrade(UI::EventParams &e) {
|
|||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
// Go to app store
|
||||
if (System_GetPropertyBool(SYSPROP_APP_GOLD)) {
|
||||
LaunchBrowser("market://details?id=org.ppsspp.ppssppgold");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "market://details?id=org.ppsspp.ppssppgold");
|
||||
} else {
|
||||
LaunchBrowser("market://details?id=org.ppsspp.ppsspp");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "market://details?id=org.ppsspp.ppsspp");
|
||||
}
|
||||
#elif PPSSPP_PLATFORM(WINDOWS)
|
||||
LaunchBrowser("https://www.ppsspp.org/download");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org/download");
|
||||
#else
|
||||
// Go directly to ppsspp.org and let the user sort it out
|
||||
// (for details and in case downloads doesn't have their platform.)
|
||||
LaunchBrowser("https://www.ppsspp.org/");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org/");
|
||||
#endif
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
@ -1414,20 +1414,20 @@ UI::EventReturn MainScreen::OnCredits(UI::EventParams &e) {
|
|||
|
||||
UI::EventReturn MainScreen::OnSupport(UI::EventParams &e) {
|
||||
#ifdef __ANDROID__
|
||||
LaunchBrowser("market://details?id=org.ppsspp.ppssppgold");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "market://details?id=org.ppsspp.ppssppgold");
|
||||
#else
|
||||
LaunchBrowser("https://www.ppsspp.org/buygold");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org/buygold");
|
||||
#endif
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn MainScreen::OnPPSSPPOrg(UI::EventParams &e) {
|
||||
LaunchBrowser("https://www.ppsspp.org");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org");
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn MainScreen::OnForums(UI::EventParams &e) {
|
||||
LaunchBrowser("https://forums.ppsspp.org");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://forums.ppsspp.org");
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -304,7 +304,7 @@ void MemStickScreen::CreateViews() {
|
|||
UI::EventReturn MemStickScreen::OnHelp(UI::EventParams ¶ms) {
|
||||
// I'm letting the old redirect handle this one, as the target is within /docs on the website,
|
||||
// and that structure may change a bit.
|
||||
LaunchBrowser("https://www.ppsspp.org/guide_storage.html");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org/guide_storage.html");
|
||||
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
|
|
@ -840,9 +840,9 @@ void CreditsScreen::CreateViews() {
|
|||
|
||||
UI::EventReturn CreditsScreen::OnSupport(UI::EventParams &e) {
|
||||
#ifdef __ANDROID__
|
||||
LaunchBrowser("market://details?id=org.ppsspp.ppssppgold");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "market://details?id=org.ppsspp.ppssppgold");
|
||||
#else
|
||||
LaunchBrowser("https://www.ppsspp.org/buygold");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org/buygold");
|
||||
#endif
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
@ -851,28 +851,28 @@ UI::EventReturn CreditsScreen::OnTwitter(UI::EventParams &e) {
|
|||
#ifdef __ANDROID__
|
||||
System_SendMessage("showTwitter", "PPSSPP_emu");
|
||||
#else
|
||||
LaunchBrowser("https://twitter.com/#!/PPSSPP_emu");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://twitter.com/#!/PPSSPP_emu");
|
||||
#endif
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn CreditsScreen::OnPPSSPPOrg(UI::EventParams &e) {
|
||||
LaunchBrowser("https://www.ppsspp.org");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org");
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn CreditsScreen::OnPrivacy(UI::EventParams &e) {
|
||||
LaunchBrowser("https://www.ppsspp.org/privacy");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.ppsspp.org/privacy");
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn CreditsScreen::OnForums(UI::EventParams &e) {
|
||||
LaunchBrowser("https://forums.ppsspp.org");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://forums.ppsspp.org");
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn CreditsScreen::OnDiscord(UI::EventParams &e) {
|
||||
LaunchBrowser("https://discord.gg/5NJB6dD");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://discord.gg/5NJB6dD");
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -392,7 +392,7 @@ EventReturn ReportScreen::HandleSubmit(EventParams &e) {
|
|||
|
||||
EventReturn ReportScreen::HandleBrowser(EventParams &e) {
|
||||
const std::string url = "https://" + Reporting::ServerHost() + "/";
|
||||
LaunchBrowser(url.c_str());
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, url.c_str());
|
||||
return EVENT_DONE;
|
||||
}
|
||||
|
||||
|
@ -515,6 +515,6 @@ void ReportFinishScreen::ShowSuggestions() {
|
|||
|
||||
UI::EventReturn ReportFinishScreen::HandleViewFeedback(UI::EventParams &e) {
|
||||
const std::string url = "https://" + Reporting::ServerHost() + "/game/" + Reporting::CurrentGameID();
|
||||
LaunchBrowser(url.c_str());
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, url.c_str());
|
||||
return EVENT_DONE;
|
||||
}
|
||||
|
|
|
@ -476,17 +476,17 @@ void System_SendMessage(const char *command, const char *parameter) {
|
|||
}
|
||||
}
|
||||
|
||||
void OpenDirectory(const char *path) {
|
||||
void System_ShowFileInFolder(const char *path) {
|
||||
// Unsupported
|
||||
}
|
||||
|
||||
void LaunchBrowser(const char *url) {
|
||||
void System_LaunchUrl(LaunchUrlType urlType, const char *url) {
|
||||
auto uri = ref new Windows::Foundation::Uri(ToPlatformString(url));
|
||||
|
||||
create_task(Windows::System::Launcher::LaunchUriAsync(uri)).then([](bool b) {});
|
||||
}
|
||||
|
||||
void Vibrate(int length_ms) {
|
||||
void System_Vibrate(int length_ms) {
|
||||
#if _M_ARM
|
||||
if (length_ms == -1 || length_ms == -3)
|
||||
length_ms = 50;
|
||||
|
|
|
@ -148,10 +148,6 @@ void UWPHost::NotifySymbolMapUpdated() {
|
|||
g_symbolMap->SortSymbols();
|
||||
}
|
||||
|
||||
bool UWPHost::IsDebuggingEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UWPHost::CanCreateShortcut() {
|
||||
return false; // Turn on when below function fixed
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ public:
|
|||
void UpdateSound() override;
|
||||
void ShutdownSound() override;
|
||||
|
||||
bool IsDebuggingEnabled() override;
|
||||
void BootDone() override;
|
||||
bool AttemptLoadSymbolMap() override;
|
||||
void SaveSymbolMap() override;
|
||||
|
|
|
@ -219,7 +219,7 @@ void MainThreadFunc() {
|
|||
} else {
|
||||
if (g_Config.iGPUBackend == (int)GPUBackend::DIRECT3D9) {
|
||||
// Allow the user to download the DX9 runtime.
|
||||
LaunchBrowser("https://www.microsoft.com/en-us/download/details.aspx?id=34429");
|
||||
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.microsoft.com/en-us/download/details.aspx?id=34429");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1213,7 +1213,7 @@ BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
|
|||
case IDC_GEDBG_RECORD:
|
||||
GPURecord::SetCallback([](const Path &path) {
|
||||
// Opens a Windows Explorer window with the file.
|
||||
OpenDirectory(path.c_str());
|
||||
System_ShowFileInFolder(path.c_str());
|
||||
});
|
||||
GPURecord::Activate();
|
||||
break;
|
||||
|
|
|
@ -304,14 +304,6 @@ void WindowsHost::NotifySymbolMapUpdated() {
|
|||
PostMessage(mainWindow_, WM_USER + 1, 0, 0);
|
||||
}
|
||||
|
||||
bool WindowsHost::IsDebuggingEnabled() {
|
||||
#ifdef _DEBUG
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
// http://msdn.microsoft.com/en-us/library/aa969393.aspx
|
||||
HRESULT CreateLink(LPCWSTR lpszPathObj, LPCWSTR lpszArguments, LPCWSTR lpszPathLink, LPCWSTR lpszDesc) {
|
||||
HRESULT hres;
|
||||
|
|
|
@ -48,7 +48,6 @@ public:
|
|||
void UpdateSound() override;
|
||||
void ShutdownSound() override;
|
||||
|
||||
bool IsDebuggingEnabled() override;
|
||||
void BootDone() override;
|
||||
bool AttemptLoadSymbolMap() override;
|
||||
void SaveSymbolMap() override;
|
||||
|
|
|
@ -110,7 +110,7 @@ int g_activeWindow = 0;
|
|||
static std::thread inputBoxThread;
|
||||
static bool inputBoxRunning = false;
|
||||
|
||||
void OpenDirectory(const char *path) {
|
||||
void System_ShowFileInFolder(const char *path) {
|
||||
// SHParseDisplayName can't handle relative paths, so normalize first.
|
||||
std::string resolved = ReplaceAll(File::ResolvePath(path), "/", "\\");
|
||||
|
||||
|
@ -125,11 +125,11 @@ void OpenDirectory(const char *path) {
|
|||
}
|
||||
}
|
||||
|
||||
void LaunchBrowser(const char *url) {
|
||||
void System_LaunchUrl(LaunchUrlType urlType, const char *url) {
|
||||
ShellExecute(NULL, L"open", ConvertUTF8ToWString(url).c_str(), NULL, NULL, SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
void Vibrate(int length_ms) {
|
||||
void System_Vibrate(int length_ms) {
|
||||
// Ignore on PC
|
||||
}
|
||||
|
||||
|
|
|
@ -381,30 +381,26 @@ void System_Toast(const char *text) {
|
|||
PushCommand("toast", text);
|
||||
}
|
||||
|
||||
void ShowKeyboard() {
|
||||
void System_ShowKeyboard() {
|
||||
PushCommand("showKeyboard", "");
|
||||
}
|
||||
|
||||
void Vibrate(int length_ms) {
|
||||
void System_Vibrate(int length_ms) {
|
||||
char temp[32];
|
||||
sprintf(temp, "%i", length_ms);
|
||||
PushCommand("vibrate", temp);
|
||||
}
|
||||
|
||||
void OpenDirectory(const char *path) {
|
||||
void System_ShowFileInFolder(const char *path) {
|
||||
// Unsupported
|
||||
}
|
||||
|
||||
void LaunchBrowser(const char *url) {
|
||||
PushCommand("launchBrowser", url);
|
||||
}
|
||||
|
||||
void LaunchMarket(const char *url) {
|
||||
PushCommand("launchMarket", url);
|
||||
}
|
||||
|
||||
void LaunchEmail(const char *email_address) {
|
||||
PushCommand("launchEmail", email_address);
|
||||
void System_LaunchUrl(LaunchUrlType urlType, const char *url) {
|
||||
switch (urlType) {
|
||||
case LaunchUrlType::BROWSER_URL: PushCommand("launchBrowser", url); break;
|
||||
case LaunchUrlType::MARKET_URL: PushCommand("launchMarket", url); break;
|
||||
case LaunchUrlType::EMAIL_ADDRESS: PushCommand("launchEmail", url); break;
|
||||
}
|
||||
}
|
||||
|
||||
void System_SendMessage(const char *command, const char *parameter) {
|
||||
|
@ -855,11 +851,11 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_audioRecording_1Stop(JNIEnv *,
|
|||
AndroidAudio_Recording_Stop(g_audioState);
|
||||
}
|
||||
|
||||
bool audioRecording_Available() {
|
||||
bool System_AudioRecordingIsAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool audioRecording_State() {
|
||||
bool System_AudioRecordingState() {
|
||||
return AndroidAudio_Recording_State(g_audioState);
|
||||
}
|
||||
|
||||
|
@ -1278,7 +1274,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_setDisplayParameters(JN
|
|||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> __cameraGetDeviceList() {
|
||||
std::vector<std::string> System_GetCameraDeviceList() {
|
||||
jclass cameraClass = findClass("org/ppsspp/ppsspp/CameraHelper");
|
||||
jmethodID deviceListMethod = getEnv()->GetStaticMethodID(cameraClass, "getDeviceList", "()Ljava/util/ArrayList;");
|
||||
jobject deviceListObject = getEnv()->CallStaticObjectMethod(cameraClass, deviceListMethod);
|
||||
|
|
|
@ -60,8 +60,8 @@ jclass findClass(const char *name) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
bool audioRecording_Available() { return false; }
|
||||
bool audioRecording_State() { return false; }
|
||||
bool System_AudioRecordingIsAvailable() { return false; }
|
||||
bool System_AudioRecordingState() { return false; }
|
||||
#endif
|
||||
|
||||
class PrintfLogger : public LogListener {
|
||||
|
|
|
@ -44,7 +44,6 @@ public:
|
|||
// this is sent from EMU thread! Make sure that Host handles it properly
|
||||
void BootDone() override {}
|
||||
|
||||
bool IsDebuggingEnabled() override { return false; }
|
||||
bool AttemptLoadSymbolMap() override { g_symbolMap->Clear(); return false; }
|
||||
void NotifySymbolMapUpdated() override {}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
@implementation CameraHelper
|
||||
|
||||
std::vector<std::string> __cameraGetDeviceList() {
|
||||
std::vector<std::string> System_GetCameraDeviceList() {
|
||||
std::vector<std::string> deviceList;
|
||||
for (AVCaptureDevice *device in [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]) {
|
||||
deviceList.push_back([device.localizedName UTF8String]);
|
||||
|
|
|
@ -752,11 +752,11 @@ void stopLocation() {
|
|||
|
||||
@end
|
||||
|
||||
void OpenDirectory(const char *path) {
|
||||
void System_ShowFileInFolder(const char *path) {
|
||||
// Unsupported
|
||||
}
|
||||
|
||||
void LaunchBrowser(char const* url)
|
||||
void System_LaunchUrl(LaunchUrlType urlType, char const* url)
|
||||
{
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithCString:url encoding:NSStringEncodingConversionAllowLossy]]];
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ BOOL SupportsTaptic() {
|
|||
return [val intValue] >= 2;
|
||||
}
|
||||
|
||||
void Vibrate(int mode) {
|
||||
void System_Vibrate(int mode) {
|
||||
if (SupportsTaptic()) {
|
||||
PPSSPPUIApplication* app = (PPSSPPUIApplication*)[UIApplication sharedApplication];
|
||||
if(app.feedbackGenerator == nil)
|
||||
|
|
|
@ -400,7 +400,6 @@ class LibretroHost : public Host
|
|||
AudioBufferWrite(audio, samples);
|
||||
}
|
||||
void ShutdownSound() override {}
|
||||
bool IsDebuggingEnabled() override { return false; }
|
||||
bool AttemptLoadSymbolMap() override { return false; }
|
||||
};
|
||||
|
||||
|
@ -1881,9 +1880,9 @@ void NativeResized() {}
|
|||
void System_Toast(const char *str) {}
|
||||
|
||||
#if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(IOS)
|
||||
std::vector<std::string> __cameraGetDeviceList() { return std::vector<std::string>(); }
|
||||
bool audioRecording_Available() { return false; }
|
||||
bool audioRecording_State() { return false; }
|
||||
std::vector<std::string> System_GetCameraDeviceList() { return std::vector<std::string>(); }
|
||||
bool System_AudioRecordingIsAvailable() { return false; }
|
||||
bool System_AudioRecordingState() { return false; }
|
||||
|
||||
void System_InputBoxGetString(const std::string &title, const std::string &defaultValue, std::function<void(bool, const std::string &)> cb) { cb(false, ""); }
|
||||
#endif
|
||||
|
|
|
@ -97,8 +97,8 @@ jclass findClass(const char *name) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
bool audioRecording_Available() { return false; }
|
||||
bool audioRecording_State() { return false; }
|
||||
bool System_AudioRecordingIsAvailable() { return false; }
|
||||
bool System_AudioRecordingState() { return false; }
|
||||
#endif
|
||||
|
||||
#ifndef M_PI_2
|
||||
|
|
Loading…
Add table
Reference in a new issue