Add clang-format to format (C++) source files automatically (#491)

* Update all CMakeLists of extensions to use clang-format
* Run clang-format on all Extensions
* Update GDCore CMakeLists.txt to add clang-format
* Run clang-format on GDCore files
* Update GDJS and GDCpp CMakeLists.txt to add clang-format
* Run clang-format on GDCpp and GDJS files
This commit is contained in:
Florian Rival
2018-05-09 15:57:38 -07:00
committed by GitHub
parent a77f8e139f
commit a8559bfbbc
866 changed files with 128312 additions and 106701 deletions

View File

@@ -9,29 +9,29 @@ This project is released under the MIT License.
#include "DraggableBehavior.h"
void DeclareDraggableBehaviorExtension(gd::PlatformExtension& extension) {
extension.SetExtensionInformation(
"DraggableBehavior",
_("Draggable Behavior"),
_("This Extension enables the movement of objects with a mouse."),
"Florian Rival",
"Open source (MIT License)");
void DeclareDraggableBehaviorExtension(gd::PlatformExtension & extension)
{
extension.SetExtensionInformation("DraggableBehavior",
_("Draggable Behavior"),
_("This Extension enables the movement of objects with a mouse."),
"Florian Rival",
"Open source (MIT License)");
gd::BehaviorMetadata& aut =
extension.AddBehavior("Draggable",
_("Draggable object"),
_("Draggable"),
_("Allows objects to be moved using the mouse."),
"",
"CppPlatform/Extensions/draggableicon.png",
"DraggableBehavior",
std::make_shared<DraggableBehavior>(),
std::shared_ptr<gd::BehaviorsSharedData>());
gd::BehaviorMetadata & aut = extension.AddBehavior("Draggable",
_("Draggable object"),
_("Draggable"),
_("Allows objects to be moved using the mouse."),
"",
"CppPlatform/Extensions/draggableicon.png",
"DraggableBehavior",
std::make_shared<DraggableBehavior>(),
std::shared_ptr<gd::BehaviorsSharedData>());
#if defined(GD_IDE_ONLY)
aut.SetIncludeFile("DraggableBehavior/DraggableBehavior.h");
#if defined(GD_IDE_ONLY)
aut.SetIncludeFile("DraggableBehavior/DraggableBehavior.h");
aut.AddCondition("Dragged",
aut.AddCondition("Dragged",
_("Being dragged"),
_("Check if the object is being dragged"),
_("_PARAM0_ is being dragged"),
@@ -39,29 +39,27 @@ void DeclareDraggableBehaviorExtension(gd::PlatformExtension & extension)
"CppPlatform/Extensions/draggableicon24.png",
"CppPlatform/Extensions/draggableicon16.png")
.AddParameter("object", _("Object"))
.AddParameter("behavior", _("Behavior"), "Draggable")
.SetFunctionName("IsDragged").SetIncludeFile("DraggableBehavior/DraggableBehavior.h");
#endif
.AddParameter("object", _("Object"))
.AddParameter("behavior", _("Behavior"), "Draggable")
.SetFunctionName("IsDragged")
.SetIncludeFile("DraggableBehavior/DraggableBehavior.h");
#endif
}
/**
* \brief This class declares information about the extension.
*/
class Extension : public ExtensionBase
{
public:
/**
* Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
*/
Extension()
{
DeclareDraggableBehaviorExtension(*this);
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
class Extension : public ExtensionBase {
public:
/**
* Constructor of an extension declares everything the extension contains:
* objects, actions, conditions and expressions.
*/
Extension() {
DeclareDraggableBehaviorExtension(*this);
GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
};
};
#if !defined(EMSCRIPTEN)
@@ -69,7 +67,7 @@ public:
* Used by GDevelop to create the extension class
* -- Do not need to be modified. --
*/
extern "C" ExtensionBase * GD_EXTENSION_API CreateGDExtension() {
return new Extension;
extern "C" ExtensionBase* GD_EXTENSION_API CreateGDExtension() {
return new Extension;
}
#endif