{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.Switch
(
Switch(..) ,
IsSwitch ,
toSwitch ,
noSwitch ,
#if defined(ENABLE_OVERLOADING)
ResolveSwitchMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SwitchGetActiveMethodInfo ,
#endif
switchGetActive ,
#if defined(ENABLE_OVERLOADING)
SwitchGetStateMethodInfo ,
#endif
switchGetState ,
switchNew ,
#if defined(ENABLE_OVERLOADING)
SwitchSetActiveMethodInfo ,
#endif
switchSetActive ,
#if defined(ENABLE_OVERLOADING)
SwitchSetStateMethodInfo ,
#endif
switchSetState ,
#if defined(ENABLE_OVERLOADING)
SwitchActivePropertyInfo ,
#endif
constructSwitchActive ,
getSwitchActive ,
setSwitchActive ,
#if defined(ENABLE_OVERLOADING)
switchActive ,
#endif
#if defined(ENABLE_OVERLOADING)
SwitchStatePropertyInfo ,
#endif
constructSwitchState ,
getSwitchState ,
setSwitchState ,
#if defined(ENABLE_OVERLOADING)
switchState ,
#endif
C_SwitchActivateCallback ,
SwitchActivateCallback ,
#if defined(ENABLE_OVERLOADING)
SwitchActivateSignalInfo ,
#endif
afterSwitchActivate ,
genClosure_SwitchActivate ,
mk_SwitchActivateCallback ,
noSwitchActivateCallback ,
onSwitchActivate ,
wrap_SwitchActivateCallback ,
C_SwitchStateSetCallback ,
SwitchStateSetCallback ,
#if defined(ENABLE_OVERLOADING)
SwitchStateSetSignalInfo ,
#endif
afterSwitchStateSet ,
genClosure_SwitchStateSet ,
mk_SwitchStateSetCallback ,
noSwitchStateSetCallback ,
onSwitchStateSet ,
wrap_SwitchStateSetCallback ,
) 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.Atk.Interfaces.ImplementorIface as Atk.ImplementorIface
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Actionable as Gtk.Actionable
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
newtype Switch = Switch (ManagedPtr Switch)
deriving (Switch -> Switch -> Bool
(Switch -> Switch -> Bool)
-> (Switch -> Switch -> Bool) -> Eq Switch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Switch -> Switch -> Bool
$c/= :: Switch -> Switch -> Bool
== :: Switch -> Switch -> Bool
$c== :: Switch -> Switch -> Bool
Eq)
foreign import ccall "gtk_switch_get_type"
c_gtk_switch_get_type :: IO GType
instance GObject Switch where
gobjectType :: IO GType
gobjectType = IO GType
c_gtk_switch_get_type
instance B.GValue.IsGValue Switch where
toGValue :: Switch -> IO GValue
toGValue o :: Switch
o = do
GType
gtype <- IO GType
c_gtk_switch_get_type
Switch -> (Ptr Switch -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Switch
o (GType -> (GValue -> Ptr Switch -> IO ()) -> Ptr Switch -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Switch -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Switch
fromGValue gv :: GValue
gv = do
Ptr Switch
ptr <- GValue -> IO (Ptr Switch)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Switch)
(ManagedPtr Switch -> Switch) -> Ptr Switch -> IO Switch
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Switch -> Switch
Switch Ptr Switch
ptr
class (GObject o, O.IsDescendantOf Switch o) => IsSwitch o
instance (GObject o, O.IsDescendantOf Switch o) => IsSwitch o
instance O.HasParentTypes Switch
type instance O.ParentTypes Switch = '[Gtk.Widget.Widget, GObject.Object.Object, Atk.ImplementorIface.ImplementorIface, Gtk.Actionable.Actionable, Gtk.Buildable.Buildable]
toSwitch :: (MonadIO m, IsSwitch o) => o -> m Switch
toSwitch :: o -> m Switch
toSwitch = IO Switch -> m Switch
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Switch -> m Switch) -> (o -> IO Switch) -> o -> m Switch
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Switch -> Switch) -> o -> IO Switch
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Switch -> Switch
Switch
noSwitch :: Maybe Switch
noSwitch :: Maybe Switch
noSwitch = Maybe Switch
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSwitchMethod (t :: Symbol) (o :: *) :: * where
ResolveSwitchMethod "activate" o = Gtk.Widget.WidgetActivateMethodInfo
ResolveSwitchMethod "activateAction" o = Gtk.Widget.WidgetActivateActionMethodInfo
ResolveSwitchMethod "activateDefault" o = Gtk.Widget.WidgetActivateDefaultMethodInfo
ResolveSwitchMethod "addAccelerator" o = Gtk.Widget.WidgetAddAcceleratorMethodInfo
ResolveSwitchMethod "addChild" o = Gtk.Buildable.BuildableAddChildMethodInfo
ResolveSwitchMethod "addController" o = Gtk.Widget.WidgetAddControllerMethodInfo
ResolveSwitchMethod "addMnemonicLabel" o = Gtk.Widget.WidgetAddMnemonicLabelMethodInfo
ResolveSwitchMethod "addTickCallback" o = Gtk.Widget.WidgetAddTickCallbackMethodInfo
ResolveSwitchMethod "allocate" o = Gtk.Widget.WidgetAllocateMethodInfo
ResolveSwitchMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSwitchMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSwitchMethod "canActivateAccel" o = Gtk.Widget.WidgetCanActivateAccelMethodInfo
ResolveSwitchMethod "childFocus" o = Gtk.Widget.WidgetChildFocusMethodInfo
ResolveSwitchMethod "computeBounds" o = Gtk.Widget.WidgetComputeBoundsMethodInfo
ResolveSwitchMethod "computeExpand" o = Gtk.Widget.WidgetComputeExpandMethodInfo
ResolveSwitchMethod "computePoint" o = Gtk.Widget.WidgetComputePointMethodInfo
ResolveSwitchMethod "computeTransform" o = Gtk.Widget.WidgetComputeTransformMethodInfo
ResolveSwitchMethod "constructChild" o = Gtk.Buildable.BuildableConstructChildMethodInfo
ResolveSwitchMethod "contains" o = Gtk.Widget.WidgetContainsMethodInfo
ResolveSwitchMethod "createPangoContext" o = Gtk.Widget.WidgetCreatePangoContextMethodInfo
ResolveSwitchMethod "createPangoLayout" o = Gtk.Widget.WidgetCreatePangoLayoutMethodInfo
ResolveSwitchMethod "customFinished" o = Gtk.Buildable.BuildableCustomFinishedMethodInfo
ResolveSwitchMethod "customTagEnd" o = Gtk.Buildable.BuildableCustomTagEndMethodInfo
ResolveSwitchMethod "customTagStart" o = Gtk.Buildable.BuildableCustomTagStartMethodInfo
ResolveSwitchMethod "destroy" o = Gtk.Widget.WidgetDestroyMethodInfo
ResolveSwitchMethod "destroyed" o = Gtk.Widget.WidgetDestroyedMethodInfo
ResolveSwitchMethod "deviceIsShadowed" o = Gtk.Widget.WidgetDeviceIsShadowedMethodInfo
ResolveSwitchMethod "dragBegin" o = Gtk.Widget.WidgetDragBeginMethodInfo
ResolveSwitchMethod "dragCheckThreshold" o = Gtk.Widget.WidgetDragCheckThresholdMethodInfo
ResolveSwitchMethod "dragDestAddImageTargets" o = Gtk.Widget.WidgetDragDestAddImageTargetsMethodInfo
ResolveSwitchMethod "dragDestAddTextTargets" o = Gtk.Widget.WidgetDragDestAddTextTargetsMethodInfo
ResolveSwitchMethod "dragDestAddUriTargets" o = Gtk.Widget.WidgetDragDestAddUriTargetsMethodInfo
ResolveSwitchMethod "dragDestFindTarget" o = Gtk.Widget.WidgetDragDestFindTargetMethodInfo
ResolveSwitchMethod "dragDestGetTargetList" o = Gtk.Widget.WidgetDragDestGetTargetListMethodInfo
ResolveSwitchMethod "dragDestGetTrackMotion" o = Gtk.Widget.WidgetDragDestGetTrackMotionMethodInfo
ResolveSwitchMethod "dragDestSet" o = Gtk.Widget.WidgetDragDestSetMethodInfo
ResolveSwitchMethod "dragDestSetTargetList" o = Gtk.Widget.WidgetDragDestSetTargetListMethodInfo
ResolveSwitchMethod "dragDestSetTrackMotion" o = Gtk.Widget.WidgetDragDestSetTrackMotionMethodInfo
ResolveSwitchMethod "dragDestUnset" o = Gtk.Widget.WidgetDragDestUnsetMethodInfo
ResolveSwitchMethod "dragGetData" o = Gtk.Widget.WidgetDragGetDataMethodInfo
ResolveSwitchMethod "dragHighlight" o = Gtk.Widget.WidgetDragHighlightMethodInfo
ResolveSwitchMethod "dragSourceAddImageTargets" o = Gtk.Widget.WidgetDragSourceAddImageTargetsMethodInfo
ResolveSwitchMethod "dragSourceAddTextTargets" o = Gtk.Widget.WidgetDragSourceAddTextTargetsMethodInfo
ResolveSwitchMethod "dragSourceAddUriTargets" o = Gtk.Widget.WidgetDragSourceAddUriTargetsMethodInfo
ResolveSwitchMethod "dragSourceGetTargetList" o = Gtk.Widget.WidgetDragSourceGetTargetListMethodInfo
ResolveSwitchMethod "dragSourceSet" o = Gtk.Widget.WidgetDragSourceSetMethodInfo
ResolveSwitchMethod "dragSourceSetIconGicon" o = Gtk.Widget.WidgetDragSourceSetIconGiconMethodInfo
ResolveSwitchMethod "dragSourceSetIconName" o = Gtk.Widget.WidgetDragSourceSetIconNameMethodInfo
ResolveSwitchMethod "dragSourceSetIconPaintable" o = Gtk.Widget.WidgetDragSourceSetIconPaintableMethodInfo
ResolveSwitchMethod "dragSourceSetTargetList" o = Gtk.Widget.WidgetDragSourceSetTargetListMethodInfo
ResolveSwitchMethod "dragSourceUnset" o = Gtk.Widget.WidgetDragSourceUnsetMethodInfo
ResolveSwitchMethod "dragUnhighlight" o = Gtk.Widget.WidgetDragUnhighlightMethodInfo
ResolveSwitchMethod "errorBell" o = Gtk.Widget.WidgetErrorBellMethodInfo
ResolveSwitchMethod "event" o = Gtk.Widget.WidgetEventMethodInfo
ResolveSwitchMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSwitchMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSwitchMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSwitchMethod "grabAdd" o = Gtk.Widget.WidgetGrabAddMethodInfo
ResolveSwitchMethod "grabFocus" o = Gtk.Widget.WidgetGrabFocusMethodInfo
ResolveSwitchMethod "grabRemove" o = Gtk.Widget.WidgetGrabRemoveMethodInfo
ResolveSwitchMethod "hasDefault" o = Gtk.Widget.WidgetHasDefaultMethodInfo
ResolveSwitchMethod "hasFocus" o = Gtk.Widget.WidgetHasFocusMethodInfo
ResolveSwitchMethod "hasGrab" o = Gtk.Widget.WidgetHasGrabMethodInfo
ResolveSwitchMethod "hasVisibleFocus" o = Gtk.Widget.WidgetHasVisibleFocusMethodInfo
ResolveSwitchMethod "hide" o = Gtk.Widget.WidgetHideMethodInfo
ResolveSwitchMethod "inDestruction" o = Gtk.Widget.WidgetInDestructionMethodInfo
ResolveSwitchMethod "initTemplate" o = Gtk.Widget.WidgetInitTemplateMethodInfo
ResolveSwitchMethod "inputShapeCombineRegion" o = Gtk.Widget.WidgetInputShapeCombineRegionMethodInfo
ResolveSwitchMethod "insertActionGroup" o = Gtk.Widget.WidgetInsertActionGroupMethodInfo
ResolveSwitchMethod "insertAfter" o = Gtk.Widget.WidgetInsertAfterMethodInfo
ResolveSwitchMethod "insertBefore" o = Gtk.Widget.WidgetInsertBeforeMethodInfo
ResolveSwitchMethod "isAncestor" o = Gtk.Widget.WidgetIsAncestorMethodInfo
ResolveSwitchMethod "isDrawable" o = Gtk.Widget.WidgetIsDrawableMethodInfo
ResolveSwitchMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSwitchMethod "isFocus" o = Gtk.Widget.WidgetIsFocusMethodInfo
ResolveSwitchMethod "isSensitive" o = Gtk.Widget.WidgetIsSensitiveMethodInfo
ResolveSwitchMethod "isToplevel" o = Gtk.Widget.WidgetIsToplevelMethodInfo
ResolveSwitchMethod "isVisible" o = Gtk.Widget.WidgetIsVisibleMethodInfo
ResolveSwitchMethod "keynavFailed" o = Gtk.Widget.WidgetKeynavFailedMethodInfo
ResolveSwitchMethod "listAccelClosures" o = Gtk.Widget.WidgetListAccelClosuresMethodInfo
ResolveSwitchMethod "listActionPrefixes" o = Gtk.Widget.WidgetListActionPrefixesMethodInfo
ResolveSwitchMethod "listMnemonicLabels" o = Gtk.Widget.WidgetListMnemonicLabelsMethodInfo
ResolveSwitchMethod "map" o = Gtk.Widget.WidgetMapMethodInfo
ResolveSwitchMethod "measure" o = Gtk.Widget.WidgetMeasureMethodInfo
ResolveSwitchMethod "mnemonicActivate" o = Gtk.Widget.WidgetMnemonicActivateMethodInfo
ResolveSwitchMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSwitchMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSwitchMethod "observeChildren" o = Gtk.Widget.WidgetObserveChildrenMethodInfo
ResolveSwitchMethod "observeControllers" o = Gtk.Widget.WidgetObserveControllersMethodInfo
ResolveSwitchMethod "parserFinished" o = Gtk.Buildable.BuildableParserFinishedMethodInfo
ResolveSwitchMethod "pick" o = Gtk.Widget.WidgetPickMethodInfo
ResolveSwitchMethod "queueAllocate" o = Gtk.Widget.WidgetQueueAllocateMethodInfo
ResolveSwitchMethod "queueComputeExpand" o = Gtk.Widget.WidgetQueueComputeExpandMethodInfo
ResolveSwitchMethod "queueDraw" o = Gtk.Widget.WidgetQueueDrawMethodInfo
ResolveSwitchMethod "queueResize" o = Gtk.Widget.WidgetQueueResizeMethodInfo
ResolveSwitchMethod "queueResizeNoRedraw" o = Gtk.Widget.WidgetQueueResizeNoRedrawMethodInfo
ResolveSwitchMethod "realize" o = Gtk.Widget.WidgetRealizeMethodInfo
ResolveSwitchMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSwitchMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSwitchMethod "registerSurface" o = Gtk.Widget.WidgetRegisterSurfaceMethodInfo
ResolveSwitchMethod "removeAccelerator" o = Gtk.Widget.WidgetRemoveAcceleratorMethodInfo
ResolveSwitchMethod "removeController" o = Gtk.Widget.WidgetRemoveControllerMethodInfo
ResolveSwitchMethod "removeMnemonicLabel" o = Gtk.Widget.WidgetRemoveMnemonicLabelMethodInfo
ResolveSwitchMethod "removeTickCallback" o = Gtk.Widget.WidgetRemoveTickCallbackMethodInfo
ResolveSwitchMethod "resetStyle" o = Gtk.Widget.WidgetResetStyleMethodInfo
ResolveSwitchMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSwitchMethod "show" o = Gtk.Widget.WidgetShowMethodInfo
ResolveSwitchMethod "sizeAllocate" o = Gtk.Widget.WidgetSizeAllocateMethodInfo
ResolveSwitchMethod "snapshotChild" o = Gtk.Widget.WidgetSnapshotChildMethodInfo
ResolveSwitchMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSwitchMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSwitchMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSwitchMethod "translateCoordinates" o = Gtk.Widget.WidgetTranslateCoordinatesMethodInfo
ResolveSwitchMethod "triggerTooltipQuery" o = Gtk.Widget.WidgetTriggerTooltipQueryMethodInfo
ResolveSwitchMethod "unmap" o = Gtk.Widget.WidgetUnmapMethodInfo
ResolveSwitchMethod "unparent" o = Gtk.Widget.WidgetUnparentMethodInfo
ResolveSwitchMethod "unrealize" o = Gtk.Widget.WidgetUnrealizeMethodInfo
ResolveSwitchMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSwitchMethod "unregisterSurface" o = Gtk.Widget.WidgetUnregisterSurfaceMethodInfo
ResolveSwitchMethod "unsetStateFlags" o = Gtk.Widget.WidgetUnsetStateFlagsMethodInfo
ResolveSwitchMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSwitchMethod "getAccessible" o = Gtk.Widget.WidgetGetAccessibleMethodInfo
ResolveSwitchMethod "getActionGroup" o = Gtk.Widget.WidgetGetActionGroupMethodInfo
ResolveSwitchMethod "getActionName" o = Gtk.Actionable.ActionableGetActionNameMethodInfo
ResolveSwitchMethod "getActionTargetValue" o = Gtk.Actionable.ActionableGetActionTargetValueMethodInfo
ResolveSwitchMethod "getActive" o = SwitchGetActiveMethodInfo
ResolveSwitchMethod "getAllocatedBaseline" o = Gtk.Widget.WidgetGetAllocatedBaselineMethodInfo
ResolveSwitchMethod "getAllocatedHeight" o = Gtk.Widget.WidgetGetAllocatedHeightMethodInfo
ResolveSwitchMethod "getAllocatedWidth" o = Gtk.Widget.WidgetGetAllocatedWidthMethodInfo
ResolveSwitchMethod "getAllocation" o = Gtk.Widget.WidgetGetAllocationMethodInfo
ResolveSwitchMethod "getAncestor" o = Gtk.Widget.WidgetGetAncestorMethodInfo
ResolveSwitchMethod "getCanFocus" o = Gtk.Widget.WidgetGetCanFocusMethodInfo
ResolveSwitchMethod "getCanTarget" o = Gtk.Widget.WidgetGetCanTargetMethodInfo
ResolveSwitchMethod "getChildVisible" o = Gtk.Widget.WidgetGetChildVisibleMethodInfo
ResolveSwitchMethod "getClipboard" o = Gtk.Widget.WidgetGetClipboardMethodInfo
ResolveSwitchMethod "getCursor" o = Gtk.Widget.WidgetGetCursorMethodInfo
ResolveSwitchMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSwitchMethod "getDirection" o = Gtk.Widget.WidgetGetDirectionMethodInfo
ResolveSwitchMethod "getDisplay" o = Gtk.Widget.WidgetGetDisplayMethodInfo
ResolveSwitchMethod "getFirstChild" o = Gtk.Widget.WidgetGetFirstChildMethodInfo
ResolveSwitchMethod "getFocusChild" o = Gtk.Widget.WidgetGetFocusChildMethodInfo
ResolveSwitchMethod "getFocusOnClick" o = Gtk.Widget.WidgetGetFocusOnClickMethodInfo
ResolveSwitchMethod "getFontMap" o = Gtk.Widget.WidgetGetFontMapMethodInfo
ResolveSwitchMethod "getFontOptions" o = Gtk.Widget.WidgetGetFontOptionsMethodInfo
ResolveSwitchMethod "getFrameClock" o = Gtk.Widget.WidgetGetFrameClockMethodInfo
ResolveSwitchMethod "getHalign" o = Gtk.Widget.WidgetGetHalignMethodInfo
ResolveSwitchMethod "getHasSurface" o = Gtk.Widget.WidgetGetHasSurfaceMethodInfo
ResolveSwitchMethod "getHasTooltip" o = Gtk.Widget.WidgetGetHasTooltipMethodInfo
ResolveSwitchMethod "getHeight" o = Gtk.Widget.WidgetGetHeightMethodInfo
ResolveSwitchMethod "getHexpand" o = Gtk.Widget.WidgetGetHexpandMethodInfo
ResolveSwitchMethod "getHexpandSet" o = Gtk.Widget.WidgetGetHexpandSetMethodInfo
ResolveSwitchMethod "getInternalChild" o = Gtk.Buildable.BuildableGetInternalChildMethodInfo
ResolveSwitchMethod "getLastChild" o = Gtk.Widget.WidgetGetLastChildMethodInfo
ResolveSwitchMethod "getLayoutManager" o = Gtk.Widget.WidgetGetLayoutManagerMethodInfo
ResolveSwitchMethod "getMapped" o = Gtk.Widget.WidgetGetMappedMethodInfo
ResolveSwitchMethod "getMarginBottom" o = Gtk.Widget.WidgetGetMarginBottomMethodInfo
ResolveSwitchMethod "getMarginEnd" o = Gtk.Widget.WidgetGetMarginEndMethodInfo
ResolveSwitchMethod "getMarginStart" o = Gtk.Widget.WidgetGetMarginStartMethodInfo
ResolveSwitchMethod "getMarginTop" o = Gtk.Widget.WidgetGetMarginTopMethodInfo
ResolveSwitchMethod "getModifierMask" o = Gtk.Widget.WidgetGetModifierMaskMethodInfo
ResolveSwitchMethod "getName" o = Gtk.Widget.WidgetGetNameMethodInfo
ResolveSwitchMethod "getNextSibling" o = Gtk.Widget.WidgetGetNextSiblingMethodInfo
ResolveSwitchMethod "getOpacity" o = Gtk.Widget.WidgetGetOpacityMethodInfo
ResolveSwitchMethod "getOverflow" o = Gtk.Widget.WidgetGetOverflowMethodInfo
ResolveSwitchMethod "getPangoContext" o = Gtk.Widget.WidgetGetPangoContextMethodInfo
ResolveSwitchMethod "getParent" o = Gtk.Widget.WidgetGetParentMethodInfo
ResolveSwitchMethod "getPath" o = Gtk.Widget.WidgetGetPathMethodInfo
ResolveSwitchMethod "getPreferredSize" o = Gtk.Widget.WidgetGetPreferredSizeMethodInfo
ResolveSwitchMethod "getPrevSibling" o = Gtk.Widget.WidgetGetPrevSiblingMethodInfo
ResolveSwitchMethod "getPrimaryClipboard" o = Gtk.Widget.WidgetGetPrimaryClipboardMethodInfo
ResolveSwitchMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSwitchMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSwitchMethod "getRealized" o = Gtk.Widget.WidgetGetRealizedMethodInfo
ResolveSwitchMethod "getReceivesDefault" o = Gtk.Widget.WidgetGetReceivesDefaultMethodInfo
ResolveSwitchMethod "getRequestMode" o = Gtk.Widget.WidgetGetRequestModeMethodInfo
ResolveSwitchMethod "getRoot" o = Gtk.Widget.WidgetGetRootMethodInfo
ResolveSwitchMethod "getScaleFactor" o = Gtk.Widget.WidgetGetScaleFactorMethodInfo
ResolveSwitchMethod "getSensitive" o = Gtk.Widget.WidgetGetSensitiveMethodInfo
ResolveSwitchMethod "getSettings" o = Gtk.Widget.WidgetGetSettingsMethodInfo
ResolveSwitchMethod "getSizeRequest" o = Gtk.Widget.WidgetGetSizeRequestMethodInfo
ResolveSwitchMethod "getState" o = SwitchGetStateMethodInfo
ResolveSwitchMethod "getStateFlags" o = Gtk.Widget.WidgetGetStateFlagsMethodInfo
ResolveSwitchMethod "getStyleContext" o = Gtk.Widget.WidgetGetStyleContextMethodInfo
ResolveSwitchMethod "getSupportMultidevice" o = Gtk.Widget.WidgetGetSupportMultideviceMethodInfo
ResolveSwitchMethod "getSurface" o = Gtk.Widget.WidgetGetSurfaceMethodInfo
ResolveSwitchMethod "getTemplateChild" o = Gtk.Widget.WidgetGetTemplateChildMethodInfo
ResolveSwitchMethod "getTooltipMarkup" o = Gtk.Widget.WidgetGetTooltipMarkupMethodInfo
ResolveSwitchMethod "getTooltipText" o = Gtk.Widget.WidgetGetTooltipTextMethodInfo
ResolveSwitchMethod "getTooltipWindow" o = Gtk.Widget.WidgetGetTooltipWindowMethodInfo
ResolveSwitchMethod "getToplevel" o = Gtk.Widget.WidgetGetToplevelMethodInfo
ResolveSwitchMethod "getValign" o = Gtk.Widget.WidgetGetValignMethodInfo
ResolveSwitchMethod "getVexpand" o = Gtk.Widget.WidgetGetVexpandMethodInfo
ResolveSwitchMethod "getVexpandSet" o = Gtk.Widget.WidgetGetVexpandSetMethodInfo
ResolveSwitchMethod "getVisible" o = Gtk.Widget.WidgetGetVisibleMethodInfo
ResolveSwitchMethod "getWidth" o = Gtk.Widget.WidgetGetWidthMethodInfo
ResolveSwitchMethod "setAccelPath" o = Gtk.Widget.WidgetSetAccelPathMethodInfo
ResolveSwitchMethod "setActionName" o = Gtk.Actionable.ActionableSetActionNameMethodInfo
ResolveSwitchMethod "setActionTargetValue" o = Gtk.Actionable.ActionableSetActionTargetValueMethodInfo
ResolveSwitchMethod "setActive" o = SwitchSetActiveMethodInfo
ResolveSwitchMethod "setBuildableProperty" o = Gtk.Buildable.BuildableSetBuildablePropertyMethodInfo
ResolveSwitchMethod "setCanFocus" o = Gtk.Widget.WidgetSetCanFocusMethodInfo
ResolveSwitchMethod "setCanTarget" o = Gtk.Widget.WidgetSetCanTargetMethodInfo
ResolveSwitchMethod "setChildVisible" o = Gtk.Widget.WidgetSetChildVisibleMethodInfo
ResolveSwitchMethod "setCursor" o = Gtk.Widget.WidgetSetCursorMethodInfo
ResolveSwitchMethod "setCursorFromName" o = Gtk.Widget.WidgetSetCursorFromNameMethodInfo
ResolveSwitchMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSwitchMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSwitchMethod "setDetailedActionName" o = Gtk.Actionable.ActionableSetDetailedActionNameMethodInfo
ResolveSwitchMethod "setDirection" o = Gtk.Widget.WidgetSetDirectionMethodInfo
ResolveSwitchMethod "setFocusChild" o = Gtk.Widget.WidgetSetFocusChildMethodInfo
ResolveSwitchMethod "setFocusOnClick" o = Gtk.Widget.WidgetSetFocusOnClickMethodInfo
ResolveSwitchMethod "setFontMap" o = Gtk.Widget.WidgetSetFontMapMethodInfo
ResolveSwitchMethod "setFontOptions" o = Gtk.Widget.WidgetSetFontOptionsMethodInfo
ResolveSwitchMethod "setHalign" o = Gtk.Widget.WidgetSetHalignMethodInfo
ResolveSwitchMethod "setHasSurface" o = Gtk.Widget.WidgetSetHasSurfaceMethodInfo
ResolveSwitchMethod "setHasTooltip" o = Gtk.Widget.WidgetSetHasTooltipMethodInfo
ResolveSwitchMethod "setHexpand" o = Gtk.Widget.WidgetSetHexpandMethodInfo
ResolveSwitchMethod "setHexpandSet" o = Gtk.Widget.WidgetSetHexpandSetMethodInfo
ResolveSwitchMethod "setLayoutManager" o = Gtk.Widget.WidgetSetLayoutManagerMethodInfo
ResolveSwitchMethod "setMarginBottom" o = Gtk.Widget.WidgetSetMarginBottomMethodInfo
ResolveSwitchMethod "setMarginEnd" o = Gtk.Widget.WidgetSetMarginEndMethodInfo
ResolveSwitchMethod "setMarginStart" o = Gtk.Widget.WidgetSetMarginStartMethodInfo
ResolveSwitchMethod "setMarginTop" o = Gtk.Widget.WidgetSetMarginTopMethodInfo
ResolveSwitchMethod "setName" o = Gtk.Widget.WidgetSetNameMethodInfo
ResolveSwitchMethod "setOpacity" o = Gtk.Widget.WidgetSetOpacityMethodInfo
ResolveSwitchMethod "setOverflow" o = Gtk.Widget.WidgetSetOverflowMethodInfo
ResolveSwitchMethod "setParent" o = Gtk.Widget.WidgetSetParentMethodInfo
ResolveSwitchMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSwitchMethod "setReceivesDefault" o = Gtk.Widget.WidgetSetReceivesDefaultMethodInfo
ResolveSwitchMethod "setSensitive" o = Gtk.Widget.WidgetSetSensitiveMethodInfo
ResolveSwitchMethod "setSizeRequest" o = Gtk.Widget.WidgetSetSizeRequestMethodInfo
ResolveSwitchMethod "setState" o = SwitchSetStateMethodInfo
ResolveSwitchMethod "setStateFlags" o = Gtk.Widget.WidgetSetStateFlagsMethodInfo
ResolveSwitchMethod "setSupportMultidevice" o = Gtk.Widget.WidgetSetSupportMultideviceMethodInfo
ResolveSwitchMethod "setSurface" o = Gtk.Widget.WidgetSetSurfaceMethodInfo
ResolveSwitchMethod "setTooltipMarkup" o = Gtk.Widget.WidgetSetTooltipMarkupMethodInfo
ResolveSwitchMethod "setTooltipText" o = Gtk.Widget.WidgetSetTooltipTextMethodInfo
ResolveSwitchMethod "setTooltipWindow" o = Gtk.Widget.WidgetSetTooltipWindowMethodInfo
ResolveSwitchMethod "setValign" o = Gtk.Widget.WidgetSetValignMethodInfo
ResolveSwitchMethod "setVexpand" o = Gtk.Widget.WidgetSetVexpandMethodInfo
ResolveSwitchMethod "setVexpandSet" o = Gtk.Widget.WidgetSetVexpandSetMethodInfo
ResolveSwitchMethod "setVisible" o = Gtk.Widget.WidgetSetVisibleMethodInfo
ResolveSwitchMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSwitchMethod t Switch, O.MethodInfo info Switch p) => OL.IsLabel t (Switch -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type SwitchActivateCallback =
IO ()
noSwitchActivateCallback :: Maybe SwitchActivateCallback
noSwitchActivateCallback :: Maybe (IO ())
noSwitchActivateCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_SwitchActivateCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SwitchActivateCallback :: C_SwitchActivateCallback -> IO (FunPtr C_SwitchActivateCallback)
genClosure_SwitchActivate :: MonadIO m => SwitchActivateCallback -> m (GClosure C_SwitchActivateCallback)
genClosure_SwitchActivate :: IO () -> m (GClosure C_SwitchActivateCallback)
genClosure_SwitchActivate cb :: IO ()
cb = IO (GClosure C_SwitchActivateCallback)
-> m (GClosure C_SwitchActivateCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SwitchActivateCallback)
-> m (GClosure C_SwitchActivateCallback))
-> IO (GClosure C_SwitchActivateCallback)
-> m (GClosure C_SwitchActivateCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SwitchActivateCallback
cb' = IO () -> C_SwitchActivateCallback
wrap_SwitchActivateCallback IO ()
cb
C_SwitchActivateCallback -> IO (FunPtr C_SwitchActivateCallback)
mk_SwitchActivateCallback C_SwitchActivateCallback
cb' IO (FunPtr C_SwitchActivateCallback)
-> (FunPtr C_SwitchActivateCallback
-> IO (GClosure C_SwitchActivateCallback))
-> IO (GClosure C_SwitchActivateCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SwitchActivateCallback
-> IO (GClosure C_SwitchActivateCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SwitchActivateCallback ::
SwitchActivateCallback ->
C_SwitchActivateCallback
wrap_SwitchActivateCallback :: IO () -> C_SwitchActivateCallback
wrap_SwitchActivateCallback _cb :: IO ()
_cb _ _ = do
IO ()
_cb
onSwitchActivate :: (IsSwitch a, MonadIO m) => a -> SwitchActivateCallback -> m SignalHandlerId
onSwitchActivate :: a -> IO () -> m SignalHandlerId
onSwitchActivate 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_SwitchActivateCallback
cb' = IO () -> C_SwitchActivateCallback
wrap_SwitchActivateCallback IO ()
cb
FunPtr C_SwitchActivateCallback
cb'' <- C_SwitchActivateCallback -> IO (FunPtr C_SwitchActivateCallback)
mk_SwitchActivateCallback C_SwitchActivateCallback
cb'
a
-> Text
-> FunPtr C_SwitchActivateCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "activate" FunPtr C_SwitchActivateCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSwitchActivate :: (IsSwitch a, MonadIO m) => a -> SwitchActivateCallback -> m SignalHandlerId
afterSwitchActivate :: a -> IO () -> m SignalHandlerId
afterSwitchActivate 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_SwitchActivateCallback
cb' = IO () -> C_SwitchActivateCallback
wrap_SwitchActivateCallback IO ()
cb
FunPtr C_SwitchActivateCallback
cb'' <- C_SwitchActivateCallback -> IO (FunPtr C_SwitchActivateCallback)
mk_SwitchActivateCallback C_SwitchActivateCallback
cb'
a
-> Text
-> FunPtr C_SwitchActivateCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "activate" FunPtr C_SwitchActivateCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SwitchActivateSignalInfo
instance SignalInfo SwitchActivateSignalInfo where
type HaskellCallbackType SwitchActivateSignalInfo = SwitchActivateCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SwitchActivateCallback cb
cb'' <- mk_SwitchActivateCallback cb'
connectSignalFunPtr obj "activate" cb'' connectMode detail
#endif
type SwitchStateSetCallback =
Bool
-> IO Bool
noSwitchStateSetCallback :: Maybe SwitchStateSetCallback
noSwitchStateSetCallback :: Maybe SwitchStateSetCallback
noSwitchStateSetCallback = Maybe SwitchStateSetCallback
forall a. Maybe a
Nothing
type C_SwitchStateSetCallback =
Ptr () ->
CInt ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_SwitchStateSetCallback :: C_SwitchStateSetCallback -> IO (FunPtr C_SwitchStateSetCallback)
genClosure_SwitchStateSet :: MonadIO m => SwitchStateSetCallback -> m (GClosure C_SwitchStateSetCallback)
genClosure_SwitchStateSet :: SwitchStateSetCallback -> m (GClosure C_SwitchStateSetCallback)
genClosure_SwitchStateSet cb :: SwitchStateSetCallback
cb = IO (GClosure C_SwitchStateSetCallback)
-> m (GClosure C_SwitchStateSetCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SwitchStateSetCallback)
-> m (GClosure C_SwitchStateSetCallback))
-> IO (GClosure C_SwitchStateSetCallback)
-> m (GClosure C_SwitchStateSetCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SwitchStateSetCallback
cb' = SwitchStateSetCallback -> C_SwitchStateSetCallback
wrap_SwitchStateSetCallback SwitchStateSetCallback
cb
C_SwitchStateSetCallback -> IO (FunPtr C_SwitchStateSetCallback)
mk_SwitchStateSetCallback C_SwitchStateSetCallback
cb' IO (FunPtr C_SwitchStateSetCallback)
-> (FunPtr C_SwitchStateSetCallback
-> IO (GClosure C_SwitchStateSetCallback))
-> IO (GClosure C_SwitchStateSetCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SwitchStateSetCallback
-> IO (GClosure C_SwitchStateSetCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SwitchStateSetCallback ::
SwitchStateSetCallback ->
C_SwitchStateSetCallback
wrap_SwitchStateSetCallback :: SwitchStateSetCallback -> C_SwitchStateSetCallback
wrap_SwitchStateSetCallback _cb :: SwitchStateSetCallback
_cb _ state :: CInt
state _ = do
let state' :: Bool
state' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
state
Bool
result <- SwitchStateSetCallback
_cb Bool
state'
let result' :: CInt
result' = (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
result
CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
onSwitchStateSet :: (IsSwitch a, MonadIO m) => a -> SwitchStateSetCallback -> m SignalHandlerId
onSwitchStateSet :: a -> SwitchStateSetCallback -> m SignalHandlerId
onSwitchStateSet obj :: a
obj cb :: SwitchStateSetCallback
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_SwitchStateSetCallback
cb' = SwitchStateSetCallback -> C_SwitchStateSetCallback
wrap_SwitchStateSetCallback SwitchStateSetCallback
cb
FunPtr C_SwitchStateSetCallback
cb'' <- C_SwitchStateSetCallback -> IO (FunPtr C_SwitchStateSetCallback)
mk_SwitchStateSetCallback C_SwitchStateSetCallback
cb'
a
-> Text
-> FunPtr C_SwitchStateSetCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "state-set" FunPtr C_SwitchStateSetCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSwitchStateSet :: (IsSwitch a, MonadIO m) => a -> SwitchStateSetCallback -> m SignalHandlerId
afterSwitchStateSet :: a -> SwitchStateSetCallback -> m SignalHandlerId
afterSwitchStateSet obj :: a
obj cb :: SwitchStateSetCallback
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_SwitchStateSetCallback
cb' = SwitchStateSetCallback -> C_SwitchStateSetCallback
wrap_SwitchStateSetCallback SwitchStateSetCallback
cb
FunPtr C_SwitchStateSetCallback
cb'' <- C_SwitchStateSetCallback -> IO (FunPtr C_SwitchStateSetCallback)
mk_SwitchStateSetCallback C_SwitchStateSetCallback
cb'
a
-> Text
-> FunPtr C_SwitchStateSetCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "state-set" FunPtr C_SwitchStateSetCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SwitchStateSetSignalInfo
instance SignalInfo SwitchStateSetSignalInfo where
type HaskellCallbackType SwitchStateSetSignalInfo = SwitchStateSetCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SwitchStateSetCallback cb
cb'' <- mk_SwitchStateSetCallback cb'
connectSignalFunPtr obj "state-set" cb'' connectMode detail
#endif
getSwitchActive :: (MonadIO m, IsSwitch o) => o -> m Bool
getSwitchActive :: o -> m Bool
getSwitchActive 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"
setSwitchActive :: (MonadIO m, IsSwitch o) => o -> Bool -> m ()
setSwitchActive :: o -> Bool -> m ()
setSwitchActive 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
constructSwitchActive :: (IsSwitch o) => Bool -> IO (GValueConstruct o)
constructSwitchActive :: Bool -> IO (GValueConstruct o)
constructSwitchActive 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 SwitchActivePropertyInfo
instance AttrInfo SwitchActivePropertyInfo where
type AttrAllowedOps SwitchActivePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SwitchActivePropertyInfo = IsSwitch
type AttrSetTypeConstraint SwitchActivePropertyInfo = (~) Bool
type AttrTransferTypeConstraint SwitchActivePropertyInfo = (~) Bool
type AttrTransferType SwitchActivePropertyInfo = Bool
type AttrGetType SwitchActivePropertyInfo = Bool
type AttrLabel SwitchActivePropertyInfo = "active"
type AttrOrigin SwitchActivePropertyInfo = Switch
attrGet = getSwitchActive
attrSet = setSwitchActive
attrTransfer _ v = do
return v
attrConstruct = constructSwitchActive
attrClear = undefined
#endif
getSwitchState :: (MonadIO m, IsSwitch o) => o -> m Bool
getSwitchState :: o -> m Bool
getSwitchState 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 "state"
setSwitchState :: (MonadIO m, IsSwitch o) => o -> Bool -> m ()
setSwitchState :: o -> Bool -> m ()
setSwitchState 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 "state" Bool
val
constructSwitchState :: (IsSwitch o) => Bool -> IO (GValueConstruct o)
constructSwitchState :: Bool -> IO (GValueConstruct o)
constructSwitchState val :: Bool
val = String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool "state" Bool
val
#if defined(ENABLE_OVERLOADING)
data SwitchStatePropertyInfo
instance AttrInfo SwitchStatePropertyInfo where
type AttrAllowedOps SwitchStatePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SwitchStatePropertyInfo = IsSwitch
type AttrSetTypeConstraint SwitchStatePropertyInfo = (~) Bool
type AttrTransferTypeConstraint SwitchStatePropertyInfo = (~) Bool
type AttrTransferType SwitchStatePropertyInfo = Bool
type AttrGetType SwitchStatePropertyInfo = Bool
type AttrLabel SwitchStatePropertyInfo = "state"
type AttrOrigin SwitchStatePropertyInfo = Switch
attrGet = getSwitchState
attrSet = setSwitchState
attrTransfer _ v = do
return v
attrConstruct = constructSwitchState
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Switch
type instance O.AttributeList Switch = SwitchAttributeList
type SwitchAttributeList = ('[ '("actionName", Gtk.Actionable.ActionableActionNamePropertyInfo), '("actionTarget", Gtk.Actionable.ActionableActionTargetPropertyInfo), '("active", SwitchActivePropertyInfo), '("canFocus", Gtk.Widget.WidgetCanFocusPropertyInfo), '("canTarget", Gtk.Widget.WidgetCanTargetPropertyInfo), '("cssName", Gtk.Widget.WidgetCssNamePropertyInfo), '("cursor", Gtk.Widget.WidgetCursorPropertyInfo), '("expand", Gtk.Widget.WidgetExpandPropertyInfo), '("focusOnClick", Gtk.Widget.WidgetFocusOnClickPropertyInfo), '("halign", Gtk.Widget.WidgetHalignPropertyInfo), '("hasDefault", Gtk.Widget.WidgetHasDefaultPropertyInfo), '("hasFocus", Gtk.Widget.WidgetHasFocusPropertyInfo), '("hasTooltip", Gtk.Widget.WidgetHasTooltipPropertyInfo), '("heightRequest", Gtk.Widget.WidgetHeightRequestPropertyInfo), '("hexpand", Gtk.Widget.WidgetHexpandPropertyInfo), '("hexpandSet", Gtk.Widget.WidgetHexpandSetPropertyInfo), '("isFocus", Gtk.Widget.WidgetIsFocusPropertyInfo), '("layoutManager", Gtk.Widget.WidgetLayoutManagerPropertyInfo), '("margin", Gtk.Widget.WidgetMarginPropertyInfo), '("marginBottom", Gtk.Widget.WidgetMarginBottomPropertyInfo), '("marginEnd", Gtk.Widget.WidgetMarginEndPropertyInfo), '("marginStart", Gtk.Widget.WidgetMarginStartPropertyInfo), '("marginTop", Gtk.Widget.WidgetMarginTopPropertyInfo), '("name", Gtk.Widget.WidgetNamePropertyInfo), '("opacity", Gtk.Widget.WidgetOpacityPropertyInfo), '("overflow", Gtk.Widget.WidgetOverflowPropertyInfo), '("parent", Gtk.Widget.WidgetParentPropertyInfo), '("receivesDefault", Gtk.Widget.WidgetReceivesDefaultPropertyInfo), '("root", Gtk.Widget.WidgetRootPropertyInfo), '("scaleFactor", Gtk.Widget.WidgetScaleFactorPropertyInfo), '("sensitive", Gtk.Widget.WidgetSensitivePropertyInfo), '("state", SwitchStatePropertyInfo), '("surface", Gtk.Widget.WidgetSurfacePropertyInfo), '("tooltipMarkup", Gtk.Widget.WidgetTooltipMarkupPropertyInfo), '("tooltipText", Gtk.Widget.WidgetTooltipTextPropertyInfo), '("valign", Gtk.Widget.WidgetValignPropertyInfo), '("vexpand", Gtk.Widget.WidgetVexpandPropertyInfo), '("vexpandSet", Gtk.Widget.WidgetVexpandSetPropertyInfo), '("visible", Gtk.Widget.WidgetVisiblePropertyInfo), '("widthRequest", Gtk.Widget.WidgetWidthRequestPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
switchActive :: AttrLabelProxy "active"
switchActive = AttrLabelProxy
switchState :: AttrLabelProxy "state"
switchState = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Switch = SwitchSignalList
type SwitchSignalList = ('[ '("accelClosuresChanged", Gtk.Widget.WidgetAccelClosuresChangedSignalInfo), '("activate", SwitchActivateSignalInfo), '("canActivateAccel", Gtk.Widget.WidgetCanActivateAccelSignalInfo), '("destroy", Gtk.Widget.WidgetDestroySignalInfo), '("directionChanged", Gtk.Widget.WidgetDirectionChangedSignalInfo), '("dragBegin", Gtk.Widget.WidgetDragBeginSignalInfo), '("dragDataDelete", Gtk.Widget.WidgetDragDataDeleteSignalInfo), '("dragDataGet", Gtk.Widget.WidgetDragDataGetSignalInfo), '("dragDataReceived", Gtk.Widget.WidgetDragDataReceivedSignalInfo), '("dragDrop", Gtk.Widget.WidgetDragDropSignalInfo), '("dragEnd", Gtk.Widget.WidgetDragEndSignalInfo), '("dragFailed", Gtk.Widget.WidgetDragFailedSignalInfo), '("dragLeave", Gtk.Widget.WidgetDragLeaveSignalInfo), '("dragMotion", Gtk.Widget.WidgetDragMotionSignalInfo), '("grabNotify", Gtk.Widget.WidgetGrabNotifySignalInfo), '("hide", Gtk.Widget.WidgetHideSignalInfo), '("keynavFailed", Gtk.Widget.WidgetKeynavFailedSignalInfo), '("map", Gtk.Widget.WidgetMapSignalInfo), '("mnemonicActivate", Gtk.Widget.WidgetMnemonicActivateSignalInfo), '("moveFocus", Gtk.Widget.WidgetMoveFocusSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("popupMenu", Gtk.Widget.WidgetPopupMenuSignalInfo), '("queryTooltip", Gtk.Widget.WidgetQueryTooltipSignalInfo), '("realize", Gtk.Widget.WidgetRealizeSignalInfo), '("show", Gtk.Widget.WidgetShowSignalInfo), '("sizeAllocate", Gtk.Widget.WidgetSizeAllocateSignalInfo), '("stateFlagsChanged", Gtk.Widget.WidgetStateFlagsChangedSignalInfo), '("stateSet", SwitchStateSetSignalInfo), '("styleUpdated", Gtk.Widget.WidgetStyleUpdatedSignalInfo), '("unmap", Gtk.Widget.WidgetUnmapSignalInfo), '("unrealize", Gtk.Widget.WidgetUnrealizeSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_switch_new" gtk_switch_new ::
IO (Ptr Switch)
switchNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Switch
switchNew :: m Switch
switchNew = IO Switch -> m Switch
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Switch -> m Switch) -> IO Switch -> m Switch
forall a b. (a -> b) -> a -> b
$ do
Ptr Switch
result <- IO (Ptr Switch)
gtk_switch_new
Text -> Ptr Switch -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "switchNew" Ptr Switch
result
Switch
result' <- ((ManagedPtr Switch -> Switch) -> Ptr Switch -> IO Switch
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Switch -> Switch
Switch) Ptr Switch
result
Switch -> IO Switch
forall (m :: * -> *) a. Monad m => a -> m a
return Switch
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_switch_get_active" gtk_switch_get_active ::
Ptr Switch ->
IO CInt
switchGetActive ::
(B.CallStack.HasCallStack, MonadIO m, IsSwitch a) =>
a
-> m Bool
switchGetActive :: a -> m Bool
switchGetActive sw :: a
sw = 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 Switch
sw' <- a -> IO (Ptr Switch)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sw
CInt
result <- Ptr Switch -> IO CInt
gtk_switch_get_active Ptr Switch
sw'
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
sw
SwitchStateSetCallback
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data SwitchGetActiveMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSwitch a) => O.MethodInfo SwitchGetActiveMethodInfo a signature where
overloadedMethod = switchGetActive
#endif
foreign import ccall "gtk_switch_get_state" gtk_switch_get_state ::
Ptr Switch ->
IO CInt
switchGetState ::
(B.CallStack.HasCallStack, MonadIO m, IsSwitch a) =>
a
-> m Bool
switchGetState :: a -> m Bool
switchGetState sw :: a
sw = 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 Switch
sw' <- a -> IO (Ptr Switch)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sw
CInt
result <- Ptr Switch -> IO CInt
gtk_switch_get_state Ptr Switch
sw'
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
sw
SwitchStateSetCallback
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data SwitchGetStateMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSwitch a) => O.MethodInfo SwitchGetStateMethodInfo a signature where
overloadedMethod = switchGetState
#endif
foreign import ccall "gtk_switch_set_active" gtk_switch_set_active ::
Ptr Switch ->
CInt ->
IO ()
switchSetActive ::
(B.CallStack.HasCallStack, MonadIO m, IsSwitch a) =>
a
-> Bool
-> m ()
switchSetActive :: a -> Bool -> m ()
switchSetActive sw :: a
sw 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 Switch
sw' <- a -> IO (Ptr Switch)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sw
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 Switch -> CInt -> IO ()
gtk_switch_set_active Ptr Switch
sw' CInt
isActive'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
sw
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SwitchSetActiveMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSwitch a) => O.MethodInfo SwitchSetActiveMethodInfo a signature where
overloadedMethod = switchSetActive
#endif
foreign import ccall "gtk_switch_set_state" gtk_switch_set_state ::
Ptr Switch ->
CInt ->
IO ()
switchSetState ::
(B.CallStack.HasCallStack, MonadIO m, IsSwitch a) =>
a
-> Bool
-> m ()
switchSetState :: a -> Bool -> m ()
switchSetState sw :: a
sw state :: Bool
state = 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 Switch
sw' <- a -> IO (Ptr Switch)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sw
let state' :: CInt
state' = (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
state
Ptr Switch -> CInt -> IO ()
gtk_switch_set_state Ptr Switch
sw' CInt
state'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
sw
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SwitchSetStateMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSwitch a) => O.MethodInfo SwitchSetStateMethodInfo a signature where
overloadedMethod = switchSetState
#endif