Commit c775e8d4fc1b9776106f23115628e20bd973c939

Authored by samuel thibault
2 parents 58bb96e5 94ee74d1
Exists in master

Merge branch 'upstream-experimental' into debian-experimental

atspi/atspi-component.c
... ... @@ -412,6 +412,63 @@ atspi_component_set_size (AtspiComponent *obj,
412 412 return ret;
413 413 }
414 414  
  415 +/**
  416 + * atspi_component_scroll_to:
  417 + * @obj: a pointer to the #AtspiComponent object on which to operate.
  418 + * @type: a #AtspiScrollType indicating where the object should be placed on the
  419 + * screen.
  420 + *
  421 + * Scrolls whatever container of the #AtspiComponent object so it becomes
  422 + * visible on the screen.
  423 + *
  424 + * Returns: #TRUE if successful, #FALSE otherwise.
  425 + **/
  426 +gboolean
  427 +atspi_component_scroll_to (AtspiComponent *obj,
  428 + AtspiScrollType type,
  429 + GError **error)
  430 +{
  431 + dbus_bool_t retval = FALSE;
  432 +
  433 + g_return_val_if_fail (obj != NULL, FALSE);
  434 +
  435 + _atspi_dbus_call (obj, atspi_interface_component,
  436 + "ScrollTo", error, "u=>b", type, &retval);
  437 +
  438 + return retval;
  439 +}
  440 +
  441 +/**
  442 + * atspi_component_scroll_to_point:
  443 + * @obj: a pointer to the #AtspiComponent object on which to operate.
  444 + * @coords: a #AtspiCoordType indicating whether the coordinates are relative to
  445 + * the screen, to the window, or to the parent object.
  446 + * @x: the x coordinate of the point to reach
  447 + * @y: the y coordinate of the point to reach
  448 + * @error: return location for a #GError
  449 + *
  450 + * Scrolls whatever container of the #AtspiComponent object so it becomes
  451 + * visible on the screen at a given position.
  452 + *
  453 + * Returns: #TRUE if successful, #FALSE otherwise.
  454 + **/
  455 +gboolean
  456 +atspi_component_scroll_to_point (AtspiComponent *obj,
  457 + AtspiCoordType coords,
  458 + gint x,
  459 + gint y,
  460 + GError **error)
  461 +{
  462 + dbus_bool_t retval = FALSE;
  463 +
  464 + g_return_val_if_fail (obj != NULL, FALSE);
  465 +
  466 + _atspi_dbus_call (obj, atspi_interface_component,
  467 + "ScrollToPoint", error, "uii=>b", coords, x, y, &retval);
  468 +
  469 + return retval;
  470 +}
  471 +
