~saltmakrell/launchpad/fixtiles-osm-gps-map

« back to all changes in this revision

Viewing changes to python/osmgpsmap.override

  • Committer: Bazaar Package Importer
  • Author(s): David Paleino
  • Date: 2010-01-23 18:01:56 UTC
  • mfrom: (0.1.3 squeeze) (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100123180156-g9bge7mrrx4j10lz
Tags: 0.5-1
* New upstream release
  - fixed missing #include in src/osm-gps-map.c (Closes: #564907)
* debian/patches/:
  - 02-fix_python_library_linking.patch removed, fixed upstream
* debian/python-osmgpsmap.examples updated
* debian/rules: don't remove COPYING on clean
* debian/libosmgpsmap0.symbols updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    return Py_BuildValue("(dd)", coord.rlat, coord.rlon);
50
50
}
51
51
%%
 
52
override osm_gps_map_set_center
 
53
static PyObject *
 
54
_wrap_osm_gps_map_set_center(PyGObject *self, PyObject *args)
 
55
{
 
56
    double latitude, longitude;
 
57
 
 
58
    if (PyTuple_Size(args) == 1)
 
59
        args = PyTuple_GetItem(args, 0);
 
60
    if (!PyArg_ParseTuple(args, "dd;OsmGpsMap.set_center takes two floats (also in a tuple)",
 
61
                          &latitude, &longitude))
 
62
        return NULL;
 
63
    osm_gps_map_set_center(OSM_GPS_MAP(self->obj), latitude, longitude);
 
64
 
 
65
    Py_INCREF(Py_None);
 
66
    return Py_None;
 
67
}
 
68
%%
 
69
override osm_gps_map_screen_to_geographic
 
70
static PyObject *
 
71
_wrap_osm_gps_map_screen_to_geographic(PyGObject *self, PyObject *args)
 
72
{
 
73
    int pixel_x, pixel_y;
 
74
    gfloat latitude, longitude;
 
75
 
 
76
    if (PyTuple_Size(args) == 1)
 
77
        args = PyTuple_GetItem(args, 0);
 
78
    if (!PyArg_ParseTuple(args, "ii:OsmGpsMap.screen_to_geographic takes two"
 
79
                          "integers (also in a tuple)", &pixel_x, &pixel_y))
 
80
        return NULL;
 
81
 
 
82
    osm_gps_map_screen_to_geographic(OSM_GPS_MAP(self->obj), pixel_x, pixel_y,
 
83
                                     &latitude, &longitude);
 
84
 
 
85
    return Py_BuildValue("(ff)", latitude, longitude);
 
86
}
 
87
%%
 
88
override osm_gps_map_geographic_to_screen
 
89
static PyObject *
 
90
_wrap_osm_gps_map_geographic_to_screen(PyGObject *self, PyObject *args)
 
91
{
 
92
    int pixel_x, pixel_y;
 
93
    gfloat latitude, longitude;
 
94
 
 
95
    if (PyTuple_Size(args) == 1)
 
96
        args = PyTuple_GetItem(args, 0);
 
97
    if (!PyArg_ParseTuple(args, "ff:OsmGpsMap.geographic_to_screen takes two"
 
98
                          "floats (also in a tuple)", &latitude, &longitude))
 
99
        return NULL;
 
100
 
 
101
    osm_gps_map_geographic_to_screen(OSM_GPS_MAP(self->obj),
 
102
                                     latitude, longitude,
 
103
                                     &pixel_x, &pixel_y);
 
104
 
 
105
    return Py_BuildValue("(ii)", pixel_x, pixel_y);
 
106
}
 
107
%%
 
108
override osm_gps_map_scroll
 
109
static PyObject *
 
110
_wrap_osm_gps_map_scroll(PyGObject *self, PyObject *args)
 
111
{
 
112
    int dx, dy;
 
113
 
 
114
    if (PyTuple_Size(args) == 1)
 
115
        args = PyTuple_GetItem(args, 0);
 
116
    if (!PyArg_ParseTuple(args, "ii:OsmGpsMap.scroll takes two "
 
117
                          "integers (also in a tuple)", &dx, &dy))
 
118
        return NULL;
 
119
 
 
120
    osm_gps_map_scroll(OSM_GPS_MAP(self->obj), dx, dy);
 
121
 
 
122
    Py_INCREF(Py_None);
 
123
    return Py_None;
 
124
}
 
125
 
 
126
%%
52
127
override osm_gps_map_add_track kwargs
53
128
static PyObject *
54
129
_wrap_osm_gps_map_add_track(PyGObject *self, PyObject *args,