From 1820294e9ea199058ba4d0626b23992e08210b44 Mon Sep 17 00:00:00 2001 From: s-ol Date: Mon, 2 Dec 2019 21:41:05 +0100 Subject: move script to its own file --- src/livecode/script.h | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/livecode/script.h (limited to 'src/livecode/script.h') diff --git a/src/livecode/script.h b/src/livecode/script.h new file mode 100644 index 000000000..9891d5c21 --- /dev/null +++ b/src/livecode/script.h @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#ifndef INK_LIVECODE_SCRIPT_H +#define INK_LIVECODE_SCRIPT_H + +/* + * A Janet script for the livecoding experience + * + * Authors: + * Sol Bekic + * Copyright (C) 2019 Authors + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#include +#include +#include +#include + +namespace Inkscape { +namespace Livecode { + +class Script { +public: + Script(JanetTable *env, std::string const &path); + + void frame(); + void commit(); + +private: + JanetTable *env; + JanetFunction *function; + Glib::RefPtr file; + Glib::RefPtr monitor; + + void reload(); + void file_changed(const Glib::RefPtr& file, + const Glib::RefPtr& other_file, + Gio::FileMonitorEvent event); +}; + +} +} + +#endif // INK_LIVECODE_SCRIPT_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 : -- cgit v1.2.3