Graphviz  2.41.20171026.1811
interface.c
Go to the documentation of this file.
1 /*
2  * DO NOT EDIT THIS FILE - it is generated by Glade.
3  */
4 
5 #include "config.h"
6 
7 #include <sys/types.h>
8 #include <sys/stat.h>
9 #ifdef HAVE_UNISTD_H
10 #include <unistd.h>
11 #endif
12 #include <string.h>
13 #include <stdio.h>
14 
15 #include <gdk/gdkkeysyms.h>
16 #include <gtk/gtk.h>
17 
18 #include "callbacks.h"
19 #include "interface.h"
20 #include "support.h"
21 
22 #define GLADE_HOOKUP_OBJECT(component,widget,name) \
23  g_object_set_data_full (G_OBJECT (component), name, \
24  gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
25 
26 #define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
27  g_object_set_data (G_OBJECT (component), name, widget)
28 
29 GtkWidget*
31 {
32  GtkWidget *window1;
33  GtkWidget *vbox1;
34  GtkWidget *menubar1;
35  GtkWidget *menuitem4;
36  GtkWidget *menu4;
37  GtkWidget *new1;
38  GtkWidget *open1;
39  GtkWidget *save1;
40  GtkWidget *save_as1;
41  GtkWidget *separatormenuitem1;
42  GtkWidget *quit1;
43  GtkWidget *menuitem5;
44  GtkWidget *menu5;
45  GtkWidget *cut1;
46  GtkWidget *copy1;
47  GtkWidget *paste1;
48  GtkWidget *delete1;
49  GtkWidget *menuitem6;
50  GtkWidget *menu6;
51  GtkWidget *menuitem7;
52  GtkWidget *menu7;
53  GtkWidget *about1;
54  GtkWidget *hpaned1;
55  GtkWidget *vbox2;
56  GtkWidget *hbox2;
57  GtkWidget *drawingarea2;
58  GtkWidget *scrolledwindow3;
59  GtkWidget *treeview1;
60  GtkWidget *toolbar1;
61  GtkIconSize tmp_toolbar_icon_size;
62  GtkWidget *toolitem1;
63  GtkWidget *label1;
64  GtkWidget *toolitem2;
65  GtkWidget *label2;
66  GtkWidget *toolitem3;
67  GtkWidget *button1;
68  GtkWidget *scrolledwindow4;
69  GtkWidget *treeview2;
70  GtkWidget *drawingarea1;
71  GtkAccelGroup *accel_group;
72 
73  accel_group = gtk_accel_group_new ();
74 
75  window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
76  gtk_window_set_title (GTK_WINDOW (window1), "DotEdit");
77 
78  vbox1 = gtk_vbox_new (FALSE, 0);
79  gtk_widget_show (vbox1);
80  gtk_container_add (GTK_CONTAINER (window1), vbox1);
81 
82  menubar1 = gtk_menu_bar_new ();
83  gtk_widget_show (menubar1);
84  gtk_box_pack_start (GTK_BOX (vbox1), menubar1, FALSE, FALSE, 0);
85 
86  menuitem4 = gtk_menu_item_new_with_mnemonic (_("_File"));
87  gtk_widget_show (menuitem4);
88  gtk_container_add (GTK_CONTAINER (menubar1), menuitem4);
89 
90  menu4 = gtk_menu_new ();
91  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem4), menu4);
92 
93  new1 = gtk_image_menu_item_new_from_stock ("gtk-new", accel_group);
94  gtk_widget_show (new1);
95  gtk_container_add (GTK_CONTAINER (menu4), new1);
96 
97  open1 = gtk_image_menu_item_new_from_stock ("gtk-open", accel_group);
98  gtk_widget_show (open1);
99  gtk_container_add (GTK_CONTAINER (menu4), open1);
100 
101  save1 = gtk_image_menu_item_new_from_stock ("gtk-save", accel_group);
102  gtk_widget_show (save1);
103  gtk_container_add (GTK_CONTAINER (menu4), save1);
104 
105  save_as1 = gtk_image_menu_item_new_from_stock ("gtk-save-as", accel_group);
106  gtk_widget_show (save_as1);
107  gtk_container_add (GTK_CONTAINER (menu4), save_as1);
108 
109  separatormenuitem1 = gtk_separator_menu_item_new ();
110  gtk_widget_show (separatormenuitem1);
111  gtk_container_add (GTK_CONTAINER (menu4), separatormenuitem1);
112  gtk_widget_set_sensitive (separatormenuitem1, FALSE);
113 
114  quit1 = gtk_image_menu_item_new_from_stock ("gtk-quit", accel_group);
115  gtk_widget_show (quit1);
116  gtk_container_add (GTK_CONTAINER (menu4), quit1);
117 
118  menuitem5 = gtk_menu_item_new_with_mnemonic (_("_Edit"));
119  gtk_widget_show (menuitem5);
120  gtk_container_add (GTK_CONTAINER (menubar1), menuitem5);
121 
122  menu5 = gtk_menu_new ();
123  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem5), menu5);
124 
125  cut1 = gtk_image_menu_item_new_from_stock ("gtk-cut", accel_group);
126  gtk_widget_show (cut1);
127  gtk_container_add (GTK_CONTAINER (menu5), cut1);
128 
129  copy1 = gtk_image_menu_item_new_from_stock ("gtk-copy", accel_group);
130  gtk_widget_show (copy1);
131  gtk_container_add (GTK_CONTAINER (menu5), copy1);
132 
133  paste1 = gtk_image_menu_item_new_from_stock ("gtk-paste", accel_group);
134  gtk_widget_show (paste1);
135  gtk_container_add (GTK_CONTAINER (menu5), paste1);
136 
137  delete1 = gtk_image_menu_item_new_from_stock ("gtk-delete", accel_group);
138  gtk_widget_show (delete1);
139  gtk_container_add (GTK_CONTAINER (menu5), delete1);
140 
141  menuitem6 = gtk_menu_item_new_with_mnemonic (_("_View"));
142  gtk_widget_show (menuitem6);
143  gtk_container_add (GTK_CONTAINER (menubar1), menuitem6);
144 
145  menu6 = gtk_menu_new ();
146  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem6), menu6);
147 
148  menuitem7 = gtk_menu_item_new_with_mnemonic (_("_Help"));
149  gtk_widget_show (menuitem7);
150  gtk_container_add (GTK_CONTAINER (menubar1), menuitem7);
151 
152  menu7 = gtk_menu_new ();
153  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem7), menu7);
154 
155  about1 = gtk_menu_item_new_with_mnemonic (_("_About"));
156  gtk_widget_show (about1);
157  gtk_container_add (GTK_CONTAINER (menu7), about1);
158 
159  hpaned1 = gtk_hpaned_new ();
160  gtk_widget_show (hpaned1);
161  gtk_box_pack_start (GTK_BOX (vbox1), hpaned1, TRUE, TRUE, 0);
162  gtk_paned_set_position (GTK_PANED (hpaned1), 0);
163 
164  vbox2 = gtk_vbox_new (FALSE, 0);
165  gtk_widget_show (vbox2);
166  gtk_paned_pack1 (GTK_PANED (hpaned1), vbox2, TRUE, TRUE);
167 
168  hbox2 = gtk_hbox_new (FALSE, 0);
169  gtk_widget_show (hbox2);
170  gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
171 
172  drawingarea2 = gtk_drawing_area_new ();
173  gtk_widget_show (drawingarea2);
174  gtk_box_pack_start (GTK_BOX (hbox2), drawingarea2, FALSE, FALSE, 1);
175  gtk_widget_set_size_request (drawingarea2, 100, 100);
176 
177  scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL);
178  gtk_widget_show (scrolledwindow3);
179  gtk_box_pack_end (GTK_BOX (hbox2), scrolledwindow3, TRUE, TRUE, 1);
180  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
181  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_SHADOW_IN);
182 
183  treeview1 = gtk_tree_view_new ();
184  gtk_widget_show (treeview1);
185  gtk_container_add (GTK_CONTAINER (scrolledwindow3), treeview1);
186  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview1), FALSE);
187 
188  toolbar1 = gtk_toolbar_new ();
189  gtk_widget_show (toolbar1);
190  gtk_box_pack_start (GTK_BOX (vbox2), toolbar1, FALSE, FALSE, 0);
191  gtk_toolbar_set_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_ICONS);
192  tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1));
193 
194  toolitem1 = (GtkWidget*) gtk_tool_item_new ();
195  gtk_widget_show (toolitem1);
196  gtk_container_add (GTK_CONTAINER (toolbar1), toolitem1);
197 
198  label1 = gtk_label_new (_("type - name"));
199  gtk_widget_show (label1);
200  gtk_container_add (GTK_CONTAINER (toolitem1), label1);
201 
202  toolitem2 = (GtkWidget*) gtk_tool_item_new ();
203  gtk_widget_show (toolitem2);
204  gtk_tool_item_set_expand (GTK_TOOL_ITEM (toolitem2), TRUE);
205  gtk_container_add (GTK_CONTAINER (toolbar1), toolitem2);
206 
207  label2 = gtk_label_new ("");
208  gtk_widget_show (label2);
209  gtk_container_add (GTK_CONTAINER (toolitem2), label2);
210 
211  toolitem3 = (GtkWidget*) gtk_tool_item_new ();
212  gtk_widget_show (toolitem3);
213  gtk_container_add (GTK_CONTAINER (toolbar1), toolitem3);
214 
215  button1 = gtk_button_new_with_mnemonic (_("Delete"));
216  gtk_widget_show (button1);
217  gtk_container_add (GTK_CONTAINER (toolitem3), button1);
218  gtk_button_set_focus_on_click (GTK_BUTTON (button1), FALSE);
219 
220  scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL);
221  gtk_widget_show (scrolledwindow4);
222  gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow4, TRUE, TRUE, 1);
223  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
224  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_SHADOW_IN);
225 
226  treeview2 = gtk_tree_view_new ();
227  gtk_widget_show (treeview2);
228  gtk_container_add (GTK_CONTAINER (scrolledwindow4), treeview2);
229  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview2), FALSE);
230  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview2), TRUE);
231 
232  drawingarea1 = gtk_drawing_area_new ();
233  gtk_widget_show (drawingarea1);
234  gtk_paned_pack2 (GTK_PANED (hpaned1), drawingarea1, TRUE, TRUE);
235  gtk_widget_set_size_request (drawingarea1, 300, 300);
236  gtk_widget_set_events (drawingarea1, GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
237 
238  g_signal_connect ((gpointer) window1, "delete_event",
239  G_CALLBACK (on_window1_delete_event),
240  NULL);
241  g_signal_connect_swapped ((gpointer) new1, "activate",
242  G_CALLBACK (on_new1_activate),
243  GTK_OBJECT (window1));
244  g_signal_connect_swapped ((gpointer) open1, "activate",
245  G_CALLBACK (on_open1_activate),
246  GTK_OBJECT (window1));
247  g_signal_connect_swapped ((gpointer) save1, "activate",
248  G_CALLBACK (on_save1_activate),
249  GTK_OBJECT (window1));
250  g_signal_connect_swapped ((gpointer) save_as1, "activate",
251  G_CALLBACK (on_save_as1_activate),
252  GTK_OBJECT (window1));
253  g_signal_connect ((gpointer) quit1, "activate",
254  G_CALLBACK (on_quit1_activate),
255  NULL);
256  g_signal_connect ((gpointer) cut1, "activate",
257  G_CALLBACK (on_cut1_activate),
258  NULL);
259  g_signal_connect ((gpointer) copy1, "activate",
260  G_CALLBACK (on_copy1_activate),
261  NULL);
262  g_signal_connect ((gpointer) paste1, "activate",
263  G_CALLBACK (on_paste1_activate),
264  NULL);
265  g_signal_connect ((gpointer) delete1, "activate",
266  G_CALLBACK (on_delete1_activate),
267  NULL);
268  g_signal_connect ((gpointer) about1, "activate",
269  G_CALLBACK (on_about1_activate),
270  NULL);
271  g_signal_connect ((gpointer) drawingarea2, "expose_event",
272  G_CALLBACK (on_drawingarea2_expose_event),
273  NULL);
274  g_signal_connect ((gpointer) drawingarea2, "motion_notify_event",
276  NULL);
277  g_signal_connect ((gpointer) button1, "button_press_event",
278  G_CALLBACK (on_button1_button_press_event),
279  NULL);
280  g_signal_connect ((gpointer) drawingarea1, "expose_event",
281  G_CALLBACK (on_drawingarea1_expose_event),
282  NULL);
283  g_signal_connect ((gpointer) drawingarea1, "motion_notify_event",
285  NULL);
286  g_signal_connect ((gpointer) drawingarea1, "configure_event",
287  G_CALLBACK (on_drawingarea1_configure_event),
288  NULL);
289  g_signal_connect ((gpointer) drawingarea1, "button_press_event",
291  NULL);
292  g_signal_connect ((gpointer) drawingarea1, "button_release_event",
294  NULL);
295  g_signal_connect ((gpointer) drawingarea1, "scroll_event",
296  G_CALLBACK (on_drawingarea1_scroll_event),
297  NULL);
298 
299  /* Store pointers to all widgets, for use by lookup_widget(). */
300  GLADE_HOOKUP_OBJECT_NO_REF (window1, window1, "window1");
301  GLADE_HOOKUP_OBJECT (window1, vbox1, "vbox1");
302  GLADE_HOOKUP_OBJECT (window1, menubar1, "menubar1");
303  GLADE_HOOKUP_OBJECT (window1, menuitem4, "menuitem4");
304  GLADE_HOOKUP_OBJECT (window1, menu4, "menu4");
305  GLADE_HOOKUP_OBJECT (window1, new1, "new1");
306  GLADE_HOOKUP_OBJECT (window1, open1, "open1");
307  GLADE_HOOKUP_OBJECT (window1, save1, "save1");
308  GLADE_HOOKUP_OBJECT (window1, save_as1, "save_as1");
309  GLADE_HOOKUP_OBJECT (window1, separatormenuitem1, "separatormenuitem1");
310  GLADE_HOOKUP_OBJECT (window1, quit1, "quit1");
311  GLADE_HOOKUP_OBJECT (window1, menuitem5, "menuitem5");
312  GLADE_HOOKUP_OBJECT (window1, menu5, "menu5");
313  GLADE_HOOKUP_OBJECT (window1, cut1, "cut1");
314  GLADE_HOOKUP_OBJECT (window1, copy1, "copy1");
315  GLADE_HOOKUP_OBJECT (window1, paste1, "paste1");
316  GLADE_HOOKUP_OBJECT (window1, delete1, "delete1");
317  GLADE_HOOKUP_OBJECT (window1, menuitem6, "menuitem6");
318  GLADE_HOOKUP_OBJECT (window1, menu6, "menu6");
319  GLADE_HOOKUP_OBJECT (window1, menuitem7, "menuitem7");
320  GLADE_HOOKUP_OBJECT (window1, menu7, "menu7");
321  GLADE_HOOKUP_OBJECT (window1, about1, "about1");
322  GLADE_HOOKUP_OBJECT (window1, hpaned1, "hpaned1");
323  GLADE_HOOKUP_OBJECT (window1, vbox2, "vbox2");
324  GLADE_HOOKUP_OBJECT (window1, hbox2, "hbox2");
325  GLADE_HOOKUP_OBJECT (window1, drawingarea2, "drawingarea2");
326  GLADE_HOOKUP_OBJECT (window1, scrolledwindow3, "scrolledwindow3");
327  GLADE_HOOKUP_OBJECT (window1, treeview1, "treeview1");
328  GLADE_HOOKUP_OBJECT (window1, toolbar1, "toolbar1");
329  GLADE_HOOKUP_OBJECT (window1, toolitem1, "toolitem1");
330  GLADE_HOOKUP_OBJECT (window1, label1, "label1");
331  GLADE_HOOKUP_OBJECT (window1, toolitem2, "toolitem2");
332  GLADE_HOOKUP_OBJECT (window1, label2, "label2");
333  GLADE_HOOKUP_OBJECT (window1, toolitem3, "toolitem3");
334  GLADE_HOOKUP_OBJECT (window1, button1, "button1");
335  GLADE_HOOKUP_OBJECT (window1, scrolledwindow4, "scrolledwindow4");
336  GLADE_HOOKUP_OBJECT (window1, treeview2, "treeview2");
337  GLADE_HOOKUP_OBJECT (window1, drawingarea1, "drawingarea1");
338 
339  gtk_window_add_accel_group (GTK_WINDOW (window1), accel_group);
340 
341  return window1;
342 }
343 
void on_paste1_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: callbacks.c:158
gboolean on_button1_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
Definition: callbacks.c:426
gboolean on_drawingarea1_button_release_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
Definition: callbacks.c:382
#define GLADE_HOOKUP_OBJECT_NO_REF(component, widget, name)
Definition: interface.c:26
void on_save1_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: callbacks.c:108
void on_save_as1_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: callbacks.c:121
void on_quit1_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: callbacks.c:132
gboolean on_drawingarea1_scroll_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
Definition: callbacks.c:399
void on_about1_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: callbacks.c:174
void on_cut1_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: callbacks.c:141
void on_delete1_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: callbacks.c:166
#define GLADE_HOOKUP_OBJECT(component, widget, name)
Definition: interface.c:22
gboolean on_drawingarea1_motion_notify_event(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
Definition: callbacks.c:256
void on_new1_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: callbacks.c:25
void on_copy1_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: callbacks.c:150
gboolean on_drawingarea1_configure_event(GtkWidget *widget, GdkEventConfigure *event, gpointer user_data)
Definition: callbacks.c:328
void on_open1_activate(GtkMenuItem *menuitem, gpointer user_data)
Definition: callbacks.c:70
#define NULL
Definition: logic.h:39
gboolean on_drawingarea2_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
Definition: callbacks.c:288
gboolean on_drawingarea1_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
Definition: callbacks.c:364
#define _(String)
Definition: support.h:28
GtkWidget * create_window1(void)
Definition: interface.c:30
gboolean on_drawingarea1_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
Definition: callbacks.c:219
gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
Definition: callbacks.c:318
#define FALSE
Definition: cgraph.h:35
gboolean on_drawingarea2_motion_notify_event(GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
Definition: callbacks.c:277
#define TRUE
Definition: cgraph.h:38