aboutsummaryrefslogtreecommitdiff
path: root/c/defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/defs.h')
-rw-r--r--c/defs.h71
1 files changed, 43 insertions, 28 deletions
diff --git a/c/defs.h b/c/defs.h
index 8196a93..9f53c92 100644
--- a/c/defs.h
+++ b/c/defs.h
@@ -5,36 +5,51 @@
#include <commctrl.h>
#include <SWI-Prolog.h>
-/* common.c */
+/* common.cpp */
TCHAR *TszFromSz(const char *, int);
-/* main.c */
+/* main.cpp */
void UpdateLayout();
-/* listview.c */
-HWND LvCreate(HMENU, DWORD);
-int LvHeight(HWND, int);
-
-/* episodelistview.c */
-HWND ElvCreate();
-void ElvDoSort(void);
-LRESULT ElvHandleNotify(LPARAM);
-void ElvRedraw(void);
-void ElvSetTop(int);
-void ElvSelectFocus(void);
-void ElvSelectUnwatched(int);
-void ElvShowFocus(void);
-void ElvUpdate(void);
-void ElvUpdateItem(LPLVITEM);
-
-/* datalistview.c */
-HWND DlvCreate();
-void DlvShowEpisode(int);
-
-/* pl.c */
-int Pl(char *, char *, char *, ...);
-int Plp(term_t, char *, ...);
-int Plg(term_t, char *, ...);
+/* listview.cpp */
+class ListView {
+protected:
+ WNDPROC m_prevProc;
+ HWND m_hWnd;
+public:
+ void Create(HMENU, DWORD);
+ int Height(int);
+ HWND HWnd(void);
+ virtual LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
+};
+
+/* episodelistview.cpp */
+class EpisodeListView: public ListView {
+public:
+ void Create(void);
+ void DoSort(void);
+ LRESULT HandleNotify(LPARAM);
+ void Redraw(void);
+ void SetTop(int);
+ void SelectFocus(void);
+ void SelectUnwatched(int);
+ void ShowFocus(void);
+ void Update(void);
+ void UpdateItem(LPLVITEM);
+ LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
+};
+
+/* datalistview.cpp */
+class DataListView: public ListView {
+public:
+ void Create(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 */
#define DLVSIKEY 0
@@ -56,8 +71,8 @@ Cmp(int a, int b)
inline int
Dpi(int i)
{
- extern int IDPI;
- return MulDiv(i, IDPI, 96);
+ extern int g_iDPI;
+ return MulDiv(i, g_iDPI, 96);
}
#endif