1 /* context-menu.c generated by valac 0.34.9, the Vala compiler
2 * generated from context-menu.vala, do not modify */
3
4 /*
5 * context-menu.vala - This file is part of the Geany MultiTerm plugin
6 *
7 * Copyright (c) 2012 Matthew Brush <matt@geany.org>.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 * MA 02110-1301, USA.
23 */
24
25 #include <glib.h>
26 #include <glib-object.h>
27 #include "multiterm.h"
28 #include <gtk/gtk.h>
29 #include <glib/gi18n-lib.h>
30 #include <stdlib.h>
31 #include <string.h>
32
33 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
34 typedef struct _Block1Data Block1Data;
35 typedef struct _Block2Data Block2Data;
36 #define _multi_term_shell_config_unref0(var) ((var == NULL) ? NULL : (var = (multi_term_shell_config_unref (var), NULL)))
37 #define _g_free0(var) (var = (g_free (var), NULL))
38
39 struct _Block1Data {
40 int _ref_count_;
41 MultiTermContextMenu* self;
42 GtkMenuItem* item;
43 GtkCheckMenuItem* check_item;
44 };
45
46 struct _Block2Data {
47 int _ref_count_;
48 Block1Data * _data1_;
49 MultiTermShellConfig* sh;
50 };
51
52
53 static gpointer multi_term_context_menu_parent_class = NULL;
54
55 enum {
56 MULTI_TERM_CONTEXT_MENU_DUMMY_PROPERTY
57 };
58 static void multi_term_context_menu_on_show_tabs_activate (MultiTermContextMenu* self, GtkCheckMenuItem* item);
59 static void multi_term_context_menu_on_next_previous_tab_activate (MultiTermContextMenu* self, GtkMenuItem* item, gboolean next);
60 static void multi_term_context_menu_on_move_to_location (MultiTermContextMenu* self, GtkMenuItem* item);
61 static void multi_term_context_menu_add_separator (MultiTermContextMenu* self);
62 static Block1Data* block1_data_ref (Block1Data* _data1_);
63 static void block1_data_unref (void * _userdata_);
64 static Block2Data* block2_data_ref (Block2Data* _data2_);
65 static void block2_data_unref (void * _userdata_);
66 static void _____lambda5_ (Block2Data* _data2_);
67 static void ______lambda5__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
68 static void __lambda6_ (MultiTermContextMenu* self);
69 static void ___lambda6__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
70 static void __lambda7_ (Block1Data* _data1_);
71 static void ___lambda7__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
72 static void __lambda8_ (Block1Data* _data1_);
73 static void ___lambda8__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
74 static void __lambda9_ (MultiTermContextMenu* self);
75 static void ___lambda9__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
76 static void __lambda10_ (MultiTermContextMenu* self);
77 static void ___lambda10__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
78 static void __lambda11_ (Block1Data* _data1_);
79 static void ___lambda11__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
80 static void __lambda12_ (Block1Data* _data1_);
81 static void ___lambda12__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
82 static void __lambda13_ (MultiTermContextMenu* self);
83 static void ___lambda13__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self);
84 static void g_cclosure_user_marshal_VOID__MULTI_TERM_SHELL_CONFIG (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
85 static void g_cclosure_user_marshal_BOOLEAN__VOID (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
86
87
multi_term_context_menu_on_show_tabs_activate(MultiTermContextMenu * self,GtkCheckMenuItem * item)88 static void multi_term_context_menu_on_show_tabs_activate (MultiTermContextMenu* self, GtkCheckMenuItem* item) {
89 GtkCheckMenuItem* _tmp0_ = NULL;
90 gboolean _tmp1_ = FALSE;
91 gboolean _tmp2_ = FALSE;
92 g_return_if_fail (self != NULL);
93 g_return_if_fail (item != NULL);
94 _tmp0_ = item;
95 _tmp1_ = gtk_check_menu_item_get_active (_tmp0_);
96 _tmp2_ = _tmp1_;
97 g_signal_emit_by_name (self, "show-tabs-activate", _tmp2_);
98 }
99
100
multi_term_context_menu_on_next_previous_tab_activate(MultiTermContextMenu * self,GtkMenuItem * item,gboolean next)101 static void multi_term_context_menu_on_next_previous_tab_activate (MultiTermContextMenu* self, GtkMenuItem* item, gboolean next) {
102 gboolean _tmp0_ = FALSE;
103 gboolean _tmp1_ = FALSE;
104 GtkMenuItem* _tmp4_ = NULL;
105 g_return_if_fail (self != NULL);
106 g_return_if_fail (item != NULL);
107 _tmp1_ = next;
108 if (_tmp1_) {
109 gboolean _tmp2_ = FALSE;
110 g_signal_emit_by_name (self, "next-tab-activate", &_tmp2_);
111 _tmp0_ = _tmp2_;
112 } else {
113 gboolean _tmp3_ = FALSE;
114 g_signal_emit_by_name (self, "previous-tab-activate", &_tmp3_);
115 _tmp0_ = _tmp3_;
116 }
117 _tmp4_ = item;
118 gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, _tmp0_);
119 }
120
121
multi_term_context_menu_on_move_to_location(MultiTermContextMenu * self,GtkMenuItem * item)122 static void multi_term_context_menu_on_move_to_location (MultiTermContextMenu* self, GtkMenuItem* item) {
123 GtkMenuItem* _tmp0_ = NULL;
124 gconstpointer _tmp1_ = NULL;
125 g_return_if_fail (self != NULL);
126 g_return_if_fail (item != NULL);
127 _tmp0_ = item;
128 _tmp1_ = g_object_get_data ((GObject*) _tmp0_, "location_is_msgwin");
129 if ((gboolean) ((gintptr) _tmp1_)) {
130 GtkMenuItem* _tmp2_ = NULL;
131 const gchar* _tmp3_ = NULL;
132 GtkMenuItem* _tmp4_ = NULL;
133 _tmp2_ = item;
134 _tmp3_ = _ ("Move to message window");
135 gtk_menu_item_set_label (_tmp2_, _tmp3_);
136 _tmp4_ = item;
137 g_object_set_data_full ((GObject*) _tmp4_, "location_is_msgwin", (gpointer) ((gintptr) FALSE), NULL);
138 g_signal_emit_by_name (self, "move-to-location-activate", "sidebar");
139 } else {
140 GtkMenuItem* _tmp5_ = NULL;
141 const gchar* _tmp6_ = NULL;
142 GtkMenuItem* _tmp7_ = NULL;
143 _tmp5_ = item;
144 _tmp6_ = _ ("Move to sidebar");
145 gtk_menu_item_set_label (_tmp5_, _tmp6_);
146 _tmp7_ = item;
147 g_object_set_data_full ((GObject*) _tmp7_, "location_is_msgwin", (gpointer) ((gintptr) TRUE), NULL);
148 g_signal_emit_by_name (self, "move-to-location-activate", "msgwin");
149 }
150 }
151
152
multi_term_context_menu_add_separator(MultiTermContextMenu * self)153 static void multi_term_context_menu_add_separator (MultiTermContextMenu* self) {
154 GtkSeparatorMenuItem* item = NULL;
155 GtkSeparatorMenuItem* _tmp0_ = NULL;
156 g_return_if_fail (self != NULL);
157 _tmp0_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
158 g_object_ref_sink (_tmp0_);
159 item = _tmp0_;
160 gtk_menu_shell_append ((GtkMenuShell*) self, (GtkWidget*) ((GtkMenuItem*) item));
161 gtk_widget_show ((GtkWidget*) item);
162 _g_object_unref0 (item);
163 }
164
165
block1_data_ref(Block1Data * _data1_)166 static Block1Data* block1_data_ref (Block1Data* _data1_) {
167 g_atomic_int_inc (&_data1_->_ref_count_);
168 return _data1_;
169 }
170
171
block1_data_unref(void * _userdata_)172 static void block1_data_unref (void * _userdata_) {
173 Block1Data* _data1_;
174 _data1_ = (Block1Data*) _userdata_;
175 if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
176 MultiTermContextMenu* self;
177 self = _data1_->self;
178 _g_object_unref0 (_data1_->check_item);
179 _g_object_unref0 (_data1_->item);
180 _g_object_unref0 (self);
181 g_slice_free (Block1Data, _data1_);
182 }
183 }
184
185
block2_data_ref(Block2Data * _data2_)186 static Block2Data* block2_data_ref (Block2Data* _data2_) {
187 g_atomic_int_inc (&_data2_->_ref_count_);
188 return _data2_;
189 }
190
191
block2_data_unref(void * _userdata_)192 static void block2_data_unref (void * _userdata_) {
193 Block2Data* _data2_;
194 _data2_ = (Block2Data*) _userdata_;
195 if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
196 MultiTermContextMenu* self;
197 self = _data2_->_data1_->self;
198 _multi_term_shell_config_unref0 (_data2_->sh);
199 block1_data_unref (_data2_->_data1_);
200 _data2_->_data1_ = NULL;
201 g_slice_free (Block2Data, _data2_);
202 }
203 }
204
205
_multi_term_shell_config_ref0(gpointer self)206 static gpointer _multi_term_shell_config_ref0 (gpointer self) {
207 return self ? multi_term_shell_config_ref (self) : NULL;
208 }
209
210
_____lambda5_(Block2Data * _data2_)211 static void _____lambda5_ (Block2Data* _data2_) {
212 Block1Data* _data1_;
213 MultiTermContextMenu* self;
214 MultiTermShellConfig* _tmp0_ = NULL;
215 _data1_ = _data2_->_data1_;
216 self = _data1_->self;
217 _tmp0_ = _data2_->sh;
218 g_signal_emit_by_name (self, "new-shell-activate", _tmp0_);
219 }
220
221
______lambda5__gtk_menu_item_activate(GtkMenuItem * _sender,gpointer self)222 static void ______lambda5__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
223 _____lambda5_ (self);
224 }
225
226
__lambda6_(MultiTermContextMenu * self)227 static void __lambda6_ (MultiTermContextMenu* self) {
228 g_signal_emit_by_name (self, "new-window-activate");
229 }
230
231
___lambda6__gtk_menu_item_activate(GtkMenuItem * _sender,gpointer self)232 static void ___lambda6__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
233 __lambda6_ ((MultiTermContextMenu*) self);
234 }
235
236
__lambda7_(Block1Data * _data1_)237 static void __lambda7_ (Block1Data* _data1_) {
238 MultiTermContextMenu* self;
239 GtkMenuItem* _tmp0_ = NULL;
240 self = _data1_->self;
241 _tmp0_ = _data1_->item;
242 multi_term_context_menu_on_next_previous_tab_activate (self, _tmp0_, TRUE);
243 }
244
245
___lambda7__gtk_menu_item_activate(GtkMenuItem * _sender,gpointer self)246 static void ___lambda7__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
247 __lambda7_ (self);
248 }
249
250
__lambda8_(Block1Data * _data1_)251 static void __lambda8_ (Block1Data* _data1_) {
252 MultiTermContextMenu* self;
253 GtkMenuItem* _tmp0_ = NULL;
254 self = _data1_->self;
255 _tmp0_ = _data1_->item;
256 multi_term_context_menu_on_next_previous_tab_activate (self, _tmp0_, FALSE);
257 }
258
259
___lambda8__gtk_menu_item_activate(GtkMenuItem * _sender,gpointer self)260 static void ___lambda8__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
261 __lambda8_ (self);
262 }
263
264
__lambda9_(MultiTermContextMenu * self)265 static void __lambda9_ (MultiTermContextMenu* self) {
266 g_signal_emit_by_name (self, "copy-activate");
267 }
268
269
___lambda9__gtk_menu_item_activate(GtkMenuItem * _sender,gpointer self)270 static void ___lambda9__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
271 __lambda9_ ((MultiTermContextMenu*) self);
272 }
273
274
__lambda10_(MultiTermContextMenu * self)275 static void __lambda10_ (MultiTermContextMenu* self) {
276 g_signal_emit_by_name (self, "paste-activate");
277 }
278
279
___lambda10__gtk_menu_item_activate(GtkMenuItem * _sender,gpointer self)280 static void ___lambda10__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
281 __lambda10_ ((MultiTermContextMenu*) self);
282 }
283
284
__lambda11_(Block1Data * _data1_)285 static void __lambda11_ (Block1Data* _data1_) {
286 MultiTermContextMenu* self;
287 GtkCheckMenuItem* _tmp0_ = NULL;
288 self = _data1_->self;
289 _tmp0_ = _data1_->check_item;
290 multi_term_context_menu_on_show_tabs_activate (self, _tmp0_);
291 }
292
293
___lambda11__gtk_menu_item_activate(GtkMenuItem * _sender,gpointer self)294 static void ___lambda11__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
295 __lambda11_ (self);
296 }
297
298
__lambda12_(Block1Data * _data1_)299 static void __lambda12_ (Block1Data* _data1_) {
300 MultiTermContextMenu* self;
301 GtkMenuItem* _tmp0_ = NULL;
302 self = _data1_->self;
303 _tmp0_ = _data1_->item;
304 multi_term_context_menu_on_move_to_location (self, _tmp0_);
305 }
306
307
___lambda12__gtk_menu_item_activate(GtkMenuItem * _sender,gpointer self)308 static void ___lambda12__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
309 __lambda12_ (self);
310 }
311
312
__lambda13_(MultiTermContextMenu * self)313 static void __lambda13_ (MultiTermContextMenu* self) {
314 g_signal_emit_by_name (self, "preferences-activate");
315 }
316
317
___lambda13__gtk_menu_item_activate(GtkMenuItem * _sender,gpointer self)318 static void ___lambda13__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) {
319 __lambda13_ ((MultiTermContextMenu*) self);
320 }
321
322
multi_term_context_menu_construct(GType object_type,MultiTermConfig * cfg)323 MultiTermContextMenu* multi_term_context_menu_construct (GType object_type, MultiTermConfig* cfg) {
324 MultiTermContextMenu * self = NULL;
325 Block1Data* _data1_;
326 GtkMenu* menu = NULL;
327 GtkImageMenuItem* image_item = NULL;
328 GtkMenu* _tmp0_ = NULL;
329 GtkMenu* _tmp1_ = NULL;
330 const gchar* _tmp2_ = NULL;
331 GtkMenuItem* _tmp3_ = NULL;
332 GtkMenuItem* _tmp4_ = NULL;
333 GtkMenu* _tmp5_ = NULL;
334 GtkMenuItem* _tmp6_ = NULL;
335 GtkMenuItem* _tmp7_ = NULL;
336 guint len = 0U;
337 MultiTermConfig* _tmp8_ = NULL;
338 GList* _tmp9_ = NULL;
339 GList* _tmp10_ = NULL;
340 guint _tmp11_ = 0U;
341 const gchar* _tmp31_ = NULL;
342 GtkMenuItem* _tmp32_ = NULL;
343 GtkMenuItem* _tmp33_ = NULL;
344 GtkMenuItem* _tmp34_ = NULL;
345 GtkMenuItem* _tmp35_ = NULL;
346 const gchar* _tmp36_ = NULL;
347 GtkMenuItem* _tmp37_ = NULL;
348 GtkMenuItem* _tmp38_ = NULL;
349 const gchar* _tmp39_ = NULL;
350 GtkMenuItem* _tmp40_ = NULL;
351 GtkMenuItem* _tmp41_ = NULL;
352 GtkImageMenuItem* _tmp42_ = NULL;
353 GtkImageMenuItem* _tmp43_ = NULL;
354 GtkImageMenuItem* _tmp44_ = NULL;
355 GtkImageMenuItem* _tmp45_ = NULL;
356 const gchar* _tmp46_ = NULL;
357 GtkCheckMenuItem* _tmp47_ = NULL;
358 GtkCheckMenuItem* _tmp48_ = NULL;
359 MultiTermConfig* _tmp49_ = NULL;
360 gboolean _tmp50_ = FALSE;
361 gboolean _tmp51_ = FALSE;
362 GtkCheckMenuItem* _tmp52_ = NULL;
363 GtkCheckMenuItem* _tmp53_ = NULL;
364 GtkCheckMenuItem* _tmp54_ = NULL;
365 MultiTermConfig* _tmp55_ = NULL;
366 gchar* _tmp56_ = NULL;
367 gchar* _tmp57_ = NULL;
368 gchar* _tmp58_ = NULL;
369 gboolean _tmp59_ = FALSE;
370 GtkMenuItem* _tmp66_ = NULL;
371 GtkMenuItem* _tmp67_ = NULL;
372 GtkMenuItem* _tmp68_ = NULL;
373 GtkImageMenuItem* _tmp69_ = NULL;
374 GtkImageMenuItem* _tmp70_ = NULL;
375 _data1_ = g_slice_new0 (Block1Data);
376 _data1_->_ref_count_ = 1;
377 self = (MultiTermContextMenu*) g_object_new (object_type, NULL);
378 _data1_->self = g_object_ref (self);
379 _tmp0_ = (GtkMenu*) gtk_menu_new ();
380 g_object_ref_sink (_tmp0_);
381 _g_object_unref0 (menu);
382 menu = _tmp0_;
383 _tmp1_ = menu;
384 gtk_widget_show ((GtkWidget*) _tmp1_);
385 _tmp2_ = _ ("Open Tab");
386 _tmp3_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp2_);
387 g_object_ref_sink (_tmp3_);
388 _g_object_unref0 (_data1_->item);
389 _data1_->item = _tmp3_;
390 _tmp4_ = _data1_->item;
391 _tmp5_ = menu;
392 gtk_menu_item_set_submenu (_tmp4_, (GtkWidget*) _tmp5_);
393 _tmp6_ = _data1_->item;
394 gtk_widget_show ((GtkWidget*) _tmp6_);
395 _tmp7_ = _data1_->item;
396 gtk_menu_shell_append ((GtkMenuShell*) self, (GtkWidget*) _tmp7_);
397 _tmp8_ = cfg;
398 _tmp9_ = multi_term_config_get_shell_configs (_tmp8_);
399 _tmp10_ = _tmp9_;
400 _tmp11_ = g_list_length (_tmp10_);
401 len = _tmp11_;
402 {
403 guint i = 0U;
404 i = (guint) 0;
405 {
406 gboolean _tmp12_ = FALSE;
407 _tmp12_ = TRUE;
408 while (TRUE) {
409 Block2Data* _data2_;
410 guint _tmp14_ = 0U;
411 guint _tmp15_ = 0U;
412 MultiTermConfig* _tmp16_ = NULL;
413 GList* _tmp17_ = NULL;
414 GList* _tmp18_ = NULL;
415 guint _tmp19_ = 0U;
416 gconstpointer _tmp20_ = NULL;
417 MultiTermShellConfig* _tmp21_ = NULL;
418 MultiTermShellConfig* _tmp22_ = NULL;
419 gchar* _tmp23_ = NULL;
420 gchar* _tmp24_ = NULL;
421 gchar* _tmp25_ = NULL;
422 GtkMenuItem* _tmp26_ = NULL;
423 GtkMenuItem* _tmp27_ = NULL;
424 GtkMenu* _tmp28_ = NULL;
425 GtkMenuItem* _tmp29_ = NULL;
426 GtkMenuItem* _tmp30_ = NULL;
427 _data2_ = g_slice_new0 (Block2Data);
428 _data2_->_ref_count_ = 1;
429 _data2_->_data1_ = block1_data_ref (_data1_);
430 if (!_tmp12_) {
431 guint _tmp13_ = 0U;
432 _tmp13_ = i;
433 i = _tmp13_ + 1;
434 }
435 _tmp12_ = FALSE;
436 _tmp14_ = i;
437 _tmp15_ = len;
438 if (!(_tmp14_ < _tmp15_)) {
439 block2_data_unref (_data2_);
440 _data2_ = NULL;
441 break;
442 }
443 _tmp16_ = cfg;
444 _tmp17_ = multi_term_config_get_shell_configs (_tmp16_);
445 _tmp18_ = _tmp17_;
446 _tmp19_ = i;
447 _tmp20_ = g_list_nth_data (_tmp18_, _tmp19_);
448 _tmp21_ = _multi_term_shell_config_ref0 ((MultiTermShellConfig*) _tmp20_);
449 _data2_->sh = _tmp21_;
450 _tmp22_ = _data2_->sh;
451 _tmp23_ = multi_term_shell_config_get_name (_tmp22_);
452 _tmp24_ = _tmp23_;
453 _tmp25_ = _tmp24_;
454 _tmp26_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp25_);
455 g_object_ref_sink (_tmp26_);
456 _g_object_unref0 (_data1_->item);
457 _data1_->item = _tmp26_;
458 _g_free0 (_tmp25_);
459 _tmp27_ = _data1_->item;
460 g_signal_connect_data (_tmp27_, "activate", (GCallback) ______lambda5__gtk_menu_item_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
461 _tmp28_ = menu;
462 _tmp29_ = _data1_->item;
463 gtk_menu_shell_append ((GtkMenuShell*) _tmp28_, (GtkWidget*) _tmp29_);
464 _tmp30_ = _data1_->item;
465 gtk_widget_show ((GtkWidget*) _tmp30_);
466 block2_data_unref (_data2_);
467 _data2_ = NULL;
468 }
469 }
470 }
471 _tmp31_ = _ ("Open Window");
472 _tmp32_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp31_);
473 g_object_ref_sink (_tmp32_);
474 _g_object_unref0 (_data1_->item);
475 _data1_->item = _tmp32_;
476 _tmp33_ = _data1_->item;
477 g_signal_connect_object (_tmp33_, "activate", (GCallback) ___lambda6__gtk_menu_item_activate, self, 0);
478 _tmp34_ = _data1_->item;
479 gtk_menu_shell_append ((GtkMenuShell*) self, (GtkWidget*) _tmp34_);
480 _tmp35_ = _data1_->item;
481 gtk_widget_show ((GtkWidget*) _tmp35_);
482 multi_term_context_menu_add_separator (self);
483 _tmp36_ = _ ("Next tab");
484 _tmp37_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp36_);
485 g_object_ref_sink (_tmp37_);
486 _g_object_unref0 (_data1_->item);
487 _data1_->item = _tmp37_;
488 _tmp38_ = _data1_->item;
489 g_signal_connect_data (_tmp38_, "activate", (GCallback) ___lambda7__gtk_menu_item_activate, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
490 _tmp39_ = _ ("Previous tab");
491 _tmp40_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp39_);
492 g_object_ref_sink (_tmp40_);
493 _g_object_unref0 (_data1_->item);
494 _data1_->item = _tmp40_;
495 _tmp41_ = _data1_->item;
496 g_signal_connect_data (_tmp41_, "activate", (GCallback) ___lambda8__gtk_menu_item_activate, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
497 _tmp42_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock (GTK_STOCK_COPY, NULL);
498 g_object_ref_sink (_tmp42_);
499 _g_object_unref0 (image_item);
500 image_item = _tmp42_;
501 _tmp43_ = image_item;
502 g_signal_connect_object ((GtkMenuItem*) _tmp43_, "activate", (GCallback) ___lambda9__gtk_menu_item_activate, self, 0);
503 _tmp44_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock (GTK_STOCK_PASTE, NULL);
504 g_object_ref_sink (_tmp44_);
505 _g_object_unref0 (image_item);
506 image_item = _tmp44_;
507 _tmp45_ = image_item;
508 g_signal_connect_object ((GtkMenuItem*) _tmp45_, "activate", (GCallback) ___lambda10__gtk_menu_item_activate, self, 0);
509 _tmp46_ = _ ("Show Tabs");
510 _tmp47_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label (_tmp46_);
511 g_object_ref_sink (_tmp47_);
512 _g_object_unref0 (_data1_->check_item);
513 _data1_->check_item = _tmp47_;
514 _tmp48_ = _data1_->check_item;
515 _tmp49_ = cfg;
516 _tmp50_ = multi_term_config_get_show_tabs (_tmp49_);
517 _tmp51_ = _tmp50_;
518 gtk_check_menu_item_set_active (_tmp48_, _tmp51_);
519 _tmp52_ = _data1_->check_item;
520 g_signal_connect_data ((GtkMenuItem*) _tmp52_, "activate", (GCallback) ___lambda11__gtk_menu_item_activate, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
521 _tmp53_ = _data1_->check_item;
522 gtk_menu_shell_append ((GtkMenuShell*) self, (GtkWidget*) ((GtkMenuItem*) _tmp53_));
523 _tmp54_ = _data1_->check_item;
524 gtk_widget_show ((GtkWidget*) _tmp54_);
525 _tmp55_ = cfg;
526 _tmp56_ = multi_term_config_get_location (_tmp55_);
527 _tmp57_ = _tmp56_;
528 _tmp58_ = _tmp57_;
529 _tmp59_ = g_strcmp0 (_tmp58_, "msgwin") == 0;
530 _g_free0 (_tmp58_);
531 if (_tmp59_) {
532 const gchar* _tmp60_ = NULL;
533 GtkMenuItem* _tmp61_ = NULL;
534 GtkMenuItem* _tmp62_ = NULL;
535 _tmp60_ = _ ("Move to sidebar");
536 _tmp61_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp60_);
537 g_object_ref_sink (_tmp61_);
538 _g_object_unref0 (_data1_->item);
539 _data1_->item = _tmp61_;
540 _tmp62_ = _data1_->item;
541 g_object_set_data_full ((GObject*) _tmp62_, "location_is_msgwin", (gpointer) ((gintptr) TRUE), NULL);
542 } else {
543 const gchar* _tmp63_ = NULL;
544 GtkMenuItem* _tmp64_ = NULL;
545 GtkMenuItem* _tmp65_ = NULL;
546 _tmp63_ = _ ("Move to message window");
547 _tmp64_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_tmp63_);
548 g_object_ref_sink (_tmp64_);
549 _g_object_unref0 (_data1_->item);
550 _data1_->item = _tmp64_;
551 _tmp65_ = _data1_->item;
552 g_object_set_data_full ((GObject*) _tmp65_, "location_is_msgwin", (gpointer) ((gintptr) FALSE), NULL);
553 }
554 _tmp66_ = _data1_->item;
555 g_signal_connect_data (_tmp66_, "activate", (GCallback) ___lambda12__gtk_menu_item_activate, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
556 _tmp67_ = _data1_->item;
557 gtk_menu_shell_append ((GtkMenuShell*) self, (GtkWidget*) _tmp67_);
558 _tmp68_ = _data1_->item;
559 gtk_widget_show ((GtkWidget*) _tmp68_);
560 _tmp69_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock (GTK_STOCK_PREFERENCES, NULL);
561 g_object_ref_sink (_tmp69_);
562 _g_object_unref0 (image_item);
563 image_item = _tmp69_;
564 _tmp70_ = image_item;
565 g_signal_connect_object ((GtkMenuItem*) _tmp70_, "activate", (GCallback) ___lambda13__gtk_menu_item_activate, self, 0);
566 _g_object_unref0 (image_item);
567 _g_object_unref0 (menu);
568 block1_data_unref (_data1_);
569 _data1_ = NULL;
570 return self;
571 }
572
573
multi_term_context_menu_new(MultiTermConfig * cfg)574 MultiTermContextMenu* multi_term_context_menu_new (MultiTermConfig* cfg) {
575 return multi_term_context_menu_construct (MULTI_TERM_TYPE_CONTEXT_MENU, cfg);
576 }
577
578
g_cclosure_user_marshal_VOID__MULTI_TERM_SHELL_CONFIG(GClosure * closure,GValue * return_value,guint n_param_values,const GValue * param_values,gpointer invocation_hint,gpointer marshal_data)579 static void g_cclosure_user_marshal_VOID__MULTI_TERM_SHELL_CONFIG (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
580 typedef void (*GMarshalFunc_VOID__MULTI_TERM_SHELL_CONFIG) (gpointer data1, gpointer arg_1, gpointer data2);
581 register GMarshalFunc_VOID__MULTI_TERM_SHELL_CONFIG callback;
582 register GCClosure * cc;
583 register gpointer data1;
584 register gpointer data2;
585 cc = (GCClosure *) closure;
586 g_return_if_fail (n_param_values == 2);
587 if (G_CCLOSURE_SWAP_DATA (closure)) {
588 data1 = closure->data;
589 data2 = param_values->data[0].v_pointer;
590 } else {
591 data1 = param_values->data[0].v_pointer;
592 data2 = closure->data;
593 }
594 callback = (GMarshalFunc_VOID__MULTI_TERM_SHELL_CONFIG) (marshal_data ? marshal_data : cc->callback);
595 callback (data1, multi_term_value_get_shell_config (param_values + 1), data2);
596 }
597
598
g_cclosure_user_marshal_BOOLEAN__VOID(GClosure * closure,GValue * return_value,guint n_param_values,const GValue * param_values,gpointer invocation_hint,gpointer marshal_data)599 static void g_cclosure_user_marshal_BOOLEAN__VOID (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
600 typedef gboolean (*GMarshalFunc_BOOLEAN__VOID) (gpointer data1, gpointer data2);
601 register GMarshalFunc_BOOLEAN__VOID callback;
602 register GCClosure * cc;
603 register gpointer data1;
604 register gpointer data2;
605 gboolean v_return;
606 cc = (GCClosure *) closure;
607 g_return_if_fail (return_value != NULL);
608 g_return_if_fail (n_param_values == 1);
609 if (G_CCLOSURE_SWAP_DATA (closure)) {
610 data1 = closure->data;
611 data2 = param_values->data[0].v_pointer;
612 } else {
613 data1 = param_values->data[0].v_pointer;
614 data2 = closure->data;
615 }
616 callback = (GMarshalFunc_BOOLEAN__VOID) (marshal_data ? marshal_data : cc->callback);
617 v_return = callback (data1, data2);
618 g_value_set_boolean (return_value, v_return);
619 }
620
621
multi_term_context_menu_class_init(MultiTermContextMenuClass * klass)622 static void multi_term_context_menu_class_init (MultiTermContextMenuClass * klass) {
623 multi_term_context_menu_parent_class = g_type_class_peek_parent (klass);
624 g_signal_new ("new_shell_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__MULTI_TERM_SHELL_CONFIG, G_TYPE_NONE, 1, MULTI_TERM_TYPE_SHELL_CONFIG);
625 g_signal_new ("new_window_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
626 g_signal_new ("copy_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
627 g_signal_new ("paste_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
628 g_signal_new ("show_tabs_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
629 g_signal_new ("preferences_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
630 g_signal_new ("next_tab_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_BOOLEAN__VOID, G_TYPE_BOOLEAN, 0);
631 g_signal_new ("previous_tab_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_BOOLEAN__VOID, G_TYPE_BOOLEAN, 0);
632 g_signal_new ("move_to_location_activate", MULTI_TERM_TYPE_CONTEXT_MENU, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
633 }
634
635
multi_term_context_menu_instance_init(MultiTermContextMenu * self)636 static void multi_term_context_menu_instance_init (MultiTermContextMenu * self) {
637 }
638
639
multi_term_context_menu_get_type(void)640 GType multi_term_context_menu_get_type (void) {
641 static volatile gsize multi_term_context_menu_type_id__volatile = 0;
642 if (g_once_init_enter (&multi_term_context_menu_type_id__volatile)) {
643 static const GTypeInfo g_define_type_info = { sizeof (MultiTermContextMenuClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) multi_term_context_menu_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MultiTermContextMenu), 0, (GInstanceInitFunc) multi_term_context_menu_instance_init, NULL };
644 GType multi_term_context_menu_type_id;
645 multi_term_context_menu_type_id = g_type_register_static (GTK_TYPE_MENU, "MultiTermContextMenu", &g_define_type_info, 0);
646 g_once_init_leave (&multi_term_context_menu_type_id__volatile, multi_term_context_menu_type_id);
647 }
648 return multi_term_context_menu_type_id__volatile;
649 }
650
651
652
653