From: Duncan C. <dun...@us...> - 2005-02-25 01:12:07
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24163/gtk/Graphics/UI/Gtk/Selectors Modified Files: ColorSelection.chs ColorSelectionDialog.chs FileChooser.chs.pp FileChooserDialog.chs.pp FileChooserWidget.chs.pp FontSelection.chs FontSelectionDialog.chs Log Message: Add more module level documentation and tidy up exiting documentation. Also add/modify section headers. Also LGPL'ify remaining modules with permission from Matthew Walton. Index: FontSelection.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FontSelection.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FontSelection.chs 12 Feb 2005 17:19:25 -0000 1.2 +++ FontSelection.chs 25 Feb 2005 01:11:37 -0000 1.3 @@ -27,7 +27,42 @@ -- A widget for selecting fonts. -- module Graphics.UI.Gtk.Selectors.FontSelection ( +-- * Description +-- +-- | The 'FontSelection' widget lists the available fonts, styles and sizes, +-- allowing the user to select a font. It is used in the 'FontSelectionDialog' +-- widget to provide a dialog box for selecting fonts. +-- +-- To set the font which is initially selected, use +-- 'fontSelectionSetFontName'. +-- +-- To get the selected font use 'fontSelectionGetFont' or +-- 'fontSelectionGetFontName'. +-- +-- To change the text which is shown in the preview area, use +-- 'fontSelectionSetPreviewText'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Box' +-- | +----'VBox' +-- | +----FontSelection +-- @ + +-- * Types + FontSelection, + FontSelectionClass, + castToFontSelection, + +-- * Constructors fontSelectionNew, + +-- * Methods fontSelectionGetFontName, fontSelectionSetFontName, fontSelectionGetPreviewText, @@ -44,6 +79,8 @@ {# context lib="gtk" prefix="gtk" #} +-------------------- +-- Constructors -- | Creates a new 'FontSelection'. -- @@ -52,6 +89,9 @@ makeNewObject mkFontSelection $ liftM castPtr $ {#call unsafe font_selection_new#} +-------------------- +-- Methods + -- | Gets the currently-selected font name. Returns Nothing if no font is -- selected. -- Index: FontSelectionDialog.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FontSelectionDialog.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FontSelectionDialog.chs 12 Feb 2005 17:19:25 -0000 1.2 +++ FontSelectionDialog.chs 25 Feb 2005 01:11:37 -0000 1.3 @@ -27,7 +27,41 @@ -- A dialog box for selecting fonts. -- module Graphics.UI.Gtk.Selectors.FontSelectionDialog ( +-- * Description +-- +-- | The 'FontSelectionDialog' widget is a dialog box for selecting a font. +-- +-- To set the font which is initially selected, use +-- 'fontSelectionDialogSetFontName'. +-- +-- To get the selected font use 'fontSelectionDialogGetFont' or +-- 'fontSelectionDialogGetFontName'. +-- +-- To change the text which is shown in the preview area, use +-- 'fontSelectionDialogSetPreviewText'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'Window' +-- | +----'Dialog' +-- | +----FontSelectionDialog +-- @ + +-- * Types + FontSelectionDialog, + FontSelectionDialogClass, + castToFontSelectionDialog, + +-- * Constructors fontSelectionDialogNew, + +-- * Methods fontSelectionDialogGetFontName, fontSelectionDialogSetFontName, fontSelectionDialogGetPreviewText, @@ -44,6 +78,8 @@ {# context lib="gtk" prefix="gtk" #} +-------------------- +-- Constructors -- | Creates a new 'FontSelectionDialog'. -- @@ -53,6 +89,9 @@ withUTFString title $ \strPtr -> {#call unsafe font_selection_dialog_new#} strPtr +-------------------- +-- Methods + -- | Gets the currently-selected font name. Returns Nothing if no font is -- selected. -- Index: FileChooserDialog.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileChooserDialog.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FileChooserDialog.chs.pp 12 Feb 2005 17:19:25 -0000 1.2 +++ FileChooserDialog.chs.pp 25 Feb 2005 01:11:37 -0000 1.3 @@ -32,14 +32,51 @@ -- -- * Added in GTK+ 2.4 -- -module Graphics.UI.Gtk.Selectors.FileChooserDialog ( +module Graphics.UI.Gtk.Selectors.FileChooserDialog ( +-- * Description +-- +-- | 'FileChooserDialog' is a dialog box suitable for use with \"File\/Open\" +-- or \"File\/Save as\" commands. This widget works by putting a +-- 'FileChooserWidget' inside a 'Dialog'. It exposes the 'FileChooser', +-- interface, so you can use all of the +-- 'FileChooser' functions on the file chooser dialog as well as those for +-- 'Dialog'. +-- +-- Note that 'FileChooserDialog' does not have any methods of its own. +-- Instead, you should use the functions that work on a 'FileChooser'. +-- +-- * Module available since Gtk version 2.4 + +-- ** Response Codes +-- +-- | 'FileChooserDialog' inherits from 'Dialog', so buttons that go in its +-- action area have response codes such as 'ResponseAccept' and +-- 'ResponseCancel'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'Window' +-- | +----'Dialog' +-- | +----FileChooserDialog +-- @ + #if GTK_CHECK_VERSION(2,4,0) - FileChooserDialogClass, +-- * Types FileChooserDialog, + FileChooserDialogClass, + castToFileChooserDialog, + + -- * Constructors fileChooserDialogNew, fileChooserDialogNewWithBackend #endif -) where + ) where #if GTK_CHECK_VERSION(2,4,0) Index: ColorSelectionDialog.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/ColorSelectionDialog.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ColorSelectionDialog.chs 12 Feb 2005 17:19:25 -0000 1.2 +++ ColorSelectionDialog.chs 25 Feb 2005 01:11:37 -0000 1.3 @@ -24,7 +24,34 @@ -- Stability : provisional -- Portability : portable (depends on GHC) -- +-- A standard dialog box for selecting a color. +-- module Graphics.UI.Gtk.Selectors.ColorSelectionDialog ( +-- * Description +-- +-- | The 'ColorSelectionDialog' provides a standard dialog which allows the +-- user to select a color much like the 'FileSelection' provides a standard +-- dialog for file selection. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Bin' +-- | +----'Window' +-- | +----'Dialog' +-- | +----ColorSelectionDialog +-- @ + +-- * Types + ColorSelectionDialog, + ColorSelectionDialogClass, + castToColorSelectionDialog, + +-- * Constructors colorSelectionDialogNew, ) where @@ -38,6 +65,8 @@ {# context lib="gtk" prefix="gtk" #} +-------------------- +-- Constructors -- | Creates a new 'ColorSelectionDialog'. -- Index: ColorSelection.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/ColorSelection.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ColorSelection.chs 12 Feb 2005 17:19:25 -0000 1.2 +++ ColorSelection.chs 25 Feb 2005 01:11:37 -0000 1.3 @@ -30,7 +30,34 @@ -- standard color selection dialog box "ColorSelectionDialog". -- module Graphics.UI.Gtk.Selectors.ColorSelection ( +-- * Description +-- +-- | The 'ColorSelection' is a widget that is used to select a color. It +-- consists of a color wheel and number of sliders and entry boxes for color +-- parameters such as hue, saturation, value, red, green, blue, and opacity. It +-- is found on the standard color selection dialog box 'ColorSelectionDialog'. + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Box' +-- | +----'VBox' +-- | +----ColorSelection +-- @ + +-- * Types + ColorSelection, + ColorSelectionClass, + castToColorSelection, + +-- * Constructors colorSelectionNew, + +-- * Methods colorSelectionGetCurrentAlpha, colorSelectionSetCurrentAlpha, colorSelectionGetCurrentColor, @@ -56,6 +83,8 @@ {# context lib="gtk" prefix="gtk" #} +-------------------- +-- Constructors -- | Creates a new ColorSelection widget. -- @@ -64,6 +93,9 @@ makeNewObject mkColorSelection $ liftM castPtr $ {#call unsafe color_selection_new#} +-------------------- +-- Methods + -- | Returns the current alpha value. -- -- * The alpha value is represented by an integer between 0 and 65535. Index: FileChooser.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileChooser.chs.pp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- FileChooser.chs.pp 13 Feb 2005 16:25:57 -0000 1.3 +++ FileChooser.chs.pp 25 Feb 2005 01:11:37 -0000 1.4 @@ -35,10 +35,102 @@ -- * Added in GTK+ 2.4 -- module Graphics.UI.Gtk.Selectors.FileChooser ( +-- * Description +-- +-- | 'FileChooser' is an interface that can be implemented by file selection +-- widgets. In Gtk+, the main objects that implement this interface are +-- 'FileChooserWidget' and 'FileChooserDialog'. You do not need to write an +-- object that implements the 'FileChooser' interface unless you are trying to +-- adapt an existing file selector to expose a standard programming interface. + +-- ** File Names and Encodings +-- +-- | When the user is finished selecting files in a 'FileChooser', your +-- program can get the selected names either as filenames or as URIs. For URIs, +-- the normal escaping rules are applied if the URI contains non-ASCII +-- characters. However, filenames are /always/ returned in the character set +-- specified by the G_FILENAME_ENCODING environment variable. Please see the +-- Glib documentation for more details about this variable. + +-- ** Adding a Preview Widget +-- +-- | You can add a custom preview widget to a file chooser and then get +-- notification about when the preview needs to be updated. To install a +-- preview widget, use 'fileChooserSetPreviewWidget'. Then, connect to the +-- updatePreview signal to get notified when you need to update +-- the contents of the preview. +-- +-- Your callback should use 'fileChooserGetPreviewFilename' to see what +-- needs previewing. Once you have generated the preview for the corresponding +-- file, you must call 'fileChooserSetPreviewWidgetActive' with a boolean flag +-- that indicates whether your callback could successfully generate a preview. + +-- ** Adding Extra Widgets +-- +-- | You can add extra widgets to a file chooser to provide options that are +-- not present in the default design. For example, you can add a toggle button +-- to give the user the option to open a file in read-only mode. You can use +-- 'fileChooserSetExtraWidget' to insert additional widgets in a file chooser. + +-- ** Key Bindings +-- +-- | Internally, Gtk+ implements a file chooser's graphical user interface +-- with the private GtkFileChooserDefaultClass. This widget has several key +-- bindings and their associated signals. This section describes the available +-- key binding signals. +-- +-- * GtkFileChooser key binding example +-- +-- The default keys that activate the key-binding signals in +-- GtkFileChooserDefaultClass are as follows: +-- +-- [Signal name] Key +-- +-- [location-popup] Control-L +-- +-- [up-folder] Alt-Up +-- +-- [down-folder] Alt-Down +-- +-- [home-folder] Alt-Home +-- +-- To change these defaults to something else, you could include the +-- following fragment in your .gtkrc-2.0 file: +-- +-- > binding "my-own-gtkfilechooser-bindings" { +-- > bind "AltShiftl" { +-- > "location-popup" () +-- > } +-- > bind "AltShiftUp" { +-- > "up-folder" () +-- > } +-- > bind "AltShiftDown" { +-- > "down-folder" () +-- > } +-- > bind "AltShiftHome" { +-- > "home-folder-folder" () +-- > } +-- > } +-- > +-- > class "GtkFileChooserDefault" binding "my-own-gtkfilechooser-bindings" +-- > +-- + +-- * Class Hierarchy +-- | +-- @ +-- | GInterface +-- | +----FileChooser +-- @ + #if GTK_CHECK_VERSION(2,4,0) - FileChooserClass, +-- * Types FileChooser, + FileChooserClass, + castToFileChooser, FileChooserAction(..), + +-- * Methods fileChooserSetAction, fileChooserGetAction, fileChooserSetLocalOnly, @@ -83,6 +175,8 @@ fileChooserAddShortcutFolderURI, fileChooserRemoveShortcutFolderURI, fileChooserListShortcutFolderURIs, + +-- * Signals onCurrentFolderChanged, afterCurrentFolderChanged, onFileActivated, @@ -92,7 +186,7 @@ onUpdatePreview, afterUpdatePreview #endif -) where + ) where #if GTK_CHECK_VERSION(2,4,0) @@ -111,6 +205,9 @@ {# enum FileChooserAction {underscoreToCase} #} {# enum FileChooserError {underscoreToCase} #} +-------------------- +-- Methods + fileChooserErrorDomain :: GErrorDomain fileChooserErrorDomain = unsafePerformIO {#call unsafe file_chooser_error_quark#} @@ -395,6 +492,9 @@ (toFileChooser chooser) fromStringGSList strList +-------------------- +-- Signals + onCurrentFolderChanged, afterCurrentFolderChanged :: FileChooserClass c => c -> IO () -> IO (ConnectId c) onCurrentFolderChanged = connect_NONE__NONE "current-folder-changed" False afterCurrentFolderChanged = connect_NONE__NONE "current-folder-changed" True Index: FileChooserWidget.chs.pp =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Graphics/UI/Gtk/Selectors/FileChooserWidget.chs.pp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FileChooserWidget.chs.pp 12 Feb 2005 17:19:25 -0000 1.2 +++ FileChooserWidget.chs.pp 25 Feb 2005 01:11:37 -0000 1.3 @@ -32,15 +32,44 @@ -- -- * Added in GTK+ 2.4 -- -module Graphics.UI.Gtk.Selectors.FileChooserWidget ( +module Graphics.UI.Gtk.Selectors.FileChooserWidget ( +-- * Description +-- +-- | 'FileChooserWidget' is a widget suitable for selecting files. It is the +-- main building block of a 'FileChooserDialog'. Most applications will only +-- need to use the latter; you can use 'FileChooserWidget' as part of a larger +-- window if you have special needs. +-- +-- Note that 'FileChooserWidget' does not have any methods of its own. +-- Instead, you should use the functions that work on a 'FileChooser'. +-- +-- * Module available since Gtk version 2.4 + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----'Container' +-- | +----'Box' +-- | +----'VBox' +-- | +----FileChooserWidget +-- @ + + #if GTK_CHECK_VERSION(2,4,0) - FileChooserWidgetClass, +-- * Types FileChooserWidget, + FileChooserWidgetClass, + castToFileChooserWidget, + +-- * Constructors FileChooserAction, fileChooserWidgetNew, fileChooserWidgetNewWithBackend, #endif -) where + ) where #if GTK_CHECK_VERSION(2,4,0) @@ -57,6 +86,9 @@ -- which we model in Haskell as another instance decleration instance FileChooserClass FileChooserWidget +-------------------- +-- Constructors + fileChooserWidgetNew :: FileChooserAction -> IO FileChooserWidget fileChooserWidgetNew action = makeNewObject mkFileChooserWidget $ liftM castPtr $ |