diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-05-18 22:10:43 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-05-18 22:10:43 +0000 |
commit | 725f68b6808a8a30778f58223fac75386f082785 (patch) | |
tree | ccba410760749d45139e5e78fd5e08f416ade1a0 /plugins/Modernb/_disabled_src | |
parent | f920ef497f3299ae24fe783ce03bdd93b419f764 (diff) |
plugins folders renaming
git-svn-id: http://svn.miranda-ng.org/main/trunk@61 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Modernb/_disabled_src')
18 files changed, 2692 insertions, 0 deletions
diff --git a/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames.c b/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames.c new file mode 100644 index 0000000000..f43402138d --- /dev/null +++ b/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames.c @@ -0,0 +1,54 @@ +/**************************************************************************\
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this code base are copyrighted to Artem Shpynov and/or
+the people listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Mar 19, 2007
+
+Author and Copyright: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+****************************************************************************
+
+File contains implementation of vertical and horizontal frames layout
+Module will substitute existed CLUIFrames feature
+
+The goal is to be:
+1. Back compatibable with CLUIFrames services
+2. Support Transparent frames
+3. Be able to create Horizontal and Vertical layouted frames
+4. Implement fast and unflicker resizing (one pass batch resizing) including during autoresize
+5. Support snapped to its edges frames, and probably other windows
+
+\**************************************************************************/
+
+#include "..\commonheaders.h"
+
+#define __modern_ext_frames_c__include_c_file
+
+#include "modern_ext_frames_private.h" //static definitions
+#include "modern_ext_frames_extern.c" //external available procedures
+#include "modern_ext_frames_intern.c" //static internal procedures
+#include "modern_ext_frames_services.c" //services
+#include "modern_ext_frames_opt.c" //options
+
+#undef __modern_ext_frames_c__include_c_file
+
diff --git a/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_extern.c b/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_extern.c new file mode 100644 index 0000000000..fb5f8b2847 --- /dev/null +++ b/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_extern.c @@ -0,0 +1,99 @@ +/**************************************************************************\
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this code base are copyrighted to Artem Shpynov and/or
+the people listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Mar 19, 2007
+
+Author and Copyright: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+****************************************************************************
+
+File contains realization of externaly available procedures
+for modern_ext_frames.c module.
+
+This file have to be excluded from compilation and need to be adde to project via
+#include preprocessor derective in modern_ext_frames.c
+
+\**************************************************************************/
+
+#include "..\commonheaders.h" //only for precompiled headers
+
+#ifdef __modern_ext_frames_c__include_c_file //protection from adding to compilation
+int ExtFrames_Init()
+{
+ if (ExtFrames.bModuleActive) return 0;
+ InitializeCriticalSection(&ExtFrames.CS);
+ ExtFrames.List=li.List_Create(0,1);
+ ExtFrames.List->sortFunc=_ExtFramesUtils_CopmareFrames;
+ _ExtFrames_InitServices();
+ ExtFrames.bModuleActive = TRUE;
+ return 1;
+}
+
+int ExtFrames_Uninit()
+{
+ efcheck 0;
+ eflock;
+ {
+ ExtFrames.bModuleActive = FALSE;
+ _ExtFrames_UninitServices();
+ li_ListDestruct(ExtFrames.List, _ExtFrames_DestructorOf_EXTFRAMEWND);
+ ExtFrames.bModuleActive = FALSE;
+ }
+ efunlock;
+ DeleteCriticalSection(&ExtFrames.CS);
+ return 1;
+}
+int ExtFrames_GetMinWindowSize( OUT SIZE * size )
+{
+ int minCX=0;
+ int minCY=0;
+
+ efcheck 0;
+ eflock;
+ minCY=_ExtFrames_GetMinParentSize(ExtFrames.List, size);
+ efunlock;
+ return minCY;
+}
+
+int ExtFrames_GetMaxCLCHeight( IN int iMaxDueDesk )
+{
+ int maxHeight=iMaxDueDesk;
+ efcheck 0;
+ eflock;
+ {
+ int i=ExtFrames.List->realCount-1;
+ maxHeight=max(iMaxDueDesk, _ExtFrames_GetMinParentSize(ExtFrames.List,NULL));
+ for (; i>0; --i)
+ {
+ EXTFRAMEWND * extFrame=(EXTFRAMEWND *)ExtFrames.List->items[i];
+ if (extFrame && (extFrame->efrm.dwFlags&F_VISIBLE) && !extFrame->efrm.bFloat && !extFrame->efrm.bNotRegistered)
+ if (extFrame->efrm.nType==EFT_HORIZONTAL)
+ maxHeight-=extFrame->efrm.minCY;
+ }
+ }
+ efunlock;
+ return maxHeight;
+}
+
+#endif
\ No newline at end of file diff --git a/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_intern.c b/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_intern.c new file mode 100644 index 0000000000..4eed16663a --- /dev/null +++ b/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_intern.c @@ -0,0 +1,195 @@ +/**************************************************************************\
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this code base are copyrighted to Artem Shpynov and/or
+the people listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Mar 19, 2007
+
+Author and Copyright: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+****************************************************************************
+
+File contains realization of internal only available procedures
+for modern_ext_frames.c module.
+
+This file have to be excluded from compilation and need to be adde to project via
+#include preprocessor derective in modern_ext_frames.c
+
+\**************************************************************************/
+
+#include "..\commonheaders.h" //only for precompiled headers
+
+#ifdef __modern_ext_frames_c__include_c_file //protection from adding to compilation
+// Closed module methods
+static int _ExtFrames_GetMinParentSize(IN SortedList* pList, OUT SIZE * size )
+{
+ EXTFRAME * clcFrame=(EXTFRAME *) pList->items[pList->realCount-1];
+ int minCX=clcFrame->minCX;
+ int minCY=clcFrame->minCY;
+ int i=pList->realCount-1;
+ for (; i>0; --i)
+ {
+ EXTFRAME * extFrame=(EXTFRAME *)pList->items[i];
+ if (extFrame && (extFrame->dwFlags&F_VISIBLE) && !extFrame->bFloat && !extFrame->bNotRegistered)
+ {
+ if (extFrame->nType==EFT_VERTICAL)
+ {
+ minCX+=extFrame->minCX;
+ minCY=max( minCY, extFrame->minCY );
+ }
+ else
+ {
+ minCY+=extFrame->minCY;
+ minCX=max( minCX,extFrame->minCX );
+ }
+ }
+ }
+ if (size)
+ {
+ size->cx=minCX;
+ size->cy=minCY;
+ }
+ return minCY;
+}
+
+static int _ExtFrames_CalcFramesRect(IN SortedList* pList, IN int width, IN int height, OUT RECT * pOutRect )
+{
+ int outHeight=height;
+ int i;
+ SIZE size;
+ RECT outRect={0};
+ int frmCount=pList->realCount-1;
+ EXTFRAME * clcFrame=(EXTFRAME *)pList->items[frmCount];
+ if (ExtFrames_GetMinWindowSize(&size)) //ensure that we provide normal size
+ {
+ width=max(size.cx,width);
+ height=max(size.cy,height);
+ }
+ outRect.right=width;
+ outRect.bottom=height;
+
+ for (i=0; i<frmCount; i++)
+ {
+ EXTFRAME * extFrame=(EXTFRAME *)pList->items[i];
+ if (extFrame && (extFrame->dwFlags&F_VISIBLE) && !extFrame->bFloat && !extFrame->bNotRegistered)
+ {
+ extFrame->rcFrameRect=outRect;
+ switch(extFrame->nEdge)
+ {
+ case EFP_LEFT:
+ extFrame->rcFrameRect.right=extFrame->rcFrameRect.left+extFrame->minCX;
+ outRect.left+=extFrame->minCX;
+ break;
+ case EFP_RIGHT:
+ extFrame->rcFrameRect.left=extFrame->rcFrameRect.right-extFrame->minCX;
+ outRect.right-=extFrame->minCX;
+ break;
+ case EFP_TOP:
+ extFrame->rcFrameRect.bottom=extFrame->rcFrameRect.top+extFrame->minCY;
+ outRect.top+=extFrame->minCY;
+ break;
+ case EFP_BOTTOM:
+ extFrame->rcFrameRect.top=extFrame->rcFrameRect.bottom-extFrame->minCY;
+ outRect.bottom-=extFrame->minCY;
+ break;
+ }
+ }
+ }
+ clcFrame->rcFrameRect=outRect;
+ if (pOutRect)
+ {
+ pOutRect->top=0;
+ pOutRect->left=0;
+ pOutRect->right=width;
+ pOutRect->bottom=height;
+ }
+ outHeight=height;
+ return height;
+}
+
+static void _ExtFrames_DestructorOf_EXTFRAMEWND(void * extFrame)
+{
+ EXTFRAMEWND * pExtFrameWnd = (EXTFRAMEWND *) extFrame;
+ if (!pExtFrameWnd) return; //early exit
+ if ( pExtFrameWnd->efrm.szFrameNameID ) mir_free( pExtFrameWnd->efrm.szFrameNameID );
+ mir_free( pExtFrameWnd );
+ return;
+}
+
+static void _ExtFrames_GetFrameDBOption(EXTFRAMEWND * pExtFrm)
+{
+ // Each known frame order per 1 000 000
+ // Each Unknown frame but absent during saving per 10 000
+ // Each new unknown per 100
+ static DWORD NextUnknownOrder=100;
+ char szKey[100]={0};
+ DWORD dwOrderInDB;
+ if (!mir_strcmpi(pExtFrm->efrm.szFrameNameID,"My Contacts"))
+ dwOrderInDB=0xFFFFFFFF;
+ else
+ {
+ _snprintf(szKey,sizeof(szKey), EXTFRAMEORDERDBPREFIX "%s",pExtFrm->efrm.szFrameNameID);
+ dwOrderInDB=DBGetContactSettingDword(NULL,EXTFRAMEMODULE,szKey,0);
+ if (!dwOrderInDB)
+ {
+ dwOrderInDB=NextUnknownOrder;
+ NextUnknownOrder+=100;
+ }
+ else
+ NextUnknownOrder = dwOrderInDB + 100;
+ }
+ pExtFrm->efrm.dwOrder=dwOrderInDB;
+
+}
+static int _ExtFramesUtils_CopmareFrames(void * first, void * last)
+{
+ EXTFRAMEWND * pExtFrmWnd1=(EXTFRAMEWND *)first;
+ EXTFRAMEWND * pExtFrmWnd2=(EXTFRAMEWND *)last;
+ if (!pExtFrmWnd1 || ! pExtFrmWnd2) return 0;
+ return pExtFrmWnd1->efrm.dwOrder-pExtFrmWnd2->efrm.dwOrder;
+}
+static void _ExtFramesUtils_CheckAlighment(EXTFRAMEWND * pExtFrm)
+{
+ if (!(pExtFrm->efrm.dwFlags&F_CANBEVERTICAL) && pExtFrm->efrm.nType == EFT_VERTICAL)
+ {
+ //issue have not be ever Vertical
+ int minsize = pExtFrm->efrm.minCX;
+ pExtFrm->efrm.minCX = pExtFrm->efrm.minCY;
+ pExtFrm->efrm.minCY = minsize;
+
+ pExtFrm->efrm.nType = EFT_HORIZONTAL;
+ pExtFrm->efrm.nEdge&=(~alVertFrameMask);
+
+ }
+ else if (pExtFrm->efrm.dwFlags&F_CANBEVERTICAL && !(pExtFrm->efrm.dwFlags&F_CANNOTBEHORIZONTAL) && (pExtFrm->efrm.nType == EFT_HORIZONTAL))
+ {
+ //issue have not be Horizontal
+ int minsize = pExtFrm->efrm.minCX;
+ pExtFrm->efrm.minCX = pExtFrm->efrm.minCY;
+ pExtFrm->efrm.minCY = minsize;
+
+ pExtFrm->efrm.nType=EFT_VERTICAL;
+ pExtFrm->efrm.nEdge|=alVertFrameMask;
+ }
+}
+
+#endif
\ No newline at end of file diff --git a/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_opt.c b/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_opt.c new file mode 100644 index 0000000000..7930530a84 --- /dev/null +++ b/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_opt.c @@ -0,0 +1,346 @@ +/**************************************************************************\
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this code base are copyrighted to Artem Shpynov and/or
+the people listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Mar 19, 2007
+
+Author and Copyright: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+****************************************************************************
+
+File contains realization of options procedures
+for modern_ext_frames.c module.
+
+This file have to be excluded from compilation and need to be adde to project via
+#include preprocessor derective in modern_ext_frames.c
+
+\**************************************************************************/
+
+#include "..\commonheaders.h" //only for precompiled headers
+
+#ifdef __modern_ext_frames_c__include_c_file //protection from adding to compilation
+
+static SortedList * extFrmOptList=NULL;
+
+static int _ExtFrames_OptionsDlgInit(WPARAM wParam,LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp;
+ efcheck 0;
+ if (MirandaExiting()) return 0;
+ ZeroMemory(&odp,sizeof(odp));
+ odp.cbSize=sizeof(odp);
+ odp.position=0;
+ odp.hInstance=g_hInst;
+ //odp.ptszGroup=TranslateT("Contact List");
+ odp.pszTemplate=MAKEINTRESOURCEA(IDD_OPT_EXTFRAMES);
+ odp.ptszTitle=LPGENT("Contact List");
+ odp.pfnDlgProc=_ExtFrames_DlgProcFrameOpts;
+ odp.ptszTab=LPGENT("Frames");
+ odp.flags=ODPF_BOLDGROUPS|ODPF_EXPERTONLY|ODPF_TCHAR;
+#ifdef _DEBUG
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+#endif
+ return 0;
+}
+
+static int _ExtFramesOptUtils_enumdb_Frames (const char *szSetting,LPARAM lParam)
+{
+ EXTFRAMEOPTDBENUMERATION * params=(EXTFRAMEOPTDBENUMERATION *)lParam;
+ char * szName=NULL;
+
+ if (wildcmpi((char*)szSetting,EXTFRAMEORDERDBPREFIX "?*"))
+ {
+ char szDBKey[100];
+ DWORD nOrder;
+ EXTFRAMEWND * pExtFrame;
+ szName=(char*)szSetting+SIZEOF(EXTFRAMEORDERDBPREFIX)-1;
+
+ _snprintf(szDBKey, SIZEOF(szDBKey), EXTFRAMEORDERDBPREFIX"%s", szName);
+ nOrder=DBGetContactSettingDword(NULL, EXTFRAMEMODULE, szDBKey, 0);
+
+ pExtFrame=mir_alloc(sizeof(EXTFRAMEWND));
+ memset(pExtFrame, 0, sizeof(EXTFRAMEWND));
+
+ pExtFrame->efrm.szFrameNameID = mir_strdup(szName);
+ pExtFrame->efrm.bNotRegistered = TRUE;
+ pExtFrame->efrm.dwOrder = nOrder;
+ li.List_Insert(params->pFrameList, pExtFrame, params->pFrameList->realCount);
+ }
+ return 0;
+}
+
+static void _ExtFramesOptUtils_FillListOfFrames(HWND hwndDlg, SortedList * pFrameList)
+{
+ DBCONTACTENUMSETTINGS dbces;
+ EXTFRAMEOPTDBENUMERATION params={0};
+ int i, j;
+
+ //firstly add all known frames from db as not registered
+ params.hwndDlg=hwndDlg;
+ params.pFrameList=pFrameList;
+ dbces.pfnEnumProc=_ExtFramesOptUtils_enumdb_Frames;
+ dbces.szModule=EXTFRAMEMODULE;
+ dbces.ofsSettings=0;
+ dbces.lParam=(LPARAM)¶ms;
+ CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
+
+ //now lets check registered frames and if it in list - set registered if not set add
+ efcheck;
+ eflock;
+ {
+ for (i=0; i<ExtFrames.List->realCount; i++)
+ {
+ EXTFRAMEWND * pRegExtFrm=(EXTFRAMEWND *)ExtFrames.List->items[i];
+ EXTFRAMEWND * pKnownFrm=NULL;
+ for (j=0; j<pFrameList->realCount; j++)
+ {
+ EXTFRAMEWND * pFrm=(EXTFRAMEWND *)pFrameList->items[j];
+ if (!mir_strcmpi(pFrm->efrm.szFrameNameID, pRegExtFrm->efrm.szFrameNameID))
+ {
+ pKnownFrm=pFrm;
+ break;
+ }
+ }
+ if (!pKnownFrm)
+ {
+ pKnownFrm=mir_alloc(sizeof(EXTFRAMEWND));
+ memset(pKnownFrm, 0, sizeof(EXTFRAMEWND));
+ li.List_Insert(pFrameList, pKnownFrm, pFrameList->realCount);
+ }
+ if (pKnownFrm->efrm.szFrameNameID) mir_free(pKnownFrm->efrm.szFrameNameID);
+ *pKnownFrm=*pRegExtFrm;
+ pKnownFrm->efrm.szFrameNameID = mir_strdup(pRegExtFrm->efrm.szFrameNameID);
+ }
+ }
+ efunlock;
+ li_SortList(pFrameList,NULL);
+ //now lets add all Registered and visible frames to frame list
+ for (i=0; i<pFrameList->realCount; i++)
+ {
+ EXTFRAMEWND * pFrm=(EXTFRAMEWND *)pFrameList->items[i];
+ TCHAR * name=mir_a2t(pFrm->efrm.szFrameNameID);
+ int idx=SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_ADDSTRING, 0, (LPARAM)TranslateTS(name));
+ mir_free(name);
+ SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_SETITEMDATA, idx, (LPARAM) pFrm);
+ }
+}
+static void _ExtFramesOptUtils_RenderPreview(HWND hwndDlg, SortedList * pList, HDC hDC)
+{
+ int i;
+ RECT rcCLUIWindow;
+ RECT rcPreviewWindow;
+ RECT outRect={0};
+ float scaleX=1, scaleY=1;
+ HFONT hFont = (HFONT)SendMessage(hwndDlg,WM_GETFONT,0,0);
+ LOGFONT lf;
+ HFONT hNewFont;
+ void * pCurrSelected=NULL;
+ int idx=SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_GETCURSEL, 0,0);
+ int Num=0;
+ if (idx>=0)
+ pCurrSelected=(void*)SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_GETITEMDATA, idx,0);
+ GetObject(hFont, sizeof(lf), &lf);
+
+ GetWindowRect(pcli->hwndContactList,&rcCLUIWindow);
+ OffsetRect(&rcCLUIWindow,-rcCLUIWindow.left, -rcCLUIWindow.top);
+
+ GetWindowRect(GetDlgItem(hwndDlg,IDC_PREVIEW),&rcPreviewWindow);
+ OffsetRect(&rcPreviewWindow,-rcPreviewWindow.left, -rcPreviewWindow.top);
+
+ _ExtFrames_CalcFramesRect(pList, rcCLUIWindow.right, rcCLUIWindow.bottom, &outRect );
+ OffsetRect(&outRect,-outRect.left, -outRect.top);
+
+ if (rcCLUIWindow.right) scaleX=((float)rcPreviewWindow.right/outRect.right);
+ if (rcCLUIWindow.bottom) scaleY=((float)rcPreviewWindow.bottom/outRect.bottom);
+
+ Rectangle(hDC,0,0,rcPreviewWindow.right,rcPreviewWindow.bottom);
+ for (i=0; i<pList->realCount; i++)
+ {
+ EXTFRAMEWND * pExtFrm=(EXTFRAMEWND *)pList->items[i];
+
+ if (pExtFrm->efrm.dwFlags&F_VISIBLE && !pExtFrm->efrm.bNotRegistered && !pExtFrm->efrm.bFloat)
+ {
+ if (pExtFrm->efrm.nType&EFT_VERTICAL)
+ lf.lfEscapement=900;
+ else
+ lf.lfEscapement=0;
+ if (pCurrSelected==pExtFrm)
+ {
+ SelectObject(hDC,GetSysColorBrush(COLOR_HIGHLIGHT));
+ SetTextColor(hDC,GetSysColor(COLOR_HIGHLIGHTTEXT));
+ SetBkColor(hDC,GetSysColor(COLOR_HIGHLIGHT));
+ } else {
+ SelectObject(hDC,GetSysColorBrush(COLOR_WINDOW));
+ SetTextColor(hDC,GetSysColor(COLOR_WINDOWTEXT));
+ SetBkColor(hDC,GetSysColor(COLOR_WINDOW));
+ }
+ hNewFont=CreateFontIndirect(&lf);
+ SelectObject(hDC,hNewFont);
+
+ outRect=pExtFrm->efrm.rcFrameRect;
+ outRect.left=(int)(scaleX*outRect.left);
+ outRect.top=(int)(scaleY*outRect.top);
+ outRect.right=(int)(scaleX*outRect.right);
+ outRect.bottom=(int)(scaleY*outRect.bottom);
+ Rectangle(hDC,outRect.left,outRect.top,outRect.right,outRect.bottom);
+ {
+ char szText[100];
+ Num++;
+ _snprintf(szText,SIZEOF(szText),"%d. <%s>",Num, Translate(pExtFrm->efrm.szFrameNameID));
+ DrawTextA(hDC,szText,-1,&outRect,DT_VCENTER|DT_CENTER|DT_NOPREFIX|DT_SINGLELINE);
+ }
+ SelectObject(hDC,GetStockObject(SYSTEM_FONT));
+ DeleteObject(hNewFont);
+ }
+ }
+
+}
+
+static void _ExtFramesOptUtils_UpdateFrameOptControl(HWND hwndDlg, SortedList * pList)
+{
+ int idx=SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_GETCURSEL, 0,0);
+ int count=SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_GETCOUNT, 0,0);
+ RECT rcCLUIWindow;
+ GetWindowRect(pcli->hwndContactList,&rcCLUIWindow);
+ OffsetRect(&rcCLUIWindow,-rcCLUIWindow.left, -rcCLUIWindow.top);
+
+ EnableWindow(GetDlgItem(hwndDlg,IDC_BUTTON_UP),(idx>0 && idx<count-1));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_BUTTON_DOWN),(idx>=0 && idx<count-2));
+ InvalidateRect(GetDlgItem(hwndDlg,IDC_PREVIEW),NULL, TRUE);
+}
+
+static void _ExtFramesOptUtils_UpdateNotRegisteredFrames(SortedList * pList, DWORD startNewOrder, EXTFRAMEWND * pFrm1, EXTFRAMEWND * pFrm2)
+{
+ int i;
+ BOOL afterFrame=FALSE;
+ DWORD newOrder=startNewOrder+1;
+ afterFrame=FALSE;
+ for (i=0; i<pList->realCount; i++)
+ {
+ if (afterFrame && pList->items[i]==pFrm2) break;
+ if (afterFrame)
+ {
+ EXTFRAMEWND * pFrm=(EXTFRAMEWND *)pList->items[i];
+ if (pFrm->efrm.bNotRegistered) pFrm->efrm.dwOrder=newOrder++;
+ else break;
+ }
+ if (pList->items[i]==pFrm1)
+ afterFrame=TRUE;
+ }
+
+}
+
+static void _ExtFramesOptUtils_ExchangeItems(HWND hwndDlg, SortedList * pList, int fst, int scnd)
+{
+ int first,second;
+ first=min(fst,scnd);
+ second=max(fst,scnd);
+ if (first>=0 && second>=0 && first!=second)
+ {
+ EXTFRAMEWND * pFrm1=(EXTFRAMEWND *)SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_GETITEMDATA, first, 0);
+ EXTFRAMEWND * pFrm2=(EXTFRAMEWND *)SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_GETITEMDATA, second, 0);
+ int len=SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_GETTEXTLEN, second, 0);
+ TCHAR * secondText=mir_alloc(len*sizeof(TCHAR));
+ int idx;
+ SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_GETTEXT, second, (LPARAM)secondText);
+ SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_DELETESTRING, second, 0);
+ idx=SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_INSERTSTRING, first, (LPARAM)secondText);
+ SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_SETITEMDATA, idx, (LPARAM) pFrm2);
+ //TO DO: change order in li.list
+ {
+ int newFirstOrder=pFrm2->efrm.dwOrder;
+ int newSecondOrder=pFrm1->efrm.dwOrder;
+
+ pFrm1->efrm.dwOrder=newFirstOrder;
+ pFrm2->efrm.dwOrder=newSecondOrder;
+ _ExtFramesOptUtils_UpdateNotRegisteredFrames(pList,newFirstOrder, pFrm1, pFrm2 );
+ _ExtFramesOptUtils_UpdateNotRegisteredFrames(pList,newSecondOrder, pFrm2, pFrm1 );
+ li_SortList(pList,NULL);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_SETCURSEL, fst, 0);
+ _ExtFramesOptUtils_UpdateFrameOptControl(hwndDlg,pList);
+ }
+}
+
+static BOOL CALLBACK _ExtFrames_DlgProcFrameOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_DRAWITEM:
+ if (wParam==IDC_PREVIEW)
+ {
+ DRAWITEMSTRUCT * lpDrawItem=(DRAWITEMSTRUCT *)lParam;
+ _ExtFramesOptUtils_RenderPreview(hwndDlg,extFrmOptList,lpDrawItem->hDC);
+ return TRUE;
+ }
+ break;
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hwndDlg);
+ extFrmOptList=li.List_Create(0,1);
+ extFrmOptList->sortFunc=_ExtFramesUtils_CopmareFrames;
+ _ExtFramesOptUtils_FillListOfFrames(hwndDlg,extFrmOptList);
+ _ExtFramesOptUtils_UpdateFrameOptControl(hwndDlg,extFrmOptList);
+ return TRUE;
+ }
+ case WM_COMMAND:
+ {
+ if (LOWORD(wParam)==IDC_EXTRAORDER &&
+ (HIWORD(wParam)==LBN_SELCHANGE || HIWORD(wParam)==LBN_SELCANCEL ) )
+ {
+ _ExtFramesOptUtils_UpdateFrameOptControl(hwndDlg, extFrmOptList);
+ return TRUE;
+ }
+ else if (HIWORD(wParam)==BN_CLICKED &&
+ (LOWORD(wParam)==IDC_BUTTON_UP || LOWORD(wParam)==IDC_BUTTON_DOWN))
+ {
+ int idx=SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, LB_GETCURSEL, 0,0);
+ if (LOWORD(wParam)==IDC_BUTTON_UP)
+ _ExtFramesOptUtils_ExchangeItems(hwndDlg, extFrmOptList, idx-1, idx);
+ else
+ _ExtFramesOptUtils_ExchangeItems(hwndDlg, extFrmOptList, idx+1, idx);
+ return TRUE;
+ }
+
+ break;
+ }
+ case WM_DESTROY:
+ {
+ li_ListDestruct(extFrmOptList,_ExtFrames_DestructorOf_EXTFRAMEWND);
+ extFrmOptList=NULL;
+ }
+ return TRUE;
+ case 0:
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_APPLY:
+ {
+
+ }
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+#endif
\ No newline at end of file diff --git a/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_private.h b/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_private.h new file mode 100644 index 0000000000..03f8e725a3 --- /dev/null +++ b/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_private.h @@ -0,0 +1,132 @@ +/**************************************************************************\
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this code base are copyrighted to Artem Shpynov and/or
+the people listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Mar 19, 2007
+
+Author and Copyright: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+\**************************************************************************/
+
+#define eflock EnterCriticalSection(&ExtFrames.CS)
+#define efunlock LeaveCriticalSection(&ExtFrames.CS)
+#define efcheck if (!ExtFrames.bModuleActive) return
+
+#define EFT_VERTICAL 1
+#define EFT_HORIZONTAL 0
+
+#define EFP_LEFT alLeft
+#define EFP_TOP alTop
+#define EFP_RIGHT alRight
+#define EFP_BOTTOM alBottom
+
+#define EXTFRAMEMODULE "ExtFrames"
+#define EXTFRAMEORDERDBPREFIX "FrameOrder/"
+
+typedef struct tagExtFrameRectDef
+{
+ DWORD dwOrder;
+ /* Used in both for frames and for options */
+ int minCX;
+ int minCY;
+ BYTE nType;
+ BYTE nEdge;
+ BOOL bInPrevious;
+ RECT rcFrameRect;
+ char *szFrameNameID; //to be dealloced in destructor
+
+ /* Used for real frames and faked in options */
+ DWORD dwFlags;
+ BOOL bFloat;
+ BOOL bNotRegistered; // for options means frame is Not Registered
+} EXTFRAME;
+
+typedef struct tagExtFrameWndDef
+{
+ EXTFRAME efrm; //have to be first element
+ //EXTFRAMEWND* can be directly type casted to EXTFRAME*
+
+ /* Used Only for real frames */
+ HWND hwndFrame;
+ HWND hwndTitle;
+ DWORD dwFrameID;
+
+} EXTFRAMEWND;
+
+typedef struct tagExtFrameModule
+{
+ CRITICAL_SECTION CS;
+ BOOL bModuleActive;
+ SortedList * List;
+ HANDLE hookSBShowTooltip; // ME_CLIST_FRAMES_SB_SHOW_TOOLTIP
+ HANDLE hookSBHideTooltip; // ME_CLIST_FRAMES_SB_HIDE_TOOLTIP
+ HANDLE hookPrebuildFrameMenu; // ME_CLIST_PREBUILDFRAMEMENU
+ DWORD dwNextFrameID; // unique number of registered frames
+}EXTFRAMESMODULE;
+
+typedef struct tagExtFramesOptDBEnumeration
+{
+ HWND hwndDlg;
+ SortedList * pFrameList;
+}EXTFRAMEOPTDBENUMERATION;
+
+//////////////////////////////////////////////////////////////////////////
+// Static Declarations
+
+// modern_ext_frames_intern.c
+static void _ExtFrames_DestructorOf_EXTFRAMEWND(void * extFrame);
+static int _ExtFrames_CalcFramesRect( IN SortedList* pList, IN int width, IN int height, OUT RECT * pWndRect );
+static int _ExtFrames_GetMinParentSize( IN SortedList* pList, OUT SIZE * size );
+static void _ExtFrames_GetFrameDBOption( IN OUT EXTFRAMEWND * pExtFrm );
+static void _ExtFramesUtils_CheckAlighment( IN OUT EXTFRAMEWND * extFrame );
+static int _ExtFramesUtils_CopmareFrames(void * first, void * last);
+
+
+// modern_ext_frames_services.c
+static void _ExtFrames_InitServices();
+static void _ExtFrames_UninitServices();
+
+// modern_ext_frames_opt.c
+static int _ExtFrames_OptionsDlgInit(WPARAM wParam,LPARAM lParam);
+static BOOL CALLBACK _ExtFrames_DlgProcFrameOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
+//
+/**static*/ int _ExtFramesSrv_AddFrame(WPARAM wParam, LPARAM lParam);
+static int _ExtFramesSrv_RemoveFrame(WPARAM wParam, LPARAM lParam);
+static int _ExtFramesSrv_ShowAllFrames(WPARAM wParam, LPARAM lParam);
+static int _ExtFramesSrv_ShowAllFramesTB(WPARAM wParam, LPARAM lParam);
+static int _ExtFramesSrv_HideAllFramesTB(WPARAM wParam, LPARAM lParam);
+static int _ExtFramesSrv_SHFrame(WPARAM wParam, LPARAM lParam);
+static int _ExtFramesSrv_SHFrameTitleBar(WPARAM wParam, LPARAM lParam);
+static int _ExtFramesSrv_ULFrame(WPARAM wParam, LPARAM lParam);
+static int _ExtFramesSrv_UCollFrame(WPARAM wParam, LPARAM lParam);
+static int _ExtFramesSrv_SetUnBorder(WPARAM wParam, LPARAM lParam);
+static int _ExtFramesSrv_UpdateFrame(WPARAM wParam, LPARAM lParam);
+static int _ExtFramesSrv_GetFrameOptions(WPARAM wParam, LPARAM lParam);
+static int _ExtFramesSrv_SetFrameOptions(WPARAM wParam, LPARAM lParam);
+
+
+
+//////////////////////////////////////////////////////////////////////////
+// Static Local Global Variable
+static EXTFRAMESMODULE ExtFrames={0};
\ No newline at end of file diff --git a/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_services.c b/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_services.c new file mode 100644 index 0000000000..e56be79255 --- /dev/null +++ b/plugins/Modernb/_disabled_src/ExtFrames/modern_ext_frames_services.c @@ -0,0 +1,386 @@ +/**************************************************************************\
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this code base are copyrighted to Artem Shpynov and/or
+the people listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Mar 19, 2007
+
+Author and Copyright: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+****************************************************************************
+
+File contains realization of service procedures
+for modern_ext_frames.c module.
+
+This file have to be excluded from compilation and need to be adde to project via
+#include preprocessor derective in modern_ext_frames.c
+
+\**************************************************************************/
+
+#include "..\commonheaders.h" //only for precompiled headers
+
+#ifdef __modern_ext_frames_c__include_c_file //protection from adding to compilation
+
+static void _ExtFrames_InitServices()
+{
+ //Create services here
+ /*
+ CreateServiceFunction( MS_CLIST_FRAMES_ADDFRAME, _ExtFramesSrv_AddFrame );
+ CreateServiceFunction( MS_CLIST_FRAMES_REMOVEFRAME, _ExtFramesSrv_RemoveFrame );
+ CreateServiceFunction( MS_CLIST_FRAMES_SHOWALLFRAMES, _ExtFramesSrv_ShowAllFrames );
+ CreateServiceFunction( MS_CLIST_FRAMES_SHOWALLFRAMESTB, _ExtFramesSrv_ShowAllFramesTB );
+ CreateServiceFunction( MS_CLIST_FRAMES_HIDEALLFRAMESTB, _ExtFramesSrv_HideAllFramesTB );
+ CreateServiceFunction( MS_CLIST_FRAMES_SHFRAME, _ExtFramesSrv_SHFrame );
+ CreateServiceFunction( MS_CLIST_FRAMES_SHFRAMETITLEBAR, _ExtFramesSrv_SHFrameTitleBar );
+ CreateServiceFunction( MS_CLIST_FRAMES_ULFRAME, _ExtFramesSrv_ULFrame );
+ CreateServiceFunction( MS_CLIST_FRAMES_UCOLLFRAME, _ExtFramesSrv_UCollFrame );
+ CreateServiceFunction( MS_CLIST_FRAMES_SETUNBORDER, _ExtFramesSrv_SetUnBorder );
+ CreateServiceFunction( MS_CLIST_FRAMES_UPDATEFRAME, _ExtFramesSrv_UpdateFrame );
+ CreateServiceFunction( MS_CLIST_FRAMES_GETFRAMEOPTIONS, _ExtFramesSrv_GetFrameOptions );
+ CreateServiceFunction( MS_CLIST_FRAMES_SETFRAMEOPTIONS, _ExtFramesSrv_SetFrameOptions );
+
+ //TODO Frame menu stuff services
+
+ //register event hook here
+ ExtFrames.hookSBShowTooltip = CreateHookableEvent( ME_CLIST_FRAMES_SB_SHOW_TOOLTIP );
+ ExtFrames.hookSBHideTooltip = CreateHookableEvent( ME_CLIST_FRAMES_SB_HIDE_TOOLTIP );
+ ExtFrames.hookPrebuildFrameMenu = CreateHookableEvent( ME_CLIST_PREBUILDFRAMEMENU );
+ */
+
+ //Hook other events
+ HookEvent(ME_OPT_INITIALISE,_ExtFrames_OptionsDlgInit);
+}
+
+static void _ExtFrames_UninitServices()
+{
+ if (ExtFrames.hookSBShowTooltip) UnhookEvent( ExtFrames.hookSBShowTooltip );
+ if (ExtFrames.hookSBHideTooltip) UnhookEvent( ExtFrames.hookSBHideTooltip );
+ if (ExtFrames.hookPrebuildFrameMenu) UnhookEvent( ExtFrames.hookPrebuildFrameMenu );
+
+ ExtFrames.hookSBShowTooltip = NULL;
+ ExtFrames.hookSBHideTooltip = NULL;
+ ExtFrames.hookPrebuildFrameMenu = NULL;
+}
+
+//////////////////////////////////////////////////////////////////////////
+//want show tooltip for statusbar
+//wparam=(char *)protocolname
+//lparam=0
+//#define ME_CLIST_FRAMES_SB_SHOW_TOOLTIP "CListFrames/StatusBarShowToolTip"
+
+//////////////////////////////////////////////////////////////////////////
+//want hide tooltip for statusbar
+//wparam=lparam=0
+//#define ME_CLIST_FRAMES_SB_HIDE_TOOLTIP "CListFrames/StatusBarHideToolTip"
+
+//////////////////////////////////////////////////////////////////////////
+//adds a frame window
+//wParam=(CLISTFrame*)
+//lParam=0
+//returns an integer, the frame id.
+//#define MS_CLIST_FRAMES_ADDFRAME "CListFrames/AddFrame"
+/**static*/ int _ExtFramesSrv_AddFrame(WPARAM wParam, LPARAM lParam)
+{
+ CLISTFrame *clfrm=(CLISTFrame *)wParam;
+ int frameId = -1;
+
+ // the clfrm->name is used as id in DB and frames without it will not be supported
+ if ( !clfrm || pcli->hwndContactList == NULL || clfrm->cbSize!=sizeof(CLISTFrame) || clfrm->name==NULL)
+ return frameId;
+
+ efcheck frameId;
+ eflock;
+ {
+ EXTFRAMEWND * pExtFrm=(EXTFRAMEWND *)mir_alloc(sizeof(EXTFRAMEWND));
+ memset(pExtFrm,0,sizeof(EXTFRAMEWND));
+ pExtFrm->dwFrameID = ExtFrames.dwNextFrameID++;
+ pExtFrm->hwndFrame = clfrm->hWnd;
+ pExtFrm->efrm.szFrameNameID = mir_strdup(clfrm->name);
+
+ //fill frame info by caller provided values
+ pExtFrm->efrm.dwFlags = clfrm->Flags;
+ // frame alignment
+ pExtFrm->efrm.nEdge = clfrm->align;
+ pExtFrm->efrm.nType = (clfrm->align&alVertFrameMask) ? EFT_VERTICAL : EFT_HORIZONTAL;
+
+ if (pExtFrm->efrm.nType == EFT_VERTICAL)
+ pExtFrm->efrm.minCX = clfrm->minSize;
+ else
+ pExtFrm->efrm.minCY = clfrm->minSize;
+
+ _ExtFrames_GetFrameDBOption(pExtFrm);
+ _ExtFramesUtils_CheckAlighment(pExtFrm);
+ li.List_Insert(ExtFrames.List, pExtFrm, 0);
+ //clfrm->hIcon
+ //clfrm->TBname
+
+ frameId=pExtFrm->dwFrameID;
+ }
+ efunlock;
+ return frameId; //frame id
+}
+//////////////////////////////////////////////////////////////////////////
+// remove frame. It does not destroy your window
+//
+//#define MS_CLIST_FRAMES_REMOVEFRAME "CListFrames/RemoveFrame"
+static int _ExtFramesSrv_RemoveFrame(WPARAM wParam, LPARAM lParam)
+{
+ efcheck 0;
+ eflock;
+ {
+ // DO HERE
+ }
+ efunlock;
+ return 0;
+}
+//////////////////////////////////////////////////////////////////////////
+//shows all frames
+//wParam=lParam=0
+//returns 0 on success, -1 on failure
+//#define MS_CLIST_FRAMES_SHOWALLFRAMES "CListFrames/ShowALLFrames"
+static int _ExtFramesSrv_ShowAllFrames(WPARAM wParam, LPARAM lParam)
+{
+ efcheck -1;
+ eflock;
+ {
+ // DO HERE
+ }
+ efunlock;
+ return 0;
+}
+//////////////////////////////////////////////////////////////////////////
+//shows the titlebars of all frames
+//wParam=lParam=0
+//returns 0 on success, -1 on failure
+//#define MS_CLIST_FRAMES_SHOWALLFRAMESTB "CListFrames/ShowALLFramesTB"
+static int _ExtFramesSrv_ShowAllFramesTB(WPARAM wParam, LPARAM lParam)
+{
+ efcheck -1;
+ eflock;
+ {
+ // DO HERE
+ }
+ efunlock;
+ return 0;
+}
+
+//////////////////////////////////////////////////////////////////////////
+//hides the titlebars of all frames
+//wParam=lParam=0
+//returns 0 on success, -1 on failure
+//#define MS_CLIST_FRAMES_HIDEALLFRAMESTB "CListFrames/HideALLFramesTB"
+static int _ExtFramesSrv_HideAllFramesTB(WPARAM wParam, LPARAM lParam)
+{
+ efcheck -1;
+ eflock;
+ {
+ // DO HERE
+ }
+ efunlock;
+ return 0;
+}
+//////////////////////////////////////////////////////////////////////////
+//shows the frame if it is hidden,
+//hides the frame if it is shown
+//wParam=FrameId
+//lParam=0
+//returns 0 on success, -1 on failure
+//#define MS_CLIST_FRAMES_SHFRAME "CListFrames/SHFrame"
+static int _ExtFramesSrv_SHFrame(WPARAM wParam, LPARAM lParam)
+{
+ efcheck -1;
+ eflock;
+ {
+ // DO HERE
+ }
+ efunlock;
+ return 0;
+}
+//////////////////////////////////////////////////////////////////////////
+//shows the frame titlebar if it is hidden,
+//hides the frame titlebar if it is shown
+//wParam=FrameId
+//lParam=0
+//returns 0 on success, -1 on failure
+//#define MS_CLIST_FRAMES_SHFRAMETITLEBAR "CListFrame/SHFrameTitleBar"
+static int _ExtFramesSrv_SHFrameTitleBar(WPARAM wParam, LPARAM lParam)
+{
+ efcheck -1;
+ eflock;
+ {
+ // DO HERE
+ }
+ efunlock;
+ return 0;
+}
+
+//////////////////////////////////////////////////////////////////////////
+//locks the frame if it is unlocked,
+//unlock the frame if it is locked
+//wParam=FrameId
+//lParam=0
+//returns 0 on success, -1 on failure
+//#define MS_CLIST_FRAMES_ULFRAME "CListFrame/ULFrame"
+static int _ExtFramesSrv_ULFrame(WPARAM wParam, LPARAM lParam)
+{
+ efcheck -1;
+ eflock;
+ {
+ // DO HERE
+ }
+ efunlock;
+ return 0;
+}
+//////////////////////////////////////////////////////////////////////////
+//collapses the frame if it is uncollapsed,
+//uncollapses the frame if it is collapsed
+//wParam=FrameId
+//lParam=0
+//returns 0 on success, -1 on failure
+//#define MS_CLIST_FRAMES_UCOLLFRAME "CListFrame/UCOLLFrame"
+static int _ExtFramesSrv_UCollFrame(WPARAM wParam, LPARAM lParam)
+{
+ efcheck -1;
+ eflock;
+ {
+ // DO HERE
+ }
+ efunlock;
+ return 0;
+}
+//////////////////////////////////////////////////////////////////////////
+//trigger border flags
+//wparam=frameid
+//lparam=0
+//#define MS_CLIST_FRAMES_SETUNBORDER "CListFrame/SetUnBorder"
+static int _ExtFramesSrv_SetUnBorder(WPARAM wParam, LPARAM lParam)
+{
+ efcheck -1;
+ eflock;
+ {
+ // DO HERE
+ }
+ efunlock;
+ return 0;
+}
+
+//////////////////////////////////////////////////////////////////////////
+//redraws the frame
+//wParam=FrameId, -1 for all frames
+//lparam=FU_flags
+//returns a pointer to option, -1 on failure
+//#define MS_CLIST_FRAMES_UPDATEFRAME "CListFrame/UpdateFrame"
+static int _ExtFramesSrv_UpdateFrame(WPARAM wParam, LPARAM lParam)
+{
+ int ret=-1;
+ efcheck ret;
+ eflock;
+ {
+ // DO HERE
+ }
+ efunlock;
+ return ret;
+}
+//////////////////////////////////////////////////////////////////////////
+//gets the frame options
+//(HIWORD)wParam=FrameId
+//(LOWORD)wParam=FO_flag
+//lParam=0
+//returns a pointer to option, -1 on failure
+//#define MS_CLIST_FRAMES_GETFRAMEOPTIONS "CListFrame/GetFrameOptions"
+static int _ExtFramesSrv_GetFrameOptions(WPARAM wParam, LPARAM lParam)
+{
+ int ret=-1;
+ efcheck ret;
+ eflock;
+ {
+ // DO HERE
+ }
+ efunlock;
+ return ret;
+}
+//sets the frame options
+//(HIWORLD)wParam=FrameId
+//(LOWORD)wParam=FO_flag
+//lParam=value
+//returns 0 on success, -1 on failure
+//#define MS_CLIST_FRAMES_SETFRAMEOPTIONS "CListFrame/SetFrameOptions"
+static int _ExtFramesSrv_SetFrameOptions(WPARAM wParam, LPARAM lParam)
+{
+ int ret=-1;
+ efcheck ret;
+ eflock;
+ {
+ // DO HERE
+ }
+ efunlock;
+ return ret;
+}
+//////////////////////////////////////////////////////////////////////////
+//Frames related menu stuff
+//////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////
+//add a new item to the context frame menu
+//wParam=0
+//lParam=(LPARAM)(CLISTMENUITEM*)&mi
+//returns a handle to the new item
+//popupposition=frameid
+//contactowner=advanced parameter
+//#define MS_CLIST_ADDCONTEXTFRAMEMENUITEM "CList/AddContextFrameMenuItem"
+
+//////////////////////////////////////////////////////////////////////////
+//remove a item from context frame menu
+//wParam=hMenuItem returned by MS_CLIST_ADDCONTACTMENUITEM
+//lParam=0
+//returns 0 on success, nonzero on failure
+//#define MS_CLIST_REMOVECONTEXTFRAMEMENUITEM "CList/RemoveContextFrameMenuItem"
+
+//////////////////////////////////////////////////////////////////////////
+//builds the context menu for a frame
+//wparam=frameid
+//lParam=0
+//returns a HMENU on success, or NULL on failure
+//#define MS_CLIST_MENUBUILDFRAMECONTEXT "CList/BuildContextFrameMenu"
+
+//////////////////////////////////////////////////////////////////////////
+// the frame menu is about to be built
+// wparam=frameid
+// lparam=
+// -1 for build from titlebar,
+// use
+// MS_CLIST_ADDCONTEXTFRAMEMENUITEM
+// MS_CLIST_REMOVECONTEXTFRAMEMENUITEM
+//
+// >0 for build in main menu,
+// must be popupname=lparam to place your items in right popup of main menu.
+// use
+// MS_CLIST_ADDMAINMENUITEM
+// MS_CLIST_REMOVEMAINMENUITEM
+//
+//#define ME_CLIST_PREBUILDFRAMEMENU "CList/PreBuildFrameMenu"
+
+//////////////////////////////////////////////////////////////////////////
+//needed by cluiframes module to add frames menu to main menu.
+//it just calls NotifyEventHooks(hPreBuildFrameMenuEvent,wParam,lParam);
+//#define MS_CLIST_FRAMEMENUNOTIFY "CList/ContextFrameMenuNotify"
+#endif
\ No newline at end of file diff --git a/plugins/Modernb/_disabled_src/forkthread.c b/plugins/Modernb/_disabled_src/forkthread.c new file mode 100644 index 0000000000..ed380f7486 --- /dev/null +++ b/plugins/Modernb/_disabled_src/forkthread.c @@ -0,0 +1,103 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2006 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "commonheaders.h"
+
+struct FORK_ARG {
+ HANDLE hEvent;
+ void (__cdecl *threadcode)(void*);
+ unsigned (__stdcall *threadcodeex)(void*);
+ void *arg;
+};
+
+void __cdecl forkthread_r(struct FORK_ARG *fa)
+{
+ void (*callercode)(void*)=fa->threadcode;
+ void *arg=fa->arg;
+ CallService(MS_SYSTEM_THREAD_PUSH,0,0);
+ SetEvent(fa->hEvent);
+ __try {
+ callercode(arg);
+ } __finally {
+ CallService(MS_SYSTEM_THREAD_POP,0,0);
+ }
+ return;
+}
+
+unsigned long forkthread (
+ void (__cdecl *threadcode)(void*),
+ unsigned long stacksize,
+ void *arg
+)
+{
+ unsigned long rc;
+ struct FORK_ARG fa;
+ if (g_bSTATE!=STATE_NORMAL) return 0; //not start the new thead if exiting
+ fa.hEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
+ fa.threadcode=threadcode;
+ fa.arg=arg;
+ rc=_beginthread(forkthread_r,stacksize,&fa);
+ if ((unsigned long)-1L != rc) {
+ WaitForSingleObject(fa.hEvent,1000);
+ } //if
+ CloseHandle(fa.hEvent);
+ return rc;
+}
+
+unsigned long __stdcall forkthreadex_r(struct FORK_ARG *fa)
+{
+ unsigned (__stdcall * threadcode) (void *)=fa->threadcodeex;
+ void *arg=fa->arg;
+ unsigned long rc=0;
+
+ CallService(MS_SYSTEM_THREAD_PUSH,0,0);
+ SetEvent(fa->hEvent);
+ __try {
+ rc=threadcode(arg);
+ } __finally {
+ CallService(MS_SYSTEM_THREAD_POP,0,0);
+ }
+ return rc;
+}
+
+unsigned long forkthreadex(
+ void *sec,
+ unsigned stacksize,
+ unsigned (__stdcall *threadcode)(void*),
+ void *arg,
+ unsigned cf,
+ unsigned *thraddr
+)
+{
+ unsigned long rc;
+ struct FORK_ARG fa;
+ fa.threadcodeex=threadcode;
+ fa.arg=arg;
+ fa.hEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
+ rc=_beginthreadex(sec,stacksize,forkthreadex_r,&fa,0,thraddr);
+ if (rc) {
+ WaitForSingleObject(fa.hEvent,INFINITE);
+ }
+ CloseHandle(fa.hEvent);
+ return rc;
+}
\ No newline at end of file diff --git a/plugins/Modernb/_disabled_src/forkthread.h b/plugins/Modernb/_disabled_src/forkthread.h new file mode 100644 index 0000000000..7a25771e31 --- /dev/null +++ b/plugins/Modernb/_disabled_src/forkthread.h @@ -0,0 +1,63 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2006 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+/*
+
+Purpose:
+
+ A safe version of _beginthread()
+
+Description:
+
+ A new thread is created and the source thread is paused until
+ internal code to call MS_SYSTEM_THREAD_PUSH is made in the context
+ if the new thread.
+
+ The source thread is then released and then the user supplied
+ code is called, when that function returns -- MS_SYSTEM_THREAD_POP
+ is called and then the thread returns.
+
+ This insures that Miranda will not exit whilst new threads
+ are trying to be born; and the unwind wait stack will unsure
+ that Miranda will wait for all created threads to return as well.
+
+Cavets:
+
+ The function must be reimplemented across MT plugins, since thread
+ creation depends on CRT which can not be shared.
+
+*/
+unsigned long mir_forkthread (
+ void (__cdecl *threadcode)(void*),
+ unsigned long stacksize,
+ void *arg
+);
+
+unsigned long forkthreadex(
+ void *sec,
+ unsigned stacksize,
+ unsigned (__stdcall *threadcode)(void*),
+ void *arg,
+ unsigned cf,
+ unsigned *thraddr
+);
diff --git a/plugins/Modernb/_disabled_src/groups.c b/plugins/Modernb/_disabled_src/groups.c new file mode 100644 index 0000000000..8e282de26b --- /dev/null +++ b/plugins/Modernb/_disabled_src/groups.c @@ -0,0 +1,525 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+#include "commonheaders.h"
+
+static int RenameGroup(WPARAM wParam,LPARAM lParam);
+static int MoveGroupBefore(WPARAM wParam,LPARAM lParam);
+
+
+static int CountGroups(void)
+{
+ DBVARIANT dbv;
+ int i;
+ char str[33];
+
+ for(i=0;;i++) {
+ itoa(i,str,10);
+ if (DBGetContactSettingTString(NULL, "CListGroups", str, &dbv))
+ break;
+ DBFreeVariant(&dbv);
+ }
+ return i;
+}
+
+static int GroupNameExists(const TCHAR *name, int skipGroup)
+{
+ char idstr[33];
+ DBVARIANT dbv;
+ int i;
+
+ for(i=0;;i++) {
+ if (i == skipGroup)
+ continue;
+ itoa(i,idstr,10);
+ if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
+ break;
+ if (!_tcscmp(((TCHAR*)dbv.ptszVal + 1), name)) {
+ DBFreeVariant(&dbv);
+ return 1;
+ }
+ DBFreeVariant(&dbv);
+ }
+ return 0;
+}
+
+static int CreateGroup(WPARAM wParam,LPARAM lParam)
+{
+ int newId=CountGroups();
+ TCHAR newBaseName[127], newName[128];
+ char str[33];
+ int i;
+ DBVARIANT dbv;
+
+ if(wParam) {
+ itoa(wParam-1,str,10);
+ if (DBGetContactSettingTString(NULL, "CListGroups", str, &dbv))
+ return 0;
+
+ mir_sntprintf( newBaseName, SIZEOF(newBaseName), _T("%s\\%s"), dbv.pszVal + 1, TranslateT("New Group"));
+ mir_free(dbv.pszVal);
+ }
+ else lstrcpyn( newBaseName, TranslateT( "New Group" ), SIZEOF( newBaseName ));
+
+ itoa(newId,str,10);
+ i=1;
+ lstrcpyn( newName + 1, newBaseName, SIZEOF(newName) - 1);
+ while(GroupNameExists(newName+1,-1))
+ mir_sntprintf( newName + 1, SIZEOF(newName) - 1, _T("%s (%d)"), newBaseName, ++i );
+
+ newName[0]=1|GROUPF_EXPANDED; //1 is required so we never get '\0'
+ DBWriteContactSettingTString(NULL, "CListGroups", str, newName);
+ CallService(MS_CLUI_GROUPADDED,newId+1,1);
+ return newId+1;
+}
+
+static int GetGroupName2(WPARAM wParam,LPARAM lParam)
+{
+ char idstr[33];
+ DBVARIANT dbv;
+ static char name[128];
+
+ itoa(wParam-1,idstr,10);
+ if(DBGetContactSettingTString(NULL,"CListGroups",idstr,&dbv))
+ return (int)(char*)NULL;
+ lstrcpynA(name, dbv.pszVal + 1, SIZEOF(name));
+ if ((DWORD *) lParam != NULL)
+ *(DWORD *) lParam = dbv.pszVal[0];
+ DBFreeVariant(&dbv);
+ return (int)name;
+}
+
+TCHAR* GetGroupNameTS( int idx, DWORD* pdwFlags )
+{
+ char idstr[33];
+ DBVARIANT dbv;
+ static TCHAR name[128];
+
+ itoa( idx-1, idstr, 10);
+ if (DBGetContactSettingTString( NULL, "CListGroups", idstr, &dbv ))
+ return NULL;
+
+ lstrcpyn( name, (TCHAR*)dbv.ptszVal + 1, SIZEOF( name ));
+ if ( pdwFlags != NULL )
+ *pdwFlags = dbv.ptszVal[0];
+ DBFreeVariant( &dbv );
+ return name;
+}
+
+int GetGroupNameT(WPARAM wParam,LPARAM lParam)
+{
+ return (int)GetGroupNameTS ((int) wParam, (DWORD*)lParam);
+}
+
+static int GetGroupName(WPARAM wParam,LPARAM lParam)
+{
+ int ret;
+ ret=GetGroupName2(wParam,lParam);
+ if((int*)lParam)
+ *(int*)lParam=0!=(*(int*)lParam&GROUPF_EXPANDED);
+ return ret;
+}
+
+static int DeleteGroup(WPARAM wParam,LPARAM lParam)
+{
+ int i;
+ char str[33];
+ DBVARIANT dbv;
+ HANDLE hContact;
+ TCHAR name[256], szNewParent[256], *pszLastBackslash;
+
+ //get the name
+ itoa(wParam-1,str,10);
+ if (DBGetContactSettingTString(NULL, "CListGroups", str, &dbv))
+ return 1;
+ if (DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT))
+ if (MessageBox((HWND)CallService(MS_CLUI_GETHWND, 0, 0), TranslateT("Are you sure you want to delete this group? This operation can not be undone."), TranslateT("Delete Group"), MB_YESNO|MB_ICONQUESTION)==IDNO)
+ return 1;
+ lstrcpyn(name, (TCHAR*)dbv.ptszVal + 1, SIZEOF(name));
+ DBFreeVariant(&dbv);
+ SetCursor(LoadCursor(NULL,IDC_WAIT));
+ //must remove setting from all child contacts too
+ //children are demoted to the next group up, not deleted.
+ lstrcpy(szNewParent, name);
+ pszLastBackslash = _tcsrchr(szNewParent, '\\');
+ if (pszLastBackslash)
+ pszLastBackslash[0] = '\0';
+ else
+ szNewParent[0] = '\0';
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ do {
+ if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
+ continue;
+ if (_tcscmp(dbv.ptszVal, name)) {
+ DBFreeVariant(&dbv);
+ continue;
+ }
+ DBFreeVariant(&dbv);
+ if (szNewParent[0])
+ DBWriteContactSettingTString(hContact, "CList", "Group", szNewParent);
+ else
+ DBDeleteContactSetting(hContact, "CList", "Group");
+ } while((hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))!=NULL);
+ //shuffle list of groups up to fill gap
+ for(i=wParam-1;;i++) {
+ itoa(i+1,str,10);
+ if (DBGetContactSettingStringUtf(NULL, "CListGroups", str, &dbv))
+ break;
+ itoa(i,str,10);
+ DBWriteContactSettingStringUtf(NULL, "CListGroups", str, dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+ itoa(i,str,10);
+ DBDeleteContactSetting(NULL,"CListGroups",str);
+ //rename subgroups
+ {
+ TCHAR szNewName[256];
+ int len;
+
+ len = lstrlen(name);
+ for(i=0;;i++) {
+ itoa(i,str,10);
+ if (DBGetContactSettingTString(NULL, "CListGroups", str, &dbv))
+ break;
+ if (!_tcsncmp((TCHAR*)dbv.ptszVal + 1, name, len) && dbv.ptszVal[len + 1] == '\\' && _tcschr(dbv.ptszVal + len + 2, '\\') == NULL) {
+ if (szNewParent[0])
+ mir_sntprintf(szNewName, SIZEOF(szNewName), _T("%s\\%s"), szNewParent, dbv.ptszVal + len + 2);
+ else
+ lstrcpyn(szNewName, dbv.ptszVal + len + 2, SIZEOF(szNewName));
+ RenameGroupT((WPARAM)(i + 1), (LPARAM)szNewName);
+ }
+ DBFreeVariant(&dbv);
+ }
+ }
+ SetCursor(LoadCursor(NULL,IDC_ARROW));
+ LoadContactTree();
+ return 0;
+}
+
+static int RenameGroupWithMove(int groupId,const TCHAR *szName,int move)
+{
+ char idstr[33];
+ TCHAR str[256], oldName[256];
+ DBVARIANT dbv;
+ HANDLE hContact;
+
+ if(GroupNameExists(szName,groupId)) {
+ MessageBox(NULL,TranslateT("You already have a group with that name. Please enter a unique name for the group."),TranslateT("Rename Group"),MB_OK);
+ return 1;
+ }
+
+ //do the change
+ itoa(groupId,idstr,10);
+ if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
+ return 1;
+ str[0]=dbv.ptszVal[0];
+ lstrcpyn(oldName, (TCHAR*)dbv.ptszVal + 1, SIZEOF(oldName));
+ DBFreeVariant(&dbv);
+ {
+ WORD l;
+ l=lstrlen(szName)+sizeof(TCHAR);
+ l=min(l,SIZEOF(str));
+ l--;
+ lstrcpyn(str + 1, szName, l);
+ str[l+1]=_T('\0');
+ }
+ DBWriteContactSettingTString(NULL, "CListGroups", idstr, str);
+
+ //must rename setting in all child contacts too
+ hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ do {
+ if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
+ continue;
+ if ( _tcscmp(dbv.ptszVal, oldName))
+ continue;
+ DBWriteContactSettingTString(hContact, "CList", "Group", szName);
+ }
+ while ((hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0)) != NULL);
+
+ //rename subgroups
+ {
+ TCHAR szNewName[256];
+ int len,i;
+
+ len = lstrlen(oldName);
+ for(i=0;;i++) {
+ if (i == groupId)
+ continue;
+ itoa(i,idstr,10);
+ if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
+ break;
+ if ( !_tcsncmp((TCHAR*)dbv.ptszVal + 1, oldName, len) && dbv.ptszVal[len + 1] == _T('\\') && _tcschr((TCHAR*)dbv.ptszVal+len + 2, _T('\\')) == NULL) {
+ mir_sntprintf( szNewName, SIZEOF(szNewName), _T("%s\\%s"), szName,(TCHAR*)dbv.pszVal + len + 2 );
+ RenameGroupWithMove(i,szNewName,0); //luckily, child groups will never need reordering
+ }
+ DBFreeVariant(&dbv);
+ }
+ }
+
+ //finally must make sure it's after any parent items
+ if(move) {
+ TCHAR *pszLastBackslash;
+ int i;
+
+ lstrcpyn(str, szName, SIZEOF(str));
+ pszLastBackslash = _tcsrchr(str, '\\');
+ if (pszLastBackslash == NULL)
+ return 0;
+ *pszLastBackslash='\0';
+ for(i=0;;i++) {
+ itoa(i,idstr,10);
+ if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
+ break;
+ if (!lstrcmp((TCHAR*)dbv.ptszVal + 1, str)) {
+ if (i < groupId)
+ break; //is OK
+ MoveGroupBefore(groupId+1,i+2);
+ break;
+ }
+ DBFreeVariant(&dbv);
+ }
+ }
+ return 0;
+}
+
+int RenameGroupT( WPARAM groupID, LPARAM newName )
+{
+ return -1 != RenameGroupWithMove( (int)groupID-1, (TCHAR*)newName, 1);
+}
+
+static int RenameGroup(WPARAM wParam,LPARAM lParam)
+{
+ #if defined( _UNICODE )
+ WCHAR* temp = mir_a2u(( char* )lParam );
+ int result = ( -1 != RenameGroupWithMove(wParam - 1, temp, 1));
+ mir_free( temp );
+ return result;
+ #else
+ return -1 != RenameGroupWithMove(wParam - 1, (TCHAR*) lParam, 1);
+ #endif
+}
+
+static int SetGroupExpandedState(WPARAM wParam,LPARAM lParam)
+{
+ char idstr[33];
+ DBVARIANT dbv;
+
+ itoa(wParam-1,idstr,10);
+ if (DBGetContactSettingStringUtf(NULL, "CListGroups", idstr, &dbv))
+ return 1;
+ if (lParam)
+ dbv.pszVal[0] |= GROUPF_EXPANDED;
+ else
+ dbv.pszVal[0] = dbv.pszVal[0] & ~GROUPF_EXPANDED;
+ DBWriteContactSettingStringUtf(NULL, "CListGroups", idstr, dbv.pszVal);
+ DBFreeVariant(&dbv);
+ return 0;
+}
+
+static int SetGroupFlags(WPARAM wParam,LPARAM lParam)
+{
+ char idstr[33];
+ DBVARIANT dbv;
+ int flags,oldval,newval;
+
+ itoa(wParam-1,idstr,10);
+ if (DBGetContactSettingStringUtf(NULL, "CListGroups", idstr, &dbv))
+ return 1;
+ flags=LOWORD(lParam)&HIWORD(lParam);
+ oldval=dbv.pszVal[0];
+ newval=dbv.pszVal[0]=(dbv.pszVal[0]&~HIWORD(lParam))|flags;
+ DBWriteContactSettingStringUtf(NULL, "CListGroups", idstr, dbv.pszVal);
+ DBFreeVariant(&dbv);
+ if ((oldval & GROUPF_HIDEOFFLINE) != (newval & GROUPF_HIDEOFFLINE))
+ LoadContactTree();
+ return 0;
+}
+
+static int MoveGroupBefore(WPARAM wParam,LPARAM lParam)
+{
+ int i,shuffleFrom,shuffleTo,shuffleDir;
+ char str[33];
+ TCHAR *szMoveName;
+ DBVARIANT dbv;
+
+ if (wParam == 0 || (LPARAM) wParam == lParam)
+ return 0;
+ itoa(wParam-1,str,10);
+ if (DBGetContactSettingTString(NULL, "CListGroups", str, &dbv))
+ return 0;
+ szMoveName = dbv.ptszVal;
+ //shuffle list of groups up to fill gap
+ if (lParam == 0) {
+ shuffleFrom = wParam - 1;
+ shuffleTo = -1;
+ shuffleDir = -1;
+ }
+ else {
+ if ((LPARAM) wParam < lParam) {
+ shuffleFrom = wParam - 1;
+ shuffleTo = lParam - 2;
+ shuffleDir = -1;
+ }
+ else {
+ shuffleFrom = wParam - 1;
+ shuffleTo = lParam - 1;
+ shuffleDir = 1;
+ }
+ }
+ if(shuffleDir==-1) {
+ for(i=shuffleFrom;i!=shuffleTo;i++) {
+ itoa(i+1,str,10);
+ if (DBGetContactSettingStringUtf(NULL, "CListGroups", str, &dbv)) {
+ shuffleTo = i;
+ break;
+ }
+ itoa(i,str,10);
+ DBWriteContactSettingStringUtf(NULL, "CListGroups", str, dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+ }
+ else {
+ for(i=shuffleFrom;i!=shuffleTo;i--) {
+ itoa(i-1,str,10);
+ if (DBGetContactSettingStringUtf(NULL, "CListGroups", str, &dbv)) {
+ mir_free(szMoveName);
+ return 1;
+ } //never happens
+ itoa(i,str,10);
+ DBWriteContactSettingStringUtf(NULL, "CListGroups", str, dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+ }
+ itoa(shuffleTo,str,10);
+ DBWriteContactSettingTString(NULL, "CListGroups", str, szMoveName);
+ mir_free(szMoveName);
+ return shuffleTo+1;
+}
+
+static int BuildGroupMenu(WPARAM wParam,LPARAM lParam)
+{
+ char idstr[33];
+ DBVARIANT dbv;
+ int groupId;
+ HMENU hRootMenu,hThisMenu;
+ int nextMenuId=100;
+ TCHAR *pBackslash,*pNextField,szThisField[128],szThisMenuItem[128];
+ int menuId,compareResult,menuItemCount;
+ MENUITEMINFO mii={0};
+
+ if (DBGetContactSettingStringUtf(NULL, "CListGroups", "0", &dbv))
+ return (int) (HMENU) NULL;
+ DBFreeVariant(&dbv);
+ hRootMenu=CreateMenu();
+ for(groupId=0;;groupId++) {
+ itoa(groupId,idstr,10);
+ if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv))
+ break;
+
+ pNextField = (TCHAR*)dbv.ptszVal + 1;
+ hThisMenu=hRootMenu;
+ mii.cbSize=MENUITEMINFO_V4_SIZE;
+ do {
+ pBackslash = _tcschr(pNextField, '\\');
+ if(pBackslash==NULL) {
+ lstrcpyn(szThisField, pNextField, SIZEOF(szThisField));
+ pNextField=NULL;
+ }
+ else {
+ lstrcpyn(szThisField, pNextField, min( SIZEOF(szThisField), pBackslash - pNextField + 1));
+ pNextField=pBackslash+1;
+ }
+ compareResult=1;
+ menuItemCount=GetMenuItemCount(hThisMenu);
+ for(menuId=0;menuId<menuItemCount;menuId++) {
+ mii.fMask=MIIM_TYPE|MIIM_SUBMENU|MIIM_DATA;
+ mii.cch = SIZEOF(szThisMenuItem);
+ mii.dwTypeData=szThisMenuItem;
+ GetMenuItemInfo(hThisMenu,menuId,TRUE,&mii);
+ compareResult = lstrcmp(szThisField, szThisMenuItem);
+ if(compareResult==0) {
+ if(pNextField==NULL) {
+ mii.fMask=MIIM_DATA;
+ mii.dwItemData=groupId+1;
+ SetMenuItemInfo(hThisMenu,menuId,TRUE,&mii);
+ }
+ else {
+ if(mii.hSubMenu==NULL) {
+ mii.fMask=MIIM_SUBMENU;
+ mii.hSubMenu=CreateMenu();
+ SetMenuItemInfo(hThisMenu,menuId,TRUE,&mii);
+ mii.fMask=MIIM_DATA|MIIM_TYPE|MIIM_ID;
+ //dwItemData doesn't change
+ mii.fType=MFT_STRING;
+ mii.dwTypeData=TranslateT("This group");
+ mii.wID=nextMenuId++;
+ InsertMenuItem(mii.hSubMenu,0,TRUE,&mii);
+ mii.fMask=MIIM_TYPE;
+ mii.fType=MFT_SEPARATOR;
+ InsertMenuItem(mii.hSubMenu,1,TRUE,&mii);
+ }
+ hThisMenu=mii.hSubMenu;
+ }
+ break;
+ }
+ if ((int) mii.dwItemData - 1 > groupId)
+ break;
+ }
+ if(compareResult) {
+ mii.fMask=MIIM_TYPE|MIIM_ID;
+ mii.wID=nextMenuId++;
+ mii.dwTypeData=szThisField;
+ mii.fType=MFT_STRING;
+ if(pNextField) {
+ mii.fMask|=MIIM_SUBMENU;
+ mii.hSubMenu=CreateMenu();
+ }
+ else {
+ mii.fMask|=MIIM_DATA;
+ mii.dwItemData=groupId+1;
+ }
+ InsertMenuItem(hThisMenu,menuId,TRUE,&mii);
+ if(pNextField) {
+ hThisMenu=mii.hSubMenu;
+ }
+ }
+ } while(pNextField);
+
+ DBFreeVariant(&dbv);
+ }
+ return (int)hRootMenu;
+}
+
+int InitGroupServices(void)
+{
+ CreateServiceFunction(MS_CLIST_GROUPCREATE,CreateGroup);
+ CreateServiceFunction(MS_CLIST_GROUPDELETE,DeleteGroup);
+ CreateServiceFunction(MS_CLIST_GROUPRENAMET,RenameGroupT);
+ CreateServiceFunction(MS_CLIST_GROUPGETNAME,GetGroupName);
+ CreateServiceFunction(MS_CLIST_GROUPGETNAME2,GetGroupName2);
+ CreateServiceFunction(MS_CLIST_GROUPGETNAMET,GetGroupNameT);
+ CreateServiceFunction(MS_CLIST_GROUPSETEXPANDED,SetGroupExpandedState);
+ CreateServiceFunction(MS_CLIST_GROUPSETFLAGS,SetGroupFlags);
+ CreateServiceFunction(MS_CLIST_GROUPMOVEBEFORE,MoveGroupBefore);
+ CreateServiceFunction(MS_CLIST_GROUPBUILDMENU,BuildGroupMenu);
+ return 0;
+}
diff --git a/plugins/Modernb/_disabled_src/modern_layout.c b/plugins/Modernb/_disabled_src/modern_layout.c new file mode 100644 index 0000000000..6e4f86e730 --- /dev/null +++ b/plugins/Modernb/_disabled_src/modern_layout.c @@ -0,0 +1,44 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2006 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+Created by Artem Shpynov October 3, 2006
+
+*/
+#include "commonheaders.h"
+
+
+/************************************************************************/
+/* file implements advanced row layout */
+/************************************************************************/
+
+enum
+{
+ ln_NONE=0;
+}
+
+typedef struct tagLAYOUTNODE
+{
+ BYTE bType; /* type of node use LAYOUTNODETYPE enum*/
+ struct tagLAYOUTNODE * child;
+
+}LAYOUTNODE, *PLAYOUTNODE, *MPLAYOUTNODE;
+
diff --git a/plugins/Modernb/_disabled_src/skinpp.cpp b/plugins/Modernb/_disabled_src/skinpp.cpp new file mode 100644 index 0000000000..a27a7bac05 --- /dev/null +++ b/plugins/Modernb/_disabled_src/skinpp.cpp @@ -0,0 +1,181 @@ +/**************************************************************************\
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Nov 9, 2006
+
+Author: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+****************************************************************************
+
+File contains implementation of new version of skining engine based on cpp,
+xml load from file etc
+
+\**************************************************************************/
+
+#include <windows.h>
+#include <win2k.h>
+#include "newpluginapi.h" //this is common header for miranda plugin api
+#include "m_system.h"
+#include "m_database.h"
+
+
+#include <string>
+#include <map>
+#include <list>
+
+#include "XMLParser/XMLParser.h"
+
+#include "skinpp.h"
+#include "skinpp_private.h"
+
+
+//////////////////////////////////////////////////////////////////////////
+// Implementation of external "interface" procedures
+//
+extern "C"
+{
+ //////////////////////////////////////////////////////////////////////////
+ // Initialize subsystem
+ //
+ void skinpp_LoadSubSystem()
+ {
+
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ // DeInitialize subsystem
+ //
+ void skinpp_UnloadSubSystem()
+ {
+
+ };
+
+};
+
+//////////////////////////////////////////////////////////////////////////
+// Implementation of internal procedures
+//
+skinpp_SKIN::skinpp_SKIN()
+{
+ m_lpXMLDocument=NULL;
+}
+
+skinpp_SKIN::~skinpp_SKIN()
+{
+ this->ClearSkin();
+}
+
+//////////////////////////////////////////////////////////////////////////
+// remove all data from skin
+//
+void skinpp_SKIN::ClearSkin()
+{
+ if (m_lpXMLDocument!=NULL) delete m_lpXMLDocument;
+ m_lpXMLDocument=NULL;
+
+ // delete objects from list
+ for (OBJLIST_ITER iter = m_ObjectList.begin(); iter!=m_ObjectList.end(); ++iter)
+ {
+ delete (iter->second);
+ }
+ m_ObjectList.clear();
+
+ // delete selectors
+ for (SELECTORLIST_ITER iter = m_SelectorList.begin(); iter!=m_SelectorList.end(); ++iter)
+ {
+ delete (*iter);
+ }
+ m_SelectorList.clear();
+}
+
+//////////////////////////////////////////////////////////////////////////
+// Load skin data from file
+//
+HRESULT skinpp_SKIN::LoadSkin(const char * szFileName)
+{
+ HRESULT result=-1;
+
+ ClearSkin();
+
+ m_lpXMLDocument=new XMLDocument();
+ result=(HRESULT)m_lpXMLDocument->ParseFromFile(szFileName);
+
+ if (result==S_OK)
+ {
+ result=GetDataFromXMLDocument();
+ if (result==S_OK) return S_OK;
+ }
+
+ // if we are here thats mean error occurred above
+ delete m_lpXMLDocument;
+ m_lpXMLDocument=NULL;
+
+ return result;
+}
+
+//////////////////////////////////////////////////////////////////////////
+// Load skin data from memory
+//
+HRESULT skinpp_SKIN::LoadSkinFromMemory(const char * szBuffer)
+{
+ HRESULT result=-1;
+
+ ClearSkin();
+
+ m_lpXMLDocument=new XMLDocument();
+ result=(HRESULT)m_lpXMLDocument->ParseFromBuffer(szBuffer);
+
+ if (result==S_OK)
+ {
+ result=GetDataFromXMLDocument();
+ if (result==S_OK) return S_OK;
+ }
+
+ // if we are here thats mean error occurred above
+ delete m_lpXMLDocument;
+ m_lpXMLDocument=NULL;
+
+ return result;
+}
+
+//////////////////////////////////////////////////////////////////////////
+// Save skin data to file
+//
+HRESULT skinpp_SKIN::SaveSkin(const char * szFileName)
+{
+ return S_OK;
+}
+
+//////////////////////////////////////////////////////////////////////////
+// Convert skin data from xmldocument nodes
+//
+HRESULT skinpp_SKIN::GetDataFromXMLDocument()
+{
+ return S_OK;
+}
+
+//////////////////////////////////////////////////////////////////////////
+// convert skin data to xmldocument nodes
+//
+HRESULT skinpp_SKIN::PutDataToXMLDocument()
+{
+ return S_OK;
+}
+/////////////////////// END of skinpp_SKIN \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
+
+
diff --git a/plugins/Modernb/_disabled_src/skinpp.h b/plugins/Modernb/_disabled_src/skinpp.h new file mode 100644 index 0000000000..ed06a83af2 --- /dev/null +++ b/plugins/Modernb/_disabled_src/skinpp.h @@ -0,0 +1,48 @@ +/**************************************************************************\
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Nov 9, 2006
+
+Author: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+****************************************************************************
+
+File contains extern "C" definition for skinppsystem
+
+\**************************************************************************/
+
+#ifndef skinpp_h__
+#define skinpp_h__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif //__cplusplus
+
+ void skinpp_LoadSubSystem();
+ void skinpp_UnloadSubSystem();
+ void * skinpp_CreateSkin();
+ void skinpp_LoadSkinFromFile(void * lpSkin, char * szFileName);
+ void skinpp_LoadSkinFromMemory(void * lpSkin, char * szBuff);
+
+#ifdef __cplusplus
+};
+#endif //__cplusplus
+
+#endif // skinpp_h__
+
diff --git a/plugins/Modernb/_disabled_src/skinpp_object.cpp b/plugins/Modernb/_disabled_src/skinpp_object.cpp new file mode 100644 index 0000000000..f674d6264b --- /dev/null +++ b/plugins/Modernb/_disabled_src/skinpp_object.cpp @@ -0,0 +1,71 @@ +/**************************************************************************\
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Nov 27, 2006
+
+Author: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+****************************************************************************
+
+File contains implementation of skinpp_OBJECT class
+
+\**************************************************************************/
+#include <windows.h>
+#include <win2k.h>
+#include "newpluginapi.h" //this is common header for miranda plugin api
+#include "m_system.h"
+#include "m_database.h"
+
+#include <string>
+#include <map>
+#include <list>
+
+#include "XMLParser/XMLParser.h"
+
+#include "skinpp.h"
+#include "skinpp_private.h"
+#include "skinpp_object.h"
+
+skinpp_SKINOBJECT::skinpp_SKINOBJECT()
+{
+ m_strObjectName="";
+}
+
+skinpp_SKINOBJECT::~skinpp_SKINOBJECT()
+{
+
+}
+int skinpp_SKINOBJECT::GetObjectDataFromXMLNode(XMLNode * lpNode)
+{
+ return 0;
+}
+
+int skinpp_SKINOBJECT::PutObjectDataToXMLNode(XMLNode * lpNode)
+{
+ return 0;
+}
+
+int skinpp_SKINOBJECT::Draw(HDC hDC, int nX, int nY, int nWidth, int nHeight, RECT * rcClipRect)
+{
+ return 0;
+}
+
+int skinpp_SKINOBJECT::ApplyObjectData(void * lpData) //modify data at lpData
+{
+ return 0;
+}
\ No newline at end of file diff --git a/plugins/Modernb/_disabled_src/skinpp_object.h b/plugins/Modernb/_disabled_src/skinpp_object.h new file mode 100644 index 0000000000..341ace5ba0 --- /dev/null +++ b/plugins/Modernb/_disabled_src/skinpp_object.h @@ -0,0 +1,49 @@ +/**************************************************************************\
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Nov 27, 2006
+
+Author: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+****************************************************************************
+
+File contains implementation of skinpp_OBJECT class HEADER
+
+\**************************************************************************/
+
+#ifndef skinpp_object_h__
+#define skinpp_object_h__
+
+class skinpp_SKINOBJECT
+{
+public:
+ //constructor and destructor
+ skinpp_SKINOBJECT();
+ ~skinpp_SKINOBJECT();
+
+ virtual int GetObjectDataFromXMLNode(XMLNode * lpNode); // gets data from node
+ virtual int PutObjectDataToXMLNode(XMLNode * lpNode); // put data to node
+
+ virtual int Draw(HDC hDC, int nX, int nY, int nWidth, int nHeight, RECT * rcClipRect=NULL); //paint itself
+ int ApplyObjectData(void * lpData); //modify data at lpData
+
+ string m_strObjectName;
+};
+
+
+#endif // skinpp_object_h__
diff --git a/plugins/Modernb/_disabled_src/skinpp_object_glyph.cpp b/plugins/Modernb/_disabled_src/skinpp_object_glyph.cpp new file mode 100644 index 0000000000..7e4c830262 --- /dev/null +++ b/plugins/Modernb/_disabled_src/skinpp_object_glyph.cpp @@ -0,0 +1,122 @@ +/**************************************************************************\
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Nov 27, 2006
+
+Author: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+****************************************************************************
+
+File contains implementation of skinpp_GLYPH class
+
+\**************************************************************************/
+#include <windows.h>
+#include <win2k.h>
+#include "newpluginapi.h" //this is common header for miranda plugin api
+#include "m_system.h"
+#include "m_database.h"
+
+#include <string>
+#include <map>
+#include <list>
+
+#include "XMLParser/XMLParser.h"
+
+#include "skinpp.h"
+#include "skinpp_private.h"
+#include "skinpp_object_glyph.h"
+
+skinpp_GLYPH::skinpp_GLYPH()
+{
+ m_bOpacity=0;
+ m_nX = m_nY = m_nWidth = m_nHeigh = 0;
+ m_hBitmap = NULL;
+ m_lpImageFileName = NULL;
+ m_nLeft = m_nTop = m_nRight = m_nBottom = 0;
+ m_bFillMode = FM_STRETCH_BOTH;
+};
+
+skinpp_GLYPH::~skinpp_GLYPH()
+{
+ //if (m_hBitmap) skinpp_FreeBitmap(m_hBitmap);
+ if (m_lpImageFileName) free(m_lpImageFileName);
+}
+
+int skinpp_GLYPH::GetObjectDataFromXMLNode(XMLNode * lpNode)
+{
+ // Early return if current object is empty (should not occur)
+ if (!this) return E_FAIL;
+
+ // call parent class to get common object data
+ if (FAILED(skinpp_SKINOBJECT::GetObjectDataFromXMLNode(lpNode))) return E_FAIL;
+
+ // get opacity, default is '255'
+ m_bOpacity=(BYTE)lpNode->GetAttributeInt("opacity",255);
+
+ // get image section
+ XMLNode * lpImageNode=lpNode->GetNode("image");
+ if (lpImageNode)
+ {
+ // file - get image filename - if empty - use internal image
+ string file=lpImageNode->GetAttributeString("file");
+ if (m_lpImageFileName) free(m_lpImageFileName);
+ m_lpImageFileName=NULL;
+ if (strlen(file.c_str())) strdup(file.c_str());
+ // if old bitmap is exists - free it
+ //if (m_hBitmap) skinpp_FreeBitmap(m_hBitmap);
+ m_hBitmap=NULL;
+
+ //x, y
+ m_nX=lpImageNode->GetAttributeInt("x");
+ m_nY=lpImageNode->GetAttributeInt("y");
+
+ //width, height
+ m_nWidth=lpImageNode->GetAttributeInt("width");
+ m_nHeigh=lpImageNode->GetAttributeInt("height");
+ }
+
+ // get resize section
+ XMLNode * lpResizeNode=lpNode->GetNode("resize");
+ if (lpResizeNode)
+ {
+ // left, top, right, bottom
+ m_nLeft=lpResizeNode->GetAttributeInt("left");
+ m_nTop=lpResizeNode->GetAttributeInt("top");
+ m_nRight=lpResizeNode->GetAttributeInt("right");
+ m_nBottom=lpResizeNode->GetAttributeInt("bottom");
+
+ // mode default is 'stretch'
+ string mode=lpResizeNode->GetAttributeString("mode","stretch");
+ char * szMode=(char*)mode.c_str();
+ if (strcmpi(szMode,"vtile")) m_bFillMode=FM_TILE_VERTICAL;
+ else if (strcmpi(szMode,"htile")) m_bFillMode=FM_TILE_HORIZONTAL;
+ else if (strcmpi(szMode,"tile")) m_bFillMode=FM_TILE_BOTH;
+ else m_bFillMode=FM_STRETCH_BOTH;
+ }
+ return S_OK;
+}
+
+int skinpp_GLYPH::PutObjectDataToXMLNode(XMLNode * lpNode)
+{
+ return 0;
+}
+
+int skinpp_GLYPH::Draw(HDC hDC, int nX, int nY, int nWidth, int nHeight, RECT * rcClipRect)
+{
+ return 0;
+}
\ No newline at end of file diff --git a/plugins/Modernb/_disabled_src/skinpp_object_glyph.h b/plugins/Modernb/_disabled_src/skinpp_object_glyph.h new file mode 100644 index 0000000000..7a7abcd464 --- /dev/null +++ b/plugins/Modernb/_disabled_src/skinpp_object_glyph.h @@ -0,0 +1,75 @@ +/**************************************************************************\
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Nov 27, 2006
+
+Author: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+****************************************************************************
+
+File contains implementation of skinpp_GLYPH class HEADER
+
+\**************************************************************************/
+
+#ifndef skinpp_object_glyph_h__
+#define skinpp_object_glyph_h__
+
+
+#include "skinpp_object.h"
+
+enum // Resizer fill mode Enumerations
+{
+ FM_STRETCH_BOTH = 0,
+ FM_TILE_HORIZONTAL,
+ FM_TILE_VERTICAL,
+ FM_TILE_BOTH
+};
+
+class skinpp_GLYPH: public skinpp_SKINOBJECT
+{
+public:
+ //constructor and destructor
+ skinpp_GLYPH();
+ ~skinpp_GLYPH();
+
+ virtual int GetObjectDataFromXMLNode(XMLNode * lpNode); // gets data from node
+ virtual int PutObjectDataToXMLNode(XMLNode * lpNode); // put data to node
+
+ virtual int Draw(HDC hDC, int nX, int nY, int nWidth, int nHeight, RECT * rcClipRect=NULL);
+
+ // data of glyph object
+ BYTE m_bOpacity; // Common glyph opacity
+
+ //Glyph image fragment
+ int m_nX,
+ m_nY,
+ m_nWidth,
+ m_nHeigh; // Position of fragment
+ HBITMAP m_hBitmap; // Glyph image
+ char *m_lpImageFileName; //TODO: UNICODE file names
+
+ //Resizer
+ int m_nLeft,
+ m_nTop,
+ m_nRight,
+ m_nBottom; // Resiser
+ BYTE m_bFillMode; // one of resizer fill mode value
+};
+
+
+#endif // skinpp_object_glyph_h__
\ No newline at end of file diff --git a/plugins/Modernb/_disabled_src/skinpp_private.h b/plugins/Modernb/_disabled_src/skinpp_private.h new file mode 100644 index 0000000000..d3d2ced220 --- /dev/null +++ b/plugins/Modernb/_disabled_src/skinpp_private.h @@ -0,0 +1,143 @@ +/**************************************************************************\
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+****************************************************************************
+
+Created: Nov 9, 2006
+
+Author: Artem Shpynov aka FYR: ashpynov@gmail.com
+
+****************************************************************************
+
+File contains class definitions for skinpp system
+
+\**************************************************************************/
+
+#ifndef skinpp_private_h__
+#define skinpp_private_h__
+
+#ifdef UNICODE
+#define tstring wstring
+#else
+#define tstring string
+#endif
+
+using namespace std;
+template<class string>
+struct OBJLIST_myless : public binary_function <string, string, bool>
+{
+ bool operator()(
+ const string& _Left,
+ const string& _Right
+ ) const
+ {
+ return (bool) (stricmp(_Left.c_str(),_Right.c_str())<0);
+ }
+};
+
+typedef map<string, class skinpp_SKINOBJECT*, OBJLIST_myless<string> > OBJLIST;
+typedef OBJLIST::const_iterator OBJLIST_ITER;
+
+typedef list<class skinpp_SELECTOR* > SELECTORLIST;
+typedef SELECTORLIST::const_iterator SELECTORLIST_ITER;
+
+
+
+class skinpp_SKIN
+{
+public:
+ //constructor and destructor
+ skinpp_SKIN();
+ ~skinpp_SKIN();
+ HRESULT LoadSkin(const char * szFileName);
+ HRESULT LoadSkinFromMemory(const char * szBuffer);
+ HRESULT SaveSkin(const char * szFileName);
+
+ class skinpp_SKINOBJECT * FindObjectByName(char * szName);
+ class skinpp_SKINOBJECT * FindObjectByRule(char * szSelector);
+ class skinpp_SKINOBJECT * FindObjectBySelector(class skinpp_SELECTOR * lpSelector);
+private:
+ HRESULT GetDataFromXMLDocument(); // convert skin data from xmldocument nodes
+ HRESULT PutDataToXMLDocument(); // convert skin data to xmldocument nodes
+ void ClearSkin(); // remove all data from skin
+
+ XMLDocument* m_lpXMLDocument; // XML document loaded from
+ OBJLIST m_ObjectList; // map of objects
+ SELECTORLIST m_SelectorList; // list of selectors
+ // list of buttons ???
+ // map of skinable db keys
+
+ string m_strSkinName;
+ string m_strSkinAuthor;
+ string m_strSkinAbout;
+ string m_strAuthorMail;
+ string m_strSkinWeb;
+
+};
+
+#include "skinpp_object.h"
+
+class skinpp_SOLID: public skinpp_SKINOBJECT
+{
+public:
+ //constructor and destructor
+ skinpp_SOLID();
+ ~skinpp_SOLID();
+
+ virtual int GetObjectDataFromXMLNode(XMLNode * lpNode); // gets data from node
+ virtual int PutObjectDataToXMLNode(XMLNode * lpNode); // put data to node
+
+ // data of solid brush object
+ BYTE m_bOpacity; // Common brush opacity
+ DWORD m_dwColor; // Color of solid brush
+};
+
+class skinpp_GRADIENT: public skinpp_SKINOBJECT
+{
+public:
+ //constructor and destructor
+ skinpp_GRADIENT();
+ ~skinpp_GRADIENT();
+
+ virtual int GetObjectDataFromXMLNode(XMLNode * lpNode); // gets data from node
+ virtual int PutObjectDataToXMLNode(XMLNode * lpNode); // put data to node
+
+ // data of gradient brush object
+ BYTE m_bStartOpacity; // start brush opacity
+ DWORD m_dwStartColor; // start color of gradient brush
+ BYTE m_bEndOpacity; // end brush opacity
+ DWORD m_dwEndColor; // end color of gradient brush
+ BYTE m_bDirection;
+};
+
+class skinpp_EMPTY: public skinpp_SKINOBJECT
+{
+public:
+ //constructor and destructor
+ skinpp_EMPTY();
+ ~skinpp_EMPTY();
+
+ virtual int GetObjectDataFromXMLNode(XMLNode * lpNode); // gets data from node
+ virtual int PutObjectDataToXMLNode(XMLNode * lpNode); // put data to node
+};
+
+class skinpp_SELECTOR
+{
+public:
+ //constructor and destructor
+};
+
+#endif // skinpp_private_h__
\ No newline at end of file diff --git a/plugins/Modernb/_disabled_src/stdafx.cpp b/plugins/Modernb/_disabled_src/stdafx.cpp new file mode 100644 index 0000000000..6856e97c85 --- /dev/null +++ b/plugins/Modernb/_disabled_src/stdafx.cpp @@ -0,0 +1,56 @@ +// stdafx.cpp : source file that includes just the standard includes
+// MMXSwarm.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+// Also includes utility functions that rarely change.
+//
+// This is a part of the Microsoft Foundation Classes C++ library.
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//
+// This source code is only intended as a supplement to the
+// Microsoft Foundation Classes Reference and related
+// electronic documentation provided with the library.
+// See these sources for detailed information regarding the
+// Microsoft Foundation Classes product.
+//
+#include "stdafx.h"
+#include <windows.h>
+#include <stdio.h>
+
+static bool _IsMMX();
+
+bool IsMMX()
+{
+ static bool bMMX = _IsMMX();
+ return(bMMX);
+}
+
+static bool _IsMMX()
+{
+ // This bit flag can get set on calling cpuid
+ // with register eax set to 1
+ const int _MMX_FEATURE_BIT = 0x00800000;
+ DWORD dwFeature = 0;
+ __try {
+ _asm {
+ mov eax,1
+ cpuid
+ mov dwFeature,edx
+ }
+ } __except ( EXCEPTION_EXECUTE_HANDLER) {
+ return false;
+ }
+ if (dwFeature & _MMX_FEATURE_BIT) {
+ __try {
+ __asm {
+ pxor mm0, mm0
+ emms
+ }
+ } __except (EXCEPTION_EXECUTE_HANDLER) {
+ return (0);
+ }
+ return(true);
+ }
+
+ return false;
+}
+
|