| 1 | /* |
| 2 | * Copyright © 2011, 2012 Canonical Ltd. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU Lesser General Public License as |
| 6 | * published by the Free Software Foundation; either version 2 of the |
| 7 | * licence, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, but |
| 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 16 | * |
| 17 | * Author: Ryan Lortie <[email protected]> |
| 18 | */ |
| 19 | |
| 20 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 21 | |
| 22 | #include "gtkbuilderprivate.h"cxx . . $ `<file>/gtk/gtkbuilderprivate.h`/ |
| 23 | #include "gtkbuildableprivate.h"cxx . . $ `<file>/gtk/gtkbuildableprivate.h`/ |
| 24 | #include <glib/gi18n-lib.h> |
| 25 | |
| 26 | #include <gio/gio.h> |
| 27 | #include <string.h> |
| 28 | |
| 29 | struct framecxx . . $ frame# |
| 30 | { |
| 31 | GMenucxx . . $ GMenu# *menucxx . . $ frame#menu.; |
| 32 | GMenuItemcxx . . $ GMenuItem# *itemcxx . . $ frame#item.; |
| 33 | struct framecxx . . $ frame# *prevcxx . . $ frame#prev.; |
| 34 | }; |
| 35 | |
| 36 | typedef structcxx . . $ $anonymous_type_f5f0de14019c1965_0# |
| 37 | { |
| 38 | ParserDatacxx . . $ ParserData# *parser_datacxx . . $ $anonymous_type_f5f0de14019c1965_0#parser_data.; |
| 39 | struct framecxx . . $ frame# framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame.; |
| 40 | char *idcxx . . $ $anonymous_type_f5f0de14019c1965_0#id.; |
| 41 | |
| 42 | /* attributes */ |
| 43 | char *attributecxx . . $ $anonymous_type_f5f0de14019c1965_0#attribute.; |
| 44 | GVariantTypecxx . . $ GVariantType# *typecxx . . $ $anonymous_type_f5f0de14019c1965_0#type.; |
| 45 | GStringcxx . . $ GString# *stringcxx . . $ $anonymous_type_f5f0de14019c1965_0#string.; |
| 46 | |
| 47 | /* translation */ |
| 48 | char *contextcxx . . $ $anonymous_type_f5f0de14019c1965_0#context.; |
| 49 | gbooleancxx . . $ gboolean# translatablecxx . . $ $anonymous_type_f5f0de14019c1965_0#translatable.; |
| 50 | } GtkBuilderMenuStatecxx . . $ GtkBuilderMenuState#; |
| 51 | |
| 52 | static void |
| 53 | gtk_builder_menu_push_framecxx . . $ gtk_builder_menu_push_frame(2d107300106fc739). (GtkBuilderMenuStatecxx . . $ GtkBuilderMenuState# *state, |
| 54 | GMenucxx . . $ GMenu# *menu, |
| 55 | GMenuItemcxx . . $ GMenuItem# *item) |
| 56 | { |
| 57 | struct framecxx . . $ frame# *new; |
| 58 | |
| 59 | new = g_newcxx . . $ `<external>/1123956534522462559/gmem.h:318:9`! (struct frame, 1); |
| 60 | *new = state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame.; |
| 61 | |
| 62 | state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..menucxx . . $ frame#menu. = menu; |
| 63 | state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..itemcxx . . $ frame#item. = item; |
| 64 | state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..prevcxx . . $ frame#prev. = new; |
| 65 | } |
| 66 | |
| 67 | static void |
| 68 | gtk_builder_menu_pop_framecxx . . $ gtk_builder_menu_pop_frame(b86dff50aae76eb2). (GtkBuilderMenuStatecxx . . $ GtkBuilderMenuState# *state) |
| 69 | { |
| 70 | struct framecxx . . $ frame# *prev = state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..prevcxx . . $ frame#prev.; |
| 71 | |
| 72 | if (state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..itemcxx . . $ frame#item.) |
| 73 | { |
| 74 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (prev->menu != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 75 | g_menu_append_itemcxx . . $ g_menu_append_item(ee09c6623c9aeb66). (prev->menucxx . . $ frame#menu., state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..itemcxx . . $ frame#item.); |
| 76 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..itemcxx . . $ frame#item.); |
| 77 | } |
| 78 | |
| 79 | state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame. = *prev; |
| 80 | |
| 81 | g_freecxx . . $ g_free(5d22bdacc48458e8). (prev); |
| 82 | } |
| 83 | |
| 84 | static void |
| 85 | gtk_builder_menu_start_elementcxx . . $ gtk_builder_menu_start_element(1a4a7e835e3f8d1e). (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context, |
| 86 | const char *element_name, |
| 87 | const char **attribute_names, |
| 88 | const char **attribute_values, |
| 89 | gpointercxx . . $ gpointer# user_data, |
| 90 | GErrorcxx . . $ GError# **error) |
| 91 | { |
| 92 | GtkBuilderMenuStatecxx . . $ GtkBuilderMenuState# *state = user_data; |
| 93 | |
| 94 | #define COLLECTcxx . . $ `gtk/gtkbuilder-menus.c:94:9`!(first, ...) \ |
| 95 | g_markup_collect_attributes (element_name, \ |
| 96 | attribute_names, attribute_values, error, \ |
| 97 | first, __VA_ARGS__, G_MARKUP_COLLECT_INVALID) |
| 98 | #define OPTIONALcxx . . $ `gtk/gtkbuilder-menus.c:98:9`! G_MARKUP_COLLECT_OPTIONAL |
| 99 | #define BOOLEANcxx . . $ `gtk/gtkbuilder-menus.c:99:9`! G_MARKUP_COLLECT_BOOLEAN |
| 100 | #define STRINGcxx . . $ `gtk/gtkbuilder-menus.c:100:9`! G_MARKUP_COLLECT_STRING |
| 101 | |
| 102 | if (state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..menucxx . . $ frame#menu.) |
| 103 | { |
| 104 | /* Can have '<item>', '<submenu>' or '<section>' here. */ |
| 105 | if (g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (element_name, "item")) |
| 106 | { |
| 107 | GMenuItemcxx . . $ GMenuItem# *item; |
| 108 | |
| 109 | if (COLLECTcxx . . $ `gtk/gtkbuilder-menus.c:94:9`! (G_MARKUP_COLLECT_INVALID, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) |
| 110 | { |
| 111 | item = g_menu_item_newcxx . . $ g_menu_item_new(985141034a53aa83). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 112 | gtk_builder_menu_push_framecxx . . $ gtk_builder_menu_push_frame(2d107300106fc739). (state, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, item); |
| 113 | } |
| 114 | |
| 115 | return; |
| 116 | } |
| 117 | |
| 118 | else if (g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (element_name, "submenu")) |
| 119 | { |
| 120 | const char *id; |
| 121 | |
| 122 | if (COLLECTcxx . . $ `gtk/gtkbuilder-menus.c:94:9`! (STRINGcxx . . $ `gtk/gtkbuilder-menus.c:100:9`! | OPTIONALcxx . . $ `gtk/gtkbuilder-menus.c:98:9`!, "id", &id)) |
| 123 | { |
| 124 | GMenuItemcxx . . $ GMenuItem# *item; |
| 125 | GMenucxx . . $ GMenu# *menu; |
| 126 | |
| 127 | menu = g_menu_newcxx . . $ g_menu_new(19bd89629a99dfed). (); |
| 128 | item = g_menu_item_new_submenucxx . . $ g_menu_item_new_submenu(968823a205d49f31). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, G_MENU_MODELcxx . . $ `<external>/17783962342109199441/gmenumodel.h:116:9`! (menu)); |
| 129 | gtk_builder_menu_push_framecxx . . $ gtk_builder_menu_push_frame(2d107300106fc739). (state, menu, item); |
| 130 | |
| 131 | if (id != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 132 | _gtk_builder_add_objectcxx . . $ _gtk_builder_add_object(e06daa8c1e8ecc34). (state->parser_datacxx . . $ $anonymous_type_f5f0de14019c1965_0#parser_data.->buildercxx . . $ $anonymous_type_3462d6b9001fa9f8_16#builder., id, G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (menu)); |
| 133 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (menu); |
| 134 | } |
| 135 | |
| 136 | return; |
| 137 | } |
| 138 | |
| 139 | else if (g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (element_name, "section")) |
| 140 | { |
| 141 | const char *id; |
| 142 | |
| 143 | if (COLLECTcxx . . $ `gtk/gtkbuilder-menus.c:94:9`! (STRINGcxx . . $ `gtk/gtkbuilder-menus.c:100:9`! | OPTIONALcxx . . $ `gtk/gtkbuilder-menus.c:98:9`!, "id", &id)) |
| 144 | { |
| 145 | GMenuItemcxx . . $ GMenuItem# *item; |
| 146 | GMenucxx . . $ GMenu# *menu; |
| 147 | |
| 148 | menu = g_menu_newcxx . . $ g_menu_new(19bd89629a99dfed). (); |
| 149 | item = g_menu_item_new_sectioncxx . . $ g_menu_item_new_section(968823a205d49f31). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, G_MENU_MODELcxx . . $ `<external>/17783962342109199441/gmenumodel.h:116:9`! (menu)); |
| 150 | gtk_builder_menu_push_framecxx . . $ gtk_builder_menu_push_frame(2d107300106fc739). (state, menu, item); |
| 151 | |
| 152 | if (id != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 153 | _gtk_builder_add_objectcxx . . $ _gtk_builder_add_object(e06daa8c1e8ecc34). (state->parser_datacxx . . $ $anonymous_type_f5f0de14019c1965_0#parser_data.->buildercxx . . $ $anonymous_type_3462d6b9001fa9f8_16#builder., id, G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (menu)); |
| 154 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (menu); |
| 155 | } |
| 156 | |
| 157 | return; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | if (state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..itemcxx . . $ frame#item.) |
| 162 | { |
| 163 | /* Can have '<attribute>' or '<link>' here. */ |
| 164 | if (g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (element_name, "attribute")) |
| 165 | { |
| 166 | const char *typestr = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 167 | const char *name = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 168 | const char *ctxt = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 169 | const char *translatable = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 170 | |
| 171 | if (COLLECTcxx . . $ `gtk/gtkbuilder-menus.c:94:9`! (STRINGcxx . . $ `gtk/gtkbuilder-menus.c:100:9`!, "name", &name, |
| 172 | OPTIONALcxx . . $ `gtk/gtkbuilder-menus.c:98:9`! | STRINGcxx . . $ `gtk/gtkbuilder-menus.c:100:9`! , "translatable", &translatable, |
| 173 | OPTIONALcxx . . $ `gtk/gtkbuilder-menus.c:98:9`! | STRINGcxx . . $ `gtk/gtkbuilder-menus.c:100:9`!, "context", &ctxt, |
| 174 | OPTIONALcxx . . $ `gtk/gtkbuilder-menus.c:98:9`! | STRINGcxx . . $ `gtk/gtkbuilder-menus.c:100:9`!, "comments", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, /* ignore, just for translators */ |
| 175 | OPTIONALcxx . . $ `gtk/gtkbuilder-menus.c:98:9`! | STRINGcxx . . $ `gtk/gtkbuilder-menus.c:100:9`!, "type", &typestr)) |
| 176 | { |
| 177 | if (typestr && !g_variant_type_string_is_validcxx . . $ g_variant_type_string_is_valid(5c4306d8553b3696). (typestr)) |
| 178 | { |
| 179 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, G_VARIANT_PARSE_ERRORcxx . . $ `<external>/10279604295420929244/gvariant.h:335:9`!, |
| 180 | G_VARIANT_PARSE_ERROR_INVALID_TYPE_STRINGcxx . . $ G_VARIANT_PARSE_ERROR_INVALID_TYPE_STRING., |
| 181 | "Invalid GVariant type string '%s'", typestr); |
| 182 | return; |
| 183 | } |
| 184 | |
| 185 | if (translatable && |
| 186 | !gtk_builder_parse_translatablecxx . . $ gtk_builder_parse_translatable(f26f8c8151810388). (translatable, &state->translatablecxx . . $ $anonymous_type_f5f0de14019c1965_0#translatable., error)) |
| 187 | { |
| 188 | return; |
| 189 | } |
| 190 | |
| 191 | state->typecxx . . $ $anonymous_type_f5f0de14019c1965_0#type. = typestr ? g_variant_type_newcxx . . $ g_variant_type_new(62c441bc3ac82a41). (typestr) : NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 192 | state->stringcxx . . $ $anonymous_type_f5f0de14019c1965_0#string. = g_string_newcxx . . $ g_string_new(e8737c02110bb79b). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 193 | state->attributecxx . . $ $anonymous_type_f5f0de14019c1965_0#attribute. = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (name); |
| 194 | state->contextcxx . . $ $anonymous_type_f5f0de14019c1965_0#context. = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (ctxt); |
| 195 | |
| 196 | gtk_builder_menu_push_framecxx . . $ gtk_builder_menu_push_frame(2d107300106fc739). (state, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 197 | } |
| 198 | |
| 199 | return; |
| 200 | } |
| 201 | |
| 202 | if (g_str_equalcxx . . $ `<external>/7714589265505779806/ghash.h:175:9`! (element_name, "link")) |
| 203 | { |
| 204 | const char *name; |
| 205 | const char *id; |
| 206 | |
| 207 | if (COLLECTcxx . . $ `gtk/gtkbuilder-menus.c:94:9`! (STRINGcxx . . $ `gtk/gtkbuilder-menus.c:100:9`!, "name", &name, |
| 208 | STRINGcxx . . $ `gtk/gtkbuilder-menus.c:100:9`! | OPTIONALcxx . . $ `gtk/gtkbuilder-menus.c:98:9`!, "id", &id)) |
| 209 | { |
| 210 | GMenucxx . . $ GMenu# *menu; |
| 211 | |
| 212 | menu = g_menu_newcxx . . $ g_menu_new(19bd89629a99dfed). (); |
| 213 | g_menu_item_set_linkcxx . . $ g_menu_item_set_link(c726f74542086760). (state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..itemcxx . . $ frame#item., name, G_MENU_MODELcxx . . $ `<external>/17783962342109199441/gmenumodel.h:116:9`! (menu)); |
| 214 | gtk_builder_menu_push_framecxx . . $ gtk_builder_menu_push_frame(2d107300106fc739). (state, menu, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 215 | |
| 216 | if (id != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 217 | _gtk_builder_add_objectcxx . . $ _gtk_builder_add_object(e06daa8c1e8ecc34). (state->parser_datacxx . . $ $anonymous_type_f5f0de14019c1965_0#parser_data.->buildercxx . . $ $anonymous_type_3462d6b9001fa9f8_16#builder., id, G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (menu)); |
| 218 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (menu); |
| 219 | } |
| 220 | |
| 221 | return; |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | { |
| 226 | GPtrArraycxx . . $ GPtrArray# *element_stack; |
| 227 | |
| 228 | element_stack = gtk_buildable_parse_context_get_element_stackcxx . . $ gtk_buildable_parse_context_get_element_stack(c968bbf1c4d98579). (context); |
| 229 | |
| 230 | if (element_stack->lencxx . . $ _GPtrArray#len. > 1) |
| 231 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, G_MARKUP_ERRORcxx . . $ `<external>/3876300978290409103/gmarkup.h:72:9`!, G_MARKUP_ERROR_UNKNOWN_ELEMENTcxx . . $ G_MARKUP_ERROR_UNKNOWN_ELEMENT., |
| 232 | _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("Element <%s> not allowed inside <%s>"), |
| 233 | element_name, |
| 234 | (const char *) g_ptr_array_indexcxx . . $ `<external>/13165152102340786875/garray.h:149:12`! (element_stack, element_stack->len - 2)); |
| 235 | |
| 236 | else |
| 237 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, G_MARKUP_ERRORcxx . . $ `<external>/3876300978290409103/gmarkup.h:72:9`!, G_MARKUP_ERROR_UNKNOWN_ELEMENTcxx . . $ G_MARKUP_ERROR_UNKNOWN_ELEMENT., |
| 238 | _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("Element <%s> not allowed at toplevel"), element_name); |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | static void |
| 243 | gtk_builder_menu_end_elementcxx . . $ gtk_builder_menu_end_element(3d4beb7ebf62278d). (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context, |
| 244 | const char *element_name, |
| 245 | gpointercxx . . $ gpointer# user_data, |
| 246 | GErrorcxx . . $ GError# **error) |
| 247 | { |
| 248 | GtkBuilderMenuStatecxx . . $ GtkBuilderMenuState# *state = user_data; |
| 249 | |
| 250 | gtk_builder_menu_pop_framecxx . . $ gtk_builder_menu_pop_frame(b86dff50aae76eb2). (state); |
| 251 | |
| 252 | if (state->stringcxx . . $ $anonymous_type_f5f0de14019c1965_0#string.) |
| 253 | { |
| 254 | GVariantcxx . . $ GVariant# *value; |
| 255 | char *text; |
| 256 | |
| 257 | text = g_string_freecxx . . $ `<external>/2906017559248664336/gstring.h:73:9`! (state->string, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 258 | state->stringcxx . . $ $anonymous_type_f5f0de14019c1965_0#string. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 259 | |
| 260 | /* do the translation if necessary */ |
| 261 | if (state->translatablecxx . . $ $anonymous_type_f5f0de14019c1965_0#translatable.) |
| 262 | { |
| 263 | const char *translated; |
| 264 | |
| 265 | if (state->contextcxx . . $ $anonymous_type_f5f0de14019c1965_0#context.) |
| 266 | translated = g_dpgettext2cxx . . $ g_dpgettext2(9e72f0106375db22). (state->parser_datacxx . . $ $anonymous_type_f5f0de14019c1965_0#parser_data.->domaincxx . . $ $anonymous_type_3462d6b9001fa9f8_16#domain., state->contextcxx . . $ $anonymous_type_f5f0de14019c1965_0#context., text); |
| 267 | else |
| 268 | translated = g_dgettextcxx . . $ g_dgettext(1320557f0feba62c). (state->parser_datacxx . . $ $anonymous_type_f5f0de14019c1965_0#parser_data.->domaincxx . . $ $anonymous_type_3462d6b9001fa9f8_16#domain., text); |
| 269 | |
| 270 | if (translated != text) |
| 271 | { |
| 272 | /* it's safe because we know that translated != text */ |
| 273 | g_freecxx . . $ g_free(5d22bdacc48458e8). (text); |
| 274 | text = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (translated); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | if (state->typecxx . . $ $anonymous_type_f5f0de14019c1965_0#type. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 279 | /* No type string specified -> it's a normal string. */ |
| 280 | g_menu_item_set_attributecxx . . $ g_menu_item_set_attribute(3bc81e74d1cbee70). (state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..itemcxx . . $ frame#item., state->attributecxx . . $ $anonymous_type_f5f0de14019c1965_0#attribute., "s", text); |
| 281 | |
| 282 | /* Else, we try to parse it according to the type string. If |
| 283 | * error is set here, it will follow us out, ending the parse. |
| 284 | * |
| 285 | * We still need to free everything, though, so ignore it here. |
| 286 | */ |
| 287 | else if ((value = g_variant_parsecxx . . $ g_variant_parse(e59413f2c62a76e8). (state->typecxx . . $ $anonymous_type_f5f0de14019c1965_0#type., text, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, error))) |
| 288 | { |
| 289 | g_menu_item_set_attribute_valuecxx . . $ g_menu_item_set_attribute_value(61b8893885d1d99a). (state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..itemcxx . . $ frame#item., state->attributecxx . . $ $anonymous_type_f5f0de14019c1965_0#attribute., value); |
| 290 | g_variant_unrefcxx . . $ g_variant_unref(86dbca581f53fd84). (value); |
| 291 | } |
| 292 | |
| 293 | if (state->typecxx . . $ $anonymous_type_f5f0de14019c1965_0#type.) |
| 294 | { |
| 295 | g_variant_type_freecxx . . $ g_variant_type_free(a4493dc2541edb49). (state->typecxx . . $ $anonymous_type_f5f0de14019c1965_0#type.); |
| 296 | state->typecxx . . $ $anonymous_type_f5f0de14019c1965_0#type. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 297 | } |
| 298 | |
| 299 | state->translatablecxx . . $ $anonymous_type_f5f0de14019c1965_0#translatable. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 300 | |
| 301 | g_freecxx . . $ g_free(5d22bdacc48458e8). (state->contextcxx . . $ $anonymous_type_f5f0de14019c1965_0#context.); |
| 302 | state->contextcxx . . $ $anonymous_type_f5f0de14019c1965_0#context. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 303 | |
| 304 | g_freecxx . . $ g_free(5d22bdacc48458e8). (state->attributecxx . . $ $anonymous_type_f5f0de14019c1965_0#attribute.); |
| 305 | state->attributecxx . . $ $anonymous_type_f5f0de14019c1965_0#attribute. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 306 | |
| 307 | g_freecxx . . $ g_free(5d22bdacc48458e8). (text); |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | static void |
| 312 | gtk_builder_menu_textcxx . . $ gtk_builder_menu_text(119220fb36b7375b). (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context, |
| 313 | const char *text, |
| 314 | gsizecxx . . $ gsize# text_len, |
| 315 | gpointercxx . . $ gpointer# user_data, |
| 316 | GErrorcxx . . $ GError# **error) |
| 317 | { |
| 318 | GtkBuilderMenuStatecxx . . $ GtkBuilderMenuState# *state = user_data; |
| 319 | int i; |
| 320 | |
| 321 | for (i = 0; i < text_len; i++) |
| 322 | if (!g_ascii_isspacecxx . . $ `<external>/7822753393113922331/gstrfuncs.h:85:9`! (text[i])) |
| 323 | { |
| 324 | if (state->stringcxx . . $ $anonymous_type_f5f0de14019c1965_0#string.) |
| 325 | g_string_append_lencxx . . $ `<external>/2906017559248664336/gstring.h:252:9`! (state->string, text, text_len); |
| 326 | |
| 327 | else |
| 328 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, G_MARKUP_ERRORcxx . . $ `<external>/3876300978290409103/gmarkup.h:72:9`!, G_MARKUP_ERROR_INVALID_CONTENTcxx . . $ G_MARKUP_ERROR_INVALID_CONTENT., |
| 329 | _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("Text may not appear inside <%s>"), |
| 330 | gtk_buildable_parse_context_get_elementcxx . . $ gtk_buildable_parse_context_get_element(4cf06b2abbd859b6). (context)); |
| 331 | break; |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | static void |
| 336 | gtk_builder_menu_errorcxx . . $ gtk_builder_menu_error(11caed43eb5753fa). (GtkBuildableParseContextcxx . . $ GtkBuildableParseContext# *context, |
| 337 | GErrorcxx . . $ GError# *error, |
| 338 | gpointercxx . . $ gpointer# user_data) |
| 339 | { |
| 340 | GtkBuilderMenuStatecxx . . $ GtkBuilderMenuState# *state = user_data; |
| 341 | |
| 342 | while (state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..prevcxx . . $ frame#prev.) |
| 343 | { |
| 344 | struct framecxx . . $ frame# *prev = state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame..prevcxx . . $ frame#prev.; |
| 345 | |
| 346 | state->framecxx . . $ $anonymous_type_f5f0de14019c1965_0#frame. = *prev; |
| 347 | |
| 348 | g_freecxx . . $ g_free(5d22bdacc48458e8). (prev); |
| 349 | } |
| 350 | |
| 351 | if (state->stringcxx . . $ $anonymous_type_f5f0de14019c1965_0#string.) |
| 352 | g_string_freecxx . . $ `<external>/2906017559248664336/gstring.h:73:9`! (state->string, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 353 | |
| 354 | if (state->typecxx . . $ $anonymous_type_f5f0de14019c1965_0#type.) |
| 355 | g_variant_type_freecxx . . $ g_variant_type_free(a4493dc2541edb49). (state->typecxx . . $ $anonymous_type_f5f0de14019c1965_0#type.); |
| 356 | |
| 357 | g_freecxx . . $ g_free(5d22bdacc48458e8). (state->attributecxx . . $ $anonymous_type_f5f0de14019c1965_0#attribute.); |
| 358 | g_freecxx . . $ g_free(5d22bdacc48458e8). (state->contextcxx . . $ $anonymous_type_f5f0de14019c1965_0#context.); |
| 359 | |
| 360 | g_freecxx . . $ g_free(5d22bdacc48458e8). (state); |
| 361 | } |
| 362 | |
| 363 | static GtkBuildableParsercxx . . $ GtkBuildableParser# gtk_builder_menu_subparsercxx . . $ gtk_builder_menu_subparser. = |
| 364 | { |
| 365 | gtk_builder_menu_start_elementcxx . . $ gtk_builder_menu_start_element(1a4a7e835e3f8d1e)., |
| 366 | gtk_builder_menu_end_elementcxx . . $ gtk_builder_menu_end_element(3d4beb7ebf62278d)., |
| 367 | gtk_builder_menu_textcxx . . $ gtk_builder_menu_text(119220fb36b7375b)., |
| 368 | gtk_builder_menu_errorcxx . . $ gtk_builder_menu_error(11caed43eb5753fa). |
| 369 | }; |
| 370 | |
| 371 | void |
| 372 | _gtk_builder_menu_startcxx . . $ _gtk_builder_menu_start(ed8a893629d4b436). (ParserDatacxx . . $ ParserData# *parser_data, |
| 373 | const char *element_name, |
| 374 | const char **attribute_names, |
| 375 | const char **attribute_values, |
| 376 | GErrorcxx . . $ GError# **error) |
| 377 | { |
| 378 | GtkBuilderMenuStatecxx . . $ GtkBuilderMenuState# *state; |
| 379 | const char *id = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 380 | char *internal_id = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 381 | |
| 382 | state = g_new0cxx . . $ `<external>/1123956534522462559/gmem.h:335:9`! (GtkBuilderMenuState, 1); |
| 383 | state->parser_datacxx . . $ $anonymous_type_f5f0de14019c1965_0#parser_data. = parser_data; |
| 384 | gtk_buildable_parse_context_pushcxx . . $ gtk_buildable_parse_context_push(2829247e7537960e). (&parser_data->ctxcxx . . $ $anonymous_type_3462d6b9001fa9f8_16#ctx., >k_builder_menu_subparsercxx . . $ gtk_builder_menu_subparser., state); |
| 385 | |
| 386 | if (COLLECTcxx . . $ `gtk/gtkbuilder-menus.c:94:9`! (STRINGcxx . . $ `gtk/gtkbuilder-menus.c:100:9`! | OPTIONALcxx . . $ `gtk/gtkbuilder-menus.c:98:9`!, "id", &id)) |
| 387 | { |
| 388 | GMenucxx . . $ GMenu# *menu; |
| 389 | |
| 390 | if (id == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 391 | { |
| 392 | internal_id = g_strdup_printfcxx . . $ g_strdup_printf(a849077ff1b8d812). ("___object_%d___", ++parser_data->object_countercxx . . $ $anonymous_type_3462d6b9001fa9f8_16#object_counter.); |
| 393 | id = internal_id; |
| 394 | } |
| 395 | |
| 396 | menu = g_menu_newcxx . . $ g_menu_new(19bd89629a99dfed). (); |
| 397 | _gtk_builder_add_objectcxx . . $ _gtk_builder_add_object(e06daa8c1e8ecc34). (state->parser_datacxx . . $ $anonymous_type_f5f0de14019c1965_0#parser_data.->buildercxx . . $ $anonymous_type_3462d6b9001fa9f8_16#builder., id, G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (menu)); |
| 398 | gtk_builder_menu_push_framecxx . . $ gtk_builder_menu_push_frame(2d107300106fc739). (state, menu, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 399 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (menu); |
| 400 | state->idcxx . . $ $anonymous_type_f5f0de14019c1965_0#id. = g_strdupcxx . . $ `<external>/7822753393113922331/gstrfuncs.h:324:9`! (id); |
| 401 | } |
| 402 | |
| 403 | g_freecxx . . $ g_free(5d22bdacc48458e8). (internal_id); |
| 404 | } |
| 405 | |
| 406 | char * |
| 407 | _gtk_builder_menu_endcxx . . $ _gtk_builder_menu_end(2c9f4ddcc187ef33). (ParserDatacxx . . $ ParserData# *parser_data) |
| 408 | { |
| 409 | GtkBuilderMenuStatecxx . . $ GtkBuilderMenuState# *state; |
| 410 | char *id; |
| 411 | |
| 412 | state = gtk_buildable_parse_context_popcxx . . $ gtk_buildable_parse_context_pop(7d95a9b1c6e56e05). (&parser_data->ctxcxx . . $ $anonymous_type_3462d6b9001fa9f8_16#ctx.); |
| 413 | id = state->idcxx . . $ $anonymous_type_f5f0de14019c1965_0#id.; |
| 414 | gtk_builder_menu_pop_framecxx . . $ gtk_builder_menu_pop_frame(b86dff50aae76eb2). (state); |
| 415 | |
| 416 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (state->frame.prev == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 417 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (state->frame.item == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 418 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (state->frame.menu == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 419 | |
| 420 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (state->string == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 421 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (state->attribute == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 422 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (state->context == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 423 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (!state->translatable); |
| 424 | |
| 425 | g_freecxx . . $ g_free(5d22bdacc48458e8). (state); |
| 426 | |
| 427 | return id; |
| 428 | } |