settings_style.h File Reference

#include <gtk/gtk.h>
Include dependency graph for settings_style.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define SETTINGSMODEL_COLUMN_TYPES

Enumerations

enum  settingsmodel_column_t { MODCOL_TITLE = 0, MODCOL_SUBTITLE, MODCOL_THUMBNAIL, N_SETTINGSMODEL_COLUMNS }

Functions

GtkWidget * create_settingsview (void)
GtkWidget * create_settingsview_for_type (SettingType setting)
void update_settings_exit_text (gchar *title, gchar *subtitle)
GtkTreeModel * get_settingsmodel (void)
void create_title (GtkVBox *parent, gchar *title, gchar *subtitle)
void create_title_keep_labels (GtkVBox *parent, gchar *title, gchar *subtitle, GtkWidget **title_label, GtkWidget **subtitle_label)
GtkVBox * create_frame (GtkVBox *vbox)
GtkWidget * subject_create ()
GtkWidget * description_create ()

Define Documentation

#define SETTINGSMODEL_COLUMN_TYPES
Value:
G_TYPE_STRING,      /* MODCOL_TITLE     */  \
            G_TYPE_STRING,      /* MODCOL_SUBTITLE  */  \
            GDK_TYPE_PIXBUF,    /* MODCOL_THUMBNAIL        */  \
            NULL

Definition at line 43 of file settings_style.h.

Referenced by get_settingsmodel().


Enumeration Type Documentation

Copyright (C) 2008 iRex Technologies B.V. All rights reserved.

Enumerator:
MODCOL_TITLE 
MODCOL_SUBTITLE 
MODCOL_THUMBNAIL 
N_SETTINGSMODEL_COLUMNS 

Definition at line 35 of file settings_style.h.


Function Documentation

GtkVBox* create_frame ( GtkVBox *  vbox  ) 

Definition at line 100 of file settings_style.c.

References SMALL_SPACING, WINDOW_BOTTOM_PADDING, WINDOW_H_PADDING, and WINDOW_TOP_ALT_PADDING.

Referenced by create_advanced_window(), create_continue_widget(), create_continue_widgets(), create_date_widget(), create_language_widgets(), create_power_window(), create_reset_window(), create_sensors_window(), create_time_widget(), and create_timezone_widget().

00101 {
00102     // Add an alignment below the exit bar
00103     GtkWidget* alignment = gtk_alignment_new(0, 0, 1.0, 0.0);
00104     gtk_box_pack_start(GTK_BOX(vbox), alignment, FALSE, FALSE, 0);
00105 
00106     // introdude a frame in the alignment
00107     GtkWidget* frame = gtk_frame_new(NULL);
00108     gtk_widget_set_name(frame, "irex-margins-frame");
00109     gtk_container_add(GTK_CONTAINER(alignment), frame);
00110     gtk_container_set_border_width(GTK_CONTAINER(frame), 3);
00111 
00112     // alignment in frame 
00113     GtkWidget* alignment2 = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
00114     gtk_container_add(GTK_CONTAINER(frame), alignment2);
00115     gtk_alignment_set_padding(GTK_ALIGNMENT(alignment2),
00116                               WINDOW_TOP_ALT_PADDING,
00117                               WINDOW_BOTTOM_PADDING,
00118                               WINDOW_H_PADDING,
00119                               WINDOW_H_PADDING);
00120    
00121     // vbox in alignment2
00122     GtkWidget* innervbox = gtk_vbox_new(FALSE, SMALL_SPACING);
00123     gtk_container_add(GTK_CONTAINER(alignment2), innervbox);
00124 
00125     return GTK_VBOX(innervbox);
00126 }

Here is the caller graph for this function:

GtkWidget* create_settingsview ( void   ) 

Definition at line 206 of file settings_style.c.

References add_settings_exit_item(), ergtk_cell_renderer_border_new(), ergtk_cell_renderer_text_new(), ERGTK_LIST_VIEW, ergtk_list_view_append_column(), ergtk_list_view_new_with_model(), ergtk_list_view_set_focus_mode(), get_settingsmodel(), MODCOL_SUBTITLE, MODCOL_THUMBNAIL, and MODCOL_TITLE.

Referenced by create_account_window(), create_advanced_window(), create_flightmode_window(), create_flipbar_window(), create_margins_window(), create_power_window(), create_reset_window(), create_rotation_window(), create_sdcapacity_window(), create_sensors_window(), create_settingsview_for_type(), and create_stylus_window().

