Skip to content
This repository was archived by the owner on Aug 9, 2021. It is now read-only.

Commit 1e06fcd

Browse files
committed
expose only necessary api
1 parent d304ab6 commit 1e06fcd

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,13 @@ The NodeGui core addon uses the following api exposed by qode binary to inject Q
135135
https://github.com/nodegui/node/blob/43e31129fc27f738b171dca3d744a0e4245dcc6d/src/qode_shared.h#L12
136136

137137
```c++
138+
#pragma once
139+
// From Qode headers
138140
namespace qode {
139141
extern int qode_argc;
140142
extern char **qode_argv;
141-
typedef bool (*QodeInjectedRunLoopFunc)();
142-
extern QodeInjectedRunLoopFunc qode_run_uv_loop_once;
143-
extern QodeInjectedRunLoopFunc qode_run_gui_loop;
144-
extern void InjectQodeRunLoop(QodeInjectedRunLoopFunc runLoop);
145-
extern void InjectQodeRunUvLoopOnce(QodeInjectedRunLoopFunc runUvLoopOnce);
143+
typedef int (*QodeCustomRunLoopFunc)();
144+
extern void InjectCustomRunLoop(QodeCustomRunLoopFunc customRunLoop);
146145
} // namespace qode
147146
```
148147

node

Submodule node updated from c542bce to f207c80

src/qode.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ bool InitWrapper(node::Environment *env) {
5353
return true;
5454
}
5555

56-
bool RunUvLoopOnceWrapper() {
56+
bool QodeRunLoop(){
5757
qodeNodeIntegration->UvRunOnce();
58-
return false;
58+
if(qode::custom_run_loop) {
59+
qode::custom_run_loop();
60+
}
61+
return true;
5962
}
6063

6164
int Start(int argc, char *argv[]) {
@@ -74,8 +77,7 @@ int Start(int argc, char *argv[]) {
7477
}
7578
// Set run loop and init function on node.
7679
qode::InjectQodeInit(&InitWrapper);
77-
qode::InjectQodeRunUvLoopOnce(&RunUvLoopOnceWrapper);
78-
// qode::InjectQodeRunLoop(&RunUvLoopOnceWrapper);
80+
qode::InjectQodeRunLoop(&QodeRunLoop);
7981

8082
// Always enable GC this app is almost always running on desktop.
8183
std::string qodeFlags = "--expose_gc";

0 commit comments

Comments
 (0)