00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00042 #ifndef _FE_GTK_H_
00043 #define _FE_GTK_H_
00044
00045 #include <gtk/gtk.h>
00046
00047 #include "frontend.h"
00048 #include "question.h"
00049
00051 #define QUESTIONBOX_HPADDING 6
00052
00053 #define QUESTIONBOX_VPADDING 3
00054
00055 #define DEFAULT_PADDING 6
00056
00057 #ifdef DI_UDEB
00058
00059 # define BASE_IMAGE_PATH \
00060 "/usr/share/graphics"
00061 #else
00062 # define BASE_IMAGE_PATH \
00063 "/home/lunar/debian/debian-installer/packages/rootskel-gtk/src" \
00064 "/usr/share/graphics"
00065 #endif
00066
00071 #define LOGO_IMAGE_PATH \
00072 BASE_IMAGE_PATH "/logo_debian.png"
00073
00078 #define LOGO_BACKGROUND_COLOR "#d70751"
00079
00081 #define CAN_CANCEL_PROGRESS(Frontend) \
00082 (Frontend->methods.can_cancel_progress(Frontend))
00083
00085 #define CAN_GO_BACK(Frontend) \
00086 (Frontend->methods.can_go_back(Frontend, Frontend->questions))
00087
00089 #define IS_QUESTION_SINGLE(Question) \
00090 (NULL == Question->prev && NULL == Question->next)
00091
00097 typedef void (* setter_function)(struct question * question,
00098 void * user_data);
00099
00101 #define SETTER_FUNCTION(X) ((setter_function) X)
00102
00103 void fe_gtk_register_setter(struct frontend * fe, setter_function func,
00104 struct question * question, void * user_data);
00105
00106 gboolean fe_gtk_is_first_question(struct question * question);
00107
00108 char * fe_gtk_get_text(struct frontend * fe, const char * template,
00109 const char * fallback);
00110
00114 typedef int (* fe_gtk_handler)(struct frontend * fe,
00115 struct question * question,
00116 GtkWidget * question_box);
00117
00119 #define DC_NO_ANSWER (-1)
00120
00126 int fe_gtk_get_answer(struct frontend * fe);
00127
00133 void fe_gtk_set_answer(struct frontend * fe, int answer);
00134
00142 void fe_gtk_set_answer_ok(struct frontend * fe);
00143
00151 void fe_gtk_set_answer_notok(struct frontend * fe);
00152
00160 void fe_gtk_set_answer_goback(struct frontend * fe);
00161
00170 void fe_gtk_force_quit(struct frontend * fe);
00171
00184 void fe_gtk_add_common_layout(struct frontend * fe, struct question * question,
00185 GtkWidget * container, GtkWidget * widget);
00186
00197 void fe_gtk_center_widget(GtkWidget ** widget, guint horizontal_padding,
00198 guint vertical_padding);
00199
00211 gboolean fe_gtk_run_message_dialog(struct frontend * fe, const gchar * title,
00212 const gchar * message);
00213
00223 void fe_gtk_add_global_key_handler(struct frontend * fe, GtkWidget * widget,
00224 GCallback key_event_handler);
00225
00231 void fe_gtk_set_buttons_sensitive(struct frontend * fe, gboolean sensitive);
00232
00242 void fe_gtk_add_button(struct frontend * fe, GtkWidget * button);
00243
00255 void fe_gtk_set_button_secondary(struct frontend * fe, GtkWidget * button,
00256 gboolean secondary);
00257
00267 GtkWidget * fe_gtk_create_continue_button(struct frontend * fe);
00268
00269 #endif