00207 {
00208     GtkWidget *view = ergtk_list_view_new_with_model( get_settingsmodel() );
00209 
00210 
00211     gtk_widget_set_name(view, "contentview-irex-settings");
00212     GtkTreeView *treeview = GTK_TREE_VIEW(view);
00213     erGtkListView *er_listview = ERGTK_LIST_VIEW(view);
00214     gtk_tree_view_set_headers_visible(treeview, FALSE);
00215     ergtk_list_view_set_focus_mode(er_listview, TRUE, TRUE);
00216     GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview);
00217     gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
00218 
00219     // icon column
00220     GtkCellRenderer *renderer = gtk_cell_renderer_pixbuf_new();
00221     g_object_set( G_OBJECT(renderer),
00222                   "xpad",   10,
00223                   "ypad",   0,
00224                   "xalign", 0.5,
00225                   "yalign", 0.5,
00226                   NULL );
00227     GtkTreeViewColumn *column = gtk_tree_view_column_new_with_attributes( NULL,
00228                                                        renderer,
00229                                                        "pixbuf", MODCOL_THUMBNAIL,
00230                                                        NULL );
00231     g_object_set( G_OBJECT(column),
00232                   "sizing", GTK_TREE_VIEW_COLUMN_AUTOSIZE,
00233                   "expand", FALSE,
00234                   NULL );
00235     ergtk_list_view_append_column(er_listview, column);
00236 
00237     // title + author column
00238     renderer = ergtk_cell_renderer_text_new(2);
00239     g_object_set( G_OBJECT(renderer),
00240                   "xpad",          0,
00241                   "ypad",          0,
00242                   "xalign",        0.0, // left
00243                   "yalign",        1.0, // bottom
00244                   "ellipsize",     PANGO_ELLIPSIZE_END,
00245                   "ellipsize-set", TRUE,
00246                   "font-0",        "Normal 10",
00247                   "font-1",        "Normal italic 9",
00248                   "height-0",      32,
00249                   "height-1",      22,
00250                   "foreground-0",  "black",
00251                   "foreground-1",  "#555555",
00252                   NULL );
00253     column = gtk_tree_view_column_new_with_attributes( "",
00254                                                        renderer,
00255                                                        "text-0", MODCOL_TITLE,
00256                                                        "text-1", MODCOL_SUBTITLE,
00257                                                        NULL );
00258     g_object_set( G_OBJECT(column),
00259                   "sizing", GTK_TREE_VIEW_COLUMN_AUTOSIZE,
00260                   "expand", TRUE,
00261                   NULL );
00262     ergtk_list_view_append_column(er_listview, column);
00263 
00264     // border column (invisible)
00265     // Note: add this to the GtkTreeView to avoid separator column from erGtkListView
00266     renderer = ergtk_cell_renderer_border_new();
00267     g_object_set( G_OBJECT(renderer),
00268                   "xpad",          0,
00269                   "ypad",          0,
00270                   "xalign",        0.0,
00271                   "yalign",        0.5,
00272                   "border-width",  2,
00273                   "border-offset", 3,
00274                   "border-color",  "dark grey",
00275                   NULL );
00276     column = gtk_tree_view_column_new_with_attributes( "",
00277                                                        renderer,
00278                                                        NULL );
00279     g_object_set( G_OBJECT(column),
00280                   "sizing", GTK_TREE_VIEW_COLUMN_AUTOSIZE,
00281                   "expand", FALSE,
00282                   NULL );
00283     ergtk_list_view_append_column(er_listview, column);
00284 
00285 
00286     add_settings_exit_item();
00287     
00288     return view;
00289 }

Here is the call graph for this function:

Here is the caller graph for this function:

GtkWidget* create_settingsview_for_type ( SettingType  setting  ) 

Definition at line 291 of file settings_style.c.

References create_settingsview(), on_focus_in(), on_focus_out(), on_listview_navigate_cursor(), and on_listview_row_activated().

Referenced by create_datetime_window(), create_device_info_window(), and create_language_window().

00292 {
00293     GtkWidget* view = create_settingsview();
00294     g_signal_connect(view, "focus-in-event", G_CALLBACK(on_focus_in), NULL );
00295     g_signal_connect(view, "focus-out-event", G_CALLBACK(on_focus_out), NULL );
00296     // setting type determines required interface call
00297     g_signal_connect(view, "row-activated", G_CALLBACK(on_listview_row_activated), (gpointer) setting ) ;
00298     g_signal_connect(view, "navigate-cursor", G_CALLBACK(on_listview_navigate_cursor), (gpointer) setting ) ;
00299 
00300     return view;
00301 }

Here is the call graph for this function:

Here is the caller graph for this function:

void create_title ( GtkVBox *  parent,
gchar *  title,
gchar *  subtitle 
)
void create_title_keep_labels ( GtkVBox *  parent,
gchar *  title,
gchar *  subtitle,
GtkWidget **  title_label,
GtkWidget **  subtitle_label 
)

Definition at line 133 of file settings_style.c.

References SETTINGS_STYLE_TITLE_HEIGHT, SETTINGS_STYLE_TITLE_SPACING, SETTINGS_STYLE_TITLE_V_PADDING, and widget.

Referenced by create_language_window(), and create_title().

