| 1 | /* GTK - The GIMP Toolkit |
| 2 | * Copyright (C) 2011 Benjamin Otte <[email protected]> |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but 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 | |
| 18 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 19 | |
| 20 | #include "gtkcsslookupprivate.h"cxx . . $ `<file>/gtk/gtkcsslookupprivate.h`/ |
| 21 | |
| 22 | #include "gtkcsscustompropertypoolprivate.h"cxx . . $ `<file>/gtk/gtkcsscustompropertypoolprivate.h`/ |
| 23 | #include "gtkcssstylepropertyprivate.h"cxx . . $ `<file>/gtk/gtkcssstylepropertyprivate.h`/ |
| 24 | #include "gtkcsstypesprivate.h"cxx . . $ `<file>/gtk/gtkcsstypesprivate.h`/ |
| 25 | #include "gtkprivatetypebuiltins.h"cxx . . $ `<file>/build/gtk/gtkprivatetypebuiltins.h`/ |
| 26 | #include "gtkprivate.h"cxx . . $ `<file>/gtk/gtkprivate.h`/ |
| 27 | |
| 28 | void |
| 29 | _gtk_css_lookup_initcxx . . $ _gtk_css_lookup_init(a5761c1952fff66a). (GtkCssLookupcxx . . $ GtkCssLookup# *lookup) |
| 30 | { |
| 31 | memsetcxx . . $ memset(d1de1e4fb215f1c6). (lookup, 0, sizeof (*lookup)); |
| 32 | |
| 33 | lookup->set_valuescxx . . $ _GtkCssLookup#set_values. = _gtk_bitmask_newcxx . . $ _gtk_bitmask_new(362ac8b55a0f6712). (); |
| 34 | } |
| 35 | |
| 36 | void |
| 37 | _gtk_css_lookup_destroycxx . . $ _gtk_css_lookup_destroy(a5761c1952fff66a). (GtkCssLookupcxx . . $ GtkCssLookup# *lookup) |
| 38 | { |
| 39 | _gtk_bitmask_freecxx . . $ _gtk_bitmask_free(44a0a5f2c5822bdd). (lookup->set_valuescxx . . $ _GtkCssLookup#set_values.); |
| 40 | |
| 41 | if (lookup->custom_valuescxx . . $ _GtkCssLookup#custom_values.) |
| 42 | g_hash_table_unrefcxx . . $ g_hash_table_unref(ce4eddf544b9218). (lookup->custom_valuescxx . . $ _GtkCssLookup#custom_values.); |
| 43 | } |
| 44 | |
| 45 | gbooleancxx . . $ gboolean# |
| 46 | _gtk_css_lookup_is_missingcxx . . $ _gtk_css_lookup_is_missing(60ee19a30eaa9590). (const GtkCssLookupcxx . . $ GtkCssLookup# *lookup, |
| 47 | guintcxx . . $ guint# id) |
| 48 | { |
| 49 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (lookup != NULL, FALSE); |
| 50 | |
| 51 | return !_gtk_bitmask_getcxx . . $ _gtk_bitmask_get(ec1f9572e2cb12df). (lookup->set_valuescxx . . $ _GtkCssLookup#set_values., id); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * _gtk_css_lookup_set: |
| 56 | * @lookup: the lookup |
| 57 | * @id: id of the property to set, see _gtk_style_property_get_id() |
| 58 | * @section: (nullable): The @section the value was defined in |
| 59 | * @value: the “cascading value” to use |
| 60 | * |
| 61 | * Sets the @value for a given @id. No value may have been set for @id |
| 62 | * before. See _gtk_css_lookup_is_missing(). This function is used to |
| 63 | * set the “winning declaration” of a lookup. Note that for performance |
| 64 | * reasons @value and @section are not copied. It is your responsibility |
| 65 | * to ensure they are kept alive until _gtk_css_lookup_free() is called. |
| 66 | **/ |
| 67 | void |
| 68 | _gtk_css_lookup_setcxx . . $ _gtk_css_lookup_set(b3ce5b9caf3307d4). (GtkCssLookupcxx . . $ GtkCssLookup# *lookup, |
| 69 | guintcxx . . $ guint# id, |
| 70 | GtkCssSectioncxx . . $ GtkCssSection# *section, |
| 71 | GtkCssValuecxx . . $ GtkCssValue# *value) |
| 72 | { |
| 73 | gtk_internal_return_if_failcxx . . $ `gtk/gtkprivate.h:50:9`! (lookup != NULL); |
| 74 | gtk_internal_return_if_failcxx . . $ `gtk/gtkprivate.h:50:9`! (value != NULL); |
| 75 | gtk_internal_return_if_failcxx . . $ `gtk/gtkprivate.h:50:9`! (lookup->values[id].value == NULL); |
| 76 | |
| 77 | lookup->valuescxx . . $ _GtkCssLookup#values.[id].valuecxx . . $ $anonymous_type_7f1be016d46968bc_0#value. = value; |
| 78 | lookup->valuescxx . . $ _GtkCssLookup#values.[id].sectioncxx . . $ $anonymous_type_7f1be016d46968bc_0#section. = section; |
| 79 | lookup->set_valuescxx . . $ _GtkCssLookup#set_values. = _gtk_bitmask_setcxx . . $ _gtk_bitmask_set(d4be56091f3b3606). (lookup->set_valuescxx . . $ _GtkCssLookup#set_values., id, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 80 | } |
| 81 | |
| 82 | void |
| 83 | _gtk_css_lookup_set_customcxx . . $ _gtk_css_lookup_set_custom(b13e1e91a3161ccc). (GtkCssLookupcxx . . $ GtkCssLookup# *lookup, |
| 84 | int id, |
| 85 | GtkCssVariableValuecxx . . $ GtkCssVariableValue# *value) |
| 86 | { |
| 87 | gtk_internal_return_if_failcxx . . $ `gtk/gtkprivate.h:50:9`! (lookup != NULL); |
| 88 | |
| 89 | if (!lookup->custom_valuescxx . . $ _GtkCssLookup#custom_values.) |
| 90 | lookup->custom_valuescxx . . $ _GtkCssLookup#custom_values. = g_hash_table_newcxx . . $ g_hash_table_new(444186de27d60923). (g_direct_hashcxx . . $ g_direct_hash(b11f534102b1ad6)., g_direct_equalcxx . . $ g_direct_equal(9148c8c3ff42c9d8).); |
| 91 | |
| 92 | if (!g_hash_table_containscxx . . $ g_hash_table_contains(453ebbf4abdbe50e). (lookup->custom_valuescxx . . $ _GtkCssLookup#custom_values., GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (id))) |
| 93 | g_hash_table_replacecxx . . $ g_hash_table_replace(6a7c46015dd5ef26). (lookup->custom_valuescxx . . $ _GtkCssLookup#custom_values., GINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:106:9`! (id), value); |
| 94 | } |