let main (main_ui:Design.main_window_extension_points) =
reset main_ui;
let value_selector
menu (main_ui:Design.main_window_extension_points) ~button localizable =
to_do_on_select
menu
main_ui
button
localizable
in
main_ui#register_source_selector value_selector;
let highlighter (buffer:GSourceView2.source_buffer) localizable ~start ~stop =
Extlib.may
(fun loc ->
if Cilutil.equals localizable loc then
let orange_area = make_tag
buffer
~name:"degeneration"
[`BACKGROUND "orange" ]
in
apply_tag buffer orange_area start stop)
(DegeneratedHighlighted.get ());
if Db.Value.is_computed () then
let ki = match localizable with
| PStmt (_,stmt) | PCodeAnnot (_,stmt,_) -> Kstmt stmt
| PLval (_,ki,_) | PTermLval(_,ki,_) | PAssigns (_,ki,_,_)
| PPredicate (_,ki,_)
| PPost_cond (_,ki,_,_)
| PAssumes (_,ki,_,_) | PDisjoint_behaviors (_,ki,_)
| PComplete_behaviors (_,ki,_)
| PTerminates (_,ki,_)| PVariant (_,ki,_)| PRequires (_,ki,_,_) -> ki
| PVDecl _ | PGlobal _ | PBehavior _ -> Kglobal
in
if not (Value.is_accessible ki) then
let dead_code_area =
make_tag
buffer
"deadcode"
[`BACKGROUND "tomato";
`STRIKETHROUGH true;
`STYLE `ITALIC;]
in
apply_tag buffer dead_code_area start stop
in
main_ui#register_source_highlighter highlighter