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

#include <glib-object.h>
#include "libdino.h"
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "dino_i18n.h"
#include <float.h>
#include <math.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
#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 DINO_UI_TYPE_SEARCH_MENU_ENTRY (dino_ui_search_menu_entry_get_type ())
#define DINO_UI_SEARCH_MENU_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_SEARCH_MENU_ENTRY, DinoUiSearchMenuEntry))
#define DINO_UI_SEARCH_MENU_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_SEARCH_MENU_ENTRY, DinoUiSearchMenuEntryClass))
#define DINO_UI_IS_SEARCH_MENU_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_SEARCH_MENU_ENTRY))
#define DINO_UI_IS_SEARCH_MENU_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_SEARCH_MENU_ENTRY))
#define DINO_UI_SEARCH_MENU_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_SEARCH_MENU_ENTRY, DinoUiSearchMenuEntryClass))

typedef struct _DinoUiSearchMenuEntry DinoUiSearchMenuEntry;
typedef struct _DinoUiSearchMenuEntryClass DinoUiSearchMenuEntryClass;
typedef struct _DinoUiSearchMenuEntryPrivate DinoUiSearchMenuEntryPrivate;
enum  {
	DINO_UI_SEARCH_MENU_ENTRY_0_PROPERTY,
	DINO_UI_SEARCH_MENU_ENTRY_ID_PROPERTY,
	DINO_UI_SEARCH_MENU_ENTRY_ORDER_PROPERTY,
	DINO_UI_SEARCH_MENU_ENTRY_NUM_PROPERTIES
};
static GParamSpec* dino_ui_search_menu_entry_properties[DINO_UI_SEARCH_MENU_ENTRY_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _DinoUiSearchMenuEntry {
	GObject parent_instance;
	DinoUiSearchMenuEntryPrivate * priv;
	GtkToggleButton* button;
};

struct _DinoUiSearchMenuEntryClass {
	GObjectClass parent_class;
};

static gpointer dino_ui_search_menu_entry_parent_class = NULL;
static DinoPluginsConversationTitlebarEntryIface * dino_ui_search_menu_entry_dino_plugins_conversation_titlebar_entry_parent_iface = NULL;

VALA_EXTERN GType dino_ui_search_menu_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiSearchMenuEntry, g_object_unref)
VALA_EXTERN gchar* dino_ui_util_string_if_tooltips_active (const gchar* s);
VALA_EXTERN DinoUiSearchMenuEntry* dino_ui_search_menu_entry_new (void);
VALA_EXTERN DinoUiSearchMenuEntry* dino_ui_search_menu_entry_construct (GType object_type);
static void dino_ui_search_menu_entry_real_set_conversation (DinoPluginsConversationTitlebarEntry* base,
                                                      DinoEntitiesConversation* conversation);
static void dino_ui_search_menu_entry_real_unset_conversation (DinoPluginsConversationTitlebarEntry* base);
static GObject* dino_ui_search_menu_entry_real_get_widget (DinoPluginsConversationTitlebarEntry* base,
                                                    DinoPluginsWidgetType type);
static void dino_ui_search_menu_entry_finalize (GObject * obj);
static GType dino_ui_search_menu_entry_get_type_once (void);
static void _vala_dino_ui_search_menu_entry_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

DinoUiSearchMenuEntry*
dino_ui_search_menu_entry_construct (GType object_type)
{
	DinoUiSearchMenuEntry * self = NULL;
	GtkToggleButton* _tmp0_;
	self = (DinoUiSearchMenuEntry*) g_object_new (object_type, NULL);
	_tmp0_ = self->button;
	gtk_button_set_icon_name ((GtkButton*) _tmp0_, "system-search-symbolic");
	return self;
}

DinoUiSearchMenuEntry*
dino_ui_search_menu_entry_new (void)
{
	return dino_ui_search_menu_entry_construct (DINO_UI_TYPE_SEARCH_MENU_ENTRY);
}

static void
dino_ui_search_menu_entry_real_set_conversation (DinoPluginsConversationTitlebarEntry* base,
                                                 DinoEntitiesConversation* conversation)
{
	DinoUiSearchMenuEntry * self;
	self = (DinoUiSearchMenuEntry*) base;
	g_return_if_fail (conversation != NULL);
}

static void
dino_ui_search_menu_entry_real_unset_conversation (DinoPluginsConversationTitlebarEntry* base)
{
	DinoUiSearchMenuEntry * self;
	self = (DinoUiSearchMenuEntry*) base;
}

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

static GObject*
dino_ui_search_menu_entry_real_get_widget (DinoPluginsConversationTitlebarEntry* base,
                                           DinoPluginsWidgetType type)
{
	DinoUiSearchMenuEntry * self;
	GtkToggleButton* _tmp0_;
	GObject* _tmp1_;
	GObject* result;
	self = (DinoUiSearchMenuEntry*) base;
	if (type != DINO_PLUGINS_WIDGET_TYPE_GTK4) {
		result = NULL;
		return result;
	}
	_tmp0_ = self->button;
	_tmp1_ = _g_object_ref0 ((GObject*) _tmp0_);
	result = _tmp1_;
	return result;
}

static const gchar*
dino_ui_search_menu_entry_real_get_id (DinoPluginsConversationTitlebarEntry* base)
{
	const gchar* result;
	DinoUiSearchMenuEntry* self;
	self = (DinoUiSearchMenuEntry*) base;
	result = "search";
	return result;
}

static gdouble
dino_ui_search_menu_entry_real_get_order (DinoPluginsConversationTitlebarEntry* base)
{
	gdouble result;
	DinoUiSearchMenuEntry* self;
	self = (DinoUiSearchMenuEntry*) base;
	result = (gdouble) 1;
	return result;
}

static void
dino_ui_search_menu_entry_class_init (DinoUiSearchMenuEntryClass * klass,
                                      gpointer klass_data)
{
	dino_ui_search_menu_entry_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_search_menu_entry_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_search_menu_entry_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_SEARCH_MENU_ENTRY_ID_PROPERTY, dino_ui_search_menu_entry_properties[DINO_UI_SEARCH_MENU_ENTRY_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_SEARCH_MENU_ENTRY_ORDER_PROPERTY, dino_ui_search_menu_entry_properties[DINO_UI_SEARCH_MENU_ENTRY_ORDER_PROPERTY] = g_param_spec_double ("order", "order", "order", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dino_ui_search_menu_entry_dino_plugins_conversation_titlebar_entry_interface_init (DinoPluginsConversationTitlebarEntryIface * iface,
                                                                                   gpointer iface_data)
{
	dino_ui_search_menu_entry_dino_plugins_conversation_titlebar_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->set_conversation = (void (*) (DinoPluginsConversationTitlebarEntry*, DinoEntitiesConversation*)) dino_ui_search_menu_entry_real_set_conversation;
	iface->unset_conversation = (void (*) (DinoPluginsConversationTitlebarEntry*)) dino_ui_search_menu_entry_real_unset_conversation;
	iface->get_widget = (GObject* (*) (DinoPluginsConversationTitlebarEntry*, DinoPluginsWidgetType)) dino_ui_search_menu_entry_real_get_widget;
	iface->get_id = dino_ui_search_menu_entry_real_get_id;
	iface->get_order = dino_ui_search_menu_entry_real_get_order;
}

static void
dino_ui_search_menu_entry_instance_init (DinoUiSearchMenuEntry * self,
                                         gpointer klass)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GtkToggleButton* _tmp2_ = NULL;
	_tmp0_ = dino_gettext ("Search messages");
	_tmp1_ = dino_ui_util_string_if_tooltips_active (_tmp0_);
	_tmp2_ = (GtkToggleButton*) gtk_toggle_button_new ();
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp2_, _tmp1_);
	_g_free0 (_tmp1_);
	g_object_ref_sink (_tmp2_);
	self->button = _tmp2_;
}

static void
dino_ui_search_menu_entry_finalize (GObject * obj)
{
	DinoUiSearchMenuEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_SEARCH_MENU_ENTRY, DinoUiSearchMenuEntry);
	_g_object_unref0 (self->button);
	G_OBJECT_CLASS (dino_ui_search_menu_entry_parent_class)->finalize (obj);
}

static GType
dino_ui_search_menu_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiSearchMenuEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_search_menu_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiSearchMenuEntry), 0, (GInstanceInitFunc) dino_ui_search_menu_entry_instance_init, NULL };
	static const GInterfaceInfo dino_plugins_conversation_titlebar_entry_info = { (GInterfaceInitFunc) dino_ui_search_menu_entry_dino_plugins_conversation_titlebar_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dino_ui_search_menu_entry_type_id;
	dino_ui_search_menu_entry_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoUiSearchMenuEntry", &g_define_type_info, 0);
	g_type_add_interface_static (dino_ui_search_menu_entry_type_id, DINO_PLUGINS_TYPE_CONVERSATION_TITLEBAR_ENTRY, &dino_plugins_conversation_titlebar_entry_info);
	return dino_ui_search_menu_entry_type_id;
}

GType
dino_ui_search_menu_entry_get_type (void)
{
	static volatile gsize dino_ui_search_menu_entry_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_search_menu_entry_type_id__once)) {
		GType dino_ui_search_menu_entry_type_id;
		dino_ui_search_menu_entry_type_id = dino_ui_search_menu_entry_get_type_once ();
		g_once_init_leave (&dino_ui_search_menu_entry_type_id__once, dino_ui_search_menu_entry_type_id);
	}
	return dino_ui_search_menu_entry_type_id__once;
}

static void
_vala_dino_ui_search_menu_entry_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	DinoUiSearchMenuEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_SEARCH_MENU_ENTRY, DinoUiSearchMenuEntry);
	switch (property_id) {
		case DINO_UI_SEARCH_MENU_ENTRY_ID_PROPERTY:
		g_value_set_string (value, dino_plugins_conversation_titlebar_entry_get_id ((DinoPluginsConversationTitlebarEntry*) self));
		break;
		case DINO_UI_SEARCH_MENU_ENTRY_ORDER_PROPERTY:
		g_value_set_double (value, dino_plugins_conversation_titlebar_entry_get_order ((DinoPluginsConversationTitlebarEntry*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

