Frama-C API - t
Return true
if the filetree currently displays all globals in flat mode (all children of the same node), false
otherwise (children of the file they are declared in). If true
, the methods set_file_attribute
and get_files_globals
must not be used
method set_file_attribute : ?strikethrough:bool -> ?text:string -> Frama_c_kernel.Datatype.Filepath.t -> unit
Manually set some attributes of the given filename.
method set_global_attribute : ?strikethrough:bool -> ?text:string -> Frama_c_kernel.Cil_types.varinfo -> unit
Manually set some attributes of the given variable.
method add_global_filter : text:string -> key:string -> (Frama_c_kernel.Cil_types.global -> bool) -> (unit -> bool) * GMenu.check_menu_item
add_global_filter text key f
adds a filter for the visibility of the globals, according to f
. If any of the filters registered through this method returns true, the global is not displayed in the filetree. text
is used in the filetree menu, to label the entry permitting to activate or deactivate the filter. key
is used to store the current state of the filter internally. The created menu is returned.
method get_file_globals : Frama_c_kernel.Datatype.Filepath.t -> (string * bool) list
Return the names and the attributes (currently only the strikethrough property) of the globals in the file passed as argument
method find_visible_global : string -> Frama_c_kernel.Cil_types.global option
find_visible_global str
searches for the next occurrence of a visible global whose name contains str
, starting at the currently selected element. Returns the global found (if any).
method add_select_function : (was_activated:bool -> activating:bool -> filetree_node -> unit) -> unit
Register a callback that is called whenever an element of the file tree is selected or unselected.
method append_text_column : title:string -> tooltip:string -> visible:(unit -> bool) -> text:(Frama_c_kernel.Cil_types.global -> string) -> ?sort: (Frama_c_kernel.Cil_types.global -> Frama_c_kernel.Cil_types.global -> int) -> [ `Visibility | `Contents ] -> unit
append_text_column ~title ~tooltip ~visible ~text ~sort
appends a new column with name title
to the file tree, and registers text
as a callback computing the text for each global variable. The column is displayed when visible
returns true. Rows of the filetree can be sorted according to sort
, if it is provided. Otherwise, they can be sorted according to the alphabetical order established by text
. The returned function can be used to force an update on the display of the column. `Visibility
means that the column must be shown or hidden. `Contents
means what it contains has changed.
method append_pixbuf_column : title:string -> (Frama_c_kernel.Cil_types.global list -> GTree.cell_properties_pixbuf list) -> (unit -> bool) -> [ `Visibility | `Contents ] -> unit
append_pixbuf_column title f visible
appends a new column with name title
to the file tree and registers f
as a callback computing the list of properties for this column. Do not forget that properties need to be set and unset explicitly. The argument visible
is used by the column to decide whether it should appear. The returned function can be used to force an update on the display of the column `Visibility
means that the column must be show or hidden. `Contents
means what it contains has changed.
method select_global : Frama_c_kernel.Cil_types.global -> bool
Selects the given global in the tree view and run the associated callbacks. Return a boolean indicating whether the selection succeeded. (Currently, only variables and functions can be selected, provided they are not filtered out.) Unless you known what your are doing, prefer calling main_ui#select_or_display_global
, which is more resilient to globals not displayed in the filetree.
method selected_globals : Frama_c_kernel.Cil_types.global list
Resynchronize the tree view with the current project state. This is called in particular by the generic reset extension of Design
method register_reset_extension : (t -> unit) -> unit
Register a function to be called whenever the reset method of the filetree is called.