Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <atspi/atspi.h>
- #include <stdio.h>
- #include <unistd.h>
- #include <dbus/dbus.h>
- void cb(const AtspiEvent *event, void *user_data)
- {
- printf("test 1.1 \n");
- gint i;
- AtspiAccessible *desktop = NULL;
- AtspiAccessible *app = NULL;
- desktop = atspi_get_desktop (0);
- for (i = 0; i < atspi_accessible_get_child_count (desktop, NULL); i++) {
- app = atspi_accessible_get_child_at_index (desktop, i, NULL);
- g_print ("(Index, application, application_child_count)=(%d,%s,%d)\n",
- i, atspi_accessible_get_name (app, NULL), atspi_accessible_get_child_count (app, NULL));
- g_object_unref (app);
- }
- }
- int main(int argc,char *argv[])
- {
- printf("At-spi-Test: \n");
- int init_error = atspi_init();
- printf("at-spi is initialised-: %d \n",init_error);
- AtspiEventListener* listener= atspi_event_listener_new(cb,NULL,NULL);
- gboolean val = atspi_event_listener_register (listener,"focus:",NULL);
- printf("val--> %d \n",val);
- val = atspi_event_listener_register (listener,"window:",NULL);
- val = atspi_event_listener_register (listener,"window:minimize",NULL);
- atspi_event_main ();
- return 0;
- }
- /*
- Compile This code using:
- gcc -Wall -I/usr/include/at-spi-2.0/ -I/usr/include/glib-2.0/ -I/usr/include/dbus-1.0 $(pkg-config --cflags glib-2.0 gobject-2.0 atspi-2) test.c -latspi
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement