+2002-04-13 Bill Haneman <bill.haneman@sun.com>
+
+ * util/magnifier.c:
+ Added implementation code for Accessibility_Magnifier_exit ().
+
+ * util/mag_control.c:
+ Added test code for above method; you can
+ now kill an existing magnifier via
+ ./mag_control q, from the util directory.
+
2002-04-11 Bill Haneman <bill.haneman@sun.com>
* test/app.c, test/keysynth-demo.c:
static void report_focus_event (const AccessibleEvent *event, void *user_data);
static void report_generic_event (const AccessibleEvent *event, void *user_data);
+static void report_window_event (const AccessibleEvent *event, void *user_data);
static void report_text_event (const AccessibleEvent *event, void *user_data);
static void report_button_press (const AccessibleEvent *event, void *user_data);
static void check_property_change (const AccessibleEvent *event, void *user_data);
static AccessibleEventListener *focus_listener;
static AccessibleEventListener *property_listener;
static AccessibleEventListener *generic_listener;
+static AccessibleEventListener *window_listener;
static AccessibleEventListener *button_listener;
static AccessibleEventListener *text_listener;
static AccessibleKeystrokeListener *command_key_listener;
focus_listener = SPI_createAccessibleEventListener (report_focus_event, NULL);
property_listener = SPI_createAccessibleEventListener (check_property_change, NULL);
generic_listener = SPI_createAccessibleEventListener (report_generic_event, NULL);
+ window_listener = SPI_createAccessibleEventListener (report_window_event, NULL);
text_listener = SPI_createAccessibleEventListener (report_text_event, NULL);
button_listener = SPI_createAccessibleEventListener (report_button_press, NULL);
SPI_registerGlobalEventListener (focus_listener, "focus:");
SPI_registerGlobalEventListener (text_listener, "object:text-caret-moved");
SPI_registerGlobalEventListener (generic_listener, "object:text-changed");
SPI_registerGlobalEventListener (button_listener, "Gtk:GtkWidget:button-press-event");
+ SPI_registerGlobalEventListener (window_listener, "Gtk:GtkWidget:window-state-event");
n_desktops = SPI_getDesktopCount ();
for (i=0; i<n_desktops; ++i)
}
void
+report_window_event (const AccessibleEvent *event, void *user_data)
+{
+ fprintf (stderr, "%s event received\n", event->type);
+}
+
+void
report_text_event (const AccessibleEvent *event, void *user_data)
{
AccessibleText *text = Accessible_getText (event->source);
printf ("destroying/clearing all regions.\n");
magnifier_clear_all_regions ();
break;
+ case 'q':
+ printf ("exiting magnifier.\n");
+ magnifier_exit ();
+ break;
case 'c':
printf ("creating 3x region at 100,100; 300x200\n");
magnifier_create_region (3.0, 3.0, 100, 100, 400, 300);
&ev);
}
+void
+magnifier_exit (void)
+{
+ Accessibility_Magnifier magnifier = get_magnifier();
+ if (magnifier)
+ Accessibility_Magnifier_exit (magnifier, &ev);
+}