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


#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <libappindicator/app-indicator.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>


#define TYPE_INDICATOR_VIEW (indicator_view_get_type ())
#define INDICATOR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_INDICATOR_VIEW, IndicatorView))
#define IS_INDICATOR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_INDICATOR_VIEW))
#define INDICATOR_VIEW_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_INDICATOR_VIEW, IndicatorViewIface))

typedef struct _IndicatorView IndicatorView;
typedef struct _IndicatorViewIface IndicatorViewIface;

#define TYPE_APP_INDICATOR_VIEW (app_indicator_view_get_type ())
#define APP_INDICATOR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_INDICATOR_VIEW, AppIndicatorView))
#define APP_INDICATOR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_INDICATOR_VIEW, AppIndicatorViewClass))
#define IS_APP_INDICATOR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_INDICATOR_VIEW))
#define IS_APP_INDICATOR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_INDICATOR_VIEW))
#define APP_INDICATOR_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_INDICATOR_VIEW, AppIndicatorViewClass))

typedef struct _AppIndicatorView AppIndicatorView;
typedef struct _AppIndicatorViewClass AppIndicatorViewClass;
typedef struct _AppIndicatorViewPrivate AppIndicatorViewPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))

struct _IndicatorViewIface {
	GTypeInterface parent_iface;
	void (*set_label) (IndicatorView* self, const gchar* value);
	void (*set_guide) (IndicatorView* self, const gchar* value);
	void (*set_icon) (IndicatorView* self, const gchar* value);
	void (*set_description) (IndicatorView* self, const gchar* value);
};

struct _AppIndicatorView {
	GObject parent_instance;
	AppIndicatorViewPrivate * priv;
};

struct _AppIndicatorViewClass {
	GObjectClass parent_class;
};

struct _AppIndicatorViewPrivate {
	AppIndicator* indicator;
};


static gpointer app_indicator_view_parent_class = NULL;
static IndicatorViewIface* app_indicator_view_indicator_view_parent_iface = NULL;

GType indicator_view_get_type (void) G_GNUC_CONST;
GType app_indicator_view_get_type (void) G_GNUC_CONST;
#define APP_INDICATOR_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_APP_INDICATOR_VIEW, AppIndicatorViewPrivate))
enum  {
	APP_INDICATOR_VIEW_DUMMY_PROPERTY,
	APP_INDICATOR_VIEW_LABEL,
	APP_INDICATOR_VIEW_GUIDE,
	APP_INDICATOR_VIEW_ICON,
	APP_INDICATOR_VIEW_DESCRIPTION
};
AppIndicatorView* app_indicator_view_new (const gchar* icondirectory, GtkMenu* menu);
AppIndicatorView* app_indicator_view_construct (GType object_type, const gchar* icondirectory, GtkMenu* menu);
static void __lambda3_ (AppIndicatorView* self, gint delta, GdkScrollDirection direction);
static void ___lambda3__app_indicator_scroll_event (AppIndicator* _sender, gint delta, GdkScrollDirection direction, gpointer self);
static void app_indicator_view_finalize (GObject* obj);
void indicator_view_set_label (IndicatorView* self, const gchar* value);
void indicator_view_set_guide (IndicatorView* self, const gchar* value);
void indicator_view_set_icon (IndicatorView* self, const gchar* value);
void indicator_view_set_description (IndicatorView* self, const gchar* value);
static void _vala_app_indicator_view_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


static void __lambda3_ (AppIndicatorView* self, gint delta, GdkScrollDirection direction) {
	gint _tmp0_ = 0;
	GdkScrollDirection _tmp1_ = 0;
	_tmp0_ = delta;
	_tmp1_ = direction;
	g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_INDICATOR_VIEW, IndicatorView), "scroll-event", _tmp0_, (guint) _tmp1_);
}


static void ___lambda3__app_indicator_scroll_event (AppIndicator* _sender, gint delta, GdkScrollDirection direction, gpointer self) {
	__lambda3_ (self, delta, direction);
}


AppIndicatorView* app_indicator_view_construct (GType object_type, const gchar* icondirectory, GtkMenu* menu) {
	AppIndicatorView * self = NULL;
	const gchar* _tmp0_ = NULL;
	AppIndicator* _tmp1_ = NULL;
	AppIndicator* _tmp2_ = NULL;
	AppIndicator* _tmp3_ = NULL;
	GtkMenu* _tmp4_ = NULL;
	AppIndicator* _tmp5_ = NULL;
	AppIndicator* _tmp6_ = NULL;
	GtkMenu* _tmp7_ = NULL;
	GList* _tmp8_ = NULL;
	GList* _tmp9_ = NULL;
	gconstpointer _tmp10_ = NULL;
	g_return_val_if_fail (icondirectory != NULL, NULL);
	g_return_val_if_fail (GTK_IS_MENU (menu), NULL);
	self = (AppIndicatorView*) g_object_new (object_type, NULL);
	_tmp0_ = icondirectory;
	_tmp1_ = app_indicator_new_with_path ("multiload", "", APP_INDICATOR_CATEGORY_SYSTEM_SERVICES, _tmp0_);
	_g_object_unref0 (self->priv->indicator);
	self->priv->indicator = _tmp1_;
	_tmp2_ = self->priv->indicator;
	app_indicator_set_status (_tmp2_, APP_INDICATOR_STATUS_ACTIVE);
	_tmp3_ = self->priv->indicator;
	_tmp4_ = menu;
	app_indicator_set_menu (_tmp3_, _tmp4_);
	_tmp5_ = self->priv->indicator;
	g_signal_connect_object (_tmp5_, "scroll-event", (GCallback) ___lambda3__app_indicator_scroll_event, self, 0);
	_tmp6_ = self->priv->indicator;
	_tmp7_ = menu;
	_tmp8_ = gtk_container_get_children (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GTK_TYPE_CONTAINER, GtkContainer));
	_tmp9_ = _tmp8_;
	_tmp10_ = _tmp9_->data;
	app_indicator_set_secondary_activate_target (_tmp6_, (GtkWidget*) _tmp10_);
	_g_list_free0 (_tmp9_);
	return self;
}


AppIndicatorView* app_indicator_view_new (const gchar* icondirectory, GtkMenu* menu) {
	return app_indicator_view_construct (TYPE_APP_INDICATOR_VIEW, icondirectory, menu);
}


static void app_indicator_view_real_set_label (IndicatorView* base, const gchar* value) {
	AppIndicatorView* self;
	AppIndicator* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_APP_INDICATOR_VIEW, AppIndicatorView);
	_tmp0_ = self->priv->indicator;
	_tmp1_ = value;
	g_object_set (_tmp0_, "label", _tmp1_, NULL);
	g_object_notify ((GObject *) self, "label");
}


static void app_indicator_view_real_set_guide (IndicatorView* base, const gchar* value) {
	AppIndicatorView* self;
	AppIndicator* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_APP_INDICATOR_VIEW, AppIndicatorView);
	_tmp0_ = self->priv->indicator;
	_tmp1_ = value;
	g_object_set (_tmp0_, "label-guide", _tmp1_, NULL);
	g_object_notify ((GObject *) self, "guide");
}


static void app_indicator_view_real_set_icon (IndicatorView* base, const gchar* value) {
	AppIndicatorView* self;
	AppIndicator* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_APP_INDICATOR_VIEW, AppIndicatorView);
	_tmp0_ = self->priv->indicator;
	_tmp1_ = value;
	g_object_set (_tmp0_, "icon-name", _tmp1_, NULL);
	g_object_notify ((GObject *) self, "icon");
}


