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: Axel S. <si...@co...> - 2009-10-30 17:02:18
|
Mon Oct 26 12:29:28 EDT 2009 Axe...@en... * Fix various usages of the mk... functions. hunk ./gtk/Graphics/UI/Gtk.hs.pp 217 + module System.Glib.GObject, hunk ./gtk/Graphics/UI/Gtk.hs.pp 420 - +import System.Glib.GObject ( + GObject, + GObjectClass, + toGObject, + castToGObject, + quarkFromString, + objectCreateAttribute, + objectSetAttribute, + objectGetAttributeUnsafe, + isA + ) + [_$_] hunk ./gtk/Graphics/UI/Gtk/Abstract/Object.chs.pp 105 - (ForeignPtr obj -> obj) -> IO (Ptr obj) -> IO obj -makeNewObject constr generator = do + (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj +makeNewObject (constr, objectUnref) generator = do hunk ./gtk/Graphics/UI/Gtk/Abstract/Widget.chs.pp 1019 - (fromMaybe (mkStyle nullForeignPtr) style) + (fromMaybe (Style nullForeignPtr) style) hunk ./gtk/Graphics/UI/Gtk/Abstract/Widget.chs.pp 1136 - case (fromMaybe (mkPixmap nullForeignPtr) shapeMask) of + case (fromMaybe (Pixmap nullForeignPtr) shapeMask) of hunk ./gtk/Graphics/UI/Gtk/Abstract/Widget.chs.pp 1159 - case (fromMaybe (mkPixmap nullForeignPtr) shapeMask) of + case (fromMaybe (Pixmap nullForeignPtr) shapeMask) of hunk ./gtk/Graphics/UI/Gtk/Abstract/Widget.chs.pp 1618 - (fromMaybe (mkAdjustment nullForeignPtr) hadjustment) - (fromMaybe (mkAdjustment nullForeignPtr) vadjustment) + (fromMaybe (Adjustment nullForeignPtr) hadjustment) + (fromMaybe (Adjustment nullForeignPtr) vadjustment) hunk ./gtk/Graphics/UI/Gtk/Gdk/Gdk.chs 139 - (maybe (mkDrawWindow nullForeignPtr) toDrawWindow mbConfine_to) + (maybe (DrawWindow nullForeignPtr) toDrawWindow mbConfine_to) hunk ./gtk/Graphics/UI/Gtk/Gdk/Pixbuf.chs.pp 709 - (mkPixbuf nullForeignPtr) (toDrawable d) (mkColormap nullForeignPtr) + (Pixbuf nullForeignPtr) (toDrawable d) (Colormap nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/Gdk/Pixmap.chs.pp 87 - (maybe (mkDrawable nullForeignPtr) toDrawable mbDrawable) + (maybe (Drawable nullForeignPtr) toDrawable mbDrawable) hunk ./gtk/Graphics/UI/Gtk/Gdk/Pixmap.chs.pp 101 - (maybe (mkDrawWindow nullForeignPtr) toDrawWindow mbDrawWindow) + (maybe (DrawWindow nullForeignPtr) toDrawWindow mbDrawWindow) hunk ./gtk/Graphics/UI/Gtk/General/General.chs 102 --- check however we do not compile users programs with this headder so if +-- check however we do not compile users programs with this header so if hunk ./gtk/Graphics/UI/Gtk/General/Selection.chs.pp 222 - (maybe (mkWidget nullForeignPtr) toWidget widget) + (maybe (Widget nullForeignPtr) toWidget widget) hunk ./gtk/Graphics/UI/Gtk/General/Selection.chs.pp 235 - (maybe (mkWidget nullForeignPtr) toWidget widget) + (maybe (Widget nullForeignPtr) toWidget widget) hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/Menu.chs.pp 168 - -- ^ The mouse button from the 'Graphics.UI.Gtk.Gdk.Events.Button' event and - -- the time of the event. These values are used to match the corresponding - -- release of the button. If this context menu is shown by programmatic - -- means, supply @Nothing@. + -- ^ The mouse button returned by 'Graphics.UI.Gtk.Gdk.EventM.eventButton' and + -- the time of the event returned by 'Graphics.UI.Gtk.Gdk.eventTime'. These + -- values are used to match the corresponding release of the button. If this + -- context menu is shown by programmatic means, supply @Nothing@. hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/Menu.chs.pp 176 - (mkWidget nullForeignPtr) - (mkWidget nullForeignPtr) + (Widget nullForeignPtr) + (Widget nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/Menu.chs.pp 186 - (mkWidget nullForeignPtr) - (mkWidget nullForeignPtr) + (Widget nullForeignPtr) + (Widget nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/Toolbar.chs.pp 286 - toolbarChildToggleButton (mkWidget nullForeignPtr) lblPtr [_$_] + toolbarChildToggleButton (Widget nullForeignPtr) lblPtr [_$_] hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/Toolbar.chs.pp 347 - toolbarChildRadioButton (maybe (mkWidget nullForeignPtr) toWidget rb) [_$_] + toolbarChildRadioButton (maybe (Widget nullForeignPtr) toWidget rb) [_$_] hunk ./gtk/Graphics/UI/Gtk/ModelView/CustomStore.chs 59 -import System.Glib.GObject (makeNewGObject) +{#import System.Glib.GObject#} (GObjectClass(..), GObject(..), unGObject, + makeNewGObject, objectUnref) hunk ./gtk/Graphics/UI/Gtk/ModelView/CustomStore.chs 102 - toGObject (CustomStore tm) = mkGObject (castForeignPtr tm) + toGObject (CustomStore tm) = GObject (castForeignPtr tm) hunk ./gtk/Graphics/UI/Gtk/ModelView/CustomStore.chs 242 - liftM con $ makeNewGObject CustomStore $ + liftM con $ makeNewGObject (CustomStore, objectUnref) $ hunk ./gtk/Graphics/UI/Gtk/ModelView/IconView.chs.pp 630 - (mkCellRenderer nullForeignPtr) + (CellRenderer nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModelSort.chs.pp 82 - toGObject (TypedTreeModelSort tm) = mkGObject (castForeignPtr tm) + toGObject (TypedTreeModelSort tm) = GObject (castForeignPtr tm) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs.pp 489 - (mkTreeViewColumn nullForeignPtr) + (TreeViewColumn nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs.pp 642 - (mkTreeViewColumn nullForeignPtr) + (TreeViewColumn nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeView.chs.pp 1301 - (mkEntry nullForeignPtr) + (Entry nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 317 - {#call unsafe text_iter_begins_tag#} ti (mkTextTag nullForeignPtr) + {#call unsafe text_iter_begins_tag#} ti (TextTag nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 329 - {#call unsafe text_iter_ends_tag#} ti (mkTextTag nullForeignPtr) + {#call unsafe text_iter_ends_tag#} ti (TextTag nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 341 - {#call unsafe text_iter_toggles_tag#} ti (mkTextTag nullForeignPtr) + {#call unsafe text_iter_toggles_tag#} ti (TextTag nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 350 - {#call unsafe text_iter_has_tag#} ti (mkTextTag nullForeignPtr) + {#call unsafe text_iter_has_tag#} ti (TextTag nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 778 - (fromMaybe (mkTextTag nullForeignPtr) tt) + (fromMaybe (TextTag nullForeignPtr) tt) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 790 - (fromMaybe (mkTextTag nullForeignPtr) tt) + (fromMaybe (TextTag nullForeignPtr) tt) hunk ./gtk/Graphics/UI/Gtk/Scrolling/HScrollbar.chs 86 -hScrollbarNewDefaults = hScrollbarNew (mkAdjustment nullForeignPtr) +hScrollbarNewDefaults = hScrollbarNew (Adjustment nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/Scrolling/VScrollbar.chs 86 -vScrollbarNewDefaults = vScrollbarNew (mkAdjustment nullForeignPtr) +vScrollbarNewDefaults = vScrollbarNew (Adjustment nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/Selectors/ColorButton.chs.pp 134 --- | Sets @color@ to be the current color in the 'ColorButton' widget. +-- | Returns the current color value. hunk ./gtk/Graphics/UI/Gtk/TreeList/TreeView.chs.pp 453 - (mkTreeViewColumn nullForeignPtr) + (TreeViewColumn nullForeignPtr) hunk ./gtk/Graphics/UI/Gtk/TreeList/TreeView.chs.pp 603 - (mkTreeViewColumn nullForeignPtr) + (TreeViewColumn nullForeignPtr) |
From: Axel S. <si...@co...> - 2009-10-30 17:02:14
|
Mon Oct 26 11:53:28 EDT 2009 Axe...@en... * Fix the Gst hierarchy. The gstreamer modules used a different hierarchy for their objects which meant that they were not interchangeable with the GObject-rooted hierarchy. There still exists a MiniHierarchy for the light-weight objects of gstreamer but they are now created using the same utility in tools/hierarchyGen. hunk ./Makefile.am 35 - gstreamer/hierarchy.list \ hunk ./Makefile.am 36 - gstreamer/gobject-hierarchy.list \ - gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template \ - gstreamer/Media/Streaming/GStreamer/MiniHierarchy.chs.template \ hunk ./Makefile.am 466 - --parentname=System.Glib.GObject) + --import=*System.Glib.GObject) hunk ./Makefile.am 879 - --parentname=System.Glib.GObject) + --forward=*System.Glib.GObject) hunk ./Makefile.am 1023 - --parentname=Graphics.UI.Gtk.Types) + --import=*Graphics.UI.Gtk.Types) hunk ./Makefile.am 1289 - --modname=System.Gnome.GConf.Types --parentname=System.Glib.GObject) + --modname=System.Gnome.GConf.Types --import=*System.Glib.GObject) hunk ./Makefile.am 1435 - $@ --tag=sourceview --parentname=Graphics.UI.Gtk.Types \ + $@ --tag=sourceview --import=*Graphics.UI.Gtk.Types \ hunk ./Makefile.am 1576 - --parentname=Graphics.UI.Gtk.Types \ + --import=*Graphics.UI.Gtk.Types \ hunk ./Makefile.am 1708 - $@ --tag=mozembed --parentname=Graphics.UI.Gtk.Types \ + $@ --tag=mozembed --import=*Graphics.UI.Gtk.Types \ hunk ./Makefile.am 2095 - $@ --tag=gtkglext --parentname=Graphics.UI.Gtk.Types \ + $@ --tag=gtkglext --import=*Graphics.UI.Gtk.Types \ hunk ./Makefile.am 2354 - --modname=System.Gnome.VFS.Hierarchy --parentname=System.Glib.GObject) + --modname=System.Gnome.VFS.Hierarchy --import=*System.Glib.GObject) hunk ./Makefile.am 2498 + gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchyBase.chs \ hunk ./Makefile.am 2572 - --parentname=System.Glib.GObject) + --import=*System.Glib.GObject) hunk ./Makefile.am 2582 - --parentname=Media.Streaming.GStreamer.Core.MiniHierarchyBase \ - --modname=Media.Streaming.GStreamer.Core.MiniHierarchy) + --import=*Media.Streaming.GStreamer.Core.MiniHierarchyBase \ + --modname=Media.Streaming.GStreamer.Core.MiniHierarchy \ + --destructor=miniObjectUnref) hunk ./gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchyBase.chs 33 - module System.Glib.GObject, + miniObjectUnref, hunk ./gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchyBase.chs 40 - mkCastToMiniObject, - mkIsMiniObject, hunk ./gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchyBase.chs 44 -import System.Glib.GObject hunk ./gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchyBase.chs 49 -mkMiniObject = MiniObject +mkMiniObject = (MiniObject, miniObjectUnref) hunk ./gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchyBase.chs 52 + hunk ./gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchyBase.chs 69 -castToMiniObject = mkMiniObject . castForeignPtr . unMiniObject . toMiniObject +castToMiniObject = toMiniObject hunk ./gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchyBase.chs 71 --- The usage of foreignPtrToPtr should be safe as the evaluation will only be --- forced if the object is used afterwards +-- | Decrease the reference counter of an object hunk ./gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchyBase.chs 73 -mkCastToMiniObject :: (MiniObjectClass obj, MiniObjectClass obj') - => GType - -> String - -> (obj -> obj') -mkCastToMiniObject gtype objTypeName obj = - case toMiniObject obj of - gobj@(MiniObject objFPtr) - | typeInstanceIsA ((unsafeForeignPtrToPtr.castForeignPtr) objFPtr) gtype - -> unsafeCastMiniObject gobj - | otherwise -> error $ "Cannot cast object to " ++ objTypeName - -mkIsMiniObject :: MiniObjectClass obj - => GType - -> obj - -> Bool -mkIsMiniObject gType obj = - unsafePerformIO $ - withForeignPtr (unMiniObject $ toMiniObject obj) $ \objPtr -> - return $ typeInstanceIsA (castPtr objPtr) gType +foreign import ccall unsafe "&gst_mini_object_unref" + miniObjectUnref :: FinalizerPtr a hunk ./tools/hierarchyGen/Hierarchy.chs.template 36 -@MODULE_EXPORTS@@FORWARD_EXPORTS@ +@MODULE_EXPORTS@ hunk ./tools/hierarchyGen/Hierarchy.chs.template 42 -@IMPORT_PARENT@ -@FORWARD_IMPORTS@ +@MODULE_IMPORTS@ hunk ./tools/hierarchyGen/TypeGen.hs 55 + pFL ps all@('G':'s':'t':rem)= pGetObject ps all rem hunk ./tools/hierarchyGen/TypeGen.hs 127 - let parentName = case map (drop 13) (filter ("--parentname=" `isPrefixOf`) rem) of - [] -> "" - (parentName:_) -> parentName + let extraNames = map (drop 9) (filter ("--import=" `isPrefixOf`) rem) hunk ./tools/hierarchyGen/TypeGen.hs 149 - + let showImport ('*':m ) = ss "{#import " .ss m .ss "#}" . indent 0 + showImport m = ss "import " . ss m . indent 0 hunk ./tools/hierarchyGen/TypeGen.hs 158 - "MODULE_EXPORTS" -> generateExports rootObject parentName forwardNames objs - "IMPORT_PARENT" -> if null parentName - then id - else ss "{#import " .ss parentName .ss "#}" - "FORWARD_IMPORTS"-> - foldl (.) id [ ss "import " . ss m . indent 0 | m <- forwardNames ] + "MODULE_EXPORTS" -> generateExports rootObject (map (dropWhile ((==) '*')) forwardNames) objs + "MODULE_IMPORTS" -> foldl (.) id (map showImport (extraNames++forwardNames)) hunk ./tools/hierarchyGen/TypeGen.hs 171 - \ {--lib=<lib>} {--prefix=<prefix>}\n\ - \ {--modname=<modName>} {--parentname=<parentName>}\n\ - \ {--forward=<fwdName>} {--destructor=<destrName>}\n\ + \ [--lib=<lib>] [--prefix=<prefix>]\n\ + \ [--modname=<modName>] {--import=<*><importName>}\n\ + \ {--forward=<*><fwdName>} [--destructor=<destrName>]\n\ hunk ./tools/hierarchyGen/TypeGen.hs 187 - \ <parentName> specify the name of the module that defines any\n\ - \ parent classes eg Hierarchy (default is none)\n\ + \ <importName> additionally import this module without\n\ + \ re-exporting it\n\ hunk ./tools/hierarchyGen/TypeGen.hs 190 + \ <*> use an asterix as prefix if the import should\n\ + \ be a .chs import statement\n\ hunk ./tools/hierarchyGen/TypeGen.hs 203 -generateExports :: String -> String -> [String] -> [[String]] -> ShowS -generateExports rootObject parent forwardNames objs = - (if null parent - then ss "" - else ss " module " .ss parent. ss ","). +generateExports :: String -> [String] -> [[String]] -> ShowS +generateExports rootObject forwardNames objs = |
From: Axel S. <si...@co...> - 2009-10-30 17:02:14
|
Tue May 12 17:35:27 EDT 2009 Axe...@en... * Add an option to c2hs to wrap each call in a locking operation. hunk ./tools/c2hs/chs/CHS.hs 57 --- | `call' [`pure'] [`unsafe'] idalias --- | `fun' [`pure'] [`unsafe'] idalias parms +-- | `call' [`pure'] [`unsafe'] [`nolock'] idalias +-- | `fun' [`pure'] [`unsafe'] [`nolock'] idalias parms hunk ./tools/c2hs/chs/CHS.hs 63 --- ctxt -> [`lib' `=' string] [prefix] +-- ctxt -> [`lib' `=' string] [prefix] [lock] hunk ./tools/c2hs/chs/CHS.hs 66 +-- lock -> `lock' `=' string hunk ./tools/c2hs/chs/CHS.hs 77 --- ptrkind -> [`foreign' | `stable'] ['newtype' | '->' ident] +-- ptrkind -> [`foreign' | `stable' ] ['newtype' | '->' ident] hunk ./tools/c2hs/chs/CHS.hs 167 + (Maybe String) -- lock function hunk ./tools/c2hs/chs/CHS.hs 181 + Bool -- is without lock? hunk ./tools/c2hs/chs/CHS.hs 187 + Bool -- is without lock? hunk ./tools/c2hs/chs/CHS.hs 211 - posOf (CHSContext _ _ pos) = pos + posOf (CHSContext _ _ _ pos) = pos hunk ./tools/c2hs/chs/CHS.hs 215 - posOf (CHSCall _ _ _ _ pos) = pos - posOf (CHSFun _ _ _ _ _ _ _ pos) = pos + posOf (CHSCall _ _ _ _ _ pos) = pos + posOf (CHSFun _ _ _ _ _ _ _ _ pos) = pos hunk ./tools/c2hs/chs/CHS.hs 227 - (CHSContext olib1 opref1 _ ) == (CHSContext olib2 opref2 _ ) = [_$_] - olib1 == olib1 && opref1 == opref2 + (CHSContext olib1 opref1 olock1 _ ) == + (CHSContext olib2 opref2 olock2 _ ) = [_$_] + olib1 == olib1 && opref1 == opref2 && olock1 == olock2 hunk ./tools/c2hs/chs/CHS.hs 236 - (CHSCall _ _ ide1 oalias1 _) == (CHSCall _ _ ide2 oalias2 _) = [_$_] + (CHSCall _ _ _ ide1 oalias1 _) == (CHSCall _ _ _ ide2 oalias2 _) = [_$_] hunk ./tools/c2hs/chs/CHS.hs 238 - (CHSFun _ _ ide1 oalias1 _ _ _ _) [_$_] - == (CHSFun _ _ ide2 oalias2 _ _ _ _) = [_$_] + (CHSFun _ _ _ ide1 oalias1 _ _ _ _) [_$_] + == (CHSFun _ _ _ ide2 oalias2 _ _ _ _) = [_$_] hunk ./tools/c2hs/chs/CHS.hs 452 -showCHSHook (CHSContext olib oprefix _) = [_$_] +showCHSHook (CHSContext olib oprefix olock _) = [_$_] hunk ./tools/c2hs/chs/CHS.hs 458 + . (case olock of + Nothing -> showString "" + Just lock -> showString "lock = " . showString lock . showString " ") hunk ./tools/c2hs/chs/CHS.hs 476 -showCHSHook (CHSCall isPure isUns ide oalias _) = [_$_] +showCHSHook (CHSCall isPure isUns isNol ide oalias _) = [_$_] hunk ./tools/c2hs/chs/CHS.hs 480 + . (if isNol then showString "nolock " else id) hunk ./tools/c2hs/chs/CHS.hs 482 -showCHSHook (CHSFun isPure isUns ide oalias octxt parms parm _) = [_$_] +showCHSHook (CHSFun isPure isUns isNol ide oalias octxt parms parm _) = [_$_] hunk ./tools/c2hs/chs/CHS.hs 486 + . (if isNol then showString "nolock " else id) hunk ./tools/c2hs/chs/CHS.hs 805 - (olib , toks'' ) <- parseOptLib toks - (opref , toks''') <- parseOptPrefix False toks'' - toks'''' <- parseEndHook toks''' - frags <- parseFrags toks'''' - let frag = CHSContext olib opref pos + (olib , toks ) <- parseOptLib toks + (opref , toks) <- parseOptPrefix False toks + (olock , toks) <- parseOptLock toks + toks <- parseEndHook toks + frags <- parseFrags toks + let frag = CHSContext olib opref olock pos hunk ./tools/c2hs/chs/CHS.hs 848 - (isPure , toks' ) <- parseIsPure toks - (isUnsafe, toks'' ) <- parseIsUnsafe toks' - (ide , toks''' ) <- parseIdent toks'' - (oalias , toks'''') <- parseOptAs ide False toks''' - toks''''' <- parseEndHook toks'''' - frags <- parseFrags toks''''' + (isPure , toks ) <- parseIsPure toks + (isUnsafe, toks ) <- parseIsUnsafe toks + (isNolock, toks ) <- parseIsNolock toks + (ide , toks ) <- parseIdent toks + (oalias , toks ) <- parseOptAs ide False toks + toks <- parseEndHook toks + frags <- parseFrags toks hunk ./tools/c2hs/chs/CHS.hs 856 - CHSHook (CHSCall isPure isUnsafe ide (norm ide oalias) pos) : frags + CHSHook (CHSCall isPure isUnsafe isNolock ide (norm ide oalias) pos) : frags hunk ./tools/c2hs/chs/CHS.hs 863 - (ide , toks'3) <- parseIdent toks'2 - (oalias , toks'4) <- parseOptAs ide False toks'3 - (octxt , toks'5) <- parseOptContext toks'4 - (parms , toks'6) <- parseParms toks'5 - (parm , toks'7) <- parseParm toks'6 - toks'8 <- parseEndHook toks'7 - frags <- parseFrags toks'8 + (isNolock, toks'3) <- parseIsNolock toks'2 + (ide , toks'4) <- parseIdent toks'3 + (oalias , toks'5) <- parseOptAs ide False toks'4 + (octxt , toks'6) <- parseOptContext toks'5 + (parms , toks'7) <- parseParms toks'6 + (parm , toks'8) <- parseParm toks'7 + toks'9 <- parseEndHook toks'8 + frags <- parseFrags toks'9 hunk ./tools/c2hs/chs/CHS.hs 873 - (CHSFun isPure isUnsafe ide (norm ide oalias) octxt parms parm pos) : + (CHSFun isPure isUnsafe isNolock ide (norm ide oalias) octxt parms parm pos) : hunk ./tools/c2hs/chs/CHS.hs 907 +parseIsNolock :: [CHSToken] -> CST s (Bool, [CHSToken]) +parseIsNolock (CHSTokNolock _:toks) = return (True , toks) +parseIsNolock toks = return (False, toks) + hunk ./tools/c2hs/chs/CHS.hs 1006 +parseOptLock :: [CHSToken] -> CST s (Maybe String, [CHSToken]) +parseOptLock (CHSTokLock _ : + CHSTokEqual _ : + CHSTokString _ str: + toks) = return (Just str, toks) +parseOptLock (CHSTokLock _:toks ) = syntaxError toks +parseOptLock toks = return (Nothing, toks) + hunk ./tools/c2hs/chs/CHSLexer.hs 97 --- | `unsafe' | `with' +-- | `unsafe' | `with' | 'lock' | 'unlock' hunk ./tools/c2hs/chs/CHSLexer.hs 230 + | CHSTokLock Position -- `lock' + | CHSTokNolock Position -- `nolock' hunk ./tools/c2hs/chs/CHSLexer.hs 279 + posOf (CHSTokLock pos ) = pos + posOf (CHSTokNolock pos ) = pos hunk ./tools/c2hs/chs/CHSLexer.hs 327 + (CHSTokLock _ ) == (CHSTokLock _ ) = True + (CHSTokNolock _ ) == (CHSTokNolock _ ) = True hunk ./tools/c2hs/chs/CHSLexer.hs 376 + showsPrec _ (CHSTokLock _ ) = showString "lock" + showsPrec _ (CHSTokNolock _ ) = showString "nolock" hunk ./tools/c2hs/chs/CHSLexer.hs 698 + idkwtok pos "lock" _ = CHSTokLock pos + idkwtok pos "nolock" _ = CHSTokNolock pos hunk ./tools/c2hs/gen/GBMonad.hs 70 - getPrefix, delayCode, getDelayedCode, ptrMapsTo, queryPtr, objIs, + getPrefix, getLock, delayCode, getDelayedCode, ptrMapsTo, queryPtr, objIs, hunk ./tools/c2hs/gen/GBMonad.hs 226 +-- (3) an optional wrapper function that acquires a lock, this may also +-- be specified on the command line hunk ./tools/c2hs/gen/GBMonad.hs 240 + mLock :: Maybe String, -- a lock function hunk ./tools/c2hs/gen/GBMonad.hs 248 -initialGBState :: GBState -initialGBState = GBState { - lib = "", - prefix = "", - frags = [], - ptrmap = Map.empty, - objmap = Map.empty - } +initialGBState :: Maybe String -> GBState +initialGBState mLock = GBState { + lib = "", + prefix = "", + mLock = mLock, + frags = [], + ptrmap = Map.empty, + objmap = Map.empty + } hunk ./tools/c2hs/gen/GBMonad.hs 260 -setContext :: (Maybe String) -> (Maybe String) -> GB () -setContext lib prefix = [_$_] +setContext :: (Maybe String) -> (Maybe String) -> (Maybe String) -> + GB () +setContext lib prefix newMLock = [_$_] hunk ./tools/c2hs/gen/GBMonad.hs 264 - prefix = fromMaybe "" prefix}, + prefix = fromMaybe "" prefix, + mLock = case newMLock of + Nothing -> mLock state + Just _ -> newMLock }, hunk ./tools/c2hs/gen/GBMonad.hs 280 +-- get the lock function +getLock :: GB (Maybe String) +getLock = readCT mLock + hunk ./tools/c2hs/gen/GBMonad.hs 301 - delay hook@(CHSCall isFun isUns ide oalias _) frags = + delay hook@(CHSCall isFun isUns _ ide oalias _) frags = hunk ./tools/c2hs/gen/GBMonad.hs 303 - Just (CHSCall isFun' isUns' ide' _ _, _) [_$_] + Just (CHSCall isFun' isUns' _ ide' _ _, _) [_$_] hunk ./tools/c2hs/gen/GBMonad.hs 305 - && isUns == isUns' [_$_] + && isUns == isUns' hunk ./tools/c2hs/gen/GenBind.hs 101 --- * context hook must preceded all but the import hooks +-- * context hook must precede all but the import hooks hunk ./tools/c2hs/gen/GenBind.hs 158 - initialGBState, setContext, getPrefix, [_$_] + initialGBState, setContext, getPrefix, getLock, hunk ./tools/c2hs/gen/GenBind.hs 162 - hunk ./tools/c2hs/gen/GenBind.hs 297 - (_, res) <- runCT (expandModule mod) ac initialGBState - return res + mLock <- getSwitch lockFunSB + (_, res) <- runCT (expandModule mod) ac (initialGBState mLock) + return res hunk ./tools/c2hs/gen/GenBind.hs 383 -expandHook (CHSContext olib oprefix _) = +expandHook (CHSContext olib oprefix olock _) = hunk ./tools/c2hs/gen/GenBind.hs 385 - setContext olib oprefix -- enter context information + setContext olib oprefix olock -- enter context information hunk ./tools/c2hs/gen/GenBind.hs 428 -expandHook hook@(CHSCall isPure isUns ide oalias pos) = +expandHook hook@(CHSCall isPure isUns isNol ide oalias pos) = hunk ./tools/c2hs/gen/GenBind.hs 436 + mLock <- if isNol then return Nothing else getLock hunk ./tools/c2hs/gen/GenBind.hs 440 - callImport hook isPure isUns ideLexeme hsLexeme cdecl' pos + callImport hook isPure isUns mLock ideLexeme hsLexeme cdecl' pos hunk ./tools/c2hs/gen/GenBind.hs 444 -expandHook hook@(CHSFun isPure isUns ide oalias ctxt parms parm pos) = +expandHook hook@(CHSFun isPure isUns isNol ide oalias ctxt parms parm pos) = hunk ./tools/c2hs/gen/GenBind.hs 452 + mLock <- if isNol then return Nothing else getLock hunk ./tools/c2hs/gen/GenBind.hs 455 - fiLexeme = hsLexeme ++ "'_" -- *Urgh* - probably unqiue... + fiLexeme = hsLexeme ++ "'_" -- *Urgh* - probably unique... hunk ./tools/c2hs/gen/GenBind.hs 458 - callHook = CHSCall isPure isUns cide (Just fiIde) pos - callImport callHook isPure isUns (identToLexeme cide) fiLexeme cdecl' pos - funDef isPure hsLexeme fiLexeme cdecl' ctxt parms parm pos + callHook = CHSCall isPure isUns isNol cide (Just fiIde) pos + callImport callHook isPure isUns mLock (identToLexeme cide) fiLexeme cdecl' pos + funDef isPure hsLexeme fiLexeme cdecl' ctxt mLock parms parm pos hunk ./tools/c2hs/gen/GenBind.hs 690 -callImport :: CHSHook -> Bool -> Bool -> String -> String -> CDecl -> Position - -> GB String -callImport hook isPure isUns ideLexeme hsLexeme cdecl pos = +callImport :: CHSHook -> Bool -> Bool -> Maybe String -> String -> String + -> CDecl -> Position -> GB String +callImport hook isPure isUns mLock ideLexeme hsLexeme cdecl pos = hunk ./tools/c2hs/gen/GenBind.hs 705 - else return hsLexeme + else return funStr hunk ./tools/c2hs/gen/GenBind.hs 711 - concat (zipWith wrForPtr foreignVec [1..])++hsLexeme++" "++ + concat (zipWith wrForPtr foreignVec [1..])++funStr++" "++ hunk ./tools/c2hs/gen/GenBind.hs 723 + funStr = case mLock of Nothing -> hsLexeme + Just lockFun -> lockFun ++ " $ " ++ hsLexeme hunk ./tools/c2hs/gen/GenBind.hs 744 + -> Maybe String -- lock function hunk ./tools/c2hs/gen/GenBind.hs 749 -funDef isPure hsLexeme fiLexeme cdecl octxt parms parm pos = +funDef isPure hsLexeme fiLexeme cdecl octxt mLock parms parm pos = hunk ./tools/c2hs/gen/GenBind.hs 763 + lock = case mLock of Nothing -> "" + Just lock -> lock ++ " $" hunk ./tools/c2hs/gen/GenBind.hs 767 - else " " ++ fiLexeme ++ join callArgs ++ " >>= \\res ->\n" + else " " ++ lock ++ fiLexeme ++ join callArgs ++ " >>= \\res ->\n" hunk ./tools/c2hs/state/Switches.hs 84 - chiPathSB :: [FilePath] -- .chi file directories + chiPathSB :: [FilePath], -- .chi file directories + lockFunSB :: Maybe String -- a function to wrap each call hunk ./tools/c2hs/state/Switches.hs 102 - chiPathSB = ["."] + chiPathSB = ["."], + lockFunSB = Nothing hunk ./tools/c2hs/toplevel/Main.hs 127 +-- --lock=NAME +-- Wrap each foreign function call in the function NAME. This +-- function is usually a function that acquires a lock for +-- the memory region that the called function is about to access. +-- A wrap function can also be specificed within the file in the +-- context hook, in which case it overrides the command line function. +-- The wrapper function can be omitted on a call-by-call basis by +-- using the nolock option in the call hook. +-- hunk ./tools/c2hs/toplevel/Main.hs 212 + | LockFun String -- wrap each function call in this function hunk ./tools/c2hs/toplevel/Main.hs 263 + Option ['l'] + ["lock"] + (ReqArg LockFun "NAME") + "wrap each foreign call with the function NAME", hunk ./tools/c2hs/toplevel/Main.hs 418 +processOpt (LockFun name ) = setLockFun name hunk ./tools/c2hs/toplevel/Main.hs 538 +-- set the name of the wrapper function that acquires a lock +-- +setLockFun :: String -> CST s () +setLockFun name = setSwitch $ \sb -> sb { lockFunSB = Just name } |
From: Axel S. <si...@co...> - 2009-10-30 17:02:14
|
Mon Oct 26 12:23:57 EDT 2009 Axe...@en... * Change the way objects are destructed. hunk ./glib/System/Glib/GObject.chs.pp 37 - objectUnref, hunk ./glib/System/Glib/GObject.chs.pp 105 --- | Decrease the reference counter of an object --- -foreign import ccall unsafe "&g_object_unref" - objectUnref :: FinalizerPtr a - hunk ./glib/System/Glib/GObject.chs.pp 113 - => (ForeignPtr obj -> obj) -- ^ constructor for the Haskell object + => (ForeignPtr obj -> obj, FinalizerPtr obj) + -- ^ constructor for the Haskell object and finalizer C function hunk ./glib/System/Glib/GObject.chs.pp 117 -makeNewGObject constr generator = do +makeNewGObject (constr, objectUnref) generator = do hunk ./glib/System/Glib/GObject.chs.pp 134 - (ForeignPtr obj -> obj) -> IO (Ptr obj) -> IO obj -constructNewGObject constr generator = do + (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj +constructNewGObject (constr, objectUnref) generator = do hunk ./glib/System/Glib/Types.chs 38 + objectUnref hunk ./glib/System/Glib/Types.chs 41 -import Foreign (ForeignPtr) +import System.Glib.FFI hunk ./glib/System/Glib/Types.chs 47 -mkGObject = GObject +mkGObject = (GObject, objectUnref) hunk ./glib/System/Glib/Types.chs 64 + +-- | Decrease the reference counter of an object +-- +foreign import ccall unsafe "&g_object_unref" + objectUnref :: FinalizerPtr a + |
From: Axel S. <si...@co...> - 2009-10-30 17:02:13
|
Tue May 12 17:36:27 EDT 2009 Axe...@en... * Streamline the types generated for gstreamer by removing the adapted type generator and generalizing the exiting one. hunk ./Makefile.am 104 - tools/hierarchyGenGst/TypeGenerator \ hunk ./Makefile.am 142 -tools_hierarchyGenGst_PKGNAME = tools_hierarchyGenGst_TypeGenerator - -tools_hierarchyGenGst_TypeGenerator_MAIN = \ - $(tools_hierarchyGenGst_TypeGenerator_SOURCES) -tools_hierarchyGenGst_TypeGenerator_EXTERNALDEPS = base-$(PKG_BASE_VERSION) -tools_hierarchyGenGst_TypeGenerator_NOSPLITOBJS = yes -tools_hierarchyGenGst_TypeGenerator_SOURCESDIRS = tools/hierarchyGenGst -tools_hierarchyGenGst_TypeGenerator_SOURCES = \ - tools/hierarchyGenGst/TypeGen.hs -# Fix automake - the subdir-objects option doesn't work here. -am_tools_hierarchyGenGst_TypeGenerator_OBJECTS = $(addsuffix .$(OBJEXT),\ - $(basename $(tools_hierarchyGenGst_TypeGenerator_SOURCES))) -MOSTLYCLEANFILES+= $(am_tools_hierarchyGenGst_TypeGenerator_OBJECTS) -MOSTLYCLEANFILES+= $(tools_hierarchyGenGst_TypeGenerator_SOURCES:.hs=.hi) - hunk ./Makefile.am 2492 - gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchy.chs \ - gstreamer/Media/Streaming/GStreamer/Core/GObjectHierarchy.chs \ - gstreamer/Media/Streaming/GStreamer/Base/Hierarchy.chs \ - gstreamer/Media/Streaming/GStreamer/Base/GObjectHierarchy.chs \ - gstreamer/Media/Streaming/GStreamer/Controller/GObjectHierarchy.chs \ - gstreamer/Media/Streaming/GStreamer/Net/Hierarchy.chs \ - gstreamer/Media/Streaming/GStreamer/Audio/Hierarchy.chs + gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchy.chs hunk ./Makefile.am 2497 - gstreamer/Media/Streaming/GStreamer/Core/HierarchyBase.hs \ - gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchyBase.chs \ hunk ./Makefile.am 2557 - gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchyBase.hs \ hunk ./Makefile.am 2566 -gstreamer/Media/Streaming/GStreamer/Core/Hierarchy.chs : \ - $(srcdir)/gstreamer/hierarchy.list \ - $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/hierarchy.list \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template \ - $@ --tag=gstreamer-core --lib=gstreamer --prefix=gst \ - --root=GObject \ - --modname=Media.Streaming.GStreamer.Core.Hierarchy) +gstreamer/Media/Streaming/GStreamer/Core/Hierarchy.chs : \ + $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ + $(srcdir)/tools/hierarchyGen/hierarchy.list \ + $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template + $(strip $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ + $(srcdir)/tools/hierarchyGen/hierarchy.list \ + $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template \ + $@ --tag=gstreamer --lib=gstreamer --prefix=gst \ + --modname=Media.Streaming.GStreamer.Core.Hierarchy \ + --parentname=System.Glib.GObject) hunk ./Makefile.am 2577 -gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchy.chs : \ - $(srcdir)/gstreamer/mini-hierarchy.list \ - $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/MiniHierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/mini-hierarchy.list \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/MiniHierarchy.chs.template \ - $@ --tag=gstreamer-core --lib=gstreamer --prefix=gst \ - --root=MiniObject \ +gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchy.chs : \ + $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/mini-hierarchy.list \ + $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template + $(strip $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ + $(srcdir)/gstreamer/mini-hierarchy.list \ + $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template \ + $@ --tag=default --lib=gstreamer --prefix=gst --root=MiniObject \ + --parentname=Media.Streaming.GStreamer.Core.MiniHierarchyBase \ hunk ./Makefile.am 2588 -gstreamer/Media/Streaming/GStreamer/Core/GObjectHierarchy.chs : \ - $(srcdir)/gstreamer/gobject-hierarchy.list \ - $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/gobject-hierarchy.list \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template \ - $@ --tag=gstreamer-core --lib=gstreamer --prefix=gst \ - --root=GObject \ - --modname=Media.Streaming.GStreamer.Core.GObjectHierarchy) - -gstreamer/Media/Streaming/GStreamer/Base/Hierarchy.chs : \ - $(srcdir)/gstreamer/hierarchy.list \ - $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/hierarchy.list \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template \ - $@ --tag=gstreamer-base --lib=gstreamer --prefix=gst \ - --root=GObject \ - --modname=Media.Streaming.GStreamer.Base.Hierarchy \ - --parentname=Media.Streaming.GStreamer.Core.Hierarchy) - -gstreamer/Media/Streaming/GStreamer/Base/GObjectHierarchy.chs : \ - $(srcdir)/gstreamer/gobject-hierarchy.list \ - $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/gobject-hierarchy.list \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template \ - $@ --tag=gstreamer-base --lib=gstreamer --prefix=gst \ - --root=GObject \ - --modname=Media.Streaming.GStreamer.Base.GObjectHierarchy) - -gstreamer/Media/Streaming/GStreamer/Controller/GObjectHierarchy.chs : \ - $(srcdir)/gstreamer/gobject-hierarchy.list \ - $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/gobject-hierarchy.list \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template \ - $@ --tag=gstreamer-controller --lib=gstreamer --prefix=gst \ - --root=GObject \ - --modname=Media.Streaming.GStreamer.Controller.GObjectHierarchy) - -gstreamer/Media/Streaming/GStreamer/Net/Hierarchy.chs : \ - $(srcdir)/gstreamer/hierarchy.list \ - $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/hierarchy.list \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template \ - $@ --tag=gstreamer-net --lib=gstreamer --prefix=gst \ - --root=GObject \ - --modname=Media.Streaming.GStreamer.Net.Hierarchy \ - --parentname=Media.Streaming.GStreamer.Core.Hierarchy) - hunk ./Makefile.am 2597 -gstreamer/Media/Streaming/GStreamer/Audio/Hierarchy.chs : \ - $(srcdir)/gstreamer/hierarchy.list \ - $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template - $(strip $(srcdir)/tools/hierarchyGenGst/TypeGenerator$(EXEEXT) \ - $(srcdir)/gstreamer/hierarchy.list \ - $(srcdir)/gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template \ - $@ --tag=gstreamer-audio --lib=gstreamer --prefix=gst \ - --root=GObject \ - --modname=Media.Streaming.GStreamer.Audio.Hierarchy \ - --parentname=Media.Streaming.GStreamer.Core.Hierarchy) - hunk ./gstreamer/Media/Streaming/GStreamer/Audio/Types.chs 34 - , module Media.Streaming.GStreamer.Audio.Hierarchy hunk ./gstreamer/Media/Streaming/GStreamer/Audio/Types.chs 41 -{#import Media.Streaming.GStreamer.Audio.Hierarchy#} hunk ./gstreamer/Media/Streaming/GStreamer/Base/Adapter.chs.pp 33 - toAdapter, hunk ./gstreamer/Media/Streaming/GStreamer/Base/Adapter.chs.pp 34 - isAdapter, + gTypeAdapter, + hunk ./gstreamer/Media/Streaming/GStreamer/Base/BaseSink.chs.pp 34 - toBaseSink, + gTypeBaseSink, + [_$_] hunk ./gstreamer/Media/Streaming/GStreamer/Base/BaseSrc.chs.pp 34 - toBaseSrc, + gTypeBaseSrc, + hunk ./gstreamer/Media/Streaming/GStreamer/Base/BaseTransform.chs.pp 34 - toBaseTransform, + gTypeBaseTransform, + hunk ./gstreamer/Media/Streaming/GStreamer/Base/PushSrc.chs 34 - toPushSrc, + gTypePushSrc, hunk ./gstreamer/Media/Streaming/GStreamer/Base/Types.chs 35 - module Media.Streaming.GStreamer.Base.Hierarchy, - module Media.Streaming.GStreamer.Base.GObjectHierarchy, hunk ./gstreamer/Media/Streaming/GStreamer/Base/Types.chs 42 -{#import Media.Streaming.GStreamer.Base.Hierarchy#} -{#import Media.Streaming.GStreamer.Base.GObjectHierarchy#} hunk ./gstreamer/Media/Streaming/GStreamer/Controller/Controller.chs 58 - constructNewGObject Controller $ return cController + constructNewGObject mkController $ return cController hunk ./gstreamer/Media/Streaming/GStreamer/Controller/Types.chs 35 - module Media.Streaming.GStreamer.Controller.GObjectHierarchy, hunk ./gstreamer/Media/Streaming/GStreamer/Controller/Types.chs 39 -{#import Media.Streaming.GStreamer.Controller.GObjectHierarchy#} hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs.pp 63 - -- Safely downcast an 'Object' to a 'Bin'. hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bin.chs.pp 64 - -- Upcast to a 'Bin'. - toBin, - -- See if an 'Object' is a 'Bin'. - isBin, + gTypeBin, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Buffer.chs.pp 44 - BufferFlags(..), - -- Safely downcast an 'Object' to a 'Bin'. hunk ./gstreamer/Media/Streaming/GStreamer/Core/Buffer.chs.pp 45 - -- Upcast to a 'Bin'. - toBuffer, - -- See if an 'Object' is a 'Bin'. - isBuffer, + gTypeBuffer, + + BufferFlags(..), hunk ./gstreamer/Media/Streaming/GStreamer/Core/Bus.chs.pp 85 - toBus, + gTypeBus, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Clock.chs.pp 109 - toClock, + gTypeClock, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Element.chs.pp 77 - toElement, + gTypeElement, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/ElementFactory.chs.pp 46 - toElementFactory, + gTypeElementFactory, hunk ./gstreamer/Media/Streaming/GStreamer/Core/GhostPad.chs.pp 34 - toGhostPad, + gTypeGhostPad, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Index.chs 34 - toIndex, + gTypeIndex, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/IndexFactory.chs 34 - toIndexFactory, + gTypeIndexFactory, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Message.chs.pp 34 - toMessage, + gTypeMessage, hunk ./gstreamer/Media/Streaming/GStreamer/Core/MiniHierarchyBase.chs 33 + module System.Glib.GObject, hunk ./gstreamer/Media/Streaming/GStreamer/Core/MiniObject.chs 37 - isMiniObject, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Object.chs.pp 34 - toObject, + gTypeObject, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pad.chs.pp 34 - toPad, + gTypePad, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/PadTemplate.chs.pp 34 - toPadTemplate, + gTypePadTemplate, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Pipeline.chs 33 - toPipeline, + gTypePipeline, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Plugin.chs 33 - toPlugin, + gTypePlugin, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/PluginFeature.chs 34 - toPluginFeature, + gTypePluginFeature, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Query.chs 35 - isQuery, + gTypeQuery, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Registry.chs 34 - toRegistry, + gTypeRegistry, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/SystemClock.chs 33 - toSystemClock, hunk ./gstreamer/Media/Streaming/GStreamer/Core/SystemClock.chs 34 + gTypeSystemClock, + hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs.pp 39 - module Media.Streaming.GStreamer.Core.GObjectHierarchy, hunk ./gstreamer/Media/Streaming/GStreamer/Core/Types.chs.pp 176 -{#import Media.Streaming.GStreamer.Core.GObjectHierarchy#} hunk ./gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template 1 -{-# OPTIONS_HADDOCK hide #-} --- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*- --- --- Author : Peter Gavin --- Created: 1-Apr-2007 --- --- Copyright (c) 2007 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/>. --- [_$_] --- GStreamer, 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 GStreamer documentation. --- --- #hide - --- | Maintainer : gtk2hs-devel\@lists.sourceforge.net --- Stability : alpha --- Portability : portable (depends on GHC) -module @MODULE_NAME@ ( -@MODULE_EXPORTS@ - ) where - -import Foreign.ForeignPtr (ForeignPtr, castForeignPtr, unsafeForeignPtrToPtr) -import Foreign.C.Types -import System.Glib.GType (GType, typeInstanceIsA) -import System.Glib.GObject -import Media.Streaming.GStreamer.Core.HierarchyBase -@IMPORT_PARENT@ - -{# context lib="@CONTEXT_LIB@" prefix="@CONTEXT_PREFIX@" #} - -@DECLERATIONS@ rmfile ./gstreamer/Media/Streaming/GStreamer/Hierarchy.chs.template hunk ./gstreamer/Media/Streaming/GStreamer/MiniHierarchy.chs.template 1 -{-# OPTIONS_HADDOCK hide #-} --- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*- --- --- Author : Peter Gavin --- Created: 1-Apr-2007 --- --- Copyright (c) 2007 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/>. --- [_$_] --- GStreamer, 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 GStreamer documentation. --- --- #hide - --- | Maintainer : gtk2hs-devel\@lists.sourceforge.net --- Stability : alpha --- Portability : portable (depends on GHC) -module @MODULE_NAME@ ( -@MODULE_EXPORTS@ - ) where - -import Foreign.ForeignPtr (ForeignPtr, castForeignPtr, unsafeForeignPtrToPtr) -import Foreign.C.Types -import System.Glib.GType (GType, typeInstanceIsA) -import Media.Streaming.GStreamer.Core.MiniHierarchyBase -@IMPORT_PARENT@ - -{# context lib="@CONTEXT_LIB@" prefix="@CONTEXT_PREFIX@" #} - -@DECLERATIONS@ rmfile ./gstreamer/Media/Streaming/GStreamer/MiniHierarchy.chs.template hunk ./gstreamer/Media/Streaming/GStreamer/Net/Types.chs 35 - module Media.Streaming.GStreamer.Net.Hierarchy hunk ./gstreamer/Media/Streaming/GStreamer/Net/Types.chs 39 -{#import Media.Streaming.GStreamer.Net.Hierarchy#} hunk ./gstreamer/gobject-hierarchy.list 1 - GObject [_$_] - GstURIHandler as URIHandler, gst_uri_handler_get_type if gstreamer-core - GstAdapter as Adapter, gst_adapter_get_type if gstreamer-base - GstController as Controller, gst_controller_get_type if gstreamer-controller rmfile ./gstreamer/gobject-hierarchy.list hunk ./gstreamer/hierarchy.list 1 - GObject [_$_] -## GStreamer classes - GstObject as Object, gst_object_get_type if gstreamer-core - GstPad as Pad, gst_pad_get_type if gstreamer-core - GstGhostPad as GhostPad, gst_ghost_pad_get_type if gstreamer-core - GstPluginFeature as PluginFeature, gst_plugin_feature_get_type if gstreamer-core - GstElementFactory as ElementFactory, gst_element_factory_get_type if gstreamer-core - GstTypeFindFactory as TypeFindFactory, gst_type_find_factory_get_type if gstreamer-core - GstIndexFactory as IndexFactory, gst_index_factory_get_type if gstreamer-core - GstElement as Element, gst_element_get_type if gstreamer-core - GstBin as Bin, gst_bin_get_type if gstreamer-core - GstPipeline as Pipeline, gst_pipeline_get_type if gstreamer-core - GstImplementsInterface as ImplementsInterface, gst_implements_interface_get_type if gstreamer-core - GstTagSetter as TagSetter, gst_tag_setter_get_type if gstreamer-core - GstBaseSrc as BaseSrc, gst_base_src_get_type if gstreamer-base - GstPushSrc as PushSrc, gst_push_src_get_type if gstreamer-base - GstBaseSink as BaseSink, gst_base_sink_get_type if gstreamer-base - GstBaseTransform as BaseTransform, gst_base_transform_get_type if gstreamer-base - GstPlugin as Plugin, gst_plugin_get_type if gstreamer-core - GstRegistry as Registry, gst_registry_get_type if gstreamer-core - GstBus as Bus, gst_bus_get_type if gstreamer-core - GstClock as Clock, gst_clock_get_type if gstreamer-core - GstAudioClock as AudioClock, gst_audio_clock_get_type if gstreamer-audio - GstSystemClock as SystemClock, gst_system_clock_get_type if gstreamer-core - GstNetClientClock as NetClientClock, gst_net_client_clock_get_type if gstreamer-net - GstIndex as Index, gst_index_get_type if gstreamer-core - GstPadTemplate as PadTemplate, gst_pad_template_get_type if gstreamer-core - GstTask as Task, gst_task_get_type if gstreamer-core - GstXML as XML, gst_xml_get_type if gstreamer-core - GstChildProxy as ChildProxy, gst_child_proxy_get_type if gstreamer-core - GstCollectPads as CollectPads, gst_collect_pads_get_type if gstreamer-base rmfile ./gstreamer/hierarchy.list hunk ./gstreamer/mini-hierarchy.list 3 - GstBuffer as Buffer, gst_buffer_get_type if gstreamer-core - GstEvent as Event, gst_event_get_type if gstreamer-core - GstMessage as Message, gst_message_get_type if gstreamer-core - GstQuery as Query, gst_query_get_type if gstreamer-core + GstBuffer as Buffer, gst_buffer_get_type + GstEvent as Event, gst_event_get_type + GstMessage as Message, gst_message_get_type + GstQuery as Query, gst_query_get_type hunk ./tools/hierarchyGen/Hierarchy.chs.template 43 -@DESTR_IMPORT@ hunk ./tools/hierarchyGen/Hierarchy.chs.template 49 -castTo :: (GObjectClass obj, GObjectClass obj') => GType -> String +castTo :: (@ROOTOBJECT@Class obj, @ROOTOBJECT@Class obj') => GType -> String hunk ./tools/hierarchyGen/Hierarchy.chs.template 52 - case toGObject obj of - gobj\@(GObject objFPtr) + case to@ROOTOBJECT@ obj of + gobj\@(@ROOTOBJECT@ objFPtr) hunk ./tools/hierarchyGen/Hierarchy.chs.template 55 - -> unsafeCastGObject gobj + -> unsafeCast@ROOTOBJECT@ gobj hunk ./tools/hierarchyGen/Hierarchy.chs.template 58 -@DECLERATIONS@ +@DECLARATIONS@ hunk ./tools/hierarchyGen/TypeGen.hs 129 + let rootObject = case map (drop 7) (filter ("--root=" `isPrefixOf`) rem) of + [] -> "GObject" + (rootObject:_) -> rootObject hunk ./tools/hierarchyGen/TypeGen.hs 150 - + [_$_] hunk ./tools/hierarchyGen/TypeGen.hs 158 - "MODULE_EXPORTS" -> generateExports parentName forwardNames objs + "MODULE_EXPORTS" -> generateExports rootObject parentName forwardNames objs hunk ./tools/hierarchyGen/TypeGen.hs 164 - "DESTR_IMPORT" -> if destrFun/="objectUnref" then id else - indent 0.ss "import System.Glib.GObject(objectUnref)" hunk ./tools/hierarchyGen/TypeGen.hs 166 - "DECLERATIONS" -> generateDeclerations destrFun prefix objs specialQueries + "DECLARATIONS" -> generateDeclarations rootObject destrFun prefix objs specialQueries + "ROOTOBJECT" -> ss rootObject hunk ./tools/hierarchyGen/TypeGen.hs 205 -generateExports :: String -> [String] -> [[String]] -> ShowS -generateExports parent forwardNames objs = +generateExports :: String -> String -> [String] -> [[String]] -> ShowS +generateExports rootObject parent forwardNames objs = hunk ./tools/hierarchyGen/TypeGen.hs 219 - , n /= "GObject" ] + , n /= rootObject ] hunk ./tools/hierarchyGen/TypeGen.hs 221 -generateDeclerations :: String -> String -> [[String]] -> TypeTable -> ShowS -generateDeclerations destr prefix objs typeTable = +generateDeclarations :: String -> String -> String -> [[String]] -> TypeTable -> ShowS +generateDeclarations rootObject destr prefix objs typeTable = hunk ./tools/hierarchyGen/TypeGen.hs 224 - [ makeClass destr prefix typeTable obj - . makeUpcast obj + [ makeClass rootObject destr prefix typeTable obj + . makeUpcast rootObject obj hunk ./tools/hierarchyGen/TypeGen.hs 229 -makeUpcast :: [String] -> ShowS -makeUpcast [obj] = id -- no casting for GObject -makeUpcast (obj:_:_) = [_$_] - indent 0.ss "castTo".ss obj.ss " :: GObjectClass obj => obj -> ".ss obj. +makeUpcast :: String -> [String] -> ShowS +makeUpcast rootObject [obj] = id -- no casting for root +makeUpcast rootObject (obj:_:_) = [_$_] + indent 0.ss "castTo".ss obj.ss " :: ".ss rootObject.ss "Class obj => obj -> ".ss obj. hunk ./tools/hierarchyGen/TypeGen.hs 237 -makeGType table [obj] = id -- no GType for GObject +makeGType table [obj] = id -- no GType for root hunk ./tools/hierarchyGen/TypeGen.hs 270 -makeClass :: String -> String -> TypeTable -> [String] -> ShowS -makeClass destr prefix table (name:[]) = id -makeClass destr prefix table (name:parents) = +makeClass :: String -> String -> String -> TypeTable -> [String] -> ShowS +makeClass rootObject destr prefix table (name:[]) = id +makeClass rootObject destr prefix table (name:parents) = hunk ./tools/hierarchyGen/TypeGen.hs 296 - indent 0.ss "to".ss name.ss " = unsafeCastGObject . toGObject". + indent 0.ss "to".ss name.ss " = unsafeCast".ss rootObject.ss " . to".ss rootObject. hunk ./tools/hierarchyGen/TypeGen.hs 299 - makeGObjectInstance name. + makeRootInstance rootObject name. hunk ./tools/hierarchyGen/TypeGen.hs 308 -makeGObjectInstance :: String -> ShowS -makeGObjectInstance name = - indent 0.ss "instance GObjectClass ".ss name.ss " where". - indent 1.ss "toGObject = GObject . castForeignPtr . un".ss name. - indent 1.ss "unsafeCastGObject = ".ss name.ss" . castForeignPtr . unGObject" +makeRootInstance :: String -> String -> ShowS +makeRootInstance rootObject name = + indent 0.ss "instance ".ss rootObject.ss "Class ".ss name.ss " where". + indent 1.ss "to".ss rootObject.ss " = ".ss rootObject.ss" . castForeignPtr . un".ss name. + indent 1.ss "unsafeCast".ss rootObject.ss " = ".ss name.ss " . castForeignPtr . un".ss rootObject hunk ./tools/hierarchyGen/hierarchy.list 277 +## GStreamer classes + GstObject as Object, gst_object_get_type if gstreamer + GstPad as Pad, gst_pad_get_type if gstreamer + GstGhostPad as GhostPad, gst_ghost_pad_get_type if gstreamer + GstPluginFeature as PluginFeature, gst_plugin_feature_get_type if gstreamer + GstElementFactory as ElementFactory, gst_element_factory_get_type if gstreamer + GstTypeFindFactory as TypeFindFactory, gst_type_find_factory_get_type if gstreamer + GstIndexFactory as IndexFactory, gst_index_factory_get_type if gstreamer + GstElement as Element, gst_element_get_type if gstreamer + GstBin as Bin, gst_bin_get_type if gstreamer + GstPipeline as Pipeline, gst_pipeline_get_type if gstreamer + GstImplementsInterface as ImplementsInterface, gst_implements_interface_get_type if gstreamer + GstTagSetter as TagSetter, gst_tag_setter_get_type if gstreamer + GstBaseSrc as BaseSrc, gst_base_src_get_type if gstreamer + GstPushSrc as PushSrc, gst_push_src_get_type if gstreamer + GstBaseSink as BaseSink, gst_base_sink_get_type if gstreamer + GstBaseTransform as BaseTransform, gst_base_transform_get_type if gstreamer + GstPlugin as Plugin, gst_plugin_get_type if gstreamer + GstRegistry as Registry, gst_registry_get_type if gstreamer + GstBus as Bus, gst_bus_get_type if gstreamer + GstClock as Clock, gst_clock_get_type if gstreamer + GstAudioClock as AudioClock, gst_audio_clock_get_type if gstreamer + GstSystemClock as SystemClock, gst_system_clock_get_type if gstreamer + GstNetClientClock as NetClientClock, gst_net_client_clock_get_type if gstreamer + GstIndex as Index, gst_index_get_type if gstreamer + GstPadTemplate as PadTemplate, gst_pad_template_get_type if gstreamer + GstTask as Task, gst_task_get_type if gstreamer + GstXML as XML, gst_xml_get_type if gstreamer + GstChildProxy as ChildProxy, gst_child_proxy_get_type if gstreamer + GstCollectPads as CollectPads, gst_collect_pads_get_type if gstreamer +## these are actually GInterfaces + GstURIHandler as URIHandler, gst_uri_handler_get_type if gstreamer + GstAdapter as Adapter, gst_adapter_get_type if gstreamer + GstController as Controller, gst_controller_get_type if gstreamer + hunk ./tools/hierarchyGenGst/TypeGen.hs 1 --- TypeGenerator.hs --- Takes a hierarchical list of all objects in GTK+ and produces --- Haskell class that reflect this hierarchy. -module Main (main) where - -import Data.Char (isAlpha, isAlphaNum, toLower, toUpper, isUpper) -import Data.List (isPrefixOf) -import Control.Monad (when) -import System.Environment (getArgs) -import System.Exit (exitWith, ExitCode(..)) - --- The current object and its inheritence relationship is defined by all --- ancestors and their column position. -type ObjectSpec = [(Int,String)] - --- This is a mapping from a type name to a) the type name in Haskell and --- b) the GTK blah_get_type function. -type TypeQuery = (String, (String, Maybe String)) -type TypeTable = [TypeQuery] - --- A Tag is a string restricting the generation of type entries to --- those lines that have the appropriate "if <tag>" at the end. -type Tag = String - -data ParserState = ParserState { - line :: Int, - col :: Int, - hierObjs :: ObjectSpec, - onlyTags :: [Tag] - } - -freshParserState :: [Tag] -> ParserState -freshParserState = ParserState 1 1 [] - --- The parser returns a list of ObjectSpec and possibly a special type query --- function. Each ObjectSpec describes one object with all its parents. - -pFreshLine :: ParserState -> String -> [(ObjectSpec, TypeQuery)] -pFreshLine ps input = pFL ps input - where - pFL ps ('#':rem) = pFL ps (dropWhile ((/=) '\n') rem) - pFL ps ('\n':rem) = pFL (ps {line = line ps+1, col=1}) rem - pFL ps (' ':rem) = pFL (ps {col=col ps+1}) rem - pFL ps ('\t':rem) = pFL (ps {col=col ps+8}) rem - pFL ps all@('G':'t':'k':rem)= pGetObject ps all rem - pFL ps all@('G':'d':'k':rem)= pGetObject ps all rem - pFL ps all@('G':'n':'o':'m':'e':rem)= pGetObject ps all rem - pFL ps [] = [] - pFL ps all = pGetObject ps all all - -pGetObject :: ParserState -> String -> String -> [(ObjectSpec, TypeQuery)] -pGetObject ps@ParserState { onlyTags=tags } txt txt' = [_$_] - (if readTag `elem` tags then (:) (spec, specialQuery) else id) $ - pFreshLine (ps { hierObjs=spec}) (dropWhile ((/=) '\n') rem'') - where - isBlank c = c==' ' || c=='\t' - isAlphaNum_ c = isAlphaNum c || c=='_' - isTagName c = isAlphaNum_ c || c=='-' || c=='.' --to allow tag 'gtk-2.4' - (origCName,rem) = span isAlphaNum txt - (origHsName,_) = span isAlphaNum txt' - (name,specialQuery,rem') = case (dropWhile isBlank rem) of - ('a':'s':r) -> - let (tyName,r') = span isAlphaNum_ (dropWhile isBlank r) in - case (dropWhile isBlank r') of - (',':r) -> - let (tyQuery,r') = span isAlphaNum_ (dropWhile isBlank r) in - (tyName, (tyName, (origCName, Just tyQuery)), r') - r -> (tyName, (tyName, (origCName, Nothing)), r) - r -> (origHsName, (origHsName, (origCName, Nothing)), r) - parents = dropWhile (\(c,_) -> c>=col ps) (hierObjs ps) - spec = (col ps,name):parents - (readTag, rem'') = case (dropWhile isBlank rem') of - ('i':'f':r) -> span isTagName (dropWhile isBlank r) - r -> ("default",r) - - -------------------------------------------------------------------------------- --- Helper functions -------------------------------------------------------------------------------- - -ss = showString -sc = showChar - -indent :: Int -> ShowS -indent c = ss ("\n"++replicate (2*c) ' ') - -------------------------------------------------------------------------------- --- start of code generation -------------------------------------------------------------------------------- - - -main = do - args <- getArgs - when (length args<3) usage - - ----------------------------------------------------------------------------- - -- Parse command line parameters - -- - let (hierFile: templateFile: goalFile: rem) = args - let tags = map (drop 6) (filter ("--tag=" `isPrefixOf`) rem) - let lib = case map (drop 6) (filter ("--lib=" `isPrefixOf`) rem) of - [] -> "gtk" - (lib:_) -> lib - let prefix = case map (drop 9) (filter ("--prefix=" `isPrefixOf`) rem) of - [] -> "gtk" - (prefix:_) -> prefix - let modName = case map (drop 10) (filter ("--modname=" `isPrefixOf`) rem) of - [] -> bareFName goalFile - (modName:_) -> modName - where bareFName = reverse . - takeWhile isAlphaNum . - drop 1 . - dropWhile isAlpha . - reverse - let parentName = case map (drop 13) (filter ("--parentname=" `isPrefixOf`) rem) of - [] -> "" - (parentName:_) -> parentName - [_$_] - let rootObject = case map (drop 7) (filter ("--root=" `isPrefixOf`) rem) of - [] -> "GObject" - (rootObject:_) -> rootObject - - ----------------------------------------------------------------------------- - -- Read in the input files - -- - content <- if hierFile == "-" - then getContents -- read stdin - else readFile hierFile - template <- readFile templateFile - - ----------------------------------------------------------------------------- - -- Parse the contents of the hierarchy file - -- - let (objs', specialQueries) = unzip $ - pFreshLine (freshParserState tags) content - objs = map (map snd) objs' - - ----------------------------------------------------------------------------- - -- Write the result file by substituting values into the template file - -- - writeFile goalFile $ - templateSubstitute template (\var -> - case var of - "MODULE_NAME" -> ss modName - "MODULE_EXPORTS" -> generateExports parentName objs - "IMPORT_PARENT" -> if null parentName - then ss "" - else ss "{#import " .ss parentName .ss "#}" - "CONTEXT_LIB" -> ss lib - "CONTEXT_PREFIX" -> ss prefix - "DECLERATIONS" -> generateDeclerations prefix rootObject objs specialQueries - _ -> ss "" - ) "" - - -usage = do - putStr "\nProgram to generate Gtk's object hierarchy in Haskell. Usage:\n\ - \TypeGenerator <hierFile> <templateFile> <outFile> {--tag=<tag>}\n\ - \ {--lib=<lib>} {--prefix=<prefix>}\n\ - \ {--modname=<modName>} {--parentname=<parentName>}\n\ - \where\n\ - \ <hierFile> a list of all possible objects, the hierarchy is\n\ - \ taken from the indentation\n\ - \ <templateFile> is the name and path of the output template file\n\ - \ <outFile> is the name and path of the output file\n\ - \ <tag> generate entries that have the tag <tag>\n\ - \ specify `default' for types without tags\n\ - \ <lib> set the lib to use in the c2hs {#context #}\n\ - \ declaration (the default is \"gtk\")\n\ - \ <prefix> set the prefix to use in the c2hs {#context #}\n\ - \ declaration (the default is \"gtk\")\n\ - \ <modName> specify module name if it does not match the\n\ - \ file name, eg a hierarchical module name\n\ - \ <parentName> specify the name of the module that defines any\n\ - \ parent classes eg Hierarchy (default is none)\n" - exitWith $ ExitFailure 1 - - - -------------------------------------------------------------------------------- --- generate dynamic fragments -------------------------------------------------------------------------------- - -generateExports :: String -> [[String]] -> ShowS -generateExports parent objs = - drop 2. - foldl (\s1 s2 -> s1.ss ", ".s2) id - [ indent 1.ss n.ss "(".ss n.ss "), ".ss n.ss "Class,". - indent 1.ss "to".ss n.ss ", ". - indent 1.ss "mk".ss n.ss ", un".ss n.sc ','. - indent 1.ss "castTo".ss n.ss ",". - indent 1.ss "is".ss n - | (n:_) <- objs - , n /= "GObject" ] - -generateDeclerations :: String -> String -> [[String]] -> TypeTable -> ShowS -generateDeclerations prefix rootObject objs typeTable = - foldl (.) id - [ makeClass prefix typeTable rootObject obj - . makeUpcast typeTable rootObject obj - | obj <- objs ] - -makeUpcast :: TypeTable -> String -> [String] -> ShowS -makeUpcast table rootObject [obj] = id -- no casting for GObject -makeUpcast table rootObject (obj:_:_) = [_$_] - indent 0.ss "castTo".ss obj.ss " :: ".ss rootObject.ss "Class obj => obj -> ".ss obj. - indent 0.ss "castTo".ss obj.ss " = mkCastTo".ss rootObject. - indent 1.get_type_func.ss " \"".ss obj.ss "\"". - indent 0.ss "is".ss obj.ss " :: ".ss obj.ss "Class o => o -> Bool". - indent 0.ss "is".ss obj.ss " = mkIs".ss rootObject.ss " ".get_type_func. - indent 0 - where - get_type_func = - ss "{# call fun unsafe ". - ss (case lookup obj table of [_$_] - (Just (_, Just get_type_func)) -> get_type_func - (Just (cname, _)) -> tail $ c2u True cname++"_get_type"). - ss " #}" - -- case to underscore translation: the boolean arg specifies whether - -- the first uppercase letter X is to be replaced by _x (True) or by x. - -- - -- translation: HButtonBox -> hbutton_box - c2u :: Bool -> String -> String - c2u True (x:xs) | isUpper x = '_':toLower x:c2u False xs - c2u False (x:xs) | isUpper x = toLower x:c2u True xs - c2u _ (x:xs) | otherwise = x:c2u True xs - c2u _ [] = [] - -makeOrd fill [] = id -makeOrd fill (obj:preds) = indent 1.ss "compare ".ss obj.ss "Tag ". - fill obj.ss obj.ss "Tag".fill obj. - ss " = EQ".makeGT obj preds - where - makeGT obj [] = id - makeGT obj (pr:eds) = indent 1.ss "compare ".ss obj.ss "Tag ". - fill obj.ss pr.ss "Tag".fill pr. - ss " = GT".makeGT obj eds - -makeClass :: String -> TypeTable -> String -> [String] -> ShowS -makeClass prefix table rootObject (name:[]) = id -makeClass prefix table rootObject (name:parents) = - indent 0.ss "-- ".ss (replicate (75-length name) '*').sc ' '.ss name. - indent 0. - indent 0.ss "{#pointer *". - (case lookup name table of - (Just (cname, _)) | stripPrefix cname == name -> ss name - | otherwise -> ss cname.ss " as ".ss name - where stripPrefix s = if uCasePrefix `isPrefixOf` s - then drop (length prefix) s - else s - uCasePrefix = toUpper (head prefix) : tail prefix -- gtk -> Gtk - ). - ss " foreign newtype #}". - indent 0. - indent 0.ss "mk".ss name.ss " = ".ss name. - indent 0.ss "un".ss name.ss " (".ss name.ss " o) = o". - indent 0. - indent 0.ss "class ".ss (head parents).ss "Class o => ".ss name.ss "Class o". - indent 0.ss "to".ss name.ss " :: ".ss name.ss "Class o => o -> ".ss name. - indent 0.ss "to".ss name.ss " = unsafeCast".ss rootObject.ss " . to".ss rootObject. - indent 0. - makeInstance name (name:init parents). - makeRootInstance name rootObject. - indent 0 - -makeInstance :: String -> [String] -> ShowS -makeInstance name [] = id -makeInstance name (par:ents) = - indent 0.ss "instance ".ss par.ss "Class ".ss name. - makeInstance name ents - -makeRootInstance :: String -> String -> ShowS -makeRootInstance name rootObject = - indent 0.ss "instance ".ss rootObject.ss "Class ".ss name.ss " where". - indent 1.ss "to".ss rootObject.ss " = ".ss "mk".ss rootObject.ss" . castForeignPtr . un".ss name. - indent 1.ss "unsafeCast".ss rootObject.ss " = mk".ss name.ss " . castForeignPtr . un".ss rootObject - -templateSubstitute :: String -> (String -> ShowS) -> ShowS -templateSubstitute template varSubst = doSubst template [_$_] - where doSubst [] = id - doSubst ('\\':'@':cs) = sc '@' . doSubst cs - doSubst ('@':cs) = let (var,_:cs') = span ('@'/=) cs - in varSubst var . doSubst cs' - doSubst (c:cs) = sc c . doSubst cs rmfile ./tools/hierarchyGenGst/TypeGen.hs rmdir ./tools/hierarchyGenGst hunk ./tools/hierarchyGen/TypeGen.hs 150 - [_$_] + |
From: Axel S. <si...@co...> - 2009-10-22 18:01:17
|
Thu Oct 22 13:59:31 EDT 2009 Axel Simon <Axe...@en...> * Complete the Screen object. hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 61 - screenGetRGBColormap, --- screenGetRGBVisual, -#if GTK_CHECK_VERSION(2,8,0) - screenGetRGBAColormap, --- screenGetRGBAVisual, hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 64 -#endif hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 73 --- screenListVisuals, --- screenGetToplevelWindows, + screenListVisuals, + screenGetToplevelWindows, hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 77 --- screenGetMonitorGeometry, + screenGetMonitorGeometry, hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 80 --- screenBroadcastClientMessage, +#if GTK_CHECK_VERSION(2,14,0) + screenGetMonitorHeightMm, + screenGetMonitorWidthMm, + screenGetMonitorPlugName, +#endif hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 88 --- screenGetWindowStack, + screenGetWindowStack, hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 92 --- screenFontOptions, + screenFontOptions, hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 100 +#if GTK_CHECK_VERSION(2,14,0) + screenMonitorsChanged, +#endif hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 115 +import System.Glib.GList hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 118 +import Graphics.Rendering.Cairo.Types ( FontOptions(..), mkFontOptions, [_$_] + withFontOptions) +import Graphics.UI.Gtk.General.Structs ( Rectangle(..) ) hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 138 +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 145 +{-# DEPRECATED screenGetDefaultColormap "instead of 'screenGetDefaultColormap obj' use 'get obj screenDefaultColormap'" #-} hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 154 +{-# DEPRECATED screenSetDefaultColormap "instead of 'screenSetDefaultColormap obj value' use 'set obj [ screenDefaultColormap := value ]'" #-} +#endif hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 166 -{- hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 167 --- root window of the display. The return value should not be freed. +-- root window of the display. hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 175 --} - --- | Gets the preferred colormap for rendering image data on @screen@. Not a --- very useful function; historically, GDK could only render RGB image data to --- one colormap and visual, but in the current version it can render to any --- colormap and visual. So there's no need to call this function. --- -screenGetRGBColormap :: Screen - -> IO Colormap -- ^ returns the preferred colormap -screenGetRGBColormap self = - makeNewGObject mkColormap $ - {# call gdk_screen_get_rgb_colormap #} - self - -{- --- | Gets a \"preferred visual\" chosen by GdkRGB for rendering image data on --- @screen@. In previous versions of GDK, this was the only visual GdkRGB could --- use for rendering. In current versions, it's simply the visual GdkRGB would --- have chosen as the optimal one in those previous versions. GdkRGB can now --- render to drawables with any visual. --- -screenGetRGBVisual :: Screen - -> IO Visual -- ^ returns The 'Visual' chosen by GdkRGB. -screenGetRGBVisual self = - makeNewGObject mkVisual $ - {# call gdk_screen_get_rgb_visual #} - self --} - -#if GTK_CHECK_VERSION(2,8,0) --- | Gets a colormap to use for creating windows or pixmaps with an alpha --- channel. The windowing system on which Gtk+ is running may not support this --- capability, in which case @Nothing@ will be returned. Even if a --- non-@Nothing@ value is returned, its possible that the window's alpha --- channel won't be honored when displaying the window on the screen: in --- particular, for X an appropriate windowing manager and compositing manager --- must be running to provide appropriate display. --- --- * Available since Gdk version 2.8 --- -screenGetRGBAColormap :: Screen - -> IO (Maybe Colormap) -- ^ returns a colormap to use for windows with an - -- alpha channel or @Nothing@ if the capability is not - -- available. -screenGetRGBAColormap self = - maybeNull (makeNewGObject mkColormap) $ - {# call gdk_screen_get_rgba_colormap #} - self - -{- --- | Gets a visual to use for creating windows or pixmaps with an alpha --- channel. See the docs for 'screenGetRGBAColormap' for caveats. --- --- * Available since Gdk version 2.8 --- -screenGetRGBAVisual :: Screen - -> IO Visual -- ^ returns a visual to use for windows with an alpha channel - -- or {@NULL@, FIXME: this should probably be converted to a - -- Maybe data type} if the capability is not available. -screenGetRGBAVisual self = - makeNewGObject mkVisual $ - {# call gdk_screen_get_rgba_visual #} - self --} hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 194 -#endif hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 264 -{- + hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 270 --- Call 'gListFree' on the return value when you\'re finished with it. --- hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 271 - -> IO [{- element type -}] -- ^ returns a list of visuals; the list must be - -- freed, but not its contents + -> IO [Visual] -- ^ returns a list of visuals hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 276 - >>= mapM (\elemPtr -> {-marshal elem-}) + >>= mapM (makeNewGObject mkVisual . return) hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 283 --- The returned list should be freed with 'gListFree', but its elements need --- not be freed. --- hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 284 - -> IO [{- element type -}] -- ^ returns list of toplevel windows, free with - -- 'gListFree' + -> IO [DrawWindow] -- ^ returns list of toplevel windows hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 289 - >>= mapM (\elemPtr -> {-marshal elem-}) --} + >>= mapM (makeNewGObject mkDrawWindow . return) + hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 296 - -> IO String -- ^ returns a newly allocated string, free with 'gFree' + -> IO String -- ^ returns a newly allocated string hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 311 -{- --- | Retrieves the {GdkRectangle, FIXME: boxed type} representing the size and +-- | Retrieves the 'Rectangle' representing the size and hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 319 - -> {-GdkRectangle*-} -- ^ @dest@ - a {GdkRectangle, FIXME: boxed type} to be - -- filled with the monitor geometry - -> IO () -screenGetMonitorGeometry self monitorNum dest = + -> IO Rectangle +screenGetMonitorGeometry self monitorNum = + alloca $ \rPtr -> do hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 325 - {-dest-} --} + (castPtr rPtr) + peek rPtr hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 357 -{- --- | On X11, sends an X ClientMessage event to all toplevel windows on --- @screen@. +#if GTK_CHECK_VERSION(2,14,0) +-- | Gets the height in millimeters of the specified monitor. hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 360 --- Toplevel windows are determined by checking for the WM_STATE property, as --- described in the Inter-Client Communication Conventions Manual (ICCCM). If --- no windows are found with the WM_STATE property set, the message is sent to --- all children of the root window. +-- * Available since Gdk version 2.14 hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 362 --- On Windows, broadcasts a message registered with the name --- GDK_WIN32_CLIENT_MESSAGE to all top-level windows. The amount of data is --- limited to one long, i.e. four bytes. +screenGetMonitorHeightMm :: Screen + -> Int -- ^ @monitorNum@ - number of the monitor + -> IO Int -- ^ returns the height of the monitor, or -1 if not available +screenGetMonitorHeightMm self monitorNum = + liftM fromIntegral $ + {# call gdk_screen_get_monitor_height_mm #} + self + (fromIntegral monitorNum) + +-- | Gets the width in millimeters of the specified monitor, if available. hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 373 -screenBroadcastClientMessage :: Screen - -> {-GdkEvent*-} -- ^ @event@ - the {GdkEvent, FIXME: unknown type\/value}. - -> IO () -screenBroadcastClientMessage self event = - {# call gdk_screen_broadcast_client_message #} +-- * Available since Gdk version 2.14 +-- +screenGetMonitorWidthMm :: Screen + -> Int -- ^ @monitorNum@ - number of the monitor + -> IO Int -- ^ returns the width of the monitor, or -1 if not available +screenGetMonitorWidthMm self monitorNum = + liftM fromIntegral $ + {# call gdk_screen_get_monitor_width_mm #} + self + (fromIntegral monitorNum) + +-- | Returns the output name of the specified monitor. Usually something like +-- VGA, DVI, or TV, not the actual product name of the display device. +-- +-- * Available since Gdk version 2.14 +-- +screenGetMonitorPlugName :: Screen + -> Int -- ^ @monitorNum@ - number of the monitor + -> IO (Maybe String) -- ^ returns a newly-allocated string containing the name of the + -- monitor, or @Nothing@ if the name cannot be determined +screenGetMonitorPlugName self monitorNum = + maybeNull readUTFString $ + {# call gdk_screen_get_monitor_plug_name #} hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 397 - {-event-} + (fromIntegral monitorNum) +#endif hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 400 +{- hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 420 +-- these are only used for the attributes +screenGetFontOptions :: Screen + -> IO (Maybe FontOptions) +screenGetFontOptions self = do + fPtr <- {# call gdk_screen_get_font_options #} self + if fPtr==nullPtr then return Nothing else liftM Just $ mkFontOptions (castPtr fPtr) + +screenSetFontOptions :: Screen + -> Maybe FontOptions + -> IO () +screenSetFontOptions self Nothing = + {# call gdk_screen_set_font_options #} self nullPtr +screenSetFontOptions self (Just options) = + withFontOptions options $ \fPtr -> + {# call gdk_screen_set_font_options #} self (castPtr fPtr) + hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 458 -{- --- | Returns a {GList, FIXME: struct type} of 'DrawWindow's representing the +-- | Returns a list of 'DrawWindow's representing the hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 464 --- function returns {@NULL@, FIXME: this should probably be converted to a --- Maybe data type}. +-- function returns @Nothing@. hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 466 --- On other platforms, this function may return {@NULL@, FIXME: this should --- probably be converted to a Maybe data type}, depending on whether it is +-- On other platforms, this function may return @Nothing@, depending on whether it is hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 469 --- The returned list is newly allocated and owns references to the windows --- it contains, so it should be freed using 'gListFree' and its windows unrefed --- using 'gObjectUnref' when no longer needed. --- hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 472 - -> IO [{- element type -}] -- ^ returns a list of 'DrawWindow's for the - -- current window stack, or {@NULL@, FIXME: this - -- should probably be converted to a Maybe data - -- type}. -screenGetWindowStack self = - {# call gdk_screen_get_window_stack #} - self - >>= fromGList - >>= mapM (\elemPtr -> {-marshal elem-}) + -> IO (Maybe [DrawWindow]) -- ^ returns a list of 'DrawWindow's for the + -- current window stack, or @Nothing@. +screenGetWindowStack self = do + lPtr <- {# call gdk_screen_get_window_stack #} self + if lPtr==nullPtr then return Nothing else liftM Just $ do + fromGList lPtr >>= mapM (constructNewGObject mkDrawWindow . return) hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 479 --} hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 483 -{- hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 485 -screenFontOptions :: Attr Screen {-gpointer-} -screenFontOptions = newAttrFrom{-gpointer-}Property "font-options" --} +screenFontOptions :: Attr Screen (Maybe FontOptions) +screenFontOptions = newAttr + screenGetFontOptions + screenSetFontOptions hunk ./gtk/Graphics/UI/Gtk/Gdk/Screen.chs.pp 523 + +#if GTK_CHECK_VERSION(2,14,0) +-- | The 'screenMonitorsChanged' signal is emitted when the number, size or +-- position of the monitors attached to the screen change. +-- +-- Only for X for now. Future implementations for Win32 and OS X may be a +-- possibility. +-- +-- * Available since Gdk version 2.14 +-- +screenMonitorsChanged :: ScreenClass self => Signal self (IO ()) +screenMonitorsChanged = Signal (connect_NONE__NONE "monitors-changed") +#endif |
From: Axel S. <si...@co...> - 2009-10-22 17:43:33
|
Thu Oct 22 05:49:36 EDT 2009 Axel Simon <Axe...@en...> * Bring apiGen up to scratch. This patch tries to fix the apiGen utility to at least run with the latest Gtk versions. There are still some flaws in the Makefile which is mainly due to me not understanding how it is all supposed to work. I have changed the paths from which files are downloaded which might have been a bit over- zealous. Furthermore, I do not understand how Gdk modules were supposed to be generated as this should be a side-effect of generating the Gtk modules. The patch also addresses some changes in the structure of the documentation xml files. hunk ./tools/apiGen/Makefile 37 -packages = glib pango atk gtk glade gconf sourceview +packages = glib pixbuf pango atk gtk glade gconf sourceview vte hunk ./tools/apiGen/Makefile 39 -gnome_platform_url = http://ftp.gnome.org/pub/gnome/platform/2.18/2.18.1/sources -gnome_desktop_url = http://ftp.gnome.org/pub/gnome/desktop/2.18/2.18.1/sources +gnome_sources_url = http://ftp.gnome.org/pub/gnome/sources hunk ./tools/apiGen/Makefile 41 -glib_version = 2.12.11 +glib_version = 2.22 +glib_step = 2 hunk ./tools/apiGen/Makefile 44 -glib_tar = glib-$(glib_version).tar.bz2 -glib_url = $(gnome_platform_url)/$(glib_tar) +glib_tar = glib-$(glib_version).$(glib_step).tar.bz2 +glib_url = $(gnome_sources_url)/$(glib_dir)/$(glib_version)/$(glib_tar) hunk ./tools/apiGen/Makefile 47 -pango_version = 1.16.2 +pixbuf_version = 0.22 +pixbuf_step = 0 +pixbuf_dir = gdk-pixbuf +pixbuf_tar = gdk-pixbuf-$(pixbuf_version).$(pixbuf_step).tar.bz2 +pixbuf_url = $(gnome_sources_url)/$(pixbuf_dir)/$(pixbuf_version)/$(pixbuf_tar) + +pango_version = 1.26 +pango_step = 0 hunk ./tools/apiGen/Makefile 56 -pango_tar = pango-$(pango_version).tar.bz2 -pango_url = $(gnome_platform_url)/$(pango_tar) +pango_tar = pango-$(pango_version).$(pango_step).tar.bz2 +pango_url = $(gnome_sources_url)/$(pango_dir)/$(pango_version)/$(pango_tar) hunk ./tools/apiGen/Makefile 59 -atk_version = 1.18.0 +atk_version = 1.28 +atk_step = 0 hunk ./tools/apiGen/Makefile 62 -atk_tar = atk-$(atk_version).tar.bz2 -atk_url = $(gnome_platform_url)/$(atk_tar) +atk_tar = atk-$(atk_version).$(atk_step).tar.bz2 +atk_url = $(gnome_sources_url)/$(atk_dir)/$(atk_version)/$(atk_tar) hunk ./tools/apiGen/Makefile 65 -gtk_version = 2.10.11 -gtk_dir = gtk -gtk_tar = gtk+-$(gtk_version).tar.bz2 -gtk_url = $(gnome_platform_url)/$(gtk_tar) +gtk_version = 2.18 +gtk_step = 3 +gtk_dir = gtk+ +gtk_tar = gtk+-$(gtk_version).$(gtk_step).tar.bz2 +gtk_url = $(gnome_sources_url)/$(gtk_dir)/$(gtk_version)/$(gtk_tar) hunk ./tools/apiGen/Makefile 71 -glade_version = 2.6.0 +glade_version = 2.12 +glade_step = 2 hunk ./tools/apiGen/Makefile 74 -glade_tar = libglade-$(glade_version).tar.bz2 -glade_url = $(gnome_platform_url)/$(glade_tar) +glade_tar = glade-$(glade_version).$(glade_step).tar.bz2 +glade_url = $(gnome_sources_url)/$(glade_dir)/$(glade_version)/$(glade_tar) hunk ./tools/apiGen/Makefile 77 -gconf_version = 2.18.0.1 -gconf_dir = gconf -gconf_tar = GConf-$(gconf_version).tar.bz2 -gconf_url = $(gnome_platform_url)/$(gconf_tar) +gconf_version = 2.28 +gconf_step = 0 +gconf_dir = GConf +gconf_tar = GConf-$(gconf_version).$(gconf_step).tar.bz2 +gconf_url = $(gnome_sources_url)/$(gconf_dir)/$(gconf_version)/$(gconf_tar) hunk ./tools/apiGen/Makefile 83 -sourceview_version = 1.8.5 -sourceview_dir = sourceview -sourceview_tar = gtksourceview-$(sourceview_version).tar.bz2 -sourceview_url = $(gnome_desktop_url)/$(sourceview_tar) +sourceview_version = 2.9 +sourceview_step = 1 +sourceview_dir = gtksourceview +sourceview_tar = gtksourceview-$(sourceview_version).$(sourceview_step).tar.bz2 +sourceview_url = $(gnome_sources_url)/$(sourceview_dir)/$(sourceview_version)/$(sourceview_tar) hunk ./tools/apiGen/Makefile 89 -vte_version = 0.16.1 +vte_version = 0.22 +vte_step = 2 hunk ./tools/apiGen/Makefile 92 -vte_tar = vte-$(vte_version).tar.bz2 -vte_url = $(gnome_desktop_url)/$(vte_tar) - -gtkhtml2_version = 2.6.3 -gtkhtml2_dir = gtkhtml2 -gtkhtml2_tar = libgtkhtml-$(gtkhtml2_version).tar.bz2 -gtkhtml2_url = $(gnome_desktop_url)/$(gtkhtml2_tar) - -gtkhtml3_version = 3.14.1 -gtkhtml3_dir = gtkhtml3 -gtkhtml3_tar = gtkhtml-$(gtkhtml3_version).tar.bz2 -gtkhtml3_url = $(gnome_desktop_url)/$(gtkhtml3_tar) - -gnome_version = 2.18.0 -gnome_dir = gnome -gnome_tar = libgnome-$(gnome_version).tar.bz2 -gnome_url = $(gnome_platform_url)/$(gnome_tar) - -gnomeui_version = 2.18.0 -gnomeui_dir = gnomeui -gnomeui_tar = libgnomeui-$(gnomeui_version).tar.bz2 -gnomeui_url = $(gnome_platform_url)/$(gnomeui_tar) - -gnomeprint_version = 2.17.92 -gnomeprint_dir = gnomeprint -gnomeprint_tar = libgnomeprint-$(gnomeprint_version).tar.bz2 -gnomeprint_url = $(gnome_platform_url)/$(gnomeprint_tar) - -gnomeprintui_version = 2.18.0 -gnomeprintui_dir = gnomeprintui -gnomeprintui_tar = libgnomeprintui-$(gnomeprintui_version).tar.bz2 -gnomeprintui_url = $(gnome_platform_url)/$(gnomeprintui_tar) - - -gnome_db_url = http://ftp.gnome.org/pub/gnome/sources/$(1)/1.3 - -gda_version = 1.3.1 -gda_dir = gda -gda_tar = libgda-$(gda_version).tar.bz2 -gda_url = $(call gnome_db_url,libgda)/$(gda_tar) - -gnomedb_version = 1.3.1 -gnomedb_dir = gnomedb -gnomedb_tar = libgnomedb-$(gnomedb_version).tar.bz2 -gnomedb_url = $(call gnome_db_url,libgnomedb)/$(gnomedb_tar) +vte_tar = vte-$(vte_version).$(vte_step).tar.bz2 +vte_url = $(gnome_sources_url)/$(vte_dir)/$(vte_version)/$(vte_tar) hunk ./tools/apiGen/Makefile 138 +################### +# +# Pixbuf modules +# + +pixbuf_docs_dirs = pixbuf/doc/xml +pixbuf_modprefix = Graphics.UI.Gtk.Gdk +pixbuf_scanmodules = gtk/Graphics/UI/Gtk/Gdk +pixbuf-modules : pixbuf-docs.xml + hunk ./tools/apiGen/Makefile 355 -% : tars/%.stamp +pkg-% : tars/%.stamp hunk ./tools/apiGen/Makefile 362 -get-source-code: $(packages) +get-source-code: $(addprefix pkg-,$(packages)) hunk ./tools/apiGen/format-docs.xsl 118 - <xsl:for-each select="refentry/refsect1[@role='details']/refsect2[title/anchor/@role='function']"> + <xsl:for-each select="refentry/refsect1[@role='details']/refsect2[@role='function']"> hunk ./tools/apiGen/mkdocxml.sh 8 -echo '<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" - "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ +echo '<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" + "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ hunk ./tools/apiGen/mkdocxml.sh 18 + <!ENTITY ast "*"> + <!ENTITY sol "/"> + <!ENTITY commat "@"> + <!ENTITY ldquo "“" ><!--=double quotation mark, left--> + <!ENTITY rdquo "”" ><!--=double quotation mark, right--> hunk ./tools/apiGen/mkdocxml.sh 33 - echo "<book filename=\"$(basename $DOC)\">" - cat $DOC - echo "</book>" + if `grep -q "<refentry" $DOC`; then + NUM=`grep -m1 -n "<refentry" $DOC | sed "s/\([0-9]*\):.*/\1/"`; + echo "<book filename=\"$(basename $DOC)\">" + tail -n+$NUM $DOC + #echo $DOC from line $NUM; + echo "</book>" + fi; hunk ./tools/apiGen/src/Docs.hs 302 + "section" -> DocOtherXRef text hunk ./tools/apiGen/src/Module.hs 728 + } = True + -- this is a bad hack to prevent a wonky attribute from spoiling the translation + isConstructOnly Decl { + decl_body = AttributeProp { + attribute_constructonly = False, + attribute_readable = False, + attribute_writeable = False + } |
From: Andy S. <And...@co...> - 2009-10-12 12:39:02
|
Mon Oct 12 08:36:21 EDT 2009 Andy Stewart <laz...@gm...> * Add notes that how to function `windowSetTransientFor` with fullscreen-window. Ignore-this: 3ba0f2b28b10b027088697639198dc98 hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 531 +-- Note that if you want to show a window @self@ on top of a full-screen window @parent@, you need to +-- turn the @self@ window into a dialog (using 'windowSetTypeHint' with 'WindowTypeHintDialog'). [_$_] +-- Otherwise the @parent@ window will always cover the @self@ window. +-- |
From: Axel S. <si...@co...> - 2009-10-11 21:18:31
|
Sat Oct 10 17:41:30 EDT 2009 ar...@rp... * UncommentGValueCharFunctions Ignore-this: 40983acf515caedccf561ebb50bd927a hunk ./glib/System/Glib/GValueTypes.chs 25 --- This is used by the implementation of properties and by the [_$_] +-- This is used by the implementation of properties and by the hunk ./glib/System/Glib/GValueTypes.chs 38 --- valueSetUChar, --- valueGetUChar, --- valueSetChar, --- valueGetChar, + valueSetUChar, + valueGetUChar, + valueSetChar, + valueGetChar, hunk ./glib/System/Glib/GValueTypes.chs 112 -{- hunk ./glib/System/Glib/GValueTypes.chs 114 - {# call unsafe value_set_uchar #} gvalue value + {# call unsafe value_set_uchar #} gvalue (fromIntegral value) hunk ./glib/System/Glib/GValueTypes.chs 118 - {# call unsafe value_get_uchar #} gvalue + liftM fromIntegral $ {# call unsafe value_get_uchar #} gvalue hunk ./glib/System/Glib/GValueTypes.chs 120 -valueSetChar :: GValue -> {#type gchar#} -> IO () +--these belong somewhere else, are in new c2hs's C2HS module +cToEnum :: (Integral i, Enum e) => i -> e +cToEnum = toEnum . fromIntegral + +cFromEnum :: (Enum e, Integral i) => e -> i +cFromEnum = fromIntegral . fromEnum + +--valueSetChar :: GValue -> {#type gchar#} -> IO () +valueSetChar :: GValue -> Char -> IO () hunk ./glib/System/Glib/GValueTypes.chs 130 - {# call unsafe value_set_char #} gvalue value + {# call unsafe value_set_char #} gvalue (cFromEnum value) hunk ./glib/System/Glib/GValueTypes.chs 132 -valueGetChar :: GValue -> IO {#type gchar#} +--valueGetChar :: GValue -> IO {#type gchar#} +valueGetChar :: GValue -> IO Char hunk ./glib/System/Glib/GValueTypes.chs 135 - {# call unsafe value_get_char #} gvalue --} + liftM cToEnum $ {# call unsafe value_get_char #} gvalue hunk ./glib/System/Glib/GValueTypes.chs 254 + |
From: Andy S. <And...@co...> - 2009-10-08 03:32:43
|
Wed Oct 7 20:57:44 EDT 2009 Andy Stewart <laz...@gm...> * Create Windows/Invisible.chs.pp (GtkInvisible) and fix docs of Notebook.chs.pp. Ignore-this: 953ca96f67b460d57b083d3409af0587 hunk ./Makefile.am 779 + gtk/Graphics/UI/Gtk/Windows/Invisible.chs.pp \ hunk ./gtk/Graphics/UI/Gtk.hs.pp 70 + module Graphics.UI.Gtk.Windows.Invisible, hunk ./gtk/Graphics/UI/Gtk.hs.pp 256 +import Graphics.UI.Gtk.Windows.Invisible hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 1148 --- | The "arrow-spacing" property defines the spacing between the scroll arrows and the tabs. +-- | The 'notebookStyleArrowSpacing" property defines the spacing between the scroll arrows and the tabs. hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 1159 --- | The "has-backward-stepper" property determines whether the standard backward arrow button is displayed. +-- | The 'notebookStyleHasBackwardStepper' property determines whether the standard backward arrow button is displayed. hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 1168 --- | The "has-forward-stepper" property determines whether the standard forward arrow button is displayed. +-- | The 'notebookStyleHasForwardStepper' property determines whether the standard forward arrow button is displayed. hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 1177 --- | The "has-secondary-backward-stepper" property determines whether a second backward arrow button is displayed on the opposite end of the tab area. +-- | The 'notebookStyleHasSecondaryBackwardStepper' property determines whether a second backward arrow button is displayed on the opposite end of the tab area. hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 1186 --- | The "has-secondary-forward-stepper" property determines whether a second forward arrow button is displayed on the opposite end of the tab area. +-- | The 'notebookStyleHasSecondaryForwardStepper' property determines whether a second forward arrow button is displayed on the opposite end of the tab area. hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 1195 --- | The "tab-curvature" property defines size of tab curvature. +-- | The 'notebookStyleTabCurvature' property defines size of tab curvature. hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 1206 --- | The "tab-overlap" property defines size of tab overlap area. +-- | The 'notebookStyleTabOverlap' property defines size of tab overlap area. addfile ./gtk/Graphics/UI/Gtk/Windows/Invisible.chs.pp hunk ./gtk/Graphics/UI/Gtk/Windows/Invisible.chs.pp 1 +-- -*-haskell-*- +-- GIMP Toolkit (GTK) Window +-- +-- Author : Andy Stewart +-- +-- Created: 7 Oct 2009 +-- +-- Copyright (C) 2009 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 2.1 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. +-- +-- | +-- Maintainer : gtk...@li... +-- Stability : provisional +-- Portability : portable (depends on GHC) +-- +-- A widget which is not displayed [_$_] +-- The 'Invisible' widget is used internally in GTK+, and is probably not very useful for application developers. +-- It is used for reliable pointer grabs and selection handling in the code for drag-and-drop. +-- +module Graphics.UI.Gtk.Windows.Invisible ( + +-- * Class Hierarchy +-- | +-- @ +-- | 'GObject' +-- | +----'Object' +-- | +----'Widget' +-- | +----Invisible +-- @ + +-- * Types + Invisible, + +-- * Constructors + invisibleNew, [_$_] + invisibleNewForScreen, + +-- * Methods + invisibleSetScreen, + invisibleGetScreen, + ) where + +import Control.Monad (liftM) + +import System.Glib.FFI +import System.Glib.UTFString +import System.Glib.GError +import System.Glib.Attributes +import System.Glib.Properties +import System.Glib.GList (fromGList, toGList) +import System.Glib.GObject (makeNewGObject) +import Graphics.UI.Gtk.Abstract.Object (makeNewObject) +import Graphics.UI.Gtk.General.Enums +import Graphics.UI.Gtk.Gdk.Screen +{#import Graphics.UI.Gtk.Types#} +{#import Graphics.UI.Gtk.Gdk.Enums#} (Modifier(..)) + +{# context lib="gtk" prefix="gtk" #} + +-------------------- +-- Constructors +-- | Creates a new 'Invisible'. +-- +invisibleNew :: IO Invisible +invisibleNew = + makeNewObject mkInvisible $ + liftM (castPtr :: Ptr Widget -> Ptr Invisible) $ + {# call invisible_new #} + +-- | Creates a new 'Invisible' object for a specified screen +-- +-- * Available since Gdk version 2.2 +-- +invisibleNewForScreen :: [_$_] + Screen -- ^ @screen@ - a 'Screen' which identifies on which the new 'Invisible' will be created. [_$_] + -> IO Invisible +invisibleNewForScreen screen = + makeNewObject mkInvisible $ + liftM (castPtr :: Ptr Widget -> Ptr Invisible) $ + {# call invisible_new_for_screen #} screen + [_$_] +-- | Sets the 'Screen' where the 'Invisible' object will be displayed. +-- +-- * Available since Gdk version 2.2 +-- +invisibleSetScreen :: Invisible [_$_] + -> Screen -- ^ @screen@ - the 'Screen' to set + -> IO () +invisibleSetScreen invisible screen = + {# call invisible_set_screen #} invisible screen + [_$_] +-- | Returns the 'Screen' object associated with invisible [_$_] +-- +-- * Available since Gdk version 2.2 +-- +invisibleGetScreen :: Invisible + -> IO Screen +invisibleGetScreen invisible = [_$_] + makeNewGObject mkScreen $ + {# call invisible_get_screen #} invisible + |
From: Andy S. <And...@co...> - 2009-10-07 16:58:22
|
Wed Oct 7 11:34:05 EDT 2009 Andy Stewart <laz...@gm...> * Update modules (Dialog, Label, Notebook) to Gtk+ 2.16 and fix docs in previous patch. Ignore-this: 9b7858f831226301fbc0493a8de4c820 hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 4 --- Author : Manuel M. T. Chakravarty, Axel Simon +-- Author : Manuel M. T. Chakravarty, Axel Simon, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 9 +-- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 139 --- labelSetAttributes, + labelSetAttributes, + labelGetAttributes, hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 148 + labelSetLineWrapMode, + labelGetLineWrapMode, hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 174 + labelWrapMode, hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 177 + labelMnemonicKeyval, + labelPattern, hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 186 + labelAttributes, hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 200 +import Graphics.UI.Gtk.Pango.Layout hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 202 +{#import Graphics.UI.Gtk.Pango.Types#} hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 204 +import Graphics.UI.Gtk.Pango.Attributes ( withAttrList, fromAttrList) hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 282 -{- --- | Set the text attributes. +-- | Sets a PangoAttrList; the attributes in the list are applied to the label text. hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 284 --- labelSetAttributes :: LabelClass l => PangoAttrList -> IO () --} +-- Note +-- +-- The attributes set with this function will be applied and merged with any other attributes previously effected by way of the "use-underline" or "use-markup" properties. While it is not recommended to mix markup strings with manually set attributes, if you must; know that the attributes will be applied to the label after the markup string is parsed. +-- +labelSetAttributes :: LabelClass self => self [_$_] + -> [PangoAttribute] -- ^ @attr@ 'PangoAttribute' + -> IO () +labelSetAttributes self attrs = do + txt <- labelGetText self + ps <- makeNewPangoString txt + withAttrList ps attrs $ \alPtr -> + {#call unsafe label_set_attributes #} (toLabel self) alPtr + +-- | Gets the attribute list that was set on the label using 'labelSetAttributes', if any. [_$_] +-- This function does not reflect attributes that come from the labels markup (see 'labelSetMarkup'). [_$_] +-- If you want to get the effective attributes for the label, use 'layoutGetAttributes' ('labelGetLayout' (label)). +-- +labelGetAttributes :: LabelClass self => self + -> IO [PangoAttribute] -- ^ return the attribute list, or Emtpy if none was set. [_$_] +labelGetAttributes self = do + txt <- labelGetText self + (PangoString correct _ _ ) <- makeNewPangoString txt + attrListPtr <- {# call unsafe label_get_attributes #} (toLabel self) + attr <- fromAttrList correct attrListPtr + return $ concat attr hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 409 +-- | If line wrapping is on (see 'labelSetLineWrap') this controls how the line wrapping is done. [_$_] +-- The default is 'WrapWholeWords' which means wrap on word boundaries. +-- +-- * Available since Gtk+ version 2.10 +-- +labelSetLineWrapMode :: LabelClass self => self + -> LayoutWrapMode -- ^ @wrapMode@ - the line wrapping mode [_$_] + -> IO () +labelSetLineWrapMode self wrapMode = + {# call label_set_line_wrap_mode #} + (toLabel self) + (fromIntegral (fromEnum wrapMode)) + +-- | Returns line wrap mode used by the label. See 'labelSetLineWrapMode'. +-- +-- * Available since Gtk+ version 2.10 +-- +labelGetLineWrapMode :: LabelClass self => self + -> IO LayoutWrapMode -- ^ return the line wrapping mode +labelGetLineWrapMode self = liftM (toEnum . fromIntegral) $ [_$_] + {# call label_get_line_wrap_mode #} + (toLabel self) + hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 777 --- allocation. See 'Misc'::xalign for that. +-- allocation. [_$_] hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 793 +-- | If line wrapping is on (see the "wrap" property) this controls how the line wrapping is done. [_$_] +-- The default is 'WrapWholeWords', which means wrap on word boundaries. +-- +-- Default value: 'WrapWholeWords' +-- +-- * Available since Gtk+ version 2.10 +-- +labelWrapMode :: LabelClass self => Attr self LayoutWrapMode +labelWrapMode = newAttrFromEnumProperty "wrap-mode" + {# call pure unsafe gtk_label_get_type #} + hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 820 +-- | The mnemonic accelerator key for this label. +-- +-- Default value: 16777215 +-- +labelMnemonicKeyval :: LabelClass self => ReadAttr self Int +labelMnemonicKeyval = readAttrFromIntProperty "mnemonic-keyval" + +-- | A string with _ characters in positions correspond to characters in the text to underline. +-- +-- Default value: "\\" +-- +labelPattern :: LabelClass self => WriteAttr self String +labelPattern = writeAttrFromStringProperty "pattern" + hunk ./gtk/Graphics/UI/Gtk/Display/Label.chs.pp 913 +-- | A list of style attributes to apply to the text of the label. +labelAttributes :: LabelClass self => Attr self [PangoAttribute] +labelAttributes = newAttr + labelGetAttributes + labelSetAttributes + hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 4 --- Author : Axel Simon +-- Author : Axel Simon, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 9 +-- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 23 --- The signals focus-tab and select-page are not bound because it is unclear --- what they mean. As far as I can see they are not emitted anywhere. +-- Functions: +-- gtk_notebook_set_group +-- gtk_notebook_get_group +-- gtk_notebook_set_window_creation_hook +-- Attributes: +-- group +-- Signals: +-- createWindow +-- focusTab +-- switchPage +-- +-- NOTE +-- +-- Don't binding `group-id` attribute, even set/get_group_id functions is deprecated) hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 71 + NotebookPage, hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 125 + notebookSetTabReorderable, + notebookGetTabReorderable, + notebookSetTabDetachable, + notebookGetTabDetachable, hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 149 + notebookChildDetachable, + notebookChildReorderable, + notebookChildTabExpand, + notebookChildTabFill, + +-- * Style Attributes + notebookStyleArrowSpacing, + notebookStyleHasBackwardStepper, + notebookStyleHasForwardStepper, + notebookStyleHasSecondaryBackwardStepper, + notebookStyleHasSecondaryForwardStepper, + notebookStyleTabCurvature, + notebookStyleTabOverlap, hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 164 + changeCurrentPage, + moveFocusOut, + pageAdded, + pageRemoved, + pageReordered, + reorderTab, + selectPage, + +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 176 +#endif hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 192 - PackType(..), PositionType(..)) + PackType(..), PositionType(..), DirectionType(..)) hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 196 +{#pointer *GtkNotebookPage as NotebookPage foreign newtype #} + hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 918 +-- | Sets whether the notebook tab can be reordered via drag and drop or not. +-- +-- * Available since Gtk version 2.10 +-- +notebookSetTabReorderable :: (NotebookClass self, WidgetClass child) => self + -> child -- ^ @child@ - a child page + -> Bool -- ^ @reorderable@ - whether the tab is reorderable or not. [_$_] + -> IO () +notebookSetTabReorderable self child reorderable = + {# call notebook_set_tab_reorderable #} + (toNotebook self) + (toWidget child) + (fromBool reorderable) + +-- | Gets whether the tab can be reordered via drag and drop or not. +-- +-- * Available since Gtk version 2.10 +-- +notebookGetTabReorderable :: (NotebookClass self, WidgetClass child) => self + -> child -- ^ @child@ - the child page + -> IO Bool -- ^ return @True@ if the tab is reorderable. [_$_] +notebookGetTabReorderable self child = liftM toBool $ + {# call notebook_get_tab_reorderable #} + (toNotebook self) + (toWidget child) + +-- | Sets whether the tab can be detached from notebook to another notebook or widget. +-- +-- Note that 2 notebooks must share a common group identificator (see gtk_notebook_set_group_id()) to allow automatic tabs interchange between them. +-- +-- If you want a widget to interact with a notebook through DnD (i.e.: accept dragged tabs from it) it must be set as a drop destination and accept the target "GTK_NOTEBOOK_TAB". [_$_] +-- The notebook will fill the selection with a GtkWidget** pointing to the child widget that corresponds to the dropped tab. +-- +-- If you want a notebook to accept drags from other widgets, you will have to set your own DnD code to do it. +-- +-- * Available since Gtk version 2.10 +-- +notebookSetTabDetachable :: (NotebookClass self, WidgetClass child) => self + -> child -- ^ @child@ - the child page + -> Bool -- ^ @detachable@ - whether the tab is detachable or not [_$_] + -> IO () +notebookSetTabDetachable self child detachable = + {# call notebook_set_tab_detachable #} + (toNotebook self) + (toWidget child) + (fromBool detachable) + +-- | Returns whether the tab contents can be detached from notebook. +-- +-- * Available since Gtk version 2.10 +-- +notebookGetTabDetachable :: (NotebookClass self, WidgetClass child) => self + -> child -- ^ @child@ - the child page + -> IO Bool -- ^ return @True@ if the tab is detachable. [_$_] +notebookGetTabDetachable self child = liftM toBool $ [_$_] + {# call notebook_get_tab_detachable #} + (toNotebook self) + (toWidget child) + hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 1120 +-- | Whether the tab is detachable. +-- +-- Default value: @False@ +-- +notebookChildDetachable :: NotebookClass self => Attr self Bool +notebookChildDetachable = newAttrFromBoolProperty "detachable" + +-- | Whether the tab is reorderable by user action or not. +-- +-- Default value: @False@ +-- +notebookChildReorderable :: NotebookClass self => Attr self Bool +notebookChildReorderable = newAttrFromBoolProperty "reorderable" + +-- | Whether to expand the child's tab or not. +-- +-- Default value : @False@ +-- +notebookChildTabExpand :: NotebookClass self => Attr self Bool +notebookChildTabExpand = newAttrFromBoolProperty "tab-expand" + +-- | Whether the child's tab should fill the allocated area or not. +-- +-- Default value : @False@ +-- +notebookChildTabFill :: NotebookClass self => Attr self Bool +notebookChildTabFill = newAttrFromBoolProperty "tab-fill" + +-- | The "arrow-spacing" property defines the spacing between the scroll arrows and the tabs. +-- +-- Allowed values: >= 0 +-- +-- Default value: 0 +-- +-- * Available since Gtk version 2.10 +-- +notebookStyleArrowSpacing :: NotebookClass self => ReadAttr self Bool +notebookStyleArrowSpacing = readAttrFromBoolProperty "arrow-spacing" + +-- | The "has-backward-stepper" property determines whether the standard backward arrow button is displayed. +-- +-- Default value: @True@ +-- +-- * Available since Gtk version 2.4 +-- +notebookStyleHasBackwardStepper :: NotebookClass self => ReadAttr self Bool +notebookStyleHasBackwardStepper = readAttrFromBoolProperty "has-backward-stepper" + +-- | The "has-forward-stepper" property determines whether the standard forward arrow button is displayed. +-- +-- Default value : @True@ +-- +-- * Available since Gtk version 2.4 +-- +notebookStyleHasForwardStepper :: NotebookClass self => ReadAttr self Bool +notebookStyleHasForwardStepper = readAttrFromBoolProperty "has-forward-stepper" + +-- | The "has-secondary-backward-stepper" property determines whether a second backward arrow button is displayed on the opposite end of the tab area. +-- +-- Default value: @False@ +-- +-- * Available since Gtk version 2.4 +-- +notebookStyleHasSecondaryBackwardStepper :: NotebookClass self => ReadAttr self Bool +notebookStyleHasSecondaryBackwardStepper = readAttrFromBoolProperty "has-secondary-backward-stepper" + +-- | The "has-secondary-forward-stepper" property determines whether a second forward arrow button is displayed on the opposite end of the tab area. +-- +-- Default value: @False@ +-- +-- * Available since Gtk version 2.4 +-- +notebookStyleHasSecondaryForwardStepper :: NotebookClass self => ReadAttr self Bool +notebookStyleHasSecondaryForwardStepper = readAttrFromBoolProperty "has-secondary-forward-stepper" + +-- | The "tab-curvature" property defines size of tab curvature. +-- +-- Allowed values: >= 0 +-- +-- Default value: 1 +-- +-- * Available since Gtk version 2.10 +-- +notebookStyleTabCurvature :: NotebookClass self => ReadAttr self Int +notebookStyleTabCurvature = readAttrFromIntProperty "tab-curvature" + +-- | The "tab-overlap" property defines size of tab overlap area. +-- +-- Default value: 2 +-- +-- * Available since Gtk version 2.10 +-- +notebookStyleTabOverlap :: NotebookClass self => ReadAttr self Int +notebookStyleTabOverlap = readAttrFromIntProperty "tab-overlap" + hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 1218 +-- | [_$_] +-- +changeCurrentPage :: NotebookClass self => Signal self (Int -> IO Bool) +changeCurrentPage = Signal (connect_INT__BOOL "change_current_page") + +-- | +-- +moveFocusOut :: NotebookClass self => Signal self (DirectionType -> IO ()) +moveFocusOut = Signal (connect_ENUM__NONE "move_focus_out") + +-- | The 'pageAdded' signal is emitted in the notebook right after a page is added to the notebook. +-- +pageAdded :: NotebookClass self => Signal self (Widget -> Int -> IO ()) +pageAdded = Signal (connect_OBJECT_INT__NONE "page_added") + +-- | The 'pageRemoved' signal is emitted in the notebook right after a page is removed from the notebook. +-- +pageRemoved :: NotebookClass self => Signal self (Widget -> Int -> IO ()) +pageRemoved = Signal (connect_OBJECT_INT__NONE "page_removed") + +-- | The 'pageReordered' signal is emitted in the notebook right after a page has been reordered. +-- +pageReordered :: NotebookClass self => Signal self (Widget -> Int -> IO ()) +pageReordered = Signal (connect_OBJECT_INT__NONE "page_reordered") + +-- | +-- +reorderTab :: NotebookClass self => Signal self (DirectionType -> Bool -> IO Bool) +reorderTab = Signal (connect_ENUM_BOOL__BOOL "reorder_tab") + +-- | +-- +selectPage :: NotebookClass self => Signal self (Bool -> IO Bool) +selectPage = Signal (connect_BOOL__BOOL "select_page") + +-- * Deprecated +#ifndef DISABLE_DEPRECATED + hunk ./gtk/Graphics/UI/Gtk/Layout/Notebook.chs.pp 1267 + +#endif hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 4 --- Author : Axel Simon +-- Author : Axel Simon, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 9 +-- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 27 +-- [_$_] +-- NOTE: [_$_] +-- Now FFI haven't support variadic function `gtk_dialog_set_alternative_button_order` hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 117 + dialogGetResponseForWidget, + alternativeDialogButtonOrder, + dialogSetAlternativeButtonOrderFromArray, hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 123 + dialogActionAreaBorder, + dialogButtonSpacing, + dialogContentAreaBorder, + dialogContentAreaSpacing, hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 129 + close, + response, + +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 136 +#endif hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 144 +import System.Glib.Properties hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 298 +-- | Gets the response id of a widget in the action area of a dialog. +dialogGetResponseForWidget :: (DialogClass self, WidgetClass widget) => self + -> widget -- ^ @widget@ - a widget in the action area of dialog [_$_] + -> IO Int -- ^ return the response id of widget, or 'ResponseNone' if widget doesn't have a response id set. [_$_] +dialogGetResponseForWidget self widget = liftM fromIntegral $ + {# call dialog_get_response_for_widget #} + (toDialog self) + (toWidget widget) + +-- | Returns @True@ if dialogs are expected to use an alternative button order on the screen screen. [_$_] +-- See 'dialogSetAlternativeButtonOrder' for more details about alternative button order. +-- +-- If you need to use this function, you should probably connect to the 'alternativeButtonOrder' signal on the GtkSettings object associated to screen, in order to be notified if the button order setting changes. +-- +-- * Available since Gtk+ version 2.6 +-- +alternativeDialogButtonOrder :: [_$_] + Maybe Screen -- ^ @screen@ - a 'Screen', or @Nothing@ to use the default screen [_$_] + -> IO Bool -- ^ return Whether the alternative button order should be used [_$_] +alternativeDialogButtonOrder (Just screen) = liftM toBool $ + {# call alternative_dialog_button_order #} screen +alternativeDialogButtonOrder Nothing = liftM toBool $ + {# call alternative_dialog_button_order #} (mkScreen nullForeignPtr) + +-- | Sets an alternative button order. [_$_] +-- If the 'alternativeButtonOrder' setting is set to @True@, the dialog buttons are reordered according to the order of the response ids in new_order. +-- +-- See 'dialogSetAlternativeButtonOrder' for more information. +-- +-- This function is for use by language bindings. +-- +-- * Available since Gtk+ version 2.6 +-- +dialogSetAlternativeButtonOrderFromArray :: DialogClass self => self + -> Int -- ^ @nParams@ - the number of response ids in new_order [_$_] + -> [Int] -- ^ @newOrder@ - an array of response ids of dialog's buttons [_$_] + -> IO () +dialogSetAlternativeButtonOrderFromArray self nParams newOrder = [_$_] + withArray (map fromIntegral newOrder) $ \newOrderPtr -> + {# call dialog_set_alternative_button_order_from_array #} + (toDialog self) + (fromIntegral nParams) + newOrderPtr + hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 354 +-- | Width of border around the button area at the bottom of the dialog. +-- +-- Allowed values: >= 0 +-- +-- Default value: 5 +-- +dialogActionAreaBorder :: DialogClass self => ReadAttr self Int +dialogActionAreaBorder = readAttrFromIntProperty "action-area-border" + +-- | Spacing between buttons. +-- +-- Allowed values: >= 0 +-- +-- Default value: 6 +-- +dialogButtonSpacing :: DialogClass self => ReadAttr self Int +dialogButtonSpacing = readAttrFromIntProperty "button-spacing" + +-- | Width of border around the main dialog area. +-- +-- Allowed values: >= 0 +-- +-- Default value: 2 +-- +dialogContentAreaBorder :: DialogClass self => ReadAttr self Int +dialogContentAreaBorder = readAttrFromIntProperty "content-area-border" + +-- | The default spacing used between elements of the content area of the dialog, [_$_] +-- as returned by 'dialogSetContentArea', unless 'boxSetSpacing' was called on that widget directly. +-- +-- Allowed values: >= 0 +-- +-- Default value: 0 +-- +-- * Available since Gtk+ version 2.16 +-- +dialogContentAreaSpacing :: DialogClass self => ReadAttr self Int +dialogContentAreaSpacing = readAttrFromIntProperty "content-area-spacing" + hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 395 +close :: DialogClass self => Signal self (IO ()) +close = Signal (connect_NONE__NONE "close") hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 398 +response :: DialogClass self => Signal self (Int -> IO ()) +response = Signal (connect_INT__NONE "response") + +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Windows/Dialog.chs.pp 413 - +#endif hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 472 --- This is normally called by the default ::key_press_event handler for toplevel windows, [_$_] +-- This is normally called by the default 'keyPressEvent' handler for toplevel windows, [_$_] hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 484 --- This is normally called by the default ::key_press_event and ::key_release_event handlers for toplevel windows, [_$_] +-- This is normally called by the default 'keyPressEvent' and 'keyReleaseEvent' handlers for toplevel windows, [_$_] hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 1236 --- The list is copied, but the reference count on each member won't be incremented. hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 1256 --- The list is a copy and should be freed with 'listFree', but the pixbufs in the list have not had their reference count incremented. hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 2117 --- | The ::activate-default signal is a keybinding signal which gets emitted when the user activates the default widget of window. +-- | The 'activateDefault' signal is a keybinding signal which gets emitted when the user activates the default widget of window. hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 2121 --- | The ::activate-default signal is a keybinding signal which gets emitted when the user activates the currently focused widget of window. +-- | The 'activateDefault' signal is a keybinding signal which gets emitted when the user activates the currently focused widget of window. hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 2130 --- | The ::keys-changed signal gets emitted when the set of accelerators or mnemonics that are associated with window changes. +-- | The 'keysChanged' signal gets emitted when the set of accelerators or mnemonics that are associated with window changes. hunk ./tools/callbackGen/gtkmarshal.list 131 +# for Notebook +NONE:OBJECT,INT +BOOLEAN:ENUM,BOOLEAN +NONE:BOXED,INT |
From: Axel S. <si...@co...> - 2009-10-07 14:43:59
|
Tue Oct 6 08:06:59 EDT 2009 Andy Stewart <laz...@gm...> * Update Multiline modules signals and Update Window/WindowGroup modules to Gtk+ 2.16 Ignore-this: 31d7c20ba557bed65a92d6c9adb2d883 hunk ./gtk/Graphics/UI/Gtk.hs.pp 292 - afterToggleOverwrite, onToggleOverwrite) + afterToggleOverwrite, onToggleOverwrite, setScrollAdjustments) hunk ./gtk/Graphics/UI/Gtk/General/Enums.chs.pp 4 --- Author : Axel Simon, Manuel Chakravarty, Andy Stewart +-- Author : Axel Simon, Manuel Chakravarty hunk ./gtk/Graphics/UI/Gtk/General/Enums.chs.pp 9 --- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 147 + applyTag, + beginUserAction, + bufferChanged, + deleteRange, + endUserAction, + insertPixbuf, + insertChildAnchor, + bufferInsertText, + markDeleted, + markSet, + modifiedChanged, + pasteDone, + removeTag, + +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 189 +#endif hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1091 +applyTag :: TextBufferClass self => Signal self (TextTag -> TextIter -> TextIter -> IO ()) [_$_] +applyTag = Signal (connect_OBJECT_BOXED_BOXED__NONE "apply-tag" mkTextIterCopy mkTextIterCopy) + +beginUserAction :: TextBufferClass self => Signal self (IO ()) +beginUserAction = Signal (connect_NONE__NONE "begin_user_action") + +bufferChanged :: TextBufferClass self => Signal self (IO ()) +bufferChanged = Signal (connect_NONE__NONE "changed") + +deleteRange :: TextBufferClass self => Signal self (TextIter -> TextIter -> IO ()) +deleteRange = Signal (connect_BOXED_BOXED__NONE "delete_range" mkTextIterCopy mkTextIterCopy) + +endUserAction :: TextBufferClass self => Signal self (IO ()) +endUserAction = Signal (connect_NONE__NONE "end_user_action") + +insertPixbuf :: TextBufferClass self => Signal self (TextIter -> Pixbuf -> IO ()) +insertPixbuf = Signal (connect_BOXED_OBJECT__NONE "insert_pixbuf" mkTextIterCopy) + +insertChildAnchor :: TextBufferClass self => Signal self (TextIter -> TextChildAnchor -> IO ()) +insertChildAnchor = Signal (connect_BOXED_OBJECT__NONE "insert_child_anchor" mkTextIterCopy) + +bufferInsertText :: TextBufferClass self => Signal self (TextIter -> String -> IO ()) +bufferInsertText = Signal (connect_BOXED_STRING__NONE "insert_text" mkTextIterCopy) + +markDeleted :: TextBufferClass self => Signal self (TextMark -> IO ()) +markDeleted = Signal (connect_OBJECT__NONE "mark_deleted") + +markSet :: TextBufferClass self => Signal self (TextIter -> TextMark -> IO ()) +markSet = Signal (connect_BOXED_OBJECT__NONE "mark_set" mkTextIterCopy) + +modifiedChanged :: TextBufferClass self => Signal self (IO ()) +modifiedChanged = Signal (connect_NONE__NONE "modified_changed") + +pasteDone :: TextBufferClass self => Signal self (Clipboard -> IO ()) +pasteDone = Signal (connect_OBJECT__NONE "paste_done") + +removeTag :: TextBufferClass self => Signal self (TextTag -> TextIter -> TextIter -> IO ()) +removeTag = Signal (connect_OBJECT_BOXED_BOXED__NONE "remove_tag" mkTextIterCopy mkTextIterCopy) + +-------------------- +-- Deprecated Signals and Events + +#ifndef DISABLE_DEPRECATED + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1264 - hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1265 +#endif hunk ./gtk/Graphics/UI/Gtk/Multiline/TextMark.chs 4 --- Author : Axel Simon, Andy Stewart +-- Author : Axel Simon hunk ./gtk/Graphics/UI/Gtk/Multiline/TextMark.chs 9 --- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 4 --- Author : Duncan Coutts, Andy Stewart +-- Author : Duncan Coutts hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 9 --- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 72 - makeNewTextAttributes, --internal + makeNewTextAttributes, -- internal hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 144 + event, + +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 149 +#endif hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 247 +-- | This function is use internal for transform TextAttributes. +-- Don't expoert this function. hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 740 +-------------------- +-- Signals +-- | An event has occurred that affects the given tag. +-- +-- * Adding an event handler to the tag makes it possible to react on +-- e.g. mouse clicks to implement hyperlinking. +-- +event :: TextTagClass self => Signal self (Event -> TextIter -> IO Bool) +event = Signal (connect_BOXED_BOXED__BOOL "event" marshalEvent mkTextIterCopy) + +-------------------- +-- Deprecated Signals and Events + +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 766 +#endif hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 4 --- Author : Axel Simon, Andy Stewart +-- Author : Axel Simon hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 9 --- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 159 + backspace, + copyClipboard, + cutClipboard, + deleteFromCursor, + insertAtCursor, + moveCursor, + moveViewport, + moveFocus, + pageHorizontally, + pasteClipboard, + populatePopup, + setAnchor, + setScrollAdjustments, + toggleCursorVisible, + toggleOverwrite, + +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 207 +#endif hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 1186 +backspace :: TextBufferClass self => Signal self (IO ()) +backspace = Signal (connect_NONE__NONE "on_backspace") + +copyClipboard :: TextBufferClass self => Signal self (IO ()) +copyClipboard = Signal (connect_NONE__NONE "copy_clipboard") + +cutClipboard :: TextBufferClass self => Signal self (IO ()) +cutClipboard = Signal (connect_NONE__NONE "cut_clipboard") + +deleteFromCursor :: TextBufferClass self => Signal self (DeleteType -> Int -> IO ()) +deleteFromCursor = Signal (connect_ENUM_INT__NONE "delete_from_cursor") + +insertAtCursor :: TextBufferClass self => Signal self (String -> IO ()) +insertAtCursor = Signal (connect_STRING__NONE "insert_at_cursor") + +moveCursor :: TextBufferClass self => Signal self (MovementStep -> Int -> Bool -> IO ()) +moveCursor = Signal (connect_ENUM_INT_BOOL__NONE "move_cursor") + +moveViewport :: TextBufferClass self => Signal self (ScrollStep -> Int -> IO ()) +moveViewport = Signal (connect_ENUM_INT__NONE "move_viewport") + +moveFocus :: TextBufferClass self => Signal self (DirectionType -> IO ()) +moveFocus = Signal (connect_ENUM__NONE "move_focus") + +pageHorizontally :: TextBufferClass self => Signal self (Int -> Bool -> IO ()) +pageHorizontally = Signal (connect_INT_BOOL__NONE "page_horizontally") + +pasteClipboard :: TextBufferClass self => Signal self (IO ()) +pasteClipboard = Signal (connect_NONE__NONE "paste_clipboard") + +populatePopup :: TextBufferClass self => Signal self (Menu -> IO ()) +populatePopup = Signal (connect_OBJECT__NONE "populate_popup") + +setAnchor :: TextBufferClass self => Signal self (IO ()) +setAnchor = Signal (connect_NONE__NONE "set_anchor") + +setScrollAdjustments :: TextBufferClass self => Signal self (Adjustment -> Adjustment -> IO ()) +setScrollAdjustments = Signal (connect_OBJECT_OBJECT__NONE "set_scroll_adjustments") + +toggleCursorVisible :: TextBufferClass self => Signal self (IO ()) +toggleCursorVisible = Signal (connect_NONE__NONE "toggle_cursor_visible") + +toggleOverwrite :: TextBufferClass self => Signal self (IO ()) +toggleOverwrite = Signal (connect_NONE__NONE "toggle_overwrite") + +-------------------- +-- Deprecated Signals and Events + +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 1420 + +#endif hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 4 --- Author : Manuel M. T. Chakravarty, Axel Simon +-- Author : Manuel M. T. Chakravarty, Axel Simon, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 9 +-- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 62 --- windowAddAccelGroup, [_$_] --- windowRemoveAccelGroup, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 85 --- windowAddMnemonic, --- windowRemoveMnemonic, --- windowSetMnemonicModifier, + windowGetDefaultWidget, + windowAddMnemonic, + windowRemoveMnemonic, + windowMnemonicActivate, + windowSetMnemonicModifier, + windowGetMnemonicModifier, + -- windowActivateKey, + -- windowPropagateKeyEvent, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 118 + windowSetStartupId, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 121 --- windowSetDecorationsHint, + windowSetDeletable, + windowGetDeletable, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 124 --- windowSetFunctionHint, + windowGetFrameDimensions, + windowSetHasFrame, + windowGetHasFrame, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 134 + windowSetIconList, + windowGetIconList, + windowSetDefaultIconList, + windowGetDefaultIconList, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 143 + windowSetDefaultIcon, + windowSetDefaultIconFromFile, + windowGetDefaultIconName, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 160 + windowParseGeometry, + windowReshowWithInitialSize, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 173 + windowSetOpacity, + windowGetOpacity, + windowGetGroup, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 184 + windowOpacity, + windowRole, + windowStartupId, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 190 + windowDeletable, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 193 + windowIconName, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 215 + windowToplevelFocus, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 219 + activateDefault, + activateFocus, + frameEvent, + keysChanged, + setFocus, + +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 231 +#endif hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 241 +import System.Glib.GList (fromGList, toGList) hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 243 -import System.Glib.GList (fromGList) hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 247 -import Graphics.UI.Gtk.Gdk.Events (Event, marshalEvent, MouseButton, +{#import Graphics.UI.Gtk.Gdk.Enums#} (Modifier(..)) +import Graphics.UI.Gtk.Gdk.Events (Event, EventKey, marshalEvent, MouseButton, hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 420 +-- | Adds a mnemonic to this window. +-- +windowAddMnemonic :: (WindowClass self, WidgetClass widget) => self + -> Int -- ^ @keyval@ - the mnemonic + -> widget -- ^ @target@ - the widget that gets activated by the mnemonic [_$_] + -> IO () +windowAddMnemonic self keyval target = + {# call window_add_mnemonic #} + (toWindow self) + (fromIntegral keyval) + (toWidget target) + +-- | Removes a mnemonic from this window. +-- +windowRemoveMnemonic :: (WindowClass self, WidgetClass widget) => self + -> Int -- ^ @keyval@ - the mnemonic [_$_] + -> widget -- ^ @target@ - the widget that gets activated by the mnemonic [_$_] + -> IO () +windowRemoveMnemonic self keyval target = + {# call window_remove_mnemonic #} [_$_] + (toWindow self) + (fromIntegral keyval) + (toWidget target) + +-- | Activates the targets associated with the mnemonic. +windowMnemonicActivate :: WindowClass self => self + -> Int -- ^ @keyval@ - the mnemonic [_$_] + -> Modifier -- ^ @modifier@ - the modifiers [_$_] + -> IO Bool -- ^ return @True@ if the activation is done. [_$_] +windowMnemonicActivate self keyval modifier = liftM toBool $ [_$_] + {# call window_mnemonic_activate #} + (toWindow self) + (fromIntegral keyval) + (fromIntegral (fromEnum modifier)) + +-- | Sets the mnemonic modifier for this window. +windowSetMnemonicModifier :: WindowClass self => self + -> Modifier -- ^ @modifier@ - the modifier mask used to activate mnemonics on this window. [_$_] + -> IO () +windowSetMnemonicModifier self modifier = + {# call window_set_mnemonic_modifier #} + (toWindow self) + (fromIntegral (fromEnum modifier)) + +-- | Returns the mnemonic modifier for this window. See 'windowSetMnemonicModifier'. +windowGetMnemonicModifier :: WindowClass self => self + -> IO Modifier -- ^ return the modifier mask used to activate mnemonics on this window. [_$_] +windowGetMnemonicModifier self = liftM (toEnum.fromIntegral) $ + {# call window_get_mnemonic_modifier #} [_$_] + (toWindow self) + +-- | Activates mnemonics and accelerators for this GtkWindow. [_$_] +-- This is normally called by the default ::key_press_event handler for toplevel windows, [_$_] +-- however in some cases it may be useful to call this directly when overriding the standard key handling for a toplevel window. +-- [_$_] +-- windowActivateKey :: WindowClass self => self +-- -> EventKey -- ^ @event@ - 'EventKey' +-- -> IO Bool -- ^ return @True@ if a mnemonic or accelerator was found and activated. [_$_] +-- windowActivateKey self event = liftM toBool $ +-- {# call window_activate_key #} +-- (toWindow self) +-- event + +-- | Propagate a key press or release event to the focus widget and up the focus container chain until a widget handles event. [_$_] +-- This is normally called by the default ::key_press_event and ::key_release_event handlers for toplevel windows, [_$_] +-- however in some cases it may be useful to call this directly when overriding the standard key handling for a toplevel window. +-- +-- windowPropagateKeyEvent :: WindowClass self => self +-- -> EventKey -- ^ @event@ - 'EventKey' +-- -> IO Bool -- ^ return @True@ if a widget in the focus chain handled the event. [_$_] +-- windowPropagateKeyEvent self event = liftM toBool $ +-- {# call window_propagate_key_event #} +-- (toWindow self) +-- event + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 637 +-- | Returns the default widget for window. See 'windowSetDefault' for more details. +-- [_$_] +-- * Available since Gtk+ version 2.14 +-- +windowGetDefaultWidget :: WindowClass self => self + -> IO Widget +windowGetDefaultWidget self = [_$_] + makeNewObject mkWidget $ + {# call window_get_default_widget #} + (toWindow self) + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 941 +-- | Startup notification identifiers are used by desktop environment to track application startup, [_$_] +-- to provide user feedback and other features. This function changes the corresponding property on the underlying GdkWindow. [_$_] +-- Normally, startup identifier is managed automatically and you should only use this function in special cases like transferring focus from other processes. You should use this function before calling gtk_window_present() or any equivalent function generating a window map event. +-- +-- This function is only useful on X11, not with other GTK+ targets. +-- +-- * Available since Gtk+ version 2.12 +-- +windowSetStartupId :: WindowClass self => self + -> String + -> IO () +windowSetStartupId self startupId = + withUTFString startupId $ \idPtr -> + {# call window_set_startup_id #} + (toWindow self) + idPtr + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 985 +-- | By default, windows have a close button in the window frame. [_$_] +-- Some window managers allow GTK+ to disable this button. [_$_] +-- If you set the deletable property to @False@ using this function, GTK+ will do its best to convince the window manager not to show a close button. [_$_] +-- Depending on the system, this function may not have any effect when called on a window that is already visible, [_$_] +-- so you should call it before calling gtk_window_show(). +-- +-- On Windows, this function always works, since there's no window manager policy involved. +-- +-- * Available since Gtk+ version 2.10 +-- +windowSetDeletable :: WindowClass self => self + -> Bool -- ^ @setting@ - @True@ to decorate the window as deletable [_$_] + -> IO () +windowSetDeletable self setting = + {# call window_set_deletable #} + (toWindow self) + (fromBool setting) + +-- | Returns whether the window has been set to have a close button via 'windowSetDeletable'. +-- +-- * Available since Gtk+ version 2.10 +-- +windowGetDeletable :: WindowClass self => self + -> IO Bool -- ^ return @True@ if the window has been set to have a close button [_$_] +windowGetDeletable self = liftM toBool $ [_$_] + {# call window_get_deletable #} + (toWindow self) + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 1035 +-- | (Note: this is a special-purpose function intended for the framebuffer port; see 'windowSetHasFrame'. [_$_] +-- It will not return the size of the window border drawn by the window manager, [_$_] +-- which is the normal case when using a windowing system. [_$_] +-- See 'drawWindowGetFrameExtents' to get the standard window border extents.) +-- +-- Retrieves the dimensions of the frame window for this toplevel. See 'windowSetHasFrame', 'windowSetFrameDimensions'. +-- +windowGetFrameDimensions :: WindowClass self => self + -> IO (Maybe (Int + ,Int + ,Int + ,Int)) -- ^ return @(left, top, right, bottom)@ is location to store size frame. @left@ is width of the frame at the left, @top@ is height of the frame at the top, @right@ is width of the frame at the right, @bottom@ is height of the frame at the bottom. +windowGetFrameDimensions self = [_$_] + alloca $ \lPtr -> alloca $ \tPtr -> alloca $ \rPtr -> alloca $ \bPtr -> [_$_] + do + {# call window_get_frame_dimensions #} (toWindow self) lPtr tPtr rPtr bPtr + if lPtr == nullPtr || tPtr == nullPtr || rPtr == nullPtr || bPtr == nullPtr + then return Nothing + else do + lv <- peek lPtr + tv <- peek tPtr + rv <- peek rPtr + bv <- peek bPtr + return (Just (fromIntegral lv, fromIntegral tv, fromIntegral rv, fromIntegral bv)) + +-- | (Note: this is a special-purpose function for the framebuffer port, that causes GTK+ to draw its own window border. [_$_] +-- For most applications, you want 'windowSetDecorated' instead, which tells the window manager whether to draw the window border.) +-- +-- If this function is called on a window with setting of @True@, before it is realized or showed, it will have a "frame" window around window->window, +-- accessible in window->frame. Using the signal frame_event you can receive all events targeted at the frame. +-- +-- This function is used by the linux-fb port to implement managed windows, [_$_] +-- but it could conceivably be used by X-programs that want to do their own window decorations. +-- +windowSetHasFrame :: WindowClass self => self [_$_] + -> Bool -- ^ @setting@ - a boolean [_$_] + -> IO () +windowSetHasFrame self setting = + {# call window_set_has_frame #} + (toWindow self) + (fromBool setting) + +-- | Accessor for whether the window has a frame window exterior to window->window. Gets the value set by 'windowSetHasFrame'. +-- +windowGetHasFrame :: WindowClass self => self + -> IO Bool -- ^ return @True@ if a frame has been added to the window via 'windowSetHasFrame'. +windowGetHasFrame self = liftM toBool $ + {# call window_get_has_frame #} + (toWindow self) + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 1208 +-- | Sets up the icon representing a GtkWindow. The icon is used when the window is minimized (also known as iconified). [_$_] +-- Some window managers or desktop environments may also place it in the window frame, or display it in other contexts. +-- +-- 'windowSetIconList' allows you to pass in the same icon in several hand-drawn sizes. [_$_] +-- The list should contain the natural sizes your icon is available in; that is, don't scale the image before passing it to GTK+. [_$_] +-- Scaling is postponed until the last minute, when the desired final size is known, to allow best quality. +-- +-- By passing several sizes, you may improve the final image quality of the icon, by reducing or eliminating automatic image scaling. +-- +-- Recommended sizes to provide: 16x16, 32x32, 48x48 at minimum, and larger images (64x64, 128x128) if you have them. +-- +-- See also 'windowSetDefaultIconList' to set the icon for all windows in your application in one go. +-- +-- Note that transient windows (those who have been set transient for another window using 'windowSetTransientFor' will inherit their icon from their +-- transient parent. [_$_] +-- So there's no need to explicitly set the icon on transient windows. +-- +windowSetIconList :: WindowClass self => self + -> [Pixbuf] + -> IO () +windowSetIconList self list = + withForeignPtrs (map unPixbuf list) $ \ptrList -> do + glist <- toGList ptrList + {# call window_set_icon_list #} + (toWindow self) + glist + [_$_] +-- | Retrieves the list of icons set by 'windowSetIconList'. [_$_] +-- The list is copied, but the reference count on each member won't be incremented. +-- +windowGetIconList :: WindowClass self => self [_$_] + -> IO [Pixbuf] +windowGetIconList self = do + glist <- {# call window_get_icon_list #} (toWindow self) + ptrList <- fromGList glist + mapM (makeNewGObject mkPixbuf . return) ptrList + +-- | Sets an icon list to be used as fallback for windows that haven't had 'windowSetIconList' called on them to set up a window-specific icon list. [_$_] +-- This function allows you to set up the icon for all windows in your app at once. +-- +-- See 'windowSetIconList' for more details. +-- +windowSetDefaultIconList :: [Pixbuf] -> IO () +windowSetDefaultIconList list = [_$_] + withForeignPtrs (map unPixbuf list) $ \ptrList -> do + glist <- toGList ptrList + {# call window_set_default_icon_list #} glist + +-- | Gets the value set by 'windowSetDefaultIconList'. [_$_] +-- The list is a copy and should be freed with 'listFree', but the pixbufs in the list have not had their reference count incremented. +-- +windowGetDefaultIconList :: IO [Pixbuf] +windowGetDefaultIconList = do + glist <- {# call window_get_default_icon_list #} + ptrList <- fromGList glist + mapM (makeNewGObject mkPixbuf . return) ptrList + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 1313 +-- | Sets an icon to be used as fallback for windows that haven't had 'windowSetIcon' called on them from a pixbuf. +-- +-- * Available since Gtk+ version 2.4 +-- +windowSetDefaultIcon :: Maybe Pixbuf -> IO () +windowSetDefaultIcon (Just icon) = + {# call window_set_default_icon #} icon +windowSetDefaultIcon Nothing = + {# call window_set_default_icon #} (mkPixbuf nullForeignPtr) + +-- | Sets an icon to be used as fallback for windows that haven't had 'windowSetIconList' called on them from a file on disk. [_$_] +windowSetDefaultIconFromFile :: [_$_] + String [_$_] + -> GError [_$_] + -> IO Bool +windowSetDefaultIconFromFile filename error = liftM toBool $ + withUTFString filename $ \filePtr -> [_$_] + with error $ \gErrorPtr -> [_$_] + {# call window_set_default_icon_from_file #} + filePtr + (castPtr gErrorPtr) + +-- | Returns the fallback icon name for windows that has been set with 'windowSetDefaultIconName'. [_$_] +-- The returned string is owned by GTK+ and should not be modified. [_$_] +-- It is only valid until the next call to 'windowSetDefaultIconName'. +-- +-- * Available since Gtk+ version 2.16 +-- +windowGetDefaultIconName :: IO String +windowGetDefaultIconName = [_$_] + {# call window_get_default_icon_name #} >>= peekCString + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 1479 +-- | Parses a standard X Window System geometry string - see the manual page for X (type 'man X') for details on this. [_$_] +-- 'windowParseGeometry' does work on all GTK+ ports including Win32 but is primarily intended for an X environment. +-- +-- If either a size or a position can be extracted from the geometry string, [_$_] +-- 'windowParseGeometry' returns @True@ and calls gtk_window_set_default_size() and/or gtk_window_move() to resize/move the window. +-- +-- If 'windowParseGeometry' returns @True@, [_$_] +-- it will also set the 'HintUserPos' and/or 'HintUserSize' hints indicating to the window manager that the size/position of the window was user-specified +-- This causes most window managers to honor the geometry. +-- +-- Note that for 'windowParseGeometry' to work as expected, it has to be called when the window has its "final" size, i.e. [_$_] +-- after calling 'widgetShowAll' on the contents and 'windowSetGeometryHints' on the window. +-- +windowParseGeometry :: WindowClass self => self + -> String + -> IO Bool +windowParseGeometry self geometry = liftM toBool $ + withUTFString geometry $ \geometryPtr -> [_$_] + {# call window_parse_geometry #} + (toWindow self) + geometryPtr + +-- | Hides window, then reshows it, resetting the default size and position of the window. Used by GUI builders only. +-- +windowReshowWithInitialSize :: WindowClass self => self -> IO () +windowReshowWithInitialSize self = + {# call window_reshow_with_initial_size #} (toWindow self) + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 1828 +-- | Request the windowing system to make window partially transparent, with opacity 0 being fully transparent and 1 fully opaque. [_$_] +-- (Values of the opacity parameter are clamped to the [0,1] range.) [_$_] +-- On X11 this has any effect only on X screens with a compositing manager running. See gtk_widget_is_composited(). +-- On Windows it should work always. +-- +-- Note that setting a window's opacity after the window has been shown causes it to flicker once on Windows. +-- [_$_] +-- * Available since Gtk+ version 2.12 +-- +windowSetOpacity :: WindowClass self => self + -> Double -- ^ @opacity@ - desired opacity, between 0 and 1 [_$_] + -> IO () +windowSetOpacity self opacity = + {#call window_set_opacity #} (toWindow self) (realToFrac opacity) + +-- | Fetches the requested opacity for this window. See 'windowSetOpacity'. +-- +-- * Available since Gtk+ version 2.12 +-- +windowGetOpacity :: WindowClass self => self [_$_] + -> IO Double -- ^ return the requested opacity for this window. [_$_] +windowGetOpacity self = liftM realToFrac $ + {#call window_get_opacity#} (toWindow self) + +-- | Returns the group for window or the default group, if window is @Nothing@ or if window does not have an explicit window group. +-- [_$_] +-- * Available since Gtk+ version 2.10 +-- +windowGetGroup :: WindowClass self => Maybe self + -> IO WindowGroup -- ^ return the 'WindowGroup' for a window or the default group [_$_] +windowGetGroup self = [_$_] + makeNewGObject mkWindowGroup $ + {# call window_get_group #} (maybe (Window nullForeignPtr) toWindow self) + [_$_] + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 1917 +-- | The requested opacity of the window. See 'windowSetOpacity' for more details about window opacity. +-- +-- Allowed values: [0,1] +-- +-- Default values: 1 +-- +-- * Available since Gtk+ version 2.12 +-- +windowOpacity :: WindowClass self => Attr self Double +windowOpacity = newAttrFromDoubleProperty "opacity" + +-- | Unique identifier for the window to be used when restoring a session. +-- +-- Default value: "\\" +-- +windowRole :: WindowClass self => Attr self String +windowRole = newAttrFromStringProperty "role" + +-- | The :startup-id is a write-only property for setting window's startup notification identifier. See 'windowSetStartupId' for more details. +-- +-- Default value: "\\" +-- +-- * Available since Gtk+ version 2.12 +-- +windowStartupId :: WindowClass self => Attr self String +windowStartupId = newAttrFromStringProperty "startup-id" + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 1970 +-- | Whether the window frame should have a close button. +-- +-- Default values: @True@ +-- +-- * Available since Gtk+ version 2.10 +-- +windowDeletable :: WindowClass self => Attr self Bool +windowDeletable = newAttrFromBoolProperty "deletable" + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 1995 +-- | The :icon-name property specifies the name of the themed icon to use as the window icon. See GtkIconTheme for more details. +-- +-- Default values: "\\" +-- +-- * Available since Gtk+ version 2.6 +-- +-- +windowIconName :: WindowClass self => Attr self String +windowIconName = newAttrFromStringProperty "icon-name" + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 2098 +-- | Whether the input focus is within this GtkWindow. +-- +-- Note: If add `window` before `HasToplevelFocus` (has-toplevel-focus attribute) +-- will conflicts with fucntion `windowHasToplevelFocus`, so we named this attribute [_$_] +-- to `windowToplevelFocus`. +-- +-- Default values: @False@ +-- +windowToplevelFocus :: WindowClass self => Attr self Bool +windowToplevelFocus = newAttrFromBoolProperty "has-toplevel-focus" + hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 2119 +-- | The ::activate-default signal is a keybinding signal which gets emitted when the user activates the default widget of window. +activateDefault :: WindowClass self => Signal self (IO ()) +activateDefault = Signal (connect_NONE__NONE "activate_default") + +-- | The ::activate-default signal is a keybinding signal which gets emitted when the user activates the currently focused widget of window. +activateFocus :: WindowClass self => Signal self (IO ()) +activateFocus = Signal (connect_NONE__NONE "activate_focus") + +-- | [_$_] +-- [_$_] +frameEvent :: WindowClass self => Signal self (Event -> IO Bool) +frameEvent = Signal (connect_BOXED__BOOL "frame_event" marshalEvent) + +-- | The ::keys-changed signal gets emitted when the set of accelerators or mnemonics that are associated with window changes. +-- +keysChanged :: WindowClass self => Signal self (IO ()) +keysChanged = Signal (connect_NONE__NONE "keys_changed") + +-- | [_$_] +-- +setFocus :: WindowClass self => Signal self (Widget -> IO ()) +setFocus = Signal (connect_OBJECT__NONE "set_focus") hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 2142 +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Windows/Window.chs.pp 2160 +#endif hunk ./gtk/Graphics/UI/Gtk/Windows/WindowGroup.chs 48 + windowGroupListWindows, hunk ./gtk/Graphics/UI/Gtk/Windows/WindowGroup.chs 53 +import System.Glib.GList (fromGList, toGList) hunk ./gtk/Graphics/UI/Gtk/Windows/WindowGroup.chs 92 + +-- | Returns a list of the GtkWindows that belong to window_group. +-- [_$_] +-- * Available since Gtk+ version 2.14 +-- +windowGroupListWindows :: WindowGroupClass self => self + -> IO [Pixbuf] -- ^ return A newly-allocated list of windows inside the group. [_$_] +windowGroupListWindows self = do + glist <- {# call window_group_list_windows #} (toWindowGroup self) + ptrList <- fromGList glist + mapM (makeNewGObject mkPixbuf . return) ptrList hunk ./tools/callbackGen/gtkmarshal.list 129 +# for TextBuffer +NONE:BOXED,STRING |
From: Axel S. <si...@co...> - 2009-10-02 07:38:57
|
Thu Oct 1 03:30:08 EDT 2009 Andy Stewart <laz...@gm...> * Update all modules under Graphics.UI.Gtk.Multiline to Gtk+ 2.16. Ignore-this: c9bd81bdac9f9c0f6d7ecad79dda5857 hunk ./gtk/Graphics/UI/Gtk/General/Enums.chs.pp 4 --- Author : Axel Simon, Manuel Chakravarty +-- Author : Axel Simon, Manuel Chakravarty, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/General/Enums.chs.pp 9 +-- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/General/Enums.chs.pp 59 + ScrollStep (..), hunk ./gtk/Graphics/UI/Gtk/General/Enums.chs.pp 310 +-- | Scrolling step +-- +{#enum ScrollStep {underscoreToCase} deriving (Eq,Show)#} + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 4 --- Author : Axel Simon +-- Author : Axel Simon, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 9 +-- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 21 --- TODO --- --- The functionality of inserting widgets (child anchors) is not implemented --- since there will probably some changes before the final release. The --- following functions are not bound: --- gtk_text_buffer_insert_child_anchor --- gtk_text_buffer_create_child_anchor --- gtk_text_buffer_get_iter_at_anchor --- onInsertChildAnchor --- [_$_] --- Check 'textBufferGetInsert', in case there is no cursor in [_$_] --- the editor, --- is there a mark called \"insert\"? If not, the function needs to return --- Maybe TextMark. The same holds for [_$_] --- 'textBufferGetSelectionBound'. --- --- If Clipboards are fully bound, then these functions need to be bound as well: --- gtk_text_buffer_add_selection_clipboard --- gtk_text_buffer_remove_selection_clipboard --- hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 23 --- The following convenience functions are omitted: [_$_] +-- Below `variadic` functions can't support by FFI: hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 27 --- gtk_text_buffer_get_bounds --- gtk_text_buffer_get_selection_bounds +-- But above functions is not essential, we can use other functions do same work. +-- Example: +-- +-- gtk_text_buffer_insert_with_tags equivalent to calling textBufferInsert, +-- then textBufferApplyTag on the inserted text. +-- [_$_] +-- gtk_text_buffer_insert_with_tags_by_name same as gtk_text_buffer_insert_with_tags, +-- just use textTagName handle tag name. [_$_] +-- +-- gtk_text_buffer_create_tag Equivalent to calling textTagNew +-- and then adding the tag to the buffer's tag table. [_$_] hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 93 + textBufferAddMark, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 136 + textBufferAddSelectionClipboard, + textBufferRemoveSelectionClipboard, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 159 + onInsertChildAnchor, + afterInsertChildAnchor, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 169 + onPasteDone, + afterPasteDone, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 478 +-- | Adds the mark at position where. [_$_] +-- The mark must not be added to another buffer, [_$_] +-- and if its name is not empty then there must not be another mark in the buffer nwith the same name. +-- +-- Emits the "mark-set" signal as notification of the mark's initial placement. +-- +textBufferAddMark :: TextBufferClass self => self + -> TextMark -- ^ @mark@ the mark to add + -> TextIter -- ^ @iter@ location to place mark + -> IO () +textBufferAddMark self mark iter = + {# call text_buffer_add_mark #} (toTextBuffer self) (toTextMark mark) iter + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 741 - hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 963 - -> TextIter -- ^ @start@ - iterator to initialize with first position in the - -- buffer - -> TextIter -- ^ @end@ - iterator to initialize with the end iterator - -> IO () -textBufferGetBounds self start end = - {# call gtk_text_buffer_get_bounds #} + -> IO (TextIter, TextIter) -- ^ return the first and last iterators in the buffer +textBufferGetBounds self = do + start <- makeEmptyTextIter + end <- makeEmptyTextIter + {#call unsafe text_buffer_get_bounds #} hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 971 + return (start, end) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1027 +-- | Adds clipboard to the list of clipboards in which the selection contents of buffer are available. [_$_] +-- In most cases, clipboard will be the 'Clipboard' of type 'SelectionPrimary' for a view of buffer. +-- +textBufferAddSelectionClipboard :: TextBufferClass self => self + -> Clipboard -- ^ @clipboard@ - the 'Clipboard' object to add + -> IO () +textBufferAddSelectionClipboard self clipboard = + {# call text_buffer_add_selection_clipboard #} (toTextBuffer self) clipboard + +-- | Removes a 'Clipboard' added with 'textBufferAddSelectionClipboard'. +-- +textBufferRemoveSelectionClipboard :: TextBufferClass self => self + -> Clipboard -- ^ @clipboard@ - the 'Clipboard' object to remove + -> IO () +textBufferRemoveSelectionClipboard self clipboard = [_$_] + {# call text_buffer_remove_selection_clipboard #} (toTextBuffer self) clipboard + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1124 --- | A widgets is inserted into the buffer. ---onInsertChildAnchor :: TextBufferClass self => --- (TextIter -> TextChildAnchor -> IO ()) -> ConnectAfter -> self -> [_$_] --- IO (ConnectId self) ---onInsertChildAnchor = connect_BOXED_OBJECT__NONE "insert_child_anchor" --- mkTextIterCopy - hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1133 +-- | The insert-child-anchor signal is emitted to insert a 'TextChildAnchor' in a 'TextBuffer'. [_$_] +-- Insertion actually occurs in the default handler. +-- +-- Note that if your handler runs before the default handler it must not invalidate the location iter (or has to revalidate it). [_$_] +-- The default signal handler revalidates it to be placed after the inserted anchor. +-- +onInsertChildAnchor, afterInsertChildAnchor :: TextBufferClass self => self + -> (TextIter -> TextChildAnchor -> IO ()) + -> IO (ConnectId self) +onInsertChildAnchor = connect_BOXED_OBJECT__NONE "insert_child_anchor" mkTextIterCopy False +afterInsertChildAnchor = connect_BOXED_OBJECT__NONE "insert_child_anchor" mkTextIterCopy True + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextBuffer.chs.pp 1185 +-- | The paste-done signal is emitted after paste operation has been completed. [_$_] +-- This is useful to properly scroll the view to the end of the pasted text. [_$_] +-- See 'textBufferPasteClipboard' for more details. +onPasteDone, afterPasteDone :: TextBufferClass self => self + -> (Clipboard -> IO ()) + -> IO (ConnectId self) +onPasteDone = connect_OBJECT__NONE "paste_done" False +afterPasteDone = connect_OBJECT__NONE "paste_done" True + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 4 --- Author : Axel Simon +-- Author : Axel Simon, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 9 +-- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 29 --- The functions gtk_text_iter_in_range and gtk_text_iter_order are not bound --- because they are only convenience functions which can replaced by calls --- to textIterCompare. --- hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 31 --- TODO --- --- Bind the following functions when we are sure about anchors [_$_] --- (see 'TextBuffer'): --- gtk_text_iter_get_anchor --- --- Bind TextAttribute functions when I am clear how to model them. [_$_] --- gtk_text_iter_get_attribute --- --- Forward exceptions in the two callback functions. --- hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 58 + textIterGetChildAnchor, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 61 - -- textIterGetChildAnchor, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 78 + textIterGetAttributes, + textIterGetLanguage, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 116 + textIterInRange, + textIterOrder, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 124 + textIterForwardVisibleWordEnds, + textIterBackwardVisibleWordStarts, + textIterForwardVisibleWordEnd, + textIterBackwardVisibleWordStart, + textIterForwardVisibleCursorPosition, + textIterBackwardVisibleCursorPosition, + textIterForwardVisibleCursorPositions, + textIterBackwardVisibleCursorPositions, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 153 +{#import Graphics.UI.Gtk.Multiline.TextTag#} +{#import Graphics.UI.Gtk.Pango.Types#} hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 267 +-- | If the location at iter contains a child anchor, [_$_] +-- the anchor is returned (with no new reference count added). [_$_] +-- Otherwise, @Nothing@ is returned. +-- +textIterGetChildAnchor :: TextIter -> IO (Maybe TextChildAnchor) +textIterGetChildAnchor it = do + tcaPtr <- {#call unsafe text_iter_get_child_anchor#} it + if tcaPtr == nullPtr then return Nothing else liftM Just $ + makeNewGObject mkTextChildAnchor (return tcaPtr) + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 469 --- | Get the text attributes at the iterator. --- --- * The @ta@ argument gives the default values if no specific [_$_] --- attributes are set at that specific location. +-- | Computes the effect of any tags applied to this spot in the text. [_$_] +-- The values parameter should be initialized to the default settings you wish to use if no tags are in effect. [_$_] +-- You'd typically obtain the defaults from 'textViewGetDefaultAttributes'. [_$_] +-- 'textIterGetAttributes' will modify values, applying the effects of any tags present at iter. [_$_] +-- If any tags affected values, the function returns @True@. hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 475 --- * The function returns @Nothing@ if the text at the iterator has [_$_] --- the same attributes. -textIterGetAttributes = error "textIterGetAttributes: not implemented" +textIterGetAttributes :: TextIter -> TextAttributes -> IO Bool +textIterGetAttributes ti ta = liftM toBool $ + {#call unsafe text_iter_get_attributes#} ti ta hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 479 +-- | A convenience wrapper around 'textIterGetAttributes', which returns the language in effect at iter. [_$_] +-- If no tags affecting language apply to iter, the return value is identical to that of 'getDefaultLanguage'. +-- +textIterGetLanguage :: TextIter -> IO Language +textIterGetLanguage ti = liftM Language $ + {#call unsafe text_iter_get_language#} ti hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 946 +-- | Calls 'textIterForwardVisibleWordEnd' up to count times. +-- +textIterForwardVisibleWordEnds :: TextIter [_$_] + -> Int -- ^ @couter@ - number of times to move [_$_] + -> IO Bool -- ^ return @True@ if iter moved and is not the end iterator [_$_] +textIterForwardVisibleWordEnds self count = [_$_] + liftM toBool $ + {# call text_iter_forward_visible_word_ends #} + self + (fromIntegral count) + +-- | Calls 'textIterBackwardVisibleWordStart' up to count times. +-- +textIterBackwardVisibleWordStarts :: TextIter [_$_] + -> Int -- ^ @couter@ - number of times to move [_$_] + -> IO Bool -- ^ return @True@ if iter moved and is not the end iterator [_$_] +textIterBackwardVisibleWordStarts self count = + liftM toBool $ + {# call text_iter_backward_visible_word_starts #} + self + (fromIntegral count) + +-- | Moves forward to the next visible word end. [_$_] +-- (If iter is currently on a word end, moves forward to the next one after that.) [_$_] +-- Word breaks are determined by Pango and should be correct for nearly any language [_$_] +-- (if not, the correct fix would be to the Pango word break algorithms). +-- +textIterForwardVisibleWordEnd :: TextIter + -> IO Bool -- ^ return @True@ if iter moved and is not the end iterator [_$_] +textIterForwardVisibleWordEnd self = + liftM toBool $ + {# call text_iter_forward_visible_word_end #} + self + +-- | Moves backward to the previous visible word start. [_$_] +-- (If iter is currently on a word start, moves backward to the next one after that.) [_$_] +-- Word breaks are determined by Pango and should be correct for nearly any language [_$_] +-- (if not, the correct fix would be to the Pango word break algorithms). +-- [_$_] +textIterBackwardVisibleWordStart :: TextIter + -> IO Bool -- ^ return @True@ if iter moved and is not the end iterator [_$_] +textIterBackwardVisibleWordStart self = + liftM toBool $ + {# call text_iter_backward_visible_word_start #} + self + +-- | Moves iter forward to the next visible cursor position. [_$_] +-- See 'textIterForwardCursorPosition' for details. +-- +textIterForwardVisibleCursorPosition :: TextIter + -> IO Bool -- ^ return @True@ if iter moved and is not the end iterator [_$_] +textIterForwardVisibleCursorPosition self = + liftM toBool $ + {# call text_iter_forward_visible_cursor_position #} + self + +-- | Moves iter forward to the previous visible cursor position. [_$_] +-- See 'textIterBackwardCursorPosition' for details. +-- [_$_] +textIterBackwardVisibleCursorPosition :: TextIter + -> IO Bool -- ^ return @True@ if iter moved and is not the end iterator [_$_] +textIterBackwardVisibleCursorPosition self = + liftM toBool $ + {# call text_iter_backward_visible_cursor_position #} + self + +-- | Moves up to count visible cursor positions. [_$_] +-- See 'textIterForwardCursorPosition' for details. +textIterForwardVisibleCursorPositions :: TextIter + -> Int -- ^ @couter@ - number of times to move [_$_] + -> IO Bool -- ^ return @True@ if iter moved and is not the end iterator [_$_] +textIterForwardVisibleCursorPositions self count = + liftM toBool $ + {# call text_iter_forward_visible_cursor_positions #} + self + (fromIntegral count) + +-- | Moves up to count visible cursor positions. [_$_] +-- See 'textIterBackwardCursorPosition' for details. +-- +textIterBackwardVisibleCursorPositions :: TextIter [_$_] + -> Int -- ^ @couter@ - number of times to move [_$_] + -> IO Bool -- ^ return @True@ if iter moved and is not the end iterator [_$_] +textIterBackwardVisibleCursorPositions self count = + liftM toBool $ + {# call text_iter_backward_visible_cursor_positions #} + self + (fromIntegral count) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 1050 +-- | Checks whether iter falls in the range [start, end). [_$_] +-- start and end must be in ascending order. +-- +textIterInRange :: TextIter [_$_] + -> TextIter -- ^ @start@ start of range + -> TextIter -- ^ @end@ end of range + -> IO Bool -- ^ @True@ if iter is in the range +textIterInRange ti start end = liftM toBool $ + {# call unsafe text_iter_in_range #} ti start end hunk ./gtk/Graphics/UI/Gtk/Multiline/TextIter.chs.pp 1060 +-- | Swaps the value of first and second if second comes before first in the buffer. [_$_] +-- That is, ensures that first and second are in sequence. [_$_] +-- Most text buffer functions that take a range call this automatically on your behalf, so there's no real reason to call it yourself in those cases. [_$_] +-- There are some exceptions, such as 'textIterInRange', that expect a pre-sorted range. +-- +textIterOrder :: TextIter -> TextIter -> IO () +textIterOrder first second = [_$_] + {# call text_iter_order #} first second hunk ./gtk/Graphics/UI/Gtk/Multiline/TextMark.chs 4 --- Author : Axel Simon +-- Author : Axel Simon, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextMark.chs 9 +-- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextMark.chs 69 +-- * Constructors + textMarkNew, + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextMark.chs 96 +-------------------- +-- Constructors +-- | Creates a text mark. [_$_] +-- Add it to a buffer using 'textBufferAddMark'. [_$_] +-- If name is NULL, the mark is anonymous; otherwise, the mark can be retrieved by name using 'textBufferGetMark'. [_$_] +-- If a mark has left gravity, and text is inserted at the mark's current location, [_$_] +-- the mark will be moved to the left of the newly-inserted text. [_$_] +-- If the mark has right gravity (left_gravity = FALSE), the mark will end up on the right of newly-inserted text. [_$_] +-- The standard left-to-right cursor is a mark with right gravity (when you type, the cursor stays on the right side of the text you're typing). +-- +textMarkNew :: [_$_] + Maybe MarkName -- ^ @markName@ - name for mark, or @Nothing@ + -> Bool -- ^ @leftGravity@ - whether the mark has left gravity + -> IO TextMark +textMarkNew markName leftGravity = + makeNewGObject mkTextMark $ + maybeWith withUTFString markName $ \markNamePtr -> + {# call text_mark_new #} + markNamePtr + (fromBool leftGravity) + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 4 --- Author : Duncan Coutts +-- Author : Duncan Coutts, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 9 +-- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 22 --- --- accessor functions for TextAttributes +-- [_$_] +-- Haven't bind `textTagTabs` properties, need bind PangoTab first (in `pango-tabs.c`) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 71 + textAttributesCopy, + textAttributesCopyValues, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 78 + textTagBackgroundSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 80 + textTagBackgroundFullHeightSet, + textTagBackgroundGdk, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 83 + textTagBackgroundStippleSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 85 + textTagForegroundSet, + textTagForegroundGdk, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 88 + textTagForegroundStippleSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 91 + textTagEditableSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 93 + textTagFontDesc, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 95 + textTagFamilySet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 97 + textTagStyleSet, + -- textTagTabs, + textTagTabsSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 101 + textTagVariantSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 103 + textTagWeightSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 105 + textTagStretchSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 107 + textTagSizeSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 109 + textTagScaleSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 112 + textTagJustificationSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 114 + textTagLanguageSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 116 + textTagLeftMarginSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 118 + textTagRightMarginSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 120 + textTagIndentSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 122 + textTagRiseSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 124 + textTagPixelsAboveLinesSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 126 + textTagPixelsBelowLinesSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 128 + textTagPixelsInsideWrapSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 130 + textTagStrikethroughSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 132 + textTagUnderlineSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 134 + textTagWrapModeSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 137 + textTagInvisibleSet, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 139 + textTagParagraphBackgroundSet, + textTagParagraphBackgroundGdk, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 156 +import Graphics.UI.Gtk.Pango.Font +import Graphics.UI.Gtk.Pango.Types (FontDescription (..), makeNewFontDescription) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 162 +import Graphics.UI.Gtk.General.Structs (Color(..)) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 228 +-- | Copies src and returns a new 'TextAttributes'. +-- +textAttributesCopy :: [_$_] + TextAttributes -- ^ @src@ - a 'TextAttributes' to be copied [_$_] + -> IO TextAttributes +textAttributesCopy src = + {#call text_attributes_copy#} src >>= makeNewTextAttributes + +-- | Copies the values from src to dest so that dest has the same values as src. [_$_] +-- Frees existing values in dest. +-- +textAttributesCopyValues :: TextAttributes -> TextAttributes -> IO () +textAttributesCopyValues src dest = + {# call text_attributes_copy_values #} src dest + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 267 +-- | Whether this tag affects the background color. +-- +-- Default value: @False@ +-- +textTagBackgroundSet :: TextTagClass self => Attr self Bool +textTagBackgroundSet = newAttrFromBoolProperty "background-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 282 +-- | Whether this tag affects background height. +-- +-- Default value: @False@ +-- [_$_] +textTagBackgroundFullHeightSet :: TextTagClass self => Attr self Bool +textTagBackgroundFullHeightSet = newAttrFromBoolProperty "background-full-height-set" + +-- | Background color as a (possibly unallocated) GdkColor. +-- +textTagBackgroundGdk :: TextTagClass self => Attr self Color +textTagBackgroundGdk = + newAttrFromBoxedStorableProperty "background-gdk" + {#call pure unsafe gdk_color_get_type#} + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 302 +-- | Whether this tag affects the background stipple. +-- [_$_] +-- Default value: @False@ +-- +textTagBackgroundStippleSet :: TextTagClass self => Attr self Bool +textTagBackgroundStippleSet = newAttrFromBoolProperty "background-stipple-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 316 +-- | Whether this tag affects the foreground color. +-- [_$_] +-- Default value: @False@ +-- +textTagForegroundSet :: TextTagClass self => Attr self Bool +textTagForegroundSet = newAttrFromBoolProperty "foreground-set" + +-- | Foreground color as a (possibly unallocated) GdkColor. +-- +textTagForegroundGdk :: TextTagClass self => Attr self Color +textTagForegroundGdk = + newAttrFromBoxedStorableProperty "foreground-gdk" + {# call pure unsafe gdk_color_get_type #} + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 336 +-- | Whether this tag affects the foreground stipple. +-- [_$_] +-- Default value: @False@ +-- +textTagForegroundStippleSet :: TextTagClass self => Attr self Bool +textTagForegroundStippleSet = newAttrFromBoolProperty "foreground-stipple-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 358 +-- | Whether this tag affects text editability. +-- [_$_] +-- Default value: @False@ +-- +textTagEditableSet :: TextTagClass self => Attr self Bool +textTagEditableSet = newAttrFromBoolProperty "editable-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 372 +-- | Font description as a 'FontDescription' struct. +-- +textTagFontDesc :: TextTagClass self => Attr self FontDescription +textTagFontDesc = newAttrFromBoxedOpaqueProperty makeNewFontDescription + (\(FontDescription fd) act -> withForeignPtr fd act) "font-desc" + {# call pure unsafe pango_font_description_get_type #} + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 386 +-- | Whether this tag affects the font family. +-- [_$_] +-- Default value: @False@ +-- +textTagFamilySet :: TextTagClass self => Attr self Bool +textTagFamilySet = newAttrFromBoolProperty "family-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 401 +-- | Whether this tag affects the font style. +-- [_$_] +-- Default value: @False@ +-- +textTagStyleSet :: TextTagClass self => Attr self Bool +textTagStyleSet = newAttrFromBoolProperty "style-set" + +-- | Custom tabs for this text. +-- textTagTabs :: TextTagClass self => Attr self TabArray + +-- | Whether this tag affects tabs. +-- [_$_] +-- Default value: @False@ +-- +textTagTabsSet :: TextTagClass self => Attr self Bool +textTagTabsSet = newAttrFromBoolProperty "tabs-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 426 +-- | Whether this tag affects the font variant. +-- [_$_] +-- Default value: @False@ +-- +textTagVariantSet :: TextTagClass self => Attr self Bool +textTagVariantSet = newAttrFromBoolProperty "variant-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 443 +-- | Whether this tag affects the font weight. +-- [_$_] +-- Default value: @False@ +-- +textTagWeightSet :: TextTagClass self => Attr self Bool +textTagWeightSet = newAttrFromBoolProperty "weight-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 458 +-- | Whether this tag affects the font stretch. +textTagStretchSet :: TextTagClass self => Attr self Bool +textTagStretchSet = newAttrFromBoolProperty "stretch-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 471 +-- | Whether this tag affects the font size. +-- [_$_] +-- Default value: @False@ +-- +textTagSizeSet :: TextTagClass self => Attr self Bool +textTagSizeSet = newAttrFromBoolProperty "size-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 488 +-- | Whether this tag scales the font size by a factor. +-- [_$_] +-- Default value: @False@ +-- +textTagScaleSet :: TextTagClass self => Attr self Bool +textTagScaleSet = newAttrFromBoolProperty "scale-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 512 +-- | Whether this tag affects paragraph justification. +-- [_$_] +-- Default value: @False@ +-- +textTagJustificationSet :: TextTagClass self => Attr self Bool +textTagJustificationSet = newAttrFromBoolProperty "justification-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 528 +-- | Whether this tag affects the language the text is rendered as. +-- [_$_] +-- Default value: @False@ +-- +textTagLanguageSet :: TextTagClass self => Attr self Bool +textTagLanguageSet = newAttrFromBoolProperty "language-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 544 +-- | Whether this tag affects the left margin. +-- [_$_] +-- Default value: @False@ +-- +textTagLeftMarginSet :: TextTagClass self => Attr self Bool +textTagLeftMarginSet = newAttrFromBoolProperty "left-margin-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 560 +-- | Whether this tag affects the right margin. +-- [_$_] +-- Default value: @False@ +-- +textTagRightMarginSet :: TextTagClass self => Attr self Bool +textTagRightMarginSet = newAttrFromBoolProperty "right-margin-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 574 +-- | Whether this tag affects indentation. +-- [_$_] +-- Default value: @False@ +-- +textTagIndentSet :: TextTagClass self => Attr self Bool +textTagIndentSet = newAttrFromBoolProperty "indent-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 589 +-- | Whether this tag affects the rise. +textTagRiseSet :: TextTagClass self => Attr self Bool +textTagRiseSet = newAttrFromBoolProperty "rise-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 602 +-- | Whether this tag affects the number of pixels above lines. +-- [_$_] +-- Default value: @False@ +-- +textTagPixelsAboveLinesSet :: TextTagClass self => Attr self Bool +textTagPixelsAboveLinesSet = newAttrFromBoolProperty "pixels-above-lines-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 618 +-- | Whether this tag affects the number of pixels below lines. +-- [_$_] +-- Default value: @False@ +-- +textTagPixelsBelowLinesSet :: TextTagClass self => Attr self Bool +textTagPixelsBelowLinesSet = newAttrFromBoolProperty "pixels-below-lines-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 634 +-- | Whether this tag affects the number of pixels between wrapped lines. +-- [_$_] +-- Default value: @False@ +-- +textTagPixelsInsideWrapSet :: TextTagClass self => Attr self Bool +textTagPixelsInsideWrapSet = newAttrFromBoolProperty "pixels-inside-wrap-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 648 +-- | Whether this tag affects strikethrough. +-- [_$_] +-- Default value: @False@ +-- +textTagStrikethroughSet :: TextTagClass self => Attr self Bool +textTagStrikethroughSet = newAttrFromBoolProperty "strikethrough-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 663 +-- | Whether this tag affects underlining. +-- [_$_] +-- Default value: @False@ +-- +textTagUnderlineSet :: TextTagClass self => Attr self Bool +textTagUnderlineSet = newAttrFromBoolProperty "underline-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 679 +-- | Whether this tag affects line wrap mode. +-- [_$_] +-- Default value: @False@ +-- +textTagWrapModeSet :: TextTagClass self => Attr self Bool +textTagWrapModeSet = newAttrFromBoolProperty "wrap-mode-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 698 +-- | Whether this tag affects text visibility. +-- [_$_] +-- Default value: @False@ +-- +textTagInvisibleSet :: TextTagClass self => Attr self Bool +textTagInvisibleSet = newAttrFromBoolProperty "invisible-set" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextTag.chs.pp 711 + +-- | Whether this tag affects the paragraph background color. +-- [_$_] +-- Default value: @False@ +-- +textTagParagraphBackgroundSet :: TextTagClass self => Attr self Bool +textTagParagraphBackgroundSet = newAttrFromBoolProperty "paragraph-background-set" + +-- | The paragraph background color as a as a (possibly unallocated) 'Color'. +-- +textTagParagraphBackgroundGdk :: TextTagClass self => Attr self Color +textTagParagraphBackgroundGdk = [_$_] + newAttrFromBoxedStorableProperty "paragraph-background-gdk" + {# call pure unsafe gdk_color_get_type #} hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 4 --- Author : Axel Simon +-- Author : Axel Simon, Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 9 +-- Copyright (C) 2009 Andy Stewart hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 23 --- If PangoTabArray is bound: do textViewSetTabs and textViewGetTabs +-- If PangoTabArray is bound: [_$_] +-- Fucntions: textViewSetTabs and textViewGetTabs +-- Properties: textViewTabs hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 146 + textViewImModule, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 160 + onBackspace, + afterBackspace, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 172 + onMoveViewport, + afterMoveViewport, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 186 + onToggleCursorVisible, + afterToggleCursorVisible, hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 196 +import System.Glib.Properties (newAttrFromStringProperty) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 206 - MovementStep(..), WrapMode(..)) + MovementStep(..), WrapMode(..), + ScrollStep (..)) hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 1068 +-- | Which IM (input method) module should be used for this entry. See GtkIMContext. +-- Setting this to a non-empty value overrides the system-wide IM module setting. [_$_] +-- See the GtkSettings "gtk-im-module" property. +-- +-- Default value: \"\" +-- +textViewImModule :: TextViewClass self => Attr self String +textViewImModule = [_$_] + newAttrFromStringProperty "im-module" + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 1169 +-- | The ::backspace signal is a keybinding signal which gets emitted when the user asks for it. +-- +-- The default bindings for this signal are Backspace and Shift-Backspace. +-- +onBackspace, afterBackspace :: TextViewClass self => self + -> IO () + -> IO (ConnectId self) +onBackspace = connect_NONE__NONE "on_backspace" False +afterBackspace = connect_NONE__NONE "on_backspace" True + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 1246 +-- | The ::move-viewport signal is a keybinding signal which can be bound to key combinations to allow the user to move the viewport, i.e. change what part of the text view is visible in a containing scrolled window. +-- There are no default bindings for this signal. +-- [_$_] +onMoveViewport, afterMoveViewport :: TextViewClass self => self + -> (ScrollStep -> Int -> IO ()) + -> IO (ConnectId self) +onMoveViewport = connect_ENUM_INT__NONE "move_viewport" False +afterMoveViewport = connect_ENUM_INT__NONE "move_viewport" True + hunk ./gtk/Graphics/UI/Gtk/Multiline/TextView.chs.pp 1331 +-- | The ::toggle-cursor-visible signal is a keybinding signal which gets emitted to toggle the visibility of the cursor. +-- The default binding for this signal is F7. +-- +onToggleCursorVisible, afterToggleCursorVisible :: TextViewClass self => self + -> IO () + -> IO (ConnectId self) +onToggleCursorVisible = connect_NONE__NONE "toggle_cursor_visible" False +afterToggleCursorVisible = connect_NONE__NONE "toggle_cursor_visible" True + |
From: Axel S. <si...@co...> - 2009-09-30 15:47:34
|
Tue Sep 29 08:18:58 EDT 2009 Andy Stewart <laz...@gm...> * Contain stub.o file in Makefile.am for generate Vte.chs.pp dynamic callback. Ignore-this: d8db4a67742a1fe4dd965b38aaffc970 hunk ./Makefile.am 1156 +libHSvte_a_LIBADD = \ + vte/Graphics/UI/Gtk/Vte/Vte_stub.o + |
From: Axel S. <si...@co...> - 2009-09-29 07:02:26
|
Tue Sep 29 03:00:27 EDT 2009 Axe...@en... * Add signal connection function for VTE. hunk ./tools/callbackGen/gtkmarshal.list 125 +# for Drag.dragFailed +BOOLEAN:OBJECT,ENUM |
From: Axel S. <si...@co...> - 2009-09-28 19:33:51
|
Mon Sep 28 15:32:01 EDT 2009 Axe...@en... * Fix documentation and some memory management stuff in VTE. hunk ./gtk/Graphics/UI/Gtk/General/Drag.chs.pp 174 + hunk ./gtk/Graphics/UI/Gtk/General/Drag.chs.pp 177 --- * The 'DestDefaults' flags specify what actions GTK+ should take on behalf +-- * The 'DestDefaults' flags specify what actions Gtk should take on behalf hunk ./gtk/Graphics/UI/Gtk/General/Drag.chs.pp 186 --- invokations of 'dragStatus' in the handler of 'dragMotion", and --- invokations of 'dragFinish' in 'dragDataReceived'. Especially the +-- invocations of 'dragStatus' in the handler of 'dragMotion', and +-- invocations of 'dragFinish' in 'dragDataReceived'. Especially the hunk ./gtk/Graphics/UI/Gtk/General/Drag.chs.pp 191 + hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 25 --- A VTE widget for terminal +-- A terminal widget hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 33 - SelectionFunc, hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 192 -import System.Posix.Types hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 196 -import System.Glib.GList hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 203 +{#import Graphics.UI.Gtk.General.Clipboard#} (selectionPrimary, + selectionClipboard) hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 216 --- | A predicate that states which characters are of interest. [_$_] --- The predicate @p c r@ should return @True@ if the character at column @c@ and row @r@ should be extracted. + +-- | A predicate that states which characters are of interest. The predicate +-- @p c r@ where @p :: VteSelect@, should return @True@ if the character at +-- column @c@ and row @r@ should be extracted. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 242 + hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 253 --- | Values for "what should happen when the user hits backspace/delete". [_$_] + +-- | Values for what should happen when the user presses backspace\/delete. [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 264 --- | Flags determining how the regular expression is to be interpreted. +-- | Flags determining how the regular expression is to be interpreted. See +-- <http://library.gnome.org/devel/glib/stable/glib-Perl-compatible-regular-expressions.html#GRegexCompileFlags> +-- for an explanation of these flags. +-- hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 272 --- expression. +-- expression. See +-- <http://library.gnome.org/devel/glib/stable/glib-Perl-compatible-regular-expressions.html#GRegexMatchFlags> +-- for an explanation of these flags. +-- hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 371 --- | Interprets data as if it were data received from a child process. [_$_] --- This can either be used to drive the terminal without a child process, or just to mess with your users. +-- | Interprets data as if it were data received from a child process. This +-- can either be used to drive the terminal without a child process, or just +-- to mess with your users. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 377 - -> Int -- ^ @len@ - the length of the string [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 378 -terminalFeed terminal string len = - withUTFString string $ \strPtr -> +terminalFeed terminal string = + withUTFStringLen string $ \(strPtr, len) -> hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 382 --- | Sends a block of UTF-8 text to the child as if it were entered by the user at the keyboard. +-- | Sends a block of UTF-8 text to the child as if it were entered by the +-- user at the keyboard. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 387 - -> Int -- ^ @len@ - length of text in bytes, or -1 if text is NUL-terminated [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 388 -terminalFeedChild terminal string len = - withUTFString string $ \strPtr -> +terminalFeedChild terminal string = + withUTFStringLen string $ \(strPtr, len) -> hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 398 - -> String -- ^ @string@ - data to send to the child [_$_] - -> Int -- ^ @len@ - length of data [_$_] + -> [Word8] -- ^ @data@ - data to send to the child [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 400 -terminalFeedChildBinary terminal string len = - withUTFString string $ \strPtr -> - {#call terminal_feed_child_binary#} (toTerminal terminal) strPtr (fromIntegral len) +terminalFeedChildBinary terminal string = + withArrayLen string $ \len strPtr -> + {#call terminal_feed_child_binary#} (toTerminal terminal) (castPtr strPtr) (fromIntegral len) hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 431 --- | Places the selected text in the terminal in the 'SelectionClipboard' selection. +-- | Places the selected text in the terminal in the 'selectionClipboard' +-- selection. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 437 --- | Sends the contents of the 'SelectionClipboard' selection to the terminal's child. [_$_] --- If necessary, the data is converted from UTF-8 to the terminal's current encoding. [_$_] --- It's called on paste menu item, or when user presses Shift+Insert. +-- | Sends the contents of the 'selectionClipboard' selection to the +-- terminal's child. If necessary, the data is converted from UTF-8 to the +-- terminal's current encoding. It's called on paste menu item, or when user +-- presses Shift+Insert. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 445 --- | Places the selected text in the terminal in the 'SelectionPrimary' selection. +-- | Places the selected text in the terminal in the +-- 'selectionPrimary' selection. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 451 --- | Sends the contents of the 'SelectionPrimary' selection to the terminal's child. [_$_] --- If necessary, the data is converted from UTF-8 to the terminal's current encoding. [_$_] --- The terminal will call also paste the 'SelectionPrimary' selection when the user clicks with the the second mouse button. +-- | Sends the contents of the +-- 'selectionPrimary' selection to the +-- terminal's child. If necessary, the data is converted from UTF-8 to the +-- terminal's current encoding. The terminal will call also paste the +-- 'SelectionPrimary' selection when the user clicks with the the second mouse +-- button. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 474 --- | Controls whether or not the terminal will beep when the child outputs the "bl" sequence. +-- | Controls whether or not the terminal will beep when the child outputs the \"bl\" sequence. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 482 --- | Checks whether or not the terminal will beep when the child outputs the "bl" sequence. +-- | Checks whether or not the terminal will beep when the child outputs the \"bl\" sequence. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 490 --- | Controls whether or not the terminal will present a visible bell to the user when the child outputs the "bl" sequence. [_$_] +-- | Controls whether or not the terminal will present a visible bell to the user when the child outputs the \"bl\" sequence. [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 499 --- | Checks whether or not the terminal will present a visible bell to the user when the child outputs the "bl" sequence. [_$_] +-- | Checks whether or not the terminal will present a visible bell to the user when the child outputs the \"bl\" sequence. [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 648 - -> Pixbuf -- ^ @image@ - a 'Pixbuf' to use, or @Nothing@ to cancel [_$_] + -> Maybe Pixbuf -- ^ @image@ - a 'Pixbuf' to use, or @Nothing@ to use the default background hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 650 -terminalSetBackgroundImage terminal image = +terminalSetBackgroundImage terminal (Just image) = hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 652 +terminalSetBackgroundImage terminal Nothing = + {#call terminal_set_background_image#} (toTerminal terminal) (mkPixbuf nullForeignPtr) hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 956 --- | Reads the location of the insertion cursor and returns it. The row coordinate is absolute. +-- | Reads the location of the insertion cursor and returns it. The row +-- coordinate is absolute. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 960 - -> IO (Int -- ^ return column of cursor - ,Int) -- ^ return row of cursor + -> IO (Int, Int) -- ^ @(column,row)@ the position of the cursor hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 969 --- | Clears the list of regular expressions the terminal uses to highlight text when the user moves the mouse cursor. +-- | Clears the list of regular expressions the terminal uses to highlight +-- text when the user moves the mouse cursor. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 975 --- | Adds the regular expression regex to the list of matching expressions. [_$_] --- When the user moves the mouse cursor over a section of displayed text which matches this expression, the text will be highlighted. +-- | Adds the regular expression to the list of matching expressions. +-- When the user moves the mouse cursor over a section of displayed text which +-- matches this expression, the text will be highlighted. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 979 --- NOTE: see http://library.gnome.org/devel/glib/stable/glib-regex-syntax.html for details about GRegex. +-- See <http://library.gnome.org/devel/glib/stable/glib-regex-syntax.html> for +-- details about the accepted syntex. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1006 --- | Checks if the text in and around the specified position matches any of the regular expressions previously set using 'terminalMatchAddRegex'. [_$_] --- If a match exists, the text string is returned and if tag is not @Nothing@, [_$_] --- the number associated with the matched regular expression will be stored in tag. --- If more than one regular expression has been set with 'terminalMatchAddRegex', then expressions are checked in the order in which they were added. +-- | Checks if the text in and around the specified position matches any of +-- the regular expressions previously registered using +-- 'terminalMatchAddRegex'. If a match exists, the matching string is returned +-- together with the number associated with the matched regular expression. If +-- more than one regular expression matches, the expressions that was +-- registered first will be returned. +-- hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1017 - -> IO (String -- ^ return a string which matches one of the previously set regular expressions, and which must be freed by the caller. - ,Int) -- ^ return pointer to an integer -terminalMatchCheck terminal column row = do - alloca $ \tagPtr -> - {#call terminal_match_check#} (toTerminal terminal) (fromIntegral column) (fromIntegral row) tagPtr >>= peekCString - >>= \str -> do - tag <- peek tagPtr - return (str,fromIntegral tag) + -> IO (Maybe (String, Int)) + -- ^ @Just (str, tag)@ - the string that matched one of the previously set + -- regular expressions together with the number @tag@ that was returned by + -- 'terminalMatchAddRegex' +terminalMatchCheck terminal column row = alloca $ \tagPtr -> do + strPtr <- {#call terminal_match_check#} (toTerminal terminal) + (fromIntegral column) (fromIntegral row) tagPtr + if strPtr==nullPtr then return Nothing else do + str <- peekCString strPtr + {#call unsafe g_free#} (castPtr strPtr) + if tagPtr==nullPtr then return Nothing else do + tag <- peek tagPtr + return (Just (str,fromIntegral tag)) hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1119 - -> IO String -- ^ return the current contents of the terminal's status line. For terminals like "xterm", this will usually be the empty string. The string must not be modified or freed by the caller. + -> IO String -- ^ The current content of the terminal's status line. For terminals like "xterm", this will usually be the empty string. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1129 - -> IO (Int -- ^ return address in which to store left/right-edge padding [_$_] - ,Int) -- ^ return address in which to store top/bottom-edge ypadding [_$_] + -> IO (Int, Int) -- ^ @(lr,tb)@ - the left\/right-edge and top\/bottom-edge padding [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1133 - {#call terminal_get_padding#} (toTerminal terminal) xPtr yPtr + {#call terminal_get_padding#} (toTerminal terminal) xPtr yPtr hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1205 --- | Controls whether or not the terminal will beep when the child outputs the "bl" sequence. +-- | Controls whether or not the terminal will beep when the child outputs the \"bl\" sequence. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1235 -terminalBackgroundImagePixbuf :: TerminalClass self => Attr self Pixbuf +terminalBackgroundImagePixbuf :: TerminalClass self => Attr self (Maybe Pixbuf) hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1237 - newAttrFromObjectProperty "background-image-pixbuf" [_$_] + newAttrFromMaybeObjectProperty "background-image-pixbuf" [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1438 --- | The length of the scrollback buffer used by the terminal. [_$_] --- The size of the scrollback buffer will be set to the larger of this value and the number of visible rows the widget can display, [_$_] --- so 0 can safely be used to disable scrollback. Note that this setting only affects the normal screen buffer. [_$_] --- For terminal types which have an alternate screen buffer, no scrollback is allowed on the alternate screen buffer. +-- | The length of the scrollback buffer used by the terminal. The size of the +-- scrollback buffer will be set to the larger of this value and the number of +-- visible rows the widget can display, so 0 can safely be used to disable +-- scrollback. Note that this setting only affects the normal screen buffer. +-- For terminal types which have an alternate screen buffer, no scrollback is +-- allowed on the alternate screen buffer. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1453 --- | Controls whether the terminal will present a visible bell to the user when the child outputs the "bl" sequence. [_$_] +-- | Controls whether the terminal will present a visible bell to the user when the child outputs the \"bl\" sequence. [_$_] |
From: Axel S. <si...@co...> - 2009-09-28 19:33:51
|
Mon Sep 28 15:32:24 EDT 2009 Axe...@en... * Add the dragFailed signal. hunk ./gtk/Graphics/UI/Gtk/General/Drag.chs.pp 65 + DragResult(..), hunk ./gtk/Graphics/UI/Gtk/General/Drag.chs.pp 142 -import Graphics.UI.Gtk.General.Enums ( DestDefaults(..), DragProtocol(..) ) +import Graphics.UI.Gtk.General.Enums ( DestDefaults(..), DragProtocol(..), + DragResult(..) ) hunk ./gtk/Graphics/UI/Gtk/General/Drag.chs.pp 690 -dragFailed = error "dragFailed: not defined yet" +-- | The 'dragFailed' signal is emitted on the drag source when a drag has +-- failed. The signal handler may hook custom code to handle a failed DND +-- operation based on the type of error, it returns @True@ is the failure has +-- been already handled (not showing the default \"drag operation failed\" +-- animation), otherwise it returns @False@. +-- +-- * Available since Gtk+ 2.12.0. +-- +dragFailed :: WidgetClass self => Signal self (DragContext -> DragResult -> IO Bool) +dragFailed = Signal (connect_OBJECT_ENUM__BOOL "drag_failed") hunk ./gtk/Graphics/UI/Gtk/General/Enums.chs.pp 38 + DragResult(..), hunk ./gtk/Graphics/UI/Gtk/General/Enums.chs.pp 176 +-- | Gives an indication why a drag operation failed. The value can by +-- obtained by connecting to the 'Graphics.UI.Gtk.General.Drag.dragFailed' +-- signal. +-- +-- * 'DragResultSuccess': The drag operation was successful +-- +-- * 'DragResultNoTarget': No suitable drag target +-- +-- * 'DragResultUserCancelled': The user cancelled the drag operation +-- +-- * 'DragResultTimeoutExpired': The drag operation timed out +-- +-- * 'DragResultGrabBroken': The pointer or keyboard grab used for the drag +-- operation was broken +-- +-- * 'DragResultError': The drag operation failed due to some unspecified error +-- +{#enum DragResult {underscoreToCase} deriving (Bounded,Eq,Show)#} + |
From: Axel S. <si...@co...> - 2009-09-28 19:33:48
|
Sun Sep 27 21:32:08 EDT 2009 Andy Stewart <laz...@gm...> * Adjust VTE binding and finish miss functions in GdkCursor Ignore-this: 782feb53e623e3af75564e6533e0e0e0 * Adjust configure.ac make VTE binding 0.20.5 or higher * Finish missing functions in Vte.chs.pp ** terminalGetTextIncludeTrailingSpaces ** terminalGetTextRange ** terminalMatchSetCursorType (this function need GdkCursorType that miss in current Cursor.chs) * Remove all deprecated functions in VTE 0.20.5 * Adjust export list of Vte.chs.pp * Adjust comment of Vte.chs.pp, make it more Haskell style * Finish miss functions of Cursor.chs hunk ./configure.ac 321 -GTKHS_PKG_CHECK(vte, vte, VTE, [vte >= 0.20], [GLIB GTK], +GTKHS_PKG_CHECK(vte, vte, VTE, [vte >= 0.20.5], [GLIB GTK], hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 5 +-- Andy Stewart <laz...@gm...> hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 10 +-- Copyright (C) 2009 Andy Stewart [_$_] hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 30 +-- * Types hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 32 - cursorNewFromPixmap + +-- * Enums + CursorType(..), + +-- * Constructors [_$_] + cursorNew, + [_$_] +-- * Methods [_$_] + cursorNewFromPixmap, + cursorNewFromPixbuf, + cursorNewFromName, + cursorNewForDisplay, + cursorGetDisplay, + cursorGetImage hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 48 +import Control.Monad (liftM) + hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 51 +import System.Glib.UTFString hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 53 -{#import Graphics.UI.Gtk.Types#} hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 55 +{#import Graphics.UI.Gtk.Types#} hiding (Arrow) + hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 59 +-------------------- +-- Types hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 63 +-------------------- +-- Enums +-- | Cursor types. +{#enum GdkCursorType as CursorType {underscoreToCase} deriving (Bounded,Eq,Show)#} + +-------------------- +-- Utils hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 78 +-------------------- +-- Constructors +-- | Creates a new cursor from the set of builtin cursors for the default display. [_$_] +-- See 'cursorNewForDisplay'. +-- To make the cursor invisible, use 'BlankCursor'. +cursorNew :: [_$_] + CursorType -- ^ @cursorType@ cursor to create [_$_] + -> IO Cursor -- ^ return a new 'Cursor' +cursorNew cursorType = do + cursorPtr <- {#call cursor_new#} $fromIntegral (fromEnum cursorType) + makeNewCursor cursorPtr + +-------------------- +-- Methods hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 113 +-- | Creates a new cursor from a pixbuf. +-- Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. [_$_] +-- The functions 'displaySupportsCursorAlpha' and 'displaySupportsCursorColor' can be used to determine whether RGBA cursors are supported; [_$_] +-- 'displayGetDefaultCursorSize' and 'displayGetMaximalCursorSize' give information about cursor sizes. +-- [_$_] +-- On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension. +-- [_$_] +cursorNewFromPixbuf :: [_$_] + Display -- ^ @display@ the 'Display' for which the cursor will be created [_$_] + -> Pixbuf -- ^ @pixbuf@ the 'Pixbuf' containing the cursor image [_$_] + -> Int -- ^ @x@ the horizontal offset of the 'hotspot' of the cursor. [_$_] + -> Int -- ^ @y@ the vertical offset of the 'hotspot' of the cursor. [_$_] + -> IO Cursor -- ^ return a new 'Cursor'. [_$_] +cursorNewFromPixbuf display pixbuf x y = do + cursorPtr <- {#call cursor_new_from_pixbuf#} display pixbuf (fromIntegral x) (fromIntegral y) + makeNewCursor cursorPtr + +-- | Creates a new cursor by looking up name in the current cursor theme. +cursorNewFromName :: [_$_] + Display -- ^ @display@ the 'Display' for which the cursor will be created [_$_] + -> String -- ^ @name@ the name of the cursor [_$_] + -> IO (Maybe Cursor) -- ^ return a new 'Cursor', or @Nothing@ if there is no cursor with the given name [_$_] +cursorNewFromName display name = [_$_] + withUTFString name $ \namePtr -> do + cursorPtr <- {#call cursor_new_from_name#} display namePtr + if cursorPtr == nullPtr then return Nothing else liftM Just $ makeNewCursor cursorPtr hunk ./gtk/Graphics/UI/Gtk/Gdk/Cursor.chs 140 +-- | Creates a new cursor from the set of builtin cursors. [_$_] +cursorNewForDisplay :: [_$_] + Display -- ^ @display@ the 'Display' for which the cursor will be created [_$_] + -> CursorType -- ^ @cursorType@ cursor to create [_$_] + -> IO Cursor -- ^ return a new 'Cursor' +cursorNewForDisplay display cursorType = do [_$_] + cursorPtr <- {#call cursor_new_for_display#} display $fromIntegral (fromEnum cursorType) + makeNewCursor cursorPtr + [_$_] +-- | Returns the display on which the GdkCursor is defined. +cursorGetDisplay :: [_$_] + Cursor -- ^ @cursor@ 'Cursor' + -> IO Display -- ^ return the 'Display' associated to cursor [_$_] +cursorGetDisplay cursor = + constructNewGObject mkDisplay $ {#call cursor_get_display#} cursor + [_$_] +-- | Returns a 'Pixbuf' with the image used to display the cursor. [_$_] +-- Note that depending on the capabilities of the windowing system and on the cursor, GDK may not be able to obtain the image data. [_$_] +-- In this case, @Nothing@ is returned. +cursorGetImage :: [_$_] + Cursor -- ^ @cursor@ 'Cursor' + -> IO (Maybe Pixbuf) -- ^ a 'Pixbuf' representing cursor, or @Nothing@ +cursorGetImage cursor = [_$_] + maybeNull (constructNewGObject mkPixbuf) $ {#call cursor_get_image#} cursor hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 20 --- TODO: --- --- ** Finish functions binding: --- 'terminalGetText', 'terminalGetTextIncludeTrailingSpaces' --- 'terminalGetTextRange', 'SelectionFunc', 'terminalMatchAddGregex' --- hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 32 + VteSelect, + SelectionFunc, + VteChar(..), + +-- * Enums + TerminalEraseBinding(..), + TerminalCursorBlinkMode(..), + TerminalCursorShape(..), + RegexCompileFlags(..), + RegexMatchFlags(..), hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 47 - TerminalEraseBinding(..), - TerminalAntiAlias(..), - TerminalCursorShape(..), - TerminalCursorBlinkMode(..), hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 88 - terminalSetCursorBlinks, hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 93 - terminalSetFontFromStringFull, - terminalSetFontFull, hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 94 - terminalGetUsingXft, hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 102 - -- terminalGetText, - -- terminalGetTextIncludeTrailingSpaces, - -- terminalGetTextRange, - -- SelectionFunc, + terminalGetText, + terminalGetTextIncludeTrailingSpaces, + terminalGetTextRange, hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 107 - terminalMatchAdd, - -- terminalMatchAddGregex, + terminalMatchAddRegex, hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 111 + terminalMatchSetCursorType, hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 121 - terminalGetCharAscent, - terminalGetCharDescent, hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 215 -{#enum VteTerminalEraseBinding as TerminalEraseBinding {underscoreToCase}#} -{#enum VteTerminalCursorShape as TerminalCursorShape {underscoreToCase}#} -{#enum VteTerminalCursorBlinkMode as TerminalCursorBlinkMode {underscoreToCase}#} -{#enum VteTerminalAntiAlias as TerminalAntiAlias {underscoreToCase}#} +-------------------- +-- Types +-- | A predicate that states which characters are of interest. [_$_] +-- The predicate @p c r@ should return @True@ if the character at column @c@ and row @r@ should be extracted. +type VteSelect = + Int + -> Int [_$_] + -> Bool + +{#pointer SelectionFunc#} + +-- | A structure describing the individual characters in the visible part of +-- a terminal window. +-- +data VteChar = VteChar { + vcRow :: Int, + vcCol :: Int, + vcChar :: Char, + vcFore :: Color, + vcBack :: Color, + vcUnderline :: Bool, + vcStrikethrough :: Bool + } hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 240 --- Constructors +-- Utils +-- | Utils function to transform 'VteAttributes' to 'VteChar'. +attrToChar :: Char -> VteAttributes -> VteChar +attrToChar ch (VteAttributes r c f b u s) = VteChar r c ch f b u s + [_$_] +foreign import ccall "wrapper" mkVteSelectionFunc :: + (Ptr Terminal -> {#type glong#} -> {#type glong#} -> Ptr () -> IO {#type gboolean#}) + -> IO SelectionFunc + [_$_] +-------------------- +-- Enums +-- | Values for "what should happen when the user hits backspace/delete". [_$_] +-- Use 'EraseAuto' unless the user can cause them to be overridden. +{#enum VteTerminalEraseBinding as TerminalEraseBinding {underscoreToCase} deriving (Bounded,Eq,Show)#} + +-- | Values for the cursor blink setting. +{#enum VteTerminalCursorBlinkMode as TerminalCursorBlinkMode {underscoreToCase} deriving (Bounded,Eq,Show)#} + +-- | Values for the cursor shape setting. +{#enum VteTerminalCursorShape as TerminalCursorShape {underscoreToCase} deriving (Bounded,Eq,Show)#} + +-- | Flags determining how the regular expression is to be interpreted. +{#enum GRegexCompileFlags as RegexCompileFlags {underscoreToCase} deriving (Bounded,Eq,Show) #} +instance Flags RegexCompileFlags hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 265 +-- | Flags determining how the string is matched against the regular +-- expression. +{#enum GRegexMatchFlags as RegexMatchFlags {underscoreToCase} deriving (Bounded,Eq,Show) #} +instance Flags RegexMatchFlags + +-------------------- +-- Constructors hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 279 - --- |Appends menu items for various input methods to the given menu. [_$_] +-- | Appends menu items for various input methods to the given menu. [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 423 --- | Places the selected text in the terminal in the GDK_SELECTION_CLIPBOARD selection. +-- | Places the selected text in the terminal in the 'SelectionClipboard' selection. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 428 --- | Sends the contents of the GDK_SELECTION_CLIPBOARD selection to the terminal's child. [_$_] +-- | Sends the contents of the 'SelectionClipboard' selection to the terminal's child. [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 435 --- | Places the selected text in the terminal in the GDK_SELECTION_PRIMARY selection. +-- | Places the selected text in the terminal in the 'SelectionPrimary' selection. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 440 --- | Sends the contents of the GDK_SELECTION_PRIMARY selection to the terminal's child. [_$_] +-- | Sends the contents of the 'SelectionPrimary' selection to the terminal's child. [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 442 --- The terminal will call also paste the GDK_SELECTION_PRIMARY selection when the user clicks with the the second mouse button. +-- The terminal will call also paste the 'SelectionPrimary' selection when the user clicks with the the second mouse button. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 471 - -> IO Bool -- ^ return @True@ if audible bell is enabled, FALSE if not [_$_] + -> IO Bool -- ^ return @True@ if audible bell is enabled, @False@ if not [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 489 - -> IO Bool -- ^ return @True@ if visible bell is enabled, FALSE if not [_$_] + -> IO Bool -- ^ return @True@ if visible bell is enabled, @False@ if not [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 494 --- | Controls whether or not the terminal will attempt to draw bold text, either by using a bold font variant or by repainting text with a different offset. +-- | Controls whether or not the terminal will attempt to draw bold text, [_$_] +-- either by using a bold font variant or by repainting text with a different offset. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 506 - -> IO Bool -- ^ return @True@ if bolding is enabled, FALSE if not [_$_] + -> IO Bool -- ^ return @True@ if bolding is enabled, @False@ if not [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 649 --- | If a background image has been set using 'terminalSetBackgroundImage', 'terminalSetBackgroundImageFile', or 'terminalSetBackgroundTransparent', and the saturation value is less than 1.0, the terminal will adjust the colors of the image before drawing the image. [_$_] +-- | If a background image has been set using 'terminalSetBackgroundImage', 'terminalSetBackgroundImageFile', or 'terminalSetBackgroundTransparent', [_$_] +-- and the saturation value is less than 1.0, the terminal will adjust the colors of the image before drawing the image. [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 659 --- | Sets the terminal's background image to the pixmap stored in the root window, adjusted so that if there are no windows below your application, the widget will appear to be transparent. +-- | Sets the terminal's background image to the pixmap stored in the root window, adjusted so that if there are no windows below your application, [_$_] +-- the widget will appear to be transparent. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 668 --- | If a background image has been set using 'terminalSetBackgroundImage', 'terminalSetBackgroundImageFile', or 'terminalSetBackgroundTransparent', and the value set by 'terminalSetBackgroundSaturation' is less than one, the terminal will adjust the color of the image before drawing the image. [_$_] --- To do so, the terminal will create a copy of the background image (or snapshot of the root window) and modify its pixel values. The initial tint color is black. +-- | If a background image has been set using 'terminalSetBackgroundImage', 'terminalSetBackgroundImageFile', or 'terminalSetBackgroundTransparent', [_$_] +-- and the value set by 'terminalSetBackgroundSaturation' is less than one, the terminal will adjust the color of the image before drawing the image. [_$_] +-- To do so, the terminal will create a copy of the background image (or snapshot of the root window) and modify its pixel values. [_$_] +-- The initial tint color is black. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 716 --- | Sets whether or not the cursor will blink. --- WARNING: 'terminalSetCursorBlinks' is deprecated and should not be used in newly-written code. 0.17.1 --- Use 'terminalSetCursorBlinkMode' instead. -terminalSetCursorBlinks :: [_$_] - TerminalClass self => self - -> Bool -- ^ @blink@ - @True@ if the cursor should blink [_$_] - -> IO () -terminalSetCursorBlinks terminal blink = - {#call terminal_set_cursor_blinks#} (toTerminal terminal) (fromBool blink) - [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 739 --- The size of the scrollback buffer will be set to the larger of this value and the number of visible rows the widget can display, so 0 can safely be used to disable scrollback. [_$_] +-- The size of the scrollback buffer will be set to the larger of this value and the number of visible rows the widget can display, [_$_] +-- so 0 can safely be used to disable scrollback. [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 759 --- | A convenience function which converts name into a FontDescription and passes it to 'terminalSetFont'. +-- | A convenience function which converts name into a 'FontDescription' and passes it to 'terminalSetFont'. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 768 --- | A convenience function which converts name into a 'FontDescription' and passes it to 'terminalSetFontFull'. --- WARNING: 'terminalSetFontFromStringFull' is deprecated and should not be used in newly-written code. 0.19.1 --- --- * Available since Vte version 0.11.11 --- -terminalSetFontFromStringFull :: [_$_] - TerminalClass self => self - -> String -- ^ @name@ - A string describing the font. [_$_] - -> TerminalAntiAlias -- ^ @antialias@ - Whether or not to antialias the font (if possible). [_$_] - -> IO () -terminalSetFontFromStringFull terminal name antialias = - withUTFString name $ \namePtr -> - {#call terminal_set_font_from_string_full#} (toTerminal terminal) namePtr $ fromIntegral (fromEnum antialias) - --- | Sets the font used for rendering all text displayed by the terminal, overriding any fonts set using 'widgetModifyFont'. [_$_] --- The terminal will immediately attempt to load the desired font, retrieve its metrics, and attempt to resize itself to keep the same number of rows and columns. --- WARNING: terminalSetFontFull' is deprecated and should not be used in newly-written code. 0.19.1 --- --- * Available since Vte version 0.11.11 --- -terminalSetFontFull :: [_$_] - TerminalClass self => self - -> FontDescription -- ^ @fontDesc@ - the 'FontDescription' of the desired font. [_$_] - -> TerminalAntiAlias -- ^ @antialias@ - specify if anti aliasing of the fonts is to be used or not. [_$_] - -> IO () -terminalSetFontFull terminal fontDesc antialias = - {#call terminal_set_font_full#} (toTerminal terminal) fontDesc $fromIntegral (fromEnum antialias) - hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 776 --- | A 'Terminal' can use multiple methods to draw text. [_$_] --- This function allows an application to determine whether or not the current method uses fontconfig to find fonts. [_$_] --- This setting cannot be changed by the caller, but in practice usually matches the behavior of GTK+ itself. -terminalGetUsingXft :: [_$_] - TerminalClass self => self - -> IO Bool -- ^ return @True@ is use xft font. -terminalGetUsingXft terminal = - liftM toBool $ - {#call terminal_get_using_xft#} (toTerminal terminal) - hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 777 --- Note that this is different from determining if the terminal is the owner of any GtkClipboard items. +-- Note that this is different from determining if the terminal is the owner of any 'GtkClipboard' items. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 806 --- | Modifies the terminal's backspace key binding, which controls what string or control sequence the terminal sends to its child when the user presses the backspace key. +-- | Modifies the terminal's backspace key binding, [_$_] +-- which controls what string or control sequence the terminal sends to its child when the user presses the backspace key. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 815 --- | Modifies the terminal's delete key binding, which controls what string or control sequence the terminal sends to its child when the user presses the delete key. +-- | Modifies the terminal's delete key binding, [_$_] +-- which controls what string or control sequence the terminal sends to its child when the user presses the delete key. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 842 --- | Resets as much of the terminal's internal state as possible, discarding any unprocessed input data, resetting character attributes, cursor state, national character set state, status line, terminal modes (insert/delete), selection state, and encoding. +-- | Resets as much of the terminal's internal state as possible, discarding any unprocessed input data, [_$_] +-- resetting character attributes, cursor state, national character set state, status line, [_$_] +-- terminal modes (insert/delete), selection state, and encoding. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 853 --- | A predicate that states which characters are of interest. -type VteSelect = - Int -- ^ the column of the character - -> Int -- ^ the row of the character - -> Bool -- ^ @True@ if the character should be inspected - --- | A structure describing the individual characters in the visible part of --- a terminal window. --- -data VteChar = VteChar { - vcRow :: Int, - vcCol :: Int, - vcChar :: Char, - vcFore :: Color, - vcBack :: Color, - vcUnderline :: Bool, - vcStrikethrough :: Bool - } - -attrToChar :: Char -> VteAttributes -> VteChar -attrToChar ch (VteAttributes r c f b u s) = VteChar r c ch f b u s - [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 863 - -> IO [VteChar] + -> IO [VteChar] -- ^ return a text string hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 879 - -{#pointer VteSelectionFunc#} - -foreign import ccall "wrapper" mkVteSelectionFunc :: - (Ptr Terminal -> {#type glong#} -> {#type glong#} -> Ptr () -> IO {#type gboolean#}) - -> IO VteSelectionFunc - [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 881 --- If is_selected is not NULL, characters will only be read if is_selected returns TRUE after being passed the column and row, respectively. [_$_] +-- If is_selected is not @Nothing@, characters will only be read if is_selected returns @True@ after being passed the column and row, respectively. [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 887 --- TODO: --- terminalGetTextIncludeTrailingSpaces +terminalGetTextIncludeTrailingSpaces :: [_$_] + TerminalClass self => self + -> Maybe VteSelect -- ^ @Just p@ for a predicate @p@ that determines + -- which character should be extracted or @Nothing@ + -- to select all characters [_$_] + -> IO [VteChar] -- ^ return a text string +terminalGetTextIncludeTrailingSpaces terminal mCB = do + cbPtr <- case mCB of + Just cb -> mkVteSelectionFunc $ \_ c r _ -> + return (fromBool (cb (fromIntegral c) (fromIntegral r))) + Nothing -> return nullFunPtr + gArrPtr <- {#call unsafe g_array_new#} 0 0 + (fromIntegral (sizeOf (undefined :: VteAttributes))) + strPtr <- {#call terminal_get_text_include_trailing_spaces #} (toTerminal terminal) cbPtr nullPtr gArrPtr + str <- if strPtr==nullPtr then return "" else peekUTFString strPtr + (len,elemPtr) <- gArrayContent (castPtr gArrPtr) + attrs <- (flip mapM) [0..len-1] $ peekElemOff elemPtr + unless (cbPtr==nullFunPtr) $ freeHaskellFunPtr cbPtr + {#call unsafe g_free#} (castPtr strPtr) + {#call unsafe g_array_free#} gArrPtr 1 + return (zipWith attrToChar str attrs) hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 910 --- If is_selected is not NULL, characters will only be read if is_selected returns TRUE after being passed the column and row, respectively. [_$_] +-- If is_selected is not @Nothing@, characters will only be read if is_selected returns @True@ after being passed the column and row, respectively. [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 913 --- TODO: --- terminalGetTextRange - --- | Specifies the type of a selection function used to check whether a cell has to be selected or not. --- TODO: --- SelectionFunc +-- +terminalGetTextRange :: + TerminalClass self => self + -> Int -- ^ @sRow@ first row to search for data [_$_] + -> Int -- ^ @sCol@ first column to search for data [_$_] + -> Int -- ^ @eRow@ last row to search for data [_$_] + -> Int -- ^ @eCol@ last column to search for data [_$_] + -> Maybe VteSelect -- ^ @Just p@ for a predicate @p@ that determines + -- which character should be extracted or @Nothing@ + -- to select all characters + -> IO [VteChar] -- ^ return a text string +terminalGetTextRange terminal sRow sCol eRow eCol mCB = do [_$_] + cbPtr <- case mCB of + Just cb -> mkVteSelectionFunc $ \_ c r _ -> + return (fromBool (cb (fromIntegral c) (fromIntegral r))) + Nothing -> return nullFunPtr + gArrPtr <- {#call unsafe g_array_new#} 0 0 + (fromIntegral (sizeOf (undefined :: VteAttributes))) + strPtr <- {#call terminal_get_text_range #} (toTerminal terminal) (fromIntegral sRow) (fromIntegral sCol) (fromIntegral eRow) (fromIntegral eCol) cbPtr nullPtr gArrPtr + str <- if strPtr==nullPtr then return "" else peekUTFString strPtr + (len,elemPtr) <- gArrayContent (castPtr gArrPtr) + attrs <- (flip mapM) [0..len-1] $ peekElemOff elemPtr + unless (cbPtr==nullFunPtr) $ freeHaskellFunPtr cbPtr + {#call unsafe g_free#} (castPtr strPtr) + {#call unsafe g_array_free#} gArrPtr 1 + return (zipWith attrToChar str attrs) hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 958 --- | Adds a regular expression to the list of matching expressions. [_$_] --- When the user moves the mouse cursor over a section of displayed text which matches this expression, the text will be highlighted. --- WARNING: 'terminalMatchAdd' is deprecated and should not be used in newly-written code. -terminalMatchAdd :: [_$_] - TerminalClass self => self - -> String -- ^ @match@ - a regular expression [_$_] - -> IO Int -- ^ return an integer associated with this expression -terminalMatchAdd terminal match = - liftM fromIntegral $ - withUTFString match $ \matchPtr -> - {#call terminal_match_add#} (toTerminal terminal) matchPtr - --- | Flags determining how the regular expression is to be interpreted. -{#enum GRegexCompileFlags as RegexCompileFlags {underscoreToCase} deriving (Bounded,Eq,Show) #} - -instance Flags RegexCompileFlags - --- | Flags determining how the string is matched against the regular --- expression. -{#enum GRegexMatchFlags as RegexMatchFlags {underscoreToCase} deriving (Bounded,Eq,Show) #} - -instance Flags RegexMatchFlags - [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 961 +-- NOTE: see http://library.gnome.org/devel/glib/stable/glib-regex-syntax.html for details about GRegex. +-- hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 987 --- | Checks if the text in and around the specified position matches any of the regular expressions previously set using 'terminalMatchAdd'. [_$_] --- If a match exists, the text string is returned and if tag is not @Nothing@, the number associated with the matched regular expression will be stored in tag. --- If more than one regular expression has been set with 'terminalMatchAdd', then expressions are checked in the order in which they were added. +-- | Checks if the text in and around the specified position matches any of the regular expressions previously set using 'terminalMatchAddRegex'. [_$_] +-- If a match exists, the text string is returned and if tag is not @Nothing@, [_$_] +-- the number associated with the matched regular expression will be stored in tag. +-- If more than one regular expression has been set with 'terminalMatchAddRegex', then expressions are checked in the order in which they were added. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 995 - -> IO (String -- ^ return pointer to an integer - ,Int) -- ^ return a string which matches one of the previously set regular expressions, and which must be freed by the caller. + -> IO (String -- ^ return a string which matches one of the previously set regular expressions, and which must be freed by the caller. + ,Int) -- ^ return pointer to an integer hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1022 --- terminalMatchSetCursorType +terminalMatchSetCursorType :: [_$_] + TerminalClass self => self + -> Int -- ^ @tag@ the tag of the regex which should use the specified cursor [_$_] + -> CursorType -- ^ @cursorType@ a 'CursorType' + -> IO () +terminalMatchSetCursorType terminal tag cursorType = [_$_] + {#call terminal_match_set_cursor_type#} (toTerminal terminal) (fromIntegral tag) $fromIntegral (fromEnum cursorType) [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1088 --- | Some terminal emulations specify a status line which is separate from the main display area, and define a means for applications to move the cursor to the status line and back. +-- | Some terminal emulations specify a status line which is separate from the main display area, [_$_] +-- and define a means for applications to move the cursor to the status line and back. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1119 --- | Get terminal 's char ascent. --- WARNING: 'terminalGetCharAscent' is deprecated and should not be used in newly-written code. 0.19.1 -terminalGetCharAscent :: [_$_] - TerminalClass self => self - -> IO Int -- ^ return the contents of terminal's char_ascent field [_$_] -terminalGetCharAscent terminal = - liftM fromIntegral $ - {#call terminal_get_char_ascent#} (toTerminal terminal) - [_$_] --- | Get terminal's char descent. [_$_] --- WARNING: 'terminalGetCharDescent' is deprecated and should not be used in newly-written code. 0.19.1 -terminalGetCharDescent :: [_$_] - TerminalClass self => self - -> IO Int -- ^ return the contents of terminal's char_descent field [_$_] -terminalGetCharDescent terminal = - liftM fromIntegral $ - {#call terminal_get_char_descent#} (toTerminal terminal) - [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1226 --- | If a background image has been set using "background-image-file:" or "background-image-pixbuf:", or "background-transparent:", and the saturation value is less than 1.0, the terminal will adjust the colors of the image before drawing the image. [_$_] +-- | If a background image has been set using "background-image-file:" or "background-image-pixbuf:", or "background-transparent:", [_$_] +-- and the saturation value is less than 1.0, the terminal will adjust the colors of the image before drawing the image. [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1240 --- | If a background image has been set using "background-image-file:" or "background-image-pixbuf:", or "background-transparent:", and and the value set by 'Terminal' background-saturation: is less than 1.0, the terminal will adjust the color of the image before drawing the image. [_$_] +-- | If a background image has been set using "background-image-file:" or "background-image-pixbuf:", or "background-transparent:", [_$_] +-- and the value set by 'Terminal' background-saturation: is less than 1.0, the terminal will adjust the color of the image before drawing the image. [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1252 --- | Sets whther the terminal uses the pixmap stored in the root window as the background, adjusted so that if there are no windows below your application, the widget will appear to be transparent. +-- | Sets whther the terminal uses the pixmap stored in the root window as the background, [_$_] +-- adjusted so that if there are no windows below your application, the widget will appear to be transparent. +-- hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1267 --- Default value: VTE_ERASE_AUTO +-- Default value: 'EraseAuto' hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1277 --- Using VTE_CURSOR_BLINK_SYSTEM will use the "gtk-cursor-blink" setting. +-- Using 'CursorBlinkSystem' will use the "gtk-cursor-blink" setting. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1279 --- Default value: VTE_CURSOR_BLINK_SYSTEM +-- Default value: 'CursorBlinkSystem' hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1290 --- Default value: VTE_CURSOR_SHAPE_BLOCK +-- Default value: 'CursorShapeBlock' hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1301 --- Default value: VTE_ERASE_AUTO +-- Default value: 'EraseAuto' hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1335 --- | Specifies the font used for rendering all text displayed by the terminal, overriding any fonts set using gtk_widget_modify_font(). [_$_] --- The terminal will immediately attempt to load the desired font, retrieve its metrics, and attempt to resize itself to keep the same number of rows and columns. +-- | Specifies the font used for rendering all text displayed by the terminal, overriding any fonts set using 'widgetModifyFont'. +-- The terminal will immediately attempt to load the desired font, retrieve its metrics, [_$_] +-- and attempt to resize itself to keep the same number of rows and columns. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1346 --- | The terminal's so-called icon title, or NULL if no icon title has been set. +-- | The terminal's so-called icon title, or empty if no icon title has been set. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1449 --- As a special case, when setting this to NULL or the empty string, the terminal will treat all graphic non-punctuation non-space characters as word +-- As a special case, when setting this to the empty string, the terminal will treat all graphic non-punctuation non-space characters as word hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1504 --- | Emitted whenever the terminal's current encoding has changed, either as a result of receiving a control sequence which toggled between the local and UTF-8 encodings, or at the parent application's request. +-- | Emitted whenever the terminal's current encoding has changed, [_$_] +-- either as a result of receiving a control sequence which toggled between the local and UTF-8 encodings, or at the parent application's request. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1510 --- This signal is frequently (but not always) emitted with a "child-exited" signal. +-- This signal is frequently (but not always) emitted with a 'childExited' signal. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1563 --- Usually scrolled containers like 'ScrolledWindow' will emit this signal to connect two instances of 'Scrollbar' to the scroll directions of the 'Terminal'. +-- Usually scrolled containers like 'ScrolledWindow' will emit this [_$_] +-- signal to connect two instances of 'Scrollbar' to the scroll directions of the 'Terminal'. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1572 --- | An internal signal used for communication between the terminal and its accessibility peer. May not be emitted under certain circumstances. +-- | An internal signal used for communication between the terminal and its accessibility peer. [_$_] +-- May not be emitted under certain circumstances. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1577 --- | An internal signal used for communication between the terminal and its accessibility peer. May not be emitted under certain circumstances. +-- | An internal signal used for communication between the terminal and its accessibility peer. [_$_] +-- May not be emitted under certain circumstances. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1582 --- | An internal signal used for communication between the terminal and its accessibility peer. May not be emitted under certain circumstances. +-- | An internal signal used for communication between the terminal and its accessibility peer. [_$_] +-- May not be emitted under certain circumstances. hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1587 --- | An internal signal used for communication between the terminal and its accessibility peer. May not be emitted under certain circumstances. +-- | An internal signal used for communication between the terminal and its accessibility peer. [_$_] +-- May not be emitted under certain circumstances. |
From: Axel S. <si...@co...> - 2009-09-26 15:13:18
|
Thu Sep 24 20:34:44 EDT 2009 Andy Stewart <laz...@gm...> * Binding for VTE 2.0 library Ignore-this: 4d04c0c8aeddbc984358b55dd54843ec hunk ./Makefile.am 50 + mkdir $(distdir)/vte/Graphics/UI/Gtk/Vte + touch $(distdir)/vte/Graphics/UI/Gtk/Vte/.keep hunk ./Makefile.am 78 +if ENABLE_VTE +pkglib_LIBRARIES += libHSvte.a +endif hunk ./Makefile.am 1124 +# +## vte package +# +################################################################################## + +if ENABLE_VTE + +vte_PKGNAME = libHSvte_a + +libHSvte_a_NAME = vte +libHSvte_a_CONFIG = vte/vte.package.conf +libHSvte_a_EXTERNALDEPS = base-$(PKG_BASE_VERSION) +libHSvte_a_INTERNALDEPS = gtk glib +libHSvte_a_HEADER = vte/vte.h +libHSvte_a_PRECOMP = vte/vte.precomp +libHSvte_a_LIBS = $(GLIB_LIBS) $(GTK_LIBS) $(VTE_LIBS) +libHSvte_a_HCFLAGS = $(FFI) +libHSvte_a_CFLAGS = $(filter-out -I% -D%,$(GLIB_CFLAGS) $(GTK_CFLAGS) $(VTE_CFLAGS)) [_$_] +libHSvte_a_CPPFLAGS = $(filter -I% -D%,$(GLIB_CFLAGS) $(GTK_CFLAGS) $(VTE_CFLAGS)) + + +libHSvte_a_SOURCESDIRS = vte + +libHSvte_a_GENERATEDSOURCES = \ + vte/Graphics/UI/Gtk/Vte/Types.chs + +nodist_libHSvte_a_SOURCES = $(libHSvte_a_GENERATEDSOURCES) + +libHSvte_a_SOURCES = \ + vte/Graphics/UI/Gtk/Vte/Vte.chs + +htmldoc_HSFILES_HIDDEN += $(libHSvte_a_GENERATEDSOURCES:.chs=.hs) + +vte_Graphics_UI_Gtk_Vte_Types_hs_HCFLAGS = -fglasgow-exts [_$_] + +vte/Graphics/UI/Gtk/Vte/Types.chs : $(srcdir)/tools/hierarchyGen/hierarchy.list \ + $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ + $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template + $(strip $(srcdir)/tools/hierarchyGen/TypeGenerator$(EXEEXT) \ + $(srcdir)/tools/hierarchyGen/hierarchy.list \ + $(srcdir)/tools/hierarchyGen/Hierarchy.chs.template \ + $@ --tag=vte --lib=vte --prefix=vte \ + --modname=Graphics.UI.Gtk.Vte.Types \ + --parentname=Graphics.UI.Gtk.Types) + +libHSvte_a_ALLSOURCES = $(libHSvte_a_SOURCES) $(nodist_libHSvte_a_SOURCES) + +am_libHSvte_a_OBJECTS = \ + $(addsuffix .$(OBJEXT),$(basename $(basename $(libHSvte_a_ALLSOURCES)))) + +libHSvte_a_HSPPFILES = $(filter %.hs.pp, $(libHSvte_a_ALLSOURCES)) +libHSvte_a_CHSPPFILES = $(filter %.chs.pp,$(libHSvte_a_ALLSOURCES)) +libHSvte_a_CHSFILES = \ + $(filter %.chs,$(libHSvte_a_ALLSOURCES:.chs.pp=.chs)) +libHSvte_a_CHSFILES_HS = $(libHSvte_a_CHSFILES:.chs=.hs) +libHSvte_a_HSCFILES = $(filter %.hsc, $(libHSvte_a_ALLSOURCES)) +libHSvte_a_HSCFILES_HS = $(libHSvte_a_HSCFILES:.hsc=.hs) +libHSvte_a_BUILDSOURCES = \ + $(libHSvte_a_HSPPFILES:.hs.pp=.hs) \ + $(libHSvte_a_CHSPPFILES:.chs.pp=.chs) \ + $(libHSvte_a_CHSFILES_HS) \ + $(libHSvte_a_HSCFILES_HS) \ + $(libHSvte_a_GENERATEDSOURCES) +libHSvte_a_HSFILES = \ + $(filter %.hs,$(libHSvte_a_BUILDSOURCES)) \ + $(filter %.hs,$(libHSvte_a_ALLSOURCES)) + +nobase_hi_DATA += $(libHSvte_a_HSFILES:.hs=.hi) + +vte_MOSTLYCLEANFILES = $(am_libHSvte_a_OBJECTS) +vte_MOSTLYCLEANFILES += $(libHSvte_a_HSFILES:.hs=.hi) +vte_MOSTLYCLEANFILES += $(libHSvte_a_CHSFILES:.chs=.chi) +vte_CLEANFILES = $(libHSvte_a_BUILDSOURCES) +vte_CLEANFILES += $(libHSvte_a_CHSFILES_HS:.hs=.dep) +vte_CLEANFILES += \ + $(libHSvte_a_HSCFILES:.hsc=_hsc_make$(EXEEXT)) \ + $(libHSvte_a_HSCFILES:.hsc=_hsc_make.c) \ + $(libHSvte_a_HSCFILES:.hsc=_hsc_make.o) + +vte/libHSvte_a.deps: $(libHSvte_a_HSFILES) | \ + $(foreach pkg,$(libHSvte_a_INTERNALDEPS),$(pkg)/libHS$(pkg)_a.deps) +$(libHSvte_a_CHSFILES:.chs=.dep): \ + $(foreach pkg,vte $(libHSglib_a_INTERNALDEPS),$(libHS$(pkg)_a_CHSFILES)) +$(libHSvte_a_CHSFILES_HS): $(libHSvte_a_PRECOMP) +$(libHSvte_a_OBJECTS) : \ + $(foreach pkg,$(libHSvte_a_INTERNALDEPS),$(libHS$(pkg)_a_OBJECTS)) + +EARLY_DEPS += $(libHSvte_a_CHSFILES:.chs=.dep) + +ifeq (,$(DONT_USE_DEPS)) +-include $(libHSvte_a_CHSFILES:.chs=.dep) vte/libHSvte_a.deps + endif + +if ENABLE_SPLITOBJS +libHSvte_a_AR = $(srcdir)/mk/link-splitobjs.sh +vte_CLEANFILES_SPLIT = $(libHSvte_a_HSFILES:.hs=_split/) +else +libHSvte_a_AR = $(AR) $(ARFLAGS) +endif + +libHSvte_a_DEPENDENCIES = HSvte.o +pkglib_DATA += HSvte.o +HSvte.o : $(libHSvte_a_OBJECTS) + $(LD) -r $(LD_X) -o $@ $(libHSvte_a_OBJECTS) $(libHSvte_a_LIBADD) + +if ENABLE_PROFILING +libHSvte_a_DEPENDENCIES += libHSvte_p.a +pkglib_DATA += libHSvte_p.a +libHSvte_p.a : $(libHSvte_a_HSFILES:.hs=.p_o) \ + $(libHSvte_a_LIBADD:.o=.p_o) + $(AR) $(ARFLAGS) $@ $^ + +ifeq (,$(DONT_USE_DEPS)) +-include vte/libHSvte_a.p_deps + endif + +nobase_hi_DATA += $(libHSvte_a_HSFILES:.hs=.p_hi) +vte_MOSTLYCLEANFILES += $(libHSvte_a_HSFILES:.hs=.p_hi) +vte_MOSTLYCLEANFILES += $(libHSvte_a_HSFILES:.hs=.p_o) +vte_MOSTLYCLEANFILES += $(libHSvte_a_LIBADD:.o=.p_o) +endif + +endif #ENABLE_VTE + hunk ./configure.ac 321 +GTKHS_PKG_CHECK(vte, vte, VTE, [vte >= 0.20], [GLIB GTK], + [build vte package (default=auto)], + [vte library requirement not met. Perhaps you need to install vte or vte-devel]) + hunk ./configure.ac 444 + GTKHS_GLIBC_PTHREAD_HACK(VTE_LIBS) hunk ./configure.ac 617 +GTKHS_PACKAGE_FILTER_CFLAGS([VTE_CFLAGS], [$GLIB_CFLAGS $GTK_CFLAGS], [$VTE_CFLAGS]) +GTKHS_PACKAGE_FILTER_LIBS([VTE_LIBS], [$GLIB_LIBS $GTK_LIBS], [$VTE_LIBS]) + hunk ./configure.ac 697 +GTKHS_REFORMAT_PACKAGE_CFLAGS(VTE_CFLAGS, VTE_CFLAGS_CQ) +GTKHS_REFORMAT_PACKAGE_LIBS(VTE_LIBS, VTE_LIBS_CQ, + VTE_LIBDIR_CQ, VTE_LIBEXTRA_CQ) +AC_SUBST(VTE_CFLAGS_CQ) +AC_SUBST(VTE_LIBS_CQ) +AC_SUBST(VTE_LIBDIR_CQ) +AC_SUBST(VTE_LIBEXTRA_CQ) + hunk ./configure.ac 946 + vte/vte.package.conf vte/vte.cabal hunk ./configure.ac 971 +echo "* vte : ${ENABLE_VTE} " adddir ./demo/vte addfile ./demo/vte/Makefile hunk ./demo/vte/Makefile 1 + +PROG = vte [_$_] +SOURCES = Vte.hs + +$(PROG) : $(SOURCES) + $(HC) --make $< -o $@ $(HCFLAGS) -XForeignFunctionInterface + +clean: + rm -f $(SOURCES:.hs=.hi) $(SOURCES:.hs=.o) $(PROG) + +HC=ghc addfile ./demo/vte/Vte.hs hunk ./demo/vte/Vte.hs 1 + -- A simple program to demonstrate Vte Binding by Cjacker Huang +module Main where + +import Graphics.UI.Gtk +import Graphics.UI.Gtk.Vte.Vte +import Graphics.UI.Gtk.Pango.Font + +main = do + initGUI + window <- windowNew + onDestroy window mainQuit + widgetSetSizeRequest window 640 480 + + scrolled <- scrolledWindowNew Nothing Nothing + scrolledWindowSetPolicy scrolled PolicyAutomatic PolicyAutomatic + vte <- terminalNew + terminalForkCommand vte Nothing Nothing Nothing Nothing False False False + font <- fontDescriptionFromString "DejaVu Sans Mono 10" + terminalSetFont vte font + containerAdd scrolled vte + containerAdd window scrolled + on vte childExited $ mainQuit + + widgetShowAll window + + mainGUI hunk ./tools/callbackGen/gtkmarshal.list 125 +# for Vte +VOID:STRING,INT hunk ./tools/hierarchyGen/hierarchy.list 99 + VteTerminal as Terminal if vte adddir ./vte adddir ./vte/Graphics adddir ./vte/Graphics/UI adddir ./vte/Graphics/UI/Gtk adddir ./vte/Graphics/UI/Gtk/Vte addfile ./vte/Graphics/UI/Gtk/Vte/.keep hunk ./vte/Graphics/UI/Gtk/Vte/.keep 1 +keep dir addfile ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 1 +-- -*-haskell-*- +-- GIMP Toolkit (GTK) widget for VTE +-- +-- Author : Andy Stewart +-- +-- Created: 20 Sep 2009 +-- +-- Copyright (C) 2009 Andy Stewart <laz...@gm...> +-- +-- 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 2.1 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. +-- +-- TODO: +-- +-- ** Finish functions binding: +-- 'terminalGetText', 'terminalGetTextIncludeTrailingSpaces' +-- 'terminalGetTextRange', 'SelectionFunc', 'terminalMatchAddGregex' +-- +-- | +-- Maintainer : gtk...@li... +-- Stability : provisional +-- Portability : portable (depends on GHC) +-- +-- A VTE widget for terminal +-- [_$_] +----------------------------------------------------------------------------- +-- [_$_] +module Graphics.UI.Gtk.Vte.Vte ( +-- * Types + Terminal, + +-- * Constructors + terminalNew, + +-- * Methods + TerminalEraseBinding(..), + TerminalAntiAlias(..), + TerminalCursorShape(..), + TerminalCursorBlinkMode(..), + terminalImAppendMenuitems, + terminalForkCommand, + terminalForkpty, + terminalSetPty, + terminalGetPty, + terminalFeed, + terminalFeedChild, + terminalFeedChildBinary, + terminalGetChildExitStatus, + terminalSelectAll, + terminalSelectNone, + terminalCopyClipboard, + terminalPasteClipboard, + terminalCopyPrimary, + terminalPastePrimary, + terminalSetSize, + terminalSetAudibleBell, + terminalGetAudibleBell, + terminalSetVisibleBell, + terminalGetVisibleBell, + terminalSetAllowBold, + terminalGetAllowBold, + terminalSetScrollOnOutput, + terminalSetScrollOnKeystroke, + terminalSetColorBold, + terminalSetColorForeground, + terminalSetColorBackground, + terminalSetColorDim, + terminalSetColorCursor, + terminalSetColorHighlight, + terminalSetColors, + terminalSetDefaultColors, + terminalSetOpacity, + terminalSetBackgroundImage, + terminalSetBackgroundImageFile, + terminalSetBackgroundSaturation, + terminalSetBackgroundTransparent, + terminalSetBackgroundTintColor, + terminalSetScrollBackground, + terminalSetCursorShape, + terminalGetCursorShape, + terminalSetCursorBlinks, + terminalSetCursorBlinkMode, + terminalGetCursorBlinkMode, + terminalSetScrollbackLines, + terminalSetFont, + terminalSetFontFromString, + terminalSetFontFromStringFull, + terminalSetFontFull, + terminalGetFont, + terminalGetUsingXft, + terminalGetHasSelection, + terminalSetWordChars, + terminalIsWordChar, + terminalSetBackspaceBinding, + terminalSetDeleteBinding, + terminalSetMouseAutohide, + terminalGetMouseAutohide, + terminalReset, + -- terminalGetText, + -- terminalGetTextIncludeTrailingSpaces, + -- terminalGetTextRange, + -- SelectionFunc, + terminalGetCursorPosition, + terminalMatchClearAll, + terminalMatchAdd, + -- terminalMatchAddGregex, + terminalMatchRemove, + terminalMatchCheck, + terminalMatchSetCursor, + terminalMatchSetCursorName, + terminalSetEmulation, + terminalGetEmulation, + terminalGetDefaultEmulation, + terminalSetEncoding, + terminalGetEncoding, + terminalGetStatusLine, + terminalGetPadding, + terminalGetAdjustment, + terminalGetCharAscent, + terminalGetCharDescent, + terminalGetCharHeight, + terminalGetCharWidth, + terminalGetColumnCount, + terminalGetRowCount, + terminalGetIconTitle, + terminalGetWindowTitle, + +-- * Attributes + terminalAllowBold, + terminalAudibleBell, + terminalBackgroundImageFile, + terminalBackgroundImagePixbuf, + terminalBackgroundOpacity, + terminalBackgroundSaturation, + terminalBackgroundTintColor, + terminalBackgroundTransparent, + terminalBackspaceBinding, + terminalCursorBlinkMode, + terminalCursorShape, + terminalDeleteBinding, + terminalEmulation, + terminalEncoding, + terminalFontDesc, + terminalIconTitle, + terminalPointerAutohide, + terminalPty, + terminalScrollBackground, + terminalScrollOnKeystroke, + terminalScrollOnOutput, + terminalScrollbackLines, + terminalVisibleBell, + terminalWindowTitle, + terminalWordChars, + +-- * Signals + beep, + charSizeChanged, + childExited, + commit, + contentsChanged, + copyClipboard, + cursorMoved, + decreaseFontSize, + deiconifyWindow, + emulationChanged, + encodingChanged, + eof, + iconTitleChanged, + iconifyWindow, + increaseFontSize, + lowerWindow, + maximizeWindow, + moveWindow, + pasteClipboard, + raiseWindow, + refreshWindow, + resizeWidnow, + restoreWindow, + selectionChanged, + setScrollAdjustments, + statusLineChanged, + textDeleted, + textInserted, + textModified, + textScrolled, + windowTitleChanged, + ) where + +import Control.Monad (liftM) +import Data.Char +import Data.Word + +import System.Posix.Types +import System.Glib.Attributes +import System.Glib.FFI +import System.Glib.UTFString +import System.Glib.Properties +import System.Glib.GList +import System.Glib.GError [_$_] +import Graphics.UI.Gtk.Gdk.GC +import Graphics.UI.Gtk.Gdk.Cursor +import Graphics.UI.Gtk.Pango.Font + +{#import Graphics.UI.Gtk.Abstract.Object#} (makeNewObject) +{#import Graphics.UI.Gtk.Signals#} +{#import Graphics.UI.Gtk.Vte.Types#} +{#import Graphics.UI.Gtk.Pango.Types#} +{#import System.Glib.GObject#} + +{#context lib= "vte" prefix= "vte"#} + +{#enum VteTerminalEraseBinding as TerminalEraseBinding {underscoreToCase}#} +{#enum VteTerminalCursorShape as TerminalCursorShape {underscoreToCase}#} +{#enum VteTerminalCursorBlinkMode as TerminalCursorBlinkMode {underscoreToCase}#} +{#enum VteTerminalAntiAlias as TerminalAntiAlias {underscoreToCase}#} + +-------------------- +-- Constructors + +-- | Create a new terminal widget. +terminalNew :: IO Terminal +terminalNew = [_$_] + makeNewObject mkTerminal $ liftM castPtr {#call terminal_new#} + +-------------------- +-- Methods + +-- |Appends menu items for various input methods to the given menu. [_$_] +-- The user can select one of these items to modify the input method used by the terminal. +terminalImAppendMenuitems :: [_$_] + TerminalClass self => self + -> MenuShell -- ^ @menushell@ - a menu shell of 'MenuShell' + -> IO () [_$_] +terminalImAppendMenuitems terminal menushell = + {#call terminal_im_append_menuitems#} (toTerminal terminal) menushell + +-- | Starts the specified command under a newly-allocated controlling pseudo-terminal. [_$_] +terminalForkCommand :: [_$_] + TerminalClass self => self + -> (Maybe String) -- ^ @command@ - the name of a binary to run, or @Nothing@ to get user's shell [_$_] + -> (Maybe [String]) -- ^ @argv@ - the argument list to be passed to command, or @Nothing@ + -> (Maybe [String]) -- ^ @envv@ - a list of environment variables to be added to the environment before starting command, or @Nothing@ + -> (Maybe String) -- ^ @directory@ - the name of a directory the command should start in, or @Nothing@ [_$_] + -> Bool -- ^ @lastlog@ - @True@ if the session should be logged to the lastlog + -> Bool -- ^ @utmp@ - @True@ if the session should be logged to the utmp/utmpx log [_$_] + -> Bool -- ^ @wtmp@ - @True@ if the session should be logged to the wtmp/wtmpx log [_$_] + -> IO Int -- ^ return the ID of the new process +terminalForkCommand terminal command argv envv directory lastlog utmp wtmp = + liftM fromIntegral $ + maybeWith withUTFString command $ \commandPtr -> + maybeWith withUTFString directory $ \dirPtr -> + maybeWith withUTFStringArray argv $ \argvPtrPtr -> + maybeWith withUTFStringArray envv $ \envvPtrPtr -> + {#call terminal_fork_command#} [_$_] + (toTerminal terminal) [_$_] + commandPtr + argvPtrPtr + envvPtrPtr + dirPtr + (fromBool lastlog) [_$_] + (fromBool utmp) + (fromBool wtmp) + +-- | Starts a new child process under a newly-allocated controlling pseudo-terminal. [_$_] +-- +-- * Available since Vte version 0.11.11 +-- [_$_] +terminalForkpty :: [_$_] + TerminalClass self => self + -> (Maybe [String]) -- ^ @envv@ - a list of environment variables to be added to the environment before starting returning in the child process, or @Nothing@ + -> (Maybe String) -- ^ @directory@ - the name of a directory the child process should change to, or @Nothing@ [_$_] + -> Bool -- ^ @lastlog@ - @True@ if the session should be logged to the lastlog [_$_] + -> Bool -- ^ @utmp@ - @True@ if the session should be logged to the utmp/utmpx log [_$_] + -> Bool -- ^ @wtmp@ - @True@ if the session should be logged to the wtmp/wtmpx log [_$_] + -> IO Int -- ^ return the ID of the new process in the parent, 0 in the child, and -1 if there was an error [_$_] +terminalForkpty terminal envv directory lastlog utmp wtmp = + liftM fromIntegral $ + maybeWith withUTFString directory $ \dirPtr -> + maybeWith withUTFStringArray envv $ \envvPtrPtr -> + {#call terminal_forkpty#} [_$_] + (toTerminal terminal) + envvPtrPtr + dirPtr + (fromBool lastlog) + (fromBool utmp) + (fromBool wtmp) + +-- | Attach an existing PTY master side to the terminal widget. [_$_] +-- Use instead of 'terminalForkCommand' or 'terminalForkpty'. +-- +-- * Available since Vte version 0.12.1 +-- +terminalSetPty :: [_$_] + TerminalClass self => self [_$_] + -> Int -- ^ @ptyMaster@ - a file descriptor of the master end of a PTY [_$_] + -> IO () +terminalSetPty terminal ptyMaster = + {#call terminal_set_pty#} (toTerminal terminal) (fromIntegral ptyMaster) + +-- | Returns the file descriptor of the master end of terminal's PTY. +-- +-- * Available since Vte version 0.19.1 +-- +terminalGetPty :: + TerminalClass self => self + -> IO Int -- ^ return the file descriptor, or -1 if the terminal has no PTY. [_$_] +terminalGetPty terminal = [_$_] + liftM fromIntegral $ [_$_] + {#call terminal_get_pty#} (toTerminal terminal) + +-- | Interprets data as if it were data received from a child process. [_$_] +-- This can either be used to drive the terminal without a child process, or just to mess with your users. +terminalFeed :: [_$_] + TerminalClass self => self [_$_] + -> String -- ^ @string@ - a string in the terminal's current encoding [_$_] + -> Int -- ^ @len@ - the length of the string [_$_] + -> IO () +terminalFeed terminal string len = + withUTFString string $ \strPtr -> + {#call terminal_feed#} (toTerminal terminal) strPtr (fromIntegral len) + +-- | Sends a block of UTF-8 text to the child as if it were entered by the user at the keyboard. +terminalFeedChild :: [_$_] + TerminalClass self => self [_$_] + -> String -- ^ @string@ - data to send to the child [_$_] + -> Int -- ^ @len@ - length of text in bytes, or -1 if text is NUL-terminated [_$_] + -> IO () +terminalFeedChild terminal string len = + withUTFString string $ \strPtr -> + {#call terminal_feed_child#} (toTerminal terminal) strPtr (fromIntegral len) + +-- | Sends a block of binary data to the child. +-- +-- * Available since Vte version 0.12.1 +-- +terminalFeedChildBinary :: [_$_] + TerminalClass self => self [_$_] + -> String -- ^ @string@ - data to send to the child [_$_] + -> Int -- ^ @len@ - length of data [_$_] + -> IO () +terminalFeedChildBinary terminal string len = + withUTFString string $ \strPtr -> + {#call terminal_feed_child_binary#} (toTerminal terminal) strPtr (fromIntegral len) + [_$_] +-- | Gets the exit status of the command started by 'terminalForkCommand'. [_$_] +-- +-- * Available since Vte version 0.19.1 +-- +terminalGetChildExitStatus :: + TerminalClass self => self [_$_] + -> IO Int -- ^ return the child's exit status [_$_] +terminalGetChildExitStatus terminal = + liftM fromIntegral $ + {#call terminal_get_child_exit_status#} (toTerminal terminal) + +-- | Selects all text within the terminal (including the scrollback buffer). +-- +-- * Available since Vte version 0.16 +-- +terminalSelectAll :: TerminalClass self => self -> IO () [_$_] +terminalSelectAll terminal = + {#call terminal_select_all#} (toTerminal terminal) + [_$_] +-- | Clears the current selection. +-- +-- * Available since Vte version 0.16 +-- +terminalSelectNone :: TerminalClass self => self -> IO () [_$_] +terminalSelectNone terminal = + {#call terminal_select_none#} (toTerminal terminal) + +-- | Places the selected text in the terminal in the GDK_SELECTION_CLIPBOARD selection. +terminalCopyClipboard :: TerminalClass self => self -> IO () +terminalCopyClipboard terminal = [_$_] + {#call terminal_copy_clipboard#} (toTerminal terminal) + [_$_] +-- | Sends the contents of the GDK_SELECTION_CLIPBOARD selection to the terminal's child. [_$_] +-- If necessary, the data is converted from UTF-8 to the terminal's current encoding. [_$_] +-- It's called on paste menu item, or when user presses Shift+Insert. +terminalPasteClipboard :: TerminalClass self => self -> IO () +terminalPasteClipboard terminal = + {#call terminal_paste_clipboard#} (toTerminal terminal) + +-- | Places the selected text in the terminal in the GDK_SELECTION_PRIMARY selection. +terminalCopyPrimary :: TerminalClass self => self -> IO () +terminalCopyPrimary terminal = + {#call terminal_copy_primary#} (toTerminal terminal) + +-- | Sends the contents of the GDK_SELECTION_PRIMARY selection to the terminal's child. [_$_] +-- If necessary, the data is converted from UTF-8 to the terminal's current encoding. [_$_] +-- The terminal will call also paste the GDK_SELECTION_PRIMARY selection when the user clicks with the the second mouse button. +terminalPastePrimary :: TerminalClass self => self -> IO () +terminalPastePrimary terminal = + {#call terminal_paste_primary#} (toTerminal terminal) + [_$_] +-- | Attempts to change the terminal's size in terms of rows and columns. [_$_] +-- If the attempt succeeds, the widget will resize itself to the proper size. +terminalSetSize :: [_$_] + TerminalClass self => self [_$_] + -> Int -- ^ @columns@ - the desired number of columns [_$_] + -> Int -- ^ @rows@ - the desired number of rows [_$_] + -> IO () +terminalSetSize terminal columns rows = + {#call terminal_set_size#} [_$_] + (toTerminal terminal) + (fromIntegral columns) + (fromIntegral rows) + [_$_] +-- | Controls whether or not the terminal will beep when the child outputs the "bl" sequence. +terminalSetAudibleBell :: [_$_] + TerminalClass self => self [_$_] + -> Bool -- ^ @isAudible@ - @True@ if the terminal should beep [_$_] + -> IO () [_$_] +terminalSetAudibleBell terminal isAudible = + {#call terminal_set_audible_bell#} (toTerminal terminal) (fromBool isAudible) + [_$_] +-- | Checks whether or not the terminal will beep when the child outputs the "bl" sequence. +terminalGetAudibleBell :: [_$_] + TerminalClass self => self [_$_] + -> IO Bool -- ^ return @True@ if audible bell is enabled, FALSE if not [_$_] +terminalGetAudibleBell terminal = + liftM toBool $ + {#call terminal_get_audible_bell#} (toTerminal terminal) + [_$_] +-- | Controls whether or not the terminal will present a visible bell to the user when the child outputs the "bl" sequence. [_$_] +-- The terminal will clear itself to the default foreground color and then repaint itself. +terminalSetVisibleBell :: [_$_] + TerminalClass self => self [_$_] + -> Bool -- ^ @isVisible@ - @True@ if the terminal should flash [_$_] + -> IO () [_$_] +terminalSetVisibleBell terminal isVisible = + {#call terminal_set_visible_bell#} (toTerminal terminal) (fromBool isVisible) + [_$_] +-- | Checks whether or not the terminal will present a visible bell to the user when the child outputs the "bl" sequence. [_$_] +-- The terminal will clear itself to the default foreground color and then repaint itself. +terminalGetVisibleBell :: [_$_] + TerminalClass self => self [_$_] + -> IO Bool -- ^ return @True@ if visible bell is enabled, FALSE if not [_$_] +terminalGetVisibleBell terminal = + liftM toBool $ + {#call terminal_get_visible_bell#} (toTerminal terminal) + [_$_] +-- | Controls whether or not the terminal will attempt to draw bold text, either by using a bold font variant or by repainting text with a different offset. +terminalSetAllowBold :: [_$_] + TerminalClass self => self [_$_] + -> Bool -- ^ @allowBold@ - @True@ if the terminal should attempt to draw bold text [_$_] + -> IO () [_$_] +terminalSetAllowBold terminal allowBold = + {#call terminal_set_allow_bold#} (toTerminal terminal) (fromBool allowBold) + [_$_] +-- | Checks whether or not the terminal will attempt to draw bold text by repainting text with a one-pixel offset. +terminalGetAllowBold :: [_$_] + TerminalClass self => self [_$_] + -> IO Bool -- ^ return @True@ if bolding is enabled, FALSE if not [_$_] +terminalGetAllowBold terminal = + liftM toBool $ + {#call terminal_get_allow_bold#} (toTerminal terminal) + [_$_] +-- | Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the new data is received from the child. +terminalSetScrollOnOutput :: [_$_] + TerminalClass self => self [_$_] + -> Bool -- ^ @scroll@ - @True@ if the terminal should scroll on output [_$_] + -> IO () [_$_] +terminalSetScrollOnOutput terminal scroll = + {#call terminal_set_scroll_on_output#} (toTerminal terminal) (fromBool scroll) + [_$_] +-- | Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the user presses a key. [_$_] +-- Modifier keys do not trigger this behavior. +terminalSetScrollOnKeystroke :: [_$_] + TerminalClass self => self [_$_] + -> Bool -- ^ @scroll@ - @True@ if the terminal should scroll on keystrokes [_$_] + -> IO () +terminalSetScrollOnKeystroke terminal scroll = + {#call terminal_set_scroll_on_keystroke#} (toTerminal terminal) (fromBool scroll) + [_$_] +-- | Sets the color used to draw bold text in the default foreground color. +terminalSetColorBold :: [_$_] + TerminalClass self => self [_$_] + -> Color -- ^ @bold@ - the new bold color [_$_] + -> IO () +terminalSetColorBold terminal bold = + with bold $ \boldPtr -> + {#call terminal_set_color_bold#} (toTerminal terminal) (castPtr boldPtr) + +-- | Sets the foreground color used to draw normal text +terminalSetColorForeground :: [_$_] + TerminalClass self => self [_$_] + -> Color -- ^ @foreground@ - the new foreground color [_$_] + -> IO () +terminalSetColorForeground terminal foreground = + with foreground $ \fgPtr -> [_$_] + {#call terminal_set_color_foreground#} (toTerminal terminal) (castPtr fgPtr) + +-- | Sets the background color for text which does not have a specific background color assigned. [_$_] +-- Only has effect when no background image is set and when the terminal is not transparent. +terminalSetColorBackground :: [_$_] + TerminalClass self => self [_$_] + -> Color -- ^ @background@ - the new background color [_$_] + -> IO () +terminalSetColorBackground terminal background = + with background $ \bgPtr -> + {#call terminal_set_color_background#} (toTerminal terminal) (castPtr bgPtr) + +-- | Sets the color used to draw dim text in the default foreground color. +terminalSetColorDim :: [_$_] + TerminalClass self => self [_$_] + -> Color -- ^ @dim@ - the nw dim color + -> IO () +terminalSetColorDim terminal dim = + with dim $ \dimPtr -> [_$_] + {#call terminal_set_color_dim#} (toTerminal terminal) (castPtr dimPtr) + +-- | Sets the background color for text which is under the cursor. [_$_] +-- If @Nothing@, text under the cursor will be drawn with foreground and background colors reversed. +-- +-- * Available since Vte version 0.11.11 +-- +terminalSetColorCursor :: [_$_] + TerminalClass self => self [_$_] + -> Color -- ^ @cursor@ - the new color to use for the text cursor [_$_] + -> IO () +terminalSetColorCursor terminal cursor = + with cursor $ \cursorPtr -> [_$_] + {#call terminal_set_color_cursor#} (toTerminal terminal) (castPtr cursorPtr) + +-- | Sets the background color for text which is highlighted. [_$_] +-- If @Nothing@, highlighted text (which is usually highlighted because it is selected) will be drawn with foreground and background colors reversed. +-- +-- * Available since Vte version 0.11.11 +-- +terminalSetColorHighlight :: [_$_] + TerminalClass self => self [_$_] + -> Color -- ^ @highlight@ - the new color to use for highlighted text [_$_] + -> IO () +terminalSetColorHighlight terminal highlight = + with highlight $ \hlPtr -> [_$_] + {#call terminal_set_color_highlight#} (toTerminal terminal) (castPtr hlPtr) + +-- | The terminal widget uses a 28-color model comprised of the default foreground and background colors, [_$_] +-- the bold foreground color, the dim foreground color, an eight color palette, [_$_] +-- bold versions of the eight color palette, and a dim version of the the eight color palette. palette_size must be either 0, 8, 16, or 24. [_$_] +-- If foreground is @Nothing@ and palette_size is greater than 0, the new foreground color is taken from palette[7]. [_$_] +-- If background is @Nothing@ and palette_size is greater than 0, the new background color is taken from palette[0]. [_$_] +-- If palette_size is 8 or 16, the third (dim) and possibly the second (bold) 8-color palettes are extrapolated from the new background color and the items in palette. +terminalSetColors :: [_$_] + TerminalClass self => self [_$_] + -> Color -- ^ @foreground@ - the new foreground color, or @Nothing@ [_$_] + -> Color -- ^ @background@ - the new background color, or @Nothing@ [_$_] + -> Color -- ^ @palette@ - the color palette [_$_] + -> Int -- ^ @size@ - the number of entries in palette [_$_] + -> IO () +terminalSetColors terminal foreground background palette size = + with foreground $ \fPtr -> + with background $ \bPtr -> + with palette $ \pPtr -> + {#call terminal_set_colors#} [_$_] + (toTerminal terminal) [_$_] + (castPtr fPtr) + (castPtr bPtr) + (castPtr pPtr) + (fromIntegral size) + +-- | Reset the terminal palette to reasonable compiled-in defaults. +terminalSetDefaultColors :: TerminalClass self => self -> IO () +terminalSetDefaultColors terminal = + {#call terminal_set_default_colors#} (toTerminal terminal) + [_$_] +-- | Sets the opacity of the terminal background, were 0 means completely transparent and 65535 means completely opaque. +terminalSetOpacity :: [_$_] + TerminalClass self => self + -> Int -- ^ @opacity@ - the new opacity [_$_] + -> IO () +terminalSetOpacity terminal opacity = + {#call terminal_set_opacity#} (toTerminal terminal) (fromIntegral opacity) + +-- | Sets a background image for the widget. [_$_] +-- Text which would otherwise be drawn using the default background color will instead be drawn over the specified image. [_$_] +-- If necessary, the image will be tiled to cover the widget's entire visible area. [_$_] +-- If specified by 'terminalSetBackgroundSaturation' the terminal will tint its in-memory copy of the image before applying it to the terminal. +terminalSetBackgroundImage :: [_$_] + TerminalClass self => self + -> Pixbuf -- ^ @image@ - a 'Pixbuf' to use, or @Nothing@ to cancel [_$_] + -> IO () +terminalSetBackgroundImage terminal image = + {#call terminal_set_background_image#} (toTerminal terminal) image + [_$_] +-- | Sets a background image for the widget. [_$_] +-- If specified by 'terminalSetBackgroundSaturation', the terminal will tint its in-memory copy of the image before applying it to the terminal. +terminalSetBackgroundImageFile :: [_$_] + TerminalClass self => self + -> String -- ^ @path@ - path to an image file [_$_] + -> IO () +terminalSetBackgroundImageFile terminal path = + withUTFString path $ \pathPtr -> + {#call terminal_set_background_image_file#} (toTerminal terminal) pathPtr + [_$_] +-- | If a background image has been set using 'terminalSetBackgroundImage', 'terminalSetBackgroundImageFile', or 'terminalSetBackgroundTransparent', and the saturation value is less than 1.0, the terminal will adjust the colors of the image before drawing the image. [_$_] +-- To do so, the terminal will create a copy of the background image (or snapshot of the root window) and modify its pixel values. +terminalSetBackgroundSaturation :: [_$_] + TerminalClass self => self + -> Double -- ^ @saturation@ - a floating point value between 0.0 and 1.0. [_$_] + -> IO () [_$_] +terminalSetBackgroundSaturation terminal saturation = + {#call terminal_set_background_saturation#} (toTerminal terminal) (realToFrac saturation) + [_$_] +-- | Sets the terminal's background image to the pixmap stored in the root window, adjusted so that if there are no windows below your application, the widget will appear to be transparent. +terminalSetBackgroundTransparent :: [_$_] + TerminalClass self => self + -> Bool -- ^ @transparent@ - @True@ if the terminal should fake transparency [_$_] + -> IO () +terminalSetBackgroundTransparent terminal transparent = + {#call terminal_set_background_transparent#} (toTerminal terminal) (fromBool transparent) + [_$_] +-- | If a background image has been set using 'terminalSetBackgroundImage', 'terminalSetBackgroundImageFile', or 'terminalSetBackgroundTransparent', and the value set by 'terminalSetBackgroundSaturation' is less than one, the terminal will adjust the color of the image before drawing the image. [_$_] +-- To do so, the terminal will create a copy of the background image (or snapshot of the root window) and modify its pixel values. The initial tint color is black. +-- +-- * Available since Vte version 0.11 +-- +terminalSetBackgroundTintColor :: [_$_] + TerminalClass self => self + -> Color -- ^ @color@ - a color which the terminal background should be tinted to if its saturation is not 1.0. [_$_] + -> IO () +terminalSetBackgroundTintColor terminal color = + with color $ \cPtr -> + {#call terminal_set_background_tint_color#} (toTerminal terminal) (castPtr cPtr) + +-- | Controls whether or not the terminal will scroll the background image (if one is set) when the text in the window must be scrolled. +-- +-- * Available since Vte version 0.11 +-- +terminalSetScrollBackground :: [_$_] + TerminalClass self => self + -> Bool -- ^ @scroll@ - @True@ if the terminal should scroll the background image along with text. [_$_] + -> IO () +terminalSetScrollBackground terminal scroll = + {#call terminal_set_scroll_background#} (toTerminal terminal) (fromBool scroll) + [_$_] +-- | Sets the shape of the cursor drawn. +-- +-- * Available since Vte version 0.19.1 +-- +terminalSetCursorShape :: + TerminalClass self => self [_$_] + -> TerminalCursorShape -- ^ @shape@ - the 'TerminalCursorShape' to use [_$_] + -> IO () +terminalSetCursorShape terminal shape = [_$_] + {#call terminal_set_cursor_shape#} (toTerminal terminal) $fromIntegral (fromEnum shape) + +-- | Returns the currently set cursor shape. +-- +-- * Available since Vte version 0.17.6 +-- +terminalGetCursorShape :: + TerminalClass self => self + -> IO TerminalCursorShape -- ^ return cursor shape +terminalGetCursorShape terminal = [_$_] + liftM (toEnum.fromIntegral) $ + {#call terminal_get_cursor_shape#} (toTerminal terminal) + +-- | Sets whether or not the cursor will blink. +-- WARNING: 'terminalSetCursorBlinks' is deprecated and should not be used in newly-written code. 0.17.1 +-- Use 'terminalSetCursorBlinkMode' instead. +terminalSetCursorBlinks :: [_$_] + TerminalClass self => self + -> Bool -- ^ @blink@ - @True@ if the cursor should blink [_$_] + -> IO () +terminalSetCursorBlinks terminal blink = + {#call terminal_set_cursor_blinks#} (toTerminal terminal) (fromBool blink) + [_$_] +-- | Returns the currently set cursor blink mode. +-- +-- * Available since Vte version 0.17.1 +-- +terminalGetCursorBlinkMode :: [_$_] + TerminalClass self => self + -> IO TerminalCursorBlinkMode -- ^ return cursor blink mode. [_$_] +terminalGetCursorBlinkMode terminal = [_$_] + liftM (toEnum.fromIntegral) $ + {#call terminal_get_cursor_blink_mode#} (toTerminal terminal) + +-- | Sets whether or not the cursor will blink. [_$_] +-- +-- * Available since Vte version 0.17.1 +-- +terminalSetCursorBlinkMode :: [_$_] + TerminalClass self => self + -> TerminalCursorBlinkMode -- ^ @mode@ - the 'TerminalCursorBlinkMode' to use [_$_] + -> IO () +terminalSetCursorBlinkMode terminal mode = + {#call terminal_set_cursor_blink_mode#} (toTerminal terminal) $fromIntegral (fromEnum mode) + +-- | Sets the length of the scrollback buffer used by the terminal. [_$_] +-- The size of the scrollback buffer will be set to the larger of this value and the number of visible rows the widget can display, so 0 can safely be used to disable scrollback. [_$_] +-- Note that this setting only affects the normal screen buffer. [_$_] +-- For terminal types which have an alternate screen buffer, no scrollback is allowed on the alternate screen buffer. +terminalSetScrollbackLines :: [_$_] + TerminalClass self => self + -> Int -- ^ @lines@ - the length of the history buffer [_$_] + -> IO () +terminalSetScrollbackLines terminal lines = + {#call terminal_set_scrollback_lines#} (toTerminal terminal) (fromIntegral lines) + +-- | Sets the font used for rendering all text displayed by the terminal, overriding any fonts set using 'widgetModifyFont'. +-- The terminal will immediately attempt to load the desired font, retrieve its metrics, and attempt to resize itself to keep the same number of rows and columns. +terminalSetFont :: [_$_] + TerminalClass self => self + -> FontDescription -- ^ @fontDesc@ - the 'FontDescription' of the desired font. [_$_] + -> IO () +terminalSetFont terminal fontDesc = + {#call terminal_set_font#} (toTerminal terminal) fontDesc + +-- | A convenience function which converts name into a FontDescription and passes it to 'terminalSetFont'. +terminalSetFontFromString :: [_$_] + TerminalClass self => self + -> String -- ^ @name@ - a string describing the font. [_$_] + -> IO () +terminalSetFontFromString terminal name = + withUTFString name $ \namePtr -> [_$_] + {#call terminal_set_font_from_string#} (toTerminal terminal) namePtr + [_$_] +-- | A convenience function which converts name into a 'FontDescription' and passes it to 'terminalSetFontFull'. +-- WARNING: 'terminalSetFontFromStringFull' is deprecated and should not be used in newly-written code. 0.19.1 +-- +-- * Available since Vte version 0.11.11 +-- +terminalSetFontFromStringFull :: [_$_] + TerminalClass self => self + -> String -- ^ @name@ - A string describing the font. [_$_] + -> TerminalAntiAlias -- ^ @antialias@ - Whether or not to antialias the font (if possible). [_$_] + -> IO () +terminalSetFontFromStringFull terminal name antialias = + withUTFString name $ \namePtr -> + {#call terminal_set_font_from_string_full#} (toTerminal terminal) namePtr $ fromIntegral (fromEnum antialias) + +-- | Sets the font used for rendering all text displayed by the terminal, overriding any fonts set using 'widgetModifyFont'. [_$_] +-- The terminal will immediately attempt to load the desired font, retrieve its metrics, and attempt to resize itself to keep the same number of rows and columns. +-- WARNING: terminalSetFontFull' is deprecated and should not be used in newly-written code. 0.19.1 +-- +-- * Available since Vte version 0.11.11 +-- +terminalSetFontFull :: [_$_] + TerminalClass self => self + -> FontDescription -- ^ @fontDesc@ - the 'FontDescription' of the desired font. [_$_] + -> TerminalAntiAlias -- ^ @antialias@ - specify if anti aliasing of the fonts is to be used or not. [_$_] + -> IO () +terminalSetFontFull terminal fontDesc antialias = + {#call terminal_set_font_full#} (toTerminal terminal) fontDesc $fromIntegral (fromEnum antialias) + +-- | Queries the terminal for information about the fonts which will be used to draw text in the terminal. +terminalGetFont :: [_$_] + TerminalClass self => self + -> IO FontDescription -- ^ return a 'FontDescription' describing the font the terminal is currently using to render text. [_$_] +terminalGetFont terminal = do + fdPtr <- {#call unsafe terminal_get_font#} (toTerminal terminal) [_$_] + makeNewFontDescription fdPtr [_$_] + +-- | A 'Terminal' can use multiple methods to draw text. [_$_] +-- This function allows an application to determine whether or not the current method uses fontconfig to find fonts. [_$_] +-- This setting cannot be changed by the caller, but in practice usually matches the behavior of GTK+ itself. +terminalGetUsingXft :: [_$_] + TerminalClass self => self + -> IO Bool -- ^ return @True@ is use xft font. +terminalGetUsingXft terminal = + liftM toBool $ + {#call terminal_get_using_xft#} (toTerminal terminal) + +-- | Checks if the terminal currently contains selected text. [_$_] +-- Note that this is different from determining if the terminal is the owner of any GtkClipboard items. +terminalGetHasSelection :: [_$_] + TerminalClass self => self + -> IO Bool -- ^ return @True@ if part of the text in the terminal is selected. [_$_] +terminalGetHasSelection terminal = + liftM toBool $ + {#call terminal_get_has_selection#} (toTerminal terminal) + [_$_] +-- | When the user double-clicks to start selection, the terminal will extend the selection on word boundaries. [_$_] +-- It will treat characters included in spec as parts of words, and all other characters as word separators. [_$_] +-- Ranges of characters can be specified by separating them with a hyphen. +-- As a special case, if @spec@ is the empty string, the terminal will treat all graphic non-punctuation non-space characters as word characters. +terminalSetWordChars :: [_$_] + TerminalClass self => self + -> String -- ^ @spec@ - a specification [_$_] + -> IO () [_$_] +terminalSetWordChars terminal spec = + withUTFString spec $ \specPtr -> + {#call terminal_set_word_chars#} (toTerminal terminal) specPtr + [_$_] +-- | Checks if a particular character is considered to be part of a word or not, based on the values last passed to 'terminalSetWordChars'. +terminalIsWordChar :: [_$_] + TerminalClass self => self + -> Char -- ^ @c@ - a candidate Unicode code point [_$_] + -> IO Bool -- ^ return @True@ if the character is considered to be part of a word [_$_] +terminalIsWordChar terminal c = + liftM toBool $ + {#call terminal_is_word_char#} (toTerminal terminal) (fromIntegral $ ord c) + +-- | Modifies the terminal's backspace key binding, which controls what string or control sequence the terminal sends to its child when the user presses the backspace key. +terminalSetBackspaceBinding :: [_$_] + TerminalClass self => self + -> TerminalEraseBinding -- ^ @binding@ - a 'TerminalEraseBinding' for the backspace key [_$_] + -> IO () +terminalSetBackspaceBinding terminal binding = + {#call terminal_set_backspace_binding#} (toTerminal terminal) (fromIntegral (fromEnum binding)) + +-- | Modifies the terminal's delete key binding, which controls what string or control sequence the terminal sends to its child when the user presses the delete key. +terminalSetDeleteBinding :: [_$_] + TerminalClass self => self + -> TerminalEraseBinding -- ^ @bindign@ - a 'TerminalEraseBinding' for the delete key [_$_] + -> IO () +terminalSetDeleteBinding terminal binding = + {#call terminal_set_delete_binding#} (toTerminal terminal) (fromIntegral (fromEnum binding)) + [_$_] +-- | Changes the value of the terminal's mouse autohide setting. [_$_] +-- When autohiding is enabled, the mouse cursor will be hidden when the user presses a key and shown when the user moves the mouse. [_$_] +-- This setting can be read using 'terminalGetMouseAutohide'. +terminalSetMouseAutohide :: [_$_] + TerminalClass self => self + -> Bool -- ^ @autohide@ - @True@ if the autohide should be enabled [_$_] + -> IO () +terminalSetMouseAutohide terminal autohide = + {#call terminal_set_mouse_autohide#} (toTerminal terminal) (fromBool autohide) + [_$_] +-- | Determines the value of the terminal's mouse autohide setting. [_$_] +-- When autohiding is enabled, the mouse cursor will be hidden when the user presses a key and shown when the user moves the mouse. [_$_] +-- This setting can be changed using 'terminalSetMouseAutohide'. +terminalGetMouseAutohide :: TerminalClass self => self -> IO Bool +terminalGetMouseAutohide terminal = + liftM toBool $ + {#call terminal_get_mouse_autohide#} (toTerminal terminal) + [_$_] +-- | Resets as much of the terminal's internal state as possible, discarding any unprocessed input data, resetting character attributes, cursor state, national character set state, status line, terminal modes (insert/delete), selection state, and encoding. +terminalReset :: [_$_] + TerminalClass self => self + -> Bool -- ^ @full@ - @True@ to reset tabstops [_$_] + -> Bool -- ^ @clearHistory@ - @True@ to empty the terminal's scrollback buffer [_$_] + -> IO () +terminalReset terminal full clearHistory = + {#call terminal_reset#} (toTerminal terminal) (fromBool full) (fromBool clearHistory) + [_$_] +-- | Extracts a view of the visible part of the terminal. If is_selected is not NULL, characters will only be read if is_selected returns TRUE after being passed the column and row, respectively. [_$_] +-- A 'CharAttributes' structure is added to attributes for each byte added to the returned string detailing the character's position, colors, and other characteristics. +-- TODO: +-- terminalGetText + +-- | Extracts a view of the visible part of the terminal. [_$_] +-- If is_selected is not NULL, characters will only be read if is_selected returns TRUE after being passed the column and row, respectively. [_$_] +-- A 'CharAttributes' structure is added to attributes for each byte added to the returned string detailing the character's position, colors, and other characteristics. [_$_] +-- This function differs from 'terminalGetText' in that trailing spaces at the end of lines are included. +-- +-- * Available since Vte version 0.11.11 +-- +-- TODO: +-- terminalGetTextIncludeTrailingSpaces + +-- | Extracts a view of the visible part of the terminal. [_$_] +-- If is_selected is not NULL, characters will only be read if is_selected returns TRUE after being passed the column and row, respectively. [_$_] +-- A 'CharAttributes' structure is added to attributes for each byte added to the returned string detailing the character's position, colors, and other characteristics. [_$_] +-- The entire scrollback buffer is scanned, so it is possible to read the entire contents of the buffer using this function. +-- TODO: +-- terminalGetTextRange + +-- | Specifies the type of a selection function used to check whether a cell has to be selected or not. +-- TODO: +-- SelectionFunc + +-- | Reads the location of the insertion cursor and returns it. The row coordinate is absolute. +terminalGetCursorPosition :: [_$_] + TerminalClass self => self + -> IO (Int -- ^ return column of cursor + ,Int) -- ^ return row of cursor +terminalGetCursorPosition terminal = do + alloca $ \cPtr -> + alloca $ \rPtr -> do + {#call terminal_get_cursor_position#} (toTerminal terminal) cPtr rPtr + column <- peek cPtr + row <- peek rPtr + return (fromIntegral column,fromIntegral row) + +-- | Clears the list of regular expressions the terminal uses to highlight text when the user moves the mouse cursor. +terminalMatchClearAll :: TerminalClass self => self -> IO () +terminalMatchClearAll terminal = + {#call terminal_match_clear_all#} (toTerminal terminal) + [_$_] +-- | Adds a regular expression to the list of matching expressions. [_$_] +-- When the user moves the mouse cursor over a section of displayed text which matches this expression, the text will be highlighted. +-- WARNING: 'terminalMatchAdd' is deprecated and should not be used in newly-written code. +terminalMatchAdd :: [_$_] + TerminalClass self => self + -> String -- ^ @match@ - a regular expression [_$_] + -> IO Int -- ^ return an integer associated with this expression Deprecated: 0.17.1 [_$_] +terminalMatchAdd terminal match = + liftM fromIntegral $ + withUTFString match $ \matchPtr -> + {#call terminal_match_add#} (toTerminal terminal) matchPtr + [_$_] +-- | Adds the regular expression regex to the list of matching expressions. [_$_] +-- When the user moves the mouse cursor over a section of displayed text which matches this expression, the text will be highlighted. +-- +-- * Available since Vte version 0.17.1 +-- +-- TODO: +-- terminalMatchAddGregex [_$_] + +-- | Removes the regular expression which is associated with the given tag from the list of expressions which the terminal will highlight when the user moves the mouse cursor over matching text. +terminalMatchRemove :: [_$_] + TerminalClass self => self + -> Int -- ^ @tag@ - the tag of the regex to remove [_$_] + -> IO () +terminalMatchRemove terminal tag = + {#call terminal_match_remove#} (toTerminal terminal) (fromIntegral tag) + +-- | Checks if the text in and around the specified position matches any of the regular expressions previously set using 'terminalMatchAdd'. [_$_] +-- If a match exists, the text string is returned and if tag is not @Nothing@, the number associated with the matched regular expression will be stored in tag. +-- If more than one regular expression has been set with 'terminalMatchAdd', then expressions are checked in the order in which they were added. +terminalMatchCheck :: [_$_] + TerminalClass self => self + -> Int -- ^ @column@ - the text column [_$_] + -> Int -- ^ @row@ - the text row [_$_] + -> IO (String -- ^ return pointer to an integer + ,Int) -- ^ return a string which matches one of the previously set regular expressions, and which must be freed by the caller. +terminalMatchCheck terminal column row = do + alloca $ \tagPtr -> + {#call terminal_match_check#} (toTerminal terminal) (fromIntegral column) (fromIntegral row) tagPtr >>= peekCString + >>= \str -> do + tag <- peek tagPtr + return (str,fromIntegral tag) + +-- | Sets which cursor the terminal will use if the pointer is over the pattern specified by tag. [_$_] +-- The terminal keeps a reference to cursor. +-- +-- * Available since Vte version 0.11 +-- +terminalMatchSetCursor :: [_$_] + TerminalClass self => self + -> Int -- ^ @tag@ - the tag of the regex which should use the specified cursor [_$_] + -> Cursor -- ^ @cursor@ - the 'Cursor' which the terminal should use when the pattern is highlighted [_$_] + -> IO () +terminalMatchSetCursor terminal tag (Cursor cur) = + with (unsafeForeignPtrToPtr cur) $ \curPtr -> + {#call terminal_match_set_cursor#} (toTerminal terminal) (fromIntegral tag) (castPtr curPtr) + +-- | Sets which cursor the terminal will use if the pointer is over the pattern specified by tag. +-- +-- * Available since Vte version 0.11.9 +-- +-- terminalMatchSetCursorType + +-- | Sets which cursor the terminal will use if the pointer is over the pattern specified by tag. +-- +-- * Available since Vte version 0.17.1 +-- +terminalMatchSetCursorName :: [_$_] + TerminalClass self => self + -> Int -- ^ @tag@ - the tag of the regex which should use the specified cursor [_$_] + -> String -- ^ @name@ - the name of the cursor [_$_] + -> IO () +terminalMatchSetCursorName terminal tag name = + withUTFString name $ \namePtr -> + {#call terminal_match_set_cursor_name#} (toTerminal terminal) (fromIntegral tag) namePtr + [_$_] +-- | Sets what type of terminal the widget attempts to emulate by scanning for control sequences defined in the system's termcap file. [_$_] +-- Unless you are interested in this feature, always use "xterm". +terminalSetEmulation :: [_$_] + TerminalClass self => self + -> String -- ^ @emulation@ - the name of a terminal description [_$_] + -> IO () [_$_] +terminalSetEmulation terminal emulation = + withUTFString emulation $ \emulationPtr -> + {#call terminal_set_emulation#} (toTerminal terminal) emulationPtr + [_$_] +-- | Queries the terminal for its current emulation, as last set by a call to 'terminalSetEmulation'. +terminalGetEmulation :: [_$_] + TerminalClass self => self + -> IO String -- ^ return the name of the terminal type the widget is attempting to emulate [_$_] +terminalGetEmulation terminal = + {#call terminal_get_emulation#} (toTerminal terminal) >>= peekCString + [_$_] +-- | Queries the terminal for its default emulation, which is attempted if the terminal type passed to 'terminalSetEmulation' emptry string. +-- +-- * Available since Vte version 0.11.11 +-- +terminalGetDefaultEmulation :: [_$_] + TerminalClass self => self + -> IO String -- ^ return the name of the default terminal type the widget attempts to emulate [_$_] +terminalGetDefaultEmulation terminal = + {#call terminal_get_default_emulation#} (toTerminal terminal) >>= peekCString + [_$_] +-- | Changes the encoding the terminal will expect data from the child to be encoded with. [_$_] +-- For certain terminal types, applications executing in the terminal can change the encoding. [_$_] +-- The default encoding is defined by the application's locale settings. +terminalSetEncoding :: + TerminalClass self => self + -> String -- ^ @codeset@ - a valid g_iconv target [_$_] + -> IO () [_$_] +terminalSetEncoding terminal codeset = + withUTFString codeset $ \codesetPtr -> + {#call terminal_set_encoding#} (toTerminal terminal) codesetPtr + [_$_] +-- | Determines the name of the encoding in which the terminal expects data to be encoded. +terminalGetEncoding :: [_$_] + TerminalClass self => self + -> IO String -- ^ return the current encoding for the terminal. [_$_] +terminalGetEncoding terminal = + {#call terminal_get_encoding#} (toTerminal terminal) >>= peekCString + [_$_] +-- | Some terminal emulations specify a status line which is separate from the main display area, and define a means for applications to move the cursor to the status line and back. +terminalGetStatusLine :: [_$_] + TerminalClass self => self + -> IO String -- ^ return the current contents of the terminal's status line. For terminals like "xterm", this will usually be the empty string. The string must not be modified or freed by the caller. +terminalGetStatusLine terminal = + {#call terminal_get_status_line#} (toTerminal terminal) >>= peekCString + [_$_] +-- | Determines the amount of additional space the widget is using to pad the edges of its visible area. [_$_] +-- This is necessary for cases where characters in the selected font don't themselves include a padding area and the text itself would otherwise be contiguous with the window border. [_$_] +-- Applications which use the widget's row_count, column_count, char_height, and char_width fields to set geometry hints using 'windowSetGeometryHints' will need to add this value to the base size. [_$_] +-- The values returned in xpad and ypad are the total padding used in each direction, and do not need to be doubled. +terminalGetPadding :: [_$_] + TerminalClass self => self + -> I... [truncated message content] |
From: Axel S. <si...@co...> - 2009-09-26 15:13:05
|
Sat Sep 26 09:56:54 EDT 2009 Axe...@en... * Finish two more functions in VTE. hunk ./Makefile.am 44 + vte/Graphics/UI/Gtk/Vte/VteCharAttrFields.h \ hunk ./Makefile.am 51 - mkdir $(distdir)/vte/Graphics/UI/Gtk/Vte - touch $(distdir)/vte/Graphics/UI/Gtk/Vte/.keep hunk ./Makefile.am 1152 - vte/Graphics/UI/Gtk/Vte/Vte.chs + vte/Graphics/UI/Gtk/Vte/VteCharAttrFields.c \ + vte/Graphics/UI/Gtk/Vte/Structs.hsc \ + vte/Graphics/UI/Gtk/Vte/Vte.chs addfile ./vte/Graphics/UI/Gtk/Vte/Structs.hsc hunk ./vte/Graphics/UI/Gtk/Vte/Structs.hsc 1 +{-# OPTIONS_HADDOCK hide #-} +-- -*-haskell-*- +-- GIMP Toolkit (GTK) marshalling of structures for VTE +-- +-- Author : Axel Simon +-- +-- Created: 26 Sep 2009 +-- +-- Copyright (C) 2009 Andy Stewart <laz...@gm...> +-- +-- 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 2.1 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. +-- +-- +-- #hide + +-- | +-- Maintainer : gtk...@li... +-- Stability : provisional +-- Portability : portable (depends on GHC) +-- +-- Structures for the VTE terminal widget +-- [_$_] +----------------------------------------------------------------------------- +-- [_$_] +module Graphics.UI.Gtk.Vte.Structs ( +-- * Types + VteAttributes(..), + [_$_] +-- * Functions + gArrayContent + ) where + +import Data.Char +import Data.Word + +import System.Glib.FFI +import Graphics.UI.Gtk.General.Structs ( Color(..) ) + +#include "VteCharAttrFields.h" + +data VteAttributes = VteAttributes { + vaRow :: Int, + vaCol :: Int, + vaFore :: Color, + vaBack :: Color, + vaUnderline :: Bool, + vaStrikethrough :: Bool + } + +-- these fields are declard as bit fields which we cannot access portably from +-- Haskell, thus, we define two C helper functions that read these fields +foreign import ccall "getVteCharAttrUnderline" + getVteCharAttrUnderline :: Ptr VteAttributes -> IO #{type gboolean} + +foreign import ccall "getVteCharAttrStrikethrough" + getVteCharAttrStrikethrough :: Ptr VteAttributes -> IO #{type gboolean} + +instance Storable VteAttributes where + sizeOf _ = #{const sizeof(VteCharAttributes)} + alignment _ = alignment (undefined :: #{type long}) + peek ptr = do + row <- #{peek VteCharAttributes, row} ptr :: IO #{type long} + col <- #{peek VteCharAttributes, column} ptr :: IO #{type long} + fore <- #{peek VteCharAttributes, fore} ptr + back <- #{peek VteCharAttributes, back} ptr + under <- getVteCharAttrUnderline ptr + strike <- getVteCharAttrStrikethrough ptr + return VteAttributes { + vaRow = fromIntegral row, + vaCol = fromIntegral col, + vaFore = fore, + vaBack = back, + vaUnderline = toBool (fromIntegral under), + vaStrikethrough = toBool (fromIntegral strike) + } + poke ptr VteAttributes {} = error "Storable VteAttributes: not implemented" + +-- | Retrieve the two fields of the GArray structure. +-- +gArrayContent :: Ptr garray -> IO (Int, Ptr VteAttributes) +gArrayContent gaPtr = do + len <- #{peek GArray, len} gaPtr :: IO #{type guint} + ptr <- #{peek GArray, data} gaPtr + return (fromIntegral len, ptr) hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 196 -import Control.Monad (liftM) +import Control.Monad (liftM, unless) hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 206 -import System.Glib.GError [_$_] -import Graphics.UI.Gtk.Gdk.GC +import System.Glib.GError +import System.Glib.Flags (Flags, fromFlags) [_$_] +import Graphics.UI.Gtk.General.Structs (Color(..)) hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 211 +import Graphics.UI.Gtk.Vte.Structs hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 218 +{#import System.Glib.GError#} (propagateGError) hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 849 - [_$_] --- | Extracts a view of the visible part of the terminal. If is_selected is not NULL, characters will only be read if is_selected returns TRUE after being passed the column and row, respectively. [_$_] --- A 'CharAttributes' structure is added to attributes for each byte added to the returned string detailing the character's position, colors, and other characteristics. --- TODO: --- terminalGetText hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 850 +-- | A predicate that states which characters are of interest. +type VteSelect = + Int -- ^ the column of the character + -> Int -- ^ the row of the character + -> Bool -- ^ @True@ if the character should be inspected + +-- | A structure describing the individual characters in the visible part of +-- a terminal window. +-- +data VteChar = VteChar { + vcRow :: Int, + vcCol :: Int, + vcChar :: Char, + vcFore :: Color, + vcBack :: Color, + vcUnderline :: Bool, + vcStrikethrough :: Bool + } + +attrToChar :: Char -> VteAttributes -> VteChar +attrToChar ch (VteAttributes r c f b u s) = VteChar r c ch f b u s + [_$_] +-- | Extracts a view of the visible part of the terminal. A selection +-- predicate may be supplied to restrict the inspected characters. The +-- return value is a list of 'VteChar' structures, each detailing the +-- character's position, colors, and other characteristics. +-- +terminalGetText :: + TerminalClass self => self + -> Maybe VteSelect -- ^ @Just p@ for a predicate @p@ that determines + -- which character should be extracted or @Nothing@ + -- to select all characters + -> IO [VteChar] +terminalGetText terminal mCB = do + cbPtr <- case mCB of + Just cb -> mkVteSelectionFunc $ \_ c r _ -> + return (fromBool (cb (fromIntegral c) (fromIntegral r))) + Nothing -> return nullFunPtr + gArrPtr <- {#call unsafe g_array_new#} 0 0 + (fromIntegral (sizeOf (undefined :: VteAttributes))) + strPtr <- {#call terminal_get_text #} (toTerminal terminal) cbPtr nullPtr gArrPtr + str <- if strPtr==nullPtr then return "" else peekUTFString strPtr + (len,elemPtr) <- gArrayContent (castPtr gArrPtr) + attrs <- (flip mapM) [0..len-1] $ peekElemOff elemPtr + unless (cbPtr==nullFunPtr) $ freeHaskellFunPtr cbPtr + {#call unsafe g_free#} (castPtr strPtr) + {#call unsafe g_array_free#} gArrPtr 1 + return (zipWith attrToChar str attrs) + +{#pointer VteSelectionFunc#} + +foreign import ccall "wrapper" mkVteSelectionFunc :: + (Ptr Terminal -> {#type glong#} -> {#type glong#} -> Ptr () -> IO {#type gboolean#}) + -> IO VteSelectionFunc + [_$_] + [_$_] hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 951 - -> IO Int -- ^ return an integer associated with this expression Deprecated: 0.17.1 [_$_] + -> IO Int -- ^ return an integer associated with this expression hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 956 + +-- | Flags determining how the regular expression is to be interpreted. +{#enum GRegexCompileFlags as RegexCompileFlags {underscoreToCase} deriving (Bounded,Eq,Show) #} + +instance Flags RegexCompileFlags + +-- | Flags determining how the string is matched against the regular +-- expression. +{#enum GRegexMatchFlags as RegexMatchFlags {underscoreToCase} deriving (Bounded,Eq,Show) #} + +instance Flags RegexMatchFlags hunk ./vte/Graphics/UI/Gtk/Vte/Vte.chs.pp 973 --- TODO: --- terminalMatchAddGregex [_$_] +terminalMatchAddRegex :: + TerminalClass self => self + -> String -- ^ @pattern@ - a regular expression + -> [RegexCompileFlags] -- ^ @flags@ - specify how to interpret the pattern + -> [RegexMatchFlags] -- ^ @flags@ - specify how to match + -> IO Int -- ^ return an integer associated with this expression +terminalMatchAddRegex terminal pattern cFlags mFlags = + withUTFString pattern $ \pat -> do + regexPtr <- propagateGError $ + {#call g_regex_new#} pat (fromIntegral (fromFlags cFlags)) + (fromIntegral (fromFlags mFlags)) + liftM fromIntegral $ {#call terminal_match_add_gregex#} + (toTerminal terminal) regexPtr (fromIntegral (fromFlags mFlags)) addfile ./vte/Graphics/UI/Gtk/Vte/VteCharAttrFields.c hunk ./vte/Graphics/UI/Gtk/Vte/VteCharAttrFields.c 1 +#include "VteCharAttrFields.h" + +gboolean getVteCharAttrUnderline(VteCharAttributes* vca) { + return vca->underline; +} + +gboolean getVteCharAttrStrikethrough(VteCharAttributes* vca) { + return vca->strikethrough; +} + addfile ./vte/Graphics/UI/Gtk/Vte/VteCharAttrFields.h hunk ./vte/Graphics/UI/Gtk/Vte/VteCharAttrFields.h 1 +#ifndef VTE_CHAR_ATTR_FIELDS_H +#define VTE_CHAR_ATTR_FIELDS_H + +#include <vte/vte.h> + +gboolean getVteCharAttrUnderline(VteCharAttributes* vca); + +gboolean getVteCharAttrStrikethrough(VteCharAttributes* vca); + +#endif /* VTE_CHAR_ATTR_FIELDS_H */ |
From: Axel S. <si...@co...> - 2009-09-26 15:13:04
|
Thu Sep 24 13:33:47 EDT 2009 Axe...@en... * Add some more new signals. move ./gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs ./gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs.pp move ./gtk/Graphics/UI/Gtk/Display/Statusbar.chs ./gtk/Graphics/UI/Gtk/Display/Statusbar.chs.pp hunk ./Makefile.am 636 - gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs \ + gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs.pp \ hunk ./Makefile.am 641 - gtk/Graphics/UI/Gtk/Display/Statusbar.chs \ + gtk/Graphics/UI/Gtk/Display/Statusbar.chs.pp \ hunk ./gtk/Graphics/UI/Gtk/Abstract/Container.chs.pp 511 --- | +-- | A widget was added to the container. hunk ./gtk/Graphics/UI/Gtk/Abstract/Container.chs.pp 517 --- | +-- | A widget was removed from the container. hunk ./gtk/Graphics/UI/Gtk/Abstract/Container.chs.pp 523 --- | +-- | Emitted when widgets need to be queried again for their preferred size. hunk ./gtk/Graphics/UI/Gtk/Abstract/Container.chs.pp 529 --- | +-- | A widget in the container received the input focus. hunk ./gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp 99 --- * Signals + +-- * Deprecated Signals +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp 114 +#endif hunk ./gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp 296 --- Signals +-- Deprecated Signals hunk ./gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp 298 +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Abstract/Paned.chs.pp 346 + +#endif hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs.pp 63 +#if GTK_CHECK_VERSION(2,10,0) + SensitivityType(..), + rangeSetLowerStepperSensitivity, + rangeGetLowerStepperSensitivity, + rangeSetUpperStepperSensitivity, + rangeGetUpperStepperSensitivity, +#endif hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs.pp 75 +#if GTK_CHECK_VERSION(2,10,0) + rangeLowerStepperSensitivity, + rangeUpperStepperSensitivity, +#endif hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs.pp 82 + adjustBounds, + valueChanged, +#if GTK_CHECK_VERSION(2,6,0) + changeValue, +#endif + +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs.pp 100 +#endif hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs.pp 107 +import System.Glib.Properties hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs.pp 201 --- emits the \"value_changed\" signal if the value changes. +-- emits the 'valueChanged' signal if the value changes. hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs.pp 239 +#if GTK_CHECK_VERSION(2,10,0) + +-- | Determines how Gtk+ handles the sensitivity of stepper arrows at the end of range widgets. +-- +-- * 'SensitivityAuto': the arrow is made insensitive if the thumb is at the end +-- +-- * 'SensitivityOn': the arrow is alwasy sensitive +-- +-- * 'SensitivityOff': the arrow is always insensitive +-- +{#enum SensitivityType {underscoreToCase} deriving (Bounded,Eq,Show)#} + +-- %hash c:3a8d d:d336 +-- | Sets the sensitivity policy for the stepper that points to the \'lower\' +-- end of the 'Range''s adjustment. +-- +-- * Available since Gtk+ version 2.10 +-- +rangeSetLowerStepperSensitivity :: RangeClass self => self + -> SensitivityType -- ^ @sensitivity@ - the lower stepper's sensitivity + -- policy. + -> IO () +rangeSetLowerStepperSensitivity self sensitivity = + {# call gtk_range_set_lower_stepper_sensitivity #} + (toRange self) + ((fromIntegral . fromEnum) sensitivity) + +-- %hash c:12a2 d:2f2a +-- | Gets the sensitivity policy for the stepper that points to the \'lower\' +-- end of the 'Range''s adjustment. +-- +-- * Available since Gtk+ version 2.10 +-- +rangeGetLowerStepperSensitivity :: RangeClass self => self + -> IO SensitivityType -- ^ returns The lower stepper's sensitivity policy. +rangeGetLowerStepperSensitivity self = + liftM (toEnum . fromIntegral) $ + {# call gtk_range_get_lower_stepper_sensitivity #} + (toRange self) + +-- %hash c:a939 d:2d79 +-- | Sets the sensitivity policy for the stepper that points to the \'upper\' +-- end of the 'Range''s adjustment. +-- +-- * Available since Gtk+ version 2.10 +-- +rangeSetUpperStepperSensitivity :: RangeClass self => self + -> SensitivityType -- ^ @sensitivity@ - the upper stepper's sensitivity + -- policy. + -> IO () +rangeSetUpperStepperSensitivity self sensitivity = + {# call gtk_range_set_upper_stepper_sensitivity #} + (toRange self) + ((fromIntegral . fromEnum) sensitivity) + +-- %hash c:456e d:896d +-- | Gets the sensitivity policy for the stepper that points to the \'upper\' +-- end of the 'Range''s adjustment. +-- +-- * Available since Gtk+ version 2.10 +-- +rangeGetUpperStepperSensitivity :: RangeClass self => self + -> IO SensitivityType -- ^ returns The upper stepper's sensitivity policy. +rangeGetUpperStepperSensitivity self = + liftM (toEnum . fromIntegral) $ + {# call gtk_range_get_upper_stepper_sensitivity #} + (toRange self) +#endif + hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs.pp 336 +#if GTK_CHECK_VERSION(2,10,0) +-- %hash c:b6dd d:1607 +-- | The sensitivity policy for the stepper that points to the adjustment's +-- lower side. +-- +-- Default value: 'SensitivityAuto' +-- +rangeLowerStepperSensitivity :: RangeClass self => Attr self SensitivityType +rangeLowerStepperSensitivity = newAttrFromEnumProperty "lower-stepper-sensitivity" + {# call pure unsafe gtk_sensitivity_type_get_type #} + +-- %hash c:2fc6 d:132a +-- | The sensitivity policy for the stepper that points to the adjustment's +-- upper side. +-- +-- Default value: 'SensitivityAuto' +-- +rangeUpperStepperSensitivity :: RangeClass self => Attr self SensitivityType +rangeUpperStepperSensitivity = newAttrFromEnumProperty "upper-stepper-sensitivity" + {# call pure unsafe gtk_sensitivity_type_get_type #} +#endif + +-- %hash c:f615 d:2481 hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs.pp 369 +-- %hash c:9758 d:680f +-- | Emitted when the range value changes. +-- +valueChanged :: RangeClass self => Signal self (IO ()) +valueChanged = Signal (connect_NONE__NONE "value_changed") + +-- %hash c:9576 d:af3f +-- | +-- +adjustBounds :: RangeClass self => Signal self (Double -> IO ()) +adjustBounds = Signal (connect_DOUBLE__NONE "adjust_bounds") + +#if GTK_CHECK_VERSION(2,6,0) +-- %hash c:a84 d:a60c +-- | The 'changeValue' signal is emitted when a scroll action is performed on +-- a range. It allows an application to determine the type of scroll event that +-- occurred and the resultant new value. The application can handle the event +-- itself and return @True@ to prevent further processing. Or, by returning +-- @False@, it can pass the event to other handlers until the default Gtk+ +-- handler is reached. +-- +-- The value parameter is unrounded. An application that overrides the +-- 'changeValue' signal is responsible for clamping the value to the desired +-- number of decimal digits. +-- +-- It is not possible to use delayed update policies in an overridden +-- 'changeValue' handler. +-- +-- * Available since Gtk+ version 2.6 +-- +changeValue :: RangeClass self => Signal self (ScrollType -> Double -> IO Bool) +changeValue = Signal (connect_ENUM_DOUBLE__BOOL "change_value") +#endif + +-------------------- +-- Deprecated Signals + +#ifndef DISABLE_DEPRECATED + hunk ./gtk/Graphics/UI/Gtk/Abstract/Range.chs.pp 457 +#endif hunk ./gtk/Graphics/UI/Gtk/Abstract/Scale.chs 42 + hunk ./gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp 90 +#if GTK_CHECK_VERSION(2,10,0) + PositionType(..), + buttonSetImagePosition, + buttonGetImagePosition, +#endif hunk ./gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp 111 +#if GTK_CHECK_VERSION(2,10,0) + buttonImagePosition, +#endif hunk ./gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp 116 + buttonActivated, + +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp 132 +#endif hunk ./gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp 144 -import Graphics.UI.Gtk.General.Enums (ReliefStyle(..)) +import Graphics.UI.Gtk.General.Enums (ReliefStyle(..), PositionType(..)) hunk ./gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp 267 +#if GTK_CHECK_VERSION(2,4,0) +-- %hash c:d8cb d:1e7d +-- | If the child of the button is a 'Misc' or 'Alignment', this property can +-- be used to control it's horizontal alignment. 0.0 is left aligned, 1.0 is +-- right aligned. +-- +-- Allowed values: [0,1] +-- +-- Default value: 0.5 +-- +-- * Available since Gtk+ version 2.4 +-- +buttonXAlign :: ButtonClass self => Attr self Float +buttonXAlign = newAttrFromFloatProperty "xalign" + +-- %hash c:ce4e d:4fec +-- | If the child of the button is a 'Misc' or 'Alignment', this property can +-- be used to control it's vertical alignment. 0.0 is top aligned, 1.0 is +-- bottom aligned. +-- +-- Allowed values: [0,1] +-- +-- Default value: 0.5 +-- +-- * Available since Gtk+ version 2.4 +-- +buttonYAlign :: ButtonClass self => Attr self Float +buttonYAlign = newAttrFromFloatProperty "yalign" +#endif + hunk ./gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp 468 +#if GTK_CHECK_VERSION(2,10,0) +-- %hash c:e7a6 d:7a76 +-- | Sets the position of the image relative to the text inside the button. +-- +-- * Available since Gtk+ version 2.10 +-- +buttonSetImagePosition :: ButtonClass self => self + -> PositionType -- ^ @position@ - the position + -> IO () +buttonSetImagePosition self position = + {# call gtk_button_set_image_position #} + (toButton self) + ((fromIntegral . fromEnum) position) + +-- %hash c:3841 d:1f6a +-- | Gets the position of the image relative to the text inside the button. +-- +-- * Available since Gtk+ version 2.10 +-- +buttonGetImagePosition :: ButtonClass self => self + -> IO PositionType -- ^ returns the position +buttonGetImagePosition self = + liftM (toEnum . fromIntegral) $ + {# call gtk_button_get_image_position #} + (toButton self) +#endif + hunk ./gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp 583 +#if GTK_CHECK_VERSION(2,10,0) +-- %hash c:20f4 d:8ca6 +-- | The position of the image relative to the text inside the button. +-- +-- Default value: 'PosLeft' +-- +-- * Available since Gtk+ version 2.10 +-- +buttonImagePosition :: ButtonClass self => Attr self PositionType +buttonImagePosition = newAttrFromEnumProperty "image-position" + {# call pure unsafe gtk_position_type_get_type #} +#endif + hunk ./gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp 599 +-- %hash c:b660 d:ab72 +-- | Emitted when the button has been activated (pressed and released). +-- +buttonActivated :: ButtonClass self => Signal self (IO ()) +buttonActivated = Signal (connect_NONE__NONE "clicked") + + +-------------------- +-- Deprecated Signals + +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Buttons/Button.chs.pp 648 - +#endif hunk ./gtk/Graphics/UI/Gtk/Buttons/RadioButton.chs.pp 130 + groupChanged, +#endif + +-- * Deprecated +#ifndef DISABLE_DEPRECATED +#if GTK_CHECK_VERSION(2,4,0) hunk ./gtk/Graphics/UI/Gtk/Buttons/RadioButton.chs.pp 139 +#endif hunk ./gtk/Graphics/UI/Gtk/Buttons/RadioButton.chs.pp 315 +#if GTK_CHECK_VERSION(2,4,0) +-- %hash c:be94 d:a584 +-- | Emitted when the group of radio buttons that a radio button belongs to +-- changes. This is emitted when a radio button switches from being alone to +-- being part of a group of 2 or more buttons, or vice-versa, and when a +-- buttton is moved from one group of 2 or more buttons to a different one, but +-- not when the composition of the group that a button belongs to changes. +-- +-- * Available since Gtk+ version 2.4 +-- +groupChanged :: RadioButtonClass self => Signal self (IO ()) +groupChanged = Signal (connect_NONE__NONE "group-changed") +#endif + +-------------------- +-- Deprecated Signals + +#ifndef DISABLE_DEPRECATED + hunk ./gtk/Graphics/UI/Gtk/Buttons/RadioButton.chs.pp 347 +#endif hunk ./gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs.pp 84 + toggled, + +-- * Deprecated +#ifndef DISABLE_DEPRECATED +-- * Signals hunk ./gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs.pp 91 +#endif hunk ./gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs.pp 273 +-- %hash c:467 d:227e +-- | Should be connected if you wish to perform an action whenever the +-- 'ToggleButton''s state is changed. +-- +toggled :: ToggleButtonClass self => Signal self (IO ()) +toggled = Signal (connect_NONE__NONE "toggled") + +-------------------- +-- Deprecated Signals + +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Buttons/ToggleButton.chs.pp 292 +#endif hunk ./gtk/Graphics/UI/Gtk/Display/Statusbar.chs.pp 91 + textPopped, + textPushed, + +-- * Deprecated +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Display/Statusbar.chs.pp 100 +#endif hunk ./gtk/Graphics/UI/Gtk/Display/Statusbar.chs.pp 219 +-- %hash c:4eb7 d:d0ef +-- | Is emitted whenever a new message gets pushed onto a statusbar's stack. +-- +textPushed :: StatusbarClass self => Signal self (ContextId -> String -> IO ()) +textPushed = Signal (\a self user -> connect_WORD_STRING__NONE "text_pushed" a self (\w s -> user (fromIntegral w) s)) + +-- %hash c:2614 d:c1d2 +-- | Is emitted whenever a new message is popped off a statusbar's stack. +-- +textPopped :: StatusbarClass self => Signal self (ContextId -> String -> IO ()) +textPopped = Signal (\a self user -> connect_WORD_STRING__NONE "text_popped" a self (\w s -> user (fromIntegral w) s)) + +-------------------- +-- Deprecated Signals + +#ifndef DISABLE_DEPRECATED hunk ./gtk/Graphics/UI/Gtk/Display/Statusbar.chs.pp 251 +#endif |
From: Axel S. <si...@co...> - 2009-09-10 21:21:59
|
Thu Sep 10 17:19:08 EDT 2009 Axe...@en... * Add the dragStatus function and more comments. hunk ./gtk/Graphics/UI/Gtk/General/Drag.chs.pp 84 + dragStatus, hunk ./gtk/Graphics/UI/Gtk/General/Drag.chs.pp 181 +-- * Things become more complicated when you try to preview the dragged data, +-- as described in the documentation for 'dragMotion'. The default +-- behaviors described by flags make some assumptions, that can conflict +-- with your own signal handlers. For instance 'DestDefaultDrop' causes +-- invokations of 'dragStatus' in the handler of 'dragMotion", and +-- invokations of 'dragFinish' in 'dragDataReceived'. Especially the +-- latter is dramatic, when your own 'dragMotion' handler calls +-- 'dragGetData' to inspect the dragged data. +-- hunk ./gtk/Graphics/UI/Gtk/General/Drag.chs.pp 593 +-- | Visualises the actions offered by the drag source. +-- +-- * This function is called by the drag destination in response to +-- 'dragMotion' called by the drag source. The passed-in action +-- is indicated where @Nothing@ will show that the drop is not +-- allowed. +-- +dragStatus :: DragContext -> Maybe DragAction -> TimeStamp -> IO () +dragStatus ctxt mAction ts = + {# call gdk_drag_status #} ctxt (maybe 0 (fromIntegral . fromEnum) mAction) + (fromIntegral ts) + [_$_] |
From: Axel S. <si...@co...> - 2009-08-28 07:36:50
|
Fri Aug 28 03:34:18 EDT 2009 Axe...@en... * Make path conversion function safe as it may call back. hunk ./gtk/Graphics/UI/Gtk/ModelView/TreeModelSort.chs.pp 124 - {# call unsafe tree_model_sort_convert_child_path_to_path #} + {# call tree_model_sort_convert_child_path_to_path #} |
From: <du...@co...> - 2009-08-22 01:13:27
|
Fri Aug 21 20:59:08 EDT 2009 Duncan Coutts <du...@ha...> * Update status in AUTHORS file to reflect reality Ignore-this: e8d4122f02b53c63f8cf22acbd9826ce hunk ./AUTHORS 4 -Duncan Coutts <du...@co...> -(current maintainer) - hunk ./AUTHORS 9 +Duncan Coutts <du...@ha...> +(joint maintainer 2005-2008, contributor 2003-) + |
From: Axel S. <si...@co...> - 2009-07-23 19:55:33
|
Mon Jul 20 15:04:41 EDT 2009 Axe...@en... * Fix reference counting for GObjects. This bug is only present in Glib libraries >2.10 which introduced floating references. The problem is that even GObjects have always a floating reference which has to be turned into a permanent reference. So far, we omitted this call which had the effect that we would keep the object around with a floating reference. Some objects in Gtk will call ref_sink on an object that is passed to them, rather than ref. This causes the floating reference to be turned into a proper one, rather than adding a new reference. Thus, when the Haskell GC comes along, the object is unref'd and destroyed while it's still being held in the Gtk object. This patch always ref_sinks the object, resulting in a proper refence being held by Haskell and forcing every ref_sink in Gtk code to have the semantics of ref. hunk ./glib/System/Glib/GObject.chs.pp 142 +#if GLIB_CHECK_VERSION(2,10,0) + -- change the exisiting floating reference into a proper reference; + -- the name is confusing, what the function does is ref,sink,unref + objectRefSink objPtr +#endif |