-rw-r--r-- | .gitignore | 10 | ||||
-rw-r--r-- | README | 29 | ||||
-rw-r--r-- | configure.ac | 28 | ||||
-rw-r--r-- | src/Makefile.am | 19 | ||||
-rw-r--r-- | src/controller/callbacks/keyboard.c | 8 | ||||
-rw-r--r-- | src/model/state/state.h | 5 | ||||
-rw-r--r-- | src/plugin/README_plugin.txt | 5 | ||||
-rw-r--r-- | src/plugin/install.rdf | 2 | ||||
-rwxr-xr-x | src/plugin/make_xpi.sh | 18 | ||||
-rw-r--r-- | src/plugin/plugin.c | 40 | ||||
-rw-r--r-- | src/plugin/plugin.h | 2 | ||||
-rw-r--r-- | src/plugin/test.html | 6 | ||||
-rw-r--r-- | src/view/geometry.c | 6 | ||||
-rw-r--r-- | src/view/init.c | 1 | ||||
-rw-r--r-- | test/ParaView/explore.pvsm | 4896 | ||||
-rw-r--r-- | test/ParaView/proteins_by_year.csv | 106810 | ||||
-rw-r--r-- | test/ParaView/proteins_by_year.sql | 19 | ||||
-rw-r--r-- | test/explore-time.mw | 358 |
18 files changed, 112222 insertions, 40 deletions
diff --git a/src/plugin/plugin.c b/src/plugin/plugin.c index 300e2f3..ac8db93 100644 --- a/src/plugin/plugin.c +++ b/src/plugin/plugin.c @@ -1,13 +1,16 @@ #include "plugin.h" +#include "../view/view.h" #include <stdlib.h> #include <string.h> #include <stdio.h> +#include <pthread.h> +#include <GL/glut.h> /* * This code is based on the Basic Plugin Example from Mozilla on-line * at - * http://mxr.mozilla.org/mozilla-central/source/modules/plugin/sdk/samples/basic/unix/BasicPlugin.c. + * http://mxr.mozilla.org/mozilla-central/source/modules/plugin/sdk/samples/basic/unix/BasicPlugin.c */ #define PLUGIN_NAME "Influenza Sequence Mapping Project Visualization Tool" @@ -22,6 +25,15 @@ typedef struct InstanceData NPWindow window; } InstanceData; +static void* +tool_thread (void *threadid) +{ + view (); + glutMainLoop (); + + return (void*) 0; +} + static void fillPluginFunctionTable (NPPluginFuncs* pFuncs) { @@ -44,9 +56,14 @@ fillPluginFunctionTable (NPPluginFuncs* pFuncs) return; } -NP_EXPORT(NPError) +NPError NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs) { + int argc = 1; + char *argv[] = {"MyApp", NULL}; + glutInit (&argc, argv); + glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); + sBrowserFuncs = bFuncs; fillPluginFunctionTable(pFuncs); @@ -54,19 +71,19 @@ NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs) return NPERR_NO_ERROR; } -NP_EXPORT(char*) +char* NP_GetPluginVersion() { return PLUGIN_VERSION; } -NP_EXPORT(char*) +char* NP_GetMIMEDescription() { - return "application/x-flumap::Visualization Tool"; + return "application/x-donpellegrino-flumap::Visualization Tool"; } -NP_EXPORT(NPError) +NPError NP_GetValue(void* future, NPPVariable aVariable, void* aValue) { switch (aVariable) @@ -85,7 +102,7 @@ NP_GetValue(void* future, NPPVariable aVariable, void* aValue) return NPERR_NO_ERROR; } -NP_EXPORT(NPError) +NPError NP_Shutdown() { return NPERR_NO_ERROR; @@ -111,6 +128,13 @@ NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* memset(instanceData, 0, sizeof(InstanceData)); instanceData->npp = instance; instance->pdata = instanceData; + + pthread_t threads; + static long tid = 0; + tid++; + pthread_create (&threads, NULL, + tool_thread, + (void*)tid); return NPERR_NO_ERROR; } @@ -175,8 +199,6 @@ NPP_HandleEvent(NPP instance, void* event) // if (nativeEvent->type != GraphicsExpose) //return 0; - printf ("In NPP_HandleEvent for the plugin.\n"); - return 1; } |