From 91eb23f044911477f615e7e25e1425b667c3f1fa Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 12 Apr 2013 21:28:12 +0000 Subject: pascal sources sync git-svn-id: http://svn.miranda-ng.org/main/trunk@4435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Actman/ua/i_uaplaces.inc | 12 ++-- plugins/ExternalAPI/delphi/m_userinfoex.inc | 2 - plugins/QuickSearch/qs.rc | 3 +- plugins/QuickSearch/quicksearch.dpr | 7 +-- plugins/QuickSearch/sr_window.pas | 10 ++-- plugins/Utils.pas/common.pas | 90 +++++++++++++++++++++-------- plugins/Utils.pas/mApiCardM.pas | 2 +- plugins/Watrack/i_gui.inc | 18 ++++-- plugins/Watrack/players/pl_mradio.pas | 26 ++------- plugins/Watrack/proto/i_proto_dlg.inc | 10 ++-- plugins/Watrack/proto/proto.pas | 15 ++--- plugins/mRadio/i_frameapi.inc | 4 +- plugins/mRadio/i_hotkey.inc | 1 + plugins/mRadio/i_myservice.inc | 26 ++++----- plugins/mRadio/i_optdlg.inc | 12 ++-- plugins/mRadio/i_tray.inc | 34 +++++------ plugins/mRadio/mradio.dpr | 17 ++---- plugins/mRadio/mradio.rc | 3 +- plugins/mRadio/variants.pas | 5 ++ 19 files changed, 159 insertions(+), 138 deletions(-) (limited to 'plugins') diff --git a/plugins/Actman/ua/i_uaplaces.inc b/plugins/Actman/ua/i_uaplaces.inc index 1d923e25a3..9ee2a79b0c 100644 --- a/plugins/Actman/ua/i_uaplaces.inc +++ b/plugins/Actman/ua/i_uaplaces.inc @@ -380,7 +380,7 @@ begin begin FillChar(clmi,SizeOf(clmi),0); clmi.cbSize:=SizeOf(clmi); - clmi.flags :=CMIF_UNICODE or CMIF_ICONFROMICOLIB; + clmi.flags :=CMIF_UNICODE; if (UAMenuItem.szMenuPopup<>nil) and (UAMenuItem.szMenuPopup^<>#0) then clmi.szName.w:=ParseVarString(UAMenuItem.szMenuPopup) @@ -417,7 +417,7 @@ begin {}{} FillChar(clmi,SizeOf(clmi),0); clmi.cbSize:=SizeOf(clmi); - clmi.flags:=CMIF_UNICODE or CMIF_ICONFROMICOLIB; + clmi.flags:=CMIF_UNICODE; if (ActionItem.flags and (UAF_2STATE+UAF_PRESSED))<>(UAF_2STATE+UAF_PRESSED) then begin clmi.hIcon:=ActionItem.hIcolibIcon; @@ -426,7 +426,7 @@ begin else begin clmi.hIcon:=ActionItem.hIcolibIconPressed; - clmi.flags:=CMIF_UNICODE or CMIF_ICONFROMICOLIB or CMIF_CHECKED; + clmi.flags:=CMIF_UNICODE or CMIF_CHECKED; extra:='1'; end; @@ -504,7 +504,7 @@ begin if (mi.flags and CMIF_HIDDEN)=0 then begin //!!!! icon (check for contact menu) - mi.flags:=mi.flags or CMIM_ICON or CMIM_FLAGS or CMIF_ICONFROMICOLIB; + mi.flags:=mi.flags or CMIM_ICON or CMIM_FLAGS; if (mtype=contact_menu) and IsLocalItem(UActionList[i]) then begin @@ -625,8 +625,8 @@ begin if ActionItem.szTTBTooltip =nil then pc1:=pc else pc1:=ActionItem.szTTBTooltip; - - if ((ActionItem.flags and UAF_2STATE)=0) or + + if ((ActionItem.flags and UAF_2STATE)=0) or (ActionItem.szTTBTooltipPressed=nil) then pc2:=pc1 else diff --git a/plugins/ExternalAPI/delphi/m_userinfoex.inc b/plugins/ExternalAPI/delphi/m_userinfoex.inc index b4aff7e7e8..819cbc9ca9 100644 --- a/plugins/ExternalAPI/delphi/m_userinfoex.inc +++ b/plugins/ExternalAPI/delphi/m_userinfoex.inc @@ -242,8 +242,6 @@ lParam = not used MBS_FLAT = $00004000; // flat button MBS_DOWNARROW = $00008000; // has arrow on the right - MBF_UNICODE = 1; - // BUTTONADDTOOLTIP // use lParam=MBF_UNICODE to set unicode tooltips // for lParam=0 the string is interpreted as ansi diff --git a/plugins/QuickSearch/qs.rc b/plugins/QuickSearch/qs.rc index 0f4e27d46a..b42780e902 100644 --- a/plugins/QuickSearch/qs.rc +++ b/plugins/QuickSearch/qs.rc @@ -147,7 +147,7 @@ FONT 8, "Ms Shell Dlg",0,0 CCS_BOTTOM | 0x0900, // SBT_TOOLTIPS | SBARS_SIZEGRIP 0,226,520,14 } - +/* VS_VERSION_INFO VERSIONINFO FILEVERSION 1,4,1,18 PRODUCTVERSION 0,8,0,0 @@ -176,3 +176,4 @@ BEGIN VALUE "Translation",0,1200 END END +*/ \ No newline at end of file diff --git a/plugins/QuickSearch/quicksearch.dpr b/plugins/QuickSearch/quicksearch.dpr index 856f3376d3..cd200ff6b5 100644 --- a/plugins/QuickSearch/quicksearch.dpr +++ b/plugins/QuickSearch/quicksearch.dpr @@ -45,7 +45,7 @@ begin 'users version of miranda,group or city.'; PluginInfo.author :='Awkward, based on Bethoven sources'; PluginInfo.authorEmail:='panda75@bk.ru; awk1975@ya.ru'; - PluginInfo.copyright :='(c) 2004,2005 Bethoven; 2006-2012 Awkward'; + PluginInfo.copyright :='(c) 2004,2005 Bethoven; 2006-2013 Awkward'; PluginInfo.homepage :='http://code.google.com/p/delphi-miranda-plugins/'; PluginInfo.flags :=UNICODE_AWARE; PluginInfo.uuid :=MIID_QUICKSEARCH; @@ -164,7 +164,7 @@ begin odp.hInstance :=hInstance; odp.pszTemplate:=PAnsiChar(IDD_DIALOG1); odp.szTitle.a :=qs_name; - odp.szGroup.a :='Contact List'; + odp.szGroup.a :='Contacts'; odp.pfnDlgProc :=@sr_optdialog.DlgProcOptions; odp.flags :=ODPF_BOLDGROUPS; Options_AddPage(wParam,@odp); @@ -240,7 +240,6 @@ exports Load, Unload, MirandaPluginInfoEx; -initialization +begin DisableThreadLibraryCalls(hInstance); - end. diff --git a/plugins/QuickSearch/sr_window.pas b/plugins/QuickSearch/sr_window.pas index 97624173ba..de9ba1b634 100644 --- a/plugins/QuickSearch/sr_window.pas +++ b/plugins/QuickSearch/sr_window.pas @@ -526,7 +526,7 @@ begin ST_SERVICE: begin if wparam._type=ptCurrent then wparam.n:=hContact; if lparam._type=ptCurrent then lparam.n:=hContact; - tmp:=CallService(protov,wparam.n,lparam.n); + tmp:=uint_ptr(CallService(protov,wparam.n,lparam.n)); if tmp=CALLSERVICE_NOTFOUND then exit; case setting_cnftype of ptString: begin @@ -619,7 +619,7 @@ begin end; ST_LASTEVENT: begin - hDbEvent := db_event_last(hContact); + hDbEvent:=db_event_last(hContact); if hDbEvent<>0 then begin ZeroMemory(@dbei,sizeof(dbei)); @@ -1190,14 +1190,14 @@ begin // filling buffer LastMeta:=0; cnt1:=0; - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(); while hContact<>0 do begin //!! check account AddContact(cnt1,hContact); inc(cnt1); if cnt1=cnt then break; // additional checking - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + hContact:=db_find_next(hContact); end; if cnt1<>cnt then begin @@ -1949,7 +1949,7 @@ begin FastWideToAnsiBuf(MainBuf[i,sub].text,buf); // ListView_GetItemTextA(grid,lplvcd^.nmcd.dwItemSpec,lplvcd^.iSubItem,buf,SizeOf(buf)); -// +//!! if (buf[0]<>#0) and (ServiceExists(MS_FP_GETCLIENTICON)<>0) then begin h:=CallService(MS_FP_GETCLIENTICON,tlparam(@buf),0); diff --git a/plugins/Utils.pas/common.pas b/plugins/Utils.pas/common.pas index cd321cbcb7..d36ecad588 100644 --- a/plugins/Utils.pas/common.pas +++ b/plugins/Utils.pas/common.pas @@ -90,6 +90,8 @@ procedure mFreeMem(var ptr); function mReallocMem(var dst; size:integer):pointer; // String processing +function FormatStrW(fmt:pWideChar; arr:array of pWideChar):pWideChar; + function WideToCombo(src:PWideChar;var dst;cp:integer=CP_ACP):integer; function ChangeUnicode(str:PWideChar):PWideChar; @@ -124,8 +126,8 @@ function StrReplace (src,SubStr,NewStr:PAnsiChar):PAnsiChar; function StrReplaceW(src,SubStr,NewStr:pWideChar):PWideChar; function CharReplace (dst:pAnsiChar;old,new:AnsiChar):PAnsiChar; function CharReplaceW(dst:pWideChar;old,new:WideChar):PWideChar; -function StrCmp (a,b:PAnsiChar;n:cardinal=0):integer; -function StrCmpW(a,b:PWideChar;n:cardinal=0):integer; +function StrCmp (a,b:PAnsiChar;n:integer=0):integer; +function StrCmpW(a,b:PWideChar;n:integer=0):integer; function StrEnd (const a:PAnsiChar):PAnsiChar; function StrEndW(const a:PWideChar):PWideChar; function StrScan (src:PAnsiChar;c:AnsiChar):PAnsiChar; @@ -904,6 +906,8 @@ begin result:=dst; end; +//----- Memory work ----- + procedure FillWord(var buf;count:cardinal;value:word); register; {$IFNDEF WIN64}assembler; { @@ -968,6 +972,7 @@ asm POP ESI end; } + {$IFNDEF WIN64} // Delphi 2009 realization function CompareMem(P1, P2: Pointer; Length: Integer): Boolean; assembler; @@ -1035,10 +1040,6 @@ asm end; {$ELSE} function CompareMem(P1, P2: Pointer; Length: Integer): Boolean; - {$IFNDEF COMPILER_16_UP} -begin - result:=CompareByte(P1,P2,Length)=0; - {$ELSE} var i:integer; begin @@ -1053,26 +1054,9 @@ begin inc(pbyte(p2)); end; result:=true; - {$ENDIF} end; {$ENDIF} -function Min(a,b:integer):integer; -begin - if a>b then - result:=b - else - result:=a; -end; - -function Max(a,b:integer):integer; -begin - if ab then + result:=b + else + result:=a; +end; + +function Max(a,b:integer):integer; +begin + if anil) and (buf^<>#0) then @@ -1198,6 +1198,46 @@ begin end; end; +function FormatStrW(fmt:pWideChar; arr:array of pWideChar):pWideChar; +var + i,len:integer; + pc:pWideChar; + number:integer; +begin + result:=nil; + if (fmt=nil) or (fmt^=#0) then + exit; + + // calculate length + len:=StrLenW(fmt); // -2*Length(arr) + for i:=0 to HIGH(arr) do + inc(len,StrLenW(arr[i])); + + // format + mGetMem(result,(len+1)*SizeOf(WideChar)); + pc:=result; + number:=0; + while fmt^<>#0 do + begin + if (fmt^='%') and ((fmt+1)^='s') then + begin + if number<=HIGH(arr) then + begin + pc:=StrCopyEW(pc,arr[number]); + inc(number); + end; + inc(fmt,2); + end + else + begin + pc^:=fmt^; + inc(pc); + inc(fmt); + end; + end; + pc^:=#0; +end; + // ----- base string functions ----- function StrDup(var dst:PAnsiChar;src:PAnsiChar;len:cardinal=0):PAnsiChar; var @@ -1510,7 +1550,7 @@ begin end; end; -function StrCmp(a,b:PAnsiChar;n:cardinal=0):integer; // CompareString +function StrCmp(a,b:PAnsiChar;n:integer=0):integer; // CompareString begin result:=0; if (a=nil) and (b=nil) then @@ -1530,7 +1570,7 @@ begin until n=0; end; -function StrCmpW(a,b:PWideChar;n:cardinal=0):integer; +function StrCmpW(a,b:PWideChar;n:integer=0):integer; begin result:=0; if (a=nil) and (b=nil) then diff --git a/plugins/Utils.pas/mApiCardM.pas b/plugins/Utils.pas/mApiCardM.pas index 6002ee2dbc..41ce4e2aa3 100644 --- a/plugins/Utils.pas/mApiCardM.pas +++ b/plugins/Utils.pas/mApiCardM.pas @@ -384,7 +384,7 @@ begin title:='Miranda event help'; note :=''; end; - SendMessageW(HelpWindow,WM_SETTEXT,0,LPARAM(title)); + SendMessageW(HelpWindow,WM_SETTEXT,0,LPARAM(TranslateW(title))); SendMessageW(GetDlgItem(HelpWindow,IDC_HLP_NOTE),WM_SETTEXT,0,LPARAM(TranslateW(Note))); end; diff --git a/plugins/Watrack/i_gui.inc b/plugins/Watrack/i_gui.inc index 2ed5411bed..ad697d6fa5 100644 --- a/plugins/Watrack/i_gui.inc +++ b/plugins/Watrack/i_gui.inc @@ -25,7 +25,7 @@ begin ttbState:=0 else CallService(MS_TTB_SETBUTTONOPTIONS,(ttbState shl 16)+TTBO_TIPNAME, - tlparam(Translate('Disable Plugin'))); + tlparam(Translate('Disable WATrack'))); result:=0; end; @@ -38,7 +38,7 @@ begin mi.szPopupName.a:=PluginShort; mi.hIcon :=CallService(MS_SKIN2_GETICON,0,lparam(IcoBtnEnable)); - mi.szName.a :='Disable Plugin'; + mi.szName.a :='Disable WATrack'; mi.pszService :=MS_WAT_PLUGINSTATUS; mi.popupPosition:=MenuDisablePos; hMenuDisable:=Menu_AddMainMenuItem(@mi); @@ -55,12 +55,12 @@ begin if f1<>0 then begin mi.hIcon :=CallService(MS_SKIN2_GETICON,0,lparam(IcoBtnDisable)); - mi.szName.a:='Enable Plugin'; + mi.szName.a:='Enable WATrack'; end else begin mi.hIcon :=CallService(MS_SKIN2_GETICON,0,lparam(IcoBtnEnable)); - mi.szName.a:='Disable Plugin'; + mi.szName.a:='Disable WATrack'; end; CallService(MS_CLIST_MODIFYMENUITEM,hMenuDisable,lparam(@mi)); @@ -68,12 +68,12 @@ begin begin if f1<>0 then begin - p:='Enable Plugin'; + p:='Enable WATrack'; CallService(MS_TTB_SETBUTTONSTATE,ttbState,TTBST_RELEASED) end else begin - p:='Disable Plugin'; + p:='Disable WATrack'; CallService(MS_TTB_SETBUTTONSTATE,ttbState,TTBST_PUSHED); end; CallService(MS_TTB_SETBUTTONOPTIONS,(ttbState shl 16)+TTBO_TIPNAME, @@ -97,6 +97,12 @@ begin // toptoolbar if ServiceExists(MS_TTB_GETBUTTONOPTIONS)<>0 then begin +{ + CallService(MS_TTB_GETBUTTONOPTIONS,(ttbInfo shl 16)+TTBO_ALLDATA,tlparam(@ttb)); + ttb.hIconUp:=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnInfo)); + ttb.hIconDn:=ttb.hIconUp; + CallService(MS_TTB_SETBUTTONOPTIONS,(ttbInfo shl 16)+TTBO_ALLDATA,tlparam(@ttb)); +} CallService(MS_TTB_GETBUTTONOPTIONS,(ttbState shl 16)+TTBO_ALLDATA,tlparam(@ttb)); ttb.hIconDn:=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnEnable)); ttb.hIconUp:=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnDisable)); diff --git a/plugins/Watrack/players/pl_mradio.pas b/plugins/Watrack/players/pl_mradio.pas index 3d97037fbb..68589eb159 100644 --- a/plugins/Watrack/players/pl_mradio.pas +++ b/plugins/Watrack/players/pl_mradio.pas @@ -72,7 +72,7 @@ function Fill:integer; var i:integer; begin - CurrentStation:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + CurrentStation:=db_find_first(playername); while CurrentStation<>0 do begin i:=DBReadWord(CurrentStation,playername,'Status',WORD(-1)); @@ -81,7 +81,7 @@ begin result:=1; exit; end; - CurrentStation:=CallService(MS_DB_CONTACT_FINDNEXT,CurrentStation,0); + CurrentStation:=db_find_next(CurrentStation,playername); end; result:=WAT_RES_NOTFOUND; end; @@ -234,9 +234,7 @@ end; function GetInfo(var SongInfo:tSongInfo;flags:integer):integer;cdecl; var - lfile:pWideChar; isRemote:bool; - isChanging:bool; begin result:=0; if (flags and WAT_OPT_PLAYERDATA)<>0 then @@ -259,32 +257,20 @@ begin end else begin - lfile:=GetFileName(plwnd,flags); - isRemote:=StrPosW(lfile,'://')<>nil; - if (prevfile=nil) or isRemote or (StrCmpW(prevfile,lfile)<>0) then + isRemote:=StrPosW(mfile,'://')<>nil; + if (prevfile=nil) or isRemote or (StrCmpW(prevfile,mfile)<>0) then begin ClearTrackInfo(SongInfo,false); - mfile:=lfile; mFreeMem(prevfile); StrDupW(prevfile,mfile); - isChanging:=true; - end - else - begin - isChanging:=false; - mFreeMem(lfile); - end; - if not isRemote then - begin - if isChanging then + if not isRemote then begin CallService(MS_WAT_GETFILEINFO,0,lparam(@SongInfo)); fsize:=GetFSize(mfile); - mFreeMem(prevfile); - StrDupW(prevfile,mfile); end; end; + //!! if kbps =0 then kbps :=GetKbps; if genre =nil then genre :=GetGenre; diff --git a/plugins/Watrack/proto/i_proto_dlg.inc b/plugins/Watrack/proto/i_proto_dlg.inc index 3c467c79ac..ebfd6d31c9 100644 --- a/plugins/Watrack/proto/i_proto_dlg.inc +++ b/plugins/Watrack/proto/i_proto_dlg.inc @@ -4,7 +4,7 @@ procedure SetAllContactStat(hwndList:HWND); var hContact,hItem:THANDLE; begin - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(); while hContact<>0 do begin hItem:=SendMessage(hwndList,CLM_FINDCONTACT,hContact,0); @@ -13,7 +13,7 @@ begin SendMessage(hwndList,CLM_SETCHECKMARK,hItem, DBReadByte(hContact,strCList,ShareOptText,0)); end; - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + hContact:=db_find_next(hContact); end; end; @@ -21,7 +21,7 @@ procedure SaveAllContactStat(hwndList:HWND); var hContact,hItem:THANDLE; begin - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(); while hContact<>0 do begin hItem:=SendMessage(hwndList,CLM_FINDCONTACT,hContact,0); @@ -32,7 +32,7 @@ begin else DBDeleteSetting(hContact,strCList,ShareOptText); end; - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + hContact:=db_find_next(hContact); end; end; @@ -100,7 +100,7 @@ begin cii.cbSize :=SizeOf(cii); cii.flags :=CLCIIF_GROUPFONT or CLCIIF_CHECKBOX; cii.pszText.w:=TranslateW('** All contacts **'); - hItemAll:=SendMessage(hList,CLM_ADDINFOITEM,0,dword(@cii)); + hItemAll:=SendMessage(hList,CLM_ADDINFOITEM,0,tlparam(@cii)); } SetAllContactStat(hList); SetHistMask(Dialog); diff --git a/plugins/Watrack/proto/proto.pas b/plugins/Watrack/proto/proto.pas index 5ff19c1b25..416a610a31 100644 --- a/plugins/Watrack/proto/proto.pas +++ b/plugins/Watrack/proto/proto.pas @@ -185,18 +185,18 @@ begin WideToAnsi(ss,p,UserCP); if ccs^.wParam=0 then begin - ccs^.lParam:=dword(p); + ccs^.lParam:=tlparam(p); end else begin move(PAnsiChar(ss)^,(PAnsiChar(ss)+StrLen(p)+1)^, (StrLenW(ss)+1)*SizeOf(WideChar)); StrCopy(PAnsiChar(ss),p); - ccs^.lParam:=dword(ss); + ccs^.lParam:=tlparam(ss); end; result:=CallService(MS_PROTO_CHAINSEND,wParam,lParam); mFreeMem(p); - ccs^.lParam:=dword(s); + ccs^.lParam:=tlparam(s); mFreeMem(ss); exit; end; @@ -313,7 +313,7 @@ begin i:=WideToCombo(textpos,encbuf,UserCP); if (HistMask and hmOutInfo)<>0 then AddEvent(ccs^.hContact,EVENTTYPE_WAT_MESSAGE,DBEF_SENT,encbuf,i); -// if CallContactService(ccs^.hContact,PSS_MESSAGEW,PREF_UNICODE,dword(encbuf))= +// if CallContactService(ccs^.hContact,PSS_MESSAGEW,PREF_UNICODE,tlparam(encbuf))= // ACKRESULT_FAILED then CallContactService(ccs^.hContact,PSS_MESSAGE,PREF_UNICODE,tlparam(encbuf)); end; @@ -409,12 +409,12 @@ procedure RegisterContacts; var hContact:integer; begin - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(); while hContact<>0 do begin if not IsChat(hContact) then CallService(MS_PROTO_ADDTOCONTACT,hContact,lparam(PluginShort)); - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + hContact:=db_find_next(hContact); end; end; @@ -476,7 +476,7 @@ begin FillChar(mi, sizeof(mi), 0); mi.cbSize :=sizeof(mi); mi.szPopupName.a:=PluginShort; - mi.flags :=CMIF_NOTOFFLINE or CMIF_NOTOFFLIST or CMIF_ICONFROMICOLIB; + mi.flags :=CMIF_NOTOFFLINE or CMIF_NOTOFFLIST; // mi.popupPosition:=MenuUserInfoPos; mi.hIcon :=Icons.hIcolib; mi.szName.a :='Get user''s Music Info'; @@ -517,6 +517,7 @@ begin vproto.Init :=@InitProc; vproto.DeInit :=@DeInitProc; vproto.AddOption :=@AddOptionsPage; + vproto.Check :=nil; vproto.ModuleName:='Protocol'; ModuleLink :=@vproto; end; diff --git a/plugins/mRadio/i_frameapi.inc b/plugins/mRadio/i_frameapi.inc index baca5d885f..8f70edbf7a 100644 --- a/plugins/mRadio/i_frameapi.inc +++ b/plugins/mRadio/i_frameapi.inc @@ -47,7 +47,7 @@ begin WM_INITDIALOG: begin hMuteFrmCtrl:=GetDlgItem(Dialog,IDC_RADIO_MUTE); SendMessage(hMuteFrmCtrl, BUTTONSETASFLATBTN,0,0); - SetButtonIcon(hMuteFrmCtrl,IcoBtnOn); +// SetButtonIcon(hMuteFrmCtrl,IcoBtnOn); hwndTooltip:=CreateWindowW(TOOLTIPS_CLASS,nil,TTS_ALWAYSTIP, integer(CW_USEDEFAULT),integer(CW_USEDEFAULT), @@ -189,7 +189,7 @@ begin begin cbSize :=SizeOf(Frame); hWnd :=FrameWnd; - hIcon :=0; + hIcon :=CallService(MS_SKIN2_GETICON,0,lparam(IcoBtnSettings)); align :=alTop; height :=tr.bottom-tr.top+2; Flags :=F_VISIBLE or F_NOBORDER or F_UNICODE; diff --git a/plugins/mRadio/i_hotkey.inc b/plugins/mRadio/i_hotkey.inc index 8b165bdc23..44e4910699 100644 --- a/plugins/mRadio/i_hotkey.inc +++ b/plugins/mRadio/i_hotkey.inc @@ -65,6 +65,7 @@ begin CallService(MS_HOTKEY_UNREGISTER,0,lparam(HKN_PLAYPAUSE)); CallService(MS_HOTKEY_UNREGISTER,0,lparam(HKN_STOP)); CallService(MS_HOTKEY_UNREGISTER,0,lparam(HKN_MUTE)); + CallService(MS_HOTKEY_UNREGISTER,0,lparam(HKN_RECORD)); DestroyServiceFunction(hRadioHotkey); end; diff --git a/plugins/mRadio/i_myservice.inc b/plugins/mRadio/i_myservice.inc index e4e76ba10f..d938a08d92 100644 --- a/plugins/mRadio/i_myservice.inc +++ b/plugins/mRadio/i_myservice.inc @@ -29,25 +29,21 @@ begin cni.dwFlag:=CNF_DISPLAY or CNF_UNICODE; cni.szProto :=PluginName; - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(PluginName); while hContact<>0 do begin - p:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)); - if (p<>nil) and (StrCmp(p,PluginName)=0) then + cni.hContact:=hContact; + if CallService(MS_CONTACT_GETCONTACTINFO,0,tlparam(@cni))=0 then begin - cni.hContact:=hContact; - if CallService(MS_CONTACT_GETCONTACTINFO,0,tlparam(@cni))=0 then - begin - if lParam=1 then - i:=StrCmp(pAnsiChar(wParam),cni.retval.szVal.a) - else - i:=StrCmpW(pWideChar(wParam),cni.retval.szVal.w); - mir_free(cni.retval.szVal.w); - if i=0 then - break; - end; + if lParam=1 then + i:=StrCmp(pAnsiChar(wParam),cni.retval.szVal.a) + else + i:=StrCmpW(pWideChar(wParam),cni.retval.szVal.w); + mir_free(cni.retval.szVal.w); + if i=0 then + break; end; - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + hContact:=db_find_next(hContact,PluginName); end; end; diff --git a/plugins/mRadio/i_optdlg.inc b/plugins/mRadio/i_optdlg.inc index 2b5d66535e..7e72aa5409 100644 --- a/plugins/mRadio/i_optdlg.inc +++ b/plugins/mRadio/i_optdlg.inc @@ -126,16 +126,12 @@ begin end else begin - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(PluginName); while hContact<>0 do begin - if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)), - PluginName)=0 then - begin - inc(result); - ExportRadioContact(result,dst,hContact); - end; - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + inc(result); + ExportRadioContact(result,dst,hContact); + hContact:=db_find_next(hContact,PluginName); end; end; end; diff --git a/plugins/mRadio/i_tray.inc b/plugins/mRadio/i_tray.inc index fa63acc720..f0a463c5de 100644 --- a/plugins/mRadio/i_tray.inc +++ b/plugins/mRadio/i_tray.inc @@ -49,32 +49,28 @@ begin // Fill list FillChar(srch,SizeOf(srch),0); - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(PluginName); while hContact<>0 do begin - if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)),cPluginName)=0 then + p:=DBReadUnicode(hContact,strCList,'MyHandle',nil); + if p<>nil then begin - p:=DBReadUnicode(hContact,strCList,'MyHandle',nil); - if p<>nil then + srch.name:=p; + // search in list + if List_GetIndex(@trayStations,@srch,@idx)<>0 then + // found - set mark + pTrayRadioStation(trayStations.Items[idx]).presents:=1 + else // add if not found begin - srch.name:=p; - // search in list - if List_GetIndex(@trayStations,@srch,@idx)<>0 then - // found - set mark - pTrayRadioStation(trayStations.Items[idx]).presents:=1 - else // add if not found - begin - mGetMem(tmp,SizeOf(tTrayRadioStation)); - tmp.name :=p; - tmp.presents:=2; - tmp.hContact:=hContact; - List_InsertPtr(@trayStations,tmp); - end; + mGetMem(tmp,SizeOf(tTrayRadioStation)); + tmp.name :=p; + tmp.presents:=2; + tmp.hContact:=hContact; + List_InsertPtr(@trayStations,tmp); end; end; - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + hContact:=db_find_next(hContact,PluginName); end; - // delete obsolete elements for i:=trayStations.realCount-1 downto 0 do begin diff --git a/plugins/mRadio/mradio.dpr b/plugins/mRadio/mradio.dpr index d8b0432b18..744ccc9813 100644 --- a/plugins/mRadio/mradio.dpr +++ b/plugins/mRadio/mradio.dpr @@ -70,14 +70,11 @@ begin if hContact=0 then begin - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(PluginName); while hContact<>0 do begin - if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)),PluginName)=0 then - begin - DBWriteWord(hContact,PluginName,optStatus,status); - end; - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + DBWriteWord(hContact,PluginName,optStatus,status); + hContact:=db_find_next(hContact,PluginName); end; end else @@ -101,12 +98,12 @@ begin result:=@PluginInfo; PluginInfo.cbSize :=SizeOf(TPLUGININFOEX); PluginInfo.shortName :='mRadio Mod'; - PluginInfo.version :=$00000202; + PluginInfo.version :=$00000203; PluginInfo.description:='This plugin plays and records Internet radio streams.'+ ' Also local media files can be played.'; PluginInfo.author :='Awkward'; PluginInfo.authorEmail:='panda75@bk.ru; awk1975@ya.ru'; - PluginInfo.copyright :='(c) 2007-2012 Awkward'; + PluginInfo.copyright :='(c) 2007-2013 Awkward'; PluginInfo.homepage :='http://code.google.com/p/delphi-miranda-plugins/'; PluginInfo.flags :=UNICODE_AWARE; PluginInfo.uuid :=MIID_MRADIO; @@ -330,7 +327,6 @@ begin PluginStatus:=ID_STATUS_OFFLINE; end; mFreeMem(custom); - Result:=0; end; @@ -344,7 +340,6 @@ exports Load, Unload, MirandaPluginInfoEx; -initialization +begin DisableThreadLibraryCalls(hInstance); - end. diff --git a/plugins/mRadio/mradio.rc b/plugins/mRadio/mradio.rc index 126052f6ee..7037c10d42 100644 --- a/plugins/mRadio/mradio.rc +++ b/plugins/mRadio/mradio.rc @@ -153,7 +153,7 @@ IDI_ADD ICON "ico\new.ico" IDI_DEL ICON "ico\delete.ico" BTN_RECUP ICON "ico\recon.ico" BTN_RECDN ICON "ico\recoff.ico" - +/* LANGUAGE 0,0 VS_VERSION_INFO VERSIONINFO FILEVERSION 0,0,2,2 @@ -183,3 +183,4 @@ BEGIN VALUE "Translation",0,1200 END END +*/ \ No newline at end of file diff --git a/plugins/mRadio/variants.pas b/plugins/mRadio/variants.pas index c7c8fdc824..01337ae11c 100644 --- a/plugins/mRadio/variants.pas +++ b/plugins/mRadio/variants.pas @@ -2,6 +2,11 @@ unit variants; interface +var + Null: Variant; { Null standard constant } + implementation +initialization + TVarData(Null).VType := varNull; end. \ No newline at end of file -- cgit v1.2.3