Debian Codegraph @

editor/export/editor_export_platform_extension.h

raw symbols SCIP
1 /**************************************************************************/
2 /* editor_export_platform_extension.h */
3 /**************************************************************************/
4 /* This file is part of: */
5 /* GODOT ENGINE */
6 /* https://godotengine.org */
7 /**************************************************************************/
8 /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9 /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10 /* */
11 /* Permission is hereby granted, free of charge, to any person obtaining */
12 /* a copy of this software and associated documentation files (the */
13 /* "Software"), to deal in the Software without restriction, including */
14 /* without limitation the rights to use, copy, modify, merge, publish, */
15 /* distribute, sublicense, and/or sell copies of the Software, and to */
16 /* permit persons to whom the Software is furnished to do so, subject to */
17 /* the following conditions: */
18 /* */
19 /* The above copyright notice and this permission notice shall be */
20 /* included in all copies or substantial portions of the Software. */
21 /* */
22 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26 /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29 /**************************************************************************/
30
31 #pragma once
32
33 #include "core/object/gdvirtual.gen.inc"
34 #include "core/variant/typed_array.h"
35 #include "editor/export/editor_export_platform.h"
36 #include "editor/export/editor_export_preset.h"
37
38 class ImageTexture;
39
40 class EditorExportPlatformExtension : public EditorExportPlatform {
41 GDCLASS(EditorExportPlatformExtension, EditorExportPlatform);
42
43 mutable String config_error;
44 mutable bool config_missing_templates = false;
45
46 protected:
47 static void _bind_methods();
48
49 public:
50 virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) const override;
51 GDVIRTUAL1RC_REQUIRED(Vector<String>, _get_preset_features, Ref<EditorExportPreset>);
52
53 virtual bool is_executable(const String &p_path) const override;
54 GDVIRTUAL1RC(bool, _is_executable, const String &);
55
56 virtual void get_export_options(List<ExportOption> *r_options) const override;
57 GDVIRTUAL0RC(TypedArray<Dictionary>, _get_export_options);
58
59 virtual bool should_update_export_options() override;
60 GDVIRTUAL0R(bool, _should_update_export_options);
61
62 virtual bool get_export_option_visibility(const EditorExportPreset *p_preset, const String &p_option) const override;
63 GDVIRTUAL2RC(bool, _get_export_option_visibility, Ref<EditorExportPreset>, const String &);
64
65 virtual String get_export_option_warning(const EditorExportPreset *p_preset, const StringName &p_name) const override;
66 GDVIRTUAL2RC(String, _get_export_option_warning, Ref<EditorExportPreset>, const StringName &);
67
68 virtual String get_os_name() const override;
69 GDVIRTUAL0RC_REQUIRED(String, _get_os_name);
70
71 virtual String get_name() const override;
72 GDVIRTUAL0RC_REQUIRED(String, _get_name);
73
74 virtual Ref<Texture2D> get_logo() const override;
75 GDVIRTUAL0RC_REQUIRED(Ref<Texture2D>, _get_logo);
76
77 virtual bool poll_export() override;
78 GDVIRTUAL0R(bool, _poll_export);
79
80 virtual int get_options_count() const override;
81 GDVIRTUAL0RC(int, _get_options_count);
82
83 virtual String get_options_tooltip() const override;
84 GDVIRTUAL0RC(String, _get_options_tooltip);
85
86 virtual Ref<Texture2D> get_option_icon(int p_index) const override;
87 GDVIRTUAL1RC(Ref<Texture2D>, _get_option_icon, int);
88
89 #ifndef DISABLE_DEPRECATED
90 GDVIRTUAL1RC_COMPAT(_get_option_icon_bind_compat_108825, Ref<ImageTexture>, _get_option_icon, int)
91 #endif
92
93 virtual String get_option_label(int p_device) const override;
94 GDVIRTUAL1RC(String, _get_option_label, int);
95
96 virtual String get_option_tooltip(int p_device) const override;
97 GDVIRTUAL1RC(String, _get_option_tooltip, int);
98
99 virtual String get_device_architecture(int p_device) const override;
100 GDVIRTUAL1RC(String, _get_device_architecture, int);
101
102 virtual void cleanup() override;
103 GDVIRTUAL0(_cleanup);
104
105 virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, BitField<EditorExportPlatform::DebugFlags> p_debug_flags) override;
106 GDVIRTUAL3R(Error, _run, Ref<EditorExportPreset>, int, BitField<EditorExportPlatform::DebugFlags>);
107
108 virtual Ref<Texture2D> get_run_icon() const override;
109 GDVIRTUAL0RC(Ref<Texture2D>, _get_run_icon);
110
111 void set_config_error(const String &p_error) const {
112 config_error = p_error;
113 }
114 String get_config_error() const {
115 return config_error;
116 }
117
118 void set_config_missing_templates(bool p_missing_templates) const {
119 config_missing_templates = p_missing_templates;
120 }
121 bool get_config_missing_templates() const {
122 return config_missing_templates;
123 }
124
125 virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override;
126 GDVIRTUAL2RC(bool, _can_export, Ref<EditorExportPreset>, bool);
127
128 virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override;
129 GDVIRTUAL2RC_REQUIRED(bool, _has_valid_export_configuration, Ref<EditorExportPreset>, bool);
130
131 virtual bool has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const override;
132 GDVIRTUAL1RC_REQUIRED(bool, _has_valid_project_configuration, Ref<EditorExportPreset>);
133
134 virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const override;
135 GDVIRTUAL1RC_REQUIRED(Vector<String>, _get_binary_extensions, Ref<EditorExportPreset>);
136
137 virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, BitField<EditorExportPlatform::DebugFlags> p_flags = 0) override;
138 GDVIRTUAL4R_REQUIRED(Error, _export_project, Ref<EditorExportPreset>, bool, const String &, BitField<EditorExportPlatform::DebugFlags>);
139
140 virtual Error export_pack(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, BitField<EditorExportPlatform::DebugFlags> p_flags = 0) override;
141 GDVIRTUAL4R(Error, _export_pack, Ref<EditorExportPreset>, bool, const String &, BitField<EditorExportPlatform::DebugFlags>);
142
143 virtual Error export_zip(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, BitField<EditorExportPlatform::DebugFlags> p_flags = 0) override;
144 GDVIRTUAL4R(Error, _export_zip, Ref<EditorExportPreset>, bool, const String &, BitField<EditorExportPlatform::DebugFlags>);
145
146 virtual Error export_pack_patch(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, const Vector<String> &p_patches = Vector<String>(), BitField<EditorExportPlatform::DebugFlags> p_flags = 0) override;
147 GDVIRTUAL5R(Error, _export_pack_patch, Ref<EditorExportPreset>, bool, const String &, const Vector<String> &, BitField<EditorExportPlatform::DebugFlags>);
148
149 virtual Error export_zip_patch(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, const Vector<String> &p_patches = Vector<String>(), BitField<EditorExportPlatform::DebugFlags> p_flags = 0) override;
150 GDVIRTUAL5R(Error, _export_zip_patch, Ref<EditorExportPreset>, bool, const String &, const Vector<String> &, BitField<EditorExportPlatform::DebugFlags>);
151
152 virtual void get_platform_features(List<String> *r_features) const override;
153 GDVIRTUAL0RC_REQUIRED(Vector<String>, _get_platform_features);
154
155 virtual String get_debug_protocol() const override;
156 GDVIRTUAL0RC(String, _get_debug_protocol);
157
158 virtual void initialize() override;
159 GDVIRTUAL0(_initialize);
160
161 EditorExportPlatformExtension();
162 ~EditorExportPlatformExtension();
163 };