In progress...

This commit is contained in:
Kolan Sh 2016-04-03 16:59:44 +03:00
parent eedd116dba
commit a42429896e

View File

@ -2,60 +2,62 @@ using LAview, Core, Plugins, GObject.Plugins;
extern const string GETTEXT_PACKAGE; extern const string GETTEXT_PACKAGE;
/** namespace LAview.Core.Plugins {
* Plugin of type A1.
*/
public class PluginObjectExample : PluginObject {
/** /**
* Constructs a new ``PluginObjectExample``. * Plugin of type A1.
*/ */
construct { public class PluginObjectExample : PluginObject {
stdout.puts ("PluginObjectExample init () called\n");
}
/** /**
* Destroys the ``PluginObjectExample``. * Constructs a new ``PluginObjectExample``.
*/ */
~PluginObjectExample () { construct {
stdout.puts ("PluginObjectExample deinit () called\n"); stdout.puts ("PluginObjectExample init () called\n");
} }
/** /**
* Gets a name of the plugin. * Destroys the ``PluginObjectExample``.
*/ */
public override string get_name () { ~PluginObjectExample () {
return "ProtObjEx"; stdout.puts ("PluginObjectExample deinit () called\n");
} }
/** /**
* Gets readable name of the plugin. * Gets a name of the plugin.
*/ */
public override string get_readable_name () { public override string get_name () {
stdout.puts ("PluginObjectExample.get_readable_name () called\n"); return "ProtObjEx";
stdout.puts ("Call IHostCore.get_cache_dir () from PluginObjectExample:\n "); }
var cache_dir = (host as IHostCore).get_cache_dir ();
stdout.printf ("cache dir = %s\n", cache_dir); /**
return _("Protocol Object Example"); * Gets readable name of the plugin.
} */
public override string get_readable_name () {
/** stdout.puts ("PluginObjectExample.get_readable_name () called\n");
* Compose the object. stdout.puts ("Call IHostCore.get_cache_dir () from PluginObjectExample:\n ");
*/ var cache_dir = (host as IHostCore).get_cache_dir ();
public override bool compose (Gee.HashMap<string, AnswerValue> answers) throws Error { stdout.printf ("cache dir = %s\n", cache_dir);
PluginDataExample data_obj_ex = (host as IHostCore).get_data_object ("DataExample") as PluginDataExample; return _("Protocol Object Example");
stdout.puts ("Compose() called\n"); }
foreach (var a in answers.entries) {
stdout.printf ("%s ", a.key); /**
* Compose the object.
*/
public override bool compose (Gee.HashMap<string, AnswerValue> answers) throws Error {
PluginDataExample data_obj_ex = (host as IHostCore).get_data_object ("DataExample") as PluginDataExample;
stdout.puts ("Compose() called\n");
foreach (var a in answers.entries) {
stdout.printf ("%s ", a.key);
}
stdout.putc ('\n');
return true;
} }
stdout.putc ('\n');
return true;
} }
} [ModuleInit]
Type plugin_init (GLib.TypeModule type_module) {
[ModuleInit] return typeof (PluginObjectExample);
Type plugin_init (GLib.TypeModule type_module) { }
return typeof (PluginObjectExample);
} }