package lablgtk3-extras

  1. Overview
  2. Docs

This module contains the types used in Configwin.

val name_to_keysym : (string * int) list
val string_to_key : string -> [> `CONTROL | `LOCK | `MOD1 | `MOD2 | `MOD3 | `MOD4 | `MOD5 | `SHIFT ] list * int
val key_to_string : ([> `CONTROL | `LOCK | `MOD1 | `MOD2 | `MOD3 | `MOD4 | `MOD5 | `SHIFT ] list * int) -> string
val key_wrapper : (Gdk.Tags.modifier list * int) Ocf.Wrapper.t
val key_option : ?doc:string -> ?cb:((Gdk.Tags.modifier list * int) -> unit) -> (Gdk.Tags.modifier list * int) -> (Gdk.Tags.modifier list * int) Ocf.conf_option

To define key options, with the Ocf module.

type 'a string_param = {
  1. string_label : string;
    (*

    the label of the parameter

    *)
  2. mutable string_value : 'a;
    (*

    the current value of the parameter

    *)
  3. string_editable : bool;
    (*

    indicates if the value can be changed

    *)
  4. string_f_apply : 'a -> unit;
    (*

    the function to call to apply the new value of the parameter

    *)
  5. string_help : string option;
    (*

    optional help string

    *)
  6. string_expand : bool;
    (*

    expand or not

    *)
  7. string_to_string : 'a -> string;
  8. string_of_string : string -> 'a;
}

This type represents a string or filename parameter, or any other type, depending on the given conversion functions.

type bool_param = {
  1. bool_label : string;
    (*

    the label of the parameter

    *)
  2. mutable bool_value : bool;
    (*

    the current value of the parameter

    *)
  3. bool_editable : bool;
    (*

    indicates if the value can be changed

    *)
  4. bool_f_apply : bool -> unit;
    (*

    the function to call to apply the new value of the parameter

    *)
  5. bool_help : string option;
    (*

    optional help string

    *)
}

This type represents a boolean parameter.

type 'a list_param = {
  1. list_label : string;
    (*

    the label of the parameter

    *)
  2. mutable list_value : 'a list;
    (*

    the current value of the parameter

    *)
  3. list_columns : (('a -> string) * string option) list;
    (*

    the list of columns: how each must be displayed, and its optional title

    *)
  4. list_f_edit : ('a -> 'a) option;
    (*

    optional edition function

    *)
  5. list_eq : 'a -> 'a -> bool;
    (*

    the comparison function used to get list without doubles

    *)
  6. list_color : 'a -> string option;
    (*

    a function to get the optional color of an element

    *)
  7. list_editable : bool;
    (*

    indicates if the value can be changed

    *)
  8. list_f_add : unit -> 'a list;
    (*

    the function to call to add list

    *)
  9. list_f_apply : 'a list -> unit;
    (*

    the function to call to apply the new value of the parameter

    *)
  10. list_help : string option;
    (*

    optional help string

    *)
}

This type represents a parameter whose value is a list of 'a.

type combo_param = {
  1. combo_label : string;
  2. mutable combo_value : string;
  3. combo_choices : string list;
  4. combo_editable : bool;
  5. combo_new_allowed : bool;
  6. combo_f_apply : string -> unit;
  7. combo_help : string option;
    (*

    optional help string

    *)
  8. combo_expand : bool;
    (*

    expand the entry widget or not

    *)
}
type custom_param = {
  1. custom_box : GPack.box;
  2. custom_f_apply : unit -> unit;
  3. custom_expand : bool;
  4. custom_framed : string option;
    (*

    optional label for an optional frame

    *)
}
type color_param = {
  1. color_label : string;
    (*

    the label of the parameter

    *)
  2. mutable color_value : string;
    (*

    the current value of the parameter

    *)
  3. color_editable : bool;
    (*

    indicates if the value can be changed

    *)
  4. color_f_apply : string -> unit;
    (*

    the function to call to apply the new value of the parameter

    *)
  5. color_help : string option;
    (*

    optional help string

    *)
  6. color_expand : bool;
    (*

    expand the entry widget or not

    *)
}
type date_param = {
  1. date_label : string;
    (*

    the label of the parameter

    *)
  2. mutable date_value : int * int * int;
    (*

    day, month, year

    *)
  3. date_editable : bool;
    (*

    indicates if the value can be changed

    *)
  4. date_f_string : (int * int * int) -> string;
    (*

    the function used to display the current value (day, month, year)

    *)
  5. date_f_apply : (int * int * int) -> unit;
    (*

    the function to call to apply the new value (day, month, year) of the parameter

    *)
  6. date_help : string option;
    (*

    optional help string

    *)
  7. date_expand : bool;
    (*

    expand the entry widget or not

    *)
}
type font_param = {
  1. font_label : string;
    (*

    the label of the parameter

    *)
  2. mutable font_value : string;
    (*

    the font name

    *)
  3. font_editable : bool;
    (*

    indicates if the value can be changed

    *)
  4. font_f_apply : string -> unit;
    (*

    the function to call to apply the new value of the parameter

    *)
  5. font_help : string option;
    (*

    optional help string

    *)
  6. font_expand : bool;
    (*

    expand the entry widget or not

    *)
}
type hotkey_param = {
  1. hk_label : string;
    (*

    the label of the parameter

    *)
  2. mutable hk_value : Gdk.Tags.modifier list * int;
    (*

    The value, as a list of modifiers and a key code

    *)
  3. hk_editable : bool;
    (*

    indicates if the value can be changed

    *)
  4. hk_f_apply : (Gdk.Tags.modifier list * int) -> unit;
    (*

    the function to call to apply the new value of the paramter

    *)
  5. hk_help : string option;
    (*

    optional help string

    *)
  6. hk_expand : bool;
    (*

    expand or not

    *)
}
val mk_custom_text_string_param : 'a string_param -> string string_param
type parameter_kind =
  1. | String_param of string string_param
  2. | List_param of unit -> < box : GObj.widget ; apply : unit >
  3. | Filename_param of string string_param
  4. | Bool_param of bool_param
  5. | Text_param of string string_param
  6. | Combo_param of combo_param
  7. | Custom_param of custom_param
  8. | Color_param of color_param
  9. | Date_param of date_param
  10. | Font_param of font_param
  11. | Hotkey_param of hotkey_param
  12. | Html_param of string string_param

This type represents the different kinds of parameters.

type configuration_structure =
  1. | Section of string * parameter_kind list
    (*

    label of the section, parameters

    *)
  2. | Section_list of string * configuration_structure list
    (*

    label of the section, list of the sub sections

    *)

This type represents the structure of the configuration window.

type return_button =
  1. | Return_apply
    (*

    The user clicked on Apply at least once before closing the window with Cancel or the window manager.

    *)
  2. | Return_ok
    (*

    The user closed the window with the ok button.

    *)
  3. | Return_cancel
    (*

    The user closed the window with the cancel button or the window manager but never clicked on the apply button.

    *)

To indicate what button was pushed by the user when the window is closed.

Bindings in the html editor

type html_binding = {
  1. mutable html_key : Gdk.Tags.modifier list * int;
  2. mutable html_begin : string;
  3. mutable html_end : string;
}
val htmlbinding_wrapper : html_binding Ocf.Wrapper.t
val htmlbinding_option : ?doc:string -> ?cb:(html_binding -> unit) -> html_binding -> html_binding Ocf.conf_option
OCaml

Innovation. Community. Security.