c4d_resource.h File Reference

Classes

class  GeResource
 

Functions

const StringGeLoadString (Int32 id)
 
String GeLoadString (Int32 id, const maxon::String &p1)
 
String GeLoadString (Int32 id, const maxon::String &p1, const maxon::String &p2)
 
String GeLoadString (Int32 id, const maxon::String &p1, const maxon::String &p2, const maxon::String &p3)
 
String GeLoadString (Int32 id, const maxon::String &p1, const maxon::String &p2, const maxon::String &p3, const maxon::String &p4)
 
String GeLoadString (Int32 id, const maxon::String &p1, const maxon::String &p2, const maxon::String &p3, const maxon::String &p4, const maxon::String &p5)
 
Bool RegisterDescription (Int32 id, const maxon::String &idstr, LocalResource *res=nullptr)
 
BaseContainerGetMenuResource (const maxon::String &menuname)
 
Bool SearchMenuResource (BaseContainer *bc, const maxon::String &searchstr)
 
GeDataSearchPluginMenuResource (const maxon::String &identifier="IDS_EDITOR_PIPELINE"_s)
 
GeDataSearchPluginSubMenuResource (const maxon::String &identifier="IDS_EDITOR_PIPELINE"_s, BaseContainer *bc=nullptr)
 
Filename GeGetPluginResourcePath ()
 
void UpdateMenus ()
 
void FreeResource ()
 

Variables

GeResource g_resource
 

Function Documentation

◆ GeLoadString() [1/6]

const String& GeLoadString ( Int32  id)

Loads a string from the plugins global resource file.

Parameters
[in]idThe ID of the string to get.
Returns
The string that matched the passed id.

◆ GeLoadString() [2/6]

String GeLoadString ( Int32  id,
const maxon::String p1 
)

Loads a string and replace the '#' with the placeholder string.

Note
In Cinema 4D there is a convention that in strings '#' is a placeholder for dynamic parts (this allows to translate a whole sentence as sentence structure and word placement may be reverted in other languages).
For example if the string is: "loading of file '#' failed", then the actual filename can be passed as p1.
Parameters
[in]idThe ID of the string to get.
[in]p1The string to insert into the placeholder.
Returns
The completed string.

◆ GeLoadString() [3/6]

String GeLoadString ( Int32  id,
const maxon::String p1,
const maxon::String p2 
)

Loads a string and replace the '#' placeholders with the appropriate string.

Note
In Cinema 4D there is a convention that in strings '#' is a placeholder for dynamic parts (this allows to translate a whole sentence as sentence structure and word placement may be reverted in other languages).
For example if the string is: "loading of file '#' failed", then the actual filename can be passed as p1.
Parameters
[in]idThe ID of the string to get.
[in]p1The string to insert into the first placeholder.
[in]p2The string to insert into the second placeholder.
Returns
The completed string.

◆ GeLoadString() [4/6]

String GeLoadString ( Int32  id,
const maxon::String p1,
const maxon::String p2,
const maxon::String p3 
)

Loads a string and replace the '#' placeholders with the appropriate string.

Note
In Cinema 4D there is a convention that in strings '#' is a placeholder for dynamic parts (this allows to translate a whole sentence as sentence structure and word placement may be reverted in other languages).
For example if the string is: "loading of file '#' failed", then the actual filename can be passed as p1.
Parameters
[in]idThe ID of the string to get.
[in]p1The string to insert into the first placeholder.
[in]p2The string to insert into the second placeholder.
[in]p3The string to insert into the third placeholder.
Returns
The completed string.

◆ GeLoadString() [5/6]

String GeLoadString ( Int32  id,
const maxon::String p1,
const maxon::String p2,
const maxon::String p3,
const maxon::String p4 
)

Loads a string and replace the '#' placeholders with the appropriate string.

