Skip to content

Commit

Permalink
Some fixes for emscripten
Browse files Browse the repository at this point in the history
  • Loading branch information
mls-m5 committed Sep 16, 2024
1 parent 198cb9c commit a9f11cd
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/files/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ std::filesystem::path standardConsoleTtyPipePath() {
return standardLocalFifoDirectory() / "console-tty-in";
}

std::filesystem::__cxx11::path standardErrorTtyPipePath() {
std::filesystem::path standardErrorTtyPipePath() {
return standardLocalFifoDirectory() / "error-tty-in";
}
6 changes: 3 additions & 3 deletions src/linux/inotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ std::unique_ptr<DirectoryNotifications> createDirectoryNotifications(

#else

inline std::unique_ptr<DirectorynDirectoryNotifications>
createDirectoryNotifications(IJobQueue &guiQueue) {
return {}
inline std::unique_ptr<DirectoryNotifications> createDirectoryNotifications(
IJobQueue &guiQueue) {
return {};
}

#endif
5 changes: 5 additions & 0 deletions src/remote_screen.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

#ifndef __EMSCRIPTEN__

#include "remote/fifoconnection.cpp"
#include "remote/tcpconnection.cpp"
#include "remote/tcpserver.cpp"
#include "screen/deserializescreen.cpp"
#include "screen/serializescreen.cpp"
#include "thinmain.cpp"

#endif
28 changes: 14 additions & 14 deletions src/screen/htmlscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ struct CellContent {
EMSCRIPTEN_KEEPALIVE
extern "C" void keyCallback(int type, char c1, char c2, char c3, char c4) {
auto str = std::string{c1, c2, c3, c4};
auto c = Utf8Char{str.data(), str.size()};
std::cout << c.toString() << std::endl;
// auto c = Utf8Char{str.data(), str.size()};
// std::cout << c.toString() << std::endl;

if (staticPointer) {
if (type == 1) {
Expand Down Expand Up @@ -158,21 +158,21 @@ void HtmlScreen::cursor(size_t x, size_t y) {
moveCursor(x, y);
}

size_t HtmlScreen::x() const {
return 0;
}
// size_t HtmlScreen::x() const {
// return 0;
// }

size_t HtmlScreen::y() const {
return 0;
}
// size_t HtmlScreen::y() const {
// return 0;
// }

size_t HtmlScreen::width() const {
return _grid->width;
}
// size_t HtmlScreen::width() const {
// return _grid->width;
// }

size_t HtmlScreen::height() const {
return _grid->height;
}
// size_t HtmlScreen::height() const {
// return _grid->height;
// }

void HtmlScreen::title(std::string title) {}

Expand Down
19 changes: 9 additions & 10 deletions src/screen/htmlscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

#ifdef __EMSCRIPTEN__

#include "screen/iinput.h"
#include "screen/iscreen.h"
#include "syntax/palette.h"
#include <memory>
#include <queue>

class HtmlScreen : public IScreen, public IInput {
class HtmlScreen : public IScreen {
public:
HtmlScreen();
~HtmlScreen();
Expand All @@ -22,14 +21,14 @@ class HtmlScreen : public IScreen, public IInput {
// @see IScreen
void cursor(size_t x, size_t y) override;
// @see IScreen
size_t x() const override;
// @see IScreen
size_t y() const override;
// @see IScreen
size_t width() const override;
// @see IScreen
size_t height() const override;
// @see IScreen
// size_t x() const override;
// // @see IScreen
// size_t y() const override;
// // @see IScreen
// size_t width() const override;
// // @see IScreen
// size_t height() const override;
// // @see IScreen
void title(std::string title) override;
// @see IScreen
void palette(const Palette &) override;
Expand Down
13 changes: 0 additions & 13 deletions src/script/browsefileinteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@ void internalBeginFileViewInteraction(std::shared_ptr<IEnvironment> env,
void handleFileViewResponse(std::shared_ptr<IEnvironment> env,
const Interaction &i) {

// auto lineAt = [&](size_t targetNum) {
// auto ss = std::istringstream{i.text};
// auto lineNum = std::size_t{};
// auto result = std::string{};
// for (std::string line; std::getline(ss, line); ++lineNum) {
// if (lineNum == targetNum) {
// result = line;
// break;
// }
// }
// return result;
// };

if (i.text.empty()) {
return;
}
Expand Down

0 comments on commit a9f11cd

Please sign in to comment.