00001 /* 00002 * This file is part of settings. 00003 * 00004 * settings is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * settings is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00031 #ifndef __ILIAD_DATETIME_SCREEN_H__ 00032 #define __ILIAD_DATETIME_SCREEN_H__ 00033 00034 #include <gtk/gtk.h> 00035 00036 #ifdef __cplusplus 00037 extern "C" 00038 { 00039 #endif 00040 00041 #define DATETIME_SCREEN_ITEM_SPACING 10 00042 #define DATETIME_DISPLAY_SPACING 25 00043 #define TIMEZONE_BUTTON_ITEM_SPACING 35 00044 #define DATETIME_DISPLAY_HEIGHT 115 00045 #define TIMEZONE_SELECTION_HEIGHT 425 00046 00047 #define DATETIME_SCREEN_ITEM_PADDING_TOP 10 00048 #define DATETIME_SCREEN_ITEM_PADDING_BOTTOM 10 00049 #define DATETIME_SCREEN_ITEM_PADDING_LEFT 13 00050 #define DATETIME_SCREEN_ITEM_PADDING_RIGHT 13 00051 00052 #define TZ_BUTTON_WIDTH 100 00053 #define TZ_BUTTON_HEIGHT 30 00054 00055 #define TOTAL_TIMEZONES 34 00056 #define DATE_STRING_LENGTH 64 00057 00058 #define TZ_SETTING_FILE "/mnt/settings/timezone" 00059 #define TZ_FILES_DIR "/usr/share/zoneinfo/Etc/" 00060 #define TZ_FILE "/etc/localtime" 00061 00062 #define DEFAULT_TIMEZONE_OFFSET 0 00063 #define DEFAULT_TIMEZONE_NAME "GMT+00:00" 00064 00065 typedef struct 00066 { 00067 GtkWidget* top_vbox; 00068 GtkWidget* settingitem; 00069 GtkWidget* timezones; 00070 GtkWidget* label_show_time_prompt; 00071 GtkWidget* label_current_time; 00072 GtkWidget* label_timezone_prompt; 00073 GtkWidget* label_possible_date[2]; 00074 GtkToggleButton* button_timezones[TOTAL_TIMEZONES+1]; 00075 GtkWidget* selection; 00076 GtkWidget* infoitem; 00077 }gtk_datetime_screen; 00078 00079 typedef struct 00080 { 00081 int tzoffset; 00082 char tzname[10]; 00083 }tz_info; 00084 00085 // Header of timezone files, you can find them in /usr/share/zoneinfo 00086 struct tzhead 00087 { 00088 char tzh_magic[4]; /* TZ_MAGIC */ 00089 char tzh_reserved[16]; /* reserved for future use */ 00090 char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */ 00091 char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */ 00092 char tzh_leapcnt[4]; /* coded number of leap seconds */ 00093 char tzh_timecnt[4]; /* coded number of transition times */ 00094 char tzh_typecnt[4]; /* coded number of local time types */ 00095 char tzh_charcnt[4]; /* coded number of abbr. chars */ 00096 }; 00097 00098 // Create the iLiad date time screen 00099 // return the container (eventbox) where the datetime settings items are displayed 00100 GtkWidget *iLiad_date_time_create(); 00101 00102 void iLiad_date_time_set_text(void); 00103 void iLiad_date_time_display_data(void); 00104 void iLiad_date_time_handle_refresh(void); 00105 00106 #ifdef __cplusplus 00107 } 00108 #endif 00109 #endif //__ILIAD_DATETIME_SCREEN_H__
1.5.6