From 095954fe8c0d1a64d8696d0ad0cd0ed395dd6c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 15 Jul 2022 00:50:32 +0200 Subject: Change declaration style. --- c/defs.h | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) (limited to 'c/defs.h') diff --git a/c/defs.h b/c/defs.h index c83dd8c..06b1ef1 100644 --- a/c/defs.h +++ b/c/defs.h @@ -8,40 +8,36 @@ /* common.cpp */ TCHAR *TszFromSz(const char *, int); -class Library { -private: - HMODULE m_hModule; -public: - static std::unique_ptr Load(const TCHAR *); +struct Library +{ Library(const TCHAR *); ~Library(); FARPROC GetProcAddress(const char *); + static std::unique_ptr Load(const TCHAR *); +private: + HMODULE m_hModule; }; /* main.cpp */ void UpdateLayout(); /* listview.cpp */ -class ListView { -protected: - int m_bHeader = 1; - WNDPROC m_prevProc; - HWND m_hWnd; -public: +struct ListView +{ ListView(HMENU, DWORD); int Height(int = -1); HWND HWnd(void) const; virtual void UpdateTheme(BOOL); virtual LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +protected: + int m_bHeader = 1; + WNDPROC m_prevProc; + HWND m_hWnd; }; /* episodelistview.cpp */ -class EpisodeListView : public ListView { -private: - int m_iSort; - LVITEM m_lviFocus; - friend int CALLBACK ElvSort(LPARAM, LPARAM, LPARAM); -public: +struct EpisodeListView : public ListView +{ EpisodeListView(void); void DoSort(void); void EnsureFocusVisible(void); @@ -56,11 +52,15 @@ public: void Update(void); void UpdateItem(LPLVITEM); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM) override; +private: + int m_iSort; + LVITEM m_lviFocus; + friend int CALLBACK ElvSort(LPARAM, LPARAM, LPARAM); }; /* datalistview.cpp */ -class DataListView : public ListView { -public: +struct DataListView : public ListView +{ DataListView(void); void ShowEpisode(int); }; @@ -83,8 +83,7 @@ int Plg(term_t, const char *, ...); #define ELVSITITLE 1 #define ELVSIRATING 2 -inline int -Cmp(int a, int b) +inline int Cmp(int a, int b) { if (a == b) return 0; @@ -93,8 +92,7 @@ Cmp(int a, int b) return -1; } -inline int -Dpi(int i) +inline int Dpi(int i) { extern int g_iDPI; return MulDiv(i, g_iDPI, 96); -- cgit v1.2.3