protected ClassBase (XmlElement ns, XmlElement elem) : base (ns, elem) { deprecated = elem.GetAttributeAsBoolean ("deprecated"); isabstract = elem.GetAttributeAsBoolean ("abstract"); foreach (XmlNode node in elem.ChildNodes) { if (!(node is XmlElement)) continue; XmlElement member = (XmlElement) node; if (member.GetAttributeAsBoolean ("hidden")) continue; string name; switch (node.Name) { case "method": name = member.GetAttribute("name"); while (methods.ContainsKey(name)) name += "mangled"; methods.Add (name, new Method (member, this)); break; case "property": name = member.GetAttribute("name"); while (props.ContainsKey(name)) name += "mangled"; props.Add (name, new Property (member, this)); break; case "field": name = member.GetAttribute("name"); while (fields.ContainsKey (name)) name += "mangled"; fields.Add (name, new ObjectField (member, this)); break; case "implements": ParseImplements (member); break; case "constructor": ctors.Add (new Ctor (member, this)); break; case "constant": name = member.GetAttribute ("name"); constants.Add (name, new Constant (member)); break; default: break; } } }
public ReturnValue(XmlElement elem) { if (elem != null) { is_null_term = elem.GetAttributeAsBoolean ("null_term_array"); is_array = elem.GetAttributeAsBoolean ("array") || elem.HasAttribute ("array_length_param"); array_length_param = elem.GetAttribute ("array_length_param"); elements_owned = elem.GetAttributeAsBoolean ("elements_owned"); owned = elem.GetAttributeAsBoolean ("owned"); ctype = elem.GetAttribute("type"); default_value = elem.GetAttribute ("default_value"); element_ctype = elem.GetAttribute ("element_type"); } }
public Method (XmlElement elem, ClassBase container_type) : base (elem, container_type) { this.retval = new ReturnValue (elem["return-type"]); if (!container_type.IsDeprecated) { deprecated = elem.GetAttributeAsBoolean ("deprecated"); } win32_utf8_variant = elem.GetAttributeAsBoolean ("win32_utf8_variant"); if (Name == "GetType") Name = "GetGType"; }
public Ctor (XmlElement elem, ClassBase implementor) : base (elem, implementor) { preferred = elem.GetAttributeAsBoolean ("preferred"); if (implementor is ObjectGen) needs_chaining = true; name = implementor.Name; }
public InterfaceGen (XmlElement ns, XmlElement elem) : base (ns, elem, true) { consume_only = elem.GetAttributeAsBoolean ("consume_only"); foreach (XmlNode node in elem.ChildNodes) { if (!(node is XmlElement)) continue; XmlElement member = (XmlElement) node; switch (member.Name) { case "signal": object sig = sigs [member.GetAttribute ("name")]; if (sig == null) sig = new Signal (node as XmlElement, this); break; default: if (!base.IsNodeNameHandled (node.Name)) new LogWriter (QualifiedName).Warn ("Unexpected node " + node.Name); break; } } }
protected MethodBase (XmlElement elem, ClassBase container_type) { this.elem = elem; this.container_type = container_type; this.name = elem.GetAttribute ("name"); parms = new Parameters (elem ["parameters"]); IsStatic = elem.GetAttribute ("shared") == "true"; if (elem.GetAttributeAsBoolean ("new_flag")) mods = "new "; if (elem.HasAttribute ("accessibility")) { string attr = elem.GetAttribute ("accessibility"); switch (attr) { case "public": case "protected": case "internal": case "private": case "protected internal": protection = attr; break; } } }
VirtualMethod AddVM(XmlElement vm_elem, bool is_signal_vm, bool is_interface) { VirtualMethod vm; if (is_signal_vm) vm = new DefaultSignalHandler (vm_elem, this); else if (is_interface) { string target_name = vm_elem.HasAttribute ("target_method") ? vm_elem.GetAttribute ("target_method") : vm_elem.GetAttribute ("name"); vm = new InterfaceVM (vm_elem, methods [target_name] as Method, this); } else vm = new GObjectVM (vm_elem, this); if (vm_elem.GetAttributeAsBoolean ("padding") || vm_elem.GetAttributeAsBoolean ("hidden")) hidden_vms.Add (vm); else { if (vm is GObjectVM) virtual_methods.Add (vm); else interface_vms.Add (vm); } if (vm.CName != "") class_members.Add (vm); return vm; }
public ArrayParameter(XmlElement elem) : base(elem) { null_terminated = elem.GetAttributeAsBoolean ("null_term_array"); }
public ArrayParameter (XmlElement elem) : base (elem) { null_terminated = elem.GetAttributeAsBoolean ("null_term_array"); if (elem.HasAttribute ("array_len")) FixedArrayLength = Int32.Parse (elem.GetAttribute ("array_len")); }