BYPASS SHELL BY ./RAZORGANZ
Server: nginx/1.20.1
System: Linux iZdzfnv9mwfppeZ 5.10.134-19.2.al8.x86_64 #1 SMP Wed Oct 29 22:47:09 CST 2025 x86_64
User: apache (48)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //usr/share/glib-2.0/codegen/__pycache__/codegen.cpython-36.pyc
3

]xa���@s�ddlmZddlmZddlmZddlmZdZdd�Zdd	�ZGd
d�d�ZGdd
�d
�Z	Gdd�d�Z
Gdd�d�ZdS)�)�config)�utils)�	dbustypes)�print_errorz�/*
 * This file is generated by gdbus-codegen, do not modify it.
 *
 * The license of this code is the same as for the D-Bus interface description
 * it was derived from. Note that it links to GLib, so must comply with the
 * LGPL linking clauses.
 */
cCsx|}t|�dkrftj|�r@|jdd�}|j�d}|j�d}qntj|�j�d}tj|�j�d}nd}d}|||fS)N��_�)�lenrZis_ugly_case�replace�upper�lowerZcamel_case_to_uscore)�	namespace�ns�ns_upper�ns_lower�r�'./usr/share/glib-2.0/codegen/codegen.py�generate_namespace*s
rcs d�djt�fdd�|j���S)NZ$0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZrcs|�kr|SdS)Nrr)�c)�safe_valid_charsrr�<lambda>@sz'generate_header_guard.<locals>.<lambda>)�join�mapr)�header_namer)rr�generate_header_guard;src@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�HeaderCodeGeneratorcCsX||_t|�\|_|_|_||_||_t|�|_||_	||_
||_|	|_|
|_
||_dS)N)�ifacesrr
rr�generate_objmanager�generate_autocleanupr�header_guard�input_files_basenames�
use_pragma�glib_min_required�symbol_decorator�symbol_decorator_header�outfile)�selfrr
rrrr r!r"r#r$r%rrr�__init__Es
zHeaderCodeGenerator.__init__cCs�dj|j�}|jjtjtj|��|jjd�|jrB|jjd�n(|jjdj|j	��|jjdj|j	��|j
dk	r�|jjd�|jjd|j
�|jjd�|jjd�|jjd�|jjd�|jjd�dS)	Nz, �
z
#pragma once
z#ifndef __{!s}__
z#define __{!s}__
z#include "%s"
z#include <gio/gio.h>
zG_BEGIN_DECLS
)rr r%�write�LICENSE_STR�formatr�VERSIONr!rr$)r&�	basenamesrrr�generate_header_preambleas
z,HeaderCodeGenerator.generate_header_preamblec	Cs��x�|jD�]�}|jjd�|jjd�|jjd|j�|jjd�|jjd|j|j|jf�|jjd|j|j|j|j|jf�|jjd|j|j|j|jf�|jjd|j|j|j|j|jf�|jjd�|jjd|j�|jjd	|j|jf�|jjd
|j|jf�|jjd�|jjd|j�|jjd�|jjd
�i}t|j	�dk�r�|jjd�x�|j	D]|}|j
d|jf}d|j}|d|j7}|d7}|j�r�|d7}x$|jD]}|d|j
|jf7}�q�W|d7}|||<�qvWt|j�dk�r�|jjd�xn|jD]d}|j
d|jf}d|j}|d|j7}x$|jD]}|d|j
|jf7}�qNW|d7}|||<�qWt|j�dk�r�|jjd�x>|jD]4}|j
d|jf}d|jj
|j|jf}|||<�q�Wx0t|j�tjd�D]}|jjd||��q�W|jjd�|jjd�|jdk�rj|jjd�|jjd |j�|jjd!�|jjd�|jdk	�r�|jjd"|j�|jjd#|j�|jjd�|jdk	�r�|jjd"|j�|jjd$|j�|jdk	�r�|jjd"|j�|jjd%|j�|jjd�t|j	�dk�r�|jjd�|jjd&�x�|j	D]�}|jdk	�rd|jjd"|j�|j�rx|jjd'�|jjd(|j|j|jf�|j�r�|jjd�x(|jD]}|jjd)|j
|jf��q�W|jjd*�|jjd��qBW|jjd�t|j�dk�r�|jjd�|jjd+�x�|jD]�}|jdk	�rN|jjd"|j�|j�rb|jjd'�|jjd,|j|j|jf�x(|jD]}|jjd|j
|jf��q�W|jjd*�|jjd��q,W|jjd�t|j	�dk�rv|jjd�|jjd-��xl|j	D�]`}|jdk	�r(|jjd"|j�|j�r<|jjd'�|jjd.|j|j|jf�x(|jD]}|jjd|j
|jf��q`W|jd�k�r�|jjd1�|j�r�|jjd�|jjd2�|jjd�|jdk	�r�|jjd"|j�|j�r�|jjd'�|jjd3|j|j|jf�x(|jD]}|jjd4|j|jf��qW|j�rR|jjd5�|jjd6�|jjd�|jdk	�r�|jjd"|j�|j�r�|jjd'�|jjd7|j|j|jf�x(|jD]}|jjd|j
|jf��q�W|jd�k�r�|jjd1�|j�r|jjd8�x(|jD]}|jjd4|j|jf��qW|j�rL|jjd5�|jjd9�|jjd��qW|jjd�t|j�dk�	r�|jjd�|jjd:��x(|jD�]}|jdk	�r�|jjd"|j�|j�r�|jjd'�|jjd;|jj
|j|j|jf�|jjdk	�	rd|jdk	�	r.|jjd"|j�|j�	rB|jjd'�|jjd<|jj|j|j|jf�|jdk	�	r�|jjd"|j�|j�	r�|jjd'�|jjd=|j|j|j|jj
f�|jjd��q�W|jjd�|jjd>�|jjd�|jjd?|j|j|jf�|jjd@|j|j|j|j|jf�|jjdA|j|j|j|j|jf�|jjdB|j|j|j|j|jf�|jjdC|j|j|j|jf�|jjdD|j|j|j|jf�|jjd�|jjdE|j|jf�|jjdF|j|jf�|jjdG|j|jf�|jjd�|jjdH|j�|jjd�|jjdI�|jjdJ�|jjdK|j�|jjd�|jjd�|jjdL|j�|jjd�|jjdM�|jjd�|jjd�|jdk	�r�|jjd"|j�|jjdN|j�|jjd�|jd�k�r6|jjd�|jjdP|j�|jjd!�|jjd�|jdk	�rT|jjd"|j�|j�rh|jjd'�|jjdQ|j�|jdk	�r�|jjd"|j�|j�r�|jjd'�|jjdR|j|jf�|jdk	�r�|jjd"|j�|j�r�|jjd'�|jjdS|j|jf�|jjd�|jdk	�
r8|jjd"|j�|j�
rL|jjd'�|jjdT|j�|jdk	�
r||jjd"|j�|j�
r�|jjd'�|jjdU|j|jf�|jdk	�
r�|jjd"|j�|j�
r�|jjd'�|jjdV|j|jf�|jjd�|jjd�|jjd>�|jjd�|jjdW|j|j|jf�|jjdX|j|j|j|j|jf�|jjdY|j|j|j|j|jf�|jjdZ|j|j|j|j|jf�|jjd[|j|j|j|jf�|jjd\|j|j|j|jf�|jjd�|jjd]|j|jf�|jjd^|j|jf�|jjd_|j|jf�|jjd�|jjd`|j�|jjd�|jjdI�|jjda�|jjdb|j�|jjd�|jjd�|jjdc|j�|jjd�|jjdd�|jjd�|jjd�|jdk	�r
|jjd"|j�|jjde|j�|jjd�|jd�k�rj|jjd�|jjdf|j�|jjd!�|jjd�|jdk	�r�|jjd"|j�|j�r�|jjd'�|jjdg|j|jf�|jjd�q
W|j�r�|jjd�|jjd>�|jjd�|jjdh|j|jf�|jjdi|j|j|j f�|jjdj|j|jf�|jjdk|j|j|j f�|jjd�|jjdl|j �|jjdm|j |j f�|jjdn|j |j f�|jjd�|jjdo|j �|jjdp�|jdk	�r�|jjd"|j�|jjdq|j�|jdk�rB|jjd�|jjdr|j �|jjd!�|jjd�xf|jD]\}|jdk	�rl|jjd"|j�|j�r�|jjd'�|jjds|j|j|jj!�|j f��qJWxf|jD]\}|jdk	�r�|jjd"|j�|j�r�|jjd'�|jjdt|j|j|jj!�|j f��q�W|jjd�|jjdu|j|jf�|jjdv|j|j|j f�|jjdw|j|j|j f�|jjdx|j|j|j f�|jjdy|j|jf�|jjdz|j|jf�|jjd�|jjd{|j |j f�|jjd||j |j f�|jjd}|j |j f�|jjd�|jjd~|j �|jjd�|jjdI�|jjd�|jjd�|j �|jjd�|jjd�|jjd�|j �|jjd�|jjd��|jjd�|jjd�|jdk	�r�|jjd"|j�|jjd�|j�|jjd�|jd�k�r:|jjd�|jjd�|j �|jjd!�|jjd�|jdk	�rX|jjd"|j�|jjd�|j |jf�|jjd�|jjd�|j|jf�|jjd�|j|j|j f�|jjd�|j|j|j f�|jjd�|j|j|j f�|jjd�|j|jf�|jjd�|j|jf�|jjd�|jjd�|j |j f�|jjd�|j |j f�|jjd�|j |j f�|jjd�|jjd�|j �|jjd�|jjdI�|jjd��|jjd�|j �|jjd�|jjd�|jjd�|j �|jjd�|jjd��|jjd�|jjd�|jdk	�r8|jjd"|j�|jjd�|j�|jjd�|jd�k�r�|jjd�|jjd�|j �|jjd!�|jjd�|jdk	�r�|jjd"|j�|jjd�|j |jf�xf|jD]\}|jdk	�r�|jjd"|j�|j�r|jjd'�|jjd�|j|jj!�|j |jf��q�W|jjd�|jjd>�|jjd�|jjd�|j|jf�|jjd�|j|j|j f�|jjd�|j|j|j f�|jjd�|j|j|j f�|jjd�|j|jf�|jjd�|j|jf�|jjd�|jjd�|j |j f�|jjd�|j |j f�|jjd�|j |j f�|jjd�|jjd�|j �|jjd�|jjdI�|jjd��|jjd�|j �|jjd�|jjd�|jjd�|j �|jjd�|jjd��|jjd�|jjd�|jd�k�r:|jjd�|jjd�|j �|jjd!�|jjd�|jdk	�rX|jjd"|j�|jjd�|j�|jjd�|jdk	�r�|jjd"|j�|jjd�|j�|jjd�|jdk	�r�|jjd"|j�|jjd�|j�|jdk	�r|jjd"|j�|jjd�|j�|jdk	�r0|jjd"|j�|jjd�|j�|jjd�|jdk	�rl|jjd"|j�|jjd�|j�|jdk	�r�|jjd"|j�|jjd�|j�|jdk	�r�|jjd"|j�|jjd�|j�|jjd�dS)�Nr(zO/* ------------------------------------------------------------------------ */
z/* Declarations for %s */
z##define %sTYPE_%s (%s_get_type ())
zB#define %s%s(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_%s, %s))
zA#define %sIS_%s(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_%s))
zT#define %s%s_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), %sTYPE_%s, %sIface))
zstruct _%s;
ztypedef struct _%s %s;
z!typedef struct _%sIface %sIface;
zstruct _%sIface
z{
z  GTypeInterface parent_iface;
rz
_method_%sz  gboolean (*handle_%s) (
z    %s *object,
z%    GDBusMethodInvocation *invocationz,
    GUnixFDList *fd_listz,
    %sarg_%sz);

z
_signal_%sz  void (*%s) (
z    %s *objectz_prop_get_%sz  %s (*get_%s) (%s *object);

)�keyz%sz};
�allz!#if GLIB_CHECK_VERSION(2, 44, 0)
z3G_DEFINE_AUTOPTR_CLEANUP_FUNC (%s, g_object_unref)
z#endif
z%s
z'GType %s_get_type (void) G_GNUC_CONST;
z.GDBusInterfaceInfo *%s_interface_info (void);
zMguint %s_override_properties (GObjectClass *klass, guint property_id_begin);
z./* D-Bus method call completion functions: */
zG_GNUC_DEPRECATED zKvoid %s_complete_%s (
    %s *object,
    GDBusMethodInvocation *invocationz
,
    %s%sz);
