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

#include "libdino.h"
#include <glib.h>
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <gobject/gvaluecollector.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

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _DinoPluginsParamSpecRegistry DinoPluginsParamSpecRegistry;

struct _DinoPluginsRegistryPrivate {
	GRecMutex __lock_encryption_list_entries;
	GRecMutex __lock_call_encryption_entries;
	GRecMutex __lock_account_settings_entries;
	GRecMutex __lock_encryption_preferences_entries;
	GRecMutex __lock_contact_details_entries;
	GRecMutex __lock_text_commands;
	GRecMutex __lock_conversation_addition_populators;
	GRecMutex __lock_notification_populators;
	GRecMutex __lock_conversation_titlebar_entries;
};

struct _DinoPluginsParamSpecRegistry {
	GParamSpec parent_instance;
};

static gint DinoPluginsRegistry_private_offset;
static gpointer dino_plugins_registry_parent_class = NULL;

static gint _dino_plugins_registry_conversation_titlebar_entries_lambda48_ (DinoPluginsConversationTitlebarEntry* a,
                                                                     DinoPluginsConversationTitlebarEntry* b);
static gint __dino_plugins_registry_conversation_titlebar_entries_lambda48__gcompare_data_func (gconstpointer a,
                                                                                         gconstpointer b,
                                                                                         gpointer self);
static gint ___lambda49_ (DinoPluginsRegistry* self,
                   DinoPluginsAccountSettingsEntry* a,
                   DinoPluginsAccountSettingsEntry* b);
static gint ____lambda49__gcompare_data_func (gconstpointer a,
                                       gconstpointer b,
                                       gpointer self);
static void dino_plugins_registry_finalize (DinoPluginsRegistry * obj);
static GType dino_plugins_registry_get_type_once (void);

static inline gpointer
dino_plugins_registry_get_instance_private (DinoPluginsRegistry* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsRegistry_private_offset);
}

static gint
_dino_plugins_registry_conversation_titlebar_entries_lambda48_ (DinoPluginsConversationTitlebarEntry* a,
                                                                DinoPluginsConversationTitlebarEntry* b)
{
	gdouble _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gdouble _tmp3_;
	gint result;
	g_return_val_if_fail (a != NULL, -1);
	g_return_val_if_fail (b != NULL, -1);
	_tmp0_ = dino_plugins_conversation_titlebar_entry_get_order (a);
	_tmp1_ = _tmp0_;
	_tmp2_ = dino_plugins_conversation_titlebar_entry_get_order (b);
	_tmp3_ = _tmp2_;
	result = (gint) (_tmp1_ - _tmp3_);
	return result;
}

static gint
__dino_plugins_registry_conversation_titlebar_entries_lambda48__gcompare_data_func (gconstpointer a,
                                                                                    gconstpointer b,
                                                                                    gpointer self)
{
	gint result;
	result = _dino_plugins_registry_conversation_titlebar_entries_lambda48_ ((DinoPluginsConversationTitlebarEntry*) a, (DinoPluginsConversationTitlebarEntry*) b);
	return result;
}

gboolean
dino_plugins_registry_register_encryption_list_entry (DinoPluginsRegistry* self,
                                                      DinoPluginsEncryptionListEntry* entry)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (entry != NULL, FALSE);
	{
		GeeHashMap* _tmp0_;
		gboolean _tmp10_ = FALSE;
		_tmp0_ = self->encryption_list_entries;
		g_rec_mutex_lock (&self->priv->__lock_encryption_list_entries);
		{
			GeeHashMap* _tmp1_;
			DinoEntitiesEncryption _tmp2_;
			DinoEntitiesEncryption _tmp3_;
			GeeHashMap* _tmp5_;
			DinoEntitiesEncryption _tmp6_;
			DinoEntitiesEncryption _tmp7_;
			_tmp1_ = self->encryption_list_entries;
			_tmp2_ = dino_plugins_encryption_list_entry_get_encryption (entry);
			_tmp3_ = _tmp2_;
			if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp1_, (gpointer) ((gintptr) _tmp3_))) {
				result = FALSE;
				{
					GeeHashMap* _tmp4_;
					_tmp4_ = self->encryption_list_entries;
					g_rec_mutex_unlock (&self->priv->__lock_encryption_list_entries);
				}
				return result;
			}
			_tmp5_ = self->encryption_list_entries;
			_tmp6_ = dino_plugins_encryption_list_entry_get_encryption (entry);
			_tmp7_ = _tmp6_;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp5_, (gpointer) ((gintptr) _tmp7_), entry);
			result = TRUE;
			{
				GeeHashMap* _tmp8_;
				_tmp8_ = self->encryption_list_entries;
				g_rec_mutex_unlock (&self->priv->__lock_encryption_list_entries);
			}
			return result;
		}
		__finally0:
		{
			GeeHashMap* _tmp9_;
			_tmp9_ = self->encryption_list_entries;
			g_rec_mutex_unlock (&self->priv->__lock_encryption_list_entries);
		}
		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 _tmp10_;
	}
}

