scripts/kconfig/gconf.c

Source file repositories/reference/linux-study-clean/scripts/kconfig/gconf.c

File Facts

System
Linux kernel
Corpus path
scripts/kconfig/gconf.c
Extension
.c
Size
36187 bytes
Lines
1357
Domain
Support Tooling And Documentation
Bucket
scripts
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

if (menu == match) {
			GtkTreeSelection *selection;
			GtkTreePath *path;

			/*
			 * Expand parents to reflect the selection, and
			 * scroll down to it.
			 */
			path = gtk_tree_model_get_path(model, &iter);
			gtk_tree_view_expand_to_path(view, path);
			gtk_tree_view_scroll_to_cell(view, path, NULL, TRUE,
						     0.5, 0.0);
			gtk_tree_path_free(path);

			selection = gtk_tree_view_get_selection(view);
			gtk_tree_selection_select_iter(selection, &iter);

			text_insert_help(menu);
		}

		_select_menu(view, model, &iter, match);

		valid = gtk_tree_model_iter_next(model, &iter);
	}
}

static void select_menu(GtkTreeView *view, struct menu *match)
{
	_select_menu(view, gtk_tree_view_get_model(view), NULL, match);
}

static void _update_row_visibility(GtkTreeView *view)
{
	GtkTreeModelFilter *filter = GTK_TREE_MODEL_FILTER(gtk_tree_view_get_model(view));

	gtk_tree_model_filter_refilter(filter);
}

static void update_row_visibility(void)
{
	if (view_mode == SPLIT_VIEW)
		_update_row_visibility(GTK_TREE_VIEW(tree1_w));
	_update_row_visibility(GTK_TREE_VIEW(tree2_w));
}

static void set_node(GtkTreeStore *tree, GtkTreeIter *node, struct menu *menu)
{
	struct symbol *sym = menu->sym;
	tristate val;
	gchar *option;
	const gchar *_no = "";
	const gchar *_mod = "";
	const gchar *_yes = "";
	const gchar *value = "";
	GdkRGBA color;
	gboolean editable = FALSE;
	gboolean btnvis = FALSE;

	option = g_strdup_printf("%s %s %s %s",
				 menu->type == M_COMMENT ? "***" : "",
				 menu_get_prompt(menu),
				 menu->type == M_COMMENT ? "***" : "",
				 sym && !sym_has_value(sym) ? "(NEW)" : "");

	gdk_rgba_parse(&color, menu_is_visible(menu) ? "Black" : "DarkGray");

	if (!sym)
		goto set;

	sym_calc_value(sym);

	if (menu->type == M_CHOICE) {	// parse children to get a final value
		struct symbol *def_sym = sym_calc_choice(menu);
		struct menu *def_menu = NULL;

		for (struct menu *child = menu->list; child; child = child->next) {
			if (menu_is_visible(child) && child->sym == def_sym)
				def_menu = child;
		}

		if (def_menu)
			value = menu_get_prompt(def_menu);

		goto set;
	}

	switch (sym_get_type(sym)) {
	case S_BOOLEAN:
	case S_TRISTATE:

Annotation

Implementation Notes