{-# LINE 2 "./Graphics/UI/Gtk/SourceView/SourceStyleScheme.chs" #-}-- -*-haskell-*--- GIMP Toolkit (GTK) SourceStyleScheme---- Author : Peter Gavin-- derived from sourceview bindings by Axel Simon and Duncan Coutts---- Created: 18 December 2008---- Copyright (C) 2004-2008 Peter Gavin, Duncan Coutts, Axel Simon---- This library is free software; you can redistribute it and/or-- modify it under the terms of the GNU Lesser General Public-- License as published by the Free Software Foundation; either-- version 2.1 of the License, or (at your option) any later version.---- This library is distributed in the hope that it will be useful,-- but WITHOUT ANY WARRANTY; without even the implied warranty of-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU-- Lesser General Public License for more details.---- |-- Maintainer : gtk2hs-users@lists.sourceforge.net-- Stability : provisional-- Portability : portable (depends on GHC)--moduleGraphics.UI.Gtk.SourceView.SourceStyleScheme(-- * Description-- | '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.-- * TypesSourceStyleScheme,SourceStyleSchemeClass,-- * MethodscastToSourceStyleScheme,sourceStyleSchemeGetId,sourceStyleSchemeGetName,sourceStyleSchemeGetDescription,sourceStyleSchemeGetAuthors,sourceStyleSchemeGetFilename,sourceStyleSchemeGetStyle,-- * AttributessourceStyleSchemeDescription,sourceStyleSchemeFilename,sourceStyleSchemeId,sourceStyleSchemeName,)whereimportControl.Monad(liftM)importGraphics.UI.Gtk.SourceView.SourceStyleimportSystem.Glib.AttributesimportSystem.Glib.FFIimportSystem.Glib.GObject(makeNewGObject)importSystem.Glib.UTFStringimportGraphics.UI.Gtk.SourceView.SourceStyle.Internal{-# LINE 65 "./Graphics/UI/Gtk/SourceView/SourceStyleScheme.chs" #-}importGraphics.UI.Gtk.SourceView.Types{-# LINE 66 "./Graphics/UI/Gtk/SourceView/SourceStyleScheme.chs" #-}importSystem.Glib.Properties{-# LINE 67 "./Graphics/UI/Gtk/SourceView/SourceStyleScheme.chs" #-}{-# LINE 69 "./Graphics/UI/Gtk/SourceView/SourceStyleScheme.chs" #-}-- methods-- |--sourceStyleSchemeGetId::SourceStyleSchemeClasssss=>sss->IOString-- ^ returns scheme id.sourceStyleSchemeGetIdss=(\(SourceStyleSchemearg1)->withForeignPtrarg1$\argPtr1->gtk_source_style_scheme_get_idargPtr1)(toSourceStyleSchemess)>>=peekUTFString-- |--sourceStyleSchemeGetName::SourceStyleSchemeClasssss=>sss->IOString-- ^ returns scheme name.sourceStyleSchemeGetNamess=(\(SourceStyleSchemearg1)->withForeignPtrarg1$\argPtr1->gtk_source_style_scheme_get_nameargPtr1)(toSourceStyleSchemess)>>=peekUTFString-- |--sourceStyleSchemeGetDescription::SourceStyleSchemeClasssss=>sss->IOString-- ^ returns scheme description (if defined) or empty.sourceStyleSchemeGetDescriptionss=(\(SourceStyleSchemearg1)->withForeignPtrarg1$\argPtr1->gtk_source_style_scheme_get_descriptionargPtr1)(toSourceStyleSchemess)>>=peekUTFString-- |--sourceStyleSchemeGetAuthors::SourceStyleSchemeClasssss=>sss->IO[String]-- ^ returns an array containing the scheme authors or empty if no author is specified by the style scheme.sourceStyleSchemeGetAuthorsss=(\(SourceStyleSchemearg1)->withForeignPtrarg1$\argPtr1->gtk_source_style_scheme_get_authorsargPtr1)(toSourceStyleSchemess)>>=peekUTFStringArray0-- |--sourceStyleSchemeGetFilename::SourceStyleSchemeClasssss=>sss->IOString-- ^ returns scheme file name if the scheme was created parsing a style scheme file or empty in the other cases.sourceStyleSchemeGetFilenamess=(\(SourceStyleSchemearg1)->withForeignPtrarg1$\argPtr1->gtk_source_style_scheme_get_filenameargPtr1)(toSourceStyleSchemess)>>=peekUTFString-- |--sourceStyleSchemeGetStyle::SourceStyleSchemeClasssss=>sss->String-- ^ @styleId@ id of the style to retrieve.->IOSourceStyle-- ^ returns style which corresponds to @styleId@ in the schemesourceStyleSchemeGetStylessid=dostyleObj<-makeNewGObjectmkSourceStyleObject$withUTFStringid((\(SourceStyleSchemearg1)arg2->withForeignPtrarg1$\argPtr1->gtk_source_style_scheme_get_styleargPtr1arg2)(toSourceStyleSchemess))sourceStyleFromObjectstyleObj-- | Style scheme description.---- Default value: \"\"--sourceStyleSchemeDescription::SourceStyleSchemeClasssss=>ReadAttrsssStringsourceStyleSchemeDescription=readAttrFromStringProperty"description"-- | Style scheme filename or 'Nothing'.---- Default value: \"\"--sourceStyleSchemeFilename::SourceStyleSchemeClasssss=>ReadAttrsssFilePathsourceStyleSchemeFilename=readAttrFromStringProperty"filename"-- | Style scheme id, a unique string used to identify the style scheme in 'SourceStyleSchemeManager'.---- Default value: \"\"--sourceStyleSchemeId::SourceStyleSchemeClasssss=>ReadAttrsssStringsourceStyleSchemeId=readAttrFromStringProperty"id"-- | Style scheme name, a translatable string to present to user.---- Default value: \"\"--sourceStyleSchemeName::SourceStyleSchemeClasssss=>ReadAttrsssStringsourceStyleSchemeName=readAttrFromStringProperty"name"foreignimportccallsafe"gtk_source_style_scheme_get_id"gtk_source_style_scheme_get_id::((PtrSourceStyleScheme)->(IO(PtrCChar)))foreignimportccallsafe"gtk_source_style_scheme_get_name"gtk_source_style_scheme_get_name::((PtrSourceStyleScheme)->(IO(PtrCChar)))foreignimportccallsafe"gtk_source_style_scheme_get_description"gtk_source_style_scheme_get_description::((PtrSourceStyleScheme)->(IO(PtrCChar)))foreignimportccallsafe"gtk_source_style_scheme_get_authors"gtk_source_style_scheme_get_authors::((PtrSourceStyleScheme)->(IO(Ptr(PtrCChar))))foreignimportccallsafe"gtk_source_style_scheme_get_filename"gtk_source_style_scheme_get_filename::((PtrSourceStyleScheme)->(IO(PtrCChar)))foreignimportccallsafe"gtk_source_style_scheme_get_style"gtk_source_style_scheme_get_style::((PtrSourceStyleScheme)->((PtrCChar)->(IO(PtrSourceStyleObject))))