Note
In Cinema 4D there is a convention that in strings '#' is a placeholder for dynamic parts (this allows to translate a whole sentence as sentence structure and word placement may be reverted in other languages).
For example if the string is: "loading of file '#' failed", then the actual filename can be passed as p1.
Parameters
[in]idThe ID of the string to get.
[in]p1The string to insert into the first placeholder.
[in]p2The string to insert into the second placeholder.
[in]p3The string to insert into the third placeholder.
[in]p4The string to insert into the fourth placeholder.
Returns
The completed string.

◆ GeLoadString() [6/6]

String GeLoadString ( Int32  id,
const maxon::String p1,
const maxon::String p2,
const maxon::String p3,
const maxon::String p4,
const maxon::String p5 
)

Loads a string and replace the '#' placeholders with the appropriate string.

Note
In Cinema 4D there is a convention that in strings '#' is a placeholder for dynamic parts (this allows to translate a whole sentence as sentence structure and word placement may be reverted in other languages).
For example if the string is: "loading of file '#' failed", then the actual filename can be passed as p1.
Parameters
[in]idThe ID of the string to get.
[in]p1The string to insert into the first placeholder.
[in]p2The string to insert into the second placeholder.
[in]p3The string to insert into the third placeholder.
[in]p4The string to insert into the fourth placeholder.
[in]p5The string to insert into the fifth placeholder.
Returns
The completed string.

◆ RegisterDescription()

Bool RegisterDescription ( Int32  id,
const maxon::String idstr,
LocalResource *  res = nullptr 
)

Registers a description for a plugin ID. This is not needed for plugin types whose Register() functions have a description parameter.

Parameters
[in]idThe plugin ID. If this is a standalone description, use a unique ID.
[in]idstrThe name of the description resource file to use for the plugin without .res extension, for example "registered".
The name has to be unique, i.e. "Tdisplay" cannot be used for 2 different descriptions.
See Description Resource for more information.
[in]resPass this to search in a specific resource class. Otherwise the default path is used.
Returns
true if the description was registered, otherwise false.

◆ GetMenuResource()

BaseContainer* GetMenuResource ( const maxon::String menuname)

Gets the menu container of a main menu.

Parameters
[in]menunameThe main menu name, e.g. "M_EDITOR" (the same name as on disk or that can be seen in the Menu Editor).
Returns
The menu container: MENURESOURCE

◆ SearchMenuResource()

Bool SearchMenuResource ( BaseContainer bc,
const maxon::String searchstr 
)

Searches a menu container for a certain plugin command (which is a string identifier, for example "PLUGIN_CMD_1000472").

Parameters
[in]bcThe menu container to search. The caller owns the pointed container.
[in]searchstrThe search string.
Returns
true if the command was found, otherwise false.

◆ SearchPluginMenuResource()

GeData* SearchPluginMenuResource ( const maxon::String identifier = "IDS_EDITOR_PIPELINE"_s)

Searches for the "Extensions" main menu category in "M_EDITOR".

Parameters
[in]identifierThe menu identifier.
Returns
The found menu container, or nullptr. Cinema 4D owns the pointed data.

◆ SearchPluginSubMenuResource()

GeData* SearchPluginSubMenuResource ( const maxon::String identifier = "IDS_EDITOR_PIPELINE"_s,
BaseContainer bc = nullptr 
)

Searches for the "Extensions" main menu category in "M_EDITOR" or optionally a sub-menu specified by bc.

Parameters
[in]identifierThe menu identifier.
[in]bcThe sub-menu container.
Returns
The found menu container, or nullptr. Cinema 4D owns the pointed data.

◆ GeGetPluginResourcePath()

Filename GeGetPluginResourcePath ( )

Gets a plugin's resource path.

Returns
The resource path for the current plugin.

◆ UpdateMenus()

void UpdateMenus ( )

Forces a menu update.

Note
Not necessary when reacting to C4DPL_BUILDMENU.

◆ FreeResource()

void FreeResource ( )

Private.

Variable Documentation

◆ g_resource

GeResource g_resource
extern

Global resources for Cinema 4D.