gi-atk-2.0.18: Atk bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com)
Safe Haskell | None
Language | Haskell2010

GI.Atk.Interfaces.Component

Contents

- Exported types
- Methods
  - contains
  - getAlpha
  - getExtents
  - getLayer
  - getMdiZorder
  - getPosition
  - getSize
  - grabFocus
  - refAccessibleAtPoint
  - removeFocusHandler
  - scrollTo
  - scrollToPoint
  - setExtents
  - setPosition
  - setSize
- Signals
  - boundsChanged

Description

`Component` should be implemented by most if not all UI elements with an actual on-screen presence, i.e. components which can be said to have a screen-coordinate bounding box. Virtually all widgets will need to have `Component` implementations provided for their corresponding `Object` class. In short, only UI elements which are *not* GUI elements will omit this ATK interface.

A possible exception might be textual information with a transparent background, in which case text glyph bounding box information is provided by `Text`.

Synopsis

- newtype Component = Component (ManagedPtr Component)
- noComponent :: Maybe Component
- class GObject o => IsComponent o
- toComponent :: (MonadIO m, IsComponent o) => o -> m Component
- componentContains :: (HasCallStack, MonadIO m, IsComponent a) => a -> Int32 -> Int32 -> CoordType -> m Bool
- componentGetAlpha :: (HasCallStack, MonadIO m, IsComponent a) => a -> m Double
- componentGetExtents :: (HasCallStack, MonadIO m, IsComponent a) => a -> CoordType -> m (Int32, Int32, Int32, Int32)
- componentGetLayer :: (HasCallStack, MonadIO m, IsComponent a) => a -> m Layer
- componentGetMdiZorder :: (HasCallStack, MonadIO m, IsComponent a) => a -> m Int32
- componentGetPosition :: (HasCallStack, MonadIO m, IsComponent a) => a -> CoordType -> m (Int32, Int32)
- componentGetSize :: (HasCallStack, MonadIO m, IsComponent a) => a -> m (Int32, Int32)
- componentGrabFocus :: (HasCallStack, MonadIO m, IsComponent a) => a -> m Bool
- componentRefAccessibleAtPoint :: (HasCallStack, MonadIO m, IsComponent a) => a -> Int32 -> Int32 -> CoordType -> m (Maybe Object)
- componentRemoveFocusHandler :: (HasCallStack, MonadIO m, IsComponent a) => a -> Word32 -> m ()
- componentScrollTo :: (HasCallStack, MonadIO m, IsComponent a) => a -> ScrollType -> m Bool
- componentScrollToPoint :: (HasCallStack, MonadIO m, IsComponent a) => a -> CoordType -> Int32 -> Int32 -> m Bool
- componentSetExtents :: (HasCallStack, MonadIO m, IsComponent a) => a -> Int32 -> Int32 -> Int32 -> Int32 -> CoordType -> m Bool
- componentSetPosition :: (HasCallStack, MonadIO m, IsComponent a) => a -> Int32 -> Int32 -> CoordType -> m Bool
- componentSetSize :: (HasCallStack, MonadIO m, IsComponent a) => a -> Int32 -> Int32 -> m Bool
- type C_ComponentBoundsChangedCallback = Ptr () -> Ptr Rectangle -> Ptr () -> IO ()
- type ComponentBoundsChangedCallback = Rectangle -> IO ()
- afterComponentBoundsChanged :: (IsComponent a, MonadIO m) => a -> ComponentBoundsChangedCallback -> m SignalHandlerId
- genClosure_ComponentBoundsChanged :: ComponentBoundsChangedCallback -> IO Closure
- mk_ComponentBoundsChangedCallback :: C_ComponentBoundsChangedCallback -> IO (FunPtr C_ComponentBoundsChangedCallback)
- noComponentBoundsChangedCallback :: Maybe ComponentBoundsChangedCallback
- onComponentBoundsChanged :: (IsComponent a, MonadIO m) => a -> ComponentBoundsChangedCallback -> m SignalHandlerId
- wrap_ComponentBoundsChangedCallback :: ComponentBoundsChangedCallback -> C_ComponentBoundsChangedCallback

# Exported types

newtype Component Source #

Memory-managed wrapper type.

Constructors

Component (ManagedPtr Component) |

Instances

GObject Component Source # |
Instance details Defined in GI.Atk.Interfaces.Component Methods gobjectType :: Component -> IO GType Source #
IsObject Component Source # |
Instance details Defined in GI.Atk.Interfaces.Component
IsComponent Component Source # |
Instance details Defined in GI.Atk.Interfaces.Component

noComponent :: Maybe Component Source #

A convenience alias for `Nothing` :: `Maybe` `Component`.

class GObject o => IsComponent o Source #

Type class for types which can be safely cast to `Component`, for instance with `toComponent`.

Instances

(GObject a, (UnknownAncestorError Component a :: Constraint)) => IsComponent a Source # |
Instance details Defined in GI.Atk.Interfaces.Component
IsComponent Component Source # |
Instance details Defined in GI.Atk.Interfaces.Component
IsComponent NoOpObject Source # |
Instance details Defined in GI.Atk.Objects.NoOpObject
IsComponent Plug Source # |
Instance details Defined in GI.Atk.Objects.Plug
IsComponent Socket Source # |
Instance details Defined in GI.Atk.Objects.Socket

toComponent :: (MonadIO m, IsComponent o) => o -> m Component Source #

Cast to `Component`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

## contains

componentContains Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: the `Component`
-> Int32 | `x`: x coordinate
-> Int32 | `y`: y coordinate
-> CoordType | `coordType`: specifies whether the coordinates are relative to the screen or to the components top level window
-> m Bool | Returns: `True` or `False` indicating whether the specified point is within the extent of the `component` or not

Checks whether the specified point is within the extent of the `component`.

Toolkit implementor note: ATK provides a default implementation for this virtual method. In general there are little reason to re-implement it.

## getAlpha

componentGetAlpha Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: an `Component`
-> m Double | Returns: An alpha value from 0 to 1.0, inclusive.

Returns the alpha value (i.e. the opacity) for this `component`, on a scale from 0 (fully transparent) to 1.0 (fully opaque).

Since: 1.12

## getExtents

componentGetExtents Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: an `Component`
-> CoordType | `coordType`: specifies whether the coordinates are relative to the screen or to the components top level window
-> m (Int32, Int32, Int32, Int32) |

Gets the rectangle which gives the extent of the `component`.

## getLayer

componentGetLayer Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: an `Component`
-> m Layer | Returns: an `Layer` which is the layer of the component

Gets the layer of the component.

## getMdiZorder

componentGetMdiZorder Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: an `Component`
-> m Int32 | Returns: a gint which is the zorder of the component, i.e. the depth at which the component is shown in relation to other components in the same container.

Gets the zorder of the component. The value G_MININT will be returned if the layer of the component is not ATK_LAYER_MDI or ATK_LAYER_WINDOW.

## getPosition

componentGetPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: an `Component`
-> CoordType | `coordType`: specifies whether the coordinates are relative to the screen or to the components top level window
-> m (Int32, Int32) |

Deprecated: Since 2.12. Use `componentGetExtents` instead.

Gets the position of `component` in the form of a point specifying `component`'s top-left corner.

## getSize

componentGetSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: an `Component`
-> m (Int32, Int32) |

Deprecated: Since 2.12. Use `componentGetExtents` instead.

Gets the size of the `component` in terms of width and height.

## grabFocus

componentGrabFocus Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: an `Component`
-> m Bool | Returns: `True` if successful, `False` otherwise.

Grabs focus for this `component`.

## refAccessibleAtPoint

componentRefAccessibleAtPoint Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: the `Component`
-> Int32 | `x`: x coordinate
-> Int32 | `y`: y coordinate
-> CoordType | `coordType`: specifies whether the coordinates are relative to the screen or to the components top level window
-> m (Maybe Object) | Returns: a reference to the accessible child, if one exists

