In progress...
This commit is contained in:
parent
eedd116dba
commit
a42429896e
100
src/main.vala
100
src/main.vala
|
@ -2,60 +2,62 @@ using LAview, Core, Plugins, GObject.Plugins;
|
|||
|
||||
extern const string GETTEXT_PACKAGE;
|
||||
|
||||
/**
|
||||
* Plugin of type A1.
|
||||
*/
|
||||
public class PluginObjectExample : PluginObject {
|
||||
|
||||
namespace LAview.Core.Plugins {
|
||||
/**
|
||||
* Constructs a new ``PluginObjectExample``.
|
||||
* Plugin of type A1.
|
||||
*/
|
||||
construct {
|
||||
stdout.puts ("PluginObjectExample init () called\n");
|
||||
}
|
||||
public class PluginObjectExample : PluginObject {
|
||||
|
||||
/**
|
||||
* Destroys the ``PluginObjectExample``.
|
||||
*/
|
||||
~PluginObjectExample () {
|
||||
stdout.puts ("PluginObjectExample deinit () called\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a name of the plugin.
|
||||
*/
|
||||
public override string get_name () {
|
||||
return "ProtObjEx";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets readable name of the plugin.
|
||||
*/
|
||||
public override string get_readable_name () {
|
||||
stdout.puts ("PluginObjectExample.get_readable_name () called\n");
|
||||
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");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
/**
|
||||
* Constructs a new ``PluginObjectExample``.
|
||||
*/
|
||||
construct {
|
||||
stdout.puts ("PluginObjectExample init () called\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the ``PluginObjectExample``.
|
||||
*/
|
||||
~PluginObjectExample () {
|
||||
stdout.puts ("PluginObjectExample deinit () called\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a name of the plugin.
|
||||
*/
|
||||
public override string get_name () {
|
||||
return "ProtObjEx";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets readable name of the plugin.
|
||||
*/
|
||||
public override string get_readable_name () {
|
||||
stdout.puts ("PluginObjectExample.get_readable_name () called\n");
|
||||
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");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
return typeof (PluginObjectExample);
|
||||
[ModuleInit]
|
||||
Type plugin_init (GLib.TypeModule type_module) {
|
||||
return typeof (PluginObjectExample);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue