summaryrefslogtreecommitdiff
path: root/nohtml/nohtml.cpp
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-04-25 15:34:26 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-04-25 15:34:26 +0000
commit50b715009438967fa9b37a62649db216ce8021b7 (patch)
treef2e16ff9e8297b213577d19e121a044532f15fcd /nohtml/nohtml.cpp
parenta44175dd565f39990ef57719313ef3a88a8d01b6 (diff)
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@145 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'nohtml/nohtml.cpp')
-rw-r--r--nohtml/nohtml.cpp104
1 files changed, 104 insertions, 0 deletions
diff --git a/nohtml/nohtml.cpp b/nohtml/nohtml.cpp
new file mode 100644
index 0000000..8cf58c6
--- /dev/null
+++ b/nohtml/nohtml.cpp
@@ -0,0 +1,104 @@
+/* Replace "dll.h" with the name of your header */
+#include "common.h"
+#include "version.h"
+#include "resource.h"
+#include "options.h"
+#include "filter.h"
+
+///////////////////////////////////////////////
+// Common Plugin Stuff
+///////////////////////////////////////////////
+HINSTANCE hInst;
+PLUGINLINK *pluginLink;
+
+PLUGININFOEX pluginInfo={
+ sizeof(PLUGININFOEX),
+ //META_PROTO,
+ __PLUGIN_NAME, // altered here and on file listing, so as not to match original
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESC,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ 0,
+ 0,
+ // TODO: generate your own GUID!!
+ { 0xD78C8249, 0xE8DB, 0x46B1, { 0x92, 0xF3, 0x88, 0xE6, 0xDC, 0x96, 0x4E, 0x8D } }
+};
+
+
+extern "C" BOOL APIENTRY DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) {
+ hInst=hinstDLL;
+ return TRUE;
+}
+
+extern "C" __declspec (dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) {
+ return &pluginInfo;
+}
+
+extern "C" __declspec (dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion) {
+ pluginInfo.cbSize = sizeof(PLUGININFO);
+ return (PLUGININFO*)&pluginInfo;
+}
+
+static const MUUID interfaces[] = {MIID_NOHTML, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+{
+ return interfaces;
+}
+
+int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
+ if(ServiceExists(MS_UPDATE_REGISTER)) {
+ // register with updater
+ Update update = {0};
+ char szVersion[16];
+
+ update.cbSize = sizeof(Update);
+
+ update.szComponentName = pluginInfo.shortName;
+ update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion);
+ update.cpbVersion = strlen((char *)update.pbVersion);
+
+ update.szUpdateURL = UPDATER_AUTOREGISTER;
+
+ // these are the three lines that matter - the archive, the page containing the version string, and the text (or data)
+ // before the version that we use to locate it on the page
+ // (note that if the update URL and the version URL point to standard file listing entries, the backend xml
+ // data will be used to check for updates rather than the actual web page - this is not true for beta urls)
+ update.szBetaUpdateURL = "http://www.scottellis.com.au/miranda_plugins/nohtml.zip";
+ update.szBetaVersionURL = "http://www.scottellis.com.au/miranda_plugins/ver_nohtml.html";
+ update.pbBetaVersionPrefix = (BYTE *)"No HTML version ";
+
+ update.cpbBetaVersionPrefix = strlen((char *)update.pbBetaVersionPrefix);
+
+ CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
+ }
+
+
+ return 0;
+}
+
+HANDLE hModulesLoaded;
+extern "C" __declspec (dllexport) int Load(PLUGINLINK *link) {
+ pluginLink=link;
+
+ InitOptions();
+
+ /////////////
+ ////// init filter
+ RegisterFilter();
+ AddFilterToContacts();
+
+ // hook modules loaded
+ hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
+ return 0;
+}
+
+extern "C" __declspec (dllexport) int Unload(void) {
+ UnhookEvent(hModulesLoaded);
+ DeinitFilter();
+ DeinitOptions();
+
+ return 0;
+}