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 | Static Public Member Functions | Public Attributes | List of all members

Base class for implementing platform's extensions. More...

#include <PlatformExtension.h>

Public Member Functions

PlatformExtensionSetExtensionInformation (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &author_, const gd::String &license_)
 Must be called to declare the main information about the extension.
 
PlatformExtensionSetExtensionHelpPath (const gd::String &helpPath_)
 Set the path to the help, relative to the wiki/documentation root. For example, "/all-features/collisions" for "http://wiki.compilgames.net/doku.php/gdevelop5/all-features/collisions". More...
 
void MarkAsDeprecated ()
 Mark this extension as deprecated: the IDE will hide it from the user.
 
gd::InstructionMetadataAddCondition (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &sentence_, const gd::String &group_, const gd::String &icon_, const gd::String &smallicon_)
 Declare a new condition as being part of the extension. More...
 
gd::InstructionMetadataAddAction (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &sentence_, const gd::String &group_, const gd::String &icon_, const gd::String &smallicon_)
 Declare a new action as being part of the extension. More...
 
gd::ExpressionMetadataAddExpression (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &group_, const gd::String &smallicon_)
 Declare a new expression as being part of the extension. More...
 
gd::ExpressionMetadataAddStrExpression (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &group_, const gd::String &smallicon_)
 Declare a new String expression as being part of the extension. More...
 
template<class T >
gd::ObjectMetadataAddObject (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &icon24x24_)
 Declare a new object as being part of the extension. More...
 
gd::ObjectMetadataAddObject (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &icon24x24_, std::shared_ptr< gd::Object > instance)
 Declare a new object as being part of the extension. More...
 
gd::BehaviorMetadataAddBehavior (const gd::String &name_, const gd::String &fullname_, const gd::String &defaultName_, const gd::String &description_, const gd::String &group_, const gd::String &icon24x24_, const gd::String &className_, std::shared_ptr< gd::Behavior > instance, std::shared_ptr< gd::BehaviorsSharedData > sharedDatasInstance)
 Declare a new behavior as being part of the extension. More...
 
gd::EffectMetadataAddEffect (const gd::String &name_)
 Declare a new effect as being part of the extension. More...
 
gd::EventMetadataAddEvent (const gd::String &name_, const gd::String &fullname_, const gd::String &description_, const gd::String &group_, const gd::String &smallicon_, std::shared_ptr< gd::BaseEvent > instance)
 Declare a new event as being part of the extension. More...
 
const gd::StringGetFullName () const
 Return the name extension user friendly name.
 
const gd::StringGetName () const
 Return the name of the extension.
 
const gd::StringGetDescription () const
 Return a description of the extension.
 
const gd::StringGetAuthor () const
 Return the name of the extension developer.
 
const gd::StringGetLicense () const
 Return the name of extension license.
 
const gd::StringGetHelpPath () const
 Return the help path of extension, relative to the wiki/documentation root.
 
bool IsDeprecated () const
 Check if the extension is flagged as being deprecated.
 
bool IsBuiltin () const
 Return true if the extension is a standard extension that cannot be deactivated.
 
const gd::StringGetNameSpace ()
 Get the namespace of the extension. More...
 
std::vector< gd::StringGetExtensionObjectsTypes () const
 Return a vector containing all the object types provided by the extension.
 
std::vector< gd::StringGetBehaviorsTypes () const
 Return a vector containing all the behavior types provided by the extension.
 
CreateFunPtr GetObjectCreationFunctionPtr (gd::String objectType) const
 Return a function to create the object if the type is handled by the extension.
 
std::vector< gd::StringGetExtensionEffectTypes () const
 Return a vector containing all the effect types provided by the extension.
 
std::shared_ptr< gd::BaseEventCreateEvent (gd::String eventType) const
 Create a custom event. More...
 
gd::BehaviorGetBehavior (gd::String behaviorType) const
 Get the gd::Behavior handling the given behavior type. More...
 
gd::BehaviorsSharedDataGetBehaviorSharedDatas (gd::String behaviorType) const
 Get the gd::BehaviorsSharedData handling the given behavior shared data. More...
 
ObjectMetadataGetObjectMetadata (const gd::String &objectType)
 Return a reference to the ObjectMetadata object associated to objectType.
 
BehaviorMetadataGetBehaviorMetadata (const gd::String &behaviorType)
 Return a reference to the BehaviorMetadata object associated to behaviorType.
 
EffectMetadataGetEffectMetadata (const gd::String &effectName)
 Return the metadata for the effect with the given name.
 
std::map< gd::String,
gd::EventMetadata > & 
GetAllEvents ()
 Return a map containing all the events provided by the extension.
 
std::map< gd::String,
gd::InstructionMetadata > & 
GetAllActions ()
 Return a reference to a map containing the names of the actions (in the first members) and the metadata associated with (in the second members).
 
