Skip to content

Commit b6f04cb

Browse files
committed
Merge pull request #107130 from timothyqiu/pure-virtual
Doc: Add "required" qualifier to methods
2 parents 37982d4 + 1ca5bc2 commit b6f04cb

37 files changed

+758
-1012
lines changed

core/doc_data.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ void DocData::method_doc_from_methodinfo(DocData::MethodDoc &p_method, const Met
127127
p_method.qualifiers = "virtual";
128128
}
129129

130+
if (p_methodinfo.flags & METHOD_FLAG_VIRTUAL_REQUIRED) {
131+
if (!p_method.qualifiers.is_empty()) {
132+
p_method.qualifiers += " ";
133+
}
134+
p_method.qualifiers += "required";
135+
}
136+
130137
if (p_methodinfo.flags & METHOD_FLAG_CONST) {
131138
if (!p_method.qualifiers.is_empty()) {
132139
p_method.qualifiers += " ";

doc/classes/AnimationNodeExtension.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<tutorials>
1010
</tutorials>
1111
<methods>
12-
<method name="_process_animation_node" qualifiers="virtual">
12+
<method name="_process_animation_node" qualifiers="virtual required">
1313
<return type="PackedFloat32Array" />
1414
<param index="0" name="playback_info" type="PackedFloat64Array" />
1515
<param index="1" name="test_only" type="bool" />

doc/classes/AudioEffect.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<link title="Audio Microphone Record Demo">https://godotengine.org/asset-library/asset/2760</link>
1313
</tutorials>
1414
<methods>
15-
<method name="_instantiate" qualifiers="virtual">
15+
<method name="_instantiate" qualifiers="virtual required">
1616
<return type="AudioEffectInstance" />
1717
<description>
1818
Override this method to customize the [AudioEffectInstance] created when this effect is applied on a bus in the editor's Audio panel, or through [method AudioServer.add_bus_effect].

doc/classes/AudioEffectInstance.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<link title="Audio buses">$DOCS_URL/tutorials/audio/audio_buses.html</link>
1111
</tutorials>
1212
<methods>
13-
<method name="_process" qualifiers="virtual">
13+
<method name="_process" qualifiers="virtual required">
1414
<return type="void" />
1515
<param index="0" name="src_buffer" type="const void*" />
1616
<param index="1" name="dst_buffer" type="AudioFrame*" />

doc/classes/AudioStreamPlayback.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
Overridable method. Should return [code]true[/code] if this playback is active and playing its audio stream.
3636
</description>
3737
</method>
38-
<method name="_mix" qualifiers="virtual">
38+
<method name="_mix" qualifiers="virtual required">
3939
<return type="int" />
4040
<param index="0" name="buffer" type="AudioFrame*" />
4141
<param index="1" name="rate_scale" type="float" />

doc/classes/AudioStreamPlaybackResampled.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
<tutorials>
88
</tutorials>
99
<methods>
10-
<method name="_get_stream_sampling_rate" qualifiers="virtual const">
10+
<method name="_get_stream_sampling_rate" qualifiers="virtual required const">
1111
<return type="float" />
1212
<description>
1313
</description>
1414
</method>
15-
<method name="_mix_resampled" qualifiers="virtual">
15+
<method name="_mix_resampled" qualifiers="virtual required">
1616
<return type="int" />
1717
<param index="0" name="dst_buffer" type="AudioFrame*" />
1818
<param index="1" name="frame_count" type="int" />

doc/classes/EditorExportPlatformExtension.xml

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@
1515
<param index="0" name="preset" type="EditorExportPreset" />
1616
<param index="1" name="debug" type="bool" />
1717
<description>
18-
[b]Optional.[/b]
1918
Returns [code]true[/code], if specified [param preset] is valid and can be exported. Use [method set_config_error] and [method set_config_missing_templates] to set error details.
2019
Usual implementation can call [method _has_valid_export_configuration] and [method _has_valid_project_configuration] to determine if export is possible.
2120
</description>
2221
</method>
2322
<method name="_cleanup" qualifiers="virtual">
2423
<return type="void" />
2524
<description>
26-
[b]Optional.[/b]
2725
Called by the editor before platform is unregistered.
2826
</description>
2927
</method>
@@ -34,7 +32,6 @@
3432
<param index="2" name="path" type="String" />
3533
<param index="3" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
3634
<description>
37-
[b]Optional.[/b]
3835
Creates a PCK archive at [param path] for the specified [param preset].
3936
This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" disabled, and PCK is selected as a file type.
4037
</description>
@@ -47,20 +44,18 @@
4744
<param index="3" name="patches" type="PackedStringArray" />
4845
<param index="4" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
4946
<description>
50-
[b]Optional.[/b]
5147
Creates a patch PCK archive at [param path] for the specified [param preset], containing only the files that have changed since the last patch.
5248
This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" enabled, and PCK is selected as a file type.
5349
[b]Note:[/b] The patches provided in [param patches] have already been loaded when this method is called and are merely provided as context. When empty the patches defined in the export preset have been loaded instead.
5450
</description>
5551
</method>
56-
<method name="_export_project" qualifiers="virtual">
52+
<method name="_export_project" qualifiers="virtual required">
5753
<return type="int" enum="Error" />
5854
<param index="0" name="preset" type="EditorExportPreset" />
5955
<param index="1" name="debug" type="bool" />
6056
<param index="2" name="path" type="String" />
6157
<param index="3" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
6258
<description>
63-
[b]Required.[/b]
6459
Creates a full project at [param path] for the specified [param preset].
6560
This method is called when "Export" button is pressed in the export dialog.
6661
This method implementation can call [method EditorExportPlatform.save_pack] or [method EditorExportPlatform.save_zip] to use default PCK/ZIP export process, or calls [method EditorExportPlatform.export_project_files] and implement custom callback for processing each exported file.
@@ -73,7 +68,6 @@
7368
<param index="2" name="path" type="String" />
7469
<param index="3" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
7570
<description>
76-
[b]Optional.[/b]
7771
Create a ZIP archive at [param path] for the specified [param preset].
7872
This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" disabled, and ZIP is selected as a file type.
7973
</description>
@@ -86,32 +80,28 @@
8680
<param index="3" name="patches" type="PackedStringArray" />
8781
<param index="4" name="flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
8882
<description>
89-
[b]Optional.[/b]
9083
Create a ZIP archive at [param path] for the specified [param preset], containing only the files that have changed since the last patch.
9184
This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" enabled, and ZIP is selected as a file type.
9285
[b]Note:[/b] The patches provided in [param patches] have already been loaded when this method is called and are merely provided as context. When empty the patches defined in the export preset have been loaded instead.
9386
</description>
9487
</method>
95-
<method name="_get_binary_extensions" qualifiers="virtual const">
88+
<method name="_get_binary_extensions" qualifiers="virtual required const">
9689
<return type="PackedStringArray" />
9790
<param index="0" name="preset" type="EditorExportPreset" />
9891
<description>
99-
[b]Required.[/b]
10092
Returns array of supported binary extensions for the full project export.
10193
</description>
10294
</method>
10395
<method name="_get_debug_protocol" qualifiers="virtual const">
10496
<return type="String" />
10597
<description>
106-
[b]Optional.[/b]
10798
Returns protocol used for remote debugging. Default implementation return [code]tcp://[/code].
10899
</description>
109100
</method>
110101
<method name="_get_device_architecture" qualifiers="virtual const">
111102
<return type="String" />
112103
<param index="0" name="device" type="int" />
113104
<description>
114-
[b]Optional.[/b]
115105
Returns device architecture for one-click deploy.
116106
</description>
117107
</method>
@@ -120,7 +110,6 @@
120110
<param index="0" name="preset" type="EditorExportPreset" />
121111
<param index="1" name="option" type="String" />
122112
<description>
123-
[b]Optional.[/b]
124113
Validates [param option] and returns visibility for the specified [param preset]. Default implementation return [code]true[/code] for all options.
125114
</description>
126115
</method>
@@ -129,14 +118,12 @@
129118
<param index="0" name="preset" type="EditorExportPreset" />
130119
<param index="1" name="option" type="StringName" />
131120
<description>
132-
[b]Optional.[/b]
133121
Validates [param option] and returns warning message for the specified [param preset]. Default implementation return empty string for all options.
134122
</description>
135123
</method>
136124
<method name="_get_export_options" qualifiers="virtual const">
137125
<return type="Dictionary[]" />
138126
<description>
139-
[b]Optional.[/b]
140127
Returns a property list, as an [Array] of dictionaries. Each [Dictionary] must at least contain the [code]name: StringName[/code] and [code]type: Variant.Type[/code] entries.
141128
Additionally, the following keys are supported:
142129
- [code]hint: PropertyHint[/code]
@@ -149,116 +136,101 @@
149136
See also [method Object._get_property_list].
150137
</description>
151138
</method>
152-
<method name="_get_logo" qualifiers="virtual const">
139+
<method name="_get_logo" qualifiers="virtual required const">
153140
<return type="Texture2D" />
154141
<description>
155-
[b]Required.[/b]
156142
Returns platform logo displayed in the export dialog, logo should be 32x32 adjusted to the current editor scale, see [method EditorInterface.get_editor_scale].
157143
</description>
158144
</method>
159-
<method name="_get_name" qualifiers="virtual const">
145+
<method name="_get_name" qualifiers="virtual required const">
160146
<return type="String" />
161147
<description>
162-
[b]Required.[/b]
163148
Returns export platform name.
164149
</description>
165150
</method>
166151
<method name="_get_option_icon" qualifiers="virtual const">
167152
<return type="ImageTexture" />
168153
<param index="0" name="device" type="int" />
169154
<description>
170-
[b]Optional.[/b]
171155
Returns one-click deploy menu item icon for the specified [param device], icon should be 16x16 adjusted to the current editor scale, see [method EditorInterface.get_editor_scale].
172156
</description>
173157
</method>
174158
<method name="_get_option_label" qualifiers="virtual const">
175159
<return type="String" />
176160
<param index="0" name="device" type="int" />
177161
<description>
178-
[b]Optional.[/b]
179162
Returns one-click deploy menu item label for the specified [param device].
180163
</description>
181164
</method>
182165
<method name="_get_option_tooltip" qualifiers="virtual const">
183166
<return type="String" />
184167
<param index="0" name="device" type="int" />
185168
<description>
186-
[b]Optional.[/b]
187169
Returns one-click deploy menu item tooltip for the specified [param device].
188170
</description>
189171
</method>
190172
<method name="_get_options_count" qualifiers="virtual const">
191173
<return type="int" />
192174
<description>
193-
[b]Optional.[/b]
194175
Returns number one-click deploy devices (or other one-click option displayed in the menu).
195176
</description>
196177
</method>
197178
<method name="_get_options_tooltip" qualifiers="virtual const">
198179
<return type="String" />
199180
<description>
200-
[b]Optional.[/b]
201181
Returns tooltip of the one-click deploy menu button.
202182
</description>
203183
</method>
204-
<method name="_get_os_name" qualifiers="virtual const">
184+
<method name="_get_os_name" qualifiers="virtual required const">
205185
<return type="String" />
206186
<description>
207-
[b]Required.[/b]
208187
Returns target OS name.
209188
</description>
210189
</method>
211-
<method name="_get_platform_features" qualifiers="virtual const">
190+
<method name="_get_platform_features" qualifiers="virtual required const">
212191
<return type="PackedStringArray" />
213192
<description>
214-
[b]Required.[/b]
215193
Returns array of platform specific features.
216194
</description>
217195
</method>
218-
<method name="_get_preset_features" qualifiers="virtual const">
196+
<method name="_get_preset_features" qualifiers="virtual required const">
219197
<return type="PackedStringArray" />
220198
<param index="0" name="preset" type="EditorExportPreset" />
221199
<description>
222-
[b]Required.[/b]
223200
Returns array of platform specific features for the specified [param preset].
224201
</description>
225202
</method>
226203
<method name="_get_run_icon" qualifiers="virtual const">
227204
<return type="Texture2D" />
228205
<description>
229-
[b]Optional.[/b]
230206
Returns icon of the one-click deploy menu button, icon should be 16x16 adjusted to the current editor scale, see [method EditorInterface.get_editor_scale].
231207
</description>
232208
</method>
233-
<method name="_has_valid_export_configuration" qualifiers="virtual const">
209+
<method name="_has_valid_export_configuration" qualifiers="virtual required const">
234210
<return type="bool" />
235211
<param index="0" name="preset" type="EditorExportPreset" />
236212
<param index="1" name="debug" type="bool" />
237213
<description>
238-
[b]Required.[/b]
239214
Returns [code]true[/code] if export configuration is valid.
240215
</description>
241216
</method>
242-
<method name="_has_valid_project_configuration" qualifiers="virtual const">
217+
<method name="_has_valid_project_configuration" qualifiers="virtual required const">
243218
<return type="bool" />
244219
<param index="0" name="preset" type="EditorExportPreset" />
245220
<description>
246-
[b]Required.[/b]
247221
Returns [code]true[/code] if project configuration is valid.
248222
</description>
249223
</method>
250224
<method name="_is_executable" qualifiers="virtual const">
251225
<return type="bool" />
252226
<param index="0" name="path" type="String" />
253227
<description>
254-
[b]Optional.[/b]
255228
Returns [code]true[/code] if specified file is a valid executable (native executable or script) for the target platform.
256229
</description>
257230
</method>
258231
<method name="_poll_export" qualifiers="virtual">
259232
<return type="bool" />
260233
<description>
261-
[b]Optional.[/b]
262234
Returns [code]true[/code] if one-click deploy options are changed and editor interface should be updated.
263235
</description>
264236
</method>
@@ -268,15 +240,13 @@
268240
<param index="1" name="device" type="int" />
269241
<param index="2" name="debug_flags" type="int" enum="EditorExportPlatform.DebugFlags" is_bitfield="true" />
270242
<description>
271-
[b]Optional.[/b]
272243
This method is called when [param device] one-click deploy menu option is selected.
273244
Implementation should export project to a temporary location, upload and run it on the specific [param device], or perform another action associated with the menu item.
274245
</description>
275246
</method>
276247
<method name="_should_update_export_options" qualifiers="virtual">
277248
<return type="bool" />
278249
<description>
279-
[b]Optional.[/b]
280250
Returns [code]true[/code] if export options list is changed and presets should be updated.
281251
</description>
282252
</method>

doc/classes/EditorExportPlugin.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
[b]Note:[/b] [method _customize_scene] will only be called for scenes that have been modified since the last export.
3131
</description>
3232
</method>
33-
<method name="_customize_resource" qualifiers="virtual">
33+
<method name="_customize_resource" qualifiers="virtual required">
3434
<return type="Resource" />
3535
<param index="0" name="resource" type="Resource" />
3636
<param index="1" name="path" type="String" />
@@ -47,7 +47,7 @@
4747
- [CompressedTexture3D]
4848
</description>
4949
</method>
50-
<method name="_customize_scene" qualifiers="virtual">
50+
<method name="_customize_scene" qualifiers="virtual required">
5151
<return type="Node" />
5252
<param index="0" name="scene" type="Node" />
5353
<param index="1" name="path" type="String" />
@@ -152,7 +152,7 @@
152152
[b]Note:[/b] Only supported on Android and requires [member EditorExportPlatformAndroid.gradle_build/use_gradle_build] to be enabled.
153153
</description>
154154
</method>
155-
<method name="_get_customization_configuration_hash" qualifiers="virtual const">
155+
<method name="_get_customization_configuration_hash" qualifiers="virtual required const">
156156
<return type="int" />
157157
<description>
158158
Return a hash based on the configuration passed (for both scenes and resources). This helps keep separate caches for separate export configurations.
@@ -172,7 +172,6 @@
172172
<param index="0" name="platform" type="EditorExportPlatform" />
173173
<param index="1" name="option" type="String" />
174174
<description>
175-
[b]Optional.[/b]
176175
Validates [param option] and returns the visibility for the specified [param platform]. The default implementation returns [code]true[/code] for all options.
177176
</description>
178177
</method>
@@ -220,7 +219,7 @@
220219
[/codeblock]
221220
</description>
222221
</method>
223-
<method name="_get_name" qualifiers="virtual const">
222+
<method name="_get_name" qualifiers="virtual required const">
224223
<return type="String" />
225224
<description>
226225
Return the name identifier of this plugin (for future identification by the exporter). The plugins are sorted by name before exporting.

doc/classes/EditorFileSystemImportFormatSupportQuery.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
<tutorials>
1010
</tutorials>
1111
<methods>
12-
<method name="_get_file_extensions" qualifiers="virtual const">
12+
<method name="_get_file_extensions" qualifiers="virtual required const">
1313
<return type="PackedStringArray" />
1414
<description>
1515
Return the file extensions supported.
1616
</description>
1717
</method>
18-
<method name="_is_active" qualifiers="virtual const">
18+
<method name="_is_active" qualifiers="virtual required const">
1919
<return type="bool" />
2020
<description>
2121
Return whether this importer is active.
2222
</description>
2323
</method>
24-
<method name="_query" qualifiers="virtual const">
24+
<method name="_query" qualifiers="virtual required const">
2525
<return type="bool" />
2626
<description>
2727
Query support. Return [code]false[/code] if import must not continue.

doc/classes/EditorScript.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<tutorials>
3636
</tutorials>
3737
<methods>
38-
<method name="_run" qualifiers="virtual">
38+
<method name="_run" qualifiers="virtual required">
3939
<return type="void" />
4040
<description>
4141
This method is executed by the Editor when [b]File &gt; Run[/b] is used.

0 commit comments

Comments
 (0)