summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@coffee.donpellegrino.com>2009-12-04 15:00:22 (GMT)
committer Don Pellegrino <don@coffee.donpellegrino.com>2009-12-04 15:00:22 (GMT)
commit6fd1026bde72c666fc40dd5ea0d9dbb4f2c1117c (patch) (side-by-side diff)
treeb0d3149ccad552fca152dbfa8b4d329b8caa49df
parentd9809d43889684a88643740214d24bcddf4cbc62 (diff)
downloadexp005-6fd1026bde72c666fc40dd5ea0d9dbb4f2c1117c.zip
exp005-6fd1026bde72c666fc40dd5ea0d9dbb4f2c1117c.tar.gz
exp005-6fd1026bde72c666fc40dd5ea0d9dbb4f2c1117c.tar.bz2
Removed NP_EXPORT references as it seems to be no longer defined.
-rw-r--r--src/plugin/plugin.c40
1 files changed, 31 insertions, 9 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;
}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.