From 4653a5d7af56bf2697e2a9a87ddbc3f86a7fb541 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Thu, 16 May 2013 18:19:56 +0000 Subject: - wbOSD: added to solutions git-svn-id: http://svn.miranda-ng.org/main/trunk@4684 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- bin10/mir_full.sln | 10 + bin10/mir_full_pro.sln | 11 + bin11/mir_full.sln | 10 + plugins/wbOSD/buildnumber.h | 6 - plugins/wbOSD/doc/readme.txt | 84 +++++++ plugins/wbOSD/events.cpp | 208 ---------------- plugins/wbOSD/main.cpp | 99 -------- plugins/wbOSD/options.cpp | 422 --------------------------------- plugins/wbOSD/readme.txt | 84 ------- plugins/wbOSD/res/version.rc | 38 +++ plugins/wbOSD/res/wbOSD.rc | 188 +++++++++++++++ plugins/wbOSD/resource.h | 57 ----- plugins/wbOSD/src/events.cpp | 208 ++++++++++++++++ plugins/wbOSD/src/main.cpp | 100 ++++++++ plugins/wbOSD/src/options.cpp | 422 +++++++++++++++++++++++++++++++++ plugins/wbOSD/src/resource.h | 57 +++++ plugins/wbOSD/src/stdafx.cpp | 18 ++ plugins/wbOSD/src/version.h | 35 +++ plugins/wbOSD/src/wbOSD.cpp | 309 ++++++++++++++++++++++++ plugins/wbOSD/src/wbOSD.h | 128 ++++++++++ plugins/wbOSD/wbOSD.cpp | 309 ------------------------ plugins/wbOSD/wbOSD.h | 128 ---------- plugins/wbOSD/wbOSD.rc | 188 --------------- plugins/wbOSD/wbOSD_10.vcxproj | 68 +++--- plugins/wbOSD/wbOSD_10.vcxproj.filters | 39 +-- plugins/wbOSD/wbOSD_11.vcxproj | 203 ++++++++++++++++ plugins/wbOSD/wbOSD_11.vcxproj.filters | 53 +++++ 27 files changed, 1935 insertions(+), 1547 deletions(-) delete mode 100644 plugins/wbOSD/buildnumber.h create mode 100644 plugins/wbOSD/doc/readme.txt delete mode 100644 plugins/wbOSD/events.cpp delete mode 100644 plugins/wbOSD/main.cpp delete mode 100644 plugins/wbOSD/options.cpp delete mode 100644 plugins/wbOSD/readme.txt create mode 100644 plugins/wbOSD/res/version.rc create mode 100644 plugins/wbOSD/res/wbOSD.rc delete mode 100644 plugins/wbOSD/resource.h create mode 100644 plugins/wbOSD/src/events.cpp create mode 100644 plugins/wbOSD/src/main.cpp create mode 100644 plugins/wbOSD/src/options.cpp create mode 100644 plugins/wbOSD/src/resource.h create mode 100644 plugins/wbOSD/src/stdafx.cpp create mode 100644 plugins/wbOSD/src/version.h create mode 100644 plugins/wbOSD/src/wbOSD.cpp create mode 100644 plugins/wbOSD/src/wbOSD.h delete mode 100644 plugins/wbOSD/wbOSD.cpp delete mode 100644 plugins/wbOSD/wbOSD.h delete mode 100644 plugins/wbOSD/wbOSD.rc create mode 100644 plugins/wbOSD/wbOSD_11.vcxproj create mode 100644 plugins/wbOSD/wbOSD_11.vcxproj.filters diff --git a/bin10/mir_full.sln b/bin10/mir_full.sln index f0a7841d70..b6b674ceea 100644 --- a/bin10/mir_full.sln +++ b/bin10/mir_full.sln @@ -387,6 +387,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StdCrypt", "..\src\core\std EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SkypeStatusChange", "..\plugins\SkypeStatusChange\SkypeStatusChange_10.vcxproj", "{10F78F26-2B20-4158-869F-CB29533B4C2C}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wbOSD", "..\plugins\wbOSD\wbOSD_10.vcxproj", "{DA450122-7F0B-45DA-9EAA-421887AD8450}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -1733,6 +1735,14 @@ Global {10F78F26-2B20-4158-869F-CB29533B4C2C}.Release|Win32.Build.0 = Release|Win32 {10F78F26-2B20-4158-869F-CB29533B4C2C}.Release|x64.ActiveCfg = Release|x64 {10F78F26-2B20-4158-869F-CB29533B4C2C}.Release|x64.Build.0 = Release|x64 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Debug|Win32.Build.0 = Debug|Win32 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Debug|x64.ActiveCfg = Debug|x64 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Debug|x64.Build.0 = Debug|x64 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Release|Win32.ActiveCfg = Release|Win32 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Release|Win32.Build.0 = Release|Win32 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Release|x64.ActiveCfg = Release|x64 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/bin10/mir_full_pro.sln b/bin10/mir_full_pro.sln index 42dc7e5c14..32eb0bfb54 100644 --- a/bin10/mir_full_pro.sln +++ b/bin10/mir_full_pro.sln @@ -423,6 +423,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StdCrypt", "..\src\core\std EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SkypeStatusChange", "..\plugins\SkypeStatusChange\SkypeStatusChange_10.vcxproj", "{10F78F26-2B20-4158-869F-CB29533B4C2C}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wbOSD", "..\plugins\wbOSD\wbOSD_10.vcxproj", "{DA450122-7F0B-45DA-9EAA-421887AD8450}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -1769,6 +1771,14 @@ Global {10F78F26-2B20-4158-869F-CB29533B4C2C}.Release|Win32.Build.0 = Release|Win32 {10F78F26-2B20-4158-869F-CB29533B4C2C}.Release|x64.ActiveCfg = Release|x64 {10F78F26-2B20-4158-869F-CB29533B4C2C}.Release|x64.Build.0 = Release|x64 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Debug|Win32.Build.0 = Debug|Win32 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Debug|x64.ActiveCfg = Debug|x64 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Debug|x64.Build.0 = Debug|x64 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Release|Win32.ActiveCfg = Release|Win32 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Release|Win32.Build.0 = Release|Win32 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Release|x64.ActiveCfg = Release|x64 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1881,6 +1891,7 @@ Global {EEB57129-946C-4B98-8856-FDA501AE2A5E} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649} {AF7D71D4-19B7-42B8-91DD-701F155AC4AE} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649} {0E73244B-30D7-4A62-B4B3-9A32B96EC1B7} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649} + {DA450122-7F0B-45DA-9EAA-421887AD8450} = {03FBFF5D-0539-4C51-B7C2-B8CFF9DEA649} {0007BE9F-DD4D-4E9B-B1C8-C5049538F862} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626} {DD76B998-ED0D-4BFD-9660-3ADC3A334872} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626} {27CA5499-B3F2-4FB6-8414-651819B0B96C} = {0EF566FB-09FC-4F4D-9944-A0CDC82DF626} diff --git a/bin11/mir_full.sln b/bin11/mir_full.sln index 7161017ae1..c34b0b7319 100644 --- a/bin11/mir_full.sln +++ b/bin11/mir_full.sln @@ -387,6 +387,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StdCrypt", "..\src\core\std EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SkypeStatusChange", "..\plugins\SkypeStatusChange\SkypeStatusChange_11.vcxproj", "{10F78F26-2B20-4158-869F-CB29533B4C2C}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wbOSD", "..\plugins\wbOSD\wbOSD_11.vcxproj", "{DA450122-7F0B-45DA-9EAA-421887AD8450}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -1733,6 +1735,14 @@ Global {10F78F26-2B20-4158-869F-CB29533B4C2C}.Release|Win32.Build.0 = Release|Win32 {10F78F26-2B20-4158-869F-CB29533B4C2C}.Release|x64.ActiveCfg = Release|x64 {10F78F26-2B20-4158-869F-CB29533B4C2C}.Release|x64.Build.0 = Release|x64 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Debug|Win32.Build.0 = Debug|Win32 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Debug|x64.ActiveCfg = Debug|x64 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Debug|x64.Build.0 = Debug|x64 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Release|Win32.ActiveCfg = Release|Win32 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Release|Win32.Build.0 = Release|Win32 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Release|x64.ActiveCfg = Release|x64 + {DA450122-7F0B-45DA-9EAA-421887AD8450}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/plugins/wbOSD/buildnumber.h b/plugins/wbOSD/buildnumber.h deleted file mode 100644 index b77727792f..0000000000 --- a/plugins/wbOSD/buildnumber.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _BUILDNUMBER_ -#define BUILDNUMBER 0 -#define __FILEVERSION_STRING 0,2,1,0 -#define __VERSION_STRING "0.2.1.0" -#define __VERSION_DWORD 0x20100 -#endif //_BUILDNUMBER_ diff --git a/plugins/wbOSD/doc/readme.txt b/plugins/wbOSD/doc/readme.txt new file mode 100644 index 0000000000..09815bf989 --- /dev/null +++ b/plugins/wbOSD/doc/readme.txt @@ -0,0 +1,84 @@ +Wannabe (Miranda's) OSD +(c)2005 Andrej Krutak +Distribute under the GNU GPL 2.0 license + +======================================================= + +Hello there, I'm happy you are trying out my OSD plugin... I've just started +to make it (in fact, it's the first miranda plugin i ever made ;-) so please +excuse bugs etc. (but you may report them, of course ;-) + +The plugin is trying to implement all the functionality of the 'old' OSD plugin. +However, I never got to it's documentation, so I can't tell if everything's gonna +work the way it should... Let me know :o) + +And I'll be happy if you send some suggestions/code parts etc., but please, +send it into the forum of this project on miranda's web ;-) + + + +------| Short tips: |---------------------------------- + +Moving the OSD: +Simply drag it by pressing left mouse button and then move the cursor ;-) +Note that only position changes done while settings dialog is shown are +saved. + +Closing the actual OSD: +Press the right button over the OSD - that will close the OSD and +show a message window for the contact who caused the OSD activity. + + + +------| Changelog: |----------------------------------- + +0.2.0.5 + New: Enable/disable OSD announces for specific own statuses + Fix: User interface improvemets... + Fix: used 100% of the processor time sometimes + +0.2.0.1 + Fix: Help button + Fix: Translation of status announces + +0.2.0.0 + Fix: multiline output + New: separate color for status & message announces + New: by pressing the right mouse button you can send message + New: message announce format can be customized a little + Fix: User interface improvemets... + Fix: again a little bit more compatible to win9x ;-) + Info: The unicode version might be broken, sorry if it is + +0.1.5.0 + New: unicode support (thanx to SilverCircle) + New: multiline output (thanx to SilverCircle) + (Hopefully)Fix: win9x-workaround memory leak +0.1.0.0 + New: more comfortable OSD positioning + New: possibility to not show own status changes + New: translation support + Fix: should work under win9x, however the transparency doesn't work well + Fix: some small bugfixes (e.g. saving of announce settings) ;-) + +0.0.2.0 + New: some more documentation + New: settings applied to osd instantly, saved after apply + New: user offline notification + Fix: only showing status of people in the contact list + +0.0.1.1 + Tiny little fix ;-) + +0.0.1.0 + Initial release + + + + +------| Some TODOs: |---------------------------------- + +* different color schemes for messages/online notifications etc. (in progess) +* test (and make work in case it doesn't) under other os than winxp +* add some other formatting options (not sure if it's worth the work) +* other things ;-) diff --git a/plugins/wbOSD/events.cpp b/plugins/wbOSD/events.cpp deleted file mode 100644 index 83d5d79c6b..0000000000 --- a/plugins/wbOSD/events.cpp +++ /dev/null @@ -1,208 +0,0 @@ -/* -Wannabe OSD -This plugin tries to become miranda's standard OSD ;-) - -(C) 2005 Andrej Krutak - -Distributed under GNU's GPL 2 or later -*/ - -#include "wbOSD.h" -#include - -extern HWND hwnd; -extern HANDLE hHookContactStatusChanged; - -void logmsg2(char *str) -{ - FILE *f=fopen("c:\\logm.txt", "a"); - fprintf(f, "%s\n", str); - fclose(f); -} - -void showmsgwnd(unsigned int param) -{ - logmsg("showmsgwnd"); - if (db_get_b(NULL,THIS_MODULE, "showMessageWindow", DEFAULT_SHOWMSGWIN)) - CallService(MS_MSG_SENDMESSAGET, (WPARAM)param, 0); -} - -LRESULT ShowOSD(TCHAR *str, int timeout, COLORREF color, HANDLE user) -{ - logmsg("ShowOSD"); - - if (!hwnd) - return 0; - - if (timeout==0) - timeout=db_get_dw(NULL,THIS_MODULE, "timeout", DEFAULT_TIMEOUT); - - osdmsg om; - om.text=str; - om.timeout=timeout; - om.color=color; - om.param=(unsigned int)user; - om.callback=showmsgwnd; - - return SendMessage(hwnd, WM_USER+4, (WPARAM)&om, 0); -} - -int ProtoAck(WPARAM,LPARAM lparam) -{ - ACKDATA *ack=(ACKDATA *)lparam; - - logmsg("ProtoAck"); - - if (!db_get_b(NULL,THIS_MODULE, "a_user", DEFAULT_ANNOUNCESTATUS)) - return 0; - - if (!(db_get_dw(NULL,THIS_MODULE,"showWhen", DEFAULT_SHOWWHEN)&(1<<(db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE)-ID_STATUS_OFFLINE)))) - return 0; - - if ( ack->type == ACKTYPE_STATUS ) { - if (!db_get_b(NULL,THIS_MODULE, "showMyStatus", DEFAULT_SHOWMYSTATUS)) - return 0; - - if ( ack->result == ACKRESULT_SUCCESS && (LPARAM)ack->hProcess != ack->lParam ) { - DWORD ann = db_get_dw( NULL, THIS_MODULE, "announce", DEFAULT_ANNOUNCE ); - if ( ann & ( 1 << ( ack->lParam - ID_STATUS_OFFLINE ))) { - TCHAR buffer[512]; - mir_sntprintf(buffer, SIZEOF(buffer), TranslateT("%s is %s"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ack->hContact, GCDNF_TCHAR), CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM) ack->lParam,GSMDF_TCHAR)); - ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), ack->hContact); - } } } - - return 0; -} - -int ContactSettingChanged(WPARAM wParam,LPARAM lParam) -{ - HANDLE hContact = (HANDLE) wParam; - DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam; - - logmsg("ContactSettingChanged1"); - - if(hContact==NULL || lstrcmpA(cws->szSetting,"Status")) return 0; - - WORD newStatus = cws->value.wVal; - WORD oldStatus = DBGetContactSettingRangedWord(hContact,"UserOnline","OldStatus2",ID_STATUS_OFFLINE, ID_STATUS_MIN, ID_STATUS_MAX); - - if (oldStatus == newStatus) return 0; - - logmsg("ContactSettingChanged2"); - - db_set_w(hContact,"UserOnline","OldStatus2", newStatus); - - if(CallService(MS_IGNORE_ISIGNORED,wParam,IGNOREEVENT_USERONLINE)) return 0; - - DWORD dwStatuses = MAKELPARAM(oldStatus, newStatus); - NotifyEventHooks(hHookContactStatusChanged, wParam, (LPARAM)dwStatuses); - - return 0; -} - -int ContactStatusChanged(WPARAM wParam, LPARAM lParam) -{ - HANDLE hContact = (HANDLE) wParam; - WORD oldStatus = LOWORD(lParam); - WORD newStatus = HIWORD(lParam); - DWORD ann=db_get_dw(NULL,THIS_MODULE,"announce", DEFAULT_ANNOUNCE); - - logmsg("ContactStatusChanged1"); - - if (!db_get_b(NULL,THIS_MODULE, "a_user", DEFAULT_ANNOUNCESTATUS)) - return 0; - - if (!(db_get_dw(NULL,THIS_MODULE,"showWhen", DEFAULT_SHOWWHEN)&(1<<(db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE)-ID_STATUS_OFFLINE)))) - return 0; - - if (!(ann&(1<<(newStatus-ID_STATUS_OFFLINE))) ) - return 0; - - logmsg("ContactStatusChanged2"); - - if (db_get_b(hContact,"CList","NotOnList",0) || db_get_b(hContact,"CList","Hidden",0) || - (CallService(MS_IGNORE_ISIGNORED,wParam,IGNOREEVENT_USERONLINE) && newStatus==ID_STATUS_ONLINE) - ) - return 0; - - TCHAR bufferW[512]; - mir_sntprintf(bufferW, SIZEOF(bufferW), TranslateT("%s is %s"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, wParam, GCDNF_TCHAR), CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,newStatus,GSMDF_TCHAR)); - ShowOSD(bufferW, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), hContact); - return 0; -} - -int HookedNewEvent(WPARAM wParam, LPARAM lParam) -{ - logmsg("HookedNewEvent1"); - HANDLE hDBEvent = (HANDLE) lParam; - DBEVENTINFO dbe; - dbe.cbSize = sizeof(dbe); - dbe.cbBlob = db_event_getBlobSize(hDBEvent); - if (dbe.cbBlob == -1) - return 0; - - dbe.pBlob = (PBYTE) malloc(dbe.cbBlob); - if(db_event_get(hDBEvent,&dbe)) - return 0; - - if (dbe.flags & DBEF_SENT || dbe.eventType == 25368) - return 0; - - if (db_get_b(NULL,THIS_MODULE, "messages", DEFAULT_ANNOUNCEMESSAGES)==0) - return 0; - - if (!(db_get_dw(NULL,THIS_MODULE,"showWhen", DEFAULT_SHOWWHEN)&(1<<(db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE)-ID_STATUS_OFFLINE)))) - return 0; - - logmsg("HookedNewEvent2"); - - TCHAR buf[512]; - _tcsncpy(buf, DEFAULT_MESSAGEFORMAT,SIZEOF(buf)); - - DBVARIANT dbv; - if(!db_get_ts(NULL,THIS_MODULE,"message_format",&dbv)) { - _tcscpy(buf, dbv.ptszVal); - db_free(&dbv); - } - - int i1=-1, i2=-1; - TCHAR* pbuf = buf; - while (*pbuf) { - if (*pbuf=='%') { - if (*(pbuf+1)=='n') { - if (i1==-1) - i1=1; - else i2=1; - *(pbuf+1)='s'; - } else if (*(pbuf+1)=='m') { - if (i1==-1) - i1=2; - else i2=2; - *(pbuf+1)='s'; - } else if (*(pbuf+1)=='l') { - *pbuf=0x0d; - *(pbuf+1)=0x0a; - } - } - pbuf++; - } - - TCHAR *c1 = 0, *c2 = 0; - if ( i1 == 1 ) - c1 = mir_tstrdup(( TCHAR* )CallService(MS_CLIST_GETCONTACTDISPLAYNAME, wParam, GCDNF_TCHAR)); - else if ( i1 == 2 ) - c1 = DbGetEventTextT( &dbe, 0 ); - - if ( i2 == 1 ) - c2 = mir_tstrdup(( TCHAR* )CallService(MS_CLIST_GETCONTACTDISPLAYNAME, wParam, GCDNF_TCHAR)); - else if ( i2 == 2 ) - c2 = DbGetEventTextT( &dbe, 0 ); - - TCHAR buffer[512]; - mir_sntprintf(buffer, SIZEOF(buffer), buf, c1, c2); - ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG), (HANDLE)wParam); - - mir_free( c1 ); - mir_free( c2 ); - return 0; -} diff --git a/plugins/wbOSD/main.cpp b/plugins/wbOSD/main.cpp deleted file mode 100644 index d4d4cc260a..0000000000 --- a/plugins/wbOSD/main.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* -Wannabe OSD -This plugin tries to become miranda's standard OSD ;-) - -(C) 2005 Andrej Krutak - -Distributed under GNU's GPL 2 or later -*/ - -#include "wbOSD.h" -#include "buildnumber.h" - -HINSTANCE hI; - -HWND hwnd=0; -HANDLE hservosda; -int hLangpack = 0; -HANDLE hHookedNewEvent, hHookedInit, hProtoAck, hContactSettingChanged, hHookContactStatusChanged, hContactStatusChanged, hpluginShutDown; -HINSTANCE hUser32; -BOOL (WINAPI*pSetLayeredWindowAttributes)(HWND, COLORREF, BYTE, DWORD); - -void logmsg2(char *str); -int MainInit(WPARAM,LPARAM); - -///////////////////////////////////////////////////////////////////////////////////////// - -static PLUGININFOEX pluginInfo = { - sizeof(PLUGININFOEX), - "WannaBe OSD", - __VERSION_DWORD, - "Show new message/status change info using onscreen display", - "Andrej Krutak", - "andree182 {at} gmail (dot) com", - "©2005 Andrej Krutak", - "http://urtax.ms.mff.cuni.cz/~andree/", - UNICODE_AWARE, - { 0xfc718bc7, 0xabc8, 0x43cd, { 0xaa, 0xd9, 0x76, 0x16, 0x14, 0x61, 0x77, 0x38 } } // {FC718BC7-ABC8-43CD-AAD9-761614617738} -}; - -extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD) -{ - return &pluginInfo; -} - -///////////////////////////////////////////////////////////////////////////////////////// - -extern "C" __declspec(dllexport) int Load() -{ - mir_getLP(&pluginInfo); - - logmsg("Load"); - pSetLayeredWindowAttributes=0; - -#ifndef FORCE_9XDRAWING - hUser32=LoadLibrary(_T("user32.dll")); -#else - hUser32=0; -#endif - - if (hUser32) { - pSetLayeredWindowAttributes=(BOOL(WINAPI*)(HWND, COLORREF, BYTE, DWORD))GetProcAddress(hUser32, "SetLayeredWindowAttributes"); - if (!pSetLayeredWindowAttributes) { - FreeLibrary(hUser32); - hUser32=0; - } - } - - hHookedInit = HookEvent(ME_SYSTEM_MODULESLOADED, MainInit); - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// - -extern "C" __declspec(dllexport) int Unload() -{ - logmsg("Unload"); - UnhookEvent(hpluginShutDown); - UnhookEvent(hProtoAck); - UnhookEvent(hContactSettingChanged); - UnhookEvent(hContactStatusChanged); - UnhookEvent(hHookedNewEvent); - UnhookEvent(hHookedInit); - - if (hUser32) - FreeLibrary(hUser32); - pSetLayeredWindowAttributes=0; - - DestroyServiceFunction(hservosda); - DestroyHookableEvent(hHookContactStatusChanged); - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// - -BOOL WINAPI DllMain(HINSTANCE hinst,DWORD fdwReason,LPVOID lpvReserved) -{ - hI = hinst; - return TRUE; -} diff --git a/plugins/wbOSD/options.cpp b/plugins/wbOSD/options.cpp deleted file mode 100644 index fdc8787fa5..0000000000 --- a/plugins/wbOSD/options.cpp +++ /dev/null @@ -1,422 +0,0 @@ -/* -Wannabe OSD -This plugin tries to become miranda's standard OSD ;-) - -(C) 2005 Andrej Krutak - -Distributed under GNU's GPL 2 or later -*/ - -#include "wbOSD.h" - -COLORREF pencustcolors[16]; - -const static osdmsg defstr={_T(""), 0, RGB(0, 0, 0), 0, 0}; - -void FillCheckBoxTree(HWND hwndTree,DWORD style) -{ - logmsg("FillCheckBoxTree"); - - TVINSERTSTRUCT tvis; - tvis.hParent = NULL; - tvis.hInsertAfter = TVI_LAST; - tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_STATE; - for ( WORD status = ID_STATUS_OFFLINE; status <=ID_STATUS_OUTTOLUNCH; status++ ) { - tvis.item.lParam = status - ID_STATUS_OFFLINE; - tvis.item.pszText = (TCHAR*) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM) status,GSMDF_TCHAR); - tvis.item.stateMask = TVIS_STATEIMAGEMASK; - tvis.item.state = INDEXTOSTATEIMAGEMASK(( style & ( 1 << tvis.item.lParam )) != 0 ? 2 : 1 ); - TreeView_InsertItem( hwndTree, &tvis ); - } -} - -DWORD MakeCheckBoxTreeFlags(HWND hwndTree) -{ - DWORD flags=0; - - logmsg("MakeCheckBoxTreeFlags"); - - TVITEM tvi; - tvi.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_STATE; - tvi.hItem=TreeView_GetRoot(hwndTree); - while(tvi.hItem) { - TreeView_GetItem(hwndTree,&tvi); - if(((tvi.state&TVIS_STATEIMAGEMASK)>>12==2)) flags|=1<align=db_get_b(NULL,THIS_MODULE, "align", DEFAULT_ALIGN); - ps->salign=db_get_b(NULL,THIS_MODULE, "salign", DEFAULT_SALIGN); - ps->altShadow=db_get_b(NULL,THIS_MODULE, "altShadow", DEFAULT_ALTSHADOW); - ps->transparent=db_get_b(NULL,THIS_MODULE, "transparent", DEFAULT_TRANPARENT); - ps->showShadow=db_get_b(NULL,THIS_MODULE, "showShadow", DEFAULT_SHOWSHADOW); - ps->messages=db_get_b(NULL,THIS_MODULE, "messages", DEFAULT_ANNOUNCEMESSAGES); - ps->a_user=db_get_b(NULL,THIS_MODULE, "a_user", DEFAULT_ANNOUNCESTATUS); - ps->distance=db_get_b(NULL,THIS_MODULE, "distance", DEFAULT_DISTANCE); - ps->winx=db_get_dw(NULL,THIS_MODULE, "winx", DEFAULT_WINX); - ps->winy=db_get_dw(NULL,THIS_MODULE, "winy", DEFAULT_WINY); - ps->winxpos=db_get_dw(NULL,THIS_MODULE, "winxpos", DEFAULT_WINXPOS); - ps->winypos=db_get_dw(NULL,THIS_MODULE, "winypos", DEFAULT_WINYPOS); - ps->alpha=db_get_b(NULL,THIS_MODULE, "alpha", DEFAULT_ALPHA); - ps->showmystatus=db_get_b(NULL,THIS_MODULE, "showMyStatus", DEFAULT_SHOWMYSTATUS); - ps->timeout=db_get_dw(NULL,THIS_MODULE, "timeout", DEFAULT_TIMEOUT); - ps->clr_msg=db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG); - ps->clr_status=db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS); - ps->clr_shadow=db_get_dw(NULL,THIS_MODULE, "clr_shadow", DEFAULT_CLRSHADOW); - ps->bkclr=db_get_dw(NULL,THIS_MODULE, "bkclr", DEFAULT_BKCLR); - - ps->showMsgWindow=db_get_b(NULL,THIS_MODULE, "showMessageWindow", DEFAULT_SHOWMSGWIN); - ps->showWhen=db_get_dw(NULL,THIS_MODULE,"showWhen", DEFAULT_SHOWWHEN); - - DBVARIANT dbv; - if (!db_get_ts( NULL, THIS_MODULE, "message_format", &dbv )) { - _tcscpy(ps->msgformat, dbv.ptszVal); - db_free(&dbv); - } - else _tcscpy(ps->msgformat, DEFAULT_MESSAGEFORMAT); - - ps->announce=db_get_dw(NULL,THIS_MODULE,"announce", DEFAULT_ANNOUNCE); - - ps->lf.lfHeight=db_get_dw(NULL,THIS_MODULE, "fntHeight", DEFAULT_FNT_HEIGHT); - ps->lf.lfWidth=db_get_dw(NULL,THIS_MODULE, "fntWidth", DEFAULT_FNT_WIDTH); - ps->lf.lfEscapement=db_get_dw(NULL,THIS_MODULE, "fntEscapement", DEFAULT_FNT_ESCAPEMENT); - ps->lf.lfOrientation=db_get_dw(NULL,THIS_MODULE, "fntOrientation", DEFAULT_FNT_ORIENTATION); - ps->lf.lfWeight=db_get_dw(NULL,THIS_MODULE, "fntWeight", DEFAULT_FNT_WEIGHT); - ps->lf.lfItalic=db_get_b(NULL,THIS_MODULE, "fntItalic", DEFAULT_FNT_ITALIC); - ps->lf.lfUnderline=db_get_b(NULL,THIS_MODULE, "fntUnderline", DEFAULT_FNT_UNDERLINE); - ps->lf.lfStrikeOut=db_get_b(NULL,THIS_MODULE, "fntStrikeout", DEFAULT_FNT_STRIKEOUT); - ps->lf.lfCharSet=db_get_b(NULL,THIS_MODULE, "fntCharSet", DEFAULT_FNT_CHARSET); - ps->lf.lfOutPrecision=db_get_b(NULL,THIS_MODULE, "fntOutPrecision", DEFAULT_FNT_OUTPRECISION); - ps->lf.lfClipPrecision=db_get_b(NULL,THIS_MODULE, "fntClipPrecision", DEFAULT_FNT_CLIPRECISION); - ps->lf.lfQuality=db_get_b(NULL,THIS_MODULE, "fntQuality", DEFAULT_FNT_QUALITY); - ps->lf.lfPitchAndFamily=db_get_b(NULL,THIS_MODULE, "fntPitchAndFamily", DEFAULT_FNT_PITCHANDFAM); - - if(!db_get_ts(NULL,THIS_MODULE,"fntFaceName",&dbv)) { - _tcscpy(ps->lf.lfFaceName, dbv.ptszVal); - db_free(&dbv); - } - else - _tcscpy(ps->lf.lfFaceName, DEFAULT_FNT_FACENAME); -} - -void saveDBSettings(plgsettings *ps) -{ - logmsg("saveDBSettings"); - - db_set_b(NULL,THIS_MODULE,"showShadow", ps->showShadow); - db_set_b(NULL,THIS_MODULE,"altShadow",ps->altShadow); - db_set_b(NULL,THIS_MODULE,"distance",ps->distance); - - db_set_dw(NULL,THIS_MODULE,"winx",ps->winx); - db_set_dw(NULL,THIS_MODULE,"winy",ps->winy); - db_set_dw(NULL,THIS_MODULE,"winxpos", ps->winxpos); - db_set_dw(NULL,THIS_MODULE,"winypos", ps->winypos); - - db_set_b(NULL,THIS_MODULE,"alpha",ps->alpha); - db_set_dw(NULL,THIS_MODULE,"timeout", ps->timeout); - - db_set_b(NULL,THIS_MODULE,"transparent",ps->transparent); - db_set_b(NULL,THIS_MODULE,"messages",ps->messages); - db_set_b(NULL,THIS_MODULE,"a_user",ps->a_user); - db_set_ts(NULL,THIS_MODULE, "message_format", ps->msgformat); - - db_set_b(NULL,THIS_MODULE,"align",ps->align); - db_set_b(NULL,THIS_MODULE,"salign",ps->salign); - - db_set_b(NULL,THIS_MODULE,"showMyStatus",ps->showmystatus); - - db_set_dw(NULL,THIS_MODULE,"clr_msg", ps->clr_msg); - db_set_dw(NULL,THIS_MODULE,"clr_shadow", ps->clr_shadow); - db_set_dw(NULL,THIS_MODULE,"clr_status", ps->clr_status); - db_set_dw(NULL,THIS_MODULE,"bkclr", ps->bkclr); - - db_set_dw(NULL,THIS_MODULE, "fntHeight", ps->lf.lfHeight); - db_set_dw(NULL,THIS_MODULE, "fntWidth", ps->lf.lfWidth); - db_set_dw(NULL,THIS_MODULE, "fntEscapement", ps->lf.lfEscapement); - db_set_dw(NULL,THIS_MODULE, "fntOrientation", ps->lf.lfOrientation); - db_set_dw(NULL,THIS_MODULE, "fntWeight", ps->lf.lfWeight); - db_set_b(NULL,THIS_MODULE, "fntItalic", ps->lf.lfItalic); - db_set_b(NULL,THIS_MODULE, "fntUnderline", ps->lf.lfUnderline); - db_set_b(NULL,THIS_MODULE, "fntStrikeout", ps->lf.lfStrikeOut); - db_set_b(NULL,THIS_MODULE, "fntCharSet", ps->lf.lfCharSet); - db_set_b(NULL,THIS_MODULE, "fntOutPrecision", ps->lf.lfOutPrecision); - db_set_b(NULL,THIS_MODULE, "fntClipPrecision", ps->lf.lfClipPrecision); - db_set_b(NULL,THIS_MODULE, "fntQuality", ps->lf.lfQuality); - db_set_b(NULL,THIS_MODULE, "fntPitchAndFamily", ps->lf.lfPitchAndFamily); - db_set_ts(NULL,THIS_MODULE, "fntFaceName", ps->lf.lfFaceName); - - db_set_dw(NULL,THIS_MODULE,"announce", ps->announce); - - db_set_b(NULL,THIS_MODULE, "showMessageWindow", ps->showMsgWindow); - db_set_dw(NULL,THIS_MODULE,"showWhen", ps->showWhen); -} - -INT_PTR CALLBACK OptDlgProc(HWND hDlg,UINT msg,WPARAM wparam,LPARAM lparam) -{ - RECT rect; - plgsettings *ps; //0: current; 1: original - - logmsg("OptDlgProc"); - - switch(msg){ - case WM_INITDIALOG: - logmsg("OptDlgProc::INITDIALOG"); - TranslateDialogDefault(hDlg); - - ps=(plgsettings*)malloc(sizeof(plgsettings)*2); - loadDBSettings(&ps[0]); - ps[1]=ps[0]; - SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG)ps); - SetWindowLongPtr(hwnd, GWL_STYLE, (LONG)(pSetLayeredWindowAttributes?0:WS_CLIPSIBLINGS)|WS_POPUP|WS_SIZEBOX); - SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED); - - SetWindowLongPtr(GetDlgItem(hDlg,IDC_TREE1),GWL_STYLE,GetWindowLong(GetDlgItem(hDlg,IDC_TREE1),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES); - SetWindowLongPtr(GetDlgItem(hDlg,IDC_TREE2),GWL_STYLE,GetWindowLong(GetDlgItem(hDlg,IDC_TREE1),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES); - - CheckDlgButton(hDlg, IDC_RADIO1+ps->align-1, BST_CHECKED); - CheckDlgButton(hDlg, IDC_RADIO10+9-ps->salign, BST_CHECKED); - CheckDlgButton(hDlg, IDC_CHECK1, ps->altShadow); - CheckDlgButton(hDlg, IDC_CHECK2, ps->showMsgWindow); - CheckDlgButton(hDlg, IDC_CHECK3, ps->transparent); - CheckDlgButton(hDlg, IDC_CHECK4, ps->showShadow); - CheckDlgButton(hDlg, IDC_CHECK5, ps->messages); - - SetDlgItemText(hDlg, IDC_EDIT2, ps->msgformat); - - CheckDlgButton(hDlg, IDC_CHECK6, ps->a_user); - CheckDlgButton(hDlg, IDC_CHECK7, ps->showmystatus); - SetDlgItemInt(hDlg, IDC_EDIT1, ps->distance, 0); - - SendDlgItemMessage(hDlg, IDC_SLIDER1, TBM_SETRANGE, (WPARAM)0, MAKELONG(0, 255)); - SendDlgItemMessage(hDlg, IDC_SLIDER1, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)ps->alpha); - - { - TCHAR buf[20]; - mir_sntprintf(buf, SIZEOF(buf), _T("%d %%"), ps->alpha*100/255); - SetDlgItemText(hDlg, IDC_ALPHATXT, buf); - } - - SetDlgItemInt(hDlg, IDC_EDIT5, ps->timeout, 0); - FillCheckBoxTree(GetDlgItem(hDlg, IDC_TREE1), ps->announce); - FillCheckBoxTree(GetDlgItem(hDlg, IDC_TREE2), ps->showWhen); - return 0; - - case WM_HSCROLL: - if (LOWORD(wparam)==SB_ENDSCROLL||LOWORD(wparam)==SB_THUMBPOSITION||LOWORD(wparam)==SB_ENDSCROLL) - return 0; - ps=(plgsettings*)GetWindowLongPtr(hDlg, GWLP_USERDATA); - ps->alpha=SendDlgItemMessage(hDlg, IDC_SLIDER1, TBM_GETPOS, 0, 0); - { - TCHAR buf[20]; - mir_sntprintf(buf, SIZEOF(buf), _T("%d %%"), ps->alpha*100/255); - SetDlgItemText(hDlg, IDC_ALPHATXT, buf); - } - goto xxx; - case WM_DESTROY: - logmsg("OptDlgProc::DESTROY"); - ps=(plgsettings*)GetWindowLongPtr(hDlg, GWLP_USERDATA); - ps[0]=ps[1]; - saveDBSettings(&ps[0]); - - SetWindowLongPtr(hwnd, GWL_STYLE, (LONG)(pSetLayeredWindowAttributes?0:WS_CLIPSIBLINGS)|WS_POPUP); - SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED); - - SetWindowPos(hwnd, 0, ps->winxpos, ps->winypos, ps->winx, ps->winy, SWP_NOZORDER|SWP_NOACTIVATE); - if (pSetLayeredWindowAttributes) - pSetLayeredWindowAttributes(hwnd, ps->bkclr, ps->alpha, (ps->transparent?LWA_COLORKEY:0)|LWA_ALPHA); - - free((void*)GetWindowLongPtr(hDlg, GWLP_USERDATA)); - return 0; - case WM_COMMAND: - logmsg("OptDlgProc::COMMAND"); - ps=(plgsettings*)GetWindowLongPtr(hDlg, GWLP_USERDATA); - switch (LOWORD(wparam)) { - case IDC_BUTTON7: - MessageBox(hDlg, _T("Variables:\n %n : Nick\n %m : Message\n %l : New line"), _T("Help"), MB_ICONINFORMATION|MB_OK); - return 0; - case IDC_BUTTON5: - SendMessage(hwnd, WM_USER+1, (WPARAM)_T("miranda is gr8 and this is a long message ;-)"), 0); - break; - case IDC_BUTTON1: - selectFont(hDlg, &(ps->lf)); - break; - case IDC_BUTTON2: - selectColor(hDlg, &ps->clr_status); - break; - case IDC_BUTTON6: - selectColor(hDlg, &ps->clr_msg); - break; - case IDC_BUTTON3: - selectColor(hDlg, &ps->clr_shadow); - break; - case IDC_BUTTON4: - selectColor(hDlg, &ps->bkclr); - break; - case IDC_CHECK4: - ps->showShadow=IsDlgButtonChecked(hDlg, IDC_CHECK4); - break; - case IDC_CHECK1: - ps->altShadow=IsDlgButtonChecked(hDlg, IDC_CHECK1); - break; - case IDC_CHECK2: - ps->showMsgWindow=IsDlgButtonChecked(hDlg, IDC_CHECK2); - case IDC_EDIT1: - ps->distance=GetDlgItemInt(hDlg, IDC_EDIT1, 0, 0); - break; - case IDC_EDIT5: - ps->timeout=GetDlgItemInt(hDlg, IDC_EDIT5, 0, 0); - break; - case IDC_CHECK3: - ps->transparent=IsDlgButtonChecked(hDlg, IDC_CHECK3); - break; - case IDC_CHECK5: - ps->messages=IsDlgButtonChecked(hDlg, IDC_CHECK5); - break; - case IDC_CHECK6: - ps->a_user=IsDlgButtonChecked(hDlg, IDC_CHECK6); - break; - case IDC_CHECK7: - ps->showmystatus=IsDlgButtonChecked(hDlg, IDC_CHECK7); - break; - case IDC_RADIO1: - case IDC_RADIO2: - case IDC_RADIO3: - case IDC_RADIO4: - case IDC_RADIO5: - case IDC_RADIO6: - case IDC_RADIO7: - case IDC_RADIO8: - case IDC_RADIO9: - if (IsDlgButtonChecked(hDlg, LOWORD(wparam))) - ps->align=LOWORD(wparam)-IDC_RADIO1+1; - break; - case IDC_RADIO10: - case IDC_RADIO11: - case IDC_RADIO12: - case IDC_RADIO13: - case IDC_RADIO14: - case IDC_RADIO15: - case IDC_RADIO16: - case IDC_RADIO17: - case IDC_RADIO18: - if (IsDlgButtonChecked(hDlg, LOWORD(wparam))) - ps->salign=10-(LOWORD(wparam)-IDC_RADIO10+1); - break; - } -xxx: - saveDBSettings(ps); - SetWindowPos(hwnd, 0, 0, 0, ps->winx, ps->winy, SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE); - if (pSetLayeredWindowAttributes) - pSetLayeredWindowAttributes(hwnd, db_get_dw(NULL,THIS_MODULE, "bkclr", DEFAULT_BKCLR), db_get_b(NULL,THIS_MODULE, "alpha", DEFAULT_ALPHA), (db_get_b(NULL,THIS_MODULE, "transparent", DEFAULT_TRANPARENT)?LWA_COLORKEY:0)|LWA_ALPHA); - InvalidateRect(hwnd, 0, TRUE); - SendMessage(GetParent(hDlg),PSM_CHANGED,0,0); - - return 0; - - case WM_NOTIFY: - logmsg("OptDlgProc::NOTIFY"); - switch(((LPNMHDR)lparam)->code){ - case TVN_SETDISPINFO: - case NM_CLICK: - case NM_RETURN: - case TVN_SELCHANGED: - if (((LPNMHDR)lparam)->idFrom==IDC_TREE1) - SendMessage(GetParent(hDlg),PSM_CHANGED,0,0); - break; - case PSN_APPLY: - ps=(plgsettings*)GetWindowLongPtr(hDlg, GWLP_USERDATA); - - GetWindowRect(hwnd, &rect); - ps->winx=rect.right-rect.left; - ps->winy=rect.bottom-rect.top; - ps->winxpos=rect.left; - ps->winypos=rect.top; - ps->announce=MakeCheckBoxTreeFlags(GetDlgItem(hDlg, IDC_TREE1)); - ps->showWhen=MakeCheckBoxTreeFlags(GetDlgItem(hDlg, IDC_TREE2)); - GetDlgItemText(hDlg, IDC_EDIT2, ps->msgformat, 255); - ps[1]=ps[0]; //apply current settings at closing - - saveDBSettings(ps); - if (pSetLayeredWindowAttributes) - pSetLayeredWindowAttributes(hwnd, db_get_dw(NULL,THIS_MODULE, "bkclr", DEFAULT_BKCLR), db_get_b(NULL,THIS_MODULE, "alpha", DEFAULT_ALPHA), (db_get_b(NULL,THIS_MODULE, "transparent", DEFAULT_TRANPARENT)?LWA_COLORKEY:0)|LWA_ALPHA); - InvalidateRect(hwnd, 0, TRUE); - break; - } - break; - } - - return 0; -} - -int OptionsInit(WPARAM wparam,LPARAM) -{ - OPTIONSDIALOGPAGE odp = { sizeof(odp) }; - odp.position=150000000; - odp.groupPosition=950000000; - odp.hInstance=hI; - odp.pszTemplate=MAKEINTRESOURCEA(IDD_DIALOG1); - odp.ptszGroup=LPGENT("Plugins"); - odp.ptszTitle=LPGENT("OSD"); - odp.pfnDlgProc=OptDlgProc; - odp.flags=ODPF_BOLDGROUPS|ODPF_TCHAR; - Options_AddPage(wparam,&odp); - return 0; -} diff --git a/plugins/wbOSD/readme.txt b/plugins/wbOSD/readme.txt deleted file mode 100644 index 09815bf989..0000000000 --- a/plugins/wbOSD/readme.txt +++ /dev/null @@ -1,84 +0,0 @@ -Wannabe (Miranda's) OSD -(c)2005 Andrej Krutak -Distribute under the GNU GPL 2.0 license - -======================================================= - -Hello there, I'm happy you are trying out my OSD plugin... I've just started -to make it (in fact, it's the first miranda plugin i ever made ;-) so please -excuse bugs etc. (but you may report them, of course ;-) - -The plugin is trying to implement all the functionality of the 'old' OSD plugin. -However, I never got to it's documentation, so I can't tell if everything's gonna -work the way it should... Let me know :o) - -And I'll be happy if you send some suggestions/code parts etc., but please, -send it into the forum of this project on miranda's web ;-) - - - -------| Short tips: |---------------------------------- - -Moving the OSD: -Simply drag it by pressing left mouse button and then move the cursor ;-) -Note that only position changes done while settings dialog is shown are -saved. - -Closing the actual OSD: -Press the right button over the OSD - that will close the OSD and -show a message window for the contact who caused the OSD activity. - - - -------| Changelog: |----------------------------------- - -0.2.0.5 - New: Enable/disable OSD announces for specific own statuses - Fix: User interface improvemets... - Fix: used 100% of the processor time sometimes - -0.2.0.1 - Fix: Help button - Fix: Translation of status announces - -0.2.0.0 - Fix: multiline output - New: separate color for status & message announces - New: by pressing the right mouse button you can send message - New: message announce format can be customized a little - Fix: User interface improvemets... - Fix: again a little bit more compatible to win9x ;-) - Info: The unicode version might be broken, sorry if it is - -0.1.5.0 - New: unicode support (thanx to SilverCircle) - New: multiline output (thanx to SilverCircle) - (Hopefully)Fix: win9x-workaround memory leak -0.1.0.0 - New: more comfortable OSD positioning - New: possibility to not show own status changes - New: translation support - Fix: should work under win9x, however the transparency doesn't work well - Fix: some small bugfixes (e.g. saving of announce settings) ;-) - -0.0.2.0 - New: some more documentation - New: settings applied to osd instantly, saved after apply - New: user offline notification - Fix: only showing status of people in the contact list - -0.0.1.1 - Tiny little fix ;-) - -0.0.1.0 - Initial release - - - - -------| Some TODOs: |---------------------------------- - -* different color schemes for messages/online notifications etc. (in progess) -* test (and make work in case it doesn't) under other os than winxp -* add some other formatting options (not sure if it's worth the work) -* other things ;-) diff --git a/plugins/wbOSD/res/version.rc b/plugins/wbOSD/res/version.rc new file mode 100644 index 0000000000..5bfbab4754 --- /dev/null +++ b/plugins/wbOSD/res/version.rc @@ -0,0 +1,38 @@ +// Microsoft Visual C++ generated resource script. +// +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + +#include "afxres.h" +#include "..\src\version.h" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "FileDescription", __DESCRIPTION + VALUE "InternalName", __PLUGIN_NAME + VALUE "LegalCopyright", __COPYRIGHT + VALUE "OriginalFilename", __FILENAME + VALUE "ProductName", __PLUGIN_NAME + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/plugins/wbOSD/res/wbOSD.rc b/plugins/wbOSD/res/wbOSD.rc new file mode 100644 index 0000000000..501a1df0a9 --- /dev/null +++ b/plugins/wbOSD/res/wbOSD.rc @@ -0,0 +1,188 @@ +// Microsoft Visual C++ generated resource script. +// +#include "..\src\resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Slovak resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SKY) +#ifdef _WIN32 +LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT +#pragma code_page(1250) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DIALOG1 DIALOGEX 0, 0, 316, 250 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION +CAPTION "Dialog" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "Radio1",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | + WS_GROUP,21,22,8,8 + CONTROL "Radio1",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,39,22,8, + 8 + CONTROL "Radio1",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,59,22,8, + 8 + CONTROL "Radio1",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,21,33,8, + 8 + CONTROL "Radio1",IDC_RADIO5,"Button",BS_AUTORADIOBUTTON,39,33,8, + 8 + CONTROL "Radio1",IDC_RADIO6,"Button",BS_AUTORADIOBUTTON,59,33,8, + 8 + CONTROL "Radio1",IDC_RADIO7,"Button",BS_AUTORADIOBUTTON,21,45,8, + 8 + CONTROL "Radio1",IDC_RADIO8,"Button",BS_AUTORADIOBUTTON,39,45,8, + 8 + CONTROL "Radio1",IDC_RADIO9,"Button",BS_AUTORADIOBUTTON,59,45,8, + 8 + PUSHBUTTON "Select font",IDC_BUTTON1,80,17,68,14 + PUSHBUTTON "Text color",IDC_BUTTON2,175,91,68,14 + PUSHBUTTON "Background color",IDC_BUTTON4,11,182,67,14 + CONTROL "Transparent",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,11,199,72,10 + CONTROL "Radio1",IDC_RADIO10,"Button",BS_AUTORADIOBUTTON | + WS_GROUP,21,99,8,8 + CONTROL "Radio1",IDC_RADIO11,"Button",BS_AUTORADIOBUTTON,39,99,8, + 8 + CONTROL "Radio1",IDC_RADIO12,"Button",BS_AUTORADIOBUTTON,59,99,8, + 8 + CONTROL "Radio1",IDC_RADIO13,"Button",BS_AUTORADIOBUTTON,21,110, + 8,8 + CONTROL "Radio1",IDC_RADIO14,"Button",BS_AUTORADIOBUTTON,39,110, + 8,8 + CONTROL "Radio1",IDC_RADIO15,"Button",BS_AUTORADIOBUTTON,59,110, + 8,8 + CONTROL "Radio1",IDC_RADIO16,"Button",BS_AUTORADIOBUTTON,21,121, + 8,8 + CONTROL "Radio1",IDC_RADIO17,"Button",BS_AUTORADIOBUTTON,39,121, + 8,8 + CONTROL "Radio1",IDC_RADIO18,"Button",BS_AUTORADIOBUTTON,59,121, + 8,8 + PUSHBUTTON "Shadow color",IDC_BUTTON3,80,92,67,14 + CONTROL "Alternative shadow",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,13,135,133,10 + EDITTEXT IDC_EDIT1,79,148,27,14,ES_AUTOHSCROLL | ES_NUMBER + GROUPBOX "Shadow align",IDC_STATIC,13,89,62,43 + GROUPBOX "General",IDC_STATIC,6,0,150,66 + GROUPBOX "Shadow",IDC_STATIC,5,70,151,99 + GROUPBOX "Align",IDC_STATIC,13,13,61,43 + LTEXT "Shadow distance:",IDC_STATIC,10,151,64,8, + SS_PATHELLIPSIS,WS_EX_RIGHT + GROUPBOX "Other",IDC_STATIC,5,171,152,75 + LTEXT "Alpha:",IDC_STATIC,92,183,60,8,SS_PATHELLIPSIS + GROUPBOX "Announce",IDC_STATIC,162,0,150,246 + LTEXT "Timeout (ms):",IDC_STATIC,91,213,62,8,SS_PATHELLIPSIS + EDITTEXT IDC_EDIT5,91,224,27,14,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "",IDC_TREE1,"SysTreeView32",TVS_DISABLEDRAGDROP | + TVS_NOTOOLTIPS | WS_BORDER | WS_TABSTOP | 0x4000,170,22, + 138,55 + CONTROL "Show",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 13,80,85,10 + CONTROL "Show events",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,167,110,139,10 + CONTROL "Status changes",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,167,10,136,10 + PUSHBUTTON "Show testing OSD",IDC_BUTTON5,11,224,67,14 + CONTROL "Show my status changes",IDC_CHECK7,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,175,80,133,10 + CONTROL "Show message window after click",IDC_CHECK2,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,167,156,138,10 + CONTROL "",IDC_SLIDER1,"msctls_trackbar32",TBS_BOTH | + TBS_NOTICKS | WS_TABSTOP,87,193,45,15 + LTEXT "Static",IDC_ALPHATXT,136,195,17,8 + PUSHBUTTON "Text color",IDC_BUTTON6,175,121,68,14 + EDITTEXT IDC_EDIT2,214,137,81,14,ES_AUTOHSCROLL + LTEXT "Format:",IDC_STATIC,177,140,35,8 + PUSHBUTTON "?",IDC_BUTTON7,298,137,10,14 + CONTROL "",IDC_TREE2,"SysTreeView32",TVS_DISABLEDRAGDROP | + TVS_NOTOOLTIPS | WS_BORDER | WS_TABSTOP | 0x4000,170,182, + 138,59 + LTEXT "Show when my status is:",IDC_STATIC,168,171,139,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_DIALOG1, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 309 + TOPMARGIN, 7 + BOTTOMMARGIN, 243 + END +END +#endif // APSTUDIO_INVOKED + +#endif // Slovak resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "..\\src\\resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/plugins/wbOSD/resource.h b/plugins/wbOSD/resource.h deleted file mode 100644 index 64e57a5dfa..0000000000 --- a/plugins/wbOSD/resource.h +++ /dev/null @@ -1,57 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by wbOSD.rc -// -#define IDD_DIALOG1 101 -#define IDC_BUTTON1 1001 -#define IDC_BUTTON2 1002 -#define IDC_BUTTON3 1003 -#define IDC_BUTTON6 1004 -#define IDC_BUTTON4 1008 -#define IDC_EDIT1 1009 -#define IDC_CHECK1 1010 -#define IDC_CHECK3 1013 -#define IDC_EDIT4 1015 -#define IDC_EDIT5 1016 -#define IDC_CHECK4 1017 -#define IDC_TREE1 1018 -#define IDC_CHECK5 1019 -#define IDC_CHECK6 1020 -#define IDC_BUTTON5 1021 -#define IDC_CHECK7 1022 -#define IDC_CHECK8 1023 -#define IDC_CHECK2 1023 -#define IDC_SLIDER1 1024 -#define IDC_ALPHATXT 1025 -#define IDC_EDIT2 1027 -#define IDC_BUTTON7 1028 -#define IDC_TREE2 1029 -#define IDC_RADIO1 1101 -#define IDC_RADIO2 1102 -#define IDC_RADIO3 1103 -#define IDC_RADIO4 1104 -#define IDC_RADIO5 1105 -#define IDC_RADIO6 1106 -#define IDC_RADIO7 1107 -#define IDC_RADIO8 1108 -#define IDC_RADIO9 1109 -#define IDC_RADIO10 1120 -#define IDC_RADIO11 1121 -#define IDC_RADIO12 1122 -#define IDC_RADIO13 1123 -#define IDC_RADIO14 1124 -#define IDC_RADIO15 1125 -#define IDC_RADIO16 1126 -#define IDC_RADIO17 1127 -#define IDC_RADIO18 1128 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1029 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp new file mode 100644 index 0000000000..83d5d79c6b --- /dev/null +++ b/plugins/wbOSD/src/events.cpp @@ -0,0 +1,208 @@ +/* +Wannabe OSD +This plugin tries to become miranda's standard OSD ;-) + +(C) 2005 Andrej Krutak + +Distributed under GNU's GPL 2 or later +*/ + +#include "wbOSD.h" +#include + +extern HWND hwnd; +extern HANDLE hHookContactStatusChanged; + +void logmsg2(char *str) +{ + FILE *f=fopen("c:\\logm.txt", "a"); + fprintf(f, "%s\n", str); + fclose(f); +} + +void showmsgwnd(unsigned int param) +{ + logmsg("showmsgwnd"); + if (db_get_b(NULL,THIS_MODULE, "showMessageWindow", DEFAULT_SHOWMSGWIN)) + CallService(MS_MSG_SENDMESSAGET, (WPARAM)param, 0); +} + +LRESULT ShowOSD(TCHAR *str, int timeout, COLORREF color, HANDLE user) +{ + logmsg("ShowOSD"); + + if (!hwnd) + return 0; + + if (timeout==0) + timeout=db_get_dw(NULL,THIS_MODULE, "timeout", DEFAULT_TIMEOUT); + + osdmsg om; + om.text=str; + om.timeout=timeout; + om.color=color; + om.param=(unsigned int)user; + om.callback=showmsgwnd; + + return SendMessage(hwnd, WM_USER+4, (WPARAM)&om, 0); +} + +int ProtoAck(WPARAM,LPARAM lparam) +{ + ACKDATA *ack=(ACKDATA *)lparam; + + logmsg("ProtoAck"); + + if (!db_get_b(NULL,THIS_MODULE, "a_user", DEFAULT_ANNOUNCESTATUS)) + return 0; + + if (!(db_get_dw(NULL,THIS_MODULE,"showWhen", DEFAULT_SHOWWHEN)&(1<<(db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE)-ID_STATUS_OFFLINE)))) + return 0; + + if ( ack->type == ACKTYPE_STATUS ) { + if (!db_get_b(NULL,THIS_MODULE, "showMyStatus", DEFAULT_SHOWMYSTATUS)) + return 0; + + if ( ack->result == ACKRESULT_SUCCESS && (LPARAM)ack->hProcess != ack->lParam ) { + DWORD ann = db_get_dw( NULL, THIS_MODULE, "announce", DEFAULT_ANNOUNCE ); + if ( ann & ( 1 << ( ack->lParam - ID_STATUS_OFFLINE ))) { + TCHAR buffer[512]; + mir_sntprintf(buffer, SIZEOF(buffer), TranslateT("%s is %s"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ack->hContact, GCDNF_TCHAR), CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM) ack->lParam,GSMDF_TCHAR)); + ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), ack->hContact); + } } } + + return 0; +} + +int ContactSettingChanged(WPARAM wParam,LPARAM lParam) +{ + HANDLE hContact = (HANDLE) wParam; + DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam; + + logmsg("ContactSettingChanged1"); + + if(hContact==NULL || lstrcmpA(cws->szSetting,"Status")) return 0; + + WORD newStatus = cws->value.wVal; + WORD oldStatus = DBGetContactSettingRangedWord(hContact,"UserOnline","OldStatus2",ID_STATUS_OFFLINE, ID_STATUS_MIN, ID_STATUS_MAX); + + if (oldStatus == newStatus) return 0; + + logmsg("ContactSettingChanged2"); + + db_set_w(hContact,"UserOnline","OldStatus2", newStatus); + + if(CallService(MS_IGNORE_ISIGNORED,wParam,IGNOREEVENT_USERONLINE)) return 0; + + DWORD dwStatuses = MAKELPARAM(oldStatus, newStatus); + NotifyEventHooks(hHookContactStatusChanged, wParam, (LPARAM)dwStatuses); + + return 0; +} + +int ContactStatusChanged(WPARAM wParam, LPARAM lParam) +{ + HANDLE hContact = (HANDLE) wParam; + WORD oldStatus = LOWORD(lParam); + WORD newStatus = HIWORD(lParam); + DWORD ann=db_get_dw(NULL,THIS_MODULE,"announce", DEFAULT_ANNOUNCE); + + logmsg("ContactStatusChanged1"); + + if (!db_get_b(NULL,THIS_MODULE, "a_user", DEFAULT_ANNOUNCESTATUS)) + return 0; + + if (!(db_get_dw(NULL,THIS_MODULE,"showWhen", DEFAULT_SHOWWHEN)&(1<<(db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE)-ID_STATUS_OFFLINE)))) + return 0; + + if (!(ann&(1<<(newStatus-ID_STATUS_OFFLINE))) ) + return 0; + + logmsg("ContactStatusChanged2"); + + if (db_get_b(hContact,"CList","NotOnList",0) || db_get_b(hContact,"CList","Hidden",0) || + (CallService(MS_IGNORE_ISIGNORED,wParam,IGNOREEVENT_USERONLINE) && newStatus==ID_STATUS_ONLINE) + ) + return 0; + + TCHAR bufferW[512]; + mir_sntprintf(bufferW, SIZEOF(bufferW), TranslateT("%s is %s"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, wParam, GCDNF_TCHAR), CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,newStatus,GSMDF_TCHAR)); + ShowOSD(bufferW, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), hContact); + return 0; +} + +int HookedNewEvent(WPARAM wParam, LPARAM lParam) +{ + logmsg("HookedNewEvent1"); + HANDLE hDBEvent = (HANDLE) lParam; + DBEVENTINFO dbe; + dbe.cbSize = sizeof(dbe); + dbe.cbBlob = db_event_getBlobSize(hDBEvent); + if (dbe.cbBlob == -1) + return 0; + + dbe.pBlob = (PBYTE) malloc(dbe.cbBlob); + if(db_event_get(hDBEvent,&dbe)) + return 0; + + if (dbe.flags & DBEF_SENT || dbe.eventType == 25368) + return 0; + + if (db_get_b(NULL,THIS_MODULE, "messages", DEFAULT_ANNOUNCEMESSAGES)==0) + return 0; + + if (!(db_get_dw(NULL,THIS_MODULE,"showWhen", DEFAULT_SHOWWHEN)&(1<<(db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE)-ID_STATUS_OFFLINE)))) + return 0; + + logmsg("HookedNewEvent2"); + + TCHAR buf[512]; + _tcsncpy(buf, DEFAULT_MESSAGEFORMAT,SIZEOF(buf)); + + DBVARIANT dbv; + if(!db_get_ts(NULL,THIS_MODULE,"message_format",&dbv)) { + _tcscpy(buf, dbv.ptszVal); + db_free(&dbv); + } + + int i1=-1, i2=-1; + TCHAR* pbuf = buf; + while (*pbuf) { + if (*pbuf=='%') { + if (*(pbuf+1)=='n') { + if (i1==-1) + i1=1; + else i2=1; + *(pbuf+1)='s'; + } else if (*(pbuf+1)=='m') { + if (i1==-1) + i1=2; + else i2=2; + *(pbuf+1)='s'; + } else if (*(pbuf+1)=='l') { + *pbuf=0x0d; + *(pbuf+1)=0x0a; + } + } + pbuf++; + } + + TCHAR *c1 = 0, *c2 = 0; + if ( i1 == 1 ) + c1 = mir_tstrdup(( TCHAR* )CallService(MS_CLIST_GETCONTACTDISPLAYNAME, wParam, GCDNF_TCHAR)); + else if ( i1 == 2 ) + c1 = DbGetEventTextT( &dbe, 0 ); + + if ( i2 == 1 ) + c2 = mir_tstrdup(( TCHAR* )CallService(MS_CLIST_GETCONTACTDISPLAYNAME, wParam, GCDNF_TCHAR)); + else if ( i2 == 2 ) + c2 = DbGetEventTextT( &dbe, 0 ); + + TCHAR buffer[512]; + mir_sntprintf(buffer, SIZEOF(buffer), buf, c1, c2); + ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG), (HANDLE)wParam); + + mir_free( c1 ); + mir_free( c2 ); + return 0; +} diff --git a/plugins/wbOSD/src/main.cpp b/plugins/wbOSD/src/main.cpp new file mode 100644 index 0000000000..791ecb7c1f --- /dev/null +++ b/plugins/wbOSD/src/main.cpp @@ -0,0 +1,100 @@ +/* +Wannabe OSD +This plugin tries to become miranda's standard OSD ;-) + +(C) 2005 Andrej Krutak + +Distributed under GNU's GPL 2 or later +*/ + +#include "wbOSD.h" +#include "version.h" + +HINSTANCE hI; + +HWND hwnd=0; +HANDLE hservosda; +int hLangpack = 0; +HANDLE hHookedNewEvent, hHookedInit, hProtoAck, hContactSettingChanged, hHookContactStatusChanged, hContactStatusChanged, hpluginShutDown; +HINSTANCE hUser32; +BOOL (WINAPI*pSetLayeredWindowAttributes)(HWND, COLORREF, BYTE, DWORD); + +void logmsg2(char *str); +int MainInit(WPARAM,LPARAM); + +///////////////////////////////////////////////////////////////////////////////////////// + +static PLUGININFOEX pluginInfo = { + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + // {FC718BC7-ABC8-43CD-AAD9-761614617738} + { 0xfc718bc7, 0xabc8, 0x43cd, { 0xaa, 0xd9, 0x76, 0x16, 0x14, 0x61, 0x77, 0x38 } } +}; + +extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD) +{ + return &pluginInfo; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +extern "C" __declspec(dllexport) int Load() +{ + mir_getLP(&pluginInfo); + + logmsg("Load"); + pSetLayeredWindowAttributes=0; + +#ifndef FORCE_9XDRAWING + hUser32=LoadLibrary(_T("user32.dll")); +#else + hUser32=0; +#endif + + if (hUser32) { + pSetLayeredWindowAttributes=(BOOL(WINAPI*)(HWND, COLORREF, BYTE, DWORD))GetProcAddress(hUser32, "SetLayeredWindowAttributes"); + if (!pSetLayeredWindowAttributes) { + FreeLibrary(hUser32); + hUser32=0; + } + } + + hHookedInit = HookEvent(ME_SYSTEM_MODULESLOADED, MainInit); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +extern "C" __declspec(dllexport) int Unload() +{ + logmsg("Unload"); + UnhookEvent(hpluginShutDown); + UnhookEvent(hProtoAck); + UnhookEvent(hContactSettingChanged); + UnhookEvent(hContactStatusChanged); + UnhookEvent(hHookedNewEvent); + UnhookEvent(hHookedInit); + + if (hUser32) + FreeLibrary(hUser32); + pSetLayeredWindowAttributes=0; + + DestroyServiceFunction(hservosda); + DestroyHookableEvent(hHookContactStatusChanged); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +BOOL WINAPI DllMain(HINSTANCE hinst,DWORD fdwReason,LPVOID lpvReserved) +{ + hI = hinst; + return TRUE; +} diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp new file mode 100644 index 0000000000..fdc8787fa5 --- /dev/null +++ b/plugins/wbOSD/src/options.cpp @@ -0,0 +1,422 @@ +/* +Wannabe OSD +This plugin tries to become miranda's standard OSD ;-) + +(C) 2005 Andrej Krutak + +Distributed under GNU's GPL 2 or later +*/ + +#include "wbOSD.h" + +COLORREF pencustcolors[16]; + +const static osdmsg defstr={_T(""), 0, RGB(0, 0, 0), 0, 0}; + +void FillCheckBoxTree(HWND hwndTree,DWORD style) +{ + logmsg("FillCheckBoxTree"); + + TVINSERTSTRUCT tvis; + tvis.hParent = NULL; + tvis.hInsertAfter = TVI_LAST; + tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_STATE; + for ( WORD status = ID_STATUS_OFFLINE; status <=ID_STATUS_OUTTOLUNCH; status++ ) { + tvis.item.lParam = status - ID_STATUS_OFFLINE; + tvis.item.pszText = (TCHAR*) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM) status,GSMDF_TCHAR); + tvis.item.stateMask = TVIS_STATEIMAGEMASK; + tvis.item.state = INDEXTOSTATEIMAGEMASK(( style & ( 1 << tvis.item.lParam )) != 0 ? 2 : 1 ); + TreeView_InsertItem( hwndTree, &tvis ); + } +} + +DWORD MakeCheckBoxTreeFlags(HWND hwndTree) +{ + DWORD flags=0; + + logmsg("MakeCheckBoxTreeFlags"); + + TVITEM tvi; + tvi.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_STATE; + tvi.hItem=TreeView_GetRoot(hwndTree); + while(tvi.hItem) { + TreeView_GetItem(hwndTree,&tvi); + if(((tvi.state&TVIS_STATEIMAGEMASK)>>12==2)) flags|=1<align=db_get_b(NULL,THIS_MODULE, "align", DEFAULT_ALIGN); + ps->salign=db_get_b(NULL,THIS_MODULE, "salign", DEFAULT_SALIGN); + ps->altShadow=db_get_b(NULL,THIS_MODULE, "altShadow", DEFAULT_ALTSHADOW); + ps->transparent=db_get_b(NULL,THIS_MODULE, "transparent", DEFAULT_TRANPARENT); + ps->showShadow=db_get_b(NULL,THIS_MODULE, "showShadow", DEFAULT_SHOWSHADOW); + ps->messages=db_get_b(NULL,THIS_MODULE, "messages", DEFAULT_ANNOUNCEMESSAGES); + ps->a_user=db_get_b(NULL,THIS_MODULE, "a_user", DEFAULT_ANNOUNCESTATUS); + ps->distance=db_get_b(NULL,THIS_MODULE, "distance", DEFAULT_DISTANCE); + ps->winx=db_get_dw(NULL,THIS_MODULE, "winx", DEFAULT_WINX); + ps->winy=db_get_dw(NULL,THIS_MODULE, "winy", DEFAULT_WINY); + ps->winxpos=db_get_dw(NULL,THIS_MODULE, "winxpos", DEFAULT_WINXPOS); + ps->winypos=db_get_dw(NULL,THIS_MODULE, "winypos", DEFAULT_WINYPOS); + ps->alpha=db_get_b(NULL,THIS_MODULE, "alpha", DEFAULT_ALPHA); + ps->showmystatus=db_get_b(NULL,THIS_MODULE, "showMyStatus", DEFAULT_SHOWMYSTATUS); + ps->timeout=db_get_dw(NULL,THIS_MODULE, "timeout", DEFAULT_TIMEOUT); + ps->clr_msg=db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG); + ps->clr_status=db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS); + ps->clr_shadow=db_get_dw(NULL,THIS_MODULE, "clr_shadow", DEFAULT_CLRSHADOW); + ps->bkclr=db_get_dw(NULL,THIS_MODULE, "bkclr", DEFAULT_BKCLR); + + ps->showMsgWindow=db_get_b(NULL,THIS_MODULE, "showMessageWindow", DEFAULT_SHOWMSGWIN); + ps->showWhen=db_get_dw(NULL,THIS_MODULE,"showWhen", DEFAULT_SHOWWHEN); + + DBVARIANT dbv; + if (!db_get_ts( NULL, THIS_MODULE, "message_format", &dbv )) { + _tcscpy(ps->msgformat, dbv.ptszVal); + db_free(&dbv); + } + else _tcscpy(ps->msgformat, DEFAULT_MESSAGEFORMAT); + + ps->announce=db_get_dw(NULL,THIS_MODULE,"announce", DEFAULT_ANNOUNCE); + + ps->lf.lfHeight=db_get_dw(NULL,THIS_MODULE, "fntHeight", DEFAULT_FNT_HEIGHT); + ps->lf.lfWidth=db_get_dw(NULL,THIS_MODULE, "fntWidth", DEFAULT_FNT_WIDTH); + ps->lf.lfEscapement=db_get_dw(NULL,THIS_MODULE, "fntEscapement", DEFAULT_FNT_ESCAPEMENT); + ps->lf.lfOrientation=db_get_dw(NULL,THIS_MODULE, "fntOrientation", DEFAULT_FNT_ORIENTATION); + ps->lf.lfWeight=db_get_dw(NULL,THIS_MODULE, "fntWeight", DEFAULT_FNT_WEIGHT); + ps->lf.lfItalic=db_get_b(NULL,THIS_MODULE, "fntItalic", DEFAULT_FNT_ITALIC); + ps->lf.lfUnderline=db_get_b(NULL,THIS_MODULE, "fntUnderline", DEFAULT_FNT_UNDERLINE); + ps->lf.lfStrikeOut=db_get_b(NULL,THIS_MODULE, "fntStrikeout", DEFAULT_FNT_STRIKEOUT); + ps->lf.lfCharSet=db_get_b(NULL,THIS_MODULE, "fntCharSet", DEFAULT_FNT_CHARSET); + ps->lf.lfOutPrecision=db_get_b(NULL,THIS_MODULE, "fntOutPrecision", DEFAULT_FNT_OUTPRECISION); + ps->lf.lfClipPrecision=db_get_b(NULL,THIS_MODULE, "fntClipPrecision", DEFAULT_FNT_CLIPRECISION); + ps->lf.lfQuality=db_get_b(NULL,THIS_MODULE, "fntQuality", DEFAULT_FNT_QUALITY); + ps->lf.lfPitchAndFamily=db_get_b(NULL,THIS_MODULE, "fntPitchAndFamily", DEFAULT_FNT_PITCHANDFAM); + + if(!db_get_ts(NULL,THIS_MODULE,"fntFaceName",&dbv)) { + _tcscpy(ps->lf.lfFaceName, dbv.ptszVal); + db_free(&dbv); + } + else + _tcscpy(ps->lf.lfFaceName, DEFAULT_FNT_FACENAME); +} + +void saveDBSettings(plgsettings *ps) +{ + logmsg("saveDBSettings"); + + db_set_b(NULL,THIS_MODULE,"showShadow", ps->showShadow); + db_set_b(NULL,THIS_MODULE,"altShadow",ps->altShadow); + db_set_b(NULL,THIS_MODULE,"distance",ps->distance); + + db_set_dw(NULL,THIS_MODULE,"winx",ps->winx); + db_set_dw(NULL,THIS_MODULE,"winy",ps->winy); + db_set_dw(NULL,THIS_MODULE,"winxpos", ps->winxpos); + db_set_dw(NULL,THIS_MODULE,"winypos", ps->winypos); + + db_set_b(NULL,THIS_MODULE,"alpha",ps->alpha); + db_set_dw(NULL,THIS_MODULE,"timeout", ps->timeout); + + db_set_b(NULL,THIS_MODULE,"transparent",ps->transparent); + db_set_b(NULL,THIS_MODULE,"messages",ps->messages); + db_set_b(NULL,THIS_MODULE,"a_user",ps->a_user); + db_set_ts(NULL,THIS_MODULE, "message_format", ps->msgformat); + + db_set_b(NULL,THIS_MODULE,"align",ps->align); + db_set_b(NULL,THIS_MODULE,"salign",ps->salign); + + db_set_b(NULL,THIS_MODULE,"showMyStatus",ps->showmystatus); + + db_set_dw(NULL,THIS_MODULE,"clr_msg", ps->clr_msg); + db_set_dw(NULL,THIS_MODULE,"clr_shadow", ps->clr_shadow); + db_set_dw(NULL,THIS_MODULE,"clr_status", ps->clr_status); + db_set_dw(NULL,THIS_MODULE,"bkclr", ps->bkclr); + + db_set_dw(NULL,THIS_MODULE, "fntHeight", ps->lf.lfHeight); + db_set_dw(NULL,THIS_MODULE, "fntWidth", ps->lf.lfWidth); + db_set_dw(NULL,THIS_MODULE, "fntEscapement", ps->lf.lfEscapement); + db_set_dw(NULL,THIS_MODULE, "fntOrientation", ps->lf.lfOrientation); + db_set_dw(NULL,THIS_MODULE, "fntWeight", ps->lf.lfWeight); + db_set_b(NULL,THIS_MODULE, "fntItalic", ps->lf.lfItalic); + db_set_b(NULL,THIS_MODULE, "fntUnderline", ps->lf.lfUnderline); + db_set_b(NULL,THIS_MODULE, "fntStrikeout", ps->lf.lfStrikeOut); + db_set_b(NULL,THIS_MODULE, "fntCharSet", ps->lf.lfCharSet); + db_set_b(NULL,THIS_MODULE, "fntOutPrecision", ps->lf.lfOutPrecision); + db_set_b(NULL,THIS_MODULE, "fntClipPrecision", ps->lf.lfClipPrecision); + db_set_b(NULL,THIS_MODULE, "fntQuality", ps->lf.lfQuality); + db_set_b(NULL,THIS_MODULE, "fntPitchAndFamily", ps->lf.lfPitchAndFamily); + db_set_ts(NULL,THIS_MODULE, "fntFaceName", ps->lf.lfFaceName); + + db_set_dw(NULL,THIS_MODULE,"announce", ps->announce); + + db_set_b(NULL,THIS_MODULE, "showMessageWindow", ps->showMsgWindow); + db_set_dw(NULL,THIS_MODULE,"showWhen", ps->showWhen); +} + +INT_PTR CALLBACK OptDlgProc(HWND hDlg,UINT msg,WPARAM wparam,LPARAM lparam) +{ + RECT rect; + plgsettings *ps; //0: current; 1: original + + logmsg("OptDlgProc"); + + switch(msg){ + case WM_INITDIALOG: + logmsg("OptDlgProc::INITDIALOG"); + TranslateDialogDefault(hDlg); + + ps=(plgsettings*)malloc(sizeof(plgsettings)*2); + loadDBSettings(&ps[0]); + ps[1]=ps[0]; + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG)ps); + SetWindowLongPtr(hwnd, GWL_STYLE, (LONG)(pSetLayeredWindowAttributes?0:WS_CLIPSIBLINGS)|WS_POPUP|WS_SIZEBOX); + SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED); + + SetWindowLongPtr(GetDlgItem(hDlg,IDC_TREE1),GWL_STYLE,GetWindowLong(GetDlgItem(hDlg,IDC_TREE1),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES); + SetWindowLongPtr(GetDlgItem(hDlg,IDC_TREE2),GWL_STYLE,GetWindowLong(GetDlgItem(hDlg,IDC_TREE1),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES); + + CheckDlgButton(hDlg, IDC_RADIO1+ps->align-1, BST_CHECKED); + CheckDlgButton(hDlg, IDC_RADIO10+9-ps->salign, BST_CHECKED); + CheckDlgButton(hDlg, IDC_CHECK1, ps->altShadow); + CheckDlgButton(hDlg, IDC_CHECK2, ps->showMsgWindow); + CheckDlgButton(hDlg, IDC_CHECK3, ps->transparent); + CheckDlgButton(hDlg, IDC_CHECK4, ps->showShadow); + CheckDlgButton(hDlg, IDC_CHECK5, ps->messages); + + SetDlgItemText(hDlg, IDC_EDIT2, ps->msgformat); + + CheckDlgButton(hDlg, IDC_CHECK6, ps->a_user); + CheckDlgButton(hDlg, IDC_CHECK7, ps->showmystatus); + SetDlgItemInt(hDlg, IDC_EDIT1, ps->distance, 0); + + SendDlgItemMessage(hDlg, IDC_SLIDER1, TBM_SETRANGE, (WPARAM)0, MAKELONG(0, 255)); + SendDlgItemMessage(hDlg, IDC_SLIDER1, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)ps->alpha); + + { + TCHAR buf[20]; + mir_sntprintf(buf, SIZEOF(buf), _T("%d %%"), ps->alpha*100/255); + SetDlgItemText(hDlg, IDC_ALPHATXT, buf); + } + + SetDlgItemInt(hDlg, IDC_EDIT5, ps->timeout, 0); + FillCheckBoxTree(GetDlgItem(hDlg, IDC_TREE1), ps->announce); + FillCheckBoxTree(GetDlgItem(hDlg, IDC_TREE2), ps->showWhen); + return 0; + + case WM_HSCROLL: + if (LOWORD(wparam)==SB_ENDSCROLL||LOWORD(wparam)==SB_THUMBPOSITION||LOWORD(wparam)==SB_ENDSCROLL) + return 0; + ps=(plgsettings*)GetWindowLongPtr(hDlg, GWLP_USERDATA); + ps->alpha=SendDlgItemMessage(hDlg, IDC_SLIDER1, TBM_GETPOS, 0, 0); + { + TCHAR buf[20]; + mir_sntprintf(buf, SIZEOF(buf), _T("%d %%"), ps->alpha*100/255); + SetDlgItemText(hDlg, IDC_ALPHATXT, buf); + } + goto xxx; + case WM_DESTROY: + logmsg("OptDlgProc::DESTROY"); + ps=(plgsettings*)GetWindowLongPtr(hDlg, GWLP_USERDATA); + ps[0]=ps[1]; + saveDBSettings(&ps[0]); + + SetWindowLongPtr(hwnd, GWL_STYLE, (LONG)(pSetLayeredWindowAttributes?0:WS_CLIPSIBLINGS)|WS_POPUP); + SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED); + + SetWindowPos(hwnd, 0, ps->winxpos, ps->winypos, ps->winx, ps->winy, SWP_NOZORDER|SWP_NOACTIVATE); + if (pSetLayeredWindowAttributes) + pSetLayeredWindowAttributes(hwnd, ps->bkclr, ps->alpha, (ps->transparent?LWA_COLORKEY:0)|LWA_ALPHA); + + free((void*)GetWindowLongPtr(hDlg, GWLP_USERDATA)); + return 0; + case WM_COMMAND: + logmsg("OptDlgProc::COMMAND"); + ps=(plgsettings*)GetWindowLongPtr(hDlg, GWLP_USERDATA); + switch (LOWORD(wparam)) { + case IDC_BUTTON7: + MessageBox(hDlg, _T("Variables:\n %n : Nick\n %m : Message\n %l : New line"), _T("Help"), MB_ICONINFORMATION|MB_OK); + return 0; + case IDC_BUTTON5: + SendMessage(hwnd, WM_USER+1, (WPARAM)_T("miranda is gr8 and this is a long message ;-)"), 0); + break; + case IDC_BUTTON1: + selectFont(hDlg, &(ps->lf)); + break; + case IDC_BUTTON2: + selectColor(hDlg, &ps->clr_status); + break; + case IDC_BUTTON6: + selectColor(hDlg, &ps->clr_msg); + break; + case IDC_BUTTON3: + selectColor(hDlg, &ps->clr_shadow); + break; + case IDC_BUTTON4: + selectColor(hDlg, &ps->bkclr); + break; + case IDC_CHECK4: + ps->showShadow=IsDlgButtonChecked(hDlg, IDC_CHECK4); + break; + case IDC_CHECK1: + ps->altShadow=IsDlgButtonChecked(hDlg, IDC_CHECK1); + break; + case IDC_CHECK2: + ps->showMsgWindow=IsDlgButtonChecked(hDlg, IDC_CHECK2); + case IDC_EDIT1: + ps->distance=GetDlgItemInt(hDlg, IDC_EDIT1, 0, 0); + break; + case IDC_EDIT5: + ps->timeout=GetDlgItemInt(hDlg, IDC_EDIT5, 0, 0); + break; + case IDC_CHECK3: + ps->transparent=IsDlgButtonChecked(hDlg, IDC_CHECK3); + break; + case IDC_CHECK5: + ps->messages=IsDlgButtonChecked(hDlg, IDC_CHECK5); + break; + case IDC_CHECK6: + ps->a_user=IsDlgButtonChecked(hDlg, IDC_CHECK6); + break; + case IDC_CHECK7: + ps->showmystatus=IsDlgButtonChecked(hDlg, IDC_CHECK7); + break; + case IDC_RADIO1: + case IDC_RADIO2: + case IDC_RADIO3: + case IDC_RADIO4: + case IDC_RADIO5: + case IDC_RADIO6: + case IDC_RADIO7: + case IDC_RADIO8: + case IDC_RADIO9: + if (IsDlgButtonChecked(hDlg, LOWORD(wparam))) + ps->align=LOWORD(wparam)-IDC_RADIO1+1; + break; + case IDC_RADIO10: + case IDC_RADIO11: + case IDC_RADIO12: + case IDC_RADIO13: + case IDC_RADIO14: + case IDC_RADIO15: + case IDC_RADIO16: + case IDC_RADIO17: + case IDC_RADIO18: + if (IsDlgButtonChecked(hDlg, LOWORD(wparam))) + ps->salign=10-(LOWORD(wparam)-IDC_RADIO10+1); + break; + } +xxx: + saveDBSettings(ps); + SetWindowPos(hwnd, 0, 0, 0, ps->winx, ps->winy, SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE); + if (pSetLayeredWindowAttributes) + pSetLayeredWindowAttributes(hwnd, db_get_dw(NULL,THIS_MODULE, "bkclr", DEFAULT_BKCLR), db_get_b(NULL,THIS_MODULE, "alpha", DEFAULT_ALPHA), (db_get_b(NULL,THIS_MODULE, "transparent", DEFAULT_TRANPARENT)?LWA_COLORKEY:0)|LWA_ALPHA); + InvalidateRect(hwnd, 0, TRUE); + SendMessage(GetParent(hDlg),PSM_CHANGED,0,0); + + return 0; + + case WM_NOTIFY: + logmsg("OptDlgProc::NOTIFY"); + switch(((LPNMHDR)lparam)->code){ + case TVN_SETDISPINFO: + case NM_CLICK: + case NM_RETURN: + case TVN_SELCHANGED: + if (((LPNMHDR)lparam)->idFrom==IDC_TREE1) + SendMessage(GetParent(hDlg),PSM_CHANGED,0,0); + break; + case PSN_APPLY: + ps=(plgsettings*)GetWindowLongPtr(hDlg, GWLP_USERDATA); + + GetWindowRect(hwnd, &rect); + ps->winx=rect.right-rect.left; + ps->winy=rect.bottom-rect.top; + ps->winxpos=rect.left; + ps->winypos=rect.top; + ps->announce=MakeCheckBoxTreeFlags(GetDlgItem(hDlg, IDC_TREE1)); + ps->showWhen=MakeCheckBoxTreeFlags(GetDlgItem(hDlg, IDC_TREE2)); + GetDlgItemText(hDlg, IDC_EDIT2, ps->msgformat, 255); + ps[1]=ps[0]; //apply current settings at closing + + saveDBSettings(ps); + if (pSetLayeredWindowAttributes) + pSetLayeredWindowAttributes(hwnd, db_get_dw(NULL,THIS_MODULE, "bkclr", DEFAULT_BKCLR), db_get_b(NULL,THIS_MODULE, "alpha", DEFAULT_ALPHA), (db_get_b(NULL,THIS_MODULE, "transparent", DEFAULT_TRANPARENT)?LWA_COLORKEY:0)|LWA_ALPHA); + InvalidateRect(hwnd, 0, TRUE); + break; + } + break; + } + + return 0; +} + +int OptionsInit(WPARAM wparam,LPARAM) +{ + OPTIONSDIALOGPAGE odp = { sizeof(odp) }; + odp.position=150000000; + odp.groupPosition=950000000; + odp.hInstance=hI; + odp.pszTemplate=MAKEINTRESOURCEA(IDD_DIALOG1); + odp.ptszGroup=LPGENT("Plugins"); + odp.ptszTitle=LPGENT("OSD"); + odp.pfnDlgProc=OptDlgProc; + odp.flags=ODPF_BOLDGROUPS|ODPF_TCHAR; + Options_AddPage(wparam,&odp); + return 0; +} diff --git a/plugins/wbOSD/src/resource.h b/plugins/wbOSD/src/resource.h new file mode 100644 index 0000000000..64e57a5dfa --- /dev/null +++ b/plugins/wbOSD/src/resource.h @@ -0,0 +1,57 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by wbOSD.rc +// +#define IDD_DIALOG1 101 +#define IDC_BUTTON1 1001 +#define IDC_BUTTON2 1002 +#define IDC_BUTTON3 1003 +#define IDC_BUTTON6 1004 +#define IDC_BUTTON4 1008 +#define IDC_EDIT1 1009 +#define IDC_CHECK1 1010 +#define IDC_CHECK3 1013 +#define IDC_EDIT4 1015 +#define IDC_EDIT5 1016 +#define IDC_CHECK4 1017 +#define IDC_TREE1 1018 +#define IDC_CHECK5 1019 +#define IDC_CHECK6 1020 +#define IDC_BUTTON5 1021 +#define IDC_CHECK7 1022 +#define IDC_CHECK8 1023 +#define IDC_CHECK2 1023 +#define IDC_SLIDER1 1024 +#define IDC_ALPHATXT 1025 +#define IDC_EDIT2 1027 +#define IDC_BUTTON7 1028 +#define IDC_TREE2 1029 +#define IDC_RADIO1 1101 +#define IDC_RADIO2 1102 +#define IDC_RADIO3 1103 +#define IDC_RADIO4 1104 +#define IDC_RADIO5 1105 +#define IDC_RADIO6 1106 +#define IDC_RADIO7 1107 +#define IDC_RADIO8 1108 +#define IDC_RADIO9 1109 +#define IDC_RADIO10 1120 +#define IDC_RADIO11 1121 +#define IDC_RADIO12 1122 +#define IDC_RADIO13 1123 +#define IDC_RADIO14 1124 +#define IDC_RADIO15 1125 +#define IDC_RADIO16 1126 +#define IDC_RADIO17 1127 +#define IDC_RADIO18 1128 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1029 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/plugins/wbOSD/src/stdafx.cpp b/plugins/wbOSD/src/stdafx.cpp new file mode 100644 index 0000000000..68250bbb4e --- /dev/null +++ b/plugins/wbOSD/src/stdafx.cpp @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012-13 Miranda NG Project (http://miranda-ng.org) + +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 version 2 +of the License. + +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, see . +*/ + +#include "wbOSD.h" \ No newline at end of file diff --git a/plugins/wbOSD/src/version.h b/plugins/wbOSD/src/version.h new file mode 100644 index 0000000000..2282deddae --- /dev/null +++ b/plugins/wbOSD/src/version.h @@ -0,0 +1,35 @@ +/* + +'File Association Manager'-Plugin for Miranda IM + +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 (AssocMgr-License.txt); if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 2 +#define __RELEASE_NUM 1 +#define __BUILD_NUM 0 + +#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM + +#define __PLUGIN_NAME "WannaBe OSD" +#define __FILENAME "wbOSD.dll" +#define __DESCRIPTION "Shows new message/status change info using onscreen display." +#define __AUTHOR "Andrej Krutak" +#define __AUTHOREMAIL "andree182@gmail.com" +#define __AUTHORWEB "http://miranda-ng.org/" +#define __COPYRIGHT "©2005 Andrej Krutak" diff --git a/plugins/wbOSD/src/wbOSD.cpp b/plugins/wbOSD/src/wbOSD.cpp new file mode 100644 index 0000000000..9bdaf74370 --- /dev/null +++ b/plugins/wbOSD/src/wbOSD.cpp @@ -0,0 +1,309 @@ +/* +Wannabe OSD +This plugin tries to become miranda's standard OSD ;-) + +(C) 2005 Andrej Krutak + +Distributed under GNU's GPL 2 or later +*/ + +#include "wbOSD.h" + +TCHAR szClassName[] = _T("wbOSD"); +const static osdmsg defstr={_T(""), 0, RGB(0, 0, 0), 0, 0}; + +int DrawMe(HWND hwnd, TCHAR *string, COLORREF color) +{ + PAINTSTRUCT ps; + RECT rect, rect2; + UINT talign=0; + int sxo, syo; + plgsettings plgs; + + logmsg("DrawMe"); + if (!string) string=_T("bullshit"); + + loadDBSettings(&plgs); + HFONT fh=CreateFontIndirect(&(plgs.lf)); + + HDC hdc=BeginPaint(hwnd, &ps); + SetBkMode(hdc, TRANSPARENT); + + GetClientRect(hwnd, &rect); + HBRUSH bkb=CreateSolidBrush(plgs.bkclr); + FillRect(hdc, &rect, bkb); + + DeleteObject(bkb); + + HGDIOBJ oo=SelectObject(hdc, fh); + +// rect2.left=0; +// rect2.top=0; +// DrawText(hdc, string, -1, &rect2, DT_SINGLELINE|DT_CALCRECT); + rect2 = rect; + DrawText(hdc, string, -1, &rect2, DT_WORDBREAK|DT_CALCRECT); + + if (plgs.align>=1 && plgs.align<=3) + rect.top=0; + if (plgs.align>=4 && plgs.align<=6) + rect.top=(rect.bottom-rect2.bottom)/2; + if (plgs.align>=7 && plgs.align<=9) + rect.top=rect.bottom-rect2.bottom; + + if (((plgs.align-1)%3)==0) + rect.left=0; + else if (((plgs.align-2)%3)==0) + rect.left=(rect.right-rect2.right)/2; + else if (((plgs.align-3)%3)==0) + rect.left=rect.right-rect2.right; + + rect.bottom=rect.top+rect2.bottom; + rect.right=rect.left+rect2.right; + + //draw shadow + if (plgs.showShadow) { + logmsg("DrawMe::showShadow"); + if (plgs.salign>=1 && plgs.salign<=3) syo=-plgs.distance; + if (plgs.salign>=4 && plgs.salign<=6) syo=0; + if (plgs.salign>=7 && plgs.salign<=9) syo=plgs.distance; + + if (((plgs.salign-1)%3)==0) sxo=-plgs.distance; + else if (((plgs.salign-2)%3)==0) sxo=0; + else if (((plgs.salign-3)%3)==0) sxo=plgs.distance; + + SetTextColor(hdc, plgs.clr_shadow); + if (plgs.altShadow==0) { + rect2=rect; + OffsetRect(&rect, sxo, syo); + + DrawText(hdc, string, -1, &rect2, DT_WORDBREAK|talign); + } else { + rect2=rect; + rect2.left+=plgs.distance; + DrawText(hdc, string, -1, &rect2, DT_WORDBREAK|talign); + + rect2=rect; + rect2.left-=plgs.distance; + DrawText(hdc, string, -1, &rect2, DT_WORDBREAK|talign); + + rect2=rect; + rect2.top-=plgs.distance; + DrawText(hdc, string, -1, &rect2, DT_WORDBREAK|talign); + + rect2=rect; + rect2.top+=plgs.distance; + DrawText(hdc, string, -1, &rect2, DT_WORDBREAK|talign); + + OffsetRect(&rect, sxo/2, syo/2); + } + } + + //draw text + SetTextColor(hdc, color); + DrawText(hdc, string, -1, &rect, DT_WORDBREAK); + + SelectObject(hdc, oo); + DeleteObject(fh); + EndPaint(hwnd, &ps); + + return 0; +} + +LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + osdmsg* ms; + + switch (message) { + case WM_CREATE: + logmsg("WindowProcedure::CREATE"); + SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG)&defstr); + return 0; + + case WM_DESTROY: + logmsg("WindowProcedure::DESTROY"); + return 0; + + case WM_PAINT: + logmsg("WindowProcedure::PAINT"); + + ms=(osdmsg*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + if (ms) + return DrawMe(hwnd, ms->text, ms->color); + + PAINTSTRUCT ps; + BeginPaint(hwnd, &ps); + EndPaint(hwnd, &ps); + return 0; + + case WM_NCRBUTTONDOWN: + logmsg("WindowProcedure::NCRBUTTONDOWN"); + + ms = (osdmsg*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + if ( ms ) { + if ( ms->callback) ms->callback(ms->param); + SendMessage(hwnd, WM_USER+3, 0, 0); + } + return 0; + + case WM_TIMER: + logmsg("WindowProcedure::TIMER"); + SendMessage(hwnd, WM_USER+3, wParam, 0); + return 0; + + case WM_USER+1: //draw text ((char *)string, (int) timeout + logmsg("WindowProcedure::USER+1"); + + ms=(osdmsg*)mir_alloc(sizeof(osdmsg)); + ms->text = mir_tstrdup((TCHAR *)wParam ); + if ( lParam == 0 ) + lParam = db_get_dw( NULL,THIS_MODULE, "timeout", DEFAULT_TIMEOUT ); + ms->timeout = lParam; + ms->callback = 0; + ms->color = db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG); + ms->param = 0; + SendMessage(hwnd, WM_USER+4, (WPARAM)ms, 0); + mir_free(ms->text); + mir_free(ms); + return 0; + + case WM_USER+2: //show + logmsg("WindowProcedure::USER+2"); + SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW|SWP_NOACTIVATE); + return 0; + + case WM_USER+3: //hide + ms = ( osdmsg* )GetWindowLongPtr(hwnd, GWLP_USERDATA); + logmsg("WindowProcedure::USER+3"); + if ( !ms ) + return 0; + + logmsg("WindowProcedure::USER+3/om"); + KillTimer(hwnd, (UINT)ms); + mir_free(ms->text); + mir_free(ms); + SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); + ShowWindow(hwnd, SW_HIDE); + return 0; + + case WM_USER+4: + logmsg("WindowProcedure::USER+4"); + + ms = (osdmsg*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + if ( ms != 0 ) { + logmsg("WindowProcedure::USER+4/old"); + KillTimer(hwnd, (UINT)ms); + mir_free(ms->text); + mir_free(ms); + SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); + if (!pSetLayeredWindowAttributes) { + logmsg("WindowProcedure::USER+4/old+9x"); + ShowWindow(hwnd, SW_HIDE); + Sleep(50); + } } + + ms =(osdmsg*)mir_alloc(sizeof(osdmsg)); + memcpy(ms, (osdmsg*)wParam, sizeof(osdmsg)); + ms->text = mir_tstrdup( ms->text ); + + SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG)ms); + SetTimer(hwnd, (UINT)ms, (int)ms->timeout, 0); + InvalidateRect(hwnd, 0, TRUE); + SendMessage(hwnd, WM_USER+2, 0, 0); + return 0; + + case WM_NCHITTEST: + { + RECT rect; + GetWindowRect(hwnd, &rect); + + logmsg("WindowProcedure::NCHITTEST"); + + if (LOWORD(lParam)>=(rect.left+5) && LOWORD(lParam)<=(rect.right-5) && + HIWORD(lParam)>=(rect.top+5) && HIWORD(lParam)<=(rect.bottom-5)) + return HTCAPTION; + return DefWindowProc (hwnd, message, wParam, lParam); + } + //here will be the doubleclick => open-message-window solution ;-) + //case WM_NCLBUTTONDBLCLK: + // CallService(MS_MSG_SENDMESSAGE, wparam,(LPARAM)&odp); + // return 0; + default: + return DefWindowProc (hwnd, message, wParam, lParam); + } + + return 0; +} + +INT_PTR OSDAnnounce(WPARAM wParam, LPARAM lParam) +{ + logmsg("OSDAnnounce"); + return SendMessage(hwnd, WM_USER+1, wParam, lParam); +} + +int pluginShutDown(WPARAM wparam,LPARAM lparam) +{ + logmsg("pluginShutDown"); + if (hwnd) { + logmsg("pluginShutDown/hwnd"); + SendMessage(hwnd, WM_USER+3, 0, 0); + DestroyWindow(hwnd); + hwnd=0; + } + return 0; +} + +int MainInit(WPARAM wparam,LPARAM lparam) +{ + logmsg("MainInit"); + HookEvent(ME_OPT_INITIALISE,OptionsInit); + + WNDCLASSEX wincl; + wincl.hInstance = hI; + wincl.lpszClassName = szClassName; + wincl.lpfnWndProc = WindowProcedure; + wincl.style = CS_DBLCLKS; + wincl.cbSize = sizeof (WNDCLASSEX); + + wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION); + wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION); + wincl.hCursor = LoadCursor (NULL, IDC_ARROW); + wincl.lpszMenuName = NULL; + wincl.cbClsExtra = 0; + wincl.cbWndExtra = 0; + wincl.hbrBackground = 0; + + if ( !RegisterClassEx( &wincl )) + return 0; + + hwnd = CreateWindowEx((pSetLayeredWindowAttributes?WS_EX_LAYERED:0)|WS_EX_TOOLWINDOW, szClassName, _T("WannaBeOSD"), + (pSetLayeredWindowAttributes?0:WS_CLIPSIBLINGS) | WS_POPUP, + db_get_dw(NULL,THIS_MODULE, "winxpos", DEFAULT_WINXPOS), + db_get_dw(NULL,THIS_MODULE, "winypos", DEFAULT_WINYPOS), + db_get_dw(NULL,THIS_MODULE, "winx", DEFAULT_WINX), + db_get_dw(NULL,THIS_MODULE, "winy", DEFAULT_WINY), + HWND_DESKTOP, NULL, hI, NULL); + + SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); + + if (pSetLayeredWindowAttributes) + pSetLayeredWindowAttributes(hwnd, db_get_dw(NULL,THIS_MODULE, "bkclr", DEFAULT_BKCLR), db_get_b(NULL,THIS_MODULE, "alpha", DEFAULT_ALPHA), (db_get_b(NULL,THIS_MODULE, "transparent", DEFAULT_TRANPARENT)?LWA_COLORKEY:0)|LWA_ALPHA); + + hservosda=CreateServiceFunction("OSD/Announce", OSDAnnounce); + + hHookedNewEvent = HookEvent(ME_DB_EVENT_ADDED, HookedNewEvent); + + // try to create ME_STATUSCHANGE_CONTACTSTATUSCHANGED event... I hope it fails when newstatusnotify or equal creates it before ;-) + + hContactStatusChanged = HookEvent(ME_STATUSCHANGE_CONTACTSTATUSCHANGED,ContactStatusChanged); + if (!hContactStatusChanged) { + hHookContactStatusChanged = CreateHookableEvent(ME_STATUSCHANGE_CONTACTSTATUSCHANGED); + hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED,ContactSettingChanged); + + hContactStatusChanged = HookEvent(ME_STATUSCHANGE_CONTACTSTATUSCHANGED,ContactStatusChanged); + } + hProtoAck=HookEvent(ME_PROTO_ACK,ProtoAck); + + hpluginShutDown=HookEvent(ME_SYSTEM_SHUTDOWN,pluginShutDown); + + return 0; +} diff --git a/plugins/wbOSD/src/wbOSD.h b/plugins/wbOSD/src/wbOSD.h new file mode 100644 index 0000000000..9233959a5f --- /dev/null +++ b/plugins/wbOSD/src/wbOSD.h @@ -0,0 +1,128 @@ +/* +Wannabe OSD +This plugin tries to become miranda's standard OSD ;-) + +(C) 2005 Andrej Krutak + +Distributed under GNU's GPL 2 or later +*/ + +#define _WIN32_WINNT 0x0500 +#define _CRT_SECURE_NO_WARNINGS + +#include +#include +#include +#include +#include + +#include "resource.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define THIS_MODULE "mirandaosd" + +//SETTINGS DEFAULTS +#define DEFAULT_FNT_HEIGHT -30 +#define DEFAULT_FNT_WIDTH 0 +#define DEFAULT_FNT_ESCAPEMENT 0 +#define DEFAULT_FNT_ORIENTATION 0 +#define DEFAULT_FNT_WEIGHT 700 +#define DEFAULT_FNT_ITALIC 0 +#define DEFAULT_FNT_UNDERLINE 0 +#define DEFAULT_FNT_STRIKEOUT 0 +#define DEFAULT_FNT_CHARSET 0 +#define DEFAULT_FNT_OUTPRECISION 3 +#define DEFAULT_FNT_CLIPRECISION 2 +#define DEFAULT_FNT_QUALITY 1 +#define DEFAULT_FNT_PITCHANDFAM 49 +#define DEFAULT_FNT_FACENAME _T("Arial") + +#define DEFAULT_CLRMSG RGB(255, 100, 0) //fore +#define DEFAULT_CLRSTATUS RGB(40, 160, 255) //fore +#define DEFAULT_CLRSHADOW RGB(0, 0, 0) //bk +#define DEFAULT_BKCLR RGB(255, 255, 255) +#define DEFAULT_ALIGN 1 +#define DEFAULT_SALIGN 1 +#define DEFAULT_DISTANCE 2 +#define DEFAULT_ALTSHADOW 0 +#define DEFAULT_TRANPARENT 1 +#define DEFAULT_WINX 500 +#define DEFAULT_WINY 100 +#define DEFAULT_WINXPOS 10 +#define DEFAULT_WINYPOS 10 +#define DEFAULT_ALPHA 175 +#define DEFAULT_TIMEOUT 3000 +#define DEFAULT_SHOWSHADOW 1 +#define DEFAULT_ANNOUNCEMESSAGES 1 +#define DEFAULT_ANNOUNCESTATUS 1 +#define DEFAULT_ANNOUNCE 0x00000002 //status mask +#define DEFAULT_SHOWMYSTATUS 1 +#define DEFAULT_MESSAGEFORMAT _T("Message from %n: %m") +#define DEFAULT_SHOWMSGWIN 1 +#define DEFAULT_SHOWWHEN 0x00000002 + +//HOOKS +#define ME_STATUSCHANGE_CONTACTSTATUSCHANGED "Miranda/StatusChange/ContactStatusChanged" + +int ContactStatusChanged(WPARAM wParam, LPARAM lParam); +int ProtoAck(WPARAM wparam,LPARAM lparam); +int ContactSettingChanged(WPARAM wparam,LPARAM lparam); +int HookedNewEvent(WPARAM wParam, LPARAM lParam); + +//ANNOUNCING MESSAGES FROM OUTSIDE ;-) +INT_PTR OSDAnnounce(WPARAM wParam, LPARAM lParam); + + + +#define ID_STATUS_MIN ID_STATUS_OFFLINE +#define ID_STATUS_MAX ID_STATUS_OUTTOLUNCH + +typedef struct _plgsettings { + int align, salign, altShadow, showShadow, a_user, distance, onlyfromlist, showmystatus; + int showMsgWindow; + int messages; //also other events... + TCHAR msgformat[256]; + int winx, winy, winxpos, winypos, alpha, transparent, timeout; + COLORREF clr_msg, clr_status, clr_shadow, bkclr; + DWORD announce, showWhen; + LOGFONT lf; +} plgsettings; + +typedef struct _osdmsg { + TCHAR *text; + int timeout; //ms + COLORREF color; + void (*callback)(unsigned int param); + int param; +} osdmsg; + +//#define logmsg(x) logmsg2(x) + +#ifndef logmsg +#define logmsg(x) //x +#endif + +int OptionsInit(WPARAM wparam,LPARAM lparam); + +extern BOOL (WINAPI*pSetLayeredWindowAttributes)(HWND, COLORREF, BYTE, DWORD); + +void loadDBSettings(plgsettings *ps); + +extern HINSTANCE hI; +extern HWND hwnd; +extern HANDLE hservosda; +extern HANDLE hHookedNewEvent, hHookedInit, hProtoAck, hContactSettingChanged, hHookContactStatusChanged, hContactStatusChanged, hpluginShutDown; +extern HINSTANCE hUser32; + diff --git a/plugins/wbOSD/wbOSD.cpp b/plugins/wbOSD/wbOSD.cpp deleted file mode 100644 index 9bdaf74370..0000000000 --- a/plugins/wbOSD/wbOSD.cpp +++ /dev/null @@ -1,309 +0,0 @@ -/* -Wannabe OSD -This plugin tries to become miranda's standard OSD ;-) - -(C) 2005 Andrej Krutak - -Distributed under GNU's GPL 2 or later -*/ - -#include "wbOSD.h" - -TCHAR szClassName[] = _T("wbOSD"); -const static osdmsg defstr={_T(""), 0, RGB(0, 0, 0), 0, 0}; - -int DrawMe(HWND hwnd, TCHAR *string, COLORREF color) -{ - PAINTSTRUCT ps; - RECT rect, rect2; - UINT talign=0; - int sxo, syo; - plgsettings plgs; - - logmsg("DrawMe"); - if (!string) string=_T("bullshit"); - - loadDBSettings(&plgs); - HFONT fh=CreateFontIndirect(&(plgs.lf)); - - HDC hdc=BeginPaint(hwnd, &ps); - SetBkMode(hdc, TRANSPARENT); - - GetClientRect(hwnd, &rect); - HBRUSH bkb=CreateSolidBrush(plgs.bkclr); - FillRect(hdc, &rect, bkb); - - DeleteObject(bkb); - - HGDIOBJ oo=SelectObject(hdc, fh); - -// rect2.left=0; -// rect2.top=0; -// DrawText(hdc, string, -1, &rect2, DT_SINGLELINE|DT_CALCRECT); - rect2 = rect; - DrawText(hdc, string, -1, &rect2, DT_WORDBREAK|DT_CALCRECT); - - if (plgs.align>=1 && plgs.align<=3) - rect.top=0; - if (plgs.align>=4 && plgs.align<=6) - rect.top=(rect.bottom-rect2.bottom)/2; - if (plgs.align>=7 && plgs.align<=9) - rect.top=rect.bottom-rect2.bottom; - - if (((plgs.align-1)%3)==0) - rect.left=0; - else if (((plgs.align-2)%3)==0) - rect.left=(rect.right-rect2.right)/2; - else if (((plgs.align-3)%3)==0) - rect.left=rect.right-rect2.right; - - rect.bottom=rect.top+rect2.bottom; - rect.right=rect.left+rect2.right; - - //draw shadow - if (plgs.showShadow) { - logmsg("DrawMe::showShadow"); - if (plgs.salign>=1 && plgs.salign<=3) syo=-plgs.distance; - if (plgs.salign>=4 && plgs.salign<=6) syo=0; - if (plgs.salign>=7 && plgs.salign<=9) syo=plgs.distance; - - if (((plgs.salign-1)%3)==0) sxo=-plgs.distance; - else if (((plgs.salign-2)%3)==0) sxo=0; - else if (((plgs.salign-3)%3)==0) sxo=plgs.distance; - - SetTextColor(hdc, plgs.clr_shadow); - if (plgs.altShadow==0) { - rect2=rect; - OffsetRect(&rect, sxo, syo); - - DrawText(hdc, string, -1, &rect2, DT_WORDBREAK|talign); - } else { - rect2=rect; - rect2.left+=plgs.distance; - DrawText(hdc, string, -1, &rect2, DT_WORDBREAK|talign); - - rect2=rect; - rect2.left-=plgs.distance; - DrawText(hdc, string, -1, &rect2, DT_WORDBREAK|talign); - - rect2=rect; - rect2.top-=plgs.distance; - DrawText(hdc, string, -1, &rect2, DT_WORDBREAK|talign); - - rect2=rect; - rect2.top+=plgs.distance; - DrawText(hdc, string, -1, &rect2, DT_WORDBREAK|talign); - - OffsetRect(&rect, sxo/2, syo/2); - } - } - - //draw text - SetTextColor(hdc, color); - DrawText(hdc, string, -1, &rect, DT_WORDBREAK); - - SelectObject(hdc, oo); - DeleteObject(fh); - EndPaint(hwnd, &ps); - - return 0; -} - -LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - osdmsg* ms; - - switch (message) { - case WM_CREATE: - logmsg("WindowProcedure::CREATE"); - SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG)&defstr); - return 0; - - case WM_DESTROY: - logmsg("WindowProcedure::DESTROY"); - return 0; - - case WM_PAINT: - logmsg("WindowProcedure::PAINT"); - - ms=(osdmsg*)GetWindowLongPtr(hwnd, GWLP_USERDATA); - if (ms) - return DrawMe(hwnd, ms->text, ms->color); - - PAINTSTRUCT ps; - BeginPaint(hwnd, &ps); - EndPaint(hwnd, &ps); - return 0; - - case WM_NCRBUTTONDOWN: - logmsg("WindowProcedure::NCRBUTTONDOWN"); - - ms = (osdmsg*)GetWindowLongPtr(hwnd, GWLP_USERDATA); - if ( ms ) { - if ( ms->callback) ms->callback(ms->param); - SendMessage(hwnd, WM_USER+3, 0, 0); - } - return 0; - - case WM_TIMER: - logmsg("WindowProcedure::TIMER"); - SendMessage(hwnd, WM_USER+3, wParam, 0); - return 0; - - case WM_USER+1: //draw text ((char *)string, (int) timeout - logmsg("WindowProcedure::USER+1"); - - ms=(osdmsg*)mir_alloc(sizeof(osdmsg)); - ms->text = mir_tstrdup((TCHAR *)wParam ); - if ( lParam == 0 ) - lParam = db_get_dw( NULL,THIS_MODULE, "timeout", DEFAULT_TIMEOUT ); - ms->timeout = lParam; - ms->callback = 0; - ms->color = db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG); - ms->param = 0; - SendMessage(hwnd, WM_USER+4, (WPARAM)ms, 0); - mir_free(ms->text); - mir_free(ms); - return 0; - - case WM_USER+2: //show - logmsg("WindowProcedure::USER+2"); - SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW|SWP_NOACTIVATE); - return 0; - - case WM_USER+3: //hide - ms = ( osdmsg* )GetWindowLongPtr(hwnd, GWLP_USERDATA); - logmsg("WindowProcedure::USER+3"); - if ( !ms ) - return 0; - - logmsg("WindowProcedure::USER+3/om"); - KillTimer(hwnd, (UINT)ms); - mir_free(ms->text); - mir_free(ms); - SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); - ShowWindow(hwnd, SW_HIDE); - return 0; - - case WM_USER+4: - logmsg("WindowProcedure::USER+4"); - - ms = (osdmsg*)GetWindowLongPtr(hwnd, GWLP_USERDATA); - if ( ms != 0 ) { - logmsg("WindowProcedure::USER+4/old"); - KillTimer(hwnd, (UINT)ms); - mir_free(ms->text); - mir_free(ms); - SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); - if (!pSetLayeredWindowAttributes) { - logmsg("WindowProcedure::USER+4/old+9x"); - ShowWindow(hwnd, SW_HIDE); - Sleep(50); - } } - - ms =(osdmsg*)mir_alloc(sizeof(osdmsg)); - memcpy(ms, (osdmsg*)wParam, sizeof(osdmsg)); - ms->text = mir_tstrdup( ms->text ); - - SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG)ms); - SetTimer(hwnd, (UINT)ms, (int)ms->timeout, 0); - InvalidateRect(hwnd, 0, TRUE); - SendMessage(hwnd, WM_USER+2, 0, 0); - return 0; - - case WM_NCHITTEST: - { - RECT rect; - GetWindowRect(hwnd, &rect); - - logmsg("WindowProcedure::NCHITTEST"); - - if (LOWORD(lParam)>=(rect.left+5) && LOWORD(lParam)<=(rect.right-5) && - HIWORD(lParam)>=(rect.top+5) && HIWORD(lParam)<=(rect.bottom-5)) - return HTCAPTION; - return DefWindowProc (hwnd, message, wParam, lParam); - } - //here will be the doubleclick => open-message-window solution ;-) - //case WM_NCLBUTTONDBLCLK: - // CallService(MS_MSG_SENDMESSAGE, wparam,(LPARAM)&odp); - // return 0; - default: - return DefWindowProc (hwnd, message, wParam, lParam); - } - - return 0; -} - -INT_PTR OSDAnnounce(WPARAM wParam, LPARAM lParam) -{ - logmsg("OSDAnnounce"); - return SendMessage(hwnd, WM_USER+1, wParam, lParam); -} - -int pluginShutDown(WPARAM wparam,LPARAM lparam) -{ - logmsg("pluginShutDown"); - if (hwnd) { - logmsg("pluginShutDown/hwnd"); - SendMessage(hwnd, WM_USER+3, 0, 0); - DestroyWindow(hwnd); - hwnd=0; - } - return 0; -} - -int MainInit(WPARAM wparam,LPARAM lparam) -{ - logmsg("MainInit"); - HookEvent(ME_OPT_INITIALISE,OptionsInit); - - WNDCLASSEX wincl; - wincl.hInstance = hI; - wincl.lpszClassName = szClassName; - wincl.lpfnWndProc = WindowProcedure; - wincl.style = CS_DBLCLKS; - wincl.cbSize = sizeof (WNDCLASSEX); - - wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION); - wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION); - wincl.hCursor = LoadCursor (NULL, IDC_ARROW); - wincl.lpszMenuName = NULL; - wincl.cbClsExtra = 0; - wincl.cbWndExtra = 0; - wincl.hbrBackground = 0; - - if ( !RegisterClassEx( &wincl )) - return 0; - - hwnd = CreateWindowEx((pSetLayeredWindowAttributes?WS_EX_LAYERED:0)|WS_EX_TOOLWINDOW, szClassName, _T("WannaBeOSD"), - (pSetLayeredWindowAttributes?0:WS_CLIPSIBLINGS) | WS_POPUP, - db_get_dw(NULL,THIS_MODULE, "winxpos", DEFAULT_WINXPOS), - db_get_dw(NULL,THIS_MODULE, "winypos", DEFAULT_WINYPOS), - db_get_dw(NULL,THIS_MODULE, "winx", DEFAULT_WINX), - db_get_dw(NULL,THIS_MODULE, "winy", DEFAULT_WINY), - HWND_DESKTOP, NULL, hI, NULL); - - SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); - - if (pSetLayeredWindowAttributes) - pSetLayeredWindowAttributes(hwnd, db_get_dw(NULL,THIS_MODULE, "bkclr", DEFAULT_BKCLR), db_get_b(NULL,THIS_MODULE, "alpha", DEFAULT_ALPHA), (db_get_b(NULL,THIS_MODULE, "transparent", DEFAULT_TRANPARENT)?LWA_COLORKEY:0)|LWA_ALPHA); - - hservosda=CreateServiceFunction("OSD/Announce", OSDAnnounce); - - hHookedNewEvent = HookEvent(ME_DB_EVENT_ADDED, HookedNewEvent); - - // try to create ME_STATUSCHANGE_CONTACTSTATUSCHANGED event... I hope it fails when newstatusnotify or equal creates it before ;-) - - hContactStatusChanged = HookEvent(ME_STATUSCHANGE_CONTACTSTATUSCHANGED,ContactStatusChanged); - if (!hContactStatusChanged) { - hHookContactStatusChanged = CreateHookableEvent(ME_STATUSCHANGE_CONTACTSTATUSCHANGED); - hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED,ContactSettingChanged); - - hContactStatusChanged = HookEvent(ME_STATUSCHANGE_CONTACTSTATUSCHANGED,ContactStatusChanged); - } - hProtoAck=HookEvent(ME_PROTO_ACK,ProtoAck); - - hpluginShutDown=HookEvent(ME_SYSTEM_SHUTDOWN,pluginShutDown); - - return 0; -} diff --git a/plugins/wbOSD/wbOSD.h b/plugins/wbOSD/wbOSD.h deleted file mode 100644 index 9233959a5f..0000000000 --- a/plugins/wbOSD/wbOSD.h +++ /dev/null @@ -1,128 +0,0 @@ -/* -Wannabe OSD -This plugin tries to become miranda's standard OSD ;-) - -(C) 2005 Andrej Krutak - -Distributed under GNU's GPL 2 or later -*/ - -#define _WIN32_WINNT 0x0500 -#define _CRT_SECURE_NO_WARNINGS - -#include -#include -#include -#include -#include - -#include "resource.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define THIS_MODULE "mirandaosd" - -//SETTINGS DEFAULTS -#define DEFAULT_FNT_HEIGHT -30 -#define DEFAULT_FNT_WIDTH 0 -#define DEFAULT_FNT_ESCAPEMENT 0 -#define DEFAULT_FNT_ORIENTATION 0 -#define DEFAULT_FNT_WEIGHT 700 -#define DEFAULT_FNT_ITALIC 0 -#define DEFAULT_FNT_UNDERLINE 0 -#define DEFAULT_FNT_STRIKEOUT 0 -#define DEFAULT_FNT_CHARSET 0 -#define DEFAULT_FNT_OUTPRECISION 3 -#define DEFAULT_FNT_CLIPRECISION 2 -#define DEFAULT_FNT_QUALITY 1 -#define DEFAULT_FNT_PITCHANDFAM 49 -#define DEFAULT_FNT_FACENAME _T("Arial") - -#define DEFAULT_CLRMSG RGB(255, 100, 0) //fore -#define DEFAULT_CLRSTATUS RGB(40, 160, 255) //fore -#define DEFAULT_CLRSHADOW RGB(0, 0, 0) //bk -#define DEFAULT_BKCLR RGB(255, 255, 255) -#define DEFAULT_ALIGN 1 -#define DEFAULT_SALIGN 1 -#define DEFAULT_DISTANCE 2 -#define DEFAULT_ALTSHADOW 0 -#define DEFAULT_TRANPARENT 1 -#define DEFAULT_WINX 500 -#define DEFAULT_WINY 100 -#define DEFAULT_WINXPOS 10 -#define DEFAULT_WINYPOS 10 -#define DEFAULT_ALPHA 175 -#define DEFAULT_TIMEOUT 3000 -#define DEFAULT_SHOWSHADOW 1 -#define DEFAULT_ANNOUNCEMESSAGES 1 -#define DEFAULT_ANNOUNCESTATUS 1 -#define DEFAULT_ANNOUNCE 0x00000002 //status mask -#define DEFAULT_SHOWMYSTATUS 1 -#define DEFAULT_MESSAGEFORMAT _T("Message from %n: %m") -#define DEFAULT_SHOWMSGWIN 1 -#define DEFAULT_SHOWWHEN 0x00000002 - -//HOOKS -#define ME_STATUSCHANGE_CONTACTSTATUSCHANGED "Miranda/StatusChange/ContactStatusChanged" - -int ContactStatusChanged(WPARAM wParam, LPARAM lParam); -int ProtoAck(WPARAM wparam,LPARAM lparam); -int ContactSettingChanged(WPARAM wparam,LPARAM lparam); -int HookedNewEvent(WPARAM wParam, LPARAM lParam); - -//ANNOUNCING MESSAGES FROM OUTSIDE ;-) -INT_PTR OSDAnnounce(WPARAM wParam, LPARAM lParam); - - - -#define ID_STATUS_MIN ID_STATUS_OFFLINE -#define ID_STATUS_MAX ID_STATUS_OUTTOLUNCH - -typedef struct _plgsettings { - int align, salign, altShadow, showShadow, a_user, distance, onlyfromlist, showmystatus; - int showMsgWindow; - int messages; //also other events... - TCHAR msgformat[256]; - int winx, winy, winxpos, winypos, alpha, transparent, timeout; - COLORREF clr_msg, clr_status, clr_shadow, bkclr; - DWORD announce, showWhen; - LOGFONT lf; -} plgsettings; - -typedef struct _osdmsg { - TCHAR *text; - int timeout; //ms - COLORREF color; - void (*callback)(unsigned int param); - int param; -} osdmsg; - -//#define logmsg(x) logmsg2(x) - -#ifndef logmsg -#define logmsg(x) //x -#endif - -int OptionsInit(WPARAM wparam,LPARAM lparam); - -extern BOOL (WINAPI*pSetLayeredWindowAttributes)(HWND, COLORREF, BYTE, DWORD); - -void loadDBSettings(plgsettings *ps); - -extern HINSTANCE hI; -extern HWND hwnd; -extern HANDLE hservosda; -extern HANDLE hHookedNewEvent, hHookedInit, hProtoAck, hContactSettingChanged, hHookContactStatusChanged, hContactStatusChanged, hpluginShutDown; -extern HINSTANCE hUser32; - diff --git a/plugins/wbOSD/wbOSD.rc b/plugins/wbOSD/wbOSD.rc deleted file mode 100644 index 0dad96f6e8..0000000000 --- a/plugins/wbOSD/wbOSD.rc +++ /dev/null @@ -1,188 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Slovak resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SKY) -#ifdef _WIN32 -LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT -#pragma code_page(1250) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DIALOG1 DIALOGEX 0, 0, 316, 250 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION -CAPTION "Dialog" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "Radio1",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,21,22,8,8 - CONTROL "Radio1",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,39,22,8, - 8 - CONTROL "Radio1",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,59,22,8, - 8 - CONTROL "Radio1",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,21,33,8, - 8 - CONTROL "Radio1",IDC_RADIO5,"Button",BS_AUTORADIOBUTTON,39,33,8, - 8 - CONTROL "Radio1",IDC_RADIO6,"Button",BS_AUTORADIOBUTTON,59,33,8, - 8 - CONTROL "Radio1",IDC_RADIO7,"Button",BS_AUTORADIOBUTTON,21,45,8, - 8 - CONTROL "Radio1",IDC_RADIO8,"Button",BS_AUTORADIOBUTTON,39,45,8, - 8 - CONTROL "Radio1",IDC_RADIO9,"Button",BS_AUTORADIOBUTTON,59,45,8, - 8 - PUSHBUTTON "Select font",IDC_BUTTON1,80,17,68,14 - PUSHBUTTON "Text color",IDC_BUTTON2,175,91,68,14 - PUSHBUTTON "Background color",IDC_BUTTON4,11,182,67,14 - CONTROL "Transparent",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,11,199,72,10 - CONTROL "Radio1",IDC_RADIO10,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,21,99,8,8 - CONTROL "Radio1",IDC_RADIO11,"Button",BS_AUTORADIOBUTTON,39,99,8, - 8 - CONTROL "Radio1",IDC_RADIO12,"Button",BS_AUTORADIOBUTTON,59,99,8, - 8 - CONTROL "Radio1",IDC_RADIO13,"Button",BS_AUTORADIOBUTTON,21,110, - 8,8 - CONTROL "Radio1",IDC_RADIO14,"Button",BS_AUTORADIOBUTTON,39,110, - 8,8 - CONTROL "Radio1",IDC_RADIO15,"Button",BS_AUTORADIOBUTTON,59,110, - 8,8 - CONTROL "Radio1",IDC_RADIO16,"Button",BS_AUTORADIOBUTTON,21,121, - 8,8 - CONTROL "Radio1",IDC_RADIO17,"Button",BS_AUTORADIOBUTTON,39,121, - 8,8 - CONTROL "Radio1",IDC_RADIO18,"Button",BS_AUTORADIOBUTTON,59,121, - 8,8 - PUSHBUTTON "Shadow color",IDC_BUTTON3,80,92,67,14 - CONTROL "Alternative shadow",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,13,135,133,10 - EDITTEXT IDC_EDIT1,79,148,27,14,ES_AUTOHSCROLL | ES_NUMBER - GROUPBOX "Shadow align",IDC_STATIC,13,89,62,43 - GROUPBOX "General",IDC_STATIC,6,0,150,66 - GROUPBOX "Shadow",IDC_STATIC,5,70,151,99 - GROUPBOX "Align",IDC_STATIC,13,13,61,43 - LTEXT "Shadow distance:",IDC_STATIC,10,151,64,8, - SS_PATHELLIPSIS,WS_EX_RIGHT - GROUPBOX "Other",IDC_STATIC,5,171,152,75 - LTEXT "Alpha:",IDC_STATIC,92,183,60,8,SS_PATHELLIPSIS - GROUPBOX "Announce",IDC_STATIC,162,0,150,246 - LTEXT "Timeout (ms):",IDC_STATIC,91,213,62,8,SS_PATHELLIPSIS - EDITTEXT IDC_EDIT5,91,224,27,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_TREE1,"SysTreeView32",TVS_DISABLEDRAGDROP | - TVS_NOTOOLTIPS | WS_BORDER | WS_TABSTOP | 0x4000,170,22, - 138,55 - CONTROL "Show",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 13,80,85,10 - CONTROL "Show events",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,167,110,139,10 - CONTROL "Status changes",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,167,10,136,10 - PUSHBUTTON "Show testing OSD",IDC_BUTTON5,11,224,67,14 - CONTROL "Show my status changes",IDC_CHECK7,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,175,80,133,10 - CONTROL "Show message window after click",IDC_CHECK2,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,167,156,138,10 - CONTROL "",IDC_SLIDER1,"msctls_trackbar32",TBS_BOTH | - TBS_NOTICKS | WS_TABSTOP,87,193,45,15 - LTEXT "Static",IDC_ALPHATXT,136,195,17,8 - PUSHBUTTON "Text color",IDC_BUTTON6,175,121,68,14 - EDITTEXT IDC_EDIT2,214,137,81,14,ES_AUTOHSCROLL - LTEXT "Format:",IDC_STATIC,177,140,35,8 - PUSHBUTTON "?",IDC_BUTTON7,298,137,10,14 - CONTROL "",IDC_TREE2,"SysTreeView32",TVS_DISABLEDRAGDROP | - TVS_NOTOOLTIPS | WS_BORDER | WS_TABSTOP | 0x4000,170,182, - 138,59 - LTEXT "Show when my status is:",IDC_STATIC,168,171,139,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_DIALOG1, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 309 - TOPMARGIN, 7 - BOTTOMMARGIN, 243 - END -END -#endif // APSTUDIO_INVOKED - -#endif // Slovak resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/plugins/wbOSD/wbOSD_10.vcxproj b/plugins/wbOSD/wbOSD_10.vcxproj index 0fc1f2760f..e151f7fe97 100644 --- a/plugins/wbOSD/wbOSD_10.vcxproj +++ b/plugins/wbOSD/wbOSD_10.vcxproj @@ -76,7 +76,7 @@ Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;WBOSD_EXPORTS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -90,15 +90,19 @@ true $(OutDir)wbOSD.pdb Windows - $(OutDir)wbOSD.lib + $(IntDir)$(TargetName).lib MachineX86 $(ProfileDir)..\..\bin10\lib + + _DEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + Disabled - WIN64;_DEBUG;_WINDOWS;_USRDLL;WBOSD_EXPORTS;%(PreprocessorDefinitions) + WIN64;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Use @@ -111,14 +115,17 @@ true $(OutDir)wbOSD.pdb Windows - $(OutDir)wbOSD.lib + $(IntDir)$(TargetName).lib $(ProfileDir)..\..\bin10\lib + + _DEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + - WIN32;NDEBUG;_WINDOWS;_USRDLL;WBOSD_EXPORTS;%(PreprocessorDefinitions) - MultiThreadedDLL + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) Use Level3 ProgramDatabase @@ -126,21 +133,26 @@ Size ../../include;%(AdditionalIncludeDirectories) wbOSD.h + OnlyExplicitInline true Windows true true - $(OutDir)wbOSD.lib + $(IntDir)$(TargetName).lib MachineX86 $(ProfileDir)..\..\bin10\lib + /PDBALTPATH:%_PDB% %(AdditionalOptions) + + NDEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + - WIN64;NDEBUG;_WINDOWS;_USRDLL;WBOSD_EXPORTS;%(PreprocessorDefinitions) - MultiThreadedDLL + WIN64;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) Use Level3 ProgramDatabase @@ -148,39 +160,39 @@ Size ../../include;%(AdditionalIncludeDirectories) wbOSD.h + OnlyExplicitInline true Windows true true - $(OutDir)wbOSD.lib + $(IntDir)$(TargetName).lib $(ProfileDir)..\..\bin10\lib + /PDBALTPATH:%_PDB% %(AdditionalOptions) + + NDEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + - - - Create - Create - Create - Create - Create - Create - - - - - - - - + + + - + + + Create + + + + - + + diff --git a/plugins/wbOSD/wbOSD_10.vcxproj.filters b/plugins/wbOSD/wbOSD_10.vcxproj.filters index d27d519e26..fc4ddaab89 100644 --- a/plugins/wbOSD/wbOSD_10.vcxproj.filters +++ b/plugins/wbOSD/wbOSD_10.vcxproj.filters @@ -15,36 +15,39 @@ - + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + Source Files - + Source Files - + Source Files - + Source Files - - Header Files - - + Resource Files - - - Header Files - - - - + + Resource Files - - - \ No newline at end of file diff --git a/plugins/wbOSD/wbOSD_11.vcxproj b/plugins/wbOSD/wbOSD_11.vcxproj new file mode 100644 index 0000000000..5eee97728d --- /dev/null +++ b/plugins/wbOSD/wbOSD_11.vcxproj @@ -0,0 +1,203 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + wbOSD + {DA450122-7F0B-45DA-9EAA-421887AD8450} + Win32Proj + + + + DynamicLibrary + Unicode + true + v110_xp + + + DynamicLibrary + Unicode + true + v110_xp + + + DynamicLibrary + Unicode + v110_xp + + + DynamicLibrary + Unicode + v110_xp + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + true + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + false + false + + + + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Use + Level3 + EditAndContinue + ../../include;%(AdditionalIncludeDirectories) + wbOSD.h + + + true + $(OutDir)wbOSD.pdb + Windows + $(IntDir)$(TargetName).lib + MachineX86 + $(ProfileDir)..\..\bin11\lib + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + + + Disabled + WIN64;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + Level3 + ProgramDatabase + ../../include;%(AdditionalIncludeDirectories) + wbOSD.h + + + true + $(OutDir)wbOSD.pdb + Windows + $(IntDir)$(TargetName).lib + $(ProfileDir)..\..\bin11\lib + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + + + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + Use + Level3 + ProgramDatabase + Full + Size + ../../include;%(AdditionalIncludeDirectories) + wbOSD.h + OnlyExplicitInline + + + true + Windows + true + true + $(IntDir)$(TargetName).lib + MachineX86 + $(ProfileDir)..\..\bin11\lib + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + + + WIN64;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + Use + Level3 + ProgramDatabase + Full + Size + ../../include;%(AdditionalIncludeDirectories) + wbOSD.h + OnlyExplicitInline + + + true + Windows + true + true + $(IntDir)$(TargetName).lib + $(ProfileDir)..\..\bin11\lib + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + + + + + + + + + Create + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/wbOSD/wbOSD_11.vcxproj.filters b/plugins/wbOSD/wbOSD_11.vcxproj.filters new file mode 100644 index 0000000000..fc4ddaab89 --- /dev/null +++ b/plugins/wbOSD/wbOSD_11.vcxproj.filters @@ -0,0 +1,53 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx + + + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file -- cgit v1.2.3