int main() { GypsyControl *control = gypsy_control_get_default(); GypsyDevice *device = gypsy_device_new("test"); GypsySatellite *satellite = gypsy_satellite_new("test"); GConfClient *client = gconf_client_get_default(); g_object_unref(client); return 0; }
int main (int argc, char **argv) { GMainLoop *mainloop; GypsyDevice *device; GypsyPosition *position; GypsyCourse *course; GError *error = NULL; char *path; if (argc < 2) { g_print ("Usage: %s device\n", argv[0]); return 0; } g_type_init (); control = gypsy_control_get_default (); path = gypsy_control_create (control, argv[1], &error); if (path == NULL) { g_warning ("Error creating client for %s: %s", argv[1], error->message); g_error_free (error); return 0; } device = gypsy_device_new (path); position = gypsy_position_new (path); g_signal_connect (position, "position-changed", G_CALLBACK (position_changed), NULL); course = gypsy_course_new (path); g_signal_connect (course, "course-changed", G_CALLBACK (course_changed), NULL); gypsy_device_start (device, &error); if (error != NULL) { g_warning ("Error starting %s: %s", argv[1], error->message); g_error_free (error); return 0; } mainloop = g_main_loop_new (NULL, FALSE); g_main_loop_run (mainloop); /* FIXME: Need some way to quit the mainloop */ g_object_unref (control); return 0; }
static void geoclue_gypsy_init (GeoclueGypsy *gypsy) { gypsy->status = GEOCLUE_STATUS_ERROR; gypsy->control = gypsy_control_get_default (); gc_provider_set_details (GC_PROVIDER (gypsy), "org.freedesktop.Geoclue.Providers.Gypsy", "/org/freedesktop/Geoclue/Providers/Gypsy", "Gypsy", "Gypsy provider"); gypsy->position_fields = GYPSY_POSITION_FIELDS_NONE; gypsy->accuracy = geoclue_accuracy_new (GEOCLUE_ACCURACY_LEVEL_NONE, 0.0, 0.0); }