module Graphics.UI.Gtk.ActionMenuToolbar.Action (
Action,
ActionClass,
castToAction, gTypeAction,
toAction,
actionNew,
actionGetName,
actionIsSensitive,
actionGetSensitive,
actionSetSensitive,
actionIsVisible,
actionGetVisible,
actionSetVisible,
actionActivate,
actionCreateMenuItem,
actionCreateToolItem,
actionConnectProxy,
actionDisconnectProxy,
actionGetProxies,
actionConnectAccelerator,
actionDisconnectAccelerator,
actionGetAccelPath,
actionSetAccelPath,
actionSetAccelGroup,
actionName,
actionLabel,
actionShortLabel,
actionTooltip,
actionStockId,
actionVisibleHorizontal,
actionVisibleOverflown,
actionVisibleVertical,
actionIsImportant,
actionHideIfEmpty,
actionSensitive,
actionVisible,
actionAccelPath,
actionAlwaysShowImage,
actionActivated,
onActionActivate,
afterActionActivate,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.GList
import System.Glib.Attributes
import System.Glib.Properties
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Types
import Graphics.UI.Gtk.Signals
import Graphics.UI.Gtk.General.StockItems
actionNew :: GlibString string
=> string
-> string
-> Maybe string
-> Maybe StockId
-> IO Action
actionNew name label tooltip stockId =
wrapNewGObject mkAction $
maybeWith withUTFString stockId $ \stockIdPtr ->
maybeWith withUTFString tooltip $ \tooltipPtr ->
withUTFString label $ \labelPtr ->
withUTFString name $ \namePtr ->
gtk_action_new
namePtr
labelPtr
tooltipPtr
stockIdPtr
actionGetName :: (ActionClass self, GlibString string) => self -> IO string
actionGetName self =
(\(Action arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_get_name argPtr1)
(toAction self)
>>= peekUTFString
actionIsSensitive :: ActionClass self => self
-> IO Bool
actionIsSensitive self =
liftM toBool $
(\(Action arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_is_sensitive argPtr1)
(toAction self)
actionGetSensitive :: ActionClass self => self
-> IO Bool
actionGetSensitive self =
liftM toBool $
(\(Action arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_get_sensitive argPtr1)
(toAction self)
actionSetSensitive :: ActionClass self => self
-> Bool
-> IO ()
actionSetSensitive self sensitive =
(\(Action arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_set_sensitive argPtr1 arg2)
(toAction self)
(fromBool sensitive)
actionIsVisible :: ActionClass self => self
-> IO Bool
actionIsVisible self =
liftM toBool $
(\(Action arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_is_visible argPtr1)
(toAction self)
actionGetVisible :: ActionClass self => self
-> IO Bool
actionGetVisible self =
liftM toBool $
(\(Action arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_get_visible argPtr1)
(toAction self)
actionSetVisible :: ActionClass self => self
-> Bool
-> IO ()
actionSetVisible self visible =
(\(Action arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_set_visible argPtr1 arg2)
(toAction self)
(fromBool visible)
actionActivate :: ActionClass self => self -> IO ()
actionActivate self =
(\(Action arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_activate argPtr1)
(toAction self)
actionCreateMenuItem :: ActionClass self => self
-> IO Widget
actionCreateMenuItem self =
makeNewObject mkWidget $
(\(Action arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_create_menu_item argPtr1)
(toAction self)
actionCreateToolItem :: ActionClass self => self
-> IO Widget
actionCreateToolItem self =
makeNewObject mkWidget $
(\(Action arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_create_tool_item argPtr1)
(toAction self)
actionConnectProxy :: (ActionClass self, WidgetClass proxy) => self
-> proxy
-> IO ()
actionConnectProxy self proxy =
(\(Action arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_action_connect_proxy argPtr1 argPtr2)
(toAction self)
(toWidget proxy)
actionDisconnectProxy :: (ActionClass self, WidgetClass proxy) => self
-> proxy
-> IO ()
actionDisconnectProxy self proxy =
(\(Action arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_action_disconnect_proxy argPtr1 argPtr2)
(toAction self)
(toWidget proxy)
actionGetProxies :: ActionClass self => self -> IO [Widget]
actionGetProxies self =
(\(Action arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_get_proxies argPtr1)
(toAction self)
>>= readGSList
>>= mapM (\elemPtr -> makeNewObject mkWidget (return elemPtr))
actionConnectAccelerator :: ActionClass self => self -> IO ()
actionConnectAccelerator self =
(\(Action arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_connect_accelerator argPtr1)
(toAction self)
actionDisconnectAccelerator :: ActionClass self => self -> IO ()
actionDisconnectAccelerator self =
(\(Action arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_disconnect_accelerator argPtr1)
(toAction self)
actionGetAccelPath :: (ActionClass self, GlibString string) => self
-> IO (Maybe string)
actionGetAccelPath self =
(\(Action arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_get_accel_path argPtr1)
(toAction self)
>>= maybePeek peekUTFString
actionSetAccelPath :: (ActionClass self, GlibString string) => self
-> string
-> IO ()
actionSetAccelPath self accelPath =
withUTFString accelPath $ \accelPathPtr ->
(\(Action arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_action_set_accel_path argPtr1 arg2)
(toAction self)
accelPathPtr
actionSetAccelGroup :: ActionClass self => self -> AccelGroup -> IO ()
actionSetAccelGroup self accelGroup =
(\(Action arg1) (AccelGroup arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_action_set_accel_group argPtr1 argPtr2)
(toAction self)
accelGroup
actionName :: GlibString string => ActionClass self => Attr self string
actionName = newAttrFromStringProperty "name"
actionLabel :: GlibString string => ActionClass self => Attr self string
actionLabel = newAttrFromStringProperty "label"
actionShortLabel :: GlibString string => ActionClass self => Attr self string
actionShortLabel = newAttrFromStringProperty "short-label"
actionTooltip :: GlibString string => ActionClass self => Attr self (Maybe string)
actionTooltip = newAttrFromMaybeStringProperty "tooltip"
actionStockId :: GlibString string => ActionClass self => Attr self (Maybe string)
actionStockId = newAttrFromMaybeStringProperty "stock_id"
actionVisibleHorizontal :: ActionClass self => Attr self Bool
actionVisibleHorizontal = newAttrFromBoolProperty "visible-horizontal"
actionVisibleOverflown :: ActionClass self => Attr self Bool
actionVisibleOverflown = newAttrFromBoolProperty "visible-overflown"
actionVisibleVertical :: ActionClass self => Attr self Bool
actionVisibleVertical = newAttrFromBoolProperty "visible-vertical"
actionIsImportant :: ActionClass self => Attr self Bool
actionIsImportant = newAttrFromBoolProperty "is-important"
actionHideIfEmpty :: ActionClass self => Attr self Bool
actionHideIfEmpty = newAttrFromBoolProperty "hide-if-empty"
actionSensitive :: ActionClass self => Attr self Bool
actionSensitive = newAttr
actionGetSensitive
actionSetSensitive
actionVisible :: ActionClass self => Attr self Bool
actionVisible = newAttr
actionGetVisible
actionSetVisible
actionAccelPath :: GlibString string => ActionClass self => ReadWriteAttr self (Maybe string) string
actionAccelPath = newAttr
actionGetAccelPath
actionSetAccelPath
actionAlwaysShowImage :: ActionClass self => Attr self Bool
actionAlwaysShowImage = newAttrFromBoolProperty "always-show-image"
actionActivated :: ActionClass self => Signal self (IO ())
actionActivated = Signal (connect_NONE__NONE "activate")
onActionActivate, afterActionActivate :: ActionClass self => self
-> IO ()
-> IO (ConnectId self)
onActionActivate = connect_NONE__NONE "activate" False
afterActionActivate = connect_NONE__NONE "activate" True
foreign import ccall safe "gtk_action_new"
gtk_action_new :: ((Ptr CChar) -> ((Ptr CChar) -> ((Ptr CChar) -> ((Ptr CChar) -> (IO (Ptr Action))))))
foreign import ccall safe "gtk_action_get_name"
gtk_action_get_name :: ((Ptr Action) -> (IO (Ptr CChar)))
foreign import ccall safe "gtk_action_is_sensitive"
gtk_action_is_sensitive :: ((Ptr Action) -> (IO CInt))
foreign import ccall safe "gtk_action_get_sensitive"
gtk_action_get_sensitive :: ((Ptr Action) -> (IO CInt))
foreign import ccall safe "gtk_action_set_sensitive"
gtk_action_set_sensitive :: ((Ptr Action) -> (CInt -> (IO ())))
foreign import ccall safe "gtk_action_is_visible"
gtk_action_is_visible :: ((Ptr Action) -> (IO CInt))
foreign import ccall safe "gtk_action_get_visible"
gtk_action_get_visible :: ((Ptr Action) -> (IO CInt))
foreign import ccall safe "gtk_action_set_visible"
gtk_action_set_visible :: ((Ptr Action) -> (CInt -> (IO ())))
foreign import ccall safe "gtk_action_activate"
gtk_action_activate :: ((Ptr Action) -> (IO ()))
foreign import ccall safe "gtk_action_create_menu_item"
gtk_action_create_menu_item :: ((Ptr Action) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_action_create_tool_item"
gtk_action_create_tool_item :: ((Ptr Action) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_action_connect_proxy"
gtk_action_connect_proxy :: ((Ptr Action) -> ((Ptr Widget) -> (IO ())))
foreign import ccall safe "gtk_action_disconnect_proxy"
gtk_action_disconnect_proxy :: ((Ptr Action) -> ((Ptr Widget) -> (IO ())))
foreign import ccall safe "gtk_action_get_proxies"
gtk_action_get_proxies :: ((Ptr Action) -> (IO (Ptr ())))
foreign import ccall safe "gtk_action_connect_accelerator"
gtk_action_connect_accelerator :: ((Ptr Action) -> (IO ()))
foreign import ccall safe "gtk_action_disconnect_accelerator"
gtk_action_disconnect_accelerator :: ((Ptr Action) -> (IO ()))
foreign import ccall safe "gtk_action_get_accel_path"
gtk_action_get_accel_path :: ((Ptr Action) -> (IO (Ptr CChar)))
foreign import ccall safe "gtk_action_set_accel_path"
gtk_action_set_accel_path :: ((Ptr Action) -> ((Ptr CChar) -> (IO ())))
foreign import ccall safe "gtk_action_set_accel_group"
gtk_action_set_accel_group :: ((Ptr Action) -> ((Ptr AccelGroup) -> (IO ())))