gwymodule-graph

gwymodule-graph — Graph modules

Synopsis




struct      GwyGraphFuncInfo;
gboolean    (*GwyGraphFunc)                 (GwyGraph *graph,
                                             const gchar *name);
gboolean    gwy_graph_func_register         (const gchar *modname,
                                             GwyGraphFuncInfo *func_info);
gboolean    gwy_graph_func_run              (const guchar *name,
                                             GwyGraph *graph);
gchar*      gwy_graph_func_get_menu_path    (const gchar *name);
GtkObject*  gwy_graph_func_build_menu       (GtkObject *item_factory,
                                             const gchar *prefix,
                                             GCallback item_callback);

Description

Graph modules implement operations on graphs (like profiles).

Details

struct GwyGraphFuncInfo

struct GwyGraphFuncInfo {

    const gchar *name;
    const gchar *menu_path;
    GwyGraphFunc graph;
};

Information about one graph function.

const gchar *name An unique data graphing function name.
const gchar *menu_path A path under "/Data Graph" where the function should appear. It must start with "/".
GwyGraphFunc graph The function itself.

GwyGraphFunc ()

gboolean    (*GwyGraphFunc)                 (GwyGraph *graph,
                                             const gchar *name);

The type of graph function.

graph: Graph (a GwyGraph) to operate on.
name: Function name from GwyGraphFuncInfo (most modules can safely ignore this argument)
Returns : Whether it succeeded (XXX: this means exactly what?).

gwy_graph_func_register ()

gboolean    gwy_graph_func_register         (const gchar *modname,
                                             GwyGraphFuncInfo *func_info);

Registeres a data graphing function.

The passed func_info must not be an automatic variable.

modname: Module identifier (name).
func_info: Data graphing function info.
Returns : TRUE on success, FALSE on failure.

gwy_graph_func_run ()

gboolean    gwy_graph_func_run              (const guchar *name,
                                             GwyGraph *graph);

Runs a graph function identified by name.

name: Graph function name.
graph: Graph (a GwyGraph).
Returns : TRUE on success, FALSE on failure. XXX: whatever it means.

gwy_graph_func_get_menu_path ()

gchar*      gwy_graph_func_get_menu_path    (const gchar *name);

Returns the menu path of a data graph identified by name.

The returned menu path is only the tail part registered by the function, i.e., without any leading "/Graph".

name: Graph function name.
Returns : The menu path. The returned string must be treated as constant and never modified or freed.

gwy_graph_func_build_menu ()

GtkObject*  gwy_graph_func_build_menu       (GtkObject *item_factory,
                                             const gchar *prefix,
                                             GCallback item_callback);

Creates GtkItemFactory for a graph menu with all registered graph functions.

item_factory: A GtkItemFactory to add items to.
prefix: Where to add the menu items to the factory.
item_callback: A GtkItemFactoryCallback1 called when an item from the menu is selected.
Returns : The menu item factory as a GtkObject.