diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:50:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:50:49 +0000 |
commit | c853ffb5b2f75f5a889ed2e3ef89b818a736e87a (patch) | |
tree | 7d13a0883bb7936b84d6ecdd7bc332b41ed04bee /src/extension/internal/template-base.h | |
parent | Initial commit. (diff) | |
download | inkscape-upstream.tar.xz inkscape-upstream.zip |
Adding upstream version 1.3+ds.upstream/1.3+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/extension/internal/template-base.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/extension/internal/template-base.h b/src/extension/internal/template-base.h new file mode 100644 index 0000000..02481d5 --- /dev/null +++ b/src/extension/internal/template-base.h @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * A base template generator used by internal template types. + * + * Authors: + * Martin Owens <doctormo@geek-2.com> + * + * Copyright (C) 2022 Authors + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#ifndef EXTENSION_INTERNAL_TEMPLATE_BASE_H +#define EXTENSION_INTERNAL_TEMPLATE_BASE_H + +#include <glib.h> + +#include "2geom/point.h" +#include "extension/extension.h" +#include "extension/implementation/implementation.h" +#include "extension/system.h" +#include "extension/template.h" +#include "util/units.h" + +class SPDocument; +class SPPage; + +namespace Inkscape { +namespace Extension { +namespace Internal { + +class TemplateBase : public Inkscape::Extension::Implementation::Implementation +{ +public: + bool check(Inkscape::Extension::Extension *module) override { return true; }; + + SPDocument *new_from_template(Inkscape::Extension::Template *tmod) override; + void resize_to_template(Inkscape::Extension::Template *tmod, SPDocument *doc, SPPage *page) override; + bool match_template_size(Inkscape::Extension::Template *tmod, double width, double height) override; + +protected: + virtual Geom::Point get_template_size(Inkscape::Extension::Template *tmod) const; + virtual Geom::Point get_template_size(Inkscape::Extension::Template *tmod, const Util::Unit *unit) const; + virtual const Util::Unit *get_template_unit(Inkscape::Extension::Template *tmod) const; + +private: +}; + +} // namespace Internal +} // namespace Extension +} // namespace Inkscape +#endif /* EXTENSION_INTERNAL_TEMPLATE_BASE_H */ |