static void app_indicator_view_real_set_description (IndicatorView* base, const gchar* value) {
	AppIndicatorView* self;
	AppIndicator* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_APP_INDICATOR_VIEW, AppIndicatorView);
	_tmp0_ = self->priv->indicator;
	_tmp1_ = value;
	g_object_set (_tmp0_, "icon-desc", _tmp1_, NULL);
	g_object_notify ((GObject *) self, "description");
}


static void app_indicator_view_class_init (AppIndicatorViewClass * klass) {
	app_indicator_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (AppIndicatorViewPrivate));
	G_OBJECT_CLASS (klass)->set_property = _vala_app_indicator_view_set_property;
	G_OBJECT_CLASS (klass)->finalize = app_indicator_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), APP_INDICATOR_VIEW_LABEL, g_param_spec_string ("label", "label", "label", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), APP_INDICATOR_VIEW_GUIDE, g_param_spec_string ("guide", "guide", "guide", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), APP_INDICATOR_VIEW_ICON, g_param_spec_string ("icon", "icon", "icon", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), APP_INDICATOR_VIEW_DESCRIPTION, g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
}


static void app_indicator_view_indicator_view_interface_init (IndicatorViewIface * iface) {
	app_indicator_view_indicator_view_parent_iface = g_type_interface_peek_parent (iface);
	iface->set_label = app_indicator_view_real_set_label;
	iface->set_guide = app_indicator_view_real_set_guide;
	iface->set_icon = app_indicator_view_real_set_icon;
	iface->set_description = app_indicator_view_real_set_description;
}


static void app_indicator_view_instance_init (AppIndicatorView * self) {
	self->priv = APP_INDICATOR_VIEW_GET_PRIVATE (self);
}


static void app_indicator_view_finalize (GObject* obj) {
	AppIndicatorView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_APP_INDICATOR_VIEW, AppIndicatorView);
	_g_object_unref0 (self->priv->indicator);
	G_OBJECT_CLASS (app_indicator_view_parent_class)->finalize (obj);
}


/******************************************************************************
 * Copyright (C) 2011-2013  Michael Hofmann <mh21@mh21.de>                    *
 *                                                                            *
 * 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 3 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.                *
 ******************************************************************************/
GType app_indicator_view_get_type (void) {
	static volatile gsize app_indicator_view_type_id__volatile = 0;
	if (g_once_init_enter (&app_indicator_view_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AppIndicatorViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) app_indicator_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AppIndicatorView), 0, (GInstanceInitFunc) app_indicator_view_instance_init, NULL };
		static const GInterfaceInfo indicator_view_info = { (GInterfaceInitFunc) app_indicator_view_indicator_view_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType app_indicator_view_type_id;
		app_indicator_view_type_id = g_type_register_static (G_TYPE_OBJECT, "AppIndicatorView", &g_define_type_info, 0);
		g_type_add_interface_static (app_indicator_view_type_id, TYPE_INDICATOR_VIEW, &indicator_view_info);
		g_once_init_leave (&app_indicator_view_type_id__volatile, app_indicator_view_type_id);
	}
	return app_indicator_view_type_id__volatile;
}


static void _vala_app_indicator_view_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	AppIndicatorView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_APP_INDICATOR_VIEW, AppIndicatorView);
	switch (property_id) {
		case APP_INDICATOR_VIEW_LABEL:
		indicator_view_set_label (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_INDICATOR_VIEW, IndicatorView), g_value_get_string (value));
		break;
		case APP_INDICATOR_VIEW_GUIDE:
		indicator_view_set_guide (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_INDICATOR_VIEW, IndicatorView), g_value_get_string (value));
		break;
		case APP_INDICATOR_VIEW_ICON:
		indicator_view_set_icon (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_INDICATOR_VIEW, IndicatorView), g_value_get_string (value));
		break;
		case APP_INDICATOR_VIEW_DESCRIPTION:
		indicator_view_set_description (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_INDICATOR_VIEW, IndicatorView), g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



