diff options
Diffstat (limited to 'plugins/TipperYM')
62 files changed, 17742 insertions, 0 deletions
diff --git a/plugins/TipperYM/DoIt.bat b/plugins/TipperYM/DoIt.bat new file mode 100644 index 0000000000..d0127132d9 --- /dev/null +++ b/plugins/TipperYM/DoIt.bat @@ -0,0 +1,58 @@ +@ECHO off
+CLS
+SET ZIP="D:\Program Files\7-Zip\7z.exe"
+
+CALL "%VS71COMNTOOLS%\vsvars32.bat"
+ECHO.
+ECHO Compilation in progress...
+ECHO.
+devenv.exe /rebuild "Release" tipper_ym.vcproj
+devenv.exe /rebuild "Release (ansi)" tipper_ym.vcproj
+
+CALL "%VS90COMNTOOLS%\vsvars32.bat"
+ECHO.
+ECHO Compilation in progress...
+ECHO.
+devenv.exe tipper_ym_9.vcproj /project "tipper_ym_9.vcproj" /projectconfig "Release|x64" /rebuild
+
+MKDIR ansi
+MKDIR x64
+COPY /Y "Release\tipper.dll" tipper.dll
+COPY /Y "Release64\tipper.dll" "x64\tipper.dll"
+COPY /Y "Release (ansi)\tipper.dll" "ansi\tipper.dll"
+
+MKDIR "skins\Tipper\XPMC"
+MKDIR "skins\Tipper\Tipper classic"
+XCOPY /Y "docs\sample skin" "skins\Tipper\XPMC"
+XCOPY /Y "docs\tipper classic" "skins\Tipper\Tipper classic"
+
+RMDIR /S /Q upload
+MKDIR "upload\updater"
+MKDIR "upload\addons"
+%ZIP% a -mx9 upload\tipper-ym.zip tipper.dll ansi\tipper.dll x64\tipper.dll docs\*.txt docs\*.ini docs\*.h skins
+
+MKDIR plugins
+COPY /Y "Release\tipper.dll" "plugins\tipper.dll"
+%ZIP% a -mx9 upload\updater\tipper-ym.zip plugins\tipper.dll docs\*.txt docs\*.ini docs\*.h
+
+COPY /Y "Release (ansi)\tipper.dll" "plugins\tipper.dll"
+%ZIP% a -mx9 upload\updater\tipper-ym_ansi.zip plugins\tipper.dll docs\*.txt docs\*.ini docs\*.h
+%ZIP% a -mx9 upload\tipper-ym_src.zip *.cpp *.h *.rc *.vcproj *.ds* docs\*.txt docs\*.ini docs\*.h sdk\*.h res\*.ico
+
+COPY /Y "Release\tipper.dll" "tipper.dll"
+%ZIP% a -mx9 upload\addons\tipper-ym.zip tipper.dll docs\*.txt docs\*.ini docs\*.h skins
+COPY /Y "Release (ansi)\tipper.dll" "tipper.dll"
+%ZIP% a -mx9 upload\addons\tipper-ym_ansi.zip tipper.dll docs\*.txt docs\*.ini docs\*.h
+COPY /Y "Release64\tipper.dll" "tipper.dll"
+%ZIP% a -mx9 upload\addons\tipper-ym_x64.zip tipper.dll docs\*.txt docs\*.ini docs\*.h skins
+
+DEL tipper.dll
+RMDIR /S /Q x64
+RMDIR /S /Q ansi
+RMDIR /S /Q plugins
+RMDIR /S /Q skins
+RMDIR /S /Q "Release"
+RMDIR /S /Q "Release64"
+RMDIR /S /Q "Release (ansi)"
+
+TIMEOUT 10
\ No newline at end of file diff --git a/plugins/TipperYM/bitmap_func.cpp b/plugins/TipperYM/bitmap_func.cpp new file mode 100644 index 0000000000..e1d8bdd644 --- /dev/null +++ b/plugins/TipperYM/bitmap_func.cpp @@ -0,0 +1,775 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#include "common.h"
+#include "options.h"
+#include "bitmap_func.h"
+#include "message_pump.h"
+
+TOOLTIPSKIN skin = {0};
+
+HBITMAP CreateBitmapPart(FIBITMAP *fibSrc, int iSrcWidth, int iSrcHeight, int iDesWidth, int iDesHeight, TransformationMode transfMode)
+{
+ FIBITMAP *fibMem = NULL;
+ HBITMAP hbmpDes = NULL;
+
+ if (!fibSrc)
+ return NULL;
+
+ switch (transfMode)
+ {
+ case TM_NONE:
+ case TM_CENTRE:
+ case TM_TILE_ALL:
+ {
+ hbmpDes = fii->FI_CreateHBITMAPFromDIB(fibSrc);
+ break;
+ }
+ case TM_STRECH_ALL:
+ {
+ fibMem = fii->FI_Rescale(fibSrc, iDesWidth, iDesHeight, FILTER_BILINEAR);
+ hbmpDes = fii->FI_CreateHBITMAPFromDIB(fibMem);
+ break;
+ }
+ case TM_STRECH_HORIZONTAL:
+ case TM_TILE_VERTICAL:
+ {
+ fibMem = fii->FI_Rescale(fibSrc, iDesWidth, iSrcHeight, FILTER_BILINEAR);
+ hbmpDes = fii->FI_CreateHBITMAPFromDIB(fibMem);
+ break;
+ }
+ case TM_STRECH_VERTICAL:
+ case TM_TILE_HORIZONTAL:
+ {
+ fibMem = fii->FI_Rescale(fibSrc, iSrcWidth, iSrcHeight, FILTER_BILINEAR);
+ hbmpDes = fii->FI_CreateHBITMAPFromDIB(fibMem);
+ break;
+ }
+ }
+
+ if (fibMem) fii->FI_Unload(fibMem);
+ return hbmpDes;
+}
+
+void DrawBitmapPart(HDC hdcMem, HBITMAP hbmpPart, RECT *rcDes, TransformationMode transfMode)
+{
+ if (!hbmpPart)
+ return;
+
+ BLENDFUNCTION blend;
+ blend.BlendOp = AC_SRC_OVER;
+ blend.BlendFlags = 0;
+ blend.SourceConstantAlpha = 255;
+ blend.AlphaFormat = AC_SRC_ALPHA;
+
+ BITMAP bitmap;
+ GetObject(hbmpPart, sizeof(bitmap), &bitmap);
+ int iBmpWidth = bitmap.bmWidth;
+ int iBmpHeight = bitmap.bmHeight;
+
+ int iDesWidth = rcDes->right - rcDes->left;
+ int iDesHeight = rcDes->bottom - rcDes->top;
+
+ SelectObject(hdcMem, hbmpPart);
+
+ switch (transfMode)
+ {
+ case TM_NONE:
+ case TM_STRECH_ALL:
+ case TM_STRECH_HORIZONTAL:
+ case TM_STRECH_VERTICAL:
+ {
+ AlphaBlend(skin.hdc, rcDes->left, rcDes->top, iBmpWidth, iBmpHeight, hdcMem, 0, 0, iBmpWidth, iBmpHeight, blend);
+ break;
+ }
+ case TM_CENTRE:
+ {
+ int iPosX = rcDes->left + ((iDesWidth - iBmpWidth) / 2);
+ int iPosY = rcDes->top + ((iDesHeight - iBmpHeight) / 2);
+ AlphaBlend(skin.hdc, iPosX, iPosY, iBmpWidth, iBmpHeight, hdcMem, 0, 0, iBmpWidth, iBmpHeight, blend);
+ break;
+ }
+ case TM_TILE_ALL:
+ {
+ int iRepX = iDesWidth / iBmpWidth;
+ int iRepY = iDesHeight / iBmpHeight;
+ int iEndX = iDesWidth % iBmpWidth;
+ int iEndY = iDesHeight % iBmpHeight;
+ int x,y;
+
+ for (y = 0; y < iRepY; y++)
+ {
+ for (x = 0; x < iRepX; x++)
+ {
+ AlphaBlend(skin.hdc, rcDes->left + (x * iBmpWidth), rcDes->top + (y * iBmpHeight), iBmpWidth, iBmpHeight, hdcMem, 0, 0, iBmpWidth, iBmpHeight, blend);
+ }
+
+ AlphaBlend(skin.hdc, rcDes->left + (x * iBmpWidth), rcDes->top + (y * iBmpHeight), iEndX, iBmpHeight, hdcMem, 0, 0, iEndX, iBmpHeight, blend);
+ }
+
+ for (x = 0; x < iRepX; x++)
+ {
+ AlphaBlend(skin.hdc, rcDes->left + (x * iBmpWidth), rcDes->top + (y * iBmpHeight), iBmpWidth, iEndY, hdcMem, 0, 0, iBmpWidth, iEndY, blend);
+ }
+
+ AlphaBlend(skin.hdc, rcDes->left + (x * iBmpWidth), rcDes->top + (y * iBmpHeight), iEndX, iEndY, hdcMem, 0, 0, iEndX, iEndY, blend);
+ break;
+ }
+ case TM_TILE_HORIZONTAL:
+ {
+ int iRepX = iDesWidth / iBmpWidth;
+ int iEndX = iDesWidth % iBmpWidth;
+ int x;
+
+ for (x = 0; x < iRepX; x++)
+ {
+ AlphaBlend(skin.hdc, rcDes->left + (x * iBmpWidth), rcDes->top, iBmpWidth, iDesHeight, hdcMem, 0, 0, iBmpWidth, iDesHeight, blend);
+ }
+
+ AlphaBlend(skin.hdc, rcDes->left + (x * iBmpWidth), rcDes->top, iEndX, iDesHeight, hdcMem, 0, 0, iEndX, iDesHeight, blend);
+ break;
+ }
+ case TM_TILE_VERTICAL:
+ {
+ int iRepY = iDesHeight / iBmpHeight;
+ int iEndY = iDesHeight % iBmpHeight;
+ int y;
+
+ for(y = 0; y < iRepY; y++)
+ {
+ AlphaBlend(skin.hdc, rcDes->left, rcDes->top + (y * iBmpHeight), iDesWidth, iBmpHeight, hdcMem, 0, 0, iDesWidth, iBmpHeight, blend);
+ }
+
+ AlphaBlend(skin.hdc, rcDes->left, rcDes->top + (y * iBmpHeight), iDesWidth, iEndY, hdcMem, 0, 0, iDesWidth, iEndY, blend);
+ break;
+ }
+ }
+}
+
+void CreateFromBitmaps(bool bServiceTip)
+{
+ int rcWidth, rcHeight;
+ int iCentWidth, iCentHeight;
+ int iBmpWidth, iBmpHeight;
+ int top, right, bottom, left;
+
+ BLENDFUNCTION blend;
+ blend.BlendOp = AC_SRC_OVER;
+ blend.BlendFlags = 0;
+ blend.SourceConstantAlpha = 255;
+ blend.AlphaFormat = AC_SRC_ALPHA;
+
+ for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
+ {
+ if (i == SKIN_ITEM_SIDEBAR && (!opt.iSidebarWidth || bServiceTip))
+ continue;
+
+ if (opt.szImgFile[i] && strlen(opt.szImgFile[i]) != 0)
+ {
+ FIBITMAP *fib = NULL;
+ if (!skin.bCached)
+ {
+ FIBITMAP *fibLoad = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)opt.szImgFile[i], (LPARAM)IMGL_RETURNDIB);
+ if (!fibLoad) continue;
+
+ if (fii->FI_GetBPP(fibLoad) != 32)
+ fib = fii->FI_ConvertTo32Bits(fibLoad);
+ else
+ fib = fibLoad;
+
+ if (fib != fibLoad)
+ fii->FI_Unload(fibLoad);
+
+ skin.fib[i] = fib;
+ }
+ else
+ {
+ fib = skin.fib[i];
+ }
+
+ // destination rectangle size
+ if (i == SKIN_ITEM_BG)
+ {
+ rcWidth = skin.iWidth;
+ rcHeight = skin.iHeight;
+ }
+ else if (i == SKIN_ITEM_SIDEBAR)
+ {
+ rcWidth = opt.iSidebarWidth;
+ rcHeight = skin.iHeight;
+ }
+
+ // bitmap size
+ iBmpWidth = fii->FI_GetWidth(fib);
+ iBmpHeight = fii->FI_GetHeight(fib);
+
+ // margins
+ top = opt.margins[i].top < iBmpHeight ? opt.margins[i].top : 0;
+ right = opt.margins[i].right < iBmpWidth ? opt.margins[i].right : 0;
+ bottom = opt.margins[i].bottom < iBmpHeight ? opt.margins[i].bottom : 0;
+ left = opt.margins[i].left < iBmpWidth ? opt.margins[i].left : 0;
+
+ // centre area size
+ iCentWidth = max(rcWidth - left - right, 0);
+ iCentHeight = max(rcHeight - top - bottom, 0);
+
+ FIBITMAP *fibCentre = NULL, *fibMem = NULL;
+ if (opt.margins[i].left || opt.margins[i].top || opt.margins[i].right || opt.margins[i].bottom)
+ {
+ // create corners bitmaps
+ if (!skin.bCached)
+ {
+ if (top > 0 && left > 0) // TL
+ {
+ fibMem = fii->FI_Copy(fib, 0, 0, left, top);
+ skin.hbmpSkinParts[i][SP_CORNER_TL] = fii->FI_CreateHBITMAPFromDIB(fibMem);
+ if (fibMem) fii->FI_Unload(fibMem);
+ }
+ if (top > 0 && right > 0) // TR
+ {
+ fibMem = fii->FI_Copy(fib, iBmpWidth - right, 0, iBmpWidth, top);
+ skin.hbmpSkinParts[i][SP_CORNER_TR] = fii->FI_CreateHBITMAPFromDIB(fibMem);
+ if (fibMem) fii->FI_Unload(fibMem);
+ }
+ if (bottom > 0 && right > 0) // BR
+ {
+ fibMem = fii->FI_Copy(fib, iBmpWidth - right, iBmpHeight - bottom, iBmpWidth, iBmpHeight);
+ skin.hbmpSkinParts[i][SP_CORNER_BR] = fii->FI_CreateHBITMAPFromDIB(fibMem);
+ if (fibMem) fii->FI_Unload(fibMem);
+ }
+ if (bottom > 0 && left > 0) // BL
+ {
+ fibMem = fii->FI_Copy(fib, 0, iBmpHeight - bottom, left, iBmpHeight);
+ skin.hbmpSkinParts[i][SP_CORNER_BL] = fii->FI_CreateHBITMAPFromDIB(fibMem);
+ if (fibMem) fii->FI_Unload(fibMem);
+ }
+ }
+
+ // create edge parts bitmaps
+ if (top > 0 && iCentWidth > 0) // top
+ {
+ fibMem = fii->FI_Copy(fib, left, 0, iBmpWidth - right, top);
+ skin.hbmpSkinParts[i][SP_EDGE_TOP] = CreateBitmapPart(fibMem, iBmpWidth - left - right, top, iCentWidth, top, opt.transfMode[i]);
+ if (fibMem) fii->FI_Unload(fibMem);
+ }
+ if (right > 0 && iCentHeight > 0) // right
+ {
+ fibMem = fii->FI_Copy(fib, iBmpWidth - right, top, iBmpWidth, iBmpHeight - bottom);
+ skin.hbmpSkinParts[i][SP_EDGE_RIGHT] = CreateBitmapPart(fibMem, right, iBmpHeight - top - bottom, right, iCentHeight, opt.transfMode[i]);
+ if (fibMem) fii->FI_Unload(fibMem);
+ }
+ if (bottom > 0 && iCentWidth > 0) // bottom
+ {
+ fibMem = fii->FI_Copy(fib, left, iBmpHeight - bottom, iBmpWidth - right, iBmpHeight);
+ skin.hbmpSkinParts[i][SP_EDGE_BOTTOM] = CreateBitmapPart(fibMem, iBmpWidth - left - right, bottom, iCentWidth, bottom, opt.transfMode[i]);
+ if (fibMem) fii->FI_Unload(fibMem);
+ }
+ if (left > 0 && iCentHeight > 0) // left
+ {
+ fibMem = fii->FI_Copy(fib, 0, top, left, iBmpHeight - bottom);
+ skin.hbmpSkinParts[i][SP_EDGE_LEFT] = CreateBitmapPart(fibMem, left, iBmpHeight - top - bottom, left, iCentHeight, opt.transfMode[i]);
+ if (fibMem) fii->FI_Unload(fibMem);
+ }
+
+ fibCentre = fii->FI_Copy(fib, left, top, iBmpWidth - right, iBmpHeight - bottom);
+ if (fibCentre)
+ {
+ fib = fibCentre;
+ iBmpWidth = fii->FI_GetWidth(fib);
+ iBmpHeight = fii->FI_GetHeight(fib);
+ }
+ }
+
+ // create centre area bitmap
+ skin.hbmpSkinParts[i][SP_CENTRE_AREA] = CreateBitmapPart(fib, iBmpWidth, iBmpHeight, iCentWidth, iCentHeight, opt.transfMode[i]);
+ if (fibCentre)
+ fii->FI_Unload(fibCentre);
+
+ if (i == SKIN_ITEM_SIDEBAR)
+ {
+ int limit = skin.bCached ? SP_CORNER_TL : SKIN_PARTS_COUNT; // don't premultiply corner bitmaps multiple times
+ for (int j = 0; j < limit; j++)
+ {
+ if (skin.hbmpSkinParts[i][j])
+ fii->FI_Premultiply(skin.hbmpSkinParts[i][j]);
+ }
+ }
+
+ HDC hdcMem = CreateCompatibleDC(0);
+ RECT rc = {0};
+
+ if (skin.hbmpSkinParts[i][SP_CENTRE_AREA])
+ {
+ SetRect(&rc, left, top, rcWidth - right, rcHeight - bottom);
+ DrawBitmapPart(hdcMem, skin.hbmpSkinParts[i][SP_CENTRE_AREA], &rc, opt.transfMode[i]);
+ }
+
+ if (opt.margins[i].left || opt.margins[i].top || opt.margins[i].right || opt.margins[i].bottom)
+ {
+ // draw edge parts
+ if (skin.hbmpSkinParts[i][SP_EDGE_TOP]) // top
+ {
+ SetRect(&rc, left, 0, rcWidth - right, top);
+ DrawBitmapPart(hdcMem, skin.hbmpSkinParts[i][SP_EDGE_TOP], &rc, opt.transfMode[i]);
+ }
+ if (skin.hbmpSkinParts[i][SP_EDGE_RIGHT]) // right
+ {
+ SetRect(&rc, rcWidth - right, top, rcWidth, rcHeight - bottom);
+ DrawBitmapPart(hdcMem, skin.hbmpSkinParts[i][SP_EDGE_RIGHT], &rc, opt.transfMode[i]);
+ }
+ if (skin.hbmpSkinParts[i][SP_EDGE_BOTTOM]) // bottom
+ {
+ SetRect(&rc, left, rcHeight - bottom, rcWidth - right, rcHeight);
+ DrawBitmapPart(hdcMem, skin.hbmpSkinParts[i][SP_EDGE_BOTTOM], &rc, opt.transfMode[i]);
+ }
+ if (skin.hbmpSkinParts[i][SP_EDGE_LEFT]) // left
+ {
+ SetRect(&rc, 0, top, left, rcHeight - bottom);
+ DrawBitmapPart(hdcMem, skin.hbmpSkinParts[i][SP_EDGE_LEFT], &rc, opt.transfMode[i]);
+ }
+
+ // draw corners
+ if (skin.hbmpSkinParts[i][SP_CORNER_TL]) // TL
+ {
+ SelectObject(hdcMem, skin.hbmpSkinParts[i][SP_CORNER_TL]);
+ AlphaBlend(skin.hdc, 0, 0, left, top, hdcMem, 0, 0, left, top, blend);
+ }
+ if (skin.hbmpSkinParts[i][SP_CORNER_TR]) // TR
+ {
+ SelectObject(hdcMem, skin.hbmpSkinParts[i][SP_CORNER_TR]);
+ AlphaBlend(skin.hdc, rcWidth - right, 0, right, top, hdcMem, 0, 0, right, top, blend);
+ }
+ if (skin.hbmpSkinParts[i][SP_CORNER_BR]) // BR
+ {
+ SelectObject(hdcMem, skin.hbmpSkinParts[i][SP_CORNER_BR]);
+ AlphaBlend(skin.hdc, rcWidth - right, rcHeight - bottom, right, bottom, hdcMem, 0, 0, right, bottom, blend);
+ }
+ if (skin.hbmpSkinParts[i][SP_CORNER_BL]) // BL
+ {
+ SelectObject(hdcMem, skin.hbmpSkinParts[i][SP_CORNER_BL]);
+ AlphaBlend(skin.hdc, 0, rcHeight - bottom, left, bottom, hdcMem, 0, 0, left, bottom, blend);
+ }
+ }
+
+ for (int j = 0; j < SP_CORNER_TL; j++)
+ {
+ if (skin.hbmpSkinParts[i][j])
+ {
+ DeleteObject(skin.hbmpSkinParts[i][j]);
+ skin.hbmpSkinParts[i][j] = NULL;
+ }
+ }
+
+ if (MyUpdateLayeredWindow)
+ skin.bNeedLayerUpdate = true;
+
+ DeleteDC(hdcMem);
+ }
+ }
+
+ skin.bCached = true;
+}
+
+void SolidColorFill(bool bServiceTip)
+{
+ RECT rc = {0};
+ rc.right = skin.iWidth;
+ rc.bottom = skin.iHeight;
+ HBRUSH hBrush = CreateSolidBrush(opt.colBg);
+ FillRect(skin.hdc, &rc, hBrush);
+ DeleteObject(hBrush);
+
+ if (opt.iSidebarWidth > 0 && !bServiceTip)
+ {
+ rc.right = opt.iSidebarWidth;
+ hBrush = CreateSolidBrush(opt.colSidebar);
+ FillRect(skin.hdc, &rc, hBrush);
+ DeleteObject(hBrush);
+ }
+}
+
+void CreateSkinBitmap(int iWidth, int iHeight, bool bServiceTip)
+{
+ if (skin.hBitmap) DeleteObject(skin.hBitmap);
+ if (skin.hdc) DeleteDC(skin.hdc);
+ skin.hBitmap = NULL;
+ skin.hdc = NULL;
+
+ skin.iWidth = iWidth;
+ skin.iHeight = iHeight;
+ skin.bNeedLayerUpdate = false;
+
+ BITMAPINFO bi;
+ bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
+ bi.bmiHeader.biWidth = skin.iWidth;
+ bi.bmiHeader.biHeight = -skin.iHeight;
+ bi.bmiHeader.biPlanes = 1;
+ bi.bmiHeader.biBitCount = 32;
+ bi.bmiHeader.biCompression = BI_RGB;
+ skin.hBitmap = (HBITMAP)CreateDIBSection(0, &bi, DIB_RGB_COLORS, (void **)&skin.colBits, 0, 0);
+
+ if (!skin.hBitmap)
+ return;
+
+ skin.hdc = CreateCompatibleDC(0);
+ DeleteObject(SelectObject(skin.hdc, skin.hBitmap));
+
+ if (opt.skinMode == SM_COLORFILL)
+ {
+ SolidColorFill(bServiceTip);
+ }
+ else
+ {
+ CreateFromBitmaps(bServiceTip);
+ if (opt.iEnableColoring == 1)
+ ColorizeBitmap();
+ }
+}
+
+void DestroySkinBitmap()
+{
+ for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
+ {
+ if (skin.fib[i])
+ {
+ fii->FI_Unload(skin.fib[i]);
+ skin.fib[i] = NULL;
+ }
+
+ for (int j = SP_CORNER_TL; j < SKIN_PARTS_COUNT; j++)
+ {
+ if (skin.hbmpSkinParts[i][j])
+ {
+ DeleteObject(skin.hbmpSkinParts[i][j]);
+ skin.hbmpSkinParts[i][j] = NULL;
+ }
+ }
+ }
+
+ skin.bCached = false;
+}
+
+void SaveAlpha(LPRECT lpRect)
+{
+ if (skin.colSavedBits)
+ {
+ mir_free(skin.colSavedBits);
+ skin.colSavedBits = 0;
+ }
+ GdiFlush();
+
+ if (lpRect->left < 0) lpRect->left = 0;
+ if (lpRect->top < 0) lpRect->top = 0;
+ if (lpRect->right > skin.iWidth) lpRect->right = skin.iWidth;
+ if (lpRect->bottom > skin.iHeight) lpRect->bottom = skin.iHeight;
+
+ int x = lpRect->left;
+ int y = lpRect->top;
+ int w = lpRect->right - lpRect->left;
+ int h = lpRect->bottom - lpRect->top;
+
+ skin.colSavedBits = (COLOR32 *)mir_alloc(sizeof(COLOR32) * w * h);
+ COLOR32 *p1 = skin.colSavedBits;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= skin.iHeight) break;
+ COLOR32 *p2 = skin.colBits + (y+i)*skin.iWidth + x;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= skin.iWidth) break;
+ *p1++ = *p2++;
+ }
+ }
+}
+
+void RestoreAlpha(LPRECT lpRect, BYTE alpha)
+{
+ if (!skin.colSavedBits)
+ return;
+
+ GdiFlush();
+
+ if (lpRect->left < 0) lpRect->left = 0;
+ if (lpRect->top < 0) lpRect->top = 0;
+ if (lpRect->right > skin.iWidth) lpRect->right = skin.iWidth;
+ if (lpRect->bottom > skin.iHeight) lpRect->bottom = skin.iHeight;
+
+ int x = lpRect->left;
+ int y = lpRect->top;
+ int w = lpRect->right - lpRect->left;
+ int h = lpRect->bottom - lpRect->top;
+
+ COLOR32 *p1 = skin.colSavedBits;
+
+ for (int i = 0; i < h; i++)
+ {
+ if (i+y < 0) continue;
+ if (i+y >= skin.iHeight) break;
+ COLOR32 *p2 = skin.colBits + (y+i)*skin.iWidth + x;
+ for (int j = 0; j < w; j++)
+ {
+ if (j+x < 0) continue;
+ if (j+x >= skin.iWidth) break;
+ if ((*p1&0x00ffffff) != (*p2&0x00ffffff))
+ {
+ *p2 |= (alpha << 24);
+ }
+ else
+ {
+ *p2 = (*p2&0x00ffffff) | (*p1&0xff000000);
+ }
+ ++p1;
+ ++p2;
+ }
+ }
+
+ mir_free(skin.colSavedBits);
+ skin.colSavedBits = 0;
+}
+
+BOOL IsAlphaTransparent(HBITMAP hBitmap)
+{
+ BITMAP bmp;
+ DWORD dwLen;
+ BYTE *p;
+
+ GetObject(hBitmap, sizeof(bmp), &bmp);
+
+ if (bmp.bmBitsPixel != 32)
+ return FALSE;
+
+ dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
+ p = (BYTE *)mir_alloc(dwLen);
+ if (p == NULL) return FALSE;
+ memset(p, 0, dwLen);
+
+ GetBitmapBits(hBitmap, dwLen, p);
+
+ for (int y = 0; y < bmp.bmHeight; y++)
+ {
+ BYTE *px = p + bmp.bmWidth * 4 * y;
+ for (int x = 0; x < bmp.bmWidth; x++)
+ {
+ if (px[3] != 0)
+ {
+ mir_free(p);
+ return TRUE;
+ }
+
+ px += 4;
+ }
+ }
+
+ mir_free(p);
+ return FALSE;
+}
+
+void DrawIconExAlpha(HDC hdc, int xLeft, int yTop, HICON hIcon, int cxWidth, int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags, bool bIsSmiley)
+{
+ bool restore = false;
+
+ if (skin.bNeedLayerUpdate && !bIsSmiley)
+ {
+ ICONINFO icon;
+ if (GetIconInfo(hIcon, &icon))
+ {
+ if (!IsAlphaTransparent(icon.hbmColor))
+ {
+ RECT rc;
+ SetRect(&rc, xLeft, yTop, xLeft + cxWidth, yTop + cyWidth);
+ SaveAlpha(&rc);
+ restore = true;
+ }
+
+ DeleteObject(icon.hbmColor);
+ DeleteObject(icon.hbmMask);
+ }
+ }
+
+ DrawIconEx(hdc, xLeft, yTop, hIcon, cxWidth, cyWidth, istepIfAniCur, hbrFlickerFreeDraw, diFlags);
+
+ if (skin.bNeedLayerUpdate && restore)
+ {
+ RECT rc;
+ SetRect(&rc, xLeft, yTop, xLeft + cxWidth, yTop + cyWidth);
+ RestoreAlpha(&rc);
+ }
+}
+
+int DrawTextAlpha(HDC hdc, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat)
+{
+ RECT rc;
+ SetRect(&rc, lpRect->left - 1, lpRect->top - 1, lpRect->right + 1, lpRect->bottom + 1);
+
+ if (skin.bNeedLayerUpdate) SaveAlpha(&rc);
+ int result = DrawText(hdc, lpString, nCount, lpRect, uFormat);
+ if (skin.bNeedLayerUpdate) RestoreAlpha(&rc);
+
+ return result;
+}
+
+static __forceinline COLOR32 rgba(COLOR32 r, COLOR32 g, COLOR32 b, COLOR32 a)
+{
+ return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff);
+}
+
+static __forceinline COLOR32 getr(COLOR32 c)
+{
+ return (c >> 16) & 0xff;
+}
+
+static __forceinline COLOR32 getg(COLOR32 c)
+{
+ return (c >> 8) & 0xff;
+}
+
+static __forceinline COLOR32 getb(COLOR32 c)
+{
+ return c & 0xff;
+}
+
+static __forceinline COLOR32 geta(COLOR32 c)
+{
+ return (c >> 24) & 0xff;
+}
+
+void PremultipleChannels()
+{
+ for (int i = 0; i < skin.iWidth * skin.iHeight; i++)
+ skin.colBits[i] = rgba( getr(skin.colBits[i])*geta(skin.colBits[i])/255,
+ getg(skin.colBits[i])*geta(skin.colBits[i])/255,
+ getb(skin.colBits[i])*geta(skin.colBits[i])/255,
+ geta(skin.colBits[i]));
+}
+
+#define PU_DIV255(x) ((x)/255)
+
+void ColorizeBitmap()
+{
+ if (!skin.colBits)
+ return;
+
+ GdiFlush();
+
+ int w = skin.iWidth;
+ int h = skin.iHeight;
+
+ // we should swap B and R channels when working with win32 COLORREF
+ float koef1r = (255 - getb(opt.colBg)) / 128.0;
+ float koef1g = (255 - getg(opt.colBg)) / 128.0;
+ float koef1b = (255 - getr(opt.colBg)) / 128.0;
+
+ int br = - 255 + 2 * getb(opt.colBg);
+ int bg = - 255 + 2 * getg(opt.colBg);
+ int bb = - 255 + 2 * getr(opt.colBg);
+
+ float koef2r = (getb(opt.colBg)) / 128.0;
+ float koef2g = (getg(opt.colBg)) / 128.0;
+ float koef2b = (getr(opt.colBg)) / 128.0;
+
+ for (int i = 0; i < w * h; i++)
+ {
+ long alpha = geta(skin.colBits[i]);
+ COLOR32 cl = alpha ? getr(skin.colBits[i])*255/alpha : 0;
+
+ skin.colBits[i] = (cl > 128) ?
+ rgba(
+ PU_DIV255((koef1r * cl + br)*alpha),
+ PU_DIV255((koef1g * cl + bg)*alpha),
+ PU_DIV255((koef1b * cl + bb)*alpha),
+ alpha):
+ rgba(
+ PU_DIV255(koef2r * cl * alpha),
+ PU_DIV255(koef2g * cl * alpha),
+ PU_DIV255(koef2b * cl * alpha),
+ alpha);
+ }
+}
+
+// code from Clist Modern by FYR
+HRGN CreateOpaqueRgn(BYTE level, bool bOpaque)
+{
+ if (!skin.colBits)
+ return NULL;
+
+ GdiFlush();
+
+ RGBQUAD *buff = (RGBQUAD *)skin.colBits;
+
+ int x,y;
+ unsigned int cRect = 64;
+ PRGNDATA pRgnData = (PRGNDATA)malloc(sizeof(RGNDATAHEADER) + (cRect)*sizeof(RECT));
+ memset(pRgnData, 0, sizeof(RGNDATAHEADER));
+ pRgnData->rdh.dwSize = sizeof(RGNDATAHEADER);
+ pRgnData->rdh.iType = RDH_RECTANGLES;
+
+ for (y = 0; y < skin.iHeight; ++y)
+ {
+ bool inside = false;
+ bool lastin = false;
+ unsigned int entry = 0;
+
+ for (x = 0; x < skin.iWidth; ++x)
+ {
+ inside = bOpaque ? (buff->rgbReserved > level) : (buff->rgbReserved < level);
+ ++buff;
+
+ if (inside != lastin)
+ {
+ if (inside)
+ {
+ lastin = true;
+ entry = x;
+ }
+ else
+ {
+ if (pRgnData->rdh.nCount == cRect)
+ {
+ cRect = cRect + 64;
+ pRgnData = (PRGNDATA)realloc(pRgnData, sizeof(RGNDATAHEADER) + (cRect)*sizeof(RECT));
+ }
+
+ SetRect(((LPRECT)pRgnData->Buffer) + pRgnData->rdh.nCount, entry, skin.iHeight - y, x, skin.iHeight - y + 1);
+ pRgnData->rdh.nCount++;
+ lastin = false;
+ }
+ }
+ }
+
+ if (lastin)
+ {
+ if (pRgnData->rdh.nCount == cRect)
+ {
+ cRect = cRect + 64;
+ pRgnData = (PRGNDATA)realloc(pRgnData, sizeof(RGNDATAHEADER) + (cRect)*sizeof(RECT));
+ }
+
+ SetRect(((LPRECT)pRgnData->Buffer) + pRgnData->rdh.nCount, entry, skin.iHeight - y, x, skin.iHeight - y + 1);
+ pRgnData->rdh.nCount++;
+ }
+ }
+
+ HRGN hRgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount*sizeof(RECT), (LPRGNDATA)pRgnData);
+ free(pRgnData);
+ return hRgn;
+}
\ No newline at end of file diff --git a/plugins/TipperYM/bitmap_func.h b/plugins/TipperYM/bitmap_func.h new file mode 100644 index 0000000000..e6ffbc4880 --- /dev/null +++ b/plugins/TipperYM/bitmap_func.h @@ -0,0 +1,71 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _BITMAP_FUNC_INC
+#define _BITMAP_FUNC_INC
+
+// tooltip skin
+#define SKIN_ITEMS_COUNT 2
+#define SKIN_PARTS_COUNT 9
+#define SKIN_ITEM_BG 0
+#define SKIN_ITEM_SIDEBAR 1
+
+// skin parts
+#define SP_CENTRE_AREA 0
+#define SP_EDGE_TOP 1
+#define SP_EDGE_RIGHT 2
+#define SP_EDGE_BOTTOM 3
+#define SP_EDGE_LEFT 4
+#define SP_CORNER_TL 5
+#define SP_CORNER_TR 6
+#define SP_CORNER_BR 7
+#define SP_CORNER_BL 8
+
+// image paint options
+typedef enum {
+ TM_NONE = 0, TM_CENTRE = 1, TM_STRECH_ALL = 2, TM_STRECH_HORIZONTAL = 3, TM_STRECH_VERTICAL = 4,
+ TM_TILE_ALL = 5, TM_TILE_HORIZONTAL = 6, TM_TILE_VERTICAL = 7
+} TransformationMode;
+
+typedef unsigned long COLOR32;
+typedef struct {
+ HDC hdc;
+ HBITMAP hBitmap;
+ HBITMAP hbmpSkinParts[SKIN_ITEMS_COUNT][SKIN_PARTS_COUNT];
+ FIBITMAP *fib[SKIN_ITEMS_COUNT];
+ COLOR32 *colBits;
+ COLOR32 *colSavedBits;
+ int iWidth;
+ int iHeight;
+ bool bNeedLayerUpdate;
+ bool bCached;
+} TOOLTIPSKIN;
+
+void CreateSkinBitmap(int iWidth, int iHeight, bool bServiceTip);
+void DestroySkinBitmap();
+int DrawTextAlpha(HDC hdc, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat);
+void DrawIconExAlpha(HDC hdc, int xLeft, int yTop, HICON hIcon, int cxWidth, int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags, bool bIsSmiley);
+void SaveAlpha(LPRECT lpRect);
+void RestoreAlpha(LPRECT lpRect, BYTE alpha = 0xff);
+void PremultipleChannels();
+void ColorizeBitmap();
+HRGN CreateOpaqueRgn(BYTE level, bool bOpaque);
+
+#endif
diff --git a/plugins/TipperYM/common.h b/plugins/TipperYM/common.h new file mode 100644 index 0000000000..7c0b07bc33 --- /dev/null +++ b/plugins/TipperYM/common.h @@ -0,0 +1,115 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#pragma once
+
+// Modify the following defines if you have to target a platform prior to the ones specified below.
+// Refer to MSDN for the latest info on corresponding values for different platforms.
+#ifndef WINVER // Allow use of features specific to Windows XP or later.
+#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
+#endif
+
+#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
+#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
+#endif
+
+#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
+#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
+#endif
+
+#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
+#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
+#endif
+
+#define MIRANDA_VER 0x0800
+
+#include <m_stdhdr.h>
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+#include <commctrl.h>
+#include <stddef.h>
+#include <time.h>
+#include <windowsx.h>
+
+#include <win2k.h>
+#include <newpluginapi.h>
+#include <statusmodes.h>
+#include <m_avatars.h>
+#include <m_awaymsg.h>
+#include <m_clc.h>
+#include <m_clist.h>
+#include <m_clui.h>
+#include <m_cluiframes.h>
+#include <m_contacts.h>
+#include <m_database.h>
+#include <m_fontservice.h>
+#include <m_icolib.h>
+#include <m_idle.h>
+#include <m_imgsrvc.h>
+#include <m_langpack.h>
+#include <m_options.h>
+#include <m_protocols.h>
+#include <m_protomod.h>
+#include <m_protosvc.h>
+#include <m_skin.h>
+#include <m_system.h>
+#include <m_timezones.h>
+#include <m_utils.h>
+#include <m_icq.h>
+
+#include "resource.h"
+#include "docs\m_tipper.h"
+#include "sdk\m_fingerprint.h"
+#include "sdk\m_flags.h"
+#include "sdk\m_folders.h"
+#include "sdk\m_metacontacts.h"
+#include "sdk\m_variables.h"
+#include "sdk\m_updater.h"
+#include "sdk\m_smileyadd.h"
+
+#if defined _WIN64
+// {605103E8-27A1-4d41-B385-BE652047A833}
+#define MIID_TIPPER { 0x605103e8, 0x27a1, 0x4d41, { 0xb3, 0x85, 0xbe, 0x65, 0x20, 0x47, 0xa8, 0x33 } }
+#elif defined _UNICODE
+// {8392DF1D-9090-4f8e-9DF6-2FE058EDD800}
+#define MIID_TIPPER { 0x8392df1d, 0x9090, 0x4f8e, { 0x9d, 0xf6, 0x2f, 0xe0, 0x58, 0xed, 0xd8, 0x00 } }
+#else
+// {63FD0B98-43AD-4c13-BD6E-2B550B9B20EF}
+#define MIID_TIPPER { 0x63fd0b98, 0x43ad, 0x4c13, { 0xbd, 0x6e, 0x2b, 0x55, 0xb0, 0x9b, 0x20, 0xef } }
+#endif
+
+#define MODULE "Tipper"
+#define MODULE_ITEMS "Tipper_Items"
+#define DEFAULT_SKIN_FOLDER "skins\\Tipper"
+
+extern HMODULE hInst;
+extern PLUGINLINK *pluginLink;
+
+extern HFONT hFontTitle, hFontLabels, hFontValues, hFontTrayTitle;
+extern COLORREF colTitle, colLabels, colBg, colValues;
+
+extern int iCodePage;
+extern char szMetaModuleName[256];
+
+extern MM_INTERFACE mmi;
+extern LIST_INTERFACE li;
+extern FI_INTERFACE *fii;
\ No newline at end of file diff --git a/plugins/TipperYM/docs/autoexec_tipper_items_cz.ini b/plugins/TipperYM/docs/autoexec_tipper_items_cz.ini new file mode 100644 index 0000000000..7cbd7c9ffc --- /dev/null +++ b/plugins/TipperYM/docs/autoexec_tipper_items_cz.ini @@ -0,0 +1,384 @@ +SETTINGS:
+
+[Tipper_Items]
+Trans_WORD to status description=d1
+NextFuncId=d22
+Trans_DWORD timestamp to time=d2
+Trans_DWORD timestamp to time difference=d3
+Trans_BYTE to Yes/No=d4
+Trans_BYTE to Male/Female (ICQ)=d5
+Trans_WORD to country name=d6
+Trans_DWORD to ip address=d7
+Trans_<prefix>Day|Month|Year to date=d8
+Trans_<prefix>Day|Month|Year to age=d9
+Trans_<prefix>Hours|Minutes|Seconds to time=d10
+Trans_<prefix>Day|Month|Year|Hours|Minutes|Seconds to time difference=d11
+Trans_<prefix>Day|Month to days to next birthday=d12
+Trans_DWORD timestamp to time (no seconds)=d13
+Trans_<prefix>Hours|Minutes to time=d14
+Trans_DWORD timestamp to date (short)=d15
+Trans_DWORD timestamp to date (long)=d16
+Trans_xStatus: empty xStatus name to default name=d17
+Trans_DWORD seconds to time difference=d18
+Trans_BYTE timezone to time=d19
+Trans_Any to Idle/Not Idle/Unknown=d20
+Trans_Any to /Idle or empty=d21
+DSNumValues=w20
+Name0=ubirthday_age
+Type0=b1
+Module0=sUserInfo
+Setting0=sBirth
+TransFuncId0=d9
+Name1=ubirthday_date
+Type1=b1
+Module1=sUserInfo
+Setting1=sBirth
+TransFuncId1=d8
+Name2=ubirthday_next
+Type2=b1
+Module2=s
+Setting2=sBirth
+TransFuncId2=d12
+Name3=ucreate_date
+Type3=b1
+Module3=s
+Setting3=sMemberTS
+TransFuncId3=d15
+Name4=ucreate_time
+Type4=b1
+Module4=s
+Setting4=sMemberTS
+TransFuncId4=d2
+Name5=ugender
+Type5=b1
+Module5=s
+Setting5=sGender
+TransFuncId5=d5
+Name6=uidle
+Type6=b1
+Module6=s
+Setting6=sIdleTS
+TransFuncId6=d2
+Name7=uidle_diff
+Type7=b1
+Module7=s
+Setting7=sIdleTS
+TransFuncId7=d3
+Name8=uip
+Type8=b1
+Module8=s
+Setting8=sIP
+TransFuncId8=d7
+Name9=uip_internal
+Type9=b1
+Module9=s
+Setting9=sRealIP
+TransFuncId9=d7
+Name10=ulastseen_ago
+Type10=b0
+Module10=sSeenModule
+Setting10=s
+TransFuncId10=d11
+Name11=ulastseen_date
+Type11=b0
+Module11=sSeenModule
+Setting11=s
+TransFuncId11=d8
+Name12=ulastseen_status
+Type12=b0
+Module12=sSeenModule
+Setting12=sOldStatus
+TransFuncId12=d1
+Name13=ulastseen_time
+Type13=b0
+Module13=sSeenModule
+Setting13=s
+TransFuncId13=d10
+Name14=ulogon_ago
+Type14=b1
+Module14=s
+Setting14=sLogonTS
+TransFuncId14=d3
+Name15=ulogon_date
+Type15=b1
+Module15=s
+Setting15=sLogonTS
+TransFuncId15=d14
+Name16=ulogon_time
+Type16=b1
+Module16=s
+Setting16=sLogonTS
+TransFuncId16=d2
+Name17=uStatus
+Type17=b1
+Module17=sr4
+Setting17=sStatus
+TransFuncId17=d1
+Name18=ustatus_msg
+Type18=b0
+Module18=sCList
+Setting18=sStatusMsg
+TransFuncId18=d0
+Name19=uxstatus_title
+Type19=b1
+Module19=s
+Setting19=sXStatusName
+TransFuncId19=d17
+DINumValues=w51
+DILabel0=uStatus:
+DILineAbove0=b0
+DIValNewline0=b0
+DIVisible0=b1
+DILabel1=u%sys:uidname|UID%:
+DIValue1=u%sys:uid^!tv%
+DILineAbove1=b0
+DIValNewline1=b0
+DIVisible1=b1
+DILabel2=uÚÄet založen:
+DIValue2=u%create_date% @ %create_time%
+DILineAbove2=b0
+DIValNewline2=b0
+DIVisible2=b1
+DILabel3=uÄŒas měřenÃ:
+DIValue3=u%raw:Current/Update^weather%
+DILineAbove3=b0
+DIValNewline3=b0
+DIVisible3=b1
+DILabel4=uZdroj informacÃ:
+DIValue4=u%raw:/MirVer^weather%
+DILineAbove4=b0
+DIValNewline4=b0
+DIVisible4=b1
+DILabel5=uAktuálnà program:
+DIValue5=u%sys:status_msg^tv%
+DILineAbove5=b0
+DIValNewline5=b1
+DIVisible5=b1
+DILabel6=u*
+DIValue6=u%raw:/Next1^tv%
+DILineAbove6=b1
+DIValNewline6=b0
+DIVisible6=b1
+DILabel7=u*
+DIValue7=u%raw:/Next2^tv%
+DILineAbove7=b0
+DIValNewline7=b0
+DIVisible7=b1
+DILabel8=u*
+DIValue8=u%raw:/Next3^tv%
+DILineAbove8=b0
+DIValNewline8=b0
+DIVisible8=b1
+DILabel9=uPrávě hraje:
+DIValue9=u?if(?and(?stricmp(?dbsetting(%subject%,Protocol,p),mradio),?stricmp(?cinfo(%subject%,status),online)),%radio_title%,)
+DILineAbove9=b0
+DIValNewline9=b1
+DIVisible9=b1
+DILabel10=uStyl:
+DIValue10=u%raw:/Genre^mradio%
+DILineAbove10=b0
+DIValNewline10=b0
+DIVisible10=b1
+DILabel11=uKvalita:
+DIValue11=u%raw:/Bitrate^mradio% kbps
+DILineAbove11=b0
+DIValNewline11=b0
+DIVisible11=b1
+DILabel12=u
+DIValue12=u
+DILineAbove12=b1
+DIValNewline12=b0
+DIVisible12=b1
+DILabel13=uJméno:
+DIValue13=u?if(?dbsetting(%subject%,?upper(?cinfo(%subject%,protocol)),FirstName),%raw:/FirstName|% %raw:/LastName|%,%raw:UserInfo/FirstName|% %raw:UserInfo/LastName|%)
+DILineAbove13=b0
+DIValNewline13=b0
+DIVisible13=b1
+DILabel14=uPohlavÃ:
+DIValue14=u%gender%
+DILineAbove14=b0
+DIValNewline14=b0
+DIVisible14=b1
+DILabel15=uNarozeniny:
+DIValue15=u%birthday_date% (%birthday_age% let) @ za: %birthday_next%
+DILineAbove15=b0
+DIValNewline15=b0
+DIVisible15=b1
+DILabel16=uEmail:
+DIValue16=u%raw:/e-mail%
+DILineAbove16=b0
+DIValNewline16=b0
+DIVisible16=b1
+DILabel17=uWeb:
+DIValue17=u%raw:/Homepage%
+DILineAbove17=b0
+DIValNewline17=b0
+DIVisible17=b1
+DILabel18=uKlient:
+DIValue18=u%raw:/MirVer^!weather%
+DILineAbove18=b0
+DIValNewline18=b0
+DIVisible18=b1
+DILabel19=u
+DIValue19=u
+DILineAbove19=b1
+DIValNewline19=b0
+DIVisible19=b1
+DILabel20=uIP:
+DIValue20=u%ip%
+DILineAbove20=b0
+DIValNewline20=b0
+DIVisible20=b1
+DILabel21=uInternà IP:
+DIValue21=u%ip_internal%
+DILineAbove21=b0
+DIValNewline21=b0
+DIVisible21=b1
+DILabel22=u
+DIValue22=u
+DILineAbove22=b1
+DIValNewline22=b0
+DIVisible22=b1
+DILabel23=uPÅ™ihlášenÃ:
+DIValue23=u%logon_time% (před: %logon_ago%)
+DILineAbove23=b0
+DIValNewline23=b0
+DIVisible23=b1
+DILabel24=uNeÄinnost:
+DIValue24=u%idle% (trvá: %idle_diff%)
+DILineAbove24=b0
+DIValNewline24=b0
+DIVisible24=b1
+DILabel25=uPoslednà stav:
+DIValue25=u%lastseen_date% @ %lastseen_time%
+DILineAbove25=b0
+DIValNewline25=b0
+DIVisible25=b1
+DILabel26=u
+DIValue26=u%lastseen_status% (před: %lastseen_ago%)
+DILineAbove26=b0
+DIValNewline26=b0
+DIVisible26=b1
+DILabel27=u
+DIValue27=u
+DILineAbove27=b1
+DIValNewline27=b0
+DIVisible27=b1
+DILabel28=uListening to:
+DIValue28=u%raw:/ListeningTo%
+DILineAbove28=b0
+DIValNewline28=b0
+DIVisible28=b1
+DILabel29=u
+DIValue29=u
+DILineAbove29=b1
+DIValNewline29=b0
+DIVisible29=b1
+DILabel30=uPoÄet zpráv:
+DIValue30=uOut: %sys:msg_count_out^!weather,mradio,tv% - In: %sys:msg_count_in%
+DILineAbove30=b1
+DIValNewline30=b0
+DIVisible30=b1
+DILabel31=uPoslednà zpráva: (před: %sys:last_msg_reltime%)
+DIValue31=u%sys:last_msg%
+DILineAbove31=b0
+DIValNewline31=b1
+DIVisible31=b1
+DILabel32=uZpráva stavu:
+DIValue32=u%sys:status_msg^!mradio,tv%
+DILineAbove32=b1
+DIValNewline32=b1
+DIVisible32=b1
+DILabel33=u
+DIValue33=u
+DILineAbove33=b1
+DIValNewline33=b0
+DIVisible33=b1
+DILabel34=uXStatus:
+DIValue34=u%xstatus_title%
+DILineAbove34=b0
+DIValNewline34=b0
+DIVisible34=b1
+DILabel35=u
+DIValue35=u%raw:/XStatusMsg%
+DILineAbove35=b0
+DIValNewline35=b1
+DIVisible35=b1
+DILabel36=uActivity:
+DIValue36=u%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/title%
+DILineAbove36=b0
+DIValNewline36=b0
+DIVisible36=b1
+DILabel37=u
+DIValue37=u%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/text%
+DILineAbove37=b0
+DIValNewline37=b1
+DIVisible37=b1
+DILabel38=u
+DIValue38=u
+DILineAbove38=b1
+DIValNewline38=b0
+DIVisible38=b1
+DILabel39=uAktuálnà situace:
+DIValue39=u%raw:Current/Condition^weather%
+DILineAbove39=b0
+DIValNewline39=b0
+DIVisible39=b1
+DILabel40=uTeplota:
+DIValue40=u%raw:Current/Temperature^weather%
+DILineAbove40=b0
+DIValNewline40=b0
+DIVisible40=b1
+DILabel41=uSubj. teplota:
+DIValue41=u%raw:Current/Feel^weather%
+DILineAbove41=b0
+DIValNewline41=b0
+DIVisible41=b1
+DILabel42=uMax/Min:
+DIValue42=u%raw:Current/High^weather%/%raw:Current/Low^weather%
+DILineAbove42=b0
+DIValNewline42=b0
+DIVisible42=b1
+DILabel43=uViditelnost
+DIValue43=u%raw:Current/Visibility^weather%
+DILineAbove43=b0
+DIValNewline43=b0
+DIVisible43=b1
+DILabel44=uVÃtr:
+DIValue44=u%raw:Current/Wind Direction% (%raw:Current/Wind Direction DEG%)/%raw:Current/Wind Speed%
+DILineAbove44=b0
+DIValNewline44=b0
+DIVisible44=b1
+DILabel45=uTlak:
+DIValue45=u%raw:Current/Pressure^weather% (%raw:Current/Pressure Tendency^weather%)
+DILineAbove45=b0
+DIValNewline45=b0
+DIVisible45=b1
+DILabel46=uVlhkost:
+DIValue46=u%raw:Current/Humidity^weather%
+DILineAbove46=b0
+DIValNewline46=b0
+DIVisible46=b1
+DILabel47=uUV Index:
+DIValue47=u%raw:Current/UV^weather% - %raw:Current/UVI^weather%
+DILineAbove47=b0
+DIValNewline47=b0
+DIVisible47=b1
+DILabel48=uVýchod Slunce:
+DIValue48=u%raw:Current/Sunrise^weather%
+DILineAbove48=b0
+DIValNewline48=b0
+DIVisible48=b1
+DILabel49=uZápad Slunce:
+DIValue49=u%raw:Current/Sunset^weather%
+DILineAbove49=b0
+DIValNewline49=b0
+DIVisible49=b1
+DILabel50=uFáze mÄ›sÃce:
+DIValue50=u%raw:Current/Moon^weather%
+DILineAbove50=b0
+DIValNewline50=b0
+DIVisible50=b1
+DIValue0=u%Status^!weather,tv,mradio%
+
+
diff --git a/plugins/TipperYM/docs/autoexec_tipper_items_eng.ini b/plugins/TipperYM/docs/autoexec_tipper_items_eng.ini new file mode 100644 index 0000000000..6d344f2405 --- /dev/null +++ b/plugins/TipperYM/docs/autoexec_tipper_items_eng.ini @@ -0,0 +1,384 @@ +SETTINGS:
+
+[Tipper_Items]
+Trans_WORD to status description=d1
+NextFuncId=d22
+Trans_DWORD timestamp to time=d2
+Trans_DWORD timestamp to time difference=d3
+Trans_BYTE to Yes/No=d4
+Trans_BYTE to Male/Female (ICQ)=d5
+Trans_WORD to country name=d6
+Trans_DWORD to ip address=d7
+Trans_<prefix>Day|Month|Year to date=d8
+Trans_<prefix>Day|Month|Year to age=d9
+Trans_<prefix>Hours|Minutes|Seconds to time=d10
+Trans_<prefix>Day|Month|Year|Hours|Minutes|Seconds to time difference=d11
+Trans_<prefix>Day|Month to days to next birthday=d12
+Trans_DWORD timestamp to time (no seconds)=d13
+Trans_<prefix>Hours|Minutes to time=d14
+Trans_DWORD timestamp to date (short)=d15
+Trans_DWORD timestamp to date (long)=d16
+Trans_xStatus: empty xStatus name to default name=d17
+Trans_DWORD seconds to time difference=d18
+Trans_BYTE timezone to time=d19
+Trans_Any to Idle/Not Idle/Unknown=d20
+Trans_Any to /Idle or empty=d21
+DSNumValues=w20
+Name0=ubirthday_age
+Type0=b1
+Module0=sUserInfo
+Setting0=sBirth
+TransFuncId0=d9
+Name1=ubirthday_date
+Type1=b1
+Module1=sUserInfo
+Setting1=sBirth
+TransFuncId1=d8
+Name2=ubirthday_next
+Type2=b1
+Module2=s
+Setting2=sBirth
+TransFuncId2=d12
+Name3=ucreate_date
+Type3=b1
+Module3=s
+Setting3=sMemberTS
+TransFuncId3=d15
+Name4=ucreate_time
+Type4=b1
+Module4=s
+Setting4=sMemberTS
+TransFuncId4=d2
+Name5=ugender
+Type5=b1
+Module5=s
+Setting5=sGender
+TransFuncId5=d5
+Name6=uidle
+Type6=b1
+Module6=s
+Setting6=sIdleTS
+TransFuncId6=d2
+Name7=uidle_diff
+Type7=b1
+Module7=s
+Setting7=sIdleTS
+TransFuncId7=d3
+Name8=uip
+Type8=b1
+Module8=s
+Setting8=sIP
+TransFuncId8=d7
+Name9=uip_internal
+Type9=b1
+Module9=s
+Setting9=sRealIP
+TransFuncId9=d7
+Name10=ulastseen_ago
+Type10=b0
+Module10=sSeenModule
+Setting10=s
+TransFuncId10=d11
+Name11=ulastseen_date
+Type11=b0
+Module11=sSeenModule
+Setting11=s
+TransFuncId11=d8
+Name12=ulastseen_status
+Type12=b0
+Module12=sSeenModule
+Setting12=sOldStatus
+TransFuncId12=d1
+Name13=ulastseen_time
+Type13=b0
+Module13=sSeenModule
+Setting13=s
+TransFuncId13=d10
+Name14=ulogon_ago
+Type14=b1
+Module14=s
+Setting14=sLogonTS
+TransFuncId14=d3
+Name15=ulogon_date
+Type15=b1
+Module15=s
+Setting15=sLogonTS
+TransFuncId15=d14
+Name16=ulogon_time
+Type16=b1
+Module16=s
+Setting16=sLogonTS
+TransFuncId16=d2
+Name17=uStatus
+Type17=b1
+Module17=sr4
+Setting17=sStatus
+TransFuncId17=d1
+Name18=ustatus_msg
+Type18=b0
+Module18=sCList
+Setting18=sStatusMsg
+TransFuncId18=d0
+Name19=uxstatus_title
+Type19=b1
+Module19=s
+Setting19=sXStatusName
+TransFuncId19=d17
+DINumValues=w47
+DILabel0=uStatus:
+DILineAbove0=b0
+DIValNewline0=b0
+DIVisible0=b1
+DILabel1=u%sys:uidname|UID%:
+DIValue1=u%sys:uid^!tv%
+DILineAbove1=b0
+DIValNewline1=b0
+DIVisible1=b1
+DIValue2=u%create_date% @ %create_time%
+DILineAbove2=b0
+DIValNewline2=b0
+DIVisible2=b1
+DIValue3=u%raw:Current/Update^weather%
+DILineAbove3=b0
+DIValNewline3=b0
+DIVisible3=b1
+DIValue4=u%raw:/MirVer^weather%
+DILineAbove4=b0
+DIValNewline4=b0
+DIVisible4=b1
+DILineAbove5=b0
+DIValNewline5=b1
+DIVisible5=b1
+DILineAbove6=b0
+DIValNewline6=b0
+DIVisible6=b1
+DILineAbove7=b0
+DIValNewline7=b0
+DIVisible7=b1
+DILineAbove8=b1
+DIValNewline8=b0
+DIVisible8=b1
+DILineAbove9=b0
+DIValNewline9=b0
+DIVisible9=b1
+DILineAbove10=b0
+DIValNewline10=b0
+DIVisible10=b1
+DILineAbove11=b0
+DIValNewline11=b0
+DIVisible11=b1
+DILineAbove12=b0
+DIValNewline12=b0
+DIVisible12=b1
+DILineAbove13=b0
+DIValNewline13=b0
+DIVisible13=b1
+DILineAbove14=b0
+DIValNewline14=b0
+DIVisible14=b1
+DILineAbove15=b1
+DIValNewline15=b0
+DIVisible15=b1
+DILineAbove16=b0
+DIValNewline16=b0
+DIVisible16=b1
+DILineAbove17=b0
+DIValNewline17=b0
+DIVisible17=b1
+DILineAbove18=b1
+DIValNewline18=b0
+DIVisible18=b1
+DILineAbove19=b0
+DIValNewline19=b0
+DIVisible19=b1
+DILineAbove20=b0
+DIValNewline20=b0
+DIVisible20=b1
+DILineAbove21=b0
+DIValNewline21=b0
+DIVisible21=b1
+DILabel22=u
+DILineAbove22=b0
+DIValNewline22=b0
+DIVisible22=b1
+DILineAbove23=b1
+DIValNewline23=b0
+DIVisible23=b1
+DILineAbove24=b0
+DIValNewline24=b0
+DIVisible24=b1
+DILineAbove25=b1
+DIValNewline25=b0
+DIVisible25=b1
+DILineAbove26=b1
+DIValNewline26=b0
+DIVisible26=b1
+DILineAbove27=b0
+DIValNewline27=b1
+DIVisible27=b1
+DILineAbove28=b1
+DIValNewline28=b1
+DIVisible28=b1
+DILabel29=u
+DIValue29=u
+DILineAbove29=b1
+DIValNewline29=b0
+DIVisible29=b1
+DILineAbove30=b0
+DIValNewline30=b0
+DIVisible30=b1
+DILineAbove31=b0
+DIValNewline31=b1
+DIVisible31=b1
+DILineAbove32=b0
+DIValNewline32=b0
+DIVisible32=b1
+DILabel33=u
+DILineAbove33=b0
+DIValNewline33=b1
+DIVisible33=b1
+DILineAbove34=b1
+DIValNewline34=b0
+DIVisible34=b1
+DILineAbove35=b0
+DIValNewline35=b0
+DIVisible35=b1
+DILineAbove36=b0
+DIValNewline36=b0
+DIVisible36=b1
+DILineAbove37=b0
+DIValNewline37=b0
+DIVisible37=b1
+DILineAbove38=b0
+DIValNewline38=b0
+DIVisible38=b1
+DILineAbove39=b0
+DIValNewline39=b0
+DIVisible39=b1
+DILineAbove40=b0
+DIValNewline40=b0
+DIVisible40=b1
+DILineAbove41=b0
+DIValNewline41=b0
+DIVisible41=b1
+DILineAbove42=b0
+DIValNewline42=b0
+DIVisible42=b1
+DILineAbove43=b0
+DIValNewline43=b0
+DIVisible43=b1
+DILineAbove44=b0
+DIValNewline44=b0
+DIVisible44=b1
+DILineAbove45=b0
+DIValNewline45=b0
+DIVisible45=b1
+DILineAbove46=b0
+DIValNewline46=b0
+DIVisible46=b1
+DILabel47=uUV Index:
+DIValue47=u%raw:Current/UV^weather% - %raw:Current/UVI^weather%
+DILineAbove47=b0
+DIValNewline47=b0
+DIVisible47=b1
+DILabel48=uVýchod Slunce:
+DIValue48=u%raw:Current/Sunrise^weather%
+DILineAbove48=b0
+DIValNewline48=b0
+DIVisible48=b1
+DILabel49=uZápad Slunce:
+DIValue49=u%raw:Current/Sunset^weather%
+DILineAbove49=b0
+DIValNewline49=b0
+DIVisible49=b1
+DILabel50=uFáze mÄ›sÃce:
+DIValue50=u%raw:Current/Moon^weather%
+DILineAbove50=b0
+DIValNewline50=b0
+DIVisible50=b1
+DILabel2=uMember since:
+DILabel4=uSource:
+DILabel3=uUpdate time:
+DIValue5=u?if(?and(?stricmp(?dbsetting(%subject%,Protocol,p),mradio),?stricmp(?cinfo(%subject%,status),online)),%radio_title%,)
+DIValue6=u%raw:/Genre^mradio%
+DILabel7=uBitrate:
+DIValue7=u%raw:/Bitrate^mradio% kbps
+DILabel8=u
+DIValue8=u
+DIValue9=u?if(?dbsetting(%subject%,?upper(?cinfo(%subject%,protocol)),FirstName),%raw:/FirstName|% %raw:/LastName|%,%raw:UserInfo/FirstName|% %raw:UserInfo/LastName|%)
+DIValue10=u%gender%
+DILabel12=uEmail:
+DIValue12=u%raw:/e-mail%
+DILabel13=uWeb:
+DIValue13=u%raw:/Homepage%
+DILabel14=uClient:
+DIValue14=u%raw:/MirVer^!weather%
+DILabel15=u
+DIValue15=u
+DILabel16=uIP:
+DIValue16=u%ip%
+DILabel17=uInternal IP:
+DIValue17=u%ip_internal%
+DILabel18=u
+DIValue18=u
+DIValue21=u%lastseen_date% @ %lastseen_time%
+DILabel23=u
+DIValue23=u
+DILabel24=uListening to:
+DIValue24=u%raw:/ListeningTo%
+DILabel25=u
+DIValue25=u
+DIValue27=u%sys:last_msg%
+DILabel30=uXStatus:
+DIValue30=u%xstatus_title%
+DILabel31=u
+DIValue31=u%raw:/XStatusMsg%
+DILabel32=uActivity:
+DIValue32=u%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/title%
+DIValue33=u%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/text%
+DILabel34=u
+DIValue34=u
+DIValue35=u%raw:Current/Condition^weather%
+DIValue36=u%raw:Current/Temperature^weather%
+DIValue37=u%raw:Current/Feel^weather%
+DILabel38=uMax/Min:
+DIValue38=u%raw:Current/High^weather%/%raw:Current/Low^weather%
+DILabel39=uVisibility:
+DIValue39=u%raw:Current/Visibility^weather%
+DIValue40=u%raw:Current/Wind Direction% (%raw:Current/Wind Direction DEG%)/%raw:Current/Wind Speed%
+DIValue41=u%raw:Current/Pressure^weather% (%raw:Current/Pressure Tendency^weather%)
+DIValue42=u%raw:Current/Humidity^weather%
+DILabel43=uUV Index:
+DIValue43=u%raw:Current/UV^weather% - %raw:Current/UVI^weather%
+DIValue44=u%raw:Current/Sunrise^weather%
+DIValue45=u%raw:Current/Sunset^weather%
+DIValue46=u%raw:Current/Moon^weather%
+DILabel5=uPlaying:
+DILabel6=uGenre:
+DILabel9=uName:
+DILabel10=uGender:
+DILabel11=uBirthday:
+DIValue11=u%birthday_date% (%birthday_age% years) @ next: %birthday_next%ays
+DILabel19=uLogon:
+DILabel20=uIdle:
+DIValue19=u%logon_time% (%logon_ago% ago)
+DIValue20=u%idle% (%idle_diff% ago)
+DILabel21=uLast seen:
+DIValue22=u%lastseen_status% (%lastseen_ago% ago)
+DILabel26=uMsg count:
+DILabel27=uLast message: (%sys:last_msg_reltime% ago)
+DILabel28=uStatus message:
+DILabel35=uCondition:
+DILabel36=uTemperature:
+DILabel37=uFeel like:
+DILabel40=uWind:
+DILabel41=uPressure:
+DILabel42=uHumidity:
+DILabel44=uSunrise:
+DILabel45=uSunset:
+DILabel46=uMoon:
+DIValue0=u%Status^!weather,tv,mtv,mradio%
+DIValue26=uOut: %sys:msg_count_out^!weather,mradio,mtv,tv% - In: %sys:msg_count_in%
+DIValue28=u%sys:status_msg^!weather,mradio%
+
+
diff --git a/plugins/TipperYM/docs/m_tipper.h b/plugins/TipperYM/docs/m_tipper.h new file mode 100644 index 0000000000..21b6df7cef --- /dev/null +++ b/plugins/TipperYM/docs/m_tipper.h @@ -0,0 +1,45 @@ +/*
+Copyright (C) 2006-07 Scott Ellis
+Copyright (C) 2007-09 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+// Tipper API
+// note: Tipper is internally unicode and requires unicows.dll to function correctly on 95/98/ME
+// so you'll find a lot of wchar_t stuff in here
+
+// translation function type
+// use hContact, module and setting to read your db value(s) and put the resulting string into buff
+// return buff if the translation was successful, or return 0 for failure
+typedef TCHAR *(TranslateFunc)(HANDLE hContact, const char *module, const char *setting_or_prefix, TCHAR *buff, int bufflen);
+
+typedef struct {
+ TranslateFunc *transFunc; // address of your translation function (see typedef above)
+ const TCHAR *swzName; // make sure this is unique, and DO NOT translate it
+ DWORD id; // will be overwritten by Tipper - do not use
+} DBVTranslation;
+
+// add a translation to tipper
+// wParam not used
+// lParam = (DBVTranslation *)translation
+#define MS_TIPPER_ADDTRANSLATION "Tipper/AddTranslation"
+
+// unicode extension to the basic functionality
+// wParam - optional (wchar_t *)text for text-only tips
+// lParam - (CLCINFOTIP *)infoTip
+#define MS_TIPPER_SHOWTIPW "mToolTip/ShowTipW"
\ No newline at end of file diff --git a/plugins/TipperYM/docs/sample skin/preview.jpg b/plugins/TipperYM/docs/sample skin/preview.jpg Binary files differnew file mode 100644 index 0000000000..2284bc96a4 --- /dev/null +++ b/plugins/TipperYM/docs/sample skin/preview.jpg diff --git a/plugins/TipperYM/docs/sample skin/xpmc.tsf b/plugins/TipperYM/docs/sample skin/xpmc.tsf new file mode 100644 index 0000000000..55b27fe82f --- /dev/null +++ b/plugins/TipperYM/docs/sample skin/xpmc.tsf @@ -0,0 +1,162 @@ +;-------------------------------------
+; Sample skin for Tipper YM
+;-------------------------------------
+;
+;*************************************
+; Skin Definition
+;*************************************
+;
+; Skin has 6 main elements:
+; [About], [Background], [Sidebar], [Fonts], [Appearance], [Other]
+;
+; Element [About] has 2 attributes:
+; Author, Preview
+;
+; Elements [Background], [Sidebar] have 6 attributes:
+; Image, TM, Left, Top, Right, Bottom
+;
+; Element [Fonts] has 17 attributes:
+; Title-face, Title-color, Title-size, Title-effect
+; Label-face, Label-color, Label-size, Label-effect
+; Value-face, Value-color, Value-size, Value-effect
+; TrayTitle-face, TrayTitle-color, TrayTitle-size, TrayTitle-effect
+; Divider-color
+;
+; Element [Appearance] has 9 attributes:
+; General-padding, Title-indent, Text-indent, Value-indent, Text-padding,
+; Outer-avatar-padding, Inner-avatar-padding, Sidebar-width, Opacity
+;
+; Elemet [Other] has 1 attribute:
+; Enable-coloring
+;
+;===========================
+; Attributes
+;===========================
+;
+; Author
+;---------------------------
+; Your name or nick ;-)
+;
+; Preview
+;---------------------------
+; Relative path to the image file with the preview of your skin.
+;
+; Image
+;---------------------------
+; Relative path to the image file that is used as tooltip background.
+;
+; TM (Transformation mode)
+;---------------------------
+; Edge parts and center area of the image file are tranformed according to this value.
+; Can be one of following values:
+; TM_NONE
+; TM_CENTRE
+; TM_STRECH_ALL
+; TM_STRECH_HORIZONTAL
+; TM_STRECH_VERTICAL
+; TM_TILE_ALL
+; TM_TILE_HORIZONTAL
+; TM_TILE_VERTICAL
+;
+; Left, Top, Right, Bottom
+;---------------------------
+; Margins in pixels for Glyph transformation.
+;
+; XXX-face
+;---------------------------
+; Name of the font (eg. Arial, Tahoma, Trebuchet MS).
+; String is case sensitive!
+;
+; XXX-color
+;---------------------------
+; Font (divider) color defined by 3 decimal numbers separated by spaces.
+; RGB color model (Red Green Blue)
+;
+; XXX-size
+;---------------------------
+; Font size in pixels :-)
+;
+; XXX-effect
+;---------------------------
+; Effect applied to the tooltip text.
+; Can be one or more of the following values (separated by spaces):
+; FONT_BOLD
+; FONT_ITALIC
+; FONT_UNDERLINE
+;
+; XXX-padding, XXX-indent
+;---------------------------
+; These values in pixels determine proportions of the tooltip.
+;
+; Sidebar-width
+;---------------------------
+; Width of the sidebar in pixels.
+;
+; Opacity
+;---------------------------
+; Opacity which is applied to the final tooltip
+; Can be number within the range of 0 - 100.
+;
+; Enable-coloring
+;---------------------------
+; Enable or disable 'Enable coloring' checkbox in the options.
+; Can be TRUE or FALSE.
+;
+;*************************************
+
+[About]
+Author = yaho
+Preview = preview.jpg
+
+[Background]
+Image = xpmc_bg.png
+TM = TM_STRECH_ALL
+Left = 16
+Top = 16
+Right = 16
+Bottom = 16
+
+[Sidebar]
+Image = xpmc_sidebar.png
+TM = TM_STRECH_ALL
+Left = 16
+Top = 16
+Right = 4
+Bottom = 16
+
+[Fonts]
+Title-face = Tahoma
+Title-color = 128 0 0
+Title-size = 12
+Title-effect = FONT_BOLD
+
+Label-face = Tahoma
+Label-color = 0 0 0
+Label-size = 8
+Label-effect = FONT_BOLD
+
+Value-face = Tahoma
+Value-color = 40 40 40
+Value-size = 8
+Value-effect = 0
+
+TrayTitle-face = Tahoma
+TrayTitle-color = 100 0 0
+TrayTitle-size = 10
+TrayTitle-effect = FONT_BOLD
+
+Divider-color = 120 120 120
+
+[Appearance]
+General-padding = 14
+Title-indent = 25
+Text-indent = 25
+Value-indent = 8
+Text-padding = 3
+Outer-avatar-padding = 18
+Inner-avatar-padding = 10
+Sidebar-width = 34
+Opacity = 90
+
+[Other]
+Enable-coloring = FALSE
diff --git a/plugins/TipperYM/docs/sample skin/xpmc_bg.png b/plugins/TipperYM/docs/sample skin/xpmc_bg.png Binary files differnew file mode 100644 index 0000000000..76b3138a3e --- /dev/null +++ b/plugins/TipperYM/docs/sample skin/xpmc_bg.png diff --git a/plugins/TipperYM/docs/sample skin/xpmc_sidebar.png b/plugins/TipperYM/docs/sample skin/xpmc_sidebar.png Binary files differnew file mode 100644 index 0000000000..43f946909d --- /dev/null +++ b/plugins/TipperYM/docs/sample skin/xpmc_sidebar.png diff --git a/plugins/TipperYM/docs/tipper classic/back.png b/plugins/TipperYM/docs/tipper classic/back.png Binary files differnew file mode 100644 index 0000000000..94557cda14 --- /dev/null +++ b/plugins/TipperYM/docs/tipper classic/back.png diff --git a/plugins/TipperYM/docs/tipper classic/classic.tsf b/plugins/TipperYM/docs/tipper classic/classic.tsf new file mode 100644 index 0000000000..93343b1e84 --- /dev/null +++ b/plugins/TipperYM/docs/tipper classic/classic.tsf @@ -0,0 +1,48 @@ +[About]
+Author = yaho
+Preview = preview.jpg
+
+[Background]
+Image = back.png
+TM = TM_STRECH_ALL
+Left = 14
+Top = 14
+Right = 14
+Bottom = 14
+
+[Fonts]
+Title-face = Tahoma
+Title-color = 100 0 0
+Title-size = 12
+Title-effect = FONT_BOLD
+
+Label-face = Tahoma
+Label-color = 35 0 0
+Label-size = 8
+Label-effect = FONT_BOLD
+
+Value-face = Tahoma
+Value-color = 24 24 24
+Value-size = 8
+Value-effect = 0
+
+TrayTitle-face = Tahoma
+TrayTitle-color = 64 0 0
+TrayTitle-size = 10
+TrayTitle-effect = FONT_BOLD
+
+Divider-color = 75 75 75
+
+[Appearance]
+General-padding = 15
+Title-indent = 24
+Text-indent = 24
+Value-indent = 10
+Text-padding = 2
+Outer-avatar-padding = 15
+Inner-avatar-padding = 10
+Sidebar-width = 0
+Opacity = 85
+
+[Other]
+Enable-coloring = TRUE
diff --git a/plugins/TipperYM/docs/tipper classic/preview.jpg b/plugins/TipperYM/docs/tipper classic/preview.jpg Binary files differnew file mode 100644 index 0000000000..6053da4ab3 --- /dev/null +++ b/plugins/TipperYM/docs/tipper classic/preview.jpg diff --git a/plugins/TipperYM/docs/tipper_licence.txt b/plugins/TipperYM/docs/tipper_licence.txt new file mode 100644 index 0000000000..7f1161073d --- /dev/null +++ b/plugins/TipperYM/docs/tipper_licence.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ 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
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/plugins/TipperYM/docs/tipper_orig_readme.txt b/plugins/TipperYM/docs/tipper_orig_readme.txt new file mode 100644 index 0000000000..7795975c23 --- /dev/null +++ b/plugins/TipperYM/docs/tipper_orig_readme.txt @@ -0,0 +1,147 @@ +Document updated: 28/09/2010
+
+******
+Tipper - shows a tooltip when you hover the mouse over a contact in your contact list
+******
+
+Most options are self explanitory...except for 'items' and 'substitutions'.
+
+If you want to set this up yourself, you need a moderate understanding of the miranda database (profile) and the Database Editor++ plugin.
+
+The easiest way is to copy the autoexec_tipper.ini file (in the same folder as this document) to the miranda program folder and restart -
+it will (normally) ask you if you wish to import the settings. If you click yes, you will find several examples in your Tipper options that
+will get you started. You can also ask your nerdier miranda-using buddies to create such a file for you, if they have a good setup.
+
+To get an idea of how tipper works, try playing with items. Items are simply a label and some text (the value). Try adding some items. Once
+you've played around a bit you'll get the idea, and then you'll understand the need for substitutions.
+
+Substitutions allow you to put useful, contact related, information into the label or value of an item. To create a substitution you need
+to have a relatively good understanding of the miranda database - a few hours browsing with dbeditor++ will give you a clue. You create a
+substitution by specifying a name and the database module and setting names for the data it will contain. You can then put this data into
+any item (label or value) by enclosing the substitution name in '%' symbols. Many database values are not terribly friendly to humans, so
+when creating a substitution, you can also choose a translation which will convert the value into a more readable format.
+
+To get technical:
+
+A 'Substitution' is a name for a database value, represented according to a particular translation. When creating new substitutions, you
+specify its name, the database module (or the contact's protocol module) and the setting name. Then you select a translation from the drop
+down list. This transformation will convert the database value into a string.
+
+An 'Item' is just a label and a value. However, any substitution names (surrounded by % symbols) occuring in either a label or a value will
+be substituted as described above. If you want to put a % symbol in a value or label, use '%%' instead.
+
+A good example is representing a contacts status (as 'Online' etc) in the tooltip.
+
+First, create a substitution called 'status' (without quotes) - the module will be the contact's protocol module, the setting name will be
+'Status' (without quotes - note the capital 'S') and the translation will be 'WORD to status description' (since this value is a WORD value
+in the database). Then, create an item and specify 'Status:' for the label and '%status%' for the value. Done.
+
+There is also a built in substitution, called a 'raw' substitution. It is not listed in the substitution list, but it is available in all
+labels and values. It's format is:
+
+%raw:<db module>/<db setting>%
+
+No translation is performed on 'raw' values. For example, to display a contact's contact list group in the tooltip, add an item with the
+label 'Group:' and the value '%raw:CList/Group%'. If you do not specify a module name (you must still include the '/'), the contact's
+protocol module will be used (or UserInfo module if setting doesn't exist in protocol module). This is ultimately just a shortcut
+for the 'null translation'.
+
+There are also 'system' substitutions (thanks to y_b), also not listed but available in all item labels and values, with the following
+format:
+
+%sys:<name>%
+
+Were name can be any of the following:
+
+uid - contact's unique identifier
+uidname - name of unique identifier
+proto - contact's protocol
+account - contact's user-defined account name
+time - contact's time
+status_msg - contact's status message
+last_msg - last message received from contact
+last_msg_time - time of last received message
+last_msg_date - date of last received message
+last_msg_reltime - relative time of last message (i.e. time between then and now)
+meta_subname - nickname of active subcontact (for metacontacts)
+meta_subuid - unique id of active subcontact
+meta_subproto - active subcontact protocol (also for metacontacts)
+msg_count_all - number of all messages in db for contact (sent + received)
+msg_count_out - number of sent messages to contact
+msg_count_in - number of received messages from contact
+
+If a substitution's value results in no text (or nothing but spaces, tabs, newlines, and carriage returns), the whole item containing that
+substitution will not be displayed. If there is an error during the substitution process (e.g. a substitution name that does not exist, an odd
+number of % symbols, etc) then the value of that substitution will be "*". Note that you can use double-percent ("%%") in plain text (not in
+substitutions) if you want an actual percent symbol.
+
+ADVANCED
+--------
+
+Alternative Text:
+In any substitution you can have 'alternate text' to use if the substitution fails (missing db value, etc). The format is:
+
+%x|y%
+
+where x is the original substitution and y is the alternative text (can be substitution). Note that you can use '|' in the alternative text,
+since it uses the *first* occurence to determine where the alternative text begins. Normally if any substitution results in no value, the entire
+item will not be displayed - but if you omit the 'y' value above (i.e. have nothing for the 'alternate' text) then the substitution process
+will continue.
+As an example, consider the following item value:
+
+%raw:/FirstName|% %raw:/LastName%
+
+The above value will display the contact's first name if it's available, and then their last name - but if the last name is not available, the
+entire item will not be displayed.
+
+Specific protocols:
+If you end a substitution with '^' and a protocols names (separated by commas), then that substitution will only be displayed if the contact belongs
+to the one of given protocols:
+
+%x^w,y,z%
+
+where w,y,z are the protocols names. If you want to display an item for every protocol *except* one or more, use
+
+%x^!w,y,z%
+
+If you use alternative text and specific protocol together, specify the alternative text first:
+
+%x|y^z%
+
+In such substitutions you can use a '^' symbol in the alternative text, as Tipper will take the *last* '^' symbol as the start of the protocol
+specifier. If you want to use a '^' symbol in alternative text without a specific protocol, just append a '^' to the end of the descriptor,
+e.g.:
+
+%x|y^%
+
+
+'HIDDEN' DB SETTINGS
+--------------------
+
+Due to space constraints in the options, the following settings are only accessible via the database (i.e. using dbeditor++):
+
+BYTE Tipper/AvatarOpacity
+
+
+********************
+'Variables' support:
+********************
+
+This plugin supports the variables plugin by UnregistereD (http://addons.miranda-im.org/details.php?action=viewfile&id=3815)
+
+Be sure to use the unicode version!
+
+All text in 'Items' - that is, labels and values, will be processed by variables BEFORE Tipper substitutions are applied.
+
+
+Good luck and have fun.
+
+
+Scott
+mail@scottellis.com.au
+www.scottellis.com.au
+
+Tipper YM mod by yaho
+yaho@miranda-easy.net
+www.miranda-easy.net
+
diff --git a/plugins/TipperYM/docs/tipper_readme.txt b/plugins/TipperYM/docs/tipper_readme.txt new file mode 100644 index 0000000000..86083f94d1 --- /dev/null +++ b/plugins/TipperYM/docs/tipper_readme.txt @@ -0,0 +1,343 @@ +*********
+Tipper YM
+*********
+
+Description
+===========
+Modified Tipper plugin by Scott Ellis.
+
+
+New features
+************
+- skin support with glyph transformation and alpha channel transparency (win 2000+)
+- two-level extended tray tooltip replacing default one with many options
+- SmileyAdd support (graphic smileys in tooltips)
+- menu for copy item/s or avatar to the clipboard (CTRL+C when tooltip is showed)
+- new icons (Extra Status, Gender, Country Flags, Fingerprint)
+- some new system substitutions
+- raw protocol substitutions are also searched in UserInfo module
+- correct status message in status bar tooltip
+- ICQ XStatus and Jabber mood/activity details in status bar tooltip
+- smooth animation when tooltip is showing and hiding
+- option for keep original avatar size and make avatar transparent
+
+
+changelog
+*********
+
+--- 2.1.0.5 ---
+! new preset item - ICQ logon time
+
+--- 2.1.0.4 ---
+! fixed buffer overrun
+
+--- 2.1.0.3 ---
+! fixed crash when getting NULL value from db
+
+--- 2.1.0.2 ---
+! fixed contact's status message retrieving
+! fixed possible crash when getting contact's account
+
+--- 2.1.0.1 ---
++ merged changes from original Tipper
+! fixed crash when getting own status message
+
+--- 2.1.0.0 ---
++ merged changes from original Tipper
++ ability to display contact time in tooltips
+
+--- 2.0.4.17 ---
+! fixed crash when getting own status message
+! memory leaks and x64 portability fixes (patch by Merlin_de)
+
+--- 2.0.4.16 ---
+* code cleanup, x64 portability
+! fixed behavior of the Apply button in options
+
+--- 2.0.4.15 ---
++ option for parse Tipper variables first
+! fixed tray tooltip detection
+! fixed some other minor bugs
+
+--- 2.0.4.14 ---
+! compatibility fixes (required Miranda IM 0.8.9 or newer)
+! layout fixes for aid translation
+
+--- 2.0.4.13 ---
++ added url link to get more skins
+! no-icon setting wasn't applied to tray tooltip
+! variables button now handle focused field (label or value)
+! removed translation of db key
+
+--- 2.0.4.12 ---
++ added variables button to new item dialog
+
+--- 2.0.4.11 ---
+* couple of changes in tray tooltip options page
+* Tipper YM now requires Miranda 0.8
+! fixed missing protocols (XFire) in tray tooltip
+! translation fixes
+
+--- 2.0.4.10 ---
++ added system substitution %sys:account%
+! fixed smileys parsing in title
+! fixed memory corruption (thx Protogenes)
+
+--- 2.0.4.9 ---
+! fixed 'skin coloring' feature
+
+--- 2.0.4.8 ---
+* title is wrapped instead of truncated
+* smileys are displayed in title
+! some fixes related to getting status message
+
+--- 2.0.4.7 ---
+! fixed possible occurrance of glitches in sidebar part of skin
+! fixed occasional crash
+
+--- 2.0.4.6 ---
+! fixed converting the font size value from skin file
+(I hope this is the last change related to skin definition, please don't beat me :)
+
+--- 2.0.4.5 ---
++ new attribute in [Font] section for specify font name
+* improved function for get own status message
+
+--- 2.0.4.4 ---
+* improved %sys:msg_count_xxx% substitutions
+! fixed saving skin options to db
+
+--- 2.0.4.3 ---
++ new skin element [Other]
++ new options for load fonts, colors and appearance provided by skin
+! many fixes for options dialog
+
+--- 2.0.4.2 ---
++ new skin attribute for enable/disable coloring feature
+! fixed skin parsing
+! fixed %sys:msg_count_xxx% substitutions (thx ASSami)
+! fixed reversed spin control in appearance options
+
+--- 2.0.4.1 ---
+! fixed crash if metacontact plugin isn't present
+
+--- 2.0.4.0 ---
++ new skin engine with coloring feature
+* separator in traytip moved above protocol name
+! disabled accounts are no more visible in tray tooltip
+! many other fixes :)
+
+--- 2.0.3.4 ---
+! fixed crash on tray tooltip (thx Lastwebpage)
+
+--- 2.0.3.3 ---
++ button for add a separator (better representation of separators in item list)
++ translation for convert BYTE to language (ICQ)
++ translations for convert WORD to name of a day and name of a month (e.g. Last seen plugin)
++ option for limit status message to adjusted count of characters
+! some fixes and cleanup
+
+--- 2.0.3.2 ---
++ option for replace only isolated smiles in text
++ option for show tooltip after all content (avatar & status message) is ready
++ option for disable retrieving of status message in all statuses ("CList/StatusMsg" value is used)
+! fixed icq xstatus/jabber mood in status bar and tray tooltips
+! fixed transparency of avatar border
+! disabled accounts are no more visible in tray tooltip
+
+--- 2.0.3.1 ---
++ option for set avatar transparency (via db key 'AvatarOpacity', value: 0 - 100%)
+! various fixes (thx all for help)
+
+--- 2.0.3.0 ---
+!!! MAKE BACKUP OF YOUR TIPPER SETTING BEFORE USE THIS VERSION !!!
+
++ reworked aero glass on windows vista
++ option for specify show effect speed
++ indication of locked protocols
++ support for SimpleAway plugin
+* tooltip items relocated to new db module Tipper_Items
+* removed option for Transparent background
+! fixed linebreaks when copy all items from tooltip
+! fixed some bugs on Win 98
+
+--- 2.0.2.11 ---
++ support for account system in miranda 0.8
++ option for disable offline protocols in tray tooltip
+! fix for copy function (CTRL + C) with clist nicer
+! workaround for unicode text in xstatus
+
+--- 2.0.2.10 ---
++ new set of predefined items
+! some fixes for predefined items (labels are translatable now)
+
+--- 2.0.2.9 ---
++ added several predefined items
+! fixed some memory leaks and crash
+
+--- 2.0.2.8 ---
++ support for jabber moods and activities
++ new translation to get number of days to next birthday
++ better caching for background image
+* some design changes in options dialog
+! fixed crash on status bar tooltip
+
+--- 2.0.2.7 ---
+! fixed crash with old variables plugin
+
+--- 2.0.2.6 ---
++ added fade out effect when window is closing
+* disabled setting for Aero Glass blur (need some work)
+! fixed parsing of text with smileys (again)
+! fixed protocol smileys for MetaContacts
+! fixed memory leak
+
+--- 2.0.2.5 ---
++ added support of window blur at Vista Aero (patch by Protogenes)
++ added option for use status bar protocols setting (on/off & order) in tray tooltip
++ added option for use protocol smileys instead of tipper smileys
+! fixed clist event in tray tooltip
+! fixed parsing of text with smileys
+
+--- 2.0.2.4 ---
+! fixed double icons drawing in extended traytip
+! fixed drawing of transparent icons
+
+--- 2.0.2.3 ---
++ added clist event info (message from xyz etc.) to extended tray tooltip
++ added listening to and number of unread emails to status bar and tray tooltip
++ added options for favourite contacts: hide offline and append protocol name
+* larger height is applied only to lines with smiley, not to all lines in text with smileys
+* max height is ignored for tray tooltip
+! fixed wrong size of pluginInfoEx structure (thx eblis)
+! fixed getting of own status message from NAS
+! fixed width of tray tooltip if 'number of contacts' was enabled
+
+--- 2.0.2.2 ---
+! fixed drawing of smileys without trasparency
+! fixed crash on tray tooltip if protocols are connecting
+
+--- 2.0.2.1 ---
+! fixed calculation of tooltip width
+
+--- 2.0.2.0 ---
++ implemented two-level extended tray tooltip replacing default one with many options
++ avatar padding divided into outer and inner padding
++ added option for value indent
+* increased animation speed
+! fixed drawing of edges - now they are transformed like centre area (according to transform setting)
+! fixed drawing of avatars with transparent background
+
+--- 2.0.1.1 ---
+! fixed large memory leak
+
+--- 2.0.1.0 ---
++ improved skin engine - added support for pictures with alpha channel transparency (win 2000+)
++ new option for copy all tooltip items with labels
++ fade effect when showing tooltip
++ option for title indent
+* gender info is searched also in UserInfo module (for gender icon)
+! small fix for alternate text
+
+--- 2.0.0.0 ---
++ 'system' substitutions to get number of (sent or received) messages for contact
+ (%sys:msg_count_out%, %sys:msg_count_in%, %sys:msg_count_all%)
++ first FL version
+
+--- 1.5.0.5 ---
++ menu for copy item/s or avatar to the clipboard (CTRL+C when tooltip is showed)
+* value for 'custom' substitutions is also searched in UserInfo modul (if 'contact protocol module' is checked)
+* changes in status message retrieving
+! item was displayed if alternate substitution fails
+! some options page fixes
+
+--- 1.5.0.4 ---
+! fixed reading of unicode settings from db
+
+--- 1.5.0.3 ---
++ buttons for export/import skin setting
+! fixed reading of numbers from db
+! fixed system substitution 'sys:uid'
+
+--- 1.5.0.2 ---
+* substitution can be (dis)allowed for more protocols (separated by commas) - e.g. %x^w,y,z%
+* substitution can be used in alternate text - e.g. %raw:x/y|sys:proto%
+* if failed 'raw protocol substitution' (%raw:/x%) is tried UserInfo module (%raw:UserInfo/x%)
+
+--- 1.5.0.1 ---
+! fixed crash with variables
+
+--- 1.5.0.0 ---
++ simple skin support with glyph transformation (like in clist modern)
++ updater support
+! fixed tooltip hiding when clist hides from timeout
+! option "show if list not focused" affects only contact tooltips in clist
+! some memory bug fixes
+* minor options dialog changes
+
+--- 1.4.8.8 ---
++ added SmileyAdd support :-)
++ added option for use background image
+! fixed display of fingerprint icon
+! many other fixes and optimalizations
+* code cleanup
+
+--- 1.4.8.7 ---
+! fixed height calculation of status bar tooltip
+! fixed display of extra icons if animation is enabled
+
+--- 1.4.8.6 ---
+! window height is also calculated from extra icons height
+! fixed nasty bug that caused crash on status bar tooltip
++ option for draw avatar border
++ added translation for extra icons
+
+--- 1.4.8.5 ---
++ show log on info in the status bar tooltip
+! fixed crash if there is no contact in db (status bar tooltip)
+! show correct status message if global status was changed (status bar tooltip)
+
+--- 1.4.8.4 ---
+! fixed another stupid bug (getting status message)
+
+--- 1.4.8.3 ---
+! fixed crash with contact of the unloaded protocol ('unknown contact')
+
+--- 1.4.8.2 ---
+* SVN-sync 214
+
+--- 1.4.5.2 ---
+* SVN-sync 205 (utf8 patch from george)
++ option to change extra icons order
++ variables parsing in status bar tooltip
+! fixed XStatus icon for metacontacts
+
+--- 1.4.3.1 ---
++ new settings (options for disable new icons and functions)
++ option for keep original avatar size
+! support for Country Flags v.0.1.1.0
+
+--- 0.4.0.3 ---
+* SVN-sync 177 (added timezone translation)
++ new icons (Gender, Country Flags)
+
+--- 0.4.0.2 ---
+* SVN-sync 172 (multiline text tips (FYR request))
++ show more icons (XStatus icon, Fingerprint icon)
+
+--- 0.4.0.1 ---
+* SVN-sync 126-157 (new plugin API)
++ retrieve XStatus details when automatic retrieve is disabled
+* code cleanup
+
+Symbols used in changelog: + = new / * = changed / ! = fixed
+
+
+Author
+======
+original plugin by sje (thx!)
+mod by yaho -> YM
+
+email: yaho@atlas.cz
+ICQ: 356344824
+www: www.miranda-easy.net
\ No newline at end of file diff --git a/plugins/TipperYM/docs/tipper_skins.txt b/plugins/TipperYM/docs/tipper_skins.txt new file mode 100644 index 0000000000..9783fbee1e --- /dev/null +++ b/plugins/TipperYM/docs/tipper_skins.txt @@ -0,0 +1,109 @@ +*************************************
+ Skin Definition
+*************************************
+
+ Skin has 6 main elements:
+ [About], [Background], [Sidebar], [Fonts], [Appearance], [Other]
+
+ Element [About] has 2 attributes:
+ Author, Preview
+
+ Elements [Background], [Sidebar] have 6 attributes:
+ Image, TM, Left, Top, Right, Bottom
+
+ Element [Fonts] has 17 attributes:
+ Title-face, Title-color, Title-size, Title-effect
+ Label-face, Label-color, Label-size, Label-effect
+ Value-face, Value-color, Value-size, Value-effect
+ TrayTitle-face, TrayTitle-color, TrayTitle-size, TrayTitle-effect
+ Divider-color
+
+ Element [Appearance] has 9 attributes:
+ General-padding, Title-indent, Text-indent, Value-indent, Text-padding,
+ Outer-avatar-padding, Inner-avatar-padding, Sidebar-width, Opacity
+
+ Elemet [Other] has 1 attribute:
+ Enable-coloring
+
+===========================
+ Attributes
+===========================
+
+ Author
+---------------------------
+ Your name or nick ;-)
+
+ Preview
+---------------------------
+ Relative path to the image file with the preview of your skin.
+
+ Image
+---------------------------
+ Relative path to the image file that is used as tooltip background.
+
+ TM (Transformation mode)
+---------------------------
+ Edge parts and center area of the image file are tranformed according to this value.
+ Can be one of following values:
+ TM_NONE
+ TM_CENTRE
+ TM_STRECH_ALL
+ TM_STRECH_HORIZONTAL
+ TM_STRECH_VERTICAL
+ TM_TILE_ALL
+ TM_TILE_HORIZONTAL
+ TM_TILE_VERTICAL
+
+ Left, Top, Right, Bottom
+---------------------------
+ Margins in pixels for Glyph transformation.
+
+ XXX-face
+---------------------------
+ Name of the font (eg. Arial, Tahoma, Trebuchet MS).
+ String is case sensitive!
+
+ XXX-color
+---------------------------
+ Font (divider) color defined by 3 decimal numbers separated by spaces.
+ RGB color model (Red Green Blue)
+
+ XXX-size
+---------------------------
+ Font size in pixels :-)
+
+ XXX-effect
+---------------------------
+ Effect applied to the tooltip text.
+ Can be one or more of the following values (separated by spaces):
+ FONT_BOLD
+ FONT_ITALIC
+ FONT_UNDERLINE
+
+ XXX-padding, XXX-indent
+---------------------------
+ These values in pixels determine proportions of the tooltip.
+
+ Sidebar-width
+---------------------------
+ Width of the sidebar in pixels.
+
+ Opacity
+---------------------------
+ Opacity which is applied to the final tooltip
+ Can be number within the range of 0 - 100.
+
+ Enable-coloring
+---------------------------
+ Enable or disable 'Enable coloring' checkbox in the options.
+ Can be TRUE or FALSE.
+
+*************************************
+
+See 'XMPC' and 'Tipper classic' folders for examples.
+Background image can be additionally colored in Miranda's options.
+At first you have to enable 'Enable skin coloring' option in Customize - Tooltips - Skin.
+And atfer that the color can be set in Customize - Fonts - Tooltips -> Background.
+
+*************************************
+
diff --git a/plugins/TipperYM/message_pump.cpp b/plugins/TipperYM/message_pump.cpp new file mode 100644 index 0000000000..0122d18cb8 --- /dev/null +++ b/plugins/TipperYM/message_pump.cpp @@ -0,0 +1,422 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#include "common.h"
+#include "message_pump.h"
+#include "popwin.h"
+#include "options.h"
+#include "str_utils.h"
+#include "subst.h"
+
+BOOL (WINAPI *MySetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD) = 0;
+BOOL (WINAPI *MyUpdateLayeredWindow)(HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags) = 0;
+BOOL (WINAPI *MyAnimateWindow)(HWND hWnd,DWORD dwTime,DWORD dwFlags) = 0;
+HMONITOR (WINAPI *MyMonitorFromPoint)(POINT, DWORD);
+BOOL (WINAPI *MyGetMonitorInfo)(HMONITOR, LPMONITORINFO);
+HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind) = 0;
+
+unsigned int uintMessagePumpThreadId = 0;
+POINT pt = {-1};
+UINT WaitForContentTimerID = 0;
+bool bAvatarReady = false;
+bool bStatusMsgReady = false;
+
+__inline bool IsContactTooltip(CLCINFOTIPEX *clc)
+{
+ return (clc->szProto || clc->swzText) == false;
+}
+
+void CALLBACK TimerProcWaitForContent(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+{
+ KillTimer(0, WaitForContentTimerID);
+ WaitForContentTimerID = 0;
+ bStatusMsgReady = true;
+ bAvatarReady = true;
+ PostMPMessage(MUM_CREATEPOPUP, 0, 0);
+}
+
+bool NeedWaitForContent(CLCINFOTIPEX *clcitex)
+{
+ bool bNeedWait = false;
+
+ if (opt.bWaitForContent && IsContactTooltip(clcitex))
+ {
+ char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)clcitex->hItem, 0);
+ if (!szProto) return false;
+
+ if (opt.bWaitForStatusMsg && !bStatusMsgReady)
+ {
+ DBDeleteContactSetting(clcitex->hItem, MODULE, "TempStatusMsg");
+ if (CanRetrieveStatusMsg(clcitex->hItem, szProto) &&
+ CallContactService(clcitex->hItem, PSS_GETAWAYMSG, 0, 0))
+ {
+ if (WaitForContentTimerID)
+ KillTimer(0, WaitForContentTimerID);
+
+ WaitForContentTimerID = SetTimer(NULL, 0, WAIT_TIMER_INTERVAL, TimerProcWaitForContent);
+ bNeedWait = true;
+ }
+ }
+
+ if (opt.bWaitForAvatar && !bAvatarReady &&
+ CallProtoService(szProto, PS_GETAVATARCAPS, AF_ENABLED, 0))
+ {
+ DBVARIANT dbv;
+ if (!DBGetContactSettingString(clcitex->hItem, "ContactPhoto", "File", &dbv))
+ {
+ if (!strstr(dbv.pszVal, ".xml"))
+ {
+ AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)clcitex->hItem, 0);
+ if (!ace)
+ {
+ if (WaitForContentTimerID)
+ KillTimer(0, WaitForContentTimerID);
+
+ WaitForContentTimerID = SetTimer(NULL, 0, WAIT_TIMER_INTERVAL, TimerProcWaitForContent);
+ bNeedWait = true;
+ }
+ else
+ bAvatarReady = true;
+ }
+ else
+ bAvatarReady = true;
+
+ DBFreeVariant(&dbv);
+ }
+ else
+ bAvatarReady = true;
+ }
+
+ }
+
+ return bNeedWait;
+}
+
+unsigned int CALLBACK MessagePumpThread(void *param)
+{
+ HWND hwndTip = 0;
+ CLCINFOTIPEX *clcitex = 0;
+
+ MSG hwndMsg = {0};
+ while (GetMessage(&hwndMsg, 0, 0, 0) > 0 && !Miranda_Terminated())
+ {
+ if (!IsDialogMessage(hwndMsg.hwnd, &hwndMsg))
+ {
+ switch (hwndMsg.message)
+ {
+ case MUM_CREATEPOPUP:
+ {
+ if (!clcitex)
+ {
+ if (hwndMsg.lParam) clcitex = (CLCINFOTIPEX *)hwndMsg.lParam;
+ else break;
+ }
+
+ if (!NeedWaitForContent(clcitex))
+ {
+ if (hwndTip) MyDestroyWindow(hwndTip);
+ hwndTip = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, POP_WIN_CLASS, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, hInst, (LPVOID)clcitex);
+
+ if (clcitex)
+ {
+ mir_free(clcitex);
+ clcitex = 0;
+ }
+
+ bStatusMsgReady = false;
+ bAvatarReady = false;
+ }
+ break;
+ }
+ case MUM_DELETEPOPUP:
+ {
+ if (hwndTip)
+ {
+ MyDestroyWindow(hwndTip);
+ hwndTip = 0;
+ }
+
+ if (clcitex)
+ {
+ mir_free(clcitex);
+ clcitex = 0;
+ }
+
+ bStatusMsgReady = false;
+ bAvatarReady = false;
+ break;
+ }
+ case MUM_GOTSTATUS:
+ {
+ HANDLE hContact = (HANDLE)hwndMsg.wParam;
+ TCHAR *swzMsg = (TCHAR *)hwndMsg.lParam;
+
+ if (opt.bWaitForContent &&
+ bStatusMsgReady == false &&
+ clcitex &&
+ clcitex->hItem == hContact)
+ {
+ if (WaitForContentTimerID)
+ {
+ KillTimer(0, WaitForContentTimerID);
+ WaitForContentTimerID = 0;
+ }
+
+ if (swzMsg)
+ {
+ DBWriteContactSettingTString(clcitex->hItem, MODULE, "TempStatusMsg", swzMsg);
+ mir_free(swzMsg);
+ }
+
+ bStatusMsgReady = true;
+ PostMPMessage(MUM_CREATEPOPUP, 0, 0);
+ }
+ else if (!opt.bWaitForContent && hwndTip)
+ SendMessage(hwndTip, PUM_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)swzMsg);
+ else if (swzMsg)
+ mir_free(swzMsg);
+
+ break;
+ }
+ case MUM_GOTXSTATUS:
+ {
+ if (hwndTip && !opt.bWaitForContent)
+ SendMessage(hwndTip, PUM_SHOWXSTATUS, hwndMsg.wParam, 0);
+ break;
+ }
+ case MUM_GOTAVATAR:
+ {
+ HANDLE hContact = (HANDLE)hwndMsg.wParam;
+
+ if (opt.bWaitForContent &&
+ bAvatarReady == false &&
+ clcitex &&
+ clcitex->hItem == hContact)
+ {
+ if (WaitForContentTimerID)
+ {
+ KillTimer(0, WaitForContentTimerID);
+ WaitForContentTimerID = 0;
+ }
+
+ bAvatarReady = true;
+ PostMPMessage(MUM_CREATEPOPUP, 0, 0);
+ }
+ else if (!opt.bWaitForContent && hwndTip)
+ SendMessage(hwndTip, PUM_SETAVATAR, hwndMsg.wParam, 0);
+
+ break;
+ }
+ default:
+ {
+ TranslateMessage(&hwndMsg);
+ DispatchMessage(&hwndMsg);
+ break;
+ }
+ }
+ }
+ }
+
+ return 0;
+}
+
+void PostMPMessage(UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ PostThreadMessage(uintMessagePumpThreadId, msg, wParam, lParam);
+}
+
+void InitMessagePump()
+{
+ WNDCLASSEX wcl = {0};
+ wcl.cbSize = sizeof(wcl);
+ wcl.lpfnWndProc = PopupWindowProc;
+ wcl.hInstance = hInst;
+ wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
+ wcl.lpszClassName = POP_WIN_CLASS;
+ RegisterClassEx(&wcl);
+
+ HMODULE hUserDll = LoadLibrary(_T("user32.dll"));
+ if (hUserDll)
+ {
+ MySetLayeredWindowAttributes = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(hUserDll, "SetLayeredWindowAttributes");
+ MyUpdateLayeredWindow = (BOOL (WINAPI *)(HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags))GetProcAddress(hUserDll, "UpdateLayeredWindow");
+ MyAnimateWindow =(BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(hUserDll, "AnimateWindow");
+ MyMonitorFromPoint = (HMONITOR (WINAPI*)(POINT, DWORD))GetProcAddress(hUserDll, "MonitorFromPoint");
+#ifdef _UNICODE
+ MyGetMonitorInfo = (BOOL (WINAPI*)(HMONITOR, LPMONITORINFO))GetProcAddress(hUserDll, "GetMonitorInfoW");
+#else
+ MyGetMonitorInfo = (BOOL (WINAPI*)(HMONITOR, LPMONITORINFO))GetProcAddress(hUserDll, "GetMonitorInfoA");
+#endif
+ }
+
+ HMODULE hDwmapiDll = LoadLibrary(_T("dwmapi.dll"));
+ if (hDwmapiDll)
+ MyDwmEnableBlurBehindWindow = (HRESULT (WINAPI *)(HWND, DWM_BLURBEHIND *))GetProcAddress(hDwmapiDll, "DwmEnableBlurBehindWindow");
+
+ CloseHandle(mir_forkthreadex(MessagePumpThread, NULL, 0, &uintMessagePumpThreadId));
+}
+
+void DeinitMessagePump()
+{
+ PostMPMessage(WM_QUIT, 0, 0);
+ UnregisterClass(POP_WIN_CLASS, hInst);
+}
+
+INT_PTR ShowTip(WPARAM wParam, LPARAM lParam)
+{
+ CLCINFOTIP *clcit = (CLCINFOTIP *)lParam;
+ HWND clist = (HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0);
+
+ if (clcit->isGroup) return 0; // no group tips (since they're pretty useless)
+ if (clcit->isTreeFocused == 0 && opt.bShowNoFocus == false && clist == WindowFromPoint(clcit->ptCursor)) return 0;
+ if (clcit->ptCursor.x == pt.x && clcit->ptCursor.y == pt.y) return 0;
+ pt.x = pt.y = 0;
+
+ CLCINFOTIPEX *clcit2 = (CLCINFOTIPEX *)mir_alloc(sizeof(CLCINFOTIPEX));
+ memcpy(clcit2, clcit, sizeof(CLCINFOTIP));
+ clcit2->cbSize = sizeof(CLCINFOTIPEX);
+ clcit2->szProto = NULL;
+ clcit2->swzText = NULL;
+
+ if (wParam) // wParam is char pointer containing text - e.g. status bar tooltip
+ {
+ clcit2->swzText = a2t((char *)wParam);
+ GetCursorPos(&clcit2->ptCursor);
+ }
+
+ PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)clcit2);
+ return 1;
+}
+
+int ShowTipHook(WPARAM wParam, LPARAM lParam)
+{
+ ShowTip(wParam, lParam);
+ return 0;
+}
+
+INT_PTR ShowTipW(WPARAM wParam, LPARAM lParam)
+{
+ CLCINFOTIP *clcit = (CLCINFOTIP *)lParam;
+ HWND clist = (HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0);
+
+ if (clcit->isGroup) return 0; // no group tips (since they're pretty useless)
+ if (clcit->isTreeFocused == 0 && opt.bShowNoFocus == false && clist == WindowFromPoint(clcit->ptCursor)) return 0;
+ if (clcit->ptCursor.x == pt.x && clcit->ptCursor.y == pt.y) return 0;
+ pt.x = pt.y = -1;
+
+ CLCINFOTIPEX *clcit2 = (CLCINFOTIPEX *)mir_alloc(sizeof(CLCINFOTIPEX));
+ memcpy(clcit2, clcit, sizeof(CLCINFOTIP));
+ clcit2->cbSize = sizeof(CLCINFOTIPEX);
+ clcit2->szProto = NULL;
+ clcit2->swzText = NULL;
+
+ if (wParam) // wParam is char pointer containing text - e.g. status bar tooltip
+ {
+ clcit2->swzText = mir_tstrdup((TCHAR *)wParam);
+ GetCursorPos(&clcit2->ptCursor);
+ }
+
+ PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)clcit2);
+ return 1;
+}
+
+INT_PTR HideTip(WPARAM wParam, LPARAM lParam)
+{
+ //CLCINFOTIP *clcit = (CLCINFOTIP *)lParam;
+ if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
+ return 0;
+
+ GetCursorPos(&pt);
+ PostMPMessage(MUM_DELETEPOPUP, 0, 0);
+ return 1;
+}
+
+int HideTipHook(WPARAM wParam, LPARAM lParam)
+{
+ HideTip(wParam, lParam);
+ return 0;
+}
+
+int ProtoAck(WPARAM wParam, LPARAM lParam)
+{
+ DBVARIANT dbv;
+ ACKDATA *ack = (ACKDATA *)lParam;
+ if (ack->result != ACKRESULT_SUCCESS)
+ return 0;
+
+ if (ack->type == ACKTYPE_AWAYMSG)
+ {
+ if (!DBGetContactSettingTString(ack->hContact, "CList", "StatusMsg", &dbv))
+ {
+ if (dbv.ptszVal[0])
+ PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)mir_tstrdup(dbv.ptszVal));
+
+ DBFreeVariant(&dbv);
+ }
+ }
+ else if (ack->type == ICQACKTYPE_XSTATUS_RESPONSE)
+ {
+ PostMPMessage(MUM_GOTXSTATUS, (WPARAM)ack->hContact, 0);
+ }
+
+ return 0;
+}
+
+int AvatarChanged(WPARAM wParam, LPARAM lParam)
+{
+ HANDLE hContact = (HANDLE)wParam;
+ PostMPMessage(MUM_GOTAVATAR, (WPARAM)hContact, 0);
+ return 0;
+}
+
+int FramesShowSBTip(WPARAM wParam, LPARAM lParam)
+{
+ if (opt.bStatusBarTips)
+ {
+ char *szProto = (char *)wParam;
+
+ CLCINFOTIPEX *clcit2 = (CLCINFOTIPEX *)mir_alloc(sizeof(CLCINFOTIPEX));
+ memset(clcit2, 0, sizeof(CLCINFOTIPEX));
+ clcit2->cbSize = sizeof(CLCINFOTIPEX);
+ clcit2->szProto= szProto; // assume static string
+ GetCursorPos(&clcit2->ptCursor);
+
+ PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)clcit2);
+ return 1;
+ }
+ return 0;
+}
+
+int FramesHideSBTip(WPARAM wParam, LPARAM lParam)
+{
+ if (opt.bStatusBarTips)
+ {
+ PostMPMessage(MUM_DELETEPOPUP, 0, 0);
+ return 1;
+ }
+ return 0;
+}
+
+BOOL MyDestroyWindow(HWND hwnd)
+{
+ SendMessage(hwnd, PUM_FADEOUTWINDOW, 0, 0);
+ return DestroyWindow(hwnd);
+}
\ No newline at end of file diff --git a/plugins/TipperYM/message_pump.h b/plugins/TipperYM/message_pump.h new file mode 100644 index 0000000000..a8858e3865 --- /dev/null +++ b/plugins/TipperYM/message_pump.h @@ -0,0 +1,71 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _MESSAGE_PUMP_INC
+#define _MESSAGE_PUMP_INC
+
+#define WAIT_TIMER_INTERVAL 500
+
+#define MUM_CREATEPOPUP (WM_USER + 0x011)
+#define MUM_DELETEPOPUP (WM_USER + 0x012)
+#define MUM_GOTSTATUS (WM_USER + 0x013)
+#define MUM_GOTAVATAR (WM_USER + 0x014)
+#define MUM_GOTXSTATUS (WM_USER + 0x015)
+
+extern BOOL (WINAPI *MySetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
+extern BOOL (WINAPI *MyUpdateLayeredWindow)(HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags);
+extern BOOL (WINAPI *MyAnimateWindow)(HWND hWnd,DWORD dwTime,DWORD dwFlags);
+extern HMONITOR (WINAPI *MyMonitorFromPoint)(POINT, DWORD);
+extern BOOL (WINAPI *MyGetMonitorInfo)(HMONITOR, LPMONITORINFO);
+
+#define DWM_BB_ENABLE 0x00000001
+#define DWM_BB_BLURREGION 0x00000002
+#define DWM_BB_TRANSITIONONMAXIMIZED 0x00000004
+struct DWM_BLURBEHIND
+{
+ DWORD dwFlags;
+ BOOL fEnable;
+ HRGN hRgnBlur;
+ BOOL fTransitionOnMaximized;
+};
+
+extern HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind);
+
+void InitMessagePump();
+void DeinitMessagePump();
+
+INT_PTR ShowTip(WPARAM wParam, LPARAM lParam);
+INT_PTR ShowTipW(WPARAM wParam, LPARAM lParam);
+INT_PTR HideTip(WPARAM wParam, LPARAM lParam);
+
+int ShowTipHook(WPARAM wParam, LPARAM lParam);
+int HideTipHook(WPARAM wParam, LPARAM lParam);
+
+int FramesShowSBTip(WPARAM wParam, LPARAM lParam);
+int FramesHideSBTip(WPARAM wParam, LPARAM lParam);
+
+int ProtoAck(WPARAM wParam, LPARAM lParam);
+int AvatarChanged(WPARAM wParam, LPARAM lParam);
+
+BOOL MyDestroyWindow(HWND hwnd);
+void PostMPMessage(UINT msg, WPARAM, LPARAM);
+
+
+#endif
diff --git a/plugins/TipperYM/mir_smileys.cpp b/plugins/TipperYM/mir_smileys.cpp new file mode 100644 index 0000000000..23fce34db2 --- /dev/null +++ b/plugins/TipperYM/mir_smileys.cpp @@ -0,0 +1,514 @@ +/*
+Copyright (C) 2005 Ricardo Pescuma Domenecci
+Copyright (C) 2007-2010 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#include "common.h"
+#include "options.h"
+#include "mir_smileys.h"
+
+
+
+void *mir_alloc0(size_t size)
+{
+ void *ptr = mir_alloc(size);
+ if (ptr) memset(ptr, 0, size);
+
+ return ptr;
+}
+
+int InitTipperSmileys()
+{
+ // Register smiley category
+ if (ServiceExists(MS_SMILEYADD_REGISTERCATEGORY))
+ {
+ SMADD_REGCAT rc;
+ rc.cbSize = sizeof(rc);
+ rc.name = "tipper";
+ rc.dispname = Translate("Tipper smileys");
+ CallService(MS_SMILEYADD_REGISTERCATEGORY, 0, (LPARAM)&rc);
+ }
+
+ return 0;
+}
+
+SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *protocol)
+{
+ if (!(opt.iSmileyAddFlags & SMILEYADD_ENABLE))
+ return NULL;
+
+ if (nCount == -1)
+ nCount = (int)lstrlen(lpString);
+
+ SMILEYPARSEINFO info = (SMILEYPARSEINFO) mir_alloc0(sizeof(tagSMILEYPARSEINFO));
+ info->pieces = ReplaceSmileys(lpString, nCount, protocol, &info->max_height);
+
+ if (!info->pieces)
+ {
+ mir_free(info);
+ return NULL;
+ }
+
+ return info;
+}
+
+void Smileys_FreeParse(SMILEYPARSEINFO parseInfo)
+{
+ if (parseInfo != NULL)
+ {
+ if (parseInfo->pieces != NULL)
+ DestroySmileyList(parseInfo->pieces);
+
+ mir_free(parseInfo);
+ }
+}
+
+// Similar to DrawText win32 api function
+// Pass uFormat | DT_CALCRECT to calc rectangle to be returned by lpRect
+// parseInfo is optional (pass NULL and it will be calculated and deleted inside function
+int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, const char *protocol, SMILEYPARSEINFO parseInfo)
+{
+ int result;
+
+ if (nCount == -1)
+ nCount = (int)lstrlen(lpString);
+
+ if (uFormat & DT_CALCRECT)
+ {
+ SIZE text_size = GetTextSize(hDC, lpString, parseInfo, uFormat, parseInfo->max_height, (lpRect->right - lpRect->left));
+ lpRect->bottom = text_size.cy;
+
+ if (text_size.cx < lpRect->right - lpRect->left)
+ {
+ if (uFormat & DT_RIGHT)
+ lpRect->left = lpRect->right - text_size.cx;
+ else
+ lpRect->right = lpRect->left + text_size.cx;
+ }
+
+ result = text_size.cy;
+ }
+ else
+ {
+ // Draw
+ if (parseInfo->pieces == NULL)
+ {
+ result = DrawText(hDC, lpString, nCount, lpRect, uFormat);
+ }
+ else
+ {
+ RECT rc = *lpRect;
+ SIZE text_size = GetTextSize(hDC, lpString, parseInfo, uFormat, parseInfo->max_height, (lpRect->right - lpRect->left));
+
+ if (text_size.cx < rc.right - rc.left)
+ {
+ if (uFormat & DT_RIGHT)
+ rc.left = rc.right - text_size.cx;
+ else
+ rc.right = rc.left + text_size.cx;
+ }
+
+ result = text_size.cy;
+ DrawTextSmiley(hDC, rc, lpString, nCount, parseInfo, uFormat, parseInfo->max_height);
+ }
+ }
+
+ return result;
+}
+
+SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_smiley_height, int max_width)
+{
+ SIZE text_size = {0};
+ int text_height;
+ int row_count = 0, pos_x = 0;
+
+ if (szText == NULL || _tcsclen(szText) == 0)
+ {
+ text_size.cy = 0;
+ text_size.cx = 0;
+ }
+ else
+ {
+ RECT text_rc = {0, 0, 2048, 2048};
+
+ if (info->pieces == NULL)
+ {
+ DrawText(hdcMem, szText, -1, &text_rc, DT_CALCRECT | uTextFormat);
+ text_size.cx = text_rc.right - text_rc.left;
+ text_size.cy = text_rc.bottom - text_rc.top;
+ }
+ else
+ {
+ // Get real height of the line
+ text_height = DrawText(hdcMem, _T("A"), 1, &text_rc, DT_CALCRECT | uTextFormat);
+
+ // See each item of list
+ int i;
+ for (i = 0; i < info->pieces->realCount; i++)
+ {
+ TEXTPIECE *piece = (TEXTPIECE *) info->pieces->items[i];
+ info->row_height[row_count] = max(info->row_height[row_count], text_height);
+
+ if (piece->type == TEXT_PIECE_TYPE_TEXT)
+ {
+ RECT text_rc = {0, 0, 2048, 2048};
+
+ DrawText(hdcMem, szText + piece->start_pos, piece->len, &text_rc, DT_CALCRECT | uTextFormat);
+ pos_x += (text_rc.right - text_rc.left);
+ if (pos_x > max_width)
+ {
+ text_size.cx = max(text_size.cx, pos_x - (text_rc.right - text_rc.left));
+ pos_x = text_rc.right - text_rc.left;
+ info->row_height[++row_count] = text_height;
+ }
+
+ if (szText[piece->start_pos + piece->len - 1] == '\n')
+ {
+ text_size.cx = max(text_size.cx, pos_x);
+ pos_x = 0;
+ info->row_height[++row_count] = 0;
+ }
+
+ }
+ else
+ {
+ double factor;
+
+ if (uTextFormat & DT_RESIZE_SMILEYS && piece->smiley_height > text_height)
+ factor = text_height / (double) piece->smiley_height;
+ else
+ factor = 1;
+
+ info->row_height[row_count] = max(info->row_height[row_count], piece->smiley_height * factor);
+
+ pos_x += piece->smiley_width * factor;
+ if (pos_x > max_width)
+ {
+ text_size.cx = max(text_size.cx, pos_x - (piece->smiley_width * factor));
+ pos_x = piece->smiley_width * factor;
+ info->row_height[++row_count] = piece->smiley_height * factor;
+ }
+ }
+ }
+
+ text_size.cx = max(text_size.cx, pos_x);
+ for (i = 0; i < row_count + 1; i++)
+ text_size.cy += info->row_height[i];
+ }
+ }
+
+ return text_size;
+}
+
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat, int max_smiley_height)
+{
+ if (szText == NULL)
+ return;
+
+ uTextFormat &= ~DT_RIGHT;
+
+ // Draw list
+ int text_height, i, shift;
+ int row_count = 0, pos_x = 0;
+
+ RECT tmp_rc = free_rc;
+
+ if (uTextFormat & DT_RTLREADING)
+ i = info->pieces->realCount - 1;
+ else
+ i = 0;
+
+ // Get real height of the line
+ text_height = DrawText(hdcMem, _T("A"), 1, &tmp_rc, DT_CALCRECT | uTextFormat);
+
+ if (IsWinVer2000Plus())
+ SaveAlpha(&free_rc);
+
+ // Just draw ellipsis
+ if (free_rc.right <= free_rc.left)
+ {
+ DrawText(hdcMem, _T("..."), 3, &free_rc, uTextFormat & ~DT_END_ELLIPSIS);
+ }
+ else
+ {
+ // Draw text and smileys
+ RECT text_rc = free_rc;
+ for (; i < info->pieces->realCount && i >= 0 && len > 0; i += (uTextFormat & DT_RTLREADING ? -1 : 1))
+ {
+ TEXTPIECE *piece = (TEXTPIECE *) info->pieces->items[i];
+
+ if (uTextFormat & DT_RTLREADING)
+ text_rc.right = free_rc.right - pos_x;
+ else
+ text_rc.left = free_rc.left + pos_x;
+
+ if (piece->type == TEXT_PIECE_TYPE_TEXT)
+ {
+ tmp_rc = text_rc;
+ tmp_rc.right = 2048;
+
+ DrawText(hdcMem, szText + piece->start_pos, min(len, piece->len), &tmp_rc, DT_CALCRECT | (uTextFormat & ~DT_END_ELLIPSIS));
+
+ pos_x += (tmp_rc.right - tmp_rc.left);
+ if (pos_x > (free_rc.right - free_rc.left))
+ {
+ pos_x = tmp_rc.right - tmp_rc.left;
+ text_rc.left = free_rc.left;
+ text_rc.right = free_rc.right;
+ text_rc.top += info->row_height[row_count];
+ row_count++;
+ }
+
+ shift = (info->row_height[row_count] - text_height) >> 1;
+ text_rc.top += shift;
+
+ if (uTextFormat & DT_RTLREADING)
+ text_rc.left = max(text_rc.left, text_rc.right - (tmp_rc.right - tmp_rc.left));
+
+ DrawText(hdcMem, szText + piece->start_pos, min(len, piece->len), &text_rc, uTextFormat);
+ len -= piece->len;
+ text_rc.top -= shift;
+
+ if (szText[piece->start_pos + piece->len - 1] == '\n')
+ {
+ text_rc.left = free_rc.left;
+ text_rc.right = free_rc.right;
+ text_rc.top += info->row_height[row_count];
+ pos_x = 0;
+ row_count++;
+ }
+ }
+ else
+ {
+ double factor;
+
+ if (len < piece->len)
+ {
+ len = 0;
+ }
+ else
+ {
+ len -= piece->len;
+
+ if (uTextFormat & DT_RESIZE_SMILEYS && piece->smiley_height > text_height)
+ factor = text_height / (double) piece->smiley_height;
+ else
+ factor = 1;
+
+ if (uTextFormat & DT_RTLREADING)
+ text_rc.left = max(text_rc.right - (int)(piece->smiley_width * factor), text_rc.left);
+
+ pos_x += piece->smiley_width * factor;
+ if (pos_x > (free_rc.right - free_rc.left))
+ {
+ pos_x = piece->smiley_width * factor;
+ text_rc.left = free_rc.left;
+ text_rc.right = free_rc.right;
+ text_rc.top += info->row_height[row_count];
+ row_count++;
+ }
+
+ shift = (info->row_height[row_count] - (LONG)(piece->smiley_height * factor)) >> 1;
+ DrawIconExAlpha(hdcMem, text_rc.left, text_rc.top + shift, piece->smiley, piece->smiley_width * factor, piece->smiley_height * factor, 0, NULL, DI_NORMAL, true);
+ }
+ }
+ }
+ }
+
+ if (IsWinVer2000Plus())
+ RestoreAlpha(&free_rc);
+}
+
+void DestroySmileyList(SortedList* p_list)
+{
+ if (p_list == NULL)
+ return;
+
+ if (p_list->items != NULL)
+ {
+ int i;
+ for (i = 0 ; i < p_list->realCount ; i++)
+ {
+ TEXTPIECE *piece = (TEXTPIECE *)p_list->items[i];
+ if (piece != NULL)
+ {
+ if (piece->type == TEXT_PIECE_TYPE_SMILEY)
+ DestroyIcon(piece->smiley);
+
+ mir_free(piece); //this free the p_list->items[i]
+ }
+ }
+ }
+ li.List_Destroy(p_list); //this free the p_list->items member
+ mir_free(p_list); //this free the p_list itself (alloc by li.List_Create)
+}
+
+// Generete the list of smileys / text to be drawn
+SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height)
+{
+ SMADD_BATCHPARSE2 sp = {0};
+ SMADD_BATCHPARSERES *spres;
+ char smileyProto[64];
+
+ *max_smiley_height = 0;
+
+ if (!text || !text[0] || !ServiceExists(MS_SMILEYADD_BATCHPARSE))
+ return NULL;
+
+ if (protocol == NULL)
+ strcpy(smileyProto, "tipper");
+ else if (strcmp(protocol, szMetaModuleName) == 0)
+ strcpy(smileyProto, "tipper");
+ else
+ strcpy(smileyProto, protocol);
+
+ // Parse it!
+ sp.cbSize = sizeof(sp);
+ sp.str = (TCHAR *)text;
+ sp.flag = SAFL_TCHAR;
+ sp.Protocolname = (opt.iSmileyAddFlags & SMILEYADD_USEPROTO) ? smileyProto : "tipper";
+ spres = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp);
+
+ if (!spres) // Did not find a smiley
+ return NULL;
+
+ // Lets add smileys
+ SortedList *plText = li.List_Create(0, 10);
+
+ TCHAR *word_start, *word_end;
+ TCHAR *smiley_start, *smiley_end;
+ TCHAR *last_text_pos = _tcsninc(text, text_size);
+
+ word_start = word_end = (TCHAR *)text;
+
+ for (unsigned i = 0; i < sp.numSmileys; i++)
+ {
+ // Get smile position
+ smiley_start = _tcsninc(text, spres[i].startChar);
+ smiley_end = _tcsninc(smiley_start, spres[i].size);
+
+ if (spres[i].hIcon) // For deffective smileypacks
+ {
+ if (opt.iSmileyAddFlags & SMILEYADD_ONLYISOLATED)
+ {
+ if ((smiley_start > text && *(smiley_start - 1) != ' ' && *(smiley_start - 1) != '\n' && *smiley_end != '\r') ||
+ (*smiley_end != '\0' && *smiley_end != ' ' && *smiley_end != '\n' && *smiley_end != '\r'))
+ continue;
+ }
+
+ // Add text
+ while (word_end != smiley_start)
+ {
+ while (word_end[0] != ' ' && word_end[0] != '\n')
+ word_end++;
+
+ if (word_end > smiley_start)
+ word_end = smiley_start;
+ else
+ word_end++;
+
+ if (word_end > word_start)
+ {
+ TEXTPIECE *piece = (TEXTPIECE *)mir_alloc0(sizeof(TEXTPIECE));
+ piece->type = TEXT_PIECE_TYPE_TEXT;
+ piece->start_pos = word_start - text;
+ piece->len = word_end - word_start;
+ li.List_Insert(plText, piece, plText->realCount);
+ word_start = word_end;
+ }
+ }
+
+ // Add smiley
+ {
+ BITMAP bm;
+ ICONINFO icon;
+ TEXTPIECE *piece = (TEXTPIECE *) mir_alloc0(sizeof(TEXTPIECE));
+
+ piece->type = TEXT_PIECE_TYPE_SMILEY;
+ piece->len = spres[i].size;
+ piece->smiley = spres[i].hIcon;
+
+ piece->smiley_width = 16;
+ piece->smiley_height = 16;
+ if (GetIconInfo(piece->smiley, &icon))
+ {
+ if (GetObject(icon.hbmColor, sizeof(BITMAP), &bm))
+ {
+ piece->smiley_width = bm.bmWidth;
+ piece->smiley_height = bm.bmHeight;
+ }
+
+ DeleteObject(icon.hbmMask);
+ DeleteObject(icon.hbmColor);
+ }
+
+ *max_smiley_height = max(piece->smiley_height, *max_smiley_height);
+ li.List_Insert(plText, piece, plText->realCount);
+ }
+
+ word_start = word_end = smiley_end;
+ }
+ }
+
+ // Add rest of the text
+ while (word_end != last_text_pos)
+ {
+ while (word_end[0] && word_end[0] != ' ' && word_end[0] != '\n')
+ word_end++;
+
+ if (word_end[0])
+ word_end++;
+
+ if (word_end > word_start)
+ {
+ TEXTPIECE *piece = (TEXTPIECE *)mir_alloc0(sizeof(TEXTPIECE));
+ piece->type = TEXT_PIECE_TYPE_TEXT;
+ piece->start_pos = word_start - text;
+ piece->len = word_end - word_start;
+ li.List_Insert(plText, piece, plText->realCount);
+ word_start = word_end;
+ }
+
+ }
+
+ CallService(MS_SMILEYADD_BATCHFREE, 0, (LPARAM)spres);
+
+ return plText;
+}
+
+int DrawTextExt(HDC hdc, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, LPCSTR lpProto, SMILEYPARSEINFO spi)
+{
+ if ((opt.iSmileyAddFlags & SMILEYADD_ENABLE) && spi != NULL)
+ {
+ if (opt.iSmileyAddFlags & SMILEYADD_RESIZE)
+ uFormat |= DT_RESIZE_SMILEYS;
+
+ return Smileys_DrawText(hdc, lpString, nCount, lpRect, uFormat, lpProto, spi);
+ }
+ else
+ {
+ if (uFormat & DT_CALCRECT)
+ {
+ return DrawText(hdc, lpString, nCount, lpRect, uFormat);
+ }
+ else
+ {
+ return DrawTextAlpha(hdc, lpString, nCount, lpRect, uFormat);
+ }
+ }
+}
diff --git a/plugins/TipperYM/mir_smileys.h b/plugins/TipperYM/mir_smileys.h new file mode 100644 index 0000000000..5f78ac8f09 --- /dev/null +++ b/plugins/TipperYM/mir_smileys.h @@ -0,0 +1,70 @@ +/*
+Copyright (C) 2005 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#ifndef __MIR_SMILEYS_H__
+#define __MIR_SMILEYS_H__
+
+#define DT_RESIZE_SMILEYS 0x10000000
+
+// smileyadd options
+#define SMILEYADD_ENABLE 1
+#define SMILEYADD_USEPROTO 2
+#define SMILEYADD_ONLYISOLATED 4
+#define SMILEYADD_RESIZE 8
+
+#define TEXT_PIECE_TYPE_TEXT 0
+#define TEXT_PIECE_TYPE_SMILEY 1
+
+typedef struct {
+ int type;
+ int len;
+ union
+ {
+ struct
+ {
+ int start_pos;
+ };
+ struct
+ {
+ HICON smiley;
+ int smiley_width;
+ int smiley_height;
+ };
+ };
+} TEXTPIECE;
+
+typedef struct tagSMILEYPARSEINFO {
+ SortedList *pieces;
+ int row_height[512]; // max 512 rows
+ int max_height;
+} *SMILEYPARSEINFO;
+
+int InitTipperSmileys();
+SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *protocol);
+void Smileys_FreeParse(SMILEYPARSEINFO parseInfo);
+
+SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height);
+SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_smiley_height, int max_width);
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat, int max_smiley_height);
+void DestroySmileyList(SortedList* p_list);
+
+int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, const char *protocol, SMILEYPARSEINFO parseInfo);
+int DrawTextExt(HDC hdc, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, LPCSTR lpProto, SMILEYPARSEINFO spi);
+
+#endif // __MIR_SMILEYS_H__
diff --git a/plugins/TipperYM/options.cpp b/plugins/TipperYM/options.cpp new file mode 100644 index 0000000000..5c6e8e049e --- /dev/null +++ b/plugins/TipperYM/options.cpp @@ -0,0 +1,2508 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#include "common.h"
+#include "options.h"
+#include "popwin.h"
+#include "str_utils.h"
+#include "message_pump.h"
+#include "preset_items.h"
+#include "skin_parser.h"
+
+OPTIONS opt;
+ICONSTATE exIcons[EXICONS_COUNT];
+
+extern TOOLTIPSKIN skin;
+extern int ReloadFont(WPARAM wParam, LPARAM lParam);
+
+
+extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip)
+{
+ if (swzProto == NULL)
+ return 0;
+
+ char szSetting[64];
+ if (bExtendedTip)
+ strcpy(szSetting, "TrayProtocolsEx");
+ else
+ strcpy(szSetting, "TrayProtocols");
+
+ DBVARIANT dbv;
+ int result = 1;
+ if (!DBGetContactSettingTString(NULL, MODULE, szSetting, &dbv))
+ {
+ result = _tcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
+ DBFreeVariant(&dbv);
+ }
+
+ return result;
+}
+
+void CreateDefaultItems()
+{
+ DSListNode *ds_node;
+ DIListNode *di_node;
+
+ for (int i = 0; defaultItemList[i].szName; i++)
+ {
+ if (defaultItemList[i].szName[0] == '-')
+ {
+ di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ _tcsncpy(di_node->di.swzLabel, _T(""), LABEL_LEN);
+ _tcsncpy(di_node->di.swzValue, _T(""), VALUE_LEN);
+ di_node->di.bLineAbove = true;
+ di_node->di.bIsVisible = true;
+ di_node->di.bParseTipperVarsFirst = false;
+ di_node->next = opt.diList;
+ opt.diList = di_node;
+ opt.iDiCount++;
+ }
+ else
+ {
+ PRESETITEM *item = GetPresetItemByName(defaultItemList[i].szName);
+ if (item == NULL) continue;
+
+ for (int j = 0; j < MAX_PRESET_SUBST_COUNT; j++)
+ {
+ PRESETSUBST *subst = GetPresetSubstByName(item->szNeededSubst[j]);
+ if (subst == NULL) continue;
+
+ ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
+ _tcsncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
+ ds_node->ds.type = subst->type;
+ strncpy(ds_node->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN);
+ ds_node->ds.iTranslateFuncId = subst->iTranslateFuncId;
+ ds_node->next = opt.dsList;
+ opt.dsList = ds_node;
+ opt.iDsCount++;
+ }
+
+ di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ _tcsncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
+ _tcsncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
+ di_node->di.bLineAbove = false;
+ di_node->di.bValueNewline = defaultItemList[i].bValueNewline;
+ di_node->di.bIsVisible = true;
+ di_node->di.bParseTipperVarsFirst = false;
+ di_node->next = opt.diList;
+ opt.diList = di_node;
+ opt.iDiCount++;
+ }
+ }
+}
+
+
+bool LoadDS(DISPLAYSUBST *ds, int index)
+{
+ char setting[512];
+ DBVARIANT dbv;
+
+ mir_snprintf(setting, SIZEOF(setting), "Name%d", index);
+ ds->swzName[0] = 0;
+ if (!DBGetContactSettingTString(0, MODULE_ITEMS, setting, &dbv))
+ {
+ _tcsncpy(ds->swzName, dbv.ptszVal, SIZEOF(ds->swzName));
+ ds->swzName[SIZEOF(ds->swzName) - 1] = 0;
+ DBFreeVariant(&dbv);
+ } else
+ return false;
+
+ mir_snprintf(setting, SIZEOF(setting), "Type%d", index);
+ ds->type = (DisplaySubstType)DBGetContactSettingByte(0, MODULE_ITEMS, setting, DVT_PROTODB);
+
+ mir_snprintf(setting, SIZEOF(setting), "Module%d", index);
+ ds->szModuleName[0] = 0;
+ if (!DBGetContactSetting(0, MODULE_ITEMS, setting, &dbv))
+ {
+ strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN);
+ ds->szModuleName[MODULE_NAME_LEN - 1] = 0;
+ DBFreeVariant(&dbv);
+ }
+
+ mir_snprintf(setting, SIZEOF(setting), "Setting%d", index);
+ ds->szSettingName[0] = 0;
+ if (!DBGetContactSetting(0, MODULE_ITEMS, setting, &dbv))
+ {
+ strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN);
+ ds->szSettingName[SETTING_NAME_LEN - 1] = 0;
+ DBFreeVariant(&dbv);
+ }
+
+ mir_snprintf(setting, SIZEOF(setting), "TransFuncId%d", index);
+ ds->iTranslateFuncId = DBGetContactSettingDword(0, MODULE_ITEMS, setting, (DWORD)-1);
+
+ // a little backward compatibility
+ if ((DWORD)ds->iTranslateFuncId == (DWORD)-1)
+ {
+ mir_snprintf(setting, SIZEOF(setting), "TransFunc%d", index);
+ ds->iTranslateFuncId = (DWORD)DBGetContactSettingWord(0, MODULE_ITEMS, setting, 0);
+ }
+
+ return true;
+}
+
+
+void SaveDS(DISPLAYSUBST *ds, int index)
+{
+ char setting[512];
+
+ mir_snprintf(setting, SIZEOF(setting), "Name%d", index);
+ DBWriteContactSettingTString(0, MODULE_ITEMS, setting, ds->swzName);
+ mir_snprintf(setting, SIZEOF(setting), "Type%d", index);
+ DBWriteContactSettingByte(0, MODULE_ITEMS, setting, (BYTE)ds->type);
+ mir_snprintf(setting, SIZEOF(setting), "Module%d", index);
+ DBWriteContactSettingString(0, MODULE_ITEMS, setting, ds->szModuleName);
+ mir_snprintf(setting, SIZEOF(setting), "Setting%d", index);
+ DBWriteContactSettingString(0, MODULE_ITEMS, setting, ds->szSettingName);
+ mir_snprintf(setting, SIZEOF(setting), "TransFuncId%d", index);
+ DBWriteContactSettingDword(0, MODULE_ITEMS, setting, (WORD)ds->iTranslateFuncId);
+}
+
+
+bool LoadDI(DISPLAYITEM *di, int index)
+{
+ char setting[512];
+ DBVARIANT dbv;
+
+ mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index);
+ di->swzLabel[0] = 0;
+ if (!DBGetContactSettingTString(0, MODULE_ITEMS, setting, &dbv))
+ {
+ _tcsncpy( di->swzLabel, dbv.ptszVal, SIZEOF(di->swzLabel));
+ di->swzLabel[SIZEOF(di->swzLabel) - 1] = 0;
+ DBFreeVariant(&dbv);
+ } else
+ return false;
+
+ mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
+ di->swzValue[0] = 0;
+ if(!DBGetContactSettingTString(0, MODULE_ITEMS, setting, &dbv))
+ {
+ _tcsncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue));
+ di->swzValue[SIZEOF(di->swzValue) - 1] = 0;
+ DBFreeVariant(&dbv);
+ }
+
+ mir_snprintf(setting, SIZEOF(setting), "DILineAbove%d", index);
+ di->bLineAbove = (DBGetContactSettingByte(0, MODULE_ITEMS, setting, 0) == 1);
+ mir_snprintf(setting, SIZEOF(setting), "DIValNewline%d", index);
+ di->bValueNewline = (DBGetContactSettingByte(0, MODULE_ITEMS, setting, 0) == 1);
+ mir_snprintf(setting, SIZEOF(setting), "DIVisible%d", index);
+ di->bIsVisible = (DBGetContactSettingByte(0, MODULE_ITEMS, setting, 1) == 1);
+ mir_snprintf(setting, SIZEOF(setting), "DITipperVarsFirst%d", index);
+ di->bParseTipperVarsFirst = (DBGetContactSettingByte(0, MODULE_ITEMS, setting, 0) == 1);
+
+ return true;
+}
+
+
+void SaveDI(DISPLAYITEM *di, int index)
+{
+ char setting[512];
+
+ mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index);
+ if (DBWriteContactSettingTString(0, MODULE_ITEMS, setting, di->swzLabel))
+ {
+ char buff[LABEL_LEN];
+ t2a(di->swzLabel, buff, LABEL_LEN);
+ DBWriteContactSettingString(0, MODULE_ITEMS, setting, buff);
+ }
+
+ mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
+ if (DBWriteContactSettingTString(0, MODULE_ITEMS, setting, di->swzValue))
+ {
+ char buff[VALUE_LEN];
+ t2a(di->swzValue, buff, VALUE_LEN);
+ DBWriteContactSettingString(0, MODULE_ITEMS, setting, buff);
+ }
+
+ mir_snprintf(setting, SIZEOF(setting), "DILineAbove%d", index);
+ DBWriteContactSettingByte(0, MODULE_ITEMS, setting, di->bLineAbove ? 1 : 0);
+ mir_snprintf(setting, SIZEOF(setting), "DIValNewline%d", index);
+ DBWriteContactSettingByte(0, MODULE_ITEMS, setting, di->bValueNewline ? 1 : 0);
+ mir_snprintf(setting, SIZEOF(setting), "DIVisible%d", index);
+ DBWriteContactSettingByte(0, MODULE_ITEMS, setting, di->bIsVisible ? 1 : 0);
+ mir_snprintf(setting, SIZEOF(setting), "DITipperVarsFirst%d", index);
+ DBWriteContactSettingByte(0, MODULE_ITEMS, setting, di->bParseTipperVarsFirst ? 1 : 0);
+}
+
+
+void SaveOptions()
+{
+ DBWriteContactSettingDword(0, MODULE, "MaxWidth", opt.iWinWidth);
+ DBWriteContactSettingDword(0, MODULE, "MaxHeight", opt.iWinMaxHeight);
+ DBWriteContactSettingByte(0, MODULE, "AvatarOpacity", (BYTE)opt.iAvatarOpacity);
+ DBWriteContactSettingByte(0, MODULE, "AvatarRoundCorners", (opt.bAvatarRound ? 1 : 0));
+ DBWriteContactSettingByte(0, MODULE, "TitleLayout", (BYTE)opt.titleLayout);
+ if (ServiceExists(MS_AV_DRAWAVATAR))
+ DBWriteContactSettingByte(0, MODULE, "AVLayout", (BYTE)opt.avatarLayout);
+ opt.bWaitForAvatar = (opt.avatarLayout == PAV_NONE) ? false : true;
+
+ DBWriteContactSettingDword(0, MODULE, "AVSize", opt.iAvatarSize);
+ DBWriteContactSettingDword(0, MODULE, "TextIndent", opt.iTextIndent);
+ DBWriteContactSettingDword(0, MODULE, "TitleIndent", opt.iTitleIndent);
+ DBWriteContactSettingDword(0, MODULE, "ValueIndent", opt.iValueIndent);
+ DBWriteContactSettingByte(0, MODULE, "ShowNoFocus", (opt.bShowNoFocus ? 1 : 0));
+
+ DBWriteContactSettingWord(0, MODULE, "TimeIn", opt.iTimeIn);
+ CallService(MS_CLC_SETINFOTIPHOVERTIME, opt.iTimeIn, 0);
+
+ DBWriteContactSettingWord(0, MODULE, "Padding", opt.iPadding);
+ DBWriteContactSettingWord(0, MODULE, "OuterAvatarPadding", opt.iOuterAvatarPadding);
+ DBWriteContactSettingWord(0, MODULE, "InnerAvatarPadding", opt.iInnerAvatarPadding);
+ DBWriteContactSettingWord(0, MODULE, "TextPadding", opt.iTextPadding);
+ DBWriteContactSettingByte(0, MODULE, "Position", (BYTE)opt.pos);
+ DBWriteContactSettingDword(0, MODULE, "MinWidth", (DWORD)opt.iMinWidth);
+ DBWriteContactSettingDword(0, MODULE, "MinHeight", (DWORD)opt.iMinHeight);
+ DBWriteContactSettingDword(0, MODULE, "SidebarWidth", (DWORD)opt.iSidebarWidth);
+ DBWriteContactSettingByte(0, MODULE, "MouseTollerance", (BYTE)opt.iMouseTollerance);
+ DBWriteContactSettingByte(0, MODULE, "SBarTips", (opt.bStatusBarTips ? 1 : 0));
+
+ DBWriteContactSettingWord(0, MODULE, "LabelVAlign", opt.iLabelValign);
+ DBWriteContactSettingWord(0, MODULE, "LabelHAlign", opt.iLabelHalign);
+ DBWriteContactSettingWord(0, MODULE, "ValueVAlign", opt.iValueValign);
+ DBWriteContactSettingWord(0, MODULE, "ValueHAlign", opt.iValueHalign);
+
+ DBWriteContactSettingByte(0, MODULE, "OriginalAvSize", (opt.bOriginalAvatarSize ? 1 : 0));
+ DBWriteContactSettingByte(0, MODULE, "AvatarBorder", (opt.bAvatarBorder ? 1 : 0));
+}
+
+void SaveItems()
+{
+ int index = 0;
+ DSListNode *ds_node = opt.dsList;
+ while (ds_node)
+ {
+ SaveDS(&ds_node->ds, index);
+ ds_node = ds_node->next;
+ index++;
+ }
+
+ DBWriteContactSettingWord(0, MODULE_ITEMS, "DSNumValues", index);
+
+ index = 0;
+ DIListNode *di_node = opt.diList;
+ opt.bWaitForStatusMsg = false;
+ while (di_node)
+ {
+ SaveDI(&di_node->di, index);
+ if (di_node->di.bIsVisible && _tcsstr(di_node->di.swzValue, _T("sys:status_msg")))
+ opt.bWaitForStatusMsg = true;
+ di_node = di_node->next;
+ index++;
+ }
+
+ DBWriteContactSettingWord(0, MODULE_ITEMS, "DINumValues", index);
+}
+
+void SaveSkinOptions()
+{
+ DBWriteContactSettingByte(0, MODULE, "Border", (opt.bBorder ? 1 : 0));
+ DBWriteContactSettingByte(0, MODULE, "DropShadow", (opt.bDropShadow ? 1 : 0));
+ DBWriteContactSettingByte(0, MODULE, "RoundCorners", (opt.bRound ? 1 : 0));
+ DBWriteContactSettingByte(0, MODULE, "AeroGlass", (opt.bAeroGlass ? 1 : 0));
+ DBWriteContactSettingByte(0, MODULE, "Opacity", (BYTE)opt.iOpacity);
+ DBWriteContactSettingByte(0, MODULE, "ShowEffect", (BYTE)opt.showEffect);
+ DBWriteContactSettingByte(0, MODULE, "ShowEffectSpeed", (BYTE)opt.iAnimateSpeed);
+ DBWriteContactSettingByte(0, MODULE, "LoadFonts", (opt.bLoadFonts ? 1 : 0));
+ DBWriteContactSettingByte(0, MODULE, "LoadProportions", (opt.bLoadProportions ? 1 : 0));
+ DBWriteContactSettingDword(0, MODULE, "EnableColoring", opt.iEnableColoring);
+}
+
+void LoadObsoleteSkinSetting()
+{
+ char setting[128];
+ DBVARIANT dbv;
+
+ for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
+ {
+ mir_snprintf(setting, 128, "SPaintMode%d", i);
+ opt.transfMode[i] = (TransformationMode)DBGetContactSettingByte(0, MODULE, setting, 0);
+ mir_snprintf(setting, 128, "SImgFile%d", i);
+ if (!DBGetContactSettingString(NULL, MODULE, setting, &dbv))
+ {
+ opt.szImgFile[i] = mir_strdup(dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+
+ mir_snprintf(setting, 128, "SGlyphMargins%d", i);
+ DWORD margins = DBGetContactSettingDword(NULL, MODULE, setting, 0);
+ opt.margins[i].top = LOBYTE(LOWORD(margins));
+ opt.margins[i].right = HIBYTE(LOWORD(margins));
+ opt.margins[i].bottom = LOBYTE(HIWORD(margins));
+ opt.margins[i].left = HIBYTE(HIWORD(margins));
+ }
+}
+
+void LoadOptions()
+{
+ opt.iWinWidth = DBGetContactSettingDword(0, MODULE, "MaxWidth", 420);
+ opt.iWinMaxHeight = DBGetContactSettingDword(0, MODULE, "MaxHeight", 400);
+ opt.iAvatarOpacity = DBGetContactSettingByte(0, MODULE, "AvatarOpacity", 100);
+ if (opt.iAvatarOpacity > 100) opt.iAvatarOpacity = 100;
+ opt.bAvatarRound = (DBGetContactSettingByte(0, MODULE, "AvatarRoundCorners", opt.bRound ? 1 : 0) == 1);
+ opt.titleLayout = (PopupTitleLayout)DBGetContactSettingByte(0, MODULE, "TitleLayout", (BYTE)PTL_LEFTICON);
+ if (ServiceExists(MS_AV_DRAWAVATAR))
+ opt.avatarLayout = (PopupAvLayout)DBGetContactSettingByte(0, MODULE, "AVLayout", PAV_RIGHT);
+ else
+ opt.avatarLayout = PAV_NONE;
+
+ opt.bWaitForAvatar = (opt.avatarLayout == PAV_NONE) ? false : true;
+ opt.iAvatarSize = DBGetContactSettingDword(0, MODULE, "AVSize", 60); //tweety
+ opt.iTextIndent = DBGetContactSettingDword(0, MODULE, "TextIndent", 22);
+ opt.iTitleIndent = DBGetContactSettingDword(0, MODULE, "TitleIndent", 22);
+ opt.iValueIndent = DBGetContactSettingDword(0, MODULE, "ValueIndent", 10);
+ opt.iSidebarWidth = DBGetContactSettingDword(0, MODULE, "SidebarWidth", 22);
+ opt.bShowNoFocus = (DBGetContactSettingByte(0, MODULE, "ShowNoFocus", 1) == 1);
+
+ int i, real_count = 0;
+ opt.dsList = 0;
+ DSListNode *ds_node;
+
+ opt.iDsCount = DBGetContactSettingWord(0, MODULE_ITEMS, "DSNumValues", 0);
+ for (i = opt.iDsCount - 1; i >= 0; i--)
+ {
+ ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
+ if (LoadDS(&ds_node->ds, i))
+ {
+ ds_node->next = opt.dsList;
+ opt.dsList = ds_node;
+ real_count++;
+ }
+ else
+ {
+ mir_free(ds_node);
+ }
+ }
+ opt.iDsCount = real_count;
+
+ real_count = 0;
+ opt.diList = 0;
+ DIListNode *di_node;
+
+ opt.bWaitForStatusMsg = false;
+ opt.iDiCount = DBGetContactSettingWord(0, MODULE_ITEMS, "DINumValues", 0);
+ for (i = opt.iDiCount - 1; i >= 0; i--)
+ {
+ di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ if (LoadDI(&di_node->di, i))
+ {
+ di_node->next = opt.diList;
+ opt.diList = di_node;
+ real_count++;
+ if (di_node->di.bIsVisible && _tcsstr(di_node->di.swzValue, _T("sys:status_msg")))
+ opt.bWaitForStatusMsg = true;
+ }
+ else
+ {
+ mir_free(di_node);
+ }
+ }
+ opt.iDiCount = real_count;
+
+ opt.iTimeIn = DBGetContactSettingWord(0, MODULE, "TimeIn", 750);
+ opt.iPadding = DBGetContactSettingWord(0, MODULE, "Padding", 4);
+ opt.iOuterAvatarPadding = DBGetContactSettingWord(0, MODULE, "OuterAvatarPadding", 6);
+ opt.iInnerAvatarPadding = DBGetContactSettingWord(0, MODULE, "InnerAvatarPadding", 10);
+ opt.iTextPadding = DBGetContactSettingWord(0, MODULE, "TextPadding", 4);
+ opt.pos = (PopupPosition)DBGetContactSettingByte(0, MODULE, "Position", (BYTE)PP_BOTTOMRIGHT);
+ opt.iMinWidth = DBGetContactSettingDword(0, MODULE, "MinWidth", 0);
+ opt.iMinHeight = DBGetContactSettingDword(0, MODULE, "MinHeight", 0);
+
+ opt.iMouseTollerance = DBGetContactSettingByte(0, MODULE, "MouseTollerance", (BYTE)GetSystemMetrics(SM_CXSMICON));
+ opt.bStatusBarTips = (DBGetContactSettingByte(0, MODULE, "SBarTips", 1) == 1);
+
+ // convert defunct last message and status message options to new 'sys' items, and remove the old settings
+ if (DBGetContactSettingByte(0, MODULE, "ShowLastMessage", 0))
+ {
+ DBDeleteContactSetting(0, MODULE, "ShowLastMessage");
+
+ // find end of list
+ di_node = opt.diList;
+ while(di_node && di_node->next)
+ di_node = di_node->next;
+
+ // last message item
+ if (di_node)
+ {
+ di_node->next = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ di_node = di_node->next;
+ }
+ else
+ {
+ opt.diList = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ di_node = opt.diList;
+ }
+
+ _tcsncpy(di_node->di.swzLabel, _T("Last message: (%sys:last_msg_reltime% ago)"), LABEL_LEN);
+ _tcsncpy(di_node->di.swzValue, _T("%sys:last_msg%"), VALUE_LEN);
+ di_node->di.bLineAbove = di_node->di.bValueNewline = true;
+ di_node->next = 0;
+ opt.iDiCount++;
+ }
+
+ if (DBGetContactSettingByte(0, MODULE, "ShowStatusMessage", 0))
+ {
+ DBDeleteContactSetting(0, MODULE, "ShowStatusMessage");
+
+ // find end of list
+ di_node = opt.diList;
+ while(di_node && di_node->next)
+ di_node = di_node->next;
+
+ // status message item
+ if (di_node)
+ {
+ di_node->next = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ di_node = di_node->next;
+ }
+ else
+ {
+ opt.diList = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ di_node = opt.diList;
+ }
+
+ _tcsncpy(di_node->di.swzLabel, _T("Status message:"), LABEL_LEN);
+ _tcsncpy(di_node->di.swzValue, _T("%sys:status_msg%"), VALUE_LEN);
+ di_node->di.bLineAbove = di_node->di.bValueNewline = true;
+ di_node->next = 0;
+ opt.iDiCount++;
+ }
+
+ opt.iLabelValign = DBGetContactSettingWord(0, MODULE, "LabelVAlign", DT_TOP /*DT_VCENTER*/);
+ opt.iLabelHalign = DBGetContactSettingWord(0, MODULE, "LabelHAlign", DT_LEFT);
+ opt.iValueValign = DBGetContactSettingWord(0, MODULE, "ValueVAlign", DT_TOP /*DT_VCENTER*/);
+ opt.iValueHalign = DBGetContactSettingWord(0, MODULE, "ValueHAlign", DT_LEFT);
+
+ // tray tooltip
+ opt.bTraytip = DBGetContactSettingByte(0, MODULE, "TrayTip", 1) ? true : false;
+ opt.bHandleByTipper = DBGetContactSettingByte(0, MODULE, "ExtendedTrayTip", 1) ? true : false;
+ opt.bExpandTraytip = DBGetContactSettingByte(0, MODULE, "ExpandTrayTip", 1) ? true : false;
+ opt.bHideOffline = DBGetContactSettingByte(0, MODULE, "HideOffline", 0) ? true : false;
+ opt.iExpandTime = DBGetContactSettingDword(0, MODULE, "ExpandTime", 1000);
+ opt.iFirstItems = DBGetContactSettingDword(0, MODULE, "TrayTipItems", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_CLIST_EVENT);
+ opt.iSecondItems = DBGetContactSettingDword(0, MODULE, "TrayTipItemsEx", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_STATUS_MSG | TRAYTIP_EXTRA_STATUS | TRAYTIP_MIRANDA_UPTIME | TRAYTIP_CLIST_EVENT);
+ opt.iFavoriteContFlags = DBGetContactSettingDword(0, MODULE, "FavContFlags", FAVCONT_APPEND_PROTO);
+
+ // extra setting
+ opt.bWaitForContent= DBGetContactSettingByte(0, MODULE, "WaitForContent", 0) ? true : false;
+ opt.bGetNewStatusMsg = DBGetContactSettingByte(0, MODULE, "GetNewStatusMsg", 0) ? true : false;
+ opt.bDisableIfInvisible = DBGetContactSettingByte(0, MODULE, "DisableInvisible", 1) ? true : false;
+ opt.bRetrieveXstatus = DBGetContactSettingByte(0, MODULE, "RetrieveXStatus", 0) ? true : false;
+ opt.bOriginalAvatarSize = DBGetContactSettingByte(0, MODULE, "OriginalAvSize", 0) ? true : false;
+ opt.bAvatarBorder = DBGetContactSettingByte(0, MODULE, "AvatarBorder", 0) ? true : false;
+ opt.bLimitMsg = DBGetContactSettingByte(0, MODULE, "LimitMsg", 0) ? true : false;
+ opt.iLimitCharCount = DBGetContactSettingByte(0, MODULE, "LimitCharCount", 64);
+ opt.iSmileyAddFlags = DBGetContactSettingDword(0, MODULE, "SmileyAddFlags", SMILEYADD_ENABLE);
+
+ DBVARIANT dbv;
+ // Load the icons order
+ for(i = 0; i < EXICONS_COUNT; i++)
+ {
+ opt.exIconsOrder[i]=i;
+ opt.exIconsVis[i]=1;
+ }
+
+ if (!DBGetContactSetting(NULL, MODULE, "IconOrder", &dbv))
+ {
+ CopyMemory(opt.exIconsOrder,dbv.pbVal,dbv.cpbVal);
+ DBFreeVariant(&dbv);
+ }
+
+ if (!DBGetContactSetting(NULL, MODULE, "icons_vis", &dbv))
+ {
+ CopyMemory(opt.exIconsVis,dbv.pbVal,dbv.cpbVal);
+ DBFreeVariant(&dbv);
+ }
+
+ for(i = 0; i < EXICONS_COUNT; i++)
+ {
+ exIcons[i].order = opt.exIconsOrder[i];
+ exIcons[i].vis = opt.exIconsVis[i];
+ }
+
+ opt.iOpacity = DBGetContactSettingByte(0, MODULE, "Opacity", 75);
+ opt.bBorder = DBGetContactSettingByte(0, MODULE, "Border", 1) ? true : false;
+ opt.bDropShadow = DBGetContactSettingByte(0, MODULE, "DropShadow", 1) ? true : false;
+ opt.bRound = DBGetContactSettingByte(0, MODULE, "RoundCorners", 1) ? true : false;
+ opt.bAeroGlass = DBGetContactSettingByte(0, MODULE, "AeroGlass", 0) ? true : false;
+ opt.showEffect = (PopupShowEffect)DBGetContactSettingByte(0, MODULE, "ShowEffect", (BYTE)PSE_FADE);
+ opt.iAnimateSpeed = DBGetContactSettingByte(0, MODULE, "ShowEffectSpeed", 12);
+
+ if (opt.iAnimateSpeed < 1)
+ opt.iAnimateSpeed = 1;
+ else if (opt.iAnimateSpeed > 20)
+ opt.iAnimateSpeed = 20;
+
+ int iBgImg = DBGetContactSettingByte(0, MODULE, "SBgImage", 0);
+ opt.skinMode = (SkinMode)DBGetContactSettingByte(0, MODULE, "SkinEngine", iBgImg ? SM_OBSOLOTE : SM_COLORFILL);
+ opt.bLoadFonts = DBGetContactSettingByte(0, MODULE, "LoadFonts", 1) ? true : false;
+ opt.bLoadProportions= DBGetContactSettingByte(0, MODULE, "LoadProportions", 1) ? true : false;
+ opt.iEnableColoring = DBGetContactSettingDword(0, MODULE, "EnableColoring", 0);
+ opt.szSkinName[0] = 0;
+
+ if (opt.skinMode == SM_OBSOLOTE)
+ {
+ LoadObsoleteSkinSetting();
+ }
+ else if (opt.skinMode == SM_IMAGE)
+ {
+ if (!DBGetContactSettingString(NULL, MODULE, "SkinName", &dbv))
+ {
+ strcpy(opt.szSkinName, dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+ }
+
+ if (opt.iDsCount == 0 && opt.iDiCount == 0)
+ {
+ // set up some reasonable defaults
+ CreateDefaultItems();
+ SaveOptions();
+ SaveItems();
+ }
+}
+
+INT_PTR CALLBACK DlgProcAddItem(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ DISPLAYITEM *di = (DISPLAYITEM *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault( hwndDlg );
+ di = (DISPLAYITEM *)lParam;
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)di);
+
+ SetDlgItemText(hwndDlg, IDC_ED_LABEL, di->swzLabel);
+ SetDlgItemText(hwndDlg, IDC_ED_VALUE, di->swzValue);
+
+ CheckDlgButton(hwndDlg, IDC_CHK_LINEABOVE, di->bLineAbove ? TRUE : FALSE);
+ CheckDlgButton(hwndDlg, IDC_CHK_VALNEWLINE, di->bValueNewline ? TRUE : FALSE);
+ CheckDlgButton(hwndDlg, IDC_CHK_PARSETIPPERFIRST, di->bParseTipperVarsFirst ? TRUE : FALSE);
+
+ int i;
+ for (i = 0; presetItems[i].szID; i++)
+ SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_ADDSTRING, 0, (LPARAM)TranslateTS(presetItems[i].swzName));
+
+ variables_skin_helpbutton(hwndDlg, IDC_BTN_VARIABLE);
+
+ SetFocus(GetDlgItem(hwndDlg, IDC_ED_LABEL));
+ return TRUE;
+ }
+ case WM_COMMAND:
+ {
+ if (HIWORD(wParam) == BN_CLICKED)
+ {
+ switch(LOWORD(wParam))
+ {
+ case IDOK:
+ {
+ int sel;
+ GetDlgItemText(hwndDlg, IDC_ED_LABEL, di->swzLabel, LABEL_LEN);
+ GetDlgItemText(hwndDlg, IDC_ED_VALUE, di->swzValue, VALUE_LEN);
+
+ di->bLineAbove = (IsDlgButtonChecked(hwndDlg, IDC_CHK_LINEABOVE) ? true : false);
+ di->bValueNewline = (IsDlgButtonChecked(hwndDlg, IDC_CHK_VALNEWLINE) ? true : false);
+ di->bParseTipperVarsFirst = (IsDlgButtonChecked(hwndDlg, IDC_CHK_PARSETIPPERFIRST) ? true : false);
+
+ sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
+ if (sel != CB_ERR)
+ {
+ TCHAR buff[256]; int i;
+ SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
+ for (i = 0; presetItems[i].szID; i++)
+ {
+ if (_tcscmp(buff, TranslateTS(presetItems[i].swzName)) == 0)
+ break;
+ }
+
+ if (presetItems[i].szNeededSubst[0])
+ EndDialog(hwndDlg, IDPRESETITEM + i);
+ else
+ EndDialog(hwndDlg, IDOK);
+ }
+ else
+ {
+ EndDialog(hwndDlg, IDOK);
+ }
+
+ return TRUE;
+ }
+ case IDCANCEL:
+ {
+ EndDialog(hwndDlg, IDCANCEL);
+ return TRUE;
+ }
+ case IDC_BTN_VARIABLE:
+ {
+ if (GetFocus() == GetDlgItem(hwndDlg, IDC_ED_LABEL))
+ variables_showhelp(hwndDlg, IDC_ED_LABEL, VHF_FULLDLG, NULL, NULL);
+ else
+ variables_showhelp(hwndDlg, IDC_ED_VALUE, VHF_FULLDLG, NULL, NULL);
+ return TRUE;
+ }
+ }
+ }
+ else if (HIWORD(wParam) == CBN_SELCHANGE)
+ {
+ if (LOWORD(wParam) == IDC_CMB_PRESETITEMS)
+ {
+ int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETCURSEL, 0, 0);
+ if (sel != CB_ERR)
+ {
+ TCHAR buff[256]; int i;
+ SendDlgItemMessage(hwndDlg, IDC_CMB_PRESETITEMS, CB_GETLBTEXT, sel, (LPARAM)buff);
+ for (i = 0; presetItems[i].szID; i++)
+ {
+ if (_tcscmp(buff, TranslateTS(presetItems[i].swzName)) == 0)
+ break;
+ }
+
+ SetDlgItemText(hwndDlg, IDC_ED_LABEL, TranslateTS(presetItems[i].swzLabel));
+ SetDlgItemText(hwndDlg, IDC_ED_VALUE, presetItems[i].swzValue);
+ }
+ }
+ }
+ break;
+ }
+ }
+
+ return 0;
+}
+
+INT_PTR CALLBACK DlgProcAddSubst(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ DISPLAYSUBST *ds = (DISPLAYSUBST *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault( hwndDlg );
+ ds = (DISPLAYSUBST *)lParam;
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)ds);
+
+ SetDlgItemText(hwndDlg, IDC_ED_LABEL, ds->swzName);
+
+ switch(ds->type)
+ {
+ case DVT_PROTODB:
+ CheckDlgButton(hwndDlg, IDC_CHK_PROTOMOD, TRUE);
+ SetDlgItemTextA(hwndDlg, IDC_ED_SETTING, ds->szSettingName);
+ break;
+ case DVT_DB:
+ SetDlgItemTextA(hwndDlg, IDC_ED_MODULE, ds->szModuleName);
+ SetDlgItemTextA(hwndDlg, IDC_ED_SETTING, ds->szSettingName);
+ break;
+ }
+
+ int index, id, i;
+ for (i = 0; i < iTransFuncsCount; i++)
+ {
+ index = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_ADDSTRING, (WPARAM)-1, (LPARAM)TranslateTS(translations[i].swzName));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_SETITEMDATA, index, (LPARAM)translations[i].id);
+ }
+
+ for (i = 0; i < iTransFuncsCount; i++)
+ {
+ id = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_GETITEMDATA, i, 0);
+ if (id == ds->iTranslateFuncId)
+ SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_SETCURSEL, i, 0);
+ }
+
+ SendMessage(hwndDlg, WMU_ENABLE_MODULE_ENTRY, 0, 0);
+ SetFocus(GetDlgItem(hwndDlg, IDC_ED_LABEL));
+ return TRUE;
+ }
+ case WMU_ENABLE_MODULE_ENTRY:
+ {
+ HWND hw = GetDlgItem(hwndDlg, IDC_CHK_PROTOMOD);
+ EnableWindow(hw, TRUE);
+ hw = GetDlgItem(hwndDlg, IDC_ED_MODULE);
+ EnableWindow(hw, !IsDlgButtonChecked(hwndDlg, IDC_CHK_PROTOMOD));
+ hw = GetDlgItem(hwndDlg, IDC_ED_SETTING);
+ EnableWindow(hw, TRUE);
+ return TRUE;
+ }
+ case WM_COMMAND:
+ {
+ if (HIWORD(wParam) == BN_CLICKED)
+ {
+ switch(LOWORD(wParam))
+ {
+ case IDC_CHK_PROTOMOD:
+ {
+ SendMessage(hwndDlg, WMU_ENABLE_MODULE_ENTRY, 0, 0);
+ break;
+ }
+ case IDOK:
+ {
+ GetDlgItemText(hwndDlg, IDC_ED_LABEL, ds->swzName, LABEL_LEN);
+ if (ds->swzName[0] == 0)
+ {
+ MessageBox(hwndDlg, TranslateT("You must enter a label"), TranslateT("Invalid Substitution"), MB_OK | MB_ICONWARNING);
+ return TRUE;
+ }
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_CHK_PROTOMOD))
+ {
+ ds->type = DVT_PROTODB;
+ }
+ else
+ {
+ ds->type = DVT_DB;
+ GetDlgItemTextA(hwndDlg, IDC_ED_MODULE, ds->szModuleName, MODULE_NAME_LEN);
+ }
+
+ GetDlgItemTextA(hwndDlg, IDC_ED_SETTING, ds->szSettingName, SETTING_NAME_LEN);
+
+ int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_GETCURSEL, 0, 0);
+ ds->iTranslateFuncId = SendDlgItemMessage(hwndDlg, IDC_CMB_TRANSLATE, CB_GETITEMDATA, sel, 0);
+
+ EndDialog(hwndDlg, IDOK);
+ return TRUE;
+ }
+ case IDCANCEL:
+ {
+ EndDialog(hwndDlg, IDCANCEL);
+ return TRUE;
+ }
+ }
+ }
+ else if (HIWORD(wParam) == CBN_SELCHANGE)
+ {
+ return TRUE;
+ }
+
+ break;
+ }
+ }
+
+ return 0;
+}
+
+static void SetTreeItemText(DIListNode *node, TCHAR **pszText)
+{
+ if (node->di.swzLabel[0] == 0)
+ {
+ if (node->di.swzValue[0] == 0 && node->di.bLineAbove)
+ *pszText = _T("--------------------------------------");
+ else
+ *pszText = TranslateT("<No Label>");
+ }
+ else
+ {
+ *pszText = node->di.swzLabel;
+ }
+}
+
+
+static OPTBUTTON btns[9] =
+{
+ IDC_BTN_ADD, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add item"),
+ IDC_BTN_SEPARATOR, 0, IDI_SEPARATOR, LPGENT("Add separator"),
+ IDC_BTN_EDIT, SKINICON_OTHER_RENAME, 0, LPGENT("Edit"),
+ IDC_BTN_REMOVE, SKINICON_OTHER_DELETE, 0, LPGENT("Remove"),
+ IDC_BTN_UP, 0, IDI_UP, LPGENT("Move up"),
+ IDC_BTN_DOWN, 0, IDI_DOWN, LPGENT("Move down"),
+ IDC_BTN_ADD2, SKINICON_OTHER_ADDCONTACT, 0, LPGENT("Add"),
+ IDC_BTN_REMOVE2, SKINICON_OTHER_DELETE, 0, LPGENT("Remove"),
+ IDC_BTN_EDIT2, SKINICON_OTHER_RENAME, 0, LPGENT("Edit")
+};
+
+INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hwndDlg);
+
+ for (int i = 0; i < SIZEOF(btns); i++)
+ {
+ SendDlgItemMessage(hwndDlg, btns[i].id, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwndDlg, btns[i].id, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(btns[i].swzTooltip), BATF_TCHAR);
+ if (btns[i].uintCoreIconId)
+ {
+ SendDlgItemMessage(hwndDlg, btns[i].id, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(btns[i].uintCoreIconId));
+ }
+ else
+ {
+ HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(btns[i].uintResIconId));
+ SendDlgItemMessage(hwndDlg, btns[i].id, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
+ DestroyIcon(hIcon);
+ }
+ }
+
+ HIMAGELIST himlStates = ImageList_Create(16, 16, IsWinVerXPPlus() ? ILC_COLOR32 | ILC_MASK : ILC_COLOR8 | ILC_MASK, 3, 0);
+ ImageList_AddIcon(himlStates, LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
+ ImageList_AddIcon(himlStates, LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
+ ImageList_AddIcon(himlStates, LoadSkinnedIcon(SKINICON_OTHER_TICK));
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), himlStates, TVSIL_STATE);
+
+ TVINSERTSTRUCT tvi = {0};
+ tvi.hInsertAfter = TVI_LAST;
+ tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
+ tvi.item.stateMask = TVIS_STATEIMAGEMASK;
+
+ DIListNode *di_node = opt.diList, *di_value;
+ while (di_node)
+ {
+ di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ *di_value = *di_node;
+ tvi.item.lParam = (LPARAM)di_value;
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(di_value->di.bIsVisible ? 2 : 1);
+ SetTreeItemText(di_value, &tvi.item.pszText);
+ TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
+ di_node = di_node->next;
+ }
+
+ DSListNode *ds_node = opt.dsList, *ds_value;
+ while (ds_node)
+ {
+ ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
+ *ds_value = *ds_node;
+ int index = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, index, (LPARAM)ds_value);
+ ds_node = ds_node->next;
+ }
+
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ return FALSE;
+ }
+ case WMU_ENABLE_LIST_BUTTONS:
+ {
+ HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ if (hItem)
+ {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_REMOVE), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_UP), TreeView_GetPrevSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem) ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_DOWN), TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem) ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_EDIT), TRUE);
+ }
+ else
+ {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_REMOVE), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_UP), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_DOWN), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_EDIT), FALSE);
+ }
+
+ int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
+ if (sel == -1)
+ {
+ HWND hw = GetDlgItem(hwndDlg, IDC_BTN_REMOVE2);
+ EnableWindow(hw, FALSE);
+ hw = GetDlgItem(hwndDlg, IDC_BTN_EDIT2);
+ EnableWindow(hw, FALSE);
+ }
+ else
+ {
+ HWND hw = GetDlgItem(hwndDlg, IDC_BTN_REMOVE2);
+ EnableWindow(hw, TRUE);
+ hw = GetDlgItem(hwndDlg, IDC_BTN_EDIT2);
+ EnableWindow(hw, TRUE);
+ }
+ return TRUE;
+ }
+ case WM_COMMAND:
+ {
+ if (HIWORD(wParam) == LBN_SELCHANGE && LOWORD(wParam) == IDC_LST_SUBST)
+ {
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ }
+ else if (HIWORD(wParam) == CBN_SELCHANGE)
+ {
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ else if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
+ {
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ else if (HIWORD(wParam) == LBN_DBLCLK && LOWORD(wParam) == IDC_LST_SUBST)
+ {
+ int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
+ if (sel != CB_ERR)
+ {
+ DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, sel, 0);
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK)
+ {
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_DELETESTRING, (WPARAM)sel, 0);
+
+ sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, sel, (LPARAM)ds_value);
+
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETCURSEL, sel, 0);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ }
+ }
+ else if (HIWORD(wParam) == BN_CLICKED)
+ {
+ switch(LOWORD(wParam))
+ {
+ case IDC_BTN_ADD:
+ {
+ DIListNode *di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ memset(di_value, 0, sizeof(DIListNode));
+ di_value->di.bIsVisible = true;
+
+ int result = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di);
+ if (result == IDOK || (result >= IDPRESETITEM && result < (IDPRESETITEM + 100)))
+ {
+ TVINSERTSTRUCT tvi = {0};
+ tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
+ tvi.item.stateMask = TVIS_STATEIMAGEMASK;
+ tvi.item.lParam = (LPARAM)di_value;
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(2);
+ SetTreeItemText(di_value, &tvi.item.pszText);
+
+ HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ if (hItem) tvi.hInsertAfter = hItem;
+ else tvi.hInsertAfter = TVI_LAST;
+ TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
+
+ if (hItem)
+ {
+ HTREEITEM hNewItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
+ if (hNewItem) TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hNewItem);
+ }
+
+ if (result >= IDPRESETITEM)
+ {
+ for (int i = 0; i < MAX_PRESET_SUBST_COUNT; i++)
+ {
+
+ PRESETSUBST *subst = GetPresetSubstByName(presetItems[result - IDPRESETITEM].szNeededSubst[i]);
+ if (subst == NULL) break;
+ if (SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_FINDSTRING, -1, (LPARAM)subst->swzName) == LB_ERR)
+ {
+ DSListNode *ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
+ memset(ds_value, 0, sizeof(DSListNode));
+ ds_value->next = NULL;
+ ds_value->ds.type = subst->type;
+ _tcscpy(ds_value->ds.swzName, subst->swzName);
+
+ if (ds_value->ds.type == DVT_DB && subst->szModuleName)
+ strcpy(ds_value->ds.szModuleName, subst->szModuleName);
+
+ if (subst->szSettingName)
+ strcpy(ds_value->ds.szSettingName, subst->szSettingName);
+
+ ds_value->ds.iTranslateFuncId = subst->iTranslateFuncId;
+
+ int index = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, index, (LPARAM)ds_value);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETCURSEL, index, 0);
+ }
+ }
+ }
+
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+
+ return TRUE;
+ }
+ case IDC_BTN_SEPARATOR:
+ {
+ DIListNode *di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ memset(di_value, 0, sizeof(DIListNode));
+ di_value->di.bIsVisible = true;
+ di_value->di.bLineAbove = true;
+
+ TVINSERTSTRUCT tvi = {0};
+ tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
+ tvi.item.stateMask = TVIS_STATEIMAGEMASK;
+ tvi.item.lParam = (LPARAM)di_value;
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(2);
+ tvi.item.pszText = _T("---------------------------------");
+
+ HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ if (hItem) tvi.hInsertAfter = hItem;
+ else tvi.hInsertAfter = TVI_LAST;
+ TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
+
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ return TRUE;
+ }
+ case IDC_BTN_REMOVE:
+ {
+ TVITEM item = {0};
+ item.mask = TVIF_PARAM;
+ item.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ if (item.hItem)
+ {
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
+ {
+ DIListNode *di_value = (DIListNode *)item.lParam;
+ mir_free(di_value);
+ TreeView_DeleteItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), item.hItem);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ }
+ return TRUE;
+ }
+ case IDC_BTN_UP:
+ case IDC_BTN_DOWN:
+ {
+ HTREEITEM hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ if (hItem)
+ {
+ HTREEITEM hNewItem;
+ if (LOWORD(wParam) == IDC_BTN_UP)
+ hNewItem = TreeView_GetPrevSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
+ else
+ hNewItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
+
+ if (hNewItem)
+ {
+ TCHAR buff[512], buff2[512];
+ LPARAM tmpParam;
+ UINT tmpState;
+
+ TVITEM item = {0};
+ item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
+ item.stateMask = TVIS_STATEIMAGEMASK;
+ item.hItem = hItem;
+ item.pszText = buff;
+ item.cchTextMax = 512;
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
+ {
+ tmpParam = item.lParam;
+ tmpState = item.state;
+ item.hItem = hNewItem;
+ item.pszText = buff2;
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
+ {
+ item.hItem = hItem;
+ TreeView_SetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
+
+ item.hItem = hNewItem;
+ item.pszText = buff;
+ item.lParam = tmpParam;
+ item.state = tmpState;
+ TreeView_SetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
+ TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hNewItem);
+ }
+ }
+ }
+ }
+
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ return TRUE;
+ }
+ case IDC_BTN_EDIT:
+ {
+ TVITEM item = {0};
+ item.mask = TVIF_PARAM;
+ item.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ if (item.hItem )
+ {
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
+ {
+ DIListNode *di_value = (DIListNode *)item.lParam;
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di) == IDOK)
+ {
+ item.mask = TVIF_TEXT;
+ SetTreeItemText(di_value, &item.pszText);
+ TreeView_SetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ }
+ }
+
+ return TRUE;
+ }
+ case IDC_BTN_ADD2:
+ {
+ DSListNode *ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
+ memset(ds_value, 0, sizeof(DSListNode));
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK)
+ {
+ int index = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, index, (LPARAM)ds_value);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETCURSEL, index, 0);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+
+ return TRUE;
+ }
+ case IDC_BTN_REMOVE2:
+ {
+ int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
+ if (sel != LB_ERR)
+ {
+ DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, sel, 0);
+ mir_free(ds_value);
+
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_DELETESTRING, (WPARAM)sel, 0);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+
+ return TRUE;
+ }
+ case IDC_BTN_EDIT2:
+ {
+ int sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCURSEL, 0, 0);
+ if (sel != LB_ERR)
+ {
+ DSListNode *ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, sel, 0);
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SUBST), hwndDlg, DlgProcAddSubst, (LPARAM)&ds_value->ds) == IDOK)
+ {
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_DELETESTRING, (WPARAM)sel, 0);
+
+ sel = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_ADDSTRING, 0, (LPARAM)ds_value->ds.swzName);
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETITEMDATA, sel, (LPARAM)ds_value);
+
+ SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_SETCURSEL, sel, 0);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ }
+
+ return TRUE;
+ }
+ default:
+ {
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ return TRUE;
+ }
+ }
+ }
+ break;
+ }
+ case WM_NOTIFY:
+ {
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_APPLY:
+ {
+ DIListNode *di_node;
+ while (opt.diList)
+ {
+ di_node = opt.diList;
+ opt.diList = opt.diList->next;
+ mir_free(di_node);
+ }
+
+ DIListNode *di_value;
+ opt.iDiCount = TreeView_GetCount(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+
+ TVITEM item = {0};
+ item.mask = TVIF_PARAM;
+ item.hItem = TreeView_GetLastVisible(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ while (item.hItem != NULL)
+ {
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
+ {
+ di_node = (DIListNode *)item.lParam;
+ di_value = (DIListNode *)mir_alloc(sizeof(DIListNode));
+ *di_value = *di_node;
+ di_value->next = opt.diList;
+ opt.diList = di_value;
+ }
+ item.hItem = TreeView_GetPrevSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), item.hItem);
+ }
+
+ DSListNode *ds_node;
+ while (opt.dsList)
+ {
+ ds_node = opt.dsList;
+ opt.dsList = opt.dsList->next;
+ mir_free(ds_node);
+ }
+
+ DSListNode *ds_value;
+ opt.iDsCount = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCOUNT, 0, 0);
+ for (int i = opt.iDsCount - 1; i >= 0; i--)
+ {
+ ds_node = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, i, 0);
+ ds_value = (DSListNode *)mir_alloc(sizeof(DSListNode));
+ *ds_value = *ds_node;
+ ds_value->next = opt.dsList;
+ opt.dsList = ds_value;
+ }
+
+ SaveItems();
+ return TRUE;
+ }
+ case NM_DBLCLK:
+ {
+ TVITEM item = {0};
+ item.mask = TVIF_PARAM;
+ item.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+ if (item.hItem)
+ {
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item))
+ {
+ DIListNode *di_value = (DIListNode *)item.lParam;
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ITEM), hwndDlg, DlgProcAddItem, (LPARAM)&di_value->di) == IDOK)
+ {
+ item.mask = TVIF_TEXT;
+ SetTreeItemText(di_value, &item.pszText);
+ TreeView_SetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item);
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ }
+ }
+ break;
+ }
+ case NM_CLICK:
+ {
+ TVHITTESTINFO hti;
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
+ {
+ if (hti.flags & TVHT_ONITEMSTATEICON)
+ {
+ TVITEMA item = {0};
+ item.hItem = hti.hItem;
+ item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_STATE;
+ item.stateMask = TVIS_STATEIMAGEMASK;
+ TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &item);
+
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 1)
+ {
+ item.state = INDEXTOSTATEIMAGEMASK(2);
+ ((DIListNode *)item.lParam)->di.bIsVisible = true;
+ }
+ else
+ {
+ item.state = INDEXTOSTATEIMAGEMASK(1);
+ ((DIListNode *)item.lParam)->di.bIsVisible = false;
+ }
+
+ TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &item);
+ SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
+ }
+ }
+ break;
+ }
+ case TVN_SELCHANGEDA:
+ case TVN_SELCHANGEDW:
+ {
+ SendMessage(hwndDlg, WMU_ENABLE_LIST_BUTTONS, 0, 0);
+ break;
+ }
+ }
+ break;
+ }
+ case WM_DESTROY:
+ {
+ DIListNode *di_value;
+ TVITEM tvi = {0};
+ tvi.mask = TVIF_PARAM;
+ HTREEITEM hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS));
+
+ while (hItem != NULL)
+ {
+ tvi.hItem = hItem;
+ if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi))
+ {
+ di_value = (DIListNode *)tvi.lParam;
+ mir_free(di_value);
+ }
+ hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), hItem);
+ }
+
+ DSListNode *ds_value;
+ int count = SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETCOUNT, 0, 0);
+ for (int i = 0; i < count; i++)
+ {
+ ds_value = (DSListNode *)SendDlgItemMessage(hwndDlg, IDC_LST_SUBST, LB_GETITEMDATA, i, 0);
+ mir_free(ds_value);
+ }
+
+ ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), TVSIL_STATE));
+ break;
+ }
+ }
+
+ return 0;
+}
+
+INT_PTR CALLBACK DlgProcOptsAppearance(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault( hwndDlg );
+
+ CheckDlgButton(hwndDlg, IDC_CHK_NOFOCUS, opt.bShowNoFocus ? TRUE : FALSE);
+ CheckDlgButton(hwndDlg, IDC_CHK_SBAR, opt.bStatusBarTips ? TRUE : FALSE);
+
+ SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_ADDSTRING, 0, (LPARAM)TranslateT("Icon on left"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_ADDSTRING, 0, (LPARAM)TranslateT("Icon on right"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_ADDSTRING, 0, (LPARAM)TranslateT("No icon"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_ADDSTRING, 0, (LPARAM)TranslateT("No title"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_SETCURSEL, (int)opt.titleLayout, 0);
+
+ SendDlgItemMessage(hwndDlg, IDC_CMB_POS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Bottom right"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_POS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Bottom left"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_POS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Top right"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_POS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Top left"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_POS, CB_SETCURSEL, (int)opt.pos, 0);
+
+ SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Top"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Centre"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Bottom"));
+ switch (opt.iLabelValign)
+ {
+ case DT_TOP: SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_SETCURSEL, 0, 0); break;
+ case DT_VCENTER: SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_SETCURSEL, 1, 0); break;
+ case DT_BOTTOM: SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_SETCURSEL, 2, 0); break;
+ }
+
+ SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Top"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Centre"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Bottom"));
+ switch (opt.iValueValign)
+ {
+ case DT_TOP: SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_SETCURSEL, 0, 0); break;
+ case DT_VCENTER: SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_SETCURSEL, 1, 0); break;
+ case DT_BOTTOM: SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_SETCURSEL, 2, 0); break;
+ }
+
+ SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_ADDSTRING, 0, (LPARAM)TranslateT("Left"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_ADDSTRING, 0, (LPARAM)TranslateT("Right"));
+ switch (opt.iLabelHalign)
+ {
+ case DT_LEFT: SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_SETCURSEL, 0, 0); break;
+ case DT_RIGHT: SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_SETCURSEL, 1, 0); break;
+ }
+
+ SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_ADDSTRING, 0, (LPARAM)TranslateT("Left"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_ADDSTRING, 0, (LPARAM)TranslateT("Right"));
+ switch (opt.iValueHalign)
+ {
+ case DT_LEFT: SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_SETCURSEL, 0, 0); break;
+ case DT_RIGHT: SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_SETCURSEL, 1, 0); break;
+ }
+
+ SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_ADDSTRING, 0, (LPARAM)TranslateT("No avatar"));
+ if (ServiceExists(MS_AV_DRAWAVATAR))
+ {
+ SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Left avatar"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_ADDSTRING, 0, (LPARAM)TranslateT("Right avatar"));
+ }
+ else
+ {
+ HWND hw = GetDlgItem(hwndDlg, IDC_CMB_AV);
+ EnableWindow(hw, FALSE);
+ hw = GetDlgItem(hwndDlg, IDC_SPIN_AVSIZE);
+ EnableWindow(hw, FALSE);
+ hw = GetDlgItem(hwndDlg, IDC_ED_AVSIZE);
+ EnableWindow(hw, FALSE);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_SETCURSEL, (int)opt.avatarLayout, 0);
+
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_WIDTH, UDM_SETRANGE, 0, (LPARAM)MAKELONG(2048, 16));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_MINWIDTH, UDM_SETRANGE, 0, (LPARAM)MAKELONG(2048, 16));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_MAXHEIGHT, UDM_SETRANGE, 0, (LPARAM)MAKELONG(2048, 16));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_MINHEIGHT, UDM_SETRANGE, 0, (LPARAM)MAKELONG(2048, 16));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_AVSIZE, UDM_SETRANGE, 0, (LPARAM)MAKELONG(100, 16));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_INDENT, UDM_SETRANGE, 0, (LPARAM)MAKELONG(400, 0));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_TITLEINDENT, UDM_SETRANGE, 0, (LPARAM)MAKELONG(400, 0));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_VALUEINDENT, UDM_SETRANGE, 0, (LPARAM)MAKELONG(400, 0));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_PADDING, UDM_SETRANGE, 0, (LPARAM)MAKELONG(128, 0));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_TEXTPADDING, UDM_SETRANGE, 0, (LPARAM)MAKELONG(128, 0));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_OUTAVPADDING, UDM_SETRANGE, 0, (LPARAM)MAKELONG(128, 0));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_INAVPADDING, UDM_SETRANGE, 0, (LPARAM)MAKELONG(128, 0));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_HOVER, UDM_SETRANGE, 0, (LPARAM)MAKELONG(5000, 5));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_SBWIDTH, UDM_SETRANGE, 0, (LPARAM)MAKELONG(2048, 0));
+
+ SetDlgItemInt(hwndDlg, IDC_ED_WIDTH, opt.iWinWidth, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_MAXHEIGHT, opt.iWinMaxHeight, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_MINWIDTH, opt.iMinWidth, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_MINHEIGHT, opt.iMinHeight, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_AVSIZE, opt.iAvatarSize, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_INDENT, opt.iTextIndent, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_TITLEINDENT, opt.iTitleIndent, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_VALUEINDENT, opt.iValueIndent, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_PADDING, opt.iPadding, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_TEXTPADDING, opt.iTextPadding, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_OUTAVPADDING, opt.iOuterAvatarPadding, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_INAVPADDING, opt.iInnerAvatarPadding, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_HOVER, opt.iTimeIn, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ED_SBWIDTH, opt.iSidebarWidth, FALSE);
+
+ CheckDlgButton(hwndDlg, IDC_CHK_ROUNDCORNERSAV, opt.bAvatarRound);
+ CheckDlgButton(hwndDlg, IDC_CHK_AVBORDER, opt.bAvatarBorder);
+ CheckDlgButton(hwndDlg, IDC_CHK_ORIGINALAVSIZE, opt.bOriginalAvatarSize);
+
+ if (opt.bOriginalAvatarSize)
+ SetDlgItemText(hwndDlg, IDC_STATIC_AVATARSIZE, TranslateT("Max avatar size:"));
+
+ return FALSE;
+ }
+ case WM_COMMAND:
+ {
+ if (LOWORD(wParam) == IDC_CHK_ORIGINALAVSIZE)
+ {
+ if (IsDlgButtonChecked(hwndDlg, IDC_CHK_ORIGINALAVSIZE))
+ SetDlgItemText(hwndDlg, IDC_STATIC_AVATARSIZE, TranslateT("Max avatar size:"));
+ else
+ SetDlgItemText(hwndDlg, IDC_STATIC_AVATARSIZE, TranslateT("Avatar size:"));
+ }
+
+ if (HIWORD(wParam) == CBN_SELCHANGE)
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ else if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ else if (HIWORD(wParam) == BN_CLICKED)
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+
+ break;
+ }
+ case WM_NOTIFY:
+ {
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY)
+ {
+ BOOL trans;
+ int new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_WIDTH, &trans, FALSE);
+ if (trans) opt.iWinWidth = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_MINWIDTH, &trans, FALSE);
+ if (trans) opt.iMinWidth = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_MAXHEIGHT, &trans, FALSE);
+ if (trans) opt.iWinMaxHeight = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_MINHEIGHT, &trans, FALSE);
+ if (trans) opt.iMinHeight = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_AVSIZE, &trans, FALSE);
+ if (trans) opt.iAvatarSize = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_INDENT, &trans, FALSE);
+ if (trans) opt.iTextIndent = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_TITLEINDENT, &trans, FALSE);
+ if (trans) opt.iTitleIndent = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_VALUEINDENT, &trans, FALSE);
+ if (trans) opt.iValueIndent = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_PADDING, &trans, FALSE);
+ if (trans) opt.iPadding = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_TEXTPADDING, &trans, FALSE);
+ if (trans) opt.iTextPadding = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_OUTAVPADDING, &trans, FALSE);
+ if (trans) opt.iOuterAvatarPadding = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_INAVPADDING, &trans, FALSE);
+ if (trans) opt.iInnerAvatarPadding = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_HOVER, &trans, FALSE);
+ if (trans) opt.iTimeIn = new_val;
+ new_val = GetDlgItemInt(hwndDlg, IDC_ED_SBWIDTH, &trans, FALSE);
+ if (trans) opt.iSidebarWidth = new_val;
+
+ opt.titleLayout = (PopupTitleLayout)SendDlgItemMessage(hwndDlg, IDC_CMB_ICON, CB_GETCURSEL, 0, 0);
+ opt.avatarLayout = (PopupAvLayout)SendDlgItemMessage(hwndDlg, IDC_CMB_AV, CB_GETCURSEL, 0, 0);
+ opt.pos = (PopupPosition)SendDlgItemMessage(hwndDlg, IDC_CMB_POS, CB_GETCURSEL, 0, 0);
+
+ opt.bAvatarBorder = IsDlgButtonChecked(hwndDlg, IDC_CHK_AVBORDER) ? true : false;
+ opt.bAvatarRound = IsDlgButtonChecked(hwndDlg, IDC_CHK_ROUNDCORNERSAV) && IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHK_ROUNDCORNERSAV)) ? true : false;
+ opt.bOriginalAvatarSize = IsDlgButtonChecked(hwndDlg, IDC_CHK_ORIGINALAVSIZE) ? true : false;
+
+ opt.bShowNoFocus = IsDlgButtonChecked(hwndDlg, IDC_CHK_NOFOCUS) ? true : false;
+ opt.bStatusBarTips = IsDlgButtonChecked(hwndDlg, IDC_CHK_SBAR) ? true : false;
+
+ switch(SendDlgItemMessage(hwndDlg, IDC_CMB_LV, CB_GETCURSEL, 0, 0))
+ {
+ case 0: opt.iLabelValign = DT_TOP; break;
+ case 1: opt.iLabelValign = DT_VCENTER; break;
+ case 2: opt.iLabelValign = DT_BOTTOM; break;
+ }
+
+ switch(SendDlgItemMessage(hwndDlg, IDC_CMB_VV, CB_GETCURSEL, 0, 0))
+ {
+ case 0: opt.iValueValign = DT_TOP; break;
+ case 1: opt.iValueValign = DT_VCENTER; break;
+ case 2: opt.iValueValign = DT_BOTTOM; break;
+ }
+
+ switch(SendDlgItemMessage(hwndDlg, IDC_CMB_LH, CB_GETCURSEL, 0, 0))
+ {
+ case 0: opt.iLabelHalign = DT_LEFT; break;
+ case 1: opt.iLabelHalign = DT_RIGHT; break;
+ }
+
+ switch(SendDlgItemMessage(hwndDlg, IDC_CMB_VH, CB_GETCURSEL, 0, 0))
+ {
+ case 0: opt.iValueHalign = DT_LEFT; break;
+ case 1: opt.iValueHalign = DT_RIGHT; break;
+ }
+
+ SaveOptions();
+ return TRUE;
+ }
+ break;
+ }
+ }
+
+ return 0;
+}
+
+INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ EXTRAICONDATA *dat;
+ dat = (EXTRAICONDATA *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hwndDlg);
+
+ CheckDlgButton(hwndDlg, IDC_CHK_WAITFORCONTENT, opt.bWaitForContent);
+ CheckDlgButton(hwndDlg, IDC_CHK_GETSTATUSMSG, opt.bGetNewStatusMsg);
+ CheckDlgButton(hwndDlg, IDC_CHK_DISABLEINVISIBLE, opt.bDisableIfInvisible);
+ CheckDlgButton(hwndDlg, IDC_CHK_RETRIEVEXSTATUS, opt.bRetrieveXstatus);
+ CheckDlgButton(hwndDlg, IDC_CHK_LIMITMSG, opt.bLimitMsg);
+ CheckDlgButton(hwndDlg, IDC_CHK_ENABLESMILEYS, opt.iSmileyAddFlags & SMILEYADD_ENABLE);
+ CheckDlgButton(hwndDlg, IDC_CHK_USEPROTOSMILEYS, opt.iSmileyAddFlags & SMILEYADD_USEPROTO);
+ CheckDlgButton(hwndDlg, IDC_CHK_ONLYISOLATED, opt.iSmileyAddFlags & SMILEYADD_ONLYISOLATED);
+ CheckDlgButton(hwndDlg, IDC_CHK_RESIZESMILEYS, opt.iSmileyAddFlags & SMILEYADD_RESIZE);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DISABLEINVISIBLE), opt.bGetNewStatusMsg);
+
+ BOOL bEnable = opt.iSmileyAddFlags & SMILEYADD_ENABLE;
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_USEPROTOSMILEYS), bEnable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_ONLYISOLATED), bEnable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_RESIZESMILEYS), bEnable);
+
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_CHARCOUNT, UDM_SETRANGE, 0, (LPARAM)MAKELONG(1024, 16));
+ SetDlgItemInt(hwndDlg, IDC_ED_CHARCOUNT, opt.iLimitCharCount, FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ED_CHARCOUNT), opt.bLimitMsg);
+
+ HIMAGELIST himlStates = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
+ ImageList_AddIcon(himlStates, LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
+ ImageList_AddIcon(himlStates, LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
+ ImageList_AddIcon(himlStates, LoadSkinnedIcon(SKINICON_OTHER_TICK));
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), himlStates, TVSIL_STATE);
+
+ int i;
+ for (i = 0; i < EXICONS_COUNT; i++)
+ {
+ exIcons[i].order = opt.exIconsOrder[i];
+ exIcons[i].vis = opt.exIconsVis[i];
+ }
+
+ dat = (EXTRAICONDATA *)mir_alloc(sizeof(EXTRAICONDATA));
+ dat->bDragging = false;
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), GWL_STYLE) | TVS_NOHSCROLL);
+
+ TVINSERTSTRUCT tvi = {0};
+ tvi.hParent = 0;
+ tvi.hInsertAfter = TVI_LAST;
+ tvi.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
+ tvi.item.stateMask = TVIS_STATEIMAGEMASK;
+ for (i = 0; i < SIZEOF(extraIconName); i++ )
+ {
+ tvi.item.lParam = (LPARAM)(&exIcons[i]);
+ tvi.item.pszText = TranslateTS(extraIconName[exIcons[i].order]);
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(exIcons[i].vis ? 2 : 1);
+ TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &tvi);
+ }
+
+ return TRUE;
+ }
+ case WM_COMMAND:
+ {
+ switch(LOWORD(wParam))
+ {
+ case IDC_CHK_ENABLESMILEYS:
+ {
+ BOOL bEnable;
+ bEnable = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLESMILEYS);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_RESIZESMILEYS), bEnable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_USEPROTOSMILEYS), bEnable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_ONLYISOLATED), bEnable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_RESIZESMILEYS), bEnable);
+ break;
+ }
+ case IDC_CHK_LIMITMSG:
+ {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ED_CHARCOUNT), IsDlgButtonChecked(hwndDlg, IDC_CHK_LIMITMSG));
+ break;
+ }
+ case IDC_CHK_GETSTATUSMSG:
+ {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DISABLEINVISIBLE), IsDlgButtonChecked(hwndDlg, IDC_CHK_GETSTATUSMSG));
+ break;
+ }
+ }
+
+ if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+
+ break;
+ }
+ case WM_NOTIFY:
+ {
+ switch (((LPNMHDR)lParam)->idFrom)
+ {
+ case 0:
+ {
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY)
+ {
+ TVITEM item = {0};
+ int i = 0;
+ DBCONTACTWRITESETTING cws;
+ cws.szModule = MODULE;
+ cws.szSetting = "IconOrder";
+ cws.value.type = DBVT_BLOB;
+ cws.value.cpbVal = SIZEOF(extraIconName);
+ cws.value.pbVal = opt.exIconsOrder;
+
+ item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS));
+ while (item.hItem != NULL)
+ {
+ item.mask = TVIF_HANDLE | TVIF_PARAM;
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &item);
+ opt.exIconsOrder[i++] = ((ICONSTATE *)item.lParam)->order;
+ item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg,IDC_TREE_EXTRAICONS), item.hItem);
+ }
+ CallService(MS_DB_CONTACT_WRITESETTING, 0,(LPARAM)&cws);
+
+ i = 0;
+ cws.szModule = MODULE;
+ cws.szSetting = "icons_vis";
+ cws.value.type = DBVT_BLOB;
+ cws.value.cpbVal = SIZEOF(extraIconName);
+ cws.value.pbVal = opt.exIconsVis;
+ item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg,IDC_TREE_EXTRAICONS));
+
+ while (item.hItem != NULL)
+ {
+ item.mask = TVIF_HANDLE | TVIF_PARAM;
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &item);
+ opt.exIconsVis[i++] = ((ICONSTATE *)item.lParam)->vis;
+ item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), item.hItem);
+ }
+ CallService(MS_DB_CONTACT_WRITESETTING, 0, (LPARAM)&cws);
+
+ opt.iSmileyAddFlags = 0;
+ opt.iSmileyAddFlags |= (IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLESMILEYS) ? SMILEYADD_ENABLE : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_CHK_USEPROTOSMILEYS) ? SMILEYADD_USEPROTO : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_CHK_ONLYISOLATED) ? SMILEYADD_ONLYISOLATED : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_CHK_RESIZESMILEYS) ? SMILEYADD_RESIZE : 0);
+
+ opt.bWaitForContent = IsDlgButtonChecked(hwndDlg, IDC_CHK_WAITFORCONTENT) ? true : false;
+ opt.bGetNewStatusMsg = IsDlgButtonChecked(hwndDlg, IDC_CHK_GETSTATUSMSG) ? true : false;
+ opt.bDisableIfInvisible = IsDlgButtonChecked(hwndDlg, IDC_CHK_DISABLEINVISIBLE) ? true : false;
+ opt.bRetrieveXstatus = IsDlgButtonChecked(hwndDlg, IDC_CHK_RETRIEVEXSTATUS) ? true : false;
+ opt.bLimitMsg = IsDlgButtonChecked(hwndDlg, IDC_CHK_LIMITMSG) ? true : false;
+ opt.iLimitCharCount = GetDlgItemInt(hwndDlg, IDC_ED_CHARCOUNT, 0, FALSE);
+
+ DBWriteContactSettingDword(0, MODULE, "SmileyAddFlags", opt.iSmileyAddFlags);
+ DBWriteContactSettingByte(0, MODULE, "WaitForContent", opt.bWaitForContent ? 1 : 0);
+ DBWriteContactSettingByte(0, MODULE, "GetNewStatusMsg", opt.bGetNewStatusMsg ? 1 : 0);
+ DBWriteContactSettingByte(0, MODULE, "DisableInvisible", opt.bDisableIfInvisible ? 1 : 0);
+ DBWriteContactSettingByte(0, MODULE, "RetrieveXStatus", opt.bRetrieveXstatus ? 1 : 0);
+ DBWriteContactSettingByte(0, MODULE, "LimitMsg", opt.bLimitMsg ? 1 : 0);
+ DBWriteContactSettingByte(0, MODULE, "LimitCharCount", opt.iLimitCharCount);
+
+ return TRUE;
+ }
+ break;
+ }
+ case IDC_TREE_EXTRAICONS:
+ {
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case TVN_BEGINDRAGA:
+ case TVN_BEGINDRAGW:
+ {
+ SetCapture(hwndDlg);
+ dat->bDragging = true;
+ dat->hDragItem = ((LPNMTREEVIEW)lParam)->itemNew.hItem;
+ TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), dat->hDragItem);
+ break;
+ }
+ case NM_CLICK:
+ {
+ TVHITTESTINFO hti;
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
+ {
+ if (hti.flags & TVHT_ONITEMSTATEICON)
+ {
+ TVITEMA item;
+ item.mask = TVIF_HANDLE | TVIF_STATE;
+ item.stateMask = TVIS_STATEIMAGEMASK;
+ item.hItem = hti.hItem;
+ TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &item);
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 1)
+ {
+ item.state = INDEXTOSTATEIMAGEMASK(2);
+ ((ICONSTATE *)item.lParam)->vis = 1;
+ }
+ else
+ {
+ item.state = INDEXTOSTATEIMAGEMASK(1);
+ ((ICONSTATE *)item.lParam)->vis = 0;
+ }
+
+ TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &item);
+ SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+ case WM_MOUSEMOVE:
+ {
+ if (!dat->bDragging)
+ break;
+
+ TVHITTESTINFO hti;
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
+ ClientToScreen(hwndDlg, &hti.pt);
+ ScreenToClient(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &hti.pt);
+ TreeView_HitTest(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &hti);
+ if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT))
+ {
+ HTREEITEM hItem = hti.hItem;
+ hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS)) / 2;
+ TreeView_HitTest(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &hti);
+ if (!(hti.flags & TVHT_ABOVE))
+ TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), hti.hItem, 1);
+ else
+ TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), hItem, 0);
+ }
+ else
+ {
+ if (hti.flags & TVHT_ABOVE)
+ SendDlgItemMessage(hwndDlg, IDC_TREE_EXTRAICONS, WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0);
+ if (hti.flags & TVHT_BELOW)
+ SendDlgItemMessage(hwndDlg, IDC_TREE_EXTRAICONS, WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), 0);
+
+ TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), 0, 0);
+ }
+ break;
+ }
+ case WM_LBUTTONUP:
+ {
+ if (!dat->bDragging)
+ break;
+
+ TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), 0, 0);
+ dat->bDragging = false;
+ ReleaseCapture();
+
+ TVHITTESTINFO hti;
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
+ ClientToScreen(hwndDlg, &hti.pt);
+ ScreenToClient(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &hti.pt);
+ hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS)) / 2;
+ TreeView_HitTest(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &hti);
+ if (dat->hDragItem == hti.hItem)
+ break;
+
+ if (hti.flags & TVHT_ABOVE)
+ hti.hItem = TVI_FIRST;
+
+ TVITEM item;
+ item.mask = TVIF_HANDLE | TVIF_PARAM;
+ item.hItem = dat->hDragItem;
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &item);
+ if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST))
+ {
+ TVINSERTSTRUCT tvis;
+ TCHAR swzName[256];
+ tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
+ tvis.item.stateMask = TVIS_STATEIMAGEMASK;
+ tvis.item.pszText = swzName;
+ tvis.item.cchTextMax = 256;
+ tvis.item.hItem = dat->hDragItem;
+ tvis.item.state = INDEXTOSTATEIMAGEMASK(((ICONSTATE *)item.lParam)->vis ? 2 : 1);
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &tvis.item);
+ TreeView_DeleteItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), dat->hDragItem);
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = hti.hItem;
+ TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &tvis));
+ SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
+ }
+
+ break;
+ }
+ case WM_DESTROY:
+ {
+ ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), TVSIL_STATE));
+ mir_free(dat);
+ break;
+ }
+ }
+ return 0;
+}
+
+void EnableControls(HWND hwndDlg, BOOL bEnableSkin)
+{
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ST_PREVIEW), (bEnableSkin && opt.szPreviewFile[0]) ? SW_HIDE : SW_SHOW);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_PIC_PREVIEW), (bEnableSkin && opt.szPreviewFile[0]) ? SW_SHOW : SW_HIDE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SHADOW), !bEnableSkin);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_BORDER), !bEnableSkin);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_ROUNDCORNERS), !bEnableSkin);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_LOADFONTS), bEnableSkin);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_LOADPROPORTIONS), bEnableSkin);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_ENABLECOLORING), bEnableSkin && opt.iEnableColoring != -1);
+}
+
+int iLastSel;
+INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hwndDlg);
+ iLastSel = RefreshSkinList(hwndDlg);
+
+ SendDlgItemMessage(hwndDlg, IDC_BTN_RELOADLIST, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_RELOADLIST, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reload skin list"), BATF_TCHAR);
+ HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RELOAD));
+ SendDlgItemMessage(hwndDlg, IDC_BTN_RELOADLIST, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
+ DestroyIcon(hIcon);
+
+ SendDlgItemMessage(hwndDlg, IDC_BTN_APPLYSKIN, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_APPLYSKIN, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Apply skin"), BATF_TCHAR);
+ hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_APPLY));
+ SendDlgItemMessage(hwndDlg, IDC_BTN_APPLYSKIN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
+ DestroyIcon(hIcon);
+
+ SendDlgItemMessage(hwndDlg, IDC_BTN_GETSKINS, BUTTONSETASFLATBTN, 0, 0);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_GETSKINS, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Get more skins"), BATF_TCHAR);
+ SendDlgItemMessage(hwndDlg, IDC_BTN_GETSKINS, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinnedIcon(SKINICON_EVENT_URL));
+
+
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_TRANS, UDM_SETRANGE, 0, (LPARAM)MAKELONG(100, 0));
+ SetDlgItemInt(hwndDlg, IDC_ED_TRANS, opt.iOpacity, FALSE);
+
+ CheckDlgButton(hwndDlg, IDC_CHK_BORDER, opt.bBorder);
+ CheckDlgButton(hwndDlg, IDC_CHK_ROUNDCORNERS, opt.bRound);
+ CheckDlgButton(hwndDlg, IDC_CHK_SHADOW, opt.bDropShadow);
+ CheckDlgButton(hwndDlg, IDC_CHK_AEROGLASS, opt.bAeroGlass);
+ CheckDlgButton(hwndDlg, IDC_CHK_LOADFONTS, opt.bLoadFonts);
+ CheckDlgButton(hwndDlg, IDC_CHK_LOADPROPORTIONS, opt.bLoadProportions);
+ if (opt.iEnableColoring != -1)
+ CheckDlgButton(hwndDlg, IDC_CHK_ENABLECOLORING, opt.iEnableColoring ? 1 : 0);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_AEROGLASS), MyDwmEnableBlurBehindWindow != 0);
+
+ SendDlgItemMessage(hwndDlg, IDC_CMB_EFFECT, CB_ADDSTRING, 0, (LPARAM)TranslateT("None"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_EFFECT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Animation"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_EFFECT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Fade"));
+ SendDlgItemMessage(hwndDlg, IDC_CMB_EFFECT, CB_SETCURSEL, (int)opt.showEffect, 0);
+
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_SPEED, UDM_SETRANGE, 0, (LPARAM)MAKELONG(20, 1));
+ SetDlgItemInt(hwndDlg, IDC_ED_SPEED, opt.iAnimateSpeed, FALSE);
+
+ EnableControls(hwndDlg, opt.skinMode == SM_IMAGE);
+ return TRUE;
+ }
+ case WM_DRAWITEM:
+ {
+ if (wParam == IDC_PIC_PREVIEW)
+ {
+ DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
+ HBRUSH hbr = GetSysColorBrush(COLOR_BTNFACE);
+ FillRect(dis->hDC, &dis->rcItem, hbr);
+
+ if (opt.szPreviewFile[0])
+ {
+ HDC hdcMem = CreateCompatibleDC(dis->hDC);
+ HBITMAP hbmpPreview = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)opt.szPreviewFile, 0);
+ if (hbmpPreview)
+ {
+ int iWidth = dis->rcItem.right - dis->rcItem.left;
+ int iHeight = dis->rcItem.bottom - dis->rcItem.top;
+
+ ResizeBitmap rb = {0};
+ rb.size = sizeof(rb);
+ rb.hBmp = hbmpPreview;
+ rb.max_width = iWidth;
+ rb.max_height = iHeight;
+ rb.fit = RESIZEBITMAP_KEEP_PROPORTIONS;
+ HBITMAP hbmpRes = (HBITMAP)CallService(MS_IMG_RESIZE, (WPARAM)&rb, 0);
+ if (hbmpRes)
+ {
+ BITMAP bmp;
+ GetObject(hbmpRes, sizeof(bmp), &bmp);
+ SelectObject(hdcMem, hbmpRes);
+ BitBlt(dis->hDC, (iWidth - bmp.bmWidth) / 2, (iHeight - bmp.bmHeight) / 2, iWidth, iHeight, hdcMem, 0, 0, SRCCOPY);
+ if (hbmpPreview != hbmpRes)
+ DeleteBitmap(hbmpRes);
+ }
+
+ DeleteBitmap(hbmpPreview);
+ }
+
+ DeleteDC(hdcMem);
+ }
+ }
+ break;
+ }
+ case WM_COMMAND:
+ {
+ switch (HIWORD(wParam))
+ {
+ case LBN_SELCHANGE:
+ {
+ if (LOWORD(wParam) == IDC_LB_SKINS)
+ {
+ HWND hwndList = GetDlgItem(hwndDlg, IDC_LB_SKINS);
+ int iSel = ListBox_GetCurSel(hwndList);
+ if (iSel != iLastSel)
+ {
+ if (iSel == 0)
+ {
+ opt.szPreviewFile[0] = 0;
+ EnableControls(hwndDlg, FALSE);
+ }
+ else if (iSel != LB_ERR)
+ {
+ TCHAR swzSkinName[256];
+ if (ListBox_GetText(hwndList, iSel, swzSkinName) > 0)
+ {
+ char *skin = mir_t2a(swzSkinName);
+ ParseSkinFile(skin, false, true);
+ mir_free(skin);
+ }
+ EnableControls(hwndDlg, TRUE);
+ if (opt.iEnableColoring != -1)
+ CheckDlgButton(hwndDlg, IDC_CHK_ENABLECOLORING, opt.iEnableColoring ? 1 : 0);
+ }
+
+ InvalidateRect(GetDlgItem(hwndDlg, IDC_PIC_PREVIEW), 0, FALSE);
+ iLastSel = iSel;
+ }
+ }
+ else if (LOWORD(wParam) == IDC_CMB_EFFECT)
+ {
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+
+ break;
+ }
+ case BN_CLICKED:
+ {
+ if (LOWORD(wParam) == IDC_BTN_APPLYSKIN)
+ {
+ int iSel = ListBox_GetCurSel(GetDlgItem(hwndDlg, IDC_LB_SKINS));
+ if (iSel == 0)
+ {
+ opt.skinMode = SM_COLORFILL;
+ opt.szSkinName[0] = 0;
+ }
+ else if (iSel != LB_ERR)
+ {
+ TCHAR swzSkinName[256];
+ if (ListBox_GetText(GetDlgItem(hwndDlg, IDC_LB_SKINS), iSel, swzSkinName) > 0)
+ {
+ opt.skinMode = SM_IMAGE;
+ t2a(swzSkinName, opt.szSkinName, sizeof(opt.szSkinName));
+ ParseSkinFile(opt.szSkinName, false, false);
+ ReloadFont(0, 0);
+ SaveOptions();
+ }
+ }
+
+ DBWriteContactSettingByte(0, MODULE, "SkinEngine", opt.skinMode);
+ DBWriteContactSettingString(0, MODULE, "SkinName", opt.szSkinName);
+
+ DestroySkinBitmap();
+ SetDlgItemInt(hwndDlg, IDC_ED_TRANS, opt.iOpacity, FALSE);
+ }
+ else if (LOWORD(wParam) == IDC_BTN_RELOADLIST)
+ iLastSel = RefreshSkinList(hwndDlg);
+ else if (LOWORD(wParam) == IDC_CHK_LOADFONTS)
+ opt.bLoadFonts = IsDlgButtonChecked(hwndDlg, IDC_CHK_LOADFONTS) ? true : false;
+ else if (LOWORD(wParam) == IDC_CHK_LOADPROPORTIONS)
+ opt.bLoadProportions = IsDlgButtonChecked(hwndDlg, IDC_CHK_LOADPROPORTIONS) ? true : false;
+ else if (LOWORD(wParam) == IDC_BTN_GETSKINS)
+ CallService(MS_UTILS_OPENURL, 0, (LPARAM)"http://www.miranda-easy.net/tipper");
+
+ break;
+ }
+ }
+
+ if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+
+ break;
+ }
+ case WM_NOTIFY:
+ {
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY )
+ {
+ opt.iOpacity = GetDlgItemInt(hwndDlg, IDC_ED_TRANS, 0, 0);
+ opt.bDropShadow = IsDlgButtonChecked(hwndDlg, IDC_CHK_SHADOW) ? true : false;
+ opt.bBorder = IsDlgButtonChecked(hwndDlg, IDC_CHK_BORDER) ? true : false;
+ opt.bRound = IsDlgButtonChecked(hwndDlg, IDC_CHK_ROUNDCORNERS) ? true : false;
+ opt.bAeroGlass = IsDlgButtonChecked(hwndDlg, IDC_CHK_AEROGLASS) ? true : false;
+ opt.showEffect = (PopupShowEffect)SendDlgItemMessage(hwndDlg, IDC_CMB_EFFECT, CB_GETCURSEL, 0, 0);
+ opt.iAnimateSpeed = GetDlgItemInt(hwndDlg, IDC_ED_SPEED, 0, 0);
+ opt.bLoadFonts = IsDlgButtonChecked(hwndDlg, IDC_CHK_LOADFONTS) ? true : false;
+ opt.bLoadProportions = IsDlgButtonChecked(hwndDlg, IDC_CHK_LOADPROPORTIONS) ? true : false;
+
+ if (opt.iEnableColoring != -1)
+ opt.iEnableColoring = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLECOLORING) ? true : false;
+
+ SaveSkinOptions();
+ return TRUE;
+ }
+ }
+ }
+
+ return FALSE;
+}
+
+INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hwndDlg);
+
+ if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS && !DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, (WPARAM) FALSE, 0);
+ else
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, (WPARAM) TRUE, 0);
+
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETHIDEEMPTYGROUPS, 1, 0);
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETGREYOUTFLAGS, 0, 0);
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETLEFTMARGIN, 2, 0);
+
+ HANDLE hContact, hItem;
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while (hContact)
+ {
+ hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ if (hItem && DBGetContactSettingByte(hContact, MODULE, "FavouriteContact", 0))
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
+
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ }
+
+ CheckDlgButton(hwndDlg, IDC_CHK_HIDEOFFLINE, opt.iFavoriteContFlags & FAVCONT_HIDE_OFFLINE);
+ CheckDlgButton(hwndDlg, IDC_CHK_APPENDPROTO, opt.iFavoriteContFlags & FAVCONT_APPEND_PROTO);
+
+ return TRUE;
+ }
+ case WM_COMMAND:
+ {
+ switch(LOWORD(wParam))
+ {
+ case IDC_BTN_OK:
+ {
+ HANDLE hContact, hItem;
+ BYTE isChecked;
+ int count = 0;
+
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while (hContact)
+ {
+ hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ if (hItem)
+ {
+ isChecked = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
+ DBWriteContactSettingByte(hContact, MODULE, "FavouriteContact", isChecked);
+ if (isChecked) count++;
+ }
+
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ }
+ DBWriteContactSettingDword(0, MODULE, "FavouriteContactsCount", count);
+
+ opt.iFavoriteContFlags = 0;
+ opt.iFavoriteContFlags |= IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? FAVCONT_HIDE_OFFLINE : 0 |
+ IsDlgButtonChecked(hwndDlg, IDC_CHK_APPENDPROTO) ? FAVCONT_APPEND_PROTO : 0;
+
+ DBWriteContactSettingDword(0, MODULE, "FavContFlags", opt.iFavoriteContFlags);
+ } // fall through
+ case IDC_BTN_CANCEL:
+ {
+ DestroyWindow(hwndDlg);
+ break;
+ }
+ }
+ return TRUE;
+ }
+ case WM_CLOSE:
+ {
+ DestroyWindow(hwndDlg);
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hwndDlg);
+
+ CheckDlgButton(hwndDlg, IDC_CHK_ENABLETRAYTIP, opt.bTraytip);
+ CheckDlgButton(hwndDlg, IDC_CHK_HANDLEBYTIPPER, opt.bHandleByTipper);
+ CheckDlgButton(hwndDlg, IDC_CHK_EXPAND, opt.bExpandTraytip);
+ CheckDlgButton(hwndDlg, IDC_CHK_HIDEOFFLINE, opt.bHideOffline);
+ SendDlgItemMessage(hwndDlg, IDC_SPIN_EXPANDTIME, UDM_SETRANGE, 0, (LPARAM)MAKELONG(5000, 10));
+ SetDlgItemInt(hwndDlg, IDC_ED_EXPANDTIME, opt.iExpandTime, FALSE);
+ SendMessage(hwndDlg, WM_COMMAND, MAKELONG(IDC_CHK_ENABLETRAYTIP, 0), 0);
+
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), GWL_STYLE) | TVS_NOHSCROLL);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), GWL_STYLE) | TVS_NOHSCROLL);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), GWL_STYLE) | TVS_NOHSCROLL);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), GWL_STYLE) | TVS_NOHSCROLL);
+
+ HIMAGELIST himlCheckBoxes;
+ himlCheckBoxes = ImageList_Create(16, 16, IsWinVerXPPlus() ? ILC_COLOR32 | ILC_MASK : ILC_COLOR8 | ILC_MASK, 3, 0);
+ ImageList_AddIcon(himlCheckBoxes, LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
+ ImageList_AddIcon(himlCheckBoxes, LoadSkinnedIcon(SKINICON_OTHER_NOTICK));
+ ImageList_AddIcon(himlCheckBoxes, LoadSkinnedIcon(SKINICON_OTHER_TICK));
+
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), himlCheckBoxes, TVSIL_STATE);
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), himlCheckBoxes, TVSIL_STATE);
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), himlCheckBoxes, TVSIL_STATE);
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), himlCheckBoxes, TVSIL_STATE);
+
+ TVINSERTSTRUCT tvi = {0};
+ tvi.hParent = 0;
+ tvi.hInsertAfter = TVI_LAST;
+ tvi.item.mask = TVIF_TEXT | TVIF_STATE;
+
+ int i, count = 0;
+ PROTOACCOUNT **accs;
+ ProtoEnumAccounts(&count, &accs);
+
+ for (i = 0; i < count; i++)
+ {
+ if (accs[i]->type == PROTOTYPE_PROTOCOL && CallProtoService(accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) != 0)
+ {
+ tvi.item.pszText = accs[i]->tszAccountName;
+ tvi.item.stateMask = TVIS_STATEIMAGEMASK;
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(IsTrayProto(accs[i]->tszAccountName, false) ? 2 : 1);
+ TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), &tvi);
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(IsTrayProto(accs[i]->tszAccountName, true) ? 2 : 1);
+ TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), &tvi);
+ }
+ }
+
+ for (i = 0; i < SIZEOF(trayTipItems); i++)
+ {
+ tvi.item.pszText = TranslateTS(trayTipItems[i]);
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(opt.iFirstItems & (1 << i) ? 2 : 1);
+ TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &tvi);
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(opt.iSecondItems & (1 << i) ? 2 : 1);
+ TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), &tvi);
+ }
+
+ return TRUE;
+ }
+ case WM_COMMAND:
+ {
+ switch(LOWORD(wParam))
+ {
+ UINT state;
+ case IDC_CHK_ENABLETRAYTIP:
+ {
+ state = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_HANDLEBYTIPPER), state);
+ } // fall through
+ case IDC_CHK_HANDLEBYTIPPER:
+ {
+ state = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER) &
+ IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_HIDEOFFLINE), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_FAVCONTACTS), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_EXPAND), state);
+ } // fall through
+ case IDC_CHK_EXPAND:
+ {
+ state = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER) &
+ IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP) &
+ IsDlgButtonChecked(hwndDlg, IDC_CHK_EXPAND);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), state);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ED_EXPANDTIME), state);
+ break;
+ }
+ case IDC_BTN_FAVCONTACTS:
+ {
+ CreateDialog(hInst, MAKEINTRESOURCE(IDD_FAVCONTACTS), 0, DlgProcFavouriteContacts);
+ break;
+ }
+ }
+
+ if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus())
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+
+ break;
+ }
+ case WM_NOTIFY:
+ {
+ switch (((LPNMHDR)lParam)->idFrom)
+ {
+ case 0:
+ {
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY)
+ {
+ TCHAR buff[256];
+ TCHAR swzProtos[1024] = {0};
+
+ TVITEM item;
+ item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg,IDC_TREE_FIRST_PROTOS));
+ item.pszText = buff;
+ item.cchTextMax = 256;
+ item.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_STATE;
+ item.stateMask = TVIS_STATEIMAGEMASK;
+ while (item.hItem != NULL)
+ {
+ TreeView_GetItem(GetDlgItem(hwndDlg,IDC_TREE_FIRST_PROTOS), &item);
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
+ {
+ _tcscat(swzProtos, buff);
+ _tcscat(swzProtos, _T(" "));
+ }
+
+ item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), item.hItem);
+ }
+
+ DBWriteContactSettingTString(0, MODULE, "TrayProtocols", swzProtos);
+
+ swzProtos[0] = 0;
+ item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg,IDC_TREE_SECOND_PROTOS));
+ item.pszText = buff;
+ while (item.hItem != NULL)
+ {
+ TreeView_GetItem(GetDlgItem(hwndDlg,IDC_TREE_SECOND_PROTOS), &item);
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
+ {
+ _tcscat(swzProtos, buff);
+ _tcscat(swzProtos, _T(" "));
+ }
+
+ item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), item.hItem);
+ }
+
+ DBWriteContactSettingTString(0, MODULE, "TrayProtocolsEx", swzProtos);
+
+ int count = 0;
+ opt.iFirstItems = 0;
+ item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg,IDC_TREE_FIRST_ITEMS));
+ item.mask = TVIF_HANDLE | TVIF_STATE;
+ item.stateMask = TVIS_STATEIMAGEMASK;
+ while (item.hItem != NULL)
+ {
+ TreeView_GetItem(GetDlgItem(hwndDlg,IDC_TREE_FIRST_ITEMS), &item);
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
+ opt.iFirstItems |= (1 << count);
+
+ item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), item.hItem);
+ count++;
+ }
+
+ count = 0;
+ opt.iSecondItems = 0;
+ item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg,IDC_TREE_SECOND_ITEMS));
+ while (item.hItem != NULL)
+ {
+ TreeView_GetItem(GetDlgItem(hwndDlg,IDC_TREE_SECOND_ITEMS), &item);
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 2)
+ opt.iSecondItems |= (1 << count);
+
+ item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_ITEMS), item.hItem);
+ count++;
+ }
+
+ opt.bTraytip = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENABLETRAYTIP) ? true : false;
+ opt.bHandleByTipper = IsDlgButtonChecked(hwndDlg, IDC_CHK_HANDLEBYTIPPER) ? true : false;
+ opt.bExpandTraytip = IsDlgButtonChecked(hwndDlg, IDC_CHK_EXPAND) ? true : false;
+ opt.bHideOffline = IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? true : false;
+ opt.iExpandTime = max(min(GetDlgItemInt(hwndDlg, IDC_ED_EXPANDTIME, 0, FALSE), 5000), 10);
+
+ DBWriteContactSettingByte(0, MODULE, "TrayTip", (opt.bTraytip ? 1 : 0));
+ DBWriteContactSettingByte(0, MODULE, "ExtendedTrayTip", (opt.bHandleByTipper ? 1 : 0));
+ DBWriteContactSettingByte(0, MODULE, "ExpandTrayTip", (opt.bExpandTraytip ? 1 : 0));
+ DBWriteContactSettingByte(0, MODULE, "HideOffline", (opt.bHideOffline ? 1 : 0));
+ DBWriteContactSettingDword(0, MODULE, "ExpandTime", opt.iExpandTime);
+ DBWriteContactSettingDword(0, MODULE, "TrayTipItems", opt.iFirstItems);
+ DBWriteContactSettingDword(0, MODULE, "TrayTipItemsEx", opt.iSecondItems);
+ return TRUE;
+ }
+ break;
+ }
+ case IDC_TREE_FIRST_PROTOS:
+ case IDC_TREE_SECOND_PROTOS:
+ case IDC_TREE_FIRST_ITEMS:
+ case IDC_TREE_SECOND_ITEMS:
+ {
+ if (((LPNMHDR)lParam)->code == NM_CLICK)
+ {
+ TVHITTESTINFO hti;
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
+ {
+ if (hti.flags & TVHT_ONITEMSTATEICON)
+ {
+ TVITEMA item = {0};
+ item.hItem = hti.hItem;
+ item.mask = TVIF_HANDLE | TVIF_STATE;
+ item.stateMask = TVIS_STATEIMAGEMASK;
+ TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &item);
+
+ if (((item.state & TVIS_STATEIMAGEMASK) >> 12) == 1)
+ item.state = INDEXTOSTATEIMAGEMASK(2);
+ else
+ item.state = INDEXTOSTATEIMAGEMASK(1);
+
+ TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &item);
+ SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
+ }
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+ case WM_DESTROY:
+ {
+ ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), TVSIL_STATE));
+ break;
+ }
+ }
+
+ return FALSE;
+}
+
+int OptInit(WPARAM wParam, LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp = {0};
+
+ odp.cbSize = sizeof(odp);
+ odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.position = -790000000;
+ odp.hInstance = hInst;
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_APPEARANCE);
+ odp.ptszTab = LPGENT("Appearance");
+ odp.ptszTitle = LPGENT("Tooltips");
+ odp.ptszGroup = LPGENT("Customize");
+ odp.nIDBottomSimpleControl = 0;
+ odp.pfnDlgProc = DlgProcOptsAppearance;
+ CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp );
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN);
+ odp.ptszTab = LPGENT("Tooltip skin");
+ odp.ptszTitle = LPGENT("Tooltips");
+ odp.ptszGroup = LPGENT("Customize");
+ odp.nIDBottomSimpleControl = 0;
+ odp.pfnDlgProc = DlgProcOptsSkin;
+ CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp );
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CONTENT);
+ odp.ptszTab = LPGENT("Content");
+ odp.ptszTitle = LPGENT("Tooltips");
+ odp.ptszGroup = LPGENT("Customize");
+ odp.nIDBottomSimpleControl = 0;
+ odp.pfnDlgProc = DlgProcOptsContent;
+ CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp );
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TRAYTIP);
+ odp.ptszTab = LPGENT("Tray tooltip");
+ odp.ptszTitle = LPGENT("Tooltips");
+ odp.ptszGroup = LPGENT("Customize");
+ odp.nIDBottomSimpleControl = 0;
+ odp.pfnDlgProc = DlgProcOptsTraytip;
+
+ CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp );
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_EXTRA);
+ odp.ptszTab = LPGENT("Extra");
+ odp.ptszTitle = LPGENT("Tooltips");
+ odp.ptszGroup = LPGENT("Customize");
+ odp.nIDBottomSimpleControl = 0;
+ odp.pfnDlgProc = DlgProcOptsExtra;
+ CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp );
+
+ return 0;
+}
+
+HANDLE hEventOptInit;
+
+void InitOptions()
+{
+ hEventOptInit = HookEvent(ME_OPT_INITIALISE, OptInit);
+}
+
+void DeinitOptions()
+{
+ UnhookEvent(hEventOptInit);
+
+ DIListNode *di_node = opt.diList;
+ while(opt.diList)
+ {
+ di_node = opt.diList;
+ opt.diList = opt.diList->next;
+ mir_free(di_node);
+ }
+
+ DSListNode *ds_node = opt.dsList;
+ while(opt.dsList)
+ {
+ ds_node = opt.dsList;
+ opt.dsList = opt.dsList->next;
+ mir_free(ds_node);
+ }
+
+ for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
+ {
+ if (opt.szImgFile[i])
+ mir_free(opt.szImgFile[i]);
+ }
+}
diff --git a/plugins/TipperYM/options.h b/plugins/TipperYM/options.h new file mode 100644 index 0000000000..4866b09a8b --- /dev/null +++ b/plugins/TipperYM/options.h @@ -0,0 +1,196 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _OPTIONS_INC
+#define _OPTIONS_INC
+
+#include "translations.h"
+#include "popwin.h"
+#include "bitmap_func.h"
+#include "skin_parser.h"
+
+#define WMU_ENABLE_LIST_BUTTONS (WM_USER + 0x030)
+#define WMU_ENABLE_MODULE_ENTRY (WM_USER + 0x031)
+
+#define LABEL_LEN 1024
+#define VALUE_LEN 8192
+#define MODULE_NAME_LEN 512
+#define SETTING_NAME_LEN 512
+
+// chekcbox icons
+#define IDI_NOTICK 205
+#define IDI_TICK 206
+#define IDPRESETITEM 1000
+
+#define MS_TOOLTIP_SHOWTIP "mToolTip/ShowTip"
+
+typedef struct {
+ UINT id, uintCoreIconId, uintResIconId;
+ TCHAR *swzTooltip;
+} OPTBUTTON;
+
+typedef struct {
+ TCHAR swzLabel[LABEL_LEN];
+ TCHAR swzValue[VALUE_LEN];
+ bool bLineAbove, bValueNewline;
+ bool bIsVisible;
+ bool bParseTipperVarsFirst;
+} DISPLAYITEM;
+
+typedef enum {DVT_DB = 0, DVT_PROTODB = 1} DisplaySubstType;
+typedef struct {
+ TCHAR swzName[LABEL_LEN];
+ DisplaySubstType type;
+ char szModuleName[MODULE_NAME_LEN];
+ char szSettingName[SETTING_NAME_LEN];
+ int iTranslateFuncId;
+} DISPLAYSUBST;
+
+struct DSListNode {
+ DISPLAYSUBST ds;
+ DSListNode *next;
+};
+
+struct DIListNode {
+ DISPLAYITEM di;
+ DIListNode *next;
+};
+
+typedef struct {
+ BYTE top;
+ BYTE right;
+ BYTE bottom;
+ BYTE left;
+} MARGINS;
+
+// tray tooltip items
+static TCHAR* trayTipItems[TRAYTIP_ITEMS_COUNT] =
+{
+ LPGENT("Number of contacts"),
+ LPGENT("Protocol lock status"),
+ LPGENT("Logon time"),
+ LPGENT("Unread emails"),
+ LPGENT("Status"),
+ LPGENT("Status message"),
+ LPGENT("Extra status"),
+ LPGENT("Listening to"),
+ LPGENT("Favourite contacts"),
+ LPGENT("Miranda uptime"),
+ LPGENT("Clist event")
+};
+
+// extra icons
+static TCHAR* extraIconName[6] =
+{
+ LPGENT("Status"),
+ LPGENT("Extra status"),
+ LPGENT("Jabber activity"),
+ LPGENT("Gender"),
+ LPGENT("Country flag"),
+ LPGENT("Client")
+};
+
+typedef struct {
+ bool bDragging;
+ HTREEITEM hDragItem;
+} EXTRAICONDATA;
+
+typedef struct {
+ BYTE order;
+ BYTE vis;
+} ICONSTATE;
+
+typedef enum {PAV_NONE=0, PAV_LEFT=1, PAV_RIGHT=2} PopupAvLayout;
+typedef enum {PTL_LEFTICON=0, PTL_RIGHTICON=1, PTL_NOICON=2, PTL_NOTITLE=3} PopupTitleLayout;
+typedef enum {PP_BOTTOMRIGHT=0, PP_BOTTOMLEFT=1, PP_TOPRIGHT=2, PP_TOPLEFT=3} PopupPosition;
+typedef enum {PSE_NONE=0, PSE_ANIMATE=1, PSE_FADE=2} PopupShowEffect;
+
+typedef struct {
+ int iWinWidth, iWinMaxHeight, iAvatarSize; //tweety
+ PopupTitleLayout titleLayout;
+ PopupAvLayout avatarLayout;
+ int iTextIndent, iTitleIndent, iValueIndent;
+ bool bShowNoFocus;
+ DSListNode *dsList;
+ int iDsCount;
+ DIListNode *diList;
+ int iDiCount;
+ int iTimeIn;
+ int iPadding, iOuterAvatarPadding, iInnerAvatarPadding, iTextPadding;
+ PopupPosition pos;
+ int iMinWidth, iMinHeight; // no UI for these
+ int iMouseTollerance;
+ bool bStatusBarTips;
+ int iSidebarWidth;
+ COLORREF colBg, colBorder, colAvatarBorder, colDivider, colBar, colTitle, colLabel, colValue, colTrayTitle, colSidebar;
+ int iLabelValign, iLabelHalign, iValueValign, iValueHalign;
+ bool bWaitForStatusMsg, bWaitForAvatar;
+
+ // tooltip skin
+ SkinMode skinMode;
+ char szSkinName[256];
+ char szPreviewFile[1024];
+ char *szImgFile[SKIN_ITEMS_COUNT];
+ MARGINS margins[SKIN_ITEMS_COUNT];
+ TransformationMode transfMode[SKIN_ITEMS_COUNT];
+ PopupShowEffect showEffect;
+ bool bLoadFonts;
+ bool bLoadProportions;
+ int iEnableColoring;
+ int iAnimateSpeed;
+ int iOpacity;
+ int iAvatarOpacity;
+ bool bBorder;
+ bool bRound, bAvatarRound;
+ bool bDropShadow;
+ bool bAeroGlass;
+
+ // tray tooltip
+ bool bTraytip;
+ bool bHandleByTipper;
+ bool bExpandTraytip;
+ bool bHideOffline;
+ int iExpandTime;
+ int iFirstItems, iSecondItems;
+ int iFavoriteContFlags;
+
+ // extra setting
+ bool bOriginalAvatarSize;
+ bool bAvatarBorder;
+ bool bWaitForContent;
+ bool bGetNewStatusMsg;
+ bool bDisableIfInvisible;
+ bool bRetrieveXstatus;
+ bool bLimitMsg;
+ int iLimitCharCount;
+ int iSmileyAddFlags;
+ BYTE exIconsOrder[EXICONS_COUNT];
+ BYTE exIconsVis[EXICONS_COUNT];
+} OPTIONS;
+
+
+extern OPTIONS opt;
+
+void InitOptions();
+void LoadOptions();
+void SaveOptions();
+void DeinitOptions();
+
+#endif
diff --git a/plugins/TipperYM/popwin.cpp b/plugins/TipperYM/popwin.cpp new file mode 100644 index 0000000000..6e75b75654 --- /dev/null +++ b/plugins/TipperYM/popwin.cpp @@ -0,0 +1,1999 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#include "common.h"
+#include "subst.h"
+#include "popwin.h"
+#include "message_pump.h"
+#include "str_utils.h"
+#include "bitmap_func.h"
+#include "translations.h"
+#include "sdk/m_gender.h"
+
+extern TOOLTIPSKIN skin;
+
+__inline void AddRow(PopupWindowData *pwd, TCHAR *swzLabel, TCHAR *swzValue, char *szProto, bool bParseSmileys, bool bNewline, bool bLineAbove, bool bIsTitle = false, HICON hIcon = NULL)
+{
+ pwd->rows = (RowData *)mir_realloc(pwd->rows, sizeof(RowData) * (pwd->iRowCount + 1));
+ pwd->rows[pwd->iRowCount].swzLabel = swzLabel ? mir_tstrdup(swzLabel) : NULL;
+ pwd->rows[pwd->iRowCount].swzValue = swzValue ? mir_tstrdup(swzValue) : NULL;
+ pwd->rows[pwd->iRowCount].spi = bParseSmileys ? Smileys_PreParse(swzValue, (int)_tcslen(swzValue), szProto) : NULL;
+ pwd->rows[pwd->iRowCount].bValueNewline = bNewline;
+ pwd->rows[pwd->iRowCount].bLineAbove = bLineAbove;
+ pwd->rows[pwd->iRowCount].bIsTitle = bIsTitle;
+ pwd->rows[pwd->iRowCount].hIcon = hIcon;
+ pwd->iRowCount++;
+}
+
+LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ PopupWindowData *pwd = (PopupWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+
+ switch(uMsg)
+ {
+ case WM_CREATE:
+ {
+ CREATESTRUCT *cs = (CREATESTRUCT *)lParam;
+ pwd = (PopupWindowData *)mir_alloc(sizeof(PopupWindowData));
+ memset(pwd, 0, sizeof(PopupWindowData));
+ pwd->clcit = *(CLCINFOTIPEX *)cs->lpCreateParams;
+ pwd->iIconIndex = -1;
+ pwd->hpenBorder = opt.bBorder ? (HPEN)CreatePen(PS_SOLID, 1, opt.colBorder) : (HPEN)CreatePen(PS_SOLID, 1, opt.colBg);
+ pwd->hpenDivider = (HPEN)CreatePen(PS_SOLID, 1, opt.colDivider);
+ pwd->iTrans = (int)(opt.iOpacity / 100.0 * 255);
+
+ // load icons order
+ for (int i = 0; i < EXICONS_COUNT; i++)
+ pwd->bIsIconVisible[opt.exIconsOrder[i]] = opt.exIconsVis[i] ? true : false;
+
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pwd);
+
+ // work around bug hiding tips
+ GetCursorPos(&pwd->ptCursorStartPos);
+ SetTimer(hwnd, ID_TIMER_CHECKMOUSE, CHECKMOUSE_ELAPSE, 0);
+
+ //Register copy menu hotkey (CTRL+C)
+ pwd->iHotkeyId = GlobalAddAtom(_T("Tipper"));
+ RegisterHotKey(hwnd, pwd->iHotkeyId, MOD_CONTROL, 0x43);
+
+ if (pwd->clcit.szProto)
+ {
+ pwd->bIsTextTip= false;
+ pwd->iIndent = opt.iTextIndent;
+ pwd->iSidebarWidth= opt.iSidebarWidth;
+
+ if (ServiceExists(MS_PROTO_GETACCOUNT))
+ {
+ PROTOACCOUNT *pa = ProtoGetAccount(pwd->clcit.szProto);
+ if (pa) _tcscpy(pwd->swzTitle, pa->tszAccountName);
+ }
+
+ if (_tcslen(pwd->swzTitle) == 0)
+ a2t(pwd->clcit.szProto, pwd->swzTitle, TITLE_TEXT_LEN);
+
+ if (CallService(MS_PROTO_ISACCOUNTLOCKED,0,(LPARAM)pwd->clcit.szProto))
+ mir_sntprintf(pwd->swzTitle, SIZEOF(pwd->swzTitle), TranslateT("%s (locked)"), pwd->swzTitle);
+
+ // get status icon
+ if (pwd->bIsIconVisible[0])
+ {
+ WORD status = CallProtoService(pwd->clcit.szProto, PS_GETSTATUS, 0, 0);
+ pwd->extraIcons[0].hIcon = (HICON)LoadSkinnedProtoIcon(pwd->clcit.szProto, status);
+ pwd->extraIcons[0].bDestroy = false;
+ }
+
+ // get activity icon
+ if (pwd->bIsIconVisible[2])
+ {
+ pwd->extraIcons[2].hIcon = GetJabberActivityIcon(0, pwd->clcit.szProto);
+ pwd->extraIcons[2].bDestroy = false;
+ }
+
+ // uid info
+ TCHAR swzUid[256], swzUidName[256];
+ if (Uid(0, pwd->clcit.szProto, swzUid, 256) && UidName(pwd->clcit.szProto, swzUidName, 253))
+ {
+ _tcscat(swzUidName, _T(": "));
+ AddRow(pwd, swzUidName, swzUid, NULL, false, false, false);
+ }
+
+ // logon info
+ TCHAR swzLogon[64];
+ if (TimestampToTimeDifference(NULL, pwd->clcit.szProto, "LogonTS", swzLogon, 59))
+ {
+ _tcscat(swzLogon, TranslateT(" ago"));
+ AddRow(pwd, TranslateT("Log on:"), swzLogon, NULL, false, false, false);
+ }
+
+ // number of unread emails
+ TCHAR swzEmailCount[64];
+ if (ProtoServiceExists(pwd->clcit.szProto, "/GetUnreadEmailCount"))
+ {
+ int iCount = (int)CallProtoService(pwd->clcit.szProto, "/GetUnreadEmailCount", 0, 0);
+ if (iCount > 0)
+ {
+ _itot(iCount, swzEmailCount, 10);
+ AddRow(pwd, TranslateT("Unread emails:"), swzEmailCount, NULL, false, false, false);
+ }
+ }
+
+ // protocol status
+ WORD wStatus = (WORD)CallProtoService(pwd->clcit.szProto, PS_GETSTATUS, 0, 0);
+ char *szStatus = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)wStatus,0);
+ if (szStatus)
+ {
+ TCHAR *swzText = mir_a2t(szStatus);
+ AddRow(pwd, TranslateT("Status:"), swzText, NULL, false, false, false);
+ mir_free(swzText);
+ }
+
+ if (wStatus >= ID_STATUS_ONLINE && wStatus <= ID_STATUS_OUTTOLUNCH)
+ {
+ // status message
+ TCHAR *swzText = GetProtoStatusMessage(pwd->clcit.szProto, wStatus);
+ if (swzText)
+ {
+ StripBBCodesInPlace(swzText);
+ AddRow(pwd, TranslateT("Status message:"), swzText, pwd->clcit.szProto, true, true, true);
+ mir_free(swzText);
+ }
+
+ // jabber mood or icq xstatus
+ TCHAR *swzAdvTitle = GetJabberAdvStatusText(pwd->clcit.szProto, "mood", "title");
+ if (swzAdvTitle)
+ {
+ StripBBCodesInPlace(swzAdvTitle);
+ AddRow(pwd, TranslateT("Mood:"), swzAdvTitle, pwd->clcit.szProto, true, false, true);
+
+ TCHAR *swzAdvText = GetJabberAdvStatusText(pwd->clcit.szProto, "mood", "text");
+ if (swzAdvText)
+ {
+ StripBBCodesInPlace(swzAdvText);
+ AddRow(pwd, _T(""), swzAdvText, pwd->clcit.szProto, true, true, false);
+ mir_free(swzAdvText);
+ }
+ }
+ else
+ {
+ if (DBGetContactSettingByte(0, pwd->clcit.szProto, "XStatusId", 0))
+ {
+ // xstatus title
+ swzAdvTitle = GetProtoExtraStatusTitle(pwd->clcit.szProto);
+ if (swzAdvTitle)
+ {
+ StripBBCodesInPlace(swzAdvTitle);
+ AddRow(pwd, TranslateT("XStatus:"), swzAdvTitle, pwd->clcit.szProto, true, false, true);
+ }
+
+ // xstatus message
+ TCHAR *swzAdvText = GetProtoExtraStatusMessage(pwd->clcit.szProto);
+ if (swzAdvText)
+ {
+ StripBBCodesInPlace(swzAdvText);
+ AddRow(pwd, _T(""), swzAdvText, pwd->clcit.szProto, true, true, false);
+ mir_free(swzAdvText);
+ }
+ }
+ }
+
+ if (swzAdvTitle)
+ {
+ mir_free(swzAdvTitle);
+ // get advanced status icon
+ if (pwd->bIsIconVisible[1])
+ {
+ pwd->extraIcons[1].hIcon = (HICON)CallProtoService(pwd->clcit.szProto, PS_ICQ_GETCUSTOMSTATUSICON, 0, 0);
+ pwd->extraIcons[1].bDestroy = true;
+ }
+ }
+
+ // jabber activity
+ TCHAR *swzActTitle = GetJabberAdvStatusText(pwd->clcit.szProto, "activity", "title");
+ if (swzActTitle)
+ {
+ StripBBCodesInPlace(swzActTitle);
+ AddRow(pwd, TranslateT("Activity:"), swzActTitle, pwd->clcit.szProto, true, false, true);
+ mir_free(swzActTitle);
+ }
+
+ TCHAR *swzActText = GetJabberAdvStatusText(pwd->clcit.szProto, "activity", "text");
+ if (swzActText)
+ {
+ StripBBCodesInPlace(swzActText);
+ AddRow(pwd, _T(""), swzActText, pwd->clcit.szProto, true, true, false);
+ mir_free(swzActText);
+ }
+
+ // listening to
+ TCHAR *swzListening = GetListeningTo(pwd->clcit.szProto);
+ if (swzListening)
+ {
+ StripBBCodesInPlace(swzListening);
+ AddRow(pwd, TranslateT("Listening to:"), swzListening, NULL, false, true, true);
+ mir_free(swzListening);
+ }
+ }
+ }
+ else if (pwd->clcit.swzText)
+ {
+ pwd->bIsTextTip = true;
+ pwd->iIndent = 0;
+ pwd->iSidebarWidth= 0;
+
+ RECT rc = pwd->clcit.rcItem;
+ bool mirandaTrayTip = ((rc.right - rc.left) == 20) && ((rc.bottom - rc.top) == 20) ? true : false;
+
+ if (mirandaTrayTip && !opt.bTraytip)
+ {
+ MyDestroyWindow(hwnd);
+ return 0;
+ }
+
+ if (mirandaTrayTip && opt.bHandleByTipper) // extended tray tooltip
+ {
+ pwd->bIsTrayTip = true;
+ pwd->iIndent = opt.iTextIndent;
+ pwd->iSidebarWidth= opt.iSidebarWidth;
+
+ SendMessage(hwnd, PUM_REFRESHTRAYTIP, 0, 0);
+
+ if (opt.bExpandTraytip)
+ SetTimer(hwnd, ID_TIMER_TRAYTIP, opt.iExpandTime, 0);
+ }
+ else
+ {
+
+ TCHAR buff[2048], *swzText = pwd->clcit.swzText;
+ size_t iBuffPos, i = 0, iSize = _tcslen(pwd->clcit.swzText);
+ bool bTopMessage = false;
+
+ while (i < iSize && swzText[i] != _T('<'))
+ {
+ iBuffPos = 0;
+ while (swzText[i] != _T('\n') && swzText[i] != _T('\r') && i < iSize && iBuffPos < 2048)
+ {
+ if (swzText[i] != _T('\t'))
+ buff[iBuffPos++] = swzText[i];
+ i++;
+ }
+
+ buff[iBuffPos] = 0;
+
+ if (iBuffPos)
+ {
+ AddRow(pwd, _T(""), buff, NULL, false, true, false);
+ bTopMessage = true;
+ }
+
+ while (i < iSize && (swzText[i] == _T('\n') || swzText[i] == _T('\r')))
+ i++;
+ }
+
+ // parse bold bits into labels and the rest into items
+ while (i < iSize)
+ {
+ while (i + 2 < iSize
+ && (swzText[i] != _T('<')
+ || swzText[i + 1] != _T('b')
+ || swzText[i + 2] != _T('>')))
+ {
+ i++;
+ }
+
+ i += 3;
+
+ iBuffPos = 0;
+ while (i + 3 < iSize
+ && iBuffPos < 2048
+ && (swzText[i] != _T('<')
+ || swzText[i + 1] != _T('/')
+ || swzText[i + 2] != _T('b')
+ || swzText[i + 3] != _T('>')))
+ {
+ if (swzText[i] != _T('\t'))
+ buff[iBuffPos++] = swzText[i];
+ i++;
+ }
+
+ i += 4;
+
+ buff[iBuffPos] = 0;
+
+ if (iBuffPos)
+ {
+ pwd->rows = (RowData *)mir_realloc(pwd->rows, sizeof(RowData) * (pwd->iRowCount + 1));
+ pwd->rows[pwd->iRowCount].bValueNewline = false;
+ pwd->rows[pwd->iRowCount].swzLabel = mir_tstrdup(buff);
+ if (pwd->iRowCount == 1 && bTopMessage)
+ pwd->rows[pwd->iRowCount].bLineAbove = true;
+ else
+ pwd->rows[pwd->iRowCount].bLineAbove = false;
+
+ iBuffPos = 0;
+ while (i < iSize
+ && iBuffPos < 2048
+ && swzText[i] != _T('\n'))
+ {
+ if (swzText[i] != _T('\t') && swzText[i] != _T('\r'))
+ buff[iBuffPos++] = swzText[i];
+ i++;
+ }
+ buff[iBuffPos] = 0;
+
+ pwd->rows[pwd->iRowCount].swzValue = mir_tstrdup(buff);
+ pwd->rows[pwd->iRowCount].spi = NULL;
+ pwd->iRowCount++;
+ }
+
+ i++;
+ }
+
+ if (pwd->iRowCount == 0)
+ {
+ // single item
+ pwd->iRowCount = 1;
+ pwd->rows = (RowData *)mir_alloc(sizeof(RowData));
+ pwd->rows[0].bLineAbove = pwd->rows[0].bValueNewline = false;
+ pwd->rows[0].swzLabel = 0;
+ pwd->rows[0].swzValue = swzText;
+ pwd->rows[0].spi = NULL;
+ }
+ }
+ }
+ else
+ {
+ pwd->bIsTextTip = false;
+ pwd->iIndent = opt.iTextIndent;
+ pwd->iSidebarWidth= opt.iSidebarWidth;
+ pwd->hContact = pwd->clcit.hItem;
+ pwd->iIconIndex = (int)CallService(MS_CLIST_GETCONTACTICON, (WPARAM)pwd->hContact, 0);
+
+ // don't use stored status message
+ if (!opt.bWaitForContent)
+ DBDeleteContactSetting(pwd->hContact, MODULE, "TempStatusMsg");
+
+ TCHAR *swzNick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)pwd->hContact, GCDNF_TCHAR);
+ _tcsncpy(pwd->swzTitle, swzNick, TITLE_TEXT_LEN);
+
+ char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)pwd->hContact, 0);
+ pwd->spiTitle = Smileys_PreParse(pwd->swzTitle, -1, szProto);
+
+ // get extra icons
+ DBVARIANT dbv = {0};
+ int i = 0;
+
+ if (szProto)
+ {
+ // status icon
+ if (pwd->bIsIconVisible[0])
+ {
+ for (i = 0; opt.exIconsOrder[i] != 0; i++);
+ pwd->extraIcons[i].hIcon = ImageList_GetIcon((HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0), pwd->iIconIndex, 0);
+ pwd->extraIcons[i].bDestroy = true;
+ }
+
+ // xstatus icon
+ if (pwd->bIsIconVisible[1])
+ {
+ for (i = 0; opt.exIconsOrder[i] != 1; i++);
+ int iXstatus = DBGetContactSettingByte(pwd->hContact, szProto, "XStatusId", 0);
+ if (iXstatus)
+ {
+ char szIconProto[64];
+ if (strcmp(szProto, szMetaModuleName) != 0)
+ {
+ strcpy(szIconProto, szProto);
+ }
+ else if (!DBGetContactSettingString(pwd->hContact, szProto, "XStatusProto", &dbv))
+ {
+ strcpy(szIconProto, dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+
+ pwd->extraIcons[i].hIcon = (HICON)CallProtoService(szIconProto, PS_ICQ_GETCUSTOMSTATUSICON, (WPARAM)iXstatus, LR_SHARED);
+ pwd->extraIcons[i].bDestroy = false;
+ }
+ }
+
+ // activity icon
+ if (pwd->bIsIconVisible[2])
+ {
+ for (i = 0; opt.exIconsOrder[i] != 2; i++);
+ pwd->extraIcons[i].hIcon = GetJabberActivityIcon(pwd->hContact, szProto);
+ pwd->extraIcons[i].bDestroy = false;
+ }
+
+ // gender icon
+ if (pwd->bIsIconVisible[3])
+ {
+ for (i = 0; opt.exIconsOrder[i] != 3; i++);
+ if (ServiceExists(MS_GENDER_GETICON))
+ {
+ pwd->extraIcons[i].hIcon = (HICON)CallService(MS_GENDER_GETICON, (WPARAM)pwd->hContact, 0);
+ }
+ else
+ {
+ int iGender = DBGetContactSettingByte(pwd->hContact, "UserInfo", "Gender", 0);
+ if (iGender == 0)
+ iGender = DBGetContactSettingByte(pwd->hContact, szProto, "Gender", 0);
+
+ if (iGender == GEN_FEMALE)
+ pwd->extraIcons[i].hIcon = (HICON)CallService(MS_SKIN2_GETICON, NULL, (LPARAM)"UserInfoEx_common_female");
+ else if (iGender == GEN_MALE)
+ pwd->extraIcons[i].hIcon = (HICON)CallService(MS_SKIN2_GETICON, NULL, (LPARAM)"UserInfoEx_common_male");
+ }
+ pwd->extraIcons[i].bDestroy = false;
+ }
+
+ // flags icon
+ if (pwd->bIsIconVisible[4])
+ {
+ for (i = 0; opt.exIconsOrder[i] != 4; i++);
+
+ int iCountry = 0;
+ if (ServiceExists(MS_FLAGS_DETECTCONTACTORIGINCOUNTRY))
+ iCountry = CallService(MS_FLAGS_DETECTCONTACTORIGINCOUNTRY, (WPARAM)pwd->hContact, 0);
+ else if (ServiceExists(MS_FLAGS_GETCONTACTORIGINCOUNTRY))
+ iCountry = CallService(MS_FLAGS_GETCONTACTORIGINCOUNTRY, (WPARAM)pwd->hContact, 0);
+
+ if (iCountry != 0 && iCountry != CTRY_UNKNOWN && iCountry != CTRY_ERROR)
+ {
+ pwd->extraIcons[i].hIcon = LoadFlagIcon(iCountry);
+ pwd->extraIcons[i].bDestroy = false;
+ }
+ }
+
+ // fingerprint icon
+ if (pwd->bIsIconVisible[5])
+ {
+ if (ServiceExists(MS_FP_GETCLIENTICON))
+ {
+ for (i = 0; opt.exIconsOrder[i] != 5; i++);
+ if (!DBGetContactSettingString(pwd->hContact, szProto, "MirVer", &dbv))
+ {
+ pwd->extraIcons[i].hIcon = (HICON)CallService(MS_FP_GETCLIENTICON, (WPARAM)dbv.pszVal, 0);
+ pwd->extraIcons[i].bDestroy = true;
+ DBFreeVariant(&dbv);
+ }
+ }
+ }
+
+ //request xstatus details
+ if (opt.bRetrieveXstatus)
+ {
+ if (!DBGetContactSettingByte(0, szProto, "XStatusAuto", 1) && ProtoServiceExists(szProto, PS_ICQ_REQUESTCUSTOMSTATUS))
+ CallProtoService(szProto, PS_ICQ_REQUESTCUSTOMSTATUS, (WPARAM)pwd->hContact, 0);
+ }
+ }
+
+ SendMessage(hwnd, PUM_REFRESH_VALUES, FALSE, 0);
+ }
+
+ SendMessage(hwnd, PUM_GETHEIGHT, 0, 0);
+ SendMessage(hwnd, PUM_CALCPOS, 0, 0);
+
+ // transparency
+ SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
+
+ if (opt.bDropShadow && opt.skinMode == SM_COLORFILL)
+ SetClassLongPtr(hwnd, GCL_STYLE, CS_DROPSHADOW);
+ else
+ SetClassLongPtr(hwnd, GCL_STYLE, 0);
+
+ if (!skin.bNeedLayerUpdate && MySetLayeredWindowAttributes)
+ MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), 0, LWA_ALPHA);
+
+ if (opt.showEffect)
+ SetTimer(hwnd, ID_TIMER_ANIMATE, ANIM_ELAPSE, 0);
+
+ ShowWindow(hwnd, SW_SHOWNOACTIVATE);
+ InvalidateRect(hwnd, 0, FALSE);
+
+ // since tipper win is topmost, this should put it at top of topmost windows
+ SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ return 0;
+ }
+ case WM_ERASEBKGND:
+ {
+ if (!skin.bNeedLayerUpdate)
+ {
+ HDC hdc = (HDC)wParam;
+ RECT rc;
+ GetClientRect(hwnd, &rc);
+
+ BitBlt(hdc, 0, 0, skin.iWidth, skin.iHeight, skin.hdc, 0, 0, SRCCOPY);
+
+ // border
+ if (opt.bBorder)
+ {
+ HBRUSH hOldBrush = (HBRUSH)SelectObject(hdc, GetStockObject(NULL_BRUSH));
+ HPEN hOldPen = (HPEN)SelectObject(hdc, pwd->hpenBorder);
+
+ int h = 0;
+ if (opt.bRound)
+ {
+ int v;
+ int w = 14;
+ h = (rc.right-rc.left) > (w*2) ? w : (rc.right-rc.left);
+ v = (rc.bottom-rc.top) > (w*2) ? w : (rc.bottom-rc.top);
+ h = (h < v) ? h : v;
+ }
+
+ RoundRect(hdc, 0, 0, (rc.right - rc.left), (rc.bottom - rc.top), h, h);
+
+ SelectObject(hdc, hOldBrush);
+ SelectObject(hdc, hOldPen);
+ }
+ }
+ return TRUE;
+ }
+ case WM_PAINT:
+ {
+ RECT r, r2;
+ PAINTSTRUCT ps;
+ BeginPaint(hwnd, &ps);
+ HDC hdc = skin.bNeedLayerUpdate ? skin.hdc : ps.hdc;
+
+ GetClientRect(hwnd, &r);
+ r2 = r;
+ HFONT hOldFont = (HFONT)GetCurrentObject(hdc,OBJ_FONT);
+
+ // text background
+ SetBkMode(hdc, TRANSPARENT);
+
+ BLENDFUNCTION blend;
+ blend.BlendOp = AC_SRC_OVER;
+ blend.BlendFlags = 0;
+ blend.SourceConstantAlpha = 255;
+ blend.AlphaFormat = AC_SRC_ALPHA;
+
+ // avatar
+ if (!pwd->bIsTextTip&& opt.avatarLayout != PAV_NONE && pwd->iAvatarHeight)
+ {
+ RECT rcAvatar;
+ rcAvatar.top = opt.iOuterAvatarPadding;
+
+ if (opt.avatarLayout == PAV_LEFT)
+ {
+ rcAvatar.left = r.left + opt.iOuterAvatarPadding;
+ rcAvatar.right = rcAvatar.left + pwd->iRealAvatarWidth;
+ r2.left += pwd->iRealAvatarWidth + (opt.iOuterAvatarPadding + opt.iInnerAvatarPadding - opt.iPadding); // padding re-added for text
+ }
+ else if (opt.avatarLayout == PAV_RIGHT)
+ {
+ rcAvatar.right = r.right - opt.iOuterAvatarPadding;
+ rcAvatar.left = rcAvatar.right - pwd->iRealAvatarWidth;
+ r2.right -= pwd->iRealAvatarWidth + (opt.iOuterAvatarPadding + opt.iInnerAvatarPadding - opt.iPadding);
+ }
+
+ rcAvatar.bottom = rcAvatar.top + pwd->iRealAvatarHeight;
+
+ AVATARCACHEENTRY *ace = 0;
+ if (pwd->hContact)
+ ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)pwd->hContact, 0);
+ else
+ ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)pwd->clcit.szProto);
+
+ if (ace && ace->hbmPic && (ace->dwFlags & AVS_BITMAP_VALID) && !(ace->dwFlags & AVS_HIDEONCLIST))
+ {
+ ResizeBitmap rb = {0};
+ rb.size = sizeof(rb);
+ rb.max_width = pwd->iRealAvatarWidth;
+ rb.max_height = pwd->iRealAvatarHeight;
+ rb.fit = RESIZEBITMAP_STRETCH | RESIZEBITMAP_KEEP_PROPORTIONS;
+ rb.hBmp = ace->hbmPic;
+ HBITMAP hbmpAvatar = (HBITMAP)CallService(MS_IMG_RESIZE, (WPARAM)&rb, 0);
+
+ if (hbmpAvatar)
+ {
+ HRGN hrgnAvatar = 0;
+ if (opt.bAvatarRound)
+ {
+ hrgnAvatar = CreateRoundRectRgn(rcAvatar.left, rcAvatar.top, rcAvatar.right + 1, rcAvatar.bottom + 1, 9, 9);
+ SelectClipRgn(hdc, hrgnAvatar);
+ }
+
+ BITMAP bm;
+ GetObject(hbmpAvatar, sizeof(bm), &bm);
+ HDC hdcMem = CreateCompatibleDC(hdc);
+ SelectObject(hdcMem, hbmpAvatar);
+
+ blend.SourceConstantAlpha = (BYTE)(opt.iAvatarOpacity / 100.0 * 255);
+ AlphaBlend(hdc, rcAvatar.left, rcAvatar.top, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, bm.bmWidth, bm.bmHeight, blend);
+ blend.SourceConstantAlpha = 255;
+
+ if (opt.bAvatarBorder)
+ {
+ SaveAlpha(&rcAvatar);
+ HBRUSH hbrBorder = CreateSolidBrush(opt.colAvatarBorder);
+ if (opt.bAvatarRound)
+ FrameRgn(hdc, hrgnAvatar, hbrBorder, 1, 1);
+ else
+ FrameRect(hdc, &rcAvatar, hbrBorder);
+
+ DeleteObject(hbrBorder);
+ RestoreAlpha(&rcAvatar, (BYTE)(opt.iAvatarOpacity / 100.0 * 255));
+ }
+
+ if (hrgnAvatar)
+ {
+ SelectClipRgn(hdc, 0);
+ DeleteObject(hrgnAvatar);
+ }
+
+ if (hbmpAvatar != ace->hbmPic)
+ DeleteObject(hbmpAvatar);
+
+ DeleteDC(hdcMem);
+ }
+ }
+ }
+
+ RECT tr;
+ tr.left = r2.left + opt.iPadding + opt.iTitleIndent;
+ tr.right = r2.right - opt.iPadding;
+ tr.top = 0;
+ tr.bottom = opt.iPadding;
+
+ if (!pwd->bIsTextTip&& opt.titleLayout != PTL_NOTITLE)
+ {
+ if (opt.titleLayout != PTL_NOICON)
+ {
+ // draw icons
+ int iIconX, iIconY;
+ iIconY = opt.iPadding + opt.iTextPadding;
+
+ if (opt.titleLayout == PTL_RIGHTICON)
+ iIconX = r2.right - 16 - opt.iPadding;
+ else
+ iIconX = r2.left + opt.iPadding;
+
+ for (int i = 0; i < EXICONS_COUNT; i++)
+ {
+ if (pwd->extraIcons[i].hIcon)
+ {
+ DrawIconExAlpha(hdc, iIconX, iIconY, pwd->extraIcons[i].hIcon, 16, 16, 0, NULL, DI_NORMAL, false);
+ iIconY += 20;
+ }
+ }
+ }
+
+ // title text
+ if (hFontTitle) SelectObject(hdc, (HGDIOBJ)hFontTitle);
+ SetTextColor(hdc, opt.colTitle);
+ tr.top = opt.iPadding;
+ tr.bottom = tr.top + pwd->iTitleHeight - opt.iPadding;
+ UINT uTextFormat = DT_TOP | DT_LEFT | DT_WORDBREAK | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS | DT_NOPREFIX;
+ DrawTextExt(hdc, pwd->swzTitle, -1, &tr, uTextFormat, NULL, pwd->spiTitle);
+ }
+
+ // values
+ pwd->iTextHeight = 0;
+ bool bIconPainted, bUseRect = true;
+ int iRowHeight;
+ for (int i = 0; i < pwd->iRowCount; i++)
+ {
+ tr.top = tr.bottom;
+ bUseRect = (tr.top + opt.iTextPadding >= pwd->iAvatarHeight);
+ bIconPainted = false;
+ if (bUseRect)
+ {
+ if (pwd->rows[i].bLineAbove)
+ {
+ HPEN hOldPen = (HPEN)SelectObject(hdc, pwd->hpenDivider);
+ tr.top += opt.iTextPadding;
+ RECT rec;
+ SetRect(&rec, r.left + opt.iPadding + pwd->iIndent, tr.top, r.right - opt.iPadding, tr.top + 1);
+ SaveAlpha(&rec);
+ Rectangle(hdc, rec.left, rec.top, rec.right, rec.bottom );
+ RestoreAlpha(&rec);
+ SelectObject(hdc, hOldPen);
+ }
+
+ tr.left = r.left + opt.iPadding + pwd->iIndent;
+ if (pwd->rows[i].bValueNewline)
+ tr.right = r.right - opt.iPadding;
+ else
+ tr.right = r.left + opt.iPadding + pwd->iIndent + pwd->iLabelWidth;
+ }
+ else
+ {
+ if (pwd->rows[i].bLineAbove)
+ {
+ HPEN hOldPen = (HPEN)SelectObject(hdc, pwd->hpenDivider);
+ tr.top += opt.iTextPadding;
+ RECT rec;
+ SetRect(&rec, r2.left + opt.iPadding + pwd->iIndent, tr.top, r2.right - opt.iPadding, tr.top + 1);
+ SaveAlpha(&rec);
+ Rectangle(hdc, rec.left, rec.top, rec.right, rec.bottom );
+ RestoreAlpha(&rec);
+ SelectObject(hdc, hOldPen);
+ }
+
+ tr.left = r2.left + opt.iPadding + pwd->iIndent;
+ if (pwd->rows[i].bValueNewline)
+ tr.right = r2.right - opt.iPadding;
+ else
+ tr.right = r2.left + opt.iPadding + pwd->iIndent + pwd->iLabelWidth;
+ }
+
+ if (pwd->rows[i].bValueNewline)
+ iRowHeight = pwd->rows[i].iLabelHeight;
+ else
+ iRowHeight = max(pwd->rows[i].iLabelHeight, pwd->rows[i].iValueHeight);
+
+ if (pwd->rows[i].iLabelHeight)
+ {
+ tr.top += opt.iTextPadding;
+ tr.bottom = tr.top + iRowHeight;
+
+ if (pwd->bIsTrayTip && pwd->rows[i].bIsTitle)
+ {
+ if (hFontTrayTitle) SelectObject(hdc, (HGDIOBJ)hFontTrayTitle);
+ SetTextColor(hdc, opt.colTrayTitle);
+ }
+ else
+ {
+ if (hFontLabels) SelectObject(hdc, (HGDIOBJ)hFontLabels);
+ SetTextColor(hdc, opt.colLabel);
+ }
+
+ // status icon in tray tooltip
+ if (opt.titleLayout != PTL_NOICON && pwd->bIsTrayTip && pwd->rows[i].hIcon)
+ {
+ DrawIconExAlpha(hdc, opt.iPadding, tr.top + (pwd->rows[i].iLabelHeight - 16) / 2, pwd->rows[i].hIcon, 16, 16, 0, NULL, DI_NORMAL, false);
+ bIconPainted = true;
+ }
+
+ DrawTextAlpha(hdc, pwd->rows[i].swzLabel, -1, &tr, opt.iLabelValign | ((opt.iLabelHalign == DT_RIGHT && !pwd->rows[i].bValueNewline) ? DT_RIGHT : DT_LEFT) | DT_END_ELLIPSIS | DT_SINGLELINE | DT_NOPREFIX);
+ if (pwd->rows[i].bValueNewline)
+ tr.top = tr.bottom;
+ }
+ else
+ {
+ tr.bottom = tr.top;
+ }
+
+ if (pwd->rows[i].bValueNewline)
+ iRowHeight = pwd->rows[i].iValueHeight;
+
+ if (hFontValues) SelectObject(hdc, (HGDIOBJ)hFontValues);
+ SetTextColor(hdc, opt.colValue);
+ if (bUseRect)
+ {
+ if (pwd->rows[i].bValueNewline)
+ tr.left = r.left + opt.iPadding + pwd->iIndent;
+ else
+ tr.left = r.left + opt.iPadding + pwd->iIndent + pwd->iLabelWidth + opt.iValueIndent;
+
+ tr.right = r.right - opt.iPadding;
+ }
+ else
+ {
+ if (pwd->rows[i].bValueNewline)
+ tr.left = r2.left + opt.iPadding + pwd->iIndent;
+ else
+ tr.left = r2.left + opt.iPadding + pwd->iIndent + pwd->iLabelWidth + opt.iValueIndent;
+
+ tr.right = r2.right - opt.iPadding;
+ }
+
+ if (pwd->rows[i].iValueHeight)
+ {
+ if (pwd->rows[i].bValueNewline || !pwd->rows[i].iLabelHeight) tr.top += opt.iTextPadding;
+ if (pwd->rows[i].iLabelHeight > pwd->rows[i].iValueHeight && pwd->bIsTextTip&& pwd->rows[i].bIsTitle)
+ tr.top = tr.bottom - pwd->rows[i].iValueHeight - 2;
+ else
+ tr.bottom = tr.top + iRowHeight;
+
+ if (opt.titleLayout != PTL_NOICON && pwd->bIsTrayTip && pwd->rows[i].hIcon && !bIconPainted)
+ DrawIconExAlpha(hdc, opt.iPadding, tr.top + (pwd->rows[i].iValueHeight - 16) / 2, pwd->rows[i].hIcon, 16, 16, 0, NULL, DI_NORMAL, false);
+
+ UINT uFormat = opt.iValueValign | opt.iValueHalign | DT_WORDBREAK | DT_WORD_ELLIPSIS | DT_END_ELLIPSIS | DT_NOPREFIX;
+ DrawTextExt(hdc, pwd->rows[i].swzValue, -1, &tr, uFormat, NULL, pwd->rows[i].spi);
+ }
+ }
+
+ PremultipleChannels();
+
+ if (opt.showEffect == PSE_NONE)
+ {
+ if (skin.bNeedLayerUpdate)
+ {
+ POINT ptSrc = {0, 0};
+ SIZE szTip = {r.right - r.left, r.bottom - r.top};
+ blend.SourceConstantAlpha = pwd->iTrans;
+ MyUpdateLayeredWindow(hwnd, NULL, NULL, &szTip, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+
+ if (opt.bAeroGlass && MyDwmEnableBlurBehindWindow)
+ {
+ DWM_BLURBEHIND bb = {0};
+ bb.dwFlags = DWM_BB_ENABLE | DWM_BB_BLURREGION;
+ bb.fEnable = TRUE;
+ bb.hRgnBlur = CreateOpaqueRgn(25, true);
+ MyDwmEnableBlurBehindWindow(hwnd, &bb);
+ }
+ }
+ else if (MySetLayeredWindowAttributes)
+ {
+ MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), pwd->iTrans, LWA_ALPHA);
+ }
+ }
+
+ SelectObject(hdc, hOldFont);
+ EndPaint(hwnd, &ps);
+ pwd->bIsPainted = true;
+ return 0;
+ }
+ case WM_HOTKEY:
+ {
+ if (LOWORD(lParam) == MOD_CONTROL && HIWORD(lParam) == 0x43) // CTRL+C
+ {
+ HICON hIcon;
+ ICONINFO iconInfo;
+ HBITMAP hbmpAllItems, hbmpItem;
+
+ if (pwd->iRowCount == 0)
+ return 0;
+
+ ShowWindow(hwnd, SW_HIDE);
+ HMENU hMenu = CreatePopupMenu();
+ if (!hMenu) return 0;
+
+ hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_ITEM_ALL), IMAGE_ICON, 0, 0, LR_LOADTRANSPARENT);
+ if (!hIcon)
+ {
+ DestroyMenu(hMenu);
+ return 0;
+ }
+
+ GetIconInfo(hIcon, &iconInfo);
+ hbmpAllItems = iconInfo.hbmColor;
+ DestroyIcon(hIcon);
+
+ AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS_LABELS, TranslateT("Copy all items with labels"));
+ AppendMenu(hMenu, MF_STRING, COPYMENU_ALLITEMS, TranslateT("Copy all items"));
+ if (pwd->clcit.szProto || pwd->hContact)
+ AppendMenu(hMenu, MF_STRING, COPYMENU_AVATAR, TranslateT("Copy avatar"));
+ AppendMenu(hMenu, MF_SEPARATOR, 2000, 0);
+
+ SetMenuItemBitmaps(hMenu, COPYMENU_ALLITEMS_LABELS, MF_BYCOMMAND, hbmpAllItems, hbmpAllItems);
+ SetMenuItemBitmaps(hMenu, COPYMENU_ALLITEMS, MF_BYCOMMAND, hbmpAllItems, hbmpAllItems);
+ SetMenuItemBitmaps(hMenu, COPYMENU_AVATAR, MF_BYCOMMAND, hbmpAllItems, hbmpAllItems);
+
+ hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_ITEM), IMAGE_ICON, 0, 0, LR_LOADTRANSPARENT);
+ if (!hIcon)
+ {
+ DeleteObject(hbmpAllItems);
+ DestroyMenu(hMenu);
+ return 0;
+ }
+
+ GetIconInfo(hIcon, &iconInfo);
+ hbmpItem = iconInfo.hbmColor;
+ DestroyIcon(hIcon);
+
+ for (int i = 0; i < pwd->iRowCount; i++)
+ {
+ if (pwd->rows[i].swzValue)
+ {
+ TCHAR buff[128];
+ int iLen = (int)_tcslen(pwd->rows[i].swzValue);
+ if (iLen)
+ {
+ if (iLen > MAX_VALUE_LEN)
+ {
+ _tcsncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN);
+ buff[MAX_VALUE_LEN] = 0;
+ _tcscat(buff, _T("..."));
+ }
+ else
+ {
+ _tcscpy(buff, pwd->rows[i].swzValue);
+ }
+
+ AppendMenu(hMenu, MF_STRING, i + 1, buff); // first id = 1, because no select have id = 0
+ SetMenuItemBitmaps(hMenu, i + 1, MF_BYCOMMAND, hbmpItem, hbmpItem);
+ }
+ else
+ {
+ AppendMenu(hMenu, MF_SEPARATOR, 0, 0);
+ }
+ }
+ }
+
+ POINT pt;
+ GetCursorPos(&pt);
+ SetForegroundWindow(hwnd);
+ int iSelItem = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, 0);
+ DeleteObject(hbmpAllItems);
+ DeleteObject(hbmpItem);
+ DestroyMenu(hMenu);
+
+ if (iSelItem == 0)
+ return 0; // no item was selected
+
+ if (OpenClipboard(NULL))
+ {
+ EmptyClipboard();
+ if (iSelItem == COPYMENU_AVATAR) // copy avatar
+ {
+ AVATARCACHEENTRY *ace = 0;
+ if (pwd->hContact) ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)pwd->hContact, 0);
+ else ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)pwd->clcit.szProto);
+ if (ace && ace->hbmPic && (ace->dwFlags & AVS_BITMAP_VALID) && !(ace->dwFlags & AVS_HIDEONCLIST))
+ {
+ HDC hdc = GetDC(hwnd);
+ HDC hdcSrc = CreateCompatibleDC(hdc);
+ HDC hdcDes = CreateCompatibleDC(hdc);
+ HBITMAP hbmAvr = CreateCompatibleBitmap(hdc, ace->bmWidth, ace->bmHeight);
+ SelectObject(hdcSrc, ace->hbmPic);
+ SelectObject(hdcDes, hbmAvr);
+ BitBlt(hdcDes, 0, 0, ace->bmWidth, ace->bmHeight, hdcSrc, 0, 0, SRCCOPY);
+ SetClipboardData(CF_BITMAP, hbmAvr);
+ ReleaseDC(hwnd, hdc);
+ DeleteDC(hdcSrc);
+ DeleteDC(hdcDes);
+ }
+ }
+ else // copy text
+ {
+ HGLOBAL hClipboardData = GlobalAlloc(GMEM_DDESHARE, 4096);
+ TCHAR *pchData = (TCHAR *)GlobalLock(hClipboardData);
+ pchData[0] = 0;
+ if (iSelItem == COPYMENU_ALLITEMS_LABELS) // copy all items with labels
+ {
+ for (int i = 0; i < pwd->iRowCount; i++)
+ {
+ if ((pwd->rows[i].swzLabel && pwd->rows[i].swzLabel[0]) ||
+ (pwd->rows[i].swzValue && pwd->rows[i].swzValue[0]))
+ {
+ if (pwd->rows[i].swzLabel && pwd->rows[i].swzLabel[0])
+ {
+ _tcscat(pchData, pwd->rows[i].swzLabel);
+ _tcscat(pchData, _T(" "));
+ }
+ else
+ {
+ _tcscat(pchData, TranslateT("<No Label>: "));
+ }
+
+ if (pwd->rows[i].swzValue && pwd->rows[i].swzValue[0])
+ _tcscat(pchData, pwd->rows[i].swzValue);
+ else
+ _tcscat(pchData, TranslateT("<No Value>"));
+
+ _tcscat(pchData, _T("\r\n"));
+ }
+ }
+ }
+ else if (iSelItem == COPYMENU_ALLITEMS) // copy all items
+ {
+ for (int i = 0; i < pwd->iRowCount; i++)
+ {
+ if (pwd->rows[i].swzValue && pwd->rows[i].swzValue[0])
+ {
+ _tcscat(pchData, pwd->rows[i].swzValue);
+ _tcscat(pchData, _T("\r\n"));
+ }
+ }
+ }
+ else // single row
+ {
+ _tcscpy(pchData, pwd->rows[iSelItem - 1].swzValue);
+ }
+
+ GlobalUnlock(hClipboardData);
+#ifdef _UNICODE
+ SetClipboardData(CF_UNICODETEXT, hClipboardData);
+#else
+ SetClipboardData(CF_TEXT, hClipboardData);
+#endif
+ }
+
+ CloseClipboard();
+ }
+ }
+ break;
+ }
+ case PUM_FADEOUTWINDOW:
+ {
+ // kill timers
+ KillTimer(hwnd, ID_TIMER_ANIMATE);
+ KillTimer(hwnd, ID_TIMER_CHECKMOUSE);
+ KillTimer(hwnd, ID_TIMER_TRAYTIP);
+
+ if (opt.showEffect != PSE_NONE)
+ {
+ if (skin.bNeedLayerUpdate)
+ {
+ POINT ptSrc = {0, 0};
+ SIZE sz = {pwd->rcWindow.right - pwd->rcWindow.left, pwd->rcWindow.bottom - pwd->rcWindow.top};
+
+ BLENDFUNCTION blend;
+ blend.BlendOp = AC_SRC_OVER;
+ blend.BlendFlags = 0;
+ blend.SourceConstantAlpha = pwd->iTrans;
+ blend.AlphaFormat = AC_SRC_ALPHA;
+
+ while (blend.SourceConstantAlpha != 0)
+ {
+ MyUpdateLayeredWindow(hwnd, NULL, NULL, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+ blend.SourceConstantAlpha = max(blend.SourceConstantAlpha - opt.iAnimateSpeed, 0);
+ Sleep(ANIM_ELAPSE);
+ }
+ }
+ else if (MySetLayeredWindowAttributes)
+ {
+ int iTrans = pwd->iTrans;
+ while (iTrans != 0)
+ {
+ MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), iTrans, LWA_ALPHA);
+ iTrans = max(iTrans - opt.iAnimateSpeed, 0);
+ Sleep(ANIM_ELAPSE);
+ }
+ }
+ }
+ break;
+ }
+ case WM_DESTROY:
+ {
+ ShowWindow(hwnd, SW_HIDE);
+
+ // unregister hotkey
+ UnregisterHotKey(hwnd, pwd->iHotkeyId);
+
+ DeleteObject(pwd->hpenBorder);
+ DeleteObject(pwd->hpenDivider);
+
+ if (pwd->hrgnAeroGlass)
+ DeleteObject(pwd->hrgnAeroGlass);
+
+ Smileys_FreeParse(pwd->spiTitle);
+
+ int i;
+ for (i = 0; i < pwd->iRowCount; i++)
+ {
+ mir_free(pwd->rows[i].swzLabel);
+ mir_free(pwd->rows[i].swzValue);
+ Smileys_FreeParse(pwd->rows[i].spi);
+ }
+
+ if (pwd->rows)
+ mir_free(pwd->rows);
+ pwd->rows = NULL;
+
+ // destroy icons
+ for (i = 0; i < EXICONS_COUNT; i++)
+ {
+ if (pwd->extraIcons[i].bDestroy)
+ DestroyIcon(pwd->extraIcons[i].hIcon);
+ }
+
+ if (pwd->clcit.swzText)
+ {
+ mir_free(pwd->clcit.swzText);
+ pwd->clcit.swzText = NULL;
+ }
+
+ mir_free(pwd);
+ pwd = NULL;
+
+ if (skin.colSavedBits) mir_free(skin.colSavedBits);
+ if (skin.hBitmap)DeleteObject(skin.hBitmap);
+ if (skin.hdc) DeleteDC(skin.hdc);
+ skin.colSavedBits = NULL;
+ skin.hBitmap = NULL;
+ skin.hdc = NULL;
+
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
+ break;
+ }
+ case WM_TIMER:
+ {
+ if (wParam == ID_TIMER_ANIMATE)
+ {
+ pwd->iAnimStep++;
+ if (pwd->iAnimStep == ANIM_STEPS)
+ KillTimer(hwnd, ID_TIMER_ANIMATE);
+
+ SendMessage(hwnd, PUM_UPDATERGN, 1, 0);
+ }
+ else if (wParam == ID_TIMER_CHECKMOUSE)
+ {
+ // workaround for tips that just won't go away
+ POINT pt;
+ GetCursorPos(&pt);
+
+ if (abs(pt.x - pwd->ptCursorStartPos.x) > opt.iMouseTollerance
+ || abs(pt.y - pwd->ptCursorStartPos.y) > opt.iMouseTollerance) // mouse has moved beyond tollerance
+ {
+ PostMPMessage(MUM_DELETEPOPUP, 0, 0);
+ }
+ }
+ else if (wParam == ID_TIMER_TRAYTIP)
+ {
+ KillTimer(hwnd, ID_TIMER_TRAYTIP);
+ SendMessage(hwnd, PUM_EXPANDTRAYTIP, 0, 0);
+ }
+
+ break;
+ }
+ case PUM_SETSTATUSTEXT:
+ {
+ if (pwd && (HANDLE)wParam == pwd->hContact)
+ {
+ DBWriteContactSettingTString(pwd->hContact, MODULE, "TempStatusMsg", (TCHAR *)lParam);
+ pwd->bIsPainted = false;
+ pwd->bNeedRefresh = true;
+ SendMessage(hwnd, PUM_REFRESH_VALUES, TRUE, 0);
+ InvalidateRect(hwnd, 0, TRUE);
+ }
+
+ if (lParam) mir_free((void *)lParam);
+ return TRUE;
+ }
+ case PUM_SHOWXSTATUS:
+ {
+ if (pwd && (HANDLE)wParam == pwd->hContact)
+ {
+ // in case we have retrieve xstatus
+ pwd->bIsPainted = false;
+ SendMessage(hwnd, PUM_REFRESH_VALUES, TRUE, 0);
+ InvalidateRect(hwnd, 0, TRUE);
+ }
+ return TRUE;
+ }
+ case PUM_SETAVATAR:
+ {
+ if (pwd && (HANDLE)wParam == pwd->hContact)
+ {
+ pwd->bIsPainted = false;
+ SendMessage(hwnd, PUM_GETHEIGHT, 0, 0);
+ SendMessage(hwnd, PUM_CALCPOS, 0, 0);
+ InvalidateRect(hwnd, 0, TRUE);
+ }
+ return TRUE;
+ }
+ case PUM_EXPANDTRAYTIP:
+ {
+ pwd->bIsPainted = false;
+ if (skin.bNeedLayerUpdate)
+ {
+ RECT r = pwd->rcWindow;
+ POINT ptSrc = {0, 0};
+ SIZE sz = {r.right - r.left, r.bottom - r.top};
+
+ BLENDFUNCTION blend;
+ blend.BlendOp = AC_SRC_OVER;
+ blend.BlendFlags = 0;
+ blend.SourceConstantAlpha = 0;
+ blend.AlphaFormat = AC_SRC_ALPHA;
+
+ MyUpdateLayeredWindow(hwnd, NULL, NULL, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+ }
+ else if (MySetLayeredWindowAttributes)
+ {
+ MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), 0, LWA_ALPHA);
+ }
+
+ SendMessage(hwnd, PUM_REFRESHTRAYTIP, 1, 0);
+ SendMessage(hwnd, PUM_GETHEIGHT, 0, 0);
+ SendMessage(hwnd, PUM_CALCPOS, 0, 0);
+ InvalidateRect(hwnd, 0, TRUE);
+
+ if (opt.showEffect)
+ {
+ KillTimer(hwnd, ID_TIMER_ANIMATE);
+ SetTimer(hwnd, ID_TIMER_ANIMATE, ANIM_ELAPSE, 0);
+ pwd->iAnimStep = 0;
+ pwd->iCurrentTrans = 0;
+ }
+
+ return TRUE;
+ }
+ case PUM_REFRESH_VALUES:
+ {
+ if (pwd && pwd->clcit.szProto == 0 && !pwd->bIsTextTip)
+ {
+ for (int i = 0; i < pwd->iRowCount; i++)
+ {
+ mir_free(pwd->rows[i].swzLabel);
+ mir_free(pwd->rows[i].swzValue);
+ Smileys_FreeParse(pwd->rows[i].spi);
+ }
+
+ if (pwd->rows)
+ {
+ mir_free(pwd->rows);
+ pwd->rows = 0;
+ }
+ pwd->iRowCount = 0;
+
+ DIListNode *node = opt.diList;
+ TCHAR buff_label[LABEL_LEN], buff[VALUE_LEN];
+ while (node)
+ {
+ if (node->di.bIsVisible)
+ {
+ if (GetLabelText(pwd->hContact, node->di, buff_label, LABEL_LEN) && GetValueText(pwd->hContact, node->di, buff, VALUE_LEN))
+ {
+ if (node->di.bLineAbove // we have a line above
+ && pwd->iRowCount > 0 // and we're not the first row
+ && pwd->rows[pwd->iRowCount - 1].bLineAbove // and above us there's a line above
+ && pwd->rows[pwd->iRowCount - 1].swzLabel[0] == 0 // with no label
+ && pwd->rows[pwd->iRowCount - 1].swzValue[0] == 0) // and no value
+ {
+ // overwrite item above
+ pwd->iRowCount--;
+ mir_free(pwd->rows[pwd->iRowCount].swzLabel);
+ mir_free(pwd->rows[pwd->iRowCount].swzValue);
+ Smileys_FreeParse(pwd->rows[pwd->iRowCount].spi); //prevent possible mem leak
+ }
+ else
+ {
+ pwd->rows = (RowData *)mir_realloc(pwd->rows, sizeof(RowData) * (pwd->iRowCount + 1));
+ }
+
+ char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)pwd->hContact, 0);
+
+ pwd->rows[pwd->iRowCount].swzLabel = mir_tstrdup(buff_label);
+ pwd->rows[pwd->iRowCount].swzValue = mir_tstrdup(buff);
+ pwd->rows[pwd->iRowCount].spi = Smileys_PreParse(buff, (int)_tcslen(buff), szProto);
+ pwd->rows[pwd->iRowCount].bValueNewline = node->di.bValueNewline;
+ pwd->rows[pwd->iRowCount].bLineAbove = node->di.bLineAbove;
+ pwd->iRowCount++;
+ }
+ }
+ node = node->next;
+ }
+
+ // if the last item is just a divider, remove it
+ if (pwd->iRowCount > 0
+ && pwd->rows[pwd->iRowCount - 1].bLineAbove // and above us there's a line above
+ && pwd->rows[pwd->iRowCount - 1].swzLabel[0] == 0 // with no label
+ && pwd->rows[pwd->iRowCount - 1].swzValue[0] == 0) // and no value
+ {
+ pwd->iRowCount--;
+ mir_free(pwd->rows[pwd->iRowCount].swzLabel);
+ mir_free(pwd->rows[pwd->iRowCount].swzValue);
+ Smileys_FreeParse(pwd->rows[pwd->iRowCount].spi); //prevent possible mem leak
+
+ if (pwd->iRowCount == 0)
+ {
+ mir_free(pwd->rows);
+ pwd->rows = 0;
+ }
+ }
+
+ if (wParam == TRUE)
+ {
+ SendMessage(hwnd, PUM_GETHEIGHT, 0, 0);
+ SendMessage(hwnd, PUM_CALCPOS, 0, 0);
+ }
+ }
+ return TRUE;
+ }
+ case PUM_GETHEIGHT:
+ {
+ int *pHeight = (int *)wParam;
+ HDC hdc = GetDC(hwnd);
+ SIZE sz;
+ RECT rc, smr;
+ rc.top = rc.left = 0;
+ rc.right = opt.iWinWidth;
+ int iWidth = opt.iPadding;
+ int iWinAvatarHeight = 0;
+ bool bStatusMsg = false;
+ HFONT hOldFont = (HFONT)GetCurrentObject(hdc,OBJ_FONT);
+
+ // avatar height
+ pwd->iAvatarHeight = 0;
+ if (!pwd->bIsTextTip && opt.avatarLayout != PAV_NONE && ServiceExists(MS_AV_GETAVATARBITMAP))
+ {
+ AVATARCACHEENTRY *ace = 0;
+ if (pwd->hContact) ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)pwd->hContact, 0);
+ else ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)pwd->clcit.szProto);
+
+ if (ace && (ace->dwFlags & AVS_BITMAP_VALID) && !(ace->dwFlags & AVS_HIDEONCLIST))
+ {
+ if (opt.bOriginalAvatarSize && max(ace->bmWidth, ace->bmHeight) <= opt.iAvatarSize)
+ {
+ pwd->iRealAvatarHeight = ace->bmHeight;
+ pwd->iRealAvatarWidth = ace->bmWidth;
+ }
+ else
+ {
+ if (ace->bmHeight >= ace->bmWidth)
+ {
+ pwd->iRealAvatarHeight = opt.iAvatarSize;
+ pwd->iRealAvatarWidth = (int)(opt.iAvatarSize * (ace->bmWidth / (double)ace->bmHeight));
+ }
+ else
+ {
+ pwd->iRealAvatarHeight = (int)(opt.iAvatarSize * (ace->bmHeight / (double)ace->bmWidth));
+ pwd->iRealAvatarWidth = opt.iAvatarSize;
+ }
+ }
+
+ pwd->iAvatarHeight = opt.iOuterAvatarPadding + opt.iInnerAvatarPadding + pwd->iRealAvatarHeight;
+ iWinAvatarHeight = 2 * opt.iOuterAvatarPadding + pwd->iRealAvatarHeight;
+ iWidth += pwd->iRealAvatarWidth + (opt.iOuterAvatarPadding + opt.iInnerAvatarPadding - opt.iPadding);
+ }
+ }
+
+ // titlebar height
+ if (!pwd->bIsTextTip && pwd->swzTitle && opt.titleLayout != PTL_NOTITLE)
+ {
+ smr.top = smr.bottom = 0;
+ smr.left = rc.left + opt.iPadding + pwd->iIndent;
+ smr.right = rc.right;
+
+ if (pwd->iRealAvatarWidth > 0)
+ smr.right -= pwd->iRealAvatarWidth + opt.iOuterAvatarPadding + opt.iInnerAvatarPadding;
+ else
+ smr.right -= opt.iPadding;
+
+ if (hFontTitle) SelectObject(hdc, (HGDIOBJ)hFontTitle);
+ DrawTextExt(hdc, pwd->swzTitle, -1, &smr, DT_CALCRECT | DT_LEFT | DT_WORDBREAK | DT_END_ELLIPSIS | DT_NOPREFIX, NULL, pwd->spiTitle);
+
+ iWidth += opt.iPadding + opt.iTitleIndent + smr.right;
+ pwd->iTitleHeight = opt.iPadding + smr.bottom;
+ }
+ else
+ {
+ pwd->iTitleHeight = opt.iPadding;
+ }
+
+ // icon height
+ int i, iCount = 0;
+ if (pwd->hContact || pwd->clcit.szProto)
+ {
+ for(i = 0; i < EXICONS_COUNT; i++)
+ {
+ if ((INT_PTR)pwd->extraIcons[i].hIcon == CALLSERVICE_NOTFOUND)
+ pwd->extraIcons[i].hIcon = 0;
+
+ if (pwd->extraIcons[i].hIcon)
+ iCount++;
+ }
+ }
+ pwd->iIconsHeight = (iCount * 20) + 20;
+
+ // text height
+ pwd->iTextHeight = pwd->iLabelWidth = 0;
+ // iterate once to find max label width for items with label and value on same line, but don't consider width of labels on a new line
+ for (i = 0; i < pwd->iRowCount; i++)
+ {
+ if (pwd->rows[i].swzLabel && !pwd->rows[i].bValueNewline)
+ {
+ if (pwd->bIsTrayTip && pwd->rows[i].bIsTitle)
+ {
+ if (hFontTrayTitle)
+ SelectObject(hdc, (HGDIOBJ)hFontTrayTitle);
+ }
+ else
+ {
+ if (hFontLabels)
+ SelectObject(hdc, (HGDIOBJ)hFontLabels);
+ }
+
+ GetTextExtentPoint32(hdc, pwd->rows[i].swzLabel, (int)_tcslen(pwd->rows[i].swzLabel), &sz);
+ if (sz.cx > pwd->iLabelWidth)
+ pwd->iLabelWidth = sz.cx;
+ }
+ }
+
+ for (i = 0; i < pwd->iRowCount; i++)
+ {
+ if (pwd->bIsTrayTip && pwd->rows[i].bIsTitle)
+ {
+ if (hFontTrayTitle)
+ SelectObject(hdc, (HGDIOBJ)hFontTrayTitle);
+ }
+ else
+ {
+ if (hFontLabels)
+ SelectObject(hdc, (HGDIOBJ)hFontLabels);
+ }
+
+ if (pwd->rows[i].swzLabel && pwd->rows[i].swzLabel[0])
+ GetTextExtentPoint32(hdc, pwd->rows[i].swzLabel, (int)_tcslen(pwd->rows[i].swzLabel), &sz);
+ else
+ sz.cy = sz.cx = 0;
+
+ // save so we don't have to recalculate
+ pwd->rows[i].iLabelHeight = sz.cy;
+
+ smr.top = smr.bottom = 0;
+ smr.left = rc.left + opt.iPadding + pwd->iIndent;
+ smr.right = rc.right;
+ if (hFontValues) SelectObject(hdc, (HGDIOBJ)hFontValues);
+ if (pwd->iTitleHeight + pwd->iTextHeight + opt.iTextPadding < pwd->iAvatarHeight)
+ smr.right -= pwd->iRealAvatarWidth + opt.iOuterAvatarPadding + opt.iInnerAvatarPadding;
+ else
+ smr.right -= opt.iPadding;
+
+ if (!pwd->rows[i].bValueNewline)
+ smr.right -= pwd->iLabelWidth + opt.iValueIndent;
+
+ if (pwd->rows[i].swzValue && pwd->rows[i].swzValue[0])
+ {
+ if (!bStatusMsg && opt.bGetNewStatusMsg)
+ {
+ if (!_tcscmp(pwd->rows[i].swzValue, _T("%sys:status_msg%")))
+ bStatusMsg = true;
+ }
+
+ DrawTextExt(hdc, pwd->rows[i].swzValue, -1, &smr, DT_CALCRECT | DT_LEFT | DT_WORDBREAK | DT_END_ELLIPSIS | DT_NOPREFIX, NULL, pwd->rows[i].spi);
+ }
+ else
+ {
+ smr.left = smr.right = 0;
+ }
+
+ // save so we don't have to recalculate
+ pwd->rows[i].iValueHeight = smr.bottom;
+
+ pwd->rows[i].iTotalHeight = (pwd->rows[i].bLineAbove ? opt.iTextPadding : 0);
+ if (pwd->rows[i].bValueNewline)
+ {
+ if (sz.cy) pwd->rows[i].iTotalHeight += sz.cy + opt.iTextPadding;
+ if (smr.bottom) pwd->rows[i].iTotalHeight += smr.bottom + opt.iTextPadding;
+ }
+ else
+ {
+ int maxheight = max(sz.cy, smr.bottom);
+ if (maxheight) pwd->rows[i].iTotalHeight += maxheight + opt.iTextPadding;
+ }
+
+ // only consider this item's width, and include it's height, if it doesn't make the window too big
+ if (max(pwd->iTitleHeight + pwd->iTextHeight + opt.iPadding + pwd->rows[i].iTotalHeight, pwd->iAvatarHeight) <= opt.iWinMaxHeight || pwd->bIsTrayTip)
+ {
+ if (iWidth < opt.iWinWidth)
+ {
+ int wid = opt.iPadding + pwd->iIndent + (pwd->rows[i].bValueNewline ? max(sz.cx, smr.right - smr.left) : pwd->iLabelWidth + opt.iValueIndent + (smr.right - smr.left));
+ if (pwd->iTitleHeight + pwd->iTextHeight + opt.iTextPadding < pwd->iAvatarHeight)
+ iWidth = max(iWidth, wid + pwd->iRealAvatarWidth + opt.iOuterAvatarPadding + opt.iInnerAvatarPadding);
+ else
+ iWidth = max(iWidth, wid + opt.iPadding);
+ }
+
+ pwd->iTextHeight += pwd->rows[i].iTotalHeight;
+ }
+ }
+
+ SelectObject(hdc, hOldFont);
+ ReleaseDC(hwnd, hdc);
+
+ int iHeight = max(pwd->iTitleHeight + pwd->iTextHeight + opt.iPadding, iWinAvatarHeight);
+ iHeight = max(pwd->iIconsHeight, iHeight);
+ if (bStatusMsg) iHeight += 50;
+
+ if (iHeight < opt.iMinHeight) iHeight = opt.iMinHeight;
+ // ignore minwidth for text tips
+ if (!pwd->bIsTextTip && iWidth < opt.iMinWidth) iWidth = opt.iMinWidth;
+
+ // ignore maxheight for tray tip
+ if (!pwd->bIsTrayTip && iHeight > opt.iWinMaxHeight) iHeight = opt.iWinMaxHeight;
+ if (iWidth > opt.iWinWidth) iWidth = opt.iWinWidth;
+
+ CreateSkinBitmap(iWidth, iHeight, pwd->bIsTextTip && !pwd->bIsTrayTip);
+
+ GetWindowRect(hwnd, &rc);
+ if (rc.right - rc.left != iWidth || rc.bottom - rc.top != iHeight)
+ {
+ SetWindowPos(hwnd, 0, 0, 0, iWidth, iHeight, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
+ GetWindowRect(hwnd, &pwd->rcWindow);
+ SendMessage(hwnd, PUM_UPDATERGN, 0, 0);
+ InvalidateRect(hwnd, 0, TRUE);
+ }
+
+ if (pHeight)
+ *pHeight = iHeight;
+
+ return TRUE;
+ }
+ case PUM_UPDATERGN:
+ {
+ HRGN hRgn;
+ RECT r = pwd->rcWindow;
+ int v, h;
+ int w = 11;
+
+ r.right -= r.left;
+ r.left = 0;
+ r.bottom -= r.top;
+ r.top = 0;
+
+ if (opt.showEffect == PSE_FADE && wParam == 1)
+ {
+ if (skin.bNeedLayerUpdate)
+ {
+ POINT ptSrc = {0, 0};
+ SIZE sz = {r.right - r.left, r.bottom - r.top};
+
+ BLENDFUNCTION blend;
+ blend.BlendOp = AC_SRC_OVER;
+ blend.BlendFlags = 0;
+ blend.SourceConstantAlpha = pwd->iCurrentTrans;
+ blend.AlphaFormat = AC_SRC_ALPHA;
+
+ pwd->iCurrentTrans += opt.iAnimateSpeed;
+ if (pwd->iCurrentTrans > pwd->iTrans)
+ {
+ pwd->iCurrentTrans = pwd->iTrans;
+ pwd->iAnimStep = ANIM_STEPS;
+ }
+
+ MyUpdateLayeredWindow(hwnd, NULL, NULL, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+
+ }
+ else if (MySetLayeredWindowAttributes)
+ {
+ pwd->iCurrentTrans += opt.iAnimateSpeed;
+ if (pwd->iCurrentTrans > pwd->iTrans)
+ {
+ pwd->iCurrentTrans = pwd->iTrans;
+ pwd->iAnimStep = ANIM_STEPS;
+ }
+
+ MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), pwd->iCurrentTrans, LWA_ALPHA);
+ }
+
+ }
+ else if (opt.showEffect == PSE_ANIMATE && pwd->bIsPainted)
+ {
+ if (pwd->iAnimStep <= (ANIM_STEPS / opt.iAnimateSpeed))
+ {
+ float frac = 1.0f - pwd->iAnimStep / ((float)ANIM_STEPS / opt.iAnimateSpeed);
+ int wi = r.right, hi = r.bottom;
+
+ r.left += (int)(wi / 2.0f * frac + 0.5f);
+ r.right -= (int)(wi / 2.0f * frac + 0.5f);
+ r.top += (int)(hi / 2.0f * frac + 0.5f);
+ r.bottom -= (int)(hi / 2.0f * frac + 0.5f);
+ }
+ else
+ {
+ pwd->iAnimStep = ANIM_STEPS;
+ }
+
+ if (skin.bNeedLayerUpdate)
+ {
+ RECT r2 = pwd->rcWindow;
+ POINT ptPos = {r.left + r2.left, r.top + r2.top};
+ POINT ptSrc = {r.left, r.top};
+
+ SIZE sz = {r.right - r.left, r.bottom - r.top};
+
+ BLENDFUNCTION blend;
+ blend.BlendOp = AC_SRC_OVER;
+ blend.BlendFlags = 0;
+ blend.SourceConstantAlpha = pwd->iTrans;
+ blend.AlphaFormat = AC_SRC_ALPHA;
+
+ MyUpdateLayeredWindow(hwnd, NULL, &ptPos, &sz, skin.hdc, &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+ }
+ }
+
+ if (!skin.bNeedLayerUpdate)
+ {
+ // round corners
+ if (opt.bRound)
+ {
+ h = (r.right-r.left)>(w*2) ? w : (r.right-r.left);
+ v = (r.bottom-r.top)>(w*2) ? w : (r.bottom-r.top);
+ h = (h<v) ? h : v;
+ }
+ else
+ {
+ h = 0;
+ }
+
+ hRgn = CreateRoundRectRgn(r.left,r.top,r.right + 1,r.bottom + 1, h, h);
+ SetWindowRgn(hwnd, hRgn, FALSE);
+
+ if (opt.showEffect == PSE_ANIMATE && pwd->iAnimStep == 1)
+ {
+ if (MySetLayeredWindowAttributes)
+ MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), pwd->iTrans, LWA_ALPHA);
+ }
+
+ }
+ else
+ {
+ // aero glass (vista+)
+ if (opt.bAeroGlass && MyDwmEnableBlurBehindWindow && pwd->iAnimStep > 5)
+ {
+ if (pwd->hrgnAeroGlass)
+ {
+ DeleteObject(pwd->hrgnAeroGlass);
+ pwd->hrgnAeroGlass = 0;
+ }
+
+ pwd->hrgnAeroGlass = CreateOpaqueRgn(25, true);
+
+ if (pwd->hrgnAeroGlass)
+ {
+ DWM_BLURBEHIND bb = {0};
+ bb.dwFlags = DWM_BB_ENABLE | DWM_BB_BLURREGION;
+ bb.fEnable = TRUE;
+ bb.hRgnBlur = pwd->hrgnAeroGlass;
+ MyDwmEnableBlurBehindWindow(hwnd, &bb);
+ }
+ }
+ }
+
+ return TRUE;
+ }
+ case PUM_CALCPOS:
+ {
+ RECT rcWork, rc;
+
+ SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWork, FALSE);
+ if (MyMonitorFromPoint)
+ {
+ HMONITOR hMon = MyMonitorFromPoint(pwd->clcit.ptCursor, MONITOR_DEFAULTTONEAREST);
+ MONITORINFO mi;
+ mi.cbSize = sizeof(mi);
+ if (MyGetMonitorInfo(hMon, &mi))
+ rcWork = mi.rcWork;
+ }
+
+ GetWindowRect(hwnd, &rc);
+
+ int x = 0, y = 0, iWidth = (rc.right - rc.left), iHeight = (rc.bottom - rc.top);
+
+ switch(opt.pos)
+ {
+ case PP_BOTTOMRIGHT:
+ x = pwd->clcit.ptCursor.x + GetSystemMetrics(SM_CXSMICON); // cursor size is too large - use small icon size
+ y = pwd->clcit.ptCursor.y + GetSystemMetrics(SM_CYSMICON);
+ break;
+ case PP_BOTTOMLEFT:
+ x = pwd->clcit.ptCursor.x - iWidth - GetSystemMetrics(SM_CXSMICON);
+ y = pwd->clcit.ptCursor.y + GetSystemMetrics(SM_CYSMICON);
+ break;
+ case PP_TOPRIGHT:
+ x = pwd->clcit.ptCursor.x + GetSystemMetrics(SM_CXSMICON);
+ y = pwd->clcit.ptCursor.y - iHeight - GetSystemMetrics(SM_CYSMICON);
+ break;
+ case PP_TOPLEFT:
+ x = pwd->clcit.ptCursor.x - iWidth - GetSystemMetrics(SM_CXSMICON);
+ y = pwd->clcit.ptCursor.y - iHeight - GetSystemMetrics(SM_CYSMICON);
+ break;
+ }
+
+
+ if (x + iWidth + 8 > rcWork.right)
+ x = rcWork.right - iWidth - 8;
+ if (x - 8 < rcWork.left)
+ x = rcWork.left + 8;
+
+ if (pwd->bAllowReposition || !pwd->bNeedRefresh)
+ {
+ if (y + iHeight > rcWork.bottom)
+ {
+ y = pwd->clcit.ptCursor.y - iHeight - 8;
+ pwd->bAllowReposition = true;
+ }
+
+ if (y - 8 < rcWork.top)
+ {
+ y = pwd->clcit.ptCursor.y + GetSystemMetrics(SM_CYSMICON);
+ pwd->bAllowReposition = true;
+ }
+ }
+
+ SetWindowPos(hwnd, 0, x, y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER);
+ GetWindowRect(hwnd, &pwd->rcWindow);
+ return TRUE;
+ }
+ case PUM_REFRESHTRAYTIP:
+ {
+ int i, j;
+ for (i = 0; i < pwd->iRowCount; i++)
+ {
+ mir_free(pwd->rows[i].swzLabel);
+ mir_free(pwd->rows[i].swzValue);
+ Smileys_FreeParse(pwd->rows[i].spi);
+ }
+
+ if (pwd->rows)
+ {
+ mir_free(pwd->rows);
+ pwd->rows = NULL;
+ }
+
+ pwd->iRowCount = 0;
+
+ DWORD dwItems = (wParam == 0) ? opt.iFirstItems : opt.iSecondItems;
+ bool bFirstItem = true;
+ TCHAR buff[64];
+
+ int oldOrder = -1, iProtoCount = 0;
+ PROTOACCOUNT **accs;
+ ProtoEnumAccounts(&iProtoCount, &accs);
+
+ for (j = 0; j < iProtoCount; j++)
+ {
+ PROTOACCOUNT *pa = NULL;
+ for (i = 0; i < iProtoCount; i++)
+ {
+
+ if (accs[i]->iOrder > oldOrder && (pa == NULL || accs[i]->iOrder < pa->iOrder))
+ pa = accs[i];
+ }
+
+ oldOrder = pa->iOrder;
+
+ WORD wStatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0);
+ if (opt.bHideOffline && wStatus == ID_STATUS_OFFLINE)
+ continue;
+
+ if (!IsAccountEnabled(pa) || !IsTrayProto(pa->tszAccountName, (BOOL)wParam))
+ continue;
+
+ if (dwItems & TRAYTIP_NUMCONTACTS)
+ {
+ int iCount = 0, iCountOnline = 0;
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while (hContact)
+ {
+ char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (proto && !strcmp(proto, pa->szModuleName))
+ {
+ if (DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
+ iCountOnline++;
+ iCount++;
+ }
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ }
+ mir_sntprintf(buff, 64, _T("(%d/%d)"), iCountOnline, iCount);
+ }
+ else
+ {
+ _tcscpy(buff, _T(""));
+ }
+
+ TCHAR swzProto[256];
+ _tcscpy(swzProto, pa->tszAccountName);
+ if (dwItems & TRAYTIP_LOCKSTATUS)
+ {
+ if (CallService(MS_PROTO_ISACCOUNTLOCKED,0,(LPARAM)pa->szModuleName))
+ mir_sntprintf(swzProto, SIZEOF(swzProto), TranslateT("%s (locked)"), pa->tszAccountName);
+ }
+
+ AddRow(pwd, swzProto, buff, NULL, false, false, !bFirstItem, true, LoadSkinnedProtoIcon(pa->szModuleName, wStatus));
+ bFirstItem = false;
+
+ if (dwItems & TRAYTIP_LOGON)
+ {
+ if (TimestampToTimeDifference(NULL, pa->szModuleName, "LogonTS", buff, 59))
+ {
+ _tcscat(buff, TranslateT(" ago"));
+ AddRow(pwd, TranslateT("Log on:"), buff, NULL, false, false, false);
+ }
+ }
+
+ if (dwItems & TRAYTIP_UNREAD_EMAILS && ProtoServiceExists(pa->szModuleName, "/GetUnreadEmailCount"))
+ {
+ int iCount = (int)CallProtoService(pa->szModuleName, "/GetUnreadEmailCount", 0, 0);
+ if (iCount > 0)
+ {
+ _itot(iCount, buff, 10);
+ AddRow(pwd, TranslateT("Unread emails:"), buff, NULL, false, false, false);
+ }
+ }
+
+ if (dwItems & TRAYTIP_STATUS)
+ {
+ char *szStatus = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)wStatus, (LPARAM)0);
+ if (szStatus)
+ {
+ TCHAR *swzText = mir_a2t(szStatus);
+ AddRow(pwd, TranslateT("Status:"), swzText, NULL, false, false, false);
+ mir_free(swzText);
+ }
+ }
+
+ if (wStatus >= ID_STATUS_ONLINE && wStatus <= ID_STATUS_OUTTOLUNCH)
+ {
+ if (dwItems & TRAYTIP_STATUS_MSG)
+ {
+ TCHAR *swzText = GetProtoStatusMessage(pa->szModuleName, wStatus);
+ if (swzText)
+ {
+ StripBBCodesInPlace(swzText);
+ AddRow(pwd, TranslateT("Status message:"), swzText, pa->szModuleName, true, true, false);
+ mir_free(swzText);
+ }
+ }
+
+ if (dwItems & TRAYTIP_EXTRA_STATUS)
+ {
+ // jabber mood or icq xstatus
+ TCHAR *swzAdvTitle = GetJabberAdvStatusText(pa->szModuleName, "mood", "title");
+ if (swzAdvTitle)
+ {
+ StripBBCodesInPlace(swzAdvTitle);
+ AddRow(pwd, TranslateT("Mood:"), swzAdvTitle, pa->szModuleName, true, false, false);
+ mir_free(swzAdvTitle);
+
+ TCHAR *swzAdvText = GetJabberAdvStatusText(pa->szModuleName, "mood", "text");
+ if (swzAdvText)
+ {
+ StripBBCodesInPlace(swzAdvText);
+ AddRow(pwd, _T(""), swzAdvText, pa->szModuleName, true, true, false);
+ mir_free(swzAdvText);
+ }
+ }
+ else
+ {
+ if (DBGetContactSettingByte(0, pa->szModuleName, "XStatusId", 0))
+ {
+ // xstatus title
+ swzAdvTitle = GetProtoExtraStatusTitle(pa->szModuleName);
+ if (swzAdvTitle)
+ {
+ StripBBCodesInPlace(swzAdvTitle);
+ AddRow(pwd, TranslateT("XStatus:"), swzAdvTitle, pa->szModuleName, true, false, false);
+ mir_free(swzAdvTitle);
+ }
+
+ // xstatus message
+ TCHAR *swzAdvText = GetProtoExtraStatusMessage(pa->szModuleName);
+ if (swzAdvText)
+ {
+ StripBBCodesInPlace(swzAdvText);
+ AddRow(pwd, _T(""), swzAdvText, pa->szModuleName, true, true, false);
+ mir_free(swzAdvText);
+ }
+ }
+ }
+
+ TCHAR *swzActTitle = GetJabberAdvStatusText(pa->szModuleName, "activity", "title");
+ if (swzActTitle)
+ {
+ StripBBCodesInPlace(swzActTitle);
+ AddRow(pwd, TranslateT("Activity:"), swzActTitle, pa->szModuleName, true, false, false);
+ mir_free(swzActTitle);
+ }
+
+ TCHAR *swzActText = GetJabberAdvStatusText(pa->szModuleName, "activity", "text");
+ if (swzActText)
+ {
+ StripBBCodesInPlace(swzActText);
+ AddRow(pwd, _T(""), swzActText, pa->szModuleName, true, true, false);
+ mir_free(swzActText);
+ }
+ }
+
+ if (dwItems & TRAYTIP_LISTENINGTO)
+ {
+ TCHAR *swzListening = GetListeningTo(pa->szModuleName);
+ if (swzListening)
+ {
+ StripBBCodesInPlace(swzListening);
+ AddRow(pwd, TranslateT("Listening to:"), swzListening, NULL, false, true, false);
+ mir_free(swzListening);
+ }
+ }
+ }
+ }
+
+ if (dwItems & TRAYTIP_FAVCONTACTS)
+ {
+ if (DBGetContactSettingDword(0, MODULE, "FavouriteContactsCount", 0))
+ {
+ HANDLE hContact;
+ TCHAR swzName[256];
+ TCHAR swzStatus[256];
+ bool bTitlePainted = false;
+ int iCount = 0, iCountOnline = 0;
+
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while (hContact)
+ {
+ if (DBGetContactSettingByte(hContact, MODULE, "FavouriteContact", 0))
+ {
+ char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (proto)
+ {
+ WORD wStatus = DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE);
+ WordToStatusDesc(hContact, proto, "Status", swzStatus, 256);
+
+ if (wStatus != ID_STATUS_OFFLINE)
+ iCountOnline++;
+
+ iCount++;
+
+ if (!(opt.iFavoriteContFlags & FAVCONT_HIDE_OFFLINE && wStatus == ID_STATUS_OFFLINE))
+ {
+ if (!bTitlePainted)
+ {
+ AddRow(pwd, TranslateT("Fav. contacts"), NULL, NULL, false, false, !bFirstItem, true, NULL);
+ bFirstItem = false;
+ bTitlePainted = true;
+ }
+
+ TCHAR *swzNick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
+ if (opt.iFavoriteContFlags & FAVCONT_APPEND_PROTO)
+ {
+ TCHAR *swzProto = a2t(proto);
+ mir_sntprintf(swzName, 256, _T("%s (%s)"), swzNick, swzProto);
+ mir_free(swzProto);
+ }
+ else
+ {
+ _tcscpy(swzName, swzNick);
+ }
+
+ AddRow(pwd, swzName, swzStatus, NULL, false, false, false);
+ }
+ }
+ }
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ }
+
+ int index = pwd->iRowCount - 1;
+ if (opt.iFavoriteContFlags & FAVCONT_HIDE_OFFLINE)
+ index -= iCountOnline;
+ else
+ index -= iCount;
+
+ if (index >= 0 && (dwItems & TRAYTIP_NUMCONTACTS) && !((opt.iFavoriteContFlags & FAVCONT_HIDE_OFFLINE) && iCountOnline == 0))
+ {
+ mir_sntprintf(buff, 64, _T("(%d/%d)"), iCountOnline, iCount);
+ pwd->rows[index].swzValue = mir_tstrdup(buff);
+ }
+ }
+ }
+
+ if (dwItems & TRAYTIP_MIRANDA_UPTIME)
+ {
+ if (TimestampToTimeDifference(NULL, MODULE, "MirandaStartTS", buff, 64))
+ {
+ AddRow(pwd, TranslateT("Other"), _T(""), NULL, false, false, !bFirstItem, true, NULL);
+ AddRow(pwd, TranslateT("Miranda uptime:"), buff, NULL, false, false, false);
+ }
+ }
+
+ if (dwItems & TRAYTIP_CLIST_EVENT && pwd->clcit.swzText)
+ {
+ TCHAR *pchBr = _tcschr(pwd->clcit.swzText, '\n');
+ TCHAR *pchBold = _tcsstr(pwd->clcit.swzText, _T("<b>"));
+
+ if (!pchBold || pchBold != pwd->clcit.swzText)
+ {
+ TCHAR swzText[256];
+ _tcscpy(swzText, pwd->clcit.swzText);
+ if (pchBr) swzText[pchBr - pwd->clcit.swzText] = 0;
+ AddRow(pwd, swzText, _T(""), NULL, false, true, false, true, LoadSkinnedIcon(SKINICON_OTHER_FILLEDBLOB));
+ }
+ }
+
+ return TRUE;
+ }
+ }
+
+ return DefWindowProc(hwnd, uMsg, wParam, lParam);
+}
\ No newline at end of file diff --git a/plugins/TipperYM/popwin.h b/plugins/TipperYM/popwin.h new file mode 100644 index 0000000000..b7ba674b08 --- /dev/null +++ b/plugins/TipperYM/popwin.h @@ -0,0 +1,140 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _POPWIN_INC
+#define _POPWIN_INC
+
+#include "mir_smileys.h"
+
+#define POP_WIN_CLASS _T(MODULE) _T("MimTTClass")
+
+#define PUM_GETHEIGHT (WM_USER + 0x020)
+#define PUM_CALCPOS (WM_USER + 0x021)
+#define PUM_SETSTATUSTEXT (WM_USER + 0x022)
+#define PUM_UPDATERGN (WM_USER + 0x023)
+#define PUM_SETAVATAR (WM_USER + 0x024)
+#define PUM_REFRESH_VALUES (WM_USER + 0x025)
+#define PUM_SHOWXSTATUS (WM_USER + 0x026)
+#define PUM_EXPANDTRAYTIP (WM_USER + 0x027)
+#define PUM_REFRESHTRAYTIP (WM_USER + 0x028)
+#define PUM_FADEOUTWINDOW (WM_USER + 0x029)
+
+// extra icons
+#define EXICONS_COUNT 6
+#define CTRY_ERROR 42 //Flags - some strange value ???
+#define GEN_FEMALE 70
+#define GEN_MALE 77
+
+// copy menu
+#define COPYMENU_ALLITEMS_LABELS 1000
+#define COPYMENU_ALLITEMS 1001
+#define COPYMENU_AVATAR 1002
+
+// tray tooltip items
+#define TRAYTIP_ITEMS_COUNT 11
+
+#define TRAYTIP_NUMCONTACTS 1
+#define TRAYTIP_LOCKSTATUS 2
+#define TRAYTIP_LOGON 4
+#define TRAYTIP_UNREAD_EMAILS 8
+#define TRAYTIP_STATUS 16
+#define TRAYTIP_STATUS_MSG 32
+#define TRAYTIP_EXTRA_STATUS 64
+#define TRAYTIP_LISTENINGTO 128
+#define TRAYTIP_FAVCONTACTS 256
+#define TRAYTIP_MIRANDA_UPTIME 512
+#define TRAYTIP_CLIST_EVENT 1024
+
+// favorite contacts options
+#define FAVCONT_HIDE_OFFLINE 1
+#define FAVCONT_APPEND_PROTO 2
+
+// other
+#define TITLE_TEXT_LEN 512
+#define MAX_VALUE_LEN 64
+
+#define ANIM_ELAPSE 10
+#define ANIM_STEPS 255
+#define CHECKMOUSE_ELAPSE 250
+
+#define ID_TIMER_ANIMATE 0x0100
+#define ID_TIMER_CHECKMOUSE 0x0101
+#define ID_TIMER_TRAYTIP 0x0102
+
+
+typedef struct {
+ HICON hIcon;
+ bool bDestroy;
+} ExtraIcons;
+
+typedef struct {
+ int cbSize;
+ int isTreeFocused; //so the plugin can provide an option
+ int isGroup; //0 if it's a contact, 1 if it's a group
+ HANDLE hItem; //handle to group or contact
+ POINT ptCursor;
+ RECT rcItem;
+ TCHAR *swzText; // for tips with specific text
+ char *szProto; // for proto tips
+} CLCINFOTIPEX;
+
+typedef struct {
+ TCHAR *swzLabel, *swzValue;
+ HICON hIcon;
+ bool bValueNewline;
+ bool bLineAbove;
+ bool bIsTitle;
+ int iLabelHeight, iValueHeight, iTotalHeight;
+ SMILEYPARSEINFO spi;
+} RowData;
+
+typedef struct {
+ HPEN hpenBorder, hpenDivider;
+ int iTitleHeight, iAvatarHeight, iIconsHeight, iTextHeight, iLabelWidth;
+ int iRealAvatarWidth, iRealAvatarHeight;
+ HANDLE hContact;
+ int iIconIndex;
+ CLCINFOTIPEX clcit;
+ TCHAR swzTitle[TITLE_TEXT_LEN];
+ SMILEYPARSEINFO spiTitle;
+ RowData *rows;
+ int iRowCount;
+ int iAnimStep;
+ int iCurrentTrans;
+ bool bIsTextTip, bIsTrayTip;
+ int iIndent, iSidebarWidth;
+ POINT ptCursorStartPos; // work around bugs with hiding tips (timer check mouse position)
+ ExtraIcons extraIcons[EXICONS_COUNT];
+ bool bIsIconVisible[EXICONS_COUNT];
+ int iTrans;
+ int iHotkeyId;
+ bool bIsPainted;
+ bool bNeedRefresh;
+ bool bAllowReposition;
+ RECT rcWindow;
+ HRGN hrgnAeroGlass;
+} PopupWindowData;
+
+
+LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip);
+
+
+#endif
diff --git a/plugins/TipperYM/preset_items.cpp b/plugins/TipperYM/preset_items.cpp new file mode 100644 index 0000000000..30498da33c --- /dev/null +++ b/plugins/TipperYM/preset_items.cpp @@ -0,0 +1,127 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#include "common.h"
+#include "preset_items.h"
+
+PRESETITEM presetItems[] =
+{
+ "birth", LPGENT("Birthday"), LPGENT("Birthday:"), _T("%birthday_date% (%birthday_age%) @ Next: %birthday_next%"), "birthdate", "birthage", "birthnext",
+ "client", LPGENT("Client"), LPGENT("Client:"), _T("%raw:/MirVer%"), 0, 0, 0,
+ "email", LPGENT("Email"), LPGENT("Email:"), _T("%raw:/e-mail%"), 0, 0, 0,
+ "gender", LPGENT("Gender"), LPGENT("Gender:"), _T("%gender%"), 0, 0, 0,
+ "homepage", LPGENT("Homepage"), LPGENT("Homepage:"), _T("%raw:/Homepage%"), 0, 0, 0,
+ "id", LPGENT("Identifier"), LPGENT("%sys:uidname|UID^!MetaContacts%:"), _T("%sys:uid%"), 0, 0, 0,
+ "idle", LPGENT("Idle"), LPGENT("Idle:"), _T("%idle% (%idle_diff% ago)"), "idle", "idlediff", 0,
+ "ip", LPGENT("IP"), LPGENT("IP:"), _T("%ip%"), "ip", 0, 0,
+ "ipint", LPGENT("IP internal"), LPGENT("IP internal:"), _T("%ip_internal%"), "ipint", 0, 0,
+ "lastmsg", LPGENT("Last message"), LPGENT("Last message: (%sys:last_msg_reltime% ago)"), _T("%sys:last_msg%"), 0, 0, 0,
+ "listening", LPGENT("Listening to"), LPGENT("Listening to:"), _T("%raw:/ListeningTo%"), 0, 0, 0,
+ "name", LPGENT("Name"), LPGENT("Name:"), _T("%raw:/FirstName|% %raw:/LastName%"), 0, 0, 0,
+ "received", LPGENT("Number of received messages"), LPGENT("Number of msg [IN]:"), _T("%sys:msg_count_in%"), 0, 0, 0,
+ "sended", LPGENT("Number of sended messages"), LPGENT("Number of msg [OUT]:"), _T("%sys:msg_count_out%"), 0, 0, 0,
+ "status", LPGENT("Status"), LPGENT("Status:"), _T("%Status%"), "status", 0, 0,
+ "statusmsg", LPGENT("Status message"), LPGENT("Status message:"), _T("%sys:status_msg%"), 0, 0, 0,
+ "time", LPGENT("Contact time"), LPGENT("Time:"), _T("%sys:time%"), 0, 0, 0,
+ "xtitle", LPGENT("XStatus title"), LPGENT("XStatus title:"), _T("%xsname%"), "xname", 0, 0,
+ "xtext", LPGENT("XStatus text"), LPGENT("XStatus text:"), _T("%raw:/XStatusMsg%"), 0, 0, 0,
+ "logon", LPGENT("[icq.dll] Logon time"), LPGENT("Logon time:"), _T("%logon_date% @ %logon_time% (pøed: %logon_ago%)"), "logondate", "logontime", "logonago",
+ "acttitle", LPGENT("[jabber.dll] Activity title"), LPGENT("Activity title:"), _T("%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/title%"), 0, 0, 0,
+ "acttext", LPGENT("[jabber.dll] Activity text"), LPGENT("Activity text:"), _T("%raw:AdvStatus/?dbsetting(%subject%,Protocol,p)/activity/text%"), 0, 0, 0,
+ "lastseentime", LPGENT("[seenplugin.dll] Last seen time"), LPGENT("Last seen time:"), _T("%lastseen_date% @ %lastseen_time%"), "lsdate", "lstime", 0,
+ "lastseenstatus", LPGENT("[seenplugin.dll] Last seen status"), LPGENT("Last seen status:"), _T("%lastseen_status% (%lastseen_ago% ago)"), "lsstatus", "lsago", 0,
+ "cond", LPGENT("[weather.dll] Condition"), LPGENT("Condition:"), _T("%raw:Current/Condition%"), 0, 0, 0,
+ "humidity", LPGENT("[weather.dll] Humidity"), LPGENT("Humidity:"), _T("%raw:Current/Humidity%"), 0, 0, 0,
+ "minmaxtemp", LPGENT("[weather.dll] Max/Min temperature"), LPGENT("Max/Min:"), _T("%raw:Current/High%/%raw:Current/Low%"), 0, 0, 0,
+ "moon", LPGENT("[weather.dll] Moon"), LPGENT("Moon:"), _T("%raw:Current/Moon%"), 0, 0, 0,
+ "pressure", LPGENT("[weather.dll] Pressure"), LPGENT("Pressure:"), _T("%raw:Current/Pressure% (%raw:Current/Pressure Tendency%)"), 0, 0, 0,
+ "sunrise", LPGENT("[weather.dll] Sunrise"), LPGENT("Sunrise:"), _T("%raw:Current/Sunrise%"), 0, 0, 0,
+ "sunset", LPGENT("[weather.dll] Sunset"), LPGENT("Sunset:"), _T("%raw:Current/Sunset%"), 0, 0, 0,
+ "temp", LPGENT("[weather.dll] Temperature"), LPGENT("Temperature:"), _T("%raw:Current/Temperature%"), 0, 0, 0,
+ "uptime", LPGENT("[weather.dll] Update time"), LPGENT("Update time:"), _T("%raw:Current/Update%"), 0, 0, 0,
+ "uvindex", LPGENT("[weather.dll] UV Index"), LPGENT("UV Index:"), _T("%raw:Current/UV% - %raw:Current/UVI%"), 0, 0, 0,
+ "vis", LPGENT("[weather.dll] Visibility"), LPGENT("Visibility:"), _T("%raw:Current/Visibility%"), 0, 0, 0,
+ "wind", LPGENT("[weather.dll] Wind"), LPGENT("Wind:"), _T("%raw:Current/Wind Direction% (%raw:Current/Wind Direction DEG%)/%raw:Current/Wind Speed%"), 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0
+};
+
+PRESETSUBST presetSubsts[] =
+{
+ "gender", _T("gender"), DVT_PROTODB, NULL, "Gender", 5,
+ "status", _T("Status"), DVT_PROTODB, NULL, "Status", 1,
+ "ip", _T("ip"), DVT_PROTODB, NULL, "IP", 7,
+ "ipint", _T("ip_internal"), DVT_PROTODB, NULL, "RealIP", 7,
+ "idle", _T("idle"), DVT_PROTODB, NULL, "IdleTS", 2,
+ "idlediff", _T("idle_diff"), DVT_PROTODB, NULL, "IdleTS", 3,
+ "xname", _T("xsname"), DVT_PROTODB, NULL, "XStatusName", 17,
+ "lsdate", _T("lastseen_date"), DVT_DB, "SeenModule", NULL, 8,
+ "lstime", _T("lastseen_time"), DVT_DB, "SeenModule", NULL, 10,
+ "lsstatus", _T("lastseen_status"), DVT_DB, "SeenModule", "OldStatus", 1,
+ "lsago", _T("lastseen_ago"), DVT_DB, "SeenModule", "seenTS", 3,
+ "birthdate", _T("birthday_date"), DVT_PROTODB, NULL, "Birth", 8,
+ "birthage", _T("birthday_age"), DVT_PROTODB, NULL, "Birth", 9,
+ "birthnext", _T("birthday_next"), DVT_PROTODB, NULL, "Birth", 12,
+ "logondate", _T("logon_date"), DVT_PROTODB, NULL, "LogonTS", 15,
+ "logontime", _T("logon_time"), DVT_PROTODB, NULL, "LogonTS", 13,
+ "logonago", _T("logon_ago"), DVT_PROTODB, NULL, "LogonTS", 3,
+ 0, 0, DVT_DB, 0, 0, 0
+};
+
+DEFAULTITEM defaultItemList[] =
+{
+ "statusmsg", true,
+ "-", false,
+ "lastmsg", true ,
+ "-", false,
+ "client", false,
+ "homepage", false,
+ "email", false,
+ "birth", false,
+ "name", false,
+ "-", false,
+ "time", false,
+ "id", false,
+ "status", false,
+ 0,0
+};
+
+PRESETITEM *GetPresetItemByName(char *szName)
+{
+ for (int i = 0; presetItems[i].szID; i++)
+ {
+ if (strcmp(presetItems[i].szID, szName) == 0)
+ return &presetItems[i];
+ }
+
+ return NULL;
+}
+
+PRESETSUBST *GetPresetSubstByName(char *szName)
+{
+ if (!szName) return NULL;
+ for (int i = 0; presetSubsts[i].szID; i++)
+ {
+ if (strcmp(presetSubsts[i].szID, szName) == 0)
+ return &presetSubsts[i];
+ }
+
+ return NULL;
+}
+
diff --git a/plugins/TipperYM/preset_items.h b/plugins/TipperYM/preset_items.h new file mode 100644 index 0000000000..5055db3dee --- /dev/null +++ b/plugins/TipperYM/preset_items.h @@ -0,0 +1,57 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _PRESETITEMS_INC
+#define _PRESETITEMS_INC
+
+#include "options.h"
+
+#define MAX_PRESET_SUBST_COUNT 3
+
+typedef struct {
+ char *szID;
+ TCHAR *swzName;
+ TCHAR *swzLabel;
+ TCHAR *swzValue;
+ char *szNeededSubst[MAX_PRESET_SUBST_COUNT];
+} PRESETITEM;
+
+typedef struct {
+ char *szID;
+ TCHAR *swzName;
+ DisplaySubstType type;
+ char *szModuleName;
+ char *szSettingName;
+ int iTranslateFuncId;
+} PRESETSUBST;
+
+typedef struct {
+ char *szName;
+ bool bValueNewline;
+} DEFAULTITEM;
+
+extern PRESETITEM presetItems[];
+extern PRESETSUBST presetSubsts[];
+extern DEFAULTITEM defaultItemList[];
+
+PRESETITEM *GetPresetItemByName(char *szName);
+PRESETSUBST *GetPresetSubstByName(char *szName);
+
+#endif
\ No newline at end of file diff --git a/plugins/TipperYM/res/apply.ico b/plugins/TipperYM/res/apply.ico Binary files differnew file mode 100644 index 0000000000..2ddfe5dcb0 --- /dev/null +++ b/plugins/TipperYM/res/apply.ico diff --git a/plugins/TipperYM/res/arrow_down.ico b/plugins/TipperYM/res/arrow_down.ico Binary files differnew file mode 100644 index 0000000000..6b630e3433 --- /dev/null +++ b/plugins/TipperYM/res/arrow_down.ico diff --git a/plugins/TipperYM/res/arrow_up.ico b/plugins/TipperYM/res/arrow_up.ico Binary files differnew file mode 100644 index 0000000000..d1886123ae --- /dev/null +++ b/plugins/TipperYM/res/arrow_up.ico diff --git a/plugins/TipperYM/res/copy_all_items.ico b/plugins/TipperYM/res/copy_all_items.ico Binary files differnew file mode 100644 index 0000000000..c24975052c --- /dev/null +++ b/plugins/TipperYM/res/copy_all_items.ico diff --git a/plugins/TipperYM/res/copy_item.ico b/plugins/TipperYM/res/copy_item.ico Binary files differnew file mode 100644 index 0000000000..a757547966 --- /dev/null +++ b/plugins/TipperYM/res/copy_item.ico diff --git a/plugins/TipperYM/res/reload.ico b/plugins/TipperYM/res/reload.ico Binary files differnew file mode 100644 index 0000000000..3eba98d2b3 --- /dev/null +++ b/plugins/TipperYM/res/reload.ico diff --git a/plugins/TipperYM/res/separator.ico b/plugins/TipperYM/res/separator.ico Binary files differnew file mode 100644 index 0000000000..60745575f2 --- /dev/null +++ b/plugins/TipperYM/res/separator.ico diff --git a/plugins/TipperYM/resource.h b/plugins/TipperYM/resource.h new file mode 100644 index 0000000000..0e850b25ea --- /dev/null +++ b/plugins/TipperYM/resource.h @@ -0,0 +1,137 @@ +//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by resource.rc
+//
+#define IDD_OPT_APPEARANCE 101
+#define IDD_SUBST 103
+#define IDD_ITEM 104
+#define IDD_OPT_CONTENT 105
+#define IDD_OPT_SKIN 106
+#define IDI_ITEM 107
+#define IDI_ITEM_ALL 108
+#define IDD_OPT_EXTRA 109
+#define IDD_OPT_TRAYTIP 110
+#define IDD_FAVCONTACTS 111
+#define IDI_UP 112
+#define IDI_DOWN 113
+#define IDI_SEPARATOR 114
+#define IDI_RELOAD 116
+#define IDI_APPLY 117
+#define IDC_ED_WIDTH 1005
+#define IDC_ED_MAXHEIGHT 1006
+#define IDC_SPIN_WIDTH 1007
+#define IDC_SPIN_MAXHEIGHT 1008
+#define IDC_ED_INDENT 1009
+#define IDC_SPIN_INDENT 1010
+#define IDC_ED_PADDING 1011
+#define IDC_SPIN_PADDING 1012
+#define IDC_ED_TRANS 1013
+#define IDC_SPIN_TRANS 1014
+#define IDC_CHK_BORDER 1015
+#define IDC_CHK_ROUNDCORNERS 1016
+#define IDC_ED_MINWIDTH 1017
+#define IDC_ED_SPEED 1017
+#define IDC_CHK_AEROGLASS 1018
+#define IDC_SPIN_SPEED 1019
+#define IDC_CHK_SHADOW 1020
+#define IDC_SPIN_MINWIDTH 1021
+#define IDC_ED_MINHEIGHT 1022
+#define IDC_SPIN_MINHEIGHT 1023
+#define IDC_ED_SBWIDTH 1024
+#define IDC_SPIN_SBWIDTH 1025
+#define IDC_ED_TEXTPADDING 1026
+#define IDC_ED_AVSIZE 1027
+#define IDC_SPIN_AVSIZE 1028
+#define IDC_ED_HOVER 1029
+#define IDC_SPIN_HOVER 1030
+#define IDC_SPIN_TEXTPADDING 1031
+#define IDC_CMB_ICON 1032
+#define IDC_CMB_AV 1033
+#define IDC_CMB_POS 1034
+#define IDC_ED_OUTAVPADDING 1035
+#define IDC_BTN_ADD 1036
+#define IDC_SPIN_OUTAVPADDING 1036
+#define IDC_BTN_REMOVE 1037
+#define IDC_CHK_ROUNDCORNERSAV 1037
+#define IDC_BTN_UP 1038
+#define IDC_CHK_ORIGINALAVSIZE 1038
+#define IDC_BTN_DOWN 1039
+#define IDC_CHK_AVBORDER 1039
+#define IDC_CHK_NOFOCUS 1040
+#define IDC_BTN_ADD2 1040
+#define IDC_BTN_EDIT 1041
+#define IDC_ED_TITLEINDENT 1041
+#define IDC_LST_SUBST 1042
+#define IDC_SPIN_TITLEINDENT 1042
+#define IDC_ED_VALUEINDENT 1043
+#define IDC_BTN_REMOVE2 1043
+#define IDC_ED_MODULE 1044
+#define IDC_SPIN_VALUEINDENT 1044
+#define IDC_BTN_EDIT2 1044
+#define IDC_CHK_PROTOMOD 1045
+#define IDC_ED_INAVPADDING 1045
+#define IDC_BTN_SEPARATOR 1045
+#define IDC_ED_SETTING 1046
+#define IDC_SPIN_INAVPADDING 1046
+#define IDC_CMB_TRANSLATE 1047
+#define IDC_ED_LABEL 1048
+#define IDC_CHK_SBAR 1048
+#define IDC_ED_VALUE 1050
+#define IDC_CHK_LINEABOVE 1051
+#define IDC_CHK_VALNEWLINE 1052
+#define IDC_CMB_LV 1053
+#define IDC_CHK_PARSETIPPERFIRST 1053
+#define IDC_CMB_VV 1054
+#define IDC_CMB_LH 1055
+#define IDC_CMB_VH 1056
+#define IDC_CHK_DISABLEINVISIBLE 1059
+#define IDC_CHK_RETRIEVEXSTATUS 1060
+#define IDC_TREE_EXTRAICONS 1061
+#define IDC_CHK_ENABLESMILEYS 1062
+#define IDC_CHK_RESIZESMILEYS 1063
+#define IDC_CHK_GETSTATUSMSG 1064
+#define IDC_CHK_WAITFORCONTENT 1065
+#define IDC_STATIC_AVATARSIZE 1085
+#define IDC_CMB_EFFECT 1086
+#define IDC_TREE_FIRST_PROTOS 1087
+#define IDC_CHK_ENABLETRAYTIP 1088
+#define IDC_CHK_HANDLEBYTIPPER 1089
+#define IDC_TREE_SECOND_PROTOS 1090
+#define IDC_TREE_SECOND_ITEMS 1094
+#define IDC_TREE_FIRST_ITEMS 1095
+#define IDC_BTN_FAVCONTACTS 1096
+#define IDC_CHK_EXPAND 1097
+#define IDC_ED_EXPANDTIME 1098
+#define IDC_SPIN_EXPANDTIME 1099
+#define IDC_CLIST 1101
+#define IDC_BTN_OK 1102
+#define IDC_BTN_CANCEL 1103
+#define IDC_CHK_HIDEOFFLINE 1104
+#define IDC_CHK_APPENDPROTO 1105
+#define IDC_CHK_USEPROTOSMILEYS 1106
+#define IDC_CHK_ONLYISOLATED 1107
+#define IDC_CMB_PRESETITEMS 1111
+#define IDC_CHK_LIMITMSG 1113
+#define IDC_ED_CHARCOUNT 1114
+#define IDC_SPIN_CHARCOUNT 1115
+#define IDC_LB_SKINS 1116
+#define IDC_PIC_PREVIEW 1117
+#define IDC_ST_PREVIEW 1119
+#define IDC_CHK_LOADFONTS 1120
+#define IDC_CHK_ENABLECOLORING 1121
+#define IDC_CHK_LOADPROPORTIONS 1122
+#define IDC_BTN_RELOADLIST 1123
+#define IDC_BTN_APPLYSKIN 1124
+#define IDC_BTN_VARIABLE 1125
+#define IDC_BTN_GETSKINS 1125
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 118
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1127
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/plugins/TipperYM/resource.rc b/plugins/TipperYM/resource.rc new file mode 100644 index 0000000000..d289b911ba --- /dev/null +++ b/plugins/TipperYM/resource.rc @@ -0,0 +1,386 @@ +// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Czech (Czech Republic) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CSY)
+LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
+#pragma code_page(1250)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_OPT_APPEARANCE DIALOGEX 0, 0, 300, 230
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ EDITTEXT IDC_ED_WIDTH,249,17,36,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_WIDTH,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,277,17,11,12
+ EDITTEXT IDC_ED_MAXHEIGHT,249,45,36,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_MAXHEIGHT,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,277,45,11,12
+ GROUPBOX "Options",IDC_STATIC,159,142,135,78
+ GROUPBOX "Layout",IDC_STATIC,5,6,150,165
+ EDITTEXT IDC_ED_AVSIZE,249,73,36,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_AVSIZE,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,277,73,11,12
+ COMBOBOX IDC_CMB_ICON,14,31,133,69,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_CMB_AV,14,45,133,76,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDC_ED_INDENT,117,65,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_INDENT,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,65,11,12
+ RTEXT "Text indent:",IDC_STATIC,9,68,104,8
+ GROUPBOX "Window",IDC_STATIC,159,6,135,133
+ RTEXT "Max width:",IDC_STATIC,165,20,80,8,0,WS_EX_RIGHT
+ RTEXT "Max height:",IDC_STATIC,165,48,80,8,0,WS_EX_RIGHT
+ RTEXT "Avatar size:",IDC_STATIC_AVATARSIZE,165,76,80,8,0,WS_EX_RIGHT
+ CONTROL "Show if list not focused",IDC_CHK_NOFOCUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,166,122,125,11
+ EDITTEXT IDC_ED_PADDING,117,107,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_PADDING,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,107,11,12
+ RTEXT "General padding:",IDC_STATIC,9,110,104,8
+ EDITTEXT IDC_ED_HOVER,249,101,36,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_HOVER,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,277,101,11,12
+ RTEXT "Hover time:",IDC_STATIC,165,104,80,8,0,WS_EX_RIGHT
+ COMBOBOX IDC_CMB_POS,14,17,133,69,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Status bar tips",IDC_CHK_SBAR,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,166,153,125,11
+ GROUPBOX "Alignment",IDC_STATIC,5,175,150,45
+ COMBOBOX IDC_CMB_LV,57,186,43,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_CMB_VV,57,202,43,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_CMB_LH,104,186,43,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_CMB_VH,104,202,43,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ RTEXT "Labels:",IDC_STATIC,10,188,44,8
+ RTEXT "Values:",IDC_STATIC,10,204,44,8
+ EDITTEXT IDC_ED_MINWIDTH,249,31,36,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_MINWIDTH,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,277,31,11,12
+ RTEXT "Min width:",IDC_STATIC,165,34,80,8,0,WS_EX_RIGHT
+ EDITTEXT IDC_ED_MINHEIGHT,249,59,36,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_MINHEIGHT,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,277,59,11,12
+ RTEXT "Min height:",IDC_STATIC,165,62,80,8,0,WS_EX_RIGHT
+ EDITTEXT IDC_ED_SBWIDTH,249,87,36,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_SBWIDTH,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,277,87,11,12
+ RTEXT "Sidebar width:",IDC_STATIC,165,90,80,8
+ EDITTEXT IDC_ED_TEXTPADDING,117,121,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_TEXTPADDING,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,121,11,12
+ RTEXT "Text padding:",IDC_STATIC,9,124,104,8
+ EDITTEXT IDC_ED_OUTAVPADDING,117,135,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_OUTAVPADDING,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,135,11,12
+ RTEXT "Outer avatar padding:",IDC_STATIC,9,138,104,8
+ CONTROL "Round corners (avatar)",IDC_CHK_ROUNDCORNERSAV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,166,187,125,11
+ CONTROL "Keep original avatar size",IDC_CHK_ORIGINALAVSIZE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,166,204,125,11
+ CONTROL "Avatar border",IDC_CHK_AVBORDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,166,170,125,11
+ EDITTEXT IDC_ED_TITLEINDENT,117,79,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_TITLEINDENT,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,79,11,12
+ RTEXT "Title indent:",IDC_STATIC,9,82,104,8
+ EDITTEXT IDC_ED_VALUEINDENT,117,94,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_VALUEINDENT,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,94,11,12
+ RTEXT "Value indent:",IDC_STATIC,9,97,104,8
+ EDITTEXT IDC_ED_INAVPADDING,117,150,30,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_INAVPADDING,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,135,150,11,12
+ RTEXT "Inner avatar padding:",IDC_STATIC,9,153,104,8
+END
+
+IDD_SUBST DIALOGEX 0, 0, 225, 196
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Substitution"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ LTEXT "Label:",IDC_STATIC,14,10,198,8
+ EDITTEXT IDC_ED_LABEL,13,23,198,13,ES_AUTOHSCROLL
+ CONTROL "Contact protocol module",IDC_CHK_PROTOMOD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,74,198,10
+ LTEXT "Module:",IDC_STATIC,14,47,198,8
+ EDITTEXT IDC_ED_MODULE,13,58,198,13,ES_AUTOHSCROLL
+ LTEXT "Setting or prefix:",IDC_STATIC,14,90,198,8
+ EDITTEXT IDC_ED_SETTING,13,103,198,13,ES_AUTOHSCROLL
+ LTEXT "Translation:",IDC_STATIC,14,131,198,8
+ COMBOBOX IDC_CMB_TRANSLATE,13,144,198,104,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "OK",IDOK,59,172,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,117,172,50,14
+END
+
+IDD_ITEM DIALOGEX 0, 0, 225, 207
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Item"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ LTEXT "Label:",IDC_STATIC,14,10,195,8
+ LTEXT "Value:",IDC_STATIC,14,47,198,8
+ EDITTEXT IDC_ED_LABEL,13,23,198,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_ED_VALUE,13,58,198,45,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
+ CONTROL "Draw a line above",IDC_CHK_LINEABOVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,110,173,10
+ CONTROL "Value on a new line",IDC_CHK_VALNEWLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,122,198,10
+ DEFPUSHBUTTON "OK",IDOK,58,185,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,116,185,50,14
+ COMBOBOX IDC_CMB_PRESETITEMS,13,161,198,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Preset items:",IDC_STATIC,14,151,198,8
+ CONTROL "Variables",IDC_BTN_VARIABLE,"MButtonClass",WS_TABSTOP,194,108,16,14
+ CONTROL "Parse Tipper variables first",IDC_CHK_PARSETIPPERFIRST,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,134,198,10
+END
+
+IDD_OPT_CONTENT DIALOGEX 0, 0, 300, 230
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_SYSMENU
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ GROUPBOX "Items",IDC_STATIC,5,4,142,216
+ GROUPBOX "Substitutions",IDC_STATIC,151,4,142,216
+ LISTBOX IDC_LST_SUBST,158,17,128,180,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Add",IDC_BTN_ADD,"MButtonClass",WS_TABSTOP,12,201,16,14
+ CONTROL "Remove",IDC_BTN_REMOVE,"MButtonClass",WS_TABSTOP,60,201,16,14
+ CONTROL "Up",IDC_BTN_UP,"MButtonClass",WS_TABSTOP,108,201,16,14
+ CONTROL "Down",IDC_BTN_DOWN,"MButtonClass",WS_TABSTOP,124,201,16,14
+ CONTROL "Edit",IDC_BTN_EDIT,"MButtonClass",WS_TABSTOP,44,201,16,14
+ CONTROL "Add",IDC_BTN_ADD2,"MButtonClass",WS_TABSTOP,158,201,16,14
+ CONTROL "Remove",IDC_BTN_REMOVE2,"MButtonClass",WS_TABSTOP,173,201,16,14
+ CONTROL "Edit",IDC_BTN_EDIT2,"MButtonClass",WS_TABSTOP,189,201,16,14
+ CONTROL "",IDC_TREE_FIRST_ITEMS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | TVS_NOHSCROLL | WS_BORDER | WS_TABSTOP,12,17,128,180
+ CONTROL "Separator",IDC_BTN_SEPARATOR,"MButtonClass",WS_TABSTOP,28,201,16,14
+END
+
+IDD_OPT_EXTRA DIALOGEX 0, 0, 300, 230
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ GROUPBOX "Advanced options",IDC_STATIC,7,96,284,74
+ CONTROL "Retrieve XStatus details if auto-retrieve is disabled",IDC_CHK_RETRIEVEXSTATUS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,153,273,10
+ CONTROL "",IDC_TREE_EXTRAICONS,"SysTreeView32",TVS_NOTOOLTIPS | TVS_NOSCROLL | TVS_FULLROWSELECT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,15,18,98,66
+ GROUPBOX "Extra icons",IDC_STATIC,7,7,114,84
+ GROUPBOX "Smileys support",IDC_STATIC,127,7,164,84
+ CONTROL "Enable SmileyAdd support",IDC_CHK_ENABLESMILEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,134,18,154,10
+ CONTROL "Resize smileys",IDC_CHK_RESIZESMILEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,134,54,154,10
+ CONTROL "Use protocol smileys",IDC_CHK_USEPROTOSMILEYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,134,36,154,10
+ CONTROL "Replace only isolated smileys",IDC_CHK_ONLYISOLATED,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,134,72,154,10
+ CONTROL "Retrieve new status message",IDC_CHK_GETSTATUSMSG,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,123,273,10
+ CONTROL "Show tooltip after all content is ready (avatar && status message)",IDC_CHK_WAITFORCONTENT,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,108,273,10
+ GROUPBOX "Status bar and tray tooltip",IDC_STATIC,7,176,284,46
+ CONTROL "Limit status messages in status bar and tray tooltips to:",IDC_CHK_LIMITMSG,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,189,273,10
+ EDITTEXT IDC_ED_CHARCOUNT,26,203,36,12,ES_AUTOHSCROLL
+ CONTROL "",IDC_SPIN_CHARCOUNT,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,52,200,11,14
+ LTEXT "characters",IDC_STATIC,69,205,218,8
+ CONTROL "Disable in invisible status",IDC_CHK_DISABLEINVISIBLE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,27,138,258,10
+END
+
+IDD_OPT_SKIN DIALOGEX 0, 0, 300, 230
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ GROUPBOX "Skins",IDC_STATIC,5,4,289,125
+ EDITTEXT IDC_ED_TRANS,252,193,33,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_TRANS,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,277,193,11,12
+ RTEXT "Opacity(%):",IDC_STATIC,157,196,90,8,0,WS_EX_RIGHT
+ GROUPBOX "Transparency",IDC_STATIC,152,185,142,39
+ GROUPBOX "Effects",IDC_STATIC,7,133,140,91
+ CONTROL "Border",IDC_CHK_BORDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,194,126,9,WS_EX_RIGHT
+ CONTROL "Shadow",IDC_CHK_SHADOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,181,126,9,WS_EX_RIGHT
+ CONTROL "Round corners (window)",IDC_CHK_ROUNDCORNERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,207,126,9,WS_EX_RIGHT
+ COMBOBOX IDC_CMB_EFFECT,16,145,122,69,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Aero Glass (Vista+)",IDC_CHK_AEROGLASS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,155,211,129,9,WS_EX_RIGHT
+ RTEXT "Animation speed:",IDC_STATIC,11,164,90,8,0,WS_EX_RIGHT
+ EDITTEXT IDC_ED_SPEED,105,162,33,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_SPEED,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,128,162,11,12
+ LISTBOX IDC_LB_SKINS,16,16,87,91,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Preview",IDC_STATIC,112,12,174,110
+ CONTROL "",IDC_PIC_PREVIEW,"Static",SS_OWNERDRAW,119,24,159,92
+ CTEXT "No preview",IDC_ST_PREVIEW,172,63,56,8
+ GROUPBOX "Skin option",IDC_STATIC,152,133,142,49
+ CONTROL "Load fonts and colors",IDC_CHK_LOADFONTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,168,130,10
+ CONTROL "Enable skin coloring",IDC_CHK_ENABLECOLORING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,144,130,10
+ CONTROL "Reload skin list",IDC_BTN_RELOADLIST,"MButtonClass",WS_TABSTOP,34,111,16,14
+ CONTROL "Apply skin",IDC_BTN_APPLYSKIN,"MButtonClass",WS_TABSTOP,16,111,16,14
+ CONTROL "Load tooltip proportions",IDC_CHK_LOADPROPORTIONS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,159,156,130,10
+ CONTROL "Get more skins",IDC_BTN_GETSKINS,"MButtonClass",WS_TABSTOP,87,111,16,14
+END
+
+IDD_OPT_TRAYTIP DIALOGEX 0, 0, 300, 230
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CONTROL "",IDC_TREE_FIRST_PROTOS,"SysTreeView32",TVS_NOTOOLTIPS | TVS_NOHSCROLL | WS_BORDER | WS_TABSTOP,17,66,120,60
+ CONTROL "Enable tray tooltips",IDC_CHK_ENABLETRAYTIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,14,142,10
+ CONTROL "Handle tray tooltips by Tipper",IDC_CHK_HANDLEBYTIPPER,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,25,142,10
+ CONTROL "",IDC_TREE_SECOND_ITEMS,"SysTreeView32",TVS_NOTOOLTIPS | TVS_NOHSCROLL | WS_BORDER | WS_TABSTOP,161,133,120,72
+ PUSHBUTTON "Favourite contacts",IDC_BTN_FAVCONTACTS,93,218,113,12
+ CONTROL "Expand to second level after:",IDC_CHK_EXPAND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,162,14,128,10
+ EDITTEXT IDC_ED_EXPANDTIME,171,29,37,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
+ CONTROL "",IDC_SPIN_EXPANDTIME,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,198,28,11,12
+ LTEXT "ms",IDC_STATIC,214,31,53,8
+ CONTROL "",IDC_TREE_SECOND_PROTOS,"SysTreeView32",TVS_NOTOOLTIPS | TVS_NOHSCROLL | WS_BORDER | WS_TABSTOP,161,66,120,60
+ CONTROL "",IDC_TREE_FIRST_ITEMS,"SysTreeView32",TVS_NOTOOLTIPS | TVS_NOHSCROLL | WS_BORDER | WS_TABSTOP,17,133,120,72
+ GROUPBOX "Options",IDC_STATIC,7,3,285,47
+ GROUPBOX "First level tooltip",IDC_STATIC,7,52,140,161
+ GROUPBOX "Second level tooltip",IDC_STATIC,152,52,140,161
+ CONTROL "Hide offline protocols",IDC_CHK_HIDEOFFLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,36,142,10
+END
+
+IDD_FAVCONTACTS DIALOGEX 0, 0, 140, 213
+STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Favourite contacts"
+FONT 8, "Tahoma", 400, 0, 0xEE
+BEGIN
+ DEFPUSHBUTTON "OK",IDC_BTN_OK,74,192,50,14
+ PUSHBUTTON "Cancel",IDC_BTN_CANCEL,15,192,50,14
+ CONTROL "",IDC_CLIST,"CListControl",WS_TABSTOP | 0x68,5,7,128,152,WS_EX_CLIENTEDGE
+ CONTROL "Hide offline",IDC_CHK_HIDEOFFLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,164,124,10
+ CONTROL "Append protocol name",IDC_CHK_APPENDPROTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,176,124,10
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_OPT_APPEARANCE, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 293
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 223
+ END
+
+ IDD_SUBST, DIALOG
+ BEGIN
+ LEFTMARGIN, 13
+ RIGHTMARGIN, 212
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 189
+ END
+
+ IDD_ITEM, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 218
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 200
+ END
+
+ IDD_OPT_CONTENT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 293
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 223
+ END
+
+ IDD_OPT_EXTRA, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 293
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 223
+ END
+
+ IDD_OPT_SKIN, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 293
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 223
+ END
+
+ IDD_OPT_TRAYTIP, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 293
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 223
+ END
+
+ IDD_FAVCONTACTS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 133
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 206
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_ITEM ICON "res\\copy_item.ico"
+IDI_ITEM_ALL ICON "res\\copy_all_items.ico"
+IDI_UP ICON "res\\arrow_up.ico"
+IDI_DOWN ICON "res\\arrow_down.ico"
+IDI_SEPARATOR ICON "res\\separator.ico"
+IDI_RELOAD ICON "res\\reload.ico"
+IDI_APPLY ICON "res\\apply.ico"
+#endif // Czech (Czech Republic) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (United States) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // English (United States) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/TipperYM/sdk/m_fingerprint.h b/plugins/TipperYM/sdk/m_fingerprint.h new file mode 100644 index 0000000000..0101166e57 --- /dev/null +++ b/plugins/TipperYM/sdk/m_fingerprint.h @@ -0,0 +1,50 @@ +/*
+Based on Miranda plugin template, originally by Richard Hughes
+http://miranda-icq.sourceforge.net/
+
+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.
+*/
+
+/************************************************************************/
+/* Author: Artem Shpynov aka FYR mailto:shpynov@nm.ru */
+/* icons by Angeli-Ka */
+/* January 12, 2006 */
+/************************************************************************/
+
+
+/*
+ * FINGERPRINT PLUGIN SERVICES HEADER
+ */
+
+/*
+ * Service SameClients MS_FP_SAMECLIENTS
+ * wParam - char * first MirVer value
+ * lParam - char * second MirVer value
+ * return pointer to char string - client desription (DO NOT DESTROY) if clients are same otherwise NULL
+ */
+#define MS_FP_SAMECLIENTS "Fingerprint/SameClients"
+
+/*
+ * ServiceGetClientIcon MS_FP_GETCLIENTICON
+ * wParam - char * MirVer value to get client for.
+ * lParam - int noCopy - if wParam is equal to "1" will return icon handler without copiing icon.
+ */
+#define MS_FP_GETCLIENTICON "Fingerprint/GetClientIcon"
diff --git a/plugins/TipperYM/sdk/m_flags.h b/plugins/TipperYM/sdk/m_flags.h new file mode 100644 index 0000000000..aafa2fb251 --- /dev/null +++ b/plugins/TipperYM/sdk/m_flags.h @@ -0,0 +1,102 @@ +/*
+Miranda IM Country Flags Plugin
+Copyright (C) 2006-2007 H. Herkenrath
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program (Flags-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_FLAGS_H__
+#define M_FLAGS_H__
+
+#if defined (_MSC_VER) && (_MSC_VER >= 1020)
+ #pragma once
+#endif
+
+/*
+ Country Flags Plugin v0.1.0.3
+*/
+
+/* interface id */
+#if !defined(MIID_FLAGS)
+ #define MIID_FLAGS {0x88a3b66e,0xc438,0x4381,{0xbc,0x17,0x71,0xd9,0x9d,0x22,0x5f,0x9c}}
+#endif
+
+/* Load a country flag icon from the skin library. v0.1.0.0+
+The retrieved icon should be released using MS_SKIN2_RELEASEICON after use.
+The country numbers can be retrieved using MS_UTILS_GETCOUNTRYLIST.
+Another way to get the country numbers are the CTRY_* constants in winnls.h of WinAPI.
+To retrieve the country number from a locale, call GetLocaleInfo().
+with LOCALE_ICOUNTRY.
+ wParam=countryNumber
+ lParam=(BOOL)fReturnHandle (nonzero to to retrieve the icolib handle instead of the icon)
+Returns a icon handle (HICON) on success, NULL on error.
+*/
+#define MS_FLAGS_LOADFLAGICON "Flags/LoadFlagIcon"
+
+#if !defined(FLAGS_NOHELPERFUNCTIONS)
+__inline static HICON LoadFlagIcon(int countryNumber) {
+ if(!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
+ return (HICON)CallService(MS_FLAGS_LOADFLAGICON,countryNumber,0);
+}
+__inline static HANDLE LoadFlagIconHandle(int countryNumber) {
+ if(!ServiceExists(MS_FLAGS_LOADFLAGICON)) return NULL;
+ return (HICON)CallService(MS_FLAGS_LOADFLAGICON,countryNumber,1);
+}
+#endif
+
+#define CTRY_UNSPECIFIED 0
+#define CTRY_OTHER 9999
+#define CTRY_UNKNOWN 0xFFFF
+
+/* Create a merged country flag icon. v0.1.0.0+
+The retrieved icon should be released using DestroyIcon() after use.
+ wParam=countryNumberUpper
+ lParam=countryNumberLower
+Returns a icon handle (HICON) on success, NULL on error.
+*/
+#define MS_FLAGS_CREATEMERGEDFLAGICON "Flags/CreateMergedFlagIcon"
+
+/* Get a corresponding country given an (external) IP address. v0.1.0.0+
+The retrieved number can be converted to a normal country name
+using MS_UTILS_GETCOUNTRYBYNUMBER.
+ wParam=dwExternalIP (same format as used in Netlib)
+ lParam=0
+Returns a country number on success,
+or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
+*/
+#define MS_FLAGS_IPTOCOUNTRY "Flags/IpToCountry"
+
+/* Detect the origin country of a contact. v0.1.0.0+
+This uses the contacts's IP first, and falls back on using
+CNF_COUNTRY and CNF_COCOUNTRY of contact details.
+To get the contact's IP it relies on the db setting
+"RealIP" in the proto module.
+ wParam=(WPARAM)(HANDLE)hContact
+ lParam=0
+Returns a country number on success,
+or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
+*/
+#define MS_FLAGS_DETECTCONTACTORIGINCOUNTRY "Flags/DetectContactOriginCountry"
+#define MS_FLAGS_GETCONTACTORIGINCOUNTRY "Flags/GetContactOriginCountry" //for beta version 0.1.1.0
+
+#if !defined(FLAGS_NOSETTINGS) && defined(EXTRA_ICON_ADV2)
+#define SETTING_SHOWSTATUSICONFLAG_DEFAULT 1
+#define SETTING_SHOWEXTRAIMGFLAG_DEFAULT 1
+#define SETTING_EXTRAIMGFLAGCOLUMN_DEFAULT EXTRA_ICON_ADV2
+#define SETTING_USEUNKNOWNFLAG_DEFAULT 1
+#define SETTING_USEIPTOCOUNTRY_DEFAULT 1
+#endif
+
+#endif // M_FLAGS_H
diff --git a/plugins/TipperYM/sdk/m_folders.h b/plugins/TipperYM/sdk/m_folders.h new file mode 100644 index 0000000000..5971cff81a --- /dev/null +++ b/plugins/TipperYM/sdk/m_folders.h @@ -0,0 +1,284 @@ +/*
+Custom profile folders plugin for Miranda IM
+
+Copyright © 2005 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_CUSTOM_FOLDERS_H
+#define M_CUSTOM_FOLDERS_H
+
+#define FOLDERS_API 501 //dunno why it's here but it is :)
+
+#define PROFILE_PATH "%profile_path%"
+#define CURRENT_PROFILE "%current_profile%"
+#define MIRANDA_PATH "%miranda_path%"
+#define PLUGINS_PATH "%miranda_path%" "\\plugins"
+#define MIRANDA_USERDATA "%miranda_userdata%"
+
+#define TO_WIDE(x) L ## x
+
+#define PROFILE_PATHW L"%profile_path%"
+#define CURRENT_PROFILEW L"%current_profile%"
+#define MIRANDA_PATHW L"%miranda_path%"
+#define MIRANDA_USERDATAW L"%miranda_userdata%"
+
+#define FOLDER_AVATARS PROFILE_PATH "\\" CURRENT_PROFILE "\\avatars"
+#define FOLDER_VCARDS PROFILE_PATH "\\" CURRENT_PROFILE "\\vcards"
+#define FOLDER_LOGS PROFILE_PATH "\\" CURRENT_PROFILE "\\logs"
+#define FOLDER_RECEIVED_FILES PROFILE_PATH "\\" CURRENT_PROFILE "\\received files"
+#define FOLDER_DOCS MIRANDA_PATH "\\" "docs"
+
+#define FOLDER_CONFIG PLUGINS_PATH "\\" "config"
+
+#define FOLDER_SCRIPTS MIRANDA_PATH "\\" "scripts"
+
+#define FOLDER_UPDATES MIRANDA_PATH "\\" "updates"
+
+#define FOLDER_CUSTOMIZE MIRANDA_PATH "\\" "customize"
+#define FOLDER_CUSTOMIZE_SOUNDS FOLDER_CUSTOMIZE "\\sounds"
+#define FOLDER_CUSTOMIZE_ICONS FOLDER_CUSTOMIZE "\\icons"
+#define FOLDER_CUSTOMIZE_SMILEYS FOLDER_CUSTOMIZE "\\smileys"
+#define FOLDER_CUSTOMIZE_SKINS FOLDER_CUSTOMIZE "\\skins"
+#define FOLDER_CUSTOMIZE_THEMES FOLDER_CUSTOMIZE "\\themes"
+
+
+#define FOLDERS_NAME_MAX_SIZE 64 //maximum name and section size
+
+#define FF_UNICODE 0x00000001
+
+#if defined (UNICODE)
+ #define FF_TCHAR FF_UNICODE
+#else
+ #define FF_TCHAR 0
+#endif
+
+typedef struct{
+ int cbSize; //size of struct
+ char szSection[FOLDERS_NAME_MAX_SIZE]; //section name, if it doesn't exist it will be created otherwise it will just add this entry to it
+ char szName[FOLDERS_NAME_MAX_SIZE]; //entry name - will be shown in options
+ union{
+ const char *szFormat; //default string format. Fallback string in case there's no entry in the database for this folder. This should be the initial value for the path, users will be able to change it later.
+ const wchar_t *szFormatW; //String is dup()'d so you can free it later. If you set the unicode string don't forget to set the flag accordingly.
+ const TCHAR *szFormatT;
+ };
+ DWORD flags; //FF_* flags
+} FOLDERSDATA;
+
+/*Folders/Register/Path service
+ wParam - not used, must be 0
+ lParam - (LPARAM) (const FOLDERDATA *) - Data structure filled with
+ the necessary information.
+ Returns a handle to the registered path or 0 on error.
+ You need to use this to call the other services.
+*/
+#define MS_FOLDERS_REGISTER_PATH "Folders/Register/Path"
+
+/*Folders/Get/PathSize service
+ wParam - (WPARAM) (int) - handle to registered path
+ lParam - (LPARAM) (int *) - pointer to the variable that receives the size of the path
+ string (not including the null character). Depending on the flags set when creating the path
+ it will either call strlen() or wcslen() to get the length of the string.
+ Returns the size of the buffer.
+*/
+#define MS_FOLDERS_GET_SIZE "Folders/Get/PathSize"
+
+typedef struct{
+ int cbSize;
+ int nMaxPathSize; //maximum size of buffer. This represents the number of characters that can be copied to it (so for unicode strings you don't send the number of bytes but the length of the string).
+ union{
+ char *szPath; //pointer to the buffer that receives the path without the last "\\"
+ wchar_t *szPathW; //unicode version of the buffer.
+ TCHAR *szPathT;
+ };
+} FOLDERSGETDATA;
+
+/*Folders/Get/Path service
+ wParam - (WPARAM) (int) - handle to registered path
+ lParam - (LPARAM) (FOLDERSGETDATA *) pointer to a FOLDERSGETDATA that has all the relevant fields filled.
+ Should return 0 on success, or nonzero otherwise.
+*/
+#define MS_FOLDERS_GET_PATH "Folders/Get/Path"
+
+typedef struct{
+ int cbSize;
+ union{
+ char **szPath; //address of a string variable (char *) or (wchar_t*) where the path should be stored (the last \ won't be copied).
+ wchar_t **szPathW; //unicode version of string.
+ TCHAR **szPathT;
+ };
+} FOLDERSGETALLOCDATA;
+
+/*Folders/GetRelativePath/Alloc service
+ wParam - (WPARAM) (int) - Handle to registered path
+ lParam - (LPARAM) (FOLDERSALLOCDATA *) data
+ This service is the same as MS_FOLDERS_GET_PATH with the difference that this service
+ allocates the needed space for the buffer. It uses miranda's memory functions for that and you need
+ to use those to free the resulting buffer.
+ Should return 0 on success, or nonzero otherwise. Currently it only returns 0.
+*/
+#define MS_FOLDERS_GET_PATH_ALLOC "Folders/Get/Path/Alloc"
+
+
+/*Folders/On/Path/Changed
+ wParam - (WPARAM) 0
+ lParam - (LPARAM) 0
+ Triggered when the folders change, you should reget the paths you registered.
+*/
+#define ME_FOLDERS_PATH_CHANGED "Folders/On/Path/Changed"
+
+#ifndef FOLDERS_NO_HELPER_FUNCTIONS
+
+#ifndef M_UTILS_H__
+#error The helper functions require that m_utils.h be included in the project. Please include that file if you want to use the helper functions. If you don''t want to use the functions just define FOLDERS_NO_HELPER_FUNCTIONS.
+#endif
+//#include "../../../include/newpluginapi.h"
+
+__inline static HANDLE FoldersRegisterCustomPath(const char *section, const char *name, const char *defaultPath)
+{
+ FOLDERSDATA fd = {0};
+ if (!ServiceExists(MS_FOLDERS_REGISTER_PATH)) return 0;
+ fd.cbSize = sizeof(FOLDERSDATA);
+ strncpy(fd.szSection, section, FOLDERS_NAME_MAX_SIZE);
+ fd.szSection[FOLDERS_NAME_MAX_SIZE - 1] = '\0';
+ strncpy(fd.szName, name, FOLDERS_NAME_MAX_SIZE);
+ fd.szName[FOLDERS_NAME_MAX_SIZE - 1] = '\0';
+ fd.szFormat = defaultPath;
+ return (HANDLE) CallService(MS_FOLDERS_REGISTER_PATH, 0, (LPARAM) &fd);
+}
+
+__inline static HANDLE FoldersRegisterCustomPathW(const char *section, const char *name, const wchar_t *defaultPathW)
+{
+ FOLDERSDATA fd = {0};
+ if (!ServiceExists(MS_FOLDERS_REGISTER_PATH)) return 0;
+ fd.cbSize = sizeof(FOLDERSDATA);
+ strncpy(fd.szSection, section, FOLDERS_NAME_MAX_SIZE);
+ fd.szSection[FOLDERS_NAME_MAX_SIZE - 1] = '\0'; //make sure it's NULL terminated
+ strncpy(fd.szName, name, FOLDERS_NAME_MAX_SIZE);
+ fd.szName[FOLDERS_NAME_MAX_SIZE - 1] = '\0'; //make sure it's NULL terminated
+ fd.szFormatW = defaultPathW;
+ fd.flags = FF_UNICODE;
+ return (HANDLE) CallService(MS_FOLDERS_REGISTER_PATH, 0, (LPARAM) &fd);
+}
+
+__inline static INT_PTR FoldersGetCustomPath(HANDLE hFolderEntry, char *path, const int size, const char *notFound)
+{
+ FOLDERSGETDATA fgd = {0};
+ INT_PTR res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = size;
+ fgd.szPath = path;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ char buffer[MAX_PATH];
+ CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) notFound, (LPARAM) buffer);
+ mir_snprintf(path, size, "%s", buffer);
+ }
+
+ return res;
+}
+
+__inline static INT_PTR FoldersGetCustomPathW(HANDLE hFolderEntry, wchar_t *pathW, const int count, const wchar_t *notFoundW)
+{
+ FOLDERSGETDATA fgd = {0};
+ INT_PTR res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = count;
+ fgd.szPathW = pathW;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ wcsncpy(pathW, notFoundW, count);
+ pathW[count - 1] = '\0';
+ }
+
+ return res;
+}
+
+__inline static INT_PTR FoldersGetCustomPathEx(HANDLE hFolderEntry, char *path, const int size, char *notFound, char *fileName)
+{
+ FOLDERSGETDATA fgd = {0};
+ INT_PTR res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = size;
+ fgd.szPath = path;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ char buffer[MAX_PATH];
+ CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) notFound, (LPARAM) buffer);
+ mir_snprintf(path, size, "%s", buffer);
+ }
+ if (strlen(path) > 0)
+ {
+ strcat(path, "\\");
+ }
+ else{
+ path[0] = '\0';
+ }
+
+ if (fileName)
+ {
+ strcat(path, fileName);
+ }
+
+ return res;
+}
+
+__inline static INT_PTR FoldersGetCustomPathExW(HANDLE hFolderEntry, wchar_t *pathW, const int count, wchar_t *notFoundW, wchar_t *fileNameW)
+{
+ FOLDERSGETDATA fgd = {0};
+ INT_PTR res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = count;
+ fgd.szPathW = pathW;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ wcsncpy(pathW, notFoundW, count);
+ pathW[count - 1] = '\0';
+ }
+
+ if (wcslen(pathW) > 0)
+ {
+ wcscat(pathW, L"\\");
+ }
+ else{
+ pathW[0] = L'\0';
+ }
+
+ if (fileNameW)
+ {
+ wcscat(pathW, fileNameW);
+ }
+
+ return res;
+}
+
+# ifdef _UNICODE
+# define FoldersGetCustomPathT FoldersGetCustomPathW
+# define FoldersGetCustomPathExT FoldersGetCustomPathExW
+# define FoldersRegisterCustomPathT FoldersRegisterCustomPathW
+#else
+# define FoldersGetCustomPathT FoldersGetCustomPath
+# define FoldersGetCustomPathExT FoldersGetCustomPath
+# define FoldersRegisterCustomPathT FoldersRegisterCustomPath
+#endif
+
+#endif
+
+#endif //M_CUSTOM_FOLDERS_H
\ No newline at end of file diff --git a/plugins/TipperYM/sdk/m_gender.h b/plugins/TipperYM/sdk/m_gender.h new file mode 100644 index 0000000000..65447b8092 --- /dev/null +++ b/plugins/TipperYM/sdk/m_gender.h @@ -0,0 +1,30 @@ +/*
+ Show Contact Gender plugin for Miranda-IM (www.miranda-im.org)
+ (c) 2006-2011 by Thief
+
+ 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
+
+ File name : $URL: http://svn.miranda.im/mainrepo/gender/trunk/m_gender.h $
+ Revision : $Rev: 957 $
+ Last change on : $Date: 2007-10-19 13:46:08 +0300 (??, 19 ??? 2007) $
+ Last change by : $Author: Thief $
+
+*/
+
+// Returns gender icon for specific contact
+// wParam = hContact
+// lParam = 0
+// return = HICON
+#define MS_GENDER_GETICON "Gender/GenderGetIcon"
diff --git a/plugins/TipperYM/sdk/m_metacontacts.h b/plugins/TipperYM/sdk/m_metacontacts.h new file mode 100644 index 0000000000..9f348bd2c6 --- /dev/null +++ b/plugins/TipperYM/sdk/m_metacontacts.h @@ -0,0 +1,166 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright © 2004 Universite Louis PASTEUR, STRASBOURG.
+Copyright © 2004 Scott Ellis (www.scottellis.com.au mail@scottellis.com.au)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_METACONTACTS_H__
+#define M_METACONTACTS_H__ 1
+
+#ifndef MIID_METACONTACTS
+#define MIID_METACONTACTS {0xc0325019, 0xc1a7, 0x40f5, { 0x83, 0x65, 0x4f, 0x46, 0xbe, 0x21, 0x86, 0x3e}}
+#endif
+
+//get the handle for a contact's parent metacontact
+//wParam=(HANDLE)hSubContact
+//lParam=0
+//returns a handle to the parent metacontact, or null if this contact is not a subcontact
+#define MS_MC_GETMETACONTACT "MetaContacts/GetMeta"
+
+//gets the handle for the default contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a handle to the default contact, or null on failure
+#define MS_MC_GETDEFAULTCONTACT "MetaContacts/GetDefault"
+
+//gets the contact number for the default contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a DWORD contact number, or -1 on failure
+#define MS_MC_GETDEFAULTCONTACTNUM "MetaContacts/GetDefaultNum"
+
+//gets the handle for the 'most online' contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a handle to the 'most online' contact
+#define MS_MC_GETMOSTONLINECONTACT "MetaContacts/GetMostOnline"
+
+//gets the number of subcontacts for a metacontact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a DWORD representing the number of subcontacts for the given metacontact
+#define MS_MC_GETNUMCONTACTS "MetaContacts/GetNumContacts"
+
+//gets the handle of a subcontact, using the subcontact's number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns a handle to the specified subcontact
+#define MS_MC_GETSUBCONTACT "MetaContacts/GetSubContact"
+
+//sets the default contact, using the subcontact's contact number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns 0 on success
+#define MS_MC_SETDEFAULTCONTACTNUM "MetaContacts/SetDefault"
+
+//sets the default contact, using the subcontact's handle
+//wParam=(HANDLE)hMetaContact
+//lParam=(HANDLE)hSubcontact
+//returns 0 on success
+#define MS_MC_SETDEFAULTCONTACT "MetaContacts/SetDefaultByHandle"
+
+//forces the metacontact to send using a specific subcontact, using the subcontact's contact number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns 0 on success
+#define MS_MC_FORCESENDCONTACTNUM "MetaContacts/ForceSendContact"
+
+//forces the metacontact to send using a specific subcontact, using the subcontact's handle
+//wParam=(HANDLE)hMetaContact
+//lParam=(HANDLE)hSubcontact
+//returns 0 on success (will fail if 'force default' is in effect)
+#define MS_MC_FORCESENDCONTACT "MetaContacts/ForceSendContactByHandle"
+
+//'unforces' the metacontact to send using a specific subcontact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns 0 on success (will fail if 'force default' is in effect)
+#define MS_MC_UNFORCESENDCONTACT "MetaContacts/UnforceSendContact"
+
+//'forces' or 'unforces' (i.e. toggles) the metacontact to send using it's default contact
+// overrides (and clears) 'force send' above, and will even force use of offline contacts
+// will send ME_MC_FORCESEND or ME_MC_UNFORCESEND event
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns 1(true) or 0(false) representing new state of 'force default'
+#define MS_MC_FORCEDEFAULT "MetaContacts/ForceSendDefault"
+
+// method to get state of 'force' for a metacontact
+// wParam=(HANDLE)hMetaContact
+// lParam= (DWORD)&contact_number or NULL
+//
+// if lparam supplied, the contact_number of the contatct 'in force' will be copied to the address it points to,
+// or if none is in force, the value (DWORD)-1 will be copied
+// (v0.8.0.8+ returns 1 if 'force default' is true with *lParam == default contact number, else returns 0 with *lParam as above)
+#define MS_MC_GETFORCESTATE "MetaContacts/GetForceState"
+
+// fired when a metacontact's default contact changes (fired upon creation of metacontact also, when default is initially set)
+// wParam=(HANDLE)hMetaContact
+// lParam=(HANDLE)hDefaultContact
+#define ME_MC_DEFAULTTCHANGED "MetaContacts/DefaultChanged"
+
+// fired when a metacontact's subcontacts change (fired upon creation of metacontact, when contacts are added or removed, and when
+// contacts are reordered) - a signal to re-read metacontact data
+// wParam=(HANDLE)hMetaContact
+// lParam=0
+#define ME_MC_SUBCONTACTSCHANGED "MetaContacts/SubcontactsChanged"
+
+// fired when a metacontact is forced to send using a specific subcontact
+// wParam=(HANDLE)hMetaContact
+// lParam=(HANDLE)hForceContact
+#define ME_MC_FORCESEND "MetaContacts/ForceSend"
+
+// fired when a metacontact is 'unforced' to send using a specific subcontact
+// wParam=(HANDLE)hMetaContact
+// lParam=0
+#define ME_MC_UNFORCESEND "MetaContacts/UnforceSend"
+
+// method to get protocol name - used to be sure you're dealing with a "real" metacontacts plugin :)
+// wParam=lParam=0
+#define MS_MC_GETPROTOCOLNAME "MetaContacts/GetProtoName"
+
+
+// added 0.9.5.0 (22/3/05)
+// wParam=(HANDLE)hContact
+// lParam=0
+// convert a given contact into a metacontact
+#define MS_MC_CONVERTTOMETA "MetaContacts/ConvertToMetacontact"
+
+// added 0.9.5.0 (22/3/05)
+// wParam=(HANDLE)hContact
+// lParam=(HANDLE)hMeta
+// add an existing contact to a metacontact
+#define MS_MC_ADDTOMETA "MetaContacts/AddToMetacontact"
+
+// added 0.9.5.0 (22/3/05)
+// wParam=0
+// lParam=(HANDLE)hContact
+// remove a contact from a metacontact
+#define MS_MC_REMOVEFROMMETA "MetaContacts/RemoveFromMetacontact"
+
+
+// added 0.9.13.2 (6/10/05)
+// wParam=(BOOL)disable
+// lParam=0
+// enable/disable the 'hidden group hack' - for clists that support subcontact hiding using 'IsSubcontact' setting
+// should be called once in the clist 'onmodulesloaded' event handler (which, since it's loaded after the db, will be called
+// before the metacontact onmodulesloaded handler where the subcontact hiding is usually done)
+#define MS_MC_DISABLEHIDDENGROUP "MetaContacts/DisableHiddenGroup"
+
+#endif
diff --git a/plugins/TipperYM/sdk/m_smileyadd.h b/plugins/TipperYM/sdk/m_smileyadd.h new file mode 100644 index 0000000000..acb14e9f44 --- /dev/null +++ b/plugins/TipperYM/sdk/m_smileyadd.h @@ -0,0 +1,252 @@ +/*
+Miranda SmileyAdd Plugin
+Copyright (C) 2005 - 2009 Boris Krasnovskiy
+Copyright (C) 2003 - 2004 Rein-Peter de Boer
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation version 2
+of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+#include <richedit.h>
+
+#define SAFLRE_INSERTEMF 2 // insert smiley as EMF into RichEdit, otherwise bitmap inserted
+ // this flag allows "true" transparency
+#define SAFLRE_OUTGOING 4 // Parsing outgoing message
+#define SAFLRE_NOCUSTOM 8 // Do not use custom smileys
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ HWND hwndRichEditControl; //handle to the rich edit control
+ CHARRANGE* rangeToReplace; //same meaning as for normal Richedit use (NULL = replaceall)
+ const char* Protocolname; //protocol to use... if you have defined a protocol, u can
+ //use your own protocol name. SmileyAdd will automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL, "Standard" will be used
+ unsigned flags; //Flags (SAFLRE_*) that define the behaivior
+ BOOL disableRedraw; //Parameter have been depricated, have no effect on operation
+ HANDLE hContact; //Contact handle
+} SMADD_RICHEDIT3;
+
+//Replace smileys in a rich edit control...
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_RICHEDIT3*) &smre; //pointer to SMADD_RICHEDIT3
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_REPLACESMILEYS "SmileyAdd/ReplaceSmileys"
+
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ char* Protocolname; //protocol to use... if you have defined a protocol, you can
+ //use your own protocol name. Smiley add will automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL: "Standard" will be used
+ int xPosition; //Postition to place the selectwindow
+ int yPosition; // "
+ int Direction; //Direction (i.e. size upwards/downwards/etc) of the window 0, 1, 2, 3
+
+ HWND hwndTarget; //Window, where to send the message when smiley is selected.
+ UINT targetMessage; //Target message, to be sent.
+ LPARAM targetWParam; //Target WParam to be sent (LParam will be char* to select smiley)
+ //see the example file.
+ HWND hwndParent; //Parent window for smiley dialog
+ HANDLE hContact; //Contact handle
+} SMADD_SHOWSEL3;
+
+//Show smiley selection window
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_SHOWSEL3*) &smre; //pointer to SMADD_SHOWSEL3
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_SHOWSELECTION "SmileyAdd/ShowSmileySelection"
+
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ char* Protocolname; // " "
+ HICON ButtonIcon; //RETURN VALUE: this is filled with the icon handle
+ //of the smiley that can be used on the button
+ //if used with GETINFO2 handle must be destroyed by user!
+ //NULL if the buttonicon is not defined...
+ int NumberOfVisibleSmileys; //Number of visible smileys defined.
+ int NumberOfSmileys; //Number of total smileys defined
+ HANDLE hContact; //Contact handle
+} SMADD_INFO2;
+
+//get button smiley icon
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_INFO2*) &smgi; //pointer to SMADD_INFO2
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_GETINFO2 "SmileyAdd/GetInfo2"
+
+// Event notifies that SmileyAdd options have changed
+// Message dialogs usually need to redraw it's content on reception of this event
+//wParam = Contact handle which options have changed, NULL if global options changed
+//lParam = (LPARAM) 0; not used
+#define ME_SMILEYADD_OPTIONSCHANGED "SmileyAdd/OptionsChanged"
+
+#define SAFL_PATH 1 // provide smiley file path, icon otherwise
+#define SAFL_UNICODE 2 // string fields in OPTIONSDIALOGPAGE are WCHAR*
+#define SAFL_OUTGOING 4 // Parsing outgoing message
+#define SAFL_NOCUSTOM 8 // Do not use custom smileys
+
+#if defined _UNICODE || defined UNICODE
+ #define SAFL_TCHAR SAFL_UNICODE
+#else
+ #define SAFL_TCHAR 0
+#endif
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ const char* Protocolname; //protocol to use... if you have defined a protocol, u can
+ //use your own protocol name. Smiley add wil automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL: "Standard" will be used
+ union {
+ TCHAR* str; //String to parse
+ char* astr;
+ wchar_t* wstr;
+ };
+ unsigned flag; //One of the SAFL_ flags specifies parsing requirements
+ //This parameter should be filled by the user
+
+ unsigned numSmileys; //Number of Smileys found, this parameter filled by SmileyAdd
+ unsigned oflag; //One of the SAFL_ flags specifies content of the parse results
+ //this parameter filled by SmileyAdd
+ HANDLE hContact; //Contact handle
+} SMADD_BATCHPARSE2;
+
+typedef struct
+{
+ unsigned startChar; //Starting smiley character
+ //Because of iterative nature of the API caller should set this
+ //parameter to correct value
+ unsigned size; //Number of characters in smiley (0 if not found)
+ //Because of iterative nature of the API caller should set this
+ //parameter to correct value
+ union {
+ const TCHAR* filepath;
+ const char* afilepath;
+ const wchar_t* wfilepath;
+ HICON hIcon; //User responsible for destroying icon handle
+ };
+} SMADD_BATCHPARSERES;
+
+//find all smileys in text, API parses the provided text and returns all smileys found
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_BATCHPARSE2*) &smgp; //pointer to SMADD_BATCHPARSE2
+//function returns pointer to array SMADD_BATCHPARSERES records for each smiley found
+//if no smileys found NULL is returned
+//if non NULL value returned pointer must be freed with MS_SMILEYADD_BATCHFREE API
+#define MS_SMILEYADD_BATCHPARSE "SmileyAdd/BatchParse"
+
+//Free memory allocated by MS_SMILEYADD_BATCHPARSE
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_BATCHPARSERES*) &smgp; //pointer to SMADD_BATCHPARSERES
+#define MS_SMILEYADD_BATCHFREE "SmileyAdd/BatchFree"
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ char* name; //smiley category name for reference
+ char* dispname; //smiley category name for display
+} SMADD_REGCAT;
+
+//Register smiley category
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_REGCAT*) &smgp; pointer to SMADD_REGCAT
+#define MS_SMILEYADD_REGISTERCATEGORY "SmileyAdd/RegisterCategory"
+
+//Register smiley category
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) Pointer to protocol name or NULL for all;
+#define MS_SMILEYADD_RELOAD "SmileyAdd/Reload"
+
+#ifndef MIID_SMILEY
+// {E03C71B2-6DEE-467e-A4F0-DD516745876A}
+#define MIID_SMILEY { 0xe03c71b2, 0x6dee, 0x467e, { 0xa4, 0xf0, 0xdd, 0x51, 0x67, 0x45, 0x87, 0x6a } }
+#endif
+
+/**
+ NM_FIREVIEWCHANGE is WM_NOTIFY Message for notify parent of host window about smiley are going to be repaint
+
+ The proposed action is next: Owner of RichEdit windows received NM_FIREVIEWCHANGE through WM_NOTIFY
+ twice first time before painting|invalidating (FVCN_PREFIRE) and second time - after (FVCN_POSTFIRE).
+ The Owner window may change any values of received FVCNDATA_NMHDR structure in order to raise needed action.
+ For example it may substitute FVCA_INVALIDATE to FVCA_CUSTOMDRAW event to force painting on self offscreen context.
+
+ It can be:
+ FVCA_CUSTOMDRAW - in this case you need to provide valid HDC to draw on and valid RECT of smiley
+ FVCA_INVALIDATE - to invalidate specified rect of window
+ FVCA_NONE - skip any action. But be aware - animation will be stopped till next repainting of smiley.
+ FVCA_SENDVIEWCHANGE - to notify richedit ole about object changed. Be aware Richedit will fully reconstruct itself
+
+ Another point is moment of received smiley rect - it is only valid if FVCA_DRAW is initially set,
+ and it is PROBABLY valid if FVCA_INVALIDATE is set. And it most probably invalid in case of FVCA_SENDVIEWCHANGE.
+ The smiley position is relative last full paint HDC. Usually it is relative to top-left corner of host
+ richedit (NOT it client area) in windows coordinates.
+
+*/
+
+// Type of Event one of
+#define FVCN_PREFIRE 1
+#define FVCN_POSTFIRE 2
+
+// Action of event are going to be done
+#define FVCA_NONE 0
+#define FVCA_DRAW 1 // do not modify hdc in case of _DRAW, Use _CUSTOMDRAW
+#define FVCA_CUSTOMDRAW 2
+//#define FVCA_INVALIDATE 3 (not supported)
+//#define FVCA_SENDVIEWCHANGE 4 (not supported)
+#define FVCA_SKIPDRAW 5
+
+// Extended NMHDR structure for WM_NOTIFY
+typedef struct
+{
+ //NMHDR structure
+ HWND hwndFrom; // Window of smiley host
+ UINT idFrom; // ignored
+ UINT code; // NM_FIREVIEWCHANGE
+
+ size_t cbSize;
+ BYTE bEvent; // FVCN_ value - pre- or post- painting
+ BYTE bAction; // FVCA_ keys
+ HDC hDC; // Canvas to draw on
+ RECT rcRect; // Valid/should be in case of FVCA_DRAW
+ COLORREF clrBackground; // color to fill background if fTransparent is not set
+ BOOL fTransparent; // if need to fill back color (not supported)
+ LPARAM lParam; // used by host window PreFire and PostFire event
+} FVCNDATA_NMHDR;
+
+// Code of WM_NOTIFY message (code)
+#define NM_FIREVIEWCHANGE NM_FIRST+1;
+
+typedef struct
+{
+ unsigned cbSize; // size of the structure
+ HANDLE hContact;
+ int type; // 0 - directory, 1 - file;
+ TCHAR* path; // smiley category name for reference
+} SMADD_CONT;
+
+//Loads all smileys for the contact
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_CONT*) &dir; // pointer to directory to load smiley from
+#define MS_SMILEYADD_LOADCONTACTSMILEYS "SmileyAdd/LoadContactSmileys"
diff --git a/plugins/TipperYM/sdk/m_updater.h b/plugins/TipperYM/sdk/m_updater.h new file mode 100644 index 0000000000..488d3722ce --- /dev/null +++ b/plugins/TipperYM/sdk/m_updater.h @@ -0,0 +1,150 @@ +#ifndef _M_UPDATER_H
+#define _M_UPDATER_H
+
+// NOTES:
+// - For langpack updates, include a string of the following format in the langpack text file:
+// ";FLID: <file listing name> <version>"
+// version must be four numbers seperated by '.', in the range 0-255 inclusive
+// - Updater will disable plugins that are downloaded but were not active prior to the update (this is so that, if an archive contains e.g. ansi and
+// unicode versions, the correct plugin will be the only one active after the new version is installed)...so if you add a support plugin, you may need
+// to install an ini file to make the plugin activate when miranda restarts after the update
+// - Updater will replace all dlls that have the same internal shortName as a downloaded update dll (this is so that msn1.dll and msn2.dll, for example,
+// will both be updated) - so if you have a unicode and a non-unicode version of a plugin in your archive, you should make the internal names different (which will break automatic
+// updates from the file listing if there is only one file listing entry for both versions, unless you use the 'MS_UPDATE_REGISTER' service below)
+// - Updater will install all files in the root of the archive into the plugins folder, except for langpack files that contain the FLID string which go into the root folder (same
+// folder as miranda32.exe)...all folders in the archive will also be copied to miranda's root folder, and their contents transferred into the new folders. The only exception is a
+// special folder called 'root_files' - if there is a folder by that name in the archive, it's contents will also be copied into miranda's root folder - this is intended to be used
+// to install additional dlls etc that a plugin may require)
+
+// if you set Update.szUpdateURL to the following value when registering, as well as setting your beta site and version data,
+// Updater will ignore szVersionURL and pbVersionPrefix, and attempt to find the file listing URL's from the backend XML data.
+// for this to work, the plugin name in pluginInfo.shortName must match the file listing exactly (except for case)
+#define UPDATER_AUTOREGISTER "UpdaterAUTOREGISTER"
+// Updater will also use the backend xml data if you provide URL's that reference the miranda file listing for updates (so you can use that method
+// if e.g. your plugin shortName does not match the file listing) - it will grab the file listing id from the end of these URLs
+
+typedef struct Update_tag {
+ int cbSize;
+ char *szComponentName; // component name as it will appear in the UI (will be translated before displaying)
+
+ char *szVersionURL; // URL where the current version can be found (NULL to disable)
+ BYTE *pbVersionPrefix; // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
+ // (note that this URL could point at a binary file - dunno why, but it could :)
+ int cpbVersionPrefix; // number of bytes pointed to by pbVersionPrefix
+ char *szUpdateURL; // URL where dll/zip is located
+ // set to UPDATER_AUTOREGISTER if you want Updater to find the file listing URLs (ensure plugin shortName matches file listing!)
+
+ char *szBetaVersionURL; // URL where the beta version can be found (NULL to disable betas)
+ BYTE *pbBetaVersionPrefix; // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
+ int cpbBetaVersionPrefix; // number of bytes pointed to by pbVersionPrefix
+ char *szBetaUpdateURL; // URL where dll/zip is located
+
+ BYTE *pbVersion; // bytes of current version, used for comparison with those in VersionURL
+ int cpbVersion; // number of bytes pointed to by pbVersion
+
+ char *szBetaChangelogURL; // url for displaying changelog for beta versions
+} Update;
+
+// register a comonent with Updater
+//
+// wparam = 0
+// lparam = (LPARAM)&Update
+#define MS_UPDATE_REGISTER "Update/Register"
+
+// utility functions to create a version string from a DWORD or from pluginInfo
+// point buf at a buffer at least 16 chars wide - but note the version string returned may be shorter
+//
+__inline static char *CreateVersionString(DWORD version, char *buf) {
+ mir_snprintf(buf, 16, "%d.%d.%d.%d", (version >> 24) & 0xFF, (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);
+ return buf;
+}
+
+__inline static char *CreateVersionStringPlugin(PLUGININFO *pluginInfo, char *buf) {
+ return CreateVersionString(pluginInfo->version, buf);
+}
+
+__inline static char *CreateVersionStringPluginEx(PLUGININFOEX *pluginInfo, char *buf) {
+ return CreateVersionString(pluginInfo->version, buf);
+}
+
+
+// register the 'easy' way - use this method if you have no beta URL and the plugin is on the miranda file listing
+// NOTE: the plugin version string on the file listing must be the string version of the version in pluginInfo (i.e. 0.0.0.1,
+// four numbers between 0 and 255 inclusivem, so no letters, brackets, etc.)
+//
+// wParam = (int)fileID - this is the file ID from the file listing (i.e. the number at the end of the download link)
+// lParam = (PLUGININFO*)&pluginInfo
+#define MS_UPDATE_REGISTERFL "Update/RegisterFL"
+
+// this function can be used to 'unregister' components - useful for plugins that register non-plugin/langpack components and
+// may need to change those components on the fly
+// lParam = (char *)szComponentName
+#define MS_UPDATE_UNREGISTER "Update/Unregister"
+
+// this event is fired when the startup process is complete, but NOT if a restart is imminent
+// it is designed for status managment plugins to use as a trigger for beggining their own startup process
+// wParam = lParam = 0 (unused)
+// (added in version 0.1.6.0)
+#define ME_UPDATE_STARTUPDONE "Update/StartupDone"
+
+// this service can be used to enable/disable Updater's global status control
+// it can be called from the StartupDone event handler
+// wParam = (BOOL)enable
+// lParam = 0
+// (added in version 0.1.6.0)
+#define MS_UPDATE_ENABLESTATUSCONTROL "Update/EnableStatusControl"
+
+// An description of usage of the above service and event:
+// Say you are a status control plugin that normally sets protocol or global statuses in your ModulesLoaded event handler.
+// In order to make yourself 'Updater compatible', you would move the status control code from ModulesLoaded to another function,
+// say DoStartup. Then, in ModulesLoaded you would check for the existence of the MS_UPDATE_ENABLESTATUSCONTROL service.
+// If it does not exist, call DoStartup. If it does exist, hook the ME_UPDATE_STARTUPDONE event and call DoStartup from there. You may
+// also wish to call MS_UPDATE_ENABLESTATUSCONTROL with wParam == FALSE at this time, to disable Updater's own status control feature.
+
+// this service can be used to determine whether updates are possible for a component with the given name
+// wParam = 0
+// lParam = (char *)szComponentName
+// returns TRUE if updates are supported, FALSE otherwise
+#define MS_UPDATE_ISUPDATESUPPORTED "Update/IsUpdateSupported"
+
+#endif
+
+
+/////////////// Usage Example ///////////////
+
+#ifdef EXAMPLE_CODE
+
+// you need to #include "m_updater.h" and HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded) in your Load function...
+
+int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
+
+ Update update = {0}; // for c you'd use memset or ZeroMemory...
+ char szVersion[16];
+
+ update.cbSize = sizeof(Update);
+
+ update.szComponentName = pluginInfo.shortName;
+ update.pbVersion = (BYTE *)CreateVersionString(&pluginInfo, szVersion);
+ update.cpbVersion = strlen((char *)update.pbVersion);
+
+ // these are the three lines that matter - the archive, the page containing the version string, and the text (or data)
+ // before the version that we use to locate it on the page
+ // (note that if the update URL and the version URL point to standard file listing entries, the backend xml
+ // data will be used to check for updates rather than the actual web page - this is not true for beta urls)
+ update.szUpdateURL = "http://scottellis.com.au:81/test/updater.zip";
+ update.szVersionURL = "http://scottellis.com.au:81/test/updater_test.html";
+ update.pbVersionPrefix = (BYTE *)"Updater version ";
+
+ update.cpbVersionPrefix = strlen((char *)update.pbVersionPrefix);
+
+ // do the same for the beta versions of the above struct members if you wish to allow beta updates from another URL
+
+ CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
+
+ // Alternatively, to register a plugin with e.g. file ID 2254 on the file listing...
+ // CallService(MS_UPDATE_REGISTERFL, (WPARAM)2254, (LPARAM)&pluginInfo);
+
+ return 0;
+}
+
+#endif
diff --git a/plugins/TipperYM/sdk/m_variables.h b/plugins/TipperYM/sdk/m_variables.h new file mode 100644 index 0000000000..1264643448 --- /dev/null +++ b/plugins/TipperYM/sdk/m_variables.h @@ -0,0 +1,719 @@ +/*
+ Variables Plugin for Miranda-IM (www.miranda-im.org)
+ Copyright 2003-2006 P. Boon
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#ifndef __M_VARS
+#define __M_VARS
+
+#if !defined(_TCHAR_DEFINED)
+#include <tchar.h>
+#endif
+
+#ifndef VARIABLES_NOHELPER
+#include <m_button.h>
+#endif
+
+#ifndef SIZEOF
+#include <win2k.h>
+#endif
+
+// --------------------------------------------------------------------------
+// Memory management
+// --------------------------------------------------------------------------
+
+// Release memory that was allocated by the Variables plugin, e.g. returned
+// strings.
+
+#define MS_VARS_FREEMEMORY "Vars/FreeMemory"
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(void *)pntr
+// Pointer to memory that was allocated by the Variables plugin (e.g. a
+// returned string) (can be NULL).
+// lParam = 0
+
+// Return Value:
+// ------------------------
+// Does return 0 on success, nozero otherwise.
+
+// Note: Do only use this service to free memory that was *explicitliy*
+// stated that it should be free with this service.
+
+
+
+#define MS_VARS_GET_MMI "Vars/GetMMI"
+
+// Get Variable's RTL/CRT function poiners to malloc(), free() and
+// realloc().
+
+// Parameters:
+// ------------------------
+// wParam = 0
+// lParam = (LPARAM) &MM_INTERFACE
+// Pointer to a memory manager interface struct (see m_system.h).
+
+// Return Value:
+// ------------------------
+// Returns 0 on success, nozero otherwise
+
+// Note: Works exactly the same as the MS_SYSTEM_GET_MMI service
+// service of m_system.h.
+
+// Helper function for easy using:
+#ifndef VARIABLES_NOHELPER
+__inline static void variables_free(void *pntr) {
+
+ CallService(MS_VARS_FREEMEMORY, (WPARAM)pntr, 0);
+}
+#endif
+
+
+
+// --------------------------------------------------------------------------
+// String formatting
+// --------------------------------------------------------------------------
+
+#define MS_VARS_FORMATSTRING "Vars/FormatString"
+
+// This service can be used to parse tokens in a text. The tokens will be
+// replaced by their resolved values. A token can either be a field or a
+// function. A field takes no arguments and is represented between
+// %-characters, e.g. "%winampsong%". A function can take any number of
+// arguments and is represented by a ? or !-character followed by the name
+// of the function and a list of arguments, e.g. "?add(1,2)".
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(FORMATINFO *)&fi
+// See below.
+// lParam = 0
+
+// Return Value:
+// ------------------------
+// Returns a pointer to the resolved string or NULL in case of an error.
+
+// Note: The returned pointer needs to be freed using MS_VARS_FREEMEMORY.
+
+typedef struct {
+ int cbSize; // Set this to sizeof(FORMATINFO).
+ int flags; // Flags to use (see FIF_* below).
+ union {
+ char *szFormat; // Text in which the tokens will be replaced (can't be
+ // NULL).
+ WCHAR *wszFormat;
+ TCHAR *tszFormat;
+ };
+ union {
+ char *szExtraText; // Extra, context-specific string (can be NULL) ->
+ // The field "extratext" will be replaced by this
+ // string. (Previously szSource).
+ WCHAR *wszExtraText;
+ TCHAR *tszExtraText;
+ };
+ HANDLE hContact; // Handle to contact (can be NULL) -> The field "subject"
+ // represents this contact.
+ int pCount; // (output) Number of succesful parsed tokens, needs to be set
+ // to 0 before the call
+ int eCount; // (output) Number of failed tokens, needs to be set to 0
+ // before the call
+ union {
+ char **szaTemporaryVars; // Temporary variables valid only in the duration of the format call
+ TCHAR **tszaTemporaryVars; // By pos: [i] is var name, [i + 1] is var value
+ WCHAR **wszaTemporaryVars;
+ };
+ int cbTemporaryVarsSize; // Number of elements in szaTemporaryVars array
+
+} FORMATINFO;
+
+#define FORMATINFOV2_SIZE 28
+
+// Possible flags:
+#define FIF_UNICODE 0x01 // Expects and returns unicode text (WCHAR*).
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define FIF_TCHAR FIF_UNICODE // Strings in structure are TCHAR*.
+#else
+#define FIF_TCHAR 0
+#endif
+
+// Helper functions for easy using:
+
+// Helper #1: variables_parse
+// ------------------------
+// The returned string needs to be freed using MS_VARS_FREEMEMORY.
+
+#ifndef VARIABLES_NOHELPER
+__inline static TCHAR *variables_parse(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact) {
+
+ FORMATINFO fi;
+
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.tszFormat = tszFormat;
+ fi.tszExtraText = tszExtraText;
+ fi.hContact = hContact;
+ fi.flags = FIF_TCHAR;
+
+ return (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+}
+#endif
+
+__inline static TCHAR *variables_parse_ex(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact,
+ TCHAR **tszaTemporaryVars, int cbTemporaryVarsSize) {
+
+ FORMATINFO fi;
+
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.tszFormat = tszFormat;
+ fi.tszExtraText = tszExtraText;
+ fi.hContact = hContact;
+ fi.flags = FIF_TCHAR;
+ fi.tszaTemporaryVars = tszaTemporaryVars;
+ fi.cbTemporaryVarsSize = cbTemporaryVarsSize;
+
+ return (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+}
+// Helper #2: variables_parsedup
+// ------------------------
+// Returns a _strdup()'ed copy of the unparsed string when Variables is not
+// installed, returns a strdup()'ed copy of the parsed result otherwise.
+
+// Note: The returned pointer needs to be released using your own free().
+
+#ifndef VARIABLES_NOHELPER
+__inline static TCHAR *variables_parsedup(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact) {
+
+ if (ServiceExists(MS_VARS_FORMATSTRING)) {
+ FORMATINFO fi;
+ TCHAR *tszParsed, *tszResult;
+
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.tszFormat = tszFormat;
+ fi.tszExtraText = tszExtraText;
+ fi.hContact = hContact;
+ fi.flags |= FIF_TCHAR;
+ tszParsed = (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ if (tszParsed) {
+ tszResult = _tcsdup(tszParsed);
+ CallService(MS_VARS_FREEMEMORY, (WPARAM)tszParsed, 0);
+ return tszResult;
+ }
+ }
+ return tszFormat?_tcsdup(tszFormat):tszFormat;
+}
+
+__inline static TCHAR *variables_parsedup_ex(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact,
+ TCHAR **tszaTemporaryVars, int cbTemporaryVarsSize) {
+
+ if (ServiceExists(MS_VARS_FORMATSTRING)) {
+ FORMATINFO fi;
+ TCHAR *tszParsed, *tszResult;
+
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.tszFormat = tszFormat;
+ fi.tszExtraText = tszExtraText;
+ fi.hContact = hContact;
+ fi.flags |= FIF_TCHAR;
+ fi.tszaTemporaryVars = tszaTemporaryVars;
+ fi.cbTemporaryVarsSize = cbTemporaryVarsSize;
+ tszParsed = (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ if (tszParsed) {
+ tszResult = _tcsdup(tszParsed);
+ CallService(MS_VARS_FREEMEMORY, (WPARAM)tszParsed, 0);
+ return tszResult;
+ }
+ }
+ return tszFormat?_tcsdup(tszFormat):tszFormat;
+}
+#endif
+
+
+
+// --------------------------------------------------------------------------
+// Register tokens
+// --------------------------------------------------------------------------
+
+// Plugins can define tokens which will be parsed by the Variables plugin.
+
+#define MS_VARS_REGISTERTOKEN "Vars/RegisterToken"
+
+// With this service you can define your own token. The newly added tokens
+// using this service are taken into account on every call to
+// MS_VARS_FORMATSTRING.
+
+// Parameters:
+// ------------------------
+// wParam = 0
+// lParam = (LPARAM)(TOKENREGISTER*)&tr
+// See below.
+
+// Return Value:
+// ------------------------
+// Returns 0 on success, nonzero otherwise. Existing tokens will be
+// 'overwritten' if registered twice.
+
+// Needed for szService and parseFunction:
+typedef struct {
+ int cbSize; // You need to check if this is >=sizeof(ARGUMENTSINFO)
+ // (already filled in).
+ FORMATINFO *fi; // Arguments passed to MS_VARS_FORMATSTRING.
+ unsigned int argc; // Number of elements in the argv array.
+ union {
+ char **argv; // Argv[0] will be the token name, the following elements
+ // are the additional arguments.
+ WCHAR **wargv; // If the registered token was registered as a unicode
+ // token, wargv should be accessed.
+ TCHAR **targv;
+ };
+ int flags; // (output) You can set flags here (initially 0), use the
+ // AIF_* flags (see below).
+} ARGUMENTSINFO;
+
+// Available flags for ARGUMENTSINFO:
+// Set the flags of the ARGUMENTSINFO struct to any of these to influence
+// further parsing.
+#define AIF_DONTPARSE 0x01 // Don't parse the result of this function,
+ // usually the result of a token is parsed
+ // again, if the `?` is used as a function
+ // character.
+#define AIF_FALSE 0x02 // The function returned logical false.
+
+// Definition of parse/cleanup functions:
+typedef char* (*VARPARSEFUNCA)(ARGUMENTSINFO *ai);
+typedef WCHAR* (*VARPARSEFUNCW)(ARGUMENTSINFO *ai);
+typedef void (*VARCLEANUPFUNCA)(char *szReturn);
+typedef void (*VARCLEANUPFUNCW)(WCHAR *wszReturn);
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define VARPARSEFUNC VARPARSEFUNCW
+#define VARCLEANUPFUNC VARCLEANUPFUNCW
+#else
+#define VARPARSEFUNC VARPARSEFUNCA
+#define VARCLEANUPFUNC VARCLEANUPFUNCA
+#endif
+
+typedef struct {
+ int cbSize; // Set this to sizeof(TOKENREGISTER).
+ union {
+ char *szTokenString; // Name of the new token to be created, without %,
+ // ?, ! etc. signs (can't be NULL).
+ WCHAR *wszTokenString;
+ TCHAR *tszTokenString;
+ };
+ union {
+ char *szService; // Name of a service that is used to request the
+ // token's value, if no service is used, a function
+ // and TRF_PARSEFUNC must be used.
+ VARPARSEFUNCA parseFunction; // See above, use with TRF_PARSEFUNC.
+ VARPARSEFUNCW parseFunctionW;
+ VARPARSEFUNC parseFunctionT;
+ };
+ union {
+ char *szCleanupService; // Name of a service to be called when the
+ // memory allocated in szService can be freed
+ // (only used when flag VRF_CLEANUP is set,
+ // else set this to NULL).
+ VARCLEANUPFUNCA cleanupFunction; // See above, use with TRF_CLEANUPFUNC.
+ VARCLEANUPFUNCW cleanupFunctionW;
+ VARCLEANUPFUNC cleanupFunctionT;
+ };
+ char *szHelpText; // Help info shown in help dialog (can be NULL). Has to
+ // be in the following format:
+ // "subject\targuments\tdescription"
+ // (Example: "math\t(x, y ,...)\tx + y + ..."), or:
+ // "subject\tdescription"
+ // (Example: "miranda\tPath to the Miranda-IM
+ // executable").
+ // Note: subject and description are translated by
+ // Variables.
+ int memType; // Describes which method Varibale's plugin needs to use to
+ // free the returned buffer, use one of the VR_MEM_* values
+ // (see below). Only valid if the flag VRF_FREEMEM is set,
+ // use TR_MEM_OWNER otherwise).
+ int flags; // Flags to use (see below), one of TRF_* (see below).
+} TOKENREGISTER;
+
+// Available Memory Storage Types:
+// These values describe which method Variables Plugin will use to free the
+// buffer returned by the parse function or service
+#define TR_MEM_VARIABLES 1 // Memory is allocated using the functions
+ // retrieved by MS_VARS_GET_MMI.
+#define TR_MEM_MIRANDA 2 // Memory is allocated using Miranda's Memory
+ // Manager Interface (using the functions
+ // returned by MS_SYSTEM_GET_MMI), if
+ // VRF_FREEMEM is set, the memory will be
+ // freed by Variables.
+#define TR_MEM_OWNER 3 // Memory is owned by the calling plugin
+ // (can't be freed by Variables Plugin
+ // automatically). This should be used if
+ // VRF_FREEMEM is not specified in the flags.
+
+// Available Flags for TOKENREGISTER:
+#define TRF_FREEMEM 0x01 // Variables Plugin will automatically free the
+ // pointer returned by the parse function or
+ // service (which method it will us is
+ // specified in memType -> see above).
+#define TRF_CLEANUP 0x02 // Call cleanup service or function, notifying
+ // that the returned buffer can be freed.
+ // Normally you should use either TRF_FREEMEM
+ // or TRF_CLEANUP.
+#define TRF_PARSEFUNC 0x40 // parseFunction will be used instead of a
+ // service.
+#define TRF_CLEANUPFUNC 0x80 // cleanupFunction will be used instead of a
+ // service.
+#define TRF_USEFUNCS TRF_PARSEFUNC|TRF_CLEANUPFUNC
+#define TRF_UNPARSEDARGS 0x04 // Provide the arguments for the parse
+ // function in their raw (unparsed) form.
+ // By default, arguments are parsed before
+ // presenting them to the parse function.
+#define TRF_FIELD 0x08 // The token can be used as a %field%.
+#define TRF_FUNCTION 0x10 // The token can be used as a ?function().
+ // Normally you should use either TRF_FIELD or
+ // TRF_FUNCTION.
+#define TRF_UNICODE 0x20 // Strings in structure are unicode (WCHAR*).
+ // In this case, the strings pointing to the
+ // arguments in the ARGUMENTS struct are
+ // unicode also. The returned buffer is
+ // expected to be unicode also, and the
+ // unicode parse and cleanup functions are
+ // called.
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define TRF_TCHAR TRF_UNICODE // Strings in structure are TCHAR*.
+#else
+#define TRF_TCHAR 0
+#endif
+
+// Deprecated:
+#define TRF_CALLSVC TRF_CLEANUP
+
+// Callback Service (szService) / parseFunction:
+// ------------------------
+// Service that is called automatically by the Variable's Plugin to resolve a
+// registered variable.
+
+// Parameters:
+// wParam = 0
+// lParam = (LPARAM)(ARGUMENTSINFO *)&ai
+// see above
+
+// Return Value:
+// Needs to return the pointer to a dynamically allocacated string or NULL.
+// A return value of NULL is regarded as an error (eCount will be increaded).
+// Flags in the ARGUMENTSINFO struct can be set (see above).
+
+// Callback Service (szCallbackService) / cleanupFunction:
+// ------------------------
+// This service is called when the memory that was allocated by the parse
+// function or service can be freed. Note: It will only be called when the
+// flag VRF_CLEANUP of TOKENREGISTER is set.
+
+// Parameters:
+// wParam = 0
+// lParam = (LPARAM)(char *)&res
+// Result from parse function or service (pointer to a string).
+
+// Return Value:
+// Should return 0 on success.
+
+
+
+// --------------------------------------------------------------------------
+// Show the help dialog
+// --------------------------------------------------------------------------
+
+// Plugins can invoke Variables' help dialog which can be used for easy input
+// by users.
+
+#define MS_VARS_SHOWHELPEX "Vars/ShowHelpEx"
+
+// This service can be used to open the help dialog of Variables. This dialog
+// provides easy input for the user and/or information about the available
+// tokens.
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(HWND)hwndParent
+// lParam = (LPARAM)(VARHELPINFO)&vhi
+// See below.
+
+// Return Value:
+// ------------------------
+// Returns 0 on succes, any other value on error.
+
+typedef struct {
+ int cbSize; // Set to sizeof(VARHELPINFO).
+ FORMATINFO *fi; // Used for both input and output. If this pointer is not
+ // NULL, the information is used as the initial values for
+ // the dialog.
+ HWND hwndCtrl; // Used for both input and output. The window text of this
+ // window will be read and used as the initial input of the
+ // input dialog. If the user presses the OK button the window
+ // text of this window will be set to the text of the input
+ // field and a EN_CHANGE message via WM_COMMAND is send to
+ // this window. (Can be NULL).
+ char *szSubjectDesc; // The description of the %subject% token will be set
+ // to this text, if not NULL. This is translated
+ // automatically.
+ char *szExtraTextDesc; // The description of the %extratext% token will be
+ // set to this text, if not NULL. This is translated
+ // automatically.
+ int flags; // Flags, see below.
+} VARHELPINFO;
+
+
+// Flags for VARHELPINFO
+#define VHF_TOKENS 0x00000001 // Create a dialog with the list of
+ // tokens
+#define VHF_INPUT 0x00000002 // Create a dialog with an input
+ // field (this contains the list of
+ // tokens as well).
+#define VHF_SUBJECT 0x00000004 // Create a dialog to select a
+ // contact for the %subject% token.
+#define VHF_EXTRATEXT 0x00000008 // Create a dialog to enter a text
+ // for the %extratext% token.
+#define VHF_HELP 0x00000010 // Create a dialog with help info.
+#define VHF_HIDESUBJECTTOKEN 0x00000020 // Hide the %subject% token in the
+ // list of tokens.
+#define VHF_HIDEEXTRATEXTTOKEN 0x00000040 // Hide the %extratext% token in
+ // the list of tokens.
+#define VHF_DONTFILLSTRUCT 0x00000080 // Don't fill the struct with the
+ // new information if OK is pressed
+#define VHF_FULLFILLSTRUCT 0x00000100 // Fill all members of the struct
+ // when OK is pressed. By default
+ // only szFormat is set. With this
+ // flag on, hContact and
+ // szExtraText are also set.
+#define VHF_SETLASTSUBJECT 0x00000200 // Set the last contact that was
+ // used in the %subject% dialog in
+ // case fi.hContact is NULL.
+
+// Predefined flags
+#define VHF_FULLDLG VHF_INPUT|VHF_SUBJECT|VHF_EXTRATEXT|VHF_HELP
+#define VHF_SIMPLEDLG VHF_INPUT|VHF_HELP
+#define VHF_NOINPUTDLG VHF_TOKENS|VHF_HELP
+
+// If the service fills information in the struct for szFormat or szExtraText,
+// these members must be free'd using the free function of Variables.
+// If wParam==NULL, the dialog is created modeless. Only one dialog can be
+// shown at the time.
+// If both hwndCtrl and fi are NULL, the user input will not be retrievable.
+// In this case, the dialog is created with only a "Close" button, instead of
+// the "OK" and "Cancel" buttons.
+// In case of modeless dialog and fi != NULL, please make sure this pointer
+// stays valid while the dialog is open.
+
+// Helper function for easy use in standard case:
+#ifndef VARIABLES_NOHELPER
+__inline static int variables_showhelp(HWND hwndDlg, UINT uIDEdit, int flags, char *szSubjectDesc, char *szExtraDesc) {
+
+ VARHELPINFO vhi;
+
+ ZeroMemory(&vhi, sizeof(VARHELPINFO));
+ vhi.cbSize = sizeof(VARHELPINFO);
+ if (flags == 0) {
+ flags = VHF_SIMPLEDLG;
+ }
+ vhi.flags = flags;
+ vhi.hwndCtrl = GetDlgItem(hwndDlg, uIDEdit);
+ vhi.szSubjectDesc = szSubjectDesc;
+ vhi.szExtraTextDesc = szExtraDesc;
+
+ return CallService(MS_VARS_SHOWHELPEX, (WPARAM)hwndDlg, (LPARAM)&vhi);
+}
+#endif
+
+
+#define MS_VARS_GETSKINITEM "Vars/GetSkinItem"
+
+// This service can be used to get the icon you can use for example on the
+// Variables help button in your options screen. You can also get the tooltip
+// text to use with such a button. If icon library is available the icon will
+// be retrieved from icon library manager, otherwise the default is returned.
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)0
+// lParam = (LPARAM)VSI_* (see below)
+
+// Return Value:
+// ------------------------
+// Depends on the information to retrieve (see below).
+
+// VSI_ constants
+#define VSI_HELPICON 1 // Can be used on the button accessing the
+ // Variables help dialog. Returns (HICON)hIcon on
+ // success or NULL on failure;
+#define VSI_HELPTIPTEXT 2 // Returns the tooltip text you can use for the
+ // help button. Returns (char *)szTipText, a
+ // static, translated buffer containing the help
+ // text or NULL on error.
+
+// Helper to set the icon on a button accessing the help dialog.
+// Preferably a 16x14 MButtonClass control, but it works on a standard
+// button control as well. If no icon is availble (because of old version of
+// Variables) the string "V" is shown on the button. If Variables is not
+// available, the button will be hidden.
+#ifndef VARIABLES_NOHELPER
+__inline static int variables_skin_helpbutton(HWND hwndDlg, UINT uIDButton) {
+
+ int res;
+ HICON hIcon;
+ TCHAR tszClass[32];
+
+ hIcon = NULL;
+ res = 0;
+ if (ServiceExists(MS_VARS_GETSKINITEM))
+ hIcon = (HICON)CallService(MS_VARS_GETSKINITEM, 0, (LPARAM)VSI_HELPICON);
+
+ GetClassName(GetDlgItem(hwndDlg, uIDButton), tszClass, SIZEOF(tszClass));
+ if (!_tcscmp(tszClass, _T("Button"))) {
+ if (hIcon != NULL) {
+ SetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE)|BS_ICON);
+ SendMessage(GetDlgItem(hwndDlg, uIDButton), BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hIcon);
+ }
+ else {
+ SetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE)&~BS_ICON);
+ SetDlgItemText(hwndDlg, uIDButton, _T("V"));
+ }
+ }
+ else if (!_tcscmp(tszClass, MIRANDABUTTONCLASS)) {
+ if (hIcon != NULL) {
+ char *szTipInfo = NULL;
+
+ SendMessage(GetDlgItem(hwndDlg, uIDButton), BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hIcon);
+ if (ServiceExists(MS_VARS_GETSKINITEM))
+ szTipInfo = (char *)CallService(MS_VARS_GETSKINITEM, 0, (LPARAM)VSI_HELPTIPTEXT);
+
+ if (szTipInfo == NULL)
+ szTipInfo = Translate("Open String Formatting Help");
+
+ SendMessage(GetDlgItem(hwndDlg, uIDButton), BUTTONADDTOOLTIP, (WPARAM)szTipInfo, 0);
+ SendDlgItemMessage(hwndDlg, uIDButton, BUTTONSETASFLATBTN, 0, 0);
+ }
+ else SetDlgItemText(hwndDlg, uIDButton, _T("V"));
+ }
+ else res = -1;
+
+ ShowWindow(GetDlgItem(hwndDlg, uIDButton), ServiceExists(MS_VARS_FORMATSTRING));
+
+ return res;
+}
+#endif
+
+
+#define MS_VARS_SHOWHELP "Vars/ShowHelp"
+
+// WARNING: This service is obsolete, please use MS_VARS_SHOWHELPEX
+
+// Shows a help dialog where all possible tokens are displayed. The tokens
+// are explained on the dialog, too. The user can edit the initial string and
+// insert as many tokens as he likes.
+
+// Parameters:
+// ------------------------
+// wParam = (HWND)hwndEdit
+// Handle to an edit control in which the modified string
+// should be inserted (When the user clicks OK in the dialog the edited
+// string will be set to hwndEdit) (can be NULL).
+// lParam = (char *)pszInitialString
+// String that the user is provided with initially when
+// the dialog gets opened (If this is NULL then the current text in the
+// hwndEdit edit control will be used) (can be NULL).
+
+// Return Value:
+// ------------------------
+// Returns the handle to the help dialog (HWND).
+
+// Note: Only one help dialog can be opened at a time. When the dialog gets
+// closed an EN_CHANGE of the edit controll will be triggered because the
+// contents were updated. (Only when user selected OK).
+
+// Example:
+// CallService(MS_VARS_SHOWHELP, (WPARAM)hwndEdit, (LPARAM)"some initial text");
+
+// --------------------------------------------------------------------------
+// Retrieve a contact's HANDLE given a string
+// --------------------------------------------------------------------------
+
+#define MS_VARS_GETCONTACTFROMSTRING "Vars/GetContactFromString"
+
+// Searching for contacts in the database. You can find contacts in db by
+// searching for their name, e.g first name.
+
+// Parameters:
+// ------------------------
+// wParam = (WPARAM)(CONTACTSINFO *)&ci
+// See below.
+// lParam = 0
+
+// Return Value:
+// ------------------------
+// Returns number of contacts found matching the given string representation.
+// The hContacts array of CONTACTSINFO struct contains these hContacts after
+// the call.
+
+// Note: The hContacts array needs to be freed after use using
+// MS_VARS_FREEMEMORY.
+
+typedef struct {
+ int cbSize; // Set this to sizeof(CONTACTSINFO).
+ union {
+ char *szContact; // String to search for, e.g. last name (can't be NULL).
+ WCHAR *wszContact;
+ TCHAR *tszContact;
+ };
+ HANDLE *hContacts; // (output) Array of contacts found.
+ DWORD flags; // Contact details that will be matched with the search
+ // string (flags can be combined).
+} CONTACTSINFO;
+
+// Possible flags:
+#define CI_PROTOID 0x00000001 // The contact in the string is encoded
+ // in the format <PROTOID:UNIQUEID>, e.g.
+ // <ICQ:12345678>.
+#define CI_NICK 0x00000002 // Search nick names.
+#define CI_LISTNAME 0x00000004 // Search custom names shown in contact
+ // list.
+#define CI_FIRSTNAME 0x00000008 // Search contact's first names (contact
+ // details).
+#define CI_LASTNAME 0x00000010 // Search contact's last names (contact
+ // details).
+#define CI_EMAIL 0x00000020 // Search contact's email adresses
+ // (contact details).
+#define CI_UNIQUEID 0x00000040 // Search unique ids of the contac, e.g.
+ // UIN.
+#define CI_CNFINFO 0x40000000 // Searches one of the CNF_* flags (set
+ // flags to CI_CNFINFO|CNF_X), only one
+ // CNF_ type possible
+#define CI_UNICODE 0x80000000 // tszContact is a unicode string
+ // (WCHAR*).
+
+#if defined(UNICODE) || defined(_UNICODE)
+#define CI_TCHAR CI_UNICODE // Strings in structure are TCHAR*.
+#else
+#define CI_TCHAR 0
+#endif
+
+
+
+#endif //__M_VARS
diff --git a/plugins/TipperYM/skin_parser.cpp b/plugins/TipperYM/skin_parser.cpp new file mode 100644 index 0000000000..4f586eef2d --- /dev/null +++ b/plugins/TipperYM/skin_parser.cpp @@ -0,0 +1,421 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#include "common.h"
+#include "options.h"
+#include "str_utils.h"
+
+extern char SKIN_FOLDER[256];
+
+int RefreshSkinList(HWND hwndDlg)
+{
+ HWND hwndSkins = GetDlgItem(hwndDlg, IDC_LB_SKINS);
+ ListBox_ResetContent(hwndSkins);
+ ListBox_AddString(hwndSkins, TranslateT("# Solid color fill"));
+
+ char szDirSave[1024];
+ GetCurrentDirectoryA(1024, szDirSave);
+ SetCurrentDirectoryA(SKIN_FOLDER);
+
+ WIN32_FIND_DATA ffd;
+ HANDLE hFind = FindFirstFile(_T("*.*"), &ffd);
+ while (hFind != INVALID_HANDLE_VALUE)
+ {
+ if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && _tcscmp(_T("."), ffd.cFileName) && _tcscmp(_T(".."), ffd.cFileName))
+ {
+ SetCurrentDirectory(ffd.cFileName);
+ WIN32_FIND_DATA ffd2;
+ HANDLE hFindFile = FindFirstFile(_T("*.tsf"), &ffd2);
+ if (hFindFile != INVALID_HANDLE_VALUE)
+ ListBox_AddString(hwndSkins, ffd.cFileName);
+
+ FindClose(hFindFile);
+ SetCurrentDirectory(_T(".."));
+ }
+
+ if (!FindNextFile(hFind, &ffd))
+ break;
+ }
+
+ FindClose(hFind);
+ SetCurrentDirectoryA(szDirSave);
+
+ TCHAR swzSkinName[256];
+ a2t(opt.szSkinName, swzSkinName, 256);
+ return ListBox_SelectString(GetDlgItem(hwndDlg, IDC_LB_SKINS), -1, swzSkinName);
+}
+
+bool FileExists(char *filename)
+{
+ HANDLE hFile = CreateFileA(filename, 0, 0, 0, OPEN_EXISTING, 0, 0);
+ if (hFile != INVALID_HANDLE_VALUE)
+ {
+ CloseHandle(hFile);
+ return true;
+ }
+
+ return false;
+}
+
+void ParseAboutPart(FILE *fp, char *buff, char *szSkinName)
+{
+ myfgets(buff, 1024, fp);
+ while (buff[0] != '[')
+ {
+ if (buff[0] != ';')
+ {
+ char *pch = strchr(buff, '=');
+ if (pch++)
+ {
+ while (pch && (*pch == ' ' || *pch == '\t'))
+ pch++;
+
+ if (pch)
+ {
+ if (strstr(buff, "author"))
+ {}
+ else if (strstr(buff, "preview"))
+ {
+ char szImgPath[1024];
+ mir_snprintf(szImgPath, SIZEOF(szImgPath), "%s\\%s\\%s", SKIN_FOLDER, szSkinName, pch);
+ if (FileExists(szImgPath))
+ strcpy(opt.szPreviewFile, szImgPath);
+ }
+ }
+ }
+ }
+
+ if (feof(fp)) break;
+ myfgets(buff, 1024, fp);
+ }
+}
+
+void ParseImagePart(FILE *fp, char *buff, int iPart)
+{
+ opt.szImgFile[iPart] = NULL;
+ opt.transfMode[iPart] = TM_NONE;
+ opt.margins[iPart].left = 0;
+ opt.margins[iPart].top = 0;
+ opt.margins[iPart].right = 0;
+ opt.margins[iPart].bottom = 0;
+
+ myfgets(buff, 1024, fp);
+ while (buff[0] != '[')
+ {
+ if (buff[0] != ';')
+ {
+ char *pch = strchr(buff, '=');
+ if (pch++)
+ {
+ while (pch && (*pch == ' ' || *pch == '\t'))
+ pch++;
+
+ if (pch)
+ {
+ if (strstr(buff, "image"))
+ {
+ char szImgPath[1024];
+ mir_snprintf(szImgPath, SIZEOF(szImgPath), "%s\\%s\\%s", SKIN_FOLDER, opt.szSkinName, pch);
+ opt.szImgFile[iPart] = mir_strdup(szImgPath);
+ }
+ else if (strstr(buff, "tm"))
+ {
+ if (!lstrcmpiA(pch, "TM_NONE"))
+ opt.transfMode[iPart] = TM_NONE;
+ else if (!lstrcmpiA(pch, "TM_CENTRE"))
+ opt.transfMode[iPart] = TM_CENTRE;
+ else if (!lstrcmpiA(pch, "TM_STRECH_ALL"))
+ opt.transfMode[iPart] = TM_STRECH_ALL;
+ else if (!lstrcmpiA(pch, "TM_STRECH_HORIZONTAL"))
+ opt.transfMode[iPart] = TM_STRECH_HORIZONTAL;
+ else if (!lstrcmpiA(pch, "TM_STRECH_VERTICAL"))
+ opt.transfMode[iPart] = TM_STRECH_VERTICAL;
+ else if (!lstrcmpiA(pch, "TM_TILE_ALL"))
+ opt.transfMode[iPart] = TM_TILE_ALL;
+ else if (!lstrcmpiA(pch, "TM_TILE_HORIZONTAL"))
+ opt.transfMode[iPart] = TM_TILE_HORIZONTAL;
+ else if (!lstrcmpiA(pch, "TM_TILE_VERTICAL"))
+ opt.transfMode[iPart] = TM_TILE_VERTICAL;
+ else
+ opt.transfMode[iPart] = TM_NONE;
+ }
+ else if (strstr(buff, "left"))
+ opt.margins[iPart].left = atoi(pch);
+ else if (strstr(buff, "top"))
+ opt.margins[iPart].top = atoi(pch);
+ else if (strstr(buff, "right"))
+ opt.margins[iPart].right = atoi(pch);
+ else if (strstr(buff, "bottom"))
+ opt.margins[iPart].bottom = atoi(pch);
+ }
+ }
+ }
+
+ if (feof(fp)) break;
+ myfgets(buff, 1024, fp);
+ }
+}
+
+char *GetSettingName(char *szValue, char *szPostfix, char *buff)
+{
+ buff[0] = 0;
+
+ if (strstr(szValue, "traytitle"))
+ mir_snprintf(buff, 64, "FontTrayTitle%s", szPostfix);
+ else if (strstr(szValue, "title"))
+ mir_snprintf(buff, 64, "FontFirst%s", szPostfix);
+ else if (strstr(szValue, "label"))
+ mir_snprintf(buff, 64, "FontLabels%s", szPostfix);
+ else if (strstr(szValue, "value"))
+ mir_snprintf(buff, 64, "FontValues%s", szPostfix);
+ else if (strstr(szValue, "divider"))
+ mir_snprintf(buff, 64, "Divider%s", szPostfix);
+
+ if (buff[0]) return buff;
+ else return NULL;
+}
+
+void ParseFontPart(FILE *fp, char *buff)
+{
+ char szSetting[64];
+
+ myfgets(buff, 1024, fp);
+ while (buff[0] != '[')
+ {
+ if (buff[0] != ';')
+ {
+ char *pch = strchr(buff, '=');
+ if (pch++)
+ {
+ while (pch && (*pch == ' ' || *pch == '\t'))
+ pch++;
+
+ if (pch)
+ {
+ if (strstr(buff, "face"))
+ {
+ if (GetSettingName(buff, "", szSetting))
+ {
+ if (strlen(pch) > 32)
+ pch[32] = 0;
+
+ TCHAR *tmp = mir_a2t(pch);
+ DBWriteContactSettingTString(0, MODULE, szSetting, tmp);
+ mir_free(tmp);
+ }
+ }
+ else if (strstr(buff, "color"))
+ {
+ if (GetSettingName(buff, "Col", szSetting))
+ {
+ BYTE r = atoi(pch);
+ pch = strchr(pch, ' ');
+ if (++pch)
+ {
+ BYTE g = atoi(pch);
+ pch = strchr(pch, ' ');
+ if (++pch)
+ {
+ BYTE b = atoi(pch);
+ COLORREF color = RGB(r, g ,b);
+ DBWriteContactSettingDword(0, MODULE, szSetting, color);
+ }
+ }
+ }
+ }
+ else if (strstr(buff, "size"))
+ {
+ if (GetSettingName(buff, "Size", szSetting))
+ {
+ HDC hdc = GetDC(0);
+ int size = -MulDiv(atoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ DBWriteContactSettingByte(0, MODULE, szSetting, (BYTE)size);
+ ReleaseDC(0, hdc);
+ }
+ }
+ else if (strstr(buff, "effect"))
+ {
+ if (GetSettingName(buff, "Sty", szSetting))
+ {
+ BYTE effect = 0;
+ if (strstr(pch, "font_bold"))
+ effect |= DBFONTF_BOLD;
+ if (strstr(pch, "font_italic"))
+ effect |= DBFONTF_ITALIC;
+ if (strstr(pch, "font_underline"))
+ effect |= DBFONTF_UNDERLINE;
+
+ DBWriteContactSettingByte(0, MODULE, szSetting, effect);
+ }
+ }
+ }
+ }
+ }
+
+ if (feof(fp)) break;
+ myfgets(buff, 1024, fp);
+ }
+}
+
+void ParseAppearancePart(FILE *fp, char *buff)
+{
+ myfgets(buff, 1024, fp);
+ while (buff[0] != '[')
+ {
+ if (buff[0] != ';')
+ {
+ char *pch = strchr(buff, '=');
+ if (pch++)
+ {
+ while (pch && (*pch == ' ' || *pch == '\t'))
+ pch++;
+
+ if (pch)
+ {
+ if (strstr(buff, "general-padding"))
+ opt.iPadding = atoi(pch);
+ else if (strstr(buff, "title-indent"))
+ opt.iTitleIndent = atoi(pch);
+ else if (strstr(buff, "text-indent"))
+ opt.iTextIndent = atoi(pch);
+ else if (strstr(buff, "value-indent"))
+ opt.iValueIndent = atoi(pch);
+ else if (strstr(buff, "text-padding"))
+ opt.iTextPadding = atoi(pch);
+ else if (strstr(buff, "outer-avatar-padding"))
+ opt.iOuterAvatarPadding = atoi(pch);
+ else if (strstr(buff, "inner-avatar-padding"))
+ opt.iInnerAvatarPadding = atoi(pch);
+ else if (strstr(buff, "sidebar-width"))
+ opt.iSidebarWidth = atoi(pch);
+ else if (strstr(buff, "opacity"))
+ opt.iOpacity = atoi(pch);
+ }
+ }
+ }
+
+ if (feof(fp)) break;
+ myfgets(buff, 1024, fp);
+ }
+}
+
+void ParseOtherPart(FILE *fp, char *buff)
+{
+ myfgets(buff, 1024, fp);
+ while (buff[0] != '[')
+ {
+ if (buff[0] != ';')
+ {
+ char *pch = strchr(buff, '=');
+ if (pch++)
+ {
+ while (pch && (*pch == ' ' || *pch == '\t'))
+ pch++;
+
+ if (pch)
+ {
+ if (strstr(buff, "enable-coloring"))
+ {
+ if (strstr(pch, "false"))
+ opt.iEnableColoring = -1;
+ }
+ }
+ }
+ }
+
+ if (feof(fp)) break;
+ myfgets(buff, 1024, fp);
+ }
+}
+
+void ParseSkinFile(char *szSkinName, bool bStartup, bool bOnlyPreview)
+{
+ char szDirSave[1024], buff[1024];
+
+ if (opt.skinMode == SM_OBSOLOTE && bStartup)
+ return;
+
+ if (!bStartup) opt.iEnableColoring = 0;
+ opt.szPreviewFile[0] = 0;
+
+ GetCurrentDirectoryA(1024, szDirSave);
+ SetCurrentDirectoryA(SKIN_FOLDER);
+ SetCurrentDirectoryA(szSkinName);
+
+ WIN32_FIND_DATAA ffd;
+ HANDLE hFind = FindFirstFileA("*.tsf", &ffd);
+ if (hFind != INVALID_HANDLE_VALUE)
+ {
+ FILE *fp = fopen(ffd.cFileName, "r");
+ if (fp)
+ {
+ myfgets(buff, 1024, fp);
+ while (!feof(fp))
+ {
+ if (buff[0] == '[')
+ {
+ if (!strcmp("[about]", buff))
+ {
+ ParseAboutPart(fp, buff, szSkinName);
+ continue;
+ }
+ else if (!strcmp("[other]", buff))
+ {
+ ParseOtherPart(fp, buff);
+ continue;
+ }
+ else if (!bOnlyPreview)
+ {
+ if (!strcmp("[background]", buff))
+ {
+ ParseImagePart(fp, buff, SKIN_ITEM_BG);
+ continue;
+ }
+ else if (!strcmp("[sidebar]", buff))
+ {
+ ParseImagePart(fp, buff, SKIN_ITEM_SIDEBAR);
+ continue;
+ }
+ else if (!bStartup && opt.bLoadFonts && !strcmp("[fonts]", buff))
+ {
+ ParseFontPart(fp, buff);
+ continue;
+ }
+ else if (!bStartup && opt.bLoadProportions && !strcmp("[appearance]", buff))
+ {
+ ParseAppearancePart(fp, buff);
+ continue;
+ }
+ }
+ }
+
+ myfgets(buff, 1024, fp);
+ }
+ fclose(fp);
+ }
+ }
+ else
+ {
+ opt.skinMode = SM_COLORFILL;
+ }
+
+ FindClose(hFind);
+ SetCurrentDirectoryA(szDirSave);
+}
\ No newline at end of file diff --git a/plugins/TipperYM/skin_parser.h b/plugins/TipperYM/skin_parser.h new file mode 100644 index 0000000000..35e5b552ab --- /dev/null +++ b/plugins/TipperYM/skin_parser.h @@ -0,0 +1,30 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _SKIN_INC
+#define _SKIN_INC
+
+typedef enum {
+ SM_COLORFILL = 0, SM_IMAGE = 1, SM_OBSOLOTE = 2
+} SkinMode;
+
+int RefreshSkinList(HWND hwndDlg);
+void ParseSkinFile(char *szSkinName, bool bStartup, bool bOnlyPreview);
+#endif
\ No newline at end of file diff --git a/plugins/TipperYM/str_utils.cpp b/plugins/TipperYM/str_utils.cpp new file mode 100644 index 0000000000..62d877f7e2 --- /dev/null +++ b/plugins/TipperYM/str_utils.cpp @@ -0,0 +1,265 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#include "common.h"
+#include "str_utils.h"
+
+int iCodePage = CP_ACP;
+
+bool a2w(const char *as, wchar_t *buff, int bufflen)
+{
+ if (as) MultiByteToWideChar(iCodePage, 0, as, -1, buff, bufflen);
+ return true;
+}
+
+bool w2a(const wchar_t *ws, char *buff, int bufflen)
+{
+ if (ws) WideCharToMultiByte(iCodePage, 0, ws, -1, buff, bufflen, 0, 0);
+ return true;
+}
+
+bool utf2w(const char *us, wchar_t *buff, int bufflen)
+{
+ if (us) MultiByteToWideChar(CP_UTF8, 0, us, -1, buff, bufflen);
+ return true;
+}
+
+bool w2utf(const wchar_t *ws, char *buff, int bufflen)
+{
+ if (ws) WideCharToMultiByte(CP_UTF8, 0, ws, -1, buff, bufflen, 0, 0);
+ return true;
+}
+
+bool a2utf(const char *as, char *buff, int bufflen)
+{
+ if (!as) return false;
+
+ wchar_t *ws = a2w(as);
+ if (ws) WideCharToMultiByte(CP_UTF8, 0, ws, -1, buff, bufflen, 0, 0);
+ mir_free(ws);
+ return true;
+}
+
+bool utf2a(const char *us, char *buff, int bufflen)
+{
+ if (!us) return false;
+
+ wchar_t *ws = utf2w(us);
+ if (ws) WideCharToMultiByte(iCodePage, 0, ws, -1, buff, bufflen, 0, 0);
+ mir_free(ws);
+ return true;
+}
+
+
+bool t2w(const TCHAR *ts, wchar_t *buff, int bufflen)
+{
+#ifdef _UNICODE
+ wcsncpy(buff, ts, bufflen);
+ return true;
+#else
+ return a2w(ts, buff, bufflen);
+#endif
+}
+
+bool w2t(const wchar_t *ws, TCHAR *buff, int bufflen)
+{
+#ifdef _UNICODE
+ wcsncpy(buff, ws, bufflen);
+ return true;
+#else
+ return w2a(ws, buff, bufflen);
+#endif
+}
+
+bool t2a(const TCHAR *ts, char *buff, int bufflen)
+{
+#ifdef _UNICODE
+ return w2a(ts, buff, bufflen);
+#else
+ strncpy(buff, ts, bufflen);
+ return true;
+#endif
+}
+
+bool a2t(const char *as, TCHAR *buff, int bufflen)
+{
+#ifdef _UNICODE
+ return a2w(as, buff, bufflen);
+#else
+ strncpy(buff, as, bufflen);
+ return true;
+#endif
+}
+
+bool t2utf(const TCHAR *ts, char *buff, int bufflen)
+{
+#ifdef _UNICODE
+ return w2utf(ts, buff, bufflen);
+#else
+ return a2utf(ts, buff, bufflen);
+#endif
+}
+
+bool utf2t(const char *us, TCHAR *buff, int bufflen)
+{
+#ifdef _UNICODE
+ return utf2w(us, buff, bufflen);
+#else
+ return utf2a(us, buff, bufflen);
+#endif
+}
+
+wchar_t *utf2w(const char *us)
+{
+ if (us)
+ {
+ int size = MultiByteToWideChar(CP_UTF8, 0, us, -1, 0, 0);
+ wchar_t *buff = (wchar_t *)mir_alloc(size * sizeof(wchar_t));
+ MultiByteToWideChar(CP_UTF8, 0, us, -1, buff, size);
+ return buff;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+char *w2utf(const wchar_t *ws)
+{
+ if (ws)
+ {
+ int size = WideCharToMultiByte(CP_UTF8, 0, ws, -1, 0, 0, 0, 0);
+ char *buff = (char *)mir_alloc(size);
+ WideCharToMultiByte(CP_UTF8, 0, ws, -1, buff, size, 0, 0);
+ return buff;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+wchar_t *a2w(const char *as)
+{
+ int size = MultiByteToWideChar(iCodePage, 0, as, -1, 0, 0);
+ wchar_t *buff = (wchar_t *)mir_alloc(size * sizeof(wchar_t));
+ MultiByteToWideChar(iCodePage, 0, as, -1, buff, size);
+ return buff;
+}
+
+char *w2a(const wchar_t *ws)
+{
+ int size = WideCharToMultiByte(iCodePage, 0, ws, -1, 0, 0, 0, 0);
+ char *buff = (char *)mir_alloc(size);
+ WideCharToMultiByte(iCodePage, 0, ws, -1, buff, size, 0, 0);
+ return buff;
+}
+
+char *utf2a(const char *utfs)
+{
+ wchar_t *ws = utf2w(utfs);
+ char *ret = w2a(ws);
+ mir_free(ws);
+ return ret;
+}
+
+char *a2utf(const char *as)
+{
+ wchar_t *ws = a2w(as);
+ char *ret = w2utf(ws);
+ mir_free(ws);
+ return ret;
+}
+
+TCHAR *w2t(const wchar_t *ws)
+{
+#ifdef _UNICODE
+ return mir_wstrdup(ws);
+#else
+ return w2a(ws);
+#endif
+}
+
+wchar_t *t2w(const TCHAR *ts)
+{
+#ifdef _UNICODE
+ return mir_tstrdup(ts);
+#else
+ return a2w(ts);
+#endif
+}
+
+
+char *t2a(const TCHAR *ts)
+{
+#ifdef _UNICODE
+ return w2a(ts);
+#else
+ return mir_strdup(ts);
+#endif
+}
+
+TCHAR *a2t(const char *as)
+{
+#ifdef _UNICODE
+ return a2w(as);
+#else
+ return mir_strdup(as);
+#endif
+}
+
+TCHAR *utf2t(const char *utfs)
+{
+#ifdef _UNICODE
+ return utf2w(utfs);
+#else
+ wchar_t *ws = utf2w(utfs);
+ char *ret = w2a(ws);
+ mir_free(ws);
+ return ret;
+#endif
+}
+
+char *t2utf(const TCHAR *ts)
+{
+#ifdef _UNICODE
+ return w2utf(ts);
+#else
+ wchar_t *ws = a2w(ts);
+ char *ret = w2utf(ws);
+ mir_free(ws);
+ return ret;
+#endif
+}
+
+char *myfgets(char *Buf, int MaxCount, FILE *File)
+{
+ fgets(Buf, MaxCount, File);
+ for (size_t i = strlen(Buf) - 1; i >= 0; i--)
+ {
+ if (Buf[i] == '\n' || Buf[i] == ' ')
+ Buf[i] = 0;
+ else
+ break;
+ }
+
+ CharLowerA(Buf);
+ return Buf;
+}
\ No newline at end of file diff --git a/plugins/TipperYM/str_utils.h b/plugins/TipperYM/str_utils.h new file mode 100644 index 0000000000..deedcacfa1 --- /dev/null +++ b/plugins/TipperYM/str_utils.h @@ -0,0 +1,66 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _STR_UTILS_INC
+#define _STR_UTILS_INC
+
+void set_codepage();
+
+bool a2w(const char *as, wchar_t *buff, int bufflen);
+bool w2a(const wchar_t *ws, char *buff, int bufflen);
+
+bool utf2w(const char *us, wchar_t *buff, int bufflen);
+bool w2utf(const wchar_t *ws, char *buff, int bufflen);
+
+bool a2utf(const char *as, char *buff, int bufflen);
+bool utf2a(const char *ws, char *buff, int bufflen);
+
+bool t2w(const TCHAR *ts, wchar_t *buff, int bufflen);
+bool w2t(const wchar_t *ws, TCHAR *buff, int bufflen);
+
+bool t2a(const TCHAR *ts, char *buff, int bufflen);
+bool a2t(const char *as, TCHAR *buff, int bufflen);
+
+bool t2utf(const TCHAR *ts, char *buff, int bufflen);
+bool utf2t(const char *us, TCHAR *buff, int bufflen);
+
+// remember to free return value
+wchar_t *a2w(const char *as);
+char *w2a(const wchar_t *ws);
+
+wchar_t *utf2w(const char *us);
+char *w2utf(const wchar_t *ws);
+
+char *utf2a(const char *us);
+char *a2utf(const char *as);
+
+wchar_t *t2w(const TCHAR *ts);
+TCHAR *w2t(const wchar_t *ws);
+
+TCHAR *utf2t(const char *us);
+char *t2utf(const TCHAR *ts);
+
+char *t2a(const TCHAR *ts);
+TCHAR *a2t(const char *as);
+
+char *myfgets(char *Buf, int MaxCount, FILE *File);
+
+#endif
+
diff --git a/plugins/TipperYM/subst.cpp b/plugins/TipperYM/subst.cpp new file mode 100644 index 0000000000..9932692876 --- /dev/null +++ b/plugins/TipperYM/subst.cpp @@ -0,0 +1,1015 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#include "common.h"
+#include "subst.h"
+#include "str_utils.h"
+#include "popwin.h"
+
+
+int ProtoServiceExists(const char *szModule, const char *szService)
+{
+ char str[MAXMODULELABELLENGTH];
+ strcpy(str,szModule);
+ strcat(str,szService);
+ return ServiceExists(str);
+}
+
+bool DBGetContactSettingAsString(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ DBVARIANT dbv;
+ buff[0] = 0;
+
+ if (!szModuleName || !szSettingName)
+ return false;
+
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ switch(dbv.type)
+ {
+ case DBVT_BYTE:
+ _itot(dbv.bVal, buff, 10);
+ break;
+ case DBVT_WORD:
+ _ltot(dbv.wVal, buff, 10);
+ break;
+ case DBVT_DWORD:
+ _ltot(dbv.dVal, buff, 10);
+ break;
+ case DBVT_ASCIIZ:
+ if (dbv.pszVal) a2t(dbv.pszVal, buff, bufflen);
+ buff[bufflen - 1] = 0;
+ break;
+ case DBVT_UTF8:
+ if (dbv.pszVal) utf2t(dbv.pszVal, buff, bufflen);
+ buff[bufflen - 1] = 0;
+ break;
+#ifdef _UNICODE
+ case DBVT_WCHAR:
+ if (dbv.pwszVal) wcsncpy(buff, dbv.pwszVal, bufflen);
+ buff[bufflen - 1] = 0;
+ break;
+#endif
+ }
+
+ DBFreeVariant(&dbv);
+ }
+
+ return buff[0] ? true : false;
+}
+
+void StripBBCodesInPlace(TCHAR *swzText)
+{
+ if (!DBGetContactSettingByte(0, MODULE, "StripBBCodes", 1))
+ return;
+
+ if (swzText == 0)
+ return;
+
+ size_t iRead = 0, iWrite = 0;
+ size_t iLen = _tcslen(swzText);
+
+ while(iRead <= iLen) // copy terminating null too
+ {
+ while(iRead <= iLen && swzText[iRead] != '[')
+ {
+ if (swzText[iRead] != swzText[iWrite]) swzText[iWrite] = swzText[iRead];
+ iRead++; iWrite++;
+ }
+
+ if (iRead > iLen)
+ break;
+
+ if (iLen - iRead >= 3 && (_tcsnicmp(swzText + iRead, _T("[b]"), 3) == 0 || _tcsnicmp(swzText + iRead, _T("[i]"), 3) == 0))
+ iRead += 3;
+ else if (iLen - iRead >= 4 && (_tcsnicmp(swzText + iRead, _T("[/b]"), 4) == 0 || _tcsnicmp(swzText + iRead, _T("[/i]"), 4) == 0))
+ iRead += 4;
+ else if (iLen - iRead >= 6 && (_tcsnicmp(swzText + iRead, _T("[color"), 6) == 0))
+ {
+ while(iRead < iLen && swzText[iRead] != ']') iRead++;
+ iRead++;// skip the ']'
+ }
+ else if (iLen - iRead >= 8 && (_tcsnicmp(swzText + iRead, _T("[/color]"), 8) == 0))
+ iRead += 8;
+ else if (iLen - iRead >= 5 && (_tcsnicmp(swzText + iRead, _T("[size"), 5) == 0))
+ {
+ while(iRead < iLen && swzText[iRead] != ']') iRead++;
+ iRead++;// skip the ']'
+ }
+ else if (iLen - iRead >= 7 && (_tcsnicmp(swzText + iRead, _T("[/size]"), 7) == 0))
+ iRead += 7;
+ else
+ {
+ if (swzText[iRead] != swzText[iWrite]) swzText[iWrite] = swzText[iRead];
+ iRead++; iWrite++;
+ }
+ }
+}
+
+DWORD LastMessageTimestamp(HANDLE hContact)
+{
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+ HANDLE hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hContact, 0);
+ while (hDbEvent)
+ {
+ dbei.cbBlob = 0;
+ CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
+ if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT))
+ break;
+
+ hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hDbEvent, 0);
+ }
+
+ if (hDbEvent)
+ return dbei.timestamp;
+
+ return 0;
+}
+
+void FormatTimestamp(DWORD ts, char *szFormat, TCHAR *buff, int bufflen)
+{
+ TCHAR swzForm[16];
+ DBTIMETOSTRINGT dbt = {0};
+ dbt.cbDest = bufflen;
+ dbt.szDest = buff;
+ a2t(szFormat, swzForm, 16);
+ dbt.szFormat = swzForm;
+ CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt);
+}
+
+bool Uid(HANDLE hContact, char *szProto, TCHAR *buff, int bufflen)
+{
+ char *tmpProto = NULL;
+
+ if (hContact) tmpProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact, 0);
+ else tmpProto = szProto;
+
+ if (tmpProto)
+ {
+ char *szUid = (char *)CallProtoService(tmpProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
+ if (szUid && (INT_PTR)szUid != CALLSERVICE_NOTFOUND)
+ return DBGetContactSettingAsString(hContact, tmpProto, szUid, buff, bufflen);
+ }
+
+ return false;
+}
+
+bool UidName(char *szProto, TCHAR *buff, int bufflen)
+{
+ if (szProto)
+ {
+ char *szUidName = (char *)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDTEXT, 0);
+ if (szUidName && (INT_PTR)szUidName != CALLSERVICE_NOTFOUND)
+ {
+ a2t(szUidName, buff, bufflen);
+ return true;
+ }
+ }
+ return false;
+}
+
+TCHAR *GetLastMessageText(HANDLE hContact)
+{
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+
+ HANDLE hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hContact, 0);
+ while (hDbEvent)
+ {
+ dbei.cbBlob = 0;
+ CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
+ if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT))
+ break;
+
+ hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hDbEvent, 0);
+ }
+
+ if (hDbEvent)
+ {
+ dbei.pBlob = (BYTE *)alloca(dbei.cbBlob);
+ CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
+
+ if (dbei.cbBlob == 0 || dbei.pBlob == 0)
+ return 0;
+
+ TCHAR *buff = DbGetEventTextT( &dbei, CP_ACP );
+ TCHAR *swzMsg = mir_tstrdup(buff);
+ mir_free(buff);
+
+ StripBBCodesInPlace(swzMsg);
+ return swzMsg;
+ }
+
+ return 0;
+}
+
+bool CanRetrieveStatusMsg(HANDLE hContact, char *szProto)
+{
+ if (opt.bGetNewStatusMsg)
+ {
+ int iFlags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0);
+ WORD wStatus = DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ if ((CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) && (iFlags & Proto_Status2Flag(wStatus)))
+ {
+ iFlags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & (PF1_VISLIST | PF1_INVISLIST);
+ if (opt.bDisableIfInvisible && iFlags)
+ {
+ int iVisMode = DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0);
+ int wProtoStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ if ((iVisMode == ID_STATUS_OFFLINE) || (wProtoStatus == ID_STATUS_INVISIBLE && iVisMode != ID_STATUS_ONLINE))
+ return false;
+ else
+ return true;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ return false;
+}
+
+TCHAR *GetStatusMessageText(HANDLE hContact)
+{
+ TCHAR *swzMsg = 0;
+ DBVARIANT dbv;
+
+ char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (szProto)
+ {
+ if (!strcmp(szProto, szMetaModuleName))
+ {
+ hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ }
+ else
+ {
+ WORD wStatus = (int)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
+ if (wStatus == ID_STATUS_OFFLINE)
+ return NULL;
+
+ if (!DBGetContactSettingTString(hContact, MODULE, "TempStatusMsg", &dbv))
+ {
+ if (_tcslen(dbv.ptszVal) != 0)
+ swzMsg = mir_tstrdup(dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ }
+ }
+
+ if (!swzMsg)
+ {
+ if (CanRetrieveStatusMsg(hContact, szProto))
+ {
+ if (CallContactService(hContact, PSS_GETAWAYMSG, 0, 0))
+ return NULL;
+ }
+
+ if (!DBGetContactSettingTString(hContact, "CList", "StatusMsg", &dbv))
+ {
+ if (dbv.ptszVal && _tcslen(dbv.ptszVal) != 0)
+ swzMsg = mir_tstrdup(dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ }
+ }
+ }
+
+ if (swzMsg)
+ StripBBCodesInPlace(swzMsg);
+
+ return swzMsg;
+}
+
+bool GetSysSubstText(HANDLE hContact, TCHAR *swzRawSpec, TCHAR *buff, int bufflen)
+{
+ if (!_tcscmp(swzRawSpec, _T("uid")))
+ {
+ return Uid(hContact, 0, buff, bufflen);
+ }
+ else if (!_tcscmp(swzRawSpec, _T("proto")))
+ {
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (szProto)
+ {
+ a2t(szProto, buff, bufflen);
+ return true;
+ }
+ }
+ else if (!_tcscmp(swzRawSpec, _T("account")))
+ {
+ char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, (WPARAM)hContact, 0);
+ if ((INT_PTR)szProto == CALLSERVICE_NOTFOUND)
+ {
+ return GetSysSubstText(hContact, _T("proto"), buff, bufflen);
+ }
+ else if (szProto)
+ {
+ PROTOACCOUNT *pa = ProtoGetAccount(szProto);
+ if (pa && pa->tszAccountName)
+ {
+ _tcsncpy(buff, pa->tszAccountName, bufflen);
+ return true;
+ }
+ else
+ return GetSysSubstText(hContact, _T("proto"), buff, bufflen);
+ }
+ }
+ else if (!_tcscmp(swzRawSpec, _T("time")))
+ {
+ if (tmi.printDateTime && !tmi.printDateTimeByContact(hContact, _T("t"), buff, bufflen, TZF_KNOWNONLY))
+ return true;
+ }
+ else if (!_tcscmp(swzRawSpec, _T("uidname")))
+ {
+ char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ return UidName(szProto, buff, bufflen);
+ }
+ else if (!_tcscmp(swzRawSpec, _T("status_msg")))
+ {
+ TCHAR *swzMsg = GetStatusMessageText(hContact);
+ if (swzMsg)
+ {
+ _tcsncpy(buff, swzMsg, bufflen);
+ mir_free(swzMsg);
+ return true;
+ }
+ }
+ else if (!_tcscmp(swzRawSpec, _T("last_msg")))
+ {
+ TCHAR *swzMsg = GetLastMessageText(hContact);
+ if (swzMsg)
+ {
+ _tcsncpy(buff, swzMsg, bufflen);
+ mir_free(swzMsg);
+ return true;
+ }
+ }
+ else if (!_tcscmp(swzRawSpec, _T("meta_subname")))
+ {
+ // get contact list name of active subcontact
+ HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ if (!hSubContact || (INT_PTR)hSubContact == CALLSERVICE_NOTFOUND) return false;
+ TCHAR *swzNick = (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hSubContact, GCDNF_TCHAR);
+ if (swzNick) _tcsncpy(buff, swzNick, bufflen);
+ return true;
+ }
+ else if (!_tcscmp(swzRawSpec, _T("meta_subuid")))
+ {
+ HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ if (!hSubContact || (INT_PTR)hSubContact == CALLSERVICE_NOTFOUND) return false;
+ return Uid(hSubContact, 0, buff, bufflen);
+ }
+ else if (!_tcscmp(swzRawSpec, _T("meta_subproto")))
+ {
+ // get protocol of active subcontact
+ HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ if (!hSubContact || (INT_PTR)hSubContact == CALLSERVICE_NOTFOUND)
+ return false;
+ return GetSysSubstText(hSubContact, _T("account"), buff, bufflen);
+ }
+ else if (!_tcscmp(swzRawSpec, _T("last_msg_time")))
+ {
+ DWORD ts = LastMessageTimestamp(hContact);
+ if (ts == 0) return false;
+ FormatTimestamp(ts, "t", buff, bufflen);
+ return true;
+ }
+ else if (!_tcscmp(swzRawSpec, _T("last_msg_date")))
+ {
+ DWORD ts = LastMessageTimestamp(hContact);
+ if (ts == 0) return false;
+ FormatTimestamp(ts, "d", buff, bufflen);
+ return true;
+ }
+ else if (!_tcscmp(swzRawSpec, _T("last_msg_reltime")))
+ {
+ DWORD ts = LastMessageTimestamp(hContact);
+ if (ts == 0) return false;
+ DWORD t = (DWORD)time(0);
+ DWORD diff = (t - ts);
+ int d = (diff / 60 / 60 / 24);
+ int h = (diff - d * 60 * 60 * 24) / 60 / 60;
+ int m = (diff - d * 60 * 60 * 24 - h * 60 * 60) / 60;
+ if (d > 0) mir_sntprintf(buff, bufflen, TranslateT("%dd %dh %dm"), d, h, m);
+ else if (h > 0) mir_sntprintf(buff, bufflen, TranslateT("%dh %dm"), h, m);
+ else mir_sntprintf(buff, bufflen, TranslateT("%dm"), m);
+ return true;
+ }
+ else if (!_tcscmp(swzRawSpec, _T("msg_count_all")) || !_tcscmp(swzRawSpec, _T("msg_count_out")) || !_tcscmp(swzRawSpec, _T("msg_count_in")))
+ {
+ DWORD dwCountOut, dwCountIn;
+ DWORD dwMetaCountOut = 0, dwMetaCountIn = 0;
+ DWORD dwLastTs, dwNewTs, dwRecountTs;
+ DWORD dwTime, dwDiff;
+ int iNumber = 1;
+ HANDLE hTmpContact = hContact;
+
+ char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (szProto && !strcmp(szProto, szMetaModuleName))
+ {
+ iNumber = CallService(MS_MC_GETNUMCONTACTS, (WPARAM)hContact, 0);
+ hTmpContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, 0);
+ }
+
+ for (int i = 0; i < iNumber; i++)
+ {
+ if (i > 0) hTmpContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, i);
+ dwRecountTs = DBGetContactSettingDword(hTmpContact, MODULE, "LastCountTS", 0);
+ dwTime = (DWORD)time(0);
+ dwDiff = (dwTime - dwRecountTs);
+ if (dwDiff > (60 * 60 * 24 * 3))
+ {
+ DBWriteContactSettingDword(hTmpContact, MODULE, "LastCountTS", dwTime);
+ dwCountOut = dwCountIn = dwLastTs = 0;
+ }
+ else
+ {
+ dwCountOut = DBGetContactSettingDword(hTmpContact, MODULE, "MsgCountOut", 0);
+ dwCountIn = DBGetContactSettingDword(hTmpContact, MODULE, "MsgCountIn", 0);
+ dwLastTs = DBGetContactSettingDword(hTmpContact, MODULE, "LastMsgTS", 0);
+ }
+
+ dwNewTs = dwLastTs;
+
+ HANDLE dbe = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hTmpContact, 0);
+ while (dbe != NULL)
+ {
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+ if (!CallService(MS_DB_EVENT_GET, (WPARAM)dbe, (LPARAM)&dbei))
+ {
+ if (dbei.eventType == EVENTTYPE_MESSAGE)
+ {
+ dwNewTs = max(dwNewTs, dbei.timestamp);
+ if (dbei.timestamp > dwLastTs)
+ {
+ if (dbei.flags & DBEF_SENT) dwCountOut++;
+ else dwCountIn++;
+ }
+ else
+ break;
+ }
+ }
+ dbe = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)dbe, 0);
+ }
+
+ if (dwNewTs > dwLastTs)
+ {
+ DBWriteContactSettingDword(hTmpContact, MODULE, "MsgCountOut", dwCountOut);
+ DBWriteContactSettingDword(hTmpContact, MODULE, "MsgCountIn", dwCountIn);
+ DBWriteContactSettingDword(hTmpContact, MODULE, "LastMsgTS", dwNewTs);
+ }
+
+ dwMetaCountOut += dwCountOut;
+ dwMetaCountIn += dwCountIn;
+ }
+
+ if (!_tcscmp(swzRawSpec, _T("msg_count_out")))
+ mir_sntprintf(buff, bufflen, _T("%d"), dwMetaCountOut);
+ else if (!_tcscmp(swzRawSpec, _T("msg_count_in")))
+ mir_sntprintf(buff, bufflen, _T("%d"), dwMetaCountIn);
+ else
+ mir_sntprintf(buff, bufflen, _T("%d"), dwMetaCountOut + dwMetaCountIn);
+ return true;
+ }
+
+ return false;
+}
+
+bool GetSubstText(HANDLE hContact, const DISPLAYSUBST &ds, TCHAR *buff, int bufflen)
+{
+ TranslateFunc *transFunc = 0;
+ for (int i = 0; i < iTransFuncsCount; i++)
+ {
+ if (translations[i].id == (DWORD)ds.iTranslateFuncId)
+ {
+ transFunc = translations[i].transFunc;
+ break;
+ }
+ }
+
+ if (!transFunc)
+ return false;
+
+ switch (ds.type)
+ {
+ case DVT_DB:
+ return transFunc(hContact, ds.szModuleName, ds.szSettingName, buff, bufflen) != 0;
+ case DVT_PROTODB:
+ {
+ char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (szProto)
+ {
+ if (transFunc(hContact, szProto, ds.szSettingName, buff, bufflen) != 0)
+ return true;
+ else
+ return transFunc(hContact, "UserInfo", ds.szSettingName, buff, bufflen) != 0;
+ }
+ break;
+ }
+ }
+ return false;
+}
+
+bool GetRawSubstText(HANDLE hContact, char *szRawSpec, TCHAR *buff, int bufflen)
+{
+ size_t lenght = strlen(szRawSpec);
+ for (size_t i = 0; i < lenght; i++)
+ {
+ if (szRawSpec[i] == '/')
+ {
+ szRawSpec[i] = 0;
+ if (strlen(szRawSpec) == 0)
+ {
+ char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (szProto)
+ {
+ if (translations[0].transFunc(hContact, szProto, &szRawSpec[i + 1], buff, bufflen) != 0)
+ return true;
+ else
+ return translations[0].transFunc(hContact, "UserInfo", &szRawSpec[i + 1], buff, bufflen) != 0;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return translations[0].transFunc(hContact, szRawSpec, &szRawSpec[i + 1], buff, bufflen) != 0;
+ }
+ }
+ }
+ return false;
+}
+
+bool ApplySubst(HANDLE hContact, const TCHAR *swzSource, bool parseTipperVarsFirst, TCHAR *swzDest, int iDestLen)
+{
+ // hack - allow empty strings before passing to variables (note - zero length strings return false after this)
+ if (swzDest && swzSource && _tcslen(swzSource) == 0)
+ {
+ swzDest[0] = 0;
+ return true;
+ }
+
+ // pass to variables plugin if available
+ TCHAR *swzVarSrc;
+ if (parseTipperVarsFirst == false)
+ swzVarSrc = variables_parsedup((TCHAR *)swzSource, 0, hContact);
+ else
+ swzVarSrc = _tcsdup(swzSource);
+
+ size_t iSourceLen = _tcslen(swzVarSrc);
+ size_t si = 0, di = 0, v = 0;
+
+ TCHAR swzVName[LABEL_LEN];
+ TCHAR swzRep[VALUE_LEN], swzAlt[VALUE_LEN];
+ while (si < iSourceLen && di < (size_t)iDestLen - 1)
+ {
+ if (swzVarSrc[si] == _T('%'))
+ {
+ si++;
+ v = 0;
+ while (si < iSourceLen && v < LABEL_LEN)
+ {
+ if (swzVarSrc[si] == _T('%'))
+ {
+ // two %'s in a row in variable name disabled: e.g. %a%%b% - this is atbbguous]
+ //if (si + 1 < iSourceLen && swzVarSrc[si + 1] == _T('%')) {
+ // si++; // skip first %, allow following code to add the second one to the variable name
+ //} else
+ break;
+ }
+ swzVName[v] = swzVarSrc[si];
+ v++; si++;
+ }
+
+ if (v == 0) // bSubst len is 0 - just a % symbol
+ {
+ swzDest[di] = _T('%');
+ }
+ else if (si < iSourceLen) // we found end %
+ {
+ swzVName[v] = 0;
+
+ bool bAltSubst = false;
+ bool bSubst = false;
+
+ // apply only to specific protocols
+ TCHAR *p = _tcsrchr(swzVName, _T('^')); // use last '^', so if you want a ^ in swzAlt text, you can just put a '^' on the end
+ if (p)
+ {
+ *p = 0;
+ p++;
+ if (*p)
+ {
+ char *cp = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (cp != NULL)
+ {
+ PROTOACCOUNT *acc = ProtoGetAccount(cp);
+ if (acc != NULL)
+ {
+ cp = acc->szProtoName;
+ }
+ }
+
+ if (cp == NULL)
+ goto empty;
+
+ bool negate = false;
+ if (*p == _T('!'))
+ {
+ p++;
+ if (*p == 0) goto error;
+ negate = true;
+ }
+
+ char sproto[256];
+ bool spec = false;
+ int len;
+
+ TCHAR *last = _tcsrchr(p, _T(','));
+ if (!last) last = p;
+
+ while (p <= last + 1)
+ {
+ len = (int)_tcscspn(p, _T(","));
+ t2a(p, sproto, len);
+ sproto[len] = 0;
+ p += len + 1;
+
+ if (_stricmp(cp, sproto) == 0)
+ {
+ spec = true;
+ break;
+ }
+ }
+
+ if (negate ? spec : !spec)
+ goto empty;
+ }
+ }
+
+ // get alternate text, if bSubst fails
+ swzAlt[0] = 0;
+ p = _tcschr(swzVName, _T('|')); // use first '|' - so you can use the '|' symbol in swzAlt text
+ if (p)
+ {
+ *p = 0; // clip swzAlt from swzVName
+ p++;
+ if (_tcslen(p) > 4 && _tcsncmp(p, _T("raw:"), 4) == 0) // raw db substitution
+ {
+ char raw_spec[LABEL_LEN];
+ p += 4;
+ t2a(p, raw_spec, LABEL_LEN);
+ GetRawSubstText(hContact, raw_spec, swzAlt, VALUE_LEN);
+ }
+ else if (_tcslen(p) > 4 && _tcsncmp(p, _T("sys:"), 4) == 0) // 'system' substitution
+ {
+ p += 4;
+ GetSysSubstText(hContact, p, swzAlt, VALUE_LEN);
+ }
+ else
+ {
+ // see if we can find the bSubst
+ DSListNode *ds_node = opt.dsList;
+ while(ds_node)
+ {
+ if (_tcscmp(ds_node->ds.swzName, p) == 0)
+ break;
+
+ ds_node = ds_node->next;
+ }
+
+ if (ds_node)
+ {
+ GetSubstText(hContact, ds_node->ds, swzAlt, VALUE_LEN);
+ }
+ else
+ {
+ _tcsncpy(swzAlt, p, VALUE_LEN);
+ bAltSubst = true;
+ }
+ }
+ swzAlt[VALUE_LEN - 1] = 0;
+ if (_tcslen(swzAlt) != 0)
+ bAltSubst = true;
+ }
+
+ // get bSubst text
+ if (v > 4 && _tcsncmp(swzVName, _T("raw:"), 4) == 0) // raw db substitution
+ {
+ char raw_spec[LABEL_LEN];
+ t2a(&swzVName[4], raw_spec, LABEL_LEN);
+ bSubst = GetRawSubstText(hContact, raw_spec, swzRep, VALUE_LEN);
+ }
+ else if (v > 4 && _tcsncmp(swzVName, _T("sys:"), 4) == 0) // 'system' substitution
+ {
+ bSubst = GetSysSubstText(hContact, &swzVName[4], swzRep, VALUE_LEN);
+ }
+ else
+ {
+ // see if we can find the bSubst
+ DSListNode *ds_node = opt.dsList;
+ while(ds_node)
+ {
+ if (_tcscmp(ds_node->ds.swzName, swzVName) == 0)
+ break;
+
+ ds_node = ds_node->next;
+ }
+
+ if (!ds_node)
+ goto error; // no such bSubst
+
+ bSubst = GetSubstText(hContact, ds_node->ds, swzRep, VALUE_LEN);
+ }
+
+ if (bSubst)
+ {
+ size_t rep_len = _tcslen(swzRep);
+ _tcsncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di));
+ di += rep_len - 1; // -1 because we inc at bottom of loop
+ }
+ else if (bAltSubst)
+ {
+ size_t alt_len = _tcslen(swzAlt);
+ _tcsncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di));
+ di += alt_len - 1; // -1 because we inc at bottom of loop
+ }
+ else
+ {
+ goto empty; // empty value
+ }
+
+ }
+ else // no end % - error
+ {
+ goto error;
+ }
+ }
+ else
+ {
+ swzDest[di] = swzVarSrc[si];
+ }
+
+ si++;
+ di++;
+ }
+
+ free(swzVarSrc);
+ swzDest[di] = 0;
+
+ if (parseTipperVarsFirst)
+ {
+ swzVarSrc = variables_parsedup((TCHAR *)swzDest, 0, hContact);
+ _tcscpy(swzDest, swzVarSrc);
+ free(swzVarSrc);
+ }
+
+
+ // check for a 'blank' string - just spaces etc
+ for (si = 0; si <= di; si++)
+ {
+ if (swzDest[si] != 0 && swzDest[si] != _T(' ') && swzDest[si] != _T('\t') && swzDest[si] != _T('\r') && swzDest[si] != _T('\n'))
+ return true;
+ }
+
+ return false;
+
+empty:
+ free(swzVarSrc);
+ return false;
+
+error:
+ swzDest[0] = _T('*');
+ swzDest[1] = 0;
+ free(swzVarSrc);
+ return true;
+}
+
+bool GetLabelText(HANDLE hContact, const DISPLAYITEM &di, TCHAR *buff, int bufflen)
+{
+ return ApplySubst(hContact, di.swzLabel, false, buff, bufflen);
+}
+
+bool GetValueText(HANDLE hContact, const DISPLAYITEM &di, TCHAR *buff, int bufflen)
+{
+ return ApplySubst(hContact, di.swzValue, di.bParseTipperVarsFirst, buff, bufflen);
+}
+
+void TruncateString(TCHAR *swzText)
+{
+ if (swzText && opt.iLimitCharCount > 3)
+ {
+ if ((int)_tcslen(swzText) > opt.iLimitCharCount)
+ {
+ swzText[opt.iLimitCharCount - 3] = 0;
+ _tcscat(swzText, _T("..."));
+ }
+ }
+}
+
+TCHAR *GetProtoStatusMessage(char *szProto, WORD wStatus)
+{
+ TCHAR *swzText = NULL;
+ char *tmpMsg = NULL;
+
+ if (!szProto || wStatus == ID_STATUS_OFFLINE)
+ return NULL;
+
+ // check if protocol supports status message for status
+ int flags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0);
+ if (!(flags & Proto_Status2Flag(wStatus)))
+ return NULL;
+
+ swzText = (TCHAR *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
+ if ((INT_PTR)swzText != CALLSERVICE_NOTFOUND)
+ {
+ if (swzText == NULL)
+ tmpMsg = (char *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, 0);
+ }
+ else
+ {
+ tmpMsg = (char *)CallService(MS_AWAYMSG_GETSTATUSMSG, wStatus, 0);
+ swzText = NULL;
+ }
+
+ if (tmpMsg && (INT_PTR)tmpMsg != CALLSERVICE_NOTFOUND)
+ {
+ swzText = mir_a2t(tmpMsg);
+ mir_free(tmpMsg);
+ }
+
+ if (swzText && !swzText[0])
+ {
+ mir_free(swzText);
+ swzText = NULL;
+ }
+
+ if (swzText && opt.bLimitMsg)
+ TruncateString(swzText);
+
+ return swzText;
+}
+
+TCHAR *GetProtoExtraStatusTitle(char *szProto)
+{
+ DBVARIANT dbv;
+ TCHAR *swzText = NULL;
+
+ if (!szProto)
+ return NULL;
+
+ if (!DBGetContactSettingTString(0, szProto, "XStatusName", &dbv))
+ {
+ if (_tcslen(dbv.ptszVal) != 0)
+ swzText = mir_tstrdup(dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ }
+
+ if (!swzText)
+ {
+ TCHAR buff[256];
+ if (EmptyXStatusToDefaultName(0, szProto, 0, buff, 256))
+ swzText = mir_tstrdup(buff);
+ }
+
+ if (opt.bLimitMsg)
+ TruncateString(swzText);
+
+ return swzText;
+}
+
+TCHAR *GetProtoExtraStatusMessage(char *szProto)
+{
+ DBVARIANT dbv;
+ TCHAR *swzText = NULL;
+
+ if (!szProto)
+ return NULL;
+
+ if (!DBGetContactSettingTString(0, szProto, "XStatusMsg", &dbv))
+ {
+ if (_tcslen(dbv.ptszVal) != 0)
+ swzText = mir_tstrdup(dbv.ptszVal);
+ DBFreeVariant(&dbv);
+
+ if (ServiceExists(MS_VARS_FORMATSTRING))
+ {
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ while(!proto)
+ {
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ if (hContact)
+ {
+ proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ }
+ else
+ {
+ hContact = NULL;
+ break;
+ }
+ }
+
+ TCHAR *tszParsed = (TCHAR *)variables_parse(swzText, NULL, hContact);
+ if (tszParsed)
+ {
+ mir_free(swzText);
+ swzText = mir_tstrdup(tszParsed);
+ variables_free(tszParsed);
+ }
+ }
+ }
+
+ if (opt.bLimitMsg)
+ TruncateString(swzText);
+
+ return swzText;
+}
+
+TCHAR *GetListeningTo(char *szProto)
+{
+ DBVARIANT dbv;
+ TCHAR *swzText = NULL;
+
+ if (!szProto)
+ return NULL;
+
+ if (!DBGetContactSettingTString(0, szProto, "ListeningTo", &dbv))
+ {
+ if (_tcslen(dbv.ptszVal) != 0)
+ swzText = mir_tstrdup(dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ }
+
+ if (opt.bLimitMsg)
+ TruncateString(swzText);
+
+ return swzText;
+}
+
+TCHAR *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue)
+{
+ DBVARIANT dbv;
+ TCHAR *swzText = NULL;
+ char szSetting[128];
+
+ if (!szProto)
+ return NULL;
+
+ mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, szSlot, szValue);
+ if (!DBGetContactSettingTString(0, "AdvStatus", szSetting, &dbv))
+ {
+ if (_tcslen(dbv.ptszVal) != 0)
+ swzText = mir_tstrdup(dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ }
+
+ if (opt.bLimitMsg)
+ TruncateString(swzText);
+
+ return swzText;
+}
+
+HICON GetJabberActivityIcon(HANDLE hContact, char *szProto)
+{
+ DBVARIANT dbv;
+ HICON hIcon = NULL;
+ char szSetting[128];
+
+ if (!szProto)
+ return NULL;
+
+ mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, "activity", "icon");
+ if (!DBGetContactSettingString(hContact, "AdvStatus", szSetting, &dbv))
+ {
+ hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+
+ return hIcon;
+}
\ No newline at end of file diff --git a/plugins/TipperYM/subst.h b/plugins/TipperYM/subst.h new file mode 100644 index 0000000000..41f66f871a --- /dev/null +++ b/plugins/TipperYM/subst.h @@ -0,0 +1,47 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _SUBST_INC
+#define _SUBST_INC
+
+#include "options.h"
+#include "translations.h"
+
+bool GetLabelText(HANDLE hContact, const DISPLAYITEM &di, TCHAR *buff, int iBufflen);
+bool GetValueText(HANDLE hContact, const DISPLAYITEM &di, TCHAR *buff, int iBufflen);
+
+void StripBBCodesInPlace(TCHAR *text);
+int ProtoServiceExists(const char *szModule, const char *szService);
+
+// can be used with hContact == 0 to get uid for a given proto
+bool UidName(char *szProto, TCHAR *buff, int bufflen);
+bool Uid(HANDLE hContact, char *szProto, TCHAR *buff, int bufflen);
+
+// get info for status and tray tooltip
+bool DBGetContactSettingAsString(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+bool CanRetrieveStatusMsg(HANDLE hContact, char *szProto);
+TCHAR *GetProtoStatusMessage(char *szProto, WORD status);
+TCHAR *GetProtoExtraStatusTitle(char *szProto);
+TCHAR *GetProtoExtraStatusMessage(char *szProto);
+TCHAR *GetListeningTo(char *szProto);
+TCHAR *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue);
+HICON GetJabberActivityIcon(HANDLE hContact, char *szProto);
+
+#endif
diff --git a/plugins/TipperYM/tipper.cpp b/plugins/TipperYM/tipper.cpp new file mode 100644 index 0000000000..0c1f21f9bf --- /dev/null +++ b/plugins/TipperYM/tipper.cpp @@ -0,0 +1,402 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#include "common.h"
+#include "version.h"
+#include "message_pump.h"
+#include "options.h"
+#include "popwin.h"
+#include "skin_parser.h"
+#include "str_utils.h"
+
+HMODULE hInst;
+PLUGINLINK *pluginLink;
+char szMetaModuleName[256] = {0};
+
+FontIDT fontTitle, fontLabels, fontValues, fontTrayTitle;
+ColourIDT colourBg, colourBorder, colourAvatarBorder, colourDivider, colourSidebar;
+HFONT hFontTitle, hFontLabels, hFontValues, hFontTrayTitle;
+
+// hooked here so it's in the main thread
+HANDLE hAvChangeEvent, hShowTipEvent, hHideTipEvent, hAckEvent, hFramesSBShow, hFramesSBHide;
+HANDLE hSettingChangedEvent, hEventDeleted;
+HANDLE hShowTipService, hShowTipWService, hHideTipService;
+
+HANDLE hFolderChanged, hSkinFolder;
+char SKIN_FOLDER[256];
+
+FI_INTERFACE *fii = NULL;
+MM_INTERFACE mmi;
+LIST_INTERFACE li;
+TIME_API tmi;
+
+PLUGININFOEX pluginInfoEx =
+{
+ sizeof(PLUGININFOEX),
+#ifdef _WIN64
+ "Tipper YM x64",
+#else
+ "Tipper YM",
+#endif
+ __VERSION_DWORD,
+ "Tool Tip notification windows",
+ "Scott Ellis, yaho",
+ "yaho@miranda-easy.net",
+ "© 2005-2007 Scott Ellis, 2007-2011 Jan Holub",
+ "http://miranda-easy.net/mods.php",
+ UNICODE_AWARE,
+ 0, //doesn't replace anything built-in
+ MIID_TIPPER
+};
+
+extern "C" bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ hInst = hinstDLL;
+ DisableThreadLibraryCalls(hInst);
+ return TRUE;
+}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ return &pluginInfoEx;
+}
+
+static const MUUID interfaces[] = {MIID_TOOLTIPS, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+{
+ return interfaces;
+}
+
+int ReloadFont(WPARAM wParam, LPARAM lParam)
+{
+ LOGFONT logFont;
+ if (hFontTitle) DeleteObject(hFontTitle);
+ opt.colTitle = CallService(MS_FONT_GETT, (WPARAM)&fontTitle, (LPARAM)&logFont);
+ hFontTitle = CreateFontIndirect(&logFont);
+ if (hFontLabels) DeleteObject(hFontLabels);
+ opt.colLabel = CallService(MS_FONT_GETT, (WPARAM)&fontLabels, (LPARAM)&logFont);
+ hFontLabels = CreateFontIndirect(&logFont);
+ if (hFontValues) DeleteObject(hFontValues);
+ opt.colValue = CallService(MS_FONT_GETT, (WPARAM)&fontValues, (LPARAM)&logFont);
+ hFontValues = CreateFontIndirect(&logFont);
+ if (hFontTrayTitle) DeleteObject(hFontTrayTitle);
+ opt.colTrayTitle = CallService(MS_FONT_GETT, (WPARAM)&fontTrayTitle, (LPARAM)&logFont);
+ hFontTrayTitle = CreateFontIndirect(&logFont);
+
+ opt.colBg = CallService(MS_COLOUR_GETT, (WPARAM)&colourBg, 0);
+ opt.colBorder = CallService(MS_COLOUR_GETT, (WPARAM)&colourBorder, 0);
+ opt.colAvatarBorder = CallService(MS_COLOUR_GETT, (WPARAM)&colourAvatarBorder, 0);
+ opt.colSidebar = CallService(MS_COLOUR_GETT, (WPARAM)&colourSidebar, 0);
+ opt.colDivider = CallService(MS_COLOUR_GETT, (WPARAM)&colourDivider, 0);
+
+ return 0;
+}
+
+
+// hack to hide tip when clist hides from timeout
+int SettingChanged(WPARAM wParam, LPARAM lParam)
+{
+ DBCONTACTWRITESETTING *dcws = (DBCONTACTWRITESETTING *)lParam;
+ if (strcmp(dcws->szModule, "CList") != 0 || strcmp(dcws->szSetting, "State") != 0)
+ return 0;
+
+ // clist hiding
+ if (dcws->value.type == DBVT_BYTE && dcws->value.bVal == 0)
+ HideTip(0, 0);
+
+ return 0;
+}
+
+// needed for msg_count_xxx substitutions
+int EventDeleted(WPARAM wParam, LPARAM lParam)
+{
+ DBEVENTINFO dbei = {0};
+ dbei.cbSize = sizeof(dbei);
+ if (!CallService(MS_DB_EVENT_GET, lParam, (LPARAM)&dbei))
+ {
+ if (dbei.eventType == EVENTTYPE_MESSAGE)
+ DBDeleteContactSetting((HANDLE)wParam, MODULE, "LastCountTS");
+ }
+
+ return 0;
+}
+
+int ReloadSkinFolder(WPARAM wParam, LPARAM lParam)
+{
+ FoldersGetCustomPath(hSkinFolder, SKIN_FOLDER, sizeof(SKIN_FOLDER), DEFAULT_SKIN_FOLDER);
+ return 0;
+}
+
+void InitFonts()
+{
+ colourBg.cbSize = sizeof(ColourIDT);
+ _tcscpy(colourBg.group, LPGENT("Tooltips"));
+ _tcscpy(colourBg.name, LPGENT("Background"));
+ strcpy(colourBg.dbSettingsGroup, MODULE);
+ strcpy(colourBg.setting, "ColourBg");
+ colourBg.defcolour = RGB(219, 219, 219);
+ colourBg.order = 0;
+
+ colourBorder.cbSize = sizeof(ColourIDT);
+ _tcscpy(colourBorder.group, LPGENT("Tooltips"));
+ _tcscpy(colourBorder.name, LPGENT("Border"));
+ strcpy(colourBorder.dbSettingsGroup, MODULE);
+ strcpy(colourBorder.setting, "BorderCol");
+ colourBorder.defcolour = 0;
+ colourBorder.order = 0;
+
+ colourAvatarBorder.cbSize = sizeof(ColourIDT);
+ _tcscpy(colourAvatarBorder.group, LPGENT("Tooltips"));
+ _tcscpy(colourAvatarBorder.name, LPGENT("Avatar border"));
+ strcpy(colourAvatarBorder.dbSettingsGroup, MODULE);
+ strcpy(colourAvatarBorder.setting, "AvBorderCol");
+ colourAvatarBorder.defcolour = 0;
+ colourAvatarBorder.order = 0;
+
+ colourDivider.cbSize = sizeof(ColourIDT);
+ _tcscpy(colourDivider.group, LPGENT("Tooltips"));
+ _tcscpy(colourDivider.name, LPGENT("Dividers"));
+ strcpy(colourDivider.dbSettingsGroup, MODULE);
+ strcpy(colourDivider.setting, "DividerCol");
+ colourDivider.defcolour = 0;
+ colourDivider.order = 0;
+
+ colourSidebar.cbSize = sizeof(ColourIDT);
+ _tcscpy(colourSidebar.group, LPGENT("Tooltips"));
+ _tcscpy(colourSidebar.name, LPGENT("Sidebar"));
+ strcpy(colourSidebar.dbSettingsGroup, MODULE);
+ strcpy(colourSidebar.setting, "SidebarCol");
+ colourSidebar.defcolour = RGB(192, 192, 192);
+ colourSidebar.order = 0;
+
+ CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourBg, 0);
+ CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourBorder, 0);
+ CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourAvatarBorder, 0);
+ CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourDivider, 0);
+ CallService(MS_COLOUR_REGISTERT, (WPARAM)&colourSidebar, 0);
+
+ fontTitle.cbSize = sizeof(FontIDT);
+ fontTitle.flags = FIDF_ALLOWEFFECTS;
+ _tcscpy(fontTitle.group, LPGENT("Tooltips"));
+ _tcscpy(fontTitle.name, LPGENT("Title"));
+ strcpy(fontTitle.dbSettingsGroup, MODULE);
+ strcpy(fontTitle.prefix, "FontFirst");
+ _tcscpy(fontTitle.backgroundGroup, LPGENT("Tooltips"));
+ _tcscpy(fontTitle.backgroundName, LPGENT("Background"));
+ fontTitle.order = 0;
+
+ fontTitle.deffontsettings.charset = DEFAULT_CHARSET;
+ fontTitle.deffontsettings.size = -14;
+ fontTitle.deffontsettings.style = DBFONTF_BOLD;
+ fontTitle.deffontsettings.colour = RGB(255, 0, 0);
+ fontTitle.flags |= FIDF_DEFAULTVALID;
+
+ fontLabels.cbSize = sizeof(FontIDT);
+ fontLabels.flags = FIDF_ALLOWEFFECTS;
+ _tcscpy(fontLabels.group, LPGENT("Tooltips"));
+ _tcscpy(fontLabels.name, LPGENT("Labels"));
+ strcpy(fontLabels.dbSettingsGroup, MODULE);
+ strcpy(fontLabels.prefix, "FontLabels");
+ _tcscpy(fontLabels.backgroundGroup, LPGENT("Tooltips"));
+ _tcscpy(fontLabels.backgroundName, LPGENT("Background"));
+ fontLabels.order = 1;
+
+ fontLabels.deffontsettings.charset = DEFAULT_CHARSET;
+ fontLabels.deffontsettings.size = -12;
+ fontLabels.deffontsettings.style = DBFONTF_ITALIC;
+ fontLabels.deffontsettings.colour = RGB(128, 128, 128);
+ fontLabels.flags |= FIDF_DEFAULTVALID;
+
+ fontValues.cbSize = sizeof(FontIDT);
+ fontValues.flags = FIDF_ALLOWEFFECTS;
+ _tcscpy(fontValues.group, LPGENT("Tooltips"));
+ _tcscpy(fontValues.name, LPGENT("Values"));
+ strcpy(fontValues.dbSettingsGroup, MODULE);
+ strcpy(fontValues.prefix, "FontValues");
+ _tcscpy(fontValues.backgroundGroup, LPGENT("Tooltips"));
+ _tcscpy(fontValues.backgroundName, LPGENT("Background"));
+ fontValues.order = 2;
+
+ fontValues.deffontsettings.charset = DEFAULT_CHARSET;
+ fontValues.deffontsettings.size = -12;
+ fontValues.deffontsettings.style = 0;
+ fontValues.deffontsettings.colour = RGB(0, 0, 0);
+ fontValues.flags |= FIDF_DEFAULTVALID;
+
+ fontTrayTitle.cbSize = sizeof(FontIDT);
+ fontTrayTitle.flags = FIDF_ALLOWEFFECTS;
+ _tcscpy(fontTrayTitle.group, LPGENT("Tooltips"));
+ _tcscpy(fontTrayTitle.name, LPGENT("Tray title"));
+ strcpy(fontTrayTitle.dbSettingsGroup, MODULE);
+ strcpy(fontTrayTitle.prefix, "FontTrayTitle");
+ _tcscpy(fontTrayTitle.backgroundGroup, LPGENT("Tooltips"));
+ _tcscpy(fontTrayTitle.backgroundName, LPGENT("Background"));
+ fontTrayTitle.order = 0;
+
+ fontTrayTitle.deffontsettings.charset = DEFAULT_CHARSET;
+ fontTrayTitle.deffontsettings.size = -14;
+ fontTrayTitle.deffontsettings.style = DBFONTF_BOLD;
+ fontTrayTitle.deffontsettings.colour = RGB(0, 0, 0);
+ fontTrayTitle.flags |= FIDF_DEFAULTVALID;
+
+ CallService(MS_FONT_REGISTERT, (WPARAM)&fontTitle, 0);
+ CallService(MS_FONT_REGISTERT, (WPARAM)&fontLabels, 0);
+ CallService(MS_FONT_REGISTERT, (WPARAM)&fontValues, 0);
+ CallService(MS_FONT_REGISTERT, (WPARAM)&fontTrayTitle, 0);
+
+ HookEvent(ME_FONT_RELOAD, ReloadFont);
+}
+
+void InitUpdaterSupport()
+{
+#ifndef _WIN64
+ if (ServiceExists(MS_UPDATE_REGISTER))
+ {
+ Update update = {0};
+ char szVersion[16];
+
+ update.cbSize = sizeof(Update);
+ update.szComponentName = pluginInfoEx.shortName;
+ update.pbVersion = (BYTE *)CreateVersionString(pluginInfoEx.version, szVersion);
+ update.cpbVersion = (int)strlen((char *)update.pbVersion);
+#ifdef _UNICODE
+ update.szUpdateURL = "http://miranda-easy.net/addons/updater/tipper-ym.zip";
+#else
+ update.szUpdateURL = "http://miranda-easy.net/addons/updater/tipper-ym_ansi.zip";
+#endif
+ update.szVersionURL = "http://miranda-easy.net/addons/updater/tipper_version.txt";
+ update.pbVersionPrefix = (BYTE *)"Tipper YM ";
+ update.cpbVersionPrefix = (int)strlen((char *)update.pbVersionPrefix);
+ CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
+ }
+#endif
+}
+
+int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+{
+ InitFonts();
+ InitUpdaterSupport();
+
+ hAvChangeEvent = HookEvent(ME_AV_AVATARCHANGED, AvatarChanged);
+ hShowTipEvent = HookEvent(ME_CLC_SHOWINFOTIP, ShowTipHook);
+ hHideTipEvent = HookEvent(ME_CLC_HIDEINFOTIP, HideTipHook);
+ hAckEvent = HookEvent(ME_PROTO_ACK, ProtoAck);
+
+ hFramesSBShow = HookEvent(ME_CLIST_FRAMES_SB_SHOW_TOOLTIP, FramesShowSBTip);
+ hFramesSBHide = HookEvent(ME_CLIST_FRAMES_SB_HIDE_TOOLTIP, FramesHideSBTip);
+
+ hFolderChanged = HookEvent(ME_FOLDERS_PATH_CHANGED, ReloadSkinFolder);
+
+ hSkinFolder = FoldersRegisterCustomPath(MODULE, "Tipper skins", MIRANDA_PATH "\\" DEFAULT_SKIN_FOLDER);
+ FoldersGetCustomPath(hSkinFolder, SKIN_FOLDER, sizeof(SKIN_FOLDER), DEFAULT_SKIN_FOLDER);
+
+ InitTipperSmileys();
+ LoadOptions();
+ ReloadFont(0, 0);
+ ParseSkinFile(opt.szSkinName, true, false);
+
+ // set 'time-in'
+ CallService(MS_CLC_SETINFOTIPHOVERTIME, opt.iTimeIn, 0);
+
+ // set Miranda start timestamp
+ DBWriteContactSettingDword(0, MODULE, "MirandaStartTS", (DWORD)time(0));
+
+ // get MetaContacts module name
+ if (ServiceExists(MS_MC_GETPROTOCOLNAME))
+ strcpy(szMetaModuleName, (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0));
+
+ return 0;
+}
+
+int Shutdown(WPARAM wParam, LPARAM lParam)
+{
+ if (hFramesSBShow) UnhookEvent(hFramesSBShow);
+ if (hFramesSBHide) UnhookEvent(hFramesSBHide);
+ if (hAvChangeEvent) UnhookEvent(hAvChangeEvent);
+ if (hShowTipEvent) UnhookEvent(hShowTipEvent);
+ if (hHideTipEvent) UnhookEvent(hHideTipEvent);
+ if (hAckEvent) UnhookEvent(hAckEvent);
+
+ if (hShowTipService) DestroyServiceFunction(hShowTipService);
+ if (hShowTipWService) DestroyServiceFunction(hShowTipWService);
+ if (hHideTipService) DestroyServiceFunction(hHideTipService);
+
+ if (hFolderChanged) UnhookEvent(hFolderChanged);
+
+ DeinitMessagePump();
+ DestroySkinBitmap();
+
+ return 0;
+}
+
+HANDLE hEventPreShutdown, hEventModulesLoaded;
+
+extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+{
+ pluginLink = link;
+
+ if (mir_getMMI(&mmi) || mir_getLI(&li) || !ServiceExists(MS_IMG_GETINTERFACE))
+ {
+ MessageBox(NULL, TranslateT("Cannot obtain required interfaces!\nTooltips will not be available until you upgrade Miranda IM to the newest version."), TranslateT("Tipper error"), MB_OK | MB_ICONSTOP);
+ return 1;
+ }
+
+ CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&fii);
+ mir_getTMI(&tmi);
+
+ if (ServiceExists(MS_LANGPACK_GETCODEPAGE))
+ iCodePage = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+
+ InitTranslations();
+ InitMessagePump();
+ InitOptions();
+
+ // for compatibility with mToolTip status tooltips
+ hShowTipService = CreateServiceFunction("mToolTip/ShowTip", ShowTip);
+#ifdef _UNICODE
+ hShowTipWService = CreateServiceFunction("mToolTip/ShowTipW", ShowTipW);
+#endif
+ hHideTipService = CreateServiceFunction("mToolTip/HideTip", HideTip);
+
+ hEventPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, Shutdown);
+ hEventModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
+
+ hSettingChangedEvent = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged);
+ hEventDeleted = HookEvent(ME_DB_EVENT_DELETED, EventDeleted);
+
+ return 0;
+}
+
+extern "C" int __declspec(dllexport) Unload()
+{
+ UnhookEvent(hSettingChangedEvent);
+ UnhookEvent(hEventDeleted);
+ UnhookEvent(hEventPreShutdown);
+ UnhookEvent(hEventModulesLoaded);
+
+ DeinitOptions();
+ DeleteObject(hFontTitle);
+ DeleteObject(hFontLabels);
+ DeleteObject(hFontValues);
+ DeleteObject(hFontTrayTitle);
+
+ DeinitTranslations();
+ return 0;
+}
diff --git a/plugins/TipperYM/tipper_ym.dsp b/plugins/TipperYM/tipper_ym.dsp new file mode 100644 index 0000000000..9908ac7eba --- /dev/null +++ b/plugins/TipperYM/tipper_ym.dsp @@ -0,0 +1,831 @@ +# Microsoft Developer Studio Project File - Name="tipper_ym" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=tipper_ym - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "tipper_ym.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "tipper_ym.mak" CFG="tipper_ym - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "tipper_ym - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "tipper_ym - Win32 Release Unicode" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "tipper_ym - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "tipper_ym - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /Gm /GX /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "TIPPER_EXPORTS" /D MICROSOFT_LAYER_FOR_UNICODE=1 /D "_UNICODE" /YX /GZ /c
+# ADD CPP /nologo /MTd /Gm /GX /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "TIPPER_EXPORTS" /D MICROSOFT_LAYER_FOR_UNICODE=1 /D "_UNICODE" /YX /GZ /c
+# ADD BASE MTL /nologo /win32
+# ADD MTL /nologo /win32
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib unicows.lib comctl32.lib ws2_32.lib msimg32.lib /nologo /subsystem:windows /dll /debug /machine:IX86 /out:"../../bin/Debug/Plugins/tipper_ym.dll" /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib unicows.lib comctl32.lib ws2_32.lib msimg32.lib /nologo /subsystem:windows /dll /pdb:"../../bin/Debug/Plugins/tipper_ym.pdb" /debug /machine:IX86 /out:"../../bin/Debug/Plugins/tipper_ym.dll" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "tipper_ym - Win32 Release Unicode"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseW"
+# PROP BASE Intermediate_Dir "ReleaseW"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseW"
+# PROP Intermediate_Dir "ReleaseW"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /Gm /GX /Zi /Os /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "TIPPER_EXPORTS" /D "_UNICODE" /D "UNICODE" /D MICROSOFT_LAYER_FOR_UNICODE=1 /YX /TP /c
+# ADD CPP /nologo /MT /Gm /GX /Zi /Os /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "TIPPER_EXPORTS" /D "_UNICODE" /D "UNICODE" /D MICROSOFT_LAYER_FOR_UNICODE=1 /YX /TP /c
+# ADD BASE MTL /nologo /win32
+# ADD MTL /nologo /win32
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib unicows.lib comctl32.lib ws2_32.lib msimg32.lib /nologo /subsystem:windows /dll /debug /machine:IX86 /nodefaultlib:"Kernel32.lib Advapi32.lib User32.lib Gdi32.lib Shell32.lib Comdlg32.lib Version.lib Mpr.lib Rasapi32.lib Winmm.lib Winspool.lib Vfw32.lib Secur32.lib Oleacc.lib Oledlg.lib Sensapi.lib" /out:"../../bin/ReleaseW/Plugins/tipper_ym.dll" /pdbtype:sept /opt:ref /opt:icf
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib unicows.lib comctl32.lib ws2_32.lib msimg32.lib /nologo /subsystem:windows /dll /pdb:"../../bin/ReleaseW/Plugins/tipper_ym.pdb" /debug /machine:IX86 /nodefaultlib:"Kernel32.lib Advapi32.lib User32.lib Gdi32.lib Shell32.lib Comdlg32.lib Version.lib Mpr.lib Rasapi32.lib Winmm.lib Winspool.lib Vfw32.lib Secur32.lib Oleacc.lib Oledlg.lib Sensapi.lib" /out:"../../bin/ReleaseW/Plugins/tipper_ym.dll" /pdbtype:sept /opt:ref /opt:icf
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "tipper_ym - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /GX /Zi /Os /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "TIPPER_EXPORTS" /D "_MBCS" /YX /c
+# ADD CPP /nologo /MT /GX /Zi /Os /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "TIPPER_EXPORTS" /D "_MBCS" /FR /YX /c
+# ADD BASE MTL /nologo /win32
+# ADD MTL /nologo /win32
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib ws2_32.lib msimg32.lib /nologo /subsystem:windows /dll /debug /machine:IX86 /out:"../../bin/Release/Plugins/tipper_ym.dll" /pdbtype:sept /opt:ref /opt:icf
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib ws2_32.lib msimg32.lib /nologo /subsystem:windows /dll /pdb:"../../bin/Release/Plugins/tipper_ym.pdb" /debug /machine:IX86 /out:"../../bin/Release/Plugins/tipper_ym.dll" /pdbtype:sept /opt:ref /opt:icf
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "tipper_ym - Win32 Debug"
+# Name "tipper_ym - Win32 Release Unicode"
+# Name "tipper_ym - Win32 Release"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+# Begin Source File
+
+SOURCE=.\bitmap_func.cpp
+DEP_CPP_BITMA=\
+ "..\..\include\m_avatars.h"\
+ "..\..\include\m_awaymsg.h"\
+ "..\..\include\m_button.h"\
+ "..\..\include\m_clc.h"\
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_clui.h"\
+ "..\..\include\m_cluiframes.h"\
+ "..\..\include\m_contacts.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_fontservice.h"\
+ "..\..\include\m_icolib.h"\
+ "..\..\include\m_icq.h"\
+ "..\..\include\m_idle.h"\
+ "..\..\include\m_imgsrvc.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_options.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_skin.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\win2k.h"\
+ ".\bitmap_func.h"\
+ ".\common.h"\
+ ".\message_pump.h"\
+ ".\mir_dblists.h"\
+ ".\mir_smileys.h"\
+ ".\options.h"\
+ ".\popwin.h"\
+ ".\sdk\m_ersatz.h"\
+ ".\sdk\m_fingerprint.h"\
+ ".\sdk\m_flags.h"\
+ ".\sdk\m_metacontacts.h"\
+ ".\sdk\m_newawaysys.h"\
+ ".\sdk\m_simpleaway.h"\
+ ".\sdk\m_smileyadd.h"\
+ ".\sdk\m_tipper.h"\
+ ".\sdk\m_updater.h"\
+ ".\sdk\m_variables.h"\
+ ".\translations.h"\
+ {$(INCLUDE)}"inttypes.h"\
+ {$(INCLUDE)}"m_freeimage.h"\
+ {$(INCLUDE)}"m_plugins.h"\
+ {$(INCLUDE)}"m_protocols.h"\
+ {$(INCLUDE)}"m_system.h"\
+ {$(INCLUDE)}"m_utils.h"\
+ {$(INCLUDE)}"statusmodes.h"\
+ {$(INCLUDE)}"stdint.h"\
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\message_pump.cpp
+DEP_CPP_MESSA=\
+ "..\..\include\m_avatars.h"\
+ "..\..\include\m_awaymsg.h"\
+ "..\..\include\m_button.h"\
+ "..\..\include\m_clc.h"\
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_clui.h"\
+ "..\..\include\m_cluiframes.h"\
+ "..\..\include\m_contacts.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_fontservice.h"\
+ "..\..\include\m_icolib.h"\
+ "..\..\include\m_icq.h"\
+ "..\..\include\m_idle.h"\
+ "..\..\include\m_imgsrvc.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_options.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_skin.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\win2k.h"\
+ ".\bitmap_func.h"\
+ ".\common.h"\
+ ".\message_pump.h"\
+ ".\mir_dblists.h"\
+ ".\mir_smileys.h"\
+ ".\options.h"\
+ ".\popwin.h"\
+ ".\sdk\m_ersatz.h"\
+ ".\sdk\m_fingerprint.h"\
+ ".\sdk\m_flags.h"\
+ ".\sdk\m_metacontacts.h"\
+ ".\sdk\m_newawaysys.h"\
+ ".\sdk\m_simpleaway.h"\
+ ".\sdk\m_smileyadd.h"\
+ ".\sdk\m_tipper.h"\
+ ".\sdk\m_updater.h"\
+ ".\sdk\m_variables.h"\
+ ".\str_utils.h"\
+ ".\subst.h"\
+ ".\translations.h"\
+ {$(INCLUDE)}"inttypes.h"\
+ {$(INCLUDE)}"m_freeimage.h"\
+ {$(INCLUDE)}"m_plugins.h"\
+ {$(INCLUDE)}"m_protocols.h"\
+ {$(INCLUDE)}"m_system.h"\
+ {$(INCLUDE)}"m_utils.h"\
+ {$(INCLUDE)}"statusmodes.h"\
+ {$(INCLUDE)}"stdint.h"\
+
+
+!IF "$(CFG)" == "tipper_ym - Win32 Debug"
+
+# ADD CPP /nologo /GX /YX /GZ
+
+!ELSEIF "$(CFG)" == "tipper_ym - Win32 Release Unicode"
+
+# ADD CPP /nologo /GX /YX
+
+!ELSEIF "$(CFG)" == "tipper_ym - Win32 Release"
+
+# ADD CPP /nologo /GX /YX
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\mir_dblists.cpp
+DEP_CPP_MIR_D=\
+ "..\..\include\m_avatars.h"\
+ "..\..\include\m_awaymsg.h"\
+ "..\..\include\m_button.h"\
+ "..\..\include\m_clc.h"\
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_clui.h"\
+ "..\..\include\m_cluiframes.h"\
+ "..\..\include\m_contacts.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_fontservice.h"\
+ "..\..\include\m_icolib.h"\
+ "..\..\include\m_icq.h"\
+ "..\..\include\m_idle.h"\
+ "..\..\include\m_imgsrvc.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_options.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_skin.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\win2k.h"\
+ ".\common.h"\
+ ".\mir_dblists.h"\
+ ".\sdk\m_ersatz.h"\
+ ".\sdk\m_fingerprint.h"\
+ ".\sdk\m_flags.h"\
+ ".\sdk\m_metacontacts.h"\
+ ".\sdk\m_newawaysys.h"\
+ ".\sdk\m_simpleaway.h"\
+ ".\sdk\m_smileyadd.h"\
+ ".\sdk\m_updater.h"\
+ ".\sdk\m_variables.h"\
+ {$(INCLUDE)}"inttypes.h"\
+ {$(INCLUDE)}"m_freeimage.h"\
+ {$(INCLUDE)}"m_plugins.h"\
+ {$(INCLUDE)}"m_protocols.h"\
+ {$(INCLUDE)}"m_system.h"\
+ {$(INCLUDE)}"m_utils.h"\
+ {$(INCLUDE)}"statusmodes.h"\
+ {$(INCLUDE)}"stdint.h"\
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\mir_smileys.cpp
+DEP_CPP_MIR_S=\
+ "..\..\include\m_avatars.h"\
+ "..\..\include\m_awaymsg.h"\
+ "..\..\include\m_button.h"\
+ "..\..\include\m_clc.h"\
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_clui.h"\
+ "..\..\include\m_cluiframes.h"\
+ "..\..\include\m_contacts.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_fontservice.h"\
+ "..\..\include\m_icolib.h"\
+ "..\..\include\m_icq.h"\
+ "..\..\include\m_idle.h"\
+ "..\..\include\m_imgsrvc.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_options.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_skin.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\win2k.h"\
+ ".\bitmap_func.h"\
+ ".\common.h"\
+ ".\mir_dblists.h"\
+ ".\mir_smileys.h"\
+ ".\options.h"\
+ ".\popwin.h"\
+ ".\sdk\m_ersatz.h"\
+ ".\sdk\m_fingerprint.h"\
+ ".\sdk\m_flags.h"\
+ ".\sdk\m_metacontacts.h"\
+ ".\sdk\m_newawaysys.h"\
+ ".\sdk\m_simpleaway.h"\
+ ".\sdk\m_smileyadd.h"\
+ ".\sdk\m_tipper.h"\
+ ".\sdk\m_updater.h"\
+ ".\sdk\m_variables.h"\
+ ".\translations.h"\
+ {$(INCLUDE)}"inttypes.h"\
+ {$(INCLUDE)}"m_freeimage.h"\
+ {$(INCLUDE)}"m_plugins.h"\
+ {$(INCLUDE)}"m_protocols.h"\
+ {$(INCLUDE)}"m_system.h"\
+ {$(INCLUDE)}"m_utils.h"\
+ {$(INCLUDE)}"statusmodes.h"\
+ {$(INCLUDE)}"stdint.h"\
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\options.cpp
+DEP_CPP_OPTIO=\
+ "..\..\include\m_avatars.h"\
+ "..\..\include\m_awaymsg.h"\
+ "..\..\include\m_button.h"\
+ "..\..\include\m_clc.h"\
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_clui.h"\
+ "..\..\include\m_cluiframes.h"\
+ "..\..\include\m_contacts.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_fontservice.h"\
+ "..\..\include\m_icolib.h"\
+ "..\..\include\m_icq.h"\
+ "..\..\include\m_idle.h"\
+ "..\..\include\m_imgsrvc.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_options.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_skin.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\win2k.h"\
+ ".\bitmap_func.h"\
+ ".\common.h"\
+ ".\message_pump.h"\
+ ".\mir_dblists.h"\
+ ".\mir_smileys.h"\
+ ".\options.h"\
+ ".\popwin.h"\
+ ".\preset_items.h"\
+ ".\sdk\m_ersatz.h"\
+ ".\sdk\m_fingerprint.h"\
+ ".\sdk\m_flags.h"\
+ ".\sdk\m_metacontacts.h"\
+ ".\sdk\m_newawaysys.h"\
+ ".\sdk\m_simpleaway.h"\
+ ".\sdk\m_smileyadd.h"\
+ ".\sdk\m_tipper.h"\
+ ".\sdk\m_updater.h"\
+ ".\sdk\m_variables.h"\
+ ".\str_utils.h"\
+ ".\translations.h"\
+ {$(INCLUDE)}"inttypes.h"\
+ {$(INCLUDE)}"m_freeimage.h"\
+ {$(INCLUDE)}"m_plugins.h"\
+ {$(INCLUDE)}"m_protocols.h"\
+ {$(INCLUDE)}"m_system.h"\
+ {$(INCLUDE)}"m_utils.h"\
+ {$(INCLUDE)}"statusmodes.h"\
+ {$(INCLUDE)}"stdint.h"\
+
+
+!IF "$(CFG)" == "tipper_ym - Win32 Debug"
+
+# ADD CPP /nologo /GX /YX /GZ
+
+!ELSEIF "$(CFG)" == "tipper_ym - Win32 Release Unicode"
+
+# ADD CPP /nologo /GX /YX
+
+!ELSEIF "$(CFG)" == "tipper_ym - Win32 Release"
+
+# ADD CPP /nologo /GX /YX
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\popwin.cpp
+DEP_CPP_POPWI=\
+ "..\..\include\m_avatars.h"\
+ "..\..\include\m_awaymsg.h"\
+ "..\..\include\m_button.h"\
+ "..\..\include\m_clc.h"\
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_clui.h"\
+ "..\..\include\m_cluiframes.h"\
+ "..\..\include\m_contacts.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_fontservice.h"\
+ "..\..\include\m_icolib.h"\
+ "..\..\include\m_icq.h"\
+ "..\..\include\m_idle.h"\
+ "..\..\include\m_imgsrvc.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_options.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_skin.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\win2k.h"\
+ ".\bitmap_func.h"\
+ ".\common.h"\
+ ".\message_pump.h"\
+ ".\mir_dblists.h"\
+ ".\mir_smileys.h"\
+ ".\options.h"\
+ ".\popwin.h"\
+ ".\sdk\m_ersatz.h"\
+ ".\sdk\m_fingerprint.h"\
+ ".\sdk\m_flags.h"\
+ ".\sdk\m_metacontacts.h"\
+ ".\sdk\m_newawaysys.h"\
+ ".\sdk\m_simpleaway.h"\
+ ".\sdk\m_smileyadd.h"\
+ ".\sdk\m_tipper.h"\
+ ".\sdk\m_updater.h"\
+ ".\sdk\m_variables.h"\
+ ".\str_utils.h"\
+ ".\subst.h"\
+ ".\translations.h"\
+ {$(INCLUDE)}"inttypes.h"\
+ {$(INCLUDE)}"m_freeimage.h"\
+ {$(INCLUDE)}"m_plugins.h"\
+ {$(INCLUDE)}"m_protocols.h"\
+ {$(INCLUDE)}"m_system.h"\
+ {$(INCLUDE)}"m_utils.h"\
+ {$(INCLUDE)}"statusmodes.h"\
+ {$(INCLUDE)}"stdint.h"\
+
+
+!IF "$(CFG)" == "tipper_ym - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "tipper_ym - Win32 Release Unicode"
+
+!ELSEIF "$(CFG)" == "tipper_ym - Win32 Release"
+
+# ADD CPP /nologo /GX /YX /GZ
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\preset_items.cpp
+DEP_CPP_PRESE=\
+ "..\..\include\m_avatars.h"\
+ "..\..\include\m_awaymsg.h"\
+ "..\..\include\m_button.h"\
+ "..\..\include\m_clc.h"\
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_clui.h"\
+ "..\..\include\m_cluiframes.h"\
+ "..\..\include\m_contacts.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_fontservice.h"\
+ "..\..\include\m_icolib.h"\
+ "..\..\include\m_icq.h"\
+ "..\..\include\m_idle.h"\
+ "..\..\include\m_imgsrvc.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_options.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_skin.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\win2k.h"\
+ ".\bitmap_func.h"\
+ ".\common.h"\
+ ".\mir_dblists.h"\
+ ".\mir_smileys.h"\
+ ".\options.h"\
+ ".\popwin.h"\
+ ".\preset_items.h"\
+ ".\sdk\m_ersatz.h"\
+ ".\sdk\m_fingerprint.h"\
+ ".\sdk\m_flags.h"\
+ ".\sdk\m_metacontacts.h"\
+ ".\sdk\m_newawaysys.h"\
+ ".\sdk\m_simpleaway.h"\
+ ".\sdk\m_smileyadd.h"\
+ ".\sdk\m_tipper.h"\
+ ".\sdk\m_updater.h"\
+ ".\sdk\m_variables.h"\
+ ".\translations.h"\
+ {$(INCLUDE)}"inttypes.h"\
+ {$(INCLUDE)}"m_freeimage.h"\
+ {$(INCLUDE)}"m_plugins.h"\
+ {$(INCLUDE)}"m_protocols.h"\
+ {$(INCLUDE)}"m_system.h"\
+ {$(INCLUDE)}"m_utils.h"\
+ {$(INCLUDE)}"statusmodes.h"\
+ {$(INCLUDE)}"stdint.h"\
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\str_utils.cpp
+DEP_CPP_STR_U=\
+ "..\..\include\m_avatars.h"\
+ "..\..\include\m_awaymsg.h"\
+ "..\..\include\m_button.h"\
+ "..\..\include\m_clc.h"\
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_clui.h"\
+ "..\..\include\m_cluiframes.h"\
+ "..\..\include\m_contacts.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_fontservice.h"\
+ "..\..\include\m_icolib.h"\
+ "..\..\include\m_icq.h"\
+ "..\..\include\m_idle.h"\
+ "..\..\include\m_imgsrvc.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_options.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_skin.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\win2k.h"\
+ ".\common.h"\
+ ".\sdk\m_ersatz.h"\
+ ".\sdk\m_fingerprint.h"\
+ ".\sdk\m_flags.h"\
+ ".\sdk\m_metacontacts.h"\
+ ".\sdk\m_newawaysys.h"\
+ ".\sdk\m_simpleaway.h"\
+ ".\sdk\m_smileyadd.h"\
+ ".\sdk\m_updater.h"\
+ ".\sdk\m_variables.h"\
+ ".\str_utils.h"\
+ {$(INCLUDE)}"inttypes.h"\
+ {$(INCLUDE)}"m_freeimage.h"\
+ {$(INCLUDE)}"m_plugins.h"\
+ {$(INCLUDE)}"m_protocols.h"\
+ {$(INCLUDE)}"m_system.h"\
+ {$(INCLUDE)}"m_utils.h"\
+ {$(INCLUDE)}"statusmodes.h"\
+ {$(INCLUDE)}"stdint.h"\
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\subst.cpp
+DEP_CPP_SUBST=\
+ "..\..\include\m_avatars.h"\
+ "..\..\include\m_awaymsg.h"\
+ "..\..\include\m_button.h"\
+ "..\..\include\m_clc.h"\
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_clui.h"\
+ "..\..\include\m_cluiframes.h"\
+ "..\..\include\m_contacts.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_fontservice.h"\
+ "..\..\include\m_icolib.h"\
+ "..\..\include\m_icq.h"\
+ "..\..\include\m_idle.h"\
+ "..\..\include\m_imgsrvc.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_options.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_skin.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\win2k.h"\
+ ".\bitmap_func.h"\
+ ".\common.h"\
+ ".\mir_dblists.h"\
+ ".\mir_smileys.h"\
+ ".\options.h"\
+ ".\popwin.h"\
+ ".\sdk\m_ersatz.h"\
+ ".\sdk\m_fingerprint.h"\
+ ".\sdk\m_flags.h"\
+ ".\sdk\m_metacontacts.h"\
+ ".\sdk\m_newawaysys.h"\
+ ".\sdk\m_simpleaway.h"\
+ ".\sdk\m_smileyadd.h"\
+ ".\sdk\m_tipper.h"\
+ ".\sdk\m_updater.h"\
+ ".\sdk\m_variables.h"\
+ ".\str_utils.h"\
+ ".\subst.h"\
+ ".\translations.h"\
+ {$(INCLUDE)}"inttypes.h"\
+ {$(INCLUDE)}"m_freeimage.h"\
+ {$(INCLUDE)}"m_plugins.h"\
+ {$(INCLUDE)}"m_protocols.h"\
+ {$(INCLUDE)}"m_system.h"\
+ {$(INCLUDE)}"m_utils.h"\
+ {$(INCLUDE)}"statusmodes.h"\
+ {$(INCLUDE)}"stdint.h"\
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\tipper.cpp
+DEP_CPP_TIPPE=\
+ "..\..\include\m_avatars.h"\
+ "..\..\include\m_awaymsg.h"\
+ "..\..\include\m_button.h"\
+ "..\..\include\m_clc.h"\
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_clui.h"\
+ "..\..\include\m_cluiframes.h"\
+ "..\..\include\m_contacts.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_fontservice.h"\
+ "..\..\include\m_icolib.h"\
+ "..\..\include\m_icq.h"\
+ "..\..\include\m_idle.h"\
+ "..\..\include\m_imgsrvc.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_options.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_skin.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\win2k.h"\
+ ".\bitmap_func.h"\
+ ".\common.h"\
+ ".\message_pump.h"\
+ ".\mir_dblists.h"\
+ ".\mir_smileys.h"\
+ ".\options.h"\
+ ".\popwin.h"\
+ ".\sdk\m_ersatz.h"\
+ ".\sdk\m_fingerprint.h"\
+ ".\sdk\m_flags.h"\
+ ".\sdk\m_metacontacts.h"\
+ ".\sdk\m_newawaysys.h"\
+ ".\sdk\m_simpleaway.h"\
+ ".\sdk\m_smileyadd.h"\
+ ".\sdk\m_tipper.h"\
+ ".\sdk\m_updater.h"\
+ ".\sdk\m_variables.h"\
+ ".\str_utils.h"\
+ ".\tipper.h"\
+ ".\translations.h"\
+ ".\version.h"\
+ {$(INCLUDE)}"inttypes.h"\
+ {$(INCLUDE)}"m_freeimage.h"\
+ {$(INCLUDE)}"m_plugins.h"\
+ {$(INCLUDE)}"m_protocols.h"\
+ {$(INCLUDE)}"m_system.h"\
+ {$(INCLUDE)}"m_utils.h"\
+ {$(INCLUDE)}"statusmodes.h"\
+ {$(INCLUDE)}"stdint.h"\
+
+
+!IF "$(CFG)" == "tipper_ym - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "tipper_ym - Win32 Release Unicode"
+
+!ELSEIF "$(CFG)" == "tipper_ym - Win32 Release"
+
+# ADD CPP /nologo /GX /Yc"common.h" /GZ
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\translations.cpp
+DEP_CPP_TRANS=\
+ "..\..\include\m_avatars.h"\
+ "..\..\include\m_awaymsg.h"\
+ "..\..\include\m_button.h"\
+ "..\..\include\m_clc.h"\
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_clui.h"\
+ "..\..\include\m_cluiframes.h"\
+ "..\..\include\m_contacts.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_fontservice.h"\
+ "..\..\include\m_icolib.h"\
+ "..\..\include\m_icq.h"\
+ "..\..\include\m_idle.h"\
+ "..\..\include\m_imgsrvc.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_options.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_skin.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\win2k.h"\
+ ".\common.h"\
+ ".\sdk\m_ersatz.h"\
+ ".\sdk\m_fingerprint.h"\
+ ".\sdk\m_flags.h"\
+ ".\sdk\m_metacontacts.h"\
+ ".\sdk\m_newawaysys.h"\
+ ".\sdk\m_simpleaway.h"\
+ ".\sdk\m_smileyadd.h"\
+ ".\sdk\m_tipper.h"\
+ ".\sdk\m_updater.h"\
+ ".\sdk\m_variables.h"\
+ ".\str_utils.h"\
+ ".\translations.h"\
+ {$(INCLUDE)}"inttypes.h"\
+ {$(INCLUDE)}"m_freeimage.h"\
+ {$(INCLUDE)}"m_plugins.h"\
+ {$(INCLUDE)}"m_protocols.h"\
+ {$(INCLUDE)}"m_system.h"\
+ {$(INCLUDE)}"m_utils.h"\
+ {$(INCLUDE)}"statusmodes.h"\
+ {$(INCLUDE)}"stdint.h"\
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl;inc;xsd"
+# Begin Source File
+
+SOURCE=.\bitmap_func.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\common.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sdk\m_tipper.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\message_pump.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mir_dblists.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mir_smileys.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\options.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\popwin.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\preset_items.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\str_utils.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\subst.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\tipper.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\translations.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\version.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+# Begin Source File
+
+SOURCE=.\res\copy_all_items.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\copy_item.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.rc
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/plugins/TipperYM/tipper_ym.dsw b/plugins/TipperYM/tipper_ym.dsw new file mode 100644 index 0000000000..aeabbeac56 --- /dev/null +++ b/plugins/TipperYM/tipper_ym.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "tipper_ym"=".\tipper_ym.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/plugins/TipperYM/tipper_ym.vcproj b/plugins/TipperYM/tipper_ym.vcproj new file mode 100644 index 0000000000..e6d1544159 --- /dev/null +++ b/plugins/TipperYM/tipper_ym.vcproj @@ -0,0 +1,464 @@ +<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="tipper_ym"
+ ProjectGUID="{79775BB3-800C-4C71-93F8-94906586B6AC}"
+ SccProjectName=""
+ SccLocalPath="">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="1">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderThrough="common.h"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ SuppressStartupBanner="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="2"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="vc7to6.lib comctl32.lib msimg32.lib ws2_32.lib"
+ OutputFile="$(ConfigurationName)\tipper.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="TRUE"
+ AdditionalLibraryDirectories="..\..\lib"
+ IgnoreAllDefaultLibraries="TRUE"
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile=".\Release/tipper.pdb"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ SuppressStartupBanner="TRUE"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/tipper.tlb"
+ HeaderFileName=""/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="1">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;MICROSOFT_LAYER_FOR_UNICODE=1"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderThrough=""
+ PrecompiledHeaderFile=""
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ SuppressStartupBanner="TRUE"
+ DebugInformationFormat="4"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="vc7to6.lib comctl32.lib msimg32.lib ws2_32.lib"
+ OutputFile="$(ConfigurationName)\tipper.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="TRUE"
+ IgnoreAllDefaultLibraries="TRUE"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile=".\Debug/tipper.pdb"
+ SubSystem="2"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ SuppressStartupBanner="TRUE"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/tipper.tlb"
+ HeaderFileName=""/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1033"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release (ansi)|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS"
+ RuntimeLibrary="2"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="vc7to6.lib comctl32.lib msimg32.lib ws2_32.lib"
+ OutputFile="$(ConfigurationName)\tipper.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="TRUE"
+ AdditionalLibraryDirectories="..\..\lib"
+ IgnoreAllDefaultLibraries="TRUE"
+ SubSystem="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx">
+ <File
+ RelativePath="bitmap_func.cpp">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1;$(NoInherit)"
+ CompileAs="2"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;MICROSOFT_LAYER_FOR_UNICODE=1;_UNICODE;$(NoInherit)"
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="message_pump.cpp">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1;$(NoInherit)"
+ CompileAs="2"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;MICROSOFT_LAYER_FOR_UNICODE=1;_UNICODE;$(NoInherit)"
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="mir_smileys.cpp">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1;$(NoInherit)"
+ CompileAs="2"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;MICROSOFT_LAYER_FOR_UNICODE=1;_UNICODE;$(NoInherit)"
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="options.cpp">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1;$(NoInherit)"
+ CompileAs="2"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;MICROSOFT_LAYER_FOR_UNICODE=1;_UNICODE;$(NoInherit)"
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="popwin.cpp">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1;$(NoInherit)"
+ CompileAs="2"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;MICROSOFT_LAYER_FOR_UNICODE=1;_UNICODE;$(NoInherit)"
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\preset_items.cpp">
+ </File>
+ <File
+ RelativePath=".\skin_parser.cpp">
+ </File>
+ <File
+ RelativePath="str_utils.cpp">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1;$(NoInherit)"
+ CompileAs="2"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;MICROSOFT_LAYER_FOR_UNICODE=1;_UNICODE;$(NoInherit)"
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="subst.cpp">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1;$(NoInherit)"
+ CompileAs="2"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;MICROSOFT_LAYER_FOR_UNICODE=1;_UNICODE;$(NoInherit)"
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="tipper.cpp">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1;$(NoInherit)"
+ UsePrecompiledHeader="1"
+ PrecompiledHeaderThrough="common.h"
+ CompileAs="2"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;MICROSOFT_LAYER_FOR_UNICODE=1;_UNICODE;$(NoInherit)"
+ BasicRuntimeChecks="3"
+ UsePrecompiledHeader="1"
+ PrecompiledHeaderThrough="common.h"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="translations.cpp">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1;$(NoInherit)"
+ CompileAs="2"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;MICROSOFT_LAYER_FOR_UNICODE=1;_UNICODE;$(NoInherit)"
+ BasicRuntimeChecks="3"/>
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd">
+ <File
+ RelativePath="bitmap_func.h">
+ </File>
+ <File
+ RelativePath="common.h">
+ </File>
+ <File
+ RelativePath="sdk\m_tipper.h">
+ </File>
+ <File
+ RelativePath="message_pump.h">
+ </File>
+ <File
+ RelativePath="mir_smileys.h">
+ </File>
+ <File
+ RelativePath="options.h">
+ </File>
+ <File
+ RelativePath="popwin.h">
+ </File>
+ <File
+ RelativePath=".\preset_items.h">
+ </File>
+ <File
+ RelativePath="resource.h">
+ </File>
+ <File
+ RelativePath=".\skin_parser.h">
+ </File>
+ <File
+ RelativePath="str_utils.h">
+ </File>
+ <File
+ RelativePath="subst.h">
+ </File>
+ <File
+ RelativePath="translations.h">
+ </File>
+ <File
+ RelativePath="version.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav">
+ <File
+ RelativePath=".\res\arrow_down.ico">
+ </File>
+ <File
+ RelativePath=".\res\arrow_up.ico">
+ </File>
+ <File
+ RelativePath="res\copy_all_items.ico">
+ </File>
+ <File
+ RelativePath="res\copy_item.ico">
+ </File>
+ <File
+ RelativePath="resource.rc">
+ </File>
+ <File
+ RelativePath=".\res\separator.ico">
+ </File>
+ <File
+ RelativePath=".\version.rc">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/plugins/TipperYM/tipper_ym_10.vcxproj b/plugins/TipperYM/tipper_ym_10.vcxproj new file mode 100644 index 0000000000..d23c04c91f --- /dev/null +++ b/plugins/TipperYM/tipper_ym_10.vcxproj @@ -0,0 +1,555 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release (ansi)|Win32">
+ <Configuration>Release (ansi)</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release (ansi)|x64">
+ <Configuration>Release (ansi)</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release (SSE2)|Win32">
+ <Configuration>Release (SSE2)</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release (SSE2)|x64">
+ <Configuration>Release (SSE2)</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>tipper_ym</ProjectName>
+ <ProjectGuid>{2C818919-A38F-44FF-BD91-A6A204AC592A}</ProjectGuid>
+ <RootNamespace>tipper</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">d:\Downloads\miranda-v0100a1w64\Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)64\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+ <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</EmbedManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)64\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+ <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</EmbedManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'">false</GenerateManifest>
+ <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'">false</EmbedManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'">$(SolutionDir)$(Configuration)64\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'">$(Configuration)64\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'">false</GenerateManifest>
+ <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'">false</EmbedManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'">false</GenerateManifest>
+ <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'">false</EmbedManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'">$(SolutionDir)$(Configuration)64\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'">$(Configuration)64\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'">false</GenerateManifest>
+ <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'">false</EmbedManifest>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">tipper</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">tipper</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">tipper</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'">tipper</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'">tipper</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">tipper</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'">tipper</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'">tipper</TargetName>
+ <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</EmbedManifest>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>common.h</PrecompiledHeaderFile>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>unicows.lib;comctl32.lib;ws2_32.lib;msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>d:\Development\TEST\miranda-im-stable-unicode\Plugins\$(TargetFileName)</OutputFile>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_WIN64;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>common.h</PrecompiledHeaderFile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;ws2_32.lib;msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetFileName)</OutputFile>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX64</TargetMachine>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ </Link>
+ <Manifest>
+ <OutputManifestFile>$(TargetPath).manifest</OutputManifestFile>
+ </Manifest>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MinSpace</Optimization>
+ <InlineFunctionExpansion>Default</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>false</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>common.h</PrecompiledHeaderFile>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>Cdecl</CallingConvention>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>unicows.lib;comctl32.lib;ws2_32.lib;msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetFileName)</OutputFile>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MinSpace</Optimization>
+ <InlineFunctionExpansion>Default</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_WIN64;_WINDOWS;_USRDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>false</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>common.h</PrecompiledHeaderFile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>Cdecl</CallingConvention>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;ws2_32.lib;msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetFileName)</OutputFile>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'">
+ <ClCompile>
+ <Optimization>MinSpace</Optimization>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>common.h</PrecompiledHeaderFile>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;ws2_32.lib;msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetFileName)</OutputFile>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MinSpace</Optimization>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_WIN64;_WINDOWS;_USRDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>common.h</PrecompiledHeaderFile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;ws2_32.lib;msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetFileName)</OutputFile>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>Default</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>common.h</PrecompiledHeaderFile>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>Cdecl</CallingConvention>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>unicows.lib;comctl32.lib;ws2_32.lib;msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetFileName)</OutputFile>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>Default</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_WIN64;_WINDOWS;_USRDLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>common.h</PrecompiledHeaderFile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>Cdecl</CallingConvention>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;ws2_32.lib;msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetFileName)</OutputFile>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="bitmap_func.cpp" />
+ <ClCompile Include="message_pump.cpp">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="mir_smileys.cpp" />
+ <ClCompile Include="options.cpp">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="popwin.cpp">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="preset_items.cpp" />
+ <ClCompile Include="skin_parser.cpp" />
+ <ClCompile Include="str_utils.cpp" />
+ <ClCompile Include="subst.cpp" />
+ <ClCompile Include="tipper.cpp">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (SSE2)|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release (ansi)|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="translations.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="bitmap_func.h" />
+ <ClInclude Include="common.h" />
+ <ClInclude Include="docs\m_tipper.h" />
+ <ClInclude Include="message_pump.h" />
+ <ClInclude Include="mir_smileys.h" />
+ <ClInclude Include="options.h" />
+ <ClInclude Include="popwin.h" />
+ <ClInclude Include="preset_items.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="skin_parser.h" />
+ <ClInclude Include="str_utils.h" />
+ <ClInclude Include="subst.h" />
+ <ClInclude Include="translations.h" />
+ <ClInclude Include="version.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\apply.ico" />
+ <None Include="res\arrow_down.ico" />
+ <None Include="res\arrow_up.ico" />
+ <None Include="res\copy_all_items.ico" />
+ <None Include="res\copy_item.ico" />
+ <None Include="res\reload.ico" />
+ <None Include="res\separator.ico" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="resource.rc" />
+ <ResourceCompile Include="version.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/TipperYM/tipper_ym_10.vcxproj.filters b/plugins/TipperYM/tipper_ym_10.vcxproj.filters new file mode 100644 index 0000000000..bc0a733352 --- /dev/null +++ b/plugins/TipperYM/tipper_ym_10.vcxproj.filters @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="bitmap_func.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="message_pump.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mir_smileys.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="options.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="popwin.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="preset_items.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="skin_parser.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="str_utils.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="subst.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="tipper.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="translations.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="bitmap_func.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="common.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="docs\m_tipper.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="message_pump.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mir_smileys.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="options.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="popwin.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="preset_items.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="skin_parser.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="str_utils.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="subst.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="translations.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="version.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\apply.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\arrow_down.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\arrow_up.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\copy_all_items.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\copy_item.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\reload.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\separator.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="resource.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ <ResourceCompile Include="version.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/TipperYM/tipper_ym_9.vcproj b/plugins/TipperYM/tipper_ym_9.vcproj new file mode 100644 index 0000000000..1b22acdf40 --- /dev/null +++ b/plugins/TipperYM/tipper_ym_9.vcproj @@ -0,0 +1,1149 @@ +<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="tipper_ym"
+ ProjectGUID="{2C818919-A38F-44FF-BD91-A6A204AC592A}"
+ RootNamespace="tipper"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="common.h"
+ DebugInformationFormat="4"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="unicows.lib comctl32.lib ws2_32.lib msimg32.lib"
+ OutputFile="$(OutDir)\tipper.dll"
+ LinkIncremental="2"
+ GenerateManifest="true"
+ AdditionalManifestDependencies=""type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64"
+ IntermediateDirectory="$(ConfigurationName)64"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="_WIN64;_DEBUG;_WINDOWS;_USRDLL;TIPPER_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="common.h"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib ws2_32.lib msimg32.lib"
+ OutputFile="$(OutDir)\tipper.dll"
+ LinkIncremental="2"
+ GenerateManifest="true"
+ AdditionalManifestDependencies=""type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ InlineFunctionExpansion="0"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
+ StringPooling="false"
+ MinimalRebuild="true"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="common.h"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="2"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="unicows.lib comctl32.lib ws2_32.lib msimg32.lib"
+ OutputFile="$(OutDir)\tipper.dll"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ AdditionalManifestDependencies=""type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'""
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ EmbedManifest="false"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64"
+ IntermediateDirectory="$(ConfigurationName)64"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ InlineFunctionExpansion="0"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="_WIN64;_WINDOWS;_USRDLL;NDEBUG"
+ StringPooling="false"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="common.h"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="2"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib ws2_32.lib msimg32.lib"
+ OutputFile="$(OutDir)\tipper.dll"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ AdditionalManifestDependencies=""type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'""
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ EmbedManifest="false"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release (ansi)|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="common.h"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib ws2_32.lib msimg32.lib"
+ OutputFile="$(OutDir)\tipper.dll"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ AdditionalManifestDependencies=""type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'""
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ EmbedManifest="false"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release (ansi)|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64"
+ IntermediateDirectory="$(ConfigurationName)64"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="_WIN64;_WINDOWS;_USRDLL;NDEBUG"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="common.h"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib ws2_32.lib msimg32.lib"
+ OutputFile="$(OutDir)\tipper.dll"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ AdditionalManifestDependencies=""type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'""
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ EmbedManifest="false"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release (SSE2)|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="0"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="2"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
+ StringPooling="true"
+ MinimalRebuild="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableEnhancedInstructionSet="2"
+ FloatingPointModel="2"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="common.h"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="2"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="unicows.lib comctl32.lib ws2_32.lib msimg32.lib"
+ OutputFile="$(OutDir)\tipper.dll"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ AdditionalManifestDependencies=""type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'""
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="false"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ EmbedManifest="false"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release (SSE2)|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64"
+ IntermediateDirectory="$(ConfigurationName)64"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="0"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="2"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="_WIN64;_WINDOWS;_USRDLL;NDEBUG"
+ StringPooling="true"
+ MinimalRebuild="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableEnhancedInstructionSet="2"
+ FloatingPointModel="2"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="common.h"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="2"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib ws2_32.lib msimg32.lib"
+ OutputFile="$(OutDir)\tipper.dll"
+ LinkIncremental="1"
+ GenerateManifest="false"
+ AdditionalManifestDependencies=""type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'""
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="false"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ EmbedManifest="false"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine=""
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\bitmap_func.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\message_pump.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (SSE2)|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (SSE2)|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\mir_smileys.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\options.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (SSE2)|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (SSE2)|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\popwin.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (SSE2)|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (SSE2)|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="2"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\preset_items.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\skin_parser.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\str_utils.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\subst.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\tipper.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (ansi)|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (SSE2)|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release (SSE2)|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\translations.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\bitmap_func.h"
+ >
+ </File>
+ <File
+ RelativePath=".\common.h"
+ >
+ </File>
+ <File
+ RelativePath=".\docs\m_tipper.h"
+ >
+ </File>
+ <File
+ RelativePath=".\message_pump.h"
+ >
+ </File>
+ <File
+ RelativePath=".\mir_smileys.h"
+ >
+ </File>
+ <File
+ RelativePath=".\options.h"
+ >
+ </File>
+ <File
+ RelativePath=".\popwin.h"
+ >
+ </File>
+ <File
+ RelativePath=".\preset_items.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\skin_parser.h"
+ >
+ </File>
+ <File
+ RelativePath=".\str_utils.h"
+ >
+ </File>
+ <File
+ RelativePath=".\subst.h"
+ >
+ </File>
+ <File
+ RelativePath=".\translations.h"
+ >
+ </File>
+ <File
+ RelativePath=".\version.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath=".\res\apply.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\arrow_down.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\arrow_up.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\copy_all_items.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\copy_item.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\reload.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\res\separator.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\version.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/plugins/TipperYM/translations.cpp b/plugins/TipperYM/translations.cpp new file mode 100644 index 0000000000..8b3eb3a3b5 --- /dev/null +++ b/plugins/TipperYM/translations.cpp @@ -0,0 +1,814 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#include "common.h"
+#include "translations.h"
+#include "subst.h"
+#include "str_utils.h"
+
+int iTransFuncsCount = 0;
+DBVTranslation *translations = 0;
+
+DWORD dwNextFuncId;
+HANDLE hServiceAdd;
+
+
+void AddTranslation(DBVTranslation *newTrans)
+{
+ iTransFuncsCount++;
+
+ translations = (DBVTranslation *)mir_realloc(translations, sizeof(DBVTranslation) * iTransFuncsCount);
+ translations[iTransFuncsCount - 1] = *newTrans;
+
+ char *szName = mir_t2a(newTrans->swzName);
+ char szSetting[256] = "Trans_";
+ strcat(szSetting, szName);
+
+ if (_tcscmp(newTrans->swzName, _T("[No translation]")) == 0)
+ {
+ translations[iTransFuncsCount - 1].id = 0;
+ }
+ else
+ {
+ DWORD id = DBGetContactSettingDword(0, MODULE_ITEMS, szSetting, 0);
+ if (id != 0)
+ {
+ translations[iTransFuncsCount - 1].id = id;
+ if (dwNextFuncId <= id) dwNextFuncId = id + 1;
+ }
+ else
+ {
+ translations[iTransFuncsCount - 1].id = dwNextFuncId++;
+ DBWriteContactSettingDword(0, MODULE_ITEMS, szSetting, translations[iTransFuncsCount - 1].id);
+ }
+
+ DBWriteContactSettingDword(0, MODULE_ITEMS, "NextFuncId", dwNextFuncId);
+ }
+
+ mir_free(szName);
+}
+
+TCHAR *NullTranslation(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ if (DBGetContactSettingAsString(hContact, szModuleName, szSettingName, buff, bufflen))
+ return buff;
+ return NULL;
+}
+
+TCHAR *TimestampToShortDate(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ if (ts == 0) return 0;
+
+ DBTIMETOSTRINGT dbt = {0};
+ dbt.cbDest = bufflen;
+ dbt.szDest = buff;
+ dbt.szFormat = _T("d");
+ CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt);
+ return buff;
+}
+
+TCHAR *TimestampToLongDate(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ if (ts == 0) return 0;
+
+ DBTIMETOSTRINGT dbt = {0};
+ dbt.cbDest = bufflen;
+ dbt.szDest = buff;
+ dbt.szFormat = _T("D");
+ CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt);
+ return buff;
+}
+
+TCHAR *TimestampToTime(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ if (ts == 0) return 0;
+
+ DBTIMETOSTRINGT dbt = {0};
+ dbt.cbDest = bufflen;
+ dbt.szDest = buff;
+ dbt.szFormat = _T("s");
+ CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt);
+ return buff;
+}
+
+TCHAR *TimestampToTimeNoSecs(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ if (ts == 0) return 0;
+
+ DBTIMETOSTRINGT dbt = {0};
+ dbt.cbDest = bufflen;
+ dbt.szDest = buff;
+ dbt.szFormat = _T("t");
+ CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt);
+ return buff;
+}
+
+TCHAR *TimestampToTimeDifference(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD t = (DWORD)time(0);
+ if (ts == 0) return 0;
+
+ DWORD diff = (ts > t) ? 0 : (t - ts);
+ int d = (diff / 60 / 60 / 24);
+ int h = (diff - d * 60 * 60 * 24) / 60 / 60;
+ int m = (diff - d * 60 * 60 * 24 - h * 60 * 60) / 60;
+ if (d > 0)
+ mir_sntprintf(buff, bufflen, TranslateT("%dd %dh %dm"), d, h, m);
+ else if (h > 0)
+ mir_sntprintf(buff, bufflen, TranslateT("%dh %dm"), h, m);
+ else
+ mir_sntprintf(buff, bufflen, TranslateT("%dm"), m);
+
+ return buff;
+}
+
+TCHAR *SecondsToTimeDifference(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ DWORD diff = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ int d = (diff / 60 / 60 / 24);
+ int h = (diff - d * 60 * 60 * 24) / 60 / 60;
+ int m = (diff - d * 60 * 60 * 24 - h * 60 * 60) / 60;
+ if (d > 0)
+ mir_sntprintf(buff, bufflen, TranslateT("%dd %dh %dm"), d, h, m);
+ else if (h > 0)
+ mir_sntprintf(buff, bufflen, TranslateT("%dh %dm"), h, m);
+ else
+ mir_sntprintf(buff, bufflen, TranslateT("%dm"), m);
+
+ return buff;
+}
+
+TCHAR *WordToStatusDesc(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ WORD wStatus = DBGetContactSettingWord(hContact, szModuleName, szSettingName, ID_STATUS_OFFLINE);
+ char *szStatus = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)wStatus, (LPARAM)0);
+ a2t(szStatus, buff, bufflen);
+ buff[bufflen - 1] = 0;
+ return buff;
+}
+
+TCHAR *ByteToYesNo(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ DBVARIANT dbv;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ if (dbv.type == DBVT_BYTE)
+ {
+ if (dbv.bVal != 0)
+ _tcsncpy(buff, _T("Yes"), bufflen);
+ else
+ _tcsncpy(buff, _T("No"), bufflen);
+ buff[bufflen - 1] = 0;
+ DBFreeVariant(&dbv);
+ return buff;
+ }
+ DBFreeVariant(&dbv);
+ }
+ return 0;
+}
+
+TCHAR *ByteToGender(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ BYTE val = (BYTE)DBGetContactSettingByte(hContact, szModuleName, szSettingName, 0);
+ if (val == 'F')
+ _tcsncpy(buff, TranslateT("Female"), bufflen);
+ else if (val == 'M')
+ _tcsncpy(buff, TranslateT("Male"), bufflen);
+ else
+ return 0;
+
+ buff[bufflen - 1] = 0;
+ return buff;
+}
+
+TCHAR *WordToCountry(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ char *szCountryName = 0;
+ WORD cid = (WORD)DBGetContactSettingWord(hContact, szModuleName, szSettingName, (WORD)-1);
+ if (cid != (WORD)-1 && ServiceExists(MS_UTILS_GETCOUNTRYBYNUMBER) && (szCountryName = (char *)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, cid, 0)) != 0)
+ {
+ if (strcmp(szCountryName, "Unknown") == 0)
+ return 0;
+ a2t(szCountryName, buff, bufflen);
+ buff[bufflen - 1] = 0;
+ return buff;
+ }
+ return 0;
+}
+
+TCHAR *DwordToIp(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ DWORD ip = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ if (ip) {
+ unsigned char *ipc = (unsigned char*)&ip;
+ mir_sntprintf(buff, bufflen, _T("%u.%u.%u.%u"), ipc[3], ipc[2], ipc[1], ipc[0]);
+ return buff;
+ }
+ return 0;
+}
+
+bool GetInt(const DBVARIANT &dbv, int *iVal)
+{
+ if (!iVal) return false;
+
+ switch(dbv.type)
+ {
+ case DBVT_BYTE:
+ if (iVal) *iVal = (int)dbv.bVal;
+ return true;
+ case DBVT_WORD:
+ if (iVal) *iVal = (int)dbv.wVal;
+ return true;
+ case DBVT_DWORD:
+ if (iVal) *iVal = (int)dbv.dVal;
+ return true;
+ }
+ return false;
+}
+
+TCHAR *DayMonthYearToDate(HANDLE hContact, const char *szModuleName, const char *prefix, TCHAR *buff, int bufflen)
+{
+ DBVARIANT dbv;
+ char szSettingName[256];
+ mir_snprintf(szSettingName, 256, "%sDay", prefix);
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ int day = 0;
+ if (GetInt(dbv, &day))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sMonth", prefix);
+ int month = 0;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ if (GetInt(dbv, &month))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sYear", prefix);
+ int year = 0;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ if (GetInt(dbv, &year))
+ {
+ DBFreeVariant(&dbv);
+
+ SYSTEMTIME st = {0};
+ st.wDay = day;
+ st.wMonth = month;
+ st.wYear = year;
+
+ GetDateFormat(LOCALE_USER_DEFAULT, 0, &st, 0, buff, bufflen);
+ return buff;
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ return 0;
+}
+
+TCHAR *DayMonthYearToAge(HANDLE hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+{
+ DBVARIANT dbv;
+ char szSettingName[256];
+ mir_snprintf(szSettingName, 256, "%sDay", szPrefix);
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ int day = 0;
+ if (GetInt(dbv, &day))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sMonth", szPrefix);
+ int month = 0;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ if (GetInt(dbv, &month))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sYear", szPrefix);
+ int year = 0;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ if (GetInt(dbv, &year))
+ {
+ DBFreeVariant(&dbv);
+
+ SYSTEMTIME now;
+ GetLocalTime(&now);
+
+ int age = now.wYear - year;
+ if (now.wMonth < month || (now.wMonth == month && now.wDay < day))
+ age--;
+ mir_sntprintf(buff, bufflen, _T("%d"), age);
+ return buff;
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ return 0;
+}
+
+TCHAR *HoursMinutesSecondsToTime(HANDLE hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+{
+ DBVARIANT dbv;
+ char szSettingName[256];
+ mir_snprintf(szSettingName, 256, "%sHours", szPrefix);
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ int hours = 0;
+ if (GetInt(dbv, &hours))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sMinutes", szPrefix);
+ int minutes = 0;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ if (GetInt(dbv, &minutes))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sSeconds", szPrefix);
+ int seconds = 0;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ GetInt(dbv, &seconds);
+ DBFreeVariant(&dbv);
+ }
+
+ SYSTEMTIME st = {0};
+ st.wHour = hours;
+ st.wMinute = minutes;
+ st.wSecond = seconds;
+
+ GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, 0, buff, bufflen);
+ return buff;
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ return 0;
+}
+
+TCHAR *HoursMinutesToTime(HANDLE hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+{
+ DBVARIANT dbv;
+ char szSettingName[256];
+ mir_snprintf(szSettingName, 256, "%sHours", szPrefix);
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ int hours = 0;
+ if (GetInt(dbv, &hours))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sMinutes", szPrefix);
+ int minutes = 0;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ if (GetInt(dbv, &minutes))
+ {
+ DBFreeVariant(&dbv);
+
+ SYSTEMTIME st = {0};
+ st.wHour = hours;
+ st.wMinute = minutes;
+
+ GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, 0, buff, bufflen);
+ return buff;
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ return 0;
+}
+
+TCHAR *DayMonthYearHoursMinutesSecondsToTimeDifference(HANDLE hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+{
+ DBVARIANT dbv;
+ char szSettingName[256];
+ mir_snprintf(szSettingName, 256, "%sDay", szPrefix);
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ int day = 0;
+ if (GetInt(dbv, &day))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sMonth", szPrefix);
+ int month = 0;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ if (GetInt(dbv, &month))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sYear", szPrefix);
+ int year = 0;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ if (GetInt(dbv, &year))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sHours", szPrefix);
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ int hours = 0;
+ if (GetInt(dbv, &hours))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sMinutes", szPrefix);
+ int minutes = 0;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ if (GetInt(dbv, &minutes))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sSeconds", szPrefix);
+ int seconds = 0;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ GetInt(dbv, &seconds);
+ DBFreeVariant(&dbv);
+ }
+
+ SYSTEMTIME st = {0}, st_now;
+ st.wDay = day;
+ st.wMonth = month;
+ st.wYear = year;
+ st.wHour = hours;
+ st.wMinute = minutes;
+ st.wSecond = seconds;
+ GetLocalTime(&st_now);
+
+ FILETIME ft, ft_now;
+ SystemTimeToFileTime(&st, &ft);
+ SystemTimeToFileTime(&st_now, &ft_now);
+
+ LARGE_INTEGER li, li_now;
+ li.HighPart = ft.dwHighDateTime; li.LowPart = ft.dwLowDateTime;
+ li_now.HighPart = ft_now.dwHighDateTime; li_now.LowPart = ft_now.dwLowDateTime;
+
+ long diff = (long)((li_now.QuadPart - li.QuadPart) / (LONGLONG)10000000L);
+ int y = diff / 60 / 60 / 24 / 365;
+ int d = (diff - y * 60 * 60 * 24 * 365) / 60 / 60 / 24;
+ int h = (diff - y * 60 * 60 * 24 * 365 - d * 60 * 60 * 24) / 60 / 60;
+ int m = (diff - y * 60 * 60 * 24 * 365 - d * 60 * 60 * 24 - h * 60 * 60) / 60;
+ if (y != 0)
+ mir_sntprintf(buff, bufflen, TranslateT("%dy %dd %dh %dm"), y, d, h, m);
+ else if (d != 0)
+ mir_sntprintf(buff, bufflen, TranslateT("%dd %dh %dm"), d, h, m);
+ else if (h != 0)
+ mir_sntprintf(buff, bufflen, TranslateT("%dh %dm"), h, m);
+ else
+ mir_sntprintf(buff, bufflen, TranslateT("%dm"), m);
+
+ return buff;
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ }
+ else
+ DBFreeVariant(&dbv);
+ }
+ return 0;
+}
+
+TCHAR *DayMonthToDaysToNextBirthday(HANDLE hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+{
+ DBVARIANT dbv;
+ char szSettingName[256];
+ mir_snprintf(szSettingName, 256, "%sDay", szPrefix);
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ int day = 0;
+ if (GetInt(dbv, &day))
+ {
+ DBFreeVariant(&dbv);
+ mir_snprintf(szSettingName, 256, "%sMonth", szPrefix);
+ int month = 0;
+ if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ {
+ if (GetInt(dbv, &month))
+ {
+ DBFreeVariant(&dbv);
+ time_t now = time(NULL);
+ struct tm *ti = localtime(&now);
+ int yday_now = ti->tm_yday;
+
+ ti->tm_mday = day;
+ ti->tm_mon = month - 1;
+ mktime(ti);
+
+ int yday_birth = ti->tm_yday;
+ if (yday_birth < yday_now)
+ {
+ yday_now -= 365;
+ yday_now -= (ti->tm_year % 4) ? 0 : 1;
+ }
+
+ int diff = yday_birth - yday_now;
+ mir_sntprintf(buff, bufflen, TranslateT("%dd"), diff);
+
+ return buff;
+ }
+ else
+ {
+ DBFreeVariant(&dbv);
+ }
+ }
+ }
+ else
+ {
+ DBFreeVariant(&dbv);
+ }
+ }
+ return 0;
+}
+
+
+TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ TCHAR szDefaultName[1024];
+ ICQ_CUSTOM_STATUS xstatus = {0};
+ DBVARIANT dbv;
+
+ // translate jabber mood
+ if (ProtoServiceExists(szModuleName, "/SendXML")) // jabber protocol?
+ {
+ if (!DBGetContactSettingTString(hContact, szModuleName, szSettingName, &dbv))
+ {
+ _tcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
+ buff[bufflen - 1] = 0;
+ return buff;
+ }
+ }
+
+ if (NullTranslation(hContact, szModuleName, szSettingName, buff, bufflen))
+ return buff;
+
+ int status = DBGetContactSettingByte(hContact, szModuleName, "XStatusId", 0);
+ if (!status) return 0;
+
+ if (ProtoServiceExists(szModuleName, PS_ICQ_GETCUSTOMSTATUSEX))
+ {
+ xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS);
+ xstatus.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
+ xstatus.ptszName = szDefaultName;
+ xstatus.wParam = (WPARAM *)&status;
+ if (CallProtoService(szModuleName, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
+ return 0;
+
+ _tcsncpy(buff, TranslateTS(szDefaultName), bufflen);
+ buff[bufflen - 1] = 0;
+ return buff;
+ }
+
+ return 0;
+}
+
+TCHAR *TimezoneToTime(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ int timezone = DBGetContactSettingByte(hContact,szModuleName,szSettingName,256);
+ if (timezone==256 || (char)timezone==-100)
+ return 0;
+
+ TIME_ZONE_INFORMATION tzi;
+ FILETIME ft;
+ LARGE_INTEGER lift;
+ SYSTEMTIME st;
+
+ timezone=(char)timezone;
+ GetSystemTimeAsFileTime(&ft);
+ if (GetTimeZoneInformation(&tzi) == TIME_ZONE_ID_DAYLIGHT)
+ timezone += tzi.DaylightBias / 30;
+
+ lift.QuadPart = *(__int64*)&ft;
+ lift.QuadPart -= (__int64)timezone * BIGI(30) * BIGI(60) * BIGI(10000000);
+ *(__int64*)&ft = lift.QuadPart;
+ FileTimeToSystemTime(&ft, &st);
+ GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buff, bufflen);
+
+ return buff;
+}
+
+TCHAR *ByteToDay(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ int iDay = DBGetContactSettingWord(hContact, szModuleName, szSettingName, -1);
+ if (iDay > -1 && iDay < 7)
+ {
+ a2t(Translate(days[iDay]), buff, bufflen);
+ buff[bufflen - 1] = 0;
+ return buff;
+ }
+
+ return 0;
+}
+
+TCHAR *ByteToMonth(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ int iMonth = DBGetContactSettingWord(hContact, szModuleName, szSettingName, 0);
+ if (iMonth > 0 && iMonth < 13)
+ {
+ a2t(Translate(months[iMonth - 1]), buff, bufflen);
+ buff[bufflen - 1] = 0;
+ return buff;
+ }
+
+ return 0;
+}
+
+TCHAR *ByteToLanguage(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+{
+ int iLang = DBGetContactSettingByte(hContact, szModuleName, szSettingName, 0);
+ if (iLang)
+ {
+ for (int i = 0; i < SIZEOF(languages); i++)
+ {
+ if (iLang == languages[i].id)
+ {
+ a2t(Translate(languages[i].szValue), buff, bufflen);
+ buff[bufflen - 1] = 0;
+ return buff;
+ }
+ }
+ }
+
+ return 0;
+}
+
+INT_PTR ServiceAddTranslation(WPARAM wParam, LPARAM lParam)
+{
+ if (!lParam) return 1;
+
+ DBVTranslation *trans = (DBVTranslation *)lParam;
+ AddTranslation(trans);
+
+ return 0;
+}
+
+#define INT_TRANS_COUNT 23
+void InitTranslations()
+{
+ dwNextFuncId = DBGetContactSettingDword(0, MODULE_ITEMS, "NextFuncId", 1);
+ DBVTranslation internalTranslations[INT_TRANS_COUNT] =
+ {
+ {
+ (TranslateFunc *)NullTranslation,
+ _T("[No translation]"),
+ },
+ {
+ (TranslateFunc *)WordToStatusDesc,
+ _T("WORD to status description")
+ },
+ {
+ (TranslateFunc *)TimestampToTime,
+ _T("DWORD timestamp to time")
+ },
+ {
+ (TranslateFunc *)TimestampToTimeDifference,
+ _T("DWORD timestamp to time difference")
+ },
+ {
+ (TranslateFunc *)ByteToYesNo,
+ _T("BYTE to Yes/No")
+ },
+ {
+ (TranslateFunc *)ByteToGender,
+ _T("BYTE to Male/Female (ICQ)")
+ },
+ {
+ (TranslateFunc *)WordToCountry,
+ _T("WORD to country name")
+ },
+ {
+ (TranslateFunc *)DwordToIp,
+ _T("DWORD to ip address")
+ },
+ {
+ (TranslateFunc *)DayMonthYearToDate,
+ _T("<prefix>Day|Month|Year to date")
+ },
+ {
+ (TranslateFunc *)DayMonthYearToAge,
+ _T("<prefix>Day|Month|Year to age")
+ },
+ {
+ (TranslateFunc *)HoursMinutesSecondsToTime,
+ _T("<prefix>Hours|Minutes|Seconds to time")
+ },
+ {
+ (TranslateFunc *)DayMonthYearHoursMinutesSecondsToTimeDifference,
+ _T("<prefix>Day|Month|Year|Hours|Minutes|Seconds to time difference")
+ },
+ {
+ (TranslateFunc *)DayMonthToDaysToNextBirthday,
+ _T("<prefix>Day|Month to days to next birthday")
+ },
+ {
+ (TranslateFunc *)TimestampToTimeNoSecs,
+ _T("DWORD timestamp to time (no seconds)")
+ },
+ {
+ (TranslateFunc *)HoursMinutesToTime,
+ _T("<prefix>Hours|Minutes to time")
+ },
+ {
+ (TranslateFunc *)TimestampToShortDate,
+ _T("DWORD timestamp to date (short)")
+ },
+ {
+ (TranslateFunc *)TimestampToLongDate,
+ _T("DWORD timestamp to date (long)")
+ },
+ {
+ (TranslateFunc *)EmptyXStatusToDefaultName,
+ _T("xStatus: empty xStatus name to default name")
+ },
+ {
+ (TranslateFunc *)SecondsToTimeDifference,
+ _T("DWORD seconds to time difference")
+ },
+ {
+ (TranslateFunc *)TimezoneToTime,
+ _T("BYTE timezone to time")
+ },
+ {
+ (TranslateFunc *)ByteToDay,
+ _T("WORD to name of a day (0..6, 0 is Sunday)")
+ },
+ {
+ (TranslateFunc *)ByteToMonth,
+ _T("WORD to name of a month (1..12, 1 is January)")
+ },
+ {
+ (TranslateFunc *)ByteToLanguage,
+ _T("BYTE to language (ICQ)")
+ }
+ };
+
+ for (int i = 0; i < INT_TRANS_COUNT; i++)
+ AddTranslation(&internalTranslations[i]);
+
+ hServiceAdd = CreateServiceFunction(MS_TIPPER_ADDTRANSLATION, ServiceAddTranslation);
+}
+
+void DeinitTranslations()
+{
+ DestroyServiceFunction(hServiceAdd);
+ mir_free(translations);
+}
+
diff --git a/plugins/TipperYM/translations.h b/plugins/TipperYM/translations.h new file mode 100644 index 0000000000..985920054e --- /dev/null +++ b/plugins/TipperYM/translations.h @@ -0,0 +1,125 @@ +/*
+Copyright (C) 2006-2007 Scott Ellis
+Copyright (C) 2007-2011 Jan Holub
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _TRANSLATIONS_INC
+#define _TRANSLATIONS_INC
+
+extern int iTransFuncsCount;
+extern DBVTranslation *translations;
+
+typedef struct {
+ int id;
+ char *szValue;
+} LISTTYPEDATAITEM;
+
+static LISTTYPEDATAITEM languages[] = {
+ {0, LPGEN("None")},
+ {55,LPGEN("Afrikaans")},
+ {58,LPGEN("Albanian")},
+ {1, LPGEN("Arabic")},
+ {59,LPGEN("Armenian")},
+ {68,LPGEN("Azerbaijani")},
+ {72,LPGEN("Belorussian")},
+ {2, LPGEN("Bhojpuri")},
+ {56,LPGEN("Bosnian")},
+ {3, LPGEN("Bulgarian")},
+ {4, LPGEN("Burmese")},
+ {5, LPGEN("Cantonese")},
+ {6, LPGEN("Catalan")},
+ {61,LPGEN("Chamorro")},
+ {7, LPGEN("Chinese")},
+ {8, LPGEN("Croatian")},
+ {9, LPGEN("Czech")},
+ {10,LPGEN("Danish")},
+ {11,LPGEN("Dutch")},
+ {12,LPGEN("English")},
+ {13,LPGEN("Esperanto")},
+ {14,LPGEN("Estonian")},
+ {15,LPGEN("Farsi")},
+ {16,LPGEN("Finnish")},
+ {17,LPGEN("French")},
+ {18,LPGEN("Gaelic")},
+ {19,LPGEN("German")},
+ {20,LPGEN("Greek")},
+ {70,LPGEN("Gujarati")},
+ {21,LPGEN("Hebrew")},
+ {22,LPGEN("Hindi")},
+ {23,LPGEN("Hungarian")},
+ {24,LPGEN("Icelandic")},
+ {25,LPGEN("Indonesian")},
+ {26,LPGEN("Italian")},
+ {27,LPGEN("Japanese")},
+ {28,LPGEN("Khmer")},
+ {29,LPGEN("Korean")},
+ {69,LPGEN("Kurdish")},
+ {30,LPGEN("Lao")},
+ {31,LPGEN("Latvian")},
+ {32,LPGEN("Lithuanian")},
+ {65,LPGEN("Macedonian")},
+ {33,LPGEN("Malay")},
+ {63,LPGEN("Mandarin")},
+ {62,LPGEN("Mongolian")},
+ {34,LPGEN("Norwegian")},
+ {57,LPGEN("Persian")},
+ {35,LPGEN("Polish")},
+ {36,LPGEN("Portuguese")},
+ {60,LPGEN("Punjabi")},
+ {37,LPGEN("Romanian")},
+ {38,LPGEN("Russian")},
+ {39,LPGEN("Serbo-Croatian")},
+ {66,LPGEN("Sindhi")},
+ {40,LPGEN("Slovak")},
+ {41,LPGEN("Slovenian")},
+ {42,LPGEN("Somali")},
+ {43,LPGEN("Spanish")},
+ {44,LPGEN("Swahili")},
+ {45,LPGEN("Swedish")},
+ {46,LPGEN("Tagalog")},
+ {64,LPGEN("Taiwanese")},
+ {71,LPGEN("Tamil")},
+ {47,LPGEN("Tatar")},
+ {48,LPGEN("Thai")},
+ {49,LPGEN("Turkish")},
+ {50,LPGEN("Ukrainian")},
+ {51,LPGEN("Urdu")},
+ {52,LPGEN("Vietnamese")},
+ {67,LPGEN("Welsh")},
+ {53,LPGEN("Yiddish")},
+ {54,LPGEN("Yoruba")},
+};
+
+static char *days[7] = {
+ LPGEN("Sunday"), LPGEN("Monday"), LPGEN("Tuesday"), LPGEN("Wednesday"), LPGEN("Thursday"), LPGEN("Friday"), LPGEN("Saturday")
+};
+
+static char *months[12] = {
+ LPGEN("January"), LPGEN("February"), LPGEN("March"), LPGEN("April"), LPGEN("May"), LPGEN("June"),
+ LPGEN("July"), LPGEN("August"), LPGEN("September"), LPGEN("October"), LPGEN("November"), LPGEN("December")
+};
+
+void InitTranslations();
+void DeinitTranslations();
+
+TCHAR *TimestampToTimeDifference(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+TCHAR *WordToStatusDesc(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+
+
+#endif
diff --git a/plugins/TipperYM/version.h b/plugins/TipperYM/version.h new file mode 100644 index 0000000000..c71b187bc0 --- /dev/null +++ b/plugins/TipperYM/version.h @@ -0,0 +1,4 @@ +#define __FILEVERSION_STRING 2,1,0,4
+#define __VERSION_STRING "2.1.0.4"
+#define __VERSION_DWORD PLUGIN_MAKE_VERSION(2, 1, 0, 4)
+
diff --git a/plugins/TipperYM/version.rc b/plugins/TipperYM/version.rc new file mode 100644 index 0000000000..a5431dcae0 --- /dev/null +++ b/plugins/TipperYM/version.rc @@ -0,0 +1,37 @@ +
+#include <windows.h>
+#include "version.h"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION __FILEVERSION_STRING
+ PRODUCTVERSION __FILEVERSION_STRING
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "Author", "Scott Ellis, yaho"
+ VALUE "CompanyName", "yaho"
+ VALUE "FileDescription", "Tool Tip notification windows"
+ VALUE "FileVersion", __VERSION_STRING
+ VALUE "InternalName", "Tipper YM"
+ VALUE "LegalCopyright", "(c) 2005-2007 Scott Ellis, 2007-2011 Jan Holub"
+ VALUE "OriginalFilename", "tipper.dll"
+ VALUE "ProductName", "Tipper YM"
+ VALUE "ProductVersion", __VERSION_STRING
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0, 1200
+ END
+END
|