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-09-05 16:12:20
|
diffing dir... Sun Sep 5 12:10:24 EDT 2010 Andy Stewart <laz...@gm...> * Add new module System.GIO.Volumes.Drive Ignore-this: 5e25d33318efae0e62c2c22944357125 { adddir ./gio/System/GIO/Volumes addfile ./gio/System/GIO/Volumes/Drive.chs hunk ./gio/System/GIO/Volumes/Drive.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.Volumes.Drive ( +-- * Details +-- +-- | 'Drive' - this represent a piece of hardware connected to the machine. It's generally only created +-- for removable hardware or hardware with removable media. +-- [_$_] +-- 'Drive' is a container class for 'Volume' objects that stem from the same piece of media. As such, +-- 'Drive' abstracts a drive with (or without) removable media and provides operations for querying +-- whether media is available, determing whether media change is automatically detected and ejecting +-- the media. +-- [_$_] +-- If the 'Drive' reports that media isn't automatically detected, one can poll for media; typically one +-- should not do this periodically as a poll for media operation is potententially expensive and may +-- spin up the drive creating noise. +-- [_$_] +-- 'Drive' supports starting and stopping drives with authentication support for the former. This can be +-- used to support a diverse set of use cases including connecting/disconnecting iSCSI devices, +-- powering down external disk enclosures and starting/stopping multi-disk devices such as RAID +-- devices. Note that the actual semantics and side-effects of starting/ stopping a 'Drive' may vary +-- according to implementation. To choose the correct verbs in e.g. a file manager, use +-- 'driveGetStartStopType'. +-- [_$_] +-- For porting from GnomeVFS note that there is no equivalent of 'Drive' in that API. + +-- * Types + Drive(..), + DriveClass, + +-- * Enums, + DriveStartStopType (..), + DriveStartFlags (..), + +-- * Methods + driveGetName, + driveGetIcon, + driveHasVolumes, + driveGetVolumes, + driveCanEject, +#if GLIB_CHECK_VERSION(2,22,0) + driveGetStartStopType, + driveCanStart, + driveCanStartDegraded, + driveCanStop, +#endif + driveCanPollForMedia, + drivePollForMedia, + driveHasMedia, + driveIsMediaCheckAutomatic, + driveIsMediaRemovable, +#if GLIB_CHECK_VERSION(2,22,0) + driveEjectWithOperation, + driveEjectWithOperationFinish, + driveStart, + driveStartFinish, + driveStopFinish, +#endif + driveEnumerateIdentifiers, + driveGetIdentifier, + [_$_] +-- * Signals [_$_] + driveChanged, + driveDisconnected, + driveEjectButton, +#if GLIB_CHECK_VERSION(2,22,0) + driveStopButton, +#endif + ) where + +import Control.Monad +import Data.Maybe (fromMaybe) +import System.GIO.Enums +import System.Glib.Attributes +import System.Glib.FFI +import System.Glib.Flags +import System.Glib.GError +import System.Glib.GList +import System.Glib.GObject +import System.Glib.Properties +import System.Glib.Signals +import System.Glib.UTFString +{#import System.GIO.Async.AsyncResult#} +{#import System.GIO.Signals#} +{#import System.GIO.Types#} + +{# context lib = "gio" prefix = "g" #} + +-------------------- +-- Methods +-- | Gets the name of drive. +driveGetName :: DriveClass drive => drive + -> IO String -- ^ returns the name for the given drive. [_$_] +driveGetName drive = [_$_] + {#call g_drive_get_name#} (toDrive drive) [_$_] + >>= readUTFString + +-- | Gets the icon for drive. +driveGetIcon :: DriveClass drive => drive + -> IO Icon -- ^ returns a 'Icon'. [_$_] +driveGetIcon drive = [_$_] + makeNewGObject mkIcon $ + {#call g_drive_get_icon#} (toDrive drive) [_$_] + +-- | Check if drive has any mountable volumes. +driveHasVolumes :: DriveClass drive => drive + -> IO Bool -- ^ returns 'True' if the drive contains volumes, 'False' otherwise. [_$_] +driveHasVolumes drive = + liftM toBool $ + {#call g_drive_has_volumes#} (toDrive drive) + +-- | Get a list of mountable volumes for drive. +driveGetVolumes :: DriveClass drive => drive + -> IO [Volume] +driveGetVolumes drive = do + glistPtr <- {#call g_drive_get_volumes #} (toDrive drive) + volumePtrs <- fromGList glistPtr + mapM (makeNewGObject mkVolume . return) volumePtrs + +-- | Checks if drive can be eject. +driveCanEject :: DriveClass drive => drive + -> IO Bool -- ^ returns 'True' if the drive can be ejected. [_$_] +driveCanEject drive = + liftM toBool $ + {#call g_drive_can_eject#} (toDrive drive) + +#if GLIB_CHECK_VERSION(2,22,0) +-- | Gets a hint about how a drive can be started/stopped. +driveGetStartStopType :: DriveClass drive => drive + -> IO DriveStartStopType -- ^ returns A value from the 'DriveStartStopType' enumeration. [_$_] +driveGetStartStopType drive = [_$_] + liftM (toEnum . fromIntegral) $ + {#call g_drive_get_start_stop_type#} (toDrive drive) + +-- | Checks if a drive can be started. +driveCanStart :: DriveClass drive => drive [_$_] + -> IO Bool -- ^ returns 'True' if the drive can be started, 'False' otherwise. [_$_] +driveCanStart drive = [_$_] + liftM toBool $ + {#call g_drive_can_start#} (toDrive drive) + +-- | Checks if a drive can be started degraded. +driveCanStartDegraded :: DriveClass drive => drive [_$_] + -> IO Bool -- ^ returns 'True' if the drive can be started degraded, 'False' otherwise. [_$_] +driveCanStartDegraded drive = [_$_] + liftM toBool $ + {#call g_drive_can_start_degraded#} (toDrive drive) + +-- | Checks if a drive can be stoped. +driveCanStop :: DriveClass drive => drive [_$_] + -> IO Bool -- ^ returns 'True' if the drive can be stoped, 'False' otherwise. [_$_] +driveCanStop drive = [_$_] + liftM toBool $ + {#call g_drive_can_stop#} (toDrive drive) +#endif + +-- | Checks if a drive can be polled for media changes. +driveCanPollForMedia :: DriveClass drive => drive + -> IO Bool +driveCanPollForMedia drive = [_$_] + liftM toBool $ + {#call g_drive_can_poll_for_media#} (toDrive drive) + +-- | Asynchronously polls drive to see if media has been inserted or removed. +-- [_$_] +-- When the operation is finished, callback will be called. You can then call +-- 'drivePollForMediaFinish' to obtain the result of the operation. +drivePollForMedia :: DriveClass drive => drive + -> Maybe Cancellable + -> AsyncReadyCallback + -> IO () +drivePollForMedia drive cancellable callback = do + cCallback <- marshalAsyncReadyCallback callback + {#call g_drive_poll_for_media #} [_$_] + (toDrive drive) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) + +-- | Finishes an operation started with 'drivePollForMedia' on a drive. +-- +-- Throws a 'GError' if an error occurs. +drivePollForMediaFinish :: DriveClass drive => drive + -> AsyncResult -- ^ @result@ a 'AsyncResult'. + -> IO () +drivePollForMediaFinish drive result = [_$_] + propagateGError (\gErrorPtr -> do + {#call g_drive_poll_for_media_finish #} [_$_] + (toDrive drive) [_$_] + result + gErrorPtr + return ()) + +-- | Checks if the drive has media. Note that the OS may not be polling the drive for media changes; see +-- 'driveIsMediaCheckAutomatic' for more details. +driveHasMedia :: DriveClass drive => drive + -> IO Bool -- ^ returns 'True' if drive has media, 'False' otherwise. [_$_] +driveHasMedia drive = [_$_] + liftM toBool $ + {#call g_drive_has_media#} (toDrive drive) + +-- | Checks if drive is capabable of automatically detecting media changes. +driveIsMediaCheckAutomatic :: DriveClass drive => drive + -> IO Bool -- ^ returns 'True' if the drive is capabable of automatically detecting media changes, 'False' otherwise. +driveIsMediaCheckAutomatic drive = [_$_] + liftM toBool $ + {#call g_drive_is_media_check_automatic#} (toDrive drive) + +-- | Checks if the drive supports removable media. +driveIsMediaRemovable :: DriveClass drive => drive + -> IO Bool -- ^ returns 'True' if drive supports removable media, 'False' otherwise. [_$_] +driveIsMediaRemovable drive = [_$_] + liftM toBool $ + {#call g_drive_is_media_removable#} (toDrive drive) + +#if GLIB_CHECK_VERSION(2,22,0) +-- | Ejects a drive. This is an asynchronous operation, and is finished by calling +-- 'driveEjectWithOperationFinish' with the drive and 'AsyncResult' data returned in the callback. +driveEjectWithOperation :: DriveClass drive + => drive + -> [MountUnmountFlags] -- ^ @flags@ flags affecting the unmount if required for eject [_$_] + -> Maybe MountOperation -- ^ @mountOperation@ a 'MountOperation' or 'Nothing' to avoid user interaction. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> AsyncReadyCallback -- ^ @callback@ a 'AsyncReadyCallback' + -> IO () +driveEjectWithOperation drive flags mountOperation cancellable callback = do + cCallback <- marshalAsyncReadyCallback callback + {#call g_drive_eject_with_operation #} [_$_] + (toDrive drive) + ((fromIntegral . fromFlags) flags) + (fromMaybe (MountOperation nullForeignPtr) mountOperation) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) + +-- | Finishes ejecting a drive. If any errors occurred during the operation, error will be set to contain +-- the errors and 'False' will be returned. +-- +-- Throws a 'GError' if an error occurs. +driveEjectWithOperationFinish :: DriveClass drive [_$_] + => drive + -> AsyncResult -- ^ @result@ a 'AsyncResult'. + -> IO () +driveEjectWithOperationFinish drive result = + propagateGError (\gErrorPtr -> do + {#call g_drive_eject_with_operation_finish #} [_$_] + (toDrive drive) [_$_] + result + gErrorPtr + return ()) + +-- | Asynchronously starts a drive. +-- [_$_] +-- When the operation is finished, callback will be called. You can then call 'driveStartFinish' to +-- obtain the result of the operation. +driveStart :: DriveClass drive + => drive + -> [DriveStartFlags] -- ^ @flags@ flags affecting the start operation. [_$_] + -> Maybe MountOperation -- ^ @mountOperation@ a 'MountOperation' or 'Nothing' to avoid user interaction. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> AsyncReadyCallback -- ^ @callback@ a 'AsyncReadyCallback' + -> IO () +driveStart drive flags mountOperation cancellable callback = do + cCallback <- marshalAsyncReadyCallback callback + {#call g_drive_start #} [_$_] + (toDrive drive) + ((fromIntegral . fromFlags) flags) + (fromMaybe (MountOperation nullForeignPtr) mountOperation) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) + +-- | Finishes starting a drive. +-- +-- Throws a 'GError' if an error occurs. +driveStartFinish :: DriveClass drive [_$_] + => drive + -> AsyncResult -- ^ @result@ a 'AsyncResult'. + -> IO () +driveStartFinish drive result = + propagateGError (\gErrorPtr -> do + {#call g_drive_start_finish #} [_$_] + (toDrive drive) [_$_] + result + gErrorPtr + return ()) + +-- | Asynchronously stops a drive. +-- [_$_] +-- When the operation is finished, callback will be called. You can then call 'driveStopFinish' to +-- obtain the result of the operation. +driveStop :: DriveClass drive + => drive + -> [MountUnmountFlags] -- ^ @flags@ flags affecting the stop operation. [_$_] + -> Maybe MountOperation -- ^ @mountOperation@ a 'MountOperation' or 'Nothing' to avoid user interaction. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> AsyncReadyCallback -- ^ @callback@ a 'AsyncReadyCallback' + -> IO () +driveStop drive flags mountOperation cancellable callback = do + cCallback <- marshalAsyncReadyCallback callback + {#call g_drive_stop #} [_$_] + (toDrive drive) + ((fromIntegral . fromFlags) flags) + (fromMaybe (MountOperation nullForeignPtr) mountOperation) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) + +-- | Finishes stoping a drive. +-- +-- Throws a 'GError' if an error occurs. +driveStopFinish :: DriveClass drive [_$_] + => drive + -> AsyncResult -- ^ @result@ a 'AsyncResult'. + -> IO () +driveStopFinish drive result = + propagateGError (\gErrorPtr -> do + {#call g_drive_stop_finish #} [_$_] + (toDrive drive) [_$_] + result + gErrorPtr + return ()) +#endif + +-- | Gets the kinds of identifiers that drive has. Use 'driveGetIdentifer' to obtain the +-- identifiers themselves. +driveEnumerateIdentifiers :: DriveClass drive => drive + -> IO [String] +driveEnumerateIdentifiers drive = [_$_] + {#call g_drive_enumerate_identifiers#} (toDrive drive) + >>= readUTFStringArray0 [_$_] + +-- | Gets the identifier of the given kind for drive. See the introduction for more information about +-- drive identifiers. +driveGetIdentifier :: DriveClass drive => drive + -> String -- ^ @kind@ the kind of identifier to return + -> IO String +driveGetIdentifier drive kind = [_$_] + withUTFString kind $ \ kindPtr -> [_$_] + {#call g_drive_get_identifier#} (toDrive drive) kindPtr + >>= readUTFString + +-------------------- +-- Signals +-- | Emitted when a drive changes. +driveChanged :: DriveClass drive => Signal drive (Drive -> IO ()) +driveChanged = Signal (connect_OBJECT__NONE "drive-changed") + +-- | Emitted when a drive changes. +driveDisconnected :: DriveClass drive => Signal drive (Drive -> IO ()) +driveDisconnected = Signal (connect_OBJECT__NONE "drive-disconnected") + +-- | Emitted when the eject button is pressed on drive. +driveEjectButton :: DriveClass drive => Signal drive (Drive -> IO ()) +driveEjectButton = Signal (connect_OBJECT__NONE "drive-eject-button") + +#if GLIB_CHECK_VERSION(2,22,0) +-- | Emitted when the stop button is pressed on drive. +driveStopButton :: DriveClass drive => Signal drive (Drive -> IO ()) +driveStopButton = Signal (connect_OBJECT__NONE "drive-stop-button") +#endif } |
From: Andy S. <And...@co...> - 2010-09-05 16:09:58
|
diffing dir... Sun Sep 5 12:08:50 EDT 2010 Andy Stewart <laz...@gm...> * Use readGList instead fromGList. Ignore-this: 3e36d136b7944ae620f5231d5e5442f3 { hunk ./gio/System/GIO/Icons/EmblemedIcon.chs 83 - -> IO [Emblem] + -> IO [Emblem] -- ^ returns a list of 'Emblem' s that is owned by emblemed [_$_] hunk ./gio/System/GIO/Icons/EmblemedIcon.chs 86 - emblemPtrs <- fromGList glistPtr + emblemPtrs <- readGList glistPtr } |
From: Andy S. <And...@co...> - 2010-09-05 16:09:56
|
diffing dir... Sun Sep 5 12:03:56 EDT 2010 Andy Stewart <laz...@gm...> * Comment function 'fileInfoSetSymlinkTarget' unless somone know how to use it. Ignore-this: e4823ea0db9b48b693b5ec9864325211 { hunk ./gio/System/GIO/File/FileInfo.chs 124 - fileInfoSetSymlinkTarget, + + -- 'fileInfoSetSymlinkTarget' use *static string* that we don't understand the purpose of this function. + -- If someone know how to use it, uncomment it and fix documentation. + -- fileInfoSetSymlinkTarget, + hunk ./gio/System/GIO/File/FileInfo.chs 608 -fileInfoSetSymlinkTarget :: FileInfoClass info => info [_$_] - -> String -- ^ @symlinkTarget@ a static string containing a path to a symlink target. [_$_] - -> IO () -fileInfoSetSymlinkTarget info symlinkTarget = - withUTFString symlinkTarget $ \ symlinkTargetPtr -> [_$_] - {#call g_file_info_set_symlink_target#} (toFileInfo info) symlinkTargetPtr +-- fileInfoSetSymlinkTarget :: FileInfoClass info => info [_$_] +-- -> String -- ^ @symlinkTarget@ a static string containing a path to a symlink target. [_$_] +-- -> IO () +-- fileInfoSetSymlinkTarget info symlinkTarget = +-- withUTFString symlinkTarget $ \ symlinkTargetPtr -> [_$_] +-- {#call g_file_info_set_symlink_target#} (toFileInfo info) symlinkTargetPtr } |
From: Andy S. <And...@co...> - 2010-09-05 15:38:24
|
diffing dir... Sun Sep 5 11:36:44 EDT 2010 Andy Stewart <laz...@gm...> * Add new module System.GIO.Icons.ThemedIcon Ignore-this: 673e486c2d8abbd6379139689475fbce { addfile ./gio/System/GIO/Icons/ThemedIcon.chs hunk ./gio/System/GIO/Icons/ThemedIcon.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.Icons.ThemedIcon ( +-- * Details +-- +-- | 'ThemeIcon' specifies an icon by pointing to an image file to be used as icon. + +-- * Types [_$_] + ThemedIcon(..), + ThemedIconClass, + +-- * Methods + themedIconNew, + themedIconNewFromNames, + themedIconPrependName, + themedIconAppendName, + themedIconGetNames, + ) where + +import Control.Monad +import System.GIO.Enums +import System.Glib.FFI +import System.Glib.Flags +import System.Glib.GError +import System.Glib.GObject +import System.Glib.UTFString +{#import System.GIO.Types#} + +{# context lib = "gio" prefix = "g" #} + +------------------- +-- Methods +-- | Creates a new icon for a file. +themedIconNew :: String -- ^ @iconname@ a string containing an icon name. [_$_] + -> IO ThemedIcon +themedIconNew iconName = + withUTFString iconName $ \ iconNamePtr -> [_$_] + {#call g_themed_icon_new#} iconNamePtr + >>= (constructNewGObject mkThemedIcon . return) . castPtr + +-- | Creates a new themed icon for iconnames. +themedIconNewFromNames :: [_$_] + [String] -- ^ @iconnames@ an array of strings containing icon names. [_$_] + -> IO ThemedIcon +themedIconNewFromNames iconNames = do + let len = if null iconNames then (-1) else length iconNames + withUTFStringArray iconNames $ \ iconNamesPtr -> [_$_] + {#call g_themed_icon_new_from_names#} iconNamesPtr (fromIntegral len) + >>= (constructNewGObject mkThemedIcon . return) . castPtr + +#if GLIB_CHECK_VERSION(2,18,0) +-- | Prepend a name to the list of icons from within icon. +themedIconPrependName :: ThemedIconClass icon => icon [_$_] + -> String -- ^ @iconname@ name of icon to prepend to list of icons from within icon. [_$_] + -> IO () +themedIconPrependName icon iconname = + withUTFString iconname $ \ iconnamePtr -> [_$_] + {#call g_themed_icon_prepend_name#} (toThemedIcon icon) iconnamePtr +#endif + +-- | Append a name to the list of icons from within icon. +themedIconAppendName :: ThemedIconClass icon => icon [_$_] + -> String -- ^ @iconname@ name of icon to append to list of icons from within icon. [_$_] + -> IO () +themedIconAppendName icon iconname = + withUTFString iconname $ \ iconnamePtr -> [_$_] + {#call g_themed_icon_append_name#} (toThemedIcon icon) iconnamePtr + +-- | Gets the names of icons from within icon. +themedIconGetNames :: ThemedIconClass icon => icon + -> IO [String] -- ^ returns a list of icon names. [_$_] +themedIconGetNames icon = [_$_] + {#call g_themed_icon_get_names#} (toThemedIcon icon) + >>= readUTFStringArray0 + } |
From: Andy S. <And...@co...> - 2010-09-05 15:38:19
|
diffing dir... Sun Sep 5 11:35:55 EDT 2010 Andy Stewart <laz...@gm...> * Add new module System.GIO.Icons.Icon Ignore-this: 5d343e4b92698e5a0536a9c31a64542b { addfile ./gio/System/GIO/Icons/Icon.chs hunk ./gio/System/GIO/Icons/Icon.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.Icons.Icon ( +-- * Details +-- +-- | 'Icon' is a very minimal interface for icons. It provides functions for checking the equality of two +-- icons, hashing of icons and serializing an icon to and from strings. +-- [_$_] +-- 'Icon' does not provide the actual pixmap for the icon as this is out of GIO's scope, however +-- implementations of 'Icon' may contain the name of an icon (see 'ThemedIcon'), or the path to an icon +-- (see GLoadableIcon). +-- [_$_] +-- To obtain a hash of a 'Icon', see 'iconHash'. +-- [_$_] +-- To check if two 'Icon's are equal, see 'iconEqual'. +-- [_$_] +-- For serializing a 'Icon', use 'iconToString'. +-- [_$_] +-- If your application or library provides one or more 'Icon' implementations you need to ensure that +-- each GType is registered with the type system prior to calling 'iconNewForString'. + +-- * Types + Icon(..), + IconClass, + +-- * Methods + iconEqual, +#if GLIB_CHECK_VERSION(2,20,0) + iconToString, + iconNewForString, +#endif + ) where + +import Control.Monad +import System.GIO.Enums +import System.Glib.FFI +import System.Glib.Flags +import System.Glib.GError +import System.Glib.GObject +import System.Glib.UTFString +{#import System.GIO.Types#} + +{# context lib = "gio" prefix = "g" #} + +-- | Checks if two icons are equal. +iconEqual :: (IconClass icon1, IconClass icon2) => icon1 -> icon2 + -> IO Bool -- ^ returns 'True' if icon1 is equal to icon2. 'False' otherwise. [_$_] +iconEqual icon1 icon2 = + liftM toBool $ + {#call g_icon_equal#} (toIcon icon1) (toIcon icon2) + +#if GLIB_CHECK_VERSION(2,20,0) +-- | Generates a textual representation of icon that can be used for serialization such as when passing +-- icon to a different process or saving it to persistent storage. Use 'iconNewForString' to get +-- icon back from the returned string. +-- [_$_] +-- The encoding of the returned string is proprietary to 'Icon' except in the following two cases +-- [_$_] +-- * If icon is a 'FileIcon', the returned string is a native path (such as /path/to/my icon.png) +-- without escaping if the 'File' for icon is a native file. If the file is not native, the returned +-- string is the result of 'fileGetUri'. +-- [_$_] +-- * If icon is a 'ThemedIcon' with exactly one name, the encoding is simply the name (such as +-- network-server). +iconToString :: IconClass icon => icon [_$_] + -> IO String +iconToString icon = + {#call g_icon_to_string#} (toIcon icon) [_$_] + >>= readUTFString + +-- | Generate a 'Icon' instance from str. This function can fail if str is not valid - see +-- 'iconToString' for discussion. +-- [_$_] +-- If your application or library provides one or more 'Icon' implementations you need to ensure that +-- each GType is registered with the type system prior to calling 'iconNewForString'. +iconNewForString :: String -> IO Icon +iconNewForString str = + constructNewGObject mkIcon $ + withUTFString str $ \ strPtr -> [_$_] + propagateGError ({# call g_icon_new_for_string #} strPtr) [_$_] +#endif } |
From: Andy S. <And...@co...> - 2010-09-05 15:38:16
|
diffing dir... Sun Sep 5 11:34:50 EDT 2010 Andy Stewart <laz...@gm...> * Add new module System.GIO.Icons.FileIcon Ignore-this: 6cb9b27e5a4b0d14dc995755c20ffd21 { addfile ./gio/System/GIO/Icons/FileIcon.chs hunk ./gio/System/GIO/Icons/FileIcon.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.Icons.FileIcon ( +-- * Details +-- +-- | 'FileIcon' specifies an icon by pointing to an image file to be used as icon. + +-- * Types [_$_] + FileIcon(..), + FileIconClass, + +-- * Methods + fileIconNew, + fileIconGetFile, + ) where + +import Control.Monad +import System.GIO.Enums +import System.Glib.FFI +import System.Glib.Flags +import System.Glib.GError +import System.Glib.GObject +import System.Glib.UTFString +{#import System.GIO.Types#} + +{# context lib = "gio" prefix = "g" #} + +------------------- +-- Methods +-- | Creates a new icon for a file. +fileIconNew :: FileClass file => file -> IO FileIcon +fileIconNew file = + {#call g_file_icon_new#} (toFile file) + >>= (constructNewGObject mkFileIcon . return) . castPtr + +-- | Gets the 'File' associated with the given icon. +fileIconGetFile :: FileIconClass icon => icon -> IO File +fileIconGetFile icon = + makeNewGObject mkFile $ + {#call g_file_icon_get_file#} (toFileIcon icon) } |
From: Andy S. <And...@co...> - 2010-09-05 15:38:14
|
diffing dir... Sun Sep 5 11:33:44 EDT 2010 Andy Stewart <laz...@gm...> * Add new module System.GIO.Icons.EmblemedIcon Ignore-this: 3b9d8eaa2946c878b78b92a32b2c2d99 { addfile ./gio/System/GIO/Icons/EmblemedIcon.chs hunk ./gio/System/GIO/Icons/EmblemedIcon.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.Icons.EmblemedIcon ( +-- * Details +-- +-- | 'EmblemedIcon' is an implementation of 'Icon' that supports adding an emblem to an icon. Adding +-- multiple emblems to an icon is ensured via 'emblemedIconAddEmblem'. +-- [_$_] +-- Note that 'Emblem'edIcon allows no control over the position of the emblems. See also 'Emblem' for +-- more information. hunk ./gio/System/GIO/Icons/EmblemedIcon.chs 39 +#if GLIB_CHECK_VERSION(2,18,0) +-- * Types [_$_] + EmblemedIcon(..), + EmblemedIconClass, + +-- * Methods + emblemedIconNew, + emblemedIconGetIcon, + emblemedIconGetEmblems, + emblemedIconAddEmblem, +#endif [_$_] + ) 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" #} + +#if GLIB_CHECK_VERSION(2,18,0) +------------------- +-- Methods +-- | Creates a new emblemed icon for icon with the emblem emblem. +emblemedIconNew :: (IconClass icon, EmblemClass emblem) => icon -> emblem -> IO EmblemedIcon +emblemedIconNew icon emblem = + {#call g_emblemed_icon_new#} [_$_] + (toIcon icon) (toEmblem emblem) + >>= (constructNewGObject mkEmblemedIcon . return) . castPtr + +-- | Gets the main icon for emblemed. +emblemedIconGetIcon :: EmblemedIconClass emblemed => emblemed + -> IO Icon -- ^ returns a 'Icon' that is owned by emblemed [_$_] +emblemedIconGetIcon emblemed = + makeNewGObject mkIcon $ + {#call g_emblemed_icon_get_icon#} (toEmblemedIcon emblemed) [_$_] + +-- | Gets the list of emblems for the icon. +emblemedIconGetEmblems :: EmblemedIconClass emblemed => emblemed + -> IO [Emblem] +emblemedIconGetEmblems emblemed = do + glistPtr <- {#call g_emblemed_icon_get_emblems#} (toEmblemedIcon emblemed) + emblemPtrs <- fromGList glistPtr + mapM (makeNewGObject mkEmblem . return) emblemPtrs + +-- | Adds emblem to the 'Emblem'. +emblemedIconAddEmblem :: EmblemedIconClass emblemed => emblemed [_$_] + -> Emblem + -> IO () +emblemedIconAddEmblem emblemed emblem = [_$_] + {#call g_emblemed_icon_add_emblem#} + (toEmblemedIcon emblemed) + emblem + +#endif } |
From: Andy S. <And...@co...> - 2010-09-05 15:38:12
|
diffing dir... Sun Sep 5 11:32:29 EDT 2010 Andy Stewart <laz...@gm...> * Add new module System.GIO.Icons.Emblem Ignore-this: cbdf8eecfaca5c611c6366cf3eb512e0 { adddir ./gio/System/GIO/Icons addfile ./gio/System/GIO/Icons/Emblem.chs hunk ./gio/System/GIO/Icons/Emblem.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.Icons.Emblem ( +-- * Details +-- +-- | 'Emblem' is an implementation of 'Icon' that supports having an emblem, which is an icon with +-- additional properties. It can than be added to a 'EmblemedIcon'. +-- [_$_] +-- Currently, only metainformation about the emblem's origin is supported. More may be added in the +-- future. + +#if GLIB_CHECK_VERSION(2,18,0) +-- * Types + Emblem(..), + EmblemClass, + +-- * Enums + EmblemOrigin (..), + +-- * Methods [_$_] + emblemNew, + emblemNewWithOrigin, + emblemGetIcon, + emblemGetOrigin, +#endif + ) where + +import Control.Monad +import System.GIO.Enums +import System.Glib.FFI +import System.Glib.Flags +import System.Glib.GError +import System.Glib.GObject +import System.Glib.UTFString +{#import System.GIO.Types#} + +{# context lib = "gio" prefix = "g" #} + +#if GLIB_CHECK_VERSION(2,18,0) +------------------- +-- Methods +-- | Creates a new emblem for icon. +emblemNew :: IconClass icon => icon -> IO Emblem +emblemNew icon = + constructNewGObject mkEmblem $ + {#call g_emblem_new#} (toIcon icon) [_$_] + +-- | Creates a new emblem for icon. +emblemNewWithOrigin :: IconClass icon [_$_] + => icon -- ^ @icon@ a 'Icon' containing the icon. [_$_] + -> EmblemOrigin -- ^ @origin@ a 'EmblemOrigin' enum defining the emblem's origin [_$_] + -> IO Emblem +emblemNewWithOrigin icon origin = + constructNewGObject mkEmblem $ + {#call g_emblem_new_with_origin#} (toIcon icon) ((fromIntegral . fromEnum) origin) + +-- | Gives back the icon from emblem. +emblemGetIcon :: EmblemClass emblem [_$_] + => emblem -- ^ @emblem@ a 'Emblem' from which the icon should be extracted. [_$_] + -> IO Icon -- ^ returns a 'Icon'. The returned object belongs to the emblem and should not be modified or freed. +emblemGetIcon emblem = + makeNewGObject mkIcon $ + {#call g_emblem_get_icon#} (toEmblem emblem) + +-- | Gets the origin of the emblem. +emblemGetOrigin :: EmblemClass emblem => emblem + -> IO EmblemOrigin +emblemGetOrigin emblem = + liftM (toEnum . fromIntegral) $ + {#call g_emblem_get_origin#} (toEmblem emblem) +#endif } |
From: Andy S. <And...@co...> - 2010-09-05 15:38:09
|
diffing dir... Sun Sep 5 11:31:21 EDT 2010 Andy Stewart <laz...@gm...> * Add prefix for MountOperation signals Ignore-this: 6405b696a291eba759d37904319909f5 { hunk ./gio/System/GIO/File/MountOperation.chs 69 - aborted, - askPassword, + mountOperationAborted, + mountOperationAskPassword, hunk ./gio/System/GIO/File/MountOperation.chs 72 - reply, + mountOperationReplySignal, hunk ./gio/System/GIO/File/MountOperation.chs 159 -aborted :: MountOperationClass op => Signal op (IO ()) -aborted = Signal (connect_NONE__NONE "aborted") +mountOperationAborted :: MountOperationClass op => Signal op (IO ()) +mountOperationAborted = Signal (connect_NONE__NONE "aborted") hunk ./gio/System/GIO/File/MountOperation.chs 167 -askPassword :: MountOperationClass op => Signal op (String -> String -> String -> AskPasswordFlags -> IO ()) -askPassword = Signal (connect_STRING_STRING_STRING_ENUM__NONE "ask-password") +mountOperationAskPassword :: MountOperationClass op => Signal op (String -> String -> String -> AskPasswordFlags -> IO ()) +mountOperationAskPassword = Signal (connect_STRING_STRING_STRING_ENUM__NONE "ask-password") hunk ./gio/System/GIO/File/MountOperation.chs 181 -reply :: MountOperationClass op => Signal op (MountOperationResult -> IO ()) -reply = Signal (connect_ENUM__NONE "reply") +mountOperationReplySignal :: MountOperationClass op => Signal op (MountOperationResult -> IO ()) +mountOperationReplySignal = Signal (connect_ENUM__NONE "reply") } |
From: Andy S. <And...@co...> - 2010-09-05 15:38:08
|
diffing dir... Sun Sep 5 11:30:54 EDT 2010 Andy Stewart <laz...@gm...> * Should withUTFString Ignore-this: 278a193c5283dbbd160907db9d66353f hunk ./gio/System/GIO/File/FileInfo.chs 608 - withCString symlinkTarget $ \ symlinkTargetPtr -> [_$_] + withUTFString symlinkTarget $ \ symlinkTargetPtr -> [_$_] |
From: Andy S. <And...@co...> - 2010-09-05 05:18:20
|
diffing dir... Sun Sep 5 01:06:48 EDT 2010 Andy Stewart <laz...@gm...> * Add embedded/MPlayer.hs demo in gtk.cabal Ignore-this: 52872e14c841e02c228a8a99a17cc190 hunk ./gtk/gtk.cabal 49 + embedded/MPlayer.hs |
From: Andy S. <And...@co...> - 2010-08-30 15:19:51
|
diffing dir... Mon Aug 30 11:18:40 EDT 2010 Andy Stewart <laz...@gm...> * Add new module File.MountOperation.chs Ignore-this: d59d980c0f36376e14a4a37e79c487b2 { addfile ./gio/System/GIO/File/MountOperation.chs hunk ./gio/System/GIO/File/MountOperation.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.MountOperation ( +-- * Details +-- +-- | 'MountOperation' provides a mechanism for interacting with the user. It can be used for +-- authenticating mountable operations, such as loop mounting files, hard drive partitions or server +-- locations. It can also be used to ask the user questions or show a list of applications preventing +-- unmount or eject operations from completing. +-- [_$_] +-- Note that 'Mount'Operation is used for more than just 'Mount' objects [_\e2_][_\80_][_\93_] for example it is also used in +-- 'driveStart'. +-- [_$_] +-- Users should instantiate a subclass of this that implements all the various callbacks to show the +-- required dialogs, such as 'MountOperation'. If no user interaction is desired (for example when +-- automounting filesystems at login time), usually 'Nothing' can be passed, see each method taking a +-- 'MountOperation' for details. + +-- * Types + MountOperation(..), + MountOperationClass, + +-- * Enums + MountOperationResult(..), + AskPasswordFlags(..), + PasswordSave(..), + +-- * Methods + mountOperationNew, + mountOperationReply, + +-- * Attributes + mountOperationAnonymous, + mountOperationChoice, + mountOperationDomain, + mountOperationPassword, + mountOperationPasswordSave, + mountOperationUsername, + +-- * Signals +#if GLIB_CHECK_VERSION(2,20,0) [_$_] + aborted, + askPassword, + -- askQuestion, + reply, + -- showProcesses, +#endif + ) where + +#include <gio/gio.h> + +import Control.Monad +import System.GIO.Enums +import System.Glib.Attributes +import System.Glib.FFI +import System.Glib.Flags +import System.Glib.GError +import System.Glib.GObject +import System.Glib.Properties +import System.Glib.Signals +import System.Glib.UTFString +{#import System.GIO.Signals#} +{#import System.GIO.Types#} + +{# context lib = "gio" prefix = "g" #} + +-------------------- +-- Methods + +-- | Creates a new mount operation. +mountOperationNew :: IO MountOperation +mountOperationNew = + constructNewGObject mkMountOperation $ + {# call g_mount_operation_new #} + +-- | Emits the "reply" signal. +mountOperationReply :: MountOperationClass op => op -> MountOperationResult -> IO () +mountOperationReply op result = [_$_] + {#call g_mount_operation_reply#} (toMountOperation op) ((fromIntegral . fromEnum) result) + +-------------------- +-- Attributes +-- | Whether to use an anonymous user when authenticating. +-- [_$_] +-- Default value: 'False' +mountOperationAnonymous :: MountOperationClass op => Attr op Bool +mountOperationAnonymous = newAttrFromBoolProperty "anonymous" + +-- | The index of the user's choice when a question is asked during the mount operation. See the +-- 'askQuestion' signal. +-- [_$_] +-- Allowed values: >= 0 +-- [_$_] +-- Default value: 0 +mountOperationChoice :: MountOperationClass op => Attr op Int +mountOperationChoice = newAttrFromIntProperty "choice" + +-- | The domain to use for the mount operation. +-- [_$_] +-- Default value: \"\" +mountOperationDomain :: MountOperationClass op => Attr op String +mountOperationDomain = newAttrFromStringProperty "domain" + +-- | The password that is used for authentication when carrying out the mount operation. +-- [_$_] +-- Default value: \"\" +mountOperationPassword :: MountOperationClass op => Attr op String +mountOperationPassword = newAttrFromStringProperty "password" + +-- | Determines if and how the password information should be saved. +-- [_$_] +-- Default value: 'PasswordSaveNever' +mountOperationPasswordSave :: MountOperationClass op => Attr op PasswordSave +mountOperationPasswordSave = newAttrFromEnumProperty "password-save" + {#call pure unsafe g_password_save_get_type #} + +-- | The user name that is used for authentication when carrying out the mount operation. +-- [_$_] +-- Default value: \"\" +mountOperationUsername :: MountOperationClass op => Attr op String +mountOperationUsername = newAttrFromStringProperty "username" + +-------------------- +-- Signals +#if GLIB_CHECK_VERSION(2,20,0) [_$_] +-- | Emitted by the backend when e.g. a device becomes unavailable while a mount operation is in +-- progress. +-- [_$_] +-- Implementations of 'MountOperation' should handle this signal by dismissing open password dialogs. +-- [_$_] +-- Since 2.20 +aborted :: MountOperationClass op => Signal op (IO ()) +aborted = Signal (connect_NONE__NONE "aborted") +#endif + +-- | Emitted when a mount operation asks the user for a password. +-- [_$_] +-- If the message contains a line break, the first line should be presented as a heading. For example, +-- it may be used as the primary text in a 'MessageDialog'. +askPassword :: MountOperationClass op => Signal op (String -> String -> String -> AskPasswordFlags -> IO ()) +askPassword = Signal (connect_STRING_STRING_STRING_ENUM__NONE "ask-password") + +-- | Emitted when asking the user a question and gives a list of choices for the user to choose from. +-- [_$_] +-- If the message contains a line break, the first line should be presented as a heading. For example, +-- it may be used as the primary text in a 'MessageDialog'. +-- askQuestion :: MountOperationClass op => Signal op (String -> [String] -> IO ()) +-- askQuestion Signal (\after obj user -> connect_STRING_BOXED__NONE "ask-question" after obj +-- (\message choicesPtr -> do +-- choices <- peekUTFString choicesPtr +-- user str choices)) + +-- | Emitted when the user has replied to the mount operation. +reply :: MountOperationClass op => Signal op (MountOperationResult -> IO ()) +reply = Signal (connect_ENUM__NONE "reply") + } |
From: Andy S. <And...@co...> - 2010-08-30 15:19:50
|
diffing dir... Mon Aug 30 11:17:40 EDT 2010 Andy Stewart <laz...@gm...> * Add new module File.IOError.chs Ignore-this: 57ae693466a3466b26c936d32223f34b { addfile ./gio/System/GIO/File/IOError.chs hunk ./gio/System/GIO/File/IOError.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.IOError ( +-- * Details +-- +-- | Contains helper functions for reporting errors to the user. + +-- * Enums + IOErrorEnum(..), + +-- * Methods [_$_] + ioErrorFromErrno, + ) where + +import Control.Monad +import System.GIO.Enums +import System.Glib.FFI + +-------------------- +-- Methods + +-- | Converts errno.h error codes into GIO error codes. +ioErrorFromErrno :: Int -- ^ @err@ Error number as defined in errno.h. [_$_] + -> IO IOErrorEnum -- ^ returns 'IOErrorEnum' value for the given errno.h error number. [_$_] +ioErrorFromErrno err = + liftM (toEnum . fromIntegral) $ {#call g_io_error_from_errno#} (fromIntegral err) } |
From: Andy S. <And...@co...> - 2010-08-30 15:19:46
|
diffing dir... Mon Aug 30 11:16:13 EDT 2010 Andy Stewart <laz...@gm...> * Add new module File.FileMonitor.chs Ignore-this: b890d52b7872aca8f0b02bc5b3bd8082 { addfile ./gio/System/GIO/File/FileMonitor.chs hunk ./gio/System/GIO/File/FileMonitor.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.FileMonitor ( +-- * Details +-- +-- | Monitors a file or directory for changes. +-- [_$_] +-- To obtain a 'FileMonitor' for a file or directory, use 'fileMonitor', or +-- 'fileMonitorDirectory' . +-- [_$_] +-- To get informed about changes to the file or directory you are monitoring, connect to the "changed" +-- signal. The signal will be emitted in the thread-default main context of the thread that the monitor +-- was created in (though if the global default main context is blocked, this may cause notifications +-- to be blocked even if the thread-default context is still running). + +-- * Types + FileMonitor(..), + FileMonitorClass, + +-- * Enums + FileMonitorEvent(..), + +-- * Methods [_$_] + fileMonitorCancel, + fileMonitorIsCancelled, + +-- * Attributes + fileMonitorCancelled, + fileMonitorRateLimit, + +-- * Signals + fileMonitorChanged, + ) where + +import Control.Monad +import System.GIO.Enums +import System.Glib.Attributes +import System.Glib.FFI +import System.Glib.Flags +import System.Glib.GError +import System.Glib.GObject +import System.Glib.Properties +import System.Glib.Signals +import System.Glib.UTFString +{#import System.GIO.Signals#} +{#import System.GIO.Types#} + +-------------------- +-- Methods +-- | Cancels a file monitor. +fileMonitorCancel :: FileMonitorClass monitor => monitor + -> IO Bool -- ^ returns 'True' if monitor was cancelled. +fileMonitorCancel monitor = + liftM toBool $ {#call g_file_monitor_cancel #} (toFileMonitor monitor) + +-- | Returns whether the monitor is canceled. +fileMonitorIsCancelled :: FileMonitorClass monitor => monitor + -> IO Bool -- ^ returns 'True' if monitor is canceled. 'False' otherwise. +fileMonitorIsCancelled monitor = [_$_] + liftM toBool $ {#call g_file_monitor_is_cancelled#} (toFileMonitor monitor) + +-------------------- +-- Attributes +-- | Whether the monitor has been cancelled. +-- [_$_] +-- Default value: 'False' +fileMonitorCancelled :: FileMonitorClass monitor => ReadAttr monitor Bool +fileMonitorCancelled = readAttrFromBoolProperty "cancelled" + +-- | The limit of the monitor to watch for changes, in milliseconds. +-- [_$_] +-- Allowed values: >= 0 +-- [_$_] +-- Default value: 800 +fileMonitorRateLimit :: FileMonitorClass monitor => Attr monitor Int +fileMonitorRateLimit = newAttrFromIntProperty "rate-limit" + +-------------------- +-- Signals +fileMonitorChanged :: FileMonitorClass monitor => Signal monitor (Maybe File -> Maybe File -> FileMonitorEvent -> IO ()) +fileMonitorChanged = Signal (connect_MOBJECT_MOBJECT_ENUM__NONE "changed") + } |
From: Andy S. <And...@co...> - 2010-08-30 15:19:45
|
diffing dir... Mon Aug 30 11:15:19 EDT 2010 Andy Stewart <laz...@gm...> * Use withCString instead withUTFString in fileInfoSetSymlinkTarget Ignore-this: a77406426b53d71127df92a8958ad1b9 hunk ./gio/System/GIO/File/FileInfo.chs 608 - withUTFString symlinkTarget $ \ symlinkTargetPtr -> [_$_] + withCString symlinkTarget $ \ symlinkTargetPtr -> [_$_] |
From: Andy S. <And...@co...> - 2010-08-30 10:51:12
|
diffing dir... Mon Aug 30 06:49:31 EDT 2010 Andy Stewart <laz...@gm...> * Add new module System.GIO.File/FileInfo.chs Ignore-this: bc9b86d4ff5ea8f76cbe2e9ce0c0b523 { addfile ./gio/System/GIO/File/FileInfo.chs hunk ./gio/System/GIO/File/FileInfo.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.FileInfo ( +-- * Details +-- +-- | Functionality for manipulating basic metadata for files. 'FileInfo' implements methods for getting +-- information that all files should contain, and allows for manipulation of extended attributes. +-- [_$_] +-- See 'FileAttribute' for more information on how GIO handles file attributes. +-- [_$_] +-- To obtain a 'FileInfo' for a 'File', use 'fileQueryInfo'. To obtain a +-- 'FileInfo' for a file input or output stream, use 'fileInputStreamQueryInfo' or +-- 'fileOutputStreamQueryInfo'. +-- [_$_] +-- To change the actual attributes of a file, you should then set the attribute in the 'FileInfo' and +-- call 'fileSetAttributesFromInfo' on a 'File'. +-- [_$_] +-- However, not all attributes can be changed in the file. For instance, the actual size of a file +-- cannot be changed via 'fileInfoSetSize' and +-- 'fileQueryWritableNamespaces' to discover the settable attributes of a particular file at +-- runtime. +-- [_$_] +-- 'FileAttributeMatcher' allows for searching through a 'FileInfo' for attributes. + +-- * Types + FileInfo(..), + FileInfoClass, + +-- * Enums, + FileAttributeStatus (..), + +-- * Methods + fileInfoNew, + fileInfoDup, + fileInfoCopyInto, + fileInfoHasAttribute, +#if GLIB_CHECK_VERSION(2,22,0) + fileInfoHasNamespace, +#endif + fileInfoListAttributes, + fileInfoGetAttributeType, + fileInfoRemoveAttribute, + fileInfoGetAttributeAsString, + fileInfoGetAttributeStatus, + fileInfoGetAttributeString, +#if GLIB_CHECK_VERSION(2,22,0) + fileInfoGetAttributeStringList, +#endif + fileInfoGetAttributeByteString, + fileInfoGetAttributeBool, + fileInfoGetAttributeWord32, + fileInfoGetAttributeInt32, + fileInfoGetAttributeWord64, + fileInfoGetAttributeInt64, + fileInfoGetAttributeObject, +#if GLIB_CHECK_VERSION(2,22,0) + fileInfoSetAttributeStatus, +#endif + fileInfoSetAttributeString, +#if GLIB_CHECK_VERSION(2,22,0) + fileInfoSetAttributeStringList, +#endif + fileInfoSetAttributeByteString, + fileInfoSetAttributeBool, + fileInfoSetAttributeWord32, + fileInfoSetAttributeInt32, + fileInfoSetAttributeWord64, + fileInfoSetAttributeInt64, + fileInfoSetAttributeObject, + + fileInfoClearStatus, + fileInfoGetFileType, + fileInfoGetIsHidden, + fileInfoGetIsBackup, + fileInfoGetIsSymlink, + fileInfoGetName, + fileInfoGetDisplayName, + fileInfoGetEditName, + fileInfoGetIcon, + fileInfoGetContentType, + fileInfoGetModificationTime, + fileInfoGetSize, + fileInfoGetSymlinkTarget, + fileInfoGetEtag, + fileInfoGetSortOrder, + fileInfoUnsetAttributeMask, + fileInfoSetFileType, + fileInfoSetIsHidden, + fileInfoSetIsSymlink, + fileInfoSetName, + fileInfoSetDisplayName, + fileInfoSetEditName, + fileInfoSetIcon, + fileInfoSetContentType, + fileInfoSetModificationTime, + fileInfoSetSize, + fileInfoSetSymlinkTarget, + fileInfoSetSortOrder, + ) where + +import Control.Monad + +import System.Glib.FFI +import System.Glib.Flags +import System.Glib.GError +import System.Glib.UTFString +import System.Glib.GObject +import System.Glib.GDateTime + +import System.GIO.Enums +import System.GIO.File.FileAttribute +{#import System.GIO.Types#} + +{# context lib = "gio" prefix = "g" #} + +-- | Creates a new file info structure. +fileInfoNew :: IO FileInfo +fileInfoNew = [_$_] + constructNewGObject mkFileInfo $ + {#call g_file_info_new#} + +-- | Duplicates a file info structure. +fileInfoDup :: FileInfoClass info => info -> IO FileInfo +fileInfoDup info = + constructNewGObject mkFileInfo $ + {#call g_file_info_dup#} (toFileInfo info) + +-- | Copies all of the 'FileAttributes' from @srcInfo@ to @destInfo@. +fileInfoCopyInto :: (FileInfoClass srcInfo, FileInfoClass destInfo) [_$_] + => srcInfo -- ^ @srcInfo@ source to copy attributes from. [_$_] + -> destInfo -- ^ @destInfo@ destination to copy attributes to. [_$_] + -> IO () +fileInfoCopyInto srcInfo destInfo = + {#call g_file_info_copy_into#} (toFileInfo srcInfo) (toFileInfo destInfo) + +-- | Checks if a file info structure has an attribute named attribute. +fileInfoHasAttribute :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. [_$_] + -> Bool -- ^ returns 'True' if Ginfo has an attribute named attribute, 'False' otherwise. +fileInfoHasAttribute info attribute = + toBool $ unsafePerformIO $ + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_has_attribute#} (toFileInfo info) attributePtr + +#if GLIB_CHECK_VERSION(2,22,0) +-- | Checks if a file info structure has an attribute in the specified @nameSpace@. +fileInfoHasNamespace :: FileInfoClass info => info + -> String -- ^ @namespace@ a file namespace key. [_$_] + -> Bool -- ^ returns 'True' if Ginfo has an namespace named namespace, 'False' otherwise. +fileInfoHasNamespace info namespace = + toBool $ unsafePerformIO $ + withUTFString namespace $ \ namespacePtr -> [_$_] + {#call g_file_info_has_namespace#} (toFileInfo info) namespacePtr +#endif + +-- | Lists the file info structure's attributes. +fileInfoListAttributes :: FileInfoClass info => info + -> String -- ^ @nameSpace@ a file attribute key's namespace. + -> IO [String]-- ^ returns a array of strings of all of the possible attribute types for the given @nameSpace@ +fileInfoListAttributes info nameSpace = + withUTFString nameSpace $ \ nameSpacePtr -> [_$_] + {#call g_file_info_list_attributes#} (toFileInfo info) nameSpacePtr + >>= readUTFStringArray0 + +-- | Gets the attribute type for an attribute key. +fileInfoGetAttributeType :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO FileAttributeType -- ^ returns a 'FileAttributeType' for the given attribute, or 'FileAttributeTypeInvalid' if the key is not set. +fileInfoGetAttributeType info attribute = + liftM (toEnum . fromIntegral) $ + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_get_attribute_type#} (toFileInfo info) attributePtr + +-- | Removes all cases of attribute from info if it exists. +fileInfoRemoveAttribute :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO () +fileInfoRemoveAttribute info attribute = + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_remove_attribute#} (toFileInfo info) attributePtr + +-- | Gets the value of a attribute, formated as a string. This escapes things as needed to make the +-- string valid utf8. +fileInfoGetAttributeAsString :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO String -- ^ returns a UTF-8 string associated with the given attribute. [_$_] +fileInfoGetAttributeAsString info attribute = + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_get_attribute_as_string#} (toFileInfo info) attributePtr + >>= readUTFString + +-- | Gets the attribute status for an attribute key. +fileInfoGetAttributeStatus :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO FileAttributeStatus -- ^ returns a 'FileAttributeStatus' for the given attribute, or 'FileAttributeStatusUnset' if the key is invalid. +fileInfoGetAttributeStatus info attribute = + liftM (toEnum . fromIntegral) $ + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_get_attribute_status#} (toFileInfo info) attributePtr + +-- | Gets the value of a string attribute. [_$_] +fileInfoGetAttributeString :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO String -- ^ returns the contents of the attribute value as a string +fileInfoGetAttributeString info attribute = + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_get_attribute_string#} (toFileInfo info) attributePtr + >>= readUTFString + +#if GLIB_CHECK_VERSION(2,22,0) +-- | Gets the value of a stringv attribute. If the attribute does not contain a stringv +fileInfoGetAttributeStringList :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO [String] -- ^ returns the contents of the attribute value as a string list +fileInfoGetAttributeStringList info attribute = + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_get_attribute_stringv#} (toFileInfo info) attributePtr + >>= readUTFStringArray0 +#endif + +-- | Gets the value of a byte string attribute. [_$_] +fileInfoGetAttributeByteString :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO String -- ^ returns the contents of the attribute value as a ByteString +fileInfoGetAttributeByteString info attribute = + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_get_attribute_byte_string#} (toFileInfo info) attributePtr + >>= readCString + +-- | Gets the value of a boolean attribute. +fileInfoGetAttributeBool :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO Bool -- ^ returns the contents of the attribute value as a bool +fileInfoGetAttributeBool info attribute = + liftM toBool $ + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_get_attribute_boolean#} (toFileInfo info) attributePtr + +-- | Gets an Word32 contained within the attribute. [_$_] +fileInfoGetAttributeWord32 :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO Word32 -- ^ returns the contents of the attribute value as a bool +fileInfoGetAttributeWord32 info attribute = + liftM fromIntegral $ + withUTFString attribute $ \ attributePtr -> do + {#call g_file_info_get_attribute_uint32#} (toFileInfo info) attributePtr + [_$_] +-- | Gets an Int32 contained within the attribute. [_$_] +fileInfoGetAttributeInt32 :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO Int32 -- ^ returns the contents of the attribute value as a bool +fileInfoGetAttributeInt32 info attribute = + liftM fromIntegral $ + withUTFString attribute $ \ attributePtr -> do + {#call g_file_info_get_attribute_int32#} (toFileInfo info) attributePtr + +-- | Gets an Word64 contained within the attribute. [_$_] +fileInfoGetAttributeWord64 :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO Word64 -- ^ returns the contents of the attribute value as a bool +fileInfoGetAttributeWord64 info attribute = + liftM fromIntegral $ + withUTFString attribute $ \ attributePtr -> do + {#call g_file_info_get_attribute_uint64#} (toFileInfo info) attributePtr + [_$_] +-- | Gets an Int64 contained within the attribute. [_$_] +fileInfoGetAttributeInt64 :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO Int64 -- ^ returns the contents of the attribute value as a bool +fileInfoGetAttributeInt64 info attribute = + liftM fromIntegral $ + withUTFString attribute $ \ attributePtr -> do + {#call g_file_info_get_attribute_int64#} (toFileInfo info) attributePtr + +-- | Gets the value of a GObject attribute. +fileInfoGetAttributeObject :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. + -> IO (Maybe GObject) -- ^ returns the contents of the attribute value as a object +fileInfoGetAttributeObject info attribute = + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_get_attribute_object#} (toFileInfo info) attributePtr + >>= \x -> maybeNull (makeNewGObject mkGObject) (return $ castPtr x) + +#if GLIB_CHECK_VERSION(2,22,0) +-- | Sets the attribute status for an attribute key. This is only needed by external code that implement +-- 'fileSetAttributesFromInfo' or similar functions. +-- [_$_] +-- The attribute must exist in info for this to work. Otherwise 'False' is returned and info is +-- unchanged. +fileInfoSetAttributeStatus :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key [_$_] + -> FileAttributeStatus -- ^ @status@ a 'FileAttributeStatus' [_$_] + -> IO Bool -- ^ returns 'True' if the status was changed, 'False' if the key was not set. [_$_] +fileInfoSetAttributeStatus info attribute status = + liftM toBool $ + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_set_attribute_status#} + (toFileInfo info) + attributePtr + ((fromIntegral . fromEnum) status) +#endif + +-- | Sets the attribute to contain the given @attrValue@, if possible. +fileInfoSetAttributeString :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. [_$_] + -> String -- ^ @attrValue@ a string. [_$_] + -> IO () +fileInfoSetAttributeString info attribute attrValue = + withUTFString attribute $ \ attributePtr -> [_$_] + withUTFString attrValue $ \ attrValuePtr -> [_$_] + {#call g_file_info_set_attribute_string#} (toFileInfo info) attributePtr attrValuePtr + +#if GLIB_CHECK_VERSION(2,22,0) +-- | Sets the attribute to contain the given @attrValue@, if possible. +fileInfoSetAttributeStringList :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. [_$_] + -> [String] -- ^ @attrValue@ a string. [_$_] + -> IO () +fileInfoSetAttributeStringList info attribute attrValue = + withUTFString attribute $ \ attributePtr -> [_$_] + withUTFStringArray0 attrValue $ \ attrValuePtr -> [_$_] + {#call g_file_info_set_attribute_stringv#} (toFileInfo info) attributePtr attrValuePtr +#endif + +-- | Sets the attribute to contain the given @attrValue@, if possible. +fileInfoSetAttributeByteString :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. [_$_] + -> String -- ^ @attrValue@ a string. [_$_] + -> IO () +fileInfoSetAttributeByteString info attribute attrValue = + withCString attribute $ \ attributePtr -> [_$_] + withCString attrValue $ \ attrValuePtr -> [_$_] + {#call g_file_info_set_attribute_byte_string#} (toFileInfo info) attributePtr attrValuePtr + +-- | Sets the attribute to contain the given @attrValue@, if possible. +fileInfoSetAttributeBool :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. [_$_] + -> Bool -- ^ @attrValue@ a string. [_$_] + -> IO () +fileInfoSetAttributeBool info attribute attrValue = + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_set_attribute_boolean#} (toFileInfo info) attributePtr (fromBool attrValue) + +-- | Sets the attribute to contain the given @attrValue@, if possible. +fileInfoSetAttributeWord32 :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. [_$_] + -> Word32 -- ^ @attrValue@ an Word32 + -> IO () +fileInfoSetAttributeWord32 info attribute attrValue = + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_set_attribute_uint32#} (toFileInfo info) attributePtr (fromIntegral attrValue) + +-- | Sets the attribute to contain the given @attrValue@, if possible. +fileInfoSetAttributeInt32 :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. [_$_] + -> Int32 -- ^ @attrValue@ an Int32 + -> IO () +fileInfoSetAttributeInt32 info attribute attrValue = + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_set_attribute_int32#} (toFileInfo info) attributePtr (fromIntegral attrValue) + +-- | Sets the attribute to contain the given @attrValue@, if possible. +fileInfoSetAttributeWord64 :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. [_$_] + -> Word64 -- ^ @attrValue@ an Word64 + -> IO () +fileInfoSetAttributeWord64 info attribute attrValue = + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_set_attribute_uint64#} (toFileInfo info) attributePtr (fromIntegral attrValue) + +-- | Sets the attribute to contain the given @attrValue@, if possible. +fileInfoSetAttributeInt64 :: FileInfoClass info => info + -> String -- ^ @attribute@ a file attribute key. [_$_] + -> Int64 -- ^ @attrValue@ an Int64 + -> IO () +fileInfoSetAttributeInt64 info attribute attrValue = + withUTFString attribute $ \ attributePtr -> [_$_] + {#call g_file_info_set_attribute_int64#} (toFileInfo info) attributePtr (fromIntegral attrValue) + +-- | Sets the attribute to contain the given @attrValue@, if possible. +fileInfoSetAttributeObject :: FileInfoClass info => info + -> String + -> GObject + -> IO () +fileInfoSetAttributeObject info attribute (GObject attrValue) = + withUTFString attribute $ \ attributePtr -> [_$_] + withForeignPtr attrValue $ \attrValuePtr -> [_$_] + {#call g_file_info_set_attribute_object#} (toFileInfo info) attributePtr (castPtr attrValuePtr) + +-- | Clears the status information from info. +-- +fileInfoClearStatus :: FileInfoClass info => info -> IO () +fileInfoClearStatus info = + {#call g_file_info_clear_status #} (toFileInfo info) + +-- | Gets a file's type (whether it is a regular file, symlink, etc). This is different from the file's +-- content type, see 'fileInfoGetContentType'. +-- +fileInfoGetFileType :: FileInfoClass info => info [_$_] + -> FileType -- ^ returns a 'FileType' for the given file. +fileInfoGetFileType info = + (toEnum . fromIntegral) $ unsafePerformIO $ + {#call g_file_info_get_file_type#} (toFileInfo info) [_$_] + +-- | Checks if a file is hidden. +fileInfoGetIsHidden :: FileInfoClass info => info [_$_] + -> Bool -- ^ returns 'True' if the file is a hidden file, 'False' otherwise. +fileInfoGetIsHidden info = + toBool $ unsafePerformIO $ + {#call g_file_info_get_is_hidden#} (toFileInfo info) + +-- | Checks if a file is a backup file. +fileInfoGetIsBackup :: FileInfoClass info => info [_$_] + -> Bool -- ^ returns 'True' if the file is a backup file, 'False' otherwise. +fileInfoGetIsBackup info = + toBool $ unsafePerformIO $ + {#call g_file_info_get_is_backup#} (toFileInfo info) + +-- | Checks if a file is a symlink file. +fileInfoGetIsSymlink :: FileInfoClass info => info [_$_] + -> Bool -- ^ returns 'True' if the file is a symlink file, 'False' otherwise. +fileInfoGetIsSymlink info = + toBool $ unsafePerformIO $ + {#call g_file_info_get_is_symlink#} (toFileInfo info) + +-- | Gets the name for a file. +fileInfoGetName :: FileInfoClass info => info + -> Maybe String -- ^ returns a string containing the file name. [_$_] +fileInfoGetName info = [_$_] + unsafePerformIO $ [_$_] + {#call g_file_info_get_name#} (toFileInfo info) + >>= maybePeek readCString + +-- | Gets the display name for a file. +fileInfoGetDisplayName :: FileInfoClass info => info + -> Maybe String -- ^ returns a string containing the display name. [_$_] +fileInfoGetDisplayName info = + unsafePerformIO $ + {#call g_file_info_get_display_name#} (toFileInfo info) + >>= maybePeek readUTFString + +-- | Gets the edit name for a file. +fileInfoGetEditName :: FileInfoClass info => info + -> Maybe String -- ^ returns a string containing the edit name. [_$_] +fileInfoGetEditName info = + unsafePerformIO $ + {#call g_file_info_get_edit_name#} (toFileInfo info) + >>= maybePeek readUTFString + +-- | Gets the icon for a file. +fileInfoGetIcon :: FileInfoClass info => info + -> IO Icon -- ^ returns 'Icon' for the given info. [_$_] +fileInfoGetIcon info = + makeNewGObject mkIcon $ + {#call g_file_info_get_icon#} (toFileInfo info) + +-- | Gets the file's content type. +fileInfoGetContentType :: FileInfoClass info => info + -> Maybe String -- ^ returns a string containing the file's content type. [_$_] +fileInfoGetContentType info = + unsafePerformIO $ + {#call g_file_info_get_content_type#} (toFileInfo info) + >>= maybePeek peekCString + +-- | Gets the modification time of the current info and sets it in result. +fileInfoGetModificationTime :: FileInfoClass info => info + -> GTimeVal +fileInfoGetModificationTime info = [_$_] + unsafePerformIO $ + alloca $ \ timeValPtr -> do + {#call g_file_info_get_modification_time#} (toFileInfo info) (castPtr timeValPtr) + peek timeValPtr + +-- | Gets the file's size. +fileInfoGetSize :: FileInfoClass info => info + -> Int64 -- ^ returns a 'Offset' containing the file's size. [_$_] +fileInfoGetSize info = [_$_] + fromIntegral $ unsafePerformIO $ + {#call g_file_info_get_size#} (toFileInfo info) + +-- | Gets the symlink target for a given 'FileInfo'. +fileInfoGetSymlinkTarget :: FileInfoClass info => info + -> Maybe String -- ^ returns a string containing the symlink target. [_$_] +fileInfoGetSymlinkTarget info = + unsafePerformIO $ + {#call g_file_info_get_symlink_target#} (toFileInfo info) + >>= maybePeek readUTFString + +-- | Gets the entity tag for a given 'FileInfo'. See 'FileAttributeEtagValue'. +fileInfoGetEtag :: FileInfoClass info => info + -> Maybe String -- ^ returns a string containing the value of the "etag:value" attribute. [_$_] +fileInfoGetEtag info = [_$_] + unsafePerformIO $ + {#call g_file_info_get_etag#} (toFileInfo info) + >>= maybePeek readUTFString + +-- | Gets the value of the @sortOrder@ attribute from the 'FileInfo'. See +-- 'FileAttributeStandardSortOrder'. +fileInfoGetSortOrder :: FileInfoClass info => info + -> Int -- ^ returns the value of the \"standard::sort_order\" attribute. +fileInfoGetSortOrder info = [_$_] + fromIntegral $ unsafePerformIO $ + {#call g_file_info_get_sort_order#} (toFileInfo info) + +-- | Unsets a mask set by 'fileInfoSetAttributeMask', if one is set. +fileInfoUnsetAttributeMask :: FileInfoClass info => info -> IO () +fileInfoUnsetAttributeMask info = + {#call g_file_info_unset_attribute_mask#} (toFileInfo info) + +-- | Sets the file type in a 'FileInfo' to type. See 'FileAttributeStandardType'. +fileInfoSetFileType :: FileInfoClass info => info -> FileType -> IO () +fileInfoSetFileType info fType = [_$_] + {#call g_file_info_set_file_type#} [_$_] + (toFileInfo info) + ((fromIntegral . fromEnum) fType) + +-- | Sets the @isHidden@ attribute in a 'FileInfo' according to @isSymlink@. See +-- 'FileAttributeStandardIsHidden'. +fileInfoSetIsHidden :: FileInfoClass info => info -> Bool -> IO () +fileInfoSetIsHidden info isHidden = [_$_] + {#call g_file_info_set_is_hidden#} (toFileInfo info) (fromBool isHidden) + +-- | Sets the @isSymlink@ attribute in a 'FileInfo' according to @isSymlink@. See +-- 'FileAttributeStandardIsSymlink'. +fileInfoSetIsSymlink :: FileInfoClass info => info -> Bool -> IO () +fileInfoSetIsSymlink info isSymlink = [_$_] + {#call g_file_info_set_is_symlink#} (toFileInfo info) (fromBool isSymlink) + +-- | Sets the name attribute for the current 'FileInfo'. See 'FileAttributeStandardName'. +fileInfoSetName :: FileInfoClass info => info -> String -> IO () +fileInfoSetName info name = [_$_] + withCString name $ \ namePtr -> [_$_] + {#call g_file_info_set_name#} (toFileInfo info) namePtr + +-- | Sets the display name for the current 'FileInfo'. See 'FileAttributeStandardDisplayName'. +fileInfoSetDisplayName :: FileInfoClass info => info -> String -> IO () +fileInfoSetDisplayName info displayName = [_$_] + withUTFString displayName $ \ displayNamePtr -> [_$_] + {#call g_file_info_set_display_name#} (toFileInfo info) displayNamePtr + +-- | Sets the edit name for the current 'FileInfo'. See 'FileAttributeStandardEditName'. +fileInfoSetEditName :: FileInfoClass info => info -> String -> IO () +fileInfoSetEditName info editName = [_$_] + withUTFString editName $ \ editNamePtr -> [_$_] + {#call g_file_info_set_edit_name#} (toFileInfo info) editNamePtr + +-- | Sets the icon for a given 'FileInfo'. See 'FileAttributeStandardIcon'. +fileInfoSetIcon :: FileInfoClass info => info -> Icon -> IO () +fileInfoSetIcon info icon = + {#call g_file_info_set_icon#} (toFileInfo info) (toIcon icon) + +-- | Sets the content type attribute for a given 'FileInfo'. See 'FileAttributeStandardContentType'. +fileInfoSetContentType :: FileInfoClass info => info [_$_] + -> String -- ^ @contentType@ a content type. See GContentType. [_$_] + -> IO () +fileInfoSetContentType info contentType = [_$_] + withUTFString contentType $ \ contentTypePtr -> [_$_] + {#call g_file_info_set_content_type#} (toFileInfo info) contentTypePtr + +-- | Sets the 'FileAttributeTimeModified' attribute in the file info to the given time value. +fileInfoSetModificationTime :: FileInfoClass info => info + -> GTimeVal + -> IO () +fileInfoSetModificationTime info mtime = + with mtime $ \ mtimePtr -> [_$_] + {#call g_file_info_set_modification_time#} (toFileInfo info) (castPtr mtimePtr) + +-- | Sets the 'FileAttributeStandardSize' attribute in the file info to the given size. +fileInfoSetSize :: FileInfoClass info => info [_$_] + -> Int64 -- ^ @size@ a goffset containing the file's size. [_$_] + -> IO () +fileInfoSetSize info size = + {#call g_file_info_set_size#} (toFileInfo info) (fromIntegral size) + +-- | Sets the 'FileAttributeStandardSymlinkTarget' attribute in the file info to the given symlink +-- target. +fileInfoSetSymlinkTarget :: FileInfoClass info => info [_$_] + -> String -- ^ @symlinkTarget@ a static string containing a path to a symlink target. [_$_] + -> IO () +fileInfoSetSymlinkTarget info symlinkTarget = + withUTFString symlinkTarget $ \ symlinkTargetPtr -> [_$_] + {#call g_file_info_set_symlink_target#} (toFileInfo info) symlinkTargetPtr + +-- | Sets the sort order attribute in the file info structure. See 'FileAttributeStandardSortOrder'. +fileInfoSetSortOrder :: FileInfoClass info => info [_$_] + -> Int -- ^ @sortOrder@ a sort order integer. [_$_] + -> IO () +fileInfoSetSortOrder info sortOrder = + {#call g_file_info_set_sort_order#} (toFileInfo info) (fromIntegral sortOrder) } |
From: Andy S. <And...@co...> - 2010-08-30 07:14:23
|
diffing dir... Mon Aug 30 03:12:40 EDT 2010 Andy Stewart <laz...@gm...> * Add new signal : NONE:MOBJECT,MOBJECT,ENUM Ignore-this: 40f4fe55a1fea4aee4c2e0ac4976529f hunk ./gio/marshal.list 50 +NONE:MOBJECT,MOBJECT,ENUM |
From: Andy S. <And...@co...> - 2010-08-30 07:14:20
|
diffing dir... Mon Aug 30 03:10:56 EDT 2010 Andy Stewart <laz...@gm...> * Fix GError functions of FileEnumerator.chs Ignore-this: 3ae6b5422a8f68cff9a033c18b63ca97 { hunk ./gio/System/GIO/File/FileEnumerator.chs 65 +import Data.Maybe (fromMaybe) hunk ./gio/System/GIO/File/FileEnumerator.chs 74 -{#import System.GIO.Base#} hunk ./gio/System/GIO/File/FileEnumerator.chs 82 --- On error, returns 'Nothing' and sets error to the error. If the enumerator is at the end, 'Nothing' will be --- returned and error will be unset. +-- On error, a 'GError' is thrown. If the enumerator is at the end, 'Nothing' will be +-- returned. hunk ./gio/System/GIO/File/FileEnumerator.chs 88 - maybeNull (makeNewGObject mkFileInfo) $ - withGObject (toFileEnumerator enumerator) $ \cEnumerator -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError $ \gErrorPtr -> [_$_] - g_file_enumerator_next_file cEnumerator cCancellable gErrorPtr - where _ = {# call g_file_enumerator_next_file #} + checkGError ( \gErrorPtr -> [_$_] + maybeNull (makeNewGObject mkFileInfo) $ + {#call g_file_enumerator_next_file #} [_$_] + (toFileEnumerator enumerator) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + gErrorPtr) + (\ _ -> return Nothing) + [_$_] hunk ./gio/System/GIO/File/FileEnumerator.chs 102 +-- +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/FileEnumerator.chs 106 - -> IO Bool -- ^ returns 'True' on success or 'False' on error. [_$_] + -> IO () hunk ./gio/System/GIO/File/FileEnumerator.chs 108 - liftM toBool $ - withGObject (toFileEnumerator enumerator) $ \cEnumerator -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError $ \gErrorPtr -> [_$_] - g_file_enumerator_close cEnumerator cCancellable gErrorPtr - where _ = {# call g_file_enumerator_close #} + propagateGError $ \gErrorPtr -> do + {#call g_file_enumerator_close#} [_$_] + (toFileEnumerator enumerator) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + gErrorPtr + return () hunk ./gio/System/GIO/File/FileEnumerator.chs 135 -fileEnumeratorNextFilesAsync enumerator numFiles ioPriority cancellable callback = - withGObject (toFileEnumerator enumerator) $ \cEnumerator -> - maybeWith withGObject cancellable $ \cCancellable -> do - cCallback <- marshalAsyncReadyCallback callback - g_file_enumerator_next_files_async [_$_] - cEnumerator - (fromIntegral numFiles) - (fromIntegral ioPriority) - cCancellable - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call g_file_enumerator_next_files_async #} +fileEnumeratorNextFilesAsync enumerator numFiles ioPriority cancellable callback = do + cCallback <- marshalAsyncReadyCallback callback + {#call g_file_enumerator_next_files_async #} + (toFileEnumerator enumerator) + (fromIntegral numFiles) + (fromIntegral ioPriority) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/FileEnumerator.chs 166 -fileEnumeratorCloseAsync enumerator ioPriority mbCancellable callback = - withGObject (toFileEnumerator enumerator) $ \cEnumerator -> - maybeWith withGObject mbCancellable $ \cCancellable -> do - cCallback <- marshalAsyncReadyCallback callback - g_file_enumerator_close_async [_$_] - cEnumerator - (fromIntegral ioPriority) - cCancellable - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call g_file_enumerator_close_async #} +fileEnumeratorCloseAsync enumerator ioPriority mbCancellable callback = do + cCallback <- marshalAsyncReadyCallback callback + {#call g_file_enumerator_close_async #} + (toFileEnumerator enumerator) [_$_] + (fromIntegral ioPriority) + (fromMaybe (Cancellable nullForeignPtr) mbCancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/FileEnumerator.chs 182 --- the error 'IoErrorCancelled' will be set, and 'False' will be returned. +-- the 'GError' 'IoErrorCancelled' will be thrown. hunk ./gio/System/GIO/File/FileEnumerator.chs 185 - -> IO Bool -- ^ returns 'True' if the close operation has finished successfully. [_$_] + -> IO () hunk ./gio/System/GIO/File/FileEnumerator.chs 187 - liftM toBool $ - propagateGError ({# call g_file_enumerator_close_finish #} (toFileEnumerator enumerator) asyncResult) [_$_] + propagateGError (\gErrorPtr -> do + {# call g_file_enumerator_close_finish #} [_$_] + (toFileEnumerator enumerator) [_$_] + asyncResult + gErrorPtr + return ()) [_$_] } |
From: Andy S. <And...@co...> - 2010-08-30 07:14:19
|
diffing dir... Mon Aug 30 03:10:16 EDT 2010 Andy Stewart <laz...@gm...> * Fix GError functions of File.chs Ignore-this: bd9fc6eeb52c895ec60f8afba1f08ad1 { hunk ./gio/System/GIO/File/File.chs 39 --- To construct a 'File', you can use: 'fileNewForPath' if +-- To construct a 'File', you can use: 'fileFromPath' if hunk ./gio/System/GIO/File/File.chs 229 - ) where +) where hunk ./gio/System/GIO/File/File.chs 233 +import Data.Maybe (fromMaybe) hunk ./gio/System/GIO/File/File.chs 242 -{#import System.GIO.Base#} hunk ./gio/System/GIO/File/File.chs 369 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject parent $ \parentPtr -> - g_file_has_parent cFile parentPtr - where _ = {#call file_has_parent #} + {#call g_file_has_parent#} [_$_] + (toFile file) + (fromMaybe (File nullForeignPtr) parent) hunk ./gio/System/GIO/File/File.chs 387 --- fails, it returns 'Nothing' and error will be set. This is very useful when constructing a 'File' for a +-- fails, it throws a GError. This is very useful when constructing a 'File' for a hunk ./gio/System/GIO/File/File.chs 392 -fileGetChildForDisplayName :: FileClass file => file -> String -> Maybe File +fileGetChildForDisplayName :: FileClass file => file -> String -> File hunk ./gio/System/GIO/File/File.chs 394 - unsafePerformIO $ maybeNull (makeNewGObject mkFile) $ + unsafePerformIO $ (makeNewGObject mkFile) $ hunk ./gio/System/GIO/File/File.chs 477 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_read cFile cCancellable) [_$_] - where _ = {# call file_read #} + propagateGError ({#call g_file_read#} [_$_] + (toFile file) + (fromMaybe (Cancellable nullForeignPtr) cancellable)) [_$_] hunk ./gio/System/GIO/File/File.chs 493 -fileReadAsync file ioPriority mbCancellable callback = - withGObject (toFile file) $ \cFile -> - maybeWith withGObject mbCancellable $ \cCancellable -> do - cCallback <- marshalAsyncReadyCallback callback - g_file_read_async cFile - (fromIntegral ioPriority) - cCancellable - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call file_read_async #} +fileReadAsync file ioPriority mbCancellable callback = do + cCallback <- marshalAsyncReadyCallback callback + {#call g_file_read_async#} [_$_] + (toFile file) + (fromIntegral ioPriority) + (fromMaybe (Cancellable nullForeignPtr) mbCancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/File.chs 532 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_append_to cFile ((fromIntegral . fromFlags) flags) cCancellable) - where _ = {# call file_append_to #} + propagateGError ({#call g_file_append_to #} [_$_] + (toFile file) [_$_] + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + ) hunk ./gio/System/GIO/File/File.chs 559 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_create cFile ((fromIntegral . fromFlags) flags) cCancellable) - where _ = {# call file_create #} + propagateGError ({#call g_file_create #} [_$_] + (toFile file) [_$_] + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + ) hunk ./gio/System/GIO/File/File.chs 604 - withGObject (toFile file) $ \cFile -> hunk ./gio/System/GIO/File/File.chs 605 - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_replace cFile - cEtag - (fromBool makeBackup) - ((fromIntegral . fromFlags) flags) cCancellable) - where _ = {# call file_replace #} + propagateGError ({#call g_file_replace#} [_$_] + (toFile file) + cEtag + (fromBool makeBackup) + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable)) hunk ./gio/System/GIO/File/File.chs 625 -fileAppendToAsync file flags ioPriority cancellable callback = - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> do +fileAppendToAsync file flags ioPriority cancellable callback = do hunk ./gio/System/GIO/File/File.chs 627 - g_file_append_to_async cFile - ((fromIntegral . fromFlags) flags) - (fromIntegral ioPriority) - cCancellable - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call file_append_to_async #} + {#call g_file_append_to_async#} [_$_] + (toFile file) + ((fromIntegral . fromFlags) flags) + (fromIntegral ioPriority) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/File.chs 658 -fileCreateAsync file flags ioPriority cancellable callback = - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> do +fileCreateAsync file flags ioPriority cancellable callback = do hunk ./gio/System/GIO/File/File.chs 660 - g_file_create_async cFile - ((fromIntegral . fromFlags) flags) - (fromIntegral ioPriority) - cCancellable - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call file_create_async #} + {#call g_file_create_async #} [_$_] + (toFile file) + ((fromIntegral . fromFlags) flags) + (fromIntegral ioPriority) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/File.chs 694 - withGObject (toFile file) $ \cFile -> - withUTFString etag $ \cEtag -> - maybeWith withGObject cancellable $ \cCancellable -> do + withUTFString etag $ \cEtag -> do hunk ./gio/System/GIO/File/File.chs 696 - g_file_replace_async cFile - cEtag - (fromBool makeBackup) - ((fromIntegral . fromFlags) flags) - (fromIntegral ioPriority) - cCancellable - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call file_replace_async #} + {#call g_file_replace_async #} [_$_] + (toFile file) + cEtag + (fromBool makeBackup) + ((fromIntegral . fromFlags) flags) + (fromIntegral ioPriority) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/File.chs 744 - withGObject (toFile file) $ \cFile -> hunk ./gio/System/GIO/File/File.chs 745 - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_query_info cFile cAttributes ((fromIntegral . fromFlags) flags) cCancellable) - where _ = {# call file_query_info #} + propagateGError ({#call g_file_query_info #} [_$_] + (toFile file) [_$_] + cAttributes [_$_] + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + ) hunk ./gio/System/GIO/File/File.chs 768 - withGObject (toFile file) $ \cFile -> - withUTFString attributes $ \cAttributes -> - maybeWith withGObject cancellable $ \cCancellable -> do + withUTFString attributes $ \cAttributes -> do hunk ./gio/System/GIO/File/File.chs 770 - g_file_query_info_async cFile - cAttributes - ((fromIntegral . fromFlags) flags) - (fromIntegral ioPriority) - cCancellable - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call file_query_info_async #} + {#call g_file_query_info_async #} [_$_] + (toFile file) + cAttributes + ((fromIntegral . fromFlags) flags) + (fromIntegral ioPriority) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/File.chs 812 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> - liftM toBool $ g_file_query_exists cFile cCancellable - where _ = {# call file_query_exists #} + liftM toBool $ [_$_] + {#call g_file_query_exists #} [_$_] + (toFile file) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 830 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> - (g_file_query_file_type cFile ((fromIntegral . fromFlags) flags) cCancellable) - where _ = {# call file_query_file_type #} + ({#call g_file_query_file_type #} [_$_] + (toFile file) [_$_] + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) ) hunk ./gio/System/GIO/File/File.chs 861 - withGObject (toFile file) $ \cFile -> hunk ./gio/System/GIO/File/File.chs 862 - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_query_filesystem_info cFile cAttributes cCancellable) - where _ = {# call file_query_filesystem_info #} + propagateGError ({#call g_file_query_filesystem_info #} [_$_] + (toFile file) [_$_] + cAttributes [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) ) hunk ./gio/System/GIO/File/File.chs 883 - withGObject (toFile file) $ \cFile -> - withUTFString attributes $ \cAttributes -> - maybeWith withGObject cancellable $ \cCancellable -> do + withUTFString attributes $ \cAttributes -> do hunk ./gio/System/GIO/File/File.chs 885 - g_file_query_filesystem_info_async cFile - cAttributes - (fromIntegral ioPriority) - cCancellable - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call file_query_filesystem_info_async #} + {#call g_file_query_filesystem_info_async #} [_$_] + (toFile file) + cAttributes + (fromIntegral ioPriority) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/File.chs 914 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_query_default_handler cFile cCancellable) - where _ = {# call file_query_default_handler #} + propagateGError ({#call g_file_query_default_handler #} [_$_] + (toFile file) + (fromMaybe (Cancellable nullForeignPtr) cancellable) ) hunk ./gio/System/GIO/File/File.chs 932 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_find_enclosing_mount cFile cCancellable) - where _ = {# call file_find_enclosing_mount #} + propagateGError ({#call g_file_find_enclosing_mount #} [_$_] + (toFile file) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + ) hunk ./gio/System/GIO/File/File.chs 949 -fileFindEnclosingMountAsync file ioPriority cancellable callback = - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> do +fileFindEnclosingMountAsync file ioPriority cancellable callback = do hunk ./gio/System/GIO/File/File.chs 951 - g_file_find_enclosing_mount_async cFile - (fromIntegral ioPriority) - cCancellable - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call file_find_enclosing_mount_async #} + {#call g_file_find_enclosing_mount_async #} [_$_] + (toFile file) + (fromIntegral ioPriority) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/File.chs 991 - withGObject (toFile file) $ \cFile -> hunk ./gio/System/GIO/File/File.chs 992 - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_enumerate_children cFile cAttributes ((fromIntegral . fromFlags) flags) cCancellable) - where _ = {# call file_enumerate_children #} + propagateGError ({#call g_file_enumerate_children #} [_$_] + (toFile file) [_$_] + cAttributes [_$_] + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + ) hunk ./gio/System/GIO/File/File.chs 1015 - withGObject (toFile file) $ \cFile -> - withUTFString attributes $ \cAttributes -> - maybeWith withGObject cancellable $ \cCancellable -> do + withUTFString attributes $ \cAttributes -> do hunk ./gio/System/GIO/File/File.chs 1017 - g_file_enumerate_children_async cFile - cAttributes - ((fromIntegral . fromFlags) flags) - (fromIntegral ioPriority) - cCancellable - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call file_enumerate_children_async #} + {#call g_file_enumerate_children_async #} [_$_] + (toFile file) + cAttributes + ((fromIntegral . fromFlags) flags) + (fromIntegral ioPriority) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/File.chs 1056 - withGObject (toFile file) $ \cFile -> hunk ./gio/System/GIO/File/File.chs 1057 - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_set_display_name cFile cDisplayName cCancellable) - where _ = {# call file_set_display_name #} + propagateGError ({#call g_file_set_display_name #} [_$_] + (toFile file) [_$_] + cDisplayName [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) ) hunk ./gio/System/GIO/File/File.chs 1076 - withGObject (toFile file) $ \cFile -> - withUTFString displayName $ \cDisplayName -> - maybeWith withGObject cancellable $ \cCancellable -> do + withUTFString displayName $ \cDisplayName -> do hunk ./gio/System/GIO/File/File.chs 1078 - g_file_set_display_name_async cFile - cDisplayName - (fromIntegral ioPriority) - cCancellable - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call file_set_display_name_async #} + {#call g_file_set_display_name_async #} [_$_] + (toFile file) + cDisplayName + (fromIntegral ioPriority) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/File.chs 1105 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_delete cFile cCancellable) >> return () - where _ = {# call file_delete #} + propagateGError ({#call g_file_delete #} + (toFile file) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + ) >> return () hunk ./gio/System/GIO/File/File.chs 1122 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_trash cFile cCancellable) >> return () - where _ = {# call file_trash #} + propagateGError ({#call g_file_trash #} + (toFile file) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + ) >> return () hunk ./gio/System/GIO/File/File.chs 1163 - -> IO Bool -fileCopy source destination flags cancellable progressCallback = - withGObject (toFile source) $ \cSource -> - withGObject (toFile destination) $ \cDestination -> - maybeWith withGObject cancellable $ \cCancellable -> do + -> IO () +fileCopy source destination flags cancellable progressCallback = do hunk ./gio/System/GIO/File/File.chs 1167 - ret <- g_file_copy cSource - cDestination - ((fromIntegral . fromFlags) flags) - cCancellable - cProgressCallback - nullPtr - cError + {#call g_file_copy #} [_$_] + (toFile source) + (toFile destination) + ((fromIntegral . fromFlags) flags) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cProgressCallback + nullPtr + cError hunk ./gio/System/GIO/File/File.chs 1177 - return $ toBool ret - where _ = {# call file_copy #} hunk ./gio/System/GIO/File/File.chs 1195 -fileCopyAsync source destination flags ioPriority cancellable progressCallback callback = - withGObject (toFile source) $ \cSource -> - withGObject (toFile destination) $ \cDestination -> - maybeWith withGObject cancellable $ \cCancellable -> do +fileCopyAsync source destination flags ioPriority cancellable progressCallback callback = do hunk ./gio/System/GIO/File/File.chs 1201 - g_file_copy_async cSource - cDestination - ((fromIntegral . fromFlags) flags) - (fromIntegral ioPriority) - cCancellable - cProgressCallback - nullPtr - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call file_copy_async #} + {#call g_file_copy_async #} + (toFile source) + (toFile destination) + ((fromIntegral . fromFlags) flags) + (fromIntegral ioPriority) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cProgressCallback + nullPtr + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/File.chs 1213 +-- +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/File.chs 1218 - -> IO Bool + -> IO () hunk ./gio/System/GIO/File/File.chs 1220 - liftM toBool $ propagateGError ({# call file_copy_finish #} (toFile file) asyncResult) + propagateGError (\gErrorPtr -> do + {# call file_copy_finish #} [_$_] + (toFile file) [_$_] + asyncResult + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1264 - -> IO Bool -fileMove source destination flags cancellable progressCallback = - withGObject (toFile source) $ \cSource -> - withGObject (toFile destination) $ \cDestination -> - maybeWith withGObject cancellable $ \cCancellable -> do + -> IO () +fileMove source destination flags cancellable progressCallback = do hunk ./gio/System/GIO/File/File.chs 1268 - ret <- g_file_move cSource - cDestination - ((fromIntegral . fromFlags) flags) - cCancellable - cProgressCallback - nullPtr - cError + {#call g_file_move #} [_$_] + (toFile source) + (toFile destination) + ((fromIntegral . fromFlags) flags) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cProgressCallback + nullPtr + cError hunk ./gio/System/GIO/File/File.chs 1278 - return $ toBool ret - where _ = {# call file_move #} hunk ./gio/System/GIO/File/File.chs 1295 -fileMakeDirectory file cancellable = - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> do - propagateGError $ g_file_make_directory cFile cCancellable +fileMakeDirectory file cancellable = do + propagateGError $ {#call g_file_make_directory #} + (toFile file) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 1300 - where _ = {# call file_make_directory #} hunk ./gio/System/GIO/File/File.chs 1316 -fileMakeDirectoryWithParents file cancellable = - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> do - propagateGError $ g_file_make_directory_with_parents cFile cCancellable +fileMakeDirectoryWithParents file cancellable = do + propagateGError $ {#call g_file_make_directory_with_parents #} + (toFile file) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 1321 - where _ = {# call file_make_directory_with_parents #} hunk ./gio/System/GIO/File/File.chs 1334 - withGObject (toFile file) $ \cFile -> - withUTFString symlinkValue $ \cSymlinkValue -> - maybeWith withGObject cancellable $ \cCancellable -> do - propagateGError $ g_file_make_symbolic_link cFile cSymlinkValue cCancellable + withUTFString symlinkValue $ \cSymlinkValue -> do + propagateGError $ {#call g_file_make_symbolic_link #} [_$_] + (toFile file) [_$_] + cSymlinkValue [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 1340 - where _ = {# call file_make_symbolic_link #} hunk ./gio/System/GIO/File/File.chs 1348 - g_file_attribute_info_list_unref ptr hunk ./gio/System/GIO/File/File.chs 1349 - where _ = {# call file_attribute_info_list_unref #} hunk ./gio/System/GIO/File/File.chs 1363 -fileQuerySettableAttributes file cancellable = - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> do - ptr <- propagateGError $ g_file_query_settable_attributes cFile cCancellable +fileQuerySettableAttributes file cancellable = do + ptr <- propagateGError $ [_$_] + {#call g_file_query_settable_attributes #} + (toFile file) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 1370 - where _ = {# call file_query_settable_attributes #} hunk ./gio/System/GIO/File/File.chs 1381 -fileQueryWritableNamespaces file cancellable = - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> do - ptr <- propagateGError $ g_file_query_writable_namespaces cFile cCancellable +fileQueryWritableNamespaces file cancellable = do + ptr <- propagateGError $ [_$_] + {#call g_file_query_writable_namespaces #} + (toFile file) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 1388 - where _ = {# call file_query_writable_namespaces #} hunk ./gio/System/GIO/File/File.chs 1402 - -> IO Bool -- ^ returns 'True' if there was any error, 'False' otherwise. [_$_] + -> IO () hunk ./gio/System/GIO/File/File.chs 1404 - liftM toBool $ - withGObject (toFile file) $ \cFile -> - withGObject (toFileInfo fileInfo) $ \cFileInfo -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_set_attributes_from_info cFile cFileInfo ((fromIntegral . fromFlags) flags) cCancellable) - where _ = {# call g_file_set_attributes_from_info #} + propagateGError (\gErrorPtr -> do + {#call g_file_set_attributes_from_info #} [_$_] + (toFile file) [_$_] + (toFileInfo fileInfo) + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1427 -fileSetAttributesFromInfoAsync file fileInfo flags ioPriority cancellable callback = - withGObject (toFile file) $ \cFile -> - withGObject (toFileInfo fileInfo) $ \cFileInfo -> - maybeWith withGObject cancellable $ \cCancellable -> do +fileSetAttributesFromInfoAsync file fileInfo flags ioPriority cancellable callback = do hunk ./gio/System/GIO/File/File.chs 1429 - g_file_set_attributes_async [_$_] - cFile [_$_] - cFileInfo [_$_] + {#call g_file_set_attributes_async #} [_$_] + (toFile file) + (toFileInfo fileInfo) hunk ./gio/System/GIO/File/File.chs 1434 - cCancellable + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 1437 - where _ = {# call g_file_set_attributes_async #} hunk ./gio/System/GIO/File/File.chs 1439 +-- +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/File.chs 1445 - -> IO Bool -- ^ returns 'True' if the attributes were set correctly, 'False' otherwise. [_$_] + -> IO () hunk ./gio/System/GIO/File/File.chs 1447 - liftM toBool $ - withGObject (toFileInfo fileInfo) $ \cFileInfo -> - propagateGError ({# call g_file_set_attributes_finish #} (toFile file) asyncResult cFileInfo) + withForeignPtr (unFileInfo fileInfo) $ \cFileInfo -> + propagateGError (\gErrorPtr -> do + {# call g_file_set_attributes_finish #} [_$_] + (toFile file) [_$_] + asyncResult [_$_] + cFileInfo + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1467 - -> IO Bool -- ^ returns 'True' if the attribute was successfully set, 'False' otherwise. [_$_] + -> IO () hunk ./gio/System/GIO/File/File.chs 1469 - liftM toBool $ - withGObject (toFile file) $ \cFile -> hunk ./gio/System/GIO/File/File.chs 1470 - withUTFString value $ \ valuePtr -> [_$_] - maybeWith withGObject cancellable $ \cCancellable -> do - propagateGError (g_file_set_attribute_string [_$_] - cFile [_$_] - attributePtr - valuePtr - ((fromIntegral . fromFlags) flags) [_$_] - cCancellable) - where _ = {# call g_file_set_attribute_string #} + withUTFString value $ \ valuePtr -> do + propagateGError (\gErrorPtr -> do + {#call g_file_set_attribute_string #} [_$_] + (toFile file) + attributePtr + valuePtr + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1492 - -> IO Bool -- ^ returns 'True' if the attribute was successfully set, 'False' otherwise. [_$_] + -> IO () hunk ./gio/System/GIO/File/File.chs 1494 - liftM toBool $ - withGObject (toFile file) $ \cFile -> hunk ./gio/System/GIO/File/File.chs 1495 - withCString value $ \ valuePtr -> [_$_] - maybeWith withGObject cancellable $ \cCancellable -> do - propagateGError (g_file_set_attribute_byte_string [_$_] - cFile [_$_] - attributePtr - valuePtr - ((fromIntegral . fromFlags) flags) [_$_] - cCancellable) - where _ = {# call g_file_set_attribute_byte_string #} + withCString value $ \ valuePtr -> do + propagateGError (\gErrorPtr -> do + {#call g_file_set_attribute_byte_string #} [_$_] + (toFile file) + attributePtr + valuePtr + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1517 - -> IO Bool -- ^ returns 'True' if the attribute was successfully set, 'False' otherwise. [_$_] + -> IO () hunk ./gio/System/GIO/File/File.chs 1519 - liftM toBool $ - withGObject (toFile file) $ \cFile -> hunk ./gio/System/GIO/File/File.chs 1520 - maybeWith withGObject cancellable $ \cCancellable -> do - propagateGError (g_file_set_attribute_uint32 [_$_] - cFile [_$_] - attributePtr - (fromIntegral value) - ((fromIntegral . fromFlags) flags) [_$_] - cCancellable) - where _ = {# call g_file_set_attribute_uint32 #} + propagateGError (\gErrorPtr -> do + {#call g_file_set_attribute_uint32 #} [_$_] + (toFile file) + attributePtr + (fromIntegral value) + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1541 - -> IO Bool -- ^ returns 'True' if the attribute was successfully set, 'False' otherwise. [_$_] + -> IO () hunk ./gio/System/GIO/File/File.chs 1543 - liftM toBool $ - withGObject (toFile file) $ \cFile -> hunk ./gio/System/GIO/File/File.chs 1544 - maybeWith withGObject cancellable $ \cCancellable -> do - propagateGError (g_file_set_attribute_int32 [_$_] - cFile [_$_] - attributePtr - (fromIntegral value) - ((fromIntegral . fromFlags) flags) [_$_] - cCancellable) - where _ = {# call g_file_set_attribute_int32 #} + propagateGError (\gErrorPtr -> do + {#call g_file_set_attribute_int32 #} [_$_] + (toFile file) + attributePtr + (fromIntegral value) + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1565 - -> IO Bool -- ^ returns 'True' if the attribute was successfully set, 'False' otherwise. [_$_] + -> IO () hunk ./gio/System/GIO/File/File.chs 1567 - liftM toBool $ - withGObject (toFile file) $ \cFile -> hunk ./gio/System/GIO/File/File.chs 1568 - maybeWith withGObject cancellable $ \cCancellable -> do - propagateGError (g_file_set_attribute_uint64 [_$_] - cFile [_$_] - attributePtr - (fromIntegral value) - ((fromIntegral . fromFlags) flags) [_$_] - cCancellable) - where _ = {# call g_file_set_attribute_uint64 #} + propagateGError (\gErrorPtr -> do + {#call g_file_set_attribute_uint64 #} [_$_] + (toFile file) + attributePtr + (fromIntegral value) + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1589 - -> IO Bool -- ^ returns 'True' if the attribute was successfully set, 'False' otherwise. [_$_] + -> IO () hunk ./gio/System/GIO/File/File.chs 1591 - liftM toBool $ - withGObject (toFile file) $ \cFile -> hunk ./gio/System/GIO/File/File.chs 1592 - maybeWith withGObject cancellable $ \cCancellable -> do - propagateGError (g_file_set_attribute_int64 [_$_] - cFile [_$_] - attributePtr - (fromIntegral value) - ((fromIntegral . fromFlags) flags) [_$_] - cCancellable) - where _ = {# call g_file_set_attribute_int64 #} + propagateGError (\gErrorPtr -> do + {#call g_file_set_attribute_int64 #} [_$_] + (toFile file) + attributePtr + (fromIntegral value) + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1613 - -> IO Bool -- ^ returns 'True' if the attributes were copied successfully, 'False' otherwise. + -> IO () hunk ./gio/System/GIO/File/File.chs 1615 - liftM toBool $ - withGObject (toFile source) $ \cSource -> - withGObject (toFile destination) $ \cDestination -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_copy_attributes cSource cDestination ((fromIntegral . fromFlags) flags) cCancellable) - where _ = {# call g_file_copy_attributes #} + propagateGError (\gErrorPtr -> do + {#call g_file_copy_attributes #} [_$_] + (toFile source) [_$_] + (toFile destination) [_$_] + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1637 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_monitor_directory cFile ((fromIntegral . fromFlags) flags) cCancellable) - where _ = {# call file_monitor_directory #} + propagateGError ({#call g_file_monitor_directory #} [_$_] + (toFile file) [_$_] + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + ) hunk ./gio/System/GIO/File/File.chs 1656 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_monitor_file cFile ((fromIntegral . fromFlags) flags) cCancellable) - where _ = {# call file_monitor_file #} + propagateGError ({#call g_file_monitor_file #} + (toFile file) [_$_] + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + ) hunk ./gio/System/GIO/File/File.chs 1675 - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> - propagateGError (g_file_monitor cFile ((fromIntegral . fromFlags) flags) cCancellable) - where _ = {# call file_monitor #} + propagateGError ({#call g_file_monitor #} [_$_] + (toFile file) [_$_] + ((fromIntegral . fromFlags) flags) [_$_] + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + ) hunk ./gio/System/GIO/File/File.chs 1697 -fileMountMountable file flags mountOperation cancellable callback = [_$_] - withGObject (toFile file) $ \cFile -> - maybeWith withGObject mountOperation $ \cMountOperation -> do - maybeWith withGObject cancellable $ \cCancellable -> do +fileMountMountable file flags mountOperation cancellable callback = do hunk ./gio/System/GIO/File/File.chs 1699 - g_file_mount_mountable cFile - ((fromIntegral . fromFlags) flags) - cMountOperation - cCancellable - cCallback - (castFunPtrToPtr cCallback) - where _ = {# call g_file_mount_mountable #} + {#call g_file_mount_mountable #} [_$_] + (toFile file) + ((fromIntegral . fromFlags) flags) + (fromMaybe (MountOperation nullForeignPtr) mountOperation) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] + cCallback + (castFunPtrToPtr cCallback) hunk ./gio/System/GIO/File/File.chs 1732 -fileUnmountMountableWithOperation file flags mountOperation cancellable callback = [_$_] - withGObject (toFile file) $ \cFile -> - maybeWith withGObject mountOperation $ \cMountOperation -> do - maybeWith withGObject cancellable $ \cCancellable -> do +fileUnmountMountableWithOperation file flags mountOperation cancellable callback = do hunk ./gio/System/GIO/File/File.chs 1734 - g_file_unmount_mountable_with_operation [_$_] - cFile + {#call g_file_unmount_mountable_with_operation #} [_$_] + (toFile file) hunk ./gio/System/GIO/File/File.chs 1737 - cMountOperation - cCancellable + (fromMaybe (MountOperation nullForeignPtr) mountOperation) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 1741 - where _ = {# call g_file_unmount_mountable_with_operation #} hunk ./gio/System/GIO/File/File.chs 1746 +-- +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/File.chs 1750 - -> IO Bool -- ^ returns 'True', 'False' if operation failed. [_$_] + -> IO () hunk ./gio/System/GIO/File/File.chs 1752 - liftM toBool $ - propagateGError ({#call g_file_unmount_mountable_with_operation_finish#} (toFile file) result) + propagateGError (\gErrorPtr -> do + {#call g_file_unmount_mountable_with_operation_finish#} [_$_] + (toFile file) [_$_] + result + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1772 -fileEjectMountableWithOperation file flags mountOperation cancellable callback = [_$_] - withGObject (toFile file) $ \cFile -> - maybeWith withGObject mountOperation $ \cMountOperation -> do - maybeWith withGObject cancellable $ \cCancellable -> do +fileEjectMountableWithOperation file flags mountOperation cancellable callback = do hunk ./gio/System/GIO/File/File.chs 1774 - g_file_eject_mountable_with_operation - cFile + {#call g_file_eject_mountable_with_operation #} + (toFile file) hunk ./gio/System/GIO/File/File.chs 1777 - cMountOperation - cCancellable + (fromMaybe (MountOperation nullForeignPtr) mountOperation) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 1781 - where _ = {# call g_file_eject_mountable_with_operation #} hunk ./gio/System/GIO/File/File.chs 1783 +-- +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/File.chs 1787 - -> IO Bool -- ^ returns 'True', 'False' if operation failed. [_$_] + -> IO () hunk ./gio/System/GIO/File/File.chs 1789 - liftM toBool $ - propagateGError ({#call g_file_eject_mountable_with_operation_finish#} (toFile file) result) + propagateGError (\gErrorPtr -> do + {#call g_file_eject_mountable_with_operation_finish#} [_$_] + (toFile file) [_$_] + result + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1812 -fileStartMountable file flags mountOperation cancellable callback = - withGObject (toFile file) $ \cFile -> - maybeWith withGObject mountOperation $ \cMountOperation -> do - maybeWith withGObject cancellable $ \cCancellable -> do +fileStartMountable file flags mountOperation cancellable callback = do hunk ./gio/System/GIO/File/File.chs 1814 - g_file_start_mountable [_$_] - cFile + {#call g_file_start_mountable #} [_$_] + (toFile file) hunk ./gio/System/GIO/File/File.chs 1817 - cMountOperation - cCancellable + (fromMaybe (MountOperation nullForeignPtr) mountOperation) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 1821 - where _ = {# call g_file_start_mountable #} hunk ./gio/System/GIO/File/File.chs 1825 +-- +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/File.chs 1830 - -> IO Bool -- ^ returns 'True' if the file was successfully ejected. 'False' otherwise. [_$_] + -> IO () hunk ./gio/System/GIO/File/File.chs 1832 - liftM toBool $ - propagateGError ({#call g_file_start_mountable_finish #} (toFile file) result) + propagateGError (\gErrorPtr -> do + {#call g_file_start_mountable_finish #} [_$_] + (toFile file) [_$_] + result + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1854 -fileStopMountable file flags mountOperation cancellable callback = - withGObject (toFile file) $ \cFile -> - maybeWith withGObject mountOperation $ \cMountOperation -> do - maybeWith withGObject cancellable $ \cCancellable -> do +fileStopMountable file flags mountOperation cancellable callback = do hunk ./gio/System/GIO/File/File.chs 1856 - g_file_stop_mountable [_$_] - cFile + {#call g_file_stop_mountable #} [_$_] + (toFile file) hunk ./gio/System/GIO/File/File.chs 1859 - cMountOperation - cCancellable + (fromMaybe (MountOperation nullForeignPtr) mountOperation) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 1863 - where _ = {# call g_file_stop_mountable #} hunk ./gio/System/GIO/File/File.chs 1867 +-- +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/File.chs 1872 - -> IO Bool -- ^ returns 'True' if the file was successfully ejected. 'False' otherwise. [_$_] + -> IO () hunk ./gio/System/GIO/File/File.chs 1874 - liftM toBool $ - propagateGError ({#call g_file_stop_mountable_finish #} (toFile file) result) + propagateGError (\gErrorPtr -> do + {#call g_file_stop_mountable_finish #} [_$_] + (toFile file) [_$_] + result + gErrorPtr + return ()) hunk ./gio/System/GIO/File/File.chs 1893 -filePollMountable file cancellable callback = [_$_] - withGObject (toFile file) $ \cFile -> - maybeWith withGObject cancellable $ \cCancellable -> do +filePollMountable file cancellable callback = do hunk ./gio/System/GIO/File/File.chs 1895 - g_file_poll_mountable [_$_] - cFile - cCancellable + {#call g_file_poll_mountable #} [_$_] + (toFile file) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 1900 - where _ = {# call g_file_poll_mountable #} hunk ./gio/System/GIO/File/File.chs 1927 -fileMountEnclosingVolume file flags mountOperation cancellable callback = [_$_] - withGObject (toFile file) $ \cFile -> - maybeWith withGObject mountOperation $ \cMountOperation -> do - maybeWith withGObject cancellable $ \cCancellable -> do +fileMountEnclosingVolume file flags mountOperation cancellable callback = do hunk ./gio/System/GIO/File/File.chs 1929 - g_file_mount_enclosing_volume [_$_] - cFile + {#call g_file_mount_enclosing_volume #} [_$_] + (toFile file) hunk ./gio/System/GIO/File/File.chs 1932 - cMountOperation - cCancellable + (fromMaybe (MountOperation nullForeignPtr) mountOperation) + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/File/File.chs 1936 - where _ = {# call g_file_mount_enclosing_volume #} } |
From: Andy S. <And...@co...> - 2010-08-30 07:14:16
|
diffing dir... Mon Aug 30 03:04:25 EDT 2010 Andy Stewart <laz...@gm...> * Fix GError functions in AppInfo.chs Ignore-this: 64920d4262f106176dea790ca7f01326 { hunk ./gio/System/GIO/File/AppInfo.chs 101 +import Data.Maybe (fromMaybe) hunk ./gio/System/GIO/File/AppInfo.chs 109 -{#import System.GIO.Base#} hunk ./gio/System/GIO/File/AppInfo.chs 122 - propagateGError (g_app_info_create_from_commandline [_$_] + propagateGError ({#call g_app_info_create_from_commandline #} hunk ./gio/System/GIO/File/AppInfo.chs 125 - ((fromIntegral . fromFlags) flags) - ) [_$_] - where _ = {# call g_app_info_create_from_commandline #} + ((fromIntegral . fromFlags) flags)) [_$_] hunk ./gio/System/GIO/File/AppInfo.chs 197 - -> IO Icon -- ^ returns the default 'Icon' for appinfo. [_$_] + -> IO (Maybe Icon) -- ^ returns the default 'Icon' for appinfo or 'Nothing' hunk ./gio/System/GIO/File/AppInfo.chs 199 - makeNewGObject mkIcon $ + maybeNull (makeNewGObject mkIcon) $ hunk ./gio/System/GIO/File/AppInfo.chs 203 --- @launchContext@ to get information about the details of the launcher (like what screen it is on). On --- error, error will be set accordingly. +-- @launchContext@ to get information about the details of the launcher (like what screen it is on). [_$_] +-- Throws a 'GError' if an error occurs hunk ./gio/System/GIO/File/AppInfo.chs 217 - -> IO Bool + -> IO () hunk ./gio/System/GIO/File/AppInfo.chs 219 - liftM toBool $ - withGObject (toAppInfo appinfo) $ \cAppinfo -> hunk ./gio/System/GIO/File/AppInfo.chs 221 - maybeWith withGObject launchContext $ \cLaunchContext -> - propagateGError (g_app_info_launch cAppinfo filesPtr cLaunchContext) [_$_] - where _ = {# call g_app_info_launch #} + propagateGError (\gErrorPtr -> do + {#call g_app_info_launch#} [_$_] + (toAppInfo appinfo) [_$_] + filesPtr [_$_] + (fromMaybe (AppLaunchContext nullForeignPtr) launchContext) + gErrorPtr [_$_] + return ()) [_$_] hunk ./gio/System/GIO/File/AppInfo.chs 244 --- @launchContext@ to get information about the details of the launcher (like what screen it is on). On --- error, error will be set accordingly. +-- @launchContext@ to get information about the details of the launcher (like what screen it is on). [_$_] +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/AppInfo.chs 254 - -> IO Bool -- ^ returns 'True' on successful launch, 'False' otherwise. [_$_] + -> IO () hunk ./gio/System/GIO/File/AppInfo.chs 256 - liftM toBool $ - withGObject (toAppInfo appinfo) $ \cAppinfo -> hunk ./gio/System/GIO/File/AppInfo.chs 257 - maybeWith withGObject launchContext $ \cLaunchContext -> - propagateGError (g_app_info_launch_uris cAppinfo (castPtr urisPtr) cLaunchContext) [_$_] - where _ = {# call g_app_info_launch_uris #} + propagateGError (\gErrorPtr -> do + {#call g_app_info_launch_uris#} [_$_] + (toAppInfo appinfo) + (castPtr urisPtr) [_$_] + (fromMaybe (AppLaunchContext nullForeignPtr) launchContext) + gErrorPtr + return ()) [_$_] hunk ./gio/System/GIO/File/AppInfo.chs 302 +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/AppInfo.chs 305 - -> IO Bool -- ^ returns 'True' on success, 'False' on error. [_$_] + -> IO () hunk ./gio/System/GIO/File/AppInfo.chs 307 - liftM toBool $ - withGObject (toAppInfo appinfo) $ \cAppinfo -> hunk ./gio/System/GIO/File/AppInfo.chs 308 - propagateGError (g_app_info_set_as_default_for_type [_$_] - cAppinfo - (castPtr contentTypePtr)) [_$_] - where _ = {# call g_app_info_set_as_default_for_type #} + propagateGError (\gErrorPtr -> do + {#call g_app_info_set_as_default_for_type#} [_$_] + (toAppInfo appinfo) + (castPtr contentTypePtr) + gErrorPtr + return ()) [_$_] hunk ./gio/System/GIO/File/AppInfo.chs 316 +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/AppInfo.chs 319 - -> IO Bool -- ^ returns 'True' on success, 'False' on error. [_$_] + -> IO () hunk ./gio/System/GIO/File/AppInfo.chs 321 - liftM toBool $ - withGObject (toAppInfo appinfo) $ \cAppinfo -> hunk ./gio/System/GIO/File/AppInfo.chs 322 - propagateGError (g_app_info_set_as_default_for_extension [_$_] - cAppinfo - (castPtr extensionPtr)) [_$_] - where _ = {# call g_app_info_set_as_default_for_extension #} + propagateGError (\gErrorPtr -> do + {#call g_app_info_set_as_default_for_extension #} + (toAppInfo appinfo) + (castPtr extensionPtr) + gErrorPtr + return ()) [_$_] hunk ./gio/System/GIO/File/AppInfo.chs 331 +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/AppInfo.chs 334 - -> IO Bool -- ^ returns 'True' on success, 'False' on error. [_$_] + -> IO () hunk ./gio/System/GIO/File/AppInfo.chs 336 - liftM toBool $ - withGObject (toAppInfo appinfo) $ \cAppinfo -> hunk ./gio/System/GIO/File/AppInfo.chs 337 - propagateGError (g_app_info_add_supports_type - cAppinfo - (castPtr extensionPtr)) [_$_] - where _ = {# call g_app_info_add_supports_type #} + propagateGError (\gErrorPtr -> do + {#call g_app_info_add_supports_type#} + (toAppInfo appinfo) + (castPtr extensionPtr) + gErrorPtr + return ()) [_$_] hunk ./gio/System/GIO/File/AppInfo.chs 352 +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/AppInfo.chs 355 - -> IO Bool -- ^ returns 'True' on success, 'False' on error. [_$_] + -> IO () hunk ./gio/System/GIO/File/AppInfo.chs 357 - liftM toBool $ - withGObject (toAppInfo appinfo) $ \cAppinfo -> hunk ./gio/System/GIO/File/AppInfo.chs 358 - propagateGError (g_app_info_remove_supports_type - cAppinfo - (castPtr extensionPtr)) [_$_] - where _ = {# call g_app_info_remove_supports_type #} + propagateGError (\gErrorPtr -> do + {#call g_app_info_remove_supports_type#} + (toAppInfo appinfo) + (castPtr extensionPtr) + gErrorPtr + return ()) [_$_] hunk ./gio/System/GIO/File/AppInfo.chs 413 +-- Throws a 'GError' if an error occurs. hunk ./gio/System/GIO/File/AppInfo.chs 417 - -> IO Bool -- ^ returns 'True' on success, 'False' on error. [_$_] + -> IO () hunk ./gio/System/GIO/File/AppInfo.chs 419 - liftM toBool $ hunk ./gio/System/GIO/File/AppInfo.chs 420 - withGObject launchContext $ \cLaunchContext -> - propagateGError (g_app_info_launch_default_for_uri - (castPtr uriPtr) - cLaunchContext) - where _ = {# call g_app_info_launch_default_for_uri #} + propagateGError (\gErrorPtr -> do + {#call g_app_info_launch_default_for_uri#} + (castPtr uriPtr) + launchContext + gErrorPtr + return ()) } |
From: Andy S. <And...@co...> - 2010-08-30 07:14:12
|
diffing dir... Mon Aug 30 03:03:08 EDT 2010 Andy Stewart <laz...@gm...> * Remove withGObject and Base.chs. (Don't need withGObject anymore) Ignore-this: 9a605c83179844f0db5201cf84f31594 { hunk ./gio/System/GIO/Base.chs 1 -{-# LANGUAGE CPP #-} --- GIMP Toolkit (GTK) Binding for Haskell: binding to gio -*-haskell-*- --- --- Author : Peter Gavin --- Created: 13-Oct-2008 --- --- Copyright (c) 2008 Peter Gavin --- --- 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.Base where - -import Control.Monad -import System.Glib.FFI -import System.Glib.Flags -import System.Glib.GObject -{#import System.GIO.Types#} - -withGObject :: GObjectClass objectT - => objectT - -> (Ptr objectT -> IO a) - -> IO a -withGObject object action = - let objectFPtr = unGObject $ toGObject object - in withForeignPtr (castForeignPtr objectFPtr) action - rmfile ./gio/System/GIO/Base.chs } |
From: Andy S. <And...@co...> - 2010-08-30 07:14:10
|
diffing dir... Mon Aug 30 03:01:28 EDT 2010 Andy Stewart <laz...@gm...> * Fix GError functions Ignore-this: 8b6da2b20a648be0751861498161b50f { hunk ./gio/System/GIO/Async/Cancellable.chs 54 +import Data.Maybe (fromMaybe) hunk ./gio/System/GIO/Async/Cancellable.chs 59 -{#import System.GIO.Base#} hunk ./gio/System/GIO/Async/Cancellable.chs 82 --- | If the cancellable is cancelled, sets the error to notify that the operation was cancelled. -cancellableThrowErrorIfCancelled :: Cancellable [_$_] - -> IO Bool -- ^ returns 'True' if cancellable was cancelled, 'False' if it was not. [_$_] +-- | If the cancellable is cancelled, throws a 'GError' to notify that the operation was cancelled. +cancellableThrowErrorIfCancelled :: Cancellable -> IO () hunk ./gio/System/GIO/Async/Cancellable.chs 85 - liftM toBool $ - propagateGError $ \gErrorPtr -> [_$_] + propagateGError $ \gErrorPtr -> do hunk ./gio/System/GIO/Async/Cancellable.chs 87 + return () hunk ./gio/System/GIO/Async/Cancellable.chs 99 - maybeWith withGObject cancellable g_cancellable_pop_current - where - _ = {# call cancellable_pop_current #} + {# call cancellable_pop_current #} + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] hunk ./gio/System/GIO/Async/Cancellable.chs 112 - maybeWith withGObject cancellable g_cancellable_push_current - where - _ = {# call cancellable_push_current #} + {# call cancellable_push_current #} + (fromMaybe (Cancellable nullForeignPtr) cancellable) [_$_] } |
From: Andy S. <And...@co...> - 2010-08-25 05:04:28
|
diffing dir... Wed Aug 25 01:01:49 EDT 2010 Andy Stewart <laz...@gm...> * Replace tab with space Ignore-this: 2b04b5086e708df42ff9b5c52da87b28 { hunk ./cairo/demo/Clock.hs 4 --- created: [_$_] +-- created: hunk ./cairo/demo/Clock.hs 38 - setLineJoin LineJoinRound [_$_] - drawHourMarks [_$_] - [_$_] + setLineJoin LineJoinRound + drawHourMarks + hunk ./cairo/demo/Clock.hs 54 - [_$_] + hunk ./cairo/demo/Clock.hs 61 - [_$_] + hunk ./cairo/demo/Clock.hs 65 - [_$_] + hunk ./cairo/demo/Clock.hs 82 - drawFrame quality [_$_] + drawFrame quality hunk ./cairo/demo/Clock.hs 84 - [_$_] + hunk ./cairo/demo/Clock.hs 130 - [_$_] + hunk ./cairo/demo/Clock.hs 139 - [_$_] + hunk ./cairo/demo/Clock.hs 156 - [_$_] + hunk ./cairo/demo/Clock.hs 165 - [_$_] + hunk ./cairo/demo/Clock.hs 279 - [_$_] + hunk ./cairo/demo/Clock.hs 303 - [_$_] + hunk ./cairo/demo/Clock.hs 309 - [_$_] + hunk ./cairo/demo/Clock.hs 327 - let clear = do [_$_] + let clear = do hunk ./cairo/demo/Clock.hs 340 - [_$_] + hunk ./cairo/demo/Clock.hs 351 - [_$_] + hunk ./cairo/demo/Clock.hs 359 - [_$_] + hunk ./cairo/demo/Clock.hs 362 - [_$_] + hunk ./cairo/demo/Clock.hs 370 - [_$_] + hunk ./cairo/demo/Drawing.hs 45 - [_$_] + hunk ./cairo/demo/Drawing.hs 52 - [_$_] + hunk ./cairo/demo/StarAndRing.hs 75 - [_$_] + hunk ./gio/demo/FileManager.hs 22 - fIcon :: Pixbuf, -- icon [_$_] + fIcon :: Pixbuf, -- icon hunk ./gio/demo/FileManager.hs 34 - [_$_] + hunk ./gio/demo/FileManager.hs 55 - let [_$_] + let hunk ./gio/demo/FileManager.hs 79 - [_$_] + hunk ./gio/demo/FileManager.hs 116 - [ cellText := formatFileSizeForDisplay size [_$_] + [ cellText := formatFileSizeForDisplay size hunk ./gio/demo/FileManager.hs 152 - [_$_] + hunk ./gio/demo/FileManager.hs 173 - ,gTimeValUSec = microseconds} = [_$_] + ,gTimeValUSec = microseconds} = hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 253 - a1==a2 && b1==b2 && (c1 .&. mask) == (c2 .&. mask) + a1==a2 && b1==b2 && (c1 .&. mask) == (c2 .&. mask) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 255 - a1==a2 && (b1 .&. mask) == (b2 .&. mask) + a1==a2 && (b1 .&. mask) == (b2 .&. mask) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 257 - (a1 .&. mask) == (a2 .&. mask) + (a1 .&. mask) == (a2 .&. mask) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 273 - takeWhile (/=0) $ - foldr calcTreeDepth (repeat 0) f + takeWhile (/=0) $ + foldr calcTreeDepth (repeat 0) f hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 287 - if idx==0 then [] else fromIntegral (idx-1) : gP (pos+d) ds + if idx==0 then [] else fromIntegral (idx-1) : gP (pos+d) ds hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 307 -type Cache a = [(TreeIter, Forest a)] [_$_] +type Cache a = [(TreeIter, Forest a)] hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 332 -advanceCache depth goal cache@((rootIter,_):_) = [_$_] +advanceCache depth goal cache@((rootIter,_):_) = hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 351 - diff = fromIntegral (goalIdx-curIdx) - (dropped, remain) = splitAt diff forest - advance = length dropped - ti' = setBitSlice ti pos d (curIdx+fromIntegral advance) - in - if advance==diff then moveToChild (pos+d) ds ((ti',remain):parents) - else (ti',remain):parents -- node not found + diff = fromIntegral (goalIdx-curIdx) + (dropped, remain) = splitAt diff forest + advance = length dropped + ti' = setBitSlice ti pos d (curIdx+fromIntegral advance) + in + if advance==diff then moveToChild (pos+d) ds ((ti',remain):parents) + else (ti',remain):parents -- node not found hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 360 - (d':_) -> dropWhile (isNonZero (pos+d) d') cache + (d':_) -> dropWhile (isNonZero (pos+d) d') cache hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 373 - childIdx :: Int - childIdx = fromIntegral (getBitSlice goal pos d)-1 - (dropped, remain) = splitAt childIdx children - advanced = length dropped - ti' = setBitSlice ti pos d (fromIntegral advanced+1) - in if advanced<childIdx then ((ti',remain):cache) else [_$_] - moveToChild (pos+d) ds ((ti',remain):cache) + childIdx :: Int + childIdx = fromIntegral (getBitSlice goal pos d)-1 + (dropped, remain) = splitAt childIdx children + advanced = length dropped + ti' = setBitSlice ti pos d (fromIntegral advanced+1) + in if advanced<childIdx then ((ti',remain):cache) else + moveToChild (pos+d) ds ((ti',remain):cache) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 382 --- [_$_] +-- hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 425 - (Maybe TreeIter, Cache a) + (Maybe TreeIter, Cache a) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 526 - Maybe (Forest a, Int, Bool) + Maybe (Forest a, Int, Bool) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 534 - subForest = for}:next) -> + subForest = for}:next) -> hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 538 - subForest = for }:next, - pos, toggle) -[_^I_][_^I_][_^I_][_^I_][_^I_] [_$_] + subForest = for }:next, + pos, toggle) + hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 558 - content = storeToCache newForest }, (True, toggle)) + content = storeToCache newForest }, (True, toggle)) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 563 - Just iter = fromPath depth parent + Just iter = fromPath depth parent hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 591 - subForest = for}:next) -> + subForest = for}:next) -> hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 595 - Just (for,toggle) -> Just (prev++Node {rootLabel = val, - subForest = for }:next, toggle) + Just (for,toggle) -> Just (prev++Node {rootLabel = val, + subForest = for }:next, toggle) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 624 - store@Store { depth = d, content = cache } <- [_$_] + store@Store { depth = d, content = cache } <- hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 631 - content = storeToCache newForest }, True) + content = storeToCache newForest }, True) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 647 - subForest = for}:next) -> + subForest = for}:next) -> hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 651 - subForest = for }:next)) + subForest = for }:next)) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 656 - Just for -> return $ Just (prev++Node { rootLabel = val, - subForest = for }:next) + Just for -> return $ Just (prev++Node { rootLabel = val, + subForest = for }:next) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 670 - store@Store { depth = d, content = cache } <- [_$_] + store@Store { depth = d, content = cache } <- hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeStore.hs 686 - store@Store { depth = d, content = cache } <- [_$_] + store@Store { depth = d, content = cache } <- hunk ./gtk/demo/actionMenu/ActionMenu.hs 48 - (Just "Clear the spreadsheet area.") - (Just stockNew) + (Just "Clear the spreadsheet area.") + (Just stockNew) hunk ./gtk/demo/actionMenu/ActionMenu.hs 52 - (Just "Open an existing spreadsheet.") - (Just stockOpen) + (Just "Open an existing spreadsheet.") + (Just stockOpen) hunk ./gtk/demo/actionMenu/ActionMenu.hs 56 - (Just "Save the current spreadsheet.") - (Just stockSave) + (Just "Save the current spreadsheet.") + (Just stockSave) hunk ./gtk/demo/actionMenu/ActionMenu.hs 60 - (Just "Save spreadsheet under new name.") - (Just stockSaveAs) + (Just "Save spreadsheet under new name.") + (Just stockSaveAs) hunk ./gtk/demo/actionMenu/ActionMenu.hs 64 - (Just "Exit this application.") - (Just stockSaveAs) - exitAct `onActionActivate` mainQuit [_$_] + (Just "Exit this application.") + (Just stockSaveAs) + exitAct `onActionActivate` mainQuit hunk ./gtk/demo/actionMenu/ActionMenu.hs 68 - (Just "Cut out the current selection.") - (Just stockCut) + (Just "Cut out the current selection.") + (Just stockCut) hunk ./gtk/demo/actionMenu/ActionMenu.hs 72 - (Just "Copy the current selection.") - (Just stockCopy) + (Just "Copy the current selection.") + (Just stockCopy) hunk ./gtk/demo/actionMenu/ActionMenu.hs 76 - (Just "Paste the current selection.") - (Just stockPaste) + (Just "Paste the current selection.") + (Just stockPaste) hunk ./gtk/demo/actionMenu/ActionMenu.hs 79 - [_$_] + hunk ./gtk/demo/actionMenu/ActionMenu.hs 84 - [_$_] + hunk ./gtk/demo/actionMenu/ActionMenu.hs 94 - [_$_] - edit <- textViewNew [_$_] + + edit <- textViewNew hunk ./gtk/demo/buttonbox/ButtonBox.hs 19 - [_$_] + hunk ./gtk/demo/buttonbox/ButtonBox.hs 31 - [_$_] + hunk ./gtk/demo/buttonbox/ButtonBox.hs 40 - , buttonBoxChildSecondary button3 := True ] + , buttonBoxChildSecondary button3 := True ] hunk ./gtk/demo/buttonbox/ButtonBox.hs 49 - hunk ./gtk/demo/carsim/CarSim.hs 187 - [_$_] + hunk ./gtk/demo/carsim/CarSim.hs 206 - [_$_] + hunk ./gtk/demo/carsim/CarSim.hs 239 - [_$_] + hunk ./gtk/demo/embedded/Embedded.hs 3 --- Click button for hang to simulate plug hanging process, [_$_] --- but socket process still running, can switch to other tab. [_$_] +-- Click button for hang to simulate plug hanging process, +-- but socket process still running, can switch to other tab. hunk ./gtk/demo/embedded/Embedded.hs 30 - _ -> socketMain [_$_] - [_$_] + _ -> socketMain + hunk ./gtk/demo/embedded/Embedded.hs 33 -socketMain :: IO () [_$_] +socketMain :: IO () hunk ./gtk/demo/embedded/Embedded.hs 51 - liftIO $ [_$_] + liftIO $ hunk ./gtk/demo/embedded/Embedded.hs 60 - -- Fork process to add GtkPlug into GtkSocekt. [_$_] + -- Fork process to add GtkPlug into GtkSocekt. hunk ./gtk/demo/embedded/Embedded.hs 62 - runCommand $ path ++ " " ++ (show $ fromNativeWindowId id) -- don't use `forkProcess` [_$_] + runCommand $ path ++ " " ++ (show $ fromNativeWindowId id) -- don't use `forkProcess` hunk ./gtk/demo/embedded/Embedded.hs 77 - [_$_] + hunk ./gtk/demo/embedded/Embedded.hs 83 - [_$_] + hunk ./gtk/demo/embedded/Embedded.hs 85 - [_$_] + hunk ./gtk/demo/embedded/MPlayer.hs 16 -import System.Environment [_$_] +import System.Environment hunk ./gtk/demo/embedded/MPlayer.hs 25 - [_$_] + hunk ./gtk/demo/embedded/MPlayer.hs 29 - [_$_] - mplayer <- mplayerNew [_$_] - mplayerStick mplayer (toContainer mainWindow) [_$_] - [_$_] - mainWindow `afterShow` do [_$_] + + mplayer <- mplayerNew + mplayerStick mplayer (toContainer mainWindow) + + mainWindow `afterShow` do hunk ./gtk/demo/embedded/MPlayer.hs 35 - [_$_] + hunk ./gtk/demo/embedded/MPlayer.hs 39 - [_$_] + hunk ./gtk/demo/embedded/MPlayer.hs 41 - [_$_] + hunk ./gtk/demo/embedded/MPlayer.hs 43 - [_$_] + hunk ./gtk/demo/embedded/MPlayer.hs 50 - [_$_] + hunk ./gtk/demo/embedded/MPlayer.hs 60 - [_$_] + hunk ./gtk/demo/embedded/MPlayer.hs 68 - [_$_] + hunk ./gtk/demo/embedded/Uzbl.hs 2 --- Just simple model demo for view, haven't handle event or else. [_$_] +-- Just simple model demo for view, haven't handle event or else. hunk ./gtk/demo/embedded/Uzbl.hs 5 --- [_$_] --- How to use: [_$_] +-- +-- How to use: hunk ./gtk/demo/embedded/Uzbl.hs 14 -import System.Environment [_$_] +import System.Environment hunk ./gtk/demo/embedded/Uzbl.hs 20 - [_$_] + hunk ./gtk/demo/embedded/Uzbl.hs 32 - [_$_] + hunk ./gtk/demo/fastdraw/FastDraw.hs 12 -import Data.Array.Base ( unsafeWrite ) [_$_] +import Data.Array.Base ( unsafeWrite ) hunk ./gtk/demo/fastdraw/FastDraw.hs 30 - ", bits per sample: "++show bits) + ", bits per sample: "++show bits) hunk ./gtk/demo/fastdraw/FastDraw.hs 41 - dirRef <- newIORef True [_$_] + dirRef <- newIORef True hunk ./gtk/demo/fastdraw/FastDraw.hs 44 - --print blue - doFromTo 0 255 $ \y -> + --print blue + doFromTo 0 255 $ \y -> hunk ./gtk/demo/fastdraw/FastDraw.hs 47 - -- Here, writeArray was replaced with unsafeWrite. The latter does - -- not check that the index is within bounds which has a tremendous - -- effect on performance. + -- Here, writeArray was replaced with unsafeWrite. The latter does + -- not check that the index is within bounds which has a tremendous + -- effect on performance. hunk ./gtk/demo/fastdraw/FastDraw.hs 55 - widgetQueueDraw canvas + widgetQueueDraw canvas hunk ./gtk/demo/fastdraw/FastDraw.hs 59 - let diff = 4 - let blue' = if dir then blue+diff else blue-diff - if dir then - if blue<=maxBound-diff then writeIORef blueRef blue' else - writeIORef blueRef maxBound >> modifyIORef dirRef not [_$_] - else - if blue>=minBound+diff then writeIORef blueRef blue' else - writeIORef blueRef minBound >> modifyIORef dirRef not [_$_] - return True [_$_] - [_$_] + let diff = 4 + let blue' = if dir then blue+diff else blue-diff + if dir then + if blue<=maxBound-diff then writeIORef blueRef blue' else + writeIORef blueRef maxBound >> modifyIORef dirRef not + else + if blue>=minBound+diff then writeIORef blueRef blue' else + writeIORef blueRef minBound >> modifyIORef dirRef not + return True + hunk ./gtk/demo/fastdraw/FastDraw.hs 91 - [_$_] + hunk ./gtk/demo/filechooser/FileChooserDemo.hs 20 - [_$_] + hunk ./gtk/demo/filechooser/FileChooserDemo.hs 51 - ++ "to select an existing folder") --dialog title + ++ "to select an existing folder") --dialog title hunk ./gtk/demo/filechooser/FileChooserDemo.hs 53 - FileChooserActionSelectFolder --the kind of dialog we want - [("Yes, this new dialog looks nice" --The buttons to display - , ResponseAccept) - ,("Eugh! Take me away!" - ,ResponseCancel)] + FileChooserActionSelectFolder --the kind of dialog we want + [("Yes, this new dialog looks nice" --The buttons to display + , ResponseAccept) + ,("Eugh! Take me away!" + ,ResponseCancel)] hunk ./gtk/demo/filechooser/FileChooserDemo.hs 60 - case response of [_$_] + case response of hunk ./gtk/demo/filechooser/FileChooserDemo.hs 71 - ++ "a new folder (or existing) folder") --dialog title + ++ "a new folder (or existing) folder") --dialog title hunk ./gtk/demo/filechooser/FileChooserDemo.hs 73 - FileChooserActionCreateFolder --the kind of dialog we want - [("I want this new folder" --The buttons to display - , ResponseAccept) - ,("Bored now." - ,ResponseCancel)] + FileChooserActionCreateFolder --the kind of dialog we want + [("I want this new folder" --The buttons to display + , ResponseAccept) + ,("Bored now." + ,ResponseCancel)] hunk ./gtk/demo/filechooser/FileChooserDemo.hs 80 - case response of [_$_] + case response of hunk ./gtk/demo/filechooser/FileChooserDemo.hs 91 - ++ "an existing file") --dialog title + ++ "an existing file") --dialog title hunk ./gtk/demo/filechooser/FileChooserDemo.hs 93 - FileChooserActionOpen --the kind of dialog we want - [("gtk-cancel" --The buttons to display - ,ResponseCancel) - ,("gtk-open" [_$_] - , ResponseAccept)] + FileChooserActionOpen --the kind of dialog we want + [("gtk-cancel" --The buttons to display + ,ResponseCancel) + ,("gtk-open" + , ResponseAccept)] hunk ./gtk/demo/filechooser/FileChooserDemo.hs 101 - case response of [_$_] + case response of hunk ./gtk/demo/filechooser/FileChooserDemo.hs 112 - ++ "a new file") --dialog title + ++ "a new file") --dialog title hunk ./gtk/demo/filechooser/FileChooserDemo.hs 114 - FileChooserActionSave --the kind of dialog we want - [("gtk-cancel" --The buttons to display - ,ResponseCancel) --you can use stock buttons - ,("gtk-save" - , ResponseAccept)] + FileChooserActionSave --the kind of dialog we want + [("gtk-cancel" --The buttons to display + ,ResponseCancel) --you can use stock buttons + ,("gtk-save" + , ResponseAccept)] hunk ./gtk/demo/filechooser/FileChooserDemo.hs 121 - case response of [_$_] + case response of hunk ./gtk/demo/filechooser/FileChooserDemo.hs 132 - ++ "a new file - with a preview widget") --dialog title + ++ "a new file - with a preview widget") --dialog title hunk ./gtk/demo/filechooser/FileChooserDemo.hs 134 - FileChooserActionOpen --the kind of dialog we want - [("_Yes, yes that's very clever" --The buttons to display - , ResponseAccept) - ,("_No, I'm not impressed" - ,ResponseCancel)] + FileChooserActionOpen --the kind of dialog we want + [("_Yes, yes that's very clever" --The buttons to display + , ResponseAccept) + ,("_No, I'm not impressed" + ,ResponseCancel)] hunk ./gtk/demo/filechooser/FileChooserDemo.hs 143 - [_$_] + hunk ./gtk/demo/filechooser/FileChooserDemo.hs 157 - case response of [_$_] + case response of hunk ./gtk/demo/filechooser/FileChooserDemo.hs 160 - [_$_] + hunk ./gtk/demo/filechooser/FileChooserDemo.hs 169 - hunk ./gtk/demo/fonts/Fonts.hs 15 - showSize (Just sz) = concat (intersperse ", " (map show sz))++ - " points" + showSize (Just sz) = concat (intersperse ", " (map show sz))++ + " points" hunk ./gtk/demo/fonts/Fonts.hs 20 - hunk ./gtk/demo/graphic/Drawing.hs 42 - drawLayoutWithColors win gc 30 (height `div` 2) text [_$_] + drawLayoutWithColors win gc 30 (height `div` 2) text hunk ./gtk/demo/graphic/Drawing.hs 46 - [_$_] hunk ./gtk/demo/gtkbuilder/GtkBuilderTest.hs 6 - initGUI -[_^I_][_$_] - -- Create the builder, and load the UI file - builder <- builderNew - builderAddFromFile builder "simple.ui" -[_^I_][_$_] - -- Retrieve some objects from the UI - window <- builderGetObject builder castToWindow "window1" - button <- builderGetObject builder castToButton "button1" -[_^I_][_$_] - -- Basic user interation - button `onClicked` putStrLn "button pressed!" - window `onDestroy` mainQuit -[_^I_][_$_] - -- Display the window - widgetShowAll window - mainGUI + initGUI + + -- Create the builder, and load the UI file + builder <- builderNew + builderAddFromFile builder "simple.ui" + + -- Retrieve some objects from the UI + window <- builderGetObject builder castToWindow "window1" + button <- builderGetObject builder castToButton "button1" + + -- Basic user interation + button `onClicked` putStrLn "button pressed!" + window `onDestroy` mainQuit + + -- Display the window + widgetShowAll window + mainGUI hunk ./gtk/demo/inputmethod/Layout.hs 46 - [_$_] + hunk ./gtk/demo/inputmethod/Layout.hs 54 - [_$_] + hunk ./gtk/demo/inputmethod/Layout.hs 59 - [_$_] + hunk ./gtk/demo/inputmethod/Layout.hs 65 - [_$_] + hunk ./gtk/demo/inputmethod/Layout.hs 78 - [_$_] + hunk ./gtk/demo/inputmethod/Layout.hs 80 - [_$_] + hunk ./gtk/demo/inputmethod/Layout.hs 84 - [_$_] + hunk ./gtk/demo/inputmethod/Layout.hs 87 - [_$_] + hunk ./gtk/demo/inputmethod/Layout.hs 90 - [_$_] + hunk ./gtk/demo/inputmethod/Layout.hs 110 - [_$_] + hunk ./gtk/demo/inputmethod/Layout.hs 123 - [_$_] + hunk ./gtk/demo/menu/ComboDemo.hs 14 - onDestroy win mainQuit [_$_] + onDestroy win mainQuit hunk ./gtk/demo/menu/ComboDemo.hs 22 - [_$_] + hunk ./gtk/demo/menu/ComboDemo.hs 26 - [_$_] + hunk ./gtk/demo/menu/ComboDemo.hs 41 - [_$_] + hunk ./gtk/demo/menu/ComboDemo.hs 43 - mainGUI [_$_] + mainGUI hunk ./gtk/demo/statusicon/StatusIcon.hs 12 - I.onPopupMenu icon $ \b a -> do [_$_] + I.onPopupMenu icon $ \b a -> do hunk ./gtk/demo/statusicon/StatusIcon.hs 20 -mkmenu s = do [_$_] +mkmenu s = do hunk ./gtk/demo/statusicon/StatusIcon.hs 24 - ,("Quit",mainQuit)] [_$_] + ,("Quit",mainQuit)] hunk ./gtk/demo/statusicon/StatusIcon.hs 27 - mkitem menu (label,act) = [_$_] + mkitem menu (label,act) = hunk ./gtk/demo/treeList/Completion.hs 15 -invertColor (Color r g b) = Color (32767+r) (32767+g) (32767+b) [_$_] +invertColor (Color r g b) = Color (32767+r) (32767+g) (32767+b) hunk ./gtk/demo/treeList/Completion.hs 39 - [_$_] + hunk ./gtk/demo/treeList/Completion.hs 82 - hunk ./gtk/demo/treeList/DirList.hs 40 - , fSize = s - , fTime = t } + , fSize = s + , fTime = t } hunk ./gtk/demo/treeList/FilterDemo.hs 17 - [_$_] + hunk ./gtk/demo/treeList/FilterDemo.hs 20 - [_$_] + hunk ./gtk/demo/treeList/FilterDemo.hs 57 - [_$_] - [_$_] - [_$_] + + + hunk ./gtk/demo/treeList/FilterDemo.hs 68 - [_$_] + hunk ./gtk/demo/treeList/ListDND.hs 26 - name :: String, - addr :: (Int, Int, Int, Int), - roomStore :: ListStore String, - roomSel :: Int, + name :: String, + addr :: (Int, Int, Int, Int), + roomStore :: ListStore String, + roomSel :: Int, hunk ./gtk/demo/treeList/ListDND.hs 57 - "tower.png","server.png","desktop.png"] + "tower.png","server.png","desktop.png"] hunk ./gtk/demo/treeList/ListDND.hs 61 -[_^I_][_$_] + hunk ./gtk/demo/treeList/ListDND.hs 71 - [_$_] + hunk ./gtk/demo/treeList/ListDND.hs 81 - content <- listStoreNewDND [_$_] + content <- listStoreNewDND hunk ./gtk/demo/treeList/ListDND.hs 83 - roomStore = genRoomStore t, roomSel = 0, cType = t}) - [minBound :: CompType .. maxBound]) + roomStore = genRoomStore t, roomSel = 0, cType = t}) + [minBound :: CompType .. maxBound]) hunk ./gtk/demo/treeList/ListDND.hs 126 - [_$_] + hunk ./gtk/demo/treeList/ListDND.hs 132 - iconViewColumns := 6] [_$_] + iconViewColumns := 6] hunk ./gtk/demo/treeList/ListDND.hs 179 - cellTextWidthChars := 0]) [dot1, dot2, dot3] + cellTextWidthChars := 0]) [dot1, dot2, dot3] hunk ./gtk/demo/treeList/ListDND.hs 181 - cellTextWidthChars := 3]) [oct1, oct2, oct3, oct4] + cellTextWidthChars := 3]) [oct1, oct2, oct3, oct4] hunk ./gtk/demo/treeList/ListDND.hs 189 - (\Computer { addr = (_,_,_,o4)} -> [cellText := show o4]) [_$_] + (\Computer { addr = (_,_,_,o4)} -> [cellText := show o4]) hunk ./gtk/demo/treeList/ListDND.hs 218 - [_$_] + hunk ./gtk/demo/treeList/ListDND.hs 224 - [_$_] + hunk ./gtk/demo/treeList/ListDND.hs 233 - [_$_] + hunk ./gtk/demo/treeList/ListDND.hs 238 - [_$_] + hunk ./gtk/demo/treeList/ListDND.hs 248 - mainGUI [_$_] + mainGUI hunk ./gtk/demo/treeList/ListDemo.hs 22 - [_$_] + hunk ./gtk/demo/treeList/ListDemo.hs 63 - [_$_] + hunk ./gtk/demo/treeList/ListDemo.hs 66 - mainGUI [_$_] + mainGUI hunk ./gtk/demo/treeList/ListTest.hs 12 - [_$_] + hunk ./gtk/demo/treeList/ListTest.hs 60 - [_$_] + hunk ./gtk/demo/treeList/ListTest.hs 66 - [_$_] + hunk ./gtk/demo/treeList/ListTest.hs 71 - mainGUI [_$_] + mainGUI hunk ./gtk/demo/treeList/ListText.hs 36 - treeViewColumnReorderable := True ] + treeViewColumnReorderable := True ] hunk ./gtk/demo/treeList/ListText.hs 42 - treeViewColumnReorderable := True ] + treeViewColumnReorderable := True ] hunk ./gtk/demo/treeList/ListText.hs 48 - [_$_] + hunk ./gtk/demo/treeList/ListText.hs 53 - treeViewColumnReorderable := True ] + treeViewColumnReorderable := True ] hunk ./gtk/demo/treeList/ListText.hs 59 - cellToggleInconsistent := rowCase row==Nothing] + cellToggleInconsistent := rowCase row==Nothing] hunk ./gtk/demo/treeList/ListText.hs 78 - hunk ./gtk/demo/treeList/TreeDemo.hs 35 - New.cellLayoutPackStart col1 renderer1 True [_$_] + New.cellLayoutPackStart col1 renderer1 True hunk ./gtk/demo/treeList/TreeDemo.hs 44 - New.treeViewAppendColumn view col2 [_$_] + New.treeViewAppendColumn view col2 hunk ./gtk/demo/treeList/TreeDemo.hs 46 - [_$_] + hunk ./gtk/demo/treeList/TreeDemo.hs 49 - mainGUI [_$_] + mainGUI hunk ./gtk/demo/treeList/TreeSort.hs 9 - rawmodel <- New.treeStoreNew [_$_] + rawmodel <- New.treeStoreNew hunk ./gtk/demo/treeList/TreeSort.hs 16 - [_$_] + hunk ./gtk/demo/treeList/TreeSort.hs 78 - -- Put it all together. [_$_] + -- Put it all together. hunk ./gtk/demo/treeList/TreeTest.hs 14 - [_$_] + hunk ./gtk/demo/treeList/TreeTest.hs 57 - [_$_] + hunk ./gtk/demo/treeList/TreeTest.hs 68 - mainGUI [_$_] + mainGUI hunk ./gtk/demo/treeList/TreeTest.hs 86 - New.cellLayoutPackStart col1 renderer1 True [_$_] + New.cellLayoutPackStart col1 renderer1 True hunk ./gtk/demo/treeList/TreeTest.hs 95 - New.treeViewAppendColumn view col2 [_$_] + New.treeViewAppendColumn view col2 hunk ./gtk/demo/unicode/Arabic.hs 14 - theText <- labelNew Nothing [_$_] + theText <- labelNew Nothing hunk ./gtk/demo/unicode/Arabic.hs 29 - markSpan [FontForeground "red"] [_$_] + markSpan [FontForeground "red"] hunk ./pango/demo/Layout.hs 24 - [_$_] + hunk ./pango/demo/Layout.hs 30 - [_$_] + hunk ./pango/demo/Layout.hs 37 - [_$_] + hunk ./pango/demo/Layout.hs 51 - [_$_] } |
From: Andy S. <And...@co...> - 2010-08-20 07:53:24
|
diffing dir... Fri Aug 20 03:48:37 EDT 2010 Andy Stewart <laz...@gm...> * Remove g_list_free from FileEnumerator.chs (fromGList is enough) Ignore-this: 31d7621be0486119502a2dd58a421e3b hunk ./gio/System/GIO/File/FileEnumerator.chs 152 - {# call unsafe g_list_free #} glistPtr |
From: Andy S. <And...@co...> - 2010-08-20 07:53:19
|
diffing dir... Sun Aug 15 14:22:46 EDT 2010 Andy Stewart <laz...@gm...> * Add new module System.GIO.File.FileEnumerator Ignore-this: 611db116b306692524bc3150d98069d6 { hunk ./gio/System/GIO.hs 36 + module System.GIO.File.FileEnumerator, hunk ./gio/System/GIO.hs 45 +import System.GIO.File.FileEnumerator addfile ./gio/System/GIO/File/FileEnumerator.chs hunk ./gio/System/GIO/File/FileEnumerator.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.FileEnumerator ( +-- * Details +-- +-- | 'FileEnumerator' allows you to operate on a set of 'File's, returning a 'FileInfo' structure for each +-- file enumerated (e.g. 'fileEnumerateChildren' will return a 'FileEnumerator' for each of the +-- children within a directory). +-- [_$_] +-- To get the next file's information from a 'FileEnumerator', use 'fileEnumeratorNextFile' or its +-- asynchronous version, 'fileEnumeratorNextFilesAsync'. Note that the asynchronous version will +-- return a list of 'FileInfo', whereas the synchronous will only return the next file in the +-- enumerator. +-- [_$_] +-- To close a 'FileEnumerator', use 'fileEnumeratorClose', or its asynchronous version, +-- 'fileEnumeratorCloseAsync'. [_$_] +-- +-- * Types + FileEnumerator (..), + FileEnumeratorClass, + +-- * Methods + fileEnumeratorNextFile, + fileEnumeratorClose, + fileEnumeratorNextFilesAsync, + fileEnumeratorNextFilesFinish, + fileEnumeratorCloseAsync, + fileEnumeratorCloseFinish, + fileEnumeratorIsClosed, + fileEnumeratorHasPending, + fileEnumeratorSetPending, +#if GLIB_CHECK_VERSION(2,18,0) + fileEnumeratorGetContainer, +#endif + ) 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.Async.AsyncResult#} +{#import System.GIO.Base#} +{#import System.GIO.Types#} + +{# context lib = "gio" prefix = "g" #} + +-- | Returns information for the next file in the enumerated object. Will block until the information is +-- available. The 'FileInfo' returned from this function will contain attributes that match the +-- attribute string that was passed when the 'FileEnumerator' was created. +-- [_$_] +-- On error, returns 'Nothing' and sets error to the error. If the enumerator is at the end, 'Nothing' will be +-- returned and error will be unset. +fileEnumeratorNextFile :: FileEnumeratorClass enumerator => enumerator + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. + -> IO (Maybe FileInfo) -- ^ returns A 'FileInfo' or 'Nothing' on error or end of enumerator. [_$_] +fileEnumeratorNextFile enumerator cancellable = + maybeNull (makeNewGObject mkFileInfo) $ + withGObject (toFileEnumerator enumerator) $ \cEnumerator -> + maybeWith withGObject cancellable $ \cCancellable -> + propagateGError $ \gErrorPtr -> [_$_] + g_file_enumerator_next_file cEnumerator cCancellable gErrorPtr + where _ = {# call g_file_enumerator_next_file #} + +-- | Releases all resources used by this enumerator, making the enumerator return GIoErrorClosed on +-- all calls. +-- [_$_] +-- This will be automatically called when the last reference is dropped, but you might want to call +-- this function to make sure resources are released as early as possible. +fileEnumeratorClose :: FileEnumeratorClass enumerator => enumerator + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> IO Bool -- ^ returns 'True' on success or 'False' on error. [_$_] +fileEnumeratorClose enumerator cancellable = + liftM toBool $ + withGObject (toFileEnumerator enumerator) $ \cEnumerator -> + maybeWith withGObject cancellable $ \cCancellable -> + propagateGError $ \gErrorPtr -> [_$_] + g_file_enumerator_close cEnumerator cCancellable gErrorPtr + where _ = {# call g_file_enumerator_close #} + +-- | Request information for a number of files from the enumerator asynchronously. When all i/o for the +-- operation is finished the callback will be called with the requested information. +-- [_$_] +-- The callback can be called with less than @numFiles@ files in case of error or at the end of the +-- enumerator. In case of a partial error the callback will be called with any succeeding items and no +-- error, and on the next request the error will be reported. If a request is cancelled the callback +-- will be called with 'IoErrorCancelled'. +-- [_$_] +-- During an async request no other sync and async calls are allowed, and will result in +-- 'IoErrorPending' errors. +-- [_$_] +-- Any outstanding i/o request with higher priority (lower numerical value) will be executed before an +-- outstanding request with lower priority. Default priority is GPriorityDefault. +fileEnumeratorNextFilesAsync :: FileEnumeratorClass enumerator + => enumerator + -> Int -- ^ @numFiles@ the number of file info objects to request [_$_] + -> Int -- ^ @ioPriority@ the io priority of the request. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> AsyncReadyCallback -- ^ @callback@ a 'AsyncReadyCallback' to call when the request is satisfied [_$_] + -> IO () +fileEnumeratorNextFilesAsync enumerator numFiles ioPriority cancellable callback = + withGObject (toFileEnumerator enumerator) $ \cEnumerator -> + maybeWith withGObject cancellable $ \cCancellable -> do + cCallback <- marshalAsyncReadyCallback callback + g_file_enumerator_next_files_async [_$_] + cEnumerator + (fromIntegral numFiles) + (fromIntegral ioPriority) + cCancellable + cCallback + (castFunPtrToPtr cCallback) + where _ = {# call g_file_enumerator_next_files_async #} + [_$_] +-- | Finishes the asynchronous operation started with 'fileEnumeratorNextFilesAsync'. +fileEnumeratorNextFilesFinish :: FileEnumeratorClass enumerator => enumerator + -> AsyncResult + -> IO [FileInfo] +fileEnumeratorNextFilesFinish enumerator asyncResult = [_$_] + propagateGError ({# call g_file_enumerator_next_files_finish #} (toFileEnumerator enumerator) asyncResult) [_$_] + >>= \glistPtr -> do + infoPtrs <- fromGList glistPtr + {# call unsafe g_list_free #} glistPtr + mapM (makeNewGObject mkFileInfo . return) infoPtrs + [_$_] +-- | Asynchronously closes the file enumerator. +-- [_$_] +-- If cancellable is not 'Nothing', then the operation can be cancelled by triggering the cancellable object +-- from another thread. If the operation was cancelled, the error 'IoErrorCancelled' will be returned +-- in 'fileEnumeratorCloseFinish'. +fileEnumeratorCloseAsync :: FileEnumeratorClass enumerator + => enumerator + -> Int -- ^ @ioPriority@ the I/O priority of the request. [_$_] + -> Maybe Cancellable -- ^ @cancellable@ optional 'Cancellable' object, 'Nothing' to ignore. [_$_] + -> AsyncReadyCallback -- ^ @callback@ a 'AsyncReadyCallback' to call when the request is satisfied [_$_] + -> IO () +fileEnumeratorCloseAsync enumerator ioPriority mbCancellable callback = + withGObject (toFileEnumerator enumerator) $ \cEnumerator -> + maybeWith withGObject mbCancellable $ \cCancellable -> do + cCallback <- marshalAsyncReadyCallback callback + g_file_enumerator_close_async [_$_] + cEnumerator + (fromIntegral ioPriority) + cCancellable + cCallback + (castFunPtrToPtr cCallback) + where _ = {# call g_file_enumerator_close_async #} + +-- | Finishes closing a file enumerator, started from 'fileEnumeratorCloseAsync'. +-- [_$_] +-- If the file enumerator was already closed when 'fileEnumeratorCloseAsync' was called, then this +-- function will report GIoErrorClosed in error, and return 'False'. If the file enumerator had +-- pending operation when the close operation was started, then this function will report +-- 'IoErrorPending', and return 'False'. If cancellable was not 'Nothing', then the operation may have been +-- cancelled by triggering the cancellable object from another thread. If the operation was cancelled, +-- the error 'IoErrorCancelled' will be set, and 'False' will be returned. +fileEnumeratorCloseFinish :: FileEnumeratorClass enumerator => enumerator + -> AsyncResult + -> IO Bool -- ^ returns 'True' if the close operation has finished successfully. [_$_] +fileEnumeratorCloseFinish enumerator asyncResult = [_$_] + liftM toBool $ + propagateGError ({# call g_file_enumerator_close_finish #} (toFileEnumerator enumerator) asyncResult) [_$_] + +-- | Checks if the file enumerator has been closed. +fileEnumeratorIsClosed :: FileEnumeratorClass enumerator => enumerator + -> IO Bool -- ^ returns 'True' if the enumerator is closed. [_$_] +fileEnumeratorIsClosed enumerator = + liftM toBool $ + {#call g_file_enumerator_is_closed#} (toFileEnumerator enumerator) + +-- | Checks if the file enumerator has pending operations. +fileEnumeratorHasPending :: FileEnumeratorClass enumerator => enumerator + -> IO Bool -- ^ returns 'True' if the enumerator has pending operations. [_$_] +fileEnumeratorHasPending enumerator = + liftM toBool $ + {#call g_file_enumerator_has_pending#} (toFileEnumerator enumerator) + +-- | Sets the file enumerator as having pending operations. +fileEnumeratorSetPending :: FileEnumeratorClass enumerator => enumerator + -> Bool + -> IO () +fileEnumeratorSetPending enumerator pending = + {#call g_file_enumerator_set_pending#} (toFileEnumerator enumerator) (fromBool pending) + +#if GLIB_CHECK_VERSION(2,18,0) +-- | Get the 'File' container which is being enumerated. +fileEnumeratorGetContainer :: FileEnumeratorClass enumerator => enumerator + -> IO File +fileEnumeratorGetContainer enumerator = + makeNewGObject mkFile $ + {#call g_file_enumerator_get_container#} (toFileEnumerator enumerator) +#endif hunk ./gio/gio.cabal 60 + System.GIO.File.FileEnumerator } |