{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.LayoutChild
(
LayoutChild(..) ,
IsLayoutChild ,
toLayoutChild ,
noLayoutChild ,
#if defined(ENABLE_OVERLOADING)
ResolveLayoutChildMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
LayoutChildGetChildWidgetMethodInfo ,
#endif
layoutChildGetChildWidget ,
#if defined(ENABLE_OVERLOADING)
LayoutChildGetLayoutManagerMethodInfo ,
#endif
layoutChildGetLayoutManager ,
#if defined(ENABLE_OVERLOADING)
LayoutChildChildWidgetPropertyInfo ,
#endif
constructLayoutChildChildWidget ,
getLayoutChildChildWidget ,
#if defined(ENABLE_OVERLOADING)
layoutChildChildWidget ,
#endif
#if defined(ENABLE_OVERLOADING)
LayoutChildLayoutManagerPropertyInfo ,
#endif
constructLayoutChildLayoutManager ,
getLayoutChildLayoutManager ,
#if defined(ENABLE_OVERLOADING)
layoutChildLayoutManager ,
#endif
) 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.Objects.LayoutManager as Gtk.LayoutManager
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
newtype LayoutChild = LayoutChild (ManagedPtr LayoutChild)
deriving (LayoutChild -> LayoutChild -> Bool
(LayoutChild -> LayoutChild -> Bool)
-> (LayoutChild -> LayoutChild -> Bool) -> Eq LayoutChild
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LayoutChild -> LayoutChild -> Bool
$c/= :: LayoutChild -> LayoutChild -> Bool
== :: LayoutChild -> LayoutChild -> Bool
$c== :: LayoutChild -> LayoutChild -> Bool
Eq)
foreign import ccall "gtk_layout_child_get_type"
c_gtk_layout_child_get_type :: IO GType
instance GObject LayoutChild where
gobjectType :: IO GType
gobjectType = IO GType
c_gtk_layout_child_get_type
instance B.GValue.IsGValue LayoutChild where
toGValue :: LayoutChild -> IO GValue
toGValue o :: LayoutChild
o = do
GType
gtype <- IO GType
c_gtk_layout_child_get_type
LayoutChild -> (Ptr LayoutChild -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr LayoutChild
o (GType
-> (GValue -> Ptr LayoutChild -> IO ())
-> Ptr LayoutChild
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr LayoutChild -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO LayoutChild
fromGValue gv :: GValue
gv = do
Ptr LayoutChild
ptr <- GValue -> IO (Ptr LayoutChild)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr LayoutChild)
(ManagedPtr LayoutChild -> LayoutChild)
-> Ptr LayoutChild -> IO LayoutChild
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr LayoutChild -> LayoutChild
LayoutChild Ptr LayoutChild
ptr
class (GObject o, O.IsDescendantOf LayoutChild o) => IsLayoutChild o
instance (GObject o, O.IsDescendantOf LayoutChild o) => IsLayoutChild o
instance O.HasParentTypes LayoutChild
type instance O.ParentTypes LayoutChild = '[GObject.Object.Object]
toLayoutChild :: (MonadIO m, IsLayoutChild o) => o -> m LayoutChild
toLayoutChild :: o -> m LayoutChild
toLayoutChild = IO LayoutChild -> m LayoutChild
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO LayoutChild -> m LayoutChild)
-> (o -> IO LayoutChild) -> o -> m LayoutChild
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr LayoutChild -> LayoutChild) -> o -> IO LayoutChild
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr LayoutChild -> LayoutChild
LayoutChild
noLayoutChild :: Maybe LayoutChild
noLayoutChild :: Maybe LayoutChild
noLayoutChild = Maybe LayoutChild
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveLayoutChildMethod (t :: Symbol) (o :: *) :: * where
ResolveLayoutChildMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveLayoutChildMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveLayoutChildMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveLayoutChildMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveLayoutChildMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveLayoutChildMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveLayoutChildMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveLayoutChildMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveLayoutChildMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveLayoutChildMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveLayoutChildMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveLayoutChildMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveLayoutChildMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveLayoutChildMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveLayoutChildMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveLayoutChildMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveLayoutChildMethod "getChildWidget" o = LayoutChildGetChildWidgetMethodInfo
ResolveLayoutChildMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveLayoutChildMethod "getLayoutManager" o = LayoutChildGetLayoutManagerMethodInfo
ResolveLayoutChildMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveLayoutChildMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveLayoutChildMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveLayoutChildMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveLayoutChildMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveLayoutChildMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveLayoutChildMethod t LayoutChild, O.MethodInfo info LayoutChild p) => OL.IsLabel t (LayoutChild -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getLayoutChildChildWidget :: (MonadIO m, IsLayoutChild o) => o -> m Gtk.Widget.Widget
getLayoutChildChildWidget :: o -> m Widget
getLayoutChildChildWidget obj :: o
obj = IO Widget -> m Widget
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Widget -> m Widget) -> IO Widget -> m Widget
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Widget) -> IO Widget
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getLayoutChildChildWidget" (IO (Maybe Widget) -> IO Widget) -> IO (Maybe Widget) -> IO Widget
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Widget -> Widget) -> IO (Maybe Widget)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "child-widget" ManagedPtr Widget -> Widget
Gtk.Widget.Widget
constructLayoutChildChildWidget :: (IsLayoutChild o, Gtk.Widget.IsWidget a) => a -> IO (GValueConstruct o)
constructLayoutChildChildWidget :: a -> IO (GValueConstruct o)
constructLayoutChildChildWidget val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "child-widget" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if defined(ENABLE_OVERLOADING)
data LayoutChildChildWidgetPropertyInfo
instance AttrInfo LayoutChildChildWidgetPropertyInfo where
type AttrAllowedOps LayoutChildChildWidgetPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint LayoutChildChildWidgetPropertyInfo = IsLayoutChild
type AttrSetTypeConstraint LayoutChildChildWidgetPropertyInfo = Gtk.Widget.IsWidget
type AttrTransferTypeConstraint LayoutChildChildWidgetPropertyInfo = Gtk.Widget.IsWidget
type AttrTransferType LayoutChildChildWidgetPropertyInfo = Gtk.Widget.Widget
type AttrGetType LayoutChildChildWidgetPropertyInfo = Gtk.Widget.Widget
type AttrLabel LayoutChildChildWidgetPropertyInfo = "child-widget"
type AttrOrigin LayoutChildChildWidgetPropertyInfo = LayoutChild
attrGet = getLayoutChildChildWidget
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gtk.Widget.Widget v
attrConstruct = constructLayoutChildChildWidget
attrClear = undefined
#endif
getLayoutChildLayoutManager :: (MonadIO m, IsLayoutChild o) => o -> m Gtk.LayoutManager.LayoutManager
getLayoutChildLayoutManager :: o -> m LayoutManager
getLayoutChildLayoutManager obj :: o
obj = IO LayoutManager -> m LayoutManager
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO LayoutManager -> m LayoutManager)
-> IO LayoutManager -> m LayoutManager
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe LayoutManager) -> IO LayoutManager
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getLayoutChildLayoutManager" (IO (Maybe LayoutManager) -> IO LayoutManager)
-> IO (Maybe LayoutManager) -> IO LayoutManager
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr LayoutManager -> LayoutManager)
-> IO (Maybe LayoutManager)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "layout-manager" ManagedPtr LayoutManager -> LayoutManager
Gtk.LayoutManager.LayoutManager
constructLayoutChildLayoutManager :: (IsLayoutChild o, Gtk.LayoutManager.IsLayoutManager a) => a -> IO (GValueConstruct o)
constructLayoutChildLayoutManager :: a -> IO (GValueConstruct o)
constructLayoutChildLayoutManager val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "layout-manager" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if defined(ENABLE_OVERLOADING)
data LayoutChildLayoutManagerPropertyInfo
instance AttrInfo LayoutChildLayoutManagerPropertyInfo where
type AttrAllowedOps LayoutChildLayoutManagerPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint LayoutChildLayoutManagerPropertyInfo = IsLayoutChild
type AttrSetTypeConstraint LayoutChildLayoutManagerPropertyInfo = Gtk.LayoutManager.IsLayoutManager
type AttrTransferTypeConstraint LayoutChildLayoutManagerPropertyInfo = Gtk.LayoutManager.IsLayoutManager
type AttrTransferType LayoutChildLayoutManagerPropertyInfo = Gtk.LayoutManager.LayoutManager
type AttrGetType LayoutChildLayoutManagerPropertyInfo = Gtk.LayoutManager.LayoutManager
type AttrLabel LayoutChildLayoutManagerPropertyInfo = "layout-manager"
type AttrOrigin LayoutChildLayoutManagerPropertyInfo = LayoutChild
attrGet = getLayoutChildLayoutManager
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gtk.LayoutManager.LayoutManager v
attrConstruct = constructLayoutChildLayoutManager
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList LayoutChild
type instance O.AttributeList LayoutChild = LayoutChildAttributeList
type LayoutChildAttributeList = ('[ '("childWidget", LayoutChildChildWidgetPropertyInfo), '("layoutManager", LayoutChildLayoutManagerPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
layoutChildChildWidget :: AttrLabelProxy "childWidget"
layoutChildChildWidget = AttrLabelProxy
layoutChildLayoutManager :: AttrLabelProxy "layoutManager"
layoutChildLayoutManager = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList LayoutChild = LayoutChildSignalList
type LayoutChildSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_layout_child_get_child_widget" gtk_layout_child_get_child_widget ::
Ptr LayoutChild ->
IO (Ptr Gtk.Widget.Widget)
layoutChildGetChildWidget ::
(B.CallStack.HasCallStack, MonadIO m, IsLayoutChild a) =>
a
-> m Gtk.Widget.Widget
layoutChildGetChildWidget :: a -> m Widget
layoutChildGetChildWidget layoutChild :: a
layoutChild = IO Widget -> m Widget
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Widget -> m Widget) -> IO Widget -> m Widget
forall a b. (a -> b) -> a -> b
$ do
Ptr LayoutChild
layoutChild' <- a -> IO (Ptr LayoutChild)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layoutChild
Ptr Widget
result <- Ptr LayoutChild -> IO (Ptr Widget)
gtk_layout_child_get_child_widget Ptr LayoutChild
layoutChild'
Text -> Ptr Widget -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "layoutChildGetChildWidget" Ptr Widget
result
Widget
result' <- ((ManagedPtr Widget -> Widget) -> Ptr Widget -> IO Widget
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Widget -> Widget
Gtk.Widget.Widget) Ptr Widget
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layoutChild
Widget -> IO Widget
forall (m :: * -> *) a. Monad m => a -> m a
return Widget
result'
#if defined(ENABLE_OVERLOADING)
data LayoutChildGetChildWidgetMethodInfo
instance (signature ~ (m Gtk.Widget.Widget), MonadIO m, IsLayoutChild a) => O.MethodInfo LayoutChildGetChildWidgetMethodInfo a signature where
overloadedMethod = layoutChildGetChildWidget
#endif
foreign import ccall "gtk_layout_child_get_layout_manager" gtk_layout_child_get_layout_manager ::
Ptr LayoutChild ->
IO (Ptr Gtk.LayoutManager.LayoutManager)
layoutChildGetLayoutManager ::
(B.CallStack.HasCallStack, MonadIO m, IsLayoutChild a) =>
a
-> m Gtk.LayoutManager.LayoutManager
layoutChildGetLayoutManager :: a -> m LayoutManager
layoutChildGetLayoutManager layoutChild :: a
layoutChild = IO LayoutManager -> m LayoutManager
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO LayoutManager -> m LayoutManager)
-> IO LayoutManager -> m LayoutManager
forall a b. (a -> b) -> a -> b
$ do
Ptr LayoutChild
layoutChild' <- a -> IO (Ptr LayoutChild)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
layoutChild
Ptr LayoutManager
result <- Ptr LayoutChild -> IO (Ptr LayoutManager)
gtk_layout_child_get_layout_manager Ptr LayoutChild
layoutChild'
Text -> Ptr LayoutManager -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "layoutChildGetLayoutManager" Ptr LayoutManager
result
LayoutManager
result' <- ((ManagedPtr LayoutManager -> LayoutManager)
-> Ptr LayoutManager -> IO LayoutManager
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr LayoutManager -> LayoutManager
Gtk.LayoutManager.LayoutManager) Ptr LayoutManager
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
layoutChild
LayoutManager -> IO LayoutManager
forall (m :: * -> *) a. Monad m => a -> m a
return LayoutManager
result'
#if defined(ENABLE_OVERLOADING)
data LayoutChildGetLayoutManagerMethodInfo
instance (signature ~ (m Gtk.LayoutManager.LayoutManager), MonadIO m, IsLayoutChild a) => O.MethodInfo LayoutChildGetLayoutManagerMethodInfo a signature where
overloadedMethod = layoutChildGetLayoutManager
#endif