GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Public Member Functions | List of all members

Base class for implementing a platform. More...

#include <Platform.h>

Public Member Functions

virtual gd::String GetName () const
 Must return the platform name.
 
virtual gd::String GetFullName () const
 Must return the platform full name, displayed to users.
 
virtual gd::String GetSubtitle () const
 Must return a text describing the platform in a few words.
 
virtual gd::String GetDescription () const
 Must return a text describing the platform, displayed to users.
 
virtual gd::String GetIcon () const
 Must return a filename to a 32*32 image file for the platform.
 
virtual void OnIDEClosed ()
 Called when the IDE is about to shut down: Take this opportunity for erasing for example any temporary file.
 
virtual void OnIDEInitialized ()
 Called when the IDE is initialized and ready to be used.
 
Extensions management

Member functions used to manage the extensions

virtual void ReloadBuiltinExtensions ()
 (Re)load platform built-in extensions. More...
 
virtual gd::String GetExtensionCreateFunctionName ()
 Must return the name of the function that is used to create an extension for this platform. More...
 
virtual bool AddExtension (std::shared_ptr< PlatformExtension > extension)
 Add an extension to the platform. More...
 
bool IsExtensionLoaded (const gd::String &name) const
 Return true if an extension with the specified name is loaded.
 
std::shared_ptr
< PlatformExtension
GetExtension (const gd::String &name) const
 Get an extension of the platform. More...
 
const std::vector
< std::shared_ptr
< gd::PlatformExtension > > & 
GetAllPlatformExtensions () const
 Get all extensions loaded for the platform. More...
 
virtual void RemoveExtension (const gd::String &name)
 Remove an extension from the platform. More...
 
Factory method

Member functions used to create the platforms objects

std::unique_ptr< gd::ObjectCreateObject (gd::String type, const gd::String &name) const
 Create an object of given type with the specified name.
 
gd::BehaviorGetBehavior (const gd::String &type) const
 Get the class handling the behavior with the given type, or nullptr if no behavior with the given type is found.
 
gd::BehaviorsSharedDataGetBehaviorSharedDatas (const gd::String &type) const
 Get the class handling the behavior shared data with the given type, or nullptr if no behavior with the given type is found.
 
std::shared_ptr< gd::BaseEventCreateEvent (const gd::String &type) const
 Create an event of given type.
 

Detailed Description

Base class for implementing a platform.

Member Function Documentation

bool gd::Platform::AddExtension ( std::shared_ptr< PlatformExtension extension)
virtual

Add an extension to the platform.

Note
This method is virtual and can be redefined by platforms if they want to do special work when an extension is loaded.
See also
gd::ExtensionsLoader
const std::vector<std::shared_ptr<gd::PlatformExtension> >& gd::Platform::GetAllPlatformExtensions ( ) const
inline

Get all extensions loaded for the platform.

Returns
Vector of Shared pointer containing all extensions
std::shared_ptr< gd::PlatformExtension > gd::Platform::GetExtension ( const gd::String name) const

Get an extension of the platform.

Returns
Shared pointer to the extension
virtual gd::String gd::Platform::GetExtensionCreateFunctionName ( )
inlinevirtual

Must return the name of the function that is used to create an extension for this platform.

For example, GD C++ Platform uses "CreateGDExtension" and GD JS Platform "CreateGDJSExtension".

See also
gd::ExtensionsLoader
virtual void gd::Platform::ReloadBuiltinExtensions ( )
inlinevirtual

(Re)load platform built-in extensions.

Note
Can be useful if, for example, the user changed the language of the editor.
void gd::Platform::RemoveExtension ( const gd::String name)
virtual

Remove an extension from the platform.

Events, objects, behaviors provided by the extension won't be available anymore.


The documentation for this class was generated from the following files: