{-# LINE 2 "./Graphics/UI/Gtk/Misc/Arrow.chs" #-}
module Graphics.UI.Gtk.Misc.Arrow (
Arrow,
ArrowClass,
castToArrow, gTypeArrow,
toArrow,
ArrowType(..),
ShadowType(..),
arrowNew,
arrowSet,
arrowArrowType,
arrowShadowType,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.Attributes
import System.Glib.Properties
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Types
{-# LINE 80 "./Graphics/UI/Gtk/Misc/Arrow.chs" #-}
import Graphics.UI.Gtk.General.Enums (ArrowType(..), ShadowType(..))
{-# LINE 83 "./Graphics/UI/Gtk/Misc/Arrow.chs" #-}
arrowNew :: ArrowType -> ShadowType -> IO Arrow
arrowNew :: ArrowType -> ShadowType -> IO Arrow
arrowNew ArrowType
arrowType ShadowType
shadowType =
(ForeignPtr Arrow -> Arrow, FinalizerPtr Arrow)
-> IO (Ptr Arrow) -> IO Arrow
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Arrow -> Arrow, FinalizerPtr Arrow)
forall {a}. (ForeignPtr Arrow -> Arrow, FinalizerPtr a)
mkArrow (IO (Ptr Arrow) -> IO Arrow) -> IO (Ptr Arrow) -> IO Arrow
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr Arrow) -> IO (Ptr Widget) -> IO (Ptr Arrow)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr Arrow
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr Arrow) (IO (Ptr Widget) -> IO (Ptr Arrow))
-> IO (Ptr Widget) -> IO (Ptr Arrow)
forall a b. (a -> b) -> a -> b
$
CInt -> CInt -> IO (Ptr Widget)
gtk_arrow_new
{-# LINE 94 "./Graphics/UI/Gtk/Misc/Arrow.chs" #-}
((fromIntegral . fromEnum) arrowType)
((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (ShadowType -> Int) -> ShadowType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShadowType -> Int
forall a. Enum a => a -> Int
fromEnum) ShadowType
shadowType)
arrowSet :: ArrowClass self => self -> ArrowType -> ShadowType -> IO ()
arrowSet :: forall self.
ArrowClass self =>
self -> ArrowType -> ShadowType -> IO ()
arrowSet self
self ArrowType
arrowType ShadowType
shadowType =
(\(Arrow ForeignPtr Arrow
arg1) CInt
arg2 CInt
arg3 -> ForeignPtr Arrow -> (Ptr Arrow -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Arrow
arg1 ((Ptr Arrow -> IO ()) -> IO ()) -> (Ptr Arrow -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Arrow
argPtr1 ->Ptr Arrow -> CInt -> CInt -> IO ()
gtk_arrow_set Ptr Arrow
argPtr1 CInt
arg2 CInt
arg3)
{-# LINE 105 "./Graphics/UI/Gtk/Misc/Arrow.chs" #-}
(toArrow self)
((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (ArrowType -> Int) -> ArrowType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ArrowType -> Int
forall a. Enum a => a -> Int
fromEnum) ArrowType
arrowType)
((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (ShadowType -> Int) -> ShadowType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShadowType -> Int
forall a. Enum a => a -> Int
fromEnum) ShadowType
shadowType)
arrowArrowType :: ArrowClass self => Attr self ArrowType
arrowArrowType :: forall self. ArrowClass self => Attr self ArrowType
arrowArrowType = String -> GType -> Attr self ArrowType
forall gobj enum.
(GObjectClass gobj, Enum enum) =>
String -> GType -> Attr gobj enum
newAttrFromEnumProperty String
"arrow-type"
GType
gtk_arrow_type_get_type
{-# LINE 119 "./Graphics/UI/Gtk/Misc/Arrow.chs" #-}
arrowShadowType :: ArrowClass self => Attr self ShadowType
arrowShadowType :: forall self. ArrowClass self => Attr self ShadowType
arrowShadowType = String -> GType -> Attr self ShadowType
forall gobj enum.
(GObjectClass gobj, Enum enum) =>
String -> GType -> Attr gobj enum
newAttrFromEnumProperty String
"shadow-type"
GType
gtk_shadow_type_get_type
{-# LINE 127 "./Graphics/UI/Gtk/Misc/Arrow.chs" #-}
foreign import ccall unsafe "gtk_arrow_new"
gtk_arrow_new :: (CInt -> (CInt -> (IO (Ptr Widget))))
foreign import ccall safe "gtk_arrow_set"
gtk_arrow_set :: ((Ptr Arrow) -> (CInt -> (CInt -> (IO ()))))
foreign import ccall unsafe "gtk_arrow_type_get_type"
gtk_arrow_type_get_type :: CULong
foreign import ccall unsafe "gtk_shadow_type_get_type"
gtk_shadow_type_get_type :: CULong