#ifndef DEFS_H #define DEFS_H #include #include #include #include /* common.cpp */ TCHAR *TszFromSz(const char *, int); 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 */ 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 */ struct EpisodeListView : public ListView { EpisodeListView(void); void DoSort(void); void EnsureFocusVisible(void); LRESULT HandleNotify(LPARAM); int ISort(void) const; void Redraw(void); void SaveFocus(void); void SetTop(int); void RestoreFocus(void); void SelectUnwatched(int); void ShowFocus(void); 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 */ struct DataListView : public ListView { DataListView(void); void ShowEpisode(int); }; /* pl.cpp */ int Pl(const char *, const char *, const char *, ...); int Plp(term_t, const char *, ...); int Plg(term_t, const char *, ...); /* defs.h */ #ifdef UNICODE #define WA "W" #else #define WA "A" #endif #define DLVSIKEY 0 #define DLVSIVALUE 1 #define ELVSIEPISODE 0 #define ELVSITITLE 1 #define ELVSIRATING 2 inline int Cmp(int a, int b) { if (a == b) return 0; if (a > b) return 1; return -1; } inline int Dpi(int i) { extern int g_iDPI; return MulDiv(i, g_iDPI, 96); } #endif