/* dbus-services.c generated by valac 0.56.19, the Vala compiler
 * generated from dbus-services.vala, do not modify */

/*
 * Copyright (c) 2026 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include <glib.h>
#include "ft_plugin_sni.h"
#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <config.h>
#include <gtk/gtk.h>

#define SNI_DBUS_MENU_SERVICE_ROOT_ID ((gint32) 0)
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
typedef struct _SniMenuItem SniMenuItem;
typedef struct _SniMenuItemClass SniMenuItemClass;
typedef struct _Block6Data Block6Data;
typedef struct _Block7Data Block7Data;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

#define SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE (sni_status_notifier_item_dbus_service_get_type ())
#define SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, SniStatusNotifierItemDBusService))
#define SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, SniStatusNotifierItemDBusServiceClass))
#define SNI_IS_STATUS_NOTIFIER_ITEM_DBUS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE))
#define SNI_IS_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE))
#define SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, SniStatusNotifierItemDBusServiceClass))

typedef struct _SniStatusNotifierItemDBusService SniStatusNotifierItemDBusService;
typedef struct _SniStatusNotifierItemDBusServiceClass SniStatusNotifierItemDBusServiceClass;
typedef struct _SniStatusNotifierItemDBusServicePrivate SniStatusNotifierItemDBusServicePrivate;
enum  {
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_0_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ID_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_CATEGORY_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ITEM_IS_MENU_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_MENU_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_TITLE_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_STATUS_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ICON_THEME_PATH_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ICON_NAME_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ICON_PIXMAP_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_OVERLAY_ICON_NAME_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_OVERLAY_ICON_PIXMAP_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ATTENTION_ICON_NAME_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ATTENTION_ICON_PIXMAP_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ATTENTION_MOVIE_NAME_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_TOOLTIP_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_WINDOW_ID_PROPERTY,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NUM_PROPERTIES
};
static GParamSpec* sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_TITLE_SIGNAL,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_ICON_SIGNAL,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_ATTENTION_ICON_SIGNAL,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_STATUS_SIGNAL,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_MENU_SIGNAL,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_TOOLTIP_SIGNAL,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_RECEIVED_ACTIVATION_TOKEN_SIGNAL,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ACTIVATED_SIGNAL,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_SECONDARY_ACTIVATED_SIGNAL,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_SCROLLED_SIGNAL,
	SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NUM_SIGNALS
};
static guint sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NUM_SIGNALS] = {0};

#define SNI_TYPE_DBUS_MENU_SERVICE (sni_dbus_menu_service_get_type ())
#define SNI_DBUS_MENU_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SNI_TYPE_DBUS_MENU_SERVICE, SniDBusMenuService))
#define SNI_DBUS_MENU_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SNI_TYPE_DBUS_MENU_SERVICE, SniDBusMenuServiceClass))
#define SNI_IS_DBUS_MENU_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SNI_TYPE_DBUS_MENU_SERVICE))
#define SNI_IS_DBUS_MENU_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SNI_TYPE_DBUS_MENU_SERVICE))
#define SNI_DBUS_MENU_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SNI_TYPE_DBUS_MENU_SERVICE, SniDBusMenuServiceClass))

typedef struct _SniDBusMenuService SniDBusMenuService;
typedef struct _SniDBusMenuServiceClass SniDBusMenuServiceClass;
typedef struct _SniDBusMenuServicePrivate SniDBusMenuServicePrivate;
enum  {
	SNI_DBUS_MENU_SERVICE_0_PROPERTY,
	SNI_DBUS_MENU_SERVICE_VERSION_PROPERTY,
	SNI_DBUS_MENU_SERVICE_STATUS_PROPERTY,
	SNI_DBUS_MENU_SERVICE_ICON_THEME_PATH_PROPERTY,
	SNI_DBUS_MENU_SERVICE_TEXT_DIRECTION_PROPERTY,
	SNI_DBUS_MENU_SERVICE_NUM_PROPERTIES
};
static GParamSpec* sni_dbus_menu_service_properties[SNI_DBUS_MENU_SERVICE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
typedef struct _Block8Data Block8Data;
typedef struct _SniMenuItemPrivate SniMenuItemPrivate;
typedef struct _Block9Data Block9Data;
#define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))
enum  {
	SNI_DBUS_MENU_SERVICE_ITEMS_PROPERTIES_UPDATED_SIGNAL,
	SNI_DBUS_MENU_SERVICE_LAYOUT_UPDATED_SIGNAL,
	SNI_DBUS_MENU_SERVICE_ITEM_ACTIVATION_REQUESTED_SIGNAL,
	SNI_DBUS_MENU_SERVICE_NUM_SIGNALS
};
static guint sni_dbus_menu_service_signals[SNI_DBUS_MENU_SERVICE_NUM_SIGNALS] = {0};

struct _Block6Data {
	int _ref_count_;
	GVariant** serialized_children;
	gint serialized_children_length1;
	gint _serialized_children_size_;
	SniMenuItemProperty* properties;
	gint properties_length1;
};

struct _Block7Data {
	int _ref_count_;
	Block6Data * _data6_;
	gint child_max_depth;
};

struct _SniStatusNotifierItemDBusService {
	GObject parent_instance;
	SniStatusNotifierItemDBusServicePrivate * priv;
	gchar* activation_token;
};

struct _SniStatusNotifierItemDBusServiceClass {
	GObjectClass parent_class;
};

struct _SniStatusNotifierItemDBusServicePrivate {
	SniIndicatorStatus _status;
	SniTooltip _tooltip;
	char* _menu;
	gboolean _item_is_menu;
	gchar* _title;
	gchar* _icon_theme_path;
	gchar* _icon_name;
	gchar* _overlay_icon_name;
};

struct _SniDBusMenuService {
	GObject parent_instance;
	SniDBusMenuServicePrivate * priv;
	gchar* activation_token;
};

struct _SniDBusMenuServiceClass {
	GObjectClass parent_class;
};

struct _SniDBusMenuServicePrivate {
	gchar* _icon_theme_path;
	SniIndicatorActionGroup* action_group;
	SniMenuItem* root;
	guint32 revision;
	GHashTable* menu_items_by_id;
	GHashTable* menu_items_by_name;
	guint layout_updated_idle_id;
	guint items_properties_updated_idle_id;
};

struct _Block8Data {
	int _ref_count_;
	SniDBusMenuService* self;
	guint* changed_ids;
	gint changed_ids_length1;
	gint _changed_ids_size_;
};

struct _SniMenuItem {
	GObject parent_instance;
	SniMenuItemPrivate * priv;
	gboolean dirty_layout;
	guint dirty_properties;
	guint modified_properties;
};

struct _SniMenuItemClass {
	GObjectClass parent_class;
};

struct _Block9Data {
	int _ref_count_;
	SniDBusMenuService* self;
	GVariantBuilder* builder;
	gboolean changed;
};

static gint SniStatusNotifierItemDBusService_private_offset;
static gpointer sni_status_notifier_item_dbus_service_parent_class = NULL;
static GType sni_status_notifier_item_dbus_service_type_id = 0;
static gint SniDBusMenuService_private_offset;
static gpointer sni_dbus_menu_service_parent_class = NULL;
static GType sni_dbus_menu_service_type_id = 0;

VALA_EXTERN GVariant* sni_empty_vardict (void);
VALA_EXTERN GVariant* sni_serialize_pixmaps (SniPixmap* pixmaps,
                                 gint pixmaps_length1);
static void _vala_array_add5 (GVariant** * array,
                       gint* length,
                       gint* size,
                       GVariant* value);
VALA_EXTERN GVariant* sni_serialize_layout (SniMenuItem* menu_item,
                                SniMenuItemProperty* properties,
                                gint properties_length1,
                                gint max_depth);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
VALA_EXTERN SniMenuItemProperty* sni_filter_properties (SniMenuItem* menu_item,
                                            SniMenuItemProperty* properties,
                                            gint properties_length1,
                                            gint* result_length1);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static void ___lambda11_ (Block7Data* _data7_,
                   SniMenuItem* child);
static void _vala_array_add6 (GVariant** * array,
                       gint* length,
                       gint* size,
                       GVariant* value);
static void ____lambda11__gfunc (gconstpointer data,
                          gpointer self);
VALA_EXTERN gboolean sni_menu_item_has_modified_property (SniMenuItem* self,
                                              SniMenuItemProperty property);
VALA_EXTERN gboolean sni_menu_item_has_default_property (SniMenuItem* self,
                                             SniMenuItemProperty property);
static void _vala_array_add7 (SniMenuItemProperty* * array,
                       gint* length,
                       gint* size,
                       SniMenuItemProperty value);
VALA_EXTERN SniMenuItemProperty* sni_unpack_properties (guint properties_mask,
                                            gint* result_length1);
static void _vala_array_add8 (SniMenuItemProperty* * array,
                       gint* length,
                       gint* size,
                       SniMenuItemProperty value);
GType sni_status_notifier_item_dbus_service_register_type (GTypeModule * module);
VALA_EXTERN GType sni_status_notifier_item_dbus_service_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint sni_status_notifier_item_dbus_service_register_object (void* object,
                                                             GDBusConnection* connection,
                                                             const gchar* path,
                                                             GError** error);
VALA_EXTERN SniStatusNotifierItemDBusService* sni_status_notifier_item_dbus_service_new (const gchar* menu_object_path,
                                                                             const gchar* icon_theme_path);
VALA_EXTERN SniStatusNotifierItemDBusService* sni_status_notifier_item_dbus_service_construct (GType object_type,
                                                                                   const gchar* menu_object_path,
                                                                                   const gchar* icon_theme_path);
VALA_EXTERN void sni_status_notifier_item_dbus_service_context_menu (SniStatusNotifierItemDBusService* self,
                                                         gint32 x,
                                                         gint32 y,
                                                         GError** error);
VALA_EXTERN void sni_status_notifier_item_dbus_service_provide_xdg_activation_token (SniStatusNotifierItemDBusService* self,
                                                                         const gchar* token,
                                                                         GError** error);
VALA_EXTERN void sni_status_notifier_item_dbus_service_activate (SniStatusNotifierItemDBusService* self,
                                                     gint32 x,
                                                     gint32 y,
                                                     GError** error);
VALA_EXTERN void sni_status_notifier_item_dbus_service_secondary_activate (SniStatusNotifierItemDBusService* self,
                                                               gint32 x,
                                                               gint32 y,
                                                               GError** error);
VALA_EXTERN void sni_status_notifier_item_dbus_service_scroll (SniStatusNotifierItemDBusService* self,
                                                   gint32 delta,
                                                   const gchar* orientation,
                                                   GError** error);
VALA_EXTERN void sni_status_notifier_item_dbus_service_set_title_internal (SniStatusNotifierItemDBusService* self,
                                                               const gchar* value,
                                                               gboolean emit_signal);
VALA_EXTERN void sni_status_notifier_item_dbus_service_set_icon_name_internal (SniStatusNotifierItemDBusService* self,
                                                                   const gchar* value,
                                                                   gboolean emit_signal);
VALA_EXTERN SniIndicatorStatus sni_status_notifier_item_dbus_service_get_status_internal (SniStatusNotifierItemDBusService* self);
VALA_EXTERN void sni_status_notifier_item_dbus_service_set_status_internal (SniStatusNotifierItemDBusService* self,
                                                                SniIndicatorStatus value,
                                                                gboolean emit_signal);
VALA_EXTERN void sni_status_notifier_item_dbus_service_get_tooltip_internal (SniStatusNotifierItemDBusService* self,
                                                                 SniTooltip* result);
VALA_EXTERN void sni_status_notifier_item_dbus_service_set_tooltip_internal (SniStatusNotifierItemDBusService* self,
                                                                 SniTooltip* value,
                                                                 gboolean emit_signal);
VALA_EXTERN void sni_status_notifier_item_dbus_service_emit_new_menu (SniStatusNotifierItemDBusService* self);
VALA_EXTERN gchar* sni_status_notifier_item_dbus_service_get_id (SniStatusNotifierItemDBusService* self);
VALA_EXTERN gchar* sni_status_notifier_item_dbus_service_get_category (SniStatusNotifierItemDBusService* self);
VALA_EXTERN gboolean sni_status_notifier_item_dbus_service_get_item_is_menu (SniStatusNotifierItemDBusService* self);
VALA_EXTERN char* sni_status_notifier_item_dbus_service_get_menu (SniStatusNotifierItemDBusService* self);
VALA_EXTERN gchar* sni_status_notifier_item_dbus_service_get_title (SniStatusNotifierItemDBusService* self);
VALA_EXTERN gchar* sni_status_notifier_item_dbus_service_get_status (SniStatusNotifierItemDBusService* self);
VALA_EXTERN gchar* sni_status_notifier_item_dbus_service_get_icon_theme_path (SniStatusNotifierItemDBusService* self);
VALA_EXTERN gchar* sni_status_notifier_item_dbus_service_get_icon_name (SniStatusNotifierItemDBusService* self);
VALA_EXTERN GVariant* sni_status_notifier_item_dbus_service_get_icon_pixmap (SniStatusNotifierItemDBusService* self);
static void _vala_SniPixmap_array_free (SniPixmap * array,
                                 gssize array_length);
VALA_EXTERN gchar* sni_status_notifier_item_dbus_service_get_overlay_icon_name (SniStatusNotifierItemDBusService* self);
VALA_EXTERN GVariant* sni_status_notifier_item_dbus_service_get_overlay_icon_pixmap (SniStatusNotifierItemDBusService* self);
VALA_EXTERN gchar* sni_status_notifier_item_dbus_service_get_attention_icon_name (SniStatusNotifierItemDBusService* self);
VALA_EXTERN GVariant* sni_status_notifier_item_dbus_service_get_attention_icon_pixmap (SniStatusNotifierItemDBusService* self);
VALA_EXTERN gchar* sni_status_notifier_item_dbus_service_get_attention_movie_name (SniStatusNotifierItemDBusService* self);
VALA_EXTERN GVariant* sni_status_notifier_item_dbus_service_get_tooltip (SniStatusNotifierItemDBusService* self);
VALA_EXTERN gint32 sni_status_notifier_item_dbus_service_get_window_id (SniStatusNotifierItemDBusService* self);
static GObject * sni_status_notifier_item_dbus_service_constructor (GType type,
                                                             guint n_construct_properties,
                                                             GObjectConstructParam * construct_properties);
VALA_EXTERN gboolean sni_capabilities_have_activation (void);
static void sni_status_notifier_item_dbus_service_finalize (GObject * obj);
static void _vala_sni_status_notifier_item_dbus_service_get_property (GObject * object,
                                                               guint property_id,
                                                               GValue * value,
                                                               GParamSpec * pspec);
static void _dbus_sni_status_notifier_item_dbus_service_context_menu (SniStatusNotifierItemDBusService* self,
                                                               GVariant* _parameters_,
                                                               GDBusMethodInvocation* invocation);
static void _dbus_sni_status_notifier_item_dbus_service_provide_xdg_activation_token (SniStatusNotifierItemDBusService* self,
                                                                               GVariant* _parameters_,
                                                                               GDBusMethodInvocation* invocation);
static void _dbus_sni_status_notifier_item_dbus_service_activate (SniStatusNotifierItemDBusService* self,
                                                           GVariant* _parameters_,
                                                           GDBusMethodInvocation* invocation);
static void _dbus_sni_status_notifier_item_dbus_service_secondary_activate (SniStatusNotifierItemDBusService* self,
                                                                     GVariant* _parameters_,
                                                                     GDBusMethodInvocation* invocation);
static void _dbus_sni_status_notifier_item_dbus_service_scroll (SniStatusNotifierItemDBusService* self,
                                                         GVariant* _parameters_,
                                                         GDBusMethodInvocation* invocation);
static void sni_status_notifier_item_dbus_service_dbus_interface_method_call (GDBusConnection* connection,
                                                                       const gchar* sender,
                                                                       const gchar* object_path,
                                                                       const gchar* interface_name,
                                                                       const gchar* method_name,
                                                                       GVariant* parameters,
                                                                       GDBusMethodInvocation* invocation,
                                                                       gpointer user_data);
static GVariant* sni_status_notifier_item_dbus_service_dbus_interface_get_property (GDBusConnection* connection,
                                                                             const gchar* sender,
                                                                             const gchar* object_path,
                                                                             const gchar* interface_name,
                                                                             const gchar* property_name,
                                                                             GError** error,
                                                                             gpointer user_data);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_id (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_category (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_item_is_menu (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_menu (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_title (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_status (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_icon_theme_path (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_icon_name (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_icon_pixmap (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_overlay_icon_name (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_overlay_icon_pixmap (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_attention_icon_name (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_attention_icon_pixmap (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_attention_movie_name (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_tooltip (SniStatusNotifierItemDBusService* self);
static GVariant* _dbus_sni_status_notifier_item_dbus_service_get_window_id (SniStatusNotifierItemDBusService* self);
static gboolean sni_status_notifier_item_dbus_service_dbus_interface_set_property (GDBusConnection* connection,
                                                                            const gchar* sender,
                                                                            const gchar* object_path,
                                                                            const gchar* interface_name,
                                                                            const gchar* property_name,
                                                                            GVariant* value,
                                                                            GError** error,
                                                                            gpointer user_data);
static void _dbus_sni_status_notifier_item_dbus_service_new_title (GObject* _sender,
                                                            gpointer* _data);
static void _dbus_sni_status_notifier_item_dbus_service_new_icon (GObject* _sender,
                                                           gpointer* _data);
static void _dbus_sni_status_notifier_item_dbus_service_new_attention_icon (GObject* _sender,
                                                                     gpointer* _data);
static void _dbus_sni_status_notifier_item_dbus_service_new_status (GObject* _sender,
                                                             gpointer* _data);
static void _dbus_sni_status_notifier_item_dbus_service_new_menu (GObject* _sender,
                                                           gpointer* _data);
static void _dbus_sni_status_notifier_item_dbus_service_new_tooltip (GObject* _sender,
                                                              gpointer* _data);
static void _sni_status_notifier_item_dbus_service_unregister_object (gpointer user_data);
GType sni_dbus_menu_service_register_type (GTypeModule * module);
VALA_EXTERN GType sni_dbus_menu_service_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint sni_dbus_menu_service_register_object (void* object,
                                             GDBusConnection* connection,
                                             const gchar* path,
                                             GError** error);
VALA_EXTERN SniDBusMenuService* sni_dbus_menu_service_new (SniMenuItem* root,
                                               SniIndicatorActionGroup* action_group,
                                               const gchar* icon_theme_path);
VALA_EXTERN SniDBusMenuService* sni_dbus_menu_service_construct (GType object_type,
                                                     SniMenuItem* root,
                                                     SniIndicatorActionGroup* action_group,
                                                     const gchar* icon_theme_path);
static void _g_free0_ (gpointer var);
static void __lambda7_ (SniDBusMenuService* self,
                 SniMenuItem* menu_item);
static void sni_dbus_menu_service_on_child_added (SniDBusMenuService* self,
                                           SniMenuItem* menu_item,
                                           SniMenuItem* child);
static void _sni_dbus_menu_service_on_child_added_sni_menu_item_child_added (SniMenuItem* _sender,
                                                                      SniMenuItem* child,
                                                                      gpointer self);
static void sni_dbus_menu_service_on_child_removed (SniDBusMenuService* self,
                                             SniMenuItem* menu_item,
                                             SniMenuItem* child);
static void _sni_dbus_menu_service_on_child_removed_sni_menu_item_child_added (SniMenuItem* _sender,
                                                                        SniMenuItem* child,
                                                                        gpointer self);
static void sni_dbus_menu_service_on_changed (SniDBusMenuService* self,
                                       SniMenuItem* menu_item,
                                       SniMenuItemProperty property);
static void _sni_dbus_menu_service_on_changed_sni_menu_item_changed (SniMenuItem* _sender,
                                                              SniMenuItemProperty property,
                                                              gpointer self);
static void ___lambda7__gfunc (gconstpointer data,
                        gpointer self);
static inline SniMenuItem* sni_dbus_menu_service_lookup_by_id (SniDBusMenuService* self,
                                                 gint32 id);
static inline SniMenuItem* sni_dbus_menu_service_lookup_by_name (SniDBusMenuService* self,
                                                   const gchar* name);
VALA_EXTERN SniMenuItem* sni_dbus_menu_service_lookup_menu_item (SniDBusMenuService* self,
                                                     const gchar* name);
VALA_EXTERN void sni_dbus_menu_service_emit_layout_updated (SniDBusMenuService* self);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (void * _userdata_);
static void __lambda9_ (Block8Data* _data8_,
                 SniMenuItem* menu_item);
static void _vala_array_add9 (guint* * array,
                       gint* length,
                       gint* size,
                       guint value);
static void ___lambda9__gfunc (gconstpointer data,
                        gpointer self);
static void sni_dbus_menu_service_queue_layout_updated (SniDBusMenuService* self);
static gboolean __lambda8_ (SniDBusMenuService* self);
static gboolean ___lambda8__gsource_func (gpointer self);
static void sni_dbus_menu_service_queue_items_properties_updated (SniDBusMenuService* self);
static void sni_dbus_menu_service_emit_items_properties_updated (SniDBusMenuService* self);
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_data_unref (void * _userdata_);
static void __lambda10_ (Block9Data* _data9_,
                  SniMenuItem* menu_item);
static void ___lambda10__gfunc (gconstpointer data,
                         gpointer self);
VALA_EXTERN void sni_dbus_menu_service_emit_updates (SniDBusMenuService* self);
VALA_EXTERN void sni_menu_item_mark_dirty_layout (SniMenuItem* self);
VALA_EXTERN void sni_menu_item_mark_dirty_property (SniMenuItem* self,
                                        SniMenuItemProperty property);
static void _sni_dbus_menu_service_on_child_removed_sni_menu_item_child_removed (SniMenuItem* _sender,
                                                                          SniMenuItem* child,
                                                                          gpointer self);
static void sni_dbus_menu_service_handle_event (SniDBusMenuService* self,
                                         gint32 id,
                                         const gchar* event_name,
                                         GVariant* data,
                                         guint32 timestamp,
                                         GError** error);
VALA_EXTERN GVariant* sni_build_platform_data (const gchar* activation_token);
VALA_EXTERN void sni_dbus_menu_service_get_layout (SniDBusMenuService* self,
                                       gint32 parent_id,
                                       gint32 recursion_depth,
                                       gchar** property_names,
                                       gint property_names_length1,
                                       guint32* revision,
                                       GVariant** layout,
                                       GError** error);
VALA_EXTERN GVariant* sni_dbus_menu_service_get_property_ (SniDBusMenuService* self,
                                               gint32 id,
                                               const gchar* name,
                                               GError** error);
VALA_EXTERN GVariant* sni_dbus_menu_service_get_group_properties (SniDBusMenuService* self,
                                                      gint32* ids,
                                                      gint ids_length1,
                                                      gchar** property_names,
                                                      gint property_names_length1,
                                                      GError** error);
VALA_EXTERN void sni_dbus_menu_service_event (SniDBusMenuService* self,
                                  gint32 id,
                                  const gchar* event_id,
                                  GVariant* data,
                                  guint32 timestamp,
                                  GError** error);
VALA_EXTERN gint32* sni_dbus_menu_service_event_group (SniDBusMenuService* self,
                                           GVariant* events,
                                           gint* result_length1,
                                           GError** error);
VALA_EXTERN gboolean sni_dbus_menu_service_about_to_show (SniDBusMenuService* self,
                                              gint32 id,
                                              GError** error);
VALA_EXTERN void sni_dbus_menu_service_about_to_show_group (SniDBusMenuService* self,
                                                gint32* ids,
                                                gint ids_length1,
                                                gint32** updates_needed,
                                                gint* updates_needed_length1,
                                                gint32** id_errors,
                                                gint* id_errors_length1,
                                                GError** error);
static void sni_dbus_menu_service_real_dispose (GObject* base);
VALA_EXTERN guint32 sni_dbus_menu_service_get_version (SniDBusMenuService* self);
VALA_EXTERN gchar* sni_dbus_menu_service_get_status (SniDBusMenuService* self);
VALA_EXTERN gchar** sni_dbus_menu_service_get_icon_theme_path (SniDBusMenuService* self,
                                                   gint* result_length1);
VALA_EXTERN gchar* sni_dbus_menu_service_get_text_direction (SniDBusMenuService* self);
static void g_cclosure_user_marshal_VOID__VARIANT_VARIANT (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__UINT_INT (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__INT_UINT (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data);
static void sni_dbus_menu_service_finalize (GObject * obj);
static void _vala_sni_dbus_menu_service_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _dbus_sni_dbus_menu_service_get_layout (SniDBusMenuService* self,
                                             GVariant* _parameters_,
                                             GDBusMethodInvocation* invocation);
static void _dbus_sni_dbus_menu_service_get_property_ (SniDBusMenuService* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation);
static void _dbus_sni_dbus_menu_service_get_group_properties (SniDBusMenuService* self,
                                                       GVariant* _parameters_,
                                                       GDBusMethodInvocation* invocation);
static void _dbus_sni_dbus_menu_service_event (SniDBusMenuService* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation);
static void _dbus_sni_dbus_menu_service_event_group (SniDBusMenuService* self,
                                              GVariant* _parameters_,
                                              GDBusMethodInvocation* invocation);
static void _dbus_sni_dbus_menu_service_about_to_show (SniDBusMenuService* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation);
static void _dbus_sni_dbus_menu_service_about_to_show_group (SniDBusMenuService* self,
                                                      GVariant* _parameters_,
                                                      GDBusMethodInvocation* invocation);
static void sni_dbus_menu_service_dbus_interface_method_call (GDBusConnection* connection,
                                                       const gchar* sender,
                                                       const gchar* object_path,
                                                       const gchar* interface_name,
                                                       const gchar* method_name,
                                                       GVariant* parameters,
                                                       GDBusMethodInvocation* invocation,
                                                       gpointer user_data);
static GVariant* sni_dbus_menu_service_dbus_interface_get_property (GDBusConnection* connection,
                                                             const gchar* sender,
                                                             const gchar* object_path,
                                                             const gchar* interface_name,
                                                             const gchar* property_name,
                                                             GError** error,
                                                             gpointer user_data);
static GVariant* _dbus_sni_dbus_menu_service_get_version (SniDBusMenuService* self);
static GVariant* _dbus_sni_dbus_menu_service_get_status (SniDBusMenuService* self);
static GVariant* _dbus_sni_dbus_menu_service_get_icon_theme_path (SniDBusMenuService* self);
static GVariant* _dbus_sni_dbus_menu_service_get_text_direction (SniDBusMenuService* self);
static gboolean sni_dbus_menu_service_dbus_interface_set_property (GDBusConnection* connection,
                                                            const gchar* sender,
                                                            const gchar* object_path,
                                                            const gchar* interface_name,
                                                            const gchar* property_name,
                                                            GVariant* value,
                                                            GError** error,
                                                            gpointer user_data);
static void _dbus_sni_dbus_menu_service_items_properties_updated (GObject* _sender,
                                                           GVariant* updated_props,
                                                           GVariant* removed_props,
                                                           gpointer* _data);
static void _dbus_sni_dbus_menu_service_layout_updated (GObject* _sender,
                                                 guint32 revision,
                                                 gint32 parent_id,
                                                 gpointer* _data);
static void _dbus_sni_dbus_menu_service_item_activation_requested (GObject* _sender,
                                                            gint32 id,
                                                            guint32 timestamp,
                                                            gpointer* _data);
static void _sni_dbus_menu_service_unregister_object (gpointer user_data);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusArgInfo _sni_status_notifier_item_dbus_service_dbus_arg_info_context_menu_x = {-1, "x", "i", NULL};
static const GDBusArgInfo _sni_status_notifier_item_dbus_service_dbus_arg_info_context_menu_y = {-1, "y", "i", NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_context_menu_in[] = {&_sni_status_notifier_item_dbus_service_dbus_arg_info_context_menu_x, &_sni_status_notifier_item_dbus_service_dbus_arg_info_context_menu_y, NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_context_menu_out[] = {NULL};
static const GDBusMethodInfo _sni_status_notifier_item_dbus_service_dbus_method_info_context_menu = {-1, "ContextMenu", (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_context_menu_in), (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_context_menu_out), NULL};
static const GDBusArgInfo _sni_status_notifier_item_dbus_service_dbus_arg_info_provide_xdg_activation_token_token = {-1, "token", "s", NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_provide_xdg_activation_token_in[] = {&_sni_status_notifier_item_dbus_service_dbus_arg_info_provide_xdg_activation_token_token, NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_provide_xdg_activation_token_out[] = {NULL};
static const GDBusMethodInfo _sni_status_notifier_item_dbus_service_dbus_method_info_provide_xdg_activation_token = {-1, "ProvideXdgActivationToken", (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_provide_xdg_activation_token_in), (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_provide_xdg_activation_token_out), NULL};
static const GDBusArgInfo _sni_status_notifier_item_dbus_service_dbus_arg_info_activate_x = {-1, "x", "i", NULL};
static const GDBusArgInfo _sni_status_notifier_item_dbus_service_dbus_arg_info_activate_y = {-1, "y", "i", NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_activate_in[] = {&_sni_status_notifier_item_dbus_service_dbus_arg_info_activate_x, &_sni_status_notifier_item_dbus_service_dbus_arg_info_activate_y, NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_activate_out[] = {NULL};
static const GDBusMethodInfo _sni_status_notifier_item_dbus_service_dbus_method_info_activate = {-1, "Activate", (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_activate_in), (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_activate_out), NULL};
static const GDBusArgInfo _sni_status_notifier_item_dbus_service_dbus_arg_info_secondary_activate_x = {-1, "x", "i", NULL};
static const GDBusArgInfo _sni_status_notifier_item_dbus_service_dbus_arg_info_secondary_activate_y = {-1, "y", "i", NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_secondary_activate_in[] = {&_sni_status_notifier_item_dbus_service_dbus_arg_info_secondary_activate_x, &_sni_status_notifier_item_dbus_service_dbus_arg_info_secondary_activate_y, NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_secondary_activate_out[] = {NULL};
static const GDBusMethodInfo _sni_status_notifier_item_dbus_service_dbus_method_info_secondary_activate = {-1, "SecondaryActivate", (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_secondary_activate_in), (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_secondary_activate_out), NULL};
static const GDBusArgInfo _sni_status_notifier_item_dbus_service_dbus_arg_info_scroll_delta = {-1, "delta", "i", NULL};
static const GDBusArgInfo _sni_status_notifier_item_dbus_service_dbus_arg_info_scroll_orientation = {-1, "orientation", "s", NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_scroll_in[] = {&_sni_status_notifier_item_dbus_service_dbus_arg_info_scroll_delta, &_sni_status_notifier_item_dbus_service_dbus_arg_info_scroll_orientation, NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_scroll_out[] = {NULL};
static const GDBusMethodInfo _sni_status_notifier_item_dbus_service_dbus_method_info_scroll = {-1, "Scroll", (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_scroll_in), (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_scroll_out), NULL};
static const GDBusMethodInfo * const _sni_status_notifier_item_dbus_service_dbus_method_info[] = {&_sni_status_notifier_item_dbus_service_dbus_method_info_context_menu, &_sni_status_notifier_item_dbus_service_dbus_method_info_provide_xdg_activation_token, &_sni_status_notifier_item_dbus_service_dbus_method_info_activate, &_sni_status_notifier_item_dbus_service_dbus_method_info_secondary_activate, &_sni_status_notifier_item_dbus_service_dbus_method_info_scroll, NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_new_title[] = {NULL};
static const GDBusSignalInfo _sni_status_notifier_item_dbus_service_dbus_signal_info_new_title = {-1, "NewTitle", (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_new_title), NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_new_icon[] = {NULL};
static const GDBusSignalInfo _sni_status_notifier_item_dbus_service_dbus_signal_info_new_icon = {-1, "NewIcon", (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_new_icon), NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_new_attention_icon[] = {NULL};
static const GDBusSignalInfo _sni_status_notifier_item_dbus_service_dbus_signal_info_new_attention_icon = {-1, "NewAttentionIcon", (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_new_attention_icon), NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_new_status[] = {NULL};
static const GDBusSignalInfo _sni_status_notifier_item_dbus_service_dbus_signal_info_new_status = {-1, "NewStatus", (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_new_status), NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_new_menu[] = {NULL};
static const GDBusSignalInfo _sni_status_notifier_item_dbus_service_dbus_signal_info_new_menu = {-1, "NewMenu", (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_new_menu), NULL};
static const GDBusArgInfo * const _sni_status_notifier_item_dbus_service_dbus_arg_info_new_tooltip[] = {NULL};
static const GDBusSignalInfo _sni_status_notifier_item_dbus_service_dbus_signal_info_new_tooltip = {-1, "NewToolTip", (GDBusArgInfo **) (&_sni_status_notifier_item_dbus_service_dbus_arg_info_new_tooltip), NULL};
static const GDBusSignalInfo * const _sni_status_notifier_item_dbus_service_dbus_signal_info[] = {&_sni_status_notifier_item_dbus_service_dbus_signal_info_new_title, &_sni_status_notifier_item_dbus_service_dbus_signal_info_new_icon, &_sni_status_notifier_item_dbus_service_dbus_signal_info_new_attention_icon, &_sni_status_notifier_item_dbus_service_dbus_signal_info_new_status, &_sni_status_notifier_item_dbus_service_dbus_signal_info_new_menu, &_sni_status_notifier_item_dbus_service_dbus_signal_info_new_tooltip, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_id = {-1, "Id", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_category = {-1, "Category", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_item_is_menu = {-1, "ItemIsMenu", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_menu = {-1, "Menu", "o", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_title = {-1, "Title", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_status = {-1, "Status", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_icon_theme_path = {-1, "IconThemePath", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_icon_name = {-1, "IconName", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_icon_pixmap = {-1, "IconPixmap", "a(iiay)", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_overlay_icon_name = {-1, "OverlayIconName", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_overlay_icon_pixmap = {-1, "OverlayIconPixmap", "a(iiay)", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_attention_icon_name = {-1, "AttentionIconName", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_attention_icon_pixmap = {-1, "AttentionIconPixmap", "a(iiay)", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_attention_movie_name = {-1, "AttentionMovieName", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_tooltip = {-1, "ToolTip", "(sa(iiay)ss)", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_status_notifier_item_dbus_service_dbus_property_info_window_id = {-1, "WindowId", "i", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _sni_status_notifier_item_dbus_service_dbus_property_info[] = {&_sni_status_notifier_item_dbus_service_dbus_property_info_id, &_sni_status_notifier_item_dbus_service_dbus_property_info_category, &_sni_status_notifier_item_dbus_service_dbus_property_info_item_is_menu, &_sni_status_notifier_item_dbus_service_dbus_property_info_menu, &_sni_status_notifier_item_dbus_service_dbus_property_info_title, &_sni_status_notifier_item_dbus_service_dbus_property_info_status, &_sni_status_notifier_item_dbus_service_dbus_property_info_icon_theme_path, &_sni_status_notifier_item_dbus_service_dbus_property_info_icon_name, &_sni_status_notifier_item_dbus_service_dbus_property_info_icon_pixmap, &_sni_status_notifier_item_dbus_service_dbus_property_info_overlay_icon_name, &_sni_status_notifier_item_dbus_service_dbus_property_info_overlay_icon_pixmap, &_sni_status_notifier_item_dbus_service_dbus_property_info_attention_icon_name, &_sni_status_notifier_item_dbus_service_dbus_property_info_attention_icon_pixmap, &_sni_status_notifier_item_dbus_service_dbus_property_info_attention_movie_name, &_sni_status_notifier_item_dbus_service_dbus_property_info_tooltip, &_sni_status_notifier_item_dbus_service_dbus_property_info_window_id, NULL};
static const GDBusInterfaceInfo _sni_status_notifier_item_dbus_service_dbus_interface_info = {-1, "org.kde.StatusNotifierItem", (GDBusMethodInfo **) (&_sni_status_notifier_item_dbus_service_dbus_method_info), (GDBusSignalInfo **) (&_sni_status_notifier_item_dbus_service_dbus_signal_info), (GDBusPropertyInfo **) (&_sni_status_notifier_item_dbus_service_dbus_property_info), NULL};
static const GDBusInterfaceVTable _sni_status_notifier_item_dbus_service_dbus_interface_vtable = {sni_status_notifier_item_dbus_service_dbus_interface_method_call, sni_status_notifier_item_dbus_service_dbus_interface_get_property, sni_status_notifier_item_dbus_service_dbus_interface_set_property};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_get_layout_parent_id = {-1, "parent_id", "i", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_get_layout_recursion_depth = {-1, "recursion_depth", "i", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_get_layout_property_names = {-1, "property_names", "as", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_get_layout_revision = {-1, "revision", "u", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_get_layout_layout = {-1, "layout", "(ia{sv}av)", NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_get_layout_in[] = {&_sni_dbus_menu_service_dbus_arg_info_get_layout_parent_id, &_sni_dbus_menu_service_dbus_arg_info_get_layout_recursion_depth, &_sni_dbus_menu_service_dbus_arg_info_get_layout_property_names, NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_get_layout_out[] = {&_sni_dbus_menu_service_dbus_arg_info_get_layout_revision, &_sni_dbus_menu_service_dbus_arg_info_get_layout_layout, NULL};
static const GDBusMethodInfo _sni_dbus_menu_service_dbus_method_info_get_layout = {-1, "GetLayout", (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_get_layout_in), (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_get_layout_out), NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_get_property__id = {-1, "id", "i", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_get_property__name = {-1, "name", "s", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_get_property__result = {-1, "result", "v", NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_get_property__in[] = {&_sni_dbus_menu_service_dbus_arg_info_get_property__id, &_sni_dbus_menu_service_dbus_arg_info_get_property__name, NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_get_property__out[] = {&_sni_dbus_menu_service_dbus_arg_info_get_property__result, NULL};
static const GDBusMethodInfo _sni_dbus_menu_service_dbus_method_info_get_property_ = {-1, "GetProperty", (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_get_property__in), (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_get_property__out), NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_get_group_properties_ids = {-1, "ids", "ai", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_get_group_properties_property_names = {-1, "property_names", "as", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_get_group_properties_result = {-1, "result", "a(ia{sv})", NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_get_group_properties_in[] = {&_sni_dbus_menu_service_dbus_arg_info_get_group_properties_ids, &_sni_dbus_menu_service_dbus_arg_info_get_group_properties_property_names, NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_get_group_properties_out[] = {&_sni_dbus_menu_service_dbus_arg_info_get_group_properties_result, NULL};
static const GDBusMethodInfo _sni_dbus_menu_service_dbus_method_info_get_group_properties = {-1, "GetGroupProperties", (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_get_group_properties_in), (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_get_group_properties_out), NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_event_id = {-1, "id", "i", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_event_event_id = {-1, "event_id", "s", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_event_data = {-1, "data", "v", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_event_timestamp = {-1, "timestamp", "u", NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_event_in[] = {&_sni_dbus_menu_service_dbus_arg_info_event_id, &_sni_dbus_menu_service_dbus_arg_info_event_event_id, &_sni_dbus_menu_service_dbus_arg_info_event_data, &_sni_dbus_menu_service_dbus_arg_info_event_timestamp, NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_event_out[] = {NULL};
static const GDBusMethodInfo _sni_dbus_menu_service_dbus_method_info_event = {-1, "Event", (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_event_in), (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_event_out), NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_event_group_events = {-1, "events", "a(isvu)", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_event_group_result = {-1, "result", "ai", NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_event_group_in[] = {&_sni_dbus_menu_service_dbus_arg_info_event_group_events, NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_event_group_out[] = {&_sni_dbus_menu_service_dbus_arg_info_event_group_result, NULL};
static const GDBusMethodInfo _sni_dbus_menu_service_dbus_method_info_event_group = {-1, "EventGroup", (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_event_group_in), (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_event_group_out), NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_about_to_show_id = {-1, "id", "i", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_about_to_show_result = {-1, "result", "b", NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_about_to_show_in[] = {&_sni_dbus_menu_service_dbus_arg_info_about_to_show_id, NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_about_to_show_out[] = {&_sni_dbus_menu_service_dbus_arg_info_about_to_show_result, NULL};
static const GDBusMethodInfo _sni_dbus_menu_service_dbus_method_info_about_to_show = {-1, "AboutToShow", (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_about_to_show_in), (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_about_to_show_out), NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_about_to_show_group_ids = {-1, "ids", "ai", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_about_to_show_group_updates_needed = {-1, "updates_needed", "ai", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_about_to_show_group_id_errors = {-1, "id_errors", "ai", NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_about_to_show_group_in[] = {&_sni_dbus_menu_service_dbus_arg_info_about_to_show_group_ids, NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_about_to_show_group_out[] = {&_sni_dbus_menu_service_dbus_arg_info_about_to_show_group_updates_needed, &_sni_dbus_menu_service_dbus_arg_info_about_to_show_group_id_errors, NULL};
static const GDBusMethodInfo _sni_dbus_menu_service_dbus_method_info_about_to_show_group = {-1, "AboutToShowGroup", (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_about_to_show_group_in), (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_about_to_show_group_out), NULL};
static const GDBusMethodInfo * const _sni_dbus_menu_service_dbus_method_info[] = {&_sni_dbus_menu_service_dbus_method_info_get_layout, &_sni_dbus_menu_service_dbus_method_info_get_property_, &_sni_dbus_menu_service_dbus_method_info_get_group_properties, &_sni_dbus_menu_service_dbus_method_info_event, &_sni_dbus_menu_service_dbus_method_info_event_group, &_sni_dbus_menu_service_dbus_method_info_about_to_show, &_sni_dbus_menu_service_dbus_method_info_about_to_show_group, NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_items_properties_updated_updated_props = {-1, "updated_props", "a(ia{sv})", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_items_properties_updated_removed_props = {-1, "removed_props", "a(ias)", NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_items_properties_updated[] = {&_sni_dbus_menu_service_dbus_arg_info_items_properties_updated_updated_props, &_sni_dbus_menu_service_dbus_arg_info_items_properties_updated_removed_props, NULL};
static const GDBusSignalInfo _sni_dbus_menu_service_dbus_signal_info_items_properties_updated = {-1, "ItemsPropertiesUpdated", (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_items_properties_updated), NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_layout_updated_revision = {-1, "revision", "u", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_layout_updated_parent_id = {-1, "parent_id", "i", NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_layout_updated[] = {&_sni_dbus_menu_service_dbus_arg_info_layout_updated_revision, &_sni_dbus_menu_service_dbus_arg_info_layout_updated_parent_id, NULL};
static const GDBusSignalInfo _sni_dbus_menu_service_dbus_signal_info_layout_updated = {-1, "LayoutUpdated", (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_layout_updated), NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_item_activation_requested_id = {-1, "id", "i", NULL};
static const GDBusArgInfo _sni_dbus_menu_service_dbus_arg_info_item_activation_requested_timestamp = {-1, "timestamp", "u", NULL};
static const GDBusArgInfo * const _sni_dbus_menu_service_dbus_arg_info_item_activation_requested[] = {&_sni_dbus_menu_service_dbus_arg_info_item_activation_requested_id, &_sni_dbus_menu_service_dbus_arg_info_item_activation_requested_timestamp, NULL};
static const GDBusSignalInfo _sni_dbus_menu_service_dbus_signal_info_item_activation_requested = {-1, "ItemActivationRequested", (GDBusArgInfo **) (&_sni_dbus_menu_service_dbus_arg_info_item_activation_requested), NULL};
static const GDBusSignalInfo * const _sni_dbus_menu_service_dbus_signal_info[] = {&_sni_dbus_menu_service_dbus_signal_info_items_properties_updated, &_sni_dbus_menu_service_dbus_signal_info_layout_updated, &_sni_dbus_menu_service_dbus_signal_info_item_activation_requested, NULL};
static const GDBusPropertyInfo _sni_dbus_menu_service_dbus_property_info_version = {-1, "Version", "u", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_dbus_menu_service_dbus_property_info_status = {-1, "Status", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_dbus_menu_service_dbus_property_info_icon_theme_path = {-1, "IconThemePath", "as", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _sni_dbus_menu_service_dbus_property_info_text_direction = {-1, "TextDirection", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _sni_dbus_menu_service_dbus_property_info[] = {&_sni_dbus_menu_service_dbus_property_info_version, &_sni_dbus_menu_service_dbus_property_info_status, &_sni_dbus_menu_service_dbus_property_info_icon_theme_path, &_sni_dbus_menu_service_dbus_property_info_text_direction, NULL};
static const GDBusInterfaceInfo _sni_dbus_menu_service_dbus_interface_info = {-1, "com.canonical.dbusmenu", (GDBusMethodInfo **) (&_sni_dbus_menu_service_dbus_method_info), (GDBusSignalInfo **) (&_sni_dbus_menu_service_dbus_signal_info), (GDBusPropertyInfo **) (&_sni_dbus_menu_service_dbus_property_info), NULL};
static const GDBusInterfaceVTable _sni_dbus_menu_service_dbus_interface_vtable = {sni_dbus_menu_service_dbus_interface_method_call, sni_dbus_menu_service_dbus_interface_get_property, sni_dbus_menu_service_dbus_interface_set_property};

inline GVariant*
sni_empty_vardict (void)
{
	GVariantType* _tmp0_;
	GVariantType* _tmp1_;
	GVariant** _tmp2_;
	GVariant** _tmp3_;
	gint _tmp3__length1;
	GVariant* _tmp4_;
	GVariant* _tmp5_;
	GVariant* result;
	_tmp0_ = g_variant_type_new ("{sv}");
	_tmp1_ = _tmp0_;
	_tmp2_ = g_new0 (GVariant*, 0 + 1);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = 0;
	_tmp4_ = g_variant_new_array (_tmp1_, _tmp3_, 0);
	g_variant_ref_sink (_tmp4_);
	_tmp5_ = _tmp4_;
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_variant_unref), NULL);
	_g_variant_type_free0 (_tmp1_);
	result = _tmp5_;
	return result;
}

static void
_vala_array_add5 (GVariant** * array,
                  gint* length,
                  gint* size,
                  GVariant* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GVariant*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

GVariant*
sni_serialize_pixmaps (SniPixmap* pixmaps,
                       gint pixmaps_length1)
{
	GVariant** serialized_pixmaps = NULL;
	GVariant** _tmp0_;
	gint serialized_pixmaps_length1;
	gint _serialized_pixmaps_size_;
	GVariantType* _tmp4_;
	GVariantType* _tmp5_;
	GVariant** _tmp6_;
	gint _tmp6__length1;
	GVariant* _tmp7_;
	GVariant* _tmp8_;
	GVariant* result;
	_tmp0_ = g_new0 (GVariant*, 0 + 1);
	serialized_pixmaps = _tmp0_;
	serialized_pixmaps_length1 = 0;
	_serialized_pixmaps_size_ = serialized_pixmaps_length1;
	{
		SniPixmap* pixmap_collection = NULL;
		gint pixmap_collection_length1 = 0;
		gint _pixmap_collection_size_ = 0;
		gint pixmap_it = 0;
		pixmap_collection = pixmaps;
		pixmap_collection_length1 = pixmaps_length1;
		for (pixmap_it = 0; pixmap_it < pixmap_collection_length1; pixmap_it = pixmap_it + 1) {
			SniPixmap _tmp1_;
			SniPixmap _tmp2_ = {0};
			SniPixmap pixmap = {0};
			_tmp1_ = pixmap_collection[pixmap_it];
			sni_pixmap_copy (&_tmp1_, &_tmp2_);
			pixmap = _tmp2_;
			{
				GVariant* _tmp3_;
				_tmp3_ = sni_pixmap_to_variant (&pixmap);
				_vala_array_add5 (&serialized_pixmaps, &serialized_pixmaps_length1, &_serialized_pixmaps_size_, _tmp3_);
				sni_pixmap_destroy (&pixmap);
			}
		}
	}
	_tmp4_ = g_variant_type_new ("(iiay)");
	_tmp5_ = _tmp4_;
	_tmp6_ = serialized_pixmaps;
	_tmp6__length1 = serialized_pixmaps_length1;
	_tmp7_ = g_variant_new_array (_tmp5_, _tmp6_, _tmp6__length1);
	g_variant_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	_g_variant_type_free0 (_tmp5_);
	result = _tmp8_;
	serialized_pixmaps = (_vala_array_free (serialized_pixmaps, serialized_pixmaps_length1, (GDestroyNotify) g_variant_unref), NULL);
	return result;
}

/**
     * Build response for `GetLayout` method.
     *
     * The result value is recursive - it contains same structure for menu item children.
     */