z(/* D-Bus signal emissions functions: */
z void %s_emit_%s (
    %s *objectz/* D-Bus method calls: */
zvoid %s_call_%s (
    %s *proxy��@z6,
    GDBusCallFlags call_flags,
    gint timeout_msecz\,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data);
z*gboolean %s_call_%s_finish (
    %s *proxyz,
    %sout_%sz,
    GUnixFDList **out_fd_listz.,
    GAsyncResult *res,
    GError **error);
z(gboolean %s_call_%s_sync (
    %s *proxyz,
    GUnixFDList  *fd_listz6,
    GCancellable *cancellable,
    GError **error);
z /* D-Bus property accessors: */
z%s%s_get_%s (%s *object);
z%s%s_dup_%s (%s *object);
z&void %s_set_%s (%s *object, %svalue);
z/* ---- */
z/#define %sTYPE_%s_PROXY (%s_proxy_get_type ())
zS#define %s%s_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_%s_PROXY, %sProxy))
z[#define %s%s_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_%s_PROXY, %sProxyClass))
za#define %s%s_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_%s_PROXY, %sProxyClass))
zM#define %sIS_%s_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_%s_PROXY))
zP#define %sIS_%s_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), %sTYPE_%s_PROXY))
z!typedef struct _%sProxy %sProxy;
z+typedef struct _%sProxyClass %sProxyClass;
z/typedef struct _%sProxyPrivate %sProxyPrivate;
zstruct _%sProxy
z  /*< private >*/
z  GDBusProxy parent_instance;
z  %sProxyPrivate *priv;
zstruct _%sProxyClass
z   GDBusProxyClass parent_class;
z-GType %s_proxy_get_type (void) G_GNUC_CONST;
�objectsz8G_DEFINE_AUTOPTR_CLEANUP_FUNC (%sProxy, g_object_unref)
avoid %s_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data);
zY%s *%s_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error);
z�%s *%s_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error);
avoid %s_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data);
za%s *%s_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error);
z�%s *%s_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error);
z5#define %sTYPE_%s_SKELETON (%s_skeleton_get_type ())
z\#define %s%s_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_%s_SKELETON, %sSkeleton))
zd#define %s%s_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_%s_SKELETON, %sSkeletonClass))
zj#define %s%s_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_%s_SKELETON, %sSkeletonClass))
zS#define %sIS_%s_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_%s_SKELETON))
zV#define %sIS_%s_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), %sTYPE_%s_SKELETON))
z'typedef struct _%sSkeleton %sSkeleton;
z1typedef struct _%sSkeletonClass %sSkeletonClass;
z5typedef struct _%sSkeletonPrivate %sSkeletonPrivate;
zstruct _%sSkeleton
z*  GDBusInterfaceSkeleton parent_instance;
z  %sSkeletonPrivate *priv;
zstruct _%sSkeletonClass
z,  GDBusInterfaceSkeletonClass parent_class;
z0GType %s_skeleton_get_type (void) G_GNUC_CONST;
z;G_DEFINE_AUTOPTR_CLEANUP_FUNC (%sSkeleton, g_object_unref)
z%s *%s_skeleton_new (void);
z-#define %sTYPE_OBJECT (%sobject_get_type ())
zP#define %sOBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_OBJECT, %sObject))
zI#define %sIS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_OBJECT))
z]#define %sOBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), %sTYPE_OBJECT, %sObject))
zstruct _%sObject;
z#typedef struct _%sObject %sObject;
z-typedef struct _%sObjectIface %sObjectIface;
zstruct _%sObjectIface
z%{
  GTypeInterface parent_iface;
};

z.GType %sobject_get_type (void) G_GNUC_CONST;

z9G_DEFINE_AUTOPTR_CLEANUP_FUNC (%sObject, g_object_unref)
z(%s *%sobject_get_%s (%sObject *object);
z)%s *%sobject_peek_%s (%sObject *object);
z9#define %sTYPE_OBJECT_PROXY (%sobject_proxy_get_type ())
za#define %sOBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_OBJECT_PROXY, %sObjectProxy))
zi#define %sOBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_OBJECT_PROXY, %sObjectProxyClass))
zo#define %sOBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_OBJECT_PROXY, %sObjectProxyClass))
zU#define %sIS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_OBJECT_PROXY))
zX#define %sIS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), %sTYPE_OBJECT_PROXY))
z-typedef struct _%sObjectProxy %sObjectProxy;
z7typedef struct _%sObjectProxyClass %sObjectProxyClass;
z;typedef struct _%sObjectProxyPrivate %sObjectProxyPrivate;
zstruct _%sObjectProxy
z$  GDBusObjectProxy parent_instance;
z  %sObjectProxyPrivate *priv;
zstruct _%sObjectProxyClass
z&  GDBusObjectProxyClass parent_class;
z3GType %sobject_proxy_get_type (void) G_GNUC_CONST;
z>G_DEFINE_AUTOPTR_CLEANUP_FUNC (%sObjectProxy, g_object_unref)
z[%sObjectProxy *%sobject_proxy_new (GDBusConnection *connection, const gchar *object_path);
z?#define %sTYPE_OBJECT_SKELETON (%sobject_skeleton_get_type ())
zj#define %sOBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_OBJECT_SKELETON, %sObjectSkeleton))
zr#define %sOBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_OBJECT_SKELETON, %sObjectSkeletonClass))
zx#define %sOBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_OBJECT_SKELETON, %sObjectSkeletonClass))
z[#define %sIS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_OBJECT_SKELETON))
z^#define %sIS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), %sTYPE_OBJECT_SKELETON))
z3typedef struct _%sObjectSkeleton %sObjectSkeleton;
z=typedef struct _%sObjectSkeletonClass %sObjectSkeletonClass;
zAtypedef struct _%sObjectSkeletonPrivate %sObjectSkeletonPrivate;
zstruct _%sObjectSkeleton
z'  GDBusObjectSkeleton parent_instance;
z!  %sObjectSkeletonPrivate *priv;
zstruct _%sObjectSkeletonClass
z)  GDBusObjectSkeletonClass parent_class;
z6GType %sobject_skeleton_get_type (void) G_GNUC_CONST;
zAG_DEFINE_AUTOPTR_CLEANUP_FUNC (%sObjectSkeleton, g_object_unref)
zD%sObjectSkeleton *%sobject_skeleton_new (const gchar *object_path);
zJvoid %sobject_skeleton_set_%s (%sObjectSkeleton *object, %s *interface_);
zK#define %sTYPE_OBJECT_MANAGER_CLIENT (%sobject_manager_client_get_type ())
z{#define %sOBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), %sTYPE_OBJECT_MANAGER_CLIENT, %sObjectManagerClient))
z�#define %sOBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), %sTYPE_OBJECT_MANAGER_CLIENT, %sObjectManagerClientClass))
z�#define %sOBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), %sTYPE_OBJECT_MANAGER_CLIENT, %sObjectManagerClientClass))
zg#define %sIS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), %sTYPE_OBJECT_MANAGER_CLIENT))
zj#define %sIS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), %sTYPE_OBJECT_MANAGER_CLIENT))
z=typedef struct _%sObjectManagerClient %sObjectManagerClient;
zGtypedef struct _%sObjectManagerClientClass %sObjectManagerClientClass;
zKtypedef struct _%sObjectManagerClientPrivate %sObjectManagerClientPrivate;
zstruct _%sObjectManagerClient
z,  GDBusObjectManagerClient parent_instance;
z&  %sObjectManagerClientPrivate *priv;
z#struct _%sObjectManagerClientClass
z.  GDBusObjectManagerClientClass parent_class;
zFG_DEFINE_AUTOPTR_CLEANUP_FUNC (%sObjectManagerClient, g_object_unref)
z<GType %sobject_manager_client_get_type (void) G_GNUC_CONST;
z�GType %sobject_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data);
a7void %sobject_manager_client_new (
    GDBusConnection        *connection,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GAsyncReadyCallback     callback,
    gpointer                user_data);
zxGDBusObjectManager *%sobject_manager_client_new_finish (
    GAsyncResult        *res,
    GError             **error);
a!GDBusObjectManager *%sobject_manager_client_new_sync (
    GDBusConnection        *connection,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GError                **error);
a=void %sobject_manager_client_new_for_bus (
    GBusType                bus_type,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GAsyncReadyCallback     callback,
    gpointer                user_data);
z�GDBusObjectManager *%sobject_manager_client_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error);
a'GDBusObjectManager *%sobject_manager_client_new_for_bus_sync (
    GBusType                bus_type,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GError                **error);
)r1r2)r1r2)r3r0)r3r0)r3r0)r3r0)r3r0)"rr%r)�namer�
name_upper�
name_lower�
camel_namer	�methods�since�unix_fd�in_args�ctype_in�signals�args�
properties�arg�sorted�keysr�version_cmp_keyrr#�
deprecated�out_argsr"�	ctype_out�	free_func�ctype_in_duprrr
r)	r&�iZfunction_pointers�mr/�value�a�s�prrr�
declare_typesxs"





















z!HeaderCodeGenerator.declare_typescCsB|jjd�|jjd�|js>|jjd�|jjdj|j��dS)Nr(zG_END_DECLS
z#endif /* __{!s}__ */
)r%r)r!r+r)r&rrr�generate_header_postamble�s
z-HeaderCodeGenerator.generate_header_postamblecCs|j�|j�|j�dS)N)r.rOrP)r&rrr�generate�szHeaderCodeGenerator.generateN)�__name__�
__module__�__qualname__r'r.rOrPrQrrrrrDsr
rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)� InterfaceInfoHeaderCodeGeneratorc

Cs\||_t|�\|_|_|_t|�|_||_||_||_	||_
|j
dkrLd|_
||_|	|_dS)Nr)
rrr
rrrrr r!r"r#r$r%)
r&rr
rr r!r"r#r$r%rrrr'�s

z)InterfaceInfoHeaderCodeGenerator.__init__cCs�dj|j�}|jjtjtj|��|jjd�|jrB|jjd�n(|jjdj|j	��|jjdj|j	��|j
dk	r�|jjd�|jjd|j
�|jjd�|jjd�|jjd�|jjd�|jjd�dS)	Nz, r(z
#pragma once
z#ifndef __{!s}__
z#define __{!s}__
z#include "%s"
z#include <gio/gio.h>
zG_BEGIN_DECLS
)rr r%r)r*r+rr,r!rr$)r&r-rrrr.s
z9InterfaceInfoHeaderCodeGenerator.generate_header_preamblecCs,x&|jD]}|jjd|j|jf�qWdS)Nz1extern %s const GDBusInterfaceInfo %s_interface;
)rr%r)r#r6)r&rIrrr�
declare_infos)sz.InterfaceInfoHeaderCodeGenerator.declare_infoscCsB|jjd�|jjd�|js>|jjd�|jjdj|j��dS)Nr(zG_END_DECLS
z#endif /* __{!s}__ */
)r%r)r!r+r)r&rrrrP2s
z:InterfaceInfoHeaderCodeGenerator.generate_header_postamblecCs|j�|j�|j�dS)N)r.rVrP)r&rrrrQ<sz)InterfaceInfoHeaderCodeGenerator.generateN)rRrSrTr'r.rVrPrQrrrrrU�s
	
rUc@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�InterfaceInfoBodyCodeGeneratorcCs<||_t|�\|_|_|_||_||_||_||_||_	dS)N)
rrr
rrrr r"�symbol_decoration_definer%)r&rr
rr r"rXr%rrrr'Fs
z'InterfaceInfoBodyCodeGenerator.__init__cCsxdj|j�}|jjtjtj|��|jdk	rJ|jjd�|jjd|j�|jjd�|jjd|j	�|jjd�dS)Nz, r(z#define %s
zV#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif

#include "%s"

#include <string.h>
)
rr r%r)r*r+rr,rXr)r&r-rrr�generate_body_preambleZs

