![]() | ![]() | ![]() | Gwyddion Module Library Reference Manual | ![]() |
---|
gwymodule-graph — Graph modules
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); gboolean gwy_graph_func_exists (const gchar *name); 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);
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. |
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?). |
gboolean gwy_graph_func_register (const gchar *modname, GwyGraphFuncInfo *func_info);
Registeres a data graphing function.
To keep compatibility with old versions func_info should not be an automatic variable. However, since 1.6 it keeps a copy of func_info.
modname : | Module identifier (name). |
func_info : | Data graphing function info. |
Returns : | TRUE on success, FALSE on failure. |
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. |
gboolean gwy_graph_func_exists (const gchar *name);
Returns whether graph function name exists.
name : | Graph function name. |
Returns : | TRUE if name exists, FALSE otherwise. |
Since 1.4.
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. |
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. |
<< gwymodule-tool | gwymodule-layer >> |