module GI.Gtk.Objects.Gesture
(
Gesture(..) ,
GestureK ,
toGesture ,
noGesture ,
gestureGetBoundingBox ,
gestureGetBoundingBoxCenter ,
gestureGetDevice ,
gestureGetGroup ,
gestureGetLastEvent ,
gestureGetLastUpdatedSequence ,
gestureGetPoint ,
gestureGetSequenceState ,
gestureGetSequences ,
gestureGetWindow ,
gestureGroup ,
gestureHandlesSequence ,
gestureIsActive ,
gestureIsGroupedWith ,
gestureIsRecognized ,
gestureSetSequenceState ,
gestureSetState ,
gestureSetWindow ,
gestureUngroup ,
GestureNPointsPropertyInfo ,
constructGestureNPoints ,
getGestureNPoints ,
GestureWindowPropertyInfo ,
constructGestureWindow ,
getGestureWindow ,
setGestureWindow ,
GestureBeginCallback ,
GestureBeginCallbackC ,
GestureBeginSignalInfo ,
afterGestureBegin ,
gestureBeginCallbackWrapper ,
gestureBeginClosure ,
mkGestureBeginCallback ,
noGestureBeginCallback ,
onGestureBegin ,
GestureCancelCallback ,
GestureCancelCallbackC ,
GestureCancelSignalInfo ,
afterGestureCancel ,
gestureCancelCallbackWrapper ,
gestureCancelClosure ,
mkGestureCancelCallback ,
noGestureCancelCallback ,
onGestureCancel ,
GestureEndCallback ,
GestureEndCallbackC ,
GestureEndSignalInfo ,
afterGestureEnd ,
gestureEndCallbackWrapper ,
gestureEndClosure ,
mkGestureEndCallback ,
noGestureEndCallback ,
onGestureEnd ,
GestureSequenceStateChangedCallback ,
GestureSequenceStateChangedCallbackC ,
GestureSequenceStateChangedSignalInfo ,
afterGestureSequenceStateChanged ,
gestureSequenceStateChangedCallbackWrapper,
gestureSequenceStateChangedClosure ,
mkGestureSequenceStateChangedCallback ,
noGestureSequenceStateChangedCallback ,
onGestureSequenceStateChanged ,
GestureUpdateCallback ,
GestureUpdateCallbackC ,
GestureUpdateSignalInfo ,
afterGestureUpdate ,
gestureUpdateCallbackWrapper ,
gestureUpdateClosure ,
mkGestureUpdateCallback ,
noGestureUpdateCallback ,
onGestureUpdate ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.Gtk.Types
import GI.Gtk.Callbacks
import qualified GI.GObject as GObject
import qualified GI.Gdk as Gdk
import qualified GI.Cairo as Cairo
newtype Gesture = Gesture (ForeignPtr Gesture)
foreign import ccall "gtk_gesture_get_type"
c_gtk_gesture_get_type :: IO GType
type instance ParentTypes Gesture = GestureParentTypes
type GestureParentTypes = '[EventController, GObject.Object]
instance GObject Gesture where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_gtk_gesture_get_type
class GObject o => GestureK o
instance (GObject o, IsDescendantOf Gesture o) => GestureK o
toGesture :: GestureK o => o -> IO Gesture
toGesture = unsafeCastTo Gesture
noGesture :: Maybe Gesture
noGesture = Nothing
type GestureBeginCallback =
Gdk.EventSequence ->
IO ()
noGestureBeginCallback :: Maybe GestureBeginCallback
noGestureBeginCallback = Nothing
type GestureBeginCallbackC =
Ptr () ->
Ptr Gdk.EventSequence ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mkGestureBeginCallback :: GestureBeginCallbackC -> IO (FunPtr GestureBeginCallbackC)
gestureBeginClosure :: GestureBeginCallback -> IO Closure
gestureBeginClosure cb = newCClosure =<< mkGestureBeginCallback wrapped
where wrapped = gestureBeginCallbackWrapper cb
gestureBeginCallbackWrapper ::
GestureBeginCallback ->
Ptr () ->
Ptr Gdk.EventSequence ->
Ptr () ->
IO ()
gestureBeginCallbackWrapper _cb _ sequence _ = do
sequence' <- (newBoxed Gdk.EventSequence) sequence
_cb sequence'
onGestureBegin :: (GObject a, MonadIO m) => a -> GestureBeginCallback -> m SignalHandlerId
onGestureBegin obj cb = liftIO $ connectGestureBegin obj cb SignalConnectBefore
afterGestureBegin :: (GObject a, MonadIO m) => a -> GestureBeginCallback -> m SignalHandlerId
afterGestureBegin obj cb = connectGestureBegin obj cb SignalConnectAfter
connectGestureBegin :: (GObject a, MonadIO m) =>
a -> GestureBeginCallback -> SignalConnectMode -> m SignalHandlerId
connectGestureBegin obj cb after = liftIO $ do
cb' <- mkGestureBeginCallback (gestureBeginCallbackWrapper cb)
connectSignalFunPtr obj "begin" cb' after
type GestureCancelCallback =
Gdk.EventSequence ->
IO ()
noGestureCancelCallback :: Maybe GestureCancelCallback
noGestureCancelCallback = Nothing
type GestureCancelCallbackC =
Ptr () ->
Ptr Gdk.EventSequence ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mkGestureCancelCallback :: GestureCancelCallbackC -> IO (FunPtr GestureCancelCallbackC)
gestureCancelClosure :: GestureCancelCallback -> IO Closure
gestureCancelClosure cb = newCClosure =<< mkGestureCancelCallback wrapped
where wrapped = gestureCancelCallbackWrapper cb
gestureCancelCallbackWrapper ::
GestureCancelCallback ->
Ptr () ->
Ptr Gdk.EventSequence ->
Ptr () ->
IO ()
gestureCancelCallbackWrapper _cb _ sequence _ = do
sequence' <- (newBoxed Gdk.EventSequence) sequence
_cb sequence'
onGestureCancel :: (GObject a, MonadIO m) => a -> GestureCancelCallback -> m SignalHandlerId
onGestureCancel obj cb = liftIO $ connectGestureCancel obj cb SignalConnectBefore
afterGestureCancel :: (GObject a, MonadIO m) => a -> GestureCancelCallback -> m SignalHandlerId
afterGestureCancel obj cb = connectGestureCancel obj cb SignalConnectAfter
connectGestureCancel :: (GObject a, MonadIO m) =>
a -> GestureCancelCallback -> SignalConnectMode -> m SignalHandlerId
connectGestureCancel obj cb after = liftIO $ do
cb' <- mkGestureCancelCallback (gestureCancelCallbackWrapper cb)
connectSignalFunPtr obj "cancel" cb' after
type GestureEndCallback =
Gdk.EventSequence ->
IO ()
noGestureEndCallback :: Maybe GestureEndCallback
noGestureEndCallback = Nothing
type GestureEndCallbackC =
Ptr () ->
Ptr Gdk.EventSequence ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mkGestureEndCallback :: GestureEndCallbackC -> IO (FunPtr GestureEndCallbackC)
gestureEndClosure :: GestureEndCallback -> IO Closure
gestureEndClosure cb = newCClosure =<< mkGestureEndCallback wrapped
where wrapped = gestureEndCallbackWrapper cb
gestureEndCallbackWrapper ::
GestureEndCallback ->
Ptr () ->
Ptr Gdk.EventSequence ->
Ptr () ->
IO ()
gestureEndCallbackWrapper _cb _ sequence _ = do
sequence' <- (newBoxed Gdk.EventSequence) sequence
_cb sequence'
onGestureEnd :: (GObject a, MonadIO m) => a -> GestureEndCallback -> m SignalHandlerId
onGestureEnd obj cb = liftIO $ connectGestureEnd obj cb SignalConnectBefore
afterGestureEnd :: (GObject a, MonadIO m) => a -> GestureEndCallback -> m SignalHandlerId
afterGestureEnd obj cb = connectGestureEnd obj cb SignalConnectAfter
connectGestureEnd :: (GObject a, MonadIO m) =>
a -> GestureEndCallback -> SignalConnectMode -> m SignalHandlerId
connectGestureEnd obj cb after = liftIO $ do
cb' <- mkGestureEndCallback (gestureEndCallbackWrapper cb)
connectSignalFunPtr obj "end" cb' after
type GestureSequenceStateChangedCallback =
Gdk.EventSequence ->
EventSequenceState ->
IO ()
noGestureSequenceStateChangedCallback :: Maybe GestureSequenceStateChangedCallback
noGestureSequenceStateChangedCallback = Nothing
type GestureSequenceStateChangedCallbackC =
Ptr () ->
Ptr Gdk.EventSequence ->
CUInt ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mkGestureSequenceStateChangedCallback :: GestureSequenceStateChangedCallbackC -> IO (FunPtr GestureSequenceStateChangedCallbackC)
gestureSequenceStateChangedClosure :: GestureSequenceStateChangedCallback -> IO Closure
gestureSequenceStateChangedClosure cb = newCClosure =<< mkGestureSequenceStateChangedCallback wrapped
where wrapped = gestureSequenceStateChangedCallbackWrapper cb
gestureSequenceStateChangedCallbackWrapper ::
GestureSequenceStateChangedCallback ->
Ptr () ->
Ptr Gdk.EventSequence ->
CUInt ->
Ptr () ->
IO ()
gestureSequenceStateChangedCallbackWrapper _cb _ sequence state _ = do
sequence' <- (newBoxed Gdk.EventSequence) sequence
let state' = (toEnum . fromIntegral) state
_cb sequence' state'
onGestureSequenceStateChanged :: (GObject a, MonadIO m) => a -> GestureSequenceStateChangedCallback -> m SignalHandlerId
onGestureSequenceStateChanged obj cb = liftIO $ connectGestureSequenceStateChanged obj cb SignalConnectBefore
afterGestureSequenceStateChanged :: (GObject a, MonadIO m) => a -> GestureSequenceStateChangedCallback -> m SignalHandlerId
afterGestureSequenceStateChanged obj cb = connectGestureSequenceStateChanged obj cb SignalConnectAfter
connectGestureSequenceStateChanged :: (GObject a, MonadIO m) =>
a -> GestureSequenceStateChangedCallback -> SignalConnectMode -> m SignalHandlerId
connectGestureSequenceStateChanged obj cb after = liftIO $ do
cb' <- mkGestureSequenceStateChangedCallback (gestureSequenceStateChangedCallbackWrapper cb)
connectSignalFunPtr obj "sequence-state-changed" cb' after
type GestureUpdateCallback =
Gdk.EventSequence ->
IO ()
noGestureUpdateCallback :: Maybe GestureUpdateCallback
noGestureUpdateCallback = Nothing
type GestureUpdateCallbackC =
Ptr () ->
Ptr Gdk.EventSequence ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mkGestureUpdateCallback :: GestureUpdateCallbackC -> IO (FunPtr GestureUpdateCallbackC)
gestureUpdateClosure :: GestureUpdateCallback -> IO Closure
gestureUpdateClosure cb = newCClosure =<< mkGestureUpdateCallback wrapped
where wrapped = gestureUpdateCallbackWrapper cb
gestureUpdateCallbackWrapper ::
GestureUpdateCallback ->
Ptr () ->
Ptr Gdk.EventSequence ->
Ptr () ->
IO ()
gestureUpdateCallbackWrapper _cb _ sequence _ = do
sequence' <- (newBoxed Gdk.EventSequence) sequence
_cb sequence'
onGestureUpdate :: (GObject a, MonadIO m) => a -> GestureUpdateCallback -> m SignalHandlerId
onGestureUpdate obj cb = liftIO $ connectGestureUpdate obj cb SignalConnectBefore
afterGestureUpdate :: (GObject a, MonadIO m) => a -> GestureUpdateCallback -> m SignalHandlerId
afterGestureUpdate obj cb = connectGestureUpdate obj cb SignalConnectAfter
connectGestureUpdate :: (GObject a, MonadIO m) =>
a -> GestureUpdateCallback -> SignalConnectMode -> m SignalHandlerId
connectGestureUpdate obj cb after = liftIO $ do
cb' <- mkGestureUpdateCallback (gestureUpdateCallbackWrapper cb)
connectSignalFunPtr obj "update" cb' after
getGestureNPoints :: (MonadIO m, GestureK o) => o -> m Word32
getGestureNPoints obj = liftIO $ getObjectPropertyCUInt obj "n-points"
constructGestureNPoints :: Word32 -> IO ([Char], GValue)
constructGestureNPoints val = constructObjectPropertyCUInt "n-points" val
data GestureNPointsPropertyInfo
instance AttrInfo GestureNPointsPropertyInfo where
type AttrAllowedOps GestureNPointsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint GestureNPointsPropertyInfo = (~) Word32
type AttrBaseTypeConstraint GestureNPointsPropertyInfo = GestureK
type AttrGetType GestureNPointsPropertyInfo = Word32
type AttrLabel GestureNPointsPropertyInfo = "Gesture::n-points"
attrGet _ = getGestureNPoints
attrSet _ = undefined
attrConstruct _ = constructGestureNPoints
getGestureWindow :: (MonadIO m, GestureK o) => o -> m Gdk.Window
getGestureWindow obj = liftIO $ getObjectPropertyObject obj "window" Gdk.Window
setGestureWindow :: (MonadIO m, GestureK o, Gdk.WindowK a) => o -> a -> m ()
setGestureWindow obj val = liftIO $ setObjectPropertyObject obj "window" val
constructGestureWindow :: (Gdk.WindowK a) => a -> IO ([Char], GValue)
constructGestureWindow val = constructObjectPropertyObject "window" val
data GestureWindowPropertyInfo
instance AttrInfo GestureWindowPropertyInfo where
type AttrAllowedOps GestureWindowPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint GestureWindowPropertyInfo = Gdk.WindowK
type AttrBaseTypeConstraint GestureWindowPropertyInfo = GestureK
type AttrGetType GestureWindowPropertyInfo = Gdk.Window
type AttrLabel GestureWindowPropertyInfo = "Gesture::window"
attrGet _ = getGestureWindow
attrSet _ = setGestureWindow
attrConstruct _ = constructGestureWindow
type instance AttributeList Gesture = GestureAttributeList
type GestureAttributeList = ('[ '("n-points", GestureNPointsPropertyInfo), '("propagation-phase", EventControllerPropagationPhasePropertyInfo), '("widget", EventControllerWidgetPropertyInfo), '("window", GestureWindowPropertyInfo)] :: [(Symbol, *)])
data GestureBeginSignalInfo
instance SignalInfo GestureBeginSignalInfo where
type HaskellCallbackType GestureBeginSignalInfo = GestureBeginCallback
connectSignal _ = connectGestureBegin
data GestureCancelSignalInfo
instance SignalInfo GestureCancelSignalInfo where
type HaskellCallbackType GestureCancelSignalInfo = GestureCancelCallback
connectSignal _ = connectGestureCancel
data GestureEndSignalInfo
instance SignalInfo GestureEndSignalInfo where
type HaskellCallbackType GestureEndSignalInfo = GestureEndCallback
connectSignal _ = connectGestureEnd
data GestureSequenceStateChangedSignalInfo
instance SignalInfo GestureSequenceStateChangedSignalInfo where
type HaskellCallbackType GestureSequenceStateChangedSignalInfo = GestureSequenceStateChangedCallback
connectSignal _ = connectGestureSequenceStateChanged
data GestureUpdateSignalInfo
instance SignalInfo GestureUpdateSignalInfo where
type HaskellCallbackType GestureUpdateSignalInfo = GestureUpdateCallback
connectSignal _ = connectGestureUpdate
type instance SignalList Gesture = GestureSignalList
type GestureSignalList = ('[ '("begin", GestureBeginSignalInfo), '("cancel", GestureCancelSignalInfo), '("end", GestureEndSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("sequence-state-changed", GestureSequenceStateChangedSignalInfo), '("update", GestureUpdateSignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "gtk_gesture_get_bounding_box" gtk_gesture_get_bounding_box ::
Ptr Gesture ->
Ptr Cairo.RectangleInt ->
IO CInt
gestureGetBoundingBox ::
(MonadIO m, GestureK a) =>
a ->
m (Bool,Cairo.RectangleInt)
gestureGetBoundingBox _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
rect <- callocBoxedBytes 16 :: IO (Ptr Cairo.RectangleInt)
result <- gtk_gesture_get_bounding_box _obj' rect
let result' = (/= 0) result
rect' <- (wrapBoxed Cairo.RectangleInt) rect
touchManagedPtr _obj
return (result', rect')
foreign import ccall "gtk_gesture_get_bounding_box_center" gtk_gesture_get_bounding_box_center ::
Ptr Gesture ->
Ptr CDouble ->
Ptr CDouble ->
IO CInt
gestureGetBoundingBoxCenter ::
(MonadIO m, GestureK a) =>
a ->
m (Bool,Double,Double)
gestureGetBoundingBoxCenter _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
x <- allocMem :: IO (Ptr CDouble)
y <- allocMem :: IO (Ptr CDouble)
result <- gtk_gesture_get_bounding_box_center _obj' x y
let result' = (/= 0) result
x' <- peek x
let x'' = realToFrac x'
y' <- peek y
let y'' = realToFrac y'
touchManagedPtr _obj
freeMem x
freeMem y
return (result', x'', y'')
foreign import ccall "gtk_gesture_get_device" gtk_gesture_get_device ::
Ptr Gesture ->
IO (Ptr Gdk.Device)
gestureGetDevice ::
(MonadIO m, GestureK a) =>
a ->
m Gdk.Device
gestureGetDevice _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_gesture_get_device _obj'
checkUnexpectedReturnNULL "gtk_gesture_get_device" result
result' <- (newObject Gdk.Device) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_gesture_get_group" gtk_gesture_get_group ::
Ptr Gesture ->
IO (Ptr (GList (Ptr Gesture)))
gestureGetGroup ::
(MonadIO m, GestureK a) =>
a ->
m [Gesture]
gestureGetGroup _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_gesture_get_group _obj'
checkUnexpectedReturnNULL "gtk_gesture_get_group" result
result' <- unpackGList result
result'' <- mapM (newObject Gesture) result'
g_list_free result
touchManagedPtr _obj
return result''
foreign import ccall "gtk_gesture_get_last_event" gtk_gesture_get_last_event ::
Ptr Gesture ->
Ptr Gdk.EventSequence ->
IO (Ptr Gdk.Event)
gestureGetLastEvent ::
(MonadIO m, GestureK a) =>
a ->
Gdk.EventSequence ->
m Gdk.Event
gestureGetLastEvent _obj sequence = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let sequence' = unsafeManagedPtrGetPtr sequence
result <- gtk_gesture_get_last_event _obj' sequence'
checkUnexpectedReturnNULL "gtk_gesture_get_last_event" result
result' <- (newBoxed Gdk.Event) result
touchManagedPtr _obj
touchManagedPtr sequence
return result'
foreign import ccall "gtk_gesture_get_last_updated_sequence" gtk_gesture_get_last_updated_sequence ::
Ptr Gesture ->
IO (Ptr Gdk.EventSequence)
gestureGetLastUpdatedSequence ::
(MonadIO m, GestureK a) =>
a ->
m Gdk.EventSequence
gestureGetLastUpdatedSequence _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_gesture_get_last_updated_sequence _obj'
checkUnexpectedReturnNULL "gtk_gesture_get_last_updated_sequence" result
result' <- (wrapBoxed Gdk.EventSequence) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_gesture_get_point" gtk_gesture_get_point ::
Ptr Gesture ->
Ptr Gdk.EventSequence ->
Ptr CDouble ->
Ptr CDouble ->
IO CInt
gestureGetPoint ::
(MonadIO m, GestureK a) =>
a ->
Maybe (Gdk.EventSequence) ->
m (Bool,Double,Double)
gestureGetPoint _obj sequence = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
maybeSequence <- case sequence of
Nothing -> return nullPtr
Just jSequence -> do
let jSequence' = unsafeManagedPtrGetPtr jSequence
return jSequence'
x <- allocMem :: IO (Ptr CDouble)
y <- allocMem :: IO (Ptr CDouble)
result <- gtk_gesture_get_point _obj' maybeSequence x y
let result' = (/= 0) result
x' <- peek x
let x'' = realToFrac x'
y' <- peek y
let y'' = realToFrac y'
touchManagedPtr _obj
whenJust sequence touchManagedPtr
freeMem x
freeMem y
return (result', x'', y'')
foreign import ccall "gtk_gesture_get_sequence_state" gtk_gesture_get_sequence_state ::
Ptr Gesture ->
Ptr Gdk.EventSequence ->
IO CUInt
gestureGetSequenceState ::
(MonadIO m, GestureK a) =>
a ->
Gdk.EventSequence ->
m EventSequenceState
gestureGetSequenceState _obj sequence = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let sequence' = unsafeManagedPtrGetPtr sequence
result <- gtk_gesture_get_sequence_state _obj' sequence'
let result' = (toEnum . fromIntegral) result
touchManagedPtr _obj
touchManagedPtr sequence
return result'
foreign import ccall "gtk_gesture_get_sequences" gtk_gesture_get_sequences ::
Ptr Gesture ->
IO (Ptr (GList (Ptr Gdk.EventSequence)))
gestureGetSequences ::
(MonadIO m, GestureK a) =>
a ->
m [Gdk.EventSequence]
gestureGetSequences _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_gesture_get_sequences _obj'
checkUnexpectedReturnNULL "gtk_gesture_get_sequences" result
result' <- unpackGList result
result'' <- mapM (newBoxed Gdk.EventSequence) result'
g_list_free result
touchManagedPtr _obj
return result''
foreign import ccall "gtk_gesture_get_window" gtk_gesture_get_window ::
Ptr Gesture ->
IO (Ptr Gdk.Window)
gestureGetWindow ::
(MonadIO m, GestureK a) =>
a ->
m Gdk.Window
gestureGetWindow _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_gesture_get_window _obj'
checkUnexpectedReturnNULL "gtk_gesture_get_window" result
result' <- (newObject Gdk.Window) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_gesture_group" gtk_gesture_group ::
Ptr Gesture ->
Ptr Gesture ->
IO ()
gestureGroup ::
(MonadIO m, GestureK a, GestureK b) =>
a ->
b ->
m ()
gestureGroup _obj gesture = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let gesture' = unsafeManagedPtrCastPtr gesture
gtk_gesture_group _obj' gesture'
touchManagedPtr _obj
touchManagedPtr gesture
return ()
foreign import ccall "gtk_gesture_handles_sequence" gtk_gesture_handles_sequence ::
Ptr Gesture ->
Ptr Gdk.EventSequence ->
IO CInt
gestureHandlesSequence ::
(MonadIO m, GestureK a) =>
a ->
Gdk.EventSequence ->
m Bool
gestureHandlesSequence _obj sequence = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let sequence' = unsafeManagedPtrGetPtr sequence
result <- gtk_gesture_handles_sequence _obj' sequence'
let result' = (/= 0) result
touchManagedPtr _obj
touchManagedPtr sequence
return result'
foreign import ccall "gtk_gesture_is_active" gtk_gesture_is_active ::
Ptr Gesture ->
IO CInt
gestureIsActive ::
(MonadIO m, GestureK a) =>
a ->
m Bool
gestureIsActive _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_gesture_is_active _obj'
let result' = (/= 0) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_gesture_is_grouped_with" gtk_gesture_is_grouped_with ::
Ptr Gesture ->
Ptr Gesture ->
IO CInt
gestureIsGroupedWith ::
(MonadIO m, GestureK a, GestureK b) =>
a ->
b ->
m Bool
gestureIsGroupedWith _obj other = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let other' = unsafeManagedPtrCastPtr other
result <- gtk_gesture_is_grouped_with _obj' other'
let result' = (/= 0) result
touchManagedPtr _obj
touchManagedPtr other
return result'
foreign import ccall "gtk_gesture_is_recognized" gtk_gesture_is_recognized ::
Ptr Gesture ->
IO CInt
gestureIsRecognized ::
(MonadIO m, GestureK a) =>
a ->
m Bool
gestureIsRecognized _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_gesture_is_recognized _obj'
let result' = (/= 0) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_gesture_set_sequence_state" gtk_gesture_set_sequence_state ::
Ptr Gesture ->
Ptr Gdk.EventSequence ->
CUInt ->
IO CInt
gestureSetSequenceState ::
(MonadIO m, GestureK a) =>
a ->
Gdk.EventSequence ->
EventSequenceState ->
m Bool
gestureSetSequenceState _obj sequence state = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let sequence' = unsafeManagedPtrGetPtr sequence
let state' = (fromIntegral . fromEnum) state
result <- gtk_gesture_set_sequence_state _obj' sequence' state'
let result' = (/= 0) result
touchManagedPtr _obj
touchManagedPtr sequence
return result'
foreign import ccall "gtk_gesture_set_state" gtk_gesture_set_state ::
Ptr Gesture ->
CUInt ->
IO CInt
gestureSetState ::
(MonadIO m, GestureK a) =>
a ->
EventSequenceState ->
m Bool
gestureSetState _obj state = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let state' = (fromIntegral . fromEnum) state
result <- gtk_gesture_set_state _obj' state'
let result' = (/= 0) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_gesture_set_window" gtk_gesture_set_window ::
Ptr Gesture ->
Ptr Gdk.Window ->
IO ()
gestureSetWindow ::
(MonadIO m, GestureK a, Gdk.WindowK b) =>
a ->
Maybe (b) ->
m ()
gestureSetWindow _obj window = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
maybeWindow <- case window of
Nothing -> return nullPtr
Just jWindow -> do
let jWindow' = unsafeManagedPtrCastPtr jWindow
return jWindow'
gtk_gesture_set_window _obj' maybeWindow
touchManagedPtr _obj
whenJust window touchManagedPtr
return ()
foreign import ccall "gtk_gesture_ungroup" gtk_gesture_ungroup ::
Ptr Gesture ->
IO ()
gestureUngroup ::
(MonadIO m, GestureK a) =>
a ->
m ()
gestureUngroup _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
gtk_gesture_ungroup _obj'
touchManagedPtr _obj
return ()