@lynx-js/lynx-library-headers 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/include/capi/lynx_env_capi.h +2 -0
- package/include/capi/lynx_group_capi.h +5 -0
- package/include/capi/lynx_view_capi.h +10 -0
- package/include/lynx/platform/embedder/public/capi/lynx_env_capi.h +2 -0
- package/include/lynx/platform/embedder/public/capi/lynx_group_capi.h +5 -0
- package/include/lynx/platform/embedder/public/capi/lynx_view_capi.h +10 -0
- package/include/lynx/platform/embedder/public/lynx_env.h +5 -0
- package/include/lynx/platform/embedder/public/lynx_group.h +8 -0
- package/include/lynx/platform/embedder/public/lynx_view.h +18 -0
- package/include/lynx_env.h +5 -0
- package/include/lynx_group.h +8 -0
- package/include/lynx_view.h +18 -0
- package/package.json +2 -2
|
@@ -27,6 +27,8 @@ LYNX_CAPI_EXPORT void lynx_env_set_devtool_app_info(const char* name,
|
|
|
27
27
|
const char* value);
|
|
28
28
|
LYNX_CAPI_EXPORT void lynx_env_enable_devtool(int enable);
|
|
29
29
|
LYNX_CAPI_EXPORT int lynx_env_is_devtool_enabled();
|
|
30
|
+
// Returns the local DebugRouter TCP port, or -1 before the listener is ready.
|
|
31
|
+
LYNX_CAPI_EXPORT int lynx_env_get_devtool_local_port();
|
|
30
32
|
LYNX_CAPI_EXPORT int lynx_env_connect_devtool(const char* url);
|
|
31
33
|
LYNX_CAPI_EXPORT void lynx_env_set_open_card_callback(
|
|
32
34
|
lynx_env_open_card_callback callback, void* user_data);
|
|
@@ -34,6 +34,11 @@ LYNX_CAPI_EXPORT void lynx_group_set_preload_js_paths(lynx_group_t*,
|
|
|
34
34
|
LYNX_CAPI_EXPORT void lynx_group_set_enable_js_group_thread(lynx_group_t*,
|
|
35
35
|
int enable);
|
|
36
36
|
|
|
37
|
+
// Enables or disables the shared white board for a lynx group. When enabled,
|
|
38
|
+
// Lynx views in the same group share one white board instance.
|
|
39
|
+
LYNX_CAPI_EXPORT void lynx_group_set_enable_white_board(lynx_group_t*,
|
|
40
|
+
int enable);
|
|
41
|
+
|
|
37
42
|
// Release the lynx group.
|
|
38
43
|
LYNX_CAPI_EXPORT void lynx_group_release(lynx_group_t*);
|
|
39
44
|
|
|
@@ -20,11 +20,21 @@ LYNX_EXTERN_C_BEGIN
|
|
|
20
20
|
// when it is no longer needed.
|
|
21
21
|
typedef struct lynx_view_t lynx_view_t;
|
|
22
22
|
|
|
23
|
+
typedef struct lynx_devtool_target_t {
|
|
24
|
+
int32_t session_id;
|
|
25
|
+
// Owned by the LynxView and valid until the next target query or release.
|
|
26
|
+
const char* url;
|
|
27
|
+
} lynx_devtool_target_t;
|
|
28
|
+
|
|
23
29
|
// Create lynx view with builder.
|
|
24
30
|
LYNX_CAPI_EXPORT lynx_view_t* lynx_view_create(lynx_view_builder_t* builder,
|
|
25
31
|
void* user_data);
|
|
26
32
|
LYNX_CAPI_EXPORT void* lynx_view_get_user_data(lynx_view_t*);
|
|
27
33
|
|
|
34
|
+
// Returns false until this LynxView is attached to the DebugRouter.
|
|
35
|
+
LYNX_CAPI_EXPORT bool lynx_view_get_devtool_target(
|
|
36
|
+
lynx_view_t*, lynx_devtool_target_t* target);
|
|
37
|
+
|
|
28
38
|
// Get the fixed WebView2 runtime path configured by the builder. Returns an
|
|
29
39
|
// empty string if no fixed runtime path was configured.
|
|
30
40
|
LYNX_CAPI_EXPORT const char* lynx_view_get_webview2_fixed_runtime_path(
|
|
@@ -27,6 +27,8 @@ LYNX_CAPI_EXPORT void lynx_env_set_devtool_app_info(const char* name,
|
|
|
27
27
|
const char* value);
|
|
28
28
|
LYNX_CAPI_EXPORT void lynx_env_enable_devtool(int enable);
|
|
29
29
|
LYNX_CAPI_EXPORT int lynx_env_is_devtool_enabled();
|
|
30
|
+
// Returns the local DebugRouter TCP port, or -1 before the listener is ready.
|
|
31
|
+
LYNX_CAPI_EXPORT int lynx_env_get_devtool_local_port();
|
|
30
32
|
LYNX_CAPI_EXPORT int lynx_env_connect_devtool(const char* url);
|
|
31
33
|
LYNX_CAPI_EXPORT void lynx_env_set_open_card_callback(
|
|
32
34
|
lynx_env_open_card_callback callback, void* user_data);
|
|
@@ -34,6 +34,11 @@ LYNX_CAPI_EXPORT void lynx_group_set_preload_js_paths(lynx_group_t*,
|
|
|
34
34
|
LYNX_CAPI_EXPORT void lynx_group_set_enable_js_group_thread(lynx_group_t*,
|
|
35
35
|
int enable);
|
|
36
36
|
|
|
37
|
+
// Enables or disables the shared white board for a lynx group. When enabled,
|
|
38
|
+
// Lynx views in the same group share one white board instance.
|
|
39
|
+
LYNX_CAPI_EXPORT void lynx_group_set_enable_white_board(lynx_group_t*,
|
|
40
|
+
int enable);
|
|
41
|
+
|
|
37
42
|
// Release the lynx group.
|
|
38
43
|
LYNX_CAPI_EXPORT void lynx_group_release(lynx_group_t*);
|
|
39
44
|
|
|
@@ -20,11 +20,21 @@ LYNX_EXTERN_C_BEGIN
|
|
|
20
20
|
// when it is no longer needed.
|
|
21
21
|
typedef struct lynx_view_t lynx_view_t;
|
|
22
22
|
|
|
23
|
+
typedef struct lynx_devtool_target_t {
|
|
24
|
+
int32_t session_id;
|
|
25
|
+
// Owned by the LynxView and valid until the next target query or release.
|
|
26
|
+
const char* url;
|
|
27
|
+
} lynx_devtool_target_t;
|
|
28
|
+
|
|
23
29
|
// Create lynx view with builder.
|
|
24
30
|
LYNX_CAPI_EXPORT lynx_view_t* lynx_view_create(lynx_view_builder_t* builder,
|
|
25
31
|
void* user_data);
|
|
26
32
|
LYNX_CAPI_EXPORT void* lynx_view_get_user_data(lynx_view_t*);
|
|
27
33
|
|
|
34
|
+
// Returns false until this LynxView is attached to the DebugRouter.
|
|
35
|
+
LYNX_CAPI_EXPORT bool lynx_view_get_devtool_target(
|
|
36
|
+
lynx_view_t*, lynx_devtool_target_t* target);
|
|
37
|
+
|
|
28
38
|
// Get the fixed WebView2 runtime path configured by the builder. Returns an
|
|
29
39
|
// empty string if no fixed runtime path was configured.
|
|
30
40
|
LYNX_CAPI_EXPORT const char* lynx_view_get_webview2_fixed_runtime_path(
|
|
@@ -23,6 +23,7 @@ class LynxEnv {
|
|
|
23
23
|
void SetDevtoolAppInfo(const char* name, const char* value);
|
|
24
24
|
void SetDevtoolEnabled(bool enable);
|
|
25
25
|
bool IsDevtoolEnabled();
|
|
26
|
+
int GetDevtoolLocalPort();
|
|
26
27
|
bool ConnectDevtool(const char* url);
|
|
27
28
|
void SetOpenCardCallback(lynx_env_open_card_callback callback,
|
|
28
29
|
void* user_data);
|
|
@@ -71,6 +72,10 @@ inline bool LynxEnv::IsDevtoolEnabled() {
|
|
|
71
72
|
return lynx_env_is_devtool_enabled();
|
|
72
73
|
}
|
|
73
74
|
|
|
75
|
+
inline int LynxEnv::GetDevtoolLocalPort() {
|
|
76
|
+
return lynx_env_get_devtool_local_port();
|
|
77
|
+
}
|
|
78
|
+
|
|
74
79
|
inline bool LynxEnv::ConnectDevtool(const char* url) {
|
|
75
80
|
return lynx_env_connect_devtool(url);
|
|
76
81
|
}
|
|
@@ -36,11 +36,18 @@ class LynxGroup {
|
|
|
36
36
|
|
|
37
37
|
bool EnableJSGroupThread() const { return enable_js_group_thread_; }
|
|
38
38
|
|
|
39
|
+
bool EnableWhiteBoard() const { return enable_white_board_; }
|
|
40
|
+
|
|
39
41
|
void SetEnableJSGroupThread(bool enable) {
|
|
40
42
|
enable_js_group_thread_ = enable;
|
|
41
43
|
lynx_group_set_enable_js_group_thread(group_, enable);
|
|
42
44
|
}
|
|
43
45
|
|
|
46
|
+
void SetEnableWhiteBoard(bool enable) {
|
|
47
|
+
enable_white_board_ = enable;
|
|
48
|
+
lynx_group_set_enable_white_board(group_, enable);
|
|
49
|
+
}
|
|
50
|
+
|
|
44
51
|
void SetPreloadJSPaths(std::vector<std::string> paths) {
|
|
45
52
|
preload_js_paths_ = std::move(paths);
|
|
46
53
|
std::vector<const char*> c_paths(preload_js_paths_.size());
|
|
@@ -62,6 +69,7 @@ class LynxGroup {
|
|
|
62
69
|
std::string id_;
|
|
63
70
|
std::vector<std::string> preload_js_paths_;
|
|
64
71
|
bool enable_js_group_thread_ = false;
|
|
72
|
+
bool enable_white_board_ = false;
|
|
65
73
|
};
|
|
66
74
|
|
|
67
75
|
} // namespace pub
|
|
@@ -29,6 +29,11 @@ struct lynx_view_t;
|
|
|
29
29
|
namespace lynx {
|
|
30
30
|
namespace pub {
|
|
31
31
|
|
|
32
|
+
struct LynxDevtoolTarget {
|
|
33
|
+
int32_t session_id;
|
|
34
|
+
std::string url;
|
|
35
|
+
};
|
|
36
|
+
|
|
32
37
|
/**
|
|
33
38
|
* @apidoc
|
|
34
39
|
* @brief LynxView is the main entry point for rendering and interacting with
|
|
@@ -344,6 +349,19 @@ class LynxView {
|
|
|
344
349
|
}
|
|
345
350
|
}
|
|
346
351
|
|
|
352
|
+
bool GetDevtoolTarget(LynxDevtoolTarget* target) {
|
|
353
|
+
if (!target) {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
lynx_devtool_target_t native_target{};
|
|
357
|
+
if (!lynx_view_get_devtool_target(lynx_view_, &native_target)) {
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
target->session_id = native_target.session_id;
|
|
361
|
+
target->url = native_target.url ? native_target.url : "";
|
|
362
|
+
return true;
|
|
363
|
+
}
|
|
364
|
+
|
|
347
365
|
lynx_view_t* Impl() { return lynx_view_; }
|
|
348
366
|
|
|
349
367
|
LynxView(const LynxView&) = delete;
|
package/include/lynx_env.h
CHANGED
|
@@ -23,6 +23,7 @@ class LynxEnv {
|
|
|
23
23
|
void SetDevtoolAppInfo(const char* name, const char* value);
|
|
24
24
|
void SetDevtoolEnabled(bool enable);
|
|
25
25
|
bool IsDevtoolEnabled();
|
|
26
|
+
int GetDevtoolLocalPort();
|
|
26
27
|
bool ConnectDevtool(const char* url);
|
|
27
28
|
void SetOpenCardCallback(lynx_env_open_card_callback callback,
|
|
28
29
|
void* user_data);
|
|
@@ -71,6 +72,10 @@ inline bool LynxEnv::IsDevtoolEnabled() {
|
|
|
71
72
|
return lynx_env_is_devtool_enabled();
|
|
72
73
|
}
|
|
73
74
|
|
|
75
|
+
inline int LynxEnv::GetDevtoolLocalPort() {
|
|
76
|
+
return lynx_env_get_devtool_local_port();
|
|
77
|
+
}
|
|
78
|
+
|
|
74
79
|
inline bool LynxEnv::ConnectDevtool(const char* url) {
|
|
75
80
|
return lynx_env_connect_devtool(url);
|
|
76
81
|
}
|
package/include/lynx_group.h
CHANGED
|
@@ -36,11 +36,18 @@ class LynxGroup {
|
|
|
36
36
|
|
|
37
37
|
bool EnableJSGroupThread() const { return enable_js_group_thread_; }
|
|
38
38
|
|
|
39
|
+
bool EnableWhiteBoard() const { return enable_white_board_; }
|
|
40
|
+
|
|
39
41
|
void SetEnableJSGroupThread(bool enable) {
|
|
40
42
|
enable_js_group_thread_ = enable;
|
|
41
43
|
lynx_group_set_enable_js_group_thread(group_, enable);
|
|
42
44
|
}
|
|
43
45
|
|
|
46
|
+
void SetEnableWhiteBoard(bool enable) {
|
|
47
|
+
enable_white_board_ = enable;
|
|
48
|
+
lynx_group_set_enable_white_board(group_, enable);
|
|
49
|
+
}
|
|
50
|
+
|
|
44
51
|
void SetPreloadJSPaths(std::vector<std::string> paths) {
|
|
45
52
|
preload_js_paths_ = std::move(paths);
|
|
46
53
|
std::vector<const char*> c_paths(preload_js_paths_.size());
|
|
@@ -62,6 +69,7 @@ class LynxGroup {
|
|
|
62
69
|
std::string id_;
|
|
63
70
|
std::vector<std::string> preload_js_paths_;
|
|
64
71
|
bool enable_js_group_thread_ = false;
|
|
72
|
+
bool enable_white_board_ = false;
|
|
65
73
|
};
|
|
66
74
|
|
|
67
75
|
} // namespace pub
|
package/include/lynx_view.h
CHANGED
|
@@ -29,6 +29,11 @@ struct lynx_view_t;
|
|
|
29
29
|
namespace lynx {
|
|
30
30
|
namespace pub {
|
|
31
31
|
|
|
32
|
+
struct LynxDevtoolTarget {
|
|
33
|
+
int32_t session_id;
|
|
34
|
+
std::string url;
|
|
35
|
+
};
|
|
36
|
+
|
|
32
37
|
/**
|
|
33
38
|
* @apidoc
|
|
34
39
|
* @brief LynxView is the main entry point for rendering and interacting with
|
|
@@ -344,6 +349,19 @@ class LynxView {
|
|
|
344
349
|
}
|
|
345
350
|
}
|
|
346
351
|
|
|
352
|
+
bool GetDevtoolTarget(LynxDevtoolTarget* target) {
|
|
353
|
+
if (!target) {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
lynx_devtool_target_t native_target{};
|
|
357
|
+
if (!lynx_view_get_devtool_target(lynx_view_, &native_target)) {
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
target->session_id = native_target.session_id;
|
|
361
|
+
target->url = native_target.url ? native_target.url : "";
|
|
362
|
+
return true;
|
|
363
|
+
}
|
|
364
|
+
|
|
347
365
|
lynx_view_t* Impl() { return lynx_view_; }
|
|
348
366
|
|
|
349
367
|
LynxView(const LynxView&) = delete;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/lynx-library-headers",
|
|
3
3
|
"author": "Lynxtron Authors",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Lynx embedder C/C++ API and weak N-API headers for native libraries",
|
|
7
7
|
"repository": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"README.md"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@lynx-js/lynxtron": "0.0.
|
|
28
|
+
"@lynx-js/lynxtron": "0.0.6"
|
|
29
29
|
},
|
|
30
30
|
"engines": {
|
|
31
31
|
"node": ">=18"
|