static Block6Data*
block6_data_ref (Block6Data* _data6_)
{
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}

static void
block6_data_unref (void * _userdata_)
{
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		_data6_->serialized_children = (_vala_array_free (_data6_->serialized_children, _data6_->serialized_children_length1, (GDestroyNotify) g_variant_unref), NULL);
		g_slice_free (Block6Data, _data6_);
	}
}

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		block6_data_unref (_data7_->_data6_);
		_data7_->_data6_ = NULL;
		g_slice_free (Block7Data, _data7_);
	}
}

static void
_vala_array_add6 (GVariant** * array,
                  gint* length,
                  gint* size,
                  GVariant* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GVariant*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
___lambda11_ (Block7Data* _data7_,
              SniMenuItem* child)
{
	Block6Data* _data6_;
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	_data6_ = _data7_->_data6_;
	g_return_if_fail (child != NULL);
	_tmp0_ = sni_serialize_layout (child, _data6_->properties, (gint) _data6_->properties_length1, _data7_->child_max_depth);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_variant_new_variant (_tmp1_);
	g_variant_ref_sink (_tmp2_);
	_vala_array_add6 (&_data6_->serialized_children, &_data6_->serialized_children_length1, &_data6_->_serialized_children_size_, _tmp2_);
	_g_variant_unref0 (_tmp1_);
}

static void
____lambda11__gfunc (gconstpointer data,
                     gpointer self)
{
	___lambda11_ (self, (SniMenuItem*) data);
}

static gpointer
_g_variant_ref0 (gpointer self)
{
	return self ? g_variant_ref (self) : NULL;
}

GVariant*
sni_serialize_layout (SniMenuItem* menu_item,
                      SniMenuItemProperty* properties,
                      gint properties_length1,
                      gint max_depth)
{
	Block6Data* _data6_;
	GVariant* serialized_properties = NULL;
	gint _tmp0_ = 0;
	SniMenuItemProperty* _tmp1_;
	SniMenuItemProperty* _tmp2_;
	gint _tmp2__length1;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	GVariant** _tmp5_;
	GVariant* _tmp7_ = NULL;
	GVariant* _tmp8_;
	GVariant* _tmp9_;
	guint _tmp11_;
	guint _tmp12_;
	GVariant* _tmp13_;
	GVariant* _tmp14_;
	const GVariantType* _tmp15_;
	GVariant** _tmp16_;
	gint _tmp16__length1;
	GVariant* _tmp17_;
	GVariant** _tmp18_;
	GVariant** _tmp19_;
	gint _tmp19__length1;
	GVariant* _tmp20_;
	GVariant* _tmp21_;
	GVariant* result;
	g_return_val_if_fail (menu_item != NULL, NULL);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	_data6_->properties = properties;
	_data6_->properties_length1 = properties_length1;
	_tmp1_ = sni_filter_properties (menu_item, _data6_->properties, (gint) _data6_->properties_length1, &_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _tmp0_;
	_tmp3_ = sni_menu_item_serialize_properties (menu_item, _tmp2_, (gint) _tmp0_);
	_tmp4_ = _tmp3_;
	_tmp2_ = (g_free (_tmp2_), NULL);
	serialized_properties = _tmp4_;
	_tmp5_ = g_new0 (GVariant*, 0 + 1);
	_data6_->serialized_children = _tmp5_;
	_data6_->serialized_children_length1 = 0;
	_data6_->_serialized_children_size_ = _data6_->serialized_children_length1;
	if (max_depth != 0) {
		Block7Data* _data7_;
		gint _tmp6_ = 0;
		_data7_ = g_slice_new0 (Block7Data);
		_data7_->_ref_count_ = 1;
		_data7_->_data6_ = block6_data_ref (_data6_);
		if (max_depth > 0) {
			_tmp6_ = max_depth - 1;
		} else {
			_tmp6_ = -1;
		}
		_data7_->child_max_depth = _tmp6_;
		sni_menu_item_foreach (menu_item, ____lambda11__gfunc, _data7_);
		block7_data_unref (_data7_);
		_data7_ = NULL;
	}
	_tmp8_ = serialized_properties;
	_tmp9_ = _g_variant_ref0 (_tmp8_);
	_tmp7_ = _tmp9_;
	if (_tmp7_ == NULL) {
		GVariant* _tmp10_;
		_tmp10_ = sni_empty_vardict ();
		_g_variant_unref0 (_tmp7_);
		_tmp7_ = _tmp10_;
	}
	_tmp11_ = sni_menu_item_get_id (menu_item);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_variant_new_int32 ((gint32) _tmp12_);
	g_variant_ref_sink (_tmp13_);
	_tmp14_ = _tmp7_;
	_tmp7_ = NULL;
	_tmp15_ = G_VARIANT_TYPE_VARIANT;
	_tmp16_ = _data6_->serialized_children;
	_tmp16__length1 = _data6_->serialized_children_length1;
	_tmp17_ = g_variant_new_array (_tmp15_, _tmp16_, _tmp16__length1);
	g_variant_ref_sink (_tmp17_);
	_tmp18_ = g_new0 (GVariant*, 3 + 1);
	_tmp18_[0] = _tmp13_;
	_tmp18_[1] = _tmp14_;
	_tmp18_[2] = _tmp17_;
	_tmp19_ = _tmp18_;
	_tmp19__length1 = 3;
	_tmp20_ = g_variant_new_tuple (_tmp19_, 3);
	g_variant_ref_sink (_tmp20_);
	_tmp21_ = _tmp20_;
	_tmp19_ = (_vala_array_free (_tmp19_, _tmp19__length1, (GDestroyNotify) g_variant_unref), NULL);
	result = _tmp21_;
	_g_variant_unref0 (_tmp7_);
	_g_variant_unref0 (serialized_properties);
	block6_data_unref (_data6_);
	_data6_ = NULL;
	return result;
}

/**
     * Filter-out properties with default values, unless the property has been modified.
     */
static void
_vala_array_add7 (SniMenuItemProperty* * array,
                  gint* length,
                  gint* size,
                  SniMenuItemProperty value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (SniMenuItemProperty, *array, *size);
	}
	(*array)[(*length)++] = value;
}

SniMenuItemProperty*
sni_filter_properties (SniMenuItem* menu_item,
                       SniMenuItemProperty* properties,
                       gint properties_length1,
                       gint* result_length1)
{
	SniMenuItemProperty* filtered_properties = NULL;
	SniMenuItemProperty* _tmp0_;
	gint filtered_properties_length1;
	gint _filtered_properties_size_;
	SniMenuItemProperty* _tmp2_;
	gint _tmp2__length1;
	SniMenuItemProperty* result;
	g_return_val_if_fail (menu_item != NULL, NULL);
	_tmp0_ = g_new0 (SniMenuItemProperty, 0);
	filtered_properties = _tmp0_;
	filtered_properties_length1 = 0;
	_filtered_properties_size_ = filtered_properties_length1;
	{
		SniMenuItemProperty* property_collection = NULL;
		gint property_collection_length1 = 0;
		gint _property_collection_size_ = 0;
		gint property_it = 0;
		property_collection = properties;
		property_collection_length1 = properties_length1;
		for (property_it = 0; property_it < property_collection_length1; property_it = property_it + 1) {
			SniMenuItemProperty property = 0;
			property = property_collection[property_it];
			{
				gboolean _tmp1_ = FALSE;
				if (!sni_menu_item_has_modified_property (menu_item, property)) {
					_tmp1_ = sni_menu_item_has_default_property (menu_item, property);
				} else {
					_tmp1_ = FALSE;
				}
				if (_tmp1_) {
					continue;
				}
				_vala_array_add7 (&filtered_properties, &filtered_properties_length1, &_filtered_properties_size_, property);
			}
		}
	}
	_tmp2_ = filtered_properties;
	_tmp2__length1 = filtered_properties_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static void
_vala_array_add8 (SniMenuItemProperty* * array,
                  gint* length,
                  gint* size,
                  SniMenuItemProperty value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (SniMenuItemProperty, *array, *size);
	}
	(*array)[(*length)++] = value;
}

SniMenuItemProperty*
sni_unpack_properties (guint properties_mask,
                       gint* result_length1)
{
	SniMenuItemProperty* properties = NULL;
	SniMenuItemProperty* _tmp0_;
	gint properties_length1;
	gint _properties_size_;
	guint index = 0U;
	SniMenuItemProperty* _tmp2_;
	gint _tmp2__length1;
	SniMenuItemProperty* result;
	_tmp0_ = g_new0 (SniMenuItemProperty, 0);
	properties = _tmp0_;
	properties_length1 = 0;
	_properties_size_ = properties_length1;
	index = 0U;
	while (TRUE) {
		guint _tmp1_;
		if (!(properties_mask != 0U)) {
			break;
		}
		if ((properties_mask & 1U) != 0U) {
			_vala_array_add8 (&properties, &properties_length1, &_properties_size_, (SniMenuItemProperty) index);
		}
		properties_mask = properties_mask >> 1;
		_tmp1_ = index;
		index = _tmp1_ + 1;
	}
	_tmp2_ = properties;
	_tmp2__length1 = properties_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static inline gpointer
sni_status_notifier_item_dbus_service_get_instance_private (SniStatusNotifierItemDBusService* self)
{
	return G_STRUCT_MEMBER_P (self, SniStatusNotifierItemDBusService_private_offset);
}

SniStatusNotifierItemDBusService*
sni_status_notifier_item_dbus_service_construct (GType object_type,
                                                 const gchar* menu_object_path,
                                                 const gchar* icon_theme_path)
{
	SniStatusNotifierItemDBusService * self = NULL;
	char* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (menu_object_path != NULL, NULL);
	g_return_val_if_fail (icon_theme_path != NULL, NULL);
	self = (SniStatusNotifierItemDBusService*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (menu_object_path);
	_g_free0 (self->priv->_menu);
	self->priv->_menu = _tmp0_;
	_tmp1_ = g_strdup (icon_theme_path);
	_g_free0 (self->priv->_icon_theme_path);
	self->priv->_icon_theme_path = _tmp1_;
	return self;
}

SniStatusNotifierItemDBusService*
sni_status_notifier_item_dbus_service_new (const gchar* menu_object_path,
                                           const gchar* icon_theme_path)
{
	return sni_status_notifier_item_dbus_service_construct (SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, menu_object_path, icon_theme_path);
}

void
sni_status_notifier_item_dbus_service_context_menu (SniStatusNotifierItemDBusService* self,
                                                    gint32 x,
                                                    gint32 y,
                                                    GError** error)
{
	g_return_if_fail (self != NULL);
}

void
sni_status_notifier_item_dbus_service_provide_xdg_activation_token (SniStatusNotifierItemDBusService* self,
                                                                    const gchar* token,
                                                                    GError** error)
{
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (token != NULL);
	_tmp0_ = token;
	if (_tmp0_ == NULL) {
		_tmp0_ = "";
	}
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->activation_token);
	self->activation_token = _tmp1_;
	_tmp2_ = self->activation_token;
	g_signal_emit (self, sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_RECEIVED_ACTIVATION_TOKEN_SIGNAL], 0, _tmp2_);
}

void
sni_status_notifier_item_dbus_service_activate (SniStatusNotifierItemDBusService* self,
                                                gint32 x,
                                                gint32 y,
                                                GError** error)
{
	const gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->activation_token;
	g_signal_emit (self, sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ACTIVATED_SIGNAL], 0, _tmp0_);
}

void
sni_status_notifier_item_dbus_service_secondary_activate (SniStatusNotifierItemDBusService* self,
                                                          gint32 x,
                                                          gint32 y,
                                                          GError** error)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_SECONDARY_ACTIVATED_SIGNAL], 0);
}

void
sni_status_notifier_item_dbus_service_scroll (SniStatusNotifierItemDBusService* self,
                                              gint32 delta,
                                              const gchar* orientation,
                                              GError** error)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	g_return_if_fail (self != NULL);
	g_return_if_fail (orientation != NULL);
	if (delta != ((gint32) 0)) {
		_tmp1_ = orientation != NULL;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = g_ascii_strdown (orientation, (gssize) -1);
		_tmp3_ = _tmp2_;
		_tmp0_ = g_strcmp0 (_tmp3_, "vertical") == 0;
		_g_free0 (_tmp3_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		g_signal_emit (self, sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_SCROLLED_SIGNAL], 0, (gint) delta);
	}
}

void
sni_status_notifier_item_dbus_service_set_title_internal (SniStatusNotifierItemDBusService* self,
                                                          const gchar* value,
                                                          gboolean emit_signal)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = self->priv->_title;
	if (g_strcmp0 (_tmp0_, value) == 0) {
		return;
	}
	_tmp1_ = g_strdup (value);
	_g_free0 (self->priv->_title);
	self->priv->_title = _tmp1_;
	if (emit_signal) {
		g_signal_emit (self, sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_TITLE_SIGNAL], 0);
	}
}

void
sni_status_notifier_item_dbus_service_set_icon_name_internal (SniStatusNotifierItemDBusService* self,
                                                              const gchar* value,
                                                              gboolean emit_signal)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = self->priv->_icon_name;
	if (g_strcmp0 (_tmp0_, value) == 0) {
		return;
	}
	_tmp1_ = g_strdup (value);
	_g_free0 (self->priv->_icon_name);
	self->priv->_icon_name = _tmp1_;
	if (emit_signal) {
		g_signal_emit (self, sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_ICON_SIGNAL], 0);
		if (self->priv->_status == SNI_INDICATOR_STATUS_NEEDS_ATTENTION) {
			g_signal_emit (self, sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_ATTENTION_ICON_SIGNAL], 0);
		}
	}
}

SniIndicatorStatus
sni_status_notifier_item_dbus_service_get_status_internal (SniStatusNotifierItemDBusService* self)
{
	SniIndicatorStatus result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_status;
	return result;
}

void
sni_status_notifier_item_dbus_service_set_status_internal (SniStatusNotifierItemDBusService* self,
                                                           SniIndicatorStatus value,
                                                           gboolean emit_signal)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_status == value) {
		return;
	}
	self->priv->_status = value;
	if (emit_signal) {
		if (value == SNI_INDICATOR_STATUS_NEEDS_ATTENTION) {
			g_signal_emit (self, sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_ATTENTION_ICON_SIGNAL], 0);
		}
		g_signal_emit (self, sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_STATUS_SIGNAL], 0);
	}
}

void
sni_status_notifier_item_dbus_service_get_tooltip_internal (SniStatusNotifierItemDBusService* self,
                                                            SniTooltip* result)
{
	SniTooltip _tmp0_;
	SniTooltip _tmp1_;
	SniTooltip _tmp2_ = {0};
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_tooltip;
	_tmp1_ = _tmp0_;
	sni_tooltip_copy (&_tmp1_, &_tmp2_);
	*result = _tmp2_;
	return;
}

void
sni_status_notifier_item_dbus_service_set_tooltip_internal (SniStatusNotifierItemDBusService* self,
                                                            SniTooltip* value,
                                                            gboolean emit_signal)
{
	SniTooltip _tmp0_;
	SniTooltip _tmp1_;
	SniTooltip _tmp2_;
	SniTooltip _tmp3_ = {0};
	g_return_if_fail (self != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = *value;
	if (sni_tooltip_equals (&self->priv->_tooltip, &_tmp0_)) {
		return;
	}
	_tmp1_ = *value;
	_tmp2_ = _tmp1_;
	sni_tooltip_copy (&_tmp2_, &_tmp3_);
	sni_tooltip_destroy (&self->priv->_tooltip);
	self->priv->_tooltip = _tmp3_;
	if (emit_signal) {
		g_signal_emit (self, sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_TOOLTIP_SIGNAL], 0);
	}
}

void
sni_status_notifier_item_dbus_service_emit_new_menu (SniStatusNotifierItemDBusService* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_MENU_SIGNAL], 0);
}

gchar*
sni_status_notifier_item_dbus_service_get_id (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (APPLICATION_ID);
	result = _tmp0_;
	return result;
}

gchar*
sni_status_notifier_item_dbus_service_get_category (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("ApplicationStatus");
	result = _tmp0_;
	return result;
}

gboolean
sni_status_notifier_item_dbus_service_get_item_is_menu (SniStatusNotifierItemDBusService* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_item_is_menu;
	return result;
}

char*
sni_status_notifier_item_dbus_service_get_menu (SniStatusNotifierItemDBusService* self)
{
	char* result;
	const char* _tmp0_;
	char* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_menu;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

gchar*
sni_status_notifier_item_dbus_service_get_title (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

gchar*
sni_status_notifier_item_dbus_service_get_status (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = sni_indicator_status_to_string (self->priv->_status);
	result = _tmp0_;
	return result;
}

gchar*
sni_status_notifier_item_dbus_service_get_icon_theme_path (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon_theme_path;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

gchar*
sni_status_notifier_item_dbus_service_get_icon_name (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
_vala_SniPixmap_array_free (SniPixmap * array,
                            gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			sni_pixmap_destroy (&array[i]);
		}
	}
	g_free (array);
}

GVariant*
sni_status_notifier_item_dbus_service_get_icon_pixmap (SniStatusNotifierItemDBusService* self)
{
	GVariant* result;
	SniPixmap* _tmp0_;
	SniPixmap* _tmp1_;
	gint _tmp1__length1;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_new0 (SniPixmap, 0);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = 0;
	_tmp2_ = sni_serialize_pixmaps (_tmp1_, (gint) 0);
	_tmp3_ = _tmp2_;
	_tmp1_ = (_vala_SniPixmap_array_free (_tmp1_, _tmp1__length1), NULL);
	result = _tmp3_;
	return result;
}

gchar*
sni_status_notifier_item_dbus_service_get_overlay_icon_name (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_overlay_icon_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

GVariant*
sni_status_notifier_item_dbus_service_get_overlay_icon_pixmap (SniStatusNotifierItemDBusService* self)
{
	GVariant* result;
	SniPixmap* _tmp0_;
	SniPixmap* _tmp1_;
	gint _tmp1__length1;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_new0 (SniPixmap, 0);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = 0;
	_tmp2_ = sni_serialize_pixmaps (_tmp1_, (gint) 0);
	_tmp3_ = _tmp2_;
	_tmp1_ = (_vala_SniPixmap_array_free (_tmp1_, _tmp1__length1), NULL);
	result = _tmp3_;
	return result;
}

gchar*
sni_status_notifier_item_dbus_service_get_attention_icon_name (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = sni_status_notifier_item_dbus_service_get_icon_name (self);
	_tmp1_ = _tmp0_;
	result = _tmp1_;
	return result;
}

GVariant*
sni_status_notifier_item_dbus_service_get_attention_icon_pixmap (SniStatusNotifierItemDBusService* self)
{
	GVariant* result;
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = sni_status_notifier_item_dbus_service_get_icon_pixmap (self);
	_tmp1_ = _tmp0_;
	result = _tmp1_;
	return result;
}

gchar*
sni_status_notifier_item_dbus_service_get_attention_movie_name (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("");
	result = _tmp0_;
	return result;
}

GVariant*
sni_status_notifier_item_dbus_service_get_tooltip (SniStatusNotifierItemDBusService* self)
{
	GVariant* result;
	GVariant* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = sni_tooltip_to_variant (&self->priv->_tooltip);
	result = _tmp0_;
	return result;
}

gint32
sni_status_notifier_item_dbus_service_get_window_id (SniStatusNotifierItemDBusService* self)
{
	gint32 result;
	g_return_val_if_fail (self != NULL, -1);
	result = (gint32) 0;
	return result;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static GObject *
sni_status_notifier_item_dbus_service_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SniStatusNotifierItemDBusService * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	parent_class = G_OBJECT_CLASS (sni_status_notifier_item_dbus_service_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, SniStatusNotifierItemDBusService);
	self->priv->_item_is_menu = !sni_capabilities_have_activation ();
	_tmp0_ = g_get_application_name ();
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_title);
	self->priv->_title = _tmp1_;
	_tmp2_ = string_to_string (APPLICATION_ID);
	_tmp3_ = g_strconcat (_tmp2_, "-symbolic", NULL);
	_g_free0 (self->priv->_icon_name);
	self->priv->_icon_name = _tmp3_;
	_tmp4_ = g_strdup ("");
	_g_free0 (self->priv->_overlay_icon_name);
	self->priv->_overlay_icon_name = _tmp4_;
	sni_tooltip_destroy (&self->priv->_tooltip);
	sni_tooltip_init (&self->priv->_tooltip);
	_tmp5_ = g_strdup ("");
	_g_free0 (self->activation_token);
	self->activation_token = _tmp5_;
	return obj;
}

static void
sni_status_notifier_item_dbus_service_class_init (SniStatusNotifierItemDBusServiceClass * klass,
                                                  gpointer klass_data)
{
	sni_status_notifier_item_dbus_service_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SniStatusNotifierItemDBusService_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_sni_status_notifier_item_dbus_service_get_property;
	G_OBJECT_CLASS (klass)->constructor = sni_status_notifier_item_dbus_service_constructor;
	G_OBJECT_CLASS (klass)->finalize = sni_status_notifier_item_dbus_service_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ID_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_CATEGORY_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_CATEGORY_PROPERTY] = g_param_spec_string ("category", "category", "category", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ITEM_IS_MENU_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ITEM_IS_MENU_PROPERTY] = g_param_spec_boolean ("item-is-menu", "item-is-menu", "item-is-menu", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_MENU_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_MENU_PROPERTY] = g_param_spec_string ("menu", "menu", "menu", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_TITLE_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_STATUS_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_STATUS_PROPERTY] = g_param_spec_string ("status", "status", "status", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ICON_THEME_PATH_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ICON_THEME_PATH_PROPERTY] = g_param_spec_string ("icon-theme-path", "icon-theme-path", "icon-theme-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ICON_NAME_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ICON_NAME_PROPERTY] = g_param_spec_string ("icon-name", "icon-name", "icon-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ICON_PIXMAP_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ICON_PIXMAP_PROPERTY] = g_param_spec_variant ("icon-pixmap", "icon-pixmap", "icon-pixmap", G_VARIANT_TYPE_ANY, NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_OVERLAY_ICON_NAME_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_OVERLAY_ICON_NAME_PROPERTY] = g_param_spec_string ("overlay-icon-name", "overlay-icon-name", "overlay-icon-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_OVERLAY_ICON_PIXMAP_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_OVERLAY_ICON_PIXMAP_PROPERTY] = g_param_spec_variant ("overlay-icon-pixmap", "overlay-icon-pixmap", "overlay-icon-pixmap", G_VARIANT_TYPE_ANY, NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ATTENTION_ICON_NAME_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ATTENTION_ICON_NAME_PROPERTY] = g_param_spec_string ("attention-icon-name", "attention-icon-name", "attention-icon-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ATTENTION_ICON_PIXMAP_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ATTENTION_ICON_PIXMAP_PROPERTY] = g_param_spec_variant ("attention-icon-pixmap", "attention-icon-pixmap", "attention-icon-pixmap", G_VARIANT_TYPE_ANY, NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ATTENTION_MOVIE_NAME_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ATTENTION_MOVIE_NAME_PROPERTY] = g_param_spec_string ("attention-movie-name", "attention-movie-name", "attention-movie-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_TOOLTIP_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_TOOLTIP_PROPERTY] = g_param_spec_variant ("tooltip", "tooltip", "tooltip", G_VARIANT_TYPE_ANY, NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_WINDOW_ID_PROPERTY, sni_status_notifier_item_dbus_service_properties[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_WINDOW_ID_PROPERTY] = g_param_spec_int ("window-id", "window-id", "window-id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_TITLE_SIGNAL] = g_signal_new ("new-title", SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_ICON_SIGNAL] = g_signal_new ("new-icon", SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_ATTENTION_ICON_SIGNAL] = g_signal_new ("new-attention-icon", SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_STATUS_SIGNAL] = g_signal_new ("new-status", SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_MENU_SIGNAL] = g_signal_new ("new-menu", SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_NEW_TOOLTIP_SIGNAL] = g_signal_new ("new-tooltip", SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_RECEIVED_ACTIVATION_TOKEN_SIGNAL] = g_signal_new ("received-activation-token", SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
	sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ACTIVATED_SIGNAL] = g_signal_new ("activated", SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
	sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_SECONDARY_ACTIVATED_SIGNAL] = g_signal_new ("secondary-activated", SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	sni_status_notifier_item_dbus_service_signals[SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_SCROLLED_SIGNAL] = g_signal_new ("scrolled", SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
}

static void
sni_status_notifier_item_dbus_service_instance_init (SniStatusNotifierItemDBusService * self,
                                                     gpointer klass)
{
	self->priv = sni_status_notifier_item_dbus_service_get_instance_private (self);
	self->priv->_status = SNI_INDICATOR_STATUS_ACTIVE;
}

static void
sni_status_notifier_item_dbus_service_finalize (GObject * obj)
{
	SniStatusNotifierItemDBusService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, SniStatusNotifierItemDBusService);
	sni_tooltip_destroy (&self->priv->_tooltip);
	_g_free0 (self->priv->_menu);
	_g_free0 (self->priv->_title);
	_g_free0 (self->priv->_icon_theme_path);
	_g_free0 (self->priv->_icon_name);
	_g_free0 (self->priv->_overlay_icon_name);
	_g_free0 (self->activation_token);
	G_OBJECT_CLASS (sni_status_notifier_item_dbus_service_parent_class)->finalize (obj);
}

/**
     * A D-Bus service for exporting an tray icon.
     *
     * We try to keep things modern by not using pixmaps. Not all features are handled the same
     * way by various desktops.
     *
     * Note that unlike standard D-Bus services, the authors of the spec instead of using
     * `PropertiesChanged` signal invented custom signals (`New*`) for notifying about changes.
     * So, we don't emit `PropertiesChanged` as it's redundant in this case.
     *
     * https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem/
     * https://api.kde.org/kstatusnotifieritem.html
     */
GType
sni_status_notifier_item_dbus_service_get_type (void)
{
	return sni_status_notifier_item_dbus_service_type_id;
}

GType
sni_status_notifier_item_dbus_service_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (SniStatusNotifierItemDBusServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sni_status_notifier_item_dbus_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SniStatusNotifierItemDBusService), 0, (GInstanceInitFunc) sni_status_notifier_item_dbus_service_instance_init, NULL };
	sni_status_notifier_item_dbus_service_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "SniStatusNotifierItemDBusService", &g_define_type_info, 0);
	g_type_set_qdata (sni_status_notifier_item_dbus_service_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) sni_status_notifier_item_dbus_service_register_object);
	SniStatusNotifierItemDBusService_private_offset = sizeof (SniStatusNotifierItemDBusServicePrivate);
	return sni_status_notifier_item_dbus_service_type_id;
}

