2008-02-11 Johannes Schmid <jhs@gnome.org>
[anjuta-git-plugin.git] / plugins / gvim / plugin.c
bloba831ee67eba5aaec6d9e1b6cd7689a1b6272908a
1 /*
2 * Copyright (c) Naba Kumar <naba@gnome.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Library General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #include <config.h>
20 #include <libgnomevfs/gnome-vfs-utils.h>
21 #include <libanjuta/anjuta-shell.h>
22 #include <libanjuta/anjuta-debug.h>
23 #include <libanjuta/anjuta-plugin.h>
24 #include <libanjuta/interfaces/ianjuta-editor-factory.h>
26 #include "plugin.h"
27 #include "anjuta-vim.h"
29 static gpointer parent_class;
31 static gboolean anjuta_vim_plugin_activate (AnjutaPlugin *plugin);
32 static gboolean anjuta_vim_plugin_deactivate (AnjutaPlugin *plugin);
33 static void anjuta_vim_plugin_instance_init (GObject *obj);
34 static void anjuta_vim_plugin_class_init (GObjectClass *klass);
36 static gboolean
37 anjuta_vim_plugin_activate (AnjutaPlugin *plugin)
39 DEBUG_PRINT ("AnjutaVimPlugin: Activating Vim plugin...");
40 return TRUE;
44 static gboolean
45 anjuta_vim_plugin_deactivate (AnjutaPlugin *plugin)
47 DEBUG_PRINT ("AnjutaVimPlugin: Dectivating Vim plugin ...");
48 return TRUE;
51 static void
52 anjuta_vim_plugin_finalize (GObject *obj)
54 GNOME_CALL_PARENT (G_OBJECT_CLASS, finalize, (obj));
58 static void
59 anjuta_vim_plugin_dispose (GObject *obj)
61 GNOME_CALL_PARENT (G_OBJECT_CLASS, dispose, (obj));
64 static void
65 anjuta_vim_plugin_instance_init (GObject *obj)
69 static void
70 anjuta_vim_plugin_class_init (GObjectClass *klass)
72 AnjutaPluginClass *plugin_class = ANJUTA_PLUGIN_CLASS (klass);
74 parent_class = g_type_class_peek_parent (klass);
76 plugin_class->activate = anjuta_vim_plugin_activate;
77 plugin_class->deactivate = anjuta_vim_plugin_deactivate;
78 klass->dispose = anjuta_vim_plugin_dispose;
79 klass->finalize = anjuta_vim_plugin_finalize;
82 static IAnjutaEditor*
83 ieditor_factory_new_editor(IAnjutaEditorFactory* factory,
84 const gchar* uri,
85 const gchar* filename,
86 GError** error)
88 AnjutaPlugin* plugin = ANJUTA_PLUGIN(factory);
89 IAnjutaEditor* editor = IANJUTA_EDITOR(anjuta_vim_new (uri, filename,
90 plugin));
91 return editor;
94 static void
95 ieditor_factory_iface_init (IAnjutaEditorFactoryIface *iface)
97 iface->new_editor = ieditor_factory_new_editor;
100 ANJUTA_PLUGIN_BEGIN (AnjutaVimPlugin, anjuta_vim_plugin);
101 ANJUTA_TYPE_ADD_INTERFACE(ieditor_factory, IANJUTA_TYPE_EDITOR_FACTORY);
102 ANJUTA_PLUGIN_END;
104 ANJUTA_SIMPLE_PLUGIN (AnjutaVimPlugin, anjuta_vim_plugin);