Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
Defines the position and size of a rectangle. It is identical to
RectangleInt
.
Synopsis
- newtype Rectangle = Rectangle (ManagedPtr Rectangle)
- newZeroRectangle :: MonadIO m => m Rectangle
- rectangleEqual :: (HasCallStack, MonadIO m) => Rectangle -> Rectangle -> m Bool
- rectangleIntersect :: (HasCallStack, MonadIO m) => Rectangle -> Rectangle -> m (Bool, Rectangle)
- rectangleUnion :: (HasCallStack, MonadIO m) => Rectangle -> Rectangle -> m Rectangle
- getRectangleHeight :: MonadIO m => Rectangle -> m Int32
- setRectangleHeight :: MonadIO m => Rectangle -> Int32 -> m ()
- getRectangleWidth :: MonadIO m => Rectangle -> m Int32
- setRectangleWidth :: MonadIO m => Rectangle -> Int32 -> m ()
- getRectangleX :: MonadIO m => Rectangle -> m Int32
- setRectangleX :: MonadIO m => Rectangle -> Int32 -> m ()
- getRectangleY :: MonadIO m => Rectangle -> m Int32
- setRectangleY :: MonadIO m => Rectangle -> Int32 -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Rectangle Source # | |
GBoxed Rectangle Source # | |
Defined in GI.Gdk.Structs.Rectangle | |
ManagedPtrNewtype Rectangle Source # | |
Defined in GI.Gdk.Structs.Rectangle toManagedPtr :: Rectangle -> ManagedPtr Rectangle | |
TypedObject Rectangle Source # | |
Defined in GI.Gdk.Structs.Rectangle glibType :: IO GType | |
IsGValue Rectangle Source # | Convert |
Defined in GI.Gdk.Structs.Rectangle toGValue :: Rectangle -> IO GValue fromGValue :: GValue -> IO Rectangle | |
HasParentTypes Rectangle Source # | |
Defined in GI.Gdk.Structs.Rectangle | |
tag ~ 'AttrSet => Constructible Rectangle tag Source # | |
type ParentTypes Rectangle Source # | |
Defined in GI.Gdk.Structs.Rectangle type ParentTypes Rectangle = '[] :: [Type] |
newZeroRectangle :: MonadIO m => m Rectangle Source #
Construct a Rectangle
struct initialized to zero.
Methods
Overloaded methods
equal
:: (HasCallStack, MonadIO m) | |
=> Rectangle |
|
-> Rectangle |
|
-> m Bool | Returns: |
Checks if the two given rectangles are equal.
Since: 3.20
intersect
:: (HasCallStack, MonadIO m) | |
=> Rectangle |
|
-> Rectangle |
|
-> m (Bool, Rectangle) | Returns: |
Calculates the intersection of two rectangles. It is allowed for
dest
to be the same as either src1
or src2
. If the rectangles
do not intersect, dest
’s width and height is set to 0 and its x
and y values are undefined. If you are only interested in whether
the rectangles intersect, but not in the intersecting area itself,
pass Nothing
for dest
.
union
:: (HasCallStack, MonadIO m) | |
=> Rectangle |
|
-> Rectangle |
|
-> m Rectangle |
Calculates the union of two rectangles.
The union of rectangles src1
and src2
is the smallest rectangle which
includes both src1
and src2
within it.
It is allowed for dest
to be the same as either src1
or src2
.
Note that this function does not ignore 'empty' rectangles (ie. with zero width or height).
Properties
height
No description available in the introspection data.
getRectangleHeight :: MonadIO m => Rectangle -> m Int32 Source #
Get the value of the “height
” field.
When overloading is enabled, this is equivalent to
get
rectangle #height
setRectangleHeight :: MonadIO m => Rectangle -> Int32 -> m () Source #
Set the value of the “height
” field.
When overloading is enabled, this is equivalent to
set
rectangle [ #height:=
value ]
width
No description available in the introspection data.
getRectangleWidth :: MonadIO m => Rectangle -> m Int32 Source #
Get the value of the “width
” field.
When overloading is enabled, this is equivalent to
get
rectangle #width
setRectangleWidth :: MonadIO m => Rectangle -> Int32 -> m () Source #
Set the value of the “width
” field.
When overloading is enabled, this is equivalent to
set
rectangle [ #width:=
value ]
x
No description available in the introspection data.
getRectangleX :: MonadIO m => Rectangle -> m Int32 Source #
Get the value of the “x
” field.
When overloading is enabled, this is equivalent to
get
rectangle #x
setRectangleX :: MonadIO m => Rectangle -> Int32 -> m () Source #
Set the value of the “x
” field.
When overloading is enabled, this is equivalent to
set
rectangle [ #x:=
value ]
y
No description available in the introspection data.
getRectangleY :: MonadIO m => Rectangle -> m Int32 Source #
Get the value of the “y
” field.
When overloading is enabled, this is equivalent to
get
rectangle #y
setRectangleY :: MonadIO m => Rectangle -> Int32 -> m () Source #
Set the value of the “y
” field.
When overloading is enabled, this is equivalent to
set
rectangle [ #y:=
value ]