38 GtkFileFilter *filter;
40 filter = gtk_file_filter_new();
41 gtk_file_filter_add_pattern(filter,
"*.gv");
42 gtk_file_filter_add_pattern(filter,
"*.dot");
43 dialog = gtk_file_chooser_dialog_new(
"Open File",
45 GTK_FILE_CHOOSER_ACTION_OPEN,
49 GTK_RESPONSE_ACCEPT,
NULL);
51 gtk_file_chooser_set_filter((GtkFileChooser *) dialog, filter);
52 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
54 filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
60 gtk_widget_destroy(dialog);
99void mCutSlot(GtkWidget *widget,
void *user_data) {
129 if (!gtk_widget_set_gl_capability
132 printf(
"glwidget creation failed \n");
139 static int state = 0;
142 gtk_widget_hide (glade_xml_get_widget(
xml,
"vbox13"));
143 gtk_widget_show (glade_xml_get_widget(
xml,
"show_console1"));
144 gtk_widget_hide (glade_xml_get_widget(
xml,
"hide_console1"));
148 gtk_widget_show (glade_xml_get_widget(
xml,
"vbox13"));
149 gtk_widget_hide (glade_xml_get_widget(
xml,
"show_console1"));
150 gtk_widget_show (glade_xml_get_widget(
xml,
"hide_console1"));
160 gtk_widget_show(glade_xml_get_widget(
xml,
"frmTVNodes"));
186 gtk_dialog_set_response_sensitive((GtkDialog *)
187 glade_xml_get_widget(
xml,
190 gtk_dialog_set_response_sensitive((GtkDialog *)
191 glade_xml_get_widget(
xml,
194 gtk_dialog_run((GtkDialog *)glade_xml_get_widget(
xml,
"dlgOpenGraph"));
196 gtk_widget_hide(glade_xml_get_widget(
xml,
"dlgOpenGraph"));
207 gtk_widget_hide(glade_xml_get_widget(
xml,
"frmObject"));
208 gtk_widget_show(glade_xml_get_widget(
xml,
"frmObject"));
237void mAbout(GtkWidget *widget,
void *user_data) {
245 cursor = gdk_cursor_new(
C);
248 gdk_cursor_destroy(cursor);
256 GtkTextBuffer *gtkbuf;
263 gtk_entry_get_text((GtkEntry *)
264 glade_xml_get_widget(
xml,
"gvprargs"));
266 gtk_text_view_get_buffer((GtkTextView *)
267 glade_xml_get_widget(
xml,
269 gtk_text_buffer_get_start_iter(gtkbuf, &startit);
270 gtk_text_buffer_get_end_iter(gtkbuf, &endit);
271 bf2 = gtk_text_buffer_get_text(gtkbuf, &startit, &endit, 0);
273 if (*args ==
'\0' && *bf2 ==
'\0') {
283 if (gtk_toggle_button_get_active
284 ((GtkToggleButton *) glade_xml_get_widget(
xml,
"gvprapplycb"))) {
292 argv[j++] =
"smyrna";
300#pragma GCC diagnostic push
301#pragma GCC diagnostic ignored "-Wcast-qual"
303 argv[j++] = (
char*)args;
305#pragma GCC diagnostic pop
325 FILE *input_file =
NULL;
328 GtkTextBuffer *gtkbuf;
332 char *filename =
NULL;
334 input_file = fopen(filename,
"r");
337 while (fgets(buf, BUFSIZ, input_file))
340 gtk_text_view_get_buffer((GtkTextView *)
341 glade_xml_get_widget(
xml,
344 if (g_utf8_validate(
str, -1,
NULL)) {
345 gtk_text_buffer_set_text(gtkbuf,
str, -1);
365 FILE *output_file =
NULL;
366 GtkTextBuffer *gtkbuf;
371 char *filename =
NULL;
373 output_file = fopen(filename,
"w");
377 gtk_text_view_get_buffer((GtkTextView *)
378 glade_xml_get_widget(
xml,
380 gtk_text_buffer_get_start_iter(gtkbuf, &startit);
381 gtk_text_buffer_get_end_iter(gtkbuf, &endit);
382 bf2 = gtk_text_buffer_get_text(gtkbuf, &startit, &endit, 0);
383 fputs(bf2, output_file);
static void agxbfree(agxbuf *xb)
free any malloced resources
static WUR char * agxbuse(agxbuf *xb)
void showAttrsWidget(void)
GdkGLConfig * configure_gl(void)
int openfiledlg(char **filename)
int savefiledlg(char **filename)
void load_graph_properties(void)
void show_gui_warning(char *str)
static Agraph_t * cloneGraph(std::vector< Agraph_t * > &gs, GVC_t *gvc, Agdesc_t kind)
int run_gvpr(Agraph_t *srcGraph, size_t argc, char *argv[])
static agxbuf xbuf[NUMXBUFS]
textitem scanner parser str
GtkWidget * drawing_area
open gl canvas
void show_settings_form(void)
void setup_tree(Agraph_t *g)
void close_graph(ViewInfo *vi)
int add_graph_to_viewport_from_file(char *fileName)