summaryrefslogtreecommitdiff
path: root/plugins/Popup/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 16:39:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 16:39:04 +0300
commit62a186697df33c96dc1a6dac0f4dfc38652fb96f (patch)
tree1437d0906218fae8827aed384026f2b7e656f4ac /plugins/Popup/src
parentfcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 (diff)
BYTE -> uint8_t
Diffstat (limited to 'plugins/Popup/src')
-rw-r--r--plugins/Popup/src/bitmap_funcs.cpp12
-rw-r--r--plugins/Popup/src/config.h54
-rw-r--r--plugins/Popup/src/notifications.cpp2
-rw-r--r--plugins/Popup/src/notifications.h6
-rw-r--r--plugins/Popup/src/opt_adv.cpp10
-rw-r--r--plugins/Popup/src/opt_class.cpp8
-rw-r--r--plugins/Popup/src/opt_gen.cpp4
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp2
-rw-r--r--plugins/Popup/src/popup_wnd2.h4
-rw-r--r--plugins/Popup/src/services.cpp2
10 files changed, 52 insertions, 52 deletions
diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp
index 9f20a65aa6..6fba66ad66 100644
--- a/plugins/Popup/src/bitmap_funcs.cpp
+++ b/plugins/Popup/src/bitmap_funcs.cpp
@@ -560,14 +560,14 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h)
DestroyIcon(hicTmp);
}
- BYTE *cbit = new BYTE[bmpColor.bmWidthBytes*bmpColor.bmHeight];
- BYTE *mbit = new BYTE[bmpMask.bmWidthBytes*bmpMask.bmHeight];
+ uint8_t *cbit = new uint8_t[bmpColor.bmWidthBytes*bmpColor.bmHeight];
+ uint8_t *mbit = new uint8_t[bmpMask.bmWidthBytes*bmpMask.bmHeight];
GetBitmapBits(info.hbmColor, bmpColor.bmWidthBytes*bmpColor.bmHeight, cbit);
GetBitmapBits(info.hbmMask, bmpMask.bmWidthBytes*bmpMask.bmHeight, mbit);
for (int i = 0; i < bmpColor.bmHeight; i++) {
for (int j = 0; j < bmpColor.bmWidth; j++) {
- BYTE *pixel = cbit + i*bmpColor.bmWidthBytes + j * 4;
+ uint8_t *pixel = cbit + i*bmpColor.bmWidthBytes + j * 4;
if (!pixel[3])
pixel[3] = (*(mbit + i*bmpMask.bmWidthBytes + j*bmpMask.bmBitsPixel / 8) & (1 << (7 - j % 8))) ? 0 : 255;
@@ -612,7 +612,7 @@ HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque)
const int addRectsCount = 64;
int rectsCount = addRectsCount;
- PRGNDATA pRgnData = (PRGNDATA)(new BYTE[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
+ PRGNDATA pRgnData = (PRGNDATA)(new uint8_t[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
LPRECT pRects = (LPRECT)(&pRgnData->Buffer);
memset(pRgnData, 0, sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT));
@@ -631,7 +631,7 @@ HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque)
SetRect(&pRects[pRgnData->rdh.nCount++], first, i, j, i + 1);
if (pRgnData->rdh.nCount >= (DWORD)rectsCount) {
rectsCount += addRectsCount;
- LPRGNDATA pRgnDataNew = (LPRGNDATA)(new BYTE[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
+ LPRGNDATA pRgnDataNew = (LPRGNDATA)(new uint8_t[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
memcpy(pRgnDataNew, pRgnData, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount * sizeof(RECT));
delete[] pRgnData;
pRgnData = pRgnDataNew;
@@ -650,7 +650,7 @@ HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque)
SetRect(&pRects[pRgnData->rdh.nCount++], first, i, j, i + 1);
if (pRgnData->rdh.nCount >= (DWORD)rectsCount) {
rectsCount += addRectsCount;
- LPRGNDATA pRgnDataNew = (LPRGNDATA)(new BYTE[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
+ LPRGNDATA pRgnDataNew = (LPRGNDATA)(new uint8_t[sizeof(RGNDATAHEADER) + (rectsCount)*sizeof(RECT)]);
memcpy(pRgnDataNew, pRgnData, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount * sizeof(RECT));
delete[] pRgnData;
pRgnData = pRgnDataNew;
diff --git a/plugins/Popup/src/config.h b/plugins/Popup/src/config.h
index 888b7624f5..aef2844d67 100644
--- a/plugins/Popup/src/config.h
+++ b/plugins/Popup/src/config.h
@@ -27,14 +27,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef struct tagPOPUPOPTIONS {
//==Page General====
//Timeout
- BYTE InfiniteDelay;
+ uint8_t InfiniteDelay;
int Seconds;
- BYTE LeaveHovered;
+ uint8_t LeaveHovered;
//Size&Position
- BYTE DynamicResize;
- BYTE UseMinimumWidth;
+ uint8_t DynamicResize;
+ uint8_t UseMinimumWidth;
WORD MinimumWidth;
- BYTE UseMaximumWidth;
+ uint8_t UseMaximumWidth;
WORD MaximumWidth;
int Position;
int Spreading;
@@ -45,20 +45,20 @@ typedef struct tagPOPUPOPTIONS {
int gapRight;
int spacing;
//Miscellaneous
- BYTE ReorderPopups;
- BYTE ReorderPopupsWarning;
+ uint8_t ReorderPopups;
+ uint8_t ReorderPopupsWarning;
//Disable when
- BYTE DisableWhenFullscreen;
+ uint8_t DisableWhenFullscreen;
//others
- BYTE debug;
+ uint8_t debug;
//==Page Skins====
LPTSTR SkinPack;
- BYTE DisplayTime;
- BYTE DropShadow;
- BYTE EnableFreeformShadows;
- BYTE EnableAeroGlass;
- BYTE UseWinColors;
- BYTE UseMText;
+ uint8_t DisplayTime;
+ uint8_t DropShadow;
+ uint8_t EnableFreeformShadows;
+ uint8_t EnableAeroGlass;
+ uint8_t UseWinColors;
+ uint8_t UseMText;
//==Page Actions====
DWORD actions;
//Mouse Override
@@ -67,24 +67,24 @@ typedef struct tagPOPUPOPTIONS {
int overrideMiddle;
//==Page Advanced====
//History
- BYTE EnableHistory;
+ uint8_t EnableHistory;
WORD HistorySize;
- BYTE UseHppHistoryLog;
+ uint8_t UseHppHistoryLog;
//Avatars
- BYTE avatarBorders;
- BYTE avatarPNGBorders;
- BYTE avatarRadius;
+ uint8_t avatarBorders;
+ uint8_t avatarPNGBorders;
+ uint8_t avatarRadius;
WORD avatarSize;
- BYTE EnableAvatarUpdates;
+ uint8_t EnableAvatarUpdates;
//Monitor
- BYTE Monitor;
+ uint8_t Monitor;
//Transparency
- BYTE UseTransparency;
- BYTE Alpha;
- BYTE OpaqueOnHover;
+ uint8_t UseTransparency;
+ uint8_t Alpha;
+ uint8_t OpaqueOnHover;
//Effect
- BYTE UseAnimations;
- BYTE UseEffect;
+ uint8_t UseAnimations;
+ uint8_t UseEffect;
LPTSTR Effect;
DWORD FadeIn;
DWORD FadeOut;
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp
index c6a507893a..5876781cb9 100644
--- a/plugins/Popup/src/notifications.cpp
+++ b/plugins/Popup/src/notifications.cpp
@@ -209,7 +209,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification)
return (HANDLE)ptd;
}
-HANDLE FindTreeData(LPTSTR group, LPTSTR name, BYTE typ)
+HANDLE FindTreeData(LPTSTR group, LPTSTR name, uint8_t typ)
{
for (auto &p : gTreeData)
if (p->typ == typ && (!group || (mir_wstrcmp(p->pszTreeRoot, group) == 0)) && (!name || (mir_wstrcmp(p->pszDescription, name) == 0)))
diff --git a/plugins/Popup/src/notifications.h b/plugins/Popup/src/notifications.h
index 041a83d78c..3a56992b33 100644
--- a/plugins/Popup/src/notifications.h
+++ b/plugins/Popup/src/notifications.h
@@ -30,12 +30,12 @@ struct POPUPTREEDATA
DWORD signature;
LPTSTR pszTreeRoot;
LPTSTR pszDescription;
- BYTE typ;
+ uint8_t typ;
union {
POPUPNOTIFICATION notification;
POPUPCLASS pupClass;
};
- BYTE enabled;
+ uint8_t enabled;
DWORD disableWhen;
int timeoutValue;
char leftAction[MAXMODULELABELLENGTH];
@@ -49,7 +49,7 @@ extern LIST<POPUPTREEDATA> gTreeData;
extern HANDLE g_hntfError, g_hntfWarning, g_hntfNotification;
int TreeDataSortFunc(const POPUPTREEDATA *p1, const POPUPTREEDATA *p2);
-HANDLE FindTreeData(LPTSTR group, LPTSTR name, BYTE typ);
+HANDLE FindTreeData(LPTSTR group, LPTSTR name, uint8_t typ);
void FreePopupClass(POPUPTREEDATA *ptd);
void UnloadTreeData();
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp
index a6bb89eacd..8b8b056d9e 100644
--- a/plugins/Popup/src/opt_adv.cpp
+++ b/plugins/Popup/src/opt_adv.cpp
@@ -235,7 +235,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case IDC_TRANS_SLIDER:
- PopupOptions.Alpha = (BYTE)SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_GETPOS, 0, 0);
+ PopupOptions.Alpha = (uint8_t)SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_GETPOS, 0, 0);
mir_snwprintf(tstr, TranslateT("%d%%"), Byte2Percentile(PopupOptions.Alpha));
SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
@@ -492,7 +492,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case PSN_APPLY:
// History
- g_plugin.setByte("EnableHistory", (BYTE)PopupOptions.EnableHistory);
+ g_plugin.setByte("EnableHistory", (uint8_t)PopupOptions.EnableHistory);
g_plugin.setWord("HistorySize", PopupOptions.HistorySize);
PopupHistoryResize();
g_plugin.setByte("UseHppHistoryLog", PopupOptions.UseHppHistoryLog);
@@ -516,7 +516,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
g_plugin.setDword("FadeInTime", PopupOptions.FadeIn);
g_plugin.setDword("FadeOutTime", PopupOptions.FadeOut);
// other old stuff
- g_plugin.setWord("MaxPopups", (BYTE)PopupOptions.MaxPopups);
+ g_plugin.setWord("MaxPopups", (uint8_t)PopupOptions.MaxPopups);
}
return TRUE;
}
@@ -551,7 +551,7 @@ LRESULT CALLBACK AvatarTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
tme.hwndTrack = hwnd;
_TrackMouseEvent(&tme);
- int newVal = (BYTE)SendMessage(hwnd, TBM_GETPOS, 0, 0);
+ int newVal = (uint8_t)SendMessage(hwnd, TBM_GETPOS, 0, 0);
if (oldVal != newVal) {
if (oldVal < 0)
SetWindowLongPtr(hwndBox, GWLP_USERDATA, 0);
@@ -600,7 +600,7 @@ LRESULT CALLBACK AlphaTrackBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
tme.hwndTrack = hwnd;
_TrackMouseEvent(&tme);
- int newVal = (BYTE)SendMessage(hwnd, TBM_GETPOS, 0, 0);
+ int newVal = (uint8_t)SendMessage(hwnd, TBM_GETPOS, 0, 0);
if (oldVal != newVal)
{
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp
index 5297481083..30376308f9 100644
--- a/plugins/Popup/src/opt_class.cpp
+++ b/plugins/Popup/src/opt_class.cpp
@@ -41,9 +41,9 @@ int ComboBox_SelectItem(HWND hwndCtl, char *data) {
struct {
UINT idCtrl;
- BYTE onTyp0;
- BYTE onTyp1;
- BYTE onTyp2;
+ uint8_t onTyp0;
+ uint8_t onTyp1;
+ uint8_t onTyp2;
}
static ctrlsAll[] = {
{ IDC_TXT_TITLE1, 0, 1, 1 },
@@ -319,7 +319,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case BN_CLICKED: // Button controls
switch (idCtrl) {
case IDC_ENABLE:
- ptd->enabled = (BYTE)Button_GetCheck((HWND)lParam);
+ ptd->enabled = (uint8_t)Button_GetCheck((HWND)lParam);
for (auto &it : ctrlsEnable)
EnableWindow(GetDlgItem(hwnd, it), ptd->enabled);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp
index 7c74a26041..d81747ae06 100644
--- a/plugins/Popup/src/opt_gen.cpp
+++ b/plugins/Popup/src/opt_gen.cpp
@@ -495,7 +495,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
g_plugin.setWord("MaximumWidth", PopupOptions.MaximumWidth);
// Position
- g_plugin.setByte("Position", (BYTE)PopupOptions.Position);
+ g_plugin.setByte("Position", (uint8_t)PopupOptions.Position);
// Configure popup area
g_plugin.setWord("gapTop", (WORD)PopupOptions.gapTop);
@@ -505,7 +505,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
g_plugin.setWord("spacing", (WORD)PopupOptions.spacing);
// Spreading
- g_plugin.setByte("Spreading", (BYTE)PopupOptions.Spreading);
+ g_plugin.setByte("Spreading", (uint8_t)PopupOptions.Spreading);
// miscellaneous
Check_ReorderPopups(hwnd); // this save also PopupOptions.ReorderPopups
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index fcb0b56b78..bd0b9ad530 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -179,7 +179,7 @@ void PopupWnd2::create()
update();
}
-void PopupWnd2::updateLayered(BYTE opacity)
+void PopupWnd2::updateLayered(uint8_t opacity)
{
if (!m_hwnd) return;
diff --git a/plugins/Popup/src/popup_wnd2.h b/plugins/Popup/src/popup_wnd2.h
index 45b940fbb6..3f4632f5d8 100644
--- a/plugins/Popup/src/popup_wnd2.h
+++ b/plugins/Popup/src/popup_wnd2.h
@@ -86,7 +86,7 @@ private:
// show & hide
bool m_bFade;
- BYTE m_btAlpha0, m_btAlpha1;
+ uint8_t m_btAlpha0, m_btAlpha1;
bool m_bSlide;
POINT m_ptPosition0, m_ptPosition1;
bool m_bDestroy;
@@ -113,7 +113,7 @@ public:
void startThread();
void create();
- void updateLayered(BYTE opacity);
+ void updateLayered(uint8_t opacity);
SIZE measure();
void update();
void animate();
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp
index 4692274bcf..a089a10a0c 100644
--- a/plugins/Popup/src/services.cpp
+++ b/plugins/Popup/src/services.cpp
@@ -123,7 +123,7 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam)
if (ppd->lchContact)
proto = Proto_GetBaseAccountName(ppd->lchContact);
- BYTE bShowMode = proto ? db_get_b(ppd->lchContact, MODULENAME, "ShowMode", PU_SHOWMODE_AUTO) : PU_SHOWMODE_AUTO;
+ uint8_t bShowMode = proto ? db_get_b(ppd->lchContact, MODULENAME, "ShowMode", PU_SHOWMODE_AUTO) : PU_SHOWMODE_AUTO;
if (bShowMode == PU_SHOWMODE_BLOCK)
return -1;