From 16b58b001d519a36ec7584d09face4def90f36e4 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sun, 13 Jun 2010 18:35:25 +0300 Subject: hmm. --- commonheaders.h | 2 +- init.c | 93 ------------------------------------------------------- init.cpp | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ juick.vcproj | 14 ++++----- main.c | 21 ------------- main.cpp | 21 +++++++++++++ main.h | 3 -- options.c | 79 ----------------------------------------------- options.cpp | 80 +++++++++++++++++++++++++++++++++++++++++++++++ utilities.c | 79 ----------------------------------------------- utilities.cpp | 79 +++++++++++++++++++++++++++++++++++++++++++++++ 11 files changed, 284 insertions(+), 283 deletions(-) delete mode 100644 init.c create mode 100644 init.cpp delete mode 100644 main.c create mode 100644 main.cpp delete mode 100644 options.c create mode 100644 options.cpp delete mode 100644 utilities.c create mode 100644 utilities.cpp diff --git a/commonheaders.h b/commonheaders.h index c52ca17..69eab89 100644 --- a/commonheaders.h +++ b/commonheaders.h @@ -23,7 +23,7 @@ #define MIRANDA_VER 0x0800 #include -//#include +#include #include #include #include diff --git a/init.c b/init.c deleted file mode 100644 index 044856c..0000000 --- a/init.c +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright © 2010 sss -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -#include "commonheaders.h" - - -#define PLUGIN_NAME "juick" - -HINSTANCE hInst; -PLUGINLINK *pluginLink; -BOOL bWatrackService = FALSE; -static int OnModulesLoaded(WPARAM wParam,LPARAM lParam); -extern char *date(); -extern int WaMpdOptInit(WPARAM wParam,LPARAM lParam); - - -PLUGININFOEX pluginInfo={ - sizeof(PLUGININFOEX), - 0, - PLUGIN_MAKE_VERSION(0,0,0,1), - "Extended juick features support for miranda", - "sss", - "sss123next@list.ru", - "© 2010 sss", - "http://sss.chaoslab.ru/tracker/mim_plugs/", - 1, //unicode - 0, //doesn't replace anything built-in - { 0x9bc43876, 0xfc68, 0x43b4, { 0x9c, 0x3a, 0xc7, 0x1d, 0x4, 0x3e, 0x34, 0x47 } } -}; - -BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) -{ - hInst=hinstDLL; - return TRUE; -} - -__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) -{ - { - static char plugname[52]; - strcpy(plugname, PLUGIN_NAME" ["); - strcat(plugname, date()); - strcat(plugname, " "); - strcat(plugname, __TIME__); - strcat(plugname, "]"); - pluginInfo.shortName = plugname; - } - return &pluginInfo; -} - -static const MUUID interfaces[] = {MIID_SERVICEMODE, MIID_LAST}; -__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) -{ - return interfaces; -} - -int __declspec(dllexport) Load(PLUGINLINK *link) -{ - pluginLink=link; - HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); - mir_getMMI(&mmi); - mir_getUTFI(&utfi); - return 0; -} - -void InitVars() -{ -} - - -static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) -{ - return 0; -} - - -int __declspec(dllexport) Unload(void) -{ - return 0; -} diff --git a/init.cpp b/init.cpp new file mode 100644 index 0000000..8b380d7 --- /dev/null +++ b/init.cpp @@ -0,0 +1,96 @@ +// Copyright © 2010 sss +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#include "commonheaders.h" + + +#define PLUGIN_NAME "juick" + +HINSTANCE hInst; +PLUGINLINK *pluginLink; +BOOL bWatrackService = FALSE; +static int OnModulesLoaded(WPARAM wParam,LPARAM lParam); +extern char *date(); +extern int WaMpdOptInit(WPARAM wParam,LPARAM lParam); + +struct MM_INTERFACE mmi; +struct UTF8_INTERFACE utfi; + + +PLUGININFOEX pluginInfo={ + sizeof(PLUGININFOEX), + 0, + PLUGIN_MAKE_VERSION(0,0,0,1), + "Extended juick features support for miranda", + "sss", + "sss123next@list.ru", + "© 2010 sss", + "http://sss.chaoslab.ru/tracker/mim_plugs/", + 1, //unicode + 0, //doesn't replace anything built-in + { 0x9bc43876, 0xfc68, 0x43b4, { 0x9c, 0x3a, 0xc7, 0x1d, 0x4, 0x3e, 0x34, 0x47 } } +}; + +BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) +{ + hInst=hinstDLL; + return TRUE; +} + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + { + static char plugname[52]; + strcpy(plugname, PLUGIN_NAME" ["); + strcat(plugname, date()); + strcat(plugname, " "); + strcat(plugname, __TIME__); + strcat(plugname, "]"); + pluginInfo.shortName = plugname; + } + return &pluginInfo; +} + +static const MUUID interfaces[] = {MIID_SERVICEMODE, MIID_LAST}; +extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) +{ + return interfaces; +} + +extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) +{ + pluginLink=link; + HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); + mir_getMMI(&mmi); + mir_getUTFI(&utfi); + return 0; +} + +void InitVars() +{ +} + + +static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) +{ + return 0; +} + + +int __declspec(dllexport) Unload(void) +{ + return 0; +} diff --git a/juick.vcproj b/juick.vcproj index 16cd78c..041fbb8 100644 --- a/juick.vcproj +++ b/juick.vcproj @@ -54,7 +54,7 @@ OmitFramePointers="true" WholeProgramOptimization="true" AdditionalIncludeDirectories="../../include" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;FULL_BUILD" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_UNICODE" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -150,7 +150,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../include" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TESTPLUG_EXPORTS;_CRT_SECURE_NO_WARNINGS;FULL_BUILD" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TESTPLUG_EXPORTS;_CRT_SECURE_NO_WARNINGS;_UNICODE" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -246,7 +246,7 @@ OmitFramePointers="true" WholeProgramOptimization="true" AdditionalIncludeDirectories="../../include" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;FULL_BUILD" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;_UNICODE" StringPooling="true" RuntimeLibrary="0" EnableFunctionLevelLinking="true" @@ -608,19 +608,19 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > diff --git a/main.c b/main.c deleted file mode 100644 index 3f8d5b0..0000000 --- a/main.c +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright © 2008 sss, chaos.persei -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - - - -#include "commonheaders.h" - diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..3f8d5b0 --- /dev/null +++ b/main.cpp @@ -0,0 +1,21 @@ +// Copyright © 2008 sss, chaos.persei +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + + + +#include "commonheaders.h" + diff --git a/main.h b/main.h index f61c90c..4888068 100644 --- a/main.h +++ b/main.h @@ -16,9 +16,6 @@ #ifndef MAIN_H #define MAIN_H -struct MM_INTERFACE mmi; -struct UTF8_INTERFACE utfi; - #endif diff --git a/options.c b/options.c deleted file mode 100644 index 782c346..0000000 --- a/options.c +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright © 2008 sss, chaos.persei -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -#include "commonheaders.h" -#include - -HINSTANCE hInst; - -static BOOL CALLBACK DlgProcJuickOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); - -int JuickOptInit(WPARAM wParam,LPARAM lParam) -{ - OPTIONSDIALOGPAGE odp = { 0 }; - odp.cbSize = sizeof(odp); - odp.hInstance = hInst; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_JUICK); - odp.pszTitle = "Juick"; - odp.pszGroup = "Message Sessions"; - odp.flags=ODPF_BOLDGROUPS; - odp.pfnDlgProc = DlgProcJuickOpts; - CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); - return 0; -} - - -static BOOL CALLBACK DlgProcJuickOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) - { - case WM_INITDIALOG: - { - TranslateDialogDefault(hwndDlg); - return TRUE; - } - - - case WM_COMMAND: - { - switch (LOWORD(wParam)) - { - - } - - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - } - - case WM_NOTIFY: - { - switch (((LPNMHDR)lParam)->code) - { - - case PSN_APPLY: - { - return TRUE; - } - } - } - break; - } - - return FALSE; -} - - - diff --git a/options.cpp b/options.cpp new file mode 100644 index 0000000..360cfe0 --- /dev/null +++ b/options.cpp @@ -0,0 +1,80 @@ +// Copyright © 2008 sss, chaos.persei +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#include "commonheaders.h" +#include + +extern HINSTANCE hInst; + +static BOOL CALLBACK DlgProcJuickOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + +int JuickOptInit(WPARAM wParam,LPARAM lParam) +{ + OPTIONSDIALOGPAGE odp = { 0 }; + odp.cbSize = sizeof(odp); + odp.hInstance = hInst; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_JUICK); + odp.pszTitle = "Juick"; + odp.pszGroup = "Message Sessions"; + odp.flags=ODPF_BOLDGROUPS; + odp.pfnDlgProc = DlgProcJuickOpts; + CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); + return 0; +} + + +static BOOL CALLBACK DlgProcJuickOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) + { + case WM_INITDIALOG: + { + TranslateDialogDefault(hwndDlg); + return TRUE; + } + + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + default: + break; + } + + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + } + + case WM_NOTIFY: + { + switch (((LPNMHDR)lParam)->code) + { + + case PSN_APPLY: + { + return TRUE; + } + } + } + break; + } + + return FALSE; +} + + + diff --git a/utilities.c b/utilities.c deleted file mode 100644 index 170dcca..0000000 --- a/utilities.c +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright © 2008 sss, chaos.persei -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -#include "commonheaders.h" - - -TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,const char* szSetting, TCHAR* szDef) -{ - DBVARIANT dbv = {DBVT_DELETED}; - TCHAR* szRes; - if (DBGetContactSettingTString(hContact, szModule, szSetting, &dbv)) - return _tcsdup(szDef); - if(dbv.pszVal) - szRes = _tcsdup(dbv.ptszVal); - DBFreeVariant(&dbv); - return szRes; -} - - -char *date() -{ - static char d[11]; - char *tmp = __DATE__, m[4], mn[3] = "01"; - m[0]=tmp[0]; - m[1]=tmp[1]; - m[2]=tmp[2]; - if(strstr(m,"Jan")) - strcpy(mn,"01"); - else if(strstr(m,"Feb")) - strcpy(mn,"02"); - else if(strstr(m,"Mar")) - strcpy(mn,"03"); - else if(strstr(m,"Apr")) - strcpy(mn,"04"); - else if(strstr(m,"May")) - strcpy(mn,"05"); - else if(strstr(m,"Jun")) - strcpy(mn,"06"); - else if(strstr(m,"Jul")) - strcpy(mn,"07"); - else if(strstr(m,"Aug")) - strcpy(mn,"08"); - else if(strstr(m,"Sep")) - strcpy(mn,"09"); - else if(strstr(m,"Oct")) - strcpy(mn,"10"); - else if(strstr(m,"Nov")) - strcpy(mn,"11"); - else if(strstr(m,"Dec")) - strcpy(mn,"12"); - d[0]=tmp[7]; - d[1]=tmp[8]; - d[2]=tmp[9]; - d[3]=tmp[10]; - d[4]='.'; - d[5]=mn[0]; - d[6]=mn[1]; - d[7]='.'; - if (tmp[4] == ' ') - d[8] = '0'; - else - d[8]=tmp[4]; - d[9]=tmp[5]; - return d; -} diff --git a/utilities.cpp b/utilities.cpp new file mode 100644 index 0000000..170dcca --- /dev/null +++ b/utilities.cpp @@ -0,0 +1,79 @@ +// Copyright © 2008 sss, chaos.persei +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#include "commonheaders.h" + + +TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,const char* szSetting, TCHAR* szDef) +{ + DBVARIANT dbv = {DBVT_DELETED}; + TCHAR* szRes; + if (DBGetContactSettingTString(hContact, szModule, szSetting, &dbv)) + return _tcsdup(szDef); + if(dbv.pszVal) + szRes = _tcsdup(dbv.ptszVal); + DBFreeVariant(&dbv); + return szRes; +} + + +char *date() +{ + static char d[11]; + char *tmp = __DATE__, m[4], mn[3] = "01"; + m[0]=tmp[0]; + m[1]=tmp[1]; + m[2]=tmp[2]; + if(strstr(m,"Jan")) + strcpy(mn,"01"); + else if(strstr(m,"Feb")) + strcpy(mn,"02"); + else if(strstr(m,"Mar")) + strcpy(mn,"03"); + else if(strstr(m,"Apr")) + strcpy(mn,"04"); + else if(strstr(m,"May")) + strcpy(mn,"05"); + else if(strstr(m,"Jun")) + strcpy(mn,"06"); + else if(strstr(m,"Jul")) + strcpy(mn,"07"); + else if(strstr(m,"Aug")) + strcpy(mn,"08"); + else if(strstr(m,"Sep")) + strcpy(mn,"09"); + else if(strstr(m,"Oct")) + strcpy(mn,"10"); + else if(strstr(m,"Nov")) + strcpy(mn,"11"); + else if(strstr(m,"Dec")) + strcpy(mn,"12"); + d[0]=tmp[7]; + d[1]=tmp[8]; + d[2]=tmp[9]; + d[3]=tmp[10]; + d[4]='.'; + d[5]=mn[0]; + d[6]=mn[1]; + d[7]='.'; + if (tmp[4] == ' ') + d[8] = '0'; + else + d[8]=tmp[4]; + d[9]=tmp[5]; + return d; +} -- cgit v1.2.3