settings/src/settings.h File Reference

setup application - E-reader settings application screen creation and handling More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  SettingsScreen_t {
  iLiad_startup_screen_t = 0, iLiad_config_screen_t, iLiad_archive_location_screen_t, iLiad_user_screen_t,
  iLiad_pincode_screen_t, iLiad_pc_connect_screen_t, iLiad_autoconnect_screen_t, iLiad_timedids_screen_t,
  iLiad_datetime_screen_t, iLiad_device_overview_screen_t, iLiad_undefined_screen_t
}

Functions

void prepare_registry_write (void)
void do_registry_write (void)
GtkWidget * settings_create (void)
gint settings_get_current_page (gint *pagecount)
void settings_page_down (gint count)
void settings_page_up (gint count)
gboolean on_settings_keypress (GtkWidget *widget, GdkEventKey *event, gpointer data)
gboolean setupInstallIpcServer ()
void show_keyboard (gboolean show)
void show_lock_screen_icon (gboolean enable)


Detailed Description

setup application - E-reader settings application screen creation and handling

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

<File description>="">

Definition in file settings.h.


Enumeration Type Documentation

Enumerator:
iLiad_startup_screen_t 
iLiad_config_screen_t 
iLiad_archive_location_screen_t 
iLiad_user_screen_t 
iLiad_pincode_screen_t 
iLiad_pc_connect_screen_t 
iLiad_autoconnect_screen_t 
iLiad_timedids_screen_t 
iLiad_datetime_screen_t 
iLiad_device_overview_screen_t 
iLiad_undefined_screen_t 

Definition at line 35 of file settings.h.


Function Documentation

void do_registry_write ( void   ) 

Definition at line 200 of file main.c.

00201 {
00202     gboolean       b;
00203     
00204     // verify write lock
00205     g_assert(lock_write == erRegGetLockState());
00206     
00207     // save registry
00208     b = erRegStore();
00209     if (b == FALSE)
00210     {
00211         ST_ERRORPRINTF("erRegStore fails with return code [%d]", b);
00212     }
00213 
00214     // release lock
00215     erRegUnlock();
00216 }

Here is the call graph for this function:

gboolean on_settings_keypress ( GtkWidget *  widget,
GdkEventKey *  event,
gpointer  data 
)

Definition at line 218 of file settings.c.

00219 {
00220     gboolean returnValue = FALSE;    // return FALSE => default gtk handling
00221     gboolean changed = FALSE;
00222 
00223     ST_LOGPRINTF("entry");
00224     erbusy_off();
00225 
00226     changed = iLiad_config_data_change_flipbar_direction();
00227     
00228     switch (event->keyval)
00229     {
00230         case GDK_Page_Down:
00231             if (changed)
00232                 settings_page_up(1);
00233             else
00234                 settings_page_down(1);
00235             returnValue = TRUE;  // no further event handling
00236             break;
00237 
00238         case GDK_Page_Up:
00239             if (changed)
00240                 settings_page_down(1);
00241             else
00242                 settings_page_up(1);
00243             returnValue = TRUE;  // no further event handling
00244             break;
00245 
00246         case GDK_F1:
00247             if (changed)
00248                 settings_page_up(5);
00249             else
00250                 settings_page_down(5);
00251             returnValue = TRUE;  // no further event handling
00252             break;
00253 
00254         case GDK_F2:
00255             if (changed)
00256                 settings_page_down(5);
00257             else
00258                 settings_page_up(5);
00259             returnValue = TRUE;  // no further event handling
00260             break;
00261 
00262         case GDK_F5:
00263             if (get_xtscal_pid() != 0)
00264             {
00265                 stop_xtscal();
00266             }
00267             else
00268             {
00269                 erbusy_blink();
00270                 gtk_main_quit();
00271                 returnValue = TRUE; // no further event handling
00272             }
00273             break;
00274             
00275         default:
00276             /* ignore */ ;
00277     }
00278 
00279     return returnValue;
00280 }

Here is the call graph for this function:

void prepare_registry_write ( void   ) 

Definition at line 166 of file main.c.