gboolean
dino_plugins_registry_register_call_entryption_entry (DinoPluginsRegistry* self,
                                                      const gchar* ns,
                                                      DinoPluginsCallEncryptionEntry* entry)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (ns != NULL, FALSE);
	g_return_val_if_fail (entry != NULL, FALSE);
	{
		GeeHashMap* _tmp0_;
		_tmp0_ = self->call_encryption_entries;
		g_rec_mutex_lock (&self->priv->__lock_call_encryption_entries);
		{
			GeeHashMap* _tmp1_;
			_tmp1_ = self->call_encryption_entries;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp1_, ns, entry);
		}
		__finally0:
		{
			GeeHashMap* _tmp2_;
			_tmp2_ = self->call_encryption_entries;
			g_rec_mutex_unlock (&self->priv->__lock_call_encryption_entries);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp3_ = FALSE;
			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_;
		}
	}
	result = TRUE;
	return result;
}

static gint
___lambda49_ (DinoPluginsRegistry* self,
              DinoPluginsAccountSettingsEntry* a,
              DinoPluginsAccountSettingsEntry* b)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint result;
	g_return_val_if_fail (a != NULL, -1);
	g_return_val_if_fail (b != NULL, -1);
	_tmp0_ = dino_plugins_account_settings_entry_get_name (b);
	_tmp1_ = _tmp0_;
	_tmp2_ = dino_plugins_account_settings_entry_get_name (a);
	_tmp3_ = _tmp2_;
	result = g_utf8_collate (_tmp1_, _tmp3_);
	return result;
}

static gint
____lambda49__gcompare_data_func (gconstpointer a,
                                  gconstpointer b,
                                  gpointer self)
{
	gint result;
	result = ___lambda49_ ((DinoPluginsRegistry*) self, (DinoPluginsAccountSettingsEntry*) a, (DinoPluginsAccountSettingsEntry*) b);
	return result;
}

gboolean
dino_plugins_registry_register_account_settings_entry (DinoPluginsRegistry* self,
                                                       DinoPluginsAccountSettingsEntry* entry)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (entry != NULL, FALSE);
	{
		GeeArrayList* _tmp0_;
		gboolean _tmp19_ = FALSE;
		_tmp0_ = self->account_settings_entries;
		g_rec_mutex_lock (&self->priv->__lock_account_settings_entries);
		{
			GeeArrayList* _tmp15_;
			GeeArrayList* _tmp16_;
			{
				GeeArrayList* _e_list = NULL;
				GeeArrayList* _tmp1_;
				gint _e_size = 0;
				GeeArrayList* _tmp2_;
				gint _tmp3_;
				gint _tmp4_;
				gint _e_index = 0;
				_tmp1_ = self->account_settings_entries;
				_e_list = _tmp1_;
				_tmp2_ = _e_list;
				_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
				_tmp4_ = _tmp3_;
				_e_size = _tmp4_;
				_e_index = -1;
				while (TRUE) {
					gint _tmp5_;
					gint _tmp6_;
					DinoPluginsAccountSettingsEntry* e = NULL;
					GeeArrayList* _tmp7_;
					gpointer _tmp8_;
					DinoPluginsAccountSettingsEntry* _tmp9_;
					const gchar* _tmp10_;
					const gchar* _tmp11_;
					const gchar* _tmp12_;
					const gchar* _tmp13_;
					_e_index = _e_index + 1;
					_tmp5_ = _e_index;
					_tmp6_ = _e_size;
					if (!(_tmp5_ < _tmp6_)) {
						break;
					}
					_tmp7_ = _e_list;
					_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _e_index);
					e = (DinoPluginsAccountSettingsEntry*) _tmp8_;
					_tmp9_ = e;
					_tmp10_ = dino_plugins_account_settings_entry_get_id (_tmp9_);
					_tmp11_ = _tmp10_;
					_tmp12_ = dino_plugins_account_settings_entry_get_id (entry);
					_tmp13_ = _tmp12_;
					if (g_strcmp0 (_tmp11_, _tmp13_) == 0) {
						result = FALSE;
						_g_object_unref0 (e);
						{
							GeeArrayList* _tmp14_;
							_tmp14_ = self->account_settings_entries;
							g_rec_mutex_unlock (&self->priv->__lock_account_settings_entries);
						}
						return result;
					}
					_g_object_unref0 (e);
				}
			}
			_tmp15_ = self->account_settings_entries;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp15_, entry);
			_tmp16_ = self->account_settings_entries;
			gee_list_sort ((GeeList*) _tmp16_, ____lambda49__gcompare_data_func, dino_plugins_registry_ref (self), dino_plugins_registry_unref);
			result = TRUE;
			{
				GeeArrayList* _tmp17_;
				_tmp17_ = self->account_settings_entries;
				g_rec_mutex_unlock (&self->priv->__lock_account_settings_entries);
			}
			return result;
		}
		__finally0:
		{
			GeeArrayList* _tmp18_;
			_tmp18_ = self->account_settings_entries;
			g_rec_mutex_unlock (&self->priv->__lock_account_settings_entries);
		}
		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 _tmp19_;
	}
}

