{-# LINE 2 "./Graphics/UI/Gtk/Buttons/ScaleButton.chs" #-}
module Graphics.UI.Gtk.Buttons.ScaleButton (
ScaleButton,
ScaleButtonClass,
castToScaleButton,
toScaleButton,
scaleButtonNew,
scaleButtonSetIcons,
scaleButtonGetPopup,
scaleButtonGetPlusButton,
scaleButtonGetMinusButton,
scaleButtonValue,
scaleButtonSize,
scaleButtonAdjustment,
scaleButtonIcons,
scaleButtonPopdown,
scaleButtonPopup,
scaleButtonValueChanged,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.Attributes
import System.Glib.Properties
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.General.Structs (IconSize(..))
import Graphics.UI.Gtk.Types
{-# LINE 93 "./Graphics/UI/Gtk/Buttons/ScaleButton.chs" #-}
import Graphics.UI.Gtk.Signals
{-# LINE 94 "./Graphics/UI/Gtk/Buttons/ScaleButton.chs" #-}
{-# LINE 96 "./Graphics/UI/Gtk/Buttons/ScaleButton.chs" #-}
scaleButtonNew :: GlibString string
=> IconSize
-> Double
-> Double
-> Double
-> [string]
-> IO ScaleButton
scaleButtonNew size min max step icons =
makeNewObject mkScaleButton $
liftM (castPtr :: Ptr Widget -> Ptr ScaleButton) $
withUTFStringArray0 icons $ \iconsPtr ->
gtk_scale_button_new
{-# LINE 122 "./Graphics/UI/Gtk/Buttons/ScaleButton.chs" #-}
((fromIntegral . fromEnum) size)
(realToFrac min)
(realToFrac max)
(realToFrac step)
iconsPtr
scaleButtonSetIcons :: (ScaleButtonClass self, GlibString string) => self
-> [string]
-> IO ()
scaleButtonSetIcons self icons =
withUTFStringArray0 icons $ \iconsPtr ->
(\(ScaleButton arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_scale_button_set_icons argPtr1 arg2)
{-# LINE 138 "./Graphics/UI/Gtk/Buttons/ScaleButton.chs" #-}
(toScaleButton self)
iconsPtr
scaleButtonGetPopup :: ScaleButtonClass self => self
-> IO Widget
scaleButtonGetPopup self =
makeNewObject mkWidget $
(\(ScaleButton arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scale_button_get_popup argPtr1)
{-# LINE 151 "./Graphics/UI/Gtk/Buttons/ScaleButton.chs" #-}
(toScaleButton self)
scaleButtonGetPlusButton :: ScaleButtonClass self => self
-> IO Widget
scaleButtonGetPlusButton self =
makeNewObject mkWidget $
(\(ScaleButton arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scale_button_get_plus_button argPtr1)
{-# LINE 162 "./Graphics/UI/Gtk/Buttons/ScaleButton.chs" #-}
(toScaleButton self)
scaleButtonGetMinusButton :: ScaleButtonClass self => self
-> IO Widget
scaleButtonGetMinusButton self =
makeNewObject mkWidget $
(\(ScaleButton arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scale_button_get_minus_button argPtr1)
{-# LINE 173 "./Graphics/UI/Gtk/Buttons/ScaleButton.chs" #-}
(toScaleButton self)
scaleButtonValue :: ScaleButtonClass self => Attr self Double
scaleButtonValue = newAttrFromDoubleProperty "value"
scaleButtonSize :: ScaleButtonClass self => Attr self IconSize
scaleButtonSize = newAttrFromEnumProperty "size"
gtk_icon_size_get_type
{-# LINE 191 "./Graphics/UI/Gtk/Buttons/ScaleButton.chs" #-}
scaleButtonAdjustment :: ScaleButtonClass self => Attr self Adjustment
scaleButtonAdjustment = newAttrFromObjectProperty "adjustment"
gtk_adjustment_get_type
{-# LINE 196 "./Graphics/UI/Gtk/Buttons/ScaleButton.chs" #-}
scaleButtonIcons :: (ScaleButtonClass self, GlibString string) => ReadWriteAttr self [string] (Maybe [string])
scaleButtonIcons =
newAttr (objectGetPropertyBoxedOpaque (peekUTFStringArray0 . castPtr) gtype "search-path")
(objectSetPropertyBoxedOpaque (\dirs f -> maybeWith withUTFStringArray0 dirs (f . castPtr)) gtype "search-path")
where gtype = g_strv_get_type
{-# LINE 214 "./Graphics/UI/Gtk/Buttons/ScaleButton.chs" #-}
scaleButtonValueChanged :: ScaleButtonClass self => Signal self (Double -> IO ())
scaleButtonValueChanged = Signal (connect_DOUBLE__NONE "value_changed")
scaleButtonPopup :: ScaleButtonClass self => Signal self (IO ())
scaleButtonPopup = Signal (connect_NONE__NONE "popup")
scaleButtonPopdown :: ScaleButtonClass self => Signal self (IO ())
scaleButtonPopdown = Signal (connect_NONE__NONE "popdown")
foreign import ccall safe "gtk_scale_button_new"
gtk_scale_button_new :: (CInt -> (CDouble -> (CDouble -> (CDouble -> ((Ptr (Ptr CChar)) -> (IO (Ptr Widget)))))))
foreign import ccall safe "gtk_scale_button_set_icons"
gtk_scale_button_set_icons :: ((Ptr ScaleButton) -> ((Ptr (Ptr CChar)) -> (IO ())))
foreign import ccall safe "gtk_scale_button_get_popup"
gtk_scale_button_get_popup :: ((Ptr ScaleButton) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_scale_button_get_plus_button"
gtk_scale_button_get_plus_button :: ((Ptr ScaleButton) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_scale_button_get_minus_button"
gtk_scale_button_get_minus_button :: ((Ptr ScaleButton) -> (IO (Ptr Widget)))
foreign import ccall unsafe "gtk_icon_size_get_type"
gtk_icon_size_get_type :: CULong
foreign import ccall unsafe "gtk_adjustment_get_type"
gtk_adjustment_get_type :: CULong
foreign import ccall safe "g_strv_get_type"
g_strv_get_type :: CULong