text stringlengths 0 234 |
|---|
(Tag : aliased Aida.Deepend.XML_DOM_Parser.XML_Tag) is |
begin |
for A of Attributes (Tag) loop |
if Name (A.all) = "name" then |
Set_Name (Arg_Tag.all, Value (A.all)); |
elsif Name (A.all) = "type" then |
Set_Type_Attribute (Arg_Tag.all, Value (A.all)); |
elsif Name (A.all) = "summary" then |
Set_Summary (Arg_Tag.all, Value (A.all)); |
elsif Name (A.all) = "interface" then |
Set_Interface_Attribute (Arg_Tag.all, Value (A.all)); |
elsif Name (A.all) = "allow-null" then |
if Value (A.all) = "true" then |
Set_Allow_Null (Arg_Tag.all, True); |
elsif Value (A.all) = "false" then |
Set_Allow_Null (Arg_Tag.all, False); |
else |
raise XML_Exception with |
"Attribute 'allow-null' must be 'true' or 'false'"; |
end if; |
elsif Name (A.all) = "enum" then |
Set_Enum (Arg_Tag.all, Value (A.all)); |
else |
raise XML_Exception; |
end if; |
end loop; |
end Iterate; |
begin |
Iterate (Node.Tag); |
return Arg_Tag; |
end Identify_Arg; |
function Identify_Request |
(Node : not null Aida.Deepend.XML_DOM_Parser.Node_Ptr) |
return not null Wayland_XML.Request_Tag_Ptr |
is |
Request_Tag : constant not null Wayland_XML.Request_Tag_Ptr |
:= new Wayland_XML.Request_Tag; |
procedure Iterate |
(Tag : aliased Aida.Deepend.XML_DOM_Parser.XML_Tag) is |
begin |
for A of Attributes (Tag) loop |
if Name (A.all) = "name" then |
Set_Name (Request_Tag.all, Value (A.all)); |
elsif Name (A.all) = "type" then |
Set_Type_Attribute (Request_Tag.all, Value (A.all)); |
elsif Name (A.all) = "since" then |
declare |
V : Integer; |
Has_Failed : Boolean; |
begin |
Aida.To_Integer (Value (A.all), V, Has_Failed); |
if Has_Failed then |
raise XML_Exception; |
else |
Set_Since |
(Request_Tag.all, |
Wayland_XML.Version_Number (V)); |
end if; |
Function Definition: procedure Generate_Code_For_Opcodes is |
Function Body: I : Integer := 0; |
procedure Generate_Code |
(Request_Tag : aliased Wayland_XML.Request_Tag) |
is |
Name : constant String |
:= Xml_Parser_Utils.Adaify_Name |
(Wayland_XML.Name (Interface_Tag) & "_" & |
Wayland_XML.Name (Request_Tag)); |
begin |
if I = 0 then |
New_Line (File); |
end if; |
Put_Line (File, " " & Name & " : constant := " & Aida.To_String (I) & ";"); |
I := I + 1; |
end Generate_Code; |
begin |
Iterate_Over_Requests (Interface_Tag, Generate_Code'Access); |
end Generate_Code_For_Opcodes; |
begin |
Generate_Code_For_Opcodes; |
-- Note: See git history for *_Since_Version constants |
end Handle_Interface; |
begin |
Iterate_Over_Interfaces (Handle_Interface'Access); |
end Generate_Code_For_Numeric_Constants; |
All_Types : Unbounded_String_Vectors.Vector; |
procedure Create_Wayland_Spec_File (Enable_Comments : Boolean) is |
File : Ada.Text_IO.File_Type; |
procedure Create_Wl_Thin_Spec_File (Protocol_Name : String); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.