diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2019-12-02 14:32:42 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2019-12-02 14:32:42 +0000 |
| commit | 81fe2250a70c892eeb195725117d566a042e5c93 (patch) | |
| tree | e2c70bd1b0f9e9d9063f6ff7aa11f6fa6b8ced80 /src/ui/tools/livecode-tool.cpp | |
| parent | add basic livecode toolbar (diff) | |
| download | inkscape-81fe2250a70c892eeb195725117d566a042e5c93.tar.gz inkscape-81fe2250a70c892eeb195725117d566a042e5c93.zip | |
add draft janet interface for livecoding
Diffstat (limited to 'src/ui/tools/livecode-tool.cpp')
| -rw-r--r-- | src/ui/tools/livecode-tool.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
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<Gdk::FrameClock> 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; } |
