summaryrefslogtreecommitdiffstats
path: root/src/livecode/script.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/livecode/script.h')
-rw-r--r--src/livecode/script.h56
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 :