00167 {
00168     gboolean       b;
00169     regLoad_t      regLoad;
00170     
00171     // acquire write lock
00172     b = erRegWriteLock();
00173     if (b == FALSE)
00174     {
00175         ST_ERRORPRINTF("erRegWriteLock fails with return code [%d]", b);
00176         g_assert_not_reached();
00177     }
00178     
00179     // reload section(s) that may be written
00180     erRegUnload(regBasis_t);
00181     regLoad = erRegLoad(regBasis_t);
00182     if (regLoad == loadError_t)
00183     {
00184         ST_ERRORPRINTF("erRegLoad(regBasis_t) fails with return code [%d]", regLoad);
00185         g_assert_not_reached();
00186     }
00187 
00188     erRegUnload(regNWProfiles_t);
00189     regLoad = erRegLoad(regNWProfiles_t);
00190     if (regLoad == loadError_t)
00191     {
00192         ST_ERRORPRINTF("erRegLoad(regNWProfiles_t) fails with return code [%d]", regLoad);
00193         g_assert_not_reached();
00194     }
00195 
00196 
00197 }

Here is the call graph for this function:

GtkWidget* settings_create ( void   ) 

Definition at line 87 of file settings.c.

00088 {
00089     GtkWidget* page;
00090     guint      signal_id;
00091 
00092     ST_LOGPRINTF("entry");
00093 
00094     g_settings = gtk_notebook_new();
00095     gtk_notebook_set_show_tabs(GTK_NOTEBOOK(g_settings), FALSE);
00096     gtk_notebook_set_show_border(GTK_NOTEBOOK(g_settings), FALSE);
00097     g_signal_connect_after(g_settings, "switch-page", G_CALLBACK(on_settings_switch_page), NULL);
00098 
00099     page = iLiad_startup_screen_create();
00100     iLiad_startup_screen_set_text();
00101     iLiad_startup_screen_display_data();
00102     gtk_notebook_append_page(GTK_NOTEBOOK(g_settings), page, NULL);
00103 
00104     page = iLiad_config_create();
00105     iLiad_config_set_text();
00106     iLiad_config_data_display();
00107     gtk_notebook_append_page(GTK_NOTEBOOK(g_settings), page, NULL);
00108 
00109     page = iLiad_archive_location_create();
00110     iLiad_archive_location_set_text();
00111     iLiad_archive_location_display_data();
00112     gtk_notebook_append_page(GTK_NOTEBOOK(g_settings), page, NULL);
00113 
00114     page = iLiad_user_create();
00115     iLiad_user_set_text();
00116     iLiad_user_data_display();
00117     gtk_notebook_append_page(GTK_NOTEBOOK(g_settings), page, NULL);
00118 
00119     page = iLiad_pincode_create();
00120     iLiad_pincode_set_text();
00121     iLiad_pincode_display_data();
00122     gtk_notebook_append_page(GTK_NOTEBOOK(g_settings), page, NULL);
00123 
00124     page = iLiad_pc_connect_screen_create();
00125     iLiad_pc_connect_screen_set_text();
00126     iLiad_pc_connect_screen_display_settings();
00127     gtk_notebook_append_page(GTK_NOTEBOOK(g_settings), page, NULL);
00128 
00129     page = iLiad_autoconnect_create();
00130     iLiad_autoconnect_set_text();
00131     iLiad_autoconnect_data_display();
00132     gtk_notebook_append_page(GTK_NOTEBOOK(g_settings), page, NULL);
00133 
00134     page = iLiad_timedids_screen_create();
00135     iLiad_timedids_screen_set_text();
00136     iLiad_timedids_screen_data_display();
00137     gtk_notebook_append_page(GTK_NOTEBOOK(g_settings), page, NULL);
00138     
00139     page = iLiad_date_time_create();
00140     iLiad_date_time_set_text();
00141     iLiad_date_time_display_data();
00142     gtk_notebook_append_page(GTK_NOTEBOOK(g_settings), page, NULL);
00143                     
00144     page = iLiad_device_overview_create();
00145     iLiad_device_overview_set_text();
00146     iLiad_device_overview_display_data();
00147     gtk_notebook_append_page(GTK_NOTEBOOK(g_settings), page, NULL);
00148 
00149     // install class-specific screen update handlers
00150     //   erGtkEntry
00151     signal_id = g_signal_lookup("screen-refresh", ERGTK_ENTRY_TYPE);
00152     g_assert(signal_id > 0);
00153     g_signal_add_emission_hook(signal_id, 0, hook_screen_refresh_typing, (gpointer)TEXT_ENTRY_CHANGED_LEVEL, NULL);
00154     //   erGtkToggleButton
00155     signal_id = g_signal_lookup("toggled", ERGTK_TOGGLE_BUTTON_TYPE);
00156     g_assert(signal_id > 0);
00157     g_signal_add_emission_hook(signal_id, 0, hook_screen_refresh_typing, (gpointer)SETTING_ITEM_CHANGE, NULL);
00158 
00159     // note book pages start counting from zero
00160     gtk_notebook_set_current_page(GTK_NOTEBOOK(g_settings), 0);
00161     gtk_widget_show(g_settings);
00162 
00163     update_pagebar();
00164 
00165     return g_settings;
00166 }

