| 1 |
/***************************************************************************** |
| 2 |
* |
| 3 |
* cdebconf - An implementation of the Debian Configuration Management |
| 4 |
* System |
| 5 |
* |
| 6 |
* cdebconf is (c) 2000-2007 Randolph Chung and others under the following |
| 7 |
* license. |
| 8 |
* |
| 9 |
* Redistribution and use in source and binary forms, with or without |
| 10 |
* modification, are permitted provided that the following conditions |
| 11 |
* are met: |
| 12 |
* |
| 13 |
* 1. Redistributions of source code must retain the above copyright |
| 14 |
* notice, this list of conditions and the following disclaimer. |
| 15 |
* |
| 16 |
* 2. Redistributions in binary form must reproduce the above copyright |
| 17 |
* notice, this list of conditions and the following disclaimer in the |
| 18 |
* documentation and/or other materials provided with the distribution. |
| 19 |
* |
| 20 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND |
| 21 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 22 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 23 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
| 24 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 25 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 26 |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 27 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 28 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 29 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 30 |
* SUCH DAMAGE. |
| 31 |
* |
| 32 |
*****************************************************************************/ |
| 33 |
|
| 34 |
/** @file fe_data.h |
| 35 |
* data structure handling specific informations about the GTK+ frontend |
| 36 |
*/ |
| 37 |
|
| 38 |
#ifndef _FE_DATA_H |
| 39 |
#define _FE_DATA_H |
| 40 |
|
| 41 |
#include <gtk/gtk.h> |
| 42 |
|
| 43 |
#include "progress.h" |
| 44 |
#include "go.h" |
| 45 |
|
| 46 |
/** A structure holding specific data of the GTK+ frontend. |
| 47 |
* |
| 48 |
* It is normally accessed by the "data" field of "struct frontend". |
| 49 |
*/ |
| 50 |
struct frontend_data |
| 51 |
{ |
| 52 |
/** Main window of the frontend. */ |
| 53 |
GtkWidget * window; |
| 54 |
|
| 55 |
/** Label used to display frontend's title. |
| 56 |
* |
| 57 |
* @see cdebconf_gtk_update_frontend_title() |
| 58 |
* @see cdebconf_gtk_set_title() |
| 59 |
*/ |
| 60 |
GtkWidget * title; |
| 61 |
|
| 62 |
/** Logo size, used to display info messages. |
| 63 |
* |
| 64 |
* @see create_banner() |
| 65 |
* @see handle_exposed_banner() |
| 66 |
*/ |
| 67 |
int logo_width; |
| 68 |
int logo_height; |
| 69 |
GtkWidget * logo_widget; |
| 70 |
GtkWidget * logo_widget_l; |
| 71 |
GtkWidget * logo_widget_r; |
| 72 |
GtkJustification banner_label_position; |
| 73 |
bool banner_expands_left; |
| 74 |
bool banner_expands_right; |
| 75 |
bool banner_adjusted; |
| 76 |
|
| 77 |
/** Workaround for #882804, GTK 2 only |
| 78 |
* |
| 79 |
* @see cdebconf_gtk_update_frontend_info() |
| 80 |
*/ |
| 81 |
GtkWidget * banner_widget; |
| 82 |
bool banner_workaround_needed; |
| 83 |
|
| 84 |
/** Internal data of the handler of progress commands. |
| 85 |
* |
| 86 |
* @see progress.c |
| 87 |
*/ |
| 88 |
struct progress_data * progress_data; |
| 89 |
|
| 90 |
/** Start of the single linked list of "setter" functions ran after |
| 91 |
* users have validated their choice. |
| 92 |
* |
| 93 |
* @see struct setter |
| 94 |
*/ |
| 95 |
struct setter * setters; |
| 96 |
|
| 97 |
/** Container for main buttons. */ |
| 98 |
GtkWidget * action_box; |
| 99 |
|
| 100 |
/** Container for either the questions widgets or the progress widgets. */ |
| 101 |
GtkWidget * target_box; |
| 102 |
|
| 103 |
/** Event listener thread. |
| 104 |
* |
| 105 |
* @see create_event_listener_thread() |
| 106 |
*/ |
| 107 |
GThread * event_listener; |
| 108 |
|
| 109 |
/** Answer to the current debconf command. |
| 110 |
* |
| 111 |
* This is used by both GO and progress handlers to synchronize the |
| 112 |
* frontend on user input. |
| 113 |
* |
| 114 |
* @see cdebconf_gtk_get_answer() |
| 115 |
* @see cdebconf_gtk_set_answer() |
| 116 |
*/ |
| 117 |
int answer; |
| 118 |
|
| 119 |
/** Allow non-blocking wait on the frontend answer. |
| 120 |
* |
| 121 |
* @see frontend_data#answer |
| 122 |
* @see wait_answer() |
| 123 |
*/ |
| 124 |
GCond answer_cond; |
| 125 |
|
| 126 |
/** Lock around the frontend answer. |
| 127 |
* |
| 128 |
* @see frontend_data#answer |
| 129 |
*/ |
| 130 |
GMutex answer_mutex; |
| 131 |
|
| 132 |
/** Associates question type and plugins. |
| 133 |
* |
| 134 |
* This table also serves as a cache, preventing us to load the same |
| 135 |
* plugins again and again. |
| 136 |
* |
| 137 |
* @see find_external_handler() |
| 138 |
*/ |
| 139 |
GHashTable * plugins; |
| 140 |
|
| 141 |
/** Current question for which help will be displayed. */ |
| 142 |
struct question * help_question; |
| 143 |
|
| 144 |
#ifdef DI_UDEB |
| 145 |
/** Internal data for specific handling related to the debian-installer. |
| 146 |
* |
| 147 |
* @see di.c |
| 148 |
*/ |
| 149 |
struct di_data * di_data; |
| 150 |
#endif /* DI_UDEB */ |
| 151 |
}; |
| 152 |
|
| 153 |
#endif /* !_FE_DATA_H */ |
| 154 |
|
| 155 |
/* vim: et sw=4 si |
| 156 |
*/ |