summaryrefslogtreecommitdiff
path: root/Build/source/libs/graphite/doc/hungarian.txt
blob: 946c9a4bc9775237465a1f1d7c631ead869df424 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
GRAPHITE HUNGARIAN NOTATION

General rules for variable names:

* Syntax is:
    scope indicator (if any)
    combining prefix (zero or more)
    type/class indicator (required)
    usage labels (optional)

* The only places underscores are used are after the scoping prefixes. Uppercase is used to separate the prefixes from the main label, if any; eg: strName, m_psegNew.

* If you are creating a new class, make up a short indicator for it and use it consistently. Class indicators should be 3-6 characters long.

* An appropriate way to indicate method arguments where necessary is with an "Arg" usage label, eg: nValueArg. Generally method arguments have no special indication.

* Usage labels can be made up arbitrarily, but the ones listed below should be used if they apply.


*** Scope indicators:

m_	member variable
s_	static (global) variable


*** Combining prefixes:

i	index
c	counter
p	pointer
pp	double pointer
rg	range (array, especially stack-allocated)
prg	pointer to the start of an array (often used for method arguments)
v	vector
d	delta or difference
k	constant (combines with an enumeration identifier: eg, klb, kest, kgmet, etc)


*** Basic type indicators:

f	boolean (flag)
n	integer (simple numerical value--not a counter, index, glyph id, char, measurement, etc.)
b	byte
l	long integer (whatever that means)
ch	character (width irrelevant)
chs	short character (8-bit)
chw	wide character (16-bit)
chl	long (32-bit) character
str	string (char-width irrelevant)
sta	ANSI string (8-bit)
stu	Unicode string (16-bit)
fxd	fixed-field integer
v	void (yes, this duplicates vector)

Graphite specific integer types:

gid	glyph id
m	em-units
xs	logical units, x-coordinates (source)
ys	logical units, y-coordinates (source)
xys	logical units, x- or y-coordinates (source)
xd	display units, x-coordinates
yd	display units, y-coordinates
xyd	display units, x- or y-coordinates


*** Common Graphite-specific class prefixes (not a complete list)

seg	Segment
font	Font
txsrc	TextSource
fface	FontFace
pass	GrPass
greng	GrEngine
tman	GrTableManager
sstrm	GrSlotStream
slot	GrSlotState
slout	GrSlotOutput
chstrm	GrCharStream
gbb	glyph bounding box


*** Enumeration prefixes (see the GrConstants.h and GrData.h files for a more complete list)

lb	line break (breakweight)
twsh	trailing whitespace handling
est	end-segment type (why the segment was terminated)
dm	draw mode (for insertion points)
dirc	directionality code
slat	slot attribute name
clr	color
op	operator in Graphite's stack machine


*** Usage labels (somewhat optional, depending on context)

Min	first in a sequence or array (used with Lim); minimum (used with Max)
Lim	1 + last in a sequence or array
Max	maximum
First	first in a sequence (used with Last)
Last	last in a sequence
Prev	previous
Next	next
Ret	return value
In	input
Out	output
New	newly created object
Arg	method argument

-----------------

EXAMPLES

pf		pointer to boolean
cch		character count
ipassPrev	index of previous pass
pppass		pointer to a pointer to a pass
iislot		index to an index to a GrSlotState
vich		vector of character indices
prgchw		pointer to the start of a wide-char buffer
dislot		delta to apply to an index of a GrSlotState
m_ipass		index of pass (member variable)
ppassNew	pointer to a newly created pass
clrBack		background color
m_igbbFirst	index to the first glyph bounding box (member variable)
islotLim	1 + index of the last slot