Verified Commit aee266c9 authored by Daniel García Moreno's avatar Daniel García Moreno Committed by Jordan Petridis

gir: Generate the class record

parent 828d5b65
......@@ -74,12 +74,7 @@ pub fn generate_gir(class: &Class) -> Result<()> {
// closing class
w.write(XmlEvent::end_element())?;
// TODO: add Class records here
// <record name="CounterClass"
// c:type="CounterClass"
// disguised="1"
// glib:is-gtype-struct-for="Counter">
// </record>
gen_record_xml(&mut w, &names)?;
// closing namespace
w.write(XmlEvent::end_element())?;
......@@ -179,3 +174,18 @@ fn type_to_ctype(type_: &Ty) -> String {
}
}
fn gen_record_xml(w: &mut EventWriter<&mut File>, names: &Names) -> Result<()> {
// <record name="CounterClass"
// c:type="CounterClass"
// disguised="1"
// glib:is-gtype-struct-for="Counter">
// </record>
w.write(XmlEvent::start_element("record")
.attr("name", &names.vtable().to_string())
.attr("disguised", "1")
.attr("glib:is-gtype-struct-for", &names.instance().to_string())
)?;
w.write(XmlEvent::end_element())?;
Ok(())
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment