KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kicad_plugin.h File Reference

defines the most basic functions which all kicad plugins must implement. More...

Go to the source code of this file.

Macros

#define KICAD_PLUGIN_EXPORT   extern "C" __attribute__((__visibility__("default")))
 

Functions

KICAD_PLUGIN_EXPORT char const * GetKicadPluginClass (void)
 Function GetKicadPluginClass returns the name of the implemented plugin class; for example 3DPLUGIN.
 
KICAD_PLUGIN_EXPORT void GetClassVersion (unsigned char *Major, unsigned char *Minor, unsigned char *Patch, unsigned char *Revision)
 Function GetClassVersion retrieves the version of the Plugin Class.
 
KICAD_PLUGIN_EXPORT bool CheckClassVersion (unsigned char Major, unsigned char Minor, unsigned char Patch, unsigned char Revision)
 Function CheckClassVersion returns true if the class version reported by the Plugin Loader is compatible with the specific implementation of a plugin.
 
KICAD_PLUGIN_EXPORT const char * GetKicadPluginName (void)
 Function GetKicadPluginName returns the name of the plugin instance; for example IDFv3.
 
KICAD_PLUGIN_EXPORT void GetPluginVersion (unsigned char *Major, unsigned char *Minor, unsigned char *Patch, unsigned char *Revision)
 Function GetPluginVersion retrieves the version of the instantiated plugin for informational purposes.
 

Detailed Description

defines the most basic functions which all kicad plugins must implement.

In the implementation the definitions must make use of the KICAD_PLUGIN_EXPORT to ensure symbol visibility.

Definition in file kicad_plugin.h.

Macro Definition Documentation

◆ KICAD_PLUGIN_EXPORT

#define KICAD_PLUGIN_EXPORT   extern "C" __attribute__((__visibility__("default")))

Definition at line 37 of file kicad_plugin.h.

Function Documentation

◆ CheckClassVersion()

KICAD_PLUGIN_EXPORT bool CheckClassVersion ( unsigned char  Major,
unsigned char  Minor,
unsigned char  Patch,
unsigned char  Revision 
)

Function CheckClassVersion returns true if the class version reported by the Plugin Loader is compatible with the specific implementation of a plugin.

This function must be defined by each specific plugin and it is the plugin developer's responsibility to ensure that the Plugin is in fact compatible with the Plugin Loader. The Plugin Loader shall reject any Plugin with a different Major number regardless of the return value of this function.

Definition at line 73 of file 3d_plugin.h.

References MAJOR.

◆ GetClassVersion()

KICAD_PLUGIN_EXPORT void GetClassVersion ( unsigned char *  Major,
unsigned char *  Minor,
unsigned char *  Patch,
unsigned char *  Revision 
)

Function GetClassVersion retrieves the version of the Plugin Class.

This value is used to ensure API compatibility of a plugin as per typical practice. This must be implemented in a source module which is compiled as part of every implementation of a specific plugin class

Parameters
Majorwill hold the Plugin Class Major version
Minorwill hold the Plugin Class Minor version
Revisionwill hold the Plugin Class Revision
Patchwill hold the Plugin Class Patch level

Definition at line 55 of file 3d_plugin.h.

References MAJOR, MINOR, PATCH, and REVISION.

◆ GetKicadPluginClass()

KICAD_PLUGIN_EXPORT char const * GetKicadPluginClass ( void  )

Function GetKicadPluginClass returns the name of the implemented plugin class; for example 3DPLUGIN.

This should be implemented in a source module which is compiled as part of every implementation of a specific plugin class.

Returns
is the NULL-terminated UTF-8 string representing the plugin class

Definition at line 49 of file 3d_plugin.h.

References KICAD_PLUGIN_CLASS.

◆ GetKicadPluginName()

KICAD_PLUGIN_EXPORT const char * GetKicadPluginName ( void  )

Function GetKicadPluginName returns the name of the plugin instance; for example IDFv3.

This string may be used to check for name conflicts or to display informational messages about loaded plugins. This method must be implemented in specific instantiations of a plugin class.

Returns
is the NULL-terminated UTF-8 string representing the plugin name

Definition at line 195 of file s3d_plugin_idf.cpp.

◆ GetPluginVersion()

KICAD_PLUGIN_EXPORT void GetPluginVersion ( unsigned char *  Major,
unsigned char *  Minor,
unsigned char *  Patch,
unsigned char *  Revision 
)

Function GetPluginVersion retrieves the version of the instantiated plugin for informational purposes.

Do not confuse this with GetClassVersion which is used to determine API compatibility.

Parameters
Majorwill hold the Plugin Major version
Minorwill hold the Plugin Minor version
Patchwill hold the Plugin Patch level
Revisionwill hold the Plugin Revision

Definition at line 201 of file s3d_plugin_idf.cpp.

References PLUGIN_3D_IDF_MAJOR, PLUGIN_3D_IDF_MINOR, PLUGIN_3D_IDF_PATCH, PLUGIN_3D_IDF_REVNO, PLUGIN_OCE_MAJOR, PLUGIN_OCE_MINOR, PLUGIN_OCE_PATCH, PLUGIN_OCE_REVNO, PLUGIN_VRML_MAJOR, PLUGIN_VRML_MINOR, PLUGIN_VRML_PATCH, and PLUGIN_VRML_REVNO.