Game Develop Core: gd::Platform Class Reference

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
Public Member Functions | List of all members
gd::Platform Class Reference
Platform Definition ( Classes defining the common concepts used by all platforms )

Base class for implementing a platform. More...

`#include <Platform.h>`

## Public Member Functions

virtual std::string | GetName () const
| Must return the platform name.
virtual std::string | GetFullName () const
| Must return the platform full name, displayed to users.
virtual std::string | GetSubtitle () const
| Must return a text describing the platform in a few words.
virtual std::string | GetDescription () const
| Must return a text describing the platform, displayed to users.
virtual std::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 std::string | GetExtensionCreateFunctionName ()
| Must return the name of the function that is used to create an extension for this platform. More...
virtual std::string | GetExtensionDestroyFunctionName ()
| Must return the name of the function that is used to create an extension for this platform. More...
virtual bool | AddExtension (boost::shared_ptr< PlatformExtension > extension)
| Add an extension to the manager. More...
bool | IsExtensionLoaded (const std::string &name) const
| Return true if an extension with the specified name is loaded.
boost::shared_ptr < PlatformExtension > | GetExtension (const std::string &name) const
| Get an extension of the platform. More...
const std::vector < boost::shared_ptr < gd::PlatformExtension > > & | GetAllPlatformExtensions () const
| Get all extensions loaded for the platform. More...
Factory method
Member functions used to create the platforms objects
boost::shared_ptr< gd::Object > | CreateObject (std::string type, const std::string &name) const
| Create an object of given type with the specified name.
gd::Automatism * | CreateAutomatism (const std::string &type) const
| Create an automatism.
boost::shared_ptr < gd::AutomatismsSharedData > | CreateAutomatismSharedDatas (const std::string &type) const
| Create an automatism shared data object.
boost::shared_ptr< gd::BaseEvent > | CreateEvent (const std::string &type) const
| Create an event of given type.
Notification of changes
The platform can do extra work when a change occurs by providing a special gd::ChangesNotifier
virtual ChangesNotifier & | GetChangesNotifier () const
| Must provide a ChangesNotifier object that will be called by the IDE if needed. The IDE is not supposed to store the returned object. More...
Preview and compilation
The platform should provides specialized classes used for previewing layouts or exporting the project.
virtual boost::shared_ptr < gd::LayoutEditorPreviewer > | GetLayoutPreviewer (gd::LayoutEditorCanvas &editor) const
| Must provide a gd::LayoutEditorPreviewer object that will be stored and used by LayoutEditorCanvas to display/run a preview of the layout of a project. More...
virtual boost::shared_ptr < gd::ProjectExporter > | GetProjectExporter () const
| Must provide a gd::ProjectExporter object that will be used by the IDE to export the project so as to be used without the IDE. More...

## Detailed Description

Base class for implementing a platform.

## Member Function Documentation

bool gd::Platform::AddExtension | ( | boost::shared_ptr< PlatformExtension > | extension) |  |

virtual

Add an extension to the manager.

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< boost::shared_ptr<gd::PlatformExtension> >& gd::Platform::GetAllPlatformExtensions | ( | ) |  | const

inline

Get all extensions loaded for the platform.

Returns
  Vector of Shared pointer containing all extensions

virtual ChangesNotifier& gd::Platform::GetChangesNotifier | ( | ) |  | const

inlinevirtual

Must provide a ChangesNotifier object that will be called by the IDE if needed. The IDE is not supposed to store the returned object.

The default implementation simply return a ChangesNotifier object doing nothing.

boost::shared_ptr< gd::PlatformExtension > gd::Platform::GetExtension | ( | const std::string & | name) |  | const

Get an extension of the platform.

Returns
  Shared pointer to the extension

virtual std::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
  GetExtensionDestroyFunctionName

virtual std::string gd::Platform::GetExtensionDestroyFunctionName | ( | ) |  |

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
  GetExtensionDestroyFunctionName

boost::shared_ptr< gd::LayoutEditorPreviewer > gd::Platform::GetLayoutPreviewer | ( | gd::LayoutEditorCanvas & | editor) |  | const

virtual

Must provide a gd::LayoutEditorPreviewer object that will be stored and used by LayoutEditorCanvas to display/run a preview of the layout of a project.

The default implementation simply return a gd::LayoutEditorPreviewer object doing nothing.

boost::shared_ptr< gd::ProjectExporter > gd::Platform::GetProjectExporter | ( | ) |  | const

virtual

Must provide a gd::ProjectExporter object that will be used by the IDE to export the project so as to be used without the IDE.

The default implementation simply return a gd::ProjectExporter object doing nothing.

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

- Platform.h
- Platform.cpp