z5InterfaceInfoBodyCodeGenerator.generate_body_preamblecCsj|jjd||f�|jjd�x |D]\}}|jjd|�q&W|jjd�|jjd�|jjd�dS)Nzconst %s * const %s[] =
z{
z  &%s,
z  NULL,
z};
r()r%r))r&�array_name_lowerZelement_type�elementsrr4rrr�generate_arraypsz-InterfaceInfoBodyCodeGenerator.generate_arraycCst|�dkrdSg}x�|D]�}|jjd�r,q|jd||jf|j�|jjd||jf�|jjd�|jjd�|jjd|j�|jjd|j�t|j�dkr�|jjd||jf�n|jjd	�|jjd
�|jjd�|j	d||jff}|j
|�qW|j|d
|�dS)Nrz
org.gtk.GDBusz%s__%s_annotationsz.const GDBusAnnotationInfo %s__%s_annotation =
z{
z  -1,  /* ref count */
z  (gchar *) "%s",
z/  (GDBusAnnotationInfo **) %s__%s_annotations,
z  NULL,  /* no annotations */
z};
r(z%s__%s_annotationZGDBusAnnotationInfo)r	r/�
startswith�define_annotationsZ	key_lower�annotationsr%r)rKr9�appendr\)r&rZr_Zannotation_pointersrLr/rrrr^{s4
z1InterfaceInfoBodyCodeGenerator.define_annotationscCst|�dkrdSg}x�|D]�}|jd||jf|j�|jjd||jf�|jjd�|jjd�|jjd|j�|jjd|j�t|j�dkr�|jjd||jf�n|jjd�|jjd	�|jjd
�|jd||jff}|j|�qW|j	|d|�dS)
Nrz%s__%s_arg_annotationsz const GDBusArgInfo %s__%s_arg =
z{
z  -1,  /* ref count */
z  (gchar *) "%s",
z3  (GDBusAnnotationInfo **) %s__%s_arg_annotations,
z  NULL,  /* no annotations */
z};
r(z
%s__%s_argZGDBusArgInfo)
r	r^r4r_r%r)�	signaturer9r`r\)r&rZr>Zarg_pointersrLr/rrr�define_args�s,
z*InterfaceInfoBodyCodeGenerator.define_argsc
Cs��x�|jD�]�}|jjd�|jjd|j�|jjd�t|j�dk�r�g}�xz|jD�]n}|jd|j|jf|j�|jd|j|jf|j	�|j
d|j|jf|j�|jjd|j|jf�|jjd	�|jjd
�|jjd|j�t|j�dk�r|jjd|j|jf�n|jjd
�t|j	�dk�rN|jjd|j|jf�n|jjd�t|j�dk�r�|jjd|j|jf�n|jjd�|jjd�|jjd�|jd|j|jff}|j
|�qXW|jd|jd|�t|j�dk�r8g}�x,|jD�] }|jd|j|jf|j�|j
d|j|jf|j�|jjd|j|jf�|jjd	�|jjd
�|jjd|j�t|j�dk�r�|jjd|j|jf�n|jjd�t|j�dk�r�|jjd|j|jf�n|jjd�|jjd�|jjd�|jd|j|jff}|j
|��q�W|jd|jd|�t|j�dk�r�g}�x4|jD�](}|j�rr|j�rrd}	n |j�r�d }	n|j�r�d!}	nd"}	|j
d#|j|jf|j�|jjd$|j|jf�|jjd	�|jjd
�|jjd|j�|jjd|j�|jjd%|	�t|j�dk�r:|jjd&|j|jf�n|jjd�|jjd�|jjd�|jd'|j|jff}|j
|��qVW|jd(|jd)|�|j
d*|j|j�|jjd+|j�|jjd	�|jjd
�|jjd|j�t|j�dk�r|jjd,|j�n|jjd-�t|j�dk�r<|jjd.|j�n|jjd/�t|j�dk�rl|jjd0|j�n|jjd1�t|j�dk�r�|jjd2|j�n|jjd�|jjd�|jjd�q
WdS)3NzO/* ------------------------------------------------------------------------ */
z/* Definitions for %s */
r(rz%s_interface__%s_method_in_argsz %s_interface__%s_method_out_argsz#%s_interface__%s_method_annotationsz0const GDBusMethodInfo %s_interface__%s_method =
z{
z  -1,  /* ref count */
z  (gchar *) "%s",
z5  (GDBusArgInfo **) %s_interface__%s_method_in_args,
z  NULL,  /* no in args */
z6  (GDBusArgInfo **) %s_interface__%s_method_out_args,
z  NULL,  /* no out args */
z@  (GDBusAnnotationInfo **) %s_interface__%s_method_annotations,
z  NULL,  /* no annotations */
z};
z%s_interface__%s_methodz%s_interface_methodsZGDBusMethodInfoz%s_interface__%s_signal_argsz#%s_interface__%s_signal_annotationsz0const GDBusSignalInfo %s_interface__%s_signal =
z2  (GDBusArgInfo **) %s_interface__%s_signal_args,
z  NULL,  /* no args */
z@  (GDBusAnnotationInfo **) %s_interface__%s_signal_annotations,
z%s_interface__%s_signalz%s_interface_signalsZGDBusSignalInfozIG_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE�#G_DBUS_PROPERTY_INFO_FLAGS_READABLE�#G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE�G_DBUS_PROPERTY_INFO_FLAGS_NONEz%%s_interface__%s_property_annotationsz4const GDBusPropertyInfo %s_interface__%s_property =
z  %s,
zB  (GDBusAnnotationInfo **) %s_interface__%s_property_annotations,
z%s_interface__%s_propertyz%s_interface_propertiesZGDBusPropertyInfoz%s_interface_annotationsz(const GDBusInterfaceInfo %s_interface =
z-  (GDBusMethodInfo **) %s_interface_methods,
z  NULL,  /* no methods */
z-  (GDBusSignalInfo **) %s_interface_signals,
z  NULL,  /* no signals */
z2  (GDBusPropertyInfo **) %s_interface_properties,
zNULL,  /* no properties */
z5  (GDBusAnnotationInfo **) %s_interface_annotations,
)rr%r)r4r	r8rbr6r;rEr^r_r9r`r\r=r>r?�readable�writablera)
r&rIZmethod_pointersrJr/Zsignal_pointersrMZproperty_pointersrN�flagsrrr�define_infos�s&z+InterfaceInfoBodyCodeGenerator.define_infoscCs|j�|j�dS)N)rYri)r&rrrrQ�sz'InterfaceInfoBodyCodeGenerator.generateN)
rRrSrTr'rYr\r^rbrirQrrrrrWEs(!XrWc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#S)$�
CodeGeneratorc

