Merge branch 'master' of git+ssh://doffm@git.freedesktop.org/git/at-spi2/at-spi2...
[platform/core/uifw/at-spi2-atk.git] / registryd / deviceeventcontroller.c
index 3f87a4e..bdc5816 100644 (file)
@@ -341,7 +341,7 @@ spi_dec_clear_unlatch_pending (SpiDEController *controller)
     g_object_get_qdata (G_OBJECT (controller), spi_dec_private_quark);
   priv->xkb_latch_mask = 0;
 }
+
 static void emit(SpiDEController *controller, const char *name, int first_type, ...)
 {
   va_list arg;
@@ -356,7 +356,7 @@ spi_dec_button_update_and_emit (SpiDEController *controller,
                                guint mask_return)
 {
   Accessibility_DeviceEvent mouse_e;
-  gchar event_name[24];
+  gchar event_detail[24];
   gboolean is_consumed = FALSE;
 
   if ((mask_return & mouse_button_mask) !=
@@ -435,7 +435,7 @@ spi_dec_button_update_and_emit (SpiDEController *controller,
        fprintf (stderr, "Button %d %s\n",
                 button_number, (is_down) ? "Pressed" : "Released");
 #endif
-       snprintf (event_name, 22, "mouse:button:%d%c", button_number,
+       snprintf (event_detail, 22, "%d%c", button_number,
                  (is_down) ? 'p' : 'r');
        /* TODO: FIXME distinguish between physical and 
         * logical buttons 
@@ -455,7 +455,7 @@ spi_dec_button_update_and_emit (SpiDEController *controller,
        if (!is_consumed)
          {
            dbus_uint32_t x = last_mouse_pos->x, y = last_mouse_pos->y;
-           emit(controller, event_name, DBUS_TYPE_UINT32, &x, DBUS_TYPE_UINT32, &y, DBUS_TYPE_INVALID);
+           emit(controller, SPI_DBUS_INTERFACE_EVENT_MOUSE, "button", event_detail, x, y);
          }
        else
          spi_dec_set_unlatch_pending (controller, mask_return);
@@ -499,10 +499,10 @@ spi_dec_mouse_check (SpiDEController *controller,
     {
       // TODO: combine these two signals?
       dbus_uint32_t ix = *x, iy = *y;
-      emit(controller, "mouse_abs", DBUS_TYPE_UINT32, &ix, DBUS_TYPE_UINT32, &iy, DBUS_TYPE_INVALID);
+      emit(controller, SPI_DBUS_INTERFACE_EVENT_MOUSE, "abs", NULL, ix, iy);
       ix -= last_mouse_pos->x;
       iy -= last_mouse_pos->y;
-      emit(controller, "mouse_rel", DBUS_TYPE_UINT32, &ix, DBUS_TYPE_UINT32, &iy, DBUS_TYPE_INVALID);
+      emit(controller, SPI_DBUS_INTERFACE_EVENT_MOUSE, "rel", NULL, ix, iy);
       last_mouse_pos->x = *x;
       last_mouse_pos->y = *y;
       *moved = True;
@@ -534,7 +534,7 @@ spi_dec_emit_modifier_event (SpiDEController *controller, guint prev_mask,
 
   d1 = prev_mask & key_modifier_mask;
   d2 = current_mask & key_modifier_mask;
-      emit(controller, "keyboard_modifiers", DBUS_TYPE_UINT32, &d1, DBUS_TYPE_UINT32, &d2, DBUS_TYPE_INVALID);
+      emit(controller, SPI_DBUS_INTERFACE_EVENT_KEYBOARD, "modifiers", NULL, d1, d2);
 }
 
 static gboolean
@@ -1026,7 +1026,7 @@ spi_device_event_controller_forward_mouse_event (SpiDEController *controller,
                                                 XEvent *xevent)
 {
   Accessibility_DeviceEvent mouse_e;
-  gchar event_name[24];
+  gchar event_detail[24];
   gboolean is_consumed = FALSE;
   gboolean xkb_mod_unlatch_occurred;
   XButtonEvent *xbutton_event = (XButtonEvent *) xevent;
@@ -1064,7 +1064,7 @@ spi_device_event_controller_forward_mouse_event (SpiDEController *controller,
           (xevent->type == ButtonPress) ? "Press" : "Release",
           mouse_button_state);
 #endif
-  snprintf (event_name, 22, "mouse:button_%d%c", button,
+  snprintf (event_detail, 22, "%d%c", button,
            (xevent->type == ButtonPress) ? 'p' : 'r');
 
   /* TODO: FIXME distinguish between physical and logical buttons */
@@ -1090,7 +1090,7 @@ spi_device_event_controller_forward_mouse_event (SpiDEController *controller,
       ix = last_mouse_pos->x;
       iy = last_mouse_pos->y;
       /* TODO - Work out which part of the spec this emit is fulfilling */
-      //emit(controller, event_name, DBUS_TYPE_UINT32, &ix, DBUS_TYPE_UINT32, &iy, DBUS_TYPE_INVALID);
+      //emit(controller, SPI_DBUS_INTERFACE_EVENT_MOUSE, "button", event_detail, ix, iy);
     }
 
   xkb_mod_unlatch_occurred = (xevent->type == ButtonPress ||