gi-gtk-0.3.18.12: GI/Gtk/Objects/ProgressBar.hs
{- |
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.ProgressBar
(
-- * Exported types
ProgressBar(..) ,
ProgressBarK ,
toProgressBar ,
noProgressBar ,
-- * Methods
-- ** progressBarGetEllipsize
progressBarGetEllipsize ,
-- ** progressBarGetFraction
progressBarGetFraction ,
-- ** progressBarGetInverted
progressBarGetInverted ,
-- ** progressBarGetPulseStep
progressBarGetPulseStep ,
-- ** progressBarGetShowText
progressBarGetShowText ,
-- ** progressBarGetText
progressBarGetText ,
-- ** progressBarNew
progressBarNew ,
-- ** progressBarPulse
progressBarPulse ,
-- ** progressBarSetEllipsize
progressBarSetEllipsize ,
-- ** progressBarSetFraction
progressBarSetFraction ,
-- ** progressBarSetInverted
progressBarSetInverted ,
-- ** progressBarSetPulseStep
progressBarSetPulseStep ,
-- ** progressBarSetShowText
progressBarSetShowText ,
-- ** progressBarSetText
progressBarSetText ,
-- * Properties
-- ** Ellipsize
ProgressBarEllipsizePropertyInfo ,
constructProgressBarEllipsize ,
getProgressBarEllipsize ,
setProgressBarEllipsize ,
-- ** Fraction
ProgressBarFractionPropertyInfo ,
constructProgressBarFraction ,
getProgressBarFraction ,
setProgressBarFraction ,
-- ** Inverted
ProgressBarInvertedPropertyInfo ,
constructProgressBarInverted ,
getProgressBarInverted ,
setProgressBarInverted ,
-- ** PulseStep
ProgressBarPulseStepPropertyInfo ,
constructProgressBarPulseStep ,
getProgressBarPulseStep ,
setProgressBarPulseStep ,
-- ** ShowText
ProgressBarShowTextPropertyInfo ,
constructProgressBarShowText ,
getProgressBarShowText ,
setProgressBarShowText ,
-- ** Text
ProgressBarTextPropertyInfo ,
constructProgressBarText ,
getProgressBarText ,
setProgressBarText ,
) 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
import qualified GI.Pango as Pango
newtype ProgressBar = ProgressBar (ForeignPtr ProgressBar)
foreign import ccall "gtk_progress_bar_get_type"
c_gtk_progress_bar_get_type :: IO GType
type instance ParentTypes ProgressBar = ProgressBarParentTypes
type ProgressBarParentTypes = '[Widget, GObject.Object, Atk.ImplementorIface, Buildable, Orientable]
instance GObject ProgressBar where
gobjectIsInitiallyUnowned _ = True
gobjectType _ = c_gtk_progress_bar_get_type
class GObject o => ProgressBarK o
instance (GObject o, IsDescendantOf ProgressBar o) => ProgressBarK o
toProgressBar :: ProgressBarK o => o -> IO ProgressBar
toProgressBar = unsafeCastTo ProgressBar
noProgressBar :: Maybe ProgressBar
noProgressBar = Nothing
-- VVV Prop "ellipsize"
-- Type: TInterface "Pango" "EllipsizeMode"
-- Flags: [PropertyReadable,PropertyWritable]
getProgressBarEllipsize :: (MonadIO m, ProgressBarK o) => o -> m Pango.EllipsizeMode
getProgressBarEllipsize obj = liftIO $ getObjectPropertyEnum obj "ellipsize"
setProgressBarEllipsize :: (MonadIO m, ProgressBarK o) => o -> Pango.EllipsizeMode -> m ()
setProgressBarEllipsize obj val = liftIO $ setObjectPropertyEnum obj "ellipsize" val
constructProgressBarEllipsize :: Pango.EllipsizeMode -> IO ([Char], GValue)
constructProgressBarEllipsize val = constructObjectPropertyEnum "ellipsize" val
data ProgressBarEllipsizePropertyInfo
instance AttrInfo ProgressBarEllipsizePropertyInfo where
type AttrAllowedOps ProgressBarEllipsizePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProgressBarEllipsizePropertyInfo = (~) Pango.EllipsizeMode
type AttrBaseTypeConstraint ProgressBarEllipsizePropertyInfo = ProgressBarK
type AttrGetType ProgressBarEllipsizePropertyInfo = Pango.EllipsizeMode
type AttrLabel ProgressBarEllipsizePropertyInfo = "ProgressBar::ellipsize"
attrGet _ = getProgressBarEllipsize
attrSet _ = setProgressBarEllipsize
attrConstruct _ = constructProgressBarEllipsize
-- VVV Prop "fraction"
-- Type: TBasicType TDouble
-- Flags: [PropertyReadable,PropertyWritable]
getProgressBarFraction :: (MonadIO m, ProgressBarK o) => o -> m Double
getProgressBarFraction obj = liftIO $ getObjectPropertyDouble obj "fraction"
setProgressBarFraction :: (MonadIO m, ProgressBarK o) => o -> Double -> m ()
setProgressBarFraction obj val = liftIO $ setObjectPropertyDouble obj "fraction" val
constructProgressBarFraction :: Double -> IO ([Char], GValue)
constructProgressBarFraction val = constructObjectPropertyDouble "fraction" val
data ProgressBarFractionPropertyInfo
instance AttrInfo ProgressBarFractionPropertyInfo where
type AttrAllowedOps ProgressBarFractionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProgressBarFractionPropertyInfo = (~) Double
type AttrBaseTypeConstraint ProgressBarFractionPropertyInfo = ProgressBarK
type AttrGetType ProgressBarFractionPropertyInfo = Double
type AttrLabel ProgressBarFractionPropertyInfo = "ProgressBar::fraction"
attrGet _ = getProgressBarFraction
attrSet _ = setProgressBarFraction
attrConstruct _ = constructProgressBarFraction
-- VVV Prop "inverted"
-- Type: TBasicType TBoolean
-- Flags: [PropertyReadable,PropertyWritable]
getProgressBarInverted :: (MonadIO m, ProgressBarK o) => o -> m Bool
getProgressBarInverted obj = liftIO $ getObjectPropertyBool obj "inverted"
setProgressBarInverted :: (MonadIO m, ProgressBarK o) => o -> Bool -> m ()
setProgressBarInverted obj val = liftIO $ setObjectPropertyBool obj "inverted" val
constructProgressBarInverted :: Bool -> IO ([Char], GValue)
constructProgressBarInverted val = constructObjectPropertyBool "inverted" val
data ProgressBarInvertedPropertyInfo
instance AttrInfo ProgressBarInvertedPropertyInfo where
type AttrAllowedOps ProgressBarInvertedPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProgressBarInvertedPropertyInfo = (~) Bool
type AttrBaseTypeConstraint ProgressBarInvertedPropertyInfo = ProgressBarK
type AttrGetType ProgressBarInvertedPropertyInfo = Bool
type AttrLabel ProgressBarInvertedPropertyInfo = "ProgressBar::inverted"
attrGet _ = getProgressBarInverted
attrSet _ = setProgressBarInverted
attrConstruct _ = constructProgressBarInverted
-- VVV Prop "pulse-step"
-- Type: TBasicType TDouble
-- Flags: [PropertyReadable,PropertyWritable]
getProgressBarPulseStep :: (MonadIO m, ProgressBarK o) => o -> m Double
getProgressBarPulseStep obj = liftIO $ getObjectPropertyDouble obj "pulse-step"
setProgressBarPulseStep :: (MonadIO m, ProgressBarK o) => o -> Double -> m ()
setProgressBarPulseStep obj val = liftIO $ setObjectPropertyDouble obj "pulse-step" val
constructProgressBarPulseStep :: Double -> IO ([Char], GValue)
constructProgressBarPulseStep val = constructObjectPropertyDouble "pulse-step" val
data ProgressBarPulseStepPropertyInfo
instance AttrInfo ProgressBarPulseStepPropertyInfo where
type AttrAllowedOps ProgressBarPulseStepPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProgressBarPulseStepPropertyInfo = (~) Double
type AttrBaseTypeConstraint ProgressBarPulseStepPropertyInfo = ProgressBarK
type AttrGetType ProgressBarPulseStepPropertyInfo = Double
type AttrLabel ProgressBarPulseStepPropertyInfo = "ProgressBar::pulse-step"
attrGet _ = getProgressBarPulseStep
attrSet _ = setProgressBarPulseStep
attrConstruct _ = constructProgressBarPulseStep
-- VVV Prop "show-text"
-- Type: TBasicType TBoolean
-- Flags: [PropertyReadable,PropertyWritable]
getProgressBarShowText :: (MonadIO m, ProgressBarK o) => o -> m Bool
getProgressBarShowText obj = liftIO $ getObjectPropertyBool obj "show-text"
setProgressBarShowText :: (MonadIO m, ProgressBarK o) => o -> Bool -> m ()
setProgressBarShowText obj val = liftIO $ setObjectPropertyBool obj "show-text" val
constructProgressBarShowText :: Bool -> IO ([Char], GValue)
constructProgressBarShowText val = constructObjectPropertyBool "show-text" val
data ProgressBarShowTextPropertyInfo
instance AttrInfo ProgressBarShowTextPropertyInfo where
type AttrAllowedOps ProgressBarShowTextPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProgressBarShowTextPropertyInfo = (~) Bool
type AttrBaseTypeConstraint ProgressBarShowTextPropertyInfo = ProgressBarK
type AttrGetType ProgressBarShowTextPropertyInfo = Bool
type AttrLabel ProgressBarShowTextPropertyInfo = "ProgressBar::show-text"
attrGet _ = getProgressBarShowText
attrSet _ = setProgressBarShowText
attrConstruct _ = constructProgressBarShowText
-- VVV Prop "text"
-- Type: TBasicType TUTF8
-- Flags: [PropertyReadable,PropertyWritable]
getProgressBarText :: (MonadIO m, ProgressBarK o) => o -> m T.Text
getProgressBarText obj = liftIO $ getObjectPropertyString obj "text"
setProgressBarText :: (MonadIO m, ProgressBarK o) => o -> T.Text -> m ()
setProgressBarText obj val = liftIO $ setObjectPropertyString obj "text" val
constructProgressBarText :: T.Text -> IO ([Char], GValue)
constructProgressBarText val = constructObjectPropertyString "text" val
data ProgressBarTextPropertyInfo
instance AttrInfo ProgressBarTextPropertyInfo where
type AttrAllowedOps ProgressBarTextPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProgressBarTextPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint ProgressBarTextPropertyInfo = ProgressBarK
type AttrGetType ProgressBarTextPropertyInfo = T.Text
type AttrLabel ProgressBarTextPropertyInfo = "ProgressBar::text"
attrGet _ = getProgressBarText
attrSet _ = setProgressBarText
attrConstruct _ = constructProgressBarText
type instance AttributeList ProgressBar = ProgressBarAttributeList
type ProgressBarAttributeList = ('[ '("app-paintable", WidgetAppPaintablePropertyInfo), '("can-default", WidgetCanDefaultPropertyInfo), '("can-focus", WidgetCanFocusPropertyInfo), '("composite-child", WidgetCompositeChildPropertyInfo), '("double-buffered", WidgetDoubleBufferedPropertyInfo), '("ellipsize", ProgressBarEllipsizePropertyInfo), '("events", WidgetEventsPropertyInfo), '("expand", WidgetExpandPropertyInfo), '("fraction", ProgressBarFractionPropertyInfo), '("halign", WidgetHalignPropertyInfo), '("has-default", WidgetHasDefaultPropertyInfo), '("has-focus", WidgetHasFocusPropertyInfo), '("has-tooltip", WidgetHasTooltipPropertyInfo), '("height-request", WidgetHeightRequestPropertyInfo), '("hexpand", WidgetHexpandPropertyInfo), '("hexpand-set", WidgetHexpandSetPropertyInfo), '("inverted", ProgressBarInvertedPropertyInfo), '("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), '("orientation", OrientableOrientationPropertyInfo), '("parent", WidgetParentPropertyInfo), '("pulse-step", ProgressBarPulseStepPropertyInfo), '("receives-default", WidgetReceivesDefaultPropertyInfo), '("scale-factor", WidgetScaleFactorPropertyInfo), '("sensitive", WidgetSensitivePropertyInfo), '("show-text", ProgressBarShowTextPropertyInfo), '("style", WidgetStylePropertyInfo), '("text", ProgressBarTextPropertyInfo), '("tooltip-markup", WidgetTooltipMarkupPropertyInfo), '("tooltip-text", WidgetTooltipTextPropertyInfo), '("valign", WidgetValignPropertyInfo), '("vexpand", WidgetVexpandPropertyInfo), '("vexpand-set", WidgetVexpandSetPropertyInfo), '("visible", WidgetVisiblePropertyInfo), '("width-request", WidgetWidthRequestPropertyInfo), '("window", WidgetWindowPropertyInfo)] :: [(Symbol, *)])
type instance SignalList ProgressBar = ProgressBarSignalList
type ProgressBarSignalList = ('[ '("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 ProgressBar::new
-- method type : Constructor
-- Args : []
-- Lengths : []
-- hInArgs : []
-- returnType : TInterface "Gtk" "ProgressBar"
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_new" gtk_progress_bar_new ::
IO (Ptr ProgressBar)
progressBarNew ::
(MonadIO m) =>
m ProgressBar
progressBarNew = liftIO $ do
result <- gtk_progress_bar_new
checkUnexpectedReturnNULL "gtk_progress_bar_new" result
result' <- (newObject ProgressBar) result
return result'
-- method ProgressBar::get_ellipsize
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Pango" "EllipsizeMode"
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_get_ellipsize" gtk_progress_bar_get_ellipsize ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
IO CUInt
progressBarGetEllipsize ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
m Pango.EllipsizeMode
progressBarGetEllipsize _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_progress_bar_get_ellipsize _obj'
let result' = (toEnum . fromIntegral) result
touchManagedPtr _obj
return result'
-- method ProgressBar::get_fraction
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TDouble
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_get_fraction" gtk_progress_bar_get_fraction ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
IO CDouble
progressBarGetFraction ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
m Double
progressBarGetFraction _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_progress_bar_get_fraction _obj'
let result' = realToFrac result
touchManagedPtr _obj
return result'
-- method ProgressBar::get_inverted
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_get_inverted" gtk_progress_bar_get_inverted ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
IO CInt
progressBarGetInverted ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
m Bool
progressBarGetInverted _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_progress_bar_get_inverted _obj'
let result' = (/= 0) result
touchManagedPtr _obj
return result'
-- method ProgressBar::get_pulse_step
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TDouble
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_get_pulse_step" gtk_progress_bar_get_pulse_step ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
IO CDouble
progressBarGetPulseStep ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
m Double
progressBarGetPulseStep _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_progress_bar_get_pulse_step _obj'
let result' = realToFrac result
touchManagedPtr _obj
return result'
-- method ProgressBar::get_show_text
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_get_show_text" gtk_progress_bar_get_show_text ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
IO CInt
progressBarGetShowText ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
m Bool
progressBarGetShowText _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_progress_bar_get_show_text _obj'
let result' = (/= 0) result
touchManagedPtr _obj
return result'
-- method ProgressBar::get_text
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUTF8
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_get_text" gtk_progress_bar_get_text ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
IO CString
progressBarGetText ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
m T.Text
progressBarGetText _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_progress_bar_get_text _obj'
checkUnexpectedReturnNULL "gtk_progress_bar_get_text" result
result' <- cstringToText result
touchManagedPtr _obj
return result'
-- method ProgressBar::pulse
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_pulse" gtk_progress_bar_pulse ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
IO ()
progressBarPulse ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
m ()
progressBarPulse _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
gtk_progress_bar_pulse _obj'
touchManagedPtr _obj
return ()
-- method ProgressBar::set_ellipsize
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "mode", argType = TInterface "Pango" "EllipsizeMode", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "mode", argType = TInterface "Pango" "EllipsizeMode", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_set_ellipsize" gtk_progress_bar_set_ellipsize ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
CUInt -> -- mode : TInterface "Pango" "EllipsizeMode"
IO ()
progressBarSetEllipsize ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
Pango.EllipsizeMode -> -- mode
m ()
progressBarSetEllipsize _obj mode = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let mode' = (fromIntegral . fromEnum) mode
gtk_progress_bar_set_ellipsize _obj' mode'
touchManagedPtr _obj
return ()
-- method ProgressBar::set_fraction
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "fraction", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "fraction", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_set_fraction" gtk_progress_bar_set_fraction ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
CDouble -> -- fraction : TBasicType TDouble
IO ()
progressBarSetFraction ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
Double -> -- fraction
m ()
progressBarSetFraction _obj fraction = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let fraction' = realToFrac fraction
gtk_progress_bar_set_fraction _obj' fraction'
touchManagedPtr _obj
return ()
-- method ProgressBar::set_inverted
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "inverted", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "inverted", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_set_inverted" gtk_progress_bar_set_inverted ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
CInt -> -- inverted : TBasicType TBoolean
IO ()
progressBarSetInverted ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
Bool -> -- inverted
m ()
progressBarSetInverted _obj inverted = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let inverted' = (fromIntegral . fromEnum) inverted
gtk_progress_bar_set_inverted _obj' inverted'
touchManagedPtr _obj
return ()
-- method ProgressBar::set_pulse_step
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "fraction", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "fraction", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_set_pulse_step" gtk_progress_bar_set_pulse_step ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
CDouble -> -- fraction : TBasicType TDouble
IO ()
progressBarSetPulseStep ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
Double -> -- fraction
m ()
progressBarSetPulseStep _obj fraction = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let fraction' = realToFrac fraction
gtk_progress_bar_set_pulse_step _obj' fraction'
touchManagedPtr _obj
return ()
-- method ProgressBar::set_show_text
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "show_text", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "show_text", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_set_show_text" gtk_progress_bar_set_show_text ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
CInt -> -- show_text : TBasicType TBoolean
IO ()
progressBarSetShowText ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
Bool -> -- show_text
m ()
progressBarSetShowText _obj show_text = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let show_text' = (fromIntegral . fromEnum) show_text
gtk_progress_bar_set_show_text _obj' show_text'
touchManagedPtr _obj
return ()
-- method ProgressBar::set_text
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "ProgressBar", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "gtk_progress_bar_set_text" gtk_progress_bar_set_text ::
Ptr ProgressBar -> -- _obj : TInterface "Gtk" "ProgressBar"
CString -> -- text : TBasicType TUTF8
IO ()
progressBarSetText ::
(MonadIO m, ProgressBarK a) =>
a -> -- _obj
Maybe (T.Text) -> -- text
m ()
progressBarSetText _obj text = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
maybeText <- case text of
Nothing -> return nullPtr
Just jText -> do
jText' <- textToCString jText
return jText'
gtk_progress_bar_set_text _obj' maybeText
touchManagedPtr _obj
freeMem maybeText
return ()