static gboolean gtk_css_matcher_widget_path_has_region (const GtkCssMatcher *matcher, const char *region, GtkRegionFlags flags) { const GtkWidgetPath *siblings; GtkRegionFlags region_flags; siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index); if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index)) { if (!gtk_widget_path_iter_has_region (siblings, matcher->path.sibling_index, region, ®ion_flags)) return FALSE; } else { if (!gtk_widget_path_iter_has_region (matcher->path.path, matcher->path.index, region, ®ion_flags)) return FALSE; } if ((flags & region_flags) != flags) return FALSE; return TRUE; }
static VALUE rg_iter_has_region(VALUE self, VALUE pos, VALUE name) { GtkRegionFlags flags; gboolean result; result = gtk_widget_path_iter_has_region(_SELF(self), NUM2INT(pos), RVAL2CSTR(name), &flags); return result ? GTKREGIONFLAGS2RVAL(flags) : Qnil; }
static gboolean gtk_css_matcher_widget_path_has_region (const GtkCssMatcher *matcher, const char *region, GtkRegionFlags flags) { const GtkWidgetPath *siblings; GtkRegionFlags region_flags; if (matcher->path.decl) { GQuark q = g_quark_try_string (region); if (q && gtk_css_node_declaration_has_region (matcher->path.decl, q, ®ion_flags)) goto found; } G_GNUC_BEGIN_IGNORE_DEPRECATIONS siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index); if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index)) { if (!gtk_widget_path_iter_has_region (siblings, matcher->path.sibling_index, region, ®ion_flags)) return FALSE; } else { if (!gtk_widget_path_iter_has_region (matcher->path.path, matcher->path.index, region, ®ion_flags)) return FALSE; } G_GNUC_END_IGNORE_DEPRECATIONS found: if ((flags & region_flags) != flags) return FALSE; return TRUE; }