From 81fe2250a70c892eeb195725117d566a042e5c93 Mon Sep 17 00:00:00 2001 From: s-ol Date: Mon, 2 Dec 2019 15:32:42 +0100 Subject: add draft janet interface for livecoding --- src/ui/tools/livecode-tool.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/ui/tools/livecode-tool.cpp') diff --git a/src/ui/tools/livecode-tool.cpp b/src/ui/tools/livecode-tool.cpp index 0071f47b3..8b096dbf0 100644 --- a/src/ui/tools/livecode-tool.cpp +++ b/src/ui/tools/livecode-tool.cpp @@ -53,7 +53,7 @@ const std::string LivecodeTool::prefsPath = "/tools/livecode"; LivecodeTool::LivecodeTool() : ToolBase(nullptr, false) - , api(SP_ACTIVE_DESKTOP) + , context(SP_ACTIVE_DESKTOP) { } @@ -83,25 +83,30 @@ bool LivecodeTool::root_handler(GdkEvent* event) ret = ToolBase::root_handler(event); if (!ret) { - api.push_event(event); + context.push_event(event); } return ret; } +void LivecodeTool::load_script(Glib::ustring const &path) +{ + context.load_script(path); +} + static Geom::Point p(100, 100); static Geom::Point a(50, 100), b(120, 300); static Geom::Rect rect(Geom::Point(20, 200), Geom::Point(220, 20)); bool LivecodeTool::handle_tick(Glib::RefPtr const &frame_clock) { - api.setup_frame(); + context.setup_frame(); - api.input_point("p", &p); - api.input_arrow("a->b", &a, &b); - api.input_rect("rect", &rect); + context.input_point("p", &p); + context.input_arrow("a->b", &a, &b); + context.input_rect("rect", &rect); - api.finish_frame(); + context.finish_frame(); return true; } -- cgit v1.2.3