#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gtk.Interfaces.TreeSortable
(
TreeSortable(..) ,
noTreeSortable ,
IsTreeSortable ,
toTreeSortable ,
#if ENABLE_OVERLOADING
TreeSortableGetSortColumnIdMethodInfo ,
#endif
treeSortableGetSortColumnId ,
#if ENABLE_OVERLOADING
TreeSortableHasDefaultSortFuncMethodInfo,
#endif
treeSortableHasDefaultSortFunc ,
#if ENABLE_OVERLOADING
TreeSortableSetDefaultSortFuncMethodInfo,
#endif
treeSortableSetDefaultSortFunc ,
#if ENABLE_OVERLOADING
TreeSortableSetSortColumnIdMethodInfo ,
#endif
treeSortableSetSortColumnId ,
#if ENABLE_OVERLOADING
TreeSortableSetSortFuncMethodInfo ,
#endif
treeSortableSetSortFunc ,
#if ENABLE_OVERLOADING
TreeSortableSortColumnChangedMethodInfo ,
#endif
treeSortableSortColumnChanged ,
C_TreeSortableSortColumnChangedCallback ,
TreeSortableSortColumnChangedCallback ,
#if 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.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
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)
noTreeSortable :: Maybe TreeSortable
noTreeSortable = Nothing
type TreeSortableSortColumnChangedCallback =
IO ()
noTreeSortableSortColumnChangedCallback :: Maybe TreeSortableSortColumnChangedCallback
noTreeSortableSortColumnChangedCallback = Nothing
type C_TreeSortableSortColumnChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_TreeSortableSortColumnChangedCallback :: C_TreeSortableSortColumnChangedCallback -> IO (FunPtr C_TreeSortableSortColumnChangedCallback)
genClosure_TreeSortableSortColumnChanged :: TreeSortableSortColumnChangedCallback -> IO Closure
genClosure_TreeSortableSortColumnChanged cb = do
let cb' = wrap_TreeSortableSortColumnChangedCallback cb
mk_TreeSortableSortColumnChangedCallback cb' >>= newCClosure
wrap_TreeSortableSortColumnChangedCallback ::
TreeSortableSortColumnChangedCallback ->
C_TreeSortableSortColumnChangedCallback
wrap_TreeSortableSortColumnChangedCallback _cb _ _ = do
_cb
onTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => a -> TreeSortableSortColumnChangedCallback -> m SignalHandlerId
onTreeSortableSortColumnChanged obj cb = liftIO $ do
let cb' = wrap_TreeSortableSortColumnChangedCallback cb
cb'' <- mk_TreeSortableSortColumnChangedCallback cb'
connectSignalFunPtr obj "sort-column-changed" cb'' SignalConnectBefore
afterTreeSortableSortColumnChanged :: (IsTreeSortable a, MonadIO m) => a -> TreeSortableSortColumnChangedCallback -> m SignalHandlerId
afterTreeSortableSortColumnChanged obj cb = liftIO $ do
let cb' = wrap_TreeSortableSortColumnChangedCallback cb
cb'' <- mk_TreeSortableSortColumnChangedCallback cb'
connectSignalFunPtr obj "sort-column-changed" cb'' SignalConnectAfter
#if ENABLE_OVERLOADING
data TreeSortableSortColumnChangedSignalInfo
instance SignalInfo TreeSortableSortColumnChangedSignalInfo where
type HaskellCallbackType TreeSortableSortColumnChangedSignalInfo = TreeSortableSortColumnChangedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_TreeSortableSortColumnChangedCallback cb
cb'' <- mk_TreeSortableSortColumnChangedCallback cb'
connectSignalFunPtr obj "sort-column-changed" cb'' connectMode
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 _ = c_gtk_tree_sortable_get_type
class GObject o => IsTreeSortable o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError TreeSortable a) =>
IsTreeSortable a
#endif
instance IsTreeSortable TreeSortable
instance Gtk.TreeModel.IsTreeModel TreeSortable
instance GObject.Object.IsObject TreeSortable
toTreeSortable :: (MonadIO m, IsTreeSortable o) => o -> m TreeSortable
toTreeSortable = liftIO . unsafeCastTo TreeSortable
#if ENABLE_OVERLOADING
instance O.HasAttributeList TreeSortable
type instance O.AttributeList TreeSortable = TreeSortableAttributeList
type TreeSortableAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if 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 "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) => O.IsLabelProxy t (TreeSortable -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveTreeSortableMethod t TreeSortable, O.MethodInfo info TreeSortable p) => O.IsLabel t (TreeSortable -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#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 sortable = liftIO $ do
sortable' <- unsafeManagedPtrCastPtr sortable
sortColumnId <- allocMem :: IO (Ptr Int32)
order <- allocMem :: IO (Ptr CUInt)
result <- gtk_tree_sortable_get_sort_column_id sortable' sortColumnId order
let result' = (/= 0) result
sortColumnId' <- peek sortColumnId
order' <- peek order
let order'' = (toEnum . fromIntegral) order'
touchManagedPtr sortable
freeMem sortColumnId
freeMem order
return (result', sortColumnId', order'')
#if 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 sortable = liftIO $ do
sortable' <- unsafeManagedPtrCastPtr sortable
result <- gtk_tree_sortable_has_default_sort_func sortable'
let result' = (/= 0) result
touchManagedPtr sortable
return result'
#if 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 sortable sortFunc = liftIO $ do
sortable' <- unsafeManagedPtrCastPtr sortable
sortFunc' <- Gtk.Callbacks.mk_TreeIterCompareFunc (Gtk.Callbacks.wrap_TreeIterCompareFunc Nothing (Gtk.Callbacks.drop_closures_TreeIterCompareFunc sortFunc))
let userData = castFunPtrToPtr sortFunc'
let destroy = safeFreeFunPtrPtr
gtk_tree_sortable_set_default_sort_func sortable' sortFunc' userData destroy
touchManagedPtr sortable
return ()
#if 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 sortable sortColumnId order = liftIO $ do
sortable' <- unsafeManagedPtrCastPtr sortable
let order' = (fromIntegral . fromEnum) order
gtk_tree_sortable_set_sort_column_id sortable' sortColumnId order'
touchManagedPtr sortable
return ()
#if 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 sortable sortColumnId sortFunc = liftIO $ do
sortable' <- unsafeManagedPtrCastPtr sortable
sortFunc' <- Gtk.Callbacks.mk_TreeIterCompareFunc (Gtk.Callbacks.wrap_TreeIterCompareFunc Nothing (Gtk.Callbacks.drop_closures_TreeIterCompareFunc sortFunc))
let userData = castFunPtrToPtr sortFunc'
let destroy = safeFreeFunPtrPtr
gtk_tree_sortable_set_sort_func sortable' sortColumnId sortFunc' userData destroy
touchManagedPtr sortable
return ()
#if 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 sortable = liftIO $ do
sortable' <- unsafeManagedPtrCastPtr sortable
gtk_tree_sortable_sort_column_changed sortable'
touchManagedPtr sortable
return ()
#if ENABLE_OVERLOADING
data TreeSortableSortColumnChangedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsTreeSortable a) => O.MethodInfo TreeSortableSortColumnChangedMethodInfo a signature where
overloadedMethod _ = treeSortableSortColumnChanged
#endif