aboutsummaryrefslogtreecommitdiff
path: root/c/episodelistview.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-17 17:49:43 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-17 17:49:43 +0200
commitbb22bc506676fd268ded3b3d6c7b7acea5dc2db9 (patch)
treef3df0eca434f86ddc70aab0410a5a4bcd4559b2a /c/episodelistview.cpp
parentcd5ff302d1b03edb6fe81254c585e0e88c8e71ee (diff)
downloadEpisodeBrowser-bb22bc506676fd268ded3b3d6c7b7acea5dc2db9.tar.gz
Update type names and variable prefixes.
Diffstat (limited to 'c/episodelistview.cpp')
-rw-r--r--c/episodelistview.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp
index e1119b4..706c51a 100644
--- a/c/episodelistview.cpp
+++ b/c/episodelistview.cpp
@@ -10,7 +10,7 @@
#include "listview.h"
#include "pl.h"
-extern DataListView* const g_lpDlv;
+extern DataListView* const g_pDlv;
int CALLBACK ElvSort(LPARAM, LPARAM, LPARAM);
EpisodeListView::EpisodeListView(const HWND hWndParent)
@@ -52,21 +52,21 @@ void EpisodeListView::EnsureFocusVisible()
LRESULT EpisodeListView::HandleNotify(const LPARAM lParam)
{
- const LPNMLISTVIEW lpNmLv = (LPNMLISTVIEW)lParam;
+ const NMLISTVIEW* const pNmLv = (NMLISTVIEW*)lParam;
- switch (lpNmLv->hdr.code) {
+ switch (pNmLv->hdr.code) {
case LVN_ITEMCHANGED: /* Select/focus episode. */
- if ((lpNmLv->uChanged & LVIF_STATE) &&
- (lpNmLv->uNewState & LVIS_FOCUSED)) {
- m_lviFocus.iItem = lpNmLv->iItem;
- m_lviFocus.lParam = lpNmLv->lParam;
+ if ((pNmLv->uChanged & LVIF_STATE) &&
+ (pNmLv->uNewState & LVIS_FOCUSED)) {
+ m_lviFocus.iItem = pNmLv->iItem;
+ m_lviFocus.lParam = pNmLv->lParam;
UpdateItem(&m_lviFocus);
- g_lpDlv->ShowEpisode(lpNmLv->lParam);
+ g_pDlv->ShowEpisode(pNmLv->lParam);
}
break;
case LVN_COLUMNCLICK: /* Sort by column. */
{
- const int iColumn = lpNmLv->iSubItem+1;
+ const int iColumn = pNmLv->iSubItem+1;
m_iSort = abs(m_iSort) == iColumn? -m_iSort: iColumn;
Pl("cfg","set_sort",m_iSort);
DoSort();
@@ -75,8 +75,8 @@ LRESULT EpisodeListView::HandleNotify(const LPARAM lParam)
}
case LVN_KEYDOWN: /* Navigate episodes by keyboard. */
{
- const LPNMLVKEYDOWN lpNmLvKd = (LPNMLVKEYDOWN)lParam;
- switch (lpNmLvKd->wVKey) {
+ const NMLVKEYDOWN *const pNmLvKd = (NMLVKEYDOWN*)lParam;
+ switch (pNmLvKd->wVKey) {
case VK_LEFT:
SelectUnwatched(-1);
break;
@@ -88,16 +88,16 @@ LRESULT EpisodeListView::HandleNotify(const LPARAM lParam)
}
case NM_CUSTOMDRAW: /* Make unwatched episodes bold. */
{
- const LPNMLVCUSTOMDRAW lpLvCd = (LPNMLVCUSTOMDRAW)lParam;
- switch (lpLvCd->nmcd.dwDrawStage) {
+ const NMLVCUSTOMDRAW* const pLvCd = (NMLVCUSTOMDRAW*)lParam;
+ switch (pLvCd->nmcd.dwDrawStage) {
case CDDS_PREPAINT:
return CDRF_NOTIFYITEMDRAW;
break;
case CDDS_ITEMPREPAINT:
{
extern HFONT g_fBold;
- if (!Pl("track_episodes","watched",lpLvCd->nmcd.lItemlParam)) {
- SelectObject(lpLvCd->nmcd.hdc, g_fBold);
+ if (!Pl("track_episodes","watched",pLvCd->nmcd.lItemlParam)) {
+ SelectObject(pLvCd->nmcd.hdc, g_fBold);
return CDRF_NEWFONT;
}
break;
@@ -195,7 +195,7 @@ s: ListView_SetItemState(m_hWnd, -1, LVIF_STATE, LVIS_SELECTED);
m_lviFocus.iItem = iItem;
m_lviFocus.lParam = iEpisode;
UpdateItem(&m_lviFocus);
- g_lpDlv->ShowEpisode(iEpisode);
+ g_pDlv->ShowEpisode(iEpisode);
}
/* Select next/previous unwatched episode. */
@@ -353,26 +353,26 @@ void EpisodeListView::Update()
}
/* Update episode name and rating. */
-void EpisodeListView::UpdateItem(const LPLVITEM lpLvi)
+void EpisodeListView::UpdateItem(const LVITEM* const pLvi)
{
TCHAR* tszName;
int iRating;
static TCHAR tszRating[3];
- if (!Pl("episode_data","episode_title",lpLvi->lParam,&tszName)) {
+ if (!Pl("episode_data","episode_title",pLvi->lParam,&tszName)) {
if (!Pl("episode_data","update_episode_data")) goto r;
- if (!Pl("episode_data","episode_title",lpLvi->lParam,&tszName))
+ if (!Pl("episode_data","episode_title",pLvi->lParam,&tszName))
goto r;
}
- ListView_SetItemText(m_hWnd, lpLvi->iItem, ELVSITITLE, tszName);
+ ListView_SetItemText(m_hWnd, pLvi->iItem, ELVSITITLE, tszName);
-r: if (!Pl("episode_data","episode_rating",lpLvi->lParam,&iRating)) {
- ListView_SetItemText(m_hWnd, lpLvi->iItem, ELVSIRATING, TEXT(""));
+r: if (!Pl("episode_data","episode_rating",pLvi->lParam,&iRating)) {
+ ListView_SetItemText(m_hWnd, pLvi->iItem, ELVSIRATING, TEXT(""));
return;
}
_stprintf_s(tszRating, sizeof(tszRating), TEXT("%d"), iRating);
- ListView_SetItemText(m_hWnd, lpLvi->iItem, ELVSIRATING, tszRating);
+ ListView_SetItemText(m_hWnd, pLvi->iItem, ELVSIRATING, tszRating);
}
LRESULT CALLBACK EpisodeListView::WndProc(const HWND hWnd, const UINT uMsg,
@@ -399,26 +399,26 @@ LRESULT CALLBACK EpisodeListView::WndProc(const HWND hWnd, const UINT uMsg,
int CALLBACK ElvSort(const LPARAM iItem1, const LPARAM iItem2, const LPARAM lExtra)
{
- EpisodeListView* const lpElv = (EpisodeListView*)lExtra;
+ EpisodeListView* const pElv = (EpisodeListView*)lExtra;
LVITEM lvi1, lvi2;
lvi1.mask = lvi2.mask = LVIF_PARAM;
lvi1.iItem = iItem1; lvi2.iItem = iItem2;
- if (!ListView_GetItem(lpElv->Handle(), &lvi1)) return 0;
- if (!ListView_GetItem(lpElv->Handle(), &lvi2)) return 0;
+ if (!ListView_GetItem(pElv->Handle(), &lvi1)) return 0;
+ if (!ListView_GetItem(pElv->Handle(), &lvi2)) return 0;
/* abs(m_iSort) is the 1-based index of the column to sort by.
* If m_iSort is negative, the order is descending. */
- const int iOrder = Cmp(lpElv->m_iSort, 0);
+ const int iOrder = Cmp(pElv->m_iSort, 0);
- switch (abs(lpElv->m_iSort)-1) {
+ switch (abs(pElv->m_iSort)-1) {
case ELVSIEPISODE:
return iOrder*Cmp(lvi1.lParam, lvi2.lParam);
case ELVSIRATING:
{
int iRating1, iRating2;
- iRating1 = lpElv->m_iSort > 0? 99: -1;
- iRating2 = lpElv->m_iSort > 0? 99: -1;
+ iRating1 = pElv->m_iSort > 0? 99: -1;
+ iRating2 = pElv->m_iSort > 0? 99: -1;
Pl("episode_data","episode_rating",lvi1.lParam,&iRating1);
Pl("episode_data","episode_rating",lvi2.lParam,&iRating2);
if (iRating1 == iRating2)