~seb128/unity-settings-daemon/battery-info-key

« back to all changes in this revision

Viewing changes to src/gnome-settings-plugins-engine.c

  • Committer: William Jon McCann
  • Author(s): William Jon McCann
  • Date: 2007-12-14 05:06:55 UTC
  • Revision ID: git-v1:b7f5d9895c19338f10b0bdd494b221b13b540d9d
Initial checkin. Previously lived in gdm module.

2007-12-14  William Jon McCann  <mccann@jhu.edu>

        * configure.ac, etc: Initial checkin.  Previously
        lived in gdm module.


svn path=/trunk/; revision=2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
 
2
 *
 
3
 * Copyright (C) 2002-2005 Paolo Maggi
 
4
 * Copyright (C) 2007      William Jon McCann <mccann@jhu.edu>
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place, Suite 330,
 
19
 * Boston, MA 02111-1307, USA.
 
20
 */
 
21
 
 
22
#include "config.h"
 
23
 
 
24
#include <string.h>
 
25
 
 
26
#include <glib.h>
 
27
#include <glib/gi18n.h>
 
28
#include <gmodule.h>
 
29
#include <gconf/gconf-client.h>
 
30
 
 
31
#include "gnome-settings-plugins-engine.h"
 
32
#include "gnome-settings-plugin.h"
 
33
 
 
34
#include "gnome-settings-module.h"
 
35
 
 
36
#define PLUGIN_EXT ".gnome-settings-plugin"
 
37
#define PLUGIN_GROUP "GNOME Settings Plugin"
 
38
 
 
39
typedef enum
 
40
{
 
41
        GNOME_SETTINGS_PLUGIN_LOADER_C,
 
42
        GNOME_SETTINGS_PLUGIN_LOADER_PY,
 
43
} GnomeSettingsPluginLoader;
 
44
 
 
45
struct _GnomeSettingsPluginInfo
 
46
{
 
47
        char                    *file;
 
48
 
 
49
        char                    *location;
 
50
        GnomeSettingsPluginLoader  loader;
 
51
        GTypeModule             *module;
 
52
 
 
53
        char                    *name;
 
54
        char                    *desc;
 
55
        char                   **authors;
 
56
        char                    *copyright;
 
57
        char                    *website;
 
58
 
 
59
        GnomeSettingsPlugin       *plugin;
 
60
 
 
61
        gint                     active : 1;
 
62
 
 
63
        guint                    active_notification_id;
 
64
 
 
65
        /* A plugin is unavailable if it is not possible to activate it
 
66
           due to an error loading the plugin module (e.g. for Python plugins
 
67
           when the interpreter has not been correctly initializated) */
 
68
        gint                     available : 1;
 
69
};
 
70
 
 
71
static char        *gnome_settings_gconf_prefix = NULL;
 
72
static GHashTable  *gnome_settings_plugins = NULL;
 
73
static GConfClient *client = NULL;
 
74
 
 
75
static void
 
76
gnome_settings_plugin_info_free (GnomeSettingsPluginInfo *info)
 
77
{
 
78
        if (info->plugin != NULL) {
 
79
                g_debug ("Unref plugin %s", info->name);
 
80
 
 
81
                g_object_unref (info->plugin);
 
82
 
 
83
                /* info->module must not be unref since it is not possible to finalize
 
84
                 * a type module */
 
85
        }
 
86
 
 
87
        g_free (info->file);
 
88
        g_free (info->location);
 
89
        g_free (info->name);
 
90
        g_free (info->desc);
 
91
        g_free (info->website);
 
92
        g_free (info->copyright);
 
93
        g_strfreev (info->authors);
 
94
 
 
95
        g_free (info);
 
96
}
 
97
 
 
98
static GnomeSettingsPluginInfo *
 
99
gnome_settings_plugins_engine_load (const char *file)
 
