| 1 |
/* |
| 2 |
* configurable-plugin.c |
| 3 |
* This file is part of libpeas |
| 4 |
* |
| 5 |
* Copyright (C) 2010 - Garrett Regier |
| 6 |
* |
| 7 |
* libpeas is free software; you can redistribute it and/or |
| 8 |
* modify it under the terms of the GNU Lesser General Public |
| 9 |
* License as published by the Free Software Foundation; either |
| 10 |
* version 2.1 of the License, or (at your option) any later version. |
| 11 |
* |
| 12 |
* libpeas is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
* Lesser General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU Lesser General Public |
| 18 |
* License along with this library; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifdef HAVE_CONFIG_H |
| 23 |
#include <config.h> |
| 24 |
#endif |
| 25 |
|
| 26 |
#include <glib.h> |
| 27 |
#include <glib-object.h> |
| 28 |
#include <gmodule.h> |
| 29 |
|
| 30 |
#include <libpeas/peas.h> |
| 31 |
#include <libpeas-gtk/peas-gtk.h> |
| 32 |
|
| 33 |
#include "configurable-plugin.h" |
| 34 |
|
| 35 |
static void peas_gtk_configurable_iface_init (PeasGtkConfigurableInterface *iface); |
| 36 |
|
| 37 |
G_DEFINE_DYNAMIC_TYPE_EXTENDED (TestingConfigurablePlugin, |
| 38 |
testing_configurable_plugin, |
| 39 |
PEAS_TYPE_EXTENSION_BASE, |
| 40 |
0, |
| 41 |
G_IMPLEMENT_INTERFACE_DYNAMIC (PEAS_GTK_TYPE_CONFIGURABLE, |
| 42 |
peas_gtk_configurable_iface_init)) |
| 43 |
|
| 44 |
static void |
| 45 |
testing_configurable_plugin_init (TestingConfigurablePlugin *configurable) |
| 46 |
{ |
| 47 |
} |
| 48 |
|
| 49 |
static void |
| 50 |
testing_configurable_plugin_class_init (TestingConfigurablePluginClass *klass) |
| 51 |
{ |
| 52 |
} |
| 53 |
|
| 54 |
static GtkWidget * |
| 55 |
testing_configurable_plugin_create_configure_widget (PeasGtkConfigurable *configurable) |
| 56 |
{ |
| 57 |
return gtk_label_new ("Hello, World!"); |
| 58 |
} |
| 59 |
|
| 60 |
static void |
| 61 |
peas_gtk_configurable_iface_init (PeasGtkConfigurableInterface *iface) |
| 62 |
{ |
| 63 |
iface->create_configure_widget = testing_configurable_plugin_create_configure_widget; |
| 64 |
} |
| 65 |
|
| 66 |
static void |
| 67 |
testing_configurable_plugin_class_finalize (TestingConfigurablePluginClass *klass) |
| 68 |
{ |
| 69 |
} |
| 70 |
|
| 71 |
G_MODULE_EXPORT void |
| 72 |
peas_register_types (PeasObjectModule *module) |
| 73 |
{ |
| 74 |
testing_configurable_plugin_register_type (G_TYPE_MODULE (module)); |
| 75 |
|
| 76 |
peas_object_module_register_extension_type (module, |
| 77 |
PEAS_GTK_TYPE_CONFIGURABLE, |
| 78 |
TESTING_TYPE_CONFIGURABLE_PLUGIN); |
| 79 |
} |