Moved base input related classes to core/input.

This commit is contained in:
Relintai 2022-08-17 17:02:24 +02:00
parent 686663d3e4
commit 99e94b08c4
131 changed files with 254 additions and 231 deletions

View File

@ -190,6 +190,7 @@ SConscript("crypto/SCsub")
SConscript("io/SCsub")
SConscript("log/SCsub")
SConscript("object/SCsub")
SConscript("input/SCsub")
SConscript("bind/SCsub")
# Build it all as a library

View File

@ -31,7 +31,7 @@
#include "global_constants.h"
#include "core/object/object.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/variant/variant.h"

23
core/input/SCsub Normal file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env python
import input_builders
from platform_methods import run_in_subprocess
Import("env")
env_input = env.Clone()
# Order matters here. Higher index controller database files write on top of lower index database files.
controller_databases = [
"gamecontrollerdb.txt",
"pandemoniumcontrollerdb.txt",
]
gensource = env_input.CommandNoCache(
"default_controller_mappings.gen.cpp",
controller_databases,
run_in_subprocess(input_builders.make_default_controller_mappings),
)
env_input.add_source_files(env.core_sources, "*.cpp")
env_input.add_source_files(env.core_sources, gensource)

View File

@ -30,7 +30,7 @@
#include "input.h"
#include "core/input_map.h"
#include "core/input/input_map.h"
#include "core/os/os.h"
#include "core/config/project_settings.h"

View File

@ -0,0 +1,69 @@
"""Functions used to generate source files during build time
All such functions are invoked in a subprocess on Windows to prevent build flakiness.
"""
from platform_methods import subprocess_main
from collections import OrderedDict
def make_default_controller_mappings(target, source, env):
dst = target[0]
g = open(dst, "w")
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
g.write('#include "core/typedefs.h"\n')
g.write('#include "core/input/default_controller_mappings.h"\n')
# ensure mappings have a consistent order
platform_mappings = OrderedDict()
for src_path in source:
with open(src_path, "r") as f:
# read mapping file and skip header
mapping_file_lines = f.readlines()[2:]
current_platform = None
for line in mapping_file_lines:
if not line:
continue
line = line.strip()
if len(line) == 0:
continue
if line[0] == "#":
current_platform = line[1:].strip()
if current_platform not in platform_mappings:
platform_mappings[current_platform] = {}
elif current_platform:
line_parts = line.split(",")
guid = line_parts[0]
if guid in platform_mappings[current_platform]:
g.write(
"// WARNING - DATABASE {} OVERWROTE PRIOR MAPPING: {} {}\n".format(
src_path, current_platform, platform_mappings[current_platform][guid]
)
)
platform_mappings[current_platform][guid] = line
platform_variables = {
"Linux": "#if X11_ENABLED",
"Windows": "#ifdef WINDOWS_ENABLED",
"Mac OS X": "#ifdef OSX_ENABLED",
"Android": "#if defined(__ANDROID__)",
"iOS": "#ifdef IPHONE_ENABLED",
"Javascript": "#ifdef JAVASCRIPT_ENABLED",
"UWP": "#ifdef UWP_ENABLED",
}
g.write("const char* DefaultControllerMappings::mappings[] = {\n")
for platform, mappings in platform_mappings.items():
variable = platform_variables[platform]
g.write("{}\n".format(variable))
for mapping in mappings.values():
g.write('\t"{}",\n'.format(mapping))
g.write("#endif\n")
g.write("\tNULL\n};\n")
g.close()
if __name__ == "__main__":
subprocess_main(globals())

View File

@ -30,7 +30,7 @@
#include "input_event.h"
#include "core/input_map.h"
#include "core/input/input_map.h"
#include "core/os/keyboard.h"
const int InputEvent::DEVICE_ID_TOUCH_MOUSE = -1;

View File

@ -30,7 +30,7 @@
#include "input_map.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "core/config/project_settings.h"

View File

