vte 0.12.5.0 → 0.13.0.0
raw patch · 8 files changed
+473/−755 lines, 8 filesdep ~glibdep ~gtkdep ~pango
Dependency ranges changed: glib, gtk, pango
Files
- Graphics/UI/Gtk/Vte/Signals.chs +8/−7
- Graphics/UI/Gtk/Vte/Types.chs +1/−1
- Graphics/UI/Gtk/Vte/Vte.chs +397/−396
- Gtk2HsSetup.hs +48/−21
- SetupWrapper.hs +2/−2
- hierarchy.list +9/−321
- marshal.list +1/−1
- vte.cabal +7/−6
Graphics/UI/Gtk/Vte/Signals.chs view
@@ -28,7 +28,7 @@ -- The object system in the second version of GTK is based on GObject from -- GLIB. This base class is rather primitive in that it only implements -- ref and unref methods (and others that are not interesting to us). If--- the marshall list mentions OBJECT it refers to an instance of this +-- the marshall list mentions OBJECT it refers to an instance of this -- GObject which is automatically wrapped with a ref and unref call. -- Structures which are not derived from GObject have to be passed as -- BOXED which gives the signal connect function a possibility to do the@@ -45,7 +45,7 @@ connect_INT_INT__NONE, connect_WORD_WORD__NONE, connect_OBJECT_OBJECT__NONE,- connect_STRING_INT__NONE,+ connect_GLIBSTRING_INT__NONE, ) where @@ -53,9 +53,10 @@ import System.Glib.FFI import System.Glib.UTFString (peekUTFString,maybePeekUTFString)+import qualified System.Glib.UTFString as Glib import System.Glib.GError (failOnGError) {#import System.Glib.Signals#}-{#import System.Glib.GObject#} +{#import System.Glib.GObject#} import Graphics.UI.GtkInternals @@ -129,12 +130,12 @@ makeNewGObject (GObject, objectUnrefFromMainloop) (return obj1) >>= \obj1' -> user (unsafeCastGObject obj1') (unsafeCastGObject obj2') -connect_STRING_INT__NONE :: - GObjectClass obj => SignalName ->+connect_GLIBSTRING_INT__NONE :: + (Glib.GlibString a', GObjectClass obj) => SignalName -> ConnectAfter -> obj ->- (String -> Int -> IO ()) ->+ (a' -> Int -> IO ()) -> IO (ConnectId obj)-connect_STRING_INT__NONE signal after obj user =+connect_GLIBSTRING_INT__NONE signal after obj user = connectGeneric signal after obj action where action :: Ptr GObject -> CString -> Int -> IO () action _ str1 int2 =
Graphics/UI/Gtk/Vte/Types.chs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# OPTIONS_HADDOCK hide #-} -- -*-haskell-*- -- -------------------- automatically generated file - do not edit ----------@@ -81,7 +82,6 @@ instance BinClass Terminal instance ContainerClass Terminal instance WidgetClass Terminal-instance ObjectClass Terminal instance GObjectClass Terminal where toGObject = GObject . castForeignPtr . unTerminal unsafeCastGObject = Terminal . castForeignPtr . unGObject
Graphics/UI/Gtk/Vte/Vte.chs view
@@ -24,9 +24,9 @@ -- Portability : portable (depends on GHC) -- -- A terminal widget--- +-- -------------------------------------------------------------------------------- +-- module Graphics.UI.Gtk.Vte.Vte ( -- * Types Terminal,@@ -174,7 +174,7 @@ pasteClipboard, raiseWindow, refreshWindow,- resizeWidnow,+ resizeWindow, restoreWindow, selectionChanged, setScrollAdjustments,@@ -195,7 +195,7 @@ import System.Glib.UTFString import System.Glib.Properties import System.Glib.GError-import System.Glib.Flags (Flags, fromFlags) +import System.Glib.Flags (Flags, fromFlags) import Graphics.UI.Gtk.Abstract.Widget (Color) import Graphics.UI.Gtk.Gdk.Cursor import Graphics.Rendering.Pango.BasicTypes (FontDescription(FontDescription), makeNewFontDescription)@@ -219,7 +219,7 @@ -- column @c@ and row @r@ should be extracted. type VteSelect = Int- -> Int + -> Int -> Bool {#pointer SelectionFunc#}@@ -243,15 +243,15 @@ -- | 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 presses backspace\/delete. +-- | Values for what should happen when the user presses backspace\/delete. -- Use 'EraseAuto' unless the user can cause them to be overridden. {#enum VteTerminalEraseBinding as TerminalEraseBinding {underscoreToCase} deriving (Bounded,Eq,Show)#} @@ -280,64 +280,64 @@ -- Constructors -- | Create a new terminal widget. terminalNew :: IO Terminal-terminalNew = +terminalNew = makeNewObject mkTerminal $ liftM castPtr {#call terminal_new#} -------------------- -- Methods--- | Appends menu items for various input methods to the given menu. +-- | 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 :: +terminalImAppendMenuitems :: TerminalClass self => self -> MenuShell -- ^ @menushell@ - a menu shell of 'MenuShell'- -> IO () + -> 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@ +-- | Starts the specified command under a newly-allocated controlling pseudo-terminal.+terminalForkCommand ::+ (TerminalClass self, GlibFilePath fp, GlibString string) => self+ -> (Maybe fp) -- ^ @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 fp) -- ^ @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 + -> 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 withUTFFilePath command $ \commandPtr ->+ maybeWith withUTFFilePath directory $ \dirPtr -> maybeWith withUTFStringArray argv $ \argvPtrPtr -> maybeWith withUTFStringArray envv $ \envvPtrPtr ->- {#call terminal_fork_command#} - (toTerminal terminal) + {#call terminal_fork_command#}+ (toTerminal terminal) commandPtr argvPtrPtr envvPtrPtr dirPtr- (fromBool lastlog) + (fromBool lastlog) (fromBool utmp) (fromBool wtmp) --- | Starts a new child process under a newly-allocated controlling pseudo-terminal. +-- | 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 ::+ (TerminalClass self, GlibString string, GlibFilePath fp) => 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 fp) -- ^ @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 withUTFFilePath directory $ \dirPtr -> maybeWith withUTFStringArray envv $ \envvPtrPtr ->- {#call terminal_forkpty#} + {#call terminal_forkpty#} (toTerminal terminal) envvPtrPtr dirPtr@@ -345,14 +345,14 @@ (fromBool utmp) (fromBool wtmp) --- | Attach an existing PTY master side to the terminal widget. +-- | 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 +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)@@ -363,17 +363,17 @@ -- terminalGetPty :: TerminalClass self => self- -> IO Int -- ^ return the file descriptor, or -1 if the terminal has no PTY. -terminalGetPty terminal = - liftM fromIntegral $ + -> 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 +terminalFeed ::+ (TerminalClass self, GlibString string) => self+ -> string -- ^ @string@ - a string in the terminal's current encoding -> IO () terminalFeed terminal string = withUTFStringLen string $ \(strPtr, len) ->@@ -381,9 +381,9 @@ -- | 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 +terminalFeedChild ::+ (TerminalClass self, GlibString string) => self+ -> string -- ^ @string@ - data to send to the child -> IO () terminalFeedChild terminal string = withUTFStringLen string $ \(strPtr, len) ->@@ -393,21 +393,21 @@ -- -- * Available since Vte version 0.12.1 ---terminalFeedChildBinary :: - TerminalClass self => self - -> [Word8] -- ^ @data@ - data to send to the child +terminalFeedChildBinary ::+ TerminalClass self => self+ -> [Word8] -- ^ @data@ - data to send to the child -> IO () terminalFeedChildBinary terminal string = withArrayLen string $ \len strPtr -> {#call terminal_feed_child_binary#} (toTerminal terminal) (castPtr strPtr) (fromIntegral len)- --- | Gets the exit status of the command started by 'terminalForkCommand'. ++-- | 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 + TerminalClass self => self+ -> IO Int -- ^ return the child's exit status terminalGetChildExitStatus terminal = liftM fromIntegral $ {#call terminal_get_child_exit_status#} (toTerminal terminal)@@ -416,24 +416,24 @@ -- -- * Available since Vte version 0.16 ---terminalSelectAll :: TerminalClass self => self -> IO () +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 :: TerminalClass self => self -> IO () terminalSelectNone terminal = {#call terminal_select_none#} (toTerminal terminal) -- | Places the selected text in the terminal in the 'selectionClipboard' -- selection. terminalCopyClipboard :: TerminalClass self => self -> IO ()-terminalCopyClipboard terminal = +terminalCopyClipboard terminal = {#call terminal_copy_clipboard#} (toTerminal terminal)- + -- | 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@@ -457,193 +457,194 @@ 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. ++-- | 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 +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#} + {#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 ::+ 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 ::+ 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. ++-- | 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 ::+ 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. ++-- | 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 ::+ 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, ++-- | 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 ::+ 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 ::+ 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 ::+ 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. ++-- | 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 +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 +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 +terminalSetColorForeground ::+ TerminalClass self => self+ -> Color -- ^ @foreground@ - the new foreground color -> IO () terminalSetColorForeground terminal foreground =- with foreground $ \fgPtr -> + 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. +-- | 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 +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 +terminalSetColorDim ::+ TerminalClass self => self -> Color -- ^ @dim@ - the nw dim color -> IO () terminalSetColorDim terminal dim =- with dim $ \dimPtr -> + with dim $ \dimPtr -> {#call terminal_set_color_dim#} (toTerminal terminal) (castPtr dimPtr) --- | Sets the background color for text which is under the cursor. +-- | 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 +terminalSetColorCursor ::+ TerminalClass self => self+ -> Color -- ^ @cursor@ - the new color to use for the text cursor -> IO () terminalSetColorCursor terminal cursor =- with cursor $ \cursorPtr -> + with cursor $ \cursorPtr -> {#call terminal_set_color_cursor#} (toTerminal terminal) (castPtr cursorPtr) --- | Sets the background color for text which is highlighted. +-- | 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 +terminalSetColorHighlight ::+ TerminalClass self => self+ -> Color -- ^ @highlight@ - the new color to use for highlighted text -> IO () terminalSetColorHighlight terminal highlight =- with highlight $ \hlPtr -> + 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]. +-- | 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 +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 -> IO ()-terminalSetColors terminal foreground background palette size =+terminalSetColors terminal foreground background palette =+ allocaArray nbColors $ \pPtr -> with foreground $ \fPtr ->- with background $ \bPtr ->- with palette $ \pPtr ->- {#call terminal_set_colors#} - (toTerminal terminal) - (castPtr fPtr)- (castPtr bPtr)- (castPtr pPtr)- (fromIntegral size)+ with background $ \bPtr -> do+ pokeArray pPtr palette+ {#call terminal_set_colors#}+ (toTerminal terminal)+ (castPtr fPtr)+ (castPtr bPtr)+ (castPtr pPtr)+ (fromIntegral nbColors)+ where nbColors = length palette -- | 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 :: +terminalSetOpacity :: TerminalClass self => self- -> Int -- ^ @opacity@ - the new opacity + -> 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. +-- | 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 :: +terminalSetBackgroundImage :: TerminalClass self => self -> Maybe Pixbuf -- ^ @image@ - a 'Pixbuf' to use, or @Nothing@ to use the default background -> IO ()@@ -651,46 +652,46 @@ {#call terminal_set_background_image#} (toTerminal terminal) image terminalSetBackgroundImage terminal Nothing = {#call terminal_set_background_image#} (toTerminal terminal) (Pixbuf nullForeignPtr)- --- | Sets a background image for the widget. ++-- | 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 +terminalSetBackgroundImageFile ::+ (TerminalClass self, GlibFilePath fp) => self+ -> fp -- ^ @path@ - path to an image file -> IO () terminalSetBackgroundImageFile terminal path =- withUTFString path $ \pathPtr ->+ withUTFFilePath 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. ++-- | 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 :: +terminalSetBackgroundSaturation :: TerminalClass self => self- -> Double -- ^ @saturation@ - a floating point value between 0.0 and 1.0. - -> IO () + -> 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, ++-- | 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 :: +terminalSetBackgroundTransparent :: TerminalClass self => self- -> Bool -- ^ @transparent@ - @True@ if the terminal should fake transparency + -> 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. ++-- | 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 :: +terminalSetBackgroundTintColor :: TerminalClass self => self- -> Color -- ^ @color@ - a color which the terminal background should be tinted to if its saturation is not 1.0. + -> 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 ->@@ -700,22 +701,22 @@ -- -- * Available since Vte version 0.11 ---terminalSetScrollBackground :: +terminalSetScrollBackground :: TerminalClass self => self- -> Bool -- ^ @scroll@ - @True@ if the terminal should scroll the background image along with text. + -> 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 + TerminalClass self => self+ -> TerminalCursorShape -- ^ @shape@ - the 'TerminalCursorShape' to use -> IO ()-terminalSetCursorShape terminal shape = +terminalSetCursorShape terminal shape = {#call terminal_set_cursor_shape#} (toTerminal terminal) $fromIntegral (fromEnum shape) -- | Returns the currently set cursor shape.@@ -725,7 +726,7 @@ terminalGetCursorShape :: TerminalClass self => self -> IO TerminalCursorShape -- ^ return cursor shape-terminalGetCursorShape terminal = +terminalGetCursorShape terminal = liftM (toEnum.fromIntegral) $ {#call terminal_get_cursor_shape#} (toTerminal terminal) @@ -733,135 +734,135 @@ -- -- * Available since Vte version 0.17.1 ---terminalGetCursorBlinkMode :: +terminalGetCursorBlinkMode :: TerminalClass self => self- -> IO TerminalCursorBlinkMode -- ^ return cursor blink mode. -terminalGetCursorBlinkMode terminal = + -> 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. +-- | Sets whether or not the cursor will blink. -- -- * Available since Vte version 0.17.1 ---terminalSetCursorBlinkMode :: +terminalSetCursorBlinkMode :: TerminalClass self => self- -> TerminalCursorBlinkMode -- ^ @mode@ - the 'TerminalCursorBlinkMode' to use + -> 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. +-- | 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 :: +terminalSetScrollbackLines :: TerminalClass self => self- -> Int -- ^ @lines@ - the length of the history buffer + -> 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 :: +terminalSetFont :: TerminalClass self => self- -> FontDescription -- ^ @fontDesc@ - the 'FontDescription' of the desired font. + -> FontDescription -- ^ @fontDesc@ - the 'FontDescription' of the desired font. -> IO () terminalSetFont terminal (FontDescription fontDesc) = {#call terminal_set_font#} (toTerminal terminal) (castPtr $ unsafeForeignPtrToPtr 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. +terminalSetFontFromString ::+ (TerminalClass self, GlibString string) => self+ -> string -- ^ @name@ - a string describing the font. -> IO () terminalSetFontFromString terminal name =- withUTFString name $ \namePtr -> + withUTFString name $ \namePtr -> {#call terminal_set_font_from_string#} (toTerminal terminal) namePtr- + -- | Queries the terminal for information about the fonts which will be used to draw text in the terminal.-terminalGetFont :: +terminalGetFont :: TerminalClass self => self- -> IO FontDescription -- ^ return a 'FontDescription' describing the font the terminal is currently using to render text. + -> 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 (castPtr fdPtr) + fdPtr <- {#call unsafe terminal_get_font#} (toTerminal terminal)+ makeNewFontDescription (castPtr fdPtr) --- | Checks if the terminal currently contains selected text. +-- | 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 :: +terminalGetHasSelection :: TerminalClass self => self- -> IO Bool -- ^ return @True@ if part of the text in the terminal is selected. + -> 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. ++-- | 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 ::+ (TerminalClass self, GlibString string) => 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 :: +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 + -> 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, +-- | 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 :: +terminalSetBackspaceBinding :: TerminalClass self => self- -> TerminalEraseBinding -- ^ @binding@ - a 'TerminalEraseBinding' for the backspace key + -> 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, +-- | 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 :: +terminalSetDeleteBinding :: TerminalClass self => self- -> TerminalEraseBinding -- ^ @bindign@ - a 'TerminalEraseBinding' for the delete key + -> 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. ++-- | 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 :: +terminalSetMouseAutohide :: TerminalClass self => self- -> Bool -- ^ @autohide@ - @True@ if the autohide should be enabled + -> 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. ++-- | 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, ++-- | 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 :: +terminalReset :: TerminalClass self => self- -> Bool -- ^ @full@ - @True@ to reset tabstops - -> Bool -- ^ @clearHistory@ - @True@ to empty the terminal's scrollback buffer + -> 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)@@ -892,19 +893,19 @@ {#call unsafe g_free#} (castPtr strPtr) {#call unsafe g_array_free#} gArrPtr 1 return (zipWith attrToChar str attrs)- --- | Extracts a view of the visible part of the terminal. --- If is_selected is not @Nothing@, 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. ++-- | Extracts a view of the visible part of the terminal.+-- If is_selected is not @Nothing@, 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 ---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 + -- to select all characters -> IO [VteChar] -- ^ return a text string terminalGetTextIncludeTrailingSpaces terminal mCB = do cbPtr <- case mCB of@@ -922,22 +923,22 @@ {#call unsafe g_array_free#} gArrPtr 1 return (zipWith attrToChar str attrs) --- | Extracts a view of the visible part of the terminal. --- If is_selected is not @Nothing@, 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. +-- | Extracts a view of the visible part of the terminal.+-- If is_selected is not @Nothing@, 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. -- 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 + -> 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 +terminalGetTextRange terminal sRow sCol eRow eCol mCB = do cbPtr <- case mCB of Just cb -> mkVteSelectionFunc $ \_ c r _ -> return (fromBool (cb (fromIntegral c) (fromIntegral r)))@@ -955,7 +956,7 @@ -- | Reads the location of the insertion cursor and returns it. The row -- coordinate is absolute.-terminalGetCursorPosition :: +terminalGetCursorPosition :: TerminalClass self => self -> IO (Int, Int) -- ^ @(column,row)@ the position of the cursor terminalGetCursorPosition terminal = do@@ -971,7 +972,7 @@ terminalMatchClearAll :: TerminalClass self => self -> IO () terminalMatchClearAll terminal = {#call terminal_match_clear_all#} (toTerminal terminal)- + -- | 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.@@ -982,8 +983,8 @@ -- * Available since Vte version 0.17.1 -- terminalMatchAddRegex ::- TerminalClass self => self- -> String -- ^ @pattern@ - a regular expression+ (TerminalClass self, GlibString string) => 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@@ -996,9 +997,9 @@ (toTerminal terminal) regexPtr (fromIntegral (fromFlags mFlags)) -- | 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 :: +terminalMatchRemove :: TerminalClass self => self- -> Int -- ^ @tag@ - the tag of the regex to remove + -> Int -- ^ @tag@ - the tag of the regex to remove -> IO () terminalMatchRemove terminal tag = {#call terminal_match_remove#} (toTerminal terminal) (fromIntegral tag)@@ -1010,11 +1011,11 @@ -- more than one regular expression matches, the expressions that was -- registered first will be returned. ---terminalMatchCheck :: - TerminalClass self => self- -> Int -- ^ @column@ - the text column - -> Int -- ^ @row@ - the text row - -> IO (Maybe (String, Int))+terminalMatchCheck ::+ (TerminalClass self, GlibString string) => self+ -> Int -- ^ @column@ - the text column+ -> Int -- ^ @row@ - the text row+ -> 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'@@ -1022,21 +1023,21 @@ strPtr <- {#call terminal_match_check#} (toTerminal terminal) (fromIntegral column) (fromIntegral row) tagPtr if strPtr==nullPtr then return Nothing else do- str <- peekCString strPtr+ str <- peekUTFString strPtr {#call unsafe g_free#} (castPtr strPtr) if tagPtr==nullPtr then return Nothing else do tag <- peek tagPtr return (Just (str,fromIntegral tag)) --- | Sets which cursor the terminal will use if the pointer is over the pattern specified by 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 :: +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 + -> 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 ->@@ -1046,87 +1047,87 @@ -- -- * Available since Vte version 0.11.9 ---terminalMatchSetCursorType :: +terminalMatchSetCursorType :: TerminalClass self => self- -> Int -- ^ @tag@ the tag of the regex which should use the specified cursor + -> 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) +terminalMatchSetCursorType terminal tag cursorType =+ {#call terminal_match_set_cursor_type#} (toTerminal terminal) (fromIntegral tag) $fromIntegral (fromEnum cursorType) -- | 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 +terminalMatchSetCursorName ::+ (TerminalClass self, GlibString string) => 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. ++-- | 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 ::+ (TerminalClass self, GlibString string) => 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 ::+ (TerminalClass self, GlibString string) => 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- + {#call terminal_get_emulation#} (toTerminal terminal) >>= peekUTFString+ -- | 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 ::+ (TerminalClass self, GlibString string) => 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. + {#call terminal_get_default_emulation#} (toTerminal terminal) >>= peekUTFString++-- | 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 () + (TerminalClass self, GlibString string) => 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 ::+ (TerminalClass self, GlibString string) => 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, + {#call terminal_get_encoding#} (toTerminal terminal) >>= peekUTFString++-- | 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 -- ^ The current content of the terminal's status line. For terminals like "xterm", this will usually be the empty string.+terminalGetStatusLine ::+ (TerminalClass self, GlibString string) => self+ -> IO string -- ^ The current content of the terminal's status line. For terminals like "xterm", this will usually be the empty string. 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. + {#call terminal_get_status_line#} (toTerminal terminal) >>= peekUTFString++-- | 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 :: +terminalGetPadding :: TerminalClass self => self- -> IO (Int, Int) -- ^ @(lr,tb)@ - the left\/right-edge and top\/bottom-edge padding + -> IO (Int, Int) -- ^ @(lr,tb)@ - the left\/right-edge and top\/bottom-edge padding terminalGetPadding terminal = alloca $ \xPtr -> alloca $ \yPtr -> do@@ -1136,61 +1137,61 @@ return (fromIntegral xpad,fromIntegral ypad) -- | Get 'Adjustment' of terminal widget.-terminalGetAdjustment :: +terminalGetAdjustment :: TerminalClass self => self- -> IO Adjustment -- ^ return the contents of terminal's adjustment field + -> IO Adjustment -- ^ return the contents of terminal's adjustment field terminalGetAdjustment terminal = makeNewObject mkAdjustment $ {#call terminal_get_adjustment#} (toTerminal terminal) -- | Get terminal's char height.-terminalGetCharHeight :: +terminalGetCharHeight :: TerminalClass self => self- -> IO Int -- ^ return the contents of terminal's char_height field + -> IO Int -- ^ return the contents of terminal's char_height field terminalGetCharHeight terminal = liftM fromIntegral $ {#call terminal_get_char_height#} (toTerminal terminal) -- | Get terminal's char width.-terminalGetCharWidth :: +terminalGetCharWidth :: TerminalClass self => self- -> IO Int -- ^ return the contents of terminal's char_width field + -> IO Int -- ^ return the contents of terminal's char_width field terminalGetCharWidth terminal = liftM fromIntegral $ {#call terminal_get_char_width#} (toTerminal terminal) -- | Get terminal's column count.-terminalGetColumnCount :: +terminalGetColumnCount :: TerminalClass self => self- -> IO Int -- ^ return the contents of terminal's column_count field + -> IO Int -- ^ return the contents of terminal's column_count field terminalGetColumnCount terminal = liftM fromIntegral $ {#call terminal_get_column_count#} (toTerminal terminal)- + -- | Get terminal's row count.-terminalGetRowCount :: +terminalGetRowCount :: TerminalClass self => self- -> IO Int -- ^ return the contents of terminal's row_count field + -> IO Int -- ^ return the contents of terminal's row_count field terminalGetRowCount terminal = liftM fromIntegral $ {#call terminal_get_row_count#} (toTerminal terminal) -- | Get icon title.-terminalGetIconTitle :: - TerminalClass self => self- -> IO String -- ^ return the contents of terminal's icon_title field +terminalGetIconTitle ::+ (TerminalClass self, GlibString string) => self+ -> IO string -- ^ return the contents of terminal's icon_title field terminalGetIconTitle terminal =- {#call terminal_get_icon_title#} (toTerminal terminal) >>= peekCString- + {#call terminal_get_icon_title#} (toTerminal terminal) >>= peekUTFString+ -- | Get window title.-terminalGetWindowTitle :: - TerminalClass self => self- -> IO String -- ^ return the contents of terminal's window_title field +terminalGetWindowTitle ::+ (TerminalClass self, GlibString string) => self+ -> IO string -- ^ return the contents of terminal's window_title field terminalGetWindowTitle terminal =- {#call terminal_get_window_title#} (toTerminal terminal) >>= peekCString+ {#call terminal_get_window_title#} (toTerminal terminal) >>= peekUTFString -------------------- -- Attributes--- | Controls whether or not the terminal will attempt to draw bold text. +-- | Controls whether or not the terminal will attempt to draw bold text. -- This may happen either by using a bold font variant, or by repainting text with a different offset. -- -- Default value: @True@@@ -1214,31 +1215,31 @@ terminalGetAudibleBell terminalSetAudibleBell --- | Sets a background image file for the widget. +-- | Sets a background image file for the widget. -- If specified by "background-saturation:", the terminal will tint its in-memory copy of the image before applying it to the terminal. -- -- Default value: \"\" -- -- * Available since Vte version 0.19.1 ---terminalBackgroundImageFile :: TerminalClass self => Attr self String-terminalBackgroundImageFile = - newAttrFromStringProperty "background-image-file" +terminalBackgroundImageFile :: (TerminalClass self, GlibString string) => Attr self string+terminalBackgroundImageFile =+ newAttrFromStringProperty "background-image-file" --- | 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. +-- | 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 "background-saturation:", the terminal will tint its in-memory copy of the image before applying it to the terminal. -- -- * Available since Vte version 0.19.1 -- terminalBackgroundImagePixbuf :: TerminalClass self => Attr self (Maybe Pixbuf) terminalBackgroundImagePixbuf =- newAttrFromMaybeObjectProperty "background-image-pixbuf" + newAttrFromMaybeObjectProperty "background-image-pixbuf" {#call pure gdk_pixbuf_get_type#} -- | Sets the opacity of the terminal background, were 0.0 means completely transparent and 1.0 means completely opaque.--- +-- -- Allowed values: [0,1] -- -- Default values: 1@@ -1249,8 +1250,8 @@ terminalBackgroundOpacity = newAttrFromDoubleProperty "background-opacity" --- | 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. -- To do so, the terminal will create a copy of the background image (or snapshot of the root window) and modify its pixel values. -- -- Allowed values: [0,1]@@ -1263,9 +1264,9 @@ terminalBackgroundSaturation = newAttrFromDoubleProperty "background-saturation" --- | 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. --- To do so, the terminal will create a copy of the background image (or snapshot of the root window) and modify its pixel values. +-- | 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.+-- 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.19.1@@ -1275,11 +1276,11 @@ newAttrFromBoxedStorableProperty "background-tint-color" {#call pure unsafe gdk_color_get_type#} --- | Sets whther the terminal uses the pixmap stored in the root window as the background, +-- | 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. -- -- NOTE: When using a compositing window manager, you should instead set a RGBA colourmap on the toplevel window, so you get real transparency.--- +-- -- Default value: @False@ -- -- * Available since Vte version 0.19.1@@ -1296,10 +1297,10 @@ -- terminalBackspaceBinding :: TerminalClass self => Attr self TerminalEraseBinding terminalBackspaceBinding =- newAttrFromEnumProperty "backspace-binding" + newAttrFromEnumProperty "backspace-binding" {#call pure unsafe terminal_erase_binding_get_type#} --- | Sets whether or not the cursor will blink. +-- | Sets whether or not the cursor will blink. -- Using 'CursorBlinkSystem' will use the "gtk-cursor-blink" setting. -- -- Default value: 'CursorBlinkSystem'@@ -1325,7 +1326,7 @@ -- | Controls what string or control sequence the terminal sends to its child when the user presses the delete key. -- -- Default value: 'EraseAuto'--- +-- -- * Available since Vte version 0.19.1 -- terminalDeleteBinding :: TerminalClass self => Attr self TerminalEraseBinding@@ -1333,33 +1334,33 @@ newAttrFromEnumProperty "delete-binding" {#call pure unsafe terminal_erase_binding_get_type#} --- | Sets what type of terminal the widget attempts to emulate by scanning for control sequences defined in the system's termcap file. +-- | 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 the default which is "xterm". -- -- Default value: "xterm" -- -- * Available since Vte version 0.19.1 ---terminalEmulation :: TerminalClass self => Attr self String+terminalEmulation :: (TerminalClass self, GlibString string) => Attr self string terminalEmulation = newAttr terminalGetEmulation terminalSetEmulation --- | Controls 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. +-- | Controls 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 is defined by the application's locale settings. -- -- Default value: \"\" -- -- * Available since Vte version 0.19.1 ---terminalEncoding :: TerminalClass self => Attr self String+terminalEncoding :: (TerminalClass self, GlibString string) => Attr self string terminalEncoding = newAttr terminalGetEncoding terminalSetEncoding -- | 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, +-- 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. -- -- * Available since Vte version 0.19.1@@ -1375,10 +1376,10 @@ -- -- * Available since Vte version 0.19.1 ---terminalIconTitle :: TerminalClass self => ReadAttr self String+terminalIconTitle :: (TerminalClass self, GlibString string) => ReadAttr self string terminalIconTitle = readAttrFromStringProperty "icon-title" --- | Controls the value of the terminal's mouse autohide setting. +-- | Controls 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. -- -- Default value: @False@@@ -1403,7 +1404,7 @@ terminalGetPty terminalSetPty --- | Controls the value of the terminal's mouse autohide setting. +-- | Controls 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. -- -- Default value: @False@@@ -1414,7 +1415,7 @@ terminalScrollBackground = newAttrFromBoolProperty "scroll-background" --- | Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the user presses a key. +-- | 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. -- -- Default value: @False@@@ -1426,7 +1427,7 @@ newAttrFromBoolProperty "scroll-on-keystroke" -- | 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.--- +-- -- Default value: @True@ -- -- * Available since Vte version 0.19.1@@ -1450,7 +1451,7 @@ terminalScrollbackLines = newAttrFromUIntProperty "scrollback-lines" --- | 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. -- The terminal will clear itself to the default foreground color and then repaint itself. -- -- Default value: @False@@@ -1468,22 +1469,22 @@ -- -- * Available since Vte version 0.19.1 ---terminalWindowTitle :: TerminalClass self => ReadAttr self String+terminalWindowTitle :: (TerminalClass self, GlibString string) => ReadAttr self string terminalWindowTitle = readAttrFromStringProperty "window-title" --- | When the user double-clicks to start selection, the terminal will extend the selection on word boundaries. --- It will treat characters the word-chars characters as parts of words, and all other characters as word separators. +-- | When the user double-clicks to start selection, the terminal will extend the selection on word boundaries.+-- It will treat characters the word-chars characters 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, when setting this to the empty string, the terminal will treat all graphic non-punctuation non-space characters as word -- characters.--- +-- -- Defalut value: \"\" -- -- * Available since Vte version 0.19.1 ---terminalWordChars :: TerminalClass self => Attr self String+terminalWordChars :: (TerminalClass self, GlibString string) => Attr self string terminalWordChars =- newAttrFromStringProperty "word-chars" + newAttrFromStringProperty "word-chars" -------------------- -- Signals@@ -1500,10 +1501,10 @@ childExited :: TerminalClass self => Signal self (IO ()) childExited = Signal (connect_NONE__NONE "child-exited") --- | Emitted whenever the terminal receives input from the user and prepares to send it to the child process. +-- | Emitted whenever the terminal receives input from the user and prepares to send it to the child process. -- The signal is emitted even when there is no child process.-commit :: TerminalClass self => Signal self (String -> Int -> IO ())-commit = Signal (connect_STRING_INT__NONE "commit")+commit :: (TerminalClass self, GlibString string) => Signal self (string -> Int -> IO ())+commit = Signal (connect_GLIBSTRING_INT__NONE "commit") -- | Emitted whenever the visible appearance of the terminal has changed. Used primarily by 'TerminalAccessible'. contentsChanged :: TerminalClass self => Signal self (IO ())@@ -1529,12 +1530,12 @@ emulationChanged :: TerminalClass self => Signal self (IO ()) emulationChanged = Signal (connect_NONE__NONE "emulation-changed") --- | Emitted whenever the terminal's current encoding has changed, +-- | 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. encodingChanged :: TerminalClass self => Signal self (IO ()) encodingChanged = Signal (connect_NONE__NONE "encoding-changed") --- | Emitted when the terminal receives an end-of-file from a child which is running in the terminal. +-- | Emitted when the terminal receives an end-of-file from a child which is running in the terminal. -- This signal is frequently (but not always) emitted with a 'childExited' signal. eof :: TerminalClass self => Signal self (IO ()) eof = Signal (connect_NONE__NONE "eof")@@ -1576,8 +1577,8 @@ refreshWindow = Signal (connect_NONE__NONE "refresh-window") -- | Emitted at the child application's request.-resizeWidnow :: TerminalClass self => Signal self (Int -> Int -> IO ()) -resizeWidnow = Signal (connect_INT_INT__NONE "resize-window")+resizeWindow :: TerminalClass self => Signal self (Int -> Int -> IO ())+resizeWindow = Signal (connect_INT_INT__NONE "resize-window") -- | Emitted at the child application's request. restoreWindow :: TerminalClass self => Signal self (IO ())@@ -1587,8 +1588,8 @@ selectionChanged :: TerminalClass self => Signal self (IO ()) selectionChanged = Signal (connect_NONE__NONE "selection-changed") --- | Set the scroll adjustments for the terminal. --- Usually scrolled containers like 'ScrolledWindow' will emit this +-- | Set the scroll adjustments for the terminal.+-- Usually scrolled containers like 'ScrolledWindow' will emit this -- signal to connect two instances of 'Scrollbar' to the scroll directions of the 'Terminal'. setScrollAdjustments :: TerminalClass self => Signal self (Adjustment -> Adjustment -> IO ()) setScrollAdjustments = Signal (connect_OBJECT_OBJECT__NONE "set-scroll-adjustments")@@ -1597,22 +1598,22 @@ statusLineChanged :: TerminalClass self => Signal self (IO ()) statusLineChanged = Signal (connect_NONE__NONE "status-line-changed") --- | An internal signal used for communication between the terminal and its accessibility peer. +-- | An internal signal used for communication between the terminal and its accessibility peer. -- May not be emitted under certain circumstances. textDeleted :: TerminalClass self => Signal self (IO ()) textDeleted = Signal (connect_NONE__NONE "text-deleted") --- | An internal signal used for communication between the terminal and its accessibility peer. +-- | An internal signal used for communication between the terminal and its accessibility peer. -- May not be emitted under certain circumstances. textInserted :: TerminalClass self => Signal self (IO ()) textInserted = Signal (connect_NONE__NONE "text-inserted") --- | An internal signal used for communication between the terminal and its accessibility peer. +-- | An internal signal used for communication between the terminal and its accessibility peer. -- May not be emitted under certain circumstances. textModified :: TerminalClass self => Signal self (IO ()) textModified = Signal (connect_NONE__NONE "text-modified") --- | An internal signal used for communication between the terminal and its accessibility peer. +-- | An internal signal used for communication between the terminal and its accessibility peer. -- May not be emitted under certain circumstances. textScrolled :: TerminalClass self => Signal self (Int -> IO ()) textScrolled = Signal (connect_INT__NONE "text-scrolled")
Gtk2HsSetup.hs view
@@ -6,9 +6,9 @@ -- | Build a Gtk2hs package. ---module Gtk2HsSetup ( - gtk2hsUserHooks, - getPkgConfigPackages, +module Gtk2HsSetup (+ gtk2hsUserHooks,+ getPkgConfigPackages, checkGtk2hsBuildtools, typeGenProgram, signalGenProgram,@@ -55,8 +55,9 @@ import Distribution.Version (Version(..)) import Distribution.Verbosity import Control.Monad (when, unless, filterM, liftM, forM, forM_)-import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList )-import Data.List (isPrefixOf, isSuffixOf, stripPrefix, nub)+import Data.Maybe ( isJust, isNothing, fromMaybe, maybeToList, catMaybes )+import Data.List (isPrefixOf, isSuffixOf, nub, minimumBy, stripPrefix, tails )+import Data.Ord as Ord (comparing) import Data.Char (isAlpha, isNumber) import qualified Data.Map as M import qualified Data.Set as S@@ -113,9 +114,16 @@ fixLibs :: [FilePath] -> [String] -> [String] fixLibs dlls = concatMap $ \ lib -> case filter (isLib lib) dlls of- dll:_ -> [dropExtension dll]- _ -> if lib == "z" then [] else [lib]+ dlls@(_:_) -> [dropExtension (pickDll dlls)]+ _ -> if lib == "z" then [] else [lib] where+ -- If there are several .dll files matching the one we're after then we+ -- just have to guess. For example for recent Windows cairo builds we get+ -- libcairo-2.dll libcairo-gobject-2.dll libcairo-script-interpreter-2.dll+ -- Our heuristic is to pick the one with the shortest name.+ -- Yes this is a hack but the proper solution is hard: we would need to+ -- parse the .a file and see which .dll file(s) it needed to link to.+ pickDll = minimumBy (Ord.comparing length) isLib lib dll = case stripPrefix ("lib"++lib) dll of Just ('.':_) -> True@@ -154,9 +162,9 @@ register :: PackageDescription -> LocalBuildInfo -> RegisterFlags -- ^Install in the user's database?; verbose -> IO ()-register pkg@(library -> Just lib )- lbi@(libraryConfig -> Just clbi) regFlags+register pkg@PackageDescription { library = Just lib } lbi regFlags = do+ let clbi = LBI.getComponentLocalBuildInfo lbi LBI.CLibName installedPkgInfoRaw <- generateRegistrationInfo verbosity pkg lib lbi clbi inplace distPref@@ -168,7 +176,7 @@ -- Three different modes: case () of- _ | modeGenerateRegFile -> die "Generate Reg File not supported"+ _ | modeGenerateRegFile -> writeRegistrationFile installedPkgInfo | modeGenerateRegScript -> die "Generate Reg Script not supported" | otherwise -> registerPackage verbosity installedPkgInfo pkg lbi inplace@@ -180,6 +188,8 @@ where modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags))+ regFile = fromMaybe (display (packageId pkg) <.> "conf")+ (fromFlag (regGenPkgConf regFlags)) modeGenerateRegScript = fromFlag (regGenScript regFlags) inplace = fromFlag (regInPlace regFlags) packageDbs = nub $ withPackageDB lbi@@ -188,6 +198,10 @@ distPref = fromFlag (regDistPref regFlags) verbosity = fromFlag (regVerbosity regFlags) + writeRegistrationFile installedPkgInfo = do+ notice verbosity ("Creating package registration file: " ++ regFile)+ writeUTF8File regFile (showInstalledPackageInfo installedPkgInfo)+ register _ _ regFlags = notice verbosity "No package to register" where verbosity = fromFlag (regVerbosity regFlags)@@ -247,11 +261,24 @@ = nub $ ["-I" ++ dir | dir <- PD.includeDirs bi] ++ [opt | opt@('-':c:_) <- PD.cppOptions bi ++ PD.ccOptions bi, c `elem` "DIU"]- ++ ["-D__GLASGOW_HASKELL__="++show (ghcDefine . versionBranch . compilerVersion $ LBI.compiler lbi)]+ ++ ["-D__GLASGOW_HASKELL__="++show (ghcDefine . ghcVersion . compilerId $ LBI.compiler lbi)] where ghcDefine (v1:v2:_) = v1 * 100 + v2 ghcDefine _ = __GLASGOW_HASKELL__ + ghcVersion :: CompilerId -> [Int]+-- This version is nicer, but we need to know the Cabal version that includes the new CompilerId+-- #if CABAL_VERSION_CHECK(1,19,2)+-- ghcVersion (CompilerId GHC v _) = versionBranch v+-- ghcVersion (CompilerId _ _ (Just c)) = ghcVersion c+-- #else+-- ghcVersion (CompilerId GHC v) = versionBranch v+-- #endif+-- ghcVersion _ = []+-- This version should work fine for now+ ghcVersion = concat . take 1 . map (read . (++"]") . takeWhile (/=']')) . catMaybes+ . map (stripPrefix "CompilerId GHC (Version {versionBranch = ") . tails . show+ installCHI :: PackageDescription -- ^information from the .cabal file -> LocalBuildInfo -- ^information from the configure step -> Verbosity -> CopyDest -- ^flags sent to copy or install@@ -262,11 +289,11 @@ -- a modules that does not have a .chi file mFiles <- mapM (findFileWithExtension' ["chi"] [buildDir lbi] . toFilePath) (PD.libModules lib)- + let files = [ f | Just f <- mFiles ] installOrdinaryFiles verbosity libPref files - + installCHI _ _ _ _ = return () ------------------------------------------------------------------------------@@ -292,13 +319,12 @@ genSynthezisedFiles :: Verbosity -> PackageDescription -> LocalBuildInfo -> IO () genSynthezisedFiles verb pd lbi = do- cPkgs <- getPkgConfigPackages verb lbi pd let xList = maybe [] (customFieldsBI . libBuildInfo) (library pd) ++customFieldsPD pd typeOpts :: String -> [ProgArg]- typeOpts tag = concat [ map (\val -> '-':'-':drop (length tag) field++'=':val) (words content)+ typeOpts tag = concat [ map (\val -> '-':'-':drop (length tag) field ++ '=':val) (words content) | (field,content) <- xList, tag `isPrefixOf` field, field /= (tag++"file")]@@ -306,8 +332,9 @@ | PackageIdentifier name (Version (major:minor:_) _) <- cPkgs , let name' = filter isAlpha (display name) , tag <- name'- : [ name' ++ "-" ++ show major ++ "." ++ show digit- | digit <- [0,2..minor] ]+ :[ name' ++ "-" ++ show maj ++ "." ++ show d2+ | (maj, d2) <- [(maj, d2) | maj <- [0..(major-1)], d2 <- [0,2..20]]+ ++ [(major, d2) | d2 <- [0,2..minor]] ] ] signalsOpts :: [ProgArg]@@ -426,14 +453,14 @@ -- Extract the dependencies of this file. This is intentionally rather naive as it -- ignores CPP conditionals. We just require everything which means that the--- existance of a .chs module may not depend on some CPP condition. +-- existance of a .chs module may not depend on some CPP condition. extractDeps :: ModDep -> IO ModDep extractDeps md@ModDep { mdLocation = Nothing } = return md extractDeps md@ModDep { mdLocation = Just f } = withUTF8FileContents f $ \con -> do let findImports acc (('{':'#':xs):xxs) = case (dropWhile (' ' ==) xs) of ('i':'m':'p':'o':'r':'t':' ':ys) -> case simpleParse (takeWhile ('#' /=) ys) of- Just m -> findImports (m:acc) xxs + Just m -> findImports (m:acc) xxs Nothing -> die ("cannot parse chs import in "++f++":\n"++ "offending line is {#"++xs) -- no more imports after the first non-import hook@@ -467,8 +494,8 @@ return (programName prog, location) ) programs let printError name = do- putStrLn $ "Cannot find " ++ name ++ "\n" + putStrLn $ "Cannot find " ++ name ++ "\n" ++ "Please install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin)." exitFailure forM_ programInfos $ \ (name, location) ->- when (isNothing location) (printError name) + when (isNothing location) (printError name)
SetupWrapper.hs view
@@ -9,7 +9,7 @@ import Distribution.Simple.Program import Distribution.Simple.Compiler import Distribution.Simple.BuildPaths (exeExtension)-import Distribution.Simple.Configure (configCompiler)+import Distribution.Simple.Configure (configCompilerEx) import Distribution.Simple.GHC (getInstalledPackages) import qualified Distribution.Simple.PackageIndex as PackageIndex import Distribution.Version@@ -115,7 +115,7 @@ when outOfDate $ do debug verbosity "Setup script is out of date, compiling..." - (comp, conf) <- configCompiler (Just GHC) Nothing Nothing+ (comp, _, conf) <- configCompilerEx (Just GHC) Nothing Nothing defaultProgramConfiguration verbosity cabalLibVersion <- cabalLibVersionToUse comp conf let cabalPkgid = PackageIdentifier (PackageName "Cabal") cabalLibVersion
hierarchy.list view
@@ -15,327 +15,15 @@ # conditional by appending 'if <tag>'. Such types are only produces if # --tag=<tag> is given on the command line of TypeGenerator. -- GObject - GdkDrawable - GdkWindow as DrawWindow, gdk_window_object_get_type-# GdkDrawableImplX11-# GdkWindowImplX11- GdkPixmap- GdkGLPixmap if gtkglext- GdkGLWindow if gtkglext- GdkColormap- GdkScreen if gtk-2.2- GdkDisplay if gtk-2.2- GdkVisual- GdkDevice- GtkSettings- GtkTextBuffer- GtkSourceBuffer if sourceview- GtkSourceBuffer if gtksourceview2- GtkTextTag- GtkSourceTag if sourceview- GtkTextTagTable- GtkSourceTagTable if sourceview- GtkStyle- GtkRcStyle- GdkDragContext- GdkPixbuf- GdkPixbufAnimation- GdkPixbufSimpleAnim- GdkPixbufAnimationIter- GtkTextChildAnchor- GtkTextMark- GtkSourceMarker if sourceview- GtkSourceMark if gtksourceview2- GtkObject+# Before these conditions, two additional properties may be given:+# * noDestr : ignores the destructor given by the --destructor+# command line argument and uses 'objectUnref'+# * noEq : do not make this type an instance of Eq; used+# if a different equality instance is manually+# defined later+ GObject+ GtkObject GtkWidget- GtkMisc- GtkLabel- GtkAccelLabel- GtkTipsQuery if deprecated- GtkArrow- GtkImage GtkContainer- WebKitWebView as WebView, webkit_web_view_get_type if webkit GtkBin- GtkAlignment- GtkFrame- GtkAspectFrame- GtkButton- GtkToggleButton- GtkCheckButton- GtkRadioButton- GtkColorButton if gtk-2.4- GtkFontButton if gtk-2.4- GtkOptionMenu if deprecated- GtkItem- GtkMenuItem- GtkCheckMenuItem- GtkRadioMenuItem- GtkTearoffMenuItem- GtkImageMenuItem- GtkSeparatorMenuItem- GtkListItem if deprecated-# GtkTreeItem- GtkWindow- GtkDialog- GtkAboutDialog if gtk-2.6- GtkColorSelectionDialog- GtkFileSelection- GtkFileChooserDialog if gtk-2.4- GtkFontSelectionDialog- GtkInputDialog- GtkMessageDialog- GtkPlug if plugNsocket- GtkEventBox- GtkHandleBox- GtkScrolledWindow- GtkViewport- GtkExpander if gtk-2.4- GtkComboBox if gtk-2.4- GtkComboBoxEntry if gtk-2.4- GtkToolItem if gtk-2.4- GtkToolButton if gtk-2.4- GtkMenuToolButton if gtk-2.6- GtkToggleToolButton if gtk-2.4- GtkRadioToolButton if gtk-2.4- GtkSeparatorToolItem if gtk-2.4- GtkMozEmbed if mozembed- VteTerminal as Terminal if vte- GtkBox- GtkButtonBox- GtkHButtonBox- GtkVButtonBox- GtkVBox- GtkColorSelection- GtkFontSelection- GtkFileChooserWidget if gtk-2.4- GtkHBox- GtkCombo if deprecated- GtkFileChooserButton if gtk-2.6- GtkStatusbar- GtkCList if deprecated- GtkCTree if deprecated- GtkFixed- GtkPaned- GtkHPaned- GtkVPaned- GtkIconView if gtk-2.6- GtkLayout- GtkList if deprecated- GtkMenuShell- GtkMenu- GtkMenuBar- GtkNotebook-# GtkPacker- GtkSocket if plugNsocket- GtkTable- GtkTextView- GtkSourceView if sourceview- GtkSourceView if gtksourceview2- GtkToolbar- GtkTreeView- GtkCalendar- GtkCellView if gtk-2.6- GtkDrawingArea- GtkEntry- GtkSpinButton- GtkRuler- GtkHRuler- GtkVRuler- GtkRange- GtkScale- GtkHScale- GtkVScale- GtkScrollbar- GtkHScrollbar- GtkVScrollbar- GtkSeparator- GtkHSeparator- GtkVSeparator- GtkInvisible-# GtkOldEditable-# GtkText- GtkPreview if deprecated-# Progress is deprecated, ProgressBar contains everything necessary-# GtkProgress- GtkProgressBar- GtkAdjustment- GtkIMContext- GtkIMMulticontext- GtkItemFactory if deprecated- GtkTooltips- -# These object were added by hand because they do not show up in the hierarchy-# chart.-# These are derived from GtkObject:- GtkTreeViewColumn- GtkCellRenderer- GtkCellRendererPixbuf- GtkCellRendererText- GtkCellRendererCombo if gtk-2.6- GtkCellRendererToggle- GtkCellRendererProgress if gtk-2.6- GtkFileFilter if gtk-2.4- GtkBuilder if gtk-2.12-# These are actually interfaces, but all objects that implement it are at-# least GObjects.- GtkCellLayout if gtk-2.4- GtkTreeSortable if gtk-2.4- GtkTooltip if gtk-2.12-# These are derived from GObject:- GtkStatusIcon if gtk-2.10- GtkTreeSelection- GtkTreeModel- GtkTreeStore- GtkListStore- GtkTreeModelSort- GtkTreeModelFilter if gtk-2.4- GtkIconFactory- GtkIconTheme- GtkSizeGroup- GtkClipboard if gtk-2.2- GtkAccelGroup- GtkAccelMap if gtk-2.4- GtkEntryCompletion if gtk-2.4- GtkAction if gtk-2.4- GtkToggleAction if gtk-2.4- GtkRadioAction if gtk-2.4- GtkActionGroup if gtk-2.4- GtkUIManager if gtk-2.4- GtkWindowGroup- GtkSourceLanguage if sourceview- GtkSourceLanguage if gtksourceview2- GtkSourceLanguagesManager if sourceview- GtkSourceLanguageManager if gtksourceview2- GladeXML as GladeXML, glade_xml_get_type if libglade- GConfClient as GConf if gconf-# These ones are actualy interfaces, but interface implementations are GObjects- GtkEditable- GtkSourceStyle as SourceStyleObject if gtksourceview2- GtkSourceStyleScheme if sourceview- GtkSourceStyleScheme if gtksourceview2- GtkSourceStyleSchemeManager if gtksourceview2- GtkFileChooser if gtk-2.4-## This now became a GObject in version 2:- GdkGC as GC, gdk_gc_get_type-## These are Pango structures- PangoContext as PangoContext, pango_context_get_type if pango- PangoLayout as PangoLayoutRaw, pango_layout_get_type if pango- PangoFont as Font, pango_font_get_type if pango- PangoFontFamily as FontFamily, pango_font_family_get_type if pango- PangoFontFace as FontFace, pango_font_face_get_type if pango- PangoFontMap as FontMap, pango_font_face_get_type if pango- PangoFontset as FontSet, pango_fontset_get_type if pango-## This type is only available for PANGO_ENABLE_BACKEND compiled source-## PangoFontsetSimple as FontSetSimple, pango_fontset_simple_get_type--## GtkGlExt classes- GdkGLContext if gtkglext- GdkGLConfig if gtkglext- GdkGLDrawable if gtkglext--## GnomeVFS classes- GnomeVFSVolume as Volume, gnome_vfs_volume_get_type if gnomevfs- GnomeVFSDrive as Drive, gnome_vfs_drive_get_type if gnomevfs- GnomeVFSVolumeMonitor as VolumeMonitor, gnome_vfs_volume_monitor_get_type if gnomevfs--## GIO classes-# Note on all the "as" clauses: the prefix G is unfortunate since it leads-# to two consecutive upper case letters which are not translated with an-# underscore each (e.g. GConf -> gconf, GtkHButtonBox -> gtk_hbutton_box).-# GUnixMountMonitor as UnixMountMonitor, g_unix_mount_monitor_get_type if gio- GOutputStream as OutputStream, g_output_stream_get_type if gio- GFilterOutputStream as FilterOutputStream, g_filter_output_stream_get_type if gio- GDataOutputStream as DataOutputStream, g_data_output_stream_get_type if gio- GBufferedOutputStream as BufferedOutputStream, g_buffered_output_stream_get_type if gio-# GUnixOutputStream as UnixOutputStream, g_unix_output_stream_get_type if gio- GFileOutputStream as FileOutputStream, g_file_output_stream_get_type if gio- GMemoryOutputStream as MemoryOutputStream, g_memory_output_stream_get_type if gio- GInputStream as InputStream, g_input_stream_get_type if gio-# GUnixInputStream as UnixInputStream, g_unix_input_stream_get_type if gio- GMemoryInputStream as MemoryInputStream, g_memory_input_stream_get_type if gio- GFilterInputStream as FilterInputStream, g_filter_input_stream_get_type if gio- GBufferedInputStream as BufferedInputStream, g_buffered_input_stream_get_type if gio- GDataInputStream as DataInputStream, g_data_input_stream_get_type if gio- GFileInputStream as FileInputStream, g_file_input_stream_get_type if gio-# GDesktopAppInfo as DesktopAppInfo, g_desktop_app_info_get_type if gio- GFileMonitor as FileMonitor, g_file_monitor_get_type if gio- GVfs as Vfs, g_vfs_get_type if gio- GMountOperation as MountOperation, g_mount_operation_get_type if gio- GThemedIcon as ThemedIcon, g_themed_icon_get_type if gio- GEmblem as Emblem, g_emblem_get_type if gio- GEmblemedIcon as EmblemedIcon, g_emblemed_icon_get_type if gio- GFileEnumerator as FileEnumerator, g_file_enumerator_get_type if gio- GFilenameCompleter as FilenameCompleter, g_filename_completer_get_type if gio- GFileIcon as FileIcon, g_file_icon_get_type if gio- GVolumeMonitor as VolumeMonitor, g_volume_monitor_get_type if gio- GCancellable as Cancellable, g_cancellable_get_type if gio- GSimpleAsyncResult as SimpleAsyncResult, g_async_result_get_type if gio- GFileInfo as FileInfo, g_file_info_get_type if gio- GAppLaunchContext as AppLaunchContext, g_app_launch_context_get_type if gio-## these are actually GInterfaces- GIcon as Icon, g_icon_get_type if gio- GSeekable as Seekable, g_seekable_get_type if gio- GAppInfo as AppInfo, g_app_info_get_type if gio- GVolume as Volume, g_volume_get_type if gio- GAsyncResult as AsyncResult, g_async_result_get_type if gio- GLoadableIcon as LoadableIcon, g_loadable_icon_get_type if gio- GDrive as Drive, g_drive_get_type if gio- GFile noEq as File, g_file_get_type if gio- GMount as Mount, g_mount_get_type if gio--## 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-- WebKitWebFrame as WebFrame, webkit_web_frame_get_type if webkit - WebKitWebSettings as WebSettings, webkit_web_settings_get_type if webkit- WebKitNetworkRequest as NetworkRequest, webkit_network_request_get_type if webkit- WebKitNetworkResponse as NetworkResponse, webkit_network_response_get_type if webkit- WebKitDownload as Download, webkit_download_get_type if webkit- WebKitWebBackForwardList as WebBackForwardList, webkit_web_back_forward_list_get_type if webkit- WebKitWebHistoryItem as WebHistoryItem, webkit_web_history_item_get_type if webkit- WebKitWebInspector as WebInspector, webkit_web_inspector_get_type if webkit- WebKitHitTestResult as HitTestResult, webkit_hit_test_result_get_type if webkit- WebKitSecurityOrigin as SecurityOrigin, webkit_security_origin_get_type if webkit- WebKitSoupAuthDialog as SoupAuthDialog, webkit_soup_auth_dialog_get_type if webkit- WebKitWebDatabase as WebDatabase, webkit_web_database_get_type if webkit- WebKitWebDataSource as WebDataSource, webkit_web_data_source_get_type if webkit- WebKitWebNavigationAction as WebNavigationAction, webkit_web_navigation_action_get_type if webkit- WebKitWebPolicyDecision as WebPolicyDecision, webkit_web_policy_decision_get_type if webkit- WebKitWebResource as WebResource, webkit_web_resource_get_type if webkit- WebKitWebWindowFeatures as WebWindowFeatures, webkit_web_window_features_get_type if webkit-+ VteTerminal as Terminal if vte
marshal.list view
@@ -47,5 +47,5 @@ NONE:INT,INT NONE:LONG,LONG NONE:TOBJECT,TOBJECT-NONE:STRING,INT+NONE:GLIBSTRING,INT
vte.cabal view
@@ -1,5 +1,5 @@ Name: vte-Version: 0.12.5.0+Version: 0.13.0.0 License: LGPL-2.1 License-file: COPYING Copyright: (c) 2001-2010 The Gtk2Hs Team@@ -40,11 +40,11 @@ Library build-depends: base >= 4 && < 5,- glib >= 0.12.5.0 && < 0.13, - pango >= 0.12.5.0 && < 0.13, - gtk >= 0.12.5.0 && < 0.13+ glib >= 0.13.0.0 && < 0.14,+ pango >= 0.13.0.0 && < 0.14,+ gtk >= 0.13.0.0 && < 0.14 - build-tools: gtk2hsC2hs >= 0.13.9,+ build-tools: gtk2hsC2hs >= 0.13.11, gtk2hsHookGenerator, gtk2hsTypeGen exposed-modules:@@ -53,7 +53,7 @@ Graphics.UI.Gtk.Vte.Structs Graphics.UI.Gtk.Vte.Types Graphics.UI.Gtk.Vte.Signals- + extensions: ForeignFunctionInterface c-sources: Graphics/UI/Gtk/Vte/VteCharAttrFields.c @@ -62,6 +62,7 @@ x-Signals-Types: marshal.list x-Signals-Import: Graphics.UI.GtkInternals + cpp-options: -U__BLOCKS__ x-c2hs-Header: vte/vte.h include-dirs: Graphics/UI/Gtk/Vte/ pkgconfig-depends: vte >= 0.20.5