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/livecode/api.h | |
| parent | add basic livecode toolbar (diff) | |
| download | inkscape-81fe2250a70c892eeb195725117d566a042e5c93.tar.gz inkscape-81fe2250a70c892eeb195725117d566a042e5c93.zip | |
add draft janet interface for livecoding
Diffstat (limited to 'src/livecode/api.h')
| -rw-r--r-- | src/livecode/api.h | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/src/livecode/api.h b/src/livecode/api.h deleted file mode 100644 index d2974a01d..000000000 --- a/src/livecode/api.h +++ /dev/null @@ -1,101 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -#ifndef INK_LIVECODE_API_H -#define INK_LIVECODE_API_H - -/* - * API for the livecoding script language - * - * Authors: - * Sol Bekic <s+inkscape@s-ol.nu> - * Copyright (C) 2019 Authors - * - * Released under GNU GPL v2+, read the file 'COPYING' for more information. - */ - -#include <cstddef> -#include <2geom/point.h> -#include <2geom/rect.h> -#include <gdk/gdk.h> - -#include "xml/repr.h" -#include "desktop.h" -#include "livecode/input.h" - - -class SPDocument; -class SPItem; - -namespace Inkscape { -namespace Livecode { - -class Mouse; - -class API { -public: - API(SPDesktop *desktop); - ~API(); - - Inkscape::XML::Node *make_rect(Geom::Rect const &rect, SPCSSAttr *css = nullptr); - Inkscape::XML::Node *make_line(Geom::Point const &p1, Geom::Point const &p2, SPCSSAttr *css = nullptr); - Inkscape::XML::Node *make_path(Glib::ustring d, Geom::Point const &pos = Geom::Point(), SPCSSAttr *css = nullptr); - Inkscape::XML::Node *make_arrow(Geom::Point const &from, Geom::Point const &to, SPCSSAttr *css = nullptr); - - bool input_point(Glib::ustring const &id, Geom::Point *point); - bool input_line(Glib::ustring const &id, Geom::Point *p1, Geom::Point *p2); - bool input_arrow(Glib::ustring const &id, Geom::Point *from, Geom::Point *to); - bool input_rect(Glib::ustring const &id, Geom::Rect *rect); - - void draw_doc(Glib::ustring const &id, Inkscape::XML::Node *item); - void draw_ui(Glib::ustring const &id, Inkscape::XML::Node *item); - - void push_event(GdkEvent *event); - void setup_frame(); - void finish_frame(); - - inline Geom::Affine ui2dt() const { - return doc_root->i2doc_affine(); - } - inline Geom::Affine dt2ui() const { - return ui2dt().inverse(); - } - - inline Geom::Affine ui2doc() const { - return desktop->w2d(); - } - inline Geom::Affine doc2ui() const { - return ui2doc().inverse(); - } - inline Geom::Affine ui2doc_vec() const { - return desktop->w2d().withoutTranslation(); - } - inline Geom::Affine doc2ui_vec() const { - return ui2doc_vec().inverse(); - } - - Mouse const &mouse(); - -private: - SPDesktop *desktop; - SPItem *doc_root, *ui_root; - - Mouse _mouse; - - Glib::ustring hot, active; - std::vector<SPItem *> drawn_items; -}; - -} -} - -#endif // INK_LIVECODE_API_H - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : |
