/* IndicatorEntry.c generated by valac 0.56.3, the Vala compiler
 * generated from IndicatorEntry.vala, do not modify */

/*
 * Copyright 2011-2020 elementary, Inc. (https://elementary.io)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA.
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include "wingpanel.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>

#define WINGPANEL_WIDGETS_STYLE_CLASS_COMPOSITED_INDICATOR "composited-indicator"
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define WINGPANEL_WIDGETS_TYPE_INDICATOR_ENTRY (wingpanel_widgets_indicator_entry_get_type ())
#define WINGPANEL_WIDGETS_INDICATOR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WINGPANEL_WIDGETS_TYPE_INDICATOR_ENTRY, WingpanelWidgetsIndicatorEntry))
#define WINGPANEL_WIDGETS_INDICATOR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WINGPANEL_WIDGETS_TYPE_INDICATOR_ENTRY, WingpanelWidgetsIndicatorEntryClass))
#define WINGPANEL_WIDGETS_IS_INDICATOR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WINGPANEL_WIDGETS_TYPE_INDICATOR_ENTRY))
#define WINGPANEL_WIDGETS_IS_INDICATOR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WINGPANEL_WIDGETS_TYPE_INDICATOR_ENTRY))
#define WINGPANEL_WIDGETS_INDICATOR_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WINGPANEL_WIDGETS_TYPE_INDICATOR_ENTRY, WingpanelWidgetsIndicatorEntryClass))

typedef struct _WingpanelWidgetsIndicatorEntry WingpanelWidgetsIndicatorEntry;
typedef struct _WingpanelWidgetsIndicatorEntryClass WingpanelWidgetsIndicatorEntryClass;
typedef struct _WingpanelWidgetsIndicatorEntryPrivate WingpanelWidgetsIndicatorEntryPrivate;

#define WINGPANEL_WIDGETS_TYPE_INDICATOR_MENU_BAR (wingpanel_widgets_indicator_menu_bar_get_type ())
#define WINGPANEL_WIDGETS_INDICATOR_MENU_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WINGPANEL_WIDGETS_TYPE_INDICATOR_MENU_BAR, WingpanelWidgetsIndicatorMenuBar))
#define WINGPANEL_WIDGETS_INDICATOR_MENU_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WINGPANEL_WIDGETS_TYPE_INDICATOR_MENU_BAR, WingpanelWidgetsIndicatorMenuBarClass))
#define WINGPANEL_WIDGETS_IS_INDICATOR_MENU_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WINGPANEL_WIDGETS_TYPE_INDICATOR_MENU_BAR))
#define WINGPANEL_WIDGETS_IS_INDICATOR_MENU_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WINGPANEL_WIDGETS_TYPE_INDICATOR_MENU_BAR))
#define WINGPANEL_WIDGETS_INDICATOR_MENU_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WINGPANEL_WIDGETS_TYPE_INDICATOR_MENU_BAR, WingpanelWidgetsIndicatorMenuBarClass))

typedef struct _WingpanelWidgetsIndicatorMenuBar WingpanelWidgetsIndicatorMenuBar;
typedef struct _WingpanelWidgetsIndicatorMenuBarClass WingpanelWidgetsIndicatorMenuBarClass;

#define WINGPANEL_SERVICES_TYPE_POPOVER_MANAGER (wingpanel_services_popover_manager_get_type ())
#define WINGPANEL_SERVICES_POPOVER_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WINGPANEL_SERVICES_TYPE_POPOVER_MANAGER, WingpanelServicesPopoverManager))
#define WINGPANEL_SERVICES_POPOVER_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WINGPANEL_SERVICES_TYPE_POPOVER_MANAGER, WingpanelServicesPopoverManagerClass))
#define WINGPANEL_SERVICES_IS_POPOVER_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WINGPANEL_SERVICES_TYPE_POPOVER_MANAGER))
#define WINGPANEL_SERVICES_IS_POPOVER_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WINGPANEL_SERVICES_TYPE_POPOVER_MANAGER))
#define WINGPANEL_SERVICES_POPOVER_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WINGPANEL_SERVICES_TYPE_POPOVER_MANAGER, WingpanelServicesPopoverManagerClass))

typedef struct _WingpanelServicesPopoverManager WingpanelServicesPopoverManager;
typedef struct _WingpanelServicesPopoverManagerClass WingpanelServicesPopoverManagerClass;
enum  {
	WINGPANEL_WIDGETS_INDICATOR_ENTRY_0_PROPERTY,
	WINGPANEL_WIDGETS_INDICATOR_ENTRY_BASE_INDICATOR_PROPERTY,
	WINGPANEL_WIDGETS_INDICATOR_ENTRY_POPOVER_MANAGER_PROPERTY,
	WINGPANEL_WIDGETS_INDICATOR_ENTRY_DISPLAY_WIDGET_PROPERTY,
	WINGPANEL_WIDGETS_INDICATOR_ENTRY_INDICATOR_WIDGET_PROPERTY,
	WINGPANEL_WIDGETS_INDICATOR_ENTRY_NUM_PROPERTIES
};
static GParamSpec* wingpanel_widgets_indicator_entry_properties[WINGPANEL_WIDGETS_INDICATOR_ENTRY_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _WingpanelWidgetsIndicatorEntry {
	GtkMenuItem parent_instance;
	WingpanelWidgetsIndicatorEntryPrivate * priv;
	WingpanelWidgetsIndicatorMenuBar* menu_bar;
};

struct _WingpanelWidgetsIndicatorEntryClass {
	GtkMenuItemClass parent_class;
};

struct _WingpanelWidgetsIndicatorEntryPrivate {
	WingpanelIndicator* _base_indicator;
	WingpanelServicesPopoverManager* _popover_manager;
	GtkWidget* _display_widget;
	GtkWidget* _indicator_widget;
	GtkRevealer* revealer;
};

static gint WingpanelWidgetsIndicatorEntry_private_offset;
static gpointer wingpanel_widgets_indicator_entry_parent_class = NULL;

VALA_EXTERN GType wingpanel_widgets_indicator_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WingpanelWidgetsIndicatorEntry, g_object_unref)
VALA_EXTERN GType wingpanel_widgets_indicator_menu_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WingpanelWidgetsIndicatorMenuBar, g_object_unref)
VALA_EXTERN GType wingpanel_services_popover_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WingpanelServicesPopoverManager, g_object_unref)
VALA_EXTERN WingpanelWidgetsIndicatorEntry* wingpanel_widgets_indicator_entry_new (WingpanelIndicator* base_indicator,
                                                                       WingpanelServicesPopoverManager* popover_manager);
VALA_EXTERN WingpanelWidgetsIndicatorEntry* wingpanel_widgets_indicator_entry_construct (GType object_type,
                                                                             WingpanelIndicator* base_indicator,
                                                                             WingpanelServicesPopoverManager* popover_manager);
static void wingpanel_widgets_indicator_entry_indicator_unmapped (WingpanelWidgetsIndicatorEntry* self);
VALA_EXTERN WingpanelIndicator* wingpanel_widgets_indicator_entry_get_base_indicator (WingpanelWidgetsIndicatorEntry* self);
static void _wingpanel_widgets_indicator_entry_indicator_unmapped_gtk_widget_unmap (GtkWidget* _sender,
                                                                             gpointer self);
VALA_EXTERN void wingpanel_widgets_indicator_menu_bar_apply_new_order (WingpanelWidgetsIndicatorMenuBar* self);
VALA_EXTERN void wingpanel_widgets_indicator_entry_set_transition_type (WingpanelWidgetsIndicatorEntry* self,
                                                            GtkRevealerTransitionType transition_type);
static void wingpanel_widgets_indicator_entry_set_reveal (WingpanelWidgetsIndicatorEntry* self,
                                                   gboolean reveal);
VALA_EXTERN WingpanelServicesPopoverManager* wingpanel_widgets_indicator_entry_get_popover_manager (WingpanelWidgetsIndicatorEntry* self);
VALA_EXTERN gboolean wingpanel_services_popover_manager_get_visible (WingpanelServicesPopoverManager* self,
                                                         WingpanelWidgetsIndicatorEntry* entry);
VALA_EXTERN void wingpanel_services_popover_manager_set_current_indicator (WingpanelServicesPopoverManager* self,
                                                               WingpanelWidgetsIndicatorEntry* value);
static void wingpanel_widgets_indicator_entry_set_base_indicator (WingpanelWidgetsIndicatorEntry* self,
                                                           WingpanelIndicator* value);
static void wingpanel_widgets_indicator_entry_set_popover_manager (WingpanelWidgetsIndicatorEntry* self,
                                                            WingpanelServicesPopoverManager* value);
VALA_EXTERN GtkWidget* wingpanel_widgets_indicator_entry_get_display_widget (WingpanelWidgetsIndicatorEntry* self);
static void wingpanel_widgets_indicator_entry_set_display_widget (WingpanelWidgetsIndicatorEntry* self,
                                                           GtkWidget* value);
VALA_EXTERN GtkWidget* wingpanel_widgets_indicator_entry_get_indicator_widget (WingpanelWidgetsIndicatorEntry* self);
static GObject * wingpanel_widgets_indicator_entry_constructor (GType type,
                                                         guint n_construct_properties,
                                                         GObjectConstructParam * construct_properties);
VALA_EXTERN void wingpanel_services_popover_manager_register_indicator (WingpanelServicesPopoverManager* self,
                                                            WingpanelWidgetsIndicatorEntry* widg);
static void _wingpanel_widgets_indicator_entry___lambda11_ (WingpanelWidgetsIndicatorEntry* self);
VALA_EXTERN void wingpanel_services_popover_manager_close (WingpanelServicesPopoverManager* self);
static void __wingpanel_widgets_indicator_entry___lambda11__wingpanel_indicator_close (WingpanelIndicator* _sender,
                                                                                gpointer self);
static void _wingpanel_widgets_indicator_entry___lambda12_ (WingpanelWidgetsIndicatorEntry* self);
VALA_EXTERN void wingpanel_services_popover_manager_unregister_indicator (WingpanelServicesPopoverManager* self,
                                                              WingpanelWidgetsIndicatorEntry* widg);
static void __wingpanel_widgets_indicator_entry___lambda12__g_object_notify (GObject* _sender,
                                                                      GParamSpec* pspec,
                                                                      gpointer self);
static gboolean _wingpanel_widgets_indicator_entry___lambda13_ (WingpanelWidgetsIndicatorEntry* self,
                                                         GdkEventScroll* e);
static gboolean __wingpanel_widgets_indicator_entry___lambda13__gtk_widget_scroll_event (GtkWidget* _sender,
                                                                                  GdkEventScroll* event,
                                                                                  gpointer self);
static gboolean _wingpanel_widgets_indicator_entry___lambda14_ (WingpanelWidgetsIndicatorEntry* self,
                                                         GdkEvent* e);
static gboolean __wingpanel_widgets_indicator_entry___lambda14__gtk_widget_touch_event (GtkWidget* _sender,
                                                                                 GdkEvent* event,
                                                                                 gpointer self);
static gboolean _wingpanel_widgets_indicator_entry___lambda15_ (WingpanelWidgetsIndicatorEntry* self,
                                                         GdkEventButton* e);
static gboolean __wingpanel_widgets_indicator_entry___lambda15__gtk_widget_button_press_event (GtkWidget* _sender,
                                                                                        GdkEventButton* event,
                                                                                        gpointer self);
static void wingpanel_widgets_indicator_entry_finalize (GObject * obj);
static GType wingpanel_widgets_indicator_entry_get_type_once (void);
static void _vala_wingpanel_widgets_indicator_entry_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec);
static void _vala_wingpanel_widgets_indicator_entry_set_property (GObject * object,
                                                           guint property_id,
                                                           const GValue * value,
                                                           GParamSpec * pspec);

static inline gpointer
wingpanel_widgets_indicator_entry_get_instance_private (WingpanelWidgetsIndicatorEntry* self)
{
	return G_STRUCT_MEMBER_P (self, WingpanelWidgetsIndicatorEntry_private_offset);
}

WingpanelWidgetsIndicatorEntry*
wingpanel_widgets_indicator_entry_construct (GType object_type,
                                             WingpanelIndicator* base_indicator,
                                             WingpanelServicesPopoverManager* popover_manager)
{
	WingpanelWidgetsIndicatorEntry * self = NULL;
	g_return_val_if_fail (base_indicator != NULL, NULL);
	g_return_val_if_fail (popover_manager != NULL, NULL);
	self = (WingpanelWidgetsIndicatorEntry*) g_object_new (object_type, "base-indicator", base_indicator, "popover-manager", popover_manager, NULL);
	return self;
}

WingpanelWidgetsIndicatorEntry*
wingpanel_widgets_indicator_entry_new (WingpanelIndicator* base_indicator,
                                       WingpanelServicesPopoverManager* popover_manager)
{
	return wingpanel_widgets_indicator_entry_construct (WINGPANEL_WIDGETS_TYPE_INDICATOR_ENTRY, base_indicator, popover_manager);
}

static void
_wingpanel_widgets_indicator_entry_indicator_unmapped_gtk_widget_unmap (GtkWidget* _sender,
                                                                        gpointer self)
{
	wingpanel_widgets_indicator_entry_indicator_unmapped ((WingpanelWidgetsIndicatorEntry*) self);
}

static void
wingpanel_widgets_indicator_entry_indicator_unmapped (WingpanelWidgetsIndicatorEntry* self)
{
	WingpanelIndicator* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	guint _tmp3_;
	WingpanelWidgetsIndicatorMenuBar* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_base_indicator;
	_tmp1_ = wingpanel_indicator_get_display_widget (_tmp0_);
	_tmp2_ = _tmp1_;
	g_signal_parse_name ("unmap", gtk_widget_get_type (), &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _wingpanel_widgets_indicator_entry_indicator_unmapped_gtk_widget_unmap, self);
	_g_object_unref0 (_tmp2_);
	_tmp4_ = self->menu_bar;
	wingpanel_widgets_indicator_menu_bar_apply_new_order (_tmp4_);
}

void
wingpanel_widgets_indicator_entry_set_transition_type (WingpanelWidgetsIndicatorEntry* self,
                                                       GtkRevealerTransitionType transition_type)
{
	GtkRevealer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->revealer;
	gtk_revealer_set_transition_type (_tmp0_, transition_type);
}

static void
wingpanel_widgets_indicator_entry_set_reveal (WingpanelWidgetsIndicatorEntry* self,
                                              gboolean reveal)
{
	gboolean _tmp0_ = FALSE;
	GtkRevealer* _tmp3_;
	g_return_if_fail (self != NULL);
	if (!reveal) {
		WingpanelServicesPopoverManager* _tmp1_;
		_tmp1_ = self->priv->_popover_manager;
		_tmp0_ = wingpanel_services_popover_manager_get_visible (_tmp1_, self);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		WingpanelServicesPopoverManager* _tmp2_;
		_tmp2_ = self->priv->_popover_manager;
		wingpanel_services_popover_manager_set_current_indicator (_tmp2_, NULL);
	}
	_tmp3_ = self->priv->revealer;
	gtk_revealer_set_reveal_child (_tmp3_, reveal);
}

WingpanelIndicator*
wingpanel_widgets_indicator_entry_get_base_indicator (WingpanelWidgetsIndicatorEntry* self)
{
	WingpanelIndicator* result;
	WingpanelIndicator* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_base_indicator;
	result = _tmp0_;
	return result;
}

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

static void
wingpanel_widgets_indicator_entry_set_base_indicator (WingpanelWidgetsIndicatorEntry* self,
                                                      WingpanelIndicator* value)
{
	WingpanelIndicator* old_value;
	g_return_if_fail (self != NULL);
	old_value = wingpanel_widgets_indicator_entry_get_base_indicator (self);
	if (old_value != value) {
		WingpanelIndicator* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_base_indicator);
		self->priv->_base_indicator = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, wingpanel_widgets_indicator_entry_properties[WINGPANEL_WIDGETS_INDICATOR_ENTRY_BASE_INDICATOR_PROPERTY]);
	}
}

WingpanelServicesPopoverManager*
wingpanel_widgets_indicator_entry_get_popover_manager (WingpanelWidgetsIndicatorEntry* self)
{
	WingpanelServicesPopoverManager* result;
	WingpanelServicesPopoverManager* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_popover_manager;
	result = _tmp0_;
	return result;
}

static void
wingpanel_widgets_indicator_entry_set_popover_manager (WingpanelWidgetsIndicatorEntry* self,
                                                       WingpanelServicesPopoverManager* value)
{
	WingpanelServicesPopoverManager* old_value;
	g_return_if_fail (self != NULL);
	old_value = wingpanel_widgets_indicator_entry_get_popover_manager (self);
	if (old_value != value) {
		WingpanelServicesPopoverManager* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_popover_manager);
		self->priv->_popover_manager = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, wingpanel_widgets_indicator_entry_properties[WINGPANEL_WIDGETS_INDICATOR_ENTRY_POPOVER_MANAGER_PROPERTY]);
	}
}

GtkWidget*
wingpanel_widgets_indicator_entry_get_display_widget (WingpanelWidgetsIndicatorEntry* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_display_widget;
	result = _tmp0_;
	return result;
}

static void
wingpanel_widgets_indicator_entry_set_display_widget (WingpanelWidgetsIndicatorEntry* self,
                                                      GtkWidget* value)
{
	GtkWidget* old_value;
	g_return_if_fail (self != NULL);
	old_value = wingpanel_widgets_indicator_entry_get_display_widget (self);
	if (old_value != value) {
		GtkWidget* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_display_widget);
		self->priv->_display_widget = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, wingpanel_widgets_indicator_entry_properties[WINGPANEL_WIDGETS_INDICATOR_ENTRY_DISPLAY_WIDGET_PROPERTY]);
	}
}

GtkWidget*
wingpanel_widgets_indicator_entry_get_indicator_widget (WingpanelWidgetsIndicatorEntry* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_indicator_widget;
	if (_tmp0_ == NULL) {
		WingpanelIndicator* _tmp1_;
		GtkWidget* _tmp2_;
		_tmp1_ = self->priv->_base_indicator;
		_tmp2_ = wingpanel_indicator_get_widget (_tmp1_);
		_g_object_unref0 (self->priv->_indicator_widget);
		self->priv->_indicator_widget = _tmp2_;
	}
	_tmp3_ = self->priv->_indicator_widget;
	result = _tmp3_;
	return result;
}

static void
_wingpanel_widgets_indicator_entry___lambda11_ (WingpanelWidgetsIndicatorEntry* self)
{
	WingpanelServicesPopoverManager* _tmp0_;
	_tmp0_ = self->priv->_popover_manager;
	wingpanel_services_popover_manager_close (_tmp0_);
}

static void
__wingpanel_widgets_indicator_entry___lambda11__wingpanel_indicator_close (WingpanelIndicator* _sender,
                                                                           gpointer self)
{
	_wingpanel_widgets_indicator_entry___lambda11_ ((WingpanelWidgetsIndicatorEntry*) self);
}

static void
_wingpanel_widgets_indicator_entry___lambda12_ (WingpanelWidgetsIndicatorEntry* self)
{
	WingpanelWidgetsIndicatorMenuBar* _tmp0_;
	_tmp0_ = self->menu_bar;
	if (_tmp0_ != NULL) {
		WingpanelServicesPopoverManager* _tmp1_;
		WingpanelIndicator* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp1_ = self->priv->_popover_manager;
		wingpanel_services_popover_manager_close (_tmp1_);
		_tmp2_ = self->priv->_base_indicator;
		_tmp3_ = wingpanel_indicator_get_visible (_tmp2_);
		_tmp4_ = _tmp3_;
		if (_tmp4_) {
			WingpanelServicesPopoverManager* _tmp5_;
			WingpanelWidgetsIndicatorMenuBar* _tmp6_;
			WingpanelIndicator* _tmp7_;
			gboolean _tmp8_;
			gboolean _tmp9_;
			_tmp5_ = self->priv->_popover_manager;
			wingpanel_services_popover_manager_register_indicator (_tmp5_, self);
			_tmp6_ = self->menu_bar;
			wingpanel_widgets_indicator_menu_bar_apply_new_order (_tmp6_);
			_tmp7_ = self->priv->_base_indicator;
			_tmp8_ = wingpanel_indicator_get_visible (_tmp7_);
			_tmp9_ = _tmp8_;
			wingpanel_widgets_indicator_entry_set_reveal (self, _tmp9_);
		} else {
			WingpanelIndicator* _tmp10_;
			gboolean _tmp11_;
			gboolean _tmp12_;
			WingpanelServicesPopoverManager* _tmp13_;
			GtkWidget* _tmp14_;
			_tmp10_ = self->priv->_base_indicator;
			_tmp11_ = wingpanel_indicator_get_visible (_tmp10_);
			_tmp12_ = _tmp11_;
			wingpanel_widgets_indicator_entry_set_reveal (self, _tmp12_);
			_tmp13_ = self->priv->_popover_manager;
			wingpanel_services_popover_manager_unregister_indicator (_tmp13_, self);
			_tmp14_ = self->priv->_display_widget;
			g_signal_connect_object (_tmp14_, "unmap", (GCallback) _wingpanel_widgets_indicator_entry_indicator_unmapped_gtk_widget_unmap, self, 0);
		}
	} else {
		WingpanelIndicator* _tmp15_;
		gboolean _tmp16_;
		gboolean _tmp17_;
		_tmp15_ = self->priv->_base_indicator;
		_tmp16_ = wingpanel_indicator_get_visible (_tmp15_);
		_tmp17_ = _tmp16_;
		wingpanel_widgets_indicator_entry_set_reveal (self, _tmp17_);
	}
}

static void
__wingpanel_widgets_indicator_entry___lambda12__g_object_notify (GObject* _sender,
                                                                 GParamSpec* pspec,
                                                                 gpointer self)
{
	_wingpanel_widgets_indicator_entry___lambda12_ ((WingpanelWidgetsIndicatorEntry*) self);
}

static gboolean
_wingpanel_widgets_indicator_entry___lambda13_ (WingpanelWidgetsIndicatorEntry* self,
                                                GdkEventScroll* e)
{
	GtkWidget* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean result;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = self->priv->_display_widget;
	g_signal_emit_by_name (_tmp0_, "scroll-event", e, &_tmp1_);
	result = GDK_EVENT_PROPAGATE;
	return result;
}

static gboolean
__wingpanel_widgets_indicator_entry___lambda13__gtk_widget_scroll_event (GtkWidget* _sender,
                                                                         GdkEventScroll* event,
                                                                         gpointer self)
{
	gboolean result;
	result = _wingpanel_widgets_indicator_entry___lambda13_ ((WingpanelWidgetsIndicatorEntry*) self, event);
	return result;
}

static gboolean
_wingpanel_widgets_indicator_entry___lambda14_ (WingpanelWidgetsIndicatorEntry* self,
                                                GdkEvent* e)
{
	gboolean result;
	g_return_val_if_fail (e != NULL, FALSE);
	if (e->type == GDK_TOUCH_BEGIN) {
		WingpanelServicesPopoverManager* _tmp0_;
		_tmp0_ = self->priv->_popover_manager;
		wingpanel_services_popover_manager_set_current_indicator (_tmp0_, self);
		result = GDK_EVENT_STOP;
		return result;
	}
	result = GDK_EVENT_PROPAGATE;
	return result;
}

static gboolean
__wingpanel_widgets_indicator_entry___lambda14__gtk_widget_touch_event (GtkWidget* _sender,
                                                                        GdkEvent* event,
                                                                        gpointer self)
{
	gboolean result;
	result = _wingpanel_widgets_indicator_entry___lambda14_ ((WingpanelWidgetsIndicatorEntry*) self, event);
	return result;
}

static gboolean
_wingpanel_widgets_indicator_entry___lambda15_ (WingpanelWidgetsIndicatorEntry* self,
                                                GdkEventButton* e)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GtkWidget* _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean result;
	g_return_val_if_fail (e != NULL, FALSE);
	if (e->button == ((guint) GDK_BUTTON_PRIMARY)) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = e->button == ((guint) GDK_BUTTON_SECONDARY);
	}
	if (_tmp1_) {
		_tmp0_ = e->type == GDK_BUTTON_PRESS;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		WingpanelServicesPopoverManager* _tmp2_;
		_tmp2_ = self->priv->_popover_manager;
		wingpanel_services_popover_manager_set_current_indicator (_tmp2_, self);
		result = GDK_EVENT_STOP;
		return result;
	}
	_tmp3_ = self->priv->_display_widget;
	g_signal_emit_by_name (_tmp3_, "button-press-event", e, &_tmp4_);
	result = GDK_EVENT_STOP;
	return result;
}

static gboolean
__wingpanel_widgets_indicator_entry___lambda15__gtk_widget_button_press_event (GtkWidget* _sender,
                                                                               GdkEventButton* event,
                                                                               gpointer self)
{
	gboolean result;
	result = _wingpanel_widgets_indicator_entry___lambda15_ ((WingpanelWidgetsIndicatorEntry*) self, event);
	return result;
}

static GObject *
wingpanel_widgets_indicator_entry_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WingpanelWidgetsIndicatorEntry * self;
	WingpanelIndicator* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	WingpanelIndicator* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GtkStyleContext* _tmp8_;
	GtkWidget* _tmp9_;
	GtkRevealer* _tmp10_;
	GtkRevealer* _tmp11_;
	GtkWidget* _tmp12_;
	GtkRevealer* _tmp13_;
	WingpanelIndicator* _tmp14_;
	gboolean _tmp15_;
	gboolean _tmp16_;
	WingpanelIndicator* _tmp18_;
	WingpanelIndicator* _tmp19_;
	WingpanelIndicator* _tmp20_;
	gboolean _tmp21_;
	gboolean _tmp22_;
	parent_class = G_OBJECT_CLASS (wingpanel_widgets_indicator_entry_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WINGPANEL_WIDGETS_TYPE_INDICATOR_ENTRY, WingpanelWidgetsIndicatorEntry);
	gtk_widget_set_can_focus ((GtkWidget*) self, FALSE);
	_tmp0_ = self->priv->_base_indicator;
	_tmp1_ = wingpanel_indicator_get_display_widget (_tmp0_);
	_tmp2_ = _tmp1_;
	wingpanel_widgets_indicator_entry_set_display_widget (self, _tmp2_);
	_g_object_unref0 (_tmp2_);
	gtk_widget_set_halign ((GtkWidget*) self, GTK_ALIGN_START);
	_tmp3_ = self->priv->_base_indicator;
	_tmp4_ = wingpanel_indicator_get_code_name (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strconcat (_tmp5_, "/entry", NULL);
	_tmp7_ = _tmp6_;
	gtk_widget_set_name ((GtkWidget*) self, _tmp7_);
	_g_free0 (_tmp7_);
	_tmp8_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp8_, WINGPANEL_WIDGETS_STYLE_CLASS_COMPOSITED_INDICATOR);
	_tmp9_ = self->priv->_display_widget;
	if (_tmp9_ == NULL) {
		return obj;
	}
	_tmp10_ = (GtkRevealer*) gtk_revealer_new ();
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->revealer);
	self->priv->revealer = _tmp10_;
	_tmp11_ = self->priv->revealer;
	_tmp12_ = self->priv->_display_widget;
	gtk_container_add ((GtkContainer*) _tmp11_, _tmp12_);
	_tmp13_ = self->priv->revealer;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp13_);
	_tmp14_ = self->priv->_base_indicator;
	_tmp15_ = wingpanel_indicator_get_visible (_tmp14_);
	_tmp16_ = _tmp15_;
	if (_tmp16_) {
		WingpanelServicesPopoverManager* _tmp17_;
		_tmp17_ = self->priv->_popover_manager;
		wingpanel_services_popover_manager_register_indicator (_tmp17_, self);
	}
	_tmp18_ = self->priv->_base_indicator;
	g_signal_connect_object (_tmp18_, "close", (GCallback) __wingpanel_widgets_indicator_entry___lambda11__wingpanel_indicator_close, self, 0);
	_tmp19_ = self->priv->_base_indicator;
	g_signal_connect_object ((GObject*) _tmp19_, "notify::visible", (GCallback) __wingpanel_widgets_indicator_entry___lambda12__g_object_notify, self, 0);
	gtk_widget_add_events ((GtkWidget*) self, (gint) GDK_SCROLL_MASK);
	gtk_widget_add_events ((GtkWidget*) self, (gint) GDK_SMOOTH_SCROLL_MASK);
	g_signal_connect_object ((GtkWidget*) self, "scroll-event", (GCallback) __wingpanel_widgets_indicator_entry___lambda13__gtk_widget_scroll_event, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "touch-event", (GCallback) __wingpanel_widgets_indicator_entry___lambda14__gtk_widget_touch_event, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "button-press-event", (GCallback) __wingpanel_widgets_indicator_entry___lambda15__gtk_widget_button_press_event, self, 0);
	_tmp20_ = self->priv->_base_indicator;
	_tmp21_ = wingpanel_indicator_get_visible (_tmp20_);
	_tmp22_ = _tmp21_;
	wingpanel_widgets_indicator_entry_set_reveal (self, _tmp22_);
	return obj;
}

static void
wingpanel_widgets_indicator_entry_class_init (WingpanelWidgetsIndicatorEntryClass * klass,
                                              gpointer klass_data)
{
	wingpanel_widgets_indicator_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WingpanelWidgetsIndicatorEntry_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_wingpanel_widgets_indicator_entry_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_wingpanel_widgets_indicator_entry_set_property;
	G_OBJECT_CLASS (klass)->constructor = wingpanel_widgets_indicator_entry_constructor;
	G_OBJECT_CLASS (klass)->finalize = wingpanel_widgets_indicator_entry_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WINGPANEL_WIDGETS_INDICATOR_ENTRY_BASE_INDICATOR_PROPERTY, wingpanel_widgets_indicator_entry_properties[WINGPANEL_WIDGETS_INDICATOR_ENTRY_BASE_INDICATOR_PROPERTY] = g_param_spec_object ("base-indicator", "base-indicator", "base-indicator", WINGPANEL_TYPE_INDICATOR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WINGPANEL_WIDGETS_INDICATOR_ENTRY_POPOVER_MANAGER_PROPERTY, wingpanel_widgets_indicator_entry_properties[WINGPANEL_WIDGETS_INDICATOR_ENTRY_POPOVER_MANAGER_PROPERTY] = g_param_spec_object ("popover-manager", "popover-manager", "popover-manager", WINGPANEL_SERVICES_TYPE_POPOVER_MANAGER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WINGPANEL_WIDGETS_INDICATOR_ENTRY_DISPLAY_WIDGET_PROPERTY, wingpanel_widgets_indicator_entry_properties[WINGPANEL_WIDGETS_INDICATOR_ENTRY_DISPLAY_WIDGET_PROPERTY] = g_param_spec_object ("display-widget", "display-widget", "display-widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WINGPANEL_WIDGETS_INDICATOR_ENTRY_INDICATOR_WIDGET_PROPERTY, wingpanel_widgets_indicator_entry_properties[WINGPANEL_WIDGETS_INDICATOR_ENTRY_INDICATOR_WIDGET_PROPERTY] = g_param_spec_object ("indicator-widget", "indicator-widget", "indicator-widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
wingpanel_widgets_indicator_entry_instance_init (WingpanelWidgetsIndicatorEntry * self,
                                                 gpointer klass)
{
	self->priv = wingpanel_widgets_indicator_entry_get_instance_private (self);
	self->priv->_indicator_widget = NULL;
}

static void
wingpanel_widgets_indicator_entry_finalize (GObject * obj)
{
	WingpanelWidgetsIndicatorEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WINGPANEL_WIDGETS_TYPE_INDICATOR_ENTRY, WingpanelWidgetsIndicatorEntry);
	_g_object_unref0 (self->priv->_base_indicator);
	_g_object_unref0 (self->priv->_popover_manager);
	_g_object_unref0 (self->menu_bar);
	_g_object_unref0 (self->priv->_display_widget);
	_g_object_unref0 (self->priv->_indicator_widget);
	_g_object_unref0 (self->priv->revealer);
	G_OBJECT_CLASS (wingpanel_widgets_indicator_entry_parent_class)->finalize (obj);
}

static GType
wingpanel_widgets_indicator_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WingpanelWidgetsIndicatorEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wingpanel_widgets_indicator_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WingpanelWidgetsIndicatorEntry), 0, (GInstanceInitFunc) wingpanel_widgets_indicator_entry_instance_init, NULL };
	GType wingpanel_widgets_indicator_entry_type_id;
	wingpanel_widgets_indicator_entry_type_id = g_type_register_static (gtk_menu_item_get_type (), "WingpanelWidgetsIndicatorEntry", &g_define_type_info, 0);
	WingpanelWidgetsIndicatorEntry_private_offset = g_type_add_instance_private (wingpanel_widgets_indicator_entry_type_id, sizeof (WingpanelWidgetsIndicatorEntryPrivate));
	return wingpanel_widgets_indicator_entry_type_id;
}

GType
wingpanel_widgets_indicator_entry_get_type (void)
{
	static volatile gsize wingpanel_widgets_indicator_entry_type_id__once = 0;
	if (g_once_init_enter (&wingpanel_widgets_indicator_entry_type_id__once)) {
		GType wingpanel_widgets_indicator_entry_type_id;
		wingpanel_widgets_indicator_entry_type_id = wingpanel_widgets_indicator_entry_get_type_once ();
		g_once_init_leave (&wingpanel_widgets_indicator_entry_type_id__once, wingpanel_widgets_indicator_entry_type_id);
	}
	return wingpanel_widgets_indicator_entry_type_id__once;
}

static void
_vala_wingpanel_widgets_indicator_entry_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec)
{
	WingpanelWidgetsIndicatorEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WINGPANEL_WIDGETS_TYPE_INDICATOR_ENTRY, WingpanelWidgetsIndicatorEntry);
	switch (property_id) {
		case WINGPANEL_WIDGETS_INDICATOR_ENTRY_BASE_INDICATOR_PROPERTY:
		g_value_set_object (value, wingpanel_widgets_indicator_entry_get_base_indicator (self));
		break;
		case WINGPANEL_WIDGETS_INDICATOR_ENTRY_POPOVER_MANAGER_PROPERTY:
		g_value_set_object (value, wingpanel_widgets_indicator_entry_get_popover_manager (self));
		break;
		case WINGPANEL_WIDGETS_INDICATOR_ENTRY_DISPLAY_WIDGET_PROPERTY:
		g_value_set_object (value, wingpanel_widgets_indicator_entry_get_display_widget (self));
		break;
		case WINGPANEL_WIDGETS_INDICATOR_ENTRY_INDICATOR_WIDGET_PROPERTY:
		g_value_set_object (value, wingpanel_widgets_indicator_entry_get_indicator_widget (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_wingpanel_widgets_indicator_entry_set_property (GObject * object,
                                                      guint property_id,
                                                      const GValue * value,
                                                      GParamSpec * pspec)
{
	WingpanelWidgetsIndicatorEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WINGPANEL_WIDGETS_TYPE_INDICATOR_ENTRY, WingpanelWidgetsIndicatorEntry);
	switch (property_id) {
		case WINGPANEL_WIDGETS_INDICATOR_ENTRY_BASE_INDICATOR_PROPERTY:
		wingpanel_widgets_indicator_entry_set_base_indicator (self, g_value_get_object (value));
		break;
		case WINGPANEL_WIDGETS_INDICATOR_ENTRY_POPOVER_MANAGER_PROPERTY:
		wingpanel_widgets_indicator_entry_set_popover_manager (self, g_value_get_object (value));
		break;
		case WINGPANEL_WIDGETS_INDICATOR_ENTRY_DISPLAY_WIDGET_PROPERTY:
		wingpanel_widgets_indicator_entry_set_display_widget (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

