module Graphics.UI.Gtk.Abstract.ContainerChildProperties (
containerChildGetPropertyBool,
containerChildSetPropertyBool,
newAttrFromContainerChildIntProperty,
newAttrFromContainerChildUIntProperty,
newAttrFromContainerChildBoolProperty,
newAttrFromContainerChildEnumProperty,
newAttrFromContainerChildFlagsProperty,
newAttrFromContainerChildStringProperty,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.Flags
import Graphics.UI.Gtk.Types
import System.Glib.GType
import qualified System.Glib.GTypeConstants as GType
import System.Glib.GValueTypes
import System.Glib.GValue (GValue(GValue), allocaGValue, valueInit)
import System.Glib.Attributes (Attr, newAttr)
containerChildSetPropertyInternal ::
(ContainerClass container, WidgetClass child)
=> GType
-> (GValue -> a -> IO ())
-> String
-> child
-> container
-> a
-> IO ()
containerChildSetPropertyInternal gtype valueSet prop child container val =
withCString prop $ \propertyNamePtr ->
allocaGValue $ \gvalue -> do
valueInit gvalue gtype
valueSet gvalue val
(\(Container arg1) (Widget arg2) arg3 (GValue arg4) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_container_child_set_property argPtr1 argPtr2 arg3 arg4)
(toContainer container)
(toWidget child)
propertyNamePtr
gvalue
containerChildGetPropertyInternal ::
(ContainerClass container, WidgetClass child)
=> GType
-> (GValue -> IO a)
-> String
-> child
-> container
-> IO a
containerChildGetPropertyInternal gtype valueGet prop child container =
withCString prop $ \propertyNamePtr ->
allocaGValue $ \gvalue -> do
valueInit gvalue gtype
(\(Container arg1) (Widget arg2) arg3 (GValue arg4) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_container_child_get_property argPtr1 argPtr2 arg3 arg4)
(toContainer container)
(toWidget child)
propertyNamePtr
gvalue
valueGet gvalue
containerChildGetPropertyBool :: (ContainerClass container, WidgetClass child)
=> String -> child -> container -> IO Bool
containerChildGetPropertyBool =
containerChildGetPropertyInternal GType.bool valueGetBool
containerChildSetPropertyBool :: (ContainerClass container, WidgetClass child)
=> String -> child -> container -> Bool -> IO ()
containerChildSetPropertyBool =
containerChildSetPropertyInternal GType.bool valueSetBool
newAttrFromContainerChildIntProperty ::
(ContainerClass container, WidgetClass child)
=> String -> child -> Attr container Int
newAttrFromContainerChildIntProperty propName child = newAttr
(containerChildGetPropertyInternal GType.int valueGetInt propName child)
(containerChildSetPropertyInternal GType.int valueSetInt propName child)
newAttrFromContainerChildUIntProperty ::
(ContainerClass container, WidgetClass child)
=> String -> child -> Attr container Int
newAttrFromContainerChildUIntProperty propName child = newAttr
(containerChildGetPropertyInternal GType.uint
(\gv -> liftM fromIntegral $ valueGetUInt gv) propName child)
(containerChildSetPropertyInternal GType.uint
(\gv v -> valueSetUInt gv (fromIntegral v)) propName child)
newAttrFromContainerChildBoolProperty ::
(ContainerClass container, WidgetClass child)
=> String -> child -> Attr container Bool
newAttrFromContainerChildBoolProperty propName child = newAttr
(containerChildGetPropertyInternal GType.bool valueGetBool propName child)
(containerChildSetPropertyInternal GType.bool valueSetBool propName child)
newAttrFromContainerChildEnumProperty ::
(ContainerClass container, WidgetClass child, Enum enum)
=> String -> GType -> child -> Attr container enum
newAttrFromContainerChildEnumProperty propName gtype child = newAttr
(containerChildGetPropertyInternal gtype valueGetEnum propName child)
(containerChildSetPropertyInternal gtype valueSetEnum propName child)
newAttrFromContainerChildFlagsProperty ::
(ContainerClass container, WidgetClass child, Flags flag)
=> String -> GType -> child -> Attr container [flag]
newAttrFromContainerChildFlagsProperty propName gtype child = newAttr
(containerChildGetPropertyInternal gtype valueGetFlags propName child)
(containerChildSetPropertyInternal gtype valueSetFlags propName child)
newAttrFromContainerChildStringProperty ::
(ContainerClass container, WidgetClass child, GlibString string)
=> String -> child -> Attr container string
newAttrFromContainerChildStringProperty propName child = newAttr
(containerChildGetPropertyInternal GType.string valueGetString propName child)
(containerChildSetPropertyInternal GType.string valueSetString propName child)
foreign import ccall safe "gtk_container_child_set_property"
gtk_container_child_set_property :: ((Ptr Container) -> ((Ptr Widget) -> ((Ptr CChar) -> ((Ptr GValue) -> (IO ())))))
foreign import ccall safe "gtk_container_child_get_property"
gtk_container_child_get_property :: ((Ptr Container) -> ((Ptr Widget) -> ((Ptr CChar) -> ((Ptr GValue) -> (IO ())))))