123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990(**************************************************************************)(* *)(* This file is part of Frama-C. *)(* *)(* Copyright (C) 2007-2023 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* alternatives) *)(* *)(* you can redistribute it and/or modify it under the terms of the GNU *)(* Lesser General Public License as published by the Free Software *)(* Foundation, version 2.1. *)(* *)(* It is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Lesser General Public License for more details. *)(* *)(* See the GNU Lesser General Public License version 2.1 *)(* for more details (enclosed in the file licenses/LGPLv2.1). *)(* *)(**************************************************************************)letscope=function|None->"Global"|Somes->Format.asprintf"%a"Cil_datatype.Position.prettystyperow=Log.eventtypet={append:row->unit;clear:unit->unit;}moduleData=Indexer.Make(structtypet=int*rowletcompare(x,_)(y,_)=Stdlib.comparexyend)letmake~packing~callback=letmodel=object(self)valmutablem=Data.emptyvalmutableage=0methoddata=mmethodsize=Data.sizemmethodindexi=Data.indeximmethodgeti=Data.getimmethodaddi=age<-age+1;m<-Data.add(age,i)m;age,imethodreload=age<-0;m<-Data.emptymethodcoerce=(self:>(int*row)Wtable.listmodel)endinletw=newWtable.list~packing~headers:true~rules:truemodel#coerceinletappende=w#insert_row(model#adde)inletclear()=(* Post a reload request before clearing.
The current model is used to know how many rows
must be deleted. *)w#reload;inletopenLoginlet_=w#add_column_pixbuf~title:"Kind"[`YALIGN0.0;`XALIGN0.5](fun(_,e)->matchewith|{evt_kind=Error}->[`STOCK_ID"gtk-dialog-error"]|{evt_kind=Warning}->[`STOCK_ID"gtk-dialog-warning"]|_->[`STOCK_ID"gtk-dialog-info"])inlet_=w#add_column_text~title:"Source"[`YALIGN0.0](fun(_,{evt_source=src})->[`TEXT(scopesrc)])inlet_=w#add_column_text~title:"Plugin"[`YALIGN0.0](fun(_,{evt_plugin=m})->[`TEXTm])inlet_=w#add_column_text~title:"Message"[`YALIGN0.0;`EDITABLEtrue](fun(_,{evt_message=m})->[`TEXTm])inw#on_click(fun(_,w)c->callbackwc);{append=append;clear=clear}letappendtmessage=t.appendmessageletcleart=t.clear()(*
Local Variables:
compile-command: "make -C ../../.."
End:
*)