aboutsummaryrefslogtreecommitdiff
path: root/README
blob: 62e0a71167db45afe86c253c3e31ff326e4d7cb1 (plain)
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

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.
layout.cpp,h
	Handles the placement of child windows.
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 <<

win.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
~~~~~~~~
Episode Browser is built with GNU Make. For the build process, the
following additional programs are required:

 - GCC/G++
 - Perl

To build b/EpisodeBrowser.exe, issue `make' in the root directory of
the project.

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.