#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <glib.h>
Go to the source code of this file.
Enumerations | |
enum | connectScreen_t { connectScreenOptions_e = 0, connectScreenProfiles_e, connectScreenUndef_e } |
Functions | |
GtkWidget * | connect_screen_create (void) |
void | connect_screen_set_text (void) |
void | connect_screen_display (void) |
void | connect_set_toolbar (void) |
void | connect_set_pagebar (void) |
void | connect_goto_page (connectScreen_t newpage) |
gint | connect_get_current_page (gint *pagecount) |
gboolean | on_connect_keypress (GdkEventKey *event) |
void | on_connect_goto_page (gint newpage) |
void | on_connect_icon_clicked (int iconID, int iconState) |
Copyright (C) 2007 iRex Technologies BV.
Definition in file connectScreen.h.
enum connectScreen_t |
Definition at line 37 of file connectScreen.h.
00038 { 00039 connectScreenOptions_e=0, 00040 connectScreenProfiles_e, 00041 connectScreenUndef_e 00042 } connectScreen_t;
gint connect_get_current_page | ( | gint * | pagecount | ) |
Definition at line 214 of file connectScreen.c.
00215 { 00216 GtkNotebook *notebook = GTK_NOTEBOOK(g_connect_notebook); 00217 00218 // get number of pages, when requested. 00219 if (pagecount != NULL) 00220 { 00221 *pagecount = gtk_notebook_get_n_pages(notebook); 00222 } 00223 00224 // return current page number, counting from 0. 00225 return gtk_notebook_get_current_page(notebook); 00226 }
void connect_goto_page | ( | connectScreen_t | newpage | ) |
Definition at line 252 of file connectScreen.c.
00253 { 00254 GtkNotebook *notebook; 00255 gint curpage, pagecount; 00256 00257 curpage = connect_get_current_page(&pagecount); 00258 if (curpage != newpage) 00259 { 00260 if (newpage >= 0 && newpage < pagecount) 00261 { 00262 CN_LOGPRINTF ("curpage %d-->newpage %d, pagecount %d", 00263 curpage, newpage, pagecount); 00264 notebook = GTK_NOTEBOOK(g_connect_notebook); 00265 gtk_notebook_set_current_page(notebook, newpage); 00266 } 00267 } 00268 }
GtkWidget* connect_screen_create | ( | void | ) |
Definition at line 74 of file connectScreen.c.
00075 { 00076 CN_LOGPRINTF ("entry"); 00077 00078 GtkWidget *alignment; 00079 GtkWidget *page; 00080 00081 // alignment 00082 alignment = gtk_alignment_new (0.0, 0.0, 0.0, 0.0); 00083 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 00084 0, 0, SCREEN_BORDER, 0); 00085 gtk_widget_show(alignment); 00086 00087 // connect_notebook 00088 g_connect_notebook = gtk_notebook_new (); 00089 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (g_connect_notebook), FALSE); 00090 gtk_notebook_set_show_border (GTK_NOTEBOOK (g_connect_notebook), FALSE); 00091 gtk_container_add (GTK_CONTAINER (alignment), g_connect_notebook); 00092 00093 // page: connect-screen-options 00094 page = connect_options_create (); 00095 gtk_notebook_append_page(GTK_NOTEBOOK (g_connect_notebook), page, NULL); 00096 00097 // page: connect-screen profiles 00098 page = connect_profiles_create (); 00099 gtk_notebook_append_page(GTK_NOTEBOOK(g_connect_notebook), page, NULL); 00100 00101 // notebook pages start counting from zero 00102 gtk_notebook_set_current_page (GTK_NOTEBOOK(g_connect_notebook), 0); 00103 gtk_widget_show (g_connect_notebook); 00104 00105 g_signal_connect_after(g_connect_notebook, "switch-page", 00106 G_CALLBACK (on_connect_switch_page), NULL); 00107 00108 return alignment; 00109 }
void connect_screen_display | ( | void | ) |
Definition at line 111 of file connectScreen.c.
00112 { 00113 int page; 00114 00115 CN_LOGPRINTF ("entry"); 00116 00117 page = connect_get_current_page(NULL); 00118 if (page == connectScreenOptions_e) 00119 { 00120 connect_options_display(); 00121 } 00122 else if (page == connectScreenProfiles_e) 00123 { 00124 connect_profiles_display(); 00125 } 00126 }
void connect_screen_set_text | ( | void | ) |
Definition at line 129 of file connectScreen.c.
00130 { 00131 CN_LOGPRINTF ("entry"); 00132 00133 connect_options_set_text(); 00134 connect_profiles_set_text(); 00135 }
void connect_set_pagebar | ( | void | ) |
Definition at line 138 of file connectScreen.c.
00139 { 00140 CN_LOGPRINTF ("entry"); 00141 00142 //gint current_page; 00143 //gint page_num; 00144 00145 if (!main_get_background ()) 00146 { 00147 // a little overkill, 00148 // but this ensures the pageBar always has the correct currentApp 00149 pagebar_reset (); 00150 00151 // For connect screen only show one page. 00152 // This forces the user to navigate using the on-screen items 00153 pagebar_set_pagecount( 1 ); 00154 pagebar_goto_page( 1 ); 00155 pagebar_redraw(); 00156 } 00157 }
void connect_set_toolbar | ( | void | ) |
Definition at line 159 of file connectScreen.c.
00160 { 00161 CN_LOGPRINTF("entry"); 00162 00163 connect_show_back(); 00164 connect_show_keyboard(); 00165 connect_show_trashcan(); 00166 }
void on_connect_goto_page | ( | gint | newpage | ) |
Definition at line 270 of file connectScreen.c.
00271 { 00272 CN_LOGPRINTF("entry newpage[%d]", newpage); 00273 connect_goto_page(newpage - 1); 00274 }
void on_connect_icon_clicked | ( | int | iconID, | |
int | iconState | |||
) |
Definition at line 276 of file connectScreen.c.
00277 { 00278 int page; 00279 00280 CN_LOGPRINTF("entry iconID[%d] iconState[%d]", iconID, iconState); 00281 00282 switch (iconID) 00283 { 00284 case iconID_back: 00285 page = connect_get_current_page(NULL); 00286 if (page == connectScreenProfiles_e) 00287 { 00288 on_connect_profiles_icon_clicked(iconID, iconState); 00289 } 00290 break; 00291 default: 00292 break; 00293 } 00294 }
gboolean on_connect_keypress | ( | GdkEventKey * | event | ) |
Definition at line 229 of file connectScreen.c.
00230 { 00231 guint ret = 0; // return FALSE => default gtk handling 00232 00233 CN_LOGPRINTF ("entry"); 00234 00235 switch (connect_get_current_page(NULL)) 00236 { 00237 case connectScreenOptions_e: 00238 ret = on_connect_options_keypress(event); 00239 break; 00240 case connectScreenProfiles_e: 00241 ret = on_connect_profiles_keypress(event); 00242 break; 00243 default: 00244 CN_ERRORPRINTF ("-- case default"); 00245 erbusy_off (); 00246 break; 00247 } 00248 00249 return ret; 00250 }