Module Gtksv_utils (.ml)


module Gtksv_utils: sig .. end
Using the same syntax highlight through all applications which use the LablGtkSourceView library.

Use the source_languages_manager below to get the languages to use in your code views. The styles of the tags of each language are read from the user's configuration file in ~/.mlgtksourceview/<language>.

The other functions below can be used to make the user edit the highlight attributes for each language.


val source_languages_manager : GSourceView.source_languages_manager
val store_lang_style : GSourceView.source_language -> unit
Store the style of the tags of the given language in the user's personal files.
val read_lang_style : GSourceView.source_language -> unit
Read the style of the tags of the given language from the user's personal files. If there is no style file for this language, it is created and the current styles of the language tags are stored.
type source_view_props 
val store_sourceview_props : source_view_props -> unit
Store the given source view properties in the user's personal files.
val read_sourceview_props : unit -> source_view_props
Read the source view properties from the user's personal files. If there is no properties file, default properties are returned.
val register_source_view : GSourceView.source_view -> unit
Register a source view so that each time the function Gtksv_utils.read_sourceview_props is called, the properties read are applied to every registered view.
val apply_sourceview_props : GSourceView.source_view -> source_view_props -> unit
Apply the given source view properties to the given source view.
val apply_sourceview_props_to_registered : source_view_props -> unit
Apply the given source view properties to the registered views.

Editing the styles


class lang_style_box : unit -> object .. end
This box can be used to make the user set the styles of the tags of a language.
val sort_languages_by_name : GSourceView.source_language list -> GSourceView.source_language list
Sort the given list of languages by name.
val edit_lang_style : ?modal:bool -> GSourceView.source_language -> unit
Make the user set his preferences for the tags of the given language. Then Gtksv_utils.store_lang_style is used to save the changes or Gtksv_utils.read_lang_style is used to restore the original values.
class multi_lang_style_box : unit -> object .. end
This box can be used to make the user set the styles of the tags of the available languages.
val edit_available_languages_styles : ?modal:bool -> unit -> unit
Make the user set his preferences for the tags of the available languages. Then Gtksv_utils.store_lang_style is used to save the changes or Gtksv_utils.read_lang_style is used to restore the original values, for each language.
class sourceview_props_box : (source_view_props -> unit) -> object .. end
This box can be used to make the user set source view properties.
val edit_sourceview_props : ?modal:bool ->
?preview:(source_view_props -> unit) -> unit -> unit
Make the user set his source view properties. Then Gtksv_utils.store_sourceview_props is used to save the changes or Gtksv_utils.read_sourceview_props is used to restore the original values.
preview : is the function called to apply the properties when the user makes a change or when he closes the window with "Ok".