sfml.js-imgui 0.0.0-stage → 1.2.1
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 +72 -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
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * as ImGui from './imgui';
|
|
2
|
+
export * as SFML from './sfml';
|
|
3
|
+
export { getFontAtlas, getStyleColors, getGlyphRangesDefault, getGlyphRangesGreek, getGlyphRangesKorean, getGlyphRangesJapanese, getGlyphRangesChineseFull, getGlyphRangesChineseSimplifiedCommon, getGlyphRangesCyrillic, getGlyphRangesThai, getGlyphRangesVietnamese, } from './font';
|
|
4
|
+
export type { ImGuiIOView, ImGuiStyleView } from './sfml';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGlyphRangesVietnamese = exports.getGlyphRangesThai = exports.getGlyphRangesCyrillic = exports.getGlyphRangesChineseSimplifiedCommon = exports.getGlyphRangesChineseFull = exports.getGlyphRangesJapanese = exports.getGlyphRangesKorean = exports.getGlyphRangesGreek = exports.getGlyphRangesDefault = exports.getStyleColors = exports.getFontAtlas = exports.SFML = exports.ImGui = void 0;
|
|
4
|
+
// Maintained ImGui API, shared-memory views, and enums.
|
|
5
|
+
exports.ImGui = require("./imgui");
|
|
6
|
+
// imgui-sfml style integration layer: Init / ProcessEvent / Update / Render.
|
|
7
|
+
exports.SFML = require("./sfml");
|
|
8
|
+
var font_1 = require("./font");
|
|
9
|
+
Object.defineProperty(exports, "getFontAtlas", { enumerable: true, get: function () { return font_1.getFontAtlas; } });
|
|
10
|
+
Object.defineProperty(exports, "getStyleColors", { enumerable: true, get: function () { return font_1.getStyleColors; } });
|
|
11
|
+
Object.defineProperty(exports, "getGlyphRangesDefault", { enumerable: true, get: function () { return font_1.getGlyphRangesDefault; } });
|
|
12
|
+
Object.defineProperty(exports, "getGlyphRangesGreek", { enumerable: true, get: function () { return font_1.getGlyphRangesGreek; } });
|
|
13
|
+
Object.defineProperty(exports, "getGlyphRangesKorean", { enumerable: true, get: function () { return font_1.getGlyphRangesKorean; } });
|
|
14
|
+
Object.defineProperty(exports, "getGlyphRangesJapanese", { enumerable: true, get: function () { return font_1.getGlyphRangesJapanese; } });
|
|
15
|
+
Object.defineProperty(exports, "getGlyphRangesChineseFull", { enumerable: true, get: function () { return font_1.getGlyphRangesChineseFull; } });
|
|
16
|
+
Object.defineProperty(exports, "getGlyphRangesChineseSimplifiedCommon", { enumerable: true, get: function () { return font_1.getGlyphRangesChineseSimplifiedCommon; } });
|
|
17
|
+
Object.defineProperty(exports, "getGlyphRangesCyrillic", { enumerable: true, get: function () { return font_1.getGlyphRangesCyrillic; } });
|
|
18
|
+
Object.defineProperty(exports, "getGlyphRangesThai", { enumerable: true, get: function () { return font_1.getGlyphRangesThai; } });
|
|
19
|
+
Object.defineProperty(exports, "getGlyphRangesVietnamese", { enumerable: true, get: function () { return font_1.getGlyphRangesVietnamese; } });
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ImDrawCmd, ImDrawData, ImDrawList, ImDrawListSplitter, ImFontAtlas, ImFontAtlasCustomRect, ImFontConfig, ImFontGlyph, ImGuiIO, ImGuiInputTextCallbackData, ImGuiListClipper, ImGuiMultiSelectIO, ImGuiPayload, ImGuiPlatformIO, ImGuiSelectionBasicStorage, ImGuiStyle, ImGuiTableSortSpecs, ImGuiTextFilter, ImGuiViewport, NativeStructMapping } from '../types';
|
|
2
|
+
type ImGuiFunctions = typeof import('../imgui/context') & typeof import('../imgui/debug') & typeof import('../imgui/style') & typeof import('../imgui/windows') & typeof import('../imgui/scrolling') & typeof import('../imgui/layout') & typeof import('../imgui/id-stack') & typeof import('../imgui/text') & typeof import('../imgui/widgets') & typeof import('../imgui/images') & typeof import('../imgui/combo') & typeof import('../imgui/drag') & typeof import('../imgui/sliders') & typeof import('../imgui/inputs') & typeof import('../imgui/color') & typeof import('../imgui/trees') & typeof import('../imgui/selection') & typeof import('../imgui/plots') & typeof import('../imgui/menus') & typeof import('../imgui/tooltips') & typeof import('../imgui/popups') & typeof import('../imgui/tables') & typeof import('../imgui/columns') & typeof import('../imgui/tabs') & typeof import('../imgui/logging') & typeof import('../imgui/drag-drop') & typeof import('../imgui/item-state') & typeof import('../imgui/drawing') & typeof import('../imgui/viewport') & typeof import('../imgui/keyboard') & typeof import('../imgui/mouse') & typeof import('../imgui/settings') & typeof import('../imgui/memory') & typeof import('../imgui/io') & typeof import('../imgui/input-text-callback') & typeof import('../imgui/text-filter') & typeof import('../imgui/text-buffer') & typeof import('../imgui/storage') & typeof import('../imgui/list-clipper') & typeof import('../imgui/draw-list-state') & typeof import('../imgui/draw-list-shapes') & typeof import('../imgui/draw-list-text') & typeof import('../imgui/draw-list-images') & typeof import('../imgui/draw-list-path') & typeof import('../imgui/draw-list-primitives') & typeof import('../imgui/draw-list-internals') & typeof import('../imgui/draw-data') & typeof import('../imgui/font-glyph-ranges') & typeof import('../imgui/font-atlas') & typeof import('../imgui/fonts') & typeof import('../imgui/legacy');
|
|
3
|
+
type NativeArguments<Arguments extends unknown[]> = Arguments extends [infer Head, ...infer Tail] ? [Exclude<Head, undefined>, ...NativeArguments<Tail>] : Required<Arguments>;
|
|
4
|
+
type MergeArguments<Left extends unknown[], Right extends unknown[]> = Left extends [infer LeftHead, ...infer LeftTail] ? Right extends [infer RightHead, ...infer RightTail] ? [LeftHead | RightHead, ...MergeArguments<LeftTail, RightTail>] : Left : Right;
|
|
5
|
+
type NativeFunctionArguments<FunctionType extends (...args: never[]) => unknown> = FunctionType extends {
|
|
6
|
+
(...args: infer First): unknown;
|
|
7
|
+
(...args: infer Last): unknown;
|
|
8
|
+
} ? MergeArguments<NativeArguments<First>, NativeArguments<Last>> : NativeArguments<Parameters<FunctionType>>;
|
|
9
|
+
type ImGuiNativeFunctions = {
|
|
10
|
+
[Name in keyof ImGuiFunctions]: (...args: NativeFunctionArguments<ImGuiFunctions[Name]>) => ReturnType<ImGuiFunctions[Name]>;
|
|
11
|
+
};
|
|
12
|
+
interface ImGuiStructViews {
|
|
13
|
+
viewImDrawCmd(handle: ImDrawCmd): NativeStructMapping;
|
|
14
|
+
viewImDrawData(handle: ImDrawData): NativeStructMapping;
|
|
15
|
+
viewImDrawList(handle: ImDrawList): NativeStructMapping;
|
|
16
|
+
viewImDrawListSplitter(handle: ImDrawListSplitter): NativeStructMapping;
|
|
17
|
+
viewImFontAtlas(handle: ImFontAtlas): NativeStructMapping;
|
|
18
|
+
viewImFontAtlasCustomRect(handle: ImFontAtlasCustomRect): NativeStructMapping;
|
|
19
|
+
viewImFontConfig(handle: ImFontConfig): NativeStructMapping;
|
|
20
|
+
viewImFontGlyph(handle: ImFontGlyph): NativeStructMapping & {
|
|
21
|
+
bitfields: {
|
|
22
|
+
Colored: number;
|
|
23
|
+
Visible: number;
|
|
24
|
+
Codepoint: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
viewImGuiIO(handle: ImGuiIO): NativeStructMapping;
|
|
28
|
+
viewImGuiInputTextCallbackData(handle: ImGuiInputTextCallbackData): NativeStructMapping;
|
|
29
|
+
viewImGuiListClipper(handle: ImGuiListClipper): NativeStructMapping;
|
|
30
|
+
viewImGuiMultiSelectIO(handle: ImGuiMultiSelectIO): NativeStructMapping;
|
|
31
|
+
viewImGuiPayload(handle: ImGuiPayload): NativeStructMapping;
|
|
32
|
+
viewImGuiPlatformIO(handle: ImGuiPlatformIO): NativeStructMapping;
|
|
33
|
+
viewImGuiSelectionBasicStorage(handle: ImGuiSelectionBasicStorage): NativeStructMapping;
|
|
34
|
+
viewImGuiStyle(handle: ImGuiStyle): NativeStructMapping;
|
|
35
|
+
viewImGuiTableSortSpecs(handle: ImGuiTableSortSpecs): NativeStructMapping;
|
|
36
|
+
viewImGuiTextFilter(handle: ImGuiTextFilter): NativeStructMapping;
|
|
37
|
+
viewImGuiViewport(handle: ImGuiViewport): NativeStructMapping;
|
|
38
|
+
}
|
|
39
|
+
export type ImGuiNativeBinding = ImGuiNativeFunctions & ImGuiStructViews;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ImGuiNativeBinding } from './imgui-binding';
|
|
2
|
+
import type { FormatArgument } from '../formatted';
|
|
3
|
+
import type { FontTextureView, SelectedItem } from '../references';
|
|
4
|
+
import type { ImDrawCmd, ImDrawList, ImFontAtlas, ImFontGlyphRangesBuilder, ImGuiIO, ImGuiInputTextCallbackData, ImGuiListClipper, ImGuiSelectionBasicStorage, ImGuiStyle, ImGuiStorage, ImGuiTextBuffer, ImGuiTextFilter, ImVec2Like, ImVec4Like, NativeStructMapping } from '../types';
|
|
5
|
+
interface NativeBinding {
|
|
6
|
+
readonly errorState: {
|
|
7
|
+
prototype: unknown;
|
|
8
|
+
};
|
|
9
|
+
init(window: object, loadDefaultFont: boolean): boolean;
|
|
10
|
+
shutdown(window: object): void;
|
|
11
|
+
setCurrentWindow(window: object): void;
|
|
12
|
+
processEvent(window: object, event: object): void;
|
|
13
|
+
update(window: object, seconds: number): void;
|
|
14
|
+
render(window: object): void;
|
|
15
|
+
updateFontTexture(): boolean;
|
|
16
|
+
getIO(): NativeStructMapping;
|
|
17
|
+
getStyle(): NativeStructMapping;
|
|
18
|
+
ioFonts(io: ImGuiIO): ImFontAtlas | null;
|
|
19
|
+
styleColors(style: ImGuiStyle): ArrayBuffer;
|
|
20
|
+
getGlyphRangesDefault(atlas: ImFontAtlas): Uint16Array;
|
|
21
|
+
getGlyphRangesGreek(atlas: ImFontAtlas): Uint16Array;
|
|
22
|
+
getGlyphRangesKorean(atlas: ImFontAtlas): Uint16Array;
|
|
23
|
+
getGlyphRangesJapanese(atlas: ImFontAtlas): Uint16Array;
|
|
24
|
+
getGlyphRangesChineseFull(atlas: ImFontAtlas): Uint16Array;
|
|
25
|
+
getGlyphRangesChineseSimplifiedCommon(atlas: ImFontAtlas): Uint16Array;
|
|
26
|
+
getGlyphRangesCyrillic(atlas: ImFontAtlas): Uint16Array;
|
|
27
|
+
getGlyphRangesThai(atlas: ImFontAtlas): Uint16Array;
|
|
28
|
+
getGlyphRangesVietnamese(atlas: ImFontAtlas): Uint16Array;
|
|
29
|
+
InputTextEx(label: string | Uint8Array, buffer: Uint8Array, bufferSize: number, flags: number, callback: ((data: ImGuiInputTextCallbackData, userData: bigint | null) => number) | null, userData: bigint | null): boolean;
|
|
30
|
+
InputTextMultilineEx(label: string | Uint8Array, buffer: Uint8Array, bufferSize: number, size: ImVec2Like, flags: number, callback: ((data: ImGuiInputTextCallbackData, userData: bigint | null) => number) | null, userData: bigint | null): boolean;
|
|
31
|
+
ComboCallbackEx(label: string | Uint8Array, currentItem: Int32Array, getter: (index: number, userData: bigint | null) => string | null, userData: bigint | null, itemsCount: number, popupHeight: number): boolean;
|
|
32
|
+
ListBoxCallbackEx(label: string | Uint8Array, currentItem: Int32Array, getter: (index: number, userData: bigint | null) => string | null, userData: bigint | null, itemsCount: number, height: number): boolean;
|
|
33
|
+
PlotLinesCallbackEx(label: string | Uint8Array, getter: (index: number, userData: bigint | null) => number, userData: bigint | null, valuesCount: number, valuesOffset: number, overlayText: string | Uint8Array | null, scaleMin: number, scaleMax: number, graphSize: ImVec2Like): void;
|
|
34
|
+
PlotHistogramCallbackEx(label: string | Uint8Array, getter: (index: number, userData: bigint | null) => number, userData: bigint | null, valuesCount: number, valuesOffset: number, overlayText: string | Uint8Array | null, scaleMin: number, scaleMax: number, graphSize: ImVec2Like): void;
|
|
35
|
+
AddCallbackEx(drawList: ImDrawList, callback: (list: ImDrawList, cmd: ImDrawCmd, userData: bigint | null) => void, userData: bigint | null): void;
|
|
36
|
+
Storage_GetIntRef(storage: ImGuiStorage, key: number, fallback: number): Int32Array;
|
|
37
|
+
Storage_GetBoolRef(storage: ImGuiStorage, key: number, fallback: boolean): Uint8Array;
|
|
38
|
+
Storage_GetFloatRef(storage: ImGuiStorage, key: number, fallback: number): Float32Array;
|
|
39
|
+
Storage_GetVoidPtrRef(storage: ImGuiStorage, key: number, fallback: bigint | null): BigUint64Array | Uint32Array;
|
|
40
|
+
FontAtlas_GetTexDataAsAlpha8(atlas: ImFontAtlas): FontTextureView | null;
|
|
41
|
+
FontAtlas_GetTexDataAsRGBA32(atlas: ImFontAtlas): FontTextureView | null;
|
|
42
|
+
FontGlyphRangesBuilder_BuildRanges(builder: ImFontGlyphRangesBuilder): Uint16Array;
|
|
43
|
+
SelectionBasicStorage_GetNextSelectedItem(storage: ImGuiSelectionBasicStorage, iterator: bigint): SelectedItem | null;
|
|
44
|
+
ImColor_SetHSV(color: Float32Array, h: number, s: number, v: number, a: number): void;
|
|
45
|
+
createFontGlyphRangesBuilder(): ImFontGlyphRangesBuilder;
|
|
46
|
+
createTextBuffer(): ImGuiTextBuffer;
|
|
47
|
+
createSelectionBasicStorage(): ImGuiSelectionBasicStorage;
|
|
48
|
+
createListClipper(): ImGuiListClipper;
|
|
49
|
+
createTextFilter(): ImGuiTextFilter;
|
|
50
|
+
Text(format: string | Uint8Array, args: readonly FormatArgument[]): void;
|
|
51
|
+
TextColored(color: ImVec4Like, format: string | Uint8Array, args: readonly FormatArgument[]): void;
|
|
52
|
+
TextDisabled(format: string | Uint8Array, args: readonly FormatArgument[]): void;
|
|
53
|
+
TextWrapped(format: string | Uint8Array, args: readonly FormatArgument[]): void;
|
|
54
|
+
LabelText(label: string | Uint8Array, format: string | Uint8Array, args: readonly FormatArgument[]): void;
|
|
55
|
+
BulletText(format: string | Uint8Array, args: readonly FormatArgument[]): void;
|
|
56
|
+
TreeNodeStr(id: string | Uint8Array, format: string | Uint8Array, args: readonly FormatArgument[]): boolean;
|
|
57
|
+
TreeNodePtr(id: bigint | null, format: string | Uint8Array, args: readonly FormatArgument[]): boolean;
|
|
58
|
+
TreeNodeExStr(id: string | Uint8Array, flags: number, format: string | Uint8Array, args: readonly FormatArgument[]): boolean;
|
|
59
|
+
TreeNodeExPtr(id: bigint | null, flags: number, format: string | Uint8Array, args: readonly FormatArgument[]): boolean;
|
|
60
|
+
SetTooltip(format: string | Uint8Array, args: readonly FormatArgument[]): void;
|
|
61
|
+
SetItemTooltip(format: string | Uint8Array, args: readonly FormatArgument[]): void;
|
|
62
|
+
LogText(format: string | Uint8Array, args: readonly FormatArgument[]): void;
|
|
63
|
+
DebugLog(format: string | Uint8Array, args: readonly FormatArgument[]): void;
|
|
64
|
+
TextBuffer_appendf(buffer: ImGuiTextBuffer, format: string | Uint8Array, args: readonly FormatArgument[]): void;
|
|
65
|
+
}
|
|
66
|
+
export declare const native: NativeBinding & ImGuiNativeBinding;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.native = void 0;
|
|
4
|
+
const node_module_1 = require("node:module");
|
|
5
|
+
const requireNative = (0, node_module_1.createRequire)(__filename);
|
|
6
|
+
// Compiled imgui native module.
|
|
7
|
+
exports.native = requireNative('../../build/Release/imgui.node');
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Window } from 'sfml.js';
|
|
2
|
+
export type SfmlNativeHandle = object;
|
|
3
|
+
interface NativeStructMapping {
|
|
4
|
+
readonly buffers: ArrayBuffer[];
|
|
5
|
+
readonly fields: Record<string, readonly [string, number, number]>;
|
|
6
|
+
}
|
|
7
|
+
type NativeStructFactory = <T extends object>(mapping: NativeStructMapping, extra?: Partial<T>) => Readonly<T>;
|
|
8
|
+
export declare const nativeStruct: NativeStructFactory;
|
|
9
|
+
/**
|
|
10
|
+
* Map native field descriptions to writable shared-memory accessors.
|
|
11
|
+
*
|
|
12
|
+
* @zh 将原生字段描述映射为可写的共享内存访问器。
|
|
13
|
+
* @ja ネイティブのフィールド記述を共有メモリの読み書きアクセサーに変換します。
|
|
14
|
+
* @ko 네이티브 필드 설명을 쓰기 가능한 공유 메모리 접근자로 매핑합니다.
|
|
15
|
+
*
|
|
16
|
+
* @param mapping - Native-owned buffers and field offsets for this view.
|
|
17
|
+
* @zh mapping - 此视图使用的原生持有缓冲区及字段偏移。
|
|
18
|
+
* @ja mapping - ビューが使うネイティブ所有バッファーとフィールドのオフセットです。
|
|
19
|
+
* @ko mapping - 이 뷰에 사용할 네이티브 소유 버퍼와 필드 오프셋입니다.
|
|
20
|
+
*
|
|
21
|
+
* @returns Accessors that read and write the supplied buffers directly.
|
|
22
|
+
* @zh 直接读写所提供缓冲区的访问器对象。
|
|
23
|
+
* @ja 指定されたバッファーを直接読み書きするアクセサーオブジェクトです。
|
|
24
|
+
* @ko 제공된 버퍼를 직접 읽고 쓰는 접근자 객체입니다.
|
|
25
|
+
*/
|
|
26
|
+
export declare function writableStruct<T extends object>(mapping: NativeStructMapping): T;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve the sfml.js window handle consumed by the native addon.
|
|
29
|
+
*
|
|
30
|
+
* @zh 获取原生扩展使用的 sfml.js 窗口句柄。
|
|
31
|
+
* @ja ネイティブアドオンが使用する sfml.js ウィンドウハンドルを取得します。
|
|
32
|
+
* @ko 네이티브 애드온이 사용하는 sfml.js 창 핸들을 가져옵니다.
|
|
33
|
+
*
|
|
34
|
+
* @param window - sfml.js window with its native graphics-state handle.
|
|
35
|
+
* @zh window - 持有原生图形状态句柄的 sfml.js 窗口。
|
|
36
|
+
* @ja window - ネイティブの描画状態ハンドルを持つ sfml.js ウィンドウです。
|
|
37
|
+
* @ko window - 네이티브 그래픽 상태 핸들을 가진 sfml.js 창입니다.
|
|
38
|
+
*
|
|
39
|
+
* @returns Shared native handle whose internal field 0 identifies the window.
|
|
40
|
+
* @zh 内部字段 0 标识该窗口的共享原生句柄。
|
|
41
|
+
* @ja 内部フィールド 0 でウィンドウを識別する共有ネイティブハンドルです。
|
|
42
|
+
* @ko 내부 필드 0으로 창을 식별하는 공유 네이티브 핸들입니다.
|
|
43
|
+
*/
|
|
44
|
+
export declare function windowNativeHandle(window: Window): SfmlNativeHandle;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.windowNativeHandle = exports.writableStruct = exports.nativeStruct = void 0;
|
|
4
|
+
const node_module_1 = require("node:module");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const littleEndian = new Uint8Array(new Uint32Array([1]).buffer)[0] === 1;
|
|
7
|
+
const readers = {
|
|
8
|
+
i8: (view, offset) => view.getInt8(offset),
|
|
9
|
+
u8: (view, offset) => view.getUint8(offset),
|
|
10
|
+
i16: (view, offset) => view.getInt16(offset, littleEndian),
|
|
11
|
+
u16: (view, offset) => view.getUint16(offset, littleEndian),
|
|
12
|
+
i32: (view, offset) => view.getInt32(offset, littleEndian),
|
|
13
|
+
bool: (view, offset) => view.getUint8(offset) !== 0,
|
|
14
|
+
u32: (view, offset) => view.getUint32(offset, littleEndian),
|
|
15
|
+
f32: (view, offset) => view.getFloat32(offset, littleEndian),
|
|
16
|
+
f64: (view, offset) => view.getFloat64(offset, littleEndian),
|
|
17
|
+
i64: (view, offset) => view.getBigInt64(offset, littleEndian),
|
|
18
|
+
u64: (view, offset) => view.getBigUint64(offset, littleEndian),
|
|
19
|
+
size64: (view, offset) => Number(view.getBigUint64(offset, littleEndian)),
|
|
20
|
+
};
|
|
21
|
+
const writers = {
|
|
22
|
+
i8: (view, offset, value) => view.setInt8(offset, Number(value)),
|
|
23
|
+
u8: (view, offset, value) => view.setUint8(offset, Number(value)),
|
|
24
|
+
i16: (view, offset, value) => view.setInt16(offset, Number(value), littleEndian),
|
|
25
|
+
u16: (view, offset, value) => view.setUint16(offset, Number(value), littleEndian),
|
|
26
|
+
i32: (view, offset, value) => view.setInt32(offset, Number(value), littleEndian),
|
|
27
|
+
bool: (view, offset, value) => view.setUint8(offset, value ? 1 : 0),
|
|
28
|
+
u32: (view, offset, value) => view.setUint32(offset, Number(value), littleEndian),
|
|
29
|
+
f32: (view, offset, value) => view.setFloat32(offset, Number(value), littleEndian),
|
|
30
|
+
f64: (view, offset, value) => view.setFloat64(offset, Number(value), littleEndian),
|
|
31
|
+
i64: (view, offset, value) => view.setBigInt64(offset, BigInt(value), littleEndian),
|
|
32
|
+
u64: (view, offset, value) => view.setBigUint64(offset, BigInt(value), littleEndian),
|
|
33
|
+
size64: (view, offset, value) => view.setBigUint64(offset, BigInt(value), littleEndian),
|
|
34
|
+
};
|
|
35
|
+
const requireHere = (0, node_module_1.createRequire)(__filename);
|
|
36
|
+
// Resolve sfml.js through normal module resolution so both packages share the
|
|
37
|
+
// same Symbol instances and helpers.
|
|
38
|
+
const entry = requireHere.resolve('sfml.js');
|
|
39
|
+
const packageRoot = (0, node_path_1.dirname)((0, node_path_1.dirname)(entry));
|
|
40
|
+
const graphics = requireHere((0, node_path_1.join)(packageRoot, 'dist/internal/graphics-state.js'));
|
|
41
|
+
const structure = requireHere((0, node_path_1.join)(packageRoot, 'dist/internal/struct-view.js'));
|
|
42
|
+
// Read a native-owned readonly struct view; field offsets come from native.
|
|
43
|
+
exports.nativeStruct = structure.nativeStruct;
|
|
44
|
+
/**
|
|
45
|
+
* Map native field descriptions to writable shared-memory accessors.
|
|
46
|
+
*
|
|
47
|
+
* @zh 将原生字段描述映射为可写的共享内存访问器。
|
|
48
|
+
* @ja ネイティブのフィールド記述を共有メモリの読み書きアクセサーに変換します。
|
|
49
|
+
* @ko 네이티브 필드 설명을 쓰기 가능한 공유 메모리 접근자로 매핑합니다.
|
|
50
|
+
*
|
|
51
|
+
* @param mapping - Native-owned buffers and field offsets for this view.
|
|
52
|
+
* @zh mapping - 此视图使用的原生持有缓冲区及字段偏移。
|
|
53
|
+
* @ja mapping - ビューが使うネイティブ所有バッファーとフィールドのオフセットです。
|
|
54
|
+
* @ko mapping - 이 뷰에 사용할 네이티브 소유 버퍼와 필드 오프셋입니다.
|
|
55
|
+
*
|
|
56
|
+
* @returns Accessors that read and write the supplied buffers directly.
|
|
57
|
+
* @zh 直接读写所提供缓冲区的访问器对象。
|
|
58
|
+
* @ja 指定されたバッファーを直接読み書きするアクセサーオブジェクトです。
|
|
59
|
+
* @ko 제공된 버퍼를 직접 읽고 쓰는 접근자 객체입니다.
|
|
60
|
+
*/
|
|
61
|
+
function writableStruct(mapping) {
|
|
62
|
+
const views = mapping.buffers.map(buffer => new DataView(buffer));
|
|
63
|
+
const result = {};
|
|
64
|
+
for (const [key, [type, region, offset]] of Object.entries(mapping.fields)) {
|
|
65
|
+
const view = views[region];
|
|
66
|
+
const read = readers[type];
|
|
67
|
+
const write = writers[type];
|
|
68
|
+
Object.defineProperty(result, key, {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
configurable: false,
|
|
71
|
+
get: () => read(view, offset),
|
|
72
|
+
set: (value) => write(view, offset, value),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
exports.writableStruct = writableStruct;
|
|
78
|
+
/**
|
|
79
|
+
* Retrieve the sfml.js window handle consumed by the native addon.
|
|
80
|
+
*
|
|
81
|
+
* @zh 获取原生扩展使用的 sfml.js 窗口句柄。
|
|
82
|
+
* @ja ネイティブアドオンが使用する sfml.js ウィンドウハンドルを取得します。
|
|
83
|
+
* @ko 네이티브 애드온이 사용하는 sfml.js 창 핸들을 가져옵니다.
|
|
84
|
+
*
|
|
85
|
+
* @param window - sfml.js window with its native graphics-state handle.
|
|
86
|
+
* @zh window - 持有原生图形状态句柄的 sfml.js 窗口。
|
|
87
|
+
* @ja window - ネイティブの描画状態ハンドルを持つ sfml.js ウィンドウです。
|
|
88
|
+
* @ko window - 네이티브 그래픽 상태 핸들을 가진 sfml.js 창입니다.
|
|
89
|
+
*
|
|
90
|
+
* @returns Shared native handle whose internal field 0 identifies the window.
|
|
91
|
+
* @zh 内部字段 0 标识该窗口的共享原生句柄。
|
|
92
|
+
* @ja 内部フィールド 0 でウィンドウを識別する共有ネイティブハンドルです。
|
|
93
|
+
* @ko 내부 필드 0으로 창을 식별하는 공유 네이티브 핸들입니다.
|
|
94
|
+
*/
|
|
95
|
+
function windowNativeHandle(window) {
|
|
96
|
+
const handle = window[graphics.graphicsNative];
|
|
97
|
+
if (typeof handle !== 'object' || handle === null) {
|
|
98
|
+
throw new TypeError('Expected an sfml.js Window');
|
|
99
|
+
}
|
|
100
|
+
return handle;
|
|
101
|
+
}
|
|
102
|
+
exports.windowNativeHandle = windowNativeHandle;
|