예제 #1
0
int main(int argc, gchar **argv)
{
  gint i;
  AtspiAccessible *desktop = NULL;
  AtspiAccessible *app = NULL;
  gchar *app_name = NULL;
  gboolean found = FALSE;

  app_name = parse_args (&argc, &argv);
  if (!app_name) {
    g_print ("ERROR: We only dump the content of a specific app, specify the name\n");
    return 0;
  }

  atspi_init ();

  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);
    if (!g_strcmp0 (atspi_accessible_get_name (app, NULL), app_name)) {
      found = TRUE;
      dump_node_content (app, "  ");
    }
    g_object_unref (app);
  }

  if (!found) {
    g_print ("ERROR: Application \"%s\" not found\n", app_name);
    return 0;
  }

  return 1;
}
예제 #2
0
int
main()
{
  atspi_init ();

  listener = atspi_event_listener_new (on_event, NULL, NULL);
  atspi_event_listener_register (listener, "object:children-changed", NULL);
  child_pid = fork ();
  if (!child_pid)
    execlp ("gedit", "gedit", NULL);
  atspi_event_main ();
  return 0;
}
int main(int argc, gchar **argv)
{
  AtspiEventListener *listener;

  filter_name = parse_args (&argc, &argv);
  if (!filter_name) {
    g_print ("NOTE: Application name to filter not specified. Showing "
             "focus/selection changes for any application.\n");
  }

  atspi_init ();

  listener = atspi_event_listener_new (on_event, NULL, NULL);

  atspi_event_listener_register (listener, "object:state-changed:focused", NULL);
  atspi_event_listener_register (listener, "object:state-changed:selected", NULL);

  atspi_event_main ();

  return 0;
}