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

/* Copyright 2016 Software Freedom Conservancy Inc.
 * Copyright 2019 Jens Georg <mail@jensge.org>
 *
 * This software is licensed under the GNU LGPL (version 2.1 or later).
 * See the COPYING file in this distribution.
 */

#include "shotwell-publishing.h"
#include <glib-object.h>
#include <glib.h>
#include "shotwell-plugin-dev-1.0.h"
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.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  {
	PUBLISHING_GOOGLE_PHOTOS_SERVICE_0_PROPERTY,
	PUBLISHING_GOOGLE_PHOTOS_SERVICE_NUM_PROPERTIES
};
static GParamSpec* publishing_google_photos_service_properties[PUBLISHING_GOOGLE_PHOTOS_SERVICE_NUM_PROPERTIES];

static gpointer publishing_google_photos_service_parent_class = NULL;
static SpitPluggableIface * publishing_google_photos_service_spit_pluggable_parent_iface = NULL;
static SpitPublishingServiceIface * publishing_google_photos_service_spit_publishing_service_parent_iface = NULL;

static gint publishing_google_photos_service_real_get_pluggable_interface (SpitPluggable* base,
                                                                    gint min_host_interface,
                                                                    gint max_host_interface);
static const gchar* publishing_google_photos_service_real_get_id (SpitPluggable* base);
static const gchar* publishing_google_photos_service_real_get_pluggable_name (SpitPluggable* base);
static SpitPluggableInfo* publishing_google_photos_service_real_get_info (SpitPluggable* base);
static SpitPublishingPublisher* publishing_google_photos_service_real_create_publisher (SpitPublishingService* base,
                                                                                 SpitPublishingPluginHost* host);
static SpitPublishingPublisherMediaType publishing_google_photos_service_real_get_supported_media (SpitPublishingService* base);
static void publishing_google_photos_service_real_activation (SpitPluggable* base,
                                                       gboolean enabled);
static GType publishing_google_photos_service_get_type_once (void);

PublishingGooglePhotosService*
publishing_google_photos_service_construct (GType object_type)
{
	PublishingGooglePhotosService * self = NULL;
	self = (PublishingGooglePhotosService*) g_object_new (object_type, NULL);
	return self;
}

PublishingGooglePhotosService*
publishing_google_photos_service_new (void)
{
	return publishing_google_photos_service_construct (PUBLISHING_GOOGLE_PHOTOS_TYPE_SERVICE);
}

static gint
publishing_google_photos_service_real_get_pluggable_interface (SpitPluggable* base,
                                                               gint min_host_interface,
                                                               gint max_host_interface)
{
	PublishingGooglePhotosService * self;
	gint result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_SERVICE, PublishingGooglePhotosService);
	result = spit_negotiate_interfaces (min_host_interface, max_host_interface, SPIT_PUBLISHING_CURRENT_INTERFACE);
	return result;
}

static const gchar*
publishing_google_photos_service_real_get_id (SpitPluggable* base)
{
	PublishingGooglePhotosService * self;
	const gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_SERVICE, PublishingGooglePhotosService);
	result = "org.gnome.shotwell.publishing.google-photos";
	return result;
}

static const gchar*
publishing_google_photos_service_real_get_pluggable_name (SpitPluggable* base)
{
	PublishingGooglePhotosService * self;
	const gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_SERVICE, PublishingGooglePhotosService);
	result = "Google Photos";
	return result;
}

static SpitPluggableInfo*
publishing_google_photos_service_real_get_info (SpitPluggable* base)
{
	PublishingGooglePhotosService * self;
	SpitPluggableInfo* info = NULL;
	SpitPluggableInfo* _tmp0_;
	SpitPluggableInfo* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_SERVICE, PublishingGooglePhotosService);
	_tmp0_ = spit_pluggable_info_new ();
	info = _tmp0_;
	spit_pluggable_info_set_authors (info, "Jens Georg");
	spit_pluggable_info_set_copyright (info, _ ("Copyright 2019 Jens Georg <mail@jensge.org>"));
	spit_pluggable_info_set_icon_name (info, "google-photos");
	result = info;
	return result;
}