Here is the call graph for this function:

gint settings_get_current_page ( gint *  pagecount  ) 

Definition at line 169 of file settings.c.

00170 {
00171     // Get number of pages, when requested.
00172     if (pagecount != NULL)
00173     {
00174         *pagecount = gtk_notebook_get_n_pages(GTK_NOTEBOOK(g_settings));
00175     }
00176 
00177     // Return current page number, counting from 0.
00178     return gtk_notebook_get_current_page(GTK_NOTEBOOK(g_settings));
00179 }

void settings_page_down ( gint  count  ) 

Definition at line 183 of file settings.c.

00184 {
00185     gint    page;
00186     gint    pagecount;
00187 
00188     page = settings_get_current_page(&pagecount);
00189     page = page + count;
00190     if (page >= pagecount)
00191     {
00192         page = pagecount - 1; // counts from 0
00193     }
00194 
00195     ST_LOGPRINTF("page %d - pagecount %d", page, pagecount);
00196     on_goto_page(page+1);  // pagebar counts from 1
00197 }

Here is the call graph for this function:

void settings_page_up ( gint  count  ) 

Definition at line 200 of file settings.c.

00201 {
00202     gint    page;
00203 
00204     page = settings_get_current_page(NULL);
00205     if (page > 0)
00206     {
00207         page = page - count;
00208         if (page < 0)
00209         {
00210             page = 0;
00211         }
00212 
00213         ST_LOGPRINTF("page %d", page);
00214         on_goto_page(page+1);  // pagebar counts from 1
00215     }
00216 }

Here is the call graph for this function:

gboolean setupInstallIpcServer (  ) 

Definition at line 407 of file settings.c.

00408 {
00409     int     returnValue;
00410     int     fd = -1;
00411 
00412     ST_IPCPRINTF("entry");
00413 
00414     returnValue = erIpcOpenServerChannel(ER_SETUP_CHANNEL, &theServerChannel);
00415 
00416     if (returnValue != (-1))
00417     {
00418         fd = erIpcGetServerFd(theServerChannel);
00419 
00420         ST_IPCPRINTF("erIpcGetServerFd returned %d\n", fd);
00421 
00422         // gtk specific mechanism to monitor input file descriptor.
00423         returnValue = gdk_input_add(fd, GDK_INPUT_READ, setupMessageReceived, (gpointer) theServerChannel);
00424 
00425         ST_IPCPRINTF("gdk_input_add returned %d", returnValue);
00426         return TRUE;
00427     }
00428     else
00429     {
00430         ST_ERRORPRINTF("Could not open server channel");
00431         return FALSE;
00432     }
00433 }

Here is the call graph for this function:

void show_keyboard ( gboolean  show  ) 

Definition at line 351 of file settings.c.

00352 {
00353     static gboolean show_previous = FALSE;
00354     ST_LOGPRINTF("entry: show [%d]", show);
00355 
00356     if (show)
00357     {
00358         // keyboard requested
00359         settings_show_keyboard();
00360         if (show_previous)
00361         {
00362             display_update_decrease_level(SETUP_SCREEN_EXPOSE_LEVEL);
00363         }
00364     }
00365     else
00366     {
00367         // keyboard not requested
00368         settings_hide_keyboard(iconState_grey);
00369     }
00370     show_previous = show;
00371 }

Here is the call graph for this function:

void show_lock_screen_icon ( gboolean  enable  ) 

Definition at line 373 of file settings.c.

00374 {
00375      if (FALSE == enable)
00376      {
00377          toolbar_setIconState(iconID_lock_screen, iconState_grey);
00378      }
00379      else
00380      {
00381          toolbar_setIconState(iconID_lock_screen, iconState_normal);
00382      }
00383 }

Here is the call graph for this function:


Generated on Sun Dec 14 17:17:31 2008 by  doxygen 1.5.6