Skip to content

Commit 9bff3c6

Browse files
committed
added get_exe_path
1 parent 60828a4 commit 9bff3c6

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

include/webframe/context.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ namespace webframe
4646
virtual window* create_window(window *parent, int width = -1, int height = -1);
4747
virtual window* find_window(const std::string& id);
4848
virtual void destroy_window(window* handle);
49+
virtual std::string get_exe_path() const;
4950
};
5051

5152
class server_context

src/context.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,9 @@ namespace webframe
2525
{
2626
(void)signum;
2727
}
28+
29+
std::string desktop_context::get_exe_path() const
30+
{
31+
return {};
32+
}
2833
}

src/runtimes/desktop/context.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,9 @@ namespace webframe::desktop
3737
{
3838
_windows.erase(handle->get_id());
3939
}
40+
41+
std::string context::get_exe_path() const
42+
{
43+
return wxStandardPaths::Get().GetExecutablePath().ToStdString();
44+
}
4045
}

src/runtimes/desktop/include/desktop/context.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace webframe::desktop
1313
webframe::window *create_window(webframe::window *parent, int width, int height) override;
1414
webframe::window *find_window(const std::string &id) override;
1515
void destroy_window(webframe::window *handle) override;
16+
std::string get_exe_path() const override;
1617

1718
private:
1819
int _default_width;

src/runtimes/desktop/include/desktop/wxwidgets.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <wx/wx.h>
77
#include <wx/mstream.h>
88
#include <wx/webview.h>
9+
#include <wx/stdpaths.h>
910
#include <wx/uri.h>
1011

1112
#endif

0 commit comments

Comments
 (0)