#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.GtkSource.Objects.SpaceDrawer
(
SpaceDrawer(..) ,
IsSpaceDrawer ,
toSpaceDrawer ,
noSpaceDrawer ,
#if ENABLE_OVERLOADING
SpaceDrawerBindMatrixSettingMethodInfo ,
#endif
spaceDrawerBindMatrixSetting ,
#if ENABLE_OVERLOADING
SpaceDrawerGetEnableMatrixMethodInfo ,
#endif
spaceDrawerGetEnableMatrix ,
#if ENABLE_OVERLOADING
SpaceDrawerGetMatrixMethodInfo ,
#endif
spaceDrawerGetMatrix ,
#if ENABLE_OVERLOADING
SpaceDrawerGetTypesForLocationsMethodInfo,
#endif
spaceDrawerGetTypesForLocations ,
spaceDrawerNew ,
#if ENABLE_OVERLOADING
SpaceDrawerSetEnableMatrixMethodInfo ,
#endif
spaceDrawerSetEnableMatrix ,
#if ENABLE_OVERLOADING
SpaceDrawerSetMatrixMethodInfo ,
#endif
spaceDrawerSetMatrix ,
#if ENABLE_OVERLOADING
SpaceDrawerSetTypesForLocationsMethodInfo,
#endif
spaceDrawerSetTypesForLocations ,
#if ENABLE_OVERLOADING
SpaceDrawerEnableMatrixPropertyInfo ,
#endif
constructSpaceDrawerEnableMatrix ,
getSpaceDrawerEnableMatrix ,
setSpaceDrawerEnableMatrix ,
#if ENABLE_OVERLOADING
spaceDrawerEnableMatrix ,
#endif
#if ENABLE_OVERLOADING
SpaceDrawerMatrixPropertyInfo ,
#endif
clearSpaceDrawerMatrix ,
constructSpaceDrawerMatrix ,
getSpaceDrawerMatrix ,
setSpaceDrawerMatrix ,
#if ENABLE_OVERLOADING
spaceDrawerMatrix ,
#endif
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.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 qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Objects.Settings as Gio.Settings
import {-# SOURCE #-} qualified GI.GtkSource.Flags as GtkSource.Flags
newtype SpaceDrawer = SpaceDrawer (ManagedPtr SpaceDrawer)
foreign import ccall "gtk_source_space_drawer_get_type"
c_gtk_source_space_drawer_get_type :: IO GType
instance GObject SpaceDrawer where
gobjectType = c_gtk_source_space_drawer_get_type
class (GObject o, O.IsDescendantOf SpaceDrawer o) => IsSpaceDrawer o
instance (GObject o, O.IsDescendantOf SpaceDrawer o) => IsSpaceDrawer o
instance O.HasParentTypes SpaceDrawer
type instance O.ParentTypes SpaceDrawer = '[GObject.Object.Object]
toSpaceDrawer :: (MonadIO m, IsSpaceDrawer o) => o -> m SpaceDrawer
toSpaceDrawer = liftIO . unsafeCastTo SpaceDrawer
noSpaceDrawer :: Maybe SpaceDrawer
noSpaceDrawer = Nothing
#if ENABLE_OVERLOADING
type family ResolveSpaceDrawerMethod (t :: Symbol) (o :: *) :: * where
ResolveSpaceDrawerMethod "bindMatrixSetting" o = SpaceDrawerBindMatrixSettingMethodInfo
ResolveSpaceDrawerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSpaceDrawerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSpaceDrawerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSpaceDrawerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSpaceDrawerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSpaceDrawerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSpaceDrawerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSpaceDrawerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSpaceDrawerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSpaceDrawerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSpaceDrawerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSpaceDrawerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSpaceDrawerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSpaceDrawerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSpaceDrawerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSpaceDrawerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSpaceDrawerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSpaceDrawerMethod "getEnableMatrix" o = SpaceDrawerGetEnableMatrixMethodInfo
ResolveSpaceDrawerMethod "getMatrix" o = SpaceDrawerGetMatrixMethodInfo
ResolveSpaceDrawerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSpaceDrawerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSpaceDrawerMethod "getTypesForLocations" o = SpaceDrawerGetTypesForLocationsMethodInfo
ResolveSpaceDrawerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSpaceDrawerMethod "setEnableMatrix" o = SpaceDrawerSetEnableMatrixMethodInfo
ResolveSpaceDrawerMethod "setMatrix" o = SpaceDrawerSetMatrixMethodInfo
ResolveSpaceDrawerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSpaceDrawerMethod "setTypesForLocations" o = SpaceDrawerSetTypesForLocationsMethodInfo
ResolveSpaceDrawerMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSpaceDrawerMethod t SpaceDrawer, O.MethodInfo info SpaceDrawer p) => OL.IsLabel t (SpaceDrawer -> 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
getSpaceDrawerEnableMatrix :: (MonadIO m, IsSpaceDrawer o) => o -> m Bool
getSpaceDrawerEnableMatrix obj = liftIO $ B.Properties.getObjectPropertyBool obj "enable-matrix"
setSpaceDrawerEnableMatrix :: (MonadIO m, IsSpaceDrawer o) => o -> Bool -> m ()
setSpaceDrawerEnableMatrix obj val = liftIO $ B.Properties.setObjectPropertyBool obj "enable-matrix" val
constructSpaceDrawerEnableMatrix :: (IsSpaceDrawer o) => Bool -> IO (GValueConstruct o)
constructSpaceDrawerEnableMatrix val = B.Properties.constructObjectPropertyBool "enable-matrix" val
#if ENABLE_OVERLOADING
data SpaceDrawerEnableMatrixPropertyInfo
instance AttrInfo SpaceDrawerEnableMatrixPropertyInfo where
type AttrAllowedOps SpaceDrawerEnableMatrixPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint SpaceDrawerEnableMatrixPropertyInfo = (~) Bool
type AttrBaseTypeConstraint SpaceDrawerEnableMatrixPropertyInfo = IsSpaceDrawer
type AttrGetType SpaceDrawerEnableMatrixPropertyInfo = Bool
type AttrLabel SpaceDrawerEnableMatrixPropertyInfo = "enable-matrix"
type AttrOrigin SpaceDrawerEnableMatrixPropertyInfo = SpaceDrawer
attrGet _ = getSpaceDrawerEnableMatrix
attrSet _ = setSpaceDrawerEnableMatrix
attrConstruct _ = constructSpaceDrawerEnableMatrix
attrClear _ = undefined
#endif
getSpaceDrawerMatrix :: (MonadIO m, IsSpaceDrawer o) => o -> m (Maybe GVariant)
getSpaceDrawerMatrix obj = liftIO $ B.Properties.getObjectPropertyVariant obj "matrix"
setSpaceDrawerMatrix :: (MonadIO m, IsSpaceDrawer o) => o -> GVariant -> m ()
setSpaceDrawerMatrix obj val = liftIO $ B.Properties.setObjectPropertyVariant obj "matrix" (Just val)
constructSpaceDrawerMatrix :: (IsSpaceDrawer o) => GVariant -> IO (GValueConstruct o)
constructSpaceDrawerMatrix val = B.Properties.constructObjectPropertyVariant "matrix" (Just val)
clearSpaceDrawerMatrix :: (MonadIO m, IsSpaceDrawer o) => o -> m ()
clearSpaceDrawerMatrix obj = liftIO $ B.Properties.setObjectPropertyVariant obj "matrix" (Nothing :: Maybe GVariant)
#if ENABLE_OVERLOADING
data SpaceDrawerMatrixPropertyInfo
instance AttrInfo SpaceDrawerMatrixPropertyInfo where
type AttrAllowedOps SpaceDrawerMatrixPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint SpaceDrawerMatrixPropertyInfo = (~) GVariant
type AttrBaseTypeConstraint SpaceDrawerMatrixPropertyInfo = IsSpaceDrawer
type AttrGetType SpaceDrawerMatrixPropertyInfo = (Maybe GVariant)
type AttrLabel SpaceDrawerMatrixPropertyInfo = "matrix"
type AttrOrigin SpaceDrawerMatrixPropertyInfo = SpaceDrawer
attrGet _ = getSpaceDrawerMatrix
attrSet _ = setSpaceDrawerMatrix
attrConstruct _ = constructSpaceDrawerMatrix
attrClear _ = clearSpaceDrawerMatrix
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList SpaceDrawer
type instance O.AttributeList SpaceDrawer = SpaceDrawerAttributeList
type SpaceDrawerAttributeList = ('[ '("enableMatrix", SpaceDrawerEnableMatrixPropertyInfo), '("matrix", SpaceDrawerMatrixPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
spaceDrawerEnableMatrix :: AttrLabelProxy "enableMatrix"
spaceDrawerEnableMatrix = AttrLabelProxy
spaceDrawerMatrix :: AttrLabelProxy "matrix"
spaceDrawerMatrix = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList SpaceDrawer = SpaceDrawerSignalList
type SpaceDrawerSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_source_space_drawer_new" gtk_source_space_drawer_new ::
IO (Ptr SpaceDrawer)
spaceDrawerNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m SpaceDrawer
spaceDrawerNew = liftIO $ do
result <- gtk_source_space_drawer_new
checkUnexpectedReturnNULL "spaceDrawerNew" result
result' <- (wrapObject SpaceDrawer) result
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "gtk_source_space_drawer_bind_matrix_setting" gtk_source_space_drawer_bind_matrix_setting ::
Ptr SpaceDrawer ->
Ptr Gio.Settings.Settings ->
CString ->
CUInt ->
IO ()
spaceDrawerBindMatrixSetting ::
(B.CallStack.HasCallStack, MonadIO m, IsSpaceDrawer a, Gio.Settings.IsSettings b) =>
a
-> b
-> T.Text
-> [Gio.Flags.SettingsBindFlags]
-> m ()
spaceDrawerBindMatrixSetting drawer settings key flags = liftIO $ do
drawer' <- unsafeManagedPtrCastPtr drawer
settings' <- unsafeManagedPtrCastPtr settings
key' <- textToCString key
let flags' = gflagsToWord flags
gtk_source_space_drawer_bind_matrix_setting drawer' settings' key' flags'
touchManagedPtr drawer
touchManagedPtr settings
freeMem key'
return ()
#if ENABLE_OVERLOADING
data SpaceDrawerBindMatrixSettingMethodInfo
instance (signature ~ (b -> T.Text -> [Gio.Flags.SettingsBindFlags] -> m ()), MonadIO m, IsSpaceDrawer a, Gio.Settings.IsSettings b) => O.MethodInfo SpaceDrawerBindMatrixSettingMethodInfo a signature where
overloadedMethod _ = spaceDrawerBindMatrixSetting
#endif
foreign import ccall "gtk_source_space_drawer_get_enable_matrix" gtk_source_space_drawer_get_enable_matrix ::
Ptr SpaceDrawer ->
IO CInt
spaceDrawerGetEnableMatrix ::
(B.CallStack.HasCallStack, MonadIO m, IsSpaceDrawer a) =>
a
-> m Bool
spaceDrawerGetEnableMatrix drawer = liftIO $ do
drawer' <- unsafeManagedPtrCastPtr drawer
result <- gtk_source_space_drawer_get_enable_matrix drawer'
let result' = (/= 0) result
touchManagedPtr drawer
return result'
#if ENABLE_OVERLOADING
data SpaceDrawerGetEnableMatrixMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSpaceDrawer a) => O.MethodInfo SpaceDrawerGetEnableMatrixMethodInfo a signature where
overloadedMethod _ = spaceDrawerGetEnableMatrix
#endif
foreign import ccall "gtk_source_space_drawer_get_matrix" gtk_source_space_drawer_get_matrix ::
Ptr SpaceDrawer ->
IO (Ptr GVariant)
spaceDrawerGetMatrix ::
(B.CallStack.HasCallStack, MonadIO m, IsSpaceDrawer a) =>
a
-> m GVariant
spaceDrawerGetMatrix drawer = liftIO $ do
drawer' <- unsafeManagedPtrCastPtr drawer
result <- gtk_source_space_drawer_get_matrix drawer'
checkUnexpectedReturnNULL "spaceDrawerGetMatrix" result
result' <- B.GVariant.wrapGVariantPtr result
touchManagedPtr drawer
return result'
#if ENABLE_OVERLOADING
data SpaceDrawerGetMatrixMethodInfo
instance (signature ~ (m GVariant), MonadIO m, IsSpaceDrawer a) => O.MethodInfo SpaceDrawerGetMatrixMethodInfo a signature where
overloadedMethod _ = spaceDrawerGetMatrix
#endif
foreign import ccall "gtk_source_space_drawer_get_types_for_locations" gtk_source_space_drawer_get_types_for_locations ::
Ptr SpaceDrawer ->
CUInt ->
IO CUInt
spaceDrawerGetTypesForLocations ::
(B.CallStack.HasCallStack, MonadIO m, IsSpaceDrawer a) =>
a
-> [GtkSource.Flags.SpaceLocationFlags]
-> m [GtkSource.Flags.SpaceTypeFlags]
spaceDrawerGetTypesForLocations drawer locations = liftIO $ do
drawer' <- unsafeManagedPtrCastPtr drawer
let locations' = gflagsToWord locations
result <- gtk_source_space_drawer_get_types_for_locations drawer' locations'
let result' = wordToGFlags result
touchManagedPtr drawer
return result'
#if ENABLE_OVERLOADING
data SpaceDrawerGetTypesForLocationsMethodInfo
instance (signature ~ ([GtkSource.Flags.SpaceLocationFlags] -> m [GtkSource.Flags.SpaceTypeFlags]), MonadIO m, IsSpaceDrawer a) => O.MethodInfo SpaceDrawerGetTypesForLocationsMethodInfo a signature where
overloadedMethod _ = spaceDrawerGetTypesForLocations
#endif
foreign import ccall "gtk_source_space_drawer_set_enable_matrix" gtk_source_space_drawer_set_enable_matrix ::
Ptr SpaceDrawer ->
CInt ->
IO ()
spaceDrawerSetEnableMatrix ::
(B.CallStack.HasCallStack, MonadIO m, IsSpaceDrawer a) =>
a
-> Bool
-> m ()
spaceDrawerSetEnableMatrix drawer enableMatrix = liftIO $ do
drawer' <- unsafeManagedPtrCastPtr drawer
let enableMatrix' = (fromIntegral . fromEnum) enableMatrix
gtk_source_space_drawer_set_enable_matrix drawer' enableMatrix'
touchManagedPtr drawer
return ()
#if ENABLE_OVERLOADING
data SpaceDrawerSetEnableMatrixMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSpaceDrawer a) => O.MethodInfo SpaceDrawerSetEnableMatrixMethodInfo a signature where
overloadedMethod _ = spaceDrawerSetEnableMatrix
#endif
foreign import ccall "gtk_source_space_drawer_set_matrix" gtk_source_space_drawer_set_matrix ::
Ptr SpaceDrawer ->
Ptr GVariant ->
IO ()
spaceDrawerSetMatrix ::
(B.CallStack.HasCallStack, MonadIO m, IsSpaceDrawer a) =>
a
-> Maybe (GVariant)
-> m ()
spaceDrawerSetMatrix drawer matrix = liftIO $ do
drawer' <- unsafeManagedPtrCastPtr drawer
maybeMatrix <- case matrix of
Nothing -> return nullPtr
Just jMatrix -> do
jMatrix' <- unsafeManagedPtrGetPtr jMatrix
return jMatrix'
gtk_source_space_drawer_set_matrix drawer' maybeMatrix
touchManagedPtr drawer
whenJust matrix touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data SpaceDrawerSetMatrixMethodInfo
instance (signature ~ (Maybe (GVariant) -> m ()), MonadIO m, IsSpaceDrawer a) => O.MethodInfo SpaceDrawerSetMatrixMethodInfo a signature where
overloadedMethod _ = spaceDrawerSetMatrix
#endif
foreign import ccall "gtk_source_space_drawer_set_types_for_locations" gtk_source_space_drawer_set_types_for_locations ::
Ptr SpaceDrawer ->
CUInt ->
CUInt ->
IO ()
spaceDrawerSetTypesForLocations ::
(B.CallStack.HasCallStack, MonadIO m, IsSpaceDrawer a) =>
a
-> [GtkSource.Flags.SpaceLocationFlags]
-> [GtkSource.Flags.SpaceTypeFlags]
-> m ()
spaceDrawerSetTypesForLocations drawer locations types = liftIO $ do
drawer' <- unsafeManagedPtrCastPtr drawer
let locations' = gflagsToWord locations
let types' = gflagsToWord types
gtk_source_space_drawer_set_types_for_locations drawer' locations' types'
touchManagedPtr drawer
return ()
#if ENABLE_OVERLOADING
data SpaceDrawerSetTypesForLocationsMethodInfo
instance (signature ~ ([GtkSource.Flags.SpaceLocationFlags] -> [GtkSource.Flags.SpaceTypeFlags] -> m ()), MonadIO m, IsSpaceDrawer a) => O.MethodInfo SpaceDrawerSetTypesForLocationsMethodInfo a signature where
overloadedMethod _ = spaceDrawerSetTypesForLocations
#endif