sfml.js-imgui 0.0.0-stage → 1.1.0
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/README.ja.md +113 -0
- package/README.ko.md +113 -0
- package/README.md +112 -2
- package/README.zh-CN.md +113 -0
- package/binding.gyp +125 -0
- package/dist/callbacks.d.ts +368 -0
- package/dist/callbacks.js +310 -0
- package/dist/enums/colors.d.ts +779 -0
- package/dist/enums/colors.js +766 -0
- package/dist/enums/drawing.d.ts +286 -0
- package/dist/enums/drawing.js +257 -0
- package/dist/enums/input.d.ts +792 -0
- package/dist/enums/input.js +731 -0
- package/dist/enums/keys.d.ts +1389 -0
- package/dist/enums/keys.js +1384 -0
- package/dist/enums/selection.d.ts +195 -0
- package/dist/enums/selection.js +182 -0
- package/dist/enums/style.d.ts +362 -0
- package/dist/enums/style.js +349 -0
- package/dist/enums/tables.d.ts +681 -0
- package/dist/enums/tables.js +644 -0
- package/dist/enums/text.d.ts +411 -0
- package/dist/enums/text.js +390 -0
- package/dist/enums/widgets.d.ts +861 -0
- package/dist/enums/widgets.js +800 -0
- package/dist/enums/windows.d.ts +487 -0
- package/dist/enums/windows.js +458 -0
- package/dist/enums.d.ts +10 -0
- package/dist/enums.js +26 -0
- package/dist/font.d.ts +249 -0
- package/dist/font.js +285 -0
- package/dist/formatted.d.ts +301 -0
- package/dist/formatted.js +342 -0
- package/dist/imgui/color.d.ts +493 -0
- package/dist/imgui/color.js +532 -0
- package/dist/imgui/columns.d.ts +242 -0
- package/dist/imgui/columns.js +273 -0
- package/dist/imgui/combo.d.ts +322 -0
- package/dist/imgui/combo.js +344 -0
- package/dist/imgui/context.d.ts +240 -0
- package/dist/imgui/context.js +270 -0
- package/dist/imgui/debug.d.ts +478 -0
- package/dist/imgui/debug.js +526 -0
- package/dist/imgui/drag-drop.d.ts +378 -0
- package/dist/imgui/drag-drop.js +414 -0
- package/dist/imgui/drag.d.ts +1371 -0
- package/dist/imgui/drag.js +1447 -0
- package/dist/imgui/draw-data.d.ts +139 -0
- package/dist/imgui/draw-data.js +154 -0
- package/dist/imgui/draw-list-images.d.ts +306 -0
- package/dist/imgui/draw-list-images.js +324 -0
- package/dist/imgui/draw-list-internals.d.ts +223 -0
- package/dist/imgui/draw-list-internals.js +259 -0
- package/dist/imgui/draw-list-path.d.ts +451 -0
- package/dist/imgui/draw-list-path.js +493 -0
- package/dist/imgui/draw-list-primitives.d.ts +297 -0
- package/dist/imgui/draw-list-primitives.js +324 -0
- package/dist/imgui/draw-list-shapes.d.ts +1258 -0
- package/dist/imgui/draw-list-shapes.js +1345 -0
- package/dist/imgui/draw-list-state.d.ts +458 -0
- package/dist/imgui/draw-list-state.js +515 -0
- package/dist/imgui/draw-list-text.d.ts +367 -0
- package/dist/imgui/draw-list-text.js +247 -0
- package/dist/imgui/drawing.d.ts +151 -0
- package/dist/imgui/drawing.js +169 -0
- package/dist/imgui/font-atlas.d.ts +726 -0
- package/dist/imgui/font-atlas.js +777 -0
- package/dist/imgui/font-glyph-ranges.d.ts +260 -0
- package/dist/imgui/font-glyph-ranges.js +230 -0
- package/dist/imgui/fonts.d.ts +114 -0
- package/dist/imgui/fonts.js +132 -0
- package/dist/imgui/id-stack.d.ts +363 -0
- package/dist/imgui/id-stack.js +309 -0
- package/dist/imgui/images.d.ts +310 -0
- package/dist/imgui/images.js +331 -0
- package/dist/imgui/index.d.ts +57 -0
- package/dist/imgui/index.js +73 -0
- package/dist/imgui/input-text-callback.d.ts +176 -0
- package/dist/imgui/input-text-callback.js +144 -0
- package/dist/imgui/inputs.d.ts +1086 -0
- package/dist/imgui/inputs.js +1159 -0
- package/dist/imgui/io.d.ts +546 -0
- package/dist/imgui/io.js +600 -0
- package/dist/imgui/item-state.d.ts +766 -0
- package/dist/imgui/item-state.js +850 -0
- package/dist/imgui/keyboard.d.ts +547 -0
- package/dist/imgui/keyboard.js +584 -0
- package/dist/imgui/layout.d.ts +927 -0
- package/dist/imgui/layout.js +1029 -0
- package/dist/imgui/legacy.d.ts +413 -0
- package/dist/imgui/legacy.js +461 -0
- package/dist/imgui/list-clipper.d.ts +282 -0
- package/dist/imgui/list-clipper.js +309 -0
- package/dist/imgui/logging.d.ts +113 -0
- package/dist/imgui/logging.js +135 -0
- package/dist/imgui/memory.d.ts +35 -0
- package/dist/imgui/memory.js +45 -0
- package/dist/imgui/menus.d.ts +373 -0
- package/dist/imgui/menus.js +407 -0
- package/dist/imgui/mouse.d.ts +740 -0
- package/dist/imgui/mouse.js +803 -0
- package/dist/imgui/plots.d.ts +252 -0
- package/dist/imgui/plots.js +267 -0
- package/dist/imgui/popups.d.ts +711 -0
- package/dist/imgui/popups.js +757 -0
- package/dist/imgui/scrolling.d.ts +341 -0
- package/dist/imgui/scrolling.js +375 -0
- package/dist/imgui/selection.d.ts +785 -0
- package/dist/imgui/selection.js +845 -0
- package/dist/imgui/settings.d.ts +194 -0
- package/dist/imgui/settings.js +216 -0
- package/dist/imgui/sliders.d.ts +1664 -0
- package/dist/imgui/sliders.js +1751 -0
- package/dist/imgui/storage.d.ts +344 -0
- package/dist/imgui/storage.js +386 -0
- package/dist/imgui/style.d.ts +680 -0
- package/dist/imgui/style.js +770 -0
- package/dist/imgui/tables.d.ts +762 -0
- package/dist/imgui/tables.js +831 -0
- package/dist/imgui/tabs.d.ts +228 -0
- package/dist/imgui/tabs.js +250 -0
- package/dist/imgui/text-buffer.d.ts +251 -0
- package/dist/imgui/text-buffer.js +239 -0
- package/dist/imgui/text-filter.d.ts +181 -0
- package/dist/imgui/text-filter.js +151 -0
- package/dist/imgui/text.d.ts +506 -0
- package/dist/imgui/text.js +425 -0
- package/dist/imgui/tooltips.d.ts +202 -0
- package/dist/imgui/tooltips.js +221 -0
- package/dist/imgui/trees.d.ts +516 -0
- package/dist/imgui/trees.js +562 -0
- package/dist/imgui/viewport.d.ts +93 -0
- package/dist/imgui/viewport.js +105 -0
- package/dist/imgui/widgets.d.ts +524 -0
- package/dist/imgui/widgets.js +572 -0
- package/dist/imgui/windows.d.ts +1210 -0
- package/dist/imgui/windows.js +1309 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +19 -0
- package/dist/internal/imgui-binding.d.ts +40 -0
- package/dist/internal/imgui-binding.js +2 -0
- package/dist/internal/native.d.ts +67 -0
- package/dist/internal/native.js +7 -0
- package/dist/internal/sfml-interop.d.ts +45 -0
- package/dist/internal/sfml-interop.js +102 -0
- package/dist/references.d.ts +393 -0
- package/dist/references.js +372 -0
- package/dist/sfml.d.ts +223 -0
- package/dist/sfml.js +320 -0
- package/dist/struct-views.d.ts +3056 -0
- package/dist/struct-views.js +418 -0
- package/dist/types.d.ts +508 -0
- package/dist/types.js +2 -0
- package/native/addon.cc +68 -0
- package/native/cimgui.h +12 -0
- package/native/imgui-args.h +492 -0
- package/native/imgui-bindings.h +35 -0
- package/native/imgui-callbacks.cc +376 -0
- package/native/imgui-context.cc +117 -0
- package/native/imgui-debug.cc +171 -0
- package/native/imgui-drag-drop.cc +120 -0
- package/native/imgui-drag-widgets.cc +473 -0
- package/native/imgui-draw-callbacks.cc +210 -0
- package/native/imgui-draw-callbacks.h +25 -0
- package/native/imgui-draw-paths.cc +413 -0
- package/native/imgui-draw-primitives.cc +317 -0
- package/native/imgui-drawing.cc +963 -0
- package/native/imgui-font-ranges.cc +73 -0
- package/native/imgui-font.cc +488 -0
- package/native/imgui-formatted.cc +388 -0
- package/native/imgui-frame.cc +56 -0
- package/native/imgui-glyph-fields.cc +87 -0
- package/native/imgui-glyph-fields.h +12 -0
- package/native/imgui-input-widgets.cc +447 -0
- package/native/imgui-input.cc +277 -0
- package/native/imgui-integration.cc +442 -0
- package/native/imgui-io.cc +255 -0
- package/native/imgui-items.cc +290 -0
- package/native/imgui-layout.cc +349 -0
- package/native/imgui-popups.cc +331 -0
- package/native/imgui-references.cc +230 -0
- package/native/imgui-selection.cc +394 -0
- package/native/imgui-slider-widgets.cc +550 -0
- package/native/imgui-storage.cc +177 -0
- package/native/imgui-struct-views.cc +626 -0
- package/native/imgui-style.cc +283 -0
- package/native/imgui-tables.cc +267 -0
- package/native/imgui-text.cc +291 -0
- package/native/imgui-utilities.cc +127 -0
- package/native/imgui-values.cc +66 -0
- package/native/imgui-widgets.cc +570 -0
- package/native/imgui-windows.cc +436 -0
- package/native/interop.h +19 -0
- package/package.json +71 -3
- package/src/callbacks.ts +447 -0
- package/src/enums/colors.ts +782 -0
- package/src/enums/drawing.ts +293 -0
- package/src/enums/input.ts +807 -0
- package/src/enums/keys.ts +1390 -0
- package/src/enums/selection.ts +198 -0
- package/src/enums/style.ts +365 -0
- package/src/enums/tables.ts +690 -0
- package/src/enums/text.ts +416 -0
- package/src/enums/widgets.ts +876 -0
- package/src/enums/windows.ts +494 -0
- package/src/enums.ts +10 -0
- package/src/font.ts +287 -0
- package/src/formatted.ts +386 -0
- package/src/imgui/color.ts +575 -0
- package/src/imgui/columns.ts +274 -0
- package/src/imgui/combo.ts +376 -0
- package/src/imgui/context.ts +268 -0
- package/src/imgui/debug.ts +542 -0
- package/src/imgui/drag-drop.ts +423 -0
- package/src/imgui/drag.ts +1615 -0
- package/src/imgui/draw-data.ts +158 -0
- package/src/imgui/draw-list-images.ts +394 -0
- package/src/imgui/draw-list-internals.ts +291 -0
- package/src/imgui/draw-list-path.ts +568 -0
- package/src/imgui/draw-list-primitives.ts +363 -0
- package/src/imgui/draw-list-shapes.ts +1593 -0
- package/src/imgui/draw-list-state.ts +551 -0
- package/src/imgui/draw-list-text.ts +594 -0
- package/src/imgui/drawing.ts +170 -0
- package/src/imgui/font-atlas.ts +862 -0
- package/src/imgui/font-glyph-ranges.ts +357 -0
- package/src/imgui/fonts.ts +133 -0
- package/src/imgui/id-stack.ts +496 -0
- package/src/imgui/images.ts +364 -0
- package/src/imgui/index.ts +57 -0
- package/src/imgui/input-text-callback.ts +268 -0
- package/src/imgui/inputs.ts +1292 -0
- package/src/imgui/io.ts +638 -0
- package/src/imgui/item-state.ts +856 -0
- package/src/imgui/keyboard.ts +590 -0
- package/src/imgui/layout.ts +1030 -0
- package/src/imgui/legacy.ts +477 -0
- package/src/imgui/list-clipper.ts +329 -0
- package/src/imgui/logging.ts +135 -0
- package/src/imgui/memory.ts +42 -0
- package/src/imgui/menus.ts +417 -0
- package/src/imgui/mouse.ts +824 -0
- package/src/imgui/plots.ts +313 -0
- package/src/imgui/popups.ts +779 -0
- package/src/imgui/scrolling.ts +378 -0
- package/src/imgui/selection.ts +904 -0
- package/src/imgui/settings.ts +220 -0
- package/src/imgui/sliders.ts +1969 -0
- package/src/imgui/storage.ts +415 -0
- package/src/imgui/style.ts +781 -0
- package/src/imgui/tables.ts +854 -0
- package/src/imgui/tabs.ts +259 -0
- package/src/imgui/text-buffer.ts +337 -0
- package/src/imgui/text-filter.ts +262 -0
- package/src/imgui/text.ts +688 -0
- package/src/imgui/tooltips.ts +218 -0
- package/src/imgui/trees.ts +583 -0
- package/src/imgui/viewport.ts +103 -0
- package/src/imgui/widgets.ts +599 -0
- package/src/imgui/windows.ts +1350 -0
- package/src/index.ts +21 -0
- package/src/internal/imgui-binding.ts +142 -0
- package/src/internal/native.ts +163 -0
- package/src/internal/sfml-interop.ts +171 -0
- package/src/references.ts +464 -0
- package/src/sfml.ts +412 -0
- package/src/struct-views.ts +3194 -0
- package/src/types.ts +539 -0
- package/tools/deps_downloader.cjs +213 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
// Copyright (c) 2026 XadillaX
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
#include <string>
|
|
5
|
+
|
|
6
|
+
#include "native/imgui-args.h"
|
|
7
|
+
#include "native/imgui-bindings.h"
|
|
8
|
+
|
|
9
|
+
namespace sfmlimgui {
|
|
10
|
+
namespace {
|
|
11
|
+
|
|
12
|
+
NAN_METHOD(PushItemFlag) {
|
|
13
|
+
ImGuiItemFlags option = {};
|
|
14
|
+
if (!ReadScalar(info, 0, &option)) return;
|
|
15
|
+
bool enabled = false;
|
|
16
|
+
if (!ReadBool(info, 1, &enabled)) return;
|
|
17
|
+
::cimgui::ImGui_PushItemFlag(option, enabled);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
NAN_METHOD(PopItemFlag) {
|
|
21
|
+
::cimgui::ImGui_PopItemFlag();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
NAN_METHOD(PushID) {
|
|
25
|
+
std::string string_id_utf8;
|
|
26
|
+
const char* string_id = nullptr;
|
|
27
|
+
if (!ReadUtf8(info, 0, &string_id_utf8, &string_id, true)) return;
|
|
28
|
+
::cimgui::ImGui_PushID(string_id);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
NAN_METHOD(PushIDStr) {
|
|
32
|
+
Utf8Range text_range;
|
|
33
|
+
if (!ReadUtf8Range(info, 0, 1, &text_range)) return;
|
|
34
|
+
// ImGui treats a zero hash length as NUL-terminated input.
|
|
35
|
+
if (text_range.end && text_range.begin == text_range.end) {
|
|
36
|
+
::cimgui::ImGui_PushID("");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
::cimgui::ImGui_PushIDStr(text_range.begin, text_range.end);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
NAN_METHOD(PushIDPtr) {
|
|
43
|
+
void* pointer_id = nullptr;
|
|
44
|
+
if (!ReadPointer(info, 0, &pointer_id)) return;
|
|
45
|
+
::cimgui::ImGui_PushIDPtr(pointer_id);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
NAN_METHOD(PushIDInt) {
|
|
49
|
+
int int_id = {};
|
|
50
|
+
if (!ReadScalar(info, 0, &int_id)) return;
|
|
51
|
+
::cimgui::ImGui_PushIDInt(int_id);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
NAN_METHOD(PopID) {
|
|
55
|
+
::cimgui::ImGui_PopID();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
NAN_METHOD(GetID) {
|
|
59
|
+
std::string string_id_utf8;
|
|
60
|
+
const char* string_id = nullptr;
|
|
61
|
+
if (!ReadUtf8(info, 0, &string_id_utf8, &string_id, true)) return;
|
|
62
|
+
auto result = ::cimgui::ImGui_GetID(string_id);
|
|
63
|
+
info.GetReturnValue().Set(Nan::New(static_cast<double>(result)));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
NAN_METHOD(GetIDStr) {
|
|
67
|
+
Utf8Range text_range;
|
|
68
|
+
if (!ReadUtf8Range(info, 0, 1, &text_range)) return;
|
|
69
|
+
// Empty explicit ranges must not enter ImGui's NUL-terminated hash path.
|
|
70
|
+
auto result =
|
|
71
|
+
(text_range.end && text_range.begin == text_range.end)
|
|
72
|
+
? ::cimgui::ImGui_GetID("")
|
|
73
|
+
: ::cimgui::ImGui_GetIDStr(text_range.begin, text_range.end);
|
|
74
|
+
info.GetReturnValue().Set(Nan::New(static_cast<double>(result)));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
NAN_METHOD(GetIDPtr) {
|
|
78
|
+
void* pointer_id = nullptr;
|
|
79
|
+
if (!ReadPointer(info, 0, &pointer_id)) return;
|
|
80
|
+
auto result = ::cimgui::ImGui_GetIDPtr(pointer_id);
|
|
81
|
+
info.GetReturnValue().Set(Nan::New(static_cast<double>(result)));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
NAN_METHOD(GetIDInt) {
|
|
85
|
+
int int_id = {};
|
|
86
|
+
if (!ReadScalar(info, 0, &int_id)) return;
|
|
87
|
+
auto result = ::cimgui::ImGui_GetIDInt(int_id);
|
|
88
|
+
info.GetReturnValue().Set(Nan::New(static_cast<double>(result)));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
NAN_METHOD(SetItemDefaultFocus) {
|
|
92
|
+
::cimgui::ImGui_SetItemDefaultFocus();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
NAN_METHOD(SetKeyboardFocusHere) {
|
|
96
|
+
::cimgui::ImGui_SetKeyboardFocusHere();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
NAN_METHOD(SetKeyboardFocusHereEx) {
|
|
100
|
+
int offset = {};
|
|
101
|
+
if (!ReadScalar(info, 0, &offset)) return;
|
|
102
|
+
::cimgui::ImGui_SetKeyboardFocusHereEx(offset);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
NAN_METHOD(SetNavCursorVisible) {
|
|
106
|
+
bool visible = false;
|
|
107
|
+
if (!ReadBool(info, 0, &visible)) return;
|
|
108
|
+
::cimgui::ImGui_SetNavCursorVisible(visible);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
NAN_METHOD(SetNextItemAllowOverlap) {
|
|
112
|
+
::cimgui::ImGui_SetNextItemAllowOverlap();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
NAN_METHOD(IsItemHovered) {
|
|
116
|
+
ImGuiHoveredFlags flags = {};
|
|
117
|
+
if (!ReadScalar(info, 0, &flags)) return;
|
|
118
|
+
auto result = ::cimgui::ImGui_IsItemHovered(flags);
|
|
119
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
NAN_METHOD(IsItemActive) {
|
|
123
|
+
auto result = ::cimgui::ImGui_IsItemActive();
|
|
124
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
NAN_METHOD(IsItemFocused) {
|
|
128
|
+
auto result = ::cimgui::ImGui_IsItemFocused();
|
|
129
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
NAN_METHOD(IsItemClicked) {
|
|
133
|
+
auto result = ::cimgui::ImGui_IsItemClicked();
|
|
134
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
NAN_METHOD(IsItemClickedEx) {
|
|
138
|
+
ImGuiMouseButton mouse_button = {};
|
|
139
|
+
if (!ReadScalar(info, 0, &mouse_button)) return;
|
|
140
|
+
auto result = ::cimgui::ImGui_IsItemClickedEx(mouse_button);
|
|
141
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
NAN_METHOD(IsItemVisible) {
|
|
145
|
+
auto result = ::cimgui::ImGui_IsItemVisible();
|
|
146
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
NAN_METHOD(IsItemEdited) {
|
|
150
|
+
auto result = ::cimgui::ImGui_IsItemEdited();
|
|
151
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
NAN_METHOD(IsItemActivated) {
|
|
155
|
+
auto result = ::cimgui::ImGui_IsItemActivated();
|
|
156
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
NAN_METHOD(IsItemDeactivated) {
|
|
160
|
+
auto result = ::cimgui::ImGui_IsItemDeactivated();
|
|
161
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
NAN_METHOD(IsItemDeactivatedAfterEdit) {
|
|
165
|
+
auto result = ::cimgui::ImGui_IsItemDeactivatedAfterEdit();
|
|
166
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
NAN_METHOD(IsItemToggledOpen) {
|
|
170
|
+
auto result = ::cimgui::ImGui_IsItemToggledOpen();
|
|
171
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
NAN_METHOD(IsAnyItemHovered) {
|
|
175
|
+
auto result = ::cimgui::ImGui_IsAnyItemHovered();
|
|
176
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
NAN_METHOD(IsAnyItemActive) {
|
|
180
|
+
auto result = ::cimgui::ImGui_IsAnyItemActive();
|
|
181
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
NAN_METHOD(IsAnyItemFocused) {
|
|
185
|
+
auto result = ::cimgui::ImGui_IsAnyItemFocused();
|
|
186
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
NAN_METHOD(GetItemID) {
|
|
190
|
+
auto result = ::cimgui::ImGui_GetItemID();
|
|
191
|
+
info.GetReturnValue().Set(Nan::New(static_cast<double>(result)));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
NAN_METHOD(GetItemRectMin) {
|
|
195
|
+
auto result = ::cimgui::ImGui_GetItemRectMin();
|
|
196
|
+
ReturnVec2(info, result);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
NAN_METHOD(GetItemRectMax) {
|
|
200
|
+
auto result = ::cimgui::ImGui_GetItemRectMax();
|
|
201
|
+
ReturnVec2(info, result);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
NAN_METHOD(GetItemRectSize) {
|
|
205
|
+
auto result = ::cimgui::ImGui_GetItemRectSize();
|
|
206
|
+
ReturnVec2(info, result);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
NAN_METHOD(PushButtonRepeat) {
|
|
210
|
+
bool repeat = false;
|
|
211
|
+
if (!ReadBool(info, 0, &repeat)) return;
|
|
212
|
+
::cimgui::ImGui_PushButtonRepeat(repeat);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
NAN_METHOD(PopButtonRepeat) {
|
|
216
|
+
::cimgui::ImGui_PopButtonRepeat();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
NAN_METHOD(PushTabStop) {
|
|
220
|
+
bool tab_stop = false;
|
|
221
|
+
if (!ReadBool(info, 0, &tab_stop)) return;
|
|
222
|
+
::cimgui::ImGui_PushTabStop(tab_stop);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
NAN_METHOD(PopTabStop) {
|
|
226
|
+
::cimgui::ImGui_PopTabStop();
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
NAN_METHOD(SetItemAllowOverlap) {
|
|
230
|
+
::cimgui::ImGui_SetItemAllowOverlap();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
NAN_METHOD(PushAllowKeyboardFocus) {
|
|
234
|
+
bool tab_stop = false;
|
|
235
|
+
if (!ReadBool(info, 0, &tab_stop)) return;
|
|
236
|
+
::cimgui::ImGui_PushAllowKeyboardFocus(tab_stop);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
NAN_METHOD(PopAllowKeyboardFocus) {
|
|
240
|
+
::cimgui::ImGui_PopAllowKeyboardFocus();
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
} // namespace
|
|
244
|
+
|
|
245
|
+
NAN_MODULE_INIT(InitializeImGuiItems) {
|
|
246
|
+
sfmljs::SetMethod<PushItemFlag>(target, "PushItemFlag");
|
|
247
|
+
sfmljs::SetMethod<PopItemFlag>(target, "PopItemFlag");
|
|
248
|
+
sfmljs::SetMethod<PushID>(target, "PushID");
|
|
249
|
+
sfmljs::SetMethod<PushIDStr>(target, "PushIDStr");
|
|
250
|
+
sfmljs::SetMethod<PushIDPtr>(target, "PushIDPtr");
|
|
251
|
+
sfmljs::SetMethod<PushIDInt>(target, "PushIDInt");
|
|
252
|
+
sfmljs::SetMethod<PopID>(target, "PopID");
|
|
253
|
+
sfmljs::SetMethod<GetID>(target, "GetID");
|
|
254
|
+
sfmljs::SetMethod<GetIDStr>(target, "GetIDStr");
|
|
255
|
+
sfmljs::SetMethod<GetIDPtr>(target, "GetIDPtr");
|
|
256
|
+
sfmljs::SetMethod<GetIDInt>(target, "GetIDInt");
|
|
257
|
+
sfmljs::SetMethod<SetItemDefaultFocus>(target, "SetItemDefaultFocus");
|
|
258
|
+
sfmljs::SetMethod<SetKeyboardFocusHere>(target, "SetKeyboardFocusHere");
|
|
259
|
+
sfmljs::SetMethod<SetKeyboardFocusHereEx>(target, "SetKeyboardFocusHereEx");
|
|
260
|
+
sfmljs::SetMethod<SetNavCursorVisible>(target, "SetNavCursorVisible");
|
|
261
|
+
sfmljs::SetMethod<SetNextItemAllowOverlap>(target, "SetNextItemAllowOverlap");
|
|
262
|
+
sfmljs::SetMethod<IsItemHovered>(target, "IsItemHovered");
|
|
263
|
+
sfmljs::SetMethod<IsItemActive>(target, "IsItemActive");
|
|
264
|
+
sfmljs::SetMethod<IsItemFocused>(target, "IsItemFocused");
|
|
265
|
+
sfmljs::SetMethod<IsItemClicked>(target, "IsItemClicked");
|
|
266
|
+
sfmljs::SetMethod<IsItemClickedEx>(target, "IsItemClickedEx");
|
|
267
|
+
sfmljs::SetMethod<IsItemVisible>(target, "IsItemVisible");
|
|
268
|
+
sfmljs::SetMethod<IsItemEdited>(target, "IsItemEdited");
|
|
269
|
+
sfmljs::SetMethod<IsItemActivated>(target, "IsItemActivated");
|
|
270
|
+
sfmljs::SetMethod<IsItemDeactivated>(target, "IsItemDeactivated");
|
|
271
|
+
sfmljs::SetMethod<IsItemDeactivatedAfterEdit>(target,
|
|
272
|
+
"IsItemDeactivatedAfterEdit");
|
|
273
|
+
sfmljs::SetMethod<IsItemToggledOpen>(target, "IsItemToggledOpen");
|
|
274
|
+
sfmljs::SetMethod<IsAnyItemHovered>(target, "IsAnyItemHovered");
|
|
275
|
+
sfmljs::SetMethod<IsAnyItemActive>(target, "IsAnyItemActive");
|
|
276
|
+
sfmljs::SetMethod<IsAnyItemFocused>(target, "IsAnyItemFocused");
|
|
277
|
+
sfmljs::SetMethod<GetItemID>(target, "GetItemID");
|
|
278
|
+
sfmljs::SetMethod<GetItemRectMin>(target, "GetItemRectMin");
|
|
279
|
+
sfmljs::SetMethod<GetItemRectMax>(target, "GetItemRectMax");
|
|
280
|
+
sfmljs::SetMethod<GetItemRectSize>(target, "GetItemRectSize");
|
|
281
|
+
sfmljs::SetMethod<PushButtonRepeat>(target, "PushButtonRepeat");
|
|
282
|
+
sfmljs::SetMethod<PopButtonRepeat>(target, "PopButtonRepeat");
|
|
283
|
+
sfmljs::SetMethod<PushTabStop>(target, "PushTabStop");
|
|
284
|
+
sfmljs::SetMethod<PopTabStop>(target, "PopTabStop");
|
|
285
|
+
sfmljs::SetMethod<SetItemAllowOverlap>(target, "SetItemAllowOverlap");
|
|
286
|
+
sfmljs::SetMethod<PushAllowKeyboardFocus>(target, "PushAllowKeyboardFocus");
|
|
287
|
+
sfmljs::SetMethod<PopAllowKeyboardFocus>(target, "PopAllowKeyboardFocus");
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
} // namespace sfmlimgui
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
// Copyright (c) 2026 XadillaX
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
#include "native/imgui-args.h"
|
|
5
|
+
#include "native/imgui-bindings.h"
|
|
6
|
+
|
|
7
|
+
namespace sfmlimgui {
|
|
8
|
+
namespace {
|
|
9
|
+
|
|
10
|
+
NAN_METHOD(PushItemWidth) {
|
|
11
|
+
float item_width = {};
|
|
12
|
+
if (!ReadScalar(info, 0, &item_width)) return;
|
|
13
|
+
::cimgui::ImGui_PushItemWidth(item_width);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
NAN_METHOD(PopItemWidth) {
|
|
17
|
+
::cimgui::ImGui_PopItemWidth();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
NAN_METHOD(SetNextItemWidth) {
|
|
21
|
+
float item_width = {};
|
|
22
|
+
if (!ReadScalar(info, 0, &item_width)) return;
|
|
23
|
+
::cimgui::ImGui_SetNextItemWidth(item_width);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
NAN_METHOD(CalcItemWidth) {
|
|
27
|
+
auto result = ::cimgui::ImGui_CalcItemWidth();
|
|
28
|
+
info.GetReturnValue().Set(Nan::New(static_cast<double>(result)));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
NAN_METHOD(PushTextWrapPos) {
|
|
32
|
+
float wrap_local_pos_x = {};
|
|
33
|
+
if (!ReadScalar(info, 0, &wrap_local_pos_x)) return;
|
|
34
|
+
::cimgui::ImGui_PushTextWrapPos(wrap_local_pos_x);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
NAN_METHOD(PopTextWrapPos) {
|
|
38
|
+
::cimgui::ImGui_PopTextWrapPos();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
NAN_METHOD(GetCursorScreenPos) {
|
|
42
|
+
auto result = ::cimgui::ImGui_GetCursorScreenPos();
|
|
43
|
+
ReturnVec2(info, result);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
NAN_METHOD(SetCursorScreenPos) {
|
|
47
|
+
cimgui::ImVec2 position;
|
|
48
|
+
if (!ReadImVec2(info, 0, &position)) return;
|
|
49
|
+
::cimgui::ImGui_SetCursorScreenPos(position);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
NAN_METHOD(GetContentRegionAvail) {
|
|
53
|
+
auto result = ::cimgui::ImGui_GetContentRegionAvail();
|
|
54
|
+
ReturnVec2(info, result);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
NAN_METHOD(GetCursorPos) {
|
|
58
|
+
auto result = ::cimgui::ImGui_GetCursorPos();
|
|
59
|
+
ReturnVec2(info, result);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
NAN_METHOD(GetCursorPosX) {
|
|
63
|
+
auto result = ::cimgui::ImGui_GetCursorPosX();
|
|
64
|
+
info.GetReturnValue().Set(Nan::New(static_cast<double>(result)));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
NAN_METHOD(GetCursorPosY) {
|
|
68
|
+
auto result = ::cimgui::ImGui_GetCursorPosY();
|
|
69
|
+
info.GetReturnValue().Set(Nan::New(static_cast<double>(result)));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
NAN_METHOD(SetCursorPos) {
|
|
73
|
+
cimgui::ImVec2 local_pos;
|
|
74
|
+
if (!ReadImVec2(info, 0, &local_pos)) return;
|
|
75
|
+
::cimgui::ImGui_SetCursorPos(local_pos);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
NAN_METHOD(SetCursorPosX) {
|
|
79
|
+
float local_x = {};
|
|
80
|
+
if (!ReadScalar(info, 0, &local_x)) return;
|
|
81
|
+
::cimgui::ImGui_SetCursorPosX(local_x);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
NAN_METHOD(SetCursorPosY) {
|
|
85
|
+
float local_y = {};
|
|
86
|
+
if (!ReadScalar(info, 0, &local_y)) return;
|
|
87
|
+
::cimgui::ImGui_SetCursorPosY(local_y);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
NAN_METHOD(GetCursorStartPos) {
|
|
91
|
+
auto result = ::cimgui::ImGui_GetCursorStartPos();
|
|
92
|
+
ReturnVec2(info, result);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
NAN_METHOD(Separator) {
|
|
96
|
+
::cimgui::ImGui_Separator();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
NAN_METHOD(SameLine) {
|
|
100
|
+
::cimgui::ImGui_SameLine();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
NAN_METHOD(SameLineEx) {
|
|
104
|
+
float offset_from_start_x = {};
|
|
105
|
+
if (!ReadScalar(info, 0, &offset_from_start_x)) return;
|
|
106
|
+
float spacing = {};
|
|
107
|
+
if (!ReadScalar(info, 1, &spacing)) return;
|
|
108
|
+
::cimgui::ImGui_SameLineEx(offset_from_start_x, spacing);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
NAN_METHOD(NewLine) {
|
|
112
|
+
::cimgui::ImGui_NewLine();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
NAN_METHOD(Spacing) {
|
|
116
|
+
::cimgui::ImGui_Spacing();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
NAN_METHOD(Dummy) {
|
|
120
|
+
cimgui::ImVec2 size;
|
|
121
|
+
if (!ReadImVec2(info, 0, &size)) return;
|
|
122
|
+
::cimgui::ImGui_Dummy(size);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
NAN_METHOD(Indent) {
|
|
126
|
+
::cimgui::ImGui_Indent();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
NAN_METHOD(IndentEx) {
|
|
130
|
+
float indent_width = {};
|
|
131
|
+
if (!ReadScalar(info, 0, &indent_width)) return;
|
|
132
|
+
::cimgui::ImGui_IndentEx(indent_width);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
NAN_METHOD(Unindent) {
|
|
136
|
+
::cimgui::ImGui_Unindent();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
NAN_METHOD(UnindentEx) {
|
|
140
|
+
float indent_width = {};
|
|
141
|
+
if (!ReadScalar(info, 0, &indent_width)) return;
|
|
142
|
+
::cimgui::ImGui_UnindentEx(indent_width);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
NAN_METHOD(BeginGroup) {
|
|
146
|
+
::cimgui::ImGui_BeginGroup();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
NAN_METHOD(EndGroup) {
|
|
150
|
+
::cimgui::ImGui_EndGroup();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
NAN_METHOD(AlignTextToFramePadding) {
|
|
154
|
+
::cimgui::ImGui_AlignTextToFramePadding();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
NAN_METHOD(GetTextLineHeight) {
|
|
158
|
+
auto result = ::cimgui::ImGui_GetTextLineHeight();
|
|
159
|
+
info.GetReturnValue().Set(Nan::New(static_cast<double>(result)));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
NAN_METHOD(GetTextLineHeightWithSpacing) {
|
|
163
|
+
auto result = ::cimgui::ImGui_GetTextLineHeightWithSpacing();
|
|
164
|
+
info.GetReturnValue().Set(Nan::New(static_cast<double>(result)));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
NAN_METHOD(GetFrameHeight) {
|
|
168
|
+
auto result = ::cimgui::ImGui_GetFrameHeight();
|
|
169
|
+
info.GetReturnValue().Set(Nan::New(static_cast<double>(result)));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
NAN_METHOD(GetFrameHeightWithSpacing) {
|
|
173
|
+
auto result = ::cimgui::ImGui_GetFrameHeightWithSpacing();
|
|
174
|
+
info.GetReturnValue().Set(Nan::New(static_cast<double>(result)));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
NAN_METHOD(IsRectVisibleBySize) {
|
|
178
|
+
cimgui::ImVec2 size;
|
|
179
|
+
if (!ReadImVec2(info, 0, &size)) return;
|
|
180
|
+
auto result = ::cimgui::ImGui_IsRectVisibleBySize(size);
|
|
181
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
NAN_METHOD(IsRectVisible) {
|
|
185
|
+
cimgui::ImVec2 rect_min;
|
|
186
|
+
if (!ReadImVec2(info, 0, &rect_min)) return;
|
|
187
|
+
cimgui::ImVec2 rect_max;
|
|
188
|
+
if (!ReadImVec2(info, 1, &rect_max)) return;
|
|
189
|
+
auto result = ::cimgui::ImGui_IsRectVisible(rect_min, rect_max);
|
|
190
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
NAN_METHOD(ListClipperBegin) {
|
|
194
|
+
cimgui::ImGuiListClipper* clipper = nullptr;
|
|
195
|
+
if (!info[0]->IsUndefined() && !info[0]->IsNull()) {
|
|
196
|
+
clipper = ReadStruct<cimgui::ImGuiListClipper>(info, 0);
|
|
197
|
+
if (!clipper) return;
|
|
198
|
+
}
|
|
199
|
+
int items_count = {};
|
|
200
|
+
if (!ReadScalar(info, 1, &items_count)) return;
|
|
201
|
+
float items_height = {};
|
|
202
|
+
if (!ReadScalar(info, 2, &items_height)) return;
|
|
203
|
+
::cimgui::ImGuiListClipper_Begin(clipper, items_count, items_height);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
NAN_METHOD(ListClipperEnd) {
|
|
207
|
+
cimgui::ImGuiListClipper* clipper = nullptr;
|
|
208
|
+
if (!info[0]->IsUndefined() && !info[0]->IsNull()) {
|
|
209
|
+
clipper = ReadStruct<cimgui::ImGuiListClipper>(info, 0);
|
|
210
|
+
if (!clipper) return;
|
|
211
|
+
}
|
|
212
|
+
::cimgui::ImGuiListClipper_End(clipper);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
NAN_METHOD(ListClipperStep) {
|
|
216
|
+
cimgui::ImGuiListClipper* clipper = nullptr;
|
|
217
|
+
if (!info[0]->IsUndefined() && !info[0]->IsNull()) {
|
|
218
|
+
clipper = ReadStruct<cimgui::ImGuiListClipper>(info, 0);
|
|
219
|
+
if (!clipper) return;
|
|
220
|
+
}
|
|
221
|
+
auto result = ::cimgui::ImGuiListClipper_Step(clipper);
|
|
222
|
+
info.GetReturnValue().Set(Nan::New(result));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
NAN_METHOD(ListClipperIncludeItemByIndex) {
|
|
226
|
+
cimgui::ImGuiListClipper* clipper = nullptr;
|
|
227
|
+
if (!info[0]->IsUndefined() && !info[0]->IsNull()) {
|
|
228
|
+
clipper = ReadStruct<cimgui::ImGuiListClipper>(info, 0);
|
|
229
|
+
if (!clipper) return;
|
|
230
|
+
}
|
|
231
|
+
int item_index = {};
|
|
232
|
+
if (!ReadScalar(info, 1, &item_index)) return;
|
|
233
|
+
::cimgui::ImGuiListClipper_IncludeItemByIndex(clipper, item_index);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
NAN_METHOD(ListClipperIncludeItemsByIndex) {
|
|
237
|
+
cimgui::ImGuiListClipper* clipper = nullptr;
|
|
238
|
+
if (!info[0]->IsUndefined() && !info[0]->IsNull()) {
|
|
239
|
+
clipper = ReadStruct<cimgui::ImGuiListClipper>(info, 0);
|
|
240
|
+
if (!clipper) return;
|
|
241
|
+
}
|
|
242
|
+
int item_begin = {};
|
|
243
|
+
if (!ReadScalar(info, 1, &item_begin)) return;
|
|
244
|
+
int item_end = {};
|
|
245
|
+
if (!ReadScalar(info, 2, &item_end)) return;
|
|
246
|
+
::cimgui::ImGuiListClipper_IncludeItemsByIndex(clipper, item_begin, item_end);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
NAN_METHOD(ListClipperSeekCursorForItem) {
|
|
250
|
+
cimgui::ImGuiListClipper* clipper = nullptr;
|
|
251
|
+
if (!info[0]->IsUndefined() && !info[0]->IsNull()) {
|
|
252
|
+
clipper = ReadStruct<cimgui::ImGuiListClipper>(info, 0);
|
|
253
|
+
if (!clipper) return;
|
|
254
|
+
}
|
|
255
|
+
int item_index = {};
|
|
256
|
+
if (!ReadScalar(info, 1, &item_index)) return;
|
|
257
|
+
::cimgui::ImGuiListClipper_SeekCursorForItem(clipper, item_index);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
NAN_METHOD(ListClipperIncludeRangeByIndices) {
|
|
261
|
+
cimgui::ImGuiListClipper* clipper = nullptr;
|
|
262
|
+
if (!info[0]->IsUndefined() && !info[0]->IsNull()) {
|
|
263
|
+
clipper = ReadStruct<cimgui::ImGuiListClipper>(info, 0);
|
|
264
|
+
if (!clipper) return;
|
|
265
|
+
}
|
|
266
|
+
int item_begin = {};
|
|
267
|
+
if (!ReadScalar(info, 1, &item_begin)) return;
|
|
268
|
+
int item_end = {};
|
|
269
|
+
if (!ReadScalar(info, 2, &item_end)) return;
|
|
270
|
+
::cimgui::ImGuiListClipper_IncludeRangeByIndices(
|
|
271
|
+
clipper, item_begin, item_end);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
NAN_METHOD(ListClipperForceDisplayRangeByIndices) {
|
|
275
|
+
cimgui::ImGuiListClipper* clipper = nullptr;
|
|
276
|
+
if (!info[0]->IsUndefined() && !info[0]->IsNull()) {
|
|
277
|
+
clipper = ReadStruct<cimgui::ImGuiListClipper>(info, 0);
|
|
278
|
+
if (!clipper) return;
|
|
279
|
+
}
|
|
280
|
+
int item_begin = {};
|
|
281
|
+
if (!ReadScalar(info, 1, &item_begin)) return;
|
|
282
|
+
int item_end = {};
|
|
283
|
+
if (!ReadScalar(info, 2, &item_end)) return;
|
|
284
|
+
::cimgui::ImGuiListClipper_ForceDisplayRangeByIndices(
|
|
285
|
+
clipper, item_begin, item_end);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
NAN_METHOD(GetContentRegionMax) {
|
|
289
|
+
auto result = ::cimgui::ImGui_GetContentRegionMax();
|
|
290
|
+
ReturnVec2(info, result);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
} // namespace
|
|
294
|
+
|
|
295
|
+
NAN_MODULE_INIT(InitializeImGuiLayout) {
|
|
296
|
+
sfmljs::SetMethod<PushItemWidth>(target, "PushItemWidth");
|
|
297
|
+
sfmljs::SetMethod<PopItemWidth>(target, "PopItemWidth");
|
|
298
|
+
sfmljs::SetMethod<SetNextItemWidth>(target, "SetNextItemWidth");
|
|
299
|
+
sfmljs::SetMethod<CalcItemWidth>(target, "CalcItemWidth");
|
|
300
|
+
sfmljs::SetMethod<PushTextWrapPos>(target, "PushTextWrapPos");
|
|
301
|
+
sfmljs::SetMethod<PopTextWrapPos>(target, "PopTextWrapPos");
|
|
302
|
+
sfmljs::SetMethod<GetCursorScreenPos>(target, "GetCursorScreenPos");
|
|
303
|
+
sfmljs::SetMethod<SetCursorScreenPos>(target, "SetCursorScreenPos");
|
|
304
|
+
sfmljs::SetMethod<GetContentRegionAvail>(target, "GetContentRegionAvail");
|
|
305
|
+
sfmljs::SetMethod<GetCursorPos>(target, "GetCursorPos");
|
|
306
|
+
sfmljs::SetMethod<GetCursorPosX>(target, "GetCursorPosX");
|
|
307
|
+
sfmljs::SetMethod<GetCursorPosY>(target, "GetCursorPosY");
|
|
308
|
+
sfmljs::SetMethod<SetCursorPos>(target, "SetCursorPos");
|
|
309
|
+
sfmljs::SetMethod<SetCursorPosX>(target, "SetCursorPosX");
|
|
310
|
+
sfmljs::SetMethod<SetCursorPosY>(target, "SetCursorPosY");
|
|
311
|
+
sfmljs::SetMethod<GetCursorStartPos>(target, "GetCursorStartPos");
|
|
312
|
+
sfmljs::SetMethod<Separator>(target, "Separator");
|
|
313
|
+
sfmljs::SetMethod<SameLine>(target, "SameLine");
|
|
314
|
+
sfmljs::SetMethod<SameLineEx>(target, "SameLineEx");
|
|
315
|
+
sfmljs::SetMethod<NewLine>(target, "NewLine");
|
|
316
|
+
sfmljs::SetMethod<Spacing>(target, "Spacing");
|
|
317
|
+
sfmljs::SetMethod<Dummy>(target, "Dummy");
|
|
318
|
+
sfmljs::SetMethod<Indent>(target, "Indent");
|
|
319
|
+
sfmljs::SetMethod<IndentEx>(target, "IndentEx");
|
|
320
|
+
sfmljs::SetMethod<Unindent>(target, "Unindent");
|
|
321
|
+
sfmljs::SetMethod<UnindentEx>(target, "UnindentEx");
|
|
322
|
+
sfmljs::SetMethod<BeginGroup>(target, "BeginGroup");
|
|
323
|
+
sfmljs::SetMethod<EndGroup>(target, "EndGroup");
|
|
324
|
+
sfmljs::SetMethod<AlignTextToFramePadding>(target, "AlignTextToFramePadding");
|
|
325
|
+
sfmljs::SetMethod<GetTextLineHeight>(target, "GetTextLineHeight");
|
|
326
|
+
sfmljs::SetMethod<GetTextLineHeightWithSpacing>(
|
|
327
|
+
target, "GetTextLineHeightWithSpacing");
|
|
328
|
+
sfmljs::SetMethod<GetFrameHeight>(target, "GetFrameHeight");
|
|
329
|
+
sfmljs::SetMethod<GetFrameHeightWithSpacing>(target,
|
|
330
|
+
"GetFrameHeightWithSpacing");
|
|
331
|
+
sfmljs::SetMethod<IsRectVisibleBySize>(target, "IsRectVisibleBySize");
|
|
332
|
+
sfmljs::SetMethod<IsRectVisible>(target, "IsRectVisible");
|
|
333
|
+
sfmljs::SetMethod<ListClipperBegin>(target, "ListClipper_Begin");
|
|
334
|
+
sfmljs::SetMethod<ListClipperEnd>(target, "ListClipper_End");
|
|
335
|
+
sfmljs::SetMethod<ListClipperStep>(target, "ListClipper_Step");
|
|
336
|
+
sfmljs::SetMethod<ListClipperIncludeItemByIndex>(
|
|
337
|
+
target, "ListClipper_IncludeItemByIndex");
|
|
338
|
+
sfmljs::SetMethod<ListClipperIncludeItemsByIndex>(
|
|
339
|
+
target, "ListClipper_IncludeItemsByIndex");
|
|
340
|
+
sfmljs::SetMethod<ListClipperSeekCursorForItem>(
|
|
341
|
+
target, "ListClipper_SeekCursorForItem");
|
|
342
|
+
sfmljs::SetMethod<ListClipperIncludeRangeByIndices>(
|
|
343
|
+
target, "ListClipper_IncludeRangeByIndices");
|
|
344
|
+
sfmljs::SetMethod<ListClipperForceDisplayRangeByIndices>(
|
|
345
|
+
target, "ListClipper_ForceDisplayRangeByIndices");
|
|
346
|
+
sfmljs::SetMethod<GetContentRegionMax>(target, "GetContentRegionMax");
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
} // namespace sfmlimgui
|