100
{
 
101
        GnomeSettingsPluginInfo *info;
 
102
        GKeyFile              *plugin_file = NULL;
 
103
        char                  *str;
 
104
 
 
105
        g_return_val_if_fail (file != NULL, NULL);
 
106
 
 
107
        g_debug ("Loading plugin: %s", file);
 
108
 
 
109
        info = g_new0 (GnomeSettingsPluginInfo, 1);
 
110
        info->file = g_strdup (file);
 
111
 
 
112
        plugin_file = g_key_file_new ();
 
113
        if (! g_key_file_load_from_file (plugin_file, file, G_KEY_FILE_NONE, NULL)) {
 
114
                g_warning ("Bad plugin file: %s", file);
 
115
                goto error;
 
116
        }
 
117
 
 
118
        if (! g_key_file_has_key (plugin_file, PLUGIN_GROUP, "IAge", NULL)) {
 
119
                g_debug ("IAge key does not exist in file: %s", file);
 
120
                goto error;
 
121
        }
 
122
 
 
123
        /* Check IAge=2 */
 
124
        if (g_key_file_get_integer (plugin_file, PLUGIN_GROUP, "IAge", NULL) != 0) {
 
125
                g_debug ("Wrong IAge in file: %s", file);
 
126
                goto error;
 
127
        }
 
128
 
 
129
        /* Get Location */
 
130
        str = g_key_file_get_string (plugin_file, PLUGIN_GROUP, "Module", NULL);
 
131
 
 
132
        if ((str != NULL) && (*str != '\0')) {
 
133
                info->location = str;
 
134
        } else {
 
135
                g_warning ("Could not find 'Module' in %s", file);
 
136
                goto error;
 
137
        }
 
138
 
 
139
        /* Get the loader for this plugin */
 
140
        str = g_key_file_get_string (plugin_file, PLUGIN_GROUP, "Loader", NULL);
 
141
        if (str && strcmp(str, "python") == 0) {
 
142
                info->loader = GNOME_SETTINGS_PLUGIN_LOADER_PY;
 
143
#ifndef ENABLE_PYTHON
 
144
                g_warning ("Cannot load Python plugin '%s' since gnome_settings was not "
 
145
                           "compiled with Python support.", file);
 
146
                goto error;
 
147
#endif
 
148
        } else {
 
149
                info->loader = GNOME_SETTINGS_PLUGIN_LOADER_C;
 
150
        }
 
151
        g_free (str);
 
152
 
 
153
        /* Get Name */
 
154
        str = g_key_file_get_locale_string (plugin_file, PLUGIN_GROUP, "Name", NULL, NULL);
 
155
        if (str) {
 
156
                info->name = str;
 
157
        } else {
 
158
                g_warning ("Could not find 'Name' in %s", file);
 
159
                goto error;
 
160
        }
 
161
 
 
162
        /* Get Description */
 
163
        str = g_key_file_get_locale_string (plugin_file, PLUGIN_GROUP, "Description", NULL, NULL);
 
164
        if (str)
 
165
                info->desc = str;
 
166
        else
 
167
                g_debug ("Could not find 'Description' in %s", file);
 
168
 
 
169
        /* Get Authors */
 
170
        info->authors = g_key_file_get_string_list (plugin_file, PLUGIN_GROUP, "Authors", NULL, NULL);
 
171
        if (info->authors == NULL)
 
172
                g_debug ("Could not find 'Authors' in %s", file);
 
173
 
 
174
        /* Get Copyright */
 
175
        str = g_key_file_get_string (plugin_file, PLUGIN_GROUP, "Copyright", NULL);
 
176
        if (str)
 
177
                info->copyright = str;
 
178
        else
 
179
                g_debug ("Could not find 'Copyright' in %s", file);
 
180
 
 
181
        /* Get Website */
 
182
        str = g_key_file_get_string (plugin_file, PLUGIN_GROUP, "Website", NULL);
 
183
        if (str)
 
184
                info->website = str;
 
185
        else
 
186
                g_debug ("Could not find 'Website' in %s", file);
 
187
 
 
188
        g_key_file_free (plugin_file);
 
189
 
 
190
        /* If we know nothing about the availability of the plugin,
 
191
           set it as available */
 
192
        info->available = TRUE;
 
193
 
 
194
        return info;
 
195
 
 
196
error:
 
197
        g_free (info->file);
 
198
        g_free (info->location);
 
199
        g_free (info->name);
 
200
        g_free (info);
 
201
        g_key_file_free (plugin_file);
 
202
 
 
203
        return NULL;
 
204
}
 
205
 
 
206
static void
 
