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. [_$_] |