From 7505cd8f7c7298f6db1dc1ad665b082810234944 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Sun, 11 Apr 2010 15:01:11 +0800 Subject: add gobject interface for lua-plugin. --- lua/lua-plugin.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 lua/lua-plugin.c (limited to 'lua/lua-plugin.c') diff --git a/lua/lua-plugin.c b/lua/lua-plugin.c new file mode 100644 index 0000000..db8aa43 --- /dev/null +++ b/lua/lua-plugin.c @@ -0,0 +1,50 @@ +#include + +#include "lua-plugin.h" + +#define IBUS_ENGINE_PLUGIN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), IBUS_TYPE_ENGINE_PLUGIN, IBusEnginePluginPrivate)) + +G_DEFINE_TYPE (IBusEnginePlugin, ibus_engine_plugin, G_TYPE_OBJECT); + +static void +ibus_engine_plugin_dispose (GObject *gobject) +{ + IBusEnginePlugin *self = IBUS_ENGINE_PLUGIN (gobject); + + /* do some cleaning here. */ + + /* Chain up to the parent class */ + G_OBJECT_CLASS (ibus_engine_plugin_parent_class)->dispose(gobject); +} + +static void +ibus_engine_plugin_finalize (GObject *gobject) +{ + IBusEnginePlugin *self = IBUS_ENGINE_PLUGIN (gobject); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (ibus_engine_plugin_parent_class)->dispose(gobject); +} + +static void +ibus_engine_plugin_class_init (IBusEnginePluginClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->dispose = ibus_engine_plugin_dispose; + gobject_class->finalize = ibus_engine_plugin_finalize; + + g_type_class_add_private (klass, sizeof (IBusEnginePluginPrivate)); +} + +static void +ibus_engine_plugin_init (IBusEnginePlugin *self) +{ + IBusEnginePluginPrivate *priv; + + self->priv = priv = IBUS_ENGINE_PLUGIN_GET_PRIVATE (self); + + priv->L = NULL; + priv->lua_commands = NULL; +} + -- cgit