#include <glib/glist.h>
#include <gmodule.h>
#include "signals.h"
#include "value.h"
#include "pluginpref.h"
Include dependency graph for plugin.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | _GaimPluginInfo |
Detailed information about a plugin. More... | |
struct | _GaimPluginLoaderInfo |
Extra information for loader plugins. More... | |
struct | _GaimPlugin |
A plugin handle. More... | |
struct | _GaimPluginUiInfo |
struct | _GaimPluginAction |
The structure used in the actions member of GaimPluginInfo. More... | |
Defines | |
#define | GAIM_PRIORITY_DEFAULT 0 |
#define | GAIM_PRIORITY_HIGHEST 9999 |
#define | GAIM_PRIORITY_LOWEST -9999 |
#define | GAIM_PLUGIN_FLAG_INVISIBLE 0x01 |
#define | GAIM_PLUGIN_MAGIC 5 |
#define | GAIM_PLUGIN_LOADER_INFO(plugin) ((GaimPluginLoaderInfo *)(plugin)->info->extra_info) |
#define | GAIM_PLUGIN_HAS_PREF_FRAME(plugin) ((plugin)->info != NULL && (plugin)->info->prefs_info != NULL) |
#define | GAIM_PLUGIN_UI_INFO(plugin) ((GaimPluginUiInfo*)(plugin)->info->prefs_info) |
#define | GAIM_PLUGIN_HAS_ACTIONS(plugin) ((plugin)->info != NULL && (plugin)->info->actions != NULL) |
#define | GAIM_PLUGIN_ACTIONS(plugin, context) |
#define | GAIM_INIT_PLUGIN(pluginname, initfunc, plugininfo) |
Handles the initialization of modules. | |
Typedefs | |
typedef _GaimPlugin | GaimPlugin |
typedef _GaimPluginInfo | GaimPluginInfo |
typedef _GaimPluginUiInfo | GaimPluginUiInfo |
typedef _GaimPluginLoaderInfo | GaimPluginLoaderInfo |
typedef _GaimPluginAction | GaimPluginAction |
typedef int | GaimPluginPriority |
Plugin priority. | |
Enumerations | |
enum | GaimPluginType { GAIM_PLUGIN_UNKNOWN = -1, GAIM_PLUGIN_STANDARD = 0, GAIM_PLUGIN_LOADER, GAIM_PLUGIN_PROTOCOL } |
Plugin types. More... | |
Functions | |
void * | gaim_plugins_get_handle (void) |
GaimPluginAction * | gaim_plugin_action_new (char *label, void(*callback)(GaimPluginAction *)) |
Allocates and returns a new GaimPluginAction. | |
Plugin API | |
GaimPlugin * | gaim_plugin_new (gboolean native, const char *path) |
Creates a new plugin structure. | |
GaimPlugin * | gaim_plugin_probe (const char *filename) |
Probes a plugin, retrieving the information on it and adding it to the list of available plugins. | |
gboolean | gaim_plugin_register (GaimPlugin *plugin) |
Registers a plugin and prepares it for loading. | |
gboolean | gaim_plugin_load (GaimPlugin *plugin) |
Attempts to load a previously probed plugin. | |
gboolean | gaim_plugin_unload (GaimPlugin *plugin) |
Unloads the specified plugin. | |
gboolean | gaim_plugin_reload (GaimPlugin *plugin) |
Reloads a plugin. | |
void | gaim_plugin_destroy (GaimPlugin *plugin) |
Unloads a plugin and destroys the structure from memory. | |
gboolean | gaim_plugin_is_loaded (const GaimPlugin *plugin) |
Returns whether or not a plugin is currently loaded. | |
Plugin IPC API | |
gboolean | gaim_plugin_ipc_register (GaimPlugin *plugin, const char *command, GaimCallback func, GaimSignalMarshalFunc marshal, GaimValue *ret_value, int num_params,...) |
Registers an IPC command in a plugin. | |
void | gaim_plugin_ipc_unregister (GaimPlugin *plugin, const char *command) |
Unregisters an IPC command in a plugin. | |
void | gaim_plugin_ipc_unregister_all (GaimPlugin *plugin) |
Unregisters all IPC commands in a plugin. | |
gboolean | gaim_plugin_ipc_get_params (GaimPlugin *plugin, const char *command, GaimValue **ret_value, int *num_params, GaimValue ***params) |
Returns a list of value types used for an IPC command. | |
void * | gaim_plugin_ipc_call (GaimPlugin *plugin, const char *command, gboolean *ok,...) |
Executes an IPC command. | |
Plugins API | |
void | gaim_plugins_set_search_paths (size_t count, char **paths) |
Sets the search paths for plugins. | |
void | gaim_plugins_unload_all (void) |
Unloads all loaded plugins. | |
void | gaim_plugins_destroy_all (void) |
Destroys all registered plugins. | |
void | gaim_plugins_load_saved (const char *key) |
Attempts to load all the plugins in the specified preference key that were loaded when gaim last quit. | |
void | gaim_plugins_probe (const char *ext) |
Probes for plugins in the registered module paths. | |
gboolean | gaim_plugins_enabled (void) |
Returns whether or not plugin support is enabled. | |
void | gaim_plugins_register_probe_notify_cb (void(*func)(void *), void *data) |
Registers a function that will be called when probing is finished. | |
void | gaim_plugins_unregister_probe_notify_cb (void(*func)(void *)) |
Unregisters a function that would be called when probing is finished. | |
void | gaim_plugins_register_load_notify_cb (void(*func)(GaimPlugin *, void *), void *data) |
Registers a function that will be called when a plugin is loaded. | |
void | gaim_plugins_unregister_load_notify_cb (void(*func)(GaimPlugin *, void *)) |
Unregisters a function that would be called when a plugin is loaded. | |
void | gaim_plugins_register_unload_notify_cb (void(*func)(GaimPlugin *, void *), void *data) |
Registers a function that will be called when a plugin is unloaded. | |
void | gaim_plugins_unregister_unload_notify_cb (void(*func)(GaimPlugin *, void *)) |
Unregisters a function that would be called when a plugin is unloaded. | |
GaimPlugin * | gaim_plugins_find_with_name (const char *name) |
Finds a plugin with the specified name. | |
GaimPlugin * | gaim_plugins_find_with_filename (const char *filename) |
Finds a plugin with the specified filename (filename with a path). | |
GaimPlugin * | gaim_plugins_find_with_basename (const char *basename) |
Finds a plugin with the specified basename (filename without a path). | |
GaimPlugin * | gaim_plugins_find_with_id (const char *id) |
Finds a plugin with the specified plugin ID. | |
GList * | gaim_plugins_get_loaded (void) |
Returns a list of all loaded plugins. | |
GList * | gaim_plugins_get_protocols (void) |
Returns a list of all protocol plugins. | |
GList * | gaim_plugins_get_all (void) |
Returns a list of all plugins, whether loaded or not. |
gaim
Gaim is the legal property of its developers, whose names are too numerous to list here. Please refer to the COPYRIGHT file distributed with this source distribution.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define GAIM_INIT_PLUGIN | ( | pluginname, | |||
initfunc, | |||||
plugininfo | ) |
Value:
gboolean gaim_init_##pluginname##_plugin(void) { \ GaimPlugin *plugin = gaim_plugin_new(TRUE, NULL); \ plugin->info = &(plugininfo); \ initfunc((plugin)); \ return gaim_plugin_register(plugin); \ }
#define GAIM_PLUGIN_ACTIONS | ( | plugin, | |||
context | ) |
Value:
(GAIM_PLUGIN_HAS_ACTIONS(plugin)? \ (plugin)->info->actions(plugin, context): NULL)
enum GaimPluginType |
void gaim_plugin_destroy | ( | GaimPlugin * | plugin | ) |
Unloads a plugin and destroys the structure from memory.
plugin | The plugin handle. |
void* gaim_plugin_ipc_call | ( | GaimPlugin * | plugin, | |
const char * | command, | |||
gboolean * | ok, | |||
... | ||||
) |
Executes an IPC command.
plugin | The plugin to execute the command on. | |
command | The name of the command. | |
ok | TRUE if the call was successful, or FALSE otherwise. | |
... | The parameters to pass. |
gboolean gaim_plugin_ipc_get_params | ( | GaimPlugin * | plugin, | |
const char * | command, | |||
GaimValue ** | ret_value, | |||
int * | num_params, | |||
GaimValue *** | params | |||
) |
Returns a list of value types used for an IPC command.
plugin | The plugin. | |
command | The name of the command. | |
ret_value | The returned return value. | |
num_params | The returned number of parameters. | |
params | The returned list of parameters. |
gboolean gaim_plugin_ipc_register | ( | GaimPlugin * | plugin, | |
const char * | command, | |||
GaimCallback | func, | |||
GaimSignalMarshalFunc | marshal, | |||
GaimValue * | ret_value, | |||
int | num_params, | |||
... | ||||
) |
Registers an IPC command in a plugin.
plugin | The plugin to register the command with. | |
command | The name of the command. | |
func | The function to execute. | |
marshal | The marshalling function. | |
ret_value | The return value type. | |
num_params | The number of parameters. | |
... | The parameter types. |
void gaim_plugin_ipc_unregister | ( | GaimPlugin * | plugin, | |
const char * | command | |||
) |
Unregisters an IPC command in a plugin.
plugin | The plugin to unregister the command from. | |
command | The name of the command. |
void gaim_plugin_ipc_unregister_all | ( | GaimPlugin * | plugin | ) |
Unregisters all IPC commands in a plugin.
plugin | The plugin to unregister the commands from. |
gboolean gaim_plugin_is_loaded | ( | const GaimPlugin * | plugin | ) |
Returns whether or not a plugin is currently loaded.
plugin | The plugin. |
gboolean gaim_plugin_load | ( | GaimPlugin * | plugin | ) |
Attempts to load a previously probed plugin.
plugin | The plugin to load. |
TRUE
if successful, or FALSE
otherwise.GaimPlugin* gaim_plugin_new | ( | gboolean | native, | |
const char * | path | |||
) |
Creates a new plugin structure.
native | Whether or not the plugin is native. | |
path | The path to the plugin, or NULL if statically compiled. |
GaimPlugin* gaim_plugin_probe | ( | const char * | filename | ) |
Probes a plugin, retrieving the information on it and adding it to the list of available plugins.
filename | The plugin's filename. |
gboolean gaim_plugin_register | ( | GaimPlugin * | plugin | ) |
Registers a plugin and prepares it for loading.
This shouldn't be called by anything but the internal module code.
plugin | The plugin to register. |
gboolean gaim_plugin_reload | ( | GaimPlugin * | plugin | ) |
Reloads a plugin.
plugin | The old plugin handle. |
TRUE
if successful, or FALSE
otherwise.gboolean gaim_plugin_unload | ( | GaimPlugin * | plugin | ) |
Unloads the specified plugin.
plugin | The plugin handle. |
TRUE
if successful, or FALSE
otherwise.gboolean gaim_plugins_enabled | ( | void | ) |
Returns whether or not plugin support is enabled.
GaimPlugin* gaim_plugins_find_with_basename | ( | const char * | basename | ) |
Finds a plugin with the specified basename (filename without a path).
basename | The plugin basename. |
NULL
if not found. GaimPlugin* gaim_plugins_find_with_filename | ( | const char * | filename | ) |
Finds a plugin with the specified filename (filename with a path).
filename | The plugin filename. |
NULL
if not found. GaimPlugin* gaim_plugins_find_with_id | ( | const char * | id | ) |
Finds a plugin with the specified plugin ID.
id | The plugin ID. |
NULL
if not found. GaimPlugin* gaim_plugins_find_with_name | ( | const char * | name | ) |
Finds a plugin with the specified name.
name | The plugin name. |
NULL
if not found. GList* gaim_plugins_get_all | ( | void | ) |
Returns a list of all plugins, whether loaded or not.
GList* gaim_plugins_get_loaded | ( | void | ) |
Returns a list of all loaded plugins.
GList* gaim_plugins_get_protocols | ( | void | ) |
Returns a list of all protocol plugins.
void gaim_plugins_load_saved | ( | const char * | key | ) |
Attempts to load all the plugins in the specified preference key that were loaded when gaim last quit.
key | The preference key containing the list of plugins. |
void gaim_plugins_probe | ( | const char * | ext | ) |
Probes for plugins in the registered module paths.
ext | The extension type to probe for, or NULL for all. |
void gaim_plugins_register_load_notify_cb | ( | void(*)(GaimPlugin *, void *) | func, | |
void * | data | |||
) |
Registers a function that will be called when a plugin is loaded.
func | The callback function. | |
data | Data to pass to the callback. |
void gaim_plugins_register_probe_notify_cb | ( | void(*)(void *) | func, | |
void * | data | |||
) |
Registers a function that will be called when probing is finished.
func | The callback function. | |
data | Data to pass to the callback. |
void gaim_plugins_register_unload_notify_cb | ( | void(*)(GaimPlugin *, void *) | func, | |
void * | data | |||
) |
Registers a function that will be called when a plugin is unloaded.
func | The callback function. | |
data | Data to pass to the callback. |
void gaim_plugins_set_search_paths | ( | size_t | count, | |
char ** | paths | |||
) |
Sets the search paths for plugins.
count | The number of search paths. | |
paths | The search paths. |
void gaim_plugins_unregister_load_notify_cb | ( | void(*)(GaimPlugin *, void *) | func | ) |
Unregisters a function that would be called when a plugin is loaded.
func | The callback function. |
void gaim_plugins_unregister_probe_notify_cb | ( | void(*)(void *) | func | ) |
Unregisters a function that would be called when probing is finished.
func | The callback function. |
void gaim_plugins_unregister_unload_notify_cb | ( | void(*)(GaimPlugin *, void *) | func | ) |
Unregisters a function that would be called when a plugin is unloaded.
func | The callback function. |