Atspi.MatchRule.new
Description: Reference for Atspi.MatchRule.new

### Constructor

# Atspi MatchRulenew

#### Declaration [src]

    AtspiMatchRule*
    atspi_match_rule_new (
      AtspiStateSet* states,
      AtspiCollectionMatchType statematchtype,
      GHashTable* attributes,
      AtspiCollectionMatchType attributematchtype,
      GArray* roles,
      AtspiCollectionMatchType rolematchtype,
      GArray* interfaces,
      AtspiCollectionMatchType interfacematchtype,
      gboolean invert
    )

#### Description [src]

Creates a new `AtspiMatchRule` with specified `states`, `attributes`, `interfaces`, and `roles`.

#### Parameters

`states`

  Type: `AtspiStateSet`

  An `AtspiStateSet` specifying the states to match or NULL if none.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`statematchtype`

  Type: `AtspiCollectionMatchType`

  An `AtspiCollectionMatchType` specifying how to interpret `states`.

`attributes`

  Type: `GHashTable`

  A `GHashTable` specifying attributes to match. To specify multiple attribute values, separate each value with a :: If an attribute value contains a :, then it can be escaped by preceding it with a . A backslash can likewise be escaped by inserting a double backslash.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`attributematchtype`

  Type: `AtspiCollectionMatchType`

  An `AtspiCollectionMatchType` specifying how to interpret `attributes`.

`roles`

  Type: An array of `AtspiRole`

  A `GArray` of roles to match, or NULL if not applicable.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`rolematchtype`

  Type: `AtspiCollectionMatchType`

  An `AtspiCollectionMatchType` specifying how to interpret `roles`.

`interfaces`

  Type: An array of `utf8`

  An array of interfaces to match, or NULL if not applicable. Interface names should be specified by the final component of their DBus names (Accessible, Component, etc). For Action, it is possible to specify an action name by enclosing it in parenthesis after the interface name, in which case only accessibles that implement that particular action will be returned. For instance, Action(click) will return accessibles that provide an action called “click”.

  The argument can be `NULL`.
  The data is owned by the caller of the function.
  Each element is a NUL terminated UTF-8 string.

`interfacematchtype`

  Type: `AtspiCollectionMatchType`

  An `AtspiCollectionMatchType` specifying how to interpret `interfaces`.

`invert`

  Type: `gboolean`

  If `TRUE`, the match rule should be denied (inverted); if `FALSE`, it should not. For example, if the match rule defines that a match is an object of ROLE_HEADING which has STATE_FOCUSABLE and a click action, inverting it would match all objects that are not of ROLE_HEADING, focusable and clickable at the same time.

#### Return value

Type: `AtspiMatchRule`

A new `AtspiMatchRule`.

The caller of the function takes ownership of the data, and is responsible for freeing it.