summaryrefslogtreecommitdiffstats
path: root/src/extension/loader.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
commit35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch)
tree657d15a03cc46bd099fc2c6546a7a4ad43815d9f /src/extension/loader.h
parentInitial commit. (diff)
downloadinkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz
inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip
Adding upstream version 1.0.2.upstream/1.0.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/extension/loader.h')
-rw-r--r--src/extension/loader.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/extension/loader.h b/src/extension/loader.h
new file mode 100644
index 0000000..c6adbe2
--- /dev/null
+++ b/src/extension/loader.h
@@ -0,0 +1,77 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/** @file
+ * Loader for external plug-ins.
+ *//*
+ *
+ * Authors:
+ * Moritz Eberl <moritz@semiodesk.com>
+ *
+ * Copyright (C) 2016 Authors
+ *
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information.
+ */
+
+#ifndef INKSCAPE_EXTENSION_LOADER_H_
+#define INKSCAPE_EXTENSION_LOADER_H_
+
+#include "extension.h"
+
+
+namespace Inkscape {
+
+namespace XML {
+class Document;
+}
+
+namespace Extension {
+
+/** This class contains the mechanism to load c++ plugins dynamically.
+*/
+class Loader {
+
+public:
+ /**
+ * Sets a base directory where to look for the actual plugin to load.
+ *
+ * @param dir is the path where the plugin should be loaded from.
+ */
+ void set_base_directory(std::string dir) {
+ _baseDirectory = dir;
+ }
+
+ /**
+ * Loads plugin dependencies which are needed for the plugin to load.
+ *
+ * @param dep
+ */
+ bool load_dependency(Dependency *dep);
+
+ /**
+ * Load the actual implementation of a plugin supplied by the plugin.
+ *
+ * @param doc The xml representation of the INX extension configuration.
+ * @return The implementation of the extension loaded from the plugin.
+ */
+ Implementation::Implementation *load_implementation(Inkscape::XML::Document *doc);
+
+private:
+ std::string _baseDirectory; /**< The base directory to load a plugin from */
+
+
+};
+
+} // namespace Extension
+} // namespace Inkscape */
+
+#endif // _LOADER_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: