1
/* functions related to selecting time zones */
3
#ifndef GWORLDCLOCK_ZONES
4
#define GWORLDCLOCK_ZONES
8
static const gchar *ZONE_TABLE="/usr/share/zoneinfo/zone.tab";
9
static const gchar *COUNTRY_TABLE="/usr/share/zoneinfo/iso3166.tab";
11
static const gchar *continents[] =
23
/* Keep this number up to date with the number of continents in the
24
array above. Not that the number of continents on Earth is going
25
to change, but you know. */
27
static const gint Ncontinents = 10;
30
typedef struct NameCodeType {
32
gchar *code; /* actually only 2 characters needed, but 3 would be better */
35
typedef struct AddZoneStruct
38
GtkWidget *countryCList;
39
GtkWidget *regionCList;
40
GtkWidget *DescriptionEntry;
48
void DeleteZone( gpointer clocklist );
50
/* Save list of time zones to configfile */
51
gint SaveZones(gpointer clocklist);
53
/* Handle "rows_reordered" signal, indicating the rows in the clock have been
55
/* Note this callback function does not get called for some reason,
56
I don't know why. A bug in GTK+ ?
57
You will have to save the reordered list by hand for the time being.
59
void registerReorderedRows( GtkTreeModel* clocklistModel,
65
gint CodeInList(gchar *code, GSList *List);
67
GSList* AddNameCodeEntry(gchar *code, gchar *name, GSList *List);
69
void ClearNameCodeList(GSList **List);
71
/* for given continent, find corresponding countries as identified in ZONE_TABLE
72
and prepare list of country name using COUNTRY_TABLE
74
GSList* FetchCountries(gchar *continent);
76
/* from given country code ("*country"), find list of regions in ZONE_TABLE */
77
/* input: country is the two-letter country code from ISO3166 */
78
GSList* FetchRegions(gchar *country);
80
void UpdateCountries(GtkWidget *ContinentCList,
83
GdkEventButton *event,
86
/* Why does the scroll box get larger when you keep selecting a country?? */
87
void UpdateRegions(GtkWidget *CountryCList,
90
GdkEventButton *event,
93
void SelectRegion(GtkWidget *RegionCList,
96
GdkEventButton *event,
99
/* when left mouse button is double-clicked,
100
send "key-pressed-event" to one of the Entry boxes
101
which will be handled by adding the given zone.
102
We're assuming here that "select-row" preceded the double-click event */
103
gint ButtonPressedInRegionList(GtkWidget *regionlist,
104
GdkEventButton *event, gpointer ZoneData);
106
/* zones are selected according to the method used in tzselect:
107
First the continent is chosen, then, if necessary, the country is chosen,
108
with countries being identified from the two-letter code in the
109
entries of [/usr/share/zoneinfo/]zone.tab (and country names taken from
110
iso3166.tab) Then the region (or city) of that country is identified, from
113
void PrepareZoneNotes(GtkWidget **ZoneNotes, AddZoneStruct *Zone);
115
void AddZoneToList(GtkWidget *w, gpointer NewZone);
117
void AddZone( gpointer clocklist );
119
void WriteZoneDescription(GtkDialog *dialog, gint responseId, gpointer Zone);
121
void ChangeZoneDescription(gpointer clocklist);