~ubuntu-branches/ubuntu/precise/folks/precise

« back to all changes in this revision

Viewing changes to backends/libsocialweb/sw-backend-factory.c

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine
  • Date: 2011-06-10 11:28:11 UTC
  • mfrom: (1.2.11 upstream) (4.2.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110610112811-whyeodbo9mjezxfp
Tags: 0.5.2-1ubuntu1
* Merge with Debian experimental, remaining Ubuntu changes:
  - debian/control:
    + Add Vcs-Bzr link

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* sw-backend-factory.c generated by valac 0.12.0, the Vala compiler
 
2
 * generated from sw-backend-factory.vala, do not modify */
 
3
 
 
4
/*
 
5
 * Copyright (C) 2009 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>.
 
6
 * Copyright (C) 2009 Nokia Corporation.
 
7
 * Copyright (C) 2010 Collabora Ltd.
 
8
 *
 
9
 * This library is free software: you can redistribute it and/or modify
 
10
 * it under the terms of the GNU Lesser General Public License as published by
 
11
 * the Free Software Foundation, either version 2.1 of the License, or
 
12
 * (at your option) any later version.
 
13
 *
 
14
 * This library is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU Lesser General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU Lesser General Public License
 
20
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
21
 *
 
22
 * Authors: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
 
23
 *          Travis Reitter <travis.reitter@collabora.co.uk>
 
24
 *          Marco Barisione <marco.barisione@collabora.co.uk>
 
25
 *
 
26
 * This file was originally part of Rygel.
 
27
 */
 
28
 
 
29
#include <glib.h>
 
30
#include <glib-object.h>
 
31
#include <folks/folks.h>
 
32
 
 
33
 
 
34
#define FOLKS_BACKENDS_SW_TYPE_BACKEND_FACTORY (folks_backends_sw_backend_factory_get_type ())
 
35
#define FOLKS_BACKENDS_SW_BACKEND_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_BACKENDS_SW_TYPE_BACKEND_FACTORY, FolksBackendsSwBackendFactory))
 
36
#define FOLKS_BACKENDS_SW_BACKEND_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_BACKENDS_SW_TYPE_BACKEND_FACTORY, FolksBackendsSwBackendFactoryClass))
 
37
#define FOLKS_BACKENDS_SW_IS_BACKEND_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_BACKENDS_SW_TYPE_BACKEND_FACTORY))
 
38
#define FOLKS_BACKENDS_SW_IS_BACKEND_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_BACKENDS_SW_TYPE_BACKEND_FACTORY))
 
39
#define FOLKS_BACKENDS_SW_BACKEND_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_BACKENDS_SW_TYPE_BACKEND_FACTORY, FolksBackendsSwBackendFactoryClass))
 
40
 
 
41
typedef struct _FolksBackendsSwBackendFactory FolksBackendsSwBackendFactory;
 
42
typedef struct _FolksBackendsSwBackendFactoryClass FolksBackendsSwBackendFactoryClass;
 
43
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 
44
typedef struct _FolksBackendsSwBackendFactoryPrivate FolksBackendsSwBackendFactoryPrivate;
 
45
 
 
46
#define FOLKS_BACKENDS_SW_TYPE_BACKEND (folks_backends_sw_backend_get_type ())
 
47
#define FOLKS_BACKENDS_SW_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLKS_BACKENDS_SW_TYPE_BACKEND, FolksBackendsSwBackend))
 
48
#define FOLKS_BACKENDS_SW_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLKS_BACKENDS_SW_TYPE_BACKEND, FolksBackendsSwBackendClass))
 
49
#define FOLKS_BACKENDS_SW_IS_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLKS_BACKENDS_SW_TYPE_BACKEND))
 
50
#define FOLKS_BACKENDS_SW_IS_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLKS_BACKENDS_SW_TYPE_BACKEND))
 
51
#define FOLKS_BACKENDS_SW_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLKS_BACKENDS_SW_TYPE_BACKEND, FolksBackendsSwBackendClass))
 
52
 
 
53
typedef struct _FolksBackendsSwBackend FolksBackendsSwBackend;
 
54
typedef struct _FolksBackendsSwBackendClass FolksBackendsSwBackendClass;
 
55
 
 
56
struct _FolksBackendsSwBackendFactory {
 
57
        GObject parent_instance;
 
58
        FolksBackendsSwBackendFactoryPrivate * priv;
 
59
};
 
60
 
 
61
struct _FolksBackendsSwBackendFactoryClass {
 
62
        GObjectClass parent_class;
 
63
};
 
64
 
 
65
 
 
66
extern FolksBackendsSwBackendFactory* backend_factory;
 
67
FolksBackendsSwBackendFactory* backend_factory = NULL;
 
68
static gpointer folks_backends_sw_backend_factory_parent_class = NULL;
 
69
 
 
70
GType folks_backends_sw_backend_factory_get_type (void) G_GNUC_CONST;
 
71
void module_init (FolksBackendStore* backend_store);
 
72
FolksBackendsSwBackendFactory* folks_backends_sw_backend_factory_new (FolksBackendStore* backend_store);
 
73
FolksBackendsSwBackendFactory* folks_backends_sw_backend_factory_construct (GType object_type, FolksBackendStore* backend_store);
 
74
void module_finalize (FolksBackendStore* backend_store);
 
75
enum  {
 
76
        FOLKS_BACKENDS_SW_BACKEND_FACTORY_DUMMY_PROPERTY
 
77
};
 
78
FolksBackendsSwBackend* folks_backends_sw_backend_new (void);
 
79
FolksBackendsSwBackend* folks_backends_sw_backend_construct (GType object_type);
 
80
GType folks_backends_sw_backend_get_type (void) G_GNUC_CONST;
 
81
 
 
82
 
 
83
/**
 
84
 * The libsocialweb backend module entry point.
 
85
 */
 
86
void module_init (FolksBackendStore* backend_store) {
 
87
        FolksBackendsSwBackendFactory* _tmp0_ = NULL;
 
88
        g_return_if_fail (backend_store != NULL);
 
89
        _tmp0_ = folks_backends_sw_backend_factory_new (backend_store);
 
90
        _g_object_unref0 (backend_factory);
 
91
        backend_factory = _tmp0_;
 
92
}
 
93
 
 
94
 
 
95
/**
 
96
 * The libsocialweb backend module exit point.
 
97
 */
 
98
void module_finalize (FolksBackendStore* backend_store) {
 
99
        g_return_if_fail (backend_store != NULL);
 
100
        _g_object_unref0 (backend_factory);
 
101
        backend_factory = NULL;
 
102
}
 
103
 
 
104
 
 
105
/**
 
106
   * {@inheritDoc}
 
107
   */
 
108
FolksBackendsSwBackendFactory* folks_backends_sw_backend_factory_construct (GType object_type, FolksBackendStore* backend_store) {
 
109
        FolksBackendsSwBackendFactory * self = NULL;
 
110
        FolksBackendsSwBackend* _tmp0_ = NULL;
 
111
        FolksBackendsSwBackend* _tmp1_;
 
112
        g_return_val_if_fail (backend_store != NULL, NULL);
 
113
        self = (FolksBackendsSwBackendFactory*) g_object_new (object_type, NULL);
 
114
        _tmp0_ = folks_backends_sw_backend_new ();
 
115
        _tmp1_ = _tmp0_;
 
116
        folks_backend_store_add_backend (backend_store, (FolksBackend*) _tmp1_);
 
117
        _g_object_unref0 (_tmp1_);
 
118
        return self;
 
119
}
 
120
 
 
121
 
 
122
FolksBackendsSwBackendFactory* folks_backends_sw_backend_factory_new (FolksBackendStore* backend_store) {
 
123
        return folks_backends_sw_backend_factory_construct (FOLKS_BACKENDS_SW_TYPE_BACKEND_FACTORY, backend_store);
 
124
}
 
125
 
 
126
 
 
127
static void folks_backends_sw_backend_factory_class_init (FolksBackendsSwBackendFactoryClass * klass) {
 
128
        folks_backends_sw_backend_factory_parent_class = g_type_class_peek_parent (klass);
 
129
}
 
130
 
 
131
 
 
132
static void folks_backends_sw_backend_factory_instance_init (FolksBackendsSwBackendFactory * self) {
 
133
}
 
134
 
 
135
 
 
136
/**
 
137
 * A backend factory to create a single {@link Backend}.
 
138
 */
 
139
GType folks_backends_sw_backend_factory_get_type (void) {
 
140
        static volatile gsize folks_backends_sw_backend_factory_type_id__volatile = 0;
 
141
        if (g_once_init_enter (&folks_backends_sw_backend_factory_type_id__volatile)) {
 
142
                static const GTypeInfo g_define_type_info = { sizeof (FolksBackendsSwBackendFactoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) folks_backends_sw_backend_factory_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FolksBackendsSwBackendFactory), 0, (GInstanceInitFunc) folks_backends_sw_backend_factory_instance_init, NULL };
 
143
                GType folks_backends_sw_backend_factory_type_id;
 
144
                folks_backends_sw_backend_factory_type_id = g_type_register_static (G_TYPE_OBJECT, "FolksBackendsSwBackendFactory", &g_define_type_info, 0);
 
145
                g_once_init_leave (&folks_backends_sw_backend_factory_type_id__volatile, folks_backends_sw_backend_factory_type_id);
 
146
        }
 
147
        return folks_backends_sw_backend_factory_type_id__volatile;
 
148
}
 
149
 
 
150
 
 
151