{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Interfaces.Orientable
(
Orientable(..) ,
noOrientable ,
IsOrientable ,
toOrientable ,
#if defined(ENABLE_OVERLOADING)
ResolveOrientableMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
OrientableGetOrientationMethodInfo ,
#endif
orientableGetOrientation ,
#if defined(ENABLE_OVERLOADING)
OrientableSetOrientationMethodInfo ,
#endif
orientableSetOrientation ,
#if defined(ENABLE_OVERLOADING)
OrientableOrientationPropertyInfo ,
#endif
constructOrientableOrientation ,
getOrientableOrientation ,
#if defined(ENABLE_OVERLOADING)
orientableOrientation ,
#endif
setOrientableOrientation ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
newtype Orientable = Orientable (ManagedPtr Orientable)
deriving (Eq)
noOrientable :: Maybe Orientable
noOrientable = Nothing
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Orientable = OrientableSignalList
type OrientableSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_orientable_get_type"
c_gtk_orientable_get_type :: IO GType
instance GObject Orientable where
gobjectType = c_gtk_orientable_get_type
instance B.GValue.IsGValue Orientable where
toGValue o = do
gtype <- c_gtk_orientable_get_type
B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_object)
fromGValue gv = do
ptr <- B.GValue.get_object gv :: IO (Ptr Orientable)
B.ManagedPtr.newObject Orientable ptr
class (GObject o, O.IsDescendantOf Orientable o) => IsOrientable o
instance (GObject o, O.IsDescendantOf Orientable o) => IsOrientable o
instance O.HasParentTypes Orientable
type instance O.ParentTypes Orientable = '[GObject.Object.Object]
toOrientable :: (MonadIO m, IsOrientable o) => o -> m Orientable
toOrientable = liftIO . unsafeCastTo Orientable
getOrientableOrientation :: (MonadIO m, IsOrientable o) => o -> m Gtk.Enums.Orientation
getOrientableOrientation obj = liftIO $ B.Properties.getObjectPropertyEnum obj "orientation"
setOrientableOrientation :: (MonadIO m, IsOrientable o) => o -> Gtk.Enums.Orientation -> m ()
setOrientableOrientation obj val = liftIO $ B.Properties.setObjectPropertyEnum obj "orientation" val
constructOrientableOrientation :: (IsOrientable o) => Gtk.Enums.Orientation -> IO (GValueConstruct o)
constructOrientableOrientation val = B.Properties.constructObjectPropertyEnum "orientation" val
#if defined(ENABLE_OVERLOADING)
data OrientableOrientationPropertyInfo
instance AttrInfo OrientableOrientationPropertyInfo where
type AttrAllowedOps OrientableOrientationPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint OrientableOrientationPropertyInfo = IsOrientable
type AttrSetTypeConstraint OrientableOrientationPropertyInfo = (~) Gtk.Enums.Orientation
type AttrTransferTypeConstraint OrientableOrientationPropertyInfo = (~) Gtk.Enums.Orientation
type AttrTransferType OrientableOrientationPropertyInfo = Gtk.Enums.Orientation
type AttrGetType OrientableOrientationPropertyInfo = Gtk.Enums.Orientation
type AttrLabel OrientableOrientationPropertyInfo = "orientation"
type AttrOrigin OrientableOrientationPropertyInfo = Orientable
attrGet = getOrientableOrientation
attrSet = setOrientableOrientation
attrTransfer _ v = do
return v
attrConstruct = constructOrientableOrientation
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Orientable
type instance O.AttributeList Orientable = OrientableAttributeList
type OrientableAttributeList = ('[ '("orientation", OrientableOrientationPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
orientableOrientation :: AttrLabelProxy "orientation"
orientableOrientation = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveOrientableMethod (t :: Symbol) (o :: *) :: * where
ResolveOrientableMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveOrientableMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveOrientableMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveOrientableMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveOrientableMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveOrientableMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveOrientableMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveOrientableMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveOrientableMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveOrientableMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveOrientableMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveOrientableMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveOrientableMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveOrientableMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveOrientableMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveOrientableMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveOrientableMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveOrientableMethod "getOrientation" o = OrientableGetOrientationMethodInfo
ResolveOrientableMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveOrientableMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveOrientableMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveOrientableMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveOrientableMethod "setOrientation" o = OrientableSetOrientationMethodInfo
ResolveOrientableMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveOrientableMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveOrientableMethod t Orientable, O.MethodInfo info Orientable p) => OL.IsLabel t (Orientable -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "gtk_orientable_get_orientation" gtk_orientable_get_orientation ::
Ptr Orientable ->
IO CUInt
orientableGetOrientation ::
(B.CallStack.HasCallStack, MonadIO m, IsOrientable a) =>
a
-> m Gtk.Enums.Orientation
orientableGetOrientation orientable = liftIO $ do
orientable' <- unsafeManagedPtrCastPtr orientable
result <- gtk_orientable_get_orientation orientable'
let result' = (toEnum . fromIntegral) result
touchManagedPtr orientable
return result'
#if defined(ENABLE_OVERLOADING)
data OrientableGetOrientationMethodInfo
instance (signature ~ (m Gtk.Enums.Orientation), MonadIO m, IsOrientable a) => O.MethodInfo OrientableGetOrientationMethodInfo a signature where
overloadedMethod = orientableGetOrientation
#endif
foreign import ccall "gtk_orientable_set_orientation" gtk_orientable_set_orientation ::
Ptr Orientable ->
CUInt ->
IO ()
orientableSetOrientation ::
(B.CallStack.HasCallStack, MonadIO m, IsOrientable a) =>
a
-> Gtk.Enums.Orientation
-> m ()
orientableSetOrientation orientable orientation = liftIO $ do
orientable' <- unsafeManagedPtrCastPtr orientable
let orientation' = (fromIntegral . fromEnum) orientation
gtk_orientable_set_orientation orientable' orientation'
touchManagedPtr orientable
return ()
#if defined(ENABLE_OVERLOADING)
data OrientableSetOrientationMethodInfo
instance (signature ~ (Gtk.Enums.Orientation -> m ()), MonadIO m, IsOrientable a) => O.MethodInfo OrientableSetOrientationMethodInfo a signature where
overloadedMethod = orientableSetOrientation
#endif