415 472 static void
416 473 atspi_component_base_init (AtspiComponent *klass)
417 474 {
... ...
atspi/atspi-component.h
... ... @@ -107,6 +107,10 @@ gboolean atspi_component_set_position (AtspiComponent *obj, gint x, gint y, Atsp
107 107  
108 108 gboolean atspi_component_set_size (AtspiComponent *obj, gint width, gint height, GError **error);
109 109  
  110 +gboolean atspi_component_scroll_to (AtspiComponent *obj, AtspiScrollType type, GError **error);
  111 +
  112 +gboolean atspi_component_scroll_to_point (AtspiComponent *obj, AtspiCoordType coords, gint x, gint y, GError **error);
  113 +
110 114 G_END_DECLS
111 115  
112 116 #endif /* _ATSPI_COMPONENT_H_ */
... ...
atspi/atspi-constants.h
... ... @@ -53,6 +53,8 @@
53 53 Accessibility::StateType\n
54 54 Accessibility::Event\n
55 55 Accessibility::EventDetails \n
  56 + Accessibility::ScrollType \n
  57 + Accessibility::CoordType \n
56 58  
57 59 \section Registry
58 60 Accessibility also includes Accessibility::Registry,
... ... @@ -124,8 +126,10 @@ typedef enum {
124 126 /**
125 127 * AtspiCoordType:
126 128 * @ATSPI_COORD_TYPE_SCREEN: Specifies xy coordinates relative to the screen.
127   - * @ATSPI_COORD_TYPE_WINDOW: Specifies xy coordinates relative to the widget's
  129 + * @ATSPI_COORD_TYPE_WINDOW: Specifies xy coordinates relative to the widget's
128 130 * top-level window.
  131 + * @ATSPI_COORD_TYPE_PARENT: Specifies xy coordinates relative to the widget's
  132 + * immediate parent.
129 133 *
130 134 * Enumeration used by #AtspiComponent, #AtspiImage, and #AtspiText interfaces
131 135 * to specify whether coordinates are relative to the window or the screen.
... ... @@ -134,6 +138,7 @@ typedef enum {
134 138 typedef enum {
135 139 ATSPI_COORD_TYPE_SCREEN,
136 140 ATSPI_COORD_TYPE_WINDOW,
  141 + ATSPI_COORD_TYPE_PARENT,
137 142 } AtspiCoordType;
138 143  
139 144 /**
... ... @@ -141,7 +146,7 @@ typedef enum {
141 146 *
142 147 * One higher than the highest valid value of #AtspiCoordType.
143 148 **/
144   -#define ATSPI_COORD_TYPE_COUNT (1+1)
  149 +#define ATSPI_COORD_TYPE_COUNT (2+1)
145 150  
146 151 /**
147 152 * AtspiCollectionSortOrder:
... ... @@ -1383,6 +1388,43 @@ typedef enum
1383 1388 ATSPI_CACHE_UNDEFINED = 0x40000000,
1384 1389 } AtspiCache;
1385 1390  
  1391 +/**
  1392 + * AtspiScrollType:
  1393 + * @ATSPI_SCROLL_TOP_LEFT: Scroll the object to the top left corner of the
  1394 + * window.
  1395 + * @ATSPI_SCROLL_BOTTOM_RIGHT: Scroll the object to the bottom right corner of
  1396 + * the window.
  1397 + * @ATSPI_SCROLL_TOP_EDGE: Scroll the object to the top edge of the window.
  1398 + * @ATSPI_SCROLL_BOTTOM_EDGE: Scroll the object to the bottom edge of the
  1399 + * window.
  1400 + * @ATSPI_SCROLL_LEFT_EDGE: Scroll the object to the left edge of the
  1401 + * window.
  1402 + * @ATSPI_SCROLL_RIGHT_EDGE: Scroll the object to the right edge of the
  1403 + * window.
  1404 + * @ATSPI_SCROLL_ANYWHERE: Scroll the object to application-dependent position
  1405 + * on the window.
  1406 + *
  1407 + * Enumeration used by interface #AtspiAccessible to specify where an
  1408 + * #AtspiAccessible object should be placed on the screen when using scroll_to.
  1409 + *
  1410 + */
  1411 +typedef enum {
  1412 + ATSPI_SCROLL_TOP_LEFT,
  1413 + ATSPI_SCROLL_BOTTOM_RIGHT,
  1414 + ATSPI_SCROLL_TOP_EDGE,
  1415 + ATSPI_SCROLL_BOTTOM_EDGE,
  1416 + ATSPI_SCROLL_LEFT_EDGE,
  1417 + ATSPI_SCROLL_RIGHT_EDGE,
  1418 + ATSPI_SCROLL_ANYWHERE
  1419 +} AtspiScrollType;
  1420 +
  1421 +/**
  1422 + * ATSPI_SCROLLTYPE_COUNT:
  1423 + *
  1424 + * One higher than the highest valid value of #AtspiScrollType.
  1425 + */
  1426 +#define ATSPI_SCROLLTYPE_COUNT (6+1)
  1427 +
1386 1428 #define ATSPI_DBUS_NAME_REGISTRY "org.a11y.atspi.Registry"
1387 1429 #define ATSPI_DBUS_PATH_REGISTRY "/org/a11y/atspi/registry"
1388 1430 #define ATSPI_DBUS_INTERFACE_REGISTRY "org.a11y.atspi.Registry"
... ...
atspi/atspi-gmain.c
... ... @@ -33,7 +33,7 @@
33 33 #define _(x) dgettext (GETTEXT_PACKAGE, x)
34 34 #define N_(x) x
35 35  
36   -/**
  36 +/*
37 37 * DBusGMessageQueue:
38 38 * A GSource subclass for dispatching DBusConnection messages.
39 39 * We need this on top of the IO handlers, because sometimes
... ... @@ -41,8 +41,8 @@
41 41 */
42 42 typedef struct
43 43 {
44   - GSource source; /**< the parent GSource */
45   - DBusConnection *connection; /**< the connection to dispatch */
  44 + GSource source; /* the parent GSource */
  45 + DBusConnection *connection; /* the connection to dispatch */
46 46 } DBusGMessageQueue;
47 47  
48 48 static gboolean message_queue_prepare (GSource *source,
... ... @@ -95,11 +95,11 @@ message_queue_dispatch (GSource *source,
95 95  
96 96 typedef struct
97 97 {
98   - GMainContext *context; /**< the main context */
99   - GSList *ios; /**< all IOHandler */
100   - GSList *timeouts; /**< all TimeoutHandler */
101   - DBusConnection *connection; /**< NULL if this is really for a server not a connection */
102   - GSource *message_queue_source; /**< DBusGMessageQueue */
  98 + GMainContext *context; /* the main context */
  99 + GSList *ios; /* all IOHandler */
  100 + GSList *timeouts; /* all TimeoutHandler */
  101 + DBusConnection *connection; /* NULL if this is really for a server not a connection */
  102 + GSource *message_queue_source; /* DBusGMessageQueue */
103 103 } ConnectionSetup;
104 104  
105 105  
... ... @@ -510,7 +510,7 @@ connection_setup_new_from_old (GMainContext *context,
510 510 return cs;
511 511 }
512 512  
513   -/** @} */ /* End of GLib bindings internals */
  513 +/* @} */ /* End of GLib bindings internals */
514 514  
515 515 /**
516 516 * atspi_dbus_connection_setup_with_g_main: (skip)
... ...
atspi/meson.build
... ... @@ -90,7 +90,8 @@ if have_gir
90 90  
91 91 gir_extra_args = [
92 92 '--c-include=atspi/atspi.h',
93   - '--pkg-export=atspi-2'
  93 + '--pkg-export=atspi-2',
  94 + '--quiet',
94 95 ]
95 96  
96 97 gir_dir = join_paths(atspi_datadir, 'gir-1.0')
... ...
bus/at-spi-bus-launcher.c
... ... @@ -2,7 +2,7 @@
2 2 *
3 3 * at-spi-bus-launcher: Manage the a11y bus as a child process
4 4 *
5   - * Copyright 2011 Red Hat, Inc.
  5 + * Copyright 2011-2018 Red Hat, Inc.
6 6 *
7 7 * This library is free software; you can redistribute it and/or
8 8 * modify it under the terms of the GNU Library General Public
... ... @@ -25,6 +25,11 @@
25 25 #include <unistd.h>
26 26 #include <string.h>
27 27 #include <signal.h>
  28 +#ifdef __linux
  29 +#include <sys/prctl.h>
  30 +#include <sys/socket.h>
  31 +#include <sys/un.h>
  32 +#endif
28 33 #include <sys/wait.h>
29 34 #include <errno.h>
30 35 #include <stdio.h>
... ... @@ -50,6 +55,7 @@ typedef struct {
50 55 GDBusConnection *session_bus;
51 56 GSettings *a11y_schema;
52 57 GSettings *interface_schema;
  58 + int name_owner_id;
53 59  
54 60 GDBusProxy *client_proxy;
55 61  
... ... @@ -58,6 +64,7 @@ typedef struct {
58 64 int a11y_bus_pid;
59 65 char *a11y_bus_address;
60 66 int pipefd[2];
  67 + int listenfd;
61 68 char *a11y_launch_error_message;
62 69 } A11yBusLauncher;
63 70  
... ... @@ -215,23 +222,6 @@ name_appeared_handler (GDBusConnection *connection,
215 222 register_client (app);
216 223 }
217 224  
218   -static void
219   -setup_bus_child (gpointer data)
220   -{
221   - A11yBusLauncher *app = data;
222   - (void) app;
223   -
224   - close (app->pipefd[0]);
225   - dup2 (app->pipefd[1], 3);
226   - close (app->pipefd[1]);
227   -
228   - /* On Linux, tell the bus process to exit if this process goes away */
229   -#ifdef __linux
230   -#include <sys/prctl.h>
231   - prctl (PR_SET_PDEATHSIG, 15);
232   -#endif
233   -}
234   -
235 225 /**
236 226 * unix_read_all_fd_to_string:
237 227 *
... ... @@ -276,24 +266,30 @@ on_bus_exited (GPid pid,
276 266 g_main_loop_quit (app->loop);
277 267 }
278 268  
  269 +#ifdef DBUS_DAEMON
  270 +static void
  271 +setup_bus_child_daemon (gpointer data)
  272 +{
  273 + A11yBusLauncher *app = data;
  274 + (void) app;
  275 +
  276 + close (app->pipefd[0]);
  277 + dup2 (app->pipefd[1], 3);
  278 + close (app->pipefd[1]);
  279 +
  280 + /* On Linux, tell the bus process to exit if this process goes away */
  281 +#ifdef __linux
  282 + prctl (PR_SET_PDEATHSIG, 15);
  283 +#endif
  284 +}
  285 +
279 286 static gboolean
280   -ensure_a11y_bus (A11yBusLauncher *app)
  287 +ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path)
281 288 {
  289 + char *argv[] = { DBUS_DAEMON, config_path, "--nofork", "--print-address", "3", NULL };
282 290 GPid pid;
283   - char *argv[] = { DBUS_DAEMON, NULL, "--nofork", "--print-address", "3", NULL };
284 291 char addr_buf[2048];
285 292 GError *error = NULL;
286   - const char *config_path = NULL;
287   -
288   - if (app->a11y_bus_pid != 0)
289   - return FALSE;
290   -
291   - if (g_file_test (SYSCONFDIR"/at-spi2/accessibility.conf", G_FILE_TEST_EXISTS))
292   - config_path = "--config-file="SYSCONFDIR"/at-spi2/accessibility.conf";
293   - else
294   - config_path = "--config-file="DATADIR"/defaults/at-spi2/accessibility.conf";
295   -
296   - argv[1] = config_path;
297 293  
298 294 if (pipe (app->pipefd) < 0)
299 295 g_error ("Failed to create pipe: %s", strerror (errno));
... ... @@ -302,7 +298,7 @@ ensure_a11y_bus (A11yBusLauncher *app)
302 298 argv,
303 299 NULL,
304 300 G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
305   - setup_bus_child,
  301 + setup_bus_child_daemon,
306 302 app,
307 303 &pid,
308 304 &error))
... ... @@ -335,6 +331,136 @@ ensure_a11y_bus (A11yBusLauncher *app)
335 331 app->a11y_bus_address = g_strchomp (g_strdup (addr_buf));
336 332 g_debug ("a11y bus address: %s", app->a11y_bus_address);
337 333  
  334 + return TRUE;
  335 +
  336 +error:
  337 + close (app->pipefd[0]);
  338 + close (app->pipefd[1]);
  339 + app->state = A11Y_BUS_STATE_ERROR;
  340 +
  341 + return FALSE;
  342 +}
  343 +#else
  344 +static gboolean
  345 +ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path)
  346 +{
  347 + return FALSE;
  348 +}
  349 +#endif
  350 +
  351 +#ifdef DBUS_BROKER
  352 +static void
  353 +setup_bus_child_broker (gpointer data)
  354 +{
  355 + A11yBusLauncher *app = data;
  356 + gchar *pid_str;
  357 + (void) app;
  358 +
  359 + dup2 (app->listenfd, 3);
  360 + close (app->listenfd);
  361 + g_setenv("LISTEN_FDS", "1", TRUE);
  362 +
  363 + pid_str = g_strdup_printf("%u", getpid());
  364 + g_setenv("LISTEN_PID", pid_str, TRUE);
  365 + g_free(pid_str);
  366 +
  367 + /* Tell the bus process to exit if this process goes away */
  368 + prctl (PR_SET_PDEATHSIG, SIGTERM);
  369 +}
  370 +
  371 +static gboolean
  372 +ensure_a11y_bus_broker (A11yBusLauncher *app, char *config_path)
  373 +{
  374 + char *argv[] = { DBUS_BROKER, config_path, "--scope", "user", NULL };
  375 + struct sockaddr_un addr = { .sun_family = AF_UNIX };
  376 + socklen_t addr_len = sizeof(addr);
  377 + GPid pid;
  378 + GError *error = NULL;
  379 +
  380 + if ((app->listenfd = socket (PF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0)) < 0)
  381 + g_error ("Failed to create listening socket: %s", strerror (errno));
  382 +
  383 + if (bind (app->listenfd, (struct sockaddr *)&addr, sizeof(sa_family_t)) < 0)
  384 + g_error ("Failed to bind listening socket: %s", strerror (errno));
  385 +
  386 + if (getsockname (app->listenfd, (struct sockaddr *)&addr, &addr_len) < 0)
  387 + g_error ("Failed to get socket name for listening socket: %s", strerror(errno));
  388 +
  389 + if (listen (app->listenfd, 1024) < 0)
  390 + g_error ("Failed to listen on socket: %s", strerror(errno));
  391 +
  392 + if (!g_spawn_async (NULL,
  393 + argv,
  394 + NULL,
  395 + G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
  396 + setup_bus_child_broker,
  397 + app,
  398 + &pid,
  399 + &error))
  400 + {
  401 + app->a11y_bus_pid = -1;
  402 + app->a11y_launch_error_message = g_strdup (error->message);
  403 + g_clear_error (&error);
  404 + goto error;
  405 + }
  406 +
  407 + close (app->listenfd);
  408 + app->listenfd = -1;
  409 +
  410 + g_child_watch_add (pid, on_bus_exited, app);
  411 + app->a11y_bus_pid = pid;
  412 + g_debug ("Launched a11y bus, child is %ld", (long) pid);
  413 + app->state = A11Y_BUS_STATE_RUNNING;
  414 +
  415 + app->a11y_bus_address = g_strconcat("unix:abstract=", addr.sun_path + 1, NULL);
  416 + g_debug ("a11y bus address: %s", app->a11y_bus_address);
  417 +
  418 + return TRUE;
  419 +
  420 +error:
  421 + close (app->listenfd);
  422 + app->state = A11Y_BUS_STATE_ERROR;
  423 +
  424 + return FALSE;
  425 +}
  426 +#else
  427 +static gboolean
  428 +ensure_a11y_bus_broker (A11yBusLauncher *app, char *config_path)
  429 +{
  430 + return FALSE;
  431 +}
  432 +#endif
  433 +
  434 +static gboolean
  435 +ensure_a11y_bus (A11yBusLauncher *app)
  436 +{
  437 + char *config_path = NULL;
  438 + gboolean success = FALSE;
  439 +
  440 + if (app->a11y_bus_pid != 0)
  441 + return FALSE;
  442 +
  443 + if (g_file_test (SYSCONFDIR"/at-spi2/accessibility.conf", G_FILE_TEST_EXISTS))
  444 + config_path = "--config-file="SYSCONFDIR"/at-spi2/accessibility.conf";
  445 + else
  446 + config_path = "--config-file="DATADIR"/defaults/at-spi2/accessibility.conf";
  447 +
  448 +#ifdef WANT_DBUS_BROKER
  449 + success = ensure_a11y_bus_broker (app, config_path);
  450 + if (!success)
  451 + {
  452 + if (!ensure_a11y_bus_daemon (app, config_path))
  453 + return FALSE;
  454 + }
  455 +#else
  456 + success = ensure_a11y_bus_daemon (app, config_path);
  457 + if (!success)
  458 + {
  459 + if (!ensure_a11y_bus_broker (app, config_path))
  460 + return FALSE;
  461 + }
  462 +#endif
  463 +
338 464 #ifdef HAVE_X11
339 465 {
340 466 Display *display = XOpenDisplay (NULL);
... ... @@ -353,13 +479,6 @@ ensure_a11y_bus (A11yBusLauncher *app)
353 479 #endif
354 480  
355 481 return TRUE;
356   -
357   - error:
358   - close (app->pipefd[0]);
359   - close (app->pipefd[1]);
360   - app->state = A11Y_BUS_STATE_ERROR;
361   -
362   - return FALSE;
363 482 }
364 483  
365 484 static void
... ... @@ -695,6 +814,15 @@ already_running ()
695 814 static GSettings *
696 815 get_schema (const gchar *name)
697 816 {
  817 +#if GLIB_CHECK_VERSION (2, 32, 0)
  818 + GSettingsSchemaSource *source = g_settings_schema_source_get_default ();
  819 + GSettingsSchema *schema = g_settings_schema_source_lookup (source, name, FALSE);
  820 +
  821 + if (schema == NULL)
  822 + return NULL;
  823 +
  824 + return g_settings_new_full (schema, NULL, NULL);
  825 +#else
698 826 const char * const *schemas = NULL;
699 827 gint i;
700 828  
... ... @@ -706,13 +834,13 @@ get_schema (const gchar *name)
706 834 }
707 835  
708 836 return NULL;
  837 +#endif
709 838 }
710 839  
711 840 static void
712 841 gsettings_key_changed (GSettings *gsettings, const gchar *key, void *user_data)
713 842 {
714 843 gboolean new_val = g_settings_get_boolean (gsettings, key);
715   - A11yBusLauncher *app = user_data;
716 844  
717 845 if (!strcmp (key, "toolkit-accessibility"))
718 846 handle_a11y_enabled_change (_global_app, new_val, FALSE);
... ... @@ -724,10 +852,6 @@ int
724 852 main (int argc,
725 853 char **argv)
726 854 {
727   - GError *error = NULL;
728   - GMainLoop *loop;
729   - GDBusConnection *session_bus;
730   - int name_owner_id;
731 855 gboolean a11y_set = FALSE;
732 856 gboolean screen_reader_set = FALSE;
733 857 gint i;
... ... @@ -783,14 +907,15 @@ main (int argc,
783 907 introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
784 908 g_assert (introspection_data != NULL);
785 909  
786   - name_owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
787   - "org.a11y.Bus",
788   - G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT,
789   - on_bus_acquired,
790   - on_name_acquired,
791   - on_name_lost,
792   - _global_app,
793   - NULL);
  910 + _global_app->name_owner_id =
  911 + g_bus_own_name (G_BUS_TYPE_SESSION,
  912 + "org.a11y.Bus",
  913 + G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT,
  914 + on_bus_acquired,
  915 + on_name_acquired,
  916 + on_name_lost,
  917 + _global_app,
  918 + NULL);
794 919  
795 920 g_main_loop_run (_global_app->loop);
796 921  
... ...
bus/meson.build
... ... @@ -31,8 +31,13 @@ configure_file(input: &#39;at-spi-dbus-bus.service.in&#39;,
31 31 install: true,
32 32 install_dir: systemd_user_dir)
33 33  
  34 +launcher_args = [
  35 + '-DSYSCONFDIR="@0@"'.format(atspi_sysconfdir),
  36 + '-DDATADIR="@0@"'.format(atspi_datadir),
  37 + ]
  38 +
34 39 if get_option('dbus_daemon') != 'default'
35   - dbus_daemon = get_option('dbus_daemon')
  40 + launcher_args += '-DDBUS_DAEMON="@0@"'.format(get_option('dbus_daemon'))
36 41 else
37 42 dbus_daemon = find_program('dbus-daemon',
38 43 '/sbin/dbus-daemon',
... ... @@ -40,16 +45,29 @@ else
40 45 '/libexec/dbus-daemon',
41 46 '/usr/libexec/dbus-daemon',
42 47 '/usr/pkg/bin/dbus-daemon',
43   - required: true).path()
  48 + required: false)
  49 + if dbus_daemon.found()
  50 + launcher_args += '-DDBUS_DAEMON="@0@"'.format(dbus_daemon.path())
  51 + endif
  52 +endif
  53 +
  54 +if get_option('dbus_broker') != 'default'
  55 + launcher_args += '-DDBUS_BROKER="@0@"'.format(get_option('dbus_broker'))
  56 +else
  57 + dbus_broker = find_program('dbus-broker-launch',
  58 + required: false)
  59 + if dbus_broker.found()
  60 + launcher_args += '-DDBUS_BROKER="@0@"'.format(dbus_broker.path())
  61 + endif
  62 +endif
  63 +
  64 +if get_option('default_bus') == 'dbus-broker'
  65 + launcher_args += '-DWANT_DBUS_BROKER'
44 66 endif
45 67  
46 68 executable('at-spi-bus-launcher', 'at-spi-bus-launcher.c',
47 69 include_directories: [ root_inc, include_directories('.') ],
48 70 dependencies: [ gio_dep, x11_deps ],
49   - c_args: [
50   - '-DSYSCONFDIR="@0@"'.format(atspi_sysconfdir),
51   - '-DDATADIR="@0@"'.format(atspi_datadir),
52   - '-DDBUS_DAEMON="@0@"'.format(dbus_daemon),
53   - ],
  71 + c_args: launcher_args,
54 72 install: true,
55 73 install_dir: atspi_libexecdir)
... ...
dbind/dbtest.c
... ... @@ -27,7 +27,7 @@
27 27 #define DESKICE_PATH "/Novell/ICEDesktop/Daemon"
28 28 #define DESKICE_NAMESPACE "Novell.ICEDesktop.Daemon"
29 29  
30   -void marshal (DBusMessage *msg, char *type, void *ptr)
  30 +void marshal (DBusMessage *msg, const char *type, void *ptr)
31 31 {
32 32 DBusMessageIter iter;
33 33  
... ... @@ -35,7 +35,7 @@ void marshal (DBusMessage *msg, char *type, void *ptr)
35 35 dbind_any_marshal (&iter, &type, &ptr);
36 36 }
37 37  
38   -void demarshal (DBusMessage *msg, char *type, void *ptr)
  38 +void demarshal (DBusMessage *msg, const char *type, void *ptr)
39 39 {
40 40 DBusMessageIter iter;
41 41  
... ... @@ -317,8 +317,8 @@ void test_twovals ()
317 317 DBusMessage *msg;
318 318 DBusMessageIter iter;
319 319 TwoVal i, o;
320   - char *type_twoval = TYPEOF_TWOVAL;
321   - char *type;
  320 + const char *type_twoval = TYPEOF_TWOVAL;
  321 + const char *type;
322 322 void *ptr;
323 323  
324 324 msg = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_CALL);
... ...
doc/libatspi/libatspi-sections.txt
... ... @@ -441,6 +441,8 @@ atspi_component_get_layer
441 441 atspi_component_get_mdi_z_order
442 442 atspi_component_grab_focus
443 443 atspi_component_get_alpha
  444 +atspi_component_scroll_to
  445 +atspi_component_scroll_to_point
444 446 <SUBSECTION Standard>
445 447 ATSPI_COMPONENT
446 448 ATSPI_IS_COMPONENT
... ... @@ -524,6 +526,8 @@ AtspiRelationType
524 526 ATSPI_RELATIONTYPE_COUNT
525 527 AtspiRole
526 528 ATSPI_ROLE_COUNT
  529 +AtspiScrollType
  530 +ATSPI_SCROLLTYPE_COUNT
527 531 </SECTION>
528 532  
529 533 <SECTION>
... ...
doc/libatspi/tmpl/atspi-constants.sgml
... ... @@ -39,6 +39,26 @@ Constant definitions needed by multiple interfaces.
39 39  
40 40  
41 41  
  42 +<!-- ##### ENUM AtspiScrollType ##### -->
  43 +<para>
  44 +
  45 +</para>
  46 +
  47 +@ATSPI_SCROLL_TOP_LEFT:
  48 +@ATSPI_SCROLL_BOTTOM_RIGHT:
  49 +@ATSPI_SCROLL_TOP_EDGE:
  50 +@ATSPI_SCROLL_BOTTOM_EDGE:
  51 +@ATSPI_SCROLL_LEFT_EDGE:
  52 +@ATSPI_SCROLL_RIGHT_EDGE:
  53 +@ATSPI_SCROLL_ANYWHERE:
  54 +
  55 +<!-- ##### MACRO ATSPI_SCROLLTYPE_COUNT ##### -->
  56 +<para>
  57 +
  58 +</para>
  59 +
  60 +
  61 +
42 62 <!-- ##### ENUM AtspiCoordType ##### -->
43 63 <para>
44 64  
... ... @@ -46,6 +66,7 @@ Constant definitions needed by multiple interfaces.
46 66  
47 67 @ATSPI_COORD_TYPE_SCREEN:
48 68 @ATSPI_COORD_TYPE_WINDOW:
  69 +@ATSPI_COORD_TYPE_PARENT:
49 70  
50 71 <!-- ##### MACRO ATSPI_COORD_TYPE_COUNT ##### -->
51 72 <para>
... ...
idl/component.didl
... ... @@ -54,7 +54,30 @@ interface org.freestandards.atspi.Component {
54 54 LAYER_WINDOW,
55 55 LAYER_LAST_DEFINED
56 56 }
57   -
  57 +
  58 + /*
  59 + Describes where the object should be placed on the window.
  60 + */
  61 + enum uint32 ScrollType {
  62 + SCROLL_TOP_LEFT = 0,
  63 + SCROLL_BOTTOM_RIGHT,
  64 + SCROLL_TOP_EDGE,
  65 + SCROLL_BOTTOM_EDGE,
  66 + SCROLL_LEFT_EDGE,
  67 + SCROLL_RIGHT_EDGE,
  68 + SCROLL_ANYWHERE
  69 + }
  70 +
  71 + /*
  72 + Specifies whether the coordinates are relative to the screen, to the
  73 + window, or to the parent object.
  74 + */
  75 + enum uint32 CoordType {
  76 + COORD_TYPE_SCREEN = 0,
  77 + COORD_TYPE_WINDOW,
  78 + COORD_TYPE_PARENT
  79 + }
  80 +
58 81 /*
59 82 True if the specified point lies within the components bounding box.
60 83 */
... ... @@ -136,4 +159,20 @@ interface org.freestandards.atspi.Component {
136 159 method GetAlpha reply {
137 160 double alpha;
138 161 }
  162 +
  163 + /*
  164 + Scroll this object so it becomes visible on the screen.
  165 + */
  166 + method ScrollTo {
  167 + ScrollType type;
  168 + }
  169 +
  170 + /*
  171 + Scroll this object so it becomes visible on the screen at a given position.
  172 + */
  173 + method ScrollToPoint {
  174 + CoordType type;
  175 + int32 x;
  176 + int32 y;
  177 + }
139 178 }
... ...
meson.build
1 1 project('at-spi2-core', 'c',
2   - version: '2.28.0',
  2 + version: '2.29.1',
3 3 license: 'LGPLv2.1+',
4 4 default_options: [
5 5 'buildtype=debugoptimized',
... ...
meson_options.txt
... ... @@ -6,6 +6,15 @@ option(&#39;dbus_daemon&#39;,
6 6 description: 'The path of the DBus daemon',
7 7 type: 'string',
8 8 value: 'default')
  9 +option('dbus_broker',
  10 + description: 'The path of the DBus broker',
  11 + type: 'string',
  12 + value: 'default')
  13 +option('default_bus',
  14 + description: 'The default DBus implementation to use',
  15 + type: 'combo',
  16 + choices: ['dbus-daemon', 'dbus-broker'],
  17 + value: 'dbus-daemon')
9 18 option('systemd_user_dir',
10 19 description: 'Location of the systemd user services',
11 20 type: 'string',
... ...
registryd/deviceeventcontroller-x11.c
... ... @@ -1018,8 +1018,10 @@ spi_dec_x11_synth_keycode_press (SpiDEController *controller,
1018 1018 {
1019 1019 unsigned int time = CurrentTime;
1020 1020 unsigned int bounce_delay;
  1021 +#ifdef THIS_IS_BROKEN
1021 1022 unsigned int elapsed_msec;
1022 1023 struct timeval tv;
  1024 +#endif
1023 1025 DEControllerPrivateData *priv = controller->priv;
1024 1026  
1025 1027 spi_x_error_trap ();
... ... @@ -1028,15 +1030,15 @@ spi_dec_x11_synth_keycode_press (SpiDEController *controller,
1028 1030 bounce_delay = xkb_get_bouncekeys_delay (controller);
1029 1031 if (bounce_delay)
1030 1032 {
  1033 +#ifdef THIS_IS_BROKEN
1031 1034 gettimeofday (&tv, NULL);
1032 1035 elapsed_msec =
1033 1036 (tv.tv_sec - priv->last_release_time.tv_sec) * 1000
1034 1037 + (tv.tv_usec - priv->last_release_time.tv_usec) / 1000;
1035   -#ifdef SPI_XKB_DEBUG
  1038 +# ifdef SPI_XKB_DEBUG
1036 1039 fprintf (stderr, "%d ms elapsed (%ld usec)\n", elapsed_msec,
1037 1040 (long) (tv.tv_usec - priv->last_release_time.tv_usec));
1038   -#endif
1039   -#ifdef THIS_IS_BROKEN
  1041 +# endif
1040 1042 if (elapsed_msec < bounce_delay)
1041 1043 time = bounce_delay - elapsed_msec + 1;
1042 1044 #else
... ... @@ -1062,8 +1064,10 @@ spi_dec_x11_synth_keycode_release (SpiDEController *controller,
1062 1064 {
1063 1065 unsigned int time = CurrentTime;
1064 1066 unsigned int slow_delay;
  1067 +#ifdef THIS_IS_BROKEN_DUNNO_WHY
1065 1068 unsigned int elapsed_msec;
1066 1069 struct timeval tv;
  1070 +#endif
1067 1071 DEControllerPrivateData *priv = controller->priv;
1068 1072  
1069 1073 spi_x_error_trap ();
... ... @@ -1072,15 +1076,15 @@ spi_dec_x11_synth_keycode_release (SpiDEController *controller,
1072 1076 slow_delay = xkb_get_slowkeys_delay (controller);
1073 1077 if (slow_delay)
1074 1078 {
  1079 +#ifdef THIS_IS_BROKEN_DUNNO_WHY
1075 1080 gettimeofday (&tv, NULL);
1076 1081 elapsed_msec =
1077 1082 (tv.tv_sec - priv->last_press_time.tv_sec) * 1000
1078 1083 + (tv.tv_usec - priv->last_press_time.tv_usec) / 1000;
1079   -#ifdef SPI_XKB_DEBUG
  1084 +# ifdef SPI_XKB_DEBUG
1080 1085 fprintf (stderr, "%d ms elapsed (%ld usec)\n", elapsed_msec,
1081 1086 (long) (tv.tv_usec - priv->last_press_time.tv_usec));
1082   -#endif
1083   -#ifdef THIS_IS_BROKEN_DUNNO_WHY
  1087 +# endif
1084 1088 if (elapsed_msec < slow_delay)
1085 1089 time = slow_delay - elapsed_msec + 1;
1086 1090 #else
... ...
registryd/reentrant-list.c
... ... @@ -45,7 +45,7 @@ spi_re_entrant_list_delete_link (GList * const *element_ptr)
45 45 GList *next;
46 46 GList *element;
47 47 gboolean first_item;
48   - GList *dummy; /* suppress warning */
  48 + GList *dummy G_GNUC_UNUSED;
49 49  
50 50 g_return_if_fail (element_ptr != NULL);
51 51  
... ...
xml/Component.xml
... ... @@ -72,5 +72,15 @@
72 72 <arg direction="out" type="b"/>
73 73 </method>
74 74  
  75 + <method name="ScrollTo">
  76 + <arg direction="in" name="type" type="u"/>
  77 + </method>
  78 +
  79 + <method name="ScrollToPoint">
  80 + <arg direction="in" name="type" type="u"/>
  81 + <arg direction="in" name="x" type="i"/>
  82 + <arg direction="in" name="y" type="i"/>
  83 + </method>
  84 +
75 85 </interface>
76 86 </node>
... ...