libyui-gtk  2.49.0
ygtktimezonepicker.h
1 /********************************************************************
2  * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
3  ********************************************************************/
4 
5 /* YGtkTimeZonePicker provides an input for selecting a time zone
6  by clicking on a world map.
7  Based on yast-qt version.
8 */
9 
10 #ifndef YGTK_TIME_ZONE_PICKER_H
11 #define YGTK_TIME_ZONE_PICKER_H
12 
13 #include <gtk/gtk.h>
14 #include <gdk/gdk.h>
15 G_BEGIN_DECLS
16 
17 #define YGTK_TYPE_TIME_ZONE_PICKER (ygtk_time_zone_picker_get_type ())
18 #define YGTK_TIME_ZONE_PICKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
19  YGTK_TYPE_TIME_ZONE_PICKER, YGtkTimeZonePicker))
20 #define YGTK_TIME_ZONE_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
21  YGTK_TYPE_TIME_ZONE_PICKER, YGtkTimeZonePickerClass))
22 #define YGTK_IS_TIME_ZONE_PICKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
23  YGTK_TYPE_TIME_ZONE_PICKER))
24 #define YGTK_IS_TIME_ZONE_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
25  YGTK_TYPE_TIME_ZONE_PICKER))
26 #define YGTK_TIME_ZONE_PICKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
27  YGTK_TYPE_TIME_ZONE_PICKER, YGtkTimeZonePickerClass))
28 
32 
33 // converts time zone code to human-readable name
34 typedef const gchar *(*TimeZoneToName) (const gchar *code, gpointer data);
35 
37 {
38  GtkWidget parent;
39 
40  // private:
41  GdkPixbuf *map_pixbuf;
42  gint map_width, map_height;
43  gint map_x, map_y; // the center of the focus in pixbuf-metrics
44  GdkWindow *map_window;
45  gdouble scale; // map-to-window scale
46  guint closeup : 2;
47 
48  GList *locations;
49  YGtkTimeZoneLocation *selected_loc, *hover_loc;
50 
51  gint last_mouse_x, last_mouse_y;
52 };
53 
55 {
56  GtkWidgetClass parent_class;
57 
58  // signals:
59  void (*zone_clicked) (YGtkTimeZonePicker *picker, const gchar *zone);
60 };
61 
63 {
64  gchar *country, *zone, *comment, *tooltip;
65  gdouble latitude, longitude;
66  gint x, y;
67 };
68 
69 GType ygtk_time_zone_picker_get_type (void) G_GNUC_CONST;
70 
71 void ygtk_time_zone_picker_set_map (YGtkTimeZonePicker *picker, const char *filename,
72  TimeZoneToName converter, gpointer converter_user_data);
73 
74 const gchar *ygtk_time_zone_picker_get_current_zone (YGtkTimeZonePicker *picker);
75 void ygtk_time_zone_picker_set_current_zone (YGtkTimeZonePicker *picker, const gchar *zone,
76  gboolean zoom);
77 
78 G_END_DECLS
79 #endif /* YGTK_TIME_ZONE_PICKER_H */
80