diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2019-12-02 20:41:05 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2019-12-02 20:41:05 +0000 |
| commit | 1820294e9ea199058ba4d0626b23992e08210b44 (patch) | |
| tree | 8b6574d814b991dbcca3eaa92e557402bfee6b3e /src/livecode/script.h | |
| parent | more janet bindings (diff) | |
| download | inkscape-1820294e9ea199058ba4d0626b23992e08210b44.tar.gz inkscape-1820294e9ea199058ba4d0626b23992e08210b44.zip | |
move script to its own file
Diffstat (limited to 'src/livecode/script.h')
| -rw-r--r-- | src/livecode/script.h | 56 |
1 files changed, 56 insertions, 0 deletions
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 <s+inkscape@s-ol.nu> + * Copyright (C) 2019 Authors + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#include <string> +#include <giomm/file.h> +#include <giomm/filemonitor.h> +#include <janet.h> + +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<Gio::File> file; + Glib::RefPtr<Gio::FileMonitor> monitor; + + void reload(); + void file_changed(const Glib::RefPtr<Gio::File>& file, + const Glib::RefPtr<Gio::File>& 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 : |
