summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/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/Clist_modern/src
parentfcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 (diff)
BYTE -> uint8_t
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r--plugins/Clist_modern/src/cluiframes.cpp18
-rw-r--r--plugins/Clist_modern/src/modern_aniavatars.cpp14
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_clc.h30
-rw-r--r--plugins/Clist_modern/src/modern_clcmsgs.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp128
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp22
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.h16
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_clistopts.cpp88
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp18
-rw-r--r--plugins/Clist_modern/src/modern_commonprototypes.h24
-rw-r--r--plugins/Clist_modern/src/modern_contact.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_docking.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_effectenum.h14
-rw-r--r--plugins/Clist_modern/src/modern_gdiplus.cpp16
-rw-r--r--plugins/Clist_modern/src/modern_global_structure.h12
-rw-r--r--plugins/Clist_modern/src/modern_image_array.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_image_array.h2
-rw-r--r--plugins/Clist_modern/src/modern_skinbutton.cpp16
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp292
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.h16
-rw-r--r--plugins/Clist_modern/src/modern_skinselector.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_skinselector.h4
-rw-r--r--plugins/Clist_modern/src/modern_static_clui.h4
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.h14
-rw-r--r--plugins/Clist_modern/src/modern_statusbar_options.cpp44
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp24
-rw-r--r--plugins/Clist_modern/src/stdafx.h2
33 files changed, 444 insertions, 444 deletions
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp
index fb47d34952..403ad5188f 100644
--- a/plugins/Clist_modern/src/cluiframes.cpp
+++ b/plugins/Clist_modern/src/cluiframes.cpp
@@ -88,7 +88,7 @@ static COLORREF sttBkColour;
static COLORREF sttSelBkColour;
static BOOL sttBkUseWinColours;
-BYTE AlignCOLLIconToLeft; //will hide frame icon
+uint8_t AlignCOLLIconToLeft; //will hide frame icon
//for old multiwindow
#define MPCF_CONTEXTFRAMEMENU 3
@@ -130,7 +130,7 @@ int CLUIFrames_OnMoving(HWND hwnd, RECT *r)
return 0;
}
-int SetAlpha(BYTE Alpha)
+int SetAlpha(uint8_t Alpha)
{
for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
@@ -679,10 +679,10 @@ static int CLUIFramesStoreFrameSettings(int Frameid)
CMStringA buf;
db_set_ws(0, CLUIFrameModule, buf.Format("Name%d", storpos), F.name);
- db_set_b(0, CLUIFrameModule, buf.Format("Collapse%d", storpos), (BYTE)btoint(F.collapsed));
- db_set_b(0, CLUIFrameModule, buf.Format("Locked%d", storpos), (BYTE)btoint(F.Locked));
- db_set_b(0, CLUIFrameModule, buf.Format("Visible%d", storpos), (BYTE)btoint(F.visible));
- db_set_b(0, CLUIFrameModule, buf.Format("TBVisile%d", storpos), (BYTE)btoint(F.TitleBar.ShowTitleBar));
+ db_set_b(0, CLUIFrameModule, buf.Format("Collapse%d", storpos), (uint8_t)btoint(F.collapsed));
+ db_set_b(0, CLUIFrameModule, buf.Format("Locked%d", storpos), (uint8_t)btoint(F.Locked));
+ db_set_b(0, CLUIFrameModule, buf.Format("Visible%d", storpos), (uint8_t)btoint(F.visible));
+ db_set_b(0, CLUIFrameModule, buf.Format("TBVisile%d", storpos), (uint8_t)btoint(F.TitleBar.ShowTitleBar));
db_set_w(0, CLUIFrameModule, buf.Format("Height%d", storpos), (WORD)F.height);
db_set_w(0, CLUIFrameModule, buf.Format("HeightCollapsed%d", storpos), (WORD)F.HeightWhenCollapsed);
@@ -693,8 +693,8 @@ static int CLUIFramesStoreFrameSettings(int Frameid)
db_set_w(0, CLUIFrameModule, buf.Format("FloatW%d", storpos), (WORD)F.FloatingSize.x);
db_set_w(0, CLUIFrameModule, buf.Format("FloatH%d", storpos), (WORD)F.FloatingSize.y);
- db_set_b(0, CLUIFrameModule, buf.Format("Floating%d", storpos), (BYTE)btoint(F.floating));
- db_set_b(0, CLUIFrameModule, buf.Format("UseBorder%d", storpos), (BYTE)btoint(F.UseBorder));
+ db_set_b(0, CLUIFrameModule, buf.Format("Floating%d", storpos), (uint8_t)btoint(F.floating));
+ db_set_b(0, CLUIFrameModule, buf.Format("UseBorder%d", storpos), (uint8_t)btoint(F.UseBorder));
db_set_w(0, CLUIFrameModule, buf.Format("Order%d", storpos), (WORD)F.order);
db_set_w(0, CLUIFrameModule, "StoredFrames", (WORD)maxstored);
@@ -2939,7 +2939,7 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP
switch (msg) {
case WM_ACTIVATE:
if (g_bTransparentFlag) {
- BYTE alpha;
+ uint8_t alpha;
if ((wParam != WA_INACTIVE || ((HWND)lParam == hwnd) || GetParent((HWND)lParam) == hwnd)) {
HWND hw = lParam ? GetParent((HWND)lParam) : nullptr;
alpha = g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT);
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp
index 9f8f3c4435..9dc29c2ed8 100644
--- a/plugins/Clist_modern/src/modern_aniavatars.cpp
+++ b/plugins/Clist_modern/src/modern_aniavatars.cpp
@@ -96,7 +96,7 @@ struct ANIAVA_WINDOWINFO
BOOL bPlaying;
int overlayIconIdx;
- BYTE bAlpha;
+ uint8_t bAlpha;
BOOL bOrderTop;
BOOL bPaused; // was request do not draw
@@ -107,7 +107,7 @@ struct ANIAVA_POSINFO
{
RECT rcPos;
int idxOverlay;
- BYTE bAlpha;
+ uint8_t bAlpha;
};
struct ANIAVA_SYNCCALLITEM
@@ -132,8 +132,8 @@ static BOOL s_bModuleStarted;
static mir_cs s_CS;
// options
-static BYTE s_bFlags; // 0x1 has border, 0x2 has round corners, 0x4 has overlay, 0x8 background color
-static BYTE s_cornerRadius;
+static uint8_t s_bFlags; // 0x1 has border, 0x2 has round corners, 0x4 has overlay, 0x8 background color
+static uint8_t s_cornerRadius;
static COLORREF s_borderColor;
static COLORREF s_bkgColor;
static HIMAGELIST s_overlayIconImageList;
@@ -453,7 +453,7 @@ static void _AniAva_LoadOptions()
s_cornerRadius = g_plugin.getByte("AvatarsUseCustomCornerSize", SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT) ? g_plugin.getWord("AvatarsCustomCornerSize", SETTINGS_AVATARCORNERSIZE_DEFAULT) : 0;
if (s_bFlags & AAO_HAS_OVERLAY) {
// check image list
- BYTE type = g_plugin.getByte("AvatarsOverlayType", SETTINGS_AVATAROVERLAYTYPE_DEFAULT);
+ uint8_t type = g_plugin.getByte("AvatarsOverlayType", SETTINGS_AVATAROVERLAYTYPE_DEFAULT);
switch (type) {
case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
s_overlayIconImageList = hAvatarOverlays;
@@ -490,7 +490,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent = nullpt
if (dat->bPlaying && IsWindowVisible(dat->hWindow)) {
POINT ptWnd = { 0 };
SIZE szWnd = { dat->rcPos.right - dat->rcPos.left, dat->rcPos.bottom - dat->rcPos.top };
- BLENDFUNCTION bf = { AC_SRC_OVER, 0, BYTE(g_CluiData.bCurrentAlpha * dat->bAlpha / 256), AC_SRC_ALPHA };
+ BLENDFUNCTION bf = { AC_SRC_OVER, 0, uint8_t(g_CluiData.bCurrentAlpha * dat->bAlpha / 256), AC_SRC_ALPHA };
POINT pt_from = { 0, 0 };
HDC hDC_animation = GetDC(nullptr);
HDC copyFromDC;
@@ -898,7 +898,7 @@ int AniAva_RenderAvatar(MCONTACT hContact, HDC hdcMem, RECT *rc)
/////////////////////////////////////////////////////////////////////////////////////////
// update avatars pos
-int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha)
+int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, uint8_t bAlpha)
{
aacheck 0;
mir_cslock lck(s_CS);
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index 3b2a64c481..050e550525 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static HANDLE hShowInfoTipEvent;
static POINT HitPoint;
static BOOL fMouseUpped;
-static BYTE IsDragToScrollMode = 0;
+static uint8_t IsDragToScrollMode = 0;
static int StartDragPos = 0;
static int StartScrollPos = 0;
static BOOL g_bSortTimerIsSet = FALSE;
@@ -1055,7 +1055,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
fMouseUpped = TRUE;
if (hitcontact != nullptr && dat->bMetaExpanding) {
- BYTE doubleClickExpand = db_get_b(0, "CLC", "MetaDoubleClick", SETTING_METAAVOIDDBLCLICK_DEFAULT);
+ uint8_t doubleClickExpand = db_get_b(0, "CLC", "MetaDoubleClick", SETTING_METAAVOIDDBLCLICK_DEFAULT);
CLUI_SafeSetTimer(hwnd, TIMERID_SUBEXPAND, GetDoubleClickTime()*doubleClickExpand, nullptr);
}
else if (dat->iHotTrack == -1 && dat->iDragItem == -1)
@@ -1296,7 +1296,7 @@ static LRESULT clcOnDestroy(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LP
static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM)
{
WORD iExtraImage[EXTRA_ICON_COUNT];
- BYTE flags = 0;
+ uint8_t flags = 0;
ClcContact *contact;
if (!Clist_FindItem(hwnd, dat, wParam, &contact))
@@ -1643,9 +1643,9 @@ HRESULT ClcLoadModule()
int ClcUnloadModule()
{
- if (g_CluiData.bOldUseGroups != (BYTE)-1)
+ if (g_CluiData.bOldUseGroups != (uint8_t)-1)
Clist::UseGroups = g_CluiData.bOldUseGroups;
- if (g_CluiData.boldHideOffline != (BYTE)-1)
+ if (g_CluiData.boldHideOffline != (uint8_t)-1)
Clist::HideOffline = g_CluiData.boldHideOffline;
return 0;
diff --git a/plugins/Clist_modern/src/modern_clc.h b/plugins/Clist_modern/src/modern_clc.h
index 0a641635d7..7f6f9308da 100644
--- a/plugins/Clist_modern/src/modern_clc.h
+++ b/plugins/Clist_modern/src/modern_clc.h
@@ -164,7 +164,7 @@ enum {
struct tContactItems
{
- BYTE itemType; //one of above CIT_ definitions
+ uint8_t itemType; //one of above CIT_ definitions
RECT itemRect;
};
@@ -189,10 +189,10 @@ struct ClcContact : public ClcContactBase
RECT pos_contact_time;
RECT pos_extra[EXTRA_ICON_COUNT];
DWORD lastPaintCounter;
- BYTE bContactRate;
+ uint8_t bContactRate;
// For extended layout
- BYTE ext_nItemsNum;
+ uint8_t ext_nItemsNum;
BOOL ext_fItemsValid;
tContactItems ext_mpItemsDesc[EXTRA_ICON_COUNT + 10]; //up to 10 items
@@ -225,16 +225,16 @@ struct ClcModernFontInfo {
HFONT hFont;
int fontHeight, changed;
COLORREF colour;
- BYTE effect;
+ uint8_t effect;
COLORREF effectColour1;
COLORREF effectColour2;
};
struct ClcData : public ClcDataBase
{
- BYTE HiLightMode;
- BYTE doubleClickExpand;
- BYTE IsMetaContactsEnabled;
+ uint8_t HiLightMode;
+ uint8_t doubleClickExpand;
+ uint8_t IsMetaContactsEnabled;
time_t last_tick_time;
bool bForceInDialog, bPlaceOfflineToRoot, bMetaIgnoreEmptyExtra, bMetaExpanding;
int subIndent;
@@ -261,7 +261,7 @@ struct ClcData : public ClcDataBase
BOOL row_align_right_items_to_right;
int row_items[NUM_ITEM_TYPE];
BOOL row_hide_group_icon;
- BYTE row_align_group_mode;
+ uint8_t row_align_group_mode;
// Avatar
BOOL avatars_show;
@@ -301,18 +301,18 @@ struct ClcData : public ClcDataBase
ClcModernFontInfo fontModernInfo[FONTID_MODERN_MAX + 1];
HWND hWnd;
- BYTE menuOwnerType;
+ uint8_t menuOwnerType;
int menuOwnerID;
DWORD m_paintCouter; //range is enoght to 49 days if painting will occure each one millisecond
- BYTE drawOverlayedStatus;
+ uint8_t drawOverlayedStatus;
int nInsertionLevel;
- BYTE dbbMetaHideExtra;
- BYTE dbbBlendInActiveState;
- BYTE dbbBlend25;
+ uint8_t dbbMetaHideExtra;
+ uint8_t dbbBlendInActiveState;
+ uint8_t dbbBlend25;
XPTHANDLE hCheckBoxTheme;
- BYTE bCompactMode;
+ uint8_t bCompactMode;
__forceinline int getRowHeight(int iRow) const
{ return (row_heights && row_variable_height) ? row_heights[iRow] : rowHeight;
@@ -358,7 +358,7 @@ COLORREF cliGetColor(char *module, char *color, COLORREF defColor);
// clcopts.c
int ClcOptInit(WPARAM wParam, LPARAM lParam);
DWORD GetDefaultExStyle(void);
-void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF *eColour1, COLORREF *eColour2);
+void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, uint8_t *effect, COLORREF *eColour1, COLORREF *eColour2);
// groups.c
int GetContactCachedStatus(MCONTACT hContact);
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp
index 93a2117cdc..bb4ef73c49 100644
--- a/plugins/Clist_modern/src/modern_clcmsgs.cpp
+++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp
@@ -200,7 +200,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP
index += contact->iSubNumber;
}
- BYTE k = db_get_b(0, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
+ uint8_t k = db_get_b(0, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
if (k) {
for (int i = 0; i < mainindex; i++) {
ClcContact *tempCont = group->cl[i];
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index 1a14954084..468fa1eefe 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -58,13 +58,13 @@ struct
const wchar_t *szDescr;
COLORREF defColour;
const wchar_t *szDefFace;
- BYTE defCharset, defStyle;
+ uint8_t defCharset, defStyle;
char defSize;
FONTEFFECT defeffect;
COLORREF colour;
wchar_t szFace[LF_FACESIZE];
- BYTE charset, style;
+ uint8_t charset, style;
char size;
}
static fontOptionsList[] =
@@ -191,7 +191,7 @@ DWORD GetDefaultExStyle(void)
return ret;
}
-void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF *eColour1, COLORREF *eColour2)
+void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, uint8_t *effect, COLORREF *eColour1, COLORREF *eColour2)
{
for (auto &p : fontOptionsList) {
if (p.fontID == i) {
@@ -291,7 +291,7 @@ static DWORD MakeCheckBoxTreeFlags(HWND hwndTree)
static void CheckButtons(HWND hwndDlg)
{
- BYTE t = IsDlgButtonChecked(hwndDlg, IDC_METAEXPAND);
+ uint8_t t = IsDlgButtonChecked(hwndDlg, IDC_METAEXPAND);
EnableWindow(GetDlgItem(hwndDlg, IDC_METADBLCLK), t);
EnableWindow(GetDlgItem(hwndDlg, IDC_METASUBEXTRA), t);
EnableWindow(GetDlgItem(hwndDlg, IDC_SUBINDENTSPIN), t);
@@ -331,15 +331,15 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CLC", "Meta", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_META));
- db_set_b(0, "CLC", "MetaDoubleClick", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_METADBLCLK));
- db_set_b(0, "CLC", "MetaHideExtra", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_METASUBEXTRA));
- db_set_b(0, "CLC", "MetaIgnoreEmptyExtra", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_METASUBEXTRA_IGN));
- db_set_b(0, "CLC", "MetaExpanding", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_METAEXPAND));
- db_set_b(0, "ModernData", "InternalAwayMsgDiscovery", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISCOVER_AWAYMSG));
- db_set_b(0, "ModernData", "RemoveAwayMessageForOffline", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_REMOVE_OFFLINE_AWAYMSG));
-
- db_set_b(0, "CLC", "SubIndent", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SUBINDENTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "Meta", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_META));
+ db_set_b(0, "CLC", "MetaDoubleClick", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_METADBLCLK));
+ db_set_b(0, "CLC", "MetaHideExtra", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_METASUBEXTRA));
+ db_set_b(0, "CLC", "MetaIgnoreEmptyExtra", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_METASUBEXTRA_IGN));
+ db_set_b(0, "CLC", "MetaExpanding", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_METAEXPAND));
+ db_set_b(0, "ModernData", "InternalAwayMsgDiscovery", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DISCOVER_AWAYMSG));
+ db_set_b(0, "ModernData", "RemoveAwayMessageForOffline", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_REMOVE_OFFLINE_AWAYMSG));
+
+ db_set_b(0, "CLC", "SubIndent", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_SUBINDENTSPIN, UDM_GETPOS, 0, 0));
ClcOptionsChanged();
CLUI_ReloadCLUIOptions();
PostMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
@@ -432,10 +432,10 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar
else
db_set_dw(0, "CLC", "GreyoutFlags", 0);
- db_set_b(0, "CLC", "ShowIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0));
+ db_set_b(0, "CLC", "ShowIdle", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0));
db_set_w(0, "CLC", "ScrollTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLC", "GroupIndent", (BYTE)SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLC", "NoVScrollBar", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0));
+ db_set_b(0, "CLC", "GroupIndent", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "NoVScrollBar", (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0));
ClcOptionsChanged();
return TRUE;
@@ -522,12 +522,12 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CLC", "GammaCorrect", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_GAMMACORRECT));
+ db_set_b(0, "CLC", "GammaCorrect", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_GAMMACORRECT));
int hil = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_HILIGHTMODE1)) hil = 1;
if (IsDlgButtonChecked(hwndDlg, IDC_HILIGHTMODE2)) hil = 2;
if (IsDlgButtonChecked(hwndDlg, IDC_HILIGHTMODE3)) hil = 3;
- db_set_b(0, "CLC", "HiLightMode", (BYTE)hil);
+ db_set_b(0, "CLC", "HiLightMode", (uint8_t)hil);
int s1 = SendDlgItemMessage(hwndDlg, IDC_CLSORT1, CB_GETCURSEL, 0, 0);
int s2 = SendDlgItemMessage(hwndDlg, IDC_CLSORT2, CB_GETCURSEL, 0, 0);
@@ -535,12 +535,12 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if (s1 >= 0) s1 = sortbyValue[s1];
if (s2 >= 0) s2 = sortbyValue[s2];
if (s3 >= 0) s3 = sortbyValue[s3];
- g_plugin.setByte("SortBy1", (BYTE)s1);
- g_plugin.setByte("SortBy2", (BYTE)s2);
- g_plugin.setByte("SortBy3", (BYTE)s3);
+ g_plugin.setByte("SortBy1", (uint8_t)s1);
+ g_plugin.setByte("SortBy2", (uint8_t)s2);
+ g_plugin.setByte("SortBy3", (uint8_t)s3);
- g_plugin.setByte("NoOfflineBottom", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOOFFLINEMOVE));
- g_plugin.setByte("PlaceOfflineToRoot", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_OFFLINETOROOT));
+ g_plugin.setByte("NoOfflineBottom", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_NOOFFLINEMOVE));
+ g_plugin.setByte("PlaceOfflineToRoot", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_OFFLINETOROOT));
Clist_LoadContactTree(); /* this won't do job properly since it only really works when changes happen */
Clist_InitAutoRebuild(g_clistApi.hwndContactTree); /* force reshuffle */
@@ -565,7 +565,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
CheckDlgButton(hwndDlg, IDC_NOOFFLINEMOVE, g_plugin.getByte("NoOfflineBottom", SETTING_NOOFFLINEBOTTOM_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_OFFLINETOROOT, g_plugin.getByte("PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
{
- BYTE trayOption = db_get_b(0, "CLUI", "XStatusTray", SETTING_TRAYOPTION_DEFAULT);
+ uint8_t trayOption = db_get_b(0, "CLUI", "XStatusTray", SETTING_TRAYOPTION_DEFAULT);
CheckDlgButton(hwndDlg, IDC_SHOWXSTATUS, (trayOption & 3) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWNORMAL, (trayOption & 2) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_TRANSPARENTOVERLAY, (trayOption & 4) ? BST_CHECKED : BST_UNCHECKED);
@@ -677,9 +677,9 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
g_plugin.setWord("IconFlashTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("DisableTrayFlash", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ g_plugin.setByte("DisableTrayFlash", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
- BYTE xOptions = 0;
+ uint8_t xOptions = 0;
xOptions = IsDlgButtonChecked(hwndDlg, IDC_SHOWXSTATUS) ? 1 : 0;
xOptions |= (xOptions && IsDlgButtonChecked(hwndDlg, IDC_SHOWNORMAL)) ? 2 : 0;
xOptions |= (xOptions && IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENTOVERLAY)) ? 4 : 0;
@@ -858,28 +858,28 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "ModernData", "HideBehind", (BYTE)SendDlgItemMessage(hwndDlg, IDC_HIDEMETHOD, CB_GETCURSEL, 0, 0));
+ db_set_b(0, "ModernData", "HideBehind", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_HIDEMETHOD, CB_GETCURSEL, 0, 0));
db_set_w(0, "ModernData", "ShowDelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN2, UDM_GETPOS, 0, 0));
db_set_w(0, "ModernData", "HideDelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN3, UDM_GETPOS, 0, 0));
db_set_w(0, "ModernData", "HideBehindBorderSize", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN4, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLUI", "DragToScroll", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
- g_plugin.setByte("BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
+ db_set_b(0, "CLUI", "DragToScroll", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
+ g_plugin.setByte("BringToFront", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
g_bChangingMode = true;
- db_set_b(0, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
- db_set_b(0, "CLUI", "AutoSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
- db_set_b(0, "CLUI", "LockSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_LOCKSIZING));
- db_set_b(0, "CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
- db_set_b(0, "CLUI", "MinSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MINSIZEHEIGHT, nullptr, FALSE));
- db_set_b(0, "CLUI", "AutoSizeUpward", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD));
- db_set_b(0, "CLUI", "SnapToEdges", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SNAPTOEDGES));
+ db_set_b(0, "CLUI", "ClientAreaDrag", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
+ db_set_b(0, "CLUI", "AutoSize", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
+ db_set_b(0, "CLUI", "LockSize", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_LOCKSIZING));
+ db_set_b(0, "CLUI", "MaxSizeHeight", (uint8_t)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
+ db_set_b(0, "CLUI", "MinSizeHeight", (uint8_t)GetDlgItemInt(hwndDlg, IDC_MINSIZEHEIGHT, nullptr, FALSE));
+ db_set_b(0, "CLUI", "AutoSizeUpward", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD));
+ db_set_b(0, "CLUI", "SnapToEdges", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SNAPTOEDGES));
- db_set_b(0, "CLUI", "DockToSides", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DOCKTOSIDES));
+ db_set_b(0, "CLUI", "DockToSides", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DOCKTOSIDES));
db_set_b(0, "CLUI", "EventArea",
- (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_EVENTAREA_ALWAYS) ? 2 : (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EVENTAREA) ? 1 : 0));
+ (uint8_t)(IsDlgButtonChecked(hwndDlg, IDC_EVENTAREA_ALWAYS) ? 2 : (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_EVENTAREA) ? 1 : 0));
- g_plugin.setByte("AutoHide", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ g_plugin.setByte("AutoHide", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
g_plugin.setWord("HideTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
CLUI_ChangeWindowMode();
SendMessage(g_clistApi.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
@@ -1088,10 +1088,10 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, "CLUI", "LeftClientMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLUI", "RightClientMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLUI", "TopClientMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TOPMARGINSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLUI", "BottomClientMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_BOTTOMMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLUI", "LeftClientMargin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLUI", "RightClientMargin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLUI", "TopClientMargin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_TOPMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLUI", "BottomClientMargin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_BOTTOMMARGINSPIN, UDM_GETPOS, 0, 0));
db_set_b(0, "ModernData", "DisableEngine", IsDlgButtonChecked(hwndDlg, IDC_DISABLEENGINE));
db_set_b(0, "ModernData", "AeroGlass", IsDlgButtonChecked(hwndDlg, IDC_AEROGLASS));
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DISABLEENGINE)) {
@@ -1101,25 +1101,25 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
db_unset(0, "ModernData", "EnableLayering");
}
g_CluiData.dwKeyColor = db_get_dw(0, "ModernSettings", "KeyColor", (DWORD)SETTING_KEYCOLOR_DEFAULT);
- g_plugin.setByte("OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
- g_plugin.setByte("OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
+ g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
+ g_plugin.setByte("OnTop", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
SetWindowPos(g_clistApi.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- db_set_b(0, "CLUI", "DragToScroll", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
+ db_set_b(0, "CLUI", "DragToScroll", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAGTOSCROLL));
//====== Non-Layered Mode ======
- g_plugin.setByte("ToolWindow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
- db_set_b(0, "CLUI", "ShowCaption", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
- db_set_b(0, "CLUI", "ShowMainMenu", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU));
- g_plugin.setByte("ThinBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BORDER));
- g_plugin.setByte("NoBorder", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOBORDERWND));
+ g_plugin.setByte("ToolWindow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
+ db_set_b(0, "CLUI", "ShowCaption", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
+ db_set_b(0, "CLUI", "ShowMainMenu", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU));
+ g_plugin.setByte("ThinBorder", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_BORDER));
+ g_plugin.setByte("NoBorder", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_NOBORDERWND));
{
wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
g_plugin.setWString("TitleText", title);
}
- g_plugin.setByte("Min2Tray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
- g_plugin.setByte("WindowShadow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
- db_set_b(0, "CLC", "RoundCorners", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ROUNDCORNERS));
+ g_plugin.setByte("Min2Tray", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
+ g_plugin.setByte("WindowShadow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
+ db_set_b(0, "CLC", "RoundCorners", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ROUNDCORNERS));
//====== End of Non-Layered Mode ======
g_bChangingMode = true;
@@ -1140,7 +1140,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
g_CluiData.fOnDesktop = false;
}
AniAva_UpdateParent();
- db_set_b(0, "CLUI", "FadeInOut", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
+ db_set_b(0, "CLUI", "FadeInOut", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
g_CluiData.fSmoothAnimation = IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT) != 0;
{
int i1 = SendDlgItemMessage(hwndDlg, IDC_FRAMESSPIN, UDM_GETPOS, 0, 0);
@@ -1150,10 +1150,10 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
db_set_dw(0, "CLUIFrames", "GapBetweenTitleBar", (DWORD)i2);
Sync(CLUIFramesOnClistResize, (WPARAM)g_clistApi.hwndContactList, 0);
}
- g_plugin.setByte("Transparent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- g_plugin.setByte("Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
- g_plugin.setByte("AutoAlpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
- g_plugin.setByte("OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
+ g_plugin.setByte("Transparent", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ g_plugin.setByte("Alpha", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
+ g_plugin.setByte("AutoAlpha", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
+ g_plugin.setByte("OnDesktop", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
ske_LoadSkinFromDB();
CLUI_UpdateLayeredMode();
@@ -1197,12 +1197,12 @@ static int bitmapRelatedControls[] = {
struct BkgrItem
{
- BYTE changed;
- BYTE useBitmap;
+ uint8_t changed;
+ uint8_t useBitmap;
COLORREF bkColor, selColor;
char filename[MAX_PATH];
WORD flags;
- BYTE useWinColours;
+ uint8_t useWinColours;
};
struct BkgrData
{
@@ -1393,7 +1393,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
continue;
char *module = bkgrList[indx] + mir_strlen(bkgrList[indx]) + 1;
- db_set_b(0, module, "UseBitmap", (BYTE)p.useBitmap);
+ db_set_b(0, module, "UseBitmap", (uint8_t)p.useBitmap);
COLORREF col;
if ((col = p.bkColor) == DEFAULT_BKCOLOUR)
@@ -1406,7 +1406,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
else
db_set_dw(0, module, "SelBkColour", col);
- db_set_b(0, module, "UseWinColours", (BYTE)p.useWinColours);
+ db_set_b(0, module, "UseWinColours", (uint8_t)p.useWinColours);
char str[MAX_PATH];
int retval = PathToAbsolute(p.filename, str);
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index 85c7854e3c..8f5d493b88 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -88,13 +88,13 @@ const int CLCPaint::SELECTION_BORDER = 6;
const int CLCPaint::MIN_TEXT_WIDTH = 20;
const int CLCPaint::BUF2SIZE = 7;
-const BYTE CLCPaint::GIM_SELECTED_AFFECT = 1;
-const BYTE CLCPaint::GIM_HOT_AFFECT = 2;
-const BYTE CLCPaint::GIM_TEMP_AFFECT = 4;
-const BYTE CLCPaint::GIM_IDLE_AFFECT = 8;
-const BYTE CLCPaint::GIM_EXTRAICON_AFFECT = CLCPaint::GIM_SELECTED_AFFECT | CLCPaint::GIM_HOT_AFFECT | CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
-const BYTE CLCPaint::GIM_STATUSICON_AFFECT = CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
-const BYTE CLCPaint::GIM_AVATAR_AFFECT = CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
+const uint8_t CLCPaint::GIM_SELECTED_AFFECT = 1;
+const uint8_t CLCPaint::GIM_HOT_AFFECT = 2;
+const uint8_t CLCPaint::GIM_TEMP_AFFECT = 4;
+const uint8_t CLCPaint::GIM_IDLE_AFFECT = 8;
+const uint8_t CLCPaint::GIM_EXTRAICON_AFFECT = CLCPaint::GIM_SELECTED_AFFECT | CLCPaint::GIM_HOT_AFFECT | CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
+const uint8_t CLCPaint::GIM_STATUSICON_AFFECT = CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
+const uint8_t CLCPaint::GIM_AVATAR_AFFECT = CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
CLCPaint::CLCPaint()
{
@@ -1050,9 +1050,9 @@ void CLCPaint::_PreparePaintContext(ClcData *dat, HDC hdc, int paintMode, RECT &
int gValue = GetRValue(pc.tmpbkcolour) + gDelta;
int bValue = GetRValue(pc.tmpbkcolour) + bDelta;
- BYTE brValue = (rValue > 255) ? 255 : rValue < 0 ? 0 : (BYTE)rValue;
- BYTE bgValue = (gValue > 255) ? 255 : gValue < 0 ? 0 : (BYTE)gValue;
- BYTE bbValue = (bValue > 255) ? 255 : bValue < 0 ? 0 : (BYTE)bValue;
+ uint8_t brValue = (rValue > 255) ? 255 : rValue < 0 ? 0 : (uint8_t)rValue;
+ uint8_t bgValue = (gValue > 255) ? 255 : gValue < 0 ? 0 : (uint8_t)gValue;
+ uint8_t bbValue = (bValue > 255) ? 255 : bValue < 0 ? 0 : (uint8_t)bValue;
pc.hBrushAlternateGrey = CreateSolidBrush(GetNearestColor(pc.hdcMem, RGB(brValue, bgValue, bbValue)));
}
@@ -2169,7 +2169,7 @@ void CLCPaint::_DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, i
text_rc.left = min(text_rc.left, prcItem->left);
}
-void CLCPaint::_DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int &selected, int &hottrack, RECT &text_rc, RECT *prcItem, UINT uTextFormat, BYTE itemType)
+void CLCPaint::_DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int &selected, int &hottrack, RECT &text_rc, RECT *prcItem, UINT uTextFormat, uint8_t itemType)
{
if (Drawing->type == CLCIT_GROUP) {
wchar_t *szCounts = Clist_GetGroupCountsText(dat, Drawing);
diff --git a/plugins/Clist_modern/src/modern_clcpaint.h b/plugins/Clist_modern/src/modern_clcpaint.h
index 20699e003c..6a17e9dc73 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.h
+++ b/plugins/Clist_modern/src/modern_clcpaint.h
@@ -27,13 +27,13 @@ private:
static const int MIN_TEXT_WIDTH;
static const int BUF2SIZE;
- static const BYTE GIM_SELECTED_AFFECT;
- static const BYTE GIM_HOT_AFFECT;
- static const BYTE GIM_TEMP_AFFECT;
- static const BYTE GIM_IDLE_AFFECT;
- static const BYTE GIM_EXTRAICON_AFFECT;
- static const BYTE GIM_STATUSICON_AFFECT;
- static const BYTE GIM_AVATAR_AFFECT;
+ static const uint8_t GIM_SELECTED_AFFECT;
+ static const uint8_t GIM_HOT_AFFECT;
+ static const uint8_t GIM_TEMP_AFFECT;
+ static const uint8_t GIM_IDLE_AFFECT;
+ static const uint8_t GIM_EXTRAICON_AFFECT;
+ static const uint8_t GIM_STATUSICON_AFFECT;
+ static const uint8_t GIM_AVATAR_AFFECT;
enum tagenumHASHINDEX
{
@@ -116,7 +116,7 @@ private:
void _DrawContactAvatar(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT *prcItem);
void _DrawContactIcon(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *prcItem);
void _DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat);
- void _DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat, BYTE itemType);
+ void _DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat, uint8_t itemType);
void _DrawContactTime(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *prcItem);
void _DrawContactExtraIcon(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *rc, int iImage);
void _DrawContactSelection(HDC hdcMem, ClcData *dat, int& selected, int& hottrack, RECT *rcPaint, RECT *prcItem);
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index 1ac895e99b..c734c2885e 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -57,7 +57,7 @@ static IconItem iconList[] =
static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
{
- BYTE bContactRate = g_plugin.getByte(hContact, "Rate");
+ uint8_t bContactRate = g_plugin.getByte(hContact, "Rate");
if (bContactRate > _countof(rates) - 1)
bContactRate = _countof(rates) - 1;
@@ -78,7 +78,7 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
INT_PTR FAV_SetRate(WPARAM hContact, LPARAM nRate)
{
if (hContact)
- g_plugin.setByte(hContact, "Rate", (BYTE)nRate);
+ g_plugin.setByte(hContact, "Rate", (uint8_t)nRate);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index 176f679f74..8033acbdb8 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -42,7 +42,7 @@ int SkinOptInit(WPARAM wParam, LPARAM lParam);
HICON cliGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status)
{
// check if options is turned on
- BYTE trayOption = db_get_b(0, "CLUI", "XStatusTray", SETTING_TRAYOPTION_DEFAULT);
+ uint8_t trayOption = db_get_b(0, "CLUI", "XStatusTray", SETTING_TRAYOPTION_DEFAULT);
if ((trayOption & 3) && szProto != nullptr) {
if (ProtoServiceExists(szProto, PS_GETCUSTOMSTATUSICON)) {
// check status is online
@@ -171,7 +171,7 @@ HRESULT CluiLoadModule()
#define GWVS_PARTIALLY_COVERED 4
int GetWindowVisibleState(HWND, int, int);
-__inline DWORD GetDIBPixelColor(int X, int Y, int Width, int Height, int ByteWidth, BYTE * ptr)
+__inline DWORD GetDIBPixelColor(int X, int Y, int Width, int Height, int ByteWidth, uint8_t * ptr)
{
DWORD res = 0;
if (X >= 0 && X < Width && Y >= 0 && Y < Height && ptr)
@@ -203,13 +203,13 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
int maxx = 0;
int maxy = 0;
int wx = 0;
- BYTE *ptr = nullptr;
+ uint8_t *ptr = nullptr;
HRGN rgn = nullptr;
HBITMAP WindowImage = g_CluiData.fLayered ? ske_GetCurrentWindowImage() : nullptr;
if (WindowImage && g_CluiData.fLayered) {
BITMAP bmp;
GetObject(WindowImage, sizeof(BITMAP), &bmp);
- ptr = (BYTE*)bmp.bmBits;
+ ptr = (uint8_t*)bmp.bmBits;
maxx = bmp.bmWidth;
maxy = bmp.bmHeight;
wx = bmp.bmWidthBytes;
@@ -301,7 +301,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
return GWVS_PARTIALLY_COVERED;
}
-BYTE g_bCalledFromShowHide = 0;
+uint8_t g_bCalledFromShowHide = 0;
int cliShowHide(bool bAlwaysShow)
{
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp
index 4674c315da..acc206f351 100644
--- a/plugins/Clist_modern/src/modern_clistopts.cpp
+++ b/plugins/Clist_modern/src/modern_clistopts.cpp
@@ -194,12 +194,12 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam
case PSN_APPLY:
g_plugin.setWord("MinRowHeight", (WORD)SendDlgItemMessage(hwndDlg, IDC_MIN_ROW_HEIGHT_SPIN, UDM_GETPOS, 0, 0));
g_plugin.setWord("RowBorder", (WORD)SendDlgItemMessage(hwndDlg, IDC_ROW_BORDER_SPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("VariableRowHeight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_VARIABLE_ROW_HEIGHT));
- g_plugin.setByte("AlignLeftItemsToLeft", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_TO_LEFT));
- g_plugin.setByte("AlignRightItemsToRight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_TO_RIGHT));
- db_set_b(0, "CLC", "CompactMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MINIMODE));
- db_set_b(0, "CLC", "LeftMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLC", "RightMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
+ g_plugin.setByte("VariableRowHeight", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_VARIABLE_ROW_HEIGHT));
+ g_plugin.setByte("AlignLeftItemsToLeft", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_TO_LEFT));
+ g_plugin.setByte("AlignRightItemsToRight", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_TO_RIGHT));
+ db_set_b(0, "CLC", "CompactMode", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_MINIMODE));
+ db_set_b(0, "CLC", "LeftMargin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "RightMargin", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_RIGHTMARGINSPIN, UDM_GETPOS, 0, 0));
{
HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST_ORDER);
for (int i = 0; i < NUM_ITEM_TYPE; i++) {
@@ -375,17 +375,17 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("AvatarsShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_AVATARS));
- g_plugin.setByte("AvatarsAnimated", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ANIAVATARS));
- g_plugin.setByte("AvatarsInSeparateWnd", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_FASTDRAW));
+ g_plugin.setByte("AvatarsShow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_AVATARS));
+ g_plugin.setByte("AvatarsAnimated", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ANIAVATARS));
+ g_plugin.setByte("AvatarsInSeparateWnd", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_FASTDRAW));
- g_plugin.setByte("AvatarsDrawBorders", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_DRAW_BORDER));
+ g_plugin.setByte("AvatarsDrawBorders", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_DRAW_BORDER));
g_plugin.setDword("AvatarsBorderColor", (DWORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_BORDER_COLOR, CPM_GETCOLOUR, 0, 0));
- g_plugin.setByte("AvatarsRoundCorners", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_ROUND_CORNERS));
- g_plugin.setByte("AvatarsIgnoreSizeForRow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_IGNORE_SIZE));
- g_plugin.setByte("AvatarsUseCustomCornerSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK));
+ g_plugin.setByte("AvatarsRoundCorners", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_ROUND_CORNERS));
+ g_plugin.setByte("AvatarsIgnoreSizeForRow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_IGNORE_SIZE));
+ g_plugin.setByte("AvatarsUseCustomCornerSize", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK));
g_plugin.setWord("AvatarsCustomCornerSize", (WORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("AvatarsDrawOverlay", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_OVERLAY_ICONS));
+ g_plugin.setByte("AvatarsDrawOverlay", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_AVATAR_OVERLAY_ICONS));
g_plugin.setWord("AvatarsSize", (WORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_SIZE_SPIN, UDM_GETPOS, 0, 0));
g_plugin.setWord("AvatarsWidth", (WORD)SendDlgItemMessage(hwndDlg, IDC_AVATAR_WIDTH_SPIN, UDM_GETPOS, 0, 0));
@@ -444,13 +444,13 @@ static INT_PTR CALLBACK DlgProcItemIconOpts(HWND hwndDlg, UINT msg, WPARAM wPara
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("IconHideOnAvatar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDE_ICON_ON_AVATAR));
- g_plugin.setByte("IconDrawOnAvatarSpace", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_ON_AVATAR_SPACE));
- g_plugin.setByte("HideGroupsIcon", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDE_GROUPSICON));
- g_plugin.setByte("IconIgnoreSizeForRownHeight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTCHECKICONSIZE));
- g_plugin.setByte("AlwaysShowAlwaysVisIcon", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYS_VISIBLEICON));
+ g_plugin.setByte("IconHideOnAvatar", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_HIDE_ICON_ON_AVATAR));
+ g_plugin.setByte("IconDrawOnAvatarSpace", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAW_ON_AVATAR_SPACE));
+ g_plugin.setByte("HideGroupsIcon", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_HIDE_GROUPSICON));
+ g_plugin.setByte("IconIgnoreSizeForRownHeight", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_NOTCHECKICONSIZE));
+ g_plugin.setByte("AlwaysShowAlwaysVisIcon", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ALWAYS_VISIBLEICON));
{
- BYTE ovr = IsDlgButtonChecked(hwndDlg, IDC_USEXSTATUS) ? 1 : 0;
+ uint8_t ovr = IsDlgButtonChecked(hwndDlg, IDC_USEXSTATUS) ? 1 : 0;
if (ovr) ovr += IsDlgButtonChecked(hwndDlg, IDC_DRAWSTATUSOVERLAY) ? 2 : 0;
db_set_b(0, "CLC", "DrawOverlayedStatus", ovr);
}
@@ -483,8 +483,8 @@ static INT_PTR CALLBACK DlgProcItemContactTimeOpts(HWND hwndDlg, UINT msg, WPARA
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("ContactTimeShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
- g_plugin.setByte("ContactTimeShowOnlyIfDifferent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ONLY_IF_DIFFERENT));
+ g_plugin.setByte("ContactTimeShow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
+ g_plugin.setByte("ContactTimeShowOnlyIfDifferent", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_ONLY_IF_DIFFERENT));
ClcOptionsChanged();
return TRUE;
}
@@ -547,16 +547,16 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("TextRTL", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RTL));
- g_plugin.setByte("AlignGroupCaptions", (BYTE)SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_GETCURSEL, 0, 0));
- g_plugin.setByte("TextAlignToRight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_RIGHT));
- g_plugin.setByte("TextReplaceSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_REPLACE_SMILEYS));
- g_plugin.setByte("TextResizeSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RESIZE_SMILEYS));
- g_plugin.setByte("TextUseProtocolSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USE_PROTOCOL_SMILEYS));
- g_plugin.setByte("TextIgnoreSizeForRownHeight", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNORE_SIZE));
- g_plugin.setByte("FirstLineDrawSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS_ON_FIRST_LINE));
- g_plugin.setByte("FirstLineAppendNick", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_APPEND_NICK));
- g_plugin.setByte("TrimText", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRIM_TEXT));
+ g_plugin.setByte("TextRTL", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_RTL));
+ g_plugin.setByte("AlignGroupCaptions", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_ALIGNGROUPCOMBO, CB_GETCURSEL, 0, 0));
+ g_plugin.setByte("TextAlignToRight", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ALIGN_RIGHT));
+ g_plugin.setByte("TextReplaceSmileys", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_REPLACE_SMILEYS));
+ g_plugin.setByte("TextResizeSmileys", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_RESIZE_SMILEYS));
+ g_plugin.setByte("TextUseProtocolSmileys", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_USE_PROTOCOL_SMILEYS));
+ g_plugin.setByte("TextIgnoreSizeForRownHeight", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_IGNORE_SIZE));
+ g_plugin.setByte("FirstLineDrawSmileys", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS_ON_FIRST_LINE));
+ g_plugin.setByte("FirstLineAppendNick", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_APPEND_NICK));
+ g_plugin.setByte("TrimText", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_TRIM_TEXT));
ClcOptionsChanged();
return TRUE;
}
@@ -688,9 +688,9 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("SecondLineShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
+ g_plugin.setByte("SecondLineShow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
g_plugin.setWord("SecondLineTopSpace", (WORD)SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("SecondLineDrawSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS));
+ g_plugin.setByte("SecondLineDrawSmileys", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS));
WORD radio;
if (IsDlgButtonChecked(hwndDlg, IDC_STATUS))
@@ -712,10 +712,10 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM
t[TEXT_TEXT_MAX_LENGTH - 1] = '\0';
g_plugin.setWString("SecondLineText", t);
- g_plugin.setByte("SecondLineXStatusHasPriority", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
- g_plugin.setByte("SecondLineShowStatusIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
- g_plugin.setByte("SecondLineShowListeningIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY));
- g_plugin.setByte("SecondLineUseNameAndMessageForXStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USE_NAME_AND_MESSAGE));
+ g_plugin.setByte("SecondLineXStatusHasPriority", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
+ g_plugin.setByte("SecondLineShowStatusIfNoAway", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
+ g_plugin.setByte("SecondLineShowListeningIfNoAway", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY));
+ g_plugin.setByte("SecondLineUseNameAndMessageForXStatus", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_USE_NAME_AND_MESSAGE));
ClcOptionsChanged();
return TRUE;
}
@@ -845,9 +845,9 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setByte("ThirdLineShow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
+ g_plugin.setByte("ThirdLineShow", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW));
g_plugin.setWord("ThirdLineTopSpace", (WORD)SendDlgItemMessage(hwndDlg, IDC_TOP_SPACE_SPIN, UDM_GETPOS, 0, 0));
- g_plugin.setByte("ThirdLineDrawSmileys", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS));
+ g_plugin.setByte("ThirdLineDrawSmileys", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DRAW_SMILEYS));
{
int radio;
if (IsDlgButtonChecked(hwndDlg, IDC_STATUS))
@@ -873,10 +873,10 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM
g_plugin.setWString("ThirdLineText", t);
}
- g_plugin.setByte("ThirdLineXStatusHasPriority", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
- g_plugin.setByte("ThirdLineUseNameAndMessageForXStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USE_NAME_AND_MESSAGE));
- g_plugin.setByte("ThirdLineShowStatusIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
- g_plugin.setByte("ThirdLineShowListeningIfNoAway", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY));
+ g_plugin.setByte("ThirdLineXStatusHasPriority", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_XSTATUS_HAS_PRIORITY));
+ g_plugin.setByte("ThirdLineUseNameAndMessageForXStatus", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_USE_NAME_AND_MESSAGE));
+ g_plugin.setByte("ThirdLineShowStatusIfNoAway", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_STATUS_IF_NOAWAY));
+ g_plugin.setByte("ThirdLineShowListeningIfNoAway", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY));
ClcOptionsChanged();
return TRUE;
}
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index b300c8a012..8c81d31480 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -173,9 +173,9 @@ VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD)
void SettingsMigrate(void)
{
- BYTE TrayIcon = g_plugin.getByte("TrayIcon");
- BYTE AlwaysPrimary = g_plugin.getByte("AlwaysPrimary");
- BYTE AlwaysMulti = g_plugin.getByte("AlwaysMulti");
+ uint8_t TrayIcon = g_plugin.getByte("TrayIcon");
+ uint8_t AlwaysPrimary = g_plugin.getByte("AlwaysPrimary");
+ uint8_t AlwaysMulti = g_plugin.getByte("AlwaysMulti");
ptrA PrimaryStatus(g_plugin.getStringA("PrimaryStatus"));
// these strings must always be set
@@ -246,7 +246,7 @@ static int GetGoodAccNum(bool *bDiffers, bool *bConn = nullptr)
return res;
}
-BYTE OldMode; //
+uint8_t OldMode; //
UINT_PTR TimerID = 0;
int cliTrayIconInit(HWND hwnd)
@@ -275,7 +275,7 @@ int cliTrayIconInit(HWND hwnd)
return 0;
}
- BYTE Mode;
+ uint8_t Mode;
if (!bDiffers) // all equal
OldMode = Mode = g_plugin.getByte("tiModeS", TRAY_ICON_MODE_GLOBAL);
else
@@ -341,7 +341,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int)
GetGoodAccNum(&bDiffers, &bConn);
// if the icon number to be changed, reinitialize module from scratch
- BYTE Mode = g_plugin.getByte((!bDiffers) ? "tiModeS" : "tiModeV", TRAY_ICON_MODE_GLOBAL);
+ uint8_t Mode = g_plugin.getByte((!bDiffers) ? "tiModeS" : "tiModeV", TRAY_ICON_MODE_GLOBAL);
if (Mode != OldMode) {
OldMode = Mode;
Clist_TrayIconIconsChanged();
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index b3fa6beaf0..b938250856 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -70,7 +70,7 @@ RECT g_rcEdgeSizingRect = { 0 };
/* Module global variables */
-static BYTE bAlphaEnd;
+static uint8_t bAlphaEnd;
static int bOldHideOffline;
static int bOldUseGroups;
@@ -502,8 +502,8 @@ int CLUI_ShowWindowMod(HWND hWnd, int nCmd)
static BOOL CLUI_WaitThreadsCompletion()
{
- static BYTE bEntersCount = 0;
- static const BYTE bcMAX_AWAITING_RETRY = 10; // repeat awaiting only 10 times
+ static uint8_t bEntersCount = 0;
+ static const uint8_t bcMAX_AWAITING_RETRY = 10; // repeat awaiting only 10 times
TRACE("CLUI_WaitThreadsCompletion Enter");
if (bEntersCount < bcMAX_AWAITING_RETRY && (g_CluiData.mutexPaintLock || g_hAwayMsgThread || g_hGetTextAsyncThread || g_hSmoothAnimationThread) && !Miranda_IsTerminated()) {
TRACE("Waiting threads");
@@ -1366,7 +1366,7 @@ static int CLUI_SmoothAlphaThreadTransition()
return 1;
}
-int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam)
+int CLUI_SmoothAlphaTransition(HWND hwnd, uint8_t GoalAlpha, BOOL wParam)
{
if (!g_CluiData.fLayered && (!g_CluiData.fSmoothAnimation && !g_bTransparentFlag)) {
if (GoalAlpha > 0 && wParam != 2) {
@@ -1958,9 +1958,9 @@ LRESULT CLUI::OnAutoAlphaTimer(UINT, WPARAM, LPARAM)
// change
bTransparentFocus = inwnd;
if (bTransparentFocus)
- CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT), 1);
+ CLUI_SmoothAlphaTransition(m_hWnd, (uint8_t)g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT), 1);
else
- CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)(g_bTransparentFlag ? g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT) : 255), 1);
+ CLUI_SmoothAlphaTransition(m_hWnd, (uint8_t)(g_bTransparentFlag ? g_plugin.getByte("AutoAlpha", SETTING_AUTOALPHA_DEFAULT) : 255), 1);
}
if (!bTransparentFocus)
KillTimer(m_hWnd, TM_AUTOALPHA);
@@ -2079,7 +2079,7 @@ LRESULT CLUI::OnActivate(UINT msg, WPARAM wParam, LPARAM lParam)
}
RedrawWindow(m_hWnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ALLCHILDREN);
if (g_bTransparentFlag) {
- BYTE alpha;
+ uint8_t alpha;
if (wParam != WA_INACTIVE || CLUI_CheckOwnedByClui((HWND)lParam) || ((HWND)lParam == m_hWnd) || GetParent((HWND)lParam) == m_hWnd)
alpha = g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT);
else
@@ -2167,7 +2167,7 @@ LRESULT CLUI::OnShowWindow(UINT, WPARAM wParam, LPARAM lParam)
if (lParam) return 0;
if (mutex_bShowHideCalledFromAnimation) return 1;
- BYTE gAlpha = (!wParam) ? 0 : (g_plugin.getByte("Transparent", SETTING_TRANSPARENT_DEFAULT) ? g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT) : 255);
+ uint8_t gAlpha = (!wParam) ? 0 : (g_plugin.getByte("Transparent", SETTING_TRANSPARENT_DEFAULT) ? g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT) : 255);
if (wParam) {
g_CluiData.bCurrentAlpha = 0;
Sync(CLUIFrames_OnShowHide, 1);
@@ -2519,7 +2519,7 @@ LRESULT CLUI::OnDestroy(UINT, WPARAM, LPARAM)
UnLoadCLUIFramesModule();
//ExtFrames_Uninit();
TRACE("CLUI.c: WM_DESTROY - UnLoadCLUIFramesModule DONE\n");
- g_plugin.setByte("State", (BYTE)state);
+ g_plugin.setByte("State", (uint8_t)state);
ske_UnloadSkin(&g_SkinObjectList);
delete m_pCLUI;
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h
index fa9e3b066e..fd42e9fca6 100644
--- a/plugins/Clist_modern/src/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/modern_commonprototypes.h
@@ -21,7 +21,7 @@ extern bool g_bPostWasCanceled;
extern bool g_bTransparentFlag;
extern bool g_bFullRepaint;
extern bool g_bMultiConnectionMode;
-extern BYTE g_bCalledFromShowHide;
+extern uint8_t g_bCalledFromShowHide;
extern HWND g_hCLUIOptionsWnd;
extern UINT g_dwMainThreadID;
extern HWND g_hwndViewModeFrame;
@@ -70,7 +70,7 @@ int CLUI_ReloadCLUIOptions();
int CLUI_ShowFromBehindEdge();
int CLUI_SizingGetWindowRect(HWND hwnd, RECT *rc);
int CLUI_SizingOnBorder(POINT, int);
-int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam);
+int CLUI_SmoothAlphaTransition(HWND hwnd, uint8_t GoalAlpha, BOOL wParam);
int CLUI_TestCursorOnBorders();
int CLUI_UpdateTimer();
void CLUI_UpdateLayeredMode();
@@ -89,7 +89,7 @@ void EventArea_ConfigureEventArea();
/* ModernSkinButton */
int ModernSkinButton_AddButton(HWND parent, char *ID, char *CommandService, char *StateDefService, char *HandeService, int Left, int Top, int Right, int Bottom, DWORD AlignedTo, wchar_t *Hint, char *DBkey, char *TypeDef, int MinWidth, int MinHeight);
int ModernSkinButtonLoadModule();
-int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r);
+int ModernSkinButton_ReposButtons(HWND parent, uint8_t draw, RECT *r);
int ModernSkinButtonUnloadModule(WPARAM, LPARAM);
/* RowHeight */
@@ -101,13 +101,13 @@ void ske_ApplyTranslucency(void);
int ske_BltBackImage(HWND destHWND, HDC destDC, RECT *BltClientRect);
HBITMAP ske_CreateDIB32(int cx, int cy);
HBITMAP ske_CreateDIB32Point(int cx, int cy, void ** bits);
-HRGN ske_CreateOpaqueRgn(BYTE Level, bool Opaque);
-HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha);
+HRGN ske_CreateOpaqueRgn(uint8_t Level, bool Opaque);
+HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, uint8_t alpha);
int ske_DrawImageAt(HDC hdc, RECT *rc);
BOOL ske_DrawIconEx(HDC hdc, int xLeft, int yTop, HICON hIcon, int cxWidth, int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
int ske_DrawNonFramedObjects(BOOL Erase, RECT *r);
BOOL ske_DrawText(HDC hdc, LPCTSTR lpString, int nCount, RECT *lpRect, UINT format);
-SKINOBJECTDESCRIPTOR* ske_FindObjectByName(const char *szName, BYTE objType, SKINOBJECTSLIST *Skin);
+SKINOBJECTDESCRIPTOR* ske_FindObjectByName(const char *szName, uint8_t objType, SKINOBJECTSLIST *Skin);
HBITMAP ske_GetCurrentWindowImage();
int ske_GetFullFilename(wchar_t *buf, const wchar_t *file, wchar_t *skinfolder, BOOL madeAbsolute);
BOOL ske_ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle);
@@ -122,7 +122,7 @@ int ske_PrepareImageButDontUpdateIt(RECT *r);
int ske_ReCreateBackImage(BOOL Erase, RECT *w);
int ske_RedrawCompleteWindow();
bool ske_ResetTextEffect(HDC);
-bool ske_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor);
+bool ske_SelectTextEffect(HDC hdc, uint8_t EffectID, DWORD FirstColor, DWORD SecondColor);
INT_PTR ske_Service_DrawGlyph(WPARAM wParam, LPARAM lParam);
BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force = FALSE);
BOOL ske_SetRgnOpaque(HDC memdc, HRGN hrgn, BOOL force = FALSE);
@@ -148,7 +148,7 @@ FRAMEWND* FindFrameByItsHWND(HWND FrameHwnd); //cluiframes.c
int DrawTitleBar(HDC hdcMem2, RECT *rect, int Frameid);
int FindFrameID(HWND FrameHwnd);
-int SetAlpha(BYTE Alpha);
+int SetAlpha(uint8_t Alpha);
/* others TODO: move above */
@@ -156,8 +156,8 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam);
void DrawBackGround(HWND hwnd, HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColour, DWORD backgroundBmpUse);
HRESULT BackgroundsLoadModule();
int BackgroundsUnloadModule();
-char* GetParamN(char *string, char *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces); //mod_skin_selector.c
-wchar_t* GetParamN(wchar_t *string, wchar_t *buf, int buflen, BYTE paramN, wchar_t Delim, BOOL SkipSpaces);
+char* GetParamN(char *string, char *buf, int buflen, uint8_t paramN, char Delim, BOOL SkipSpaces); //mod_skin_selector.c
+wchar_t* GetParamN(wchar_t *string, wchar_t *buf, int buflen, uint8_t paramN, wchar_t Delim, BOOL SkipSpaces);
DWORD CompareContacts2_getLMTime(MCONTACT u); //contact.c
DWORD mod_CalcHash(const char *a); //mod_skin_selector.c
HICON cliGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status); //clistmod.c
@@ -182,7 +182,7 @@ INT_PTR SetUseGroups(WPARAM wParam, LPARAM lParam);
INT_PTR ToggleSounds(WPARAM wParam, LPARAM lParam); //contact.c
void ClcOptionsChanged(); //clc.c
void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc); //Docking.c
-void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1, DWORD flag, BYTE alpha); //gdiplus.cpp
+void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1, DWORD flag, uint8_t alpha); //gdiplus.cpp
void InitGdiPlus(); //gdiplus.cpp
void ShutdownGdiPlus(); //gdiplus.cpp
void UnloadAvatarOverlayIcon(); //clc.c
@@ -252,7 +252,7 @@ extern HRESULT(WINAPI *g_proc_DWMEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHI
/* SkinEngine.c */
-BYTE SkinDBGetContactSettingByte(MCONTACT hContact, const char* szSection, const char*szKey, BYTE bDefault);
+uint8_t SkinDBGetContactSettingByte(MCONTACT hContact, const char* szSection, const char*szKey, uint8_t bDefault);
extern OVERLAYICONINFO g_pAvatarOverlayIcons[MAX_STATUS_COUNT];
extern OVERLAYICONINFO g_pStatusOverlayIcons[MAX_STATUS_COUNT];
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp
index 5cb553bbe9..49c9e8cc43 100644
--- a/plugins/Clist_modern/src/modern_contact.cpp
+++ b/plugins/Clist_modern/src/modern_contact.cpp
@@ -90,7 +90,7 @@ int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2)
ClcCacheEntry *c1 = contact1->pce, *c2 = contact2->pce;
for (int i = 0; i < _countof(g_CluiData.bSortByOrder); i++) {
- BYTE &by = g_CluiData.bSortByOrder[i];
+ uint8_t &by = g_CluiData.bSortByOrder[i];
if (by == SORTBY_STATUS) { //status
int ordera = GetStatusModeOrdering(c1->getStatus());
@@ -177,6 +177,6 @@ INT_PTR SetUseGroups(WPARAM wParam, LPARAM)
INT_PTR ToggleSounds(WPARAM, LPARAM)
{
db_set_b(0, "Skin", "UseSound",
- (BYTE)!db_get_b(0, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT));
+ (uint8_t)!db_get_b(0, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT));
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp
index e7a63e9a57..fc22f00af3 100644
--- a/plugins/Clist_modern/src/modern_docking.cpp
+++ b/plugins/Clist_modern/src/modern_docking.cpp
@@ -102,7 +102,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
MSG *msg = (MSG*)wParam;
if (msg->message == WM_DESTROY)
- g_plugin.setByte("Docked", (BYTE)g_CluiData.fDocked);
+ g_plugin.setByte("Docked", (uint8_t)g_CluiData.fDocked);
if (!g_CluiData.fDocked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE && msg->message != WM_SIZE) return 0;
switch (msg->message) {
@@ -197,7 +197,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
Sync(CLUIFrames_OnMoving, msg->hwnd, (LPRECT)msg->lParam);
g_CluiData.mutexPreventDockMoving = 1;
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
- g_plugin.setByte("Docked", (BYTE)g_CluiData.fDocked);
+ g_plugin.setByte("Docked", (uint8_t)g_CluiData.fDocked);
ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
return TRUE;
}
@@ -294,7 +294,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
GetCursorPos(&pt);
PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
SetWindowPos(msg->hwnd, nullptr, pt.x - rc.right / 2, pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, g_plugin.getDword("Width", 0), g_plugin.getDword("Height", 0), SWP_NOZORDER);
- g_plugin.setByte("Docked", (BYTE)g_CluiData.fDocked);
+ g_plugin.setByte("Docked", (uint8_t)g_CluiData.fDocked);
// ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
}
return 1;
diff --git a/plugins/Clist_modern/src/modern_effectenum.h b/plugins/Clist_modern/src/modern_effectenum.h
index aff63b837c..e6fe8bb64c 100644
--- a/plugins/Clist_modern/src/modern_effectenum.h
+++ b/plugins/Clist_modern/src/modern_effectenum.h
@@ -4,16 +4,16 @@ typedef signed char sbyte;
typedef struct _MODERNEFFECTMATRIX
{
sbyte matrix[25];
- BYTE topEffect;
- BYTE leftEffect;
- BYTE rightEffect;
- BYTE bottomEffect;
- BYTE cycleCount; //low 7 bits
+ uint8_t topEffect;
+ uint8_t leftEffect;
+ uint8_t rightEffect;
+ uint8_t bottomEffect;
+ uint8_t cycleCount; //low 7 bits
}MODERNEFFECTMATRIX;
typedef struct _MODERNEFFECT
{
- BYTE EffectID;
+ uint8_t EffectID;
MODERNEFFECTMATRIX EffectMatrix;
DWORD EffectColor1;
DWORD EffectColor2;
@@ -90,4 +90,4 @@ MODERNEFFECTMATRIX ModernEffectsEnum[] = {
extern wchar_t * ModernEffectNames[];
#endif
extern BOOL SkinEngine_ResetTextEffect(HDC);
-extern BOOL SkinEngine_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor); \ No newline at end of file
+extern BOOL SkinEngine_SelectTextEffect(HDC hdc, uint8_t EffectID, DWORD FirstColor, DWORD SecondColor); \ No newline at end of file
diff --git a/plugins/Clist_modern/src/modern_gdiplus.cpp b/plugins/Clist_modern/src/modern_gdiplus.cpp
index cbc36d8f79..7a11b64b70 100644
--- a/plugins/Clist_modern/src/modern_gdiplus.cpp
+++ b/plugins/Clist_modern/src/modern_gdiplus.cpp
@@ -15,7 +15,7 @@ using namespace Gdiplus;
HBITMAP ske_CreateDIB32(int cx, int cy);
-BYTE saved_alpha;
+uint8_t saved_alpha;
ULONG_PTR g_gdiplusToken;
int g_hottrack;
@@ -43,9 +43,9 @@ static ColorMatrix ClrMatrix =
0.0f, 0.0f, 0.0f, 0.0f, 1.0f
};
-DWORD argb_from_cola(COLORREF col, BYTE alpha)
+DWORD argb_from_cola(COLORREF col, uint8_t alpha)
{
- return((BYTE)(alpha) << 24 | col);
+ return((uint8_t)(alpha) << 24 | col);
}
HBITMAP GDIPlus_LoadGlyphImage(const wchar_t *tszFileName)
@@ -63,17 +63,17 @@ HBITMAP GDIPlus_LoadGlyphImage(const wchar_t *tszFileName)
return hbmp;
}
-void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1, DWORD flag, BYTE alpha)
+void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1, DWORD flag, uint8_t alpha)
{
BITMAP bmp;
Bitmap *bm;
- BYTE * bmbits = nullptr;
+ uint8_t * bmbits = nullptr;
GetObject(hbmp, sizeof(BITMAP), &bmp);
Graphics g(hDestDC);
if (bmp.bmBitsPixel == 32 && (flag&AVS_PREMULTIPLIED)) {
- bmbits = (BYTE*)bmp.bmBits;
+ bmbits = (uint8_t*)bmp.bmBits;
if (!bmbits) {
- bmbits = (BYTE*)malloc(bmp.bmHeight*bmp.bmWidthBytes);
+ bmbits = (uint8_t*)malloc(bmp.bmHeight*bmp.bmWidthBytes);
GetBitmapBits(hbmp, bmp.bmHeight*bmp.bmWidthBytes, bmbits);
}
bm = new Bitmap(bmp.bmWidth, bmp.bmHeight, bmp.bmWidthBytes, PixelFormat32bppPARGB, bmbits);
@@ -110,7 +110,7 @@ BOOL GDIPlus_AlphaBlend(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWi
Bitmap *bm;
if (bmp.bmBitsPixel == 32 && bf->AlphaFormat) {
- bm = new Bitmap(bmp.bmWidth, bmp.bmHeight, bmp.bmWidthBytes, PixelFormat32bppPARGB, (BYTE*)bmp.bmBits);
+ bm = new Bitmap(bmp.bmWidth, bmp.bmHeight, bmp.bmWidthBytes, PixelFormat32bppPARGB, (uint8_t*)bmp.bmBits);
bm->RotateFlip(RotateNoneFlipY);
}
else bm = new Bitmap(hbmp, nullptr);
diff --git a/plugins/Clist_modern/src/modern_global_structure.h b/plugins/Clist_modern/src/modern_global_structure.h
index ba134cdaae..6e76a7367c 100644
--- a/plugins/Clist_modern/src/modern_global_structure.h
+++ b/plugins/Clist_modern/src/modern_global_structure.h
@@ -23,8 +23,8 @@ struct CLUIDATA
char varFilter[2048];
DWORD lastMsgFilter;
char current_viewmode[256], old_viewmode[256];
- BYTE boldHideOffline;
- BYTE bOldUseGroups;
+ uint8_t boldHideOffline;
+ uint8_t bOldUseGroups;
DWORD statusMaskFilter;
DWORD stickyMaskFilter;
DWORD filterFlags;
@@ -48,10 +48,10 @@ struct CLUIDATA
bool fSortNoOfflineBottom;
bool fAutoSize;
bool fAeroGlass;
- BYTE bCurrentAlpha;
- BYTE bSTATE;
- BYTE bBehindEdgeSettings;
- BYTE bSortByOrder[3];
+ uint8_t bCurrentAlpha;
+ uint8_t bSTATE;
+ uint8_t bBehindEdgeSettings;
+ uint8_t bSortByOrder[3];
signed char nBehindEdgeState;
diff --git a/plugins/Clist_modern/src/modern_image_array.cpp b/plugins/Clist_modern/src/modern_image_array.cpp
index cd2ec11052..1b96633d77 100644
--- a/plugins/Clist_modern/src/modern_image_array.cpp
+++ b/plugins/Clist_modern/src/modern_image_array.cpp
@@ -575,7 +575,7 @@ BOOL ImageArray_RemoveImage(IMAGE_ARRAY_DATA *iad, int pos)
-BOOL ImageArray_DrawImage(IMAGE_ARRAY_DATA *iad, int pos, HDC hdcDest, int nXDest, int nYDest, BYTE Alpha)
+BOOL ImageArray_DrawImage(IMAGE_ARRAY_DATA *iad, int pos, HDC hdcDest, int nXDest, int nYDest, uint8_t Alpha)
{
if (hdcDest == nullptr || pos < 0 || pos >= iad->nodes_size)
return FALSE;
diff --git a/plugins/Clist_modern/src/modern_image_array.h b/plugins/Clist_modern/src/modern_image_array.h
index 1572f83922..45899fceef 100644
--- a/plugins/Clist_modern/src/modern_image_array.h
+++ b/plugins/Clist_modern/src/modern_image_array.h
@@ -79,6 +79,6 @@ BOOL ImageArray_ChangeImage(IMAGE_ARRAY_DATA *iad, HBITMAP hBmp, int pos);
BOOL ImageArray_RemoveImage(IMAGE_ARRAY_DATA *iad, int pos);
// Draw an image
-BOOL ImageArray_DrawImage(IMAGE_ARRAY_DATA *iad, int pos, HDC hdcDest, int nXDest, int nYDest, BYTE Alpha);
+BOOL ImageArray_DrawImage(IMAGE_ARRAY_DATA *iad, int pos, HDC hdcDest, int nXDest, int nYDest, uint8_t Alpha);
#endif // __IMAGE_ARRAY_H__
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp
index 132d85b4da..5fe7f39945 100644
--- a/plugins/Clist_modern/src/modern_skinbutton.cpp
+++ b/plugins/Clist_modern/src/modern_skinbutton.cpp
@@ -38,10 +38,10 @@ HWND SetToolTip(HWND hwnd, wchar_t * tip);
typedef struct _ModernSkinButtonCtrl
{
HWND hwnd;
- BYTE down; // button state
- BYTE focus; // has focus (1 or 0)
- BYTE hover;
- BYTE IsSwitcher;
+ uint8_t down; // button state
+ uint8_t focus; // has focus (1 or 0)
+ uint8_t hover;
+ uint8_t IsSwitcher;
BOOL fCallOnPress;
char * ID;
char * CommandService;
@@ -236,7 +236,7 @@ static int ModernSkinButtonToggleDBValue(char * ValueDBSection, char *ValueTypeD
case 'b':
curval = db_get_b(0, section, key, l2);
curval = (curval == l2) ? l1 : l2;
- db_set_b(0, section, key, (BYTE)curval);
+ db_set_b(0, section, key, (uint8_t)curval);
break;
}
mir_free(section);
@@ -490,7 +490,7 @@ HWND SetToolTip(HWND hwnd, wchar_t * tip)
typedef struct _MButton
{
HWND hwnd;
- BYTE ConstrainPositionFrom; //(BBRRTTLL) L = 0 - from left, L = 1 from right, L = 2 from center
+ uint8_t ConstrainPositionFrom; //(BBRRTTLL) L = 0 - from left, L = 1 from right, L = 2 from center
int OrL, OrR, OrT, OrB;
int minW, minH;
ModernSkinButtonCtrl * bct;
@@ -564,7 +564,7 @@ int ModernSkinButton_AddButton(HWND parent,
Buttons[ButtonsCount].OrT = Top;
Buttons[ButtonsCount].OrR = Right;
Buttons[ButtonsCount].OrB = Bottom;
- Buttons[ButtonsCount].ConstrainPositionFrom = (BYTE)sbFlags;
+ Buttons[ButtonsCount].ConstrainPositionFrom = (uint8_t)sbFlags;
Buttons[ButtonsCount].minH = MinHeight;
Buttons[ButtonsCount].minW = MinWidth;
ButtonsCount++;
@@ -641,7 +641,7 @@ int ModernSkinButtonDeleteAll()
return 0;
}
-int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *pRect)
+int ModernSkinButton_ReposButtons(HWND parent, uint8_t draw, RECT *pRect)
{
RECT rc, clr, rd;
BOOL altDraw = FALSE;
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index 36ea9594a3..43b5675d15 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -37,13 +37,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* tga header */
struct tga_header_t
{
- BYTE id_lenght; /* size of image id */
- BYTE colormap_type; /* 1 is has a colormap */
- BYTE image_type; /* compression type */
+ uint8_t id_lenght; /* size of image id */
+ uint8_t colormap_type; /* 1 is has a colormap */
+ uint8_t image_type; /* compression type */
short cm_first_entry; /* colormap origin */
short cm_length; /* colormap length */
- BYTE cm_size; /* colormap size */
+ uint8_t cm_size; /* colormap size */
short x_origin; /* bottom left x coord origin */
short y_origin; /* bottom left y coord origin */
@@ -51,8 +51,8 @@ struct tga_header_t
short width; /* picture width (in pixels) */
short height; /* picture height (in pixels) */
- BYTE pixel_depth; /* bits per pixel: 8, 16, 24 or 32 */
- BYTE image_descriptor; /* 24 bits = 0x00; 32 bits = 0x80 */
+ uint8_t pixel_depth; /* bits per pixel: 8, 16, 24 or 32 */
+ uint8_t image_descriptor; /* 24 bits = 0x00; 32 bits = 0x80 */
};
#pragma pack(pop)
@@ -86,8 +86,8 @@ static SKINOBJECTSLIST *pCurrentSkin = nullptr;
static char **pszSettingName = nullptr;
static int nArrayLen = 0;
-static BYTE pbGammaWeight[256] = { 0 };
-static BYTE pbGammaWeightAdv[256] = { 0 };
+static uint8_t pbGammaWeight[256] = { 0 };
+static uint8_t pbGammaWeightAdv[256] = { 0 };
static BOOL bGammaWeightFilled = FALSE;
static mir_cs cs_SkinChanging;
@@ -95,7 +95,7 @@ static mir_cs cs_SkinChanging;
static LISTMODERNMASK *MainModernMaskList = nullptr;
/* Private module procedures */
-static BOOL ske_GetMaskBit(BYTE *line, int x);
+static BOOL ske_GetMaskBit(uint8_t *line, int x);
static INT_PTR ske_Service_AlphaTextOut(WPARAM wParam, LPARAM lParam);
static INT_PTR ske_Service_DrawIconEx(WPARAM wParam, LPARAM lParam);
@@ -105,7 +105,7 @@ static void ske_AddParseSkinFont(char * szFontID, char * szDefineString);
static int ske_GetSkinFromDB(char * szSection, SKINOBJECTSLIST * Skin);
static SKINOBJECTDESCRIPTOR* ske_FindObject(const char *szName, SKINOBJECTSLIST *Skin);
static int ske_LoadSkinFromResource(BOOL bOnlyObjects);
-static void ske_PreMultiplyChannels(HBITMAP hbmp, BYTE Mult);
+static void ske_PreMultiplyChannels(HBITMAP hbmp, uint8_t 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);
@@ -116,7 +116,7 @@ static MODERNEFFECT meCurrentEffect = { 0xFF, { 0 }, 0, 0 };
//////////////////////////////////////////////////////////////////////////
// Ini file parser
-IniParser::IniParser(wchar_t * tcsFileName, BYTE flags) : _Flags(flags)
+IniParser::IniParser(wchar_t * tcsFileName, uint8_t flags) : _Flags(flags)
{
_DoInit();
if (!tcsFileName) return;
@@ -134,7 +134,7 @@ IniParser::IniParser(wchar_t * tcsFileName, BYTE flags) : _Flags(flags)
}
}
-IniParser::IniParser(HINSTANCE hInst, const char * resourceName, const char * resourceType, BYTE flags) : _Flags(flags)
+IniParser::IniParser(HINSTANCE hInst, const char * resourceName, const char * resourceType, uint8_t flags) : _Flags(flags)
{
_DoInit();
_LoadResourceIni(hInst, resourceName, resourceType);
@@ -183,7 +183,7 @@ HRESULT IniParser::WriteStrToDb(const char * szSection, const char * szName, con
switch (szValue[0]) {
case 'b':
- db_set_b(0, szSection, szName, (BYTE)atoi(szValue + 1));
+ db_set_b(0, szSection, szName, (uint8_t)atoi(szValue + 1));
break;
case 'w':
@@ -566,7 +566,7 @@ BOOL ske_SetRgnOpaque(HDC memdc, HRGN hrgn, BOOL force)
BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force)
{
int f = 0;
- BYTE *bits;
+ uint8_t *bits;
BITMAP bmp;
if (g_CluiData.fDisableSkinEngine && !force)
@@ -580,11 +580,11 @@ BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force)
if (!bmp.bmBits) {
f = 1;
- bits = (BYTE*)mir_alloc(bmp.bmWidthBytes*bmp.bmHeight);
+ bits = (uint8_t*)mir_alloc(bmp.bmWidthBytes*bmp.bmHeight);
GetBitmapBits(hbmp, bmp.bmWidthBytes*bmp.bmHeight, bits);
}
else
- bits = (BYTE*)bmp.bmBits;
+ bits = (uint8_t*)bmp.bmBits;
int sx = (fr->left > 0) ? fr->left : 0;
int sy = (fr->top > 0) ? fr->top : 0;
@@ -593,9 +593,9 @@ BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force)
int width = ex - sx;
- BYTE *pLine = ((BYTE *)bits) + (bmp.bmHeight - sy - 1) * bmp.bmWidthBytes + (sx << 2) + 3;
+ uint8_t *pLine = ((uint8_t *)bits) + (bmp.bmHeight - sy - 1) * bmp.bmWidthBytes + (sx << 2) + 3;
for (int y = 0; y < (ey - sy); y++) {
- BYTE *pColumn = pLine;
+ uint8_t *pColumn = pLine;
for (int x = 0; x < width; x++) {
*pColumn = 255;
pColumn += 4;
@@ -610,7 +610,7 @@ BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force)
return 1;
}
-static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *rGlyph, RECT *rClip, BYTE mode, BYTE drawMode)
+static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *rGlyph, RECT *rClip, uint8_t mode, uint8_t drawMode)
{
BLENDFUNCTION bf = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
@@ -922,7 +922,7 @@ HBITMAP ske_CreateDIB32Point(int cx, int cy, void **bits)
return DirectBitmap;
}
-HRGN ske_CreateOpaqueRgn(BYTE Level, bool Opaque)
+HRGN ske_CreateOpaqueRgn(uint8_t Level, bool Opaque)
{
if (!g_pCachedWindow)
return nullptr;
@@ -986,7 +986,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST *preq, GLYPHOBJECT *pobj)
int k = 0;
//BITMAP bmp = {0};
HBITMAP membmp = nullptr, oldbmp = nullptr, oldglyph = nullptr;
- BYTE Is32Bit = 0;
+ uint8_t Is32Bit = 0;
RECT PRect;
POINT mode2offset = { 0 };
int depth = 0;
@@ -1241,7 +1241,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST *preq, GLYPHOBJECT *pobj)
if ((k > 0 || k == -1) && mode == 2) {
{
- BLENDFUNCTION bf = { AC_SRC_OVER, 0, pobj->dwAlpha, BYTE(pobj->bmBitsPixel == 32 && pobj->Style != ST_BRUSH ? AC_SRC_ALPHA : 0) };
+ BLENDFUNCTION bf = { AC_SRC_OVER, 0, pobj->dwAlpha, uint8_t(pobj->bmBitsPixel == 32 && pobj->Style != ST_BRUSH ? AC_SRC_ALPHA : 0) };
OffsetRect(&PRect, mode2offset.x, mode2offset.y);
ske_AlphaBlend(preq->hDC, PRect.left, PRect.top, PRect.right - PRect.left, PRect.bottom - PRect.top,
memdc, 0, 0, PRect.right - PRect.left, PRect.bottom - PRect.top, bf);
@@ -1370,7 +1370,7 @@ static SKINOBJECTDESCRIPTOR* ske_FindObjectByMask(MODERNMASK *pModernMask, SKINO
return sk->pMaskList ? skin_FindObjectByMask(pModernMask, sk->pMaskList) : nullptr;
}
-SKINOBJECTDESCRIPTOR* ske_FindObjectByName(const char *szName, BYTE objType, SKINOBJECTSLIST *Skin)
+SKINOBJECTDESCRIPTOR* ske_FindObjectByName(const char *szName, uint8_t objType, SKINOBJECTSLIST *Skin)
{
SKINOBJECTSLIST *sk = (Skin == nullptr) ? (&g_SkinObjectList) : Skin;
for (DWORD i = 0; i < sk->dwObjLPAlocated; i++) {
@@ -1411,7 +1411,7 @@ INT_PTR ske_Service_DrawGlyph(WPARAM wParam, LPARAM lParam)
if (gl->hGlyph) {
BITMAP bmp = { 0 };
GetObject(gl->hGlyph, sizeof(BITMAP), &bmp);
- gl->bmBitsPixel = (BYTE)bmp.bmBitsPixel;
+ gl->bmBitsPixel = (uint8_t)bmp.bmBitsPixel;
gl->bmHeight = bmp.bmHeight;
gl->bmWidth = bmp.bmWidth;
}
@@ -1422,11 +1422,11 @@ INT_PTR ske_Service_DrawGlyph(WPARAM wParam, LPARAM lParam)
}
-void ske_PreMultiplyChannels(HBITMAP hbmp, BYTE Mult)
+void ske_PreMultiplyChannels(HBITMAP hbmp, uint8_t Mult)
{
BITMAP bmp;
BOOL flag = FALSE;
- BYTE *pBitmapBits;
+ uint8_t *pBitmapBits;
DWORD Len;
int bh, bw, y, x;
@@ -1440,9 +1440,9 @@ void ske_PreMultiplyChannels(HBITMAP hbmp, BYTE Mult)
GetBitmapBits(hbmp, Len, pBitmapBits);
}
else
- pBitmapBits = (BYTE *)bmp.bmBits;
+ pBitmapBits = (uint8_t *)bmp.bmBits;
for (y = 0; y < bh; ++y) {
- BYTE *pPixel = pBitmapBits + bw * 4 * y;
+ uint8_t *pPixel = pBitmapBits + bw * 4 * y;
for (x = 0; x < bw; ++x) {
if (Mult) {
@@ -1492,20 +1492,20 @@ 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)
+static BOOL ske_ReadTGAImageData(void *From, DWORD fromSize, uint8_t *destBuf, DWORD bufSize, BOOL RLE)
{
- BYTE *pos = destBuf;
- BYTE *from = fromSize ? (BYTE *)From : nullptr;
+ uint8_t *pos = destBuf;
+ uint8_t *from = fromSize ? (uint8_t *)From : nullptr;
FILE *fp = !fromSize ? (FILE *)From : nullptr;
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);
+ uint8_t r = from ? from[fromCount++] : (uint8_t)fgetc(fp);
+ uint8_t g = from ? from[fromCount++] : (uint8_t)fgetc(fp);
+ uint8_t b = from ? from[fromCount++] : (uint8_t)fgetc(fp);
+ uint8_t a = from ? from[fromCount++] : (uint8_t)fgetc(fp);
pos[destCount++] = r;
pos[destCount++] = g;
pos[destCount++] = b;
@@ -1516,14 +1516,14 @@ static BOOL ske_ReadTGAImageData(void *From, DWORD fromSize, BYTE *destBuf, DWOR
}
}
else {
- BYTE rgba[4];
- BYTE packet_header;
- BYTE *ptr = pos;
- BYTE size;
+ uint8_t rgba[4];
+ uint8_t packet_header;
+ uint8_t *ptr = pos;
+ uint8_t size;
int i;
while (ptr < pos + bufSize) {
/* read first byte */
- packet_header = from ? from[fromCount] : (BYTE)fgetc(fp);
+ packet_header = from ? from[fromCount] : (uint8_t)fgetc(fp);
if (from) from++;
size = 1 + (packet_header & 0x7f);
if (packet_header & 0x80) {
@@ -1532,7 +1532,7 @@ static BOOL ske_ReadTGAImageData(void *From, DWORD fromSize, BYTE *destBuf, DWOR
*((DWORD*)rgba) = *((DWORD*)(from + fromCount));
fromCount += 4;
}
- else fread(rgba, sizeof(BYTE), 4, fp);
+ else fread(rgba, sizeof(uint8_t), 4, fp);
for (i = 0; i < size; ++i, ptr += 4) {
ptr[2] = rgba[2];
ptr[1] = rgba[1];
@@ -1542,10 +1542,10 @@ static BOOL ske_ReadTGAImageData(void *From, DWORD fromSize, BYTE *destBuf, DWOR
}
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);
+ ptr[0] = from ? from[fromCount++] : (uint8_t)fgetc(fp);
+ ptr[1] = from ? from[fromCount++] : (uint8_t)fgetc(fp);
+ ptr[2] = from ? from[fromCount++] : (uint8_t)fgetc(fp);
+ ptr[3] = from ? from[fromCount++] : (uint8_t)fgetc(fp);
}
}
}
@@ -1555,7 +1555,7 @@ static BOOL ske_ReadTGAImageData(void *From, DWORD fromSize, BYTE *destBuf, DWOR
static HBITMAP ske_LoadGlyphImage_TGA(const wchar_t *szFilename)
{
- BYTE *colormap = nullptr;
+ uint8_t *colormap = nullptr;
int cx = 0, cy = 0;
BOOL err = FALSE;
tga_header_t header;
@@ -1575,7 +1575,7 @@ static HBITMAP ske_LoadGlyphImage_TGA(const wchar_t *szFilename)
}
/*memory allocation */
- colormap = (BYTE*)mir_alloc(header.width*header.height * 4);
+ colormap = (uint8_t*)mir_alloc(header.width*header.height * 4);
cx = header.width;
cy = header.height;
fseek(fp, header.id_lenght, SEEK_CUR);
@@ -1590,11 +1590,11 @@ static HBITMAP ske_LoadGlyphImage_TGA(const wchar_t *szFilename)
HGLOBAL hRes = LoadResource(g_plugin.getInst(), hRSrc);
if (!hRes) return nullptr;
DWORD size = SizeofResource(g_plugin.getInst(), hRSrc);
- BYTE *mem = (BYTE*)LockResource(hRes);
+ uint8_t *mem = (uint8_t*)LockResource(hRes);
if (size > sizeof(header)) {
tga_header_t *tgahdr = (tga_header_t*)mem;
if (tgahdr->pixel_depth == 32 && (tgahdr->image_type == 2 || tgahdr->image_type == 10)) {
- colormap = (BYTE*)mir_alloc(tgahdr->width*tgahdr->height * 4);
+ colormap = (uint8_t*)mir_alloc(tgahdr->width*tgahdr->height * 4);
cx = tgahdr->width;
cy = tgahdr->height;
ske_ReadTGAImageData((void*)(mem + sizeof(tga_header_t) + tgahdr->id_lenght + tgahdr->cm_length), size - (sizeof(tga_header_t) + tgahdr->id_lenght + tgahdr->cm_length), colormap, cx*cy * 4, tgahdr->image_type == 10);
@@ -1607,7 +1607,7 @@ static HBITMAP ske_LoadGlyphImage_TGA(const wchar_t *szFilename)
return nullptr;
// create dib section
- BYTE *pt;
+ uint8_t *pt;
HBITMAP hbmp = ske_CreateDIB32Point(cx, cy, (void**)&pt);
if (hbmp)
memcpy(pt, colormap, cx*cy * 4);
@@ -2010,7 +2010,7 @@ bool ske_ResetTextEffect(HDC hdc)
return true;
}
-bool ske_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor)
+bool ske_SelectTextEffect(HDC hdc, uint8_t EffectID, DWORD FirstColor, DWORD SecondColor)
{
if (EffectID > MAXPREDEFINEDEFFECTS)
return false;
@@ -2047,22 +2047,22 @@ static bool ske_GetTextEffect(HDC hdc, MODERNEFFECT *modernEffect)
return true;
}
-static bool ske_DrawTextEffect(BYTE *destPt, BYTE *maskPt, DWORD width, DWORD height, MODERNEFFECT *effect)
+static bool ske_DrawTextEffect(uint8_t *destPt, uint8_t *maskPt, DWORD width, DWORD height, MODERNEFFECT *effect)
{
sbyte *buf;
sbyte *outbuf;
sbyte *bufline, *buflineTop, *buflineMid;
int sign = 0;
- BYTE *maskline, *destline;
- BYTE al, rl, gl, bl, ad, rd, gd, bd;
+ uint8_t *maskline, *destline;
+ uint8_t al, rl, gl, bl, ad, rd, gd, bd;
int k = 0;
DWORD x, y;
sbyte *matrix;
- BYTE mcTopStart;
- BYTE mcBottomEnd;
- BYTE mcLeftStart;
- BYTE mcRightEnd;
- BYTE effectCount;
+ uint8_t mcTopStart;
+ uint8_t mcBottomEnd;
+ uint8_t mcLeftStart;
+ uint8_t mcRightEnd;
+ uint8_t effectCount;
int minX = width;
int maxX = 0;
int minY = height;
@@ -2070,7 +2070,7 @@ static bool ske_DrawTextEffect(BYTE *destPt, BYTE *maskPt, DWORD width, DWORD he
if (effect->EffectID == 0xFF) return false;
if (!width || !height) return false;
if (!destPt) return false;
- buf = (sbyte*)mir_alloc(width*height*sizeof(BYTE));
+ buf = (sbyte*)mir_alloc(width*height*sizeof(uint8_t));
{
matrix = effect->EffectMatrix.matrix;
mcTopStart = 2 - effect->EffectMatrix.topEffect;
@@ -2079,11 +2079,11 @@ static bool ske_DrawTextEffect(BYTE *destPt, BYTE *maskPt, DWORD width, DWORD he
mcRightEnd = 3 + effect->EffectMatrix.rightEffect;
effectCount = effect->EffectMatrix.cycleCount;
}
- al = 255 - ((BYTE)(effect->EffectColor1 >> 24));
+ al = 255 - ((uint8_t)(effect->EffectColor1 >> 24));
rl = GetRValue(effect->EffectColor1);
gl = GetGValue(effect->EffectColor1);
bl = GetBValue(effect->EffectColor1);
- ad = 255 - ((BYTE)(effect->EffectColor2 >> 24));
+ ad = 255 - ((uint8_t)(effect->EffectColor2 >> 24));
rd = GetRValue(effect->EffectColor2);
gd = GetGValue(effect->EffectColor2);
bd = GetBValue(effect->EffectColor2);
@@ -2093,7 +2093,7 @@ static bool ske_DrawTextEffect(BYTE *destPt, BYTE *maskPt, DWORD width, DWORD he
bufline = buf + y*width;
maskline = maskPt + ((y*width) << 2);
for (x = 0; x < width; x++) {
- BYTE a = (sbyte)(DWORD)((maskline[0] + maskline[2] + maskline[1] + maskline[1]) >> 4);
+ uint8_t a = (sbyte)(DWORD)((maskline[0] + maskline[2] + maskline[1] + maskline[1]) >> 4);
*bufline = a;
if (a != 0) {
minX = min((int)x, minX);
@@ -2146,7 +2146,7 @@ static bool ske_DrawTextEffect(BYTE *destPt, BYTE *maskPt, DWORD width, DWORD he
buf = outbuf;
}
{
- BYTE r1, b1, g1, a1;
+ uint8_t r1, b1, g1, a1;
b1 = bl; r1 = rl; g1 = gl; a1 = al; sign = 1;
//perform out to dest
for (y = 0; y < height; y++) {
@@ -2154,7 +2154,7 @@ static bool ske_DrawTextEffect(BYTE *destPt, BYTE *maskPt, DWORD width, DWORD he
destline = destPt + ((y*width) << 2);
for (x = 0; x < width; x++) {
sbyte val = *bufline;
- BYTE absVal = ((val < 0) ? -val : val);
+ uint8_t absVal = ((val < 0) ? -val : val);
if (val != 0) {
if (val > 0 && sign < 0) {
@@ -2187,19 +2187,19 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect,
// Step first fill fast calc correction tables:
static bool _tables_empty = true;
- static BYTE gammaTbl[256]; // Gamma correction table
+ static uint8_t gammaTbl[256]; // Gamma correction table
static WORD blueMulTbl[256]; // blue coefficient multiplication table
static WORD greenMulTbl[256]; // green coefficient multiplication table
static WORD redMulTbl[256]; // red coefficient multiplication table
if (_tables_empty) {
// fill tables
double gammaCfPw = 1000 / (double)DBGetContactSettingRangedWord(0, "ModernData", "AlphaTextOutGamma", 700, 1, 5000);
- BYTE blueCf = db_get_b(0, "ModernData", "AlphaTextOutBlueCorrection", 28);
- BYTE redCf = db_get_b(0, "ModernData", "AlphaTextOutRed Correction", 77);
- BYTE greenCf = db_get_b(0, "ModernData", "AlphaTextOutGreen Correction", 151);
+ uint8_t blueCf = db_get_b(0, "ModernData", "AlphaTextOutBlueCorrection", 28);
+ uint8_t redCf = db_get_b(0, "ModernData", "AlphaTextOutRed Correction", 77);
+ uint8_t greenCf = db_get_b(0, "ModernData", "AlphaTextOutGreen Correction", 151);
for (int i = 0; i < 256; i++) {
- gammaTbl[i] = (BYTE)(255 * pow((double)i / 255, gammaCfPw));
+ gammaTbl[i] = (uint8_t)(255 * pow((double)i / 255, gammaCfPw));
blueMulTbl[i] = i * blueCf;
redMulTbl[i] = i * redCf;
greenMulTbl[i] = i * greenCf;
@@ -2216,13 +2216,13 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect,
GetObject(hDestBitmap, sizeof(BITMAP), &bmpDest);
bool destHasNotDIB = (bmpDest.bmBits == nullptr);
- BYTE *pDestBits;
+ uint8_t *pDestBits;
if (destHasNotDIB) {
- pDestBits = (BYTE*)mir_alloc(bmpDest.bmHeight * bmpDest.bmWidthBytes);
+ pDestBits = (uint8_t*)mir_alloc(bmpDest.bmHeight * bmpDest.bmWidthBytes);
GetBitmapBits(hDestBitmap, bmpDest.bmHeight*bmpDest.bmWidthBytes, pDestBits);
}
else
- pDestBits = (BYTE*)bmpDest.bmBits;
+ pDestBits = (uint8_t*)bmpDest.bmBits;
// Creating offscreen buffer
HDC hOffscreenDC = CreateCompatibleDC(hDC);
@@ -2302,13 +2302,13 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect,
// probably here are mess ofscreen and temp buff dc
//Create bitmap image for offscreen
- BYTE *bits = nullptr;
+ uint8_t *bits = nullptr;
HBITMAP hbmp = ske_CreateDIB32Point(textSize.cx, textSize.cy, (void**)&bits);
if (bits != nullptr) {
HBITMAP holdbmp = (HBITMAP)SelectObject(hOffscreenDC, hbmp);
//Create buffer bitmap image for temp text
- BYTE *bufbits = nullptr;
+ uint8_t *bufbits = nullptr;
HBITMAP bufbmp = ske_CreateDIB32Point(textSize.cx, textSize.cy, (void**)&bufbits);
if (bufbits != nullptr) {
HDC bufDC = CreateCompatibleDC(hDC);
@@ -2336,12 +2336,12 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect,
DWORD width = textSize.cx;
DWORD heigh = textSize.cy;
- BYTE *pDestScanLine, *pBufScanLine, *pix, *bufpix;
+ uint8_t *pDestScanLine, *pBufScanLine, *pix, *bufpix;
- BYTE al = 255 - ((BYTE)(ARGBcolor >> 24));
- BYTE r = GetRValue(ARGBcolor);
- BYTE g = GetGValue(ARGBcolor);
- BYTE b = GetBValue(ARGBcolor);
+ uint8_t al = 255 - ((uint8_t)(ARGBcolor >> 24));
+ uint8_t r = GetRValue(ARGBcolor);
+ uint8_t g = GetGValue(ARGBcolor);
+ uint8_t b = GetBValue(ARGBcolor);
for (DWORD y = 2; y < heigh - 2; y++) {
int lineBytes = y * (width << 2);
@@ -2354,9 +2354,9 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect,
bufpix = pBufScanLine + (x << 2);
// Monochromatic
- BYTE bx = gammaTbl[bufpix[0]];
- BYTE gx = gammaTbl[bufpix[1]];
- BYTE rx = gammaTbl[bufpix[2]];
+ uint8_t bx = gammaTbl[bufpix[0]];
+ uint8_t gx = gammaTbl[bufpix[1]];
+ uint8_t rx = gammaTbl[bufpix[2]];
if (al != 255) {
bx *= al / 255;
@@ -2364,10 +2364,10 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect,
rx *= al / 255;
}
- BYTE ax = (BYTE)(((DWORD)rx * 77 + (DWORD)gx * 151 + (DWORD)bx * 28 + 128) / 256);
+ uint8_t ax = (uint8_t)(((DWORD)rx * 77 + (DWORD)gx * 151 + (DWORD)bx * 28 + 128) / 256);
if (ax) {
//Normalize components to gray
- BYTE axx = 255 - ((r + g + b) >> 2); // Coefficient of grayance, more white font - more gray edges
+ uint8_t axx = 255 - ((r + g + b) >> 2); // Coefficient of grayance, more white font - more gray edges
WORD atx = ax * (255 - axx);
bx = (atx + bx * axx) / 255;
gx = (atx + gx * axx) / 255;
@@ -2380,7 +2380,7 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect,
pix[0] += brx;
pix[1] += grx;
pix[2] += rrx;
- pix[3] = (BYTE)(ax + (BYTE)(255 - ax)*pix[3] / 255);
+ pix[3] = (uint8_t)(ax + (uint8_t)(255 - ax)*pix[3] / 255);
}
}
}
@@ -2473,13 +2473,13 @@ HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i)
// TODO: Direct draw Icon from imagelist without
// extracting of icon
if (bm.bmBitsPixel == 32) {
- BYTE *bits = (BYTE*)bm.bmBits;
+ uint8_t *bits = (uint8_t*)bm.bmBits;
if (!bits) {
- bits = (BYTE*)mir_alloc(bm.bmWidthBytes*bm.bmHeight);
+ bits = (uint8_t*)mir_alloc(bm.bmWidthBytes*bm.bmHeight);
GetBitmapBits(imi.hbmImage, bm.bmWidthBytes*bm.bmHeight, bits);
}
- BYTE *bcbits = bits + (bm.bmHeight - imi.rcImage.bottom)*bm.bmWidthBytes + (imi.rcImage.left*bm.bmBitsPixel >> 3);
+ uint8_t *bcbits = bits + (bm.bmHeight - imi.rcImage.bottom)*bm.bmWidthBytes + (imi.rcImage.left*bm.bmBitsPixel >> 3);
for (int iy = 0; iy < imi.rcImage.bottom - imi.rcImage.top; iy++) {
int x;
// Dummy microsoft fix - alpha can be less than r,g or b
@@ -2489,11 +2489,11 @@ HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i)
DWORD *c = ((DWORD*)bcbits);
for (x = 0; x < imi.rcImage.right - imi.rcImage.left; x++) {
DWORD val = *c;
- BYTE a = (BYTE)((val) >> 24);
+ uint8_t a = (uint8_t)((val) >> 24);
if (a != 0) {
- BYTE r = (BYTE)((val & 0xFF0000) >> 16);
- BYTE g = (BYTE)((val & 0xFF00) >> 8);
- BYTE b = (BYTE)(val & 0xFF);
+ uint8_t r = (uint8_t)((val & 0xFF0000) >> 16);
+ uint8_t g = (uint8_t)((val & 0xFF00) >> 8);
+ uint8_t b = (uint8_t)(val & 0xFF);
if (a < r || a < g || a < b) {
a = max(max(r, g), b);
val = a << 24 | r << 16 | g << 8 | b;
@@ -2523,7 +2523,7 @@ BOOL ske_ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int
if (g_CluiData.fDisableSkinEngine)
return ImageList_DrawEx(himl, i, hdcDst, x, y, dx, dy, rgbBk, rgbFg, fStyle);
- BYTE alpha;
+ uint8_t alpha;
if (fStyle & ILD_BLEND25)
alpha = 64;
else if (fStyle & ILD_BLEND50)
@@ -2553,14 +2553,14 @@ static INT_PTR ske_Service_DrawIconEx(WPARAM wParam, LPARAM)
BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags)
{
ICONINFO ici;
- BYTE alpha = (BYTE)((diFlags & 0xFF000000) >> 24);
+ uint8_t alpha = (uint8_t)((diFlags & 0xFF000000) >> 24);
HBITMAP tBmp = nullptr;
- BYTE *imbits, *imimagbits, *immaskbits;
- BYTE *t1, *t2, *t3;
+ uint8_t *imbits, *imimagbits, *immaskbits;
+ uint8_t *t1, *t2, *t3;
//lockimagelist
- BYTE hasmask = FALSE, no32bit = FALSE, noMirrorMask = FALSE, hasalpha = FALSE;
+ uint8_t hasmask = FALSE, no32bit = FALSE, noMirrorMask = FALSE, hasalpha = FALSE;
alpha = alpha ? alpha : 255;
if (g_CluiData.fDisableSkinEngine && !(diFlags & 0x80))
@@ -2597,16 +2597,16 @@ BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, i
bool NoDIBImage = (imbt.bmBits == nullptr);
if (NoDIBImage) {
- imimagbits = (BYTE*)mir_alloc(cy*imbt.bmWidthBytes);
+ imimagbits = (uint8_t*)mir_alloc(cy*imbt.bmWidthBytes);
GetBitmapBits(ici.hbmColor, cy*imbt.bmWidthBytes, (void*)imimagbits);
}
- else imimagbits = (BYTE*)imbt.bmBits;
+ else imimagbits = (uint8_t*)imbt.bmBits;
if (immaskbt.bmBits == nullptr) {
- immaskbits = (BYTE*)mir_alloc(cy*immaskbt.bmWidthBytes);
+ immaskbits = (uint8_t*)mir_alloc(cy*immaskbt.bmWidthBytes);
GetBitmapBits(ici.hbmMask, cy*immaskbt.bmWidthBytes, (void*)immaskbits);
}
- else immaskbits = (BYTE*)immaskbt.bmBits;
+ else immaskbits = (uint8_t*)immaskbt.bmBits;
HDC imDC = CreateCompatibleDC(hdcDst);
DWORD icy = imbt.bmHeight;
@@ -2638,12 +2638,12 @@ BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, i
t2 = imbits + (!no32bit ? y : (icy - y - 1))*mwb2;
t3 = immaskbits + (noMirrorMask ? y : (h - y - 1 - top))*mwb;
for (x = 0; x < right; x++) {
- BYTE mask = 0;
- BYTE a = 0;
+ uint8_t mask = 0;
+ uint8_t a = 0;
DWORD *src = (DWORD*)(t1 + (x << 2));
DWORD *dest = (DWORD*)(t2 + (x << 2));
if (hasalpha && !hasmask)
- a = ((BYTE*)src)[3];
+ a = ((uint8_t*)src)[3];
else {
mask = ((1 << (7 - x % 8))&(*(t3 + (x >> 3)))) != 0;
if (mask) {
@@ -2652,22 +2652,22 @@ BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, i
continue;
}
- if (((BYTE*)src)[3]>0)
- a = ((BYTE*)src)[3];
+ if (((uint8_t*)src)[3]>0)
+ a = ((uint8_t*)src)[3];
else
a = 0;
}
else if (hasalpha || hasmask)
- a = (((BYTE*)src)[3] > 0 ? ((BYTE*)src)[3] : 255);
+ a = (((uint8_t*)src)[3] > 0 ? ((uint8_t*)src)[3] : 255);
else if (!hasalpha && !hasmask)
a = 255;
else { *dest = 0; continue; }
}
if (a > 0) {
- ((BYTE*)dest)[3] = a;
- ((BYTE*)dest)[0] = ((BYTE*)src)[0] * a / 255;
- ((BYTE*)dest)[1] = ((BYTE*)src)[1] * a / 255;
- ((BYTE*)dest)[2] = ((BYTE*)src)[2] * a / 255;
+ ((uint8_t*)dest)[3] = a;
+ ((uint8_t*)dest)[0] = ((uint8_t*)src)[0] * a / 255;
+ ((uint8_t*)dest)[1] = ((uint8_t*)src)[1] * a / 255;
+ ((uint8_t*)dest)[2] = ((uint8_t*)src)[2] * a / 255;
}
else *dest = 0;
}
@@ -3200,7 +3200,7 @@ void ske_ApplyTranslucency()
if (!g_CluiData.fLayered && IsTransparancy) {
if (!layered)
SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)g_CluiData.bCurrentAlpha, LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (uint8_t)g_CluiData.bCurrentAlpha, LWA_ALPHA);
}
AniAva_RedrawAllAvatars(FALSE);
@@ -3280,7 +3280,7 @@ static DWORD ske_HexToARGB(char *Hex)
char *st;
DWORD AARRGGBB = strtoul(buf2, &st, 16);
- BYTE alpha = (BYTE)((AARRGGBB & 0xFF000000) >> 24);
+ uint8_t alpha = (uint8_t)((AARRGGBB & 0xFF000000) >> 24);
alpha = 255 - ((alpha == 0) ? 255 : alpha);
AARRGGBB = (alpha << 24) + ((AARRGGBB & 0x00FF0000) >> 16) + ((AARRGGBB & 0x000000FF) << 16) + (AARRGGBB & 0x0000FF00);
return AARRGGBB;
@@ -3449,14 +3449,14 @@ static void ske_AddParseSkinFont(char *szFontID, char *szDefineString)
}
/*
- * ske_CheckHasAlfaChannel - checks if image has at least one BYTE in alpha chennel
+ * ske_CheckHasAlfaChannel - checks if image has at least one uint8_t in alpha chennel
* that is not a 0. (is image real 32 bit or just 24 bit)
*/
-static BOOL ske_CheckHasAlfaChannel(BYTE *from, int widthByte, int height)
+static BOOL ske_CheckHasAlfaChannel(uint8_t *from, int widthByte, int height)
{
DWORD *pt = (DWORD*)from;
for (int j = 0; j < height; j++) {
- BYTE *add = (BYTE*)pt + widthByte;
+ uint8_t *add = (uint8_t*)pt + widthByte;
while (pt < (DWORD*)add) {
if ((*pt & 0xFF000000) != 0)
return TRUE;
@@ -3471,7 +3471,7 @@ static BOOL ske_CheckHasAlfaChannel(BYTE *from, int widthByte, int height)
* ske_CheckIconHasMask - checks if mask image has at least one that is not a 0.
* Not sure is ir required or not
*/
-static BOOL ske_CheckIconHasMask(BYTE *from)
+static BOOL ske_CheckIconHasMask(uint8_t *from)
{
for (int i = 0; i < 16 * 16 / 8; i++)
if (from[i] != 0)
@@ -3483,7 +3483,7 @@ static BOOL ske_CheckIconHasMask(BYTE *from)
/*
* ske_GetMaskBit - return value of apropriate mask bit in line at x position
*/
-static BOOL ske_GetMaskBit(BYTE *line, int x)
+static BOOL ske_GetMaskBit(uint8_t *line, int x)
{
return ((*(line + (x >> 3)))&(0x01 << (7 - (x & 0x07)))) != 0;
}
@@ -3493,19 +3493,19 @@ static BOOL ske_GetMaskBit(BYTE *line, int x)
* X2 - overlaying points.
*/
-static DWORD ske_Blend(DWORD X1, DWORD X2, BYTE alpha)
+static DWORD ske_Blend(DWORD X1, DWORD X2, uint8_t alpha)
{
- BYTE a1 = (BYTE)(X1 >> 24);
- BYTE a2 = (BYTE)(((X2 >> 24)*alpha) >> 8);
- BYTE r1 = (BYTE)(X1 >> 16);
- BYTE r2 = (BYTE)(X2 >> 16);
- BYTE g1 = (BYTE)(X1 >> 8);
- BYTE g2 = (BYTE)(X2 >> 8);
- BYTE b1 = (BYTE)(X1);
- BYTE b2 = (BYTE)(X2);
+ uint8_t a1 = (uint8_t)(X1 >> 24);
+ uint8_t a2 = (uint8_t)(((X2 >> 24)*alpha) >> 8);
+ uint8_t r1 = (uint8_t)(X1 >> 16);
+ uint8_t r2 = (uint8_t)(X2 >> 16);
+ uint8_t g1 = (uint8_t)(X1 >> 8);
+ uint8_t g2 = (uint8_t)(X2 >> 8);
+ uint8_t b1 = (uint8_t)(X1);
+ uint8_t b2 = (uint8_t)(X2);
- BYTE a_1 = ~a1;
- BYTE a_2 = ~a2;
+ uint8_t a_1 = ~a1;
+ uint8_t a_2 = ~a2;
WORD am = (WORD)a1*a_2;
/* it is possible to use >>8 instead of /255 but it is require additional
@@ -3531,7 +3531,7 @@ static DWORD ske_Blend(DWORD X1, DWORD X2, BYTE alpha)
* CreateJoinedIcon - creates new icon by drawing hTop over hBottom.
*/
-HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha)
+HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, uint8_t alpha)
{
ICONINFO iNew = { 0 };
ICONINFO iciBottom = { 0 };
@@ -3545,7 +3545,7 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha)
HDC tempDC = CreateCompatibleDC(nullptr);
- BYTE *ptPixels;
+ uint8_t *ptPixels;
HBITMAP nImage = ske_CreateDIB32Point(16, 16, (void**)&ptPixels);
HBITMAP oImage = (HBITMAP)SelectObject(tempDC, nImage);
@@ -3558,37 +3558,37 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha)
GetObject(iciTop.hbmMask, sizeof(BITMAP), &bmp_top_mask);
if (bmp_bottom.bmBitsPixel == 32 && bmp_top.bmBitsPixel == 32) {
- BYTE *BottomBuffer, *TopBuffer, *BottomMaskBuffer, *TopMaskBuffer;
- BYTE *bb, *tb, *bmb, *tmb;
- BYTE *db = ptPixels;
+ uint8_t *BottomBuffer, *TopBuffer, *BottomMaskBuffer, *TopMaskBuffer;
+ uint8_t *bb, *tb, *bmb, *tmb;
+ uint8_t *db = ptPixels;
int vstep_d = 16 * 4;
int vstep_b = bmp_bottom.bmWidthBytes;
int vstep_t = bmp_top.bmWidthBytes;
int vstep_bm = bmp_bottom_mask.bmWidthBytes;
int vstep_tm = bmp_top_mask.bmWidthBytes;
alpha = alpha ? alpha : 255;
- if (bmp_bottom.bmBits) bb = BottomBuffer = (BYTE*)bmp_bottom.bmBits;
+ if (bmp_bottom.bmBits) bb = BottomBuffer = (uint8_t*)bmp_bottom.bmBits;
else {
- BottomBuffer = (BYTE*)mir_alloc(bmp_bottom.bmHeight*bmp_bottom.bmWidthBytes);
+ BottomBuffer = (uint8_t*)mir_alloc(bmp_bottom.bmHeight*bmp_bottom.bmWidthBytes);
GetBitmapBits(iciBottom.hbmColor, bmp_bottom.bmHeight*bmp_bottom.bmWidthBytes, BottomBuffer);
bb = BottomBuffer + vstep_b*(bmp_bottom.bmHeight - 1);
vstep_b = -vstep_b;
}
- if (bmp_top.bmBits) tb = TopBuffer = (BYTE*)bmp_top.bmBits;
+ if (bmp_top.bmBits) tb = TopBuffer = (uint8_t*)bmp_top.bmBits;
else {
- TopBuffer = (BYTE*)mir_alloc(bmp_top.bmHeight*bmp_top.bmWidthBytes);
+ TopBuffer = (uint8_t*)mir_alloc(bmp_top.bmHeight*bmp_top.bmWidthBytes);
GetBitmapBits(iciTop.hbmColor, bmp_top.bmHeight*bmp_top.bmWidthBytes, TopBuffer);
tb = TopBuffer + vstep_t*(bmp_top.bmHeight - 1);
vstep_t = -vstep_t;
}
if (bmp_bottom_mask.bmBits) {
- BottomMaskBuffer = (BYTE*)bmp_bottom_mask.bmBits;
+ BottomMaskBuffer = (uint8_t*)bmp_bottom_mask.bmBits;
bmb = BottomMaskBuffer;
}
else {
- BottomMaskBuffer = (BYTE*)mir_alloc(bmp_bottom_mask.bmHeight*bmp_bottom_mask.bmWidthBytes);
+ BottomMaskBuffer = (uint8_t*)mir_alloc(bmp_bottom_mask.bmHeight*bmp_bottom_mask.bmWidthBytes);
GetBitmapBits(iciBottom.hbmMask, bmp_bottom_mask.bmHeight*bmp_bottom_mask.bmWidthBytes, BottomMaskBuffer);
bmb = BottomMaskBuffer + vstep_bm*(bmp_bottom_mask.bmHeight - 1);
vstep_bm = -vstep_bm;
@@ -3596,11 +3596,11 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha)
}
if (bmp_top_mask.bmBits) {
- TopMaskBuffer = (BYTE*)bmp_top_mask.bmBits;
+ TopMaskBuffer = (uint8_t*)bmp_top_mask.bmBits;
tmb = TopMaskBuffer;
}
else {
- TopMaskBuffer = (BYTE*)mir_alloc(bmp_top_mask.bmHeight*bmp_top_mask.bmWidthBytes);
+ TopMaskBuffer = (uint8_t*)mir_alloc(bmp_top_mask.bmHeight*bmp_top_mask.bmWidthBytes);
GetBitmapBits(iciTop.hbmMask, bmp_top_mask.bmHeight*bmp_top_mask.bmWidthBytes, TopMaskBuffer);
tmb = TopMaskBuffer + vstep_tm*(bmp_top_mask.bmHeight - 1);
vstep_tm = -vstep_tm;
@@ -3651,7 +3651,7 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha)
SelectObject(tempDC, oImage);
DeleteDC(tempDC);
- BYTE p[32] = { 0 };
+ uint8_t p[32] = { 0 };
HBITMAP nMask = CreateBitmap(16, 16, 1, 1, (void*)&p);
{
HDC tempDC2 = CreateCompatibleDC(nullptr);
@@ -3703,13 +3703,13 @@ BOOL SkinDBGetContactSetting(MCONTACT hContact, const char *szSection, const cha
return db_get(hContact, szSection, szKey, retdbv);
}
-BYTE SkinDBGetContactSettingByte(MCONTACT hContact, const char *szSection, const char *szKey, BYTE bDefault)
+uint8_t SkinDBGetContactSettingByte(MCONTACT hContact, const char *szSection, const char *szKey, uint8_t bDefault)
{
DBVARIANT dbv = { 0 };
BOOL bSkinned = FALSE;
if (!SkinDBGetContactSetting(hContact, szSection, szKey, &dbv, &bSkinned)) {
if (dbv.type == DBVT_BYTE) {
- BYTE retVal = dbv.bVal;
+ uint8_t retVal = dbv.bVal;
db_free(&dbv);
return retVal;
}
diff --git a/plugins/Clist_modern/src/modern_skinengine.h b/plugins/Clist_modern/src/modern_skinengine.h
index d59f64f680..d9f3cf440e 100644
--- a/plugins/Clist_modern/src/modern_skinengine.h
+++ b/plugins/Clist_modern/src/modern_skinengine.h
@@ -4,7 +4,7 @@
#define ske_H_INC
/* Definitions */
-#define GetAValue(argb)((BYTE)((argb)>>24))
+#define GetAValue(argb)((uint8_t)((argb)>>24))
#define DEFAULTSKINSECTION "ModernSkin"
@@ -32,7 +32,7 @@ struct GLYPHIMAGE
wchar_t *szFileName;
DWORD dwLoadedTimes;
HBITMAP hGlyph;
- BYTE isSemiTransp;
+ uint8_t isSemiTransp;
};
typedef GLYPHIMAGE *LPGLYPHIMAGE;
@@ -44,15 +44,15 @@ struct CURRWNDIMAGEDATA
HDC hScreenDC;
HBITMAP hImageDIB, hImageOld;
HBITMAP hBackDIB, hBackOld;
- BYTE * hImageDIBByte;
- BYTE * hBackDIBByte;
+ uint8_t * hImageDIBByte;
+ uint8_t * hBackDIBByte;
int Width, Height;
};
struct EFFECTSSTACKITEM
{
HDC hdc;
- BYTE EffectID;
+ uint8_t EffectID;
DWORD FirstColor;
DWORD SecondColor;
};
@@ -69,8 +69,8 @@ public:
typedef HRESULT(*ParserCallback_t)(const char *szSection, const char *szKey, const char *szValue, IniParser *This);
- IniParser(wchar_t *szFileName, BYTE flags = FLAG_WITH_SETTINGS);
- IniParser(HINSTANCE hInst, const char *resourceName, const char *resourceType, BYTE flags = FLAG_ONLY_OBJECTS);
+ IniParser(wchar_t *szFileName, uint8_t flags = FLAG_WITH_SETTINGS);
+ IniParser(HINSTANCE hInst, const char *resourceName, const char *resourceType, uint8_t flags = FLAG_ONLY_OBJECTS);
~IniParser();
bool CheckOK() { return _isValid; }
@@ -105,7 +105,7 @@ private:
DWORD _dwSizeOfRes;
char* _pPosition;
- BYTE _Flags;
+ uint8_t _Flags;
};
diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp
index cea33b7f92..bd96db90e3 100644
--- a/plugins/Clist_modern/src/modern_skinselector.cpp
+++ b/plugins/Clist_modern/src/modern_skinselector.cpp
@@ -232,7 +232,7 @@ static int ParseToModernMask(MODERNMASK *mm, char *szText)
if (!mm || !szText) return -1;
unsigned int textLen = (unsigned)mir_strlen(szText);
- BYTE curParam = 0;
+ uint8_t curParam = 0;
unsigned int startPos = 0;
char *pszParam;
@@ -278,7 +278,7 @@ static BOOL CompareModernMask(MODERNMASK *mmValue, MODERNMASK *mmTemplate)
{
//TODO
BOOL res = TRUE;
- BYTE pVal = 0, pTemp = 0;
+ uint8_t pVal = 0, pTemp = 0;
while (pTemp < mmTemplate->dwParamCnt && pVal < mmValue->dwParamCnt) {
// find pTemp parameter in mValue
DWORD vh, ph;
@@ -363,7 +363,7 @@ SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue, LISTMODERNMASK *mm
return res;
}
-wchar_t* GetParamNT(char *string, wchar_t *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
+wchar_t* GetParamNT(char *string, wchar_t *buf, int buflen, uint8_t paramN, char Delim, BOOL SkipSpaces)
{
char *ansibuf = (char*)mir_alloc(buflen / sizeof(wchar_t));
GetParamN(string, ansibuf, buflen / sizeof(wchar_t), paramN, Delim, SkipSpaces);
@@ -372,7 +372,7 @@ wchar_t* GetParamNT(char *string, wchar_t *buf, int buflen, BYTE paramN, char De
return buf;
}
-wchar_t* GetParamN(wchar_t *string, wchar_t *buf, int buflen, BYTE paramN, wchar_t Delim, BOOL SkipSpaces)
+wchar_t* GetParamN(wchar_t *string, wchar_t *buf, int buflen, uint8_t paramN, wchar_t Delim, BOOL SkipSpaces)
{
size_t i = 0, start = 0, CurentCount = 0, len;
while (i < mir_wstrlen(string)) {
@@ -398,7 +398,7 @@ wchar_t* GetParamN(wchar_t *string, wchar_t *buf, int buflen, BYTE paramN, wchar
return buf;
}
-char* GetParamN(char *string, char *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
+char* GetParamN(char *string, char *buf, int buflen, uint8_t paramN, char Delim, BOOL SkipSpaces)
{
size_t i = 0, start = 0, CurentCount = 0, len;
while (i < mir_strlen(string)) {
diff --git a/plugins/Clist_modern/src/modern_skinselector.h b/plugins/Clist_modern/src/modern_skinselector.h
index a7106a63e6..9567f95870 100644
--- a/plugins/Clist_modern/src/modern_skinselector.h
+++ b/plugins/Clist_modern/src/modern_skinselector.h
@@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct MASKPARAM
{
DWORD dwId;
- BYTE bMaskParamFlag;
+ uint8_t bMaskParamFlag;
char* szName;
DWORD dwValueHash;
char* szValue;
@@ -71,6 +71,6 @@ DWORD mod_CalcHash(const char *a);
int RegisterObjectByParce(char *ObjectName, char *Params);
SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue, LISTMODERNMASK *mmTemplateList);
SKINOBJECTDESCRIPTOR* skin_FindObjectByMask(MODERNMASK *mm, LISTMODERNMASK *mmTemplateList);
-wchar_t * GetParamNT(char *string, wchar_t *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces);
+wchar_t * GetParamNT(char *string, wchar_t *buf, int buflen, uint8_t paramN, char Delim, BOOL SkipSpaces);
int SkinDrawGlyphMask(HDC hdc, RECT *rcSize, RECT *rcClip, MODERNMASK *ModernMask);
#endif
diff --git a/plugins/Clist_modern/src/modern_static_clui.h b/plugins/Clist_modern/src/modern_static_clui.h
index c3bae487c0..725f8746bd 100644
--- a/plugins/Clist_modern/src/modern_static_clui.h
+++ b/plugins/Clist_modern/src/modern_static_clui.h
@@ -69,7 +69,7 @@ int EventArea_Create(HWND hCluiWnd);
int ExtraImage_ExtraIDToColumnNum(int extra);
int ModernSkinButtonLoadModule();
-int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r);
+int ModernSkinButton_ReposButtons(HWND parent, uint8_t draw, RECT *r);
void ske_ApplyTranslucency();
HBITMAP ske_CreateDIB32(int cx, int cy);
@@ -88,7 +88,7 @@ int UnhookAll();
int CLUI_IsInMainWindow(HWND hwnd);
int CLUI_SizingOnBorder(POINT pt, int size);
-int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam);
+int CLUI_SmoothAlphaTransition(HWND hwnd, uint8_t GoalAlpha, BOOL wParam);
int CLUI_TestCursorOnBorders();
static int CLUI_SmoothAlphaThreadTransition();
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index fb968fb775..1f28b12e89 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -35,7 +35,7 @@ struct ProtoItemData : public MZeroedObject
int fullWidth;
RECT protoRect;
- BYTE xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
+ uint8_t xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
bool bDoubleIcons;
bool bShowProtoIcon;
bool bShowProtoName;
@@ -72,7 +72,7 @@ int LoadStatusBarData()
g_StatusBarData.rectBorders.right = db_get_dw(0, "CLUI", "RightOffset", SETTING_RIGHTOFFSET_DEFAULT);
g_StatusBarData.rectBorders.top = db_get_dw(0, "CLUI", "TopOffset", SETTING_TOPOFFSET_DEFAULT);
g_StatusBarData.rectBorders.bottom = db_get_dw(0, "CLUI", "BottomOffset", SETTING_BOTTOMOFFSET_DEFAULT);
- g_StatusBarData.extraspace = (BYTE)db_get_dw(0, "CLUI", "SpaceBetween", SETTING_SPACEBETWEEN_DEFAULT);
+ g_StatusBarData.extraspace = (uint8_t)db_get_dw(0, "CLUI", "SpaceBetween", SETTING_SPACEBETWEEN_DEFAULT);
if (g_StatusBarData.BarFont) {
DeleteObject(g_StatusBarData.BarFont);
@@ -188,7 +188,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
mir_snprintf(buf, "SBarShow_%s", szProto);
- BYTE showOps = db_get_b(0, "CLUI", buf, SETTING_SBARSHOW_DEFAULT);
+ uint8_t showOps = db_get_b(0, "CLUI", buf, SETTING_SBARSHOW_DEFAULT);
p = new ProtoItemData;
p->bShowProtoIcon = (showOps & 1) != 0;
p->bShowProtoName = (showOps & 2) != 0;
@@ -653,7 +653,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
if (ID) {
int res = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, ID), 0);
if (res >= 0)
- db_set_b(0, "CLUI", "ShowSBar", (BYTE)(wParam/*(res&F_VISIBLE)*/ ? 1 : 0));
+ db_set_b(0, "CLUI", "ShowSBar", (uint8_t)(wParam/*(res&F_VISIBLE)*/ ? 1 : 0));
}
}
break;
diff --git a/plugins/Clist_modern/src/modern_statusbar.h b/plugins/Clist_modern/src/modern_statusbar.h
index 5687c10c5b..4c164a4b09 100644
--- a/plugins/Clist_modern/src/modern_statusbar.h
+++ b/plugins/Clist_modern/src/modern_statusbar.h
@@ -12,20 +12,20 @@ typedef struct tagSTATUSBARDATA
{
BOOL sameWidth;
RECT rectBorders;
- BYTE extraspace;
- BYTE Align;
- BYTE VAlign;
+ uint8_t extraspace;
+ uint8_t Align;
+ uint8_t VAlign;
bool bShowProtoIcon;
bool bShowProtoName;
bool bShowStatusName;
bool bConnectingIcon;
HFONT BarFont;
DWORD fontColor;
- BYTE TextEffectID;
+ uint8_t TextEffectID;
DWORD TextEffectColor1;
DWORD TextEffectColor2;
- BYTE xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
- BYTE nProtosPerLine;
+ uint8_t xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
+ uint8_t nProtosPerLine;
bool bShowProtoEmails;
HBITMAP hBmpBackground;
@@ -36,7 +36,7 @@ typedef struct tagSTATUSBARDATA
XPTHANDLE hTheme;
BOOL perProtoConfig;
- BYTE SBarRightClk;
+ uint8_t SBarRightClk;
} STATUSBARDATA;
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp
index d096236e6a..3513df1b6d 100644
--- a/plugins/Clist_modern/src/modern_statusbar_options.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp
@@ -29,11 +29,11 @@ typedef struct _StatusBarProtocolOptions
char *szName;
BOOL AccountIsCustomized;
BOOL HideAccount;
- BYTE SBarShow;
- BYTE SBarRightClk;
- BYTE UseConnectingIcon;
- BYTE ShowUnreadEmails;
- BYTE ShowXStatus;
+ uint8_t SBarShow;
+ uint8_t SBarRightClk;
+ uint8_t UseConnectingIcon;
+ uint8_t ShowUnreadEmails;
+ uint8_t ShowXStatus;
int PaddingLeft;
int PaddingRight;
} StatusBarProtocolOptions;
@@ -52,7 +52,7 @@ static void UpdateXStatusIconOptions(HWND hwndDlg, StatusBarProtocolOptions &dat
EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENTOVERLAY), en && IsDlgButtonChecked(hwndDlg, IDC_SHOWXSTATUS) && IsDlgButtonChecked(hwndDlg, IDC_SHOWNORMAL) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWBOTH));
- BYTE val = 0;
+ uint8_t val = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWXSTATUS)) {
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWBOTH)) val = 3;
else if (IsDlgButtonChecked(hwndDlg, IDC_SHOWNORMAL)) val = 2;
@@ -89,7 +89,7 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg)
CheckDlgButton(hwndDlg, IDC_SHOWUNREADEMAIL, (sbpo.ShowUnreadEmails == 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_TRANSPARENTOVERLAY, (sbpo.ShowXStatus & 4) ? BST_CHECKED : BST_UNCHECKED);
{
- BYTE showOpts = sbpo.SBarShow;
+ uint8_t showOpts = sbpo.SBarShow;
CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts & 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts & 2 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts & 4 ? BST_CHECKED : BST_UNCHECKED);
@@ -397,19 +397,19 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
char settingBuf[256];
mir_snprintf(settingBuf, "SBarAccountIsCustom_%s", sbpo->szName);
- db_set_b(0, "CLUI", settingBuf, (BYTE)sbpo->AccountIsCustomized);
+ db_set_b(0, "CLUI", settingBuf, (uint8_t)sbpo->AccountIsCustomized);
mir_snprintf(settingBuf, "HideAccount_%s", sbpo->szName);
- db_set_b(0, "CLUI", settingBuf, (BYTE)sbpo->HideAccount);
+ db_set_b(0, "CLUI", settingBuf, (uint8_t)sbpo->HideAccount);
mir_snprintf(settingBuf, "SBarShow_%s", sbpo->szName);
- db_set_b(0, "CLUI", settingBuf, (BYTE)sbpo->SBarShow);
+ db_set_b(0, "CLUI", settingBuf, (uint8_t)sbpo->SBarShow);
mir_snprintf(settingBuf, "SBarRightClk_%s", sbpo->szName);
- db_set_b(0, "CLUI", settingBuf, (BYTE)sbpo->SBarRightClk);
+ db_set_b(0, "CLUI", settingBuf, (uint8_t)sbpo->SBarRightClk);
mir_snprintf(settingBuf, "UseConnectingIcon_%s", sbpo->szName);
- db_set_b(0, "CLUI", settingBuf, (BYTE)sbpo->UseConnectingIcon);
+ db_set_b(0, "CLUI", settingBuf, (uint8_t)sbpo->UseConnectingIcon);
mir_snprintf(settingBuf, "ShowUnreadEmails_%s", sbpo->szName);
- db_set_b(0, "CLUI", settingBuf, (BYTE)sbpo->ShowUnreadEmails);
+ db_set_b(0, "CLUI", settingBuf, (uint8_t)sbpo->ShowUnreadEmails);
mir_snprintf(settingBuf, "ShowXStatus_%s", sbpo->szName);
db_set_b(0, "CLUI", settingBuf, sbpo->ShowXStatus);
mir_snprintf(settingBuf, "PaddingLeft_%s", sbpo->szName);
@@ -418,25 +418,25 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
db_set_dw(0, "CLUI", settingBuf, sbpo->PaddingRight);
}
- db_set_b(0, "CLUI", "SBarShow", (BYTE)_GlobalOptions.SBarShow);
- db_set_b(0, "CLUI", "SBarRightClk", (BYTE)_GlobalOptions.SBarRightClk);
- db_set_b(0, "CLUI", "UseConnectingIcon", (BYTE)_GlobalOptions.UseConnectingIcon);
- db_set_b(0, "CLUI", "ShowUnreadEmails", (BYTE)_GlobalOptions.ShowUnreadEmails);
+ db_set_b(0, "CLUI", "SBarShow", (uint8_t)_GlobalOptions.SBarShow);
+ db_set_b(0, "CLUI", "SBarRightClk", (uint8_t)_GlobalOptions.SBarRightClk);
+ db_set_b(0, "CLUI", "UseConnectingIcon", (uint8_t)_GlobalOptions.UseConnectingIcon);
+ db_set_b(0, "CLUI", "ShowUnreadEmails", (uint8_t)_GlobalOptions.ShowUnreadEmails);
db_set_b(0, "CLUI", "ShowXStatus", _GlobalOptions.ShowXStatus);
db_set_dw(0, "CLUI", "PaddingLeft", _GlobalOptions.PaddingLeft);
db_set_dw(0, "CLUI", "PaddingRight", _GlobalOptions.PaddingRight);
- db_set_b(0, "CLUI", "StatusBarProtosPerLine", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MULTI_SPIN, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
- db_set_b(0, "CLUI", "Align", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_GETCURSEL, 0, 0));
- db_set_b(0, "CLUI", "VAlign", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_GETCURSEL, 0, 0));
+ db_set_b(0, "CLUI", "StatusBarProtosPerLine", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_MULTI_SPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLUI", "EqualSections", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
+ db_set_b(0, "CLUI", "Align", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_GETCURSEL, 0, 0));
+ db_set_b(0, "CLUI", "VAlign", (uint8_t)SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_GETCURSEL, 0, 0));
db_set_dw(0, "CLUI", "LeftOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN, UDM_GETPOS, 0, 0));
db_set_dw(0, "CLUI", "RightOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN2, UDM_GETPOS, 0, 0));
db_set_dw(0, "CLUI", "TopOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_SBAR_BORDER_TOP_SPIN, UDM_GETPOS, 0, 0));
db_set_dw(0, "CLUI", "BottomOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_SBAR_BORDER_BOTTOM_SPIN, UDM_GETPOS, 0, 0));
db_set_dw(0, "CLUI", "SpaceBetween", (DWORD)SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN3, UDM_GETPOS, 0, 0));
- db_set_b(0, "CLUI", "ShowSBar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ db_set_b(0, "CLUI", "ShowSBar", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
LoadStatusBarData();
cliCluiProtocolStatusChanged(0, nullptr);
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index 62d18be1a6..e4b935d374 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -327,7 +327,7 @@ static int Toolbar_ModulesLoaded(WPARAM, LPARAM)
TopToolbar_SetCustomProc(CustomizeButton, 0);
- BYTE bOldSetting = 0;
+ uint8_t bOldSetting = 0;
if (!db_get_b(0, "Compatibility", "TTB_Upgrade", 0)) {
if (bOldSetting = db_get_b(0, "CLUI", "ShowButtonBar", 1)) {
CopySettings("BUTTWIDTH", "option_Bar0_BtnWidth", 20);
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index a9bcc83f1d..61b12e346a 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -157,7 +157,7 @@ class CViewModeSetupDlg : public CDlgBase
static int __cdecl FillModes(const char *szsetting, void *param)
{
- if (BYTE(szsetting[0]) == 246)
+ if (uint8_t(szsetting[0]) == 246)
return 1;
if (szsetting[0] == 13)
return 1;
@@ -557,7 +557,7 @@ class CViewModeSetupDlg : public CDlgBase
DWORD lmdat = db_get_dw(0, CLVM_MODULE, szSetting, 0);
SetDlgItemInt(m_hwnd, IDC_LASTMSGVALUE, LOWORD(lmdat), FALSE);
- BYTE bTmp = LOBYTE(HIWORD(lmdat));
+ uint8_t bTmp = LOBYTE(HIWORD(lmdat));
SendDlgItemMessage(m_hwnd, IDC_LASTMESSAGEOP, CB_SETCURSEL, bTmp, 0);
bTmp = HIBYTE(HIWORD(lmdat));
SendDlgItemMessage(m_hwnd, IDC_LASTMESSAGEUNIT, CB_SETCURSEL, bTmp, 0);
@@ -847,7 +847,7 @@ static int menuCounter = 0;
static int FillMenuCallback(char *szSetting)
{
- if (BYTE(szSetting[0]) == 246)
+ if (uint8_t(szSetting[0]) == 246)
return 1;
if (szSetting[0] == 13)
return 1;
@@ -1219,18 +1219,18 @@ void ApplyViewMode(const char *szName)
mir_snprintf(szSetting, "%c_LastMode", 246);
db_unset(0, CLVM_MODULE, szSetting);
- if (g_CluiData.bOldUseGroups != (BYTE)-1)
+ if (g_CluiData.bOldUseGroups != (uint8_t)-1)
CallService(MS_CLIST_SETUSEGROUPS, (WPARAM)g_CluiData.bOldUseGroups, 0);
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE);
- if (g_CluiData.boldHideOffline != (BYTE)-1)
+ if (g_CluiData.boldHideOffline != (uint8_t)-1)
g_clistApi.pfnSetHideOffline(g_CluiData.boldHideOffline);
- if (g_CluiData.bOldUseGroups != (BYTE)-1)
+ if (g_CluiData.bOldUseGroups != (uint8_t)-1)
CallService(MS_CLIST_SETUSEGROUPS, (WPARAM)g_CluiData.bOldUseGroups, 0);
- g_CluiData.boldHideOffline = (BYTE)-1;
- g_CluiData.bOldUseGroups = (BYTE)-1;
+ g_CluiData.boldHideOffline = (uint8_t)-1;
+ g_CluiData.bOldUseGroups = (uint8_t)-1;
g_CluiData.current_viewmode[0] = 0;
g_CluiData.old_viewmode[0] = 0;
@@ -1306,12 +1306,12 @@ void ApplyViewMode(const char *szName)
g_CluiData.bFilterEffective |= CLVM_STICKY_CONTACTS;
if (g_CluiData.bFilterEffective & CLVM_FILTER_STATUS) {
- if (g_CluiData.boldHideOffline == (BYTE)-1)
+ if (g_CluiData.boldHideOffline == (uint8_t)-1)
g_CluiData.boldHideOffline = Clist::HideOffline;
g_clistApi.pfnSetHideOffline(false);
}
- else if (g_CluiData.boldHideOffline != (BYTE)-1) {
+ else if (g_CluiData.boldHideOffline != (uint8_t)-1) {
g_clistApi.pfnSetHideOffline(g_CluiData.boldHideOffline);
g_CluiData.boldHideOffline = -1;
}
@@ -1323,12 +1323,12 @@ void ApplyViewMode(const char *szName)
bUseGroups = 0;
if (bUseGroups != -1) {
- if (g_CluiData.bOldUseGroups == (BYTE)-1)
+ if (g_CluiData.bOldUseGroups == (uint8_t)-1)
g_CluiData.bOldUseGroups = Clist::UseGroups;
CallService(MS_CLIST_SETUSEGROUPS, bUseGroups, 0);
}
- else if (g_CluiData.bOldUseGroups != (BYTE)-1) {
+ else if (g_CluiData.bOldUseGroups != (uint8_t)-1) {
CallService(MS_CLIST_SETUSEGROUPS, g_CluiData.bOldUseGroups, 0);
g_CluiData.bOldUseGroups = -1;
}
diff --git a/plugins/Clist_modern/src/stdafx.h b/plugins/Clist_modern/src/stdafx.h
index a9b2e1fb57..db6d97c5e1 100644
--- a/plugins/Clist_modern/src/stdafx.h
+++ b/plugins/Clist_modern/src/stdafx.h
@@ -241,7 +241,7 @@ int AniAva_UnloadModule();
int AniAva_UpdateOptions(); //reload options, //hot enable/disable engine
int AniAva_AddAvatar(MCONTACT hContact, wchar_t * szFilename, int width, int heigth); // adds avatars to be displayed
-int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha); // update avatars pos
+int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, uint8_t bAlpha); // update avatars pos
int AniAva_InvalidateAvatarPositions(MCONTACT hContact); // reset positions of avatars to be drawn (still be painted at same place)
int AniAva_RemoveInvalidatedAvatars(); // all avatars without validated position will be stop painted and probably removed
int AniAva_RemoveAvatar(MCONTACT hContact); // remove avatar