00134 {
00135     GtkWidget* widget = gtk_hbox_new(FALSE, SETTINGS_STYLE_TITLE_SPACING);
00136     gtk_box_pack_start(GTK_BOX(parent), widget, FALSE, FALSE, SETTINGS_STYLE_TITLE_V_PADDING);
00137     gtk_widget_set_size_request(widget, -1, SETTINGS_STYLE_TITLE_HEIGHT);
00138     GtkBox *titlehbox = GTK_BOX(widget);
00139 
00140     GtkWidget* label1 = gtk_label_new(title);
00141     gtk_label_set_ellipsize(GTK_LABEL(label1), PANGO_ELLIPSIZE_NONE);
00142     gtk_widget_set_name(label1, "irex-settings-title");
00143     gtk_box_pack_start(titlehbox, label1, FALSE, FALSE, 0);
00144     gtk_widget_show(label1);
00145 
00146     GtkWidget* label2 = gtk_label_new("-");
00147     gtk_label_set_ellipsize(GTK_LABEL(label2), PANGO_ELLIPSIZE_NONE);
00148     gtk_widget_set_name(label2, "irex-settings-title");
00149     gtk_box_pack_start(titlehbox, label2, FALSE, FALSE, 0);
00150     gtk_widget_show(label2);
00151     
00152     GtkWidget* label3 = gtk_label_new(subtitle);
00153     gtk_label_set_ellipsize(GTK_LABEL(label3), PANGO_ELLIPSIZE_NONE);
00154     gtk_widget_set_name(label3, "irex-settings-subtitle");
00155     gtk_box_pack_start(titlehbox, label3, FALSE, FALSE, 0);
00156     gtk_widget_show(label3);
00157     gtk_widget_show(GTK_WIDGET(titlehbox));
00158 
00159     if ( title_label != NULL )
00160     {
00161         *title_label = label1;
00162     }
00163     if (subtitle_label != NULL )
00164     {
00165         *subtitle_label = label3;
00166     }
00167 }

Here is the caller graph for this function:

GtkWidget* description_create (  ) 

Definition at line 337 of file settings_style.c.

References grey, label, and label_on_size_allocate().

Referenced by create_auto_shutdown_widgets(), create_continue_widget(), create_continue_widgets(), create_date_widget(), create_descriptive_text_widgets(), create_format_widgets(), create_light_widgets(), create_lock_widgets(), create_radio_button_icon_item(), create_reset_widgets(), create_scribble_widgets(), create_sd_card_widgets(), create_sound_widgets(), create_stylus_widgets(), create_thumbnail_widgets(), create_time_widget(), create_timezone_widget(), and create_zooming_widgets().

00338 {
00339     GtkWidget* label = gtk_label_new(NULL);
00340     gtk_label_set_single_line_mode(GTK_LABEL(label), FALSE);
00341     gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);  
00342     gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_NONE);
00343     gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
00344     gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &grey); 
00345     gtk_widget_modify_font (label, pango_font_description_from_string ("Normal italic 9"));
00346     g_signal_connect( G_OBJECT(label), "size-allocate", G_CALLBACK(label_on_size_allocate), NULL);
00347     gtk_widget_set_size_request(label, -1, -1);
00348     return label;
00349 }

Here is the call graph for this function:

Here is the caller graph for this function:

GtkTreeModel* get_settingsmodel ( void   ) 

Definition at line 316 of file settings_style.c.

References g_settings_filestore, N_SETTINGSMODEL_COLUMNS, and SETTINGSMODEL_COLUMN_TYPES.

Referenced by create_settingsview().

00317 {   
00318     static GtkTreeModel *settingsmodel = NULL;
00319 
00320     if (g_settings_filestore == NULL)
00321     {   
00322         g_settings_filestore = gtk_list_store_new( N_SETTINGSMODEL_COLUMNS, SETTINGSMODEL_COLUMN_TYPES);
00323         settingsmodel = GTK_TREE_MODEL(g_settings_filestore);
00324     }
00325 
00326     return settingsmodel;
00327 }

Here is the caller graph for this function:

GtkWidget* subject_create (  ) 

Definition at line 329 of file settings_style.c.

References label.

Referenced by create_auto_shutdown_widgets(), create_continue_widgets(), create_date_widget(), create_descriptive_text_widgets(), create_format_widgets(), create_light_widgets(), create_lock_widgets(), create_radio_button_icon_item(), create_reset_widgets(), create_scribble_widgets(), create_sd_card_widgets(), create_sound_widgets(), create_stylus_widgets(), create_thumbnail_widgets(), create_time_widget(), create_timezone_widget(), and create_zooming_widgets().

00330 {
00331     GtkWidget* label = gtk_label_new(NULL);
00332     gtk_widget_set_name(label, "irex-normal-text");
00333     gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
00334     return label;
00335 }

Here is the caller graph for this function:

void update_settings_exit_text ( gchar *  title,
gchar *  subtitle 
)

Definition at line 303 of file settings_style.c.

References g_settings_filestore, MODCOL_SUBTITLE, and MODCOL_TITLE.

Referenced by update_labels_and_buttons().

00304 {
00305     GtkTreeIter iter;
00306 
00307     if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_settings_filestore), &iter))
00308     {
00309         gtk_list_store_set(g_settings_filestore,   &iter, 
00310                 MODCOL_TITLE,           title,
00311                 MODCOL_SUBTITLE,     subtitle,
00312                 -1 );
00313     }
00314 }

Here is the caller graph for this function:

Generated by  doxygen 1.6.2-20100208