13 #include "GDCore/Events/EventsList.h"
14 #include "GDCore/IDE/Dialogs/LayoutEditorCanvas/EditorSettings.h"
15 #include "GDCore/Project/BehaviorsSharedData.h"
16 #include "GDCore/Project/InitialInstancesContainer.h"
17 #include "GDCore/Project/Layer.h"
18 #include "GDCore/Project/LayersContainer.h"
19 #include "GDCore/Project/ObjectGroupsContainer.h"
20 #include "GDCore/Project/ObjectsContainer.h"
21 #include "GDCore/Project/VariablesContainer.h"
22 #include "GDCore/String.h"
28 class InitialInstancesContainer;
115 return objectsContainer;
122 return objectsContainer;
135 return initialInstances;
142 return initialInstances;
203 bool HasLayerNamed(
const gd::String& name)
const;
218 Layer& GetLayer(std::size_t index);
223 const Layer& GetLayer(std::size_t index)
const;
228 std::size_t GetLayerPosition(
const gd::String& name)
const;
233 std::size_t GetLayersCount()
const;
238 void InsertNewLayer(
const gd::String& name, std::size_t position);
243 void InsertLayer(
const Layer& theLayer, std::size_t position);
253 void SwapLayers(std::size_t firstLayerIndex, std::size_t secondLayerIndex);
258 void MoveLayer(std::size_t oldIndex, std::size_t newIndex);
269 void UpdateBehaviorsSharedData(
gd::Project& project);
274 std::vector<gd::String> GetAllBehaviorSharedDataNames()
const;
279 bool HasBehaviorSharedData(
const gd::String& behaviorName);
296 const std::map<gd::String, std::unique_ptr<gd::BehaviorsSharedData>>&
297 GetAllBehaviorSharedData()
const;
304 return editorSettings;
320 disableInputWhenNotFocused = disable;
332 standardSortMethod = enable;
344 stopSoundsOnStartup = enable;
372 unsigned int backgroundColorR = 0;
373 unsigned int backgroundColorG = 0;
374 unsigned int backgroundColorB = 0;
380 std::map<gd::String, std::unique_ptr<gd::BehaviorsSharedData>>
382 bool stopSoundsOnStartup =
true;
384 bool standardSortMethod =
true;
385 bool disableInputWhenNotFocused =
true;
389 badBehaviorSharedData;
402 std::unique_ptr<gd::BehaviorsSharedData> CreateBehaviorsSharedData(
425 const ObjectsContainer& layout,
427 bool searchInGroups =
true);
437 bool searchInGroups =
true);
442 std::vector<gd::String> GD_CORE_API
447 bool searchInGroups);
457 bool searchInGroups =
true);
468 bool searchInGroups =
true);
475 const ObjectsContainer& layout,
477 bool searchInGroups =
true);
486 std::vector<gd::String> GD_CORE_API
488 const ObjectsContainer& layout,
490 bool searchInGroups =
true);
Base class for defining data shared by behaviors having the same type and name.
Definition: BehaviorsSharedData.h:24
Container for arbitrary serialized data to be used by the editor to store settings.
Definition: EditorSettings.h:19
A list of events.
Definition: EventsList.h:32
Defines a container of gd::InitialInstances.
Definition: InitialInstancesContainer.h:38
Represents a layer of a layout.
Definition: Layer.h:91
Contains the layers for a scene or a custom object.
Definition: LayersContainer.h:21
Represent a layout ( also called a scene ) of a project.
Definition: Layout.h:40
bool StopSoundsOnStartup() const
Definition: Layout.h:351
bool StandardSortMethod() const
Definition: Layout.h:338
const gd::String & GetMangledName() const
Definition: Layout.h:70
gd::ObjectsContainer & GetObjects()
return the objects of the scene.
Definition: Layout.h:114
unsigned int GetBackgroundColorGreen() const
Definition: Layout.h:89
void SetStandardSortMethod(bool enable=true)
Definition: Layout.h:331
gd::InitialInstancesContainer & GetInitialInstances()
Definition: Layout.h:141
bool IsInputDisabledWhenFocusIsLost()
Definition: Layout.h:326
void SetBackgroundColor(unsigned int r, unsigned int g, unsigned int b)
Definition: Layout.h:75
const gd::ObjectsContainer & GetObjects() const
Return the objects of the scene.
Definition: Layout.h:121
const gd::VariablesContainer & GetVariables() const
Get the variables of the scene.
Definition: Layout.h:173
const gd::EventsList & GetEvents() const
Definition: Layout.h:154
gd::EditorSettings & GetAssociatedEditorSettings()
Definition: Layout.h:311
const gd::LayersContainer & GetLayers() const
Get the layers of the scene.
Definition: Layout.h:193
const gd::String & GetName() const
Definition: Layout.h:65
const gd::String & GetWindowDefaultTitle() const
Definition: Layout.h:99
unsigned int GetBackgroundColorBlue() const
Definition: Layout.h:94
const gd::EditorSettings & GetAssociatedEditorSettings() const
Definition: Layout.h:303
const gd::InitialInstancesContainer & GetInitialInstances() const
Definition: Layout.h:134
unsigned int GetBackgroundColorRed() const
Definition: Layout.h:84
void SetStopSoundsOnStartup(bool enable=true)
Definition: Layout.h:343
gd::LayersContainer & GetLayers()
Get the layers of the scene.
Definition: Layout.h:198
void DisableInputWhenFocusIsLost(bool disable=true)
Definition: Layout.h:319
gd::EventsList & GetEvents()
Definition: Layout.h:159
Layout * Clone() const
Return a pointer to a copy of the layout.
Definition: Layout.h:50
gd::VariablesContainer & GetVariables()
Get the variables of the scene.
Definition: Layout.h:182
void SetWindowDefaultTitle(const gd::String &title_)
Definition: Layout.h:104
Used as a base class for classes that will own objects (see gd::Object).
Definition: ObjectsContainer.h:37
Base class representing a project (game), including all resources, scenes, objects,...
Definition: Project.h:51
A generic container that can represent a value ( containing a string, double, bool or int),...
Definition: SerializerElement.h:37
String represents an UTF8 encoded string.
Definition: String.h:33
Class defining a container for gd::Variable.
Definition: VariablesContainer.h:28
Definition: CommonTools.h:24
gd::String GD_CORE_API GetTypeOfObject(const gd::ObjectsContainer &project, const gd::ObjectsContainer &layout, gd::String name, bool searchInGroups)
Get a type from an object/group name.
Definition: Layout.cpp:422
std::vector< gd::String > GD_CORE_API GetBehaviorNamesInObjectOrGroup(const gd::ObjectsContainer &project, const gd::ObjectsContainer &layout, const gd::String &objectOrGroupName, const gd::String &behaviorType, bool searchInGroups)
Get the names of behavior of a given type if an object or all objects of a group has it.
Definition: Layout.cpp:510
gd::String GD_CORE_API GetTypeOfBehaviorInObjectOrGroup(const gd::ObjectsContainer &project, const gd::ObjectsContainer &layout, const gd::String &objectOrGroupName, const gd::String &behaviorName, bool searchInGroups)
Get the type of a behavior if an object or all objects of a group has it.
Definition: Layout.cpp:677
gd::String GD_CORE_API GetTypeOfBehavior(const gd::ObjectsContainer &project, const gd::ObjectsContainer &layout, gd::String name, bool searchInGroups)
Get a type from a behavior name.
Definition: Layout.cpp:732
bool GD_CORE_API IsDefaultBehavior(const gd::ObjectsContainer &project, const gd::ObjectsContainer &layout, gd::String objectOrGroupName, gd::String behaviorName, bool searchInGroups)
Check if a behavior is a default one or doesn't exist in an object or all objects of a group.
Definition: Layout.cpp:626
vector< gd::String > GD_CORE_API GetBehaviorsOfObject(const gd::ObjectsContainer &project, const gd::ObjectsContainer &layout, const gd::String &name, bool searchInGroups)
Get behaviors of an object/group.
Definition: Layout.cpp:754
bool GD_CORE_API HasBehaviorInObjectOrGroup(const gd::ObjectsContainer &project, const gd::ObjectsContainer &layout, const gd::String &objectOrGroupName, const gd::String &behaviorName, bool searchInGroups)
Check if an object or all objects of a group has a behavior.
Definition: Layout.cpp:579
std::vector< gd::String > GetHiddenLayers(const Layout &layout)
Get the names of all layers from the given layout that are invisible.
Definition: Layout.cpp:411