#include "choice_model.h"
#include <string.h>
#include <gtk/gtk.h>
#include "frontend.h"
#include "question.h"
#include "strutl.h"
Include dependency graph for choice_model.c:

Go to the source code of this file.
Data Structures | |
| struct | search_result |
| Internal data structure used by fe_gtk_choice_model_find_value(). More... | |
Functions | |
| static gboolean | is_searched_value (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, struct search_result *result) |
| GtkTreeModelForeachFunc used by fe_gtk_choice_model_find_value(). | |
| GtkTreePath * | fe_gtk_choice_model_find_value (GtkTreeModel *model, const char *searched_value) |
| Search for a given value in a model. | |
| GtkTreeModel * | fe_gtk_choice_model_create_full (struct frontend *fe, struct question *question, parent_predicate is_parent) |
| Full interface to create a tree model from a given question. | |
| GtkTreeModel * | fe_gtk_choice_model_create (struct frontend *fe, struct question *question) |
| Create a one level model for a given question. | |
| static gboolean | increment_model_length (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, guint *length) |
| GtkTreeModelForeachFunc used by fe_gtk_choice_model_get_length(). | |
| guint | fe_gtk_choice_model_get_length (GtkTreeModel *model) |
| Get the total number of choices in the given model. | |
| static gboolean | is_selected (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, GtkTreePath **result) |
| GtkTreeModelForeachFunc used by fe_gtk_choice_model_get_first_selected(). | |
| GtkTreePath * | fe_gtk_choice_model_get_first_selected (GtkTreeModel *model) |
| Get the first selected choice in the given model. | |
| void | fe_gtk_choice_model_set (GtkTreeModel *model, GtkTreeIter *iter,...) |
| Set a given row in the model. | |
For internal use only.
Definition in file choice_model.c.
| GtkTreeModel* fe_gtk_choice_model_create | ( | struct frontend * | fe, | |
| struct question * | question | |||
| ) |
Create a one level model for a given question.
| fe | cdebconf frontend | |
| question | a select or multiselect question |
Definition at line 222 of file choice_model.c.
References fe_gtk_choice_model_create_full().
Referenced by handle_all().
| GtkTreeModel* fe_gtk_choice_model_create_full | ( | struct frontend * | fe, | |
| struct question * | question, | |||
| parent_predicate | is_parent | |||
| ) |
Full interface to create a tree model from a given question.
| fe | cdebconf frontend | |
| question | select or multiselect question | |
| is_parent | helper determining if a choice is the parent of the next choices |
Definition at line 113 of file choice_model.c.
References fe_gtk_choice_model_find_value(), and path.
Referenced by create_select_list(), and fe_gtk_choice_model_create().
| GtkTreePath* fe_gtk_choice_model_find_value | ( | GtkTreeModel * | model, | |
| const char * | searched_value | |||
| ) |
Search for a given value in a model.
The allocated GtkTreePath must be freed by the caller.
| model | model to be searched | |
| searched_value | value to be found |
Definition at line 91 of file choice_model.c.
References is_searched_value(), search_result::path, and search_result::searched_value.
Referenced by fe_gtk_choice_model_create_full().
| GtkTreePath* fe_gtk_choice_model_get_first_selected | ( | GtkTreeModel * | model | ) |
Get the first selected choice in the given model.
The returned path must be free'd by the caller.
| model | searched model |
Definition at line 291 of file choice_model.c.
References is_selected().
Referenced by create_select_list(), and set_selected_active().
| guint fe_gtk_choice_model_get_length | ( | GtkTreeModel * | model | ) |
Get the total number of choices in the given model.
| model | measured model |
Definition at line 250 of file choice_model.c.
References increment_model_length().
Referenced by create_multiselect_checkboxes(), and set_value_from_multiselect().
| void fe_gtk_choice_model_set | ( | GtkTreeModel * | model, | |
| GtkTreeIter * | iter, | |||
| ... | ||||
| ) |
Set a given row in the model.
This function has the same interface than gtk_tree_store_set(), and the same effect. It is just here to abstract over the GtkTreeModel implementation used for choice models.
| model | the model to modify | |
| iter | position in the model |
Definition at line 309 of file choice_model.c.
Referenced by update_selection_for_toggle().
| static gboolean increment_model_length | ( | GtkTreeModel * | model, | |
| GtkTreePath * | path, | |||
| GtkTreeIter * | iter, | |||
| guint * | length | |||
| ) | [static] |
GtkTreeModelForeachFunc used by fe_gtk_choice_model_get_length().
| model | traversed model | |
| path | path of the current value | |
| iter | iter pointing to the current value | |
| length | current known size of the model |
Definition at line 237 of file choice_model.c.
Referenced by fe_gtk_choice_model_get_length().
| static gboolean is_searched_value | ( | GtkTreeModel * | model, | |
| GtkTreePath * | path, | |||
| GtkTreeIter * | iter, | |||
| struct search_result * | result | |||
| ) | [static] |
GtkTreeModelForeachFunc used by fe_gtk_choice_model_find_value().
| model | searched model | |
| path | path of the current value | |
| iter | iter pointing to the current value | |
| result | search result structure |
Definition at line 68 of file choice_model.c.
References search_result::path, and search_result::searched_value.
Referenced by fe_gtk_choice_model_find_value().
| static gboolean is_selected | ( | GtkTreeModel * | model, | |
| GtkTreePath * | path, | |||
| GtkTreeIter * | iter, | |||
| GtkTreePath ** | result | |||
| ) | [static] |
GtkTreeModelForeachFunc used by fe_gtk_choice_model_get_first_selected().
| model | searched model | |
| path | path of the current value | |
| iter | iter pointing to the current value | |
| result | search result structure |
Definition at line 269 of file choice_model.c.
Referenced by fe_gtk_choice_model_get_first_selected().
1.5.1