public override void visit_interface (Interface iface) {
base.visit_interface (iface);
- var dbus = iface.get_attribute ("DBus");
- if (dbus == null) {
- return;
- }
- string dbus_iface_name = dbus.get_string ("name");
+ string dbus_iface_name = get_dbus_name (iface);
if (dbus_iface_name == null) {
return;
}
}
public override TypeRegisterFunction create_interface_register_function (Interface iface) {
- var dbus = iface.get_attribute ("DBus");
- if (dbus == null) {
- return new InterfaceRegisterFunction (iface, context);
- }
-
- string dbus_iface_name = dbus.get_string ("name");
+ string dbus_iface_name = get_dbus_name (iface);
if (dbus_iface_name == null) {
return new InterfaceRegisterFunction (iface, context);
}
}
void handle_signals (Interface iface, CCodeBlock block) {
- string dbus_iface_name = iface.get_attribute ("DBus").get_string ("name");
+ string dbus_iface_name = get_dbus_name (iface);
CCodeIfStatement clastif = null;
foreach (Signal sig in iface.get_signals ()) {
string generate_dbus_proxy_method (Interface iface, Method m) {
string proxy_name = "%sdbus_proxy_%s".printf (iface.get_lower_case_cprefix (), m.name);
- string dbus_iface_name = iface.get_attribute ("DBus").get_string ("name");
+ string dbus_iface_name = get_dbus_name (iface);
CCodeDeclaration cdecl;
string generate_async_dbus_proxy_method (Interface iface, Method m) {
string proxy_name = "%sdbus_proxy_%s_async".printf (iface.get_lower_case_cprefix (), m.name);
- string dbus_iface_name = iface.get_attribute ("DBus").get_string ("name");
+ string dbus_iface_name = get_dbus_name (iface);
CCodeDeclaration cdecl;
string generate_finish_dbus_proxy_method (Interface iface, Method m) {
string proxy_name = "%sdbus_proxy_%s_finish".printf (iface.get_lower_case_cprefix (), m.name);
- string dbus_iface_name = iface.get_attribute ("DBus").get_string ("name");
+ string dbus_iface_name = get_dbus_name (iface);
CCodeDeclaration cdecl;
string generate_dbus_proxy_property_get (Interface iface, Property prop) {
string proxy_name = "%sdbus_proxy_get_%s".printf (iface.get_lower_case_cprefix (), prop.name);
- string dbus_iface_name = iface.get_attribute ("DBus").get_string ("name");
+ string dbus_iface_name = get_dbus_name (iface);
var owned_type = prop.get_accessor.value_type.copy ();
owned_type.value_owned = true;
string generate_dbus_proxy_property_set (Interface iface, Property prop) {
string proxy_name = "%sdbus_proxy_set_%s".printf (iface.get_lower_case_cprefix (), prop.name);
- string dbus_iface_name = iface.get_attribute ("DBus").get_string ("name");
+ string dbus_iface_name = get_dbus_name (iface);
var array_type = prop.set_accessor.value_type as ArrayType;
}
}
- var dbus = sym.get_attribute ("DBus");
- if (dbus == null) {
- return result;
- }
- string dbus_iface_name = dbus.get_string ("name");
+ string dbus_iface_name = get_dbus_name (sym);
if (dbus_iface_name == null) {
return result;
}
}
void handle_signals (ObjectTypeSymbol sym, CCodeBlock block) {
- var dbus = sym.get_attribute ("DBus");
- if (dbus == null) {
- return;
- }
- string dbus_iface_name = dbus.get_string ("name");
+ string dbus_iface_name = get_dbus_name (sym);
if (dbus_iface_name == null) {
return;
}
handle_method ("org.freedesktop.DBus.Introspectable", "Introspect", generate_dbus_introspect (sym), block, ref clastif);
- var dbus = sym.get_attribute ("DBus");
- if (dbus != null) {
- string dbus_iface_name = dbus.get_string ("name");
- if (dbus_iface_name != null) {
- bool need_property_get = false;
- bool need_property_set = false;
- foreach (Property prop in sym.get_properties ()) {
- if (prop.binding != MemberBinding.INSTANCE
- || prop.overrides || prop.access != SymbolAccessibility.PUBLIC) {
- continue;
- }
- if (!is_dbus_visible (prop)) {
- continue;
- }
- if (prop.get_accessor != null) {
- need_property_get = true;
- }
- if (prop.set_accessor != null) {
- need_property_set = true;
- }
+ string dbus_iface_name = get_dbus_name (sym);
+ if (dbus_iface_name != null) {
+ bool need_property_get = false;
+ bool need_property_set = false;
+ foreach (Property prop in sym.get_properties ()) {
+ if (prop.binding != MemberBinding.INSTANCE
+ || prop.overrides || prop.access != SymbolAccessibility.PUBLIC) {
+ continue;
}
-
- if (need_property_get) {
- handle_method ("org.freedesktop.DBus.Properties", "Get", generate_dbus_property_get_wrapper (sym, dbus_iface_name), block, ref clastif);
+ if (!is_dbus_visible (prop)) {
+ continue;
}
- if (need_property_set) {
- handle_method ("org.freedesktop.DBus.Properties", "Set", generate_dbus_property_set_wrapper (sym, dbus_iface_name), block, ref clastif);
+ if (prop.get_accessor != null) {
+ need_property_get = true;
}
- handle_method ("org.freedesktop.DBus.Properties", "GetAll", generate_dbus_property_get_all_wrapper (sym, dbus_iface_name), block, ref clastif);
+ if (prop.set_accessor != null) {
+ need_property_set = true;
+ }
+ }
- handle_methods (sym, dbus_iface_name, block, ref clastif);
+ if (need_property_get) {
+ handle_method ("org.freedesktop.DBus.Properties", "Get", generate_dbus_property_get_wrapper (sym, dbus_iface_name), block, ref clastif);
}
+ if (need_property_set) {
+ handle_method ("org.freedesktop.DBus.Properties", "Set", generate_dbus_property_set_wrapper (sym, dbus_iface_name), block, ref clastif);
+ }
+ handle_method ("org.freedesktop.DBus.Properties", "GetAll", generate_dbus_property_get_all_wrapper (sym, dbus_iface_name), block, ref clastif);
+
+ handle_methods (sym, dbus_iface_name, block, ref clastif);
}
var resultblock = new CCodeBlock ();