{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.Gtk.Objects.Arrow
    ( 

-- * Exported types
    Arrow(..)                               ,
    ArrowK                                  ,
    toArrow                                 ,
    noArrow                                 ,


 -- * Methods
-- ** arrowNew
    arrowNew                                ,


-- ** arrowSet
    arrowSet                                ,




 -- * Properties
-- ** ArrowType
    ArrowArrowTypePropertyInfo              ,
    constructArrowArrowType                 ,
    getArrowArrowType                       ,
    setArrowArrowType                       ,


-- ** ShadowType
    ArrowShadowTypePropertyInfo             ,
    constructArrowShadowType                ,
    getArrowShadowType                      ,
    setArrowShadowType                      ,




    ) 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.Atk as Atk
import qualified GI.GObject as GObject

newtype Arrow = Arrow (ForeignPtr Arrow)
foreign import ccall "gtk_arrow_get_type"
    c_gtk_arrow_get_type :: IO GType

type instance ParentTypes Arrow = ArrowParentTypes
type ArrowParentTypes = '[Misc, Widget, GObject.Object, Atk.ImplementorIface, Buildable]

instance GObject Arrow where
    gobjectIsInitiallyUnowned _ = True
    gobjectType _ = c_gtk_arrow_get_type
    

class GObject o => ArrowK o
instance (GObject o, IsDescendantOf Arrow o) => ArrowK o

toArrow :: ArrowK o => o -> IO Arrow
toArrow = unsafeCastTo Arrow

noArrow :: Maybe Arrow
noArrow = Nothing

-- VVV Prop "arrow-type"
   -- Type: TInterface "Gtk" "ArrowType"
   -- Flags: [PropertyReadable,PropertyWritable]

getArrowArrowType :: (MonadIO m, ArrowK o) => o -> m ArrowType
getArrowArrowType obj = liftIO $ getObjectPropertyEnum obj "arrow-type"

setArrowArrowType :: (MonadIO m, ArrowK o) => o -> ArrowType -> m ()
setArrowArrowType obj val = liftIO $ setObjectPropertyEnum obj "arrow-type" val

constructArrowArrowType :: ArrowType -> IO ([Char], GValue)
constructArrowArrowType val = constructObjectPropertyEnum "arrow-type" val

data ArrowArrowTypePropertyInfo
instance AttrInfo ArrowArrowTypePropertyInfo where
    type AttrAllowedOps ArrowArrowTypePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ArrowArrowTypePropertyInfo = (~) ArrowType
    type AttrBaseTypeConstraint ArrowArrowTypePropertyInfo = ArrowK
    type AttrGetType ArrowArrowTypePropertyInfo = ArrowType
    type AttrLabel ArrowArrowTypePropertyInfo = "Arrow::arrow-type"
    attrGet _ = getArrowArrowType
    attrSet _ = setArrowArrowType
    attrConstruct _ = constructArrowArrowType

-- VVV Prop "shadow-type"
   -- Type: TInterface "Gtk" "ShadowType"
   -- Flags: [PropertyReadable,PropertyWritable]

getArrowShadowType :: (MonadIO m, ArrowK o) => o -> m ShadowType
getArrowShadowType obj = liftIO $ getObjectPropertyEnum obj "shadow-type"

setArrowShadowType :: (MonadIO m, ArrowK o) => o -> ShadowType -> m ()
setArrowShadowType obj val = liftIO $ setObjectPropertyEnum obj "shadow-type" val

constructArrowShadowType :: ShadowType -> IO ([Char], GValue)
constructArrowShadowType val = constructObjectPropertyEnum "shadow-type" val

data ArrowShadowTypePropertyInfo
instance AttrInfo ArrowShadowTypePropertyInfo where
    type AttrAllowedOps ArrowShadowTypePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ArrowShadowTypePropertyInfo = (~) ShadowType
    type AttrBaseTypeConstraint ArrowShadowTypePropertyInfo = ArrowK
    type AttrGetType ArrowShadowTypePropertyInfo = ShadowType
    type AttrLabel ArrowShadowTypePropertyInfo = "Arrow::shadow-type"
    attrGet _ = getArrowShadowType
    attrSet _ = setArrowShadowType
    attrConstruct _ = constructArrowShadowType

type instance AttributeList Arrow = ArrowAttributeList
type ArrowAttributeList = ('[ '("app-paintable", WidgetAppPaintablePropertyInfo), '("arrow-type", ArrowArrowTypePropertyInfo), '("can-default", WidgetCanDefaultPropertyInfo), '("can-focus", WidgetCanFocusPropertyInfo), '("composite-child", WidgetCompositeChildPropertyInfo), '("double-buffered", WidgetDoubleBufferedPropertyInfo), '("events", WidgetEventsPropertyInfo), '("expand", WidgetExpandPropertyInfo), '("halign", WidgetHalignPropertyInfo), '("has-default", WidgetHasDefaultPropertyInfo), '("has-focus", WidgetHasFocusPropertyInfo), '("has-tooltip", WidgetHasTooltipPropertyInfo), '("height-request", WidgetHeightRequestPropertyInfo), '("hexpand", WidgetHexpandPropertyInfo), '("hexpand-set", WidgetHexpandSetPropertyInfo), '("is-focus", WidgetIsFocusPropertyInfo), '("margin", WidgetMarginPropertyInfo), '("margin-bottom", WidgetMarginBottomPropertyInfo), '("margin-end", WidgetMarginEndPropertyInfo), '("margin-left", WidgetMarginLeftPropertyInfo), '("margin-right", WidgetMarginRightPropertyInfo), '("margin-start", WidgetMarginStartPropertyInfo), '("margin-top", WidgetMarginTopPropertyInfo), '("name", WidgetNamePropertyInfo), '("no-show-all", WidgetNoShowAllPropertyInfo), '("opacity", WidgetOpacityPropertyInfo), '("parent", WidgetParentPropertyInfo), '("receives-default", WidgetReceivesDefaultPropertyInfo), '("scale-factor", WidgetScaleFactorPropertyInfo), '("sensitive", WidgetSensitivePropertyInfo), '("shadow-type", ArrowShadowTypePropertyInfo), '("style", WidgetStylePropertyInfo), '("tooltip-markup", WidgetTooltipMarkupPropertyInfo), '("tooltip-text", WidgetTooltipTextPropertyInfo), '("valign", WidgetValignPropertyInfo), '("vexpand", WidgetVexpandPropertyInfo), '("vexpand-set", WidgetVexpandSetPropertyInfo), '("visible", WidgetVisiblePropertyInfo), '("width-request", WidgetWidthRequestPropertyInfo), '("window", WidgetWindowPropertyInfo), '("xalign", MiscXalignPropertyInfo), '("xpad", MiscXpadPropertyInfo), '("yalign", MiscYalignPropertyInfo), '("ypad", MiscYpadPropertyInfo)] :: [(Symbol, *)])

type instance SignalList Arrow = ArrowSignalList
type ArrowSignalList = ('[ '("accel-closures-changed", WidgetAccelClosuresChangedSignalInfo), '("button-press-event", WidgetButtonPressEventSignalInfo), '("button-release-event", WidgetButtonReleaseEventSignalInfo), '("can-activate-accel", WidgetCanActivateAccelSignalInfo), '("child-notify", WidgetChildNotifySignalInfo), '("composited-changed", WidgetCompositedChangedSignalInfo), '("configure-event", WidgetConfigureEventSignalInfo), '("damage-event", WidgetDamageEventSignalInfo), '("delete-event", WidgetDeleteEventSignalInfo), '("destroy", WidgetDestroySignalInfo), '("destroy-event", WidgetDestroyEventSignalInfo), '("direction-changed", WidgetDirectionChangedSignalInfo), '("drag-begin", WidgetDragBeginSignalInfo), '("drag-data-delete", WidgetDragDataDeleteSignalInfo), '("drag-data-get", WidgetDragDataGetSignalInfo), '("drag-data-received", WidgetDragDataReceivedSignalInfo), '("drag-drop", WidgetDragDropSignalInfo), '("drag-end", WidgetDragEndSignalInfo), '("drag-failed", WidgetDragFailedSignalInfo), '("drag-leave", WidgetDragLeaveSignalInfo), '("drag-motion", WidgetDragMotionSignalInfo), '("draw", WidgetDrawSignalInfo), '("enter-notify-event", WidgetEnterNotifyEventSignalInfo), '("event", WidgetEventSignalInfo), '("event-after", WidgetEventAfterSignalInfo), '("focus", WidgetFocusSignalInfo), '("focus-in-event", WidgetFocusInEventSignalInfo), '("focus-out-event", WidgetFocusOutEventSignalInfo), '("grab-broken-event", WidgetGrabBrokenEventSignalInfo), '("grab-focus", WidgetGrabFocusSignalInfo), '("grab-notify", WidgetGrabNotifySignalInfo), '("hide", WidgetHideSignalInfo), '("hierarchy-changed", WidgetHierarchyChangedSignalInfo), '("key-press-event", WidgetKeyPressEventSignalInfo), '("key-release-event", WidgetKeyReleaseEventSignalInfo), '("keynav-failed", WidgetKeynavFailedSignalInfo), '("leave-notify-event", WidgetLeaveNotifyEventSignalInfo), '("map", WidgetMapSignalInfo), '("map-event", WidgetMapEventSignalInfo), '("mnemonic-activate", WidgetMnemonicActivateSignalInfo), '("motion-notify-event", WidgetMotionNotifyEventSignalInfo), '("move-focus", WidgetMoveFocusSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("parent-set", WidgetParentSetSignalInfo), '("popup-menu", WidgetPopupMenuSignalInfo), '("property-notify-event", WidgetPropertyNotifyEventSignalInfo), '("proximity-in-event", WidgetProximityInEventSignalInfo), '("proximity-out-event", WidgetProximityOutEventSignalInfo), '("query-tooltip", WidgetQueryTooltipSignalInfo), '("realize", WidgetRealizeSignalInfo), '("screen-changed", WidgetScreenChangedSignalInfo), '("scroll-event", WidgetScrollEventSignalInfo), '("selection-clear-event", WidgetSelectionClearEventSignalInfo), '("selection-get", WidgetSelectionGetSignalInfo), '("selection-notify-event", WidgetSelectionNotifyEventSignalInfo), '("selection-received", WidgetSelectionReceivedSignalInfo), '("selection-request-event", WidgetSelectionRequestEventSignalInfo), '("show", WidgetShowSignalInfo), '("show-help", WidgetShowHelpSignalInfo), '("size-allocate", WidgetSizeAllocateSignalInfo), '("state-changed", WidgetStateChangedSignalInfo), '("state-flags-changed", WidgetStateFlagsChangedSignalInfo), '("style-set", WidgetStyleSetSignalInfo), '("style-updated", WidgetStyleUpdatedSignalInfo), '("touch-event", WidgetTouchEventSignalInfo), '("unmap", WidgetUnmapSignalInfo), '("unmap-event", WidgetUnmapEventSignalInfo), '("unrealize", WidgetUnrealizeSignalInfo), '("visibility-notify-event", WidgetVisibilityNotifyEventSignalInfo), '("window-state-event", WidgetWindowStateEventSignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method Arrow::new
-- method type : Constructor
-- Args : [Arg {argName = "arrow_type", argType = TInterface "Gtk" "ArrowType", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "shadow_type", argType = TInterface "Gtk" "ShadowType", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "arrow_type", argType = TInterface "Gtk" "ArrowType", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "shadow_type", argType = TInterface "Gtk" "ShadowType", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Gtk" "Arrow"
-- throws : False
-- Skip return : False

foreign import ccall "gtk_arrow_new" gtk_arrow_new :: 
    CUInt ->                                -- arrow_type : TInterface "Gtk" "ArrowType"
    CUInt ->                                -- shadow_type : TInterface "Gtk" "ShadowType"
    IO (Ptr Arrow)

{-# DEPRECATED arrowNew ["(Since version 3.14)","Use a #GtkImage with a suitable icon."]#-}
arrowNew ::
    (MonadIO m) =>
    ArrowType ->                            -- arrow_type
    ShadowType ->                           -- shadow_type
    m Arrow
arrowNew arrow_type shadow_type = liftIO $ do
    let arrow_type' = (fromIntegral . fromEnum) arrow_type
    let shadow_type' = (fromIntegral . fromEnum) shadow_type
    result <- gtk_arrow_new arrow_type' shadow_type'
    checkUnexpectedReturnNULL "gtk_arrow_new" result
    result' <- (newObject Arrow) result
    return result'

-- method Arrow::set
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Arrow", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "arrow_type", argType = TInterface "Gtk" "ArrowType", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "shadow_type", argType = TInterface "Gtk" "ShadowType", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Arrow", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "arrow_type", argType = TInterface "Gtk" "ArrowType", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "shadow_type", argType = TInterface "Gtk" "ShadowType", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_arrow_set" gtk_arrow_set :: 
    Ptr Arrow ->                            -- _obj : TInterface "Gtk" "Arrow"
    CUInt ->                                -- arrow_type : TInterface "Gtk" "ArrowType"
    CUInt ->                                -- shadow_type : TInterface "Gtk" "ShadowType"
    IO ()

{-# DEPRECATED arrowSet ["(Since version 3.14)","Use a #GtkImage with a suitable icon."]#-}
arrowSet ::
    (MonadIO m, ArrowK a) =>
    a ->                                    -- _obj
    ArrowType ->                            -- arrow_type
    ShadowType ->                           -- shadow_type
    m ()
arrowSet _obj arrow_type shadow_type = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let arrow_type' = (fromIntegral . fromEnum) arrow_type
    let shadow_type' = (fromIntegral . fromEnum) shadow_type
    gtk_arrow_set _obj' arrow_type' shadow_type'
    touchManagedPtr _obj
    return ()