fe_gtk.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  * cdebconf - An implementation of the Debian Configuration Management
00004  *            System
00005  *
00006  * $Id$
00007  *
00008  * cdebconf is (c) 2000-2007 Randolph Chung and others under the following
00009  * license.
00010  *
00011  * Redistribution and use in source and binary forms, with or without
00012  * modification, are permitted provided that the following conditions
00013  * are met:
00014  *
00015  * 1. Redistributions of source code must retain the above copyright
00016  * notice, this list of conditions and the following disclaimer.
00017  *
00018  * 2. Redistributions in binary form must reproduce the above copyright
00019  * notice, this list of conditions and the following disclaimer in the
00020  * documentation and/or other materials provided with the distribution.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
00023  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00024  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00025  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
00026  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00027  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00028  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00029  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00031  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00032  * SUCH DAMAGE.
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 /* DI_UDEB */
00062 # define BASE_IMAGE_PATH \
00063     "/home/lunar/debian/debian-installer/packages/rootskel-gtk/src" \
00064     "/usr/share/graphics"
00065 #endif /* DI_UDEB */
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 /* !_FE_GTK_H_ */

Generated on Sat Jul 7 23:41:41 2007 for fe_gtk by  doxygen 1.5.1