@ -31,7 +31,7 @@
/*************************************************************************/
#include "core/object/object.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
class InputMap : public Object {
GDCLASS(InputMap, Object);

View File

@ -30,7 +30,7 @@
#include "shortcut.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
void ShortCut::set_shortcut(const Ref<InputEvent> &p_shortcut) {

View File

@ -30,7 +30,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/object/reference.h"
#include "core/object/script_language.h"

View File

@ -32,7 +32,7 @@
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/midi_driver.h"
#include "core/config/project_settings.h"
#include "core/version_generated.gen.h"

View File

@ -39,7 +39,7 @@
#include "core/crypto/hashing_context.h"
#include "core/config/engine.h"
#include "core/func_ref.h"
#include "core/input_map.h"
#include "core/input/input_map.h"
#include "core/io/config_file.h"
#include "core/io/dtls_server.h"
#include "core/io/http_client.h"
@ -65,7 +65,7 @@
#include "core/math/geometry.h"
#include "core/math/random_number_generator.h"
#include "core/math/triangle_mesh.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/main_loop.h"
#include "core/os/time.h"
#include "core/containers/packed_data_container.h"

View File

@ -31,7 +31,7 @@
#include "variant_parser.h"
#include "core/io/resource_loader.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/string/string_buffer.h"

View File

@ -41,7 +41,7 @@
#include "core/math/math_funcs.h"
#include "core/math/transform_2d.h"
#include "core/string/node_path.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/containers/pair.h"
#include "core/string/string_name.h"
@ -53,7 +53,7 @@
#include "scene/gui/option_button.h"
#include "scene/gui/popup_menu.h"
#include "scene/gui/range.h"
#include "scene/gui/shortcut.h"
#include "core/input/shortcut.h"
#include "scene/main/node.h"
#include "scene/resources/font.h"

View File

@ -42,8 +42,8 @@
#include "core/math/transform.h"
#include "core/math/transform_2d.h"
#include "core/math/vector3.h"
#include "core/os/input.h"
#include "core/os/input_event.h"
#include "core/input/input.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/containers/pair.h"
@ -78,7 +78,7 @@
#include "scene/gui/scroll_bar.h"
#include "scene/gui/scroll_container.h"
#include "scene/gui/separator.h"
#include "scene/gui/shortcut.h"
#include "core/input/shortcut.h"
#include "scene/gui/slider.h"
#include "scene/gui/spin_box.h"
#include "scene/gui/texture_rect.h"

View File

@ -44,7 +44,7 @@
#include "core/containers/list.h"
#include "core/math/math_funcs.h"
#include "core/string/node_path.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/string/string_name.h"
#include "core/typedefs.h"

View File

@ -35,8 +35,8 @@
#include "core/variant/dictionary.h"
#include "core/math/math_funcs.h"
#include "core/math/vector2.h"
#include "core/os/input.h"
#include "core/os/input_event.h"
#include "core/input/input.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/object/resource.h"
@ -55,7 +55,7 @@
#include "scene/gui/label.h"
#include "scene/gui/line_edit.h"
#include "scene/gui/scroll_container.h"
#include "scene/gui/shortcut.h"
#include "core/input/shortcut.h"
#include "scene/gui/text_edit.h"
#include "scene/gui/texture_button.h"
#include "scene/gui/tool_button.h"

View File

@ -42,7 +42,7 @@
#include "core/containers/map.h"
#include "core/math/rect2.h"
#include "core/os/file_access.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/object/script_language.h"
#include "core/typedefs.h"

View File

@ -31,7 +31,7 @@
#include "editor_audio_buses.h"
#include "core/io/resource_saver.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "editor_node.h"
#include "editor_scale.h"
@ -47,7 +47,7 @@
#include "core/math/math_defs.h"
#include "core/math/math_funcs.h"
#include "core/math/rect2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/string/string_name.h"
#include "core/object/undo_redo.h"

View File

@ -39,7 +39,7 @@
#include "core/math/vector2.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/os/os.h"

View File

@ -30,7 +30,7 @@
#include "editor_help.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "core/version_generated.gen.h"
#include "doc_data_compressed.gen.h"
@ -46,7 +46,7 @@
#include "core/math/math_funcs.h"
#include "core/math/rect2.h"
#include "core/math/vector2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/os/os.h"
#include "core/containers/pair.h"

View File

@ -37,7 +37,7 @@
#include "core/error/error_macros.h"
#include "core/math/rect2.h"
#include "core/math/vector2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/os/os.h"
#include "core/typedefs.h"

View File

@ -37,8 +37,8 @@
#include "core/containers/hash_map.h"
#include "core/math/math_defs.h"
#include "core/math/math_funcs.h"
#include "core/os/input.h"
#include "core/os/input_event.h"
#include "core/input/input.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/os/os.h"

View File

@ -40,7 +40,7 @@
#include "core/error/error_list.h"
#include "core/containers/list.h"
#include "core/math/math_defs.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/string/ustring.h"
#include "core/variant/variant.h"

View File

@ -48,8 +48,8 @@
#include "core/object/object_id.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/os/input.h"
#include "core/os/input_event.h"
#include "core/input/input.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/main_loop.h"
#include "core/os/memory.h"
@ -177,7 +177,7 @@
#include "scene/gui/popup_menu.h"
#include "scene/gui/rich_text_label.h"
#include "scene/gui/scroll_bar.h"
#include "scene/gui/shortcut.h"
#include "core/input/shortcut.h"
#include "scene/gui/split_container.h"
#include "scene/gui/tab_container.h"
#include "scene/gui/tabs.h"

View File

@ -51,7 +51,7 @@
#include "core/math/math_defs.h"
#include "core/math/transform.h"
#include "core/math/vector3.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/containers/pool_vector.h"
#include "core/object/resource.h"
#include "core/containers/rid.h"

View File

@ -38,7 +38,7 @@
#include "core/image.h"
#include "core/math/math_funcs.h"
#include "core/math/vector2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/variant/variant.h"
#include "scene/gui/button.h"

View File

@ -47,7 +47,7 @@
#include "core/math/vector3.h"
#include "core/object/object.h"
#include "core/object/object_id.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/config/project_settings.h"
#include "core/containers/rid.h"

View File

@ -37,8 +37,8 @@
#include "core/io/resource_loader.h"
#include "core/math/math_defs.h"
#include "core/math/rect2.h"
#include "core/os/input.h"
#include "core/os/input_event.h"
#include "core/input/input.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/object/resource.h"
#include "core/typedefs.h"

View File

@ -44,7 +44,7 @@
#include "core/containers/map.h"
#include "core/math/math_defs.h"
#include "core/math/rect2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/containers/pair.h"
#include "core/object/ref_ptr.h"

View File

@ -46,7 +46,7 @@
#include "core/math/vector2.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/main_loop.h"
#include "core/os/memory.h"

View File

@ -32,7 +32,7 @@
#include "core/object/resource.h"
#include "scene/gui/shortcut.h"
#include "core/input/shortcut.h"
#include "core/object/object.h"
#include "core/io/config_file.h"

View File

@ -31,7 +31,7 @@
#include "editor_spin_slider.h"
#include "core/math/expression.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "editor_scale.h"
#include "core/variant/array.h"
@ -42,7 +42,7 @@
#include "core/math/math_funcs.h"
#include "core/math/rect2.h"
#include "core/math/transform_2d.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/main_loop.h"
#include "core/os/memory.h"
#include "core/typedefs.h"

View File

@ -33,7 +33,7 @@
#include "core/os/keyboard.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "scene/gui/button.h"
void EditorZoomWidget::_update_zoom_label() {

View File

@ -33,7 +33,7 @@
#include "core/io/resource_loader.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "core/config/project_settings.h"
@ -52,7 +52,7 @@
#include "core/error/error_macros.h"
#include "core/io/config_file.h"
#include "core/io/resource_saver.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/string/print_string.h"
#include "core/object/resource.h"

View File

@ -31,7 +31,7 @@
#include "pane_drag.h"
#include "core/object/class_db.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/variant/variant.h"
#include "scene/2d/canvas_item.h"
#include "scene/resources/texture.h"

View File

@ -40,7 +40,7 @@
#include "core/math/math_defs.h"
#include "core/math/math_funcs.h"
#include "core/math/transform_2d.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/containers/pool_vector.h"
#include "core/typedefs.h"

View File

@ -41,7 +41,7 @@
#include "core/math/math_funcs.h"
#include "core/math/rect2.h"
#include "core/math/transform_2d.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/object/undo_redo.h"
#include "core/variant/variant.h"

View File

@ -45,7 +45,7 @@
#include "core/math/math_funcs.h"
#include "core/math/rect2.h"
#include "core/math/transform_2d.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/object/undo_redo.h"
#include "core/variant/variant.h"

View File

@ -32,7 +32,7 @@
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "core/config/project_settings.h"
#include "editor/animation_track_editor.h"
@ -52,7 +52,7 @@
#include "core/containers/list.h"
#include "core/math/math_funcs.h"
#include "core/math/rect2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/object/resource.h"
#include "core/containers/rid_handle.h"

View File

@ -42,7 +42,7 @@
#include "core/math/geometry.h"
#include "core/math/math_defs.h"
#include "core/math/transform_2d.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/typedefs.h"
#include "core/object/undo_redo.h"

View File

@ -39,7 +39,7 @@
#include "core/math/math_funcs.h"
#include "core/math/rect2.h"
#include "core/math/vector2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/typedefs.h"
#include "core/containers/vector.h"

View File

@ -30,7 +30,7 @@
#include "canvas_item_editor_plugin.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "core/config/project_settings.h"
#include "editor/editor_node.h"
@ -61,7 +61,7 @@
#include "core/math/geometry.h"
#include "core/math/math_funcs.h"
#include "core/string/node_path.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/containers/pool_vector.h"
#include "core/object/resource.h"

View File

@ -30,7 +30,7 @@
#include "collision_polygon_editor_plugin.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "editor/editor_settings.h"
#include "scene/3d/camera.h"
@ -47,7 +47,7 @@
#include "core/math/rect2.h"
#include "core/math/transform.h"
#include "core/math/vector3.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/containers/pool_vector.h"
#include "core/object/undo_redo.h"

View File

@ -41,8 +41,8 @@
#include "core/object/class_db.h"
#include "core/math/math_defs.h"
#include "core/math/math_funcs.h"
#include "core/os/input.h"
#include "core/os/input_event.h"
#include "core/input/input.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/object/undo_redo.h"

View File

@ -31,7 +31,7 @@
#include "curve_editor_plugin.h"
#include "core/core_string_names.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "editor/editor_scale.h"
#include "core/object/class_db.h"
@ -41,7 +41,7 @@
#include "core/math/math_defs.h"
#include "core/math/math_funcs.h"
#include "core/math/rect2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/object/resource.h"
#include "core/string/string_name.h"

View File

@ -44,7 +44,7 @@
#include "core/math/transform.h"
#include "core/math/vector2.h"
#include "core/math/vector3.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/variant/variant.h"
#include "scene/3d/camera.h"

View File

@ -40,7 +40,7 @@
#include "core/math/math_funcs.h"
#include "core/math/rect2.h"
#include "core/math/transform_2d.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/object/undo_redo.h"
#include "core/variant/variant.h"

View File

@ -37,7 +37,7 @@
#include "core/math/math_defs.h"
#include "core/math/plane.h"
#include "core/math/transform.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/containers/pool_vector.h"

View File

@ -31,7 +31,7 @@
#include "polygon_2d_editor_plugin.h"
#include "canvas_item_editor_plugin.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
@ -44,7 +44,7 @@
#include "core/math/rect2.h"
#include "core/math/transform_2d.h"
#include "core/string/node_path.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/string/string_name.h"
#include "core/typedefs.h"

View File

@ -32,7 +32,7 @@
#include "core/io/resource_loader.h"
#include "core/os/file_access.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "core/config/project_settings.h"
@ -58,7 +58,7 @@
#include "core/containers/map.h"
#include "core/math/math_funcs.h"
#include "core/math/transform_2d.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/main_loop.h"
#include "core/os/memory.h"
#include "core/containers/pair.h"

View File

@ -41,8 +41,8 @@
#include "core/math/transform_2d.h"
#include "core/string/node_path.h"
#include "core/os/file_access.h"
#include "core/os/input.h"
#include "core/os/input_event.h"
#include "core/input/input.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/config/project_settings.h"

View File

@ -40,7 +40,7 @@
#include "core/containers/map.h"
#include "core/math/transform_2d.h"
#include "core/os/file_access.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/main_loop.h"
#include "core/os/memory.h"

View File

@ -42,8 +42,8 @@
#include "core/math/plane.h"
#include "core/math/rect2.h"
#include "core/string/node_path.h"
#include "core/os/input.h"
#include "core/os/input_event.h"
#include "core/input/input.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/os/os.h"
@ -82,7 +82,7 @@
#include "scene/gui/panel_container.h"
#include "scene/gui/popup_menu.h"
#include "scene/gui/separator.h"
#include "scene/gui/shortcut.h"
#include "core/input/shortcut.h"
#include "scene/gui/split_container.h"
#include "scene/gui/tool_button.h"
#include "scene/gui/viewport_container.h"

View File

@ -39,8 +39,8 @@
#include "core/math/math_defs.h"
#include "core/math/math_funcs.h"
#include "core/math/rect2.h"
#include "core/os/input.h"
#include "core/os/input_event.h"
#include "core/input/input.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/containers/pool_vector.h"

View File

@ -38,7 +38,7 @@
#include "core/error/error_macros.h"
#include "core/math/transform_2d.h"
#include "core/math/vector2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/typedefs.h"
#include "editor/editor_settings.h"

View File

@ -31,7 +31,7 @@
#include "texture_region_editor_plugin.h"
#include "core/core_string_names.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "editor/editor_scale.h"
#include "scene/gui/panel.h"
@ -41,7 +41,7 @@
#include "core/math/math_defs.h"
#include "core/math/math_funcs.h"
#include "core/math/transform_2d.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/main_loop.h"
#include "core/os/memory.h"
#include "core/string/string_name.h"

View File

@ -36,7 +36,7 @@
#include "core/error/error_macros.h"
#include "core/io/resource_loader.h"
#include "core/math/vector2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/typedefs.h"

View File

@ -39,7 +39,7 @@
#include "core/math/rect2.h"
#include "core/math/transform_2d.h"
#include "core/math/vector2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/string/string_name.h"
#include "core/typedefs.h"

View File

@ -44,7 +44,7 @@
#include "core/math/vector2.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/main_loop.h"
#include "core/os/memory.h"

View File

@ -30,7 +30,7 @@
#include "project_settings_editor.h"
#include "core/input_map.h"
#include "core/input/input_map.h"
#include "core/os/keyboard.h"
#include "core/config/project_settings.h"
#include "core/string/translation.h"

View File

@ -33,7 +33,7 @@
#include "scene/gui/dialogs.h"
#include "core/math/vector2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/object/reference.h"
#include "core/string/ustring.h"
#include "core/variant/variant.h"

View File

@ -48,8 +48,8 @@
#include "core/math/transform_2d.h"
#include "core/math/vector2.h"
#include "core/math/vector3.h"
#include "core/os/input.h"
#include "core/os/input_event.h"
#include "core/input/input.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/main_loop.h"
#include "core/os/memory.h"

View File

@ -36,7 +36,7 @@
#include "core/containers/list.h"
#include "core/containers/map.h"
#include "core/object/method_bind.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/object/script_language.h"

View File

@ -35,7 +35,7 @@
#include "scene/gui/button.h"
#include "scene/gui/line_edit.h"
#include "core/object/class_db.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/containers/pair.h"
#include "core/typedefs.h"

View File

@ -39,8 +39,8 @@
#include "core/io/resource_saver.h"
#include "core/math/vector2.h"
#include "core/os/file_access.h"
#include "core/os/input.h"
#include "core/os/input_event.h"
#include "core/input/input.h"
#include "core/input/input_event.h"
#include "core/os/keyboard.h"
#include "core/os/memory.h"
#include "core/os/os.h"

View File

@ -45,7 +45,7 @@
#include "core/math/math_defs.h"
#include "core/math/rect2.h"
#include "core/math/vector2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/os/memory.h"
#include "core/typedefs.h"
#include "core/object/undo_redo.h"
@ -60,7 +60,7 @@
#include "scene/gui/line_edit.h"
#include "scene/gui/panel_container.h"
#include "scene/gui/popup.h"
#include "scene/gui/shortcut.h"
#include "core/input/shortcut.h"
#include "scene/gui/tab_container.h"
#include "scene/gui/texture_rect.h"
#include "scene/gui/tool_button.h"

View File

@ -9,17 +9,6 @@ env.main_sources = []
env.add_source_files(env.main_sources, "*.cpp")
# Order matters here. Higher index controller database files write on top of lower index database files.
controller_databases = ["gamecontrollerdb.txt", "pandemoniumcontrollerdb.txt"]
gensource = env.CommandNoCache(
"default_controller_mappings.gen.cpp",
controller_databases,
run_in_subprocess(main_builders.make_default_controller_mappings),
)
env.add_source_files(env.main_sources, gensource)
env.Depends("#main/splash.gen.h", "#main/splash.png")
env.CommandNoCache("#main/splash.gen.h", "#main/splash.png", run_in_subprocess(main_builders.make_splash))

View File

@ -30,9 +30,9 @@
#include "input_default.h"
#include "core/input_map.h"
#include "core/input/input_map.h"
#include "core/os/os.h"
#include "main/default_controller_mappings.h"
#include "core/input/default_controller_mappings.h"
#include "scene/resources/texture.h"
#include "servers/visual_server.h"

View File

@ -30,7 +30,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "core/os/input.h"
#include "core/input/input.h"
class InputDefault : public Input {
GDCLASS(InputDefault, Input);

View File

@ -31,7 +31,7 @@
#include "main.h"
#include "core/crypto/crypto.h"
#include "core/input_map.h"
#include "core/input/input_map.h"
#include "core/io/file_access_network.h"
#include "core/io/file_access_pack.h"
#include "core/io/file_access_zip.h"

View File

@ -67,64 +67,5 @@ def make_app_icon(target, source, env):
g.write("#endif")
def make_default_controller_mappings(target, source, env):
dst = target[0]
g = open(dst, "w")
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
g.write('#include "core/typedefs.h"\n')
g.write('#include "main/default_controller_mappings.h"\n')
# ensure mappings have a consistent order
platform_mappings = OrderedDict()
for src_path in source:
with open(src_path, "r") as f:
# read mapping file and skip header
mapping_file_lines = f.readlines()[2:]
current_platform = None
for line in mapping_file_lines:
if not line:
continue
line = line.strip()
if len(line) == 0:
continue
if line[0] == "#":
current_platform = line[1:].strip()
if current_platform not in platform_mappings:
platform_mappings[current_platform] = {}
elif current_platform:
line_parts = line.split(",")
guid = line_parts[0]
if guid in platform_mappings[current_platform]:
g.write(
"// WARNING - DATABASE {} OVERWROTE PRIOR MAPPING: {} {}\n".format(
src_path, current_platform, platform_mappings[current_platform][guid]
)
)
platform_mappings[current_platform][guid] = line
platform_variables = {
"Linux": "#if X11_ENABLED",
"Windows": "#ifdef WINDOWS_ENABLED",
"Mac OS X": "#ifdef OSX_ENABLED",
"Android": "#if defined(__ANDROID__)",
"iOS": "#ifdef IPHONE_ENABLED",
"Javascript": "#ifdef JAVASCRIPT_ENABLED",
"UWP": "#ifdef UWP_ENABLED",
}
g.write("const char* DefaultControllerMappings::mappings[] = {\n")
for platform, mappings in platform_mappings.items():
variable = platform_variables[platform]
g.write("{}\n".format(variable))
for mapping in mappings.values():
g.write('\t"{}",\n'.format(mapping))
g.write("#endif\n")
g.write("\tNULL\n};\n")
g.close()
if __name__ == "__main__":
subprocess_main(globals())

View File

@ -47,7 +47,7 @@
#include "scene/gui/progress_bar.h"
#include "scene/gui/rich_text_label.h"
#include "scene/gui/scroll_bar.h"
#include "scene/gui/shortcut.h"
#include "core/input/shortcut.h"
#include "scene/gui/spin_box.h"
#include "scene/gui/tab_container.h"
#include "scene/gui/texture_rect.h"

View File

@ -36,7 +36,7 @@
#include "core/string/print_string.h"
#include "scene/gui/control.h"
#include "scene/gui/shortcut.h"
#include "core/input/shortcut.h"
#include "scene/gui/text_edit.h"
#include "servers/visual/shader_language.h"
#include "servers/visual/shader_types.h"

View File

@ -2,7 +2,7 @@
#define SLOPE_POINT_H
#include "core/math/vector2.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "scene/gui/control.h"

View File

@ -2,7 +2,7 @@
#define LEFT_PANEL_H
#include "core/variant/array.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/string/ustring.h"
#include "scene/gui/box_container.h"

View File

@ -1,7 +1,7 @@
#ifndef FLOAT_EDIT_H
#define FLOAT_EDIT_H
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "scene/gui/line_edit.h"
class ColorRect;

View File

@ -3,7 +3,7 @@
#define GRADIENT_CURSOR_H
#include "core/math/color.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/variant/variant.h"
#include "scene/gui/control.h"

View File

@ -2,7 +2,7 @@
#define MM_GRADIENT_EDITOR_H
#include "core/math/color.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/object/reference.h"
#include "core/object/undo_redo.h"
#include "core/variant/variant.h"

View File

@ -3,7 +3,7 @@
#include "scene/gui/control.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
class PolygonEditor;

View File

@ -1,7 +1,7 @@
#ifndef POLYGON_EDITOR_H
#define POLYGON_EDITOR_H
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "core/object/reference.h"
#include "polygon_view.h"

View File

@ -25,7 +25,7 @@ SOFTWARE.
#include "editor/editor_plugin.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
//TODO:
//Remove gizmo registration, it's not needed anymore

View File

@ -25,7 +25,7 @@ SOFTWARE.
#include "paint_window.h"
#include "core/image.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "scene/resources/texture.h"
#include "actions/brighten_action.h"

View File

@ -4,7 +4,7 @@
#include "core/log/logger.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "editor/editor_plugin.h"
#include "editor/project_settings_editor.h"

View File

@ -26,7 +26,7 @@ SOFTWARE.
#include "../singleton/prop_utils.h"
#include "core/os/keyboard.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "scene/gui/separator.h"
#include "editor/editor_settings.h"

View File

@ -26,7 +26,7 @@ SOFTWARE.
#include "../singleton/prop_2d_utils.h"
#include "core/os/keyboard.h"
#include "editor/editor_settings.h"
#include "core/os/input.h"
#include "core/input/input.h"
void Prop2DEditorPlugin::convert_active_scene_to_prop_data() {
SceneTree *st = SceneTree::get_singleton();

View File

@ -31,7 +31,7 @@
#include "tile_map_editor_plugin.h"
#include "core/math/math_funcs.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"

View File

@ -30,7 +30,7 @@
#include "tile_set_editor_plugin.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "editor/editor_file_dialog.h"
#include "editor/editor_file_system.h"

View File

@ -30,7 +30,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "core/os/input_event.h"
#include "core/input/input_event.h"
#include "editor/editor_inspector.h"
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"

View File

@ -38,7 +38,7 @@ SOFTWARE.
#include "../defines.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "editor/plugins/spatial_editor_plugin.h"
#include "scene/3d/camera.h"
#include "scene/gui/slider.h"

View File

@ -36,7 +36,7 @@ SOFTWARE.
#include "../defines.h"
#include "core/os/input.h"
#include "core/input/input.h"
#include "editor/plugins/spatial_editor_plugin.h"
#include "scene/3d/camera.h"
#include "scene/gui/slider.h"

View File

@ -22,7 +22,7 @@ SOFTWARE.
#include "bs_input_event_key.h"
#include "scene/gui/shortcut.h"
#include "core/input/shortcut.h"
void BSInputEventKey::from_input_event_key(const Ref<InputEventKey> event) {
set_device(event->get_device());

View File

@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "core/os/input_event.h"
#include "core/input/input_event.h"
class BSInputEventKey : public InputEventKey {
GDCLASS(BSInputEventKey, InputEventKey);

View File

@ -42,7 +42,7 @@
#include "scene/gui/margin_container.h"
#include "scene/gui/label.h"
#include "core/input_map.h"
#include "core/input/input_map.h"
static const char *_button_names[JOY_BUTTON_MAX] = {
"DualShock Cross, Xbox A, Nintendo B",

Some files were not shown because too many files have changed in this diff Show More