CsH||_t|�\|_|_|_||_||_||_||_||_	||_
|	|_dS)N)rrr
rrrrr �docbook_genr"rXr%)
r&rr
rrr rkr"rXr%rrrr'�szCodeGenerator.__init__cCs�dj|j�}|jjtjtj|��|jdk	rJ|jjd�|jjd|j�|jjd�|jjd|j	�|jjd�|jjd�|jjd�|jjd�|jjd	�|jjd
�|jjd�|jjd�|jjd
�|jjd�dS)Nz, r(z#define %s
zV#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif

#include "%s"

#include <string.h>
z8#ifdef G_OS_UNIX
#  include <gio/gunixfdlist.h>
#endif

zbtypedef struct
{
  GDBusArgInfo parent_struct;
  gboolean use_gvariant;
} _ExtendedGDBusArgInfo;

z�typedef struct
{
  GDBusMethodInfo parent_struct;
  const gchar *signal_name;
  gboolean pass_fdlist;
} _ExtendedGDBusMethodInfo;

zktypedef struct
{
  GDBusSignalInfo parent_struct;
  const gchar *signal_name;
} _ExtendedGDBusSignalInfo;

z�typedef struct
{
  GDBusPropertyInfo parent_struct;
  const gchar *hyphen_name;
  guint use_gvariant : 1;
  guint emits_changed_signal : 1;
} _ExtendedGDBusPropertyInfo;

zqtypedef struct
{
  GDBusInterfaceInfo parent_struct;
  const gchar *hyphen_name;
} _ExtendedGDBusInterfaceInfo;

a
typedef struct
{
  const _ExtendedGDBusPropertyInfo *info;
  guint prop_id;
  GValue orig_value; /* the value before the change */
} ChangedProperty;

static void
_changed_property_free (ChangedProperty *data)
{
  g_value_unset (&data->orig_value);
  g_free (data);
}

a�static gboolean
_g_strv_equal0 (gchar **a, gchar **b)
{
  gboolean ret = FALSE;
  guint n;
  if (a == NULL && b == NULL)
    {
      ret = TRUE;
      goto out;
    }
  if (a == NULL || b == NULL)
    goto out;
  if (g_strv_length (a) != g_strv_length (b))
    goto out;
  for (n = 0; a[n] != NULL; n++)
    if (g_strcmp0 (a[n], b[n]) != 0)
      goto out;
  ret = TRUE;
out:
  return ret;
}

astatic gboolean
_g_variant_equal0 (GVariant *a, GVariant *b)
{
  gboolean ret = FALSE;
  if (a == NULL && b == NULL)
    {
      ret = TRUE;
      goto out;
    }
  if (a == NULL || b == NULL)
    goto out;
  ret = g_variant_equal (a, b);
out:
  return ret;
}

ahG_GNUC_UNUSED static gboolean
_g_value_equal (const GValue *a, const GValue *b)
{
  gboolean ret = FALSE;
  g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
  switch (G_VALUE_TYPE (a))
    {
      case G_TYPE_BOOLEAN:
        ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
        break;
      case G_TYPE_UCHAR:
        ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
        break;
      case G_TYPE_INT:
        ret = (g_value_get_int (a) == g_value_get_int (b));
        break;
      case G_TYPE_UINT:
        ret = (g_value_get_uint (a) == g_value_get_uint (b));
        break;
      case G_TYPE_INT64:
        ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
        break;
      case G_TYPE_UINT64:
        ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
        break;
      case G_TYPE_DOUBLE:
        {
          /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
          gdouble da = g_value_get_double (a);
          gdouble db = g_value_get_double (b);
          ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
        }
        break;
      case G_TYPE_STRING:
        ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
        break;
      case G_TYPE_VARIANT:
        ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
        break;
      default:
        if (G_VALUE_TYPE (a) == G_TYPE_STRV)
          ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
        else
          g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
        break;
    }
  return ret;
}

)
rr r%r)r*r+rr,rXr)r&r-rrrrY�s:

	
z$CodeGenerator.generate_body_preamblecCs�|dkrdSd}xz|D]r}|jjd�r(q|jjd|||j|jf�t|j�dkr`|jjd�n|jjd||f�|jjd�|d7}qW|dkr�|jjd|�d}x6|D].}|jjd�r�q�|jjd	||f�|d7}q�W|jjd
�|S)Nrz
org.gtk.GDBuszUstatic const GDBusAnnotationInfo %s_%d =
{
  -1,
  (gchar *) "%s",
  (gchar *) "%s",
z  NULL
z+  (GDBusAnnotationInfo **) &%s_%d_pointers
z};

rz;static const GDBusAnnotationInfo * const %s_pointers[] =
{
z
  &%s_%d,
z  NULL
};

)r/r]r%r)rKr	r_)r&�prefixr_�nrLrJrrr�generate_annotationsss6

z"CodeGenerator.generate_annotationscCsx�|D]�}|jd||jf|j�}|jjd||j|j|jf�|dkrV|jjd�n|jjd||jf�|jjd�tj|jd�s�|jjd�n|jjd	�|jjd
�qWt|�dkr�|jjd|�x"|D]}|jjd||jf�q�W|jjd
�dS)Nz%s_arg_%s_annotation_infozastatic const _ExtendedGDBusArgInfo %s_%s =
{
  {
    -1,
    (gchar *) "%s",
    (gchar *) "%s",
rz	    NULL
zA    (GDBusAnnotationInfo **) &%s_arg_%s_annotation_info_pointers
z  },
zorg.gtk.GDBus.C.ForceGVariantz  FALSE
z  TRUE
z};

z4static const GDBusArgInfo * const %s_pointers[] =
{
z  &%s_%s.parent_struct,
z  NULL
};

)	rnr4r_r%r)rar�lookup_annotationr	)r&rlr>rL�num_annorrr�
generate_args�s.



zCodeGenerator.generate_argscCsb|jjd|j�t|j�dk�r��x@|jD�]4}|jd|j|jf|j�|jd|j|jf|j�|j	d|j|jf|j
�}|jjd|j|j|jf�t|j�dkr�|jjd�n|jjd|j|jf�t|j�dkr�|jjd�n|jjd	|j|jf�|dk�r|jjd
�n|jjd|j|jf�|jjd|j|j�rLd
ndf�|jjd�q,W|jjd|j�x(|jD]}|jjd|j|jf��q�W|jjd�t|j
�dk�r�x�|j
D]�}|jd|j|jf|j�|j	d|j|jf|j
�}|jjd|j|j|jf�t|j�dk�r8|jjd�n|jjd|j|jf�|dk�rh|jjd
�n|jjd|j|jf�|jjd|j�|jjd��q�W|jjd|j�x(|j
D]}|jjd|j|jf��q�W|jjd�t|j�dk�rh�x |jD�]}|j�r"|j�r"d}n |j�r0d}n|j�r>d}nd}|j	d|j|jf|j
�}|jjd |j|j|j|jj|f�|dk�r�|jjd
�n|jjd!|j|jf�|jjd"|j�tj|j
d#��s�|jjd$�n|jjd%�|j�r|jjd&�n|jjd'�|jjd��qW|jjd(|j�x(|jD]}|jjd)|j|jf��q:W|jjd�|j	d*|j|j
�}|jjd+|j|jf�t|j�dk�r�|jjd�n|jjd,|j�t|j
�dk�r�|jjd�n|jjd-|j�t|j�dk�r|jjd�n|jjd.|j�|dk�r<|jjd
�n|jjd/|j�|jjd0|j�|jjd1�|jj|jjd2|j|jfd3��|j||jd�|jjd4|j|jf�|jj|jjd5|j|jfd3��|j||jd�|jjd6|j�t|j�dk�r|jjd7�|jjd8�x"|jD]}|jjd9|j��q*W|jjd:�|jjd1�dS);Nz+/* ---- Introspection data for %s ---- */

rz_%s_method_info_%s_IN_ARGz_%s_method_info_%s_OUT_ARGz_%s_method_%s_annotation_infoz]static const _ExtendedGDBusMethodInfo _%s_method_info_%s =
{
  {
    -1,
    (gchar *) "%s",
z
    NULL,
z;    (GDBusArgInfo **) &_%s_method_info_%s_IN_ARG_pointers,
z<    (GDBusArgInfo **) &_%s_method_info_%s_OUT_ARG_pointers,
z	    NULL
zE    (GDBusAnnotationInfo **) &_%s_method_%s_annotation_info_pointers
z  },
  "handle-%s",
  %s
ZTRUEZFALSEz};

zDstatic const GDBusMethodInfo * const _%s_method_info_pointers[] =
{
z%  &_%s_method_info_%s.parent_struct,
z  NULL
};

z_%s_signal_info_%s_ARGz_%s_signal_%s_annotation_infoz]static const _ExtendedGDBusSignalInfo _%s_signal_info_%s =
{
  {
    -1,
    (gchar *) "%s",
z8    (GDBusArgInfo **) &_%s_signal_info_%s_ARG_pointers,
zE    (GDBusAnnotationInfo **) &_%s_signal_%s_annotation_info_pointers
z  },
  "%s"
zDstatic const GDBusSignalInfo * const _%s_signal_info_pointers[] =
{
z%  &_%s_signal_info_%s.parent_struct,
zIG_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLErcrdrez_%s_property_%s_annotation_infoz}static const _ExtendedGDBusPropertyInfo _%s_property_info_%s =
{
  {
    -1,
    (gchar *) "%s",
    (gchar *) "%s",
    %s,
zG    (GDBusAnnotationInfo **) &_%s_property_%s_annotation_info_pointers
z
  },
  "%s",
zorg.gtk.GDBus.C.ForceGVariantz	  FALSE,
z  TRUE,
z  TRUE
z  FALSE
zHstatic const GDBusPropertyInfo * const _%s_property_info_pointers[] =
{
z'  &_%s_property_info_%s.parent_struct,
z_%s_annotation_infoz`static const _ExtendedGDBusInterfaceInfo _%s_interface_info =
{
  {
    -1,
    (gchar *) "%s",
z4    (GDBusMethodInfo **) &_%s_method_info_pointers,
z4    (GDBusSignalInfo **) &_%s_signal_info_pointers,
z8    (GDBusPropertyInfo **) &_%s_property_info_pointers,
z;    (GDBusAnnotationInfo **) &_%s_annotation_info_pointers
z  },
  "%s",
};

r(z�/**
 * %s_interface_info:
 *
 * Gets a machine-readable description of the #%s D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
FzvGDBusInterfaceInfo *
%s_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_%s_interface_info.parent_struct;
}

ag/**
 * %s_override_properties:
 * @klass: The class structure for a #GObject derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #%s interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
z1guint
%s_override_properties (GObjectClass *klassz G_GNUC_UNUSEDz, guint property_id_begin)
{
zG  g_object_class_override_property (klass, property_id_begin++, "%s");
z#  return property_id_begin - 1;
}

)r%r)r4r	r8rqr6r;rErnr_�name_hyphenr:r=r>r?rfrgr@rarroZemits_changed_signalrk�expand�+write_gtkdoc_deprecated_and_since_and_closer7)r&rIrJrprMrN�accessrrr�$generate_introspection_for_interface�sB








z2CodeGenerator.generate_introspection_for_interfacec	Csn|jjd�|jj|jjd|j|jfd��|j||jd�|jjd�|jj|jjd|jd��i}t|j�dkr�xD|jD]:}|j	d|j
f}d|j
}|d|j|jf7}|||<q�Wt|j�dk�rxD|jD]:}|j	d	|j
f}d
|j
}|d|j|jf7}|||<q�Wt|j
�dk�rlxF|j
D]<}|j	d|j
f}d
|j
}|d|j|jf7}|||<�q,Wx0t|j�tjd�D]}|jjd||��q�W|jj|jjd|jd��|j||jd�|jjd�|jjd|j|jf�|jjd|j|j
f�|jjd�|jjd|j
|jf�t|j�dk�rht|j�dk�rht|j
�dk�rh|jjd�n|jjd�|jjd�t|j�dk�r�|jjd��x4|jD�](}|jj|jjd|j|j|jfd��|j�r�|jjd�x"|jD]}|jjd|j��q�W|jj|jjd|j|j|j
|j
fd��|j||jd�|j�rRd}	nd}	|jjd|j|j|j
t|j�|	f�|j�r�|jjd �x"|jD]}|jjd!|j��q�W|jjd"�|jjd��q�Wt|j�dk�r�|jjd#�x�|jD]�}|jj|jjd$|j|j|jfd��x"|jD]}|jjd%|j��q*W|jj|jjd&|j|jfd��|j||jd�|jjd'|j|j|j
t|j�f�x"|jD]}|jjd!|j��q�W|jjd"�|jjd��q�Wt|j
�dk�r^|jjd(��x`|j
D�]T}|j�r |j�r d)}
n,|j�r.d*}
n|j�r<d+}
ntd,j|j��|jj|jjd-|j|j|j|j|
fd��|j||jd�|jjd.�|jjd/k�r�d0|j|j|j|jjf}�nd|jjd1k�r�d2|j|j|jf}�n>|jjd3k�rd4|j|j|jf}�n|jjd5k�r2d6|j|j|jf}�n�|jjd7k�rXd8|j|j|jf}�n�|jjd9k�r~d:|j|j|jf}�n�|jjd;k�r�d<|j|j|jf}�n�|jjd=k�r�d>|j|j|jf}�nZ|jjd?k�r�d@|j|j|jf}�n4|jjdAk�rdB|j|j|jf}�n|jjdCk�r:dD|j|j|jf}n�|jjdEk�r^dD|j|j|jf}n�|jjdFk�r�dD|j|j|jf}n�|jjdGk�r�dD|j|j|jf}n~|jjdHk�r�dI|j|j|jf}nZ|jjdJk�r�dI|j|j|jf}n6|jjdKk�rdI|j|j|jf}ntdLj|jj��dM}|j�r8dN|}|jjdO||f�|jjd��qW|jjdP�dS)QNr(zF/**
 * %s:
 *
 * Abstract interface type for the D-Bus interface #%s.
Frz8/**
 * %sIface:
 * @parent_iface: The parent interface.
z
_method_%sz@handle_%s: z&Handler for the #%s::handle-%s signal.z
_signal_%sz@%s: zHandler for the #%s::%s signal.z_prop_get_%sz	@get_%s: zGetter for the #%s:%s property.)r/z * %s
z1 *
 * Virtual table for the D-Bus interface #%s.
ztypedef %sIface %sInterface;
z+G_DEFINE_INTERFACE (%s, %s, G_TYPE_OBJECT)
z+static void
%s_default_init (%sIface *ifacez G_GNUC_UNUSED)
z)
z{
z9  /* GObject signals for incoming D-Bus method calls: */
z[  /**
   * %s::handle-%s:
   * @object: A #%s.
   * @invocation: A #GDBusMethodInvocation.
z4   * @fd_list: (nullable): A #GUnixFDList or %NULL.
z0   * @arg_%s: Argument passed by remote caller.
au   *
   * Signal emitted when a remote caller is invoking the %s.%s() D-Bus method.
   *
   * If a signal handler returns %%TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call %s_complete_%s() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %%G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %%G_DBUS_METHOD_INVOCATION_HANDLED or %%TRUE if the invocation was handled, %%G_DBUS_METHOD_INVOCATION_UNHANDLED or %%FALSE to let other signal handlers run.
r1ra  g_signal_new ("handle-%s",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (%sIface, handle_%s),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    %d,
    G_TYPE_DBUS_METHOD_INVOCATIONz, G_TYPE_UNIX_FD_LISTz, %sz);
z4  /* GObject signals for received D-Bus signals: */
z(  /**
   * %s::%s:
   * @object: A #%s.
z   * @arg_%s: Argument.
z�   *
   * On the client-side, this signal is emitted whenever the D-Bus signal #%s::%s is received.
   *
   * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
z�  g_signal_new ("%s",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (%sIface, %s),
    NULL,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_NONE,
    %dz1  /* GObject properties for D-Bus properties: */
z�Since the D-Bus property for this #GObject property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side.z�Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.z�Since the D-Bus property for this #GObject property is writable but not readable, it is meaningful to write to it on both the client- and service-side. It is only meaningful, however, to read from it on the service-side.z>Cannot handle property "{}" that neither readable nor writablezO  /**
   * %s:%s:
   *
   * Represents the D-Bus property #%s:%s.
   *
   * %s
z.  g_object_interface_install_property (iface,
�G_TYPE_VARIANTzCg_param_spec_variant ("%s", "%s", "%s", G_VARIANT_TYPE ("%s"), NULL�bz-g_param_spec_boolean ("%s", "%s", "%s", FALSE�yz/g_param_spec_uchar ("%s", "%s", "%s", 0, 255, 0rmz=g_param_spec_int ("%s", "%s", "%s", G_MININT16, G_MAXINT16, 0�qz6g_param_spec_uint ("%s", "%s", "%s", 0, G_MAXUINT16, 0rIz=g_param_spec_int ("%s", "%s", "%s", G_MININT32, G_MAXINT32, 0�uz6g_param_spec_uint ("%s", "%s", "%s", 0, G_MAXUINT32, 0�xz?g_param_spec_int64 ("%s", "%s", "%s", G_MININT64, G_MAXINT64, 0�tz8g_param_spec_uint64 ("%s", "%s", "%s", 0, G_MAXUINT64, 0�dzEg_param_spec_double ("%s", "%s", "%s", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0rMz+g_param_spec_string ("%s", "%s", "%s", NULL�o�gZay�asz1g_param_spec_boxed ("%s", "%s", "%s", G_TYPE_STRVZaoZaayz%Unsupported gtype "{}" for GParamSpecz*G_PARAM_READWRITE | G_PARAM_STATIC_STRINGSzG_PARAM_DEPRECATED | z
    %s, %s));z}

)r%r)rkrsr7r4rtr	r8r9r6rrr=r?rArBrrCr:r;�gtyper>rfrgrr+r@rarD)r&rIZdoc_bitsrJr/rKrMrNrLZ
extra_args�hintrhrrr�generate_interface�s�


0
z CodeGenerator.generate_interfacecCs��x�|jD�]�}|jr"|jr"d}n(|jr.d}n|jr:d}ntdj|j��|jj|jj	d|j
|j
|j|j|j|fd��|jj
dk	r�|jjd|j
|j
f�n|jjd�|j||jd	�|jjd
|jj|j
|j
|jf�|jjd|j|j|j
f�|jjd�|jjd
�|jj
dk	�r�|jj|jj	d|j
|j
|j|j|j||jj
fd��|j||jd	�|jjd|jj|j
|j
|j|jjf�|jjd|j�|jjd�|jjd�|jjd
�|j�r�|j�r�d}n,|j�r�d}n|j�r�d}ntdj|j��|jj|jj	d|j
|j
|j|j|j|fd��|j||jd	�|jjd|j
|j
|j|jjf�|jjd|j�|jjd�|jjd
�q
WdS)Nz�Since this D-Bus property is both readable and writable, it is meaningful to use this function on both the client- and service-side.zrSince this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.zjSince this D-Bus property is not readable, it is only meaningful to use this function on the service-side.z>Cannot handle property "{}" that neither readable nor writablezk/**
 * %s_get_%s: (skip)
 * @object: A #%s.
 *
 * Gets the value of the #%s:%s D-Bus property.
 *
 * %s
 *
Fah * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use %s_dup_%s() if on another thread.
 *
 * Returns: (transfer none) (nullable): The property value or %%NULL if the property is not set. Do not free the returned value, it belongs to @object.
z  * Returns: The property value.
rz%s
%s_get_%s (%s *object)
{
z3  return %s%s_GET_IFACE (object)->get_%s (object);
z}
r(z�/**
 * %s_dup_%s: (skip)
 * @object: A #%s.
 *
 * Gets a copy of the #%s:%s D-Bus property.
 *
 * %s
 *
 * Returns: (transfer full) (nullable): The property value or %%NULL if the property is not set. The returned value should be freed with %s().
z'%s
%s_dup_%s (%s *object)
{
  %svalue;
z8  g_object_get (G_OBJECT (object), "%s", &value, NULL);
z  return value;
zjSince this D-Bus property is not writable, it is only meaningful to use this function on the service-side.zrSince this D-Bus property is writable, it is meaningful to use this function on both the client- and service-side.z�/**
 * %s_set_%s: (skip)
 * @object: A #%s.
 * @value: The value to set.
 *
 * Sets the #%s:%s D-Bus property to @value.
 *
 * %s
z'void
%s_set_%s (%s *object, %svalue)
{
z7  g_object_set (G_OBJECT (object), "%s", value, NULL);
)r?rfrgrr+r4r%r)rkrsr6r7r@rGrtr<rr5rHrr)r&rIrNr�rrr�generate_property_accessors	s�





z)CodeGenerator.generate_property_accessorscCs"�x|jD�]}|jj|jjd|j|j|jfd��x |jD]}|jjd|j�q>W|jj|jjd|j|jfd��|j	||jd�|jjd|j|j|jf�x&|jD]}|jjd|j
|jf�q�W|jjd|j�x |jD]}|jjd	|j�q�W|jjd
�|jjd�q
WdS)Nz&/**
 * %s_emit_%s:
 * @object: A #%s.
Fz. * @arg_%s: Argument to pass with the signal.
z& *
 * Emits the #%s::%s D-Bus signal.
rz void
%s_emit_%s (
    %s *objectz,
    %sarg_%sz))
{
  g_signal_emit_by_name (object, "%s"z, arg_%sz);
z}

)r=r%r)rkrsr6r7r>r4rtr<rr)r&rIrMrLrrr�generate_signal_emitters�	s2z&CodeGenerator.generate_signal_emittersc
Cs��x�|jD�]�}|jjd|j|j|jf�x |jD]}|jjd|j�q4W|jd6krd|jjd�|jrv|jjd�|jj|j	j
d|j|j|j|j|j|jfd��|j||jd	�|jjd
|j|j|jf�x&|jD]}|jjd|j|jf�q�W|jd7k�r|jjd�|j�r(|jjd
�|jjd�|j�rJ|jjd�n|jjd�|jjd|j�x"|jD]}|jjd|j
��qpW|jjd�x"|jD]}|jjd|j��q�W|jjd�|jd8k�r�|jjd�n|jjd�|j�r|jjd�|jjd�|jjd�|jjd|j|j|jf�x8|jD].}|jjd|j|j�r`d|jndf��q>W|j�r�|jjd�|jj|j	j
d |j|j|j|jfd��|j||jd	�|jjd!|j|j|jf�x(|jD]}|jjd"|j|jf��q�W|j�r|jjd#�|jjd$�|j�r:|jjd%�n|jjd&�|jjd'�|jjd(�x"|jD]}|jjd|j��qfW|jjd�x"|jD]}|jjd)|j��q�W|jjd*�|jjd+�|jjd,|j|j|jf�x"|jD]}|jjd|j��q�W|jd9k�r"|jjd�|j�r6|jjd�x8|jD].}|jjd|j|j�r`d|jndf��q>W|j�r�|jjd-�|jj|j	j
d.|j|j|j|jfd��|j||jd	�|jjd/|j|j|jf�x(|jD]}|jjd|j|jf��q�W|jd:k�r|jjd�|j�r0|jjd0�x(|jD]}|jjd"|j|jf��q8W|j�rn|jjd#�|jjd1�|j�r�|jjd2�n|jjd3�|jjd|j�x"|jD]}|jjd|j
��q�W|jjd�x"|jD]}|jjd|j��q�W|jjd�|jd;k�r(|jjd�n|jjd�|j�rH|jjd4�|jjd5�|jjd(�x"|jD]}|jjd|j��qhW|jjd�x"|jD]}|jjd)|j��q�W|jjd*�|jjd+�q
WdS)<Nz*/**
 * %s_call_%s:
 * @proxy: A #%sProxy.
z9 * @arg_%s: Argument to pass with the method invocation.
r1r2a6 * @call_flags: Flags from the #GDBusCallFlags enumeration. If you want to allow interactive
       authorization be sure to set %G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION.
 * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or
       -1 to use the proxy default timeout.
z2 * @fd_list: (nullable): A #GUnixFDList or %NULL.
aU * @cancellable: (nullable): A #GCancellable or %%NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %%NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the %s.%s() D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call %s_call_%s_finish() to get the result of the operation.
 *
 * See %s_call_%s_sync() for the synchronous, blocking version of this method.
Frzvoid
%s_call_%s (
    %s *proxyz,
    %sarg_%sz6,
    GDBusCallFlags call_flags,
    gint timeout_msecz,
    GUnixFDList *fd_listz],
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
z=  g_dbus_proxy_call_with_unix_fd_list (G_DBUS_PROXY (proxy),
z+  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
z    "%s",
    g_variant_new ("(z%sz)"z,
                   arg_%sz),
z"    call_flags,
    timeout_msec,
z$    G_DBUS_CALL_FLAGS_NONE,
    -1,
z
    fd_list,
z/    cancellable,
    callback,
    user_data);
z}

z1/**
 * %s_call_%s_finish:
 * @proxy: A #%sProxy.
zZ * @out_%s: (out) (optional)%s: Return location for return parameter or %%NULL to ignore.
� rzZ * @out_fd_list: (out) (optional): Return location for a #GUnixFDList or %NULL to ignore.
a * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to %s_call_%s().
 * @error: Return location for error or %%NULL.
 *
 * Finishes an operation started with %s_call_%s().
 *
 * Returns: (skip): %%TRUE if the call succeeded, %%FALSE if @error is set.
z*gboolean
%s_call_%s_finish (
    %s *proxyz,
    %sout_%sz,
    GUnixFDList **out_fd_listzA,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
ze  _ret = g_dbus_proxy_call_with_unix_fd_list_finish (G_DBUS_PROXY (proxy), out_fd_list, res, error);
zF  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
z#  if (_ret == NULL)
    goto _out;
z*  g_variant_get (_ret,
                 "(z,
                 out_%sz);
  g_variant_unref (_ret);
z _out:
  return _ret != NULL;
}

z//**
 * %s_call_%s_sync:
 * @proxy: A #%sProxy.
zE * @out_fd_list: (out): Return location for a #GUnixFDList or %NULL.
at * @cancellable: (nullable): A #GCancellable or %%NULL.
 * @error: Return location for error or %%NULL.
 *
 * Synchronously invokes the %s.%s() D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See %s_call_%s() for the asynchronous version of this method.
 *
 * Returns: (skip): %%TRUE if the call succeeded, %%FALSE if @error is set.
z(gboolean
%s_call_%s_sync (
    %s *proxyz,
    GUnixFDList  *fd_listzI,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
zI  _ret = g_dbus_proxy_call_with_unix_fd_list_sync (G_DBUS_PROXY (proxy),
z7  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
z    fd_list,
    out_fd_list,
z@    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
)r1r2)r1r2)r1r2)r1r2)r1r2)r1r2)r8r%r)r6r7r;r4r"r:rkrsrtr<�	format_inrEZarray_annotationrFZ
format_out)r&rIrJrLrrr�generate_method_calls�	sH

&&z#CodeGenerator.generate_method_callscCs��x�|jD�]�}|jjd|j|j|jf�|jr>|jjd�x |jD]}|jjd|j�qFW|jj|jj	d|j|jfd��|j
||jd�|jjd|j|j|jf�|jr�|jjd�x&|jD]}|jjd	|j|jf�q�W|jjd
�|j�r
|jjd�n|jjd�x"|jD]}|jjd
|j��qW|jjd�x"|jD]}|jjd|j��qNW|j�r�|jjd�n|jjd�|jjd�q
WdS)Nze/**
 * %s_complete_%s:
 * @object: A #%s.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
z2 * @fd_list: (nullable): A #GUnixFDList or %NULL.
z * @%s: Parameter to return.
a= *
 * Helper function used in service implementations to finish handling invocations of the %s.%s() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
FrzYvoid
%s_complete_%s (
    %s *object G_GNUC_UNUSED,
    GDBusMethodInvocation *invocationz,
    GUnixFDList *fd_listz
,
    %s%sz)
{
z\  g_dbus_method_invocation_return_value_with_unix_fd_list (invocation,
    g_variant_new ("(zJ  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("(z%sz)"z,
                   %sz),
    fd_list);
z));
z}

)
r8r%r)r6r7r:rEr4rkrsrtr<r�)r&rIrJrLrrr�generate_method_completers�
sJz(CodeGenerator.generate_method_completerscCs�|jjd�|jj|jjd|j|jfd��|j||jd�|jjd�|jj|jjd|j|jfd��|j||jd�|jjd�|jjd|j�|jjd|j|jf�|jjd	�|jjd
|j|jf�|jjd|j�|jjd|j|j|jf�|jjd
�|jjd
|j|jf�|jjd|j|j|jf�|jjd�|jjd|j�|jjd|j|j|jf�|jjd�|jjd|j�|jjd|j�t	|j
�dk�r�|jjd�n|jjd�|jjd�t	|j
�dk�r|jjdt	|j
�|jf�|jjd�t	|j
�dk�r\|jjd|j�|jjd|j�|jjd�|jjd|j�t	|j
�dk�r�|jjd�n|jjd�|jjd�t	|j
�dk�r�|jjdt	|j
�|j|j|jf�|jjd�|jjd|j�|jjd �|jjd!|j�|jjd"|j|jf�|jjd#�|jjd$|j|jf�|jjd%�|jjd&�|jjd�|jjd'|j�|jjd(|j|j|j|j|jf��x�|j
D�]�}d)}|jj
dk	�r�d*}|jjd+|jj|j|j|j|j|j|j|jj|f	�d}|jjd,k�s4|jjd-k�s4|jjd.k�r8d/}|�rP|jjd0|j�|jjd1|j�|jjd2k�r�|jjd3�|jjd4�|jjd5�n�|jjd6�d7}|jjd8k�s�|jjd,k�s�|jjd-k�s�|jjd.k�r�d9}|jjd:|jj|f�|�r|jjd;|j�|jjd<�|jjd=�|jjd>�|jjd?�|jjd��q�W|jjd@|j|j|j|j|j|j|jf�|jjdA|j|j|j|j|j|j|jf�t	|j
�dk�r�|jjdB|j�|jjdC|j�|jjd�|jjdD|j|jf�t	|j
�dk�r"|jjdE�n|jjdF�|jjdG�x,|j
D]"}|jjdH|j|j|jf��qBW|jjd�|jj|jjdI|j|j|j|jfd��|j||jd�|jjdJ|j|j|j|jf�|jjdK|j|j|j|jf�|j||jd�|jjdL|j|j|j|jf�|jj|jjdM|j|j|j|jfd��|j||jd�|jjdN|j|j|j|j|j|j|jf�|jjd�|jj|jjdO|j|j|j|jfd��|j||jd�|jjdP|j|j|j|jf�|jjdQ|j|j|j|jf�|j||jd�|jjdR|j|j|j|jf�|jj|jjdS|j|j|j|jfd��|j||jd�|jjdT|j|j|j|j|j|j|jf�|jjd�dS)UNzP/* ------------------------------------------------------------------------ */

z|/**
 * %sProxy:
 *
 * The #%sProxy structure contains only private data and should only be accessed using the provided API.
Frr(z]/**
 * %sProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #%sProxy.
z-struct _%sProxyPrivate
{
  GData *qdata;
};

z3static void %s_proxy_iface_init (%sIface *iface);

z2#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
z?G_DEFINE_TYPE_WITH_CODE (%sProxy, %s_proxy, G_TYPE_DBUS_PROXY,
z1                         G_ADD_PRIVATE (%sProxy)
zR                         G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_proxy_iface_init))

z#else
z#endif
z2static void
%s_proxy_finalize (GObject *object)
{
z(  %sProxy *proxy = %s%s_PROXY (object);
z*  g_datalist_clear (&proxy->priv->qdata);
z@  G_OBJECT_CLASS (%s_proxy_parent_class)->finalize (object);
}

z7static void
%s_proxy_get_property (GObject      *objectz\ G_GNUC_UNUSED,
  guint         prop_id G_GNUC_UNUSED,
  GValue       *value G_GNUC_UNUSED,
z2,
  guint         prop_id,
  GValue       *value,
z'  GParamSpec   *pspec G_GNUC_UNUSED)
{
a  const _ExtendedGDBusPropertyInfo *info;
  GVariant *variant;
  g_assert (prop_id != 0 && prop_id - 1 < %d);
  info = (const _ExtendedGDBusPropertyInfo *) _%s_property_info_pointers[prop_id - 1];
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
  if (info->use_gvariant)
    {
      g_value_set_variant (value, variant);
    }
  else
    {
      if (variant != NULL)
        g_dbus_gvariant_to_gvalue (variant, value);
    }
  if (variant != NULL)
    g_variant_unref (variant);
z}

zkstatic void
%s_proxy_set_property_cb (GDBusProxy *proxy,
  GAsyncResult *res,
  gpointer      user_data)
{
a�  const _ExtendedGDBusPropertyInfo *info = user_data;
  GError *error;
  GVariant *_ret;
  error = NULL;
  _ret = g_dbus_proxy_call_finish (proxy, res, &error);
  if (!_ret)
    {
      g_warning ("Error setting property '%%s' on interface %s: %%s (%%s, %%d)",
                 info->parent_struct.name, 
                 error->message, g_quark_to_string (error->domain), error->code);
      g_error_free (error);
    }
  else
    {
      g_variant_unref (_ret);
    }
z#static void
%s_proxy_set_property (zpGObject      *object G_GNUC_UNUSED,
  guint         prop_id G_GNUC_UNUSED,
  const GValue *value G_GNUC_UNUSED,
zFGObject      *object,
  guint         prop_id,
  const GValue *value,
ai  const _ExtendedGDBusPropertyInfo *info;
  GVariant *variant;
  g_assert (prop_id != 0 && prop_id - 1 < %d);
  info = (const _ExtendedGDBusPropertyInfo *) _%s_property_info_pointers[prop_id - 1];
  variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
  g_dbus_proxy_call (G_DBUS_PROXY (object),
    "org.freedesktop.DBus.Properties.Set",
    g_variant_new ("(ssv)", "%s", info->parent_struct.name, variant),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    NULL, (GAsyncReadyCallback) %s_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
  g_variant_unref (variant);
z�static void
%s_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
z�  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  gsize num_params;
  gsize n;
  guint signal_id;
z�  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_%s_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
z�  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], %sTYPE_%s);
  g_value_set_object (&paramv[0], proxy);
a�  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
z>  signal_id = g_signal_lookup (info->signal_name, %sTYPE_%s);
z/  g_signal_emitv (paramv, signal_id, 0, NULL);
zZ  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
z�static void
%s_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
a�  %sProxy *proxy = %s%s_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_%s_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_%s_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

�0ZNULLzvstatic %s
%s_proxy_get_%s (%s *object)
{
  %sProxy *proxy = %s%s_PROXY (object);
  GVariant *variant;
  %svalue = %s;
Zg_variant_get_strvZg_variant_get_objvZg_variant_get_bytestring_arrayTzb  value = g_datalist_get_data (&proxy->priv->qdata, "%s");
  if (value != NULL)
    return value;
zK  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "%s");
rwz  value = variant;
z  if (variant != NULL)
z    g_variant_unref (variant);
z  if (variant != NULL)
    {
rZg_variant_get_stringz, NULLz      value = %s (variant%s);
zV      g_datalist_set_data_full (&proxy->priv->qdata, "%s", (gpointer) value, g_free);
z!      g_variant_unref (variant);
z    }
z  return value;
z}
aMstatic void
%s_proxy_init (%sProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = %s_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, %sTYPE_%s_PROXY, %sProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), %s_interface_info ());
}

a�static void
%s_proxy_class_init (%sProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = %s_proxy_finalize;
  gobject_class->get_property = %s_proxy_get_property;
  gobject_class->set_property = %s_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = %s_proxy_g_signal;
  proxy_class->g_properties_changed = %s_proxy_g_properties_changed;

z.  %s_override_properties (gobject_class, 1);

zu#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (%sProxyPrivate));
#endif
z/static void
%s_proxy_iface_init (%sIface *ifacez G_GNUC_UNUSED)
z)
z{
z#  iface->get_%s = %s_proxy_get_%s;
a�/**
 * %s_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (nullable): A bus name (well-known or unique) or %%NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (nullable): A #GCancellable or %%NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface #%s. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call %s_proxy_new_finish() to get the result of the operation.
 *
 * See %s_proxy_new_sync() for the synchronous, blocking version of this constructor.
a�void
%s_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (%sTYPE_%s_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "%s", NULL);
}

aH/**
 * %s_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to %s_proxy_new().
 * @error: Return location for error or %%NULL
 *
 * Finishes an operation started with %s_proxy_new().
 *
 * Returns: (transfer full) (type %sProxy): The constructed proxy object or %%NULL if @error is set.
az%s *
%s_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return %s%s (ret);
  else
    return NULL;
}

a�/**
 * %s_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (nullable): A bus name (well-known or unique) or %%NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (nullable): A #GCancellable or %%NULL.
 * @error: Return location for error or %%NULL
 *
 * Synchronously creates a proxy for the D-Bus interface #%s. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See %s_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type %sProxy): The constructed proxy object or %%NULL if @error is set.
a�%s *
%s_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (%sTYPE_%s_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "%s", NULL);
  if (ret != NULL)
    return %s%s (ret);
  else
    return NULL;
}

a3/**
 * %s_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (nullable): A #GCancellable or %%NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like %s_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call %s_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See %s_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
a�void
%s_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (%sTYPE_%s_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "%s", NULL);
}

a`/**
 * %s_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to %s_proxy_new_for_bus().
 * @error: Return location for error or %%NULL
 *
 * Finishes an operation started with %s_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type %sProxy): The constructed proxy object or %%NULL if @error is set.
a�%s *
%s_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return %s%s (ret);
  else
    return NULL;
}

ax/**
 * %s_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (nullable): A #GCancellable or %%NULL.
 * @error: Return location for error or %%NULL
 *
 * Like %s_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See %s_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type %sProxy): The constructed proxy object or %%NULL if @error is set.
a�%s *
%s_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (%sTYPE_%s_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "%s", NULL);
  if (ret != NULL)
    return %s%s (ret);
  else
    return NULL;
}

)r%r)rkrsr7rtr6rr5r	r?r4r@rGr<Zgvariant_getr�)r&rIrNZ	nul_valueZfree_containerZ	extra_lenrrr�generate_proxys






	






zCodeGenerator.generate_proxycCs�	|jjd�|jj|jjd|j|jfd��|j||jd�|jjd�|jj|jjd|j|jfd��|j||jd�|jjd�|jjd|j�|jjd|j|j|j|jf�|jjd	�|jjd
|j|jf�|jjd�|jjd|j|jf�|jjd
�|jjd�|jjd�|jjd|j|j|j|jf�|jjd|j�|jjd|j|j|j|jf�|jjd|j�|jjd|j|j|j|jf�|jjd|j|jf�|jjd�|jjd|j|jf�|jjd�|jjd|j|j|j|jf�|jjd|j|j|j|j|j	f�t
|j�dk�rX|jjd|j�|jjd|j�t
|j�dk�r�|jjd�n|jjd�|jjd�t
|j�dk�r�|jjd|j|j|j|jf�|jjd��x|jD�]}|jjd|j|j|jf�x(|j
D]}|jjd |j|j	f��qW|jjd!|j|j|jf�|jjd"�x"|j
D]}|jjd#|j��qbW|jjd$�x"|j
D]}|jjd%|j	��q�W|jjd&�|jjd'|j	|j	f�|jjd(�|jjd)�|jjd��q�W|jjd*|j|jf�|jjd+�|jjd,|j|jf�|jjd-|j�|jjd.|j|j|jf�|jjd/�|jjd,|j|jf�|jjd.|j|j|jf�|jjd0�|jjd1|j�|jjd2|j|j|jf�t
|j�dk�r|jjd3t
|j��|jjd4�|jjd5�|jjd6�|jjd7�|jjd8�|jjd9�|jjd:|j�t
|j�dk�r�|jjd;|j�|jjd<|j|j|jt
|j�f�|jjd�|jjd=|j|j|j|jf�|jjd>|j	�|jjd5�|jjd?�|jjd@�|jjdA�|jjdB�|jjdC|j|jf�|jjdD�|jjdE|j|j|j|j|j|jf�|jjdF|j�|jjdG|j|j|jt
|j�|j|jf�|jjd�|jjdH|j|j|j|j|j|jf�|jjdI�|jjdJ�t
|j�dk�rR|jjdKt
|j��d}x0|jD]&}|jjdL||jjf�|dM7}�q(W|jjd�d}x�|jD]�}|jjdN|jj|j|j|jf�|jjd2|j|j|jf�|jjdO|jj|jj|f�|jjdP�|jjdQ�|jjd�|dM7}�qjW|jjdR|j|j|jf�t
|j�dk�rV|jjdS|j|j|jf�|jjdT|j�|jjdU�|jjdV|j�|jjdW|j�|jjdX|j�|jjdY|j�|jjdZ|j�|jjd�|jjd[|j|jf�t
|j�dk�	rt
|j�dk�	r|jjd�n|jjd�|jjd�x,|jD]"}|jjd\|j|j|jf��	q.Wx,|jD]"}|jjd]|j|j|jf��	q\W|jjd�|jj|jjd^|j|j	|jfd��|j||jd�|jjd_|j|j|j|j|j|jf�dS)`NzP/* ------------------------------------------------------------------------ */

z�/**
 * %sSkeleton:
 *
 * The #%sSkeleton structure contains only private data and should only be accessed using the provided API.
Frr(zc/**
 * %sSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #%sSkeleton.
z�struct _%sSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

a5static void
_%s_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  %sSkeleton *skeleton = %s%s_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  gsize num_params;
  guint num_extra;
  gsize n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
zx  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
aq  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], %sTYPE_%s);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
a�  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
z>  signal_id = g_signal_lookup (info->signal_name, %sTYPE_%s);
ae  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
  g_value_unset (&return_value);
zb  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
z}

a�static GVariant *
_%s_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  %sSkeleton *skeleton = %s%s_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
a�  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_%s_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %%s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

a�static gboolean
_%s_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  %sSkeleton *skeleton = %s%s_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
a�  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_%s_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %%s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

z�static const GDBusInterfaceVTable _%s_skeleton_vtable =
{
  _%s_skeleton_handle_method_call,
  _%s_skeleton_handle_get_property,
  _%s_skeleton_handle_set_property,
  {NULL}
};

z�static GDBusInterfaceInfo *
%s_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return %s_interface_info ();
z�static GDBusInterfaceVTable *
%s_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_%s_skeleton_vtable;
z�static GVariant *
%s_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  %sSkeleton *skeleton = %s%s_SKELETON (_skeleton);
a�
  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_%s_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _%s_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _%s_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _%s_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "%s", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

z8static gboolean _%s_emit_changed (gpointer user_data);

zOstatic void
%s_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeletonz G_GNUC_UNUSED)
z)
z{
a�  %sSkeleton *skeleton = %s%s_SKELETON (_skeleton);
  gboolean emit_changed = FALSE;

  g_mutex_lock (&skeleton->priv->lock);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    {
      g_source_destroy (skeleton->priv->changed_properties_idle_source);
      skeleton->priv->changed_properties_idle_source = NULL;
      emit_changed = TRUE;
    }
  g_mutex_unlock (&skeleton->priv->lock);

  if (emit_changed)
    _%s_emit_changed (skeleton);
z-static void
_%s_on_signal_%s (
    %s *objectz,
    %sarg_%sz�)
{
  %sSkeleton *skeleton = %s%s_SKELETON (object);

  GList      *connections, *l;
  GVariant   *signal_variant;
  connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
z9
  signal_variant = g_variant_ref_sink (g_variant_new ("(z%sz)"z,
                   arg_%sz));
a%  for (l = connections; l != NULL; l = l->next)
    {
      GDBusConnection *connection = l->data;
      g_dbus_connection_emit_signal (connection,
        NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "%s", "%s",
        signal_variant, NULL);
    }
z$  g_variant_unref (signal_variant);
z2  g_list_free_full (connections, g_object_unref);
z5static void %s_skeleton_iface_init (%sIface *iface);
z2#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
zRG_DEFINE_TYPE_WITH_CODE (%sSkeleton, %s_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
z4                         G_ADD_PRIVATE (%sSkeleton)
zU                         G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_skeleton_iface_init))

z#else
z#endif
z5static void
%s_skeleton_finalize (GObject *object)
{
z1  %sSkeleton *skeleton = %s%s_SKELETON (object);
zZ  guint n;
  for (n = 0; n < %d; n++)
    g_value_unset (&skeleton->priv->properties[n]);
z'  g_free (skeleton->priv->properties);
zb  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
z>  if (skeleton->priv->changed_properties_idle_source != NULL)
zG    g_source_destroy (skeleton->priv->changed_properties_idle_source);
z2  g_main_context_unref (skeleton->priv->context);
z)  g_mutex_clear (&skeleton->priv->lock);
zC  G_OBJECT_CLASS (%s_skeleton_parent_class)->finalize (object);
}

z�static void
%s_skeleton_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
z�  %sSkeleton *skeleton = %s%s_SKELETON (object);
  g_assert (prop_id != 0 && prop_id - 1 < %d);
  g_mutex_lock (&skeleton->priv->lock);
  g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
  g_mutex_unlock (&skeleton->priv->lock);
zlstatic gboolean
_%s_emit_changed (gpointer user_data)
{
  %sSkeleton *skeleton = %s%s_SKELETON (user_data);
a�  GList *l;
  GVariantBuilder builder;
  GVariantBuilder invalidated_builder;
  guint num_changes;

  g_mutex_lock (&skeleton->priv->lock);
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
  for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
    {
      ChangedProperty *cp = l->data;
      GVariant *variant;
      const GValue *cur_value;

      cur_value = &skeleton->priv->properties[cp->prop_id - 1];
      if (!_g_value_equal (cur_value, &cp->orig_value))
        {
          variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
          g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
          g_variant_unref (variant);
          num_changes++;
        }
    }
  if (num_changes > 0)
    {
      GList *connections, *ll;
      GVariant *signal_variant;
      signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "%s",
                                           &builder, &invalidated_builder));
      connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
      for (ll = connections; ll != NULL; ll = ll->next)
        {
          GDBusConnection *connection = ll->data;

          g_dbus_connection_emit_signal (connection,
                                         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
                                         "org.freedesktop.DBus.Properties",
                                         "PropertiesChanged",
                                         signal_variant,
                                         NULL);
        }
      g_variant_unref (signal_variant);
      g_list_free_full (connections, g_object_unref);
    }
  else
    {
      g_variant_builder_clear (&builder);
      g_variant_builder_clear (&invalidated_builder);
    }
z-  skeleton->priv->changed_properties = NULL;
z9  skeleton->priv->changed_properties_idle_source = NULL;
z*  g_mutex_unlock (&skeleton->priv->lock);
z  return FALSE;
}

a�static void
_%s_schedule_emit_changed (%sSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
{
  ChangedProperty *cp;
  GList *l;
  cp = NULL;
  for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
    {
      ChangedProperty *i_cp = l->data;
      if (i_cp->info == info)
        {
          cp = i_cp;
          break;
        }
    }
aT  if (cp == NULL)
    {
      cp = g_new0 (ChangedProperty, 1);
      cp->prop_id = prop_id;
      cp->info = info;
      skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
      g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
      g_value_copy (orig_value, &cp->orig_value);
    }
}

a�static void
%s_skeleton_notify (GObject      *object,
  GParamSpec *pspec G_GNUC_UNUSED)
{
  %sSkeleton *skeleton = %s%s_SKELETON (object);
  g_mutex_lock (&skeleton->priv->lock);
  if (skeleton->priv->changed_properties != NULL &&
      skeleton->priv->changed_properties_idle_source == NULL)
    {
      skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
      g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
      g_source_set_callback (skeleton->priv->changed_properties_idle_source, _%s_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _%s_emit_changed");
      g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
      g_source_unref (skeleton->priv->changed_properties_idle_source);
    }
  g_mutex_unlock (&skeleton->priv->lock);
}

z�static void
%s_skeleton_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec)
{
a4  const _ExtendedGDBusPropertyInfo *info;
  %sSkeleton *skeleton = %s%s_SKELETON (object);
  g_assert (prop_id != 0 && prop_id - 1 < %d);
  info = (const _ExtendedGDBusPropertyInfo *) _%s_property_info_pointers[prop_id - 1];
  g_mutex_lock (&skeleton->priv->lock);
  g_object_freeze_notify (object);
  if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
    {
      if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL &&
          info->emits_changed_signal)
        _%s_schedule_emit_changed (skeleton, info, prop_id, &skeleton->priv->properties[prop_id - 1]);
      g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
      g_object_notify_by_pspec (object, pspec);
    }
  g_mutex_unlock (&skeleton->priv->lock);
  g_object_thaw_notify (object);
astatic void
%s_skeleton_init (%sSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = %s_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, %sTYPE_%s_SKELETON, %sSkeletonPrivate);
#endif

z(  g_mutex_init (&skeleton->priv->lock);
zB  skeleton->priv->context = g_main_context_ref_thread_default ();
z4  skeleton->priv->properties = g_new0 (GValue, %d);
z6  g_value_init (&skeleton->priv->properties[%d], %s);
rz,static %s
%s_skeleton_get_%s (%s *object)
{
z�  %svalue;
  g_mutex_lock (&skeleton->priv->lock);
  value = %s (&(skeleton->priv->properties[%d]));
  g_mutex_unlock (&skeleton->priv->lock);
z  return value;
z}
z�static void
%s_skeleton_class_init (%sSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = %s_skeleton_finalize;
z�  gobject_class->get_property = %s_skeleton_get_property;
  gobject_class->set_property = %s_skeleton_set_property;
  gobject_class->notify       = %s_skeleton_notify;

z.
  %s_override_properties (gobject_class, 1);
z=
  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
zB  skeleton_class->get_info = %s_skeleton_dbus_interface_get_info;
zN  skeleton_class->get_properties = %s_skeleton_dbus_interface_get_properties;
z<  skeleton_class->flush = %s_skeleton_dbus_interface_flush;
zF  skeleton_class->get_vtable = %s_skeleton_dbus_interface_get_vtable;
zy
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (%sSkeletonPrivate));
#endif
z2static void
%s_skeleton_iface_init (%sIface *ifacez   iface->%s = _%s_on_signal_%s;
z&  iface->get_%s = %s_skeleton_get_%s;
z�/**
 * %s_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface #%s.
 *
 * Returns: (transfer full) (type %sSkeleton): The skeleton object.
zZ%s *
%s_skeleton_new (void)
{
  return %s%s (g_object_new (%sTYPE_%s_SKELETON, NULL));
}

)r%r)rkrsr7rtr6rr5r4r	r?r=r>r<r�r@r�Z
ctype_in_gZ
gvalue_get)r&rIrMrLrmrNrrr�generate_skeleton�
s>







1

	




 zCodeGenerator.generate_skeletonc
Cs�|jjd�|jj|jjd|j|j|j|j|jfd��|jjd�|jj|jjd|j|jfd��|jjd�|jj|jjd|j|jfd��|jjd�|jjd|j|jf�|jjd|j|jf�|jjd�|jjd	|j|jf�x�|jD]x}|jj|jjd
|j|j|j|j	fd��|j
||jd�d}|j�rPd
|}|jjd|j|j|j|j|j
|f�q�W|jjd�x�|jD]�}|jj|jjd|j|j
j�|j|j|j	|jfd��|j
||jd�|jjd|j|j|j
j�|jf�|jjd|j	|j|j
f��q�W|jjd�x�|jD]�}|jj|jjd|j|j
j�|j|j|j
j�|jfd��|j
||jd�|jjd|j|j|j
j�|jf�|jjd|j	|j|j
f��q2W|jjd�|jjd|j�|jj|jjd|j|jfd��|jjd�|jjd�|jj|jjd|j|jfd��|jjd�|jjd�|jjd|j|j|jf�|jjd|j|j|jf�|jjd�|jjd|j|j|j|j|j|jf�|jjd|j|jf�|jjd|j�|jjd�|jjd |j|j|jf�d!}x.|jD]$}|jjd"||j	f�|d!7}�q"W|jjd#�|jjd$|j|j|j|jf�d!}x.|jD]$}|jjd%||jf�|d!7}�q�W|jjd�|jj|jjd&|jd��|jjd'|j|j|j|jf�|jj|jjd(|j|jfd��|jjd�|jjd�|jj|jjd)|j|jfd��|jjd�|jjd�|jjd*|j|j|jf�|jjd�|jjd+|j|j|jf�|jjd,|j|j|j|j|j|jf�|jjd-|j|jf�|jjd.|j|j|jf�d!}x6|jD],}|jjd/||j|j
|j	f�|d!7}�qW|jjd#�|jjd0|j|j|jf�d!}x.|jD]$}|jjd"||j	f�|d!7}�qvW|jjd#�|jjd1|j|j|j|jf�d!}x.|jD]$}|jjd%||jf�|d!7}�q�W|jjd�|jj|jjd2|jd��|jjd3|j|j|j|jf�x�|jD]�}|jj|jjd4|j|j
j�|j|j|j|j	fd��|j
||jd�|jjd5|j|j
j�|j|jf�|jjd6|j��qNW|jjd�dS)7Nz�/* ------------------------------------------------------------------------
 * Code for Object, ObjectProxy and ObjectSkeleton
 * ------------------------------------------------------------------------
 */

a/**
 * SECTION:%sObject
 * @title: %sObject
 * @short_description: Specialized GDBusObject types
 *
 * This section contains the #%sObject, #%sObjectProxy, and #%sObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
 */
Fr(zX/**
 * %sObject:
 *
 * The #%sObject type is a specialized container of interfaces.
 */
zs/**
 * %sObjectIface:
 * @parent_iface: The parent interface.
 *
 * Virtual table for the #%sObject interface.
 */
z)typedef %sObjectIface %sObjectInterface;
z�G_DEFINE_INTERFACE_WITH_CODE (%sObject, %sobject, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT);)
z;static void
%sobject_default_init (%sObjectIface *iface)
{
z�  /**
   * %sObject:%s:
   *
   * The #%s instance corresponding to the D-Bus interface #%s, if any.
   *
   * Connect to the #GObject::notify signal to get informed of property changes.
r1z*G_PARAM_READWRITE | G_PARAM_STATIC_STRINGSzG_PARAM_DEPRECATED | zg  g_object_interface_install_property (iface, g_param_spec_object ("%s", "%s", "%s", %sTYPE_%s, %s));

z}

a/**
 * %sobject_get_%s:
 * @object: A #%sObject.
 *
 * Gets the #%s instance for the D-Bus interface #%s on @object, if any.
 *
 * Returns: (transfer full) (nullable): A #%s that must be freed with g_object_unref() or %%NULL if @object does not implement the interface.
rz'%s *%sobject_get_%s (%sObject *object)
z�{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "%s");
  if (ret == NULL)
    return NULL;
  return %s%s (ret);
}

a�/**
 * %sobject_peek_%s: (skip)
 * @object: A #%sObject.
 *
 * Like %sobject_get_%s() but doesn't increase the reference count on the returned object.
 *
 * It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.
 *
 * Returns: (transfer none) (nullable): A #%s or %%NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
z(%s *%sobject_peek_%s (%sObject *object)
z�{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "%s");
  if (ret == NULL)
    return NULL;
  g_object_unref (ret);
  return %s%s (ret);
}

a�static void
%sobject_notify (GDBusObject *object, GDBusInterface *interface)
{
  _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
  /* info can be NULL if the other end is using a D-Bus interface we don't know
   * anything about, for example old generated code in this process talking to
   * newer generated code in the other process. */
  if (info != NULL)
    g_object_notify (G_OBJECT (object), info->hyphen_name);
}

z�/**
 * %sObjectProxy:
 *
 * The #%sObjectProxy structure contains only private data and should only be accessed using the provided API.
z */
zi/**
 * %sObjectProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #%sObjectProxy.
zZstatic void
%sobject_proxy__%sobject_iface_init (%sObjectIface *iface G_GNUC_UNUSED)
{
}

z�static void
%sobject_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
{
  iface->interface_added = %sobject_notify;
  iface->interface_removed = %sobject_notify;
}

a&G_DEFINE_TYPE_WITH_CODE (%sObjectProxy, %sobject_proxy, G_TYPE_DBUS_OBJECT_PROXY,
                         G_IMPLEMENT_INTERFACE (%sTYPE_OBJECT, %sobject_proxy__%sobject_iface_init)
                         G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, %sobject_proxy__g_dbus_object_iface_init))

zKstatic void
%sobject_proxy_init (%sObjectProxy *object G_GNUC_UNUSED)
{
}

z�static void
%sobject_proxy_set_property (GObject      *gobject,
  guint         prop_id,
  const GValue *value G_GNUC_UNUSED,
  GParamSpec   *pspec)
{
  G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
z�static void
%sobject_proxy_get_property (GObject      *gobject,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec)
{
  %sObjectProxy *object = %sOBJECT_PROXY (gobject);
  GDBusInterface *interface;

  switch (prop_id)
    {
rz�    case %d:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "%s");
      g_value_take_object (value, interface);
      break;

zd    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
      break;
  }
}

z�static void
%sobject_proxy_class_init (%sObjectProxyClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);

  gobject_class->set_property = %sobject_proxy_set_property;
  gobject_class->get_property = %sobject_proxy_get_property;

z>  g_object_class_override_property (gobject_class, %d, "%s");
z�/**
 * %sobject_proxy_new:
 * @connection: A #GDBusConnection.
 * @object_path: An object path.
 *
 * Creates a new proxy object.
 *
 * Returns: (transfer full): The proxy object.
 */
ai%sObjectProxy *
%sobject_proxy_new (GDBusConnection *connection,
  const gchar *object_path)
{
  g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
  g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
  return %sOBJECT_PROXY (g_object_new (%sTYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
}

z�/**
 * %sObjectSkeleton:
 *
 * The #%sObjectSkeleton structure contains only private data and should only be accessed using the provided API.
zo/**
 * %sObjectSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #%sObjectSkeleton.
z]static void
%sobject_skeleton__%sobject_iface_init (%sObjectIface *iface G_GNUC_UNUSED)
{
}

z�static void
%sobject_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
{
  iface->interface_added = %sobject_notify;
  iface->interface_removed = %sobject_notify;
}

a5G_DEFINE_TYPE_WITH_CODE (%sObjectSkeleton, %sobject_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
                         G_IMPLEMENT_INTERFACE (%sTYPE_OBJECT, %sobject_skeleton__%sobject_iface_init)
                         G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, %sobject_skeleton__g_dbus_object_iface_init))

zQstatic void
%sobject_skeleton_init (%sObjectSkeleton *object G_GNUC_UNUSED)
{
}

astatic void
%sobject_skeleton_set_property (GObject      *gobject,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec)
{
  %sObjectSkeleton *object = %sOBJECT_SKELETON (gobject);
  GDBusInterfaceSkeleton *interface;

  switch (prop_id)
    {
a�    case %d:
      interface = g_value_get_object (value);
      if (interface != NULL)
        {
          g_warn_if_fail (%sIS_%s (interface));
          g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
        }
      else
        {
          g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "%s");
        }
      break;

z�static void
%sobject_skeleton_get_property (GObject      *gobject,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec)
{
  %sObjectSkeleton *object = %sOBJECT_SKELETON (gobject);
  GDBusInterface *interface;

  switch (prop_id)
    {
astatic void
%sobject_skeleton_class_init (%sObjectSkeletonClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);

  gobject_class->set_property = %sobject_skeleton_set_property;
  gobject_class->get_property = %sobject_skeleton_get_property;

z�/**
 * %sobject_skeleton_new:
 * @object_path: An object path.
 *
 * Creates a new skeleton object.
 *
 * Returns: (transfer full): The skeleton object.
 */
z�%sObjectSkeleton *
%sobject_skeleton_new (const gchar *object_path)
{
  g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
  return %sOBJECT_SKELETON (g_object_new (%sTYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
}

z�/**
 * %sobject_skeleton_set_%s:
 * @object: A #%sObjectSkeleton.
 * @interface_: (nullable): A #%s or %%NULL to clear the interface.
 *
 * Sets the #%s instance for the D-Bus interface #%s on @object.
zIvoid %sobject_skeleton_set_%s (%sObjectSkeleton *object, %s *interface_)
zA{
  g_object_set (G_OBJECT (object), "%s", interface_, NULL);
}

)r%r)rkrsr
rrrrr7r4rtrDrr5r)r&rIrhrmrrr�generate_object�s�






zCodeGenerator.generate_objectcCs~|jjd�|jj|jjd|j|j|jfd��|jjd�|jj|jjd|j|jfd��|jjd�|jjd�|jj|jjd|j|jfd��|jjd�|jjd�|jjd|j|jf�|jjd	|j|jf�|jjd
|j|jf�|jj|jjd|j|jfd��|jjd�|jjd|j�|jjd
|j�x,|jD]"}|jjd|j|j|j	f��qTW|jjd�|jjd�|jjd�|jj|jjd|j|j|j|jfd��|jjd�|jjd|j|j|jf�|jjd|j|j|j|jf�|jjd�|jjd|j�|jj|jjd|j|j|j|jfd��|jjd�|jjd|j|j|jf�|jjd�|jj|jjd|j|j|j|jfd��|jjd�|jjd|j|j|jf�|jjd|j|j|j|jf�|jjd�|jjd|j�|jj|jjd|j|j|j|jfd��|jjd�|jjd|j|j|jf�|jjd�dS)Nz�/* ------------------------------------------------------------------------
 * Code for ObjectManager client
 * ------------------------------------------------------------------------
 */

a/**
 * SECTION:%sObjectManagerClient
 * @title: %sObjectManagerClient
 * @short_description: Generated GDBusObjectManagerClient type
 *
 * This section contains a #GDBusObjectManagerClient that uses %sobject_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
 */
Fr(z�/**
 * %sObjectManagerClient:
 *
 * The #%sObjectManagerClient structure contains only private data and should only be accessed using the provided API.
z */
zy/**
 * %sObjectManagerClientClass:
 * @parent_class: The parent class.
 *
 * Class structure for #%sObjectManagerClient.
zcG_DEFINE_TYPE (%sObjectManagerClient, %sobject_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT)

z]static void
%sobject_manager_client_init (%sObjectManagerClient *manager G_GNUC_UNUSED)
{
}

zfstatic void
%sobject_manager_client_class_init (%sObjectManagerClientClass *klass G_GNUC_UNUSED)
{
}

a!/**
 * %sobject_manager_client_get_proxy_type:
 * @manager: A #GDBusObjectManagerClient.
 * @object_path: The object path of the remote object (unused).
 * @interface_name: (nullable): Interface name of the remote object or %%NULL to get the object proxy #GType.
 * @user_data: User data (unused).
 *
 * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy derived and #GDBusProxy derived types.
 *
 * Returns: A #GDBusProxy derived #GType if @interface_name is not %%NULL, otherwise the #GType for #%sObjectProxy.
z�GType
%sobject_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
{
a  static gsize once_init_value = 0;
  static GHashTable *lookup_hash;
  GType ret;

  if (interface_name == NULL)
    return %sTYPE_OBJECT_PROXY;
  if (g_once_init_enter (&once_init_value))
    {
      lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
z^      g_hash_table_insert (lookup_hash, (gpointer) "%s", GSIZE_TO_POINTER (%sTYPE_%s_PROXY));
z5      g_once_init_leave (&once_init_value, 1);
    }
z�  ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
  if (ret == (GType) 0)
    ret = G_TYPE_DBUS_PROXY;
z  return ret;
}

a/**
 * %sobject_manager_client_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
 * @name: (nullable): A bus name (well-known or unique) or %%NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (nullable): A #GCancellable or %%NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates #GDBusObjectManagerClient using %sobject_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call %sobject_manager_client_new_finish() to get the result of the operation.
 *
 * See %sobject_manager_client_new_sync() for the synchronous, blocking version of this constructor.
aGvoid
%sobject_manager_client_new (
    GDBusConnection        *connection,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GAsyncReadyCallback     callback,
    gpointer                user_data)
{
  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);
}

a�/**
 * %sobject_manager_client_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to %sobject_manager_client_new().
 * @error: Return location for error or %%NULL
 *
 * Finishes an operation started with %sobject_manager_client_new().
 *
 * Returns: (transfer full) (type %sObjectManagerClient): The constructed object manager client or %%NULL if @error is set.
a�GDBusObjectManager *
%sobject_manager_client_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return G_DBUS_OBJECT_MANAGER (ret);
  else
    return NULL;
}

ad/**
 * %sobject_manager_client_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
 * @name: (nullable): A bus name (well-known or unique) or %%NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (nullable): A #GCancellable or %%NULL.
 * @error: Return location for error or %%NULL
 *
 * Synchronously creates #GDBusObjectManagerClient using %sobject_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See %sobject_manager_client_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type %sObjectManagerClient): The constructed object manager client or %%NULL if @error is set.
aoGDBusObjectManager *
%sobject_manager_client_new_sync (
    GDBusConnection        *connection,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GError                **error)
{
  GInitable *ret;
  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);
  if (ret != NULL)
    return G_DBUS_OBJECT_MANAGER (ret);
  else
    return NULL;
}

a}/**
 * %sobject_manager_client_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (nullable): A #GCancellable or %%NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like %sobject_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call %sobject_manager_client_new_for_bus_finish() to get the result of the operation.
 *
 * See %sobject_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
aIvoid
%sobject_manager_client_new_for_bus (
    GBusType                bus_type,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GAsyncReadyCallback     callback,
    gpointer                user_data)
{
  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);
}

a�/**
 * %sobject_manager_client_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to %sobject_manager_client_new_for_bus().
 * @error: Return location for error or %%NULL
 *
 * Finishes an operation started with %sobject_manager_client_new_for_bus().
 *
 * Returns: (transfer full) (type %sObjectManagerClient): The constructed object manager client or %%NULL if @error is set.
a�GDBusObjectManager *
%sobject_manager_client_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return G_DBUS_OBJECT_MANAGER (ret);
  else
    return NULL;
}

a�/**
 * %sobject_manager_client_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (nullable): A #GCancellable or %%NULL.
 * @error: Return location for error or %%NULL
 *
 * Like %sobject_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See %sobject_manager_client_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type %sObjectManagerClient): The constructed object manager client or %%NULL if @error is set.
aqGDBusObjectManager *
%sobject_manager_client_new_for_bus_sync (
    GBusType                bus_type,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GError                **error)
{
  GInitable *ret;
  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);
  if (ret != NULL)
    return G_DBUS_OBJECT_MANAGER (ret);
  else
    return NULL;
}

)
r%r)rkrsr
rrrr4r5)r&rIrrr�generate_object_manager_client�s�

	


z,CodeGenerator.generate_object_manager_clientcCs�t|j�dkr(|jd|d|d|jf�|jr�t|tj�r@d}nDt|tj�rRd}n2t|tj�rdd}n t|tj	�rvd}nt
dj|��|j|jj
d	|d|d|fd
��|jd|df�dS)Nrz%*s *
%*s * Since: %s
rzThe D-Bus interfacezThe D-Bus methodzThe D-Bus signalzThe D-Bus propertyzCannot handle object "{}"z0%*s *
%*s * Deprecated: %s has been deprecated.
Fz%*s */
)r	r9r)rD�
isinstancerZ	InterfaceZMethodZSignalZPropertyrr+rkrs)r&�obj�f�indent�thingrrrrt3s$z9CodeGenerator.write_gtkdoc_deprecated_and_since_and_closecCsL|jjd|j�|jj|jjd|j|j|j|jfd��|jjd�dS)Nz�/* ------------------------------------------------------------------------
 * Code for interface %s
 * ------------------------------------------------------------------------
 */

z�/**
 * SECTION:%s
 * @title: %s
 * @short_description: Generated C code for the %s D-Bus interface
 *
 * This section contains code for working with the #%s D-Bus interface in C.
 */
Fr()r%r)r4rkrsr7)r&rIrrr�generate_interface_introMs
z&CodeGenerator.generate_interface_introcCs�|j�xh|jD]^}|j|�|j|�|j|�|j|�|j|�|j|�|j|�|j	|�|j
|�qW|jr�|j�|j
�dS)N)rYrr�rvr�r�r�r�r�r�r�rr�r�)r&rIrrrrQds







zCodeGenerator.generateN)rRrSrTr'rYrnrqrvr�r�r�r�r�r�r�r�r�rtr�rQrrrrrj�sT8*&K&>+
,[rjN)rrrrrr*rrrrUrWrjrrrr�<module>s&	:N`