#include <bt-dbus.h>
#endif
+#ifdef WITH_GL
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include <gtk/gtkgl.h>
+#endif
+
#include "mapper.h"
#include "hildon-mapper.h"
#include "utils.h"
}
static gboolean
-mapper_hal_init(void)
+mapper_hal_init(DBusConnection *dbc)
{
DBusError error;
+g_return_if_fail(dbc);
+
dbus_error_init(&error);
ctx=libhal_ctx_new();
-g_assert(ctx);
+g_return_if_fail(ctx);
+
+libhal_ctx_set_dbus_connection(ctx, dbc);
-g_assert(dbus_conn);
-libhal_ctx_set_dbus_connection(ctx, dbus_conn);
-g_debug("HAL: init");
-if (!libhal_ctx_init(ctx, &error))
+if (!libhal_ctx_init(ctx, &error)) {
+ g_warning("HAL Init failed");
return FALSE;
+}
-g_debug("HAL: setting cb");
libhal_ctx_set_device_condition(ctx, hal_condition_cb);
libhal_device_add_property_watch(ctx, "/org/freedesktop/Hal/devices/platform_retu_headset_logicaldev_input",NULL);
case MAPPER_INIT_MISC:
/* Initialize D-Bus system connection. */
if (NULL == (dbus_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error))) {
- g_printerr("Failed to open connection to D-Bus: %s.\n", error->message);
+ g_warning("Failed to open connection to D-Bus: %s.\n", error->message);
popup_error(NULL, "Failed to connect to D-Bus.");
- error = NULL;
+ error=NULL;
}
/* XXX: Move this */
osso_hw_set_event_cb(_osso, NULL, osso_cb_hw_state, NULL);
#endif
#ifdef WITH_HAL
- mapper_hal_init();
+ mapper_hal_init(dbus_conn);
#endif
mis=MAPPER_INIT_UI;
gint
main(gint argc, gchar * argv[])
{
-/* Initialize localization. */
+dbus_conn=NULL;
+
setlocale(LC_ALL, "");
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
gst_init(&argc, &argv);
#endif
gtk_init(&argc, &argv);
+#if defined (WITH_GL)
+if (!gtk_gl_init_check(&argc, &argv)) {
+ g_warning("OpenGL init failed");
+}
+#endif
if (mapper_osso_init()!=0)
return 1;
if (mapper_osso_cb_init()!=0)