------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real-time scheduling analysis tool. -- This program provides services to automatically check schedulability and -- other performance criteria of real-time architecture models. -- -- Copyright (C) 2002-2020, Frank Singhoff, Alain Plantec, Jerome Legrand, -- Hai Nam Tran, Stephane Rubini -- -- The Cheddar project was started in 2002 by -- Frank Singhoff, Lab-STICC UMR 6285, Université de Bretagne Occidentale -- -- Cheddar has been published in the "Agence de Protection des Programmes/France" in 2008. -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- The full list of contributors and sponsors can be found in AUTHORS.txt and SPONSORS.txt -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program 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 General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- -- Contact : cheddar@listes.univ-brest.fr -- ------------------------------------------------------------------------------ -- Last update : -- $Rev$ -- $Date$ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Gtk.Text_Iter; use Gtk.Text_Iter; with Ada.Text_IO; use Ada.Text_IO; with unbounded_strings; use unbounded_strings; with Glib; use Glib; with Glib.Object; use Glib.Object; with Gtk.Text_Buffer; use Gtk.Text_Buffer; with Gtk.Text_Tag_Table; use Gtk.Text_Tag_Table; with Gtk.Text_Tag; use Gtk.Text_Tag; with Gdk.Color; use Gdk.Color; with task_set; use task_set; use task_set.generic_task_set; package body graphical_editor.message_text is iter : gtk_text_iter; line_number : Integer := 0; tag : gtk_text_tag; color : gdk_color := Parse ("red"); procedure write_title (response_list : in framework_response_table) is begin Get_Iter_At_Line (buffer_editor_cheddar, iter, gint (line_number)); Insert_With_Tags_By_Name (buffer_editor_cheddar, iter, To_String (response_list.entries (0).title), "red"); line_number := line_number - 1; end write_title; procedure write_text (response_list : in framework_response_table) is begin for j in 0 .. response_list.nb_entries - 1 loop Get_Iter_At_Line (buffer_editor_cheddar, iter, gint (line_number)); Insert (buffer_editor_cheddar, iter, To_String (response_list.entries (j).text)); line_number := line_number - 1; end loop; end write_text; procedure write_text (msg : in String) is begin Get_Iter_At_Line (buffer_editor_cheddar, iter, gint (line_number)); Insert (buffer_editor_cheddar, iter, msg); line_number := line_number - 1; end write_text; procedure write_title_and_text (response_list : in framework_response_table) is begin for j in 0 .. response_list.nb_entries - 1 loop Get_Iter_At_Line (buffer_editor_cheddar, iter, gint (line_number)); Insert_With_Tags_By_Name (buffer_editor_cheddar, iter, To_String (response_list.entries (j).title), "red"); line_number := line_number - 1; Get_Iter_At_Line (buffer_editor_cheddar, iter, gint (line_number)); Insert (buffer_editor_cheddar, iter, To_String (response_list.entries (j).text)); line_number := line_number - 1; end loop; end write_title_and_text; procedure initialize_message_text_properties is begin Alloc (Get_Default_Colormap, color); tag := Create_Tag (buffer_editor_cheddar, "red"); Set_Property (tag, Foreground_Gdk_Property, color); end initialize_message_text_properties; procedure starting_text is begin if (get_number_of_elements (sys.tasks) = 0) then Set_Text (buffer_editor_cheddar, "- No task set ready to analyse : load a model from the 'File' menu, or edit task set from the 'Edit' menu." & To_String (unbounded_lf)); else Set_Text (buffer_editor_cheddar, "- Task set ready to analyse : run analysis from the 'Tools' menu." & To_String (unbounded_lf)); end if; end starting_text; end graphical_editor.message_text;