File: option_factory.c

package info (click to toggle)
pdf-presenter-console 3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,660 kB
  • sloc: ansic: 18,202; makefile: 6
file content (156 lines) | stat: -rw-r--r-- 9,124 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/* 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;
}