module GI.Gtk.Objects.GestureSingle
(
GestureSingle(..) ,
GestureSingleK ,
toGestureSingle ,
noGestureSingle ,
gestureSingleGetButton ,
gestureSingleGetCurrentButton ,
gestureSingleGetCurrentSequence ,
gestureSingleGetExclusive ,
gestureSingleGetTouchOnly ,
gestureSingleSetButton ,
gestureSingleSetExclusive ,
gestureSingleSetTouchOnly ,
GestureSingleButtonPropertyInfo ,
constructGestureSingleButton ,
getGestureSingleButton ,
setGestureSingleButton ,
GestureSingleExclusivePropertyInfo ,
constructGestureSingleExclusive ,
getGestureSingleExclusive ,
setGestureSingleExclusive ,
GestureSingleTouchOnlyPropertyInfo ,
constructGestureSingleTouchOnly ,
getGestureSingleTouchOnly ,
setGestureSingleTouchOnly ,
) 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
newtype GestureSingle = GestureSingle (ForeignPtr GestureSingle)
foreign import ccall "gtk_gesture_single_get_type"
c_gtk_gesture_single_get_type :: IO GType
type instance ParentTypes GestureSingle = GestureSingleParentTypes
type GestureSingleParentTypes = '[Gesture, EventController, GObject.Object]
instance GObject GestureSingle where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_gtk_gesture_single_get_type
class GObject o => GestureSingleK o
instance (GObject o, IsDescendantOf GestureSingle o) => GestureSingleK o
toGestureSingle :: GestureSingleK o => o -> IO GestureSingle
toGestureSingle = unsafeCastTo GestureSingle
noGestureSingle :: Maybe GestureSingle
noGestureSingle = Nothing
getGestureSingleButton :: (MonadIO m, GestureSingleK o) => o -> m Word32
getGestureSingleButton obj = liftIO $ getObjectPropertyCUInt obj "button"
setGestureSingleButton :: (MonadIO m, GestureSingleK o) => o -> Word32 -> m ()
setGestureSingleButton obj val = liftIO $ setObjectPropertyCUInt obj "button" val
constructGestureSingleButton :: Word32 -> IO ([Char], GValue)
constructGestureSingleButton val = constructObjectPropertyCUInt "button" val
data GestureSingleButtonPropertyInfo
instance AttrInfo GestureSingleButtonPropertyInfo where
type AttrAllowedOps GestureSingleButtonPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint GestureSingleButtonPropertyInfo = (~) Word32
type AttrBaseTypeConstraint GestureSingleButtonPropertyInfo = GestureSingleK
type AttrGetType GestureSingleButtonPropertyInfo = Word32
type AttrLabel GestureSingleButtonPropertyInfo = "GestureSingle::button"
attrGet _ = getGestureSingleButton
attrSet _ = setGestureSingleButton
attrConstruct _ = constructGestureSingleButton
getGestureSingleExclusive :: (MonadIO m, GestureSingleK o) => o -> m Bool
getGestureSingleExclusive obj = liftIO $ getObjectPropertyBool obj "exclusive"
setGestureSingleExclusive :: (MonadIO m, GestureSingleK o) => o -> Bool -> m ()
setGestureSingleExclusive obj val = liftIO $ setObjectPropertyBool obj "exclusive" val
constructGestureSingleExclusive :: Bool -> IO ([Char], GValue)
constructGestureSingleExclusive val = constructObjectPropertyBool "exclusive" val
data GestureSingleExclusivePropertyInfo
instance AttrInfo GestureSingleExclusivePropertyInfo where
type AttrAllowedOps GestureSingleExclusivePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint GestureSingleExclusivePropertyInfo = (~) Bool
type AttrBaseTypeConstraint GestureSingleExclusivePropertyInfo = GestureSingleK
type AttrGetType GestureSingleExclusivePropertyInfo = Bool
type AttrLabel GestureSingleExclusivePropertyInfo = "GestureSingle::exclusive"
attrGet _ = getGestureSingleExclusive
attrSet _ = setGestureSingleExclusive
attrConstruct _ = constructGestureSingleExclusive
getGestureSingleTouchOnly :: (MonadIO m, GestureSingleK o) => o -> m Bool
getGestureSingleTouchOnly obj = liftIO $ getObjectPropertyBool obj "touch-only"
setGestureSingleTouchOnly :: (MonadIO m, GestureSingleK o) => o -> Bool -> m ()
setGestureSingleTouchOnly obj val = liftIO $ setObjectPropertyBool obj "touch-only" val
constructGestureSingleTouchOnly :: Bool -> IO ([Char], GValue)
constructGestureSingleTouchOnly val = constructObjectPropertyBool "touch-only" val
data GestureSingleTouchOnlyPropertyInfo
instance AttrInfo GestureSingleTouchOnlyPropertyInfo where
type AttrAllowedOps GestureSingleTouchOnlyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint GestureSingleTouchOnlyPropertyInfo = (~) Bool
type AttrBaseTypeConstraint GestureSingleTouchOnlyPropertyInfo = GestureSingleK
type AttrGetType GestureSingleTouchOnlyPropertyInfo = Bool
type AttrLabel GestureSingleTouchOnlyPropertyInfo = "GestureSingle::touch-only"
attrGet _ = getGestureSingleTouchOnly
attrSet _ = setGestureSingleTouchOnly
attrConstruct _ = constructGestureSingleTouchOnly
type instance AttributeList GestureSingle = GestureSingleAttributeList
type GestureSingleAttributeList = ('[ '("button", GestureSingleButtonPropertyInfo), '("exclusive", GestureSingleExclusivePropertyInfo), '("n-points", GestureNPointsPropertyInfo), '("propagation-phase", EventControllerPropagationPhasePropertyInfo), '("touch-only", GestureSingleTouchOnlyPropertyInfo), '("widget", EventControllerWidgetPropertyInfo), '("window", GestureWindowPropertyInfo)] :: [(Symbol, *)])
type instance SignalList GestureSingle = GestureSingleSignalList
type GestureSingleSignalList = ('[ '("begin", GestureBeginSignalInfo), '("cancel", GestureCancelSignalInfo), '("end", GestureEndSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("sequence-state-changed", GestureSequenceStateChangedSignalInfo), '("update", GestureUpdateSignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "gtk_gesture_single_get_button" gtk_gesture_single_get_button ::
Ptr GestureSingle ->
IO Word32
gestureSingleGetButton ::
(MonadIO m, GestureSingleK a) =>
a ->
m Word32
gestureSingleGetButton _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_gesture_single_get_button _obj'
touchManagedPtr _obj
return result
foreign import ccall "gtk_gesture_single_get_current_button" gtk_gesture_single_get_current_button ::
Ptr GestureSingle ->
IO Word32
gestureSingleGetCurrentButton ::
(MonadIO m, GestureSingleK a) =>
a ->
m Word32
gestureSingleGetCurrentButton _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_gesture_single_get_current_button _obj'
touchManagedPtr _obj
return result
foreign import ccall "gtk_gesture_single_get_current_sequence" gtk_gesture_single_get_current_sequence ::
Ptr GestureSingle ->
IO (Ptr Gdk.EventSequence)
gestureSingleGetCurrentSequence ::
(MonadIO m, GestureSingleK a) =>
a ->
m Gdk.EventSequence
gestureSingleGetCurrentSequence _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_gesture_single_get_current_sequence _obj'
checkUnexpectedReturnNULL "gtk_gesture_single_get_current_sequence" result
result' <- (wrapBoxed Gdk.EventSequence) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_gesture_single_get_exclusive" gtk_gesture_single_get_exclusive ::
Ptr GestureSingle ->
IO CInt
gestureSingleGetExclusive ::
(MonadIO m, GestureSingleK a) =>
a ->
m Bool
gestureSingleGetExclusive _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_gesture_single_get_exclusive _obj'
let result' = (/= 0) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_gesture_single_get_touch_only" gtk_gesture_single_get_touch_only ::
Ptr GestureSingle ->
IO CInt
gestureSingleGetTouchOnly ::
(MonadIO m, GestureSingleK a) =>
a ->
m Bool
gestureSingleGetTouchOnly _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_gesture_single_get_touch_only _obj'
let result' = (/= 0) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_gesture_single_set_button" gtk_gesture_single_set_button ::
Ptr GestureSingle ->
Word32 ->
IO ()
gestureSingleSetButton ::
(MonadIO m, GestureSingleK a) =>
a ->
Word32 ->
m ()
gestureSingleSetButton _obj button = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
gtk_gesture_single_set_button _obj' button
touchManagedPtr _obj
return ()
foreign import ccall "gtk_gesture_single_set_exclusive" gtk_gesture_single_set_exclusive ::
Ptr GestureSingle ->
CInt ->
IO ()
gestureSingleSetExclusive ::
(MonadIO m, GestureSingleK a) =>
a ->
Bool ->
m ()
gestureSingleSetExclusive _obj exclusive = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let exclusive' = (fromIntegral . fromEnum) exclusive
gtk_gesture_single_set_exclusive _obj' exclusive'
touchManagedPtr _obj
return ()
foreign import ccall "gtk_gesture_single_set_touch_only" gtk_gesture_single_set_touch_only ::
Ptr GestureSingle ->
CInt ->
IO ()
gestureSingleSetTouchOnly ::
(MonadIO m, GestureSingleK a) =>
a ->
Bool ->
m ()
gestureSingleSetTouchOnly _obj touch_only = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let touch_only' = (fromIntegral . fromEnum) touch_only
gtk_gesture_single_set_touch_only _obj' touch_only'
touchManagedPtr _obj
return ()