module Graphics.UI.Gtk.Scrolling.ScrolledWindow (
ScrolledWindow,
ScrolledWindowClass,
castToScrolledWindow, gTypeScrolledWindow,
toScrolledWindow,
scrolledWindowNew,
scrolledWindowGetHAdjustment,
scrolledWindowGetVAdjustment,
PolicyType(..),
scrolledWindowSetPolicy,
scrolledWindowGetPolicy,
scrolledWindowAddWithViewport,
CornerType(..),
scrolledWindowSetPlacement,
scrolledWindowGetPlacement,
ShadowType(..),
scrolledWindowSetShadowType,
scrolledWindowGetShadowType,
scrolledWindowSetMinContentWidth,
scrolledWindowGetMinContentWidth,
scrolledWindowSetMinContentHeight,
scrolledWindowGetMinContentHeight,
scrolledWindowSetHAdjustment,
scrolledWindowSetVAdjustment,
scrolledWindowGetHScrollbar,
scrolledWindowGetVScrollbar,
scrolledWindowSetKineticScrolling,
scrolledWindowGetKineticScrolling,
scrolledWindowSetCaptureButtonPress,
scrolledWindowGetCaptureButtonPress,
scrolledWindowHAdjustment,
scrolledWindowVAdjustment,
scrolledWindowHscrollbarPolicy,
scrolledWindowVscrollbarPolicy,
scrolledWindowWindowPlacement,
scrolledWindowShadowType,
scrolledWindowMinContentWidth,
scrolledWindowMinContentHeight,
scrolledWindowPlacement,
scrolledWindowKineticScrolling,
) where
import Control.Monad (liftM)
import Data.Maybe (fromMaybe)
import System.Glib.FFI
import System.Glib.Attributes
import System.Glib.Properties
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Types
import Graphics.UI.Gtk.General.Enums (PolicyType(..), CornerType(..), ShadowType(..))
scrolledWindowNew ::
Maybe Adjustment
-> Maybe Adjustment
-> IO ScrolledWindow
scrolledWindowNew hadjustment vadjustment =
makeNewObject mkScrolledWindow $
liftM (castPtr :: Ptr Widget -> Ptr ScrolledWindow) $
(\(Adjustment arg1) (Adjustment arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_scrolled_window_new argPtr1 argPtr2)
(fromMaybe (Adjustment nullForeignPtr) hadjustment)
(fromMaybe (Adjustment nullForeignPtr) vadjustment)
scrolledWindowGetHAdjustment :: ScrolledWindowClass self => self -> IO Adjustment
scrolledWindowGetHAdjustment self =
makeNewObject mkAdjustment $
(\(ScrolledWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_get_hadjustment argPtr1)
(toScrolledWindow self)
scrolledWindowGetVAdjustment :: ScrolledWindowClass self => self -> IO Adjustment
scrolledWindowGetVAdjustment self =
makeNewObject mkAdjustment $
(\(ScrolledWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_get_vadjustment argPtr1)
(toScrolledWindow self)
scrolledWindowSetPolicy :: ScrolledWindowClass self => self
-> PolicyType
-> PolicyType
-> IO ()
scrolledWindowSetPolicy self hscrollbarPolicy vscrollbarPolicy =
(\(ScrolledWindow arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_set_policy argPtr1 arg2 arg3)
(toScrolledWindow self)
((fromIntegral . fromEnum) hscrollbarPolicy)
((fromIntegral . fromEnum) vscrollbarPolicy)
scrolledWindowGetPolicy :: ScrolledWindowClass self => self
-> IO (PolicyType, PolicyType)
scrolledWindowGetPolicy self =
alloca $ \hPolPtr ->
alloca $ \vPolPtr -> do
(\(ScrolledWindow arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_get_policy argPtr1 arg2 arg3)
(toScrolledWindow self)
hPolPtr vPolPtr
hPol <- liftM (toEnum.fromIntegral) $ peek hPolPtr
vPol <- liftM (toEnum.fromIntegral) $ peek vPolPtr
return (hPol, vPol)
scrolledWindowAddWithViewport :: (ScrolledWindowClass self, WidgetClass child) => self
-> child
-> IO ()
scrolledWindowAddWithViewport self child =
(\(ScrolledWindow arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_scrolled_window_add_with_viewport argPtr1 argPtr2)
(toScrolledWindow self)
(toWidget child)
scrolledWindowSetPlacement :: ScrolledWindowClass self => self
-> CornerType
-> IO ()
scrolledWindowSetPlacement self windowPlacement =
(\(ScrolledWindow arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_set_placement argPtr1 arg2)
(toScrolledWindow self)
((fromIntegral . fromEnum) windowPlacement)
scrolledWindowGetPlacement :: ScrolledWindowClass self => self -> IO CornerType
scrolledWindowGetPlacement self =
liftM (toEnum . fromIntegral) $
(\(ScrolledWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_get_placement argPtr1)
(toScrolledWindow self)
scrolledWindowSetShadowType :: ScrolledWindowClass self => self -> ShadowType -> IO ()
scrolledWindowSetShadowType self type_ =
(\(ScrolledWindow arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_set_shadow_type argPtr1 arg2)
(toScrolledWindow self)
((fromIntegral . fromEnum) type_)
scrolledWindowGetShadowType :: ScrolledWindowClass self => self -> IO ShadowType
scrolledWindowGetShadowType self =
liftM (toEnum . fromIntegral) $
(\(ScrolledWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_get_shadow_type argPtr1)
(toScrolledWindow self)
scrolledWindowSetMinContentWidth :: ScrolledWindowClass self => self -> Int -> IO ()
scrolledWindowSetMinContentWidth self width =
(\(ScrolledWindow arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_set_min_content_width argPtr1 arg2)
(toScrolledWindow self)
(fromIntegral width)
scrolledWindowGetMinContentWidth :: ScrolledWindowClass self => self -> IO Int
scrolledWindowGetMinContentWidth self =
liftM fromIntegral $
(\(ScrolledWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_get_min_content_width argPtr1)
(toScrolledWindow self)
scrolledWindowSetMinContentHeight :: ScrolledWindowClass self => self -> Int -> IO ()
scrolledWindowSetMinContentHeight self height =
(\(ScrolledWindow arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_set_min_content_height argPtr1 arg2)
(toScrolledWindow self)
(fromIntegral height)
scrolledWindowGetMinContentHeight :: ScrolledWindowClass self => self -> IO Int
scrolledWindowGetMinContentHeight self =
liftM fromIntegral $
(\(ScrolledWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_get_min_content_height argPtr1)
(toScrolledWindow self)
scrolledWindowSetHAdjustment :: ScrolledWindowClass self => self -> Adjustment -> IO ()
scrolledWindowSetHAdjustment self hadjustment =
(\(ScrolledWindow arg1) (Adjustment arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_scrolled_window_set_hadjustment argPtr1 argPtr2)
(toScrolledWindow self)
hadjustment
scrolledWindowSetVAdjustment :: ScrolledWindowClass self => self
-> Adjustment
-> IO ()
scrolledWindowSetVAdjustment self vadjustment =
(\(ScrolledWindow arg1) (Adjustment arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_scrolled_window_set_vadjustment argPtr1 argPtr2)
(toScrolledWindow self)
vadjustment
scrolledWindowGetHScrollbar :: ScrolledWindowClass self => self
-> IO (Maybe HScrollbar)
scrolledWindowGetHScrollbar self =
maybeNull (makeNewObject mkHScrollbar) $
liftM (castPtr :: Ptr Widget -> Ptr HScrollbar) $
(\(ScrolledWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_get_hscrollbar argPtr1)
(toScrolledWindow self)
scrolledWindowGetVScrollbar :: ScrolledWindowClass self => self
-> IO (Maybe VScrollbar)
scrolledWindowGetVScrollbar self =
maybeNull (makeNewObject mkVScrollbar) $
liftM (castPtr :: Ptr Widget -> Ptr VScrollbar) $
(\(ScrolledWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_get_vscrollbar argPtr1)
(toScrolledWindow self)
scrolledWindowSetKineticScrolling :: ScrolledWindowClass self => self -> Bool -> IO ()
scrolledWindowSetKineticScrolling self kineticScrolling =
(\(ScrolledWindow arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_set_kinetic_scrolling argPtr1 arg2)
(toScrolledWindow self)
(fromBool kineticScrolling)
scrolledWindowGetKineticScrolling :: ScrolledWindowClass self => self -> IO Bool
scrolledWindowGetKineticScrolling self =
liftM toBool $
(\(ScrolledWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_get_kinetic_scrolling argPtr1)
(toScrolledWindow self)
scrolledWindowSetCaptureButtonPress :: ScrolledWindowClass self => self -> Bool -> IO ()
scrolledWindowSetCaptureButtonPress self captureButtonPress =
(\(ScrolledWindow arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_set_capture_button_press argPtr1 arg2)
(toScrolledWindow self)
(fromBool captureButtonPress)
scrolledWindowGetCaptureButtonPress :: ScrolledWindowClass self => self -> IO Bool
scrolledWindowGetCaptureButtonPress self =
liftM toBool $
(\(ScrolledWindow arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_scrolled_window_get_capture_button_press argPtr1)
(toScrolledWindow self)
scrolledWindowHAdjustment :: ScrolledWindowClass self => Attr self Adjustment
scrolledWindowHAdjustment = newAttr
scrolledWindowGetHAdjustment
scrolledWindowSetHAdjustment
scrolledWindowVAdjustment :: ScrolledWindowClass self => Attr self Adjustment
scrolledWindowVAdjustment = newAttr
scrolledWindowGetVAdjustment
scrolledWindowSetVAdjustment
scrolledWindowHscrollbarPolicy :: ScrolledWindowClass self => Attr self PolicyType
scrolledWindowHscrollbarPolicy = newAttrFromEnumProperty "hscrollbar-policy"
gtk_policy_type_get_type
scrolledWindowVscrollbarPolicy :: ScrolledWindowClass self => Attr self PolicyType
scrolledWindowVscrollbarPolicy = newAttrFromEnumProperty "vscrollbar-policy"
gtk_policy_type_get_type
scrolledWindowWindowPlacement :: ScrolledWindowClass self => Attr self CornerType
scrolledWindowWindowPlacement = newAttrFromEnumProperty "window-placement"
gtk_corner_type_get_type
scrolledWindowShadowType :: ScrolledWindowClass self => Attr self ShadowType
scrolledWindowShadowType = newAttr
scrolledWindowGetShadowType
scrolledWindowSetShadowType
scrolledWindowMinContentWidth :: ScrolledWindowClass self => Attr self Int
scrolledWindowMinContentWidth = newAttr
scrolledWindowGetMinContentWidth
scrolledWindowSetMinContentWidth
scrolledWindowMinContentHeight :: ScrolledWindowClass self => Attr self Int
scrolledWindowMinContentHeight = newAttr
scrolledWindowGetMinContentHeight
scrolledWindowSetMinContentHeight
scrolledWindowPlacement :: ScrolledWindowClass self => Attr self CornerType
scrolledWindowPlacement = newAttr
scrolledWindowGetPlacement
scrolledWindowSetPlacement
scrolledWindowKineticScrolling :: ScrolledWindowClass self => Attr self Bool
scrolledWindowKineticScrolling = newAttr
scrolledWindowGetKineticScrolling
scrolledWindowSetKineticScrolling
foreign import ccall unsafe "gtk_scrolled_window_new"
gtk_scrolled_window_new :: ((Ptr Adjustment) -> ((Ptr Adjustment) -> (IO (Ptr Widget))))
foreign import ccall unsafe "gtk_scrolled_window_get_hadjustment"
gtk_scrolled_window_get_hadjustment :: ((Ptr ScrolledWindow) -> (IO (Ptr Adjustment)))
foreign import ccall unsafe "gtk_scrolled_window_get_vadjustment"
gtk_scrolled_window_get_vadjustment :: ((Ptr ScrolledWindow) -> (IO (Ptr Adjustment)))
foreign import ccall safe "gtk_scrolled_window_set_policy"
gtk_scrolled_window_set_policy :: ((Ptr ScrolledWindow) -> (CInt -> (CInt -> (IO ()))))
foreign import ccall unsafe "gtk_scrolled_window_get_policy"
gtk_scrolled_window_get_policy :: ((Ptr ScrolledWindow) -> ((Ptr CInt) -> ((Ptr CInt) -> (IO ()))))
foreign import ccall safe "gtk_scrolled_window_add_with_viewport"
gtk_scrolled_window_add_with_viewport :: ((Ptr ScrolledWindow) -> ((Ptr Widget) -> (IO ())))
foreign import ccall safe "gtk_scrolled_window_set_placement"
gtk_scrolled_window_set_placement :: ((Ptr ScrolledWindow) -> (CInt -> (IO ())))
foreign import ccall unsafe "gtk_scrolled_window_get_placement"
gtk_scrolled_window_get_placement :: ((Ptr ScrolledWindow) -> (IO CInt))
foreign import ccall safe "gtk_scrolled_window_set_shadow_type"
gtk_scrolled_window_set_shadow_type :: ((Ptr ScrolledWindow) -> (CInt -> (IO ())))
foreign import ccall unsafe "gtk_scrolled_window_get_shadow_type"
gtk_scrolled_window_get_shadow_type :: ((Ptr ScrolledWindow) -> (IO CInt))
foreign import ccall safe "gtk_scrolled_window_set_min_content_width"
gtk_scrolled_window_set_min_content_width :: ((Ptr ScrolledWindow) -> (CInt -> (IO ())))
foreign import ccall unsafe "gtk_scrolled_window_get_min_content_width"
gtk_scrolled_window_get_min_content_width :: ((Ptr ScrolledWindow) -> (IO CInt))
foreign import ccall safe "gtk_scrolled_window_set_min_content_height"
gtk_scrolled_window_set_min_content_height :: ((Ptr ScrolledWindow) -> (CInt -> (IO ())))
foreign import ccall unsafe "gtk_scrolled_window_get_min_content_height"
gtk_scrolled_window_get_min_content_height :: ((Ptr ScrolledWindow) -> (IO CInt))
foreign import ccall safe "gtk_scrolled_window_set_hadjustment"
gtk_scrolled_window_set_hadjustment :: ((Ptr ScrolledWindow) -> ((Ptr Adjustment) -> (IO ())))
foreign import ccall safe "gtk_scrolled_window_set_vadjustment"
gtk_scrolled_window_set_vadjustment :: ((Ptr ScrolledWindow) -> ((Ptr Adjustment) -> (IO ())))
foreign import ccall safe "gtk_scrolled_window_get_hscrollbar"
gtk_scrolled_window_get_hscrollbar :: ((Ptr ScrolledWindow) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_scrolled_window_get_vscrollbar"
gtk_scrolled_window_get_vscrollbar :: ((Ptr ScrolledWindow) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_scrolled_window_set_kinetic_scrolling"
gtk_scrolled_window_set_kinetic_scrolling :: ((Ptr ScrolledWindow) -> (CInt -> (IO ())))
foreign import ccall safe "gtk_scrolled_window_get_kinetic_scrolling"
gtk_scrolled_window_get_kinetic_scrolling :: ((Ptr ScrolledWindow) -> (IO CInt))
foreign import ccall safe "gtk_scrolled_window_set_capture_button_press"
gtk_scrolled_window_set_capture_button_press :: ((Ptr ScrolledWindow) -> (CInt -> (IO ())))
foreign import ccall safe "gtk_scrolled_window_get_capture_button_press"
gtk_scrolled_window_get_capture_button_press :: ((Ptr ScrolledWindow) -> (IO CInt))
foreign import ccall unsafe "gtk_policy_type_get_type"
gtk_policy_type_get_type :: CULong
foreign import ccall unsafe "gtk_corner_type_get_type"
gtk_corner_type_get_type :: CULong