package frama-c

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Gtk_helper.ConfigurationSource

Configuration module for the GUI: all magic visual constants should use this mechanism (window width, ratios, ...).

  • since Carbon-20101201
type configData =
  1. | ConfInt of int
  2. | ConfBool of bool
  3. | ConfFloat of float
  4. | ConfString of string
  5. | ConfList of configData list
Sourceval load : unit -> unit
Sourceval save : unit -> unit
Sourceval reset : unit -> unit
Sourceval set : string -> configData -> unit

Set a configuration element, with a key. Overwrites the previous values

Sourceval find : string -> configData

Find a configuration elements, given a key. Raises Not_found if it cannot find it

Sourceval find_int : ?default:int -> string -> int

Like find but extracts the integer. Raises Not_found if the key is found but is not an integer. Raises Not_found if no default is given and the key is not found. If a default is given and the key is not found then the default value is stored for the given key and returned.

Sourceval use_int : string -> (int -> unit) -> unit

Looks for an integer configuration element, and if it is found, it is given to the given function. Otherwise, does nothing

Sourceval set_int : string -> int -> unit

Sets a ConfigInt

Sourceval find_bool : ?default:bool -> string -> bool

Same as find_int.

Sourceval use_bool : string -> (bool -> unit) -> unit

Same as use_int.

Sourceval set_bool : string -> bool -> unit

Sets a ConfigBool

Sourceval find_float : ?default:float -> string -> float

Same as find_int.

Sourceval use_float : string -> (float -> unit) -> unit

Same as use_int.

Sourceval set_float : string -> float -> unit

Sets a ConfigFloat

Sourceval find_string : ?default:string -> string -> string

Same as find_int.

Sourceval use_string : string -> (string -> unit) -> unit

Same as use_int.

Sourceval find_list : string -> configData list
Sourceval use_list : string -> (configData list -> unit) -> unit
Sourceval set_list : string -> configData list -> unit

Helpers to connect widgets to configuration values. The configuration value is first pushed to the widget using method #set, or the ~default value is used instead.

Then, a callback is registered into the widget via #connect such that subsequent values from user's action are saved back into the configuration file.

Sourceclass type 'a selector = object ... end

Abstract interface to the connected widget. This API is consistent with the Widget ones.

Sourceval config_int : key:string -> default:int -> int selector -> unit
Sourceval config_bool : key:string -> default:bool -> bool selector -> unit
Sourceval config_string : key:string -> default:string -> string selector -> unit
Sourceval config_float : key:string -> default:float -> float selector -> unit
Sourceval config_values : key:string -> default:'a -> values:('a * string) list -> 'a selector -> unit

The values field is used as a dictionary of available values. They are compared with Stdlib.(=).

OCaml

Innovation. Community. Security.