summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-01 22:15:26 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-01 22:15:26 +0000
commit612fc2f36903f0168f88622f61e1a0de4dae5b92 (patch)
tree7ba72966a7ed48a480b01e4b964d85fecdcbb725 /plugins
parentacd4daf132c8ff3b05df7615e95f60be2fb82ddb (diff)
- atavism named MS_UTILS_LOADBITMAP removed;
- bmpfilter.cpp also removed; - Bitmap_Load() function added instead; - various bitmap related crap fixed; git-svn-id: http://svn.miranda-ng.org/main/trunk@13966 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AVS/src/options.cpp6
-rw-r--r--plugins/AVS/src/services.cpp2
-rw-r--r--plugins/AvatarHistory/src/AvatarDlg.cpp2
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp18
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_clistevents.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp250
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp9
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp8
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp10
-rw-r--r--plugins/Clist_nicer/src/clcopts.cpp2
-rw-r--r--plugins/Clist_nicer/src/extBackg.cpp2
-rw-r--r--plugins/FloatingContacts/src/main.cpp10
-rw-r--r--plugins/FloatingContacts/src/options.cpp2
-rw-r--r--plugins/ModernOpt/src/mopt_selector.cpp12
-rw-r--r--plugins/SimpleStatusMsg/src/msgbox.cpp25
-rw-r--r--plugins/TopToolBar/src/toolbarwnd.cpp9
19 files changed, 84 insertions, 311 deletions
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp
index 4dc593fcd2..8cd31b023b 100644
--- a/plugins/AVS/src/options.cpp
+++ b/plugins/AVS/src/options.cpp
@@ -100,7 +100,7 @@ static void RemoveProtoPic(const char *szProto)
static void SetProtoPic(char *szProto)
{
TCHAR FileName[MAX_PATH], filter[256];
- BmpFilterGetStrings(filter, SIZEOF(filter));
+ Bitmap_GetFilter(filter, SIZEOF(filter));
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
@@ -706,7 +706,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = g_hInst;
odp.flags = ODPF_BOLDGROUPS;
odp.pszGroup = LPGEN("Contacts");
@@ -1101,7 +1101,7 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP
int OnDetailsInit(WPARAM wParam, LPARAM lParam)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = { 0 };
odp.hIcon = g_hIcon;
odp.hInstance = g_hInst;
odp.pszTitle = LPGEN("Avatar");
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp
index 7411849efa..1f3fd7441b 100644
--- a/plugins/AVS/src/services.cpp
+++ b/plugins/AVS/src/services.cpp
@@ -128,7 +128,7 @@ static INT_PTR avSetAvatar(MCONTACT hContact, TCHAR *tszPath)
if (tszPath == NULL) {
TCHAR filter[256];
- BmpFilterGetStrings(filter, SIZEOF(filter));
+ Bitmap_GetFilter(filter, SIZEOF(filter));
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp
index 3489960f50..a6e8a24029 100644
--- a/plugins/AvatarHistory/src/AvatarDlg.cpp
+++ b/plugins/AvatarHistory/src/AvatarDlg.cpp
@@ -538,7 +538,7 @@ static INT_PTR ShowDialogSvc(WPARAM wParam, LPARAM lParam)
int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact)
{
TCHAR filter[MAX_PATH], file[MAX_PATH];
- BmpFilterGetStrings(filter, SIZEOF(filter));
+ Bitmap_GetFilter(filter, SIZEOF(filter));
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
index 49cfb9bd80..a472ded4b1 100644
--- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
@@ -2506,29 +2506,29 @@ int OnFrameTitleBarBackgroundChange(WPARAM, LPARAM)
{
if (MirandaExiting()) return 0;
{
- DBVARIANT dbv = { 0 };
-
AlignCOLLIconToLeft = db_get_b(NULL, "FrameTitleBar", "AlignCOLLIconToLeft", CLCDEFAULT_COLLICONTOLEFT);
bkColour = sttGetColor("FrameTitleBar", "BkColour", CLCDEFAULT_BKCOLOUR);
bkUseWinColours = db_get_b(NULL, "FrameTitleBar", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
SelBkColour = sttGetColor("FrameTitleBar", "TextColour", CLCDEFAULT_TEXTCOLOUR);
- if (hBmpBackground) { DeleteObject(hBmpBackground); hBmpBackground = NULL; }
+
+ if (hBmpBackground) {
+ DeleteObject(hBmpBackground);
+ hBmpBackground = NULL;
+ }
if (g_CluiData.fDisableSkinEngine) {
if (db_get_b(NULL, "FrameTitleBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- if (!db_get_s(NULL, "FrameTitleBar", "BkBitmap", &dbv)) {
- hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
- db_free(&dbv);
- }
+ ptrT tszBitmapName(db_get_tsa(NULL, "FrameTitleBar", "BkBitmap"));
+ if (tszBitmapName)
+ hBmpBackground = Bitmap_Load(tszBitmapName);
}
backgroundBmpUse = db_get_w(NULL, "FrameTitleBar", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
- };
+ }
CLUI__cliInvalidateRect(pcli->hwndContactList, 0, 0);
RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE);
-
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index 57c9025fe5..9d762dd183 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -1369,7 +1369,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BROWSE) {
TCHAR str[MAX_PATH], filter[512];
- BmpFilterGetStrings(filter, SIZEOF(filter));
+ Bitmap_GetFilter(filter, SIZEOF(filter));
GetDlgItemText(hwndDlg, IDC_FILENAME, str, SIZEOF(str));
OPENFILENAME ofn = { 0 };
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index 33734e5199..f68832d1b9 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -673,9 +673,9 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
dat->MenuTextHiColor = sttGetColor("Menu", "SelTextColour", CLCDEFAULT_MODERN_SELTEXTCOLOUR);
if (db_get_b(NULL, "Menu", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- ptrA szBitmap(db_get_sa(NULL, "Menu", "BkBitmap"));
- if (szBitmap)
- dat->hMenuBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, szBitmap);
+ ptrT tszBitmap(db_get_tsa(NULL, "Menu", "BkBitmap"));
+ if (tszBitmap != NULL)
+ dat->hMenuBackground = Bitmap_Load(tszBitmap);
}
dat->MenuBmpUse = db_get_w(NULL, "Menu", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp
index c03ed3b766..a23b0cfad6 100644
--- a/plugins/Clist_modern/src/modern_clistevents.cpp
+++ b/plugins/Clist_modern/src/modern_clistevents.cpp
@@ -260,15 +260,13 @@ static int ehhEventAreaBackgroundSettingsChanged(WPARAM, LPARAM)
DeleteObject(event_area.hBmpBackground);
event_area.hBmpBackground = NULL;
}
- if (g_CluiData.fDisableSkinEngine)
- {
- DBVARIANT dbv;
+
+ if (g_CluiData.fDisableSkinEngine) {
event_area.bkColour = sttGetColor("EventArea", "BkColour", CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL, "EventArea", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- if (!db_get_s(NULL, "EventArea", "BkBitmap", &dbv)) {
- event_area.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
- db_free(&dbv);
- }
+ ptrT tszBitmap(db_get_tsa(NULL, "EventArea", "BkBitmap"));
+ if (tszBitmap != NULL)
+ event_area.hBmpBackground = Bitmap_Load(tszBitmap);
}
event_area.useWinColors = db_get_b(NULL, "EventArea", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
event_area.backgroundBmpUse = db_get_w(NULL, "EventArea", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index d2625f1943..d24d5c82e2 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -86,7 +86,7 @@ static void ske_AddParseSkinFont(char * szFontID, char * szDefineString);
static int ske_GetSkinFromDB(char * szSection, SKINOBJECTSLIST * Skin);
static LPSKINOBJECTDESCRIPTOR ske_FindObject(const char *szName, SKINOBJECTSLIST *Skin);
static int ske_LoadSkinFromResource(BOOL bOnlyObjects);
-static void ske_PreMultiplyChanells(HBITMAP hbmp, BYTE Mult);
+static void ske_PreMultiplyChannels(HBITMAP hbmp, BYTE Mult);
static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting);
static INT_PTR ske_Service_UpdateFrameImage(WPARAM wParam, LPARAM lParam);
static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam);
@@ -1411,7 +1411,7 @@ INT_PTR ske_Service_DrawGlyph(WPARAM wParam, LPARAM lParam)
}
-void ske_PreMultiplyChanells(HBITMAP hbmp, BYTE Mult)
+void ske_PreMultiplyChannels(HBITMAP hbmp, BYTE Mult)
{
BITMAP bmp;
BOOL flag = FALSE;
@@ -1476,237 +1476,33 @@ int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL m
return 0;
}
-/*
-This function is required to load TGA to dib buffer myself
-Major part of routines is from http://tfcduke.developpez.com/tutoriel/format/tga/fichiers/tga.c
-*/
-
-static BOOL ske_ReadTGAImageData(void * From, DWORD fromSize, BYTE * destBuf, DWORD bufSize, BOOL RLE)
-{
- BYTE * pos = destBuf;
- BYTE * from = fromSize ? (BYTE*)From : NULL;
- FILE * fp = !fromSize ? (FILE*)From : NULL;
- DWORD destCount = 0;
- DWORD fromCount = 0;
- if (!RLE) {
- while (((from && fromCount < fromSize) || (fp && fromCount < bufSize))
- && (destCount < bufSize)) {
- BYTE r = from ? from[fromCount++] : (BYTE)fgetc(fp);
- BYTE g = from ? from[fromCount++] : (BYTE)fgetc(fp);
- BYTE b = from ? from[fromCount++] : (BYTE)fgetc(fp);
- BYTE a = from ? from[fromCount++] : (BYTE)fgetc(fp);
- pos[destCount++] = r;
- pos[destCount++] = g;
- pos[destCount++] = b;
- pos[destCount++] = a;
-
- if (destCount > bufSize) break;
- if (from) if (fromCount < fromSize) break;
- }
- }
- else {
- BYTE rgba[4];
- BYTE packet_header;
- BYTE *ptr = pos;
- BYTE size;
- int i;
- while (ptr < pos + bufSize) {
- /* read first byte */
- packet_header = from ? from[fromCount] : (BYTE)fgetc(fp);
- if (from) from++;
- size = 1 + (packet_header & 0x7f);
- if (packet_header & 0x80) {
- /* run-length packet */
- if (from) {
- *((DWORD*)rgba) = *((DWORD*)(from + fromCount));
- fromCount += 4;
- }
- else fread(rgba, sizeof(BYTE), 4, fp);
- for (i = 0; i < size; ++i, ptr += 4) {
- ptr[2] = rgba[2];
- ptr[1] = rgba[1];
- ptr[0] = rgba[0];
- ptr[3] = rgba[3];
- }
- }
- else { /* not run-length packet */
- for (i = 0; i < size; ++i, ptr += 4) {
- ptr[0] = from ? from[fromCount++] : (BYTE)fgetc(fp);
- ptr[1] = from ? from[fromCount++] : (BYTE)fgetc(fp);
- ptr[2] = from ? from[fromCount++] : (BYTE)fgetc(fp);
- ptr[3] = from ? from[fromCount++] : (BYTE)fgetc(fp);
- }
- }
- }
- }
- return TRUE;
-}
-
-static HBITMAP ske_LoadGlyphImage_TGA(const TCHAR *szFilename)
-{
- BYTE *colormap = NULL;
- int cx = 0, cy = 0;
- BOOL err = FALSE;
- tga_header_t header;
- if (!szFilename) return NULL;
- if (!wildcmpit(szFilename, _T("*\\*%.tga"))) {
- //Loading TGA image from file
- FILE *fp = _tfopen(szFilename, _T("rb"));
- if (!fp) {
- TRACEVAR("error: couldn't open \"%s\"!\n", szFilename);
- return NULL;
- }
- /* read header */
- fread(&header, sizeof(tga_header_t), 1, fp);
- if ((header.pixel_depth != 32) || ((header.image_type != 10) && (header.image_type != 2))) {
- fclose(fp);
- return NULL;
- }
-
- /*memory allocation */
- colormap = (BYTE*)malloc(header.width*header.height * 4);
- cx = header.width;
- cy = header.height;
- fseek(fp, header.id_lenght, SEEK_CUR);
- fseek(fp, header.cm_length, SEEK_CUR);
- err = !ske_ReadTGAImageData((void*)fp, 0, colormap, header.width*header.height * 4, header.image_type == 10);
- fclose(fp);
- }
- else {
- /* reading from resources IDR_TGA_DEFAULT_SKIN */
- HRSRC hRSrc = FindResourceA(g_hInst, MAKEINTRESOURCEA(IDR_TGA_DEFAULT_SKIN), "TGA");
- if (!hRSrc) return NULL;
- HGLOBAL hRes = LoadResource(g_hInst, hRSrc);
- if (!hRes) return NULL;
- DWORD size = SizeofResource(g_hInst, hRSrc);
- BYTE *mem = (BYTE*)LockResource(hRes);
- if (size > sizeof(header)) {
- tga_header_t * header = (tga_header_t *)mem;
- if (header->pixel_depth == 32 && (header->image_type == 2 || header->image_type == 10)) {
- colormap = (BYTE*)malloc(header->width*header->height * 4);
- cx = header->width;
- cy = header->height;
- ske_ReadTGAImageData((void*)(mem + sizeof(tga_header_t) + header->id_lenght + header->cm_length), size - (sizeof(tga_header_t) + header->id_lenght + header->cm_length), colormap, cx*cy * 4, header->image_type == 10);
- }
- }
- FreeResource(hRes);
- }
-
- if (colormap) { //create dib section
- BYTE * pt;
- HBITMAP hbmp = ske_CreateDIB32Point(cx, cy, (void**)&pt);
- if (hbmp)
- memcpy(pt, colormap, cx*cy * 4);
- free(colormap);
- return hbmp;
- }
- return NULL;
-}
-
-
-//this function is required to load PNG to dib buffer myself
-static HBITMAP ske_LoadGlyphImage_Png2Dib(const TCHAR *tszFilename)
-{
- HANDLE hFile, hMap = NULL;
- BYTE* ppMap = NULL;
- long cbFileSize = 0;
- BITMAPINFOHEADER* pDib = { 0 };
- BYTE* pDibBits = NULL;
-
- if (!ServiceExists(MS_PNG2DIB)) {
- MessageBox(NULL, TranslateT("You need an image services plugin to process PNG images."), TranslateT("Error"), MB_OK);
- return (HBITMAP)NULL;
- }
-
- if ((hFile = CreateFile(tszFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL)) != INVALID_HANDLE_VALUE)
- if ((hMap = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != NULL)
- if ((ppMap = (BYTE*)MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)
- cbFileSize = GetFileSize(hFile, NULL);
-
- if (cbFileSize != 0) {
- PNG2DIB param;
- param.pSource = ppMap;
- param.cbSourceSize = cbFileSize;
- param.pResult = &pDib;
- if (CallService(MS_PNG2DIB, 0, (LPARAM)&param))
- pDibBits = (BYTE*)(pDib + 1);
- else
- cbFileSize = 0;
- }
-
- if (ppMap != NULL) UnmapViewOfFile(ppMap);
- if (hMap != NULL) CloseHandle(hMap);
- if (hFile != NULL) CloseHandle(hFile);
-
- if (cbFileSize == 0)
- return (HBITMAP)NULL;
-
- HBITMAP hBitmap;
- BITMAPINFO* bi = (BITMAPINFO*)pDib;
- BYTE *pt = (BYTE*)bi;
- pt += bi->bmiHeader.biSize;
- if (bi->bmiHeader.biBitCount != 32) {
- HDC sDC = GetDC(NULL);
- hBitmap = CreateDIBitmap(sDC, pDib, CBM_INIT, pDibBits, bi, DIB_PAL_COLORS);
- SelectObject(sDC, hBitmap);
- DeleteDC(sDC);
- }
- else {
- BYTE *ptPixels = pt;
- hBitmap = CreateDIBSection(NULL, bi, DIB_RGB_COLORS, (void **)&ptPixels, NULL, 0);
- memcpy(ptPixels, pt, bi->bmiHeader.biSizeImage);
- }
- GlobalFree(pDib);
- return hBitmap;
-}
-
static HBITMAP ske_LoadGlyphImageByDecoders(const TCHAR *tszFileName)
{
- // Loading image from file by imgdecoder...
- HBITMAP hBitmap = NULL;
- TCHAR ext[5];
- BYTE f = 0;
-
- BITMAP bmpInfo;
- {
- size_t l = mir_tstrlen(tszFileName);
- mir_tstrncpy(ext, tszFileName + (l - 4), 5);
- }
if (!_tcschr(tszFileName, '%') && !PathFileExists(tszFileName))
return NULL;
- if (!mir_tstrcmpi(ext, _T(".tga"))) {
- hBitmap = ske_LoadGlyphImage_TGA(tszFileName);
- f = 1;
- }
- else if (ServiceExists("Image/Png2Dib") && !mir_tstrcmpi(ext, _T(".png"))) {
- hBitmap = ske_LoadGlyphImage_Png2Dib(tszFileName);
- GetObject(hBitmap, sizeof(BITMAP), &bmpInfo);
- f = (bmpInfo.bmBits != NULL);
- }
- else if (mir_tstrcmpi(ext, _T(".png"))) {
- hBitmap = (HBITMAP)CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)tszFileName);
- }
+ HBITMAP hBitmap = Bitmap_Load(tszFileName);
+ if (hBitmap == NULL)
+ return NULL;
- if (hBitmap) {
- GetObject(hBitmap, sizeof(BITMAP), &bmpInfo);
- if (bmpInfo.bmBitsPixel == 32)
- ske_PreMultiplyChanells(hBitmap, f);
- else {
- HDC dc32 = CreateCompatibleDC(NULL);
- HDC dc24 = CreateCompatibleDC(NULL);
- HBITMAP hBitmap32 = ske_CreateDIB32(bmpInfo.bmWidth, bmpInfo.bmHeight);
- HBITMAP obmp24 = (HBITMAP)SelectObject(dc24, hBitmap);
- HBITMAP obmp32 = (HBITMAP)SelectObject(dc32, hBitmap32);
- BitBlt(dc32, 0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, dc24, 0, 0, SRCCOPY);
- SelectObject(dc24, obmp24);
- SelectObject(dc32, obmp32);
- DeleteDC(dc24);
- DeleteDC(dc32);
- DeleteObject(hBitmap);
- hBitmap = hBitmap32;
- ske_PreMultiplyChanells(hBitmap, 0);
- }
+ BITMAP bmpInfo;
+ GetObject(hBitmap, sizeof(BITMAP), &bmpInfo);
+ if (bmpInfo.bmBitsPixel == 32)
+ ske_PreMultiplyChannels(hBitmap, 0);
+ else {
+ HDC dc32 = CreateCompatibleDC(NULL);
+ HDC dc24 = CreateCompatibleDC(NULL);
+ HBITMAP hBitmap32 = ske_CreateDIB32(bmpInfo.bmWidth, bmpInfo.bmHeight);
+ HBITMAP obmp24 = (HBITMAP)SelectObject(dc24, hBitmap);
+ HBITMAP obmp32 = (HBITMAP)SelectObject(dc32, hBitmap32);
+ BitBlt(dc32, 0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, dc24, 0, 0, SRCCOPY);
+ SelectObject(dc24, obmp24);
+ SelectObject(dc32, obmp32);
+ DeleteDC(dc24);
+ DeleteDC(dc32);
+ DeleteObject(hBitmap);
+ hBitmap = hBitmap32;
+ ske_PreMultiplyChannels(hBitmap, 0);
}
return hBitmap;
}
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index e5ba279caf..a282791ae2 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -108,13 +108,11 @@ int LoadStatusBarData()
if (g_StatusBarData.hBmpBackground) { DeleteObject(g_StatusBarData.hBmpBackground); g_StatusBarData.hBmpBackground = NULL; }
if (g_CluiData.fDisableSkinEngine) {
- DBVARIANT dbv;
g_StatusBarData.bkColour = sttGetColor("StatusBar", "BkColour", CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL, "StatusBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- if (!db_get_s(NULL, "StatusBar", "BkBitmap", &dbv)) {
- g_StatusBarData.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
- db_free(&dbv);
- }
+ ptrT tszBitmapName(db_get_tsa(NULL, "StatusBar", "BkBitmap"));
+ if (tszBitmapName)
+ g_StatusBarData.hBmpBackground = Bitmap_Load(tszBitmapName);
}
g_StatusBarData.bkUseWinColors = db_get_b(NULL, "StatusBar", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
g_StatusBarData.backgroundBmpUse = db_get_w(NULL, "StatusBar", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index cee0d5137a..3771fc2324 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -138,14 +138,13 @@ static int ehhToolBarBackgroundSettingsChanged(WPARAM, LPARAM)
DeleteObject(tbdat.mtb_hBmpBackground);
tbdat.mtb_hBmpBackground = NULL;
}
+
if (g_CluiData.fDisableSkinEngine) {
- DBVARIANT dbv;
tbdat.mtb_bkColour = sttGetColor("ToolBar", "BkColour", CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL, "ToolBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- if (!db_get_s(NULL, "ToolBar", "BkBitmap", &dbv, DBVT_TCHAR)) {
- tbdat.mtb_hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.ptszVal);
- db_free(&dbv);
- }
+ ptrT tszBitmapName(db_get_tsa(NULL, "ToolBar", "BkBitmap"));
+ if (tszBitmapName)
+ tbdat.mtb_hBmpBackground = Bitmap_Load(tszBitmapName);
}
tbdat.mtb_useWinColors = db_get_b(NULL, "ToolBar", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
tbdat.mtb_backgroundBmpUse = db_get_b(NULL, "ToolBar", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index 4d1b3cc2c6..62280566a4 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -1165,13 +1165,11 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM, LPARAM)
}
if (g_CluiData.fDisableSkinEngine) {
- DBVARIANT dbv;
view_mode.bkColour = sttGetColor("ViewMode", "BkColour", CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL, "ViewMode", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- if (!db_get_s(NULL, "ViewMode", "BkBitmap", &dbv)) {
- view_mode.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
- db_free(&dbv);
- }
+ ptrT tszBitmapName(db_get_tsa(NULL, "ViewMode", "BkBitmap"));
+ if (tszBitmapName)
+ view_mode.hBmpBackground = Bitmap_Load(tszBitmapName);
}
view_mode.useWinColors = db_get_b(NULL, "ViewMode", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
view_mode.backgroundBmpUse = db_get_w(NULL, "ViewMode", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
index 6ce2df5ff9..d9a2614206 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
@@ -2332,10 +2332,7 @@ boolean AlignCOLLIconToLeft; //will hide frame icon
int OnFrameTitleBarBackgroundChange()
{
- DBVARIANT dbv;
-
AlignCOLLIconToLeft = cfg::getByte("FrameTitleBar", "AlignCOLLIconToLeft", 0);
-
bkColour = cfg::getDword("FrameTitleBar", "BkColour", CLCDEFAULT_BKCOLOUR);
if (hBmpBackground) {
@@ -2343,10 +2340,9 @@ int OnFrameTitleBarBackgroundChange()
hBmpBackground = NULL;
}
if (cfg::getByte("FrameTitleBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- if (!db_get(NULL, "FrameTitleBar", "BkBitmap", &dbv)) {
- hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
- mir_free(dbv.pszVal);
- }
+ ptrT tszBitmapName(db_get_tsa(NULL, "FrameTitleBar", "BkBitmap"));
+ if (tszBitmapName != NULL)
+ hBmpBackground = Bitmap_Load(tszBitmapName);
}
backgroundBmpUse = cfg::getWord("FrameTitleBar", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp
index 23a6b172d4..ccff06c1b1 100644
--- a/plugins/Clist_nicer/src/clcopts.cpp
+++ b/plugins/Clist_nicer/src/clcopts.cpp
@@ -745,7 +745,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if (LOWORD(wParam) == IDC_BROWSE) {
TCHAR str[MAX_PATH], filter[512];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, SIZEOF(str));
- BmpFilterGetStrings(filter, SIZEOF(filter));
+ Bitmap_GetFilter(filter, SIZEOF(filter));
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp
index 4e441c8c98..3b3d478c1c 100644
--- a/plugins/Clist_nicer/src/extBackg.cpp
+++ b/plugins/Clist_nicer/src/extBackg.cpp
@@ -625,7 +625,7 @@ static void CorrectBitmap32Alpha(HBITMAP hBitmap)
static HBITMAP LoadPNG(const char *szFilename)
{
- HBITMAP hBitmap = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)szFilename);
+ HBITMAP hBitmap = Bitmap_Load(_A2T(szFilename));
if (hBitmap != 0)
CorrectBitmap32Alpha(hBitmap);
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp
index f0e6295ad7..03101b7fb8 100644
--- a/plugins/FloatingContacts/src/main.cpp
+++ b/plugins/FloatingContacts/src/main.cpp
@@ -564,7 +564,7 @@ static void CreateBackgroundBrush()
hBkBrush = NULL;
}
- if ( db_get_b(NULL, MODULE, "DrawBorder", FLT_DEFAULT_DRAWBORDER)) {
+ if (db_get_b(NULL, MODULE, "DrawBorder", FLT_DEFAULT_DRAWBORDER)) {
COLORREF cr = (COLORREF)db_get_dw(NULL, MODULE, "LTEdgesColor", FLT_DEFAULT_LTEDGESCOLOR);
hLTEdgesPen = CreatePen(PS_SOLID, 1, cr);
cr = (COLORREF)db_get_dw(NULL, MODULE, "RBEdgesColor", FLT_DEFAULT_RBEDGESCOLOR);
@@ -572,11 +572,9 @@ static void CreateBackgroundBrush()
}
if (db_get_b(NULL, MODULE, "BkUseBitmap", FLT_DEFAULT_BKGNDUSEBITMAP)) {
- DBVARIANT dbv;
- if ( !db_get_ts(NULL, MODULE, "BkBitmap", &dbv)) {
- hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)dbv.ptszVal);
- db_free(&dbv);
- }
+ ptrT tszBitmapName(db_get_tsa(NULL, MODULE, "BkBitmap"));
+ if (tszBitmapName != NULL)
+ hBmpBackground = Bitmap_Load(tszBitmapName);
}
nBackgroundBmpUse = (WORD)db_get_w(NULL, MODULE, "BkBitmapOpt", FLT_DEFAULT_BKGNDBITMAPOPT);
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp
index 0571b83aa8..fbc0a79f65 100644
--- a/plugins/FloatingContacts/src/options.cpp
+++ b/plugins/FloatingContacts/src/options.cpp
@@ -246,7 +246,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
{
TCHAR str[MAX_PATH], filter[512];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, SIZEOF(str));
- BmpFilterGetStrings(filter, SIZEOF(filter));
+ Bitmap_GetFilter(filter, SIZEOF(filter));
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
diff --git a/plugins/ModernOpt/src/mopt_selector.cpp b/plugins/ModernOpt/src/mopt_selector.cpp
index df9fdc565b..994ba7489a 100644
--- a/plugins/ModernOpt/src/mopt_selector.cpp
+++ b/plugins/ModernOpt/src/mopt_selector.cpp
@@ -46,15 +46,9 @@ static void sttPreviewSkin(MODERNOPTOBJECT *obj, TCHAR *fn, LPDRAWITEMSTRUCT lps
return;
}
- char *afn = mir_t2a(fn);
- char *fnpreview = (char *)mir_alloc(mir_strlen(afn) + 10);
- mir_strcpy(fnpreview, afn);
- mir_strcat(fnpreview, ".png");
- HBITMAP hbmPreview = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)fnpreview);
- mir_free(afn);
- mir_free(fnpreview);
-
- if (!hbmPreview) return;
+ HBITMAP hbmPreview = Bitmap_Load(CMString(fn) + _T(".png"));
+ if (!hbmPreview)
+ return;
BITMAP bmp;
GetObject(hbmPreview, sizeof(bmp), &bmp);
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp
index 87bac02d81..3ce328a87a 100644
--- a/plugins/SimpleStatusMsg/src/msgbox.cpp
+++ b/plugins/SimpleStatusMsg/src/msgbox.cpp
@@ -453,26 +453,26 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control)
break;
case ID__VARIABLES_MOREVARIABLES:
- {
- VARHELPINFO vhi = {0};
- vhi.cbSize = sizeof(vhi);
- vhi.flags = VHF_FULLDLG | VHF_SETLASTSUBJECT;
- vhi.hwndCtrl = edit_control;
- vhi.szSubjectDesc = NULL;
- vhi.szExtraTextDesc = NULL;
- CallService(MS_VARS_SHOWHELPEX, (WPARAM)hwnd, (LPARAM)&vhi);
+ {
+ VARHELPINFO vhi = {0};
+ vhi.cbSize = sizeof(vhi);
+ vhi.flags = VHF_FULLDLG | VHF_SETLASTSUBJECT;
+ vhi.hwndCtrl = edit_control;
+ vhi.szSubjectDesc = NULL;
+ vhi.szExtraTextDesc = NULL;
+ CallService(MS_VARS_SHOWHELPEX, (WPARAM)hwnd, (LPARAM)&vhi);
+ }
break;
- }
default:
if (!OpenClipboard(GetParent(hwnd)))
break;
+
if (EmptyClipboard()) {
TCHAR item_string[128];
- int len;
-
GetMenuString(hmenu, m_selection, (LPTSTR)&item_string, 128, MF_BYCOMMAND);
- len = mir_tstrlen(item_string);
+
+ int len = (int)mir_tstrlen(item_string);
if (len) {
LPTSTR lptstrCopy;
HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (len + 1) * sizeof(TCHAR));
@@ -486,7 +486,6 @@ VOID APIENTRY HandlePopupMenu(HWND hwnd, POINT pt, HWND edit_control)
GlobalUnlock(hglbCopy);
SetClipboardData(CF_UNICODETEXT, hglbCopy);
-
}
}
CloseClipboard();
diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp
index ec2505917d..08ce75a4bf 100644
--- a/plugins/TopToolBar/src/toolbarwnd.cpp
+++ b/plugins/TopToolBar/src/toolbarwnd.cpp
@@ -293,7 +293,6 @@ INT_PTR OnEventFire(WPARAM wParam, LPARAM lParam)
int LoadBackgroundOptions()
{
- //load options
bkColour = db_get_dw(NULL, TTB_OPTDIR, "BkColour", TTBDEFAULT_BKCOLOUR);
if (hBmpBackground) {
DeleteObject(hBmpBackground);
@@ -301,11 +300,9 @@ int LoadBackgroundOptions()
}
if (db_get_b(NULL, TTB_OPTDIR, "UseBitmap", TTBDEFAULT_USEBITMAP)) {
- DBVARIANT dbv;
- if (!db_get(NULL, TTB_OPTDIR, "BkBitmap", &dbv)) {
- hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
- db_free(&dbv);
- }
+ ptrT tszBitmapName(db_get_tsa(NULL, TTB_OPTDIR, "BkBitmap"));
+ if (tszBitmapName != NULL)
+ hBmpBackground = Bitmap_Load(tszBitmapName);
}
backgroundBmpUse = db_get_w(NULL, TTB_OPTDIR, "BkBmpUse", TTBDEFAULT_BKBMPUSE);