{-# LINE 2 "./Graphics/UI/Gtk/Special/Ruler.chs" #-}
module Graphics.UI.Gtk.Special.Ruler (
Ruler,
RulerClass,
castToRuler,
toRuler,
MetricType (..),
rulerRange,
rulerLower,
rulerUpper,
rulerPosition,
rulerMaxSize,
rulerMetric,
) where
import System.Glib.FFI
import System.Glib.Attributes
import System.Glib.Properties
import Graphics.UI.Gtk.General.Enums
import Graphics.UI.Gtk.Types
{-# LINE 80 "./Graphics/UI/Gtk/Special/Ruler.chs" #-}
{-# LINE 82 "./Graphics/UI/Gtk/Special/Ruler.chs" #-}
rulerSetRange :: RulerClass self => self
-> (Double
,Double
,Double
,Double)
-> IO ()
rulerSetRange :: forall self.
RulerClass self =>
self -> (Double, Double, Double, Double) -> IO ()
rulerSetRange self
self (Double
lower, Double
upper, Double
position, Double
maxSize) =
(\(Ruler ForeignPtr Ruler
arg1) CDouble
arg2 CDouble
arg3 CDouble
arg4 CDouble
arg5 -> ForeignPtr Ruler -> (Ptr Ruler -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Ruler
arg1 ((Ptr Ruler -> IO ()) -> IO ()) -> (Ptr Ruler -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Ruler
argPtr1 ->Ptr Ruler -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
gtk_ruler_set_range Ptr Ruler
argPtr1 CDouble
arg2 CDouble
arg3 CDouble
arg4 CDouble
arg5)
{-# LINE 100 "./Graphics/UI/Gtk/Special/Ruler.chs" #-}
(toRuler self)
(Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
lower)
(Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
upper)
(Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
position)
(Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
maxSize)
rulerGetRange :: RulerClass self => self
-> IO (Double, Double, Double, Double)
rulerGetRange :: forall self.
RulerClass self =>
self -> IO (Double, Double, Double, Double)
rulerGetRange self
self =
(Ptr CDouble -> IO (Double, Double, Double, Double))
-> IO (Double, Double, Double, Double)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CDouble -> IO (Double, Double, Double, Double))
-> IO (Double, Double, Double, Double))
-> (Ptr CDouble -> IO (Double, Double, Double, Double))
-> IO (Double, Double, Double, Double)
forall a b. (a -> b) -> a -> b
$ \Ptr CDouble
lowerPtr ->
(Ptr CDouble -> IO (Double, Double, Double, Double))
-> IO (Double, Double, Double, Double)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CDouble -> IO (Double, Double, Double, Double))
-> IO (Double, Double, Double, Double))
-> (Ptr CDouble -> IO (Double, Double, Double, Double))
-> IO (Double, Double, Double, Double)
forall a b. (a -> b) -> a -> b
$ \Ptr CDouble
upperPtr ->
(Ptr CDouble -> IO (Double, Double, Double, Double))
-> IO (Double, Double, Double, Double)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CDouble -> IO (Double, Double, Double, Double))
-> IO (Double, Double, Double, Double))
-> (Ptr CDouble -> IO (Double, Double, Double, Double))
-> IO (Double, Double, Double, Double)
forall a b. (a -> b) -> a -> b
$ \Ptr CDouble
positionPtr ->
(Ptr CDouble -> IO (Double, Double, Double, Double))
-> IO (Double, Double, Double, Double)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CDouble -> IO (Double, Double, Double, Double))
-> IO (Double, Double, Double, Double))
-> (Ptr CDouble -> IO (Double, Double, Double, Double))
-> IO (Double, Double, Double, Double)
forall a b. (a -> b) -> a -> b
$ \Ptr CDouble
maxSizePtr -> do
(\(Ruler ForeignPtr Ruler
arg1) Ptr CDouble
arg2 Ptr CDouble
arg3 Ptr CDouble
arg4 Ptr CDouble
arg5 -> ForeignPtr Ruler -> (Ptr Ruler -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Ruler
arg1 ((Ptr Ruler -> IO ()) -> IO ()) -> (Ptr Ruler -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Ruler
argPtr1 ->Ptr Ruler
-> Ptr CDouble
-> Ptr CDouble
-> Ptr CDouble
-> Ptr CDouble
-> IO ()
gtk_ruler_get_range Ptr Ruler
argPtr1 Ptr CDouble
arg2 Ptr CDouble
arg3 Ptr CDouble
arg4 Ptr CDouble
arg5)
{-# LINE 117 "./Graphics/UI/Gtk/Special/Ruler.chs" #-}
(toRuler self)
Ptr CDouble
lowerPtr
Ptr CDouble
upperPtr
Ptr CDouble
positionPtr
Ptr CDouble
maxSizePtr
CDouble
lower <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
lowerPtr
CDouble
upper <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
upperPtr
CDouble
position <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
positionPtr
CDouble
maxSize <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
maxSizePtr
(Double, Double, Double, Double)
-> IO (Double, Double, Double, Double)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
lower, CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
upper, CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
position, CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
maxSize)
rulerRange :: RulerClass self => Attr self (Double, Double, Double, Double)
rulerRange :: forall self.
RulerClass self =>
Attr self (Double, Double, Double, Double)
rulerRange = (self -> IO (Double, Double, Double, Double))
-> (self -> (Double, Double, Double, Double) -> IO ())
-> ReadWriteAttr
self
(Double, Double, Double, Double)
(Double, Double, Double, Double)
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
self -> IO (Double, Double, Double, Double)
forall self.
RulerClass self =>
self -> IO (Double, Double, Double, Double)
rulerGetRange
self -> (Double, Double, Double, Double) -> IO ()
forall self.
RulerClass self =>
self -> (Double, Double, Double, Double) -> IO ()
rulerSetRange
rulerLower :: RulerClass self => Attr self Double
rulerLower :: forall self. RulerClass self => Attr self Double
rulerLower = String -> Attr self Double
forall gobj. GObjectClass gobj => String -> Attr gobj Double
newAttrFromDoubleProperty String
"lower"
rulerUpper :: RulerClass self => Attr self Double
rulerUpper :: forall self. RulerClass self => Attr self Double
rulerUpper = String -> Attr self Double
forall gobj. GObjectClass gobj => String -> Attr gobj Double
newAttrFromDoubleProperty String
"upper"
rulerPosition :: RulerClass self => Attr self Double
rulerPosition :: forall self. RulerClass self => Attr self Double
rulerPosition = String -> Attr self Double
forall gobj. GObjectClass gobj => String -> Attr gobj Double
newAttrFromDoubleProperty String
"position"
rulerMaxSize :: RulerClass self => Attr self Double
rulerMaxSize :: forall self. RulerClass self => Attr self Double
rulerMaxSize = String -> Attr self Double
forall gobj. GObjectClass gobj => String -> Attr gobj Double
newAttrFromDoubleProperty String
"max-size"
rulerMetric :: RulerClass self => Attr self MetricType
rulerMetric :: forall self. RulerClass self => Attr self MetricType
rulerMetric = String -> GType -> Attr self MetricType
forall gobj enum.
(GObjectClass gobj, Enum enum) =>
String -> GType -> Attr gobj enum
newAttrFromEnumProperty String
"metric"
GType
gtk_metric_type_get_type
{-# LINE 176 "./Graphics/UI/Gtk/Special/Ruler.chs" #-}
foreign import ccall safe "gtk_ruler_set_range"
gtk_ruler_set_range :: ((Ptr Ruler) -> (CDouble -> (CDouble -> (CDouble -> (CDouble -> (IO ()))))))
foreign import ccall safe "gtk_ruler_get_range"
gtk_ruler_get_range :: ((Ptr Ruler) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> ((Ptr CDouble) -> (IO ()))))))
foreign import ccall unsafe "gtk_metric_type_get_type"
gtk_metric_type_get_type :: CULong