gtksourceview2 0.12.5.0 → 0.13.0.0
raw patch · 19 files changed
+474/−740 lines, 19 filesdep +textdep ~glibdep ~gtk
Dependencies added: text
Dependency ranges changed: glib, gtk
Files
- Graphics/UI/Gtk/SourceView/Signals.chs +3/−2
- Graphics/UI/Gtk/SourceView/SourceBuffer.chs +92/−91
- Graphics/UI/Gtk/SourceView/SourceCompletionItem.chs +37/−34
- Graphics/UI/Gtk/SourceView/SourceCompletionProposal.chs +14/−14
- Graphics/UI/Gtk/SourceView/SourceCompletionProvider.chs +13/−13
- Graphics/UI/Gtk/SourceView/SourceIter.chs +4/−4
- Graphics/UI/Gtk/SourceView/SourceLanguage.chs +27/−27
- Graphics/UI/Gtk/SourceView/SourceLanguageManager.chs +17/−17
- Graphics/UI/Gtk/SourceView/SourceMark.chs +21/−20
- Graphics/UI/Gtk/SourceView/SourceStyle.hs +5/−3
- Graphics/UI/Gtk/SourceView/SourceStyleScheme.chs +34/−34
- Graphics/UI/Gtk/SourceView/SourceStyleSchemeManager.chs +19/−19
- Graphics/UI/Gtk/SourceView/SourceView.chs +113/−112
- Graphics/UI/Gtk/SourceView/Types.chs +1/−0
- Gtk2HsSetup.hs +48/−21
- SetupWrapper.hs +2/−2
- gtksourceview2.cabal +6/−6
- gtksourceview2.h +3/−0
- hierarchy.list +15/−321
Graphics/UI/Gtk/SourceView/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@@ -55,9 +55,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#} {#context lib="gtk" prefix="gtk" #}
Graphics/UI/Gtk/SourceView/SourceBuffer.chs view
@@ -30,11 +30,11 @@ -- | The 'SourceBuffer' object is the model for 'SourceView' widgets. It extends the 'TextBuffer' -- object by adding features useful to display and edit source code as syntax highlighting and bracket -- matching. It also implements support for undo/redo operations.--- +-- -- To create a 'SourceBuffer' use 'sourceBufferNew' or -- 'sourceBufferNewWithLanguage'. The second form is just a convenience function which allows -- you to initially set a 'SourceLanguage'.--- +-- -- By default highlighting is enabled, but you can disable it with -- 'sourceBufferSetHighlightSyntax'. @@ -93,6 +93,7 @@ import Graphics.UI.Gtk.Abstract.Object (makeNewObject) import System.Glib.Attributes import System.Glib.FFI+import System.Glib.UTFString import System.Glib.GList import System.Glib.GObject (wrapNewGObject, makeNewGObject) @@ -111,7 +112,7 @@ -- sourceBufferNew :: Maybe TextTagTable -> IO SourceBuffer sourceBufferNew tt = wrapNewGObject mkSourceBuffer $- {#call unsafe source_buffer_new#} + {#call unsafe source_buffer_new#} (fromMaybe (TextTagTable nullForeignPtr) tt) -- | Create a new 'SourceBuffer'@@ -126,37 +127,37 @@ -- 'sourceBufferSetLanguage'. If highlight is 'False', syntax highlighting is disabled and all the -- 'TextTag' objects that have been added by the syntax highlighting engine are removed from the -- buffer.-sourceBufferSetHighlightSyntax :: SourceBufferClass buffer => buffer -- ^ @buffer@ a 'SourceBuffer'. - -> Bool -- ^ @highlight@ 'True' to enable syntax highlighting, 'False' to disable it. +sourceBufferSetHighlightSyntax :: SourceBufferClass buffer => buffer -- ^ @buffer@ a 'SourceBuffer'.+ -> Bool -- ^ @highlight@ 'True' to enable syntax highlighting, 'False' to disable it. -> IO () sourceBufferSetHighlightSyntax sb newVal =- {#call unsafe source_buffer_set_highlight_syntax#} - (toSourceBuffer sb) + {#call unsafe source_buffer_set_highlight_syntax#}+ (toSourceBuffer sb) (fromBool newVal)- + -- | Determines whether syntax highlighting is activated in the source buffer.-sourceBufferGetHighlightSyntax :: SourceBufferClass buffer => buffer - -> IO Bool -- ^ returns 'True' if syntax highlighting is enabled, 'False' otherwise. +sourceBufferGetHighlightSyntax :: SourceBufferClass buffer => buffer+ -> IO Bool -- ^ returns 'True' if syntax highlighting is enabled, 'False' otherwise. sourceBufferGetHighlightSyntax sb = liftM toBool $- {#call unsafe source_buffer_get_highlight_syntax#} + {#call unsafe source_buffer_get_highlight_syntax#} (toSourceBuffer sb) -- | Associate a 'SourceLanguage' with the source buffer. If language is not-'Nothing' and syntax -- highlighting is enabled (see 'sourceBufferSetHighlightSyntax', the syntax patterns defined -- in language will be used to highlight the text contained in the buffer. If language is 'Nothing', the -- text contained in the buffer is not highlighted.-sourceBufferSetLanguage :: SourceBufferClass buffer => buffer - -> Maybe SourceLanguage -- ^ @language@ a 'SourceLanguage' to set, or 'Nothing'. +sourceBufferSetLanguage :: SourceBufferClass buffer => buffer+ -> Maybe SourceLanguage -- ^ @language@ a 'SourceLanguage' to set, or 'Nothing'. -> IO () sourceBufferSetLanguage sb lang =- {#call unsafe source_buffer_set_language#} - (toSourceBuffer sb) + {#call unsafe source_buffer_set_language#}+ (toSourceBuffer sb) (fromMaybe (SourceLanguage nullForeignPtr) lang)- --- | Returns the 'SourceLanguage' associated with the buffer, see 'sourceBufferSetLanguage'. -sourceBufferGetLanguage :: SourceBufferClass buffer => buffer - -> IO (Maybe SourceLanguage) -- ^ returns 'SourceLanguage' associated with the buffer, or 'Nothing'. -sourceBufferGetLanguage sb = ++-- | Returns the 'SourceLanguage' associated with the buffer, see 'sourceBufferSetLanguage'.+sourceBufferGetLanguage :: SourceBufferClass buffer => buffer+ -> IO (Maybe SourceLanguage) -- ^ returns 'SourceLanguage' associated with the buffer, or 'Nothing'.+sourceBufferGetLanguage sb = maybeNull (makeNewGObject mkSourceLanguage) $ {#call unsafe source_buffer_get_language#} (toSourceBuffer sb) @@ -164,78 +165,78 @@ -- cursor over a bracket character (a parenthesis, a square bracket, etc.) the matching opening or -- closing bracket character will be highlighted. You can specify the style with the -- 'sourceBufferSetBracketMatchStyle' function.-sourceBufferSetHighlightMatchingBrackets :: SourceBufferClass buffer => buffer - -> Bool -- ^ @highlight@ 'True' if you want matching brackets highlighted. +sourceBufferSetHighlightMatchingBrackets :: SourceBufferClass buffer => buffer+ -> Bool -- ^ @highlight@ 'True' if you want matching brackets highlighted. -> IO () sourceBufferSetHighlightMatchingBrackets sb newVal = {#call unsafe source_buffer_set_highlight_matching_brackets#} (toSourceBuffer sb) (fromBool newVal)- + -- | Determines whether bracket match highlighting is activated for the source buffer.-sourceBufferGetHighlightMatchingBrackets :: SourceBufferClass buffer => buffer - -> IO Bool -- ^ returns 'True' if the source buffer will highlight matching brackets. +sourceBufferGetHighlightMatchingBrackets :: SourceBufferClass buffer => buffer+ -> IO Bool -- ^ returns 'True' if the source buffer will highlight matching brackets. sourceBufferGetHighlightMatchingBrackets sb = liftM toBool $ {#call unsafe source_buffer_get_highlight_matching_brackets#} (toSourceBuffer sb) -- | Sets style scheme used by the buffer. If scheme is 'Nothing' no style scheme is used.-sourceBufferSetStyleScheme :: SourceBufferClass buffer => buffer - -> Maybe SourceStyleScheme -- ^ @scheme@ style scheme. +sourceBufferSetStyleScheme :: SourceBufferClass buffer => buffer+ -> Maybe SourceStyleScheme -- ^ @scheme@ style scheme. -> IO () sourceBufferSetStyleScheme sb scheme =- {#call unsafe source_buffer_set_style_scheme#} - (toSourceBuffer sb) + {#call unsafe source_buffer_set_style_scheme#}+ (toSourceBuffer sb) (fromMaybe (SourceStyleScheme nullForeignPtr) scheme) -- | Returns the 'SourceStyleScheme' currently used in buffer.-sourceBufferGetStyleScheme :: SourceBufferClass buffer => buffer +sourceBufferGetStyleScheme :: SourceBufferClass buffer => buffer -> IO (Maybe SourceStyleScheme) -- ^ returns the 'SourceStyleScheme' set by 'sourceBufferSetStyleScheme', or 'Nothing'.-sourceBufferGetStyleScheme sb = +sourceBufferGetStyleScheme sb = maybeNull (makeNewGObject mkSourceStyleScheme) $ {#call unsafe source_buffer_get_style_scheme#} (toSourceBuffer sb) -- | Sets the number of undo levels for user actions the buffer will track. If the number of user actions -- exceeds the limit set by this function, older actions will be discarded.--- +-- -- If @maxUndoLevels@ is -1, no limit is set.--- +-- -- A new action is started whenever the function 'textBufferBeginUserAction' is called. In -- general, this happens whenever the user presses any key which modifies the buffer, but the undo -- manager will try to merge similar consecutive actions, such as multiple character insertions into -- one action. But, inserting a newline does start a new action.-sourceBufferSetMaxUndoLevels :: SourceBufferClass buffer => buffer - -> Int -- ^ @maxUndoLevels@ the desired maximum number of undo levels. +sourceBufferSetMaxUndoLevels :: SourceBufferClass buffer => buffer+ -> Int -- ^ @maxUndoLevels@ the desired maximum number of undo levels. -> IO () sourceBufferSetMaxUndoLevels sb newVal = {#call unsafe source_buffer_set_max_undo_levels#} (toSourceBuffer sb) (fromIntegral newVal)- + -- | Determines the number of undo levels the buffer will track for buffer edits.-sourceBufferGetMaxUndoLevels :: SourceBufferClass buffer => buffer +sourceBufferGetMaxUndoLevels :: SourceBufferClass buffer => buffer -> IO Int -- ^ returns the maximum number of possible undo levels or -1 if no limit is set. sourceBufferGetMaxUndoLevels sb = liftM fromIntegral $ {#call unsafe source_buffer_get_max_undo_levels#} (toSourceBuffer sb) -- | Determines whether a source buffer can undo the last action.-sourceBufferGetCanUndo :: SourceBufferClass buffer => buffer - -> IO Bool -- ^ returns 'True' if it's possible to undo the last action. +sourceBufferGetCanUndo :: SourceBufferClass buffer => buffer+ -> IO Bool -- ^ returns 'True' if it's possible to undo the last action. sourceBufferGetCanUndo sb = liftM toBool $ {#call unsafe source_buffer_can_undo#} (toSourceBuffer sb)- + -- | Determines whether a source buffer can redo the last action (i.e. if the last operation was an -- undo).-sourceBufferGetCanRedo :: SourceBufferClass buffer => buffer - -> IO Bool -- ^ returns 'True' if a redo is possible. +sourceBufferGetCanRedo :: SourceBufferClass buffer => buffer+ -> IO Bool -- ^ returns 'True' if a redo is possible. sourceBufferGetCanRedo sb = liftM toBool $ {#call unsafe source_buffer_can_redo#} (toSourceBuffer sb) -- | Undoes the last user action which modified the buffer. Use 'sourceBufferCanUndo' to check -- whether a call to this function will have any effect.--- +-- -- Actions are defined as groups of operations between a call to 'textBufferBeginUserAction' -- and 'textBufferEndUserAction' on the -- same line. sourceBufferUndo :: SourceBufferClass buffer => buffer -> IO () sourceBufferUndo sb = {#call source_buffer_undo#} (toSourceBuffer sb)- + -- | Redoes the last undo operation. Use 'sourceBufferCanRedo' to check whether a call to this -- function will have any effect. sourceBufferRedo :: SourceBufferClass buffer => buffer -> IO ()@@ -245,13 +246,13 @@ -- | Marks the beginning of a not undoable action on the buffer, disabling the undo manager. Typically -- you would call this function before initially setting the contents of the buffer (e.g. when loading -- a file in a text editor).--- +-- -- You may nest 'sourceBufferBeginNotUndoableAction' / -- 'sourceBufferEndNotUndoableAction' blocks. sourceBufferBeginNotUndoableAction :: SourceBufferClass buffer => buffer -> IO () sourceBufferBeginNotUndoableAction sb = {#call source_buffer_begin_not_undoable_action#} (toSourceBuffer sb)- + -- | Marks the end of a not undoable action on the buffer. When the last not undoable block is closed -- through the call to this function, the list of undo actions is cleared and the undo manager is -- re-enabled.@@ -282,26 +283,26 @@ -- passed name is @Nothing@. Also, the buffer owns the markers so you -- shouldn't unreference it. -sourceBufferCreateSourceMark :: SourceBufferClass buffer => buffer -- the buffer- -> Maybe String -- the name of the mark- -> String -- the category of the mark+sourceBufferCreateSourceMark :: (SourceBufferClass buffer, GlibString string) => buffer -- the buffer+ -> Maybe string -- the name of the mark+ -> string -- the category of the mark -> TextIter -> IO SourceMark sourceBufferCreateSourceMark sb name category iter = makeNewGObject mkSourceMark $- maybeWith withCString name $ \strPtr1 ->- withCString category $ \strPtr2 ->+ maybeWith withUTFString name $ \strPtr1 ->+ withUTFString category $ \strPtr2 -> {#call source_buffer_create_source_mark#} (toSourceBuffer sb) strPtr1 strPtr2 iter -- | Returns the list of marks of the given category at line. If category is empty, all marks at line are -- returned.-sourceBufferGetSourceMarksAtLine :: SourceBufferClass buffer => buffer -- ^ @buffer@ a 'SourceBuffer'. - -> Int -- ^ @line@ a line number. - -> String -- ^ @category@ category to search for or empty +sourceBufferGetSourceMarksAtLine :: (SourceBufferClass buffer, GlibString string) => buffer -- ^ @buffer@ a 'SourceBuffer'.+ -> Int -- ^ @line@ a line number.+ -> string -- ^ @category@ category to search for or empty -> IO [SourceMark]-sourceBufferGetSourceMarksAtLine buffer line category = - withCString category $ \categoryPtr ->+sourceBufferGetSourceMarksAtLine buffer line category =+ withUTFString category $ \categoryPtr -> {#call gtk_source_buffer_get_source_marks_at_line #}- (toSourceBuffer buffer) + (toSourceBuffer buffer) (fromIntegral line) categoryPtr >>= readGSList@@ -309,12 +310,12 @@ -- | Returns the list of marks of the given category at iter. If category is empty it returns all marks at -- iter.-sourceBufferGetSourceMarksAtIter :: SourceBufferClass buffer => buffer -- ^ @buffer@ a 'SourceBuffer'. - -> TextIter -- ^ @iter@ an iterator. - -> String -- ^ @category@ category to search for or empty+sourceBufferGetSourceMarksAtIter :: (SourceBufferClass buffer, GlibString string) => buffer -- ^ @buffer@ a 'SourceBuffer'.+ -> TextIter -- ^ @iter@ an iterator.+ -> string -- ^ @category@ category to search for or empty -> IO [SourceMark] sourceBufferGetSourceMarksAtIter buffer iter category =- withCString category $ \categoryPtr ->+ withUTFString category $ \categoryPtr -> {#call gtk_source_buffer_get_source_marks_at_iter #} (toSourceBuffer buffer) iter@@ -324,13 +325,13 @@ -- | Remove all marks of category between start and end from the buffer. If category is empty, all marks -- in the range will be removed.-sourceBufferRemoveSourceMarks :: SourceBufferClass buffer => buffer -- ^ @buffer@ a 'SourceBuffer'. - -> TextIter -- ^ @start@ a 'TextIter' - -> TextIter -- ^ @end@ a 'TextIter' - -> String -- ^ @category@ category to search for or empty+sourceBufferRemoveSourceMarks :: (SourceBufferClass buffer, GlibString string) => buffer -- ^ @buffer@ a 'SourceBuffer'.+ -> TextIter -- ^ @start@ a 'TextIter'+ -> TextIter -- ^ @end@ a 'TextIter'+ -> string -- ^ @category@ category to search for or empty -> IO () sourceBufferRemoveSourceMarks buffer start end category =- withCString category $ \categoryPtr ->+ withUTFString category $ \categoryPtr -> {#call gtk_source_buffer_remove_source_marks #} (toSourceBuffer buffer) start@@ -339,13 +340,13 @@ -- | Moves iter to the position of the next 'SourceMark' of the given category. Returns 'True' if iter was -- moved. If category is empty, the next source mark can be of any category.-sourceBufferForwardIterToSourceMark :: SourceBufferClass buffer => buffer -- ^ @buffer@ a 'SourceBuffer'. - -> TextIter -- ^ @iter@ an iterator. - -> String -- ^ @category@ category to search for or emtpy- -> IO Bool -- ^ returns whether iter moved. +sourceBufferForwardIterToSourceMark :: (SourceBufferClass buffer, GlibString string) => buffer -- ^ @buffer@ a 'SourceBuffer'.+ -> TextIter -- ^ @iter@ an iterator.+ -> string -- ^ @category@ category to search for or emtpy+ -> IO Bool -- ^ returns whether iter moved. sourceBufferForwardIterToSourceMark buffer iter category = liftM toBool $- withCString category $ \categoryPtr ->+ withUTFString category $ \categoryPtr -> {#call gtk_source_buffer_forward_iter_to_source_mark #} (toSourceBuffer buffer) iter@@ -353,68 +354,68 @@ -- | Moves iter to the position of the previous 'SourceMark' of the given category. Returns 'True' if iter -- was moved. If category is empty, the previous source mark can be of any category.-sourceBufferBackwardIterToSourceMark :: SourceBufferClass buffer => buffer -- ^ @buffer@ a 'SourceBuffer'. - -> TextIter -- ^ @iter@ an iterator. - -> String -- ^ @category@ category to search for or emtpy- -> IO Bool -- ^ returns whether iter moved. +sourceBufferBackwardIterToSourceMark :: (SourceBufferClass buffer, GlibString string) => buffer -- ^ @buffer@ a 'SourceBuffer'.+ -> TextIter -- ^ @iter@ an iterator.+ -> string -- ^ @category@ category to search for or emtpy+ -> IO Bool -- ^ returns whether iter moved. sourceBufferBackwardIterToSourceMark buffer iter category = liftM toBool $- withCString category $ \categoryPtr ->+ withUTFString category $ \categoryPtr -> {#call gtk_source_buffer_backward_iter_to_source_mark #} (toSourceBuffer buffer) iter categoryPtr -- | Forces buffer to analyze and highlight the given area synchronously.--- +-- -- Note--- +-- -- This is a potentially slow operation and should be used only when you need to make sure that some -- text not currently visible is highlighted, for instance before printing.-sourceBufferEnsureHighlight :: SourceBufferClass buffer => buffer - -> TextIter -- ^ @start@ start of the area to highlight. - -> TextIter -- ^ @end@ end of the area to highlight. +sourceBufferEnsureHighlight :: SourceBufferClass buffer => buffer+ -> TextIter -- ^ @start@ start of the area to highlight.+ -> TextIter -- ^ @end@ end of the area to highlight. -> IO () sourceBufferEnsureHighlight sb start end = {#call source_buffer_ensure_highlight#} (toSourceBuffer sb) start end -- | Whether Redo operation is possible.--- +-- -- Default value: 'False'--- +-- sourceBufferCanRedo :: SourceBufferClass buffer => ReadAttr buffer Bool sourceBufferCanRedo = readAttrFromBoolProperty "can-redo" -- | Whether Undo operation is possible.--- +-- -- Default value: 'False' sourceBufferCanUndo :: SourceBufferClass buffer => ReadAttr buffer Bool sourceBufferCanUndo = readAttrFromBoolProperty "can-undo" -- | Whether to highlight matching brackets in the buffer.--- +-- -- Default value: 'True' -- sourceBufferHighlightMatchingBrackets :: SourceBufferClass buffer => Attr buffer Bool sourceBufferHighlightMatchingBrackets = newAttrFromBoolProperty "highlight-matching-brackets" -- | Whether to highlight syntax in the buffer.--- +-- -- Default value: 'True' -- sourceBufferHighlightSyntax :: SourceBufferClass buffer => Attr buffer Bool sourceBufferHighlightSyntax = newAttrFromBoolProperty "highlight-matching-brackets" -- | Language object to get highlighting patterns from.--- +-- sourceBufferLanguage :: SourceBufferClass buffer => Attr buffer (Maybe SourceLanguage) sourceBufferLanguage = newAttrFromMaybeObjectProperty "language" gTypeSourceLanguage -- | Number of undo levels for the buffer. -1 means no limit. This property will only affect the default -- undo manager.--- +-- -- Allowed values: >= GMaxulong--- +-- -- Default value: 1000 -- sourceBufferMaxUndoLevels :: SourceBufferClass buffer => Attr buffer Int@@ -422,7 +423,7 @@ -- | Style scheme. It contains styles for syntax highlighting, optionally foreground, background, cursor -- color, current line color, and matching brackets style.--- +-- sourceBufferSourceStyleScheme :: SourceBufferClass buffer => Attr buffer (Maybe SourceStyleScheme) sourceBufferSourceStyleScheme = newAttrFromMaybeObjectProperty "style-scheme" gTypeSourceStyleScheme @@ -450,4 +451,4 @@ -- buffer. -- sourceBufferSourceMarkUpdated :: SourceBufferClass buffer => Signal buffer (TextMark -> IO ())-sourceBufferSourceMarkUpdated = Signal $ connect_OBJECT__NONE "source-mark-updated" +sourceBufferSourceMarkUpdated = Signal $ connect_OBJECT__NONE "source-mark-updated"
Graphics/UI/Gtk/SourceView/SourceCompletionItem.chs view
@@ -58,86 +58,89 @@ -- | Create a new 'SourceCompletionItem' with label label, icon icon and extra information info. Both -- icon and info can be 'Nothing' in which case there will be no icon shown and no extra information -- available.-sourceCompletionItemNew :: String -- ^ @label@ The item label - -> String -- ^ @text@ The item text +sourceCompletionItemNew :: GlibString string+ => string -- ^ @label@ The item label+ -> string -- ^ @text@ The item text -> Maybe Pixbuf -- ^ @icon@ The item icon or 'Nothing'- -> String -- ^ @info@ The item extra information + -> string -- ^ @info@ The item extra information -> IO SourceCompletionItem sourceCompletionItemNew label text icon info = wrapNewGObject mkSourceCompletionItem $- withUTFString label $ \ labelPtr -> - withUTFString text $ \ textPtr -> - withUTFString info $ \ infoPtr -> + withUTFString label $ \ labelPtr ->+ withUTFString text $ \ textPtr ->+ withUTFString info $ \ infoPtr -> {#call gtk_source_completion_item_new #} labelPtr textPtr (fromMaybe (Pixbuf nullForeignPtr) icon) infoPtr- - ++ -- | Create a new 'SourceCompletionItem' with markup label markup, icon icon and extra information -- info. Both icon and info can be 'Nothing' in which case there will be no icon shown and no extra -- information available.-sourceCompletionItemNewWithMarkup :: String- -> String+sourceCompletionItemNewWithMarkup :: GlibString string+ => string+ -> string -> Maybe Pixbuf- -> String+ -> string -> IO SourceCompletionItem-sourceCompletionItemNewWithMarkup markup text icon info = - wrapNewGObject mkSourceCompletionItem $ - withUTFString markup $ \ markupPtr -> - withUTFString text $ \ textPtr -> - withUTFString info $ \ infoPtr -> +sourceCompletionItemNewWithMarkup markup text icon info =+ wrapNewGObject mkSourceCompletionItem $+ withUTFString markup $ \ markupPtr ->+ withUTFString text $ \ textPtr ->+ withUTFString info $ \ infoPtr -> {#call gtk_source_completion_item_new_with_markup #} markupPtr textPtr (fromMaybe (Pixbuf nullForeignPtr) icon) infoPtr- + -- | Creates a new 'SourceCompletionItem' from a stock item. If label is 'Nothing', the stock label will be -- used.-sourceCompletionItemNewFromStock :: Maybe String -- ^ @label@ The item label or 'Nothing'- -> String -- ^ @text@ The item text - -> String -- ^ @stock@ The stock icon - -> String -- ^ @info@ The item extra information +sourceCompletionItemNewFromStock :: GlibString string+ => Maybe string -- ^ @label@ The item label or 'Nothing'+ -> string -- ^ @text@ The item text+ -> string -- ^ @stock@ The stock icon+ -> string -- ^ @info@ The item extra information -> IO SourceCompletionItem sourceCompletionItemNewFromStock label text stock info = wrapNewGObject mkSourceCompletionItem $- maybeWith withUTFString label $ \ labelPtr -> - withUTFString text $ \ textPtr -> - withUTFString stock $ \ stockPtr -> - withUTFString info $ \ infoPtr -> + maybeWith withUTFString label $ \ labelPtr ->+ withUTFString text $ \ textPtr ->+ withUTFString stock $ \ stockPtr ->+ withUTFString info $ \ infoPtr -> {#call gtk_source_completion_item_new_from_stock #} labelPtr textPtr stockPtr infoPtr- + -- | Icon to be shown for this proposal. sourceCompletionItemIcon :: SourceCompletionItemClass item => Attr item Pixbuf sourceCompletionItemIcon = newAttrFromObjectProperty "icon" {# call pure unsafe gdk_pixbuf_get_type #} -- | Optional extra information to be shown for this proposal.--- +-- -- Default value: \"\"-sourceCompletionItemInfo :: SourceCompletionItemClass item => Attr item String+sourceCompletionItemInfo :: (SourceCompletionItemClass item, GlibString string) => Attr item string sourceCompletionItemInfo = newAttrFromStringProperty "info" -- | Optional extra labelrmation to be shown for this proposal.--- +-- -- Default value: \"\"-sourceCompletionItemLabel :: SourceCompletionItemClass item => Attr item String+sourceCompletionItemLabel :: (SourceCompletionItemClass item, GlibString string) => Attr item string sourceCompletionItemLabel = newAttrFromStringProperty "label" -- | Optional extra markuprmation to be shown for this proposal.--- +-- -- Default value: \"\"-sourceCompletionItemMarkup :: SourceCompletionItemClass item => Attr item String+sourceCompletionItemMarkup :: (SourceCompletionItemClass item, GlibString string) => Attr item string sourceCompletionItemMarkup = newAttrFromStringProperty "markup" -- | Optional extra textrmation to be shown for this proposal.--- +-- -- Default value: \"\"-sourceCompletionItemText :: SourceCompletionItemClass item => Attr item String+sourceCompletionItemText :: (SourceCompletionItemClass item, GlibString string) => Attr item string sourceCompletionItemText = newAttrFromStringProperty "text"
Graphics/UI/Gtk/SourceView/SourceCompletionProposal.chs view
@@ -62,8 +62,8 @@ -- | Gets the label of proposal. The label is shown in the list of proposals as plain text. If you need -- any markup (such as bold or italic text), you have to implement -- 'sourceCompletionProposalGetMarkup'.-sourceCompletionProposalGetLabel :: SourceCompletionProposalClass scp => scp- -> IO String -- ^ returns A new string containing the label of proposal. +sourceCompletionProposalGetLabel :: (SourceCompletionProposalClass scp, GlibString string) => scp+ -> IO string -- ^ returns A new string containing the label of proposal. sourceCompletionProposalGetLabel scp = {#call gtk_source_completion_proposal_get_label #} (toSourceCompletionProposal scp)@@ -71,8 +71,8 @@ -- | Gets the label of proposal with markup. The label is shown in the list of proposals and may contain -- markup. This will be used instead of 'sourceCompletionProposalGetLabel' if implemented.-sourceCompletionProposalGetMarkup :: SourceCompletionProposalClass scp => scp- -> IO String -- ^ returns A new string containing the label of proposal with markup. +sourceCompletionProposalGetMarkup :: (SourceCompletionProposalClass scp, GlibString string) => scp+ -> IO string -- ^ returns A new string containing the label of proposal with markup. sourceCompletionProposalGetMarkup scp = {#call gtk_source_completion_proposal_get_markup #} (toSourceCompletionProposal scp)@@ -81,8 +81,8 @@ -- | Gets the text of proposal. The text that is inserted into the text buffer when the proposal is -- activated by the default activation. You are free to implement a custom activation handler in the -- provider and not implement this function.-sourceCompletionProposalGetText :: SourceCompletionProposalClass scp => scp- -> IO String -- ^ returns A new string containing the text of proposal. +sourceCompletionProposalGetText :: (SourceCompletionProposalClass scp, GlibString string) => scp+ -> IO string -- ^ returns A new string containing the text of proposal. sourceCompletionProposalGetText scp = {#call gtk_source_completion_proposal_get_text #} (toSourceCompletionProposal scp)@@ -90,7 +90,7 @@ -- | Gets the icon of proposal. sourceCompletionProposalGetIcon :: SourceCompletionProposalClass scp => scp- -> IO Pixbuf -- ^ returns The icon of proposal. + -> IO Pixbuf -- ^ returns The icon of proposal. sourceCompletionProposalGetIcon scp = wrapNewGObject mkPixbuf $ {#call gtk_source_completion_proposal_get_icon #}@@ -98,28 +98,28 @@ -- | Gets extra information associated to the proposal. This information will be used to present the user -- with extra, detailed information about the selected proposal.-sourceCompletionProposalGetInfo :: SourceCompletionProposalClass scp => scp- -> IO String -- ^ returns A new string containing extra information of proposal or empty if no extra information is associated to proposal.+sourceCompletionProposalGetInfo :: (SourceCompletionProposalClass scp, GlibString string) => scp+ -> IO string -- ^ returns A new string containing extra information of proposal or empty if no extra information is associated to proposal. sourceCompletionProposalGetInfo scp = {#call gtk_source_completion_proposal_get_info #} (toSourceCompletionProposal scp) >>= peekUTFString -- | Get the hash value of proposal. This is used to (together with 'sourceCompletionProposalEqual')--- to match proposals in the completion model. +-- to match proposals in the completion model. sourceCompletionProposalHash :: SourceCompletionProposalClass scp => scp- -> IO Int -- ^ returns The hash value of proposal + -> IO Int -- ^ returns The hash value of proposal sourceCompletionProposalHash scp = liftM fromIntegral $ {#call gtk_source_completion_proposal_hash #} (toSourceCompletionProposal scp) -- | Get whether two proposal objects are the same. This is used to (together with--- 'sourceCompletionProposalHash') to match proposals in the completion model. -sourceCompletionProposalEqual :: (SourceCompletionProposalClass scp1, SourceCompletionProposalClass scp2) +-- 'sourceCompletionProposalHash') to match proposals in the completion model.+sourceCompletionProposalEqual :: (SourceCompletionProposalClass scp1, SourceCompletionProposalClass scp2) => scp1 -> scp2- -> IO Bool -- ^ returns 'True' if proposal and object are the same proposal + -> IO Bool -- ^ returns 'True' if proposal and object are the same proposal sourceCompletionProposalEqual scp1 scp2 = liftM toBool $ {#call gtk_source_completion_proposal_equal #}
Graphics/UI/Gtk/SourceView/SourceCompletionProvider.chs view
@@ -27,7 +27,7 @@ -- * Description -- | You must implement this interface to provide proposals to 'SourceCompletion' --- * Types +-- * Types SourceCompletionProvider, SourceCompletionProviderClass, @@ -61,16 +61,16 @@ {# context lib="gtk" prefix="gtk" #} -- | Get the name of the provider. This should be a translatable name for display to the user. For--- example: _("Document word completion provider"). -sourceCompletionProviderGetName :: SourceCompletionProviderClass scp => scp - -> IO String -- ^ returns A new string containing the name of the provider. +-- example: _("Document word completion provider").+sourceCompletionProviderGetName :: (SourceCompletionProviderClass scp, GlibString string) => scp+ -> IO string -- ^ returns A new string containing the name of the provider. sourceCompletionProviderGetName scp = {#call gtk_source_completion_provider_get_name #} (toSourceCompletionProvider scp) >>= peekUTFString -- | Get the icon of the provider.-sourceCompletionProviderGetIcon :: SourceCompletionProviderClass scp => scp +sourceCompletionProviderGetIcon :: SourceCompletionProviderClass scp => scp -> IO (Maybe Pixbuf) sourceCompletionProviderGetIcon scp = maybeNull (wrapNewGObject mkPixbuf) $@@ -79,8 +79,8 @@ -- | Get the delay in milliseconds before starting interactive completion for this provider. A value of -- -1 indicates to use the default value as set by 'autoCompleteDelay'.-sourceCompletionProviderGetInteractiveDelay :: SourceCompletionProviderClass scp => scp - -> IO Int -- ^ returns the interactive delay in milliseconds. +sourceCompletionProviderGetInteractiveDelay :: SourceCompletionProviderClass scp => scp+ -> IO Int -- ^ returns the interactive delay in milliseconds. sourceCompletionProviderGetInteractiveDelay scp = liftM fromIntegral $ {#call gtk_source_completion_provider_get_interactive_delay #}@@ -88,13 +88,13 @@ -- | Get the provider priority. The priority determines the order in which proposals appear in the -- completion popup. Higher priorities are sorted before lower priorities. The default priority is 0.-sourceCompletionProviderGetPriority :: SourceCompletionProviderClass scp => scp - -> IO Int -- ^ returns the provider priority. +sourceCompletionProviderGetPriority :: SourceCompletionProviderClass scp => scp+ -> IO Int -- ^ returns the provider priority. sourceCompletionProviderGetPriority scp = liftM fromIntegral $ {#call gtk_source_completion_provider_get_priority #} (toSourceCompletionProvider scp)- + -- | Get a customized info widget to show extra information of a proposal. This allows for customized -- widgets on a proposal basis, although in general providers will have the same custom widget for all -- their proposals and proposal can be ignored. The implementation of this function is optional. If@@ -102,8 +102,8 @@ -- implemented, the default 'sourceCompletionProposalGetInfo' will be used to display extra -- information about a 'SourceCompletionProposal'. sourceCompletionProviderGetInfoWidget :: SourceCompletionProviderClass scp => scp- -> SourceCompletionProposal -- ^ @proposal@ The currently selected 'SourceCompletionProposal' - -> IO Widget -- ^ returns a custom 'Widget' to show extra information about proposal. + -> SourceCompletionProposal -- ^ @proposal@ The currently selected 'SourceCompletionProposal'+ -> IO Widget -- ^ returns a custom 'Widget' to show extra information about proposal. sourceCompletionProviderGetInfoWidget scp proposal = makeNewObject mkWidget $ {#call gtk_source_completion_provider_get_info_widget #}@@ -132,7 +132,7 @@ context proposal iter- if success + if success then return (Just iter) else return Nothing
Graphics/UI/Gtk/SourceView/SourceIter.chs view
@@ -61,16 +61,16 @@ -- match and @matchEnd@ to the first character after the match. The search will not continue past -- limit. Note that a search is a linear or O(n) operation, so you may wish to use limit to avoid -- locking up your UI on large buffers.--- +-- -- If the 'SourceSearchVisibleOnly' flag is present, the match may have invisible text -- interspersed in str. i.e. str will be a possibly-noncontiguous subsequence of the matched -- range. similarly, if you specify 'SourceSearchTextOnly', the match may have pixbufs or child -- widgets mixed inside the matched range. If these flags are not given, the match must be exact; the -- special 0xFFFC character in str will match embedded pixbufs or child widgets. If you specify the -- 'SourceSearchCaseInsensitive' flag, the text will be matched regardless of what case it is in.--- +-- -- Same as 'textIterForwardSearch', but supports case insensitive searching.-sourceIterForwardSearch :: TextIter -> String -> [SourceSearchFlags] -> +sourceIterForwardSearch :: GlibString string => TextIter -> string -> [SourceSearchFlags] -> Maybe TextIter -> IO (Maybe (TextIter, TextIter)) sourceIterForwardSearch ti str flags limit = do start <- makeEmptyTextIter@@ -84,7 +84,7 @@ -- | same as 'textIterForwardSearch' but allows -- case insensitive search and possibly in the future regular expressions. ---sourceIterBackwardSearch :: TextIter -> String -> [SourceSearchFlags] -> +sourceIterBackwardSearch :: GlibString string => TextIter -> string -> [SourceSearchFlags] -> Maybe TextIter -> IO (Maybe (TextIter, TextIter)) sourceIterBackwardSearch ti str flags limit = do start <- makeEmptyTextIter
Graphics/UI/Gtk/SourceView/SourceLanguage.chs view
@@ -71,38 +71,38 @@ -- | Returns the ID of the language. The ID is not locale-dependent. ---sourceLanguageGetId :: SourceLanguageClass sl => sl- -> IO String -- ^ returns the ID of language. The returned string is owned by language and should not be freed or modified.+sourceLanguageGetId :: (SourceLanguageClass sl, GlibString string) => sl+ -> IO string -- ^ returns the ID of language. The returned string is owned by language and should not be freed or modified. sourceLanguageGetId sl = {#call unsafe source_language_get_id#} (toSourceLanguage sl) >>= peekUTFString -- | Returns the localized name of the language. ---sourceLanguageGetName :: SourceLanguageClass sl => sl - -> IO String -- ^ returns the name of language. The returned string is owned by language and should not be freed or modified.+sourceLanguageGetName :: (SourceLanguageClass sl, GlibString string) => sl+ -> IO string -- ^ returns the name of language. The returned string is owned by language and should not be freed or modified. sourceLanguageGetName sl = {#call unsafe source_language_get_name#} (toSourceLanguage sl) >>= peekUTFString -- | Returns the localized section of the language. Each language belong to a section (ex. HTML belogs to -- the Markup section). ---sourceLanguageGetSection :: SourceLanguageClass sl => sl - -> IO String -- ^ returns the section of language. The returned string is owned by language and should not be freed or modified.+sourceLanguageGetSection :: (SourceLanguageClass sl, GlibString string) => sl+ -> IO string -- ^ returns the section of language. The returned string is owned by language and should not be freed or modified. sourceLanguageGetSection sl = {#call unsafe source_language_get_section#} (toSourceLanguage sl) >>= peekUTFString -- | Returns whether the language should be hidden from the user. ---sourceLanguageGetHidden :: SourceLanguageClass sl => sl - -> IO Bool -- ^ returns 'True' if the language should be hidden, 'False' otherwise. +sourceLanguageGetHidden :: SourceLanguageClass sl => sl+ -> IO Bool -- ^ returns 'True' if the language should be hidden, 'False' otherwise. sourceLanguageGetHidden sl = liftM toBool $ {#call unsafe source_language_get_hidden#} (toSourceLanguage sl) -- | ---sourceLanguageGetMetadata :: SourceLanguageClass sl => sl - -> String -- ^ @name@ metadata property name.- -> IO String -- ^ returns value of property name stored in the metadata of language or empty if language doesn't contain that metadata+sourceLanguageGetMetadata :: (SourceLanguageClass sl, GlibString string) => sl+ -> string -- ^ @name@ metadata property name.+ -> IO string -- ^ returns value of property name stored in the metadata of language or empty if language doesn't contain that metadata sourceLanguageGetMetadata sl name = do withUTFString name ({#call unsafe source_language_get_metadata#} (toSourceLanguage sl)) >>= peekUTFString @@ -110,8 +110,8 @@ -- 'sourceLanguageGetMetadata ' to retrieve the "mimetypes" metadata property and split it into -- an array. ---sourceLanguageGetMimeTypes :: SourceLanguageClass sl => sl - -> IO [String] -- ^ returns an array containing the mime types or empty if no mime types are found. The +sourceLanguageGetMimeTypes :: (SourceLanguageClass sl, GlibString string) => sl+ -> IO [string] -- ^ returns an array containing the mime types or empty if no mime types are found. The sourceLanguageGetMimeTypes sl = do mimeTypesArray <- {#call unsafe source_language_get_mime_types#} (toSourceLanguage sl) mimeTypes <- liftM (fromMaybe []) $ maybePeek peekUTFStringArray0 mimeTypesArray@@ -122,8 +122,8 @@ -- 'sourceLanguageGetMetadata' to retrieve the "globs" metadata property and split it into an -- array. ---sourceLanguageGetGlobs :: SourceLanguageClass sl => sl - -> IO [String] -- ^ returns an array containing the globs or empty if no globs are found. +sourceLanguageGetGlobs :: (SourceLanguageClass sl, GlibString string) => sl+ -> IO [string] -- ^ returns an array containing the globs or empty if no globs are found. sourceLanguageGetGlobs sl = do globsArray <- {#call unsafe source_language_get_globs#} (toSourceLanguage sl) globs <- liftM (fromMaybe []) $ maybePeek peekUTFStringArray0 globsArray@@ -131,9 +131,9 @@ return globs -- | Returns the name of the style with ID @styleId@ defined by this language.-sourceLanguageGetStyleName :: SourceLanguageClass sl => sl - -> String -- ^ @styleId@ a style ID- -> IO String -- ^ returns the name of the style with ID @styleId@ defined by this language or empty if the style has no name or there is no style with ID @styleId@ defined by this language. The returned string is owned by the language and must not be modified.+sourceLanguageGetStyleName :: (SourceLanguageClass sl, GlibString string) => sl+ -> string -- ^ @styleId@ a style ID+ -> IO string -- ^ returns the name of the style with ID @styleId@ defined by this language or empty if the style has no name or there is no style with ID @styleId@ defined by this language. The returned string is owned by the language and must not be modified. sourceLanguageGetStyleName sl styleId = withUTFString styleId $ \styleIdPtr -> {#call gtk_source_language_get_style_name#}@@ -142,8 +142,8 @@ >>= peekUTFString -- | Returns the ids of the styles defined by this language.-sourceLanguageGetStyleIds :: SourceLanguageClass sl => sl - -> IO [String] -- ^ returns an array containing ids of the styles defined by this language or empty if no style is defined. +sourceLanguageGetStyleIds :: (SourceLanguageClass sl, GlibString string) => sl+ -> IO [string] -- ^ returns an array containing ids of the styles defined by this language or empty if no style is defined. sourceLanguageGetStyleIds sl = do globsArray <- {#call gtk_source_language_get_style_ids#} (toSourceLanguage sl) globs <- liftM (fromMaybe []) $ maybePeek peekUTFStringArray0 globsArray@@ -151,29 +151,29 @@ return globs -- | Whether the language should be hidden from the user.--- +-- -- Default value: 'False' -- sourceLanguageHidden :: SourceLanguageClass sl => ReadAttr sl Bool sourceLanguageHidden = readAttrFromBoolProperty "hidden" -- | Language id.--- +-- -- Default value: \"\" ---sourceLanguageId :: SourceLanguageClass sl => ReadAttr sl String+sourceLanguageId :: (SourceLanguageClass sl, GlibString string) => ReadAttr sl string sourceLanguageId = readAttrFromStringProperty "id" -- | Language name.--- +-- -- Default value: \"\" ---sourceLanguageName :: SourceLanguageClass sl => ReadAttr sl String+sourceLanguageName :: (SourceLanguageClass sl, GlibString string) => ReadAttr sl string sourceLanguageName = readAttrFromStringProperty "name" -- | Language section.--- +-- -- Default value: \"\" ---sourceLanguageSection :: SourceLanguageClass sl => ReadAttr sl String+sourceLanguageSection :: (SourceLanguageClass sl, GlibString string) => ReadAttr sl string sourceLanguageSection = readAttrFromStringProperty "section"
Graphics/UI/Gtk/SourceView/SourceLanguageManager.chs view
@@ -80,37 +80,37 @@ -- | Sets the list of directories where the lm looks for language files. If dirs is 'Nothing', the search path -- is reset to default.--- +-- -- Note--- +-- -- At the moment this function can be called only before the language files are loaded for the first -- time. In practice to set a custom search path for a 'SourceLanguageManager', you have to call this -- function right after creating it. ---sourceLanguageManagerSetSearchPath :: SourceLanguageManagerClass slm => slm -> Maybe [String] -> IO ()+sourceLanguageManagerSetSearchPath :: (SourceLanguageManagerClass slm, GlibFilePath fp) => slm -> Maybe [fp] -> IO () sourceLanguageManagerSetSearchPath slm dirs =- maybeWith withUTFStringArray0 dirs $ \dirsPtr -> do+ maybeWith withUTFFilePathArray0 dirs $ \dirsPtr -> do {#call unsafe source_language_manager_set_search_path#} (toSourceLanguageManager slm) dirsPtr -- | Gets the list directories where lm looks for language files. ---sourceLanguageManagerGetSearchPath :: SourceLanguageManagerClass slm => slm -> IO [String]+sourceLanguageManagerGetSearchPath :: (SourceLanguageManagerClass slm, GlibFilePath fp) => slm -> IO [fp] sourceLanguageManagerGetSearchPath slm = do dirsPtr <- {#call unsafe source_language_manager_get_search_path#} (toSourceLanguageManager slm)- liftM (fromMaybe []) $ maybePeek peekUTFStringArray0 dirsPtr+ liftM (fromMaybe []) $ maybePeek peekUTFFilePathArray0 dirsPtr -- | Returns the ids of the available languages. ---sourceLanguageManagerGetLanguageIds :: SourceLanguageManagerClass slm => slm -> IO [String]+sourceLanguageManagerGetLanguageIds :: (SourceLanguageManagerClass slm, GlibString string) => slm -> IO [string] sourceLanguageManagerGetLanguageIds slm = do idsPtr <- {#call unsafe source_language_manager_get_language_ids#} (toSourceLanguageManager slm) liftM (fromMaybe []) $ maybePeek peekUTFStringArray0 idsPtr -- | Gets the 'SourceLanguage' identified by the given id in the language manager. ---sourceLanguageManagerGetLanguage :: SourceLanguageManagerClass slm => slm - -> String -- ^ @id@ a language id.- -> IO (Maybe SourceLanguage) -- ^ returns a 'SourceLanguage', or 'Nothing' if there is no language identified by the given id. +sourceLanguageManagerGetLanguage :: (SourceLanguageManagerClass slm, GlibString string) => slm+ -> string -- ^ @id@ a language id.+ -> IO (Maybe SourceLanguage) -- ^ returns a 'SourceLanguage', or 'Nothing' if there is no language identified by the given id. sourceLanguageManagerGetLanguage slm id = do slPtr <- liftM castPtr $ withUTFString id ({#call unsafe source_language_manager_get_language#} (toSourceLanguageManager slm))@@ -121,12 +121,12 @@ -- | Picks a 'SourceLanguage' for given file name and content type, according to the information in lang -- files. Either filename or @contentType@ may be 'Nothing'. ---sourceLanguageManagerGuessLanguage :: SourceLanguageManagerClass slm => slm - -> Maybe String -- ^ @filename@ a filename in Glib filename encoding, or 'Nothing'.- -> Maybe String -- ^ @contentType@ a content type (as in GIO API), or 'Nothing'.- -> IO (Maybe SourceLanguage) -- ^ returns a 'SourceLanguage', or 'Nothing' if there is no suitable language for given filename and/or @contentType@. +sourceLanguageManagerGuessLanguage :: (SourceLanguageManagerClass slm, GlibFilePath fp, GlibString string) => slm+ -> Maybe fp -- ^ @filename@ a filename in Glib filename encoding, or 'Nothing'.+ -> Maybe string -- ^ @contentType@ a content type (as in GIO API), or 'Nothing'.+ -> IO (Maybe SourceLanguage) -- ^ returns a 'SourceLanguage', or 'Nothing' if there is no suitable language for given filename and/or @contentType@. sourceLanguageManagerGuessLanguage slm filename contentType =- maybeWith withUTFString filename $ \cFilename ->+ maybeWith withUTFFilePath filename $ \cFilename -> maybeWith withUTFString contentType $ \cContentType -> do slPtr <- liftM castPtr $ {#call unsafe source_language_manager_guess_language#} (toSourceLanguageManager slm) cFilename cContentType@@ -136,14 +136,14 @@ -- | List of the ids of the available languages. ---sourceLanguageManagerLanguageIds :: SourceLanguageManagerClass slm => ReadAttr slm [String]+sourceLanguageManagerLanguageIds :: (SourceLanguageManagerClass slm, GlibString string) => ReadAttr slm [string] sourceLanguageManagerLanguageIds = readAttrFromBoxedOpaqueProperty (liftM (fromMaybe []) . maybePeek peekUTFStringArray0 . castPtr) "language-ids" {#call pure g_strv_get_type#} -- | List of directories where the language specification files (.lang) are located. ---sourceLanguageManagerSearchPath :: SourceLanguageManagerClass slm => ReadWriteAttr slm [String] (Maybe [String])+sourceLanguageManagerSearchPath :: (SourceLanguageManagerClass slm, GlibString string) => ReadWriteAttr slm [string] (Maybe [string]) sourceLanguageManagerSearchPath = newAttr (objectGetPropertyBoxedOpaque (peekUTFStringArray0 . castPtr) gtype "search-path") (objectSetPropertyBoxedOpaque (\dirs f -> maybeWith withUTFStringArray0 dirs (f . castPtr)) gtype "search-path")
Graphics/UI/Gtk/SourceView/SourceMark.chs view
@@ -29,7 +29,7 @@ -- * Description -- | A 'SourceMark' marks a position in the text where you want to display additional info. It is based -- on 'TextMark' and thus is still valid after the text has changed though its position may change.--- +-- -- 'SourceMarks' are organised in categories which you have to set when you create the mark. Each -- category can have a pixbuf and a priority associated using @gtkSourceViewSetMarkCategoryPixbuf@ -- and @gtkSourceViewSetMarkCategoryPriority@. The pixbuf will be displayed in the margin at the@@ -70,10 +70,11 @@ -- is anonymous; otherwise, the mark can be retrieved by name using -- 'textBufferGetMark'. Normally marks are created using the utility function -- 'sourceBufferCreateMark'.-sourceMarkNew :: Maybe String -- ^ @name@ Name of the 'SourceMark', can be 'Nothing' when not using a name- -> String -- ^ @category@ is used to classify marks according to common characteristics (e.g. all the marks representing a bookmark could +sourceMarkNew :: GlibString string+ => Maybe string -- ^ @name@ Name of the 'SourceMark', can be 'Nothing' when not using a name+ -> string -- ^ @category@ is used to classify marks according to common characteristics (e.g. all the marks representing a bookmark could -> IO SourceMark-sourceMarkNew name category = +sourceMarkNew name category = wrapNewGObject mkSourceMark $ maybeWith withUTFString name $ \namePtr -> withUTFString category $ \categoryPtr ->@@ -82,9 +83,9 @@ categoryPtr -- | Returns the mark category--- -sourceMarkGetCategory :: SourceMarkClass mark => mark- -> IO String -- ^ returns the category of the 'SourceMark' +--+sourceMarkGetCategory :: (SourceMarkClass mark, GlibString string) => mark+ -> IO string -- ^ returns the category of the 'SourceMark' sourceMarkGetCategory mark = do strPtr <- {#call unsafe source_mark_get_category#} (toSourceMark mark) markType <- peekUTFString strPtr@@ -93,25 +94,25 @@ -- | Returns the next 'SourceMark' in the buffer or 'Nothing' if the mark was not added to a buffer. If there -- is no next mark, 'Nothing' will be returned.--- +-- -- If category is 'Nothing', looks for marks of any category--- -sourceMarkNext :: SourceMarkClass mark => mark - -> Maybe String -- ^ @category@ a string specifying the mark category or 'Nothing' - -> IO (Maybe SourceMark) -- ^ returns the next 'SourceMark' or 'Nothing' -sourceMarkNext mark category = +--+sourceMarkNext :: (SourceMarkClass mark, GlibString string) => mark+ -> Maybe string -- ^ @category@ a string specifying the mark category or 'Nothing'+ -> IO (Maybe SourceMark) -- ^ returns the next 'SourceMark' or 'Nothing'+sourceMarkNext mark category = maybeNull (makeNewGObject mkSourceMark) $ maybeWith withUTFString category $ {#call unsafe source_mark_next#} (toSourceMark mark) -- | Returns the previous 'SourceMark' in the buffer or 'Nothing' if the mark was not added to a buffer. If -- there is no previous mark, 'Nothing' is returned.--- +-- -- If category is 'Nothing', looks for marks of any category--- -sourceMarkPrev :: SourceMarkClass mark => mark - -> Maybe String -- ^ @category@ a string specifying the mark category or 'Nothing' - -> IO (Maybe SourceMark) -- ^ returns the previous 'SourceMark' or 'Nothing' -sourceMarkPrev mark category = +--+sourceMarkPrev :: (SourceMarkClass mark, GlibString string) => mark+ -> Maybe string -- ^ @category@ a string specifying the mark category or 'Nothing'+ -> IO (Maybe SourceMark) -- ^ returns the previous 'SourceMark' or 'Nothing'+sourceMarkPrev mark category = maybeNull (makeNewGObject mkSourceMark) $ maybeWith withUTFString category $ {#call unsafe source_mark_prev#} (toSourceMark mark) @@ -119,5 +120,5 @@ -- which priority it is drawn. -- Default value: \"\" ---sourceMarkCategory :: SourceMarkClass mark => Attr mark String+sourceMarkCategory :: (SourceMarkClass mark, GlibString string) => Attr mark string sourceMarkCategory = newAttrFromStringProperty "category"
Graphics/UI/Gtk/SourceView/SourceStyle.hs view
@@ -28,13 +28,15 @@ SourceStyle(..), ) where +import Data.Text (Text)+ data SourceStyle = SourceStyle- { sourceStyleBackground :: Maybe String+ { sourceStyleBackground :: Maybe Text , sourceStyleBold :: Maybe Bool- , sourceStyleForeground :: Maybe String+ , sourceStyleForeground :: Maybe Text , sourceStyleItalic :: Maybe Bool- , sourceStyleLineBackground :: Maybe String+ , sourceStyleLineBackground :: Maybe Text , sourceStyleStrikethrough :: Maybe Bool , sourceStyleUnderline :: Maybe Bool }
Graphics/UI/Gtk/SourceView/SourceStyleScheme.chs view
@@ -29,7 +29,7 @@ -- | 'SourceStyleScheme' contains all the text styles to be used in 'SourceView' and -- 'SourceBuffer'. For instance, it contains text styles for syntax highlighting, it may contain -- foreground and background color for non-highlighted text, color for the line numbers, etc.--- +-- -- Style schemes are stored in XML files. The format of a scheme file is the documented in the style -- scheme reference. @@ -37,7 +37,7 @@ SourceStyleScheme, SourceStyleSchemeClass, --- * Methods +-- * Methods castToSourceStyleScheme, sourceStyleSchemeGetId, sourceStyleSchemeGetName,@@ -46,7 +46,7 @@ sourceStyleSchemeGetFilename, sourceStyleSchemeGetStyle, --- * Attributes +-- * Attributes sourceStyleSchemeDescription, sourceStyleSchemeFilename, sourceStyleSchemeId,@@ -69,45 +69,45 @@ -- methods --- | --- -sourceStyleSchemeGetId :: SourceStyleSchemeClass sss => sss- -> IO String -- ^ returns scheme id. +-- |+--+sourceStyleSchemeGetId :: (SourceStyleSchemeClass sss, GlibString string) => sss+ -> IO string -- ^ returns scheme id. sourceStyleSchemeGetId ss = {#call source_style_scheme_get_id#} (toSourceStyleScheme ss) >>= peekUTFString --- | --- -sourceStyleSchemeGetName :: SourceStyleSchemeClass sss => sss - -> IO String -- ^ returns scheme name. +-- |+--+sourceStyleSchemeGetName :: (SourceStyleSchemeClass sss, GlibString string) => sss+ -> IO string -- ^ returns scheme name. sourceStyleSchemeGetName ss = {#call source_style_scheme_get_name#} (toSourceStyleScheme ss) >>= peekUTFString --- | --- -sourceStyleSchemeGetDescription :: SourceStyleSchemeClass sss => sss - -> IO String -- ^ returns scheme description (if defined) or empty. +-- |+--+sourceStyleSchemeGetDescription :: (SourceStyleSchemeClass sss, GlibString string) => sss+ -> IO string -- ^ returns scheme description (if defined) or empty. sourceStyleSchemeGetDescription ss = {#call source_style_scheme_get_description#} (toSourceStyleScheme ss) >>= peekUTFString -- | ---sourceStyleSchemeGetAuthors :: SourceStyleSchemeClass sss => sss - -> IO [String] -- ^ returns an array containing the scheme authors or empty if no author is specified by the style scheme.+sourceStyleSchemeGetAuthors :: (SourceStyleSchemeClass sss, GlibString string) => sss+ -> IO [string] -- ^ returns an array containing the scheme authors or empty if no author is specified by the style scheme. sourceStyleSchemeGetAuthors ss = {#call source_style_scheme_get_authors#} (toSourceStyleScheme ss) >>= peekUTFStringArray0 --- | --- -sourceStyleSchemeGetFilename :: SourceStyleSchemeClass sss => sss - -> IO String -- ^ returns scheme file name if the scheme was created parsing a style scheme file or empty in the other cases.+-- |+--+sourceStyleSchemeGetFilename :: (SourceStyleSchemeClass sss, GlibString string) => sss+ -> IO string -- ^ returns scheme file name if the scheme was created parsing a style scheme file or empty in the other cases. sourceStyleSchemeGetFilename ss = {#call source_style_scheme_get_filename#} (toSourceStyleScheme ss) >>= peekUTFString --- | --- -sourceStyleSchemeGetStyle :: SourceStyleSchemeClass sss => sss - -> String -- ^ @styleId@ id of the style to retrieve.+-- |+--+sourceStyleSchemeGetStyle :: (SourceStyleSchemeClass sss, GlibString string) => sss+ -> string -- ^ @styleId@ id of the style to retrieve. -> IO SourceStyle -- ^ returns style which corresponds to @styleId@ in the scheme sourceStyleSchemeGetStyle ss id = do styleObj <- makeNewGObject mkSourceStyleObject $@@ -115,29 +115,29 @@ sourceStyleFromObject styleObj -- | Style scheme description.--- +-- -- Default value: \"\" ---sourceStyleSchemeDescription :: SourceStyleSchemeClass sss => ReadAttr sss String+sourceStyleSchemeDescription :: (SourceStyleSchemeClass sss, GlibString string) => ReadAttr sss string sourceStyleSchemeDescription = readAttrFromStringProperty "description" -- | Style scheme filename or 'Nothing'.--- +-- -- Default value: \"\" ---sourceStyleSchemeFilename :: SourceStyleSchemeClass sss => ReadAttr sss FilePath-sourceStyleSchemeFilename = readAttrFromStringProperty "filename"+sourceStyleSchemeFilename :: (SourceStyleSchemeClass sss, GlibFilePath fp) => ReadAttr sss fp+sourceStyleSchemeFilename = readAttrFromFilePathProperty "filename" -- | Style scheme id, a unique string used to identify the style scheme in 'SourceStyleSchemeManager'.--- +-- -- Default value: \"\" ---sourceStyleSchemeId :: SourceStyleSchemeClass sss => ReadAttr sss String+sourceStyleSchemeId :: (SourceStyleSchemeClass sss, GlibString string) => ReadAttr sss string sourceStyleSchemeId = readAttrFromStringProperty "id" -- | Style scheme name, a translatable string to present to user.--- +-- -- Default value: \"\" ---sourceStyleSchemeName :: SourceStyleSchemeClass sss => ReadAttr sss String+sourceStyleSchemeName :: (SourceStyleSchemeClass sss, GlibString string) => ReadAttr sss string sourceStyleSchemeName = readAttrFromStringProperty "name"
Graphics/UI/Gtk/SourceView/SourceStyleSchemeManager.chs view
@@ -29,7 +29,7 @@ SourceStyleSchemeManager, SourceStyleSchemeManagerClass, --- * Methods +-- * Methods sourceStyleSchemeManagerNew, sourceStyleSchemeManagerGetDefault, sourceStyleSchemeManagerSetSearchPath,@@ -75,49 +75,49 @@ -- | Sets the list of directories where the manager looks for style scheme files. If dirs is 'Nothing', the -- search path is reset to default. ---sourceStyleSchemeManagerSetSearchPath :: SourceStyleSchemeManagerClass sssm => sssm -> Maybe [String] -> IO ()+sourceStyleSchemeManagerSetSearchPath :: (SourceStyleSchemeManagerClass sssm, GlibFilePath fp) => sssm -> Maybe [fp] -> IO () sourceStyleSchemeManagerSetSearchPath ssm dirs =- maybeWith withUTFStringArray0 dirs $ \dirsPtr -> do+ maybeWith withUTFFilePathArray0 dirs $ \dirsPtr -> do {#call unsafe source_style_scheme_manager_set_search_path#} (toSourceStyleSchemeManager ssm) dirsPtr -- | Appends path to the list of directories where the manager looks for style scheme files. See -- 'sourceStyleSchemeManagerSetSearchPath' for details. ---sourceStyleSchemeManagerAppendSearchPath :: SourceStyleSchemeManagerClass sssm => sssm - -> String -- ^ @path@ a directory or a filename. +sourceStyleSchemeManagerAppendSearchPath :: (SourceStyleSchemeManagerClass sssm, GlibFilePath fp) => sssm+ -> fp -- ^ @path@ a directory or a filename. -> IO () sourceStyleSchemeManagerAppendSearchPath ssm dir =- withUTFString dir $ {#call unsafe source_style_scheme_manager_append_search_path#} (toSourceStyleSchemeManager ssm)+ withUTFFilePath dir $ {#call unsafe source_style_scheme_manager_append_search_path#} (toSourceStyleSchemeManager ssm) -- | Prepends path to the list of directories where the manager looks for style scheme files. See -- 'sourceStyleSchemeManagerSetSearchPath' for details. ---sourceStyleSchemeManagerPrependSearchPath :: SourceStyleSchemeManagerClass sssm => sssm - -> String -- ^ @path@ a directory or a filename. +sourceStyleSchemeManagerPrependSearchPath :: (SourceStyleSchemeManagerClass sssm, GlibFilePath fp) => sssm+ -> fp -- ^ @path@ a directory or a filename. -> IO () sourceStyleSchemeManagerPrependSearchPath ssm dir =- withUTFString dir $ {#call unsafe source_style_scheme_manager_prepend_search_path#} (toSourceStyleSchemeManager ssm)+ withUTFFilePath dir $ {#call unsafe source_style_scheme_manager_prepend_search_path#} (toSourceStyleSchemeManager ssm) -- | Returns the current search path for the manager. See -- 'sourceStyleSchemeManagerSetSearchPath' for details. ---sourceStyleSchemeManagerGetSearchPath :: SourceStyleSchemeManagerClass sssm => sssm - -> IO [String]+sourceStyleSchemeManagerGetSearchPath :: (SourceStyleSchemeManagerClass sssm, GlibFilePath fp) => sssm+ -> IO [fp] sourceStyleSchemeManagerGetSearchPath ssm = do dirsPtr <- {#call unsafe source_style_scheme_manager_get_search_path#} (toSourceStyleSchemeManager ssm)- peekUTFStringArray0 dirsPtr+ peekUTFFilePathArray0 dirsPtr -- | Returns the ids of the available style schemes. ---sourceStyleSchemeManagerGetSchemeIds :: SourceStyleSchemeManagerClass sssm => sssm -> IO [String]+sourceStyleSchemeManagerGetSchemeIds :: (SourceStyleSchemeManagerClass sssm, GlibString string) => sssm -> IO [string] sourceStyleSchemeManagerGetSchemeIds ssm = do idsPtr <- {#call unsafe source_style_scheme_manager_get_scheme_ids#} (toSourceStyleSchemeManager ssm) liftM (fromMaybe []) $ maybePeek peekUTFStringArray0 idsPtr -- | Looks up style scheme by id. ---sourceStyleSchemeManagerGetScheme :: SourceStyleSchemeManagerClass sssm => sssm - -> String -- ^ @schemeId@ style scheme id to find+sourceStyleSchemeManagerGetScheme :: (SourceStyleSchemeManagerClass sssm, GlibString string) => sssm+ -> string -- ^ @schemeId@ style scheme id to find -> IO SourceStyleScheme sourceStyleSchemeManagerGetScheme ssm id = makeNewGObject mkSourceStyleScheme $ withUTFString id $ {#call unsafe source_style_scheme_manager_get_scheme#} (toSourceStyleSchemeManager ssm)@@ -131,15 +131,15 @@ -- | List of the ids of the available style schemes. ---sourceStyleSchemeManagerStyleIds :: SourceStyleSchemeManagerClass sssm => ReadAttr sssm [String]+sourceStyleSchemeManagerStyleIds :: (SourceStyleSchemeManagerClass sssm, GlibString string) => ReadAttr sssm [string] sourceStyleSchemeManagerStyleIds = readAttrFromBoxedOpaqueProperty (liftM (fromMaybe []) . maybePeek peekUTFStringArray0 . castPtr) "style-ids" {#call pure g_strv_get_type#} -- | List of directories and files where the style schemes are located. ---sourceStyleSchemeManagerSearchPath :: SourceStyleSchemeManagerClass sssm => ReadWriteAttr sssm [String] (Maybe [String])+sourceStyleSchemeManagerSearchPath :: (SourceStyleSchemeManagerClass sssm, GlibFilePath fp) => ReadWriteAttr sssm [fp] (Maybe [fp]) sourceStyleSchemeManagerSearchPath =- newAttr (objectGetPropertyBoxedOpaque (peekUTFStringArray0 . castPtr) gtype "search-path")- (objectSetPropertyBoxedOpaque (\dirs f -> maybeWith withUTFStringArray0 dirs (f . castPtr)) gtype "search-path")+ newAttr (objectGetPropertyBoxedOpaque (peekUTFFilePathArray0 . castPtr) gtype "search-path")+ (objectSetPropertyBoxedOpaque (\dirs f -> maybeWith withUTFFilePathArray0 dirs (f . castPtr)) gtype "search-path") where gtype = {#call pure g_strv_get_type#}
Graphics/UI/Gtk/SourceView/SourceView.chs view
@@ -39,7 +39,7 @@ SourceDrawSpacesFlags(..), SourceViewGutterPosition (..), --- * Methods +-- * Methods castToSourceView, sourceViewNew, sourceViewNewWithBuffer,@@ -78,7 +78,7 @@ sourceViewGetDrawSpaces, sourceViewGetGutter, --- * Attributes +-- * Attributes sourceViewAutoIndent, sourceViewCompletion, sourceViewDrawSpaces,@@ -121,6 +121,7 @@ import System.Glib.GObject (wrapNewGObject, makeNewGObject) import System.Glib.Attributes import System.Glib.FFI+import System.Glib.UTFString {#import Graphics.UI.Gtk.SourceView.Signals#} {#import Graphics.UI.Gtk.SourceView.Types#}@@ -143,41 +144,41 @@ -- | If 'True' auto indentation of text is enabled. ---sourceViewSetAutoIndent :: SourceViewClass sv => sv - -> Bool -- ^ @enable@ whether to enable auto indentation. +sourceViewSetAutoIndent :: SourceViewClass sv => sv+ -> Bool -- ^ @enable@ whether to enable auto indentation. -> IO () sourceViewSetAutoIndent sv enable = {#call source_view_set_auto_indent#} (toSourceView sv) (fromBool enable)- + -- | Returns whether auto indentation of text is enabled. ---sourceViewGetAutoIndent :: SourceViewClass sv => sv - -> IO Bool -- ^ returns 'True' if auto indentation is enabled. +sourceViewGetAutoIndent :: SourceViewClass sv => sv+ -> IO Bool -- ^ returns 'True' if auto indentation is enabled. sourceViewGetAutoIndent sv = liftM toBool $ {#call unsafe source_view_get_auto_indent#} (toSourceView sv) -- | If 'True', when the tab key is pressed and there is a selection, the selected text is indented of one -- level instead of being replaced with the \t characters. Shift+Tab unindents the selection. ---sourceViewSetIndentOnTab :: SourceViewClass sv => sv - -> Bool -- ^ @enable@ whether to indent a block when tab is pressed. +sourceViewSetIndentOnTab :: SourceViewClass sv => sv+ -> Bool -- ^ @enable@ whether to indent a block when tab is pressed. -> IO () sourceViewSetIndentOnTab sv enable = {#call source_view_set_indent_on_tab#} (toSourceView sv) (fromBool enable)- + -- | Returns whether when the tab key is pressed the current selection should get indented instead of -- replaced with the \t character. ---sourceViewGetIndentOnTab :: SourceViewClass sv => sv - -> IO Bool -- ^ returns 'True' if the selection is indented when tab is pressed. +sourceViewGetIndentOnTab :: SourceViewClass sv => sv+ -> IO Bool -- ^ returns 'True' if the selection is indented when tab is pressed. sourceViewGetIndentOnTab sv = liftM toBool $ {#call unsafe source_view_get_indent_on_tab#} (toSourceView sv) -- | Sets the number of spaces to use for each step of indent. If width is -1, the value of the -- 'tabWidth' property will be used. ---sourceViewSetIndentWidth :: SourceViewClass sv => sv - -> Int -- ^ @width@ indent width in characters. +sourceViewSetIndentWidth :: SourceViewClass sv => sv+ -> Int -- ^ @width@ indent width in characters. -> IO () sourceViewSetIndentWidth sv width = {#call source_view_set_indent_width#} (toSourceView sv) (fromIntegral width)@@ -185,130 +186,130 @@ -- | Returns the number of spaces to use for each step of indent. See 'sourceViewSetIndentWidth' -- for details. ---sourceViewGetIndentWidth :: SourceViewClass sv => sv - -> IO Int -- ^ returns indent width. +sourceViewGetIndentWidth :: SourceViewClass sv => sv+ -> IO Int -- ^ returns indent width. sourceViewGetIndentWidth sv = liftM fromIntegral $ {#call unsafe source_view_get_indent_width#} (toSourceView sv) -- | If 'True' any tabulator character inserted is replaced by a group of space characters. ---sourceViewSetInsertSpacesInsteadOfTabs :: SourceViewClass sv => sv - -> Bool -- ^ @enable@ whether to insert spaces instead of tabs. +sourceViewSetInsertSpacesInsteadOfTabs :: SourceViewClass sv => sv+ -> Bool -- ^ @enable@ whether to insert spaces instead of tabs. -> IO () sourceViewSetInsertSpacesInsteadOfTabs sv enable = {#call source_view_set_insert_spaces_instead_of_tabs#} (toSourceView sv) (fromBool enable)- + -- | Returns whether when inserting a tabulator character it should be replaced by a group of space -- characters. ---sourceViewGetInsertSpacesInsteadOfTabs :: SourceViewClass sv => sv - -> IO Bool -- ^ returns 'True' if spaces are inserted instead of tabs. +sourceViewGetInsertSpacesInsteadOfTabs :: SourceViewClass sv => sv+ -> IO Bool -- ^ returns 'True' if spaces are inserted instead of tabs. sourceViewGetInsertSpacesInsteadOfTabs sv = liftM toBool $ {#call unsafe source_view_get_insert_spaces_instead_of_tabs#} (toSourceView sv) -- | Set the desired movement of the cursor when HOME and END keys are pressed. ---sourceViewSetSmartHomeEnd :: SourceViewClass sv => sv - -> SourceSmartHomeEndType -- ^ @smartHe@ the desired behavior among 'SourceSmartHomeEndType'. +sourceViewSetSmartHomeEnd :: SourceViewClass sv => sv+ -> SourceSmartHomeEndType -- ^ @smartHe@ the desired behavior among 'SourceSmartHomeEndType'. -> IO () sourceViewSetSmartHomeEnd sv newVal = {#call source_view_set_smart_home_end#} (toSourceView sv) (fromIntegral $ fromEnum newVal)- + -- | Returns a 'SourceSmartHomeEndType' end value specifying how the cursor will move when HOME and END -- keys are pressed. ---sourceViewGetSmartHomeEnd :: SourceViewClass sv => sv - -> IO SourceSmartHomeEndType -- ^ returns a 'SourceSmartHomeEndTypeend' value. +sourceViewGetSmartHomeEnd :: SourceViewClass sv => sv+ -> IO SourceSmartHomeEndType -- ^ returns a 'SourceSmartHomeEndTypeend' value. sourceViewGetSmartHomeEnd sv = liftM (toEnum . fromIntegral) $ {#call unsafe source_view_get_smart_home_end#} (toSourceView sv) -- | If show is 'True' the current line is highlighted. ---sourceViewSetHighlightCurrentLine :: SourceViewClass sv => sv - -> Bool -- ^ @show@ whether to highlight the current line +sourceViewSetHighlightCurrentLine :: SourceViewClass sv => sv+ -> Bool -- ^ @show@ whether to highlight the current line -> IO () sourceViewSetHighlightCurrentLine sv newVal = {#call source_view_set_highlight_current_line#} (toSourceView sv) (fromBool newVal)- + -- | Returns whether the current line is highlighted ---sourceViewGetHighlightCurrentLine :: SourceViewClass sv => sv - -> IO Bool -- ^ returns 'True' if the current line is highlighted. +sourceViewGetHighlightCurrentLine :: SourceViewClass sv => sv+ -> IO Bool -- ^ returns 'True' if the current line is highlighted. sourceViewGetHighlightCurrentLine sv = liftM toBool $ {#call unsafe source_view_get_highlight_current_line#} (toSourceView sv) -- | If 'True' line marks will be displayed beside the text. ---sourceViewSetShowLineMarks :: SourceViewClass sv => sv - -> Bool -- ^ @show@ whether line marks should be displayed. +sourceViewSetShowLineMarks :: SourceViewClass sv => sv+ -> Bool -- ^ @show@ whether line marks should be displayed. -> IO () sourceViewSetShowLineMarks sv newVal = {#call source_view_set_show_line_marks#} (toSourceView sv) (fromBool newVal)- + -- | Returns whether line marks are displayed beside the text. ---sourceViewGetShowLineMarks :: SourceViewClass sv => sv - -> IO Bool -- ^ returns 'True' if the line marks are displayed. +sourceViewGetShowLineMarks :: SourceViewClass sv => sv+ -> IO Bool -- ^ returns 'True' if the line marks are displayed. sourceViewGetShowLineMarks sv = liftM toBool $ {#call unsafe source_view_get_show_line_marks#} (toSourceView sv) -- | If 'True' line numbers will be displayed beside the text. ---sourceViewSetShowLineNumbers :: SourceViewClass sv => sv - -> Bool -- ^ @show@ whether line numbers should be displayed. +sourceViewSetShowLineNumbers :: SourceViewClass sv => sv+ -> Bool -- ^ @show@ whether line numbers should be displayed. -> IO () sourceViewSetShowLineNumbers sv newVal = {#call source_view_set_show_line_numbers#} (toSourceView sv) (fromBool newVal)- + -- | Returns whether line numbers are displayed beside the text. ---sourceViewGetShowLineNumbers :: SourceViewClass sv => sv - -> IO Bool -- ^ returns 'True' if the line numbers are displayed. +sourceViewGetShowLineNumbers :: SourceViewClass sv => sv+ -> IO Bool -- ^ returns 'True' if the line numbers are displayed. sourceViewGetShowLineNumbers sv = liftM toBool $ {#call unsafe source_view_get_show_line_numbers#} (toSourceView sv) -- | If 'True' a right margin is displayed ---sourceViewSetShowRightMargin :: SourceViewClass sv => sv - -> Bool -- ^ @show@ whether to show a right margin. +sourceViewSetShowRightMargin :: SourceViewClass sv => sv+ -> Bool -- ^ @show@ whether to show a right margin. -> IO () sourceViewSetShowRightMargin sv newVal = {#call source_view_set_show_right_margin#} (toSourceView sv) (fromBool newVal)- + -- | Returns whether a right margin is displayed. ---sourceViewGetShowRightMargin :: SourceViewClass sv => sv - -> IO Bool -- ^ returns 'True' if the right margin is shown. +sourceViewGetShowRightMargin :: SourceViewClass sv => sv+ -> IO Bool -- ^ returns 'True' if the right margin is shown. sourceViewGetShowRightMargin sv = liftM toBool $ {#call source_view_get_show_right_margin#} (toSourceView sv)- + -- | Sets the position of the right margin in the given view. ---sourceViewSetRightMarginPosition :: SourceViewClass sv => sv - -> Word -- ^ @pos@ the width in characters where to position the right margin. +sourceViewSetRightMarginPosition :: SourceViewClass sv => sv+ -> Word -- ^ @pos@ the width in characters where to position the right margin. -> IO () sourceViewSetRightMarginPosition sv margin = {#call source_view_set_right_margin_position#} (toSourceView sv) (fromIntegral margin)- + -- | Gets the position of the right margin in the given view. ---sourceViewGetRightMarginPosition :: SourceViewClass sv => sv - -> IO Int -- ^ returns the position of the right margin. +sourceViewGetRightMarginPosition :: SourceViewClass sv => sv+ -> IO Int -- ^ returns the position of the right margin. sourceViewGetRightMarginPosition sv = liftM fromIntegral $ {#call unsafe source_view_get_right_margin_position#} (toSourceView sv) -- | Sets the width of tabulation in characters. ---sourceViewSetTabWidth :: SourceViewClass sv => sv - -> Int -- ^ @width@ width of tab in characters. +sourceViewSetTabWidth :: SourceViewClass sv => sv+ -> Int -- ^ @width@ width of tab in characters. -> IO () sourceViewSetTabWidth sv width = {#call source_view_set_tab_width#} (toSourceView sv) (fromIntegral width)- + -- | Returns the width of tabulation in characters. ---sourceViewGetTabWidth :: SourceViewClass sv => sv - -> IO Int -- ^ returns width of tab. +sourceViewGetTabWidth :: SourceViewClass sv => sv+ -> IO Int -- ^ returns width of tab. sourceViewGetTabWidth sv = liftM fromIntegral $ {#call unsafe source_view_get_tab_width#} (toSourceView sv) @@ -318,14 +319,14 @@ -> SourceDrawSpacesFlags -- ^ @flags@ 'SourceDrawSpacesFlags' specifing how white spaces should be displayed -> IO () sourceViewSetDrawSpaces view flags =- {#call gtk_source_view_set_draw_spaces #} + {#call gtk_source_view_set_draw_spaces #} (toSourceView view) (fromIntegral $ fromEnum flags) -- | Returns the 'SourceDrawSpacesFlags' specifying if and how spaces should be displayed for this view. sourceViewGetDrawSpaces :: SourceViewClass sv => sv- -> IO SourceDrawSpacesFlags -- ^ returns the 'SourceDrawSpacesFlags', 0 if no spaces should be drawn. -sourceViewGetDrawSpaces view = + -> IO SourceDrawSpacesFlags -- ^ returns the 'SourceDrawSpacesFlags', 0 if no spaces should be drawn.+sourceViewGetDrawSpaces view = liftM (toEnum . fromIntegral) $ {#call gtk_source_view_get_draw_spaces #} (toSourceView view)@@ -334,8 +335,8 @@ -- and 'TextWindowRight' are supported, respectively corresponding to the left and right -- gutter. The line numbers and mark category icons are rendered in the gutter corresponding to -- 'TextWindowLeft'.-sourceViewGetGutter :: SourceViewClass sv => sv - -> TextWindowType -- ^ @windowType@ the gutter window type +sourceViewGetGutter :: SourceViewClass sv => sv+ -> TextWindowType -- ^ @windowType@ the gutter window type -> IO SourceGutter sourceViewGetGutter sv windowType = makeNewGObject mkSourceGutter $@@ -347,29 +348,29 @@ -- | Set the priority for the given mark category. When there are multiple marks on the same line, marks -- of categories with higher priorities will be drawn on top. ---sourceViewSetMarkCategoryPriority :: SourceViewClass sv => sv - -> String -- ^ @category@ a mark category. - -> Int -- ^ @priority@ the priority for the category +sourceViewSetMarkCategoryPriority :: (SourceViewClass sv, GlibString string) => sv+ -> string -- ^ @category@ a mark category.+ -> Int -- ^ @priority@ the priority for the category -> IO ()-sourceViewSetMarkCategoryPriority sv markerType priority = withCString markerType $ \strPtr ->+sourceViewSetMarkCategoryPriority sv markerType priority = withUTFString markerType $ \strPtr -> {#call source_view_set_mark_category_priority#} (toSourceView sv) strPtr (fromIntegral priority) -- | Gets the priority which is associated with the given category. ---sourceViewGetMarkCategoryPriority :: SourceViewClass sv => sv - -> String -- ^ @category@ a mark category. +sourceViewGetMarkCategoryPriority :: (SourceViewClass sv, GlibString string) => sv+ -> string -- ^ @category@ a mark category. -> IO Int -- ^ returns the priority or if category exists but no priority was set, it defaults to 0.-sourceViewGetMarkCategoryPriority sv markerType = withCString markerType $ \strPtr ->+sourceViewGetMarkCategoryPriority sv markerType = withUTFString markerType $ \strPtr -> liftM fromIntegral $ {#call unsafe source_view_get_mark_category_priority#} (toSourceView sv) strPtr -- | Sets the icon to be used for category to pixbuf. If pixbuf is 'Nothing', the icon is unset.-sourceViewSetMarkCategoryIconFromPixbuf :: SourceViewClass sv => sv- -> String -- ^ @category@ a mark category. - -> Maybe Pixbuf -- ^ @pixbuf@ a 'Pixbuf' or 'Nothing'. +sourceViewSetMarkCategoryIconFromPixbuf :: (SourceViewClass sv, GlibString string) => sv+ -> string -- ^ @category@ a mark category.+ -> Maybe Pixbuf -- ^ @pixbuf@ a 'Pixbuf' or 'Nothing'. -> IO () sourceViewSetMarkCategoryIconFromPixbuf sv category pixbuf =- withCString category $ \categoryPtr ->+ withUTFString category $ \categoryPtr -> {#call gtk_source_view_set_mark_category_icon_from_pixbuf #} (toSourceView sv) categoryPtr@@ -377,13 +378,13 @@ -- | Sets the icon to be used for category to the stock item @stockId@. If @stockId@ is 'Nothing', the icon is -- unset.-sourceViewSetMarkCategoryIconFromStock :: SourceViewClass sv => sv- -> String -- ^ @category@ a mark category. - -> Maybe String -- ^ @stockId@ the stock id or 'Nothing'. +sourceViewSetMarkCategoryIconFromStock :: (SourceViewClass sv, GlibString string) => sv+ -> string -- ^ @category@ a mark category.+ -> Maybe string -- ^ @stockId@ the stock id or 'Nothing'. -> IO () sourceViewSetMarkCategoryIconFromStock sv category stockId =- withCString category $ \categoryPtr ->- maybeWith withCString stockId $ \stockIdPtr ->+ withUTFString category $ \categoryPtr ->+ maybeWith withUTFString stockId $ \stockIdPtr -> {#call gtk_source_view_set_mark_category_icon_from_stock #} (toSourceView sv) categoryPtr@@ -391,28 +392,28 @@ -- | Sets the icon to be used for category to the named theme item name. If name is 'Nothing', the icon is -- unset.-sourceViewSetMarkCategoryIconFromIconName :: SourceViewClass sv => sv- -> String -- ^ @category@ a mark category. - -> Maybe String -- ^ @name@ the themed icon name or 'Nothing'. +sourceViewSetMarkCategoryIconFromIconName :: (SourceViewClass sv, GlibString string) => sv+ -> string -- ^ @category@ a mark category.+ -> Maybe string -- ^ @name@ the themed icon name or 'Nothing'. -> IO () sourceViewSetMarkCategoryIconFromIconName sv category name =- withCString category $ \categoryPtr ->- maybeWith withCString name $ \namePtr ->+ withUTFString category $ \categoryPtr ->+ maybeWith withUTFString name $ \namePtr -> {#call gtk_source_view_set_mark_category_icon_from_icon_name #} (toSourceView sv) categoryPtr namePtr -- | Sets given background color for mark category. If color is 'Nothing', the background color is unset.-sourceViewSetMarkCategoryBackground :: SourceViewClass sv => sv- -> String -- ^ @category@ a mark category. - -> Maybe Color -- ^ @color@ background color or 'Nothing' to unset it. +sourceViewSetMarkCategoryBackground :: (SourceViewClass sv, GlibString string) => sv+ -> string -- ^ @category@ a mark category.+ -> Maybe Color -- ^ @color@ background color or 'Nothing' to unset it. -> IO () sourceViewSetMarkCategoryBackground sv category color = let withMB :: Storable a => Maybe a -> (Ptr a -> IO b) -> IO b withMB Nothing f = f nullPtr withMB (Just x) f = with x f- in withCString category $ \categoryPtr ->+ in withUTFString category $ \categoryPtr -> withMB color $ \colorPtr -> {#call gtk_source_view_set_mark_category_background #} (toSourceView sv)@@ -420,13 +421,13 @@ (castPtr colorPtr) -- | Gets the background color associated with given category.-sourceViewGetMarkCategoryBackground :: SourceViewClass sv => sv- -> String -- ^ @category@ a mark category.+sourceViewGetMarkCategoryBackground :: (SourceViewClass sv, GlibString string) => sv+ -> string -- ^ @category@ a mark category. -> Color -- ^ @dest@ destination 'Color' structure to fill in. -> IO Bool -- ^ returns 'True' if background color for category was set and dest is set to a valid color, or 'False' otherwise.-sourceViewGetMarkCategoryBackground sv category color = +sourceViewGetMarkCategoryBackground sv category color = liftM toBool $- withCString category $ \ categoryPtr ->+ withUTFString category $ \ categoryPtr -> with color $ \ colorPtr -> {#call gtk_source_view_get_mark_category_background #} (toSourceView sv)@@ -435,7 +436,7 @@ #endif -- | Whether to enable auto indentation.--- +-- -- Default value: 'False' -- sourceViewAutoIndent :: SourceViewClass sv => Attr sv Bool@@ -453,71 +454,71 @@ sourceViewDrawSpaces = newAttrFromEnumProperty "draw-spaces" {#call fun gtk_source_draw_spaces_flags_get_type#} -- | Whether to highlight the current line.--- +-- -- Default value: 'False' -- sourceViewHighlightCurrentLine :: SourceViewClass sv => Attr sv Bool sourceViewHighlightCurrentLine = newAttrFromBoolProperty "highlight-current-line" -- | Whether to indent the selected text when the tab key is pressed.--- +-- -- Default value: 'True' -- sourceViewIndentOnTab :: SourceViewClass sv => Attr sv Bool sourceViewIndentOnTab = newAttrFromBoolProperty "indent-on-tab" -- | Width of an indentation step expressed in number of spaces.--- +-- -- Allowed values: [GMaxulong,32]--- +-- -- Default value: -1 -- sourceViewIndentWidth :: SourceViewClass sv => Attr sv Int sourceViewIndentWidth = newAttrFromIntProperty "indent-width" -- | Whether to insert spaces instead of tabs.--- +-- -- Default value: 'False' -- sourceViewInsertSpacesInsteadOfTabs :: SourceViewClass sv => Attr sv Bool sourceViewInsertSpacesInsteadOfTabs = newAttrFromBoolProperty "insert-spaces-instead-of-tabs" -- | Position of the right margin.--- +-- -- Allowed values: [1,200]--- +-- -- Default value: 80 -- sourceViewRightMarginPosition :: SourceViewClass sv => Attr sv Int sourceViewRightMarginPosition = newAttrFromUIntProperty "right-margin-position" -- | Whether to display line numbers--- +-- -- Default value: 'False' -- sourceViewShowLineNumbers :: SourceViewClass sv => Attr sv Bool sourceViewShowLineNumbers = newAttrFromBoolProperty "show-line-numbers" -- | Whether to display line mark pixbufs--- +-- -- Default value: 'False' -- sourceViewShowRightMargin :: SourceViewClass sv => Attr sv Bool sourceViewShowRightMargin = newAttrFromBoolProperty "show-right-margin" -- | Set the behavior of the HOME and END keys.--- +-- -- Default value: 'SourceSmartHomeEndDisabled'--- +-- -- Since 2.0 -- sourceViewSmartHomeEnd :: SourceViewClass sv => Attr sv SourceSmartHomeEndType sourceViewSmartHomeEnd = newAttrFromEnumProperty "smart-home-end" {#call fun gtk_source_smart_home_end_type_get_type#} -- | Width of an tab character expressed in number of spaces.--- +-- -- Allowed values: [1,32]--- +-- -- Default value: 8 -- sourceViewTabWidth :: SourceViewClass sv => Attr sv Int@@ -541,7 +542,7 @@ -- | The 'showCompletion' signal is a keybinding signal which gets emitted when the user initiates a -- completion in default mode.--- +-- -- Applications should not connect to it, but may emit it with @gSignalEmitByName@ if they need to -- control the default mode completion activation. sourceViewShowCompletion :: SourceViewClass sv => Signal sv (IO ())@@ -550,8 +551,8 @@ -- | Emitted when a line mark has been activated (for instance when there was a button press in the line -- marks gutter). You can use iter to determine on which line the activation took place. sourceViewLineMarkActivated :: SourceViewClass sv => Signal sv (TextIter -> EventM EAny ())-sourceViewLineMarkActivated = - Signal (\after obj fun -> +sourceViewLineMarkActivated =+ Signal (\after obj fun -> connect_BOXED_PTR__NONE "line-mark-activated" mkTextIterCopy after obj (\iter eventPtr -> runReaderT (fun iter) eventPtr) )@@ -562,14 +563,14 @@ -- | 'sourceViewSetMarkCategoryPixbuf' is deprecated and should not be used in newly-written -- code. Use 'sourceViewSetMarkCategoryIconFromPixbuf' instead ---sourceViewSetMarkCategoryPixbuf :: SourceViewClass sv => sv -> String -> Pixbuf -> IO ()-sourceViewSetMarkCategoryPixbuf sv markerType marker = withCString markerType $ \strPtr ->+sourceViewSetMarkCategoryPixbuf :: (SourceViewClass sv, GlibString string) => sv -> string -> Pixbuf -> IO ()+sourceViewSetMarkCategoryPixbuf sv markerType marker = withUTFString markerType $ \strPtr -> {#call source_view_set_mark_category_pixbuf#} (toSourceView sv) strPtr marker -- | 'sourceViewGetMarkCategoryPixbuf' is deprecated and should not be used in newly-written code. ---sourceViewGetMarkCategoryPixbuf :: SourceViewClass sv => sv -> String -> IO Pixbuf-sourceViewGetMarkCategoryPixbuf sv markerType = withCString markerType $ \strPtr ->+sourceViewGetMarkCategoryPixbuf :: (SourceViewClass sv, GlibString string) => sv -> string -> IO Pixbuf+sourceViewGetMarkCategoryPixbuf sv markerType = withUTFString markerType $ \strPtr -> wrapNewGObject mkPixbuf $ {#call unsafe source_view_get_mark_category_pixbuf#} (toSourceView sv) strPtr #endif
Graphics/UI/Gtk/SourceView/Types.chs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# OPTIONS_HADDOCK hide #-} -- -*-haskell-*- -- -------------------- automatically generated file - do not edit ----------
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
gtksourceview2.cabal view
@@ -1,5 +1,5 @@ Name: gtksourceview2-Version: 0.12.5.0+Version: 0.13.0.0 License: LGPL-2.1 License-file: COPYING Copyright: (c) 2001-2010 The Gtk2Hs Team@@ -9,7 +9,7 @@ Cabal-Version: >= 1.8 Stability: provisional homepage: http://projects.haskell.org/gtk2hs/-bug-reports: http://hackage.haskell.org/trac/gtk2hs/+bug-reports: https://github.com/gtk2hs/gtksourceview/issues Synopsis: Binding to the GtkSourceView library. Description: GtkSourceView is a text widget that extends the standard GTK+ 2.x text widget GtkTextView. It improves GtkTextView by implementing syntax highlighting and@@ -40,10 +40,10 @@ location: https://github.com/gtk2hs/gtksourceview Library- build-depends: base >= 4 && < 5, array, containers, mtl,- glib >= 0.12 && < 0.13+ build-depends: base >= 4 && < 5, array, containers, mtl, text,+ glib >= 0.13 && < 0.14 - build-tools: gtk2hsC2hs >= 0.13.8,+ build-tools: gtk2hsC2hs >= 0.13.11, gtk2hsHookGenerator, gtk2hsTypeGen exposed-modules:@@ -81,4 +81,4 @@ x-c2hs-Header: gtksourceview2.h pkgconfig-depends: gtksourceview-2.0 >= 2.0.2 x-Types-Hierarchy: hierarchy.list- build-depends: gtk >=0.12.5.0 && <0.13+ build-depends: gtk >=0.13.0.0 && <0.14
gtksourceview2.h view
@@ -1,3 +1,6 @@+#ifdef __BLOCKS__+#undef __BLOCKS__+#endif #include "gtk2hs_macros.h" #include <gtksourceview/gtksourcebuffer.h> #if GTK_MAJOR_VERSION < 3
hierarchy.list view
@@ -17,333 +17,27 @@ GObject - GtkSourceGutter if gtksourceview2- GtkSourceUndoManager if gtksourceview2- GtkSourceCompletionProvider if gtksourceview2- GtkSourceCompletionProposal if gtksourceview2- GtkSourceCompletionContext if gtksourceview2- GtkSourceCompletionItem if gtksourceview2- 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+ GtkSourceGutter if gtksourceview2+ GtkSourceUndoManager if gtksourceview2+ GtkSourceCompletionProvider if gtksourceview2+ GtkSourceCompletionProposal if gtksourceview2+ GtkSourceCompletionContext if gtksourceview2+ GtkSourceCompletionItem if gtksourceview2+ GtkSourceCompletion if gtksourceview2 GtkTextBuffer- GtkSourceBuffer if sourceview- GtkSourceBuffer if gtksourceview2- GtkTextTag- GtkSourceTag if sourceview- GtkTextTagTable- GtkSourceTagTable if sourceview- GtkStyle- GtkRcStyle- GdkDragContext- GdkPixbuf- GdkPixbufAnimation- GdkPixbufSimpleAnim- GdkPixbufAnimationIter- GtkTextChildAnchor+ GtkSourceBuffer if gtksourceview2 GtkTextMark- GtkSourceMarker if sourceview GtkSourceMark if gtksourceview2 GtkObject- GtkSourceCompletion if gtksourceview2 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- GtkSourceCompletionInfo if gtksourceview2- 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+ GtkSourceCompletionInfo if gtksourceview2 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-+ GtkSourceView if gtksourceview2+ GtkSourceLanguage if gtksourceview2+ GtkSourceLanguageManager if gtksourceview2+ GtkSourceStyle as SourceStyleObject if gtksourceview2+ GtkSourceStyleScheme if gtksourceview2+ GtkSourceStyleSchemeManager if gtksourceview2