{-# LINE 2 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
module Graphics.UI.Gtk.Abstract.IMContext (
IMContext,
IMContextClass,
castToIMContext, gTypeIMContext,
toIMContext,
imContextSetClientWindow,
imContextGetPreeditString,
imContextFilterKeypress,
imContextFocusIn,
imContextFocusOut,
imContextReset,
imContextSetCursorLocation,
imContextSetUsePreedit,
imContextSetSurrounding,
imContextGetSurrounding,
imContextDeleteSurrounding,
imContextPreeditStart,
imContextPreeditEnd,
imContextPreeditChanged,
imContextCommit,
imContextRetrieveSurrounding,
imContextDeleteSurrounding',
) where
import Control.Monad (liftM)
import Control.Monad.Reader.Class (ask)
import Control.Monad.Trans (liftIO)
import Data.Maybe (fromMaybe)
import System.Glib.FFI
import System.Glib.UTFString (readUTFString, withUTFString, genUTFOfs,
ofsToUTF, ofsFromUTF, GlibString)
import Graphics.UI.Gtk.Types
{-# LINE 77 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
import Graphics.UI.Gtk.Signals
{-# LINE 78 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
import Graphics.UI.Gtk.Gdk.EventM (EventM, EKey)
import Graphics.UI.Gtk.General.Structs (Rectangle)
import Graphics.Rendering.Pango.Enums (PangoAttribute)
import Graphics.Rendering.Pango.Attributes (readAttrList)
{-# LINE 84 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
imContextSetClientWindow :: IMContextClass self => self
-> Maybe DrawWindow
-> IO ()
imContextSetClientWindow :: forall self.
IMContextClass self =>
self -> Maybe DrawWindow -> IO ()
imContextSetClientWindow self
self Maybe DrawWindow
window =
(\(IMContext ForeignPtr IMContext
arg1) (DrawWindow ForeignPtr DrawWindow
arg2) -> ForeignPtr IMContext -> (Ptr IMContext -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr IMContext
arg1 ((Ptr IMContext -> IO ()) -> IO ())
-> (Ptr IMContext -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IMContext
argPtr1 ->ForeignPtr DrawWindow -> (Ptr DrawWindow -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr DrawWindow
arg2 ((Ptr DrawWindow -> IO ()) -> IO ())
-> (Ptr DrawWindow -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr DrawWindow
argPtr2 ->Ptr IMContext -> Ptr DrawWindow -> IO ()
gtk_im_context_set_client_window Ptr IMContext
argPtr1 Ptr DrawWindow
argPtr2)
{-# LINE 99 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
(toIMContext self)
(DrawWindow -> Maybe DrawWindow -> DrawWindow
forall a. a -> Maybe a -> a
fromMaybe (ForeignPtr DrawWindow -> DrawWindow
DrawWindow ForeignPtr DrawWindow
forall a. ForeignPtr a
nullForeignPtr) Maybe DrawWindow
window)
imContextGetPreeditString :: (IMContextClass self, GlibString string) => self
-> IO (string, [[PangoAttribute]], Int)
imContextGetPreeditString :: forall self string.
(IMContextClass self, GlibString string) =>
self -> IO (string, [[PangoAttribute]], Int)
imContextGetPreeditString self
self =
(Ptr (Ptr CChar) -> IO (string, [[PangoAttribute]], Int))
-> IO (string, [[PangoAttribute]], Int)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr (Ptr CChar) -> IO (string, [[PangoAttribute]], Int))
-> IO (string, [[PangoAttribute]], Int))
-> (Ptr (Ptr CChar) -> IO (string, [[PangoAttribute]], Int))
-> IO (string, [[PangoAttribute]], Int)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
strPtr ->
(Ptr (Ptr ()) -> IO (string, [[PangoAttribute]], Int))
-> IO (string, [[PangoAttribute]], Int)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr (Ptr ()) -> IO (string, [[PangoAttribute]], Int))
-> IO (string, [[PangoAttribute]], Int))
-> (Ptr (Ptr ()) -> IO (string, [[PangoAttribute]], Int))
-> IO (string, [[PangoAttribute]], Int)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr ())
attrListPtr ->
(Ptr CInt -> IO (string, [[PangoAttribute]], Int))
-> IO (string, [[PangoAttribute]], Int)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CInt -> IO (string, [[PangoAttribute]], Int))
-> IO (string, [[PangoAttribute]], Int))
-> (Ptr CInt -> IO (string, [[PangoAttribute]], Int))
-> IO (string, [[PangoAttribute]], Int)
forall a b. (a -> b) -> a -> b
$ \Ptr CInt
cursorPosPtr ->
(\(IMContext ForeignPtr IMContext
arg1) Ptr (Ptr CChar)
arg2 Ptr (Ptr ())
arg3 Ptr CInt
arg4 -> ForeignPtr IMContext -> (Ptr IMContext -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr IMContext
arg1 ((Ptr IMContext -> IO ()) -> IO ())
-> (Ptr IMContext -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IMContext
argPtr1 ->Ptr IMContext
-> Ptr (Ptr CChar) -> Ptr (Ptr ()) -> Ptr CInt -> IO ()
gtk_im_context_get_preedit_string Ptr IMContext
argPtr1 Ptr (Ptr CChar)
arg2 Ptr (Ptr ())
arg3 Ptr CInt
arg4)
{-# LINE 115 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
(toIMContext self)
Ptr (Ptr CChar)
strPtr
Ptr (Ptr ())
attrListPtr
Ptr CInt
cursorPosPtr
IO () -> IO (Ptr CChar) -> IO (Ptr CChar)
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Ptr (Ptr CChar) -> IO (Ptr CChar)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr CChar)
strPtr IO (Ptr CChar) -> (Ptr CChar -> IO string) -> IO string
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Ptr CChar -> IO string
forall s. GlibString s => Ptr CChar -> IO s
readUTFString IO string
-> (string -> IO (string, [[PangoAttribute]], Int))
-> IO (string, [[PangoAttribute]], Int)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \string
str ->
Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr ())
attrListPtr IO (Ptr ())
-> (Ptr () -> IO [[PangoAttribute]]) -> IO [[PangoAttribute]]
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= UTFCorrection -> Ptr () -> IO [[PangoAttribute]]
readAttrList (string -> UTFCorrection
forall s. GlibString s => s -> UTFCorrection
genUTFOfs string
str) IO [[PangoAttribute]]
-> ([[PangoAttribute]] -> IO (string, [[PangoAttribute]], Int))
-> IO (string, [[PangoAttribute]], Int)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \[[PangoAttribute]]
attrs ->
Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
cursorPosPtr IO CInt
-> (CInt -> IO (string, [[PangoAttribute]], Int))
-> IO (string, [[PangoAttribute]], Int)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CInt
cursorPos ->
(string, [[PangoAttribute]], Int)
-> IO (string, [[PangoAttribute]], Int)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (string
str, [[PangoAttribute]]
attrs, CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
cursorPos)
imContextFilterKeypress :: IMContextClass self => self
-> EventM EKey Bool
imContextFilterKeypress :: forall self. IMContextClass self => self -> EventM EKey Bool
imContextFilterKeypress self
self =
(CInt -> Bool) -> ReaderT (Ptr EKey) IO CInt -> EventM EKey Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (ReaderT (Ptr EKey) IO CInt -> EventM EKey Bool)
-> ReaderT (Ptr EKey) IO CInt -> EventM EKey Bool
forall a b. (a -> b) -> a -> b
$
ReaderT (Ptr EKey) IO (Ptr EKey)
forall r (m :: * -> *). MonadReader r m => m r
ask ReaderT (Ptr EKey) IO (Ptr EKey)
-> (Ptr EKey -> ReaderT (Ptr EKey) IO CInt)
-> ReaderT (Ptr EKey) IO CInt
forall a b.
ReaderT (Ptr EKey) IO a
-> (a -> ReaderT (Ptr EKey) IO b) -> ReaderT (Ptr EKey) IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr EKey
eventPtr ->
IO CInt -> ReaderT (Ptr EKey) IO CInt
forall a. IO a -> ReaderT (Ptr EKey) IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> ReaderT (Ptr EKey) IO CInt)
-> IO CInt -> ReaderT (Ptr EKey) IO CInt
forall a b. (a -> b) -> a -> b
$
(\(IMContext ForeignPtr IMContext
arg1) Ptr ()
arg2 -> ForeignPtr IMContext -> (Ptr IMContext -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr IMContext
arg1 ((Ptr IMContext -> IO CInt) -> IO CInt)
-> (Ptr IMContext -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr IMContext
argPtr1 ->Ptr IMContext -> Ptr () -> IO CInt
gtk_im_context_filter_keypress Ptr IMContext
argPtr1 Ptr ()
arg2)
{-# LINE 137 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
(toIMContext self)
(Ptr EKey -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr EKey
eventPtr)
imContextFocusIn :: IMContextClass self => self -> IO ()
imContextFocusIn :: forall self. IMContextClass self => self -> IO ()
imContextFocusIn self
self =
(\(IMContext ForeignPtr IMContext
arg1) -> ForeignPtr IMContext -> (Ptr IMContext -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr IMContext
arg1 ((Ptr IMContext -> IO ()) -> IO ())
-> (Ptr IMContext -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IMContext
argPtr1 ->Ptr IMContext -> IO ()
gtk_im_context_focus_in Ptr IMContext
argPtr1)
{-# LINE 147 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
(toIMContext self)
imContextFocusOut :: IMContextClass self => self -> IO ()
imContextFocusOut :: forall self. IMContextClass self => self -> IO ()
imContextFocusOut self
self =
(\(IMContext ForeignPtr IMContext
arg1) -> ForeignPtr IMContext -> (Ptr IMContext -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr IMContext
arg1 ((Ptr IMContext -> IO ()) -> IO ())
-> (Ptr IMContext -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IMContext
argPtr1 ->Ptr IMContext -> IO ()
gtk_im_context_focus_out Ptr IMContext
argPtr1)
{-# LINE 156 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
(toIMContext self)
imContextReset :: IMContextClass self => self -> IO ()
imContextReset :: forall self. IMContextClass self => self -> IO ()
imContextReset self
self =
(\(IMContext ForeignPtr IMContext
arg1) -> ForeignPtr IMContext -> (Ptr IMContext -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr IMContext
arg1 ((Ptr IMContext -> IO ()) -> IO ())
-> (Ptr IMContext -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IMContext
argPtr1 ->Ptr IMContext -> IO ()
gtk_im_context_reset Ptr IMContext
argPtr1)
{-# LINE 165 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
(toIMContext self)
imContextSetCursorLocation :: IMContextClass self => self
-> Rectangle
-> IO ()
imContextSetCursorLocation :: forall self. IMContextClass self => self -> Rectangle -> IO ()
imContextSetCursorLocation self
self Rectangle
area =
Rectangle -> (Ptr Rectangle -> IO ()) -> IO ()
forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
with Rectangle
area ((Ptr Rectangle -> IO ()) -> IO ())
-> (Ptr Rectangle -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Rectangle
areaPtr ->
(\(IMContext ForeignPtr IMContext
arg1) Ptr ()
arg2 -> ForeignPtr IMContext -> (Ptr IMContext -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr IMContext
arg1 ((Ptr IMContext -> IO ()) -> IO ())
-> (Ptr IMContext -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IMContext
argPtr1 ->Ptr IMContext -> Ptr () -> IO ()
gtk_im_context_set_cursor_location Ptr IMContext
argPtr1 Ptr ()
arg2)
{-# LINE 176 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
(toIMContext self)
(Ptr Rectangle -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr Ptr Rectangle
areaPtr)
imContextSetUsePreedit :: IMContextClass self => self
-> Bool
-> IO ()
imContextSetUsePreedit :: forall self. IMContextClass self => self -> Bool -> IO ()
imContextSetUsePreedit self
self Bool
usePreedit =
(\(IMContext ForeignPtr IMContext
arg1) CInt
arg2 -> ForeignPtr IMContext -> (Ptr IMContext -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr IMContext
arg1 ((Ptr IMContext -> IO ()) -> IO ())
-> (Ptr IMContext -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IMContext
argPtr1 ->Ptr IMContext -> CInt -> IO ()
gtk_im_context_set_use_preedit Ptr IMContext
argPtr1 CInt
arg2)
{-# LINE 190 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
(toIMContext self)
(Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
usePreedit)
imContextSetSurrounding :: (IMContextClass self, GlibString string) => self
-> string
-> Int
-> IO ()
imContextSetSurrounding :: forall self string.
(IMContextClass self, GlibString string) =>
self -> string -> Int -> IO ()
imContextSetSurrounding self
self string
text Int
cursorIndex =
string -> (Ptr CChar -> IO ()) -> IO ()
forall a. string -> (Ptr CChar -> IO a) -> IO a
forall s a. GlibString s => s -> (Ptr CChar -> IO a) -> IO a
withUTFString string
text ((Ptr CChar -> IO ()) -> IO ()) -> (Ptr CChar -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr CChar
textPtr ->
(\(IMContext ForeignPtr IMContext
arg1) Ptr CChar
arg2 CInt
arg3 CInt
arg4 -> ForeignPtr IMContext -> (Ptr IMContext -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr IMContext
arg1 ((Ptr IMContext -> IO ()) -> IO ())
-> (Ptr IMContext -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr IMContext
argPtr1 ->Ptr IMContext -> Ptr CChar -> CInt -> CInt -> IO ()
gtk_im_context_set_surrounding Ptr IMContext
argPtr1 Ptr CChar
arg2 CInt
arg3 CInt
arg4)
{-# LINE 207 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
(toIMContext self)
Ptr CChar
textPtr
(-CInt
1)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> UTFCorrection -> Int
ofsToUTF Int
cursorIndex (string -> UTFCorrection
forall s. GlibString s => s -> UTFCorrection
genUTFOfs string
text)))
imContextGetSurrounding :: (IMContextClass self, GlibString string) => self
-> IO (Maybe (string, Int))
imContextGetSurrounding :: forall self string.
(IMContextClass self, GlibString string) =>
self -> IO (Maybe (string, Int))
imContextGetSurrounding self
self =
(Ptr (Ptr CChar) -> IO (Maybe (string, Int)))
-> IO (Maybe (string, Int))
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr (Ptr CChar) -> IO (Maybe (string, Int)))
-> IO (Maybe (string, Int)))
-> (Ptr (Ptr CChar) -> IO (Maybe (string, Int)))
-> IO (Maybe (string, Int))
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
textPtr ->
(Ptr CInt -> IO (Maybe (string, Int))) -> IO (Maybe (string, Int))
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CInt -> IO (Maybe (string, Int)))
-> IO (Maybe (string, Int)))
-> (Ptr CInt -> IO (Maybe (string, Int)))
-> IO (Maybe (string, Int))
forall a b. (a -> b) -> a -> b
$ \Ptr CInt
cursorIndexPtr ->
(\(IMContext ForeignPtr IMContext
arg1) Ptr (Ptr CChar)
arg2 Ptr CInt
arg3 -> ForeignPtr IMContext -> (Ptr IMContext -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr IMContext
arg1 ((Ptr IMContext -> IO CInt) -> IO CInt)
-> (Ptr IMContext -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr IMContext
argPtr1 ->Ptr IMContext -> Ptr (Ptr CChar) -> Ptr CInt -> IO CInt
gtk_im_context_get_surrounding Ptr IMContext
argPtr1 Ptr (Ptr CChar)
arg2 Ptr CInt
arg3)
{-# LINE 234 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
(toIMContext self)
Ptr (Ptr CChar)
textPtr
Ptr CInt
cursorIndexPtr IO CInt
-> (CInt -> IO (Maybe (string, Int))) -> IO (Maybe (string, Int))
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CInt
provided ->
if CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool CInt
provided then
Ptr (Ptr CChar) -> IO (Ptr CChar)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr CChar)
textPtr IO (Ptr CChar) -> (Ptr CChar -> IO string) -> IO string
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Ptr CChar -> IO string
forall s. GlibString s => Ptr CChar -> IO s
readUTFString IO string
-> (string -> IO (Maybe (string, Int))) -> IO (Maybe (string, Int))
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \string
text ->
Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
cursorIndexPtr IO CInt
-> (CInt -> IO (Maybe (string, Int))) -> IO (Maybe (string, Int))
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CInt
cursorIndex ->
Maybe (string, Int) -> IO (Maybe (string, Int))
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ((string, Int) -> Maybe (string, Int)
forall a. a -> Maybe a
Just (string
text, Int -> UTFCorrection -> Int
ofsFromUTF (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
cursorIndex)
(string -> UTFCorrection
forall s. GlibString s => s -> UTFCorrection
genUTFOfs string
text)))
else
Maybe (string, Int) -> IO (Maybe (string, Int))
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe (string, Int)
forall a. Maybe a
Nothing
imContextDeleteSurrounding :: IMContextClass self => self
-> Int
-> Int
-> IO Bool
imContextDeleteSurrounding :: forall self. IMContextClass self => self -> Int -> Int -> IO Bool
imContextDeleteSurrounding self
self Int
offset Int
nChars =
(CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
(\(IMContext ForeignPtr IMContext
arg1) CInt
arg2 CInt
arg3 -> ForeignPtr IMContext -> (Ptr IMContext -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr IMContext
arg1 ((Ptr IMContext -> IO CInt) -> IO CInt)
-> (Ptr IMContext -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr IMContext
argPtr1 ->Ptr IMContext -> CInt -> CInt -> IO CInt
gtk_im_context_delete_surrounding Ptr IMContext
argPtr1 CInt
arg2 CInt
arg3)
{-# LINE 268 "./Graphics/UI/Gtk/Abstract/IMContext.chs" #-}
(toIMContext self)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
offset)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
nChars)
imContextPreeditStart :: IMContextClass self => Signal self (IO ())
imContextPreeditStart :: forall self. IMContextClass self => Signal self (IO ())
imContextPreeditStart = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (SignalName -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
SignalName -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE SignalName
"preedit-start")
imContextPreeditEnd :: IMContextClass self => Signal self (IO ())
imContextPreeditEnd :: forall self. IMContextClass self => Signal self (IO ())
imContextPreeditEnd = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (SignalName -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
SignalName -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE SignalName
"preedit-end")
imContextPreeditChanged :: IMContextClass self => Signal self (IO ())
imContextPreeditChanged :: forall self. IMContextClass self => Signal self (IO ())
imContextPreeditChanged = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (SignalName -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
SignalName -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE SignalName
"preedit-changed")
imContextCommit :: (IMContextClass self, GlibString string) => Signal self (string -> IO ())
imContextCommit :: forall self string.
(IMContextClass self, GlibString string) =>
Signal self (string -> IO ())
imContextCommit = (Bool -> self -> (string -> IO ()) -> IO (ConnectId self))
-> Signal self (string -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (SignalName
-> Bool -> self -> (string -> IO ()) -> IO (ConnectId self)
forall a' obj.
(GlibString a', GObjectClass obj) =>
SignalName -> Bool -> obj -> (a' -> IO ()) -> IO (ConnectId obj)
connect_GLIBSTRING__NONE SignalName
"commit")
imContextRetrieveSurrounding :: IMContextClass self => Signal self (IO Bool)
imContextRetrieveSurrounding :: forall self. IMContextClass self => Signal self (IO Bool)
imContextRetrieveSurrounding = (Bool -> self -> IO Bool -> IO (ConnectId self))
-> Signal self (IO Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (SignalName -> Bool -> self -> IO Bool -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
SignalName -> Bool -> obj -> IO Bool -> IO (ConnectId obj)
connect_NONE__BOOL SignalName
"retrieve-surrounding")
imContextDeleteSurrounding' :: IMContextClass self => Signal self (Int -> Int -> IO Bool)
imContextDeleteSurrounding' :: forall self.
IMContextClass self =>
Signal self (Int -> Int -> IO Bool)
imContextDeleteSurrounding' = (Bool -> self -> (Int -> Int -> IO Bool) -> IO (ConnectId self))
-> Signal self (Int -> Int -> IO Bool)
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (SignalName
-> Bool -> self -> (Int -> Int -> IO Bool) -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
SignalName
-> Bool -> obj -> (Int -> Int -> IO Bool) -> IO (ConnectId obj)
connect_INT_INT__BOOL SignalName
"delete-surrounding")
foreign import ccall safe "gtk_im_context_set_client_window"
gtk_im_context_set_client_window :: ((Ptr IMContext) -> ((Ptr DrawWindow) -> (IO ())))
foreign import ccall safe "gtk_im_context_get_preedit_string"
gtk_im_context_get_preedit_string :: ((Ptr IMContext) -> ((Ptr (Ptr CChar)) -> ((Ptr (Ptr ())) -> ((Ptr CInt) -> (IO ())))))
foreign import ccall safe "gtk_im_context_filter_keypress"
gtk_im_context_filter_keypress :: ((Ptr IMContext) -> ((Ptr ()) -> (IO CInt)))
foreign import ccall safe "gtk_im_context_focus_in"
gtk_im_context_focus_in :: ((Ptr IMContext) -> (IO ()))
foreign import ccall safe "gtk_im_context_focus_out"
gtk_im_context_focus_out :: ((Ptr IMContext) -> (IO ()))
foreign import ccall safe "gtk_im_context_reset"
gtk_im_context_reset :: ((Ptr IMContext) -> (IO ()))
foreign import ccall safe "gtk_im_context_set_cursor_location"
gtk_im_context_set_cursor_location :: ((Ptr IMContext) -> ((Ptr ()) -> (IO ())))
foreign import ccall safe "gtk_im_context_set_use_preedit"
gtk_im_context_set_use_preedit :: ((Ptr IMContext) -> (CInt -> (IO ())))
foreign import ccall safe "gtk_im_context_set_surrounding"
gtk_im_context_set_surrounding :: ((Ptr IMContext) -> ((Ptr CChar) -> (CInt -> (CInt -> (IO ())))))
foreign import ccall safe "gtk_im_context_get_surrounding"
gtk_im_context_get_surrounding :: ((Ptr IMContext) -> ((Ptr (Ptr CChar)) -> ((Ptr CInt) -> (IO CInt))))
foreign import ccall safe "gtk_im_context_delete_surrounding"
gtk_im_context_delete_surrounding :: ((Ptr IMContext) -> (CInt -> (CInt -> (IO CInt))))