std::map< gd::String,
gd::InstructionMetadata > & 
GetAllConditions ()
 
std::map< gd::String,
gd::ExpressionMetadata > & 
GetAllExpressions ()
 
std::map< gd::String,
gd::ExpressionMetadata > & 
GetAllStrExpressions ()
 
std::map< gd::String,
gd::InstructionMetadata > & 
GetAllActionsForObject (gd::String objectType)
 Return a reference to a map containing the names of the actions, related to the object type, and the metadata associated with.
 
std::map< gd::String,
gd::InstructionMetadata > & 
GetAllConditionsForObject (gd::String objectType)
 
std::map< gd::String,
gd::ExpressionMetadata > & 
GetAllExpressionsForObject (gd::String objectType)
 
std::map< gd::String,
gd::ExpressionMetadata > & 
GetAllStrExpressionsForObject (gd::String objectType)
 
std::map< gd::String,
gd::InstructionMetadata > & 
GetAllActionsForBehavior (gd::String autoType)
 
std::map< gd::String,
gd::InstructionMetadata > & 
GetAllConditionsForBehavior (gd::String autoType)
 
std::map< gd::String,
gd::ExpressionMetadata > & 
GetAllExpressionsForBehavior (gd::String autoType)
 
std::map< gd::String,
gd::ExpressionMetadata > & 
GetAllStrExpressionsForBehavior (gd::String autoType)
 
virtual void ExposeConditionsResources (Instruction &condition, gd::ArbitraryResourceWorker &worker)
 
virtual void ExposeActionsResources (Instruction &action, gd::ArbitraryResourceWorker &worker)
 
void StripUnimplementedInstructionsAndExpressions ()
 Delete all instructions having no functions name or custom code generator.
 

Static Public Member Functions

static std::vector< gd::StringGetBuiltinExtensionsNames ()
 Return the name of all the extensions which are considered provided by platforms.
 
static gd::String GetNamespaceSeparator ()
 Get the string used to separate the name of the instruction/expression and the extension.
 

Public Attributes

CompilationInfo compilationInfo
 

Detailed Description

Base class for implementing platform's extensions.

Member Function Documentation

gd::InstructionMetadata & gd::PlatformExtension::AddAction ( const gd::String name_,
const gd::String fullname_,
const gd::String description_,
const gd::String sentence_,
const gd::String group_,
const gd::String icon_,
const gd::String smallicon_ 
)

Declare a new action as being part of the extension.

Note
This method does nothing when used for GD C++ runtime.
gd::BehaviorMetadata & gd::PlatformExtension::AddBehavior ( const gd::String name_,
const gd::String fullname_,
const gd::String defaultName_,
const gd::String description_,
const gd::String group_,
const gd::String icon24x24_,
const gd::String className_,
std::shared_ptr< gd::Behavior instance,
std::shared_ptr< gd::BehaviorsSharedData sharedDatasInstance 
)

Declare a new behavior as being part of the extension.

Note
This method does nothing when used for GD C++ runtime.
Parameters
nameThe name of the behavior
fullnameThe user friendly name of the behavior
descriptionThe user friendly description of the behavior
iconThe 24x24 icon of the behavior: res/icons_[SkinName]/[iconName]24.png will be first tried, and then if it does not exists, it is assumed that the icon name is the filename that must be used to open the icon.
instanceAn instance of the behavior that will be used to create the behavior
sharedDatasInstanceOptional instance of the data shared by the behaviors having the same name.
gd::InstructionMetadata & gd::PlatformExtension::AddCondition ( const gd::String name_,
const gd::String fullname_,
const gd::String description_,
const gd::String sentence_,
const gd::String group_,
const gd::String icon_,
const gd::String smallicon_ 
)

Declare a new condition as being part of the extension.

Note
This method does nothing when used for GD C++ runtime.
gd::EffectMetadata & gd::PlatformExtension::AddEffect ( const gd::String name_)

Declare a new effect as being part of the extension.

Parameters
nameThe internal name of the effect (also called effect type).
gd::EventMetadata & gd::PlatformExtension::AddEvent ( const gd::String name_,
const gd::String fullname_,
const gd::String description_,
const gd::String group_,
const gd::String smallicon_,
std::shared_ptr< gd::BaseEvent instance 
)

Declare a new event as being part of the extension.

Note
This method does nothing when used for GD C++ runtime.
gd::ExpressionMetadata & gd::PlatformExtension::AddExpression ( const gd::String name_,
const gd::String fullname_,
const gd::String description_,
const gd::String group_,
const gd::String smallicon_ 
)

Declare a new expression as being part of the extension.