static void
_vala_sni_status_notifier_item_dbus_service_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec)
{
	SniStatusNotifierItemDBusService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SNI_TYPE_STATUS_NOTIFIER_ITEM_DBUS_SERVICE, SniStatusNotifierItemDBusService);
	switch (property_id) {
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ID_PROPERTY:
		g_value_take_string (value, sni_status_notifier_item_dbus_service_get_id (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_CATEGORY_PROPERTY:
		g_value_take_string (value, sni_status_notifier_item_dbus_service_get_category (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ITEM_IS_MENU_PROPERTY:
		g_value_set_boolean (value, sni_status_notifier_item_dbus_service_get_item_is_menu (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_MENU_PROPERTY:
		g_value_take_string (value, sni_status_notifier_item_dbus_service_get_menu (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_TITLE_PROPERTY:
		g_value_take_string (value, sni_status_notifier_item_dbus_service_get_title (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_STATUS_PROPERTY:
		g_value_take_string (value, sni_status_notifier_item_dbus_service_get_status (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ICON_THEME_PATH_PROPERTY:
		g_value_take_string (value, sni_status_notifier_item_dbus_service_get_icon_theme_path (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ICON_NAME_PROPERTY:
		g_value_take_string (value, sni_status_notifier_item_dbus_service_get_icon_name (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ICON_PIXMAP_PROPERTY:
		g_value_take_variant (value, sni_status_notifier_item_dbus_service_get_icon_pixmap (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_OVERLAY_ICON_NAME_PROPERTY:
		g_value_take_string (value, sni_status_notifier_item_dbus_service_get_overlay_icon_name (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_OVERLAY_ICON_PIXMAP_PROPERTY:
		g_value_take_variant (value, sni_status_notifier_item_dbus_service_get_overlay_icon_pixmap (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ATTENTION_ICON_NAME_PROPERTY:
		g_value_take_string (value, sni_status_notifier_item_dbus_service_get_attention_icon_name (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ATTENTION_ICON_PIXMAP_PROPERTY:
		g_value_take_variant (value, sni_status_notifier_item_dbus_service_get_attention_icon_pixmap (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_ATTENTION_MOVIE_NAME_PROPERTY:
		g_value_take_string (value, sni_status_notifier_item_dbus_service_get_attention_movie_name (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_TOOLTIP_PROPERTY:
		g_value_take_variant (value, sni_status_notifier_item_dbus_service_get_tooltip (self));
		break;
		case SNI_STATUS_NOTIFIER_ITEM_DBUS_SERVICE_WINDOW_ID_PROPERTY:
		g_value_set_int (value, sni_status_notifier_item_dbus_service_get_window_id (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_dbus_sni_status_notifier_item_dbus_service_context_menu (SniStatusNotifierItemDBusService* self,
                                                          GVariant* _parameters_,
                                                          GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint32 x = 0;
	GVariant* _tmp3_;
	gint32 y = 0;
	GVariant* _tmp4_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp3_ = g_variant_iter_next_value (&_arguments_iter);
	x = g_variant_get_int32 (_tmp3_);
	g_variant_unref (_tmp3_);
	_tmp4_ = g_variant_iter_next_value (&_arguments_iter);
	y = g_variant_get_int32 (_tmp4_);
	g_variant_unref (_tmp4_);
	sni_status_notifier_item_dbus_service_context_menu (self, x, y, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_sni_status_notifier_item_dbus_service_provide_xdg_activation_token (SniStatusNotifierItemDBusService* self,
                                                                          GVariant* _parameters_,
                                                                          GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* token = NULL;
	GVariant* _tmp5_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp5_ = g_variant_iter_next_value (&_arguments_iter);
	token = g_variant_dup_string (_tmp5_, NULL);
	g_variant_unref (_tmp5_);
	sni_status_notifier_item_dbus_service_provide_xdg_activation_token (self, token, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (token);
	;
}

static void
_dbus_sni_status_notifier_item_dbus_service_activate (SniStatusNotifierItemDBusService* self,
                                                      GVariant* _parameters_,
                                                      GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint32 x = 0;
	GVariant* _tmp6_;
	gint32 y = 0;
	GVariant* _tmp7_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp6_ = g_variant_iter_next_value (&_arguments_iter);
	x = g_variant_get_int32 (_tmp6_);
	g_variant_unref (_tmp6_);
	_tmp7_ = g_variant_iter_next_value (&_arguments_iter);
	y = g_variant_get_int32 (_tmp7_);
	g_variant_unref (_tmp7_);
	sni_status_notifier_item_dbus_service_activate (self, x, y, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_sni_status_notifier_item_dbus_service_secondary_activate (SniStatusNotifierItemDBusService* self,
                                                                GVariant* _parameters_,
                                                                GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint32 x = 0;
	GVariant* _tmp8_;
	gint32 y = 0;
	GVariant* _tmp9_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp8_ = g_variant_iter_next_value (&_arguments_iter);
	x = g_variant_get_int32 (_tmp8_);
	g_variant_unref (_tmp8_);
	_tmp9_ = g_variant_iter_next_value (&_arguments_iter);
	y = g_variant_get_int32 (_tmp9_);
	g_variant_unref (_tmp9_);
	sni_status_notifier_item_dbus_service_secondary_activate (self, x, y, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_sni_status_notifier_item_dbus_service_scroll (SniStatusNotifierItemDBusService* self,
                                                    GVariant* _parameters_,
                                                    GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint32 delta = 0;
	GVariant* _tmp10_;
	gchar* orientation = NULL;
	GVariant* _tmp11_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp10_ = g_variant_iter_next_value (&_arguments_iter);
	delta = g_variant_get_int32 (_tmp10_);
	g_variant_unref (_tmp10_);
	_tmp11_ = g_variant_iter_next_value (&_arguments_iter);
	orientation = g_variant_dup_string (_tmp11_, NULL);
	g_variant_unref (_tmp11_);
	sni_status_notifier_item_dbus_service_scroll (self, delta, orientation, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (orientation);
	;
}

static void
sni_status_notifier_item_dbus_service_dbus_interface_method_call (GDBusConnection* connection,
                                                                  const gchar* sender,
                                                                  const gchar* object_path,
                                                                  const gchar* interface_name,
                                                                  const gchar* method_name,
                                                                  GVariant* parameters,
                                                                  GDBusMethodInvocation* invocation,
                                                                  gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "ContextMenu") == 0) {
		_dbus_sni_status_notifier_item_dbus_service_context_menu (object, parameters, invocation);
	} else if (strcmp (method_name, "ProvideXdgActivationToken") == 0) {
		_dbus_sni_status_notifier_item_dbus_service_provide_xdg_activation_token (object, parameters, invocation);
	} else if (strcmp (method_name, "Activate") == 0) {
		_dbus_sni_status_notifier_item_dbus_service_activate (object, parameters, invocation);
	} else if (strcmp (method_name, "SecondaryActivate") == 0) {
		_dbus_sni_status_notifier_item_dbus_service_secondary_activate (object, parameters, invocation);
	} else if (strcmp (method_name, "Scroll") == 0) {
		_dbus_sni_status_notifier_item_dbus_service_scroll (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_id (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_id (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_category (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_category (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_item_is_menu (SniStatusNotifierItemDBusService* self)
{
	gboolean result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_item_is_menu (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_menu (SniStatusNotifierItemDBusService* self)
{
	char* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_menu (self);
	_reply = g_variant_new_object_path (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_title (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_title (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_status (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_status (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_icon_theme_path (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_icon_theme_path (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_icon_name (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_icon_name (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_icon_pixmap (SniStatusNotifierItemDBusService* self)
{
	GVariant* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_icon_pixmap (self);
	_reply = result;
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_overlay_icon_name (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_overlay_icon_name (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_overlay_icon_pixmap (SniStatusNotifierItemDBusService* self)
{
	GVariant* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_overlay_icon_pixmap (self);
	_reply = result;
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_attention_icon_name (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_attention_icon_name (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_attention_icon_pixmap (SniStatusNotifierItemDBusService* self)
{
	GVariant* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_attention_icon_pixmap (self);
	_reply = result;
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_attention_movie_name (SniStatusNotifierItemDBusService* self)
{
	gchar* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_attention_movie_name (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_tooltip (SniStatusNotifierItemDBusService* self)
{
	GVariant* result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_tooltip (self);
	_reply = result;
	return _reply;
}

static GVariant*
_dbus_sni_status_notifier_item_dbus_service_get_window_id (SniStatusNotifierItemDBusService* self)
{
	gint32 result;
	GVariant* _reply;
	result = sni_status_notifier_item_dbus_service_get_window_id (self);
	_reply = g_variant_new_int32 (result);
	return _reply;
}

static GVariant*
sni_status_notifier_item_dbus_service_dbus_interface_get_property (GDBusConnection* connection,
                                                                   const gchar* sender,
                                                                   const gchar* object_path,
                                                                   const gchar* interface_name,
                                                                   const gchar* property_name,
                                                                   GError** error,
                                                                   gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "Id") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_id (object);
	} else if (strcmp (property_name, "Category") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_category (object);
	} else if (strcmp (property_name, "ItemIsMenu") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_item_is_menu (object);
	} else if (strcmp (property_name, "Menu") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_menu (object);
	} else if (strcmp (property_name, "Title") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_title (object);
	} else if (strcmp (property_name, "Status") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_status (object);
	} else if (strcmp (property_name, "IconThemePath") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_icon_theme_path (object);
	} else if (strcmp (property_name, "IconName") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_icon_name (object);
	} else if (strcmp (property_name, "IconPixmap") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_icon_pixmap (object);
	} else if (strcmp (property_name, "OverlayIconName") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_overlay_icon_name (object);
	} else if (strcmp (property_name, "OverlayIconPixmap") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_overlay_icon_pixmap (object);
	} else if (strcmp (property_name, "AttentionIconName") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_attention_icon_name (object);
	} else if (strcmp (property_name, "AttentionIconPixmap") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_attention_icon_pixmap (object);
	} else if (strcmp (property_name, "AttentionMovieName") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_attention_movie_name (object);
	} else if (strcmp (property_name, "ToolTip") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_tooltip (object);
	} else if (strcmp (property_name, "WindowId") == 0) {
		return _dbus_sni_status_notifier_item_dbus_service_get_window_id (object);
	}
	return NULL;
}

static gboolean
sni_status_notifier_item_dbus_service_dbus_interface_set_property (GDBusConnection* connection,
                                                                   const gchar* sender,
                                                                   const gchar* object_path,
                                                                   const gchar* interface_name,
                                                                   const gchar* property_name,
                                                                   GVariant* value,
                                                                   GError** error,
                                                                   gpointer user_data)
{
	return FALSE;
}

static void
_dbus_sni_status_notifier_item_dbus_service_new_title (GObject* _sender,
                                                       gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.kde.StatusNotifierItem", "NewTitle", _arguments, NULL);
}

static void
_dbus_sni_status_notifier_item_dbus_service_new_icon (GObject* _sender,
                                                      gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.kde.StatusNotifierItem", "NewIcon", _arguments, NULL);
}

static void
_dbus_sni_status_notifier_item_dbus_service_new_attention_icon (GObject* _sender,
                                                                gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.kde.StatusNotifierItem", "NewAttentionIcon", _arguments, NULL);
}

static void
_dbus_sni_status_notifier_item_dbus_service_new_status (GObject* _sender,
                                                        gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.kde.StatusNotifierItem", "NewStatus", _arguments, NULL);
}

static void
_dbus_sni_status_notifier_item_dbus_service_new_menu (GObject* _sender,
                                                      gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.kde.StatusNotifierItem", "NewMenu", _arguments, NULL);
}

static void
_dbus_sni_status_notifier_item_dbus_service_new_tooltip (GObject* _sender,
                                                         gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "org.kde.StatusNotifierItem", "NewToolTip", _arguments, NULL);
}

guint
sni_status_notifier_item_dbus_service_register_object (gpointer object,
                                                       GDBusConnection* connection,
                                                       const gchar* path,
                                                       GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_sni_status_notifier_item_dbus_service_dbus_interface_info), &_sni_status_notifier_item_dbus_service_dbus_interface_vtable, data, _sni_status_notifier_item_dbus_service_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "new-title", (GCallback) _dbus_sni_status_notifier_item_dbus_service_new_title, data);
	g_signal_connect (object, "new-icon", (GCallback) _dbus_sni_status_notifier_item_dbus_service_new_icon, data);
	g_signal_connect (object, "new-attention-icon", (GCallback) _dbus_sni_status_notifier_item_dbus_service_new_attention_icon, data);
	g_signal_connect (object, "new-status", (GCallback) _dbus_sni_status_notifier_item_dbus_service_new_status, data);
	g_signal_connect (object, "new-menu", (GCallback) _dbus_sni_status_notifier_item_dbus_service_new_menu, data);
	g_signal_connect (object, "new-tooltip", (GCallback) _dbus_sni_status_notifier_item_dbus_service_new_tooltip, data);
	return result;
}

static void
_sni_status_notifier_item_dbus_service_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_sni_status_notifier_item_dbus_service_new_title, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_sni_status_notifier_item_dbus_service_new_icon, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_sni_status_notifier_item_dbus_service_new_attention_icon, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_sni_status_notifier_item_dbus_service_new_status, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_sni_status_notifier_item_dbus_service_new_menu, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_sni_status_notifier_item_dbus_service_new_tooltip, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
sni_dbus_menu_service_get_instance_private (SniDBusMenuService* self)
{
	return G_STRUCT_MEMBER_P (self, SniDBusMenuService_private_offset);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static void
_sni_dbus_menu_service_on_child_added_sni_menu_item_child_added (SniMenuItem* _sender,
                                                                 SniMenuItem* child,
                                                                 gpointer self)
{
	sni_dbus_menu_service_on_child_added ((SniDBusMenuService*) self, _sender, child);
}

static void
_sni_dbus_menu_service_on_child_removed_sni_menu_item_child_added (SniMenuItem* _sender,
                                                                   SniMenuItem* child,
                                                                   gpointer self)
{
	sni_dbus_menu_service_on_child_removed ((SniDBusMenuService*) self, _sender, child);
}

static void
_sni_dbus_menu_service_on_changed_sni_menu_item_changed (SniMenuItem* _sender,
                                                         SniMenuItemProperty property,
                                                         gpointer self)
{
	sni_dbus_menu_service_on_changed ((SniDBusMenuService*) self, _sender, property);
}

static void
__lambda7_ (SniDBusMenuService* self,
            SniMenuItem* menu_item)
{
	GHashTable* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	g_return_if_fail (menu_item != NULL);
	_tmp0_ = self->priv->menu_items_by_id;
	_tmp1_ = sni_menu_item_get_id (menu_item);
	_tmp2_ = _tmp1_;
	g_hash_table_insert (_tmp0_, (gpointer) ((guintptr) _tmp2_), menu_item);
	_tmp4_ = sni_menu_item_get_name (menu_item);
	_tmp5_ = _tmp4_;
	if (g_strcmp0 (_tmp5_, "") != 0) {
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp6_ = sni_menu_item_get_name (menu_item);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp7_ != NULL;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		GHashTable* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		gchar* _tmp11_;
		_tmp8_ = self->priv->menu_items_by_name;
		_tmp9_ = sni_menu_item_get_name (menu_item);
		_tmp10_ = _tmp9_;
		_tmp11_ = g_strdup (_tmp10_);
		g_hash_table_insert (_tmp8_, _tmp11_, menu_item);
	}
	g_signal_connect_object (menu_item, "child-added", (GCallback) _sni_dbus_menu_service_on_child_added_sni_menu_item_child_added, self, 0);
	g_signal_connect_object (menu_item, "child-added", (GCallback) _sni_dbus_menu_service_on_child_removed_sni_menu_item_child_added, self, 0);
	g_signal_connect_object (menu_item, "changed", (GCallback) _sni_dbus_menu_service_on_changed_sni_menu_item_changed, self, 0);
}

static void
___lambda7__gfunc (gconstpointer data,
                   gpointer self)
{
	__lambda7_ ((SniDBusMenuService*) self, (SniMenuItem*) data);
}

SniDBusMenuService*
sni_dbus_menu_service_construct (GType object_type,
                                 SniMenuItem* root,
                                 SniIndicatorActionGroup* action_group,
                                 const gchar* icon_theme_path)
{
	SniDBusMenuService * self = NULL;
	SniMenuItem* _tmp0_;
	SniIndicatorActionGroup* _tmp1_;
	gchar* _tmp2_;
	GHashFunc _tmp3_;
	GEqualFunc _tmp4_;
	GHashTable* _tmp5_;
	GHashFunc _tmp6_;
	GEqualFunc _tmp7_;
	GHashTable* _tmp8_;
	SniMenuItem* _tmp9_;
	g_return_val_if_fail (root != NULL, NULL);
	g_return_val_if_fail (action_group != NULL, NULL);
	g_return_val_if_fail (icon_theme_path != NULL, NULL);
	self = (SniDBusMenuService*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (root);
	_g_object_unref0 (self->priv->root);
	self->priv->root = _tmp0_;
	_tmp1_ = _g_object_ref0 (action_group);
	_g_object_unref0 (self->priv->action_group);
	self->priv->action_group = _tmp1_;
	_tmp2_ = g_strdup (icon_theme_path);
	_g_free0 (self->priv->_icon_theme_path);
	self->priv->_icon_theme_path = _tmp2_;
	_tmp3_ = g_direct_hash;
	_tmp4_ = g_direct_equal;
	_tmp5_ = g_hash_table_new_full (_tmp3_, _tmp4_, NULL, NULL);
	_g_hash_table_unref0 (self->priv->menu_items_by_id);
	self->priv->menu_items_by_id = _tmp5_;
	_tmp6_ = g_str_hash;
	_tmp7_ = g_str_equal;
	_tmp8_ = g_hash_table_new_full (_tmp6_, _tmp7_, _g_free0_, NULL);
	_g_hash_table_unref0 (self->priv->menu_items_by_name);
	self->priv->menu_items_by_name = _tmp8_;
	_tmp9_ = self->priv->root;
	sni_menu_item_traverse (_tmp9_, ___lambda7__gfunc, self);
	return self;
}

SniDBusMenuService*
sni_dbus_menu_service_new (SniMenuItem* root,
                           SniIndicatorActionGroup* action_group,
                           const gchar* icon_theme_path)
{
	return sni_dbus_menu_service_construct (SNI_TYPE_DBUS_MENU_SERVICE, root, action_group, icon_theme_path);
}

static inline SniMenuItem*
sni_dbus_menu_service_lookup_by_id (SniDBusMenuService* self,
                                    gint32 id)
{
	SniMenuItem* _tmp0_ = NULL;
	SniMenuItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (id >= ((gint32) 0)) {
		GHashTable* _tmp1_;
		gconstpointer _tmp2_;
		_tmp1_ = self->priv->menu_items_by_id;
		_tmp2_ = g_hash_table_lookup (_tmp1_, (gpointer) ((guintptr) id));
		_tmp0_ = (SniMenuItem*) _tmp2_;
	} else {
		_tmp0_ = NULL;
	}
	result = _tmp0_;
	return result;
}

static inline SniMenuItem*
sni_dbus_menu_service_lookup_by_name (SniDBusMenuService* self,
                                      const gchar* name)
{
	GHashTable* _tmp0_;
	gconstpointer _tmp1_;
	SniMenuItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = self->priv->menu_items_by_name;
	_tmp1_ = g_hash_table_lookup (_tmp0_, name);
	result = (SniMenuItem*) _tmp1_;
	return result;
}

SniMenuItem*
sni_dbus_menu_service_lookup_menu_item (SniDBusMenuService* self,
                                        const gchar* name)
{
	SniMenuItem* _tmp0_;
	SniMenuItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = sni_dbus_menu_service_lookup_by_name (self, name);
	result = _tmp0_;
	return result;
}

static Block8Data*
block8_data_ref (Block8Data* _data8_)
{
	g_atomic_int_inc (&_data8_->_ref_count_);
	return _data8_;
}

static void
block8_data_unref (void * _userdata_)
{
	Block8Data* _data8_;
	_data8_ = (Block8Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
		SniDBusMenuService* self;
		self = _data8_->self;
		_data8_->changed_ids = (g_free (_data8_->changed_ids), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block8Data, _data8_);
	}
}

static void
_vala_array_add9 (guint* * array,
                  gint* length,
                  gint* size,
                  guint value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (guint, *array, *size);
	}
	(*array)[(*length)++] = value;
}

static void
__lambda9_ (Block8Data* _data8_,
            SniMenuItem* menu_item)
{
	SniDBusMenuService* self;
	self = _data8_->self;
	g_return_if_fail (menu_item != NULL);
	if (menu_item->dirty_layout) {
		guint _tmp0_;
		guint _tmp1_;
		_tmp0_ = sni_menu_item_get_id (menu_item);
		_tmp1_ = _tmp0_;
		_vala_array_add9 (&_data8_->changed_ids, &_data8_->changed_ids_length1, &_data8_->_changed_ids_size_, _tmp1_);
		menu_item->dirty_layout = FALSE;
	}
}

static void
___lambda9__gfunc (gconstpointer data,
                   gpointer self)
{
	__lambda9_ (self, (SniMenuItem*) data);
}

void
sni_dbus_menu_service_emit_layout_updated (SniDBusMenuService* self)
{
	Block8Data* _data8_;
	SniMenuItem* _tmp0_;
	guint* _tmp1_;
	SniMenuItem* _tmp2_;
	guint* _tmp3_;
	gint _tmp3__length1;
	g_return_if_fail (self != NULL);
	_data8_ = g_slice_new0 (Block8Data);
	_data8_->_ref_count_ = 1;
	_data8_->self = g_object_ref (self);
	_tmp0_ = self->priv->root;
	if (_tmp0_ == NULL) {
		block8_data_unref (_data8_);
		_data8_ = NULL;
		return;
	}
	if (self->priv->layout_updated_idle_id != ((guint) 0)) {
		g_source_remove (self->priv->layout_updated_idle_id);
		self->priv->layout_updated_idle_id = (guint) 0;
	}
	_tmp1_ = g_new0 (guint, 0);
	_data8_->changed_ids = _tmp1_;
	_data8_->changed_ids_length1 = 0;
	_data8_->_changed_ids_size_ = _data8_->changed_ids_length1;
	_tmp2_ = self->priv->root;
	sni_menu_item_traverse (_tmp2_, ___lambda9__gfunc, _data8_);
	_tmp3_ = _data8_->changed_ids;
	_tmp3__length1 = _data8_->changed_ids_length1;
	if (_tmp3__length1 > 0) {
		guint32 _tmp4_;
		SniMenuItem* _tmp5_;
		guint _tmp6_;
		guint _tmp7_;
		_tmp4_ = self->priv->revision;
		self->priv->revision = _tmp4_ + 1;
		_tmp5_ = self->priv->root;
		_tmp6_ = sni_menu_item_get_id (_tmp5_);
		_tmp7_ = _tmp6_;
		g_signal_emit (self, sni_dbus_menu_service_signals[SNI_DBUS_MENU_SERVICE_LAYOUT_UPDATED_SIGNAL], 0, self->priv->revision, (gint32) _tmp7_);
	}
	block8_data_unref (_data8_);
	_data8_ = NULL;
}

static gboolean
__lambda8_ (SniDBusMenuService* self)
{
	SniMenuItem* _tmp0_;
	gboolean result;
	self->priv->layout_updated_idle_id = (guint) 0;
	_tmp0_ = self->priv->root;
	if (_tmp0_ != NULL) {
		SniMenuItem* _tmp1_;
		guint _tmp2_;
		guint _tmp3_;
		_tmp1_ = self->priv->root;
		_tmp2_ = sni_menu_item_get_id (_tmp1_);
		_tmp3_ = _tmp2_;
		g_signal_emit (self, sni_dbus_menu_service_signals[SNI_DBUS_MENU_SERVICE_LAYOUT_UPDATED_SIGNAL], 0, self->priv->revision, (gint32) _tmp3_);
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda8__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda8_ ((SniDBusMenuService*) self);
	return result;
}

static void
sni_dbus_menu_service_queue_layout_updated (SniDBusMenuService* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->layout_updated_idle_id != ((guint) 0)) {
		return;
	}
	self->priv->layout_updated_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda8__gsource_func, g_object_ref (self), g_object_unref);
}

static void
sni_dbus_menu_service_queue_items_properties_updated (SniDBusMenuService* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->layout_updated_idle_id != ((guint) 0)) {
		return;
	}
}

static Block9Data*
block9_data_ref (Block9Data* _data9_)
{
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}

static void
block9_data_unref (void * _userdata_)
{
	Block9Data* _data9_;
	_data9_ = (Block9Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		SniDBusMenuService* self;
		self = _data9_->self;
		_g_variant_builder_unref0 (_data9_->builder);
		_g_object_unref0 (self);
		g_slice_free (Block9Data, _data9_);
	}
}

static void
__lambda10_ (Block9Data* _data9_,
             SniMenuItem* menu_item)
{
	SniDBusMenuService* self;
	self = _data9_->self;
	g_return_if_fail (menu_item != NULL);
	if (menu_item->dirty_properties != 0U) {
		GVariantBuilder* _tmp0_;
		guint _tmp1_;
		guint _tmp2_;
		GVariant* _tmp3_;
		gint _tmp4_ = 0;
		SniMenuItemProperty* _tmp5_;
		SniMenuItemProperty* _tmp6_;
		gint _tmp6__length1;
		GVariant* _tmp7_;
		GVariant** _tmp8_;
		GVariant** _tmp9_;
		gint _tmp9__length1;
		GVariant* _tmp10_;
		GVariant* _tmp11_;
		_tmp0_ = _data9_->builder;
		_tmp1_ = sni_menu_item_get_id (menu_item);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_variant_new_int32 ((gint32) _tmp2_);
		g_variant_ref_sink (_tmp3_);
		_tmp5_ = sni_unpack_properties (menu_item->dirty_properties, &_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp6__length1 = _tmp4_;
		_tmp7_ = sni_menu_item_serialize_properties (menu_item, _tmp6_, (gint) _tmp4_);
		_tmp8_ = g_new0 (GVariant*, 2 + 1);
		_tmp8_[0] = _tmp3_;
		_tmp8_[1] = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp9__length1 = 2;
		_tmp10_ = g_variant_new_tuple (_tmp9_, 2);
		g_variant_ref_sink (_tmp10_);
		_tmp11_ = _tmp10_;
		g_variant_builder_add_value (_tmp0_, _tmp11_);
		_g_variant_unref0 (_tmp11_);
		_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) g_variant_unref), NULL);
		_tmp6_ = (g_free (_tmp6_), NULL);
		menu_item->dirty_properties = 0U;
		_data9_->changed = TRUE;
	}
}

static void
___lambda10__gfunc (gconstpointer data,
                    gpointer self)
{
	__lambda10_ (self, (SniMenuItem*) data);
}

static void
sni_dbus_menu_service_emit_items_properties_updated (SniDBusMenuService* self)
{
	Block9Data* _data9_;
	SniMenuItem* _tmp0_;
	GVariantType* _tmp1_;
	GVariantType* _tmp2_;
	GVariantBuilder* _tmp3_;
	GVariantBuilder* _tmp4_;
	SniMenuItem* _tmp5_;
	g_return_if_fail (self != NULL);
	_data9_ = g_slice_new0 (Block9Data);
	_data9_->_ref_count_ = 1;
	_data9_->self = g_object_ref (self);
	_tmp0_ = self->priv->root;
	if (_tmp0_ == NULL) {
		block9_data_unref (_data9_);
		_data9_ = NULL;
		return;
	}
	if (self->priv->items_properties_updated_idle_id != ((guint) 0)) {
		g_source_remove (self->priv->items_properties_updated_idle_id);
		self->priv->items_properties_updated_idle_id = (guint) 0;
	}
	_tmp1_ = g_variant_type_new ("a(ia{sv})");
	_tmp2_ = _tmp1_;
	_tmp3_ = g_variant_builder_new (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_variant_type_free0 (_tmp2_);
	_data9_->builder = _tmp4_;
	_data9_->changed = FALSE;
	_tmp5_ = self->priv->root;
	sni_menu_item_traverse (_tmp5_, ___lambda10__gfunc, _data9_);
	if (_data9_->changed) {
		GVariantBuilder* _tmp6_;
		GVariant* _tmp7_;
		GVariant* _tmp8_;
		GVariantType* _tmp9_;
		GVariantType* _tmp10_;
		GVariant** _tmp11_;
		GVariant** _tmp12_;
		gint _tmp12__length1;
		GVariant* _tmp13_;
		GVariant* _tmp14_;
		_tmp6_ = _data9_->builder;
		_tmp7_ = g_variant_builder_end (_tmp6_);
		g_variant_ref_sink (_tmp7_);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_variant_type_new ("(ias)");
		_tmp10_ = _tmp9_;
		_tmp11_ = g_new0 (GVariant*, 0 + 1);
		_tmp12_ = _tmp11_;
		_tmp12__length1 = 0;
		_tmp13_ = g_variant_new_array (_tmp10_, _tmp12_, 0);
		g_variant_ref_sink (_tmp13_);
		_tmp14_ = _tmp13_;
		g_signal_emit (self, sni_dbus_menu_service_signals[SNI_DBUS_MENU_SERVICE_ITEMS_PROPERTIES_UPDATED_SIGNAL], 0, _tmp8_, _tmp14_);
		_g_variant_unref0 (_tmp14_);
		_tmp12_ = (_vala_array_free (_tmp12_, _tmp12__length1, (GDestroyNotify) g_variant_unref), NULL);
		_g_variant_type_free0 (_tmp10_);
		_g_variant_unref0 (_tmp8_);
	}
	block9_data_unref (_data9_);
	_data9_ = NULL;
}

void
sni_dbus_menu_service_emit_updates (SniDBusMenuService* self)
{
	g_return_if_fail (self != NULL);
	sni_dbus_menu_service_emit_layout_updated (self);
	sni_dbus_menu_service_emit_items_properties_updated (self);
}

static void
sni_dbus_menu_service_on_child_added (SniDBusMenuService* self,
                                      SniMenuItem* menu_item,
                                      SniMenuItem* child)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (menu_item != NULL);
	g_return_if_fail (child != NULL);
	sni_menu_item_mark_dirty_layout (menu_item);
	sni_menu_item_mark_dirty_property (menu_item, SNI_MENU_ITEM_PROPERTY_CHILDREN_DISPLAY);
	sni_dbus_menu_service_queue_layout_updated (self);
	g_signal_connect_object (child, "child-added", (GCallback) _sni_dbus_menu_service_on_child_added_sni_menu_item_child_added, self, 0);
	g_signal_connect_object (child, "child-added", (GCallback) _sni_dbus_menu_service_on_child_removed_sni_menu_item_child_added, self, 0);
}

static void
_sni_dbus_menu_service_on_child_removed_sni_menu_item_child_removed (SniMenuItem* _sender,
                                                                     SniMenuItem* child,
                                                                     gpointer self)
{
	sni_dbus_menu_service_on_child_removed ((SniDBusMenuService*) self, _sender, child);
}

static void
sni_dbus_menu_service_on_child_removed (SniDBusMenuService* self,
                                        SniMenuItem* menu_item,
                                        SniMenuItem* child)
{
	guint _tmp0_;
	guint _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (menu_item != NULL);
	g_return_if_fail (child != NULL);
	sni_menu_item_mark_dirty_layout (menu_item);
	sni_menu_item_mark_dirty_property (menu_item, SNI_MENU_ITEM_PROPERTY_CHILDREN_DISPLAY);
	sni_dbus_menu_service_queue_layout_updated (self);
	g_signal_parse_name ("child-added", SNI_TYPE_MENU_ITEM, &_tmp0_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (child, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _sni_dbus_menu_service_on_child_added_sni_menu_item_child_added, self);
	g_signal_parse_name ("child-removed", SNI_TYPE_MENU_ITEM, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (child, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _sni_dbus_menu_service_on_child_removed_sni_menu_item_child_removed, self);
}

static void
sni_dbus_menu_service_on_changed (SniDBusMenuService* self,
                                  SniMenuItem* menu_item,
                                  SniMenuItemProperty property)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (menu_item != NULL);
	sni_menu_item_mark_dirty_property (menu_item, property);
	sni_dbus_menu_service_queue_items_properties_updated (self);
}

static void
sni_dbus_menu_service_handle_event (SniDBusMenuService* self,
                                    gint32 id,
                                    const gchar* event_name,
                                    GVariant* data,
                                    guint32 timestamp,
                                    GError** error)
{
	SniMenuItem* menu_item = NULL;
	SniMenuItem* _tmp0_;
	SniMenuItem* _tmp1_;
	SniIndicatorActionGroup* _tmp3_;
	SniMenuItem* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	SniMenuItem* _tmp7_;
	GVariant* _tmp8_;
	GVariant* _tmp9_;
	const gchar* _tmp10_;
	GVariant* _tmp11_;
	GVariant* _tmp12_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (event_name != NULL);
	g_return_if_fail (data != NULL);
	if (g_strcmp0 (event_name, "clicked") != 0) {
		return;
	}
	_tmp0_ = sni_dbus_menu_service_lookup_by_id (self, id);
	menu_item = _tmp0_;
	_tmp1_ = menu_item;
	if (_tmp1_ == NULL) {
		GError* _tmp2_;
		_tmp2_ = g_error_new_literal (G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "Unknown id");
		_inner_error0_ = _tmp2_;
		if (_inner_error0_->domain == G_DBUS_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp3_ = self->priv->action_group;
	_tmp4_ = menu_item;
	_tmp5_ = sni_menu_item_get_action_name (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = menu_item;
	_tmp8_ = sni_menu_item_get_action_target (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = self->activation_token;
	_tmp11_ = sni_build_platform_data (_tmp10_);
	_tmp12_ = _tmp11_;
	g_remote_action_group_activate_action_full ((GRemoteActionGroup*) _tmp3_, _tmp6_, _tmp9_, _tmp12_);
	_g_variant_unref0 (_tmp12_);
}

void
sni_dbus_menu_service_get_layout (SniDBusMenuService* self,
                                  gint32 parent_id,
                                  gint32 recursion_depth,
                                  gchar** property_names,
                                  gint property_names_length1,
                                  guint32* revision,
                                  GVariant** layout,
                                  GError** error)
{
	guint32 _vala_revision = 0U;
	GVariant* _vala_layout = NULL;
	SniMenuItem* parent = NULL;
	SniMenuItem* _tmp0_;
	SniMenuItem* _tmp1_;
	SniMenuItem* _tmp3_;
	gint _tmp4_ = 0;
	SniMenuItemProperty* _tmp5_;
	SniMenuItemProperty* _tmp6_;
	gint _tmp6__length1;
	GVariant* _tmp7_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = sni_dbus_menu_service_lookup_by_id (self, parent_id);
	parent = _tmp0_;
	_tmp1_ = parent;
	if (_tmp1_ == NULL) {
		GError* _tmp2_;
		_tmp2_ = g_error_new_literal (G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "Unknown parent id");
		_inner_error0_ = _tmp2_;
		if ((_inner_error0_->domain == G_DBUS_ERROR) || (_inner_error0_->domain == G_IO_ERROR)) {
			g_propagate_error (error, _inner_error0_);
			_g_variant_unref0 (_vala_layout);
			return;
		} else {
			_g_variant_unref0 (_vala_layout);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_vala_revision = self->priv->revision;
	_tmp3_ = parent;
	_tmp5_ = sni_menu_item_property_from_strv (property_names, (gint) property_names_length1, &_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp6__length1 = _tmp4_;
	_tmp7_ = sni_serialize_layout (_tmp3_, _tmp6_, (gint) _tmp4_, (gint) recursion_depth);
	_g_variant_unref0 (_vala_layout);
	_vala_layout = _tmp7_;
	_tmp6_ = (g_free (_tmp6_), NULL);
	if (revision) {
		*revision = _vala_revision;
	}
	if (layout) {
		*layout = _vala_layout;
	} else {
		_g_variant_unref0 (_vala_layout);
	}
}

GVariant*
sni_dbus_menu_service_get_property_ (SniDBusMenuService* self,
                                     gint32 id,
                                     const gchar* name,
                                     GError** error)
{
	SniMenuItem* menu_item = NULL;
	SniMenuItem* _tmp0_;
	SniMenuItem* _tmp1_;
	SniMenuItemProperty property = 0;
	GVariant* value = NULL;
	SniMenuItem* _tmp3_;
	GVariant* _tmp4_;
	GVariant* _tmp5_;
	GVariant* _tmp7_;
	GVariant* _tmp8_;
	GError* _inner_error0_ = NULL;
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = sni_dbus_menu_service_lookup_by_id (self, id);
	menu_item = _tmp0_;
	_tmp1_ = menu_item;
	if (_tmp1_ == NULL) {
		GError* _tmp2_;
		_tmp2_ = g_error_new_literal (G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "Unknown menu item id");
		_inner_error0_ = _tmp2_;
		if ((_inner_error0_->domain == G_DBUS_ERROR) || (_inner_error0_->domain == G_IO_ERROR)) {
			g_propagate_error (error, _inner_error0_);
			return NULL;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	property = sni_menu_item_property_from_string (name);
	_tmp3_ = menu_item;
	_tmp4_ = sni_menu_item_serialize_property (_tmp3_, property);
	value = _tmp4_;
	_tmp5_ = value;
	if (_tmp5_ == NULL) {
		GError* _tmp6_;
		_tmp6_ = g_error_new_literal (G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "Unknown property");
		_inner_error0_ = _tmp6_;
		if ((_inner_error0_->domain == G_DBUS_ERROR) || (_inner_error0_->domain == G_IO_ERROR)) {
			g_propagate_error (error, _inner_error0_);
			_g_variant_unref0 (value);
			return NULL;
		} else {
			_g_variant_unref0 (value);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp7_ = value;
	_tmp8_ = g_variant_new_variant (_tmp7_);
	g_variant_ref_sink (_tmp8_);
	result = _tmp8_;
	_g_variant_unref0 (value);
	return result;
}

GVariant*
sni_dbus_menu_service_get_group_properties (SniDBusMenuService* self,
                                            gint32* ids,
                                            gint ids_length1,
                                            gchar** property_names,
                                            gint property_names_length1,
                                            GError** error)
{
	SniMenuItemProperty* properties = NULL;
	gint _tmp0_ = 0;
	SniMenuItemProperty* _tmp1_;
	gint properties_length1;
	gint _properties_size_;
	GVariantBuilder* builder = NULL;
	GVariantType* _tmp2_;
	GVariantType* _tmp3_;
	GVariantBuilder* _tmp4_;
	GVariantBuilder* _tmp5_;
	GVariantBuilder* _tmp29_;
	GVariant* _tmp30_;
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = sni_menu_item_property_from_strv (property_names, (gint) property_names_length1, &_tmp0_);
	properties = _tmp1_;
	properties_length1 = _tmp0_;
	_properties_size_ = properties_length1;
	_tmp2_ = g_variant_type_new ("a(ia{sv})");
	_tmp3_ = _tmp2_;
	_tmp4_ = g_variant_builder_new (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_variant_type_free0 (_tmp3_);
	builder = _tmp5_;
	{
		gint32* id_collection = NULL;
		gint id_collection_length1 = 0;
		gint _id_collection_size_ = 0;
		gint id_it = 0;
		id_collection = ids;
		id_collection_length1 = ids_length1;
		for (id_it = 0; id_it < id_collection_length1; id_it = id_it + 1) {
			gint32 id = 0;
			id = id_collection[id_it];
			{
				SniMenuItem* menu_item = NULL;
				SniMenuItem* _tmp6_;
				SniMenuItem* _tmp7_;
				SniMenuItem* _tmp8_;
				GVariant* data = NULL;
				SniMenuItem* _tmp9_;
				SniMenuItem* _tmp10_;
				SniMenuItemProperty* _tmp11_;
				gint _tmp11__length1;
				gint _tmp12_ = 0;
				SniMenuItemProperty* _tmp13_;
				SniMenuItemProperty* _tmp14_;
				gint _tmp14__length1;
				GVariant* _tmp15_;
				GVariant* _tmp16_;
				GVariant* _tmp17_;
				GVariantBuilder* _tmp18_;
				SniMenuItem* _tmp19_;
				guint _tmp20_;
				guint _tmp21_;
				GVariant* _tmp22_;
				GVariant* _tmp23_;
				GVariant* _tmp24_;
				GVariant** _tmp25_;
				GVariant** _tmp26_;
				gint _tmp26__length1;
				GVariant* _tmp27_;
				GVariant* _tmp28_;
				_tmp6_ = sni_dbus_menu_service_lookup_by_id (self, id);
				_tmp7_ = _g_object_ref0 (_tmp6_);
				menu_item = _tmp7_;
				_tmp8_ = menu_item;
				if (_tmp8_ == NULL) {
					_g_object_unref0 (menu_item);
					continue;
				}
				_tmp9_ = menu_item;
				_tmp10_ = menu_item;
				_tmp11_ = properties;
				_tmp11__length1 = properties_length1;
				_tmp13_ = sni_filter_properties (_tmp10_, _tmp11_, (gint) _tmp11__length1, &_tmp12_);
				_tmp14_ = _tmp13_;
				_tmp14__length1 = _tmp12_;
				_tmp15_ = sni_menu_item_serialize_properties (_tmp9_, _tmp14_, (gint) _tmp12_);
				_tmp16_ = _tmp15_;
				_tmp14_ = (g_free (_tmp14_), NULL);
				data = _tmp16_;
				_tmp17_ = data;
				if (_tmp17_ == NULL) {
					_g_variant_unref0 (data);
					_g_object_unref0 (menu_item);
					continue;
				}
				_tmp18_ = builder;
				_tmp19_ = menu_item;
				_tmp20_ = sni_menu_item_get_id (_tmp19_);
				_tmp21_ = _tmp20_;
				_tmp22_ = g_variant_new_int32 ((gint32) _tmp21_);
				g_variant_ref_sink (_tmp22_);
				_tmp23_ = data;
				_tmp24_ = _g_variant_ref0 (_tmp23_);
				_tmp25_ = g_new0 (GVariant*, 2 + 1);
				_tmp25_[0] = _tmp22_;
				_tmp25_[1] = _tmp24_;
				_tmp26_ = _tmp25_;
				_tmp26__length1 = 2;
				_tmp27_ = g_variant_new_tuple (_tmp26_, 2);
				g_variant_ref_sink (_tmp27_);
				_tmp28_ = _tmp27_;
				g_variant_builder_add_value (_tmp18_, _tmp28_);
				_g_variant_unref0 (_tmp28_);
				_tmp26_ = (_vala_array_free (_tmp26_, _tmp26__length1, (GDestroyNotify) g_variant_unref), NULL);
				_g_variant_unref0 (data);
				_g_object_unref0 (menu_item);
			}
		}
	}
	_tmp29_ = builder;
	_tmp30_ = g_variant_builder_end (_tmp29_);
	g_variant_ref_sink (_tmp30_);
	result = _tmp30_;
	_g_variant_builder_unref0 (builder);
	properties = (g_free (properties), NULL);
	return result;
}

void
sni_dbus_menu_service_event (SniDBusMenuService* self,
                             gint32 id,
                             const gchar* event_id,
                             GVariant* data,
                             guint32 timestamp,
                             GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (event_id != NULL);
	g_return_if_fail (data != NULL);
	sni_dbus_menu_service_handle_event (self, id, event_id, data, timestamp, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if ((_inner_error0_->domain == G_DBUS_ERROR) || (_inner_error0_->domain == G_IO_ERROR)) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

gint32*
sni_dbus_menu_service_event_group (SniDBusMenuService* self,
                                   GVariant* events,
                                   gint* result_length1,
                                   GError** error)
{
	gint32 id = 0;
	gchar* event_id = NULL;
	GVariant* data = NULL;
	guint32 timestamp = 0U;
	gsize n = 0UL;
	gint32* _tmp10_;
	gint32* _tmp11_;
	gint _tmp11__length1;
	GError* _inner_error0_ = NULL;
	gint32* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (events != NULL, NULL);
	n = g_variant_n_children (events);
	{
		gint index = 0;
		index = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GVariant* event = NULL;
				GVariant* _tmp2_;
				GVariant* _tmp3_;
				gint32 _tmp4_ = 0;
				gchar* _tmp5_ = NULL;
				GVariant* _tmp6_ = NULL;
				guint32 _tmp7_ = 0U;
				const gchar* _tmp8_;
				GVariant* _tmp9_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = index;
					index = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(((gsize) index) < n)) {
					break;
				}
				_tmp2_ = g_variant_get_child_value (events, (gsize) index);
				event = _tmp2_;
				_tmp3_ = event;
				g_variant_get (_tmp3_, "(isvu)", &_tmp4_, &_tmp5_, &_tmp6_, &_tmp7_, NULL);
				id = _tmp4_;
				_g_free0 (event_id);
				event_id = _tmp5_;
				_g_variant_unref0 (data);
				data = _tmp6_;
				timestamp = _tmp7_;
				_tmp8_ = event_id;
				_tmp9_ = data;
				sni_dbus_menu_service_handle_event (self, id, _tmp8_, _tmp9_, timestamp, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if ((_inner_error0_->domain == G_DBUS_ERROR) || (_inner_error0_->domain == G_IO_ERROR)) {
						g_propagate_error (error, _inner_error0_);
						_g_variant_unref0 (event);
						_g_variant_unref0 (data);
						_g_free0 (event_id);
						return NULL;
					} else {
						_g_variant_unref0 (event);
						_g_variant_unref0 (data);
						_g_free0 (event_id);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return NULL;
					}
				}
				_g_variant_unref0 (event);
			}
		}
	}
	_tmp10_ = g_new0 (gint32, 0);
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 0;
	if (result_length1) {
		*result_length1 = _tmp11__length1;
	}
	result = _tmp11_;
	_g_variant_unref0 (data);
	_g_free0 (event_id);
	return result;
}

gboolean
sni_dbus_menu_service_about_to_show (SniDBusMenuService* self,
                                     gint32 id,
                                     GError** error)
{
	SniMenuItem* menu_item = NULL;
	SniMenuItem* _tmp0_;
	gboolean _tmp1_ = FALSE;
	SniMenuItem* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = sni_dbus_menu_service_lookup_by_id (self, id);
	menu_item = _tmp0_;
	_tmp2_ = menu_item;
	if (_tmp2_ != NULL) {
		SniMenuItem* _tmp3_;
		_tmp3_ = menu_item;
		_tmp1_ = sni_menu_item_needs_update (_tmp3_);
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	return result;
}

void
sni_dbus_menu_service_about_to_show_group (SniDBusMenuService* self,
                                           gint32* ids,
                                           gint ids_length1,
                                           gint32** updates_needed,
                                           gint* updates_needed_length1,
                                           gint32** id_errors,
                                           gint* id_errors_length1,
                                           GError** error)
{
	gint32* _vala_updates_needed = NULL;
	gint _vala_updates_needed_length1 = 0;
	gint32* _vala_id_errors = NULL;
	gint _vala_id_errors_length1 = 0;
	gint32* _tmp0_;
	gint32* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_new0 (gint32, ids_length1);
	_vala_updates_needed = (g_free (_vala_updates_needed), NULL);
	_vala_updates_needed = _tmp0_;
	_vala_updates_needed_length1 = ids_length1;
	_tmp1_ = g_new0 (gint32, ids_length1);
	_vala_id_errors = (g_free (_vala_id_errors), NULL);
	_vala_id_errors = _tmp1_;
	_vala_id_errors_length1 = ids_length1;
	{
		gint index = 0;
		index = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				SniMenuItem* menu_item = NULL;
				gint32 _tmp5_;
				SniMenuItem* _tmp6_;
				gboolean _tmp7_ = FALSE;
				SniMenuItem* _tmp8_;
				gint32* _tmp10_;
				gint _tmp10__length1;
				gint32* _tmp11_;
				gint _tmp11__length1;
				SniMenuItem* _tmp12_;
				if (!_tmp2_) {
					gint _tmp3_;
					gint _tmp4_;
					_tmp3_ = index;
					_tmp4_ = index;
					index = _tmp4_ + 1;
				}
				_tmp2_ = FALSE;
				if (!(index < ids_length1)) {
					break;
				}
				_tmp5_ = ids[index];
				_tmp6_ = sni_dbus_menu_service_lookup_by_id (self, _tmp5_);
				menu_item = _tmp6_;
				_tmp8_ = menu_item;
				if (_tmp8_ != NULL) {
					SniMenuItem* _tmp9_;
					_tmp9_ = menu_item;
					_tmp7_ = sni_menu_item_needs_update (_tmp9_);
				} else {
					_tmp7_ = FALSE;
				}
				_tmp10_ = _vala_updates_needed;
				_tmp10__length1 = _vala_updates_needed_length1;
				_tmp10_[index] = (gint32) _tmp7_;
				_tmp11_ = _vala_id_errors;
				_tmp11__length1 = _vala_id_errors_length1;
				_tmp12_ = menu_item;
				_tmp11_[index] = (gint32) (_tmp12_ == NULL);
			}
		}
	}
	if (updates_needed) {
		*updates_needed = _vala_updates_needed;
	} else {
		_vala_updates_needed = (g_free (_vala_updates_needed), NULL);
	}
	if (updates_needed_length1) {
		*updates_needed_length1 = _vala_updates_needed_length1;
	}
	if (id_errors) {
		*id_errors = _vala_id_errors;
	} else {
		_vala_id_errors = (g_free (_vala_id_errors), NULL);
	}
	if (id_errors_length1) {
		*id_errors_length1 = _vala_id_errors_length1;
	}
}

static void
sni_dbus_menu_service_real_dispose (GObject* base)
{
	SniDBusMenuService * self;
	self = (SniDBusMenuService*) base;
	if (self->priv->layout_updated_idle_id != ((guint) 0)) {
		g_source_remove (self->priv->layout_updated_idle_id);
		self->priv->layout_updated_idle_id = (guint) 0;
	}
	if (self->priv->items_properties_updated_idle_id != ((guint) 0)) {
		g_source_remove (self->priv->items_properties_updated_idle_id);
		self->priv->items_properties_updated_idle_id = (guint) 0;
	}
	_g_hash_table_unref0 (self->priv->menu_items_by_id);
	self->priv->menu_items_by_id = NULL;
	_g_hash_table_unref0 (self->priv->menu_items_by_name);
	self->priv->menu_items_by_name = NULL;
	G_OBJECT_CLASS (sni_dbus_menu_service_parent_class)->dispose (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject));
}

guint32
sni_dbus_menu_service_get_version (SniDBusMenuService* self)
{
	guint32 result;
	g_return_val_if_fail (self != NULL, 0U);
	result = (guint32) 4U;
	return result;
}

gchar*
sni_dbus_menu_service_get_status (SniDBusMenuService* self)
{
	gchar* result;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("normal");
	result = _tmp0_;
	return result;
}

gchar**
sni_dbus_menu_service_get_icon_theme_path (SniDBusMenuService* self,
                                           gint* result_length1)
{
	gchar** result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon_theme_path;
	_tmp1_ = g_strdup (_tmp0_);
	_tmp2_ = g_new0 (gchar*, 1 + 1);
	_tmp2_[0] = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp3__length1 = 1;
	if (result_length1) {
		*result_length1 = _tmp3__length1;
	}
	result = _tmp3_;
	return result;
}

gchar*
sni_dbus_menu_service_get_text_direction (SniDBusMenuService* self)
{
	gchar* result;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) {
		_tmp0_ = "rtl";
	} else {
		_tmp0_ = "ltr";
	}
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
g_cclosure_user_marshal_VOID__VARIANT_VARIANT (GClosure * closure,
                                               GValue * return_value,
                                               guint n_param_values,
                                               const GValue * param_values,
                                               gpointer invocation_hint,
                                               gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__VARIANT_VARIANT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__VARIANT_VARIANT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__VARIANT_VARIANT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_variant (param_values + 1), g_value_get_variant (param_values + 2), data2);
}

static void
g_cclosure_user_marshal_VOID__UINT_INT (GClosure * closure,
                                        GValue * return_value,
                                        guint n_param_values,
                                        const GValue * param_values,
                                        gpointer invocation_hint,
                                        gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__UINT_INT) (gpointer data1, guint32 arg_1, gint32 arg_2, gpointer data2);
	register GMarshalFunc_VOID__UINT_INT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__UINT_INT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_uint (param_values + 1), g_value_get_int (param_values + 2), data2);
}

static void
g_cclosure_user_marshal_VOID__INT_UINT (GClosure * closure,
                                        GValue * return_value,
                                        guint n_param_values,
                                        const GValue * param_values,
                                        gpointer invocation_hint,
                                        gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__INT_UINT) (gpointer data1, gint32 arg_1, guint32 arg_2, gpointer data2);
	register GMarshalFunc_VOID__INT_UINT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__INT_UINT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_int (param_values + 1), g_value_get_uint (param_values + 2), data2);
}

static void
sni_dbus_menu_service_class_init (SniDBusMenuServiceClass * klass,
                                  gpointer klass_data)
{
	sni_dbus_menu_service_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SniDBusMenuService_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) sni_dbus_menu_service_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_sni_dbus_menu_service_get_property;
	G_OBJECT_CLASS (klass)->finalize = sni_dbus_menu_service_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_DBUS_MENU_SERVICE_VERSION_PROPERTY, sni_dbus_menu_service_properties[SNI_DBUS_MENU_SERVICE_VERSION_PROPERTY] = g_param_spec_uint ("version", "version", "version", 0, G_MAXUINT, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_DBUS_MENU_SERVICE_STATUS_PROPERTY, sni_dbus_menu_service_properties[SNI_DBUS_MENU_SERVICE_STATUS_PROPERTY] = g_param_spec_string ("status", "status", "status", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_DBUS_MENU_SERVICE_ICON_THEME_PATH_PROPERTY, sni_dbus_menu_service_properties[SNI_DBUS_MENU_SERVICE_ICON_THEME_PATH_PROPERTY] = g_param_spec_boxed ("icon-theme-path", "icon-theme-path", "icon-theme-path", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SNI_DBUS_MENU_SERVICE_TEXT_DIRECTION_PROPERTY, sni_dbus_menu_service_properties[SNI_DBUS_MENU_SERVICE_TEXT_DIRECTION_PROPERTY] = g_param_spec_string ("text-direction", "text-direction", "text-direction", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	         * Triggered when there are property updates across many items.
	         */
	sni_dbus_menu_service_signals[SNI_DBUS_MENU_SERVICE_ITEMS_PROPERTIES_UPDATED_SIGNAL] = g_signal_new ("items-properties-updated", SNI_TYPE_DBUS_MENU_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__VARIANT_VARIANT, G_TYPE_NONE, 2, G_TYPE_VARIANT, G_TYPE_VARIANT);
	/**
	         * Triggered by app, notify client to update the menu.
	         *
	         * Passing current `revision` as the client may already have the latest update.
	         */
	sni_dbus_menu_service_signals[SNI_DBUS_MENU_SERVICE_LAYOUT_UPDATED_SIGNAL] = g_signal_new ("layout-updated", SNI_TYPE_DBUS_MENU_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__UINT_INT, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_INT);
	/**
	         * Triggered by app, requesting to open the menu.
	         */
	sni_dbus_menu_service_signals[SNI_DBUS_MENU_SERVICE_ITEM_ACTIVATION_REQUESTED_SIGNAL] = g_signal_new ("item-activation-requested", SNI_TYPE_DBUS_MENU_SERVICE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT_UINT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_UINT);
}

static void
sni_dbus_menu_service_instance_init (SniDBusMenuService * self,
                                     gpointer klass)
{
	gchar* _tmp0_;
	self->priv = sni_dbus_menu_service_get_instance_private (self);
	self->priv->_icon_theme_path = NULL;
	self->priv->action_group = NULL;
	self->priv->root = NULL;
	self->priv->revision = (guint32) 1U;
	self->priv->layout_updated_idle_id = (guint) 0;
	self->priv->items_properties_updated_idle_id = (guint) 0;
	_tmp0_ = g_strdup ("");
	self->activation_token = _tmp0_;
}

static void
sni_dbus_menu_service_finalize (GObject * obj)
{
	SniDBusMenuService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SNI_TYPE_DBUS_MENU_SERVICE, SniDBusMenuService);
	_g_free0 (self->priv->_icon_theme_path);
	_g_object_unref0 (self->priv->action_group);
	_g_object_unref0 (self->priv->root);
	_g_hash_table_unref0 (self->priv->menu_items_by_id);
	_g_hash_table_unref0 (self->priv->menu_items_by_name);
	_g_free0 (self->activation_token);
	G_OBJECT_CLASS (sni_dbus_menu_service_parent_class)->finalize (obj);
}

/**
     * A D-Bus service for exporting an indicator menu.
     *
     * Menu structure should be static.
     *
     * https://github.com/gnustep/libs-dbuskit/blob/master/Bundles/DBusMenu/com.canonical.dbusmenu.xml
     */
GType
sni_dbus_menu_service_get_type (void)
{
	return sni_dbus_menu_service_type_id;
}

GType
sni_dbus_menu_service_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (SniDBusMenuServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sni_dbus_menu_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SniDBusMenuService), 0, (GInstanceInitFunc) sni_dbus_menu_service_instance_init, NULL };
	sni_dbus_menu_service_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "SniDBusMenuService", &g_define_type_info, 0);
	g_type_set_qdata (sni_dbus_menu_service_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) sni_dbus_menu_service_register_object);
	SniDBusMenuService_private_offset = sizeof (SniDBusMenuServicePrivate);
	return sni_dbus_menu_service_type_id;
}

static void
_vala_sni_dbus_menu_service_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	SniDBusMenuService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SNI_TYPE_DBUS_MENU_SERVICE, SniDBusMenuService);
	switch (property_id) {
		case SNI_DBUS_MENU_SERVICE_VERSION_PROPERTY:
		g_value_set_uint (value, sni_dbus_menu_service_get_version (self));
		break;
		case SNI_DBUS_MENU_SERVICE_STATUS_PROPERTY:
		g_value_take_string (value, sni_dbus_menu_service_get_status (self));
		break;
		case SNI_DBUS_MENU_SERVICE_ICON_THEME_PATH_PROPERTY:
		{
			int length;
			g_value_take_boxed (value, sni_dbus_menu_service_get_icon_theme_path (self, &length));
		}
		break;
		case SNI_DBUS_MENU_SERVICE_TEXT_DIRECTION_PROPERTY:
		g_value_take_string (value, sni_dbus_menu_service_get_text_direction (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_dbus_sni_dbus_menu_service_get_layout (SniDBusMenuService* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint32 parent_id = 0;
	GVariant* _tmp12_;
	gint32 recursion_depth = 0;
	GVariant* _tmp13_;
	gchar** property_names = NULL;
	gint property_names_length1 = 0;
	GVariant* _tmp14_;
	gchar** _tmp15_;
	gint _tmp15__length;
	gint _tmp15__size;
	gint _tmp15__length1;
	GVariantIter _tmp16_;
	GVariant* _tmp17_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	guint32 revision = 0U;
	GVariant* layout = NULL;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp12_ = g_variant_iter_next_value (&_arguments_iter);
	parent_id = g_variant_get_int32 (_tmp12_);
	g_variant_unref (_tmp12_);
	_tmp13_ = g_variant_iter_next_value (&_arguments_iter);
	recursion_depth = g_variant_get_int32 (_tmp13_);
	g_variant_unref (_tmp13_);
	_tmp14_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp15_ = g_new (gchar*, 5);
	_tmp15__length = 0;
	_tmp15__size = 4;
	_tmp15__length1 = 0;
	g_variant_iter_init (&_tmp16_, _tmp14_);
	for (; (_tmp17_ = g_variant_iter_next_value (&_tmp16_)) != NULL; _tmp15__length1++) {
		if (_tmp15__size == _tmp15__length) {
			_tmp15__size = 2 * _tmp15__size;
			_tmp15_ = g_renew (gchar*, _tmp15_, _tmp15__size + 1);
		}
		_tmp15_[_tmp15__length++] = g_variant_dup_string (_tmp17_, NULL);
		g_variant_unref (_tmp17_);
	}
	property_names_length1 = _tmp15__length1;
	_tmp15_[_tmp15__length] = NULL;
	property_names = _tmp15_;
	g_variant_unref (_tmp14_);
	sni_dbus_menu_service_get_layout (self, parent_id, recursion_depth, property_names, property_names_length1, &revision, &layout, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_uint32 (revision));
	g_variant_builder_add_value (&_reply_builder, layout);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	property_names = (_vala_array_free (property_names, property_names_length1, (GDestroyNotify) g_free), NULL);
	_g_variant_unref0 (layout);
	;
}

static void
_dbus_sni_dbus_menu_service_get_property_ (SniDBusMenuService* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint32 id = 0;
	GVariant* _tmp18_;
	gchar* name = NULL;
	GVariant* _tmp19_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp18_ = g_variant_iter_next_value (&_arguments_iter);
	id = g_variant_get_int32 (_tmp18_);
	g_variant_unref (_tmp18_);
	_tmp19_ = g_variant_iter_next_value (&_arguments_iter);
	name = g_variant_dup_string (_tmp19_, NULL);
	g_variant_unref (_tmp19_);
	result = sni_dbus_menu_service_get_property_ (self, id, name, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, result);
	_g_variant_unref0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (name);
	;
}

static void
_dbus_sni_dbus_menu_service_get_group_properties (SniDBusMenuService* self,
                                                  GVariant* _parameters_,
                                                  GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint32* ids = NULL;
	gint ids_length1 = 0;
	GVariant* _tmp20_;
	gint32* _tmp21_;
	gint _tmp21__length;
	gint _tmp21__size;
	gint _tmp21__length1;
	GVariantIter _tmp22_;
	GVariant* _tmp23_;
	gchar** property_names = NULL;
	gint property_names_length1 = 0;
	GVariant* _tmp24_;
	gchar** _tmp25_;
	gint _tmp25__length;
	gint _tmp25__size;
	gint _tmp25__length1;
	GVariantIter _tmp26_;
	GVariant* _tmp27_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	GVariant* result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp20_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp21_ = g_new (gint32, 5);
	_tmp21__length = 0;
	_tmp21__size = 4;
	_tmp21__length1 = 0;
	g_variant_iter_init (&_tmp22_, _tmp20_);
	for (; (_tmp23_ = g_variant_iter_next_value (&_tmp22_)) != NULL; _tmp21__length1++) {
		if (_tmp21__size == _tmp21__length) {
			_tmp21__size = 2 * _tmp21__size;
			_tmp21_ = g_renew (gint32, _tmp21_, _tmp21__size + 1);
		}
		_tmp21_[_tmp21__length++] = g_variant_get_int32 (_tmp23_);
		g_variant_unref (_tmp23_);
	}
	ids_length1 = _tmp21__length1;
	ids = _tmp21_;
	g_variant_unref (_tmp20_);
	_tmp24_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp25_ = g_new (gchar*, 5);
	_tmp25__length = 0;
	_tmp25__size = 4;
	_tmp25__length1 = 0;
	g_variant_iter_init (&_tmp26_, _tmp24_);
	for (; (_tmp27_ = g_variant_iter_next_value (&_tmp26_)) != NULL; _tmp25__length1++) {
		if (_tmp25__size == _tmp25__length) {
			_tmp25__size = 2 * _tmp25__size;
			_tmp25_ = g_renew (gchar*, _tmp25_, _tmp25__size + 1);
		}
		_tmp25_[_tmp25__length++] = g_variant_dup_string (_tmp27_, NULL);
		g_variant_unref (_tmp27_);
	}
	property_names_length1 = _tmp25__length1;
	_tmp25_[_tmp25__length] = NULL;
	property_names = _tmp25_;
	g_variant_unref (_tmp24_);
	result = sni_dbus_menu_service_get_group_properties (self, ids, ids_length1, property_names, property_names_length1, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, result);
	_g_variant_unref0 (result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	ids = (g_free (ids), NULL);
	property_names = (_vala_array_free (property_names, property_names_length1, (GDestroyNotify) g_free), NULL);
	;
}

static void
_dbus_sni_dbus_menu_service_event (SniDBusMenuService* self,
                                   GVariant* _parameters_,
                                   GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint32 id = 0;
	GVariant* _tmp28_;
	gchar* event_id = NULL;
	GVariant* _tmp29_;
	GVariant* data = NULL;
	GVariant* _tmp30_;
	guint32 timestamp = 0U;
	GVariant* _tmp31_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp28_ = g_variant_iter_next_value (&_arguments_iter);
	id = g_variant_get_int32 (_tmp28_);
	g_variant_unref (_tmp28_);
	_tmp29_ = g_variant_iter_next_value (&_arguments_iter);
	event_id = g_variant_dup_string (_tmp29_, NULL);
	g_variant_unref (_tmp29_);
	_tmp30_ = g_variant_iter_next_value (&_arguments_iter);
	data = g_variant_get_variant (_tmp30_);
	g_variant_unref (_tmp30_);
	_tmp31_ = g_variant_iter_next_value (&_arguments_iter);
	timestamp = g_variant_get_uint32 (_tmp31_);
	g_variant_unref (_tmp31_);
	sni_dbus_menu_service_event (self, id, event_id, data, timestamp, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (event_id);
	_g_variant_unref0 (data);
	;
}

static void
_dbus_sni_dbus_menu_service_event_group (SniDBusMenuService* self,
                                         GVariant* _parameters_,
                                         GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GVariant* events = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint32* result;
	gint result_length1 = 0;
	gint32* _tmp32_;
	GVariantBuilder _tmp33_;
	gint _tmp34_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	events = g_variant_iter_next_value (&_arguments_iter);
	result = sni_dbus_menu_service_event_group (self, events, &result_length1, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_tmp32_ = result;
	g_variant_builder_init (&_tmp33_, G_VARIANT_TYPE ("ai"));
	for (_tmp34_ = 0; _tmp34_ < result_length1; _tmp34_++) {
		g_variant_builder_add_value (&_tmp33_, g_variant_new_int32 (*_tmp32_));
		_tmp32_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp33_));
	result = (g_free (result), NULL);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_variant_unref0 (events);
	;
}

static void
_dbus_sni_dbus_menu_service_about_to_show (SniDBusMenuService* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint32 id = 0;
	GVariant* _tmp35_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gboolean result;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp35_ = g_variant_iter_next_value (&_arguments_iter);
	id = g_variant_get_int32 (_tmp35_);
	g_variant_unref (_tmp35_);
	result = sni_dbus_menu_service_about_to_show (self, id, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		return;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_boolean (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
}

static void
_dbus_sni_dbus_menu_service_about_to_show_group (SniDBusMenuService* self,
                                                 GVariant* _parameters_,
                                                 GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gint32* ids = NULL;
	gint ids_length1 = 0;
	GVariant* _tmp36_;
	gint32* _tmp37_;
	gint _tmp37__length;
	gint _tmp37__size;
	gint _tmp37__length1;
	GVariantIter _tmp38_;
	GVariant* _tmp39_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint32* updates_needed = NULL;
	gint updates_needed_length1 = 0;
	gint32* _tmp40_;
	GVariantBuilder _tmp41_;
	gint _tmp42_;
	gint32* id_errors = NULL;
	gint id_errors_length1 = 0;
	gint32* _tmp43_;
	GVariantBuilder _tmp44_;
	gint _tmp45_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp36_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp37_ = g_new (gint32, 5);
	_tmp37__length = 0;
	_tmp37__size = 4;
	_tmp37__length1 = 0;
	g_variant_iter_init (&_tmp38_, _tmp36_);
	for (; (_tmp39_ = g_variant_iter_next_value (&_tmp38_)) != NULL; _tmp37__length1++) {
		if (_tmp37__size == _tmp37__length) {
			_tmp37__size = 2 * _tmp37__size;
			_tmp37_ = g_renew (gint32, _tmp37_, _tmp37__size + 1);
		}
		_tmp37_[_tmp37__length++] = g_variant_get_int32 (_tmp39_);
		g_variant_unref (_tmp39_);
	}
	ids_length1 = _tmp37__length1;
	ids = _tmp37_;
	g_variant_unref (_tmp36_);
	sni_dbus_menu_service_about_to_show_group (self, ids, ids_length1, &updates_needed, &updates_needed_length1, &id_errors, &id_errors_length1, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_tmp40_ = updates_needed;
	g_variant_builder_init (&_tmp41_, G_VARIANT_TYPE ("ai"));
	for (_tmp42_ = 0; _tmp42_ < updates_needed_length1; _tmp42_++) {
		g_variant_builder_add_value (&_tmp41_, g_variant_new_int32 (*_tmp40_));
		_tmp40_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp41_));
	_tmp43_ = id_errors;
	g_variant_builder_init (&_tmp44_, G_VARIANT_TYPE ("ai"));
	for (_tmp45_ = 0; _tmp45_ < id_errors_length1; _tmp45_++) {
		g_variant_builder_add_value (&_tmp44_, g_variant_new_int32 (*_tmp43_));
		_tmp43_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp44_));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	ids = (g_free (ids), NULL);
	updates_needed = (g_free (updates_needed), NULL);
	id_errors = (g_free (id_errors), NULL);
	;
}

static void
sni_dbus_menu_service_dbus_interface_method_call (GDBusConnection* connection,
                                                  const gchar* sender,
                                                  const gchar* object_path,
                                                  const gchar* interface_name,
                                                  const gchar* method_name,
                                                  GVariant* parameters,
                                                  GDBusMethodInvocation* invocation,
                                                  gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "GetLayout") == 0) {
		_dbus_sni_dbus_menu_service_get_layout (object, parameters, invocation);
	} else if (strcmp (method_name, "GetProperty") == 0) {
		_dbus_sni_dbus_menu_service_get_property_ (object, parameters, invocation);
	} else if (strcmp (method_name, "GetGroupProperties") == 0) {
		_dbus_sni_dbus_menu_service_get_group_properties (object, parameters, invocation);
	} else if (strcmp (method_name, "Event") == 0) {
		_dbus_sni_dbus_menu_service_event (object, parameters, invocation);
	} else if (strcmp (method_name, "EventGroup") == 0) {
		_dbus_sni_dbus_menu_service_event_group (object, parameters, invocation);
	} else if (strcmp (method_name, "AboutToShow") == 0) {
		_dbus_sni_dbus_menu_service_about_to_show (object, parameters, invocation);
	} else if (strcmp (method_name, "AboutToShowGroup") == 0) {
		_dbus_sni_dbus_menu_service_about_to_show_group (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
_dbus_sni_dbus_menu_service_get_version (SniDBusMenuService* self)
{
	guint32 result;
	GVariant* _reply;
	result = sni_dbus_menu_service_get_version (self);
	_reply = g_variant_new_uint32 (result);
	return _reply;
}

static GVariant*
_dbus_sni_dbus_menu_service_get_status (SniDBusMenuService* self)
{
	gchar* result;
	GVariant* _reply;
	result = sni_dbus_menu_service_get_status (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_sni_dbus_menu_service_get_icon_theme_path (SniDBusMenuService* self)
{
	gchar** result;
	gint result_length1 = 0;
	GVariant* _reply;
	gchar** _tmp46_;
	GVariantBuilder _tmp47_;
	gint _tmp48_;
	result = sni_dbus_menu_service_get_icon_theme_path (self, &result_length1);
	_tmp46_ = result;
	g_variant_builder_init (&_tmp47_, G_VARIANT_TYPE ("as"));
	for (_tmp48_ = 0; _tmp48_ < result_length1; _tmp48_++) {
		g_variant_builder_add_value (&_tmp47_, g_variant_new_string (*_tmp46_));
		_tmp46_++;
	}
	_reply = g_variant_builder_end (&_tmp47_);
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
	return _reply;
}

static GVariant*
_dbus_sni_dbus_menu_service_get_text_direction (SniDBusMenuService* self)
{
	gchar* result;
	GVariant* _reply;
	result = sni_dbus_menu_service_get_text_direction (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
sni_dbus_menu_service_dbus_interface_get_property (GDBusConnection* connection,
                                                   const gchar* sender,
                                                   const gchar* object_path,
                                                   const gchar* interface_name,
                                                   const gchar* property_name,
                                                   GError** error,
                                                   gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "Version") == 0) {
		return _dbus_sni_dbus_menu_service_get_version (object);
	} else if (strcmp (property_name, "Status") == 0) {
		return _dbus_sni_dbus_menu_service_get_status (object);
	} else if (strcmp (property_name, "IconThemePath") == 0) {
		return _dbus_sni_dbus_menu_service_get_icon_theme_path (object);
	} else if (strcmp (property_name, "TextDirection") == 0) {
		return _dbus_sni_dbus_menu_service_get_text_direction (object);
	}
	return NULL;
}

static gboolean
sni_dbus_menu_service_dbus_interface_set_property (GDBusConnection* connection,
                                                   const gchar* sender,
                                                   const gchar* object_path,
                                                   const gchar* interface_name,
                                                   const gchar* property_name,
                                                   GVariant* value,
                                                   GError** error,
                                                   gpointer user_data)
{
	return FALSE;
}

static void
_dbus_sni_dbus_menu_service_items_properties_updated (GObject* _sender,
                                                      GVariant* updated_props,
                                                      GVariant* removed_props,
                                                      gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, updated_props);
	g_variant_builder_add_value (&_arguments_builder, removed_props);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "com.canonical.dbusmenu", "ItemsPropertiesUpdated", _arguments, NULL);
}

static void
_dbus_sni_dbus_menu_service_layout_updated (GObject* _sender,
                                            guint32 revision,
                                            gint32 parent_id,
                                            gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (revision));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (parent_id));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "com.canonical.dbusmenu", "LayoutUpdated", _arguments, NULL);
}

static void
_dbus_sni_dbus_menu_service_item_activation_requested (GObject* _sender,
                                                       gint32 id,
                                                       guint32 timestamp,
                                                       gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (id));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (timestamp));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "com.canonical.dbusmenu", "ItemActivationRequested", _arguments, NULL);
}

guint
sni_dbus_menu_service_register_object (gpointer object,
                                       GDBusConnection* connection,
                                       const gchar* path,
                                       GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_sni_dbus_menu_service_dbus_interface_info), &_sni_dbus_menu_service_dbus_interface_vtable, data, _sni_dbus_menu_service_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "items-properties-updated", (GCallback) _dbus_sni_dbus_menu_service_items_properties_updated, data);
	g_signal_connect (object, "layout-updated", (GCallback) _dbus_sni_dbus_menu_service_layout_updated, data);
	g_signal_connect (object, "item-activation-requested", (GCallback) _dbus_sni_dbus_menu_service_item_activation_requested, data);
	return result;
}

static void
_sni_dbus_menu_service_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_sni_dbus_menu_service_items_properties_updated, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_sni_dbus_menu_service_layout_updated, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_sni_dbus_menu_service_item_activation_requested, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

