text
stringlengths
0
234
elsif Protocol_Name = "pointer_gestures_unstable_v1" then
Iterate_Over_Interfaces (Handle_Interface_Subprogram_Pointer_Gestures'Access);
Iterate_Over_Interfaces (Handle_Interface_Events_Pointer_Gestures'Access);
else
Iterate_Over_Interfaces (Handle_Interface_Common_Events'Access);
end if;
end Generate_Manually_Edited_Partial_Type_Declarations;
procedure Create_Wl_Thin_Spec_File (Protocol_Name : String) is
procedure Generate_Code_For_Interface_Constants is
procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is
Name : constant String
:= Xml_Parser_Utils.Adaify_Name
(Wayland_XML.Name (Interface_Tag) & "_Interface");
begin
if not Generate_Interfaces_For_Client and Protocol_Name = "client" then
Put_Line (File, " " & Name & " : aliased constant Interface_T");
Put_Line (File, " with Import, Convention => C, External_Name => """ & Wayland_XML.Name (Interface_Tag) & "_interface"";");
New_Line (File);
else
Put_Line (File, " " & Name & " : aliased constant Interface_T;");
end if;
end Handle_Interface;
begin
Iterate_Over_Interfaces (Handle_Interface'Access);
end Generate_Code_For_Interface_Constants;
procedure Generate_Private_Code_For_Interface_Constants is
type Partial_Match (Is_Match : Boolean) is record
case Is_Match is
when True => null;
when False => Index : Positive;
end case;
end record;
type Match (Is_Match : Boolean) is record
case Is_Match is
when False => null;
when True => Index : Positive;
end case;
end record;
function Contains_At_Index
(Index : Positive;
Vector, Sub_Vector : Unbounded_String_Vectors.Vector) return Partial_Match
is
use type SU.Unbounded_String;
begin
for Sub_Index in Sub_Vector.First_Index .. Sub_Vector.Last_Index loop
declare
Vector_Index : constant Positive := Index + (Sub_Index - Sub_Vector.First_Index);
begin
if Vector_Index > Vector.Last_Index or else Sub_Vector (Sub_Index) /= Vector (Vector_Index) then
return (Is_Match => False, Index => Sub_Index);
end if;
Function Definition: procedure Generate_Code_For_Interface_Ptrs is
Function Body: procedure Handle_Interface (Interface_Tag : aliased Wayland_XML.Interface_Tag) is
Interface_Ptr_Name : constant String :=
Xml_Parser_Utils.Adaify_Name (Name (Interface_Tag)) & "_Ptr";
begin
if Interface_Ptr_Name /= "Display_Ptr" then
Put_Line (File, " type " & Interface_Ptr_Name & " is new Proxy_Ptr;");
New_Line (File);
end if;
end Handle_Interface;
begin
Iterate_Over_Interfaces (Handle_Interface'Access);
end Generate_Code_For_Interface_Ptrs;
procedure Generate_Code_For_Each_Interface is
procedure Handle_Interface
(Interface_Tag : aliased Wayland_XML.Interface_Tag)
is
procedure Generate_Code_For_Subprogram_Ptrs is
procedure Generate_Code_For_Subprogram
(Event_Tag : aliased Wayland_XML.Event_Tag)
is
V : Wayland_XML.Event_Child_Vectors.Vector;
Subprogram_Name : constant String
:= Xml_Parser_Utils.Adaify_Name
(Name (Interface_Tag) & "_" & Name (Event_Tag) & "_Subprogram_Ptr");
Interface_Name : constant String
:= Xml_Parser_Utils.Adaify_Name (Name (Interface_Tag));
begin
for Child of Wayland_XML.Children (Event_Tag) loop
if Child.Kind_Id = Child_Arg then
V.Append (Child);
end if;
end loop;
declare
Max_Name_Length : Natural := Interface_Name'Length;
Dont_Care : String_Maps.Map;
begin
for Child of V loop