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


#include <glib.h>
#include <glib-object.h>


#define PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY (pdfpc_renderer_cache_option_factory_get_type ())
#define PDFPC_RENDERER_CACHE_OPTION_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY, pdfpcRendererCacheOptionFactory))
#define PDFPC_RENDERER_CACHE_OPTION_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY, pdfpcRendererCacheOptionFactoryClass))
#define PDFPC_RENDERER_CACHE_IS_OPTION_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY))
#define PDFPC_RENDERER_CACHE_IS_OPTION_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY))
#define PDFPC_RENDERER_CACHE_OPTION_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY, pdfpcRendererCacheOptionFactoryClass))

typedef struct _pdfpcRendererCacheOptionFactory pdfpcRendererCacheOptionFactory;
typedef struct _pdfpcRendererCacheOptionFactoryClass pdfpcRendererCacheOptionFactoryClass;
typedef struct _pdfpcRendererCacheOptionFactoryPrivate pdfpcRendererCacheOptionFactoryPrivate;

#define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ())
#define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase))
#define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass))
#define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE))
#define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE))
#define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass))

typedef struct _pdfpcMetadataBase pdfpcMetadataBase;
typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass;

#define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ())
#define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase))
#define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass))
#define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE))
#define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE))
#define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass))

typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase;
typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass;

#define PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE (pdfpc_renderer_cache_png_engine_get_type ())
#define PDFPC_RENDERER_CACHE_PNG_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngine))
#define PDFPC_RENDERER_CACHE_PNG_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngineClass))
#define PDFPC_RENDERER_CACHE_PNG_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE))
#define PDFPC_RENDERER_CACHE_PNG_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE))
#define PDFPC_RENDERER_CACHE_PNG_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngineClass))

typedef struct _pdfpcRendererCachePNGEngine pdfpcRendererCachePNGEngine;
typedef struct _pdfpcRendererCachePNGEngineClass pdfpcRendererCachePNGEngineClass;

#define PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE (pdfpc_renderer_cache_simple_engine_get_type ())
#define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngine))
#define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngineClass))
#define PDFPC_RENDERER_CACHE_SIMPLE_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE))
#define PDFPC_RENDERER_CACHE_SIMPLE_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE))
#define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngineClass))

typedef struct _pdfpcRendererCacheSimpleEngine pdfpcRendererCacheSimpleEngine;
typedef struct _pdfpcRendererCacheSimpleEngineClass pdfpcRendererCacheSimpleEngineClass;

struct _pdfpcRendererCacheOptionFactory {
	GObject parent_instance;
	pdfpcRendererCacheOptionFactoryPrivate * priv;
};

struct _pdfpcRendererCacheOptionFactoryClass {
	GObjectClass parent_class;
};


static gpointer pdfpc_renderer_cache_option_factory_parent_class = NULL;
extern gboolean pdfpc_options_disable_cache_compression;

GType pdfpc_renderer_cache_option_factory_get_type (void) G_GNUC_CONST;
enum  {
	PDFPC_RENDERER_CACHE_OPTION_FACTORY_DUMMY_PROPERTY
};
static pdfpcRendererCacheOptionFactory* pdfpc_renderer_cache_option_factory_new (void);
static pdfpcRendererCacheOptionFactory* pdfpc_renderer_cache_option_factory_construct (GType object_type);
GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST;
GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST;
pdfpcRendererCacheBase* pdfpc_renderer_cache_option_factory_create (pdfpcMetadataBase* metadata);
pdfpcRendererCachePNGEngine* pdfpc_renderer_cache_png_engine_new (pdfpcMetadataBase* metadata);
pdfpcRendererCachePNGEngine* pdfpc_renderer_cache_png_engine_construct (GType object_type, pdfpcMetadataBase* metadata);
GType pdfpc_renderer_cache_png_engine_get_type (void) G_GNUC_CONST;
pdfpcRendererCacheSimpleEngine* pdfpc_renderer_cache_simple_engine_new (pdfpcMetadataBase* metadata);
pdfpcRendererCacheSimpleEngine* pdfpc_renderer_cache_simple_engine_construct (GType object_type, pdfpcMetadataBase* metadata);
GType pdfpc_renderer_cache_simple_engine_get_type (void) G_GNUC_CONST;


/**
         * Do not allow instantiation of the factory
         */
static pdfpcRendererCacheOptionFactory* pdfpc_renderer_cache_option_factory_construct (GType object_type) {
	pdfpcRendererCacheOptionFactory * self = NULL;
	self = (pdfpcRendererCacheOptionFactory*) g_object_new (object_type, NULL);
	return self;
}


static pdfpcRendererCacheOptionFactory* pdfpc_renderer_cache_option_factory_new (void) {
	return pdfpc_renderer_cache_option_factory_construct (PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY);
}


/**
         * Create and return a new Cache engine based on the set of commandline
         * options.
         */
pdfpcRendererCacheBase* pdfpc_renderer_cache_option_factory_create (pdfpcMetadataBase* metadata) {
	pdfpcRendererCacheBase* result = NULL;
	gboolean _tmp0_;
	g_return_val_if_fail (metadata != NULL, NULL);
	_tmp0_ = pdfpc_options_disable_cache_compression;
	if (!_tmp0_) {
		pdfpcMetadataBase* _tmp1_;
		pdfpcRendererCachePNGEngine* _tmp2_;
		_tmp1_ = metadata;
		_tmp2_ = pdfpc_renderer_cache_png_engine_new (_tmp1_);
		result = (pdfpcRendererCacheBase*) _tmp2_;
		return result;
	} else {
		pdfpcMetadataBase* _tmp3_;
		pdfpcRendererCacheSimpleEngine* _tmp4_;
		_tmp3_ = metadata;
		_tmp4_ = pdfpc_renderer_cache_simple_engine_new (_tmp3_);
		result = (pdfpcRendererCacheBase*) _tmp4_;
		return result;
	}
}


static void pdfpc_renderer_cache_option_factory_class_init (pdfpcRendererCacheOptionFactoryClass * klass) {
	pdfpc_renderer_cache_option_factory_parent_class = g_type_class_peek_parent (klass);
}


static void pdfpc_renderer_cache_option_factory_instance_init (pdfpcRendererCacheOptionFactory * self) {
}


/**
     * Creates cache engines based on the global commandline options
     */
GType pdfpc_renderer_cache_option_factory_get_type (void) {
	static volatile gsize pdfpc_renderer_cache_option_factory_type_id__volatile = 0;
	if (g_once_init_enter (&pdfpc_renderer_cache_option_factory_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (pdfpcRendererCacheOptionFactoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_renderer_cache_option_factory_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcRendererCacheOptionFactory), 0, (GInstanceInitFunc) pdfpc_renderer_cache_option_factory_instance_init, NULL };
		GType pdfpc_renderer_cache_option_factory_type_id;
		pdfpc_renderer_cache_option_factory_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcRendererCacheOptionFactory", &g_define_type_info, 0);
		g_once_init_leave (&pdfpc_renderer_cache_option_factory_type_id__volatile, pdfpc_renderer_cache_option_factory_type_id);
	}
	return pdfpc_renderer_cache_option_factory_type_id__volatile;
}



