{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Interfaces.TreeSortable
(
TreeSortable(..) ,
noTreeSortable ,
IsTreeSortable ,
toTreeSortable ,
#if defined(ENABLE_OVERLOADING)
ResolveTreeSortableMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TreeSortableGetSortColumnIdMethodInfo ,
#endif
treeSortableGetSortColumnId ,
#if defined(ENABLE_OVERLOADING)
TreeSortableHasDefaultSortFuncMethodInfo,
#endif
treeSortableHasDefaultSortFunc ,
#if defined(ENABLE_OVERLOADING)
TreeSortableSetDefaultSortFuncMethodInfo,
#endif
treeSortableSetDefaultSortFunc ,
#if defined(ENABLE_OVERLOADING)
TreeSortableSetSortColumnIdMethodInfo ,
#endif
treeSortableSetSortColumnId ,
#if defined(ENABLE_OVERLOADING)
TreeSortableSetSortFuncMethodInfo ,
#endif
treeSortableSetSortFunc ,
#if defined(ENABLE_OVERLOADING)
TreeSortableSortColumnChangedMethodInfo ,
#endif
treeSortableSortColumnChanged ,
C_TreeSortableSortColumnChangedCallback ,
TreeSortableSortColumnChangedCallback ,
#if defined(ENABLE_OVERLOADING)
TreeSortableSortColumnChangedSignalInfo ,
#endif
afterTreeSortableSortColumnChanged ,
genClosure_TreeSortableSortColumnChanged,
mk_TreeSortableSortColumnChangedCallback,
noTreeSortableSortColumnChangedCallback ,
onTreeSortableSortColumnChanged ,
wrap_TreeSortableSortColumnChangedCallback,
) 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.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.TreeModel as Gtk.TreeModel
newtype TreeSortable = TreeSortable (ManagedPtr TreeSortable)
deriving (TreeSortable -> TreeSortable -> Bool
(TreeSortable -> TreeSortable -> Bool)
-> (TreeSortable -> TreeSortable -> Bool) -> Eq TreeSortable
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TreeSortable -> TreeSortable -> Bool
$c/= :: TreeSortable -> TreeSortable -> Bool
== :: TreeSortable -> TreeSortable -> Bool
$c== :: TreeSortable -> TreeSortable -> Bool
Eq)
noTreeSortable :: Maybe TreeSortable
noTreeSortable :: Maybe TreeSortable
noTreeSortable = Maybe TreeSortable
forall a. Maybe a
Nothing
type TreeSortableSortColumnChangedCallback =
IO ()
noTreeSortableSortColumnChangedCallback :: Maybe TreeSortableSortColumnChangedCallback
noTreeSortableSortColumnChangedCallback :: Maybe TreeSortableSortColumnChangedCallback
noTreeSortableSortColumnChangedCallback = Maybe TreeSortableSortColumnChangedCallback
forall a. Maybe a
Nothing
type C_TreeSortableSortColumnChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_TreeSortableSortColumnChangedCallback :: C_TreeSortableSortColumnChangedCallback -> IO (FunPtr C_TreeSortableSortColumnChangedCallback)
genClosure_TreeSortableSortColumnChanged :: MonadIO m => TreeSortableSortColumnChangedCallback -> m (GClosure C_TreeSortableSortColumnChangedCallback)
genClosure_TreeSortableSortColumnChanged :: TreeSortableSortColumnChangedCallback
-> m (GClosure C_TreeSortableSortColumnChangedCallback)
genClosure_TreeSortableSortColumnChanged cb :: TreeSortableSortColumnChangedCallback
cb = IO (GClosure C_TreeSortableSortColumnChangedCallback)
-> m (GClosure C_TreeSortableSortColumnChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TreeSortableSortColumnChangedCallback)
-> m (GClosure C_TreeSortableSortColumnChangedCallback))
-> IO (GClosure C_TreeSortableSortColumnChangedCallback)
-> m (GClosure C_TreeSortableSortColumnChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TreeSortableSortColumnChangedCallback
cb' = TreeSortableSortColumnChangedCallback
-> C_TreeSortableSortColumnChangedCallback
wrap_TreeSortableSortColumnChangedCallback TreeSortableSortColumnChangedCallback
cb
C_TreeSortableSortColumnChangedCallback
-> IO (FunPtr C_TreeSortableSortColumnChangedCallback)
mk_TreeSortableSortColumnChangedCallback C_TreeSortableSortColumnChangedCallback
cb' IO (FunPtr C_TreeSortableSortColumnChangedCallback)
-> (FunPtr C_TreeSortableSortColumnChangedCallback
-> IO (GClosure C_TreeSortableSortColumnChangedCallback))
-> IO (GClosure C_TreeSortableSortColumnChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TreeSortableSortColumnChangedCallback
-> IO (GClosure C_TreeSortableSortColumnChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_TreeSortableSortColumnChangedCallback ::
TreeSortableSortColumnChangedCallback ->
C_TreeSortableSortColumnChangedCallback
wrap_TreeSortableSortColumnChangedCallback :: TreeSortableSortColumnChangedCallback
-> C_TreeSortableSortColumnChangedCallback
wrap_TreeSortableSortColumnChangedCallback _cb :: TreeSortableSortColumnChangedCallback
_cb _ _ = do
TreeSortableSortColumnChangedCallback
_cb
onTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => a -> TreeSortableSortColumnChangedCallback -> m SignalHandlerId
onTreeSortableSortColumnChanged :: a -> TreeSortableSortColumnChangedCallback -> m SignalHandlerId
onTreeSortableSortColumnChanged obj :: a
obj cb :: TreeSortableSortColumnChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TreeSortableSortColumnChangedCallback
cb' = TreeSortableSortColumnChangedCallback
-> C_TreeSortableSortColumnChangedCallback
wrap_TreeSortableSortColumnChangedCallback TreeSortableSortColumnChangedCallback
cb
FunPtr C_TreeSortableSortColumnChangedCallback
cb'' <- C_TreeSortableSortColumnChangedCallback
-> IO (FunPtr C_TreeSortableSortColumnChangedCallback)
mk_TreeSortableSortColumnChangedCallback C_TreeSortableSortColumnChangedCallback
cb'
a
-> Text
-> FunPtr C_TreeSortableSortColumnChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "sort-column-changed" FunPtr C_TreeSortableSortColumnChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => a -> TreeSortableSortColumnChangedCallback -> m SignalHandlerId
afterTreeSortableSortColumnChanged :: a -> TreeSortableSortColumnChangedCallback -> m SignalHandlerId
afterTreeSortableSortColumnChanged obj :: a
obj cb :: TreeSortableSortColumnChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TreeSortableSortColumnChangedCallback
cb' = TreeSortableSortColumnChangedCallback
-> C_TreeSortableSortColumnChangedCallback
wrap_TreeSortableSortColumnChangedCallback TreeSortableSortColumnChangedCallback
cb
FunPtr C_TreeSortableSortColumnChangedCallback
cb'' <- C_TreeSortableSortColumnChangedCallback
-> IO (FunPtr C_TreeSortableSortColumnChangedCallback)
mk_TreeSortableSortColumnChangedCallback C_TreeSortableSortColumnChangedCallback
cb'
a
-> Text
-> FunPtr C_TreeSortableSortColumnChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "sort-column-changed" FunPtr C_TreeSortableSortColumnChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data TreeSortableSortColumnChangedSignalInfo
instance SignalInfo TreeSortableSortColumnChangedSignalInfo where
type HaskellCallbackType TreeSortableSortColumnChangedSignalInfo = TreeSortableSortColumnChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_TreeSortableSortColumnChangedCallback cb
cb'' <- mk_TreeSortableSortColumnChangedCallback cb'
connectSignalFunPtr obj "sort-column-changed" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList TreeSortable = TreeSortableSignalList
type TreeSortableSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("rowChanged", Gtk.TreeModel.TreeModelRowChangedSignalInfo), '("rowDeleted", Gtk.TreeModel.TreeModelRowDeletedSignalInfo), '("rowHasChildToggled", Gtk.TreeModel.TreeModelRowHasChildToggledSignalInfo), '("rowInserted", Gtk.TreeModel.TreeModelRowInsertedSignalInfo), '("sortColumnChanged", TreeSortableSortColumnChangedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_tree_sortable_get_type"
c_gtk_tree_sortable_get_type :: IO GType
instance GObject TreeSortable where
gobjectType :: IO GType
gobjectType = IO GType
c_gtk_tree_sortable_get_type
instance B.GValue.IsGValue TreeSortable where
toGValue :: TreeSortable -> IO GValue
toGValue o :: TreeSortable
o = do
GType
gtype <- IO GType
c_gtk_tree_sortable_get_type
TreeSortable -> (Ptr TreeSortable -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr TreeSortable
o (GType
-> (GValue
-> Ptr TreeSortable -> TreeSortableSortColumnChangedCallback)
-> Ptr TreeSortable
-> IO GValue
forall a.
GType
-> (GValue -> a -> TreeSortableSortColumnChangedCallback)
-> a
-> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr TreeSortable -> TreeSortableSortColumnChangedCallback
forall a.
GObject a =>
GValue -> Ptr a -> TreeSortableSortColumnChangedCallback
B.GValue.set_object)
fromGValue :: GValue -> IO TreeSortable
fromGValue gv :: GValue
gv = do
Ptr TreeSortable
ptr <- GValue -> IO (Ptr TreeSortable)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr TreeSortable)
(ManagedPtr TreeSortable -> TreeSortable)
-> Ptr TreeSortable -> IO TreeSortable
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr TreeSortable -> TreeSortable
TreeSortable Ptr TreeSortable
ptr
class (GObject o, O.IsDescendantOf TreeSortable o) => IsTreeSortable o
instance (GObject o, O.IsDescendantOf TreeSortable o) => IsTreeSortable o
instance O.HasParentTypes TreeSortable
type instance O.ParentTypes TreeSortable = '[Gtk.TreeModel.TreeModel, GObject.Object.Object]
toTreeSortable :: (MonadIO m, IsTreeSortable o) => o -> m TreeSortable
toTreeSortable :: o -> m TreeSortable
toTreeSortable = IO TreeSortable -> m TreeSortable
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TreeSortable -> m TreeSortable)
-> (o -> IO TreeSortable) -> o -> m TreeSortable
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr TreeSortable -> TreeSortable) -> o -> IO TreeSortable
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr TreeSortable -> TreeSortable
TreeSortable
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TreeSortable
type instance O.AttributeList TreeSortable = TreeSortableAttributeList
type TreeSortableAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveTreeSortableMethod (t :: Symbol) (o :: *) :: * where
ResolveTreeSortableMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveTreeSortableMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveTreeSortableMethod "filterNew" o = Gtk.TreeModel.TreeModelFilterNewMethodInfo
ResolveTreeSortableMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveTreeSortableMethod "foreach" o = Gtk.TreeModel.TreeModelForeachMethodInfo
ResolveTreeSortableMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveTreeSortableMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveTreeSortableMethod "hasDefaultSortFunc" o = TreeSortableHasDefaultSortFuncMethodInfo
ResolveTreeSortableMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveTreeSortableMethod "iterChildren" o = Gtk.TreeModel.TreeModelIterChildrenMethodInfo
ResolveTreeSortableMethod "iterHasChild" o = Gtk.TreeModel.TreeModelIterHasChildMethodInfo
ResolveTreeSortableMethod "iterNChildren" o = Gtk.TreeModel.TreeModelIterNChildrenMethodInfo
ResolveTreeSortableMethod "iterNext" o = Gtk.TreeModel.TreeModelIterNextMethodInfo
ResolveTreeSortableMethod "iterNthChild" o = Gtk.TreeModel.TreeModelIterNthChildMethodInfo
ResolveTreeSortableMethod "iterParent" o = Gtk.TreeModel.TreeModelIterParentMethodInfo
ResolveTreeSortableMethod "iterPrevious" o = Gtk.TreeModel.TreeModelIterPreviousMethodInfo
ResolveTreeSortableMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveTreeSortableMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveTreeSortableMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveTreeSortableMethod "refNode" o = Gtk.TreeModel.TreeModelRefNodeMethodInfo
ResolveTreeSortableMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveTreeSortableMethod "rowChanged" o = Gtk.TreeModel.TreeModelRowChangedMethodInfo
ResolveTreeSortableMethod "rowDeleted" o = Gtk.TreeModel.TreeModelRowDeletedMethodInfo
ResolveTreeSortableMethod "rowHasChildToggled" o = Gtk.TreeModel.TreeModelRowHasChildToggledMethodInfo
ResolveTreeSortableMethod "rowInserted" o = Gtk.TreeModel.TreeModelRowInsertedMethodInfo
ResolveTreeSortableMethod "rowsReordered" o = Gtk.TreeModel.TreeModelRowsReorderedMethodInfo
ResolveTreeSortableMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveTreeSortableMethod "sortColumnChanged" o = TreeSortableSortColumnChangedMethodInfo
ResolveTreeSortableMethod "sortNewWithModel" o = Gtk.TreeModel.TreeModelSortNewWithModelMethodInfo
ResolveTreeSortableMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveTreeSortableMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveTreeSortableMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveTreeSortableMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveTreeSortableMethod "unrefNode" o = Gtk.TreeModel.TreeModelUnrefNodeMethodInfo
ResolveTreeSortableMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveTreeSortableMethod "getColumnType" o = Gtk.TreeModel.TreeModelGetColumnTypeMethodInfo
ResolveTreeSortableMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveTreeSortableMethod "getFlags" o = Gtk.TreeModel.TreeModelGetFlagsMethodInfo
ResolveTreeSortableMethod "getIter" o = Gtk.TreeModel.TreeModelGetIterMethodInfo
ResolveTreeSortableMethod "getIterFirst" o = Gtk.TreeModel.TreeModelGetIterFirstMethodInfo
ResolveTreeSortableMethod "getIterFromString" o = Gtk.TreeModel.TreeModelGetIterFromStringMethodInfo
ResolveTreeSortableMethod "getNColumns" o = Gtk.TreeModel.TreeModelGetNColumnsMethodInfo
ResolveTreeSortableMethod "getPath" o = Gtk.TreeModel.TreeModelGetPathMethodInfo
ResolveTreeSortableMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveTreeSortableMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveTreeSortableMethod "getSortColumnId" o = TreeSortableGetSortColumnIdMethodInfo
ResolveTreeSortableMethod "getStringFromIter" o = Gtk.TreeModel.TreeModelGetStringFromIterMethodInfo
ResolveTreeSortableMethod "getValue" o = Gtk.TreeModel.TreeModelGetValueMethodInfo
ResolveTreeSortableMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveTreeSortableMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveTreeSortableMethod "setDefaultSortFunc" o = TreeSortableSetDefaultSortFuncMethodInfo
ResolveTreeSortableMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveTreeSortableMethod "setSortColumnId" o = TreeSortableSetSortColumnIdMethodInfo
ResolveTreeSortableMethod "setSortFunc" o = TreeSortableSetSortFuncMethodInfo
ResolveTreeSortableMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTreeSortableMethod t TreeSortable, O.MethodInfo info TreeSortable p) => OL.IsLabel t (TreeSortable -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "gtk_tree_sortable_get_sort_column_id" gtk_tree_sortable_get_sort_column_id ::
Ptr TreeSortable ->
Ptr Int32 ->
Ptr CUInt ->
IO CInt
treeSortableGetSortColumnId ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSortable a) =>
a
-> m ((Bool, Int32, Gtk.Enums.SortType))
treeSortableGetSortColumnId :: a -> m (Bool, Int32, SortType)
treeSortableGetSortColumnId sortable :: a
sortable = IO (Bool, Int32, SortType) -> m (Bool, Int32, SortType)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Int32, SortType) -> m (Bool, Int32, SortType))
-> IO (Bool, Int32, SortType) -> m (Bool, Int32, SortType)
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSortable
sortable' <- a -> IO (Ptr TreeSortable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sortable
Ptr Int32
sortColumnId <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr CUInt
order <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
CInt
result <- Ptr TreeSortable -> Ptr Int32 -> Ptr CUInt -> IO CInt
gtk_tree_sortable_get_sort_column_id Ptr TreeSortable
sortable' Ptr Int32
sortColumnId Ptr CUInt
order
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Int32
sortColumnId' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
sortColumnId
CUInt
order' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
order
let order'' :: SortType
order'' = (Int -> SortType
forall a. Enum a => Int -> a
toEnum (Int -> SortType) -> (CUInt -> Int) -> CUInt -> SortType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
order'
a -> TreeSortableSortColumnChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TreeSortableSortColumnChangedCallback
touchManagedPtr a
sortable
Ptr Int32 -> TreeSortableSortColumnChangedCallback
forall a. Ptr a -> TreeSortableSortColumnChangedCallback
freeMem Ptr Int32
sortColumnId
Ptr CUInt -> TreeSortableSortColumnChangedCallback
forall a. Ptr a -> TreeSortableSortColumnChangedCallback
freeMem Ptr CUInt
order
(Bool, Int32, SortType) -> IO (Bool, Int32, SortType)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Int32
sortColumnId', SortType
order'')
#if defined(ENABLE_OVERLOADING)
data TreeSortableGetSortColumnIdMethodInfo
instance (signature ~ (m ((Bool, Int32, Gtk.Enums.SortType))), MonadIO m, IsTreeSortable a) => O.MethodInfo TreeSortableGetSortColumnIdMethodInfo a signature where
overloadedMethod = treeSortableGetSortColumnId
#endif
foreign import ccall "gtk_tree_sortable_has_default_sort_func" gtk_tree_sortable_has_default_sort_func ::
Ptr TreeSortable ->
IO CInt
treeSortableHasDefaultSortFunc ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSortable a) =>
a
-> m Bool
treeSortableHasDefaultSortFunc :: a -> m Bool
treeSortableHasDefaultSortFunc sortable :: a
sortable = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSortable
sortable' <- a -> IO (Ptr TreeSortable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sortable
CInt
result <- Ptr TreeSortable -> IO CInt
gtk_tree_sortable_has_default_sort_func Ptr TreeSortable
sortable'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> TreeSortableSortColumnChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TreeSortableSortColumnChangedCallback
touchManagedPtr a
sortable
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TreeSortableHasDefaultSortFuncMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsTreeSortable a) => O.MethodInfo TreeSortableHasDefaultSortFuncMethodInfo a signature where
overloadedMethod = treeSortableHasDefaultSortFunc
#endif
foreign import ccall "gtk_tree_sortable_set_default_sort_func" gtk_tree_sortable_set_default_sort_func ::
Ptr TreeSortable ->
FunPtr Gtk.Callbacks.C_TreeIterCompareFunc ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO ()
treeSortableSetDefaultSortFunc ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSortable a) =>
a
-> Gtk.Callbacks.TreeIterCompareFunc
-> m ()
treeSortableSetDefaultSortFunc :: a -> TreeIterCompareFunc -> m ()
treeSortableSetDefaultSortFunc sortable :: a
sortable sortFunc :: TreeIterCompareFunc
sortFunc = TreeSortableSortColumnChangedCallback -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (TreeSortableSortColumnChangedCallback -> m ())
-> TreeSortableSortColumnChangedCallback -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSortable
sortable' <- a -> IO (Ptr TreeSortable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sortable
FunPtr C_TreeIterCompareFunc
sortFunc' <- C_TreeIterCompareFunc -> IO (FunPtr C_TreeIterCompareFunc)
Gtk.Callbacks.mk_TreeIterCompareFunc (Maybe (Ptr (FunPtr C_TreeIterCompareFunc))
-> TreeIterCompareFunc_WithClosures -> C_TreeIterCompareFunc
Gtk.Callbacks.wrap_TreeIterCompareFunc Maybe (Ptr (FunPtr C_TreeIterCompareFunc))
forall a. Maybe a
Nothing (TreeIterCompareFunc -> TreeIterCompareFunc_WithClosures
Gtk.Callbacks.drop_closures_TreeIterCompareFunc TreeIterCompareFunc
sortFunc))
let userData :: Ptr ()
userData = FunPtr C_TreeIterCompareFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_TreeIterCompareFunc
sortFunc'
let destroy :: FunPtr (Ptr a -> TreeSortableSortColumnChangedCallback)
destroy = FunPtr (Ptr a -> TreeSortableSortColumnChangedCallback)
forall a. FunPtr (Ptr a -> TreeSortableSortColumnChangedCallback)
safeFreeFunPtrPtr
Ptr TreeSortable
-> FunPtr C_TreeIterCompareFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> TreeSortableSortColumnChangedCallback
gtk_tree_sortable_set_default_sort_func Ptr TreeSortable
sortable' FunPtr C_TreeIterCompareFunc
sortFunc' Ptr ()
userData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> TreeSortableSortColumnChangedCallback)
destroy
a -> TreeSortableSortColumnChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TreeSortableSortColumnChangedCallback
touchManagedPtr a
sortable
() -> TreeSortableSortColumnChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSortableSetDefaultSortFuncMethodInfo
instance (signature ~ (Gtk.Callbacks.TreeIterCompareFunc -> m ()), MonadIO m, IsTreeSortable a) => O.MethodInfo TreeSortableSetDefaultSortFuncMethodInfo a signature where
overloadedMethod = treeSortableSetDefaultSortFunc
#endif
foreign import ccall "gtk_tree_sortable_set_sort_column_id" gtk_tree_sortable_set_sort_column_id ::
Ptr TreeSortable ->
Int32 ->
CUInt ->
IO ()
treeSortableSetSortColumnId ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSortable a) =>
a
-> Int32
-> Gtk.Enums.SortType
-> m ()
treeSortableSetSortColumnId :: a -> Int32 -> SortType -> m ()
treeSortableSetSortColumnId sortable :: a
sortable sortColumnId :: Int32
sortColumnId order :: SortType
order = TreeSortableSortColumnChangedCallback -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (TreeSortableSortColumnChangedCallback -> m ())
-> TreeSortableSortColumnChangedCallback -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSortable
sortable' <- a -> IO (Ptr TreeSortable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sortable
let order' :: CUInt
order' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (SortType -> Int) -> SortType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SortType -> Int
forall a. Enum a => a -> Int
fromEnum) SortType
order
Ptr TreeSortable
-> Int32 -> CUInt -> TreeSortableSortColumnChangedCallback
gtk_tree_sortable_set_sort_column_id Ptr TreeSortable
sortable' Int32
sortColumnId CUInt
order'
a -> TreeSortableSortColumnChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TreeSortableSortColumnChangedCallback
touchManagedPtr a
sortable
() -> TreeSortableSortColumnChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSortableSetSortColumnIdMethodInfo
instance (signature ~ (Int32 -> Gtk.Enums.SortType -> m ()), MonadIO m, IsTreeSortable a) => O.MethodInfo TreeSortableSetSortColumnIdMethodInfo a signature where
overloadedMethod = treeSortableSetSortColumnId
#endif
foreign import ccall "gtk_tree_sortable_set_sort_func" gtk_tree_sortable_set_sort_func ::
Ptr TreeSortable ->
Int32 ->
FunPtr Gtk.Callbacks.C_TreeIterCompareFunc ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO ()
treeSortableSetSortFunc ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSortable a) =>
a
-> Int32
-> Gtk.Callbacks.TreeIterCompareFunc
-> m ()
treeSortableSetSortFunc :: a -> Int32 -> TreeIterCompareFunc -> m ()
treeSortableSetSortFunc sortable :: a
sortable sortColumnId :: Int32
sortColumnId sortFunc :: TreeIterCompareFunc
sortFunc = TreeSortableSortColumnChangedCallback -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (TreeSortableSortColumnChangedCallback -> m ())
-> TreeSortableSortColumnChangedCallback -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSortable
sortable' <- a -> IO (Ptr TreeSortable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sortable
FunPtr C_TreeIterCompareFunc
sortFunc' <- C_TreeIterCompareFunc -> IO (FunPtr C_TreeIterCompareFunc)
Gtk.Callbacks.mk_TreeIterCompareFunc (Maybe (Ptr (FunPtr C_TreeIterCompareFunc))
-> TreeIterCompareFunc_WithClosures -> C_TreeIterCompareFunc
Gtk.Callbacks.wrap_TreeIterCompareFunc Maybe (Ptr (FunPtr C_TreeIterCompareFunc))
forall a. Maybe a
Nothing (TreeIterCompareFunc -> TreeIterCompareFunc_WithClosures
Gtk.Callbacks.drop_closures_TreeIterCompareFunc TreeIterCompareFunc
sortFunc))
let userData :: Ptr ()
userData = FunPtr C_TreeIterCompareFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_TreeIterCompareFunc
sortFunc'
let destroy :: FunPtr (Ptr a -> TreeSortableSortColumnChangedCallback)
destroy = FunPtr (Ptr a -> TreeSortableSortColumnChangedCallback)
forall a. FunPtr (Ptr a -> TreeSortableSortColumnChangedCallback)
safeFreeFunPtrPtr
Ptr TreeSortable
-> Int32
-> FunPtr C_TreeIterCompareFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> TreeSortableSortColumnChangedCallback
gtk_tree_sortable_set_sort_func Ptr TreeSortable
sortable' Int32
sortColumnId FunPtr C_TreeIterCompareFunc
sortFunc' Ptr ()
userData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> TreeSortableSortColumnChangedCallback)
destroy
a -> TreeSortableSortColumnChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TreeSortableSortColumnChangedCallback
touchManagedPtr a
sortable
() -> TreeSortableSortColumnChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSortableSetSortFuncMethodInfo
instance (signature ~ (Int32 -> Gtk.Callbacks.TreeIterCompareFunc -> m ()), MonadIO m, IsTreeSortable a) => O.MethodInfo TreeSortableSetSortFuncMethodInfo a signature where
overloadedMethod = treeSortableSetSortFunc
#endif
foreign import ccall "gtk_tree_sortable_sort_column_changed" gtk_tree_sortable_sort_column_changed ::
Ptr TreeSortable ->
IO ()
treeSortableSortColumnChanged ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeSortable a) =>
a
-> m ()
treeSortableSortColumnChanged :: a -> m ()
treeSortableSortColumnChanged sortable :: a
sortable = TreeSortableSortColumnChangedCallback -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (TreeSortableSortColumnChangedCallback -> m ())
-> TreeSortableSortColumnChangedCallback -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeSortable
sortable' <- a -> IO (Ptr TreeSortable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sortable
Ptr TreeSortable -> TreeSortableSortColumnChangedCallback
gtk_tree_sortable_sort_column_changed Ptr TreeSortable
sortable'
a -> TreeSortableSortColumnChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TreeSortableSortColumnChangedCallback
touchManagedPtr a
sortable
() -> TreeSortableSortColumnChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TreeSortableSortColumnChangedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsTreeSortable a) => O.MethodInfo TreeSortableSortColumnChangedMethodInfo a signature where
overloadedMethod = treeSortableSortColumnChanged
#endif