You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
(68) |
Aug
(4) |
Sep
|
Oct
(23) |
Nov
(95) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
|
Mar
|
Apr
(51) |
May
(81) |
Jun
(2) |
Jul
(86) |
Aug
(143) |
Sep
(3) |
Oct
(31) |
Nov
(63) |
Dec
(90) |
2005 |
Jan
(277) |
Feb
(157) |
Mar
(99) |
Apr
(195) |
May
(151) |
Jun
(148) |
Jul
(98) |
Aug
(123) |
Sep
(20) |
Oct
(174) |
Nov
(155) |
Dec
(26) |
2006 |
Jan
(51) |
Feb
(19) |
Mar
(16) |
Apr
(12) |
May
(5) |
Jun
|
Jul
(11) |
Aug
(7) |
Sep
(10) |
Oct
(31) |
Nov
(174) |
Dec
(56) |
2007 |
Jan
(45) |
Feb
(52) |
Mar
(10) |
Apr
(5) |
May
(47) |
Jun
(16) |
Jul
(80) |
Aug
(29) |
Sep
(14) |
Oct
(59) |
Nov
(46) |
Dec
(16) |
2008 |
Jan
(10) |
Feb
(1) |
Mar
|
Apr
|
May
(49) |
Jun
(26) |
Jul
(8) |
Aug
(4) |
Sep
(25) |
Oct
(53) |
Nov
(9) |
Dec
(1) |
2009 |
Jan
(66) |
Feb
(11) |
Mar
(1) |
Apr
(14) |
May
(8) |
Jun
(1) |
Jul
(2) |
Aug
(2) |
Sep
(9) |
Oct
(23) |
Nov
(35) |
Dec
|
2010 |
Jan
(7) |
Feb
(2) |
Mar
(39) |
Apr
(19) |
May
(161) |
Jun
(19) |
Jul
(32) |
Aug
(65) |
Sep
(113) |
Oct
(120) |
Nov
(2) |
Dec
|
2012 |
Jan
|
Feb
(5) |
Mar
(4) |
Apr
(7) |
May
(9) |
Jun
(14) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(12) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
(17) |
Mar
(4) |
Apr
(4) |
May
(9) |
Jun
|
Jul
(8) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Andy S. <And...@co...> - 2010-08-20 07:34:05
|
diffing dir... Fri Aug 20 03:30:38 EDT 2010 Andy Stewart <laz...@gm...> * Remove g_list_free from contentTypesGetRegistered (fromGList free GList) Ignore-this: c0bd4b1934151593735983781b09a53c hunk ./gio/System/GIO/File/ContentType.chs 190 - {# call unsafe g_list_free #} glistPtr |
From: Andy S. <And...@co...> - 2010-08-20 07:34:02
|
diffing dir... Fri Aug 20 03:28:53 EDT 2010 Andy Stewart <laz...@gm...> * Fix docs Ignore-this: 365eb686a956c0751d1b589a4063de18 hunk ./gio/System/GIO/File/ContentType.chs 178 - -> IO [String] -- ^ returns an 'Nothing'-terminated array of zero or more content types + -> IO [String] -- ^ returns a list of possible content types |
From: Andy S. <And...@co...> - 2010-08-20 07:33:59
|
diffing dir... Fri Aug 20 03:27:29 EDT 2010 Andy Stewart <laz...@gm...> * Use unsafePerformIO wrap contentTypeFromMimeType Ignore-this: d56f9609209674c5965a625a0dea3ea9 { hunk ./gio/System/GIO/File/ContentType.chs 139 - -> IO String [_$_] + -> String [_$_] hunk ./gio/System/GIO/File/ContentType.chs 141 + unsafePerformIO $ } |
From: Andy S. <And...@co...> - 2010-08-20 07:33:58
|
diffing dir... Fri Aug 20 03:26:34 EDT 2010 Andy Stewart <laz...@gm...> * Change appInfoGetId to 'IO (Maybe String)' Ignore-this: 89d11b9f1abd8d02cb7c962f71789440 { hunk ./gio/System/GIO/File/AppInfo.chs 148 - -> Maybe String + -> IO (Maybe String) hunk ./gio/System/GIO/File/AppInfo.chs 150 - unsafePerformIO $ [_$_] } |
From: Andy S. <And...@co...> - 2010-08-20 07:05:34
|
diffing dir... Sun Aug 15 14:20:50 EDT 2010 Andy Stewart <laz...@gm...> * Add new module System.GIO.File.ContentType Ignore-this: bde0c7cca0295d4312be28d3d8c031f4 { hunk ./gio/System/GIO.hs 33 - module System.GIO.File.File, hunk ./gio/System/GIO.hs 34 + module System.GIO.File.ContentType, + module System.GIO.File.File, hunk ./gio/System/GIO.hs 41 -import System.GIO.File.File hunk ./gio/System/GIO.hs 42 +import System.GIO.File.ContentType +import System.GIO.File.File addfile ./gio/System/GIO/File/ContentType.chs hunk ./gio/System/GIO/File/ContentType.chs 1 +{-# LANGUAGE CPP #-} +-- GIMP Toolkit (GTK) Binding for Haskell: binding to gio -*-haskell-*- +-- +-- Author : Andy Stewart +-- Created: 30-Apirl-2010 +-- +-- Copyright (c) 2010 Andy Stewart +-- +-- This library is free software: you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation, either version 3 of +-- the License, or (at your option) any later version. +-- [_$_] +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- [_$_] +-- You should have received a copy of the GNU Lesser General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/>. +-- [_$_] +-- GIO, the C library which this Haskell library depends on, is +-- available under LGPL Version 2. The documentation included with +-- this library is based on the original GIO documentation. +-- [_$_] +-- | Maintainer : gtk...@li... +-- Stability : alpha +-- Portability : portable (depends on GHC) +module System.GIO.File.ContentType ( +-- * Details +-- +-- | A content type is a platform specific string that defines the type of a file. On unix it is a mime +-- type, on win32 it is an extension string like ".doc", ".txt" or a percieved string like +-- "audio". Such strings can be looked up in the registry at HkeyClassesRoot. + +-- * Methods + contentTypeEquals, + contentTypeIsA, + contentTypeIsUnknown, + contentTypeGetDescription, + contentTypeGetMimeType, + contentTypeGetIcon, + contentTypeCanBeExecutable, +#if GLIB_CHECK_VERSION(2,18,0) + contentTypeFromMimeType, +#endif + contentTypeGuess, +#if GLIB_CHECK_VERSION(2,18,0) + contentTypeGuessForTree, +#endif + contentTypesGetRegistered, + ) where + +import Control.Monad +import System.GIO.Enums +import System.Glib.FFI +import System.Glib.Flags +import System.Glib.GError +import System.Glib.GList +import System.Glib.GObject +import System.Glib.UTFString +{#import System.GIO.Types#} + +{# context lib = "gio" prefix = "g" #} + +-- | Compares two content types for equality. +contentTypeEquals :: [_$_] + String [_$_] + -> String [_$_] + -> Bool -- ^ returns 'True' if the two strings are identical or equivalent, 'False' otherwise. +contentTypeEquals type1 type2 = [_$_] + toBool $ unsafePerformIO $ + withUTFString type1 $ \ type1Ptr -> [_$_] + withUTFString type2 $ \ type2Ptr -> [_$_] + {#call g_content_type_equals#} type1Ptr type2Ptr + +-- | Determines if type is a subset of supertype. +contentTypeIsA :: [_$_] + String [_$_] + -> String [_$_] + -> Bool -- ^ returns 'True' if type is a kind of supertype, 'False' otherwise. [_$_] +contentTypeIsA type1 supertype = [_$_] + toBool $ unsafePerformIO $ + withUTFString type1 $ \ type1Ptr -> [_$_] + withUTFString supertype $ \ supertypePtr -> [_$_] + {#call g_content_type_equals#} type1Ptr supertypePtr + +-- | Checks if the content type is the generic "unknown" type. On unix this is the +-- "application/octet-stream" mimetype, while on win32 it is \"*\". +contentTypeIsUnknown :: String + -> Bool -- ^ returns 'True' if the type is the unknown type. [_$_] +contentTypeIsUnknown typ = + toBool $ unsafePerformIO $ + withUTFString typ $ \ typPtr -> [_$_] + {#call g_content_type_is_unknown#} typPtr + +-- | Gets the human readable description of the content type. +contentTypeGetDescription :: [_$_] + String [_$_] + -> String -- ^ returns a short description of the content type type. [_$_] +contentTypeGetDescription typ = [_$_] + unsafePerformIO $ + withUTFString typ $ \ typPtr -> [_$_] + {#call g_content_type_get_description#} typPtr + >>= readUTFString + +-- | Gets the mime-type for the content type. If one is registered +contentTypeGetMimeType :: [_$_] + String [_$_] + -> String -- ^ returns the registered mime-type for the given type, or 'Nothing' if unknown. [_$_] +contentTypeGetMimeType typ = [_$_] + unsafePerformIO $ + withUTFString typ $ \ typPtr -> [_$_] + {#call g_content_type_get_mime_type#} typPtr + >>= readUTFString + +-- | Gets the icon for a content type. +contentTypeGetIcon :: String [_$_] + -> Icon -- ^ returns 'Icon' corresponding to the content type. [_$_] +contentTypeGetIcon typ = [_$_] + unsafePerformIO $ makeNewGObject mkIcon $ + withUTFString typ $ \ typPtr -> [_$_] + {#call g_content_type_get_icon#} typPtr + +-- | Checks if a content type can be executable. Note that for instance things like text files can be +-- executables (i.e. scripts and batch files). +contentTypeCanBeExecutable :: String [_$_] + -> Bool -- ^ returns 'True' if the file type corresponds to a type that can be executable, 'False' otherwise. +contentTypeCanBeExecutable typ = + toBool $ unsafePerformIO $ + withUTFString typ $ \ typPtr -> [_$_] + {#call g_content_type_can_be_executable#} typPtr + +#if GLIB_CHECK_VERSION(2,18,0) +-- | Tries to find a content type based on the mime type name. +contentTypeFromMimeType :: [_$_] + String -- ^ @mimeType@ a mime type string. [_$_] + -> IO String [_$_] +contentTypeFromMimeType mimeType = + withUTFString mimeType $ \ mimeTypePtr -> [_$_] + {#call g_content_type_from_mime_type#} mimeTypePtr + >>= readUTFString +#endif + +-- | Guesses the content type based on example data. If the function is uncertain, @resultUncertain@ will +-- be set to 'True'. Either filename or data may be 'Nothing', in which case the guess will be based solely on +-- the other argument. +contentTypeGuess :: String + -> String -- ^ @data@ a stream of data, + -> Int -- ^ @dataSize@ the size of data [_$_] + -> IO (Bool, String) -- ^ returns a string indicating a guessed content type for the given data. +contentTypeGuess filename dat dataSize = + withUTFString filename $ \ filenamePtr -> [_$_] + withUTFString dat $ \ datPtr -> [_$_] + alloca $ \ resultUncertainPtr -> do + strPtr <- {#call g_content_type_guess#} [_$_] + filenamePtr [_$_] + (castPtr datPtr) + (fromIntegral dataSize) + (castPtr resultUncertainPtr) + resultUncertain <- peek resultUncertainPtr + str <- readUTFString strPtr + return (resultUncertain, str) + +#if GLIB_CHECK_VERSION(2,18,0) +-- | Tries to guess the type of the tree with root root, by looking at the files it contains. The result +-- is an array of content types, with the best guess coming first. +-- [_$_] +-- The types returned all have the form x-content/foo, e.g. x-content/audio-cdda (for audio CDs) or +-- x-content/image-dcf (for a camera memory card). See the shared-mime-info specification for more on +-- x-content types. +-- [_$_] +-- This function is useful in the implementation of 'mountGuessContentType'. +contentTypeGuessForTree :: FileClass file + => file -- ^ @root@ the root of the tree to guess a type for [_$_] + -> IO [String] -- ^ returns an 'Nothing'-terminated array of zero or more content types +contentTypeGuessForTree root = + {#call g_content_type_guess_for_tree#} (toFile root) + >>= readUTFStringArray0 +#endif + +-- | Gets a list of strings containing all the registered content types known to the system. [_$_] +contentTypesGetRegistered :: [_$_] + IO [String] -- ^ returns GList of the registered content types. [_$_] +contentTypesGetRegistered = do + glistPtr <- {#call g_content_types_get_registered#} [_$_] + strPtrs <- fromGList glistPtr + {# call unsafe g_list_free #} glistPtr + mapM readUTFString strPtrs + + [_$_] hunk ./gio/gio.cabal 57 + System.GIO.File.ContentType } |
From: Andy S. <And...@co...> - 2010-08-20 07:02:03
|
diffing dir... Fri Aug 20 02:57:11 EDT 2010 Andy Stewart <laz...@gm...> * Change Gicon to GIcon Ignore-this: bc628738737996e81479c584e4722c00 { hunk ./gtk/Graphics/UI/Gtk/General/IconTheme.chs 110 - iconThemeLookupByGicon, + iconThemeLookupByGIcon, hunk ./gtk/Graphics/UI/Gtk/General/IconTheme.chs 375 -iconThemeLookupByGicon :: (IconThemeClass self, IconClass icon) => self +iconThemeLookupByGIcon :: (IconThemeClass self, IconClass icon) => self hunk ./gtk/Graphics/UI/Gtk/General/IconTheme.chs 383 -iconThemeLookupByGicon self icon size flags = do +iconThemeLookupByGIcon self icon size flags = do hunk ./gtk/Graphics/UI/Gtk/Misc/Tooltip.chs 96 - tooltipSetIconFromGicon, + tooltipSetIconFromGIcon, hunk ./gtk/Graphics/UI/Gtk/Misc/Tooltip.chs 234 -tooltipSetIconFromGicon :: TooltipClass self => self [_$_] +tooltipSetIconFromGIcon :: TooltipClass self => self [_$_] hunk ./gtk/Graphics/UI/Gtk/Misc/Tooltip.chs 238 -tooltipSetIconFromGicon tooltip icon size = +tooltipSetIconFromGIcon tooltip icon size = } |
From: Andy S. <And...@co...> - 2010-08-20 06:55:42
|
diffing dir... Fri Aug 20 02:53:10 EDT 2010 Andy Stewart <laz...@gm...> * Fix docs Ignore-this: 86084932a239bc6c4303afba524c17cf hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs 457 --- | Wheter range's slikder has a fixed size, or a size that depends on it's adjustment's page. +-- | Wheter range's slikder has a fixed size, or a size that depends on it's adjustment's page size. |
From: Andy S. <And...@co...> - 2010-08-20 01:24:18
|
diffing dir... Sun Aug 15 14:18:14 EDT 2010 Andy Stewart <laz...@gm...> * Add new module System.GIO.File.AppInfo Ignore-this: 23ce5a7d752a7e5d00374b9574282fd5 { hunk ./gio/System/GIO.hs 32 - module System.GIO.File.File + + module System.GIO.File.File, + module System.GIO.File.AppInfo, hunk ./gio/System/GIO.hs 39 -import System.GIO.File.File hunk ./gio/System/GIO.hs 40 +import System.GIO.File.File +import System.GIO.File.AppInfo addfile ./gio/System/GIO/File/AppInfo.chs hunk ./gio/System/GIO/File/AppInfo.chs 1 +{-# LANGUAGE CPP #-} +-- GIMP Toolkit (GTK) Binding for Haskell: binding to gio -*-haskell-*- +-- +-- Author : Andy Stewart +-- Created: 30-Apirl-2010 +-- +-- Copyright (c) 2010 Andy Stewart +-- +-- This library is free software: you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation, either version 3 of +-- the License, or (at your option) any later version. +-- [_$_] +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- [_$_] +-- You should have received a copy of the GNU Lesser General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/>. +-- [_$_] +-- GIO, the C library which this Haskell library depends on, is +-- available under LGPL Version 2. The documentation included with +-- this library is based on the original GIO documentation. +-- [_$_] +-- | Maintainer : gtk...@li... +-- Stability : alpha +-- Portability : portable (depends on GHC) +module System.GIO.File.AppInfo ( +-- * Details +-- | 'AppInfo' and 'AppLaunchContext' are used for describing and launching applications installed on the +-- system. +-- [_$_] +-- As of GLib 2.20, URIs will always be converted to POSIX paths (using 'fileGetPath' when using +-- 'appInfoLaunch' even if the application requested an URI and not a POSIX path. For example for +-- an desktop-file based application with Exec key totem %U and a single URI, sftp://foo/file.avi, then +-- /home/user/.gvfs/sftp on foo/file.avi will be passed. This will only work if a set of suitable GIO +-- extensions (such as gvfs 2.26 compiled with FUSE support), is available and operational; if this is +-- not the case, the URI will be passed unmodified to the application. Some URIs, such as mailto:, of +-- course cannot be mapped to a POSIX path (in gvfs there's no FUSE mount for it); such URIs will be +-- passed unmodified to the application. +-- [_$_] +-- Specifically for gvfs 2.26 and later, the POSIX URI will be mapped back to the GIO URI in the 'File' +-- constructors (since gvfs implements the GVfs extension point). As such, if the application needs to +-- examine the URI, it needs to use 'fileGetUri' or similar on 'File'. In other words, an +-- application cannot assume that the URI passed to e.g. 'fileNewForCommandlineArg ' is equal to +-- the result of 'fileGetUri'. [_$_] + +-- * Types [_$_] + AppInfo, + AppInfoClass, + AppLaunchContext, + AppLaunchContextClass, + +-- * Enums + AppInfoCreateFlags (..), + +-- * Methods + appInfoCreateFromCommandline, + appInfoDup, + appInfoEqual, + appInfoGetId, + appInfoGetName, +#if GLIB_CHECK_VERSION(2,24,0) + appInfoGetDisplayName, +#endif + appInfoGetDescription, + appInfoGetExecutable, +#if GLIB_CHECK_VERSION(2,20,0) + appInfoGetCommandline, +#endif + appInfoGetIcon, + appInfoLaunch, + appInfoSupportsFiles, + appInfoSupportsUris, + appInfoLaunchUris, + appInfoShouldShow, +#if GLIB_CHECK_VERSION(2,20,0) + appInfoCanDelete, + appInfoDelete, + appInfoResetTypeAssociations, +#endif + appInfoSetAsDefaultForType, + appInfoSetAsDefaultForExtension, + appInfoAddSupportsType, + appInfoCanRemoveSupportsType, + appInfoRemoveSupportsType, + appInfoGetAll, + appInfoGetAllForType, + appInfoGetDefaultForType, + appInfoGetDefaultForUriScheme, + appInfoLaunchDefaultForUri, + appLaunchContextGetDisplay, + appLaunchContextGetStartupNotifyId, + appLaunchContextLaunchFailed, + appLaunchContextNew + ) where + +import Control.Monad +import System.GIO.Enums +import System.Glib.FFI +import System.Glib.Flags +import System.Glib.GError +import System.Glib.GList +import System.Glib.GObject +import System.Glib.UTFString +{#import System.GIO.Base#} +{#import System.GIO.Types#} + +{# context lib = "gio" prefix = "g" #} + +-- | Creates a new 'AppInfo' from the given information. +appInfoCreateFromCommandline :: String -- ^ @commandline@ the commandline to use + -> Maybe String -- ^ @applicationName@ the application name, or 'Nothing' to use commandline + -> [AppInfoCreateFlags] -- ^ @flags@ flags that can specify details of the created 'AppInfo' [_$_] + -> IO AppInfo -- ^ returns new 'AppInfo' for given command. [_$_] +appInfoCreateFromCommandline commandline applicationName flags = + constructNewGObject mkAppInfo $ + withUTFString commandline $ \ commandlinePtr -> [_$_] + maybeWith withUTFString applicationName $ \ applicationNamePtr -> [_$_] + propagateGError (g_app_info_create_from_commandline [_$_] + commandlinePtr [_$_] + applicationNamePtr + ((fromIntegral . fromFlags) flags) + ) [_$_] + where _ = {# call g_app_info_create_from_commandline #} + +-- | Creates a duplicate of a 'AppInfo'. +appInfoDup :: AppInfoClass appinfo => appinfo -> IO AppInfo +appInfoDup appinfo = [_$_] + constructNewGObject mkAppInfo $ + {#call g_app_info_dup #} (toAppInfo appinfo) + +-- | Checks if two 'AppInfo's are equal. +appInfoEqual :: (AppInfoClass info1, AppInfoClass info2) => info1 -> info2 + -> Bool -- ^ returns 'True' if appinfo1 is equal to appinfo2. 'False' otherwise. [_$_] +appInfoEqual info1 info2 = [_$_] + unsafePerformIO $ liftM toBool $ + {#call g_app_info_equal #} (toAppInfo info1) (toAppInfo info2) + +-- | Gets the ID of an application. An id is a string that identifies the application. The exact format +-- of the id is platform dependent. For instance, on Unix this is the desktop file id from the xdg menu +-- specification. +-- [_$_] +-- Note that the returned ID may be 'Nothing', depending on how the appinfo has been constructed. +appInfoGetId :: AppInfoClass appinfo => appinfo [_$_] + -> Maybe String +appInfoGetId appinfo = [_$_] + unsafePerformIO $ [_$_] + {#call g_app_info_get_id#} (toAppInfo appinfo) + >>= maybePeek readUTFString + +-- | Gets the installed name of the application. +appInfoGetName :: AppInfoClass appinfo => appinfo + -> String -- ^ returns the name of the application for appinfo. [_$_] +appInfoGetName appinfo = [_$_] + unsafePerformIO $ + {#call g_app_info_get_name#} (toAppInfo appinfo) + >>= readCString + +#if GLIB_CHECK_VERSION(2,24,0) +-- | Gets the installed name of the application. +appInfoGetDisplayName :: AppInfoClass appinfo => appinfo + -> String -- ^ returns the display name of the application for appinfo, or the name if no display name is available. +appInfoGetDisplayName appinfo = [_$_] + unsafePerformIO $ + {#call g_app_info_get_display_name#} (toAppInfo appinfo) + >>= readUTFString +#endif + +-- | Gets a human-readable description of an installed application. +appInfoGetDescription :: AppInfoClass appinfo => appinfo + -> Maybe String -- ^ returns a string containing a description of the application appinfo, or 'Nothing' if none. +appInfoGetDescription appinfo = [_$_] + unsafePerformIO $ do + {#call g_app_info_get_description#} (toAppInfo appinfo) + >>= maybePeek peekUTFString + +-- | Gets the executable's name for the installed application. +appInfoGetExecutable :: AppInfoClass appinfo => appinfo + -> String -- ^ returns the executable of the application for appinfo. [_$_] +appInfoGetExecutable appinfo = [_$_] + unsafePerformIO $ + {#call g_app_info_get_executable#} (toAppInfo appinfo) + >>= peekCString + +#if GLIB_CHECK_VERSION(2,20,0) +-- | Gets the commandline with which the application will be started. +appInfoGetCommandline :: AppInfoClass appinfo => appinfo + -> Maybe String -- ^ returns a string containing the appinfo's commandline, or 'Nothing' if this information is not available +appInfoGetCommandline appinfo = [_$_] + unsafePerformIO $ [_$_] + {#call g_app_info_get_commandline#} (toAppInfo appinfo) + >>= maybePeek peekCString +#endif + +-- | Gets the icon for the application. +appInfoGetIcon :: AppInfoClass appinfo => appinfo [_$_] + -> IO Icon -- ^ returns the default 'Icon' for appinfo. [_$_] +appInfoGetIcon appinfo = + makeNewGObject mkIcon $ + {#call g_app_info_get_icon#} (toAppInfo appinfo) + +-- | Launches the application. Passes files to the launched application as arguments, using the optional +-- @launchContext@ to get information about the details of the launcher (like what screen it is on). On +-- error, error will be set accordingly. +-- [_$_] +-- To lauch the application without arguments pass a emtpy files list. +-- [_$_] +-- Note that even if the launch is successful the application launched can fail to start if it runs +-- into problems during startup. There is no way to detect this. +-- [_$_] +-- Some URIs can be changed when passed through a 'File' (for instance unsupported uris with strange +-- formats like mailto:), so if you have a textual uri you want to pass in as argument, consider using +-- 'appInfoLaunchUris' instead. +appInfoLaunch :: AppInfoClass appinfo => appinfo + -> [File] -- ^ @files@ a list of 'File' objects [_$_] + -> Maybe AppLaunchContext -- ^ @launchContext@ a 'AppLaunchContext' or 'Nothing' [_$_] + -> IO Bool +appInfoLaunch appinfo files launchContext = [_$_] + liftM toBool $ + withGObject (toAppInfo appinfo) $ \cAppinfo -> + withForeignPtrs (map unFile files) $ \wFilePtr -> + withGList wFilePtr $ \filesPtr -> + maybeWith withGObject launchContext $ \cLaunchContext -> + propagateGError (g_app_info_launch cAppinfo filesPtr cLaunchContext) [_$_] + where _ = {# call g_app_info_launch #} + +-- | Checks if the application accepts files as arguments. +appInfoSupportsFiles :: AppInfoClass appinfo => appinfo [_$_] + -> IO Bool -- ^ returns 'True' if the appinfo supports files. [_$_] +appInfoSupportsFiles appinfo = + liftM toBool $ + {#call g_app_info_supports_files #} (toAppInfo appinfo) + +-- | Checks if the application accepts uris as arguments. +appInfoSupportsUris :: AppInfoClass appinfo => appinfo [_$_] + -> IO Bool -- ^ returns 'True' if the appinfo supports uris. [_$_] +appInfoSupportsUris appinfo = + liftM toBool $ + {#call g_app_info_supports_uris #} (toAppInfo appinfo) + +-- | Launches the application. Passes uris to the launched application as arguments, using the optional +-- @launchContext@ to get information about the details of the launcher (like what screen it is on). On +-- error, error will be set accordingly. +-- [_$_] +-- To lauch the application without arguments pass a empty uris list. +-- [_$_] +-- Note that even if the launch is successful the application launched can fail to start if it runs +-- into problems during startup. There is no way to detect this. +appInfoLaunchUris :: AppInfoClass appinfo => appinfo + -> [String] -- ^ @uris@ a list containing URIs to launch. [_$_] + -> Maybe AppLaunchContext -- ^ @launchContext@ a 'AppLaunchContext' or 'Nothing' [_$_] + -> IO Bool -- ^ returns 'True' on successful launch, 'False' otherwise. [_$_] +appInfoLaunchUris appinfo uris launchContext = [_$_] + liftM toBool $ + withGObject (toAppInfo appinfo) $ \cAppinfo -> + withUTFStringArray uris $ \urisPtr -> + maybeWith withGObject launchContext $ \cLaunchContext -> + propagateGError (g_app_info_launch_uris cAppinfo (castPtr urisPtr) cLaunchContext) [_$_] + where _ = {# call g_app_info_launch_uris #} + +-- | Checks if the application info should be shown in menus that list available applications. +appInfoShouldShow :: AppInfoClass appinfo => appinfo + -> IO Bool -- ^ returns 'True' if the appinfo should be shown, 'False' otherwise. [_$_] +appInfoShouldShow appinfo = [_$_] + liftM toBool $ + {#call g_app_info_should_show#} (toAppInfo appinfo) + +#if GLIB_CHECK_VERSION(2,20,0) +-- | Obtains the information whether the 'AppInfo' can be deleted. See 'appInfoDelete'. +appInfoCanDelete :: AppInfoClass appinfo => appinfo + -> IO Bool -- ^ returns 'True' if appinfo can be deleted [_$_] +appInfoCanDelete appinfo = [_$_] + liftM toBool $ + {#call g_app_info_can_delete#} (toAppInfo appinfo) + +-- | Tries to delete a 'AppInfo'. +-- [_$_] +-- On some platforms, there may be a difference between user-defined 'AppInfo's which can be deleted, +-- and system-wide ones which cannot. See 'appInfoCanDelete'. +appInfoDelete :: AppInfoClass appinfo => appinfo + -> IO Bool -- ^ returns 'True' if appinfo has been deleted [_$_] +appInfoDelete appinfo = [_$_] + liftM toBool $ + {#call g_app_info_delete#} (toAppInfo appinfo) + +-- | Removes all changes to the type associations done by 'appInfoSetAsDefaultForType', +-- 'appInfoSetAsDefaultForExtension' or +-- 'appInfoRemoveSupportsType'. +appInfoResetTypeAssociations :: [_$_] + String -- ^ @contentType@ a content type + -> IO () +appInfoResetTypeAssociations contentType = + withUTFString contentType $ \ contentTypePtr -> [_$_] + {#call g_app_info_reset_type_associations#} (castPtr contentTypePtr) +#endif + +-- | Sets the application as the default handler for a given type. +appInfoSetAsDefaultForType :: AppInfoClass appinfo => appinfo [_$_] + -> String -- ^ @contentType@ the content type. [_$_] + -> IO Bool -- ^ returns 'True' on success, 'False' on error. [_$_] +appInfoSetAsDefaultForType appinfo contentType = + liftM toBool $ + withGObject (toAppInfo appinfo) $ \cAppinfo -> + withUTFString contentType $ \ contentTypePtr -> [_$_] + propagateGError (g_app_info_set_as_default_for_type [_$_] + cAppinfo + (castPtr contentTypePtr)) [_$_] + where _ = {# call g_app_info_set_as_default_for_type #} + +-- | Sets the application as the default handler for a given extension. +appInfoSetAsDefaultForExtension :: AppInfoClass appinfo => appinfo [_$_] + -> String -- ^ @extension@ a string containing the file extension (without the dot). [_$_] + -> IO Bool -- ^ returns 'True' on success, 'False' on error. [_$_] +appInfoSetAsDefaultForExtension appinfo extension = + liftM toBool $ + withGObject (toAppInfo appinfo) $ \cAppinfo -> + withUTFString extension $ \ extensionPtr -> [_$_] + propagateGError (g_app_info_set_as_default_for_extension [_$_] + cAppinfo + (castPtr extensionPtr)) [_$_] + where _ = {# call g_app_info_set_as_default_for_extension #} + +-- | Adds a content type to the application information to indicate the application is capable of opening +-- files with the given content type. +appInfoAddSupportsType :: AppInfoClass appinfo => appinfo [_$_] + -> String -- ^ @contentType@ a string. [_$_] + -> IO Bool -- ^ returns 'True' on success, 'False' on error. [_$_] +appInfoAddSupportsType appinfo extension = + liftM toBool $ + withGObject (toAppInfo appinfo) $ \cAppinfo -> + withUTFString extension $ \ extensionPtr -> [_$_] + propagateGError (g_app_info_add_supports_type + cAppinfo + (castPtr extensionPtr)) [_$_] + where _ = {# call g_app_info_add_supports_type #} + +-- | Checks if a supported content type can be removed from an application. +appInfoCanRemoveSupportsType :: AppInfoClass appinfo => appinfo + -> IO Bool -- ^ returns 'True' if it is possible to remove supported content types from a given appinfo, 'False' if not. +appInfoCanRemoveSupportsType appinfo = [_$_] + liftM toBool $ + {#call g_app_info_can_remove_supports_type#} (toAppInfo appinfo) + +-- | Removes a supported type from an application, if possible. +appInfoRemoveSupportsType :: AppInfoClass appinfo => appinfo [_$_] + -> String -- ^ @contentType@ a string. [_$_] + -> IO Bool -- ^ returns 'True' on success, 'False' on error. [_$_] +appInfoRemoveSupportsType appinfo extension = + liftM toBool $ + withGObject (toAppInfo appinfo) $ \cAppinfo -> + withUTFString extension $ \ extensionPtr -> [_$_] + propagateGError (g_app_info_remove_supports_type + cAppinfo + (castPtr extensionPtr)) [_$_] + where _ = {# call g_app_info_remove_supports_type #} + +-- | Gets a list of all of the applications currently registered on this system. +-- [_$_] +-- For desktop files, this includes applications that have NoDisplay=true set or are excluded from +-- display by means of OnlyShowIn or NotShowIn. See 'appInfoShouldShow'. The returned list does +-- not include applications which have the Hidden key set. +appInfoGetAll :: IO [AppInfo] +appInfoGetAll = do + glistPtr <- {# call g_app_info_get_all #} [_$_] + list <- fromGList glistPtr + mapM (makeNewGObject mkAppInfo . return) list [_$_] + +-- | Gets a list of all 'AppInfo's for a given content type. +appInfoGetAllForType :: [_$_] + String -- ^ @contentType@ the content type to find a 'AppInfo' for [_$_] + -> IO [AppInfo] -- ^ returns list of 'AppInfo's for given @contentType@ or 'empty' on error. [_$_] +appInfoGetAllForType contentType = [_$_] + withUTFString contentType $ \ contentTypePtr -> do + glistPtr <- {# call g_app_info_get_all_for_type #} (castPtr contentTypePtr) + if glistPtr == nullPtr + then return [] + else do [_$_] + list <- fromGList glistPtr + mapM (makeNewGObject mkAppInfo . return) list [_$_] + +-- | Gets the 'AppInfo' that corresponds to a given content type. +appInfoGetDefaultForType :: [_$_] + String -- ^ @contentType@ the content type to find a 'AppInfo' for [_$_] + -> Bool -- ^ @mustSupportUris@ if 'True', the 'AppInfo' is expected to support URIs [_$_] + -> IO (Maybe AppInfo) -- ^ returns list of 'AppInfo's for given @contentType@ or 'Nothing' on error. [_$_] +appInfoGetDefaultForType contentType mustSupportUris = [_$_] + maybeNull (makeNewGObject mkAppInfo) $ + withUTFString contentType $ \ contentTypePtr -> do + {# call g_app_info_get_default_for_type #} [_$_] + (castPtr contentTypePtr) + (fromBool mustSupportUris) + +-- | Gets the default application for launching applications using this URI scheme. A URI scheme is the +-- initial part of the URI, up to but not including the ':', e.g. "http", "ftp" or "sip". +appInfoGetDefaultForUriScheme :: [_$_] + String -- ^ @uriScheme@ a string containing a URI scheme. [_$_] + -> IO (Maybe AppInfo) -- ^ returns list of 'AppInfo's for given @contentType@ or 'Nothing' on error. [_$_] +appInfoGetDefaultForUriScheme uriScheme = [_$_] + maybeNull (makeNewGObject mkAppInfo) $ + withUTFString uriScheme $ \ uriSchemePtr -> [_$_] + {# call g_app_info_get_default_for_uri_scheme #} (castPtr uriSchemePtr) + +-- | Utility function that launches the default application registered to handle the specified +-- uri. Synchronous I/O is done on the uri to detect the type of the file if required. +appInfoLaunchDefaultForUri :: [_$_] + String -- ^ @uri@ the uri to show [_$_] + -> AppLaunchContext -- ^ @launchContext@ an optional 'AppLaunchContext'. [_$_] + -> IO Bool -- ^ returns 'True' on success, 'False' on error. [_$_] +appInfoLaunchDefaultForUri uri launchContext = [_$_] + liftM toBool $ + withUTFString uri $ \ uriPtr -> [_$_] + withGObject launchContext $ \cLaunchContext -> + propagateGError (g_app_info_launch_default_for_uri + (castPtr uriPtr) + cLaunchContext) + where _ = {# call g_app_info_launch_default_for_uri #} + +-- | Gets the display string for the display. This is used to ensure new applications are started on the +-- same display as the launching application. +appLaunchContextGetDisplay :: AppInfoClass appinfo => AppLaunchContext + -> appinfo + -> [File] -- ^ @files@ a list of 'File' objects [_$_] + -> IO String -- ^ returns a display string for the display. [_$_] +appLaunchContextGetDisplay launchContext appinfo files = [_$_] + withForeignPtrs (map unFile files) $ \wFilePtr -> + withGList wFilePtr $ \filesPtr -> + {#call g_app_launch_context_get_display#} [_$_] + (toAppLaunchContext launchContext) + (toAppInfo appinfo) + filesPtr + >>= readUTFString + +-- | Initiates startup notification for the application and returns the DesktopStartupId for the +-- launched operation, if supported. +-- [_$_] +-- Startup notification IDs are defined in the FreeDesktop.Org Startup Notifications standard. +appLaunchContextGetStartupNotifyId :: AppInfoClass appinfo => AppLaunchContext + -> appinfo + -> [File] -- ^ @files@ a list of 'File' objects [_$_] + -> IO (Maybe String) -- ^ returns a startup notification ID for the application, or 'Nothing' if not supported. +appLaunchContextGetStartupNotifyId launchContext appinfo files = [_$_] + withForeignPtrs (map unFile files) $ \wFilePtr -> + withGList wFilePtr $ \filesPtr -> [_$_] + {#call g_app_launch_context_get_startup_notify_id #} [_$_] + (toAppLaunchContext launchContext) + (toAppInfo appinfo) + filesPtr + >>= maybePeek readUTFString + +-- | Called when an application has failed to launch, so that it can cancel the application startup +-- notification started in 'appLaunchContextGetStartupNotifyId'. +appLaunchContextLaunchFailed :: AppLaunchContext + -> String -- ^ @startupNotifyId@ the startup notification id that was returned by 'appLaunchContextGetStartupNotifyId'. + -> IO () +appLaunchContextLaunchFailed launchContext startupNotifyId = [_$_] + withUTFString startupNotifyId $ \ startupNotifyIdPtr -> [_$_] + {#call g_app_launch_context_launch_failed#} [_$_] + (toAppLaunchContext launchContext) + (castPtr startupNotifyIdPtr) + +-- | Creates a new application launch context. This is not normally used, instead you instantiate a +-- subclass of this, such as 'AppLaunchContext'. +appLaunchContextNew :: IO AppLaunchContext +appLaunchContextNew = + constructNewGObject mkAppLaunchContext $ + {#call g_app_launch_context_new#} hunk ./gio/gio.cabal 51 + System.GIO.Types[_^I_][_^I_] [_$_] + [_$_] hunk ./gio/gio.cabal 55 + [_$_] + System.GIO.File.AppInfo hunk ./gio/gio.cabal 59 - System.GIO.Types[_^I_][_^I_] [_$_] } |
From: Andy S. <And...@co...> - 2010-08-20 01:04:05
|
diffing dir... Thu Aug 19 21:02:27 EDT 2010 Andy Stewart <laz...@gm...> * Fix docs of System.GIO.Enums.chs Ignore-this: c79c94787be2a4ef2ad4d80ef648c5ec { hunk ./gio/System/GIO/Enums.chs 69 +-- | Flags used when querying a 'FileInfo'. hunk ./gio/System/GIO/Enums.chs 73 +-- | Flags used when an operation may create a file. hunk ./gio/System/GIO/Enums.chs 77 +-- | Flags used when copying or moving files. hunk ./gio/System/GIO/Enums.chs 81 +-- | Flags used to set what a 'FileMonitor' will watch for. hunk ./gio/System/GIO/Enums.chs 85 +-- | Indicates a hint from the file system whether files should be previewed in a file manager. Returned +-- as the value of the key 'FileAttributeFilesystemUsePreview'. hunk ./gio/System/GIO/Enums.chs 89 +-- | Indicates the file's on-disk type. hunk ./gio/System/GIO/Enums.chs 92 +-- | Used by 'fileSetAttributesFromInfo' when setting file attributes. hunk ./gio/System/GIO/Enums.chs 95 +-- | Flags specifying the behaviour of an attribute. hunk ./gio/System/GIO/Enums.chs 99 +-- | 'AskPasswordFlags' are used to request specific information from the user, or to notify the user of +-- their choices in an authentication situation. hunk ./gio/System/GIO/Enums.chs 104 +-- | 'PasswordSave' is used to indicate the lifespan of a saved password. hunk ./gio/System/GIO/Enums.chs 107 +-- | 'MountOperationResult' is returned as a result when a request for information is send by the mounting +-- operation. hunk ./gio/System/GIO/Enums.chs 111 +-- | Error codes returned by GIO functions. hunk ./gio/System/GIO/Enums.chs 114 +-- | Specifies what type of event a monitor event is. hunk ./gio/System/GIO/Enums.chs 117 +-- | Flags used when mounting a mount. hunk ./gio/System/GIO/Enums.chs 121 +-- | Flags used when an unmounting a mount. hunk ./gio/System/GIO/Enums.chs 125 +-- | Flags used when starting a drive. hunk ./gio/System/GIO/Enums.chs 129 +-- | Enumeration describing how a drive can be started/stopped. hunk ./gio/System/GIO/Enums.chs 132 +-- | 'EmblemOrigin' is used to add information about the origin of the emblem to 'Emblem'. hunk ./gio/System/GIO/Enums.chs 135 +-- | Flags used when creating a 'AppInfo'. } |
From: Andy S. <And...@co...> - 2010-08-20 00:46:39
|
diffing dir... Thu Aug 19 20:40:55 EDT 2010 Andy Stewart <laz...@gm...> * Add signal entryInsertAtCursor Ignore-this: 77cf0a94afaf0852a9e12be937347564 { hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 26 --- NOTE --- --- Don't bind 'insert-at-cursor' signal, it's not default bindings signal. [_$_] --- hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 115 + entryInsertAtCursor, hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 621 +-- | The 'entryInsertAtCursor' signal is a keybinding signal which gets emitted when the user initiates the +-- insertion of a fixed string at the cursor. +entryInsertAtCursor :: EntryClass ec => Signal ec (String -> IO ()) +entryInsertAtCursor = Signal (connect_STRING__NONE "insert-at-cursor") + } |
From: Andy S. <And...@co...> - 2010-08-20 00:46:31
|
diffing dir... Thu Aug 19 20:36:48 EDT 2010 Andy Stewart <laz...@gm...> * Fix GtkEntry signal docs Ignore-this: 9f6e7a8a273147926809dc57aa68484e { hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 593 --- | The 'backspace' signal is a keybinding signal which gets emitted when the user asks for it. +-- | The 'entryBackspace' signal is a keybinding signal which gets emitted when the user asks for it. hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 599 --- | The 'copyClipboard' signal is a keybinding signal which gets emitted to copy the selection to the +-- | The 'entryCopyClipboard' signal is a keybinding signal which gets emitted to copy the selection to the hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 606 --- | The 'cutClipboard' signal is a keybinding signal which gets emitted to cut the selection to the +-- | The 'entryCutClipboard' signal is a keybinding signal which gets emitted to cut the selection to the hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 613 --- | The 'deleteFromCursor' signal is a keybinding signal which gets emitted when the user initiates a +-- | The 'entryDeleteFromCursor' signal is a keybinding signal which gets emitted when the user initiates a hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 624 --- | The 'moveCursor' signal is a keybinding signal which gets emitted when the user initiates a cursor +-- | The 'entryMoveCursor' signal is a keybinding signal which gets emitted when the user initiates a cursor hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 641 --- | The 'pasteClipboard' signal is a keybinding signal which gets emitted to paste the contents of the +-- | The 'entryPasteClipboard' signal is a keybinding signal which gets emitted to paste the contents of the hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 648 --- | The 'populatePopup' signal gets emitted before showing the context menu of the entry. +-- | The 'entryPopulatePopup' signal gets emitted before showing the context menu of the entry. hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 660 --- | The 'toggleOverwrite' signal is a keybinding signal which gets emitted to toggle the overwrite mode +-- | The 'entryToggleOverwrite' signal is a keybinding signal which gets emitted to toggle the overwrite mode } |
From: Andy S. <And...@co...> - 2010-08-20 00:46:28
|
diffing dir... Thu Aug 19 20:32:33 EDT 2010 Andy Stewart <laz...@gm...> * Fix docs Ignore-this: 34a56e4307a6f4f64dd7f80c26ccfcb3 hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs 345 --- | This function returns sliders range along the long dimension, in widget->window coordinates. +-- | This function returns sliders range along the long dimension, in 'DrawWindow' coordinates. |
From: Andy S. <And...@co...> - 2010-08-20 00:46:25
|
diffing dir... Thu Aug 19 20:30:28 EDT 2010 Andy Stewart <laz...@gm...> * Remove docs for GAsyncReadyCallback Ignore-this: 620ba9abd566bd2ff98d11e7533f4b31 hunk ./gio/System/GIO/Async/AsyncResult.chs 47 --- | This type just use for bind, don't expose it. |
From: Andy S. <And...@co...> - 2010-08-20 00:46:21
|
diffing dir... Thu Aug 19 20:25:48 EDT 2010 Andy Stewart <laz...@gm...> * Add attrs : rangeSliderSizeFixed rangeMinSliderSize Ignore-this: 405a799689dcd18938af254be04bf82c { hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs 89 +#if GTK_CHECK_VERSION(2,20,0) + rangeSliderSizeFixed, + rangeMinSliderSize, +#endif hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs 456 +#if GTK_CHECK_VERSION(2,20,0) +-- | Wheter range's slikder has a fixed size, or a size that depends on it's adjustment's page. +rangeSliderSizeFixed :: RangeClass self => Attr self Bool +rangeSliderSizeFixed = newAttr + rangeGetSliderSizeFixed + rangeSetSliderSizeFixed + +-- | Get/Set sliders range along the long dimension, in 'DrawWindow' coordinates. +rangeMinSliderSize :: RangeClass self => ReadWriteAttr self Int Bool +rangeMinSliderSize = newAttr + rangeGetMinSliderSize + rangeSetMinSliderSize +#endif + } |
From: Andy S. <And...@co...> - 2010-08-20 00:46:17
|
diffing dir... Thu Aug 19 20:03:31 EDT 2010 Andy Stewart <laz...@gm...> * Fix GtkRange docs Ignore-this: 12fcb5e26cebeb4a4dae6eaf004022a6 hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs 328 --- | This function returns the area that contains the range's trough and its steppers, in widget->window +-- | This function returns the area that contains the range's trough and its steppers, in 'DrawWindow' |
From: Andy S. <And...@co...> - 2010-08-20 00:46:13
|
diffing dir... Thu Aug 19 19:59:14 EDT 2010 Andy Stewart <laz...@gm...> * Fix GtkEntry docs (change expose-event to eventExpose) Ignore-this: 2d6dedd6c370a1f5002984c71a614b9f { hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 423 --- drawing something to the entry in an expose-event callback because it enables the callback to +-- drawing something to the entry in an 'eventExpose' callback because it enables the callback to hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 437 --- entry in an expose-event callback because it enables the callback to distinguish between the text +-- entry in an 'eventExpose' callback because it enables the callback to distinguish between the text } |
From: Andy S. <And...@co...> - 2010-08-17 03:51:50
|
diffing dir... Mon Aug 16 23:47:26 EDT 2010 Andy Stewart <laz...@gm...> * Add new function tooltipSetIconFromGicon Ignore-this: 57c707c8842c3e2ca565f0772c3f9233 { hunk ./gtk/Graphics/UI/Gtk/Misc/Tooltip.chs 94 +#ifdef HAVE_GIO +#if GTK_CHECK_VERSION(2,20,0) + tooltipSetIconFromGicon, +#endif +#endif hunk ./gtk/Graphics/UI/Gtk/Misc/Tooltip.chs 111 +#ifdef HAVE_GIO +{#import System.GIO.Types#} +#endif hunk ./gtk/Graphics/UI/Gtk/Misc/Tooltip.chs 229 + +#ifdef HAVE_GIO +#if GTK_CHECK_VERSION(2,20,0) +-- | Sets the icon of the tooltip (which is in front of the text) to be the icon indicated by gicon with +-- the size indicated by size. If gicon is 'Nothing', the image will be hidden. +tooltipSetIconFromGicon :: TooltipClass self => self [_$_] + -> Maybe Icon -- ^ @gicon@ a GIcon representing the icon, or 'Nothing'. allow-none. [_$_] + -> IconSize + -> IO () +tooltipSetIconFromGicon tooltip icon size = + {#call gtk_tooltip_set_icon_from_gicon #} + (toTooltip tooltip) + (fromMaybe (Icon nullForeignPtr) icon) + ((fromIntegral . fromEnum) size) +#endif +#endif } |
From: Andy S. <And...@co...> - 2010-08-17 03:38:16
|
diffing dir... Mon Aug 16 23:37:40 EDT 2010 Andy Stewart <laz...@gm...> * Add new attr : actionAlwaysShowImage Ignore-this: d601f866f9021e542dc32b9ca97609c4 { hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs 5 --- Author : Duncan Coutts +-- Author : Duncan Coutts, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs 10 +-- Copyright (C) 2010 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs 132 +#if GTK_CHECK_VERSION(2,20,0) + actionAlwaysShowImage, +#endif hunk ./gtk/Graphics/UI/Gtk/ActionMenuToolbar/Action.chs 509 +#if GTK_CHECK_VERSION(2,20,0) +-- | If 'True', the action's menu item proxies will ignore the 'menuImages' setting and always show +-- their image, if available. +-- [_$_] +-- Use this property if the menu item would be useless or hard to use without their image. +-- [_$_] +-- Default value: 'False' +-- [_$_] +-- Since 2.20 +actionAlwaysShowImage :: ActionClass self => Attr self Bool +actionAlwaysShowImage = newAttrFromBoolProperty "always-show-image" +#endif + } |
From: Andy S. <And...@co...> - 2010-08-17 03:35:19
|
diffing dir... Sun Aug 15 14:46:32 EDT 2010 Andy Stewart <laz...@gm...> * Add demo Ignore-this: a86db09851a251d99499bed0e8a23361 { adddir ./gio/demo addfile ./gio/demo/FileManager.hs hunk ./gio/demo/FileManager.hs 1 +-- | File Manager demo. +-- Author : Andy Stewart +-- Copyright : (c) 2010 Andy Stewart <laz...@gm...> + +-- | This simple file-manager base on gio. +-- +module Main where + +import Control.Monad +import Data.Maybe +import Graphics.UI.Gtk +import Graphics.UI.Gtk.General.IconTheme +import Graphics.UI.Gtk.ModelView +import System.GIO +import System.Glib.GDateTime +import System.Glib.GError +import System.Locale +import System.Time +import Text.Printf + +data FMInfo = FMInfo { + fIcon :: Pixbuf, -- icon [_$_] + fName :: String, -- file name + fDesc :: String, -- mime type description + fSize :: Integer, -- file size + fTime :: ClockTime -- modified time +} + +-- | Main. +main :: IO () +main = do + -- Init. + initGUI + [_$_] + -- Create window. + window <- windowNew + windowSetDefaultSize window 900 600 + windowSetPosition window WinPosCenter + scrolledWindow <- scrolledWindowNew Nothing Nothing + window `containerAdd` scrolledWindow + + -- Get file infos under specify directory. + infos <- directoryGetFileInfos "/" + + -- Get FMInfo. + fInfos <- mapM (\info -> do + -- Get Icon. + icon <- fileInfoGetIcon info + iconTheme <- iconThemeGetDefault + iconInfo <- iconThemeLookupByGicon iconTheme icon 24 IconLookupUseBuiltin + pixbuf <- case iconInfo of + Just ii -> iconInfoLoadIcon ii + Nothing -> liftM fromJust $ iconThemeLoadIcon iconTheme "unknown" 24 IconLookupUseBuiltin + + let [_$_] + -- Get file name. + name = fromJust $ fileInfoGetName info + -- File size. + size = toInteger $ fileInfoGetSize info + -- File modified time. + time = gTimeValToClockTime $ fileInfoGetModificationTime info + -- File mime description. + Just contentType = fileInfoGetContentType info + desc = contentTypeGetDescription contentType + + return $ FMInfo pixbuf name desc size time + ) infos + + -- Initialize tree view. + store <- listStoreNew fInfos + tv <- treeViewNewWithModel store + scrolledWindow `containerAdd` tv + + -- List Icons. + tvc <- treeViewColumnNew + set tvc [ treeViewColumnTitle := "Icon" + , treeViewColumnResizable := True ] + treeViewAppendColumn tv tvc + [_$_] + icon <- cellRendererPixbufNew + treeViewColumnPackStart tvc icon True + cellLayoutSetAttributes tvc icon store $ \FMInfo { fIcon = icon } -> + [ cellPixbuf := icon ] + + -- List Name. + tvc <- treeViewColumnNew + set tvc [ treeViewColumnTitle := "Name" + , treeViewColumnResizable := True ] + treeViewAppendColumn tv tvc + + name <- cellRendererTextNew + treeViewColumnPackStart tvc name True + cellLayoutSetAttributes tvc name store $ \FMInfo { fName = name } -> + [ cellText := name ] + + -- List file mime description. + tvc <- treeViewColumnNew + set tvc [ treeViewColumnTitle := "Description" + , treeViewColumnResizable := True ] + treeViewAppendColumn tv tvc + + desc <- cellRendererTextNew + treeViewColumnPackStart tvc desc True + cellLayoutSetAttributes tvc desc store $ \FMInfo { fDesc = desc } -> + [ cellText := desc ] + + -- List file size. + tvc <- treeViewColumnNew + set tvc [ treeViewColumnTitle := "Size" + , treeViewColumnResizable := True ] + treeViewAppendColumn tv tvc + + size <- cellRendererTextNew + treeViewColumnPackStart tvc size True + cellLayoutSetAttributes tvc size store $ \FMInfo { fSize = size } -> + [ cellText := formatFileSizeForDisplay size [_$_] + , cellXAlign := 1.0] + + -- List modified time. + tvc <- treeViewColumnNew + set tvc [ treeViewColumnTitle := "Modified" + , treeViewColumnResizable := True ] + treeViewAppendColumn tv tvc + + time <- cellRendererTextNew + treeViewColumnPackStart tvc time True + cellLayoutSetAttributes tvc time store $ \FMInfo { fTime = time } -> + [ cellText :=> do + calTime <- toCalendarTime time + return (formatCalendarTime defaultTimeLocale "%Y/%m/%d %T" calTime)] + + -- Show window. + window `onDestroy` mainQuit + widgetShowAll window + + mainGUI + +directoryGetFileInfos :: FilePath -> IO [FileInfo] +directoryGetFileInfos directory = do + let dir = fileFromPath directory + enumerator <- fileEnumerateChildren dir "*" [] Nothing + fileEnumeratorGetFileInfos enumerator + +fileEnumeratorGetFileInfos :: FileEnumeratorClass enumerator => enumerator -> IO [FileInfo] +fileEnumeratorGetFileInfos enum = do + fileInfo <- fileEnumeratorNextFile enum Nothing + case fileInfo of + Just info -> do + infos <- fileEnumeratorGetFileInfos enum + return $ info : infos + Nothing -> return [] + [_$_] +formatFileSizeForDisplay :: Integer -> String +formatFileSizeForDisplay size + | size < 2 ^ 10 = humanSize 1 ++ " bytes" + | size < 2 ^ 20 = humanSize (2 ^ 10) ++ " KB" + | size < 2 ^ 30 = humanSize (2 ^ 20) ++ " MB" + | size < 2 ^ 40 = humanSize (2 ^ 30) ++ " GB" + | size < 2 ^ 50 = humanSize (2 ^ 40) ++ " TB" + | size < 2 ^ 60 = humanSize (2 ^ 50) ++ " PB" + | size < 2 ^ 70 = humanSize (2 ^ 60) ++ " EB" + | size < 2 ^ 80 = humanSize (2 ^ 70) ++ " ZB" + | size < 2 ^ 90 = humanSize (2 ^ 80) ++ " YB" + | size < 2 ^ 100 = humanSize (2 ^ 90) ++ " NB" + | size < 2 ^ 110 = humanSize (2 ^ 100) ++ " DB" + where humanSize base = printf "%.1f" (integralToDouble size / base) :: String + +integralToDouble :: Integral a => a -> Double +integralToDouble v = fromIntegral v :: Double + +gTimeValToClockTime :: GTimeVal -> ClockTime +gTimeValToClockTime GTimeVal {gTimeValSec = seconds + ,gTimeValUSec = microseconds} = [_$_] + TOD (toInteger seconds) (toInteger microseconds * 1000) addfile ./gio/demo/Makefile hunk ./gio/demo/Makefile 1 + +PROG = filemanager +SOURCES = FileManager.hs + +$(PROG) : $(SOURCES) + $(HC) --make $< -o $@ $(HCFLAGS) + +clean: + rm -f $(SOURCES:.hs=.hi) $(SOURCES:.hs=.o) $(PROG) + +HC=ghc hunk ./gio/gio.cabal 33 +Data-Dir: demo +Data-Files: Makefile + FileManager.hs + } |
From: Andy S. <And...@co...> - 2010-08-17 03:34:54
|
diffing dir... Mon Aug 16 23:34:02 EDT 2010 Andy Stewart <laz...@gm...> * Add new Widget functions : widgetHasRcStyle widgetGetRealized widgetGetMapped Ignore-this: 30dffb060a9cc4155727e8f8b894324d { hunk ./gtk/Graphics/UI/Gtk/Abstract/Widget.chs 233 +#if GTK_CHECK_VERSION(2,20,0) + widgetHasRcStyle, + widgetGetRealized, + widgetGetMapped, +#endif hunk ./gtk/Graphics/UI/Gtk/Abstract/Widget.chs 2339 +#if GTK_CHECK_VERSION(2,20,0) +-- | Determines if the widget style has been looked up through the rc mechanism. +widgetHasRcStyle :: WidgetClass self => self [_$_] + -> IO Bool -- ^ returns 'True' if the widget has been looked up through the rc mechanism, 'False' otherwise. +widgetHasRcStyle self = [_$_] + liftM toBool $ + {#call gtk_widget_has_rc_style #} + (toWidget self) + +-- | Determines whether widget is realized. +widgetGetRealized :: WidgetClass self => self + -> IO Bool -- ^ returns 'True' if widget is realized, 'False' otherwise [_$_] +widgetGetRealized self = + liftM toBool $ + {#call gtk_widget_get_realized #} + (toWidget self) + [_$_] +-- | Whether the widget is mapped. +widgetGetMapped :: WidgetClass self => self + -> IO Bool -- ^ returns 'True' if the widget is mapped, 'False' otherwise. [_$_] +widgetGetMapped self = + liftM toBool $ + {#call gtk_widget_get_mapped #} + (toWidget self) + [_$_] +#endif + } |
From: Andy S. <And...@co...> - 2010-08-17 03:25:14
|
diffing dir... Mon Aug 16 23:24:15 EDT 2010 Andy Stewart <laz...@gm...> * Add function statusIconSetName Ignore-this: a41103b6ca70cd65f760933db721c50a { hunk ./gtk/Graphics/UI/Gtk/Display/StatusIcon.chs 5 --- Author : Andrea Vezzosi +-- Author : Andrea Vezzosi, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Display/StatusIcon.chs 10 +-- Copyright (C) 2010 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Display/StatusIcon.chs 97 +#if GTK_CHECK_VERSION(2,20,0) + statusIconSetName, +#endif hunk ./gtk/Graphics/UI/Gtk/Display/StatusIcon.chs 461 +#if GTK_CHECK_VERSION(2,20,0) +-- | Sets the name of this tray icon. This should be a string identifying this icon. It is may be used +-- for sorting the icons in the tray and will not be shown to the user. +statusIconSetName :: StatusIconClass self => self -> String -> IO () +statusIconSetName self name = + withUTFString name $ \ namePtr -> [_$_] + {#call gtk_status_icon_set_name #} + (toStatusIcon self) + namePtr +#endif } |
From: Andy S. <And...@co...> - 2010-08-17 03:25:10
|
diffing dir... Mon Aug 16 23:21:15 EDT 2010 Andy Stewart <laz...@gm...> * Add function statusbarGetMessageArea Ignore-this: 76836112f3b4e2fed9b1c4c7dadad9c3 { hunk ./gtk/Graphics/UI/Gtk/Display/Statusbar.chs 5 --- Author : Axel Simon +-- Author : Axel Simon, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Display/Statusbar.chs 10 +-- Copyright (C) 2010 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Display/Statusbar.chs 88 +#if GTK_CHECK_VERSION(2,20,0) + statusbarGetMessageArea, +#endif hunk ./gtk/Graphics/UI/Gtk/Display/Statusbar.chs 209 +#if GTK_CHECK_VERSION(2,20,0) +-- | Retrieves the box containing the label widget. +statusbarGetMessageArea :: StatusbarClass self => self -> IO Box +statusbarGetMessageArea self = + makeNewObject mkBox $ + liftM (castPtr :: Ptr Widget -> Ptr Box) $ + {# call unsafe gtk_statusbar_get_message_area #} + (toStatusbar self) + +#endif + } |
From: Andy S. <And...@co...> - 2010-08-17 03:18:50
|
diffing dir... Mon Aug 16 23:17:24 EDT 2010 Andy Stewart <laz...@gm...> * Add function panedGetHandleWindow Ignore-this: 9d8a1cfe3a72730c0fba61d3d0f2cd30 { hunk ./gtk/Graphics/UI/Gtk/Abstract/Paned.chs 85 +#if GTK_CHECK_VERSION(2,20,0) + panedGetHandleWindow, +#endif hunk ./gtk/Graphics/UI/Gtk/Abstract/Paned.chs 234 +#if GTK_CHECK_VERSION(2,20,0) +-- | Returns the 'Window' of the handle. This function is useful when handling button or motion events +-- because it enables the callback to distinguish between the window of the paned, a child and the +-- handle. +panedGetHandleWindow :: PanedClass self => self + -> IO DrawWindow +panedGetHandleWindow self = + makeNewGObject mkDrawWindow $ + {#call gtk_paned_get_handle_window #} + (toPaned self) +#endif + } |
From: Andy S. <And...@co...> - 2010-08-17 02:26:19
|
diffing dir... Mon Aug 16 22:25:47 EDT 2010 Andy Stewart <laz...@gm...> * Add signal textViewPreeditChanged Ignore-this: b56693b30ca1d3e11d42269710bc7bbf { hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs 182 + textViewPreeditChanged hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs 1308 +-- | If an input method is used, the typed text will not immediately be committed to the buffer. So if +-- you are interested in the text, connect to this signal. +-- [_$_] +-- This signal is only emitted if the text at the given position is actually editable. +textViewPreeditChanged :: TextViewClass self => Signal self (String -> IO ()) +textViewPreeditChanged = Signal (connect_STRING__NONE "preedit-changed") + } |
From: Andy S. <And...@co...> - 2010-08-17 02:22:27
|
diffing dir... Mon Aug 16 22:20:53 EDT 2010 Andy Stewart <laz...@gm...> * Update GtkRange to 2.20 Ignore-this: e484ad25c495097cc7dc810f38d94978 rangeGetMinSliderSize rangeGetRangeRect rangeGetSliderRange rangeGetSliderSizeFixed rangeSetMinSliderSize rangeSetSliderSizeFixed { hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs 71 +#if GTK_CHECK_VERSION(2,20,0) + rangeGetMinSliderSize, + rangeGetRangeRect, + rangeGetSliderRange, + rangeGetSliderSizeFixed, + rangeSetMinSliderSize, + rangeSetSliderSizeFixed, +#endif hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs 121 +import Graphics.UI.Gtk.General.Structs (Rectangle(..)) hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs 317 +#if GTK_CHECK_VERSION(2,20,0) +-- | This function is useful mainly for 'Range' subclasses. +-- [_$_] +-- See 'rangeSetMinSliderSize'. +rangeGetMinSliderSize :: RangeClass self => self + -> IO Int -- ^ returns The minimum size of the range's slider. [_$_] +rangeGetMinSliderSize range = + liftM fromIntegral $ + {#call gtk_range_get_min_slider_size #} + (toRange range) + +-- | This function returns the area that contains the range's trough and its steppers, in widget->window +-- coordinates. +-- [_$_] +-- This function is useful mainly for 'Range' subclasses. +rangeGetRangeRect :: RangeClass self => self + -> IO Rectangle +rangeGetRangeRect self = + alloca $ \rPtr -> do + {# call gtk_range_get_range_rect #} + (toRange self) + (castPtr rPtr) + peek rPtr + +-- | This function returns sliders range along the long dimension, in widget->window coordinates. +-- [_$_] +-- This function is useful mainly for 'Range' subclasses. +rangeGetSliderRange :: RangeClass self => self + -> IO (Maybe (Int, Int)) +rangeGetSliderRange range = + alloca $ \ startPtr -> [_$_] + alloca $ \ endPtr -> do + {#call gtk_range_get_slider_range #} + (toRange range) + startPtr + endPtr + if (startPtr /= nullPtr && endPtr /= nullPtr) + then do + start <- peek startPtr + end <- peek endPtr + return (Just (fromIntegral start, fromIntegral end)) + else return Nothing + +-- | This function is useful mainly for 'Range' subclasses. +-- [_$_] +-- See 'rangeSetSliderSizeFixed'. +rangeGetSliderSizeFixed :: RangeClass self => self + -> IO Bool -- ^ returns whether the range's slider has a fixed size. [_$_] +rangeGetSliderSizeFixed self = [_$_] + liftM toBool $ + {#call gtk_range_get_slider_size_fixed #} + (toRange self) + +-- | Sets the minimum size of the range's slider. +-- [_$_] +-- This function is useful mainly for 'Range' subclasses. +rangeSetMinSliderSize :: RangeClass self => self + -> Bool + -> IO () +rangeSetMinSliderSize self minSize = + {#call gtk_range_set_min_slider_size #} + (toRange self) + (fromBool minSize) + +-- | Sets whether the range's slider has a fixed size, or a size that depends on it's adjustment's page +-- size. +-- [_$_] +-- This function is useful mainly for 'Range' subclasses. +rangeSetSliderSizeFixed :: RangeClass self => self + -> Bool -- ^ @sizeFixed@ 'True' to make the slider size constant [_$_] + -> IO () +rangeSetSliderSizeFixed self sizeFixed = + {#call gtk_range_set_slider_size_fixed #} + (toRange self) + (fromBool sizeFixed) +#endif } |