Commit f518c5b7 authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz
Browse files

updated for e-map removal

2008-04-02  Vincent Untz  <vuntz@gnome.org>

	* configure.in: updated for e-map removal

2008-04-02  Vincent Untz  <vuntz@gnome.org>

	* Makefile.am: updated
	* e-map/Makefile.am:
	* e-map/e-map-marshal.list:
	* e-map/e-map.c:
	* e-map/e-map.h:
	* tz-list.c:
	* tz-list.h:
	* tz-sel-dialog.c:
	* tz-sel-dialog.h:
	* tz-window.c:
	* tz-window.h:
	* tz.c:
	* tz.h: Remove all those files that aren't used anymore.

svn path=/trunk/; revision=10975
parent a9110fc9
2008-04-02 Vincent Untz <vuntz@gnome.org>
* configure.in: updated for e-map removal
2008-03-10 Vincent Untz <vuntz@gnome.org>
* configure.in: post-release bump to 2.22.1.
......
2008-04-02 Vincent Untz <vuntz@gnome.org>
* Makefile.am: updated
* e-map/Makefile.am:
* e-map/e-map-marshal.list:
* e-map/e-map.c:
* e-map/e-map.h:
* tz-list.c:
* tz-list.h:
* tz-sel-dialog.c:
* tz-sel-dialog.h:
* tz-window.c:
* tz-window.h:
* tz.c:
* tz.h: Remove all those files that aren't used anymore.
2008-04-02 Vincent Untz <vuntz@gnome.org>
Clean things a bit. It's easier to have one function call instead of
......
SUBDIRS = e-map pixmaps
SUBDIRS = pixmaps
INCLUDES = \
-I$(srcdir)/../../libpanel-applet \
......@@ -45,14 +45,6 @@ endif
CLOCK_SOURCES = \
calendar-window.c \
calendar-window.h \
tz-window.c \
tz-window.h \
tz-sel-dialog.c \
tz-sel-dialog.h \
tz-list.c \
tz-list.h \
tz.c \
tz.h \
obox.c \
obox.h \
clock.c \
......@@ -83,7 +75,6 @@ CLOCK_SOURCES = \
CLOCK_LDADD = \
../../libpanel-applet/libpanel-applet-2.la \
e-map/libemap.a \
$(CLOCK_LIBS) \
$(POLKIT_GNOME_LIBS) \
-lgweather
......
INCLUDES = \
-DMAP_DIR=\""$(datadir)/gnome-panel/pixmaps"\" \
-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
$(DISABLE_DEPRECATED_CFLAGS) \
$(WARN_CFLAGS) \
$(CLOCK_CFLAGS)
EXTRA_DIST= e-map-marshal.list
e-map-marshal.h: e-map-marshal.list
( @GLIB_GENMARSHAL@ $< --header > e-map-marshal.tmp \
&& mv e-map-marshal.tmp e-map-marshal.h ) \
|| ( rm -f e-map-marshal.tmp && exit 1 )
e-map-marshal.c: e-map-marshal.list e-map-marshal.h
( echo "#include \"e-map-marshal.h\"" > e-map-marshal.tmp \
&& @GLIB_GENMARSHAL@ $< --body >> e-map-marshal.tmp \
&& mv e-map-marshal.tmp e-map-marshal.c ) \
|| ( rm -f e-map-marshal.tmp && exit 1 )
$(e_map_la_OBJECTS): e-map-marshal.h
noinst_LIBRARIES = libemap.a
libemap_a_CFLAGS = \
-fPIC \
$(GNOME_CFLAGS) \
$(GDK_PIXBUF_CFLAGS)
BUILT_SOURCES= e-map-marshal.c e-map-marshal.h
libemap_a_SOURCES = \
e-map.c e-map.h \
e-map-marshal.c e-map-marshal.h
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* Map widget.
*
* Copyright (C) 2000-2001 Ximian, Inc.
*
* Authors: Hans Petter Jansson <hpj@ximian.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef E_MAP_H
#define E_MAP_H
#include <gtk/gtkwidget.h>
#define TYPE_E_MAP (e_map_get_type ())
#define E_MAP(obj) (GTK_CHECK_CAST ((obj), TYPE_E_MAP, EMap))
#define E_MAP_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_E_MAP, EMapClass))
#define IS_E_MAP(obj) (GTK_CHECK_TYPE ((obj), TYPE_E_MAP))
#define IS_E_MAP_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_E_MAP))
typedef struct _EMap EMap;
typedef struct _EMapClass EMapClass;
typedef struct _EMapPoint EMapPoint;
struct _EMap
{
GtkWidget widget;
/* Private data */
gpointer priv;
};
struct _EMapClass
{
GtkWidgetClass parent_class;
/* Notification signals */
void (*zoom_fit) (EMap * view);
/* GTK+ scrolling interface */
void (*set_scroll_adjustments) (GtkWidget * widget,
GtkAdjustment * hadj,
GtkAdjustment * vadj);
};
/* The definition of Dot */
struct _EMapPoint
{
gchar *name; /* Can be NULL */
double longitude, latitude;
guint32 rgba;
gpointer user_data;
};
/* --- Widget --- */
GtkType e_map_get_type (void);
EMap *e_map_new (void);
/* Stop doing redraws when map data changes (e.g. by modifying points) */
void e_map_freeze (EMap *map);
/* Do an immediate repaint, and start doing realtime repaints again */
void e_map_thaw (EMap *map);
/* --- Coordinate translation --- */
/* Translates window-relative coords to lat/long */
void e_map_window_to_world (EMap *map,
double win_x, double win_y,
double *world_longitude, double *world_latitude);
/* Translates lat/long to window-relative coordinates. Note that the
* returned coordinates can be negative or greater than the current size
* of the allocation area */
void e_map_world_to_window (EMap *map,
double world_longitude, double world_latitude,
double *win_x, double *win_y);
/* --- Zoom --- */
double e_map_get_magnification (EMap *map);
/* Pass TRUE if we want the smooth zoom hack */
void e_map_set_smooth_zoom (EMap *map, gboolean state);
/* TRUE if smooth zoom hack will be employed */
gboolean e_map_get_smooth_zoom (EMap *map);
/* NB: Function definition will change shortly */
void e_map_zoom_to_location (EMap *map, double longitude, double latitude);
/* Zoom to mag factor 1.0 */
void e_map_zoom_out (EMap *map);
/* --- Points --- */
EMapPoint *e_map_add_point (EMap *map, gchar *name,
double longitude, double latitude,
guint32 color_rgba);
void e_map_remove_point (EMap *map, EMapPoint *point);
void e_map_point_get_location (EMapPoint *point,
double *longitude, double *latitude);
gchar *e_map_point_get_name (EMapPoint *point);
guint32 e_map_point_get_color_rgba (EMapPoint *point);
void e_map_point_set_color_rgba (EMap *map, EMapPoint *point, guint32 color_rgba);
void e_map_point_set_data (EMapPoint *point, gpointer data);
gpointer e_map_point_get_data (EMapPoint *point);
gboolean e_map_point_is_in_view (EMap *map, EMapPoint *point);
EMapPoint *e_map_get_closest_point (EMap *map, double longitude, double latitude,
gboolean in_view);
#endif
This diff is collapsed.
/*
* Copyright (C) 2007 Vincent Untz
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Authors:
* Vincent Untz <vuntz@gnome.org>
*/
#ifndef TZ_LIST_H
#define TZ_LIST_H
#include <glib-object.h>
#include <gdk/gdkscreen.h>
#include "tz.h"
G_BEGIN_DECLS
#define TZ_TYPE_LIST (tz_list_get_type ())
#define TZ_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TZ_TYPE_LIST, TzList))
#define TZ_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TZ_TYPE_LIST, TzListClass))
#define TZ_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TZ_TYPE_LIST))
#define TZ_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TZ_TYPE_LIST))
#define TZ_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TZ_TYPE_LIST, TzListClass))
typedef struct _TzList TzList;
typedef struct _TzListClass TzListClass;
typedef struct _TzListPrivate TzListPrivate;
typedef struct _TzListItem TzListItem;
struct _TzListClass
{
GObjectClass parent_class;
void (* added) (TzList *list,
TzListItem *item);
void (* changed) (TzList *list,
TzListItem *item);
void (* removed) (TzList *list,
TzListItem *item);
};
struct _TzList
{
GObject parent_instance;
TzListPrivate *priv;
};
GType tz_list_get_type (void);
TzList *tz_list_new (const char *prefs_dir);
GList *tz_list_get_items (TzList *list);
gboolean tz_list_contains (TzList *list,
TzLocation *tz_loc);
void tz_list_edit (TzList *list,
GdkScreen *screen);
void tz_list_add (TzList *list,
TzLocation *tz_loc,
const char *name);
void tz_list_rename (TzList *list,
TzListItem *item,
const char *new_name);
void tz_list_move_up (TzList *list,
TzListItem *item);
void tz_list_move_down (TzList *list,
TzListItem *item);
void tz_list_remove (TzList *list,
TzListItem *item);
TzLocation *tz_list_item_get_tz_location (TzListItem *item);
const char *tz_list_item_get_zone (TzListItem *item);
const char *tz_list_item_get_name (TzListItem *item);
int tz_list_item_get_sort_order (TzListItem *item);
G_END_DECLS
#endif /* TZ_LIST_H */
This diff is collapsed.
/*
* tz-sel-dialog.h: timezone selection dialog
*
* Copyright (C) 2007 Vincent Untz <vuntz@gnome.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Authors:
* Vincent Untz <vuntz@gnome.org>
*/
#ifndef TZ_SEL_DIALOG_H
#define TZ_SEL_DIALOG_H
#include <gtk/gtk.h>
#include "tz-list.h"
G_BEGIN_DECLS
GtkWidget *tz_sel_dialog_new (TzList *tz_list);
void tz_sel_dialog_present (GtkWindow *window);
G_END_DECLS
#endif /* TZ_SEL_DIALOG_H */
/*
* tz-window.c: toplevel window containing timezones
*
* Copyright (C) 2007 Vincent Untz <vuntz@gnome.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Authors:
* Vincent Untz <vuntz@gnome.org>
*/
#include <config.h>
#include <string.h>
#include <glib/gi18n.h>
#include "tz-window.h"
#include "clock.h"
#include "tz-list.h"
#define TZ_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TZ_TYPE_WINDOW, TzWindowPrivate))
typedef struct _TzWindowItem TzWindowItem;
struct _TzWindowItem {
TzListItem *list_item;
GtkWidget *name_label;
GtkWidget *time_label;
};
struct _TzWindowPrivate {
GtkWidget *align;
GtkWidget *separator;
GtkWidget *vbox_names;
GtkWidget *vbox_times;
TzList *tz_list;
GHashTable *tz_hash;
char *format;
gulong added_id;
gulong changed_id;
gulong removed_id;
};
G_DEFINE_TYPE (TzWindow, tz_window, GTK_TYPE_WINDOW);
static void
tz_window_item_set_time (TzWindow *tzwin,
TzWindowItem *item,
time_t *now)
{
struct tm *tm;
char hour[256];
char *utf8;
tm = tz_get_localtime_at (tz_list_item_get_zone (item->list_item),
now);
if (strftime (hour, sizeof (hour), tzwin->priv->format, tm) <= 0)
strcpy (hour, "???");
utf8 = g_locale_to_utf8 (hour, -1, NULL, NULL, NULL);
if (!utf8)
utf8 = g_strdup (hour);
gtk_label_set_text (GTK_LABEL (item->time_label), utf8);
g_free (utf8);
}
static void
tz_window_item_set_tooltip (TzWindowItem *item)
{
TzLocation *tz_loc;
TzInfo *tz;
char *text;
char *line;
tz_loc = tz_list_item_get_tz_location (item->list_item);
tz = tz_info_from_location (tz_loc);
if (tz->daylight)
/* Translators: the first string is a timezone name as in "UTC"
* the second string is "+" or nothing. The result looks like
* this: BST (UTC +01:00) */
line = g_strdup_printf (_("%s with daylight saving (UTC %s%.2ld:%.2ld)"),
tz->tzname_normal,
(tz->utc_offset / 3600) >= 0 ? "+" : "",
tz->utc_offset / 3600,
(ABS (tz->utc_offset) % 3600) / 60);
else
/* Translators: the first string is a timezone name as in "UTC"
* the second string is "+" or nothing. The result looks like
* this: BST (UTC +01:00) */
line = g_strdup_printf (_("%s (UTC %s%.2ld:%.2ld)"),
tz->tzname_normal,
(tz->utc_offset / 3600) >= 0 ? "+" : "",
tz->utc_offset / 3600,
(ABS (tz->utc_offset) % 3600) / 60);
/* Translators: the first string is a timezone name (as in
* "Europe/Paris"), the second string is a country name abbreviation
* (as in "FR") and the last string is another line (it's the one
* looking like "BST (UTC +01:00)") */
text = g_strdup_printf (_("%s - %s\n%s"),
_(tz_location_get_zone (tz_loc)),
tz_location_get_country (tz_loc),
line);
g_free (line);
gtk_widget_set_tooltip_text (item->name_label, text);
gtk_widget_set_tooltip_text (item->time_label, text);
tz_info_free (tz);
g_free (text);
}
static void
tz_window_item_free (gpointer data)
{
g_slice_free (TzWindowItem, data);
}
static void
tz_list_item_added (TzList *tz_list,
TzListItem *item,
TzWindow *tzwin)
{
TzWindowItem *win_item;
time_t now;
win_item = g_hash_table_lookup (tzwin->priv->tz_hash, item);
if (win_item)
return;
win_item = g_slice_new (TzWindowItem);
win_item->list_item = item;
win_item->name_label = gtk_label_new (tz_list_item_get_name (item));
win_item->time_label = gtk_label_new ("???");
time (&now);
tz_window_item_set_tooltip (win_item);
tz_window_item_set_time (tzwin, win_item, &now);
g_hash_table_insert (tzwin->priv->tz_hash, item, win_item);
gtk_misc_set_alignment (GTK_MISC (win_item->name_label), 0, 0.5);
gtk_misc_set_alignment (GTK_MISC (win_item->time_label), 1, 0.5);
gtk_widget_show (win_item->name_label);
gtk_widget_show (win_item->time_label);
gtk_container_add (GTK_CONTAINER (tzwin->priv->vbox_names),
win_item->name_label);
gtk_container_add (GTK_CONTAINER (tzwin->priv->vbox_times),
win_item->time_label);
gtk_box_reorder_child (GTK_BOX (tzwin->priv->vbox_names),
win_item->name_label,
tz_list_item_get_sort_order (item));
gtk_box_reorder_child (GTK_BOX (tzwin->priv->vbox_times),
win_item->time_label,
tz_list_item_get_sort_order (item));
gtk_widget_show (tzwin->priv->align);
gtk_widget_show (tzwin->priv->separator);
}
static void
tz_list_item_changed (TzList *tz_list,
TzListItem *item,
TzWindow *tzwin)
{
TzWindowItem *win_item;
time_t now;
win_item = g_hash_table_lookup (tzwin->priv->tz_hash, item);
if (!win_item)
return;
gtk_label_set_text (GTK_LABEL (win_item->name_label),
tz_list_item_get_name (item));
time (&now);
tz_window_item_set_tooltip (win_item);
tz_window_item_set_time (tzwin, win_item, &now);
gtk_box_reorder_child (GTK_BOX (tzwin->priv->vbox_names),
win_item->name_label,
tz_list_item_get_sort_order (item));
gtk_box_reorder_child (GTK_BOX (tzwin->priv->vbox_times),
win_item->time_label,
tz_list_item_get_sort_order (item));
}
static void
tz_list_item_removed (TzList *tz_list,
TzListItem *item,
TzWindow *tzwin)
{
TzWindowItem *win_item;
GList *children;
win_item = g_hash_table_lookup (tzwin->priv->tz_hash, item);
if (!win_item)
return;
gtk_widget_destroy (win_item->name_label);
gtk_widget_destroy (win_item->time_label);
g_hash_table_remove (tzwin->priv->tz_hash, item);
children = gtk_container_get_children (GTK_CONTAINER (tzwin->priv->vbox_names));
if (g_list_length (children) == 0) {
gtk_widget_hide (tzwin->priv->align);
gtk_widget_hide (tzwin->priv->separator);
}
g_list_free (children);
}
static void
tz_window_edit_zones (GtkWidget *widget,
TzWindow *tzwin)
{
tz_list_edit (tzwin->priv->tz_list,
gtk_widget_get_screen (GTK_WIDGET (tzwin)));
}
static void
tz_window_fill (TzWindow *tzwin)
{
GtkWidget *frame;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *button;