mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Switch all NativeMessageReceived to System_PostUIMessage
This commit is contained in:
@@ -20,9 +20,6 @@ class GraphicsContext;
|
||||
// This might get called multiple times in some implementations, you must be able to handle that.
|
||||
void NativeGetAppInfo(std::string *app_dir_name, std::string *app_nice_name, bool *landscape, std::string *version);
|
||||
|
||||
// Generic host->C++ messaging, used for functionality like system-native popup input boxes.
|
||||
void NativeMessageReceived(const char *message, const char *value);
|
||||
|
||||
// Easy way for the Java side to ask the C++ side for configuration options, such as
|
||||
// the rotation lock which must be controlled from Java on Android.
|
||||
// It is currently not called on non-Android platforms.
|
||||
|
||||
@@ -211,7 +211,7 @@ std::vector<std::string> System_GetCameraDeviceList();
|
||||
bool System_AudioRecordingIsAvailable();
|
||||
bool System_AudioRecordingState();
|
||||
|
||||
// This will be changed to take an enum. Currently simply implemented by forwarding to NativeMessageReceived.
|
||||
// This will be changed to take an enum. Replacement for the old NativeMessageReceived.
|
||||
void System_PostUIMessage(const std::string &message, const std::string ¶m);
|
||||
|
||||
// For these functions, most platforms will use the implementation provided in UI/AudioCommon.cpp,
|
||||
|
||||
+1
-1
@@ -537,7 +537,7 @@ QString MainUI::InputBoxGetQString(QString title, QString defaultValue) {
|
||||
|
||||
void MainUI::resizeGL(int w, int h) {
|
||||
if (UpdateScreenScale(w, h)) {
|
||||
NativeMessageReceived("gpu_displayResized", "");
|
||||
System_PostUIMessage("gpu_displayResized", "");
|
||||
}
|
||||
xscale = w / this->width();
|
||||
yscale = h / this->height();
|
||||
|
||||
+6
-6
@@ -130,7 +130,7 @@ void MainWindow::loadAct()
|
||||
{
|
||||
QFileInfo info(filename);
|
||||
g_Config.currentDirectory = Path(info.absolutePath().toStdString());
|
||||
NativeMessageReceived("boot", filename.toStdString().c_str());
|
||||
System_PostUIMessage("boot", filename.toStdString().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ void MainWindow::closeAct()
|
||||
{
|
||||
updateMenus();
|
||||
|
||||
NativeMessageReceived("stop", "");
|
||||
System_PostUIMessage("stop", "");
|
||||
SetGameTitle("");
|
||||
}
|
||||
|
||||
@@ -232,25 +232,25 @@ void MainWindow::exitAct()
|
||||
|
||||
void MainWindow::runAct()
|
||||
{
|
||||
NativeMessageReceived("run", "");
|
||||
System_PostUIMessage("run", "");
|
||||
}
|
||||
|
||||
void MainWindow::pauseAct()
|
||||
{
|
||||
NativeMessageReceived("pause", "");
|
||||
System_PostUIMessage("pause", "");
|
||||
}
|
||||
|
||||
void MainWindow::stopAct()
|
||||
{
|
||||
Core_Stop();
|
||||
NativeMessageReceived("stop", "");
|
||||
System_PostUIMessage("stop", "");
|
||||
}
|
||||
|
||||
void MainWindow::resetAct()
|
||||
{
|
||||
updateMenus();
|
||||
|
||||
NativeMessageReceived("reset", "");
|
||||
System_PostUIMessage("reset", "");
|
||||
}
|
||||
|
||||
void MainWindow::switchUMDAct()
|
||||
|
||||
+14
-14
@@ -113,20 +113,20 @@ private slots:
|
||||
void consoleAct();
|
||||
|
||||
// Game settings
|
||||
void languageAct() { NativeMessageReceived("language screen", ""); }
|
||||
void controlMappingAct() { NativeMessageReceived("control mapping", ""); }
|
||||
void displayLayoutEditorAct() { NativeMessageReceived("display layout editor", ""); }
|
||||
void moreSettingsAct() { NativeMessageReceived("settings", ""); }
|
||||
void languageAct() { System_PostUIMessage("language screen", ""); }
|
||||
void controlMappingAct() { System_PostUIMessage("control mapping", ""); }
|
||||
void displayLayoutEditorAct() { System_PostUIMessage("display layout editor", ""); }
|
||||
void moreSettingsAct() { System_PostUIMessage("settings", ""); }
|
||||
|
||||
void bufferRenderAct() {
|
||||
NativeMessageReceived("gpu_renderResized", "");
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_renderResized", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
void linearAct() { g_Config.iTexFiltering = (g_Config.iTexFiltering != 0) ? 0 : 3; }
|
||||
|
||||
void renderingResolutionGroup_triggered(QAction *action) {
|
||||
g_Config.iInternalResolution = action->data().toInt();
|
||||
NativeMessageReceived("gpu_renderResized", "");
|
||||
NativeMessagSystem_PostUIMessageeReceived("gpu_renderResized", "");
|
||||
}
|
||||
void windowGroup_triggered(QAction *action) { SetWindowScale(action->data().toInt()); }
|
||||
|
||||
@@ -134,7 +134,7 @@ private slots:
|
||||
g_Config.bAutoFrameSkip = !g_Config.bAutoFrameSkip;
|
||||
if (g_Config.bSkipBufferEffects) {
|
||||
g_Config.bSkipBufferEffects = false;
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
}
|
||||
void frameSkippingGroup_triggered(QAction *action) { g_Config.iFrameSkip = action->data().toInt(); }
|
||||
@@ -143,19 +143,19 @@ private slots:
|
||||
void screenScalingFilterGroup_triggered(QAction *action) { g_Config.iDisplayFilter = action->data().toInt(); }
|
||||
void textureScalingLevelGroup_triggered(QAction *action) {
|
||||
g_Config.iTexScalingLevel = action->data().toInt();
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
void textureScalingTypeGroup_triggered(QAction *action) {
|
||||
g_Config.iTexScalingType = action->data().toInt();
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
void deposterizeAct() {
|
||||
g_Config.bTexDeposterize = !g_Config.bTexDeposterize;
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
void transformAct() {
|
||||
g_Config.bHardwareTransform = !g_Config.bHardwareTransform;
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
void vertexCacheAct() { g_Config.bVertexCache = !g_Config.bVertexCache; }
|
||||
void frameskipAct() { g_Config.iFrameSkip = !g_Config.iFrameSkip; }
|
||||
@@ -172,7 +172,7 @@ private slots:
|
||||
// Chat
|
||||
void chatAct() {
|
||||
if (GetUIState() == UISTATE_INGAME) {
|
||||
NativeMessageReceived("chat screen", "");
|
||||
System_PostUIMessage("chat screen", "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ private slots:
|
||||
void raiseTopMost();
|
||||
void statsAct() {
|
||||
g_Config.bShowDebugStats = !g_Config.bShowDebugStats;
|
||||
NativeMessageReceived("clear jit", "");
|
||||
System_PostUIMessage("clear jit", "");
|
||||
}
|
||||
|
||||
// Help
|
||||
|
||||
@@ -442,17 +442,17 @@ void OSXOpenURL(const char *url) {
|
||||
}
|
||||
|
||||
-(void)pauseAction: (NSMenuItem *)item {
|
||||
NativeMessageReceived("pause", "");
|
||||
System_PostUIMessage("pause", "");
|
||||
}
|
||||
|
||||
-(void)resetAction: (NSMenuItem *)item {
|
||||
NativeMessageReceived("reset", "");
|
||||
System_PostUIMessage("reset", "");
|
||||
Core_EnableStepping(false);
|
||||
}
|
||||
|
||||
-(void)chatAction: (NSMenuItem *)item {
|
||||
if (GetUIState() == UISTATE_INGAME) {
|
||||
NativeMessageReceived("chat screen", "");
|
||||
System_PostUIMessage("chat screen", "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,7 +541,7 @@ TOGGLE_METHOD(AutoFrameSkip, g_Config.bAutoFrameSkip, g_Config.UpdateAfterSettin
|
||||
TOGGLE_METHOD(SoftwareRendering, g_Config.bSoftwareRendering)
|
||||
TOGGLE_METHOD(FullScreen, g_Config.bFullScreen, System_MakeRequest(SystemRequestType::TOGGLE_FULLSCREEN_STATE, 0, g_Config.UseFullScreen() ? "1" : "0", "", 3))
|
||||
// TOGGLE_METHOD(VSync, g_Config.bVSync)
|
||||
TOGGLE_METHOD(ShowDebugStats, g_Config.bShowDebugStats, NativeMessageReceived("clear jit", ""))
|
||||
TOGGLE_METHOD(ShowDebugStats, g_Config.bShowDebugStats, System_PostUIMessage("clear jit", ""))
|
||||
#undef TOGGLE_METHOD
|
||||
|
||||
-(void)setToggleShowCounterItem: (NSMenuItem *)item {
|
||||
@@ -622,14 +622,14 @@ TOGGLE_METHOD(ShowDebugStats, g_Config.bShowDebugStats, NativeMessageReceived("c
|
||||
}
|
||||
|
||||
-(void)openRecentItem: (NSMenuItem *)item {
|
||||
NativeMessageReceived("boot", g_Config.RecentIsos()[item.tag].c_str());
|
||||
System_PostUIMessage("boot", g_Config.RecentIsos()[item.tag].c_str());
|
||||
}
|
||||
|
||||
-(void)openSystemFileBrowser {
|
||||
int g = 0;
|
||||
DarwinDirectoryPanelCallback callback = [g] (bool succ, Path thePathChosen) {
|
||||
if (succ)
|
||||
NativeMessageReceived("boot", thePathChosen.c_str());
|
||||
System_PostUIMessage("boot", thePathChosen.c_str());
|
||||
};
|
||||
|
||||
DarwinFileSystemServices services;
|
||||
|
||||
@@ -155,9 +155,9 @@ UI::EventReturn DisplayLayoutScreen::OnPostProcShaderChange(UI::EventParams &e)
|
||||
g_Config.vPostShaderNames.erase(std::remove(g_Config.vPostShaderNames.begin(), g_Config.vPostShaderNames.end(), "Off"), g_Config.vPostShaderNames.end());
|
||||
FixPostShaderOrder(&g_Config.vPostShaderNames);
|
||||
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
NativeMessageReceived("gpu_renderResized", ""); // To deal with shaders that can change render resolution like upscaling.
|
||||
NativeMessageReceived("postshader_updated", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_renderResized", ""); // To deal with shaders that can change render resolution like upscaling.
|
||||
System_PostUIMessage("postshader_updated", "");
|
||||
|
||||
if (gpu) {
|
||||
gpu->NotifyConfigChanged();
|
||||
@@ -381,7 +381,7 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
auto removeButton = shaderRow->Add(new Choice(ImageID("I_TRASHCAN"), new LinearLayoutParams(0.0f)));
|
||||
removeButton->OnClick.Add([=](EventParams &e) -> UI::EventReturn {
|
||||
g_Config.vPostShaderNames.erase(g_Config.vPostShaderNames.begin() + i);
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
RecreateViews();
|
||||
return UI::EVENT_DONE;
|
||||
});
|
||||
@@ -409,7 +409,7 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
FixPostShaderOrder(&g_Config.vPostShaderNames);
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
RecreateViews();
|
||||
return UI::EVENT_DONE;
|
||||
});
|
||||
@@ -493,18 +493,18 @@ void PostProcScreen::OnCompleted(DialogResult result) {
|
||||
if (showStereoShaders_) {
|
||||
if (g_Config.sStereoToMonoShader != value) {
|
||||
g_Config.sStereoToMonoShader = value;
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
} else {
|
||||
if (id_ < (int)g_Config.vPostShaderNames.size()) {
|
||||
if (g_Config.vPostShaderNames[id_] != value) {
|
||||
g_Config.vPostShaderNames[id_] = value;
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
}
|
||||
else {
|
||||
g_Config.vPostShaderNames.push_back(value);
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -428,7 +428,7 @@ EmuScreen::~EmuScreen() {
|
||||
void EmuScreen::dialogFinished(const Screen *dialog, DialogResult result) {
|
||||
// TODO: improve the way with which we got commands from PauseMenu.
|
||||
// DR_CANCEL/DR_BACK means clicked on "continue", DR_OK means clicked on "back to menu",
|
||||
// DR_YES means a message sent to PauseMenu by NativeMessageReceived.
|
||||
// DR_YES means a message sent to PauseMenu by System_PostUIMessage.
|
||||
if (result == DR_OK || quit_) {
|
||||
screenManager()->switchScreen(new MainScreen());
|
||||
quit_ = false;
|
||||
@@ -709,13 +709,13 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
case VIRTKEY_PREVIOUS_SLOT:
|
||||
if (down) {
|
||||
SaveState::PrevSlot();
|
||||
NativeMessageReceived("savestate_displayslot", "");
|
||||
System_PostUIMessage("savestate_displayslot", "");
|
||||
}
|
||||
break;
|
||||
case VIRTKEY_NEXT_SLOT:
|
||||
if (down) {
|
||||
SaveState::NextSlot();
|
||||
NativeMessageReceived("savestate_displayslot", "");
|
||||
System_PostUIMessage("savestate_displayslot", "");
|
||||
}
|
||||
break;
|
||||
case VIRTKEY_TOGGLE_FULLSCREEN:
|
||||
@@ -733,7 +733,7 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
g_Config.bSaveNewTextures = !g_Config.bSaveNewTextures;
|
||||
if (g_Config.bSaveNewTextures) {
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("saveNewTextures_true", "Textures will now be saved to your storage"), 2.0);
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
} else {
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("saveNewTextures_false", "Texture saving was disabled"), 2.0);
|
||||
}
|
||||
@@ -746,7 +746,7 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("replaceTextures_true", "Texture replacement enabled"), 2.0);
|
||||
else
|
||||
g_OSD.Show(OSDType::MESSAGE_INFO, sc->T("replaceTextures_false", "Textures no longer are being replaced"), 2.0);
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
break;
|
||||
case VIRTKEY_RAPID_FIRE:
|
||||
@@ -1037,7 +1037,7 @@ UI::EventReturn EmuScreen::OnResume(UI::EventParams ¶ms) {
|
||||
|
||||
UI::EventReturn EmuScreen::OnReset(UI::EventParams ¶ms) {
|
||||
if (coreState == CoreState::CORE_RUNTIME_ERROR) {
|
||||
NativeMessageReceived("reset", "");
|
||||
System_PostUIMessage("reset", "");
|
||||
}
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
|
||||
static const char *msaaModes[] = { "Off", "2x", "4x", "8x", "16x" };
|
||||
auto msaaChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iMultiSampleLevel, gr->T("Antialiasing (MSAA)"), msaaModes, 0, ARRAY_SIZE(msaaModes), I18NCat::GRAPHICS, screenManager()));
|
||||
msaaChoice->OnChoice.Add([&](UI::EventParams &) -> UI::EventReturn {
|
||||
NativeMessageReceived("gpu_renderResized", "");
|
||||
System_PostUIMessage("gpu_renderResized", "");
|
||||
return UI::EVENT_DONE;
|
||||
});
|
||||
msaaChoice->SetDisabledPtr(&g_Config.bSoftwareRendering);
|
||||
@@ -388,7 +388,7 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
|
||||
settingInfo_->Show(gr->T("RenderingMode NonBuffered Tip", "Faster, but graphics may be missing in some games"), e.v);
|
||||
g_Config.bAutoFrameSkip = false;
|
||||
}
|
||||
NativeMessageReceived("gpu_renderResized", "");
|
||||
System_PostUIMessage("gpu_renderResized", "");
|
||||
return UI::EVENT_DONE;
|
||||
});
|
||||
skipBufferEffects->SetDisabledPtr(&g_Config.bSoftwareRendering);
|
||||
@@ -1147,7 +1147,7 @@ UI::EventReturn GameSettingsScreen::OnSustainedPerformanceModeChange(UI::EventPa
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnJitAffectingSetting(UI::EventParams &e) {
|
||||
NativeMessageReceived("clear jit", "");
|
||||
System_PostUIMessage("clear jit", "");
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
@@ -1263,7 +1263,7 @@ UI::EventReturn GameSettingsScreen::OnResolutionChange(UI::EventParams &e) {
|
||||
System_RecreateActivity();
|
||||
}
|
||||
Reporting::UpdateConfig();
|
||||
NativeMessageReceived("gpu_renderResized", "");
|
||||
System_PostUIMessage("gpu_renderResized", "");
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
@@ -1292,7 +1292,7 @@ void GameSettingsScreen::onFinish(DialogResult result) {
|
||||
|
||||
// Wipe some caches after potentially changing settings.
|
||||
// Let's not send resize messages here, handled elsewhere.
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
|
||||
void GameSettingsScreen::dialogFinished(const Screen *dialog, DialogResult result) {
|
||||
@@ -1538,7 +1538,7 @@ UI::EventReturn GameSettingsScreen::OnTextureShader(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn GameSettingsScreen::OnTextureShaderChange(UI::EventParams &e) {
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
RecreateViews(); // Update setting name
|
||||
g_Config.bTexHardwareScaling = g_Config.sTextureShaderName != "Off";
|
||||
return UI::EVENT_DONE;
|
||||
@@ -1727,7 +1727,7 @@ void DeveloperToolsScreen::CreateViews() {
|
||||
|
||||
void DeveloperToolsScreen::onFinish(DialogResult result) {
|
||||
g_Config.Save("DeveloperToolsScreen::onFinish");
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
|
||||
void GameSettingsScreen::CallbackRestoreDefaults(bool yes) {
|
||||
@@ -1808,7 +1808,7 @@ UI::EventReturn DeveloperToolsScreen::OnTouchscreenTest(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn DeveloperToolsScreen::OnJitAffectingSetting(UI::EventParams &e) {
|
||||
NativeMessageReceived("clear jit", "");
|
||||
System_PostUIMessage("clear jit", "");
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1375,7 +1375,7 @@ UI::EventReturn MainScreen::OnLoadFile(UI::EventParams &e) {
|
||||
if (System_GetPropertyBool(SYSPROP_HAS_FILE_BROWSER)) {
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
System_BrowseForFile(mm->T("Load"), BrowseFileType::BOOTABLE, [](const std::string &value, int) {
|
||||
NativeMessageReceived("boot", value.c_str());
|
||||
System_PostUIMessage("boot", value.c_str());
|
||||
});
|
||||
}
|
||||
return UI::EVENT_DONE;
|
||||
|
||||
+1
-1
@@ -435,7 +435,7 @@ void HandleCommonMessages(const char *message, const char *value, ScreenManager
|
||||
auto sy = GetI18NCategory(I18NCat::SYSTEM);
|
||||
auto langScreen = new NewLanguageScreen(sy->T("Language"));
|
||||
langScreen->OnChoice.Add([](UI::EventParams &) {
|
||||
NativeMessageReceived("recreateviews", "");
|
||||
System_PostUIMessage("recreateviews", "");
|
||||
System_Notify(SystemNotification::UI);
|
||||
return UI::EVENT_DONE;
|
||||
});
|
||||
|
||||
+2
-6
@@ -1118,7 +1118,7 @@ void NativeRender(GraphicsContext *graphicsContext) {
|
||||
#if !PPSSPP_PLATFORM(WINDOWS) && !defined(ANDROID)
|
||||
PSP_CoreParameter().pixelWidth = g_display.pixel_xres;
|
||||
PSP_CoreParameter().pixelHeight = g_display.pixel_yres;
|
||||
NativeMessageReceived("gpu_displayResized", "");
|
||||
System_PostUIMessage("gpu_displayResized", "");
|
||||
#endif
|
||||
} else {
|
||||
// INFO_LOG(G3D, "Polling graphics context");
|
||||
@@ -1341,7 +1341,7 @@ void NativeAxis(const AxisInput &axis) {
|
||||
xSensitivity, ySensitivity);
|
||||
}
|
||||
|
||||
void NativeMessageReceived(const char *message, const char *value) {
|
||||
void System_PostUIMessage(const std::string &message, const std::string &value) {
|
||||
std::lock_guard<std::mutex> lock(pendingMutex);
|
||||
PendingMessage pendingMessage;
|
||||
pendingMessage.msg = message;
|
||||
@@ -1349,10 +1349,6 @@ void NativeMessageReceived(const char *message, const char *value) {
|
||||
pendingMessages.push_back(pendingMessage);
|
||||
}
|
||||
|
||||
void System_PostUIMessage(const std::string &message, const std::string &value) {
|
||||
NativeMessageReceived(message.c_str(), value.c_str());
|
||||
}
|
||||
|
||||
void NativeResized() {
|
||||
// NativeResized can come from any thread so we just set a flag, then process it later.
|
||||
VERBOSE_LOG(G3D, "NativeResized - setting flag");
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
NSURL *firstURL = urls.firstObject;
|
||||
if (!firstURL) return; // No URLs, don't do anything
|
||||
|
||||
NativeMessageReceived("boot", firstURL.fileSystemRepresentation);
|
||||
System_PostUIMessage("boot", firstURL.fileSystemRepresentation);
|
||||
}
|
||||
|
||||
- (NSMenu *)applicationDockMenu:(NSApplication *)sender {
|
||||
|
||||
@@ -676,7 +676,7 @@ UI::EventReturn SavedataScreen::OnSearch(UI::EventParams &e) {
|
||||
if (System_GetPropertyBool(SYSPROP_HAS_TEXT_INPUT_DIALOG)) {
|
||||
System_InputBoxGetString(di->T("Filter"), searchFilter_, [](const std::string &value, int ivalue) {
|
||||
if (ivalue) {
|
||||
NativeMessageReceived("savedatascreen_search", value.c_str());
|
||||
System_PostUIMessage("savedatascreen_search", value.c_str());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -88,13 +88,13 @@ void TabbedUIDialogScreenWithGameBackground::CreateViews() {
|
||||
|
||||
searchSettings->Add(new ItemHeader(se->T("Find settings")));
|
||||
searchSettings->Add(new PopupTextInputChoice(&searchFilter_, se->T("Filter"), "", 64, screenManager()))->OnChange.Add([=](UI::EventParams &e) {
|
||||
NativeMessageReceived("gameSettings_search", StripSpaces(searchFilter_).c_str());
|
||||
System_PostUIMessage("gameSettings_search", StripSpaces(searchFilter_).c_str());
|
||||
return UI::EVENT_DONE;
|
||||
});
|
||||
|
||||
clearSearchChoice_ = searchSettings->Add(new Choice(se->T("Clear filter")));
|
||||
clearSearchChoice_->OnClick.Add([=](UI::EventParams &e) {
|
||||
NativeMessageReceived("gameSettings_search", "");
|
||||
System_PostUIMessage("gameSettings_search", "");
|
||||
return UI::EVENT_DONE;
|
||||
});
|
||||
|
||||
|
||||
+1
-1
@@ -267,7 +267,7 @@ void App::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ ar
|
||||
PSP_CoreParameter().pixelWidth = (int)(width * scale);
|
||||
PSP_CoreParameter().pixelHeight = (int)(height * scale);
|
||||
if (UpdateScreenScale((int)width, (int)height)) {
|
||||
NativeMessageReceived("gpu_displayResized", "");
|
||||
System_PostUIMessage("gpu_displayResized", "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace MainWindow
|
||||
g_Config.iInternalResolution = 0;
|
||||
}
|
||||
|
||||
NativeMessageReceived("gpu_renderResized", "");
|
||||
System_PostUIMessage("gpu_renderResized", "");
|
||||
}
|
||||
|
||||
void CorrectCursor() {
|
||||
@@ -282,7 +282,7 @@ namespace MainWindow
|
||||
SavePosition();
|
||||
Core_NotifyWindowHidden(false);
|
||||
if (!g_Config.bPauseWhenMinimized) {
|
||||
NativeMessageReceived("window minimized", "false");
|
||||
System_PostUIMessage("window minimized", "false");
|
||||
}
|
||||
|
||||
int width = 0, height = 0;
|
||||
@@ -305,8 +305,8 @@ namespace MainWindow
|
||||
DEBUG_LOG(SYSTEM, "Pixel width/height: %dx%d", PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight);
|
||||
|
||||
if (UpdateScreenScale(width, height)) {
|
||||
NativeMessageReceived("gpu_displayResized", "");
|
||||
NativeMessageReceived("gpu_renderResized", "");
|
||||
System_PostUIMessage("gpu_displayResized", "");
|
||||
System_PostUIMessage("gpu_renderResized", "");
|
||||
}
|
||||
|
||||
// Don't save the window state if fullscreen.
|
||||
@@ -856,12 +856,12 @@ namespace MainWindow
|
||||
}
|
||||
|
||||
if (wParam == WA_ACTIVE || wParam == WA_CLICKACTIVE) {
|
||||
NativeMessageReceived("got_focus", "");
|
||||
System_PostUIMessage("got_focus", "");
|
||||
hasFocus = true;
|
||||
trapMouse = true;
|
||||
}
|
||||
if (wParam == WA_INACTIVE) {
|
||||
NativeMessageReceived("lost_focus", "");
|
||||
System_PostUIMessage("lost_focus", "");
|
||||
WindowsRawInput::LoseFocus();
|
||||
InputDevice::LoseFocus();
|
||||
hasFocus = false;
|
||||
@@ -908,7 +908,7 @@ namespace MainWindow
|
||||
case SIZE_MINIMIZED:
|
||||
Core_NotifyWindowHidden(true);
|
||||
if (!g_Config.bPauseWhenMinimized) {
|
||||
NativeMessageReceived("window minimized", "true");
|
||||
System_PostUIMessage("window minimized", "true");
|
||||
}
|
||||
InputDevice::LoseFocus();
|
||||
break;
|
||||
@@ -1032,7 +1032,7 @@ namespace MainWindow
|
||||
TCHAR filename[512];
|
||||
if (DragQueryFile(hdrop, 0, filename, 512) != 0) {
|
||||
const std::string utf8_filename = ReplaceAll(ConvertWStringToUTF8(filename), "\\", "/");
|
||||
NativeMessageReceived("boot", utf8_filename.c_str());
|
||||
System_PostUIMessage("boot", utf8_filename.c_str());
|
||||
Core_EnableStepping(false);
|
||||
}
|
||||
}
|
||||
|
||||
+21
-21
@@ -339,7 +339,7 @@ namespace MainWindow {
|
||||
Core_EnableStepping(false);
|
||||
}
|
||||
filename = ReplaceAll(filename, "\\", "/");
|
||||
NativeMessageReceived("boot", filename.c_str());
|
||||
System_PostUIMessage("boot", filename.c_str());
|
||||
W32Util::MakeTopMost(GetHWND(), g_Config.bTopMost);
|
||||
}
|
||||
|
||||
@@ -367,17 +367,17 @@ namespace MainWindow {
|
||||
// not static
|
||||
void setTexScalingMultiplier(int level) {
|
||||
g_Config.iTexScalingLevel = level;
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
|
||||
static void setTexScalingType(int type) {
|
||||
g_Config.iTexScalingType = type;
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
|
||||
static void setSkipBufferEffects(bool skip) {
|
||||
g_Config.bSkipBufferEffects = skip;
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
|
||||
static void setFrameSkipping(int framesToSkip = -1) {
|
||||
@@ -461,7 +461,7 @@ namespace MainWindow {
|
||||
case ID_TOGGLE_BREAK:
|
||||
if (GetUIState() == UISTATE_PAUSEMENU) {
|
||||
// Causes hang
|
||||
//NativeMessageReceived("run", "");
|
||||
//System_PostUIMessage("run", "");
|
||||
|
||||
if (disasmWindow)
|
||||
SendMessage(disasmWindow->GetDlgHandle(), WM_COMMAND, IDC_STOPGO, 0);
|
||||
@@ -480,7 +480,7 @@ namespace MainWindow {
|
||||
break;
|
||||
|
||||
case ID_EMULATION_PAUSE:
|
||||
NativeMessageReceived("pause", "");
|
||||
System_PostUIMessage("pause", "");
|
||||
break;
|
||||
|
||||
case ID_EMULATION_STOP:
|
||||
@@ -488,12 +488,12 @@ namespace MainWindow {
|
||||
Core_EnableStepping(false);
|
||||
|
||||
Core_Stop();
|
||||
NativeMessageReceived("stop", "");
|
||||
System_PostUIMessage("stop", "");
|
||||
Core_WaitInactive();
|
||||
break;
|
||||
|
||||
case ID_EMULATION_RESET:
|
||||
NativeMessageReceived("reset", "");
|
||||
System_PostUIMessage("reset", "");
|
||||
Core_EnableStepping(false);
|
||||
break;
|
||||
|
||||
@@ -513,7 +513,7 @@ namespace MainWindow {
|
||||
|
||||
case ID_EMULATION_CHAT:
|
||||
if (GetUIState() == UISTATE_INGAME) {
|
||||
NativeMessageReceived("chat screen", "");
|
||||
System_PostUIMessage("chat screen", "");
|
||||
}
|
||||
break;
|
||||
case ID_FILE_LOADSTATEFILE:
|
||||
@@ -532,7 +532,7 @@ namespace MainWindow {
|
||||
case ID_FILE_SAVESTATE_NEXT_SLOT:
|
||||
{
|
||||
SaveState::NextSlot();
|
||||
NativeMessageReceived("savestate_displayslot", "");
|
||||
System_PostUIMessage("savestate_displayslot", "");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ namespace MainWindow {
|
||||
{
|
||||
if (!KeyMap::PspButtonHasMappings(VIRTKEY_NEXT_SLOT)) {
|
||||
SaveState::NextSlot();
|
||||
NativeMessageReceived("savestate_displayslot", "");
|
||||
System_PostUIMessage("savestate_displayslot", "");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -586,7 +586,7 @@ namespace MainWindow {
|
||||
}
|
||||
|
||||
case ID_OPTIONS_LANGUAGE:
|
||||
NativeMessageReceived("language screen", "");
|
||||
System_PostUIMessage("language screen", "");
|
||||
break;
|
||||
|
||||
case ID_OPTIONS_IGNOREWINKEY:
|
||||
@@ -631,7 +631,7 @@ namespace MainWindow {
|
||||
g_Config.bAutoFrameSkip = !g_Config.bAutoFrameSkip;
|
||||
if (g_Config.bAutoFrameSkip && g_Config.bSkipBufferEffects) {
|
||||
g_Config.bSkipBufferEffects = false;
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -648,7 +648,7 @@ namespace MainWindow {
|
||||
|
||||
case ID_TEXTURESCALING_DEPOSTERIZE:
|
||||
g_Config.bTexDeposterize = !g_Config.bTexDeposterize;
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
break;
|
||||
|
||||
case ID_OPTIONS_DIRECT3D9:
|
||||
@@ -677,23 +677,23 @@ namespace MainWindow {
|
||||
|
||||
case ID_OPTIONS_SKIP_BUFFER_EFFECTS:
|
||||
g_Config.bSkipBufferEffects = !g_Config.bSkipBufferEffects;
|
||||
NativeMessageReceived("gpu_renderResized", "");
|
||||
System_PostUIMessage("gpu_renderResized", "");
|
||||
g_OSD.ShowOnOff(gr->T("Skip Buffer Effects"), g_Config.bSkipBufferEffects);
|
||||
break;
|
||||
|
||||
case ID_DEBUG_SHOWDEBUGSTATISTICS:
|
||||
g_Config.bShowDebugStats = !g_Config.bShowDebugStats;
|
||||
NativeMessageReceived("clear jit", "");
|
||||
System_PostUIMessage("clear jit", "");
|
||||
break;
|
||||
|
||||
case ID_OPTIONS_HARDWARETRANSFORM:
|
||||
g_Config.bHardwareTransform = !g_Config.bHardwareTransform;
|
||||
NativeMessageReceived("gpu_configChanged", "");
|
||||
System_PostUIMessage("gpu_configChanged", "");
|
||||
g_OSD.ShowOnOff(gr->T("Hardware Transform"), g_Config.bHardwareTransform);
|
||||
break;
|
||||
|
||||
case ID_OPTIONS_DISPLAY_LAYOUT:
|
||||
NativeMessageReceived("display layout editor", "");
|
||||
System_PostUIMessage("display layout editor", "");
|
||||
break;
|
||||
|
||||
|
||||
@@ -724,7 +724,7 @@ namespace MainWindow {
|
||||
break;
|
||||
|
||||
case ID_DEBUG_DUMPNEXTFRAME:
|
||||
NativeMessageReceived("gpu dump next frame", "");
|
||||
System_PostUIMessage("gpu dump next frame", "");
|
||||
break;
|
||||
|
||||
case ID_DEBUG_LOADMAPFILE:
|
||||
@@ -860,11 +860,11 @@ namespace MainWindow {
|
||||
break;
|
||||
|
||||
case ID_OPTIONS_CONTROLS:
|
||||
NativeMessageReceived("control mapping", "");
|
||||
System_PostUIMessage("control mapping", "");
|
||||
break;
|
||||
|
||||
case ID_OPTIONS_MORE_SETTINGS:
|
||||
NativeMessageReceived("settings", "");
|
||||
System_PostUIMessage("settings", "");
|
||||
break;
|
||||
|
||||
case ID_EMULATION_SOUND:
|
||||
|
||||
@@ -860,7 +860,7 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_resume(JNIEnv *, jclass) {
|
||||
INFO_LOG(SYSTEM, "NativeApp.resume() - resuming audio");
|
||||
AndroidAudio_Resume(g_audioState);
|
||||
|
||||
NativeMessageReceived("app_resumed", "");
|
||||
System_PostUIMessage("app_resumed", "");
|
||||
}
|
||||
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_pause(JNIEnv *, jclass) {
|
||||
@@ -973,7 +973,7 @@ extern "C" bool Java_org_ppsspp_ppsspp_NativeRenderer_displayInit(JNIEnv * env,
|
||||
renderer_inited = true;
|
||||
}
|
||||
|
||||
NativeMessageReceived("recreateviews", "");
|
||||
System_PostUIMessage("recreateviews", "");
|
||||
|
||||
if (IsVREnabled()) {
|
||||
EnterVR(firstStart, graphicsContext->GetAPIContext());
|
||||
@@ -1266,7 +1266,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_sendMessageFromJava(JNI
|
||||
} else if (msg == "permission_granted") {
|
||||
INFO_LOG(SYSTEM, "STORAGE PERMISSION: GRANTED");
|
||||
// Send along.
|
||||
NativeMessageReceived(msg.c_str(), prm.c_str());
|
||||
System_PostUIMessage(msg.c_str(), prm.c_str());
|
||||
} else if (msg == "sustained_perf_supported") {
|
||||
sustainedPerfSupported = true;
|
||||
} else if (msg == "safe_insets") {
|
||||
@@ -1285,7 +1285,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_sendMessageFromJava(JNI
|
||||
KeyMap::NotifyPadConnected(nextInputDeviceID, prm);
|
||||
} else if (msg == "core_powerSaving") {
|
||||
// Forward.
|
||||
NativeMessageReceived(msg.c_str(), prm.c_str());
|
||||
System_PostUIMessage(msg.c_str(), prm.c_str());
|
||||
} else {
|
||||
ERROR_LOG(SYSTEM, "Got unexpected message from Java, ignoring: %s / %s", msg.c_str(), prm.c_str());
|
||||
}
|
||||
|
||||
+2
-2
@@ -112,7 +112,7 @@
|
||||
iOSCoreAudioShutdown();
|
||||
}
|
||||
|
||||
NativeMessageReceived("lost_focus", "");
|
||||
System_PostUIMessage("lost_focus", "");
|
||||
}
|
||||
|
||||
-(void) applicationDidBecomeActive:(UIApplication *)application {
|
||||
@@ -120,7 +120,7 @@
|
||||
iOSCoreAudioInit();
|
||||
}
|
||||
|
||||
NativeMessageReceived("got_focus", "");
|
||||
System_PostUIMessage("got_focus", "");
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application {
|
||||
|
||||
Reference in New Issue
Block a user