1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-25 15:37:42 +00:00

Apply clang-format again to recent changes

Also add missing copyright headers.

[ci skip]
This commit is contained in:
Rémi Verschelde
2017-09-16 19:48:21 +02:00
parent 27cd90f2b0
commit 2d4f6ef0bf
4 changed files with 94 additions and 42 deletions

View File

@@ -609,7 +609,6 @@ private:
void _license_tree_selected(); void _license_tree_selected();
protected: protected:
void _notification(int p_what); void _notification(int p_what);
static void _bind_methods(); static void _bind_methods();

View File

@@ -1,10 +1,39 @@
/*************************************************************************/
/* gd_native_library_editor.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
#include "gd_native_library_editor.h" #include "gd_native_library_editor.h"
#include "gdnative.h" #include "gdnative.h"
void GDNativeLibraryEditor::_find_gdnative_singletons(EditorFileSystemDirectory *p_dir, const Set<String> &enabled_list) { void GDNativeLibraryEditor::_find_gdnative_singletons(EditorFileSystemDirectory *p_dir, const Set<String> &enabled_list) {
// check children // check children
for (int i = 0; i < p_dir->get_file_count(); i++) { for (int i = 0; i < p_dir->get_file_count(); i++) {
@@ -34,8 +63,6 @@ void GDNativeLibraryEditor::_find_gdnative_singletons(EditorFileSystemDirectory
for (int i = 0; i < p_dir->get_subdir_count(); i++) { for (int i = 0; i < p_dir->get_subdir_count(); i++) {
_find_gdnative_singletons(p_dir->get_subdir(i), enabled_list); _find_gdnative_singletons(p_dir->get_subdir(i), enabled_list);
} }
} }
void GDNativeLibraryEditor::_update_libraries() { void GDNativeLibraryEditor::_update_libraries() {
@@ -59,7 +86,6 @@ void GDNativeLibraryEditor::_update_libraries() {
} }
updating = false; updating = false;
} }
void GDNativeLibraryEditor::_item_edited() { void GDNativeLibraryEditor::_item_edited() {
@@ -107,8 +133,7 @@ void GDNativeLibraryEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_item_edited"), &GDNativeLibraryEditor::_item_edited); ClassDB::bind_method(D_METHOD("_item_edited"), &GDNativeLibraryEditor::_item_edited);
} }
GDNativeLibraryEditor::GDNativeLibraryEditor() GDNativeLibraryEditor::GDNativeLibraryEditor() {
{
libraries = memnew(Tree); libraries = memnew(Tree);
libraries->set_columns(2); libraries->set_columns(2);
libraries->set_column_titles_visible(true); libraries->set_column_titles_visible(true);
@@ -119,4 +144,5 @@ GDNativeLibraryEditor::GDNativeLibraryEditor()
updating = false; updating = false;
libraries->connect("item_edited", this, "_item_edited"); libraries->connect("item_edited", this, "_item_edited");
} }
#endif
#endif // TOOLS_ENABLED

View File

@@ -1,12 +1,40 @@
/*************************************************************************/
/* gd_native_library_editor.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GD_NATIVE_LIBRARY_EDITOR_H #ifndef GD_NATIVE_LIBRARY_EDITOR_H
#define GD_NATIVE_LIBRARY_EDITOR_H #define GD_NATIVE_LIBRARY_EDITOR_H
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
#include "editor/project_settings_editor.h"
#include "editor/editor_file_system.h" #include "editor/editor_file_system.h"
#include "editor/project_settings_editor.h"
class GDNativeLibraryEditor : public VBoxContainer class GDNativeLibraryEditor : public VBoxContainer {
{
Tree *libraries; Tree *libraries;
bool updating; bool updating;
@@ -14,10 +42,11 @@ class GDNativeLibraryEditor : public VBoxContainer
void _find_gdnative_singletons(EditorFileSystemDirectory *p_dir, const Set<String> &enabled_list); void _find_gdnative_singletons(EditorFileSystemDirectory *p_dir, const Set<String> &enabled_list);
void _item_edited(); void _item_edited();
protected:
protected:
void _notification(int p_what); void _notification(int p_what);
static void _bind_methods(); static void _bind_methods();
public: public:
GDNativeLibraryEditor(); GDNativeLibraryEditor();
}; };

View File

@@ -99,7 +99,6 @@ Set<String> get_gdnative_singletons(EditorFileSystemDirectory *p_dir) {
void actual_discoverer_handler() { void actual_discoverer_handler() {
EditorFileSystemDirectory *dir = EditorFileSystem::get_singleton()->get_filesystem(); EditorFileSystemDirectory *dir = EditorFileSystem::get_singleton()->get_filesystem();
Set<String> file_paths = get_gdnative_singletons(dir); Set<String> file_paths = get_gdnative_singletons(dir);
Array files; Array files;
@@ -122,7 +121,6 @@ static void editor_init_callback() {
library_editor->set_name(TTR("GDNative")); library_editor->set_name(TTR("GDNative"));
ProjectSettingsEditor::get_singleton()->get_tabs()->add_child(library_editor); ProjectSettingsEditor::get_singleton()->get_tabs()->add_child(library_editor);
discoverer = memnew(GDNativeSingletonDiscover); discoverer = memnew(GDNativeSingletonDiscover);
EditorFileSystem::get_singleton()->connect("filesystem_changed", discoverer, "get_class"); EditorFileSystem::get_singleton()->connect("filesystem_changed", discoverer, "get_class");
} }