Gets a reference to the accessible child, if one exists, at the coordinate point specified by `x` and `y`.

## removeFocusHandler

componentRemoveFocusHandler Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: the `Component` to remove the focus handler from
-> Word32 | `handlerId`: the handler id of the focus handler to be removed from `component`
-> m () |

Deprecated: (Since version 2.9.4)If you need to track when an object gains orlose the focus, use the `Object`::`state-change` "focused" notification instead.

Remove the handler specified by `handlerId` from the list of functions to be executed when this object receives focus events (in or out).

## scrollTo

componentScrollTo Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: an `Component`
-> ScrollType | `type`: specify where the object should be made visible.
-> m Bool | Returns: whether scrolling was successful.

Makes `component` visible on the screen by scrolling all necessary parents.

Contrary to atk_component_set_position, this does not actually move `component` in its parent, this only makes the parents scroll so that the object shows up on the screen, given its current position within the parents.

Since: 2.30

## scrollToPoint

componentScrollToPoint Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: an `Component`
-> CoordType | `coords`: specify whether coordinates are relative to the screen or to the parent object.
-> Int32 | `x`: x-position where to scroll to
-> Int32 | `y`: y-position where to scroll to
-> m Bool | Returns: whether scrolling was successful.

Makes an object visible on the screen at a given position by scrolling all necessary parents.

Since: 2.30

## setExtents

componentSetExtents Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: an `Component`
-> Int32 | `x`: x coordinate
-> Int32 | `y`: y coordinate
-> Int32 | `width`: width to set for `component`
-> Int32 | `height`: height to set for `component`
-> CoordType | `coordType`: specifies whether the coordinates are relative to the screen or to the components top level window
-> m Bool | Returns: `True` or `False` whether the extents were set or not

Sets the extents of `component`.

## setPosition

componentSetPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: an `Component`
-> Int32 | `x`: x coordinate
-> Int32 | `y`: y coordinate
-> CoordType | `coordType`: specifies whether the coordinates are relative to the screen or to the component's top level window
-> m Bool | Returns: `True` or `False` whether or not the position was set or not

Sets the position of `component`.

Contrary to atk_component_scroll_to, this does not trigger any scrolling, this just moves `component` in its parent.

## setSize

componentSetSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsComponent a) |
=> a | `component`: an `Component`
-> Int32 | `width`: width to set for `component`
-> Int32 | `height`: height to set for `component`
-> m Bool | Returns: `True` or `False` whether the size was set or not

Set the size of the `component` in terms of width and height.

# Signals

## boundsChanged

type C_ComponentBoundsChangedCallback = Ptr () -> Ptr Rectangle -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type ComponentBoundsChangedCallback Source #

Arguments

= Rectangle | `arg1`: The AtkRectangle giving the new position and size.
-> IO () |

The 'bounds-changed" signal is emitted when the bposition or size of the component changes.

afterComponentBoundsChanged :: (IsComponent a, MonadIO m) => a -> ComponentBoundsChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “`bounds-changed`” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after component #boundsChanged callback

genClosure_ComponentBoundsChanged :: ComponentBoundsChangedCallback -> IO Closure Source #

Wrap the callback into a `Closure`.

mk_ComponentBoundsChangedCallback :: C_ComponentBoundsChangedCallback -> IO (FunPtr C_ComponentBoundsChangedCallback) Source #

Generate a function pointer callable from C code, from a `C_ComponentBoundsChangedCallback`.

noComponentBoundsChangedCallback :: Maybe ComponentBoundsChangedCallback Source #

A convenience synonym for ``Nothing` :: `Maybe` `ComponentBoundsChangedCallback``.

onComponentBoundsChanged :: (IsComponent a, MonadIO m) => a -> ComponentBoundsChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “`bounds-changed`” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on component #boundsChanged callback

wrap_ComponentBoundsChangedCallback :: ComponentBoundsChangedCallback -> C_ComponentBoundsChangedCallback Source #

Wrap a `ComponentBoundsChangedCallback` into a `C_ComponentBoundsChangedCallback`.