]> git.itanic.dy.fi Git - maemo-mapper/blob - src/dbus-ifc.h
Administrative changes in preparation for release of Maemo Mapper v2.6.2.
[maemo-mapper] / src / dbus-ifc.h
1 /*
2  * Copyright (C) 2006, 2007 John Costigan.
3  *
4  * POI and GPS-Info code originally written by Cezary Jackiewicz.
5  *
6  * Default map data provided by http://www.openstreetmap.org/
7  *
8  * This file is part of Maemo Mapper.
9  *
10  * Maemo Mapper 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 3 of the License, or
13  * (at your option) any later version.
14  *
15  * Maemo Mapper 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 Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
22  */
23
24 #ifndef MAEMO_MAPPER_DBUS_H
25 #define MAEMO_MAPPER_DBUS_H
26
27 #define DBUS_API_SUBJECT_TO_CHANGE
28
29 #define MM_DBUS_SERVICE "com.gnuite.maemo_mapper"
30 #define MM_DBUS_PATH "/com/gnuite/maemo_mapper"
31 #define MM_DBUS_INTERFACE "com.gnuite.maemo_mapper"
32
33 /**
34  * Sets the view center (including zoom and viewing angle).  All of the
35  * fields are optional, although (due to the requirements of DBUS), if you
36  * specify one value, you must specify all the values preceding it.  I.e. if
37  * you specify new_viewing_angle, you must specify all the fields.
38  *
39  * A screen refresh is performed regardless of whether or not any of the
40  * fields are specified or different from previous values.  Thus, you can
41  * force a refresh of the screen simply by calling this method with no
42  * arguments.
43  *
44  * This method has no effect if the user is currently tap-and-holding or
45  * dragging on the screen.
46  *
47  * Note that, if this method causes the refresh of the screen, then
48  * Auto-Center will always become disabled.
49  */
50 #define MM_DBUS_METHOD_SET_VIEW_POSITION "set_view_center"
51 typedef struct _SetViewPositionArgs SetViewPositionArgs;
52 struct _SetViewPositionArgs
53 {
54     gdouble new_lat;
55     gdouble new_lon;
56     gint new_zoom;
57     gdouble new_viewing_angle; /* i.e. rotation */
58 };
59
60 /**
61  * Occurs whenever the view center (including zoom and viewing angle)
62  * changes.  This signal is not necessarily fired when the screen size is
63  * changed.  Not all of the given information may necessarily have changed,
64  * but at least one is guaranteed to have changed.
65  */
66 #define MM_DBUS_SIGNAL_VIEW_POSITION_CHANGED "view_position_changed"
67 typedef struct _ViewPositionChangedArgs ViewPositionChangedArgs;
68 struct _ViewPositionChangedArgs
69 {
70     gdouble new_lat;
71     gdouble new_lon;
72     gint new_zoom;
73     gdouble new_viewing_angle; /* i.e. rotation */
74 };
75 void dbus_ifc_fire_view_position_changed(
76         Point new_center, gint new_zoom, gdouble new_viewing_angle);
77
78 /**
79  * Occurs whenever the dimensions (width and height) of the map change.  The
80  * dimensions do not include any sidebars (like the GPS info panel).  If the
81  * GPS info panel is hidden or unhidden, this event will be fired.
82  */
83 #define MM_DBUS_SIGNAL_VIEW_DIMENSIONS_CHANGED "view_dimensions_changed"
84 typedef struct _ViewDimensionsChangedArgs ViewDimensionsChangedArgs;
85 struct _ViewDimensionsChangedArgs
86 {
87     gint new_view_width_pixels;
88     gint new_view_height_pixels;
89 };
90 void dbus_ifc_fire_view_dimensions_changed(
91         gint new_view_width_pixels, gint new_view_height_pixels);
92
93
94 void dbus_ifc_init(void);
95
96 #endif /* ifndef MAEMO_MAPPER_GPS_H */