Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions daslib/imgui_node_editor_lint.das
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ module imgui_node_editor_lint shared private
//! lint / daspkg install).

require daslib/ast_boost
require strings

let private ALLOWED_NE : table<string> <- {
// Geometry / topology / selection reads — pure queries, no host needed (the
Expand Down Expand Up @@ -75,8 +74,9 @@ class NodeEditorLintVisitor : AstVisitor {
}

def override preVisitExprCall(var expr : ExprCall?) : void {
// Also skips macro-synthesized call sites: their `at` points at the macro template's file, not the user's.
// a spliced wrapper body is `generated` and carries the CALL SITE's location, so the file compare below cannot see it
if (expr.func == null || expr.func._module == null
|| expr.genFlags.generated
|| (current_function != null
&& (current_function.flags.generated
|| (current_function.at.fileInfo != null
Expand All @@ -86,7 +86,7 @@ class NodeEditorLintVisitor : AstVisitor {
let fname = string(expr.func.name)
if (!key_exists(ALLOWED_NE, fname)) {
compiling_program() |> macro_error(expr.at,
"NODEEDITOR001: raw imgui_node_editor::{fname} is forbidden use the wrapper in modules/dasImguiNodeEditor/daslib/imgui_node_editor_boost_v2.das (node/pin/link, begin_create/begin_delete + query/accept/reject, get_selected_*/select_*/clear_selection, create_node_editor/node_editor). Bypassing the create/delete wrappers breaks live-command queue injection. If {fname} is a genuinely host-agnostic read, extend ALLOWED_NE in imgui_node_editor_lint.das. Per-file escape: `options _allow_node_editor_native = true`.")
"NODEEDITOR001: raw imgui_node_editor::{fname} is forbidden - use the wrapper in modules/dasImguiNodeEditor/daslib/imgui_node_editor_boost_v2.das (node/pin/link, begin_create/begin_delete + query/accept/reject, get_selected_*/select_*/clear_selection, create_node_editor/node_editor). Bypassing the create/delete wrappers breaks live-command queue injection. If {fname} is a genuinely host-agnostic read, extend ALLOWED_NE in imgui_node_editor_lint.das. Per-file escape: `options _allow_node_editor_native = true`.")
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/cb_dasIMGUI_NODE_EDITOR.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace das {

template <> struct typeFactory<ax::NodeEditor::NodeId> {
static TypeDeclPtr make(const ModuleLibrary &) {
auto t = new TypeDecl(Type::tInt);
auto t = new TypeDecl(Type::tInt, cppBindingLineInfo());
t->alias = "ax::NodeEditor::NodeId";
t->aotAlias = true;
return t;
Expand All @@ -31,7 +31,7 @@ template <> struct cast_res<ax::NodeEditor::NodeId> {

template <> struct typeFactory<ax::NodeEditor::PinId> {
static TypeDeclPtr make(const ModuleLibrary &) {
auto t = new TypeDecl(Type::tInt);
auto t = new TypeDecl(Type::tInt, cppBindingLineInfo());
t->alias = "ax::NodeEditor::PinId";
t->aotAlias = true;
return t;
Expand All @@ -54,7 +54,7 @@ template <> struct cast_res<ax::NodeEditor::PinId> {

template <> struct typeFactory<ax::NodeEditor::LinkId> {
static TypeDeclPtr make(const ModuleLibrary &) {
auto t = new TypeDecl(Type::tInt);
auto t = new TypeDecl(Type::tInt, cppBindingLineInfo());
t->alias = "ax::NodeEditor::LinkId";
t->aotAlias = true;
return t;
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/test_clipboard_tutorial.das
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ require daslib/json_boost public
//! it. The node count confirms the app's clipboard recreated the topology.
//!
//! imgui-node-editor checks io.KeyCtrl directly, so the user chord is Ctrl on every platform
//! (NOT Cmd on macOS — unlike an ImGui InputText). The synthetic AddKeyEvent path swaps
//! Ctrl/Super under ConfigMacOSXBehaviors, so this test feeds Super there to surface io.KeyCtrl.
//! (NOT Cmd on macOS - unlike an ImGui InputText). Synth keys are LOGICAL: dasImgui pre-swaps
//! Ctrl/Super under ConfigMacOSXBehaviors to cancel ImGui's own AddKeyEvent swap
//! (imgui_boost_runtime.das), so feeding Ctrl lands as io.KeyCtrl everywhere - feeding Super
//! there double-swaps and no chord fires.
//! Distinct from test_clipboard.das / test_shortcuts.das, which drive shader_graph through the
//! ne_shortcut INJECTION rail; this proves the real key chord routes through the same
//! accept_<kind> path end to end.
Expand All @@ -31,9 +33,7 @@ def test_clipboard_tutorial(t : T?) {
t |> success(s.handle != uint64(0), "editor handle present")
if (s.handle == uint64(0)) return
let canvas = s.canvas
var initial_snap = ne_snapshot(s)
let macos = initial_snap?["io"]?["config_macos_behaviors"] ?? false
let shortcut_mod = macos ? "Super" : "Ctrl"
let shortcut_mod = "Ctrl"

t |> success(ne_wait_widget(s, "node_1", 15.0f) != null, "seed graph rendered")
t |> equal(ne_node_count(s), 2, "2 seed nodes initially")
Expand Down