awesome new plugin for everything. 'text' creates an item for the text you type (=
authorHannes Janetzek <hannes.janetzek@gmail.com>
Tue, 2 Feb 2010 16:06:42 +0000 (16:06 +0000)
committerHannes Janetzek <hannes.janetzek@gmail.com>
Tue, 2 Feb 2010 16:06:42 +0000 (16:06 +0000)
SVN revision: 45807

src/modules/everything/sources/Makefile.am
src/modules/everything/sources/evry_plug_text.c [new file with mode: 0644]

index 4a80ddfd667f0ab272a55d775953148d5758178e..a64e5a58818490e4b805745d6ac74f472aee80a6 100644 (file)
@@ -62,4 +62,11 @@ evry_plug_aspell_la_LIBADD       = @e_libs@  ../libfoo.la
 evry_plug_aspell_la_LDFLAGS      = -no-undefined -module -avoid-version
 evry_plug_aspell_la_LIBTOOLFLAGS = --tag=disable-static
 
+evry_plug_textdir = $(plugindir)
+evry_plug_text_LTLIBRARIES = evry_plug_text.la
+evry_plug_text_la_SOURCES =  evry_plug_text.c
+evry_plug_text_la_LIBADD       = @e_libs@  ../libfoo.la
+evry_plug_text_la_LDFLAGS      = -no-undefined -module -avoid-version
+evry_plug_text_la_LIBTOOLFLAGS = --tag=disable-static
+
 
diff --git a/src/modules/everything/sources/evry_plug_text.c b/src/modules/everything/sources/evry_plug_text.c
new file mode 100644 (file)
index 0000000..9b23833
--- /dev/null
@@ -0,0 +1,52 @@
+#include "Evry.h"
+
+static Evry_Plugin *p1;
+static Evry_Plugin *p2;
+
+
+
+static void
+_cleanup(Evry_Plugin *p)
+{
+   EVRY_PLUGIN_ITEMS_FREE(p);
+}
+
+static int
+_fetch(Evry_Plugin *p, const char *input)
+{
+   Evry_Item *it;
+
+   EVRY_PLUGIN_ITEMS_FREE(p);
+   
+   it = evry_item_new(NULL, p, input, NULL);
+
+   EVRY_PLUGIN_ITEM_APPEND(p, it);
+
+   return 1;
+}
+
+static Eina_Bool
+_init(void)
+{
+   p1 = evry_plugin_new(NULL, "Text", type_subject, NULL, "TEXT", 1, "accessories-editor", NULL,
+                       NULL, _cleanup, _fetch, NULL, NULL, NULL, NULL);
+
+   p2 = evry_plugin_new(NULL, "Text", type_object, NULL, "TEXT", 1, "accessories-editor", NULL,
+                       NULL, _cleanup, _fetch, NULL, NULL, NULL, NULL);
+
+   evry_plugin_register(p1, 10);
+   evry_plugin_register(p2, 10);
+
+   return EINA_TRUE;
+}
+
+static void
+_shutdown(void)
+{
+   EVRY_PLUGIN_FREE(p1);
+   EVRY_PLUGIN_FREE(p2);
+}
+
+
+EINA_MODULE_INIT(_init);
+EINA_MODULE_SHUTDOWN(_shutdown);