Heraia  0.1.8
plugin.h File Reference

Header file where plugin definitions are sat. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  plugin_filter_t
 
struct  plugin_info_t
 Detailed information about a plugin. More...
 
struct  heraia_plugin_t
 Complete plugin structure. More...
 

Macros

#define HERAIA_PLUGIN_API_VERSION   1
 API Version to use to verify within the plugin that the interface is what expected. More...
 
#define HERAIA_PRIORITY_DEFAULT   0
 Priorities ... More...
 
#define HERAIA_PRIORITY_HIGHEST   9999
 highest priority More...
 
#define HERAIA_PRIORITY_LOWEST   -9999
 lowest priority More...
 

Typedefs

typedef void(* InitProc )(heraia_struct_t *)
 
typedef void(* QuitProc )(void)
 
typedef void(* RunProc )(GtkWidget *, gpointer)
 
typedef void(* RefreshProc )(heraia_struct_t *, void *)
 
typedef int PluginPriority
 
typedef gboolean(* ImportFunction )(const gchar *filename, void *user_data)
 import / export and filters functions this may change quickly More...
 
typedef gboolean(* ExportFunction )(const gchar *filename, void *user_data)
 

Enumerations

enum  PluginType { HERAIA_PLUGIN_UNKNOWN = -1, HERAIA_PLUGIN_FILTER = 0, HERAIA_PLUGIN_ACTION = 1 }
 Plugin types. More...
 
enum  PluginState {
  PLUGIN_STATE_RUNNING, PLUGIN_STATE_INITIALIZING, PLUGIN_STATE_LOADED, PLUGIN_STATE_NEW,
  PLUGIN_STATE_EXITING, PLUGIN_STATE_NONE
}
 May indicate the plugin state. More...
 

Functions

gboolean plugin_capable (void)
 Says whether the system can handle plugins (or not) More...
 
heraia_plugin_tnew_plugin (void)
 Creates a new empty plugin it may be initialised by the plugin itself ! More...
 
void free_plugin (heraia_plugin_t *plugin)
 free an unused plugin use with caution More...
 
void load_plugins (heraia_struct_t *main_struct)
 looks at the plugins dir(s) and loads the needed plugins (all ;-) (one at a time !!) More...
 
void add_entry_to_plugins_menu (heraia_struct_t *main_struct, heraia_plugin_t *plugin)
 adds a menu entry to the plugin menu adds a signal handler when the menu is toggled More...
 
heraia_plugin_tfind_plugin_by_name (GList *plugins_list, gchar *name)
 Finds the desired plugin by its name and return the plugin structure or NULL. More...
 
gboolean load_plugin_xml (heraia_struct_t *main_struct, heraia_plugin_t *plugin)
 Loads the xml's definition file that describes the plugin (.gtkbuilder suffix) tries the paths found in the location_list. More...
 
void refresh_all_plugins (heraia_struct_t *main_struct)
 To help the main program to send events to the plugins. More...
 

Detailed Description

Header file where plugin definitions are sat.

Definition in file plugin.h.

Macro Definition Documentation

#define HERAIA_PLUGIN_API_VERSION   1

API Version to use to verify within the plugin that the interface is what expected.

Definition at line 38 of file plugin.h.

#define HERAIA_PRIORITY_DEFAULT   0

Priorities ...

Default priority

Definition at line 87 of file plugin.h.

Referenced by heraia_plugin_init().

#define HERAIA_PRIORITY_HIGHEST   9999

highest priority

Definition at line 88 of file plugin.h.

#define HERAIA_PRIORITY_LOWEST   -9999

lowest priority

Note
do we use this ?

Definition at line 89 of file plugin.h.

Typedef Documentation

typedef gboolean(* ExportFunction)(const gchar *filename, void *user_data)

Definition at line 100 of file plugin.h.

typedef gboolean(* ImportFunction)(const gchar *filename, void *user_data)

import / export and filters functions this may change quickly

Definition at line 96 of file plugin.h.

typedef void(* InitProc)(heraia_struct_t *)

Definition at line 66 of file plugin.h.

typedef int PluginPriority

Definition at line 86 of file plugin.h.

typedef void(* QuitProc)(void)

Definition at line 67 of file plugin.h.

typedef void(* RefreshProc)(heraia_struct_t *, void *)

Definition at line 69 of file plugin.h.

typedef void(* RunProc)(GtkWidget *, gpointer)

Definition at line 68 of file plugin.h.

Enumeration Type Documentation

May indicate the plugin state.

Enumerator
PLUGIN_STATE_RUNNING 
PLUGIN_STATE_INITIALIZING 
PLUGIN_STATE_LOADED 
PLUGIN_STATE_NEW 
PLUGIN_STATE_EXITING 
PLUGIN_STATE_NONE 

Definition at line 54 of file plugin.h.

enum PluginType

Plugin types.

Enumerator
HERAIA_PLUGIN_UNKNOWN 

Unknown type.

HERAIA_PLUGIN_FILTER 

Filter plugin.

HERAIA_PLUGIN_ACTION 

Action plugin.

Definition at line 43 of file plugin.h.

Function Documentation

add_entry_to_plugins_menu ( heraia_struct_t main_struct,
heraia_plugin_t plugin 
)

adds a menu entry to the plugin menu adds a signal handler when the menu is toggled

Parameters
main_struct: main structure
plugin: a plugin to add to the plugin's menu

Definition at line 296 of file plugin.c.

References heraia_plugin_t::cmi_entry, heraia_get_widget(), heraia_plugin_t::info, xml_t::main, plugin_info_t::name, heraia_plugin_t::run_proc, and heraia_struct_t::xmls.

Referenced by init_plugin().

Here is the call graph for this function:

Here is the caller graph for this function:

heraia_plugin_t * find_plugin_by_name ( GList *  plugins_list,
gchar *  name 
)

Finds the desired plugin by its name and return the plugin structure or NULL.

Parameters
plugins_list: list of all available plugins
name: plugin's name we're looking for
Returns
Returns a heraia_plugin_t that correspond to the plugin or NULL if no plugin was found with that name

Definition at line 323 of file plugin.c.

References heraia_plugin_t::info, and plugin_info_t::name.

Referenced by init(), pn_treeview_double_click(), pn_treeview_selection_changed_cb(), and run().

Here is the caller graph for this function:

free_plugin ( heraia_plugin_t plugin)
load_plugin_xml ( heraia_struct_t main_struct,
heraia_plugin_t plugin 
)

Loads the xml's definition file that describes the plugin (.gtkbuilder suffix) tries the paths found in the location_list.

Parameters
main_struct: main structure
plugin: plugin for whom we want to load it's GtkBuilder XML definition file
Returns
Returns TRUE if everything went ok, FALSE otherwise

Definition at line 356 of file plugin.c.

References heraia_plugin_t::info, load_xml_file(), heraia_struct_t::location_list, plugin_info_t::name, and heraia_plugin_t::xml.

Referenced by init().

Here is the call graph for this function:

Here is the caller graph for this function:

load_plugins ( heraia_struct_t main_struct)

looks at the plugins dir(s) and loads the needed plugins (all ;-) (one at a time !!)

Parameters
main_struct: main structure
Todo:
Register all shared plugins (plugins_dir) (-DPLUGINS_DIR) This may be a config file option later ...

Definition at line 258 of file plugin.c.

References load_one_plugin(), and log_message().

Referenced by init_heraia_plugin_system().

Here is the call graph for this function:

Here is the caller graph for this function:

new_plugin ( void  )

Creates a new empty plugin it may be initialised by the plugin itself !

Returns
Returns a newly created heraia_plugin_t plugin structure

Definition at line 56 of file plugin.c.

References PLUGIN_STATE_NEW, and heraia_plugin_t::state.

Referenced by load_one_plugin().

Here is the caller graph for this function:

gboolean plugin_capable ( void  )

Says whether the system can handle plugins (or not)

Returns
Returns TRUE if the system is able to handle plugins, FALSE otherwise

Definition at line 43 of file plugin.c.

Referenced by init_heraia_plugin_system().

Here is the caller graph for this function:

refresh_all_plugins ( heraia_struct_t main_struct)

To help the main program to send events to the plugins.

Parameters
main_struct: main structure

Definition at line 378 of file plugin.c.

References heraia_struct_t::plugins_list, and heraia_plugin_t::refresh_proc.

Referenced by refresh_event_handler().

Here is the caller graph for this function: