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

/*
* Copyright (c) 2011-2013 Yorba Foundation
*               2018 elementary LLC. (https://elementary.io)
*
* 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
*/
/* Represents a row-type.*/

#include "io.elementary.photos.h"
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <string.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  {
	SEARCH_ROW_0_PROPERTY,
	SEARCH_ROW_PARENT_PROPERTY,
	SEARCH_ROW_NUM_PROPERTIES
};
static GParamSpec* search_row_properties[SEARCH_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _SearchRowPrivate {
	SearchRowContainer* _parent;
};

static gint SearchRow_private_offset;
static gpointer search_row_parent_class = NULL;

static SearchCondition* search_row_real_get_search_condition (SearchRow* self);
static void search_row_real_populate (SearchRow* self,
                               SearchCondition* sc);
static gboolean search_row_real_is_complete (SearchRow* self);
static GObject * search_row_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties);
static void search_row_finalize (GObject * obj);
static GType search_row_get_type_once (void);
static void _vala_search_row_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec);
static void _vala_search_row_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
search_row_get_instance_private (SearchRow* self)
{
	return G_STRUCT_MEMBER_P (self, SearchRow_private_offset);
}

static SearchCondition*
search_row_real_get_search_condition (SearchRow* self)
{
	g_critical ("Type `%s' does not implement abstract method `search_row_get_search_condition'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

SearchCondition*
search_row_get_search_condition (SearchRow* self)
{
	SearchRowClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = SEARCH_ROW_GET_CLASS (self);
	if (_klass_->get_search_condition) {
		return _klass_->get_search_condition (self);
	}
	return NULL;
}

static void
search_row_real_populate (SearchRow* self,
                          SearchCondition* sc)
{
	g_critical ("Type `%s' does not implement abstract method `search_row_populate'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
search_row_populate (SearchRow* self,
                     SearchCondition* sc)
{
	SearchRowClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = SEARCH_ROW_GET_CLASS (self);
	if (_klass_->populate) {
		_klass_->populate (self, sc);
	}
}

static gboolean
search_row_real_is_complete (SearchRow* self)
{
	gboolean _tmp0_ = FALSE;
	g_critical ("Type `%s' does not implement abstract method `search_row_is_complete'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gboolean
search_row_is_complete (SearchRow* self)
{
	SearchRowClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = SEARCH_ROW_GET_CLASS (self);
	if (_klass_->is_complete) {
		return _klass_->is_complete (self);
	}
	return FALSE;
}

SearchRow*
search_row_construct (GType object_type)
{
	SearchRow * self = NULL;
	self = (SearchRow*) g_object_new (object_type, NULL);
	return self;
}

SearchRowContainer*
search_row_get_parent (SearchRow* self)
{
	SearchRowContainer* result;
	SearchRowContainer* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_parent;
	result = _tmp0_;
	return result;
}

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

static void
search_row_set_parent (SearchRow* self,
                       SearchRowContainer* value)
{
	SearchRowContainer* old_value;
	g_return_if_fail (self != NULL);
	old_value = search_row_get_parent (self);
	if (old_value != value) {
		SearchRowContainer* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_parent);
		self->priv->_parent = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, search_row_properties[SEARCH_ROW_PARENT_PROPERTY]);
	}
}

static GObject *
search_row_constructor (GType type,
                        guint n_construct_properties,
                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SearchRow * self;
	parent_class = G_OBJECT_CLASS (search_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SEARCH_ROW, SearchRow);
	gtk_grid_set_column_spacing ((GtkGrid*) self, 6);
	return obj;
}

static void
search_row_class_init (SearchRowClass * klass,
                       gpointer klass_data)
{
	search_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SearchRow_private_offset);
	((SearchRowClass *) klass)->get_search_condition = (SearchCondition* (*) (SearchRow*)) search_row_real_get_search_condition;
	((SearchRowClass *) klass)->populate = (void (*) (SearchRow*, SearchCondition*)) search_row_real_populate;
	((SearchRowClass *) klass)->is_complete = (gboolean (*) (SearchRow*)) search_row_real_is_complete;
	G_OBJECT_CLASS (klass)->get_property = _vala_search_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_search_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = search_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = search_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEARCH_ROW_PARENT_PROPERTY, search_row_properties[SEARCH_ROW_PARENT_PROPERTY] = g_param_spec_object ("parent", "parent", "parent", TYPE_SEARCH_ROW_CONTAINER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
search_row_instance_init (SearchRow * self,
                          gpointer klass)
{
	self->priv = search_row_get_instance_private (self);
}

static void
search_row_finalize (GObject * obj)
{
	SearchRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SEARCH_ROW, SearchRow);
	_g_object_unref0 (self->priv->_parent);
	G_OBJECT_CLASS (search_row_parent_class)->finalize (obj);
}

static GType
search_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SearchRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) search_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SearchRow), 0, (GInstanceInitFunc) search_row_instance_init, NULL };
	GType search_row_type_id;
	search_row_type_id = g_type_register_static (gtk_grid_get_type (), "SearchRow", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	SearchRow_private_offset = g_type_add_instance_private (search_row_type_id, sizeof (SearchRowPrivate));
	return search_row_type_id;
}

GType
search_row_get_type (void)
{
	static volatile gsize search_row_type_id__once = 0;
	if (g_once_init_enter (&search_row_type_id__once)) {
		GType search_row_type_id;
		search_row_type_id = search_row_get_type_once ();
		g_once_init_leave (&search_row_type_id__once, search_row_type_id);
	}
	return search_row_type_id__once;
}

static void
_vala_search_row_get_property (GObject * object,
                               guint property_id,
                               GValue * value,
                               GParamSpec * pspec)
{
	SearchRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_SEARCH_ROW, SearchRow);
	switch (property_id) {
		case SEARCH_ROW_PARENT_PROPERTY:
		g_value_set_object (value, search_row_get_parent (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_search_row_set_property (GObject * object,
                               guint property_id,
                               const GValue * value,
                               GParamSpec * pspec)
{
	SearchRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_SEARCH_ROW, SearchRow);
	switch (property_id) {
		case SEARCH_ROW_PARENT_PROPERTY:
		search_row_set_parent (self, g_value_get_object (value));
		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;
}

