#include <syslog.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <signal.h>
#include <string.h>
#include <errno.h>
#include "common.h"
#include "template.h"
#include "question.h"
#include "frontend.h"
#include "database.h"
#include "plugin.h"
#include "strutl.h"
#include "fe_gtk.h"
#include "fe_data.h"
#include "handlers.h"
#include "select_handlers.h"
#include "descriptions.h"
#include "progress.h"
#include "go.h"
#include "ui.h"
#include "di.h"
Include dependency graph for fe_gtk.c:

Go to the source code of this file.
Functions | |
| char * | fe_gtk_get_text (struct frontend *fe, const char *template, const char *fallback) |
| Get the description of a given template. | |
| static void * | handle_gtk_events (void *dummy) |
| A GThreadFunc calling the GTK+ main loop. | |
| gboolean | fe_gtk_is_first_question (struct question *question) |
| Determines if a question is the first question requiring user input of the current question row. | |
| void | fe_gtk_force_quit (struct frontend *fe) |
| Force cdebconf to quit. | |
| static void | destroy_frontend_data (struct frontend *fe) |
| De-allocate and de-init all elements of the GTK+ frontend data. | |
| static gboolean | create_frontend_data (struct frontend *fe) |
| Allocate and initialize non-graphical elements of the GTK+ frontend. | |
| static int | fe_gtk_shutdown (struct frontend *fe) |
| Implements the shutdown method of cdebconf frontends. | |
| static void | show_main_window (struct frontend *fe) |
| Show the GTK+ frontend window. | |
| int | fe_gtk_get_answer (struct frontend *fe) |
| Get the pending debconf answer in a thread-safe way. | |
| void | fe_gtk_set_answer (struct frontend *fe, int answer) |
| Set the pending debconf answer in a thread-safe way. | |
| void | fe_gtk_set_answer_ok (struct frontend *fe) |
| Set the pending debconf answer to DC_OK. | |
| void | fe_gtk_set_answer_notok (struct frontend *fe) |
| Set the pending debconf answer to DC_NOTOK. | |
| void | fe_gtk_set_answer_goback (struct frontend *fe) |
| Set the pending debconf answer to DC_GOBACK. | |
| static gboolean | create_event_listener_thread (struct frontend *fe) |
| Create the event listener thread. | |
| static int | fe_gtk_initialize (struct frontend *fe, struct configuration *conf) |
| Implements the initialize method of cdebconf frontends. | |
| static void | fe_gtk_set_title (struct frontend *fe, const char *title) |
| Implements the set_title method of cdebconf frontends. | |
| static bool | fe_gtk_can_go_back (struct frontend *fe, struct question *question) |
| Implements the can_go_back function of cdebconf frontends. | |
| static unsigned long | fe_gtk_query_capability (struct frontend *fe) |
| Implements the query_capability function of cdebconf frontends. | |
Variables | |
| frontend_module | debconf_frontend_module |
| Describe our frontend implementation to cdebconf. | |
Definition in file fe_gtk.c.
| static gboolean create_event_listener_thread | ( | struct frontend * | fe | ) | [static] |
Create the event listener thread.
| fe | cdebconf frontend |
Definition at line 306 of file fe_gtk.c.
References frontend_data::event_listener, and handle_gtk_events().
Referenced by fe_gtk_initialize().
| static gboolean create_frontend_data | ( | struct frontend * | fe | ) | [static] |
Allocate and initialize non-graphical elements of the GTK+ frontend.
The data field of the given frontend will be set to the newly allocated structure.
| fe | cdebconf frontend |
Definition at line 184 of file fe_gtk.c.
References frontend_data::answer_cond, frontend_data::answer_mutex, destroy_frontend_data(), and frontend_data::plugins.
Referenced by fe_gtk_initialize().
| static void destroy_frontend_data | ( | struct frontend * | fe | ) | [static] |
De-allocate and de-init all elements of the GTK+ frontend data.
| fe | cdebconf frontend |
Definition at line 143 of file fe_gtk.c.
References frontend_data::action_box, fe_gtk_progress_stop(), fe_gtk_set_answer_notok(), frontend_data::plugins, frontend_data::target_box, frontend_data::title, and frontend_data::window.
Referenced by create_frontend_data(), and fe_gtk_shutdown().
| static bool fe_gtk_can_go_back | ( | struct frontend * | fe, | |
| struct question * | question | |||
| ) | [static] |
| void fe_gtk_force_quit | ( | struct frontend * | fe | ) |
Force cdebconf to quit.
This function is currently used when the main window is closed.
It is implemented by sending a TERM signal to the current process,
| fe | cdebconf frontend |
Definition at line 132 of file fe_gtk.c.
Referenced by handle_closed_main_window().
| int fe_gtk_get_answer | ( | struct frontend * | fe | ) |
Get the pending debconf answer in a thread-safe way.
| fe | cdebconf frontend |
Definition at line 260 of file fe_gtk.c.
References frontend_data::answer, and frontend_data::answer_mutex.
| char* fe_gtk_get_text | ( | struct frontend * | fe, | |
| const char * | template, | |||
| const char * | fallback | |||
| ) |
Get the description of a given template.
The caller is responsible to free the returned string.
| fe | cdebconf frontend | |
| template | template name | |
| fallback | fallback string when the template does not exists |
Definition at line 84 of file fe_gtk.c.
Referenced by create_cancel_button(), create_dialog_action_box(), create_goback_button(), fe_gtk_create_continue_button(), get_text_direction(), handle_boolean_buttons(), handle_boolean_radio(), and popup_success().
| static int fe_gtk_initialize | ( | struct frontend * | fe, | |
| struct configuration * | conf | |||
| ) | [static] |
Implements the initialize method of cdebconf frontends.
This will initialize the GTK+ frontend data, the GTK+ window and common widgets and forks the event handling thread.
Definition at line 331 of file fe_gtk.c.
References create_event_listener_thread(), create_frontend_data(), fe_gtk_create_main_window(), fe_gtk_di_setup(), fe_gtk_shutdown(), and show_main_window().
| gboolean fe_gtk_is_first_question | ( | struct question * | question | ) |
Determines if a question is the first question requiring user input of the current question row.
| question | question that will be tested |
Definition at line 116 of file fe_gtk.c.
Referenced by create_multiselect_checkboxes(), create_select_combo(), fe_gtk_handle_password(), fe_gtk_handle_string(), and handle_boolean_radio().
| static unsigned long fe_gtk_query_capability | ( | struct frontend * | fe | ) | [static] |
| void fe_gtk_set_answer | ( | struct frontend * | fe, | |
| int | answer | |||
| ) |
Set the pending debconf answer in a thread-safe way.
| fe | cdebconf frontend | |
| answer | the new answer value |
Definition at line 272 of file fe_gtk.c.
References frontend_data::answer, frontend_data::answer_cond, and frontend_data::answer_mutex.
Referenced by fe_gtk_go(), fe_gtk_progress_start(), fe_gtk_set_answer_goback(), fe_gtk_set_answer_notok(), and fe_gtk_set_answer_ok().
| void fe_gtk_set_answer_goback | ( | struct frontend * | fe | ) |
Set the pending debconf answer to DC_GOBACK.
This function is provided by convenience as a possible argument for g_signal_connect_swapped().
| fe | cdebconf frontend |
Definition at line 295 of file fe_gtk.c.
References fe_gtk_set_answer().
Referenced by create_cancel_button(), create_goback_button(), handle_cancel_key(), and handle_goback_key().
| void fe_gtk_set_answer_notok | ( | struct frontend * | fe | ) |
Set the pending debconf answer to DC_NOTOK.
This function is provided by convenience as a possible argument for g_signal_connect_swapped().
| fe | cdebconf frontend |
Definition at line 289 of file fe_gtk.c.
References fe_gtk_set_answer().
Referenced by destroy_frontend_data().
| void fe_gtk_set_answer_ok | ( | struct frontend * | fe | ) |
Set the pending debconf answer to DC_OK.
This function is provided by convenience as a possible argument for g_signal_connect_swapped().
| fe | cdebconf frontend |
Definition at line 283 of file fe_gtk.c.
References fe_gtk_set_answer().
Referenced by create_select_list(), fe_gtk_create_continue_button(), handle_false_button(), and handle_true_button().
| static void fe_gtk_set_title | ( | struct frontend * | fe, | |
| const char * | title | |||
| ) | [static] |
Implements the set_title method of cdebconf frontends.
When build for the debian-installer, this will only update the corresponding fields in frontend data. The title widget will then be updated by fe_gtk_di_run_dialog() on the next GO or progress start.
| fe | cdebconf frontend | |
| title | new frontend title |
Definition at line 384 of file fe_gtk.c.
References fe_gtk_update_frontend_title().
| static int fe_gtk_shutdown | ( | struct frontend * | fe | ) | [static] |
Implements the shutdown method of cdebconf frontends.
| fe | cdebconf frontend |
Definition at line 226 of file fe_gtk.c.
References destroy_frontend_data(), frontend_data::event_listener, fe_gtk_destroy_main_window(), and fe_gtk_di_shutdown().
Referenced by fe_gtk_initialize().
| static void* handle_gtk_events | ( | void * | dummy | ) | [static] |
A GThreadFunc calling the GTK+ main loop.
This function will be run in another thread and will happily process GTK+ events resulting in user interaction.
| dummy | an unused parameter |
Definition at line 101 of file fe_gtk.c.
Referenced by create_event_listener_thread().
| static void show_main_window | ( | struct frontend * | fe | ) | [static] |
Show the GTK+ frontend window.
| fe | cdebconf frontend |
Definition at line 250 of file fe_gtk.c.
References frontend_data::window.
Referenced by fe_gtk_initialize().
| struct frontend_module debconf_frontend_module |
Initial value:
{
initialize: fe_gtk_initialize,
shutdown: fe_gtk_shutdown,
can_go_back: fe_gtk_can_go_back,
query_capability: fe_gtk_query_capability,
set_title: fe_gtk_set_title,
go: fe_gtk_go,
can_cancel_progress: fe_gtk_can_cancel_progress,
progress_start: fe_gtk_progress_start,
progress_info: fe_gtk_progress_info,
progress_set: fe_gtk_progress_set,
progress_stop: fe_gtk_progress_stop,
}
1.5.1