{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.ToggleAction
(
ToggleAction(..) ,
IsToggleAction ,
toToggleAction ,
noToggleAction ,
#if defined(ENABLE_OVERLOADING)
ResolveToggleActionMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ToggleActionGetActiveMethodInfo ,
#endif
toggleActionGetActive ,
#if defined(ENABLE_OVERLOADING)
ToggleActionGetDrawAsRadioMethodInfo ,
#endif
toggleActionGetDrawAsRadio ,
toggleActionNew ,
#if defined(ENABLE_OVERLOADING)
ToggleActionSetActiveMethodInfo ,
#endif
toggleActionSetActive ,
#if defined(ENABLE_OVERLOADING)
ToggleActionSetDrawAsRadioMethodInfo ,
#endif
toggleActionSetDrawAsRadio ,
#if defined(ENABLE_OVERLOADING)
ToggleActionToggledMethodInfo ,
#endif
toggleActionToggled ,
#if defined(ENABLE_OVERLOADING)
ToggleActionActivePropertyInfo ,
#endif
constructToggleActionActive ,
getToggleActionActive ,
setToggleActionActive ,
#if defined(ENABLE_OVERLOADING)
toggleActionActive ,
#endif
#if defined(ENABLE_OVERLOADING)
ToggleActionDrawAsRadioPropertyInfo ,
#endif
constructToggleActionDrawAsRadio ,
getToggleActionDrawAsRadio ,
setToggleActionDrawAsRadio ,
#if defined(ENABLE_OVERLOADING)
toggleActionDrawAsRadio ,
#endif
C_ToggleActionToggledCallback ,
ToggleActionToggledCallback ,
#if defined(ENABLE_OVERLOADING)
ToggleActionToggledSignalInfo ,
#endif
afterToggleActionToggled ,
genClosure_ToggleActionToggled ,
mk_ToggleActionToggledCallback ,
noToggleActionToggledCallback ,
onToggleActionToggled ,
wrap_ToggleActionToggledCallback ,
) 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.GI.Base.Signals as B.Signals
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.Interfaces.Buildable as Gtk.Buildable
import {-# SOURCE #-} qualified GI.Gtk.Objects.Action as Gtk.Action
newtype ToggleAction = ToggleAction (ManagedPtr ToggleAction)
deriving (ToggleAction -> ToggleAction -> Bool
(ToggleAction -> ToggleAction -> Bool)
-> (ToggleAction -> ToggleAction -> Bool) -> Eq ToggleAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ToggleAction -> ToggleAction -> Bool
$c/= :: ToggleAction -> ToggleAction -> Bool
== :: ToggleAction -> ToggleAction -> Bool
$c== :: ToggleAction -> ToggleAction -> Bool
Eq)
foreign import ccall "gtk_toggle_action_get_type"
c_gtk_toggle_action_get_type :: IO GType
instance GObject ToggleAction where
gobjectType :: IO GType
gobjectType = IO GType
c_gtk_toggle_action_get_type
instance B.GValue.IsGValue ToggleAction where
toGValue :: ToggleAction -> IO GValue
toGValue o :: ToggleAction
o = do
GType
gtype <- IO GType
c_gtk_toggle_action_get_type
ToggleAction -> (Ptr ToggleAction -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ToggleAction
o (GType
-> (GValue -> Ptr ToggleAction -> IO ())
-> Ptr ToggleAction
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr ToggleAction -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO ToggleAction
fromGValue gv :: GValue
gv = do
Ptr ToggleAction
ptr <- GValue -> IO (Ptr ToggleAction)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr ToggleAction)
(ManagedPtr ToggleAction -> ToggleAction)
-> Ptr ToggleAction -> IO ToggleAction
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr ToggleAction -> ToggleAction
ToggleAction Ptr ToggleAction
ptr
class (GObject o, O.IsDescendantOf ToggleAction o) => IsToggleAction o
instance (GObject o, O.IsDescendantOf ToggleAction o) => IsToggleAction o
instance O.HasParentTypes ToggleAction
type instance O.ParentTypes ToggleAction = '[Gtk.Action.Action, GObject.Object.Object, Gtk.Buildable.Buildable]
toToggleAction :: (MonadIO m, IsToggleAction o) => o -> m ToggleAction
toToggleAction :: o -> m ToggleAction
toToggleAction = IO ToggleAction -> m ToggleAction
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ToggleAction -> m ToggleAction)
-> (o -> IO ToggleAction) -> o -> m ToggleAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr ToggleAction -> ToggleAction) -> o -> IO ToggleAction
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr ToggleAction -> ToggleAction
ToggleAction
noToggleAction :: Maybe ToggleAction
noToggleAction :: Maybe ToggleAction
noToggleAction = Maybe ToggleAction
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveToggleActionMethod (t :: Symbol) (o :: *) :: * where
ResolveToggleActionMethod "activate" o = Gtk.Action.ActionActivateMethodInfo
ResolveToggleActionMethod "addChild" o = Gtk.Buildable.BuildableAddChildMethodInfo
ResolveToggleActionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveToggleActionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveToggleActionMethod "blockActivate" o = Gtk.Action.ActionBlockActivateMethodInfo
ResolveToggleActionMethod "connectAccelerator" o = Gtk.Action.ActionConnectAcceleratorMethodInfo
ResolveToggleActionMethod "constructChild" o = Gtk.Buildable.BuildableConstructChildMethodInfo
ResolveToggleActionMethod "createIcon" o = Gtk.Action.ActionCreateIconMethodInfo
ResolveToggleActionMethod "createMenu" o = Gtk.Action.ActionCreateMenuMethodInfo
ResolveToggleActionMethod "createMenuItem" o = Gtk.Action.ActionCreateMenuItemMethodInfo
ResolveToggleActionMethod "createToolItem" o = Gtk.Action.ActionCreateToolItemMethodInfo
ResolveToggleActionMethod "customFinished" o = Gtk.Buildable.BuildableCustomFinishedMethodInfo
ResolveToggleActionMethod "customTagEnd" o = Gtk.Buildable.BuildableCustomTagEndMethodInfo
ResolveToggleActionMethod "customTagStart" o = Gtk.Buildable.BuildableCustomTagStartMethodInfo
ResolveToggleActionMethod "disconnectAccelerator" o = Gtk.Action.ActionDisconnectAcceleratorMethodInfo
ResolveToggleActionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveToggleActionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveToggleActionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveToggleActionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveToggleActionMethod "isSensitive" o = Gtk.Action.ActionIsSensitiveMethodInfo
ResolveToggleActionMethod "isVisible" o = Gtk.Action.ActionIsVisibleMethodInfo
ResolveToggleActionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveToggleActionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveToggleActionMethod "parserFinished" o = Gtk.Buildable.BuildableParserFinishedMethodInfo
ResolveToggleActionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveToggleActionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveToggleActionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveToggleActionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveToggleActionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveToggleActionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveToggleActionMethod "toggled" o = ToggleActionToggledMethodInfo
ResolveToggleActionMethod "unblockActivate" o = Gtk.Action.ActionUnblockActivateMethodInfo
ResolveToggleActionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveToggleActionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveToggleActionMethod "getAccelClosure" o = Gtk.Action.ActionGetAccelClosureMethodInfo
ResolveToggleActionMethod "getAccelPath" o = Gtk.Action.ActionGetAccelPathMethodInfo
ResolveToggleActionMethod "getActive" o = ToggleActionGetActiveMethodInfo
ResolveToggleActionMethod "getAlwaysShowImage" o = Gtk.Action.ActionGetAlwaysShowImageMethodInfo
ResolveToggleActionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveToggleActionMethod "getDrawAsRadio" o = ToggleActionGetDrawAsRadioMethodInfo
ResolveToggleActionMethod "getGicon" o = Gtk.Action.ActionGetGiconMethodInfo
ResolveToggleActionMethod "getIconName" o = Gtk.Action.ActionGetIconNameMethodInfo
ResolveToggleActionMethod "getInternalChild" o = Gtk.Buildable.BuildableGetInternalChildMethodInfo
ResolveToggleActionMethod "getIsImportant" o = Gtk.Action.ActionGetIsImportantMethodInfo
ResolveToggleActionMethod "getLabel" o = Gtk.Action.ActionGetLabelMethodInfo
ResolveToggleActionMethod "getName" o = Gtk.Action.ActionGetNameMethodInfo
ResolveToggleActionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveToggleActionMethod "getProxies" o = Gtk.Action.ActionGetProxiesMethodInfo
ResolveToggleActionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveToggleActionMethod "getSensitive" o = Gtk.Action.ActionGetSensitiveMethodInfo
ResolveToggleActionMethod "getShortLabel" o = Gtk.Action.ActionGetShortLabelMethodInfo
ResolveToggleActionMethod "getStockId" o = Gtk.Action.ActionGetStockIdMethodInfo
ResolveToggleActionMethod "getTooltip" o = Gtk.Action.ActionGetTooltipMethodInfo
ResolveToggleActionMethod "getVisible" o = Gtk.Action.ActionGetVisibleMethodInfo
ResolveToggleActionMethod "getVisibleHorizontal" o = Gtk.Action.ActionGetVisibleHorizontalMethodInfo
ResolveToggleActionMethod "getVisibleVertical" o = Gtk.Action.ActionGetVisibleVerticalMethodInfo
ResolveToggleActionMethod "setAccelGroup" o = Gtk.Action.ActionSetAccelGroupMethodInfo
ResolveToggleActionMethod "setAccelPath" o = Gtk.Action.ActionSetAccelPathMethodInfo
ResolveToggleActionMethod "setActive" o = ToggleActionSetActiveMethodInfo
ResolveToggleActionMethod "setAlwaysShowImage" o = Gtk.Action.ActionSetAlwaysShowImageMethodInfo
ResolveToggleActionMethod "setBuildableProperty" o = Gtk.Buildable.BuildableSetBuildablePropertyMethodInfo
ResolveToggleActionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveToggleActionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveToggleActionMethod "setDrawAsRadio" o = ToggleActionSetDrawAsRadioMethodInfo
ResolveToggleActionMethod "setGicon" o = Gtk.Action.ActionSetGiconMethodInfo
ResolveToggleActionMethod "setIconName" o = Gtk.Action.ActionSetIconNameMethodInfo
ResolveToggleActionMethod "setIsImportant" o = Gtk.Action.ActionSetIsImportantMethodInfo
ResolveToggleActionMethod "setLabel" o = Gtk.Action.ActionSetLabelMethodInfo
ResolveToggleActionMethod "setName" o = Gtk.Buildable.BuildableSetNameMethodInfo
ResolveToggleActionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveToggleActionMethod "setSensitive" o = Gtk.Action.ActionSetSensitiveMethodInfo
ResolveToggleActionMethod "setShortLabel" o = Gtk.Action.ActionSetShortLabelMethodInfo
ResolveToggleActionMethod "setStockId" o = Gtk.Action.ActionSetStockIdMethodInfo
ResolveToggleActionMethod "setTooltip" o = Gtk.Action.ActionSetTooltipMethodInfo
ResolveToggleActionMethod "setVisible" o = Gtk.Action.ActionSetVisibleMethodInfo
ResolveToggleActionMethod "setVisibleHorizontal" o = Gtk.Action.ActionSetVisibleHorizontalMethodInfo
ResolveToggleActionMethod "setVisibleVertical" o = Gtk.Action.ActionSetVisibleVerticalMethodInfo
ResolveToggleActionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveToggleActionMethod t ToggleAction, O.MethodInfo info ToggleAction p) => OL.IsLabel t (ToggleAction -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
{-# DEPRECATED ToggleActionToggledCallback ["(Since version 3.10)"] #-}
type ToggleActionToggledCallback =
IO ()
noToggleActionToggledCallback :: Maybe ToggleActionToggledCallback
noToggleActionToggledCallback :: Maybe (IO ())
noToggleActionToggledCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_ToggleActionToggledCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_ToggleActionToggledCallback :: C_ToggleActionToggledCallback -> IO (FunPtr C_ToggleActionToggledCallback)
genClosure_ToggleActionToggled :: MonadIO m => ToggleActionToggledCallback -> m (GClosure C_ToggleActionToggledCallback)
genClosure_ToggleActionToggled :: IO () -> m (GClosure C_ToggleActionToggledCallback)
genClosure_ToggleActionToggled cb :: IO ()
cb = IO (GClosure C_ToggleActionToggledCallback)
-> m (GClosure C_ToggleActionToggledCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ToggleActionToggledCallback)
-> m (GClosure C_ToggleActionToggledCallback))
-> IO (GClosure C_ToggleActionToggledCallback)
-> m (GClosure C_ToggleActionToggledCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_ToggleActionToggledCallback
cb' = IO () -> C_ToggleActionToggledCallback
wrap_ToggleActionToggledCallback IO ()
cb
C_ToggleActionToggledCallback
-> IO (FunPtr C_ToggleActionToggledCallback)
mk_ToggleActionToggledCallback C_ToggleActionToggledCallback
cb' IO (FunPtr C_ToggleActionToggledCallback)
-> (FunPtr C_ToggleActionToggledCallback
-> IO (GClosure C_ToggleActionToggledCallback))
-> IO (GClosure C_ToggleActionToggledCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ToggleActionToggledCallback
-> IO (GClosure C_ToggleActionToggledCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_ToggleActionToggledCallback ::
ToggleActionToggledCallback ->
C_ToggleActionToggledCallback
wrap_ToggleActionToggledCallback :: IO () -> C_ToggleActionToggledCallback
wrap_ToggleActionToggledCallback _cb :: IO ()
_cb _ _ = do
IO ()
_cb
onToggleActionToggled :: (IsToggleAction a, MonadIO m) => a -> ToggleActionToggledCallback -> m SignalHandlerId
onToggleActionToggled :: a -> IO () -> m SignalHandlerId
onToggleActionToggled obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_ToggleActionToggledCallback
cb' = IO () -> C_ToggleActionToggledCallback
wrap_ToggleActionToggledCallback IO ()
cb
FunPtr C_ToggleActionToggledCallback
cb'' <- C_ToggleActionToggledCallback
-> IO (FunPtr C_ToggleActionToggledCallback)
mk_ToggleActionToggledCallback C_ToggleActionToggledCallback
cb'
a
-> Text
-> FunPtr C_ToggleActionToggledCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "toggled" FunPtr C_ToggleActionToggledCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterToggleActionToggled :: (IsToggleAction a, MonadIO m) => a -> ToggleActionToggledCallback -> m SignalHandlerId
afterToggleActionToggled :: a -> IO () -> m SignalHandlerId
afterToggleActionToggled obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_ToggleActionToggledCallback
cb' = IO () -> C_ToggleActionToggledCallback
wrap_ToggleActionToggledCallback IO ()
cb
FunPtr C_ToggleActionToggledCallback
cb'' <- C_ToggleActionToggledCallback
-> IO (FunPtr C_ToggleActionToggledCallback)
mk_ToggleActionToggledCallback C_ToggleActionToggledCallback
cb'
a
-> Text
-> FunPtr C_ToggleActionToggledCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "toggled" FunPtr C_ToggleActionToggledCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data ToggleActionToggledSignalInfo
instance SignalInfo ToggleActionToggledSignalInfo where
type HaskellCallbackType ToggleActionToggledSignalInfo = ToggleActionToggledCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_ToggleActionToggledCallback cb
cb'' <- mk_ToggleActionToggledCallback cb'
connectSignalFunPtr obj "toggled" cb'' connectMode detail
#endif
getToggleActionActive :: (MonadIO m, IsToggleAction o) => o -> m Bool
getToggleActionActive :: o -> m Bool
getToggleActionActive obj :: o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj "active"
setToggleActionActive :: (MonadIO m, IsToggleAction o) => o -> Bool -> m ()
setToggleActionActive :: o -> Bool -> m ()
setToggleActionActive obj :: o
obj val :: Bool
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj "active" Bool
val
constructToggleActionActive :: (IsToggleAction o) => Bool -> IO (GValueConstruct o)
constructToggleActionActive :: Bool -> IO (GValueConstruct o)
constructToggleActionActive val :: Bool
val = String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool "active" Bool
val
#if defined(ENABLE_OVERLOADING)
data ToggleActionActivePropertyInfo
instance AttrInfo ToggleActionActivePropertyInfo where
type AttrAllowedOps ToggleActionActivePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint ToggleActionActivePropertyInfo = IsToggleAction
type AttrSetTypeConstraint ToggleActionActivePropertyInfo = (~) Bool
type AttrTransferTypeConstraint ToggleActionActivePropertyInfo = (~) Bool
type AttrTransferType ToggleActionActivePropertyInfo = Bool
type AttrGetType ToggleActionActivePropertyInfo = Bool
type AttrLabel ToggleActionActivePropertyInfo = "active"
type AttrOrigin ToggleActionActivePropertyInfo = ToggleAction
attrGet = getToggleActionActive
attrSet = setToggleActionActive
attrTransfer _ v = do
return v
attrConstruct = constructToggleActionActive
attrClear = undefined
#endif
getToggleActionDrawAsRadio :: (MonadIO m, IsToggleAction o) => o -> m Bool
getToggleActionDrawAsRadio :: o -> m Bool
getToggleActionDrawAsRadio obj :: o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj "draw-as-radio"
setToggleActionDrawAsRadio :: (MonadIO m, IsToggleAction o) => o -> Bool -> m ()
setToggleActionDrawAsRadio :: o -> Bool -> m ()
setToggleActionDrawAsRadio obj :: o
obj val :: Bool
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj "draw-as-radio" Bool
val
constructToggleActionDrawAsRadio :: (IsToggleAction o) => Bool -> IO (GValueConstruct o)
constructToggleActionDrawAsRadio :: Bool -> IO (GValueConstruct o)
constructToggleActionDrawAsRadio val :: Bool
val = String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool "draw-as-radio" Bool
val
#if defined(ENABLE_OVERLOADING)
data ToggleActionDrawAsRadioPropertyInfo
instance AttrInfo ToggleActionDrawAsRadioPropertyInfo where
type AttrAllowedOps ToggleActionDrawAsRadioPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint ToggleActionDrawAsRadioPropertyInfo = IsToggleAction
type AttrSetTypeConstraint ToggleActionDrawAsRadioPropertyInfo = (~) Bool
type AttrTransferTypeConstraint ToggleActionDrawAsRadioPropertyInfo = (~) Bool
type AttrTransferType ToggleActionDrawAsRadioPropertyInfo = Bool
type AttrGetType ToggleActionDrawAsRadioPropertyInfo = Bool
type AttrLabel ToggleActionDrawAsRadioPropertyInfo = "draw-as-radio"
type AttrOrigin ToggleActionDrawAsRadioPropertyInfo = ToggleAction
attrGet = getToggleActionDrawAsRadio
attrSet = setToggleActionDrawAsRadio
attrTransfer _ v = do
return v
attrConstruct = constructToggleActionDrawAsRadio
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ToggleAction
type instance O.AttributeList ToggleAction = ToggleActionAttributeList
type ToggleActionAttributeList = ('[ '("actionGroup", Gtk.Action.ActionActionGroupPropertyInfo), '("active", ToggleActionActivePropertyInfo), '("alwaysShowImage", Gtk.Action.ActionAlwaysShowImagePropertyInfo), '("drawAsRadio", ToggleActionDrawAsRadioPropertyInfo), '("gicon", Gtk.Action.ActionGiconPropertyInfo), '("hideIfEmpty", Gtk.Action.ActionHideIfEmptyPropertyInfo), '("iconName", Gtk.Action.ActionIconNamePropertyInfo), '("isImportant", Gtk.Action.ActionIsImportantPropertyInfo), '("label", Gtk.Action.ActionLabelPropertyInfo), '("name", Gtk.Action.ActionNamePropertyInfo), '("sensitive", Gtk.Action.ActionSensitivePropertyInfo), '("shortLabel", Gtk.Action.ActionShortLabelPropertyInfo), '("stockId", Gtk.Action.ActionStockIdPropertyInfo), '("tooltip", Gtk.Action.ActionTooltipPropertyInfo), '("visible", Gtk.Action.ActionVisiblePropertyInfo), '("visibleHorizontal", Gtk.Action.ActionVisibleHorizontalPropertyInfo), '("visibleOverflown", Gtk.Action.ActionVisibleOverflownPropertyInfo), '("visibleVertical", Gtk.Action.ActionVisibleVerticalPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
toggleActionActive :: AttrLabelProxy "active"
toggleActionActive = AttrLabelProxy
toggleActionDrawAsRadio :: AttrLabelProxy "drawAsRadio"
toggleActionDrawAsRadio = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList ToggleAction = ToggleActionSignalList
type ToggleActionSignalList = ('[ '("activate", Gtk.Action.ActionActivateSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("toggled", ToggleActionToggledSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_toggle_action_new" gtk_toggle_action_new ::
CString ->
CString ->
CString ->
CString ->
IO (Ptr ToggleAction)
{-# DEPRECATED toggleActionNew ["(Since version 3.10)"] #-}
toggleActionNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Maybe (T.Text)
-> Maybe (T.Text)
-> Maybe (T.Text)
-> m ToggleAction
toggleActionNew :: Text -> Maybe Text -> Maybe Text -> Maybe Text -> m ToggleAction
toggleActionNew name :: Text
name label :: Maybe Text
label tooltip :: Maybe Text
tooltip stockId :: Maybe Text
stockId = IO ToggleAction -> m ToggleAction
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ToggleAction -> m ToggleAction)
-> IO ToggleAction -> m ToggleAction
forall a b. (a -> b) -> a -> b
$ do
CString
name' <- Text -> IO CString
textToCString Text
name
CString
maybeLabel <- case Maybe Text
label of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jLabel :: Text
jLabel -> do
CString
jLabel' <- Text -> IO CString
textToCString Text
jLabel
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jLabel'
CString
maybeTooltip <- case Maybe Text
tooltip of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jTooltip :: Text
jTooltip -> do
CString
jTooltip' <- Text -> IO CString
textToCString Text
jTooltip
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jTooltip'
CString
maybeStockId <- case Maybe Text
stockId of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jStockId :: Text
jStockId -> do
CString
jStockId' <- Text -> IO CString
textToCString Text
jStockId
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jStockId'
Ptr ToggleAction
result <- CString -> CString -> CString -> CString -> IO (Ptr ToggleAction)
gtk_toggle_action_new CString
name' CString
maybeLabel CString
maybeTooltip CString
maybeStockId
Text -> Ptr ToggleAction -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "toggleActionNew" Ptr ToggleAction
result
ToggleAction
result' <- ((ManagedPtr ToggleAction -> ToggleAction)
-> Ptr ToggleAction -> IO ToggleAction
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ToggleAction -> ToggleAction
ToggleAction) Ptr ToggleAction
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeLabel
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeTooltip
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeStockId
ToggleAction -> IO ToggleAction
forall (m :: * -> *) a. Monad m => a -> m a
return ToggleAction
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_toggle_action_get_active" gtk_toggle_action_get_active ::
Ptr ToggleAction ->
IO CInt
{-# DEPRECATED toggleActionGetActive ["(Since version 3.10)"] #-}
toggleActionGetActive ::
(B.CallStack.HasCallStack, MonadIO m, IsToggleAction a) =>
a
-> m Bool
toggleActionGetActive :: a -> m Bool
toggleActionGetActive action :: a
action = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr ToggleAction
action' <- a -> IO (Ptr ToggleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
CInt
result <- Ptr ToggleAction -> IO CInt
gtk_toggle_action_get_active Ptr ToggleAction
action'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
action
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ToggleActionGetActiveMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsToggleAction a) => O.MethodInfo ToggleActionGetActiveMethodInfo a signature where
overloadedMethod = toggleActionGetActive
#endif
foreign import ccall "gtk_toggle_action_get_draw_as_radio" gtk_toggle_action_get_draw_as_radio ::
Ptr ToggleAction ->
IO CInt
{-# DEPRECATED toggleActionGetDrawAsRadio ["(Since version 3.10)"] #-}
toggleActionGetDrawAsRadio ::
(B.CallStack.HasCallStack, MonadIO m, IsToggleAction a) =>
a
-> m Bool
toggleActionGetDrawAsRadio :: a -> m Bool
toggleActionGetDrawAsRadio action :: a
action = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr ToggleAction
action' <- a -> IO (Ptr ToggleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
CInt
result <- Ptr ToggleAction -> IO CInt
gtk_toggle_action_get_draw_as_radio Ptr ToggleAction
action'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
action
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ToggleActionGetDrawAsRadioMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsToggleAction a) => O.MethodInfo ToggleActionGetDrawAsRadioMethodInfo a signature where
overloadedMethod = toggleActionGetDrawAsRadio
#endif
foreign import ccall "gtk_toggle_action_set_active" gtk_toggle_action_set_active ::
Ptr ToggleAction ->
CInt ->
IO ()
{-# DEPRECATED toggleActionSetActive ["(Since version 3.10)"] #-}
toggleActionSetActive ::
(B.CallStack.HasCallStack, MonadIO m, IsToggleAction a) =>
a
-> Bool
-> m ()
toggleActionSetActive :: a -> Bool -> m ()
toggleActionSetActive action :: a
action isActive :: Bool
isActive = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ToggleAction
action' <- a -> IO (Ptr ToggleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
let isActive' :: CInt
isActive' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
isActive
Ptr ToggleAction -> CInt -> IO ()
gtk_toggle_action_set_active Ptr ToggleAction
action' CInt
isActive'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
action
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ToggleActionSetActiveMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsToggleAction a) => O.MethodInfo ToggleActionSetActiveMethodInfo a signature where
overloadedMethod = toggleActionSetActive
#endif
foreign import ccall "gtk_toggle_action_set_draw_as_radio" gtk_toggle_action_set_draw_as_radio ::
Ptr ToggleAction ->
CInt ->
IO ()
{-# DEPRECATED toggleActionSetDrawAsRadio ["(Since version 3.10)"] #-}
toggleActionSetDrawAsRadio ::
(B.CallStack.HasCallStack, MonadIO m, IsToggleAction a) =>
a
-> Bool
-> m ()
toggleActionSetDrawAsRadio :: a -> Bool -> m ()
toggleActionSetDrawAsRadio action :: a
action drawAsRadio :: Bool
drawAsRadio = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ToggleAction
action' <- a -> IO (Ptr ToggleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
let drawAsRadio' :: CInt
drawAsRadio' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
drawAsRadio
Ptr ToggleAction -> CInt -> IO ()
gtk_toggle_action_set_draw_as_radio Ptr ToggleAction
action' CInt
drawAsRadio'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
action
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ToggleActionSetDrawAsRadioMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsToggleAction a) => O.MethodInfo ToggleActionSetDrawAsRadioMethodInfo a signature where
overloadedMethod = toggleActionSetDrawAsRadio
#endif
foreign import ccall "gtk_toggle_action_toggled" gtk_toggle_action_toggled ::
Ptr ToggleAction ->
IO ()
{-# DEPRECATED toggleActionToggled ["(Since version 3.10)"] #-}
toggleActionToggled ::
(B.CallStack.HasCallStack, MonadIO m, IsToggleAction a) =>
a
-> m ()
toggleActionToggled :: a -> m ()
toggleActionToggled action :: a
action = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ToggleAction
action' <- a -> IO (Ptr ToggleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
Ptr ToggleAction -> IO ()
gtk_toggle_action_toggled Ptr ToggleAction
action'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
action
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ToggleActionToggledMethodInfo
instance (signature ~ (m ()), MonadIO m, IsToggleAction a) => O.MethodInfo ToggleActionToggledMethodInfo a signature where
overloadedMethod = toggleActionToggled
#endif