1

With gdbus codegen, a struct/object is defined as a complete type in the xml like below

<method name="GetInfo">
 <arg direction="out" type="(sib)" name="info"/>
</method>

However, if the same struct is used at multiple places, repeating the type definition is a bit painful, especially when the signature changes later on.

<method name="GetInfoList">
 <arg direction="out" type="a(sib)" name="info_list"/>
</method>

So, is there a way to define an alias or a something for structs that we don't have to maintain the same thing at multiple places? Oh, and using Qt bindings is not an option in this case unfortunately.

Regards,

abdus_salam
  • 738
  • 2
  • 7
  • 19

1 Answers1

1

So, is there a way to define an alias or a something for structs that we don't have to maintain the same thing at multiple places?

No, there is not. That’s one of the disadvantages of using gdbus-codegen. If you want to define a struct for each of the D-Bus types in your API, you need to implement your service/client manually, without gdbus-codegen, using functions like g_dbus_connection_register_object().

Philip Withnall
  • 5,293
  • 14
  • 28