~kroq-gar78/ubuntu/precise/gnome-control-center/fix-885947

« back to all changes in this revision

Viewing changes to panels/datetime/tz.h

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Moya
  • Date: 2011-05-17 10:47:27 UTC
  • mfrom: (0.1.11 experimental) (1.1.45 upstream)
  • Revision ID: james.westby@ubuntu.com-20110517104727-lqel6m8vhfw5jby1
Tags: 1:3.0.1.1-1ubuntu1
* Rebase on Debian, remaining Ubuntu changes:
* debian/control:
  - Build-Depend on hardening-wrapper, dpkg-dev and dh-autoreconf
  - Add dependency on ubuntu-system-service
  - Remove dependency on gnome-icon-theme-symbolic
  - Move dependency on apg, gnome-icon-theme-symbolic and accountsservice to
    be a Recommends: until we get them in main
* debian/rules:
  - Use autoreconf
  - Add binary-post-install rule for gnome-control-center-data
  - Run dh-autoreconf
* debian/gnome-control-center.dirs:
* debian/gnome-control-center.links:
  - Add a link to the control center shell for indicators
* debian/patches/00_disable-nm.patch:
  - Temporary patch to disable building with NetworkManager until we get
    the new one in the archive
* debian/patches/01_git_remove_gettext_calls.patch:
  - Remove calls to AM_GNU_GETTEXT, IT_PROG_INTLTOOL should be enough
* debian/patches/01_git_kill_warning.patch:
  - Kill warning
* debian/patches/50_ubuntu_systemwide_prefs.patch:
  - Ubuntu specific proxy preferences
* debian/patches/51_ubuntu_system_keyboard.patch:
  - Implement the global keyboard spec at https://wiki.ubuntu.com/DefaultKeyboardSettings

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 
2
/* Generic timezone utilities.
 
3
 *
 
4
 * Copyright (C) 2000-2001 Ximian, Inc.
 
5
 *
 
6
 * Authors: Hans Petter Jansson <hpj@ximian.com>
 
7
 * 
 
8
 * Largely based on Michael Fulbright's work on Anaconda.
 
9
 *
 
10
 * This program is free software; you can redistribute it and/or modify
 
11
 * it under the terms of the GNU General Public License as published by
 
12
 * the Free Software Foundation; either version 2 of the License, or
 
13
 * (at your option) any later version.
 
14
 *
 
15
 * This program is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 * GNU General Public License for more details.
 
19
 *
 
20
 * You should have received a copy of the GNU General Public License
 
21
 * along with this program; if not, write to the Free Software
 
22
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 
23
 */
 
24
 
 
25
 
 
26
#ifndef _E_TZ_H
 
27
#define _E_TZ_H
 
28
 
 
29
#include <glib.h>
 
30
 
 
31
#ifndef __sun
 
32
#  define TZ_DATA_FILE "/usr/share/zoneinfo/zone.tab"
 
33
#else
 
34
#  define TZ_DATA_FILE "/usr/share/lib/zoneinfo/tab/zone_sun.tab"
 
35
#endif
 
36
 
 
37
typedef struct _TzDB TzDB;
 
38
typedef struct _TzLocation TzLocation;
 
39
typedef struct _TzInfo TzInfo;
 
40
 
 
41
 
 
42
struct _TzDB
 
43
{
 
44
        GPtrArray  *locations;
 
45
        GHashTable *backward;
 
46
};
 
47
 
 
48
struct _TzLocation
 
49
{
 
50
        gchar *country;
 
51
        gdouble latitude;
 
52
        gdouble longitude;
 
53
        gchar *zone;
 
54
        gchar *comment;
 
55
 
 
56
        gdouble dist; /* distance to clicked point for comparison */
 
57
};
 
58
 
 
59
/* see the glibc info page information on time zone information */
 
60
/*  tzname_normal    is the default name for the timezone */
 
61
/*  tzname_daylight  is the name of the zone when in daylight savings */
 
62
/*  utc_offset       is offset in seconds from utc */
 
63
/*  daylight         if non-zero then location obeys daylight savings */
 
64
 
 
65
struct _TzInfo
 
66
{
 
67
        gchar *tzname_normal;
 
68
        gchar *tzname_daylight;
 
69
        glong utc_offset;
 
70
        gint daylight;
 
71
};
 
72
 
 
73
 
 
74
TzDB      *tz_load_db                 (void);
 
75
void       tz_db_free                 (TzDB *db);
 
76
char *     tz_info_get_clean_name     (TzDB *tz_db,
 
77
                                       const char *tz);
 
78
GPtrArray *tz_get_locations           (TzDB *db);
 
79
void       tz_location_get_position   (TzLocation *loc,
 
80
                                       double *longitude, double *latitude);
 
81
char      *tz_location_get_country    (TzLocation *loc);
 
82
gchar     *tz_location_get_zone       (TzLocation *loc);
 
83
gchar     *tz_location_get_comment    (TzLocation *loc);
 
84
glong      tz_location_get_utc_offset (TzLocation *loc);
 
85
gint       tz_location_set_locally    (TzLocation *loc);
 
86
TzInfo    *tz_info_from_location      (TzLocation *loc);
 
87
void       tz_info_free               (TzInfo *tz_info);
 
88
 
 
89
#endif