gtk 0.13.9 → 0.14.2
raw patch · 8 files changed
+197/−2 lines, 8 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Graphics.UI.Gtk.Selectors.FileChooserButton: fileChooserButtonFileSet :: FileChooserButtonClass self => Signal self (IO ())
Files
- Graphics/UI/Gtk.chs +2/−0
- Graphics/UI/Gtk/Abstract/Box.chs +84/−0
- Graphics/UI/Gtk/Entry/Entry.chs +50/−0
- Graphics/UI/Gtk/General/Enums.chs +13/−0
- Graphics/UI/Gtk/Selectors/FileChooserButton.chs +14/−0
- Graphics/UI/Gtk/Types.chs +29/−0
- SetupWrapper.hs +1/−1
- gtk.cabal +4/−1
Graphics/UI/Gtk.chs view
@@ -221,6 +221,7 @@ module Graphics.UI.Gtk.Layout.Layout, module Graphics.UI.Gtk.Layout.Notebook, #if GTK_MAJOR_VERSION >= 3+ module Graphics.UI.Gtk.Layout.Grid, module Graphics.UI.Gtk.Layout.Overlay, #endif module Graphics.UI.Gtk.Layout.Expander,@@ -486,6 +487,7 @@ import Graphics.UI.Gtk.Layout.Layout import Graphics.UI.Gtk.Layout.Notebook #if GTK_MAJOR_VERSION >= 3+import Graphics.UI.Gtk.Layout.Grid import Graphics.UI.Gtk.Layout.Overlay #endif import Graphics.UI.Gtk.Layout.Expander
Graphics/UI/Gtk/Abstract/Box.chs view
@@ -116,10 +116,24 @@ boxReorderChild, boxQueryChildPacking, boxSetChildPacking,+#if GTK_CHECK_VERSION(3,10,0)+ boxGetBaselinePosition,+ boxSetBaselinePosition,+#endif+#if GTK_CHECK_VERSION(3,12,0)+ boxGetCenterWidget,+ boxSetCenterWidget,+#endif -- * Attributes boxSpacing, boxHomogeneous,+#if GTK_CHECK_VERSION(3,10,0)+ boxBaselinePosition,+#endif+#if GTK_CHECK_VERSION(3,12,0)+ boxCenterWidget,+#endif -- * Child Attributes boxChildPacking,@@ -137,6 +151,13 @@ toPacking, fromPacking) import Graphics.UI.Gtk.Abstract.ContainerChildProperties +#if GTK_CHECK_VERSION(3,10,0)+import Graphics.UI.Gtk.General.Enums (BaselinePosition)+#endif+#if GTK_CHECK_VERSION(3,12,0)+import Graphics.UI.Gtk.Abstract.Object (makeNewObject)+#endif+ {# context lib="gtk" prefix="gtk" #} --------------------@@ -321,6 +342,51 @@ ((fromIntegral . fromEnum) packType) where (expand, fill) = fromPacking packing +#if GTK_CHECK_VERSION(3,10,0)+-- | Gets the value set by `boxSetBaselinePostion`+boxGetBaselinePosition :: BoxClass self => self+ -> IO BaselinePosition+boxGetBaselinePosition self =+ liftM (toEnum . fromIntegral) $+ {# call unsafe box_get_baseline_position #}+ (toBox self)++-- | Sets the baseline position of a box. This affects only+-- horizontal boxes with at least one baseline aligned child.+-- If there is more vertical space available than requested,+-- and the baseline is not allocated by the parent then+-- `position` is used to allocate the baseline wrt the extra+-- space available.+boxSetBaselinePosition :: BoxClass self => self+ -> BaselinePosition+ -> IO ()+boxSetBaselinePosition self position =+ {# call unsafe box_set_baseline_position #}+ (toBox self)+ (fromIntegral $ fromEnum position)+#endif++#if GTK_CHECK_VERSION(3,12,0)+-- | Retrieves the center widget of the box.+boxGetCenterWidget :: BoxClass self => self+ -> IO Widget+boxGetCenterWidget self =+ makeNewObject mkWidget $+ {# call unsafe box_get_center_widget #}+ (toBox self)++-- | Sets a center widget; that is a child widget that will be+-- centered with respect to the full width of the box, even if+-- the children at either side take up different amounts of space.+boxSetCenterWidget :: (BoxClass self, WidgetClass widget) => self+ -> widget+ -> IO ()+boxSetCenterWidget self position =+ {# call unsafe box_set_center_widget #}+ (toBox self)+ (toWidget position)+#endif+ -- | Retrieves the standard spacing between widgets. -- boxGetSpacing :: BoxClass self => self@@ -352,6 +418,24 @@ boxHomogeneous = newAttr boxGetHomogeneous boxSetHomogeneous++#if GTK_CHECK_VERSION(3,10,0)+-- | The position of the baseline aligned widgets if extra space is available.+boxBaselinePosition :: BoxClass self => Attr self BaselinePosition+boxBaselinePosition = newAttr+ boxGetBaselinePosition+ boxSetBaselinePosition+#endif++#if GTK_CHECK_VERSION(3,12,0)+-- | A child widget that will be centered with respect to the+-- full width of the box, even if the children at either side+-- take up different amounts of space.+boxCenterWidget :: (BoxClass self, WidgetClass widget) => ReadWriteAttr self Widget widget+boxCenterWidget = newAttr+ boxGetCenterWidget+ boxSetCenterWidget+#endif -------------------- -- Child Attributes
Graphics/UI/Gtk/Entry/Entry.chs view
@@ -77,6 +77,10 @@ entrySetHasFrame, entryGetWidthChars, entrySetWidthChars,+#if GTK_CHECK_VERSION(3,2,0)+ entrySetPlaceholderText,+ entryGetPlaceholderText,+#endif #if GTK_CHECK_VERSION(2,4,0) entrySetAlignment, entryGetAlignment,@@ -110,6 +114,9 @@ entryWidthChars, entryScrollOffset, entryText,+#if GTK_CHECK_VERSION(3,2,0)+ entryPlaceholderText,+#endif #if GTK_CHECK_VERSION(2,4,0) entryXalign, entryAlignment,@@ -430,6 +437,38 @@ (toEntry self) (fromIntegral nChars) +#if GTK_CHECK_VERSION(3,2,0)+-- | Sets text to be displayed in entry when it is empty and unfocused.+-- This can be used to give a visual hint of the expected contents of the `Entry`.+--+-- Note that since the placeholder text gets removed when the entry received+-- focus, using this feature is a bit problematic if the entry is given the+-- initial focus in a window. Sometimes this can be worked around by delaying+-- the initial focus setting until the first key event arrives.+--+-- * Available since Gtk version 3.2+--+entrySetPlaceholderText :: (EntryClass self, GlibString text) => self+ -> Maybe text -- ^ @text@ a string to be displayed when entry is empty an unfocused, or `Nothing`+ -> IO ()+entrySetPlaceholderText self text =+ maybeWith withUTFString text $ \ textPtr ->+ {# call entry_set_placeholder_text #}+ (toEntry self)+ textPtr++-- | Retrieves the text that will be displayed when entry is empty and unfocused.+--+-- * Available since Gtk version 3.2+--+entryGetPlaceholderText :: (EntryClass self, GlibString text) => self+ -> IO (Maybe text) -- ^ returns placeholder text+entryGetPlaceholderText self =+ {# call unsafe entry_get_placeholder_text #}+ (toEntry self)+ >>= maybePeek peekUTFString+#endif+ #if GTK_CHECK_VERSION(2,4,0) -- | Sets the alignment for the contents of the entry. This controls the -- horizontal positioning of the contents when the displayed text is shorter@@ -652,6 +691,17 @@ entryText = newAttr entryGetText entrySetText++#if GTK_CHECK_VERSION(3,2,0)+-- | The text that will be displayed in the `Entry` when it is empty and unfocused.+--+-- Default value: Nothing+--+entryPlaceholderText :: (EntryClass self, GlibString text) => Attr self (Maybe text)+entryPlaceholderText = newAttr+ entryGetPlaceholderText+ entrySetPlaceholderText+#endif #if GTK_CHECK_VERSION(2,4,0) -- | The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL
Graphics/UI/Gtk/General/Enums.chs view
@@ -32,6 +32,9 @@ #endif ArrowType(..), AttachOptions(..),+#if GTK_CHECK_VERSION(3,10,0)+ BaselinePosition(..),+#endif MouseButton(..), ButtonBoxStyle(..), CalendarDisplayOptions(..),@@ -139,6 +142,16 @@ {#enum AttachOptions {underscoreToCase} deriving(Bounded,Eq,Show)#} instance Flags AttachOptions++#if GTK_CHECK_VERSION(3,10,0)+-- | Whenever a container has some form of natural row it may align children in +-- that row along a common typographical baseline. If the amount of verical space+-- in the row is taller than the total requested height of the baseline-aligned+-- children then it can use a BaselinePosition to select where to put the+-- baseline inside the extra availible space.+--+{#enum BaselinePosition {underscoreToCase} deriving (Eq,Show)#}+#endif -- | Mouse buttons. --
Graphics/UI/Gtk/Selectors/FileChooserButton.chs view
@@ -75,6 +75,9 @@ fileChooserButtonDialog, fileChooserButtonTitle, fileChooserButtonWidthChars,++-- * Signals+ fileChooserButtonFileSet #endif ) where @@ -86,6 +89,7 @@ import System.Glib.Properties import Graphics.UI.Gtk.Abstract.Object (makeNewObject) {#import Graphics.UI.Gtk.Types#}+{#import Graphics.UI.Gtk.Signals#} #if GTK_CHECK_VERSION(2,6,0) {#import Graphics.UI.Gtk.Selectors.FileChooser#} (FileChooserAction)@@ -216,4 +220,14 @@ fileChooserButtonWidthChars = newAttr fileChooserButtonGetWidthChars fileChooserButtonSetWidthChars++--------------------+-- Signals++-- %hash c:b660 d:ab72+-- | Emitted when the user selects a file.+--+fileChooserButtonFileSet :: FileChooserButtonClass self => Signal self (IO ())+fileChooserButtonFileSet = Signal (connect_NONE__NONE "file-set")+ #endif
Graphics/UI/Gtk/Types.chs view
@@ -422,6 +422,10 @@ toStatusbar, mkStatusbar, unStatusbar, castToStatusbar, gTypeStatusbar,+ Grid(Grid), GridClass,+ toGrid, + mkGrid, unGrid,+ castToGrid, gTypeGrid, Fixed(Fixed), FixedClass, toFixed, mkFixed, unFixed,@@ -3209,6 +3213,31 @@ gTypeStatusbar :: GType gTypeStatusbar = {# call fun unsafe gtk_statusbar_get_type #}++-- *********************************************************************** Grid++{#pointer *GtkGrid as Grid foreign newtype #} deriving (Eq,Ord)++mkGrid = (Grid, objectUnrefFromMainloop)+unGrid (Grid o) = o++class ContainerClass o => GridClass o+toGrid :: GridClass o => o -> Grid+toGrid = unsafeCastGObject . toGObject++instance GridClass Grid+instance ContainerClass Grid+instance WidgetClass Grid+instance GObjectClass Grid where+ toGObject = GObject . castForeignPtr . unGrid+ unsafeCastGObject = Grid . castForeignPtr . unGObject++castToGrid :: GObjectClass obj => obj -> Grid+castToGrid = castTo gTypeGrid "Grid"++gTypeGrid :: GType+gTypeGrid =+ {# call fun unsafe gtk_grid_get_type #} -- ********************************************************************** Fixed
SetupWrapper.hs view
@@ -20,7 +20,7 @@ import System.Process import System.Exit (ExitCode(..), exitWith) import System.FilePath-import System.Directory+import System.Directory (doesFileExist, getModificationTime) import qualified Control.Exception as Exception import System.IO.Error (isDoesNotExistError)
gtk.cabal view
@@ -1,5 +1,5 @@ Name: gtk-Version: 0.13.9+Version: 0.14.2 License: LGPL-2.1 License-file: COPYING Copyright: (c) 2001-2010 The Gtk2Hs Team@@ -389,6 +389,9 @@ cpp-options: -DWIN32 -fno-exceptions cc-options: -fno-exceptions extra-libraries: kernel32++ if os(windows)+ cpp-options: -D__USE_MINGW_ANSI_STDIO=1 x-c2hs-Header: hsgtk.h x-Types-Hierarchy: hierarchy.list