--------------------------------------------- ----------------------------------- -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . D I A . P R I N T E R . M I S C -- -- -- -- S p e c -- -- -- -- Copyright (C) 2005-2006, GET-Telecom Paris. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- -- Free Software Foundation; either version 2, or (at your option) any -- -- later version. Ocarina 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 distributed with Ocarina; see file COPYING. -- -- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth -- -- Floor, Boston, MA 02111-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Ocarina is maintained by the Ocarina team -- -- (ocarina-users@listes.enst.fr) -- -- -- ------------------------------------------------------------------------------ with DOM.Core; package Ocarina.Dia.Printer.Misc is -- Defining the record field Point type point is record X : Float; Y : Float; end record; function Print_Point (Pt : in point) return String; function Add_Points (Pt1 : in point; Pt2 : in point) return point; function String_To_Point (Im : String) return point; -- Defining the record field Rectangle type rectangle is record TL : point; BR : point; end record; function Print_Rectangle (Rect : in rectangle) return String; -- this function adds a point connection to an object, which -- XML_Node is given. it count the number of connection in the -- object, including those which belong to the ports then return -- ne number of the connection function Add_Point_Connection (Doc : DOM.Core.document; XML_Node : DOM.Core.node) return Integer; -- this function finds the XML Node corresponding to an object -- which has already been inserted in the XML Tree. function Find_Node (Doc : DOM.Core.document; Node : node_id) return DOM.Core.node; -- this function returns the name of a port function Get_Name_Of_XML_Port (XML_Node : DOM.Core.node) return String; -- I is the Id function Find_Node (Doc : DOM.Core.document; I : String) return DOM.Core.node; -- this function finds the XML Node corresponding -- to the Value of an object inserted -- in the XML Tree. function Find_Node_Value (XML_Node : DOM.Core.node; Value_Type : String; Value : String) return DOM.Core.node; -- this function returns the Id of an XML object function Id (Node : DOM.Core.node) return String; -- The following subprograms are not part of the standard DOM -- interface. However, they are needed for a full usage of this -- DOM implementation procedure Print (Prefix : String; N : DOM.Core.node; Print_Comments : Boolean := False; Print_XML_PI : Boolean := False; With_URI : Boolean := False); -- Print the contents of Node and its children in XML format. If -- Print_Comments is True, then nodes associated with comments are -- also displayed. By default, names are of the form -- ns_prefix:local_name. However, if with_URI is True, names will -- be ns_URI:local_name instead procedure Print (Prefix : String; List : DOM.Core.node_list; Print_Comments : Boolean := False; Print_XML_PI : Boolean := False; With_URI : Boolean := False); -- Same as Print, byt for all the nodes in the list. -- this function remove the first element of the String function Remove_First_Space (input : String) return String; -- this function convert an Integer in a String function Integer_To_String (input : Integer) return String; -- this function convert a Float in a String function Float_To_String (input : Float) return String; end Ocarina.Dia.Printer.Misc;