#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gtk.Objects.GestureDrag
(
GestureDrag(..) ,
IsGestureDrag ,
toGestureDrag ,
noGestureDrag ,
#if ENABLE_OVERLOADING
GestureDragGetOffsetMethodInfo ,
#endif
gestureDragGetOffset ,
#if ENABLE_OVERLOADING
GestureDragGetStartPointMethodInfo ,
#endif
gestureDragGetStartPoint ,
gestureDragNew ,
C_GestureDragDragBeginCallback ,
GestureDragDragBeginCallback ,
#if ENABLE_OVERLOADING
GestureDragDragBeginSignalInfo ,
#endif
afterGestureDragDragBegin ,
genClosure_GestureDragDragBegin ,
mk_GestureDragDragBeginCallback ,
noGestureDragDragBeginCallback ,
onGestureDragDragBegin ,
wrap_GestureDragDragBeginCallback ,
C_GestureDragDragEndCallback ,
GestureDragDragEndCallback ,
#if ENABLE_OVERLOADING
GestureDragDragEndSignalInfo ,
#endif
afterGestureDragDragEnd ,
genClosure_GestureDragDragEnd ,
mk_GestureDragDragEndCallback ,
noGestureDragDragEndCallback ,
onGestureDragDragEnd ,
wrap_GestureDragDragEndCallback ,
C_GestureDragDragUpdateCallback ,
GestureDragDragUpdateCallback ,
#if ENABLE_OVERLOADING
GestureDragDragUpdateSignalInfo ,
#endif
afterGestureDragDragUpdate ,
genClosure_GestureDragDragUpdate ,
mk_GestureDragDragUpdateCallback ,
noGestureDragDragUpdateCallback ,
onGestureDragDragUpdate ,
wrap_GestureDragDragUpdateCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gtk.Objects.EventController as Gtk.EventController
import {-# SOURCE #-} qualified GI.Gtk.Objects.Gesture as Gtk.Gesture
import {-# SOURCE #-} qualified GI.Gtk.Objects.GestureSingle as Gtk.GestureSingle
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
newtype GestureDrag = GestureDrag (ManagedPtr GestureDrag)
foreign import ccall "gtk_gesture_drag_get_type"
c_gtk_gesture_drag_get_type :: IO GType
instance GObject GestureDrag where
gobjectType = c_gtk_gesture_drag_get_type
class (GObject o, O.IsDescendantOf GestureDrag o) => IsGestureDrag o
instance (GObject o, O.IsDescendantOf GestureDrag o) => IsGestureDrag o
instance O.HasParentTypes GestureDrag
type instance O.ParentTypes GestureDrag = '[Gtk.GestureSingle.GestureSingle, Gtk.Gesture.Gesture, Gtk.EventController.EventController, GObject.Object.Object]
toGestureDrag :: (MonadIO m, IsGestureDrag o) => o -> m GestureDrag
toGestureDrag = liftIO . unsafeCastTo GestureDrag
noGestureDrag :: Maybe GestureDrag
noGestureDrag = Nothing
#if ENABLE_OVERLOADING
type family ResolveGestureDragMethod (t :: Symbol) (o :: *) :: * where
ResolveGestureDragMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveGestureDragMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveGestureDragMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveGestureDragMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveGestureDragMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveGestureDragMethod "group" o = Gtk.Gesture.GestureGroupMethodInfo
ResolveGestureDragMethod "handleEvent" o = Gtk.EventController.EventControllerHandleEventMethodInfo
ResolveGestureDragMethod "handlesSequence" o = Gtk.Gesture.GestureHandlesSequenceMethodInfo
ResolveGestureDragMethod "isActive" o = Gtk.Gesture.GestureIsActiveMethodInfo
ResolveGestureDragMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveGestureDragMethod "isGroupedWith" o = Gtk.Gesture.GestureIsGroupedWithMethodInfo
ResolveGestureDragMethod "isRecognized" o = Gtk.Gesture.GestureIsRecognizedMethodInfo
ResolveGestureDragMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveGestureDragMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveGestureDragMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveGestureDragMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveGestureDragMethod "reset" o = Gtk.EventController.EventControllerResetMethodInfo
ResolveGestureDragMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveGestureDragMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveGestureDragMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveGestureDragMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveGestureDragMethod "ungroup" o = Gtk.Gesture.GestureUngroupMethodInfo
ResolveGestureDragMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveGestureDragMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveGestureDragMethod "getBoundingBox" o = Gtk.Gesture.GestureGetBoundingBoxMethodInfo
ResolveGestureDragMethod "getBoundingBoxCenter" o = Gtk.Gesture.GestureGetBoundingBoxCenterMethodInfo
ResolveGestureDragMethod "getButton" o = Gtk.GestureSingle.GestureSingleGetButtonMethodInfo
ResolveGestureDragMethod "getCurrentButton" o = Gtk.GestureSingle.GestureSingleGetCurrentButtonMethodInfo
ResolveGestureDragMethod "getCurrentSequence" o = Gtk.GestureSingle.GestureSingleGetCurrentSequenceMethodInfo
ResolveGestureDragMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveGestureDragMethod "getDevice" o = Gtk.Gesture.GestureGetDeviceMethodInfo
ResolveGestureDragMethod "getExclusive" o = Gtk.GestureSingle.GestureSingleGetExclusiveMethodInfo
ResolveGestureDragMethod "getGroup" o = Gtk.Gesture.GestureGetGroupMethodInfo
ResolveGestureDragMethod "getLastEvent" o = Gtk.Gesture.GestureGetLastEventMethodInfo
ResolveGestureDragMethod "getLastUpdatedSequence" o = Gtk.Gesture.GestureGetLastUpdatedSequenceMethodInfo
ResolveGestureDragMethod "getOffset" o = GestureDragGetOffsetMethodInfo
ResolveGestureDragMethod "getPoint" o = Gtk.Gesture.GestureGetPointMethodInfo
ResolveGestureDragMethod "getPropagationPhase" o = Gtk.EventController.EventControllerGetPropagationPhaseMethodInfo
ResolveGestureDragMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveGestureDragMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveGestureDragMethod "getSequenceState" o = Gtk.Gesture.GestureGetSequenceStateMethodInfo
ResolveGestureDragMethod "getSequences" o = Gtk.Gesture.GestureGetSequencesMethodInfo
ResolveGestureDragMethod "getStartPoint" o = GestureDragGetStartPointMethodInfo
ResolveGestureDragMethod "getTouchOnly" o = Gtk.GestureSingle.GestureSingleGetTouchOnlyMethodInfo
ResolveGestureDragMethod "getWidget" o = Gtk.EventController.EventControllerGetWidgetMethodInfo
ResolveGestureDragMethod "getWindow" o = Gtk.Gesture.GestureGetWindowMethodInfo
ResolveGestureDragMethod "setButton" o = Gtk.GestureSingle.GestureSingleSetButtonMethodInfo
ResolveGestureDragMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveGestureDragMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveGestureDragMethod "setExclusive" o = Gtk.GestureSingle.GestureSingleSetExclusiveMethodInfo
ResolveGestureDragMethod "setPropagationPhase" o = Gtk.EventController.EventControllerSetPropagationPhaseMethodInfo
ResolveGestureDragMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveGestureDragMethod "setSequenceState" o = Gtk.Gesture.GestureSetSequenceStateMethodInfo
ResolveGestureDragMethod "setState" o = Gtk.Gesture.GestureSetStateMethodInfo
ResolveGestureDragMethod "setTouchOnly" o = Gtk.GestureSingle.GestureSingleSetTouchOnlyMethodInfo
ResolveGestureDragMethod "setWindow" o = Gtk.Gesture.GestureSetWindowMethodInfo
ResolveGestureDragMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveGestureDragMethod t GestureDrag, O.MethodInfo info GestureDrag p) => OL.IsLabel t (GestureDrag -> 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
type GestureDragDragBeginCallback =
Double
-> Double
-> IO ()
noGestureDragDragBeginCallback :: Maybe GestureDragDragBeginCallback
noGestureDragDragBeginCallback = Nothing
type C_GestureDragDragBeginCallback =
Ptr () ->
CDouble ->
CDouble ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_GestureDragDragBeginCallback :: C_GestureDragDragBeginCallback -> IO (FunPtr C_GestureDragDragBeginCallback)
genClosure_GestureDragDragBegin :: MonadIO m => GestureDragDragBeginCallback -> m (GClosure C_GestureDragDragBeginCallback)
genClosure_GestureDragDragBegin cb = liftIO $ do
let cb' = wrap_GestureDragDragBeginCallback cb
mk_GestureDragDragBeginCallback cb' >>= B.GClosure.newGClosure
wrap_GestureDragDragBeginCallback ::
GestureDragDragBeginCallback ->
C_GestureDragDragBeginCallback
wrap_GestureDragDragBeginCallback _cb _ startX startY _ = do
let startX' = realToFrac startX
let startY' = realToFrac startY
_cb startX' startY'
onGestureDragDragBegin :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragBeginCallback -> m SignalHandlerId
onGestureDragDragBegin obj cb = liftIO $ do
let cb' = wrap_GestureDragDragBeginCallback cb
cb'' <- mk_GestureDragDragBeginCallback cb'
connectSignalFunPtr obj "drag-begin" cb'' SignalConnectBefore
afterGestureDragDragBegin :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragBeginCallback -> m SignalHandlerId
afterGestureDragDragBegin obj cb = liftIO $ do
let cb' = wrap_GestureDragDragBeginCallback cb
cb'' <- mk_GestureDragDragBeginCallback cb'
connectSignalFunPtr obj "drag-begin" cb'' SignalConnectAfter
type GestureDragDragEndCallback =
Double
-> Double
-> IO ()
noGestureDragDragEndCallback :: Maybe GestureDragDragEndCallback
noGestureDragDragEndCallback = Nothing
type C_GestureDragDragEndCallback =
Ptr () ->
CDouble ->
CDouble ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_GestureDragDragEndCallback :: C_GestureDragDragEndCallback -> IO (FunPtr C_GestureDragDragEndCallback)
genClosure_GestureDragDragEnd :: MonadIO m => GestureDragDragEndCallback -> m (GClosure C_GestureDragDragEndCallback)
genClosure_GestureDragDragEnd cb = liftIO $ do
let cb' = wrap_GestureDragDragEndCallback cb
mk_GestureDragDragEndCallback cb' >>= B.GClosure.newGClosure
wrap_GestureDragDragEndCallback ::
GestureDragDragEndCallback ->
C_GestureDragDragEndCallback
wrap_GestureDragDragEndCallback _cb _ offsetX offsetY _ = do
let offsetX' = realToFrac offsetX
let offsetY' = realToFrac offsetY
_cb offsetX' offsetY'
onGestureDragDragEnd :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragEndCallback -> m SignalHandlerId
onGestureDragDragEnd obj cb = liftIO $ do
let cb' = wrap_GestureDragDragEndCallback cb
cb'' <- mk_GestureDragDragEndCallback cb'
connectSignalFunPtr obj "drag-end" cb'' SignalConnectBefore
afterGestureDragDragEnd :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragEndCallback -> m SignalHandlerId
afterGestureDragDragEnd obj cb = liftIO $ do
let cb' = wrap_GestureDragDragEndCallback cb
cb'' <- mk_GestureDragDragEndCallback cb'
connectSignalFunPtr obj "drag-end" cb'' SignalConnectAfter
type GestureDragDragUpdateCallback =
Double
-> Double
-> IO ()
noGestureDragDragUpdateCallback :: Maybe GestureDragDragUpdateCallback
noGestureDragDragUpdateCallback = Nothing
type C_GestureDragDragUpdateCallback =
Ptr () ->
CDouble ->
CDouble ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_GestureDragDragUpdateCallback :: C_GestureDragDragUpdateCallback -> IO (FunPtr C_GestureDragDragUpdateCallback)
genClosure_GestureDragDragUpdate :: MonadIO m => GestureDragDragUpdateCallback -> m (GClosure C_GestureDragDragUpdateCallback)
genClosure_GestureDragDragUpdate cb = liftIO $ do
let cb' = wrap_GestureDragDragUpdateCallback cb
mk_GestureDragDragUpdateCallback cb' >>= B.GClosure.newGClosure
wrap_GestureDragDragUpdateCallback ::
GestureDragDragUpdateCallback ->
C_GestureDragDragUpdateCallback
wrap_GestureDragDragUpdateCallback _cb _ offsetX offsetY _ = do
let offsetX' = realToFrac offsetX
let offsetY' = realToFrac offsetY
_cb offsetX' offsetY'
onGestureDragDragUpdate :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragUpdateCallback -> m SignalHandlerId
onGestureDragDragUpdate obj cb = liftIO $ do
let cb' = wrap_GestureDragDragUpdateCallback cb
cb'' <- mk_GestureDragDragUpdateCallback cb'
connectSignalFunPtr obj "drag-update" cb'' SignalConnectBefore
afterGestureDragDragUpdate :: (IsGestureDrag a, MonadIO m) => a -> GestureDragDragUpdateCallback -> m SignalHandlerId
afterGestureDragDragUpdate obj cb = liftIO $ do
let cb' = wrap_GestureDragDragUpdateCallback cb
cb'' <- mk_GestureDragDragUpdateCallback cb'
connectSignalFunPtr obj "drag-update" cb'' SignalConnectAfter
#if ENABLE_OVERLOADING
instance O.HasAttributeList GestureDrag
type instance O.AttributeList GestureDrag = GestureDragAttributeList
type GestureDragAttributeList = ('[ '("button", Gtk.GestureSingle.GestureSingleButtonPropertyInfo), '("exclusive", Gtk.GestureSingle.GestureSingleExclusivePropertyInfo), '("nPoints", Gtk.Gesture.GestureNPointsPropertyInfo), '("propagationPhase", Gtk.EventController.EventControllerPropagationPhasePropertyInfo), '("touchOnly", Gtk.GestureSingle.GestureSingleTouchOnlyPropertyInfo), '("widget", Gtk.EventController.EventControllerWidgetPropertyInfo), '("window", Gtk.Gesture.GestureWindowPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
data GestureDragDragBeginSignalInfo
instance SignalInfo GestureDragDragBeginSignalInfo where
type HaskellCallbackType GestureDragDragBeginSignalInfo = GestureDragDragBeginCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_GestureDragDragBeginCallback cb
cb'' <- mk_GestureDragDragBeginCallback cb'
connectSignalFunPtr obj "drag-begin" cb'' connectMode
data GestureDragDragEndSignalInfo
instance SignalInfo GestureDragDragEndSignalInfo where
type HaskellCallbackType GestureDragDragEndSignalInfo = GestureDragDragEndCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_GestureDragDragEndCallback cb
cb'' <- mk_GestureDragDragEndCallback cb'
connectSignalFunPtr obj "drag-end" cb'' connectMode
data GestureDragDragUpdateSignalInfo
instance SignalInfo GestureDragDragUpdateSignalInfo where
type HaskellCallbackType GestureDragDragUpdateSignalInfo = GestureDragDragUpdateCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_GestureDragDragUpdateCallback cb
cb'' <- mk_GestureDragDragUpdateCallback cb'
connectSignalFunPtr obj "drag-update" cb'' connectMode
type instance O.SignalList GestureDrag = GestureDragSignalList
type GestureDragSignalList = ('[ '("begin", Gtk.Gesture.GestureBeginSignalInfo), '("cancel", Gtk.Gesture.GestureCancelSignalInfo), '("dragBegin", GestureDragDragBeginSignalInfo), '("dragEnd", GestureDragDragEndSignalInfo), '("dragUpdate", GestureDragDragUpdateSignalInfo), '("end", Gtk.Gesture.GestureEndSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("sequenceStateChanged", Gtk.Gesture.GestureSequenceStateChangedSignalInfo), '("update", Gtk.Gesture.GestureUpdateSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_gesture_drag_new" gtk_gesture_drag_new ::
Ptr Gtk.Widget.Widget ->
IO (Ptr GestureDrag)
gestureDragNew ::
(B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
a
-> m GestureDrag
gestureDragNew widget = liftIO $ do
widget' <- unsafeManagedPtrCastPtr widget
result <- gtk_gesture_drag_new widget'
checkUnexpectedReturnNULL "gestureDragNew" result
result' <- (wrapObject GestureDrag) result
touchManagedPtr widget
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "gtk_gesture_drag_get_offset" gtk_gesture_drag_get_offset ::
Ptr GestureDrag ->
Ptr CDouble ->
Ptr CDouble ->
IO CInt
gestureDragGetOffset ::
(B.CallStack.HasCallStack, MonadIO m, IsGestureDrag a) =>
a
-> m ((Bool, Double, Double))
gestureDragGetOffset gesture = liftIO $ do
gesture' <- unsafeManagedPtrCastPtr gesture
x <- allocMem :: IO (Ptr CDouble)
y <- allocMem :: IO (Ptr CDouble)
result <- gtk_gesture_drag_get_offset gesture' x y
let result' = (/= 0) result
x' <- peek x
let x'' = realToFrac x'
y' <- peek y
let y'' = realToFrac y'
touchManagedPtr gesture
freeMem x
freeMem y
return (result', x'', y'')
#if ENABLE_OVERLOADING
data GestureDragGetOffsetMethodInfo
instance (signature ~ (m ((Bool, Double, Double))), MonadIO m, IsGestureDrag a) => O.MethodInfo GestureDragGetOffsetMethodInfo a signature where
overloadedMethod _ = gestureDragGetOffset
#endif
foreign import ccall "gtk_gesture_drag_get_start_point" gtk_gesture_drag_get_start_point ::
Ptr GestureDrag ->
Ptr CDouble ->
Ptr CDouble ->
IO CInt
gestureDragGetStartPoint ::
(B.CallStack.HasCallStack, MonadIO m, IsGestureDrag a) =>
a
-> m ((Bool, Double, Double))
gestureDragGetStartPoint gesture = liftIO $ do
gesture' <- unsafeManagedPtrCastPtr gesture
x <- allocMem :: IO (Ptr CDouble)
y <- allocMem :: IO (Ptr CDouble)
result <- gtk_gesture_drag_get_start_point gesture' x y
let result' = (/= 0) result
x' <- peek x
let x'' = realToFrac x'
y' <- peek y
let y'' = realToFrac y'
touchManagedPtr gesture
freeMem x
freeMem y
return (result', x'', y'')
#if ENABLE_OVERLOADING
data GestureDragGetStartPointMethodInfo
instance (signature ~ (m ((Bool, Double, Double))), MonadIO m, IsGestureDrag a) => O.MethodInfo GestureDragGetStartPointMethodInfo a signature where
overloadedMethod _ = gestureDragGetStartPoint
#endif