gtk 0.12.5.6 → 0.12.5.7
raw patch · 6 files changed
+103/−7 lines, 6 filesdep ~glib
Dependency ranges changed: glib
Files
- Graphics/UI/Gtk.chs +6/−0
- Graphics/UI/Gtk/Abstract/Widget.chs +24/−0
- Graphics/UI/Gtk/Gdk/EventM.hsc +18/−5
- Graphics/UI/Gtk/Gdk/Pixbuf.chs +22/−0
- Graphics/UI/Gtk/Types.chs +31/−0
- gtk.cabal +2/−2
Graphics/UI/Gtk.chs view
@@ -217,6 +217,9 @@ module Graphics.UI.Gtk.Layout.HPaned, module Graphics.UI.Gtk.Layout.Layout, module Graphics.UI.Gtk.Layout.Notebook,+#if GTK_MAJOR_VERSION >= 3+ module Graphics.UI.Gtk.Layout.Overlay,+#endif module Graphics.UI.Gtk.Layout.Expander, module Graphics.UI.Gtk.Layout.Table, module Graphics.UI.Gtk.Layout.VBox,@@ -474,6 +477,9 @@ import Graphics.UI.Gtk.Layout.VPaned import Graphics.UI.Gtk.Layout.Layout import Graphics.UI.Gtk.Layout.Notebook+#if GTK_MAJOR_VERSION >= 3+import Graphics.UI.Gtk.Layout.Overlay+#endif import Graphics.UI.Gtk.Layout.Expander import Graphics.UI.Gtk.Layout.Table -- ornaments
Graphics/UI/Gtk/Abstract/Widget.chs view
@@ -248,7 +248,12 @@ widgetParent, widgetWidthRequest, widgetHeightRequest,+ widgetMarginLeft,+ widgetMarginRight,+ widgetMarginTop,+ widgetMarginBottom, widgetVisible,+ widgetOpacity, widgetSensitive, widgetAppPaintable, widgetCanFocus,@@ -2364,6 +2369,18 @@ widgetName :: WidgetClass self => Attr self (Maybe String) widgetName = newAttrFromMaybeStringProperty "name" +widgetMarginLeft :: WidgetClass self => Attr self Int+widgetMarginLeft = newAttrFromIntProperty "margin-left"++widgetMarginRight :: WidgetClass self => Attr self Int+widgetMarginRight = newAttrFromIntProperty "margin-right"++widgetMarginTop :: WidgetClass self => Attr self Int+widgetMarginTop = newAttrFromIntProperty "margin-top"++widgetMarginBottom :: WidgetClass self => Attr self Int+widgetMarginBottom = newAttrFromIntProperty "margin-bottom"+ -- %hash c:1533 d:3213 -- | The parent widget of this widget. Must be a Container widget. --@@ -2399,6 +2416,13 @@ -- widgetVisible :: WidgetClass self => Attr self Bool widgetVisible = newAttrFromBoolProperty "visible"++-- | The opacity of the widget+--+-- Default value: @1.0@+--+widgetOpacity :: WidgetClass self => Attr self Double+widgetOpacity = newAttrFromDoubleProperty "opacity" -- %hash c:4dd4 d:594e -- | Whether the widget responds to input.
Graphics/UI/Gtk/Gdk/EventM.hsc view
@@ -123,6 +123,7 @@ eventRootCoordinates, eventModifier, eventModifierAll,+ eventModifierMouse, eventTime, eventKeyVal, eventKeyName,@@ -359,23 +360,35 @@ -- | Query the modifier keys that were depressed when the event happened. -- Sticky modifiers such as CapsLock are omitted in the return value. -- Use 'eventModifierAll' your application requires all modifiers.+-- Use 'eventModifierMouse' if you just need the mouse buttons. -- eventModifier :: HasModifier t => EventM t [Modifier]-eventModifier = eM False+eventModifier = eM defModMask -- | Query the modifier keys that were depressed when the event happened. -- The result includes sticky modifiers such as CapsLock. Normally, -- 'eventModifier' is more appropriate in applications. -- eventModifierAll :: HasModifier t => EventM t [Modifier]-eventModifierAll = eM True+eventModifierAll = eM allModMask +-- | Query the mouse buttons that were depressed when the event happened.+--+eventModifierMouse :: HasModifier t => EventM t [Modifier]+eventModifierMouse = eM mouseModMask++allModMask = -1+ foreign import ccall safe "gtk_accelerator_get_default_mod_mask" defModMask :: #gtk2hs_type guint -eM allModifs = do- let mask | allModifs = -1- | otherwise = defModMask+mouseModMask = #{const GDK_BUTTON1_MASK}+ .|. #{const GDK_BUTTON2_MASK}+ .|. #{const GDK_BUTTON3_MASK}+ .|. #{const GDK_BUTTON4_MASK}+ .|. #{const GDK_BUTTON5_MASK}++eM mask = do ptr <- ask liftIO $ do (ty :: #{gtk2hs_type GdkEventType}) <- peek (castPtr ptr)
Graphics/UI/Gtk/Gdk/Pixbuf.chs view
@@ -77,6 +77,9 @@ #if GTK_CHECK_VERSION(2,6,0) pixbufNewFromFileAtScale, #endif+#if GTK_CHECK_VERSION(3,0,0)+ pixbufNewFromSurface,+#endif pixbufNewFromInline, InlineImage, pixbufNewSubpixbuf,@@ -133,6 +136,8 @@ #if GTK_MAJOR_VERSION < 3 import Graphics.UI.Gtk.Gdk.Pixmap (Bitmap, Pixmap) #endif+import Graphics.Rendering.Cairo+import Graphics.Rendering.Cairo.Types {# context prefix="gdk" #} @@ -345,6 +350,23 @@ (fromIntegral height) (fromBool preserveAspectRatio) errPtrPtr+#endif++#if GTK_CHECK_VERSION(3,0,0)+-- | Creates a new pixbuf from a cairo Surface.+--+-- Transfers image data from a cairo Surface and converts it to an RGB(A) representation inside a Pixbuf. This allows you to efficiently read individual pixels from cairo surfaces. For GdkWindows, use gdk_pixbuf_get_from_window() instead.+-- +-- This function will create an RGB pixbuf with 8 bits per channel. The pixbuf will contain an alpha channel if the surface contains one.+pixbufNewFromSurface :: Surface -> Int -> Int -> Int -> Int -> IO Pixbuf+pixbufNewFromSurface surface srcX srcY width height =+ withSurface surface $ \ss -> wrapNewGObject mkPixbuf $+ {# call gdk_pixbuf_get_from_surface #}+ (castPtr ss)+ (fromIntegral srcX)+ (fromIntegral srcY)+ (fromIntegral width)+ (fromIntegral height) #endif -- | A string representing an image file format.
Graphics/UI/Gtk/Types.chs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# OPTIONS_HADDOCK hide #-} -- -*-haskell-*- -- -------------------- automatically generated file - do not edit ----------@@ -276,6 +277,10 @@ toSeparatorMenuItem, mkSeparatorMenuItem, unSeparatorMenuItem, castToSeparatorMenuItem, gTypeSeparatorMenuItem,+ Overlay(Overlay), OverlayClass,+ toOverlay, + mkOverlay, unOverlay,+ castToOverlay, gTypeOverlay, Window(Window), WindowClass, toWindow, mkWindow, unWindow,@@ -2232,6 +2237,32 @@ gTypeSeparatorMenuItem :: GType gTypeSeparatorMenuItem = {# call fun unsafe gtk_separator_menu_item_get_type #}++-- ******************************************************************** Overlay++{#pointer *GtkOverlay as Overlay foreign newtype #} deriving (Eq,Ord)++mkOverlay = (Overlay, objectUnrefFromMainloop)+unOverlay (Overlay o) = o++class BinClass o => OverlayClass o+toOverlay :: OverlayClass o => o -> Overlay+toOverlay = unsafeCastGObject . toGObject++instance OverlayClass Overlay+instance BinClass Overlay+instance ContainerClass Overlay+instance WidgetClass Overlay+instance GObjectClass Overlay where+ toGObject = GObject . castForeignPtr . unOverlay+ unsafeCastGObject = Overlay . castForeignPtr . unGObject++castToOverlay :: GObjectClass obj => obj -> Overlay+castToOverlay = castTo gTypeOverlay "Overlay"++gTypeOverlay :: GType+gTypeOverlay =+ {# call fun unsafe gtk_overlay_get_type #} -- ********************************************************************* Window
gtk.cabal view
@@ -1,5 +1,5 @@ Name: gtk-Version: 0.12.5.6+Version: 0.12.5.7 License: LGPL-2.1 License-file: COPYING Copyright: (c) 2001-2010 The Gtk2Hs Team@@ -137,7 +137,7 @@ Library build-depends: base >= 4 && < 5, array, containers, mtl, bytestring,- glib >= 0.12.5.3 && < 0.13,+ glib >= 0.12.5.4 && < 0.13, pango >= 0.12.5.3 && < 0.13, cairo >= 0.12.5.3 && < 0.13 if flag(have-gio)