#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gtk.Objects.IMContext
(
IMContext(..) ,
IsIMContext ,
toIMContext ,
noIMContext ,
#if ENABLE_OVERLOADING
IMContextDeleteSurroundingMethodInfo ,
#endif
iMContextDeleteSurrounding ,
#if ENABLE_OVERLOADING
IMContextFilterKeypressMethodInfo ,
#endif
iMContextFilterKeypress ,
#if ENABLE_OVERLOADING
IMContextFocusInMethodInfo ,
#endif
iMContextFocusIn ,
#if ENABLE_OVERLOADING
IMContextFocusOutMethodInfo ,
#endif
iMContextFocusOut ,
#if ENABLE_OVERLOADING
IMContextGetPreeditStringMethodInfo ,
#endif
iMContextGetPreeditString ,
#if ENABLE_OVERLOADING
IMContextGetSurroundingMethodInfo ,
#endif
iMContextGetSurrounding ,
#if ENABLE_OVERLOADING
IMContextResetMethodInfo ,
#endif
iMContextReset ,
#if ENABLE_OVERLOADING
IMContextSetClientWindowMethodInfo ,
#endif
iMContextSetClientWindow ,
#if ENABLE_OVERLOADING
IMContextSetCursorLocationMethodInfo ,
#endif
iMContextSetCursorLocation ,
#if ENABLE_OVERLOADING
IMContextSetSurroundingMethodInfo ,
#endif
iMContextSetSurrounding ,
#if ENABLE_OVERLOADING
IMContextSetUsePreeditMethodInfo ,
#endif
iMContextSetUsePreedit ,
#if ENABLE_OVERLOADING
IMContextInputHintsPropertyInfo ,
#endif
constructIMContextInputHints ,
getIMContextInputHints ,
#if ENABLE_OVERLOADING
iMContextInputHints ,
#endif
setIMContextInputHints ,
#if ENABLE_OVERLOADING
IMContextInputPurposePropertyInfo ,
#endif
constructIMContextInputPurpose ,
getIMContextInputPurpose ,
#if ENABLE_OVERLOADING
iMContextInputPurpose ,
#endif
setIMContextInputPurpose ,
C_IMContextCommitCallback ,
IMContextCommitCallback ,
#if ENABLE_OVERLOADING
IMContextCommitSignalInfo ,
#endif
afterIMContextCommit ,
genClosure_IMContextCommit ,
mk_IMContextCommitCallback ,
noIMContextCommitCallback ,
onIMContextCommit ,
wrap_IMContextCommitCallback ,
C_IMContextDeleteSurroundingCallback ,
IMContextDeleteSurroundingCallback ,
#if ENABLE_OVERLOADING
IMContextDeleteSurroundingSignalInfo ,
#endif
afterIMContextDeleteSurrounding ,
genClosure_IMContextDeleteSurrounding ,
mk_IMContextDeleteSurroundingCallback ,
noIMContextDeleteSurroundingCallback ,
onIMContextDeleteSurrounding ,
wrap_IMContextDeleteSurroundingCallback ,
C_IMContextPreeditChangedCallback ,
IMContextPreeditChangedCallback ,
#if ENABLE_OVERLOADING
IMContextPreeditChangedSignalInfo ,
#endif
afterIMContextPreeditChanged ,
genClosure_IMContextPreeditChanged ,
mk_IMContextPreeditChangedCallback ,
noIMContextPreeditChangedCallback ,
onIMContextPreeditChanged ,
wrap_IMContextPreeditChangedCallback ,
C_IMContextPreeditEndCallback ,
IMContextPreeditEndCallback ,
#if ENABLE_OVERLOADING
IMContextPreeditEndSignalInfo ,
#endif
afterIMContextPreeditEnd ,
genClosure_IMContextPreeditEnd ,
mk_IMContextPreeditEndCallback ,
noIMContextPreeditEndCallback ,
onIMContextPreeditEnd ,
wrap_IMContextPreeditEndCallback ,
C_IMContextPreeditStartCallback ,
IMContextPreeditStartCallback ,
#if ENABLE_OVERLOADING
IMContextPreeditStartSignalInfo ,
#endif
afterIMContextPreeditStart ,
genClosure_IMContextPreeditStart ,
mk_IMContextPreeditStartCallback ,
noIMContextPreeditStartCallback ,
onIMContextPreeditStart ,
wrap_IMContextPreeditStartCallback ,
C_IMContextRetrieveSurroundingCallback ,
IMContextRetrieveSurroundingCallback ,
#if ENABLE_OVERLOADING
IMContextRetrieveSurroundingSignalInfo ,
#endif
afterIMContextRetrieveSurrounding ,
genClosure_IMContextRetrieveSurrounding ,
mk_IMContextRetrieveSurroundingCallback ,
noIMContextRetrieveSurroundingCallback ,
onIMContextRetrieveSurrounding ,
wrap_IMContextRetrieveSurroundingCallback,
) 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.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Objects.Window as Gdk.Window
import qualified GI.Gdk.Structs.EventKey as Gdk.EventKey
import qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Flags as Gtk.Flags
import qualified GI.Pango.Structs.AttrList as Pango.AttrList
newtype IMContext = IMContext (ManagedPtr IMContext)
foreign import ccall "gtk_im_context_get_type"
c_gtk_im_context_get_type :: IO GType
instance GObject IMContext where
gobjectType _ = c_gtk_im_context_get_type
class GObject o => IsIMContext o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError IMContext a) =>
IsIMContext a
#endif
instance IsIMContext IMContext
instance GObject.Object.IsObject IMContext
toIMContext :: (MonadIO m, IsIMContext o) => o -> m IMContext
toIMContext = liftIO . unsafeCastTo IMContext
noIMContext :: Maybe IMContext
noIMContext = Nothing
#if ENABLE_OVERLOADING
type family ResolveIMContextMethod (t :: Symbol) (o :: *) :: * where
ResolveIMContextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveIMContextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveIMContextMethod "deleteSurrounding" o = IMContextDeleteSurroundingMethodInfo
ResolveIMContextMethod "filterKeypress" o = IMContextFilterKeypressMethodInfo
ResolveIMContextMethod "focusIn" o = IMContextFocusInMethodInfo
ResolveIMContextMethod "focusOut" o = IMContextFocusOutMethodInfo
ResolveIMContextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveIMContextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveIMContextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveIMContextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveIMContextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveIMContextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveIMContextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveIMContextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveIMContextMethod "reset" o = IMContextResetMethodInfo
ResolveIMContextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveIMContextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveIMContextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveIMContextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveIMContextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveIMContextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveIMContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveIMContextMethod "getPreeditString" o = IMContextGetPreeditStringMethodInfo
ResolveIMContextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveIMContextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveIMContextMethod "getSurrounding" o = IMContextGetSurroundingMethodInfo
ResolveIMContextMethod "setClientWindow" o = IMContextSetClientWindowMethodInfo
ResolveIMContextMethod "setCursorLocation" o = IMContextSetCursorLocationMethodInfo
ResolveIMContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveIMContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveIMContextMethod "setSurrounding" o = IMContextSetSurroundingMethodInfo
ResolveIMContextMethod "setUsePreedit" o = IMContextSetUsePreeditMethodInfo
ResolveIMContextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveIMContextMethod t IMContext, O.MethodInfo info IMContext p) => O.IsLabelProxy t (IMContext -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveIMContextMethod t IMContext, O.MethodInfo info IMContext p) => O.IsLabel t (IMContext -> 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
type IMContextCommitCallback =
T.Text
-> IO ()
noIMContextCommitCallback :: Maybe IMContextCommitCallback
noIMContextCommitCallback = Nothing
type C_IMContextCommitCallback =
Ptr () ->
CString ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_IMContextCommitCallback :: C_IMContextCommitCallback -> IO (FunPtr C_IMContextCommitCallback)
genClosure_IMContextCommit :: IMContextCommitCallback -> IO Closure
genClosure_IMContextCommit cb = do
let cb' = wrap_IMContextCommitCallback cb
mk_IMContextCommitCallback cb' >>= newCClosure
wrap_IMContextCommitCallback ::
IMContextCommitCallback ->
C_IMContextCommitCallback
wrap_IMContextCommitCallback _cb _ str _ = do
str' <- cstringToText str
_cb str'
onIMContextCommit :: (IsIMContext a, MonadIO m) => a -> IMContextCommitCallback -> m SignalHandlerId
onIMContextCommit obj cb = liftIO $ do
let cb' = wrap_IMContextCommitCallback cb
cb'' <- mk_IMContextCommitCallback cb'
connectSignalFunPtr obj "commit" cb'' SignalConnectBefore
afterIMContextCommit :: (IsIMContext a, MonadIO m) => a -> IMContextCommitCallback -> m SignalHandlerId
afterIMContextCommit obj cb = liftIO $ do
let cb' = wrap_IMContextCommitCallback cb
cb'' <- mk_IMContextCommitCallback cb'
connectSignalFunPtr obj "commit" cb'' SignalConnectAfter
type IMContextDeleteSurroundingCallback =
Int32
-> Int32
-> IO Bool
noIMContextDeleteSurroundingCallback :: Maybe IMContextDeleteSurroundingCallback
noIMContextDeleteSurroundingCallback = Nothing
type C_IMContextDeleteSurroundingCallback =
Ptr () ->
Int32 ->
Int32 ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_IMContextDeleteSurroundingCallback :: C_IMContextDeleteSurroundingCallback -> IO (FunPtr C_IMContextDeleteSurroundingCallback)
genClosure_IMContextDeleteSurrounding :: IMContextDeleteSurroundingCallback -> IO Closure
genClosure_IMContextDeleteSurrounding cb = do
let cb' = wrap_IMContextDeleteSurroundingCallback cb
mk_IMContextDeleteSurroundingCallback cb' >>= newCClosure
wrap_IMContextDeleteSurroundingCallback ::
IMContextDeleteSurroundingCallback ->
C_IMContextDeleteSurroundingCallback
wrap_IMContextDeleteSurroundingCallback _cb _ offset nChars _ = do
result <- _cb offset nChars
let result' = (fromIntegral . fromEnum) result
return result'
onIMContextDeleteSurrounding :: (IsIMContext a, MonadIO m) => a -> IMContextDeleteSurroundingCallback -> m SignalHandlerId
onIMContextDeleteSurrounding obj cb = liftIO $ do
let cb' = wrap_IMContextDeleteSurroundingCallback cb
cb'' <- mk_IMContextDeleteSurroundingCallback cb'
connectSignalFunPtr obj "delete-surrounding" cb'' SignalConnectBefore
afterIMContextDeleteSurrounding :: (IsIMContext a, MonadIO m) => a -> IMContextDeleteSurroundingCallback -> m SignalHandlerId
afterIMContextDeleteSurrounding obj cb = liftIO $ do
let cb' = wrap_IMContextDeleteSurroundingCallback cb
cb'' <- mk_IMContextDeleteSurroundingCallback cb'
connectSignalFunPtr obj "delete-surrounding" cb'' SignalConnectAfter
type IMContextPreeditChangedCallback =
IO ()
noIMContextPreeditChangedCallback :: Maybe IMContextPreeditChangedCallback
noIMContextPreeditChangedCallback = Nothing
type C_IMContextPreeditChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_IMContextPreeditChangedCallback :: C_IMContextPreeditChangedCallback -> IO (FunPtr C_IMContextPreeditChangedCallback)
genClosure_IMContextPreeditChanged :: IMContextPreeditChangedCallback -> IO Closure
genClosure_IMContextPreeditChanged cb = do
let cb' = wrap_IMContextPreeditChangedCallback cb
mk_IMContextPreeditChangedCallback cb' >>= newCClosure
wrap_IMContextPreeditChangedCallback ::
IMContextPreeditChangedCallback ->
C_IMContextPreeditChangedCallback
wrap_IMContextPreeditChangedCallback _cb _ _ = do
_cb
onIMContextPreeditChanged :: (IsIMContext a, MonadIO m) => a -> IMContextPreeditChangedCallback -> m SignalHandlerId
onIMContextPreeditChanged obj cb = liftIO $ do
let cb' = wrap_IMContextPreeditChangedCallback cb
cb'' <- mk_IMContextPreeditChangedCallback cb'
connectSignalFunPtr obj "preedit-changed" cb'' SignalConnectBefore
afterIMContextPreeditChanged :: (IsIMContext a, MonadIO m) => a -> IMContextPreeditChangedCallback -> m SignalHandlerId
afterIMContextPreeditChanged obj cb = liftIO $ do
let cb' = wrap_IMContextPreeditChangedCallback cb
cb'' <- mk_IMContextPreeditChangedCallback cb'
connectSignalFunPtr obj "preedit-changed" cb'' SignalConnectAfter
type IMContextPreeditEndCallback =
IO ()
noIMContextPreeditEndCallback :: Maybe IMContextPreeditEndCallback
noIMContextPreeditEndCallback = Nothing
type C_IMContextPreeditEndCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_IMContextPreeditEndCallback :: C_IMContextPreeditEndCallback -> IO (FunPtr C_IMContextPreeditEndCallback)
genClosure_IMContextPreeditEnd :: IMContextPreeditEndCallback -> IO Closure
genClosure_IMContextPreeditEnd cb = do
let cb' = wrap_IMContextPreeditEndCallback cb
mk_IMContextPreeditEndCallback cb' >>= newCClosure
wrap_IMContextPreeditEndCallback ::
IMContextPreeditEndCallback ->
C_IMContextPreeditEndCallback
wrap_IMContextPreeditEndCallback _cb _ _ = do
_cb
onIMContextPreeditEnd :: (IsIMContext a, MonadIO m) => a -> IMContextPreeditEndCallback -> m SignalHandlerId
onIMContextPreeditEnd obj cb = liftIO $ do
let cb' = wrap_IMContextPreeditEndCallback cb
cb'' <- mk_IMContextPreeditEndCallback cb'
connectSignalFunPtr obj "preedit-end" cb'' SignalConnectBefore
afterIMContextPreeditEnd :: (IsIMContext a, MonadIO m) => a -> IMContextPreeditEndCallback -> m SignalHandlerId
afterIMContextPreeditEnd obj cb = liftIO $ do
let cb' = wrap_IMContextPreeditEndCallback cb
cb'' <- mk_IMContextPreeditEndCallback cb'
connectSignalFunPtr obj "preedit-end" cb'' SignalConnectAfter
type IMContextPreeditStartCallback =
IO ()
noIMContextPreeditStartCallback :: Maybe IMContextPreeditStartCallback
noIMContextPreeditStartCallback = Nothing
type C_IMContextPreeditStartCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_IMContextPreeditStartCallback :: C_IMContextPreeditStartCallback -> IO (FunPtr C_IMContextPreeditStartCallback)
genClosure_IMContextPreeditStart :: IMContextPreeditStartCallback -> IO Closure
genClosure_IMContextPreeditStart cb = do
let cb' = wrap_IMContextPreeditStartCallback cb
mk_IMContextPreeditStartCallback cb' >>= newCClosure
wrap_IMContextPreeditStartCallback ::
IMContextPreeditStartCallback ->
C_IMContextPreeditStartCallback
wrap_IMContextPreeditStartCallback _cb _ _ = do
_cb
onIMContextPreeditStart :: (IsIMContext a, MonadIO m) => a -> IMContextPreeditStartCallback -> m SignalHandlerId
onIMContextPreeditStart obj cb = liftIO $ do
let cb' = wrap_IMContextPreeditStartCallback cb
cb'' <- mk_IMContextPreeditStartCallback cb'
connectSignalFunPtr obj "preedit-start" cb'' SignalConnectBefore
afterIMContextPreeditStart :: (IsIMContext a, MonadIO m) => a -> IMContextPreeditStartCallback -> m SignalHandlerId
afterIMContextPreeditStart obj cb = liftIO $ do
let cb' = wrap_IMContextPreeditStartCallback cb
cb'' <- mk_IMContextPreeditStartCallback cb'
connectSignalFunPtr obj "preedit-start" cb'' SignalConnectAfter
type IMContextRetrieveSurroundingCallback =
IO Bool
noIMContextRetrieveSurroundingCallback :: Maybe IMContextRetrieveSurroundingCallback
noIMContextRetrieveSurroundingCallback = Nothing
type C_IMContextRetrieveSurroundingCallback =
Ptr () ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_IMContextRetrieveSurroundingCallback :: C_IMContextRetrieveSurroundingCallback -> IO (FunPtr C_IMContextRetrieveSurroundingCallback)
genClosure_IMContextRetrieveSurrounding :: IMContextRetrieveSurroundingCallback -> IO Closure
genClosure_IMContextRetrieveSurrounding cb = do
let cb' = wrap_IMContextRetrieveSurroundingCallback cb
mk_IMContextRetrieveSurroundingCallback cb' >>= newCClosure
wrap_IMContextRetrieveSurroundingCallback ::
IMContextRetrieveSurroundingCallback ->
C_IMContextRetrieveSurroundingCallback
wrap_IMContextRetrieveSurroundingCallback _cb _ _ = do
result <- _cb
let result' = (fromIntegral . fromEnum) result
return result'
onIMContextRetrieveSurrounding :: (IsIMContext a, MonadIO m) => a -> IMContextRetrieveSurroundingCallback -> m SignalHandlerId
onIMContextRetrieveSurrounding obj cb = liftIO $ do
let cb' = wrap_IMContextRetrieveSurroundingCallback cb
cb'' <- mk_IMContextRetrieveSurroundingCallback cb'
connectSignalFunPtr obj "retrieve-surrounding" cb'' SignalConnectBefore
afterIMContextRetrieveSurrounding :: (IsIMContext a, MonadIO m) => a -> IMContextRetrieveSurroundingCallback -> m SignalHandlerId
afterIMContextRetrieveSurrounding obj cb = liftIO $ do
let cb' = wrap_IMContextRetrieveSurroundingCallback cb
cb'' <- mk_IMContextRetrieveSurroundingCallback cb'
connectSignalFunPtr obj "retrieve-surrounding" cb'' SignalConnectAfter
getIMContextInputHints :: (MonadIO m, IsIMContext o) => o -> m [Gtk.Flags.InputHints]
getIMContextInputHints obj = liftIO $ getObjectPropertyFlags obj "input-hints"
setIMContextInputHints :: (MonadIO m, IsIMContext o) => o -> [Gtk.Flags.InputHints] -> m ()
setIMContextInputHints obj val = liftIO $ setObjectPropertyFlags obj "input-hints" val
constructIMContextInputHints :: (IsIMContext o) => [Gtk.Flags.InputHints] -> IO (GValueConstruct o)
constructIMContextInputHints val = constructObjectPropertyFlags "input-hints" val
#if ENABLE_OVERLOADING
data IMContextInputHintsPropertyInfo
instance AttrInfo IMContextInputHintsPropertyInfo where
type AttrAllowedOps IMContextInputHintsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint IMContextInputHintsPropertyInfo = (~) [Gtk.Flags.InputHints]
type AttrBaseTypeConstraint IMContextInputHintsPropertyInfo = IsIMContext
type AttrGetType IMContextInputHintsPropertyInfo = [Gtk.Flags.InputHints]
type AttrLabel IMContextInputHintsPropertyInfo = "input-hints"
type AttrOrigin IMContextInputHintsPropertyInfo = IMContext
attrGet _ = getIMContextInputHints
attrSet _ = setIMContextInputHints
attrConstruct _ = constructIMContextInputHints
attrClear _ = undefined
#endif
getIMContextInputPurpose :: (MonadIO m, IsIMContext o) => o -> m Gtk.Enums.InputPurpose
getIMContextInputPurpose obj = liftIO $ getObjectPropertyEnum obj "input-purpose"
setIMContextInputPurpose :: (MonadIO m, IsIMContext o) => o -> Gtk.Enums.InputPurpose -> m ()
setIMContextInputPurpose obj val = liftIO $ setObjectPropertyEnum obj "input-purpose" val
constructIMContextInputPurpose :: (IsIMContext o) => Gtk.Enums.InputPurpose -> IO (GValueConstruct o)
constructIMContextInputPurpose val = constructObjectPropertyEnum "input-purpose" val
#if ENABLE_OVERLOADING
data IMContextInputPurposePropertyInfo
instance AttrInfo IMContextInputPurposePropertyInfo where
type AttrAllowedOps IMContextInputPurposePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint IMContextInputPurposePropertyInfo = (~) Gtk.Enums.InputPurpose
type AttrBaseTypeConstraint IMContextInputPurposePropertyInfo = IsIMContext
type AttrGetType IMContextInputPurposePropertyInfo = Gtk.Enums.InputPurpose
type AttrLabel IMContextInputPurposePropertyInfo = "input-purpose"
type AttrOrigin IMContextInputPurposePropertyInfo = IMContext
attrGet _ = getIMContextInputPurpose
attrSet _ = setIMContextInputPurpose
attrConstruct _ = constructIMContextInputPurpose
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList IMContext
type instance O.AttributeList IMContext = IMContextAttributeList
type IMContextAttributeList = ('[ '("inputHints", IMContextInputHintsPropertyInfo), '("inputPurpose", IMContextInputPurposePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
iMContextInputHints :: AttrLabelProxy "inputHints"
iMContextInputHints = AttrLabelProxy
iMContextInputPurpose :: AttrLabelProxy "inputPurpose"
iMContextInputPurpose = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
data IMContextCommitSignalInfo
instance SignalInfo IMContextCommitSignalInfo where
type HaskellCallbackType IMContextCommitSignalInfo = IMContextCommitCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_IMContextCommitCallback cb
cb'' <- mk_IMContextCommitCallback cb'
connectSignalFunPtr obj "commit" cb'' connectMode
data IMContextDeleteSurroundingSignalInfo
instance SignalInfo IMContextDeleteSurroundingSignalInfo where
type HaskellCallbackType IMContextDeleteSurroundingSignalInfo = IMContextDeleteSurroundingCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_IMContextDeleteSurroundingCallback cb
cb'' <- mk_IMContextDeleteSurroundingCallback cb'
connectSignalFunPtr obj "delete-surrounding" cb'' connectMode
data IMContextPreeditChangedSignalInfo
instance SignalInfo IMContextPreeditChangedSignalInfo where
type HaskellCallbackType IMContextPreeditChangedSignalInfo = IMContextPreeditChangedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_IMContextPreeditChangedCallback cb
cb'' <- mk_IMContextPreeditChangedCallback cb'
connectSignalFunPtr obj "preedit-changed" cb'' connectMode
data IMContextPreeditEndSignalInfo
instance SignalInfo IMContextPreeditEndSignalInfo where
type HaskellCallbackType IMContextPreeditEndSignalInfo = IMContextPreeditEndCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_IMContextPreeditEndCallback cb
cb'' <- mk_IMContextPreeditEndCallback cb'
connectSignalFunPtr obj "preedit-end" cb'' connectMode
data IMContextPreeditStartSignalInfo
instance SignalInfo IMContextPreeditStartSignalInfo where
type HaskellCallbackType IMContextPreeditStartSignalInfo = IMContextPreeditStartCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_IMContextPreeditStartCallback cb
cb'' <- mk_IMContextPreeditStartCallback cb'
connectSignalFunPtr obj "preedit-start" cb'' connectMode
data IMContextRetrieveSurroundingSignalInfo
instance SignalInfo IMContextRetrieveSurroundingSignalInfo where
type HaskellCallbackType IMContextRetrieveSurroundingSignalInfo = IMContextRetrieveSurroundingCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_IMContextRetrieveSurroundingCallback cb
cb'' <- mk_IMContextRetrieveSurroundingCallback cb'
connectSignalFunPtr obj "retrieve-surrounding" cb'' connectMode
type instance O.SignalList IMContext = IMContextSignalList
type IMContextSignalList = ('[ '("commit", IMContextCommitSignalInfo), '("deleteSurrounding", IMContextDeleteSurroundingSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("preeditChanged", IMContextPreeditChangedSignalInfo), '("preeditEnd", IMContextPreeditEndSignalInfo), '("preeditStart", IMContextPreeditStartSignalInfo), '("retrieveSurrounding", IMContextRetrieveSurroundingSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_im_context_delete_surrounding" gtk_im_context_delete_surrounding ::
Ptr IMContext ->
Int32 ->
Int32 ->
IO CInt
iMContextDeleteSurrounding ::
(B.CallStack.HasCallStack, MonadIO m, IsIMContext a) =>
a
-> Int32
-> Int32
-> m Bool
iMContextDeleteSurrounding context offset nChars = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
result <- gtk_im_context_delete_surrounding context' offset nChars
let result' = (/= 0) result
touchManagedPtr context
return result'
#if ENABLE_OVERLOADING
data IMContextDeleteSurroundingMethodInfo
instance (signature ~ (Int32 -> Int32 -> m Bool), MonadIO m, IsIMContext a) => O.MethodInfo IMContextDeleteSurroundingMethodInfo a signature where
overloadedMethod _ = iMContextDeleteSurrounding
#endif
foreign import ccall "gtk_im_context_filter_keypress" gtk_im_context_filter_keypress ::
Ptr IMContext ->
Ptr Gdk.EventKey.EventKey ->
IO CInt
iMContextFilterKeypress ::
(B.CallStack.HasCallStack, MonadIO m, IsIMContext a) =>
a
-> Gdk.EventKey.EventKey
-> m Bool
iMContextFilterKeypress context event = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
event' <- unsafeManagedPtrGetPtr event
result <- gtk_im_context_filter_keypress context' event'
let result' = (/= 0) result
touchManagedPtr context
touchManagedPtr event
return result'
#if ENABLE_OVERLOADING
data IMContextFilterKeypressMethodInfo
instance (signature ~ (Gdk.EventKey.EventKey -> m Bool), MonadIO m, IsIMContext a) => O.MethodInfo IMContextFilterKeypressMethodInfo a signature where
overloadedMethod _ = iMContextFilterKeypress
#endif
foreign import ccall "gtk_im_context_focus_in" gtk_im_context_focus_in ::
Ptr IMContext ->
IO ()
iMContextFocusIn ::
(B.CallStack.HasCallStack, MonadIO m, IsIMContext a) =>
a
-> m ()
iMContextFocusIn context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
gtk_im_context_focus_in context'
touchManagedPtr context
return ()
#if ENABLE_OVERLOADING
data IMContextFocusInMethodInfo
instance (signature ~ (m ()), MonadIO m, IsIMContext a) => O.MethodInfo IMContextFocusInMethodInfo a signature where
overloadedMethod _ = iMContextFocusIn
#endif
foreign import ccall "gtk_im_context_focus_out" gtk_im_context_focus_out ::
Ptr IMContext ->
IO ()
iMContextFocusOut ::
(B.CallStack.HasCallStack, MonadIO m, IsIMContext a) =>
a
-> m ()
iMContextFocusOut context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
gtk_im_context_focus_out context'
touchManagedPtr context
return ()
#if ENABLE_OVERLOADING
data IMContextFocusOutMethodInfo
instance (signature ~ (m ()), MonadIO m, IsIMContext a) => O.MethodInfo IMContextFocusOutMethodInfo a signature where
overloadedMethod _ = iMContextFocusOut
#endif
foreign import ccall "gtk_im_context_get_preedit_string" gtk_im_context_get_preedit_string ::
Ptr IMContext ->
Ptr CString ->
Ptr (Ptr Pango.AttrList.AttrList) ->
Ptr Int32 ->
IO ()
iMContextGetPreeditString ::
(B.CallStack.HasCallStack, MonadIO m, IsIMContext a) =>
a
-> m ((T.Text, Pango.AttrList.AttrList, Int32))
iMContextGetPreeditString context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
str <- allocMem :: IO (Ptr CString)
attrs <- allocMem :: IO (Ptr (Ptr Pango.AttrList.AttrList))
cursorPos <- allocMem :: IO (Ptr Int32)
gtk_im_context_get_preedit_string context' str attrs cursorPos
str' <- peek str
str'' <- cstringToText str'
freeMem str'
attrs' <- peek attrs
attrs'' <- (wrapBoxed Pango.AttrList.AttrList) attrs'
cursorPos' <- peek cursorPos
touchManagedPtr context
freeMem str
freeMem attrs
freeMem cursorPos
return (str'', attrs'', cursorPos')
#if ENABLE_OVERLOADING
data IMContextGetPreeditStringMethodInfo
instance (signature ~ (m ((T.Text, Pango.AttrList.AttrList, Int32))), MonadIO m, IsIMContext a) => O.MethodInfo IMContextGetPreeditStringMethodInfo a signature where
overloadedMethod _ = iMContextGetPreeditString
#endif
foreign import ccall "gtk_im_context_get_surrounding" gtk_im_context_get_surrounding ::
Ptr IMContext ->
Ptr CString ->
Ptr Int32 ->
IO CInt
iMContextGetSurrounding ::
(B.CallStack.HasCallStack, MonadIO m, IsIMContext a) =>
a
-> m ((Bool, T.Text, Int32))
iMContextGetSurrounding context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
text <- allocMem :: IO (Ptr CString)
cursorIndex <- allocMem :: IO (Ptr Int32)
result <- gtk_im_context_get_surrounding context' text cursorIndex
let result' = (/= 0) result
text' <- peek text
text'' <- cstringToText text'
freeMem text'
cursorIndex' <- peek cursorIndex
touchManagedPtr context
freeMem text
freeMem cursorIndex
return (result', text'', cursorIndex')
#if ENABLE_OVERLOADING
data IMContextGetSurroundingMethodInfo
instance (signature ~ (m ((Bool, T.Text, Int32))), MonadIO m, IsIMContext a) => O.MethodInfo IMContextGetSurroundingMethodInfo a signature where
overloadedMethod _ = iMContextGetSurrounding
#endif
foreign import ccall "gtk_im_context_reset" gtk_im_context_reset ::
Ptr IMContext ->
IO ()
iMContextReset ::
(B.CallStack.HasCallStack, MonadIO m, IsIMContext a) =>
a
-> m ()
iMContextReset context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
gtk_im_context_reset context'
touchManagedPtr context
return ()
#if ENABLE_OVERLOADING
data IMContextResetMethodInfo
instance (signature ~ (m ()), MonadIO m, IsIMContext a) => O.MethodInfo IMContextResetMethodInfo a signature where
overloadedMethod _ = iMContextReset
#endif
foreign import ccall "gtk_im_context_set_client_window" gtk_im_context_set_client_window ::
Ptr IMContext ->
Ptr Gdk.Window.Window ->
IO ()
iMContextSetClientWindow ::
(B.CallStack.HasCallStack, MonadIO m, IsIMContext a, Gdk.Window.IsWindow b) =>
a
-> Maybe (b)
-> m ()
iMContextSetClientWindow context window = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
maybeWindow <- case window of
Nothing -> return nullPtr
Just jWindow -> do
jWindow' <- unsafeManagedPtrCastPtr jWindow
return jWindow'
gtk_im_context_set_client_window context' maybeWindow
touchManagedPtr context
whenJust window touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data IMContextSetClientWindowMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsIMContext a, Gdk.Window.IsWindow b) => O.MethodInfo IMContextSetClientWindowMethodInfo a signature where
overloadedMethod _ = iMContextSetClientWindow
#endif
foreign import ccall "gtk_im_context_set_cursor_location" gtk_im_context_set_cursor_location ::
Ptr IMContext ->
Ptr Gdk.Rectangle.Rectangle ->
IO ()
iMContextSetCursorLocation ::
(B.CallStack.HasCallStack, MonadIO m, IsIMContext a) =>
a
-> Gdk.Rectangle.Rectangle
-> m ()
iMContextSetCursorLocation context area = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
area' <- unsafeManagedPtrGetPtr area
gtk_im_context_set_cursor_location context' area'
touchManagedPtr context
touchManagedPtr area
return ()
#if ENABLE_OVERLOADING
data IMContextSetCursorLocationMethodInfo
instance (signature ~ (Gdk.Rectangle.Rectangle -> m ()), MonadIO m, IsIMContext a) => O.MethodInfo IMContextSetCursorLocationMethodInfo a signature where
overloadedMethod _ = iMContextSetCursorLocation
#endif
foreign import ccall "gtk_im_context_set_surrounding" gtk_im_context_set_surrounding ::
Ptr IMContext ->
CString ->
Int32 ->
Int32 ->
IO ()
iMContextSetSurrounding ::
(B.CallStack.HasCallStack, MonadIO m, IsIMContext a) =>
a
-> T.Text
-> Int32
-> Int32
-> m ()
iMContextSetSurrounding context text len cursorIndex = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
text' <- textToCString text
gtk_im_context_set_surrounding context' text' len cursorIndex
touchManagedPtr context
freeMem text'
return ()
#if ENABLE_OVERLOADING
data IMContextSetSurroundingMethodInfo
instance (signature ~ (T.Text -> Int32 -> Int32 -> m ()), MonadIO m, IsIMContext a) => O.MethodInfo IMContextSetSurroundingMethodInfo a signature where
overloadedMethod _ = iMContextSetSurrounding
#endif
foreign import ccall "gtk_im_context_set_use_preedit" gtk_im_context_set_use_preedit ::
Ptr IMContext ->
CInt ->
IO ()
iMContextSetUsePreedit ::
(B.CallStack.HasCallStack, MonadIO m, IsIMContext a) =>
a
-> Bool
-> m ()
iMContextSetUsePreedit context usePreedit = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
let usePreedit' = (fromIntegral . fromEnum) usePreedit
gtk_im_context_set_use_preedit context' usePreedit'
touchManagedPtr context
return ()
#if ENABLE_OVERLOADING
data IMContextSetUsePreeditMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsIMContext a) => O.MethodInfo IMContextSetUsePreeditMethodInfo a signature where
overloadedMethod _ = iMContextSetUsePreedit
#endif