1 /* symbols.c generated by valac 0.48.9, the Vala compiler
2 * generated from symbols.vala, do not modify */
3
4 /*
5 * This file is part of GNOME LaTeX.
6 *
7 * Copyright © 2010-2012 Sébastien Wilmet
8 *
9 * GNOME LaTeX 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 3 of the License, or
12 * (at your option) any later version.
13 *
14 * GNOME LaTeX 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 GNOME LaTeX. If not, see <http://www.gnu.org/licenses/>.
21 *
22 * Author: Sébastien Wilmet
23 */
24
25 #include <glib-object.h>
26 #include <gtk/gtk.h>
27 #include <gee.h>
28 #include <stdlib.h>
29 #include <string.h>
30 #include <glib.h>
31 #include <glib/gi18n-lib.h>
32 #include <gdk-pixbuf/gdk-pixbuf.h>
33
34 typedef enum {
35 SYMBOLS_CATEGORY_TYPE_NORMAL,
36 SYMBOLS_CATEGORY_TYPE_MOST_USED
37 } SymbolsCategoryType;
38
39 #define TYPE_SYMBOLS_CATEGORY_TYPE (symbols_category_type_get_type ())
40 typedef enum {
41 SYMBOLS_CATEGORY_COLUMN_TYPE,
42 SYMBOLS_CATEGORY_COLUMN_ICON,
43 SYMBOLS_CATEGORY_COLUMN_NAME,
44 SYMBOLS_CATEGORY_COLUMN_SYMBOLS_STORE,
45 SYMBOLS_CATEGORY_COLUMN_N_COLUMNS
46 } SymbolsCategoryColumn;
47
48 #define TYPE_SYMBOLS_CATEGORY_COLUMN (symbols_category_column_get_type ())
49 typedef enum {
50 SYMBOL_COLUMN_PIXBUF,
51 SYMBOL_COLUMN_COMMAND,
52 SYMBOL_COLUMN_TOOLTIP,
53 SYMBOL_COLUMN_ID,
54 SYMBOL_COLUMN_N_COLUMNS
55 } SymbolColumn;
56
57 #define TYPE_SYMBOL_COLUMN (symbol_column_get_type ())
58
59 #define TYPE_SYMBOLS (symbols_get_type ())
60 #define SYMBOLS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SYMBOLS, Symbols))
61 #define SYMBOLS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SYMBOLS, SymbolsClass))
62 #define IS_SYMBOLS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SYMBOLS))
63 #define IS_SYMBOLS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SYMBOLS))
64 #define SYMBOLS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SYMBOLS, SymbolsClass))
65
66 typedef struct _Symbols Symbols;
67 typedef struct _SymbolsClass SymbolsClass;
68 typedef struct _SymbolsPrivate SymbolsPrivate;
69
70 #define TYPE_NORMAL_SYMBOLS (normal_symbols_get_type ())
71 #define NORMAL_SYMBOLS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NORMAL_SYMBOLS, NormalSymbols))
72 #define NORMAL_SYMBOLS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NORMAL_SYMBOLS, NormalSymbolsClass))
73 #define IS_NORMAL_SYMBOLS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NORMAL_SYMBOLS))
74 #define IS_NORMAL_SYMBOLS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NORMAL_SYMBOLS))
75 #define NORMAL_SYMBOLS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NORMAL_SYMBOLS, NormalSymbolsClass))
76
77 typedef struct _NormalSymbols NormalSymbols;
78 typedef struct _NormalSymbolsClass NormalSymbolsClass;
79 enum {
80 SYMBOLS_0_PROPERTY,
81 SYMBOLS_NUM_PROPERTIES
82 };
83 static GParamSpec* symbols_properties[SYMBOLS_NUM_PROPERTIES];
84
85 #define SYMBOLS_TYPE_CATEGORY_INFO (symbols_category_info_get_type ())
86 typedef struct _SymbolsCategoryInfo SymbolsCategoryInfo;
87 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
88 #define _g_free0(var) (var = (g_free (var), NULL))
89
90 #define TYPE_MOST_USED_SYMBOLS (most_used_symbols_get_type ())
91 #define MOST_USED_SYMBOLS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MOST_USED_SYMBOLS, MostUsedSymbols))
92 #define MOST_USED_SYMBOLS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MOST_USED_SYMBOLS, MostUsedSymbolsClass))
93 #define IS_MOST_USED_SYMBOLS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MOST_USED_SYMBOLS))
94 #define IS_MOST_USED_SYMBOLS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MOST_USED_SYMBOLS))
95 #define MOST_USED_SYMBOLS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MOST_USED_SYMBOLS, MostUsedSymbolsClass))
96
97 typedef struct _MostUsedSymbols MostUsedSymbols;
98 typedef struct _MostUsedSymbolsClass MostUsedSymbolsClass;
99 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
100 typedef struct _NormalSymbolsPrivate NormalSymbolsPrivate;
101
102 #define NORMAL_SYMBOLS_TYPE_SYMBOL_INFO (normal_symbols_symbol_info_get_type ())
103 typedef struct _NormalSymbolsSymbolInfo NormalSymbolsSymbolInfo;
104 enum {
105 NORMAL_SYMBOLS_0_PROPERTY,
106 NORMAL_SYMBOLS_NUM_PROPERTIES
107 };
108 static GParamSpec* normal_symbols_properties[NORMAL_SYMBOLS_NUM_PROPERTIES];
109 #define _normal_symbols_symbol_info_free0(var) ((var == NULL) ? NULL : (var = (normal_symbols_symbol_info_free (var), NULL)))
110 #define _g_markup_parse_context_unref0(var) ((var == NULL) ? NULL : (var = (g_markup_parse_context_unref (var), NULL)))
111
112 struct _Symbols {
113 GObject parent_instance;
114 SymbolsPrivate * priv;
115 };
116
117 struct _SymbolsClass {
118 GObjectClass parent_class;
119 };
120
121 struct _SymbolsPrivate {
122 GtkListStore* _categories_store;
123 GeeMap* _normal_symbols_map;
124 };
125
126 struct _SymbolsCategoryInfo {
127 gchar* name;
128 gchar* icon;
129 gchar* id;
130 };
131
132 struct _NormalSymbols {
133 GtkListStore parent_instance;
134 NormalSymbolsPrivate * priv;
135 };
136
137 struct _NormalSymbolsClass {
138 GtkListStoreClass parent_class;
139 };
140
141 struct _NormalSymbolsSymbolInfo {
142 gchar* latex_command;
143 gchar* package_required;
144 };
145
146 struct _NormalSymbolsPrivate {
147 gchar* _category_id;
148 gchar* _resource_path;
149 GeeMap* _data;
150 };
151
152 static gint Symbols_private_offset;
153 static gpointer symbols_parent_class = NULL;
154 static Symbols* symbols__instance;
155 static Symbols* symbols__instance = NULL;
156 static gint NormalSymbols_private_offset;
157 static gpointer normal_symbols_parent_class = NULL;
158
159 GType symbols_category_type_get_type (void) G_GNUC_CONST;
160 GType symbols_category_column_get_type (void) G_GNUC_CONST;
161 GType symbol_column_get_type (void) G_GNUC_CONST;
162 GType symbols_get_type (void) G_GNUC_CONST;
163 G_DEFINE_AUTOPTR_CLEANUP_FUNC (Symbols, g_object_unref)
164 GType normal_symbols_get_type (void) G_GNUC_CONST;
165 G_DEFINE_AUTOPTR_CLEANUP_FUNC (NormalSymbols, g_object_unref)
166 static GType symbols_category_info_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
167 static SymbolsCategoryInfo* symbols_category_info_dup (const SymbolsCategoryInfo* self);
168 static void symbols_category_info_free (SymbolsCategoryInfo* self);
169 static void symbols_category_info_copy (const SymbolsCategoryInfo* self,
170 SymbolsCategoryInfo* dest);
171 static void symbols_category_info_destroy (SymbolsCategoryInfo* self);
172 static Symbols* symbols_new (void);
173 static Symbols* symbols_construct (GType object_type);
174 static void symbols_add_normal_category (Symbols* self,
175 SymbolsCategoryInfo* info);
176 Symbols* symbols_get_default (void);
177 static void symbols_add_most_used_category (Symbols* self);
178 GtkTreeModel* symbols_get_categories_model (Symbols* self);
179 gboolean symbols_get_symbol_info (Symbols* self,
180 const gchar* id,
181 gchar* * command,
182 gchar* * tooltip);
183 gboolean normal_symbols_get_symbol_info (NormalSymbols* self,
184 const gchar* icon_file,
185 gchar* * command,
186 gchar* * package);
187 gchar* symbols_get_tooltip (const gchar* latex_command,
188 const gchar* package_required);
189 NormalSymbols* normal_symbols_new (const gchar* category_id);
190 NormalSymbols* normal_symbols_construct (GType object_type,
191 const gchar* category_id);
192 GType most_used_symbols_get_type (void) G_GNUC_CONST;
193 G_DEFINE_AUTOPTR_CLEANUP_FUNC (MostUsedSymbols, g_object_unref)
194 MostUsedSymbols* most_used_symbols_get_default (void);
195 GtkTreeModel* most_used_symbols_get_model (MostUsedSymbols* self);
196 GdkPixbuf* symbols_get_pixbuf (const gchar* symbol_id);
197 static void symbols_finalize (GObject * obj);
198 static GType symbols_get_type_once (void);
199 static GType normal_symbols_symbol_info_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
200 static NormalSymbolsSymbolInfo* normal_symbols_symbol_info_dup (const NormalSymbolsSymbolInfo* self);
201 static void normal_symbols_symbol_info_free (NormalSymbolsSymbolInfo* self);
202 static void normal_symbols_symbol_info_copy (const NormalSymbolsSymbolInfo* self,
203 NormalSymbolsSymbolInfo* dest);
204 static void normal_symbols_symbol_info_destroy (NormalSymbolsSymbolInfo* self);
205 static void normal_symbols_load_symbols (NormalSymbols* self);
206 const gchar* utils_get_string_from_resource (const gchar* resource_path);
207 static void normal_symbols_parser_start (NormalSymbols* self,
208 GMarkupParseContext* context,
209 const gchar* name,
210 gchar** attr_names,
211 gint attr_names_length1,
212 gchar** attr_values,
213 gint attr_values_length1,
214 GError** error);
215 static void _normal_symbols_parser_start_gmarkup_parser_start_element_func (GMarkupParseContext* context,
216 const gchar* element_name,
217 gchar** attribute_names,
218 gchar** attribute_values,
219 gpointer self,
220 GError** error);
221 static void normal_symbols_add_symbol (NormalSymbols* self,
222 const gchar* icon_file,
223 NormalSymbolsSymbolInfo* symbol);
224 static void normal_symbols_finalize (GObject * obj);
225 static GType normal_symbols_get_type_once (void);
226 static void _vala_array_destroy (gpointer array,
227 gint array_length,
228 GDestroyNotify destroy_func);
229 static void _vala_array_free (gpointer array,
230 gint array_length,
231 GDestroyNotify destroy_func);
232 static gint _vala_array_length (gpointer array);
233
234 static const SymbolsCategoryInfo SYMBOLS__normal_categories[7] = {{N_ ("Greek"), "symbol_greek", "greek"}, {N_ ("Arrows"), "symbol_arrows", "arrows"}, {N_ ("Relations"), "symbol_relations", "relations"}, {N_ ("Operators"), "symbol_operators", "operators"}, {N_ ("Delimiters"), "symbol_delimiters", "delimiters"}, {N_ ("Misc math"), "symbol_misc_math", "misc-math"}, {N_ ("Misc text"), "symbol_misc_text", "misc-text"}};
235
236 static GType
symbols_category_type_get_type_once(void)237 symbols_category_type_get_type_once (void)
238 {
239 static const GEnumValue values[] = {{SYMBOLS_CATEGORY_TYPE_NORMAL, "SYMBOLS_CATEGORY_TYPE_NORMAL", "normal"}, {SYMBOLS_CATEGORY_TYPE_MOST_USED, "SYMBOLS_CATEGORY_TYPE_MOST_USED", "most-used"}, {0, NULL, NULL}};
240 GType symbols_category_type_type_id;
241 symbols_category_type_type_id = g_enum_register_static ("SymbolsCategoryType", values);
242 return symbols_category_type_type_id;
243 }
244
245 GType
symbols_category_type_get_type(void)246 symbols_category_type_get_type (void)
247 {
248 static volatile gsize symbols_category_type_type_id__volatile = 0;
249 if (g_once_init_enter (&symbols_category_type_type_id__volatile)) {
250 GType symbols_category_type_type_id;
251 symbols_category_type_type_id = symbols_category_type_get_type_once ();
252 g_once_init_leave (&symbols_category_type_type_id__volatile, symbols_category_type_type_id);
253 }
254 return symbols_category_type_type_id__volatile;
255 }
256
257 static GType
symbols_category_column_get_type_once(void)258 symbols_category_column_get_type_once (void)
259 {
260 static const GEnumValue values[] = {{SYMBOLS_CATEGORY_COLUMN_TYPE, "SYMBOLS_CATEGORY_COLUMN_TYPE", "type"}, {SYMBOLS_CATEGORY_COLUMN_ICON, "SYMBOLS_CATEGORY_COLUMN_ICON", "icon"}, {SYMBOLS_CATEGORY_COLUMN_NAME, "SYMBOLS_CATEGORY_COLUMN_NAME", "name"}, {SYMBOLS_CATEGORY_COLUMN_SYMBOLS_STORE, "SYMBOLS_CATEGORY_COLUMN_SYMBOLS_STORE", "symbols-store"}, {SYMBOLS_CATEGORY_COLUMN_N_COLUMNS, "SYMBOLS_CATEGORY_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
261 GType symbols_category_column_type_id;
262 symbols_category_column_type_id = g_enum_register_static ("SymbolsCategoryColumn", values);
263 return symbols_category_column_type_id;
264 }
265
266 GType
symbols_category_column_get_type(void)267 symbols_category_column_get_type (void)
268 {
269 static volatile gsize symbols_category_column_type_id__volatile = 0;
270 if (g_once_init_enter (&symbols_category_column_type_id__volatile)) {
271 GType symbols_category_column_type_id;
272 symbols_category_column_type_id = symbols_category_column_get_type_once ();
273 g_once_init_leave (&symbols_category_column_type_id__volatile, symbols_category_column_type_id);
274 }
275 return symbols_category_column_type_id__volatile;
276 }
277
278 static GType
symbol_column_get_type_once(void)279 symbol_column_get_type_once (void)
280 {
281 static const GEnumValue values[] = {{SYMBOL_COLUMN_PIXBUF, "SYMBOL_COLUMN_PIXBUF", "pixbuf"}, {SYMBOL_COLUMN_COMMAND, "SYMBOL_COLUMN_COMMAND", "command"}, {SYMBOL_COLUMN_TOOLTIP, "SYMBOL_COLUMN_TOOLTIP", "tooltip"}, {SYMBOL_COLUMN_ID, "SYMBOL_COLUMN_ID", "id"}, {SYMBOL_COLUMN_N_COLUMNS, "SYMBOL_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
282 GType symbol_column_type_id;
283 symbol_column_type_id = g_enum_register_static ("SymbolColumn", values);
284 return symbol_column_type_id;
285 }
286
287 GType
symbol_column_get_type(void)288 symbol_column_get_type (void)
289 {
290 static volatile gsize symbol_column_type_id__volatile = 0;
291 if (g_once_init_enter (&symbol_column_type_id__volatile)) {
292 GType symbol_column_type_id;
293 symbol_column_type_id = symbol_column_get_type_once ();
294 g_once_init_leave (&symbol_column_type_id__volatile, symbol_column_type_id);
295 }
296 return symbol_column_type_id__volatile;
297 }
298
299 static inline gpointer
symbols_get_instance_private(Symbols * self)300 symbols_get_instance_private (Symbols* self)
301 {
302 return G_STRUCT_MEMBER_P (self, Symbols_private_offset);
303 }
304
305 static Symbols*
symbols_construct(GType object_type)306 symbols_construct (GType object_type)
307 {
308 Symbols * self = NULL;
309 GtkListStore* _tmp0_;
310 GeeHashMap* _tmp1_;
311 #line 75 "symbols.vala"
312 self = (Symbols*) g_object_new (object_type, NULL);
313 #line 77 "symbols.vala"
314 _tmp0_ = gtk_list_store_new ((gint) SYMBOLS_CATEGORY_COLUMN_N_COLUMNS, TYPE_SYMBOLS_CATEGORY_TYPE, G_TYPE_STRING, G_TYPE_STRING, gtk_tree_model_get_type (), -1);
315 #line 77 "symbols.vala"
316 _g_object_unref0 (self->priv->_categories_store);
317 #line 77 "symbols.vala"
318 self->priv->_categories_store = _tmp0_;
319 #line 84 "symbols.vala"
320 _tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, TYPE_NORMAL_SYMBOLS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
321 #line 84 "symbols.vala"
322 _g_object_unref0 (self->priv->_normal_symbols_map);
323 #line 84 "symbols.vala"
324 self->priv->_normal_symbols_map = (GeeMap*) _tmp1_;
325 #line 326 "symbols.c"
326 {
327 SymbolsCategoryInfo* info_collection = NULL;
328 gint info_collection_length1 = 0;
329 gint _info_collection_size_ = 0;
330 gint info_it = 0;
331 #line 86 "symbols.vala"
332 info_collection = SYMBOLS__normal_categories;
333 #line 86 "symbols.vala"
334 info_collection_length1 = G_N_ELEMENTS (SYMBOLS__normal_categories);
335 #line 86 "symbols.vala"
336 for (info_it = 0; info_it < info_collection_length1; info_it = info_it + 1) {
337 #line 338 "symbols.c"
338 SymbolsCategoryInfo _tmp2_;
339 SymbolsCategoryInfo _tmp3_ = {0};
340 SymbolsCategoryInfo info = {0};
341 #line 86 "symbols.vala"
342 _tmp2_ = info_collection[info_it];
343 #line 86 "symbols.vala"
344 symbols_category_info_copy (&_tmp2_, &_tmp3_);
345 #line 86 "symbols.vala"
346 info = _tmp3_;
347 #line 348 "symbols.c"
348 {
349 SymbolsCategoryInfo _tmp4_;
350 #line 87 "symbols.vala"
351 _tmp4_ = info;
352 #line 87 "symbols.vala"
353 symbols_add_normal_category (self, &_tmp4_);
354 #line 86 "symbols.vala"
355 symbols_category_info_destroy (&info);
356 #line 357 "symbols.c"
357 }
358 }
359 }
360 #line 75 "symbols.vala"
361 return self;
362 #line 363 "symbols.c"
363 }
364
365 static Symbols*
symbols_new(void)366 symbols_new (void)
367 {
368 #line 75 "symbols.vala"
369 return symbols_construct (TYPE_SYMBOLS);
370 #line 371 "symbols.c"
371 }
372
373 static gpointer
_g_object_ref0(gpointer self)374 _g_object_ref0 (gpointer self)
375 {
376 #line 102 "symbols.vala"
377 return self ? g_object_ref (self) : NULL;
378 #line 379 "symbols.c"
379 }
380
381 Symbols*
symbols_get_default(void)382 symbols_get_default (void)
383 {
384 Symbols* _tmp0_;
385 Symbols* _tmp3_;
386 Symbols* _tmp4_;
387 Symbols* result = NULL;
388 #line 92 "symbols.vala"
389 _tmp0_ = symbols__instance;
390 #line 92 "symbols.vala"
391 if (_tmp0_ == NULL) {
392 #line 393 "symbols.c"
393 Symbols* _tmp1_;
394 Symbols* _tmp2_;
395 #line 94 "symbols.vala"
396 _tmp1_ = symbols_new ();
397 #line 94 "symbols.vala"
398 _g_object_unref0 (symbols__instance);
399 #line 94 "symbols.vala"
400 symbols__instance = _tmp1_;
401 #line 99 "symbols.vala"
402 _tmp2_ = symbols__instance;
403 #line 99 "symbols.vala"
404 symbols_add_most_used_category (_tmp2_);
405 #line 406 "symbols.c"
406 }
407 #line 102 "symbols.vala"
408 _tmp3_ = symbols__instance;
409 #line 102 "symbols.vala"
410 _tmp4_ = _g_object_ref0 (_tmp3_);
411 #line 102 "symbols.vala"
412 result = _tmp4_;
413 #line 102 "symbols.vala"
414 return result;
415 #line 416 "symbols.c"
416 }
417
418 GtkTreeModel*
symbols_get_categories_model(Symbols * self)419 symbols_get_categories_model (Symbols* self)
420 {
421 GtkListStore* _tmp0_;
422 GtkTreeModel* _tmp1_;
423 GtkTreeModel* result = NULL;
424 #line 105 "symbols.vala"
425 g_return_val_if_fail (self != NULL, NULL);
426 #line 107 "symbols.vala"
427 _tmp0_ = self->priv->_categories_store;
428 #line 107 "symbols.vala"
429 _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_tree_model_get_type ()) ? ((GtkTreeModel*) _tmp0_) : NULL);
430 #line 107 "symbols.vala"
431 result = _tmp1_;
432 #line 107 "symbols.vala"
433 return result;
434 #line 435 "symbols.c"
435 }
436
437 gboolean
symbols_get_symbol_info(Symbols * self,const gchar * id,gchar ** command,gchar ** tooltip)438 symbols_get_symbol_info (Symbols* self,
439 const gchar* id,
440 gchar* * command,
441 gchar* * tooltip)
442 {
443 gchar* _vala_command = NULL;
444 gchar* _vala_tooltip = NULL;
445 gchar** id_components = NULL;
446 gchar** _tmp0_;
447 gchar** _tmp1_;
448 gint id_components_length1;
449 gint _id_components_size_;
450 gchar* category_id = NULL;
451 const gchar* _tmp2_;
452 gchar* _tmp3_;
453 gchar* icon_file = NULL;
454 const gchar* _tmp4_;
455 gchar* _tmp5_;
456 GeeMap* _tmp6_;
457 NormalSymbols* normal_symbols = NULL;
458 GeeMap* _tmp7_;
459 gpointer _tmp8_;
460 gchar* package = NULL;
461 gboolean ok = FALSE;
462 gchar* _tmp9_ = NULL;
463 gchar* _tmp10_ = NULL;
464 gboolean _tmp11_;
465 const gchar* _tmp12_;
466 const gchar* _tmp13_;
467 gchar* _tmp14_;
468 gboolean result = FALSE;
469 #line 110 "symbols.vala"
470 g_return_val_if_fail (self != NULL, FALSE);
471 #line 110 "symbols.vala"
472 g_return_val_if_fail (id != NULL, FALSE);
473 #line 112 "symbols.vala"
474 _g_free0 (_vala_command);
475 #line 112 "symbols.vala"
476 _vala_command = NULL;
477 #line 113 "symbols.vala"
478 _g_free0 (_vala_tooltip);
479 #line 113 "symbols.vala"
480 _vala_tooltip = NULL;
481 #line 115 "symbols.vala"
482 _tmp1_ = _tmp0_ = g_strsplit (id, "/", 0);
483 #line 115 "symbols.vala"
484 id_components = _tmp1_;
485 #line 115 "symbols.vala"
486 id_components_length1 = _vala_array_length (_tmp0_);
487 #line 115 "symbols.vala"
488 _id_components_size_ = id_components_length1;
489 #line 116 "symbols.vala"
490 g_return_val_if_fail (id_components_length1 == 2, FALSE);
491 #line 118 "symbols.vala"
492 _tmp2_ = id_components[0];
493 #line 118 "symbols.vala"
494 _tmp3_ = g_strdup (_tmp2_);
495 #line 118 "symbols.vala"
496 category_id = _tmp3_;
497 #line 119 "symbols.vala"
498 _tmp4_ = id_components[1];
499 #line 119 "symbols.vala"
500 _tmp5_ = g_strdup (_tmp4_);
501 #line 119 "symbols.vala"
502 icon_file = _tmp5_;
503 #line 121 "symbols.vala"
504 _tmp6_ = self->priv->_normal_symbols_map;
505 #line 121 "symbols.vala"
506 g_return_val_if_fail (gee_map_has_key (_tmp6_, category_id), FALSE);
507 #line 123 "symbols.vala"
508 _tmp7_ = self->priv->_normal_symbols_map;
509 #line 123 "symbols.vala"
510 _tmp8_ = gee_map_get (_tmp7_, category_id);
511 #line 123 "symbols.vala"
512 normal_symbols = (NormalSymbols*) _tmp8_;
513 #line 125 "symbols.vala"
514 package = NULL;
515 #line 126 "symbols.vala"
516 _tmp11_ = normal_symbols_get_symbol_info (normal_symbols, icon_file, &_tmp9_, &_tmp10_);
517 #line 126 "symbols.vala"
518 _g_free0 (_vala_command);
519 #line 126 "symbols.vala"
520 _vala_command = _tmp9_;
521 #line 126 "symbols.vala"
522 _g_free0 (package);
523 #line 126 "symbols.vala"
524 package = _tmp10_;
525 #line 126 "symbols.vala"
526 ok = _tmp11_;
527 #line 128 "symbols.vala"
528 g_return_val_if_fail (ok, FALSE);
529 #line 130 "symbols.vala"
530 _tmp12_ = _vala_command;
531 #line 130 "symbols.vala"
532 _tmp13_ = package;
533 #line 130 "symbols.vala"
534 _tmp14_ = symbols_get_tooltip (_tmp12_, _tmp13_);
535 #line 130 "symbols.vala"
536 _g_free0 (_vala_tooltip);
537 #line 130 "symbols.vala"
538 _vala_tooltip = _tmp14_;
539 #line 131 "symbols.vala"
540 result = TRUE;
541 #line 131 "symbols.vala"
542 _g_free0 (package);
543 #line 131 "symbols.vala"
544 _g_object_unref0 (normal_symbols);
545 #line 131 "symbols.vala"
546 _g_free0 (icon_file);
547 #line 131 "symbols.vala"
548 _g_free0 (category_id);
549 #line 131 "symbols.vala"
550 id_components = (_vala_array_free (id_components, id_components_length1, (GDestroyNotify) g_free), NULL);
551 #line 131 "symbols.vala"
552 if (command) {
553 #line 131 "symbols.vala"
554 *command = _vala_command;
555 #line 556 "symbols.c"
556 } else {
557 #line 131 "symbols.vala"
558 _g_free0 (_vala_command);
559 #line 560 "symbols.c"
560 }
561 #line 131 "symbols.vala"
562 if (tooltip) {
563 #line 131 "symbols.vala"
564 *tooltip = _vala_tooltip;
565 #line 566 "symbols.c"
566 } else {
567 #line 131 "symbols.vala"
568 _g_free0 (_vala_tooltip);
569 #line 570 "symbols.c"
570 }
571 #line 131 "symbols.vala"
572 return result;
573 #line 574 "symbols.c"
574 }
575
576 static void
symbols_add_normal_category(Symbols * self,SymbolsCategoryInfo * info)577 symbols_add_normal_category (Symbols* self,
578 SymbolsCategoryInfo* info)
579 {
580 GtkListStore* store = NULL;
581 SymbolsCategoryInfo _tmp0_;
582 const gchar* _tmp1_;
583 NormalSymbols* _tmp2_;
584 GeeMap* _tmp3_;
585 SymbolsCategoryInfo _tmp4_;
586 const gchar* _tmp5_;
587 GtkTreeIter iter = {0};
588 GtkListStore* _tmp6_;
589 GtkTreeIter _tmp7_ = {0};
590 GtkListStore* _tmp8_;
591 GtkTreeIter _tmp9_;
592 SymbolsCategoryInfo _tmp10_;
593 const gchar* _tmp11_;
594 SymbolsCategoryInfo _tmp12_;
595 const gchar* _tmp13_;
596 #line 134 "symbols.vala"
597 g_return_if_fail (self != NULL);
598 #line 134 "symbols.vala"
599 g_return_if_fail (info != NULL);
600 #line 136 "symbols.vala"
601 _tmp0_ = *info;
602 #line 136 "symbols.vala"
603 _tmp1_ = _tmp0_.id;
604 #line 136 "symbols.vala"
605 _tmp2_ = normal_symbols_new (_tmp1_);
606 #line 136 "symbols.vala"
607 store = (GtkListStore*) _tmp2_;
608 #line 138 "symbols.vala"
609 _tmp3_ = self->priv->_normal_symbols_map;
610 #line 138 "symbols.vala"
611 _tmp4_ = *info;
612 #line 138 "symbols.vala"
613 _tmp5_ = _tmp4_.id;
614 #line 138 "symbols.vala"
615 gee_map_set (_tmp3_, _tmp5_, IS_NORMAL_SYMBOLS (store) ? ((NormalSymbols*) store) : NULL);
616 #line 141 "symbols.vala"
617 _tmp6_ = self->priv->_categories_store;
618 #line 141 "symbols.vala"
619 gtk_list_store_append (_tmp6_, &_tmp7_);
620 #line 141 "symbols.vala"
621 iter = _tmp7_;
622 #line 142 "symbols.vala"
623 _tmp8_ = self->priv->_categories_store;
624 #line 142 "symbols.vala"
625 _tmp9_ = iter;
626 #line 142 "symbols.vala"
627 _tmp10_ = *info;
628 #line 142 "symbols.vala"
629 _tmp11_ = _tmp10_.icon;
630 #line 142 "symbols.vala"
631 _tmp12_ = *info;
632 #line 142 "symbols.vala"
633 _tmp13_ = _tmp12_.name;
634 #line 142 "symbols.vala"
635 gtk_list_store_set (_tmp8_, &_tmp9_, SYMBOLS_CATEGORY_COLUMN_TYPE, SYMBOLS_CATEGORY_TYPE_NORMAL, SYMBOLS_CATEGORY_COLUMN_ICON, _tmp11_, SYMBOLS_CATEGORY_COLUMN_NAME, _ (_tmp13_), SYMBOLS_CATEGORY_COLUMN_SYMBOLS_STORE, store, -1);
636 #line 134 "symbols.vala"
637 _g_object_unref0 (store);
638 #line 639 "symbols.c"
639 }
640
641 static void
symbols_add_most_used_category(Symbols * self)642 symbols_add_most_used_category (Symbols* self)
643 {
644 GtkTreeModel* model = NULL;
645 MostUsedSymbols* _tmp0_;
646 MostUsedSymbols* _tmp1_;
647 GtkTreeModel* _tmp2_;
648 GtkTreeModel* _tmp3_;
649 GtkTreeIter iter = {0};
650 GtkListStore* _tmp4_;
651 GtkTreeIter _tmp5_ = {0};
652 GtkListStore* _tmp6_;
653 GtkTreeIter _tmp7_;
654 #line 150 "symbols.vala"
655 g_return_if_fail (self != NULL);
656 #line 152 "symbols.vala"
657 _tmp0_ = most_used_symbols_get_default ();
658 #line 152 "symbols.vala"
659 _tmp1_ = _tmp0_;
660 #line 152 "symbols.vala"
661 _tmp2_ = most_used_symbols_get_model (_tmp1_);
662 #line 152 "symbols.vala"
663 _tmp3_ = _tmp2_;
664 #line 152 "symbols.vala"
665 _g_object_unref0 (_tmp1_);
666 #line 152 "symbols.vala"
667 model = _tmp3_;
668 #line 155 "symbols.vala"
669 _tmp4_ = self->priv->_categories_store;
670 #line 155 "symbols.vala"
671 gtk_list_store_append (_tmp4_, &_tmp5_);
672 #line 155 "symbols.vala"
673 iter = _tmp5_;
674 #line 156 "symbols.vala"
675 _tmp6_ = self->priv->_categories_store;
676 #line 156 "symbols.vala"
677 _tmp7_ = iter;
678 #line 156 "symbols.vala"
679 gtk_list_store_set (_tmp6_, &_tmp7_, SYMBOLS_CATEGORY_COLUMN_TYPE, SYMBOLS_CATEGORY_TYPE_MOST_USED, SYMBOLS_CATEGORY_COLUMN_ICON, "help-about", SYMBOLS_CATEGORY_COLUMN_NAME, _ ("Most Used"), SYMBOLS_CATEGORY_COLUMN_SYMBOLS_STORE, model, -1);
680 #line 150 "symbols.vala"
681 _g_object_unref0 (model);
682 #line 683 "symbols.c"
683 }
684
685 gchar*
symbols_get_tooltip(const gchar * latex_command,const gchar * package_required)686 symbols_get_tooltip (const gchar* latex_command,
687 const gchar* package_required)
688 {
689 gchar* tooltip = NULL;
690 gchar* _tmp0_;
691 gchar* result = NULL;
692 #line 164 "symbols.vala"
693 g_return_val_if_fail (latex_command != NULL, NULL);
694 #line 168 "symbols.vala"
695 _tmp0_ = g_markup_escape_text (latex_command, (gssize) -1);
696 #line 168 "symbols.vala"
697 tooltip = _tmp0_;
698 #line 170 "symbols.vala"
699 if (package_required != NULL) {
700 #line 701 "symbols.c"
701 const gchar* _tmp1_;
702 gchar* _tmp2_;
703 gchar* _tmp3_;
704 gchar* _tmp4_;
705 #line 171 "symbols.vala"
706 _tmp1_ = tooltip;
707 #line 171 "symbols.vala"
708 _tmp2_ = g_strdup_printf (" (package %s)", package_required);
709 #line 171 "symbols.vala"
710 _tmp3_ = _tmp2_;
711 #line 171 "symbols.vala"
712 _tmp4_ = g_strconcat (_tmp1_, _tmp3_, NULL);
713 #line 171 "symbols.vala"
714 _g_free0 (tooltip);
715 #line 171 "symbols.vala"
716 tooltip = _tmp4_;
717 #line 171 "symbols.vala"
718 _g_free0 (_tmp3_);
719 #line 720 "symbols.c"
720 }
721 #line 173 "symbols.vala"
722 result = tooltip;
723 #line 173 "symbols.vala"
724 return result;
725 #line 726 "symbols.c"
726 }
727
728 GdkPixbuf*
symbols_get_pixbuf(const gchar * symbol_id)729 symbols_get_pixbuf (const gchar* symbol_id)
730 {
731 GError* _inner_error0_ = NULL;
732 GdkPixbuf* result = NULL;
733 #line 176 "symbols.vala"
734 g_return_val_if_fail (symbol_id != NULL, NULL);
735 #line 736 "symbols.c"
736 {
737 GdkPixbuf* _tmp0_ = NULL;
738 gchar* _tmp1_;
739 gchar* _tmp2_;
740 GdkPixbuf* _tmp3_;
741 GdkPixbuf* _tmp4_;
742 GdkPixbuf* _tmp5_;
743 #line 180 "symbols.vala"
744 _tmp1_ = g_strconcat ("/org/gnome/gnome-latex/symbols/", symbol_id, NULL);
745 #line 180 "symbols.vala"
746 _tmp2_ = _tmp1_;
747 #line 180 "symbols.vala"
748 _tmp3_ = gdk_pixbuf_new_from_resource (_tmp2_, &_inner_error0_);
749 #line 180 "symbols.vala"
750 _tmp4_ = _tmp3_;
751 #line 180 "symbols.vala"
752 _g_free0 (_tmp2_);
753 #line 180 "symbols.vala"
754 _tmp0_ = _tmp4_;
755 #line 180 "symbols.vala"
756 if (G_UNLIKELY (_inner_error0_ != NULL)) {
757 #line 758 "symbols.c"
758 goto __catch0_g_error;
759 }
760 #line 180 "symbols.vala"
761 _tmp5_ = _tmp0_;
762 #line 180 "symbols.vala"
763 _tmp0_ = NULL;
764 #line 180 "symbols.vala"
765 result = _tmp5_;
766 #line 180 "symbols.vala"
767 _g_object_unref0 (_tmp0_);
768 #line 180 "symbols.vala"
769 return result;
770 #line 771 "symbols.c"
771 }
772 goto __finally0;
773 __catch0_g_error:
774 {
775 GError* e = NULL;
776 GError* _tmp6_;
777 const gchar* _tmp7_;
778 #line 178 "symbols.vala"
779 e = _inner_error0_;
780 #line 178 "symbols.vala"
781 _inner_error0_ = NULL;
782 #line 185 "symbols.vala"
783 _tmp6_ = e;
784 #line 185 "symbols.vala"
785 _tmp7_ = _tmp6_->message;
786 #line 185 "symbols.vala"
787 g_warning ("symbols.vala:185: Impossible to load the symbol '%s': %s", symbol_id, _tmp7_);
788 #line 186 "symbols.vala"
789 result = NULL;
790 #line 186 "symbols.vala"
791 _g_error_free0 (e);
792 #line 186 "symbols.vala"
793 return result;
794 #line 795 "symbols.c"
795 }
796 __finally0:
797 #line 178 "symbols.vala"
798 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
799 #line 178 "symbols.vala"
800 g_clear_error (&_inner_error0_);
801 #line 178 "symbols.vala"
802 return NULL;
803 #line 804 "symbols.c"
804 }
805
806 static void
symbols_category_info_copy(const SymbolsCategoryInfo * self,SymbolsCategoryInfo * dest)807 symbols_category_info_copy (const SymbolsCategoryInfo* self,
808 SymbolsCategoryInfo* dest)
809 {
810 const gchar* _tmp0_;
811 gchar* _tmp1_;
812 const gchar* _tmp2_;
813 gchar* _tmp3_;
814 const gchar* _tmp4_;
815 gchar* _tmp5_;
816 #line 50 "symbols.vala"
817 _tmp0_ = (*self).name;
818 #line 50 "symbols.vala"
819 _tmp1_ = g_strdup (_tmp0_);
820 #line 50 "symbols.vala"
821 _g_free0 ((*dest).name);
822 #line 50 "symbols.vala"
823 (*dest).name = _tmp1_;
824 #line 50 "symbols.vala"
825 _tmp2_ = (*self).icon;
826 #line 50 "symbols.vala"
827 _tmp3_ = g_strdup (_tmp2_);
828 #line 50 "symbols.vala"
829 _g_free0 ((*dest).icon);
830 #line 50 "symbols.vala"
831 (*dest).icon = _tmp3_;
832 #line 50 "symbols.vala"
833 _tmp4_ = (*self).id;
834 #line 50 "symbols.vala"
835 _tmp5_ = g_strdup (_tmp4_);
836 #line 50 "symbols.vala"
837 _g_free0 ((*dest).id);
838 #line 50 "symbols.vala"
839 (*dest).id = _tmp5_;
840 #line 841 "symbols.c"
841 }
842
843 static void
symbols_category_info_destroy(SymbolsCategoryInfo * self)844 symbols_category_info_destroy (SymbolsCategoryInfo* self)
845 {
846 #line 52 "symbols.vala"
847 _g_free0 ((*self).name);
848 #line 53 "symbols.vala"
849 _g_free0 ((*self).icon);
850 #line 54 "symbols.vala"
851 _g_free0 ((*self).id);
852 #line 853 "symbols.c"
853 }
854
855 static SymbolsCategoryInfo*
symbols_category_info_dup(const SymbolsCategoryInfo * self)856 symbols_category_info_dup (const SymbolsCategoryInfo* self)
857 {
858 SymbolsCategoryInfo* dup;
859 #line 50 "symbols.vala"
860 dup = g_new0 (SymbolsCategoryInfo, 1);
861 #line 50 "symbols.vala"
862 symbols_category_info_copy (self, dup);
863 #line 50 "symbols.vala"
864 return dup;
865 #line 866 "symbols.c"
866 }
867
868 static void
symbols_category_info_free(SymbolsCategoryInfo * self)869 symbols_category_info_free (SymbolsCategoryInfo* self)
870 {
871 #line 50 "symbols.vala"
872 symbols_category_info_destroy (self);
873 #line 50 "symbols.vala"
874 g_free (self);
875 #line 876 "symbols.c"
876 }
877
878 static GType
symbols_category_info_get_type_once(void)879 symbols_category_info_get_type_once (void)
880 {
881 GType symbols_category_info_type_id;
882 symbols_category_info_type_id = g_boxed_type_register_static ("SymbolsCategoryInfo", (GBoxedCopyFunc) symbols_category_info_dup, (GBoxedFreeFunc) symbols_category_info_free);
883 return symbols_category_info_type_id;
884 }
885
886 static GType
symbols_category_info_get_type(void)887 symbols_category_info_get_type (void)
888 {
889 static volatile gsize symbols_category_info_type_id__volatile = 0;
890 if (g_once_init_enter (&symbols_category_info_type_id__volatile)) {
891 GType symbols_category_info_type_id;
892 symbols_category_info_type_id = symbols_category_info_get_type_once ();
893 g_once_init_leave (&symbols_category_info_type_id__volatile, symbols_category_info_type_id);
894 }
895 return symbols_category_info_type_id__volatile;
896 }
897
898 static void
symbols_class_init(SymbolsClass * klass,gpointer klass_data)899 symbols_class_init (SymbolsClass * klass,
900 gpointer klass_data)
901 {
902 #line 48 "symbols.vala"
903 symbols_parent_class = g_type_class_peek_parent (klass);
904 #line 48 "symbols.vala"
905 g_type_class_adjust_private_offset (klass, &Symbols_private_offset);
906 #line 48 "symbols.vala"
907 G_OBJECT_CLASS (klass)->finalize = symbols_finalize;
908 #line 909 "symbols.c"
909 }
910
911 static void
symbols_instance_init(Symbols * self,gpointer klass)912 symbols_instance_init (Symbols * self,
913 gpointer klass)
914 {
915 #line 48 "symbols.vala"
916 self->priv = symbols_get_instance_private (self);
917 #line 918 "symbols.c"
918 }
919
920 static void
symbols_finalize(GObject * obj)921 symbols_finalize (GObject * obj)
922 {
923 Symbols * self;
924 #line 48 "symbols.vala"
925 self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SYMBOLS, Symbols);
926 #line 69 "symbols.vala"
927 _g_object_unref0 (self->priv->_categories_store);
928 #line 72 "symbols.vala"
929 _g_object_unref0 (self->priv->_normal_symbols_map);
930 #line 48 "symbols.vala"
931 G_OBJECT_CLASS (symbols_parent_class)->finalize (obj);
932 #line 933 "symbols.c"
933 }
934
935 static GType
symbols_get_type_once(void)936 symbols_get_type_once (void)
937 {
938 static const GTypeInfo g_define_type_info = { sizeof (SymbolsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) symbols_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Symbols), 0, (GInstanceInitFunc) symbols_instance_init, NULL };
939 GType symbols_type_id;
940 symbols_type_id = g_type_register_static (G_TYPE_OBJECT, "Symbols", &g_define_type_info, 0);
941 Symbols_private_offset = g_type_add_instance_private (symbols_type_id, sizeof (SymbolsPrivate));
942 return symbols_type_id;
943 }
944
945 GType
symbols_get_type(void)946 symbols_get_type (void)
947 {
948 static volatile gsize symbols_type_id__volatile = 0;
949 if (g_once_init_enter (&symbols_type_id__volatile)) {
950 GType symbols_type_id;
951 symbols_type_id = symbols_get_type_once ();
952 g_once_init_leave (&symbols_type_id__volatile, symbols_type_id);
953 }
954 return symbols_type_id__volatile;
955 }
956
957 static inline gpointer
normal_symbols_get_instance_private(NormalSymbols * self)958 normal_symbols_get_instance_private (NormalSymbols* self)
959 {
960 return G_STRUCT_MEMBER_P (self, NormalSymbols_private_offset);
961 }
962
963 static const gchar*
string_to_string(const gchar * self)964 string_to_string (const gchar* self)
965 {
966 const gchar* result = NULL;
967 #line 1570 "glib-2.0.vapi"
968 g_return_val_if_fail (self != NULL, NULL);
969 #line 1571 "glib-2.0.vapi"
970 result = self;
971 #line 1571 "glib-2.0.vapi"
972 return result;
973 #line 974 "symbols.c"
974 }
975
976 NormalSymbols*
normal_symbols_construct(GType object_type,const gchar * category_id)977 normal_symbols_construct (GType object_type,
978 const gchar* category_id)
979 {
980 NormalSymbols * self = NULL;
981 gchar* _tmp0_;
982 const gchar* _tmp1_;
983 gchar* _tmp2_;
984 GeeHashMap* _tmp3_;
985 GType* column_types = NULL;
986 GType* _tmp4_;
987 gint column_types_length1;
988 gint _column_types_size_;
989 #line 205 "symbols.vala"
990 g_return_val_if_fail (category_id != NULL, NULL);
991 #line 205 "symbols.vala"
992 self = (NormalSymbols*) g_object_new (object_type, NULL);
993 #line 207 "symbols.vala"
994 _tmp0_ = g_strdup (category_id);
995 #line 207 "symbols.vala"
996 _g_free0 (self->priv->_category_id);
997 #line 207 "symbols.vala"
998 self->priv->_category_id = _tmp0_;
999 #line 208 "symbols.vala"
1000 _tmp1_ = string_to_string (category_id);
1001 #line 208 "symbols.vala"
1002 _tmp2_ = g_strconcat ("/org/gnome/gnome-latex/symbols/", _tmp1_, "/", NULL);
1003 #line 208 "symbols.vala"
1004 _g_free0 (self->priv->_resource_path);
1005 #line 208 "symbols.vala"
1006 self->priv->_resource_path = _tmp2_;
1007 #line 210 "symbols.vala"
1008 _tmp3_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NORMAL_SYMBOLS_TYPE_SYMBOL_INFO, (GBoxedCopyFunc) normal_symbols_symbol_info_dup, (GDestroyNotify) normal_symbols_symbol_info_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
1009 #line 210 "symbols.vala"
1010 _g_object_unref0 (self->priv->_data);
1011 #line 210 "symbols.vala"
1012 self->priv->_data = (GeeMap*) _tmp3_;
1013 #line 212 "symbols.vala"
1014 _tmp4_ = g_new0 (GType, 4);
1015 #line 212 "symbols.vala"
1016 _tmp4_[0] = gdk_pixbuf_get_type ();
1017 #line 212 "symbols.vala"
1018 _tmp4_[1] = G_TYPE_STRING;
1019 #line 212 "symbols.vala"
1020 _tmp4_[2] = G_TYPE_STRING;
1021 #line 212 "symbols.vala"
1022 _tmp4_[3] = G_TYPE_STRING;
1023 #line 212 "symbols.vala"
1024 column_types = _tmp4_;
1025 #line 212 "symbols.vala"
1026 column_types_length1 = 4;
1027 #line 212 "symbols.vala"
1028 _column_types_size_ = column_types_length1;
1029 #line 219 "symbols.vala"
1030 gtk_list_store_set_column_types ((GtkListStore*) self, (gint) column_types_length1, column_types);
1031 #line 221 "symbols.vala"
1032 normal_symbols_load_symbols (self);
1033 #line 205 "symbols.vala"
1034 column_types = (g_free (column_types), NULL);
1035 #line 205 "symbols.vala"
1036 return self;
1037 #line 1038 "symbols.c"
1038 }
1039
1040 NormalSymbols*
normal_symbols_new(const gchar * category_id)1041 normal_symbols_new (const gchar* category_id)
1042 {
1043 #line 205 "symbols.vala"
1044 return normal_symbols_construct (TYPE_NORMAL_SYMBOLS, category_id);
1045 #line 1046 "symbols.c"
1046 }
1047
1048 gboolean
normal_symbols_get_symbol_info(NormalSymbols * self,const gchar * icon_file,gchar ** command,gchar ** package)1049 normal_symbols_get_symbol_info (NormalSymbols* self,
1050 const gchar* icon_file,
1051 gchar* * command,
1052 gchar* * package)
1053 {
1054 gchar* _vala_command = NULL;
1055 gchar* _vala_package = NULL;
1056 GeeMap* _tmp0_;
1057 NormalSymbolsSymbolInfo info = {0};
1058 GeeMap* _tmp1_;
1059 gpointer _tmp2_;
1060 NormalSymbolsSymbolInfo* _tmp3_;
1061 NormalSymbolsSymbolInfo _tmp4_;
1062 NormalSymbolsSymbolInfo _tmp5_ = {0};
1063 NormalSymbolsSymbolInfo _tmp6_;
1064 NormalSymbolsSymbolInfo _tmp7_;
1065 const gchar* _tmp8_;
1066 gchar* _tmp9_;
1067 NormalSymbolsSymbolInfo _tmp10_;
1068 const gchar* _tmp11_;
1069 gchar* _tmp12_;
1070 gboolean result = FALSE;
1071 #line 224 "symbols.vala"
1072 g_return_val_if_fail (self != NULL, FALSE);
1073 #line 224 "symbols.vala"
1074 g_return_val_if_fail (icon_file != NULL, FALSE);
1075 #line 226 "symbols.vala"
1076 _g_free0 (_vala_command);
1077 #line 226 "symbols.vala"
1078 _vala_command = NULL;
1079 #line 227 "symbols.vala"
1080 _g_free0 (_vala_package);
1081 #line 227 "symbols.vala"
1082 _vala_package = NULL;
1083 #line 229 "symbols.vala"
1084 _tmp0_ = self->priv->_data;
1085 #line 229 "symbols.vala"
1086 if (!gee_map_has_key (_tmp0_, icon_file)) {
1087 #line 230 "symbols.vala"
1088 result = FALSE;
1089 #line 230 "symbols.vala"
1090 if (command) {
1091 #line 230 "symbols.vala"
1092 *command = _vala_command;
1093 #line 1094 "symbols.c"
1094 } else {
1095 #line 230 "symbols.vala"
1096 _g_free0 (_vala_command);
1097 #line 1098 "symbols.c"
1098 }
1099 #line 230 "symbols.vala"
1100 if (package) {
1101 #line 230 "symbols.vala"
1102 *package = _vala_package;
1103 #line 1104 "symbols.c"
1104 } else {
1105 #line 230 "symbols.vala"
1106 _g_free0 (_vala_package);
1107 #line 1108 "symbols.c"
1108 }
1109 #line 230 "symbols.vala"
1110 return result;
1111 #line 1112 "symbols.c"
1112 }
1113 #line 232 "symbols.vala"
1114 _tmp1_ = self->priv->_data;
1115 #line 232 "symbols.vala"
1116 _tmp2_ = gee_map_get (_tmp1_, icon_file);
1117 #line 232 "symbols.vala"
1118 _tmp3_ = (NormalSymbolsSymbolInfo*) _tmp2_;
1119 #line 232 "symbols.vala"
1120 _tmp4_ = *_tmp3_;
1121 #line 232 "symbols.vala"
1122 normal_symbols_symbol_info_copy (&_tmp4_, &_tmp5_);
1123 #line 232 "symbols.vala"
1124 _tmp6_ = _tmp5_;
1125 #line 232 "symbols.vala"
1126 _normal_symbols_symbol_info_free0 (_tmp3_);
1127 #line 232 "symbols.vala"
1128 info = _tmp6_;
1129 #line 233 "symbols.vala"
1130 _tmp7_ = info;
1131 #line 233 "symbols.vala"
1132 _tmp8_ = _tmp7_.latex_command;
1133 #line 233 "symbols.vala"
1134 _tmp9_ = g_strdup (_tmp8_);
1135 #line 233 "symbols.vala"
1136 _g_free0 (_vala_command);
1137 #line 233 "symbols.vala"
1138 _vala_command = _tmp9_;
1139 #line 234 "symbols.vala"
1140 _tmp10_ = info;
1141 #line 234 "symbols.vala"
1142 _tmp11_ = _tmp10_.package_required;
1143 #line 234 "symbols.vala"
1144 _tmp12_ = g_strdup (_tmp11_);
1145 #line 234 "symbols.vala"
1146 _g_free0 (_vala_package);
1147 #line 234 "symbols.vala"
1148 _vala_package = _tmp12_;
1149 #line 236 "symbols.vala"
1150 result = TRUE;
1151 #line 236 "symbols.vala"
1152 normal_symbols_symbol_info_destroy (&info);
1153 #line 236 "symbols.vala"
1154 if (command) {
1155 #line 236 "symbols.vala"
1156 *command = _vala_command;
1157 #line 1158 "symbols.c"
1158 } else {
1159 #line 236 "symbols.vala"
1160 _g_free0 (_vala_command);
1161 #line 1162 "symbols.c"
1162 }
1163 #line 236 "symbols.vala"
1164 if (package) {
1165 #line 236 "symbols.vala"
1166 *package = _vala_package;
1167 #line 1168 "symbols.c"
1168 } else {
1169 #line 236 "symbols.vala"
1170 _g_free0 (_vala_package);
1171 #line 1172 "symbols.c"
1172 }
1173 #line 236 "symbols.vala"
1174 return result;
1175 #line 1176 "symbols.c"
1176 }
1177
1178 static void
_normal_symbols_parser_start_gmarkup_parser_start_element_func(GMarkupParseContext * context,const gchar * element_name,gchar ** attribute_names,gchar ** attribute_values,gpointer self,GError ** error)1179 _normal_symbols_parser_start_gmarkup_parser_start_element_func (GMarkupParseContext* context,
1180 const gchar* element_name,
1181 gchar** attribute_names,
1182 gchar** attribute_values,
1183 gpointer self,
1184 GError** error)
1185 {
1186 #line 249 "symbols.vala"
1187 normal_symbols_parser_start ((NormalSymbols*) self, context, element_name, attribute_names, _vala_array_length (attribute_names), attribute_values, _vala_array_length (attribute_values), error);
1188 #line 1189 "symbols.c"
1189 }
1190
1191 static void
normal_symbols_load_symbols(NormalSymbols * self)1192 normal_symbols_load_symbols (NormalSymbols* self)
1193 {
1194 const gchar* contents = NULL;
1195 const gchar* _tmp0_;
1196 gchar* _tmp1_;
1197 gchar* _tmp2_;
1198 const gchar* _tmp3_;
1199 const gchar* _tmp4_;
1200 const gchar* _tmp5_;
1201 GError* _inner_error0_ = NULL;
1202 #line 239 "symbols.vala"
1203 g_return_if_fail (self != NULL);
1204 #line 241 "symbols.vala"
1205 _tmp0_ = self->priv->_resource_path;
1206 #line 241 "symbols.vala"
1207 _tmp1_ = g_strconcat (_tmp0_, "data.xml", NULL);
1208 #line 241 "symbols.vala"
1209 _tmp2_ = _tmp1_;
1210 #line 241 "symbols.vala"
1211 _tmp3_ = utils_get_string_from_resource (_tmp2_);
1212 #line 241 "symbols.vala"
1213 _tmp4_ = _tmp3_;
1214 #line 241 "symbols.vala"
1215 _g_free0 (_tmp2_);
1216 #line 241 "symbols.vala"
1217 contents = _tmp4_;
1218 #line 244 "symbols.vala"
1219 _tmp5_ = contents;
1220 #line 244 "symbols.vala"
1221 if (_tmp5_ == NULL) {
1222 #line 245 "symbols.vala"
1223 return;
1224 #line 1225 "symbols.c"
1225 }
1226 {
1227 GMarkupParser parser = {0};
1228 GMarkupParser _tmp6_ = {0};
1229 GMarkupParseContext* context = NULL;
1230 GMarkupParser _tmp7_;
1231 GMarkupParseContext* _tmp8_;
1232 GMarkupParseContext* _tmp9_;
1233 const gchar* _tmp10_;
1234 #line 249 "symbols.vala"
1235 _tmp6_.start_element = _normal_symbols_parser_start_gmarkup_parser_start_element_func;
1236 #line 249 "symbols.vala"
1237 _tmp6_.end_element = NULL;
1238 #line 249 "symbols.vala"
1239 _tmp6_.text = NULL;
1240 #line 249 "symbols.vala"
1241 _tmp6_.passthrough = NULL;
1242 #line 249 "symbols.vala"
1243 _tmp6_.error = NULL;
1244 #line 249 "symbols.vala"
1245 parser = _tmp6_;
1246 #line 250 "symbols.vala"
1247 _tmp7_ = parser;
1248 #line 250 "symbols.vala"
1249 _tmp8_ = g_markup_parse_context_new (&_tmp7_, 0, self, NULL);
1250 #line 250 "symbols.vala"
1251 context = _tmp8_;
1252 #line 251 "symbols.vala"
1253 _tmp9_ = context;
1254 #line 251 "symbols.vala"
1255 _tmp10_ = contents;
1256 #line 251 "symbols.vala"
1257 g_markup_parse_context_parse (_tmp9_, _tmp10_, (gssize) -1, &_inner_error0_);
1258 #line 251 "symbols.vala"
1259 if (G_UNLIKELY (_inner_error0_ != NULL)) {
1260 #line 251 "symbols.vala"
1261 _g_markup_parse_context_unref0 (context);
1262 #line 1263 "symbols.c"
1263 goto __catch0_g_error;
1264 }
1265 #line 247 "symbols.vala"
1266 _g_markup_parse_context_unref0 (context);
1267 #line 1268 "symbols.c"
1268 }
1269 goto __finally0;
1270 __catch0_g_error:
1271 {
1272 GError* e = NULL;
1273 GError* _tmp11_;
1274 const gchar* _tmp12_;
1275 #line 247 "symbols.vala"
1276 e = _inner_error0_;
1277 #line 247 "symbols.vala"
1278 _inner_error0_ = NULL;
1279 #line 255 "symbols.vala"
1280 _tmp11_ = e;
1281 #line 255 "symbols.vala"
1282 _tmp12_ = _tmp11_->message;
1283 #line 255 "symbols.vala"
1284 g_warning ("symbols.vala:255: Impossible to load the symbols: %s", _tmp12_);
1285 #line 247 "symbols.vala"
1286 _g_error_free0 (e);
1287 #line 1288 "symbols.c"
1288 }
1289 __finally0:
1290 #line 247 "symbols.vala"
1291 if (G_UNLIKELY (_inner_error0_ != NULL)) {
1292 #line 247 "symbols.vala"
1293 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
1294 #line 247 "symbols.vala"
1295 g_clear_error (&_inner_error0_);
1296 #line 247 "symbols.vala"
1297 return;
1298 #line 1299 "symbols.c"
1299 }
1300 }
1301
1302 static void
normal_symbols_add_symbol(NormalSymbols * self,const gchar * icon_file,NormalSymbolsSymbolInfo * symbol)1303 normal_symbols_add_symbol (NormalSymbols* self,
1304 const gchar* icon_file,
1305 NormalSymbolsSymbolInfo* symbol)
1306 {
1307 GeeMap* _tmp0_;
1308 NormalSymbolsSymbolInfo _tmp1_;
1309 gchar* tooltip = NULL;
1310 NormalSymbolsSymbolInfo _tmp2_;
1311 const gchar* _tmp3_;
1312 NormalSymbolsSymbolInfo _tmp4_;
1313 const gchar* _tmp5_;
1314 gchar* _tmp6_;
1315 gchar* id = NULL;
1316 const gchar* _tmp7_;
1317 gchar* _tmp8_;
1318 GdkPixbuf* pixbuf = NULL;
1319 const gchar* _tmp9_;
1320 GdkPixbuf* _tmp10_;
1321 GdkPixbuf* _tmp11_;
1322 GtkTreeIter iter = {0};
1323 GtkTreeIter _tmp12_ = {0};
1324 GtkTreeIter _tmp13_;
1325 GdkPixbuf* _tmp14_;
1326 NormalSymbolsSymbolInfo _tmp15_;
1327 const gchar* _tmp16_;
1328 const gchar* _tmp17_;
1329 const gchar* _tmp18_;
1330 #line 259 "symbols.vala"
1331 g_return_if_fail (self != NULL);
1332 #line 259 "symbols.vala"
1333 g_return_if_fail (icon_file != NULL);
1334 #line 259 "symbols.vala"
1335 g_return_if_fail (symbol != NULL);
1336 #line 261 "symbols.vala"
1337 _tmp0_ = self->priv->_data;
1338 #line 261 "symbols.vala"
1339 _tmp1_ = *symbol;
1340 #line 261 "symbols.vala"
1341 gee_map_set (_tmp0_, icon_file, &_tmp1_);
1342 #line 263 "symbols.vala"
1343 _tmp2_ = *symbol;
1344 #line 263 "symbols.vala"
1345 _tmp3_ = _tmp2_.latex_command;
1346 #line 263 "symbols.vala"
1347 _tmp4_ = *symbol;
1348 #line 263 "symbols.vala"
1349 _tmp5_ = _tmp4_.package_required;
1350 #line 263 "symbols.vala"
1351 _tmp6_ = symbols_get_tooltip (_tmp3_, _tmp5_);
1352 #line 263 "symbols.vala"
1353 tooltip = _tmp6_;
1354 #line 266 "symbols.vala"
1355 _tmp7_ = self->priv->_category_id;
1356 #line 266 "symbols.vala"
1357 _tmp8_ = g_strdup_printf ("%s/%s", _tmp7_, icon_file);
1358 #line 266 "symbols.vala"
1359 id = _tmp8_;
1360 #line 268 "symbols.vala"
1361 _tmp9_ = id;
1362 #line 268 "symbols.vala"
1363 _tmp10_ = symbols_get_pixbuf (_tmp9_);
1364 #line 268 "symbols.vala"
1365 pixbuf = _tmp10_;
1366 #line 269 "symbols.vala"
1367 _tmp11_ = pixbuf;
1368 #line 269 "symbols.vala"
1369 if (_tmp11_ == NULL) {
1370 #line 270 "symbols.vala"
1371 _g_object_unref0 (pixbuf);
1372 #line 270 "symbols.vala"
1373 _g_free0 (id);
1374 #line 270 "symbols.vala"
1375 _g_free0 (tooltip);
1376 #line 270 "symbols.vala"
1377 return;
1378 #line 1379 "symbols.c"
1379 }
1380 #line 273 "symbols.vala"
1381 gtk_list_store_append ((GtkListStore*) self, &_tmp12_);
1382 #line 273 "symbols.vala"
1383 iter = _tmp12_;
1384 #line 274 "symbols.vala"
1385 _tmp13_ = iter;
1386 #line 274 "symbols.vala"
1387 _tmp14_ = pixbuf;
1388 #line 274 "symbols.vala"
1389 _tmp15_ = *symbol;
1390 #line 274 "symbols.vala"
1391 _tmp16_ = _tmp15_.latex_command;
1392 #line 274 "symbols.vala"
1393 _tmp17_ = tooltip;
1394 #line 274 "symbols.vala"
1395 _tmp18_ = id;
1396 #line 274 "symbols.vala"
1397 gtk_list_store_set ((GtkListStore*) self, &_tmp13_, SYMBOL_COLUMN_PIXBUF, _tmp14_, SYMBOL_COLUMN_COMMAND, _tmp16_, SYMBOL_COLUMN_TOOLTIP, _tmp17_, SYMBOL_COLUMN_ID, _tmp18_, -1);
1398 #line 259 "symbols.vala"
1399 _g_object_unref0 (pixbuf);
1400 #line 259 "symbols.vala"
1401 _g_free0 (id);
1402 #line 259 "symbols.vala"
1403 _g_free0 (tooltip);
1404 #line 1405 "symbols.c"
1405 }
1406
1407 static void
normal_symbols_parser_start(NormalSymbols * self,GMarkupParseContext * context,const gchar * name,gchar ** attr_names,gint attr_names_length1,gchar ** attr_values,gint attr_values_length1,GError ** error)1408 normal_symbols_parser_start (NormalSymbols* self,
1409 GMarkupParseContext* context,
1410 const gchar* name,
1411 gchar** attr_names,
1412 gint attr_names_length1,
1413 gchar** attr_values,
1414 gint attr_values_length1,
1415 GError** error)
1416 {
1417 const gchar* _tmp0_;
1418 GQuark _tmp2_ = 0U;
1419 #line 285 "symbols.vala"
1420 static GQuark _tmp1_label0 = 0;
1421 #line 285 "symbols.vala"
1422 static GQuark _tmp1_label1 = 0;
1423 #line 1424 "symbols.c"
1424 GError* _inner_error0_ = NULL;
1425 #line 282 "symbols.vala"
1426 g_return_if_fail (self != NULL);
1427 #line 282 "symbols.vala"
1428 g_return_if_fail (context != NULL);
1429 #line 282 "symbols.vala"
1430 g_return_if_fail (name != NULL);
1431 #line 285 "symbols.vala"
1432 _tmp0_ = name;
1433 #line 285 "symbols.vala"
1434 _tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
1435 #line 285 "symbols.vala"
1436 if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("symbols")))) {
1437 #line 285 "symbols.vala"
1438 switch (0) {
1439 #line 1440 "symbols.c"
1440 default:
1441 {
1442 #line 288 "symbols.vala"
1443 return;
1444 #line 1445 "symbols.c"
1445 }
1446 }
1447 } else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("symbol")))) {
1448 #line 285 "symbols.vala"
1449 switch (0) {
1450 #line 1451 "symbols.c"
1451 default:
1452 {
1453 NormalSymbolsSymbolInfo symbol = {0};
1454 gchar* icon_file = NULL;
1455 const gchar* _tmp22_;
1456 NormalSymbolsSymbolInfo _tmp23_;
1457 #line 291 "symbols.vala"
1458 memset (&symbol, 0, sizeof (NormalSymbolsSymbolInfo));
1459 #line 292 "symbols.vala"
1460 _g_free0 (symbol.package_required);
1461 #line 292 "symbols.vala"
1462 symbol.package_required = NULL;
1463 #line 293 "symbols.vala"
1464 icon_file = NULL;
1465 #line 1466 "symbols.c"
1466 {
1467 gint i = 0;
1468 #line 295 "symbols.vala"
1469 i = 0;
1470 #line 1471 "symbols.c"
1471 {
1472 gboolean _tmp3_ = FALSE;
1473 #line 295 "symbols.vala"
1474 _tmp3_ = TRUE;
1475 #line 295 "symbols.vala"
1476 while (TRUE) {
1477 #line 1478 "symbols.c"
1478 const gchar* _tmp5_;
1479 const gchar* _tmp6_;
1480 GQuark _tmp8_ = 0U;
1481 #line 297 "symbols.vala"
1482 static GQuark _tmp7_label0 = 0;
1483 #line 297 "symbols.vala"
1484 static GQuark _tmp7_label1 = 0;
1485 #line 297 "symbols.vala"
1486 static GQuark _tmp7_label2 = 0;
1487 #line 295 "symbols.vala"
1488 if (!_tmp3_) {
1489 #line 1490 "symbols.c"
1490 gint _tmp4_;
1491 #line 295 "symbols.vala"
1492 _tmp4_ = i;
1493 #line 295 "symbols.vala"
1494 i = _tmp4_ + 1;
1495 #line 1496 "symbols.c"
1496 }
1497 #line 295 "symbols.vala"
1498 _tmp3_ = FALSE;
1499 #line 295 "symbols.vala"
1500 if (!(i < attr_names_length1)) {
1501 #line 295 "symbols.vala"
1502 break;
1503 #line 1504 "symbols.c"
1504 }
1505 #line 297 "symbols.vala"
1506 _tmp5_ = attr_names[i];
1507 #line 297 "symbols.vala"
1508 _tmp6_ = _tmp5_;
1509 #line 297 "symbols.vala"
1510 _tmp8_ = (NULL == _tmp6_) ? 0 : g_quark_from_string (_tmp6_);
1511 #line 297 "symbols.vala"
1512 if (_tmp8_ == ((0 != _tmp7_label0) ? _tmp7_label0 : (_tmp7_label0 = g_quark_from_static_string ("file")))) {
1513 #line 297 "symbols.vala"
1514 switch (0) {
1515 #line 1516 "symbols.c"
1516 default:
1517 {
1518 const gchar* _tmp9_;
1519 gchar* _tmp10_;
1520 #line 300 "symbols.vala"
1521 _tmp9_ = attr_values[i];
1522 #line 300 "symbols.vala"
1523 _tmp10_ = g_strdup (_tmp9_);
1524 #line 300 "symbols.vala"
1525 _g_free0 (icon_file);
1526 #line 300 "symbols.vala"
1527 icon_file = _tmp10_;
1528 #line 301 "symbols.vala"
1529 break;
1530 #line 1531 "symbols.c"
1531 }
1532 }
1533 } else if (_tmp8_ == ((0 != _tmp7_label1) ? _tmp7_label1 : (_tmp7_label1 = g_quark_from_static_string ("command")))) {
1534 #line 297 "symbols.vala"
1535 switch (0) {
1536 #line 1537 "symbols.c"
1537 default:
1538 {
1539 const gchar* _tmp11_;
1540 gchar* _tmp12_;
1541 #line 304 "symbols.vala"
1542 _tmp11_ = attr_values[i];
1543 #line 304 "symbols.vala"
1544 _tmp12_ = g_strdup (_tmp11_);
1545 #line 304 "symbols.vala"
1546 _g_free0 (symbol.latex_command);
1547 #line 304 "symbols.vala"
1548 symbol.latex_command = _tmp12_;
1549 #line 305 "symbols.vala"
1550 break;
1551 #line 1552 "symbols.c"
1552 }
1553 }
1554 } else if (_tmp8_ == ((0 != _tmp7_label2) ? _tmp7_label2 : (_tmp7_label2 = g_quark_from_static_string ("package")))) {
1555 #line 297 "symbols.vala"
1556 switch (0) {
1557 #line 1558 "symbols.c"
1558 default:
1559 {
1560 const gchar* _tmp13_;
1561 gchar* _tmp14_;
1562 #line 308 "symbols.vala"
1563 _tmp13_ = attr_values[i];
1564 #line 308 "symbols.vala"
1565 _tmp14_ = g_strdup (_tmp13_);
1566 #line 308 "symbols.vala"
1567 _g_free0 (symbol.package_required);
1568 #line 308 "symbols.vala"
1569 symbol.package_required = _tmp14_;
1570 #line 309 "symbols.vala"
1571 break;
1572 #line 1573 "symbols.c"
1573 }
1574 }
1575 } else {
1576 #line 297 "symbols.vala"
1577 switch (0) {
1578 #line 1579 "symbols.c"
1579 default:
1580 {
1581 const gchar* _tmp15_;
1582 gchar* _tmp16_;
1583 gchar* _tmp17_;
1584 gchar* _tmp18_;
1585 gchar* _tmp19_;
1586 GError* _tmp20_;
1587 GError* _tmp21_;
1588 #line 312 "symbols.vala"
1589 _tmp15_ = attr_names[i];
1590 #line 312 "symbols.vala"
1591 _tmp16_ = g_strconcat ("unknown attribute \"", _tmp15_, NULL);
1592 #line 312 "symbols.vala"
1593 _tmp17_ = _tmp16_;
1594 #line 312 "symbols.vala"
1595 _tmp18_ = g_strconcat (_tmp17_, "\"", NULL);
1596 #line 312 "symbols.vala"
1597 _tmp19_ = _tmp18_;
1598 #line 312 "symbols.vala"
1599 _tmp20_ = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, _tmp19_);
1600 #line 312 "symbols.vala"
1601 _tmp21_ = _tmp20_;
1602 #line 312 "symbols.vala"
1603 _g_free0 (_tmp19_);
1604 #line 312 "symbols.vala"
1605 _g_free0 (_tmp17_);
1606 #line 312 "symbols.vala"
1607 _inner_error0_ = _tmp21_;
1608 #line 312 "symbols.vala"
1609 if (_inner_error0_->domain == G_MARKUP_ERROR) {
1610 #line 312 "symbols.vala"
1611 g_propagate_error (error, _inner_error0_);
1612 #line 312 "symbols.vala"
1613 _g_free0 (icon_file);
1614 #line 312 "symbols.vala"
1615 normal_symbols_symbol_info_destroy (&symbol);
1616 #line 312 "symbols.vala"
1617 return;
1618 #line 1619 "symbols.c"
1619 } else {
1620 #line 312 "symbols.vala"
1621 _g_free0 (icon_file);
1622 #line 312 "symbols.vala"
1623 normal_symbols_symbol_info_destroy (&symbol);
1624 #line 312 "symbols.vala"
1625 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
1626 #line 312 "symbols.vala"
1627 g_clear_error (&_inner_error0_);
1628 #line 312 "symbols.vala"
1629 return;
1630 #line 1631 "symbols.c"
1631 }
1632 }
1633 }
1634 }
1635 }
1636 }
1637 }
1638 #line 317 "symbols.vala"
1639 _tmp22_ = icon_file;
1640 #line 317 "symbols.vala"
1641 _tmp23_ = symbol;
1642 #line 317 "symbols.vala"
1643 normal_symbols_add_symbol (self, _tmp22_, &_tmp23_);
1644 #line 318 "symbols.vala"
1645 _g_free0 (icon_file);
1646 #line 318 "symbols.vala"
1647 normal_symbols_symbol_info_destroy (&symbol);
1648 #line 318 "symbols.vala"
1649 break;
1650 #line 1651 "symbols.c"
1651 }
1652 }
1653 } else {
1654 #line 285 "symbols.vala"
1655 switch (0) {
1656 #line 1657 "symbols.c"
1657 default:
1658 {
1659 gchar* _tmp24_;
1660 gchar* _tmp25_;
1661 gchar* _tmp26_;
1662 gchar* _tmp27_;
1663 GError* _tmp28_;
1664 GError* _tmp29_;
1665 #line 321 "symbols.vala"
1666 _tmp24_ = g_strconcat ("unknown element \"", name, NULL);
1667 #line 321 "symbols.vala"
1668 _tmp25_ = _tmp24_;
1669 #line 321 "symbols.vala"
1670 _tmp26_ = g_strconcat (_tmp25_, "\"", NULL);
1671 #line 321 "symbols.vala"
1672 _tmp27_ = _tmp26_;
1673 #line 321 "symbols.vala"
1674 _tmp28_ = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT, _tmp27_);
1675 #line 321 "symbols.vala"
1676 _tmp29_ = _tmp28_;
1677 #line 321 "symbols.vala"
1678 _g_free0 (_tmp27_);
1679 #line 321 "symbols.vala"
1680 _g_free0 (_tmp25_);
1681 #line 321 "symbols.vala"
1682 _inner_error0_ = _tmp29_;
1683 #line 321 "symbols.vala"
1684 if (_inner_error0_->domain == G_MARKUP_ERROR) {
1685 #line 321 "symbols.vala"
1686 g_propagate_error (error, _inner_error0_);
1687 #line 321 "symbols.vala"
1688 return;
1689 #line 1690 "symbols.c"
1690 } else {
1691 #line 321 "symbols.vala"
1692 g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
1693 #line 321 "symbols.vala"
1694 g_clear_error (&_inner_error0_);
1695 #line 321 "symbols.vala"
1696 return;
1697 #line 1698 "symbols.c"
1698 }
1699 }
1700 }
1701 }
1702 }
1703
1704 static void
normal_symbols_symbol_info_copy(const NormalSymbolsSymbolInfo * self,NormalSymbolsSymbolInfo * dest)1705 normal_symbols_symbol_info_copy (const NormalSymbolsSymbolInfo* self,
1706 NormalSymbolsSymbolInfo* dest)
1707 {
1708 const gchar* _tmp0_;
1709 gchar* _tmp1_;
1710 const gchar* _tmp2_;
1711 gchar* _tmp3_;
1712 #line 193 "symbols.vala"
1713 _tmp0_ = (*self).latex_command;
1714 #line 193 "symbols.vala"
1715 _tmp1_ = g_strdup (_tmp0_);
1716 #line 193 "symbols.vala"
1717 _g_free0 ((*dest).latex_command);
1718 #line 193 "symbols.vala"
1719 (*dest).latex_command = _tmp1_;
1720 #line 193 "symbols.vala"
1721 _tmp2_ = (*self).package_required;
1722 #line 193 "symbols.vala"
1723 _tmp3_ = g_strdup (_tmp2_);
1724 #line 193 "symbols.vala"
1725 _g_free0 ((*dest).package_required);
1726 #line 193 "symbols.vala"
1727 (*dest).package_required = _tmp3_;
1728 #line 1729 "symbols.c"
1729 }
1730
1731 static void
normal_symbols_symbol_info_destroy(NormalSymbolsSymbolInfo * self)1732 normal_symbols_symbol_info_destroy (NormalSymbolsSymbolInfo* self)
1733 {
1734 #line 195 "symbols.vala"
1735 _g_free0 ((*self).latex_command);
1736 #line 196 "symbols.vala"
1737 _g_free0 ((*self).package_required);
1738 #line 1739 "symbols.c"
1739 }
1740
1741 static NormalSymbolsSymbolInfo*
normal_symbols_symbol_info_dup(const NormalSymbolsSymbolInfo * self)1742 normal_symbols_symbol_info_dup (const NormalSymbolsSymbolInfo* self)
1743 {
1744 NormalSymbolsSymbolInfo* dup;
1745 #line 193 "symbols.vala"
1746 dup = g_new0 (NormalSymbolsSymbolInfo, 1);
1747 #line 193 "symbols.vala"
1748 normal_symbols_symbol_info_copy (self, dup);
1749 #line 193 "symbols.vala"
1750 return dup;
1751 #line 1752 "symbols.c"
1752 }
1753
1754 static void
normal_symbols_symbol_info_free(NormalSymbolsSymbolInfo * self)1755 normal_symbols_symbol_info_free (NormalSymbolsSymbolInfo* self)
1756 {
1757 #line 193 "symbols.vala"
1758 normal_symbols_symbol_info_destroy (self);
1759 #line 193 "symbols.vala"
1760 g_free (self);
1761 #line 1762 "symbols.c"
1762 }
1763
1764 static GType
normal_symbols_symbol_info_get_type_once(void)1765 normal_symbols_symbol_info_get_type_once (void)
1766 {
1767 GType normal_symbols_symbol_info_type_id;
1768 normal_symbols_symbol_info_type_id = g_boxed_type_register_static ("NormalSymbolsSymbolInfo", (GBoxedCopyFunc) normal_symbols_symbol_info_dup, (GBoxedFreeFunc) normal_symbols_symbol_info_free);
1769 return normal_symbols_symbol_info_type_id;
1770 }
1771
1772 static GType
normal_symbols_symbol_info_get_type(void)1773 normal_symbols_symbol_info_get_type (void)
1774 {
1775 static volatile gsize normal_symbols_symbol_info_type_id__volatile = 0;
1776 if (g_once_init_enter (&normal_symbols_symbol_info_type_id__volatile)) {
1777 GType normal_symbols_symbol_info_type_id;
1778 normal_symbols_symbol_info_type_id = normal_symbols_symbol_info_get_type_once ();
1779 g_once_init_leave (&normal_symbols_symbol_info_type_id__volatile, normal_symbols_symbol_info_type_id);
1780 }
1781 return normal_symbols_symbol_info_type_id__volatile;
1782 }
1783
1784 static void
normal_symbols_class_init(NormalSymbolsClass * klass,gpointer klass_data)1785 normal_symbols_class_init (NormalSymbolsClass * klass,
1786 gpointer klass_data)
1787 {
1788 #line 191 "symbols.vala"
1789 normal_symbols_parent_class = g_type_class_peek_parent (klass);
1790 #line 191 "symbols.vala"
1791 g_type_class_adjust_private_offset (klass, &NormalSymbols_private_offset);
1792 #line 191 "symbols.vala"
1793 G_OBJECT_CLASS (klass)->finalize = normal_symbols_finalize;
1794 #line 1795 "symbols.c"
1795 }
1796
1797 static void
normal_symbols_instance_init(NormalSymbols * self,gpointer klass)1798 normal_symbols_instance_init (NormalSymbols * self,
1799 gpointer klass)
1800 {
1801 #line 191 "symbols.vala"
1802 self->priv = normal_symbols_get_instance_private (self);
1803 #line 1804 "symbols.c"
1804 }
1805
1806 static void
normal_symbols_finalize(GObject * obj)1807 normal_symbols_finalize (GObject * obj)
1808 {
1809 NormalSymbols * self;
1810 #line 191 "symbols.vala"
1811 self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_NORMAL_SYMBOLS, NormalSymbols);
1812 #line 199 "symbols.vala"
1813 _g_free0 (self->priv->_category_id);
1814 #line 200 "symbols.vala"
1815 _g_free0 (self->priv->_resource_path);
1816 #line 203 "symbols.vala"
1817 _g_object_unref0 (self->priv->_data);
1818 #line 191 "symbols.vala"
1819 G_OBJECT_CLASS (normal_symbols_parent_class)->finalize (obj);
1820 #line 1821 "symbols.c"
1821 }
1822
1823 static GType
normal_symbols_get_type_once(void)1824 normal_symbols_get_type_once (void)
1825 {
1826 static const GTypeInfo g_define_type_info = { sizeof (NormalSymbolsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) normal_symbols_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (NormalSymbols), 0, (GInstanceInitFunc) normal_symbols_instance_init, NULL };
1827 GType normal_symbols_type_id;
1828 normal_symbols_type_id = g_type_register_static (gtk_list_store_get_type (), "NormalSymbols", &g_define_type_info, 0);
1829 NormalSymbols_private_offset = g_type_add_instance_private (normal_symbols_type_id, sizeof (NormalSymbolsPrivate));
1830 return normal_symbols_type_id;
1831 }
1832
1833 GType
normal_symbols_get_type(void)1834 normal_symbols_get_type (void)
1835 {
1836 static volatile gsize normal_symbols_type_id__volatile = 0;
1837 if (g_once_init_enter (&normal_symbols_type_id__volatile)) {
1838 GType normal_symbols_type_id;
1839 normal_symbols_type_id = normal_symbols_get_type_once ();
1840 g_once_init_leave (&normal_symbols_type_id__volatile, normal_symbols_type_id);
1841 }
1842 return normal_symbols_type_id__volatile;
1843 }
1844
1845 static void
_vala_array_destroy(gpointer array,gint array_length,GDestroyNotify destroy_func)1846 _vala_array_destroy (gpointer array,
1847 gint array_length,
1848 GDestroyNotify destroy_func)
1849 {
1850 #line 183 "project_dialogs.vala"
1851 if ((array != NULL) && (destroy_func != NULL)) {
1852 #line 1853 "symbols.c"
1853 gint i;
1854 #line 183 "project_dialogs.vala"
1855 for (i = 0; i < array_length; i = i + 1) {
1856 #line 183 "project_dialogs.vala"
1857 if (((gpointer*) array)[i] != NULL) {
1858 #line 183 "project_dialogs.vala"
1859 destroy_func (((gpointer*) array)[i]);
1860 #line 1861 "symbols.c"
1861 }
1862 }
1863 }
1864 }
1865
1866 static void
_vala_array_free(gpointer array,gint array_length,GDestroyNotify destroy_func)1867 _vala_array_free (gpointer array,
1868 gint array_length,
1869 GDestroyNotify destroy_func)
1870 {
1871 #line 183 "project_dialogs.vala"
1872 _vala_array_destroy (array, array_length, destroy_func);
1873 #line 183 "project_dialogs.vala"
1874 g_free (array);
1875 #line 1876 "symbols.c"
1876 }
1877
1878 static gint
_vala_array_length(gpointer array)1879 _vala_array_length (gpointer array)
1880 {
1881 gint length;
1882 length = 0;
1883 #line 183 "project_dialogs.vala"
1884 if (array) {
1885 #line 183 "project_dialogs.vala"
1886 while (((gpointer*) array)[length]) {
1887 #line 183 "project_dialogs.vala"
1888 length++;
1889 #line 1890 "symbols.c"
1890 }
1891 }
1892 #line 183 "project_dialogs.vala"
1893 return length;
1894 #line 1895 "symbols.c"
1895 }
1896
1897