Another one bites the dust (SendUIMessage)

This commit is contained in:
Henrik Rydgård 2023-03-24 21:39:02 +01:00
parent 56c26eef4d
commit adccc480a0
9 changed files with 11 additions and 14 deletions

View file

@ -130,3 +130,4 @@ inline void System_SetWindowTitle(const std::string &param) {
// Non-inline to avoid including Path.h
void System_CreateGameShortcut(const Path &path, const std::string &title);

View file

@ -200,6 +200,9 @@ 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.
void System_PostUIMessage(const std::string &message, const std::string &param);
// For these functions, most platforms will use the implementation provided in UI/AudioCommon.cpp,
// no need to implement separately.
void System_AudioGetDebugStats(char *buf, size_t bufSize);

View file

@ -31,7 +31,6 @@ public:
virtual void ToggleDebugConsoleVisibility() {}
virtual void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) {}
virtual void SendUIMessage(const std::string &message, const std::string &value) {}
virtual void SendDebugOutput(const std::string &output) {}
virtual void SendDebugScreenshot(const u8 *pixbuf, u32 w, u32 h) {}

View file

@ -307,7 +307,7 @@ bool Load_PSP_ISO(FileLoader *fileLoader, std::string *error_string) {
//in case we didn't go through EmuScreen::boot
g_Config.loadGameConfig(id, g_paramSFO.GetValueString("TITLE"));
host->SendUIMessage("config_loaded", "");
System_PostUIMessage("config_loaded", "");
INFO_LOG(LOADER, "Loading %s...", bootpath.c_str());
PSPLoaders_Shutdown();

View file

@ -41,10 +41,6 @@ public:
osm.Show(message, duration, color, -1, true, id);
}
void SendUIMessage(const std::string &message, const std::string &value) override {
NativeMessageReceived(message.c_str(), value.c_str());
}
private:
Path SymbolMapFilename(Path currentFilename);
MainWindow* mainWindow;

View file

@ -23,15 +23,7 @@
class NativeHost : public Host {
public:
NativeHost() {}
void UpdateSound() override {}
void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override {
osm.Show(message, duration, color, -1, true, id);
}
void SendUIMessage(const std::string &message, const std::string &value) override {
NativeMessageReceived(message.c_str(), value.c_str());
}
};

View file

@ -1354,6 +1354,10 @@ 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");

View file

@ -115,6 +115,7 @@ bool System_GetPropertyBool(SystemProperty prop) {
}
}
void System_Notify(SystemNotification notification) {}
void System_PostUIMessage(const std::string &message, const std::string &param) {}
bool System_MakeRequest(SystemRequestType type, int requestId, const std::string &param1, const std::string &param2, int param3) { return false; }
void System_InputBoxGetString(const std::string &title, const std::string &defaultValue, std::function<void(bool, const std::string &)> cb) { cb(false, ""); }
void System_AskForPermission(SystemPermission permission) {}

View file

@ -88,6 +88,7 @@ bool System_GetPropertyBool(SystemProperty prop) {
}
}
void System_Notify(SystemNotification notification) {}
void System_PostUIMessage(const std::string &message, const std::string &param) {}
void System_AudioGetDebugStats(char *buf, size_t bufSize) { if (buf) buf[0] = '\0'; }
void System_AudioClear() {}
void System_AudioPushSamples(const s32 *audio, int numSamples) {}