text stringlengths 0 234 |
|---|
procedure Generate_Code_For_Protocol_Tag_Children is |
procedure Handle_Interface |
(Interface_Tag : aliased Wayland_XML.Interface_Tag) |
is |
procedure Generate_Code_For_Add_Listener_Subprogram_Implementations (Name : String) is |
Ptr_Listener_Name : constant String := Name & "_Listener_Ptr"; |
begin |
Generate_Pretty_Code_For_Subprogram |
(File, Implementation, Interface_Tag, "Add_Listener", "Interfaces.C.int", |
((+"Listener", +Ptr_Listener_Name), |
(+"Data", +"Void_Ptr"))); |
Put_Line (File, " begin"); |
Put_Line (File, " return Wayland.API.Proxy_Add_Listener"); |
Put_Line (File, " (" & Name & ".all, Listener.all'Address, Data);"); |
Put_Line (File, " end " & Name & "_Add_Listener;"); |
end Generate_Code_For_Add_Listener_Subprogram_Implementations; |
procedure Generate_Code_For_Set_User_Data_Subprogram_Implementations (Name : String) is |
begin |
Generate_Pretty_Code_For_Subprogram |
(File, Implementation, Interface_Tag, "Set_User_Data", "", |
(1 => (+"Data", +"Void_Ptr"))); |
Put_Line (File, " begin"); |
Put_Line (File, " Wayland.API.Proxy_Set_User_Data (" & Name & ".all, Data);"); |
Put_Line (File, " end " & Name & "_Set_User_Data;"); |
end Generate_Code_For_Set_User_Data_Subprogram_Implementations; |
procedure Generate_Code_For_Get_User_Data_Subprogram_Implementations (Name : String) is |
begin |
Generate_Pretty_Code_For_Subprogram |
(File, Implementation, Interface_Tag, "Get_User_Data", "Void_Ptr"); |
Put_Line (File, " begin"); |
Put_Line (File, " return Wayland.API.Proxy_Get_User_Data (" & Name & ".all);"); |
Put_Line (File, " end " & Name & "_Get_User_Data;"); |
end Generate_Code_For_Get_User_Data_Subprogram_Implementations; |
procedure Generate_Code_For_Get_ID_Subprogram_Implementations (Name : String) is |
begin |
Generate_Pretty_Code_For_Subprogram |
(File, Implementation, Interface_Tag, "Get_ID", "Unsigned_32"); |
Put_Line (File, " begin"); |
Put_Line (File, " return Wayland.API.Proxy_Get_Id (" & Name & ".all);"); |
Put_Line (File, " end " & Name & "_Get_ID;"); |
end Generate_Code_For_Get_ID_Subprogram_Implementations; |
procedure Generate_Code_For_Get_Version_Subprogram_Implementations (Name : String) is |
begin |
Generate_Pretty_Code_For_Subprogram |
(File, Implementation, Interface_Tag, "Get_Version", "Unsigned_32"); |
Put_Line (File, " begin"); |
Put_Line (File, " return Wayland.API.Proxy_Get_Version (" & Name & ".all);"); |
Put_Line (File, " end " & Name & "_Get_Version;"); |
end Generate_Code_For_Get_Version_Subprogram_Implementations; |
procedure Generate_Code_For_Destroy_Subprogram_Implementations (Name : String) is |
begin |
Generate_Pretty_Code_For_Subprogram |
(File, Implementation, Interface_Tag, "Destroy", ""); |
Put_Line (File, " begin"); |
Put_Line (File, " Wayland.API.Proxy_Destroy (" & Name & ".all);"); |
Put_Line (File, " end " & Name & "_Destroy;"); |
end Generate_Code_For_Destroy_Subprogram_Implementations; |
procedure Generate_Code_For_Requests is |
procedure Generate_Code_For_Subprogram_Implementation |
(Request_Tag : aliased Wayland_XML.Request_Tag) |
is |
Request_Name : constant String := |
Xml_Parser_Utils.Adaify_Name (Name (Request_Tag)); |
Subprogram_Name : constant String |
:= Xml_Parser_Utils.Adaify_Name |
(Name (Interface_Tag) & "_" & Request_Name); |
Opcode : constant String := "Constants." & Subprogram_Name; |
Name : constant String |
:= Xml_Parser_Utils.Adaify_Name |
(Wayland_XML.Name (Interface_Tag)); |
Ptr_Name : constant String |
:= Xml_Parser_Utils.Adaify_Name |
(Wayland_XML.Name (Interface_Tag) & "_Ptr"); |
procedure Generate_Arguments (Spaces : Natural; Null_Id : Boolean) is |
use SF; |
function Get_Value (Child : Wayland_XML.Arg_Tag; Value : String) return String is |
(if Exists_Enum (Child) then "Convert (" & Value & ")" else Value); |
First_Element : Boolean := True; |
begin |
for Child of Children (Request_Tag) loop |
if Child.Kind_Id = Child_Arg then |
if not First_Element then |
Put_Line (File, ","); |
end if; |
First_Element := False; |
if Type_Attribute (Child.Arg_Tag.all) /= Type_Object then |
if Type_Attribute (Child.Arg_Tag.all) = Type_New_Id then |
if Null_Id then |
Put (File, Spaces * " " & "0"); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.