process_com.cpp

main 79 lines · 2 KB Raw
Alex Alex Commit Map Editor 18/10/2026 23:40
1//////////////////////////////////////////////////////////////////////
2// This file is part of Remere's Map Editor
3//////////////////////////////////////////////////////////////////////
4// Remere's Map Editor is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Remere's Map Editor is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//////////////////////////////////////////////////////////////////////
17
18#include "main.h"
19
20#ifdef _USE_PROCESS_COM
21
22 #include "gui.h"
23 #include "process_com.h"
24
25// Server
26
27RMEProcessServer::RMEProcessServer() {
28 ////
29}
30
31RMEProcessServer::~RMEProcessServer() {
32 ////
33}
34
35wxConnectionBase* RMEProcessServer::OnAcceptConnection(const wxString& topic) {
36 if (topic.Lower() == "rme_talk") {
37 g_gui.root->Iconize(false); // Show application if minimized
38 g_gui.root->Raise(); // Request the window manager to raise this application to the top of Z-order
39 return newd RMEProcessConnection();
40 }
41 return nullptr;
42}
43
44// Client
45
46RMEProcessClient::RMEProcessClient() :
47 proc(nullptr) {
48 ////
49}
50
51RMEProcessClient::~RMEProcessClient() {
52 delete proc;
53}
54
55wxConnectionBase* RMEProcessClient::OnMakeConnection() {
56 return proc = newd RMEProcessConnection();
57}
58
59// Connection
60
61RMEProcessConnection::RMEProcessConnection() :
62 wxConnection() {
63 ////
64}
65
66RMEProcessConnection::~RMEProcessConnection() {
67 ////
68}
69
70bool RMEProcessConnection::OnExec(const wxString& topic, const wxString& fileName) {
71 if (topic.Lower() == "rme_talk" && fileName != wxEmptyString) {
72 g_gui.LoadMap(FileName(fileName));
73 return true;
74 }
75 return false;
76}
77
78#endif
79
Top