![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
RBPlugin; RBPluginClass; void (*RBPluginActivationFunc) (RBPlugin *plugin, RBShell *shell); GtkWidget * (*RBPluginWidgetFunc) (RBPlugin *plugin); gboolean (*RBPluginBooleanFunc) (RBPlugin *plugin); void rb_plugin_activate (RBPlugin *plugin, RBShell *shell); void rb_plugin_deactivate (RBPlugin *plugin, RBShell *shell); gboolean rb_plugin_is_configurable (RBPlugin *plugin); GtkWidget * rb_plugin_create_configure_dialog (RBPlugin *plugin); char * rb_plugin_find_file (RBPlugin *plugin, const char *file); GList * rb_get_plugin_paths (void); #define RB_PLUGIN_REGISTER (PluginName, plugin_name) #define RB_PLUGIN_REGISTER_TYPE (type_name) #define RB_PLUGIN_DEFINE_TYPE (TypeName, type_name, TYPE_PARENT)
This is the base class for all plugins. It provides methods called when activating, deactivating, and configuring plugins.
typedef struct { GObjectClass parent_class; /* Virtual public methods */ RBPluginActivationFunc activate; RBPluginActivationFunc deactivate; RBPluginWidgetFunc create_configure_dialog; /* Plugins should not override this, it's handled automatically by the RbPluginClass */ RBPluginBooleanFunc is_configurable; } RBPluginClass;
void (*RBPluginActivationFunc) (RBPlugin *plugin, RBShell *shell);
Typedef for plugin activation and deactivation functions. These functions include the RBShell as an argument to allow the plugin to locate other parts of Rhythmbox.
GtkWidget * (*RBPluginWidgetFunc) (RBPlugin *plugin);
Typedef for plugin configuration functions.
gboolean (*RBPluginBooleanFunc) (RBPlugin *plugin);
Typedef for plugin functions that return a gboolean.
|
the RBPlugin |
Returns : |
something |
void rb_plugin_activate (RBPlugin *plugin, RBShell *shell);
Called when a plugin is being activated, either on startup or when enabled in the plugin configuration dialog.
void rb_plugin_deactivate (RBPlugin *plugin, RBShell *shell);
Called when a plugin is being deactivated, either on shutdown or when disabled in the plugin configuration dialog.
Note that plugin instances are never destroyed, so the same plugin instance can be deactivated and then reactivated. After deactivation, the plugin must be in a state where it can be reactivated.
gboolean rb_plugin_is_configurable (RBPlugin *plugin);
Determines whether the plugin is configurable.
GtkWidget * rb_plugin_create_configure_dialog (RBPlugin *plugin);
Creates a configuration dialog for plugin
. The plugin can store
the dialog instance the first time it is created and just return it
thereafter.
|
the RBPlugin |
Returns : |
configuration widget for plugin
|
char * rb_plugin_find_file (RBPlugin *plugin, const char *file);
Searches for file
in the install directory for plugin
.
Plugins should use this to locate any data files they install.
|
the RBPlugin |
|
file to search for |
Returns : |
path to the file, must be freed by caller. |
GList * rb_get_plugin_paths (void);
Returns a list containing the paths to search for plugins.
Returns : |
GList of paths, must be freed by caller |
#define RB_PLUGIN_REGISTER(PluginName, plugin_name)
Registers a Rhythmbox plugin type. Use this instead of G_DEFINE_TYPE (or similar) for RBPlugin implementations.
|
plugin name in CamelCase |
|
plugin name in lowercase with words separated by '_' |
#define RB_PLUGIN_REGISTER_TYPE(type_name)
Registers additional types for the plugin. This should be called in the plugin class_init function for types besides the plugin itself that need to be registered with the GObject type system.
|
CamelCase name of the type to register |
#define RB_PLUGIN_DEFINE_TYPE(TypeName, type_name, TYPE_PARENT)
Defines additional types for the plugin. This should be used instead of G_DEFINE_TYPE for additional object types that need to be registered with the GObject type system.
|
type name in CamelCase |
|
type name in lowercase with words separated by '_' |
|
GType macro for the parent type |