annotate CODING @ 622:54e20abb5c6d

Fix display of collection in overlay info. Due to markup escaped <i>collection</i> was displayed instead of collection's in italic. Overlay info syntax was extended to allow the wrapping of displayed data with markup. General syntax is: %name[:length limit][:extra]% Extra string uses special character '*' to mark the place of the data to display. If no '*' is present, then extra string is just appended to data. Any "\n" is replaced by a newline on display. Pango mark up is accepted in left and right parts. If data is empty, nothing will be displayed. Examples: "%name:<i>*</i>\n%" -> name is displayed in italics ended with a newline "%size:\n%" -> size is displayed with a newline at end "%formatted.ISOSpeedRating:ISO *%" -> prefix iso number with "ISO " (ie. "ISO 100") "Collection <b>*</b>\n" -> display collection name in bold prefixed by "Collection " and a newline is appended Collection name formatting was slighly improved by not displaying the .gqv extension. The default overlay info string was modified to use the new syntax, but older info strings should be displayed as usual.
author zas_
date Sat, 10 May 2008 21:29:53 +0000
parents f31ae0d9e163
children f20e7cebcb12
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
1 Please keep the general coding style of Geeqie:
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
2
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
3 Space after if, while and for:
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
4 ------------------------------
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
5
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
6 while (...)
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
7 for (...)
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
8 if (...)
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
9
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
10 Indentation of {}:
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
11 ------------------
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
12
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
13 while (...)
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
14 {
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
15 ...
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
16 }
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
17
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
18 if (...)
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
19 {
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
20 ...
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
21 }
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
22 else
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
23 {
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
24 ...
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
25 }
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
26
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
27 Spaces around operators:
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
28 ------------------------
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
29
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
30 i = 2;
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
31 x = i * (j / 2);
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
32
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
33
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
34 Space after comma:
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
35 ------------------
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
36 func(a, b, c);
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
37
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
38 Functions without any parameter should be declared using void:
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
39 --------------------------------------------------------------
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
40 gint function(void)
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
41 {
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
42 ...
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
43 }
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
44
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
45 Use glib types:
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
46 ---------------
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
47 Please use glib types when possible (ie. gint and gchar instead of int and char)
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
48 .
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
49
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
50 Use glib functions:
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
51 -------------------
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
52 Use glib functions when possible (ie. g_ascii_isspace() instead of isspace()).
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
53 Check if used functions are not deprecated.
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
54
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
55 Others:
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
56 -------
524
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
57 Check twice the indentation and spurious whitespaces.
7659ccaf2a74 Document the Geeqie coding style.
zas_
parents:
diff changeset
58
611
f31ae0d9e163 Update CODING and HACKING files, and add po/README file for translators.
zas_
parents: 525
diff changeset
59 Try to use explicit variable and function names.