From 308b14daa23b11367b677d24194f35cbb6a7dbec Mon Sep 17 00:00:00 2001 From: mataes2007 Date: Sat, 26 Nov 2011 12:49:09 +0000 Subject: updated KeyboardNotify git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@212 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- kbdnotify/KnowYourRights/knowyourrights.c | 77 ------------------------------ kbdnotify/flash.c | 4 +- kbdnotify/ignore.c | 18 +++---- kbdnotify/keyboard.c | 4 +- kbdnotify/main.c | 78 ++++++++++++++++++++----------- kbdnotify/options.c | 18 +++---- kbdnotify/trigger.c | 8 ++-- kbdnotify/utils.c | 6 +-- 8 files changed, 81 insertions(+), 132 deletions(-) delete mode 100644 kbdnotify/KnowYourRights/knowyourrights.c diff --git a/kbdnotify/KnowYourRights/knowyourrights.c b/kbdnotify/KnowYourRights/knowyourrights.c deleted file mode 100644 index 8b83985..0000000 --- a/kbdnotify/KnowYourRights/knowyourrights.c +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include -#include -#include "../../headers_c/newpluginapi.h" -#include "../../headers_c/m_utils.h" - -HANDLE hKbdDev[10] = {INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE}; -#define MAX_KBDHANDLES 10 - -BOOL isWindowsNT(void) -{ - OSVERSIONINFOEX osvi; - BOOL bOsVersionInfoEx; - - ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - if(!(bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi))) { - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if(!GetVersionEx((OSVERSIONINFO *)&osvi)) - osvi.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS; - } - return osvi.dwPlatformId==VER_PLATFORM_WIN32_NT; -} - - -BOOL OpenKeyboardDevice() -{ - int i = 0; - char aux1[MAX_PATH+1], aux2[MAX_PATH+1]; - - do { - mir_snprintf(aux1, sizeof(aux1), "Kbd%d", i); - mir_snprintf(aux2, sizeof(aux2), "\\Device\\KeyboardClass%d", i); - DefineDosDevice(DDD_RAW_TARGET_PATH, aux1, aux2); - - mir_snprintf(aux1, sizeof(aux1), "\\\\.\\Kbd%d", i); - hKbdDev[i] = CreateFile(aux1, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); - - } while (hKbdDev[i] != INVALID_HANDLE_VALUE && ++i < MAX_KBDHANDLES); - - return hKbdDev[0] != INVALID_HANDLE_VALUE; -} - - -void CloseKeyboardDevice() -{ - int i; - - for (i = 0; i < MAX_KBDHANDLES && hKbdDev[i] != INVALID_HANDLE_VALUE; i++) - CloseHandle(hKbdDev[i]); - -} - - -int main(void) -{ - char buffer[MAX_PATH+1]; - - if (!isWindowsNT()) { - printf("This application is meant for NT based systems\n"); - return 0; - } - - if (QueryDosDevice("Kbd0", buffer, sizeof(buffer))) { - printf("Device already created\n"); - return 0; - } - - if (!OpenKeyboardDevice()) { - printf("Device could not be created\n"); - return 1; - } - - CloseKeyboardDevice(); - printf("Device succesfully created\n"); - return 0; -} diff --git a/kbdnotify/flash.c b/kbdnotify/flash.c index 5450be9..f2bb647 100644 --- a/kbdnotify/flash.c +++ b/kbdnotify/flash.c @@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "keypresses.h" #include "utils.h" #include "constants.h" -#include "../headers_c/newpluginapi.h" -#include "../headers_c/m_database.h" +#include +#include typedef struct { unsigned int size; diff --git a/kbdnotify/ignore.c b/kbdnotify/ignore.c index fed80cc..b9d897b 100644 --- a/kbdnotify/ignore.c +++ b/kbdnotify/ignore.c @@ -26,15 +26,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "ignore.h" #include "resource.h" #include "constants.h" -#include "../headers_c/newpluginapi.h" -#include "../headers_c/m_clc.h" -#include "../headers_c/m_clist.h" -#include "../headers_c/m_database.h" -#include "../headers_c/m_langpack.h" -#include "../headers_c/m_options.h" -#include "../headers_c/m_protosvc.h" -#include "../headers_c/m_protocols.h" -#include "../headers_c/m_skin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #define IGNOREEVENT_MAX 4 diff --git a/kbdnotify/keyboard.c b/kbdnotify/keyboard.c index 20117c1..5e7c261 100644 --- a/kbdnotify/keyboard.c +++ b/kbdnotify/keyboard.c @@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include "keypresses.h" -#include "../headers_c/newpluginapi.h" -#include "../headers_c/m_utils.h" +#include +#include // Globals diff --git a/kbdnotify/main.c b/kbdnotify/main.c index 033b95b..8e9fdff 100644 --- a/kbdnotify/main.c +++ b/kbdnotify/main.c @@ -65,6 +65,8 @@ History ------- + 1.5.7.7: + [!] Added support for Miranda 0.8.x.x. 1.5.7.6: [!] Fixed bug in Ignore module. 1.5.7.5: @@ -195,20 +197,20 @@ #include "EnumProc.h" #include "utils.h" #include "m_kbdnotify.h" -#include "../headers_c/newpluginapi.h" -#include "../headers_c/m_database.h" -#include "../headers_c/m_options.h" -#include "../headers_c/m_clist.h" -#include "../headers_c/m_system.h" -#include "../headers_c/m_langpack.h" -#include "../headers_c/m_protocols.h" -#include "../headers_c/m_protosvc.h" -#include "../headers_c/m_contacts.h" -#include "../headers_c/m_message.h" -#include "../headers_c/m_utils.h" -#include "../headers_c/m_icq.h" -#include "../headers_c/m_metacontacts.h" -#include "../headers_c/m_updater.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "m_metacontacts.h" +#include "m_updater.h" #pragma comment(lib, "advapi32.lib") #define NCONVERS_BLINKID ((HANDLE)123456) //nconvers' random identifier used to flash an icon for "incoming message" on contact list @@ -306,18 +308,20 @@ char *szMetaProto = NULL; BYTE bMetaProtoEnabled = 0; -PLUGININFO pluginInfo={ +PLUGININFOEX pluginInfo={ sizeof(PLUGININFO), "Keyboard Notify Ext.", - PLUGIN_MAKE_VERSION(1,5,7,6), + PLUGIN_MAKE_VERSION(1,5,7,7), "Flashes your keyboard LEDs when a message has arrived", "TioDuke", "tioduke@yahoo.ca", - "© 2002-2003 M.Öberg, 2004 Std, 2005-2006 TioDuke", + "© 2002-2003 M.Öberg, 2004 Std, 2005-2008 TioDuke", "http://addons.miranda-im.org/", 0, //not transient - 0 //doesn't replace anything built-in -}; + 0, //doesn't replace anything built-in + {0x119d7288, 0x2050, 0x448d, { 0x99, 0x00, 0xd8, 0x6a, 0xc7, 0x04, 0x26, 0xbf }} //{119D7288-2050-448d-9900-D86AC70426BF} +}; + int InitializeOptions(WPARAM,LPARAM); @@ -1139,13 +1143,35 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) -__declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion) -{ - - return &pluginInfo; - -} - +__declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion) +{ + + pluginInfo.cbSize = sizeof(PLUGININFO); + return (PLUGININFO*)&pluginInfo; + +} + + + +__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + + pluginInfo.cbSize = sizeof(PLUGININFOEX); + return &pluginInfo; + +} + + + +#define MIID_KBDNOTIFY {0x119d7288, 0x2050, 0x448d, { 0x99, 0x00, 0xd8, 0x6a, 0xc7, 0x04, 0x26, 0xbf }} +static const MUUID interfaces[] = {MIID_KBDNOTIFY, MIID_LAST}; +__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) +{ + + return interfaces; + +} + int __declspec(dllexport) Load(PLUGINLINK *link) diff --git a/kbdnotify/options.c b/kbdnotify/options.c index 6b08cda..57ea559 100644 --- a/kbdnotify/options.c +++ b/kbdnotify/options.c @@ -30,15 +30,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "protolist.h" #include "EnumProc.h" #include "utils.h" -#include "../headers_c/newpluginapi.h" -#include "../headers_c/m_clc.h" -#include "../headers_c/m_clist.h" -#include "../headers_c/m_database.h" -#include "../headers_c/m_langpack.h" -#include "../headers_c/m_options.h" -#include "../headers_c/m_protosvc.h" -#include "../headers_c/m_protocols.h" -#include "../headers_c/m_icq.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #define IDI_BLANK 200 diff --git a/kbdnotify/trigger.c b/kbdnotify/trigger.c index a05671a..e8b155e 100644 --- a/kbdnotify/trigger.c +++ b/kbdnotify/trigger.c @@ -26,10 +26,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "constants.h" #include "utils.h" #include "resource.h" -#include "../headers_c/newpluginapi.h" -#include "../headers_c/m_database.h" -#include "../headers_c/m_langpack.h" -#include "../headers_c/m_trigger.h" +#include +#include +#include +#include "m_trigger.h" extern HINSTANCE hInst; diff --git a/kbdnotify/utils.c b/kbdnotify/utils.c index fbddb18..1307fbe 100644 --- a/kbdnotify/utils.c +++ b/kbdnotify/utils.c @@ -21,9 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include "utils.h" -#include "../headers_c/newpluginapi.h" -#include "../headers_c/m_database.h" -#include "../headers_c/m_utils.h" +#include +#include +#include char *fmtDBSettingName(const char *fmt, ...) -- cgit v1.2.3