1 /* $Id$ $Revision$ */
2 /* vim:set shiftwidth=4 ts=8: */
3 
4 /*************************************************************************
5  * Copyright (c) 2011 AT&T Intellectual Property
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the Eclipse Public License v1.0
8  * which accompanies this distribution, and is available at
9  * http://www.eclipse.org/legal/epl-v10.html
10  *
11  * Contributors: See CVS logs. Details at http://www.graphviz.org/
12  *************************************************************************/
13 
14 #ifndef TVNODES_H
15 #define TVNODES_H
16 
17 #include "gui/gui.h"
18 #define MAX_NODE_PER_PAGE 100
19 #define LOCATION_X_CHKSELECTED 16
20 #define LOCATION_X_IDLABEL 45
21 #define LOCATION_X_CHKVISIBLE 139
22 #define LOCATION_X_CHKHIGHLIGHTED 202
23 #define LOCATION_X_NAME  276
24 #define LOCATION_X_DATA1 356
25 #define LOCATION_X_DATA2 561
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31     typedef struct token_info {
32 	int op_index;		// has to
33 	int op1_length;
34 	int op2_length;
35 
36     } token_info;
37 
38     typedef struct btree_node {
39 	int child_count;
40 	struct btree_node **childs;
41 	struct btree_node *parent;
42 	int rank;		//0 root
43 	char op;		// & | + - whatever
44 	int node_type;		//0 and 1 or 2 atom
45 	char *attr_name;
46 	char *regex;
47 	float min;
48 	float max;
49 	int value;		//filter result true false, 0 , 1
50 	int active;
51     } btree_node;
52 
53     typedef struct _tv_filter {
54 	btree_node *root;
55 	char *min_data1;
56 	char *min_data2;
57 	char *max_data1;
58 	char *max_data2;
59 	char *filter_string;
60 	int active;
61 	int visible;		//-1 all 0 not not visible 1 only visibles
62 	int highlighted;	//same above
63 	int selected;		//same above
64     } tv_filter;
65 
66     typedef struct _tv_node {
67 	int index;
68 	GtkCheckButton *chkSelected;
69 	GtkCheckButton *chkVisible;
70 	GtkCheckButton *chkHighlighted;
71 	GtkLabel *IDLabel;
72 	GtkEntry *Name;
73 	GtkEntry *Data1;
74 	GtkEntry *Data2;
75 	int valid;
76     } tv_node;
77 
78 
79     typedef struct _tv_nodes {
80 	int pagecount;
81 	int activepage;
82 	int firstnodeid;
83 	int *page_history;
84 	int page_history_count;
85 	int recordperpage;	//dynamic so that can be changed by plugins etc
86 	int filtered;
87 	int page_data_index;
88 	int page_data_node_index;
89 	tv_node TV_Node[MAX_NODE_PER_PAGE];
90 	tv_filter filter;
91 	int Y;
92 	int Y_Gap;
93 	int initial_Y;
94 	int chkSelected_X;
95 	int IDLabel_X;
96 	int chkVisible_X;
97 	int chkHighlighted_X;
98 	int Data1_X;
99 	int Data2_X;
100 	int initialized;
101 	int general_purpose_flag;	//dont forget to to set it back
102     } tv_nodes;
103 /*
104     extern tv_nodes TV_Nodes;
105 
106 
107 
108     void execute_tv_nodes(void);
109     int set_filter(tv_filter * TV_Filter, char *MinData1,
110 		   char *MaxData1, char *MinData2, char *MaxData2,
111 		   char *Filter_String, int selected, int visible,
112 		   int highlighted);
113     int tv_nodes_goto_page(int page);
114     int tv_nodes_next_page(void);
115     int tv_nodes_prior_page(void);
116     int tv_nodes_last_page(void);
117     int tv_nodes_first_page(void);
118 
119     int reset_page_History(void);
120     int prepare_page_history(void);
121     int create_save_subgraph_from_filter(char *filename);
122     int update_TV_data_from_gui(void);
123     int apply_filter_from_gui(void);
124     int tv_select_all(void);
125     int tv_unselect_all(void);
126     int tv_highligh_all(void);
127     int tv_unhighligh_all(void);
128 */
129     int tv_show_all(void);
130     int tv_hide_all(void);
131     int tv_save_as(int);
132     void setup_tree (Agraph_t* g);
133 
134 #ifdef __cplusplus
135 }				/* end extern "C" */
136 #endif
137 #endif
138