Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The ATK interface provided by UI components which occupy a physical area on the screen. which the user can activate/interact with.
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)
- class (GObject o, IsDescendantOf Component 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 ComponentBoundsChangedCallback = Rectangle -> IO ()
- afterComponentBoundsChanged :: (IsComponent a, MonadIO m) => a -> ((?self :: a) => ComponentBoundsChangedCallback) -> m SignalHandlerId
- onComponentBoundsChanged :: (IsComponent a, MonadIO m) => a -> ((?self :: a) => ComponentBoundsChangedCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq Component Source # | |
GObject Component Source # | |
Defined in GI.Atk.Interfaces.Component | |
ManagedPtrNewtype Component Source # | |
Defined in GI.Atk.Interfaces.Component toManagedPtr :: Component -> ManagedPtr Component | |
TypedObject Component Source # | |
Defined in GI.Atk.Interfaces.Component | |
HasParentTypes Component Source # | |
Defined in GI.Atk.Interfaces.Component | |
IsGValue (Maybe Component) Source # | Convert |
Defined in GI.Atk.Interfaces.Component gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Component -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Component) | |
type ParentTypes Component Source # | |
Defined in GI.Atk.Interfaces.Component type ParentTypes Component = '[Object] |
class (GObject o, IsDescendantOf Component o) => IsComponent o Source #
Type class for types which can be safely cast to Component
, for instance with toComponent
.
Instances
(GObject o, IsDescendantOf Component o) => IsComponent o Source # | |
Defined in GI.Atk.Interfaces.Component |
toComponent :: (MonadIO m, IsComponent o) => o -> m Component Source #
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, contains, forceFloating, freezeNotify, getv, grabFocus, isFloating, notify, notifyByPspec, ref, refAccessibleAtPoint, refSink, removeFocusHandler, runDispose, scrollTo, scrollToPoint, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getAlpha, getData, getExtents, getLayer, getMdiZorder, getPosition, getProperty, getQdata, getSize.
Setters
setData, setDataFull, setExtents, setPosition, setProperty, setSize.
contains
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> CoordType |
|
-> m Bool | Returns: |
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
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> CoordType |
|
-> m (Int32, Int32, Int32, Int32) |
Gets the rectangle which gives the extent of the component
.
If the extent can not be obtained (e.g. a non-embedded plug or missing support), all of x, y, width, height are set to -1.
getLayer
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> m Layer | Returns: an |
Gets the layer of the component.
getMdiZorder
componentGetMdiZorder Source #
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> CoordType |
|
-> 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.
If the position can not be obtained (e.g. a non-embedded plug or missing support), x and y are set to -1.
getSize
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> m (Int32, Int32) |
Deprecated: Since 2.12. Use componentGetExtents
instead.
Gets the size of the component
in terms of width and height.
If the size can not be obtained (e.g. a non-embedded plug or missing support), width and height are set to -1.
grabFocus
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> m Bool |
Grabs focus for this component
.
refAccessibleAtPoint
componentRefAccessibleAtPoint Source #
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> CoordType |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> Word32 |
|
-> m () |
Deprecated: (Since version 2.9.4)If you need to track when an object gains orlose the focus, use the Object::stateChange "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
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> ScrollType |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> CoordType |
|
-> Int32 |
|
-> Int32 |
|
-> m Bool | Returns: whether scrolling was successful. |
Move the top-left of component
to a given position of the screen by
scrolling all necessary parents.
Since: 2.30
setExtents
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> CoordType |
|
-> m Bool |
Sets the extents of component
.
setPosition
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> CoordType |
|
-> m Bool | Returns: |
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
:: (HasCallStack, MonadIO m, IsComponent a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> m Bool |
Set the size of the component
in terms of width and height.
Signals
boundsChanged
type ComponentBoundsChangedCallback Source #
The 'bounds-changed" signal is emitted when the bposition or size of the component changes.
afterComponentBoundsChanged :: (IsComponent a, MonadIO m) => a -> ((?self :: a) => ComponentBoundsChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the boundsChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
component #boundsChanged callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onComponentBoundsChanged :: (IsComponent a, MonadIO m) => a -> ((?self :: a) => ComponentBoundsChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the boundsChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
component #boundsChanged callback