![]() |
![]() |
![]() |
Gypsy Reference Manual | ![]() |
---|---|---|---|---|
GypsyPosition; #define GYPSY_POSITION_DBUS_INTERFACE #define GYPSY_POSITION_DBUS_SERVICE enum GypsyPositionFields; GypsyPosition* gypsy_position_new (const char *object_path); GypsyPositionFields gypsy_position_get_position (GypsyPosition *position, int *timestamp, double *latitude, double *longitude, double *altitude, GError **error);
GypsyPosition is used whenever the client program wishes to know about GPS position changes. It can report the current position, and has a signal to notify listeners to changes.
typedef struct _GypsyPosition GypsyPosition;
There are no public fields in GypsyPosition.
#define GYPSY_POSITION_DBUS_INTERFACE "org.freedesktop.Gypsy.Position"
A define containing the name of the Position interface
#define GYPSY_POSITION_DBUS_SERVICE "org.freedesktop.Gypsy"
A define containing the address of the Position service
typedef enum { GYPSY_POSITION_FIELDS_NONE = 1 << 0, GYPSY_POSITION_FIELDS_LATITUDE = 1 << 1, GYPSY_POSITION_FIELDS_LONGITUDE = 1 << 2, GYPSY_POSITION_FIELDS_ALTITUDE = 1 << 3 } GypsyPositionFields;
A bitmask telling which fields in the position_changed callback are valid
GypsyPosition* gypsy_position_new (const char *object_path);
Creates a new GypsyPosition object that listens for position changes
from the GPS found at object_path
.
object_path : |
Object path to the GPS device |
Returns : | A GypsyPosition object |
GypsyPositionFields gypsy_position_get_position (GypsyPosition *position, int *timestamp, double *latitude, double *longitude, double *altitude, GError **error);
Obtains the current position, if known, from the GPS device.
timestamp
, latitude
, longitude
and altitude
can be NULL if the result
is not required.
position : |
A GypsyPosition |
timestamp : |
Pointer to store the timestamp |
latitude : |
Pointer to store the latitude |
longitude : |
Pointer to store the longitude |
altitude : |
Pointer to store the altitude |
error : |
Pointer to store a GError |
Returns : | Bitmask of GypsyPositionFields indicating what field was set |
void user_function (GypsyPosition *fields, gint timestamp, gint latitude, gdouble longitude, gdouble altitude, gdouble arg5, gpointer user_data) : Run First / No Recursion
The ::position-changed signal is emitted when the GPS device
indicates that one or more of the position fields has changed.
The fields which have changed will be indicated in the fields
bitmask.
fields : |
A bitmask of GypsyPositionFields indicating which of the following fields are valid |
timestamp : |
The timestamp when this change occurred |
latitude : |
The new latitude |
longitude : |
The new longitude |
altitude : |
The new altitude |
user_data : |
user data set when the signal handler was connected. |