#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.FileIcon
(
FileIcon(..) ,
IsFileIcon ,
toFileIcon ,
noFileIcon ,
#if ENABLE_OVERLOADING
FileIconGetFileMethodInfo ,
#endif
fileIconGetFile ,
fileIconNew ,
#if ENABLE_OVERLOADING
FileIconFilePropertyInfo ,
#endif
constructFileIconFile ,
#if ENABLE_OVERLOADING
fileIconFile ,
#endif
getFileIconFile ,
) 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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.File as Gio.File
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Icon as Gio.Icon
import {-# SOURCE #-} qualified GI.Gio.Interfaces.LoadableIcon as Gio.LoadableIcon
newtype FileIcon = FileIcon (ManagedPtr FileIcon)
foreign import ccall "g_file_icon_get_type"
c_g_file_icon_get_type :: IO GType
instance GObject FileIcon where
gobjectType = c_g_file_icon_get_type
class (GObject o, O.IsDescendantOf FileIcon o) => IsFileIcon o
instance (GObject o, O.IsDescendantOf FileIcon o) => IsFileIcon o
instance O.HasParentTypes FileIcon
type instance O.ParentTypes FileIcon = '[GObject.Object.Object, Gio.Icon.Icon, Gio.LoadableIcon.LoadableIcon]
toFileIcon :: (MonadIO m, IsFileIcon o) => o -> m FileIcon
toFileIcon = liftIO . unsafeCastTo FileIcon
noFileIcon :: Maybe FileIcon
noFileIcon = Nothing
#if ENABLE_OVERLOADING
type family ResolveFileIconMethod (t :: Symbol) (o :: *) :: * where
ResolveFileIconMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFileIconMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFileIconMethod "equal" o = Gio.Icon.IconEqualMethodInfo
ResolveFileIconMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFileIconMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFileIconMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFileIconMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFileIconMethod "load" o = Gio.LoadableIcon.LoadableIconLoadMethodInfo
ResolveFileIconMethod "loadAsync" o = Gio.LoadableIcon.LoadableIconLoadAsyncMethodInfo
ResolveFileIconMethod "loadFinish" o = Gio.LoadableIcon.LoadableIconLoadFinishMethodInfo
ResolveFileIconMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFileIconMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFileIconMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFileIconMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFileIconMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFileIconMethod "serialize" o = Gio.Icon.IconSerializeMethodInfo
ResolveFileIconMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFileIconMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFileIconMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFileIconMethod "toString" o = Gio.Icon.IconToStringMethodInfo
ResolveFileIconMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFileIconMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFileIconMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFileIconMethod "getFile" o = FileIconGetFileMethodInfo
ResolveFileIconMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFileIconMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFileIconMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFileIconMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveFileIconMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFileIconMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileIconMethod t FileIcon, O.MethodInfo info FileIcon p) => OL.IsLabel t (FileIcon -> 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
getFileIconFile :: (MonadIO m, IsFileIcon o) => o -> m Gio.File.File
getFileIconFile obj = liftIO $ checkUnexpectedNothing "getFileIconFile" $ B.Properties.getObjectPropertyObject obj "file" Gio.File.File
constructFileIconFile :: (IsFileIcon o, Gio.File.IsFile a) => a -> IO (GValueConstruct o)
constructFileIconFile val = B.Properties.constructObjectPropertyObject "file" (Just val)
#if ENABLE_OVERLOADING
data FileIconFilePropertyInfo
instance AttrInfo FileIconFilePropertyInfo where
type AttrAllowedOps FileIconFilePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileIconFilePropertyInfo = Gio.File.IsFile
type AttrBaseTypeConstraint FileIconFilePropertyInfo = IsFileIcon
type AttrGetType FileIconFilePropertyInfo = Gio.File.File
type AttrLabel FileIconFilePropertyInfo = "file"
type AttrOrigin FileIconFilePropertyInfo = FileIcon
attrGet _ = getFileIconFile
attrSet _ = undefined
attrConstruct _ = constructFileIconFile
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList FileIcon
type instance O.AttributeList FileIcon = FileIconAttributeList
type FileIconAttributeList = ('[ '("file", FileIconFilePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
fileIconFile :: AttrLabelProxy "file"
fileIconFile = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList FileIcon = FileIconSignalList
type FileIconSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_file_icon_new" g_file_icon_new ::
Ptr Gio.File.File ->
IO (Ptr FileIcon)
fileIconNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a) =>
a
-> m FileIcon
fileIconNew file = liftIO $ do
file' <- unsafeManagedPtrCastPtr file
result <- g_file_icon_new file'
checkUnexpectedReturnNULL "fileIconNew" result
result' <- (wrapObject FileIcon) result
touchManagedPtr file
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_file_icon_get_file" g_file_icon_get_file ::
Ptr FileIcon ->
IO (Ptr Gio.File.File)
fileIconGetFile ::
(B.CallStack.HasCallStack, MonadIO m, IsFileIcon a) =>
a
-> m Gio.File.File
fileIconGetFile icon = liftIO $ do
icon' <- unsafeManagedPtrCastPtr icon
result <- g_file_icon_get_file icon'
checkUnexpectedReturnNULL "fileIconGetFile" result
result' <- (newObject Gio.File.File) result
touchManagedPtr icon
return result'
#if ENABLE_OVERLOADING
data FileIconGetFileMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsFileIcon a) => O.MethodInfo FileIconGetFileMethodInfo a signature where
overloadedMethod _ = fileIconGetFile
#endif