{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Structs.SelectionData
(
SelectionData(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveSelectionDataMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SelectionDataCopyMethodInfo ,
#endif
selectionDataCopy ,
#if defined(ENABLE_OVERLOADING)
SelectionDataFreeMethodInfo ,
#endif
selectionDataFree ,
#if defined(ENABLE_OVERLOADING)
SelectionDataGetDataMethodInfo ,
#endif
selectionDataGetData ,
#if defined(ENABLE_OVERLOADING)
SelectionDataGetDataTypeMethodInfo ,
#endif
selectionDataGetDataType ,
#if defined(ENABLE_OVERLOADING)
SelectionDataGetDisplayMethodInfo ,
#endif
selectionDataGetDisplay ,
#if defined(ENABLE_OVERLOADING)
SelectionDataGetFormatMethodInfo ,
#endif
selectionDataGetFormat ,
#if defined(ENABLE_OVERLOADING)
SelectionDataGetLengthMethodInfo ,
#endif
selectionDataGetLength ,
#if defined(ENABLE_OVERLOADING)
SelectionDataGetPixbufMethodInfo ,
#endif
selectionDataGetPixbuf ,
#if defined(ENABLE_OVERLOADING)
SelectionDataGetSelectionMethodInfo ,
#endif
selectionDataGetSelection ,
#if defined(ENABLE_OVERLOADING)
SelectionDataGetTargetMethodInfo ,
#endif
selectionDataGetTarget ,
#if defined(ENABLE_OVERLOADING)
SelectionDataGetTargetsMethodInfo ,
#endif
selectionDataGetTargets ,
#if defined(ENABLE_OVERLOADING)
SelectionDataGetTextMethodInfo ,
#endif
selectionDataGetText ,
#if defined(ENABLE_OVERLOADING)
SelectionDataGetUrisMethodInfo ,
#endif
selectionDataGetUris ,
#if defined(ENABLE_OVERLOADING)
SelectionDataSetMethodInfo ,
#endif
selectionDataSet ,
#if defined(ENABLE_OVERLOADING)
SelectionDataSetPixbufMethodInfo ,
#endif
selectionDataSetPixbuf ,
#if defined(ENABLE_OVERLOADING)
SelectionDataSetTextMethodInfo ,
#endif
selectionDataSetText ,
#if defined(ENABLE_OVERLOADING)
SelectionDataSetUrisMethodInfo ,
#endif
selectionDataSetUris ,
#if defined(ENABLE_OVERLOADING)
SelectionDataTargetsIncludeImageMethodInfo,
#endif
selectionDataTargetsIncludeImage ,
#if defined(ENABLE_OVERLOADING)
SelectionDataTargetsIncludeRichTextMethodInfo,
#endif
selectionDataTargetsIncludeRichText ,
#if defined(ENABLE_OVERLOADING)
SelectionDataTargetsIncludeTextMethodInfo,
#endif
selectionDataTargetsIncludeText ,
#if defined(ENABLE_OVERLOADING)
SelectionDataTargetsIncludeUriMethodInfo,
#endif
selectionDataTargetsIncludeUri ,
) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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 Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.Atk.Interfaces.ImplementorIface as Atk.ImplementorIface
import qualified GI.Atk.Objects.Object as Atk.Object
import qualified GI.Cairo.Structs.Context as Cairo.Context
import qualified GI.Cairo.Structs.FontOptions as Cairo.FontOptions
import qualified GI.Cairo.Structs.Region as Cairo.Region
import qualified GI.Cairo.Structs.Surface as Cairo.Surface
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.MarkupParser as GLib.MarkupParser
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Enums as Gdk.Enums
import qualified GI.Gdk.Flags as Gdk.Flags
import qualified GI.Gdk.Objects.Device as Gdk.Device
import qualified GI.Gdk.Objects.Display as Gdk.Display
import qualified GI.Gdk.Objects.DragContext as Gdk.DragContext
import qualified GI.Gdk.Objects.FrameClock as Gdk.FrameClock
import qualified GI.Gdk.Objects.Screen as Gdk.Screen
import qualified GI.Gdk.Objects.Visual as Gdk.Visual
import qualified GI.Gdk.Objects.Window as Gdk.Window
import qualified GI.Gdk.Structs.Atom as Gdk.Atom
import qualified GI.Gdk.Structs.Color as Gdk.Color
import qualified GI.Gdk.Structs.EventAny as Gdk.EventAny
import qualified GI.Gdk.Structs.EventButton as Gdk.EventButton
import qualified GI.Gdk.Structs.EventConfigure as Gdk.EventConfigure
import qualified GI.Gdk.Structs.EventCrossing as Gdk.EventCrossing
import qualified GI.Gdk.Structs.EventExpose as Gdk.EventExpose
import qualified GI.Gdk.Structs.EventFocus as Gdk.EventFocus
import qualified GI.Gdk.Structs.EventGrabBroken as Gdk.EventGrabBroken
import qualified GI.Gdk.Structs.EventKey as Gdk.EventKey
import qualified GI.Gdk.Structs.EventMotion as Gdk.EventMotion
import qualified GI.Gdk.Structs.EventOwnerChange as Gdk.EventOwnerChange
import qualified GI.Gdk.Structs.EventProperty as Gdk.EventProperty
import qualified GI.Gdk.Structs.EventProximity as Gdk.EventProximity
import qualified GI.Gdk.Structs.EventScroll as Gdk.EventScroll
import qualified GI.Gdk.Structs.EventSelection as Gdk.EventSelection
import qualified GI.Gdk.Structs.EventVisibility as Gdk.EventVisibility
import qualified GI.Gdk.Structs.EventWindowState as Gdk.EventWindowState
import qualified GI.Gdk.Structs.Geometry as Gdk.Geometry
import qualified GI.Gdk.Structs.RGBA as Gdk.RGBA
import qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import qualified GI.Gdk.Unions.Event as Gdk.Event
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Interfaces.ActionGroup as Gio.ActionGroup
import qualified GI.Gio.Interfaces.ActionMap as Gio.ActionMap
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Objects.Application as Gio.Application
import qualified GI.Gio.Objects.Menu as Gio.Menu
import qualified GI.Gio.Objects.MenuModel as Gio.MenuModel
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Flags as Gtk.Flags
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.StyleProvider as Gtk.StyleProvider
import {-# SOURCE #-} qualified GI.Gtk.Objects.AccelGroup as Gtk.AccelGroup
import {-# SOURCE #-} qualified GI.Gtk.Objects.Adjustment as Gtk.Adjustment
import {-# SOURCE #-} qualified GI.Gtk.Objects.Application as Gtk.Application
import {-# SOURCE #-} qualified GI.Gtk.Objects.Bin as Gtk.Bin
import {-# SOURCE #-} qualified GI.Gtk.Objects.Builder as Gtk.Builder
import {-# SOURCE #-} qualified GI.Gtk.Objects.Clipboard as Gtk.Clipboard
import {-# SOURCE #-} qualified GI.Gtk.Objects.Container as Gtk.Container
import {-# SOURCE #-} qualified GI.Gtk.Objects.IconFactory as Gtk.IconFactory
import {-# SOURCE #-} qualified GI.Gtk.Objects.RcStyle as Gtk.RcStyle
import {-# SOURCE #-} qualified GI.Gtk.Objects.Settings as Gtk.Settings
import {-# SOURCE #-} qualified GI.Gtk.Objects.Style as Gtk.Style
import {-# SOURCE #-} qualified GI.Gtk.Objects.StyleContext as Gtk.StyleContext
import {-# SOURCE #-} qualified GI.Gtk.Objects.StyleProperties as Gtk.StyleProperties
import {-# SOURCE #-} qualified GI.Gtk.Objects.TextBuffer as Gtk.TextBuffer
import {-# SOURCE #-} qualified GI.Gtk.Objects.TextChildAnchor as Gtk.TextChildAnchor
import {-# SOURCE #-} qualified GI.Gtk.Objects.TextMark as Gtk.TextMark
import {-# SOURCE #-} qualified GI.Gtk.Objects.TextTag as Gtk.TextTag
import {-# SOURCE #-} qualified GI.Gtk.Objects.TextTagTable as Gtk.TextTagTable
import {-# SOURCE #-} qualified GI.Gtk.Objects.Tooltip as Gtk.Tooltip
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
import {-# SOURCE #-} qualified GI.Gtk.Objects.Window as Gtk.Window
import {-# SOURCE #-} qualified GI.Gtk.Objects.WindowGroup as Gtk.WindowGroup
import {-# SOURCE #-} qualified GI.Gtk.Structs.AccelGroupEntry as Gtk.AccelGroupEntry
import {-# SOURCE #-} qualified GI.Gtk.Structs.AccelKey as Gtk.AccelKey
import {-# SOURCE #-} qualified GI.Gtk.Structs.Border as Gtk.Border
import {-# SOURCE #-} qualified GI.Gtk.Structs.CssSection as Gtk.CssSection
import {-# SOURCE #-} qualified GI.Gtk.Structs.IconSet as Gtk.IconSet
import {-# SOURCE #-} qualified GI.Gtk.Structs.IconSource as Gtk.IconSource
import {-# SOURCE #-} qualified GI.Gtk.Structs.Requisition as Gtk.Requisition
import {-# SOURCE #-} qualified GI.Gtk.Structs.SettingsValue as Gtk.SettingsValue
import {-# SOURCE #-} qualified GI.Gtk.Structs.SymbolicColor as Gtk.SymbolicColor
import {-# SOURCE #-} qualified GI.Gtk.Structs.TargetEntry as Gtk.TargetEntry
import {-# SOURCE #-} qualified GI.Gtk.Structs.TargetList as Gtk.TargetList
import {-# SOURCE #-} qualified GI.Gtk.Structs.TextAppearance as Gtk.TextAppearance
import {-# SOURCE #-} qualified GI.Gtk.Structs.TextAttributes as Gtk.TextAttributes
import {-# SOURCE #-} qualified GI.Gtk.Structs.TextIter as Gtk.TextIter
import {-# SOURCE #-} qualified GI.Gtk.Structs.WidgetPath as Gtk.WidgetPath
import qualified GI.Pango.Enums as Pango.Enums
import qualified GI.Pango.Objects.Context as Pango.Context
import qualified GI.Pango.Objects.FontMap as Pango.FontMap
import qualified GI.Pango.Objects.Layout as Pango.Layout
import qualified GI.Pango.Structs.FontDescription as Pango.FontDescription
import qualified GI.Pango.Structs.Language as Pango.Language
import qualified GI.Pango.Structs.TabArray as Pango.TabArray
#else
import qualified GI.Gdk.Objects.Display as Gdk.Display
import qualified GI.Gdk.Structs.Atom as Gdk.Atom
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import {-# SOURCE #-} qualified GI.Gtk.Objects.TextBuffer as Gtk.TextBuffer
#endif
newtype SelectionData = SelectionData (SP.ManagedPtr SelectionData)
deriving (SelectionData -> SelectionData -> Bool
(SelectionData -> SelectionData -> Bool)
-> (SelectionData -> SelectionData -> Bool) -> Eq SelectionData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SelectionData -> SelectionData -> Bool
== :: SelectionData -> SelectionData -> Bool
$c/= :: SelectionData -> SelectionData -> Bool
/= :: SelectionData -> SelectionData -> Bool
Eq)
instance SP.ManagedPtrNewtype SelectionData where
toManagedPtr :: SelectionData -> ManagedPtr SelectionData
toManagedPtr (SelectionData ManagedPtr SelectionData
p) = ManagedPtr SelectionData
p
foreign import ccall "gtk_selection_data_get_type" c_gtk_selection_data_get_type ::
IO GType
type instance O.ParentTypes SelectionData = '[]
instance O.HasParentTypes SelectionData
instance B.Types.TypedObject SelectionData where
glibType :: IO GType
glibType = IO GType
c_gtk_selection_data_get_type
instance B.Types.GBoxed SelectionData
instance B.GValue.IsGValue (Maybe SelectionData) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_selection_data_get_type
gvalueSet_ :: Ptr GValue -> Maybe SelectionData -> IO ()
gvalueSet_ Ptr GValue
gv Maybe SelectionData
P.Nothing = Ptr GValue -> Ptr SelectionData -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr SelectionData
forall a. Ptr a
FP.nullPtr :: FP.Ptr SelectionData)
gvalueSet_ Ptr GValue
gv (P.Just SelectionData
obj) = SelectionData -> (Ptr SelectionData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SelectionData
obj (Ptr GValue -> Ptr SelectionData -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe SelectionData)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr SelectionData)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr SelectionData)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newBoxed SelectionData ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SelectionData
type instance O.AttributeList SelectionData = SelectionDataAttributeList
type SelectionDataAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gtk_selection_data_copy" gtk_selection_data_copy ::
Ptr SelectionData ->
IO (Ptr SelectionData)
selectionDataCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m SelectionData
selectionDataCopy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m SelectionData
selectionDataCopy SelectionData
data_ = IO SelectionData -> m SelectionData
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SelectionData -> m SelectionData)
-> IO SelectionData -> m SelectionData
forall a b. (a -> b) -> a -> b
$ do
data_' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
data_
result <- gtk_selection_data_copy data_'
checkUnexpectedReturnNULL "selectionDataCopy" result
result' <- (wrapBoxed SelectionData) result
touchManagedPtr data_
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataCopyMethodInfo
instance (signature ~ (m SelectionData), MonadIO m) => O.OverloadedMethod SelectionDataCopyMethodInfo SelectionData signature where
overloadedMethod = selectionDataCopy
instance O.OverloadedMethodInfo SelectionDataCopyMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataCopy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataCopy"
})
#endif
foreign import ccall "gtk_selection_data_free" gtk_selection_data_free ::
Ptr SelectionData ->
IO ()
selectionDataFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m ()
selectionDataFree :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m ()
selectionDataFree SelectionData
data_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
data_' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
data_
gtk_selection_data_free data_'
touchManagedPtr data_
return ()
#if defined(ENABLE_OVERLOADING)
data SelectionDataFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod SelectionDataFreeMethodInfo SelectionData signature where
overloadedMethod = selectionDataFree
instance O.OverloadedMethodInfo SelectionDataFreeMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataFree"
})
#endif
foreign import ccall "gtk_selection_data_get_data_type" gtk_selection_data_get_data_type ::
Ptr SelectionData ->
IO (Ptr Gdk.Atom.Atom)
selectionDataGetDataType ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m Gdk.Atom.Atom
selectionDataGetDataType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m Atom
selectionDataGetDataType SelectionData
selectionData = IO Atom -> m Atom
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Atom -> m Atom) -> IO Atom -> m Atom
forall a b. (a -> b) -> a -> b
$ do
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
result <- gtk_selection_data_get_data_type selectionData'
checkUnexpectedReturnNULL "selectionDataGetDataType" result
result' <- (newPtr Gdk.Atom.Atom) result
touchManagedPtr selectionData
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataGetDataTypeMethodInfo
instance (signature ~ (m Gdk.Atom.Atom), MonadIO m) => O.OverloadedMethod SelectionDataGetDataTypeMethodInfo SelectionData signature where
overloadedMethod = selectionDataGetDataType
instance O.OverloadedMethodInfo SelectionDataGetDataTypeMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataGetDataType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataGetDataType"
})
#endif
foreign import ccall "gtk_selection_data_get_data_with_length" gtk_selection_data_get_data_with_length ::
Ptr SelectionData ->
Ptr Int32 ->
IO (Ptr Word8)
selectionDataGetData ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m ByteString
selectionDataGetData :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m ByteString
selectionDataGetData SelectionData
selectionData = IO ByteString -> m ByteString
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ByteString -> m ByteString) -> IO ByteString -> m ByteString
forall a b. (a -> b) -> a -> b
$ do
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
length_ <- allocMem :: IO (Ptr Int32)
result <- gtk_selection_data_get_data_with_length selectionData' length_
length_' <- peek length_
checkUnexpectedReturnNULL "selectionDataGetData" result
result' <- (unpackByteStringWithLength length_') result
touchManagedPtr selectionData
freeMem length_
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataGetDataMethodInfo
instance (signature ~ (m ByteString), MonadIO m) => O.OverloadedMethod SelectionDataGetDataMethodInfo SelectionData signature where
overloadedMethod = selectionDataGetData
instance O.OverloadedMethodInfo SelectionDataGetDataMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataGetData",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataGetData"
})
#endif
foreign import ccall "gtk_selection_data_get_display" gtk_selection_data_get_display ::
Ptr SelectionData ->
IO (Ptr Gdk.Display.Display)
selectionDataGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m Gdk.Display.Display
selectionDataGetDisplay :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m Display
selectionDataGetDisplay SelectionData
selectionData = IO Display -> m Display
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ do
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
result <- gtk_selection_data_get_display selectionData'
checkUnexpectedReturnNULL "selectionDataGetDisplay" result
result' <- (newObject Gdk.Display.Display) result
touchManagedPtr selectionData
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataGetDisplayMethodInfo
instance (signature ~ (m Gdk.Display.Display), MonadIO m) => O.OverloadedMethod SelectionDataGetDisplayMethodInfo SelectionData signature where
overloadedMethod = selectionDataGetDisplay
instance O.OverloadedMethodInfo SelectionDataGetDisplayMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataGetDisplay",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataGetDisplay"
})
#endif
foreign import ccall "gtk_selection_data_get_format" gtk_selection_data_get_format ::
Ptr SelectionData ->
IO Int32
selectionDataGetFormat ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m Int32
selectionDataGetFormat :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m Int32
selectionDataGetFormat SelectionData
selectionData = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
result <- gtk_selection_data_get_format selectionData'
touchManagedPtr selectionData
return result
#if defined(ENABLE_OVERLOADING)
data SelectionDataGetFormatMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.OverloadedMethod SelectionDataGetFormatMethodInfo SelectionData signature where
overloadedMethod = selectionDataGetFormat
instance O.OverloadedMethodInfo SelectionDataGetFormatMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataGetFormat",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataGetFormat"
})
#endif
foreign import ccall "gtk_selection_data_get_length" gtk_selection_data_get_length ::
Ptr SelectionData ->
IO Int32
selectionDataGetLength ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m Int32
selectionDataGetLength :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m Int32
selectionDataGetLength SelectionData
selectionData = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
result <- gtk_selection_data_get_length selectionData'
touchManagedPtr selectionData
return result
#if defined(ENABLE_OVERLOADING)
data SelectionDataGetLengthMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.OverloadedMethod SelectionDataGetLengthMethodInfo SelectionData signature where
overloadedMethod = selectionDataGetLength
instance O.OverloadedMethodInfo SelectionDataGetLengthMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataGetLength",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataGetLength"
})
#endif
foreign import ccall "gtk_selection_data_get_pixbuf" gtk_selection_data_get_pixbuf ::
Ptr SelectionData ->
IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)
selectionDataGetPixbuf ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m (Maybe GdkPixbuf.Pixbuf.Pixbuf)
selectionDataGetPixbuf :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m (Maybe Pixbuf)
selectionDataGetPixbuf SelectionData
selectionData = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
result <- gtk_selection_data_get_pixbuf selectionData'
maybeResult <- convertIfNonNull result $ \Ptr Pixbuf
result' -> do
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
GdkPixbuf.Pixbuf.Pixbuf) Ptr Pixbuf
result'
return result''
touchManagedPtr selectionData
return maybeResult
#if defined(ENABLE_OVERLOADING)
data SelectionDataGetPixbufMethodInfo
instance (signature ~ (m (Maybe GdkPixbuf.Pixbuf.Pixbuf)), MonadIO m) => O.OverloadedMethod SelectionDataGetPixbufMethodInfo SelectionData signature where
overloadedMethod = selectionDataGetPixbuf
instance O.OverloadedMethodInfo SelectionDataGetPixbufMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataGetPixbuf",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataGetPixbuf"
})
#endif
foreign import ccall "gtk_selection_data_get_selection" gtk_selection_data_get_selection ::
Ptr SelectionData ->
IO (Ptr Gdk.Atom.Atom)
selectionDataGetSelection ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m Gdk.Atom.Atom
selectionDataGetSelection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m Atom
selectionDataGetSelection SelectionData
selectionData = IO Atom -> m Atom
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Atom -> m Atom) -> IO Atom -> m Atom
forall a b. (a -> b) -> a -> b
$ do
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
result <- gtk_selection_data_get_selection selectionData'
checkUnexpectedReturnNULL "selectionDataGetSelection" result
result' <- (newPtr Gdk.Atom.Atom) result
touchManagedPtr selectionData
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataGetSelectionMethodInfo
instance (signature ~ (m Gdk.Atom.Atom), MonadIO m) => O.OverloadedMethod SelectionDataGetSelectionMethodInfo SelectionData signature where
overloadedMethod = selectionDataGetSelection
instance O.OverloadedMethodInfo SelectionDataGetSelectionMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataGetSelection",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataGetSelection"
})
#endif
foreign import ccall "gtk_selection_data_get_target" gtk_selection_data_get_target ::
Ptr SelectionData ->
IO (Ptr Gdk.Atom.Atom)
selectionDataGetTarget ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m Gdk.Atom.Atom
selectionDataGetTarget :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m Atom
selectionDataGetTarget SelectionData
selectionData = IO Atom -> m Atom
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Atom -> m Atom) -> IO Atom -> m Atom
forall a b. (a -> b) -> a -> b
$ do
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
result <- gtk_selection_data_get_target selectionData'
checkUnexpectedReturnNULL "selectionDataGetTarget" result
result' <- (newPtr Gdk.Atom.Atom) result
touchManagedPtr selectionData
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataGetTargetMethodInfo
instance (signature ~ (m Gdk.Atom.Atom), MonadIO m) => O.OverloadedMethod SelectionDataGetTargetMethodInfo SelectionData signature where
overloadedMethod = selectionDataGetTarget
instance O.OverloadedMethodInfo SelectionDataGetTargetMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataGetTarget",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataGetTarget"
})
#endif
foreign import ccall "gtk_selection_data_get_targets" gtk_selection_data_get_targets ::
Ptr SelectionData ->
Ptr (Ptr (Ptr Gdk.Atom.Atom)) ->
Ptr Int32 ->
IO CInt
selectionDataGetTargets ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m ((Bool, [Gdk.Atom.Atom]))
selectionDataGetTargets :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m (Bool, [Atom])
selectionDataGetTargets SelectionData
selectionData = IO (Bool, [Atom]) -> m (Bool, [Atom])
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, [Atom]) -> m (Bool, [Atom]))
-> IO (Bool, [Atom]) -> m (Bool, [Atom])
forall a b. (a -> b) -> a -> b
$ do
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
targets <- callocMem :: IO (Ptr (Ptr (Ptr Gdk.Atom.Atom)))
nAtoms <- allocMem :: IO (Ptr Int32)
result <- gtk_selection_data_get_targets selectionData' targets nAtoms
nAtoms' <- peek nAtoms
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
targets' <- peek targets
targets'' <- (unpackPtrArrayWithLength nAtoms') targets'
targets''' <- mapM (newPtr Gdk.Atom.Atom) targets''
freeMem targets'
touchManagedPtr selectionData
freeMem targets
freeMem nAtoms
return (result', targets''')
#if defined(ENABLE_OVERLOADING)
data SelectionDataGetTargetsMethodInfo
instance (signature ~ (m ((Bool, [Gdk.Atom.Atom]))), MonadIO m) => O.OverloadedMethod SelectionDataGetTargetsMethodInfo SelectionData signature where
overloadedMethod = selectionDataGetTargets
instance O.OverloadedMethodInfo SelectionDataGetTargetsMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataGetTargets",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataGetTargets"
})
#endif
foreign import ccall "gtk_selection_data_get_text" gtk_selection_data_get_text ::
Ptr SelectionData ->
IO CString
selectionDataGetText ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m (Maybe T.Text)
selectionDataGetText :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m (Maybe Text)
selectionDataGetText SelectionData
selectionData = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
result <- gtk_selection_data_get_text selectionData'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
freeMem result'
return result''
touchManagedPtr selectionData
return maybeResult
#if defined(ENABLE_OVERLOADING)
data SelectionDataGetTextMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.OverloadedMethod SelectionDataGetTextMethodInfo SelectionData signature where
overloadedMethod = selectionDataGetText
instance O.OverloadedMethodInfo SelectionDataGetTextMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataGetText",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataGetText"
})
#endif
foreign import ccall "gtk_selection_data_get_uris" gtk_selection_data_get_uris ::
Ptr SelectionData ->
IO (Ptr CString)
selectionDataGetUris ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m [T.Text]
selectionDataGetUris :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m [Text]
selectionDataGetUris SelectionData
selectionData = IO [Text] -> m [Text]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
result <- gtk_selection_data_get_uris selectionData'
checkUnexpectedReturnNULL "selectionDataGetUris" result
result' <- unpackZeroTerminatedUTF8CArray result
mapZeroTerminatedCArray freeMem result
freeMem result
touchManagedPtr selectionData
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataGetUrisMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m) => O.OverloadedMethod SelectionDataGetUrisMethodInfo SelectionData signature where
overloadedMethod = selectionDataGetUris
instance O.OverloadedMethodInfo SelectionDataGetUrisMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataGetUris",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataGetUris"
})
#endif
foreign import ccall "gtk_selection_data_set" gtk_selection_data_set ::
Ptr SelectionData ->
Ptr Gdk.Atom.Atom ->
Int32 ->
Ptr Word8 ->
Int32 ->
IO ()
selectionDataSet ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> Gdk.Atom.Atom
-> Int32
-> ByteString
-> m ()
selectionDataSet :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> Atom -> Int32 -> ByteString -> m ()
selectionDataSet SelectionData
selectionData Atom
type_ Int32
format ByteString
data_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
let length_ :: Int32
length_ = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
data_
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
type_' <- unsafeManagedPtrGetPtr type_
data_' <- packByteString data_
gtk_selection_data_set selectionData' type_' format data_' length_
touchManagedPtr selectionData
touchManagedPtr type_
freeMem data_'
return ()
#if defined(ENABLE_OVERLOADING)
data SelectionDataSetMethodInfo
instance (signature ~ (Gdk.Atom.Atom -> Int32 -> ByteString -> m ()), MonadIO m) => O.OverloadedMethod SelectionDataSetMethodInfo SelectionData signature where
overloadedMethod = selectionDataSet
instance O.OverloadedMethodInfo SelectionDataSetMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataSet",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataSet"
})
#endif
foreign import ccall "gtk_selection_data_set_pixbuf" gtk_selection_data_set_pixbuf ::
Ptr SelectionData ->
Ptr GdkPixbuf.Pixbuf.Pixbuf ->
IO CInt
selectionDataSetPixbuf ::
(B.CallStack.HasCallStack, MonadIO m, GdkPixbuf.Pixbuf.IsPixbuf a) =>
SelectionData
-> a
-> m Bool
selectionDataSetPixbuf :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPixbuf a) =>
SelectionData -> a -> m Bool
selectionDataSetPixbuf SelectionData
selectionData a
pixbuf = IO Bool -> m Bool
forall a. IO a -> m a
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
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
pixbuf' <- unsafeManagedPtrCastPtr pixbuf
result <- gtk_selection_data_set_pixbuf selectionData' pixbuf'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr selectionData
touchManagedPtr pixbuf
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataSetPixbufMethodInfo
instance (signature ~ (a -> m Bool), MonadIO m, GdkPixbuf.Pixbuf.IsPixbuf a) => O.OverloadedMethod SelectionDataSetPixbufMethodInfo SelectionData signature where
overloadedMethod = selectionDataSetPixbuf
instance O.OverloadedMethodInfo SelectionDataSetPixbufMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataSetPixbuf",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataSetPixbuf"
})
#endif
foreign import ccall "gtk_selection_data_set_text" gtk_selection_data_set_text ::
Ptr SelectionData ->
CString ->
Int32 ->
IO CInt
selectionDataSetText ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> T.Text
-> Int32
-> m Bool
selectionDataSetText :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> Text -> Int32 -> m Bool
selectionDataSetText SelectionData
selectionData Text
str Int32
len = IO Bool -> m Bool
forall a. IO a -> m a
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
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
str' <- textToCString str
result <- gtk_selection_data_set_text selectionData' str' len
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr selectionData
freeMem str'
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataSetTextMethodInfo
instance (signature ~ (T.Text -> Int32 -> m Bool), MonadIO m) => O.OverloadedMethod SelectionDataSetTextMethodInfo SelectionData signature where
overloadedMethod = selectionDataSetText
instance O.OverloadedMethodInfo SelectionDataSetTextMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataSetText",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataSetText"
})
#endif
foreign import ccall "gtk_selection_data_set_uris" gtk_selection_data_set_uris ::
Ptr SelectionData ->
Ptr CString ->
IO CInt
selectionDataSetUris ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> [T.Text]
-> m Bool
selectionDataSetUris :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> [Text] -> m Bool
selectionDataSetUris SelectionData
selectionData [Text]
uris = IO Bool -> m Bool
forall a. IO a -> m a
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
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
uris' <- packZeroTerminatedUTF8CArray uris
result <- gtk_selection_data_set_uris selectionData' uris'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr selectionData
mapZeroTerminatedCArray freeMem uris'
freeMem uris'
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataSetUrisMethodInfo
instance (signature ~ ([T.Text] -> m Bool), MonadIO m) => O.OverloadedMethod SelectionDataSetUrisMethodInfo SelectionData signature where
overloadedMethod = selectionDataSetUris
instance O.OverloadedMethodInfo SelectionDataSetUrisMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataSetUris",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataSetUris"
})
#endif
foreign import ccall "gtk_selection_data_targets_include_image" gtk_selection_data_targets_include_image ::
Ptr SelectionData ->
CInt ->
IO CInt
selectionDataTargetsIncludeImage ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> Bool
-> m Bool
selectionDataTargetsIncludeImage :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> Bool -> m Bool
selectionDataTargetsIncludeImage SelectionData
selectionData Bool
writable = IO Bool -> m Bool
forall a. IO a -> m a
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
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
let writable' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
writable
result <- gtk_selection_data_targets_include_image selectionData' writable'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr selectionData
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataTargetsIncludeImageMethodInfo
instance (signature ~ (Bool -> m Bool), MonadIO m) => O.OverloadedMethod SelectionDataTargetsIncludeImageMethodInfo SelectionData signature where
overloadedMethod = selectionDataTargetsIncludeImage
instance O.OverloadedMethodInfo SelectionDataTargetsIncludeImageMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataTargetsIncludeImage",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataTargetsIncludeImage"
})
#endif
foreign import ccall "gtk_selection_data_targets_include_rich_text" gtk_selection_data_targets_include_rich_text ::
Ptr SelectionData ->
Ptr Gtk.TextBuffer.TextBuffer ->
IO CInt
selectionDataTargetsIncludeRichText ::
(B.CallStack.HasCallStack, MonadIO m, Gtk.TextBuffer.IsTextBuffer a) =>
SelectionData
-> a
-> m Bool
selectionDataTargetsIncludeRichText :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTextBuffer a) =>
SelectionData -> a -> m Bool
selectionDataTargetsIncludeRichText SelectionData
selectionData a
buffer = IO Bool -> m Bool
forall a. IO a -> m a
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
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
buffer' <- unsafeManagedPtrCastPtr buffer
result <- gtk_selection_data_targets_include_rich_text selectionData' buffer'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr selectionData
touchManagedPtr buffer
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataTargetsIncludeRichTextMethodInfo
instance (signature ~ (a -> m Bool), MonadIO m, Gtk.TextBuffer.IsTextBuffer a) => O.OverloadedMethod SelectionDataTargetsIncludeRichTextMethodInfo SelectionData signature where
overloadedMethod = selectionDataTargetsIncludeRichText
instance O.OverloadedMethodInfo SelectionDataTargetsIncludeRichTextMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataTargetsIncludeRichText",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataTargetsIncludeRichText"
})
#endif
foreign import ccall "gtk_selection_data_targets_include_text" gtk_selection_data_targets_include_text ::
Ptr SelectionData ->
IO CInt
selectionDataTargetsIncludeText ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m Bool
selectionDataTargetsIncludeText :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m Bool
selectionDataTargetsIncludeText SelectionData
selectionData = IO Bool -> m Bool
forall a. IO a -> m a
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
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
result <- gtk_selection_data_targets_include_text selectionData'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr selectionData
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataTargetsIncludeTextMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SelectionDataTargetsIncludeTextMethodInfo SelectionData signature where
overloadedMethod = selectionDataTargetsIncludeText
instance O.OverloadedMethodInfo SelectionDataTargetsIncludeTextMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataTargetsIncludeText",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataTargetsIncludeText"
})
#endif
foreign import ccall "gtk_selection_data_targets_include_uri" gtk_selection_data_targets_include_uri ::
Ptr SelectionData ->
IO CInt
selectionDataTargetsIncludeUri ::
(B.CallStack.HasCallStack, MonadIO m) =>
SelectionData
-> m Bool
selectionDataTargetsIncludeUri :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SelectionData -> m Bool
selectionDataTargetsIncludeUri SelectionData
selectionData = IO Bool -> m Bool
forall a. IO a -> m a
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
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
result <- gtk_selection_data_targets_include_uri selectionData'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr selectionData
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionDataTargetsIncludeUriMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SelectionDataTargetsIncludeUriMethodInfo SelectionData signature where
overloadedMethod = selectionDataTargetsIncludeUri
instance O.OverloadedMethodInfo SelectionDataTargetsIncludeUriMethodInfo SelectionData where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Structs.SelectionData.selectionDataTargetsIncludeUri",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk3-3.0.44/docs/GI-Gtk-Structs-SelectionData.html#v:selectionDataTargetsIncludeUri"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveSelectionDataMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveSelectionDataMethod "copy" o = SelectionDataCopyMethodInfo
ResolveSelectionDataMethod "free" o = SelectionDataFreeMethodInfo
ResolveSelectionDataMethod "set" o = SelectionDataSetMethodInfo
ResolveSelectionDataMethod "targetsIncludeImage" o = SelectionDataTargetsIncludeImageMethodInfo
ResolveSelectionDataMethod "targetsIncludeRichText" o = SelectionDataTargetsIncludeRichTextMethodInfo
ResolveSelectionDataMethod "targetsIncludeText" o = SelectionDataTargetsIncludeTextMethodInfo
ResolveSelectionDataMethod "targetsIncludeUri" o = SelectionDataTargetsIncludeUriMethodInfo
ResolveSelectionDataMethod "getDataType" o = SelectionDataGetDataTypeMethodInfo
ResolveSelectionDataMethod "getData" o = SelectionDataGetDataMethodInfo
ResolveSelectionDataMethod "getDisplay" o = SelectionDataGetDisplayMethodInfo
ResolveSelectionDataMethod "getFormat" o = SelectionDataGetFormatMethodInfo
ResolveSelectionDataMethod "getLength" o = SelectionDataGetLengthMethodInfo
ResolveSelectionDataMethod "getPixbuf" o = SelectionDataGetPixbufMethodInfo
ResolveSelectionDataMethod "getSelection" o = SelectionDataGetSelectionMethodInfo
ResolveSelectionDataMethod "getTarget" o = SelectionDataGetTargetMethodInfo
ResolveSelectionDataMethod "getTargets" o = SelectionDataGetTargetsMethodInfo
ResolveSelectionDataMethod "getText" o = SelectionDataGetTextMethodInfo
ResolveSelectionDataMethod "getUris" o = SelectionDataGetUrisMethodInfo
ResolveSelectionDataMethod "setPixbuf" o = SelectionDataSetPixbufMethodInfo
ResolveSelectionDataMethod "setText" o = SelectionDataSetTextMethodInfo
ResolveSelectionDataMethod "setUris" o = SelectionDataSetUrisMethodInfo
ResolveSelectionDataMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSelectionDataMethod t SelectionData, O.OverloadedMethod info SelectionData p) => OL.IsLabel t (SelectionData -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveSelectionDataMethod t SelectionData, O.OverloadedMethod info SelectionData p, R.HasField t SelectionData p) => R.HasField t SelectionData p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSelectionDataMethod t SelectionData, O.OverloadedMethodInfo info SelectionData) => OL.IsLabel t (O.MethodProxy info SelectionData) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif