1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
E P I S O D E B R O W S E R
d o c u m e n t a t i o n
Introduction
~~~~~~~~~~~~
Episode Browser is a simple graphical program that offers an interface
to episodes of TV series stored on the local hard drive. It offers
ways of keeping track of watched and unwatched episodes, as well as
fetching episode information from the internet.
In its current form, it is designed specifically for Detective Conan.
Implementation
~~~~~~~~~~~~~~
Episode Browser is implemented in C++ using the Win32 API (see the c
folder). The source code is spread across a number of files:
>> Frontend <<
main.cpp
Entry point and initialization. Contains the main event handler.
listview.cpp,h
Defines the shared aspects of the two list views.
episodelistview.cpp,h
Defines the interface to the episode list view.
datalistview.cpp,h
Defines the interface to the data list view.
resource.rc
Defines menu and dialog window resources.
resource.h
Defines identifiers and macros for resources.
>> Backend <<
ext.cpp,h
Interacts with the external world (to open an episode).
data.cpp,h
Defines the underlying data representation, as well as
functions to retrieve data from Detective Conan World.
>> Miscellanea <<
win32.cpp,h
Helpers for interacting with the Win32 API.
util.h
Utility functions.
test.cpp,h
Simple test framework (work in progress).
debug.cpp,h
Helpers for debugging.
Building
~~~~~~~~
To build Episode Browser, the following programs are required:
- GCC or Visual Studio (2019)
- GNU make
- CMake
Furthermore, the following dependencies are required:
- libxml2 (included with MSYS GCC, downloaded separately for MSVC)
You may need to manually provide library and header file directories
in c/CMakeLists.txt.
Episode Browse may be built by issuing `make' from the root directory.
The build process is controlled by a few environment variables:
- SYSTEM = vs2019 (default) or mingw
- VS_CONFIG = Debug (default) or Release
- VS_TOOLSET = v142 (default), v141_xp (for Windows XP support)
- VS_PLATFORM = x64 (default) or Win32 (32-bit x86)
Hacking
~~~~~~~
The Episode Browser source code uses a limited form of Hungarian
notation. In summary, Hungarian notation is used only for
- traditional Win32 names such as uMsg, lParam, hWnd,
- variables of Windows-specific types, like hfNormal (HFONT),
- arrays, such as vTipCtx (read as: context tip vector),
- booleans, such as bActive, bViewWatched,
- counts, such as cb (byte count), cch (character count), and
- type disambiguation.
For an example of the last point, imagine you have an integer named
`rating', which you want to convert to a string. What should the
string be called? The simple answer is `sRating'.
In addition, global variables are prefixed with g_ and non-public
member variables are prefixed with m_.
A special note on the meaning of cb and cch: these prefixes are used
to designate size. For strings, this means the total size, including
space for the terminating NUL character. To designate string length
without NUL, `len' is used.
While specific Hungarian prefixes are unnecessary for most variables,
"natural" word order should be avoided. In other words, lenString is
preferred over stringLen, because it mirrors vString.
Hungarian notation should not be used for type names.
|