rotation.h File Reference

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

Go to the source code of this file.

Functions

GtkWidget * create_rotation_window (GtkWidget *parent)
void load_rotation_settings ()
void save_rotation_settings ()

Function Documentation

GtkWidget* create_rotation_window ( GtkWidget *  parent  ) 

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

Definition at line 105 of file rotation.c.

References create_rotation_settings_widgets(), create_settingsview(), create_title(), init_widgets_with_settings(), LOGPRINTF, on_focus_in(), on_focus_out(), on_listview_navigate_cursor(), on_listview_row_activated(), SMALL_SPACING, WINDOW_BORDER_PADDING, WINDOW_BOTTOM_PADDING, WINDOW_H_PADDING, and WINDOW_TOP_ALT_PADDING.

Referenced by create_concrete_win().

00106 {
00107     LOGPRINTF(" create_rotation_window \n");
00108 
00109     // create top window
00110     GtkWidget* top_window = parent;
00111     gtk_window_maximize(GTK_WINDOW(top_window));
00112     gtk_window_set_resizable(GTK_WINDOW(top_window), FALSE);
00113     gtk_container_set_border_width(GTK_CONTAINER(top_window), WINDOW_BORDER_PADDING );
00114     gtk_window_set_modal(GTK_WINDOW(top_window), TRUE);
00115 
00116     // top level vbox (vboxtop)
00117     GtkWidget* vboxtop = gtk_vbox_new(FALSE, 3);
00118     gtk_container_add(GTK_CONTAINER(top_window), vboxtop);
00119 
00120     // add header container the title and subtitle of this settings page
00121     create_title(GTK_VBOX(vboxtop), _("Settings"), _("Rotation Direction"));
00122     
00123     // add the back/exit bar below the title 
00124     GtkWidget* view = create_settingsview();
00125     gtk_box_pack_start(GTK_BOX(vboxtop), view, FALSE, FALSE,0 ); 
00126     g_signal_connect(view, "row-activated", G_CALLBACK(on_listview_row_activated), NULL ) ;
00127     g_signal_connect(view, "navigate-cursor", G_CALLBACK(on_listview_navigate_cursor), NULL ) ;
00128     g_signal_connect(view, "focus-in-event", G_CALLBACK(on_focus_in), NULL );
00129     g_signal_connect(view, "focus-out-event", G_CALLBACK(on_focus_out), NULL );
00130 
00131     // add an alignment below the exit bar
00132     GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 0.0);
00133     gtk_container_add(GTK_CONTAINER(vboxtop), alignment);
00134 
00135     // introdude a frame in the alignment
00136     GtkWidget* frame = gtk_frame_new(NULL);
00137     gtk_widget_set_name(frame, "irex-margins-frame");
00138     gtk_container_add(GTK_CONTAINER(alignment), frame);
00139     gtk_container_set_border_width(GTK_CONTAINER(frame), 3);
00140 
00141     // alignment in frame 
00142     GtkWidget* alignment2 = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
00143     gtk_container_add(GTK_CONTAINER(frame), alignment2);
00144     gtk_alignment_set_padding(GTK_ALIGNMENT(alignment2),
00145                               WINDOW_TOP_ALT_PADDING,
00146                               WINDOW_BOTTOM_PADDING,
00147                               WINDOW_H_PADDING,
00148                               WINDOW_H_PADDING);
00149    
00150     // vbox in alignment2
00151     GtkWidget* innervbox = gtk_vbox_new(FALSE, SMALL_SPACING);
00152     gtk_container_add(GTK_CONTAINER(alignment2), innervbox);
00153     
00154     // The margin settings section.
00155     create_rotation_settings_widgets(GTK_BOX(innervbox));
00156 
00157     // Update widget with current settings.
00158     init_widgets_with_settings();
00159 
00160     gtk_widget_grab_focus(view);
00161 
00162     gtk_widget_show_all(top_window);
00163     return top_window;
00164 }

Here is the call graph for this function:

Here is the caller graph for this function:

void load_rotation_settings (  ) 

Definition at line 233 of file rotation.c.

References g_cur_rotation_settings, g_orig_rotation_settings, GCONF_ROTATION_DIRECTION, get_value_string(), LOGPRINTF, rotation, Rotation_Anti_Clockwise, and Rotation_Clockwise.

Referenced by create_concrete_win().

00234 {
00235     LOGPRINTF(" load_rotation_settings "); 
00236     const char* rotation          = NULL;
00237     
00238     // Get rotation direction.
00239     rotation = get_value_string(GCONF_ROTATION_DIRECTION);
00240     if (strcmp(rotation, "clockwise") == 0)
00241     {
00242         g_orig_rotation_settings = Rotation_Clockwise;
00243     }
00244     else
00245     {
00246         g_orig_rotation_settings = Rotation_Anti_Clockwise;
00247     }
00248     
00249     g_cur_rotation_settings = g_orig_rotation_settings;
00250 }

Here is the call graph for this function:

Here is the caller graph for this function:

void save_rotation_settings (  ) 

Definition at line 253 of file rotation.c.

References g_cur_rotation_settings, g_orig_rotation_settings, GCONF_ROTATION_DIRECTION, LOGPRINTF, Rotation_Clockwise, and set_value_string().

Referenced by on_listview_row_activated().

00254 {
00255     LOGPRINTF(" save_rotation_settings ");  
00256     // Set rotation direction if necessary.
00257     if (g_cur_rotation_settings != g_orig_rotation_settings)
00258     {
00259         set_value_string(GCONF_ROTATION_DIRECTION,
00260             (g_cur_rotation_settings == Rotation_Clockwise) ? "clockwise" : "anticlockwise");
00261     }
00262 
00263     LOGPRINTF("Saving rotation settings, done.");
00264 }

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  doxygen 1.6.2-20100208