%%
headers
#include <Python.h>
#include "pygobject.h"
#include "e-map.h"
#define E_TYPE_MAP TYPE_E_MAP
#define E_TYPE_MAP_POINT TYPE_E_MAP_POINT
%%
modulename emap
%%
import gtk.Widget as PyGtkWidget_Type
%%
ignore-glob
  *_get_type
%%
override e_map_window_to_world kwargs
static PyObject *
_wrap_e_map_window_to_world(PyGObject *self, PyObject *args, PyObject *kwargs)
{
    static char *kwlist[] = {"win_x", "win_y", NULL};
    double win_x, win_y, world_longitude, world_latitude;

    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "dd:EMap.window_to_world", kwlist, &win_x, &win_y))
        return NULL;

    e_map_window_to_world(E_MAP(self->obj), win_x, win_y, &world_longitude, &world_latitude);

    return Py_BuildValue("(dd)", world_longitude, world_latitude);
}
%%
override e_map_world_to_window kwargs
static PyObject *
_wrap_e_map_world_to_window(PyGObject *self, PyObject *args, PyObject *kwargs)
{
    static char *kwlist[] = {"world_longitude", "world_latitude", NULL};
    double world_longitude, world_latitude, win_x, win_y;

    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "dd:EMap.world_to_window", kwlist, &world_longitude, &world_latitude))
        return NULL;

    e_map_world_to_window(E_MAP(self->obj), world_longitude, world_latitude, &win_x, &win_y);

    return Py_BuildValue("(dd)", win_x, win_y);
}
%%
override e_map_add_point kwargs
static PyObject *
_wrap_e_map_add_point(PyGObject *self, PyObject *args, PyObject *kwargs)
{
    static char *kwlist[] = {"name", "longitude", "latitude", "color_rgba", NULL};
    gchar *name;
    double longitude, latitude;
    guint32 color_rgba;
    EMapPoint *point;

    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "sddI:EMap.add_point", kwlist, &name, &longitude, &latitude, &color_rgba))
        return NULL;

    point = e_map_add_point(E_MAP(self->obj), name, longitude, latitude, color_rgba);
    return pyg_boxed_new(TYPE_E_MAP_POINT, point, TRUE, TRUE);
}
%%
override e_map_point_get_location noargs
static PyObject *
_wrap_e_map_point_get_location(PyGObject *self)
{
    double longitude, latitude;

    e_map_point_get_location(pyg_boxed_get(self, EMapPoint), &longitude, &latitude);

    return Py_BuildValue("(dd)", longitude, latitude);
}
%%
