## atspi-misc atspi-misc |

## Functions

int | atspi_init ()
gboolean | atspi_is_initialized ()
void | atspi_set_timeout ()
void | atspi_set_main_context ()
void | atspi_event_main ()
void | atspi_event_quit ()
int | atspi_exit ()

## Description

## Functions

### atspi_init ()

    int
    atspi_init (void);

Connects to the accessibility registry and initializes the SPI.

#### Returns

0 on success, 1 if already initialized, or an integer error code.

### atspi_is_initialized ()

    gboolean
    atspi_is_initialized (void);

Indicates whether AT-SPI has been initialized.

#### Returns

`True` if initialized; `False` otherwise.

### atspi_set_timeout ()

    void
    atspi_set_timeout (gint val,
                       gint startup_time);

Set the timeout used for method calls. If this is not set explicitly, a default of 0.8 ms is used. Note that at-spi2-registryd currently uses a timeout of 3 seconds when sending a keyboard event notification. This means that, if an AT makes a call in response to the keyboard notification and the application being called does not respond before the timeout is reached, at-spi2-registryd will time out on the keyboard event notification and pass the key onto the application (ie, reply to indicate that the key was not consumed), so this may make it undesirable to set a timeout larger than 3 seconds.

By default, the normal timeout is set to 800 ms, and the application startup timeout is set to 15 seconds.

#### Parameters

val | The timeout value, in milliseconds, or -1 to disable the timeout. |
startup_time | The amount of time, in milliseconds, to allow to pass before enforcing timeouts on an application. Can be used to prevent timeout exceptions if an application is likely to block for an extended period of time on initialization. -1 can be passed to disable this behavior. |

### atspi_set_main_context ()

    void
    atspi_set_main_context (GMainContext *cnx);

Sets the main loop context that AT-SPI should assume is in use when setting an idle callback. This function should be called by application-side implementors (ie, at-spi2-atk) when it is desirable to re-enter the main loop.

#### Parameters

cnx | The GMainContext to use. |

### atspi_event_main ()

    void
    atspi_event_main ();

Starts/enters the main event loop for the AT-SPI services.

NOTE: This method does not return control; it is exited via a call to atspi_event_quit from within an event handler.

### atspi_event_quit ()

    void
    atspi_event_quit ();

Quits the last main event loop for the AT-SPI services, See: atspi_event_main

### atspi_exit ()

    int
    atspi_exit ();

Disconnects from AtspiRegistry instances and releases any floating resources. Call only once at exit.

#### Returns

0 if there were no leaks, otherwise other integer values.