self.h.write('\n')
# First the GInterface
- self.h.write('#define %sTYPE_%s (%s_get_gtype ())\n'%(i.ns_upper, i.name_upper, i.name_lower))
+ self.h.write('#define %sTYPE_%s (%s_get_type ())\n'%(i.ns_upper, i.name_upper, i.name_lower))
self.h.write('#define %s%s(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_%s, %s))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
self.h.write('#define %sIS_%s(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_%s))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper))
self.h.write('#define %s%s_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), %sTYPE_%s, %s))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
self.h.write('};\n')
self.h.write('\n')
- self.h.write('GType %s_get_gtype (void) G_GNUC_CONST;\n'%(i.name_lower))
+ self.h.write('GType %s_get_type (void) G_GNUC_CONST;\n'%(i.name_lower))
self.h.write('\n')
self.h.write('GDBusInterfaceInfo *%s_interface_info (void);\n'%(i.name_lower))
if len(i.properties) > 0:
self.h.write('\n')
self.h.write('/* ---- */\n')
self.h.write('\n')
- self.h.write('#define %sTYPE_%s_PROXY (%s_proxy_get_gtype ())\n'%(i.ns_upper, i.name_upper, i.name_lower))
+ self.h.write('#define %sTYPE_%s_PROXY (%s_proxy_get_type ())\n'%(i.ns_upper, i.name_upper, i.name_lower))
self.h.write('#define %s%s_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_%s_PROXY, %sProxy))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
self.h.write('#define %s%s_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_%s_PROXY, %sProxyClass))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
self.h.write('#define %s%s_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_%s_PROXY, %sProxyClass))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
self.h.write(' GDBusProxyClass parent_class;\n')
self.h.write('};\n')
self.h.write('\n')
- self.h.write('GType %s_proxy_get_gtype (void) G_GNUC_CONST;\n'%(i.name_lower))
+ self.h.write('GType %s_proxy_get_type (void) G_GNUC_CONST;\n'%(i.name_lower))
self.h.write('\n')
if i.deprecated:
self.h.write('\n')
self.h.write('/* ---- */\n')
self.h.write('\n')
- self.h.write('#define %sTYPE_%s_SKELETON (%s_skeleton_get_gtype ())\n'%(i.ns_upper, i.name_upper, i.name_lower))
+ self.h.write('#define %sTYPE_%s_SKELETON (%s_skeleton_get_type ())\n'%(i.ns_upper, i.name_upper, i.name_lower))
self.h.write('#define %s%s_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_%s_SKELETON, %sSkeleton))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
self.h.write('#define %s%s_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_%s_SKELETON, %sSkeletonClass))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
self.h.write('#define %s%s_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_%s_SKELETON, %sSkeletonClass))\n'%(i.ns_upper, i.name_upper, i.ns_upper, i.name_upper, i.camel_name))
self.h.write(' GDBusInterfaceSkeletonClass parent_class;\n')
self.h.write('};\n')
self.h.write('\n')
- self.h.write('GType %s_skeleton_get_gtype (void) G_GNUC_CONST;\n'%(i.name_lower))
+ self.h.write('GType %s_skeleton_get_type (void) G_GNUC_CONST;\n'%(i.name_lower))
self.h.write('\n')
if i.deprecated:
self.h.write('G_GNUC_DEPRECATED ')
self.h.write('\n')
self.h.write('/* ---- */\n')
self.h.write('\n')
- self.h.write('#define %sTYPE_OBJECT_MANAGER_CLIENT (%sobject_manager_client_get_gtype ())\n'%(self.ns_upper, self.ns_lower))
+ self.h.write('#define %sTYPE_OBJECT_MANAGER_CLIENT (%sobject_manager_client_get_type ())\n'%(self.ns_upper, self.ns_lower))
self.h.write('#define %sOBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_OBJECT_MANAGER_CLIENT, %sObjectManagerClient))\n'%(self.ns_upper, self.ns_upper, self.namespace))
self.h.write('#define %sOBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_OBJECT_MANAGER_CLIENT, %sObjectManagerClientClass))\n'%(self.ns_upper, self.ns_upper, self.namespace))
self.h.write('#define %sOBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_OBJECT_MANAGER_CLIENT, %sObjectManagerClientClass))\n'%(self.ns_upper, self.ns_upper, self.namespace))
self.h.write(' GDBusObjectManagerClientClass parent_class;\n')
self.h.write('};\n')
self.h.write('\n')
- self.h.write('GType %sobject_manager_client_get_gtype (void) G_GNUC_CONST;\n'%(self.ns_lower))
+ self.h.write('GType %sobject_manager_client_get_type (void) G_GNUC_CONST;\n'%(self.ns_lower))
self.h.write('\n')
- self.h.write('GDBusProxyTypeFunc %sobject_manager_client_get_proxy_type_func (void);\n'%(self.ns_lower))
+ self.h.write('GType %sobject_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data);\n'%(self.ns_lower))
self.h.write('\n')
self.h.write('void %sobject_manager_client_new (\n'
' GDBusConnection *connection,\n'
'\n')
self.c.write('typedef %sIface %sInterface;\n'%(i.camel_name, i.camel_name))
- self.c.write('#define %s_get_type %s_get_gtype\n'%(i.name_lower, i.name_lower))
self.c.write('G_DEFINE_INTERFACE (%s, %s, G_TYPE_OBJECT);\n'%(i.camel_name, i.name_lower))
- self.c.write('#undef %s_get_type\n'%(i.name_lower))
self.c.write('\n')
# ----------------------------------------------------------------------------------------------------
def generate_property_accessors(self, i):
for p in i.properties:
# getter
+ self.c.write('/**\n'
+ ' * %s_get_%s:\n'
+ ' * @object: \n'
+ ' *\n'
+ ' * Returns: (transfer none): \n'
+ %(i.name_lower, p.name_lower))
+ self.c.write(' */\n')
self.c.write('%s\n'
'%s_get_%s (%s *object)\n'
'{\n'
self.c.write('}\n')
self.c.write('\n')
# setter
+ self.c.write('/**\n'
+ ' * %s_set_%s:\n'
+ ' * @object: \n'
+ ' * @value: \n'
+ ' *\n'
+ %(i.name_lower, p.name_lower))
+ self.c.write(' */\n')
self.c.write('void\n'
'%s_set_%s (%s *object, %svalue)\n'
'{\n'%(i.name_lower, p.name_lower, i.camel_name, p.arg.ctype_in, ))
def generate_method_calls(self, i):
for m in i.methods:
# async begin
+ self.c.write('/**\n'
+ ' * %s_call_%s:\n'
+ ' * @proxy: \n'
+ %(i.name_lower, m.name_lower))
+ for a in m.in_args:
+ self.c.write(' * @%s: \n'%(a.name))
+ self.c.write(' * @cancellable: \n'
+ ' * @callback: \n'
+ ' * @user_data: \n'
+ ' *\n')
+ self.c.write(' */\n')
self.c.write('void\n'
'%s_call_%s (\n'
' %s *proxy'%(i.name_lower, m.name_lower, i.camel_name))
self.c.write('}\n'
'\n')
# async finish
+ self.c.write('/**\n'
+ ' * %s_call_%s_finish:\n'
+ ' * @proxy: \n'
+ %(i.name_lower, m.name_lower))
+ for a in m.out_args:
+ self.c.write(' * @out_%s: (out): \n'%(a.name))
+ self.c.write(' * @res: \n'
+ ' * @error: \n'
+ ' *\n'
+ ' * Returns: \n')
+ self.c.write(' */\n')
self.c.write('gboolean\n'
'%s_call_%s_finish (\n'
' %s *proxy'%(i.name_lower, m.name_lower, i.camel_name))
# sync
+ self.c.write('/**\n'
+ ' * %s_call_%s_sync:\n'
+ ' * @proxy: \n'
+ %(i.name_lower, m.name_lower))
+ for a in m.in_args:
+ self.c.write(' * @%s: \n'%(a.name))
+ for a in m.out_args:
+ self.c.write(' * @out_%s: (out): \n'%(a.name))
+ self.c.write(' * @cancellable: \n'
+ ' * @error: \n'
+ ' *\n'
+ ' * Returns: \n')
+ self.c.write(' */\n')
self.c.write('gboolean\n'
'%s_call_%s_sync (\n'
' %s *proxy'%(i.name_lower, m.name_lower, i.camel_name))
'{\n'
'}\n'
'\n'%(i.name_lower, i.camel_name))
- self.c.write('#define %s_proxy_get_type %s_proxy_get_gtype\n'%(i.name_lower, i.name_lower))
+ self.c.write('#define %s_proxy_get_type %s_proxy_get_type\n'%(i.name_lower, i.name_lower))
self.c.write('G_DEFINE_TYPE_WITH_CODE (%sProxy, %s_proxy, G_TYPE_DBUS_PROXY,\n'%(i.camel_name, i.name_lower))
self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_proxy_iface_init));\n'%(i.ns_upper, i.name_upper, i.name_lower))
self.c.write('#undef %s_proxy_get_type\n'
self.c.write('}\n')
# constructors
+ self.c.write('/**\n'
+ ' * %s_proxy_new:\n'
+ ' * @connection: \n'
+ ' * @flags: \n'
+ ' * @name: \n'
+ ' * @object_path: \n'
+ ' * @callback: \n'
+ ' * @user_data: \n'
+ ' *\n'
+ %(i.name_lower))
+ self.c.write(' */\n')
self.c.write('void\n'
'%s_proxy_new (\n'
' GDBusConnection *connection,\n'
'}\n'
'\n'
%(i.name_lower, i.ns_upper, i.name_upper, i.name))
+ self.c.write('/**\n'
+ ' * %s_proxy_new_finish:\n'
+ ' * @res: \n'
+ ' * @error: \n'
+ ' *\n'
+ ' * Returns: (transfer full) (type %sProxy):\n'
+ %(i.name_lower, i.camel_name))
+ self.c.write(' */\n')
self.c.write('%s *\n'
'%s_proxy_new_finish (\n'
' GAsyncResult *res,\n'
'}\n'
'\n'
%(i.camel_name, i.name_lower, i.ns_upper, i.name_upper))
+ self.c.write('/**\n'
+ ' * %s_proxy_new_sync:\n'
+ ' * @connection: \n'
+ ' * @flags: \n'
+ ' * @name: \n'
+ ' * @object_path: \n'
+ ' * @cancellable: \n'
+ ' * @error: \n'
+ ' *\n'
+ ' * Returns: (transfer full) (type %sProxy):\n'
+ %(i.name_lower, i.camel_name))
+ self.c.write(' */\n')
self.c.write('%s *\n'
'%s_proxy_new_sync (\n'
' GDBusConnection *connection,\n'
'\n'
%(i.camel_name, i.name_lower, i.ns_upper, i.name_upper, i.name, i.ns_upper, i.name_upper))
self.c.write('\n')
+ self.c.write('/**\n'
+ ' * %s_proxy_new_for_bus:\n'
+ ' * @bus_type: \n'
+ ' * @flags: \n'
+ ' * @name: \n'
+ ' * @object_path: \n'
+ ' * @callback: \n'
+ ' * @user_data: \n'
+ ' *\n'
+ %(i.name_lower))
+ self.c.write(' */\n')
self.c.write('void\n'
'%s_proxy_new_for_bus (\n'
' GBusType bus_type,\n'
'}\n'
'\n'
%(i.name_lower, i.ns_upper, i.name_upper, i.name))
+ self.c.write('/**\n'
+ ' * %s_proxy_new_for_bus_finish:\n'
+ ' * @res: \n'
+ ' * @error: \n'
+ ' *\n'
+ ' * Returns: (transfer full) (type %sProxy):\n'
+ %(i.name_lower, i.camel_name))
+ self.c.write(' */\n')
self.c.write('%s *\n'
'%s_proxy_new_for_bus_finish (\n'
' GAsyncResult *res,\n'
'}\n'
'\n'
%(i.camel_name, i.name_lower, i.ns_upper, i.name_upper))
+ self.c.write('/**\n'
+ ' * %s_proxy_new_for_bus_sync:\n'
+ ' * @bus_type: \n'
+ ' * @flags: \n'
+ ' * @name: \n'
+ ' * @object_path: \n'
+ ' * @cancellable: \n'
+ ' * @error: \n'
+ ' *\n'
+ ' * Returns: (transfer full) (type %sProxy):\n'
+ %(i.name_lower, i.camel_name))
+ self.c.write(' */\n')
self.c.write('%s *\n'
'%s_proxy_new_for_bus_sync (\n'
' GBusType bus_type,\n'
%(s.name_lower, i.name_lower, s.name_lower))
self.c.write('}\n'
'\n')
- self.c.write('#define %s_skeleton_get_type %s_skeleton_get_gtype\n'%(i.name_lower, i.name_lower))
+ self.c.write('#define %s_skeleton_get_type %s_skeleton_get_type\n'%(i.name_lower, i.name_lower))
self.c.write('G_DEFINE_TYPE_WITH_CODE (%sSkeleton, %s_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,\n'%(i.camel_name, i.name_lower))
self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_skeleton_iface_init));\n'%(i.ns_upper, i.name_upper, i.name_lower))
self.c.write('#undef %s_skeleton_get_type\n'
'\n')
# constructors
+ self.c.write('/**\n'
+ ' * %s_skeleton_new:\n'
+ ' *\n'
+ ' * Returns: (transfer full) (type %sSkeleton):\n'
+ %(i.name_lower, i.camel_name))
+ self.c.write(' */\n')
self.c.write('%s *\n'
'%s_skeleton_new (void)\n'
'{\n'
# class boilerplate
self.c.write('/* ------------------------------------------------------------------------ */\n'
'\n')
- self.c.write('#define %sobject_manager_client_get_type %sobject_manager_client_get_gtype\n'%(self.ns_lower, self.ns_lower))
+ self.c.write('#define %sobject_manager_client_get_type %sobject_manager_client_get_type\n'%(self.ns_lower, self.ns_lower))
self.c.write('G_DEFINE_TYPE (%sObjectManagerClient, %sobject_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);\n'%(self.namespace, self.ns_lower))
self.c.write('#undef %sobject_manager_client_get_type\n'
'\n'%(self.ns_lower))
'}\n'
'\n'%(self.ns_lower, self.namespace))
- self.c.write('static GType\n'
- '_%sobject_manager_client_get_proxy_type_func (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data)\n'
+ self.c.write('GType\n'
+ '%sobject_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data)\n'
'{\n'
%(self.ns_lower))
self.c.write(' static gsize once_init_value = 0;\n'
'}\n'
'\n')
- self.c.write('GDBusProxyTypeFunc\n'
- '%sobject_manager_client_get_proxy_type_func (void)\n'
- '{\n'
- ' return _%sobject_manager_client_get_proxy_type_func;\n'
- '}\n'
- '\n'
- %(self.ns_lower, self.ns_lower))
-
# constructors
+ self.c.write('/**\n'
+ ' * %sobject_manager_client_new:\n'
+ ' * @connection: \n'
+ ' * @flags: \n'
+ ' * @name: \n'
+ ' * @object_path: \n'
+ ' * @cancellable: \n'
+ ' * @callback: \n'
+ ' * @user_data: \n'
+ ' *\n'
+ %(self.ns_lower))
+ self.c.write(' */\n')
self.c.write('void\n'
'%sobject_manager_client_new (\n'
' GDBusConnection *connection,\n'
' GAsyncReadyCallback callback,\n'
' gpointer user_data)\n'
'{\n'
- ' g_async_initable_new_async (%sTYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", _%sobject_manager_client_get_proxy_type_func, NULL);\n'
+ ' g_async_initable_new_async (%sTYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", %sobject_manager_client_get_proxy_type, NULL);\n'
'}\n'
'\n'
%(self.ns_lower, self.ns_upper, self.ns_lower))
+ self.c.write('/**\n'
+ ' * %sobject_manager_client_new_finish:\n'
+ ' * @res: \n'
+ ' * @error: \n'
+ ' *\n'
+ ' * Returns: (transfer full) (type %sObjectManagerClient):\n'
+ %(self.ns_lower, self.namespace))
+ self.c.write(' */\n')
self.c.write('GDBusObjectManager *\n'
'%sobject_manager_client_new_finish (\n'
' GAsyncResult *res,\n'
'}\n'
'\n'
%(self.ns_lower))
+ self.c.write('/**\n'
+ ' * %sobject_manager_client_new_sync:\n'
+ ' * @connection: \n'
+ ' * @flags: \n'
+ ' * @name: \n'
+ ' * @object_path: \n'
+ ' * @cancellable: \n'
+ ' * @error: \n'
+ ' *\n'
+ ' * Returns: (transfer full) (type %sObjectManagerClient):\n'
+ %(self.ns_lower, self.namespace))
+ self.c.write(' */\n')
self.c.write('GDBusObjectManager *\n'
'%sobject_manager_client_new_sync (\n'
' GDBusConnection *connection,\n'
' GError **error)\n'
'{\n'
' GInitable *ret;\n'
- ' ret = g_initable_new (%sTYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", _%sobject_manager_client_get_proxy_type_func, NULL);\n'
+ ' ret = g_initable_new (%sTYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", %sobject_manager_client_get_proxy_type, NULL);\n'
' if (ret != NULL)\n'
' return G_DBUS_OBJECT_MANAGER (ret);\n'
' else\n'
'\n'
%(self.ns_lower, self.ns_upper, self.ns_lower))
self.c.write('\n')
+ self.c.write('/**\n'
+ ' * %sobject_manager_client_new_for_bus:\n'
+ ' * @bus_type: \n'
+ ' * @flags: \n'
+ ' * @name: \n'
+ ' * @object_path: \n'
+ ' * @cancellable: \n'
+ ' * @callback: \n'
+ ' * @user_data: \n'
+ ' *\n'
+ %(self.ns_lower))
+ self.c.write(' */\n')
self.c.write('void\n'
'%sobject_manager_client_new_for_bus (\n'
' GBusType bus_type,\n'
' GAsyncReadyCallback callback,\n'
' gpointer user_data)\n'
'{\n'
- ' g_async_initable_new_async (%sTYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", _%sobject_manager_client_get_proxy_type_func, NULL);\n'
+ ' g_async_initable_new_async (%sTYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", %sobject_manager_client_get_proxy_type, NULL);\n'
'}\n'
'\n'
%(self.ns_lower, self.ns_upper, self.ns_lower))
+ self.c.write('/**\n'
+ ' * %sobject_manager_client_new_for_bus_finish:\n'
+ ' * @res: \n'
+ ' * @error: \n'
+ ' *\n'
+ ' * Returns: (transfer full) (type %sObjectManagerClient):\n'
+ %(self.ns_lower, self.namespace))
+ self.c.write(' */\n')
self.c.write('GDBusObjectManager *\n'
'%sobject_manager_client_new_for_bus_finish (\n'
' GAsyncResult *res,\n'
'}\n'
'\n'
%(self.ns_lower))
+ self.c.write('/**\n'
+ ' * %sobject_manager_client_new_for_bus_sync:\n'
+ ' * @bus_type: \n'
+ ' * @flags: \n'
+ ' * @name: \n'
+ ' * @object_path: \n'
+ ' * @cancellable: \n'
+ ' * @error: \n'
+ ' *\n'
+ ' * Returns: (transfer full) (type %sObjectManagerClient):\n'
+ %(self.ns_lower, self.namespace))
+ self.c.write(' */\n')
self.c.write('GDBusObjectManager *\n'
'%sobject_manager_client_new_for_bus_sync (\n'
' GBusType bus_type,\n'
' GError **error)\n'
'{\n'
' GInitable *ret;\n'
- ' ret = g_initable_new (%sTYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", _%sobject_manager_client_get_proxy_type_func, NULL);\n'
+ ' ret = g_initable_new (%sTYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", %sobject_manager_client_get_proxy_type, NULL);\n'
' if (ret != NULL)\n'
' return G_DBUS_OBJECT_MANAGER (ret);\n'
' else\n'