plugin.h File Reference

Plugin API

gaim. More...

#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...

Plugin API

GaimPlugingaim_plugin_new (gboolean native, const char *path)
 Creates a new plugin structure.
GaimPlugingaim_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.
GaimPlugingaim_plugins_find_with_name (const char *name)
 Finds a plugin with the specified name.
GaimPlugingaim_plugins_find_with_filename (const char *filename)
 Finds a plugin with the specified filename (filename with a path).
GaimPlugingaim_plugins_find_with_basename (const char *basename)
 Finds a plugin with the specified basename (filename without a path).
GaimPlugingaim_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.

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)
GaimPluginActiongaim_plugin_action_new (char *label, void(*callback)(GaimPluginAction *))
 Allocates and returns a new GaimPluginAction.


Detailed Description

Plugin API

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 Documentation

#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); \
    }
Handles the initialization of modules.

#define GAIM_PLUGIN_ACTIONS ( plugin,
context   ) 

Value:

(GAIM_PLUGIN_HAS_ACTIONS(plugin)? \
    (plugin)->info->actions(plugin, context): NULL)


Enumeration Type Documentation

enum GaimPluginType

Plugin types.

Enumerator:
GAIM_PLUGIN_UNKNOWN  Unknown type.
GAIM_PLUGIN_STANDARD  Standard plugin.
GAIM_PLUGIN_LOADER  Loader plugin.
GAIM_PLUGIN_PROTOCOL  Protocol plugin.


Function Documentation

void gaim_plugin_destroy ( GaimPlugin plugin  ) 

Unloads a plugin and destroys the structure from memory.

Parameters:
plugin The plugin handle.

void* gaim_plugin_ipc_call ( GaimPlugin plugin,
const char *  command,
gboolean *  ok,
  ... 
)

Executes an IPC command.

Parameters:
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.
Returns:
The return value, which will be NULL if the command doesn't return a value.

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.

Parameters:
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.
Returns:
TRUE if the command was found, or FALSE otherwise.

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.

Parameters:
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.
Returns:
TRUE if the function was registered successfully, or FALSE otherwise.

void gaim_plugin_ipc_unregister ( GaimPlugin plugin,
const char *  command 
)

Unregisters an IPC command in a plugin.

Parameters:
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.

Parameters:
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.

Parameters:
plugin The plugin.
Returns:
TRUE if loaded, or FALSE otherwise.

gboolean gaim_plugin_load ( GaimPlugin plugin  ) 

Attempts to load a previously probed plugin.

Parameters:
plugin The plugin to load.
Returns:
TRUE if successful, or FALSE otherwise.
See also:
gaim_plugin_reload()

gaim_plugin_unload()

GaimPlugin* gaim_plugin_new ( gboolean  native,
const char *  path 
)

Creates a new plugin structure.

Parameters:
native Whether or not the plugin is native.
path The path to the plugin, or NULL if statically compiled.
Returns:
A new GaimPlugin 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.

Parameters:
filename The plugin's filename.
Returns:
The plugin handle.
See also:
gaim_plugin_load()

gaim_plugin_destroy()

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.

Parameters:
plugin The plugin to register.

gboolean gaim_plugin_reload ( GaimPlugin plugin  ) 

Reloads a plugin.

Parameters:
plugin The old plugin handle.
Returns:
TRUE if successful, or FALSE otherwise.
See also:
gaim_plugin_load()

gaim_plugin_unload()

gboolean gaim_plugin_unload ( GaimPlugin plugin  ) 

Unloads the specified plugin.

Parameters:
plugin The plugin handle.
Returns:
TRUE if successful, or FALSE otherwise.
See also:
gaim_plugin_load()

gaim_plugin_reload()

gboolean gaim_plugins_enabled ( void   ) 

Returns whether or not plugin support is enabled.

Returns:
TRUE if plugin support is enabled, or FALSE otherwise.

GaimPlugin* gaim_plugins_find_with_basename ( const char *  basename  ) 

Finds a plugin with the specified basename (filename without a path).

Parameters:
basename The plugin basename.
Returns:
The plugin if found, or NULL if not found.

GaimPlugin* gaim_plugins_find_with_filename ( const char *  filename  ) 

Finds a plugin with the specified filename (filename with a path).

Parameters:
filename The plugin filename.
Returns:
The plugin if found, or NULL if not found.

GaimPlugin* gaim_plugins_find_with_id ( const char *  id  ) 

Finds a plugin with the specified plugin ID.

Parameters:
id The plugin ID.
Returns:
The plugin if found, or NULL if not found.

GaimPlugin* gaim_plugins_find_with_name ( const char *  name  ) 

Finds a plugin with the specified name.

Parameters:
name The plugin name.
Returns:
The plugin if found, or NULL if not found.

GList* gaim_plugins_get_all ( void   ) 

Returns a list of all plugins, whether loaded or not.

Returns:
A list of all plugins.

GList* gaim_plugins_get_loaded ( void   ) 

Returns a list of all loaded plugins.

Returns:
A list of all loaded plugins.

GList* gaim_plugins_get_protocols ( void   ) 

Returns a list of all protocol plugins.

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.

Parameters:
key The preference key containing the list of plugins.

void gaim_plugins_probe ( const char *  ext  ) 

Probes for plugins in the registered module paths.

Parameters:
ext The extension type to probe for, or NULL for all.
See also:
gaim_plugin_set_probe_path()

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
func The callback function.


Generated on Wed Aug 9 23:40:44 2006 for gaim by  doxygen 1.4.7