Note
This method does nothing when used for GD C++ runtime.
template<class T >
gd::ObjectMetadata & gd::PlatformExtension::AddObject ( const gd::String name_,
const gd::String fullname_,
const gd::String description_,
const gd::String icon24x24_ 
)

Declare a new object as being part of the extension.

Note
This method does nothing when used for GD C++ runtime.
Template Parameters
Tthe declared class inherited from gd::Object
Parameters
nameThe name of the object
fullnameThe user friendly name of the object
descriptionThe user friendly description of the object
iconThe 24x24 icon of the object: res/icons_[SkinName]/[iconName]24.png will be first tried, and then if it does not exists, the full entered name will be tried.
gd::ObjectMetadata & gd::PlatformExtension::AddObject ( const gd::String name_,
const gd::String fullname_,
const gd::String description_,
const gd::String icon24x24_,
std::shared_ptr< gd::Object instance 
)

Declare a new object as being part of the extension.

Note
This method does nothing when used for GD C++ runtime.
Parameters
nameThe name of the object
fullnameThe user friendly name of the object
descriptionThe user friendly description of the object
iconThe 24x24 icon of the object: res/icons_[SkinName]/[iconName]24.png will be first tried, and then if it does not exists, the full entered name will be tried.
instanceThe "blueprint" object to be copied when a new object is asked for.
gd::ExpressionMetadata & gd::PlatformExtension::AddStrExpression ( const gd::String name_,
const gd::String fullname_,
const gd::String description_,
const gd::String group_,
const gd::String smallicon_ 
)

Declare a new String expression as being part of the extension.

Note
This method does nothing when used for GD C++ runtime.
gd::BaseEventSPtr gd::PlatformExtension::CreateEvent ( gd::String  eventType) const

Create a custom event.

Return an empty pointer if eventType is not provided by the extension.

virtual void gd::PlatformExtension::ExposeActionsResources ( Instruction action,
gd::ArbitraryResourceWorker worker 
)
inlinevirtual

Called ( e.g. during compilation ) so as to inventory resources used by actions and update their filename

See also
ArbitraryResourceWorker
virtual void gd::PlatformExtension::ExposeConditionsResources ( Instruction condition,
gd::ArbitraryResourceWorker worker 
)
inlinevirtual

Called ( e.g. during compilation ) so as to inventory resources used by conditions and update their filename

See also
gd::PlatformExtension::ExposeActionsResources
std::map< gd::String, gd::InstructionMetadata > & gd::PlatformExtension::GetAllActionsForBehavior ( gd::String  autoType)
std::map< gd::String, gd::InstructionMetadata > & gd::PlatformExtension::GetAllConditions ( )
std::map< gd::String, gd::InstructionMetadata > & gd::PlatformExtension::GetAllConditionsForBehavior ( gd::String  autoType)
std::map< gd::String, gd::InstructionMetadata > & gd::PlatformExtension::GetAllConditionsForObject ( gd::String  objectType)
std::map< gd::String, gd::ExpressionMetadata > & gd::PlatformExtension::GetAllExpressions ( )
std::map< gd::String, gd::ExpressionMetadata > & gd::PlatformExtension::GetAllExpressionsForBehavior ( gd::String  autoType)
std::map< gd::String, gd::ExpressionMetadata > & gd::PlatformExtension::GetAllExpressionsForObject ( gd::String  objectType)
std::map< gd::String, gd::ExpressionMetadata > & gd::PlatformExtension::GetAllStrExpressions ( )
std::map< gd::String, gd::ExpressionMetadata > & gd::PlatformExtension::GetAllStrExpressionsForBehavior ( gd::String  autoType)
std::map< gd::String, gd::ExpressionMetadata > & gd::PlatformExtension::GetAllStrExpressionsForObject ( gd::String  objectType)
gd::Behavior * gd::PlatformExtension::GetBehavior ( gd::String  behaviorType) const

Get the gd::Behavior handling the given behavior type.

Return nullptr if behaviorType is not provided by the extension.

gd::BehaviorsSharedData * gd::PlatformExtension::GetBehaviorSharedDatas ( gd::String  behaviorType) const

Get the gd::BehaviorsSharedData handling the given behavior shared data.

Return nullptr if behaviorType is not provided by the extension.

const gd::String& gd::PlatformExtension::GetNameSpace ( )
inline

Get the namespace of the extension.

Note
The namespace is simply the name of the extension concatenated with "::" at the end.
PlatformExtension& gd::PlatformExtension::SetExtensionHelpPath ( const gd::String helpPath_)
inline

Set the path to the help, relative to the wiki/documentation root. For example, "/all-features/collisions" for "http://wiki.compilgames.net/doku.php/gdevelop5/all-features/collisions".

The instructions, objects and behaviors will have this help path set by default, unless you call SetHelpPath on them.


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