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

/*
* Copyright (c) 2011-2013 Yorba Foundation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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 "io.elementary.photos.h"
#include <gee.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gphoto2/gphoto2-camera.h>
#include <gphoto.h>

#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

enum  {
	CAMERA_BRANCH_0_PROPERTY,
	CAMERA_BRANCH_NUM_PROPERTIES
};
static GParamSpec* camera_branch_properties[CAMERA_BRANCH_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _camera_table_unref0(var) ((var == NULL) ? NULL : (var = (camera_table_unref (var), NULL)))
#define _discovered_camera_unref0(var) ((var == NULL) ? NULL : (var = (discovered_camera_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	CAMERA_GROUPING_0_PROPERTY,
	CAMERA_GROUPING_NUM_PROPERTIES
};
static GParamSpec* camera_grouping_properties[CAMERA_GROUPING_NUM_PROPERTIES];
enum  {
	CAMERA_SIDEBAR_ENTRY_0_PROPERTY,
	CAMERA_SIDEBAR_ENTRY_NUM_PROPERTIES
};
static GParamSpec* camera_sidebar_entry_properties[CAMERA_SIDEBAR_ENTRY_NUM_PROPERTIES];
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _CameraBranchPrivate {
	GeeHashMap* camera_map;
};

struct _CameraSidebarEntryPrivate {
	DiscoveredCamera* camera;
	gchar* uri;
};

static gint CameraBranch_private_offset;
static gpointer camera_branch_parent_class = NULL;
VALA_EXTERN GIcon* camera_branch_cameras_icon;
GIcon* camera_branch_cameras_icon = NULL;
static gpointer camera_grouping_parent_class = NULL;
static gint CameraSidebarEntry_private_offset;
static gpointer camera_sidebar_entry_parent_class = NULL;

static gint camera_branch_camera_comparator (SidebarEntry* a,
                                      SidebarEntry* b);
static gint _camera_branch_camera_comparator_gcompare_func (gconstpointer a,
                                                     gconstpointer b);
static void camera_branch_add_camera (CameraBranch* self,
                               DiscoveredCamera* camera);
static void camera_branch_on_camera_added (CameraBranch* self,
                                    DiscoveredCamera* camera);
static void _camera_branch_on_camera_added_camera_table_camera_added (CameraTable* _sender,
                                                               DiscoveredCamera* camera,
                                                               gpointer self);
static void camera_branch_on_camera_removed (CameraBranch* self,
                                      DiscoveredCamera* camera);
static void _camera_branch_on_camera_removed_camera_table_camera_removed (CameraTable* _sender,
                                                                   DiscoveredCamera* camera,
                                                                   gpointer self);
static void camera_branch_remove_camera (CameraBranch* self,
                                  DiscoveredCamera* camera);
static void camera_branch_finalize (GObject * obj);
static GType camera_branch_get_type_once (void);
static GType camera_grouping_get_type_once (void);
static gchar* camera_sidebar_entry_real_get_sidebar_name (SidebarSimplePageEntry* base);
static GIcon* camera_sidebar_entry_real_get_sidebar_icon (SidebarSimplePageEntry* base);
static Page* camera_sidebar_entry_real_create_page (SidebarSimplePageEntry* base);
static void camera_sidebar_entry_finalize (GObject * obj);
static GType camera_sidebar_entry_get_type_once (void);

static inline gpointer
camera_branch_get_instance_private (CameraBranch* self)
{
	return G_STRUCT_MEMBER_P (self, CameraBranch_private_offset);
}

static gint
_camera_branch_camera_comparator_gcompare_func (gconstpointer a,
                                                gconstpointer b)
{
	gint result;
	result = camera_branch_camera_comparator ((SidebarEntry*) a, (SidebarEntry*) b);
	return result;
}

static void
_camera_branch_on_camera_added_camera_table_camera_added (CameraTable* _sender,
                                                          DiscoveredCamera* camera,
                                                          gpointer self)
{
	camera_branch_on_camera_added ((CameraBranch*) self, camera);
}

static void
_camera_branch_on_camera_removed_camera_table_camera_removed (CameraTable* _sender,
                                                              DiscoveredCamera* camera,
                                                              gpointer self)
{
	camera_branch_on_camera_removed ((CameraBranch*) self, camera);
}

CameraBranch*
camera_branch_construct (GType object_type)
{
	CameraBranch * self = NULL;
	CameraGrouping* _tmp0_;
	CameraGrouping* _tmp1_;
	CameraTable* _tmp12_;
	CameraTable* _tmp13_;
	CameraTable* _tmp14_;
	CameraTable* _tmp15_;
	_tmp0_ = camera_grouping_new ();
	_tmp1_ = _tmp0_;
	self = (CameraBranch*) sidebar_branch_construct (object_type, (SidebarEntry*) _tmp1_, SIDEBAR_BRANCH_OPTIONS_HIDE_IF_EMPTY | SIDEBAR_BRANCH_OPTIONS_AUTO_OPEN_ON_NEW_CHILD, _camera_branch_camera_comparator_gcompare_func, NULL);
	_g_object_unref0 (_tmp1_);
	{
		GeeIterator* _camera_it = NULL;
		CameraTable* _tmp2_;
		CameraTable* _tmp3_;
		GeeIterable* _tmp4_;
		GeeIterable* _tmp5_;
		GeeIterator* _tmp6_;
		GeeIterator* _tmp7_;
		_tmp2_ = camera_table_get_instance ();
		_tmp3_ = _tmp2_;
		_tmp4_ = camera_table_get_cameras (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = gee_iterable_iterator (_tmp5_);
		_tmp7_ = _tmp6_;
		_g_object_unref0 (_tmp5_);
		_camera_table_unref0 (_tmp3_);
		_camera_it = _tmp7_;
		while (TRUE) {
			GeeIterator* _tmp8_;
			DiscoveredCamera* camera = NULL;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			DiscoveredCamera* _tmp11_;
			_tmp8_ = _camera_it;
			if (!gee_iterator_next (_tmp8_)) {
				break;
			}
			_tmp9_ = _camera_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			camera = (DiscoveredCamera*) _tmp10_;
			_tmp11_ = camera;
			camera_branch_add_camera (self, _tmp11_);
			_discovered_camera_unref0 (camera);
		}
		_g_object_unref0 (_camera_it);
	}
	_tmp12_ = camera_table_get_instance ();
	_tmp13_ = _tmp12_;
	g_signal_connect_object (_tmp13_, "camera-added", (GCallback) _camera_branch_on_camera_added_camera_table_camera_added, self, 0);
	_camera_table_unref0 (_tmp13_);
	_tmp14_ = camera_table_get_instance ();
	_tmp15_ = _tmp14_;
	g_signal_connect_object (_tmp15_, "camera-removed", (GCallback) _camera_branch_on_camera_removed_camera_table_camera_removed, self, 0);
	_camera_table_unref0 (_tmp15_);
	return self;
}

CameraBranch*
camera_branch_new (void)
{
	return camera_branch_construct (CAMERA_TYPE_BRANCH);
}

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

static gint
camera_branch_camera_comparator (SidebarEntry* a,
                                 SidebarEntry* b)
{
	gint ret = 0;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gint _tmp4_;
	gint result;
	g_return_val_if_fail (a != NULL, -1);
	g_return_val_if_fail (b != NULL, -1);
	if (a == b) {
		result = 0;
		return result;
	}
	_tmp0_ = sidebar_entry_get_sidebar_name (a);
	_tmp1_ = _tmp0_;
	_tmp2_ = sidebar_entry_get_sidebar_name (b);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_utf8_collate (_tmp1_, _tmp3_);
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	ret = _tmp4_;
	if (ret == 0) {
		CameraSidebarEntry* cam_a = NULL;
		CameraSidebarEntry* _tmp5_;
		CameraSidebarEntry* cam_b = NULL;
		CameraSidebarEntry* _tmp6_;
		gboolean _tmp7_ = FALSE;
		CameraSidebarEntry* _tmp8_;
		CameraSidebarEntry* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		CameraSidebarEntry* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp5_ = _g_object_ref0 (CAMERA_IS_SIDEBAR_ENTRY (a) ? ((CameraSidebarEntry*) a) : NULL);
		cam_a = _tmp5_;
		_tmp6_ = _g_object_ref0 (CAMERA_IS_SIDEBAR_ENTRY (b) ? ((CameraSidebarEntry*) b) : NULL);
		cam_b = _tmp6_;
		_tmp8_ = cam_a;
		if (_tmp8_ != NULL) {
			CameraSidebarEntry* _tmp9_;
			_tmp9_ = cam_b;
			_tmp7_ = _tmp9_ != NULL;
		} else {
			_tmp7_ = FALSE;
		}
		_vala_assert (_tmp7_, "cam_a != null && cam_b != null");
		_tmp10_ = cam_a;
		_tmp11_ = camera_sidebar_entry_get_uri (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = cam_b;
		_tmp14_ = camera_sidebar_entry_get_uri (_tmp13_);
		_tmp15_ = _tmp14_;
		ret = g_utf8_collate (_tmp12_, _tmp15_);
		_g_free0 (_tmp15_);
		_g_free0 (_tmp12_);
		_g_object_unref0 (cam_b);
		_g_object_unref0 (cam_a);
	}
	result = ret;
	return result;
}

CameraSidebarEntry*
camera_branch_get_entry_for_camera (CameraBranch* self,
                                    DiscoveredCamera* camera)
{
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	CameraSidebarEntry* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (camera != NULL, NULL);
	_tmp0_ = self->priv->camera_map;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, camera);
	result = (CameraSidebarEntry*) _tmp1_;
	return result;
}

static void
camera_branch_on_camera_added (CameraBranch* self,
                               DiscoveredCamera* camera)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (camera != NULL);
	camera_branch_add_camera (self, camera);
}

static void
camera_branch_on_camera_removed (CameraBranch* self,
                                 DiscoveredCamera* camera)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (camera != NULL);
	camera_branch_remove_camera (self, camera);
}

static void
camera_branch_add_camera (CameraBranch* self,
                          DiscoveredCamera* camera)
{
	GeeHashMap* _tmp0_;
	CameraSidebarEntry* entry = NULL;
	CameraSidebarEntry* _tmp1_;
	GeeHashMap* _tmp2_;
	SidebarEntry* _tmp3_;
	SidebarEntry* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (camera != NULL);
	_tmp0_ = self->priv->camera_map;
	_vala_assert (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, camera), "!camera_map.has_key (camera)");
	_tmp1_ = camera_sidebar_entry_new (camera);
	entry = _tmp1_;
	_tmp2_ = self->priv->camera_map;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp2_, camera, entry);
	_tmp3_ = sidebar_branch_get_root ((SidebarBranch*) self);
	_tmp4_ = _tmp3_;
	sidebar_branch_graft ((SidebarBranch*) self, _tmp4_, (SidebarEntry*) entry, NULL);
	_g_object_unref0 (_tmp4_);
	_g_object_unref0 (entry);
}

static void
camera_branch_remove_camera (CameraBranch* self,
                             DiscoveredCamera* camera)
{
	GeeHashMap* _tmp0_;
	CameraSidebarEntry* entry = NULL;
	GeeHashMap* _tmp1_;
	gpointer _tmp2_;
	gboolean removed = FALSE;
	GeeHashMap* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (camera != NULL);
	_tmp0_ = self->priv->camera_map;
	_vala_assert (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, camera), "camera_map.has_key (camera)");
	_tmp1_ = self->priv->camera_map;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, camera);
	entry = (CameraSidebarEntry*) _tmp2_;
	_vala_assert (entry != NULL, "entry != null");
	_tmp3_ = self->priv->camera_map;
	removed = gee_abstract_map_unset ((GeeAbstractMap*) _tmp3_, camera, NULL);
	_vala_assert (removed, "removed");
	sidebar_branch_prune ((SidebarBranch*) self, (SidebarEntry*) entry);
	_g_object_unref0 (entry);
}

static void
camera_branch_base_init (CameraBranchClass * klass)
{
	GThemedIcon* _tmp0_;
	_tmp0_ = (GThemedIcon*) g_themed_icon_new (RESOURCES_ICON_CAMERAS);
	_g_object_unref0 (camera_branch_cameras_icon);
	camera_branch_cameras_icon = (GIcon*) _tmp0_;
}

static void
camera_branch_class_init (CameraBranchClass * klass,
                          gpointer klass_data)
{
	camera_branch_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CameraBranch_private_offset);
	G_OBJECT_CLASS (klass)->finalize = camera_branch_finalize;
}

static void
camera_branch_instance_init (CameraBranch * self,
                             gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = camera_branch_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (TYPE_DISCOVERED_CAMERA, (GBoxedCopyFunc) discovered_camera_ref, (GDestroyNotify) discovered_camera_unref, CAMERA_TYPE_SIDEBAR_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->camera_map = _tmp0_;
}

static void
camera_branch_finalize (GObject * obj)
{
	CameraBranch * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CAMERA_TYPE_BRANCH, CameraBranch);
	_g_object_unref0 (self->priv->camera_map);
	G_OBJECT_CLASS (camera_branch_parent_class)->finalize (obj);
}

static GType
camera_branch_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CameraBranchClass), (GBaseInitFunc) camera_branch_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) camera_branch_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CameraBranch), 0, (GInstanceInitFunc) camera_branch_instance_init, NULL };
	GType camera_branch_type_id;
	camera_branch_type_id = g_type_register_static (SIDEBAR_TYPE_BRANCH, "CameraBranch", &g_define_type_info, 0);
	CameraBranch_private_offset = g_type_add_instance_private (camera_branch_type_id, sizeof (CameraBranchPrivate));
	return camera_branch_type_id;
}

GType
camera_branch_get_type (void)
{
	static volatile gsize camera_branch_type_id__once = 0;
	if (g_once_init_enter (&camera_branch_type_id__once)) {
		GType camera_branch_type_id;
		camera_branch_type_id = camera_branch_get_type_once ();
		g_once_init_leave (&camera_branch_type_id__once, camera_branch_type_id);
	}
	return camera_branch_type_id__once;
}

CameraGrouping*
camera_grouping_construct (GType object_type)
{
	CameraGrouping * self = NULL;
	GIcon* _tmp0_;
	_tmp0_ = camera_branch_cameras_icon;
	self = (CameraGrouping*) sidebar_grouping_construct (object_type, _ ("Cameras"), _tmp0_, NULL);
	return self;
}

CameraGrouping*
camera_grouping_new (void)
{
	return camera_grouping_construct (CAMERA_TYPE_GROUPING);
}

static void
camera_grouping_class_init (CameraGroupingClass * klass,
                            gpointer klass_data)
{
	camera_grouping_parent_class = g_type_class_peek_parent (klass);
}

static void
camera_grouping_instance_init (CameraGrouping * self,
                               gpointer klass)
{
}

static GType
camera_grouping_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CameraGroupingClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) camera_grouping_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CameraGrouping), 0, (GInstanceInitFunc) camera_grouping_instance_init, NULL };
	GType camera_grouping_type_id;
	camera_grouping_type_id = g_type_register_static (SIDEBAR_TYPE_GROUPING, "CameraGrouping", &g_define_type_info, 0);
	return camera_grouping_type_id;
}

GType
camera_grouping_get_type (void)
{
	static volatile gsize camera_grouping_type_id__once = 0;
	if (g_once_init_enter (&camera_grouping_type_id__once)) {
		GType camera_grouping_type_id;
		camera_grouping_type_id = camera_grouping_get_type_once ();
		g_once_init_leave (&camera_grouping_type_id__once, camera_grouping_type_id);
	}
	return camera_grouping_type_id__once;
}

static inline gpointer
camera_sidebar_entry_get_instance_private (CameraSidebarEntry* self)
{
	return G_STRUCT_MEMBER_P (self, CameraSidebarEntry_private_offset);
}

static gpointer
_discovered_camera_ref0 (gpointer self)
{
	return self ? discovered_camera_ref (self) : NULL;
}

CameraSidebarEntry*
camera_sidebar_entry_construct (GType object_type,
                                DiscoveredCamera* camera)
{
	CameraSidebarEntry * self = NULL;
	DiscoveredCamera* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_val_if_fail (camera != NULL, NULL);
	self = (CameraSidebarEntry*) sidebar_simple_page_entry_construct (object_type);
	_tmp0_ = _discovered_camera_ref0 (camera);
	_discovered_camera_unref0 (self->priv->camera);
	self->priv->camera = _tmp0_;
	_tmp1_ = camera->uri;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (self->priv->uri);
	self->priv->uri = _tmp2_;
	return self;
}

CameraSidebarEntry*
camera_sidebar_entry_new (DiscoveredCamera* camera)
{
	return camera_sidebar_entry_construct (CAMERA_TYPE_SIDEBAR_ENTRY, camera);
}

static gchar*
camera_sidebar_entry_real_get_sidebar_name (SidebarSimplePageEntry* base)
{
	CameraSidebarEntry * self;
	const gchar* _tmp0_ = NULL;
	DiscoveredCamera* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (CameraSidebarEntry*) base;
	_tmp1_ = self->priv->camera;
	_tmp2_ = _tmp1_->display_name;
	_tmp0_ = _tmp2_;
	if (_tmp0_ == NULL) {
		_tmp0_ = _ ("Camera");
	}
	_tmp3_ = g_strdup (_tmp0_);
	result = _tmp3_;
	return result;
}

static GIcon*
camera_sidebar_entry_real_get_sidebar_icon (SidebarSimplePageEntry* base)
{
	CameraSidebarEntry * self;
	GIcon* _tmp0_ = NULL;
	DiscoveredCamera* _tmp1_;
	GIcon* _tmp2_;
	GIcon* _tmp4_;
	GIcon* result;
	self = (CameraSidebarEntry*) base;
	_tmp1_ = self->priv->camera;
	_tmp2_ = _tmp1_->icon;
	_tmp0_ = _tmp2_;
	if (_tmp0_ == NULL) {
		GIcon* _tmp3_;
		_tmp3_ = camera_branch_cameras_icon;
		_tmp0_ = _tmp3_;
	}
	_tmp4_ = _g_object_ref0 (_tmp0_);
	result = _tmp4_;
	return result;
}

static Page*
camera_sidebar_entry_real_create_page (SidebarSimplePageEntry* base)
{
	CameraSidebarEntry * self;
	DiscoveredCamera* _tmp0_;
	Camera* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GIcon* _tmp5_;
	GIcon* _tmp6_;
	ImportPage* _tmp7_;
	Page* _tmp8_;
	Page* result;
	self = (CameraSidebarEntry*) base;
	_tmp0_ = self->priv->camera;
	_tmp1_ = _tmp0_->gcamera;
	_tmp2_ = self->priv->uri;
	_tmp3_ = sidebar_simple_page_entry_get_sidebar_name ((SidebarSimplePageEntry*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = sidebar_simple_page_entry_get_sidebar_icon ((SidebarSimplePageEntry*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = import_page_new (_tmp1_, _tmp2_, _tmp4_, _tmp6_);
	g_object_ref_sink (_tmp7_);
	_tmp8_ = (Page*) _tmp7_;
	_g_object_unref0 (_tmp6_);
	_g_free0 (_tmp4_);
	result = _tmp8_;
	return result;
}

gchar*
camera_sidebar_entry_get_uri (CameraSidebarEntry* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->uri;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
camera_sidebar_entry_class_init (CameraSidebarEntryClass * klass,
                                 gpointer klass_data)
{
	camera_sidebar_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CameraSidebarEntry_private_offset);
	((SidebarSimplePageEntryClass *) klass)->get_sidebar_name = (gchar* (*) (SidebarSimplePageEntry*)) camera_sidebar_entry_real_get_sidebar_name;
	((SidebarSimplePageEntryClass *) klass)->get_sidebar_icon = (GIcon* (*) (SidebarSimplePageEntry*)) camera_sidebar_entry_real_get_sidebar_icon;
	((SidebarSimplePageEntryClass *) klass)->create_page = (Page* (*) (SidebarSimplePageEntry*)) camera_sidebar_entry_real_create_page;
	G_OBJECT_CLASS (klass)->finalize = camera_sidebar_entry_finalize;
}

static void
camera_sidebar_entry_instance_init (CameraSidebarEntry * self,
                                    gpointer klass)
{
	self->priv = camera_sidebar_entry_get_instance_private (self);
}

static void
camera_sidebar_entry_finalize (GObject * obj)
{
	CameraSidebarEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CAMERA_TYPE_SIDEBAR_ENTRY, CameraSidebarEntry);
	_discovered_camera_unref0 (self->priv->camera);
	_g_free0 (self->priv->uri);
	G_OBJECT_CLASS (camera_sidebar_entry_parent_class)->finalize (obj);
}

static GType
camera_sidebar_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CameraSidebarEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) camera_sidebar_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CameraSidebarEntry), 0, (GInstanceInitFunc) camera_sidebar_entry_instance_init, NULL };
	GType camera_sidebar_entry_type_id;
	camera_sidebar_entry_type_id = g_type_register_static (SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY, "CameraSidebarEntry", &g_define_type_info, 0);
	CameraSidebarEntry_private_offset = g_type_add_instance_private (camera_sidebar_entry_type_id, sizeof (CameraSidebarEntryPrivate));
	return camera_sidebar_entry_type_id;
}

GType
camera_sidebar_entry_get_type (void)
{
	static volatile gsize camera_sidebar_entry_type_id__once = 0;
	if (g_once_init_enter (&camera_sidebar_entry_type_id__once)) {
		GType camera_sidebar_entry_type_id;
		camera_sidebar_entry_type_id = camera_sidebar_entry_get_type_once ();
		g_once_init_leave (&camera_sidebar_entry_type_id__once, camera_sidebar_entry_type_id);
	}
	return camera_sidebar_entry_type_id__once;
}

