{-# LINE 2 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
module Graphics.UI.Gtk.Recent.RecentChooser (
RecentChooser,
RecentChooserClass,
castToRecentChooser,
toRecentChooser,
RecentChooserError(..),
RecentSortType(..),
recentChooserSetSortFunc,
recentChooserSetCurrentURI,
recentChooserGetCurrentURI,
recentChooserGetCurrentItem,
recentChooserSelectURI,
recentChooserUnselectURI,
recentChooserSelectAll,
recentChooserUnselectAll,
recentChooserGetItems,
recentChooserGetURIs,
recentChooserAddFilter,
recentChooserRemoveFilter,
recentChooserListFilters,
recentChooserShowPrivate,
recentChooserShowTips,
recentChooserShowIcons,
recentChooserShowNotFound,
recentChooserSelectMultiple,
recentChooserLocalOnly,
recentChooserLimit,
recentChooserSortType,
recentChooserFilter,
recentChooserSelectionChanged,
recentChooserItemActivated,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.Attributes
import System.Glib.Properties
import System.Glib.GList
import System.Glib.GError (checkGError)
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Recent.RecentInfo (RecentInfo, mkRecentInfo)
import Graphics.UI.Gtk.Types
{-# LINE 105 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
import Graphics.UI.Gtk.Signals
{-# LINE 106 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
{-# LINE 108 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
data RecentChooserError = RecentChooserErrorNotFound
| RecentChooserErrorInvalidUri
deriving (Int -> RecentChooserError
RecentChooserError -> Int
RecentChooserError -> [RecentChooserError]
RecentChooserError -> RecentChooserError
RecentChooserError -> RecentChooserError -> [RecentChooserError]
RecentChooserError
-> RecentChooserError -> RecentChooserError -> [RecentChooserError]
(RecentChooserError -> RecentChooserError)
-> (RecentChooserError -> RecentChooserError)
-> (Int -> RecentChooserError)
-> (RecentChooserError -> Int)
-> (RecentChooserError -> [RecentChooserError])
-> (RecentChooserError
-> RecentChooserError -> [RecentChooserError])
-> (RecentChooserError
-> RecentChooserError -> [RecentChooserError])
-> (RecentChooserError
-> RecentChooserError
-> RecentChooserError
-> [RecentChooserError])
-> Enum RecentChooserError
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: RecentChooserError -> RecentChooserError
succ :: RecentChooserError -> RecentChooserError
$cpred :: RecentChooserError -> RecentChooserError
pred :: RecentChooserError -> RecentChooserError
$ctoEnum :: Int -> RecentChooserError
toEnum :: Int -> RecentChooserError
$cfromEnum :: RecentChooserError -> Int
fromEnum :: RecentChooserError -> Int
$cenumFrom :: RecentChooserError -> [RecentChooserError]
enumFrom :: RecentChooserError -> [RecentChooserError]
$cenumFromThen :: RecentChooserError -> RecentChooserError -> [RecentChooserError]
enumFromThen :: RecentChooserError -> RecentChooserError -> [RecentChooserError]
$cenumFromTo :: RecentChooserError -> RecentChooserError -> [RecentChooserError]
enumFromTo :: RecentChooserError -> RecentChooserError -> [RecentChooserError]
$cenumFromThenTo :: RecentChooserError
-> RecentChooserError -> RecentChooserError -> [RecentChooserError]
enumFromThenTo :: RecentChooserError
-> RecentChooserError -> RecentChooserError -> [RecentChooserError]
Enum,RecentChooserError
RecentChooserError
-> RecentChooserError -> Bounded RecentChooserError
forall a. a -> a -> Bounded a
$cminBound :: RecentChooserError
minBound :: RecentChooserError
$cmaxBound :: RecentChooserError
maxBound :: RecentChooserError
Bounded,RecentChooserError -> RecentChooserError -> Bool
(RecentChooserError -> RecentChooserError -> Bool)
-> (RecentChooserError -> RecentChooserError -> Bool)
-> Eq RecentChooserError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RecentChooserError -> RecentChooserError -> Bool
== :: RecentChooserError -> RecentChooserError -> Bool
$c/= :: RecentChooserError -> RecentChooserError -> Bool
/= :: RecentChooserError -> RecentChooserError -> Bool
Eq,Int -> RecentChooserError -> ShowS
[RecentChooserError] -> ShowS
RecentChooserError -> String
(Int -> RecentChooserError -> ShowS)
-> (RecentChooserError -> String)
-> ([RecentChooserError] -> ShowS)
-> Show RecentChooserError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RecentChooserError -> ShowS
showsPrec :: Int -> RecentChooserError -> ShowS
$cshow :: RecentChooserError -> String
show :: RecentChooserError -> String
$cshowList :: [RecentChooserError] -> ShowS
showList :: [RecentChooserError] -> ShowS
Show)
{-# LINE 113 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
data RecentSortType = RecentSortNone
| RecentSortMru
| RecentSortLru
| RecentSortCustom
deriving (Bounded,Eq,Show)
instance Enum RecentSortType where
fromEnum :: RecentSortType -> Int
fromEnum RecentSortType
RecentSortNone = Int
0
fromEnum RecentSortType
RecentSortMru = Int
1
fromEnum RecentSortType
RecentSortLru = Int
2
fromEnum RecentSortType
RecentSortCustom = Int
3
toEnum 0 = RecentSortNone
toEnum 1 = RecentSortMru
toEnum 2 = RecentSortLru
toEnum 3 = RecentSortCustom
toEnum unmatched = error ("RecentSortType.toEnum: Cannot match " ++ show unmatched)
succ RecentSortNone = RecentSortMru
succ RecentSortMru = RecentSortLru
succ RecentSortLru = RecentSortCustom
succ _ = undefined
pred RecentSortMru = RecentSortNone
pred RecentSortLru = RecentSortMru
pred RecentSortCustom = RecentSortLru
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x RecentSortCustom
enumFromThen _ _ = error "Enum RecentSortType: enumFromThen not implemented"
enumFromThenTo :: RecentSortType
-> RecentSortType -> RecentSortType -> [RecentSortType]
enumFromThenTo RecentSortType
_ RecentSortType
_ RecentSortType
_ = String -> [RecentSortType]
forall a. HasCallStack => String -> a
error String
"Enum RecentSortType: enumFromThenTo not implemented"
{-# LINE 116 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
recentChooserSetSortFunc :: RecentChooserClass self => self
-> (Maybe (RecentInfo -> IO Int))
-> IO ()
recentChooserSetSortFunc self Nothing =
(\(RecentChooser arg1) arg2 arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->gtk_recent_chooser_set_sort_func argPtr1 arg2 arg3 arg4)
{-# LINE 136 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
(toRecentChooser self) nullFunPtr nullPtr nullFunPtr
recentChooserSetSortFunc self (Just func) = do
fPtr <- mkRecentSortFunc $ \_ infoPtr _ -> do
info <- mkRecentInfo infoPtr
liftM fromIntegral (func info)
(\(RecentChooser arg1) arg2 arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->gtk_recent_chooser_set_sort_func argPtr1 arg2 arg3 arg4)
{-# LINE 142 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
(toRecentChooser self)
fPtr
(castFunPtrToPtr fPtr)
destroyFunPtr
type RecentSortFunc = FunPtr (((Ptr RecentInfo) -> ((Ptr RecentInfo) -> ((Ptr ()) -> (IO CInt)))))
{-# LINE 148 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
foreign import ccall "wrapper" mkRecentSortFunc ::
(Ptr RecentInfo -> Ptr RecentInfo -> Ptr () -> IO (CInt))
-> IO RecentSortFunc
recentChooserSetCurrentURI :: (RecentChooserClass self, GlibString string) => self
-> string
-> IO Bool
recentChooserSetCurrentURI :: forall self string.
(RecentChooserClass self, GlibString string) =>
self -> string -> IO Bool
recentChooserSetCurrentURI self
self string
uri =
(Ptr (Ptr ()) -> IO Bool) -> (GError -> IO Bool) -> IO Bool
forall a. (Ptr (Ptr ()) -> IO a) -> (GError -> IO a) -> IO a
checkGError ( \Ptr (Ptr ())
errorPtr ->
(CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
string -> (CString -> IO CInt) -> IO CInt
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
uri ((CString -> IO CInt) -> IO CInt)
-> (CString -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \CString
uriPtr ->
(\(RecentChooser ForeignPtr RecentChooser
arg1) CString
arg2 Ptr (Ptr ())
arg3 -> ForeignPtr RecentChooser
-> (Ptr RecentChooser -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentChooser
arg1 ((Ptr RecentChooser -> IO CInt) -> IO CInt)
-> (Ptr RecentChooser -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr RecentChooser
argPtr1 ->Ptr RecentChooser -> CString -> Ptr (Ptr ()) -> IO CInt
gtk_recent_chooser_set_current_uri Ptr RecentChooser
argPtr1 CString
arg2 Ptr (Ptr ())
arg3)
{-# LINE 166 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
(self -> RecentChooser
forall o. RecentChooserClass o => o -> RecentChooser
toRecentChooser self
self)
CString
uriPtr
Ptr (Ptr ())
errorPtr)
(\GError
_ -> Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
False)
recentChooserGetCurrentURI :: (RecentChooserClass self, GlibString string) => self
-> IO string
recentChooserGetCurrentURI :: forall self string.
(RecentChooserClass self, GlibString string) =>
self -> IO string
recentChooserGetCurrentURI self
self =
(\(RecentChooser ForeignPtr RecentChooser
arg1) -> ForeignPtr RecentChooser
-> (Ptr RecentChooser -> IO CString) -> IO CString
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentChooser
arg1 ((Ptr RecentChooser -> IO CString) -> IO CString)
-> (Ptr RecentChooser -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ \Ptr RecentChooser
argPtr1 ->Ptr RecentChooser -> IO CString
gtk_recent_chooser_get_current_uri Ptr RecentChooser
argPtr1)
{-# LINE 180 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
(toRecentChooser self)
IO CString -> (CString -> IO string) -> IO string
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= CString -> IO string
forall s. GlibString s => CString -> IO s
readUTFString
recentChooserGetCurrentItem :: RecentChooserClass self => self
-> IO RecentInfo
recentChooserGetCurrentItem :: forall self. RecentChooserClass self => self -> IO RecentInfo
recentChooserGetCurrentItem self
self = do
Ptr RecentInfo
info <- (\(RecentChooser ForeignPtr RecentChooser
arg1) -> ForeignPtr RecentChooser
-> (Ptr RecentChooser -> IO (Ptr RecentInfo))
-> IO (Ptr RecentInfo)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentChooser
arg1 ((Ptr RecentChooser -> IO (Ptr RecentInfo)) -> IO (Ptr RecentInfo))
-> (Ptr RecentChooser -> IO (Ptr RecentInfo))
-> IO (Ptr RecentInfo)
forall a b. (a -> b) -> a -> b
$ \Ptr RecentChooser
argPtr1 ->Ptr RecentChooser -> IO (Ptr RecentInfo)
gtk_recent_chooser_get_current_item Ptr RecentChooser
argPtr1) (self -> RecentChooser
forall o. RecentChooserClass o => o -> RecentChooser
toRecentChooser self
self)
Ptr RecentInfo -> IO RecentInfo
mkRecentInfo Ptr RecentInfo
info
recentChooserSelectURI :: (RecentChooserClass self, GlibString string) => self
-> string
-> IO Bool
recentChooserSelectURI :: forall self string.
(RecentChooserClass self, GlibString string) =>
self -> string -> IO Bool
recentChooserSelectURI self
self string
uri =
(Ptr (Ptr ()) -> IO Bool) -> (GError -> IO Bool) -> IO Bool
forall a. (Ptr (Ptr ()) -> IO a) -> (GError -> IO a) -> IO a
checkGError ( \Ptr (Ptr ())
errorPtr ->
(CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
string -> (CString -> IO CInt) -> IO CInt
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
uri ((CString -> IO CInt) -> IO CInt)
-> (CString -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \CString
uriPtr ->
(\(RecentChooser ForeignPtr RecentChooser
arg1) CString
arg2 Ptr (Ptr ())
arg3 -> ForeignPtr RecentChooser
-> (Ptr RecentChooser -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentChooser
arg1 ((Ptr RecentChooser -> IO CInt) -> IO CInt)
-> (Ptr RecentChooser -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr RecentChooser
argPtr1 ->Ptr RecentChooser -> CString -> Ptr (Ptr ()) -> IO CInt
gtk_recent_chooser_select_uri Ptr RecentChooser
argPtr1 CString
arg2 Ptr (Ptr ())
arg3)
{-# LINE 210 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
(self -> RecentChooser
forall o. RecentChooserClass o => o -> RecentChooser
toRecentChooser self
self)
CString
uriPtr
Ptr (Ptr ())
errorPtr)
(\GError
_ -> Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
False)
recentChooserUnselectURI :: (RecentChooserClass self, GlibString string) => self
-> string
-> IO ()
recentChooserUnselectURI :: forall self string.
(RecentChooserClass self, GlibString string) =>
self -> string -> IO ()
recentChooserUnselectURI self
self string
uri =
string -> (CString -> IO ()) -> IO ()
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
uri ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
uriPtr ->
(\(RecentChooser ForeignPtr RecentChooser
arg1) CString
arg2 -> ForeignPtr RecentChooser -> (Ptr RecentChooser -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentChooser
arg1 ((Ptr RecentChooser -> IO ()) -> IO ())
-> (Ptr RecentChooser -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentChooser
argPtr1 ->Ptr RecentChooser -> CString -> IO ()
gtk_recent_chooser_unselect_uri Ptr RecentChooser
argPtr1 CString
arg2)
{-# LINE 226 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
(toRecentChooser self)
CString
uriPtr
recentChooserSelectAll :: RecentChooserClass self => self -> IO ()
recentChooserSelectAll :: forall self. RecentChooserClass self => self -> IO ()
recentChooserSelectAll self
self =
(\(RecentChooser ForeignPtr RecentChooser
arg1) -> ForeignPtr RecentChooser -> (Ptr RecentChooser -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentChooser
arg1 ((Ptr RecentChooser -> IO ()) -> IO ())
-> (Ptr RecentChooser -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentChooser
argPtr1 ->Ptr RecentChooser -> IO ()
gtk_recent_chooser_select_all Ptr RecentChooser
argPtr1)
{-# LINE 238 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
(toRecentChooser self)
recentChooserUnselectAll :: RecentChooserClass self => self -> IO ()
recentChooserUnselectAll :: forall self. RecentChooserClass self => self -> IO ()
recentChooserUnselectAll self
self =
(\(RecentChooser ForeignPtr RecentChooser
arg1) -> ForeignPtr RecentChooser -> (Ptr RecentChooser -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentChooser
arg1 ((Ptr RecentChooser -> IO ()) -> IO ())
-> (Ptr RecentChooser -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentChooser
argPtr1 ->Ptr RecentChooser -> IO ()
gtk_recent_chooser_unselect_all Ptr RecentChooser
argPtr1)
{-# LINE 248 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
(toRecentChooser self)
recentChooserGetItems :: RecentChooserClass self => self
-> IO [RecentInfo]
recentChooserGetItems :: forall self. RecentChooserClass self => self -> IO [RecentInfo]
recentChooserGetItems self
self = do
Ptr ()
glist <- (\(RecentChooser ForeignPtr RecentChooser
arg1) -> ForeignPtr RecentChooser
-> (Ptr RecentChooser -> IO (Ptr ())) -> IO (Ptr ())
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentChooser
arg1 ((Ptr RecentChooser -> IO (Ptr ())) -> IO (Ptr ()))
-> (Ptr RecentChooser -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Ptr RecentChooser
argPtr1 ->Ptr RecentChooser -> IO (Ptr ())
gtk_recent_chooser_get_items Ptr RecentChooser
argPtr1) (self -> RecentChooser
forall o. RecentChooserClass o => o -> RecentChooser
toRecentChooser self
self)
[Ptr RecentInfo]
list <- Ptr () -> IO [Ptr RecentInfo]
forall a. Ptr () -> IO [Ptr a]
fromGList Ptr ()
glist
(Ptr RecentInfo -> IO RecentInfo)
-> [Ptr RecentInfo] -> IO [RecentInfo]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM Ptr RecentInfo -> IO RecentInfo
mkRecentInfo [Ptr RecentInfo]
list
recentChooserGetURIs :: (RecentChooserClass self, GlibString string) => self
-> IO [string]
recentChooserGetURIs :: forall self string.
(RecentChooserClass self, GlibString string) =>
self -> IO [string]
recentChooserGetURIs self
self =
(Ptr CULong -> IO [string]) -> IO [string]
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CULong -> IO [string]) -> IO [string])
-> (Ptr CULong -> IO [string]) -> IO [string]
forall a b. (a -> b) -> a -> b
$ \Ptr CULong
lengthPtr -> do
Ptr CString
str <- (\(RecentChooser ForeignPtr RecentChooser
arg1) Ptr CULong
arg2 -> ForeignPtr RecentChooser
-> (Ptr RecentChooser -> IO (Ptr CString)) -> IO (Ptr CString)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentChooser
arg1 ((Ptr RecentChooser -> IO (Ptr CString)) -> IO (Ptr CString))
-> (Ptr RecentChooser -> IO (Ptr CString)) -> IO (Ptr CString)
forall a b. (a -> b) -> a -> b
$ \Ptr RecentChooser
argPtr1 ->Ptr RecentChooser -> Ptr CULong -> IO (Ptr CString)
gtk_recent_chooser_get_uris Ptr RecentChooser
argPtr1 Ptr CULong
arg2)
{-# LINE 275 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
(self -> RecentChooser
forall o. RecentChooserClass o => o -> RecentChooser
toRecentChooser self
self)
Ptr CULong
lengthPtr
CULong
length <- Ptr CULong -> IO CULong
forall a. Storable a => Ptr a -> IO a
peek Ptr CULong
lengthPtr
(CString -> IO string) -> [CString] -> IO [string]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM CString -> IO string
forall s. GlibString s => CString -> IO s
peekUTFString ([CString] -> IO [string]) -> IO [CString] -> IO [string]
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Int -> Ptr CString -> IO [CString]
forall a. Storable a => Int -> Ptr a -> IO [a]
peekArray (CULong -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CULong
length) Ptr CString
str
recentChooserAddFilter :: (RecentChooserClass self, RecentFilterClass filter) => self
-> filter
-> IO ()
recentChooserAddFilter :: forall self filter.
(RecentChooserClass self, RecentFilterClass filter) =>
self -> filter -> IO ()
recentChooserAddFilter self
self filter
filter =
(\(RecentChooser ForeignPtr RecentChooser
arg1) (RecentFilter ForeignPtr RecentFilter
arg2) -> ForeignPtr RecentChooser -> (Ptr RecentChooser -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentChooser
arg1 ((Ptr RecentChooser -> IO ()) -> IO ())
-> (Ptr RecentChooser -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentChooser
argPtr1 ->ForeignPtr RecentFilter -> (Ptr RecentFilter -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentFilter
arg2 ((Ptr RecentFilter -> IO ()) -> IO ())
-> (Ptr RecentFilter -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentFilter
argPtr2 ->Ptr RecentChooser -> Ptr RecentFilter -> IO ()
gtk_recent_chooser_add_filter Ptr RecentChooser
argPtr1 Ptr RecentFilter
argPtr2)
{-# LINE 293 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
(toRecentChooser self)
(filter -> RecentFilter
forall o. RecentFilterClass o => o -> RecentFilter
toRecentFilter filter
filter)
recentChooserRemoveFilter :: (RecentChooserClass self, RecentFilterClass filter) => self
-> filter
-> IO ()
recentChooserRemoveFilter :: forall self filter.
(RecentChooserClass self, RecentFilterClass filter) =>
self -> filter -> IO ()
recentChooserRemoveFilter self
self filter
filter =
(\(RecentChooser ForeignPtr RecentChooser
arg1) (RecentFilter ForeignPtr RecentFilter
arg2) -> ForeignPtr RecentChooser -> (Ptr RecentChooser -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentChooser
arg1 ((Ptr RecentChooser -> IO ()) -> IO ())
-> (Ptr RecentChooser -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentChooser
argPtr1 ->ForeignPtr RecentFilter -> (Ptr RecentFilter -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentFilter
arg2 ((Ptr RecentFilter -> IO ()) -> IO ())
-> (Ptr RecentFilter -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentFilter
argPtr2 ->Ptr RecentChooser -> Ptr RecentFilter -> IO ()
gtk_recent_chooser_remove_filter Ptr RecentChooser
argPtr1 Ptr RecentFilter
argPtr2)
{-# LINE 304 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
(toRecentChooser self)
(filter -> RecentFilter
forall o. RecentFilterClass o => o -> RecentFilter
toRecentFilter filter
filter)
recentChooserListFilters :: RecentChooserClass self => self
-> IO [RecentFilter]
recentChooserListFilters :: forall self. RecentChooserClass self => self -> IO [RecentFilter]
recentChooserListFilters self
self = do
Ptr ()
glist <- (\(RecentChooser ForeignPtr RecentChooser
arg1) -> ForeignPtr RecentChooser
-> (Ptr RecentChooser -> IO (Ptr ())) -> IO (Ptr ())
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr RecentChooser
arg1 ((Ptr RecentChooser -> IO (Ptr ())) -> IO (Ptr ()))
-> (Ptr RecentChooser -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Ptr RecentChooser
argPtr1 ->Ptr RecentChooser -> IO (Ptr ())
gtk_recent_chooser_list_filters Ptr RecentChooser
argPtr1)
{-# LINE 316 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
(self -> RecentChooser
forall o. RecentChooserClass o => o -> RecentChooser
toRecentChooser self
self)
[Ptr Any]
list <- Ptr () -> IO [Ptr Any]
forall a. Ptr () -> IO [Ptr a]
fromGList Ptr ()
glist
(Ptr Any -> IO RecentFilter) -> [Ptr Any] -> IO [RecentFilter]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (\Ptr Any
x -> (ForeignPtr RecentFilter -> RecentFilter,
FinalizerPtr RecentFilter)
-> IO (Ptr RecentFilter) -> IO RecentFilter
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr RecentFilter -> RecentFilter,
FinalizerPtr RecentFilter)
forall {a}.
(ForeignPtr RecentFilter -> RecentFilter, FinalizerPtr a)
mkRecentFilter (Ptr RecentFilter -> IO (Ptr RecentFilter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> Ptr RecentFilter
forall a b. Ptr a -> Ptr b
castPtr Ptr Any
x))) [Ptr Any]
list
recentChooserShowPrivate :: RecentChooserClass self => Attr self Bool
recentChooserShowPrivate :: forall self. RecentChooserClass self => Attr self Bool
recentChooserShowPrivate = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"show-private"
recentChooserShowTips :: RecentChooserClass self => Attr self Bool
recentChooserShowTips :: forall self. RecentChooserClass self => Attr self Bool
recentChooserShowTips = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"show-tips"
recentChooserShowIcons :: RecentChooserClass self => Attr self Bool
recentChooserShowIcons :: forall self. RecentChooserClass self => Attr self Bool
recentChooserShowIcons = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"show-icons"
recentChooserShowNotFound :: RecentChooserClass self => Attr self Bool
recentChooserShowNotFound :: forall self. RecentChooserClass self => Attr self Bool
recentChooserShowNotFound = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"show-not-found"
recentChooserSelectMultiple :: RecentChooserClass self => Attr self Bool
recentChooserSelectMultiple :: forall self. RecentChooserClass self => Attr self Bool
recentChooserSelectMultiple = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"select-multiple"
recentChooserLocalOnly :: RecentChooserClass self => Attr self Bool
recentChooserLocalOnly :: forall self. RecentChooserClass self => Attr self Bool
recentChooserLocalOnly = String -> Attr self Bool
forall gobj. GObjectClass gobj => String -> Attr gobj Bool
newAttrFromBoolProperty String
"local-only"
recentChooserLimit :: RecentChooserClass self => Attr self Int
recentChooserLimit :: forall self. RecentChooserClass self => Attr self Int
recentChooserLimit = String -> Attr self Int
forall gobj. GObjectClass gobj => String -> Attr gobj Int
newAttrFromIntProperty String
"limit"
recentChooserSortType :: RecentChooserClass self => Attr self RecentSortType
recentChooserSortType :: forall self. RecentChooserClass self => Attr self RecentSortType
recentChooserSortType = String -> CULong -> Attr self RecentSortType
forall gobj enum.
(GObjectClass gobj, Enum enum) =>
String -> CULong -> Attr gobj enum
newAttrFromEnumProperty String
"sort-type"
CULong
gtk_recent_sort_type_get_type
{-# LINE 409 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
recentChooserFilter :: (RecentChooserClass self, RecentFilterClass recentFilter) => ReadWriteAttr self RecentFilter recentFilter
recentChooserFilter :: forall self recentFilter.
(RecentChooserClass self, RecentFilterClass recentFilter) =>
ReadWriteAttr self RecentFilter recentFilter
recentChooserFilter = String -> CULong -> ReadWriteAttr self RecentFilter recentFilter
forall gobj gobj' gobj''.
(GObjectClass gobj, GObjectClass gobj', GObjectClass gobj'') =>
String -> CULong -> ReadWriteAttr gobj gobj' gobj''
newAttrFromObjectProperty String
"filter"
CULong
gtk_recent_filter_get_type
{-# LINE 418 "./Graphics/UI/Gtk/Recent/RecentChooser.chs" #-}
recentChooserSelectionChanged :: RecentChooserClass self => Signal self (IO ())
recentChooserSelectionChanged :: forall self. RecentChooserClass self => Signal self (IO ())
recentChooserSelectionChanged = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE String
"selection_changed")
recentChooserItemActivated :: RecentChooserClass self => Signal self (IO ())
recentChooserItemActivated :: forall self. RecentChooserClass self => Signal self (IO ())
recentChooserItemActivated = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE String
"item_activated")
foreign import ccall safe "gtk_recent_chooser_set_sort_func"
gtk_recent_chooser_set_sort_func :: ((Ptr RecentChooser) -> ((FunPtr ((Ptr RecentInfo) -> ((Ptr RecentInfo) -> ((Ptr ()) -> (IO CInt))))) -> ((Ptr ()) -> ((FunPtr ((Ptr ()) -> (IO ()))) -> (IO ())))))
foreign import ccall safe "gtk_recent_chooser_set_current_uri"
gtk_recent_chooser_set_current_uri :: ((Ptr RecentChooser) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO CInt))))
foreign import ccall safe "gtk_recent_chooser_get_current_uri"
gtk_recent_chooser_get_current_uri :: ((Ptr RecentChooser) -> (IO (Ptr CChar)))
foreign import ccall safe "gtk_recent_chooser_get_current_item"
gtk_recent_chooser_get_current_item :: ((Ptr RecentChooser) -> (IO (Ptr RecentInfo)))
foreign import ccall safe "gtk_recent_chooser_select_uri"
gtk_recent_chooser_select_uri :: ((Ptr RecentChooser) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO CInt))))
foreign import ccall safe "gtk_recent_chooser_unselect_uri"
gtk_recent_chooser_unselect_uri :: ((Ptr RecentChooser) -> ((Ptr CChar) -> (IO ())))
foreign import ccall safe "gtk_recent_chooser_select_all"
gtk_recent_chooser_select_all :: ((Ptr RecentChooser) -> (IO ()))
foreign import ccall safe "gtk_recent_chooser_unselect_all"
gtk_recent_chooser_unselect_all :: ((Ptr RecentChooser) -> (IO ()))
foreign import ccall safe "gtk_recent_chooser_get_items"
gtk_recent_chooser_get_items :: ((Ptr RecentChooser) -> (IO (Ptr ())))
foreign import ccall safe "gtk_recent_chooser_get_uris"
gtk_recent_chooser_get_uris :: ((Ptr RecentChooser) -> ((Ptr CULong) -> (IO (Ptr (Ptr CChar)))))
foreign import ccall safe "gtk_recent_chooser_add_filter"
gtk_recent_chooser_add_filter :: ((Ptr RecentChooser) -> ((Ptr RecentFilter) -> (IO ())))
foreign import ccall safe "gtk_recent_chooser_remove_filter"
gtk_recent_chooser_remove_filter :: ((Ptr RecentChooser) -> ((Ptr RecentFilter) -> (IO ())))
foreign import ccall safe "gtk_recent_chooser_list_filters"
gtk_recent_chooser_list_filters :: ((Ptr RecentChooser) -> (IO (Ptr ())))
foreign import ccall unsafe "gtk_recent_sort_type_get_type"
gtk_recent_sort_type_get_type :: CULong
foreign import ccall unsafe "gtk_recent_filter_get_type"
gtk_recent_filter_get_type :: CULong