diff options
Diffstat (limited to 'egraph/Egraph.h')
-rw-r--r-- | egraph/Egraph.h | 233 |
1 files changed, 0 insertions, 233 deletions
diff --git a/egraph/Egraph.h b/egraph/Egraph.h deleted file mode 100644 index 553d5cd..0000000 --- a/egraph/Egraph.h +++ /dev/null @@ -1,233 +0,0 @@ -#include <Eina.h> -#include <Evas.h> -#include <Ecore.h> -#include <igraph/igraph.h> - -#define EGRAPH_VERTICES_MAX 16384 /* cannot be more that u_int32_t */ -#define EGRAPH_VERTICE_NAME_MAXLEN 60 - -typedef struct Egraph Egraph; -typedef struct Egraph_Edge Egraph_Edge; -typedef struct Egraph_Vertice Egraph_Vertice; - -typedef enum { - EGRAPH_LAYOUT_GRAPHOPT = 0, - EGRAPH_LAYOUT_KAMADAKAWAI = 1, - EGRAPH_LAYOUT_FRUCHTERMANREINGOLD = 2, -} Egraph_Layout; -#define EGRAPH_LAYOUT_DEFAULT EGRAPH_LAYOUT_GRAPHOPT -#define EGRAPH_LAYOUTING_IMPROVEMENTS 5 - -struct Egraph { - Evas_Object_Smart_Clipped_Data __clipped_data; - Evas_Object *obj; - Evas_Object *split_vertice_edge; - Evas *evas; - int graph_directed; - int display_vertices; - int display_names; - int display_edges; - int use_animations; - int do_improvements; - char *theme_path; - int theme_edges; - Egraph_Layout layout; - struct { - Ecore_Thread *thread; - int running; - int todo; - int changes_diff; - int improvement; /* special pass to improve the graph layout */ - } layouting; - Eina_Hash *vertices; - int vertices_count; - u_int32_t vertices_freeids[EGRAPH_VERTICES_MAX]; - int vertice_max_w; - int vertice_max_h; - Eina_List *edges; - igraph_t graph; - int graph_vcount; - igraph_matrix_t coords; - igraph_t graph2; // XXX remove use of graph here, see _repos() - int graph2_vcount; - igraph_vector_t graph2_wmin, graph2_wmax, graph2_hmin, graph2_hmax; - int graph_wmin, graph_wmax, graph_hmin, graph_hmax; - igraph_matrix_t coords2; -}; - -struct Egraph_Vertice { - u_int32_t id; - char *name; - char *type; - u_int status : 1; - Evas_Object *o; - Eina_List *edges; - Eina_List *blobs_incoming; - void *data; - u_int is_group : 1; - Eina_List *group_vertices; /* used if the vertice is a group */ - u_int new : 1; - u_int v2_new : 1; - u_int v2_del : 1; - u_int v3_new : 1; - u_int v3_del : 1; -}; - -struct Egraph_Edge { - Egraph_Vertice *a; - Egraph_Vertice *b; - char *type; - Evas_Object *o; - u_int o_usetheme : 1; - void *data; - u_int new : 1; - u_int v2_new : 1; - u_int v2_del : 1; - u_int v3_new : 1; - u_int v3_del : 1; -}; - -/** - * Creates Egraph Evas_Object - */ -Evas_Object *egraph_new(Evas *evas, int directed); - -/** - * Remove all nodes and edges - */ -void egraph_clear(Evas_Object *obj); - -/** - * Configure egraph to use an edje theme - */ -void egraph_theme_file_set(Evas_Object *obj, char *path); - -/** - * Sets if egraph should theme the edges - */ -void egraph_theme_edges_set(Evas_Object *obj, int set); - -/** - * Sets the layout of Egraph - */ -void egraph_layout_set(Evas_Object *obj, Egraph_Layout layout); - -/** - * Configure if Egraph should display vertices - */ -void egraph_display_vertices_set(Evas_Object *obj, int set); - -/** - * Configure if Egraph should display vertices names - */ -void egraph_display_names_set(Evas_Object *obj, int set); - -/** - * Configure if Egraph should display edges - */ -void egraph_display_edges_set(Evas_Object *obj, int set); - -/** - * Configure if Egraph should use animations - */ -void egraph_use_animations_set(Evas_Object *obj, int set); - -/** - * Configure if Egraph should do improvements after a graph change - */ -void egraph_do_improvements_set(Evas_Object *obj, int set); - -/** - * Adds an edge between existing vertices - * - * @param obj The Egraph object - * @param a First vertice - * @param b Second vertice - * @param data The pointer to attach - * @return The new Egraph_Egde object - */ -Egraph_Edge *egraph_edge_add(Evas_Object *obj, - Egraph_Vertice *a, Egraph_Vertice *b, void *data); - -/** - * Delete an edge - * - * Hint: This does not delete vertices - */ -void egraph_edge_del(Evas_Object *obj, Egraph_Edge *e); - -/** - * Sets the type of an edge, to make it appear differently in the graph, - * depending on theme - */ -void egraph_edge_type_set(Evas_Object *obj, - Egraph_Edge *e, const char *type); -/** - * Finds if an edge exists between 2 vertices - */ -Egraph_Edge *egraph_edge_find(Evas_Object *obj, - Egraph_Vertice *a, Egraph_Vertice *b); - -/** - * Add a vertice to the graph - * - * @param obj The Egraph object - * @param name The name of the vertice to be displayed. If NULL, no name is - * displayed - * @param data The pointer to attach - */ -Egraph_Vertice *egraph_vertice_add(Evas_Object *obj, - const char *name, void *data); - -/** - * Delete a vertice - * - * Hint: Also deletes all the edges attached to it - * - * @param obj The Egraph object - * @todo add user callback where edges are deleted - */ -void egraph_vertice_del(Evas_Object *obj, Egraph_Vertice *v); - -/** - * Update the name of a vertice - */ -void egraph_vertice_rename(Evas_Object *obj, Egraph_Vertice *v, - const char *name); - -/** - * Sets the type of a vertice, to make it appear differently in the graph, - * depending on theme - */ -void -egraph_vertice_type_set(Evas_Object *obj, Egraph_Vertice *v, const char *type); - - /** - * Send a blob from vertice to vertice - * - * A blob is a visual object that will move quickly from the first node to the - * second node. - */ -void egraph_vertice_send_blob(Evas_Object *obj, - Egraph_Vertice *a, Egraph_Vertice *b, - int size, u_int32_t color); - -/** - * Add a group of vertices, for later attaching nodes to it. - * - * The group is represented by an Egraph_Vertice with special properties. - */ -Egraph_Vertice *egraph_group_add(Evas_Object *obj, - const char *name, void *data); - -/** - * Attach a vertice to a group - */ -int egraph_group_vertice_attach(Evas_Object *obj, - Egraph_Vertice *group, Egraph_Vertice *v); - -/** - * Detach a vertice from a group - */ -void egraph_group_vertice_detach(Evas_Object *obj, - Egraph_Vertice *group, Egraph_Vertice *v); |