{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) This struct defines a single action. It is for use with g_action_map_add_action_entries(). The order of the items in the structure are intended to reflect frequency of use. It is permissible to use an incomplete initialiser in order to leave some of the later values as %NULL. All values after @name are optional. Additional optional fields may be added in the future. See g_action_map_add_action_entries() for an example. -} module GI.Gio.Structs.ActionEntry ( -- * Exported types ActionEntry(..) , noActionEntry , -- * Properties -- ** Name actionEntryReadName , -- ** ParameterType actionEntryReadParameterType , -- ** State actionEntryReadState , ) where import Prelude () import Data.GI.Base.ShortPrelude import qualified Data.Text as T import qualified Data.ByteString.Char8 as B import qualified Data.Map as Map import GI.Gio.Types import GI.Gio.Callbacks newtype ActionEntry = ActionEntry (ForeignPtr ActionEntry) noActionEntry :: Maybe ActionEntry noActionEntry = Nothing actionEntryReadName :: ActionEntry -> IO T.Text actionEntryReadName s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 0) :: IO CString val' <- cstringToText val return val' -- XXX Skipped getter for "ActionEntry:activate" :: Not implemented: "Wrapping foreign callbacks is not supported yet" actionEntryReadParameterType :: ActionEntry -> IO T.Text actionEntryReadParameterType s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 16) :: IO CString val' <- cstringToText val return val' actionEntryReadState :: ActionEntry -> IO T.Text actionEntryReadState s = withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 24) :: IO CString val' <- cstringToText val return val' -- XXX Skipped getter for "ActionEntry:change_state" :: Not implemented: "Wrapping foreign callbacks is not supported yet"