summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2011-02-16 18:24:36 -0800
committerDan Nicholson <dbn.lists@gmail.com>2011-02-18 09:09:38 -0800
commit8e1ac838c4f72d48f6ab8181ee0391a2b094e28a (patch)
tree5d67daffccb6b1240b7eb2300c2834da4a0a0c5d
parent9c35739beb1bccbc46a25677ca5a24a212c10394 (diff)
plugin: Initialize and destroy previewer
Still not doing anything useful, but now the widget is wired up and the backends are enabled.
-rw-r--r--plugin/evbp.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/plugin/evbp.c b/plugin/evbp.c
index 5112e00..24123b0 100644
--- a/plugin/evbp.c
+++ b/plugin/evbp.c
@@ -45,12 +45,18 @@ evbp_new(NPMIMEType pluginType, NPP instance, uint16_t mode,
priv->npp = instance;
instance->pdata = priv;
+ /* create new previewer */
+ priv->pview = ev_previewer_new();
+
return NPERR_NO_ERROR;
}
static NPError
evbp_destroy(NPP instance, NPSavedData** save)
{
+ evbp_priv_t *priv = instance->pdata;
+
+ g_object_unref(priv->pview);
npn_funcs->memfree(instance->pdata);
instance->pdata = NULL;
@@ -190,6 +196,21 @@ NP_Initialize(NPNetscapeFuncs *nfuncs, NPPluginFuncs *pfuncs)
if (ret != NPERR_NO_ERROR)
return ret;
+ /* Initialize gtk */
+ gtk_init(NULL, NULL);
+
+#ifdef ENABLE_NLS
+ /* Initialize the i18n stuff */
+ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+#endif
+
+ /* Initialize evince */
+ if (!ev_init())
+ return NPERR_MODULE_LOAD_FAILED_ERROR;
+ ev_stock_icons_init();
+
return NPERR_NO_ERROR;
}
@@ -224,7 +245,8 @@ NP_Shutdown(void)
}
npn_funcs = NULL;
- ev_shutdown ();
+ ev_shutdown();
+ ev_stock_icons_shutdown();
return NPERR_NO_ERROR;
}