static SpitPublishingPublisher*
publishing_google_photos_service_real_create_publisher (SpitPublishingService* base,
                                                        SpitPublishingPluginHost* host)
{
	PublishingGooglePhotosService * self;
	PublishingGooglePhotosPublisher* _tmp0_;
	SpitPublishingPublisher* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_SERVICE, PublishingGooglePhotosService);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (host, SPIT_PUBLISHING_TYPE_PLUGIN_HOST), NULL);
	_tmp0_ = publishing_google_photos_publisher_new (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_SERVICE, SpitPublishingService), host);
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_PUBLISHING_TYPE_PUBLISHER, SpitPublishingPublisher);
	return result;
}

static SpitPublishingPublisherMediaType
publishing_google_photos_service_real_get_supported_media (SpitPublishingService* base)
{
	PublishingGooglePhotosService * self;
	SpitPublishingPublisherMediaType result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_SERVICE, PublishingGooglePhotosService);
	result = SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_PHOTO | SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_VIDEO;
	return result;
}

static void
publishing_google_photos_service_real_activation (SpitPluggable* base,
                                                  gboolean enabled)
{
	PublishingGooglePhotosService * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_SERVICE, PublishingGooglePhotosService);
}

static void
publishing_google_photos_service_class_init (PublishingGooglePhotosServiceClass * klass,
                                             gpointer klass_data)
{
	publishing_google_photos_service_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_google_photos_service_spit_pluggable_interface_init (SpitPluggableIface * iface,
                                                                gpointer iface_data)
{
	publishing_google_photos_service_spit_pluggable_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_pluggable_interface = (gint (*) (SpitPluggable*, gint, gint)) publishing_google_photos_service_real_get_pluggable_interface;
	iface->get_id = (const gchar* (*) (SpitPluggable*)) publishing_google_photos_service_real_get_id;
	iface->get_pluggable_name = (const gchar* (*) (SpitPluggable*)) publishing_google_photos_service_real_get_pluggable_name;
	iface->get_info = (SpitPluggableInfo* (*) (SpitPluggable*)) publishing_google_photos_service_real_get_info;
	iface->activation = (void (*) (SpitPluggable*, gboolean)) publishing_google_photos_service_real_activation;
}

static void
publishing_google_photos_service_spit_publishing_service_interface_init (SpitPublishingServiceIface * iface,
                                                                         gpointer iface_data)
{
	publishing_google_photos_service_spit_publishing_service_parent_iface = g_type_interface_peek_parent (iface);
	iface->create_publisher = (SpitPublishingPublisher* (*) (SpitPublishingService*, SpitPublishingPluginHost*)) publishing_google_photos_service_real_create_publisher;
	iface->get_supported_media = (SpitPublishingPublisherMediaType (*) (SpitPublishingService*)) publishing_google_photos_service_real_get_supported_media;
}

static void
publishing_google_photos_service_instance_init (PublishingGooglePhotosService * self,
                                                gpointer klass)
{
}

static GType
publishing_google_photos_service_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingGooglePhotosServiceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_google_photos_service_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingGooglePhotosService), 0, (GInstanceInitFunc) publishing_google_photos_service_instance_init, NULL };
	static const GInterfaceInfo spit_pluggable_info = { (GInterfaceInitFunc) publishing_google_photos_service_spit_pluggable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo spit_publishing_service_info = { (GInterfaceInitFunc) publishing_google_photos_service_spit_publishing_service_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType publishing_google_photos_service_type_id;
	publishing_google_photos_service_type_id = g_type_register_static (G_TYPE_OBJECT, "PublishingGooglePhotosService", &g_define_type_info, 0);
	g_type_add_interface_static (publishing_google_photos_service_type_id, SPIT_TYPE_PLUGGABLE, &spit_pluggable_info);
	g_type_add_interface_static (publishing_google_photos_service_type_id, SPIT_PUBLISHING_TYPE_SERVICE, &spit_publishing_service_info);
	return publishing_google_photos_service_type_id;
}

GType
publishing_google_photos_service_get_type (void)
{
	static volatile gsize publishing_google_photos_service_type_id__once = 0;
	if (g_once_init_enter (&publishing_google_photos_service_type_id__once)) {
		GType publishing_google_photos_service_type_id;
		publishing_google_photos_service_type_id = publishing_google_photos_service_get_type_once ();
		g_once_init_leave (&publishing_google_photos_service_type_id__once, publishing_google_photos_service_type_id);
	}
	return publishing_google_photos_service_type_id__once;
}

