module GI.WebKit2.Objects.ColorChooserRequest
(
ColorChooserRequest(..) ,
ColorChooserRequestK ,
toColorChooserRequest ,
noColorChooserRequest ,
colorChooserRequestCancel ,
colorChooserRequestFinish ,
colorChooserRequestGetElementRectangle ,
colorChooserRequestGetRgba ,
colorChooserRequestSetRgba ,
ColorChooserRequestRgbaPropertyInfo ,
constructColorChooserRequestRgba ,
getColorChooserRequestRgba ,
setColorChooserRequestRgba ,
ColorChooserRequestFinishedCallback ,
ColorChooserRequestFinishedCallbackC ,
ColorChooserRequestFinishedSignalInfo ,
afterColorChooserRequestFinished ,
colorChooserRequestFinishedCallbackWrapper,
colorChooserRequestFinishedClosure ,
mkColorChooserRequestFinishedCallback ,
noColorChooserRequestFinishedCallback ,
onColorChooserRequestFinished ,
) 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.WebKit2.Types
import GI.WebKit2.Callbacks
import qualified GI.GObject as GObject
import qualified GI.Gdk as Gdk
newtype ColorChooserRequest = ColorChooserRequest (ForeignPtr ColorChooserRequest)
foreign import ccall "webkit_color_chooser_request_get_type"
c_webkit_color_chooser_request_get_type :: IO GType
type instance ParentTypes ColorChooserRequest = ColorChooserRequestParentTypes
type ColorChooserRequestParentTypes = '[GObject.Object]
instance GObject ColorChooserRequest where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_webkit_color_chooser_request_get_type
class GObject o => ColorChooserRequestK o
instance (GObject o, IsDescendantOf ColorChooserRequest o) => ColorChooserRequestK o
toColorChooserRequest :: ColorChooserRequestK o => o -> IO ColorChooserRequest
toColorChooserRequest = unsafeCastTo ColorChooserRequest
noColorChooserRequest :: Maybe ColorChooserRequest
noColorChooserRequest = Nothing
type ColorChooserRequestFinishedCallback =
IO ()
noColorChooserRequestFinishedCallback :: Maybe ColorChooserRequestFinishedCallback
noColorChooserRequestFinishedCallback = Nothing
type ColorChooserRequestFinishedCallbackC =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mkColorChooserRequestFinishedCallback :: ColorChooserRequestFinishedCallbackC -> IO (FunPtr ColorChooserRequestFinishedCallbackC)
colorChooserRequestFinishedClosure :: ColorChooserRequestFinishedCallback -> IO Closure
colorChooserRequestFinishedClosure cb = newCClosure =<< mkColorChooserRequestFinishedCallback wrapped
where wrapped = colorChooserRequestFinishedCallbackWrapper cb
colorChooserRequestFinishedCallbackWrapper ::
ColorChooserRequestFinishedCallback ->
Ptr () ->
Ptr () ->
IO ()
colorChooserRequestFinishedCallbackWrapper _cb _ _ = do
_cb
onColorChooserRequestFinished :: (GObject a, MonadIO m) => a -> ColorChooserRequestFinishedCallback -> m SignalHandlerId
onColorChooserRequestFinished obj cb = liftIO $ connectColorChooserRequestFinished obj cb SignalConnectBefore
afterColorChooserRequestFinished :: (GObject a, MonadIO m) => a -> ColorChooserRequestFinishedCallback -> m SignalHandlerId
afterColorChooserRequestFinished obj cb = connectColorChooserRequestFinished obj cb SignalConnectAfter
connectColorChooserRequestFinished :: (GObject a, MonadIO m) =>
a -> ColorChooserRequestFinishedCallback -> SignalConnectMode -> m SignalHandlerId
connectColorChooserRequestFinished obj cb after = liftIO $ do
cb' <- mkColorChooserRequestFinishedCallback (colorChooserRequestFinishedCallbackWrapper cb)
connectSignalFunPtr obj "finished" cb' after
getColorChooserRequestRgba :: (MonadIO m, ColorChooserRequestK o) => o -> m Gdk.RGBA
getColorChooserRequestRgba obj = liftIO $ getObjectPropertyBoxed obj "rgba" Gdk.RGBA
setColorChooserRequestRgba :: (MonadIO m, ColorChooserRequestK o) => o -> Gdk.RGBA -> m ()
setColorChooserRequestRgba obj val = liftIO $ setObjectPropertyBoxed obj "rgba" val
constructColorChooserRequestRgba :: Gdk.RGBA -> IO ([Char], GValue)
constructColorChooserRequestRgba val = constructObjectPropertyBoxed "rgba" val
data ColorChooserRequestRgbaPropertyInfo
instance AttrInfo ColorChooserRequestRgbaPropertyInfo where
type AttrAllowedOps ColorChooserRequestRgbaPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ColorChooserRequestRgbaPropertyInfo = (~) Gdk.RGBA
type AttrBaseTypeConstraint ColorChooserRequestRgbaPropertyInfo = ColorChooserRequestK
type AttrGetType ColorChooserRequestRgbaPropertyInfo = Gdk.RGBA
type AttrLabel ColorChooserRequestRgbaPropertyInfo = "ColorChooserRequest::rgba"
attrGet _ = getColorChooserRequestRgba
attrSet _ = setColorChooserRequestRgba
attrConstruct _ = constructColorChooserRequestRgba
type instance AttributeList ColorChooserRequest = ColorChooserRequestAttributeList
type ColorChooserRequestAttributeList = ('[ '("rgba", ColorChooserRequestRgbaPropertyInfo)] :: [(Symbol, *)])
data ColorChooserRequestFinishedSignalInfo
instance SignalInfo ColorChooserRequestFinishedSignalInfo where
type HaskellCallbackType ColorChooserRequestFinishedSignalInfo = ColorChooserRequestFinishedCallback
connectSignal _ = connectColorChooserRequestFinished
type instance SignalList ColorChooserRequest = ColorChooserRequestSignalList
type ColorChooserRequestSignalList = ('[ '("finished", ColorChooserRequestFinishedSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "webkit_color_chooser_request_cancel" webkit_color_chooser_request_cancel ::
Ptr ColorChooserRequest ->
IO ()
colorChooserRequestCancel ::
(MonadIO m, ColorChooserRequestK a) =>
a ->
m ()
colorChooserRequestCancel _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
webkit_color_chooser_request_cancel _obj'
touchManagedPtr _obj
return ()
foreign import ccall "webkit_color_chooser_request_finish" webkit_color_chooser_request_finish ::
Ptr ColorChooserRequest ->
IO ()
colorChooserRequestFinish ::
(MonadIO m, ColorChooserRequestK a) =>
a ->
m ()
colorChooserRequestFinish _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
webkit_color_chooser_request_finish _obj'
touchManagedPtr _obj
return ()
foreign import ccall "webkit_color_chooser_request_get_element_rectangle" webkit_color_chooser_request_get_element_rectangle ::
Ptr ColorChooserRequest ->
Ptr Gdk.Rectangle ->
IO ()
colorChooserRequestGetElementRectangle ::
(MonadIO m, ColorChooserRequestK a) =>
a ->
m (Gdk.Rectangle)
colorChooserRequestGetElementRectangle _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
rect <- callocBoxedBytes 16 :: IO (Ptr Gdk.Rectangle)
webkit_color_chooser_request_get_element_rectangle _obj' rect
rect' <- (wrapBoxed Gdk.Rectangle) rect
touchManagedPtr _obj
return rect'
foreign import ccall "webkit_color_chooser_request_get_rgba" webkit_color_chooser_request_get_rgba ::
Ptr ColorChooserRequest ->
Ptr Gdk.RGBA ->
IO ()
colorChooserRequestGetRgba ::
(MonadIO m, ColorChooserRequestK a) =>
a ->
m (Gdk.RGBA)
colorChooserRequestGetRgba _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
rgba <- callocBoxedBytes 32 :: IO (Ptr Gdk.RGBA)
webkit_color_chooser_request_get_rgba _obj' rgba
rgba' <- (wrapBoxed Gdk.RGBA) rgba
touchManagedPtr _obj
return rgba'
foreign import ccall "webkit_color_chooser_request_set_rgba" webkit_color_chooser_request_set_rgba ::
Ptr ColorChooserRequest ->
Ptr Gdk.RGBA ->
IO ()
colorChooserRequestSetRgba ::
(MonadIO m, ColorChooserRequestK a) =>
a ->
Gdk.RGBA ->
m ()
colorChooserRequestSetRgba _obj rgba = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let rgba' = unsafeManagedPtrGetPtr rgba
webkit_color_chooser_request_set_rgba _obj' rgba'
touchManagedPtr _obj
touchManagedPtr rgba
return ()