207
gnome_settings_plugins_engine_plugin_active_cb (GConfClient           *client,
 
208
                                              guint                  cnxn_id,
 
209
                                              GConfEntry            *entry,
 
210
                                              GnomeSettingsPluginInfo *info)
 
211
{
 
212
        if (gconf_value_get_bool (entry->value)) {
 
213
                gnome_settings_plugins_engine_activate_plugin (info);
 
214
        } else {
 
215
                gnome_settings_plugins_engine_deactivate_plugin (info);
 
216
        }
 
217
}
 
218
 
 
219
static void
 
220
gnome_settings_plugins_engine_load_file (const char *filename)
 
221
{
 
222
        GnomeSettingsPluginInfo *info;
 
223
        char                  *key_name;
 
224
        gboolean               activate;
 
225
 
 
226
        if (g_str_has_suffix (filename, PLUGIN_EXT) == FALSE) {
 
227
                return;
 
228
        }
 
229
 
 
230
        info = gnome_settings_plugins_engine_load (filename);
 
231
        if (info == NULL) {
 
232
                return;
 
233
        }
 
234
 
 
235
        if (g_hash_table_lookup (gnome_settings_plugins, info->location)) {
 
236
                gnome_settings_plugin_info_free (info);
 
237
                return;
 
238
        }
 
239
 
 
240
        g_hash_table_insert (gnome_settings_plugins, info->location, info);
 
241
 
 
242
        key_name = g_strdup_printf ("%s/%s", gnome_settings_gconf_prefix, info->location);
 
243
        gconf_client_add_dir (client, key_name, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
 
244
        g_free (key_name);
 
245
 
 
246
        key_name = g_strdup_printf ("%s/%s/active", gnome_settings_gconf_prefix, info->location);
 
247
 
 
248
        info->active_notification_id = gconf_client_notify_add (client,
 
249
                                                                key_name,
 
250
                                                                (GConfClientNotifyFunc)gnome_settings_plugins_engine_plugin_active_cb,
 
251
                                                                info,
 
252
                                                                NULL,
 
253
                                                                NULL);
 
254
 
 
255
        g_debug ("Reading gconf key: %s", key_name);
 
256
        activate = gconf_client_get_bool (client, key_name, NULL);
 
257
        g_free (key_name);
 
258
 
 
259
        if (activate) {
 
260
                gboolean res;
 
261
                res = gnome_settings_plugins_engine_activate_plugin (info);
 
262
                if (res) {
 
263
                        g_debug ("Plugin %s: active", info->location);
 
264
                } else {
 
265
                        g_debug ("Plugin %s: activation failed", info->location);
 
266
                }
 
267
        } else {
 
268
                g_debug ("Plugin %s: inactive", info->location);
 
269
        }
 
270
}
 
271
 
 
272
static void
 
273
gnome_settings_plugins_engine_load_dir (const char *path)
 
274
{
 
275
        GError     *error;
 
276
        GDir       *d;
 
277
        const char *name;
 
278
 
 
279
        g_debug ("Loading settings plugins from dir: %s", path);
 
280
 
 
281
        error = NULL;
 
282
        d = g_dir_open (path, 0, &error);
 
283
        if (d == NULL) {
 
284
                g_warning (error->message);
 
285
                g_error_free (error);
 
286
                return;
 
287
        }
 
288
 
 
289
        while ((name = g_dir_read_name (d))) {
 
290
                char *filename;
 
291
 
 
292
                filename = g_build_filename (path, name, NULL);
 
293
                if (g_file_test (filename, G_FILE_TEST_IS_DIR) != FALSE) {
 
294
                        gnome_settings_plugins_engine_load_dir (filename);
 
295
                } else {
 
296
                        gnome_settings_plugins_engine_load_file (filename);
 
297
                }
 
298
                g_free (filename);
 
299
 
 
300
        }
 
301
 
 
302
        g_dir_close (d);
 
303
}
 
304
 
 
305
static void
 
306
gnome_settings_plugins_engine_load_all (void)
 
307
{
 
308
        /* load system plugins */
 
309
        gnome_settings_plugins_engine_load_dir (GNOME_SETTINGS_PLUGINDIR "/");
 
310
}
 
311
 
 
312
gboolean
 
313
gnome_settings_plugins_engine_init (const char *gconf_prefix)
 
314
{
 
315
        g_return_val_if_fail (gnome_settings_plugins == NULL, FALSE);
 
316
        g_return_val_if_fail (gconf_prefix != NULL, FALSE);
 
317
 
 
318
        if (!g_module_supported ()) {
 
319
                g_warning ("gnome_settings is not able to initialize the plugins engine.");
 
320
                return FALSE;
 
321
        }
 
322
 
 
323
        gnome_settings_plugins = g_hash_table_new_full (g_str_hash,
 
324
                                                      g_str_equal,
 
325
                                                      NULL,
 
326
                                                      (GDestroyNotify)gnome_settings_plugin_info_free);
 
327
 
 
328
        gnome_settings_gconf_prefix = g_strdup (gconf_prefix);
 
329
 
 
330
        client = gconf_client_get_default ();
 
331
 
 
332
        gnome_settings_plugins_engine_load_all ();
 
333
 
 
334
        return TRUE;
 
335
}
 
336
 
 
337
void
 
338
gnome_settings_plugins_engine_garbage_collect (void)
 
339
{
 
340
#ifdef ENABLE_PYTHON
 
341
        gnome_settings_python_garbage_collect ();
 
342
#endif
 
343
}
 
344
 
 
345
void
 
346
gnome_settings_plugins_engine_shutdown (void)
 
347
{
 
348
 
 
349
#ifdef ENABLE_PYTHON
 
350
        /* Note: that this may cause finalization of objects by
 
351
         * running the garbage collector. Since some of the plugin may
 
352
         * have installed callbacks upon object finalization it must
 
353
         * run before we get rid of the plugins.
 
354
         */
 
355
        gnome_settings_python_shutdown ();
 
356
#endif
 
357
 
 
358
        if (gnome_settings_plugins != NULL) {
 
359
                g_hash_table_destroy (gnome_settings_plugins);
 
360
                gnome_settings_plugins = NULL;
 
361
        }
 
362
 
 
363
        if (client != NULL) {
 
364
                g_object_unref (client);
 
365
                client = NULL;
 
366
        }
 
367
 
 
368
        g_free (gnome_settings_gconf_prefix);
 
369
        gnome_settings_gconf_prefix = NULL;
 
370
}
 
371
 
 
372
static void
 
373
collate_values_cb (gpointer key,
 
374
                   gpointer value,
 
375
                   GList  **list)
 
376
{
 
377
        *list = g_list_prepend (*list, value);
 
378
}
 
379
 
 
380
const GList *
 
381
gnome_settings_plugins_engine_get_plugins_list (void)
 
382
{
 
383
        GList *list = NULL;
 
384
 
 
385
        if (gnome_settings_plugins == NULL) {
 
386
                return NULL;
 
387
        }
 
388
 
 
389
        g_hash_table_foreach (gnome_settings_plugins, (GHFunc)collate_values_cb, &list);
 
390
        list = g_list_reverse (list);
 
391
 
 
392
        return list;
 
393
}
 
394
 
 
395
static gboolean
 
396
load_plugin_module (GnomeSettingsPluginInfo *info)
 
397
{
 
398
        char *path;
 
399
        char *dirname;
 
400
 
 
401
        g_return_val_if_fail (info != NULL, FALSE);
 
402
        g_return_val_if_fail (info->file != NULL, FALSE);
 
403
        g_return_val_if_fail (info->location != NULL, FALSE);
 
404
        g_return_val_if_fail (info->plugin == NULL, FALSE);
 
405
        g_return_val_if_fail (info->available, FALSE);
 
406
 
 
407
        switch (info->loader) {
 
408
                case GNOME_SETTINGS_PLUGIN_LOADER_C:
 
409
                        dirname = g_path_get_dirname (info->file);
 
410
                        g_return_val_if_fail (dirname != NULL, FALSE);
 
411
 
 
412
                        path = g_module_build_path (dirname, info->location);
 
413
                        g_free (dirname);
 
414
                        g_return_val_if_fail (path != NULL, FALSE);
 
415
 
 
416
                        info->module = G_TYPE_MODULE (gnome_settings_module_new (path));
 
417
                        g_free (path);
 
418
 
 
419
                        break;
 
420
 
 
421
#ifdef ENABLE_PYTHON
 
422
                case GNOME_SETTINGS_PLUGIN_LOADER_PY:
 
423
                {
 
424
                        char *dir;
 
425
 
 
426
                        if (!gnome_settings_python_init ()) {
 
427
                                /* Mark plugin as unavailable and fails */
 
428
                                info->available = FALSE;
 
429
 
 
430
                                g_warning ("Cannot load Python plugin '%s' since gnome_settings "
 
431
                                           "was not able to initialize the Python interpreter.",
 
432
                                           info->name);
 
433
 
 
434
                                return FALSE;
 
435
                        }
 
436
 
 
437
                        dir = g_path_get_dirname (info->file);
 
438
 
 
439
                        g_return_val_if_fail ((info->location != NULL) &&
 
440
                                              (info->location[0] != '\0'),
 
441
                                              FALSE);
 
442
 
 
443
                        info->module = G_TYPE_MODULE (
 
444
                                        gnome_settings_python_module_new (dir, info->location));
 
445
 
 
446
                        g_free (dir);
 
447
                        break;
 
448
                }
 
449
#endif
 
450
                default:
 
451
                        g_return_val_if_reached (FALSE);
 
452
        }
 
453
 
 
454
        if (!g_type_module_use (info->module)) {
 
455
                switch (info->loader) {
 
456
                        case GNOME_SETTINGS_PLUGIN_LOADER_C:
 
457
                                g_warning ("Cannot load plugin '%s' since file '%s' cannot be read.",
 
458
                                           info->name,
 
459
                                           gnome_settings_module_get_path (GNOME_SETTINGS_MODULE (info->module)));
 
460
                                break;
 
461
 
 
462
                        case GNOME_SETTINGS_PLUGIN_LOADER_PY:
 
463
                                g_warning ("Cannot load Python plugin '%s' since file '%s' cannot be read.",
 
464
                                           info->name,
 
465
                                           info->location);
 
466
                                break;
 
467
 
 
468
                        default:
 
469
                                g_return_val_if_reached (FALSE);
 
470
                }
 
471
 
 
472
                g_object_unref (G_OBJECT (info->module));
 
473
                info->module = NULL;
 
474
 
 
475
                /* Mark plugin as unavailable and fails */
 
476
                info->available = FALSE;
 
477
 
 
478
                return FALSE;
 
479
        }
 
480
 
 
481
        switch (info->loader) {
 
482
                case GNOME_SETTINGS_PLUGIN_LOADER_C:
 
483
                        info->plugin =
 
484
                                GNOME_SETTINGS_PLUGIN (gnome_settings_module_new_object (GNOME_SETTINGS_MODULE (info->module)));
 
485
                        break;
 
486
 
 
487
#ifdef ENABLE_PYTHON
 
488
                case GNOME_SETTINGS_PLUGIN_LOADER_PY:
 
489
                        info->plugin =
 
490
                                GNOME_SETTINGS_PLUGIN (gnome_settings_python_module_new_object (GNOME_SETTINGS_PYTHON_MODULE (info->module)));
 
491
                        break;
 
492
#endif
 
493
 
 
494
                default:
 
495
                        g_return_val_if_reached (FALSE);
 
496
        }
 
497
 
 
498
        g_type_module_unuse (info->module);
 
499
 
 
500
        return TRUE;
 
501
}
 
502
 
 
503
static gboolean
 
504
gnome_settings_plugins_engine_activate_plugin_real (GnomeSettingsPluginInfo *info)
 
505
{
 
506
        gboolean res = TRUE;
 
507
 
 
508
        if (!info->available) {
 
509
                /* Plugin is not available, don't try to activate/load it */
 
510
                return FALSE;
 
511
        }
 
512
 
 
513
        if (info->plugin == NULL)
 
514
                res = load_plugin_module (info);
 
515
 
 
516
        if (res) {
 
517
                gnome_settings_plugin_activate (info->plugin);
 
518
        } else {
 
519
                g_warning ("Error activating plugin '%s'", info->name);
 
520
        }
 
521
 
 
522
        return res;
 
523
}
 
524
 
 
525
gboolean
 
526
gnome_settings_plugins_engine_activate_plugin (GnomeSettingsPluginInfo *info)
 
527
{
 
528
 
 
529
        g_return_val_if_fail (info != NULL, FALSE);
 
530
 
 
531
        if (! info->available) {
 
532
                return FALSE;
 
533
        }
 
534
 
 
535
        if (info->active) {
 
536
                return TRUE;
 
537
        }
 
538
 
 
539
        if (gnome_settings_plugins_engine_activate_plugin_real (info)) {
 
540
                char *key_name;
 
541
 
 
542
                key_name = g_strdup_printf ("/%s/%s/active",
 
543
                                            gnome_settings_gconf_prefix,
 
544
                                            info->location);
 
545
                gconf_client_set_bool (client, key_name, TRUE, NULL);
 
546
                g_free (key_name);
 
547
 
 
548
                info->active = TRUE;
 
549
 
 
550
                return TRUE;
 
551
        }
 
552
 
 
553
        return FALSE;
 
554
}
 
555
 
 
556
static void
 
557
gnome_settings_plugins_engine_deactivate_plugin_real (GnomeSettingsPluginInfo *info)
 
558
{
 
559
        gnome_settings_plugin_deactivate (info->plugin);
 
560
}
 
561
 
 
562
gboolean
 
563
gnome_settings_plugins_engine_deactivate_plugin (GnomeSettingsPluginInfo *info)
 
564
{
 
565
        char *key_name;
 
566
 
 
567
        g_return_val_if_fail (info != NULL, FALSE);
 
568
 
 
569
        if (!info->active || !info->available) {
 
570
                return TRUE;
 
571
        }
 
572
 
 
573
        gnome_settings_plugins_engine_deactivate_plugin_real (info);
 
574
 
 
575
        /* Update plugin state */
 
576
        info->active = FALSE;
 
577
 
 
578
        key_name = g_strdup_printf ("/%s/%s/active",
 
579
                                    gnome_settings_gconf_prefix,
 
580
                                    info->location);
 
581
        gconf_client_set_bool (client, key_name, FALSE, NULL);
 
582
        g_free (key_name);
 
583
 
 
584
        return TRUE;
 
585
}
 
586
 
 
587
gboolean
 
588
gnome_settings_plugins_engine_plugin_is_active (GnomeSettingsPluginInfo *info)
 
589
{
 
590
        g_return_val_if_fail (info != NULL, FALSE);
 
591
 
 
592
        return (info->available && info->active);
 
593
}
 
594
 
 
595
gboolean
 
596
gnome_settings_plugins_engine_plugin_is_available (GnomeSettingsPluginInfo *info)
 
597
{
 
598
        g_return_val_if_fail (info != NULL, FALSE);
 
599
 
 
600
        return (info->available != FALSE);
 
601
}
 
602
 
 
603
const char *
 
604
gnome_settings_plugins_engine_get_plugin_name (GnomeSettingsPluginInfo *info)
 
605
{
 
606
        g_return_val_if_fail (info != NULL, NULL);
 
607
 
 
608
        return info->name;
 
609
}
 
610
 
 
611
const char *
 
612
gnome_settings_plugins_engine_get_plugin_description (GnomeSettingsPluginInfo *info)
 
613
{
 
614
        g_return_val_if_fail (info != NULL, NULL);
 
615
 
 
616
        return info->desc;
 
617
}
 
618
 
 
619
const char **
 
620
gnome_settings_plugins_engine_get_plugin_authors (GnomeSettingsPluginInfo *info)
 
621
{
 
622
        g_return_val_if_fail (info != NULL, (const char **)NULL);
 
623
 
 
624
        return (const char **)info->authors;
 
625
}
 
626
 
 
627
const char *
 
628
gnome_settings_plugins_engine_get_plugin_website (GnomeSettingsPluginInfo *info)
 
629
{
 
630
        g_return_val_if_fail (info != NULL, NULL);
 
631
 
 
632
        return info->website;
 
633
}
 
634
 
 
635
const char *
 
636
gnome_settings_plugins_engine_get_plugin_copyright (GnomeSettingsPluginInfo *info)
 
637
{
 
638
        g_return_val_if_fail (info != NULL, NULL);
 
639
 
 
640
        return info->copyright;
 
641
}