summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-21 12:11:11 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-21 12:11:11 +0000
commit84c6ccfafbfe7b320443294ac78b3033774602cf (patch)
treed92c6f118c604944cad11fea006ba0aa20d8023f
parent6dc45c41690e8d25757918256fbcb0a06db52f17 (diff)
proper file for the precompiled headers
git-svn-id: http://svn.miranda-ng.org/main/trunk@2415 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonheaders.h5
-rw-r--r--plugins/Clist_modern/src/modern_cachefuncs.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_clistevents.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_cluiframes.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_commonheaders.cpp245
-rw-r--r--plugins/Clist_modern/src/modern_contact.cpp34
-rw-r--r--plugins/Clist_modern/src/modern_image_array.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_rowheight_funcs.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_rowtemplateopt.cpp338
-rw-r--r--plugins/Clist_modern/src/modern_skinbutton.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp32
-rw-r--r--plugins/Clist_modern/src/modern_skinopt.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_utils.cpp161
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp2
-rw-r--r--plugins/Clist_modern/src/resource.h2
21 files changed, 327 insertions, 554 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_commonheaders.h b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
index d54dec0392..ed9690a1b1 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonheaders.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
@@ -233,7 +233,6 @@ extern int CLUI_ShowWindowMod(HWND hwnd, int cmd);
extern void TRACE_ERROR();
extern BOOL DebugDeleteObject(HGDIOBJ a);
-extern BOOL mod_DeleteDC(HDC hdc);
extern BOOL ske_ResetTextEffect(HDC hdc);
extern BOOL ske_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor);
extern void IvalidateDisplayNameCache(DWORD mode);
@@ -258,7 +257,6 @@ void FreeAndNil( void **p );
extern SortedList *clistCache;
-HICON LoadSmallIconShared(HINSTANCE hInstance, LPCTSTR lpIconName);
HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName);
BOOL DestroyIcon_protect(HICON icon);
@@ -347,9 +345,6 @@ void pdnce___SetStatus( ClcCacheEntry *pdnce, WORD wStatus );
typedef void (*ItemDestuctor)(void*);
void li_ListDestruct(SortedList *pList, ItemDestuctor pItemDestructor);
-void li_RemoveDestruct(SortedList *pList, int index, ItemDestuctor pItemDestructor);
-void li_RemovePtrDestruct(SortedList *pList, void * ptr, ItemDestuctor pItemDestructor);
-void li_SortList(SortedList *pList, FSortFunc pSortFunct);
#define mir_safe_free(a) if(a) mir_free(a)
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp
index 2d95a3d58f..d6c7cf2338 100644
--- a/plugins/Clist_modern/src/modern_cachefuncs.cpp
+++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp
@@ -798,8 +798,8 @@ void Cache_ProceedAvatarInList(ClcData *dat, ClcContact *contact)
BitBlt(hdc, rc.left, rc.top, w, h,hdcTmp2,0,0,SRCCOPY);
SelectObject(hdcTmp2,bmo2);
SelectObject(hdcTmp,bmo);
- mod_DeleteDC(hdcTmp);
- mod_DeleteDC(hdcTmp2);
+ DeleteDC(hdcTmp);
+ DeleteDC(hdcTmp2);
DeleteObject(b2);
}
else {
@@ -809,7 +809,7 @@ void Cache_ProceedAvatarInList(ClcData *dat, ClcContact *contact)
hbmTempAvOld = (HBITMAP)SelectObject(hdcTempAv,ace->hbmPic);
ske_AlphaBlend(hdc, rc.left, rc.top, w, h, hdcTempAv, 0, 0,ace->bmWidth,ace->bmHeight, bf);
SelectObject(hdcTempAv, hbmTempAvOld);
- mod_DeleteDC(hdcTempAv);
+ DeleteDC(hdcTempAv);
}
}
}
@@ -899,7 +899,7 @@ void Cache_GetAvatar(ClcData *dat, ClcContact *contact)
HBITMAP obmp = (HBITMAP)SelectObject(dcMem, hBmp);
StretchBlt(hdc, 0, 0, width_clip, height_clip,dcMem, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
SelectObject(dcMem,obmp);
- mod_DeleteDC(dcMem);
+ DeleteDC(dcMem);
RECT rtr = {0};
rtr.right = width_clip+1;
@@ -908,7 +908,7 @@ void Cache_GetAvatar(ClcData *dat, ClcContact *contact)
hDrawBmp = (HBITMAP)GetCurrentObject(hdc, OBJ_BITMAP);
SelectObject(hdc,oldBmp);
- mod_DeleteDC(hdc);
+ DeleteDC(hdc);
// Add to list
if (old_pos >= 0) {
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index a905536b03..e2b3aea184 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -1495,7 +1495,7 @@ static LRESULT clcOnDestroy(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LP
}
ImageArray_Clear(&dat->avatar_cache);
- mod_DeleteDC(dat->avatar_cache.hdc);
+ DeleteDC(dat->avatar_cache.hdc);
ImageArray_Free(&dat->avatar_cache, FALSE);
if (dat->himlHighlight)
ImageList_Destroy(dat->himlHighlight);
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index 8d8570bc1a..36a4f619b5 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -474,8 +474,8 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar
{
HIMAGELIST himlCheckBoxes;
himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,2,2);
- ImageList_AddIcon(himlCheckBoxes,LoadSmallIconShared(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_NOTICK)));
- ImageList_AddIcon(himlCheckBoxes,LoadSmallIconShared(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_TICK)));
+ ImageList_AddIcon(himlCheckBoxes, LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
+ ImageList_AddIcon(himlCheckBoxes, LoadSkinnedIcon(SKINICON_OTHER_TICK));
TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),himlCheckBoxes,TVSIL_NORMAL);
TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),himlCheckBoxes,TVSIL_NORMAL);
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index 90b1512d21..9ad29ca52d 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -1453,8 +1453,8 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
BitBlt( hdcMem, p_rect.left, p_rect.top, w, h, hdcTmp2, 0, 0, SRCCOPY );
SelectObject( hdcTmp2, bmo2 );
SelectObject( hdcTmp, bmo );
- mod_DeleteDC( hdcTmp );
- mod_DeleteDC( hdcTmp2 );
+ DeleteDC( hdcTmp );
+ DeleteDC( hdcTmp2 );
DeleteObject( b2 );
}
else {
@@ -1464,7 +1464,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
hbmTempAvOld = ( HBITMAP )SelectObject( hdcTempAv, Drawing->avatar_data->hbmPic );
ske_AlphaBlend( hdcMem, p_rect.left, p_rect.top, w, h, hdcTempAv, 0, 0, Drawing->avatar_data->bmWidth, Drawing->avatar_data->bmHeight, bf );
SelectObject( hdcTempAv, hbmTempAvOld );
- mod_DeleteDC( hdcTempAv );
+ DeleteDC( hdcTempAv );
}
}*/
_DrawContactAvatar( hdcMem, dat, Drawing, &row_rc, selected, hottrack, p_rect, &p_rect );
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp
index e94d28eb18..7745330956 100644
--- a/plugins/Clist_modern/src/modern_clistevents.cpp
+++ b/plugins/Clist_modern/src/modern_clistevents.cpp
@@ -565,7 +565,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP
hdc2,rc.left,rc.top,SRCCOPY);
SelectObject(hdc2,hbmpo);
DeleteObject(hbmp);
- mod_DeleteDC(hdc2);
+ DeleteDC(hdc2);
SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
ReleaseDC(hwnd,hdc);
ValidateRect(hwnd,NULL);
@@ -587,7 +587,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP
hdc2,ps.rcPaint.left,ps.rcPaint.top,SRCCOPY);
SelectObject(hdc2,hbmpo);
DeleteObject(hbmp);
- mod_DeleteDC(hdc2);
+ DeleteDC(hdc2);
ps.fErase = FALSE;
EndPaint(hwnd,&ps);
}
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 913617b2dc..b0a9ffee51 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -2061,7 +2061,7 @@ LRESULT CLUI::OnPaint( UINT msg, WPARAM wParam, LPARAM lParam )
BitBlt(paintDC,w2.left,w2.top,w2.right-w2.left,w2.bottom-w2.top,g_pCachedWindow->hBackDC,w2.left,w2.top,SRCCOPY);
SelectObject(hdc,oldbmp);
DeleteObject(hbmp);
- mod_DeleteDC(hdc);
+ DeleteDC(hdc);
ReleaseDC(m_hWnd,paintDC);
}
else {
diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp
index de2b26bf7e..2b78349096 100644
--- a/plugins/Clist_modern/src/modern_cluiframes.cpp
+++ b/plugins/Clist_modern/src/modern_cluiframes.cpp
@@ -2981,7 +2981,7 @@ int DrawTitleBar(HDC hdcMem2,RECT *rect,int Frameid)
DeleteObject(b1);
SelectObject(hdcMem,hoTTBFont);
SelectObject(hdcMem,hoBrush);
- mod_DeleteDC(hdcMem);
+ DeleteDC(hdcMem);
return 0;
}
static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/Clist_modern/src/modern_commonheaders.cpp b/plugins/Clist_modern/src/modern_commonheaders.cpp
index 45c2709d2b..d2c889fa24 100644
--- a/plugins/Clist_modern/src/modern_commonheaders.cpp
+++ b/plugins/Clist_modern/src/modern_commonheaders.cpp
@@ -1,247 +1,2 @@
#define DB_USEHELPERFUNCTIONS
#include "hdr/modern_commonheaders.h"
-
-BYTE gl_TrimText = 1;
-
-char * __cdecl strstri( char *a, const char *b)
-{
- char * x, *y;
- if ( !a || !b) return FALSE;
- x = _strdup(a);
- y = _strdup(b);
- x = _strupr(x);
- y = _strupr(y);
- char * pos = strstr(x,y);
- if ( pos )
- {
- char * retval = a + ( pos - x );
- free(x);
- free(y);
- return retval;
- }
- free(x);
- free(y);
- return NULL;
-}
-int __cdecl mir_strcmpi(const char *a, const char *b)
-{
- if (a == NULL && b == NULL) return 0;
- if (a == NULL || b == NULL) return _stricmp(a?a:"",b?b:"");
- return _stricmp(a,b);
-}
-
-int __cdecl mir_tstrcmpi(const TCHAR *a, const TCHAR *b)
-{
- if (a == NULL && b == NULL) return 0;
- if (a == NULL || b == NULL) return _tcsicmp(a?a:_T(""),b?b:_T(""));
- return _tcsicmp(a,b);
-}
-BOOL __cdecl mir_bool_strcmpi(const char *a, const char *b)
-{
- if (a == NULL && b == NULL) return 1;
- if (a == NULL || b == NULL) return _stricmp(a?a:"",b?b:"") == 0;
- return _stricmp(a,b) == 0;
-}
-
-BOOL __cdecl mir_bool_tstrcmpi(const TCHAR *a, const TCHAR *b)
-{
- if (a == NULL && b == NULL) return 1;
- if (a == NULL || b == NULL) return _tcsicmp(a?a:_T(""),b?b:_T("")) == 0;
- return _tcsicmp(a,b) == 0;
-}
-
-#ifdef strlen
-#undef strcmp
-#undef strlen
-#endif
-
-int __cdecl mir_strcmp (const char *a, const char *b)
-{
- if ( !(a && b)) return a != b;
- return (strcmp(a,b));
-};
-
-int mir_strlen (const char *a)
-{
- if (a == NULL) return 0;
- return (int)(strlen(a));
-};
-
-#define strlen(a) mir_strlen(a)
-#define strcmp(a,b) mir_strcmp(a,b)
-
-/*
-__inline void *mir_calloc( size_t num, size_t size )
-{
- void *p = mir_alloc(num*size);
- if (p == NULL) return NULL;
- memset(p,0,num*size);
- return p;
-};
-*/
-wchar_t * mir_strdupW(const wchar_t * src)
-{
- wchar_t * p;
- if (src == NULL) return NULL;
- p = (wchar_t *) mir_alloc((lstrlenW(src)+1)*sizeof(wchar_t));
- if ( !p) return 0;
- lstrcpyW(p, src);
- return p;
-}
-
-//copy len symbols from string - do not check is it null terminated or len is more then actual
-char * strdupn(const char * src, int len)
-{
- char * p;
- if (src == NULL) return NULL;
- p = (char*)malloc(len+1);
- if ( !p) return 0;
- memcpy(p,src,len);
- p[len] = '\0';
- return p;
-}
-
-DWORD exceptFunction(LPEXCEPTION_POINTERS EP)
-{
- //printf("1 "); // printed first
- char buf[4096];
-
-
- mir_snprintf(buf, SIZEOF(buf), "\r\nExceptCode: %x\r\nExceptFlags: %x\r\nExceptAddress: %p\r\n",
- EP->ExceptionRecord->ExceptionCode,
- EP->ExceptionRecord->ExceptionFlags,
- EP->ExceptionRecord->ExceptionAddress
- );
- TRACE(buf);
- MessageBoxA(0,buf,"clist_mw Exception",0);
-
-
- return EXCEPTION_EXECUTE_HANDLER;
-}
-
-#ifdef _DEBUG
-#undef DeleteObject
-#endif
-
-void TRACE_ERROR()
-{
- DWORD t = GetLastError();
- LPVOID lpMsgBuf;
- if ( !FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- t,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPTSTR) &lpMsgBuf,
- 0,
- NULL ))
- {
- // Handle the error.
- return ;
- }
-#ifdef _DEBUG
- MessageBox( NULL, (LPCTSTR)lpMsgBuf, _T("Error"), MB_OK | MB_ICONINFORMATION );
- DebugBreak();
-#endif
- LocalFree( lpMsgBuf );
-
-}
-
-BOOL DebugDeleteObject(HGDIOBJ a)
-{
- BOOL res = DeleteObject(a);
- if ( !res) TRACE_ERROR();
- return res;
-}
-
-BOOL mod_DeleteDC(HDC hdc)
-{
-// ske_ResetTextEffect(hdc);
- return DeleteDC(hdc);
-}
-#ifdef _DEBUG
-#define DeleteObject(a) DebugDeleteObject(a)
-#endif
-
-
-// load small icon (shared) it's not need to be destroyed
-
-HICON LoadSmallIconShared(HINSTANCE hInstance, LPCTSTR lpIconName)
-{
- int cx = GetSystemMetrics(SM_CXSMICON);
- return (HICON)LoadImage(hInstance,lpIconName, IMAGE_ICON,cx,cx, LR_DEFAULTCOLOR|LR_SHARED);
-}
-
-// load small icon (not shared) it IS NEED to be destroyed
-HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName)
-{
- HICON hIcon = NULL; // icon handle
- int index = -(int)lpIconName;
- TCHAR filename[MAX_PATH] = {0};
- GetModuleFileName(hInstance,filename,MAX_PATH);
- ExtractIconEx(filename,index,NULL,&hIcon,1);
- return hIcon;
-}
-
-// load small icon from hInstance
-HICON LoadIconEx(HINSTANCE hInstance, LPCTSTR lpIconName, BOOL bShared)
-{
- HICON hResIcon = bShared?LoadSmallIcon(hInstance,lpIconName):LoadSmallIconShared(hInstance,lpIconName);
- if ( !hResIcon) //Icon not found in hInstance lets try to load it from core
- {
- HINSTANCE hCoreInstance = GetModuleHandle(NULL);
- if (hCoreInstance != hInstance)
- hResIcon = bShared?LoadSmallIcon(hInstance,lpIconName):LoadSmallIconShared(hInstance,lpIconName);
- }
- return hResIcon;
-}
-
-BOOL DestroyIcon_protect(HICON icon)
-{
- if (icon) return DestroyIcon(icon);
- return FALSE;
-}
-
-void li_ListDestruct(SortedList *pList, ItemDestuctor pItemDestructor)
-{
- int i=0;
- if ( !pList) return;
- for (i=0; i < pList->realCount; i++) pItemDestructor(pList->items[i]);
- List_Destroy(pList);
- mir_free(pList);
-}
-
-void li_RemoveDestruct(SortedList *pList, int index, ItemDestuctor pItemDestructor)
-{
- if (index >= 0 && index < pList->realCount)
- {
- pItemDestructor(pList->items[index]);
- List_Remove(pList, index);
- }
-}
-
-void li_RemovePtrDestruct(SortedList *pList, void * ptr, ItemDestuctor pItemDestructor)
-{
- if (List_RemovePtr(pList, ptr))
- pItemDestructor(ptr);
-}
-
-void li_SortList(SortedList *pList, FSortFunc pSortFunct)
-{
- FSortFunc pOldSort = pList->sortFunc;
- int i;
- if ( !pSortFunct) pSortFunct = pOldSort;
- pList->sortFunc = NULL;
- for (i=0; i < pList->realCount-1; i++)
- if (pOldSort(pList->items[i],pList->items[i+1]) < 0)
- {
- void * temp = pList->items[i];
- pList->items[i] = pList->items[i+1];
- pList->items[i+1] = temp;
- i--;
- if (i>0) i--;
- }
- pList->sortFunc = pOldSort;
-}
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp
index e1cc237e36..4f1de747b5 100644
--- a/plugins/Clist_modern/src/modern_contact.cpp
+++ b/plugins/Clist_modern/src/modern_contact.cpp
@@ -83,42 +83,41 @@ DWORD CompareContacts2_getLMTime(HANDLE hContact)
int GetProtoIndex(char * szName)
{
- PROTOACCOUNT **accs = NULL;
- int accCount = 0;
- int i;
- if ( !szName) return -1;
- ProtoEnumAccounts( &accCount, &accs );
- for (i=0; i < accCount; i++)
- if ( !mir_strcmpi(szName,accs[i]->szModuleName))
- return accs[i]->iOrder;
- return -1;
+ if (szName) {
+ PROTOACCOUNT **accs = NULL;
+ int accCount = 0;
+ ProtoEnumAccounts( &accCount, &accs );
+
+ for (int i=0; i < accCount; i++)
+ if ( !mir_strcmpi(szName, accs[i]->szModuleName))
+ return accs[i]->iOrder;
+ }
+
+ return -1;
}
int CompareContacts2(const ClcContact *contact1,const ClcContact *contact2, int by)
{
-
HANDLE a;
HANDLE b;
TCHAR *namea, *nameb;
int statusa,statusb;
char *szProto1,*szProto2;
-
+
if ((INT_PTR)contact1 < 100 || (INT_PTR)contact2 < 100) return 0;
-
+
a = contact1->hContact;
b = contact2->hContact;
-
+
namea = (TCHAR *)contact1->szText;
statusa = GetContactCachedStatus(contact1->hContact);
szProto1 = contact1->proto;
-
+
nameb = (TCHAR *)contact2->szText;
statusb = GetContactCachedStatus(contact2->hContact);
szProto2 = contact2->proto;
-
- if (by == SORTBY_STATUS)
- { //status
+ if (by == SORTBY_STATUS) { //status
int ordera,orderb;
ordera = GetStatusModeOrdering(statusa);
orderb = GetStatusModeOrdering(statusb);
@@ -191,7 +190,6 @@ INT_PTR ToggleHideOffline(WPARAM wParam,LPARAM lParam)
INT_PTR ToggleGroups(WPARAM wParam,LPARAM lParam)
{
-
db_set_b(NULL, "CList", "UseGroups",
(BYTE) !db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
pcli->pfnLoadContactTree();
diff --git a/plugins/Clist_modern/src/modern_image_array.cpp b/plugins/Clist_modern/src/modern_image_array.cpp
index 11b51081a9..0798f9a993 100644
--- a/plugins/Clist_modern/src/modern_image_array.cpp
+++ b/plugins/Clist_modern/src/modern_image_array.cpp
@@ -133,7 +133,7 @@ void ImageArray_Initialize(LP_IMAGE_ARRAY_DATA iad, BOOL width_based, int grow_s
// If keep_bitmap is TRUE, doesn't delete de bitmap and return its handle. Else, return NULL
HBITMAP ImageArray_Free(LP_IMAGE_ARRAY_DATA iad, BOOL keep_bitmap)
{
- mod_DeleteDC(iad->hdc);
+ DeleteDC(iad->hdc);
if (iad->img != NULL && !keep_bitmap)
{
@@ -160,7 +160,7 @@ HBITMAP ImageArray_Free(LP_IMAGE_ARRAY_DATA iad, BOOL keep_bitmap)
void ImageArray_Clear(LP_IMAGE_ARRAY_DATA iad)
{
HDC tmpdc = CreateCompatibleDC(iad->hdc);
- if (iad->hdc) mod_DeleteDC(iad->hdc);
+ if (iad->hdc) DeleteDC(iad->hdc);
iad->hdc = tmpdc;
if (iad->img != NULL)
@@ -339,7 +339,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
// restore things
SelectObject(hdc_old,old_bmp);
- mod_DeleteDC(hdc_old);
+ DeleteDC(hdc_old);
if (iad->img != NULL) DeleteObject(iad->img);
iad->img = hNewBmp;
@@ -499,7 +499,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
}
// restore things
- mod_DeleteDC(hdc_old);
+ DeleteDC(hdc_old);
if (iad->img != NULL) DeleteObject(iad->img);
iad->img = hNewBmp;
@@ -628,7 +628,7 @@ BOOL ImageArray_RemoveImage(LP_IMAGE_ARRAY_DATA iad, int pos)
}
// restore things
- mod_DeleteDC(hdc_old);
+ DeleteDC(hdc_old);
if (iad->img != NULL) DeleteObject(iad->img);
iad->img = hNewBmp;
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
index 9e041b48a3..427467bdbc 100644
--- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
+++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
@@ -155,7 +155,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
gl_RowTabAccess[i]->w = size.cx;
SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
ske_ResetTextEffect(hdc);
- mod_DeleteDC(hdc);
+ DeleteDC(hdc);
}
gl_RowTabAccess[i]->h = tmp;
}
@@ -182,7 +182,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
gl_RowTabAccess[i]->w = size.cx;
SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
ske_ResetTextEffect(hdc);
- mod_DeleteDC(hdc);
+ DeleteDC(hdc);
}
}
gl_RowTabAccess[i]->h = tmp;
@@ -207,7 +207,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
gl_RowTabAccess[i]->w = size.cx;
SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
ske_ResetTextEffect(hdc);
- mod_DeleteDC(hdc);
+ DeleteDC(hdc);
}
}
gl_RowTabAccess[i]->h = tmp;
@@ -309,7 +309,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
text_size.cy = ske_DrawText(hdc, szResult, lstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
ske_ResetTextEffect(hdc);
- mod_DeleteDC(hdc);
+ DeleteDC(hdc);
text_size.cx = rc.right - rc.left;
gl_RowTabAccess[i]->w = text_size.cx;
}
diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
index 2fb5444032..3e11a9c127 100644
--- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
+++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
@@ -28,25 +28,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "hdr/modern_commonprototypes.h"
#include "hdr/modern_row.h"
-
-
-
-
-
void RefreshTree(HWND hwndDlg,HTREEITEM hti);
static char* rowOptTmplStr;
static ROWCELL* rowOptTmplRoot;
static ROWCELL* rowOptTA[100];
- TCHAR *types[] = {_T("none"), _T("text1"), _T("text2"), _T("text3"), _T("status"),
- _T("avatar"), _T("extra"), _T("extra1"), _T("extra2"), _T("extra3"),
- _T("extra4"), _T("extra5"), _T("extra6"), _T("extra7"), _T("extra8"),
- _T("extra9"), _T("time"), _T("space"), _T("fspace")};
+TCHAR *types[] = {
+ _T("none"), _T("text1"), _T("text2"), _T("text3"), _T("status"),
+ _T("avatar"), _T("extra"), _T("extra1"), _T("extra2"), _T("extra3"),
+ _T("extra4"), _T("extra5"), _T("extra6"), _T("extra7"), _T("extra8"),
+ _T("extra9"), _T("time"), _T("space"), _T("fspace")
+};
+
RECT da = {205,58,440,130}; // Draw area
-// Add by ZorG
-//char * rowOptBuildTmpl(HTREEITEM node, HWND htree)
-//{
-//}
void rowOptBuildTA(pROWCELL cell, pROWCELL* TA, int* i)
{
if ( !cell) return;
@@ -68,8 +62,7 @@ void rowOptShowSettings(HWND hwnd)
TreeView_GetItem(GetDlgItem(hwnd, IDC_ROWTREE), &tvi);
cell = (pROWCELL)tvi.lParam;
- if ( !tvi.hItem)
- {
+ if ( !tvi.hItem) {
EnableWindow(GetDlgItem(hwnd,IDC_CONTTYPE) ,0);
EnableWindow(GetDlgItem(hwnd,IDC_VALIGN),0);
EnableWindow(GetDlgItem(hwnd,IDC_HALIGN) ,0);
@@ -80,40 +73,34 @@ void rowOptShowSettings(HWND hwnd)
SendDlgItemMessage(hwnd,IDC_SPINCONTWIDTH, UDM_SETPOS,0,0);
SendDlgItemMessage(hwnd,IDC_SPINCONTHEIGHT,UDM_SETPOS,0,0);
EnableWindow(GetDlgItem(hwnd,IDC_CONTLAYER),0);
- return;
+ return;
}
- else
- {
- EnableWindow(GetDlgItem(hwnd,IDC_CONTTYPE) ,1);
- EnableWindow(GetDlgItem(hwnd,IDC_VALIGN),1);
- EnableWindow(GetDlgItem(hwnd,IDC_HALIGN) ,1);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTLAYER),1);
- if (cell->type != TC_SPACE && cell->type != TC_FIXED)
- {
- EnableWindow(GetDlgItem(hwnd,IDC_CONTWIDTH) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTHEIGHT),0);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTWIDTH) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTHEIGHT),0);
- SendDlgItemMessage(hwnd,IDC_SPINCONTWIDTH, UDM_SETPOS,0,0);
- SendDlgItemMessage(hwnd,IDC_SPINCONTHEIGHT,UDM_SETPOS,0,0);
- }
- else
- {
- EnableWindow(GetDlgItem(hwnd,IDC_CONTWIDTH) ,1);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTHEIGHT),1);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTWIDTH) ,1);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTHEIGHT),1);
- SendDlgItemMessage(hwnd,IDC_SPINCONTWIDTH, UDM_SETPOS,0,MAKELONG(cell->w,0));
- SendDlgItemMessage(hwnd,IDC_SPINCONTHEIGHT,UDM_SETPOS,0,MAKELONG(cell->h,0));
- }
-
+ EnableWindow(GetDlgItem(hwnd,IDC_CONTTYPE) ,1);
+ EnableWindow(GetDlgItem(hwnd,IDC_VALIGN),1);
+ EnableWindow(GetDlgItem(hwnd,IDC_HALIGN) ,1);
+ EnableWindow(GetDlgItem(hwnd,IDC_CONTLAYER),1);
+
+ if (cell->type != TC_SPACE && cell->type != TC_FIXED) {
+ EnableWindow(GetDlgItem(hwnd,IDC_CONTWIDTH) ,0);
+ EnableWindow(GetDlgItem(hwnd,IDC_CONTHEIGHT),0);
+ EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTWIDTH) ,0);
+ EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTHEIGHT),0);
+ SendDlgItemMessage(hwnd,IDC_SPINCONTWIDTH, UDM_SETPOS,0,0);
+ SendDlgItemMessage(hwnd,IDC_SPINCONTHEIGHT,UDM_SETPOS,0,0);
+ }
+ else {
+ EnableWindow(GetDlgItem(hwnd,IDC_CONTWIDTH) ,1);
+ EnableWindow(GetDlgItem(hwnd,IDC_CONTHEIGHT),1);
+ EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTWIDTH) ,1);
+ EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTHEIGHT),1);
+ SendDlgItemMessage(hwnd,IDC_SPINCONTWIDTH, UDM_SETPOS,0,MAKELONG(cell->w,0));
+ SendDlgItemMessage(hwnd,IDC_SPINCONTHEIGHT,UDM_SETPOS,0,MAKELONG(cell->h,0));
}
SendDlgItemMessage(hwnd, IDC_CONTTYPE, CB_SETCURSEL, cell->type, 0);
- switch (cell->valign)
- {
+ switch (cell->valign) {
case TC_VCENTER:
param = 1;
break;
@@ -125,8 +112,7 @@ void rowOptShowSettings(HWND hwnd)
}
SendDlgItemMessage(hwnd, IDC_VALIGN, CB_SETCURSEL, param, 0);
- switch (cell->halign)
- {
+ switch (cell->halign) {
case TC_HCENTER:
param = 1;
break;
@@ -139,49 +125,40 @@ void rowOptShowSettings(HWND hwnd)
SendDlgItemMessage(hwnd, IDC_HALIGN, CB_SETCURSEL, param, 0);
CheckDlgButton(hwnd,IDC_CONTLAYER,cell->layer?BST_CHECKED:BST_UNCHECKED);
-
- return;
-
}
void rowOptGenerateTreeView(pROWCELL cell, HTREEITEM node, HWND hwnd)
{
- TVINSERTSTRUCT tvis;
- HTREEITEM pnode;
-
if ( !cell) return;
+ TVINSERTSTRUCT tvis;
tvis.hParent = node;
- tvis.hInsertAfter = TVI_LAST;
+ tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.lParam = (LPARAM)cell;
- switch (cell->cont)
- {
+ switch (cell->cont) {
case TC_ROW:
tvis.item.pszText = _T("Line");
break;
case TC_COL:
tvis.item.pszText = _T("Column");
}
-
+
tvis.item.iImage = cell->child?1:2;
tvis.item.iSelectedImage = cell->child?0:2;
- pnode = TreeView_InsertItem(hwnd,&tvis);
-
+ HTREEITEM pnode = TreeView_InsertItem(hwnd,&tvis);
rowOptGenerateTreeView(cell->child, pnode, hwnd);
rowOptGenerateTreeView(cell->next, node, hwnd);
}
int rowOptFillRowTree(HWND hwnd)
{
- int i=0;
TreeView_DeleteAllItems(hwnd);
rowOptGenerateTreeView(rowOptTmplRoot, NULL, hwnd);
TreeView_Expand(hwnd, TreeView_GetRoot(hwnd), TVM_EXPAND);
-
return 0;
}
@@ -191,21 +168,18 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti)
TVITEM tviparent;
ROWCELL *cell = NULL;
- if ( !hti)
- {
- if (TreeView_GetRoot(htree)) return;
- else
- {
- rowAddCell(rowOptTmplRoot, TC_ROW);
- tvis.hParent = NULL;
- tvis.hInsertAfter = TVI_ROOT;
- tvis.item.pszText = _T("Line");
- tvis.item.lParam = (LPARAM)rowOptTmplRoot;
- cell = rowOptTmplRoot;
- }
+ if ( !hti) {
+ if (TreeView_GetRoot(htree))
+ return;
+
+ rowAddCell(rowOptTmplRoot, TC_ROW);
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = TVI_ROOT;
+ tvis.item.pszText = _T("Line");
+ tvis.item.lParam = (LPARAM)rowOptTmplRoot;
+ cell = rowOptTmplRoot;
}
- else
- {
+ else {
// Get parent item
tviparent.hItem = hti;
tviparent.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
@@ -217,8 +191,7 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti)
else
tvis.item.pszText = _T("Line");
- if (cell->child)
- {
+ if (cell->child) {
cell = cell->child;
while (cell->next)
@@ -227,8 +200,7 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti)
rowAddCell(cell->next, ((ROWCELL*)tviparent.lParam)->cont == TC_ROW?TC_COL:TC_ROW);
cell = cell->next;
}
- else
- {
+ else {
rowAddCell(cell->child, ((ROWCELL*)tviparent.lParam)->cont == TC_ROW?TC_COL:TC_ROW);
cell = cell->child;
}
@@ -253,12 +225,9 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti)
tviparent.iSelectedImage = 0;
TreeView_SetItem(htree, &tviparent);
- {
- int i=0;
- ZeroMemory( rowOptTA, sizeof( rowOptTA ));
- rowOptBuildTA(rowOptTmplRoot, (pROWCELL*)&rowOptTA, &i);
- }
-
+ int i=0;
+ ZeroMemory( rowOptTA, sizeof( rowOptTA ));
+ rowOptBuildTA(rowOptTmplRoot, (pROWCELL*)&rowOptTA, &i);
}
void rowOptDelContainer(HWND htree, HTREEITEM hti)
@@ -375,8 +344,7 @@ void RefreshTree(HWND hwndDlg,HTREEITEM hti)
INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
{
int hbuf = 0, seq = 0;
@@ -384,52 +352,33 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TranslateDialogDefault(hwndDlg);
rowOptTmplStr = db_get_sa(NULL, "ModernData", "RowTemplate");
- if ( !rowOptTmplStr) rowOptTmplStr = mir_strdup("<TR />");
- {
- //HIMAGELIST himlTreeIcons;
- //himlTreeIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,3,2);
- //ImageList_AddIcon(himlTreeIcons,LoadSmallIconShared(g_hInst,MAKEINTRESOURCE(IDI_ROWCONT1)));
- //ImageList_AddIcon(himlTreeIcons,LoadSmallIconShared(g_hInst,MAKEINTRESOURCE(IDI_ROWCONT2)));
- //ImageList_AddIcon(himlTreeIcons,LoadSmallIconShared(g_hInst,MAKEINTRESOURCE(IDI_ROWCONT3)));
- //TreeView_SetImageList(htree,himlTreeIcons,TVSIL_NORMAL);
- }
+ if ( !rowOptTmplStr)
+ rowOptTmplStr = mir_strdup("<TR />");
SendDlgItemMessage(hwndDlg,IDC_SPINCONTWIDTH, UDM_SETRANGE,0,MAKELONG(999,0));
SendDlgItemMessage(hwndDlg,IDC_SPINCONTHEIGHT,UDM_SETRANGE,0,MAKELONG(999,0));
- {
- int i, item;
+ int i, item;
- for (i=0; i < SIZEOF(types); i++)
- {
- item = SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_ADDSTRING,0,(LPARAM)TranslateTS(types[i]));
- SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_SETITEMDATA,item,0);
- }
- SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_SETCURSEL,0,0);
+ for (i=0; i < SIZEOF(types); i++) {
+ item = SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_ADDSTRING,0,(LPARAM)TranslateTS(types[i]));
+ SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_SETITEMDATA,item,0);
}
+ SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_SETCURSEL,0,0);
- {
- int i, item;
- TCHAR *alignment[] = {_T("left"), _T("hCenter"), _T("right")};
- for (i=0; i < SIZEOF(alignment); i++)
- {
- item = SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_ADDSTRING,0,(LPARAM)TranslateTS(alignment[i]));
- SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_SETITEMDATA,item,0);
- }
- SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_SETCURSEL,0,0);
-
+ TCHAR *h_alignment[] = {_T("left"), _T("hCenter"), _T("right")};
+ for (i=0; i < SIZEOF(h_alignment); i++) {
+ item = SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_ADDSTRING,0,(LPARAM)TranslateTS(h_alignment[i]));
+ SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_SETITEMDATA,item,0);
}
+ SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_SETCURSEL,0,0);
- {
- int i, item;
- TCHAR *alignment[] = {_T("top"), _T("vCenter"), _T("bottom")};
- for (i=0; i < SIZEOF(alignment); i++)
- {
- item = SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_ADDSTRING,0,(LPARAM)TranslateTS(alignment[i]));
- SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_SETITEMDATA,item,0);
- }
- SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_SETCURSEL,0,0);
+ TCHAR *v_alignment[] = {_T("top"), _T("vCenter"), _T("bottom")};
+ for (i=0; i < SIZEOF(v_alignment); i++) {
+ item = SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_ADDSTRING,0,(LPARAM)TranslateTS(v_alignment[i]));
+ SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_SETITEMDATA,item,0);
}
+ SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_SETCURSEL,0,0);
rowDeleteTree(rowOptTmplRoot);
rowOptTmplRoot = NULL;
@@ -442,9 +391,8 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
RefreshTree(hwndDlg,NULL);
TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_ROWTREE), TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_ROWTREE)));
rowOptShowSettings(hwndDlg);
-
- return TRUE;
}
+ return TRUE;
case WM_COMMAND:
{
@@ -452,29 +400,25 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
pROWCELL cell;
TVITEM tvi = {0};
HTREEITEM hti = TreeView_GetSelection(htree);
-
+
tvi.hItem = hti;
tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
TreeView_GetItem(htree, &tvi);
cell = (pROWCELL)tvi.lParam;
- switch (LOWORD(wParam))
- {
+ switch (LOWORD(wParam)) {
case IDC_CONTTYPE:
- if (HIWORD(wParam) == CBN_SELENDOK)
- {
- TVITEM tv = {0};
+ if (HIWORD(wParam) == CBN_SELENDOK) {
+ TVITEM tv = {0};
int index = SendMessage(GetDlgItem(hwndDlg,IDC_CONTTYPE),CB_GETCURSEL, 0, 0);
cell->type = index;
RefreshTree(hwndDlg,NULL);
}
-
+
case IDC_VALIGN:
- if (HIWORD(wParam) == CBN_SELENDOK)
- {
- switch (SendMessage(GetDlgItem(hwndDlg,IDC_VALIGN),CB_GETCURSEL, 0, 0))
- {
+ if (HIWORD(wParam) == CBN_SELENDOK) {
+ switch (SendMessage(GetDlgItem(hwndDlg,IDC_VALIGN),CB_GETCURSEL, 0, 0)) {
case 0:
cell->valign = TC_TOP;
break;
@@ -489,10 +433,8 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
}
case IDC_HALIGN:
- if (HIWORD(wParam) == CBN_SELENDOK)
- {
- switch (SendMessage(GetDlgItem(hwndDlg,IDC_HALIGN),CB_GETCURSEL, 0, 0))
- {
+ if (HIWORD(wParam) == CBN_SELENDOK) {
+ switch (SendMessage(GetDlgItem(hwndDlg,IDC_HALIGN),CB_GETCURSEL, 0, 0)) {
case 0:
cell->halign = TC_LEFT;
break;
@@ -505,77 +447,60 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
}
RefreshTree(hwndDlg,NULL);
}
-
-
}
- if (HIWORD(wParam) == BN_CLICKED)
- {
+ if (HIWORD(wParam) == BN_CLICKED) {
if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_ADDCONTAINER))
- // Adding new container
+ // Adding new container
{
rowOptAddContainer(htree, hti);
}
else if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_DELCONTAINER))
- // Deleting container
+ // Deleting container
{
rowOptDelContainer(htree, hti);
}
else if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_CONTUP))
- // Moving container to up
+ // Moving container to up
{
RedrawWindow(htree,&da,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
}
- else if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_CONTDOWN))
- // Moving container to down
- {
- }
RefreshTree(hwndDlg,NULL);
RedrawWindow(GetParent(hwndDlg),NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
}
-
-
- //SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- return TRUE;
+ return TRUE;
}
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom)
- {
-
+ switch(((LPNMHDR)lParam)->idFrom) {
case IDC_ROWTREE:
if (((LPNMHDR)lParam)->code == NM_SETCURSOR )
rowOptShowSettings(hwndDlg);
if (((LPNMHDR)lParam)->code == NM_CLICK )
RedrawWindow(hwndDlg,&da,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW);
break;
-
+
case 0: // Apply or Ok button is pressed
return FALSE; // Temporary
break;
}
return TRUE;
-
+
case WM_PAINT:
- {
+ if (rowOptTmplRoot) {
int i=0;
// Drawning row template at properties page
PAINTSTRUCT ps;
- HDC hdc;
- TVITEM curItem;
-
- if ( !rowOptTmplRoot) return FALSE;
- hdc = BeginPaint(hwndDlg, &ps);
+ HDC hdc = BeginPaint(hwndDlg, &ps);
+ TVITEM curItem;
curItem.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_ROWTREE));
curItem.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_ROWTREE), &curItem);
- while(rowOptTA[i])
- {
- switch(rowOptTA[i]->type)
- {
+ while(rowOptTA[i]) {
+ switch(rowOptTA[i]->type) {
case TC_AVATAR:
rowOptTA[i]->w = 25;
rowOptTA[i]->h = 30;
@@ -611,38 +536,29 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
rowOptTA[i]->w = 30;
rowOptTA[i]->h = 10;
default:
- {
rowOptTA[i]->w = 0;
rowOptTA[i]->h = 0;
}
-
- }
-
-
i++;
}
-
- rowSizeWithReposition(rowOptTmplRoot, da.right-da.left);
-
+ rowSizeWithReposition(rowOptTmplRoot, da.right-da.left);
i = -1;
- while (rowOptTA[++i])
- {
-
- switch(rowOptTA[i]->type)
- {
+ while (rowOptTA[++i]) {
+
+ switch(rowOptTA[i]->type) {
case TC_SPACE:
case TC_FIXED:
case 0:
//if (rowOptTA[i] != (pROWCELL)curItem.lParam)
- continue;
+ continue;
}
Rectangle(hdc,
- rowOptTA[i]->r.left + da.left,
- rowOptTA[i]->r.top + da.top,
- rowOptTA[i]->r.right + da.left,
- rowOptTA[i]->r.bottom + da.top);
+ rowOptTA[i]->r.left + da.left,
+ rowOptTA[i]->r.top + da.top,
+ rowOptTA[i]->r.right + da.left,
+ rowOptTA[i]->r.bottom + da.top);
}
EndPaint(hwndDlg, &ps);
@@ -652,53 +568,3 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
}
return FALSE;
}
-
-
-
-
-/*
-BOOL CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-
-{
- switch (msg)
- {
- case WM_DESTROY:
- {
- break;
- }
- case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwndDlg);
- break;
- }
- case WM_COMMAND:
- {
- //LOWORD(wParam) == IDC_control
- //HIWORD(wParam) == Message
- //SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- }
- case WM_NOTIFY:
- {
- switch (((LPNMHDR)lParam)->idFrom)
- {
-// case IDC_control:
-// {
-// break;
-// }
- case 0:
- {
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- {
- break;
- } //case PSN_APPLY
- } //switch code
- } //case 0:
- } //switch from
- } //case: WM_NOTIFY
- } // switch msg
- return FALSE;
-}
-*/ \ No newline at end of file
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp
index 06c54d40be..dd456c8940 100644
--- a/plugins/Clist_modern/src/modern_skinbutton.cpp
+++ b/plugins/Clist_modern/src/modern_skinbutton.cpp
@@ -198,7 +198,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
if ( !whdc || !g_CluiData.fLayered)
{
SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
- mod_DeleteDC(hdc);
+ DeleteDC(hdc);
}
// if (sdc)
// ReleaseDC(GetParent(hwnd),sdc);
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index 98abc69630..4d3bea9a3c 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -529,8 +529,8 @@ int SkinEngineUnloadModule()
SelectObject(g_pCachedWindow->hImageDC,g_pCachedWindow->hImageOld);
DeleteObject(g_pCachedWindow->hBackDIB);
DeleteObject(g_pCachedWindow->hImageDIB);
- mod_DeleteDC(g_pCachedWindow->hBackDC);
- mod_DeleteDC(g_pCachedWindow->hImageDC);
+ DeleteDC(g_pCachedWindow->hBackDC);
+ DeleteDC(g_pCachedWindow->hImageDC);
ReleaseDC(NULL,g_pCachedWindow->hScreenDC);
mir_free_and_nil(g_pCachedWindow);
}
@@ -811,7 +811,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
{
SelectObject(mem2dc,oldbmp);
DeleteObject(mem2bmp);
- mod_DeleteDC(mem2dc);
+ DeleteDC(mem2dc);
}
return 1;
}
@@ -912,7 +912,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
}
SelectObject(mem2dc,oldbmp);
DeleteObject(mem2bmp);
- mod_DeleteDC(mem2dc);
+ DeleteDC(mem2dc);
}
else if (mode == FM_TILE_HORZ && (rGlyph->right-rGlyph->left>0) && (rGlyph->bottom-rGlyph->top>0) && (rFill->bottom-rFill->top)>0 && (rFill->right-rFill->left)>0)
{
@@ -1001,7 +1001,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
}
SelectObject(mem2dc,oldbmp);
DeleteObject(mem2bmp);
- mod_DeleteDC(mem2dc);
+ DeleteDC(mem2dc);
}
else if (mode == FM_TILE_BOTH && (rGlyph->right-rGlyph->left>0) && (rGlyph->bottom-rGlyph->top>0))
{
@@ -1102,7 +1102,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
}
SelectObject(mem2dc,oldbmp);
DeleteObject(mem2bmp);
- mod_DeleteDC(mem2dc);
+ DeleteDC(mem2dc);
}
return 1;
@@ -1258,7 +1258,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
if (mode == 2)
{
SelectObject(memdc,oldbmp);
- mod_DeleteDC(memdc);
+ DeleteDC(memdc);
DeleteObject(membmp);
}
return 0;
@@ -1518,12 +1518,12 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
{
if (oldglyph) SelectObject(glyphdc,oldglyph);
- if (glyphdc) mod_DeleteDC(glyphdc);
+ if (glyphdc) DeleteDC(glyphdc);
}
if (mode == 2)
{
SelectObject(memdc,oldbmp);
- mod_DeleteDC(memdc);
+ DeleteDC(memdc);
DeleteObject(membmp);
}
@@ -2067,8 +2067,8 @@ static HBITMAP ske_LoadGlyphImageByDecoders(char * szFileName)
BitBlt(dc32,0,0,bmpInfo.bmWidth,bmpInfo.bmHeight,dc24,0,0,SRCCOPY);
SelectObject(dc24,obmp24);
SelectObject(dc32,obmp32);
- mod_DeleteDC(dc24);
- mod_DeleteDC(dc32);
+ DeleteDC(dc24);
+ DeleteDC(dc32);
DeleteObject(hBitmap);
hBitmap = hBitmap32;
ske_PreMultiplyChanells(hBitmap,0);
@@ -2990,7 +2990,7 @@ static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect
SelectObject(bufDC,bufoldbmp);
DeleteObject(bufbmp);
SelectObject(bufDC, hOldBufFont );
- mod_DeleteDC(bufDC);
+ DeleteDC(bufDC);
}
SelectObject(hOffscreenDC,holdbmp);
DeleteObject(hbmp);
@@ -3232,7 +3232,7 @@ BOOL ske_DrawIconEx(HDC hdcDst,int xLeft,int yTop,HICON hIcon,int cxWidth,int cy
}
SelectObject(tempDC1,otBmp);
- mod_DeleteDC(tempDC1);
+ DeleteDC(tempDC1);
}
/*
if (imbt.bmBitsPixel != 32)
@@ -3354,7 +3354,7 @@ BOOL ske_DrawIconEx(HDC hdcDst,int xLeft,int yTop,HICON hIcon,int cxWidth,int cy
DeleteObject(ici.hbmColor);
DeleteObject(ici.hbmMask);
SelectObject(imDC,GetStockObject(DEFAULT_GUI_FONT));
- mod_DeleteDC(imDC);
+ DeleteDC(imDC);
return 1;// DrawIconExS(hdc,xLeft,yTop,hIcon,cxWidth,cyWidth,istepIfAniCur,hbrFlickerFreeDraw,diFlags);
}
@@ -3682,7 +3682,7 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting)
SelectObject(hdc,o);
DeleteObject(n);
- mod_DeleteDC(hdc);
+ DeleteDC(hdc);
}
return 1;
}
@@ -4242,7 +4242,7 @@ static void ske_AddParseSkinFont(char * szFontID,char * szDefineString,SKINOBJEC
{
HDC hdc = CreateCompatibleDC(NULL);
logfont.lfHeight = (long)-MulDiv(logfont.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
- mod_DeleteDC(hdc);
+ DeleteDC(hdc);
}
logfont.lfHeight = -logfont.lfHeight;
GetParamN(szDefineString,buf,sizeof(buf),2,',',TRUE);
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp
index 7bfea762c1..c4ed9b7707 100644
--- a/plugins/Clist_modern/src/modern_skinopt.cpp
+++ b/plugins/Clist_modern/src/modern_skinopt.cpp
@@ -304,13 +304,13 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
imgOldbmp = ( HBITMAP )SelectObject( imgDC, hPreviewBitmap );
ske_AlphaBlend( memDC, imgPos.x, imgPos.y, dWidth, dHeight, imgDC, 0, 0, bmp.bmWidth, bmp.bmHeight, bf );
SelectObject( imgDC, imgOldbmp );
- mod_DeleteDC( imgDC );
+ DeleteDC( imgDC );
}
}
BitBlt( dis->hDC, dis->rcItem.left, dis->rcItem.top, mWidth, mHeight, memDC, 0, 0, SRCCOPY );
SelectObject( memDC, holdbmp );
DeleteObject( hbmp );
- mod_DeleteDC( memDC );
+ DeleteDC( memDC );
}
break;
@@ -760,7 +760,7 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam)
imgOldbmp = ( HBITMAP )SelectObject( imgDC, hPreviewBitmap );
ske_AlphaBlend( dis->hDC, imgPos.x, imgPos.y, dWidth, dHeight, imgDC, 0, 0, bmp.bmWidth, bmp.bmHeight, bf );
SelectObject( imgDC, imgOldbmp );
- mod_DeleteDC( imgDC );
+ DeleteDC( imgDC );
}
ske_UnloadGlyphImage(hPreviewBitmap);
}
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index c603fc9e76..c344dc31a6 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -690,7 +690,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam
BitBlt(hdc, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, hdc2, rc.left, rc.top, SRCCOPY);
SelectObject(hdc2, hbmpo);
DeleteObject(hbmp);
- mod_DeleteDC(hdc2);
+ DeleteDC(hdc2);
SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
ReleaseDC(hwnd,hdc);
@@ -713,7 +713,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam
hdc2,ps.rcPaint.left,ps.rcPaint.top,SRCCOPY);
SelectObject(hdc2,hbmpo);
DeleteObject(hbmp);
- mod_DeleteDC(hdc2);
+ DeleteDC(hdc2);
ps.fErase = FALSE;
EndPaint(hwnd,&ps);
}
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index b5318994ec..71934984d3 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -202,7 +202,7 @@ static void sttDrawNonLayeredSkinedBar(HWND hwnd, HDC hdc)
BitBlt(hdc, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, hdc2, rc.left, rc.top, SRCCOPY);
SelectObject(hdc2, hbmpo);
DeleteObject(hbmp);
- mod_DeleteDC(hdc2);
+ DeleteDC(hdc2);
SelectObject(hdc, (HFONT)GetStockObject(DEFAULT_GUI_FONT));
ValidateRect(hwnd, NULL);
diff --git a/plugins/Clist_modern/src/modern_utils.cpp b/plugins/Clist_modern/src/modern_utils.cpp
new file mode 100644
index 0000000000..724bdacf28
--- /dev/null
+++ b/plugins/Clist_modern/src/modern_utils.cpp
@@ -0,0 +1,161 @@
+#include "hdr/modern_commonheaders.h"
+
+BYTE gl_TrimText = 1;
+
+char * __cdecl strstri( char *a, const char *b)
+{
+ char * x, *y;
+ if ( !a || !b) return FALSE;
+ x = _strdup(a);
+ y = _strdup(b);
+ x = _strupr(x);
+ y = _strupr(y);
+ char * pos = strstr(x,y);
+ if ( pos )
+ {
+ char * retval = a + ( pos - x );
+ free(x);
+ free(y);
+ return retval;
+ }
+ free(x);
+ free(y);
+ return NULL;
+}
+int __cdecl mir_strcmpi(const char *a, const char *b)
+{
+ if (a == NULL && b == NULL) return 0;
+ if (a == NULL || b == NULL) return _stricmp(a?a:"",b?b:"");
+ return _stricmp(a,b);
+}
+
+int __cdecl mir_tstrcmpi(const TCHAR *a, const TCHAR *b)
+{
+ if (a == NULL && b == NULL) return 0;
+ if (a == NULL || b == NULL) return _tcsicmp(a?a:_T(""),b?b:_T(""));
+ return _tcsicmp(a,b);
+}
+BOOL __cdecl mir_bool_strcmpi(const char *a, const char *b)
+{
+ if (a == NULL && b == NULL) return 1;
+ if (a == NULL || b == NULL) return _stricmp(a?a:"",b?b:"") == 0;
+ return _stricmp(a,b) == 0;
+}
+
+BOOL __cdecl mir_bool_tstrcmpi(const TCHAR *a, const TCHAR *b)
+{
+ if (a == NULL && b == NULL) return 1;
+ if (a == NULL || b == NULL) return _tcsicmp(a?a:_T(""),b?b:_T("")) == 0;
+ return _tcsicmp(a,b) == 0;
+}
+
+#ifdef strlen
+#undef strcmp
+#undef strlen
+#endif
+
+int __cdecl mir_strcmp (const char *a, const char *b)
+{
+ if ( !(a && b)) return a != b;
+ return (strcmp(a,b));
+};
+
+int mir_strlen (const char *a)
+{
+ if (a == NULL) return 0;
+ return (int)(strlen(a));
+};
+
+#define strlen(a) mir_strlen(a)
+#define strcmp(a,b) mir_strcmp(a,b)
+
+//copy len symbols from string - do not check is it null terminated or len is more then actual
+char * strdupn(const char * src, int len)
+{
+ char * p;
+ if (src == NULL) return NULL;
+ p = (char*)malloc(len+1);
+ if ( !p) return 0;
+ memcpy(p,src,len);
+ p[len] = '\0';
+ return p;
+}
+
+DWORD exceptFunction(LPEXCEPTION_POINTERS EP)
+{
+ char buf[4096];
+ mir_snprintf(buf, SIZEOF(buf), "\r\nExceptCode: %x\r\nExceptFlags: %x\r\nExceptAddress: %p\r\n",
+ EP->ExceptionRecord->ExceptionCode,
+ EP->ExceptionRecord->ExceptionFlags,
+ EP->ExceptionRecord->ExceptionAddress);
+
+ TRACE(buf);
+ MessageBoxA(0,buf,"clist_mw Exception",0);
+ return EXCEPTION_EXECUTE_HANDLER;
+}
+
+#ifdef _DEBUG
+#undef DeleteObject
+#endif
+
+void TRACE_ERROR()
+{
+ DWORD t = GetLastError();
+ LPVOID lpMsgBuf;
+ if ( !FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ t,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR) &lpMsgBuf,
+ 0,
+ NULL ))
+ {
+ // Handle the error.
+ return ;
+ }
+#ifdef _DEBUG
+ MessageBox( NULL, (LPCTSTR)lpMsgBuf, _T("Error"), MB_OK | MB_ICONINFORMATION );
+ DebugBreak();
+#endif
+ LocalFree( lpMsgBuf );
+}
+
+BOOL DebugDeleteObject(HGDIOBJ a)
+{
+ BOOL res = DeleteObject(a);
+ if ( !res) TRACE_ERROR();
+ return res;
+}
+
+#ifdef _DEBUG
+#define DeleteObject(a) DebugDeleteObject(a)
+#endif
+
+// load small icon (not shared) it IS NEED to be destroyed
+HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName)
+{
+ HICON hIcon = NULL; // icon handle
+ int index = -(int)lpIconName;
+ TCHAR filename[MAX_PATH] = {0};
+ GetModuleFileName(hInstance,filename,MAX_PATH);
+ ExtractIconEx(filename,index,NULL,&hIcon,1);
+ return hIcon;
+}
+
+BOOL DestroyIcon_protect(HICON icon)
+{
+ if (icon) return DestroyIcon(icon);
+ return FALSE;
+}
+
+void li_ListDestruct(SortedList *pList, ItemDestuctor pItemDestructor)
+{
+ int i=0;
+ if ( !pList) return;
+ for (i=0; i < pList->realCount; i++) pItemDestructor(pList->items[i]);
+ List_Destroy(pList);
+ mir_free(pList);
+}
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index 2bf9ae8666..61b5fc0bcd 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -1161,7 +1161,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
BitBlt(hdc,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,hdc2,rc.left,rc.top,SRCCOPY);
SelectObject(hdc2,hbmpo);
DeleteObject(hbmp);
- mod_DeleteDC(hdc2);
+ DeleteDC(hdc2);
SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
diff --git a/plugins/Clist_modern/src/resource.h b/plugins/Clist_modern/src/resource.h
index da1f1f507e..a7c161cc5b 100644
--- a/plugins/Clist_modern/src/resource.h
+++ b/plugins/Clist_modern/src/resource.h
@@ -22,8 +22,6 @@
#define IDI_SENDEMAIL 193
#define IDR_CLISTMENU 199
#define IDI_BLANK 200
-#define IDI_NOTICK 205
-#define IDI_TICK 206
#define IDD_OPT_ICONS 207
#define IDI_FILE 207
#define IDI_TIMESTAMP 208