descriptions.c File Reference

tools to display question descriptions for the GTK+ frontend of cdebconf More...

#include "descriptions.h"
#include <string.h>
#include <gtk/gtk.h>
#include "frontend.h"
#include "question.h"
#include "template.h"
#include "fe_gtk.h"
#include "fe_data.h"

Include dependency graph for descriptions.c:

Go to the source code of this file.

Defines

#define DESCRIPTION_MARGIN   4
 margin around descriptions
#define DESCRIPTION_VPADDING   3
 vertical padding around descriptions
#define EXT_DESCRIPTION_VPADDING   2
 vertical padding around extendend description

Functions

static const char * get_icon_path (struct question *question)
 Get the full path to an icon associated to a question type.
static void add_icon (struct question *question, GtkWidget *container)
 Add an icon for a given question in the given container.
static GdkColor * get_background_color (struct frontend *fe)
 Get the background color for the main window of the frontend.
static void add_description (struct frontend *fe, struct question *question, GtkWidget *container)
 Add a description to a given container.
static void add_extended_description (struct frontend *fe, struct question *question, GtkWidget *container)
 Add an extendend description to a given container.
GtkWidget * fe_gtk_create_description (struct frontend *fe, struct question *question)
 Return a new widget with description and extendend description of a given question.

Variables

struct {
   const char *   type
 question type
   const char *   path
 full path to the associated icon
icon_mapping []
 A mapping between question type and icons for descriptions.


Detailed Description

tools to display question descriptions for the GTK+ frontend of cdebconf

Definition in file descriptions.c.


Function Documentation

static void add_description ( struct frontend *  fe,
struct question *  question,
GtkWidget *  container 
) [static]

Add a description to a given container.

Parameters:
fe cdebconf frontend
question the question from which the description will be read
container the container where the description will be added

Definition at line 134 of file descriptions.c.

References DESCRIPTION_MARGIN, DESCRIPTION_VPADDING, and get_background_color().

Referenced by fe_gtk_create_description().

static void add_extended_description ( struct frontend *  fe,
struct question *  question,
GtkWidget *  container 
) [static]

Add an extendend description to a given container.

Parameters:
fe cdebconf frontend
question the question from which the extendend description will be read
container the container where the extendend description will be added

Definition at line 177 of file descriptions.c.

References EXT_DESCRIPTION_VPADDING, and get_background_color().

Referenced by fe_gtk_create_description().

static void add_icon ( struct question *  question,
GtkWidget *  container 
) [static]

Add an icon for a given question in the given container.

Parameters:
question the question
container the container where the icon will be added

Definition at line 87 of file descriptions.c.

References get_icon_path().

Referenced by fe_gtk_create_description().

GtkWidget* fe_gtk_create_description ( struct frontend *  fe,
struct question *  question 
)

Return a new widget with description and extendend description of a given question.

Parameters:
fe cdebconf frontend
question question that will be looked upon
Returns:
a newly created widget or NULL on failure

Definition at line 211 of file descriptions.c.

References add_description(), add_extended_description(), and add_icon().

Referenced by fe_gtk_add_common_layout().

static GdkColor* get_background_color ( struct frontend *  fe  )  [static]

Get the background color for the main window of the frontend.

Parameters:
fe cdebconf frontend
Returns:
the background color of the main window

Definition at line 114 of file descriptions.c.

References frontend_data::window.

Referenced by add_description(), and add_extended_description().

static const char* get_icon_path ( struct question *  question  )  [static]

Get the full path to an icon associated to a question type.

Parameters:
question the question
Returns:
a statically allocated path to an icon or NULL if no icon is associated with the question

Definition at line 70 of file descriptions.c.

References icon_mapping.

Referenced by add_icon().


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