+2003-02-24 Bill Haneman <bill.haneman@sun.com>
+
+ * cspi/spi_text.c:
+ (get_accessible_text_boundary_type):
+ Move default return value to (new) default case in switch.
+ (get_accessible_text_clip_type):
+ Move default return value to (new) default case in switch.
+
+ * libspi/application.c:
+ (lookup_toolkit_event_for_name, reverse_lookup_name_for_toolkit_event):
+ Remove unused methods.
+ (impl_accessibility_application_register_object_event_listener):
+ Remove unused methods.
+
+ * libspi/value.c:
+ Added #include of <math.h>.
+
+ * registryd/deviceeventcontroller.c:
+ (spi_dec_ungrab_mouse): Bracketed with #ifdefs, since
+ we don't currently use this method.
+ (spi_dec_init_mouse_listener): Don't call XkbGetMap unless
+ have_xkb is TRUE.
+ (impl_generate_key_event):
+ Remove unused variables.
+ (impl_generate_mouse_event):
+ Initialize button to zero, just in case we get an invalid
+ input. Added support for mouse buttons 4 and 5.
+ (spi_device_event_controller_new):
+ Removed unused variable declaration for 'private'.
+ (registry.h):
+ Added #include of <gdk/gdk.h>
+
2003-02-14 Padraig O'Briain <padraig.obriain@sun.com>
* configure.in: Update to work when X is not installed in expected
/* Fixme */
return Accessibility_TEXT_BOUNDARY_CHAR;
break;
+ default:
+ /* FIXME */
+ return Accessibility_TEXT_BOUNDARY_CHAR;
}
- /* FIXME */
- return Accessibility_TEXT_BOUNDARY_CHAR;
}
static Accessibility_TEXT_CLIP_TYPE
case SPI_TEXT_CLIP_MIN:
return Accessibility_TEXT_CLIP_MIN;
break;
- case SPI_TEXT_CLIP_MAX:
+ case SPI_TEXT_CLIP_MAX:
return Accessibility_TEXT_CLIP_MAX;
break;
+ default:
+ return Accessibility_TEXT_CLIP_BOTH;
}
- return Accessibility_TEXT_CLIP_BOTH;
}
static AccessibleTextRange **
SpiAccessible *source,
Accessibility_Event *e);
-static const char *reverse_lookup_name_for_toolkit_event (char *toolkit_name);
-
-static const char *
-lookup_toolkit_event_for_name (const char *generic_name)
-{
- char *toolkit_specific_name;
- SpiApplicationClass *klass = g_type_class_peek (SPI_APPLICATION_TYPE);
-#ifdef SPI_DEBUG
- fprintf (stderr, "looking for %s in hash table.\n", generic_name);
-#endif
- toolkit_specific_name =
- (char *) g_hash_table_lookup (klass->toolkit_event_names, generic_name);
-#ifdef SPI_DEBUG
- fprintf (stderr, "generic event %s converted to %s\n", generic_name, toolkit_specific_name);
-#endif
- return toolkit_specific_name;
-}
-
/*
* Implemented GObject::finalize
*/
}
static gboolean
-spi_application_object_event_listener (GSignalInvocationHint *signal_hint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- Accessibility_Event e;
- AtkObject *aobject;
- SpiAccessible *source;
- GSignalQuery signal_query;
- gchar *event_name;
- const char *generic_name;
-
- g_return_val_if_fail (the_app != NULL, FALSE);
-
- g_signal_query (signal_hint->signal_id, &signal_query);
-
- /* TODO: move GTK reference out of app.c into bridge */
- event_name = g_strdup_printf ("Gtk:%s:%s",
- g_type_name (signal_query.itype),
- signal_query.signal_name);
-
- generic_name = reverse_lookup_name_for_toolkit_event (event_name);
-
- fprintf (stderr, "Received (object) signal %s maps to '%s'\n",
- event_name, generic_name);
-
- g_free (event_name);
-
- g_return_val_if_fail (generic_name, FALSE);
-
- aobject = get_atk_object_ref (g_value_get_object (param_values + 0));
-
- source = spi_accessible_new (aobject);
- e.type = CORBA_string_dup (generic_name);
- e.source = CORBA_OBJECT_NIL;
- e.detail1 = 0;
- e.detail2 = 0;
- spi_init_any_nil (&e.any_data);
- notify_listeners (the_app->toolkit_listeners, source, &e);
-
- bonobo_object_unref (BONOBO_OBJECT (source));
-
- g_object_unref (G_OBJECT (aobject));
-
- return TRUE;
-}
-
-static gboolean
spi_application_toolkit_event_listener (GSignalInvocationHint *signal_hint,
guint n_param_values,
const GValue *param_values,
}
static void
-impl_accessibility_application_register_object_event_listener (PortableServer_Servant servant,
- Accessibility_EventListener listener,
- const CORBA_char *event_name,
- CORBA_Environment *ev)
-{
- guint spi_listener_id = 0;
- const char *toolkit_specific_event_name =
- lookup_toolkit_event_for_name (event_name);
- if (toolkit_specific_event_name)
- {
- spi_listener_id =
- atk_add_global_event_listener (spi_application_object_event_listener,
- toolkit_specific_event_name);
- the_app->toolkit_listeners = g_list_append (the_app->toolkit_listeners,
- CORBA_Object_duplicate (listener, ev));
- }
-#ifdef SPI_DEBUG
- fprintf (stderr, "registered %d for object events named: %s\n",
- spi_listener_id,
- event_name);
-#endif
-}
-
-static void
notify_listeners (GList *listeners, SpiAccessible *source, Accessibility_Event *e)
{
GList *l;
}
}
-static const char *
-reverse_lookup_name_for_toolkit_event (char *toolkit_specific_name)
-{
- const char *generic_name;
- SpiApplicationClass *klass = g_type_class_peek (SPI_APPLICATION_TYPE);
-#ifdef SPI_DEBUG
- fprintf (stderr, "(reverse lookup) looking for %s in hash table.\n", toolkit_specific_name);
-#endif
- generic_name =
- (const char *) g_hash_table_lookup (klass->generic_event_names, toolkit_specific_name);
-#ifdef SPI_DEBUG
- fprintf (stderr, "toolkit event %s converted to %s\n", toolkit_specific_name, generic_name);
-#endif
- return generic_name;
-}
-
static void
init_toolkit_names (GHashTable **generic_event_names, GHashTable **toolkit_event_names)
{
/* value.c : implements the Value interface */
#include <config.h>
+#include <math.h>
#include <stdio.h>
#include <libspi/value.h>
}
}
+#ifdef WE_NEED_UGRAB_MOUSE
static int
spi_dec_ungrab_mouse (gpointer data)
{
}
return FALSE;
}
+#endif
static void
spi_dec_init_mouse_listener (SpiRegistry *registry)
g_object_get_qdata (G_OBJECT (controller), spi_dec_private_quark);
/* FIXME: should check for extension first! */
XTestGrabControl (spi_get_display (), True);
- priv->xkb_desc = XkbGetMap (spi_get_display (), 0, XkbUseCoreKbd);
/* calls to device-specific implementations and routines go here */
/* register with: keyboard hardware code handler */
&priv->xkb_base_error_code, NULL, NULL);
if (priv->have_xkb)
{
+ priv->xkb_desc = XkbGetMap (spi_get_display (), 0, XkbUseCoreKbd);
XkbSelectEvents (spi_get_display (),
XkbUseCoreKbd,
XkbStateNotifyMask, XkbStateNotifyMask);
}
+
gdk_window_add_filter (NULL, global_filter_fn, controller);
gdk_window_set_events (gdk_get_default_root_window (),
{
SpiDEController *controller =
SPI_DEVICE_EVENT_CONTROLLER (bonobo_object (servant));
- DEControllerPrivateData *priv;
long key_synth_code;
- unsigned int slow_keys_delay;
- unsigned int press_time;
- unsigned int release_time;
#ifdef SPI_DEBUG
fprintf (stderr, "synthesizing keystroke %ld, type %d\n",
const CORBA_char *eventName,
CORBA_Environment *ev)
{
- int button;
+ int button = 0;
gboolean error = FALSE;
Display *display = spi_get_display ();
#ifdef SPI_DEBUG
case '3':
button = 3;
break;
+ case '4':
+ button = 4;
+ break;
+ case '5':
+ button = 5;
+ break;
default:
error = TRUE;
}
{
SpiDEController *retval = g_object_new (
SPI_DEVICE_EVENT_CONTROLLER_TYPE, NULL);
- DEControllerPrivateData *private;
retval->registry = SPI_REGISTRY (bonobo_object_ref (
BONOBO_OBJECT (registry)));
#define SPI_REGISTRY_H_
#include <glib/gmain.h>
+#include <gdk/gdk.h>
#include <libspi/listener.h>
typedef struct _SpiRegistry SpiRegistry;