gboolean
dino_plugins_registry_register_encryption_preferences_entry (DinoPluginsRegistry* self,
                                                             DinoPluginsEncryptionPreferencesEntry* entry)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (entry != NULL, FALSE);
	{
		GeeArrayList* _tmp0_;
		gboolean _tmp18_ = FALSE;
		_tmp0_ = self->encryption_preferences_entries;
		g_rec_mutex_lock (&self->priv->__lock_encryption_preferences_entries);
		{
			GeeArrayList* _tmp15_;
			{
				GeeArrayList* _e_list = NULL;
				GeeArrayList* _tmp1_;
				gint _e_size = 0;
				GeeArrayList* _tmp2_;
				gint _tmp3_;
				gint _tmp4_;
				gint _e_index = 0;
				_tmp1_ = self->encryption_preferences_entries;
				_e_list = _tmp1_;
				_tmp2_ = _e_list;
				_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
				_tmp4_ = _tmp3_;
				_e_size = _tmp4_;
				_e_index = -1;
				while (TRUE) {
					gint _tmp5_;
					gint _tmp6_;
					DinoPluginsEncryptionPreferencesEntry* e = NULL;
					GeeArrayList* _tmp7_;
					gpointer _tmp8_;
					DinoPluginsEncryptionPreferencesEntry* _tmp9_;
					const gchar* _tmp10_;
					const gchar* _tmp11_;
					const gchar* _tmp12_;
					const gchar* _tmp13_;
					_e_index = _e_index + 1;
					_tmp5_ = _e_index;
					_tmp6_ = _e_size;
					if (!(_tmp5_ < _tmp6_)) {
						break;
					}
					_tmp7_ = _e_list;
					_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _e_index);
					e = (DinoPluginsEncryptionPreferencesEntry*) _tmp8_;
					_tmp9_ = e;
					_tmp10_ = dino_plugins_encryption_preferences_entry_get_id (_tmp9_);
					_tmp11_ = _tmp10_;
					_tmp12_ = dino_plugins_encryption_preferences_entry_get_id (entry);
					_tmp13_ = _tmp12_;
					if (g_strcmp0 (_tmp11_, _tmp13_) == 0) {
						result = FALSE;
						_g_object_unref0 (e);
						{
							GeeArrayList* _tmp14_;
							_tmp14_ = self->encryption_preferences_entries;
							g_rec_mutex_unlock (&self->priv->__lock_encryption_preferences_entries);
						}
						return result;
					}
					_g_object_unref0 (e);
				}
			}
			_tmp15_ = self->encryption_preferences_entries;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp15_, entry);
			result = TRUE;
			{
				GeeArrayList* _tmp16_;
				_tmp16_ = self->encryption_preferences_entries;
				g_rec_mutex_unlock (&self->priv->__lock_encryption_preferences_entries);
			}
			return result;
		}
		__finally0:
		{
			GeeArrayList* _tmp17_;
			_tmp17_ = self->encryption_preferences_entries;
			g_rec_mutex_unlock (&self->priv->__lock_encryption_preferences_entries);
		}
		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 _tmp18_;
	}
}

gboolean
dino_plugins_registry_register_contact_details_entry (DinoPluginsRegistry* self,
                                                      DinoPluginsContactDetailsProvider* entry)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (entry != NULL, FALSE);
	{
		GeeArrayList* _tmp0_;
		gboolean _tmp18_ = FALSE;
		_tmp0_ = self->contact_details_entries;
		g_rec_mutex_lock (&self->priv->__lock_contact_details_entries);
		{
			GeeArrayList* _tmp15_;
			{
				GeeArrayList* _e_list = NULL;
				GeeArrayList* _tmp1_;
				gint _e_size = 0;
				GeeArrayList* _tmp2_;
				gint _tmp3_;
				gint _tmp4_;
				gint _e_index = 0;
				_tmp1_ = self->contact_details_entries;
				_e_list = _tmp1_;
				_tmp2_ = _e_list;
				_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
				_tmp4_ = _tmp3_;
				_e_size = _tmp4_;
				_e_index = -1;
				while (TRUE) {
					gint _tmp5_;
					gint _tmp6_;
					DinoPluginsContactDetailsProvider* e = NULL;
					GeeArrayList* _tmp7_;
					gpointer _tmp8_;
					DinoPluginsContactDetailsProvider* _tmp9_;
					const gchar* _tmp10_;
					const gchar* _tmp11_;
					const gchar* _tmp12_;
					const gchar* _tmp13_;
					_e_index = _e_index + 1;
					_tmp5_ = _e_index;
					_tmp6_ = _e_size;
					if (!(_tmp5_ < _tmp6_)) {
						break;
					}
					_tmp7_ = _e_list;
					_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _e_index);
					e = (DinoPluginsContactDetailsProvider*) _tmp8_;
					_tmp9_ = e;
					_tmp10_ = dino_plugins_contact_details_provider_get_id (_tmp9_);
					_tmp11_ = _tmp10_;
					_tmp12_ = dino_plugins_contact_details_provider_get_id (entry);
					_tmp13_ = _tmp12_;
					if (g_strcmp0 (_tmp11_, _tmp13_) == 0) {
						result = FALSE;
						_g_object_unref0 (e);
						{
							GeeArrayList* _tmp14_;
							_tmp14_ = self->contact_details_entries;
							g_rec_mutex_unlock (&self->priv->__lock_contact_details_entries);
						}
						return result;
					}
					_g_object_unref0 (e);
				}
			}
			_tmp15_ = self->contact_details_entries;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp15_, entry);
			result = TRUE;
			{
				GeeArrayList* _tmp16_;
				_tmp16_ = self->contact_details_entries;
				g_rec_mutex_unlock (&self->priv->__lock_contact_details_entries);
			}
			return result;
		}
		__finally0:
		{
			GeeArrayList* _tmp17_;
			_tmp17_ = self->contact_details_entries;
			g_rec_mutex_unlock (&self->priv->__lock_contact_details_entries);
		}
		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 _tmp18_;
	}
}

gboolean
dino_plugins_registry_register_text_command (DinoPluginsRegistry* self,
                                             DinoPluginsTextCommand* cmd)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (cmd != NULL, FALSE);
	{
		GeeMap* _tmp0_;
		gboolean _tmp10_ = FALSE;
		_tmp0_ = self->text_commands;
		g_rec_mutex_lock (&self->priv->__lock_text_commands);
		{
			GeeMap* _tmp1_;
			const gchar* _tmp2_;
			const gchar* _tmp3_;
			GeeMap* _tmp5_;
			const gchar* _tmp6_;
			const gchar* _tmp7_;
			_tmp1_ = self->text_commands;
			_tmp2_ = dino_plugins_text_command_get_cmd (cmd);
			_tmp3_ = _tmp2_;
			if (gee_map_has_key (_tmp1_, _tmp3_)) {
				result = FALSE;
				{
					GeeMap* _tmp4_;
					_tmp4_ = self->text_commands;
					g_rec_mutex_unlock (&self->priv->__lock_text_commands);
				}
				return result;
			}
			_tmp5_ = self->text_commands;
			_tmp6_ = dino_plugins_text_command_get_cmd (cmd);
			_tmp7_ = _tmp6_;
			gee_map_set (_tmp5_, _tmp7_, cmd);
			result = TRUE;
			{
				GeeMap* _tmp8_;
				_tmp8_ = self->text_commands;
				g_rec_mutex_unlock (&self->priv->__lock_text_commands);
			}
			return result;
		}
		__finally0:
		{
			GeeMap* _tmp9_;
			_tmp9_ = self->text_commands;
			g_rec_mutex_unlock (&self->priv->__lock_text_commands);
		}
		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 _tmp10_;
	}
}

gboolean
dino_plugins_registry_register_contact_titlebar_entry (DinoPluginsRegistry* self,
                                                       DinoPluginsConversationTitlebarEntry* entry)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (entry != NULL, FALSE);
	{
		GeeCollection* _tmp0_;
		gboolean _tmp15_ = FALSE;
		_tmp0_ = self->conversation_titlebar_entries;
		g_rec_mutex_lock (&self->priv->__lock_conversation_titlebar_entries);
		{
			GeeCollection* _tmp12_;
			{
				GeeIterator* _e_it = NULL;
				GeeCollection* _tmp1_;
				GeeIterator* _tmp2_;
				_tmp1_ = self->conversation_titlebar_entries;
				_tmp2_ = gee_iterable_iterator ((GeeIterable*) _tmp1_);
				_e_it = _tmp2_;
				while (TRUE) {
					GeeIterator* _tmp3_;
					DinoPluginsConversationTitlebarEntry* e = NULL;
					GeeIterator* _tmp4_;
					gpointer _tmp5_;
					DinoPluginsConversationTitlebarEntry* _tmp6_;
					const gchar* _tmp7_;
					const gchar* _tmp8_;
					const gchar* _tmp9_;
					const gchar* _tmp10_;
					_tmp3_ = _e_it;
					if (!gee_iterator_next (_tmp3_)) {
						break;
					}
					_tmp4_ = _e_it;
					_tmp5_ = gee_iterator_get (_tmp4_);
					e = (DinoPluginsConversationTitlebarEntry*) _tmp5_;
					_tmp6_ = e;
					_tmp7_ = dino_plugins_conversation_titlebar_entry_get_id (_tmp6_);
					_tmp8_ = _tmp7_;
					_tmp9_ = dino_plugins_conversation_titlebar_entry_get_id (entry);
					_tmp10_ = _tmp9_;
					if (g_strcmp0 (_tmp8_, _tmp10_) == 0) {
						result = FALSE;
						_g_object_unref0 (e);
						_g_object_unref0 (_e_it);
						{
							GeeCollection* _tmp11_;
							_tmp11_ = self->conversation_titlebar_entries;
							g_rec_mutex_unlock (&self->priv->__lock_conversation_titlebar_entries);
						}
						return result;
					}
					_g_object_unref0 (e);
				}
				_g_object_unref0 (_e_it);
			}
			_tmp12_ = self->conversation_titlebar_entries;
			gee_collection_add (_tmp12_, entry);
			result = TRUE;
			{
				GeeCollection* _tmp13_;
				_tmp13_ = self->conversation_titlebar_entries;
				g_rec_mutex_unlock (&self->priv->__lock_conversation_titlebar_entries);
			}
			return result;
		}
		__finally0:
		{
			GeeCollection* _tmp14_;
			_tmp14_ = self->conversation_titlebar_entries;
			g_rec_mutex_unlock (&self->priv->__lock_conversation_titlebar_entries);
		}
		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 _tmp15_;
	}
}

gboolean
dino_plugins_registry_register_conversation_addition_populator (DinoPluginsRegistry* self,
                                                                DinoPluginsConversationAdditionPopulator* populator)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (populator != NULL, FALSE);
	{
		GeeList* _tmp0_;
		gboolean _tmp18_ = FALSE;
		_tmp0_ = self->conversation_addition_populators;
		g_rec_mutex_lock (&self->priv->__lock_conversation_addition_populators);
		{
			GeeList* _tmp15_;
			{
				GeeList* _p_list = NULL;
				GeeList* _tmp1_;
				gint _p_size = 0;
				GeeList* _tmp2_;
				gint _tmp3_;
				gint _tmp4_;
				gint _p_index = 0;
				_tmp1_ = self->conversation_addition_populators;
				_p_list = _tmp1_;
				_tmp2_ = _p_list;
				_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
				_tmp4_ = _tmp3_;
				_p_size = _tmp4_;
				_p_index = -1;
				while (TRUE) {
					gint _tmp5_;
					gint _tmp6_;
					DinoPluginsConversationItemPopulator* p = NULL;
					GeeList* _tmp7_;
					gpointer _tmp8_;
					DinoPluginsConversationItemPopulator* _tmp9_;
					const gchar* _tmp10_;
					const gchar* _tmp11_;
					const gchar* _tmp12_;
					const gchar* _tmp13_;
					_p_index = _p_index + 1;
					_tmp5_ = _p_index;
					_tmp6_ = _p_size;
					if (!(_tmp5_ < _tmp6_)) {
						break;
					}
					_tmp7_ = _p_list;
					_tmp8_ = gee_list_get (_tmp7_, _p_index);
					p = (DinoPluginsConversationItemPopulator*) ((DinoPluginsConversationAdditionPopulator*) _tmp8_);
					_tmp9_ = p;
					_tmp10_ = dino_plugins_conversation_item_populator_get_id (_tmp9_);
					_tmp11_ = _tmp10_;
					_tmp12_ = dino_plugins_conversation_item_populator_get_id ((DinoPluginsConversationItemPopulator*) populator);
					_tmp13_ = _tmp12_;
					if (g_strcmp0 (_tmp11_, _tmp13_) == 0) {
						result = FALSE;
						_g_object_unref0 (p);
						{
							GeeList* _tmp14_;
							_tmp14_ = self->conversation_addition_populators;
							g_rec_mutex_unlock (&self->priv->__lock_conversation_addition_populators);
						}
						return result;
					}
					_g_object_unref0 (p);
				}
			}
			_tmp15_ = self->conversation_addition_populators;
			gee_collection_add ((GeeCollection*) _tmp15_, populator);
			result = TRUE;
			{
				GeeList* _tmp16_;
				_tmp16_ = self->conversation_addition_populators;
				g_rec_mutex_unlock (&self->priv->__lock_conversation_addition_populators);
			}
			return result;
		}
		__finally0:
		{
			GeeList* _tmp17_;
			_tmp17_ = self->conversation_addition_populators;
			g_rec_mutex_unlock (&self->priv->__lock_conversation_addition_populators);
		}
		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 _tmp18_;
	}
}

gboolean
dino_plugins_registry_register_notification_populator (DinoPluginsRegistry* self,
                                                       DinoPluginsNotificationPopulator* populator)
{
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (populator != NULL, FALSE);
	{
		GeeList* _tmp0_;
		gboolean _tmp18_ = FALSE;
		_tmp0_ = self->notification_populators;
		g_rec_mutex_lock (&self->priv->__lock_notification_populators);
		{
			GeeList* _tmp15_;
			{
				GeeList* _p_list = NULL;
				GeeList* _tmp1_;
				gint _p_size = 0;
				GeeList* _tmp2_;
				gint _tmp3_;
				gint _tmp4_;
				gint _p_index = 0;
				_tmp1_ = self->notification_populators;
				_p_list = _tmp1_;
				_tmp2_ = _p_list;
				_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
				_tmp4_ = _tmp3_;
				_p_size = _tmp4_;
				_p_index = -1;
				while (TRUE) {
					gint _tmp5_;
					gint _tmp6_;
					DinoPluginsNotificationPopulator* p = NULL;
					GeeList* _tmp7_;
					gpointer _tmp8_;
					DinoPluginsNotificationPopulator* _tmp9_;
					const gchar* _tmp10_;
					const gchar* _tmp11_;
					const gchar* _tmp12_;
					const gchar* _tmp13_;
					_p_index = _p_index + 1;
					_tmp5_ = _p_index;
					_tmp6_ = _p_size;
					if (!(_tmp5_ < _tmp6_)) {
						break;
					}
					_tmp7_ = _p_list;
					_tmp8_ = gee_list_get (_tmp7_, _p_index);
					p = (DinoPluginsNotificationPopulator*) _tmp8_;
					_tmp9_ = p;
					_tmp10_ = dino_plugins_notification_populator_get_id (_tmp9_);
					_tmp11_ = _tmp10_;
					_tmp12_ = dino_plugins_notification_populator_get_id (populator);
					_tmp13_ = _tmp12_;
					if (g_strcmp0 (_tmp11_, _tmp13_) == 0) {
						result = FALSE;
						_g_object_unref0 (p);
						{
							GeeList* _tmp14_;
							_tmp14_ = self->notification_populators;
							g_rec_mutex_unlock (&self->priv->__lock_notification_populators);
						}
						return result;
					}
					_g_object_unref0 (p);
				}
			}
			_tmp15_ = self->notification_populators;
			gee_collection_add ((GeeCollection*) _tmp15_, populator);
			result = TRUE;
			{
				GeeList* _tmp16_;
				_tmp16_ = self->notification_populators;
				g_rec_mutex_unlock (&self->priv->__lock_notification_populators);
			}
			return result;
		}
		__finally0:
		{
			GeeList* _tmp17_;
			_tmp17_ = self->notification_populators;
			g_rec_mutex_unlock (&self->priv->__lock_notification_populators);
		}
		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 _tmp18_;
	}
}

DinoPluginsRegistry*
dino_plugins_registry_construct (GType object_type)
{
	DinoPluginsRegistry* self = NULL;
	self = (DinoPluginsRegistry*) g_type_create_instance (object_type);
	return self;
}

DinoPluginsRegistry*
dino_plugins_registry_new (void)
{
	return dino_plugins_registry_construct (DINO_PLUGINS_TYPE_REGISTRY);
}

static void
dino_plugins_value_registry_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
dino_plugins_value_registry_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		dino_plugins_registry_unref (value->data[0].v_pointer);
	}
}

static void
dino_plugins_value_registry_copy_value (const GValue* src_value,
                                        GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = dino_plugins_registry_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
dino_plugins_value_registry_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
dino_plugins_value_registry_collect_value (GValue* value,
                                           guint n_collect_values,
                                           GTypeCValue* collect_values,
                                           guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		DinoPluginsRegistry * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = dino_plugins_registry_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
dino_plugins_value_registry_lcopy_value (const GValue* value,
                                         guint n_collect_values,
                                         GTypeCValue* collect_values,
                                         guint collect_flags)
{
	DinoPluginsRegistry ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = dino_plugins_registry_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
dino_plugins_param_spec_registry (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags)
{
	DinoPluginsParamSpecRegistry* spec;
	g_return_val_if_fail (g_type_is_a (object_type, DINO_PLUGINS_TYPE_REGISTRY), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
dino_plugins_value_get_registry (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_PLUGINS_TYPE_REGISTRY), NULL);
	return value->data[0].v_pointer;
}

void
dino_plugins_value_set_registry (GValue* value,
                                 gpointer v_object)
{
	DinoPluginsRegistry * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_PLUGINS_TYPE_REGISTRY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_PLUGINS_TYPE_REGISTRY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		dino_plugins_registry_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_plugins_registry_unref (old);
	}
}

void
dino_plugins_value_take_registry (GValue* value,
                                  gpointer v_object)
{
	DinoPluginsRegistry * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_PLUGINS_TYPE_REGISTRY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_PLUGINS_TYPE_REGISTRY));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_plugins_registry_unref (old);
	}
}

static void
dino_plugins_registry_class_init (DinoPluginsRegistryClass * klass,
                                  gpointer klass_data)
{
	dino_plugins_registry_parent_class = g_type_class_peek_parent (klass);
	((DinoPluginsRegistryClass *) klass)->finalize = dino_plugins_registry_finalize;
	g_type_class_adjust_private_offset (klass, &DinoPluginsRegistry_private_offset);
}

static void
dino_plugins_registry_instance_init (DinoPluginsRegistry * self,
                                     gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	GeeArrayList* _tmp4_;
	GeeHashMap* _tmp5_;
	GeeArrayList* _tmp6_;
	GeeArrayList* _tmp7_;
	GeeTreeSet* _tmp8_;
	self->priv = dino_plugins_registry_get_instance_private (self);
	g_rec_mutex_init (&self->priv->__lock_encryption_list_entries);
	_tmp0_ = gee_hash_map_new (DINO_ENTITIES_TYPE_ENCRYPTION, NULL, NULL, DINO_PLUGINS_TYPE_ENCRYPTION_LIST_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->encryption_list_entries = _tmp0_;
	g_rec_mutex_init (&self->priv->__lock_call_encryption_entries);
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, DINO_PLUGINS_TYPE_CALL_ENCRYPTION_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->call_encryption_entries = _tmp1_;
	g_rec_mutex_init (&self->priv->__lock_account_settings_entries);
	_tmp2_ = gee_array_list_new (DINO_PLUGINS_TYPE_ACCOUNT_SETTINGS_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->account_settings_entries = _tmp2_;
	g_rec_mutex_init (&self->priv->__lock_encryption_preferences_entries);
	_tmp3_ = gee_array_list_new (DINO_PLUGINS_TYPE_ENCRYPTION_PREFERENCES_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->encryption_preferences_entries = _tmp3_;
	g_rec_mutex_init (&self->priv->__lock_contact_details_entries);
	_tmp4_ = gee_array_list_new (DINO_PLUGINS_TYPE_CONTACT_DETAILS_PROVIDER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->contact_details_entries = _tmp4_;
	g_rec_mutex_init (&self->priv->__lock_text_commands);
	_tmp5_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, DINO_PLUGINS_TYPE_TEXT_COMMAND, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->text_commands = (GeeMap*) _tmp5_;
	g_rec_mutex_init (&self->priv->__lock_conversation_addition_populators);
	_tmp6_ = gee_array_list_new (DINO_PLUGINS_TYPE_CONVERSATION_ADDITION_POPULATOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->conversation_addition_populators = (GeeList*) _tmp6_;
	g_rec_mutex_init (&self->priv->__lock_notification_populators);
	_tmp7_ = gee_array_list_new (DINO_PLUGINS_TYPE_NOTIFICATION_POPULATOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->notification_populators = (GeeList*) _tmp7_;
	g_rec_mutex_init (&self->priv->__lock_conversation_titlebar_entries);
	_tmp8_ = gee_tree_set_new (DINO_PLUGINS_TYPE_CONVERSATION_TITLEBAR_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, __dino_plugins_registry_conversation_titlebar_entries_lambda48__gcompare_data_func, NULL, NULL);
	self->conversation_titlebar_entries = (GeeCollection*) _tmp8_;
	self->ref_count = 1;
}

static void
dino_plugins_registry_finalize (DinoPluginsRegistry * obj)
{
	DinoPluginsRegistry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_TYPE_REGISTRY, DinoPluginsRegistry);
	g_signal_handlers_destroy (self);
	g_rec_mutex_clear (&self->priv->__lock_encryption_list_entries);
	_g_object_unref0 (self->encryption_list_entries);
	g_rec_mutex_clear (&self->priv->__lock_call_encryption_entries);
	_g_object_unref0 (self->call_encryption_entries);
	g_rec_mutex_clear (&self->priv->__lock_account_settings_entries);
	_g_object_unref0 (self->account_settings_entries);
	g_rec_mutex_clear (&self->priv->__lock_encryption_preferences_entries);
	_g_object_unref0 (self->encryption_preferences_entries);
	g_rec_mutex_clear (&self->priv->__lock_contact_details_entries);
	_g_object_unref0 (self->contact_details_entries);
	g_rec_mutex_clear (&self->priv->__lock_text_commands);
	_g_object_unref0 (self->text_commands);
	g_rec_mutex_clear (&self->priv->__lock_conversation_addition_populators);
	_g_object_unref0 (self->conversation_addition_populators);
	g_rec_mutex_clear (&self->priv->__lock_notification_populators);
	_g_object_unref0 (self->notification_populators);
	g_rec_mutex_clear (&self->priv->__lock_conversation_titlebar_entries);
	_g_object_unref0 (self->conversation_titlebar_entries);
	_g_object_unref0 (self->video_call_plugin);
}

static GType
dino_plugins_registry_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { dino_plugins_value_registry_init, dino_plugins_value_registry_free_value, dino_plugins_value_registry_copy_value, dino_plugins_value_registry_peek_pointer, "p", dino_plugins_value_registry_collect_value, "p", dino_plugins_value_registry_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsRegistryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_registry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsRegistry), 0, (GInstanceInitFunc) dino_plugins_registry_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType dino_plugins_registry_type_id;
	dino_plugins_registry_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DinoPluginsRegistry", &g_define_type_info, &g_define_type_fundamental_info, 0);
	DinoPluginsRegistry_private_offset = g_type_add_instance_private (dino_plugins_registry_type_id, sizeof (DinoPluginsRegistryPrivate));
	return dino_plugins_registry_type_id;
}

GType
dino_plugins_registry_get_type (void)
{
	static volatile gsize dino_plugins_registry_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_registry_type_id__once)) {
		GType dino_plugins_registry_type_id;
		dino_plugins_registry_type_id = dino_plugins_registry_get_type_once ();
		g_once_init_leave (&dino_plugins_registry_type_id__once, dino_plugins_registry_type_id);
	}
	return dino_plugins_registry_type_id__once;
}

gpointer
dino_plugins_registry_ref (gpointer instance)
{
	DinoPluginsRegistry * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
dino_plugins_registry_unref (gpointer instance)
{
	DinoPluginsRegistry * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		DINO_PLUGINS_REGISTRY_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

