From 7de38a08b97e0554e318b8c25806cef5d47259e6 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 12 Jun 2014 17:49:53 +0000 Subject: headers of not adopted plugins moved to !Deprecated git-svn-id: http://svn.miranda-ng.org/main/trunk@9438 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/m_icq.h | 20 + .../!Deprecated/ExternalAPI/delphi/imgdecoder.pas | 114 + .../ExternalAPI/delphi/m_DataAsMessage.inc | 155 ++ .../!Deprecated/ExternalAPI/delphi/m_anismiley.inc | 116 + .../ExternalAPI/delphi/m_autoreplacer.inc | 39 + .../ExternalAPI/delphi/m_contactdir.inc | 164 ++ .../!Deprecated/ExternalAPI/delphi/m_db3xsa.inc | 84 + .../!Deprecated/ExternalAPI/delphi/m_ersatz.inc | 41 + plugins/!Deprecated/ExternalAPI/delphi/m_fuse.inc | 28 + .../ExternalAPI/delphi/m_help(plugin).inc | 76 + .../ExternalAPI/delphi/m_historyevents.inc | 201 ++ .../!Deprecated/ExternalAPI/delphi/m_ircscript.inc | 125 + .../ExternalAPI/delphi/m_keybindings.inc | 58 + .../!Deprecated/ExternalAPI/delphi/m_langman.inc | 46 + .../ExternalAPI/delphi/m_mathmodule.inc | 199 ++ plugins/!Deprecated/ExternalAPI/delphi/m_motd.inc | 75 + .../ExternalAPI/delphi/m_nickhistory.inc | 50 + .../ExternalAPI/delphi/m_simpleaway.inc | 26 + plugins/!Deprecated/ExternalAPI/delphi/m_smh.inc | 50 + plugins/!Deprecated/ExternalAPI/delphi/m_smr.inc | 59 + .../ExternalAPI/delphi/m_snapping_windows.inc | 35 + .../ExternalAPI/delphi/m_spamfilter.inc | 751 ++++++ plugins/!Deprecated/ExternalAPI/delphi/m_speak.inc | 267 +++ plugins/!Deprecated/ExternalAPI/delphi/m_voice.inc | 156 ++ .../ExternalAPI/delphi/m_voiceservice.inc | 87 + plugins/!Deprecated/ExternalAPI/delphi/m_w7ui.inc | 84 + .../!Deprecated/ExternalAPI/delphi/m_webcam.inc | 142 ++ .../!Deprecated/ExternalAPI/m_ContactSettings.h | 235 ++ plugins/!Deprecated/ExternalAPI/m_DataAsMessage.h | 182 ++ plugins/!Deprecated/ExternalAPI/m_LogService.h | 217 ++ .../!Deprecated/ExternalAPI/m_MagneticWindows.h | 86 + plugins/!Deprecated/ExternalAPI/m_MathModule.h | 263 +++ plugins/!Deprecated/ExternalAPI/m_autoreplacer.h | 39 + plugins/!Deprecated/ExternalAPI/m_db3xsa.h | 120 + plugins/!Deprecated/ExternalAPI/m_dbx_tree.h | 684 ++++++ plugins/!Deprecated/ExternalAPI/m_fortunemsg.h | 71 + plugins/!Deprecated/ExternalAPI/m_hddinfo.h | 6 + plugins/!Deprecated/ExternalAPI/m_help.h | 89 + plugins/!Deprecated/ExternalAPI/m_icqplus.h | 92 + plugins/!Deprecated/ExternalAPI/m_ircscript.h | 129 ++ plugins/!Deprecated/ExternalAPI/m_langman.h | 41 + plugins/!Deprecated/ExternalAPI/m_script.h | 144 ++ plugins/!Deprecated/ExternalAPI/m_simpleaway.h | 103 + .../!Deprecated/ExternalAPI/m_snappingwindows.h | 25 + plugins/!Deprecated/ExternalAPI/m_voice.h | 158 ++ plugins/!Deprecated/ExternalAPI/m_voiceservice.h | 86 + plugins/!Deprecated/ExternalAPI/m_w7ui.h | 63 + plugins/AutoShutdown/res/resource.rc | 2 - plugins/AutoShutdown/src/common.h | 5 +- plugins/AutoShutdown/src/options.cpp | 6 - plugins/AutoShutdown/src/resource.h | 1 - plugins/AutoShutdown/src/settingsdlg.cpp | 5 - plugins/AutoShutdown/src/watcher.cpp | 18 - .../ClientChangeNotify/src/ClientChangeNotify.cpp | 57 - plugins/ClientChangeNotify/src/Common.h | 3 - plugins/ClientChangeNotify/src/OptDlg.cpp | 1 - plugins/ExternalAPI/delphi/imgdecoder.pas | 114 - plugins/ExternalAPI/delphi/m_DataAsMessage.inc | 155 -- plugins/ExternalAPI/delphi/m_anismiley.inc | 116 - plugins/ExternalAPI/delphi/m_autoreplacer.inc | 39 - plugins/ExternalAPI/delphi/m_contactdir.inc | 164 -- plugins/ExternalAPI/delphi/m_db3xsa.inc | 84 - plugins/ExternalAPI/delphi/m_ersatz.inc | 41 - plugins/ExternalAPI/delphi/m_fuse.inc | 28 - plugins/ExternalAPI/delphi/m_help(plugin).inc | 76 - plugins/ExternalAPI/delphi/m_historyevents.inc | 201 -- plugins/ExternalAPI/delphi/m_ircscript.inc | 125 - plugins/ExternalAPI/delphi/m_keybindings.inc | 58 - plugins/ExternalAPI/delphi/m_langman.inc | 46 - plugins/ExternalAPI/delphi/m_mathmodule.inc | 199 -- plugins/ExternalAPI/delphi/m_motd.inc | 75 - plugins/ExternalAPI/delphi/m_nickhistory.inc | 50 - plugins/ExternalAPI/delphi/m_simpleaway.inc | 26 - plugins/ExternalAPI/delphi/m_smh.inc | 50 - plugins/ExternalAPI/delphi/m_smr.inc | 59 - plugins/ExternalAPI/delphi/m_snapping_windows.inc | 35 - plugins/ExternalAPI/delphi/m_spamfilter.inc | 751 ------ plugins/ExternalAPI/delphi/m_speak.inc | 267 --- plugins/ExternalAPI/delphi/m_voice.inc | 156 -- plugins/ExternalAPI/delphi/m_voiceservice.inc | 87 - plugins/ExternalAPI/delphi/m_w7ui.inc | 84 - plugins/ExternalAPI/delphi/m_webcam.inc | 142 -- plugins/ExternalAPI/m_ContactSettings.h | 235 -- plugins/ExternalAPI/m_DataAsMessage.h | 182 -- plugins/ExternalAPI/m_LogService.h | 217 -- plugins/ExternalAPI/m_MagneticWindows.h | 86 - plugins/ExternalAPI/m_MathModule.h | 263 --- plugins/ExternalAPI/m_autoreplacer.h | 39 - plugins/ExternalAPI/m_db3xsa.h | 120 - plugins/ExternalAPI/m_dbx_tree.h | 684 ------ plugins/ExternalAPI/m_fortunemsg.h | 71 - plugins/ExternalAPI/m_hddinfo.h | 6 - plugins/ExternalAPI/m_help.h | 89 - plugins/ExternalAPI/m_icqplus.h | 92 - plugins/ExternalAPI/m_ircscript.h | 129 -- plugins/ExternalAPI/m_langman.h | 41 - plugins/ExternalAPI/m_script.h | 144 -- plugins/ExternalAPI/m_shutdown.h | 1 - plugins/ExternalAPI/m_simpleaway.h | 103 - plugins/ExternalAPI/m_snappingwindows.h | 25 - plugins/ExternalAPI/m_svc_dbepp.h | 42 - plugins/ExternalAPI/m_voice.h | 158 -- plugins/ExternalAPI/m_voiceservice.h | 86 - plugins/ExternalAPI/m_w7ui.h | 63 - plugins/IEView/res/ieview.rc | 7 +- plugins/IEView/src/HTMLBuilder.cpp | 6 - plugins/IEView/src/Options.cpp | 15 - plugins/IEView/src/Options.h | 3 - plugins/IEView/src/TextToken.cpp | 717 +++--- plugins/IEView/src/TextToken.h | 1 - plugins/IEView/src/ieview_common.h | 1 - plugins/IEView/src/resource.h | 1 - plugins/MyDetails/src/commons.h | 1 - plugins/MyDetails/src/data.cpp | 17 - plugins/MyDetails/src/data.h | 2 - plugins/MyDetails/src/frame.cpp | 40 - plugins/MyDetails/src/mydetails.cpp | 12 +- plugins/NewAwaySysMod/NewAwaySys_12.vcxproj | 5 +- plugins/NewAwaySysMod/src/AwaySys.cpp | 94 - plugins/NewAwaySysMod/src/Common.h | 3 - plugins/New_GPG/src/commonheaders.h | 2 +- plugins/NotifyAnything/src/common.h | 3 - plugins/NotifyAnything/src/main.cpp | 321 ++- plugins/NotifyAnything/src/options.cpp | 32 +- plugins/QuickContacts/res/resource.rc | 2 - plugins/QuickContacts/src/commons.h | 1 - plugins/QuickContacts/src/quickcontacts.cpp | 46 - plugins/QuickContacts/src/resource.h | 3 - plugins/SimpleStatusMsg/src/awaymsg.cpp | 4 - plugins/SimpleStatusMsg/src/commonheaders.h | 1 - plugins/SimpleStatusMsg/src/main.cpp | 83 - plugins/SimpleStatusMsg/src/simplestatusmsg.h | 3 + plugins/UserInfoEx/src/commonheaders.h | 1 - .../src/ex_import/dlg_ExImOpenSaveFile.cpp | 7 - protocols/IRCG/src/irc.h | 10 - protocols/IRCG/src/irclib.cpp | 8 +- protocols/IRCG/src/ircproto.cpp | 209 +- protocols/IRCG/src/options.cpp | 1 - protocols/IRCG/src/scripting.cpp | 53 +- protocols/IRCG/src/services.cpp | 340 ++- protocols/IcqOscarJ/src/icqoscar.h | 1 - protocols/SkypeClassic/SkypeClassic_12.vcxproj | 48 +- .../SkypeClassic/SkypeClassic_12.vcxproj.filters | 10 +- protocols/SkypeClassic/src/contacts.cpp | 404 ++-- protocols/SkypeClassic/src/skype.cpp | 2385 ++++++++++---------- protocols/SkypeClassic/src/voiceservice.cpp | 154 -- protocols/SkypeClassic/src/voiceservice.h | 18 - 147 files changed, 8274 insertions(+), 9084 deletions(-) create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/imgdecoder.pas create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_DataAsMessage.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_anismiley.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_autoreplacer.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_contactdir.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_db3xsa.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_ersatz.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_fuse.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_help(plugin).inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_historyevents.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_ircscript.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_keybindings.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_langman.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_mathmodule.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_motd.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_nickhistory.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_simpleaway.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_smh.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_smr.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_snapping_windows.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_spamfilter.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_speak.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_voice.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_voiceservice.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_w7ui.inc create mode 100644 plugins/!Deprecated/ExternalAPI/delphi/m_webcam.inc create mode 100644 plugins/!Deprecated/ExternalAPI/m_ContactSettings.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_DataAsMessage.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_LogService.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_MagneticWindows.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_MathModule.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_autoreplacer.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_db3xsa.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_dbx_tree.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_fortunemsg.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_hddinfo.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_help.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_icqplus.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_ircscript.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_langman.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_script.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_simpleaway.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_snappingwindows.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_voice.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_voiceservice.h create mode 100644 plugins/!Deprecated/ExternalAPI/m_w7ui.h delete mode 100644 plugins/ExternalAPI/delphi/imgdecoder.pas delete mode 100644 plugins/ExternalAPI/delphi/m_DataAsMessage.inc delete mode 100644 plugins/ExternalAPI/delphi/m_anismiley.inc delete mode 100644 plugins/ExternalAPI/delphi/m_autoreplacer.inc delete mode 100644 plugins/ExternalAPI/delphi/m_contactdir.inc delete mode 100644 plugins/ExternalAPI/delphi/m_db3xsa.inc delete mode 100644 plugins/ExternalAPI/delphi/m_ersatz.inc delete mode 100644 plugins/ExternalAPI/delphi/m_fuse.inc delete mode 100644 plugins/ExternalAPI/delphi/m_help(plugin).inc delete mode 100644 plugins/ExternalAPI/delphi/m_historyevents.inc delete mode 100644 plugins/ExternalAPI/delphi/m_ircscript.inc delete mode 100644 plugins/ExternalAPI/delphi/m_keybindings.inc delete mode 100644 plugins/ExternalAPI/delphi/m_langman.inc delete mode 100644 plugins/ExternalAPI/delphi/m_mathmodule.inc delete mode 100644 plugins/ExternalAPI/delphi/m_motd.inc delete mode 100644 plugins/ExternalAPI/delphi/m_nickhistory.inc delete mode 100644 plugins/ExternalAPI/delphi/m_simpleaway.inc delete mode 100644 plugins/ExternalAPI/delphi/m_smh.inc delete mode 100644 plugins/ExternalAPI/delphi/m_smr.inc delete mode 100644 plugins/ExternalAPI/delphi/m_snapping_windows.inc delete mode 100644 plugins/ExternalAPI/delphi/m_spamfilter.inc delete mode 100644 plugins/ExternalAPI/delphi/m_speak.inc delete mode 100644 plugins/ExternalAPI/delphi/m_voice.inc delete mode 100644 plugins/ExternalAPI/delphi/m_voiceservice.inc delete mode 100644 plugins/ExternalAPI/delphi/m_w7ui.inc delete mode 100644 plugins/ExternalAPI/delphi/m_webcam.inc delete mode 100644 plugins/ExternalAPI/m_ContactSettings.h delete mode 100644 plugins/ExternalAPI/m_DataAsMessage.h delete mode 100644 plugins/ExternalAPI/m_LogService.h delete mode 100644 plugins/ExternalAPI/m_MagneticWindows.h delete mode 100644 plugins/ExternalAPI/m_MathModule.h delete mode 100644 plugins/ExternalAPI/m_autoreplacer.h delete mode 100644 plugins/ExternalAPI/m_db3xsa.h delete mode 100644 plugins/ExternalAPI/m_dbx_tree.h delete mode 100644 plugins/ExternalAPI/m_fortunemsg.h delete mode 100644 plugins/ExternalAPI/m_hddinfo.h delete mode 100644 plugins/ExternalAPI/m_help.h delete mode 100755 plugins/ExternalAPI/m_icqplus.h delete mode 100644 plugins/ExternalAPI/m_ircscript.h delete mode 100644 plugins/ExternalAPI/m_langman.h delete mode 100644 plugins/ExternalAPI/m_script.h delete mode 100644 plugins/ExternalAPI/m_simpleaway.h delete mode 100644 plugins/ExternalAPI/m_snappingwindows.h delete mode 100644 plugins/ExternalAPI/m_svc_dbepp.h delete mode 100644 plugins/ExternalAPI/m_voice.h delete mode 100644 plugins/ExternalAPI/m_voiceservice.h delete mode 100644 plugins/ExternalAPI/m_w7ui.h delete mode 100644 protocols/SkypeClassic/src/voiceservice.cpp delete mode 100644 protocols/SkypeClassic/src/voiceservice.h diff --git a/include/m_icq.h b/include/m_icq.h index 3afb3b7b42..a3b5855619 100644 --- a/include/m_icq.h +++ b/include/m_icq.h @@ -186,4 +186,24 @@ typedef struct { // -1 delayed (rate control) - sequence unknown #define PS_ICQ_REQUESTCUSTOMSTATUS "/RequestXStatusDetails" +#define MAX_CAPNAME 64 +typedef struct +{ + int cbSize; + char caps[0x10]; + HANDLE hIcon; + char name[MAX_CAPNAME]; +} ICQ_CUSTOMCAP; + +// Add a custom icq capability. +// wParam = 0; +// lParam = (LPARAM)(ICQ_CUSTOMCAP *)&icqCustomCap; +#define PS_ICQ_ADDCAPABILITY "/IcqAddCapability" + +// Check if capability is supportes. Only icqCustomCap.caps does matter. +// wParam = (WPARAM)(HANDLE)hContact; +// lParam = (LPARAM)(ICQ_CUSTOMCAP *)&icqCustomCap; +// returns non-zero if capability is supported +#define PS_ICQ_CHECKCAPABILITY "/IcqCheckCapability" + #endif // M_ICQ_H__ diff --git a/plugins/!Deprecated/ExternalAPI/delphi/imgdecoder.pas b/plugins/!Deprecated/ExternalAPI/delphi/imgdecoder.pas new file mode 100644 index 0000000000..eea6ec2610 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/imgdecoder.pas @@ -0,0 +1,114 @@ +unit ImgDecoder; + +interface +uses Windows; + +function IsImgDecoderAvailable:boolean; +function ImgNewDecoder(var pDecoder:pointer):dword; +function ImgDeleteDecoder(pDecoder:pointer):dword; +function ImgNewDIBFromFile(pDecoder:pointer;Filename:PAnsiChar;var pImg:pointer):dword; +function ImgDeleteDIBSection(pImg:pointer):dword; +function ImgGetHandle(pImg:pointer;var pBitmap:HBITMAP;var ppDIBBits:pointer):dword; + +implementation + +const + hModule:THANDLE=0; +type + tImgNewDecoder =function(var pDecoder:pointer):dword; stdcall; + tImgDeleteDecoder =function(pDecoder:pointer):dword; stdcall; + tImgNewDIBFromFile =function(pDecoder:pointer;Filename:PAnsiChar;var pImg):dword; stdcall; + tImgDeleteDIBSection=function(pImg:pointer):dword; stdcall; + tImgGetHandle =function(pImg:pointer;var pBitmap:HBITMAP;var ppDIBBits:pointer):dword; stdcall; + +const + pImgNewDecoder :tImgNewDecoder = nil; + pImgDeleteDecoder :tImgDeleteDecoder = nil; + pImgNewDIBFromFile :tImgNewDIBFromFile = nil; + pImgDeleteDIBSection:tImgDeleteDIBSection = nil; + pImgGetHandle :tImgGetHandle = nil; + +function IsImgDecoderAvailable:boolean; +begin + result:=hModule<>0; +end; + +function ImgNewDecoder(var pDecoder:pointer):dword; +begin + if @pImgNewDecoder<>nil then + result:=pImgNewDecoder(pDecoder) + else + result:=0; +end; + +function ImgDeleteDecoder(pDecoder:pointer):dword; +begin + if @pImgDeleteDecoder<>nil then + result:=pImgDeleteDecoder(pDecoder) + else + result:=0; +end; + +function ImgNewDIBFromFile(pDecoder:pointer;Filename:PAnsiChar;var pImg:pointer):dword; +begin + if @pImgNewDecoder<>nil then + result:=pImgNewDIBFromFile(pDecoder,Filename,pImg) + else + result:=0; +end; + +function ImgDeleteDIBSection(pImg:pointer):dword; +begin + if @pImgNewDecoder<>nil then + result:=pImgDeleteDIBSection(pImg) + else + result:=0; +end; + +function ImgGetHandle(pImg:pointer;var pBitmap:HBITMAP;var ppDIBBits:pointer):dword; +begin + if @pImgGetHandle<>nil then + result:=pImgGetHandle(pImg,pBitmap,ppDIBBits) + else + result:=0; +end; + +initialization + hModule:=LoadLibrary('imgdecoder.dll'); + if hModule=0 then + hModule:=LoadLibrary('plugins\imgdecoder.dll'); + + if hModule<>0 then + begin + pImgNewDecoder :=GetProcAddress(hModule, 'ImgNewDecoder'); + pImgDeleteDecoder :=GetProcAddress(hModule, 'ImgDeleteDecoder'); + pImgNewDIBFromFile :=GetProcAddress(hModule, 'ImgNewDIBFromFile'); + pImgDeleteDIBSection:=GetProcAddress(hModule, 'ImgDeleteDIBSection'); + pImgGetHandle :=GetProcAddress(hModule, 'ImgGetHandle'); + end; + +finalization + if hModule<>0 then + FreeLibrary(hModule); +end. +{ Sample of using + +var + pDecoder:pointer; + pImg:pointer; + bitmap:HBITMAP; + pBits:pointer; +begin + if IsImgDecoderAvailable then + begin + ImgNewDecoder(pDecoder); + if ImgNewDIBFromFile(pDecoder,PAnsiChar(ParamStr(1)),pImg)<>0 then + begin + ImgGetHandle(pImg,bitmap,pBits); +// action + ImgDeleteDIBSection(pImg); + end; + ImgDeleteDecoder(pDecoder); + end; +end. +} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_DataAsMessage.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_DataAsMessage.inc new file mode 100644 index 0000000000..71bfcc059d --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_DataAsMessage.inc @@ -0,0 +1,155 @@ +{ + DataAsMessage plugin for Miranda IM + Copyright (c) 2006 Chervov Dmitry + + 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 +} + +{$IFNDEF M_DATAASMESSAGE} +{$DEFINE M_DATAASMESSAGE} + +const +// DAM_SENDRESULTINFO::iResult values + DAM_SR_SUCCESS = 0; + DAM_SR_TIMEOUT = 1; // timeout period expired; this value is returned + // also if the contact went offline for a time + // longer than a timeout period + DAM_SR_NOTSUPPORTED = 2; // means this szDataType is not supported by the + // remote side + DAM_SR_NODAM = 3; // means there is no DataAsMessage plugin on the + // remote side; keep in mind that this error may + // also appear accidentally because of a bad + // connectivity during the handshake (if there + // was a timeout when waiting for a response) + DAM_SR_CANCELLEDLOCAL = 4; // cancelled from the local(sending) side + DAM_SR_CANCELLEDREMOTE = 5; // cancelled from the remote(receiving) side + DAM_SR_BADCRC = 6; // bad CRC; we can't do anything with this error. presumably, it will happen rarely, and the most probable cause is the protocol that filters some of characters in our messages OR it may be a bug in DataAsMessage plugin (hopefully not ;) ). + DAM_SR_UNKNOWN = 7; // unknown error + +// Return values for DAM_SENDRESULTPROC + DAM_SRA_RETRY = 1; + +type +// hContact, szDataType and SessionID fields correspond to the fields of the +// DAM_SENDDATAINFO structure + PDAM_SENDRESULTINFO = ^TDAM_SENDRESULTINFO; + TDAM_SENDRESULTINFO = record + cbSize :int; // sizeof(DAM_SENDRESULTINFO) + hContact :THANDLE; + szDataType:PAnsiChar; + SessionID :dword; + iResult :int; // transmission result code + end; + +type + TDAM_SENDRESULTPROC = function(sri:PDAM_SENDRESULTINFO):int; cdecl; +// this procedure receives the result of the transmission. it's called when the +// session closes (either the data was sent successfully or there was an error) +// you can return DAM_SRA_RETRY when iResult is DAM_SR_TIMEOUT if you want to +// retry sending + +const +// DAM_SENDDATAINFO::Flags constants + DAM_SDF_DONTPACK = 1; // don't pack the data (by default all the data is packed) + DAM_SDF_NOTIMEOUT = 2; // don't generate a timeout error ever, keep trying to + // send the data. If the contact is offline, the data + // is saved in the memory until the contact goes online. + // Loss of the data occurs only if the sender's miranda + // closes (this may change in future to allow fully + // functional offline sending that will guarantee the + // data to be sent in any case, but of course the + // sending starts only when the both contacts are + // online). other errors than the timeout error can be + // still generated though. + +type + TDAM_SENDDATAINFO = record + cbSize :int; // sizeof(DAM_SENDDATAINFO) + hContact :THANDLE; + szDataType:PAnsiChar; // zero-terminated string, containing data type, + // preferably in format "YourPluginName" or + // "YourPluginName/Something" (make sure this string + // won't coincide by an accident with someone else's + // string!). you can identify your data by this ID later + nDataLen :int; // keep in mind that if the length is too big (more than + // about 8 KB), it's more preferable to split your data + // into several chunks, as you won't be able to "pick + // up" your data at the other end until all the data is + // transferred + cData :PAnsiChar; + Flags :int; // combination of the DAM_SDF_ constants + SendAfterSessionID:dword; // may be NULL; otherwise it's guaranteed that the + // sending starts only after successful completion + // of SendAfterSessionID session + SendResultProc:TDAM_SENDRESULTPROC; // pointer to a procedure that receives + // the result; can be NULL + SessionID :dword; // OUT; receives the session ID + end; + +const +// MS_DAM_SENDDATA return values + DAM_SDA_NOERROR = 0; + DAM_SDA_NOTSUPPORTED = -1; // contact's protocol doesn't support sending/ + // receiving messages + DAM_SDA_TOOMANYSESSIONS = -2; // too many sessions + +// MS_DAM_SENDDATA +// sends the data +// wParam = (WPARAM)(DAM_SENDDATAINFO*)sdi; +// lParam = 0 +// Returns 0 (DAM_SDA_NOERROR) and fills SessionID if the session was queued for sending successfully; returns one of the DAM_SDA_ values on failure + MS_DAM_SENDDATA = 'DataAsMessage/SendData'; + +function DAMSendData(hContact:THANDLE; szDataType:PAnsiChar; nDataLen:int; + cData:PAnsiChar; Flags:int; SendAfterSessionID:dword; + SendResultProc:TDAM_SENDRESULTPROC;pSessionID:pdword):int; +var + sdi:TDAM_SENDDATAINFO; +begin + FillChar(sdi,SizeOf(sdi),0); + sdi.cbSize :=SizeOf(sdi); + sdi.hContact :=hContact; + sdi.szDataType:=szDataType; + sdi.nDataLen :=nDataLen; + sdi.cData :=cData; + sdi.Flags :=Flags; + sdi.SendAfterSessionID:=SendAfterSessionID; + sdi.SendResultProc :=SendResultProc; + Result:=CallService(MS_DAM_SENDDATA,dword(@sdi),0); + if pSessionID<>nil then + pSessionID^:=sdi.SessionID; +end; + +type + TDAM_RECVDATAINFO = record + cbSize :int; // sizeof(DAM_RECVDATAINFO) + hContact :THANDLE; + szDataType:PAnsiChar; + nDataLen :int; + cData :PAnsiChar; + end; + +const +// ME_DAM_RECVDATA +// hook up to this event to check for incoming data +// make sure rdi->szDataType is yours before doing anything! +// The important thing here is that your plugin will receive TWO ME_DAM_RECVDATA notifications on every single MS_DAM_SENDDATA call from a remote side: +// The first notification arrives when the remote side starts to transmit the data. In this case DAM_RECVDATAINFO::cData = NULL (and DAM_RECVDATAINFO::nDataLen = -1) as we didn't receive any data yet. Return 1 to indicate that your plugin recognized the DAM_RECVDATAINFO::szDataType, otherwise return 0. If there are no any plugin that recognized the data, DAM cancels the transfer and there won't be any second notification for it. +// The second notification is when the data is transmitted successfully. nDataLen contains the usual data size and cData points to the data buffer. cData is guaranteed to be valid only during the ME_DAM_RECVDATA call. You must copy the data to your own plugin's memory if you need it later. again, return 1 to indicate that your plugin recognized the data, otherwise return 0 +// wParam = (WPARAM)(DAM_RECVDATAINFO*)rdi; +// lParam = 0 + ME_DAM_RECVDATA = 'DataAsMessage/RecvData'; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_anismiley.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_anismiley.inc new file mode 100644 index 0000000000..f16005fe51 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_anismiley.inc @@ -0,0 +1,116 @@ +{$IFNDEF M_ANISMILEY} +{$DEFINE M_ANISMILEY} + +const + IASF_UNICODE = 1; + +type + TINSERTANISMILEY = record + cbSize :size_t; + hWnd :HWND; + szFilename :TChar; + dwBackColor:COLORREF; + nHeight :int; + dwFlags :dword; + end; + tagINSERTANISMILEY = TINSERTANISMILEY; + +const + MS_INSERTANISMILEY :PAnsiChar = 'mAnimator/InsertSmiley'; +(* + function InsertAnimatedSmiley(wnd:HWND;filename:TChar;Back:TCOLORREF;height:int):bool; + const + bServiceExists:int=-1 + var + ias:TINSERTANISMILEY; + begin + if bServiceExists=-1 then + bServiceExists:=ServiceExists(MS_INSERTANISMILEY); + if bServiceExists=0 then + result:=false + else + begin + ias.cbSize :=SizeOf(TINSERTANISMILEY); + ias.hWnd :=wnd; + ias.tcsFilename:=Filename.w; + ias.dwFlags :=IASF_UNICODE; + ias.nHeight :=Height; + ias.dwBackColor:=Back; + result:=CallService(MS_INSERTANISMILEY,WPARAM(@ias),0)<>0; + end; + end; + + bool InsertAnimatedSmiley(HWND _hwnd, TCHAR * _szFilename, COLORREF _dwBack, int _nHeight) + { + static int bServiceExists=-1; + ias={0}; + if (bServiceExists==-1) + bServiceExists=ServiceExists(MS_INSERTANISMILEY); + if (!bServiceExists) return FALSE; + ias.cbSize=sizeof(INSERTANISMILEY); + ias.hWnd=_hwnd; + ias.tcsFilename=_szFilename; + ias.dwFlags=IASF_TCHAR; + ias.nHeight=_nHeight; + ias.dwBackColor=_dwBack; + return (bool) CallService(MS_INSERTANISMILEY,(WPARAM)&ias, 0); + }; +*) + + +{ + NM_FIREVIEWCHANGE is WM_NOTIFY Message for notify parent of host window about smiley are going to be repaint + + The proposed action is next: Owner of RichEdit windows received NM_FIREVIEWCHANGE through WM_NOTIFY + twice first time before painting|invalidating (FVCN_PREFIRE) and second time - after (FVCN_POSTFIRE). + The Owner window may change any values of received FVCNDATA_NMHDR structure in order to raise needed action. + For example it may substitute FVCA_INVALIDATE to FVCA_CUSTOMDRAW event to force painting on self offscreen context. + + It can be: + FVCA_CUSTOMDRAW - in this case you need to provide valid HDC to draw on and valid RECT of smiley + FVCA_INVALIDATE - to invalidate specified rect of window + FVCA_NONE - skip any action. But be aware - animation will be stopped till next repainting of smiley. + FVCA_SENDVIEWCHANGE - to notify richedit ole about object changed. Be aware Richedit will fully reconstruct itself + + Another point is moment of received smiley rect - it is only valid if FVCA_DRAW is initially set, + and it is PROBABLY valid if FVCA_INVALIDATE is set. And it most probably invalid in case of FVCA_SENDVIEWCHANGE. + The smiley position is relative last full paint HDC. Usually it is relative to top-left corner of host + richedit (NOT it client area) in windows coordinates. +} + +const +// Type of Event one of + FVCN_PREFIRE = 1; + FVCN_POSTFIRE = 2; + +// Action of event are going to be done + FVCA_NONE = 0; + FVCA_DRAW = 1; // do not modify hdc in case of _DRAW, Use _CUSTOMDRAW + FVCA_CUSTOMDRAW = 2; + FVCA_INVALIDATE = 3; + FVCA_SENDVIEWCHANGE = 4; + FVCA_SKIPDRAW = 5; + +// Extended NMHDR structure for WM_NOTIFY +type + TFVCNDATA_NMHDR = record + //NMHDR structure + hwndFrom :HWND; // Window of smiley host + idFrom :uint_ptr; // ignored + code :uint; // NM_FIREVIEWCHANGE + + cbSize :size_t; + bEvent :byte; // FVCN_ value - pre- or post- painting + bAction :byte; // FVCA_ keys + hDC :HDC; // Canvas to draw on + rcRect :TRECT; // Valid/should be in case of FVCA_DRAW + clrBackground:TCOLORREF; // color to fill background if fTransparent is not set + fTransparent :bool; // if need to fill back color + lParam :LPARAM; // used by host window PreFire and PostFire event + end; + +const +// Code of WM_NOTIFY message (code) + NM_FIREVIEWCHANGE = NM_FIRST+1; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_autoreplacer.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_autoreplacer.inc new file mode 100644 index 0000000000..bc1d528463 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_autoreplacer.inc @@ -0,0 +1,39 @@ +{ + AutoReplacer plugin + by Angelo Luiz Tartari +} + +{$IFNDEF M_AUTOREPLACER} +{$DEFINE M_AUTOREPLACER} + +const + +{ + Adds a window handle to AutoReplacer. + This handle must belong to any window based on a editbox (editbox, richtext, TMemo, TEdit, TMaskEdit, etc.). + After adding a handle, AutoReplacer will automatically work on this window. + wParam = 0 + lParam = (LPARAM)(HWND)hwnd + Returns: 0 on success, -1 if hwnd is invalid, 1 on error. +} + MS_AUTOREPLACER_ADDWINHANDLE = 'AutoReplacer/AddWinHandle'; + +{ + Removes a window handle from AutoReplacer's list. + wParam = 0 + lParam = (LPARAM)(HWND)hwnd + Returns: 0 on success, -1 if hwnd is invalid, 1 if hwnd wasn't found. +} + MS_AUTOREPLACER_REMWINHANDLE = 'AutoReplacer/RemWinHandle'; + + function autoreplacer_AddWinHandle(hwnd: HWND): integer; + begin + Result := CallService(MS_AUTOREPLACER_ADDWINHANDLE, 0, LPARAM(hwnd)); + end; + + function autoreplacer_RemWinHandle(hwnd: HWND): integer; + begin + Result := CallService(MS_AUTOREPLACER_REMWINHANDLE, 0, LPARAM(hwnd)); + end; + +{$ENDIF} \ No newline at end of file diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_contactdir.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_contactdir.inc new file mode 100644 index 0000000000..1b21717753 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_contactdir.inc @@ -0,0 +1,164 @@ +{ +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2005 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +} + +{$IFNDEF M_CONTACTDIR} +{$DEFINE M_CONTACTDIR} + +{ Contactdir module was created on 2005/05/17, 0.4.0.1 + + -- How you use this module as a protocol -- + + On Load() Register your protocol with the setting name that stores unique IDs, example: + + if ( ContactDir_SupportExists() ) g_Atom=ContactDir_Register("ICQ", "UIN"); + + This will register your protocol and walk the database looking for all contacts on PROTOCOL_NAME which have + a "UIN" setting and store it in memory (converting to a string as needed) You of course have to + provide fallback if the services don't exist, it's an idea to keep existing code for that. + + - + + When you add a new contact via MS_DB_CONTACT_ADD, you must register it with your protocol atom too, via + ContactDir_AddContact(atom, "UIN #", hContact) and when it is deleted ContactDir_RemoveContact(atom, "UIN #") + + - + + To find a contact, use ContactDir_Lookup(atom, "ICQ #") which will return the hContact. +} + +type + PCONTACTDIRECTORYDESCRIPTOR = ^TCONTACTDIRECTORYDESCRIPTOR; + TCONTACTDIRECTORYDESCRIPTOR = record + cbSize :int; + szProto :PAnsiChar; + szSetting:PAnsiChar; + atom :THANDLE; // out arg + end; + +{ + wParam: 0 + lParam: (LPARAM) &CONTACTDIRECTORYDESCRIPTOR; + Affect: Register a given protocol and it's setting name which contains the unique key entry. e.g. ("ICQ", "UIN") + and return a HANDLE for use with other lookup services. + Returns: 0 on success, non zero on failure -- a returned handle is in .atom + Note: The directory will convert dword values into string representations but will not do this for bytes or words + used as IDs -- the protocol has to convert the IDs itself (: + Note: See ContactDir_Register() for a quicker way. + *** WARNING ***: This service does not expect the given module name to have registered as a protocol module, it + completely bypasses this information. + Version: 0.4.0.1 (2005/05/17+) +} +const + MS_CONTACTDIR_REGISTER = 'ContactDir/Register'; + +type + PCONTACTDIRECTORYLOOKUP = ^TCONTACTDIRECTORYLOOKUP; + TCONTACTDIRECTORYLOOKUP = record + cbSize :int; + atom :THANDLE; // Atom handle from MS_CONTACTDIR_REGISTER + szID :PAnsiChar; // in: value you wish to find (makes its own copy if needed) + hContact:THANDLE; // out: hContact associated with szID, if any. + end; + +{ + wParam: 0 + lParam: (LPARAM) &CONTACTDIRECTORYLOOKUP; + Affect: Given an atom and string ID, will find the associated DB hContact value + Returns: 0 on success, non zero on failure + Version: 0.4.0.1 (2005/05/17+) + Note: ContactDir_Lookup() helper macro might be of use. +} +const + MS_CONTACTDIR_LOOKUP = 'ContactDir/Lookup'; + +{ + wParam: 0 + lParam: (LPARAM)&CONTACTDIRECTORYLOOKUP; + Affect: Add a contact to a protocol atom association. + Returns: 0 on success, non zero on failure + Version: 0.4.0.1 (2005/05/17+) + Note: You must call this when you create a contact with MS_DB_CONTACT_ADD, see ContactDir_AddContact() +} + MS_CONTACTDIR_ADDCONTACT = 'ContactDir/AddContact'; + +{ + wParam: 0 + lParam: (LPARAM)&CONTACTDIRECTORYLOOKUP; + Affect: Remove a contact to a protocol atom association. + Returns: 0 on success, non zero on failure + Version: 0.4.0.1 (2005/05/17+) + Note: see ContactDir_RemoveContact() +} + MS_CONTACTDIR_REMOVECONTACT = 'ContactDir/RemoveContact'; + +(* +/* -- Helper functions -- */ + +static int ContactDir_SupportExists(void) +{ + return ServiceExists(MS_CONTACTDIR_REGISTER); +} + +// Only take as valid if ContactDir_SupportExists() returns true. +static HANDLE ContactDir_Register(AnsiChar * szProto, AnsiChar * szSetting) +{ + CONTACTDIRECTORYDESCRIPTOR cd; + cd.cbSize=sizeof(CONTACTDIRECTORYDESCRIPTOR); + cd.szProto=szProto; + cd.szSetting=szSetting; + cd.atom=NULL; + CallService(MS_CONTACTDIR_REGISTER, 0, (LPARAM)&cd); + return cd.atom; +} + +static __inline HANDLE ContactDir_Lookup(HANDLE atom, AnsiChar * szID) +{ + CONTACTDIRECTORYLOOKUP f; + f.cbSize=sizeof(f); + f.atom=atom; + f.szID=szID; + f.hContact=NULL; + CallService(MS_CONTACTDIR_LOOKUP, 0, (LPARAM)&f); + return f.hContact; +} + +static __inline void ContactDir_AddContact(HANDLE atom, AnsiChar * szID, HANDLE hContact) +{ + CONTACTDIRECTORYLOOKUP c = {0}; + c.cbSize=sizeof(CONTACTDIRECTORYLOOKUP); + c.atom=atom; + c.szID=szID; + c.hContact=hContact; + CallService(MS_CONTACTDIR_ADDCONTACT, 0, (LPARAM)&c); +} + +static __inline void ContactDir_RemoveContact(HANDLE atom, AnsiChar * szID) +{ + CONTACTDIRECTORYLOOKUP c = {0}; + c.cbSize=sizeof(CONTACTDIRECTORYLOOKUP); + c.atom=atom; + c.szID=szID; + c.hContact=NULL; + CallService(MS_CONTACTDIR_REMOVECONTACT, 0, (LPARAM)&c); +} +*) +{$ENDIF} \ No newline at end of file diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_db3xsa.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_db3xsa.inc new file mode 100644 index 0000000000..77ac666967 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_db3xsa.inc @@ -0,0 +1,84 @@ +{ +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2007 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +} + +{$IFNDEF M_DB3XSA} +{$DEFINE M_DB3XSA} + +const +{ DB/SetPassword v0.5.1.3+ + This service is used to set, change or clear the password used for encrypting the profile. + It opens the password change dialog. + wParam=0 + lParam=0 +} + MS_DB_SETPASSWORD = 'DB/SetPassword'; + +{ DB/Backup v0.5.1.3+ + This service will make a backup of your current profile. Backups are named + xx.bak where xx is the number of backups. The larger the number, the + older the backup. + wParam=0 + lParam=0 +} + MS_DB_BACKUP = 'DB/Backup'; + +{ DB/Backup v0.5.1.3+ + This service is the trigger action service and does the same as the service above. + Only difference is wParam carries flags from trigger plugin. + wParam=flags + lParam=0 +} + MS_DB_BACKUPTRIGGER = 'DB/BackupTriggerAct'; + +{ DB/GetProfilePath(W) v0.5.1.5+ + Gets the path of the profile currently being used by the database module. This + path does not include the last '\'. It is appended with the profile's name if + ProfileSubDir=yes is set in the mirandaboot.ini. + wParam=(WPARAM)(int)cbName + lParam=(LPARAM)(AnsiChar*)pszName + pszName is a pointer to the buffer that receives the path of the profile + cbName is the size in bytes of the pszName buffer + Returns 0 on success or nonzero otherwise +} + MS_DB_GETPROFILEPATHW = 'DB/GetProfilePathW'; + + +{ DB/GetProfilePathBasic(W) v0.5.1.5+ + Gets the path of the profile currently being used by the database module. This + path does not include the last '\'. This is never appended with the profile's name. + wParam=(WPARAM)(int)cbName + lParam=(LPARAM)(AnsiChar*)pszName + pszName is a pointer to the buffer that receives the path of the profile + cbName is the size in bytes of the pszName buffer + Returns 0 on success or nonzero otherwise +} + MS_DB_GETPROFILEPATH_BASIC = 'DB/GetProfilePathBasic'; + MS_DB_GETPROFILEPATH_BASICW = 'DB/GetProfilePathBasicW'; + + MIRANDAPATH = '%MIRANDAPATH%'; + MIRANDAPATHW = '%MIRANDAPATH%'; + PROFILEPATH = '%PROFILEPATH%'; + PROFILEPATHW = '%PROFILEPATH%'; + PROFILENAME = '%PROFILENAME%'; + PROFILENAMEW = '%PROFILENAME%'; + +{$ENDIF} \ No newline at end of file diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_ersatz.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_ersatz.inc new file mode 100644 index 0000000000..553194eee2 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_ersatz.inc @@ -0,0 +1,41 @@ +{ +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2006 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +} + +{$IFNDEF M_ERSATZ} +{$DEFINE M_ERSATZ} + +const +// Returns the status message for a status +// wParam=(word) 0 for current status or a status +// lParam=0 +// Returns status msg or NULL if there is none. The protocol have to handle only the current +// status. Handling messages for other statuses is optional. +// Remember to mir_free the return value + PS_GETMYAWAYMSG = '/GetMyAwayMsg'; + +// Created if ersatz is installed +// wParam=0 +// lParam=0 +// returns always 1 + MS_ERSATZ_ENABLED = 'ERSATZ/Enabled'; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_fuse.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_fuse.inc new file mode 100644 index 0000000000..82b002b5db --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_fuse.inc @@ -0,0 +1,28 @@ +{$IFNDEF M_FUSE} +{$DEFINE M_FUSE} + +const + FUSE_INIT = 0; // core started, Param=**FUSE_LINK + FUSE_DEINIT = 1; // core stopped + FUSE_DEFMOD = 3; // LoadDefaultModules() return code, Param=*int + FUSE_DEATH = 4; // DestroyingModularEngine() just got called + +type + PFUSE_LINK = ^TFUSE_LINK; + TFUSE_LINK = record + cbSize : longint; + CreateHookableEvent : function (para1:PAnsiChar):THANDLE;cdecl; + DestroyHookableEvent : function (para1:THANDLE):longint;cdecl; + NotifyEventHooks : function (para1:THANDLE; para2:WPARAM; para3:LPARAM):longint;cdecl; + HookEvent : function (para1:PAnsiChar; para2:TMIRANDAHOOK):THANDLE;cdecl; + HookEventMessage : function (para1:PAnsiChar; para2:HWND; para3:dword):THANDLE;cdecl; + UnhookEvent : function (para1:THANDLE):longint;cdecl; + CreateServiceFunction : function (para1:PAnsiChar; para2:TMIRANDASERVICE):THANDLE;cdecl; + CreateTransientServiceFunction : function (para1:PAnsiChar; para2:TMIRANDASERVICE):THANDLE;cdecl; + DestroyServiceFunction : function (para1:THANDLE):longint;cdecl; + CallService : function (para1:PAnsiChar; para2:WPARAM; para3:LPARAM):longint;cdecl; + ServiceExists : function (para1:PAnsiChar):longint;cdecl; {v0.1.0.1+ } + CallServiceSync : function (para1:PAnsiChar; para2:WPARAM; para3:LPARAM):longint;cdecl; {v0.1.2.2+ } + end; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_help(plugin).inc b/plugins/!Deprecated/ExternalAPI/delphi/m_help(plugin).inc new file mode 100644 index 0000000000..0eb63615d9 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_help(plugin).inc @@ -0,0 +1,76 @@ +{ +Miranda IM Help Plugin +Copyright (C) 2002 Richard Hughes, 2005-2007 H. Herkenrath + +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 (Help-License.txt); if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +} + +{$IFNDEF M_HELP} +{$DEFINE M_HELP} + +const + +{ + Help Plugin 0.2.1.2 + All services in here except MS_HELP_SHOWLANGDIALOG should be thread-safe, + you can call them from any thread +} + +{ interface id } + MIID_HELP: TGUID = '{302660C5-1BF6-4054-A79F-77B1965D6F48}'; + +{ Enable/disable the help context menu for a specific control. v0.2.0.0+ +Note: You normally do not need to call this, read below. +You can can use this to deactivate the appearance of the help context menu +being shown when the user right clicks on an control. +You can use this service to disable the context menu. + +You do *not* need to use this service when you would like to show +a context menu by yourself, just handle WM_CONTEXTMENU correctly instead. +You need to return TRUE in your DlgProc or 0 in your WndProc, indicating 'message handled'. + +The context menu is disabled by default on the following controls (looks silly on multi-component controls): +ListView, TreeView, Statusbar, Toolbar, CLC +AutoTips are disabled by default for controls stating DLGC_WANTALLKEYS or DLGC_HASSETSEL at +WM_GETDLGCODE (autotips are annoying on edits). + wParam : (HWND)hwndCtl + lParam : flags (see below) +Returns 0 on success or nonzero on failure +} + MS_HELP_SETCONTEXTSTATE = 'Help/SetContextState'; + HCSF_CONTEXTMENU = $01; // show help context menu for this control + HCSF_AUTOTIP = $02; // show automatic help tip on hover for this control + // only works for non-editable + +{ Show a help tooltip for a specific control or dialog. v0.2.0.0+ +You can call this if you would like to show help at a specific time. + wParam : (HWND)hwndCtl + lParam : 0 +Returns 0 on success or nonzero on failure. +The service fails when the help tooltip cannot be instantiated. +} + MS_HELP_SHOWHELP = 'Help/ShowHelp'; + +{ Show the download language dialog. v0.2.1.0+ + wParam : 0 + lParam : 0 +The dialog can't have a parent due to it's asynchronous nature. +If the language window is already opened it will be +brought to front instead (returns success). +Returns 0 on success, nonzero otherwise. +} + MS_HELP_SHOWLANGDIALOG = 'Help/ShowLangDialog'; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_historyevents.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_historyevents.inc new file mode 100644 index 0000000000..ae582f0eef --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_historyevents.inc @@ -0,0 +1,201 @@ +{ +Copyright (C) 2006 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +} + + +{$IFNDEF M_HISTORYEVENTS} +{$DEFINE M_HISTORYEVENTS} + +const + HISTORYEVENTS_FORMAT_CHAR = 1; + HISTORYEVENTS_FORMAT_WCHAR = 2; + HISTORYEVENTS_FORMAT_RICH_TEXT = 4; + HISTORYEVENTS_FORMAT_HTML = 8; + +const + HISTORYEVENTS_FLAG_DEFAULT = 1 shl 0; // Is a miranda core event type + HISTORYEVENTS_FLAG_SHOW_IM_SRMM = 1 shl 1; // If this event has to be shown in srmm dialog + HISTORYEVENTS_FLAG_USE_SENT_FLAG = 1 shl 2; // Means that it can be a sent or received and uses DBEF_SENT to mark that + HISTORYEVENTS_FLAG_EXPECT_CONTACT_NAME_BEFORE = 1 shl 3; // Means that who is drawing this should draw the contact name before the text + HISTORYEVENTS_FLAG_ONLY_LOG_IF_SRMM_OPEN = 1 shl 4; // If this event will be logged only if the message window is open + HISTORYEVENTS_FLAG_FLASH_MSG_WINDOW = 1 shl 5; // If this event will trigger the openning/flashing of the message window + + HISTORYEVENTS_REGISTERED_IN_ICOLIB = 9 shl 16; // If the icon is a name already registered in icolib + + HISTORYEVENTS_FLAG_KEEP_ONE_YEAR = 1 shl 8; // By default store in db for 1 year + HISTORYEVENTS_FLAG_KEEP_SIX_MONTHS = 2 shl 8; // By default store in db for 6 months + HISTORYEVENTS_FLAG_KEEP_ONE_MONTH = 3 shl 8; // By default store in db for 1 month + HISTORYEVENTS_FLAG_KEEP_ONE_WEEK = 4 shl 8; // By default store in db for 1 week + HISTORYEVENTS_FLAG_KEEP_ONE_DAY = 5 shl 8; // By default store in db for 1 day + HISTORYEVENTS_FLAG_KEEP_FOR_SRMM = 6 shl 8; // By default store in db only enought for message log + HISTORYEVENTS_FLAG_KEEP_MAX_TEN = 7 shl 8; // By default store in db max 10 entries + HISTORYEVENTS_FLAG_KEEP_MAX_HUNDRED = 8 shl 8; // By default store in db for 100 entries + HISTORYEVENTS_FLAG_KEEP_DONT = 9 shl 8; // By default don't store in db (aka ignore it) + + +// This function must be implemented by subscribers. It must return a pointer or NULL +// to say it can't handle the text +type + fGetHistoryEventText = function(hContact:THANDLE; hDbEvent:THANDLE; + dbe:PDBEVENTINFO; format:int):pointer; cdecl; + +type + HISTORY_EVENT_HANDLER = record + cbSize :int; + module :PAnsiChar; + name :PAnsiChar; // Internal event name + description:PAnsiChar; // Will be translated. When retrieving it is already translated + eventType :word; // The event type it can handle + defaultIcon:HICON; // PAnsiChar= icon name if HISTORYEVENTS_REGISTERED_IN_ICOLIB is set. + // Always use this one when retrieving + supports :int; // What kind of return is supported - or of HISTORYEVENTS_FORMAT_* + flags :int; // or of HISTORYEVENTS_FLAG_* + pfGetHistoryEventText:fGetHistoryEventText; // NULL to use default get text (similar to message, without extra format) + + // Aditional data if wants to use add to history services + templates:^PAnsiChar; // Each entry is: "Name\nDefault\n%var%\tDescription\n%var%\tDescription\n%var%\tDescription" + numTemplates:int; + end; +const +{ + Get the number of registered events + + wParam: ignored + lParam: ignored + Return: The number of events registered with the plugin +} + MS_HISTORYEVENTS_GET_COUNT:PAnsiChar = 'HistoryEvents/GetCount'; + +{ + Get an event by number or by type. + To retrieve by number, pass -1 as type. To retrieve by type, pass -1 as number. + + wParam: (int) event number + lParam: (int) event type + Return: (const HISTORY_EVENT_HANDLER *) if the event exists, NULL otherwise. Don't change the + returned strunc: it is a pointer to the internall struct. +} + MS_HISTORYEVENTS_GET_EVENT:PAnsiChar = 'HistoryEvents/GetEvent'; + +{ + Register a plugin that can handle an event type. This must be called during the call to the + Load function of the plugin. In ModulesLoaded callback all plugins have to be already + registered, so srmm and history modules can query then. + + wParam: HISTORY_EVENT_HANDLER * + lParam: ignored + Return: 0 for success +} + MS_HISTORYEVENTS_REGISTER:PAnsiChar = 'HistoryEvents/Register'; + + +type + HISTORY_EVENT_PARAM = record + cbSize :int; + hDbEvent:THANDLE; + dbe :PDBEVENTINFO; // Optional + format :int; // one of HISTORYEVENTS_FORMAT_* + end; + +const +{ + Check if an event can be handled by any subscribers + + wParam: WORD - event type + lParam: ignored + Return: BOOL +} + MS_HISTORYEVENTS_CAN_HANDLE:PAnsiChar = 'HistoryEvents/CanHandle'; + +{ + Get the icon for a history event type + + wParam: WORD - event type + lParam: ignored + Return: HICON - after use free with MS_HISTORYEVENTS_RELEASE_ICON +} + MS_HISTORYEVENTS_GET_ICON:PAnsiChar = 'HistoryEvents/GetIcon'; + +{ + Get the flags for a history event type + + wParam: WORD - event type + lParam: ignored + Return: int - or of HISTORYEVENTS_FLAG_* or -1 if error +} + MS_HISTORYEVENTS_GET_FLAGS:PAnsiChar = 'HistoryEvents/GetFlags'; + +{ + Release the icon for a history event type. This is really just a forward to icolib + + wParam: HICON + lParam: ignored +} + MS_HISTORYEVENTS_RELEASE_ICON:PAnsiChar = 'Skin2/Icons/ReleaseIcon'; + +{ + Get the text for a history event type + + wParam: HISTORY_EVENT_PARAM * + lParam: ignored + Return: char * or wchar * depending on sent flags. Free with mir_free or MS_HISTORYEVENTS_RELEASE_TEXT +} + MS_HISTORYEVENTS_GET_TEXT:PAnsiChar = 'HistoryEvents/GetText'; + +{ + Release the text for a history event type. Internally is just a call to mir_free + + wParam: char * or wchar * + lParam: ignored +} + MS_HISTORYEVENTS_RELEASE_TEXT:PAnsiChar = 'HistoryEvents/ReleaseText'; + + +type + HISTORY_EVENT_ADD = record + cbSize :int; + hContact :THANDLE; + eventType :word; + templateNum :int; + variables :^PTCHAR; // TCHAR **variables + numVariables :int; + additionalData :pbyte; + additionalDataSize:int; + flags :int; // Flags for the event type + end; + +const +{ + Add an registered event to the history. This is a helper service + + wParam: HISTORY_EVENT_ADD + lParam: ignored + Return: HANDLE to the db event +} + MS_HISTORYEVENTS_ADD_TO_HISTORY:PAnsiChar = 'HistoryEvents/AddToHistory'; + +{ + Check if a template is enabled + + wParam: event type + lParam: template num + Return: TRUE or FALSE +} + MS_HISTORYEVENTS_IS_ENABLED_TEMPLATE:PAnsiChar = 'HistoryEvents/IsEnabledTemplate'; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_ircscript.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_ircscript.inc new file mode 100644 index 0000000000..0157443e30 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_ircscript.inc @@ -0,0 +1,125 @@ +{ + This file is a description of the interface between the Miranda Scripting + Plugin (MSP) and IRC. It is mainly an internal draft. + + The MSP is a powerful PHP based scripting engine + which can automate many tasks in Miranda IM. With the implementation of + this interface IRC can also benefit from the advantages MSP brings. The + interface has been constructed by the respective authors of IRC and MSP. + + The idea is that MSP and IRC should communicate via the interface outlined herein, + but MSP should "package" the data in attractive functions that can be easily + used by eager scripters. + + Note that m_chat.h should be #included as the events defined therein is used in this interface + + The IRC plugin communicates with MSP mainly through 8 (2 x 4) services which are + illustrated by the following matrix (MSP has 4 services and IRC 4 services): + + -------------------------------------------------- + | | | + | Incoming raw data | Data going | + | from server | to GUI | + | (before processing) | (after processing) | + | | | + -------------------------------------------------- + | | | + | Outgoing raw data | Data going | + | to server | from GUI | + | (after processing) | (before processing) | + | | | + -------------------------------------------------- + + (processing refers to the IRC plugin reacting to different commands) +} + +{$IFNDEF M_IRCSCRIPT} +{$DEFINE M_IRCSCRIPT} + +//------------------------- HANDLING RAW MESSAGES ------------------------ +{ + The two leftmost boxes are related to data sent to and from the server in RAW form. + (a typical RAW message looks like this: ":nick!user@host COMMAND PARAMETERS") + + It is very useful for scripters to be able to manipulate and add RAW streams of data. + + The below structure is used when RAW data is generated and IRC must trigger an + event in MSP so the scripts can do their magic. + + If the data is modified make sure to use MS_SYSTEM_GET_MMI and then mmi_realloc() to + allocate from the same heap. Do not free the data. + + wParam= Module name + lParam= (LPARAM)(AnsiChar *)pszRaw + returns nonzero if the message should be dropped +} + +{ + NOTE! IRC will implement two services which also uses the same parameters: + + "/InsertRawIn" //used for inserting a "fake" incoming RAW event + "/InsertRawOut" //used for inserting a "fake" outgoing RAW event +} + +const + MS_MBOT_IRC_RAW_IN = 'MBot/IrcRawIn'; + MS_MBOT_IRC_RAW_OUT = 'MBot/IrcRawOut'; + +//------------------------- HANDLING GUI MESSAGES 1 ------------------------ +{ + The top rightmost box is related to data sent to the gui + (currently chat.dll) in the form of GCEVENT's. (see m_chat.h) + + While maybe not as useful to the scripter, it can be useful to be able to + "tap into" messages to the GUI from the IRC plugin. + + If the data is modified make sure to realloc() or similar. + + wParam= (WPARAM) (WPARAM_GUI_IN) &wgi + lParam= (LPARAM)(GCEVENT *)&gce // see m_chat.h + returns nonzero if the message should be dropped +} + +{ + NOTE! IRC will implement a service which also uses the same parameters: + + "/InsertGuiIn" //used for inserting a "fake" event to the GUI +} +type + PWPARAM_GUI_IN = ^WPARAM_GUI_IN; + WPARAM_GUI_IN = record + pszModule:PAnsiChar; + wParam:WPARAM; + end; + PMBOT_GUI_WPARAM_IN_STRUCT = PWPARAM_GUI_IN; + TMBOT_GUI_WPARAM_IN_STRUCT = WPARAM_GUI_IN; + +const + MS_MBOT_IRC_GUI_IN = 'MBot/IrcGuiIn'; + +//------------------------- HANDLING GUI MESSAGES 2 ------------------------ +{ + The bottom rightmost box is related to data sent from the gui + (currently chat.dll) in the form of GCHOOKS's. Originally this is carried out in a hook, + but for MSP this is done via a service instead. + + It can be useful for scripters to simulate user actions, like entering text, closing the window etc + + If the data is modified make sure to realloc() or similar. + + wParam= Module name + lParam= (LPARAM)(GCHOOK *)gch // see m_chat.h + returns nonzero if the message should be dropped +} + +{ + NOTE! IRC will implement a service which also uses the same parameters: + + "/InsertGuiOut" //used for inserting a "fake" outgoing event to the GUI +} + + MS_MBOT_IRC_GUI_OUT = 'MBot/IrcGuiOut'; + + MS_MBOT_REGISTERIRC = 'MBot/RegisterIRCModule'; + +{$ENDIF} \ No newline at end of file diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_keybindings.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_keybindings.inc new file mode 100644 index 0000000000..e0c31c31e5 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_keybindings.inc @@ -0,0 +1,58 @@ +{ +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2007 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +} + +{$IFNDEF M_KEYBINDINGS} + +const + KB_CTRL_FLAG = $10000; + KB_SHIFT_FLAG = $20000; + KB_ALT_FLAG = $40000; + + KBDF_UNICODE = 1; + +type + TKEYBINDINGDESC = record + cbSize :int; //size of the structure + szSection :TChar; // section name used to display key bindings in the tree view [TRANSLATED-BY-CORE] + pszActionName :TChar; // action name used to display key bindings in the tree view [TRANSLATED-BY-CORE] + pszActionGroup:PAnsiChar; // action group name used to group unique shortcuts, shortcuts cannot be duplicated within a group + key :array [0..4] of dword; // virtual key + KB_* flags, up to 5 different shortcuts may be defined for each action + flags :dword; // flags (KBDF_*) + action :int; // id of the action + end; + +{Registers action with default key bindings assigned to it. + wParam = (WPARAM) 0; not used + lParam = (LPARAM) (KEYBINDINGDESC*) + return: 0 on success, error code otherwise +} + MS_KEYBINDINGS_REGISTER :PAnsiChar = 'KeyBindings/Register'; + +{Gets action assigned to the given key + key[0] and pszActionGroup in KEYBINDINGDESC should be set before calling this service + wParam = (WPARAM) 0; not used + lParam = (LPARAM) (KEYBINDINGDESC*) + return: 0 if action assigned to the given key was found, 1 otherwise +} + MS_KEYBINDINGS_GET :PAnsiChar = 'KeyBindings/Get'; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_langman.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_langman.inc new file mode 100644 index 0000000000..4f0079719d --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_langman.inc @@ -0,0 +1,46 @@ +{ +'Language Pack Manager'-Plugin for +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2005-2007 H. Herkenrath + +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 (LangMan-License.txt); if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +} + +{$IFNDEF M_LANGMAN} +{$DEFINE M_LANGMAN} + +const + +{ + Language Pack Manager v1.0.2.1 + If you have any question or extension whishes please let me know: + hrathh at users.sourceforge.net +} + +{ interface id } + MIID_LANGMAN: TGUID = '{D80370D5-4B1E-46a8-ACA4-1FAAD79B7D1E}'; + +{ Show the download language dialog. v1.0.1.2+ + wParam : 0 + lParam : 0 +The dialog can't have a parent due to it's asynchronous nature. +If the language window is already opened it will be +brought to front instead (returns success). +Returns 0 on success, nonzero otherwise. +} + MS_LANGMAN_SHOWLANGDIALOG = 'LangMan/ShowLangDialog'; + +{$ENDIF} // M_LANGMAN diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_mathmodule.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_mathmodule.inc new file mode 100644 index 0000000000..a4d10edfa6 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_mathmodule.inc @@ -0,0 +1,199 @@ +{$IFNDEF M_MATHMODULE} +{$DEFINE M_MATHMODULE} + {--------------------------------------------------- } + { + 2 + x + 2 Pi + + R + Sin(wt) + + Math-Module + + Miranda Plugin by Stephan Kassemeyer + MathModule API - (c) Stephan Kassemeyer + 8 May, 2004 + } + { --------- } + { + Miranda Service-functions defined by MathModule + call with the + int ( CallService)(const AnsiChar servicename,WPARAM,LPARAM) + that you get from miranda when Miranda calls the + Load(PLUGINLINK link) + of your PlugIn-dll + the CallService function then is: + link->CallServiceSync(Servicename,wparam,lparam) + } + { --------- } + +const + MATH_RTF_REPLACE_FORMULAE = 'Math/RtfReplaceFormulae'; + { replace all formulas in a RichEdit with bitmaps. } + { wParam = 0 } + { lParam = *TMathRichedit Info } + { return: TRUE if replacement succeeded, FALSE if not (disable by user?). } + { handle of richedit. } + { NULL: replace all. } +type + PMathRicheditInfo = ^TMathRicheditInfo; + TMathRicheditInfo = record + hwndRichEditControl : HWND; + sel : PCHARRANGE; + disableredraw : int; + end; + { WARNING: !!! } + { Strange things happen if you use this function twice on the same CHARRANGE: } + { if Math-startDelimiter == Math-endDelimiter, there is the following problem: } + { it might be that someone forgot an endDelimiter, this results in a lonesome startdelimiter. } + { if you try to MATH_REPLACE_FORMULAE the second time, startDelimiters and endDelimiters are mixed up. } + { The same problem occours if we have empty formulae, because two succeding delimiters are } + { replaced with a single delimiter. } + +const + MATH_GET_STARTDELIMITER = 'Math/GetStartDelimiter'; + { returns the delimiter that marks the beginning of a formula } + { wparam=0 } + { lparam=0 } + { result=*AnsiChar Delimiter } + { !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER } + + MATH_GETENDDELIMITER = 'Math/GetEndDelimiter'; + { returns the delimiter that marks the end of a formula } + { wparam=0 } + { lparam=0 } + { result=*AnsiChar Delimiter } + { !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER } + + MTH_FREE_MATH_BUFFER = 'Math/FreeRTFBitmapText'; + { deletes any buffer that MathModule has created. } + { wparam=0 } + { lparam=(*AnsiChar) buffer } + { result=0 } + + MATH_SETBKGCOLOR = 'Math/SetBackGroundColor'; + { changes the background color of the next formula to be rendered. } + { wparam=0 } + { lparam=(COLORREF) color } + { result=0 } + + MATH_SET_PARAMS = 'Math/SetParams'; + { sets a parameter (only integer values) encoded in wparam } + { wparam=paramcode } + { lparam=parametervalue } + { paramcodes: } +const + MATH_PARAM_BKGCOLOR = 0; // (COLORREF) std-rgb-color or TRANSPARENT_Color + MATH_PARAM_FONTCOLOR = 1; // (COLORREF) std-rgb-color + RESIZE_HWND = 2; // (HWND) preview window resizes RESIZE_HWND when + // it is being resized. + ToolboxEdit_HWND = 3; // (HWND) If this hwnd (of an edit-box) is set, + // MathModule can insert Formula-elements from + // the Math-Toolbox. +// you can make the BKGCOLOR Transparent (default) by using this color: + TRANSPARENT_Color = $FFFFFFFF-1; // this is default + +const + MTH_GETBITMAP = 'Math/GetBitmap'; + {returns Bitmap that represents the formula given in lparam (string-pointer) } + {this formula has NO Delimiters. } + {wparam=0 } + {lparam=(*AnsiChar)Formula } + {result=(HBITMAP) bitmap } + {!!! the bitmap must be deleted with DeleteObject(hobject) } + {example: } + {HBITMAP Bmp=(HBITMAP)CallService(MTH_GETBITMAP,0, (LPARAM)formula); } + + MTH_GET_RTF_BITMAPTEXT = 'Math/GetRTFBitmapText'; + { returns rich-text stream that includes bitmaps from text given in lparam } + { text included between MATH_GET_STARTDELIMITER and MATH_GETENDDELIMITER } + { hereby is replaced with a rtf-bitmap-stream that represents the corresponding formula } + { wparam=0 } + { lparam=*AnsiChar text } + { result=*AnsiChar rtfstream } + { !!! the result-buffer must be deleted with MTH_FREE_RTF_BITMAPTEXT } + + MTH_FREE_RTF_BITMAPTEXT = 'Math/FreeRTFBitmapText'; + { deletes the buffer that MTH_GET_RTF_BITMAPTEXT has created. } + { wparam=0 } + { lparam=(*AnsiChar) buffer } + { result=0 } + + { ************************************************************** } + { The following is still SRMM - specific. } + { I plan to modify it, so that other PlugIns can take advantage of e.g. preview-window.... } +const + MTH_SHOW = 'Math/Show'; + { shows the preview-window } + { wparam=0 } + { lparam=0 } + { result=0 } + + MTH_HIDE = 'Math/Hide'; + { hides the preview-window } + { wparam=0 } + { lparam=0 } + { result=0 } + + MTH_RESIZE = 'Math/Resize'; + { sets the size of the preview-window } + { wparam=0 } + { lparam=(*TMathWindowInfo) } + { result=0 } +type + PTMathWindowInfo = ^TTMathWindowInfo; + TTMathWindowInfo = record + top : int; + left : int; + right : int; + bottom: int; + end; + +const + MTH_SETFORMULA = 'Math/SetFormula'; + { sets the text that the preview-window should parse to display formulas found inside } + { wparam=0 } + { lparam=(*AnsiChar) text } + { result=0 } + + MTH_Set_ToolboxEditHwnd = 'Math/SetTBhwnd'; + { If this hwnd (of an edit-box) is set, MathModule can insert Formula-elements from the Math-Toolbox. } + { wparam=0 } + { lparam=handle } + {übergibt fenster-Handle des aktuellen Message-Dialogs } + + MTH_Set_Srmm_HWND = 'Math/SetSrmmHWND'; + { If MathModule knows the handle of a SRMM-based window, following features exist: } + { - preview window resizes Math-Srmm when it is being resized. } + { wparam=0 } + { lparam=handle } + { result=0 } + { todo: umbenennen in MTH_Set_ResizeWindowHandle, zusaetzlich MTH_Set_ToolboxEditHandle erstellen, dann keine SRMM-Abhaengigkeit mehr. } + { damit ResizeWindows selbst entscheiden koennen, was sie tun, kann man auch ein miranda-event "MTH_preview_resized" einrichten. } + + MTH_GET_PREVIEW_HEIGHT = 'Math/getPreviewHeight'; + { returns the height of the whole preview-window (including system-menu-bar) } + { consider this when maximizing a window to that preview-window is hooked on top or bottom } + { it returns the height no matter whether preview-window is visible or not } + { wparam=0 } + { lparam=0 } + { result=(int) height } + + MTH_GET_PREVIEW_SHOWN = 'Math/getPreviewShown'; + { returns 1 if preview window is visible } + { returns 0 if preview window is invisible } + { result=(int) shown } + + MTH_SUBSTITUTE_DELIMITER = 'Math/SubstituteDelimiter'; + { replaces Substitute given lparam-structure with internal Math-Delimiter } + { wparam=0 } + { lparam=(TMathSubstInfo) substInfo } + { result=0 } + +type + PTMathSubstInfo = ^TTMathSubstInfo; + TTMathSubstInfo = record + EditHandle : HWND; + Substitute : PAnsiChar; + end; +{--------------------------------------------------- } +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_motd.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_motd.inc new file mode 100644 index 0000000000..3b986bf02e --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_motd.inc @@ -0,0 +1,75 @@ +{ +Copyright (C) 2005 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +} + +{$IFNDEF M_MOTD} +{$DEFINE M_MOTD} + +//=== SERVICES === + +{ +MOTD/GetMessage service +Get a MOTD + +wparam = (MOTDMessage*)lpMOTDMessage +lparam = 0 +returns: 0 on success, -1 on failure. On success, lpMOTDMessage is filled with the MOTD +} +type + PMOTDMessage = ^TMOTDMessage; + TMOTDMessage = record + cbSize :int; // sizeof(MOTDMessage) + pszMessage :PAnsiChar; // Buffer to store message + cbMessageSize:dword; // Size of message buffer (including '\0') + pszAuthor :PAnsiChar; // Buffer to store author + cbAuthorSize :dword; // Size of author buffer (including '\0') + end; +const + MS_MOTD_GETMESSAGE = 'MOTD/GetMessage'; + +{ +MOTD/AddMessage service +Add a message to the MOTD list + +wparam = (MOTDMessage*)lpMOTDMessage +lparam = 0 +returns: 0 on success, -1 on failure +} + MS_MOTD_ADDMESSAGE = 'MOTD/AddMessage'; + +{ +MOTD/ShowMessage service +Show a popup with a MOTD + +wparam = 0 +lparam = 0 +returns: 0 +} + MS_MOTD_SHOWMESSAGE ='MOTD/ShowMessage'; + +{ +MOTD/ShowAddMessage service +Show a dialog to add a MOTD + +wparam = 0 +lparam = 0 +returns: 0 +} + MS_MOTD_SHOWADDMESSAGE = 'MOTD/ShowAddMessage'; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_nickhistory.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_nickhistory.inc new file mode 100644 index 0000000000..240fc73b29 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_nickhistory.inc @@ -0,0 +1,50 @@ +{ +Copyright (C) 2006 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +} + +{$IFNDEF M_NICKHISTORY} +{$DEFINE M_NICKHISTORY} + +const + EVENTTYPE_NICKNAME_CHANGE = 9001; + +{ +Return TRUE is Nick History is enabled for this contact + +wParam: hContact +lParam: ignored +} + MS_NICKHISTORY_ENABLED = 'NickHistory/Enabled'; + +{ +Enable Nick History for a contact + +wParam: hContact +lParam: ignored +} + MS_NICKHISTORY_ENABLE = 'NickHistory/Enable'; + +{ +Disable Nick History for a contact + +wParam: hContact +lParam: ignored +} + MS_NICKHISTORY_DISABLE = 'NickHistory/Disable'; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_simpleaway.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_simpleaway.inc new file mode 100644 index 0000000000..16bf2328fb --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_simpleaway.inc @@ -0,0 +1,26 @@ +{$IFNDEF M_SIMPLEAWAY} +{$DEFINE M_SIMPLEAWAY} + +const +// lParam = (AnsiChar *)status message +// wParam = new status, from statusmodes.h + MS_SA_SETSTATUSMODE = 'SimpleAway/SetStatusMode'; + MS_AWAYSYS_SETSTATUSMODE = MS_SA_SETSTATUSMODE //for compatibility with some plugins + +//Internal use only + MS_SA_TTCHANGESTATUSMSG = 'SimpleAway/TTChangeStatusMessage'; + +//wParam=new status, from statusmodes.h +//lParam=protocol name, NULL if for all protocols (added in v0.3.1alpha) + MS_SA_CHANGESTATUSMSG = 'SimpleAway/ChangeStatusMessage' + +// wParam = 0 +// lParam = 0 +// allways returns 1 + MS_SA_ISSARUNNING = 'SimpleAway/IsSARunning'; + +// wParam = 0 +// lParam = 0 + MS_SA_COPYAWAYMSG = 'SimpleAway/CopyAwayMsg'; + +{$ENDIF} \ No newline at end of file diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_smh.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_smh.inc new file mode 100644 index 0000000000..134b2075e8 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_smh.inc @@ -0,0 +1,50 @@ +{ +Copyright (C) 2006 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +} + +{$IFNDEF M_SMH} +{$DEFINE M_SMH} + +const + EVENTTYPE_STATUSMESSAGE_CHANGE = 9002; + +{ +Return TRUE is Status Message History is enabled for this contact + +wParam: hContact +lParam: ignored +} + MS_SMH_ENABLED = 'SMH/Enabled'; + +{ +Enable Status Message History for a contact + +wParam: hContact +lParam: ignored +} + MS_SMH_ENABLE = 'SMH/Enable'; + +{ +Disable Status Message History for a contact + +wParam: hContact +lParam: ignored +} + MS_SMH_DISABLE = 'SMH/Disable'; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_smr.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_smr.inc new file mode 100644 index 0000000000..d8feacfc6a --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_smr.inc @@ -0,0 +1,59 @@ +{ +Copyright (C) 2005 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +} + +{$IFNDEF M_SMR} +{$DEFINE M_SMR} + +const +{ +Return TRUE is smr is enabled for this protocol +If is enabled, status message is kept under CList\StatusMsg db key in user data + +wParam: protocol name +lParam: ignored +} + MS_SMR_ENABLED_FOR_PROTOCOL = 'SMR/MsgRetrievalEnabledForProtocol'; + +{ +Return TRUE is smr is enabled for this contact and its protocol (smr can be +disabled per user, if protocol is enabled) +If is enabled, status message is kept under CList\StatusMsg db key in user data + +wParam: hContact +lParam: ignored +} + MS_SMR_ENABLED_FOR_CONTACT = 'SMR/MsgRetrievalEnabledForUser'; + +{ +Enable status message retrieval for a contact + +wParam: hContact +lParam: ignored +} + MS_SMR_ENABLE_CONTACT = 'SMR/EnableContactMsgRetrieval'; + +{ +Disable status message retrieval for a contact + +wParam: hContact +lParam: ignored +} + MS_SMR_DISABLE_CONTACT = 'SMR/DisableContactMsgRetrieval'; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_snapping_windows.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_snapping_windows.inc new file mode 100644 index 0000000000..e3c513482a --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_snapping_windows.inc @@ -0,0 +1,35 @@ +{$IFNDEF SNAPPING_WINDOWS} +{$DEFINE SNAPPING_WINDOWS} + +type + PSnapWindowProc = ^TSnapWindowProc; + TSnapWindowProc = record + hWnd : THWND; + m_szMoveOffset : TSIZE; + wParam : WPARAM; + lParam : LPARAM; + Reserved1 : int; + Reserved2 : int; + Reserved3 : int; + end; + +const + MS_SNAPWINDOWPROC = 'Utils/SnapWindowProc'; + +function CallSnappingWindowProc(hwnd:hwnd; nMessage:int; + wParam:WPARAM;lParam:LPARAM):int;// cdecl; +const + SnapInfo:TSnapWindowProc=(); +begin + result:=0; + if (nMessage=WM_MOVING) or (nMessage=WM_NCLBUTTONDOWN) or + (nMessage=WM_SYSCOMMAND) or (nMessage=WM_SIZING) then + begin + SnapInfo.hWnd := hwnd; + SnapInfo.wParam := wParam; + SnapInfo.lParam := lParam; + CallService(MS_SNAPWINDOWPROC,WPARAM(@SnapInfo),nMessage); + if nMessage=WM_SIZING then result:=1; + end; +end; +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_spamfilter.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_spamfilter.inc new file mode 100644 index 0000000000..54c4729a81 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_spamfilter.inc @@ -0,0 +1,751 @@ +{ +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright © 2003-2004 Heiko Herkenrath + +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. +} + +{$IFNDEF M_SPAMFILTER} +{$DEFINE M_SPAMFILTER} + +const +// Spam Filter Version: 2.5.2.1 +// See "spamcheck.c" in the sources for an example on how to use the spam checking services. + +// The functionality and the API of Spam Filter is quite complex +// and not easy to describe or explain. +// If you have any question or extension whishes please send me an e-mail: +// hrathh at users.sourceforge.net + +// Notes: +// * All services are fully thread-safe, you can call everything from any thread +// (If there are problems with it it is a bug :-) ) +// * Unicode parameters can also be passed to the ANSI version of the plugin +// and the other way round. The strings get converted as they are needed +// using automatic two-way translation. +// Unicode support was added in v2.5.0.0. + +// ------------------------------------------- +// -- Getting handles ------------------------ +// ------------------------------------------- + + MS_SPAMFILTER_GETHANDLE = 'SpamFilter/GetHandle'; + +// Description: +// ------------- +// Gets a specified icon/window handle. + +// Parameters: +// ------------- +// wParam = (uint)uHandleType (see below); +// lParam = 0 + +// Possible values for wParam: + SFHT_HWND_PLUGIN_OPTIONS = 2; // HWND of the "Spam Filter" options dialog (if it is loaded; else NULL) + SFHT_HICON_SPAM = 3; // HICON of the spam icon (small): needs to be destroyed! (DestroyIcon()) + // Added in v2.0.2.0: + SFHT_HICON_SPAM_LARGE = 4; // HICON of the spam icon (large): needs to be destroyed! (DestroyIcon()) + SFHT_HICON_SPAM_LAYER = 5; // HICON of the spam layer icon (small): needs to be destroyed! (DestroyIcon()) + // Icons are taken directly from resources, not skinned by user + // Added in v2.0.3.0: + SFHT_HWND_ADVERTISMENT_FILTER = 6; // HWND of the "Advertisment Filter" settings dialog (if it is opened; else NULL) + SFHT_HWND_ROBOT_FILTER = 7; // HWND of the "Robot Filter" settings dialog (if it is opened; else NULL) + SFHT_HWND_DISLIKEDMESSAGES_FILTER = 8; // HWND of the "Disliked Messages Filter" settings dialog (if it is opened; else NULL) + // Added in v2.5.0.0: + SFHT_HWND_SPAMDEFINITIONS_INFO = 9; // HWND of the "Spam Definitions" info dialog (if it is opened; else NULL) + SFHT_HWND_SPAMMERS_INFO = 10; // HWND of the Spammers info dialog (if it is opened; else NULL) + + SFHT_BOOL_IS_UNICODE = 100; // No handle, returns TRUE if Spam Filter is installed as Unicode version, FALSE otherwise + // (You probably never need to call this since Spam Filter performs automatic two-way translation + // when a service is called) + +// Note: Icons are taken directly from resources, they are not skinned by user. + + +// Return Values: +// -------------- +// Returns the specified handle value: HINSTANCE, HWND, ICON +// +// Note: +// If a handle is not available (or if it was removed) the function will +// return NULL. +// When you are using this service you need to check always for the +// NULL return value. + +// ------------------------------------------- +// -- Activating/Deactivating the filters ---- +// ------------------------------------------- + + MS_SPAMFILTER_CHANGEFILTERACTIVATION = 'SpamFilter/ChangeFilterActivation'; + +// Description: +// ------------- +// Provides the possibility to enable or disable the spam filters. +// Also updates the checkboxes in the spam filter options if the option dialog is opened. + +// Parameters: +// ------------- +// wParam = (uint)uFilterType (For possible values see below) +// lParam = (bool)bNewState (new activation state of filter) + +// Possible filter type values (uFilterType): + SFT_ADVERTISMENT_FILTER = 1; + SFT_DISLIKEDMESSAGES_FILTER = 2; + SFT_ROBOT_FILTER = 3; + +// Return Values: +// -------------- +// Returns 0 on success, nonzero on error. + + +// ------------------------------------------- +// -- Showing configure dialogs -------------- +// ------------------------------------------- + + MS_SPAMFILTER_SHOWFILTERDIALOG = 'SpamFilter/ShowFilterDialog'; + +// Description: +// ------------- +// Shows the configure dialog of the specified filter. + +// Parameters: +// ------------- +// wParam = (HWND)hwndParent (Can be NULL) +// lParam = (uint)uFilterType (For possible values see above) +// -> since 2.0.2.0: If this is zero then the options dialog will be opened pointing to the Spam Filter options. +// Note: +// If hwndParent is not NULL the function will not return +// until the configure dialog is closed. +// If hwndParent is NULL the Miranda window will be used as parent + +// Since 2.0.2.0: + SFTEX_OPTIONS_PAGE = 0; + +// Since 2.5.0.0: +// Combine the following flag with the lParam/uFilterType parameter +// to show the corresponding Spam Definitions info dialog instead +// of the settings dialog: + SFTEXF_SPAMDEFINITIONS_INFO = $2000; +// Note: SFTEXF_SPAMDEFINITIONS_INFO can't be combined with SFT_ROBOT_FILTER + +// Combine the following flag with the lParam/uFilterType of 0 parameter +// to show the Spammers dialog instead of the settings dialog: + SFTEXF_SPAMMERS_INFO = $4000; +// Note: SFTEXF_SPAMMERS_INFO can't be combined with SFT_* + + + +// Return Values: +// -------------- +// Returns 0 on success, nonzero on error. + +// Since v2.0.3.0: +// If the specified settings window is already opened it will be +// brought to front (reactivated) instead (returns success though). +// This might be changed however in the future. + +// Changed behaviour in v2.0.3.0: +// If hwndParent was not set then the function returned the handle to the new window. +// Now the function returns 0 to indicate success instead. + + +// ------------------------------------------- +// -- Adding message types ------------------- +// ------------------------------------------- + + MS_SPAMFILTER_REGISTERMESSAGETYPE = 'SpamFilter/MessageTypes/Register'; + +// Description: +// ------------- +// Adds a new message type which can be checked for spam. +// Associated event: ME_SPAMFILTER_PREREGISTERMESSAGETYPE + +// Parameters: +// ------------- +// wParam = 0 +// lParam = (MESSAGETYPEDESC*)mtd (see below) + +// Return Values: +// -------------- +// Returns 0 on success, nonzero on error. + + +// Already registered message types are: +// (With pszSection set to the installed network protocol names, e.g. "ICQ") + SFMT_AUTHREQUEST = 'Auth'; + SFMT_ADDED = 'Added'; // since v2.1.0.0 + SFMT_MESSAGE = 'Msg'; + SFMT_URL = 'URL'; + SFMT_FILE = 'File'; + SFMT_CONTACTS = 'Contacts'; + + +// MESSAGETYPEDESC structure: +type + PMESSAGETYPEDESC = ^TMESSAGETYPEDESC; + TMESSAGETYPEDESC = record + cbSize :integer; // Set to sizeof(MESSAGETYPEDESC) + pszSection :PAnsiChar; // Section of message name for database + // e.g. protocol name (Can not be NULL) + SectionDescription:TChar; // Readable name of section e.g. protocol name (can be NULL) + // Ignored if section existed previously + hSectionIcon :THANDLE; // Icon to show for section e.g. protocol icon (can be NULL) + // Ignored if section existed previously + pszName :PAnsiChar; // Name to refer to message type when spam + // checking and in db (Can not be NULL) + Description :TChar; // Description for options dialog (can be NULL) + hIcon :THANDLE; // EITHER: icon handle representing the message + // type OR: one of mirandas skin constants with + // a negative sign, e.g (HICON)-SKINICON_EVENT_MESSAGE, + // same as for LoadSkinnedIcon() -> can be 0 + // and can also be a normal icon handle (HICON) + bDefaultStatus :bool; // Whether checking for this type should be + // activated or not by default + dwFlags :dword; // Flags for the message type (for possible flags see below) + iSectionPosition :integer; // Approx position number for the section in the + // options list, lower numbers are nearer to the + // top (Can be 0 to be sorted alphabetically) + // Ignored if section existed previously (or + // if pszSection is NULL) Added in v2.1.1.0 + iPosition :integer; // Approx position number for the item in the + // options list, lower numbers are nearer to the + // top (Can be 0 to be sorted alphabetically) + // Added in v2.1.1.0 + end; + +const + +// Possible MESSAGETYPEDESC flags: + MTDF_DEFAULTDISABLED = $00000001; // Is disabled by default + MTDF_HIDDEN = $00000002; // Does not get shown on the options page +// Since v2.5.0.0 + MTDF_UNICODE = $00000004; // pszSectionDescription and pszDescription are Unicode strings + + +// ------------------------------------------- +// -- Modify new added message type (Event) -- +// ------------------------------------------- + + ME_SPAMFILTER_PREREGISTERMESSAGETYPE = 'SpamFilter/MessageTypes/PreRegister'; + +// Description: +// ------------- +// Gets fired before a new message type is added to be checked for spam. +// +// This is meant for asking other plugins if the specified default data is ok. +// Other plugins (especially protocols) can disable a message type if either sending spam +// is not possible for those protocols or if spam checking would cause unwanted side-effects. + +// Warning: Most elements of the MESSAGETYPEDESC structure can also be NULL. +// However, the structure was checked for errors before this events gets called. + +// Parameters: +// ----------------- +// wParam = 0 (same wParam as used for MS_SPAMFILTER_REGISTERMESSAGETYPE) +// lParam = (MESSAGETYPEDESC*)mtd (see above, contents can be modified) + +// Return Values: +// ----------------- +// Returning 0 on this event will accept the message type to be added. +// Returning 1 will prevent the the message type to be added. + +// Note: Works as it does now since v2.1.1.0 + + +// ------------------------------------------- +// -- Uninstalling a message type ------------ +// ------------------------------------------- + + MS_SPAMFILTER_REMOVEMESSAGETYPE = 'SpamFilter/RemoveMessageType'; + +// Description: +// ------------- +// Uninstalls a specifed message type. It removes the database setting related to the given message type. +// Should only be used for uninstalling purposes (e.g in uninstall function of PluginUninstaller) + +// Parameters: +// ------------- +// wParam = (AnsiChar*)pszMsgTypeName (Message type name; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before) +// lParam = (AnsiChar*)pszMsgTypeSection (The section of the message type string; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before) + +// Return Values: +// -------------- +// Returns 0 on success, nonzero on error.. + + +// ------------------------------------------- +// -- Message type activation ---------------- +// ------------------------------------------- + + MS_SPAMFILTER_ISMESSAGETYPEACTIVATED = 'SpamFilter/MessageTypes/IsActivated'; + +// Description: +// ------------- +// Returns if a specified message type is activated or not. + +// Parameters: +// ------------- +// wParam = (AnsiChar*)pszMsgTypeName (Message type name; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before) +// lParam = (AnsiChar*)pszMsgTypeSection (The section of the message type string; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before) + +// Return Values: +// -------------- +// Returns TRUE if the message type is activated and FALSE otherwise. + + +// ------------------------------------------- +// -- Reset AutoIgnore counters -------------- +// ------------------------------------------- + + MS_SPAMFILTER_RESETAUTOIGNORE = 'SpamFilter/AutoIgnore/Reset'; + +// Description: +// ------------- +// Resets the list in which the total number of spam sent by +// each user is kept. +// The list is necessary to determine when a particular user reached the +// allowed spam messages limit. + +// Parameters: +// ------------- +// wParam = (bool)bOnlyCount (if TRUE the service will only return the user count without doing reset) +// lParam = 0 + +// Return Values: +// -------------- +// Returns 0 on success, nonzero on error. + + +// ----------------------------------------- +// -- Spam Checking ------------------------ +// ----------------------------------------- + + MS_SPAMFILTER_ADVERTISMENTCHECK = 'SpamFilter/AdvertismentCheck'; + MS_SPAMFILTER_DISLIKEDMESSAGESCHECK = 'SpamFilter/DislikedMessagesCheck'; + MS_SPAMFILTER_ROBOTCHECK = 'SpamFilter/RobotCheck'; + +// Description: +// ------------- +// These services provide the possibility to check a specified text for contained spam. +// The function checks for everything that is activated in the plugin's options. + +// Note: These functions work as they do now since v2.1.0.0 + +// Parameters: +// ------------- +// wParam = (SPAMCHECKDATA*)scd +// lParam = 0 + +// SPAMCHECKDATA structure: +type + PSPAMCHECKDATA = ^TSPAMCHECKDATA; + TSPAMCHECKDATA = record + cbSize :integer; // sizeof(SPAMCHECKDATA) + pszMsgTypeSection:PAnsiChar; // The section of the message type string: You need + // to use MS_SPAMFILTER_REGISTERMESSAGETYPE before + pszMsgTypeName :PAnsiChar; // Description of the message: You need to use + // MS_SPAMFILTER_REGISTERMESSAGETYPE before + MsgText :TChar; // Pointer to the text of a message which is + // checked for spam. Can be NULL. + dwFlags :dword; // Flags for the spam checking. (For more details see below.) + case LongInt of + 0: (hContact: TMCONTACT); // Handle to the sending contact (use pszUserName + // instead if no hContact is available) + 1: (UserName: TChar); // Name of the user, e.g. nick (set SCDF_NO_CONTACT + // in the flags to use this parameter) -> should + // be as unique as possible + end; + +const +// Possible flags in the SPAMCHECKDATA structure: + SCDF_NO_NOTIFY = $00000001; // Don't show a popup, play sound or log to file if the message is spam. + SCDF_NO_CANCEL = $00000002; // Do check even if user pressed control key to avoid the spam check manually + SCDF_NO_AUTOIGNORE = $00000004; // Do not use the AutoIgnore feature for this check + SCDF_NO_CONTACT = $00000008; // Use pszUserName instead of hContact of union +// Since v2.5.0.0: + SCDF_UNICODE = $00000010; // Specify this flag if associated message text and/or user name is Unicode + + +// Return Values: +// -------------- +// Possible return flags: + SFF_MARKREAD = $00000010; // Flag + SFF_DELETE = $00000020; // Flag + SFF_IGNORE = $00000040; // Flag + SFF_SENDMSG_NOTIFY = $00000100; // Flag, Only MS_SPAMFILTER_DISLIKEDMESSAGESCHECK + SFF_SENDMSG_INSTRUCTION = $00000200; // Flag, Only MS_SPAMFILTER_ROBOTCHECK + SFF_SENDMSG_CONFIRMATION = $00000400; // Flag, Only MS_SPAMFILTER_ROBOTCHECK + SFF_TESTPASSED = $00000080; // Flag, Only MS_SPAMFILTER_ROBOTCHECK + SFF_ISSPAM = $00000002; // Flag + SFF_ISNORMAL = $00000001; // Flag +// Since 2.5.2.0: + SFF_HIDE = $00001000; // Flag, Only MS_SPAMFILTER_ROBOTCHECK + +// ------------------------------------------- +// -- Getting additional Check Info ---------- +// ------------------------------------------- + + MS_SPAMFILTER_GETSPAMCHECKINFO = 'SpamFilter/GetSpamCheckInfo'; + +// Description: +// ------------- +// Gets data needed for the processing of spam mesages. + +// Parameters: +// ------------- +// wParam = (dword)dwDataType (For possible values see below) +// lParam = depends on wParam (see below) + +// Possible values for lParam: + +// TRUE/FALSE: if the specified filter is enabled + SFSCI_ACTIVATION_FILTER = 1; // lParam = uFilterType (For possible values see above) + +// Strings: Get the message texts specified by the user +// ANSI + SFSCI_MSGTEXT_NOTIFYA = 2; // lParam = (SPAMCHECKDATA*)scd, scd->hContact (or scd->pszUserName) and scd->pszMsgText (and scd->cbSize) should be filled in. + SFSCI_MSGTEXT_INSTRUCTIONA = 3; // lParam: see SFSCI_MSGTEXT_NOTIFYA + SFSCI_MSGTEXT_CONFIRMATIONA = 4; // lParam: see SFSCI_MSGTEXT_NOTIFYA + +// Unicode (since v2.5.0.0) + SFSCI_MSGTEXT_NOTIFYW = 6; // lParam = (SPAMCHECKDATA*)scd, scd->hContact (or scd->pwszUserName) and scd->pwszMsgText (and scd->cbSize) should be filled in. + SFSCI_MSGTEXT_INSTRUCTIONW = 7; // lParam: see SFSCI_MSGTEXT_NOTIFYW + SFSCI_MSGTEXT_CONFIRMATIONW = 8; // lParam: see SFSCI_MSGTEXT_NOTIFYW + +// TRUE/FALSE: if the above message text should be added to history. + SFSCI_ADD_TO_HISTORY = 5; // lParam = SFSCI_MSGTEXT_NOTIFY(A/W), SFSCI_MSGTEXT_INSTRUCTION(A/W) or SFSCI_MSGTEXT_CONFIRMATION(A/W) + +// Since 2.5.2.0: +// Counts of milliseconds to delay the above message texts sending. + SFSCI_DELAY_TIME_REPLY = 9; // lParam=0 + + +// Return Values: +// -------------- +// SFSCI_ACTIVATION_FILTER -> (bool)TRUE/FALSE +// SFSCI_DELAY_TIME_REPLY -> (bool)TRUE/FALSE + +// SFSCI_MSGTEXT_NOTIFYA -> (AnsiChar*) free with miranda_sys_free() of "m_system.h", (all %vars% in the text are already resolved) +// SFSCI_MSGTEXT_INSTRUCTIONA -> see SFSCI_MSGTEXT_NOTIFYA +// SFSCI_MSGTEXT_CONFIRMATIONA -> see SFSCI_MSGTEXT_NOTIFYA + +// SFSCI_MSGTEXT_NOTIFYW -> (WCHAR*) free with miranda_sys_free() of "m_system.h", (all %vars% in the text are already resolved) +// SFSCI_MSGTEXT_INSTRUCTIONW -> see SFSCI_MSGTEXT_NOTIFYW +// SFSCI_MSGTEXT_CONFIRMATIONW -> see SFSCI_MSGTEXT_NOTIFYW + +// SFSCI_ADD_TO_HISTORY -> (bool)TRUE/FALSE + +// returns NULL on error + + +// ------------------------------------------- +// -- Confirm spam check (Event) ------------- +// ------------------------------------------- + + ME_SPAMFILTER_OKTOSPAMCHECK = 'SpamFilter/OkToSpamCheck'; + +// Description: +// ------------- +// Gets fired before the spam check for a message starts. + +// Parameters: +// ----------------- +// wParam = (SPAMCHECKDATA*)scd (Pointer to SPAMCHECKDATA struct) +// lParam = (uint)uFilterType (For possible values see above) + +// Return Values: +// ----------------- +// Returning 0 on this event will accept spam checking for the message, +// Returning 1 will prevent the spam check. + + +// ------------------------------------------- +// -- Confirm spam detection (Event) --------- +// ------------------------------------------- + + ME_SPAMFILTER_OKTOSPAMDETECTION = 'SpamFilter/OkToSpamDetection'; + +// Description: +// ------------- +// Gets fired after a spam message is detected. + +// Parameters: +// ----------------- +// wParam = (SPAMCHECKDATA*)scd (Pointer to SPAMCHECKDATA struct) +// lParam = (uint)uFilterType (For possible values see above) + +// Return Values: +// ----------------- +// Returning 0 on this event will accept the spam detection +// Returning 1 cause the message not to be seen as spam. + +// Note: If you only would like to get the final result hook +// ME_SPAMFILTER_SPAMRECEIVED instead + + +// ------------------------------------------- +// -- Spam message received (Event) ---------- +// ------------------------------------------- + + ME_SPAMFILTER_SPAMRECEIVED = 'SpamFilter/SpamReceived'; + +// Description: +// ------------- +// Gets fired when a message if recognized as spam. + +// Parameters: +// ----------------- +// wParam = (SPAMCHECKDATA*)scd (Pointer to SPAMCHECKDATA struct) +// lParam = (uint)uFilterType (For possible values see above) + +// Return Values: +// ----------------- +// The return value should be 0. + + +// ------------------------------------------- +// -- Spam Filter loaded (Event) ------------- +// ------------------------------------------- + + ME_SPAMFILTER_MODULELOADED = 'SpamFilter/ModuleLoaded'; + +// Description: +// ------------- +// Gets fired when a all parts of the "Spam Filter" were loaded and available +// to other plugins. +// Past this event all functionality of the plugin is fully available. +// The event works quite similar as ME_SYSTEM_MODULESLOADED. +// You can use ME_SYSTEM_MODULESLOADED in most cases instead. Please do so! + +// Parameters: +// ----------------- +// wParam = 0 +// lParam = 0 + +// Return Values: +// ----------------- +// The return value should be 0. + + + +// ------------------------------------------- +// -- Helper: Duplicate SPAMCHECKDATA -------- +// ------------------------------------------- + + MS_SPAMFILTER_COPYSPAMCHECKDATA = 'SpamFilter/SpamCheckData/Copy'; + +// Description: +// ------------- +// Copys all contents of a SPAMCHECKDATA struct (especially strings) to another one +// using Miranda's Memory Manager Interface (see m_system.h). +// Use MS_SPAMFILTER_FREESPAMCHECKDATA to free the result when no longer needed. + +// Available since 2.5.2.0. + +// Parameters: +// ------------- +// wParam = (SPAMCHECKDATA*)pscdTo +// lParam = (SPAMCHECKDATA*)pscdFrom + +// Return Values: +// -------------- +// Returns 0 on success, nonzero on error. + + + +// ------------------------------------------- +// -- Helper: Free SPAMCHECKDATA ------------- +// ------------------------------------------- + + MS_SPAMFILTER_FREESPAMCHECKDATA = 'SpamFilter/SpamCheckData/Free'; + +// Description: +// ------------- +// Frees the memory allocated by MS_SPAMFILTER_COPYSPAMCHECKDATA. +// using Miranda's Memory Manager Interface (see m_system.h). + +// Available since 2.5.2.0. + +// Parameters: +// ------------- +// wParam = (SPAMCHECKDATA*)pscd +// lParam = 0 + +// Return Values: +// -------------- +// Returns 0 on success, nonzero on failure. + + + +// ------------------------------------------- +// -- Showing error messages ----------------- +// ------------------------------------------- + + MS_SPAMFILTER_SHOWERROR = 'SpamFilter/ShowError'; + +// Description: +// ------------- +// Shows a Miranda try balloon tip, popup or message box +// with the specified error message. + +// Parameters: +// ------------- +// wParam = (uint)uErrorType (For possible values see below) +// lParam = 0 + +// Possible values for wParam: + SFSE_CRITICAL_ERROR = 1; // Unspecified critical error occured related to spam checking. + // Only use this for situations that may never ever occur. + // Please do avoid this if possible. + + SFSE_SEND_FAILED = 2; // Show this error when a sending of SFSCI_MSGTEXT_NOTIFY, + // SFSCI_MSGTEXT_INSTRUCTION, or SFSCI_MSGTEXT_CONFIRMATION failed + +// Return Values: +// -------------- +// Returns 0 on success, nonzero on error. + + + +// ------------------------------------------- +// -- Set contact as spammer (Contact) ------- +// ------------------------------------------- + + MS_SPAMFILTER_CONTACT_SETASSPAMMER = 'SpamFilter/Contact/SetAsSpammer'; + +// Description: +// ------------- +// This service adds a specified user to the spammer list (fully ignored). + +// Note: works same as MS_SPAMFILTER_CONTACT_SHOWSETASSPAMMERDIALOG +// but does not prompt the user. + +// Available since v2.5.0.0 + +// Parameters: +// ------------- +// wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.) +// lParam = (dword)dwFlags (flags about what should be done, see below) + +// Available Flags: + SCASF_NO_NOTIFY = $00000001; // Prevents logging and playing of sounds + SCASF_USE_ROBOT_SOUND = $00000002; // play robot sound instead of advertisment sound (only if SCASF_NO_NOTIFY is not set) + SCASF_NO_REMOVE_HISTORY = $00000004; // history is marked read instead of fully removed + SCASF_NO_DENY_AUTHREQUESTS = $00000008; // do not deny pending auth requests + +// Return Values: +// -------------- +// Returns 0 on success, nonzero on error. + + +// ------------------------------------------- +// -- Show mark spammer dialog (Contact) ----- +// ------------------------------------------- + + MS_SPAMFILTER_CONTACT_SHOWSETASSPAMMERDIALOG = 'SpamFilter/Contact/ShowSetAsSpammerDialog'; + +// Description: +// ------------- +// This service adds a specified user to the spammer list. +// Before it shows a dialog to let the user confirm the action. +// For use for example as action for a button on the message dialog. + +// Note: This service performs the same tasks as MS_SPAMFILTER_SETCONTACTASSPAMMER +// to execute the action the user chooses. + +// Available since v2.5.0.0 + +// Parameters: +// ------------- +// wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.) +// lParam = (HWND)hwndParent (Handle to the parent window. Can be NULL.) + +// Return Values: +// -------------- +// Returns FALSE if user clicked cancel on the dialog. +// TRUE if the contact was handled as spammer. + + +// Changed in v2.5.0.0: +// The service MS_SPAMFILTER_SETSPAMMANUALLY has been deprecated. +// New plugins should use MS_SPAMFILTER_CONTACT_SHOWSETASSPAMMERDIALOG instead. + MS_SPAMFILTER_SETSPAMMANUALLY = 'SpamFilter/SetSpamManually'; + + +// ------------------------------------------- +// -- Test if contact is spammer (Contact) --- +// ------------------------------------------- + + MS_SPAMFILTER_CONTACT_ISSPAMMER = 'SpamFilter/Contact/IsSpammer'; + +// Description: +// ------------- +// This service tests if a specified contact is on the spammer list (fully ignored). + +// Available since v2.5.0.0 + +// Parameters: +// ------------- +// wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.) +// lParam = 0 + +// Return Values: +// -------------- +// Returns TRUE when the contact is on the spammer list, FALSE otherwise. + + +// ------------------------------------------- +// -- Unmarks a contact as spammer (Contact) - +// ------------------------------------------- + + MS_SPAMFILTER_CONTACT_UNSETSPAMMER = 'SpamFilter/Contact/UnSetSpammer'; + +// Description: +// ------------- +// This service restores a spammer to be again a normal contact (unignored). + +// Available since v2.5.0.0 + +// Parameters: +// ------------- +// wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.) +// lParam = 0 + +// Return Values: +// -------------- +// Returns 0 on success, nonzero on error. + + +// ------------------------------------------- +// -- Spammer state changed (Event) ---------- +// ------------------------------------------- + + ME_SPAMFILTER_CONTACT_SPAMMERSTATECHANGED = 'SpamFilter/Contact/SpammerStateChanged'; + +// Description: +// ------------- +// Gets fired when a a contact gets marked as spammer or unmarked. + +// Parameters: +// ----------------- +// wParam = (HANDLE)hContact +// lParam = (bool)bIsSpammer (new state) + +// Return Values: +// ----------------- +// The return value should be 0. + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_speak.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_speak.inc new file mode 100644 index 0000000000..7badc4e0a4 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_speak.inc @@ -0,0 +1,267 @@ +{ +Copyright (C) 2007 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +} + +{$IFNDEF M_SPEAK} +{$DEFINE M_SPEAK} + +(* +There is 2 ways of using the speak plugin: + +1. Older and simple way: just call + Speak_Say(hContact, _T("text to speak")) +and the text will be spoken using contact settings. If hContact is NULL, it will use +system settings. +Previous versions only had an ascii version, so if you want to support then you need +to call + Speak_SayA(hContact, "text to speak") + + +2. Integrating with meSpeak GUI: for that you have first to register a speak type and +then call the speak functions. In both case you have 2 options: + +2.1 Sending the full text: meSpeak GUI will only allow to enable/disable the type. +To register call (in modules loaded): + Speak_Register("PluginName (DB key)", "name", "Prety name for GUI", "icon_xyz") +And to speak call: + Speak_SayEx("name", hContact, _T("text to speak")) + +2.2 Using templates: you will not pass the text, but some variables. meSpeak handles +the GUI to allow the user to create the text for those variables. These functions +end with WT (with templates). +To register call (in modules loaded): + AnsiChar *templates[] = { "Name\nDefault\n%var1%\tDescription 1\n%var2%\tDescription2\n%var3%\tDescription 3" }; + Speak_RegisterWT("PluginName (DB key)", "name", "Prety name for GUI", "icon_xyz", + templates, 1); +And to speak call: + TCHAR *variables[] = { _T("var1"), _T("Value 1"), _T("var2"), _T("Value 2"), _T("var3"), _T("Value 3") }; + Speak_SayExWT("name", hContact, 0, variables, 3); +*) + +const + MIID_SPEAK = '{1EF72725-6A83-483B-AA50-8953E359EEAD}'; + + {* + Speak a text + + wParam: (HANDLE) hContact + lParam: (AnsiChar *) text + return: 0 on success + *} + MS_SPEAK_SAY_A = 'Speak/Say'; + + {* + Speak a unicode text + + wParam: (HANDLE) hContact + lParam: (WCHAR *) text + return: 0 on success + *} + MS_SPEAK_SAY_W = 'Speak/SayW'; + +type + PSPEAK_TYPE = ^TSPEAK_TYPE; + TSPEAK_TYPE = record + cbSize: integer; + module: PAnsiChar; + name: PAnsiChar; // Internal type name + description: PAnsiChar; // Will be translated + icon: PAnsiChar; // Name off icolib icon + // Aditional data if wants to use add to history services + templates: ^PAnsiChar; // Each entry is: "Name\nDefault\n%var%\tDescription\n%var%\tDescription\n%var%\tDescription" + numTemplates: integer; + end; + +const + {* + Register and speak type + + wParam: (SPEAK_TYPE *) type + lParam: 0 + return: 0 on success + *} + MS_SPEAK_REGISTER = 'Speak/Register'; + +const + SPEAK_CHAR = 1; + SPEAK_WCHAR = 2; + +type + PSPEAK_ITEM = ^TSPEAK_ITEM; + TSPEAK_ITEM = record + cbSize: integer; + _type: PAnsiChar; // Internal type name + hContact: TMCONTACT; + flags: integer; // SPEAK_* + templateNum: integer; // -1 to use text + case boolean of + true: (text: PAnsiChar); + false: ( + variables: pointer; + numVariables: integer; + ); + end; + +const + {* + Speak a text + + wParam: (SPEAK_ITEM *) Item + lParam: 0 + return: 0 on success + *} + MS_SPEAK_SAYEX = 'Speak/SayEx'; + + +{$IFDEF I_AM_A_CONSTANT_THAT_IS_NEVER_DEFINED_BUT_ALLOWS_THE_CODE_BELOW_NOT_TO_BE_COMMENTED} +// Helper functions + +static int Speak_SayA(HANDLE hContact, const AnsiChar *text) +{ + return CallService(MS_SPEAK_SAY_A, (WPARAM) hContact, (LPARAM) text); +} + +static int Speak_SayW(HANDLE hContact, const WCHAR *text) +{ + return CallService(MS_SPEAK_SAY_W, (WPARAM) hContact, (LPARAM) text); +} + +static int Speak_Register(AnsiChar *module, AnsiChar *name, AnsiChar *description, AnsiChar *icon) +{ + SPEAK_TYPE type; + + if (!ServiceExists(MS_SPEAK_REGISTER)) + return -1; + + type.cbSize = sizeof(type); + type.module = module; + type.name = name; + type.description = description; + type.icon = icon; + type.templates = NULL; + type.numTemplates = 0; + + return CallService(MS_SPEAK_REGISTER, (WPARAM) &type, 0); +} + +static int Speak_RegisterWT(const AnsiChar *module, const AnsiChar *name, const AnsiChar *description, + const AnsiChar *icon, AnsiChar **templates, int numTemplates) +{ + SPEAK_TYPE type; + + if (!ServiceExists(MS_SPEAK_REGISTER)) + return -1; + + type.cbSize = sizeof(type); + type.module = module; + type.name = name; + type.description = description; + type.icon = icon; + type.templates = templates; + type.numTemplates = numTemplates; + + return CallService(MS_SPEAK_REGISTER, (WPARAM) &type, 0); +} + +static int Speak_SayExA(AnsiChar *type, HANDLE hContact, const AnsiChar *text) +{ + SPEAK_ITEM item; + + if (!ServiceExists(MS_SPEAK_SAYEX)) + // Try old service + return Speak_SayA(hContact, text); + + item.cbSize = sizeof(item); + item.flags = SPEAK_CHAR; + item.type = type; + item.hContact = hContact; + item.templateNum = -1; + item.text = text; + + return CallService(MS_SPEAK_SAYEX, (WPARAM) &item, 0); +} + +static int Speak_SayExW(AnsiChar *type, HANDLE hContact, const WCHAR *text) +{ + SPEAK_ITEM item; + + if (!ServiceExists(MS_SPEAK_SAYEX)) + // Try old service + return Speak_SayW(hContact, text); + + item.cbSize = sizeof(item); + item.flags = SPEAK_WCHAR; + item.type = type; + item.hContact = hContact; + item.templateNum = -1; + item.text = text; + + return CallService(MS_SPEAK_SAYEX, (WPARAM) &item, 0); +} + +static int Speak_SayExWTA(AnsiChar *type, HANDLE hContact, int templateNum, AnsiChar **variables, int numVariables) +{ + SPEAK_ITEM item; + + if (!ServiceExists(MS_SPEAK_SAYEX)) + return -1; + + item.cbSize = sizeof(item); + item.flags = SPEAK_CHAR; + item.type = type; + item.hContact = hContact; + item.templateNum = templateNum; + item.variables = variables; + item.numVariables = numVariables; + + return CallService(MS_SPEAK_SAYEX, (WPARAM) &item, 0); +} + +static int Speak_SayExWTW(AnsiChar *type, HANDLE hContact, int templateNum, WCHAR **variables, int numVariables) +{ + SPEAK_ITEM item; + + if (!ServiceExists(MS_SPEAK_SAYEX)) + return -1; + + item.cbSize = sizeof(item); + item.flags = SPEAK_WCHAR; + item.type = type; + item.hContact = hContact; + item.templateNum = templateNum; + item.variables = variables; + item.numVariables = numVariables; + + return CallService(MS_SPEAK_SAYEX, (WPARAM) &item, 0); +} + + +#ifdef UNICODE +# define MS_SPEAK_SAY MS_SPEAK_SAY_W +# define Speak_Say Speak_SayW +# define Speak_SayEx Speak_SayExW +# define Speak_SayExWT Speak_SayExWTW +#else +# define MS_SPEAK_SAY MS_SPEAK_SAY_A +# define Speak_Say Speak_SayA +# define Speak_SayEx Speak_SayExA +# define Speak_SayExWT Speak_SayExWTA +#endif + +{$ENDIF} +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_voice.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_voice.inc new file mode 100644 index 0000000000..5e97094e34 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_voice.inc @@ -0,0 +1,156 @@ +{ +Copyright (C) 2006-2009 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +} + +{$IFNDEF __M_VOICE} +{$DEFINE __M_VOICE} + +const + EVENTTYPE_VOICE_CALL = 8739; + + VOICE_CAPS_VOICE = 1 shl 0; // Voice is supported for this protocol. You need to set this one. + VOICE_CAPS_CALL_CONTACT = 1 shl 1; // Set if a call can be made to a hContact (PS_VOICE_CALL_CONTACT_VALID is used to validate the string) + VOICE_CAPS_CALL_STRING = 1 shl 3; // Set if a call can be made to some string (PS_VOICE_CALL_STRING_VALID is used to validate the string) +{ + Request to the protocol capabilities relative to voice. + + wParam: 0 + lParam: 0 + return: VOICE_CAPS_* +} + PS_VOICE_CAPS = '/Voice/Caps'; + + VOICE_SECURE = $00000001; + VOICE_UNICODE = $80000000; + + VOICE_STATE_TALKING = 0; + VOICE_STATE_RINGING = 1; + VOICE_STATE_CALLING = 2; + VOICE_STATE_ON_HOLD = 3; + VOICE_STATE_ENDED = 4; + VOICE_STATE_BUSY = 5; + +type + TVOICE_CALL = record + cbSize :int; // Struct size + moduleName:PAnsiChar; // The name of the protocol module (the same as VOICE_MODULE.name or the protocol szModule) + id :PAnsiChar; // Protocol especific ID for this call + flags :int; // VOICE_UNICODE to say the string is unicode or 0. + // VOICE_SECURE to say this is a encrypted call + hContact :TMCONTACT; // Contact associated with the call (can be NULL) + szNumber :TChar; // Number to call (can be NULL) + // Or the contact or the number must be != NULL + // If both are != NULL the call will be made to the number + // and will be associated with the contact + // This fields are only needed in first notification for a call id + szName :TChar; // Name of the caller. This makes sense only on incoming calls, + // where no contact is associated and the caller has a name and a number. + state :int; // VOICE_STATE_* + end; + +const +{ +Notifies that a voice call changed state + +wParam: const VOICE_CALL * +lParam: ignored +return: 0 on success +} + PE_VOICE_CALL_STATE = '/Voice/State'; + +{ +Request to the protocol a make voice call + +wParam: (HANDLE) hContact +lParam: (const TCHAR *) number +return: 0 on success +Or the contact or the number must be != NULL. If both are != NULL the call will be +made to the number and will be associated with the contact. +} + PS_VOICE_CALL = '/Voice/Call'; + +{ +Service called to make the protocol answer a call or restore a hold call. +It is an async call. If the call was answered, the PE_VOICE_CALL_STATE +notification will be fired. + +wParam: (const char *) id +lParam: ignored +return: 0 on success +} + PS_VOICE_ANSWERCALL = '/Voice/AnswerCall'; + +{ +Service called to make the protocol answer a call. This can be called if the +call is ringing or has started. If called any other time it should be ignored. +It is an async call. If the call was droped, the PE_VOICE_CALL_STATE +notification will be fired. + +wParam: (const char *) id +lParam: ignored +return: 0 on success +} + PS_VOICE_DROPCALL = '/Voice/DropCall'; + +{ +Service called to make the protocol hold a call. This means that the call should not +be droped, but it should be muted and put in a hold, to allow other call to be answered. +If the protocol can't hold a cal, it should be droped. + +This can be called if the call has started. If called any other time it should be ignored. +It is an async call. If the call was droped, the PE_VOICE_CALL_STATE +notification will be fired. + +wParam: (const char *) id +lParam: ignored +return: 0 on success +} + PS_VOICE_HOLDCALL = '/Voice/HoldCall'; + +{ +Send a DTMF (one digit text) to a talking call. + +wParam: (const char *) id +lParam: (TCHAR) dtmf +return: 0 on success +} + PS_VOICE_SEND_DTMF = '/Voice/SendDTMF'; + +{ +Used if protocol support VOICE_CALL_STRING. The call string is passed as +wParam and the proto should validate it. If this service does not exist all numbers can be called. + +wParam: (const TCHAR *) call string +lParam: ignored +return: 0 if wrong, 1 if correct +} + PS_VOICE_CALL_STRING_VALID = '/Voice/CallStringValid'; + +{ +Used if protocol support VOICE_CALL_CONTACT. +The hContact is passed as wParam and the proto should tell if this contact can be +called. If this service does not exist all contacts can be called (or, if it is a protocol, +all contacts from the protocol can be called). + +wParam: (HANDLE) hContact +lParam: (bool) TRUE if it is a test for 'can call now?', FALSE if is a test for 'will be possible to call someday?' +return: 0 if can't be called, 1 if can +} + PS_VOICE_CALL_CONTACT_VALID = '/Voice/CallContactValid'; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_voiceservice.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_voiceservice.inc new file mode 100644 index 0000000000..ab5872d8d3 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_voiceservice.inc @@ -0,0 +1,87 @@ +{ +Copyright (C) 2007 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +} + +{$IFNDEF M_VOICESERVICE} +{$DEFINE M_VOICESERVICE} + +const + MIID_VOICESERVICE:MUUID='{7D64437-EF2E-4F60-BB2D-3C518FE24D63}; + +{ +This services are a mirror of the services/notifications in m_voice.h, +with the difference that that ones are to be used by protocols, and this ones +are to be used by plugins that can make calls to contacts in multiple protocols. + +To get the devices for input/output and some options, query the db directly: + VoiceService/EchoCancelation byte default: TRUE + VoiceService/MicBoost byte default: TRUE + VoiceService/Input TString default: windows default + VoiceService/Output TString default: windows default +} + +type + TVOICE_MODULE = record + cbSize :int; // sizeof(VOICE_MODULE) + description:TChar; // The description of the voice provider. This is the name that + // will be shown to the user + name :PAnsiChar; // The internal name of the voice provider. All PS_* serivces + // defined in m_voide.h need to be created based in this name. + // For example, PS_VOICE_CALL (/Voice/Call) need to be created + // as /Voice/Call + icon :PAnsiChar; // Icon to identify provider (from icolib) + flags :int; // or of VOICE_CAPS_*. You don't need to send VOICE_CAPS_VOICE. + end; + +{ +Register a new plugin that can make/receive voice calls (a voice provider). + +wParam: const VOICE_MODULE * +lParam: ignored +return: 0 on success +} + MS_VOICESERVICE_REGISTER:PAnsiChar = 'VoiceService/Register'; + +{ +Unregister a plugin that can make/receive voice calls (a voice provider). + +wParam: (const char *) Provider name +lParam: ignored +return: 0 on success +} + MS_VOICESERVICE_UNREGISTER:PAnsiChar = 'VoiceService/Unregister'; + +{ +Request a voice call to hContact. + +wParam: (HANDLE) hContact +lParam: ignored +return: the number of option calls for a contact. If > 0, it can be called +} + MS_VOICESERVICE_CAN_CALL:PAnsiChar = 'VoiceService/CanCall'; + +{ +Request a voice call to hContact. + +wParam: (HANDLE) hContact +lParam: (char *) Voice provider or NULL to use any provider avaiable +return: 0 on success +} + MS_VOICESERVICE_CALL:PAnsiChar = 'VoiceService/Call'; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_w7ui.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_w7ui.inc new file mode 100644 index 0000000000..3841319ac7 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_w7ui.inc @@ -0,0 +1,84 @@ +{$IFNDEF M_W7UI} +{$DEFINE M_W7UI} + +const + MIS_ICOLIB = 0; + MIS_GENERAL = 1; + MIS_PROTOCOL = 2; + +type + PMIRANDAJUMPLISTITEM = ^TMIRANDAJUMPLISTITEM; + TMIRANDAJUMPLISTITEM = record + iconSource:int; + iconName :pAnsiChar; + iconIdx :int; + szTitle :pWideChar; + szPrefix :pWideChar; + szArgument:pWideChar; + end; + +const +// Force jumplist rebuild + MS_JUMPLIST_REBUILD:pAnsiChar = 'w7/JumpList/Rebuild'; + +// --- + ME_JUMPLIST_BUILDCATEGORIES:pAnsiChar = 'w7/JumpList/BuildCategories'; + +// lParam = (WCHAR *)category name + ME_JUMPLIST_BUILDITEMS:pAnsiChar = 'w7/JumpList/BuildItems'; + +// lParam = (WCHAR *)category name + MS_JUMPLIST_ADDCATEGORY:pAnsiChar = 'w7/JumpList/AddCategory'; + +// lParam = (MIRANDAJUMPLISTITEM *)item + MS_JUMPLIST_ADDITEM:pAnsiChar = 'w7/JumpList/AddItem'; + +// wParam = prefix +// lParam = argument + ME_JUMPLIST_PROCESS:pAnsiChar = 'w7/JumpList/Process'; + +procedure MJumpList_AddCategory(name:pWideChar); +begin + CallService(MS_JUMPLIST_ADDCATEGORY, 0, LPARAM(name)); +end; + +procedure MJumpList_AddItem(mir_icon:pAnsiChar; title, prefix, argument:pWideChar); overload; +var + item:TMIRANDAJUMPLISTITEM; +begin + item.iconSource:=MIS_ICOLIB; + item.iconName :=mir_icon; + item.iconIdx :=0; + item.szTitle :=title; + item.szPrefix :=prefix; + item.szArgument:=argument; + CallService(MS_JUMPLIST_ADDITEM, 0, LPARAM(@item)); +end; + +procedure MJumpList_AddItem(skinicon:int; title, prefix, argument:pWideChar); overload; +var + item:TMIRANDAJUMPLISTITEM; +begin + item.iconSource:=MIS_GENERAL; + item.iconName :=0; + item.iconIdx :=skinicon; + item.szTitle :=title; + item.szPrefix :=prefix; + item.szArgument:=argument; + CallService(MS_JUMPLIST_ADDITEM, 0, LPARAM(@item)); +end; + +procedure MJumpList_AddItem(proto:pansiChar; skinicon:int; title, prefix, argument:pWideChar); overload; +var + item:TMIRANDAJUMPLISTITEM; +begin + item.iconSource:=MIS_PROTOCOL; + item.iconName :=proto; + item.iconIdx :=skinicon; + item.szTitle :=title; + item.szPrefix :=prefix; + item.szArgument:=argument; + CallService(MS_JUMPLIST_ADDITEM, 0, LPARAM(@item)); +end; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/delphi/m_webcam.inc b/plugins/!Deprecated/ExternalAPI/delphi/m_webcam.inc new file mode 100644 index 0000000000..592e28a479 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/delphi/m_webcam.inc @@ -0,0 +1,142 @@ +{ + WebCam Video plugin by Sergei Polishchuk, SoftCab Inc + http://www.softcab.com + pserge@softcab.com +} + +{$IFNDEF M_WEBCAM} +{$DEFINE M_WEBCAM} + +const + MS_WEBCAM_OPEN = 'WebCam/Open'; +{ + This opens webcamera + wParam, and lParam must be zero. + Returns HANDLE to web camera. + For Example: + HANDLE hWebcamera = CallService(MS_WEBCAM_OPEN, 0, 0); +} + + MS_WEBCAM_ISREADY = 'WebCam/IsReady'; +{ + This zero if camera is ready for use, and non-zero if camera is still initializing. + It's useful to user this function after asynchronous opening of camera + wParam must be zero. + lParam = (LPARAM)(HANDLE)hCamera - camera handle + For Example: + HANDLE hWebcamera = CallService(MS_WEBCAM_ISREADY, 0, 0); +} + + MS_WEBCAM_CLOSE = 'WebCam/Close'; +{ + This will close web camera. + wParam must be zero + lParam = (LPARAM)(HANDLE)hWebcamera - a handle returned by MS_WEBCAM_OPEN + Return value is undefined. + For Example: + CallService(MS_WEBCAM_CLOSE, 0, (LPARAM)hWebcamera); +} + + MS_WEBCAM_SHOWWND = 'WebCam/Show'; +{ + This will show or hide web camera window + wParam = 1 to show window, or zero to hide one + lParam = (LPARAM)(HANDLE)hWebcamera - handle to camera + Return value is undefined. + For Example, this will show the window: + CallService(MS_WEBCAM_SHOWWND, 1, (LPARAM)hWebcamera); +} + + MS_WEBCAM_FREE = 'WebCam/Free'; +{ + This will free WEBCAM_QUERY fields. + wParam = sizeof(WEBCAM_QUERY) + lParam = (LPARAM)(WEBCAM_QUERY*)&Query + Return value is undefined + For Example: + CallService(MS_WEBCAM_FREE, sizeof(Query), (LPARAM)&Query); +} + + MS_WEBCAM_QUERY = 'WebCam/Query'; + WANT_PICTURE = pointer(-1); +{ + This will query web camera for data. + wParam = sizeof(WEBCAM_QUERY) + lParam = (LPARAM)(WEBCAM_QUERY*)&Query + Returns zero in case of success, or non-zero in case of any error + Before queryng camera, you need to setup some WEBCAM_QUERY structure fields. +} + +(* +WEBCAM_QUERY Query; +memset(&Query, 0, sizeof(Query)); +Query.hCamera = hWebcamera; +Query.Jpeg = WANT_PICTURE; // we want to get .JPG image +Query.Bitmap = NULL; // we do not need .BMP image +int ret = CallService(MS_WEBCAM_QUERY, sizeof(Query), (LPARAM)&Query); +if(!ret) +{ if(Query.Jpeg != NULL) + { // do something with JPG picture. For example, you may save it to .JPG file. + } + // now let's release the memory + CallService(MS_WEBCAM_FREE, sizeof(Query), (LPARAM)&Query); +} +*) + + MS_WEBCAM_SCREENSHOT = 'WebCam/ScreenShot'; +{ + This will return window screenshot + wParam = sizeof(WEBCAM_QUERY) + lParam = (LPARAM)(WEBCAM_QUERY*)&Query + Returns zero in case of success, or non-zero in case of any error + WEBCAMBUF->hCamera specifies window handle. + It's not required to open webcamera in order to run this service function. +} + +(* + +WEBCAM_QUERY Query; +memset(&Query, 0, sizeof(Query)); +Query.hCamera = (HANDLE)GetDesktopWindow(); // getting whole desktop picture. +Query.Jpeg = WANT_PICTURE; // we want to get .JPG image +Query.Bitmap = NULL; // we do not need .BMP image +int ret = CallService(MS_WEBCAM_SCREENSHOT, sizeof(Query), (LPARAM)&Query); +if(!ret) +{ if(Query.Jpeg != NULL) + { // do something with JPG picture. For example, you may save it to .JPG file. + } + // now let's release the memory + CallService(MS_WEBCAM_FREE, sizeof(Query), (LPARAM)&Query); +} + +*) + + ME_WEBCAM_SNAPSHOTRECEIVED = 'WebCam/SnapshotRecv'; +{ + This event will be fired right after receiving snapshot from remote contact. + wParam=(WPARAM)(HANDLE)hContact - a contact handle + lParam=(LPARAM)(WEBCAMBUF*)buffer - a buffer that contains JPEG image + IMPORTANT: you should not modify the buffer. It's read-only. +} + +type + ptag_WEBCAMBUF = ^tag_WEBCAMBUF; + tag_WEBCAMBUF = record + Size:dword; // size of Data buffer in bytes + Data:array [0..0] of byte; + end; + PWEBCAMBUF = ^WEBCAMBUF; + WEBCAMBUF = tag_WEBCAMBUF; + +type + ptag_WEBCAM_QUERY = ^tag_WEBCAM_QUERY; + tag_WEBCAM_QUERY = record + hCamera:THANDLE; // [in] HANDLE to web camera + cx,cy :word; // [out] camera picture size + Jpeg :PWEBCAMBUF; // [in,out] points to .JPG file content in memory + Bitmap :PWEBCAMBUF; // [in,out] points to .BMP file content in memory + end; + PWEBCAM_QUERY = ^WEBCAM_QUERY; + WEBCAM_QUERY = tag_WEBCAM_QUERY; + +{$ENDIF} diff --git a/plugins/!Deprecated/ExternalAPI/m_ContactSettings.h b/plugins/!Deprecated/ExternalAPI/m_ContactSettings.h new file mode 100644 index 0000000000..1b497ab479 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_ContactSettings.h @@ -0,0 +1,235 @@ +/* + Contact Settings plugin for Miranda IM + Copyright (c) 2007-2008 Chervov Dmitry + + 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 +*/ + +#ifndef __M_CONTACTSETTINGS_H +#define __M_CONTACTSETTINGS_H + + +typedef struct { + int cbSize; // sizeof(CONTACTSETTINGSINIT) + int Type; // one of CSIT_ constants; value of this field depends on what settings dialog was opened: contact settings or group settings + union + { + MCONTACT hContact; // used when Type == CSIT_CONTACT + int groupID; // used when Type == CSIT_GROUP + }; +} CONTACTSETTINGSINIT; + +// CONTACTSETTINGSINIT::Type +#define CSIT_CONTACT 1 // CONTACTSETTINGSINIT::hContact is valid +#define CSIT_GROUP 2 // CONTACTSETTINGSINIT::groupID is valid; in general, if Type == CSIT_GROUP, you MUST call MS_CONTACTSETTINGS_ADDCONTROL and add _all_ your per-contact controls, independently of current group contents, because potentially the group can contain any contacts in future. + +/* ME_CONTACTSETTINGS_INITIALISE +The user opened a contact settings dialog. Modules should do whatever initialisation they need and call MS_CONTACTSETTINGS_ADDCONTROL one or more times if they want controls displayed in the dialog +wParam=(WPARAM)(CONTACTSETTINGSINIT*)csi +lParam=0 +*/ +#define ME_CONTACTSETTINGS_INITIALISE "ContactSettings/Init" + + +/* MS_CONTACTSETTINGS_ADDCONTROL +Must only be called during a ME_CONTACTSETTINGS_INITIALISE hook +Adds a control to the contact settings dialog +wParam=(WPARAM)(CONTACTSETTINGSINIT*)csi +lParam=(LPARAM)(CONTACTSETTINGSCONTROL*)csc +Returns 0 on success, nonzero on failure +csi must have come straight from the wParam of ME_CONTACTSETTINGS_INITIALISE +Strings in the structure can be released as soon as the service returns. +*/ + +// CONTACTSETTINGSCONTROL::Position +#define CSPOS_SORTBYALPHABET 0x40000000 // recommended value for Position if you don't need a specific sorting order +// Group = "Notifications": +#define CSPOS_NOTIFICATIONS_SERVICES 0x20000000 // recommended control position for notification SERVICE PROVIDERS (popups, osd, tickers, etc). Notification plugins that use these services should use CSPOS_SORTBYALPHABET, so that notification service provider settings are above any other specific notification settings. + +// CONTACTSETTINGSCONTROL::Flags +#define CSCF_UNICODE 1 // string fields in CONTACTSETTINGSCONTROL and CSCONTROLSTATE are WCHAR* +#define CSCF_DONT_TRANSLATE_STRINGS 2 // specifies that strings in CONTACTSETTINGSCONTROL and CSCONTROLSTATE are translated already + +#ifdef _UNICODE +#define CSCF_TCHAR CSCF_UNICODE +#else +#define CSCF_TCHAR 0 +#endif + +// CONTACTSETTINGSCONTROL::ControlType +typedef enum +{ + CSCT_LABEL = -1, // CSCT_LABEL is used internally in ContactSettings, and mustn't be used by other plugins + CSCT_CHECKBOX, // checkbox control + CSCT_COMBOBOX // combobox control with a title above it +} CSCONTROLTYPE; + +// some common values for CONTACTSETTINGSCONTROL::ptszGroup +#define CSGROUP_NOTIFICATIONS LPGENT("Notifications") + +// special values for CONTACTSETTINGSCONTROL::szModule +#define CSMODULE_PROTO "%proto%" // ContactSettings will replace this by contact's protocol module name + +struct CSCONTROLSTATE +{ +#ifdef __cplusplus + CSCONTROLSTATE(): ptszName(NULL) {dbvValue.type = 0; dbvValue.dVal = 0; dbvValue.pbVal = 0; } + CSCONTROLSTATE(char *pszName, BYTE Value) { this->pszName = pszName; dbvValue.type = DBVT_BYTE; dbvValue.bVal = Value; } + CSCONTROLSTATE(char *pszName, char Value) { this->pszName = pszName; dbvValue.type = DBVT_BYTE; dbvValue.cVal = Value; } + CSCONTROLSTATE(char *pszName, WORD Value) { this->pszName = pszName; dbvValue.type = DBVT_WORD; dbvValue.wVal = Value; } + CSCONTROLSTATE(char *pszName, short Value) { this->pszName = pszName; dbvValue.type = DBVT_WORD; dbvValue.sVal = Value; } + CSCONTROLSTATE(char *pszName, DWORD Value) { this->pszName = pszName; dbvValue.type = DBVT_DWORD; dbvValue.dVal = Value; } + CSCONTROLSTATE(char *pszName, long Value) { this->pszName = pszName; dbvValue.type = DBVT_DWORD; dbvValue.lVal = Value; } + CSCONTROLSTATE(char *pszName, const char *szValue) { this->pszName = pszName; dbvValue.type = DBVT_ASCIIZ; dbvValue.pszVal = (char*)szValue; } + CSCONTROLSTATE(char *pszName, const WCHAR *wszValue) { this->pszName = pszName; dbvValue.type = DBVT_WCHAR; dbvValue.pwszVal = (WCHAR*)wszValue; } + CSCONTROLSTATE(WCHAR *pwszName, BYTE Value) { this->pwszName = pwszName; dbvValue.type = DBVT_BYTE; dbvValue.bVal = Value; } + CSCONTROLSTATE(WCHAR *pwszName, char Value) { this->pwszName = pwszName; dbvValue.type = DBVT_BYTE; dbvValue.cVal = Value; } + CSCONTROLSTATE(WCHAR *pwszName, WORD Value) { this->pwszName = pwszName; dbvValue.type = DBVT_WORD; dbvValue.wVal = Value; } + CSCONTROLSTATE(WCHAR *pwszName, short Value) { this->pwszName = pwszName; dbvValue.type = DBVT_WORD; dbvValue.sVal = Value; } + CSCONTROLSTATE(WCHAR *pwszName, DWORD Value) { this->pwszName = pwszName; dbvValue.type = DBVT_DWORD; dbvValue.dVal = Value; } + CSCONTROLSTATE(WCHAR *pwszName, long Value) { this->pwszName = pwszName; dbvValue.type = DBVT_DWORD; dbvValue.lVal = Value; } + CSCONTROLSTATE(WCHAR *pwszName, const char *szValue) { this->pwszName = pwszName; dbvValue.type = DBVT_ASCIIZ; dbvValue.pszVal = (char*)szValue; } + CSCONTROLSTATE(WCHAR *pwszName, const WCHAR *wszValue) { this->pwszName = pwszName; dbvValue.type = DBVT_WCHAR; dbvValue.pwszVal = (WCHAR*)wszValue; } +#endif + + union + { + TCHAR *ptszName; // item text for CSCT_COMBOBOX; not used for CSCT_CHECKBOX + char *pszName; + WCHAR *pwszName; + }; + DBVARIANT dbvValue; // database value for this state +}; + +// WARNING: do not use Translate(TS) for ptszTitle, ptszGroup, ptszTooltip or CSCONTROLSTATE::ptszName as they are translated by ContactSettings. The only exception is when you use CSCF_DONT_TRANSLATE_STRINGS flag +typedef struct { + int cbSize; // sizeof(CONTACTSETTINGSCONTROL) + int cbStateSize; // sizeof(CSCONTROLSTATE) + int Position; // position in the group, lower numbers are topmost. CSPOS_SORTBYALPHABET is recommended if you don't need a specific sorting order + DWORD Flags; // a combination of CSCF_ constants + CSCONTROLTYPE ControlType; // one of CSCT_ constants + union + { + TCHAR *ptszTitle; // label above the control + char *pszTitle; + WCHAR *pwszTitle; + }; + union + { + TCHAR *ptszGroup; // group title (several controls may be grouped together); may be NULL. + char *pszGroup; + WCHAR *pwszGroup; + }; + union + { + TCHAR *ptszTooltip; // tooltip for the control; may be NULL + char *pszTooltip; + WCHAR *pwszTooltip; + }; + const char *szModule; // database module; may contain variables (see above; currently the only existing variable is CSMODULE_PROTO) + const char *szSetting; // database setting + int StateNum; // number of possible states; always 2 or 3 for CSCT_CHECKBOX, and can be any number starting from 2 for CSCT_COMBOBOX + int DefState; // default state index + CSCONTROLSTATE *pStates; // array of StateNum items, describing all possible control states. Can be NULL for CSCT_COMBOBOX, in this case ContactSettings will use DBVT_BYTE database values, 0 is unchecked, 1 is checked, 2 is indeterminate. Can't be NULL for CSCT_COMBOBOX. + DWORD ValueMask; // in most cases simply set this to 0. when not 0, it allows to define a bit mask to access separate bits of a db value instead of reading/writing the whole value. is valid only for DBVT_BYTE, DBVT_WORD and DBVT_DWORD values +} CONTACTSETTINGSCONTROL; + +#define MS_CONTACTSETTINGS_ADDCONTROL "ContactSettings/AddControl" + + +typedef struct { + int cbSize; // sizeof(CONTACTSETTINGSCHANGEINFO) + HANDLE hContact; + const char *szModule; // variables in szModule and szSetting are NOT parsed, i.e. ContactSettings copies the values straight from CONTACTSETTINGSCONTROL + const char *szSetting; +} CONTACTSETTINGSCHANGEINFO; + +/* ME_CONTACTSETTINGS_SETTINGCHANGED +Called for every changed setting when the user applied changes in a contact settings dialog +wParam=(WPARAM)(CONTACTSETTINGSCHANGEINFO*)csci +lParam=0 +This event will be triggered many times rapidly when a whole bunch of values are set. +Modules which hook this should be aware of this fact and quickly return if they are not interested in the value that has been changed. +*/ +#define ME_CONTACTSETTINGS_SETTINGCHANGED "ContactSettings/SettingChanged" + + +/* MS_CONTACTSETTINGS_SHOWDIALOG +Shows Contact Settings dialog for a contact +wParam=hContact +lParam=0 +*/ +#define MS_CONTACTSETTINGS_SHOWDIALOG "ContactSettings/ShowDialog" + +/* MS_CONTACTSETTINGS_SHOWGROUPDIALOG. Not implemented yet. +Shows dialog for a group +wParam=groupId (0 is the main group) +lParam=0 +*/ +#define MS_CONTACTSETTINGS_SHOWGROUPDIALOG "ContactSettings/ShowGroupDialog" + + +/* +Example of use: + +// in ME_SYSTEM_MODULESLOADED handler: + HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInit); + +// ME_CONTACTSETTINGS_INITIALISE handler +static int ContactSettingsInit(WPARAM wParam, LPARAM lParam) +{ + CONTACTSETTINGSINIT *csi = (CONTACTSETTINGSINIT*)wParam; + +// check first whether to add controls or not +// we need to get a protocol name for that, if it's a contact settings dialog: + char *szProto = (csi->Type == CSIT_CONTACT) ? (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)csi->hContact, 0) : NULL; +// in general, you MUST add all your controls if csi->Type == CSIT_GROUP (i.e. user opened a group settings dialog), otherwise your plugin won't support group settings well: + if ((csi->Type == CSIT_GROUP) || +// otherwise (for a contact settings dialog), you can add controls depending on some conditions, like protocol caps, etc. +// in this example, we check whether the protocol has a PS_GETCUSTOMSTATUSICON service (i.e. does it support xstatuses or not): + (csi->Type == CSIT_CONTACT && szProto && ProtoServiceExists(szProto, PS_GETCUSTOMSTATUSICON))) +// your plugin must ignore cases when csi->Type is neither CSIT_GROUP nor CSIT_CONTACT + { + CONTACTSETTINGSCONTROL csc = {0}; + csc.cbSize = sizeof(csc); + csc.Position = CSPOS_SORTBYALPHABET; + csc.Flags = CSCF_TCHAR; + csc.ControlType = CSCT_COMBOBOX; + csc.StateNum = 3; + csc.ptszTitle = LPGENT("XStatus change notifications:") _T("\0") LPGENT("Ignore") _T("\0") LPGENT("Notify always") _T("\0") LPGENT("Use global settings") _T("\0"); + csc.ptszGroup = CSGROUP_NOTIFICATIONS; + csc.ptszTooltip = LPGENT("Tooltip text"); + csc.pszDBSetting = "ModuleName/XSNotifications"; + csc.DefValue = 2; // "Use global settings" + CallService(MS_CONTACTSETTINGS_ADDCONTROL, wParam, (LPARAM)&csc); + + // and CSCT_CHECKBOX example: + csc.Position = CSPOS_SORTBYALPHABET; + csc.Flags = CSCF_TCHAR; + csc.ControlType = CSCT_CHECKBOX; + csc.StateNum = 3; + csc.ptszTitle = LPGENT("Other setting"); + csc.ptszGroup = LPGENT("Some group"); + csc.ptszTooltip = LPGENT("Tooltip text"); + csc.pszDBSetting = "ModuleName/OtherSetting"; + csc.DefValue = 2; // BST_INDETERMINATE + CallService(MS_CONTACTSETTINGS_ADDCONTROL, wParam, (LPARAM)&csc); + } + return 0; +} + +*/ + +#endif // __M_CONTACTSETTINGS_H diff --git a/plugins/!Deprecated/ExternalAPI/m_DataAsMessage.h b/plugins/!Deprecated/ExternalAPI/m_DataAsMessage.h new file mode 100644 index 0000000000..2f1f2eb441 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_DataAsMessage.h @@ -0,0 +1,182 @@ +/* + DataAsMessage plugin for Miranda IM + Copyright (c) 2006-2007 Chervov Dmitry + + 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 +*/ + +#ifndef __M_DATAASMESSAGE_H +#define __M_DATAASMESSAGE_H + +// DAM_SENDRESULTINFO::iResult values +#define DAM_SR_SUCCESS 0 +#define DAM_SR_TIMEOUT 1 // timeout period expired; this value is returned also if the contact went offline for a time longer than a timeout period +#define DAM_SR_NOTSUPPORTED 2 // means this szDataType is not supported by the remote side +#define DAM_SR_NODAM 3 // means there is no DataAsMessage plugin on the remote side; keep in mind that this error can also appear accidentally because of a bad connectivity during the handshake (if there was a timeout when waiting for a response) +#define DAM_SR_CANCELLEDLOCAL 4 // cancelled from the local(sending) side +#define DAM_SR_CANCELLEDREMOTE 5 // cancelled from the remote(receiving) side +#define DAM_SR_BADCRC 6 // bad CRC; we can't do anything with this error. the most probable cause is that protocol filters some of characters in our messages +#define DAM_SR_UNKNOWN 7 // unknown error + +// Return values for DAM_SENDRESULTPROC +#define DAM_SRA_RETRY 1 + +typedef struct +{ + int cbSize; // sizeof(DAM_SENDRESULTINFO) + HANDLE hContact; + char *szDataType; + DWORD SessionID; + int iResult; // transmission result code +} DAM_SENDRESULTINFO; // hContact, szDataType and SessionID fields correspond to the fields of the DAM_SENDDATAINFO structure + +typedef int (*DAM_SENDRESULTPROC)(DAM_SENDRESULTINFO *sri); // this procedure receives the result of the transmission. it's called when the session closes (either the data was sent successfully or there was an error) +// you can return DAM_SRA_RETRY when iResult is DAM_SR_TIMEOUT if you want to retry sending + + +// DAM_SENDDATAINFO::Flags constants +#define DAM_SDF_DONTPACK 1 // don't compress the data (by default all the data is compressed) +#define DAM_SDF_NOTIMEOUT 2 // don't generate a timeout error ever, keep trying to send the data. If the contact is offline, the data is saved in the memory until the contact goes online. Loss of the data occurs only if the sender's miranda closes (this may change in future to allow fully functional offline sending that will guarantee the data to be sent in any case, but of course the sending starts only when the both contacts are online). other errors than the timeout error can be still generated though. + +typedef struct +{ + int cbSize; // sizeof(DAM_SENDDATAINFO) + HANDLE hContact; + char *szDataType; // zero-terminated string, containing data type, preferably in format "YourPluginName" or "YourPluginName/Something" (make sure this string won't coincide by an accident with someone else's string!). you can identify your data by this ID later + int nDataLen; // keep in mind that if the length is too big (more than about 8 KB), it's more preferable to split your data into several chunks, as you won't be able to "pick up" your data at the other end until all the data is transferred + char *cData; + int Flags; // combination of the DAM_SDF_ constants + DWORD SendAfterSessionID; // may be NULL; otherwise it's guaranteed that the sending starts only after successful completion of SendAfterSessionID session + DAM_SENDRESULTPROC SendResultProc; // pointer to a procedure that receives the result; can be NULL + DWORD SessionID; // OUT; receives the session ID +} DAM_SENDDATAINFO; + +// MS_DAM_SENDDATA return values +#define DAM_SDA_NOERROR 0 +#define DAM_SDA_NOTSUPPORTED (-1) // contact's protocol doesn't support sending/receiving messages +#define DAM_SDA_TOOMANYSESSIONS (-2) // too many sessions + +// MS_DAM_SENDDATA +// sends the data +// wParam = (WPARAM)(DAM_SENDDATAINFO*)sdi; +// lParam = 0 +// Returns 0 (DAM_SDA_NOERROR) and fills SessionID if the session was queued for sending successfully; returns one of the DAM_SDA_ values on failure +#define MS_DAM_SENDDATA "DataAsMessage/SendData" + +static int __inline DAMSendData(HANDLE hContact, char *szDataType, int nDataLen, char *cData, int Flags, DWORD SendAfterSessionID, DAM_SENDRESULTPROC SendResultProc, DWORD *pSessionID) +{ + int Result; + DAM_SENDDATAINFO sdi; + ZeroMemory(&sdi, sizeof(sdi)); + sdi.cbSize = sizeof(sdi); + sdi.hContact = hContact; + sdi.szDataType = szDataType; + sdi.nDataLen = nDataLen; + sdi.cData = cData; + sdi.Flags = Flags; + sdi.SendAfterSessionID = SendAfterSessionID; + sdi.SendResultProc = SendResultProc; + Result = CallService(MS_DAM_SENDDATA, (WPARAM)&sdi, 0); + if (pSessionID) + { + *pSessionID = sdi.SessionID; + } + return Result; +} + + +typedef struct +{ + int cbSize; // sizeof(DAM_RECVDATAINFO) + HANDLE hContact; + char *szDataType; + int nDataLen; + char *cData; +} DAM_RECVDATAINFO; + +// ME_DAM_RECVDATA +// hook up to this event to check for incoming data +// make sure rdi->szDataType is yours before doing anything! +// The important thing here is that your plugin will receive TWO ME_DAM_RECVDATA notifications on every single MS_DAM_SENDDATA call from a remote side: +// The first notification arrives when the remote side starts to transmit the data. In this case DAM_RECVDATAINFO::cData = NULL (and DAM_RECVDATAINFO::nDataLen = -1) as we didn't receive any data yet. Return 1 to indicate that your plugin recognized the DAM_RECVDATAINFO::szDataType, otherwise return 0. If there are no any plugin that recognized the data, DAM cancels the transfer and there won't be any second notification for it. +// The second notification is when the data is transmitted successfully. nDataLen contains the usual data size and cData points to the data buffer. cData is guaranteed to be valid only during the ME_DAM_RECVDATA call. You must copy the data to your own plugin's memory if you need to use it later. And again, return 1 to indicate that your plugin recognized the data, otherwise return 0 +// wParam = (WPARAM)(DAM_RECVDATAINFO*)rdi; +// lParam = 0 +#define ME_DAM_RECVDATA "DataAsMessage/RecvData" + + +typedef struct +{ + int cbSize; // sizeof(DAM_COMPRESSION_DATA) + void *(*malloc)(size_t); // pointer to the malloc() function of the calling module + int nInputDataLen; // IN; length of the input data in bytes + char *cInputData; // IN; pointer to the input data + int nOutputDataLen; // OUT; length of the output data in bytes + char *cOutputData; // OUT; pointer to the output data +} DAM_COMPRESSION_DATA; + +// Compression/decompression services. You DON'T have to use them if you want to send compressed data using DAM services, as DAM compresses the data automatically. These services are here just in case you need to compress/decompress data for your own needs + +// MS_DAM_COMPRESS +// compresses the data using BZip2 +// wParam = (WPARAM)(DAM_COMPRESSION_DATA*)bd; +// lParam = 0 +// cbSize, malloc, nInputDataLen and cInputData fields must be valid when calling the service. +// Returns 0 and fills nOutputDataLen and cOutputData on success; returns non-zero on failure +// This service allocates the memory for cOutputData using the specified malloc function; you must call free(cOutputData) when you've finished working with cOutputData +#define MS_DAM_COMPRESS "DataAsMessage/Compress" + +// MS_DAM_DECOMPRESS +// decompresses the data +// wParam = (WPARAM)(DAM_COMPRESSION_DATA*)bd; +// lParam = 0 +// cbSize, malloc, nInputDataLen and cInputData fields must be valid when calling the service. +// Returns 0 and fills nOutputDataLen and cOutputData on success; returns non-zero on failure +// This service allocates the memory for cOutputData using the specified malloc function; you must call free(cOutputData) when you've finished working with cOutputData +#define MS_DAM_DECOMPRESS "DataAsMessage/Decompress" + + +__inline int DAM_Compress(char *cInputData, int nInputDataLen, char **cOutputData, int *nOutputDataLen) +{ + int Result; + DAM_COMPRESSION_DATA bd; + ZeroMemory(&bd, sizeof(bd)); + bd.cbSize = sizeof(bd); + bd.malloc = malloc; + bd.nInputDataLen = nInputDataLen; + bd.cInputData = cInputData; + Result = CallService(MS_DAM_COMPRESS, (WPARAM)&bd, 0); + *nOutputDataLen = bd.nOutputDataLen; + *cOutputData = bd.cOutputData; + return Result; +} + +__inline int DAM_Decompress(char *cInputData, int nInputDataLen, char **cOutputData, int *nOutputDataLen) +{ + int Result; + DAM_COMPRESSION_DATA bd; + ZeroMemory(&bd, sizeof(bd)); + bd.cbSize = sizeof(bd); + bd.malloc = malloc; + bd.nInputDataLen = nInputDataLen; + bd.cInputData = cInputData; + Result = CallService(MS_DAM_DECOMPRESS, (WPARAM)&bd, 0); + *nOutputDataLen = bd.nOutputDataLen; + *cOutputData = bd.cOutputData; + return Result; +} + + +#endif // __M_DATAASMESSAGE_H diff --git a/plugins/!Deprecated/ExternalAPI/m_LogService.h b/plugins/!Deprecated/ExternalAPI/m_LogService.h new file mode 100644 index 0000000000..3acd6be1d6 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_LogService.h @@ -0,0 +1,217 @@ +/* + LogService - Plugin for Miranda IM + Copyright (c) 2006-2008 Chervov Dmitry + + 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 +*/ + +#ifndef __M_LOGSERVICE_H +#define __M_LOGSERVICE_H + +#define MIID_LOGSERVICE {0xe60bc9eb, 0xa099, 0x4846, {0xbc, 0x11, 0xba, 0x39, 0xf6, 0x60, 0x8b, 0x94}} +// {E60BC9EB-A099-4846-BC11-BA39F6608B94} + + +// LS_REGINFO::Flags constants +#define LSRF_WCHAR 1 // specifies that LS_REGINFO::szTitle, szDefLogPath and szDefFormat are WCHAR* +#ifdef _UNICODE + #define LSRF_TCHAR LSRF_WCHAR +#else + #define LSRF_TCHAR 0 +#endif + +typedef struct { + int cbSize; // sizeof(LS_REGINFO) + char *szID; // Log ID; it's a good idea to use your plugin name here + union + { + char *szTitle; // Title shown in the options. Cannot be NULL or empty. This is translated by LogService automatically + WCHAR *wszTitle; + TCHAR *tszTitle; + }; + union + { + char *szDefLogPath; // Default log file path, may contain variables. May be NULL - in this case the default path is ".log". Usually it's relative to \Logs dir, but it can be changed by user through Folders plugin. + WCHAR *wszDefLogPath; // if there's no Variables plugin installed, LogService will use szDefLogPath with all the variables removed from it + TCHAR *tszDefLogPath; + }; + union + { + char *szDefFormat; // Default log format; contains variables. May be NULL - in this case the default formatting is "`[`!cdate()-!ctime()`]` %extratext%" + WCHAR *wszDefFormat; + TCHAR *tszDefFormat; + }; + int Flags; +} LS_REGINFO; + +// MS_LOGSERVICE_REGISTER +// Registers a log. Your plugin can register several different logs with different settings. This service must be called once for every needed log ID at every startup. +// wParam = (WPARAM)(LS_REGINFO*)pri - pointer to LS_REGINFO item +// lParam = 0 +// returns 0 on success +#define MS_LOGSERVICE_REGISTER "LogService/Register" + +__inline static INT_PTR logservice_register(char *szID, TCHAR *tszTitle, TCHAR *tszDefLogPath, TCHAR *tszDefFormat) +{ + LS_REGINFO ri; + ZeroMemory(&ri, sizeof(LS_REGINFO)); + ri.cbSize = sizeof(LS_REGINFO); + ri.szID = szID; + ri.tszTitle = tszTitle; + ri.tszDefLogPath = tszDefLogPath; + ri.tszDefFormat = tszDefFormat; + ri.Flags = LSRF_TCHAR; + return CallService(MS_LOGSERVICE_REGISTER, (WPARAM)&ri, 0); +} + + + +// LS_MSGINFO::Flags constants +#define LSMF_WCHAR 1 // specifies that LS_MSGINFO::szMsg is a WCHAR* +#ifdef _UNICODE + #define LSMF_TCHAR LSMF_WCHAR +#else + #define LSMF_TCHAR 0 +#endif + +typedef struct { + int cbSize; // sizeof(LS_MSGINFO) + char *szID; + MCONTACT hContact; // may be NULL if no contact is associated with the message + union + { + char *szMsg; // the message + WCHAR *wszMsg; + TCHAR *tszMsg; + }; + int Flags; +} LS_MSGINFO; + +// MS_LOGSERVICE_LOG +// Logs szMsg message. You don't have to specify in szMsg anything else than the actual message. i.e. LogService will take care of date, time, contact nick etc by itself, using the format string +// wParam = (WPARAM)(LS_MSGINFO*)pmi - pointer to LS_MSGINFO item +// lParam = 0 +// returns 0 on success +#define MS_LOGSERVICE_LOG "LogService/Log" + +__inline static INT_PTR logservice_log(char *szID, MCONTACT hContact, TCHAR *tszMsg) +{ + LS_MSGINFO mi; + ZeroMemory(&mi, sizeof(LS_MSGINFO)); + mi.cbSize = sizeof(LS_MSGINFO); + mi.szID = szID; + mi.hContact = hContact; + mi.tszMsg = tszMsg; + mi.Flags = LSMF_TCHAR; + return CallService(MS_LOGSERVICE_LOG, (WPARAM)&mi, 0); +} + + +// LS_LOGINFO::Flags constants +#define LSLI_WCHAR 1 // [in]; specifies that LS_LOGINFO::szLogPath is a WCHAR* +#ifdef _UNICODE + #define LSLI_TCHAR LSLI_WCHAR +#else + #define LSLI_TCHAR 0 +#endif +#define LSLI_LOGENABLED 2 // [out]; LogService will set this flag if log with ID szID is enabled in the options. Setting this flag before calling MS_LOGSERVICE_GETLOGINFO is ignored. This flag is independent of hContact. + +typedef struct { + int cbSize; // [in]; sizeof(LS_LOGINFO) + char *szID; // [in] + MCONTACT hContact; // [in]; may be NULL + union + { + char *szLogPath; // [in]; pointer to a string to receive log file name, including full path. May be NULL. The string must be at least MAX_PATH characters long + WCHAR *wszLogPath; + TCHAR *tszLogPath; + }; + int Flags; // [in,out] +} LS_LOGINFO; + +// MS_LOGSERVICE_GETLOGINFO +// Returns various information about log with ID szID. +// wParam = (WPARAM)(LS_LOGINFO*)pli - pointer to LS_LOGINFO item +// lParam = 0 +// If szFileName is not NULL, MS_LOGSERVICE_GETLOGINFO gets full log file path by szID and hContact and copies it to *szLogPath +// Also the service will set LSLI_LOGENABLED flag if the specified log is enabled in the options. +// returns 0 on success +#define MS_LOGSERVICE_GETLOGINFO "LogService/GetLogInfo" + + +/* +1) Example of the simpliest way to use LogService: + + // define szID + #define LOG_ID "MyPluginName" + + // in ME_SYSTEM_MODULESLOADED handler: + logservice_register(LOG_ID, LPGENT("My plugin - log title"), NULL, NULL); + + // whenever you need to log something: + logservice_log(LOG_ID, NULL, _T("Test message")); + // (don't forget to specify hContact instead of NULL here if there's a contact associated with the message) + +MyPluginName.log will be created with the following contents: +[20.08.2007-14:30:00] Test message + + +2) If you want to offer additional customizability of log format using Variables, but still want the log to be usable even when Variables plugin is not installed, you can specify different messages depending on existence of MS_VARS_FORMATSTRING service. This example will explain how to do this and also will show you some other useful hints related to Variables plugin. + + // define szID + #define LOG_ID "ClientChangeNotify" + + // For example, say, we want to append user's ICQ UIN (or Yahoo ID, etc) to file name, to log CCN events to different files, depending on protocol (i.e. ClientChangeNotify_310927.log for ICQ). That's why custom log file path with variables is used here: + + logservice_register(LOG_ID, LPGENT("ClientChangeNotify"), + _T("ClientChangeNotify?puts(p,?dbsetting(%subject%,Protocol,p))?if2(_?dbsetting(,?get(p),?pinfo(?get(p),uidsetting)),).log"), + TranslateT("`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,id)) changed client to %extratext%")); + + // When Variables plugin is not installed, LogService will automatically cut all the variables from the log path, and we'll get usual "ClientChangeNotify.log" - so everyting is ok here. + // But note that %extratext% in the log format is supposed to contain only client name in CCN, and without some special measures, we would get something like this in the log when Variables plugin is not installed: + // [20.08.2007-14:30:00] Miranda IM 0.7.0.33 alpha (ICQ v0.3.8.105 alpha) + // Without at least contact nick, such log will be just useless. So when logging, we'll handle this case in a special way: + + if (ServiceExists(MS_VARS_FORMATSTRING)) + { // Variables plugin is installed + logservice_log(LOG_ID, hContact, tszClientName); + } else + { // Variables plugin is not installed, so we have to generate the string by ourselves, using some simple predefined format: + TCHAR tszNickAndClient[1024]; + mir_sntprintf(tszNickAndClient, SIZEOF(tszNickAndClient), TranslateT("%s changed his client to %s"), + (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR), tszClientName); + logservice_log(LOG_ID, hContact, tszNickAndClient); + } + +3) The other solution to the case when there's no Variables plugin, is to sacrifice customizability of log format for a simplier implementation: + + // define szID + #define LOG_ID "ClientChangeNotify" + + // in ME_SYSTEM_MODULESLOADED handler: + logservice_register(LOG_ID, LPGENT("ClientChangeNotify"), + _T("ClientChangeNotify?puts(p,?dbsetting(%subject%,Protocol,p))?if2(_?dbsetting(,?get(p),?pinfo(?get(p),uidsetting)),).log"), + NULL); + + // logging: + TCHAR tszNickAndClient[1024]; + mir_sntprintf(tszNickAndClient, SIZEOF(tszNickAndClient), TranslateT("%s changed his client to %s"), + (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR), tszClientName); + logservice_log(LOG_ID, hContact, tszNickAndClient); + + // Note that %extratext% now always contains the whole " changed his client to " string, and user is almost unable to customize this; perhaps only by using another translation or some advanced Variables scripts. +*/ + +#endif // __M_LOGSERVICE_H \ No newline at end of file diff --git a/plugins/!Deprecated/ExternalAPI/m_MagneticWindows.h b/plugins/!Deprecated/ExternalAPI/m_MagneticWindows.h new file mode 100644 index 0000000000..e011c773fd --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_MagneticWindows.h @@ -0,0 +1,86 @@ +#ifndef __M_MAGNETICWINDOWS_H__ +#define __M_MAGNETICWINDOWS_H__ + +//#include "../include/newpluginapi.h" + +// For other Plugins to start snapping for their windows +// wparam: hwnd of window +// lparam: 0 +// return: 0 on success, 1 on error +#define MS_MW_ADDWINDOW "Utils/MagneticWindows/Add" + +// For other Plugins to stop snapping for their windows +// wparam: hwnd of window +// lparam: 0 +// return: 0 on success, 1 on error +#define MS_MW_REMWINDOW "Utils/MagneticWindows/Rem" + +//decide where to align on the list: +#define MS_MW_STL_List_Left 0x00000001 //Snaps the window to the left border of the list +#define MS_MW_STL_List_Top 0x00000002 //Snaps the window to the top border of the list +#define MS_MW_STL_List_Right 0x00000004 //Snaps the window to the right border of the list +#define MS_MW_STL_List_Bottom 0x00000008 //Snaps the window to the bottom border of the list +//decide with what side (of the window you want to snap) to snap to the list +#define MS_MW_STL_Wnd_Left 0x00000010 //Snaps the window with the left border to the left/right side of the list +#define MS_MW_STL_Wnd_Top 0x00000020 //Snaps the window with the top border to the top/bottom side of the list +#define MS_MW_STL_Wnd_Right 0x00000040 //Snaps the window with the right border to the left/right side of the list +#define MS_MW_STL_Wnd_Bottom 0x00000080 //Snaps the window with the bottom border to the top/bottom side of the list + +#define MS_MW_STL_Wnd_FullWidth (MS_MW_STL_Wnd_Left | MS_MW_STL_Wnd_Right) + //Snaps to the top/bottom of the list and spans over the full width + +#define MS_MW_STL_Wnd_FullHeight (MS_MW_STL_Wnd_Top | MS_MW_STL_Wnd_Bottom) + //Snaps to the left/right of the list and spans over the full height + +// to place the window in the list combine f.e. MS_MW_STL_List_Left | MS_MW_STL_Wnd_Right | *vetical alignment* + +//For other Plugins to snap a window to the list for other Plugins +// wparam: hwnd of window +// lparam: combination of the above constants MS_MW_STL_* +// return: 0 on success, 1 on error +#define MS_MW_SNAPTOLIST "Utils/MagneticWindows/SnapToList" + +// Helper functions +#ifndef _MW_NO_HELPPER_FUNCTIONS + + +static inline int MagneticWindows_AddWindow(HWND hWnd) +{ + if (ServiceExists(MS_MW_ADDWINDOW)) + { + return CallService(MS_MW_ADDWINDOW, (WPARAM) hWnd, 0); + } + else + { + return -1; + } +} + +static inline int MagneticWindows_RemoveWindow(HWND hWnd) +{ + if (ServiceExists(MS_MW_REMWINDOW)) + { + return CallService(MS_MW_REMWINDOW, (WPARAM) hWnd, 0); + } + else + { + return -1; + } +} + +static inline int MagneticWindows_SnapWindowToList(HWND hWnd, int MS_MW_STL_Options) +{ + if (ServiceExists(MS_MW_SNAPTOLIST)) + { + return CallService(MS_MW_SNAPTOLIST, (WPARAM) hWnd, (LPARAM) MS_MW_STL_Options); + } + else + { + return -1; + } +} + +#endif + + +#endif // __M_MAGNETICWINDOWS_H__ diff --git a/plugins/!Deprecated/ExternalAPI/m_MathModule.h b/plugins/!Deprecated/ExternalAPI/m_MathModule.h new file mode 100644 index 0000000000..04ae06a7f7 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_MathModule.h @@ -0,0 +1,263 @@ +#ifndef M_MATHMODULE_H_ +#define M_MATHMODULE_H_ +//--------------------------------------------------- + + +/* + ************************** + * 2 * + ** * x + 2 Pi + ** ************* + R + * Sin(wt) + * + + Math-Module + ************** + + Miranda Plugin by Stephan Kassemeyer + + + MathModule API - (c) Stephan Kassemeyer + 8 May, 2004 + +*/ + + +// --------- + +/* + Miranda Service-functions defined by MathModule + call with the + int (*CallService)(const char * servicename,WPARAM,LPARAM) + that you get from miranda when Miranda calls the + Load(PLUGINLINK * link) + of your PlugIn-dll + the CallService function then is: + link->CallServiceSync(Servicename,wparam,lparam) +*/ + +// --------- + +#define MATH_RTF_REPLACE_FORMULAE "Math/RtfReplaceFormulae" +// replace all formulas in a RichEdit with bitmaps. +// wParam = 0 +// lParam = *TMathRichedit Info +// return: TRUE if replacement succeeded, FALSE if not (disable by user?). +typedef struct +{ + HWND hwndRichEditControl; // handle of richedit. + CHARRANGE* sel; // NULL: replace all. + int disableredraw; +} TMathRicheditInfo; +// WARNING: !!! +// Strange things happen if you use this function twice on the same CHARRANGE: +// if Math-startDelimiter == Math-endDelimiter, there is the following problem: +// it might be that someone forgot an endDelimiter, this results in a lonesome startdelimiter. +// if you try to MATH_REPLACE_FORMULAE the second time, startDelimiters and endDelimiters are mixed up. +// The same problem occours if we have empty formulae, because two succeding delimiters are +// replaced with a single delimiter. + + +#define MTH_GETBITMAP "Math/GetBitmap" +//returns Bitmap that represents the formula given in lparam (string-pointer) +//this formula has NO Delimiters. +//wparam=0 +//lparam=(*char)Formula +//result=(HBITMAP) bitmap +//!!! the bitmap must be deleted with DeleteObject(hobject) +//example: +//HBITMAP Bmp=(HBITMAP)CallService(MTH_GETBITMAP,0, (LPARAM)formula); + +#define MTH_GET_GIF "Math/GetGif" +// this renders a formula given in lparam and produces a gif-image in a temporary-folder +// and returns the filename (full path). Be sure to copy the file if you want to preserve it, +// because the files are managed as a ring-buffer, if 99 files already exist, this +// function overwrites the first one. +// wparam=0 +// lparam=*char text // formula WITHOUT delimiters +// result=(*char)path +// !!! the result-buffer must be deleted with MTH_FREE_GIFPATH +#define MTH_GET_GIF_UNICODE "Math/GetGifUnicode" +// wparam=0 +// lparam=*wchar_t text +// result=*char path +// !!! the result-buffer must be deleted with MTH_FREE_GIFPATH +#define MTH_FREE_GIFPATH "Math/FreeRTFBitmapText" + +#define MTH_GET_RTF_BITMAPTEXT "Math/GetRTFBitmapText" +// returns rich-text stream that includes bitmaps from text given in lparam +// text included between MATH_GET_STARTDELIMITER and MATH_GETENDDELIMITER +// hereby is replaced with a rtf-bitmap-stream that represents the corresponding formula +// wparam=0 +// lparam=*char text +// result=*char rtfstream +// !!! the result-buffer must be deleted with MTH_FREE_RTF_BITMAPTEXT +#define MTH_FREE_RTF_BITMAPTEXT "Math/FreeRTFBitmapText" +// deletes the buffer that MTH_GET_RTF_BITMAPTEXT has created. +// wparam=0 +// lparam=(*char) buffer +// result=0 + +#define MTH_GET_HTML_SOURCE "Math/GetHTMLSource" +// this is similar to MTH_GET_RTF_BITMAPTEXT, but +// as we cannot include embedded images, the bitmaps are saved in a +// temporary directory (relative to Miranda-dir) and the images are linked into +// the html-source +// wparam=0 +// lparam=*char text // this has to be html-source already. this function only adds formula-links. +// result=*char htmlsource +// !!! the result-buffer must be deleted with MTH_FREE_HTML_BUFFER +#define MTH_GET_HTML_SOURCE_UNICODE "Math/GetHTMLSourceUnicode" +// wparam=0 +// lparam=*wchar_t text +// result=*wchar_t htmlsource +#define MTH_FREE_HTML_BUFFER "Math/FreeRTFBitmapText" +// deletes string-buffers that MathModule has created. +// wparam=(bool) unicode // 0 if no unicode-buffer; 1 if unicode-buffer !!! +// lparam=(*char) buffer +// result=0 + + +// **********parameter functions: + +#define MATH_SET_PARAMS "Math/SetParams" +//-------------------------------------- +// sets a parameter (only integer values) specified in wparam +// wparam=paramcode +// lparam=parametervalue +// paramcodes: + #define MATH_PARAM_BKGCOLOR 0 // (COLORREF) std-rgb-color or TRANSPARENT_Color + // you can make the BKGCOLOR Transparent (default) by using this color: + #define TRANSPARENT_Color 0xffffffff -1 // this is default + #define MATH_PARAM_FONTCOLOR 1 // (COLORREF) std-rgb-color + #define MATH_PARAM_RESIZE_HWND 2 // (HWND) preview window resizes RESIZE_HWND when it is being resized. + #define MATH_PARAM_ToolboxEdit_HWND 3 // (HWND) If this hwnd (of an edit-box) is set, MathModule can insert Formula-elements from the Math-Toolbox. + +#define MATH_GET_PARAMS "Math/GetParams" +//--------------------------------------- +// get a parameter (only integer values) specified in wparam +// wparam=paramcode +// lparam=lparamOfPARAM // see below +// paramcodes and returnvalues: + #define MATH_PARAM_STARTDELIMITER 4 // retval: *char delimiter // the delimiter that marks the beginning of a formula + // !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER + // lparam=0 + #define MATH_PARAM_ENDDELIMITER 5 // retval: *char delimiter // the delimiter that marks the end of a formula + // !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER + // lparam=0 +// ************end parameter functions. + +#define MTH_FREE_MATH_BUFFER "Math/FreeRTFBitmapText" +// deletes string-buffers that MathModule has created. (at the moment only the *DELIMITER-services create such strings) +// wparam=0 +// lparam=(*char) buffer +// result=0 + + + +// ********* preview-window functions + +#define MTH_SHOW "Math/Show" +// shows the preview-window +// wparam=0 +// lparam=0 +// result=0 + +#define MTH_HIDE "Math/Hide" +// hides the preview-window +// wparam=0 +// lparam=0 +// result=0 + +#define MTH_RESIZE "Math/Resize" +// sets the size of the preview-window +// wparam=0 +// lparam=(*TMathWindowInfo) +// result=0 +typedef struct +{ + int top; + int left; + int right; + int bottom; +} TMathWindowInfo; + +#define MTH_SETFORMULA "Math/SetFormula" +// sets the text that the preview-window should parse to display formulas found inside +// wparam=0 +// lparam=(*char) text +// result=0 + +#define MTH_GET_PREVIEW_HEIGHT "Math/getPreviewHeight" +// returns the height of the whole preview-window (including system-menu-bar) +// consider this when maximizing a window to that preview-window is hooked on top or bottom +// it returns the height no matter whether preview-window is visible or not +// wparam=0 +// lparam=0 +// result=(int) height + +#define MTH_GET_PREVIEW_SHOWN "Math/getPreviewShown" +// returns 1 if preview window is visible +// returns 0 if preview window is invisible +// result=(int) shown + +//---------------end preview functions + + +#define MTH_SUBSTITUTE_DELIMITER "Math/SubstituteDelimiter" +// replaces Substitute in an edit-box given in lparam-structure with internal Math-Delimiter. +// MathSrmm uses this for the shortcut-functionality +// I do not recommend to use this, it's not Unicode-safe +// wparam=0 +// lparam=(TMathSubstInfo) substInfo +// result=0 +typedef struct +{ + HWND EditHandle; + char* Substitute; +} TMathSubstInfo; + + + + + +// +// ---- here are some obsolete services. I plan to remove them soon. Use MATH_SET_PARAMS or MATH_GET_PARAMS instead !! +// + +#define MATH_SETBKGCOLOR "Math/SetBackGroundColor" +// changes the background color of the next formula to be rendered. +// wparam=0 +// lparam=(COLORREF) color +// result=0 + +#define MTH_Set_ToolboxEditHwnd "Math/SetTBhwnd" +// If this hwnd (of an edit-box) is set, MathModule can insert Formula-elements from the Math-Toolbox. +// wparam=0 +// lparam=handle + +#define MTH_Set_Resize_HWND "Math/SetResizeHWND" //übergibt fenster-Handle des aktuellen Message-Dialogs +// If MathModule knows the handle of a SRMM-based window, following features exist: +// - preview window resizes Math-Srmm when it is being resized. +// wparam=0 +// lparam=handle +// result=0 + +#define MATH_GET_STARTDELIMITER "Math/GetStartDelimiter" +// returns the delimiter that marks the beginning of a formula +// wparam=0 +// lparam=0 +// result=*char Delimiter +// !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER + +#define MATH_GETENDDELIMITER "Math/GetEndDelimiter" +// returns the delimiter that marks the end of a formula +// wparam=0 +// lparam=0 +// result=*char Delimiter +// !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER + +//--------------------------------------------------- +#endif +//#ifndef M_MATHMODULE_H_ + diff --git a/plugins/!Deprecated/ExternalAPI/m_autoreplacer.h b/plugins/!Deprecated/ExternalAPI/m_autoreplacer.h new file mode 100644 index 0000000000..a169edb10c --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_autoreplacer.h @@ -0,0 +1,39 @@ +/* + AutoReplacer plugin + by Angelo Luiz Tartari +*/ + +#ifndef M_AUTOREPLACER_H +#define M_AUTOREPLACER_H + +/* + Adds a window handle to AutoReplacer. + This handle must belong to any window based on a editbox (editbox, richtext, TMemo, TEdit, TMaskEdit, etc.). + After adding a handle, AutoReplacer will automatically work on this window. + wParam = 0 + lParam = (LPARAM)(HWND)hwnd + Returns: 0 on success, -1 if hwnd is invalid, 1 on error. + Example: + if(ServiceExists(MS_AUTOREPLACER_ADDWINHANDLE)) + autoreplacer_AddWinHandle(GetDlgItem(hwndDlg, IDC_EDIT1)); +*/ +#define MS_AUTOREPLACER_ADDWINHANDLE "AutoReplacer/AddWinHandle" +static int __inline autoreplacer_AddWinHandle(HWND hwnd) { + return (int)CallService(MS_AUTOREPLACER_ADDWINHANDLE, 0, (LPARAM)hwnd); +} + +/* + Removes a window handle from AutoReplacer's list. + wParam = 0 + lParam = (LPARAM)(HWND)hwnd + Returns: 0 on success, -1 if hwnd is invalid, 1 if hwnd wasn't found. + Example: + if(ServiceExists(MS_AUTOREPLACER_REMWINHANDLE)) + autoreplacer_RemWinHandle(GetDlgItem(hwndDlg, IDC_EDIT1)); +*/ +#define MS_AUTOREPLACER_REMWINHANDLE "AutoReplacer/RemWinHandle" +static int __inline autoreplacer_RemWinHandle(HWND hwnd) { + return (int)CallService(MS_AUTOREPLACER_REMWINHANDLE, 0, (LPARAM)hwnd); +} + +#endif \ No newline at end of file diff --git a/plugins/!Deprecated/ExternalAPI/m_db3xsa.h b/plugins/!Deprecated/ExternalAPI/m_db3xsa.h new file mode 100644 index 0000000000..f1e5334fc4 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_db3xsa.h @@ -0,0 +1,120 @@ +/* + +Miranda NG: the free IM client for Microsoft* Windows* + +Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org), +Copyright (c) 2000-07 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +*/ + +/* DB/SetPassword v0.5.1.3+ +This service is used to set, change or clear the password used for encrypting the profile. +It opens the password change dialog. +wParam=0 +lParam=0 +*/ +#define MS_DB_SETPASSWORD "DB/SetPassword" + +/* DB/Backup v0.5.1.3+ +This service will make a backup of your current profile. Backups are named + xx.bak where xx is the number of backups. The larger the number, the +older the backup. +wParam=0 +lParam=0 +*/ +#define MS_DB_BACKUP "DB/Backup" + +/* DB/Backup v0.5.1.3+ +This service is the trigger action service and does the same as the service above. +Only difference is wParam carries flags from trigger plugin. +wParam=flags +lParam=0 +*/ +#define MS_DB_BACKUPTRIGGER "DB/BackupTriggerAct" + +/* DB/GetProfilePath( W ) v0.5.1.5+ +Gets the path of the profile currently being used by the database module. This +path does not include the last '\'. It is appended with the profile's name if +ProfileSubDir=yes is set in the mirandaboot.ini. + wParam=( WPARAM )( int )cbName + lParam=( LPARAM )( char* )pszName +pszName is a pointer to the buffer that receives the path of the profile +cbName is the size in bytes of the pszName buffer +Returns 0 on success or nonzero otherwise +*/ +#define MS_DB_GETPROFILEPATHW "DB/GetProfilePathW" + + +/* DB/GetProfilePathBasic( W ) v0.5.1.5+ +Gets the path of the profile currently being used by the database module. This +path does not include the last '\'. This is never appended with the profile's name. + wParam=( WPARAM )( int )cbName + lParam=( LPARAM )( char* )pszName +pszName is a pointer to the buffer that receives the path of the profile +cbName is the size in bytes of the pszName buffer +Returns 0 on success or nonzero otherwise +*/ +#define MS_DB_GETPROFILEPATH_BASIC "DB/GetProfilePathBasic" +#define MS_DB_GETPROFILEPATH_BASICW "DB/GetProfilePathBasicW" + +/* Utils/PathToAbsolute( W ) v0.5.1.5+ +This service routine expands all environment variables of a path string. +It supports: +%MIRANDAPATH% - expands to the installation folder of miranda, +%PROFILEPATH% - expands to the folder the current profile is stored in, +%PROFILENAME% - expands to the name of the current profile, +and all windows like environment variables such as: +%USERPROFILE%, %WINDIR%, ... +It returns the length of the absolute path in characters on success or +0 if any of the environment variables was not translated. +wParam=relative source path ( must be smaller than MAX_PATH ) +lParam=absolute destination path ( must be larger or equal to MAX_PATH ) +*/ +#define MIRANDAPATH "%MIRANDAPATH%" +#define MIRANDAPATHW L"%MIRANDAPATH%" +#define PROFILEPATH "%PROFILEPATH%" +#define PROFILEPATHW L"%PROFILEPATH%" +#define PROFILENAME "%PROFILENAME%" +#define PROFILENAMEW L"%PROFILENAME%" + +#ifndef MS_UTILS_PATHTOABSOLUTE + #define MS_UTILS_PATHTOABSOLUTE "Utils/PathToAbsolute" +#endif +#define MS_UTILS_PATHTOABSOLUTEW "Utils/PathToAbsoluteW" + +/* Utils/PathToRelative( W ) v0.5.1.5+ +This service parses the given absolute path and translates it to a string +containing as much environment variables as possible. +The return value is the length of the relative path in characters. +wParam=absolute source path ( must be smaller than MAX_PATH ) +lParam=relative destination path ( must be larger or equal to MAX_PATH ) +*/ +#ifndef MS_UTILS_PATHTORELATIVE + #define MS_UTILS_PATHTORELATIVE "Utils/PathToRelative" +#endif +#define MS_UTILS_PATHTORELATIVEW "Utils/PathToRelativeW" + +/* Unicode/Multibyte wrapping via TCHAR +*/ +#ifdef _UNICODE + #define MS_UTILS_PATHTOABSOLUTET MS_UTILS_PATHTOABSOLUTEW + #define MS_UTILS_PATHTORELATIVET MS_UTILS_PATHTORELATIVEW +#else + #define MS_UTILS_PATHTOABSOLUTET MS_UTILS_PATHTOABSOLUTE + #define MS_UTILS_PATHTORELATIVET MS_UTILS_PATHTORELATIVE +#endif \ No newline at end of file diff --git a/plugins/!Deprecated/ExternalAPI/m_dbx_tree.h b/plugins/!Deprecated/ExternalAPI/m_dbx_tree.h new file mode 100644 index 0000000000..073f56043b --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_dbx_tree.h @@ -0,0 +1,684 @@ +/* + +dbx_tree: tree database driver for Miranda IM + +Copyright 2007-2010 Michael "Protogenes" Kunz, + +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. + +*/ + +#ifndef M_DBX_TREE_H__ + +#define M_DBX_TREE_H__ 1 + +#include +#pragma pack(push, 8) + + +/** + \brief general return value if invalid param or invalid combination of params specified +**/ +static const unsigned int DBT_INVALIDPARAM = 0xFFFFFFFF; + + +/////////////////////////////////////////////////////////// +// Entities +/////////////////////////////////////////////////////////// + +/** + \brief A handle to a Entity +**/ +typedef uint32_t TDBTEntityHandle; + +static const uint32_t DBT_NF_IsRoot = 0x00000001; /// Entity is the Root +static const uint32_t DBT_NF_IsGroup = 0x00000002; /// Entity is a group +static const uint32_t DBT_NF_IsAccount = 0x00000004; /// Entity is an account + +static const uint32_t DBT_NF_HasChildren = 0x00010000; /// Entity has Children (for Groups and Metacontacts) +static const uint32_t DBT_NF_HasVirtuals = 0x00020000; /// Entity has at least one Virtual duplicate +static const uint32_t DBT_NF_IsVirtual = 0x00040000; /// Entity is a Virtual duplicate + +static const uint32_t DBT_NFM_SpecialEntity = DBT_NF_IsRoot | DBT_NF_IsGroup | DBT_NF_IsAccount | DBT_NF_IsVirtual; + +/////////////////////////////////////////////////////////// +// Entities +/////////////////////////////////////////////////////////// + +/** + \brief + \param wParam = 0 + \param lParam = 0 + + \return Handle to root Entity +**/ +#define MS_DBT_ENTITY_GETROOT "DBT/Entity/GetRoot" + + +/** + \brief + \param wParam = hEntity + \param lParam = 0 + + \return ChildCount of specified Entity +**/ +#define MS_DBT_ENTITY_CHILDCOUNT "DBT/Entity/ChildCount" + + +/** + \brief + \param wParam = hEntity + \param lParam = 0 + + \return Parent hEntity of specified Entity +**/ +#define MS_DBT_ENTITY_GETPARENT "DBT/Entity/GetParent" + + +/** + \brief + \param wParam = hEntity + \param lParam = hNewEntity + + \return 0 on success +**/ +#define MS_DBT_ENTITY_MOVE "DBT/Entity/Move" + +/** + \brief + \param wParam = hEntity + \param lParam = hNewParent +**/ +#define ME_DBT_ENTITY_MOVING "DBT/Entity/Moving" +/** + \brief + \param wParam = hEntity + \param lParam = hOldParent +**/ +#define ME_DBT_ENTITY_MOVED "DBT/Entity/Moved" + +/** + \brief Read the flags of an Entity + \param wParam = hEntity + \param lParam = 0 + + \return Flags +**/ +#define MS_DBT_ENTITY_GETFLAGS "DBT/Entity/GetFlags" + + + +static const uint32_t DBT_NIFO_OSC_AC = 0x00000001; /// onStartEntity - AddChildren +static const uint32_t DBT_NIFO_OSC_AP = 0x00000002; /// onStartEntity - AddParent +static const uint32_t DBT_NIFO_OSC_AO = 0x00000004; /// onStartEntity - AddOriginal (only if Entity is virtual) +static const uint32_t DBT_NIFO_OSC_AOC = 0x00000008 | DBT_NIFO_OSC_AO; /// onStartEntity - AddOriginalChildren (only if Entity is virtual) +static const uint32_t DBT_NIFO_OSC_AOP = 0x00000010 | DBT_NIFO_OSC_AO; /// onStartEntity - AddOriginalParent (only if Entity is virtual) +static const uint32_t DBT_NIFO_OSC_USEACCOUNT = 0x00000080; /// onStartEntity - use Account as fallback, only for settings + +static const uint32_t DBT_NIFO_OC_AC = 0x00000001 <<8; /// onChildEntity - AddChildren +//static const uint32_t DBT_LC_OC_AP = 0x00000002 <<8; /// invalid for children +static const uint32_t DBT_NIFO_OC_AO = 0x00000004 <<8; /// onChildEntity - AddOriginal (only if Entity is virtual) +static const uint32_t DBT_NIFO_OC_AOC = 0x00000008 <<8 | DBT_NIFO_OC_AO; /// onChildEntity - AddOriginalChildren (only if Entity is virtual) +static const uint32_t DBT_NIFO_OC_AOP = 0x00000010 <<8 | DBT_NIFO_OC_AO; /// onChildEntity - AddOriginalParent (only if Entity is virtual) +static const uint32_t DBT_NIFO_OC_USEACCOUNT = 0x00000080 <<8; /// onStartEntity - use Account as fallback, only for settings + +static const uint32_t DBT_NIFO_OP_AC = 0x00000001 <<16; /// onParentEntity - AddChildren +static const uint32_t DBT_NIFO_OP_AP = 0x00000002 <<16; /// onParentEntity - AddParent +static const uint32_t DBT_NIFO_OP_AO = 0x00000004 <<16; /// onParentEntity - AddOriginal (only if Entity is virtual) +static const uint32_t DBT_NIFO_OP_AOC = 0x00000008 <<16 | DBT_NIFO_OP_AO; /// onParentEntity - AddOriginalChildren (only if Entity is virtual) +static const uint32_t DBT_NIFO_OP_AOP = 0x00000010 <<16 | DBT_NIFO_OP_AO; /// onParentEntity - AddOriginalParent (only if Entity is virtual) +static const uint32_t DBT_NIFO_OP_USEACCOUNT = 0x00000080 <<16; /// onStartEntity - use Account as fallback, only for settings + +static const uint32_t DBT_NIFO_GF_DEPTHFIRST = 0x01000000; /// general flags - depth first iteration instead of breath first +static const uint32_t DBT_NIFO_GF_USEROOT = 0x02000000; /// general flags - use root as fallback, only for settings +static const uint32_t DBT_NIFO_GF_VL1 = 0x10000000; /// general flags - limit virtual lookup depth to 1 +static const uint32_t DBT_NIFO_GF_VL2 = 0x20000000; /// general flags - limit virtual lookup depth to 2 +static const uint32_t DBT_NIFO_GF_VL3 = 0x30000000; /// general flags - limit virtual lookup depth to 3 +static const uint32_t DBT_NIFO_GF_VL4 = 0x40000000; /// general flags - limit virtual lookup depth to 4 + +/** + \brief Entityfilter options for Entity iteration +**/ +typedef + struct TDBTEntityIterFilter + { + uint32_t cbSize; /// size of the structur in bytes + uint32_t Options; /// Options for iteration: DB_EIFO_* + uint32_t fHasFlags; /// flags an Entity must have to be iterated + uint32_t fDontHasFlags; /// flags an Entity have not to have to be iterated + } TDBTEntityIterFilter, *PDBTEntityIterFilter; + +/** + \brief Handle of an Entity-Iteration +**/ +typedef uintptr_t TDBTEntityIterationHandle; +/** + \brief initialize an iteration of Entities + \param wParam = PDBTEntityIterFilter, NULL to iterate all Entities (breadthfirst, all but root) + \param lParam = TDBTEntityHandle Entity, where iteration starts + + \return EnumID +**/ +#define MS_DBT_ENTITY_ITER_INIT "DBT/Entity/Iter/Init" + + +/** + \brief get the next Entity + \param wParam = EnumID returned by MS_DBT_ENTITY_ITER_INIT + \param lParam = 0 + + \return hEntity, 0 at the end +**/ +#define MS_DBT_ENTITY_ITER_NEXT "DBT/Entity/Iter/Next" + +/** + \brief closes an iteration and frees its ressourcs + \param wParam = IterationHandle returned by MS_DBT_ENTITY_ITER_INIT + \param lParam = 0 + + \return 0 on success +**/ +#define MS_DBT_ENTITY_ITER_CLOSE "DBT/Entity/Iter/Close" + +/** + \brief Deletes an Entity. + + All children will be moved to its parent. + If the Entity has virtual copies, history and settings will be transfered to the first duplicate. + + \param wParam = hEntity + \param lParam = 0 + + \return 0 on success +**/ +#define MS_DBT_ENTITY_DELETE "DBT/Entity/Delete" + + +typedef struct TDBTEntity +{ + uint32_t bcSize; + TDBTEntityHandle hParentEntity; + uint32_t fFlags; /// Flags DBT_NF_ + TDBTEntityHandle hAccountEntity; /// Needed for normal Entities, reference to AccountEntity for the created one +} TDBTEntity, *PDBTEntity; + +/** + \brief Creates a new Entity. + \param wParam = PDBTEntity + \param lParam = 0 + + \return hEntity on success, 0 otherwise +**/ +#define MS_DBT_ENTITY_CREATE "DBT/Entity/Create" + + +/** + \brief returns the account entity handle specified during creation + \param wParam = TDBTEntityHandle + \param lParam = 0 + + \return hEntity on success, 0 otherwise +**/ +#define MS_DBT_ENTITY_GETACCOUNT "DBT/Entity/GetAccount" + + +/////////////////////////////////////////////////////////// +// Virtual Entities +/////////////////////////////////////////////////////////// + +/** + \brief Creates a virtual duplicate of an Entity + \param wParam = hEntity to duplicate, couldn't be a group (DBT_NF_IsGroup set to 0) + \param lParam = hParentEntity to place duplicate + + \return hEntity of created duplicate +**/ +#define MS_DBT_VIRTUALENTITY_CREATE "DBT/VirtualEntity/Create" + +/** + \brief Retrieves the original Entity, which this is a duplicate of + \param wParam = hEntity of virtual Entity + \param lParam = 0 + + \return hEntity of original Entity +**/ +#define MS_DBT_VIRTUALENTITY_GETPARENT "DBT/VirtualEntity/GetParent" + +/** + \brief Retrieves the first virtual duplicate of an Entity (if any) + \param wParam = hEntity with virtual copies + \param lParam + + \return hEntity of first virtual duplicate +**/ +#define MS_DBT_VIRTUALENTITY_GETFIRST "DBT/VirtualEntity/GetFirst" + +/** + \brief Retrieves the following duplicate + \param wParam = hVirtualEntity of virtual Entity + \param lParam = 0 + + \return hEntity of next duplicate, 0 if hVirtualEntity was the last duplicate +**/ +#define MS_DBT_VIRTUALENTITY_GETNEXT "DBT/VirtualEntity/GetNext" + + +/////////////////////////////////////////////////////////// +// Settings +/////////////////////////////////////////////////////////// + +/** + \brief Handle of a Setting +**/ +typedef uint32_t TDBTSettingHandle; + + +static const uint16_t DBT_ST_BYTE = 0x01; +static const uint16_t DBT_ST_WORD = 0x02; +static const uint16_t DBT_ST_DWORD = 0x03; +static const uint16_t DBT_ST_QWORD = 0x04; + +static const uint16_t DBT_ST_CHAR = 0x11; +static const uint16_t DBT_ST_SHORT = 0x12; +static const uint16_t DBT_ST_INT = 0x13; +static const uint16_t DBT_ST_INT64 = 0x14; + +static const uint16_t DBT_ST_BOOL = 0x20; +static const uint16_t DBT_ST_FLOAT = 0x21; +static const uint16_t DBT_ST_DOUBLE = 0x22; + +static const uint16_t DBT_ST_ANSI = 0xff; +static const uint16_t DBT_ST_BLOB = 0xfe; +static const uint16_t DBT_ST_UTF8 = 0xfd; +static const uint16_t DBT_ST_WCHAR = 0xfc; + +#if (defined(_UNICODE) || defined(UNICODE)) + static const uint16_t DBT_ST_TCHAR = DBT_ST_WCHAR; +#else + static const uint16_t DBT_ST_TCHAR = DBT_ST_ANSI; +#endif + +static const uint16_t DBT_STF_Signed = 0x10; +static const uint16_t DBT_STF_VariableLength = 0x80; + + + +static const uint32_t DBT_SDF_FoundValid = 0x00000001; +static const uint32_t DBT_SDF_HashValid = 0x00000002; + +/** + \brief Describes a setting, its name and location +**/ +typedef + struct TDBTSettingDescriptor { + uint32_t cbSize; /// size of the structure in bytes + TDBTEntityHandle Entity; /// Entityhandle where the setting can be found, or where searching starts + char * pszSettingName; /// Setting name + uint32_t Options; /// options describing where the setting can be found DBT_NIFO_* + uint32_t Flags; /// Valid Flags. DBT_SDF_* describes which following values are valid (internal use) + + TDBTEntityHandle FoundInEntity; /// internal use to avoid to do the searching twice + uint32_t Hash; /// internal used HashValue for settingname + TDBTSettingHandle FoundHandle; /// internal used SettingHandle + } TDBTSettingDescriptor, * PDBTSettingDescriptor; + +/** + \brief Describes a settings value + + it is never used alone, without a type qualifier +**/ +typedef + union TDBTSettingValue { + bool Bool; + int8_t Char; uint8_t Byte; + int16_t Short; uint16_t Word; + uint32_t Int; uint32_t DWord; + int64_t Int64; uint64_t QWord; + float Float; + double Double; + + struct { + uint32_t Length; // length in bytes of pBlob, length in characters of char types including trailing null + union { + uint8_t * pBlob; + char * pAnsi; + char * pUTF8; + wchar_t * pWide; + TCHAR * pTChar; + }; + }; + } TDBTSettingValue; + +/** + \brief Describes a setting +**/ +typedef + struct TDBTSetting { + uint32_t cbSize; /// size of the structure in bytes + PDBTSettingDescriptor Descriptor; /// pointer to a Setting descriptor used to locate the setting + uint16_t Type; /// type of the setting, see DBT_ST_* + TDBTSettingValue Value; /// Value of the setting according to Type + } TDBTSetting, * PDBTSetting; + + + +/** + \brief retrieves the handle of the setting + \param wParam = PDBTSettingDescriptor + \param lParam = 0 + + \return hSetting when found, 0 otherwise +**/ +#define MS_DBT_SETTING_FIND "DBT/Setting/Find" + + +/** + \brief deletes the specified Setting + \param wParam = PDBTSettingDescriptor + \param lParam = 0 + + \return hSetting when found, 0 otherwise +**/ +#define MS_DBT_SETTING_DELETE "DBT/Setting/Delete" + +/** + \brief deletes the specified Setting + \param wParam = TDBTSettingHandle + \param lParam = 0 + + \return 0 on success +**/ +#define MS_DBT_SETTING_DELETEHANDLE "DBT/Setting/DeleteHandle" + + +/** + \brief Write a setting (and creates it if neccessary) + \param wParam = PDBTSetting + \param lParam = 0 + + \return TDBTSettingHandle on success, 0 otherwise +**/ +#define MS_DBT_SETTING_WRITE "DBT/Setting/Write" + +/** + \brief retrieves the handle of the setting + \param wParam = PDBTSetting + \param lParam = TDBTSettingHandle, could be 0 to create new setting, but needs wParam->Descriptor with valid data + + \return hSetting when found or created, 0 otherwise +**/ +#define MS_DBT_SETTING_WRITEHANDLE "DBT/Setting/WriteHandle" + +/** + \brief retrieves the value of the setting + \param wParam = PDBTSetting + \param lParam = 0 + + \return SettingHandle +**/ +#define MS_DBT_SETTING_READ "DBT/Setting/Read" + +/** + \brief retrieves the value of the setting + + Also retrieves the SettingDescriptor if it is set and prepared correctly (name buffers set etc) + \param wParam = PDBTSetting + \param lParam = TDBTSettingHandle + + \return original settings type +**/ +#define MS_DBT_SETTING_READHANDLE "DBT/Setting/ReadHandle" + + + +/** + \brief Settings Filter Options for setting iteration +**/ +typedef + struct TDBTSettingIterFilter { + uint32_t cbSize; /// size in bytes of this structure + uint32_t Options; /// DBT_NIFO_* flags + TDBTEntityHandle hEntity; /// hEntity which settings should be iterated (or where iteration begins) + char * NameStart; /// if set != NULL the iteration will only return settings which name starts with this string + uint32_t ExtraCount; /// count of additional Entities which settings are enumerated, size of the array pointed by ExtraEntities + TDBTEntityHandle * ExtraEntities; /// pointer to an array with additional Entity handles in prioritized order + + PDBTSettingDescriptor Descriptor; /// if set, the iteration will fill in the correct data, you may set SettingsNameLength and SettingName to a buffer to recieve the name of each setting + PDBTSetting Setting; /// if set, iteration loads every settings value, except variable length data (blob, strings) but returns their length + + } TDBTSettingIterFilter, *PDBTSettingIterFilter; + + +/** + \brief Handle of a Setting-Iteration +**/ +typedef uintptr_t TDBTSettingIterationHandle; +/** + \brief initialize an iteration of settings + \param wParam = PDBTSettingIterFilter + \param lParam = 0 + + \return EnumID +**/ +#define MS_DBT_SETTING_ITER_INIT "DBT/Setting/Iter/Init" + + +/** + \brief get the next setting + \param wParam = EnumID returned by MS_DBT_SETTING_ITER_INIT + \param lParam = 0 + + \return hSetting, 0 at the end +**/ +#define MS_DBT_SETTING_ITER_NEXT "DBT/Setting/Iter/Next" + +/** + \brief closes an iteration and frees its ressourcs + \param wParam = IterationHandle returned by MS_DBT_SETTING_ITER_INIT + \param lParam = 0 + + \return 0 on success +**/ +#define MS_DBT_SETTING_ITER_CLOSE "DBT/Setting/Iter/Close" + + +/////////////////////////////////////////////////////////// +// Events +/////////////////////////////////////////////////////////// + +typedef uint32_t TDBTEventHandle; + + +/** + \brief this event was sent by the user. If not set this event was received. +**/ +static const uint32_t DBT_EF_SENT = 0x00000002; + +/** + \brief event has been read by the user. It does not need to be processed any more except for history. +**/ +static const uint32_t DBT_EF_READ = 0x00000004; + +/** + \brief event contains the right-to-left aligned text +**/ +static const uint32_t DBT_EF_RTL = 0x00000008; + +/** + \brief event contains a text in utf-8 +**/ +static const uint32_t DBT_EF_UTF = 0x00000010; + +/** + \brief event is virtual. it is not stored to db file yet. +**/ +static const uint32_t DBT_EF_VIRTUAL = 0x00000020; + +/** + \brief describes an event +**/ +typedef struct TDBTEvent { + uint32_t cbSize; /// size of the structure in bytes + char * ModuleName; /// + uint32_t Timestamp; /// seconds since 00:00, 01/01/1970. Gives us times until 2106 unless you use the standard C library which is signed and can only do until 2038. In GMT. + uint32_t Flags; /// the omnipresent flags + uint32_t EventType; /// module-unique event type ID + uint32_t cbBlob; /// size of pBlob in bytes + uint8_t * pBlob; /// pointer to buffer containing module-defined event data +} TDBTEvent, *PDBTEvent; + +static const uint32_t DBT_EventType_Message = 0; +static const uint32_t DBT_EventType_URL = 1; +static const uint32_t DBT_EventType_Contacts = 2; +static const uint32_t DBT_EventType_Added = 1000; +static const uint32_t DBT_EventType_AuthRequest = 1001; //specific codes, hence the module- +static const uint32_t DBT_EventType_File = 1002; //specific limit has been raised to 2000 + + +/** + \brief retrieves the blobsize of an event in bytes + \param wParam = hEvent + \param lParam = 0 + + \return blobsize +**/ +#define MS_DBT_EVENT_GETBLOBSIZE "DBT/Event/GetBlobSize" + + + +/** + \brief retrieves all information of an event + \param wParam = hEvent + \param lParam = PDBTEvent + + \return 0 on success +**/ +#define MS_DBT_EVENT_GET "DBT/Event/Get" + +/** + \brief retrieves all information of an event + \param wParam = hEntity + \param lParam = 0 + + \return Event count of specified Entity on success, DBT_INVALIDPARAM on error +**/ +#define MS_DBT_EVENT_GETCOUNT "DBT/Event/GetCount" + + +/** + \brief Deletes the specfied event + \param wParam = hEntity + \param lParam = hEvent + + \return 0 on success +**/ +#define MS_DBT_EVENT_DELETE "DBT/Event/Delete" + +/** + \brief Creates a new Event + \param wParam = hEntity + \param lParam = PDBTEvent + + \return hEvent on success, 0 otherwise +**/ + +#define MS_DBT_EVENT_ADD "DBT/Event/Add" + + +/** + \brief Changes the flags for an event to mark it as read. + \param wParam = hEntity + \param lParam = hEvent + + \return New flags +**/ +#define MS_DBT_EVENT_MARKREAD "DBT/Event/MarkRead" + +/** + \brief Saves a virtual event to file and changes the flags. + \param wParam = hEntity + \param lParam = hEvent + + \return 0 on success +**/ +#define MS_DBT_EVENT_WRITETODISK "DBT/Event/WriteToDisk" + +/** + \brief Retrieves a handle to a Entity that owns hEvent. + \param wParam = hEvent + \param lParam = 0 + + \return NULL is a valid return value, meaning, as usual, the user. + DBT_INVALIDPARAM if hDbEvent is invalid, or the handle to the Entity on + success +**/ +#define MS_DBT_EVENT_GETENTITY "DBT/Event/GetEntity" + +/** + \brief Event Filter Options for event iteration +**/ +typedef + struct TDBTEventIterFilter { + uint32_t cbSize; /// size in bytes of this structure + uint32_t Options; /// DBT_NIFO_* flags + TDBTEntityHandle hEntity; /// hEntity which events should be iterated (or where iteration begins) + uint32_t ExtraCount; /// count of additional Entities which settings are enumerated, size of the array pointed by ExtraEntities + TDBTEntityHandle * ExtraEntities; /// pointer to an array with additional Entity handles in prioritized order + + uint32_t tSince; /// timestamp when to start iteration, 0 for first item + uint32_t tTill; /// timestamp when to stop iteration, 0 for last item + + PDBTEvent Event; /// if set every events data gets stored there + + } TDBTEventIterFilter, *PDBTEventIterFilter; + + +/** + \brief Handle of a Event-Iteration +**/ +typedef uintptr_t TDBTEventIterationHandle; +/** + \brief initialize an iteration of events + \param wParam = PDBTEventIterFilter + \param lParam = 0 + + \return EnumID +**/ +#define MS_DBT_EVENT_ITER_INIT "DBT/Event/Iter/Init" + + +/** + \brief get the next event + \param wParam = EnumID returned by MS_DBT_EVENT_ITER_INIT + \param lParam = 0 + + \return hSetting, 0 at the end +**/ +#define MS_DBT_EVENT_ITER_NEXT "DBT/Event/Iter/Next" + +/** + \brief closes an iteration and frees its resourcs + \param wParam = IterationHandle returned by MS_DBT_EVENT_ITER_INIT + \param lParam = 0 + + \return 0 on success +**/ +#define MS_DBT_EVENT_ITER_CLOSE "DBT/Event/Iter/Close" + + + +#pragma pack(pop) + +#endif diff --git a/plugins/!Deprecated/ExternalAPI/m_fortunemsg.h b/plugins/!Deprecated/ExternalAPI/m_fortunemsg.h new file mode 100644 index 0000000000..bf13dc422c --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_fortunemsg.h @@ -0,0 +1,71 @@ +/* + +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. + +*/ + +#ifndef _FORTUNEMSG_ +#define _FORTUNEMSG_ + +#define MIN_FORTUNEMSG 10 +#define MAX_FORTUNEMSG 1024 +#define FORTUNE_BUFSIZE (MAX_FORTUNEMSG + 1) + +//returns the fortune message (from a random file) +//wParam=0 +//lParam=(char *)buffer or 0 +//returns (char *)status msg (buffer if specified), or 0 on failure +//If lParam != 0 then the fortune msg is to be stored there, make sure +//its length is at least equal to FORTUNE_BUFSIZE. If lParam == 0, then +//the plugin will allocate the memory, but don't forget to free it (the +//return value) using MS_FORTUNEMSG_FREEMEMORY (but only if you specify lParam=0!!!) +#define MS_FORTUNEMSG_GETMESSAGE "FortuneMsg/GetMessage" + +//returns the fortune message for a protocol +//wParam=(char*)szProtoName +//lParam=(char *)buffer or 0 +//returns (char *)status msg (buffer if specified), or 0 on failure +//If lParam != 0 then the fortune msg is to be stored there, make sure +//its length is at least equal to FORTUNE_BUFSIZE. If lParam == 0, then +//the plugin will allocate the memory, but don't forget to free it (the +//return value) using MS_FORTUNEMSG_FREEMEMORY (but only if you specify lParam=0!!!) +#define MS_FORTUNEMSG_GETPROTOMSG "FortuneMsg/GetProtoMessage" + +//returns the fortune status message for a status +//wParam=(int)status +//lParam=(char *)buffer or 0 +//returns (char *)status msg (buffer if specified), or 0 on failure +//If lParam != 0 then the fortune msg is to be stored there, make sure +//its length is at least equal to FORTUNE_BUFSIZE. If lParam == 0, then +//the plugin will allocate the memory, but don't forget to free it (the +//return value) using MS_FORTUNEMSG_FREEMEMORY (but only if you specify lParam=0!!!) +#define MS_FORTUNEMSG_GETSTATUSMSG "FortuneMsg/GetStatusMessage" + +//frees the memory allocated by one of the other three services +//wParam=0 +//lParam=(void *)pointer to the memory to be freed +//(the returned value from one of the other three services if called with lParam=0) +//return value: 0 on success, -1 on failure (argument was NULL) +#define MS_FORTUNEMSG_FREEMEMORY "FortuneMsg/FreeMemory" + + +//this service was created for being used by Variables plugin +//wParam=0 +//lParam=(ARGUMENTSINFO *) see m_variables.h for description of the structure +//returns (char *)status msg, or 0 on failure +#define MS_FORTUNEMSG_FROMVARIABLES "FortuneMsg/FromVariables" + + +#endif diff --git a/plugins/!Deprecated/ExternalAPI/m_hddinfo.h b/plugins/!Deprecated/ExternalAPI/m_hddinfo.h new file mode 100644 index 0000000000..3f529ec1ff --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_hddinfo.h @@ -0,0 +1,6 @@ +#define MS_SYSINFO_HDDTEMP "SysInfo/HddTemp" + // checks current hdd temperature +#define MS_SYSINFO_CUSTPOP "SysInfo/CustomPopup" + //shows special custom popup +#define ME_SYSINFO_HDDOVERHEAT "SysInfo/HddOverheat" + // happens if one ot the drives has current temperature higher than set as normal diff --git a/plugins/!Deprecated/ExternalAPI/m_help.h b/plugins/!Deprecated/ExternalAPI/m_help.h new file mode 100644 index 0000000000..ea8557628c --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_help.h @@ -0,0 +1,89 @@ +/* + +Miranda IM Help Plugin +Copyright (C) 2002 Richard Hughes, 2005-2007 H. Herkenrath + +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 (Help-License.txt); if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef M_HELP_H__ +#define M_HELP_H__ + +/* + Help Plugin 0.2.1.2 + All services in here except MS_HELP_SHOWLANGDIALOG should be thread-safe, + you can call them from any thread +*/ + +/* interface id */ +#if !defined(MIID_HELP) + #define MIID_HELP {0x302660c5,0x1bf6,0x4054,{0xa7,0x9f,0x77,0xb1,0x96,0x5d,0x6f,0x48}} +#endif + +/* Enable/disable the help context menu for a specific control. v0.2.0.0+ +Note: You normally do not need to call this, read below. +You can can use this to deactivate the appearance of the help context menu +being shown when the user right clicks on an control. +You can use this service to disable the context menu. + +You do *not* need to use this service when you would like to show +a context menu by yourself, just handle WM_CONTEXTMENU correctly instead. +You need to return TRUE in your DlgProc or 0 in your WndProc, indicating 'message handled'. + +The context menu is disabled by default on the following controls (looks silly on multi-component controls): +ListView, TreeView, Statusbar, Toolbar, CLC +AutoTips are disabled by default for controls stating DLGC_WANTALLKEYS or DLGC_HASSETSEL at +WM_GETDLGCODE (autotips are annoying on edits). + wParam=(WPARAM)(HWND)hwndCtl + lParam=(LPARAM)flags (see below) +Returns 0 on success or nonzero on failure +*/ +#define MS_HELP_SETCONTEXTSTATE "Help/SetContextState" +#define HCSF_CONTEXTMENU 0x01 // show help context menu for this control +#define HCSF_AUTOTIP 0x02 // show automatic help tip on hover for this control + // only works for non-editable +#if !defined(HELP_NOHELPERFUNCTIONS) +__inline static int Help_SetContextState(HWND hwndCtl,DWORD flags) { + if (!ServiceExists(MS_HELP_SETCONTEXTSTATE)) return -1; + return CallService(MS_HELP_SETCONTEXTSTATE,(WPARAM)hwndCtl,flags); +} +#endif + +/* Show a help tooltip for a specific control or dialog. v0.2.0.0+ +You can call this if you would like to show help at a specific time. + wParam=(WPARAM)(HWND)hwndCtl + lParam=0 (unused) +Returns 0 on success or nonzero on failure. +The service fails when the help tooltip cannot be instantiated. +*/ +#define MS_HELP_SHOWHELP "Help/ShowHelp" + +/* Show the download language dialog. v0.2.1.0+ + wParam=lParam=0 +The dialog can't have a parent due to it's asynchronous nature. +If the language window is already opened it will be +brought to front instead (returns success). +Returns 0 on success, nonzero otherwise. +*/ +#define MS_HELP_SHOWLANGDIALOG "Help/ShowLangDialog" + + +#ifndef HELP_NOSETTINGS +#define SETTING_AUTOTIPSENABLED_DEFAULT 0 +#define SETTING_AUTOTIPDELAY_DEFAULT 4000 +#define SETTING_ENABLEHELPUPDATES_DEFAULT 1 +#endif + +#endif // M_HELP_H__ diff --git a/plugins/!Deprecated/ExternalAPI/m_icqplus.h b/plugins/!Deprecated/ExternalAPI/m_icqplus.h new file mode 100644 index 0000000000..30c5b44a82 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_icqplus.h @@ -0,0 +1,92 @@ +// ---------------------------------------------------------------------------80 +// ICQ plugin for Miranda Instant Messenger +// ________________________________________ +// +// Copyright © 2000,2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede +// Copyright © 2001,2002 Jon Keating, Richard Hughes +// Copyright © 2002,2003,2004 Martin Öberg, Sam Kothari, Robert Rainwater +// Copyright © 2004,2005,2006,2007 Joe Kucera +// +// 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. + + +#ifndef M_ICQPLUS_H__ +#define M_ICQPLUS_H__ 1 + +/*#define PS_ICQP_SERVER_IGNORE "/ServerIgnore" + +#define MS_INCOGNITO_REQUEST "/IncognitoRequest" + + +#define MS_TZER_DIALOG "/TzerDialog" +//Send tzer +//wParam=(WPARAM)hContact; +//lParam=(int)tZer +#define MS_SEND_TZER "/SendtZer" + + + +*/ + +#define MAX_CAPNAME 64 +typedef struct +{ + int cbSize; + char caps[0x10]; + HANDLE hIcon; + char name[MAX_CAPNAME]; +} ICQ_CUSTOMCAP; + +// Add a custom icq capability. +// wParam = 0; +// lParam = (LPARAM)(ICQ_CUSTOMCAP *)&icqCustomCap; +#define PS_ICQ_ADDCAPABILITY "/IcqAddCapability" + +// Check if capability is supportes. Only icqCustomCap.caps does matter. +// wParam = (WPARAM)(HANDLE)hContact; +// lParam = (LPARAM)(ICQ_CUSTOMCAP *)&icqCustomCap; +// returns non-zero if capability is supported +#define PS_ICQ_CHECKCAPABILITY "/IcqCheckCapability" +/* + +#ifndef ICQ_NOHELPERS +static __inline void IcqBuildMirandaCap(ICQ_CUSTOMCAP *icqCustomCap, const char *name, HICON hIcon, const char *id) +{ + if (!icqCustomCap) return; + icqCustomCap->cbSize = sizeof(*icqCustomCap); + icqCustomCap->hIcon = hIcon; + strncpy(icqCustomCap->name, name, sizeof(icqCustomCap->name))[sizeof(icqCustomCap->name)-1]=0; + memset(icqCustomCap->caps, 0, 0x10); + strncpy(icqCustomCap->caps+0, "Miranda/", 8); + strncpy(icqCustomCap->caps+8, id, 8); +} +#endif*/ + +/* usage: +char icqCustomCapStr[0x10] = {...}; +ICQ_CUSTOMCAP icqCustomCap; +icqCustomCap.cbSize = sizeof(icqCustomCap); +memcpy(icqCustomCap.caps, icqCustomCapStr, 0x10); +lstrcpy(icqCustomCap.name, "Custom Name"); +CallProtoService("ICQ", PS_ICQ_ADDCAPABILITY, 0, (LPARAM)&icqCustomCap); +*/ + +//check user status via ASD +//wParam=(WPARAM)hContact; + +//#define MS_ICQ_GET_USER_STATUS "/IcqGetUserStatus" + + +#endif // M_ICQPLUS_H__ \ No newline at end of file diff --git a/plugins/!Deprecated/ExternalAPI/m_ircscript.h b/plugins/!Deprecated/ExternalAPI/m_ircscript.h new file mode 100644 index 0000000000..ddab3b96bb --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_ircscript.h @@ -0,0 +1,129 @@ + +/* + This file is a description of the interface between the Miranda Scripting + Plugin (MSP) and IRC. It is mainly an internal draft. + + The MSP is a powerful PHP based scripting engine + which can automate many tasks in Miranda IM. With the implementation of + this interface IRC can also benefit from the advantages MSP brings. The + interface has been constructed by the respective authors of IRC and MSP. + + The idea is that MSP and IRC should communicate via the interface outlined herein, + but MSP should "package" the data in attractive functions that can be easily + used by eager scripters. + + Note that m_chat.h should be #included as the events defined therein is used in this interface + + The IRC plugin communicates with MSP mainly through 8 (2 x 4) services which are + illustrated by the following matrix (MSP has 4 services and IRC 4 services): + + + -------------------------------------------------- + | | | + | Incoming raw data | Data going | + | from server | to GUI | + | (before processing) | (after processing) | + | | | + -------------------------------------------------- + | | | + | Outgoing raw data | Data going | + | to server | from GUI | + | (after processing) | (before processing) | + | | | + -------------------------------------------------- + + (processing refers to the IRC plugin reacting to different commands) + +*/ + + +//------------------------- HANDLING RAW MESSAGES ------------------------ +/* + + The two leftmost boxes are related to data sent to and from the server in RAW form. + (a typical RAW message looks like this: ":nick!user@host COMMAND PARAMETERS") + + It is very useful for scripters to be able to manipulate and add RAW streams of data. + + The below structure is used when RAW data is generated and IRC must trigger an + event in MSP so the scripts can do their magic. + + If the data is modified make sure to use MS_SYSTEM_GET_MMI and then mmi_realloc() to + allocate from the same heap. Do not free the data. + + wParam= Module name + lParam= (LPARAM)( char* )pszRaw + returns nonzero if the message should be dropped +*/ + +/* + NOTE! IRC will implement two services which also uses the same parameters: + + "/InsertRawIn" //used for inserting a "fake" incoming RAW event + "/InsertRawOut" //used for inserting a "fake" outgoing RAW event + +*/ + + +#define MS_MBOT_IRC_RAW_IN "MBot/IrcRawIn" +#define MS_MBOT_IRC_RAW_OUT "MBot/IrcRawOut" + + +//------------------------- HANDLING GUI MESSAGES 1 ------------------------ +/* + + The top rightmost box is related to data sent to the gui + (currently chat.dll) in the form of GCEVENT's. (see m_chat.h) + + While maybe not as useful to the scripter, it can be useful to be able to + "tap into" messages to the GUI from the IRC plugin. + + If the data is modified make sure to realloc() or similar. + + wParam= (WPARAM) (WPARAM_GUI_IN) &wgi + lParam= (LPARAM)(GCEVENT *)&gce // see m_chat.h + returns nonzero if the message should be dropped +*/ + +/* + NOTE! IRC will implement a service which also uses the same parameters: + + "/InsertGuiIn" //used for inserting a "fake" event to the GUI + +*/ +typedef struct MBOT_GUI_WPARAM_IN_STRUCT +{ + const char* pszModule; + WPARAM wParam; +}WPARAM_GUI_IN; + +#define MS_MBOT_IRC_GUI_IN "MBot/IrcGuiIn" + + +//------------------------- HANDLING GUI MESSAGES 2 ------------------------ +/* + + The bottom rightmost box is related to data sent from the gui + (currently chat.dll) in the form of GCHOOKS's. Originally this is carried out in a hook, + but for MSP this is done via a service instead. + + It can be useful for scripters to simulate user actions, like entering text, closing the window etc + + If the data is modified make sure to realloc() or similar. + + wParam= Module name + lParam= (LPARAM)(GCHOOK *)gch // see m_chat.h + returns nonzero if the message should be dropped +*/ + +/* + NOTE! IRC will implement a service which also uses the same parameters: + + "/InsertGuiOut" //used for inserting a "fake" outgoing event to the GUI + +*/ + +#define MS_MBOT_IRC_GUI_OUT "MBot/IrcGuiOut" + +#define MS_MBOT_REGISTERIRC "MBot/RegisterIRCModule" + diff --git a/plugins/!Deprecated/ExternalAPI/m_langman.h b/plugins/!Deprecated/ExternalAPI/m_langman.h new file mode 100644 index 0000000000..1a7b5bf9c2 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_langman.h @@ -0,0 +1,41 @@ +/* + +'Language Pack Manager'-Plugin for +Miranda NG: the free IM client for Microsoft* Windows* + +Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org), +Copyright (C) 2005-2007 H. Herkenrath + +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 (LangMan-License.txt); if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef M_LANGMAN_H__ +#define M_LANGMAN_H__ + +/* Show the download language dialog. v1.0.2.0+ + wParam=lParam=0 +The dialog can't have a parent due to it's asynchronous nature. +If the language window is already opened it will be +brought to front instead (returns success). +Returns 0 on success, nonzero otherwise. +*/ +#define MS_LANGMAN_SHOWLANGDIALOG "LangMan/ShowLangDialog" + + +#ifndef LANGMAN_NOSETTINGS +#define SETTING_ENABLEAUTOUPDATES_DEFAULT 1 +#endif + +#endif // M_LANGMAN_H diff --git a/plugins/!Deprecated/ExternalAPI/m_script.h b/plugins/!Deprecated/ExternalAPI/m_script.h new file mode 100644 index 0000000000..2388bbaad1 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_script.h @@ -0,0 +1,144 @@ +/* + +Miranda Scripting Plugin for Miranda NG +Copyright 2004-2006 Piotr Pawluczuk (www.pawluczuk.info) + +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. + +*/ +/* +Miranda NG: the free IM client for Microsoft* Windows* + +Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org), +Copyright (c) 2000-03 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +*/ + +#ifndef M_SCRIPT_H__ +#define M_SCRIPT_H__ 1 + +#define MBOT_GETCPARAM(cp) ((void*)((unsigned char*)cp + 24)) + +typedef enum {MBOT_NUMBER=0,MBOT_STRING=1,MBOT_VOID=2}MBOT_TYPE; + +#ifndef _LIBPHP_H__ +enum SVAR_TYPE{SV_NULL,SV_LONG=1,SV_WORD=2,SV_DOUBLE=3, + SV_STRING=4,SV_LPOINTER=5,SV_ARRAY=11}; +#endif + +typedef struct{ + int cbSize; //Set to sizeof(); + char* pszOutput; + char* pszResult; +}MBOT_RESULT; + +struct MBOT_VPARAM{ + void* data; + long length; /*length of data, used for strings, and binary strings*/ + long type; +}; + +/* +MBOT function prototypes; +*/ +typedef int (*MBOT_RegisterFunction)(const char* name,void* fptr,long lp, + MBOT_TYPE rval,MBOT_TYPE p1,MBOT_TYPE p2,MBOT_TYPE p3,MBOT_TYPE p4); +typedef int (*MBOT_UnregisterFunction)(const char* name); + +typedef void* (*MBOT_Malloc)(long amount); +typedef char* (*MBOT_Strdup)(const char* str); +typedef void (*MBOT_Free)(void* ptr); +typedef void (*MBOT_FreeResult)(MBOT_RESULT* ptr); + +typedef int (*MBOT_GetVar)(const char* name,void** value,SVAR_TYPE* cType);//returns TRUE if var exists; +typedef int (*MBOT_DelVar)(const char* name); +typedef int (*MBOT_SetVar)(const char* name,void* value,SVAR_TYPE cType); +typedef int (*MBOT_NewVar)(const char* name,void* value,SVAR_TYPE cType,char locked); + +/******************************************************************* + * PARAMETERS: + pszScript - source code of the script; ***DO NOT USE PHP TAGS*** + pResult - if set, you'll get the struct filled with the result; + NOTE! Remember to release the struct with "fp_freeresult"!; + pCParam - custom parameter, for your own use; use MBOT_GETCPARAM(cparam) to get the pointer; + nCPType - its type {MBOT_NUMBER,MBOT_STRING,MBOT_VOID} if str or num, php will be able to get it too + + *EXAMPLE: + fpExecuteFile("mbot/scripts/my.php","fct1",&mbr,"parameter", + MBOT_STRING,"suf","hello",100,25.6); + *******************************************************************/ +typedef int (*MBOT_ExecuteScript)(const char* pszScript,MBOT_RESULT* pResult, + void* pCParam,MBOT_TYPE nCPType); + +/******************************************************************* + * PARAMETERS: + pszPathname - relative or absolute path of the php file; + pszFcnName - function name can be NULL (whole file will be executed then); + pResult - if set, you'll get the struct filled with the result; + NOTE! Remember to release the struct with "fp_freeresult"!; + pCParam - custom parameter, for your own use; use MBOT_GETCPARAM(cparam) to get the pointer; + nCPType - its type {MBOT_NUMBER,MBOT_STRING,MBOT_VOID} if str or num, php will be able to get it too + pszPTypes - a string containing pformats s-string,u-long,l-long,d-long,q-double,f-float,x-hex long, v - MBOT_VPARAM* + ... - values; + + *EXAMPLE: + fpExecuteScript("mbot/scripts/my.php","fct1",&mbr,"parameter", + MBOT_STRING,"suf","hello",100,25.6); + *******************************************************************/ +typedef int (*MBOT_ExecuteFile)(const char* pszPathname,const char* pszFcnName,MBOT_RESULT* pResult, + void* pCParam,MBOT_TYPE nCPType,const char* pszPTypes,...); + +typedef struct{ + int cbSize; //sizeof(MBOT_LPHP); + const char* pszMBotVersion; + //execution + MBOT_ExecuteScript fpExecuteScript; + MBOT_ExecuteFile fpExecuteFile; + //functions + MBOT_RegisterFunction fpRegister; + MBOT_UnregisterFunction fpUnregister; + //variables + MBOT_NewVar fpNewVar; + MBOT_SetVar fpSetVar; + MBOT_GetVar fpGetVar; + MBOT_DelVar fpDelVar; + //memory + MBOT_Strdup fp_strdup; + MBOT_Malloc fp_malloc; + MBOT_Free fp_free; + MBOT_FreeResult fp_freeresult; +}MBOT_FUNCTIONS; + +/*MS_MBOT_GET_FUNCTIONS +lParam = wParam = 0; +returns a pointer to const MBOT_FUNCTIONS structure; +*/ +#define MS_MBOT_GET_FCN_TABLE "MBot/GetFcnTable" +#endif //M_SCRIPT_H__ \ No newline at end of file diff --git a/plugins/!Deprecated/ExternalAPI/m_simpleaway.h b/plugins/!Deprecated/ExternalAPI/m_simpleaway.h new file mode 100644 index 0000000000..e70dcbf4ac --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_simpleaway.h @@ -0,0 +1,103 @@ +/* + +Simple Status Message plugin for Miranda IM +Copyright (C) 2006-2010 Bartosz 'Dezeath' Bia³ek, (C) 2005 Harven + +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., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#ifndef M_SIMPLEAWAY_H__ +#define M_SIMPLEAWAY_H__ 1 + +// +// NOTE: These services are deprecated. Please do not use them anymore. +// Take a look at m_simplestatusmsg.h instead. +// + +// Represents status that a protocol(s) is/are currently in +#define ID_STATUS_CURRENT 40082 + +// Force a change of global status mode/message +// wParam = (int)new status (from statusmodes.h), 0 or ID_STATUS_CURRENT for current +// lParam = (TCHAR *)status message +#define MS_SA_SETSTATUSMODE "SimpleAway/SetStatusMode" +#define MS_AWAYSYS_SETSTATUSMODE MS_SA_SETSTATUSMODE // for compatibility with some plugins + +// Brings up the status message dialog +// wParam = 0 +// lParam = (LPARAM)(char *)protocol name, NULL if for all protocols +#define MS_SA_SHOWSTATUSMSGDIALOG "SimpleAway/ShowStatusMessageDialog" + +// Similar to the service above, for internal use only +#define MS_SA_TTCHANGESTATUSMSG "SimpleAway/TTChangeStatusMessage" + +// Force a change of status mode/message. The status message dialog will appear, +// depending on the configuration of the user +// wParam = (int)new status +// lParam = (LPARAM)(char *)protocol name, NULL if for all protocols +// Returns 1 when changed without showing the status message dialog +#define MS_SA_CHANGESTATUSMSG "SimpleAway/ChangeStatusMessage" + +// For checking if SimpleAway is running +// wParam = lParam = 0 +// Always returns 1 +#define MS_SA_ISSARUNNING "SimpleAway/IsSARunning" + +// Copy the away/na/etc message of a contact +// wParam = (WPARAM)(HANDLE)hContact +// lParam = 0 +// Returns 0 on success or nonzero on failure +// Returns immediately, without waiting for the message to retrieve +#define MS_SA_COPYAWAYMSG "SimpleAway/CopyAwayMsg" + +// Go to URL in away/na/etc message of a contact +// wParam = (WPARAM)(HANDLE)hContact +// lParam = 0 +#define MS_SA_GOTOURLMSG "SimpleAway/GoToURLMsg" + +// Returns the default status message for a status in specified protocol module +// or the current status message for the specified protocol if 0 or ID_STATUS_CURRENT is used +// wParam = (int)status, 0 or ID_STATUS_CURRENT for current +// lParam = (LPARAM)(char *)protocol name, NULL if for all protocols +// Returns status msg. Remember to free the return value +#ifndef MS_AWAYMSG_GETSTATUSMSG + #define MS_AWAYMSG_GETSTATUSMSG "SRAway/GetStatusMessage" +#endif +#ifndef MS_AWAYMSG_GETSTATUSMSGW + #define MS_AWAYMSG_GETSTATUSMSGW "SRAway/GetStatusMessageW" +#endif + +#ifndef MS_AWAYMSG_GETSTATUSMSGT + #ifdef _UNICODE + #define MS_AWAYMSG_GETSTATUSMSGT MS_AWAYMSG_GETSTATUSMSGW + #else + #define MS_AWAYMSG_GETSTATUSMSGT MS_AWAYMSG_GETSTATUSMSG + #endif +#endif + +// Force a change to specified global status mode/message +// (calls MS_SA_CHANGESTATUSMSG with proper parameters) +// wParam = lParam = 0 +#define MS_SA_SETOFFLINESTATUS "SimpleAway/SetOfflineStatus" +#define MS_SA_SETONLINESTATUS "SimpleAway/SetOnlineStatus" +#define MS_SA_SETAWAYSTATUS "SimpleAway/SetAwayStatus" +#define MS_SA_SETDNDSTATUS "SimpleAway/SetDNDStatus" +#define MS_SA_SETNASTATUS "SimpleAway/SetNAStatus" +#define MS_SA_SETOCCUPIEDSTATUS "SimpleAway/SetOccupiedStatus" +#define MS_SA_SETFREECHATSTATUS "SimpleAway/SetFreeChatStatus" +#define MS_SA_SETINVISIBLESTATUS "SimpleAway/SetInvisibleStatus" +#define MS_SA_SETONTHEPHONESTATUS "SimpleAway/SetOnThePhoneStatus" +#define MS_SA_SETOUTTOLUNCHSTATUS "SimpleAway/SetOutToLunchStatus" + +#endif // M_SIMPLEAWAY_H__ diff --git a/plugins/!Deprecated/ExternalAPI/m_snappingwindows.h b/plugins/!Deprecated/ExternalAPI/m_snappingwindows.h new file mode 100644 index 0000000000..fcfd679913 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_snappingwindows.h @@ -0,0 +1,25 @@ +#ifndef SNAPPING_WINDOWS_H +#define SNAPPING_WINDOWS_H + +struct SnapWindowProc_t +{ + HWND hWnd; + // + SIZE m_szMoveOffset; + WPARAM wParam; + LPARAM lParam; + // + int Reserved1; + int Reserved2; + int Reserved3; +}; + +#define CallSnappingWindowProc(hwnd,nMessage,wParam,lParam) {static struct SnapWindowProc_t SnapInfo; \ + if ((nMessage == WM_MOVING) || (nMessage == WM_NCLBUTTONDOWN) || (nMessage == WM_SYSCOMMAND) || (nMessage == WM_SIZING)){ \ + SnapInfo.hWnd = hwnd; \ + SnapInfo.wParam = wParam; \ + SnapInfo.lParam = lParam; \ + CallService("Utils/SnapWindowProc",(WPARAM)&SnapInfo,nMessage); \ + if (nMessage == WM_SIZING) return 1;}} + +#endif //SNAPPING_WINDOWS_H \ No newline at end of file diff --git a/plugins/!Deprecated/ExternalAPI/m_voice.h b/plugins/!Deprecated/ExternalAPI/m_voice.h new file mode 100644 index 0000000000..5adf159f05 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_voice.h @@ -0,0 +1,158 @@ +/* +Copyright (C) 2006 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ + + +#ifndef __M_VOICE_H__ +# define __M_VOICE_H__ + + +#define EVENTTYPE_VOICE_CALL 8739 + + +#define PROTOTYPE_VOICE (PROTOTYPE_ENCRYPTION-9) + + +#define VOICE_UNICODE 0x80000000 + +#ifdef UNICODE +# define VOICE_TCHAR VOICE_UNICODE +#else +# define VOICE_TCHAR 0 +#endif + +#define VOICE_STATE_TALKING 0 +#define VOICE_STATE_RINGING 1 +#define VOICE_STATE_CALLING 2 +#define VOICE_STATE_ON_HOLD 3 +#define VOICE_STATE_ENDED 4 + +typedef struct { + int cbSize; // Struct size + const char *szModule; // The name of the protocol module (used only in notifications) + char *id; // Protocol especific ID for this call + int flags; // Can be VOICE_CALL_CONTACT or VOICE_CALL_STRING (VOICE_UNICODE to say the string is unicode) + union { // Who to call + MCONTACT hContact; + TCHAR *ptszContact; + char *pszContact; + WCHAR *pwszContact; + }; + int state; // VOICE_STATE_* + +} VOICE_CALL; + + +/* +Notifies that a voice call changed state + +wParam: const VOICE_CALL * +lParam: ignored +return: 0 on success +*/ +#define PE_VOICE_CALL_STATE "/Voice/State" + + +#define VOICE_SUPPORTED 1 // Set if proto support voice calls. Probabilly will be 1 ;) +#define VOICE_CALL_CONTACT 2 // Set if a call can be made to a hContact +#define VOICE_CALL_CONTACT_NEED_TEST 4 // Set if the contact need to be tested with PS_VOICE_CALL_CONTACT_VALID (needs VOICE_CALL_CONTACT set to work) +#define VOICE_CALL_STRING 8 // Set if a call can be made to some string (PS_VOICE_CALL_STRING_VALID is used to validate the string) +#define VOICE_CAN_SET_DEVICE 16 // Set if the devices to mic in and sound out can be set (or the protocol will handle it internally) +#define VOICE_CAN_HOLD 32 // Set if a call can be put on hold +/* +Get protocol voice support flags + +wParam: ignored +lParam: ignored +return: 0 on success +*/ +#define PS_VOICE_GETINFO "/Voice/GetInfo" + +/* +Request to the protocol a voice call to hContact. + +wParam: (HANDLE) hContact +lParam: ignored +return: 0 on success +*/ +#define PS_VOICE_CALL "/Voice/Call" + +/* +Service called to make the protocol answer a call. +It is an async call. If the call was answered, the PE_VOICE_STARTEDCALL +notification will be fired. + +wParam: (const char *) id +lParam: ignored +return: 0 on success +*/ +#define PS_VOICE_ANSWERCALL "/Voice/AnswerCall" + +/* +Service called to make the protocol answer a call. This can be called if the +call is ringing or has started. If called any other time it should be ignored. +It is an async call. If the call was droped, the PE_VOICE_ENDEDCALL +notification will be fired. + +wParam: (const char *) id +lParam: ignored +return: 0 on success +*/ +#define PS_VOICE_DROPCALL "/Voice/DropCall" + +/* +Service called to make the protocol hold a call. This means that the call should not +be droped, but it should be muted and put in a hold, to allow other call to be answered. +If the protocol can't hold a cal, it should be droped. + +This can be called if the call has started. If called any other time it should be ignored. +It is an async call. If the call was droped, the PE_VOICE_HOLDEDCALL +notification will be fired. + +wParam: (const char *) id +lParam: ignored +return: 0 on success +*/ +#define PS_VOICE_HOLDCALL "/Voice/HoldCall" + +/* +Used if protocol support VOICE_CALL_STRING. The call string is passed as +wParam and the proto should validate it. + +wParam: (const TCHAR *) call string +lParam: ignored +return: 0 if wrong, 1 if correct +*/ +#define PS_VOICE_CALL_STRING_VALID "/Voice/CallStringValid" + +/* +Used if protocol support VOICE_CALL_CONTACT and VOICE_CALL_CONTACT_NEED_TEST. +The hContact is passed as wParam and the proto should tell if this contact can be +called. + +wParam: (HANDLE) hContact +lParam: (BOOL) TRUE if it is a test for 'can call now?', FALSE if is a test for 'will be possible to call someday?' +return: 0 if can't be called, 1 if can +*/ +#define PS_VOICE_CALL_CONTACT_VALID "/Voice/CallContactValid" + + + + + +#endif // __M_VOICE_H__ diff --git a/plugins/!Deprecated/ExternalAPI/m_voiceservice.h b/plugins/!Deprecated/ExternalAPI/m_voiceservice.h new file mode 100644 index 0000000000..98c3580aea --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_voiceservice.h @@ -0,0 +1,86 @@ +/* +Copyright (C) 2007 Ricardo Pescuma Domenecci + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This 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 +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ + + +#ifndef __M_VOICESERVICE_H__ +# define __M_VOICESERVICE_H__ + +#include "m_voice.h" + + +#define MIID_VOICESERVICE { 0x7d64437, 0xef2e, 0x4f60, { 0xbb, 0x2d, 0x3c, 0x51, 0x8f, 0xe2, 0x4d, 0x63 } } + + +/* +This services are a mirror of the services/notifications in m_voice.h, +with the difference that that ones are to be used by protocols, and this ones +are to be used by plugins that can make calls to contacts in multiple protocols. +*/ + + +/* +Notifies that a voice call changed state + +wParam: const VOICE_CALL * +lParam: ignored +return: 0 on success +*/ +#define MS_VOICESERVICE_STATE "VoiceService/State" + + + +struct VOICE_MODULE +{ + int cbSize; // sizeof(VOICE_MODULE) + char *name; // The internal name of the plugin. All PS_* serivces (except PS_VOICE_GETINFO) + // defined in m_voide.h need to be created based in this name. For example, + // PS_VOICE_CALL (/Voice/Call) need to be created as /Voice/Call + int flags; // VOICE_* from m_voice.h +}; +/* +Register a new plugin that can make/receive voice calls. + +wParam: const VOICE_MODULE * +lParam: ignored +return: 0 on success +*/ +#define MS_VOICESERVICE_REGISTER "VoiceService/Register" + + +/* +Request a voice call to hContact. + +wParam: (HANDLE) hContact +lParam: ignored +return: the number of option calls for a contact. If > 0, it can be called +*/ +#define MS_VOICESERVICE_CAN_CALL "VoiceService/CanCall" + +/* +Request a voice call to hContact. + +wParam: (HANDLE) hContact +lParam: (char *) Protocol or NULL to use any proto avaiable +return: 0 on success +*/ +#define MS_VOICESERVICE_CALL "VoiceService/Call" + + + +#endif // __M_VOICESERVICE_H__ diff --git a/plugins/!Deprecated/ExternalAPI/m_w7ui.h b/plugins/!Deprecated/ExternalAPI/m_w7ui.h new file mode 100644 index 0000000000..6d8ee28b92 --- /dev/null +++ b/plugins/!Deprecated/ExternalAPI/m_w7ui.h @@ -0,0 +1,63 @@ +#ifndef m_w7ui_h__ +#define m_w7ui_h__ + +enum +{ + MIS_ICOLIB, + MIS_GENERAL, + MIS_PROTOCOL, +}; + +struct MIRANDAJUMPLISTITEM +{ + int iconSource; + char *iconName; + int iconIdx; + WCHAR *szTitle; + WCHAR *szPrefix; + WCHAR *szArgument; +}; + +// Force jumplist rebuild +#define MS_JUMPLIST_REBUILD "w7/JumpList/Rebuild" + +// --- +#define ME_JUMPLIST_BUILDCATEGORIES "w7/JumpList/BuildCategories" + +// lParam = (WCHAR *)category name +#define ME_JUMPLIST_BUILDITEMS "w7/JumpList/BuildItems" + +// lParam = (WCHAR *)category name +#define MS_JUMPLIST_ADDCATEGORY "w7/JumpList/AddCategory" + +// lParam = (MIRANDAJUMPLISTITEM *)item +#define MS_JUMPLIST_ADDITEM "w7/JumpList/AddItem" + +// wParam = prefix +// lParam = argument +#define ME_JUMPLIST_PROCESS "w7/JumpList/Process" + +static void MJumpList_AddCategory(WCHAR *name) +{ + CallService(MS_JUMPLIST_ADDCATEGORY, 0, (LPARAM)name); +} + +static void MJumpList_AddItem(char *mir_icon, WCHAR *title, WCHAR *prefix, WCHAR *argument) +{ + MIRANDAJUMPLISTITEM item = { MIS_ICOLIB, mir_icon, 0, title, prefix, argument }; + CallService(MS_JUMPLIST_ADDITEM, 0, (LPARAM)&item); +} + +static void MJumpList_AddItem(int skinicon, WCHAR *title, WCHAR *prefix, WCHAR *argument) +{ + MIRANDAJUMPLISTITEM item = { MIS_GENERAL, 0, skinicon, title, prefix, argument }; + CallService(MS_JUMPLIST_ADDITEM, 0, (LPARAM)&item); +} + +static void MJumpList_AddItem(char *proto, int skinicon, WCHAR *title, WCHAR *prefix, WCHAR *argument) +{ + MIRANDAJUMPLISTITEM item = { MIS_PROTOCOL, proto, skinicon, title, prefix, argument }; + CallService(MS_JUMPLIST_ADDITEM, 0, (LPARAM)&item); +} + +#endif // m_w7ui_h__ diff --git a/plugins/AutoShutdown/res/resource.rc b/plugins/AutoShutdown/res/resource.rc index 222c63cecb..6739278fdc 100644 --- a/plugins/AutoShutdown/res/resource.rc +++ b/plugins/AutoShutdown/res/resource.rc @@ -71,8 +71,6 @@ BEGIN LTEXT "Automatically shutdown the computer and turn the power off when one of the following occurs:",IDC_STATIC,12,128,273,18,SS_NOPREFIX CONTROL "&Thunderstorm warning is issued (Weather)",IDC_CHECK_WEATHER, "Button",BS_AUTOCHECKBOX | BS_TOP | WS_DISABLED | WS_TABSTOP,12,150,273,11 - CONTROL "&Harddrive overheats (HDD Info)",IDC_CHECK_HDDOVERHEAT, - "Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,12,163,273,10 END IDD_SETTINGS DIALOGEX 0, 0, 239, 286 diff --git a/plugins/AutoShutdown/src/common.h b/plugins/AutoShutdown/src/common.h index 7a59d8961f..e2cd8a8264 100644 --- a/plugins/AutoShutdown/src/common.h +++ b/plugins/AutoShutdown/src/common.h @@ -59,11 +59,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include -#include -#include -#include "m_shutdown.h" +#include #include "cpuusage.h" #include "frame.h" diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp index 4cadbe61c4..fbd8da2d41 100644 --- a/plugins/AutoShutdown/src/options.cpp +++ b/plugins/AutoShutdown/src/options.cpp @@ -50,10 +50,6 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L { BOOL enabled = ServiceIsTypeEnabled(SDSDT_SHUTDOWN,0); if (enabled) { - if (ServiceExists(MS_SYSINFO_HDDTEMP)) { - EnableWindow(GetDlgItem(hwndDlg,IDC_CHECK_HDDOVERHEAT),TRUE); - CheckDlgButton(hwndDlg,IDC_CHECK_HDDOVERHEAT,db_get_b(NULL,"AutoShutdown","HddOverheatShutdown",SETTING_HDDOVERHEATSHUTDOWN_DEFAULT) != 0); - } if (ServiceExists(MS_WEATHER_UPDATE)) { EnableWindow(GetDlgItem(hwndDlg,IDC_CHECK_WEATHER),TRUE); CheckDlgButton(hwndDlg,IDC_CHECK_WEATHER,db_get_b(NULL,"AutoShutdown","WeatherShutdown",SETTING_WEATHERSHUTDOWN_DEFAULT) != 0); @@ -100,8 +96,6 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L db_set_b(NULL,"AutoShutdown","SmartOfflineCheck",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_SMARTOFFLINECHECK) != 0)); if (IsWindowEnabled(GetDlgItem(hwndDlg,IDC_CHECK_WEATHER))) db_set_b(NULL,"AutoShutdown","WeatherShutdown",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_WEATHER) != 0)); - if (IsWindowEnabled(GetDlgItem(hwndDlg,IDC_CHECK_HDDOVERHEAT))) - db_set_b(NULL,"AutoShutdown","HddOverheatShutdown",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_HDDOVERHEAT) != 0)); return TRUE; } break; diff --git a/plugins/AutoShutdown/src/resource.h b/plugins/AutoShutdown/src/resource.h index f379eb3aab..78a764d908 100644 --- a/plugins/AutoShutdown/src/resource.h +++ b/plugins/AutoShutdown/src/resource.h @@ -43,7 +43,6 @@ #define IDC_CHECK_REMEMBERONRESTART 1033 #define IDC_CHECK_SMARTOFFLINECHECK 1034 #define IDC_CHECK_WEATHER 1035 -#define IDC_CHECK_HDDOVERHEAT 1036 // Next default values for new objects // diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 1f3fad458e..f18255283a 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -130,8 +130,6 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR SetDlgItemText(hwndDlg,IDC_EDIT_MESSAGE,dbv.ptszVal); mir_free(dbv.ptszVal); } - if (ServiceExists(MS_AUTOREPLACER_ADDWINHANDLE)) - CallService(MS_AUTOREPLACER_ADDWINHANDLE,0,(LPARAM)GetDlgItem(hwndDlg,IDC_EDIT_MESSAGE)); } /* cpuusage threshold */ { @@ -181,8 +179,6 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR } case WM_DESTROY: { - if (ServiceExists(MS_AUTOREPLACER_ADDWINHANDLE)) - CallService(MS_AUTOREPLACER_REMWINHANDLE,0,(LPARAM)GetDlgItem(hwndDlg,IDC_EDIT_MESSAGE)); Utils_SaveWindowPosition(hwndDlg,NULL,"AutoShutdown","SettingsDlg_"); HICON hIcon=(HICON)SendDlgItemMessage(hwndDlg,IDC_ICON_HEADER,STM_SETIMAGE,IMAGE_ICON,0); HFONT hFont=(HFONT)SendDlgItemMessage(hwndDlg,IDC_TEXT_HEADER,WM_GETFONT,0,0); @@ -395,7 +391,6 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR } break; } - CallSnappingWindowProc(hwndDlg,msg,wParam,lParam); /* Snapping Windows plugin */ return FALSE; } diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 70111eaa44..61686744f4 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -31,8 +31,6 @@ static HANDLE hHookIdleChanged; static HANDLE hHookSettingChanged; /* Weather Shutdown */ static HANDLE hHookWeatherUpdated; -/* Overheat Shutdown */ -static HANDLE hHookHddOverheat; /* Services */ static HANDLE hServiceStartWatcher,hServiceStopWatcher,hServiceIsEnabled; static HANDLE hEventWatcherChanged; @@ -246,15 +244,6 @@ static int WeatherUpdated(WPARAM wParam,LPARAM lParam) return 0; } -/************************* Overheat Shutdown **************************/ - -static int HddOverheat(WPARAM wParam,LPARAM lParam) -{ - if (db_get_b(NULL,"AutoShutdown","HddOverheatShutdown",SETTING_HDDOVERHEATSHUTDOWN_DEFAULT)) - ServiceShutdown(SDSDT_SHUTDOWN,TRUE); - return 0; -} - /************************* Services ***********************************/ INT_PTR ServiceStartWatcher(WPARAM wParam,LPARAM lParam) @@ -329,9 +318,6 @@ void WatcherModulesLoaded(void) /* Weather Shutdown */ if (ServiceExists(MS_WEATHER_UPDATE)) hHookWeatherUpdated=HookEvent(ME_WEATHER_UPDATED,WeatherUpdated); - /* Overheat Shutdown */ - if (ServiceExists(MS_SYSINFO_HDDTEMP)) - hHookHddOverheat=HookEvent(ME_SYSINFO_HDDOVERHEAT,HddOverheat); /* restore watcher if it was running on last exit */ if (db_get_b(NULL,"AutoShutdown","RememberOnRestart",0)==SDROR_RUNNING) { @@ -356,8 +342,6 @@ void InitWatcher(void) hHookProtoAck=HookEvent(ME_PROTO_ACK,ProtoAck); /* Weather Shutdown */ hHookWeatherUpdated=NULL; - /* Overheat Shutdown */ - hHookHddOverheat=NULL; /* Services */ hEventWatcherChanged=CreateHookableEvent(ME_AUTOSHUTDOWN_WATCHERCHANGED); hServiceStartWatcher = CreateServiceFunction(MS_AUTOSHUTDOWN_STARTWATCHER, ServiceStartWatcher); @@ -383,8 +367,6 @@ void UninitWatcher(void) mir_free(transfers); /* does NULL check */ /* Weather Shutdown */ UnhookEvent(hHookWeatherUpdated); /* does NULL check */ - /* Overheat Shutdown */ - UnhookEvent(hHookHddOverheat); /* does NULL check */ /* Services */ DestroyServiceFunction(hServiceStartWatcher); DestroyServiceFunction(hServiceStopWatcher); diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 2aaa9463b2..55c09e6d4d 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -105,22 +105,6 @@ void Popup_DoAction(HWND hWnd, BYTE Action, PLUGIN_DATA *pdata) CallServiceSync(MS_HISTORY_SHOWCONTACTHISTORY, hContact, 0); break; - case PCA_OPENLOG: // open log file - { - TCString LogFilePath; - LS_LOGINFO li = {0}; - li.cbSize = sizeof(li); - li.szID = LOG_ID; - li.hContact = hContact; - li.Flags = LSLI_TCHAR; - li.tszLogPath = LogFilePath.GetBuffer(MAX_PATH); - if (!CallService(MS_LOGSERVICE_GETLOGINFO, (WPARAM)&li, 0)) { - LogFilePath.ReleaseBuffer(); - ShowLog(LogFilePath); - } - else LogFilePath.ReleaseBuffer(); - break; - } case PCA_CLOSEPOPUP: // close popup PUDeletePopup(hWnd); break; @@ -276,50 +260,11 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) ClientName.ReleaseBuffer(); } else ClientName = sd.MirVer; - - if (bVariablesExists) - logservice_log(LOG_ID, hContact, ClientName); - else { - _ASSERT(szProto); - TCString szUID(_T("")); - char *uid = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0); - if (uid && (INT_PTR)uid != CALLSERVICE_NOTFOUND) - szUID = DBGetContactSettingAsString(hContact, szProto, uid, _T("")); - - logservice_log(LOG_ID, hContact, TCString((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR)) + _T(" (") + szUID + TranslateT(") changed client to ") + ClientName); - } } _ASSERT(sd.MirVer.GetLen()); // save the last known MirVer value even if the new one is empty return 0; } -static int ContactSettingsInit(WPARAM wParam, LPARAM lParam) -{ - CONTACTSETTINGSINIT *csi = (CONTACTSETTINGSINIT*)wParam; - char *szProto = (csi->Type == CSIT_CONTACT) ? GetContactProto(csi->hContact) : NULL; - if ((csi->Type == CSIT_GROUP) || (szProto && csi->Type == CSIT_CONTACT)) { - int Flag1 = (csi->Type == CSIT_CONTACT) ? CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) : PF1_IM; // if it's a group settings dialog, we assume that there are possibly some contacts in the group with PF1_IM capability - if (Flag1 & (PF1_IMRECV | PF1_URLRECV | PF1_FILERECV)) { // I hope, these flags are sufficient to describe which protocols can theoretically have a client - CONTACTSETTINGSCONTROL csc = {0}; - csc.cbSize = sizeof(csc); - csc.cbStateSize = sizeof(CSCONTROLSTATE); - csc.Position = CSPOS_SORTBYALPHABET; - csc.Flags = CSCF_TCHAR; - csc.ControlType = CSCT_COMBOBOX; - csc.ptszTitle = LPGENT("Client change notifications:"); - csc.ptszGroup = CSGROUP_NOTIFICATIONS; - csc.szModule = MOD_NAME; - csc.szSetting = DB_CCN_NOTIFY; - csc.StateNum = 4; - csc.DefState = 3; - CSCONTROLSTATE States[] = {CSCONTROLSTATE(LPGENT("Never, ignore client changes for this contact"), (BYTE)NOTIFY_IGNORE), CSCONTROLSTATE(LPGENT("Always except when client change notifications are disabled globally"), (BYTE)NOTIFY_ALMOST_ALWAYS), CSCONTROLSTATE(LPGENT("Always, even when client change notifications are disabled globally"), (BYTE)NOTIFY_ALWAYS), CSCONTROLSTATE(LPGENT("Use global settings (default)"), (BYTE)NOTIFY_USEGLOBAL)}; - csc.pStates = States; - CallService(MS_CONTACTSETTINGS_ADDCONTROL, wParam, (LPARAM)&csc); - } - } - return 0; -} - static INT_PTR srvTogglePopups(WPARAM wParam, LPARAM lParam) { g_PopupOptPage.SetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY, !g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY)); @@ -385,7 +330,6 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam) HookEvent(ME_SYSTEM_MODULELOAD, ModuleLoad); HookEvent(ME_SYSTEM_MODULEUNLOAD, ModuleLoad); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged); - HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInit); SkinAddNewSoundEx(CLIENTCHANGED_SOUND, NULL, LPGEN("ClientChangeNotify: Client changed")); if (bPopupExists) { @@ -408,7 +352,6 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam) if (!bFingerprintExists && !db_get_b(NULL, MOD_NAME, DB_NO_FINGERPRINT_ERROR, 0)) CreateDialog(g_hInstance, MAKEINTRESOURCE(IDD_CCN_ERROR), NULL, CCNErrorDlgProc); - logservice_register(LOG_ID, LPGENT("ClientChangeNotify"), _T("ClientChangeNotify?puts(p,?dbsetting(%subject%,Protocol,p))?if2(_?dbsetting(,?get(p),?pinfo(?get(p),uidsetting)),).log"), TranslateT("`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,ID)) changed client to %extratext%")); return 0; } diff --git a/plugins/ClientChangeNotify/src/Common.h b/plugins/ClientChangeNotify/src/Common.h index d29080795b..2dbe3efbfd 100644 --- a/plugins/ClientChangeNotify/src/Common.h +++ b/plugins/ClientChangeNotify/src/Common.h @@ -38,7 +38,6 @@ #include "m_langpack.h" #include "m_options.h" #include "m_clist.h" -#include "m_LogService.h" #include "m_system.h" #include "m_message.h" #include "m_userinfo.h" @@ -51,7 +50,6 @@ #include "m_fingerprint.h" #include "m_metacontacts.h" -#include "m_ContactSettings.h" #include "CommonLibs\TMyArray.h" #include "CommonLibs\Options.h" @@ -68,7 +66,6 @@ #define PCA_OPENDETAILS 2 // open contact details window #define PCA_OPENMENU 3 // open contact menu #define PCA_OPENHISTORY 4 // open contact history -#define PCA_OPENLOG 5 // open log file #define PCA_DONOTHING 6 // do nothing #define POPUP_DEF_LCLICKACTION PCA_OPENMESSAGEWND diff --git a/plugins/ClientChangeNotify/src/OptDlg.cpp b/plugins/ClientChangeNotify/src/OptDlg.cpp index 96a96ccc20..711ba11a39 100644 --- a/plugins/ClientChangeNotify/src/OptDlg.cpp +++ b/plugins/ClientChangeNotify/src/OptDlg.cpp @@ -78,7 +78,6 @@ PopupActions[] = LPGENT("Open contact details window"), PCA_OPENDETAILS, LPGENT("Open contact menu"), PCA_OPENMENU, LPGENT("Open contact history"), PCA_OPENHISTORY, - LPGENT("Open log file"), PCA_OPENLOG, LPGENT("Do nothing"), PCA_DONOTHING }; diff --git a/plugins/ExternalAPI/delphi/imgdecoder.pas b/plugins/ExternalAPI/delphi/imgdecoder.pas deleted file mode 100644 index eea6ec2610..0000000000 --- a/plugins/ExternalAPI/delphi/imgdecoder.pas +++ /dev/null @@ -1,114 +0,0 @@ -unit ImgDecoder; - -interface -uses Windows; - -function IsImgDecoderAvailable:boolean; -function ImgNewDecoder(var pDecoder:pointer):dword; -function ImgDeleteDecoder(pDecoder:pointer):dword; -function ImgNewDIBFromFile(pDecoder:pointer;Filename:PAnsiChar;var pImg:pointer):dword; -function ImgDeleteDIBSection(pImg:pointer):dword; -function ImgGetHandle(pImg:pointer;var pBitmap:HBITMAP;var ppDIBBits:pointer):dword; - -implementation - -const - hModule:THANDLE=0; -type - tImgNewDecoder =function(var pDecoder:pointer):dword; stdcall; - tImgDeleteDecoder =function(pDecoder:pointer):dword; stdcall; - tImgNewDIBFromFile =function(pDecoder:pointer;Filename:PAnsiChar;var pImg):dword; stdcall; - tImgDeleteDIBSection=function(pImg:pointer):dword; stdcall; - tImgGetHandle =function(pImg:pointer;var pBitmap:HBITMAP;var ppDIBBits:pointer):dword; stdcall; - -const - pImgNewDecoder :tImgNewDecoder = nil; - pImgDeleteDecoder :tImgDeleteDecoder = nil; - pImgNewDIBFromFile :tImgNewDIBFromFile = nil; - pImgDeleteDIBSection:tImgDeleteDIBSection = nil; - pImgGetHandle :tImgGetHandle = nil; - -function IsImgDecoderAvailable:boolean; -begin - result:=hModule<>0; -end; - -function ImgNewDecoder(var pDecoder:pointer):dword; -begin - if @pImgNewDecoder<>nil then - result:=pImgNewDecoder(pDecoder) - else - result:=0; -end; - -function ImgDeleteDecoder(pDecoder:pointer):dword; -begin - if @pImgDeleteDecoder<>nil then - result:=pImgDeleteDecoder(pDecoder) - else - result:=0; -end; - -function ImgNewDIBFromFile(pDecoder:pointer;Filename:PAnsiChar;var pImg:pointer):dword; -begin - if @pImgNewDecoder<>nil then - result:=pImgNewDIBFromFile(pDecoder,Filename,pImg) - else - result:=0; -end; - -function ImgDeleteDIBSection(pImg:pointer):dword; -begin - if @pImgNewDecoder<>nil then - result:=pImgDeleteDIBSection(pImg) - else - result:=0; -end; - -function ImgGetHandle(pImg:pointer;var pBitmap:HBITMAP;var ppDIBBits:pointer):dword; -begin - if @pImgGetHandle<>nil then - result:=pImgGetHandle(pImg,pBitmap,ppDIBBits) - else - result:=0; -end; - -initialization - hModule:=LoadLibrary('imgdecoder.dll'); - if hModule=0 then - hModule:=LoadLibrary('plugins\imgdecoder.dll'); - - if hModule<>0 then - begin - pImgNewDecoder :=GetProcAddress(hModule, 'ImgNewDecoder'); - pImgDeleteDecoder :=GetProcAddress(hModule, 'ImgDeleteDecoder'); - pImgNewDIBFromFile :=GetProcAddress(hModule, 'ImgNewDIBFromFile'); - pImgDeleteDIBSection:=GetProcAddress(hModule, 'ImgDeleteDIBSection'); - pImgGetHandle :=GetProcAddress(hModule, 'ImgGetHandle'); - end; - -finalization - if hModule<>0 then - FreeLibrary(hModule); -end. -{ Sample of using - -var - pDecoder:pointer; - pImg:pointer; - bitmap:HBITMAP; - pBits:pointer; -begin - if IsImgDecoderAvailable then - begin - ImgNewDecoder(pDecoder); - if ImgNewDIBFromFile(pDecoder,PAnsiChar(ParamStr(1)),pImg)<>0 then - begin - ImgGetHandle(pImg,bitmap,pBits); -// action - ImgDeleteDIBSection(pImg); - end; - ImgDeleteDecoder(pDecoder); - end; -end. -} diff --git a/plugins/ExternalAPI/delphi/m_DataAsMessage.inc b/plugins/ExternalAPI/delphi/m_DataAsMessage.inc deleted file mode 100644 index 71bfcc059d..0000000000 --- a/plugins/ExternalAPI/delphi/m_DataAsMessage.inc +++ /dev/null @@ -1,155 +0,0 @@ -{ - DataAsMessage plugin for Miranda IM - Copyright (c) 2006 Chervov Dmitry - - 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 -} - -{$IFNDEF M_DATAASMESSAGE} -{$DEFINE M_DATAASMESSAGE} - -const -// DAM_SENDRESULTINFO::iResult values - DAM_SR_SUCCESS = 0; - DAM_SR_TIMEOUT = 1; // timeout period expired; this value is returned - // also if the contact went offline for a time - // longer than a timeout period - DAM_SR_NOTSUPPORTED = 2; // means this szDataType is not supported by the - // remote side - DAM_SR_NODAM = 3; // means there is no DataAsMessage plugin on the - // remote side; keep in mind that this error may - // also appear accidentally because of a bad - // connectivity during the handshake (if there - // was a timeout when waiting for a response) - DAM_SR_CANCELLEDLOCAL = 4; // cancelled from the local(sending) side - DAM_SR_CANCELLEDREMOTE = 5; // cancelled from the remote(receiving) side - DAM_SR_BADCRC = 6; // bad CRC; we can't do anything with this error. presumably, it will happen rarely, and the most probable cause is the protocol that filters some of characters in our messages OR it may be a bug in DataAsMessage plugin (hopefully not ;) ). - DAM_SR_UNKNOWN = 7; // unknown error - -// Return values for DAM_SENDRESULTPROC - DAM_SRA_RETRY = 1; - -type -// hContact, szDataType and SessionID fields correspond to the fields of the -// DAM_SENDDATAINFO structure - PDAM_SENDRESULTINFO = ^TDAM_SENDRESULTINFO; - TDAM_SENDRESULTINFO = record - cbSize :int; // sizeof(DAM_SENDRESULTINFO) - hContact :THANDLE; - szDataType:PAnsiChar; - SessionID :dword; - iResult :int; // transmission result code - end; - -type - TDAM_SENDRESULTPROC = function(sri:PDAM_SENDRESULTINFO):int; cdecl; -// this procedure receives the result of the transmission. it's called when the -// session closes (either the data was sent successfully or there was an error) -// you can return DAM_SRA_RETRY when iResult is DAM_SR_TIMEOUT if you want to -// retry sending - -const -// DAM_SENDDATAINFO::Flags constants - DAM_SDF_DONTPACK = 1; // don't pack the data (by default all the data is packed) - DAM_SDF_NOTIMEOUT = 2; // don't generate a timeout error ever, keep trying to - // send the data. If the contact is offline, the data - // is saved in the memory until the contact goes online. - // Loss of the data occurs only if the sender's miranda - // closes (this may change in future to allow fully - // functional offline sending that will guarantee the - // data to be sent in any case, but of course the - // sending starts only when the both contacts are - // online). other errors than the timeout error can be - // still generated though. - -type - TDAM_SENDDATAINFO = record - cbSize :int; // sizeof(DAM_SENDDATAINFO) - hContact :THANDLE; - szDataType:PAnsiChar; // zero-terminated string, containing data type, - // preferably in format "YourPluginName" or - // "YourPluginName/Something" (make sure this string - // won't coincide by an accident with someone else's - // string!). you can identify your data by this ID later - nDataLen :int; // keep in mind that if the length is too big (more than - // about 8 KB), it's more preferable to split your data - // into several chunks, as you won't be able to "pick - // up" your data at the other end until all the data is - // transferred - cData :PAnsiChar; - Flags :int; // combination of the DAM_SDF_ constants - SendAfterSessionID:dword; // may be NULL; otherwise it's guaranteed that the - // sending starts only after successful completion - // of SendAfterSessionID session - SendResultProc:TDAM_SENDRESULTPROC; // pointer to a procedure that receives - // the result; can be NULL - SessionID :dword; // OUT; receives the session ID - end; - -const -// MS_DAM_SENDDATA return values - DAM_SDA_NOERROR = 0; - DAM_SDA_NOTSUPPORTED = -1; // contact's protocol doesn't support sending/ - // receiving messages - DAM_SDA_TOOMANYSESSIONS = -2; // too many sessions - -// MS_DAM_SENDDATA -// sends the data -// wParam = (WPARAM)(DAM_SENDDATAINFO*)sdi; -// lParam = 0 -// Returns 0 (DAM_SDA_NOERROR) and fills SessionID if the session was queued for sending successfully; returns one of the DAM_SDA_ values on failure - MS_DAM_SENDDATA = 'DataAsMessage/SendData'; - -function DAMSendData(hContact:THANDLE; szDataType:PAnsiChar; nDataLen:int; - cData:PAnsiChar; Flags:int; SendAfterSessionID:dword; - SendResultProc:TDAM_SENDRESULTPROC;pSessionID:pdword):int; -var - sdi:TDAM_SENDDATAINFO; -begin - FillChar(sdi,SizeOf(sdi),0); - sdi.cbSize :=SizeOf(sdi); - sdi.hContact :=hContact; - sdi.szDataType:=szDataType; - sdi.nDataLen :=nDataLen; - sdi.cData :=cData; - sdi.Flags :=Flags; - sdi.SendAfterSessionID:=SendAfterSessionID; - sdi.SendResultProc :=SendResultProc; - Result:=CallService(MS_DAM_SENDDATA,dword(@sdi),0); - if pSessionID<>nil then - pSessionID^:=sdi.SessionID; -end; - -type - TDAM_RECVDATAINFO = record - cbSize :int; // sizeof(DAM_RECVDATAINFO) - hContact :THANDLE; - szDataType:PAnsiChar; - nDataLen :int; - cData :PAnsiChar; - end; - -const -// ME_DAM_RECVDATA -// hook up to this event to check for incoming data -// make sure rdi->szDataType is yours before doing anything! -// The important thing here is that your plugin will receive TWO ME_DAM_RECVDATA notifications on every single MS_DAM_SENDDATA call from a remote side: -// The first notification arrives when the remote side starts to transmit the data. In this case DAM_RECVDATAINFO::cData = NULL (and DAM_RECVDATAINFO::nDataLen = -1) as we didn't receive any data yet. Return 1 to indicate that your plugin recognized the DAM_RECVDATAINFO::szDataType, otherwise return 0. If there are no any plugin that recognized the data, DAM cancels the transfer and there won't be any second notification for it. -// The second notification is when the data is transmitted successfully. nDataLen contains the usual data size and cData points to the data buffer. cData is guaranteed to be valid only during the ME_DAM_RECVDATA call. You must copy the data to your own plugin's memory if you need it later. again, return 1 to indicate that your plugin recognized the data, otherwise return 0 -// wParam = (WPARAM)(DAM_RECVDATAINFO*)rdi; -// lParam = 0 - ME_DAM_RECVDATA = 'DataAsMessage/RecvData'; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_anismiley.inc b/plugins/ExternalAPI/delphi/m_anismiley.inc deleted file mode 100644 index f16005fe51..0000000000 --- a/plugins/ExternalAPI/delphi/m_anismiley.inc +++ /dev/null @@ -1,116 +0,0 @@ -{$IFNDEF M_ANISMILEY} -{$DEFINE M_ANISMILEY} - -const - IASF_UNICODE = 1; - -type - TINSERTANISMILEY = record - cbSize :size_t; - hWnd :HWND; - szFilename :TChar; - dwBackColor:COLORREF; - nHeight :int; - dwFlags :dword; - end; - tagINSERTANISMILEY = TINSERTANISMILEY; - -const - MS_INSERTANISMILEY :PAnsiChar = 'mAnimator/InsertSmiley'; -(* - function InsertAnimatedSmiley(wnd:HWND;filename:TChar;Back:TCOLORREF;height:int):bool; - const - bServiceExists:int=-1 - var - ias:TINSERTANISMILEY; - begin - if bServiceExists=-1 then - bServiceExists:=ServiceExists(MS_INSERTANISMILEY); - if bServiceExists=0 then - result:=false - else - begin - ias.cbSize :=SizeOf(TINSERTANISMILEY); - ias.hWnd :=wnd; - ias.tcsFilename:=Filename.w; - ias.dwFlags :=IASF_UNICODE; - ias.nHeight :=Height; - ias.dwBackColor:=Back; - result:=CallService(MS_INSERTANISMILEY,WPARAM(@ias),0)<>0; - end; - end; - - bool InsertAnimatedSmiley(HWND _hwnd, TCHAR * _szFilename, COLORREF _dwBack, int _nHeight) - { - static int bServiceExists=-1; - ias={0}; - if (bServiceExists==-1) - bServiceExists=ServiceExists(MS_INSERTANISMILEY); - if (!bServiceExists) return FALSE; - ias.cbSize=sizeof(INSERTANISMILEY); - ias.hWnd=_hwnd; - ias.tcsFilename=_szFilename; - ias.dwFlags=IASF_TCHAR; - ias.nHeight=_nHeight; - ias.dwBackColor=_dwBack; - return (bool) CallService(MS_INSERTANISMILEY,(WPARAM)&ias, 0); - }; -*) - - -{ - NM_FIREVIEWCHANGE is WM_NOTIFY Message for notify parent of host window about smiley are going to be repaint - - The proposed action is next: Owner of RichEdit windows received NM_FIREVIEWCHANGE through WM_NOTIFY - twice first time before painting|invalidating (FVCN_PREFIRE) and second time - after (FVCN_POSTFIRE). - The Owner window may change any values of received FVCNDATA_NMHDR structure in order to raise needed action. - For example it may substitute FVCA_INVALIDATE to FVCA_CUSTOMDRAW event to force painting on self offscreen context. - - It can be: - FVCA_CUSTOMDRAW - in this case you need to provide valid HDC to draw on and valid RECT of smiley - FVCA_INVALIDATE - to invalidate specified rect of window - FVCA_NONE - skip any action. But be aware - animation will be stopped till next repainting of smiley. - FVCA_SENDVIEWCHANGE - to notify richedit ole about object changed. Be aware Richedit will fully reconstruct itself - - Another point is moment of received smiley rect - it is only valid if FVCA_DRAW is initially set, - and it is PROBABLY valid if FVCA_INVALIDATE is set. And it most probably invalid in case of FVCA_SENDVIEWCHANGE. - The smiley position is relative last full paint HDC. Usually it is relative to top-left corner of host - richedit (NOT it client area) in windows coordinates. -} - -const -// Type of Event one of - FVCN_PREFIRE = 1; - FVCN_POSTFIRE = 2; - -// Action of event are going to be done - FVCA_NONE = 0; - FVCA_DRAW = 1; // do not modify hdc in case of _DRAW, Use _CUSTOMDRAW - FVCA_CUSTOMDRAW = 2; - FVCA_INVALIDATE = 3; - FVCA_SENDVIEWCHANGE = 4; - FVCA_SKIPDRAW = 5; - -// Extended NMHDR structure for WM_NOTIFY -type - TFVCNDATA_NMHDR = record - //NMHDR structure - hwndFrom :HWND; // Window of smiley host - idFrom :uint_ptr; // ignored - code :uint; // NM_FIREVIEWCHANGE - - cbSize :size_t; - bEvent :byte; // FVCN_ value - pre- or post- painting - bAction :byte; // FVCA_ keys - hDC :HDC; // Canvas to draw on - rcRect :TRECT; // Valid/should be in case of FVCA_DRAW - clrBackground:TCOLORREF; // color to fill background if fTransparent is not set - fTransparent :bool; // if need to fill back color - lParam :LPARAM; // used by host window PreFire and PostFire event - end; - -const -// Code of WM_NOTIFY message (code) - NM_FIREVIEWCHANGE = NM_FIRST+1; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_autoreplacer.inc b/plugins/ExternalAPI/delphi/m_autoreplacer.inc deleted file mode 100644 index bc1d528463..0000000000 --- a/plugins/ExternalAPI/delphi/m_autoreplacer.inc +++ /dev/null @@ -1,39 +0,0 @@ -{ - AutoReplacer plugin - by Angelo Luiz Tartari -} - -{$IFNDEF M_AUTOREPLACER} -{$DEFINE M_AUTOREPLACER} - -const - -{ - Adds a window handle to AutoReplacer. - This handle must belong to any window based on a editbox (editbox, richtext, TMemo, TEdit, TMaskEdit, etc.). - After adding a handle, AutoReplacer will automatically work on this window. - wParam = 0 - lParam = (LPARAM)(HWND)hwnd - Returns: 0 on success, -1 if hwnd is invalid, 1 on error. -} - MS_AUTOREPLACER_ADDWINHANDLE = 'AutoReplacer/AddWinHandle'; - -{ - Removes a window handle from AutoReplacer's list. - wParam = 0 - lParam = (LPARAM)(HWND)hwnd - Returns: 0 on success, -1 if hwnd is invalid, 1 if hwnd wasn't found. -} - MS_AUTOREPLACER_REMWINHANDLE = 'AutoReplacer/RemWinHandle'; - - function autoreplacer_AddWinHandle(hwnd: HWND): integer; - begin - Result := CallService(MS_AUTOREPLACER_ADDWINHANDLE, 0, LPARAM(hwnd)); - end; - - function autoreplacer_RemWinHandle(hwnd: HWND): integer; - begin - Result := CallService(MS_AUTOREPLACER_REMWINHANDLE, 0, LPARAM(hwnd)); - end; - -{$ENDIF} \ No newline at end of file diff --git a/plugins/ExternalAPI/delphi/m_contactdir.inc b/plugins/ExternalAPI/delphi/m_contactdir.inc deleted file mode 100644 index 1b21717753..0000000000 --- a/plugins/ExternalAPI/delphi/m_contactdir.inc +++ /dev/null @@ -1,164 +0,0 @@ -{ -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2005 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -} - -{$IFNDEF M_CONTACTDIR} -{$DEFINE M_CONTACTDIR} - -{ Contactdir module was created on 2005/05/17, 0.4.0.1 - - -- How you use this module as a protocol -- - - On Load() Register your protocol with the setting name that stores unique IDs, example: - - if ( ContactDir_SupportExists() ) g_Atom=ContactDir_Register("ICQ", "UIN"); - - This will register your protocol and walk the database looking for all contacts on PROTOCOL_NAME which have - a "UIN" setting and store it in memory (converting to a string as needed) You of course have to - provide fallback if the services don't exist, it's an idea to keep existing code for that. - - - - - When you add a new contact via MS_DB_CONTACT_ADD, you must register it with your protocol atom too, via - ContactDir_AddContact(atom, "UIN #", hContact) and when it is deleted ContactDir_RemoveContact(atom, "UIN #") - - - - - To find a contact, use ContactDir_Lookup(atom, "ICQ #") which will return the hContact. -} - -type - PCONTACTDIRECTORYDESCRIPTOR = ^TCONTACTDIRECTORYDESCRIPTOR; - TCONTACTDIRECTORYDESCRIPTOR = record - cbSize :int; - szProto :PAnsiChar; - szSetting:PAnsiChar; - atom :THANDLE; // out arg - end; - -{ - wParam: 0 - lParam: (LPARAM) &CONTACTDIRECTORYDESCRIPTOR; - Affect: Register a given protocol and it's setting name which contains the unique key entry. e.g. ("ICQ", "UIN") - and return a HANDLE for use with other lookup services. - Returns: 0 on success, non zero on failure -- a returned handle is in .atom - Note: The directory will convert dword values into string representations but will not do this for bytes or words - used as IDs -- the protocol has to convert the IDs itself (: - Note: See ContactDir_Register() for a quicker way. - *** WARNING ***: This service does not expect the given module name to have registered as a protocol module, it - completely bypasses this information. - Version: 0.4.0.1 (2005/05/17+) -} -const - MS_CONTACTDIR_REGISTER = 'ContactDir/Register'; - -type - PCONTACTDIRECTORYLOOKUP = ^TCONTACTDIRECTORYLOOKUP; - TCONTACTDIRECTORYLOOKUP = record - cbSize :int; - atom :THANDLE; // Atom handle from MS_CONTACTDIR_REGISTER - szID :PAnsiChar; // in: value you wish to find (makes its own copy if needed) - hContact:THANDLE; // out: hContact associated with szID, if any. - end; - -{ - wParam: 0 - lParam: (LPARAM) &CONTACTDIRECTORYLOOKUP; - Affect: Given an atom and string ID, will find the associated DB hContact value - Returns: 0 on success, non zero on failure - Version: 0.4.0.1 (2005/05/17+) - Note: ContactDir_Lookup() helper macro might be of use. -} -const - MS_CONTACTDIR_LOOKUP = 'ContactDir/Lookup'; - -{ - wParam: 0 - lParam: (LPARAM)&CONTACTDIRECTORYLOOKUP; - Affect: Add a contact to a protocol atom association. - Returns: 0 on success, non zero on failure - Version: 0.4.0.1 (2005/05/17+) - Note: You must call this when you create a contact with MS_DB_CONTACT_ADD, see ContactDir_AddContact() -} - MS_CONTACTDIR_ADDCONTACT = 'ContactDir/AddContact'; - -{ - wParam: 0 - lParam: (LPARAM)&CONTACTDIRECTORYLOOKUP; - Affect: Remove a contact to a protocol atom association. - Returns: 0 on success, non zero on failure - Version: 0.4.0.1 (2005/05/17+) - Note: see ContactDir_RemoveContact() -} - MS_CONTACTDIR_REMOVECONTACT = 'ContactDir/RemoveContact'; - -(* -/* -- Helper functions -- */ - -static int ContactDir_SupportExists(void) -{ - return ServiceExists(MS_CONTACTDIR_REGISTER); -} - -// Only take as valid if ContactDir_SupportExists() returns true. -static HANDLE ContactDir_Register(AnsiChar * szProto, AnsiChar * szSetting) -{ - CONTACTDIRECTORYDESCRIPTOR cd; - cd.cbSize=sizeof(CONTACTDIRECTORYDESCRIPTOR); - cd.szProto=szProto; - cd.szSetting=szSetting; - cd.atom=NULL; - CallService(MS_CONTACTDIR_REGISTER, 0, (LPARAM)&cd); - return cd.atom; -} - -static __inline HANDLE ContactDir_Lookup(HANDLE atom, AnsiChar * szID) -{ - CONTACTDIRECTORYLOOKUP f; - f.cbSize=sizeof(f); - f.atom=atom; - f.szID=szID; - f.hContact=NULL; - CallService(MS_CONTACTDIR_LOOKUP, 0, (LPARAM)&f); - return f.hContact; -} - -static __inline void ContactDir_AddContact(HANDLE atom, AnsiChar * szID, HANDLE hContact) -{ - CONTACTDIRECTORYLOOKUP c = {0}; - c.cbSize=sizeof(CONTACTDIRECTORYLOOKUP); - c.atom=atom; - c.szID=szID; - c.hContact=hContact; - CallService(MS_CONTACTDIR_ADDCONTACT, 0, (LPARAM)&c); -} - -static __inline void ContactDir_RemoveContact(HANDLE atom, AnsiChar * szID) -{ - CONTACTDIRECTORYLOOKUP c = {0}; - c.cbSize=sizeof(CONTACTDIRECTORYLOOKUP); - c.atom=atom; - c.szID=szID; - c.hContact=NULL; - CallService(MS_CONTACTDIR_REMOVECONTACT, 0, (LPARAM)&c); -} -*) -{$ENDIF} \ No newline at end of file diff --git a/plugins/ExternalAPI/delphi/m_db3xsa.inc b/plugins/ExternalAPI/delphi/m_db3xsa.inc deleted file mode 100644 index 77ac666967..0000000000 --- a/plugins/ExternalAPI/delphi/m_db3xsa.inc +++ /dev/null @@ -1,84 +0,0 @@ -{ -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2007 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -} - -{$IFNDEF M_DB3XSA} -{$DEFINE M_DB3XSA} - -const -{ DB/SetPassword v0.5.1.3+ - This service is used to set, change or clear the password used for encrypting the profile. - It opens the password change dialog. - wParam=0 - lParam=0 -} - MS_DB_SETPASSWORD = 'DB/SetPassword'; - -{ DB/Backup v0.5.1.3+ - This service will make a backup of your current profile. Backups are named - xx.bak where xx is the number of backups. The larger the number, the - older the backup. - wParam=0 - lParam=0 -} - MS_DB_BACKUP = 'DB/Backup'; - -{ DB/Backup v0.5.1.3+ - This service is the trigger action service and does the same as the service above. - Only difference is wParam carries flags from trigger plugin. - wParam=flags - lParam=0 -} - MS_DB_BACKUPTRIGGER = 'DB/BackupTriggerAct'; - -{ DB/GetProfilePath(W) v0.5.1.5+ - Gets the path of the profile currently being used by the database module. This - path does not include the last '\'. It is appended with the profile's name if - ProfileSubDir=yes is set in the mirandaboot.ini. - wParam=(WPARAM)(int)cbName - lParam=(LPARAM)(AnsiChar*)pszName - pszName is a pointer to the buffer that receives the path of the profile - cbName is the size in bytes of the pszName buffer - Returns 0 on success or nonzero otherwise -} - MS_DB_GETPROFILEPATHW = 'DB/GetProfilePathW'; - - -{ DB/GetProfilePathBasic(W) v0.5.1.5+ - Gets the path of the profile currently being used by the database module. This - path does not include the last '\'. This is never appended with the profile's name. - wParam=(WPARAM)(int)cbName - lParam=(LPARAM)(AnsiChar*)pszName - pszName is a pointer to the buffer that receives the path of the profile - cbName is the size in bytes of the pszName buffer - Returns 0 on success or nonzero otherwise -} - MS_DB_GETPROFILEPATH_BASIC = 'DB/GetProfilePathBasic'; - MS_DB_GETPROFILEPATH_BASICW = 'DB/GetProfilePathBasicW'; - - MIRANDAPATH = '%MIRANDAPATH%'; - MIRANDAPATHW = '%MIRANDAPATH%'; - PROFILEPATH = '%PROFILEPATH%'; - PROFILEPATHW = '%PROFILEPATH%'; - PROFILENAME = '%PROFILENAME%'; - PROFILENAMEW = '%PROFILENAME%'; - -{$ENDIF} \ No newline at end of file diff --git a/plugins/ExternalAPI/delphi/m_ersatz.inc b/plugins/ExternalAPI/delphi/m_ersatz.inc deleted file mode 100644 index 553194eee2..0000000000 --- a/plugins/ExternalAPI/delphi/m_ersatz.inc +++ /dev/null @@ -1,41 +0,0 @@ -{ -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2006 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -} - -{$IFNDEF M_ERSATZ} -{$DEFINE M_ERSATZ} - -const -// Returns the status message for a status -// wParam=(word) 0 for current status or a status -// lParam=0 -// Returns status msg or NULL if there is none. The protocol have to handle only the current -// status. Handling messages for other statuses is optional. -// Remember to mir_free the return value - PS_GETMYAWAYMSG = '/GetMyAwayMsg'; - -// Created if ersatz is installed -// wParam=0 -// lParam=0 -// returns always 1 - MS_ERSATZ_ENABLED = 'ERSATZ/Enabled'; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_fuse.inc b/plugins/ExternalAPI/delphi/m_fuse.inc deleted file mode 100644 index 82b002b5db..0000000000 --- a/plugins/ExternalAPI/delphi/m_fuse.inc +++ /dev/null @@ -1,28 +0,0 @@ -{$IFNDEF M_FUSE} -{$DEFINE M_FUSE} - -const - FUSE_INIT = 0; // core started, Param=**FUSE_LINK - FUSE_DEINIT = 1; // core stopped - FUSE_DEFMOD = 3; // LoadDefaultModules() return code, Param=*int - FUSE_DEATH = 4; // DestroyingModularEngine() just got called - -type - PFUSE_LINK = ^TFUSE_LINK; - TFUSE_LINK = record - cbSize : longint; - CreateHookableEvent : function (para1:PAnsiChar):THANDLE;cdecl; - DestroyHookableEvent : function (para1:THANDLE):longint;cdecl; - NotifyEventHooks : function (para1:THANDLE; para2:WPARAM; para3:LPARAM):longint;cdecl; - HookEvent : function (para1:PAnsiChar; para2:TMIRANDAHOOK):THANDLE;cdecl; - HookEventMessage : function (para1:PAnsiChar; para2:HWND; para3:dword):THANDLE;cdecl; - UnhookEvent : function (para1:THANDLE):longint;cdecl; - CreateServiceFunction : function (para1:PAnsiChar; para2:TMIRANDASERVICE):THANDLE;cdecl; - CreateTransientServiceFunction : function (para1:PAnsiChar; para2:TMIRANDASERVICE):THANDLE;cdecl; - DestroyServiceFunction : function (para1:THANDLE):longint;cdecl; - CallService : function (para1:PAnsiChar; para2:WPARAM; para3:LPARAM):longint;cdecl; - ServiceExists : function (para1:PAnsiChar):longint;cdecl; {v0.1.0.1+ } - CallServiceSync : function (para1:PAnsiChar; para2:WPARAM; para3:LPARAM):longint;cdecl; {v0.1.2.2+ } - end; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_help(plugin).inc b/plugins/ExternalAPI/delphi/m_help(plugin).inc deleted file mode 100644 index 0eb63615d9..0000000000 --- a/plugins/ExternalAPI/delphi/m_help(plugin).inc +++ /dev/null @@ -1,76 +0,0 @@ -{ -Miranda IM Help Plugin -Copyright (C) 2002 Richard Hughes, 2005-2007 H. Herkenrath - -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 (Help-License.txt); if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -} - -{$IFNDEF M_HELP} -{$DEFINE M_HELP} - -const - -{ - Help Plugin 0.2.1.2 - All services in here except MS_HELP_SHOWLANGDIALOG should be thread-safe, - you can call them from any thread -} - -{ interface id } - MIID_HELP: TGUID = '{302660C5-1BF6-4054-A79F-77B1965D6F48}'; - -{ Enable/disable the help context menu for a specific control. v0.2.0.0+ -Note: You normally do not need to call this, read below. -You can can use this to deactivate the appearance of the help context menu -being shown when the user right clicks on an control. -You can use this service to disable the context menu. - -You do *not* need to use this service when you would like to show -a context menu by yourself, just handle WM_CONTEXTMENU correctly instead. -You need to return TRUE in your DlgProc or 0 in your WndProc, indicating 'message handled'. - -The context menu is disabled by default on the following controls (looks silly on multi-component controls): -ListView, TreeView, Statusbar, Toolbar, CLC -AutoTips are disabled by default for controls stating DLGC_WANTALLKEYS or DLGC_HASSETSEL at -WM_GETDLGCODE (autotips are annoying on edits). - wParam : (HWND)hwndCtl - lParam : flags (see below) -Returns 0 on success or nonzero on failure -} - MS_HELP_SETCONTEXTSTATE = 'Help/SetContextState'; - HCSF_CONTEXTMENU = $01; // show help context menu for this control - HCSF_AUTOTIP = $02; // show automatic help tip on hover for this control - // only works for non-editable - -{ Show a help tooltip for a specific control or dialog. v0.2.0.0+ -You can call this if you would like to show help at a specific time. - wParam : (HWND)hwndCtl - lParam : 0 -Returns 0 on success or nonzero on failure. -The service fails when the help tooltip cannot be instantiated. -} - MS_HELP_SHOWHELP = 'Help/ShowHelp'; - -{ Show the download language dialog. v0.2.1.0+ - wParam : 0 - lParam : 0 -The dialog can't have a parent due to it's asynchronous nature. -If the language window is already opened it will be -brought to front instead (returns success). -Returns 0 on success, nonzero otherwise. -} - MS_HELP_SHOWLANGDIALOG = 'Help/ShowLangDialog'; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_historyevents.inc b/plugins/ExternalAPI/delphi/m_historyevents.inc deleted file mode 100644 index ae582f0eef..0000000000 --- a/plugins/ExternalAPI/delphi/m_historyevents.inc +++ /dev/null @@ -1,201 +0,0 @@ -{ -Copyright (C) 2006 Ricardo Pescuma Domenecci - -This is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this file; see the file license.txt. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. -} - - -{$IFNDEF M_HISTORYEVENTS} -{$DEFINE M_HISTORYEVENTS} - -const - HISTORYEVENTS_FORMAT_CHAR = 1; - HISTORYEVENTS_FORMAT_WCHAR = 2; - HISTORYEVENTS_FORMAT_RICH_TEXT = 4; - HISTORYEVENTS_FORMAT_HTML = 8; - -const - HISTORYEVENTS_FLAG_DEFAULT = 1 shl 0; // Is a miranda core event type - HISTORYEVENTS_FLAG_SHOW_IM_SRMM = 1 shl 1; // If this event has to be shown in srmm dialog - HISTORYEVENTS_FLAG_USE_SENT_FLAG = 1 shl 2; // Means that it can be a sent or received and uses DBEF_SENT to mark that - HISTORYEVENTS_FLAG_EXPECT_CONTACT_NAME_BEFORE = 1 shl 3; // Means that who is drawing this should draw the contact name before the text - HISTORYEVENTS_FLAG_ONLY_LOG_IF_SRMM_OPEN = 1 shl 4; // If this event will be logged only if the message window is open - HISTORYEVENTS_FLAG_FLASH_MSG_WINDOW = 1 shl 5; // If this event will trigger the openning/flashing of the message window - - HISTORYEVENTS_REGISTERED_IN_ICOLIB = 9 shl 16; // If the icon is a name already registered in icolib - - HISTORYEVENTS_FLAG_KEEP_ONE_YEAR = 1 shl 8; // By default store in db for 1 year - HISTORYEVENTS_FLAG_KEEP_SIX_MONTHS = 2 shl 8; // By default store in db for 6 months - HISTORYEVENTS_FLAG_KEEP_ONE_MONTH = 3 shl 8; // By default store in db for 1 month - HISTORYEVENTS_FLAG_KEEP_ONE_WEEK = 4 shl 8; // By default store in db for 1 week - HISTORYEVENTS_FLAG_KEEP_ONE_DAY = 5 shl 8; // By default store in db for 1 day - HISTORYEVENTS_FLAG_KEEP_FOR_SRMM = 6 shl 8; // By default store in db only enought for message log - HISTORYEVENTS_FLAG_KEEP_MAX_TEN = 7 shl 8; // By default store in db max 10 entries - HISTORYEVENTS_FLAG_KEEP_MAX_HUNDRED = 8 shl 8; // By default store in db for 100 entries - HISTORYEVENTS_FLAG_KEEP_DONT = 9 shl 8; // By default don't store in db (aka ignore it) - - -// This function must be implemented by subscribers. It must return a pointer or NULL -// to say it can't handle the text -type - fGetHistoryEventText = function(hContact:THANDLE; hDbEvent:THANDLE; - dbe:PDBEVENTINFO; format:int):pointer; cdecl; - -type - HISTORY_EVENT_HANDLER = record - cbSize :int; - module :PAnsiChar; - name :PAnsiChar; // Internal event name - description:PAnsiChar; // Will be translated. When retrieving it is already translated - eventType :word; // The event type it can handle - defaultIcon:HICON; // PAnsiChar= icon name if HISTORYEVENTS_REGISTERED_IN_ICOLIB is set. - // Always use this one when retrieving - supports :int; // What kind of return is supported - or of HISTORYEVENTS_FORMAT_* - flags :int; // or of HISTORYEVENTS_FLAG_* - pfGetHistoryEventText:fGetHistoryEventText; // NULL to use default get text (similar to message, without extra format) - - // Aditional data if wants to use add to history services - templates:^PAnsiChar; // Each entry is: "Name\nDefault\n%var%\tDescription\n%var%\tDescription\n%var%\tDescription" - numTemplates:int; - end; -const -{ - Get the number of registered events - - wParam: ignored - lParam: ignored - Return: The number of events registered with the plugin -} - MS_HISTORYEVENTS_GET_COUNT:PAnsiChar = 'HistoryEvents/GetCount'; - -{ - Get an event by number or by type. - To retrieve by number, pass -1 as type. To retrieve by type, pass -1 as number. - - wParam: (int) event number - lParam: (int) event type - Return: (const HISTORY_EVENT_HANDLER *) if the event exists, NULL otherwise. Don't change the - returned strunc: it is a pointer to the internall struct. -} - MS_HISTORYEVENTS_GET_EVENT:PAnsiChar = 'HistoryEvents/GetEvent'; - -{ - Register a plugin that can handle an event type. This must be called during the call to the - Load function of the plugin. In ModulesLoaded callback all plugins have to be already - registered, so srmm and history modules can query then. - - wParam: HISTORY_EVENT_HANDLER * - lParam: ignored - Return: 0 for success -} - MS_HISTORYEVENTS_REGISTER:PAnsiChar = 'HistoryEvents/Register'; - - -type - HISTORY_EVENT_PARAM = record - cbSize :int; - hDbEvent:THANDLE; - dbe :PDBEVENTINFO; // Optional - format :int; // one of HISTORYEVENTS_FORMAT_* - end; - -const -{ - Check if an event can be handled by any subscribers - - wParam: WORD - event type - lParam: ignored - Return: BOOL -} - MS_HISTORYEVENTS_CAN_HANDLE:PAnsiChar = 'HistoryEvents/CanHandle'; - -{ - Get the icon for a history event type - - wParam: WORD - event type - lParam: ignored - Return: HICON - after use free with MS_HISTORYEVENTS_RELEASE_ICON -} - MS_HISTORYEVENTS_GET_ICON:PAnsiChar = 'HistoryEvents/GetIcon'; - -{ - Get the flags for a history event type - - wParam: WORD - event type - lParam: ignored - Return: int - or of HISTORYEVENTS_FLAG_* or -1 if error -} - MS_HISTORYEVENTS_GET_FLAGS:PAnsiChar = 'HistoryEvents/GetFlags'; - -{ - Release the icon for a history event type. This is really just a forward to icolib - - wParam: HICON - lParam: ignored -} - MS_HISTORYEVENTS_RELEASE_ICON:PAnsiChar = 'Skin2/Icons/ReleaseIcon'; - -{ - Get the text for a history event type - - wParam: HISTORY_EVENT_PARAM * - lParam: ignored - Return: char * or wchar * depending on sent flags. Free with mir_free or MS_HISTORYEVENTS_RELEASE_TEXT -} - MS_HISTORYEVENTS_GET_TEXT:PAnsiChar = 'HistoryEvents/GetText'; - -{ - Release the text for a history event type. Internally is just a call to mir_free - - wParam: char * or wchar * - lParam: ignored -} - MS_HISTORYEVENTS_RELEASE_TEXT:PAnsiChar = 'HistoryEvents/ReleaseText'; - - -type - HISTORY_EVENT_ADD = record - cbSize :int; - hContact :THANDLE; - eventType :word; - templateNum :int; - variables :^PTCHAR; // TCHAR **variables - numVariables :int; - additionalData :pbyte; - additionalDataSize:int; - flags :int; // Flags for the event type - end; - -const -{ - Add an registered event to the history. This is a helper service - - wParam: HISTORY_EVENT_ADD - lParam: ignored - Return: HANDLE to the db event -} - MS_HISTORYEVENTS_ADD_TO_HISTORY:PAnsiChar = 'HistoryEvents/AddToHistory'; - -{ - Check if a template is enabled - - wParam: event type - lParam: template num - Return: TRUE or FALSE -} - MS_HISTORYEVENTS_IS_ENABLED_TEMPLATE:PAnsiChar = 'HistoryEvents/IsEnabledTemplate'; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_ircscript.inc b/plugins/ExternalAPI/delphi/m_ircscript.inc deleted file mode 100644 index 0157443e30..0000000000 --- a/plugins/ExternalAPI/delphi/m_ircscript.inc +++ /dev/null @@ -1,125 +0,0 @@ -{ - This file is a description of the interface between the Miranda Scripting - Plugin (MSP) and IRC. It is mainly an internal draft. - - The MSP is a powerful PHP based scripting engine - which can automate many tasks in Miranda IM. With the implementation of - this interface IRC can also benefit from the advantages MSP brings. The - interface has been constructed by the respective authors of IRC and MSP. - - The idea is that MSP and IRC should communicate via the interface outlined herein, - but MSP should "package" the data in attractive functions that can be easily - used by eager scripters. - - Note that m_chat.h should be #included as the events defined therein is used in this interface - - The IRC plugin communicates with MSP mainly through 8 (2 x 4) services which are - illustrated by the following matrix (MSP has 4 services and IRC 4 services): - - -------------------------------------------------- - | | | - | Incoming raw data | Data going | - | from server | to GUI | - | (before processing) | (after processing) | - | | | - -------------------------------------------------- - | | | - | Outgoing raw data | Data going | - | to server | from GUI | - | (after processing) | (before processing) | - | | | - -------------------------------------------------- - - (processing refers to the IRC plugin reacting to different commands) -} - -{$IFNDEF M_IRCSCRIPT} -{$DEFINE M_IRCSCRIPT} - -//------------------------- HANDLING RAW MESSAGES ------------------------ -{ - The two leftmost boxes are related to data sent to and from the server in RAW form. - (a typical RAW message looks like this: ":nick!user@host COMMAND PARAMETERS") - - It is very useful for scripters to be able to manipulate and add RAW streams of data. - - The below structure is used when RAW data is generated and IRC must trigger an - event in MSP so the scripts can do their magic. - - If the data is modified make sure to use MS_SYSTEM_GET_MMI and then mmi_realloc() to - allocate from the same heap. Do not free the data. - - wParam= Module name - lParam= (LPARAM)(AnsiChar *)pszRaw - returns nonzero if the message should be dropped -} - -{ - NOTE! IRC will implement two services which also uses the same parameters: - - "/InsertRawIn" //used for inserting a "fake" incoming RAW event - "/InsertRawOut" //used for inserting a "fake" outgoing RAW event -} - -const - MS_MBOT_IRC_RAW_IN = 'MBot/IrcRawIn'; - MS_MBOT_IRC_RAW_OUT = 'MBot/IrcRawOut'; - -//------------------------- HANDLING GUI MESSAGES 1 ------------------------ -{ - The top rightmost box is related to data sent to the gui - (currently chat.dll) in the form of GCEVENT's. (see m_chat.h) - - While maybe not as useful to the scripter, it can be useful to be able to - "tap into" messages to the GUI from the IRC plugin. - - If the data is modified make sure to realloc() or similar. - - wParam= (WPARAM) (WPARAM_GUI_IN) &wgi - lParam= (LPARAM)(GCEVENT *)&gce // see m_chat.h - returns nonzero if the message should be dropped -} - -{ - NOTE! IRC will implement a service which also uses the same parameters: - - "/InsertGuiIn" //used for inserting a "fake" event to the GUI -} -type - PWPARAM_GUI_IN = ^WPARAM_GUI_IN; - WPARAM_GUI_IN = record - pszModule:PAnsiChar; - wParam:WPARAM; - end; - PMBOT_GUI_WPARAM_IN_STRUCT = PWPARAM_GUI_IN; - TMBOT_GUI_WPARAM_IN_STRUCT = WPARAM_GUI_IN; - -const - MS_MBOT_IRC_GUI_IN = 'MBot/IrcGuiIn'; - -//------------------------- HANDLING GUI MESSAGES 2 ------------------------ -{ - The bottom rightmost box is related to data sent from the gui - (currently chat.dll) in the form of GCHOOKS's. Originally this is carried out in a hook, - but for MSP this is done via a service instead. - - It can be useful for scripters to simulate user actions, like entering text, closing the window etc - - If the data is modified make sure to realloc() or similar. - - wParam= Module name - lParam= (LPARAM)(GCHOOK *)gch // see m_chat.h - returns nonzero if the message should be dropped -} - -{ - NOTE! IRC will implement a service which also uses the same parameters: - - "/InsertGuiOut" //used for inserting a "fake" outgoing event to the GUI -} - - MS_MBOT_IRC_GUI_OUT = 'MBot/IrcGuiOut'; - - MS_MBOT_REGISTERIRC = 'MBot/RegisterIRCModule'; - -{$ENDIF} \ No newline at end of file diff --git a/plugins/ExternalAPI/delphi/m_keybindings.inc b/plugins/ExternalAPI/delphi/m_keybindings.inc deleted file mode 100644 index e0c31c31e5..0000000000 --- a/plugins/ExternalAPI/delphi/m_keybindings.inc +++ /dev/null @@ -1,58 +0,0 @@ -{ -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2007 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -} - -{$IFNDEF M_KEYBINDINGS} - -const - KB_CTRL_FLAG = $10000; - KB_SHIFT_FLAG = $20000; - KB_ALT_FLAG = $40000; - - KBDF_UNICODE = 1; - -type - TKEYBINDINGDESC = record - cbSize :int; //size of the structure - szSection :TChar; // section name used to display key bindings in the tree view [TRANSLATED-BY-CORE] - pszActionName :TChar; // action name used to display key bindings in the tree view [TRANSLATED-BY-CORE] - pszActionGroup:PAnsiChar; // action group name used to group unique shortcuts, shortcuts cannot be duplicated within a group - key :array [0..4] of dword; // virtual key + KB_* flags, up to 5 different shortcuts may be defined for each action - flags :dword; // flags (KBDF_*) - action :int; // id of the action - end; - -{Registers action with default key bindings assigned to it. - wParam = (WPARAM) 0; not used - lParam = (LPARAM) (KEYBINDINGDESC*) - return: 0 on success, error code otherwise -} - MS_KEYBINDINGS_REGISTER :PAnsiChar = 'KeyBindings/Register'; - -{Gets action assigned to the given key - key[0] and pszActionGroup in KEYBINDINGDESC should be set before calling this service - wParam = (WPARAM) 0; not used - lParam = (LPARAM) (KEYBINDINGDESC*) - return: 0 if action assigned to the given key was found, 1 otherwise -} - MS_KEYBINDINGS_GET :PAnsiChar = 'KeyBindings/Get'; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_langman.inc b/plugins/ExternalAPI/delphi/m_langman.inc deleted file mode 100644 index 4f0079719d..0000000000 --- a/plugins/ExternalAPI/delphi/m_langman.inc +++ /dev/null @@ -1,46 +0,0 @@ -{ -'Language Pack Manager'-Plugin for -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2005-2007 H. Herkenrath - -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 (LangMan-License.txt); if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -} - -{$IFNDEF M_LANGMAN} -{$DEFINE M_LANGMAN} - -const - -{ - Language Pack Manager v1.0.2.1 - If you have any question or extension whishes please let me know: - hrathh at users.sourceforge.net -} - -{ interface id } - MIID_LANGMAN: TGUID = '{D80370D5-4B1E-46a8-ACA4-1FAAD79B7D1E}'; - -{ Show the download language dialog. v1.0.1.2+ - wParam : 0 - lParam : 0 -The dialog can't have a parent due to it's asynchronous nature. -If the language window is already opened it will be -brought to front instead (returns success). -Returns 0 on success, nonzero otherwise. -} - MS_LANGMAN_SHOWLANGDIALOG = 'LangMan/ShowLangDialog'; - -{$ENDIF} // M_LANGMAN diff --git a/plugins/ExternalAPI/delphi/m_mathmodule.inc b/plugins/ExternalAPI/delphi/m_mathmodule.inc deleted file mode 100644 index a4d10edfa6..0000000000 --- a/plugins/ExternalAPI/delphi/m_mathmodule.inc +++ /dev/null @@ -1,199 +0,0 @@ -{$IFNDEF M_MATHMODULE} -{$DEFINE M_MATHMODULE} - {--------------------------------------------------- } - { - 2 - x + 2 Pi - + R - Sin(wt) - - Math-Module - - Miranda Plugin by Stephan Kassemeyer - MathModule API - (c) Stephan Kassemeyer - 8 May, 2004 - } - { --------- } - { - Miranda Service-functions defined by MathModule - call with the - int ( CallService)(const AnsiChar servicename,WPARAM,LPARAM) - that you get from miranda when Miranda calls the - Load(PLUGINLINK link) - of your PlugIn-dll - the CallService function then is: - link->CallServiceSync(Servicename,wparam,lparam) - } - { --------- } - -const - MATH_RTF_REPLACE_FORMULAE = 'Math/RtfReplaceFormulae'; - { replace all formulas in a RichEdit with bitmaps. } - { wParam = 0 } - { lParam = *TMathRichedit Info } - { return: TRUE if replacement succeeded, FALSE if not (disable by user?). } - { handle of richedit. } - { NULL: replace all. } -type - PMathRicheditInfo = ^TMathRicheditInfo; - TMathRicheditInfo = record - hwndRichEditControl : HWND; - sel : PCHARRANGE; - disableredraw : int; - end; - { WARNING: !!! } - { Strange things happen if you use this function twice on the same CHARRANGE: } - { if Math-startDelimiter == Math-endDelimiter, there is the following problem: } - { it might be that someone forgot an endDelimiter, this results in a lonesome startdelimiter. } - { if you try to MATH_REPLACE_FORMULAE the second time, startDelimiters and endDelimiters are mixed up. } - { The same problem occours if we have empty formulae, because two succeding delimiters are } - { replaced with a single delimiter. } - -const - MATH_GET_STARTDELIMITER = 'Math/GetStartDelimiter'; - { returns the delimiter that marks the beginning of a formula } - { wparam=0 } - { lparam=0 } - { result=*AnsiChar Delimiter } - { !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER } - - MATH_GETENDDELIMITER = 'Math/GetEndDelimiter'; - { returns the delimiter that marks the end of a formula } - { wparam=0 } - { lparam=0 } - { result=*AnsiChar Delimiter } - { !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER } - - MTH_FREE_MATH_BUFFER = 'Math/FreeRTFBitmapText'; - { deletes any buffer that MathModule has created. } - { wparam=0 } - { lparam=(*AnsiChar) buffer } - { result=0 } - - MATH_SETBKGCOLOR = 'Math/SetBackGroundColor'; - { changes the background color of the next formula to be rendered. } - { wparam=0 } - { lparam=(COLORREF) color } - { result=0 } - - MATH_SET_PARAMS = 'Math/SetParams'; - { sets a parameter (only integer values) encoded in wparam } - { wparam=paramcode } - { lparam=parametervalue } - { paramcodes: } -const - MATH_PARAM_BKGCOLOR = 0; // (COLORREF) std-rgb-color or TRANSPARENT_Color - MATH_PARAM_FONTCOLOR = 1; // (COLORREF) std-rgb-color - RESIZE_HWND = 2; // (HWND) preview window resizes RESIZE_HWND when - // it is being resized. - ToolboxEdit_HWND = 3; // (HWND) If this hwnd (of an edit-box) is set, - // MathModule can insert Formula-elements from - // the Math-Toolbox. -// you can make the BKGCOLOR Transparent (default) by using this color: - TRANSPARENT_Color = $FFFFFFFF-1; // this is default - -const - MTH_GETBITMAP = 'Math/GetBitmap'; - {returns Bitmap that represents the formula given in lparam (string-pointer) } - {this formula has NO Delimiters. } - {wparam=0 } - {lparam=(*AnsiChar)Formula } - {result=(HBITMAP) bitmap } - {!!! the bitmap must be deleted with DeleteObject(hobject) } - {example: } - {HBITMAP Bmp=(HBITMAP)CallService(MTH_GETBITMAP,0, (LPARAM)formula); } - - MTH_GET_RTF_BITMAPTEXT = 'Math/GetRTFBitmapText'; - { returns rich-text stream that includes bitmaps from text given in lparam } - { text included between MATH_GET_STARTDELIMITER and MATH_GETENDDELIMITER } - { hereby is replaced with a rtf-bitmap-stream that represents the corresponding formula } - { wparam=0 } - { lparam=*AnsiChar text } - { result=*AnsiChar rtfstream } - { !!! the result-buffer must be deleted with MTH_FREE_RTF_BITMAPTEXT } - - MTH_FREE_RTF_BITMAPTEXT = 'Math/FreeRTFBitmapText'; - { deletes the buffer that MTH_GET_RTF_BITMAPTEXT has created. } - { wparam=0 } - { lparam=(*AnsiChar) buffer } - { result=0 } - - { ************************************************************** } - { The following is still SRMM - specific. } - { I plan to modify it, so that other PlugIns can take advantage of e.g. preview-window.... } -const - MTH_SHOW = 'Math/Show'; - { shows the preview-window } - { wparam=0 } - { lparam=0 } - { result=0 } - - MTH_HIDE = 'Math/Hide'; - { hides the preview-window } - { wparam=0 } - { lparam=0 } - { result=0 } - - MTH_RESIZE = 'Math/Resize'; - { sets the size of the preview-window } - { wparam=0 } - { lparam=(*TMathWindowInfo) } - { result=0 } -type - PTMathWindowInfo = ^TTMathWindowInfo; - TTMathWindowInfo = record - top : int; - left : int; - right : int; - bottom: int; - end; - -const - MTH_SETFORMULA = 'Math/SetFormula'; - { sets the text that the preview-window should parse to display formulas found inside } - { wparam=0 } - { lparam=(*AnsiChar) text } - { result=0 } - - MTH_Set_ToolboxEditHwnd = 'Math/SetTBhwnd'; - { If this hwnd (of an edit-box) is set, MathModule can insert Formula-elements from the Math-Toolbox. } - { wparam=0 } - { lparam=handle } - {übergibt fenster-Handle des aktuellen Message-Dialogs } - - MTH_Set_Srmm_HWND = 'Math/SetSrmmHWND'; - { If MathModule knows the handle of a SRMM-based window, following features exist: } - { - preview window resizes Math-Srmm when it is being resized. } - { wparam=0 } - { lparam=handle } - { result=0 } - { todo: umbenennen in MTH_Set_ResizeWindowHandle, zusaetzlich MTH_Set_ToolboxEditHandle erstellen, dann keine SRMM-Abhaengigkeit mehr. } - { damit ResizeWindows selbst entscheiden koennen, was sie tun, kann man auch ein miranda-event "MTH_preview_resized" einrichten. } - - MTH_GET_PREVIEW_HEIGHT = 'Math/getPreviewHeight'; - { returns the height of the whole preview-window (including system-menu-bar) } - { consider this when maximizing a window to that preview-window is hooked on top or bottom } - { it returns the height no matter whether preview-window is visible or not } - { wparam=0 } - { lparam=0 } - { result=(int) height } - - MTH_GET_PREVIEW_SHOWN = 'Math/getPreviewShown'; - { returns 1 if preview window is visible } - { returns 0 if preview window is invisible } - { result=(int) shown } - - MTH_SUBSTITUTE_DELIMITER = 'Math/SubstituteDelimiter'; - { replaces Substitute given lparam-structure with internal Math-Delimiter } - { wparam=0 } - { lparam=(TMathSubstInfo) substInfo } - { result=0 } - -type - PTMathSubstInfo = ^TTMathSubstInfo; - TTMathSubstInfo = record - EditHandle : HWND; - Substitute : PAnsiChar; - end; -{--------------------------------------------------- } -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_motd.inc b/plugins/ExternalAPI/delphi/m_motd.inc deleted file mode 100644 index 3b986bf02e..0000000000 --- a/plugins/ExternalAPI/delphi/m_motd.inc +++ /dev/null @@ -1,75 +0,0 @@ -{ -Copyright (C) 2005 Ricardo Pescuma Domenecci - -This is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this file; see the file license.txt. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. -} - -{$IFNDEF M_MOTD} -{$DEFINE M_MOTD} - -//=== SERVICES === - -{ -MOTD/GetMessage service -Get a MOTD - -wparam = (MOTDMessage*)lpMOTDMessage -lparam = 0 -returns: 0 on success, -1 on failure. On success, lpMOTDMessage is filled with the MOTD -} -type - PMOTDMessage = ^TMOTDMessage; - TMOTDMessage = record - cbSize :int; // sizeof(MOTDMessage) - pszMessage :PAnsiChar; // Buffer to store message - cbMessageSize:dword; // Size of message buffer (including '\0') - pszAuthor :PAnsiChar; // Buffer to store author - cbAuthorSize :dword; // Size of author buffer (including '\0') - end; -const - MS_MOTD_GETMESSAGE = 'MOTD/GetMessage'; - -{ -MOTD/AddMessage service -Add a message to the MOTD list - -wparam = (MOTDMessage*)lpMOTDMessage -lparam = 0 -returns: 0 on success, -1 on failure -} - MS_MOTD_ADDMESSAGE = 'MOTD/AddMessage'; - -{ -MOTD/ShowMessage service -Show a popup with a MOTD - -wparam = 0 -lparam = 0 -returns: 0 -} - MS_MOTD_SHOWMESSAGE ='MOTD/ShowMessage'; - -{ -MOTD/ShowAddMessage service -Show a dialog to add a MOTD - -wparam = 0 -lparam = 0 -returns: 0 -} - MS_MOTD_SHOWADDMESSAGE = 'MOTD/ShowAddMessage'; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_nickhistory.inc b/plugins/ExternalAPI/delphi/m_nickhistory.inc deleted file mode 100644 index 240fc73b29..0000000000 --- a/plugins/ExternalAPI/delphi/m_nickhistory.inc +++ /dev/null @@ -1,50 +0,0 @@ -{ -Copyright (C) 2006 Ricardo Pescuma Domenecci - -This is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this file; see the file license.txt. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. -} - -{$IFNDEF M_NICKHISTORY} -{$DEFINE M_NICKHISTORY} - -const - EVENTTYPE_NICKNAME_CHANGE = 9001; - -{ -Return TRUE is Nick History is enabled for this contact - -wParam: hContact -lParam: ignored -} - MS_NICKHISTORY_ENABLED = 'NickHistory/Enabled'; - -{ -Enable Nick History for a contact - -wParam: hContact -lParam: ignored -} - MS_NICKHISTORY_ENABLE = 'NickHistory/Enable'; - -{ -Disable Nick History for a contact - -wParam: hContact -lParam: ignored -} - MS_NICKHISTORY_DISABLE = 'NickHistory/Disable'; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_simpleaway.inc b/plugins/ExternalAPI/delphi/m_simpleaway.inc deleted file mode 100644 index 16bf2328fb..0000000000 --- a/plugins/ExternalAPI/delphi/m_simpleaway.inc +++ /dev/null @@ -1,26 +0,0 @@ -{$IFNDEF M_SIMPLEAWAY} -{$DEFINE M_SIMPLEAWAY} - -const -// lParam = (AnsiChar *)status message -// wParam = new status, from statusmodes.h - MS_SA_SETSTATUSMODE = 'SimpleAway/SetStatusMode'; - MS_AWAYSYS_SETSTATUSMODE = MS_SA_SETSTATUSMODE //for compatibility with some plugins - -//Internal use only - MS_SA_TTCHANGESTATUSMSG = 'SimpleAway/TTChangeStatusMessage'; - -//wParam=new status, from statusmodes.h -//lParam=protocol name, NULL if for all protocols (added in v0.3.1alpha) - MS_SA_CHANGESTATUSMSG = 'SimpleAway/ChangeStatusMessage' - -// wParam = 0 -// lParam = 0 -// allways returns 1 - MS_SA_ISSARUNNING = 'SimpleAway/IsSARunning'; - -// wParam = 0 -// lParam = 0 - MS_SA_COPYAWAYMSG = 'SimpleAway/CopyAwayMsg'; - -{$ENDIF} \ No newline at end of file diff --git a/plugins/ExternalAPI/delphi/m_smh.inc b/plugins/ExternalAPI/delphi/m_smh.inc deleted file mode 100644 index 134b2075e8..0000000000 --- a/plugins/ExternalAPI/delphi/m_smh.inc +++ /dev/null @@ -1,50 +0,0 @@ -{ -Copyright (C) 2006 Ricardo Pescuma Domenecci - -This is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this file; see the file license.txt. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. -} - -{$IFNDEF M_SMH} -{$DEFINE M_SMH} - -const - EVENTTYPE_STATUSMESSAGE_CHANGE = 9002; - -{ -Return TRUE is Status Message History is enabled for this contact - -wParam: hContact -lParam: ignored -} - MS_SMH_ENABLED = 'SMH/Enabled'; - -{ -Enable Status Message History for a contact - -wParam: hContact -lParam: ignored -} - MS_SMH_ENABLE = 'SMH/Enable'; - -{ -Disable Status Message History for a contact - -wParam: hContact -lParam: ignored -} - MS_SMH_DISABLE = 'SMH/Disable'; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_smr.inc b/plugins/ExternalAPI/delphi/m_smr.inc deleted file mode 100644 index d8feacfc6a..0000000000 --- a/plugins/ExternalAPI/delphi/m_smr.inc +++ /dev/null @@ -1,59 +0,0 @@ -{ -Copyright (C) 2005 Ricardo Pescuma Domenecci - -This is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this file; see the file license.txt. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. -} - -{$IFNDEF M_SMR} -{$DEFINE M_SMR} - -const -{ -Return TRUE is smr is enabled for this protocol -If is enabled, status message is kept under CList\StatusMsg db key in user data - -wParam: protocol name -lParam: ignored -} - MS_SMR_ENABLED_FOR_PROTOCOL = 'SMR/MsgRetrievalEnabledForProtocol'; - -{ -Return TRUE is smr is enabled for this contact and its protocol (smr can be -disabled per user, if protocol is enabled) -If is enabled, status message is kept under CList\StatusMsg db key in user data - -wParam: hContact -lParam: ignored -} - MS_SMR_ENABLED_FOR_CONTACT = 'SMR/MsgRetrievalEnabledForUser'; - -{ -Enable status message retrieval for a contact - -wParam: hContact -lParam: ignored -} - MS_SMR_ENABLE_CONTACT = 'SMR/EnableContactMsgRetrieval'; - -{ -Disable status message retrieval for a contact - -wParam: hContact -lParam: ignored -} - MS_SMR_DISABLE_CONTACT = 'SMR/DisableContactMsgRetrieval'; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_snapping_windows.inc b/plugins/ExternalAPI/delphi/m_snapping_windows.inc deleted file mode 100644 index e3c513482a..0000000000 --- a/plugins/ExternalAPI/delphi/m_snapping_windows.inc +++ /dev/null @@ -1,35 +0,0 @@ -{$IFNDEF SNAPPING_WINDOWS} -{$DEFINE SNAPPING_WINDOWS} - -type - PSnapWindowProc = ^TSnapWindowProc; - TSnapWindowProc = record - hWnd : THWND; - m_szMoveOffset : TSIZE; - wParam : WPARAM; - lParam : LPARAM; - Reserved1 : int; - Reserved2 : int; - Reserved3 : int; - end; - -const - MS_SNAPWINDOWPROC = 'Utils/SnapWindowProc'; - -function CallSnappingWindowProc(hwnd:hwnd; nMessage:int; - wParam:WPARAM;lParam:LPARAM):int;// cdecl; -const - SnapInfo:TSnapWindowProc=(); -begin - result:=0; - if (nMessage=WM_MOVING) or (nMessage=WM_NCLBUTTONDOWN) or - (nMessage=WM_SYSCOMMAND) or (nMessage=WM_SIZING) then - begin - SnapInfo.hWnd := hwnd; - SnapInfo.wParam := wParam; - SnapInfo.lParam := lParam; - CallService(MS_SNAPWINDOWPROC,WPARAM(@SnapInfo),nMessage); - if nMessage=WM_SIZING then result:=1; - end; -end; -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_spamfilter.inc b/plugins/ExternalAPI/delphi/m_spamfilter.inc deleted file mode 100644 index 54c4729a81..0000000000 --- a/plugins/ExternalAPI/delphi/m_spamfilter.inc +++ /dev/null @@ -1,751 +0,0 @@ -{ -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright © 2003-2004 Heiko Herkenrath - -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. -} - -{$IFNDEF M_SPAMFILTER} -{$DEFINE M_SPAMFILTER} - -const -// Spam Filter Version: 2.5.2.1 -// See "spamcheck.c" in the sources for an example on how to use the spam checking services. - -// The functionality and the API of Spam Filter is quite complex -// and not easy to describe or explain. -// If you have any question or extension whishes please send me an e-mail: -// hrathh at users.sourceforge.net - -// Notes: -// * All services are fully thread-safe, you can call everything from any thread -// (If there are problems with it it is a bug :-) ) -// * Unicode parameters can also be passed to the ANSI version of the plugin -// and the other way round. The strings get converted as they are needed -// using automatic two-way translation. -// Unicode support was added in v2.5.0.0. - -// ------------------------------------------- -// -- Getting handles ------------------------ -// ------------------------------------------- - - MS_SPAMFILTER_GETHANDLE = 'SpamFilter/GetHandle'; - -// Description: -// ------------- -// Gets a specified icon/window handle. - -// Parameters: -// ------------- -// wParam = (uint)uHandleType (see below); -// lParam = 0 - -// Possible values for wParam: - SFHT_HWND_PLUGIN_OPTIONS = 2; // HWND of the "Spam Filter" options dialog (if it is loaded; else NULL) - SFHT_HICON_SPAM = 3; // HICON of the spam icon (small): needs to be destroyed! (DestroyIcon()) - // Added in v2.0.2.0: - SFHT_HICON_SPAM_LARGE = 4; // HICON of the spam icon (large): needs to be destroyed! (DestroyIcon()) - SFHT_HICON_SPAM_LAYER = 5; // HICON of the spam layer icon (small): needs to be destroyed! (DestroyIcon()) - // Icons are taken directly from resources, not skinned by user - // Added in v2.0.3.0: - SFHT_HWND_ADVERTISMENT_FILTER = 6; // HWND of the "Advertisment Filter" settings dialog (if it is opened; else NULL) - SFHT_HWND_ROBOT_FILTER = 7; // HWND of the "Robot Filter" settings dialog (if it is opened; else NULL) - SFHT_HWND_DISLIKEDMESSAGES_FILTER = 8; // HWND of the "Disliked Messages Filter" settings dialog (if it is opened; else NULL) - // Added in v2.5.0.0: - SFHT_HWND_SPAMDEFINITIONS_INFO = 9; // HWND of the "Spam Definitions" info dialog (if it is opened; else NULL) - SFHT_HWND_SPAMMERS_INFO = 10; // HWND of the Spammers info dialog (if it is opened; else NULL) - - SFHT_BOOL_IS_UNICODE = 100; // No handle, returns TRUE if Spam Filter is installed as Unicode version, FALSE otherwise - // (You probably never need to call this since Spam Filter performs automatic two-way translation - // when a service is called) - -// Note: Icons are taken directly from resources, they are not skinned by user. - - -// Return Values: -// -------------- -// Returns the specified handle value: HINSTANCE, HWND, ICON -// -// Note: -// If a handle is not available (or if it was removed) the function will -// return NULL. -// When you are using this service you need to check always for the -// NULL return value. - -// ------------------------------------------- -// -- Activating/Deactivating the filters ---- -// ------------------------------------------- - - MS_SPAMFILTER_CHANGEFILTERACTIVATION = 'SpamFilter/ChangeFilterActivation'; - -// Description: -// ------------- -// Provides the possibility to enable or disable the spam filters. -// Also updates the checkboxes in the spam filter options if the option dialog is opened. - -// Parameters: -// ------------- -// wParam = (uint)uFilterType (For possible values see below) -// lParam = (bool)bNewState (new activation state of filter) - -// Possible filter type values (uFilterType): - SFT_ADVERTISMENT_FILTER = 1; - SFT_DISLIKEDMESSAGES_FILTER = 2; - SFT_ROBOT_FILTER = 3; - -// Return Values: -// -------------- -// Returns 0 on success, nonzero on error. - - -// ------------------------------------------- -// -- Showing configure dialogs -------------- -// ------------------------------------------- - - MS_SPAMFILTER_SHOWFILTERDIALOG = 'SpamFilter/ShowFilterDialog'; - -// Description: -// ------------- -// Shows the configure dialog of the specified filter. - -// Parameters: -// ------------- -// wParam = (HWND)hwndParent (Can be NULL) -// lParam = (uint)uFilterType (For possible values see above) -// -> since 2.0.2.0: If this is zero then the options dialog will be opened pointing to the Spam Filter options. -// Note: -// If hwndParent is not NULL the function will not return -// until the configure dialog is closed. -// If hwndParent is NULL the Miranda window will be used as parent - -// Since 2.0.2.0: - SFTEX_OPTIONS_PAGE = 0; - -// Since 2.5.0.0: -// Combine the following flag with the lParam/uFilterType parameter -// to show the corresponding Spam Definitions info dialog instead -// of the settings dialog: - SFTEXF_SPAMDEFINITIONS_INFO = $2000; -// Note: SFTEXF_SPAMDEFINITIONS_INFO can't be combined with SFT_ROBOT_FILTER - -// Combine the following flag with the lParam/uFilterType of 0 parameter -// to show the Spammers dialog instead of the settings dialog: - SFTEXF_SPAMMERS_INFO = $4000; -// Note: SFTEXF_SPAMMERS_INFO can't be combined with SFT_* - - - -// Return Values: -// -------------- -// Returns 0 on success, nonzero on error. - -// Since v2.0.3.0: -// If the specified settings window is already opened it will be -// brought to front (reactivated) instead (returns success though). -// This might be changed however in the future. - -// Changed behaviour in v2.0.3.0: -// If hwndParent was not set then the function returned the handle to the new window. -// Now the function returns 0 to indicate success instead. - - -// ------------------------------------------- -// -- Adding message types ------------------- -// ------------------------------------------- - - MS_SPAMFILTER_REGISTERMESSAGETYPE = 'SpamFilter/MessageTypes/Register'; - -// Description: -// ------------- -// Adds a new message type which can be checked for spam. -// Associated event: ME_SPAMFILTER_PREREGISTERMESSAGETYPE - -// Parameters: -// ------------- -// wParam = 0 -// lParam = (MESSAGETYPEDESC*)mtd (see below) - -// Return Values: -// -------------- -// Returns 0 on success, nonzero on error. - - -// Already registered message types are: -// (With pszSection set to the installed network protocol names, e.g. "ICQ") - SFMT_AUTHREQUEST = 'Auth'; - SFMT_ADDED = 'Added'; // since v2.1.0.0 - SFMT_MESSAGE = 'Msg'; - SFMT_URL = 'URL'; - SFMT_FILE = 'File'; - SFMT_CONTACTS = 'Contacts'; - - -// MESSAGETYPEDESC structure: -type - PMESSAGETYPEDESC = ^TMESSAGETYPEDESC; - TMESSAGETYPEDESC = record - cbSize :integer; // Set to sizeof(MESSAGETYPEDESC) - pszSection :PAnsiChar; // Section of message name for database - // e.g. protocol name (Can not be NULL) - SectionDescription:TChar; // Readable name of section e.g. protocol name (can be NULL) - // Ignored if section existed previously - hSectionIcon :THANDLE; // Icon to show for section e.g. protocol icon (can be NULL) - // Ignored if section existed previously - pszName :PAnsiChar; // Name to refer to message type when spam - // checking and in db (Can not be NULL) - Description :TChar; // Description for options dialog (can be NULL) - hIcon :THANDLE; // EITHER: icon handle representing the message - // type OR: one of mirandas skin constants with - // a negative sign, e.g (HICON)-SKINICON_EVENT_MESSAGE, - // same as for LoadSkinnedIcon() -> can be 0 - // and can also be a normal icon handle (HICON) - bDefaultStatus :bool; // Whether checking for this type should be - // activated or not by default - dwFlags :dword; // Flags for the message type (for possible flags see below) - iSectionPosition :integer; // Approx position number for the section in the - // options list, lower numbers are nearer to the - // top (Can be 0 to be sorted alphabetically) - // Ignored if section existed previously (or - // if pszSection is NULL) Added in v2.1.1.0 - iPosition :integer; // Approx position number for the item in the - // options list, lower numbers are nearer to the - // top (Can be 0 to be sorted alphabetically) - // Added in v2.1.1.0 - end; - -const - -// Possible MESSAGETYPEDESC flags: - MTDF_DEFAULTDISABLED = $00000001; // Is disabled by default - MTDF_HIDDEN = $00000002; // Does not get shown on the options page -// Since v2.5.0.0 - MTDF_UNICODE = $00000004; // pszSectionDescription and pszDescription are Unicode strings - - -// ------------------------------------------- -// -- Modify new added message type (Event) -- -// ------------------------------------------- - - ME_SPAMFILTER_PREREGISTERMESSAGETYPE = 'SpamFilter/MessageTypes/PreRegister'; - -// Description: -// ------------- -// Gets fired before a new message type is added to be checked for spam. -// -// This is meant for asking other plugins if the specified default data is ok. -// Other plugins (especially protocols) can disable a message type if either sending spam -// is not possible for those protocols or if spam checking would cause unwanted side-effects. - -// Warning: Most elements of the MESSAGETYPEDESC structure can also be NULL. -// However, the structure was checked for errors before this events gets called. - -// Parameters: -// ----------------- -// wParam = 0 (same wParam as used for MS_SPAMFILTER_REGISTERMESSAGETYPE) -// lParam = (MESSAGETYPEDESC*)mtd (see above, contents can be modified) - -// Return Values: -// ----------------- -// Returning 0 on this event will accept the message type to be added. -// Returning 1 will prevent the the message type to be added. - -// Note: Works as it does now since v2.1.1.0 - - -// ------------------------------------------- -// -- Uninstalling a message type ------------ -// ------------------------------------------- - - MS_SPAMFILTER_REMOVEMESSAGETYPE = 'SpamFilter/RemoveMessageType'; - -// Description: -// ------------- -// Uninstalls a specifed message type. It removes the database setting related to the given message type. -// Should only be used for uninstalling purposes (e.g in uninstall function of PluginUninstaller) - -// Parameters: -// ------------- -// wParam = (AnsiChar*)pszMsgTypeName (Message type name; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before) -// lParam = (AnsiChar*)pszMsgTypeSection (The section of the message type string; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before) - -// Return Values: -// -------------- -// Returns 0 on success, nonzero on error.. - - -// ------------------------------------------- -// -- Message type activation ---------------- -// ------------------------------------------- - - MS_SPAMFILTER_ISMESSAGETYPEACTIVATED = 'SpamFilter/MessageTypes/IsActivated'; - -// Description: -// ------------- -// Returns if a specified message type is activated or not. - -// Parameters: -// ------------- -// wParam = (AnsiChar*)pszMsgTypeName (Message type name; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before) -// lParam = (AnsiChar*)pszMsgTypeSection (The section of the message type string; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before) - -// Return Values: -// -------------- -// Returns TRUE if the message type is activated and FALSE otherwise. - - -// ------------------------------------------- -// -- Reset AutoIgnore counters -------------- -// ------------------------------------------- - - MS_SPAMFILTER_RESETAUTOIGNORE = 'SpamFilter/AutoIgnore/Reset'; - -// Description: -// ------------- -// Resets the list in which the total number of spam sent by -// each user is kept. -// The list is necessary to determine when a particular user reached the -// allowed spam messages limit. - -// Parameters: -// ------------- -// wParam = (bool)bOnlyCount (if TRUE the service will only return the user count without doing reset) -// lParam = 0 - -// Return Values: -// -------------- -// Returns 0 on success, nonzero on error. - - -// ----------------------------------------- -// -- Spam Checking ------------------------ -// ----------------------------------------- - - MS_SPAMFILTER_ADVERTISMENTCHECK = 'SpamFilter/AdvertismentCheck'; - MS_SPAMFILTER_DISLIKEDMESSAGESCHECK = 'SpamFilter/DislikedMessagesCheck'; - MS_SPAMFILTER_ROBOTCHECK = 'SpamFilter/RobotCheck'; - -// Description: -// ------------- -// These services provide the possibility to check a specified text for contained spam. -// The function checks for everything that is activated in the plugin's options. - -// Note: These functions work as they do now since v2.1.0.0 - -// Parameters: -// ------------- -// wParam = (SPAMCHECKDATA*)scd -// lParam = 0 - -// SPAMCHECKDATA structure: -type - PSPAMCHECKDATA = ^TSPAMCHECKDATA; - TSPAMCHECKDATA = record - cbSize :integer; // sizeof(SPAMCHECKDATA) - pszMsgTypeSection:PAnsiChar; // The section of the message type string: You need - // to use MS_SPAMFILTER_REGISTERMESSAGETYPE before - pszMsgTypeName :PAnsiChar; // Description of the message: You need to use - // MS_SPAMFILTER_REGISTERMESSAGETYPE before - MsgText :TChar; // Pointer to the text of a message which is - // checked for spam. Can be NULL. - dwFlags :dword; // Flags for the spam checking. (For more details see below.) - case LongInt of - 0: (hContact: TMCONTACT); // Handle to the sending contact (use pszUserName - // instead if no hContact is available) - 1: (UserName: TChar); // Name of the user, e.g. nick (set SCDF_NO_CONTACT - // in the flags to use this parameter) -> should - // be as unique as possible - end; - -const -// Possible flags in the SPAMCHECKDATA structure: - SCDF_NO_NOTIFY = $00000001; // Don't show a popup, play sound or log to file if the message is spam. - SCDF_NO_CANCEL = $00000002; // Do check even if user pressed control key to avoid the spam check manually - SCDF_NO_AUTOIGNORE = $00000004; // Do not use the AutoIgnore feature for this check - SCDF_NO_CONTACT = $00000008; // Use pszUserName instead of hContact of union -// Since v2.5.0.0: - SCDF_UNICODE = $00000010; // Specify this flag if associated message text and/or user name is Unicode - - -// Return Values: -// -------------- -// Possible return flags: - SFF_MARKREAD = $00000010; // Flag - SFF_DELETE = $00000020; // Flag - SFF_IGNORE = $00000040; // Flag - SFF_SENDMSG_NOTIFY = $00000100; // Flag, Only MS_SPAMFILTER_DISLIKEDMESSAGESCHECK - SFF_SENDMSG_INSTRUCTION = $00000200; // Flag, Only MS_SPAMFILTER_ROBOTCHECK - SFF_SENDMSG_CONFIRMATION = $00000400; // Flag, Only MS_SPAMFILTER_ROBOTCHECK - SFF_TESTPASSED = $00000080; // Flag, Only MS_SPAMFILTER_ROBOTCHECK - SFF_ISSPAM = $00000002; // Flag - SFF_ISNORMAL = $00000001; // Flag -// Since 2.5.2.0: - SFF_HIDE = $00001000; // Flag, Only MS_SPAMFILTER_ROBOTCHECK - -// ------------------------------------------- -// -- Getting additional Check Info ---------- -// ------------------------------------------- - - MS_SPAMFILTER_GETSPAMCHECKINFO = 'SpamFilter/GetSpamCheckInfo'; - -// Description: -// ------------- -// Gets data needed for the processing of spam mesages. - -// Parameters: -// ------------- -// wParam = (dword)dwDataType (For possible values see below) -// lParam = depends on wParam (see below) - -// Possible values for lParam: - -// TRUE/FALSE: if the specified filter is enabled - SFSCI_ACTIVATION_FILTER = 1; // lParam = uFilterType (For possible values see above) - -// Strings: Get the message texts specified by the user -// ANSI - SFSCI_MSGTEXT_NOTIFYA = 2; // lParam = (SPAMCHECKDATA*)scd, scd->hContact (or scd->pszUserName) and scd->pszMsgText (and scd->cbSize) should be filled in. - SFSCI_MSGTEXT_INSTRUCTIONA = 3; // lParam: see SFSCI_MSGTEXT_NOTIFYA - SFSCI_MSGTEXT_CONFIRMATIONA = 4; // lParam: see SFSCI_MSGTEXT_NOTIFYA - -// Unicode (since v2.5.0.0) - SFSCI_MSGTEXT_NOTIFYW = 6; // lParam = (SPAMCHECKDATA*)scd, scd->hContact (or scd->pwszUserName) and scd->pwszMsgText (and scd->cbSize) should be filled in. - SFSCI_MSGTEXT_INSTRUCTIONW = 7; // lParam: see SFSCI_MSGTEXT_NOTIFYW - SFSCI_MSGTEXT_CONFIRMATIONW = 8; // lParam: see SFSCI_MSGTEXT_NOTIFYW - -// TRUE/FALSE: if the above message text should be added to history. - SFSCI_ADD_TO_HISTORY = 5; // lParam = SFSCI_MSGTEXT_NOTIFY(A/W), SFSCI_MSGTEXT_INSTRUCTION(A/W) or SFSCI_MSGTEXT_CONFIRMATION(A/W) - -// Since 2.5.2.0: -// Counts of milliseconds to delay the above message texts sending. - SFSCI_DELAY_TIME_REPLY = 9; // lParam=0 - - -// Return Values: -// -------------- -// SFSCI_ACTIVATION_FILTER -> (bool)TRUE/FALSE -// SFSCI_DELAY_TIME_REPLY -> (bool)TRUE/FALSE - -// SFSCI_MSGTEXT_NOTIFYA -> (AnsiChar*) free with miranda_sys_free() of "m_system.h", (all %vars% in the text are already resolved) -// SFSCI_MSGTEXT_INSTRUCTIONA -> see SFSCI_MSGTEXT_NOTIFYA -// SFSCI_MSGTEXT_CONFIRMATIONA -> see SFSCI_MSGTEXT_NOTIFYA - -// SFSCI_MSGTEXT_NOTIFYW -> (WCHAR*) free with miranda_sys_free() of "m_system.h", (all %vars% in the text are already resolved) -// SFSCI_MSGTEXT_INSTRUCTIONW -> see SFSCI_MSGTEXT_NOTIFYW -// SFSCI_MSGTEXT_CONFIRMATIONW -> see SFSCI_MSGTEXT_NOTIFYW - -// SFSCI_ADD_TO_HISTORY -> (bool)TRUE/FALSE - -// returns NULL on error - - -// ------------------------------------------- -// -- Confirm spam check (Event) ------------- -// ------------------------------------------- - - ME_SPAMFILTER_OKTOSPAMCHECK = 'SpamFilter/OkToSpamCheck'; - -// Description: -// ------------- -// Gets fired before the spam check for a message starts. - -// Parameters: -// ----------------- -// wParam = (SPAMCHECKDATA*)scd (Pointer to SPAMCHECKDATA struct) -// lParam = (uint)uFilterType (For possible values see above) - -// Return Values: -// ----------------- -// Returning 0 on this event will accept spam checking for the message, -// Returning 1 will prevent the spam check. - - -// ------------------------------------------- -// -- Confirm spam detection (Event) --------- -// ------------------------------------------- - - ME_SPAMFILTER_OKTOSPAMDETECTION = 'SpamFilter/OkToSpamDetection'; - -// Description: -// ------------- -// Gets fired after a spam message is detected. - -// Parameters: -// ----------------- -// wParam = (SPAMCHECKDATA*)scd (Pointer to SPAMCHECKDATA struct) -// lParam = (uint)uFilterType (For possible values see above) - -// Return Values: -// ----------------- -// Returning 0 on this event will accept the spam detection -// Returning 1 cause the message not to be seen as spam. - -// Note: If you only would like to get the final result hook -// ME_SPAMFILTER_SPAMRECEIVED instead - - -// ------------------------------------------- -// -- Spam message received (Event) ---------- -// ------------------------------------------- - - ME_SPAMFILTER_SPAMRECEIVED = 'SpamFilter/SpamReceived'; - -// Description: -// ------------- -// Gets fired when a message if recognized as spam. - -// Parameters: -// ----------------- -// wParam = (SPAMCHECKDATA*)scd (Pointer to SPAMCHECKDATA struct) -// lParam = (uint)uFilterType (For possible values see above) - -// Return Values: -// ----------------- -// The return value should be 0. - - -// ------------------------------------------- -// -- Spam Filter loaded (Event) ------------- -// ------------------------------------------- - - ME_SPAMFILTER_MODULELOADED = 'SpamFilter/ModuleLoaded'; - -// Description: -// ------------- -// Gets fired when a all parts of the "Spam Filter" were loaded and available -// to other plugins. -// Past this event all functionality of the plugin is fully available. -// The event works quite similar as ME_SYSTEM_MODULESLOADED. -// You can use ME_SYSTEM_MODULESLOADED in most cases instead. Please do so! - -// Parameters: -// ----------------- -// wParam = 0 -// lParam = 0 - -// Return Values: -// ----------------- -// The return value should be 0. - - - -// ------------------------------------------- -// -- Helper: Duplicate SPAMCHECKDATA -------- -// ------------------------------------------- - - MS_SPAMFILTER_COPYSPAMCHECKDATA = 'SpamFilter/SpamCheckData/Copy'; - -// Description: -// ------------- -// Copys all contents of a SPAMCHECKDATA struct (especially strings) to another one -// using Miranda's Memory Manager Interface (see m_system.h). -// Use MS_SPAMFILTER_FREESPAMCHECKDATA to free the result when no longer needed. - -// Available since 2.5.2.0. - -// Parameters: -// ------------- -// wParam = (SPAMCHECKDATA*)pscdTo -// lParam = (SPAMCHECKDATA*)pscdFrom - -// Return Values: -// -------------- -// Returns 0 on success, nonzero on error. - - - -// ------------------------------------------- -// -- Helper: Free SPAMCHECKDATA ------------- -// ------------------------------------------- - - MS_SPAMFILTER_FREESPAMCHECKDATA = 'SpamFilter/SpamCheckData/Free'; - -// Description: -// ------------- -// Frees the memory allocated by MS_SPAMFILTER_COPYSPAMCHECKDATA. -// using Miranda's Memory Manager Interface (see m_system.h). - -// Available since 2.5.2.0. - -// Parameters: -// ------------- -// wParam = (SPAMCHECKDATA*)pscd -// lParam = 0 - -// Return Values: -// -------------- -// Returns 0 on success, nonzero on failure. - - - -// ------------------------------------------- -// -- Showing error messages ----------------- -// ------------------------------------------- - - MS_SPAMFILTER_SHOWERROR = 'SpamFilter/ShowError'; - -// Description: -// ------------- -// Shows a Miranda try balloon tip, popup or message box -// with the specified error message. - -// Parameters: -// ------------- -// wParam = (uint)uErrorType (For possible values see below) -// lParam = 0 - -// Possible values for wParam: - SFSE_CRITICAL_ERROR = 1; // Unspecified critical error occured related to spam checking. - // Only use this for situations that may never ever occur. - // Please do avoid this if possible. - - SFSE_SEND_FAILED = 2; // Show this error when a sending of SFSCI_MSGTEXT_NOTIFY, - // SFSCI_MSGTEXT_INSTRUCTION, or SFSCI_MSGTEXT_CONFIRMATION failed - -// Return Values: -// -------------- -// Returns 0 on success, nonzero on error. - - - -// ------------------------------------------- -// -- Set contact as spammer (Contact) ------- -// ------------------------------------------- - - MS_SPAMFILTER_CONTACT_SETASSPAMMER = 'SpamFilter/Contact/SetAsSpammer'; - -// Description: -// ------------- -// This service adds a specified user to the spammer list (fully ignored). - -// Note: works same as MS_SPAMFILTER_CONTACT_SHOWSETASSPAMMERDIALOG -// but does not prompt the user. - -// Available since v2.5.0.0 - -// Parameters: -// ------------- -// wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.) -// lParam = (dword)dwFlags (flags about what should be done, see below) - -// Available Flags: - SCASF_NO_NOTIFY = $00000001; // Prevents logging and playing of sounds - SCASF_USE_ROBOT_SOUND = $00000002; // play robot sound instead of advertisment sound (only if SCASF_NO_NOTIFY is not set) - SCASF_NO_REMOVE_HISTORY = $00000004; // history is marked read instead of fully removed - SCASF_NO_DENY_AUTHREQUESTS = $00000008; // do not deny pending auth requests - -// Return Values: -// -------------- -// Returns 0 on success, nonzero on error. - - -// ------------------------------------------- -// -- Show mark spammer dialog (Contact) ----- -// ------------------------------------------- - - MS_SPAMFILTER_CONTACT_SHOWSETASSPAMMERDIALOG = 'SpamFilter/Contact/ShowSetAsSpammerDialog'; - -// Description: -// ------------- -// This service adds a specified user to the spammer list. -// Before it shows a dialog to let the user confirm the action. -// For use for example as action for a button on the message dialog. - -// Note: This service performs the same tasks as MS_SPAMFILTER_SETCONTACTASSPAMMER -// to execute the action the user chooses. - -// Available since v2.5.0.0 - -// Parameters: -// ------------- -// wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.) -// lParam = (HWND)hwndParent (Handle to the parent window. Can be NULL.) - -// Return Values: -// -------------- -// Returns FALSE if user clicked cancel on the dialog. -// TRUE if the contact was handled as spammer. - - -// Changed in v2.5.0.0: -// The service MS_SPAMFILTER_SETSPAMMANUALLY has been deprecated. -// New plugins should use MS_SPAMFILTER_CONTACT_SHOWSETASSPAMMERDIALOG instead. - MS_SPAMFILTER_SETSPAMMANUALLY = 'SpamFilter/SetSpamManually'; - - -// ------------------------------------------- -// -- Test if contact is spammer (Contact) --- -// ------------------------------------------- - - MS_SPAMFILTER_CONTACT_ISSPAMMER = 'SpamFilter/Contact/IsSpammer'; - -// Description: -// ------------- -// This service tests if a specified contact is on the spammer list (fully ignored). - -// Available since v2.5.0.0 - -// Parameters: -// ------------- -// wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.) -// lParam = 0 - -// Return Values: -// -------------- -// Returns TRUE when the contact is on the spammer list, FALSE otherwise. - - -// ------------------------------------------- -// -- Unmarks a contact as spammer (Contact) - -// ------------------------------------------- - - MS_SPAMFILTER_CONTACT_UNSETSPAMMER = 'SpamFilter/Contact/UnSetSpammer'; - -// Description: -// ------------- -// This service restores a spammer to be again a normal contact (unignored). - -// Available since v2.5.0.0 - -// Parameters: -// ------------- -// wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.) -// lParam = 0 - -// Return Values: -// -------------- -// Returns 0 on success, nonzero on error. - - -// ------------------------------------------- -// -- Spammer state changed (Event) ---------- -// ------------------------------------------- - - ME_SPAMFILTER_CONTACT_SPAMMERSTATECHANGED = 'SpamFilter/Contact/SpammerStateChanged'; - -// Description: -// ------------- -// Gets fired when a a contact gets marked as spammer or unmarked. - -// Parameters: -// ----------------- -// wParam = (HANDLE)hContact -// lParam = (bool)bIsSpammer (new state) - -// Return Values: -// ----------------- -// The return value should be 0. - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_speak.inc b/plugins/ExternalAPI/delphi/m_speak.inc deleted file mode 100644 index 7badc4e0a4..0000000000 --- a/plugins/ExternalAPI/delphi/m_speak.inc +++ /dev/null @@ -1,267 +0,0 @@ -{ -Copyright (C) 2007 Ricardo Pescuma Domenecci - -This is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this file; see the file license.txt. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. -} - -{$IFNDEF M_SPEAK} -{$DEFINE M_SPEAK} - -(* -There is 2 ways of using the speak plugin: - -1. Older and simple way: just call - Speak_Say(hContact, _T("text to speak")) -and the text will be spoken using contact settings. If hContact is NULL, it will use -system settings. -Previous versions only had an ascii version, so if you want to support then you need -to call - Speak_SayA(hContact, "text to speak") - - -2. Integrating with meSpeak GUI: for that you have first to register a speak type and -then call the speak functions. In both case you have 2 options: - -2.1 Sending the full text: meSpeak GUI will only allow to enable/disable the type. -To register call (in modules loaded): - Speak_Register("PluginName (DB key)", "name", "Prety name for GUI", "icon_xyz") -And to speak call: - Speak_SayEx("name", hContact, _T("text to speak")) - -2.2 Using templates: you will not pass the text, but some variables. meSpeak handles -the GUI to allow the user to create the text for those variables. These functions -end with WT (with templates). -To register call (in modules loaded): - AnsiChar *templates[] = { "Name\nDefault\n%var1%\tDescription 1\n%var2%\tDescription2\n%var3%\tDescription 3" }; - Speak_RegisterWT("PluginName (DB key)", "name", "Prety name for GUI", "icon_xyz", - templates, 1); -And to speak call: - TCHAR *variables[] = { _T("var1"), _T("Value 1"), _T("var2"), _T("Value 2"), _T("var3"), _T("Value 3") }; - Speak_SayExWT("name", hContact, 0, variables, 3); -*) - -const - MIID_SPEAK = '{1EF72725-6A83-483B-AA50-8953E359EEAD}'; - - {* - Speak a text - - wParam: (HANDLE) hContact - lParam: (AnsiChar *) text - return: 0 on success - *} - MS_SPEAK_SAY_A = 'Speak/Say'; - - {* - Speak a unicode text - - wParam: (HANDLE) hContact - lParam: (WCHAR *) text - return: 0 on success - *} - MS_SPEAK_SAY_W = 'Speak/SayW'; - -type - PSPEAK_TYPE = ^TSPEAK_TYPE; - TSPEAK_TYPE = record - cbSize: integer; - module: PAnsiChar; - name: PAnsiChar; // Internal type name - description: PAnsiChar; // Will be translated - icon: PAnsiChar; // Name off icolib icon - // Aditional data if wants to use add to history services - templates: ^PAnsiChar; // Each entry is: "Name\nDefault\n%var%\tDescription\n%var%\tDescription\n%var%\tDescription" - numTemplates: integer; - end; - -const - {* - Register and speak type - - wParam: (SPEAK_TYPE *) type - lParam: 0 - return: 0 on success - *} - MS_SPEAK_REGISTER = 'Speak/Register'; - -const - SPEAK_CHAR = 1; - SPEAK_WCHAR = 2; - -type - PSPEAK_ITEM = ^TSPEAK_ITEM; - TSPEAK_ITEM = record - cbSize: integer; - _type: PAnsiChar; // Internal type name - hContact: TMCONTACT; - flags: integer; // SPEAK_* - templateNum: integer; // -1 to use text - case boolean of - true: (text: PAnsiChar); - false: ( - variables: pointer; - numVariables: integer; - ); - end; - -const - {* - Speak a text - - wParam: (SPEAK_ITEM *) Item - lParam: 0 - return: 0 on success - *} - MS_SPEAK_SAYEX = 'Speak/SayEx'; - - -{$IFDEF I_AM_A_CONSTANT_THAT_IS_NEVER_DEFINED_BUT_ALLOWS_THE_CODE_BELOW_NOT_TO_BE_COMMENTED} -// Helper functions - -static int Speak_SayA(HANDLE hContact, const AnsiChar *text) -{ - return CallService(MS_SPEAK_SAY_A, (WPARAM) hContact, (LPARAM) text); -} - -static int Speak_SayW(HANDLE hContact, const WCHAR *text) -{ - return CallService(MS_SPEAK_SAY_W, (WPARAM) hContact, (LPARAM) text); -} - -static int Speak_Register(AnsiChar *module, AnsiChar *name, AnsiChar *description, AnsiChar *icon) -{ - SPEAK_TYPE type; - - if (!ServiceExists(MS_SPEAK_REGISTER)) - return -1; - - type.cbSize = sizeof(type); - type.module = module; - type.name = name; - type.description = description; - type.icon = icon; - type.templates = NULL; - type.numTemplates = 0; - - return CallService(MS_SPEAK_REGISTER, (WPARAM) &type, 0); -} - -static int Speak_RegisterWT(const AnsiChar *module, const AnsiChar *name, const AnsiChar *description, - const AnsiChar *icon, AnsiChar **templates, int numTemplates) -{ - SPEAK_TYPE type; - - if (!ServiceExists(MS_SPEAK_REGISTER)) - return -1; - - type.cbSize = sizeof(type); - type.module = module; - type.name = name; - type.description = description; - type.icon = icon; - type.templates = templates; - type.numTemplates = numTemplates; - - return CallService(MS_SPEAK_REGISTER, (WPARAM) &type, 0); -} - -static int Speak_SayExA(AnsiChar *type, HANDLE hContact, const AnsiChar *text) -{ - SPEAK_ITEM item; - - if (!ServiceExists(MS_SPEAK_SAYEX)) - // Try old service - return Speak_SayA(hContact, text); - - item.cbSize = sizeof(item); - item.flags = SPEAK_CHAR; - item.type = type; - item.hContact = hContact; - item.templateNum = -1; - item.text = text; - - return CallService(MS_SPEAK_SAYEX, (WPARAM) &item, 0); -} - -static int Speak_SayExW(AnsiChar *type, HANDLE hContact, const WCHAR *text) -{ - SPEAK_ITEM item; - - if (!ServiceExists(MS_SPEAK_SAYEX)) - // Try old service - return Speak_SayW(hContact, text); - - item.cbSize = sizeof(item); - item.flags = SPEAK_WCHAR; - item.type = type; - item.hContact = hContact; - item.templateNum = -1; - item.text = text; - - return CallService(MS_SPEAK_SAYEX, (WPARAM) &item, 0); -} - -static int Speak_SayExWTA(AnsiChar *type, HANDLE hContact, int templateNum, AnsiChar **variables, int numVariables) -{ - SPEAK_ITEM item; - - if (!ServiceExists(MS_SPEAK_SAYEX)) - return -1; - - item.cbSize = sizeof(item); - item.flags = SPEAK_CHAR; - item.type = type; - item.hContact = hContact; - item.templateNum = templateNum; - item.variables = variables; - item.numVariables = numVariables; - - return CallService(MS_SPEAK_SAYEX, (WPARAM) &item, 0); -} - -static int Speak_SayExWTW(AnsiChar *type, HANDLE hContact, int templateNum, WCHAR **variables, int numVariables) -{ - SPEAK_ITEM item; - - if (!ServiceExists(MS_SPEAK_SAYEX)) - return -1; - - item.cbSize = sizeof(item); - item.flags = SPEAK_WCHAR; - item.type = type; - item.hContact = hContact; - item.templateNum = templateNum; - item.variables = variables; - item.numVariables = numVariables; - - return CallService(MS_SPEAK_SAYEX, (WPARAM) &item, 0); -} - - -#ifdef UNICODE -# define MS_SPEAK_SAY MS_SPEAK_SAY_W -# define Speak_Say Speak_SayW -# define Speak_SayEx Speak_SayExW -# define Speak_SayExWT Speak_SayExWTW -#else -# define MS_SPEAK_SAY MS_SPEAK_SAY_A -# define Speak_Say Speak_SayA -# define Speak_SayEx Speak_SayExA -# define Speak_SayExWT Speak_SayExWTA -#endif - -{$ENDIF} -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_voice.inc b/plugins/ExternalAPI/delphi/m_voice.inc deleted file mode 100644 index 5e97094e34..0000000000 --- a/plugins/ExternalAPI/delphi/m_voice.inc +++ /dev/null @@ -1,156 +0,0 @@ -{ -Copyright (C) 2006-2009 Ricardo Pescuma Domenecci - -This is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this file; see the file license.txt. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. -} - -{$IFNDEF __M_VOICE} -{$DEFINE __M_VOICE} - -const - EVENTTYPE_VOICE_CALL = 8739; - - VOICE_CAPS_VOICE = 1 shl 0; // Voice is supported for this protocol. You need to set this one. - VOICE_CAPS_CALL_CONTACT = 1 shl 1; // Set if a call can be made to a hContact (PS_VOICE_CALL_CONTACT_VALID is used to validate the string) - VOICE_CAPS_CALL_STRING = 1 shl 3; // Set if a call can be made to some string (PS_VOICE_CALL_STRING_VALID is used to validate the string) -{ - Request to the protocol capabilities relative to voice. - - wParam: 0 - lParam: 0 - return: VOICE_CAPS_* -} - PS_VOICE_CAPS = '/Voice/Caps'; - - VOICE_SECURE = $00000001; - VOICE_UNICODE = $80000000; - - VOICE_STATE_TALKING = 0; - VOICE_STATE_RINGING = 1; - VOICE_STATE_CALLING = 2; - VOICE_STATE_ON_HOLD = 3; - VOICE_STATE_ENDED = 4; - VOICE_STATE_BUSY = 5; - -type - TVOICE_CALL = record - cbSize :int; // Struct size - moduleName:PAnsiChar; // The name of the protocol module (the same as VOICE_MODULE.name or the protocol szModule) - id :PAnsiChar; // Protocol especific ID for this call - flags :int; // VOICE_UNICODE to say the string is unicode or 0. - // VOICE_SECURE to say this is a encrypted call - hContact :TMCONTACT; // Contact associated with the call (can be NULL) - szNumber :TChar; // Number to call (can be NULL) - // Or the contact or the number must be != NULL - // If both are != NULL the call will be made to the number - // and will be associated with the contact - // This fields are only needed in first notification for a call id - szName :TChar; // Name of the caller. This makes sense only on incoming calls, - // where no contact is associated and the caller has a name and a number. - state :int; // VOICE_STATE_* - end; - -const -{ -Notifies that a voice call changed state - -wParam: const VOICE_CALL * -lParam: ignored -return: 0 on success -} - PE_VOICE_CALL_STATE = '/Voice/State'; - -{ -Request to the protocol a make voice call - -wParam: (HANDLE) hContact -lParam: (const TCHAR *) number -return: 0 on success -Or the contact or the number must be != NULL. If both are != NULL the call will be -made to the number and will be associated with the contact. -} - PS_VOICE_CALL = '/Voice/Call'; - -{ -Service called to make the protocol answer a call or restore a hold call. -It is an async call. If the call was answered, the PE_VOICE_CALL_STATE -notification will be fired. - -wParam: (const char *) id -lParam: ignored -return: 0 on success -} - PS_VOICE_ANSWERCALL = '/Voice/AnswerCall'; - -{ -Service called to make the protocol answer a call. This can be called if the -call is ringing or has started. If called any other time it should be ignored. -It is an async call. If the call was droped, the PE_VOICE_CALL_STATE -notification will be fired. - -wParam: (const char *) id -lParam: ignored -return: 0 on success -} - PS_VOICE_DROPCALL = '/Voice/DropCall'; - -{ -Service called to make the protocol hold a call. This means that the call should not -be droped, but it should be muted and put in a hold, to allow other call to be answered. -If the protocol can't hold a cal, it should be droped. - -This can be called if the call has started. If called any other time it should be ignored. -It is an async call. If the call was droped, the PE_VOICE_CALL_STATE -notification will be fired. - -wParam: (const char *) id -lParam: ignored -return: 0 on success -} - PS_VOICE_HOLDCALL = '/Voice/HoldCall'; - -{ -Send a DTMF (one digit text) to a talking call. - -wParam: (const char *) id -lParam: (TCHAR) dtmf -return: 0 on success -} - PS_VOICE_SEND_DTMF = '/Voice/SendDTMF'; - -{ -Used if protocol support VOICE_CALL_STRING. The call string is passed as -wParam and the proto should validate it. If this service does not exist all numbers can be called. - -wParam: (const TCHAR *) call string -lParam: ignored -return: 0 if wrong, 1 if correct -} - PS_VOICE_CALL_STRING_VALID = '/Voice/CallStringValid'; - -{ -Used if protocol support VOICE_CALL_CONTACT. -The hContact is passed as wParam and the proto should tell if this contact can be -called. If this service does not exist all contacts can be called (or, if it is a protocol, -all contacts from the protocol can be called). - -wParam: (HANDLE) hContact -lParam: (bool) TRUE if it is a test for 'can call now?', FALSE if is a test for 'will be possible to call someday?' -return: 0 if can't be called, 1 if can -} - PS_VOICE_CALL_CONTACT_VALID = '/Voice/CallContactValid'; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_voiceservice.inc b/plugins/ExternalAPI/delphi/m_voiceservice.inc deleted file mode 100644 index ab5872d8d3..0000000000 --- a/plugins/ExternalAPI/delphi/m_voiceservice.inc +++ /dev/null @@ -1,87 +0,0 @@ -{ -Copyright (C) 2007 Ricardo Pescuma Domenecci - -This is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this file; see the file license.txt. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. -} - -{$IFNDEF M_VOICESERVICE} -{$DEFINE M_VOICESERVICE} - -const - MIID_VOICESERVICE:MUUID='{7D64437-EF2E-4F60-BB2D-3C518FE24D63}; - -{ -This services are a mirror of the services/notifications in m_voice.h, -with the difference that that ones are to be used by protocols, and this ones -are to be used by plugins that can make calls to contacts in multiple protocols. - -To get the devices for input/output and some options, query the db directly: - VoiceService/EchoCancelation byte default: TRUE - VoiceService/MicBoost byte default: TRUE - VoiceService/Input TString default: windows default - VoiceService/Output TString default: windows default -} - -type - TVOICE_MODULE = record - cbSize :int; // sizeof(VOICE_MODULE) - description:TChar; // The description of the voice provider. This is the name that - // will be shown to the user - name :PAnsiChar; // The internal name of the voice provider. All PS_* serivces - // defined in m_voide.h need to be created based in this name. - // For example, PS_VOICE_CALL (/Voice/Call) need to be created - // as /Voice/Call - icon :PAnsiChar; // Icon to identify provider (from icolib) - flags :int; // or of VOICE_CAPS_*. You don't need to send VOICE_CAPS_VOICE. - end; - -{ -Register a new plugin that can make/receive voice calls (a voice provider). - -wParam: const VOICE_MODULE * -lParam: ignored -return: 0 on success -} - MS_VOICESERVICE_REGISTER:PAnsiChar = 'VoiceService/Register'; - -{ -Unregister a plugin that can make/receive voice calls (a voice provider). - -wParam: (const char *) Provider name -lParam: ignored -return: 0 on success -} - MS_VOICESERVICE_UNREGISTER:PAnsiChar = 'VoiceService/Unregister'; - -{ -Request a voice call to hContact. - -wParam: (HANDLE) hContact -lParam: ignored -return: the number of option calls for a contact. If > 0, it can be called -} - MS_VOICESERVICE_CAN_CALL:PAnsiChar = 'VoiceService/CanCall'; - -{ -Request a voice call to hContact. - -wParam: (HANDLE) hContact -lParam: (char *) Voice provider or NULL to use any provider avaiable -return: 0 on success -} - MS_VOICESERVICE_CALL:PAnsiChar = 'VoiceService/Call'; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_w7ui.inc b/plugins/ExternalAPI/delphi/m_w7ui.inc deleted file mode 100644 index 3841319ac7..0000000000 --- a/plugins/ExternalAPI/delphi/m_w7ui.inc +++ /dev/null @@ -1,84 +0,0 @@ -{$IFNDEF M_W7UI} -{$DEFINE M_W7UI} - -const - MIS_ICOLIB = 0; - MIS_GENERAL = 1; - MIS_PROTOCOL = 2; - -type - PMIRANDAJUMPLISTITEM = ^TMIRANDAJUMPLISTITEM; - TMIRANDAJUMPLISTITEM = record - iconSource:int; - iconName :pAnsiChar; - iconIdx :int; - szTitle :pWideChar; - szPrefix :pWideChar; - szArgument:pWideChar; - end; - -const -// Force jumplist rebuild - MS_JUMPLIST_REBUILD:pAnsiChar = 'w7/JumpList/Rebuild'; - -// --- - ME_JUMPLIST_BUILDCATEGORIES:pAnsiChar = 'w7/JumpList/BuildCategories'; - -// lParam = (WCHAR *)category name - ME_JUMPLIST_BUILDITEMS:pAnsiChar = 'w7/JumpList/BuildItems'; - -// lParam = (WCHAR *)category name - MS_JUMPLIST_ADDCATEGORY:pAnsiChar = 'w7/JumpList/AddCategory'; - -// lParam = (MIRANDAJUMPLISTITEM *)item - MS_JUMPLIST_ADDITEM:pAnsiChar = 'w7/JumpList/AddItem'; - -// wParam = prefix -// lParam = argument - ME_JUMPLIST_PROCESS:pAnsiChar = 'w7/JumpList/Process'; - -procedure MJumpList_AddCategory(name:pWideChar); -begin - CallService(MS_JUMPLIST_ADDCATEGORY, 0, LPARAM(name)); -end; - -procedure MJumpList_AddItem(mir_icon:pAnsiChar; title, prefix, argument:pWideChar); overload; -var - item:TMIRANDAJUMPLISTITEM; -begin - item.iconSource:=MIS_ICOLIB; - item.iconName :=mir_icon; - item.iconIdx :=0; - item.szTitle :=title; - item.szPrefix :=prefix; - item.szArgument:=argument; - CallService(MS_JUMPLIST_ADDITEM, 0, LPARAM(@item)); -end; - -procedure MJumpList_AddItem(skinicon:int; title, prefix, argument:pWideChar); overload; -var - item:TMIRANDAJUMPLISTITEM; -begin - item.iconSource:=MIS_GENERAL; - item.iconName :=0; - item.iconIdx :=skinicon; - item.szTitle :=title; - item.szPrefix :=prefix; - item.szArgument:=argument; - CallService(MS_JUMPLIST_ADDITEM, 0, LPARAM(@item)); -end; - -procedure MJumpList_AddItem(proto:pansiChar; skinicon:int; title, prefix, argument:pWideChar); overload; -var - item:TMIRANDAJUMPLISTITEM; -begin - item.iconSource:=MIS_PROTOCOL; - item.iconName :=proto; - item.iconIdx :=skinicon; - item.szTitle :=title; - item.szPrefix :=prefix; - item.szArgument:=argument; - CallService(MS_JUMPLIST_ADDITEM, 0, LPARAM(@item)); -end; - -{$ENDIF} diff --git a/plugins/ExternalAPI/delphi/m_webcam.inc b/plugins/ExternalAPI/delphi/m_webcam.inc deleted file mode 100644 index 592e28a479..0000000000 --- a/plugins/ExternalAPI/delphi/m_webcam.inc +++ /dev/null @@ -1,142 +0,0 @@ -{ - WebCam Video plugin by Sergei Polishchuk, SoftCab Inc - http://www.softcab.com - pserge@softcab.com -} - -{$IFNDEF M_WEBCAM} -{$DEFINE M_WEBCAM} - -const - MS_WEBCAM_OPEN = 'WebCam/Open'; -{ - This opens webcamera - wParam, and lParam must be zero. - Returns HANDLE to web camera. - For Example: - HANDLE hWebcamera = CallService(MS_WEBCAM_OPEN, 0, 0); -} - - MS_WEBCAM_ISREADY = 'WebCam/IsReady'; -{ - This zero if camera is ready for use, and non-zero if camera is still initializing. - It's useful to user this function after asynchronous opening of camera - wParam must be zero. - lParam = (LPARAM)(HANDLE)hCamera - camera handle - For Example: - HANDLE hWebcamera = CallService(MS_WEBCAM_ISREADY, 0, 0); -} - - MS_WEBCAM_CLOSE = 'WebCam/Close'; -{ - This will close web camera. - wParam must be zero - lParam = (LPARAM)(HANDLE)hWebcamera - a handle returned by MS_WEBCAM_OPEN - Return value is undefined. - For Example: - CallService(MS_WEBCAM_CLOSE, 0, (LPARAM)hWebcamera); -} - - MS_WEBCAM_SHOWWND = 'WebCam/Show'; -{ - This will show or hide web camera window - wParam = 1 to show window, or zero to hide one - lParam = (LPARAM)(HANDLE)hWebcamera - handle to camera - Return value is undefined. - For Example, this will show the window: - CallService(MS_WEBCAM_SHOWWND, 1, (LPARAM)hWebcamera); -} - - MS_WEBCAM_FREE = 'WebCam/Free'; -{ - This will free WEBCAM_QUERY fields. - wParam = sizeof(WEBCAM_QUERY) - lParam = (LPARAM)(WEBCAM_QUERY*)&Query - Return value is undefined - For Example: - CallService(MS_WEBCAM_FREE, sizeof(Query), (LPARAM)&Query); -} - - MS_WEBCAM_QUERY = 'WebCam/Query'; - WANT_PICTURE = pointer(-1); -{ - This will query web camera for data. - wParam = sizeof(WEBCAM_QUERY) - lParam = (LPARAM)(WEBCAM_QUERY*)&Query - Returns zero in case of success, or non-zero in case of any error - Before queryng camera, you need to setup some WEBCAM_QUERY structure fields. -} - -(* -WEBCAM_QUERY Query; -memset(&Query, 0, sizeof(Query)); -Query.hCamera = hWebcamera; -Query.Jpeg = WANT_PICTURE; // we want to get .JPG image -Query.Bitmap = NULL; // we do not need .BMP image -int ret = CallService(MS_WEBCAM_QUERY, sizeof(Query), (LPARAM)&Query); -if(!ret) -{ if(Query.Jpeg != NULL) - { // do something with JPG picture. For example, you may save it to .JPG file. - } - // now let's release the memory - CallService(MS_WEBCAM_FREE, sizeof(Query), (LPARAM)&Query); -} -*) - - MS_WEBCAM_SCREENSHOT = 'WebCam/ScreenShot'; -{ - This will return window screenshot - wParam = sizeof(WEBCAM_QUERY) - lParam = (LPARAM)(WEBCAM_QUERY*)&Query - Returns zero in case of success, or non-zero in case of any error - WEBCAMBUF->hCamera specifies window handle. - It's not required to open webcamera in order to run this service function. -} - -(* - -WEBCAM_QUERY Query; -memset(&Query, 0, sizeof(Query)); -Query.hCamera = (HANDLE)GetDesktopWindow(); // getting whole desktop picture. -Query.Jpeg = WANT_PICTURE; // we want to get .JPG image -Query.Bitmap = NULL; // we do not need .BMP image -int ret = CallService(MS_WEBCAM_SCREENSHOT, sizeof(Query), (LPARAM)&Query); -if(!ret) -{ if(Query.Jpeg != NULL) - { // do something with JPG picture. For example, you may save it to .JPG file. - } - // now let's release the memory - CallService(MS_WEBCAM_FREE, sizeof(Query), (LPARAM)&Query); -} - -*) - - ME_WEBCAM_SNAPSHOTRECEIVED = 'WebCam/SnapshotRecv'; -{ - This event will be fired right after receiving snapshot from remote contact. - wParam=(WPARAM)(HANDLE)hContact - a contact handle - lParam=(LPARAM)(WEBCAMBUF*)buffer - a buffer that contains JPEG image - IMPORTANT: you should not modify the buffer. It's read-only. -} - -type - ptag_WEBCAMBUF = ^tag_WEBCAMBUF; - tag_WEBCAMBUF = record - Size:dword; // size of Data buffer in bytes - Data:array [0..0] of byte; - end; - PWEBCAMBUF = ^WEBCAMBUF; - WEBCAMBUF = tag_WEBCAMBUF; - -type - ptag_WEBCAM_QUERY = ^tag_WEBCAM_QUERY; - tag_WEBCAM_QUERY = record - hCamera:THANDLE; // [in] HANDLE to web camera - cx,cy :word; // [out] camera picture size - Jpeg :PWEBCAMBUF; // [in,out] points to .JPG file content in memory - Bitmap :PWEBCAMBUF; // [in,out] points to .BMP file content in memory - end; - PWEBCAM_QUERY = ^WEBCAM_QUERY; - WEBCAM_QUERY = tag_WEBCAM_QUERY; - -{$ENDIF} diff --git a/plugins/ExternalAPI/m_ContactSettings.h b/plugins/ExternalAPI/m_ContactSettings.h deleted file mode 100644 index 1b497ab479..0000000000 --- a/plugins/ExternalAPI/m_ContactSettings.h +++ /dev/null @@ -1,235 +0,0 @@ -/* - Contact Settings plugin for Miranda IM - Copyright (c) 2007-2008 Chervov Dmitry - - 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 -*/ - -#ifndef __M_CONTACTSETTINGS_H -#define __M_CONTACTSETTINGS_H - - -typedef struct { - int cbSize; // sizeof(CONTACTSETTINGSINIT) - int Type; // one of CSIT_ constants; value of this field depends on what settings dialog was opened: contact settings or group settings - union - { - MCONTACT hContact; // used when Type == CSIT_CONTACT - int groupID; // used when Type == CSIT_GROUP - }; -} CONTACTSETTINGSINIT; - -// CONTACTSETTINGSINIT::Type -#define CSIT_CONTACT 1 // CONTACTSETTINGSINIT::hContact is valid -#define CSIT_GROUP 2 // CONTACTSETTINGSINIT::groupID is valid; in general, if Type == CSIT_GROUP, you MUST call MS_CONTACTSETTINGS_ADDCONTROL and add _all_ your per-contact controls, independently of current group contents, because potentially the group can contain any contacts in future. - -/* ME_CONTACTSETTINGS_INITIALISE -The user opened a contact settings dialog. Modules should do whatever initialisation they need and call MS_CONTACTSETTINGS_ADDCONTROL one or more times if they want controls displayed in the dialog -wParam=(WPARAM)(CONTACTSETTINGSINIT*)csi -lParam=0 -*/ -#define ME_CONTACTSETTINGS_INITIALISE "ContactSettings/Init" - - -/* MS_CONTACTSETTINGS_ADDCONTROL -Must only be called during a ME_CONTACTSETTINGS_INITIALISE hook -Adds a control to the contact settings dialog -wParam=(WPARAM)(CONTACTSETTINGSINIT*)csi -lParam=(LPARAM)(CONTACTSETTINGSCONTROL*)csc -Returns 0 on success, nonzero on failure -csi must have come straight from the wParam of ME_CONTACTSETTINGS_INITIALISE -Strings in the structure can be released as soon as the service returns. -*/ - -// CONTACTSETTINGSCONTROL::Position -#define CSPOS_SORTBYALPHABET 0x40000000 // recommended value for Position if you don't need a specific sorting order -// Group = "Notifications": -#define CSPOS_NOTIFICATIONS_SERVICES 0x20000000 // recommended control position for notification SERVICE PROVIDERS (popups, osd, tickers, etc). Notification plugins that use these services should use CSPOS_SORTBYALPHABET, so that notification service provider settings are above any other specific notification settings. - -// CONTACTSETTINGSCONTROL::Flags -#define CSCF_UNICODE 1 // string fields in CONTACTSETTINGSCONTROL and CSCONTROLSTATE are WCHAR* -#define CSCF_DONT_TRANSLATE_STRINGS 2 // specifies that strings in CONTACTSETTINGSCONTROL and CSCONTROLSTATE are translated already - -#ifdef _UNICODE -#define CSCF_TCHAR CSCF_UNICODE -#else -#define CSCF_TCHAR 0 -#endif - -// CONTACTSETTINGSCONTROL::ControlType -typedef enum -{ - CSCT_LABEL = -1, // CSCT_LABEL is used internally in ContactSettings, and mustn't be used by other plugins - CSCT_CHECKBOX, // checkbox control - CSCT_COMBOBOX // combobox control with a title above it -} CSCONTROLTYPE; - -// some common values for CONTACTSETTINGSCONTROL::ptszGroup -#define CSGROUP_NOTIFICATIONS LPGENT("Notifications") - -// special values for CONTACTSETTINGSCONTROL::szModule -#define CSMODULE_PROTO "%proto%" // ContactSettings will replace this by contact's protocol module name - -struct CSCONTROLSTATE -{ -#ifdef __cplusplus - CSCONTROLSTATE(): ptszName(NULL) {dbvValue.type = 0; dbvValue.dVal = 0; dbvValue.pbVal = 0; } - CSCONTROLSTATE(char *pszName, BYTE Value) { this->pszName = pszName; dbvValue.type = DBVT_BYTE; dbvValue.bVal = Value; } - CSCONTROLSTATE(char *pszName, char Value) { this->pszName = pszName; dbvValue.type = DBVT_BYTE; dbvValue.cVal = Value; } - CSCONTROLSTATE(char *pszName, WORD Value) { this->pszName = pszName; dbvValue.type = DBVT_WORD; dbvValue.wVal = Value; } - CSCONTROLSTATE(char *pszName, short Value) { this->pszName = pszName; dbvValue.type = DBVT_WORD; dbvValue.sVal = Value; } - CSCONTROLSTATE(char *pszName, DWORD Value) { this->pszName = pszName; dbvValue.type = DBVT_DWORD; dbvValue.dVal = Value; } - CSCONTROLSTATE(char *pszName, long Value) { this->pszName = pszName; dbvValue.type = DBVT_DWORD; dbvValue.lVal = Value; } - CSCONTROLSTATE(char *pszName, const char *szValue) { this->pszName = pszName; dbvValue.type = DBVT_ASCIIZ; dbvValue.pszVal = (char*)szValue; } - CSCONTROLSTATE(char *pszName, const WCHAR *wszValue) { this->pszName = pszName; dbvValue.type = DBVT_WCHAR; dbvValue.pwszVal = (WCHAR*)wszValue; } - CSCONTROLSTATE(WCHAR *pwszName, BYTE Value) { this->pwszName = pwszName; dbvValue.type = DBVT_BYTE; dbvValue.bVal = Value; } - CSCONTROLSTATE(WCHAR *pwszName, char Value) { this->pwszName = pwszName; dbvValue.type = DBVT_BYTE; dbvValue.cVal = Value; } - CSCONTROLSTATE(WCHAR *pwszName, WORD Value) { this->pwszName = pwszName; dbvValue.type = DBVT_WORD; dbvValue.wVal = Value; } - CSCONTROLSTATE(WCHAR *pwszName, short Value) { this->pwszName = pwszName; dbvValue.type = DBVT_WORD; dbvValue.sVal = Value; } - CSCONTROLSTATE(WCHAR *pwszName, DWORD Value) { this->pwszName = pwszName; dbvValue.type = DBVT_DWORD; dbvValue.dVal = Value; } - CSCONTROLSTATE(WCHAR *pwszName, long Value) { this->pwszName = pwszName; dbvValue.type = DBVT_DWORD; dbvValue.lVal = Value; } - CSCONTROLSTATE(WCHAR *pwszName, const char *szValue) { this->pwszName = pwszName; dbvValue.type = DBVT_ASCIIZ; dbvValue.pszVal = (char*)szValue; } - CSCONTROLSTATE(WCHAR *pwszName, const WCHAR *wszValue) { this->pwszName = pwszName; dbvValue.type = DBVT_WCHAR; dbvValue.pwszVal = (WCHAR*)wszValue; } -#endif - - union - { - TCHAR *ptszName; // item text for CSCT_COMBOBOX; not used for CSCT_CHECKBOX - char *pszName; - WCHAR *pwszName; - }; - DBVARIANT dbvValue; // database value for this state -}; - -// WARNING: do not use Translate(TS) for ptszTitle, ptszGroup, ptszTooltip or CSCONTROLSTATE::ptszName as they are translated by ContactSettings. The only exception is when you use CSCF_DONT_TRANSLATE_STRINGS flag -typedef struct { - int cbSize; // sizeof(CONTACTSETTINGSCONTROL) - int cbStateSize; // sizeof(CSCONTROLSTATE) - int Position; // position in the group, lower numbers are topmost. CSPOS_SORTBYALPHABET is recommended if you don't need a specific sorting order - DWORD Flags; // a combination of CSCF_ constants - CSCONTROLTYPE ControlType; // one of CSCT_ constants - union - { - TCHAR *ptszTitle; // label above the control - char *pszTitle; - WCHAR *pwszTitle; - }; - union - { - TCHAR *ptszGroup; // group title (several controls may be grouped together); may be NULL. - char *pszGroup; - WCHAR *pwszGroup; - }; - union - { - TCHAR *ptszTooltip; // tooltip for the control; may be NULL - char *pszTooltip; - WCHAR *pwszTooltip; - }; - const char *szModule; // database module; may contain variables (see above; currently the only existing variable is CSMODULE_PROTO) - const char *szSetting; // database setting - int StateNum; // number of possible states; always 2 or 3 for CSCT_CHECKBOX, and can be any number starting from 2 for CSCT_COMBOBOX - int DefState; // default state index - CSCONTROLSTATE *pStates; // array of StateNum items, describing all possible control states. Can be NULL for CSCT_COMBOBOX, in this case ContactSettings will use DBVT_BYTE database values, 0 is unchecked, 1 is checked, 2 is indeterminate. Can't be NULL for CSCT_COMBOBOX. - DWORD ValueMask; // in most cases simply set this to 0. when not 0, it allows to define a bit mask to access separate bits of a db value instead of reading/writing the whole value. is valid only for DBVT_BYTE, DBVT_WORD and DBVT_DWORD values -} CONTACTSETTINGSCONTROL; - -#define MS_CONTACTSETTINGS_ADDCONTROL "ContactSettings/AddControl" - - -typedef struct { - int cbSize; // sizeof(CONTACTSETTINGSCHANGEINFO) - HANDLE hContact; - const char *szModule; // variables in szModule and szSetting are NOT parsed, i.e. ContactSettings copies the values straight from CONTACTSETTINGSCONTROL - const char *szSetting; -} CONTACTSETTINGSCHANGEINFO; - -/* ME_CONTACTSETTINGS_SETTINGCHANGED -Called for every changed setting when the user applied changes in a contact settings dialog -wParam=(WPARAM)(CONTACTSETTINGSCHANGEINFO*)csci -lParam=0 -This event will be triggered many times rapidly when a whole bunch of values are set. -Modules which hook this should be aware of this fact and quickly return if they are not interested in the value that has been changed. -*/ -#define ME_CONTACTSETTINGS_SETTINGCHANGED "ContactSettings/SettingChanged" - - -/* MS_CONTACTSETTINGS_SHOWDIALOG -Shows Contact Settings dialog for a contact -wParam=hContact -lParam=0 -*/ -#define MS_CONTACTSETTINGS_SHOWDIALOG "ContactSettings/ShowDialog" - -/* MS_CONTACTSETTINGS_SHOWGROUPDIALOG. Not implemented yet. -Shows dialog for a group -wParam=groupId (0 is the main group) -lParam=0 -*/ -#define MS_CONTACTSETTINGS_SHOWGROUPDIALOG "ContactSettings/ShowGroupDialog" - - -/* -Example of use: - -// in ME_SYSTEM_MODULESLOADED handler: - HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInit); - -// ME_CONTACTSETTINGS_INITIALISE handler -static int ContactSettingsInit(WPARAM wParam, LPARAM lParam) -{ - CONTACTSETTINGSINIT *csi = (CONTACTSETTINGSINIT*)wParam; - -// check first whether to add controls or not -// we need to get a protocol name for that, if it's a contact settings dialog: - char *szProto = (csi->Type == CSIT_CONTACT) ? (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)csi->hContact, 0) : NULL; -// in general, you MUST add all your controls if csi->Type == CSIT_GROUP (i.e. user opened a group settings dialog), otherwise your plugin won't support group settings well: - if ((csi->Type == CSIT_GROUP) || -// otherwise (for a contact settings dialog), you can add controls depending on some conditions, like protocol caps, etc. -// in this example, we check whether the protocol has a PS_GETCUSTOMSTATUSICON service (i.e. does it support xstatuses or not): - (csi->Type == CSIT_CONTACT && szProto && ProtoServiceExists(szProto, PS_GETCUSTOMSTATUSICON))) -// your plugin must ignore cases when csi->Type is neither CSIT_GROUP nor CSIT_CONTACT - { - CONTACTSETTINGSCONTROL csc = {0}; - csc.cbSize = sizeof(csc); - csc.Position = CSPOS_SORTBYALPHABET; - csc.Flags = CSCF_TCHAR; - csc.ControlType = CSCT_COMBOBOX; - csc.StateNum = 3; - csc.ptszTitle = LPGENT("XStatus change notifications:") _T("\0") LPGENT("Ignore") _T("\0") LPGENT("Notify always") _T("\0") LPGENT("Use global settings") _T("\0"); - csc.ptszGroup = CSGROUP_NOTIFICATIONS; - csc.ptszTooltip = LPGENT("Tooltip text"); - csc.pszDBSetting = "ModuleName/XSNotifications"; - csc.DefValue = 2; // "Use global settings" - CallService(MS_CONTACTSETTINGS_ADDCONTROL, wParam, (LPARAM)&csc); - - // and CSCT_CHECKBOX example: - csc.Position = CSPOS_SORTBYALPHABET; - csc.Flags = CSCF_TCHAR; - csc.ControlType = CSCT_CHECKBOX; - csc.StateNum = 3; - csc.ptszTitle = LPGENT("Other setting"); - csc.ptszGroup = LPGENT("Some group"); - csc.ptszTooltip = LPGENT("Tooltip text"); - csc.pszDBSetting = "ModuleName/OtherSetting"; - csc.DefValue = 2; // BST_INDETERMINATE - CallService(MS_CONTACTSETTINGS_ADDCONTROL, wParam, (LPARAM)&csc); - } - return 0; -} - -*/ - -#endif // __M_CONTACTSETTINGS_H diff --git a/plugins/ExternalAPI/m_DataAsMessage.h b/plugins/ExternalAPI/m_DataAsMessage.h deleted file mode 100644 index 2f1f2eb441..0000000000 --- a/plugins/ExternalAPI/m_DataAsMessage.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - DataAsMessage plugin for Miranda IM - Copyright (c) 2006-2007 Chervov Dmitry - - 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 -*/ - -#ifndef __M_DATAASMESSAGE_H -#define __M_DATAASMESSAGE_H - -// DAM_SENDRESULTINFO::iResult values -#define DAM_SR_SUCCESS 0 -#define DAM_SR_TIMEOUT 1 // timeout period expired; this value is returned also if the contact went offline for a time longer than a timeout period -#define DAM_SR_NOTSUPPORTED 2 // means this szDataType is not supported by the remote side -#define DAM_SR_NODAM 3 // means there is no DataAsMessage plugin on the remote side; keep in mind that this error can also appear accidentally because of a bad connectivity during the handshake (if there was a timeout when waiting for a response) -#define DAM_SR_CANCELLEDLOCAL 4 // cancelled from the local(sending) side -#define DAM_SR_CANCELLEDREMOTE 5 // cancelled from the remote(receiving) side -#define DAM_SR_BADCRC 6 // bad CRC; we can't do anything with this error. the most probable cause is that protocol filters some of characters in our messages -#define DAM_SR_UNKNOWN 7 // unknown error - -// Return values for DAM_SENDRESULTPROC -#define DAM_SRA_RETRY 1 - -typedef struct -{ - int cbSize; // sizeof(DAM_SENDRESULTINFO) - HANDLE hContact; - char *szDataType; - DWORD SessionID; - int iResult; // transmission result code -} DAM_SENDRESULTINFO; // hContact, szDataType and SessionID fields correspond to the fields of the DAM_SENDDATAINFO structure - -typedef int (*DAM_SENDRESULTPROC)(DAM_SENDRESULTINFO *sri); // this procedure receives the result of the transmission. it's called when the session closes (either the data was sent successfully or there was an error) -// you can return DAM_SRA_RETRY when iResult is DAM_SR_TIMEOUT if you want to retry sending - - -// DAM_SENDDATAINFO::Flags constants -#define DAM_SDF_DONTPACK 1 // don't compress the data (by default all the data is compressed) -#define DAM_SDF_NOTIMEOUT 2 // don't generate a timeout error ever, keep trying to send the data. If the contact is offline, the data is saved in the memory until the contact goes online. Loss of the data occurs only if the sender's miranda closes (this may change in future to allow fully functional offline sending that will guarantee the data to be sent in any case, but of course the sending starts only when the both contacts are online). other errors than the timeout error can be still generated though. - -typedef struct -{ - int cbSize; // sizeof(DAM_SENDDATAINFO) - HANDLE hContact; - char *szDataType; // zero-terminated string, containing data type, preferably in format "YourPluginName" or "YourPluginName/Something" (make sure this string won't coincide by an accident with someone else's string!). you can identify your data by this ID later - int nDataLen; // keep in mind that if the length is too big (more than about 8 KB), it's more preferable to split your data into several chunks, as you won't be able to "pick up" your data at the other end until all the data is transferred - char *cData; - int Flags; // combination of the DAM_SDF_ constants - DWORD SendAfterSessionID; // may be NULL; otherwise it's guaranteed that the sending starts only after successful completion of SendAfterSessionID session - DAM_SENDRESULTPROC SendResultProc; // pointer to a procedure that receives the result; can be NULL - DWORD SessionID; // OUT; receives the session ID -} DAM_SENDDATAINFO; - -// MS_DAM_SENDDATA return values -#define DAM_SDA_NOERROR 0 -#define DAM_SDA_NOTSUPPORTED (-1) // contact's protocol doesn't support sending/receiving messages -#define DAM_SDA_TOOMANYSESSIONS (-2) // too many sessions - -// MS_DAM_SENDDATA -// sends the data -// wParam = (WPARAM)(DAM_SENDDATAINFO*)sdi; -// lParam = 0 -// Returns 0 (DAM_SDA_NOERROR) and fills SessionID if the session was queued for sending successfully; returns one of the DAM_SDA_ values on failure -#define MS_DAM_SENDDATA "DataAsMessage/SendData" - -static int __inline DAMSendData(HANDLE hContact, char *szDataType, int nDataLen, char *cData, int Flags, DWORD SendAfterSessionID, DAM_SENDRESULTPROC SendResultProc, DWORD *pSessionID) -{ - int Result; - DAM_SENDDATAINFO sdi; - ZeroMemory(&sdi, sizeof(sdi)); - sdi.cbSize = sizeof(sdi); - sdi.hContact = hContact; - sdi.szDataType = szDataType; - sdi.nDataLen = nDataLen; - sdi.cData = cData; - sdi.Flags = Flags; - sdi.SendAfterSessionID = SendAfterSessionID; - sdi.SendResultProc = SendResultProc; - Result = CallService(MS_DAM_SENDDATA, (WPARAM)&sdi, 0); - if (pSessionID) - { - *pSessionID = sdi.SessionID; - } - return Result; -} - - -typedef struct -{ - int cbSize; // sizeof(DAM_RECVDATAINFO) - HANDLE hContact; - char *szDataType; - int nDataLen; - char *cData; -} DAM_RECVDATAINFO; - -// ME_DAM_RECVDATA -// hook up to this event to check for incoming data -// make sure rdi->szDataType is yours before doing anything! -// The important thing here is that your plugin will receive TWO ME_DAM_RECVDATA notifications on every single MS_DAM_SENDDATA call from a remote side: -// The first notification arrives when the remote side starts to transmit the data. In this case DAM_RECVDATAINFO::cData = NULL (and DAM_RECVDATAINFO::nDataLen = -1) as we didn't receive any data yet. Return 1 to indicate that your plugin recognized the DAM_RECVDATAINFO::szDataType, otherwise return 0. If there are no any plugin that recognized the data, DAM cancels the transfer and there won't be any second notification for it. -// The second notification is when the data is transmitted successfully. nDataLen contains the usual data size and cData points to the data buffer. cData is guaranteed to be valid only during the ME_DAM_RECVDATA call. You must copy the data to your own plugin's memory if you need to use it later. And again, return 1 to indicate that your plugin recognized the data, otherwise return 0 -// wParam = (WPARAM)(DAM_RECVDATAINFO*)rdi; -// lParam = 0 -#define ME_DAM_RECVDATA "DataAsMessage/RecvData" - - -typedef struct -{ - int cbSize; // sizeof(DAM_COMPRESSION_DATA) - void *(*malloc)(size_t); // pointer to the malloc() function of the calling module - int nInputDataLen; // IN; length of the input data in bytes - char *cInputData; // IN; pointer to the input data - int nOutputDataLen; // OUT; length of the output data in bytes - char *cOutputData; // OUT; pointer to the output data -} DAM_COMPRESSION_DATA; - -// Compression/decompression services. You DON'T have to use them if you want to send compressed data using DAM services, as DAM compresses the data automatically. These services are here just in case you need to compress/decompress data for your own needs - -// MS_DAM_COMPRESS -// compresses the data using BZip2 -// wParam = (WPARAM)(DAM_COMPRESSION_DATA*)bd; -// lParam = 0 -// cbSize, malloc, nInputDataLen and cInputData fields must be valid when calling the service. -// Returns 0 and fills nOutputDataLen and cOutputData on success; returns non-zero on failure -// This service allocates the memory for cOutputData using the specified malloc function; you must call free(cOutputData) when you've finished working with cOutputData -#define MS_DAM_COMPRESS "DataAsMessage/Compress" - -// MS_DAM_DECOMPRESS -// decompresses the data -// wParam = (WPARAM)(DAM_COMPRESSION_DATA*)bd; -// lParam = 0 -// cbSize, malloc, nInputDataLen and cInputData fields must be valid when calling the service. -// Returns 0 and fills nOutputDataLen and cOutputData on success; returns non-zero on failure -// This service allocates the memory for cOutputData using the specified malloc function; you must call free(cOutputData) when you've finished working with cOutputData -#define MS_DAM_DECOMPRESS "DataAsMessage/Decompress" - - -__inline int DAM_Compress(char *cInputData, int nInputDataLen, char **cOutputData, int *nOutputDataLen) -{ - int Result; - DAM_COMPRESSION_DATA bd; - ZeroMemory(&bd, sizeof(bd)); - bd.cbSize = sizeof(bd); - bd.malloc = malloc; - bd.nInputDataLen = nInputDataLen; - bd.cInputData = cInputData; - Result = CallService(MS_DAM_COMPRESS, (WPARAM)&bd, 0); - *nOutputDataLen = bd.nOutputDataLen; - *cOutputData = bd.cOutputData; - return Result; -} - -__inline int DAM_Decompress(char *cInputData, int nInputDataLen, char **cOutputData, int *nOutputDataLen) -{ - int Result; - DAM_COMPRESSION_DATA bd; - ZeroMemory(&bd, sizeof(bd)); - bd.cbSize = sizeof(bd); - bd.malloc = malloc; - bd.nInputDataLen = nInputDataLen; - bd.cInputData = cInputData; - Result = CallService(MS_DAM_DECOMPRESS, (WPARAM)&bd, 0); - *nOutputDataLen = bd.nOutputDataLen; - *cOutputData = bd.cOutputData; - return Result; -} - - -#endif // __M_DATAASMESSAGE_H diff --git a/plugins/ExternalAPI/m_LogService.h b/plugins/ExternalAPI/m_LogService.h deleted file mode 100644 index 3acd6be1d6..0000000000 --- a/plugins/ExternalAPI/m_LogService.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - LogService - Plugin for Miranda IM - Copyright (c) 2006-2008 Chervov Dmitry - - 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 -*/ - -#ifndef __M_LOGSERVICE_H -#define __M_LOGSERVICE_H - -#define MIID_LOGSERVICE {0xe60bc9eb, 0xa099, 0x4846, {0xbc, 0x11, 0xba, 0x39, 0xf6, 0x60, 0x8b, 0x94}} -// {E60BC9EB-A099-4846-BC11-BA39F6608B94} - - -// LS_REGINFO::Flags constants -#define LSRF_WCHAR 1 // specifies that LS_REGINFO::szTitle, szDefLogPath and szDefFormat are WCHAR* -#ifdef _UNICODE - #define LSRF_TCHAR LSRF_WCHAR -#else - #define LSRF_TCHAR 0 -#endif - -typedef struct { - int cbSize; // sizeof(LS_REGINFO) - char *szID; // Log ID; it's a good idea to use your plugin name here - union - { - char *szTitle; // Title shown in the options. Cannot be NULL or empty. This is translated by LogService automatically - WCHAR *wszTitle; - TCHAR *tszTitle; - }; - union - { - char *szDefLogPath; // Default log file path, may contain variables. May be NULL - in this case the default path is ".log". Usually it's relative to \Logs dir, but it can be changed by user through Folders plugin. - WCHAR *wszDefLogPath; // if there's no Variables plugin installed, LogService will use szDefLogPath with all the variables removed from it - TCHAR *tszDefLogPath; - }; - union - { - char *szDefFormat; // Default log format; contains variables. May be NULL - in this case the default formatting is "`[`!cdate()-!ctime()`]` %extratext%" - WCHAR *wszDefFormat; - TCHAR *tszDefFormat; - }; - int Flags; -} LS_REGINFO; - -// MS_LOGSERVICE_REGISTER -// Registers a log. Your plugin can register several different logs with different settings. This service must be called once for every needed log ID at every startup. -// wParam = (WPARAM)(LS_REGINFO*)pri - pointer to LS_REGINFO item -// lParam = 0 -// returns 0 on success -#define MS_LOGSERVICE_REGISTER "LogService/Register" - -__inline static INT_PTR logservice_register(char *szID, TCHAR *tszTitle, TCHAR *tszDefLogPath, TCHAR *tszDefFormat) -{ - LS_REGINFO ri; - ZeroMemory(&ri, sizeof(LS_REGINFO)); - ri.cbSize = sizeof(LS_REGINFO); - ri.szID = szID; - ri.tszTitle = tszTitle; - ri.tszDefLogPath = tszDefLogPath; - ri.tszDefFormat = tszDefFormat; - ri.Flags = LSRF_TCHAR; - return CallService(MS_LOGSERVICE_REGISTER, (WPARAM)&ri, 0); -} - - - -// LS_MSGINFO::Flags constants -#define LSMF_WCHAR 1 // specifies that LS_MSGINFO::szMsg is a WCHAR* -#ifdef _UNICODE - #define LSMF_TCHAR LSMF_WCHAR -#else - #define LSMF_TCHAR 0 -#endif - -typedef struct { - int cbSize; // sizeof(LS_MSGINFO) - char *szID; - MCONTACT hContact; // may be NULL if no contact is associated with the message - union - { - char *szMsg; // the message - WCHAR *wszMsg; - TCHAR *tszMsg; - }; - int Flags; -} LS_MSGINFO; - -// MS_LOGSERVICE_LOG -// Logs szMsg message. You don't have to specify in szMsg anything else than the actual message. i.e. LogService will take care of date, time, contact nick etc by itself, using the format string -// wParam = (WPARAM)(LS_MSGINFO*)pmi - pointer to LS_MSGINFO item -// lParam = 0 -// returns 0 on success -#define MS_LOGSERVICE_LOG "LogService/Log" - -__inline static INT_PTR logservice_log(char *szID, MCONTACT hContact, TCHAR *tszMsg) -{ - LS_MSGINFO mi; - ZeroMemory(&mi, sizeof(LS_MSGINFO)); - mi.cbSize = sizeof(LS_MSGINFO); - mi.szID = szID; - mi.hContact = hContact; - mi.tszMsg = tszMsg; - mi.Flags = LSMF_TCHAR; - return CallService(MS_LOGSERVICE_LOG, (WPARAM)&mi, 0); -} - - -// LS_LOGINFO::Flags constants -#define LSLI_WCHAR 1 // [in]; specifies that LS_LOGINFO::szLogPath is a WCHAR* -#ifdef _UNICODE - #define LSLI_TCHAR LSLI_WCHAR -#else - #define LSLI_TCHAR 0 -#endif -#define LSLI_LOGENABLED 2 // [out]; LogService will set this flag if log with ID szID is enabled in the options. Setting this flag before calling MS_LOGSERVICE_GETLOGINFO is ignored. This flag is independent of hContact. - -typedef struct { - int cbSize; // [in]; sizeof(LS_LOGINFO) - char *szID; // [in] - MCONTACT hContact; // [in]; may be NULL - union - { - char *szLogPath; // [in]; pointer to a string to receive log file name, including full path. May be NULL. The string must be at least MAX_PATH characters long - WCHAR *wszLogPath; - TCHAR *tszLogPath; - }; - int Flags; // [in,out] -} LS_LOGINFO; - -// MS_LOGSERVICE_GETLOGINFO -// Returns various information about log with ID szID. -// wParam = (WPARAM)(LS_LOGINFO*)pli - pointer to LS_LOGINFO item -// lParam = 0 -// If szFileName is not NULL, MS_LOGSERVICE_GETLOGINFO gets full log file path by szID and hContact and copies it to *szLogPath -// Also the service will set LSLI_LOGENABLED flag if the specified log is enabled in the options. -// returns 0 on success -#define MS_LOGSERVICE_GETLOGINFO "LogService/GetLogInfo" - - -/* -1) Example of the simpliest way to use LogService: - - // define szID - #define LOG_ID "MyPluginName" - - // in ME_SYSTEM_MODULESLOADED handler: - logservice_register(LOG_ID, LPGENT("My plugin - log title"), NULL, NULL); - - // whenever you need to log something: - logservice_log(LOG_ID, NULL, _T("Test message")); - // (don't forget to specify hContact instead of NULL here if there's a contact associated with the message) - -MyPluginName.log will be created with the following contents: -[20.08.2007-14:30:00] Test message - - -2) If you want to offer additional customizability of log format using Variables, but still want the log to be usable even when Variables plugin is not installed, you can specify different messages depending on existence of MS_VARS_FORMATSTRING service. This example will explain how to do this and also will show you some other useful hints related to Variables plugin. - - // define szID - #define LOG_ID "ClientChangeNotify" - - // For example, say, we want to append user's ICQ UIN (or Yahoo ID, etc) to file name, to log CCN events to different files, depending on protocol (i.e. ClientChangeNotify_310927.log for ICQ). That's why custom log file path with variables is used here: - - logservice_register(LOG_ID, LPGENT("ClientChangeNotify"), - _T("ClientChangeNotify?puts(p,?dbsetting(%subject%,Protocol,p))?if2(_?dbsetting(,?get(p),?pinfo(?get(p),uidsetting)),).log"), - TranslateT("`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,id)) changed client to %extratext%")); - - // When Variables plugin is not installed, LogService will automatically cut all the variables from the log path, and we'll get usual "ClientChangeNotify.log" - so everyting is ok here. - // But note that %extratext% in the log format is supposed to contain only client name in CCN, and without some special measures, we would get something like this in the log when Variables plugin is not installed: - // [20.08.2007-14:30:00] Miranda IM 0.7.0.33 alpha (ICQ v0.3.8.105 alpha) - // Without at least contact nick, such log will be just useless. So when logging, we'll handle this case in a special way: - - if (ServiceExists(MS_VARS_FORMATSTRING)) - { // Variables plugin is installed - logservice_log(LOG_ID, hContact, tszClientName); - } else - { // Variables plugin is not installed, so we have to generate the string by ourselves, using some simple predefined format: - TCHAR tszNickAndClient[1024]; - mir_sntprintf(tszNickAndClient, SIZEOF(tszNickAndClient), TranslateT("%s changed his client to %s"), - (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR), tszClientName); - logservice_log(LOG_ID, hContact, tszNickAndClient); - } - -3) The other solution to the case when there's no Variables plugin, is to sacrifice customizability of log format for a simplier implementation: - - // define szID - #define LOG_ID "ClientChangeNotify" - - // in ME_SYSTEM_MODULESLOADED handler: - logservice_register(LOG_ID, LPGENT("ClientChangeNotify"), - _T("ClientChangeNotify?puts(p,?dbsetting(%subject%,Protocol,p))?if2(_?dbsetting(,?get(p),?pinfo(?get(p),uidsetting)),).log"), - NULL); - - // logging: - TCHAR tszNickAndClient[1024]; - mir_sntprintf(tszNickAndClient, SIZEOF(tszNickAndClient), TranslateT("%s changed his client to %s"), - (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR), tszClientName); - logservice_log(LOG_ID, hContact, tszNickAndClient); - - // Note that %extratext% now always contains the whole " changed his client to " string, and user is almost unable to customize this; perhaps only by using another translation or some advanced Variables scripts. -*/ - -#endif // __M_LOGSERVICE_H \ No newline at end of file diff --git a/plugins/ExternalAPI/m_MagneticWindows.h b/plugins/ExternalAPI/m_MagneticWindows.h deleted file mode 100644 index e011c773fd..0000000000 --- a/plugins/ExternalAPI/m_MagneticWindows.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef __M_MAGNETICWINDOWS_H__ -#define __M_MAGNETICWINDOWS_H__ - -//#include "../include/newpluginapi.h" - -// For other Plugins to start snapping for their windows -// wparam: hwnd of window -// lparam: 0 -// return: 0 on success, 1 on error -#define MS_MW_ADDWINDOW "Utils/MagneticWindows/Add" - -// For other Plugins to stop snapping for their windows -// wparam: hwnd of window -// lparam: 0 -// return: 0 on success, 1 on error -#define MS_MW_REMWINDOW "Utils/MagneticWindows/Rem" - -//decide where to align on the list: -#define MS_MW_STL_List_Left 0x00000001 //Snaps the window to the left border of the list -#define MS_MW_STL_List_Top 0x00000002 //Snaps the window to the top border of the list -#define MS_MW_STL_List_Right 0x00000004 //Snaps the window to the right border of the list -#define MS_MW_STL_List_Bottom 0x00000008 //Snaps the window to the bottom border of the list -//decide with what side (of the window you want to snap) to snap to the list -#define MS_MW_STL_Wnd_Left 0x00000010 //Snaps the window with the left border to the left/right side of the list -#define MS_MW_STL_Wnd_Top 0x00000020 //Snaps the window with the top border to the top/bottom side of the list -#define MS_MW_STL_Wnd_Right 0x00000040 //Snaps the window with the right border to the left/right side of the list -#define MS_MW_STL_Wnd_Bottom 0x00000080 //Snaps the window with the bottom border to the top/bottom side of the list - -#define MS_MW_STL_Wnd_FullWidth (MS_MW_STL_Wnd_Left | MS_MW_STL_Wnd_Right) - //Snaps to the top/bottom of the list and spans over the full width - -#define MS_MW_STL_Wnd_FullHeight (MS_MW_STL_Wnd_Top | MS_MW_STL_Wnd_Bottom) - //Snaps to the left/right of the list and spans over the full height - -// to place the window in the list combine f.e. MS_MW_STL_List_Left | MS_MW_STL_Wnd_Right | *vetical alignment* - -//For other Plugins to snap a window to the list for other Plugins -// wparam: hwnd of window -// lparam: combination of the above constants MS_MW_STL_* -// return: 0 on success, 1 on error -#define MS_MW_SNAPTOLIST "Utils/MagneticWindows/SnapToList" - -// Helper functions -#ifndef _MW_NO_HELPPER_FUNCTIONS - - -static inline int MagneticWindows_AddWindow(HWND hWnd) -{ - if (ServiceExists(MS_MW_ADDWINDOW)) - { - return CallService(MS_MW_ADDWINDOW, (WPARAM) hWnd, 0); - } - else - { - return -1; - } -} - -static inline int MagneticWindows_RemoveWindow(HWND hWnd) -{ - if (ServiceExists(MS_MW_REMWINDOW)) - { - return CallService(MS_MW_REMWINDOW, (WPARAM) hWnd, 0); - } - else - { - return -1; - } -} - -static inline int MagneticWindows_SnapWindowToList(HWND hWnd, int MS_MW_STL_Options) -{ - if (ServiceExists(MS_MW_SNAPTOLIST)) - { - return CallService(MS_MW_SNAPTOLIST, (WPARAM) hWnd, (LPARAM) MS_MW_STL_Options); - } - else - { - return -1; - } -} - -#endif - - -#endif // __M_MAGNETICWINDOWS_H__ diff --git a/plugins/ExternalAPI/m_MathModule.h b/plugins/ExternalAPI/m_MathModule.h deleted file mode 100644 index 04ae06a7f7..0000000000 --- a/plugins/ExternalAPI/m_MathModule.h +++ /dev/null @@ -1,263 +0,0 @@ -#ifndef M_MATHMODULE_H_ -#define M_MATHMODULE_H_ -//--------------------------------------------------- - - -/* - ************************** - * 2 * - ** * x + 2 Pi - ** ************* + R - * Sin(wt) - * - - Math-Module - ************** - - Miranda Plugin by Stephan Kassemeyer - - - MathModule API - (c) Stephan Kassemeyer - 8 May, 2004 - -*/ - - -// --------- - -/* - Miranda Service-functions defined by MathModule - call with the - int (*CallService)(const char * servicename,WPARAM,LPARAM) - that you get from miranda when Miranda calls the - Load(PLUGINLINK * link) - of your PlugIn-dll - the CallService function then is: - link->CallServiceSync(Servicename,wparam,lparam) -*/ - -// --------- - -#define MATH_RTF_REPLACE_FORMULAE "Math/RtfReplaceFormulae" -// replace all formulas in a RichEdit with bitmaps. -// wParam = 0 -// lParam = *TMathRichedit Info -// return: TRUE if replacement succeeded, FALSE if not (disable by user?). -typedef struct -{ - HWND hwndRichEditControl; // handle of richedit. - CHARRANGE* sel; // NULL: replace all. - int disableredraw; -} TMathRicheditInfo; -// WARNING: !!! -// Strange things happen if you use this function twice on the same CHARRANGE: -// if Math-startDelimiter == Math-endDelimiter, there is the following problem: -// it might be that someone forgot an endDelimiter, this results in a lonesome startdelimiter. -// if you try to MATH_REPLACE_FORMULAE the second time, startDelimiters and endDelimiters are mixed up. -// The same problem occours if we have empty formulae, because two succeding delimiters are -// replaced with a single delimiter. - - -#define MTH_GETBITMAP "Math/GetBitmap" -//returns Bitmap that represents the formula given in lparam (string-pointer) -//this formula has NO Delimiters. -//wparam=0 -//lparam=(*char)Formula -//result=(HBITMAP) bitmap -//!!! the bitmap must be deleted with DeleteObject(hobject) -//example: -//HBITMAP Bmp=(HBITMAP)CallService(MTH_GETBITMAP,0, (LPARAM)formula); - -#define MTH_GET_GIF "Math/GetGif" -// this renders a formula given in lparam and produces a gif-image in a temporary-folder -// and returns the filename (full path). Be sure to copy the file if you want to preserve it, -// because the files are managed as a ring-buffer, if 99 files already exist, this -// function overwrites the first one. -// wparam=0 -// lparam=*char text // formula WITHOUT delimiters -// result=(*char)path -// !!! the result-buffer must be deleted with MTH_FREE_GIFPATH -#define MTH_GET_GIF_UNICODE "Math/GetGifUnicode" -// wparam=0 -// lparam=*wchar_t text -// result=*char path -// !!! the result-buffer must be deleted with MTH_FREE_GIFPATH -#define MTH_FREE_GIFPATH "Math/FreeRTFBitmapText" - -#define MTH_GET_RTF_BITMAPTEXT "Math/GetRTFBitmapText" -// returns rich-text stream that includes bitmaps from text given in lparam -// text included between MATH_GET_STARTDELIMITER and MATH_GETENDDELIMITER -// hereby is replaced with a rtf-bitmap-stream that represents the corresponding formula -// wparam=0 -// lparam=*char text -// result=*char rtfstream -// !!! the result-buffer must be deleted with MTH_FREE_RTF_BITMAPTEXT -#define MTH_FREE_RTF_BITMAPTEXT "Math/FreeRTFBitmapText" -// deletes the buffer that MTH_GET_RTF_BITMAPTEXT has created. -// wparam=0 -// lparam=(*char) buffer -// result=0 - -#define MTH_GET_HTML_SOURCE "Math/GetHTMLSource" -// this is similar to MTH_GET_RTF_BITMAPTEXT, but -// as we cannot include embedded images, the bitmaps are saved in a -// temporary directory (relative to Miranda-dir) and the images are linked into -// the html-source -// wparam=0 -// lparam=*char text // this has to be html-source already. this function only adds formula-links. -// result=*char htmlsource -// !!! the result-buffer must be deleted with MTH_FREE_HTML_BUFFER -#define MTH_GET_HTML_SOURCE_UNICODE "Math/GetHTMLSourceUnicode" -// wparam=0 -// lparam=*wchar_t text -// result=*wchar_t htmlsource -#define MTH_FREE_HTML_BUFFER "Math/FreeRTFBitmapText" -// deletes string-buffers that MathModule has created. -// wparam=(bool) unicode // 0 if no unicode-buffer; 1 if unicode-buffer !!! -// lparam=(*char) buffer -// result=0 - - -// **********parameter functions: - -#define MATH_SET_PARAMS "Math/SetParams" -//-------------------------------------- -// sets a parameter (only integer values) specified in wparam -// wparam=paramcode -// lparam=parametervalue -// paramcodes: - #define MATH_PARAM_BKGCOLOR 0 // (COLORREF) std-rgb-color or TRANSPARENT_Color - // you can make the BKGCOLOR Transparent (default) by using this color: - #define TRANSPARENT_Color 0xffffffff -1 // this is default - #define MATH_PARAM_FONTCOLOR 1 // (COLORREF) std-rgb-color - #define MATH_PARAM_RESIZE_HWND 2 // (HWND) preview window resizes RESIZE_HWND when it is being resized. - #define MATH_PARAM_ToolboxEdit_HWND 3 // (HWND) If this hwnd (of an edit-box) is set, MathModule can insert Formula-elements from the Math-Toolbox. - -#define MATH_GET_PARAMS "Math/GetParams" -//--------------------------------------- -// get a parameter (only integer values) specified in wparam -// wparam=paramcode -// lparam=lparamOfPARAM // see below -// paramcodes and returnvalues: - #define MATH_PARAM_STARTDELIMITER 4 // retval: *char delimiter // the delimiter that marks the beginning of a formula - // !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER - // lparam=0 - #define MATH_PARAM_ENDDELIMITER 5 // retval: *char delimiter // the delimiter that marks the end of a formula - // !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER - // lparam=0 -// ************end parameter functions. - -#define MTH_FREE_MATH_BUFFER "Math/FreeRTFBitmapText" -// deletes string-buffers that MathModule has created. (at the moment only the *DELIMITER-services create such strings) -// wparam=0 -// lparam=(*char) buffer -// result=0 - - - -// ********* preview-window functions - -#define MTH_SHOW "Math/Show" -// shows the preview-window -// wparam=0 -// lparam=0 -// result=0 - -#define MTH_HIDE "Math/Hide" -// hides the preview-window -// wparam=0 -// lparam=0 -// result=0 - -#define MTH_RESIZE "Math/Resize" -// sets the size of the preview-window -// wparam=0 -// lparam=(*TMathWindowInfo) -// result=0 -typedef struct -{ - int top; - int left; - int right; - int bottom; -} TMathWindowInfo; - -#define MTH_SETFORMULA "Math/SetFormula" -// sets the text that the preview-window should parse to display formulas found inside -// wparam=0 -// lparam=(*char) text -// result=0 - -#define MTH_GET_PREVIEW_HEIGHT "Math/getPreviewHeight" -// returns the height of the whole preview-window (including system-menu-bar) -// consider this when maximizing a window to that preview-window is hooked on top or bottom -// it returns the height no matter whether preview-window is visible or not -// wparam=0 -// lparam=0 -// result=(int) height - -#define MTH_GET_PREVIEW_SHOWN "Math/getPreviewShown" -// returns 1 if preview window is visible -// returns 0 if preview window is invisible -// result=(int) shown - -//---------------end preview functions - - -#define MTH_SUBSTITUTE_DELIMITER "Math/SubstituteDelimiter" -// replaces Substitute in an edit-box given in lparam-structure with internal Math-Delimiter. -// MathSrmm uses this for the shortcut-functionality -// I do not recommend to use this, it's not Unicode-safe -// wparam=0 -// lparam=(TMathSubstInfo) substInfo -// result=0 -typedef struct -{ - HWND EditHandle; - char* Substitute; -} TMathSubstInfo; - - - - - -// -// ---- here are some obsolete services. I plan to remove them soon. Use MATH_SET_PARAMS or MATH_GET_PARAMS instead !! -// - -#define MATH_SETBKGCOLOR "Math/SetBackGroundColor" -// changes the background color of the next formula to be rendered. -// wparam=0 -// lparam=(COLORREF) color -// result=0 - -#define MTH_Set_ToolboxEditHwnd "Math/SetTBhwnd" -// If this hwnd (of an edit-box) is set, MathModule can insert Formula-elements from the Math-Toolbox. -// wparam=0 -// lparam=handle - -#define MTH_Set_Resize_HWND "Math/SetResizeHWND" //übergibt fenster-Handle des aktuellen Message-Dialogs -// If MathModule knows the handle of a SRMM-based window, following features exist: -// - preview window resizes Math-Srmm when it is being resized. -// wparam=0 -// lparam=handle -// result=0 - -#define MATH_GET_STARTDELIMITER "Math/GetStartDelimiter" -// returns the delimiter that marks the beginning of a formula -// wparam=0 -// lparam=0 -// result=*char Delimiter -// !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER - -#define MATH_GETENDDELIMITER "Math/GetEndDelimiter" -// returns the delimiter that marks the end of a formula -// wparam=0 -// lparam=0 -// result=*char Delimiter -// !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER - -//--------------------------------------------------- -#endif -//#ifndef M_MATHMODULE_H_ - diff --git a/plugins/ExternalAPI/m_autoreplacer.h b/plugins/ExternalAPI/m_autoreplacer.h deleted file mode 100644 index a169edb10c..0000000000 --- a/plugins/ExternalAPI/m_autoreplacer.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - AutoReplacer plugin - by Angelo Luiz Tartari -*/ - -#ifndef M_AUTOREPLACER_H -#define M_AUTOREPLACER_H - -/* - Adds a window handle to AutoReplacer. - This handle must belong to any window based on a editbox (editbox, richtext, TMemo, TEdit, TMaskEdit, etc.). - After adding a handle, AutoReplacer will automatically work on this window. - wParam = 0 - lParam = (LPARAM)(HWND)hwnd - Returns: 0 on success, -1 if hwnd is invalid, 1 on error. - Example: - if(ServiceExists(MS_AUTOREPLACER_ADDWINHANDLE)) - autoreplacer_AddWinHandle(GetDlgItem(hwndDlg, IDC_EDIT1)); -*/ -#define MS_AUTOREPLACER_ADDWINHANDLE "AutoReplacer/AddWinHandle" -static int __inline autoreplacer_AddWinHandle(HWND hwnd) { - return (int)CallService(MS_AUTOREPLACER_ADDWINHANDLE, 0, (LPARAM)hwnd); -} - -/* - Removes a window handle from AutoReplacer's list. - wParam = 0 - lParam = (LPARAM)(HWND)hwnd - Returns: 0 on success, -1 if hwnd is invalid, 1 if hwnd wasn't found. - Example: - if(ServiceExists(MS_AUTOREPLACER_REMWINHANDLE)) - autoreplacer_RemWinHandle(GetDlgItem(hwndDlg, IDC_EDIT1)); -*/ -#define MS_AUTOREPLACER_REMWINHANDLE "AutoReplacer/RemWinHandle" -static int __inline autoreplacer_RemWinHandle(HWND hwnd) { - return (int)CallService(MS_AUTOREPLACER_REMWINHANDLE, 0, (LPARAM)hwnd); -} - -#endif \ No newline at end of file diff --git a/plugins/ExternalAPI/m_db3xsa.h b/plugins/ExternalAPI/m_db3xsa.h deleted file mode 100644 index f1e5334fc4..0000000000 --- a/plugins/ExternalAPI/m_db3xsa.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - -Miranda NG: the free IM client for Microsoft* Windows* - -Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org), -Copyright (c) 2000-07 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -*/ - -/* DB/SetPassword v0.5.1.3+ -This service is used to set, change or clear the password used for encrypting the profile. -It opens the password change dialog. -wParam=0 -lParam=0 -*/ -#define MS_DB_SETPASSWORD "DB/SetPassword" - -/* DB/Backup v0.5.1.3+ -This service will make a backup of your current profile. Backups are named - xx.bak where xx is the number of backups. The larger the number, the -older the backup. -wParam=0 -lParam=0 -*/ -#define MS_DB_BACKUP "DB/Backup" - -/* DB/Backup v0.5.1.3+ -This service is the trigger action service and does the same as the service above. -Only difference is wParam carries flags from trigger plugin. -wParam=flags -lParam=0 -*/ -#define MS_DB_BACKUPTRIGGER "DB/BackupTriggerAct" - -/* DB/GetProfilePath( W ) v0.5.1.5+ -Gets the path of the profile currently being used by the database module. This -path does not include the last '\'. It is appended with the profile's name if -ProfileSubDir=yes is set in the mirandaboot.ini. - wParam=( WPARAM )( int )cbName - lParam=( LPARAM )( char* )pszName -pszName is a pointer to the buffer that receives the path of the profile -cbName is the size in bytes of the pszName buffer -Returns 0 on success or nonzero otherwise -*/ -#define MS_DB_GETPROFILEPATHW "DB/GetProfilePathW" - - -/* DB/GetProfilePathBasic( W ) v0.5.1.5+ -Gets the path of the profile currently being used by the database module. This -path does not include the last '\'. This is never appended with the profile's name. - wParam=( WPARAM )( int )cbName - lParam=( LPARAM )( char* )pszName -pszName is a pointer to the buffer that receives the path of the profile -cbName is the size in bytes of the pszName buffer -Returns 0 on success or nonzero otherwise -*/ -#define MS_DB_GETPROFILEPATH_BASIC "DB/GetProfilePathBasic" -#define MS_DB_GETPROFILEPATH_BASICW "DB/GetProfilePathBasicW" - -/* Utils/PathToAbsolute( W ) v0.5.1.5+ -This service routine expands all environment variables of a path string. -It supports: -%MIRANDAPATH% - expands to the installation folder of miranda, -%PROFILEPATH% - expands to the folder the current profile is stored in, -%PROFILENAME% - expands to the name of the current profile, -and all windows like environment variables such as: -%USERPROFILE%, %WINDIR%, ... -It returns the length of the absolute path in characters on success or -0 if any of the environment variables was not translated. -wParam=relative source path ( must be smaller than MAX_PATH ) -lParam=absolute destination path ( must be larger or equal to MAX_PATH ) -*/ -#define MIRANDAPATH "%MIRANDAPATH%" -#define MIRANDAPATHW L"%MIRANDAPATH%" -#define PROFILEPATH "%PROFILEPATH%" -#define PROFILEPATHW L"%PROFILEPATH%" -#define PROFILENAME "%PROFILENAME%" -#define PROFILENAMEW L"%PROFILENAME%" - -#ifndef MS_UTILS_PATHTOABSOLUTE - #define MS_UTILS_PATHTOABSOLUTE "Utils/PathToAbsolute" -#endif -#define MS_UTILS_PATHTOABSOLUTEW "Utils/PathToAbsoluteW" - -/* Utils/PathToRelative( W ) v0.5.1.5+ -This service parses the given absolute path and translates it to a string -containing as much environment variables as possible. -The return value is the length of the relative path in characters. -wParam=absolute source path ( must be smaller than MAX_PATH ) -lParam=relative destination path ( must be larger or equal to MAX_PATH ) -*/ -#ifndef MS_UTILS_PATHTORELATIVE - #define MS_UTILS_PATHTORELATIVE "Utils/PathToRelative" -#endif -#define MS_UTILS_PATHTORELATIVEW "Utils/PathToRelativeW" - -/* Unicode/Multibyte wrapping via TCHAR -*/ -#ifdef _UNICODE - #define MS_UTILS_PATHTOABSOLUTET MS_UTILS_PATHTOABSOLUTEW - #define MS_UTILS_PATHTORELATIVET MS_UTILS_PATHTORELATIVEW -#else - #define MS_UTILS_PATHTOABSOLUTET MS_UTILS_PATHTOABSOLUTE - #define MS_UTILS_PATHTORELATIVET MS_UTILS_PATHTORELATIVE -#endif \ No newline at end of file diff --git a/plugins/ExternalAPI/m_dbx_tree.h b/plugins/ExternalAPI/m_dbx_tree.h deleted file mode 100644 index 073f56043b..0000000000 --- a/plugins/ExternalAPI/m_dbx_tree.h +++ /dev/null @@ -1,684 +0,0 @@ -/* - -dbx_tree: tree database driver for Miranda IM - -Copyright 2007-2010 Michael "Protogenes" Kunz, - -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. - -*/ - -#ifndef M_DBX_TREE_H__ - -#define M_DBX_TREE_H__ 1 - -#include -#pragma pack(push, 8) - - -/** - \brief general return value if invalid param or invalid combination of params specified -**/ -static const unsigned int DBT_INVALIDPARAM = 0xFFFFFFFF; - - -/////////////////////////////////////////////////////////// -// Entities -/////////////////////////////////////////////////////////// - -/** - \brief A handle to a Entity -**/ -typedef uint32_t TDBTEntityHandle; - -static const uint32_t DBT_NF_IsRoot = 0x00000001; /// Entity is the Root -static const uint32_t DBT_NF_IsGroup = 0x00000002; /// Entity is a group -static const uint32_t DBT_NF_IsAccount = 0x00000004; /// Entity is an account - -static const uint32_t DBT_NF_HasChildren = 0x00010000; /// Entity has Children (for Groups and Metacontacts) -static const uint32_t DBT_NF_HasVirtuals = 0x00020000; /// Entity has at least one Virtual duplicate -static const uint32_t DBT_NF_IsVirtual = 0x00040000; /// Entity is a Virtual duplicate - -static const uint32_t DBT_NFM_SpecialEntity = DBT_NF_IsRoot | DBT_NF_IsGroup | DBT_NF_IsAccount | DBT_NF_IsVirtual; - -/////////////////////////////////////////////////////////// -// Entities -/////////////////////////////////////////////////////////// - -/** - \brief - \param wParam = 0 - \param lParam = 0 - - \return Handle to root Entity -**/ -#define MS_DBT_ENTITY_GETROOT "DBT/Entity/GetRoot" - - -/** - \brief - \param wParam = hEntity - \param lParam = 0 - - \return ChildCount of specified Entity -**/ -#define MS_DBT_ENTITY_CHILDCOUNT "DBT/Entity/ChildCount" - - -/** - \brief - \param wParam = hEntity - \param lParam = 0 - - \return Parent hEntity of specified Entity -**/ -#define MS_DBT_ENTITY_GETPARENT "DBT/Entity/GetParent" - - -/** - \brief - \param wParam = hEntity - \param lParam = hNewEntity - - \return 0 on success -**/ -#define MS_DBT_ENTITY_MOVE "DBT/Entity/Move" - -/** - \brief - \param wParam = hEntity - \param lParam = hNewParent -**/ -#define ME_DBT_ENTITY_MOVING "DBT/Entity/Moving" -/** - \brief - \param wParam = hEntity - \param lParam = hOldParent -**/ -#define ME_DBT_ENTITY_MOVED "DBT/Entity/Moved" - -/** - \brief Read the flags of an Entity - \param wParam = hEntity - \param lParam = 0 - - \return Flags -**/ -#define MS_DBT_ENTITY_GETFLAGS "DBT/Entity/GetFlags" - - - -static const uint32_t DBT_NIFO_OSC_AC = 0x00000001; /// onStartEntity - AddChildren -static const uint32_t DBT_NIFO_OSC_AP = 0x00000002; /// onStartEntity - AddParent -static const uint32_t DBT_NIFO_OSC_AO = 0x00000004; /// onStartEntity - AddOriginal (only if Entity is virtual) -static const uint32_t DBT_NIFO_OSC_AOC = 0x00000008 | DBT_NIFO_OSC_AO; /// onStartEntity - AddOriginalChildren (only if Entity is virtual) -static const uint32_t DBT_NIFO_OSC_AOP = 0x00000010 | DBT_NIFO_OSC_AO; /// onStartEntity - AddOriginalParent (only if Entity is virtual) -static const uint32_t DBT_NIFO_OSC_USEACCOUNT = 0x00000080; /// onStartEntity - use Account as fallback, only for settings - -static const uint32_t DBT_NIFO_OC_AC = 0x00000001 <<8; /// onChildEntity - AddChildren -//static const uint32_t DBT_LC_OC_AP = 0x00000002 <<8; /// invalid for children -static const uint32_t DBT_NIFO_OC_AO = 0x00000004 <<8; /// onChildEntity - AddOriginal (only if Entity is virtual) -static const uint32_t DBT_NIFO_OC_AOC = 0x00000008 <<8 | DBT_NIFO_OC_AO; /// onChildEntity - AddOriginalChildren (only if Entity is virtual) -static const uint32_t DBT_NIFO_OC_AOP = 0x00000010 <<8 | DBT_NIFO_OC_AO; /// onChildEntity - AddOriginalParent (only if Entity is virtual) -static const uint32_t DBT_NIFO_OC_USEACCOUNT = 0x00000080 <<8; /// onStartEntity - use Account as fallback, only for settings - -static const uint32_t DBT_NIFO_OP_AC = 0x00000001 <<16; /// onParentEntity - AddChildren -static const uint32_t DBT_NIFO_OP_AP = 0x00000002 <<16; /// onParentEntity - AddParent -static const uint32_t DBT_NIFO_OP_AO = 0x00000004 <<16; /// onParentEntity - AddOriginal (only if Entity is virtual) -static const uint32_t DBT_NIFO_OP_AOC = 0x00000008 <<16 | DBT_NIFO_OP_AO; /// onParentEntity - AddOriginalChildren (only if Entity is virtual) -static const uint32_t DBT_NIFO_OP_AOP = 0x00000010 <<16 | DBT_NIFO_OP_AO; /// onParentEntity - AddOriginalParent (only if Entity is virtual) -static const uint32_t DBT_NIFO_OP_USEACCOUNT = 0x00000080 <<16; /// onStartEntity - use Account as fallback, only for settings - -static const uint32_t DBT_NIFO_GF_DEPTHFIRST = 0x01000000; /// general flags - depth first iteration instead of breath first -static const uint32_t DBT_NIFO_GF_USEROOT = 0x02000000; /// general flags - use root as fallback, only for settings -static const uint32_t DBT_NIFO_GF_VL1 = 0x10000000; /// general flags - limit virtual lookup depth to 1 -static const uint32_t DBT_NIFO_GF_VL2 = 0x20000000; /// general flags - limit virtual lookup depth to 2 -static const uint32_t DBT_NIFO_GF_VL3 = 0x30000000; /// general flags - limit virtual lookup depth to 3 -static const uint32_t DBT_NIFO_GF_VL4 = 0x40000000; /// general flags - limit virtual lookup depth to 4 - -/** - \brief Entityfilter options for Entity iteration -**/ -typedef - struct TDBTEntityIterFilter - { - uint32_t cbSize; /// size of the structur in bytes - uint32_t Options; /// Options for iteration: DB_EIFO_* - uint32_t fHasFlags; /// flags an Entity must have to be iterated - uint32_t fDontHasFlags; /// flags an Entity have not to have to be iterated - } TDBTEntityIterFilter, *PDBTEntityIterFilter; - -/** - \brief Handle of an Entity-Iteration -**/ -typedef uintptr_t TDBTEntityIterationHandle; -/** - \brief initialize an iteration of Entities - \param wParam = PDBTEntityIterFilter, NULL to iterate all Entities (breadthfirst, all but root) - \param lParam = TDBTEntityHandle Entity, where iteration starts - - \return EnumID -**/ -#define MS_DBT_ENTITY_ITER_INIT "DBT/Entity/Iter/Init" - - -/** - \brief get the next Entity - \param wParam = EnumID returned by MS_DBT_ENTITY_ITER_INIT - \param lParam = 0 - - \return hEntity, 0 at the end -**/ -#define MS_DBT_ENTITY_ITER_NEXT "DBT/Entity/Iter/Next" - -/** - \brief closes an iteration and frees its ressourcs - \param wParam = IterationHandle returned by MS_DBT_ENTITY_ITER_INIT - \param lParam = 0 - - \return 0 on success -**/ -#define MS_DBT_ENTITY_ITER_CLOSE "DBT/Entity/Iter/Close" - -/** - \brief Deletes an Entity. - - All children will be moved to its parent. - If the Entity has virtual copies, history and settings will be transfered to the first duplicate. - - \param wParam = hEntity - \param lParam = 0 - - \return 0 on success -**/ -#define MS_DBT_ENTITY_DELETE "DBT/Entity/Delete" - - -typedef struct TDBTEntity -{ - uint32_t bcSize; - TDBTEntityHandle hParentEntity; - uint32_t fFlags; /// Flags DBT_NF_ - TDBTEntityHandle hAccountEntity; /// Needed for normal Entities, reference to AccountEntity for the created one -} TDBTEntity, *PDBTEntity; - -/** - \brief Creates a new Entity. - \param wParam = PDBTEntity - \param lParam = 0 - - \return hEntity on success, 0 otherwise -**/ -#define MS_DBT_ENTITY_CREATE "DBT/Entity/Create" - - -/** - \brief returns the account entity handle specified during creation - \param wParam = TDBTEntityHandle - \param lParam = 0 - - \return hEntity on success, 0 otherwise -**/ -#define MS_DBT_ENTITY_GETACCOUNT "DBT/Entity/GetAccount" - - -/////////////////////////////////////////////////////////// -// Virtual Entities -/////////////////////////////////////////////////////////// - -/** - \brief Creates a virtual duplicate of an Entity - \param wParam = hEntity to duplicate, couldn't be a group (DBT_NF_IsGroup set to 0) - \param lParam = hParentEntity to place duplicate - - \return hEntity of created duplicate -**/ -#define MS_DBT_VIRTUALENTITY_CREATE "DBT/VirtualEntity/Create" - -/** - \brief Retrieves the original Entity, which this is a duplicate of - \param wParam = hEntity of virtual Entity - \param lParam = 0 - - \return hEntity of original Entity -**/ -#define MS_DBT_VIRTUALENTITY_GETPARENT "DBT/VirtualEntity/GetParent" - -/** - \brief Retrieves the first virtual duplicate of an Entity (if any) - \param wParam = hEntity with virtual copies - \param lParam - - \return hEntity of first virtual duplicate -**/ -#define MS_DBT_VIRTUALENTITY_GETFIRST "DBT/VirtualEntity/GetFirst" - -/** - \brief Retrieves the following duplicate - \param wParam = hVirtualEntity of virtual Entity - \param lParam = 0 - - \return hEntity of next duplicate, 0 if hVirtualEntity was the last duplicate -**/ -#define MS_DBT_VIRTUALENTITY_GETNEXT "DBT/VirtualEntity/GetNext" - - -/////////////////////////////////////////////////////////// -// Settings -/////////////////////////////////////////////////////////// - -/** - \brief Handle of a Setting -**/ -typedef uint32_t TDBTSettingHandle; - - -static const uint16_t DBT_ST_BYTE = 0x01; -static const uint16_t DBT_ST_WORD = 0x02; -static const uint16_t DBT_ST_DWORD = 0x03; -static const uint16_t DBT_ST_QWORD = 0x04; - -static const uint16_t DBT_ST_CHAR = 0x11; -static const uint16_t DBT_ST_SHORT = 0x12; -static const uint16_t DBT_ST_INT = 0x13; -static const uint16_t DBT_ST_INT64 = 0x14; - -static const uint16_t DBT_ST_BOOL = 0x20; -static const uint16_t DBT_ST_FLOAT = 0x21; -static const uint16_t DBT_ST_DOUBLE = 0x22; - -static const uint16_t DBT_ST_ANSI = 0xff; -static const uint16_t DBT_ST_BLOB = 0xfe; -static const uint16_t DBT_ST_UTF8 = 0xfd; -static const uint16_t DBT_ST_WCHAR = 0xfc; - -#if (defined(_UNICODE) || defined(UNICODE)) - static const uint16_t DBT_ST_TCHAR = DBT_ST_WCHAR; -#else - static const uint16_t DBT_ST_TCHAR = DBT_ST_ANSI; -#endif - -static const uint16_t DBT_STF_Signed = 0x10; -static const uint16_t DBT_STF_VariableLength = 0x80; - - - -static const uint32_t DBT_SDF_FoundValid = 0x00000001; -static const uint32_t DBT_SDF_HashValid = 0x00000002; - -/** - \brief Describes a setting, its name and location -**/ -typedef - struct TDBTSettingDescriptor { - uint32_t cbSize; /// size of the structure in bytes - TDBTEntityHandle Entity; /// Entityhandle where the setting can be found, or where searching starts - char * pszSettingName; /// Setting name - uint32_t Options; /// options describing where the setting can be found DBT_NIFO_* - uint32_t Flags; /// Valid Flags. DBT_SDF_* describes which following values are valid (internal use) - - TDBTEntityHandle FoundInEntity; /// internal use to avoid to do the searching twice - uint32_t Hash; /// internal used HashValue for settingname - TDBTSettingHandle FoundHandle; /// internal used SettingHandle - } TDBTSettingDescriptor, * PDBTSettingDescriptor; - -/** - \brief Describes a settings value - - it is never used alone, without a type qualifier -**/ -typedef - union TDBTSettingValue { - bool Bool; - int8_t Char; uint8_t Byte; - int16_t Short; uint16_t Word; - uint32_t Int; uint32_t DWord; - int64_t Int64; uint64_t QWord; - float Float; - double Double; - - struct { - uint32_t Length; // length in bytes of pBlob, length in characters of char types including trailing null - union { - uint8_t * pBlob; - char * pAnsi; - char * pUTF8; - wchar_t * pWide; - TCHAR * pTChar; - }; - }; - } TDBTSettingValue; - -/** - \brief Describes a setting -**/ -typedef - struct TDBTSetting { - uint32_t cbSize; /// size of the structure in bytes - PDBTSettingDescriptor Descriptor; /// pointer to a Setting descriptor used to locate the setting - uint16_t Type; /// type of the setting, see DBT_ST_* - TDBTSettingValue Value; /// Value of the setting according to Type - } TDBTSetting, * PDBTSetting; - - - -/** - \brief retrieves the handle of the setting - \param wParam = PDBTSettingDescriptor - \param lParam = 0 - - \return hSetting when found, 0 otherwise -**/ -#define MS_DBT_SETTING_FIND "DBT/Setting/Find" - - -/** - \brief deletes the specified Setting - \param wParam = PDBTSettingDescriptor - \param lParam = 0 - - \return hSetting when found, 0 otherwise -**/ -#define MS_DBT_SETTING_DELETE "DBT/Setting/Delete" - -/** - \brief deletes the specified Setting - \param wParam = TDBTSettingHandle - \param lParam = 0 - - \return 0 on success -**/ -#define MS_DBT_SETTING_DELETEHANDLE "DBT/Setting/DeleteHandle" - - -/** - \brief Write a setting (and creates it if neccessary) - \param wParam = PDBTSetting - \param lParam = 0 - - \return TDBTSettingHandle on success, 0 otherwise -**/ -#define MS_DBT_SETTING_WRITE "DBT/Setting/Write" - -/** - \brief retrieves the handle of the setting - \param wParam = PDBTSetting - \param lParam = TDBTSettingHandle, could be 0 to create new setting, but needs wParam->Descriptor with valid data - - \return hSetting when found or created, 0 otherwise -**/ -#define MS_DBT_SETTING_WRITEHANDLE "DBT/Setting/WriteHandle" - -/** - \brief retrieves the value of the setting - \param wParam = PDBTSetting - \param lParam = 0 - - \return SettingHandle -**/ -#define MS_DBT_SETTING_READ "DBT/Setting/Read" - -/** - \brief retrieves the value of the setting - - Also retrieves the SettingDescriptor if it is set and prepared correctly (name buffers set etc) - \param wParam = PDBTSetting - \param lParam = TDBTSettingHandle - - \return original settings type -**/ -#define MS_DBT_SETTING_READHANDLE "DBT/Setting/ReadHandle" - - - -/** - \brief Settings Filter Options for setting iteration -**/ -typedef - struct TDBTSettingIterFilter { - uint32_t cbSize; /// size in bytes of this structure - uint32_t Options; /// DBT_NIFO_* flags - TDBTEntityHandle hEntity; /// hEntity which settings should be iterated (or where iteration begins) - char * NameStart; /// if set != NULL the iteration will only return settings which name starts with this string - uint32_t ExtraCount; /// count of additional Entities which settings are enumerated, size of the array pointed by ExtraEntities - TDBTEntityHandle * ExtraEntities; /// pointer to an array with additional Entity handles in prioritized order - - PDBTSettingDescriptor Descriptor; /// if set, the iteration will fill in the correct data, you may set SettingsNameLength and SettingName to a buffer to recieve the name of each setting - PDBTSetting Setting; /// if set, iteration loads every settings value, except variable length data (blob, strings) but returns their length - - } TDBTSettingIterFilter, *PDBTSettingIterFilter; - - -/** - \brief Handle of a Setting-Iteration -**/ -typedef uintptr_t TDBTSettingIterationHandle; -/** - \brief initialize an iteration of settings - \param wParam = PDBTSettingIterFilter - \param lParam = 0 - - \return EnumID -**/ -#define MS_DBT_SETTING_ITER_INIT "DBT/Setting/Iter/Init" - - -/** - \brief get the next setting - \param wParam = EnumID returned by MS_DBT_SETTING_ITER_INIT - \param lParam = 0 - - \return hSetting, 0 at the end -**/ -#define MS_DBT_SETTING_ITER_NEXT "DBT/Setting/Iter/Next" - -/** - \brief closes an iteration and frees its ressourcs - \param wParam = IterationHandle returned by MS_DBT_SETTING_ITER_INIT - \param lParam = 0 - - \return 0 on success -**/ -#define MS_DBT_SETTING_ITER_CLOSE "DBT/Setting/Iter/Close" - - -/////////////////////////////////////////////////////////// -// Events -/////////////////////////////////////////////////////////// - -typedef uint32_t TDBTEventHandle; - - -/** - \brief this event was sent by the user. If not set this event was received. -**/ -static const uint32_t DBT_EF_SENT = 0x00000002; - -/** - \brief event has been read by the user. It does not need to be processed any more except for history. -**/ -static const uint32_t DBT_EF_READ = 0x00000004; - -/** - \brief event contains the right-to-left aligned text -**/ -static const uint32_t DBT_EF_RTL = 0x00000008; - -/** - \brief event contains a text in utf-8 -**/ -static const uint32_t DBT_EF_UTF = 0x00000010; - -/** - \brief event is virtual. it is not stored to db file yet. -**/ -static const uint32_t DBT_EF_VIRTUAL = 0x00000020; - -/** - \brief describes an event -**/ -typedef struct TDBTEvent { - uint32_t cbSize; /// size of the structure in bytes - char * ModuleName; /// - uint32_t Timestamp; /// seconds since 00:00, 01/01/1970. Gives us times until 2106 unless you use the standard C library which is signed and can only do until 2038. In GMT. - uint32_t Flags; /// the omnipresent flags - uint32_t EventType; /// module-unique event type ID - uint32_t cbBlob; /// size of pBlob in bytes - uint8_t * pBlob; /// pointer to buffer containing module-defined event data -} TDBTEvent, *PDBTEvent; - -static const uint32_t DBT_EventType_Message = 0; -static const uint32_t DBT_EventType_URL = 1; -static const uint32_t DBT_EventType_Contacts = 2; -static const uint32_t DBT_EventType_Added = 1000; -static const uint32_t DBT_EventType_AuthRequest = 1001; //specific codes, hence the module- -static const uint32_t DBT_EventType_File = 1002; //specific limit has been raised to 2000 - - -/** - \brief retrieves the blobsize of an event in bytes - \param wParam = hEvent - \param lParam = 0 - - \return blobsize -**/ -#define MS_DBT_EVENT_GETBLOBSIZE "DBT/Event/GetBlobSize" - - - -/** - \brief retrieves all information of an event - \param wParam = hEvent - \param lParam = PDBTEvent - - \return 0 on success -**/ -#define MS_DBT_EVENT_GET "DBT/Event/Get" - -/** - \brief retrieves all information of an event - \param wParam = hEntity - \param lParam = 0 - - \return Event count of specified Entity on success, DBT_INVALIDPARAM on error -**/ -#define MS_DBT_EVENT_GETCOUNT "DBT/Event/GetCount" - - -/** - \brief Deletes the specfied event - \param wParam = hEntity - \param lParam = hEvent - - \return 0 on success -**/ -#define MS_DBT_EVENT_DELETE "DBT/Event/Delete" - -/** - \brief Creates a new Event - \param wParam = hEntity - \param lParam = PDBTEvent - - \return hEvent on success, 0 otherwise -**/ - -#define MS_DBT_EVENT_ADD "DBT/Event/Add" - - -/** - \brief Changes the flags for an event to mark it as read. - \param wParam = hEntity - \param lParam = hEvent - - \return New flags -**/ -#define MS_DBT_EVENT_MARKREAD "DBT/Event/MarkRead" - -/** - \brief Saves a virtual event to file and changes the flags. - \param wParam = hEntity - \param lParam = hEvent - - \return 0 on success -**/ -#define MS_DBT_EVENT_WRITETODISK "DBT/Event/WriteToDisk" - -/** - \brief Retrieves a handle to a Entity that owns hEvent. - \param wParam = hEvent - \param lParam = 0 - - \return NULL is a valid return value, meaning, as usual, the user. - DBT_INVALIDPARAM if hDbEvent is invalid, or the handle to the Entity on - success -**/ -#define MS_DBT_EVENT_GETENTITY "DBT/Event/GetEntity" - -/** - \brief Event Filter Options for event iteration -**/ -typedef - struct TDBTEventIterFilter { - uint32_t cbSize; /// size in bytes of this structure - uint32_t Options; /// DBT_NIFO_* flags - TDBTEntityHandle hEntity; /// hEntity which events should be iterated (or where iteration begins) - uint32_t ExtraCount; /// count of additional Entities which settings are enumerated, size of the array pointed by ExtraEntities - TDBTEntityHandle * ExtraEntities; /// pointer to an array with additional Entity handles in prioritized order - - uint32_t tSince; /// timestamp when to start iteration, 0 for first item - uint32_t tTill; /// timestamp when to stop iteration, 0 for last item - - PDBTEvent Event; /// if set every events data gets stored there - - } TDBTEventIterFilter, *PDBTEventIterFilter; - - -/** - \brief Handle of a Event-Iteration -**/ -typedef uintptr_t TDBTEventIterationHandle; -/** - \brief initialize an iteration of events - \param wParam = PDBTEventIterFilter - \param lParam = 0 - - \return EnumID -**/ -#define MS_DBT_EVENT_ITER_INIT "DBT/Event/Iter/Init" - - -/** - \brief get the next event - \param wParam = EnumID returned by MS_DBT_EVENT_ITER_INIT - \param lParam = 0 - - \return hSetting, 0 at the end -**/ -#define MS_DBT_EVENT_ITER_NEXT "DBT/Event/Iter/Next" - -/** - \brief closes an iteration and frees its resourcs - \param wParam = IterationHandle returned by MS_DBT_EVENT_ITER_INIT - \param lParam = 0 - - \return 0 on success -**/ -#define MS_DBT_EVENT_ITER_CLOSE "DBT/Event/Iter/Close" - - - -#pragma pack(pop) - -#endif diff --git a/plugins/ExternalAPI/m_fortunemsg.h b/plugins/ExternalAPI/m_fortunemsg.h deleted file mode 100644 index bf13dc422c..0000000000 --- a/plugins/ExternalAPI/m_fortunemsg.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - -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. - -*/ - -#ifndef _FORTUNEMSG_ -#define _FORTUNEMSG_ - -#define MIN_FORTUNEMSG 10 -#define MAX_FORTUNEMSG 1024 -#define FORTUNE_BUFSIZE (MAX_FORTUNEMSG + 1) - -//returns the fortune message (from a random file) -//wParam=0 -//lParam=(char *)buffer or 0 -//returns (char *)status msg (buffer if specified), or 0 on failure -//If lParam != 0 then the fortune msg is to be stored there, make sure -//its length is at least equal to FORTUNE_BUFSIZE. If lParam == 0, then -//the plugin will allocate the memory, but don't forget to free it (the -//return value) using MS_FORTUNEMSG_FREEMEMORY (but only if you specify lParam=0!!!) -#define MS_FORTUNEMSG_GETMESSAGE "FortuneMsg/GetMessage" - -//returns the fortune message for a protocol -//wParam=(char*)szProtoName -//lParam=(char *)buffer or 0 -//returns (char *)status msg (buffer if specified), or 0 on failure -//If lParam != 0 then the fortune msg is to be stored there, make sure -//its length is at least equal to FORTUNE_BUFSIZE. If lParam == 0, then -//the plugin will allocate the memory, but don't forget to free it (the -//return value) using MS_FORTUNEMSG_FREEMEMORY (but only if you specify lParam=0!!!) -#define MS_FORTUNEMSG_GETPROTOMSG "FortuneMsg/GetProtoMessage" - -//returns the fortune status message for a status -//wParam=(int)status -//lParam=(char *)buffer or 0 -//returns (char *)status msg (buffer if specified), or 0 on failure -//If lParam != 0 then the fortune msg is to be stored there, make sure -//its length is at least equal to FORTUNE_BUFSIZE. If lParam == 0, then -//the plugin will allocate the memory, but don't forget to free it (the -//return value) using MS_FORTUNEMSG_FREEMEMORY (but only if you specify lParam=0!!!) -#define MS_FORTUNEMSG_GETSTATUSMSG "FortuneMsg/GetStatusMessage" - -//frees the memory allocated by one of the other three services -//wParam=0 -//lParam=(void *)pointer to the memory to be freed -//(the returned value from one of the other three services if called with lParam=0) -//return value: 0 on success, -1 on failure (argument was NULL) -#define MS_FORTUNEMSG_FREEMEMORY "FortuneMsg/FreeMemory" - - -//this service was created for being used by Variables plugin -//wParam=0 -//lParam=(ARGUMENTSINFO *) see m_variables.h for description of the structure -//returns (char *)status msg, or 0 on failure -#define MS_FORTUNEMSG_FROMVARIABLES "FortuneMsg/FromVariables" - - -#endif diff --git a/plugins/ExternalAPI/m_hddinfo.h b/plugins/ExternalAPI/m_hddinfo.h deleted file mode 100644 index 3f529ec1ff..0000000000 --- a/plugins/ExternalAPI/m_hddinfo.h +++ /dev/null @@ -1,6 +0,0 @@ -#define MS_SYSINFO_HDDTEMP "SysInfo/HddTemp" - // checks current hdd temperature -#define MS_SYSINFO_CUSTPOP "SysInfo/CustomPopup" - //shows special custom popup -#define ME_SYSINFO_HDDOVERHEAT "SysInfo/HddOverheat" - // happens if one ot the drives has current temperature higher than set as normal diff --git a/plugins/ExternalAPI/m_help.h b/plugins/ExternalAPI/m_help.h deleted file mode 100644 index ea8557628c..0000000000 --- a/plugins/ExternalAPI/m_help.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - -Miranda IM Help Plugin -Copyright (C) 2002 Richard Hughes, 2005-2007 H. Herkenrath - -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 (Help-License.txt); if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef M_HELP_H__ -#define M_HELP_H__ - -/* - Help Plugin 0.2.1.2 - All services in here except MS_HELP_SHOWLANGDIALOG should be thread-safe, - you can call them from any thread -*/ - -/* interface id */ -#if !defined(MIID_HELP) - #define MIID_HELP {0x302660c5,0x1bf6,0x4054,{0xa7,0x9f,0x77,0xb1,0x96,0x5d,0x6f,0x48}} -#endif - -/* Enable/disable the help context menu for a specific control. v0.2.0.0+ -Note: You normally do not need to call this, read below. -You can can use this to deactivate the appearance of the help context menu -being shown when the user right clicks on an control. -You can use this service to disable the context menu. - -You do *not* need to use this service when you would like to show -a context menu by yourself, just handle WM_CONTEXTMENU correctly instead. -You need to return TRUE in your DlgProc or 0 in your WndProc, indicating 'message handled'. - -The context menu is disabled by default on the following controls (looks silly on multi-component controls): -ListView, TreeView, Statusbar, Toolbar, CLC -AutoTips are disabled by default for controls stating DLGC_WANTALLKEYS or DLGC_HASSETSEL at -WM_GETDLGCODE (autotips are annoying on edits). - wParam=(WPARAM)(HWND)hwndCtl - lParam=(LPARAM)flags (see below) -Returns 0 on success or nonzero on failure -*/ -#define MS_HELP_SETCONTEXTSTATE "Help/SetContextState" -#define HCSF_CONTEXTMENU 0x01 // show help context menu for this control -#define HCSF_AUTOTIP 0x02 // show automatic help tip on hover for this control - // only works for non-editable -#if !defined(HELP_NOHELPERFUNCTIONS) -__inline static int Help_SetContextState(HWND hwndCtl,DWORD flags) { - if (!ServiceExists(MS_HELP_SETCONTEXTSTATE)) return -1; - return CallService(MS_HELP_SETCONTEXTSTATE,(WPARAM)hwndCtl,flags); -} -#endif - -/* Show a help tooltip for a specific control or dialog. v0.2.0.0+ -You can call this if you would like to show help at a specific time. - wParam=(WPARAM)(HWND)hwndCtl - lParam=0 (unused) -Returns 0 on success or nonzero on failure. -The service fails when the help tooltip cannot be instantiated. -*/ -#define MS_HELP_SHOWHELP "Help/ShowHelp" - -/* Show the download language dialog. v0.2.1.0+ - wParam=lParam=0 -The dialog can't have a parent due to it's asynchronous nature. -If the language window is already opened it will be -brought to front instead (returns success). -Returns 0 on success, nonzero otherwise. -*/ -#define MS_HELP_SHOWLANGDIALOG "Help/ShowLangDialog" - - -#ifndef HELP_NOSETTINGS -#define SETTING_AUTOTIPSENABLED_DEFAULT 0 -#define SETTING_AUTOTIPDELAY_DEFAULT 4000 -#define SETTING_ENABLEHELPUPDATES_DEFAULT 1 -#endif - -#endif // M_HELP_H__ diff --git a/plugins/ExternalAPI/m_icqplus.h b/plugins/ExternalAPI/m_icqplus.h deleted file mode 100755 index 30c5b44a82..0000000000 --- a/plugins/ExternalAPI/m_icqplus.h +++ /dev/null @@ -1,92 +0,0 @@ -// ---------------------------------------------------------------------------80 -// ICQ plugin for Miranda Instant Messenger -// ________________________________________ -// -// Copyright © 2000,2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede -// Copyright © 2001,2002 Jon Keating, Richard Hughes -// Copyright © 2002,2003,2004 Martin Öberg, Sam Kothari, Robert Rainwater -// Copyright © 2004,2005,2006,2007 Joe Kucera -// -// 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. - - -#ifndef M_ICQPLUS_H__ -#define M_ICQPLUS_H__ 1 - -/*#define PS_ICQP_SERVER_IGNORE "/ServerIgnore" - -#define MS_INCOGNITO_REQUEST "/IncognitoRequest" - - -#define MS_TZER_DIALOG "/TzerDialog" -//Send tzer -//wParam=(WPARAM)hContact; -//lParam=(int)tZer -#define MS_SEND_TZER "/SendtZer" - - - -*/ - -#define MAX_CAPNAME 64 -typedef struct -{ - int cbSize; - char caps[0x10]; - HANDLE hIcon; - char name[MAX_CAPNAME]; -} ICQ_CUSTOMCAP; - -// Add a custom icq capability. -// wParam = 0; -// lParam = (LPARAM)(ICQ_CUSTOMCAP *)&icqCustomCap; -#define PS_ICQ_ADDCAPABILITY "/IcqAddCapability" - -// Check if capability is supportes. Only icqCustomCap.caps does matter. -// wParam = (WPARAM)(HANDLE)hContact; -// lParam = (LPARAM)(ICQ_CUSTOMCAP *)&icqCustomCap; -// returns non-zero if capability is supported -#define PS_ICQ_CHECKCAPABILITY "/IcqCheckCapability" -/* - -#ifndef ICQ_NOHELPERS -static __inline void IcqBuildMirandaCap(ICQ_CUSTOMCAP *icqCustomCap, const char *name, HICON hIcon, const char *id) -{ - if (!icqCustomCap) return; - icqCustomCap->cbSize = sizeof(*icqCustomCap); - icqCustomCap->hIcon = hIcon; - strncpy(icqCustomCap->name, name, sizeof(icqCustomCap->name))[sizeof(icqCustomCap->name)-1]=0; - memset(icqCustomCap->caps, 0, 0x10); - strncpy(icqCustomCap->caps+0, "Miranda/", 8); - strncpy(icqCustomCap->caps+8, id, 8); -} -#endif*/ - -/* usage: -char icqCustomCapStr[0x10] = {...}; -ICQ_CUSTOMCAP icqCustomCap; -icqCustomCap.cbSize = sizeof(icqCustomCap); -memcpy(icqCustomCap.caps, icqCustomCapStr, 0x10); -lstrcpy(icqCustomCap.name, "Custom Name"); -CallProtoService("ICQ", PS_ICQ_ADDCAPABILITY, 0, (LPARAM)&icqCustomCap); -*/ - -//check user status via ASD -//wParam=(WPARAM)hContact; - -//#define MS_ICQ_GET_USER_STATUS "/IcqGetUserStatus" - - -#endif // M_ICQPLUS_H__ \ No newline at end of file diff --git a/plugins/ExternalAPI/m_ircscript.h b/plugins/ExternalAPI/m_ircscript.h deleted file mode 100644 index ddab3b96bb..0000000000 --- a/plugins/ExternalAPI/m_ircscript.h +++ /dev/null @@ -1,129 +0,0 @@ - -/* - This file is a description of the interface between the Miranda Scripting - Plugin (MSP) and IRC. It is mainly an internal draft. - - The MSP is a powerful PHP based scripting engine - which can automate many tasks in Miranda IM. With the implementation of - this interface IRC can also benefit from the advantages MSP brings. The - interface has been constructed by the respective authors of IRC and MSP. - - The idea is that MSP and IRC should communicate via the interface outlined herein, - but MSP should "package" the data in attractive functions that can be easily - used by eager scripters. - - Note that m_chat.h should be #included as the events defined therein is used in this interface - - The IRC plugin communicates with MSP mainly through 8 (2 x 4) services which are - illustrated by the following matrix (MSP has 4 services and IRC 4 services): - - - -------------------------------------------------- - | | | - | Incoming raw data | Data going | - | from server | to GUI | - | (before processing) | (after processing) | - | | | - -------------------------------------------------- - | | | - | Outgoing raw data | Data going | - | to server | from GUI | - | (after processing) | (before processing) | - | | | - -------------------------------------------------- - - (processing refers to the IRC plugin reacting to different commands) - -*/ - - -//------------------------- HANDLING RAW MESSAGES ------------------------ -/* - - The two leftmost boxes are related to data sent to and from the server in RAW form. - (a typical RAW message looks like this: ":nick!user@host COMMAND PARAMETERS") - - It is very useful for scripters to be able to manipulate and add RAW streams of data. - - The below structure is used when RAW data is generated and IRC must trigger an - event in MSP so the scripts can do their magic. - - If the data is modified make sure to use MS_SYSTEM_GET_MMI and then mmi_realloc() to - allocate from the same heap. Do not free the data. - - wParam= Module name - lParam= (LPARAM)( char* )pszRaw - returns nonzero if the message should be dropped -*/ - -/* - NOTE! IRC will implement two services which also uses the same parameters: - - "/InsertRawIn" //used for inserting a "fake" incoming RAW event - "/InsertRawOut" //used for inserting a "fake" outgoing RAW event - -*/ - - -#define MS_MBOT_IRC_RAW_IN "MBot/IrcRawIn" -#define MS_MBOT_IRC_RAW_OUT "MBot/IrcRawOut" - - -//------------------------- HANDLING GUI MESSAGES 1 ------------------------ -/* - - The top rightmost box is related to data sent to the gui - (currently chat.dll) in the form of GCEVENT's. (see m_chat.h) - - While maybe not as useful to the scripter, it can be useful to be able to - "tap into" messages to the GUI from the IRC plugin. - - If the data is modified make sure to realloc() or similar. - - wParam= (WPARAM) (WPARAM_GUI_IN) &wgi - lParam= (LPARAM)(GCEVENT *)&gce // see m_chat.h - returns nonzero if the message should be dropped -*/ - -/* - NOTE! IRC will implement a service which also uses the same parameters: - - "/InsertGuiIn" //used for inserting a "fake" event to the GUI - -*/ -typedef struct MBOT_GUI_WPARAM_IN_STRUCT -{ - const char* pszModule; - WPARAM wParam; -}WPARAM_GUI_IN; - -#define MS_MBOT_IRC_GUI_IN "MBot/IrcGuiIn" - - -//------------------------- HANDLING GUI MESSAGES 2 ------------------------ -/* - - The bottom rightmost box is related to data sent from the gui - (currently chat.dll) in the form of GCHOOKS's. Originally this is carried out in a hook, - but for MSP this is done via a service instead. - - It can be useful for scripters to simulate user actions, like entering text, closing the window etc - - If the data is modified make sure to realloc() or similar. - - wParam= Module name - lParam= (LPARAM)(GCHOOK *)gch // see m_chat.h - returns nonzero if the message should be dropped -*/ - -/* - NOTE! IRC will implement a service which also uses the same parameters: - - "/InsertGuiOut" //used for inserting a "fake" outgoing event to the GUI - -*/ - -#define MS_MBOT_IRC_GUI_OUT "MBot/IrcGuiOut" - -#define MS_MBOT_REGISTERIRC "MBot/RegisterIRCModule" - diff --git a/plugins/ExternalAPI/m_langman.h b/plugins/ExternalAPI/m_langman.h deleted file mode 100644 index 1a7b5bf9c2..0000000000 --- a/plugins/ExternalAPI/m_langman.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - -'Language Pack Manager'-Plugin for -Miranda NG: the free IM client for Microsoft* Windows* - -Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org), -Copyright (C) 2005-2007 H. Herkenrath - -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 (LangMan-License.txt); if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef M_LANGMAN_H__ -#define M_LANGMAN_H__ - -/* Show the download language dialog. v1.0.2.0+ - wParam=lParam=0 -The dialog can't have a parent due to it's asynchronous nature. -If the language window is already opened it will be -brought to front instead (returns success). -Returns 0 on success, nonzero otherwise. -*/ -#define MS_LANGMAN_SHOWLANGDIALOG "LangMan/ShowLangDialog" - - -#ifndef LANGMAN_NOSETTINGS -#define SETTING_ENABLEAUTOUPDATES_DEFAULT 1 -#endif - -#endif // M_LANGMAN_H diff --git a/plugins/ExternalAPI/m_script.h b/plugins/ExternalAPI/m_script.h deleted file mode 100644 index 2388bbaad1..0000000000 --- a/plugins/ExternalAPI/m_script.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - -Miranda Scripting Plugin for Miranda NG -Copyright 2004-2006 Piotr Pawluczuk (www.pawluczuk.info) - -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. - -*/ -/* -Miranda NG: the free IM client for Microsoft* Windows* - -Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org), -Copyright (c) 2000-03 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -*/ - -#ifndef M_SCRIPT_H__ -#define M_SCRIPT_H__ 1 - -#define MBOT_GETCPARAM(cp) ((void*)((unsigned char*)cp + 24)) - -typedef enum {MBOT_NUMBER=0,MBOT_STRING=1,MBOT_VOID=2}MBOT_TYPE; - -#ifndef _LIBPHP_H__ -enum SVAR_TYPE{SV_NULL,SV_LONG=1,SV_WORD=2,SV_DOUBLE=3, - SV_STRING=4,SV_LPOINTER=5,SV_ARRAY=11}; -#endif - -typedef struct{ - int cbSize; //Set to sizeof(); - char* pszOutput; - char* pszResult; -}MBOT_RESULT; - -struct MBOT_VPARAM{ - void* data; - long length; /*length of data, used for strings, and binary strings*/ - long type; -}; - -/* -MBOT function prototypes; -*/ -typedef int (*MBOT_RegisterFunction)(const char* name,void* fptr,long lp, - MBOT_TYPE rval,MBOT_TYPE p1,MBOT_TYPE p2,MBOT_TYPE p3,MBOT_TYPE p4); -typedef int (*MBOT_UnregisterFunction)(const char* name); - -typedef void* (*MBOT_Malloc)(long amount); -typedef char* (*MBOT_Strdup)(const char* str); -typedef void (*MBOT_Free)(void* ptr); -typedef void (*MBOT_FreeResult)(MBOT_RESULT* ptr); - -typedef int (*MBOT_GetVar)(const char* name,void** value,SVAR_TYPE* cType);//returns TRUE if var exists; -typedef int (*MBOT_DelVar)(const char* name); -typedef int (*MBOT_SetVar)(const char* name,void* value,SVAR_TYPE cType); -typedef int (*MBOT_NewVar)(const char* name,void* value,SVAR_TYPE cType,char locked); - -/******************************************************************* - * PARAMETERS: - pszScript - source code of the script; ***DO NOT USE PHP TAGS*** - pResult - if set, you'll get the struct filled with the result; - NOTE! Remember to release the struct with "fp_freeresult"!; - pCParam - custom parameter, for your own use; use MBOT_GETCPARAM(cparam) to get the pointer; - nCPType - its type {MBOT_NUMBER,MBOT_STRING,MBOT_VOID} if str or num, php will be able to get it too - - *EXAMPLE: - fpExecuteFile("mbot/scripts/my.php","fct1",&mbr,"parameter", - MBOT_STRING,"suf","hello",100,25.6); - *******************************************************************/ -typedef int (*MBOT_ExecuteScript)(const char* pszScript,MBOT_RESULT* pResult, - void* pCParam,MBOT_TYPE nCPType); - -/******************************************************************* - * PARAMETERS: - pszPathname - relative or absolute path of the php file; - pszFcnName - function name can be NULL (whole file will be executed then); - pResult - if set, you'll get the struct filled with the result; - NOTE! Remember to release the struct with "fp_freeresult"!; - pCParam - custom parameter, for your own use; use MBOT_GETCPARAM(cparam) to get the pointer; - nCPType - its type {MBOT_NUMBER,MBOT_STRING,MBOT_VOID} if str or num, php will be able to get it too - pszPTypes - a string containing pformats s-string,u-long,l-long,d-long,q-double,f-float,x-hex long, v - MBOT_VPARAM* - ... - values; - - *EXAMPLE: - fpExecuteScript("mbot/scripts/my.php","fct1",&mbr,"parameter", - MBOT_STRING,"suf","hello",100,25.6); - *******************************************************************/ -typedef int (*MBOT_ExecuteFile)(const char* pszPathname,const char* pszFcnName,MBOT_RESULT* pResult, - void* pCParam,MBOT_TYPE nCPType,const char* pszPTypes,...); - -typedef struct{ - int cbSize; //sizeof(MBOT_LPHP); - const char* pszMBotVersion; - //execution - MBOT_ExecuteScript fpExecuteScript; - MBOT_ExecuteFile fpExecuteFile; - //functions - MBOT_RegisterFunction fpRegister; - MBOT_UnregisterFunction fpUnregister; - //variables - MBOT_NewVar fpNewVar; - MBOT_SetVar fpSetVar; - MBOT_GetVar fpGetVar; - MBOT_DelVar fpDelVar; - //memory - MBOT_Strdup fp_strdup; - MBOT_Malloc fp_malloc; - MBOT_Free fp_free; - MBOT_FreeResult fp_freeresult; -}MBOT_FUNCTIONS; - -/*MS_MBOT_GET_FUNCTIONS -lParam = wParam = 0; -returns a pointer to const MBOT_FUNCTIONS structure; -*/ -#define MS_MBOT_GET_FCN_TABLE "MBot/GetFcnTable" -#endif //M_SCRIPT_H__ \ No newline at end of file diff --git a/plugins/ExternalAPI/m_shutdown.h b/plugins/ExternalAPI/m_shutdown.h index 239a728d82..74c32d7830 100644 --- a/plugins/ExternalAPI/m_shutdown.h +++ b/plugins/ExternalAPI/m_shutdown.h @@ -157,7 +157,6 @@ Unused, return always 0 here. #define SETTING_SHOWCONFIRMDLG_DEFAULT 1 #define SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT 30 // seconds #define SETTING_WEATHERSHUTDOWN_DEFAULT 0 -#define SETTING_HDDOVERHEATSHUTDOWN_DEFAULT 1 #define SETTING_SMARTOFFLINECHECK_DEFAULT 1 #define SETTING_SHUTDOWNTYPE_DEFAULT SDSDT_SHUTDOWN diff --git a/plugins/ExternalAPI/m_simpleaway.h b/plugins/ExternalAPI/m_simpleaway.h deleted file mode 100644 index e70dcbf4ac..0000000000 --- a/plugins/ExternalAPI/m_simpleaway.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - -Simple Status Message plugin for Miranda IM -Copyright (C) 2006-2010 Bartosz 'Dezeath' Bia³ek, (C) 2005 Harven - -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., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef M_SIMPLEAWAY_H__ -#define M_SIMPLEAWAY_H__ 1 - -// -// NOTE: These services are deprecated. Please do not use them anymore. -// Take a look at m_simplestatusmsg.h instead. -// - -// Represents status that a protocol(s) is/are currently in -#define ID_STATUS_CURRENT 40082 - -// Force a change of global status mode/message -// wParam = (int)new status (from statusmodes.h), 0 or ID_STATUS_CURRENT for current -// lParam = (TCHAR *)status message -#define MS_SA_SETSTATUSMODE "SimpleAway/SetStatusMode" -#define MS_AWAYSYS_SETSTATUSMODE MS_SA_SETSTATUSMODE // for compatibility with some plugins - -// Brings up the status message dialog -// wParam = 0 -// lParam = (LPARAM)(char *)protocol name, NULL if for all protocols -#define MS_SA_SHOWSTATUSMSGDIALOG "SimpleAway/ShowStatusMessageDialog" - -// Similar to the service above, for internal use only -#define MS_SA_TTCHANGESTATUSMSG "SimpleAway/TTChangeStatusMessage" - -// Force a change of status mode/message. The status message dialog will appear, -// depending on the configuration of the user -// wParam = (int)new status -// lParam = (LPARAM)(char *)protocol name, NULL if for all protocols -// Returns 1 when changed without showing the status message dialog -#define MS_SA_CHANGESTATUSMSG "SimpleAway/ChangeStatusMessage" - -// For checking if SimpleAway is running -// wParam = lParam = 0 -// Always returns 1 -#define MS_SA_ISSARUNNING "SimpleAway/IsSARunning" - -// Copy the away/na/etc message of a contact -// wParam = (WPARAM)(HANDLE)hContact -// lParam = 0 -// Returns 0 on success or nonzero on failure -// Returns immediately, without waiting for the message to retrieve -#define MS_SA_COPYAWAYMSG "SimpleAway/CopyAwayMsg" - -// Go to URL in away/na/etc message of a contact -// wParam = (WPARAM)(HANDLE)hContact -// lParam = 0 -#define MS_SA_GOTOURLMSG "SimpleAway/GoToURLMsg" - -// Returns the default status message for a status in specified protocol module -// or the current status message for the specified protocol if 0 or ID_STATUS_CURRENT is used -// wParam = (int)status, 0 or ID_STATUS_CURRENT for current -// lParam = (LPARAM)(char *)protocol name, NULL if for all protocols -// Returns status msg. Remember to free the return value -#ifndef MS_AWAYMSG_GETSTATUSMSG - #define MS_AWAYMSG_GETSTATUSMSG "SRAway/GetStatusMessage" -#endif -#ifndef MS_AWAYMSG_GETSTATUSMSGW - #define MS_AWAYMSG_GETSTATUSMSGW "SRAway/GetStatusMessageW" -#endif - -#ifndef MS_AWAYMSG_GETSTATUSMSGT - #ifdef _UNICODE - #define MS_AWAYMSG_GETSTATUSMSGT MS_AWAYMSG_GETSTATUSMSGW - #else - #define MS_AWAYMSG_GETSTATUSMSGT MS_AWAYMSG_GETSTATUSMSG - #endif -#endif - -// Force a change to specified global status mode/message -// (calls MS_SA_CHANGESTATUSMSG with proper parameters) -// wParam = lParam = 0 -#define MS_SA_SETOFFLINESTATUS "SimpleAway/SetOfflineStatus" -#define MS_SA_SETONLINESTATUS "SimpleAway/SetOnlineStatus" -#define MS_SA_SETAWAYSTATUS "SimpleAway/SetAwayStatus" -#define MS_SA_SETDNDSTATUS "SimpleAway/SetDNDStatus" -#define MS_SA_SETNASTATUS "SimpleAway/SetNAStatus" -#define MS_SA_SETOCCUPIEDSTATUS "SimpleAway/SetOccupiedStatus" -#define MS_SA_SETFREECHATSTATUS "SimpleAway/SetFreeChatStatus" -#define MS_SA_SETINVISIBLESTATUS "SimpleAway/SetInvisibleStatus" -#define MS_SA_SETONTHEPHONESTATUS "SimpleAway/SetOnThePhoneStatus" -#define MS_SA_SETOUTTOLUNCHSTATUS "SimpleAway/SetOutToLunchStatus" - -#endif // M_SIMPLEAWAY_H__ diff --git a/plugins/ExternalAPI/m_snappingwindows.h b/plugins/ExternalAPI/m_snappingwindows.h deleted file mode 100644 index fcfd679913..0000000000 --- a/plugins/ExternalAPI/m_snappingwindows.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef SNAPPING_WINDOWS_H -#define SNAPPING_WINDOWS_H - -struct SnapWindowProc_t -{ - HWND hWnd; - // - SIZE m_szMoveOffset; - WPARAM wParam; - LPARAM lParam; - // - int Reserved1; - int Reserved2; - int Reserved3; -}; - -#define CallSnappingWindowProc(hwnd,nMessage,wParam,lParam) {static struct SnapWindowProc_t SnapInfo; \ - if ((nMessage == WM_MOVING) || (nMessage == WM_NCLBUTTONDOWN) || (nMessage == WM_SYSCOMMAND) || (nMessage == WM_SIZING)){ \ - SnapInfo.hWnd = hwnd; \ - SnapInfo.wParam = wParam; \ - SnapInfo.lParam = lParam; \ - CallService("Utils/SnapWindowProc",(WPARAM)&SnapInfo,nMessage); \ - if (nMessage == WM_SIZING) return 1;}} - -#endif //SNAPPING_WINDOWS_H \ No newline at end of file diff --git a/plugins/ExternalAPI/m_svc_dbepp.h b/plugins/ExternalAPI/m_svc_dbepp.h deleted file mode 100644 index d728de9ddc..0000000000 --- a/plugins/ExternalAPI/m_svc_dbepp.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - -Miranda NG: the free IM client for Microsoft* Windows* - -Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org), -Copyright (c) 2003-11 Bio, Jonathan Gordon - -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. -*/ - -#ifndef M_DBEDITOR -#define M_DBEDITOR - -/* -Open user tree in DBE++ -wParam=(HANDLE)hContact -lParam=0 -always returns 0 -*/ -#define MS_DBEDIT_MENUCOMMAND "DBEditorpp/MenuCommand" - -/* -Import settings\contacts from file -wParam=(HANDLE)hContact -lParam=(char*)FilePath -always returns 0 -*/ -#define MS_DBEDIT_IMPORT "DBEditorpp/Import" - -#endif \ No newline at end of file diff --git a/plugins/ExternalAPI/m_voice.h b/plugins/ExternalAPI/m_voice.h deleted file mode 100644 index 5adf159f05..0000000000 --- a/plugins/ExternalAPI/m_voice.h +++ /dev/null @@ -1,158 +0,0 @@ -/* -Copyright (C) 2006 Ricardo Pescuma Domenecci - -This is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this file; see the file license.txt. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. -*/ - - -#ifndef __M_VOICE_H__ -# define __M_VOICE_H__ - - -#define EVENTTYPE_VOICE_CALL 8739 - - -#define PROTOTYPE_VOICE (PROTOTYPE_ENCRYPTION-9) - - -#define VOICE_UNICODE 0x80000000 - -#ifdef UNICODE -# define VOICE_TCHAR VOICE_UNICODE -#else -# define VOICE_TCHAR 0 -#endif - -#define VOICE_STATE_TALKING 0 -#define VOICE_STATE_RINGING 1 -#define VOICE_STATE_CALLING 2 -#define VOICE_STATE_ON_HOLD 3 -#define VOICE_STATE_ENDED 4 - -typedef struct { - int cbSize; // Struct size - const char *szModule; // The name of the protocol module (used only in notifications) - char *id; // Protocol especific ID for this call - int flags; // Can be VOICE_CALL_CONTACT or VOICE_CALL_STRING (VOICE_UNICODE to say the string is unicode) - union { // Who to call - MCONTACT hContact; - TCHAR *ptszContact; - char *pszContact; - WCHAR *pwszContact; - }; - int state; // VOICE_STATE_* - -} VOICE_CALL; - - -/* -Notifies that a voice call changed state - -wParam: const VOICE_CALL * -lParam: ignored -return: 0 on success -*/ -#define PE_VOICE_CALL_STATE "/Voice/State" - - -#define VOICE_SUPPORTED 1 // Set if proto support voice calls. Probabilly will be 1 ;) -#define VOICE_CALL_CONTACT 2 // Set if a call can be made to a hContact -#define VOICE_CALL_CONTACT_NEED_TEST 4 // Set if the contact need to be tested with PS_VOICE_CALL_CONTACT_VALID (needs VOICE_CALL_CONTACT set to work) -#define VOICE_CALL_STRING 8 // Set if a call can be made to some string (PS_VOICE_CALL_STRING_VALID is used to validate the string) -#define VOICE_CAN_SET_DEVICE 16 // Set if the devices to mic in and sound out can be set (or the protocol will handle it internally) -#define VOICE_CAN_HOLD 32 // Set if a call can be put on hold -/* -Get protocol voice support flags - -wParam: ignored -lParam: ignored -return: 0 on success -*/ -#define PS_VOICE_GETINFO "/Voice/GetInfo" - -/* -Request to the protocol a voice call to hContact. - -wParam: (HANDLE) hContact -lParam: ignored -return: 0 on success -*/ -#define PS_VOICE_CALL "/Voice/Call" - -/* -Service called to make the protocol answer a call. -It is an async call. If the call was answered, the PE_VOICE_STARTEDCALL -notification will be fired. - -wParam: (const char *) id -lParam: ignored -return: 0 on success -*/ -#define PS_VOICE_ANSWERCALL "/Voice/AnswerCall" - -/* -Service called to make the protocol answer a call. This can be called if the -call is ringing or has started. If called any other time it should be ignored. -It is an async call. If the call was droped, the PE_VOICE_ENDEDCALL -notification will be fired. - -wParam: (const char *) id -lParam: ignored -return: 0 on success -*/ -#define PS_VOICE_DROPCALL "/Voice/DropCall" - -/* -Service called to make the protocol hold a call. This means that the call should not -be droped, but it should be muted and put in a hold, to allow other call to be answered. -If the protocol can't hold a cal, it should be droped. - -This can be called if the call has started. If called any other time it should be ignored. -It is an async call. If the call was droped, the PE_VOICE_HOLDEDCALL -notification will be fired. - -wParam: (const char *) id -lParam: ignored -return: 0 on success -*/ -#define PS_VOICE_HOLDCALL "/Voice/HoldCall" - -/* -Used if protocol support VOICE_CALL_STRING. The call string is passed as -wParam and the proto should validate it. - -wParam: (const TCHAR *) call string -lParam: ignored -return: 0 if wrong, 1 if correct -*/ -#define PS_VOICE_CALL_STRING_VALID "/Voice/CallStringValid" - -/* -Used if protocol support VOICE_CALL_CONTACT and VOICE_CALL_CONTACT_NEED_TEST. -The hContact is passed as wParam and the proto should tell if this contact can be -called. - -wParam: (HANDLE) hContact -lParam: (BOOL) TRUE if it is a test for 'can call now?', FALSE if is a test for 'will be possible to call someday?' -return: 0 if can't be called, 1 if can -*/ -#define PS_VOICE_CALL_CONTACT_VALID "/Voice/CallContactValid" - - - - - -#endif // __M_VOICE_H__ diff --git a/plugins/ExternalAPI/m_voiceservice.h b/plugins/ExternalAPI/m_voiceservice.h deleted file mode 100644 index 98c3580aea..0000000000 --- a/plugins/ExternalAPI/m_voiceservice.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright (C) 2007 Ricardo Pescuma Domenecci - -This is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this file; see the file license.txt. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. -*/ - - -#ifndef __M_VOICESERVICE_H__ -# define __M_VOICESERVICE_H__ - -#include "m_voice.h" - - -#define MIID_VOICESERVICE { 0x7d64437, 0xef2e, 0x4f60, { 0xbb, 0x2d, 0x3c, 0x51, 0x8f, 0xe2, 0x4d, 0x63 } } - - -/* -This services are a mirror of the services/notifications in m_voice.h, -with the difference that that ones are to be used by protocols, and this ones -are to be used by plugins that can make calls to contacts in multiple protocols. -*/ - - -/* -Notifies that a voice call changed state - -wParam: const VOICE_CALL * -lParam: ignored -return: 0 on success -*/ -#define MS_VOICESERVICE_STATE "VoiceService/State" - - - -struct VOICE_MODULE -{ - int cbSize; // sizeof(VOICE_MODULE) - char *name; // The internal name of the plugin. All PS_* serivces (except PS_VOICE_GETINFO) - // defined in m_voide.h need to be created based in this name. For example, - // PS_VOICE_CALL (/Voice/Call) need to be created as /Voice/Call - int flags; // VOICE_* from m_voice.h -}; -/* -Register a new plugin that can make/receive voice calls. - -wParam: const VOICE_MODULE * -lParam: ignored -return: 0 on success -*/ -#define MS_VOICESERVICE_REGISTER "VoiceService/Register" - - -/* -Request a voice call to hContact. - -wParam: (HANDLE) hContact -lParam: ignored -return: the number of option calls for a contact. If > 0, it can be called -*/ -#define MS_VOICESERVICE_CAN_CALL "VoiceService/CanCall" - -/* -Request a voice call to hContact. - -wParam: (HANDLE) hContact -lParam: (char *) Protocol or NULL to use any proto avaiable -return: 0 on success -*/ -#define MS_VOICESERVICE_CALL "VoiceService/Call" - - - -#endif // __M_VOICESERVICE_H__ diff --git a/plugins/ExternalAPI/m_w7ui.h b/plugins/ExternalAPI/m_w7ui.h deleted file mode 100644 index 6d8ee28b92..0000000000 --- a/plugins/ExternalAPI/m_w7ui.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef m_w7ui_h__ -#define m_w7ui_h__ - -enum -{ - MIS_ICOLIB, - MIS_GENERAL, - MIS_PROTOCOL, -}; - -struct MIRANDAJUMPLISTITEM -{ - int iconSource; - char *iconName; - int iconIdx; - WCHAR *szTitle; - WCHAR *szPrefix; - WCHAR *szArgument; -}; - -// Force jumplist rebuild -#define MS_JUMPLIST_REBUILD "w7/JumpList/Rebuild" - -// --- -#define ME_JUMPLIST_BUILDCATEGORIES "w7/JumpList/BuildCategories" - -// lParam = (WCHAR *)category name -#define ME_JUMPLIST_BUILDITEMS "w7/JumpList/BuildItems" - -// lParam = (WCHAR *)category name -#define MS_JUMPLIST_ADDCATEGORY "w7/JumpList/AddCategory" - -// lParam = (MIRANDAJUMPLISTITEM *)item -#define MS_JUMPLIST_ADDITEM "w7/JumpList/AddItem" - -// wParam = prefix -// lParam = argument -#define ME_JUMPLIST_PROCESS "w7/JumpList/Process" - -static void MJumpList_AddCategory(WCHAR *name) -{ - CallService(MS_JUMPLIST_ADDCATEGORY, 0, (LPARAM)name); -} - -static void MJumpList_AddItem(char *mir_icon, WCHAR *title, WCHAR *prefix, WCHAR *argument) -{ - MIRANDAJUMPLISTITEM item = { MIS_ICOLIB, mir_icon, 0, title, prefix, argument }; - CallService(MS_JUMPLIST_ADDITEM, 0, (LPARAM)&item); -} - -static void MJumpList_AddItem(int skinicon, WCHAR *title, WCHAR *prefix, WCHAR *argument) -{ - MIRANDAJUMPLISTITEM item = { MIS_GENERAL, 0, skinicon, title, prefix, argument }; - CallService(MS_JUMPLIST_ADDITEM, 0, (LPARAM)&item); -} - -static void MJumpList_AddItem(char *proto, int skinicon, WCHAR *title, WCHAR *prefix, WCHAR *argument) -{ - MIRANDAJUMPLISTITEM item = { MIS_PROTOCOL, proto, skinicon, title, prefix, argument }; - CallService(MS_JUMPLIST_ADDITEM, 0, (LPARAM)&item); -} - -#endif // m_w7ui_h__ diff --git a/plugins/IEView/res/ieview.rc b/plugins/IEView/res/ieview.rc index 09852a0d95..6aac7db2ce 100644 --- a/plugins/IEView/res/ieview.rc +++ b/plugins/IEView/res/ieview.rc @@ -7,7 +7,8 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "afxres.h" + ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -70,7 +71,6 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,46,279,10 CONTROL "Enable workaround for PNG transparency",IDC_ENABLE_PNGHACK, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,61,279,10 - CONTROL "Enable MathModule support",IDC_ENABLE_MATHMODULE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,76,279,10 CONTROL "Replace smileys in user names",IDC_SMILEYS_IN_NAMES, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,91,279,10 CONTROL "Hide window border",IDC_NO_BORDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,106,279,10 @@ -168,7 +168,8 @@ END // // Generated from the TEXTINCLUDE 3 resource. // - + + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index 716cb584f3..8545f34264 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -57,12 +57,6 @@ bool HTMLBuilder::encode(MCONTACT hContact, const char *proto, const wchar_t *te break; } level++; - case 2: - if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_MATHMODULE) && Options::isMathModule()) { - token = TextToken::tokenizeMath(text); - break; - } - level++; case 3: token = TextToken::tokenizeLinks(text); break; diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 7be2656e0d..a6b7ca5ca9 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -477,9 +477,6 @@ static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w if (Options::getGeneralFlags() & Options::GENERAL_ENABLE_FLASH) { CheckDlgButton(hwndDlg, IDC_ENABLE_FLASH, TRUE); } - if (Options::getGeneralFlags() & Options::GENERAL_ENABLE_MATHMODULE) { - CheckDlgButton(hwndDlg, IDC_ENABLE_MATHMODULE, TRUE); - } if (Options::getGeneralFlags() & Options::GENERAL_ENABLE_PNGHACK) { CheckDlgButton(hwndDlg, IDC_ENABLE_PNGHACK, TRUE); } @@ -492,7 +489,6 @@ static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w if (Options::getGeneralFlags() & Options::GENERAL_ENABLE_EMBED) { CheckDlgButton(hwndDlg, IDC_ENABLE_EMBED, TRUE); } - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_MATHMODULE), Options::isMathModule()); EnableWindow(GetDlgItem(hwndDlg, IDC_SMILEYS_IN_NAMES), Options::isSmileyAdd()); EnableWindow(GetDlgItem(hwndDlg, IDC_EMBED_SIZE), IsDlgButtonChecked(hwndDlg, IDC_ENABLE_EMBED)); TCHAR* size[] = { _T("320 x 205"), _T("480 x 385") , _T("560 x 349"), _T("640 x 390")}; @@ -508,7 +504,6 @@ static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w switch (LOWORD(wParam)) { case IDC_ENABLE_BBCODES: case IDC_ENABLE_FLASH: - case IDC_ENABLE_MATHMODULE: case IDC_ENABLE_PNGHACK: case IDC_SMILEYS_IN_NAMES: case IDC_NO_BORDER: @@ -533,9 +528,6 @@ static INT_PTR CALLBACK IEViewGeneralOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w if (IsDlgButtonChecked(hwndDlg, IDC_ENABLE_FLASH)) { i |= Options::GENERAL_ENABLE_FLASH; } - if (IsDlgButtonChecked(hwndDlg, IDC_ENABLE_MATHMODULE)) { - i |= Options::GENERAL_ENABLE_MATHMODULE; - } if (IsDlgButtonChecked(hwndDlg, IDC_ENABLE_PNGHACK)) { i |= Options::GENERAL_ENABLE_PNGHACK; } @@ -964,7 +956,6 @@ static INT_PTR CALLBACK IEViewGroupChatsOptDlgProc(HWND hwndDlg, UINT msg, WPARA } bool Options::isInited = false; -bool Options::bMathModule = false; bool Options::bSmileyAdd = false; int Options::avatarServiceFlags = 0; int Options::generalFlags; @@ -1600,7 +1591,6 @@ void Options::init() lastProto = proto; } - bMathModule = 0 != ServiceExists(MTH_GET_GIF_UNICODE); bSmileyAdd = 0 != ServiceExists(MS_SMILEYADD_BATCHPARSE); avatarServiceFlags = 0; if (ServiceExists(MS_AV_GETAVATARBITMAP)) @@ -1642,11 +1632,6 @@ int Options::getEmbedsize() return db_get_dw(NULL, ieviewModuleName, "Embedsize", 0); } -bool Options::isMathModule() -{ - return bMathModule; -} - bool Options::isSmileyAdd() { return bSmileyAdd; diff --git a/plugins/IEView/src/Options.h b/plugins/IEView/src/Options.h index 58f758ceaf..4fbf6fe4a1 100644 --- a/plugins/IEView/src/Options.h +++ b/plugins/IEView/src/Options.h @@ -195,7 +195,6 @@ class Options { private: static int generalFlags; static bool isInited; - static bool bMathModule; static bool bSmileyAdd; static int avatarServiceFlags; static ProtocolSettings* protocolList; @@ -207,7 +206,6 @@ public: }; enum OPTIONS { GENERAL_ENABLE_BBCODES = 0x000001, - GENERAL_ENABLE_MATHMODULE = 0x000002, GENERAL_ENABLE_FLASH = 0x000004, GENERAL_ENABLE_PNGHACK = 0x000008, GENERAL_SMILEYINNAMES = 0x000010, @@ -235,7 +233,6 @@ public: static void setEmbedsize(int size); static int getEmbedsize(); - static bool isMathModule(); static bool isSmileyAdd(); static int getAvatarServiceFlags(); static void init(); diff --git a/plugins/IEView/src/TextToken.cpp b/plugins/IEView/src/TextToken.cpp index 7b27e70614..40fb816bde 100644 --- a/plugins/IEView/src/TextToken.cpp +++ b/plugins/IEView/src/TextToken.cpp @@ -127,7 +127,7 @@ void TextToken::setLink(const wchar_t *_link) static int countNoWhitespace(const wchar_t *str) { int c; - for (c=0; *str!='\n' && *str!='\r' && *str!='\t' && *str!=' ' && *str!='\0'; str++, c++); + for (c = 0; *str != '\n' && *str != '\r' && *str != '\t' && *str != ' ' && *str != '\0'; str++, c++); return c; } @@ -135,125 +135,38 @@ TextToken* TextToken::tokenizeBBCodes(const wchar_t *text) { return tokenizeBBCodes(text, (int)wcslen(text)); } -TextToken* TextToken::tokenizeMath(const wchar_t *text) { - TextToken *firstToken = NULL, *lastToken = NULL, *mathToken = NULL; - static bool mathModInitialized = false; - static wchar_t *mathTagName[] = {NULL, NULL}; - static int mathTagLen[] = {0, 0}; - int i; - if (!mathModInitialized) { - if (ServiceExists(MATH_GET_PARAMS)) { - char* mthDelStart = (char *)CallService(MATH_GET_PARAMS, (WPARAM)MATH_PARAM_STARTDELIMITER, 0); - char* mthDelEnd = (char *)CallService(MATH_GET_PARAMS, (WPARAM)MATH_PARAM_ENDDELIMITER, 0); - if (mthDelStart!=NULL) { - mathTagName[0] = mir_a2t(mthDelStart); - mathTagLen[0] = (int)wcslen(mathTagName[0]); - } - if (mthDelEnd!=NULL) { - mathTagName[1] = mir_a2t(mthDelEnd); - mathTagLen[1] = (int)wcslen(mathTagName[1]); - } - CallService(MTH_FREE_MATH_BUFFER,0, (LPARAM) mthDelStart); - CallService(MTH_FREE_MATH_BUFFER,0, (LPARAM) mthDelEnd); - } - mathModInitialized = true; - } - int textLen = 0; - int l = (int)wcslen(text); - for (i=0; i<=l;) { - bool mathFound = false; - int k = 0, tagDataStart=0, newTokenType = 0, newTokenSize = 0; - if (mathTagName[0] != NULL && mathTagName[1] != NULL) { - if (!wcsnicmp(text+i, mathTagName[0], mathTagLen[0])) { - k = tagDataStart = i + mathTagLen[0]; - for (; k < l; k++) { - if (!wcsnicmp(text+k, mathTagName[1], mathTagLen[1])) { - k += mathTagLen[1]; - mathFound = true; - break; - } - } - } - } - if (mathFound) { - mathToken = new TextToken(MATH, text + tagDataStart, k - mathTagLen[1] - tagDataStart); - char* mathPath=(char*)CallService(MTH_GET_GIF_UNICODE, 0, (LPARAM) mathToken->getTextW()); - if (mathPath!=NULL) { - mathToken->setLink(mathPath); - CallService(MTH_FREE_GIFPATH, 0, (LPARAM) mathPath); - } else { - mathToken->setLink(""); - } - mathToken->setEnd(false); - newTokenType = MATH; - newTokenSize = k - i; - } else { - if (i==l) { - newTokenType = END; - newTokenSize = 1; - } else { - newTokenType = TEXT; - newTokenSize = 1; - } - } - if (newTokenType != TEXT) { - if (textLen >0 ) { - TextToken *newToken = new TextToken(TEXT, text+i-textLen, textLen); - textLen = 0; - if (lastToken == NULL) { - firstToken = newToken; - } else { - lastToken->setNext(newToken); - } - lastToken = newToken; - } - if (newTokenType == MATH) { - if (lastToken == NULL) { - firstToken = mathToken; - } else { - lastToken->setNext(mathToken); - } - lastToken = mathToken; - } - } else { - textLen += newTokenSize; - } - i += newTokenSize; - } - return firstToken; -} // TODO: Add the following BBCodes: code #define BB_TAG_NUM 10 TextToken* TextToken::tokenizeBBCodes(const wchar_t *text, int l) { - static const wchar_t *bbTagName[] = {L"b", L"i", L"u", L"s", L"img", L"color", L"size", L"bimg", L"url", L"code"}; - static int bbTagNameLen[] = {1, 1, 1, 1, 3, 5, 4, 4, 3, 4}; - static int bbTagArg[] = {0, 0, 0, 0, 0, 1, 1, 0, 1, 0}; - static int bbTagId[] = {BB_B, BB_I, BB_U, BB_S, BB_IMG, BB_COLOR, BB_SIZE, BB_BIMG, BB_URL, BB_CODE}; + static const wchar_t *bbTagName[] = { L"b", L"i", L"u", L"s", L"img", L"color", L"size", L"bimg", L"url", L"code" }; + static int bbTagNameLen[] = { 1, 1, 1, 1, 3, 5, 4, 4, 3, 4 }; + static int bbTagArg[] = { 0, 0, 0, 0, 0, 1, 1, 0, 1, 0 }; + static int bbTagId[] = { BB_B, BB_I, BB_U, BB_S, BB_IMG, BB_COLOR, BB_SIZE, BB_BIMG, BB_URL, BB_CODE }; static int bbTagEnd[BB_TAG_NUM]; static int bbTagCount[BB_TAG_NUM]; - int i,j; - TextToken *firstToken = NULL, *lastToken = NULL, * bbToken = NULL; + int i, j; + TextToken *firstToken = NULL, *lastToken = NULL, *bbToken = NULL; int textLen = 0; for (j = 0; j < BB_TAG_NUM; j++) { bbTagCount[j] = 0; bbTagEnd[j] = 0; } for (i = 0; i <= l;) { - int k, tagArgStart=0, tagArgEnd=0, tagDataStart=0, newTokenType = 0, newTokenSize = 0; + int k, tagArgStart = 0, tagArgEnd = 0, tagDataStart = 0, newTokenType = 0, newTokenSize = 0; bool bbFound = false; if (text[i] == '[') { - if (text[i+1] != '/') { + if (text[i + 1] != '/') { for (j = 0; j < BB_TAG_NUM; j++) { k = i + 1; - if (!wcsnicmp(text+k, bbTagName[j], bbTagNameLen[j])) { + if (!wcsnicmp(text + k, bbTagName[j], bbTagNameLen[j])) { tagArgStart = tagArgEnd = 0; k += bbTagNameLen[j]; if (bbTagArg[j]) { if (text[k] != '=') continue; k++; tagArgStart = k; - for (; text[k]!='\0'; k++) { - if (text[k]==']') break; + for (; text[k] != '\0'; k++) { + if (text[k] == ']') break; } tagArgEnd = k; } @@ -262,9 +175,9 @@ TextToken* TextToken::tokenizeBBCodes(const wchar_t *text, int l) { tagDataStart = k; if (k < bbTagEnd[j]) k = bbTagEnd[j]; for (; k < l; k++) { - if (text[k] == '[' && text[k+1] == '/') { + if (text[k] == '[' && text[k + 1] == '/') { k += 2; - if (!wcsnicmp(text+k, bbTagName[j], bbTagNameLen[j])) { + if (!wcsnicmp(text + k, bbTagName[j], bbTagNameLen[j])) { k += bbTagNameLen[j]; if (text[k] == ']') { k++; @@ -291,7 +204,8 @@ TextToken* TextToken::tokenizeBBCodes(const wchar_t *text, int l) { bbTagCount[j]++; if (bbTagArg[j]) { bbToken = new TextToken(BBCODE, text + tagArgStart, tagArgEnd - tagArgStart); - } else { + } + else { bbToken = new TextToken(BBCODE, bbTagName[j], bbTagNameLen[j]); } bbToken->setTag(bbTagId[j]); @@ -315,10 +229,11 @@ TextToken* TextToken::tokenizeBBCodes(const wchar_t *text, int l) { break; } } - } else { + } + else { for (j = 0; j < BB_TAG_NUM; j++) { k = i + 2; - if (bbTagCount[j]>0 && !wcsnicmp(text+k, bbTagName[j], bbTagNameLen[j])) { + if (bbTagCount[j]>0 && !wcsnicmp(text + k, bbTagName[j], bbTagNameLen[j])) { k += bbTagNameLen[j]; if (text[k] == ']') { k++; @@ -338,21 +253,23 @@ TextToken* TextToken::tokenizeBBCodes(const wchar_t *text, int l) { } } if (!bbFound) { - if (i==l) { + if (i == l) { newTokenType = END; newTokenSize = 1; - } else { + } + else { newTokenType = TEXT; newTokenSize = 1; } } if (newTokenType != TEXT) { - if (textLen >0 ) { - TextToken *newToken = new TextToken(TEXT, text+i-textLen, textLen); + if (textLen > 0) { + TextToken *newToken = new TextToken(TEXT, text + i - textLen, textLen); textLen = 0; if (lastToken == NULL) { firstToken = newToken; - } else { + } + else { lastToken->setNext(newToken); } lastToken = newToken; @@ -360,12 +277,14 @@ TextToken* TextToken::tokenizeBBCodes(const wchar_t *text, int l) { if (newTokenType == BBCODE) { if (lastToken == NULL) { firstToken = bbToken; - } else { + } + else { lastToken->setNext(bbToken); } lastToken = bbToken; } - } else { + } + else { textLen += newTokenSize; } i += newTokenSize; @@ -377,47 +296,54 @@ TextToken* TextToken::tokenizeLinks(const wchar_t *text) { TextToken *firstToken = NULL, *lastToken = NULL; int textLen = 0; int l = (int)wcslen(text); - for (int i=0; i<=l;) { + for (int i = 0; i <= l;) { int newTokenType, newTokenSize; - int urlLen = Utils::detectURL(text+i); + int urlLen = Utils::detectURL(text + i); if (i == l) { newTokenType = END; newTokenSize = 1; - } else if (urlLen > 0) { + } + else if (urlLen > 0) { newTokenType = LINK; newTokenSize = urlLen; - } else if (!wcsncmp(text+i, L"www.", 4)) { + } + else if (!wcsncmp(text + i, L"www.", 4)) { newTokenType = WWWLINK; - newTokenSize = countNoWhitespace(text+i); - } else if (!wcsncmp(text+i, L"mailto:", 7)) { + newTokenSize = countNoWhitespace(text + i); + } + else if (!wcsncmp(text + i, L"mailto:", 7)) { newTokenType = LINK; - newTokenSize = countNoWhitespace(text+i); - } else { + newTokenSize = countNoWhitespace(text + i); + } + else { newTokenType = TEXT; newTokenSize = 1; } if (newTokenType != TEXT) { - if (textLen >0 ) { - TextToken *newToken = new TextToken(TEXT, text+i-textLen, textLen); + if (textLen > 0) { + TextToken *newToken = new TextToken(TEXT, text + i - textLen, textLen); textLen = 0; if (lastToken == NULL) { firstToken = newToken; - } else { + } + else { lastToken->setNext(newToken); } lastToken = newToken; } if (newTokenType == WWWLINK || newTokenType == LINK) { - TextToken *newToken = new TextToken(newTokenType, text+i, newTokenSize); + TextToken *newToken = new TextToken(newTokenType, text + i, newTokenSize); newToken->setLink(newToken->getText()); if (lastToken == NULL) { firstToken = newToken; - } else { + } + else { lastToken->setNext(newToken); } lastToken = newToken; } - } else { + } + else { textLen += newTokenSize; } i += newTokenSize; @@ -438,29 +364,32 @@ TextToken* TextToken::tokenizeSmileys(MCONTACT hContact, const char *proto, cons sp.flag = SAFL_PATH | SAFL_UNICODE | (isSent ? SAFL_OUTGOING : 0); sp.wstr = (wchar_t *)text; sp.hContact = hContact; - spRes = (SMADD_BATCHPARSERES *) CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp); + spRes = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp); int last_pos = 0; if (spRes != NULL) { for (int i = 0; i < (int)sp.numSmileys; i++) { if (spRes[i].filepath != NULL && strlen((char *)spRes[i].filepath) > 0) { if ((int)spRes[i].startChar - last_pos > 0) { - TextToken *newToken = new TextToken(TEXT, text+last_pos, spRes[i].startChar-last_pos); + TextToken *newToken = new TextToken(TEXT, text + last_pos, spRes[i].startChar - last_pos); if (lastToken == NULL) { firstToken = newToken; - } else { + } + else { lastToken->setNext(newToken); } lastToken = newToken; } - TextToken *newToken = new TextToken(SMILEY, text+spRes[i].startChar, spRes[i].size); + TextToken *newToken = new TextToken(SMILEY, text + spRes[i].startChar, spRes[i].size); if (sp.oflag & SAFL_UNICODE) { newToken->setLink((wchar_t *)spRes[i].filepath); - } else { + } + else { newToken->setLink((char *)spRes[i].filepath); } if (lastToken == NULL) { firstToken = newToken; - } else { + } + else { lastToken->setNext(newToken); } lastToken = newToken; @@ -470,10 +399,11 @@ TextToken* TextToken::tokenizeSmileys(MCONTACT hContact, const char *proto, cons CallService(MS_SMILEYADD_BATCHFREE, 0, (LPARAM)spRes); } if (last_pos < l) { - TextToken *newToken = new TextToken(TEXT, text+last_pos, l-last_pos); + TextToken *newToken = new TextToken(TEXT, text + last_pos, l - last_pos); if (lastToken == NULL) { firstToken = newToken; - } else { + } + else { lastToken->setNext(newToken); } lastToken = newToken; @@ -486,7 +416,7 @@ TextToken* TextToken::tokenizeChatFormatting(const wchar_t *text) { int textLen = 0; int l = (int)wcslen(text); wchar_t* tokenBuffer = new wchar_t[l + 1]; - for (int i=0; i<=l;) { + for (int i = 0; i <= l;) { int newTokenType = TEXT; int newTokenSize = 1; int newTokenTag = 0; @@ -495,66 +425,68 @@ TextToken* TextToken::tokenizeChatFormatting(const wchar_t *text) { bool endToken = false; - if (i==l) { + if (i == l) { newTokenType = END; - } else { + } + else { if (text[i] == '%') { newTokenSize = 2; switch (text[i + 1]) { - case '%': - break; - case 'B': - endToken = true; - case 'b': - newTokenType = BBCODE; - newTokenTag = BB_B; - break; - case 'U': - endToken = true; - case 'u': - newTokenType = BBCODE; - newTokenTag = BB_U; - break; - case 'I': - endToken = true; - case 'i': - newTokenType = BBCODE; - newTokenTag = BB_I; - break; - case 'C': - endToken = true; - case 'c': - newTokenType = BBCODE; - newTokenTag = BB_COLOR; - if (!endToken) { - newTokenText = text + i + 2; - newTokenTextLen = 7; - newTokenSize = 9; - } - break; - case 'F': - endToken = true; - case 'f': - newTokenType = BBCODE; - newTokenTag = BB_BACKGROUND; - if (!endToken) { - newTokenText = text + i + 2; - newTokenTextLen = 7; - newTokenSize = 9; - } - break; - default: - newTokenSize = 1; + case '%': + break; + case 'B': + endToken = true; + case 'b': + newTokenType = BBCODE; + newTokenTag = BB_B; + break; + case 'U': + endToken = true; + case 'u': + newTokenType = BBCODE; + newTokenTag = BB_U; + break; + case 'I': + endToken = true; + case 'i': + newTokenType = BBCODE; + newTokenTag = BB_I; + break; + case 'C': + endToken = true; + case 'c': + newTokenType = BBCODE; + newTokenTag = BB_COLOR; + if (!endToken) { + newTokenText = text + i + 2; + newTokenTextLen = 7; + newTokenSize = 9; + } + break; + case 'F': + endToken = true; + case 'f': + newTokenType = BBCODE; + newTokenTag = BB_BACKGROUND; + if (!endToken) { + newTokenText = text + i + 2; + newTokenTextLen = 7; + newTokenSize = 9; + } + break; + default: + newTokenSize = 1; } } } if (newTokenType != TEXT) { - if (textLen >0 ) { + if (textLen > 0) { TextToken *newToken = new TextToken(TEXT, tokenBuffer, textLen); textLen = 0; if (lastToken == NULL) { firstToken = newToken; - } else { + } + else { lastToken->setNext(newToken); } lastToken = newToken; @@ -565,12 +497,14 @@ TextToken* TextToken::tokenizeChatFormatting(const wchar_t *text) { newToken->setTag(newTokenTag); if (lastToken == NULL) { firstToken = newToken; - } else { + } + else { lastToken->setNext(newToken); } lastToken = newToken; } - } else { + } + else { tokenBuffer[textLen] = text[i]; textLen++; } @@ -586,46 +520,48 @@ wchar_t *TextToken::htmlEncode(const wchar_t *str) if (str == NULL) return NULL; int c = 0; - for (ptr=str; *ptr!='\0'; ptr++) { + for (ptr = str; *ptr != '\0'; ptr++) { bool wasSpace = false; - if (*ptr==' ' && wasSpace) { + if (*ptr == ' ' && wasSpace) { wasSpace = true; c += 6; - } else { + } + else { wasSpace = false; switch (*ptr) { - case '\n': c += 4; break; - case '\r': break; - case '&': c += 5; break; - case '>': c += 4; break; - case '<': c += 4; break; - case '"': c += 6; break; - case ' ': wasSpace = true; - default: c += 1; break; + case '\n': c += 4; break; + case '\r': break; + case '&': c += 5; break; + case '>': c += 4; break; + case '<': c += 4; break; + case '"': c += 6; break; + case ' ': wasSpace = true; + default: c += 1; break; } } } - wchar_t *output = new wchar_t[c+1]; - for (out=output, ptr=str; *ptr!='\0'; ptr++) { + wchar_t *output = new wchar_t[c + 1]; + for (out = output, ptr = str; *ptr != '\0'; ptr++) { bool wasSpace = false; - if (*ptr==' ' && wasSpace) { + if (*ptr == ' ' && wasSpace) { wcscpy(out, L" "); out += 6; - } else { + } + else { wasSpace = false; switch (*ptr) { - case '\n': wcscpy(out, L"
"); out += 4; break; - case '\r': break; - case '&': wcscpy(out, L"&"); out += 5; break; - case '>': wcscpy(out, L">"); out += 4; break; - case '<': wcscpy(out, L"<"); out += 4; break; - case '"': wcscpy(out, L"""); out += 6; break; - case ' ': wasSpace = true; - default: *out = *ptr; out += 1; break; + case '\n': wcscpy(out, L"
"); out += 4; break; + case '\r': break; + case '&': wcscpy(out, L"&"); out += 5; break; + case '>': wcscpy(out, L">"); out += 4; break; + case '<': wcscpy(out, L"<"); out += 4; break; + case '"': wcscpy(out, L"""); out += 6; break; + case ' ': wasSpace = true; + default: *out = *ptr; out += 1; break; } } } - *out = '\0'; + *out = '\0'; return output; } @@ -633,190 +569,199 @@ void TextToken::toString(wchar_t **str, int *sizeAlloced) { wchar_t *eText = NULL, *eLink = NULL; switch (type) { - case TEXT: - eText = htmlEncode(wtext); - Utils::appendText(str, sizeAlloced, L"%s", eText); - break; - case WWWLINK: - case LINK: - { - eText = htmlEncode(wtext); - eLink = htmlEncode(wlink); - const wchar_t *linkPrefix = type == WWWLINK ? L"http://" : L""; - if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_EMBED)) { - wchar_t *match = wcsstr(wlink, L"youtube.com"); - if (match != NULL) { - match = wcsstr(match + 11, L"v="); - if (match != NULL) { - match += 2; - wchar_t *match2 = wcsstr(match, L"&"); - int len = match2 != NULL ? match2 - match : (int)wcslen(match); - match = mir_wstrdup(match); - match[len] = 0; - int width ; - int height; - int Embedsize = Options::getEmbedsize(); - switch (Embedsize){ - case 0: - width = 320; - height = 205; - break; - case 1: - width = 480; - height = 385; - break; - case 2: - width = 560; - height = 349; - break; - case 3: - width = 640; - height = 390; - break; - - }; - - Utils::appendText(str, sizeAlloced, L"
\ - \ - \ - \ - \ -
", width, height, match, match, width, height); - mir_free(match); - break; - } - } + case TEXT: + eText = htmlEncode(wtext); + Utils::appendText(str, sizeAlloced, L"%s", eText); + break; + case WWWLINK: + case LINK: + { + eText = htmlEncode(wtext); + eLink = htmlEncode(wlink); + const wchar_t *linkPrefix = type == WWWLINK ? L"http://" : L""; + if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_EMBED)) { + wchar_t *match = wcsstr(wlink, L"youtube.com"); + if (match != NULL) { + match = wcsstr(match + 11, L"v="); + if (match != NULL) { + match += 2; + wchar_t *match2 = wcsstr(match, L"&"); + int len = match2 != NULL ? match2 - match : (int)wcslen(match); + match = mir_wstrdup(match); + match[len] = 0; + int width; + int height; + int Embedsize = Options::getEmbedsize(); + switch (Embedsize){ + case 0: + width = 320; + height = 205; + break; + case 1: + width = 480; + height = 385; + break; + case 2: + width = 560; + height = 349; + break; + case 3: + width = 640; + height = 390; + break; + + }; + + Utils::appendText(str, sizeAlloced, L"
\ + \ + \ + \ + \ +
", width, height, match, match, width, height); + mir_free(match); + break; } - Utils::appendText(str, sizeAlloced, L"%s", linkPrefix, eLink, eText); - } - break; - case SMILEY: - eText = htmlEncode(wtext); - if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_FLASH) && (wcsstr(wlink, L".swf")!=NULL)) { - Utils::appendText(str, sizeAlloced, - L"\ - %s", - eText, wlink, eText); - } else if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_PNGHACK) && (wcsstr(wlink, L".png")!=NULL)) { - Utils::appendText(str, sizeAlloced, L"\"%s\"/%s", wlink, eText, eText, eText); - } else { - Utils::appendText(str, sizeAlloced, L"\"%s\"%s", wlink, eText, eText, eText); } - break; - case MATH: - eText = htmlEncode(wtext); - if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_PNGHACK) && (wcsstr(wlink, L".png")!=NULL)) { - Utils::appendText(str, sizeAlloced, L"\"%s\"%s",wlink , eText, eText); - } else { - Utils::appendText(str, sizeAlloced, L"\"%s\"%s", wlink, eText, eText); - } - break; - case BBCODE: - if (!end) { - switch (tag) { - case BB_B: - //Utils::appendText(str, sizeAlloced, L""); - Utils::appendText(str, sizeAlloced, L""); - break; - case BB_I: - //Utils::appendText(str, sizeAlloced, L""); - Utils::appendText(str, sizeAlloced, L""); - break; - case BB_U: - //Utils::appendText(str, sizeAlloced, L""); - Utils::appendText(str, sizeAlloced, L""); - break; - case BB_S: - //Utils::appendText(str, sizeAlloced, L""); - Utils::appendText(str, sizeAlloced, L""); - break; - case BB_CODE: - //Utils::appendText(str, sizeAlloced, L""); - Utils::appendText(str, sizeAlloced, L"
");
-					break;
-				case BB_IMG:
-					eText = htmlEncode(wtext);
-					if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_FLASH) && eText != NULL && (wcsstr(eText, L".swf")!=NULL)) {
-						Utils::appendText(str, sizeAlloced,
-		L"
\ -
", - eText); - } else if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_PNGHACK) && eText != NULL && (wcsstr(eText, L".png")!=NULL)) { - Utils::appendText(str, sizeAlloced, L"", eText); - } else { - if (eText != NULL && wcsncmp(eText, L"http://", 7)) { - Utils::appendText(str, sizeAlloced, L"
this.width ? 'auto' : maxw);\" src=\"file://%s\" />
", eText); - } else { - Utils::appendText(str, sizeAlloced, L"
this.width ? 'auto' : maxw);\" src=\"%s\" />
", eText); - } - } - break; - case BB_BIMG: - eText = htmlEncode(mir_ptr(Utils::toAbsolute(wtext))); - - if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_FLASH) && (wcsstr(eText, L".swf")!=NULL)) { - Utils::appendText(str, sizeAlloced, - L"
\ -
", - eText); - } else if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_PNGHACK) && (wcsstr(eText, L".png")!=NULL)) { - Utils::appendText(str, sizeAlloced, L"", eText); - } else { + } + Utils::appendText(str, sizeAlloced, L"%s", linkPrefix, eLink, eText); + } + break; + case SMILEY: + eText = htmlEncode(wtext); + if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_FLASH) && (wcsstr(wlink, L".swf") != NULL)) { + Utils::appendText(str, sizeAlloced, + L"\ + %s", + eText, wlink, eText); + } + else if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_PNGHACK) && (wcsstr(wlink, L".png") != NULL)) { + Utils::appendText(str, sizeAlloced, L"\"%s\"/%s", wlink, eText, eText, eText); + } + else { + Utils::appendText(str, sizeAlloced, L"\"%s\"%s", wlink, eText, eText, eText); + } + break; + case MATH: + eText = htmlEncode(wtext); + if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_PNGHACK) && (wcsstr(wlink, L".png") != NULL)) { + Utils::appendText(str, sizeAlloced, L"\"%s\"%s", wlink, eText, eText); + } + else { + Utils::appendText(str, sizeAlloced, L"\"%s\"%s", wlink, eText, eText); + } + break; + case BBCODE: + if (!end) { + switch (tag) { + case BB_B: + //Utils::appendText(str, sizeAlloced, L""); + Utils::appendText(str, sizeAlloced, L""); + break; + case BB_I: + //Utils::appendText(str, sizeAlloced, L""); + Utils::appendText(str, sizeAlloced, L""); + break; + case BB_U: + //Utils::appendText(str, sizeAlloced, L""); + Utils::appendText(str, sizeAlloced, L""); + break; + case BB_S: + //Utils::appendText(str, sizeAlloced, L""); + Utils::appendText(str, sizeAlloced, L""); + break; + case BB_CODE: + //Utils::appendText(str, sizeAlloced, L""); + Utils::appendText(str, sizeAlloced, L"
");
+				break;
+			case BB_IMG:
+				eText = htmlEncode(wtext);
+				if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_FLASH) && eText != NULL && (wcsstr(eText, L".swf") != NULL)) {
+					Utils::appendText(str, sizeAlloced,
+						L"
\ +
", + eText); + } + else if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_PNGHACK) && eText != NULL && (wcsstr(eText, L".png") != NULL)) { + Utils::appendText(str, sizeAlloced, L"", eText); + } + else { + if (eText != NULL && wcsncmp(eText, L"http://", 7)) { Utils::appendText(str, sizeAlloced, L"
this.width ? 'auto' : maxw);\" src=\"file://%s\" />
", eText); } - break; - case BB_URL: - eText = htmlEncode(wtext); - eLink = htmlEncode(wlink); - Utils::appendText(str, sizeAlloced, L"%s", eLink, eText); - break; - case BB_COLOR: - eText = htmlEncode(wtext); - //Utils::appendText(str, sizeAlloced, L"", eText); - Utils::appendText(str, sizeAlloced, L"", eText); - break; - case BB_BACKGROUND: - eText = htmlEncode(wtext); - Utils::appendText(str, sizeAlloced, L"", eText); - break; - case BB_SIZE: - eText = htmlEncode(wtext); - Utils::appendText(str, sizeAlloced, L"", eText); - break; + else { + Utils::appendText(str, sizeAlloced, L"
this.width ? 'auto' : maxw);\" src=\"%s\" />
", eText); + } } - } else { - switch (tag) { - case BB_B: - Utils::appendText(str, sizeAlloced, L"
"); - break; - case BB_I: - Utils::appendText(str, sizeAlloced, L"
"); - break; - case BB_U: - Utils::appendText(str, sizeAlloced, L""); - break; - case BB_S: - Utils::appendText(str, sizeAlloced, L"
"); - break; - case BB_CODE: - Utils::appendText(str, sizeAlloced, L"
"); - break; - case BB_COLOR: - Utils::appendText(str, sizeAlloced, L""); - break; - case BB_SIZE: - Utils::appendText(str, sizeAlloced, L""); - break; - case BB_BACKGROUND: - Utils::appendText(str, sizeAlloced, L""); - break; + break; + case BB_BIMG: + eText = htmlEncode(mir_ptr(Utils::toAbsolute(wtext))); + + if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_FLASH) && (wcsstr(eText, L".swf") != NULL)) { + Utils::appendText(str, sizeAlloced, + L"
\ +
", + eText); + } + else if ((Options::getGeneralFlags()&Options::GENERAL_ENABLE_PNGHACK) && (wcsstr(eText, L".png") != NULL)) { + Utils::appendText(str, sizeAlloced, L"", eText); + } + else { + Utils::appendText(str, sizeAlloced, L"
this.width ? 'auto' : maxw);\" src=\"file://%s\" />
", eText); } + break; + case BB_URL: + eText = htmlEncode(wtext); + eLink = htmlEncode(wlink); + Utils::appendText(str, sizeAlloced, L"%s", eLink, eText); + break; + case BB_COLOR: + eText = htmlEncode(wtext); + //Utils::appendText(str, sizeAlloced, L"", eText); + Utils::appendText(str, sizeAlloced, L"", eText); + break; + case BB_BACKGROUND: + eText = htmlEncode(wtext); + Utils::appendText(str, sizeAlloced, L"", eText); + break; + case BB_SIZE: + eText = htmlEncode(wtext); + Utils::appendText(str, sizeAlloced, L"", eText); + break; + } + } + else { + switch (tag) { + case BB_B: + Utils::appendText(str, sizeAlloced, L"
"); + break; + case BB_I: + Utils::appendText(str, sizeAlloced, L""); + break; + case BB_U: + Utils::appendText(str, sizeAlloced, L""); + break; + case BB_S: + Utils::appendText(str, sizeAlloced, L"
"); + break; + case BB_CODE: + Utils::appendText(str, sizeAlloced, L"
"); + break; + case BB_COLOR: + Utils::appendText(str, sizeAlloced, L""); + break; + case BB_SIZE: + Utils::appendText(str, sizeAlloced, L"
"); + break; + case BB_BACKGROUND: + Utils::appendText(str, sizeAlloced, L""); + break; } - break; + } + break; } - if (eText!=NULL) delete eText; - if (eLink!=NULL) delete eLink; + if (eText != NULL) delete eText; + if (eLink != NULL) delete eLink; } diff --git a/plugins/IEView/src/TextToken.h b/plugins/IEView/src/TextToken.h index e9b2417ca4..68e607cd69 100644 --- a/plugins/IEView/src/TextToken.h +++ b/plugins/IEView/src/TextToken.h @@ -84,7 +84,6 @@ public: static TextToken* tokenizeLinks(const wchar_t *wtext); static TextToken* tokenizeSmileys(MCONTACT hContact, const char *proto, const wchar_t *wtext, bool isSent); static TextToken* tokenizeBBCodes(const wchar_t *text); - static TextToken* tokenizeMath(const wchar_t *text); static TextToken* tokenizeChatFormatting(const wchar_t *text); }; #endif diff --git a/plugins/IEView/src/ieview_common.h b/plugins/IEView/src/ieview_common.h index fbfb60b3ec..fe3301f549 100644 --- a/plugins/IEView/src/ieview_common.h +++ b/plugins/IEView/src/ieview_common.h @@ -53,7 +53,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include #include "IEView.h" diff --git a/plugins/IEView/src/resource.h b/plugins/IEView/src/resource.h index 073073f64e..ce77e9d24f 100644 --- a/plugins/IEView/src/resource.h +++ b/plugins/IEView/src/resource.h @@ -33,7 +33,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define IDC_SCROLL_BACKGROUND_IMAGE 1003 #define IDC_ENABLE_BBCODES 1004 #define IDC_ENABLE_FLASH 1005 -#define IDC_ENABLE_MATHMODULE 1006 #define IDC_ENABLE_PNGHACK 1007 #define IDC_SMILEYS_IN_NAMES 1008 #define IDC_NO_BORDER 1009 diff --git a/plugins/MyDetails/src/commons.h b/plugins/MyDetails/src/commons.h index 408feb8ba8..ee2e8c56eb 100644 --- a/plugins/MyDetails/src/commons.h +++ b/plugins/MyDetails/src/commons.h @@ -46,7 +46,6 @@ Boston, MA 02111-1307, USA. #include #include #include -#include #include #include #include diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index c6afc471e8..8244c6e7b2 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -219,10 +219,6 @@ void Protocol::GetStatusMsg(int aStatus, TCHAR *msg, size_t msg_size) ptrT tmp((TCHAR *)CallProtoService(name, PS_GETMYAWAYMSG, 0, SGMA_TCHAR)); lcopystr(msg, tmp == NULL ? _T("") : tmp, msg_size); } - else if (ServiceExists(MS_AWAYMSG_GETSTATUSMSGT)) { - ptrT tmp((TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)aStatus, 0)); - lcopystr(msg, tmp == NULL ? _T("") : tmp, msg_size); - } } TCHAR* Protocol::GetStatusMsg() @@ -443,13 +439,6 @@ Protocol *ProtocolArray::Get(const char *name) return NULL; } - -bool ProtocolArray::CanSetStatusMsgPerProtocol() -{ - return ServiceExists(MS_SA_CHANGESTATUSMSG) != 0; -} - - void ProtocolArray::GetAvatars() { for (int i = 0; i < buffer_len; i++) @@ -558,12 +547,6 @@ TCHAR *ProtocolArray::GetDefaultStatusMsg(int status) if (status == ID_STATUS_CONNECTING) status = ID_STATUS_OFFLINE; - TCHAR *tmp = (TCHAR *)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)status, 0); - if (tmp != NULL) { - lstrcpyn(default_status_message, tmp, SIZEOF(default_status_message)); - mir_free(tmp); - } - return default_status_message; } diff --git a/plugins/MyDetails/src/data.h b/plugins/MyDetails/src/data.h index 53bc6ade9d..803c6ecc23 100644 --- a/plugins/MyDetails/src/data.h +++ b/plugins/MyDetails/src/data.h @@ -134,8 +134,6 @@ public: void GetStatuses(); int GetGlobalStatus(); - bool CanSetStatusMsgPerProtocol(); - void GetDefaultNick(); // Copy to cache void GetDefaultAvatar(); // Copy to cache TCHAR *GetDefaultStatusMsg(); // Copy to cache diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 2469e22728..3e1309edd8 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -1806,26 +1806,6 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar HMENU submenu = GetSubMenu(menu, 3); TranslateMenu(submenu); - if (protocols->CanSetStatusMsgPerProtocol()) { - // Add this proto to menu - mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my status message for %s..."), proto->description); - - MENUITEMINFO mii = {0}; - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_ID | MIIM_TYPE; - mii.fType = MFT_STRING; - mii.dwTypeData = tmp; - mii.cch = (int)_tcslen(tmp); - mii.wID = 1; - - if (!proto->CanSetStatusMsg()) { - mii.fMask |= MIIM_STATE; - mii.fState = MFS_DISABLED; - } - - InsertMenuItem(submenu, 0, TRUE, &mii); - } - // Add this to menu mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my status message for %s..."), CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, proto->status, GSMDF_TCHAR)); @@ -1927,26 +1907,6 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii); - if (protocols->CanSetStatusMsgPerProtocol()) { - // Add this proto to menu - mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my status message for %s..."), proto->description); - - ZeroMemory(&mii, sizeof(mii)); - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_ID | MIIM_TYPE; - mii.fType = MFT_STRING; - mii.dwTypeData = tmp; - mii.cch = (int)_tcslen(tmp); - mii.wID = 3; - - if ( !proto->CanSetStatusMsg()) { - mii.fMask |= MIIM_STATE; - mii.fState = MFS_DISABLED; - } - - InsertMenuItem(submenu, 0, TRUE, &mii); - } - mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my nickname for %s..."), proto->description); ZeroMemory(&mii, sizeof(mii)); diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp index 7b8d6bf2f3..5316f302eb 100644 --- a/plugins/MyDetails/src/mydetails.cpp +++ b/plugins/MyDetails/src/mydetails.cpp @@ -488,19 +488,9 @@ static INT_PTR PluginCommand_SetMyStatusMessageUI(WPARAM wParam, LPARAM lParam) if (proto_num == -1) return -1; - if (protocols->CanSetStatusMsgPerProtocol() && !proto->CanSetStatusMsg()) + if (!proto->CanSetStatusMsg()) return -2; } - else if (ServiceExists(MS_SA_CHANGESTATUSMSG)) { - if (proto == NULL && status == 0) - CallService(MS_SA_CHANGESTATUSMSG, protocols->GetGlobalStatus(), NULL); - else if (status == 0) - CallService(MS_SA_CHANGESTATUSMSG, proto->status, (LPARAM)proto_name); - else - CallService(MS_SA_CHANGESTATUSMSG, status, (LPARAM)proto_name); - - return 0; - } if (proto == NULL || proto->status != ID_STATUS_OFFLINE) { if (!status_msg_dialog_open) { diff --git a/plugins/NewAwaySysMod/NewAwaySys_12.vcxproj b/plugins/NewAwaySysMod/NewAwaySys_12.vcxproj index e0731ab734..c4d959a7d7 100644 --- a/plugins/NewAwaySysMod/NewAwaySys_12.vcxproj +++ b/plugins/NewAwaySysMod/NewAwaySys_12.vcxproj @@ -82,7 +82,6 @@ MultiThreadedDebugDLL Use Level3 - EditAndContinue Common.h @@ -91,6 +90,7 @@ Windows false $(ProfileDir)..\..\bin12\lib + comctl32.lib;%(AdditionalDependencies) _DEBUG;%(PreprocessorDefinitions) @@ -114,6 +114,7 @@ Windows false $(ProfileDir)..\..\bin12\lib + comctl32.lib;%(AdditionalDependencies) _DEBUG;%(PreprocessorDefinitions) @@ -143,6 +144,7 @@ Windows false $(ProfileDir)..\..\bin12\lib + comctl32.lib;%(AdditionalDependencies) NDEBUG;%(PreprocessorDefinitions) @@ -172,6 +174,7 @@ Windows false $(ProfileDir)..\..\bin12\lib + comctl32.lib;%(AdditionalDependencies) NDEBUG;%(PreprocessorDefinitions) diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 0dae3e2a38..225620bdce 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -34,7 +34,6 @@ #include "m_idle.h" #include "m_statusplugins.h" #include "m_NewAwaySys.h" -#include "m_ContactSettings.h" #include "MsgTree.h" #include "ContactList.h" #include "Properties.h" @@ -159,32 +158,6 @@ int StatusMsgReq(WPARAM wParam, LPARAM lParam, CString &szProto) if (!iMode) VarParseData.Flags |= VPF_XSTATUS; - TCString LogMsg; - if (!iMode) { // if it's an xstatus message request - LogMsg = db_get_s(NULL, szProto, "XStatusName", _T("")); - TCString XMsg(db_get_s(NULL, szProto, "XStatusMsg", _T(""))); - if (XMsg.GetLen()) { - if (LogMsg.GetLen()) - LogMsg += _T("\r\n"); - - LogMsg += XMsg; - } - } - else LogMsg = VarParseData.Message; - - if (ServiceExists(MS_VARS_FORMATSTRING)) - logservice_log(LOG_ID, hFoundContact, LogMsg); - else { - TCString szUIN; - _ultot(lParam, szUIN.GetBuffer(16), 10); - szUIN.ReleaseBuffer(); - TCHAR *szStatDesc = iMode ? pcli->pfnGetStatusModeDescription(iMode, 0) : STR_XSTATUSDESC; - if (!szStatDesc) { - _ASSERT(0); - szStatDesc = _T(""); - } - logservice_log(LOG_ID, hFoundContact, TCString(pcli->pfnGetContactDisplayName(hFoundContact, 0)) + _T(" (") + szUIN + TranslateT(") read your ") + szStatDesc + TranslateT(" message:\r\n") + LogMsg); - } return 0; } @@ -473,70 +446,6 @@ static int IconsChanged(WPARAM, LPARAM) return 0; } -static int ContactSettingsInit(WPARAM wParam, LPARAM) -{ - CONTACTSETTINGSINIT *csi = (CONTACTSETTINGSINIT*)wParam; - char *szProto = (csi->Type == CSIT_CONTACT) ? GetContactProto(csi->hContact) : NULL; - if ((csi->Type == CSIT_GROUP) || szProto) { - int Flag1 = (csi->Type == CSIT_CONTACT) ? CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) : PF1_IM; // we assume that there can be some contacts in the group with PF1_IM capability - if ((Flag1 & PF1_IM) == PF1_IM || Flag1 & PF1_INDIVMODEMSG) { // does contact's protocol supports message sending/receiving or individual status messages? - CONTACTSETTINGSCONTROL csc = { 0 }; - csc.cbSize = sizeof(csc); - csc.cbStateSize = sizeof(CSCONTROLSTATE); - csc.Position = CSPOS_SORTBYALPHABET; - csc.ControlType = CSCT_CHECKBOX; - csc.szModule = MOD_NAME; - csc.StateNum = 3; - csc.DefState = 2; // these settings are used for all controls below - - int StatusMode = 0; - if (csi->Type == CSIT_CONTACT) { - CContactSettings CSettings(0, csi->hContact); - StatusMode = CSettings.Status; - } - else { - _ASSERT(csi->Type == CSIT_GROUP); - StatusMode = g_ProtoStates[(char*)NULL].Status; - } - - if (StatusMode == ID_STATUS_OFFLINE) - StatusMode = ID_STATUS_AWAY; - - CString Setting; - TCHAR Title[128]; - csc.Flags = CSCF_TCHAR | CSCF_DONT_TRANSLATE_STRINGS; // these Flags and ptszGroup are used for both controls below - csc.ptszGroup = TranslateT("New Away System"); - - if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS)) { - mir_sntprintf(Title, SIZEOF(Title), TranslateT("Enable autoreply when you are %s"), pcli->pfnGetStatusModeDescription(StatusMode, 0)); - csc.ptszTitle = Title; - csc.ptszTooltip = TranslateT("\"Store contact autoreply/ignore settings for each status separately\" is enabled, so this setting is per-contact AND per-status."); - } - else { - csc.ptszTitle = TranslateT("Enable autoreply"); - csc.ptszTooltip = NULL; - } - Setting = StatusToDBSetting(StatusMode, DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS); - csc.szSetting = Setting; - CallService(MS_CONTACTSETTINGS_ADDCONTROL, wParam, (LPARAM)&csc); - - if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS)) { - mir_sntprintf(Title, SIZEOF(Title), TranslateT("Don't send status message when you are %s"), pcli->pfnGetStatusModeDescription(StatusMode, 0)); - csc.ptszTitle = Title; - csc.ptszTooltip = TranslateT("Ignore status message requests from this contact and don't send an autoreply.\r\n\"Store contact autoreply/ignore settings for each status separately\" is enabled, so this setting is per-contact AND per-status."); - } - else { - csc.ptszTitle = TranslateT("Don't send status message"); - csc.ptszTooltip = TranslateT("Ignore status message requests from this contact and don't send an autoreply"); - } - Setting = StatusToDBSetting(StatusMode, DB_IGNOREREQUESTS, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS); - csc.szSetting = Setting; - CallService(MS_CONTACTSETTINGS_ADDCONTROL, wParam, (LPARAM)&csc); - } - } - return 0; -} - ///////////////////////////////////////////////////////////////////////////////////////// // variables @@ -700,7 +609,6 @@ int MirandaLoaded(WPARAM, LPARAM) HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PreBuildContactMenu); HookEvent(ME_SKIN_ICONSCHANGED, IconsChanged); HookEvent(ME_IDLE_CHANGED, IdleChangeEvent); - HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInit); g_hReadWndList = WindowList_Create(); @@ -801,8 +709,6 @@ extern "C" int __declspec(dllexport) Load(void) InitCommonControls(); InitOptions(); // must be called before we hook CallService - logservice_register(LOG_ID, LPGENT("New Away System"), _T("NewAwaySys?puts(p,?dbsetting(%subject%,Protocol,p))?if2(_?dbsetting(,?get(p),?pinfo(?get(p),uidsetting)),).log"), TranslateT("`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,id)) read your %nas_statdesc% message:\r\n%extratext%\r\n\r\n")); - if (db_get_b(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 1) { // change all %nas_message% variables to %extratext% if it wasn't done before TCString Str = db_get_s(NULL, MOD_NAME, "PopupsFormat", _T("")); if (Str.GetLen()) diff --git a/plugins/NewAwaySysMod/src/Common.h b/plugins/NewAwaySysMod/src/Common.h index 95d3268684..f9ca1ef548 100644 --- a/plugins/NewAwaySysMod/src/Common.h +++ b/plugins/NewAwaySysMod/src/Common.h @@ -67,9 +67,6 @@ #include "m_toptoolbar.h" #include "m_popup.h" #include "m_metacontacts.h" -#include "m_LogService.h" - -#pragma comment(lib,"comctl32.lib") #include "CString.h" #include "Options.h" diff --git a/plugins/New_GPG/src/commonheaders.h b/plugins/New_GPG/src/commonheaders.h index 01a1d59ff5..5af43c1c9e 100644 --- a/plugins/New_GPG/src/commonheaders.h +++ b/plugins/New_GPG/src/commonheaders.h @@ -62,7 +62,7 @@ using std::fstream; #include #include #include -#include +#include #include #include #include diff --git a/plugins/NotifyAnything/src/common.h b/plugins/NotifyAnything/src/common.h index ff1f9c2588..0b44f0e8db 100644 --- a/plugins/NotifyAnything/src/common.h +++ b/plugins/NotifyAnything/src/common.h @@ -16,8 +16,6 @@ #include "m_database.h" #include "m_popup.h" -#include "m_LogService.h" - #include "resource.h" #include "Version.h" @@ -49,5 +47,4 @@ void load_settings(); int OptionsInitialize(WPARAM wParam, LPARAM lParam); extern std::string g_mirandaDir; -extern bool IsLogService; #define LOG_ID LPGEN("NotifyAnything") diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp index dc93702c32..a545a16518 100644 --- a/plugins/NotifyAnything/src/main.cpp +++ b/plugins/NotifyAnything/src/main.cpp @@ -17,30 +17,18 @@ back to the main thread. void cslog(const char *what, const char *file, int line) { - if (IsLogService){ - std::string LogString; - char buf[10]; - LogString = what; - LogString += ": "; - LogString += file; - LogString += ":"; - LogString += itoa(line, buf, 10); - logservice_log(LOG_ID, NULL, (TCHAR *) LogString.c_str()); - } - else { - if (g_settings.log_to_file) { - time_t t_; - time(&t_); - tm *t = localtime(&t_); - //FILE *f = fopen("na.log", "a"); - FILE *f = fopen(g_settings.log_filename.c_str(), "a"); - if (f) { - //fprintf(f, "%s: %s:%i\n", what, file, line); - fprintf(f, "[%04i-%02i-%02i %02i:%02i:%02i cs] %s: %s:%i\n", - int(t->tm_year+1900), int(t->tm_mon), int(t->tm_mday), - int(t->tm_hour), int(t->tm_min), int(t->tm_sec), what, file, line); - fclose(f); - } + if (g_settings.log_to_file) { + time_t t_; + time(&t_); + tm *t = localtime(&t_); + //FILE *f = fopen("na.log", "a"); + FILE *f = fopen(g_settings.log_filename.c_str(), "a"); + if (f) { + //fprintf(f, "%s: %s:%i\n", what, file, line); + fprintf(f, "[%04i-%02i-%02i %02i:%02i:%02i cs] %s: %s:%i\n", + int(t->tm_year + 1900), int(t->tm_mon), int(t->tm_mday), + int(t->tm_hour), int(t->tm_min), int(t->tm_sec), what, file, line); + fclose(f); } } } @@ -64,7 +52,6 @@ SOCKET g_udp_socket, g_tcp_socket; volatile bool g_exit_threads, g_firstrun; std::string g_mirandaDir; CRITICAL_SECTION g_wsocklock; -bool IsLogService; HINSTANCE hInst; int hLangpack; @@ -80,7 +67,7 @@ PLUGININFOEX pluginInfo = { __AUTHORWEB, UNICODE_AWARE, // {E92874EC-594A-4A2F-BDED-C0BE8B5A45D1} - {0xe92874ec, 0x594a, 0x4a2f, {0xbd, 0xed, 0xc0, 0xbe, 0x8b, 0x5a, 0x45, 0xd1}} + { 0xe92874ec, 0x594a, 0x4a2f, { 0xbd, 0xed, 0xc0, 0xbe, 0x8b, 0x5a, 0x45, 0xd1 } } }; BOOL WINAPI DllMain(HINSTANCE hi, DWORD, LPVOID) @@ -117,8 +104,8 @@ std::string strip(std::string str) { while (!str.empty() && isspace(str[0])) str.erase(0, 1); - while (!str.empty() && isspace(*(str.end()-1))) - str.erase(str.size()-1); + while (!str.empty() && isspace(*(str.end() - 1))) + str.erase(str.size() - 1); return str; } @@ -127,23 +114,18 @@ void dbg_msg(std::string str, int type) str = strip(str); if (g_settings.debug_messages) - CallServiceSync(MS_POPUP_SHOWMESSAGE, (WPARAM) const_cast(str.c_str()), (LPARAM) type); - - if (IsLogService){ - logservice_log(LOG_ID, NULL, (TCHAR *) str.c_str()); - } - else { - if (g_settings.log_to_file) { - time_t t_; - time(&t_); - tm *t = localtime(&t_); - FILE *f = fopen(g_settings.log_filename.c_str(), "a"); - if (f) { - fprintf(f, "[%04i-%02i-%02i %02i:%02i:%02i dbg_msg] %s\n", - int(t->tm_year+1900), int(t->tm_mon), int(t->tm_mday), - int(t->tm_hour), int(t->tm_min), int(t->tm_sec), str.c_str()); - fclose(f); - } + CallServiceSync(MS_POPUP_SHOWMESSAGE, (WPARAM) const_cast(str.c_str()), (LPARAM)type); + + if (g_settings.log_to_file) { + time_t t_; + time(&t_); + tm *t = localtime(&t_); + FILE *f = fopen(g_settings.log_filename.c_str(), "a"); + if (f) { + fprintf(f, "[%04i-%02i-%02i %02i:%02i:%02i dbg_msg] %s\n", + int(t->tm_year + 1900), int(t->tm_mon), int(t->tm_mday), + int(t->tm_hour), int(t->tm_min), int(t->tm_sec), str.c_str()); + fclose(f); } } } @@ -153,10 +135,10 @@ void showLastError() int err = GetLastError(); LPVOID lpMsgBuf; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL); - dbg_msg((char *) lpMsgBuf, SM_WARNING); + dbg_msg((char *)lpMsgBuf, SM_WARNING); LocalFree(lpMsgBuf); } @@ -169,7 +151,7 @@ struct enum_icons_t { BOOL CALLBACK enum_icons_func(HMODULE, LPCTSTR, LPTSTR name, LONG_PTR data) { - enum_icons_t *info = (enum_icons_t *) data; + enum_icons_t *info = (enum_icons_t *)data; if (!--info->nr) { info->found = true; info->name = name; @@ -232,8 +214,8 @@ HICON getIcon(const std::string &name) if (p == name.npos) { // try to load icon file HANDLE h = LoadImageA(NULL, name.c_str(), IMAGE_ICON, 16, 16, LR_LOADFROMFILE); - if (h != NULL) - return icons[name] = (HICON) h; + if (h != NULL) + return icons[name] = (HICON)h; showLastError(); return deficon; @@ -241,7 +223,7 @@ HICON getIcon(const std::string &name) std::tstring file((TCHAR*)_A2T(name.c_str()), 0, p); - std::tstring rname(file.c_str(), p+1); + std::tstring rname(file.c_str(), p + 1); if (rname.empty()) { dbg_msg(Translate("No resource name given."), SM_WARNING); return deficon; @@ -262,8 +244,8 @@ HICON getIcon(const std::string &name) dbg_msg("Icon indices start at 1.", SM_WARNING); return deficon; } - - BOOL ok = EnumResourceNames(module, RT_GROUP_ICON, enum_icons_func, (LONG_PTR) &info); + + BOOL ok = EnumResourceNames(module, RT_GROUP_ICON, enum_icons_func, (LONG_PTR)&info); if (!info.found) { if (!ok) { if (GetLastError()) { @@ -277,7 +259,7 @@ HICON getIcon(const std::string &name) resname = info.name; } - HICON icon = (HICON) LoadImage(module, resname, IMAGE_ICON, 16, 16, 0); + HICON icon = (HICON)LoadImage(module, resname, IMAGE_ICON, 16, 16, 0); FreeLibrary(module); if (!icon) { @@ -285,7 +267,7 @@ HICON getIcon(const std::string &name) return deficon; } - return icons[name] = (HICON) icon; + return icons[name] = (HICON)icon; } bool getNext(std::string &out, std::string &in, char sep) @@ -297,18 +279,18 @@ bool getNext(std::string &out, std::string &in, char sep) while (!in.empty()) { if (in[0] == sep) { - in.erase(0,1); + in.erase(0, 1); return true; } if (in[0] == '\"') { - in.erase(0,1); + in.erase(0, 1); size_t p = in.find('\"'); if (p == in.npos) throw "Unterminated quote: \"" + in; out += '"'; out.append(in, 0, p); out += '"'; - in.erase(0, p+1); + in.erase(0, p + 1); return true; } if (!in.compare(0, 3, "<[[")) { @@ -317,12 +299,12 @@ bool getNext(std::string &out, std::string &in, char sep) if (p == in.npos) throw "Unterminated \"<[[\": <[[" + in; out.append(in, 0, p); - in.erase(0, p+3); + in.erase(0, p + 3); return true; } out += in[0]; - in.erase(0,1); + in.erase(0, 1); return true; } return false; @@ -341,9 +323,9 @@ void getAll(std::vector &out, std::string &in, char sep, bool unquo std::string arg; while (getNext(arg, in, sep)) if (!arg.empty()) { - if (unquote_) - arg = unquote(arg); - out.push_back(arg); + if (unquote_) + arg = unquote(arg); + out.push_back(arg); } } @@ -380,7 +362,7 @@ void processSingleAction(const std::string &what, bool &closeflag) throw "Insufficient arguments: " + what; std::vector cargs; - for (std::vector::iterator i=args.begin(), e=args.end(); i!=e; ++i) + for (std::vector::iterator i = args.begin(), e = args.end(); i != e; ++i) cargs.push_back(i->c_str()); cargs.push_back(0); @@ -404,10 +386,11 @@ void processSingleAction(const std::string &what, bool &closeflag) const char *cargs = decode_se_arg(args); - if ((int) ShellExecuteA(0, "open", file.c_str(), cargs, 0, SW_SHOWNORMAL) <= 32) + if ((int)ShellExecuteA(0, "open", file.c_str(), cargs, 0, SW_SHOWNORMAL) <= 32) throw "Failed to open: " + file + " " + args; - } else if (!what.compare(0, 6, "shell:")) { + } + else if (!what.compare(0, 6, "shell:")) { if (!g_settings.allow_execute) { dbg_msg(Translate("Application launching is disabled."), SM_WARNING); return; @@ -427,10 +410,11 @@ void processSingleAction(const std::string &what, bool &closeflag) args = strip(args); dir = /*unquote(*/strip(dir)/*)*/; - if ((int) ShellExecuteA(0, decode_se_arg(verb), decode_se_arg(file), + if ((int)ShellExecuteA(0, decode_se_arg(verb), decode_se_arg(file), decode_se_arg(args), decode_se_arg(dir), SW_SHOWNORMAL) <= 32) throw "Failed: " + what; - } else if (what == "close") + } + else if (what == "close") closeflag = true; else throw "Action not recognized: " + what; @@ -456,47 +440,47 @@ void processAction(const std::string &what, bool &closeflag) static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { popup_t *pd = 0; - pd = (popup_t *) CallService(MS_POPUP_GETPLUGINDATA, (WPARAM) hWnd, (LPARAM) pd); + pd = (popup_t *)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, (LPARAM)pd); if (!pd) return FALSE; switch (message) { case WM_COMMAND: - { - EnterCS(&g_popups_cs); - std::string left; - if (pd) - left = pd->left; - LeaveCS(&g_popups_cs); + { + EnterCS(&g_popups_cs); + std::string left; + if (pd) + left = pd->left; + LeaveCS(&g_popups_cs); - if (left.empty()) + if (left.empty()) + PUDeletePopup(hWnd); + else { + bool closeflag = false; + processAction(left, closeflag); + if (closeflag) PUDeletePopup(hWnd); - else { - bool closeflag = false; - processAction(left, closeflag); - if (closeflag) - PUDeletePopup(hWnd); - } } + } return TRUE; case WM_CONTEXTMENU: - { - EnterCS(&g_popups_cs); - std::string right; - if (pd) - right = pd->right; - LeaveCS(&g_popups_cs); + { + EnterCS(&g_popups_cs); + std::string right; + if (pd) + right = pd->right; + LeaveCS(&g_popups_cs); - if (right.empty()) + if (right.empty()) + PUDeletePopup(hWnd); + else { + bool closeflag = false; + processAction(right, closeflag); + if (closeflag) PUDeletePopup(hWnd); - else { - bool closeflag = false; - processAction(right, closeflag); - if (closeflag) - PUDeletePopup(hWnd); - } } + } return TRUE; case UM_INITPOPUP: @@ -534,7 +518,7 @@ int showMessage(const popup_t &msg) ppd.colorBack = msg.background; ppd.colorText = msg.foreground; ppd.lchIcon = getIcon(msg.icon); - ppd.PluginWindowProc = (WNDPROC) PopupDlgProc; + ppd.PluginWindowProc = (WNDPROC)PopupDlgProc; ppd.iSeconds = msg.delay; EnterCS(&g_popups_cs); @@ -605,23 +589,25 @@ inline int dehex(int c) { COLORREF parseColor(const std::string &buf, bool &ok) { ok = false; - for (int i=0; i!=buf.size(); ++i) + for (int i = 0; i != buf.size(); ++i) if (!isxdigit(buf[i])) - return RGB(0,0,0); + return RGB(0, 0, 0); if (buf.size() == 6) { int r = (dehex(buf[0]) << 4) + dehex(buf[1]); int g = (dehex(buf[2]) << 4) + dehex(buf[3]); int b = (dehex(buf[4]) << 4) + dehex(buf[5]); ok = true; - return RGB(r,g,b); - } else if (buf.size() == 3) { - int r = dehex(buf[0])*17; - int g = dehex(buf[1])*17; - int b = dehex(buf[2])*17; + return RGB(r, g, b); + } + else if (buf.size() == 3) { + int r = dehex(buf[0]) * 17; + int g = dehex(buf[1]) * 17; + int b = dehex(buf[2]) * 17; ok = true; - return RGB(r,g,b); - } else - return RGB(0,0,0); + return RGB(r, g, b); + } + else + return RGB(0, 0, 0); } void loadDefaults(popup_t &msg, char ch) @@ -632,16 +618,16 @@ void loadDefaults(popup_t &msg, char ch) switch (ch) { case '%': msg.icon = "message"; - msg.background = RGB(173,206,247); - msg.foreground = RGB(0,0,0); + msg.background = RGB(173, 206, 247); + msg.foreground = RGB(0, 0, 0); msg.contact = "Message"; msg.beep = true; msg.sound = "Message"; return; case '!': msg.icon = "exclamation"; - msg.background = RGB(191,0,0); - msg.foreground = RGB(255,245,225); + msg.background = RGB(191, 0, 0); + msg.foreground = RGB(255, 245, 225); msg.contact = "Error"; msg.beep = true; msg.sound = "Error"; @@ -649,8 +635,8 @@ void loadDefaults(popup_t &msg, char ch) case ' ': default: msg.icon = "information"; - msg.background = RGB(255,245,225); - msg.foreground = RGB(0,0,0); + msg.background = RGB(255, 245, 225); + msg.foreground = RGB(0, 0, 0); msg.contact = "Notice"; msg.beep = true; msg.sound = "Notice"; @@ -665,7 +651,7 @@ bool parseSimpleMessage(const std::string &buf, popup_t &msg, char sep) msg.message = buf; else { msg.contact.assign(buf, 0, p); - msg.message.assign(buf, p+1, buf.npos); + msg.message.assign(buf, p + 1, buf.npos); } return true; } @@ -692,17 +678,18 @@ bool parseComplexMessage(const std::string &buf, popup_t &msg, char sep) std::string what(p, wend); std::string arg; if (wend == cpos && wend && npos) - arg.assign(cpos+1, npos); + arg.assign(cpos + 1, npos); else if (!cpos) arg.erase(); else - arg = cpos+1; + arg = cpos + 1; if (!g_settings.password.empty() && !passok) { if (what == "passwd" && arg == g_settings.password) { passok = true; continue; - } else + } + else return false; } @@ -714,13 +701,15 @@ bool parseComplexMessage(const std::string &buf, popup_t &msg, char sep) if (!cpos) { dbg_msg(Translate("No argument given to msg option."), SM_WARNING); return false; - } else if (msg.replace != xno && msg.id.empty()) { + } + else if (msg.replace != xno && msg.id.empty()) { dbg_msg(Translate("ID is required for replacement."), SM_WARNING); return false; } msg.message = arg; return true; - } else if (what == "replace") { + } + else if (what == "replace") { if (arg == "yes") msg.replace = xreplace; else if (arg == "append") @@ -731,7 +720,8 @@ bool parseComplexMessage(const std::string &buf, popup_t &msg, char sep) msg.replace = xno; else dbg_msg(Translate("Invalid argument for replace option: ") + arg, SM_WARNING); - } else if (what == "sound") { + } + else if (what == "sound") { if (arg.empty()) msg.beep = false; else { @@ -739,43 +729,54 @@ bool parseComplexMessage(const std::string &buf, popup_t &msg, char sep) msg.sound = arg; registerSound(arg); } - } else if (what == "left") { + } + else if (what == "left") { msg.left = arg; - } else if (what == "right") { + } + else if (what == "right") { msg.right = arg; - } else if (what == "opened") { + } + else if (what == "opened") { msg.opened = arg; - } else if (what == "closed") { + } + else if (what == "closed") { msg.closed = arg; - } else if (what == "delay") { + } + else if (what == "delay") { msg.delay = atoi(arg.c_str()); - } else if (what == "id") { + } + else if (what == "id") { msg.id = arg; - } else if (what == "bg") { + } + else if (what == "bg") { bool ok; msg.background = parseColor(arg, ok); if (!ok) dbg_msg("Invalid color: " + arg, SM_WARNING); - } else if (what == "fg") { + } + else if (what == "fg") { bool ok; msg.foreground = parseColor(arg, ok); if (!ok) dbg_msg("Invalid color: " + arg, SM_WARNING); - } else if (what == "from") + } + else if (what == "from") msg.contact = arg; else if (what == "sep") { if (arg.size() == 1) sep = arg[0]; else dbg_msg("Invalid argument for sep option: " + arg, SM_WARNING); - } else if (what == "beep") { + } + else if (what == "beep") { if (arg == "1") msg.beep = true; else if (arg == "0") msg.beep = false; else dbg_msg("Invalid argument for beep option: " + arg, SM_WARNING); - } else + } + else dbg_msg("Unknown option: " + what, SM_NOTIFY); } return true; @@ -799,7 +800,8 @@ bool parseMessage(const std::string &abuf, popup_t &msg) if (buf.size() < 2) return false; loadDefaults(msg, buf[0]); buf.erase(0, 1); - } else + } + else loadDefaults(msg, ' '); if (buf[0] == sep) @@ -812,24 +814,20 @@ bool parseMessage(const std::string &abuf, popup_t &msg) void processMessage(std::string buf) { - if (IsLogService){ - logservice_log(LOG_ID, NULL, (TCHAR *) buf.c_str()); - } - else { - if (g_settings.log_to_file) { - time_t t_; - time(&t_); - tm *t = localtime(&t_); - FILE *f = fopen(g_settings.log_filename.c_str(), "a"); - if (f) { - bool err = fprintf(f, "[%04i-%02i-%02i %02i:%02i:%02i] %s\n", - int(t->tm_year+1900), int(t->tm_mon+1), int(t->tm_mday), - int(t->tm_hour), int(t->tm_min), int(t->tm_sec), buf.c_str()) < 0; - if (fclose(f) == EOF || err) - dbg_msg(Translate("Failed to write to log file."), SM_WARNING); - } else - dbg_msg(Translate("Failed to open log file."), SM_WARNING); + if (g_settings.log_to_file) { + time_t t_; + time(&t_); + tm *t = localtime(&t_); + FILE *f = fopen(g_settings.log_filename.c_str(), "a"); + if (f) { + bool err = fprintf(f, "[%04i-%02i-%02i %02i:%02i:%02i] %s\n", + int(t->tm_year + 1900), int(t->tm_mon + 1), int(t->tm_mday), + int(t->tm_hour), int(t->tm_min), int(t->tm_sec), buf.c_str()) < 0; + if (fclose(f) == EOF || err) + dbg_msg(Translate("Failed to write to log file."), SM_WARNING); } + else + dbg_msg(Translate("Failed to open log file."), SM_WARNING); } popup_t msg; @@ -925,7 +923,8 @@ DWORD udptcpThreadFunc(LPVOID useUdp) if (err > 0) processMessage(buf); } - } else { + } + else { listen(sock, SOMAXCONN); while (!g_exit_threads) { int fromSize = sizeof from; @@ -944,7 +943,8 @@ DWORD udptcpThreadFunc(LPVOID useUdp) if (err < 0) { totalbuf.clear(); break; - } else if (err == 0) + } + else if (err == 0) break; else { totallen += err; @@ -974,7 +974,8 @@ DWORD udptcpThreadFunc(LPVOID useUdp) t += Translate("N/A: FormatMessage failed, error code was 0x"); char tbuf[10]; t += itoa(ec, tbuf, 16); - } else + } + else t += buf; MessageBoxA(0, t.c_str(), Translate("Error"), MB_OK); @@ -986,10 +987,10 @@ void start_threads() { g_exit_threads = false; DWORD id; - g_udp_thread = CreateThread(NULL, 0, - (LPTHREAD_START_ROUTINE) udptcpThreadFunc, (LPVOID) 1, 0, &id); - g_tcp_thread = CreateThread(NULL, 0, - (LPTHREAD_START_ROUTINE) udptcpThreadFunc, NULL, 0, &id); + g_udp_thread = CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)udptcpThreadFunc, (LPVOID)1, 0, &id); + g_tcp_thread = CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)udptcpThreadFunc, NULL, 0, &id); } void stop_threads() @@ -1003,17 +1004,13 @@ void stop_threads() WaitForSingleObject(g_tcp_thread, INFINITE); } -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { return &pluginInfo; } int ModulesLoaded(WPARAM wParam, LPARAM lParam) { - IsLogService = ServiceExists(MS_LOGSERVICE_REGISTER) != 0; - if (IsLogService) - logservice_register(LOG_ID, LPGENT(LOG_ID), NULL, NULL); - return 0; } @@ -1022,7 +1019,7 @@ extern "C" int __declspec(dllexport) Load() g_firstrun = true; mir_getLP(&pluginInfo); - char buf[MAX_PATH+1]; + char buf[MAX_PATH + 1]; strcpy(buf, "."); g_mirandaDir = getcwd(buf, MAX_PATH); diff --git a/plugins/NotifyAnything/src/options.cpp b/plugins/NotifyAnything/src/options.cpp index 69468f95e5..47cdaeecf6 100644 --- a/plugins/NotifyAnything/src/options.cpp +++ b/plugins/NotifyAnything/src/options.cpp @@ -11,30 +11,8 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara char buf[10]; CheckDlgButton(hwndDlg, NA_LOCAL_CHECK, g_settings.local_only ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, NA_DEBUG_MSG_CHECK, g_settings.debug_messages ? BST_CHECKED : BST_UNCHECKED); - if (IsLogService) { - LS_LOGINFO pli; - pli.szID = LOG_ID; - pli.hContact = NULL; - pli.szLogPath = NULL; - pli.Flags = 0; - pli.cbSize = sizeof(LS_LOGINFO); - if (!CallService(MS_LOGSERVICE_GETLOGINFO, (WPARAM)(LS_LOGINFO *) &pli, 0)) { - CheckDlgButton(hwndDlg, NA_LOG_CHECK, (pli.Flags && LSLI_LOGENABLED) ? BST_CHECKED : BST_UNCHECKED); - } - std::tstring InLogService = TranslateT("Services"); - InLogService += _T(" -> "); - InLogService += TranslateT("LogService"); - InLogService += _T(" -> "); - InLogService += TranslateT(LOG_ID); - SetDlgItemText(hwndDlg, NA_LOG_FILENAME, InLogService.c_str()); - } - else { - CheckDlgButton(hwndDlg, NA_LOG_CHECK, g_settings.log_to_file ? BST_CHECKED : BST_UNCHECKED); - SetDlgItemTextA(hwndDlg, NA_LOG_FILENAME, g_settings.log_filename.c_str()); - } - EnableWindow(GetDlgItem(hwndDlg, NA_LOG_CHECK), !IsLogService); - EnableWindow(GetDlgItem(hwndDlg, NA_LOG_FILENAME), !IsLogService); - EnableWindow(GetDlgItem(hwndDlg, NA_LOG_BROWSE), !IsLogService); + CheckDlgButton(hwndDlg, NA_LOG_CHECK, g_settings.log_to_file ? BST_CHECKED : BST_UNCHECKED); + SetDlgItemTextA(hwndDlg, NA_LOG_FILENAME, g_settings.log_filename.c_str()); EnableWindow(GetDlgItem(hwndDlg, NA_DEBUG_MSG_CHECK), IsDlgButtonChecked(hwndDlg, NA_LOG_CHECK) ? 1 : 0); CheckDlgButton(hwndDlg, NA_PCSPEAKER_CHECK, g_settings.use_pcspeaker ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, NA_ALLOW_EXECUTE, g_settings.allow_execute ? BST_CHECKED : BST_UNCHECKED); @@ -134,12 +112,6 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara buf[0] = '\0'; s.password = _T2A(buf); - if (!IsLogService) { - if (!GetDlgItemText(hwndDlg, NA_LOG_FILENAME, buf, sizeof buf - 1)) - buf[0] = '\0'; - s.log_filename = _T2A(buf); - } - g_settings = s; save_settings(); stop_threads(); diff --git a/plugins/QuickContacts/res/resource.rc b/plugins/QuickContacts/res/resource.rc index 0f173ee773..75b589855f 100644 --- a/plugins/QuickContacts/res/resource.rc +++ b/plugins/QuickContacts/res/resource.rc @@ -73,7 +73,6 @@ BEGIN 176,11 CONTROL "",IDC_MESSAGE,"MButtonClass",0x0,41,36,17,15, 0x18000000L - CONTROL "",IDC_VOICE,"MButtonClass",0x0,62,36,17,15,0x18000000L CONTROL "",IDC_FILE,"MButtonClass",0x0,83,36,17,15,0x18000000L CONTROL "",IDC_URL,"MButtonClass",0x0,104,36,17,15,0x18000000L CONTROL "",IDC_USERINFO,"MButtonClass",0x0,125,36,17,15, @@ -119,7 +118,6 @@ BEGIN "I", HOTKEY_INFO, VIRTKEY, CONTROL, NOINVERT "M", HOTKEY_MENU, VIRTKEY, CONTROL, NOINVERT "U", HOTKEY_URL, VIRTKEY, CONTROL, NOINVERT - "V", HOTKEY_VOICE, VIRTKEY, CONTROL, NOINVERT END #ifdef APSTUDIO_INVOKED diff --git a/plugins/QuickContacts/src/commons.h b/plugins/QuickContacts/src/commons.h index b9c41b88e9..ab0397762f 100644 --- a/plugins/QuickContacts/src/commons.h +++ b/plugins/QuickContacts/src/commons.h @@ -44,7 +44,6 @@ Boston, MA 02111-1307, USA. #include #include -#include #include #include "../utils/mir_options.h" diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 6cd7065ba3..fe69dea394 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -132,12 +132,6 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) hkd.pszService = NULL; - hkd.lParam = HOTKEY_VOICE; - hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'V'); - hkd.pszName = "Quick Contacts/Voice"; - hkd.ptszDescription = LPGENT("Make a voice call"); - Hotkey_Register(&hkd); - hkd.lParam = HOTKEY_FILE; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, 'F'); hkd.pszName = "Quick Contacts/File"; @@ -443,7 +437,6 @@ void EnableButtons(HWND hwndDlg, MCONTACT hContact) if (hContact == NULL) { EnableWindow(GetDlgItem(hwndDlg, IDC_MESSAGE), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_VOICE), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_FILE), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_URL), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_USERINFO), FALSE); @@ -466,11 +459,7 @@ void EnableButtons(HWND hwndDlg, MCONTACT hContact) if (pszProto != NULL) caps = CallProtoService(pszProto, PS_GETCAPS, PFLAGNUM_1, 0); - BOOL voice = (ServiceExists(MS_VOICESERVICE_CAN_CALL) - && CallService(MS_VOICESERVICE_CAN_CALL, hContact, 0) > 0); - EnableWindow(GetDlgItem(hwndDlg, IDC_MESSAGE), caps & PF1_IMSEND ? TRUE : FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_VOICE), voice); EnableWindow(GetDlgItem(hwndDlg, IDC_FILE), caps & PF1_FILESEND ? TRUE : FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_URL), caps & PF1_URLSEND ? TRUE : FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_USERINFO), TRUE); @@ -770,17 +759,6 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA // Buttons FillCheckbox(hwndDlg, IDC_SHOW_ALL_CONTACTS, LPGENT("Show all contacts"), hasNewHotkeyModule ? NULL : _T("Ctrl+A")); FillButton(hwndDlg, IDC_MESSAGE, LPGENT("Send message"), NULL, LoadSkinnedIcon(SKINICON_EVENT_MESSAGE)); - - if (ServiceExists(MS_VOICESERVICE_CAN_CALL)) - FillButton(hwndDlg, IDC_VOICE, LPGENT("Make a voice call"), hasNewHotkeyModule ? NULL : _T("Ctrl+V"), Skin_GetIcon("vca_call")); - else - { - GetWindowRect(GetDlgItem(hwndDlg, IDC_VOICE), &rc); - ScreenToClient(hwndDlg, &rc); - MoveWindow(GetDlgItem(hwndDlg, IDC_MESSAGE), rc, FALSE); - ShowWindow(GetDlgItem(hwndDlg, IDC_VOICE), SW_HIDE); - } - FillButton(hwndDlg, IDC_FILE, LPGENT("Send file"), hasNewHotkeyModule ? NULL : _T("Ctrl+F"), LoadSkinnedIcon(SKINICON_EVENT_FILE)); FillButton(hwndDlg, IDC_URL, LPGENT("Send URL"), hasNewHotkeyModule ? NULL : _T("Ctrl+U"), LoadSkinnedIcon(SKINICON_EVENT_URL)); FillButton(hwndDlg, IDC_USERINFO, LPGENT("Open user info"), hasNewHotkeyModule ? NULL : _T("Ctrl+I"), LoadSkinnedIcon(SKINICON_OTHER_USERDETAILS)); @@ -848,30 +826,6 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendMessage(hwndDlg, WM_CLOSE, 0, 0); break; } - case HOTKEY_VOICE: - case IDC_VOICE: - { - MCONTACT hContact = GetSelectedContact(hwndDlg); - if (hContact == NULL) - { - SetDlgItemText(hwndDlg, IDC_USERNAME, _T("")); - SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); - break; - } - - // Is button enabled? - if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_VOICE))) - break; - - if (!ServiceExists(MS_VOICESERVICE_CALL)) - break; - - CallService(MS_VOICESERVICE_CALL, (WPARAM) hContact, 0); - - db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact); - SendMessage(hwndDlg, WM_CLOSE, 0, 0); - } - break; case HOTKEY_FILE: case IDC_FILE: diff --git a/plugins/QuickContacts/src/resource.h b/plugins/QuickContacts/src/resource.h index f7f6a0142f..38fd6df5cb 100644 --- a/plugins/QuickContacts/src/resource.h +++ b/plugins/QuickContacts/src/resource.h @@ -23,15 +23,12 @@ #define IDC_USERINFO 1065 #define IDC_HISTORY 1066 #define IDC_MENU 1067 -#define IDC_VOICE 1068 #define HOTKEY_FILE 40001 #define HOTKEY_URL 40002 #define HOTKEY_INFO 40003 #define HOTKEY_HISTORY 40004 #define HOTKEY_ALL_CONTACTS 40005 #define HOTKEY_MENU 40006 -#define HOTKEY_VOICE 40007 -#define IDC_STATIC -1 // Next default values for new objects // diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 81442e02e1..17b43b5381 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -446,9 +446,5 @@ int LoadAwayMsgModule(void) HookEvent(ME_CLIST_PREBUILDCONTACTMENU, AwayMsgPreBuildMenu); - // Deprecated SimpleAway services - CreateServiceFunction(MS_SA_COPYAWAYMSG, CopyAwayMsgCommand); - CreateServiceFunction(MS_SA_GOTOURLMSG, GoToURLMsgCommand); - return 0; } diff --git a/plugins/SimpleStatusMsg/src/commonheaders.h b/plugins/SimpleStatusMsg/src/commonheaders.h index 30b7b51e82..b709b87837 100644 --- a/plugins/SimpleStatusMsg/src/commonheaders.h +++ b/plugins/SimpleStatusMsg/src/commonheaders.h @@ -42,7 +42,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include -#include #include #include "simplestatusmsg.h" diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 530c769fa2..4e9ff62d91 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -1184,66 +1184,6 @@ static INT_PTR ChangeStatusMsg(WPARAM wParam, LPARAM lParam) return 0; } -static INT_PTR SetOfflineStatus(WPARAM wParam, LPARAM lParam) -{ - ChangeStatusMessage((WPARAM)ID_STATUS_OFFLINE, 0); - return 0; -} - -static INT_PTR SetOnlineStatus(WPARAM wParam, LPARAM lParam) -{ - ChangeStatusMessage((WPARAM)ID_STATUS_ONLINE, 0); - return 0; -} - -static INT_PTR SetAwayStatus(WPARAM wParam, LPARAM lParam) -{ - ChangeStatusMessage((WPARAM)ID_STATUS_AWAY, 0); - return 0; -} - -static INT_PTR SetDNDStatus(WPARAM wParam, LPARAM lParam) -{ - ChangeStatusMessage((WPARAM)ID_STATUS_DND, 0); - return 0; -} - -static INT_PTR SetNAStatus(WPARAM wParam, LPARAM lParam) -{ - ChangeStatusMessage((WPARAM)ID_STATUS_NA, 0); - return 0; -} - -static INT_PTR SetOccupiedStatus(WPARAM wParam, LPARAM lParam) -{ - ChangeStatusMessage((WPARAM)ID_STATUS_OCCUPIED, 0); - return 0; -} - -static INT_PTR SetFreeChatStatus(WPARAM wParam, LPARAM lParam) -{ - ChangeStatusMessage((WPARAM)ID_STATUS_FREECHAT, 0); - return 0; -} - -static INT_PTR SetInvisibleStatus(WPARAM wParam, LPARAM lParam) -{ - ChangeStatusMessage((WPARAM)ID_STATUS_INVISIBLE, 0); - return 0; -} - -static INT_PTR SetOnThePhoneStatus(WPARAM wParam, LPARAM lParam) -{ - ChangeStatusMessage((WPARAM)ID_STATUS_ONTHEPHONE, 0); - return 0; -} - -static INT_PTR SetOutToLunchStatus(WPARAM wParam, LPARAM lParam) -{ - ChangeStatusMessage((WPARAM)ID_STATUS_OUTTOLUNCH, 0); - return 0; -} - static int ProcessProtoAck(WPARAM wParam,LPARAM lParam) { ACKDATA *ack = (ACKDATA *)lParam; @@ -1965,11 +1905,6 @@ static int OnPreShutdown(WPARAM wParam, LPARAM lParam) return 0; } -static INT_PTR IsSARunning(WPARAM wParam, LPARAM lParam) -{ - return 1; -} - //remember to mir_free() the return value static INT_PTR sttGetAwayMessageT(WPARAM wParam, LPARAM lParam) { @@ -1995,24 +1930,6 @@ extern "C" int __declspec(dllexport) Load(void) CreateServiceFunction(MS_SIMPLESTATUSMSG_CHANGESTATUSMSG, ChangeStatusMsg); CreateServiceFunction(MS_SIMPLESTATUSMSG_SHOWDIALOGINT, ShowStatusMessageDialogInternal); // internal use ONLY - // Deprecated SimpleAway services - CreateServiceFunction(MS_SA_ISSARUNNING, IsSARunning); - CreateServiceFunction(MS_SA_CHANGESTATUSMSG, ChangeStatusMsg); - CreateServiceFunction(MS_SA_TTCHANGESTATUSMSG, ShowStatusMessageDialogInternal); - CreateServiceFunction(MS_SA_SHOWSTATUSMSGDIALOG, ShowStatusMessageDialog); - CreateServiceFunction(MS_SA_SETSTATUSMODE, SetStatusModeFromExtern); - - CreateServiceFunction(MS_SA_SETOFFLINESTATUS, SetOfflineStatus); - CreateServiceFunction(MS_SA_SETONLINESTATUS, SetOnlineStatus); - CreateServiceFunction(MS_SA_SETAWAYSTATUS, SetAwayStatus); - CreateServiceFunction(MS_SA_SETDNDSTATUS, SetDNDStatus); - CreateServiceFunction(MS_SA_SETNASTATUS, SetNAStatus); - CreateServiceFunction(MS_SA_SETOCCUPIEDSTATUS, SetOccupiedStatus); - CreateServiceFunction(MS_SA_SETFREECHATSTATUS, SetFreeChatStatus); - CreateServiceFunction(MS_SA_SETINVISIBLESTATUS, SetInvisibleStatus); - CreateServiceFunction(MS_SA_SETONTHEPHONESTATUS, SetOnThePhoneStatus); - CreateServiceFunction(MS_SA_SETOUTTOLUNCHSTATUS, SetOutToLunchStatus); - HookEvent(ME_SYSTEM_OKTOEXIT, OnOkToExit); HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown); diff --git a/plugins/SimpleStatusMsg/src/simplestatusmsg.h b/plugins/SimpleStatusMsg/src/simplestatusmsg.h index f78f04dcbc..c1ca255b19 100644 --- a/plugins/SimpleStatusMsg/src/simplestatusmsg.h +++ b/plugins/SimpleStatusMsg/src/simplestatusmsg.h @@ -34,6 +34,9 @@ PROTOACCOUNTS; extern PROTOACCOUNTS *accounts; +// Represents status that a protocol(s) is/are currently in +#define ID_STATUS_CURRENT 40082 + #define DLG_SHOW_STATUS 1 #define DLG_SHOW_STATUS_ICONS 2 #define DLG_SHOW_LIST_ICONS 4 diff --git a/plugins/UserInfoEx/src/commonheaders.h b/plugins/UserInfoEx/src/commonheaders.h index a44ad92343..e4ed409e68 100644 --- a/plugins/UserInfoEx/src/commonheaders.h +++ b/plugins/UserInfoEx/src/commonheaders.h @@ -76,7 +76,6 @@ using namespace std; #include #include #include -#include #include #include #include diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp index 6dab5f380d..0d59af26ec 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp @@ -211,13 +211,6 @@ static void GetInitialDir(LPSTR pszInitialDir) if (!PathToAbsolute(szRelative, pszInitialDir)) strcpy(pszInitialDir, szRelative); } - else if (//try to use environment variables supported by pathpatch of db3xSA - !ServiceExists(MS_DB_GETPROFILEPATH_BASIC) || - !PathToAbsolute(PROFILEPATH "\\" PROFILENAME, pszInitialDir)) { - // use standard path to absolute - if ( !PathToAbsolute("", pszInitialDir)) - *pszInitialDir = 0; - } else *pszInitialDir = 0; } diff --git a/protocols/IRCG/src/irc.h b/protocols/IRCG/src/irc.h index 27ef8bc750..89f2edd82d 100644 --- a/protocols/IRCG/src/irc.h +++ b/protocols/IRCG/src/irc.h @@ -73,8 +73,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "m_string.h" #include "win2k.h" -#include "m_ircscript.h" - #include "resource.h" #define IRC_QUICKCONNECT "/QuickConnectMenu" @@ -459,10 +457,6 @@ struct CIrcProto : public PROTO INT_PTR __cdecl Scripting_InsertGuiIn(WPARAM wParam,LPARAM lParam); INT_PTR __cdecl Scripting_InsertGuiOut(WPARAM wParam,LPARAM lParam); INT_PTR __cdecl Scripting_GetIrcData(WPARAM wparam, LPARAM lparam); - BOOL Scripting_TriggerMSPRawIn(char ** pszRaw); - BOOL Scripting_TriggerMSPRawOut(char ** pszRaw); - BOOL Scripting_TriggerMSPGuiIn(WPARAM * wparam, GCEVENT *gce); - BOOL Scripting_TriggerMSPGuiOut(GCHOOK * gch); // services.cpp void ConnectToServer(void); @@ -654,10 +648,6 @@ HICON LoadIconEx(int iIndex, bool big = false); HANDLE GetIconHandle(int iconId); void ReleaseIconEx(HICON hIcon); -// services.cpp - -extern BOOL bChatInstalled, m_bMbotInstalled; - //tools.cpp int __stdcall WCCmp(const TCHAR* wild, const TCHAR* string); char* __stdcall IrcLoadFile(TCHAR * szPath); diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index 369d2ff6ed..0e1fc195b6 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -276,13 +276,13 @@ void CIrcProto::Notify(const CIrcMessage* pmsg) int CIrcProto::NLSend(const unsigned char* buf, int cbBuf) { - if (m_bMbotInstalled && m_scriptingEnabled) { + if (m_scriptingEnabled) { int iVal = NULL; char * pszTemp = 0; pszTemp = (char*)mir_alloc(lstrlenA((const char *)buf) + 1); lstrcpynA(pszTemp, (const char *)buf, lstrlenA((const char *)buf) + 1); - if (Scripting_TriggerMSPRawOut(&pszTemp) && pszTemp) { + if (pszTemp) { if (con) iVal = Netlib_Send(con, (const char*)pszTemp, lstrlenA(pszTemp), MSG_DUMPASTEXT); } @@ -413,10 +413,10 @@ void CIrcProto::DoReceive() // process single message by monitor objects if (*pStart) { - if (m_bMbotInstalled && m_scriptingEnabled) { + if (m_scriptingEnabled) { char* pszTemp = mir_strdup(pStart); - if (Scripting_TriggerMSPRawIn(&pszTemp) && pszTemp) { + if (pszTemp) { char* p1 = pszTemp; // replace end-of-line with NULLs while (*p1 != '\0') { diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index e6a93a0d42..a212afdfdb 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -26,18 +26,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static volatile LONG g_msgid = 1; -static int CompareSessions( const CDccSession* p1, const CDccSession* p2 ) +static int CompareSessions(const CDccSession* p1, const CDccSession* p2) { - return INT_PTR( p1->di->hContact ) - INT_PTR( p2->di->hContact ); + return INT_PTR(p1->di->hContact) - INT_PTR(p2->di->hContact); } CIrcProto::CIrcProto(const char* szModuleName, const TCHAR* tszUserName) : - PROTO(szModuleName, tszUserName), - m_dcc_chats( 10, CompareSessions ), - m_dcc_xfers( 10, CompareSessions ), - m_ignoreItems( 10 ), - vUserhostReasons( 10 ), - vWhoInProgress( 10 ) +PROTO(szModuleName, tszUserName), +m_dcc_chats(10, CompareSessions), +m_dcc_xfers(10, CompareSessions), +m_ignoreItems(10), +vUserhostReasons(10), +vWhoInProgress(10) { InitializeCriticalSection(&cs); InitializeCriticalSection(&m_gchook); @@ -77,69 +77,69 @@ CIrcProto::CIrcProto(const char* szModuleName, const TCHAR* tszUserName) : CList_SetAllOffline(true); IRC_MAP_ENTRY("PING", PING) - IRC_MAP_ENTRY("JOIN", JOIN) - IRC_MAP_ENTRY("QUIT", QUIT) - IRC_MAP_ENTRY("KICK", KICK) - IRC_MAP_ENTRY("MODE", MODE) - IRC_MAP_ENTRY("NICK", NICK) - IRC_MAP_ENTRY("PART", PART) - IRC_MAP_ENTRY("PRIVMSG", PRIVMSG) - IRC_MAP_ENTRY("TOPIC", TOPIC) - IRC_MAP_ENTRY("NOTICE", NOTICE) - IRC_MAP_ENTRY("PING", PINGPONG) - IRC_MAP_ENTRY("PONG", PINGPONG) - IRC_MAP_ENTRY("INVITE", INVITE) - IRC_MAP_ENTRY("ERROR", ERROR) - IRC_MAP_ENTRY("001", WELCOME) - IRC_MAP_ENTRY("002", YOURHOST) - IRC_MAP_ENTRY("005", SUPPORT) - IRC_MAP_ENTRY("223", WHOIS_OTHER) //CodePage info - IRC_MAP_ENTRY("254", NOOFCHANNELS) - IRC_MAP_ENTRY("263", TRYAGAIN) - IRC_MAP_ENTRY("264", WHOIS_OTHER) //Encryption info (SSL connect) - IRC_MAP_ENTRY("301", WHOIS_AWAY) - IRC_MAP_ENTRY("302", USERHOST_REPLY) - IRC_MAP_ENTRY("305", BACKFROMAWAY) - IRC_MAP_ENTRY("306", SETAWAY) - IRC_MAP_ENTRY("307", WHOIS_AUTH) - IRC_MAP_ENTRY("310", WHOIS_OTHER) - IRC_MAP_ENTRY("311", WHOIS_NAME) - IRC_MAP_ENTRY("312", WHOIS_SERVER) - IRC_MAP_ENTRY("313", WHOIS_OTHER) - IRC_MAP_ENTRY("315", WHO_END) - IRC_MAP_ENTRY("317", WHOIS_IDLE) - IRC_MAP_ENTRY("318", WHOIS_END) - IRC_MAP_ENTRY("319", WHOIS_CHANNELS) - IRC_MAP_ENTRY("320", WHOIS_AUTH) - IRC_MAP_ENTRY("321", LISTSTART) - IRC_MAP_ENTRY("322", LIST) - IRC_MAP_ENTRY("323", LISTEND) - IRC_MAP_ENTRY("324", MODEQUERY) - IRC_MAP_ENTRY("330", WHOIS_AUTH) - IRC_MAP_ENTRY("332", INITIALTOPIC) - IRC_MAP_ENTRY("333", INITIALTOPICNAME) - IRC_MAP_ENTRY("352", WHO_REPLY) - IRC_MAP_ENTRY("353", NAMES) - IRC_MAP_ENTRY("366", ENDNAMES) - IRC_MAP_ENTRY("367", BANLIST) - IRC_MAP_ENTRY("368", BANLISTEND) - IRC_MAP_ENTRY("346", BANLIST) - IRC_MAP_ENTRY("347", BANLISTEND) - IRC_MAP_ENTRY("348", BANLIST) - IRC_MAP_ENTRY("349", BANLISTEND) - IRC_MAP_ENTRY("371", WHOIS_OTHER) - IRC_MAP_ENTRY("376", ENDMOTD) - IRC_MAP_ENTRY("401", WHOIS_NO_USER) - IRC_MAP_ENTRY("403", JOINERROR) - IRC_MAP_ENTRY("416", WHOTOOLONG) - IRC_MAP_ENTRY("421", UNKNOWN) - IRC_MAP_ENTRY("422", ENDMOTD) - IRC_MAP_ENTRY("433", NICK_ERR) - IRC_MAP_ENTRY("471", JOINERROR) - IRC_MAP_ENTRY("473", JOINERROR) - IRC_MAP_ENTRY("474", JOINERROR) - IRC_MAP_ENTRY("475", JOINERROR) - IRC_MAP_ENTRY("671", WHOIS_OTHER) //Encryption info (SSL connect) + IRC_MAP_ENTRY("JOIN", JOIN) + IRC_MAP_ENTRY("QUIT", QUIT) + IRC_MAP_ENTRY("KICK", KICK) + IRC_MAP_ENTRY("MODE", MODE) + IRC_MAP_ENTRY("NICK", NICK) + IRC_MAP_ENTRY("PART", PART) + IRC_MAP_ENTRY("PRIVMSG", PRIVMSG) + IRC_MAP_ENTRY("TOPIC", TOPIC) + IRC_MAP_ENTRY("NOTICE", NOTICE) + IRC_MAP_ENTRY("PING", PINGPONG) + IRC_MAP_ENTRY("PONG", PINGPONG) + IRC_MAP_ENTRY("INVITE", INVITE) + IRC_MAP_ENTRY("ERROR", ERROR) + IRC_MAP_ENTRY("001", WELCOME) + IRC_MAP_ENTRY("002", YOURHOST) + IRC_MAP_ENTRY("005", SUPPORT) + IRC_MAP_ENTRY("223", WHOIS_OTHER) //CodePage info + IRC_MAP_ENTRY("254", NOOFCHANNELS) + IRC_MAP_ENTRY("263", TRYAGAIN) + IRC_MAP_ENTRY("264", WHOIS_OTHER) //Encryption info (SSL connect) + IRC_MAP_ENTRY("301", WHOIS_AWAY) + IRC_MAP_ENTRY("302", USERHOST_REPLY) + IRC_MAP_ENTRY("305", BACKFROMAWAY) + IRC_MAP_ENTRY("306", SETAWAY) + IRC_MAP_ENTRY("307", WHOIS_AUTH) + IRC_MAP_ENTRY("310", WHOIS_OTHER) + IRC_MAP_ENTRY("311", WHOIS_NAME) + IRC_MAP_ENTRY("312", WHOIS_SERVER) + IRC_MAP_ENTRY("313", WHOIS_OTHER) + IRC_MAP_ENTRY("315", WHO_END) + IRC_MAP_ENTRY("317", WHOIS_IDLE) + IRC_MAP_ENTRY("318", WHOIS_END) + IRC_MAP_ENTRY("319", WHOIS_CHANNELS) + IRC_MAP_ENTRY("320", WHOIS_AUTH) + IRC_MAP_ENTRY("321", LISTSTART) + IRC_MAP_ENTRY("322", LIST) + IRC_MAP_ENTRY("323", LISTEND) + IRC_MAP_ENTRY("324", MODEQUERY) + IRC_MAP_ENTRY("330", WHOIS_AUTH) + IRC_MAP_ENTRY("332", INITIALTOPIC) + IRC_MAP_ENTRY("333", INITIALTOPICNAME) + IRC_MAP_ENTRY("352", WHO_REPLY) + IRC_MAP_ENTRY("353", NAMES) + IRC_MAP_ENTRY("366", ENDNAMES) + IRC_MAP_ENTRY("367", BANLIST) + IRC_MAP_ENTRY("368", BANLISTEND) + IRC_MAP_ENTRY("346", BANLIST) + IRC_MAP_ENTRY("347", BANLISTEND) + IRC_MAP_ENTRY("348", BANLIST) + IRC_MAP_ENTRY("349", BANLISTEND) + IRC_MAP_ENTRY("371", WHOIS_OTHER) + IRC_MAP_ENTRY("376", ENDMOTD) + IRC_MAP_ENTRY("401", WHOIS_NO_USER) + IRC_MAP_ENTRY("403", JOINERROR) + IRC_MAP_ENTRY("416", WHOTOOLONG) + IRC_MAP_ENTRY("421", UNKNOWN) + IRC_MAP_ENTRY("422", ENDMOTD) + IRC_MAP_ENTRY("433", NICK_ERR) + IRC_MAP_ENTRY("471", JOINERROR) + IRC_MAP_ENTRY("473", JOINERROR) + IRC_MAP_ENTRY("474", JOINERROR) + IRC_MAP_ENTRY("475", JOINERROR) + IRC_MAP_ENTRY("671", WHOIS_OTHER) //Encryption info (SSL connect) } CIrcProto::~CIrcProto() @@ -170,7 +170,7 @@ CIrcProto::~CIrcProto() //////////////////////////////////////////////////////////////////////////////////////// // OnModulesLoaded - performs hook registration -static COLORREF crCols[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; +static COLORREF crCols[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; static int sttCheckPerform(const char *szSetting, LPARAM lParam) { @@ -207,42 +207,30 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) nlu.ptszDescriptiveName = name; hNetlibDCC = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu); - if (ServiceExists("MBot/GetFcnTable")) { - CallService(MS_MBOT_REGISTERIRC, 0, (LPARAM)m_szModuleName); - m_bMbotInstalled = TRUE; - } - - if (ServiceExists(MS_GC_REGISTER)) { - GCREGISTER gcr = { sizeof(GCREGISTER) }; - gcr.dwFlags = GC_CHANMGR | GC_BOLD | GC_ITALICS | GC_UNDERLINE | GC_COLOR | GC_BKGCOLOR; - gcr.nColors = 16; - gcr.pColors = colors; - gcr.ptszDispName = m_tszUserName; - gcr.pszModule = m_szModuleName; - CallServiceSync(MS_GC_REGISTER, NULL, (LPARAM)&gcr); - - HookProtoEvent(ME_GC_EVENT, &CIrcProto::GCEventHook); - HookProtoEvent(ME_GC_BUILDMENU, &CIrcProto::GCMenuHook); - - GCSESSION gcw = { sizeof(GCSESSION) }; - gcw.iType = GCW_SERVER; - gcw.ptszID = SERVERWINDOW; - gcw.pszModule = m_szModuleName; - gcw.ptszName = NEWTSTR_ALLOCA((TCHAR*)_A2T(m_network)); - CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw); - - GCDEST gcd = { m_szModuleName, SERVERWINDOW, GC_EVENT_CONTROL }; - GCEVENT gce = { sizeof(gce), &gcd }; - if (m_useServer && !m_hideServerWindow) - CallChatEvent(WINDOW_VISIBLE, (LPARAM)&gce); - else - CallChatEvent(WINDOW_HIDDEN, (LPARAM)&gce); - bChatInstalled = TRUE; - } - else { - if (IDYES == MessageBox(0, TranslateT("The IRC protocol depends on another plugin called 'Chat'\n\nDo you want to download it from the Miranda NG web site now?"), TranslateT("Information"), MB_YESNO | MB_ICONINFORMATION)) - CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://miranda-ng.org/"); - } + GCREGISTER gcr = { sizeof(GCREGISTER) }; + gcr.dwFlags = GC_CHANMGR | GC_BOLD | GC_ITALICS | GC_UNDERLINE | GC_COLOR | GC_BKGCOLOR; + gcr.nColors = 16; + gcr.pColors = colors; + gcr.ptszDispName = m_tszUserName; + gcr.pszModule = m_szModuleName; + CallServiceSync(MS_GC_REGISTER, NULL, (LPARAM)&gcr); + + HookProtoEvent(ME_GC_EVENT, &CIrcProto::GCEventHook); + HookProtoEvent(ME_GC_BUILDMENU, &CIrcProto::GCMenuHook); + + GCSESSION gcw = { sizeof(GCSESSION) }; + gcw.iType = GCW_SERVER; + gcw.ptszID = SERVERWINDOW; + gcw.pszModule = m_szModuleName; + gcw.ptszName = NEWTSTR_ALLOCA((TCHAR*)_A2T(m_network)); + CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw); + + GCDEST gcd = { m_szModuleName, SERVERWINDOW, GC_EVENT_CONTROL }; + GCEVENT gce = { sizeof(gce), &gcd }; + if (m_useServer && !m_hideServerWindow) + CallChatEvent(WINDOW_VISIBLE, (LPARAM)&gce); + else + CallChatEvent(WINDOW_HIDDEN, (LPARAM)&gce); TCHAR szTemp[MAX_PATH]; mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\%S_perform.ini"), m_szModuleName); @@ -774,7 +762,7 @@ struct TFakeAckParam { __inline TFakeAckParam(MCONTACT _hContact, int _msgid) : hContact(_hContact), msgid(_msgid) - {} + {} MCONTACT hContact; int msgid; @@ -861,9 +849,6 @@ int __cdecl CIrcProto::SetStatus(int iNewStatus) int CIrcProto::SetStatusInternal(int iNewStatus, bool bIsInternal) { - if (!bChatInstalled) - return 0; - if (iNewStatus != ID_STATUS_OFFLINE && !m_network[0]) { if (m_nick[0] && !m_disableDefaultServer) { CQuickDlg* dlg = new CQuickDlg(this); diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 5ffdac047a..a5805e266f 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -1026,7 +1026,6 @@ void COtherPrefsDlg::OnInitDialog() m_quitMessage.SetText(m_proto->m_quitMessage); m_perform.SetState(m_proto->m_perform); m_scripting.SetState(m_proto->m_scriptingEnabled); - m_scripting.Enable(m_bMbotInstalled); m_performCombo.Enable(m_proto->m_perform); m_pertormEdit.Enable(m_proto->m_perform); m_add.Enable(m_proto->m_perform); diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp index 84dfcc8203..484a2b6739 100644 --- a/protocols/IRCG/src/scripting.cpp +++ b/protocols/IRCG/src/scripting.cpp @@ -25,7 +25,7 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertRawIn(WPARAM, LPARAM lParam) { char* pszRaw = (char*)lParam; - if (m_bMbotInstalled && m_scriptingEnabled && pszRaw && IsConnected()) { + if (m_scriptingEnabled && pszRaw && IsConnected()) { TCHAR* p = mir_a2t(pszRaw); InsertIncomingEvent(p); mir_free(p); @@ -38,7 +38,7 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertRawIn(WPARAM, LPARAM lParam) INT_PTR __cdecl CIrcProto::Scripting_InsertRawOut( WPARAM, LPARAM lParam ) { char* pszRaw = (char*)lParam; - if (m_bMbotInstalled && m_scriptingEnabled && pszRaw && IsConnected()) { + if (m_scriptingEnabled && pszRaw && IsConnected()) { String S = pszRaw; ReplaceString(S, "%", "%%%%"); NLSendNoScript((const unsigned char *)S.c_str(), lstrlenA(S.c_str())); @@ -75,7 +75,7 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertGuiOut(WPARAM, LPARAM lParam) { GCHOOK* gch = (GCHOOK*)lParam; - if (m_bMbotInstalled && m_scriptingEnabled && gch) { + if (m_scriptingEnabled && gch) { GCHOOK* gchook = new GCHOOK; gchook->pDest = new GCDEST; @@ -107,54 +107,9 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertGuiOut(WPARAM, LPARAM lParam) return 1; } -BOOL CIrcProto::Scripting_TriggerMSPRawIn(char** pszRaw) -{ - int iVal = CallService(MS_MBOT_IRC_RAW_IN, (WPARAM)m_szModuleName, (LPARAM)pszRaw); - if (iVal == 0) - return TRUE; - - return iVal > 0 ? FALSE : TRUE; -} - -BOOL CIrcProto::Scripting_TriggerMSPRawOut(char ** pszRaw) -{ - int iVal = CallService(MS_MBOT_IRC_RAW_OUT, (WPARAM)m_szModuleName, (LPARAM)pszRaw); - if (iVal == 0) - return TRUE; - - return iVal > 0 ? FALSE : TRUE; -} - -BOOL CIrcProto::Scripting_TriggerMSPGuiIn(WPARAM * wparam, GCEVENT *gce) -{ - WPARAM_GUI_IN wgi = { 0 }; - - wgi.pszModule = m_szModuleName; - wgi.wParam = *wparam; - if (gce->time == 0) - gce->time = time(0); - - int iVal = CallService(MS_MBOT_IRC_GUI_IN, (WPARAM)&wgi, (LPARAM)gce); - if (iVal == 0) { - *wparam = wgi.wParam; - return TRUE; - } - - return iVal > 0 ? FALSE : TRUE; -} - -BOOL CIrcProto::Scripting_TriggerMSPGuiOut(GCHOOK* gch) -{ - int iVal = CallService(MS_MBOT_IRC_GUI_OUT, (WPARAM)m_szModuleName, (LPARAM)gch); - if (iVal == 0) - return TRUE; - - return iVal > 0 ? FALSE : TRUE; -} - INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam) { - if (m_bMbotInstalled && m_scriptingEnabled && lparam) { + if (m_scriptingEnabled && lparam) { String sString = (char*)lparam, sRequest; CMString sOutput, sChannel; diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 1b922570d8..c7aa5a6be6 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -21,8 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "irc.h" -BOOL bChatInstalled = FALSE, m_bMbotInstalled = FALSE; - void CIrcProto::InitMainMenus(void) { char temp[MAXMODULELABELLENGTH]; @@ -31,58 +29,56 @@ void CIrcProto::InitMainMenus(void) CLISTMENUITEM mi = { sizeof(mi) }; mi.pszService = temp; - if (bChatInstalled) { - HGENMENU hRoot = MO_GetProtoRootMenu(m_szModuleName); - if (hRoot == NULL) { - // Root popupmenuitem - mi.ptszName = m_tszUserName; - mi.position = -1999901010; - mi.hParentMenu = HGENMENU_ROOT; - mi.flags = CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED; - mi.icolibItem = GetIconHandle(IDI_MAIN); - hRoot = hMenuRoot = Menu_AddProtoMenuItem(&mi); - } - else { - if (hMenuRoot) - CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)hMenuRoot, 0); - hMenuRoot = NULL; - } - - mi.flags = CMIF_CHILDPOPUP; - mi.pszName = LPGEN("&Quick connect"); - mi.icolibItem = GetIconHandle(IDI_QUICK); - strcpy(d, IRC_QUICKCONNECT); - mi.position = 201001; - mi.hParentMenu = hRoot; - hMenuQuick = Menu_AddProtoMenuItem(&mi); - - if (m_iStatus != ID_STATUS_OFFLINE) mi.flags |= CMIF_GRAYED; - - mi.pszName = LPGEN("&Join channel"); - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_JOIN);//GetIconHandle(IDI_JOIN); - strcpy(d, IRC_JOINCHANNEL); - mi.position = 201002; - hMenuJoin = Menu_AddProtoMenuItem(&mi); - - mi.pszName = LPGEN("&Change your nickname"); - mi.icolibItem = GetIconHandle(IDI_RENAME); - strcpy(d, IRC_CHANGENICK); - mi.position = 201003; - hMenuNick = Menu_AddProtoMenuItem(&mi); - - mi.pszName = LPGEN("Show the &list of available channels"); - mi.icolibItem = GetIconHandle(IDI_LIST); - strcpy(d, IRC_SHOWLIST); - mi.position = 201004; - hMenuList = Menu_AddProtoMenuItem(&mi); - - if (m_useServer) mi.flags &= ~CMIF_GRAYED; - mi.pszName = LPGEN("&Show the server window"); - mi.icolibItem = GetIconHandle(IDI_SERVER); - strcpy(d, IRC_SHOWSERVER); - mi.position = 201005; - hMenuServer = Menu_AddProtoMenuItem(&mi); + HGENMENU hRoot = MO_GetProtoRootMenu(m_szModuleName); + if (hRoot == NULL) { + // Root popupmenuitem + mi.ptszName = m_tszUserName; + mi.position = -1999901010; + mi.hParentMenu = HGENMENU_ROOT; + mi.flags = CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED; + mi.icolibItem = GetIconHandle(IDI_MAIN); + hRoot = hMenuRoot = Menu_AddProtoMenuItem(&mi); } + else { + if (hMenuRoot) + CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)hMenuRoot, 0); + hMenuRoot = NULL; + } + + mi.flags = CMIF_CHILDPOPUP; + mi.pszName = LPGEN("&Quick connect"); + mi.icolibItem = GetIconHandle(IDI_QUICK); + strcpy(d, IRC_QUICKCONNECT); + mi.position = 201001; + mi.hParentMenu = hRoot; + hMenuQuick = Menu_AddProtoMenuItem(&mi); + + if (m_iStatus != ID_STATUS_OFFLINE) mi.flags |= CMIF_GRAYED; + + mi.pszName = LPGEN("&Join channel"); + mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_JOIN);//GetIconHandle(IDI_JOIN); + strcpy(d, IRC_JOINCHANNEL); + mi.position = 201002; + hMenuJoin = Menu_AddProtoMenuItem(&mi); + + mi.pszName = LPGEN("&Change your nickname"); + mi.icolibItem = GetIconHandle(IDI_RENAME); + strcpy(d, IRC_CHANGENICK); + mi.position = 201003; + hMenuNick = Menu_AddProtoMenuItem(&mi); + + mi.pszName = LPGEN("Show the &list of available channels"); + mi.icolibItem = GetIconHandle(IDI_LIST); + strcpy(d, IRC_SHOWLIST); + mi.position = 201004; + hMenuList = Menu_AddProtoMenuItem(&mi); + + if (m_useServer) mi.flags &= ~CMIF_GRAYED; + mi.pszName = LPGEN("&Show the server window"); + mi.icolibItem = GetIconHandle(IDI_SERVER); + strcpy(d, IRC_SHOWSERVER); + mi.position = 201005; + hMenuServer = Menu_AddProtoMenuItem(&mi); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -97,8 +93,8 @@ static CIrcProto* IrcGetInstanceByHContact(MCONTACT hContact) return NULL; for (int i = 0; i < g_Instances.getCount(); i++) - if (!strcmp(szProto, g_Instances[i]->m_szModuleName)) - return g_Instances[i]; + if (!strcmp(szProto, g_Instances[i]->m_szModuleName)) + return g_Instances[i]; return NULL; } @@ -439,12 +435,12 @@ static void DoChatFormatting(TCHAR* pszText) break; case 'c': { - lstrcpy(InsertThis, _T("\003")); - iRemoveChars = 2; + lstrcpy(InsertThis, _T("\003")); + iRemoveChars = 2; - TCHAR szTemp[3]; - lstrcpyn(szTemp, p1 + 2, 3); - iFG = _ttoi(szTemp); + TCHAR szTemp[3]; + lstrcpyn(szTemp, p1 + 2, 3); + iFG = _ttoi(szTemp); } break; case 'C': @@ -534,9 +530,9 @@ int __cdecl CIrcProto::GCEventHook(WPARAM wParam, LPARAM lParam) case GC_USER_PRIVMESS: { - TCHAR szTemp[4000]; - mir_sntprintf(szTemp, SIZEOF(szTemp), _T("/QUERY %s"), gch->ptszUID); - PostIrcMessageWnd(p1, NULL, szTemp); + TCHAR szTemp[4000]; + mir_sntprintf(szTemp, SIZEOF(szTemp), _T("/QUERY %s"), gch->ptszUID); + PostIrcMessageWnd(p1, NULL, szTemp); } break; @@ -576,29 +572,29 @@ int __cdecl CIrcProto::GCEventHook(WPARAM wParam, LPARAM lParam) PostIrcMessage(_T("/nickserv DROP")); break; case 8: // nickserv Identify - { - CQuestionDlg* dlg = new CQuestionDlg(this); - dlg->Show(); - HWND question_hWnd = dlg->GetHwnd(); - HWND hEditCtrl = GetDlgItem(question_hWnd, IDC_EDIT); - SetDlgItemText(question_hWnd, IDC_CAPTION, TranslateT("Identify nick")); - SetWindowText(GetDlgItem(question_hWnd, IDC_TEXT), TranslateT("Please enter your password")); - SetDlgItemText(question_hWnd, IDC_HIDDENEDIT, _T("/nickserv IDENTIFY %question=\"%s\",\"%s\"")); - SetWindowLongPtr(GetDlgItem(question_hWnd, IDC_EDIT), GWL_STYLE, - (LONG)GetWindowLongPtr(GetDlgItem(question_hWnd, IDC_EDIT), GWL_STYLE) | ES_PASSWORD); - SendMessage(hEditCtrl, EM_SETPASSWORDCHAR, (WPARAM)_T('*'), 0); - SetFocus(hEditCtrl); - dlg->Activate(); - } + { + CQuestionDlg* dlg = new CQuestionDlg(this); + dlg->Show(); + HWND question_hWnd = dlg->GetHwnd(); + HWND hEditCtrl = GetDlgItem(question_hWnd, IDC_EDIT); + SetDlgItemText(question_hWnd, IDC_CAPTION, TranslateT("Identify nick")); + SetWindowText(GetDlgItem(question_hWnd, IDC_TEXT), TranslateT("Please enter your password")); + SetDlgItemText(question_hWnd, IDC_HIDDENEDIT, _T("/nickserv IDENTIFY %question=\"%s\",\"%s\"")); + SetWindowLongPtr(GetDlgItem(question_hWnd, IDC_EDIT), GWL_STYLE, + (LONG)GetWindowLongPtr(GetDlgItem(question_hWnd, IDC_EDIT), GWL_STYLE) | ES_PASSWORD); + SendMessage(hEditCtrl, EM_SETPASSWORDCHAR, (WPARAM)_T('*'), 0); + SetFocus(hEditCtrl); + dlg->Activate(); + } break; case 9: // nickserv remind password - { - DBVARIANT dbv; - if (!getTString("Nick", &dbv)) { - PostIrcMessage(_T("/nickserv SENDPASS %s"), dbv.ptszVal); - db_free(&dbv); - } + { + DBVARIANT dbv; + if (!getTString("Nick", &dbv)) { + PostIrcMessage(_T("/nickserv SENDPASS %s"), dbv.ptszVal); + db_free(&dbv); } + } break; case 10: // nickserv set new password PostIrcMessage(_T("/nickserv SET PASSWORD %%question=\"%s\",\"%s\""), @@ -701,12 +697,12 @@ int __cdecl CIrcProto::GCEventHook(WPARAM wParam, LPARAM lParam) case 10: PostIrcMessage(_T("/WHOIS %s %s"), gch->ptszUID, gch->ptszUID); break; - // case 11: - // DoUserhostWithReason(1, "I", true, "%s", gch->ptszUID ); - // break; - // case 12: - // DoUserhostWithReason(1, "J", true, "%s", gch->ptszUID ); - // break; + // case 11: + // DoUserhostWithReason(1, "I", true, "%s", gch->ptszUID ); + // break; + // case 12: + // DoUserhostWithReason(1, "J", true, "%s", gch->ptszUID ); + // break; case 13: PostIrcMessage(_T("/DCC CHAT %s"), gch->ptszUID); break; @@ -743,19 +739,19 @@ int __cdecl CIrcProto::GCEventHook(WPARAM wParam, LPARAM lParam) gch->ptszUID, TranslateT("Please enter the channel name to invite to"), TranslateT("Invite to channel")); break; case 30: - { - PROTOSEARCHRESULT psr = { 0 }; - psr.cbSize = sizeof(psr); - psr.flags = PSR_TCHAR; - psr.id = gch->ptszUID; - psr.nick = gch->ptszUID; - - ADDCONTACTSTRUCT acs = { 0 }; - acs.handleType = HANDLE_SEARCHRESULT; - acs.szProto = m_szModuleName; - acs.psr = &psr; - CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs); - } + { + PROTOSEARCHRESULT psr = { 0 }; + psr.cbSize = sizeof(psr); + psr.flags = PSR_TCHAR; + psr.id = gch->ptszUID; + psr.nick = gch->ptszUID; + + ADDCONTACTSTRUCT acs = { 0 }; + acs.handleType = HANDLE_SEARCHRESULT; + acs.szProto = m_szModuleName; + acs.psr = &psr; + CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs); + } break; case 31: //slap PostIrcMessageWnd(p1, NULL, CMString(FORMAT, _T("/slap %s"), gch->ptszUID)); @@ -780,74 +776,74 @@ int __cdecl CIrcProto::GCEventHook(WPARAM wParam, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// static gc_item logItems[] = { - { LPGENT("&Change your nickname" ), 1, MENU_ITEM, FALSE }, - { LPGENT("Channel &settings" ), 2, MENU_ITEM, FALSE }, - { _T(""), 0, MENU_SEPARATOR, FALSE }, - { LPGENT("NickServ"), 0, MENU_NEWPOPUP, FALSE }, - { LPGENT("Register nick" ), 5, MENU_POPUPITEM, TRUE }, - { LPGENT("Auth nick" ), 6, MENU_POPUPITEM, FALSE }, - { LPGENT("Delete nick" ), 7, MENU_POPUPITEM, FALSE }, - { LPGENT("Identify nick" ), 8, MENU_POPUPITEM, FALSE }, - { LPGENT("Remind password" ), 9, MENU_POPUPITEM, FALSE }, - { LPGENT("Set new password" ), 10, MENU_POPUPITEM, TRUE }, - { LPGENT("Set language" ), 11, MENU_POPUPITEM, FALSE }, - { LPGENT("Set homepage" ), 12, MENU_POPUPITEM, FALSE }, - { LPGENT("Set e-mail" ), 13, MENU_POPUPITEM, FALSE }, - { LPGENT("Set info" ), 14, MENU_POPUPITEM, FALSE }, - { _T("" ), 0, MENU_POPUPSEPARATOR, FALSE }, - { LPGENT("Hide e-mail from info" ), 20, MENU_POPUPITEM, FALSE }, - { LPGENT("Show e-mail in info" ), 21, MENU_POPUPITEM, FALSE }, - { _T("" ), 0, MENU_POPUPSEPARATOR, FALSE }, - { LPGENT("Set security for nick" ), 22, MENU_POPUPITEM, FALSE }, - { LPGENT("Remove security for nick" ), 23, MENU_POPUPITEM, FALSE }, - { _T("" ), 0, MENU_POPUPSEPARATOR, FALSE }, - { LPGENT("Link nick to current" ), 24, MENU_POPUPITEM, FALSE }, - { LPGENT("Unlink nick from current" ), 25, MENU_POPUPITEM, FALSE }, - { LPGENT("Set main nick" ), 26, MENU_POPUPITEM, FALSE }, - { LPGENT("List all your nicks" ), 27, MENU_POPUPITEM, FALSE }, - { LPGENT("List your channels" ), 28, MENU_POPUPITEM, FALSE }, - { _T("" ), 0, MENU_POPUPSEPARATOR, FALSE }, - { LPGENT("Kill unauthorized: off" ), 15, MENU_POPUPITEM, FALSE }, - { LPGENT("Kill unauthorized: on" ), 16, MENU_POPUPITEM, FALSE }, - { LPGENT("Kill unauthorized: quick" ), 17, MENU_POPUPITEM, FALSE }, - { _T("" ), 0, MENU_POPUPSEPARATOR, FALSE }, - { LPGENT("Hide nick from list" ), 18, MENU_POPUPITEM, FALSE }, - { LPGENT("Show nick to list" ), 19, MENU_POPUPITEM, FALSE }, - { LPGENT("Show the server &window" ), 4, MENU_ITEM, FALSE }, - { _T(""), 0, MENU_SEPARATOR, FALSE }, - { LPGENT("&Leave the channel" ), 3, MENU_ITEM, FALSE } -}; - -static gc_item nickItems[] = { - { LPGENT("&WhoIs info"), 10, MENU_ITEM, FALSE }, //0 - { LPGENT("&Invite to channel"), 23, MENU_ITEM, FALSE }, - { LPGENT("Send ¬ice"), 22, MENU_ITEM, FALSE }, - { LPGENT("&Slap"), 31, MENU_ITEM, FALSE }, - { LPGENT("Nickserv info"), 32, MENU_ITEM, FALSE }, - { LPGENT("Nickserv kill ghost"), 33, MENU_ITEM, FALSE }, //5 - { LPGENT("&Control"), 0, MENU_NEWPOPUP, FALSE }, - { LPGENT("Give Owner"), 18, MENU_POPUPITEM, FALSE }, //7 - { LPGENT("Take Owner"), 19, MENU_POPUPITEM, FALSE }, - { LPGENT("Give Admin"), 20, MENU_POPUPITEM, FALSE }, - { LPGENT("Take Admin"), 21, MENU_POPUPITEM, FALSE }, //10 - { LPGENT("Give &Op"), 1, MENU_POPUPITEM, FALSE }, - { LPGENT("Take O&p"), 2, MENU_POPUPITEM, FALSE }, - { LPGENT("Give &Halfop"), 16, MENU_POPUPITEM, FALSE }, - { LPGENT("Take H&alfop"), 17, MENU_POPUPITEM, FALSE }, - { LPGENT("Give &Voice"), 3, MENU_POPUPITEM, FALSE }, //15 - { LPGENT("Take V&oice"), 4, MENU_POPUPITEM, FALSE }, - { _T(""), 0, MENU_POPUPSEPARATOR, FALSE }, - { LPGENT("&Kick"), 5, MENU_POPUPITEM, FALSE }, - { LPGENT("Ki&ck (reason)"), 6, MENU_POPUPITEM, FALSE }, - { LPGENT("&Ban"), 7, MENU_POPUPITEM, FALSE }, //20 - { LPGENT("Ban'&n kick"), 8, MENU_POPUPITEM, FALSE }, - { LPGENT("Ban'n kick (&reason)"), 9, MENU_POPUPITEM, FALSE }, - { LPGENT("&Direct Connection"), 0, MENU_NEWPOPUP, FALSE }, - { LPGENT("Request &Chat"), 13, MENU_POPUPITEM, FALSE }, - { LPGENT("Send &File"), 14, MENU_POPUPITEM, FALSE }, //25 - { LPGENT("Add to &ignore list"), 15, MENU_ITEM, FALSE }, - { _T(""), 12, MENU_SEPARATOR, FALSE }, - { LPGENT("&Add User"), 30, MENU_ITEM, FALSE } + { LPGENT("&Change your nickname"), 1, MENU_ITEM, FALSE }, + { LPGENT("Channel &settings"), 2, MENU_ITEM, FALSE }, + { _T(""), 0, MENU_SEPARATOR, FALSE }, + { LPGENT("NickServ"), 0, MENU_NEWPOPUP, FALSE }, + { LPGENT("Register nick"), 5, MENU_POPUPITEM, TRUE }, + { LPGENT("Auth nick"), 6, MENU_POPUPITEM, FALSE }, + { LPGENT("Delete nick"), 7, MENU_POPUPITEM, FALSE }, + { LPGENT("Identify nick"), 8, MENU_POPUPITEM, FALSE }, + { LPGENT("Remind password"), 9, MENU_POPUPITEM, FALSE }, + { LPGENT("Set new password"), 10, MENU_POPUPITEM, TRUE }, + { LPGENT("Set language"), 11, MENU_POPUPITEM, FALSE }, + { LPGENT("Set homepage"), 12, MENU_POPUPITEM, FALSE }, + { LPGENT("Set e-mail"), 13, MENU_POPUPITEM, FALSE }, + { LPGENT("Set info"), 14, MENU_POPUPITEM, FALSE }, + { _T(""), 0, MENU_POPUPSEPARATOR, FALSE }, + { LPGENT("Hide e-mail from info"), 20, MENU_POPUPITEM, FALSE }, + { LPGENT("Show e-mail in info"), 21, MENU_POPUPITEM, FALSE }, + { _T(""), 0, MENU_POPUPSEPARATOR, FALSE }, + { LPGENT("Set security for nick"), 22, MENU_POPUPITEM, FALSE }, + { LPGENT("Remove security for nick"), 23, MENU_POPUPITEM, FALSE }, + { _T(""), 0, MENU_POPUPSEPARATOR, FALSE }, + { LPGENT("Link nick to current"), 24, MENU_POPUPITEM, FALSE }, + { LPGENT("Unlink nick from current"), 25, MENU_POPUPITEM, FALSE }, + { LPGENT("Set main nick"), 26, MENU_POPUPITEM, FALSE }, + { LPGENT("List all your nicks"), 27, MENU_POPUPITEM, FALSE }, + { LPGENT("List your channels"), 28, MENU_POPUPITEM, FALSE }, + { _T(""), 0, MENU_POPUPSEPARATOR, FALSE }, + { LPGENT("Kill unauthorized: off"), 15, MENU_POPUPITEM, FALSE }, + { LPGENT("Kill unauthorized: on"), 16, MENU_POPUPITEM, FALSE }, + { LPGENT("Kill unauthorized: quick"), 17, MENU_POPUPITEM, FALSE }, + { _T(""), 0, MENU_POPUPSEPARATOR, FALSE }, + { LPGENT("Hide nick from list"), 18, MENU_POPUPITEM, FALSE }, + { LPGENT("Show nick to list"), 19, MENU_POPUPITEM, FALSE }, + { LPGENT("Show the server &window"), 4, MENU_ITEM, FALSE }, + { _T(""), 0, MENU_SEPARATOR, FALSE }, + { LPGENT("&Leave the channel"), 3, MENU_ITEM, FALSE } +}; + +static gc_item nickItems[] = { + { LPGENT("&WhoIs info"), 10, MENU_ITEM, FALSE }, //0 + { LPGENT("&Invite to channel"), 23, MENU_ITEM, FALSE }, + { LPGENT("Send ¬ice"), 22, MENU_ITEM, FALSE }, + { LPGENT("&Slap"), 31, MENU_ITEM, FALSE }, + { LPGENT("Nickserv info"), 32, MENU_ITEM, FALSE }, + { LPGENT("Nickserv kill ghost"), 33, MENU_ITEM, FALSE }, //5 + { LPGENT("&Control"), 0, MENU_NEWPOPUP, FALSE }, + { LPGENT("Give Owner"), 18, MENU_POPUPITEM, FALSE }, //7 + { LPGENT("Take Owner"), 19, MENU_POPUPITEM, FALSE }, + { LPGENT("Give Admin"), 20, MENU_POPUPITEM, FALSE }, + { LPGENT("Take Admin"), 21, MENU_POPUPITEM, FALSE }, //10 + { LPGENT("Give &Op"), 1, MENU_POPUPITEM, FALSE }, + { LPGENT("Take O&p"), 2, MENU_POPUPITEM, FALSE }, + { LPGENT("Give &Halfop"), 16, MENU_POPUPITEM, FALSE }, + { LPGENT("Take H&alfop"), 17, MENU_POPUPITEM, FALSE }, + { LPGENT("Give &Voice"), 3, MENU_POPUPITEM, FALSE }, //15 + { LPGENT("Take V&oice"), 4, MENU_POPUPITEM, FALSE }, + { _T(""), 0, MENU_POPUPSEPARATOR, FALSE }, + { LPGENT("&Kick"), 5, MENU_POPUPITEM, FALSE }, + { LPGENT("Ki&ck (reason)"), 6, MENU_POPUPITEM, FALSE }, + { LPGENT("&Ban"), 7, MENU_POPUPITEM, FALSE }, //20 + { LPGENT("Ban'&n kick"), 8, MENU_POPUPITEM, FALSE }, + { LPGENT("Ban'n kick (&reason)"), 9, MENU_POPUPITEM, FALSE }, + { LPGENT("&Direct Connection"), 0, MENU_NEWPOPUP, FALSE }, + { LPGENT("Request &Chat"), 13, MENU_POPUPITEM, FALSE }, + { LPGENT("Send &File"), 14, MENU_POPUPITEM, FALSE }, //25 + { LPGENT("Add to &ignore list"), 15, MENU_ITEM, FALSE }, + { _T(""), 12, MENU_SEPARATOR, FALSE }, + { LPGENT("&Add User"), 30, MENU_ITEM, FALSE } }; int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam) @@ -913,8 +909,8 @@ int __cdecl CIrcProto::OnPreShutdown(WPARAM, LPARAM) EnterCriticalSection(&cs); if (m_perform && IsConnected()) - if (DoPerform("Event: Disconnect")) - Sleep(200); + if (DoPerform("Event: Disconnect")) + Sleep(200); DisconnectAllDCCSessions(true); diff --git a/protocols/IcqOscarJ/src/icqoscar.h b/protocols/IcqOscarJ/src/icqoscar.h index eb64c0ab2c..33e9e5cba0 100644 --- a/protocols/IcqOscarJ/src/icqoscar.h +++ b/protocols/IcqOscarJ/src/icqoscar.h @@ -113,7 +113,6 @@ #include "channels.h" #include "families.h" #include "m_icq.h" -#include "m_icqplus.h" #include "icq_advsearch.h" #include "log.h" diff --git a/protocols/SkypeClassic/SkypeClassic_12.vcxproj b/protocols/SkypeClassic/SkypeClassic_12.vcxproj index d05e962c18..b7868c7487 100644 --- a/protocols/SkypeClassic/SkypeClassic_12.vcxproj +++ b/protocols/SkypeClassic/SkypeClassic_12.vcxproj @@ -61,7 +61,6 @@ - @@ -82,7 +81,6 @@ - {5F9243AE-C6C9-4F42-B670-67A97767A50B} @@ -91,27 +89,23 @@ DynamicLibrary - false Unicode true v120_xp DynamicLibrary - false Unicode v120_xp DynamicLibrary - false Unicode true v120_xp DynamicLibrary - false Unicode v120_xp @@ -149,14 +143,10 @@ _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) false EnableFastChecks - MultiThreadedDebug + MultiThreadedDebugDLL false Level3 - true - EditAndContinue - Default ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - skype.h true Fast 4996;%(DisableSpecificWarnings) @@ -167,13 +157,12 @@ wsock32.lib;comctl32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true true false $(IntDir)$(TargetName).lib - $(ProfileDir)..\..\bin12\lib; + $(ProfileDir)..\..\bin12\lib false + Windows @@ -183,14 +172,10 @@ true false EnableFastChecks - MultiThreadedDebug + MultiThreadedDebugDLL false Level3 - true - ProgramDatabase - Default ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - skype.h true Fast 4996;%(DisableSpecificWarnings) @@ -201,12 +186,11 @@ wsock32.lib;comctl32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true true false $(IntDir)$(TargetName).lib - $(ProfileDir)..\..\bin12\lib; + $(ProfileDir)..\..\bin12\lib + Windows @@ -216,16 +200,12 @@ true Size true - true NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true false true Level3 - true - Default ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - skype.h Fast 4996;%(DisableSpecificWarnings) @@ -235,13 +215,13 @@ wsock32.lib;comctl32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true true true $(IntDir)$(TargetName).lib - $(ProfileDir)..\..\bin12\lib; + $(ProfileDir)..\..\bin12\lib true + Windows + false @@ -251,17 +231,13 @@ true Size true - true NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true false true false Level3 - true - Default ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - skype.h Fast 4996;%(DisableSpecificWarnings) @@ -271,13 +247,13 @@ wsock32.lib;comctl32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - true true true $(IntDir)$(TargetName).lib - $(ProfileDir)..\..\bin12\lib; + $(ProfileDir)..\..\bin12\lib true + Windows + false diff --git a/protocols/SkypeClassic/SkypeClassic_12.vcxproj.filters b/protocols/SkypeClassic/SkypeClassic_12.vcxproj.filters index eec33c3042..2d9d1be44f 100644 --- a/protocols/SkypeClassic/SkypeClassic_12.vcxproj.filters +++ b/protocols/SkypeClassic/SkypeClassic_12.vcxproj.filters @@ -60,9 +60,6 @@ Source Files - - Source Files - @@ -119,9 +116,6 @@ Header Files - - Header Files - @@ -190,10 +184,10 @@ - Source Files + Resource Files - Source Files + Resource Files \ No newline at end of file diff --git a/protocols/SkypeClassic/src/contacts.cpp b/protocols/SkypeClassic/src/contacts.cpp index bfcd4a4319..92b07eaab2 100644 --- a/protocols/SkypeClassic/src/contacts.cpp +++ b/protocols/SkypeClassic/src/contacts.cpp @@ -7,7 +7,6 @@ #include "debug.h" #include "pthread.h" #include "gchat.h" -#include "voiceservice.h" #pragma warning (push) #pragma warning (disable: 4100) // unreferenced formal parameter @@ -28,179 +27,175 @@ static HANDLE hMenuCallItem, hMenuCallHangup, hMenuSkypeOutCallItem, hMenuHoldCa // Seems to be not neccessary /* BOOL SupportAlphaIcons(void) { - HANDLE hMod; - DLLVERSIONINFO tDVI={0}; - BOOL retval=FALSE; - FARPROC pDllGetVersion; - - if (!(hMod=LoadLibrary("comctl32.dll"))) return FALSE; - if (pDllGetVersion=GetProcAddress(hMod, "DllGetVersion")) { - tDVI.cbSize=sizeof(tDVI); - if (!pDllGetVersion ((DLLVERSIONINFO *)&tDVI)) { - if (GetDeviceCaps(GetDC(NULL), BITSPIXEL)*GetDeviceCaps(GetDC(NULL), PLANES)>=32 && - tDVI.dwMajorVersion>=6) - retval=TRUE; - } - } - FreeLibrary(hMod); - return retval; +HANDLE hMod; +DLLVERSIONINFO tDVI={0}; +BOOL retval=FALSE; +FARPROC pDllGetVersion; + +if (!(hMod=LoadLibrary("comctl32.dll"))) return FALSE; +if (pDllGetVersion=GetProcAddress(hMod, "DllGetVersion")) { +tDVI.cbSize=sizeof(tDVI); +if (!pDllGetVersion ((DLLVERSIONINFO *)&tDVI)) { +if (GetDeviceCaps(GetDC(NULL), BITSPIXEL)*GetDeviceCaps(GetDC(NULL), PLANES)>=32 && +tDVI.dwMajorVersion>=6) +retval=TRUE; +} +} +FreeLibrary(hMod); +return retval; } */ CLISTMENUITEM CallItem(void) { - CLISTMENUITEM mi={0}; - - mi.cbSize=sizeof(mi); - mi.position=-2000005000; - mi.flags=CMIF_NOTOFFLINE|CMIF_TCHAR; - mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_CALL)); - mi.pszContactOwner=SKYPE_PROTONAME; - mi.ptszName=LPGENT("Call (Skype)"); - mi.pszService=SKYPE_CALL; - + CLISTMENUITEM mi = { 0 }; + + mi.cbSize = sizeof(mi); + mi.position = -2000005000; + mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR; + mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CALL)); + mi.pszContactOwner = SKYPE_PROTONAME; + mi.ptszName = LPGENT("Call (Skype)"); + mi.pszService = SKYPE_CALL; + return mi; } CLISTMENUITEM SkypeOutCallItem(void) { - CLISTMENUITEM mi={0}; + CLISTMENUITEM mi = { 0 }; - mi.cbSize=sizeof(mi); - mi.position=-2000005000; - mi.flags=CMIF_HIDDEN|CMIF_TCHAR; - mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_CALLSKYPEOUT)); - mi.ptszName=LPGENT("Call using SkypeOut"); - mi.pszService=SKYPEOUT_CALL; + mi.cbSize = sizeof(mi); + mi.position = -2000005000; + mi.flags = CMIF_HIDDEN | CMIF_TCHAR; + mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CALLSKYPEOUT)); + mi.ptszName = LPGENT("Call using SkypeOut"); + mi.pszService = SKYPEOUT_CALL; return mi; } CLISTMENUITEM HupItem(void) { - CLISTMENUITEM mi={0}; + CLISTMENUITEM mi = { 0 }; - mi.cbSize=sizeof(mi); - mi.position=-2000005000; - mi.flags=CMIF_NOTOFFLINE|CMIF_TCHAR; - mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_HANGUP)); - mi.pszContactOwner=SKYPE_PROTONAME; - mi.ptszName=LPGENT("Hang up call (Skype)"); - mi.pszService=SKYPE_CALLHANGUP; + mi.cbSize = sizeof(mi); + mi.position = -2000005000; + mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR; + mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_HANGUP)); + mi.pszContactOwner = SKYPE_PROTONAME; + mi.ptszName = LPGENT("Hang up call (Skype)"); + mi.pszService = SKYPE_CALLHANGUP; return mi; } CLISTMENUITEM SkypeOutHupItem(void) { - CLISTMENUITEM mi={0}; - - mi.cbSize=sizeof(mi); - mi.position=-2000005000; - mi.flags=CMIF_TCHAR; - mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_HANGUP)); - mi.ptszName=LPGENT("Hang up SkypeOut call"); - mi.pszService=SKYPEOUT_CALL; + CLISTMENUITEM mi = { 0 }; + + mi.cbSize = sizeof(mi); + mi.position = -2000005000; + mi.flags = CMIF_TCHAR; + mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_HANGUP)); + mi.ptszName = LPGENT("Hang up SkypeOut call"); + mi.pszService = SKYPEOUT_CALL; return mi; } CLISTMENUITEM HoldCallItem(void) { - CLISTMENUITEM mi={0}; - - mi.cbSize=sizeof(mi); - mi.position=-2000005000; - mi.flags=CMIF_HIDDEN|CMIF_NOTOFFLINE|CMIF_TCHAR; - mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_HOLD)); - mi.ptszName=LPGENT("Hold call"); - mi.pszService=SKYPE_HOLDCALL; + CLISTMENUITEM mi = { 0 }; + + mi.cbSize = sizeof(mi); + mi.position = -2000005000; + mi.flags = CMIF_HIDDEN | CMIF_NOTOFFLINE | CMIF_TCHAR; + mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_HOLD)); + mi.ptszName = LPGENT("Hold call"); + mi.pszService = SKYPE_HOLDCALL; return mi; } CLISTMENUITEM ResumeCallItem(void) { - CLISTMENUITEM mi={0}; - - mi.cbSize=sizeof(mi); - mi.position=-2000005000; - mi.flags=CMIF_HIDDEN|CMIF_NOTOFFLINE|CMIF_TCHAR; - mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_RESUME)); - mi.ptszName=LPGENT("Resume call"); - mi.pszService=SKYPE_HOLDCALL; + CLISTMENUITEM mi = { 0 }; + + mi.cbSize = sizeof(mi); + mi.position = -2000005000; + mi.flags = CMIF_HIDDEN | CMIF_NOTOFFLINE | CMIF_TCHAR; + mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESUME)); + mi.ptszName = LPGENT("Resume call"); + mi.pszService = SKYPE_HOLDCALL; return mi; } CLISTMENUITEM FileTransferItem(void) { - CLISTMENUITEM mi={0}; + CLISTMENUITEM mi = { 0 }; // Stolen from file.c of Miranda core - mi.cbSize=sizeof(mi); - mi.position=-2000020000; - mi.flags=CMIF_HIDDEN|CMIF_NOTOFFLINE|CMIF_TCHAR; - mi.hIcon=LoadSkinnedIcon(SKINICON_EVENT_FILE); - mi.ptszName=LPGENT("&File"); - mi.pszContactOwner=SKYPE_PROTONAME; - mi.pszService=SKYPE_SENDFILE; + mi.cbSize = sizeof(mi); + mi.position = -2000020000; + mi.flags = CMIF_HIDDEN | CMIF_NOTOFFLINE | CMIF_TCHAR; + mi.hIcon = LoadSkinnedIcon(SKINICON_EVENT_FILE); + mi.ptszName = LPGENT("&File"); + mi.pszContactOwner = SKYPE_PROTONAME; + mi.pszService = SKYPE_SENDFILE; return mi; } CLISTMENUITEM ChatInitItem(void) { - CLISTMENUITEM mi={0}; - - mi.cbSize=sizeof(mi); - mi.position=-2000020000; - mi.flags=CMIF_HIDDEN|CMIF_NOTOFFLINE|CMIF_TCHAR; - mi.hIcon=LoadIcon( hInst, MAKEINTRESOURCE( IDI_INVITE )); - mi.ptszName=LPGENT("&Open group chat"); - mi.pszContactOwner=SKYPE_PROTONAME; - mi.pszService=SKYPE_CHATNEW; + CLISTMENUITEM mi = { 0 }; + + mi.cbSize = sizeof(mi); + mi.position = -2000020000; + mi.flags = CMIF_HIDDEN | CMIF_NOTOFFLINE | CMIF_TCHAR; + mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_INVITE)); + mi.ptszName = LPGENT("&Open group chat"); + mi.pszContactOwner = SKYPE_PROTONAME; + mi.pszService = SKYPE_CHATNEW; return mi; } HANDLE add_contextmenu(MCONTACT hContact) { CLISTMENUITEM mi; - + UNREFERENCED_PARAMETER(hContact); - if (!HasVoiceService()) { - mi=CallItem(); - hMenuCallItem=Menu_AddContactMenuItem(&mi); - mi=HupItem(); - hMenuCallHangup=Menu_AddContactMenuItem(&mi); - } - - mi=SkypeOutCallItem(); - hMenuSkypeOutCallItem=Menu_AddContactMenuItem(&mi); + mi = CallItem(); + hMenuCallItem = Menu_AddContactMenuItem(&mi); + mi = HupItem(); + hMenuCallHangup = Menu_AddContactMenuItem(&mi); - if (!HasVoiceService()) { - mi=HoldCallItem(); - hMenuHoldCallItem=Menu_AddContactMenuItem(&mi); - } + mi = SkypeOutCallItem(); + hMenuSkypeOutCallItem = Menu_AddContactMenuItem(&mi); + + mi = HoldCallItem(); + hMenuHoldCallItem = Menu_AddContactMenuItem(&mi); - // We cannot use flag PF1_FILESEND for sending files, as Skype opens its own + // We cannot use flag PF1_FILESEND for sending files, as Skype opens its own // sendfile-Dialog. - mi=FileTransferItem(); - hMenuFileTransferItem=Menu_AddContactMenuItem(&mi); - - mi=ChatInitItem(); - hMenuChatInitItem=Menu_AddContactMenuItem(&mi); - - - ZeroMemory(&mi,sizeof(mi)); - mi.cbSize=sizeof(mi); - mi.position=-2000005000; - mi.flags=CMIF_TCHAR; - mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_IMPORT)); - mi.pszContactOwner=SKYPE_PROTONAME; - mi.ptszName=LPGENT("Import Skype history"); - mi.pszService=SKYPE_IMPORTHISTORY; + mi = FileTransferItem(); + hMenuFileTransferItem = Menu_AddContactMenuItem(&mi); + + mi = ChatInitItem(); + hMenuChatInitItem = Menu_AddContactMenuItem(&mi); + + + ZeroMemory(&mi, sizeof(mi)); + mi.cbSize = sizeof(mi); + mi.position = -2000005000; + mi.flags = CMIF_TCHAR; + mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_IMPORT)); + mi.pszContactOwner = SKYPE_PROTONAME; + mi.ptszName = LPGENT("Import Skype history"); + mi.pszService = SKYPE_IMPORTHISTORY; return Menu_AddContactMenuItem(&mi); } HANDLE add_mainmenu(void) { - CLISTMENUITEM mi={0}; - - mi.cbSize=sizeof(mi); - mi.position=-2000005000; - mi.flags=CMIF_TCHAR; - mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_ADD)); - mi.pszContactOwner=SKYPE_PROTONAME; - mi.ptszName=LPGENT("Add Skype contact"); - mi.pszService=SKYPE_ADDUSER; + CLISTMENUITEM mi = { 0 }; + + mi.cbSize = sizeof(mi); + mi.position = -2000005000; + mi.flags = CMIF_TCHAR; + mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ADD)); + mi.pszContactOwner = SKYPE_PROTONAME; + mi.ptszName = LPGENT("Add Skype contact"); + mi.pszService = SKYPE_ADDUSER; return Menu_AddMainMenuItem(&mi); } @@ -216,77 +211,76 @@ int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { if (!(szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0))) return 0; - if (!HasVoiceService()) { - // Clear hold-Item in case it exists - mi=HoldCallItem(); - mi.flags|=CMIM_ALL; - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuHoldCallItem,(LPARAM)&mi); - } + // Clear hold-Item in case it exists + mi = HoldCallItem(); + mi.flags |= CMIM_ALL; + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuHoldCallItem, (LPARAM)&mi); if (!strcmp(szProto, SKYPE_PROTONAME)) { - if (!HasVoiceService()) { - if (!db_get((MCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { - if (db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "OnHold", 0)) - mi=ResumeCallItem(); else mi=HoldCallItem(); - mi.flags=CMIM_ALL; - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuHoldCallItem,(LPARAM)&mi); + if (!db_get((MCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { + if (db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "OnHold", 0)) + mi = ResumeCallItem(); else mi = HoldCallItem(); + mi.flags = CMIM_ALL; + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuHoldCallItem, (LPARAM)&mi); - callAvailable = FALSE; - hangupAvailable = TRUE; + callAvailable = FALSE; + hangupAvailable = TRUE; - db_free(&dbv); - } else { callAvailable = TRUE; hangupAvailable = FALSE; } - - if (db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)!=0) { - callAvailable = FALSE; - hangupAvailable = FALSE; - } - - mi = CallItem(); - mi.flags |= CMIM_ALL | (!callAvailable?CMIF_HIDDEN:0); - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuCallItem,(LPARAM)&mi); + db_free(&dbv); + } + else { callAvailable = TRUE; hangupAvailable = FALSE; } - mi = HupItem(); - mi.flags |= CMIM_ALL | (!hangupAvailable?CMIF_HIDDEN:0); - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuCallHangup,(LPARAM)&mi); + if (db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0) != 0) { + callAvailable = FALSE; + hangupAvailable = FALSE; } + mi = CallItem(); + mi.flags |= CMIM_ALL | (!callAvailable ? CMIF_HIDDEN : 0); + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuCallItem, (LPARAM)&mi); + + mi = HupItem(); + mi.flags |= CMIM_ALL | (!hangupAvailable ? CMIF_HIDDEN : 0); + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuCallHangup, (LPARAM)&mi); + // Clear SkypeOut menu in case it exists - mi=SkypeOutCallItem(); - mi.flags|=CMIM_ALL; - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuSkypeOutCallItem,(LPARAM)&mi); + mi = SkypeOutCallItem(); + mi.flags |= CMIM_ALL; + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuSkypeOutCallItem, (LPARAM)&mi); // File sending and groupchat-creation works starting with protocol version 5 - if (protocol>=5) { - mi=FileTransferItem(); - if (db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0) - mi.flags ^= CMIF_HIDDEN; + if (protocol >= 5) { + mi = FileTransferItem(); + if (db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0) == 0) + mi.flags ^= CMIF_HIDDEN; mi.flags |= CMIM_FLAGS; - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuFileTransferItem,(LPARAM)&mi); + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuFileTransferItem, (LPARAM)&mi); } - if (protocol>=5 || bIsImoproxy) { - mi=ChatInitItem(); + if (protocol >= 5 || bIsImoproxy) { + mi = ChatInitItem(); if (db_get_b(NULL, SKYPE_PROTONAME, "UseGroupchat", 0) && - db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0) - mi.flags ^= CMIF_HIDDEN; + db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "ChatRoom", 0) == 0) + mi.flags ^= CMIF_HIDDEN; mi.flags |= CMIM_FLAGS; - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuChatInitItem,(LPARAM)&mi); + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuChatInitItem, (LPARAM)&mi); } - } else if (bSkypeOut) { + } + else if (bSkypeOut) { if (!db_get((MCONTACT)wParam, SKYPE_PROTONAME, "CallId", &dbv)) { - mi=SkypeOutHupItem(); + mi = SkypeOutHupItem(); db_free(&dbv); - } else { - mi=SkypeOutCallItem(); - if(!db_get((MCONTACT)wParam,"UserInfo","MyPhone0",&dbv)) { + } + else { + mi = SkypeOutCallItem(); + if (!db_get((MCONTACT)wParam, "UserInfo", "MyPhone0", &dbv)) { db_free(&dbv); - mi.flags=0; + mi.flags = 0; } } - mi.flags|=CMIM_ALL; - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuSkypeOutCallItem,(LPARAM)&mi); + mi.flags |= CMIM_ALL; + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuSkypeOutCallItem, (LPARAM)&mi); } return 0; @@ -294,15 +288,15 @@ int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { /* int ClistDblClick(WPARAM wParam, LPARAM lParam) { - char *szProto; +char *szProto; - szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 ); - if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && - db_get_w((HANDLE)wParam, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE)==ID_STATUS_ONTHEPHONE) { - SkypeCall(wParam, 0); - } +szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 ); +if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && +db_get_w((HANDLE)wParam, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE)==ID_STATUS_ONTHEPHONE) { +SkypeCall(wParam, 0); +} - return 0; +return 0; } */ @@ -312,13 +306,13 @@ MCONTACT find_contact(char *name) DBVARIANT dbv; // already on list? - for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact=db_find_next(hContact)) + for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { - char *szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, hContact, 0 ); - if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==0) + char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0); + if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME) && db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0) == 0) { if (db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) continue; - tCompareResult = strcmp(dbv.pszVal, name); + tCompareResult = strcmp(dbv.pszVal, name); db_free(&dbv); if (tCompareResult) continue; return hContact; // already there, return handle @@ -333,13 +327,13 @@ MCONTACT find_contactT(TCHAR *name) DBVARIANT dbv; // already on list? - for (MCONTACT hContact=db_find_first(); hContact != NULL; hContact=db_find_next(hContact)) + for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { - char *szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, hContact, 0 ); - if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==0) + char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0); + if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME) && db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0) == 0) { if (db_get_ts(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) continue; - tCompareResult = _tcscmp(dbv.ptszVal, name); + tCompareResult = _tcscmp(dbv.ptszVal, name); db_free(&dbv); if (tCompareResult) continue; return hContact; // already there, return handle @@ -354,34 +348,36 @@ MCONTACT add_contact(char *name, DWORD flags) MCONTACT hContact; // already on list? - if (hContact=find_contact(name)) { + if (hContact = find_contact(name)) { if (!(flags & PALF_TEMPORARY) && db_get_b(hContact, "CList", "NotOnList", 1)) { - db_unset( hContact, "CList", "NotOnList" ); - db_unset( hContact, "CList", "Hidden" ); + db_unset(hContact, "CList", "NotOnList"); + db_unset(hContact, "CList", "Hidden"); } LOG(("add_contact: Found %s", name)); return hContact; // already there, return handle } // no, so add - + LOG(("add_contact: Adding %s", name)); - hContact=(MCONTACT)CallServiceSync(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallServiceSync(MS_DB_CONTACT_ADD, 0, 0); if (hContact) { - if (CallServiceSync(MS_PROTO_ADDTOCONTACT, hContact,(LPARAM)SKYPE_PROTONAME)!=0) { + if (CallServiceSync(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)SKYPE_PROTONAME) != 0) { LOG(("add_contact: Ouch! MS_PROTO_ADDTOCONTACT failed for some reason")); CallServiceSync(MS_DB_CONTACT_DELETE, hContact, 0); return NULL; } if (name[0]) db_set_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, name); - if (flags & PALF_TEMPORARY ) { + if (flags & PALF_TEMPORARY) { db_set_b(hContact, "CList", "NotOnList", 1); db_set_b(hContact, "CList", "Hidden", 1); } if (name[0]) { SkypeSend("GET USER %s DISPLAYNAME", name); - } else {LOG(("add_contact: Info: The contact added has no name."));} - } else {LOG(("add_contact: Ouch! MS_DB_CONTACT_ADD failed for some reason"));} + } + else { LOG(("add_contact: Info: The contact added has no name.")); } + } + else { LOG(("add_contact: Ouch! MS_DB_CONTACT_ADD failed for some reason")); } LOG(("add_contact succeeded")); return hContact; } @@ -389,31 +385,31 @@ MCONTACT add_contact(char *name, DWORD flags) void logoff_contacts(BOOL bCleanup) { MCONTACT hContact; char *szProto; - DBVARIANT dbv={0}; + DBVARIANT dbv = { 0 }; LOG(("logoff_contacts: Logging off contacts.")); - for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) { - szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, hContact, 0 ); - if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME)) + for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { + szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0); + if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME)) { - if (db_get_w(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE)!=ID_STATUS_OFFLINE) + if (db_get_w(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) db_set_w(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE); db_unset(hContact, SKYPE_PROTONAME, "CallId"); - if (db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==1) + if (db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0) == 1) { if (db_get_ts(hContact, SKYPE_PROTONAME, "ChatRoomID", &dbv)) continue; - RemChat (dbv.ptszVal); + RemChat(dbv.ptszVal); db_free(&dbv); } if (db_get_s(hContact, SKYPE_PROTONAME, "Typing_Stream", &dbv) == 0) { - if (bCleanup) SkypeSend ("ALTER APPLICATION libpurple_typing DISCONNECT %s", dbv.pszVal); + if (bCleanup) SkypeSend("ALTER APPLICATION libpurple_typing DISCONNECT %s", dbv.pszVal); db_free(&dbv); db_unset(hContact, SKYPE_PROTONAME, "Typing_Stream"); } } } - if (bCleanup && (protocol>=5 || bIsImoproxy)) SkypeSend ("DELETE APPLICATION libpurple_typing"); + if (bCleanup && (protocol >= 5 || bIsImoproxy)) SkypeSend("DELETE APPLICATION libpurple_typing"); } diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp index bd65d1bae7..20d4048458 100644 --- a/protocols/SkypeClassic/src/skype.cpp +++ b/protocols/SkypeClassic/src/skype.cpp @@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "pthread.h" #include "gchat.h" #include "m_toptoolbar.h" -#include "voiceservice.h" #include "msglist.h" #include "memlist.h" #include @@ -34,9 +33,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define INVALID_FILE_ATTRIBUTES 0xFFFFFFFF #endif #ifdef _WIN64 - #if (_MSC_VER < 1500) - #pragma comment (lib, "bufferoverflowU.lib") - #endif +#if (_MSC_VER < 1500) +#pragma comment (lib, "bufferoverflowU.lib") +#endif #endif #pragma warning (disable: 4706) // assignment within conditional expression @@ -44,18 +43,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. POPUPDATAT MessagePopup; // Exported Globals -HWND hSkypeWnd=NULL, g_hWnd=NULL, hSkypeWndSecondary=NULL, hForbiddenSkypeWnd = NULL; -HANDLE SkypeReady, SkypeMsgReceived, hInitChat=NULL, httbButton=NULL, FetchMessageEvent=NULL; -BOOL SkypeInitialized=FALSE, MirandaShuttingDown=FALSE, PopupServiceExists=FALSE; -BOOL UseSockets=FALSE, bSkypeOut=FALSE, bProtocolSet=FALSE, bIsImoproxy=FALSE; -char skype_path[MAX_PATH], protocol=2, *pszProxyCallout=NULL, g_szProtoName[_MAX_FNAME]="SkypeClassic"; -int SkypeStatus=ID_STATUS_OFFLINE, hSearchThread=-1, receivers=1; +HWND hSkypeWnd = NULL, g_hWnd = NULL, hSkypeWndSecondary = NULL, hForbiddenSkypeWnd = NULL; +HANDLE SkypeReady, SkypeMsgReceived, hInitChat = NULL, httbButton = NULL, FetchMessageEvent = NULL; +BOOL SkypeInitialized = FALSE, MirandaShuttingDown = FALSE, PopupServiceExists = FALSE; +BOOL UseSockets = FALSE, bSkypeOut = FALSE, bProtocolSet = FALSE, bIsImoproxy = FALSE; +char skype_path[MAX_PATH], protocol = 2, *pszProxyCallout = NULL, g_szProtoName[_MAX_FNAME] = "SkypeClassic"; +int SkypeStatus = ID_STATUS_OFFLINE, hSearchThread = -1, receivers = 1; long sendwatchers = 0, rcvwatchers = 0; UINT ControlAPIAttach, ControlAPIDiscover; -LONG AttachStatus=-1; +LONG AttachStatus = -1; HINSTANCE hInst; HANDLE hProtocolAvatarsFolder; -char DefaultAvatarsFolder[MAX_PATH+1]; +char DefaultAvatarsFolder[MAX_PATH + 1]; DWORD mirandaVersion; int hLangpack = 0; @@ -63,47 +62,47 @@ CRITICAL_SECTION RingAndEndcallMutex, QueryThreadMutex, TimeMutex; // Module Internal Globals HANDLE MessagePumpReady; -HANDLE hChatEvent=NULL, hChatMenu=NULL; -HANDLE hEvInitChat=NULL, hBuddyAdded=NULL; -HANDLE hMenuAddSkypeContact=NULL; +HANDLE hChatEvent = NULL, hChatMenu = NULL; +HANDLE hEvInitChat = NULL, hBuddyAdded = NULL; +HANDLE hMenuAddSkypeContact = NULL; DWORD msgPumpThreadId = 0; #ifdef SKYPEBUG_OFFLN HANDLE GotUserstatus; #endif -BOOL bModulesLoaded=FALSE; -char *RequestedStatus=NULL; // To fix Skype-API Statusmode-bug -char cmdMessage[12]="MESSAGE", cmdPartner[8]="PARTNER"; // Compatibility commands +BOOL bModulesLoaded = FALSE; +char *RequestedStatus = NULL; // To fix Skype-API Statusmode-bug +char cmdMessage[12] = "MESSAGE", cmdPartner[8] = "PARTNER"; // Compatibility commands // Direct assignment of user properties to a DB-Setting -static const settings_map m_settings[]= { - {"LANGUAGE", "Language1"}, - {"PROVINCE", "State"}, - {"CITY", "City"}, - {"PHONE_HOME", "Phone"}, - {"PHONE_OFFICE", "CompanyPhone"}, - {"PHONE_MOBILE", "Cellular"}, - {"HOMEPAGE", "Homepage"}, - {"ABOUT", "About"} - }; +static const settings_map m_settings[] = { + { "LANGUAGE", "Language1" }, + { "PROVINCE", "State" }, + { "CITY", "City" }, + { "PHONE_HOME", "Phone" }, + { "PHONE_OFFICE", "CompanyPhone" }, + { "PHONE_MOBILE", "Cellular" }, + { "HOMEPAGE", "Homepage" }, + { "ABOUT", "About" } +}; // Imported Globals extern status_map status_codes[]; -BOOL (WINAPI *MyEnableThemeDialogTexture)(HANDLE, DWORD) = 0; +BOOL(WINAPI *MyEnableThemeDialogTexture)(HANDLE, DWORD) = 0; HMODULE hUxTheme = 0; // function pointers, use typedefs for casting to shut up the compiler when using GetProcAddress() -typedef BOOL (WINAPI *PITA)(); -typedef HANDLE (WINAPI *POTD)(HWND, LPCWSTR); -typedef UINT (WINAPI *PDTB)(HANDLE, HDC, int, int, RECT *, RECT *); -typedef UINT (WINAPI *PCTD)(HANDLE); -typedef UINT (WINAPI *PDTT)(HANDLE, HDC, int, int, LPCWSTR, int, DWORD, DWORD, RECT *); +typedef BOOL(WINAPI *PITA)(); +typedef HANDLE(WINAPI *POTD)(HWND, LPCWSTR); +typedef UINT(WINAPI *PDTB)(HANDLE, HDC, int, int, RECT *, RECT *); +typedef UINT(WINAPI *PCTD)(HANDLE); +typedef UINT(WINAPI *PDTT)(HANDLE, HDC, int, int, LPCWSTR, int, DWORD, DWORD, RECT *); PITA pfnIsThemeActive = 0; POTD pfnOpenThemeData = 0; @@ -134,20 +133,20 @@ typedef struct { int InitVSApi() { - if((hUxTheme = LoadLibraryA("uxtheme.dll")) == 0) - return 0; - - pfnIsThemeActive = (PITA)GetProcAddress(hUxTheme, "IsThemeActive"); - pfnOpenThemeData = (POTD)GetProcAddress(hUxTheme, "OpenThemeData"); - pfnDrawThemeBackground = (PDTB)GetProcAddress(hUxTheme, "DrawThemeBackground"); - pfnCloseThemeData = (PCTD)GetProcAddress(hUxTheme, "CloseThemeData"); - pfnDrawThemeText = (PDTT)GetProcAddress(hUxTheme, "DrawThemeText"); - - MyEnableThemeDialogTexture = (BOOL (WINAPI *)(HANDLE, DWORD))GetProcAddress(hUxTheme, "EnableThemeDialogTexture"); - if(pfnIsThemeActive != 0 && pfnOpenThemeData != 0 && pfnDrawThemeBackground != 0 && pfnCloseThemeData != 0 && pfnDrawThemeText != 0) { - return 1; - } - return 0; + if ((hUxTheme = LoadLibraryA("uxtheme.dll")) == 0) + return 0; + + pfnIsThemeActive = (PITA)GetProcAddress(hUxTheme, "IsThemeActive"); + pfnOpenThemeData = (POTD)GetProcAddress(hUxTheme, "OpenThemeData"); + pfnDrawThemeBackground = (PDTB)GetProcAddress(hUxTheme, "DrawThemeBackground"); + pfnCloseThemeData = (PCTD)GetProcAddress(hUxTheme, "CloseThemeData"); + pfnDrawThemeText = (PDTT)GetProcAddress(hUxTheme, "DrawThemeText"); + + MyEnableThemeDialogTexture = (BOOL(WINAPI *)(HANDLE, DWORD))GetProcAddress(hUxTheme, "EnableThemeDialogTexture"); + if (pfnIsThemeActive != 0 && pfnOpenThemeData != 0 && pfnDrawThemeBackground != 0 && pfnCloseThemeData != 0 && pfnDrawThemeText != 0) { + return 1; + } + return 0; } /* @@ -156,9 +155,9 @@ int InitVSApi() int FreeVSApi() { - if(hUxTheme != 0) - FreeLibrary(hUxTheme); - return 0; + if (hUxTheme != 0) + FreeLibrary(hUxTheme); + return 0; } // Plugin Info @@ -173,7 +172,7 @@ PLUGININFOEX pluginInfo = { __AUTHORWEB, UNICODE_AWARE, // {A71F8335-7B87-4432-B8A3-81479431C6F5} - {0xa71f8335, 0x7b87, 0x4432, {0xb8, 0xa3, 0x81, 0x47, 0x94, 0x31, 0xc6, 0xf5}} + { 0xa71f8335, 0x7b87, 0x4432, { 0xb8, 0xa3, 0x81, 0x47, 0x94, 0x31, 0xc6, 0xf5 } } }; #define MAPDND 1 // Map Occupied to DND status and say that you support it @@ -183,9 +182,9 @@ PLUGININFOEX pluginInfo = { void RegisterToDbeditorpp(void) { - // known modules list - if (ServiceExists("DBEditorpp/RegisterSingleModule")) - CallService("DBEditorpp/RegisterSingleModule", (WPARAM)SKYPE_PROTONAME, 0); + // known modules list + if (ServiceExists("DBEditorpp/RegisterSingleModule")) + CallService("DBEditorpp/RegisterSingleModule", (WPARAM)SKYPE_PROTONAME, 0); } /* @@ -205,7 +204,7 @@ int ShowMessage(int iconID, TCHAR *lpzText, int mustShow) { if (db_get_b(NULL, SKYPE_PROTONAME, "SuppressErrors", 0)) return -1; - lpzText=TranslateTS(lpzText); + lpzText = TranslateTS(lpzText); if (bModulesLoaded && PopupServiceExists && ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, SKYPE_PROTONAME, "UsePopup", 0) && !MirandaShuttingDown) { BOOL showPopup, popupWindowColor; @@ -215,32 +214,32 @@ int ShowMessage(int iconID, TCHAR *lpzText, int mustShow) { popupTimeSec = db_get_dw(NULL, SKYPE_PROTONAME, "popupTimeSecErr", 4); popupTextColor = db_get_dw(NULL, SKYPE_PROTONAME, "popupTextColorErr", GetSysColor(COLOR_WINDOWTEXT)); popupBackColor = db_get_dw(NULL, SKYPE_PROTONAME, "popupBackColorErr", GetSysColor(COLOR_BTNFACE)); - popupWindowColor = ( 0 != db_get_b(NULL, SKYPE_PROTONAME, "popupWindowColorErr", TRUE)); - showPopup = ( 0 != db_get_b(NULL, SKYPE_PROTONAME, "showPopupErr", TRUE)); + popupWindowColor = (0 != db_get_b(NULL, SKYPE_PROTONAME, "popupWindowColorErr", TRUE)); + showPopup = (0 != db_get_b(NULL, SKYPE_PROTONAME, "showPopupErr", TRUE)); MessagePopup.lchContact = NULL; - MessagePopup.lchIcon = LoadIcon(hInst,MAKEINTRESOURCE(iconID)); - MessagePopup.colorBack = ! popupWindowColor ? popupBackColor : GetSysColor(COLOR_BTNFACE); - MessagePopup.colorText = ! popupWindowColor ? popupTextColor : GetSysColor(COLOR_WINDOWTEXT); + MessagePopup.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(iconID)); + MessagePopup.colorBack = !popupWindowColor ? popupBackColor : GetSysColor(COLOR_BTNFACE); + MessagePopup.colorText = !popupWindowColor ? popupTextColor : GetSysColor(COLOR_WINDOWTEXT); MessagePopup.iSeconds = popupTimeSec; MessagePopup.PluginData = (void *)1; - + lstrcpy(MessagePopup.lptzText, lpzText); #ifdef _UNICODE - mbstowcs (MessagePopup.lptzContactName, SKYPE_PROTONAME, strlen(SKYPE_PROTONAME)+1); + mbstowcs(MessagePopup.lptzContactName, SKYPE_PROTONAME, strlen(SKYPE_PROTONAME) + 1); #else lstrcpy(MessagePopup.lptzContactName, SKYPE_PROTONAME); #endif - if(showPopup) - CallService(MS_POPUP_ADDPOPUPT,(WPARAM)&MessagePopup,0); + if (showPopup) + CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&MessagePopup, 0); return 0; - } + } else { - if (mustShow==1) MessageBox(NULL,lpzText,_T("Skype Protocol"), MB_OK | MB_ICONWARNING); + if (mustShow == 1) MessageBox(NULL, lpzText, _T("Skype Protocol"), MB_OK | MB_ICONWARNING); return 0; } } @@ -248,11 +247,11 @@ int ShowMessage(int iconID, TCHAR *lpzText, int mustShow) { int ShowMessageA(int iconID, char *lpzText, int mustShow) { WCHAR *lpwText; int iRet; - size_t len = mbstowcs (NULL, lpzText, strlen(lpzText)); - if (len == -1 || !(lpwText = (WCHAR*)calloc(len+1,sizeof(WCHAR)))) return -1; - mbstowcs (lpwText, lpzText, strlen(lpzText)); + size_t len = mbstowcs(NULL, lpzText, strlen(lpzText)); + if (len == -1 || !(lpwText = (WCHAR*)calloc(len + 1, sizeof(WCHAR)))) return -1; + mbstowcs(lpwText, lpzText, strlen(lpzText)); iRet = ShowMessage(iconID, lpwText, mustShow); - free (lpwText); + free(lpwText); return iRet; } #endif @@ -264,8 +263,8 @@ int HookContactAdded(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); - szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 ); - if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME)) + szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); + if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME)) add_contextmenu((MCONTACT)wParam); return 0; } @@ -275,13 +274,13 @@ int HookContactDeleted(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); - szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 ); - if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME)) { + szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); + if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME)) { DBVARIANT dbv; int retval; if (db_get_s((MCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 1; - retval=SkypeSend("SET USER %s BUDDYSTATUS 1", dbv.pszVal); + retval = SkypeSend("SET USER %s BUDDYSTATUS 1", dbv.pszVal); db_free(&dbv); if (retval) return 1; } @@ -300,30 +299,30 @@ void GetInfoThread(void *hContact) // fall through there so that message gets added to the queue in order to be // consumed by SkypeGet char *pszProps[] = { - "BIRTHDAY", "COUNTRY", "SEX", "MOOD_TEXT", "TIMEZONE", "IS_VIDEO_CAPABLE"}; + "BIRTHDAY", "COUNTRY", "SEX", "MOOD_TEXT", "TIMEZONE", "IS_VIDEO_CAPABLE" }; - LOG (("GetInfoThread started.")); - EnterCriticalSection (&QueryThreadMutex); - if (db_get_s((MCONTACT)hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) + LOG(("GetInfoThread started.")); + EnterCriticalSection(&QueryThreadMutex); + if (db_get_s((MCONTACT)hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) { - LOG (("GetInfoThread terminated, cannot find Skype Name for contact %08X.", hContact)); - LeaveCriticalSection (&QueryThreadMutex); + LOG(("GetInfoThread terminated, cannot find Skype Name for contact %08X.", hContact)); + LeaveCriticalSection(&QueryThreadMutex); return; } - if (ptr=SkypeGet ("USER", dbv.pszVal, "DISPLAYNAME")) { + if (ptr = SkypeGet("USER", dbv.pszVal, "DISPLAYNAME")) { // WndProc sets Nick accordingly if (*ptr) bSetNick = TRUE; - free (ptr); + free(ptr); } - if (ptr=SkypeGet ("USER", dbv.pszVal, "FULLNAME")) { + if (ptr = SkypeGet("USER", dbv.pszVal, "FULLNAME")) { if (*ptr && !bSetNick && db_get_b(NULL, SKYPE_PROTONAME, "ShowFullname", 1)) { // No Displayname and FULLNAME requested db_set_utf((MCONTACT)hContact, SKYPE_PROTONAME, "Nick", ptr); bSetNick = TRUE; } - free (ptr); + free(ptr); } if (!bSetNick) { @@ -334,81 +333,83 @@ void GetInfoThread(void *hContact) if (!bIsImoproxy) { - for (i=0; i= 7 || bIsImoproxy) { // Notify about the possibility of an avatar - ACKDATA ack = {0}; - ack.cbSize = sizeof( ACKDATA ); + ACKDATA ack = { 0 }; + ack.cbSize = sizeof(ACKDATA); ack.szModule = SKYPE_PROTONAME; ack.hContact = (MCONTACT)hContact; ack.type = ACKTYPE_AVATAR; ack.result = ACKRESULT_STATUS; - CallService( MS_PROTO_BROADCASTACK, 0, ( LPARAM )&ack ); + CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)&ack); //if (ptr=SkypeGet ("USER", dbv.pszVal, "RICH_MOOD_TEXT")) free (ptr); } if (!bIsImoproxy) { - for (i=0; i=5 || bIsImoproxy) { - SkypeSend ("CREATE APPLICATION libpurple_typing"); - testfor ("CREATE APPLICATION libpurple_typing", 2000); + if (SearchFriends() == -1) { + LOG(("SkypeSystemInit thread stopped with failure.")); + Initializing = FALSE; + return; + } + if (protocol >= 5 || bIsImoproxy) { + SkypeSend("CREATE APPLICATION libpurple_typing"); + testfor("CREATE APPLICATION libpurple_typing", 2000); } - if (protocol>=5 || bIsImoproxy) { + if (protocol >= 5 || bIsImoproxy) { SearchUsersWaitingMyAuthorization(NULL); if (db_get_b(NULL, SKYPE_PROTONAME, "UseGroupchat", 0)) SearchRecentChats(NULL); } SkypeSend("SEARCH MISSED%sS", cmdMessage); - + #ifndef SKYPEBUG_OFFLN if (SkypeSend("GET USERSTATUS")==-1) { - LOG (("SkypeSystemInit thread stopped with failure.")); + LOG (("SkypeSystemInit thread stopped with failure.")); Initializing=FALSE; return; } #endif - SetTimer (g_hWnd, 1, PING_INTERVAL, NULL); - SkypeInitialized=TRUE; - Initializing=FALSE; - LOG (("SkypeSystemInit thread terminated gracefully.")); + SetTimer(g_hWnd, 1, PING_INTERVAL, NULL); + SkypeInitialized = TRUE; + Initializing = FALSE; + LOG(("SkypeSystemInit thread terminated gracefully.")); return; } void FirstLaunch(char *dummy) { - int counter=0; + int counter = 0; UNREFERENCED_PARAMETER(dummy); - LOG (("FirstLaunch thread started.")); - if (!db_get_b(NULL, SKYPE_PROTONAME, "StartSkype", 1) || ConnectToSkypeAPI(skype_path, FALSE)==-1) + LOG(("FirstLaunch thread started.")); + if (!db_get_b(NULL, SKYPE_PROTONAME, "StartSkype", 1) || ConnectToSkypeAPI(skype_path, FALSE) == -1) { - int oldstatus=SkypeStatus; + int oldstatus = SkypeStatus; - LOG(("OnModulesLoaded starting offline..")); + LOG(("OnModulesLoaded starting offline..")); InterlockedExchange((long *)&SkypeStatus, ID_STATUS_OFFLINE); - ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldstatus, SkypeStatus); + ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldstatus, SkypeStatus); } - if (AttachStatus==-1 || AttachStatus==SKYPECONTROLAPI_ATTACH_REFUSED || AttachStatus==SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE) { - LOG (("FirstLaunch thread stopped because of invalid Attachstatus.")); + if (AttachStatus == -1 || AttachStatus == SKYPECONTROLAPI_ATTACH_REFUSED || AttachStatus == SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE) { + LOG(("FirstLaunch thread stopped because of invalid Attachstatus.")); return; } - + // When you launch Skype and Attach is Successfull, it still takes some time // until it becomes available for receiving messages. // Let's probe this with PINGing LOG(("CheckIfApiIsResponding Entering test loop")); - for ( ;; ) { + for (;;) { LOG(("Test #%d", counter)); - if (SkypeSend("PING")==-1) counter ++; else break; - if (counter>=20) { + if (SkypeSend("PING") == -1) counter++; else break; + if (counter >= 20) { OUTPUT(_T("Cannot reach Skype API, plugin disfunct.")); - LOG (("FirstLaunch thread stopped: cannot reach Skype API.")); + LOG(("FirstLaunch thread stopped: cannot reach Skype API.")); return; } Sleep(500); @@ -783,28 +787,28 @@ void FirstLaunch(char *dummy) { LOG(("CheckIfApiIsResponding: Testing for PONG")); testfor("PONG", 2000); // Flush PONG from MsgQueue - pthread_create(( pThreadFunc )SkypeSystemInit, NULL); - LOG (("FirstLaunch thread terminated gracefully.")); + pthread_create((pThreadFunc)SkypeSystemInit, NULL); + LOG(("FirstLaunch thread terminated gracefully.")); } int CreateTopToolbarButton(WPARAM wParam, LPARAM lParam) { - TTBButton ttb={0}; - + TTBButton ttb = { 0 }; + UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(lParam); ttb.cbSize = sizeof(ttb); - ttb.dwFlags = TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP; - ttb.hIconHandleDn = ttb.hIconHandleUp = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_CALL)); + ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP; + ttb.hIconHandleDn = ttb.hIconHandleUp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_CALL)); ttb.pszService = SKYPEOUT_CALL; - ttb.name=Translate("Do a SkypeOut-call"); - if ((int)(TopToolbar_AddButton(&ttb))==-1) httbButton=0; + ttb.name = Translate("Do a SkypeOut-call"); + if ((int)(TopToolbar_AddButton(&ttb)) == -1) httbButton = 0; return 0; } int OnModulesLoaded(WPARAM wParam, LPARAM lParam) { - bModulesLoaded=TRUE; + bModulesLoaded = TRUE; UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(lParam); @@ -815,31 +819,30 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) { HookEventsLoaded(); RegisterToDbeditorpp(); - VoiceServiceModulesLoaded(); GCInit(); add_contextmenu(NULL); - if ( ServiceExists( MS_GC_REGISTER )) + if (ServiceExists(MS_GC_REGISTER)) { - static COLORREF crCols[1] = {0}; + static COLORREF crCols[1] = { 0 }; char szEvent[MAXMODULELABELLENGTH]; GCREGISTER gcr = { sizeof(gcr) }; gcr.dwFlags = GC_CHANMGR; // |GC_ACKMSG; // TODO: Not implemented yet gcr.ptszDispName = _T("Skype protocol"); gcr.pszModule = SKYPE_PROTONAME; - if (CallService(MS_GC_REGISTER, 0, (LPARAM)&gcr)) + if (CallService(MS_GC_REGISTER, 0, (LPARAM)&gcr)) OUTPUT(_T("Unable to register with Groupchat module!")); - _snprintf (szEvent, sizeof(szEvent), "%s\\ChatInit", SKYPE_PROTONAME); + _snprintf(szEvent, sizeof(szEvent), "%s\\ChatInit", SKYPE_PROTONAME); hInitChat = CreateHookableEvent(szEvent); hEvInitChat = HookEvent(szEvent, ChatInit); hChatEvent = HookEvent(ME_GC_EVENT, GCEventHook); hChatMenu = HookEvent(ME_GC_BUILDMENU, GCMenuHook); - CreateServiceFunction (SKYPE_CHATNEW, SkypeChatCreate); - CreateProtoService (PS_LEAVECHAT, GCOnLeaveChat); - CreateProtoService (PS_JOINCHAT, GCOnJoinChat); + CreateServiceFunction(SKYPE_CHATNEW, SkypeChatCreate); + CreateProtoService(PS_LEAVECHAT, GCOnLeaveChat); + CreateProtoService(PS_JOINCHAT, GCOnJoinChat); } // Try folder service first hProtocolAvatarsFolder = NULL; @@ -847,83 +850,84 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) { { char *tmpPath; - if (!ServiceExists (MS_UTILS_REPLACEVARS) || !(tmpPath = Utils_ReplaceVars("%miranda_avatarcache%"))) + if (!ServiceExists(MS_UTILS_REPLACEVARS) || !(tmpPath = Utils_ReplaceVars("%miranda_avatarcache%"))) tmpPath = PROFILE_PATH; mir_snprintf(DefaultAvatarsFolder, sizeof(DefaultAvatarsFolder), "%s\\%s", tmpPath, SKYPE_PROTONAME); - hProtocolAvatarsFolder = (HANDLE) FoldersRegisterCustomPath(SKYPE_PROTONAME, "Avatars Cache", DefaultAvatarsFolder); + hProtocolAvatarsFolder = (HANDLE)FoldersRegisterCustomPath(SKYPE_PROTONAME, "Avatars Cache", DefaultAvatarsFolder); } - + if (hProtocolAvatarsFolder == NULL) { // Use defaults - CallService(MS_DB_GETPROFILEPATH, (WPARAM) MAX_PATH, (LPARAM) DefaultAvatarsFolder); + CallService(MS_DB_GETPROFILEPATH, (WPARAM)MAX_PATH, (LPARAM)DefaultAvatarsFolder); mir_snprintf(DefaultAvatarsFolder, sizeof(DefaultAvatarsFolder), "%s\\%s", DefaultAvatarsFolder, SKYPE_PROTONAME); CreateDirectoryA(DefaultAvatarsFolder, NULL); } - pthread_create(( pThreadFunc )FirstLaunch, NULL); + pthread_create((pThreadFunc)FirstLaunch, NULL); return 0; } void FetchMessageThread(fetchmsg_arg *pargs) { - char *who=NULL, *type=NULL, *chat=NULL, *users=NULL, *msg=NULL, *status=NULL; + char *who = NULL, *type = NULL, *chat = NULL, *users = NULL, *msg = NULL, *status = NULL; char *ptr, *msgptr, szPartnerHandle[32], szBuf[128]; - int direction=0, msglen = 0; - DWORD timestamp = 0, lwr=0; - CCSDATA ccs={0}; - PROTORECVEVENT pre={0}; + int direction = 0, msglen = 0; + DWORD timestamp = 0, lwr = 0; + CCSDATA ccs = { 0 }; + PROTORECVEVENT pre = { 0 }; MCONTACT hContact = NULL, hChat = NULL; HANDLE hDbEvent; - DBEVENTINFO dbei={0}; - DBVARIANT dbv={0}; + DBEVENTINFO dbei = { 0 }; + DBVARIANT dbv = { 0 }; fetchmsg_arg args; - BOOL bEmoted=FALSE, isGroupChat=FALSE, bHasPartList=FALSE; + BOOL bEmoted = FALSE, isGroupChat = FALSE, bHasPartList = FALSE; BOOL bUseGroupChat = db_get_b(NULL, SKYPE_PROTONAME, "UseGroupchat", 0); if (!pargs) return; args = *pargs; - free (pargs); - - sprintf (szPartnerHandle, "%s_HANDLE", cmdPartner); + free(pargs); + + sprintf(szPartnerHandle, "%s_HANDLE", cmdPartner); pre.lParam = strtoul(args.msgnum, NULL, 10); if (args.bIsRead) pre.flags |= PREF_CREATEREAD; //pEvent = MsgList_FindMessage(pre.lParam); // Get Timestamp if (!args.pMsgEntry || !args.pMsgEntry->tEdited) { - if (!(ptr=SkypeGet (cmdMessage, args.msgnum, "TIMESTAMP"))) return; - if (strncmp(ptr, "ERROR", 5)) timestamp=atol(ptr); - else timestamp=(DWORD)SkypeTime(NULL); + if (!(ptr = SkypeGet(cmdMessage, args.msgnum, "TIMESTAMP"))) return; + if (strncmp(ptr, "ERROR", 5)) timestamp = atol(ptr); + else timestamp = (DWORD)SkypeTime(NULL); free(ptr); - } else timestamp=(DWORD)(args.pMsgEntry->tEdited); + } + else timestamp = (DWORD)(args.pMsgEntry->tEdited); __try { // Get Chatname (also to determine if we need to relay this to a groupchat) - if (!(chat=SkypeGetErr (cmdMessage, args.msgnum, "CHATNAME"))) __leave; - if (hChat = find_chatA(chat)) isGroupChat=TRUE; + if (!(chat = SkypeGetErr(cmdMessage, args.msgnum, "CHATNAME"))) __leave; + if (hChat = find_chatA(chat)) isGroupChat = TRUE; // Get chat status - if ((status=SkypeGetErr ("CHAT", chat, "STATUS")) && - !strcmp(status, "MULTI_SUBSCRIBED")) isGroupChat=TRUE; - + if ((status = SkypeGetErr("CHAT", chat, "STATUS")) && + !strcmp(status, "MULTI_SUBSCRIBED")) isGroupChat = TRUE; + // Get chat type - if (!(type=SkypeGetErr (cmdMessage, args.msgnum, "TYPE"))) __leave; - bEmoted = strcmp(type, "EMOTED")==0; - if (strcmp(type, "MULTI_SUBSCRIBED")==0) isGroupChat=TRUE; + if (!(type = SkypeGetErr(cmdMessage, args.msgnum, "TYPE"))) __leave; + bEmoted = strcmp(type, "EMOTED") == 0; + if (strcmp(type, "MULTI_SUBSCRIBED") == 0) isGroupChat = TRUE; // Group chat handling if (isGroupChat && strcmp(type, "TEXT") && strcmp(type, "SAID") && strcmp(type, "UNKNOWN") && !bEmoted) { if (bUseGroupChat) { BOOL bAddedMembers = FALSE; - if (!strcmp(type,"SAWMEMBERS") || !strcmp(type, "CREATEDCHATWITH")) + if (!strcmp(type, "SAWMEMBERS") || !strcmp(type, "CREATEDCHATWITH")) { // We have a new Groupchat LOG(("FetchMessageThread CHAT SAWMEMBERS")); if (!hChat) ChatStart(chat, FALSE); __leave; } - if (!strcmp(type,"KICKED")) + if (!strcmp(type, "KICKED")) { if (!hChat) __leave; GCDEST gcd = { SKYPE_PROTONAME, make_nonutf_tchar_string((const unsigned char*)chat), GC_EVENT_KICK }; @@ -931,29 +935,29 @@ void FetchMessageThread(fetchmsg_arg *pargs) { gce.dwFlags = GCEF_ADDTOLOG; gce.time = timestamp; - if (users=SkypeGetErr (cmdMessage, args.msgnum, "USERS")) { - CONTACTINFO ci = {0}; + if (users = SkypeGetErr(cmdMessage, args.msgnum, "USERS")) { + CONTACTINFO ci = { 0 }; ci.hContact = find_contact(users); - gce.ptszUID= make_nonutf_tchar_string((const unsigned char*)users); - if (who=SkypeGetErr (cmdMessage, args.msgnum, szPartnerHandle)) { - gce.ptszStatus= make_nonutf_tchar_string((const unsigned char*)who); + gce.ptszUID = make_nonutf_tchar_string((const unsigned char*)users); + if (who = SkypeGetErr(cmdMessage, args.msgnum, szPartnerHandle)) { + gce.ptszStatus = make_nonutf_tchar_string((const unsigned char*)who); ci.cbSize = sizeof(ci); ci.szProto = SKYPE_PROTONAME; ci.dwFlag = CNF_DISPLAY | CNF_TCHAR; - if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) gce.ptszNick=ci.pszVal; - else gce.ptszNick=gce.ptszUID; - + if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) gce.ptszNick = ci.pszVal; + else gce.ptszNick = gce.ptszUID; + CallService(MS_GC_EVENT, 0, (LPARAM)&gce); - RemChatContact (GetChat(gcd.ptszID), gce.ptszUID); + RemChatContact(GetChat(gcd.ptszID), gce.ptszUID); free_nonutf_tchar_string((void*)gce.ptszStatus); - if (ci.pszVal) mir_free (ci.pszVal); + if (ci.pszVal) mir_free(ci.pszVal); } free_nonutf_tchar_string((void*)gce.ptszUID); } free_nonutf_tchar_string((void*)gcd.ptszID); __leave; } - if (!strcmp(type,"SETROLE")) + if (!strcmp(type, "SETROLE")) { gchat_contact *gcContact; char *pszRole; @@ -967,70 +971,70 @@ void FetchMessageThread(fetchmsg_arg *pargs) { gce.dwFlags = GCEF_ADDTOLOG; gce.time = timestamp; - if (users=SkypeGetErr (cmdMessage, args.msgnum, "USERS")) { - gce.ptszUID= make_nonutf_tchar_string((const unsigned char*)users); - if (who=SkypeGetErr (cmdMessage, args.msgnum, szPartnerHandle)) { - CONTACTINFO ci = {0}; + if (users = SkypeGetErr(cmdMessage, args.msgnum, "USERS")) { + gce.ptszUID = make_nonutf_tchar_string((const unsigned char*)users); + if (who = SkypeGetErr(cmdMessage, args.msgnum, szPartnerHandle)) { + CONTACTINFO ci = { 0 }; ci.cbSize = sizeof(ci); ci.szProto = SKYPE_PROTONAME; ci.dwFlag = CNF_DISPLAY | CNF_TCHAR; ci.hContact = find_contact(who); - if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) { - gce.ptszText=_tcsdup(ci.pszVal); - mir_free (ci.pszVal); + if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) { + gce.ptszText = _tcsdup(ci.pszVal); + mir_free(ci.pszVal); ci.pszVal = NULL; } - else gce.ptszText=make_tchar_string((const unsigned char*)who); + else gce.ptszText = make_tchar_string((const unsigned char*)who); ci.hContact = find_contact(users); - if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) gce.ptszNick=ci.pszVal; - else gce.ptszNick=gce.ptszUID; + if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) gce.ptszNick = ci.pszVal; + else gce.ptszNick = gce.ptszUID; if (gcContact = GetChatContact(GetChat(gcd.ptszID), gce.ptszUID)) { gce.ptszStatus = gcContact->szRole; CallService(MS_GC_EVENT, 0, (LPARAM)&gce); } - if (pszRole=SkypeGetErr (cmdMessage, args.msgnum, "ROLE")) { + if (pszRole = SkypeGetErr(cmdMessage, args.msgnum, "ROLE")) { gce.ptszStatus = make_nonutf_tchar_string((const unsigned char*)pszRole); gcd.iType = GC_EVENT_ADDSTATUS; CallService(MS_GC_EVENT, 0, (LPARAM)&gce); free_nonutf_tchar_string((void*)gce.ptszStatus); - free (pszRole); + free(pszRole); } free((void*)gce.ptszText); - if (ci.pszVal) mir_free (ci.pszVal); + if (ci.pszVal) mir_free(ci.pszVal); } free_nonutf_tchar_string((void*)gce.ptszUID); } free_nonutf_tchar_string((void*)gcd.ptszID); __leave; } - if (!strcmp(type,"SETTOPIC")) + if (!strcmp(type, "SETTOPIC")) { LOG(("FetchMessageThread CHAT SETTOPIC")); GCDEST gcd = { SKYPE_PROTONAME, make_nonutf_tchar_string((const unsigned char*)chat), GC_EVENT_TOPIC }; GCEVENT gce = { sizeof(gce), &gcd }; gce.dwFlags = GCEF_ADDTOLOG; gce.time = timestamp; - if (who=SkypeGetErr (cmdMessage, args.msgnum, szPartnerHandle)) { - CONTACTINFO ci = {0}; + if (who = SkypeGetErr(cmdMessage, args.msgnum, szPartnerHandle)) { + CONTACTINFO ci = { 0 }; ci.hContact = find_contact(who); gce.ptszUID = make_nonutf_tchar_string((const unsigned char*)who); ci.cbSize = sizeof(ci); ci.szProto = SKYPE_PROTONAME; ci.dwFlag = CNF_DISPLAY | CNF_TCHAR; - if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) gce.ptszNick=ci.pszVal; - else gce.ptszNick=gce.ptszUID; + if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) gce.ptszNick = ci.pszVal; + else gce.ptszNick = gce.ptszUID; - if (ptr=SkypeGetErr (cmdMessage, args.msgnum, "BODY")) { + if (ptr = SkypeGetErr(cmdMessage, args.msgnum, "BODY")) { gce.ptszText = make_tchar_string((const unsigned char*)ptr); CallService(MS_GC_EVENT, 0, (LPARAM)&gce); - free ((void*)gce.ptszText); - free (ptr); + free((void*)gce.ptszText); + free(ptr); } - free_nonutf_tchar_string ((void*)gce.ptszUID); - if (ci.pszVal) mir_free (ci.pszVal); + free_nonutf_tchar_string((void*)gce.ptszUID); + if (ci.pszVal) mir_free(ci.pszVal); } free_nonutf_tchar_string((void*)gcd.ptszID); if (!args.bDontMarkSeen) @@ -1040,7 +1044,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { } __leave; } - if (!strcmp(type,"LEFT") || (bAddedMembers = strcmp(type,"ADDEDMEMBERS")==0)) + if (!strcmp(type, "LEFT") || (bAddedMembers = strcmp(type, "ADDEDMEMBERS") == 0)) { LOG(("FetchMessageThread CHAT LEFT or ADDEDMEMBERS")); if (bAddedMembers) { @@ -1048,37 +1052,37 @@ void FetchMessageThread(fetchmsg_arg *pargs) { GCEVENT gce = { sizeof(gce), &gcd }; gce.dwFlags = GCEF_ADDTOLOG; gce.time = timestamp; - if (users=SkypeGetErr (cmdMessage, args.msgnum, "USERS")) { + if (users = SkypeGetErr(cmdMessage, args.msgnum, "USERS")) { CMString(FORMAT, _T("%S %s"), users, TranslateT("invited")); - gce.ptszText= make_tchar_string((const unsigned char*)users); - if (who=SkypeGetErr (cmdMessage, args.msgnum, szPartnerHandle)) { + gce.ptszText = make_tchar_string((const unsigned char*)users); + if (who = SkypeGetErr(cmdMessage, args.msgnum, szPartnerHandle)) { DBVARIANT dbv; - if (db_get_s(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv)==0) { - gce.bIsMe = strcmp(who, dbv.pszVal)==0; + if (db_get_s(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv) == 0) { + gce.bIsMe = strcmp(who, dbv.pszVal) == 0; db_free(&dbv); } - gce.ptszUID = make_nonutf_tchar_string((const unsigned char*)who); + gce.ptszUID = make_nonutf_tchar_string((const unsigned char*)who); - CONTACTINFO ci = {0}; + CONTACTINFO ci = { 0 }; ci.cbSize = sizeof(ci); if (!gce.bIsMe) ci.hContact = find_contact(who); ci.szProto = SKYPE_PROTONAME; ci.dwFlag = CNF_DISPLAY | CNF_TCHAR; - if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) - gce.ptszNick = ci.pszVal; + if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) + gce.ptszNick = ci.pszVal; else gce.ptszNick = gce.ptszUID; - + CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); free_nonutf_tchar_string((void*)gce.ptszUID); - if (ci.pszVal) mir_free (ci.pszVal); + if (ci.pszVal) mir_free(ci.pszVal); } - if (gce.ptszText) free ((void*)gce.ptszText); + if (gce.ptszText) free((void*)gce.ptszText); } - free_nonutf_tchar_string ((void*)gcd.ptszID); + free_nonutf_tchar_string((void*)gcd.ptszID); } - if (!args.QueryMsgDirection) SkypeSend ("GET CHAT %s MEMBERS", chat); + if (!args.QueryMsgDirection) SkypeSend("GET CHAT %s MEMBERS", chat); __leave; } } @@ -1089,103 +1093,104 @@ void FetchMessageThread(fetchmsg_arg *pargs) { if (args.getstatus) { char *status; - if (protocol<4) InterlockedIncrement (&rcvwatchers); - status=SkypeGetID(cmdMessage, args.msgnum, "STATUS"); - if (protocol<4) InterlockedDecrement (&rcvwatchers); + if (protocol < 4) InterlockedIncrement(&rcvwatchers); + status = SkypeGetID(cmdMessage, args.msgnum, "STATUS"); + if (protocol < 4) InterlockedDecrement(&rcvwatchers); if (!status) __leave; - if (!strcmp(status, "SENT")) direction=DBEF_SENT; + if (!strcmp(status, "SENT")) direction = DBEF_SENT; free(status); } // Who sent it? - if (!(who=SkypeGetErr (cmdMessage, args.msgnum, szPartnerHandle))) __leave; + if (!(who = SkypeGetErr(cmdMessage, args.msgnum, szPartnerHandle))) __leave; // Get contact handle LOG(("FetchMessageThread Finding contact handle")); db_get_s(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv); - if (dbv.pszVal && !strcmp (who, dbv.pszVal)) + if (dbv.pszVal && !strcmp(who, dbv.pszVal)) { char *pTok, *nextoken; // It's from me.. But to whom? // CHATMESSAGE .. USERS doesn't return anything, so we have to query the CHAT-Object - if (!(ptr=SkypeGetErr ("CHAT", chat, "ACTIVEMEMBERS"))) { - db_free (&dbv); + if (!(ptr = SkypeGetErr("CHAT", chat, "ACTIVEMEMBERS"))) { + db_free(&dbv); __leave; } - for (pTok = strtok_r (ptr, " ", &nextoken); pTok; pTok=strtok_r(NULL, " ", &nextoken)) { - if (strcmp (pTok, dbv.pszVal)) break; // Take the first dude in the list who is not me + for (pTok = strtok_r(ptr, " ", &nextoken); pTok; pTok = strtok_r(NULL, " ", &nextoken)) { + if (strcmp(pTok, dbv.pszVal)) break; // Take the first dude in the list who is not me } if (!pTok) { - free (ptr); - db_free (&dbv); + free(ptr); + db_free(&dbv); __leave; // We failed } - free (who); - who=(char *)memmove (ptr, pTok, strlen(pTok)+1); + free(who); + who = (char *)memmove(ptr, pTok, strlen(pTok) + 1); direction = DBEF_SENT; } - db_free (&dbv); + db_free(&dbv); - if (!(hContact=find_contact(who))) { + if (!(hContact = find_contact(who))) { // Permanent adding of user obsolete, we use the BUDDYSTATUS now (bug #0000005) ResetEvent(hBuddyAdded); SkypeSend("GET USER %s BUDDYSTATUS", who); WaitForSingleObject(hBuddyAdded, INFINITE); - if (!(hContact=find_contact(who))) { + if (!(hContact = find_contact(who))) { // Arrgh, the user has been deleted from contact list. // In this case, we add him temp. to receive the msg at least. - hContact=add_contact(who, PALF_TEMPORARY); + hContact = add_contact(who, PALF_TEMPORARY); } } // Text which was sent (on edited msg, BODY may already be in queue, check) - sprintf (szBuf, "GET %s %s BODY", cmdMessage, args.msgnum); - if (!args.pMsgEntry || !args.pMsgEntry->tEdited || !(ptr=SkypeRcv(szBuf+4, 1000))) + sprintf(szBuf, "GET %s %s BODY", cmdMessage, args.msgnum); + if (!args.pMsgEntry || !args.pMsgEntry->tEdited || !(ptr = SkypeRcv(szBuf + 4, 1000))) { - if (SkypeSend(szBuf)==-1 || !(ptr=SkypeRcv(szBuf+4, INFINITE))) + if (SkypeSend(szBuf) == -1 || !(ptr = SkypeRcv(szBuf + 4, INFINITE))) __leave; } if (strncmp(ptr, "ERROR", 5)) { - msgptr = ptr+strlen(szBuf+4)+1; - bHasPartList = strncmp(msgptr,"tEdited) { // Mark the message as edited if (!*msgptr && args.pMsgEntry->hEvent != INVALID_HANDLE_VALUE) { // Empty message and edited -> Delete event if ((int)(hContact = db_event_getContact(args.pMsgEntry->hEvent)) != -1) { db_event_delete(hContact, args.pMsgEntry->hEvent); - free (ptr); + free(ptr); __leave; } - } else { - msgptr-=9; - memcpy (msgptr, "[EDITED] ", 9); + } + else { + msgptr -= 9; + memcpy(msgptr, "[EDITED] ", 9); } } - if( bEmoted && !isGroupChat) { - CONTACTINFO ci = {0}; + if (bEmoted && !isGroupChat) { + CONTACTINFO ci = { 0 }; int newlen; - char *pMsg, *pszUTFnick=NULL; + char *pMsg, *pszUTFnick = NULL; ci.cbSize = sizeof(ci); ci.szProto = SKYPE_PROTONAME; ci.dwFlag = CNF_DISPLAY | CNF_TCHAR; if (ci.hContact = hContact) { - CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci); + CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci); if (ci.pszVal) { #ifdef _UNICODE pszUTFnick = (char*)make_utf8_string(ci.pszVal); #else utf8_encode (ci.pszVal, &pszUTFnick); #endif - mir_free (ci.pszVal); + mir_free(ci.pszVal); } } - newlen = int(strlen(msgptr) + (pszUTFnick?strlen(pszUTFnick):0) + 9); + newlen = int(strlen(msgptr) + (pszUTFnick ? strlen(pszUTFnick) : 0) + 9); if (pMsg = (char *)malloc(newlen)) { - sprintf (pMsg, "** %s%s%s **", (pszUTFnick?pszUTFnick:""),(pszUTFnick?" ":""),(char*)msgptr); - free (ptr); + sprintf(pMsg, "** %s%s%s **", (pszUTFnick ? pszUTFnick : ""), (pszUTFnick ? " " : ""), (char*)msgptr); + free(ptr); ptr = msgptr = pMsg; } if (pszUTFnick) free(pszUTFnick); @@ -1195,47 +1200,48 @@ void FetchMessageThread(fetchmsg_arg *pargs) { !isGroupChat) { // I guess Groupchat doesn't support UTF8? msg = ptr; pre.flags |= PREF_UTF; - } else { // Older version has to decode either UTF8->ANSI or UTF8->UNICODE + } + else { // Older version has to decode either UTF8->ANSI or UTF8->UNICODE // This could be replaced by mir_getUTFI - functions for Miranda 0.5+ builds, but we stay // 0.4 compatible for backwards compatibility. Unfortunately this requires us to link with utf8.c #ifdef _UNICODE int wcLen; #endif - if (utf8_decode(msgptr, &msg)==-1) { + if (utf8_decode(msgptr, &msg) == -1) { free(ptr); __leave; } #ifdef _UNICODE - msglen = (int)strlen(msg)+1; - msgptr = (char*)make_unicode_string ((const unsigned char*)msgptr); - wcLen = int(_tcslen((TCHAR*)msgptr)+1)*sizeof(TCHAR); - msg=(char*)realloc(msg, msglen+wcLen); - memcpy (msg+msglen, msgptr, wcLen); + msglen = (int)strlen(msg) + 1; + msgptr = (char*)make_unicode_string((const unsigned char*)msgptr); + wcLen = int(_tcslen((TCHAR*)msgptr) + 1)*sizeof(TCHAR); + msg = (char*)realloc(msg, msglen + wcLen); + memcpy(msg + msglen, msgptr, wcLen); free(msgptr); pre.flags |= PREF_UNICODE; #endif msgptr = msg; - free (ptr); + free(ptr); } - msglen = (int)strlen(msgptr)+1; + msglen = (int)strlen(msgptr) + 1; } else { - free (ptr); + free(ptr); __leave; } // skype sends some xml statics after a call has finished. Check if thats the case and suppress it if necessary... - if ((db_get_b(NULL, SKYPE_PROTONAME, "SuppressCallSummaryMessage", 1) && - bHasPartList) || msgptr[0]==0) __leave; + if ((db_get_b(NULL, SKYPE_PROTONAME, "SuppressCallSummaryMessage", 1) && + bHasPartList) || msgptr[0] == 0) __leave; if (isGroupChat && bUseGroupChat) { - DBVARIANT dbv = {0}; + DBVARIANT dbv = { 0 }; LOG(("FetchMessageThread This is a group chat message")); if (!hChat) ChatStart(chat, FALSE); GCDEST gcd = { SKYPE_PROTONAME, make_nonutf_tchar_string((const unsigned char*)chat), bEmoted ? GC_EVENT_ACTION : GC_EVENT_MESSAGE }; GCEVENT gce = { sizeof(gce), &gcd }; - if ((gce.bIsMe = (direction&DBEF_SENT)?TRUE:FALSE) && db_get_s(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv)==0) + if ((gce.bIsMe = (direction&DBEF_SENT) ? TRUE : FALSE) && db_get_s(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv) == 0) { free(who); who = _strdup(dbv.pszVal); @@ -1244,19 +1250,19 @@ void FetchMessageThread(fetchmsg_arg *pargs) { gce.ptszUID = make_nonutf_tchar_string((const unsigned char*)who); gce.ptszNick = gce.ptszUID; - CONTACTINFO ci = {0}; + CONTACTINFO ci = { 0 }; ci.cbSize = sizeof(ci); ci.szProto = SKYPE_PROTONAME; ci.dwFlag = CNF_DISPLAY | CNF_TCHAR; ci.hContact = !gce.bIsMe ? hContact : NULL; if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) - gce.ptszNick = ci.pszVal; - gce.time = timestamp > 0 ? timestamp : (DWORD)SkypeTime(NULL); - gce.ptszText = (TCHAR*)(msgptr+msglen); + gce.ptszNick = ci.pszVal; + gce.time = timestamp > 0 ? timestamp : (DWORD)SkypeTime(NULL); + gce.ptszText = (TCHAR*)(msgptr + msglen); gce.dwFlags = GCEF_ADDTOLOG; CallService(MS_GC_EVENT, 0, (LPARAM)&gce); MsgList_Add(pre.lParam, INVALID_HANDLE_VALUE); // Mark as groupchat - if (ci.pszVal) mir_free (ci.pszVal); + if (ci.pszVal) mir_free(ci.pszVal); free_nonutf_tchar_string((void*)gce.ptszUID); free_nonutf_tchar_string((void*)gcd.ptszID); @@ -1268,33 +1274,33 @@ void FetchMessageThread(fetchmsg_arg *pargs) { if (args.QueryMsgDirection || (direction&DBEF_SENT)) { // Check if the timestamp is valid - dbei.cbSize=sizeof(dbei); - dbei.cbBlob=0; + dbei.cbSize = sizeof(dbei); + dbei.cbBlob = 0; if (hDbEvent = db_event_first(hContact)) { - db_event_get(hDbEvent,&dbei); - lwr=dbei.timestamp; + db_event_get(hDbEvent, &dbei); + lwr = dbei.timestamp; } - dbei.cbSize=sizeof(dbei); - dbei.cbBlob=0; - dbei.timestamp=0; - if (hDbEvent=db_event_last(hContact)) + dbei.cbSize = sizeof(dbei); + dbei.cbBlob = 0; + dbei.timestamp = 0; + if (hDbEvent = db_event_last(hContact)) db_event_get(hDbEvent, &dbei); LOG(("FetchMessageThread timestamp %ld between %ld and %ld", timestamp, lwr, dbei.timestamp)); - if (timestamp0?timestamp:(DWORD)SkypeTime(NULL); - dbei.flags=direction; - if (pre.flags & PREF_CREATEREAD) dbei.flags|=DBEF_READ; - if (pre.flags & PREF_UTF) dbei.flags|=DBEF_UTF; - dbei.eventType=EVENTTYPE_MESSAGE; + dbei.cbBlob += sizeof(WCHAR)*((DWORD)wcslen((WCHAR*)&msgptr[dbei.cbBlob]) + 1); + dbei.pBlob = (PBYTE)msgptr; + dbei.timestamp = timestamp > 0 ? timestamp : (DWORD)SkypeTime(NULL); + dbei.flags = direction; + if (pre.flags & PREF_CREATEREAD) dbei.flags |= DBEF_READ; + if (pre.flags & PREF_UTF) dbei.flags |= DBEF_UTF; + dbei.eventType = EVENTTYPE_MESSAGE; pme = MsgList_Add(pre.lParam, db_event_add(hContact, &dbei)); // We could call MS_PROTO_CHAINSEND if we want to have MetaContact adding the history for us, @@ -1307,30 +1313,30 @@ void FetchMessageThread(fetchmsg_arg *pargs) { MCONTACT hMetaContact; if (dwMetaLink != MAXDWORD && (hMetaContact = GetMetaHandle(dwMetaLink))) { - dbei.szModule=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hMetaContact, 0); + dbei.szModule = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hMetaContact, 0); pme->hMetaEvent = db_event_add(hMetaContact, &dbei); } } - if (!args.QueryMsgDirection && !args.bDontMarkSeen) + if (!args.QueryMsgDirection && !args.bDontMarkSeen) SkypeSend("SET %s %s SEEN", cmdMessage, args.msgnum); } } - if (!(direction&DBEF_SENT) && (!args.QueryMsgDirection || (args.QueryMsgDirection && timestamp>dbei.timestamp))) { + if (!(direction&DBEF_SENT) && (!args.QueryMsgDirection || (args.QueryMsgDirection && timestamp > dbei.timestamp))) { LOG(("FetchMessageThread Normal message add...")); // Normal message received, process it ccs.szProtoService = PSR_MESSAGE; ccs.hContact = hContact; ccs.wParam = 0; ccs.lParam = (LPARAM)⪯ - pre.flags |= direction; - if(isGroupChat && db_get_b(NULL, SKYPE_PROTONAME, "MarkGroupchatRead", 0)) + pre.flags |= direction; + if (isGroupChat && db_get_b(NULL, SKYPE_PROTONAME, "MarkGroupchatRead", 0)) pre.flags |= PREF_CREATEREAD; - pre.timestamp = timestamp>0?timestamp:(DWORD)SkypeTime(NULL); + pre.timestamp = timestamp > 0 ? timestamp : (DWORD)SkypeTime(NULL); pre.szMessage = msgptr; - CallServiceSync(MS_PROTO_CHAINRECV, 0, (LPARAM) &ccs); + CallServiceSync(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs); // Yes, we have successfully read the msg if (!args.bDontMarkSeen) SkypeSend("SET %s %s SEEN", cmdMessage, args.msgnum); @@ -1342,7 +1348,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { if (users) free(users); if (chat) free(chat); if (type) free(type); - if (who) free (who); + if (who) free(who); } } @@ -1351,61 +1357,61 @@ void FetchMessageThreadSync(fetchmsg_arg *pargs) { // Secure this thread with a mutex. // This is needed to ensure that we get called after an old msg in the queue has // been added so that MsgList_FindEntry will find it. - WaitForSingleObject (FetchMessageEvent, 30000); // Wait max. 30 sec. for previous message fetch to complete + WaitForSingleObject(FetchMessageEvent, 30000); // Wait max. 30 sec. for previous message fetch to complete if ((pargs->pMsgEntry = MsgList_FindMessage(strtoul(pargs->msgnum, NULL, 10))) && !pargs->pMsgEntry->tEdited) { // Better don't do this, as we set the msg as read and with this code, we would // mark messages not opened by user as read which isn't that good /* if (pargs->bIsRead && pMsgEvent->hEvent != INVALID_HANDLE_VALUE) { - MCONTACT hContact; - if ((int)(hContact = (MCONTACT)CallService (MS_DB_EVENT_GETCONTACT, (WPARAM)pMsgEntry->hEvent, 0)) != -1) - CallService (MS_DB_EVENT_MARKREAD, hContact, (LPARAM)hDBEvent); + MCONTACT hContact; + if ((int)(hContact = (MCONTACT)CallService (MS_DB_EVENT_GETCONTACT, (WPARAM)pMsgEntry->hEvent, 0)) != -1) + CallService (MS_DB_EVENT_MARKREAD, hContact, (LPARAM)hDBEvent); } */ - free (pargs); + free(pargs); } - else FetchMessageThread (pargs); - SetEvent (FetchMessageEvent); + else FetchMessageThread(pargs); + SetEvent(FetchMessageEvent); } -static int MsglCmpProc(const void *pstPElement,const void *pstPToFind) +static int MsglCmpProc(const void *pstPElement, const void *pstPToFind) { - return strcmp ((char*)((fetchmsg_arg*)pstPElement)->pMsgEntry, (char*)((fetchmsg_arg*)pstPToFind)->pMsgEntry); + return strcmp((char*)((fetchmsg_arg*)pstPElement)->pMsgEntry, (char*)((fetchmsg_arg*)pstPToFind)->pMsgEntry); } void MessageListProcessingThread(char *str) { - char *token, *nextoken, *chat=NULL; + char *token, *nextoken, *chat = NULL; fetchmsg_arg *args; TYP_LIST *hListMsgs = List_Init(32); int i, nCount; // Frst we need to sort the message timestamps - for ((token=strtok_r(str, ", ", &nextoken)); token; token=strtok_r(NULL, ", ", &nextoken)) { - if (args=(fetchmsg_arg*)calloc(1, sizeof(fetchmsg_arg)+sizeof(DWORD))) { - strncpy (args->msgnum, token, sizeof(args->msgnum)); - args->getstatus=TRUE; - args->bIsRead=TRUE; - args->bDontMarkSeen=TRUE; - args->QueryMsgDirection=TRUE; - args->pMsgEntry = (TYP_MSGLENTRY*) SkypeGet ("CHATMESSAGE", token, "TIMESTAMP"); - if (!chat) chat=SkypeGet ("CHATMESSAGE", token, "CHATNAME"); - if (args->pMsgEntry) List_InsertSort (hListMsgs, MsglCmpProc, args); + for ((token = strtok_r(str, ", ", &nextoken)); token; token = strtok_r(NULL, ", ", &nextoken)) { + if (args = (fetchmsg_arg*)calloc(1, sizeof(fetchmsg_arg) + sizeof(DWORD))) { + strncpy(args->msgnum, token, sizeof(args->msgnum)); + args->getstatus = TRUE; + args->bIsRead = TRUE; + args->bDontMarkSeen = TRUE; + args->QueryMsgDirection = TRUE; + args->pMsgEntry = (TYP_MSGLENTRY*)SkypeGet("CHATMESSAGE", token, "TIMESTAMP"); + if (!chat) chat = SkypeGet("CHATMESSAGE", token, "CHATNAME"); + if (args->pMsgEntry) List_InsertSort(hListMsgs, MsglCmpProc, args); else free(args); } } - for (i=0, nCount=List_Count(hListMsgs); ipMsgEntry); + for (i = 0, nCount = List_Count(hListMsgs); i < nCount; i++) { + args = (fetchmsg_arg*)List_ElementAt(hListMsgs, i); + free(args->pMsgEntry); args->pMsgEntry = NULL; - FetchMessageThreadSync (args); + FetchMessageThreadSync(args); } if (chat) { - SkypeSend ("GET CHAT %s MEMBERS", chat); - free (chat); + SkypeSend("GET CHAT %s MEMBERS", chat); + free(chat); } - List_Exit (hListMsgs); - free (str); + List_Exit(hListMsgs); + free(str); } char *GetCallerHandle(char *szSkypeMsg) { @@ -1416,15 +1422,15 @@ char *GetCallerHandle(char *szSkypeMsg) { MCONTACT GetCallerContact(char *szSkypeMsg) { char *szHandle; - MCONTACT hContact=NULL; + MCONTACT hContact = NULL; - if (!(szHandle=GetCallerHandle(szSkypeMsg))) return NULL; - if (!(hContact=find_contact(szHandle))) { + if (!(szHandle = GetCallerHandle(szSkypeMsg))) return NULL; + if (!(hContact = find_contact(szHandle))) { // If it's a SkypeOut-contact, PARTNER_HANDLE = SkypeOUT number DBVARIANT dbv; int tCompareResult; - for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) { + for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { if (db_get_s(hContact, SKYPE_PROTONAME, "SkypeOutNr", &dbv)) continue; tCompareResult = strcmp(dbv.pszVal, szHandle); db_free(&dbv); @@ -1432,48 +1438,48 @@ MCONTACT GetCallerContact(char *szSkypeMsg) } } free(szHandle); - if (!hContact) {LOG(("GetCallerContact Not found!"));} + if (!hContact) { LOG(("GetCallerContact Not found!")); } return hContact; } MCONTACT GetMetaHandle(DWORD dwId) { - for (MCONTACT hContact=db_find_first(); hContact != NULL; hContact=db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { char *szProto = GetContactProto(hContact); if (szProto != NULL && !strcmp(szProto, "MetaContacts") && - db_get_dw(hContact, "MetaContacts", "MetaID", MAXDWORD)==dwId) + db_get_dw(hContact, "MetaContacts", "MetaID", MAXDWORD) == dwId) return hContact; - } + } return 0; } -LRESULT CALLBACK InCallPopUpProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) +LRESULT CALLBACK InCallPopUpProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - switch(msg) + switch (msg) { - case WM_COMMAND: - break; - - case WM_CONTEXTMENU: - SendMessage(hwnd,UM_DESTROYPOPUP,0,0); - break; - case UM_FREEPLUGINDATA: - //Here we'd free our own data, if we had it. - return FALSE; - case UM_INITPOPUP: - break; - case UM_DESTROYPOPUP: - break; - case WM_NOTIFY: - default: - break; - } - return DefWindowProc(hwnd,msg,wParam,lParam); + case WM_COMMAND: + break; + + case WM_CONTEXTMENU: + SendMessage(hwnd, UM_DESTROYPOPUP, 0, 0); + break; + case UM_FREEPLUGINDATA: + //Here we'd free our own data, if we had it. + return FALSE; + case UM_INITPOPUP: + break; + case UM_DESTROYPOPUP: + break; + case WM_NOTIFY: + default: + break; + } + return DefWindowProc(hwnd, msg, wParam, lParam); } void RingThread(char *szSkypeMsg) { MCONTACT hContact; - DBEVENTINFO dbei={0}; + DBEVENTINFO dbei = { 0 }; DBVARIANT dbv; char *ptr = NULL; @@ -1489,37 +1495,32 @@ void RingThread(char *szSkypeMsg) { // skype doesnt accept status-changes for finished calls. The CriticalSection syncronizes // the threads and the messages are processed in correct order. // Not the best solution, but it works. - EnterCriticalSection (&RingAndEndcallMutex); + EnterCriticalSection(&RingAndEndcallMutex); - LOG(("RingThread started.")); - if (protocol >= 5) SkypeSend ("MINIMIZE"); - if (hContact=GetCallerContact(szSkypeMsg)) { + LOG(("RingThread started.")); + if (protocol >= 5) SkypeSend("MINIMIZE"); + if (hContact = GetCallerContact(szSkypeMsg)) { // Make sure that an answering thread is not already in progress so that we don't get // the 'Incoming call' event twice if (!db_get_s(hContact, SKYPE_PROTONAME, "CallId", &dbv)) { db_free(&dbv); - LOG(("RingThread terminated.")); + LOG(("RingThread terminated.")); goto l_exitRT; } db_set_s(hContact, SKYPE_PROTONAME, "CallId", szSkypeMsg); } - - if (!(ptr=SkypeGet(szSkypeMsg, "TYPE", ""))) { - LOG(("RingThread terminated.")); + + if (!(ptr = SkypeGet(szSkypeMsg, "TYPE", ""))) { + LOG(("RingThread terminated.")); goto l_exitRT;; } - if (!strncmp(ptr, "INCOMING", 8)) - NofifyVoiceService(hContact, szSkypeMsg, VOICE_STATE_RINGING); - else - NofifyVoiceService(hContact, szSkypeMsg, VOICE_STATE_CALLING); - if (!strncmp(ptr, "INCOMING", 8)) { if (!hContact) { char *szHandle; - - if (szHandle=GetCallerHandle(szSkypeMsg)) { - if (!(hContact=add_contact(szHandle, PALF_TEMPORARY))) { + + if (szHandle = GetCallerHandle(szSkypeMsg)) { + if (!(hContact = add_contact(szHandle, PALF_TEMPORARY))) { free(szHandle); goto l_exitRT; } @@ -1527,33 +1528,29 @@ void RingThread(char *szSkypeMsg) { db_set_w(hContact, SKYPE_PROTONAME, "Status", (WORD)SkypeStatusToMiranda("SKYPEOUT")); db_set_s(hContact, SKYPE_PROTONAME, "SkypeOutNr", szHandle); free(szHandle); - } else goto l_exitRT; + } + else goto l_exitRT; } } - if (HasVoiceService()) { - // Voice service will handle it - goto l_exitRT; - } - - dbei.cbSize=sizeof(dbei); - dbei.eventType=EVENTTYPE_CALL; - dbei.szModule=SKYPE_PROTONAME; - dbei.timestamp=(DWORD)SkypeTime(NULL); - dbei.pBlob=(unsigned char*)Translate("Phone call"); - dbei.cbBlob=strlen((const char*)dbei.pBlob)+1; - if (!strncmp(ptr, "INCOMING", 8)) + dbei.cbSize = sizeof(dbei); + dbei.eventType = EVENTTYPE_CALL; + dbei.szModule = SKYPE_PROTONAME; + dbei.timestamp = (DWORD)SkypeTime(NULL); + dbei.pBlob = (unsigned char*)Translate("Phone call"); + dbei.cbBlob = strlen((const char*)dbei.pBlob) + 1; + if (!strncmp(ptr, "INCOMING", 8)) { - CLISTEVENT cle={0}; + CLISTEVENT cle = { 0 }; char toolTip[256]; - if(PopupServiceExists) + if (PopupServiceExists) { BOOL showPopup, popupWindowColor; unsigned int popupBackColor, popupTextColor; int popupTimeSec; POPUPDATAT InCallPopup; - TCHAR * lpzContactName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,hContact,GCDNF_TCHAR); + TCHAR * lpzContactName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR); popupTimeSec = db_get_dw(NULL, SKYPE_PROTONAME, "popupTimeSec", 4); popupTextColor = db_get_dw(NULL, SKYPE_PROTONAME, "popupTextColor", GetSysColor(COLOR_WINDOWTEXT)); @@ -1562,47 +1559,47 @@ void RingThread(char *szSkypeMsg) { showPopup = (0 != db_get_b(NULL, SKYPE_PROTONAME, "showPopup", TRUE)); InCallPopup.lchContact = hContact; - InCallPopup.lchIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_CALL)); - InCallPopup.colorBack = ! popupWindowColor ? popupBackColor : GetSysColor(COLOR_BTNFACE); - InCallPopup.colorText = ! popupWindowColor ? popupTextColor : GetSysColor(COLOR_WINDOWTEXT); + InCallPopup.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CALL)); + InCallPopup.colorBack = !popupWindowColor ? popupBackColor : GetSysColor(COLOR_BTNFACE); + InCallPopup.colorText = !popupWindowColor ? popupTextColor : GetSysColor(COLOR_WINDOWTEXT); InCallPopup.iSeconds = popupTimeSec; InCallPopup.PluginWindowProc = (WNDPROC)InCallPopUpProc; InCallPopup.PluginData = (void *)1; - + lstrcpy(InCallPopup.lptzText, TranslateT("Incoming Skype Call")); lstrcpy(InCallPopup.lptzContactName, lpzContactName); - if(showPopup) - CallService(MS_POPUP_ADDPOPUPT,(WPARAM)&InCallPopup,0); + if (showPopup) + CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&InCallPopup, 0); } - cle.cbSize=sizeof(cle); - cle.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_CALL)); - cle.pszService=SKYPE_ANSWERCALL; - dbei.flags=DBEF_READ; - cle.hContact=hContact; - cle.hDbEvent=db_event_add(hContact, &dbei); - _snprintf(toolTip,sizeof(toolTip),Translate("Incoming call from %s"),(char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,hContact,0)); - cle.pszTooltip=toolTip; - CallServiceSync(MS_CLIST_ADDEVENT,0,(LPARAM)&cle); - } - else + cle.cbSize = sizeof(cle); + cle.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CALL)); + cle.pszService = SKYPE_ANSWERCALL; + dbei.flags = DBEF_READ; + cle.hContact = hContact; + cle.hDbEvent = db_event_add(hContact, &dbei); + _snprintf(toolTip, sizeof(toolTip), Translate("Incoming call from %s"), (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, 0)); + cle.pszTooltip = toolTip; + CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); + } + else { - dbei.flags=DBEF_SENT; + dbei.flags = DBEF_SENT; db_event_add(hContact, &dbei); } l_exitRT: - if (ptr) free (ptr); + if (ptr) free(ptr); free(szSkypeMsg); - LeaveCriticalSection (&RingAndEndcallMutex); + LeaveCriticalSection(&RingAndEndcallMutex); } void EndCallThread(char *szSkypeMsg) { - MCONTACT hContact=NULL; + MCONTACT hContact = NULL; HANDLE hDbEvent; - DBEVENTINFO dbei={0}; + DBEVENTINFO dbei = { 0 }; DBVARIANT dbv; int tCompareResult; @@ -1618,11 +1615,11 @@ void EndCallThread(char *szSkypeMsg) { // skype doesnt accept status-changes for finished calls. The CriticalSection syncronizes // the threads and the messages are processed in correct order. // Not the best solution, but it works. - EnterCriticalSection (&RingAndEndcallMutex); + EnterCriticalSection(&RingAndEndcallMutex); - LOG(("EndCallThread started.")); + LOG(("EndCallThread started.")); if (szSkypeMsg) { - for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) { + for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { if (db_get_s(hContact, SKYPE_PROTONAME, "CallId", &dbv)) continue; tCompareResult = strcmp(dbv.pszVal, szSkypeMsg); db_free(&dbv); @@ -1631,48 +1628,43 @@ void EndCallThread(char *szSkypeMsg) { } if (hContact) { - NofifyVoiceService(hContact, szSkypeMsg, VOICE_STATE_ENDED); - db_unset(hContact, SKYPE_PROTONAME, "CallId"); - if (!HasVoiceService()) { - dbei.cbSize=sizeof(dbei); - hDbEvent = db_event_firstUnread(hContact); - while(hDbEvent) { - dbei.cbBlob=0; - db_event_get(hDbEvent, &dbei); - if (!(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType==EVENTTYPE_CALL) { - db_event_markRead(hContact,hDbEvent); - CallService(MS_CLIST_REMOVEEVENT,hContact,(LPARAM)hDbEvent); - } - free(dbei.pBlob); - hDbEvent=db_event_next(hContact, hDbEvent); + dbei.cbSize = sizeof(dbei); + hDbEvent = db_event_firstUnread(hContact); + while (hDbEvent) { + dbei.cbBlob = 0; + db_event_get(hDbEvent, &dbei); + if (!(dbei.flags&(DBEF_SENT | DBEF_READ)) && dbei.eventType == EVENTTYPE_CALL) { + db_event_markRead(hContact, hDbEvent); + CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)hDbEvent); } + free(dbei.pBlob); + hDbEvent = db_event_next(hContact, hDbEvent); } if (!db_get_s(hContact, SKYPE_PROTONAME, "SkypeOutNr", &dbv)) { db_free(&dbv); - if (!strcmp((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0), SKYPE_PROTONAME) && + if (!strcmp((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0), SKYPE_PROTONAME) && db_get_b(hContact, "CList", "NotOnList", 0) - ) - CallService(MS_DB_CONTACT_DELETE, hContact, 0); + ) + CallService(MS_DB_CONTACT_DELETE, hContact, 0); } } free(szSkypeMsg); - LeaveCriticalSection (&RingAndEndcallMutex); + LeaveCriticalSection(&RingAndEndcallMutex); } void HoldCallThread(char *szSkypeMsg) { MCONTACT hContact; LOG(("HoldCallThread started")); - if (!szSkypeMsg) { + if (!szSkypeMsg) { LOG(("HoldCallThread terminated.")); return; } - if (hContact=GetCallerContact(szSkypeMsg)) { + if (hContact = GetCallerContact(szSkypeMsg)) { db_set_b(hContact, SKYPE_PROTONAME, "OnHold", 1); - NofifyVoiceService(hContact, szSkypeMsg, VOICE_STATE_ON_HOLD); } free(szSkypeMsg); LOG(("HoldCallThread terminated gracefully")); @@ -1686,117 +1678,117 @@ void ResumeCallThread(char *szSkypeMsg) { LOG(("ResumeCallThread terminated.")); return; } - if (hContact=GetCallerContact(szSkypeMsg)) { + if (hContact = GetCallerContact(szSkypeMsg)) { db_unset(hContact, SKYPE_PROTONAME, "OnHold"); - NofifyVoiceService(hContact, szSkypeMsg, VOICE_STATE_TALKING); } free(szSkypeMsg); - LOG(("ResumeCallThread terminated gracefully.")); + LOG(("ResumeCallThread terminated gracefully.")); } int SetUserStatus(void) { - if (RequestedStatus && AttachStatus!=-1) { - if (SkypeSend("SET USERSTATUS %s", RequestedStatus)==-1) return 1; - } - return 0; + if (RequestedStatus && AttachStatus != -1) { + if (SkypeSend("SET USERSTATUS %s", RequestedStatus) == -1) return 1; + } + return 0; } void LaunchSkypeAndSetStatusThread(void *newStatus) { -/* if (!db_get_b(NULL, SKYPE_PROTONAME, "UnloadOnOffline", 0)) { - logoff_contacts(); - return 1; - } -*/ - int oldStatus=SkypeStatus; + /* if (!db_get_b(NULL, SKYPE_PROTONAME, "UnloadOnOffline", 0)) { + logoff_contacts(); + return 1; + } + */ + int oldStatus = SkypeStatus; static BOOL bLaunching = FALSE; UNREFERENCED_PARAMETER(newStatus); if (bLaunching) return; bLaunching = TRUE; - LOG (("LaunchSkypeAndSetStatusThread started.")); + LOG(("LaunchSkypeAndSetStatusThread started.")); InterlockedExchange((long *)&SkypeStatus, (int)ID_STATUS_CONNECTING); - ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, SkypeStatus); - - if (ConnectToSkypeAPI(skype_path, 1)!=-1) { - pthread_create(( pThreadFunc )SkypeSystemInit, NULL); + ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, SkypeStatus); + + if (ConnectToSkypeAPI(skype_path, 1) != -1) { + pthread_create((pThreadFunc)SkypeSystemInit, NULL); //InterlockedExchange((long *)&SkypeStatus, (int)newStatus); //ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, SkypeStatus); SetUserStatus(); } - LOG (("LaunchSkypeAndSetStatusThread terminated gracefully.")); + LOG(("LaunchSkypeAndSetStatusThread terminated gracefully.")); bLaunching = FALSE; } -LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) -{ - PCOPYDATASTRUCT CopyData; - char *ptr, *szSkypeMsg=NULL, *nick, *buf; - static char *onlinestatus=NULL; - static BOOL RestoreUserStatus=FALSE; +LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) +{ + PCOPYDATASTRUCT CopyData; + char *ptr, *szSkypeMsg = NULL, *nick, *buf; + static char *onlinestatus = NULL; + static BOOL RestoreUserStatus = FALSE; int sstat, oldstatus, flag; MCONTACT hContact; fetchmsg_arg *args; static int iReentranceCnt = 0; iReentranceCnt++; - switch (message) - { - case WM_COPYDATA: - LOG(("WM_COPYDATA start")); - if(hSkypeWnd==(HWND)wParam) { + switch (message) + { + case WM_COPYDATA: + LOG(("WM_COPYDATA start")); + if (hSkypeWnd == (HWND)wParam) { char *pData; - CopyData=(PCOPYDATASTRUCT)lParam; + CopyData = (PCOPYDATASTRUCT)lParam; pData = (char*)CopyData->lpData; - while (*pData==' ') pData++; - szSkypeMsg=_strdup((char*)pData); + while (*pData == ' ') pData++; + szSkypeMsg = _strdup((char*)pData); ReplyMessage(1); LOG(("< %s", szSkypeMsg)); - if (!strncmp(szSkypeMsg, "CONNSTATUS", 10)) { - if (!strncmp(szSkypeMsg+11, "LOGGEDOUT", 9)) { - SkypeInitialized=FALSE; + if (!strncmp(szSkypeMsg, "CONNSTATUS", 10)) { + if (!strncmp(szSkypeMsg + 11, "LOGGEDOUT", 9)) { + SkypeInitialized = FALSE; ResetEvent(SkypeReady); - AttachStatus=-1; - sstat=ID_STATUS_OFFLINE; - if (g_hWnd) KillTimer (g_hWnd, 1); + AttachStatus = -1; + sstat = ID_STATUS_OFFLINE; + if (g_hWnd) KillTimer(g_hWnd, 1); logoff_contacts(TRUE); - } else - sstat=SkypeStatusToMiranda(szSkypeMsg+11); + } + else + sstat = SkypeStatusToMiranda(szSkypeMsg + 11); if (sstat) { - oldstatus=SkypeStatus; + oldstatus = SkypeStatus; InterlockedExchange((long*)&SkypeStatus, sstat); - ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldstatus, SkypeStatus); - if (sstat!=ID_STATUS_OFFLINE) { - if (sstat!=ID_STATUS_CONNECTING && (oldstatus==ID_STATUS_OFFLINE || oldstatus==ID_STATUS_CONNECTING)) { + ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldstatus, SkypeStatus); + if (sstat != ID_STATUS_OFFLINE) { + if (sstat != ID_STATUS_CONNECTING && (oldstatus == ID_STATUS_OFFLINE || oldstatus == ID_STATUS_CONNECTING)) { - SkypeInitialized=FALSE; - pthread_create(( pThreadFunc )SkypeSystemInit, NULL); + SkypeInitialized = FALSE; + pthread_create((pThreadFunc)SkypeSystemInit, NULL); } - if (db_get_b(NULL, SKYPE_PROTONAME, "KeepState", 0)) RestoreUserStatus=TRUE; + if (db_get_b(NULL, SKYPE_PROTONAME, "KeepState", 0)) RestoreUserStatus = TRUE; } -// if (SkypeStatus==ID_STATUS_ONLINE) SkypeSend("SEARCH MISSEDMESSAGES"); + // if (SkypeStatus==ID_STATUS_ONLINE) SkypeSend("SEARCH MISSEDMESSAGES"); } -// break; + // break; } if (!strncmp(szSkypeMsg, "USERSTATUS", 10)) { -// if ((sstat=SkypeStatusToMiranda(szSkypeMsg+11)) && SkypeStatus!=ID_STATUS_CONNECTING) { - if ((sstat=SkypeStatusToMiranda(szSkypeMsg+11))) { - if (RestoreUserStatus && RequestedStatus) { - RestoreUserStatus=FALSE; - SkypeSend ("SET USERSTATUS %s", RequestedStatus); - } - oldstatus=SkypeStatus; - InterlockedExchange((long*)&SkypeStatus, sstat); - ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldstatus, sstat); + // if ((sstat=SkypeStatusToMiranda(szSkypeMsg+11)) && SkypeStatus!=ID_STATUS_CONNECTING) { + if ((sstat = SkypeStatusToMiranda(szSkypeMsg + 11))) { + if (RestoreUserStatus && RequestedStatus) { + RestoreUserStatus = FALSE; + SkypeSend("SET USERSTATUS %s", RequestedStatus); + } + oldstatus = SkypeStatus; + InterlockedExchange((long*)&SkypeStatus, sstat); + ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldstatus, sstat); #ifdef SKYPEBUG_OFFLN - if ((oldstatus==ID_STATUS_OFFLINE || oldstatus==ID_STATUS_CONNECTING) && - SkypeStatus!=ID_STATUS_CONNECTING && SkypeStatus!=ID_STATUS_OFFLINE) - pthread_create(( pThreadFunc )SearchFriendsThread, NULL); + if ((oldstatus == ID_STATUS_OFFLINE || oldstatus == ID_STATUS_CONNECTING) && + SkypeStatus != ID_STATUS_CONNECTING && SkypeStatus != ID_STATUS_OFFLINE) + pthread_create((pThreadFunc)SearchFriendsThread, NULL); #endif } #ifdef SKYPEBUG_OFFLN @@ -1807,35 +1799,35 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) if (!strncmp(szSkypeMsg, "APPLICATION libpurple_typing", 28)) { char *nextoken, *p; - if (p=strtok_r(szSkypeMsg+29, " ", &nextoken)) + if (p = strtok_r(szSkypeMsg + 29, " ", &nextoken)) { - if (!strcmp (p, "STREAMS")) { + if (!strcmp(p, "STREAMS")) { char *pStr; - while (p=strtok_r(NULL, " ", &nextoken)) { + while (p = strtok_r(NULL, " ", &nextoken)) { if (pStr = strchr(p, ':')) { - *pStr=0; - if (hContact=find_contact(p)) { - *pStr=':'; + *pStr = 0; + if (hContact = find_contact(p)) { + *pStr = ':'; db_set_s(hContact, SKYPE_PROTONAME, "Typing_Stream", p); } } } } - else if (!strcmp (p, "DATAGRAM")) { - if (p=strtok_r(NULL, " ", &nextoken)) { + else if (!strcmp(p, "DATAGRAM")) { + if (p = strtok_r(NULL, " ", &nextoken)) { char *pStr; if (pStr = strchr(p, ':')) { - *pStr=0; - if (hContact=find_contact(p)) { - *pStr=':'; + *pStr = 0; + if (hContact = find_contact(p)) { + *pStr = ':'; db_set_s(hContact, SKYPE_PROTONAME, "Typing_Stream", p); - if (p=strtok_r(NULL, " ", &nextoken)) { + if (p = strtok_r(NULL, " ", &nextoken)) { LPARAM lTyping = PROTOTYPE_CONTACTTYPING_OFF; - if (!strcmp(p, "PURPLE_TYPING")) lTyping=PROTOTYPE_CONTACTTYPING_INFINITE; + if (!strcmp(p, "PURPLE_TYPING")) lTyping = PROTOTYPE_CONTACTTYPING_INFINITE; CallService(MS_PROTO_CONTACTISTYPING, hContact, lTyping); break; } @@ -1848,28 +1840,28 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) if (!strncmp(szSkypeMsg, "USER ", 5)) { char *nextoken; - buf=_strdup(szSkypeMsg+5); - nick=strtok_r(buf, " ", &nextoken); - ptr=strtok_r(NULL, " ", &nextoken); + buf = _strdup(szSkypeMsg + 5); + nick = strtok_r(buf, " ", &nextoken); + ptr = strtok_r(NULL, " ", &nextoken); if (strcmp(ptr, "BUDDYSTATUS")) { if (!strcmp(ptr, "RECEIVEDAUTHREQUEST")) { - pthread_create(( pThreadFunc )SearchUsersWaitingMyAuthorization, NULL); - free (buf); + pthread_create((pThreadFunc)SearchUsersWaitingMyAuthorization, NULL); + free(buf); break; } - if (!(hContact=find_contact(nick)) && strcmp(ptr, "FULLNAME")) { + if (!(hContact = find_contact(nick)) && strcmp(ptr, "FULLNAME")) { SkypeSend("GET USER %s BUDDYSTATUS", nick); - free (buf); + free(buf); break; - } + } if (!strcmp(ptr, "ONLINESTATUS")) { - if (SkypeStatus!=ID_STATUS_OFFLINE) + if (SkypeStatus != ID_STATUS_OFFLINE) { - db_set_w(hContact, SKYPE_PROTONAME, "Status", (WORD)SkypeStatusToMiranda(ptr+13)); - if((WORD)SkypeStatusToMiranda(ptr+13) != ID_STATUS_OFFLINE) + db_set_w(hContact, SKYPE_PROTONAME, "Status", (WORD)SkypeStatusToMiranda(ptr + 13)); + if ((WORD)SkypeStatusToMiranda(ptr + 13) != ID_STATUS_OFFLINE) { LOG(("WndProc Status is not offline so get user info")); pthread_create(GetInfoThread, (void*)hContact); @@ -1891,7 +1883,7 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) * If we don't remove the ERRORs from the list, another consumer may see the ERROR * as a reply to his query and process it. * In case the SKYPE Protocol really broadcasts one of these messages without being - * requested by GetInfoThread (i.e. MOOD_TEXT), the garbage collector will take + * requested by GetInfoThread (i.e. MOOD_TEXT), the garbage collector will take * care of them and remove them after some time. * This may not be the most efficient way, but ensures that we finally do proper * error handling. @@ -1902,56 +1894,64 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) if (nm = strtok_r(NULL, " ", &nextoken)) { db_set_utf(hContact, SKYPE_PROTONAME, "FirstName", nm); - if (!(nm=strtok_r(NULL, "", &nextoken))) db_unset(hContact, SKYPE_PROTONAME, "LastName"); - else + if (!(nm = strtok_r(NULL, "", &nextoken))) db_unset(hContact, SKYPE_PROTONAME, "LastName"); + else db_set_utf(hContact, SKYPE_PROTONAME, "LastName", nm); } - } else - if (!strcmp(ptr, "BIRTHDAY")) { + } + else + if (!strcmp(ptr, "BIRTHDAY")) { unsigned int y, m, d; - if (sscanf(ptr+9, "%04d%02d%02d", &y, &m, &d)==3) { + if (sscanf(ptr + 9, "%04d%02d%02d", &y, &m, &d) == 3) { db_set_w(hContact, SKYPE_PROTONAME, "BirthYear", (WORD)y); db_set_b(hContact, SKYPE_PROTONAME, "BirthMonth", (BYTE)m); db_set_b(hContact, SKYPE_PROTONAME, "BirthDay", (BYTE)d); - } else { + } + else { db_unset(hContact, SKYPE_PROTONAME, "BirthYear"); db_unset(hContact, SKYPE_PROTONAME, "BirthMonth"); db_unset(hContact, SKYPE_PROTONAME, "BirthDay"); } - } else - if (!strcmp(ptr, "COUNTRY")) { + } + else + if (!strcmp(ptr, "COUNTRY")) { if (ptr[8]) { struct CountryListEntry *countries; int countryCount, i; CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&countryCount, (LPARAM)&countries); - for (i=0; i= 86400 )?(256-((2*(atoi(ptr+9)-86400))/3600)):((-2*(atoi(ptr+9)-86400))/3600); - if (tms.tm_isdst == 1 && db_get_b(NULL, SKYPE_PROTONAME, "UseTimeZonePatch", 0)) + tz = (value >= 86400) ? (256 - ((2 * (atoi(ptr + 9) - 86400)) / 3600)) : ((-2 * (atoi(ptr + 9) - 86400)) / 3600); + if (tms.tm_isdst == 1 && db_get_b(NULL, SKYPE_PROTONAME, "UseTimeZonePatch", 0)) { LOG(("WndProc: Using the TimeZonePatch")); - db_set_b(hContact, "UserInfo", "Timezone", (BYTE)(tz+2)); + db_set_b(hContact, "UserInfo", "Timezone", (BYTE)(tz + 2)); } else { LOG(("WndProc: Not using the TimeZonePatch")); - db_set_b(hContact, "UserInfo", "Timezone", (BYTE)(tz+0)); + db_set_b(hContact, "UserInfo", "Timezone", (BYTE)(tz + 0)); } - } else { + } + else { LOG(("WndProc: Deleting the TimeZone in UserInfo Section")); db_unset(hContact, "UserInfo", "Timezone"); } - } else - if (!strcmp(ptr, "IS_VIDEO_CAPABLE")){ + } + else + if (!strcmp(ptr, "IS_VIDEO_CAPABLE")){ if (!_stricmp(ptr + 17, "True")) db_set_s(hContact, SKYPE_PROTONAME, "MirVer", "Skype 2.0"); else db_set_s(hContact, SKYPE_PROTONAME, "MirVer", "Skype"); - } else - if (!strcmp(ptr, "RICH_MOOD_TEXT")) { + } + else + if (!strcmp(ptr, "RICH_MOOD_TEXT")) { db_set_s(hContact, SKYPE_PROTONAME, "MirVer", "Skype 3.0"); - } else - if (!strcmp(ptr, "DISPLAYNAME")) { + } + else + if (!strcmp(ptr, "DISPLAYNAME")) { // Skype Bug? -> If nickname isn't customised in the Skype-App, this won't return anything :-( - if (ptr[12]) - db_set_utf(hContact, SKYPE_PROTONAME, "Nick", ptr+12); - } else // Other proerties that can be directly assigned to a DB-Value - { - int i; - char *pszProp; - - for (i=0; itEdited = atol(ptr+18); + pEntry->tEdited = atol(ptr + 18); } bFetchMsg = TRUE; - } else bFetchMsg = (strncmp(ptr, " STATUS RE", 10) == 0 && !rcvwatchers) || + } + else bFetchMsg = (strncmp(ptr, " STATUS RE", 10) == 0 && !rcvwatchers) || (strncmp(ptr, " STATUS SENT", 12) == 0 && !sendwatchers); if (bFetchMsg) { // If new message is available, fetch it - ptr[0]=0; - if (!(args=(fetchmsg_arg *)calloc(1, sizeof(*args)))) break; - strncpy (args->msgnum, pMsgNum, sizeof(args->msgnum)); - args->getstatus=FALSE; + ptr[0] = 0; + if (!(args = (fetchmsg_arg *)calloc(1, sizeof(*args)))) break; + strncpy(args->msgnum, pMsgNum, sizeof(args->msgnum)); + args->getstatus = FALSE; //args->bIsRead = strncmp(ptr+8, "READ", 4) == 0; - pthread_create(( pThreadFunc )FetchMessageThreadSync, args); + pthread_create((pThreadFunc)FetchMessageThreadSync, args); break; } } @@ -2167,14 +2178,14 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) break; } if (!strncmp(szSkypeMsg, "PROTOCOL ", 9)) { - if ((protocol=(char)atoi(szSkypeMsg+9))>=3) { + if ((protocol = (char)atoi(szSkypeMsg + 9)) >= 3) { strcpy(cmdMessage, "CHATMESSAGE"); strcpy(cmdPartner, "FROM"); } bProtocolSet = TRUE; - if (protocol<5 && !hMenuAddSkypeContact && - db_get_b(NULL, SKYPE_PROTONAME, "EnableMenu", 1)) + if (protocol < 5 && !hMenuAddSkypeContact && + db_get_b(NULL, SKYPE_PROTONAME, "EnableMenu", 1)) { hMenuAddSkypeContact = add_mainmenu(); } @@ -2183,72 +2194,72 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) SkypeMsgAdd(szSkypeMsg); ReleaseSemaphore(SkypeMsgReceived, receivers, NULL); } - break; - - case WM_TIMER: - if (iReentranceCnt>1) break; - if (!bIsImoproxy) SkypeSend("PING"); - SkypeMsgCollectGarbage(MAX_MSG_AGE); - MsgList_CollectGarbage(); - if (receivers>1) + break; + + case WM_TIMER: + if (iReentranceCnt > 1) break; + if (!bIsImoproxy) SkypeSend("PING"); + SkypeMsgCollectGarbage(MAX_MSG_AGE); + MsgList_CollectGarbage(); + if (receivers > 1) + { + LOG(("Watchdog WARNING: there are still %d receivers waiting for MSGs", receivers)); + } + break; + + case WM_CLOSE: + PostQuitMessage(0); + break; + case WM_DESTROY: + KillTimer(hWndDlg, 1); + break; + case WM_COPYDATALOCAL: + return WndProc(hWndDlg, WM_COPYDATA, wParam, lParam); + + default: + if (message == ControlAPIAttach) { + // Skype responds with Attach to the discover-message + if ((HWND)wParam == hForbiddenSkypeWnd) { + ResetEvent(SkypeReady); + break; + } + AttachStatus = lParam; + if (lParam == SKYPECONTROLAPI_ATTACH_SUCCESS) { + LOG(("AttachStatus success, got hWnd %08X", (HWND)wParam)); + + if (hSkypeWnd && (HWND)wParam != hSkypeWnd && IsWindow(hSkypeWnd)) + hSkypeWndSecondary = (HWND)wParam; + else { + hSkypeWnd = (HWND)wParam; // Skype gave us the communication window handle + hSkypeWndSecondary = NULL; + } + } + if (AttachStatus != SKYPECONTROLAPI_ATTACH_API_AVAILABLE && + AttachStatus != SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE) { - LOG(("Watchdog WARNING: there are still %d receivers waiting for MSGs", receivers)); + LOG(("Attaching: SkypeReady fired, Attachstatus is %d", AttachStatus)); + SetEvent(SkypeReady); } + AttachStatus = lParam; break; - - case WM_CLOSE: - PostQuitMessage (0); - break; - case WM_DESTROY: - KillTimer (hWndDlg, 1); - break; - case WM_COPYDATALOCAL: - return WndProc (hWndDlg, WM_COPYDATA, wParam, lParam); - - default: - if(message==ControlAPIAttach) { - // Skype responds with Attach to the discover-message - if ((HWND)wParam == hForbiddenSkypeWnd) { - ResetEvent(SkypeReady); - break; - } - AttachStatus=lParam; - if (lParam==SKYPECONTROLAPI_ATTACH_SUCCESS) { - LOG (("AttachStatus success, got hWnd %08X", (HWND)wParam)); - - if (hSkypeWnd && (HWND)wParam!=hSkypeWnd && IsWindow(hSkypeWnd)) - hSkypeWndSecondary = (HWND)wParam; - else { - hSkypeWnd=(HWND)wParam; // Skype gave us the communication window handle - hSkypeWndSecondary = NULL; - } - } - if (AttachStatus!=SKYPECONTROLAPI_ATTACH_API_AVAILABLE && - AttachStatus!=SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE) - { - LOG(("Attaching: SkypeReady fired, Attachstatus is %d", AttachStatus)); - SetEvent(SkypeReady); - } - AttachStatus=lParam; - break; - } - --iReentranceCnt; - return DefWindowProc(hWndDlg, message, wParam, lParam); - } + } + --iReentranceCnt; + return DefWindowProc(hWndDlg, message, wParam, lParam); + } LOG(("WM_COPYDATA exit (%08X)", message)); if (szSkypeMsg) free(szSkypeMsg); --iReentranceCnt; return 1; -} +} void TellError(DWORD err) { LPVOID lpMsgBuf; - - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); - MessageBox( NULL, (TCHAR*)lpMsgBuf, _T("GetLastError"), MB_OK|MB_ICONINFORMATION ); - LocalFree( lpMsgBuf ); - return; + + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL); + MessageBox(NULL, (TCHAR*)lpMsgBuf, _T("GetLastError"), MB_OK | MB_ICONINFORMATION); + LocalFree(lpMsgBuf); + return; } @@ -2261,88 +2272,89 @@ INT_PTR SkypeSetStatus(WPARAM wParam, LPARAM lParam) UNREFERENCED_PARAMETER(lParam); if (MirandaShuttingDown) return 0; - LOG (("SkypeSetStatus enter")); + LOG(("SkypeSetStatus enter")); UseCustomCommand = db_get_b(NULL, SKYPE_PROTONAME, "UseCustomCommand", 0); UnloadOnOffline = db_get_b(NULL, SKYPE_PROTONAME, "UnloadOnOffline", 0); //if (!SkypeInitialized && !db_get_b(NULL, SKYPE_PROTONAME, "UnloadOnOffline", 0)) return 0; // Workaround for Skype status-bug - if ((int)wParam==ID_STATUS_OFFLINE) logoff_contacts(TRUE); - if (SkypeStatus==(int)wParam) return 0; + if ((int)wParam == ID_STATUS_OFFLINE) logoff_contacts(TRUE); + if (SkypeStatus == (int)wParam) return 0; oldStatus = SkypeStatus; - if ((int)wParam==ID_STATUS_CONNECTING) return 0; + if ((int)wParam == ID_STATUS_CONNECTING) return 0; #ifdef MAPDND - if ((int)wParam==ID_STATUS_OCCUPIED || (int)wParam==ID_STATUS_ONTHEPHONE) wParam=ID_STATUS_DND; - if ((int)wParam==ID_STATUS_OUTTOLUNCH) wParam=ID_STATUS_NA; + if ((int)wParam == ID_STATUS_OCCUPIED || (int)wParam == ID_STATUS_ONTHEPHONE) wParam = ID_STATUS_DND; + if ((int)wParam == ID_STATUS_OUTTOLUNCH) wParam = ID_STATUS_NA; #endif #ifdef MAPNA if ((int)wParam==ID_STATUS_NA) wParam = ID_STATUS_AWAY; #endif - RequestedStatus=MirandaStatusToSkype((int)wParam); - - /* - if (SkypeStatus != ID_STATUS_OFFLINE) - { - InterlockedExchange((long*)&SkypeStatus, (int)wParam); - ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, SkypeStatus); - } - */ - - if ((int)wParam==ID_STATUS_OFFLINE && UnloadOnOffline) - { - if(UseCustomCommand) - { - DBVARIANT dbv; - if(!db_get_s(NULL,SKYPE_PROTONAME,"CommandLine",&dbv)) - { - CloseSkypeAPI(dbv.pszVal); - db_free(&dbv); - } - } - else + RequestedStatus = MirandaStatusToSkype((int)wParam); + + /* + if (SkypeStatus != ID_STATUS_OFFLINE) + { + InterlockedExchange((long*)&SkypeStatus, (int)wParam); + ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, SkypeStatus); + } + */ + + if ((int)wParam == ID_STATUS_OFFLINE && UnloadOnOffline) + { + if (UseCustomCommand) + { + DBVARIANT dbv; + if (!db_get_s(NULL, SKYPE_PROTONAME, "CommandLine", &dbv)) { - CloseSkypeAPI(skype_path); + CloseSkypeAPI(dbv.pszVal); + db_free(&dbv); } + } + else + { + CloseSkypeAPI(skype_path); + } - } else if (AttachStatus==-1) - { - pthread_create(LaunchSkypeAndSetStatusThread, (void *)wParam); - return 0; - } + } + else if (AttachStatus == -1) + { + pthread_create(LaunchSkypeAndSetStatusThread, (void *)wParam); + return 0; + } - iRet = SetUserStatus(); - LOG (("SkypeSetStatus exit")); - return iRet; + iRet = SetUserStatus(); + LOG(("SkypeSetStatus exit")); + return iRet; } int __stdcall SendBroadcast(MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam) { - ACKDATA ack = { sizeof( ACKDATA ) }; + ACKDATA ack = { sizeof(ACKDATA) }; ack.szModule = SKYPE_PROTONAME; ack.hContact = hContact; ack.type = type; ack.result = result; ack.hProcess = hProcess; ack.lParam = lParam; - return CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)&ack ); + return CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)&ack); } static void __cdecl SkypeGetAwayMessageThread(void *hContact) { DBVARIANT dbv; - if (!db_get_ts((MCONTACT)hContact, "CList", "StatusMsg", &dbv )) { - SendBroadcast((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )dbv.ptszVal ); - db_free( &dbv ); + if (!db_get_ts((MCONTACT)hContact, "CList", "StatusMsg", &dbv)) { + SendBroadcast((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal); + db_free(&dbv); } - else SendBroadcast((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )0 ); + else SendBroadcast((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)0); } -INT_PTR SkypeGetAwayMessage(WPARAM wParam,LPARAM lParam) +INT_PTR SkypeGetAwayMessage(WPARAM wParam, LPARAM lParam) { - CCSDATA* ccs = ( CCSDATA* )lParam; + CCSDATA* ccs = (CCSDATA*)lParam; UNREFERENCED_PARAMETER(wParam); @@ -2356,12 +2368,12 @@ INT_PTR SkypeGetAwayMessage(WPARAM wParam,LPARAM lParam) static int GetFileHash(char* filename) { - HANDLE hFile = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); + HANDLE hFile = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); int remainder = 0, byte, bit; char data[1024]; DWORD dwRead; - if(hFile == INVALID_HANDLE_VALUE) return 0; + if (hFile == INVALID_HANDLE_VALUE) return 0; do { @@ -2370,11 +2382,11 @@ static int GetFileHash(char* filename) ReadFile(hFile, data, 1024, &dwRead, NULL); /* loop through each byte of data */ - for (byte = 0; byte < (int) dwRead; ++byte) { + for (byte = 0; byte < (int)dwRead; ++byte) { /* store the next byte into the remainder */ remainder ^= (data[byte] << (WIDTH - 8)); /* calculate for all 8 bits in the byte */ - for ( bit = 8; bit > 0; --bit) { + for (bit = 8; bit > 0; --bit) { /* check if MSB of remainder is a one */ if (remainder & TOPBIT) remainder = (remainder << 1) ^ POLYNOMIAL; @@ -2382,7 +2394,7 @@ static int GetFileHash(char* filename) remainder = (remainder << 1); } } - } while(dwRead == 1024); + } while (dwRead == 1024); CloseHandle(hFile); @@ -2391,10 +2403,10 @@ static int GetFileHash(char* filename) static int _GetFileSize(char* filename) { - HANDLE hFile = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); + HANDLE hFile = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); int size; - if(hFile == INVALID_HANDLE_VALUE) + if (hFile == INVALID_HANDLE_VALUE) return 0; size = GetFileSize(hFile, NULL); CloseHandle(hFile); @@ -2402,42 +2414,42 @@ static int _GetFileSize(char* filename) } /* RetrieveUserAvatar - * + * * Purpose: Get a user avatar from skype itself * Params : param=(void *)(HANDLE)hContact */ void RetrieveUserAvatar(void *param) { - MCONTACT hContact = (MCONTACT) param; + MCONTACT hContact = (MCONTACT)param; HANDLE file; - PROTO_AVATAR_INFORMATION AI={0}; - ACKDATA ack = {0}; + PROTO_AVATAR_INFORMATION AI = { 0 }; + ACKDATA ack = { 0 }; DBVARIANT dbv; - char AvatarFile[MAX_PATH+1], AvatarTmpFile[MAX_PATH+10], *ptr, *pszTempFile; + char AvatarFile[MAX_PATH + 1], AvatarTmpFile[MAX_PATH + 10], *ptr, *pszTempFile; if (hContact == NULL) return; // Mount default ack - ack.cbSize = sizeof( ACKDATA ); + ack.cbSize = sizeof(ACKDATA); ack.szModule = SKYPE_PROTONAME; ack.hContact = hContact; ack.type = ACKTYPE_AVATAR; ack.result = ACKRESULT_FAILED; - - AI.cbSize = sizeof( AI ); + + AI.cbSize = sizeof(AI); AI.hContact = hContact; // Get skype name - if (db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv) == 0) + if (db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv) == 0) { if (dbv.pszVal) { // Get filename FoldersGetCustomPath(hProtocolAvatarsFolder, AvatarFile, sizeof(AvatarFile), DefaultAvatarsFolder); - if (!*AvatarFile) strcpy (AvatarFile, DefaultAvatarsFolder); + if (!*AvatarFile) strcpy(AvatarFile, DefaultAvatarsFolder); mir_snprintf(AvatarTmpFile, sizeof(AvatarTmpFile), "AVATAR 1 %s\\%s_tmp.jpg", AvatarFile, dbv.pszVal); - pszTempFile = AvatarTmpFile+9; + pszTempFile = AvatarTmpFile + 9; mir_snprintf(AvatarFile, sizeof(AvatarFile), "%s\\%s.jpg", AvatarFile, dbv.pszVal); // Just to be sure @@ -2446,15 +2458,15 @@ void RetrieveUserAvatar(void *param) if (file != INVALID_HANDLE_VALUE) { CloseHandle(file); - if (ptr=SkypeGet ("USER", dbv.pszVal, AvatarTmpFile)) + if (ptr = SkypeGet("USER", dbv.pszVal, AvatarTmpFile)) { - if (strncmp(ptr, "ERROR", 5) && - GetFileAttributesA(pszTempFile) != INVALID_FILE_ATTRIBUTES) + if (strncmp(ptr, "ERROR", 5) && + GetFileAttributesA(pszTempFile) != INVALID_FILE_ATTRIBUTES) { ack.result = ACKRESULT_SUCCESS; // Is no avatar image? - if (!db_get_b(NULL, SKYPE_PROTONAME, "ShowDefaultSkypeAvatar", 0) + if (!db_get_b(NULL, SKYPE_PROTONAME, "ShowDefaultSkypeAvatar", 0) && GetFileHash(pszTempFile) == 0x8d34e05d && _GetFileSize(pszTempFile) == 3751) { // Has no avatar @@ -2472,7 +2484,7 @@ void RetrieveUserAvatar(void *param) } } - free (ptr); + free(ptr); } DeleteFileA(pszTempFile); } @@ -2480,26 +2492,26 @@ void RetrieveUserAvatar(void *param) } db_free(&dbv); } - CallService( MS_PROTO_BROADCASTACK, 0, ( LPARAM )&ack ); + CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)&ack); } /* SkypeGetAvatarInfo - * + * * Purpose: Set user avatar in profile * Params : wParam=0 * lParam=(LPARAM)(const char*)filename * Returns: 0 - Success * -1 - Failure */ -INT_PTR SkypeGetAvatarInfo(WPARAM wParam,LPARAM lParam) +INT_PTR SkypeGetAvatarInfo(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv; - PROTO_AVATAR_INFORMATION* AI = ( PROTO_AVATAR_INFORMATION* )lParam; + PROTO_AVATAR_INFORMATION* AI = (PROTO_AVATAR_INFORMATION*)lParam; if (AI->hContact == NULL) // User { - if (!db_get_s(NULL,SKYPE_PROTONAME, "AvatarFile", &dbv)) + if (!db_get_s(NULL, SKYPE_PROTONAME, "AvatarFile", &dbv)) { lstrcpynA(AI->filename, dbv.pszVal, sizeof(AI->filename)); db_free(&dbv); @@ -2511,7 +2523,7 @@ INT_PTR SkypeGetAvatarInfo(WPARAM wParam,LPARAM lParam) else // Contact { DBVARIANT dbv; - char AvatarFile[MAX_PATH+1]; + char AvatarFile[MAX_PATH + 1]; if (protocol < 7 && !bIsImoproxy) return GAIR_NOAVATAR; @@ -2519,11 +2531,11 @@ INT_PTR SkypeGetAvatarInfo(WPARAM wParam,LPARAM lParam) if (wParam & GAIF_FORCE) { // Request anyway - pthread_create(RetrieveUserAvatar, (void *) AI->hContact); + pthread_create(RetrieveUserAvatar, (void *)AI->hContact); return GAIR_WAITFOR; } - if (db_get_s(AI->hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) + if (db_get_s(AI->hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) // No skype name ?? return GAIR_NOAVATAR; @@ -2542,7 +2554,7 @@ INT_PTR SkypeGetAvatarInfo(WPARAM wParam,LPARAM lParam) // Check if the file exists if (GetFileAttributesA(AvatarFile) == INVALID_FILE_ATTRIBUTES) return GAIR_NOAVATAR; - + // Return the avatar AI->format = PA_FORMAT_JPEG; strcpy(AI->filename, AvatarFile); @@ -2552,7 +2564,7 @@ INT_PTR SkypeGetAvatarInfo(WPARAM wParam,LPARAM lParam) /* SkypeGetAvatarCaps - * + * * Purpose: Query avatar caps for a protocol * Params : wParam=One of AF_* * lParam=Depends on wParam @@ -2560,37 +2572,37 @@ INT_PTR SkypeGetAvatarInfo(WPARAM wParam,LPARAM lParam) */ INT_PTR SkypeGetAvatarCaps(WPARAM wParam, LPARAM lParam) { - switch(wParam) + switch (wParam) { - case AF_MAXSIZE: - { - POINT *p = (POINT *) lParam; - if (p == NULL) - return -1; + case AF_MAXSIZE: + { + POINT *p = (POINT *)lParam; + if (p == NULL) + return -1; - p->x = 96; - p->y = 96; - return 0; - } - case AF_PROPORTION: - { - return PIP_NONE; - } - case AF_FORMATSUPPORTED: - { - if (lParam == PA_FORMAT_PNG || lParam == PA_FORMAT_JPEG) - return TRUE; - else - return FALSE; - } - case AF_ENABLED: - { + p->x = 96; + p->y = 96; + return 0; + } + case AF_PROPORTION: + { + return PIP_NONE; + } + case AF_FORMATSUPPORTED: + { + if (lParam == PA_FORMAT_PNG || lParam == PA_FORMAT_JPEG) return TRUE; - } - case AF_DONTNEEDDELAYS: - { + else return FALSE; - } + } + case AF_ENABLED: + { + return TRUE; + } + case AF_DONTNEEDDELAYS: + { + return FALSE; + } } return -1; } @@ -2603,9 +2615,9 @@ INT_PTR SkypeGetStatus(WPARAM wParam, LPARAM lParam) { return SkypeStatus; } -INT_PTR SkypeGetInfo(WPARAM wParam,LPARAM lParam) { - CCSDATA *ccs = (CCSDATA *) lParam; - +INT_PTR SkypeGetInfo(WPARAM wParam, LPARAM lParam) { + CCSDATA *ccs = (CCSDATA *)lParam; + UNREFERENCED_PARAMETER(wParam); pthread_create(GetInfoThread, (void*)ccs->hContact); @@ -2613,12 +2625,12 @@ INT_PTR SkypeGetInfo(WPARAM wParam,LPARAM lParam) { } INT_PTR SkypeAddToList(WPARAM wParam, LPARAM lParam) { - PROTOSEARCHRESULT *psr=(PROTOSEARCHRESULT*)lParam; + PROTOSEARCHRESULT *psr = (PROTOSEARCHRESULT*)lParam; LOG(("SkypeAddToList Adding API function called")); - if (psr->cbSize!=sizeof(PROTOSEARCHRESULT) || !psr->nick) return 0; + if (psr->cbSize != sizeof(PROTOSEARCHRESULT) || !psr->nick) return 0; LOG(("SkypeAddToList OK")); - return (INT_PTR)add_contact(_T2A(psr->nick), wParam); + return (INT_PTR)add_contact(_T2A(psr->nick), wParam); } INT_PTR SkypeBasicSearch(WPARAM wParam, LPARAM lParam) { @@ -2626,7 +2638,7 @@ INT_PTR SkypeBasicSearch(WPARAM wParam, LPARAM lParam) { LOG(("SkypeBasicSearch %s", (char *)lParam)); if (!SkypeInitialized) return 0; - return (hSearchThread=pthread_create(( pThreadFunc )BasicSearchThread, _strdup((char *)lParam))); + return (hSearchThread = pthread_create((pThreadFunc)BasicSearchThread, _strdup((char *)lParam))); } void MessageSendWatchThread(void *a) { @@ -2636,117 +2648,121 @@ void MessageSendWatchThread(void *a) { LOG(("MessageSendWatchThread started.")); - str=SkypeRcvMsg(arg->szId, SkypeTime(NULL)-1, arg->hContact, db_get_dw(NULL, "SRMsg", "MessageTimeout", TIMEOUT_MSGSEND)); - InterlockedDecrement (&sendwatchers); + str = SkypeRcvMsg(arg->szId, SkypeTime(NULL) - 1, arg->hContact, db_get_dw(NULL, "SRMsg", "MessageTimeout", TIMEOUT_MSGSEND)); + InterlockedDecrement(&sendwatchers); if (str) { if (!db_get_b(arg->hContact, SKYPE_PROTONAME, "ChatRoom", 0)) { - if (err=GetSkypeErrorMsg(str)) { - ProtoBroadcastAck(SKYPE_PROTONAME, arg->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 1, (LPARAM)Translate(err)); + if (err = GetSkypeErrorMsg(str)) { + ProtoBroadcastAck(SKYPE_PROTONAME, arg->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)1, (LPARAM)Translate(err)); free(err); free(str); free(arg); LOG(("MessageSendWatchThread terminated.")); return; } - ProtoBroadcastAck(SKYPE_PROTONAME, arg->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) 1, 0); + ProtoBroadcastAck(SKYPE_PROTONAME, arg->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)1, 0); } free(str); LOG(("MessageSendWatchThread terminated gracefully.")); } - free (arg); + free(arg); } INT_PTR SkypeSendMessage(WPARAM wParam, LPARAM lParam) { - CCSDATA *ccs = (CCSDATA *) lParam; + CCSDATA *ccs = (CCSDATA *)lParam; DBVARIANT dbv; - BOOL sendok=TRUE; - char *msg = (char *) ccs->lParam, *utfmsg=NULL, *mymsgcmd=cmdMessage, szId[16]={0}; + BOOL sendok = TRUE; + char *msg = (char *)ccs->lParam, *utfmsg = NULL, *mymsgcmd = cmdMessage, szId[16] = { 0 }; static DWORD dwMsgNum = 0; BYTE bIsChatroom = 0 != db_get_b(ccs->hContact, SKYPE_PROTONAME, "ChatRoom", 0); - + UNREFERENCED_PARAMETER(wParam); if (bIsChatroom) { if (db_get_s(ccs->hContact, SKYPE_PROTONAME, "ChatRoomID", &dbv)) return 0; - mymsgcmd="CHATMESSAGE"; + mymsgcmd = "CHATMESSAGE"; } else { if (db_get_s(ccs->hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 0; - mymsgcmd="MESSAGE"; + mymsgcmd = "MESSAGE"; } - + if (ccs->wParam & PREF_UTF) { utfmsg = msg; - } else if (ccs->wParam & PREF_UNICODE) { - utfmsg = (char*)make_utf8_string((WCHAR*)(msg+strlen(msg)+1)); - } else { - if (utf8_encode(msg, &utfmsg)==-1) utfmsg=NULL; - } - if (protocol>=4) { - InterlockedIncrement ((LONG*)&dwMsgNum); - sprintf (szId, "#M%d ", dwMsgNum++); - } - InterlockedIncrement (&sendwatchers); - if (!utfmsg || SkypeSend("%s%s %s %s", szId, mymsgcmd, dbv.pszVal, utfmsg)) sendok=FALSE; - if (utfmsg && utfmsg!=msg) free(utfmsg); + } + else if (ccs->wParam & PREF_UNICODE) { + utfmsg = (char*)make_utf8_string((WCHAR*)(msg + strlen(msg) + 1)); + } + else { + if (utf8_encode(msg, &utfmsg) == -1) utfmsg = NULL; + } + if (protocol >= 4) { + InterlockedIncrement((LONG*)&dwMsgNum); + sprintf(szId, "#M%d ", dwMsgNum++); + } + InterlockedIncrement(&sendwatchers); + if (!utfmsg || SkypeSend("%s%s %s %s", szId, mymsgcmd, dbv.pszVal, utfmsg)) sendok = FALSE; + if (utfmsg && utfmsg != msg) free(utfmsg); db_free(&dbv); if (sendok) { msgsendwt_arg *psendarg = (msgsendwt_arg*)calloc(1, sizeof(msgsendwt_arg)); - + if (psendarg) { psendarg->hContact = ccs->hContact; - strcpy (psendarg->szId, szId); + strcpy(psendarg->szId, szId); pthread_create(MessageSendWatchThread, psendarg); - } else InterlockedDecrement (&sendwatchers); + } + else InterlockedDecrement(&sendwatchers); return 1; - } else InterlockedDecrement (&sendwatchers); - if (!bIsChatroom) - ProtoBroadcastAck(SKYPE_PROTONAME, ccs->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 1, (LPARAM)Translate("Connection to Skype lost")); + } + else InterlockedDecrement(&sendwatchers); + if (!bIsChatroom) + ProtoBroadcastAck(SKYPE_PROTONAME, ccs->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)1, (LPARAM)Translate("Connection to Skype lost")); return 0; } INT_PTR SkypeRecvMessage(WPARAM wParam, LPARAM lParam) { - DBEVENTINFO dbei={0}; - CCSDATA *ccs = (CCSDATA *) lParam; - PROTORECVEVENT *pre = (PROTORECVEVENT *) ccs->lParam; + DBEVENTINFO dbei = { 0 }; + CCSDATA *ccs = (CCSDATA *)lParam; + PROTORECVEVENT *pre = (PROTORECVEVENT *)ccs->lParam; UNREFERENCED_PARAMETER(wParam); - db_unset(ccs->hContact, "CList", "Hidden"); - dbei.cbSize = sizeof(dbei); - dbei.szModule = SKYPE_PROTONAME; - dbei.timestamp = pre->timestamp; - if (pre->flags & PREF_CREATEREAD) dbei.flags|=DBEF_READ; - if (pre->flags & PREF_UTF) dbei.flags|=DBEF_UTF; - dbei.eventType = EVENTTYPE_MESSAGE; - dbei.cbBlob = strlen(pre->szMessage) + 1; + db_unset(ccs->hContact, "CList", "Hidden"); + dbei.cbSize = sizeof(dbei); + dbei.szModule = SKYPE_PROTONAME; + dbei.timestamp = pre->timestamp; + if (pre->flags & PREF_CREATEREAD) dbei.flags |= DBEF_READ; + if (pre->flags & PREF_UTF) dbei.flags |= DBEF_UTF; + dbei.eventType = EVENTTYPE_MESSAGE; + dbei.cbBlob = strlen(pre->szMessage) + 1; if (pre->flags & PREF_UNICODE) - dbei.cbBlob += sizeof( wchar_t )*( (DWORD)wcslen(( wchar_t* )&pre->szMessage[dbei.cbBlob] )+1 ); - dbei.pBlob = (PBYTE) pre->szMessage; - MsgList_Add (pre->lParam, db_event_add(ccs->hContact, &dbei)); - return 0; + dbei.cbBlob += sizeof(wchar_t)*((DWORD)wcslen((wchar_t*)&pre->szMessage[dbei.cbBlob]) + 1); + dbei.pBlob = (PBYTE)pre->szMessage; + MsgList_Add(pre->lParam, db_event_add(ccs->hContact, &dbei)); + return 0; } INT_PTR SkypeUserIsTyping(WPARAM wParam, LPARAM lParam) { - DBVARIANT dbv={0}; + DBVARIANT dbv = { 0 }; MCONTACT hContact = (MCONTACT)wParam; - if (protocol<5 && !bIsImoproxy) return 0; + if (protocol < 5 && !bIsImoproxy) return 0; if (db_get_s(hContact, SKYPE_PROTONAME, "Typing_Stream", &dbv)) { if (db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv) == 0) { char szCmd[256]; - _snprintf (szCmd, sizeof(szCmd), + _snprintf(szCmd, sizeof(szCmd), "ALTER APPLICATION libpurple_typing CONNECT %s", dbv.pszVal); - SkypeSend (szCmd); - db_free (&dbv); - testfor (szCmd, 2000); + SkypeSend(szCmd); + db_free(&dbv); + testfor(szCmd, 2000); // TODO: We should somehow cache the typing notify result and send it // after we got a connection, but in the meantime this notification won't // get sent on first run @@ -2754,8 +2770,8 @@ INT_PTR SkypeUserIsTyping(WPARAM wParam, LPARAM lParam) { return 0; } - SkypeSend ("ALTER APPLICATION libpurple_typing DATAGRAM %s %s", dbv.pszVal, - (lParam==PROTOTYPE_SELFTYPING_ON?"PURPLE_TYPING":"PURPLE_NOT_TYPING")); + SkypeSend("ALTER APPLICATION libpurple_typing DATAGRAM %s %s", dbv.pszVal, + (lParam == PROTOTYPE_SELFTYPING_ON ? "PURPLE_TYPING" : "PURPLE_NOT_TYPING")); db_free(&dbv); return 0; } @@ -2776,7 +2792,7 @@ INT_PTR SkypeSendAuthRequest(WPARAM wParam, LPARAM lParam) { } INT_PTR SkypeRecvAuth(WPARAM wParam, LPARAM lParam) { - DBEVENTINFO dbei = {0}; + DBEVENTINFO dbei = { 0 }; CCSDATA* ccs = (CCSDATA*)lParam; PROTORECVEVENT* pre = (PROTORECVEVENT*)ccs->lParam; @@ -2784,31 +2800,33 @@ INT_PTR SkypeRecvAuth(WPARAM wParam, LPARAM lParam) { db_unset(ccs->hContact, "CList", "Hidden"); - dbei.cbSize = sizeof(dbei); - dbei.szModule = SKYPE_PROTONAME; + dbei.cbSize = sizeof(dbei); + dbei.szModule = SKYPE_PROTONAME; dbei.timestamp = pre->timestamp; - dbei.flags = ((pre->flags & PREF_CREATEREAD)?DBEF_READ:0); + dbei.flags = ((pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0); dbei.eventType = EVENTTYPE_AUTHREQUEST; - dbei.cbBlob = pre->lParam; - dbei.pBlob = (PBYTE)pre->szMessage; + dbei.cbBlob = pre->lParam; + dbei.pBlob = (PBYTE)pre->szMessage; db_event_add(NULL, &dbei); return 0; } char *__skypeauth(WPARAM wParam) { - DBEVENTINFO dbei={0}; + DBEVENTINFO dbei = { 0 }; if (!SkypeInitialized) return NULL; dbei.cbSize = sizeof(dbei); - if ((dbei.cbBlob = db_event_getBlobSize((HANDLE)wParam)==-1 || - !(dbei.pBlob = (unsigned char*)malloc(dbei.cbBlob)))) - { return NULL; } + if ((dbei.cbBlob = db_event_getBlobSize((HANDLE)wParam) == -1 || + !(dbei.pBlob = (unsigned char*)malloc(dbei.cbBlob)))) + { + return NULL; + } if (db_event_get((HANDLE)wParam, &dbei) || dbei.eventType != EVENTTYPE_AUTHREQUEST || - strcmp(dbei.szModule, SKYPE_PROTONAME)) + strcmp(dbei.szModule, SKYPE_PROTONAME)) { free(dbei.pBlob); return NULL; @@ -2821,9 +2839,9 @@ INT_PTR SkypeAuthAllow(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); - if (pBlob=__skypeauth(wParam)) - { - int retval=SkypeSend("SET USER %s ISAUTHORIZED TRUE", pBlob+sizeof(DWORD)+sizeof(HANDLE)); + if (pBlob = __skypeauth(wParam)) + { + int retval = SkypeSend("SET USER %s ISAUTHORIZED TRUE", pBlob + sizeof(DWORD) + sizeof(HANDLE)); free(pBlob); if (!retval) return 0; } @@ -2835,9 +2853,9 @@ INT_PTR SkypeAuthDeny(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); - if (pBlob=__skypeauth(wParam)) - { - int retval=SkypeSend("SET USER %s ISAUTHORIZED FALSE", pBlob+sizeof(DWORD)+sizeof(HANDLE)); + if (pBlob = __skypeauth(wParam)) + { + int retval = SkypeSend("SET USER %s ISAUTHORIZED FALSE", pBlob + sizeof(DWORD) + sizeof(HANDLE)); free(pBlob); if (!retval) return 0; } @@ -2850,9 +2868,9 @@ INT_PTR SkypeAddToListByEvent(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); - if (pBlob=__skypeauth(wParam)) - { - MCONTACT hContact=add_contact(pBlob+sizeof(DWORD)+sizeof(HANDLE), LOWORD(wParam)); + if (pBlob = __skypeauth(wParam)) + { + MCONTACT hContact = add_contact(pBlob + sizeof(DWORD) + sizeof(HANDLE), LOWORD(wParam)); free(pBlob); if (hContact) return (int)hContact; } @@ -2863,7 +2881,7 @@ INT_PTR SkypeRegisterProxy(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(wParam); if (!lParam) { - free (pszProxyCallout); + free(pszProxyCallout); pszProxyCallout = NULL; } pszProxyCallout = _strdup((char*)lParam); @@ -2880,10 +2898,10 @@ void CleanupNicknames(char *dummy) { UNREFERENCED_PARAMETER(dummy); LOG(("CleanupNicknames Cleaning up...")); - for (hContact=db_find_first();hContact != NULL;hContact=db_find_next(hContact)) { - szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, hContact, 0 ); - if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && - db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==0) + for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { + szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0); + if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME) && + db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0) == 0) { if (db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) continue; if (db_get_s(hContact, SKYPE_PROTONAME, "Nick", &dbv2)) { @@ -2902,21 +2920,21 @@ void CleanupNicknames(char *dummy) { ///////////////////////////////////////////////////////////////////////////////////////// // EnterBitmapFileName - enters a bitmap filename -int __stdcall EnterBitmapFileName( char* szDest ) +int __stdcall EnterBitmapFileName(char* szDest) { - char szFilter[ 512 ]; - OPENFILENAMEA ofn = {0}; + char szFilter[512]; + OPENFILENAMEA ofn = { 0 }; *szDest = 0; - CallService( MS_UTILS_GETBITMAPFILTERSTRINGS, sizeof szFilter, ( LPARAM )szFilter ); - ofn.lStructSize = sizeof( OPENFILENAME ); + CallService(MS_UTILS_GETBITMAPFILTERSTRINGS, sizeof szFilter, (LPARAM)szFilter); + ofn.lStructSize = sizeof(OPENFILENAME); ofn.lpstrFilter = szFilter; ofn.lpstrFile = szDest; ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; ofn.nMaxFile = MAX_PATH; ofn.nMaxFileTitle = MAX_PATH; ofn.lpstrDefExt = "bmp"; - if ( !GetOpenFileNameA( &ofn )) + if (!GetOpenFileNameA(&ofn)) return 1; return ERROR_SUCCESS; @@ -2926,7 +2944,7 @@ int MirandaExit(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(lParam); - MirandaShuttingDown=TRUE; + MirandaShuttingDown = TRUE; return 0; } @@ -2934,20 +2952,20 @@ int OkToExit(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(lParam); -// logoff_contacts(); - MirandaShuttingDown=TRUE; + // logoff_contacts(); + MirandaShuttingDown = TRUE; // Trigger all semaphores and events just to be sure that there is no deadlock ReleaseSemaphore(SkypeMsgReceived, receivers, NULL); - SetEvent (SkypeReady); - SetEvent (MessagePumpReady); + SetEvent(SkypeReady); + SetEvent(MessagePumpReady); #ifdef SKYPEBUG_OFFLN SetEvent(GotUserstatus); #endif - SetEvent (hBuddyAdded); + SetEvent(hBuddyAdded); - SkypeFlush (); - PostMessage (g_hWnd, WM_CLOSE, 0, 0); + SkypeFlush(); + PostMessage(g_hWnd, WM_CLOSE, 0, 0); return 0; } @@ -2958,34 +2976,34 @@ struct PLUGINDI { }; // Taken from pluginopts.c and modified -int EnumOldPluginName(const char *szSetting,LPARAM lParam) +int EnumOldPluginName(const char *szSetting, LPARAM lParam) { - struct PLUGINDI *pdi=(struct PLUGINDI*)lParam; + struct PLUGINDI *pdi = (struct PLUGINDI*)lParam; if (pdi && lParam) { - pdi->szSettings=(char**)realloc(pdi->szSettings,(pdi->dwCount+1)*sizeof(char*)); - pdi->szSettings[pdi->dwCount++]=_strdup(szSetting); - } + pdi->szSettings = (char**)realloc(pdi->szSettings, (pdi->dwCount + 1)*sizeof(char*)); + pdi->szSettings[pdi->dwCount++] = _strdup(szSetting); + } return 0; } // Are there any Skype users on list? // 1 --> Yes // 0 --> No -int AnySkypeusers(void) +int AnySkypeusers(void) { MCONTACT hContact; DBVARIANT dbv; int tCompareResult; // already on list? - for (hContact=db_find_first(); - hContact != NULL; - hContact=db_find_next(hContact)) + for (hContact = db_find_first(); + hContact != NULL; + hContact = db_find_next(hContact)) { // GETCONTACTBASEPROTO doesn't work on not loaded protocol, therefore get // protocol from DB if (db_get_s(hContact, "Protocol", "p", &dbv)) continue; - tCompareResult = !strcmp(dbv.pszVal, SKYPE_PROTONAME); + tCompareResult = !strcmp(dbv.pszVal, SKYPE_PROTONAME); db_free(&dbv); if (tCompareResult) return 1; } @@ -2994,103 +3012,103 @@ int AnySkypeusers(void) /*void UpgradeName(char *OldName) -{ - DBCONTACTENUMSETTINGS cns; - DBCONTACTWRITESETTING cws; - DBVARIANT dbv; - MCONTACT hContact=NULL; - struct PLUGINDI pdi; - - LOG(("Updating old database settings if there are any...")); - cns.pfnEnumProc=EnumOldPluginName; - cns.lParam=(LPARAM)&pdi; - cns.szModule=OldName; - cns.ofsSettings=0; - - hContact = db_find_first(); - - for ( ;; ) { - memset(&pdi,0,sizeof(pdi)); - CallService(MS_DB_CONTACT_ENUMSETTINGS,hContact,(LPARAM)&cns); - // Upgrade Protocol settings to new string - if (pdi.szSettings) { - int i; - - LOG(("We're currently upgrading...")); - for (i=0;i 0 && !Miranda_Terminated()) { - TranslateMessage (&msg); - DispatchMessage (&msg); - } - UnregisterClass (WndClass.lpszClassName, hInst); - LOG (("Messagepump stopped.")); + + LOG(("Messagepump started.")); + while (GetMessage(&msg, NULL, 0, 0) > 0 && !Miranda_Terminated()) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + UnregisterClass(WndClass.lpszClassName, hInst); + LOG(("Messagepump stopped.")); } // DLL Stuff // @@ -3102,9 +3120,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirVers return &pluginInfo; } -extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MUUID_SKYPE_CALL, MIID_LAST}; +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MUUID_SKYPE_CALL, MIID_LAST }; -extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) +extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { UNREFERENCED_PARAMETER(fdwReason); UNREFERENCED_PARAMETER(lpvReserved); @@ -3149,13 +3167,13 @@ extern "C" int __declspec(dllexport) Load(void) LOG(("Load: Skype Plugin loading...")); // We need to upgrade SKYPE_PROTOCOL internal name to Skype if not already done -/* if (!db_get_b(NULL, SKYPE_PROTONAME, "UpgradeDone", 0)) - UpgradeName("SKYPE_PROTOCOL");*/ + /* if (!db_get_b(NULL, SKYPE_PROTONAME, "UpgradeDone", 0)) + UpgradeName("SKYPE_PROTOCOL");*/ - // Initialisation of Skype MsgQueue must be done because of Cleanup in end and + // Initialisation of Skype MsgQueue must be done because of Cleanup in end and // Mutex is also initialized here. LOG(("SkypeMsgInit initializing Skype MSG-queue")); - if (SkypeMsgInit()==-1) { + if (SkypeMsgInit() == -1) { OUTPUT(_T("Memory allocation error on startup.")); return 0; } @@ -3165,72 +3183,70 @@ extern "C" int __declspec(dllexport) Load(void) // --> Fixing Issue #0000006 from bugtracker. if (!db_get_b(NULL, SKYPE_PROTONAME, "FirstRun", 0)) { db_set_b(NULL, SKYPE_PROTONAME, "FirstRun", 1); - if (AnySkypeusers()==0) // First run, it seems :) - if (MessageBox(NULL, TranslateT("This seems to be the first time that you're running the Skype protocol plugin. Do you want to enable the protocol for this Miranda profile? If you chose NO, you can always enable it in the plugin options later."), _T("Welcome!"), MB_ICONQUESTION|MB_YESNO)==IDNO) { - char path[MAX_PATH], *filename; - GetModuleFileNameA(hInst, path, sizeof(path)); - if (filename = strrchr(path,'\\')+1) - db_set_b(NULL,"PluginDisable",filename,1); - return 0; + if (AnySkypeusers() == 0) // First run, it seems :) + if (MessageBox(NULL, TranslateT("This seems to be the first time that you're running the Skype protocol plugin. Do you want to enable the protocol for this Miranda profile? If you chose NO, you can always enable it in the plugin options later."), _T("Welcome!"), MB_ICONQUESTION | MB_YESNO) == IDNO) { + char path[MAX_PATH], *filename; + GetModuleFileNameA(hInst, path, sizeof(path)); + if (filename = strrchr(path, '\\') + 1) + db_set_b(NULL, "PluginDisable", filename, 1); + return 0; } } // Check if Skype is installed - SkypeInstalled=TRUE; + SkypeInstalled = TRUE; UseCustomCommand = (BYTE)db_get_b(NULL, SKYPE_PROTONAME, "UseCustomCommand", 0); UseSockets = (BOOL)db_get_b(NULL, SKYPE_PROTONAME, "UseSkype2Socket", 0); - if (!UseSockets && !UseCustomCommand) + if (!UseSockets && !UseCustomCommand) { - if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Skype\\Phone"), 0, KEY_READ, &MyKey)!=ERROR_SUCCESS) + if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Skype\\Phone"), 0, KEY_READ, &MyKey) != ERROR_SUCCESS) { - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\Skype\\Phone"), 0, KEY_READ, &MyKey)!=ERROR_SUCCESS) + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\Skype\\Phone"), 0, KEY_READ, &MyKey) != ERROR_SUCCESS) { - SkypeInstalled=FALSE; + SkypeInstalled = FALSE; } } - - Buffsize=sizeof(skype_path); - - if (SkypeInstalled==FALSE || RegQueryValueExA(MyKey, "SkypePath", NULL, NULL, (unsigned char *)skype_path, &Buffsize)!=ERROR_SUCCESS) + + Buffsize = sizeof(skype_path); + + if (SkypeInstalled == FALSE || RegQueryValueExA(MyKey, "SkypePath", NULL, NULL, (unsigned char *)skype_path, &Buffsize) != ERROR_SUCCESS) { - //OUTPUT("Skype was not found installed :( \nMaybe you are using portable Skype."); - RegCloseKey(MyKey); - skype_path[0]=0; - //return 0; + //OUTPUT("Skype was not found installed :( \nMaybe you are using portable Skype."); + RegCloseKey(MyKey); + skype_path[0] = 0; + //return 0; } RegCloseKey(MyKey); } - WSAStartup(MAKEWORD(2,2), &wsaData); + WSAStartup(MAKEWORD(2, 2), &wsaData); // Start Skype connection - if (!(ControlAPIAttach=RegisterWindowMessage(_T("SkypeControlAPIAttach"))) || !(ControlAPIDiscover=RegisterWindowMessage(_T("SkypeControlAPIDiscover")))) + if (!(ControlAPIAttach = RegisterWindowMessage(_T("SkypeControlAPIAttach"))) || !(ControlAPIDiscover = RegisterWindowMessage(_T("SkypeControlAPIDiscover")))) { - OUTPUT(_T("Cannot register Window message.")); - return 0; + OUTPUT(_T("Cannot register Window message.")); + return 0; } - - SkypeMsgReceived=CreateSemaphore(NULL, 0, MAX_MSGS, NULL); - if (!(SkypeReady=CreateEvent(NULL, TRUE, FALSE, NULL)) || - !(MessagePumpReady=CreateEvent(NULL, FALSE, FALSE, NULL)) || + + SkypeMsgReceived = CreateSemaphore(NULL, 0, MAX_MSGS, NULL); + if (!(SkypeReady = CreateEvent(NULL, TRUE, FALSE, NULL)) || + !(MessagePumpReady = CreateEvent(NULL, FALSE, FALSE, NULL)) || #ifdef SKYPEBUG_OFFLN - !(GotUserstatus=CreateEvent(NULL, TRUE, FALSE, NULL)) || + !(GotUserstatus = CreateEvent(NULL, TRUE, FALSE, NULL)) || #endif - !(hBuddyAdded=CreateEvent(NULL, FALSE, FALSE, NULL)) || - !(FetchMessageEvent=CreateEvent(NULL, FALSE, TRUE, NULL))) { - OUTPUT(_T("Unable to create Mutex!")); + !(hBuddyAdded = CreateEvent(NULL, FALSE, FALSE, NULL)) || + !(FetchMessageEvent = CreateEvent(NULL, FALSE, TRUE, NULL))) { + OUTPUT(_T("Unable to create Mutex!")); return 0; } /* Register the module */ PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE }; pd.szName = SKYPE_PROTONAME; - pd.type = PROTOTYPE_PROTOCOL; + pd.type = PROTOTYPE_PROTOCOL; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); - VoiceServiceInit(); - CreateServices(); HookEvents(); InitVSApi(); @@ -3239,51 +3255,50 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown); // Startup Message-pump - pthread_create (( pThreadFunc )MsgPump, NULL); + pthread_create((pThreadFunc)MsgPump, NULL); WaitForSingleObject(MessagePumpReady, INFINITE); return 0; } -extern "C" int __declspec( dllexport ) Unload(void) +extern "C" int __declspec(dllexport) Unload(void) { BOOL UseCustomCommand = db_get_b(NULL, SKYPE_PROTONAME, "UseCustomCommand", 0); BOOL Shutdown = db_get_b(NULL, SKYPE_PROTONAME, "Shutdown", 0); - - LOG (("Unload started")); - - if ( Shutdown && ((skype_path && skype_path[0]) ||UseCustomCommand) ) { - if(UseCustomCommand) + LOG(("Unload started")); + + if (Shutdown && ((skype_path && skype_path[0]) || UseCustomCommand)) { + + if (UseCustomCommand) { DBVARIANT dbv; - if(!db_get_s(NULL,SKYPE_PROTONAME,"CommandLine",&dbv)) + if (!db_get_s(NULL, SKYPE_PROTONAME, "CommandLine", &dbv)) { char szAbsolutePath[MAX_PATH]; TranslateMirandaRelativePathToAbsolute(dbv.pszVal, szAbsolutePath, FALSE); _spawnl(_P_NOWAIT, szAbsolutePath, szAbsolutePath, "/SHUTDOWN", NULL); - LOG (("Unload Sent /shutdown to %s", szAbsolutePath)); + LOG(("Unload Sent /shutdown to %s", szAbsolutePath)); db_free(&dbv); } } else { _spawnl(_P_NOWAIT, skype_path, skype_path, "/SHUTDOWN", NULL); - LOG (("Unload Sent /shutdown to %s", skype_path)); + LOG(("Unload Sent /shutdown to %s", skype_path)); } - + } SkypeMsgCleanup(); //WSACleanup(); FreeVSApi(); UnhookEvents(); UnhookEvent(hChatEvent); - UnhookEvent (hChatMenu); - UnhookEvent (hEvInitChat); + UnhookEvent(hChatMenu); + UnhookEvent(hEvInitChat); DestroyHookableEvent(hInitChat); - VoiceServiceExit(); GCExit(); MsgList_Exit(); @@ -3299,8 +3314,8 @@ extern "C" int __declspec( dllexport ) Unload(void) DeleteCriticalSection(&RingAndEndcallMutex); DeleteCriticalSection(&QueryThreadMutex); - SkypeRegisterProxy (0, 0); - LOG (("Unload: Shutdown complete")); + SkypeRegisterProxy(0, 0); + LOG(("Unload: Shutdown complete")); #ifdef _DEBUG end_debug(); #endif diff --git a/protocols/SkypeClassic/src/voiceservice.cpp b/protocols/SkypeClassic/src/voiceservice.cpp deleted file mode 100644 index dd49772d2a..0000000000 --- a/protocols/SkypeClassic/src/voiceservice.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include "skype.h" -#include "skypeapi.h" -#include "skypesvc.h" -#include "voiceservice.h" -#include - -#pragma warning (push) -#pragma warning (disable: 4100) // unreferenced formal parameter -#include -#pragma warning (pop) - -HANDLE hVoiceNotify = NULL; -BOOL has_voice_service = FALSE; - -extern char g_szProtoName[]; - - -BOOL HasVoiceService() -{ - return has_voice_service; -} - -void NofifyVoiceService(MCONTACT hContact, char *callId, int state) -{ - VOICE_CALL vc = {0}; - vc.cbSize = sizeof(vc); - vc.szModule = SKYPE_PROTONAME; - vc.id = callId; - vc.flags = VOICE_CALL_CONTACT; - vc.state = state; - vc.hContact = hContact; - NotifyEventHooks(hVoiceNotify, (WPARAM) &vc, 0); -} - -static INT_PTR VoiceGetInfo(WPARAM wParam, LPARAM lParam) -{ - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - return VOICE_SUPPORTED | VOICE_CALL_CONTACT | VOICE_CAN_HOLD; -} - -static MCONTACT FindContactByCallId(char *callId) -{ - MCONTACT hContact; - int iCmpRes; - for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) { - char *szProto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0); - - DBVARIANT dbv; - if (szProto != NULL - && !strcmp(szProto, SKYPE_PROTONAME) - && db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0) == 0 - && !db_get_s(hContact, SKYPE_PROTONAME, "CallId", &dbv)) - { - iCmpRes = strcmp(callId, dbv.pszVal); - db_free(&dbv); - if (iCmpRes == 0) - return hContact; - } - } - - return NULL; -} - -static INT_PTR VoiceCall(WPARAM wParam, LPARAM lParam) -{ - DBVARIANT dbv; - - UNREFERENCED_PARAMETER(lParam); - - if (!wParam) return -1; - - if (db_get_s((MCONTACT)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) - return -1; - - SkypeSend("CALL %s", dbv.pszVal); - db_free (&dbv); - - return 0; -} - -static INT_PTR VoiceAnswer(WPARAM wParam, LPARAM lParam) -{ - char *callId = (char *) wParam; - - UNREFERENCED_PARAMETER(lParam); - - if (!wParam) return -1; - - if (FindContactByCallId(callId) == NULL) - return -1; - - SkypeSend("SET %s STATUS INPROGRESS", callId); - testfor("ERROR", 200); - - return 0; -} - -static INT_PTR VoiceDrop(WPARAM wParam, LPARAM lParam) -{ - char *callId = (char *) wParam; - - UNREFERENCED_PARAMETER(lParam); - - if (!wParam) return -1; - - if (FindContactByCallId(callId) == NULL) - return -1; - - SkypeSend("SET %s STATUS FINISHED", callId); - - return 0; -} - -static INT_PTR VoiceHold(WPARAM wParam, LPARAM lParam) -{ - char *callId = (char *) wParam; - - UNREFERENCED_PARAMETER(lParam); - - if (!wParam) return -1; - - if (FindContactByCallId(callId) == NULL) - return -1; - - SkypeSend("SET %s STATUS ONHOLD", callId); - - return 0; -} - -void VoiceServiceInit() -{ - // leecher, 26.03.2011: Did this ever work in the old versions?? - char szEvent[MAXMODULELABELLENGTH]; - - _snprintf (szEvent, sizeof(szEvent), "%s%s", SKYPE_PROTONAME, PE_VOICE_CALL_STATE); - hVoiceNotify = CreateHookableEvent( szEvent ); - CreateProtoService( PS_VOICE_GETINFO, VoiceGetInfo ); - CreateProtoService( PS_VOICE_CALL, VoiceCall ); - CreateProtoService( PS_VOICE_ANSWERCALL, VoiceAnswer ); - CreateProtoService( PS_VOICE_DROPCALL, VoiceDrop ); - CreateProtoService( PS_VOICE_HOLDCALL, VoiceHold ); -} - -void VoiceServiceExit() -{ - DestroyHookableEvent(hVoiceNotify); -} - -void VoiceServiceModulesLoaded() -{ - has_voice_service = ServiceExists(MS_VOICESERVICE_REGISTER); -} \ No newline at end of file diff --git a/protocols/SkypeClassic/src/voiceservice.h b/protocols/SkypeClassic/src/voiceservice.h deleted file mode 100644 index df1a016100..0000000000 --- a/protocols/SkypeClassic/src/voiceservice.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _VOICESERVICE_H_ -#define _VOICESERVICE_H_ - -#pragma warning (push) -#pragma warning (disable: 4201) // nonstandard extension used : nameless struct/union -#include -#pragma warning (pop) - -BOOL HasVoiceService(); -void VoiceServiceInit(); -void VoiceServiceExit(); -void VoiceServiceModulesLoaded(); -void NofifyVoiceService(MCONTACT hContact, char *callId, int state) ; - - - -#endif // _VOICESERVICE_H_ - -- cgit v1.2.3