Mercurial > hg > forks > geeqie
annotate CODING @ 2916:ae6cdcd69d9f default tip
Merge with upstream/master.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 14 May 2019 11:46:50 +0300 |
parents | 2e7fd08bfbe4 |
children |
rev | line source |
---|---|
2604
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
1 Log Window: |
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
2 |
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
3 DEBUG_0() |
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
4 Use DEBUG_0() only for temporary debugging i.e. not in code in the repository. |
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
5 The user will then not see irrelevant debug output when the default |
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
6 debug level = 0 is used. |
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
7 |
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
8 log_printf() |
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
9 If the first word of the message is "error" or "warning" (case insensitive) |
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
10 the message will be color-coded appropriately. |
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
11 |
2909
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2661
diff
changeset
|
12 |
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2661
diff
changeset
|
13 GTKInspector: |
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2661
diff
changeset
|
14 |
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2661
diff
changeset
|
15 DEBUG_NAME(widget) |
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2661
diff
changeset
|
16 For use with the GTKInspector to provide a visual indication of where objects are declared. |
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2661
diff
changeset
|
17 |
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2661
diff
changeset
|
18 Sample command line call: |
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2661
diff
changeset
|
19 GTK_DEBUG=interactive src/geeqie |
2e7fd08bfbe4
DEBUG_NAME() function for use with GTKInspector
Colin Clark <colin.clark@cclark.uk>
parents:
2661
diff
changeset
|
20 |
2604
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
21 -------------------------------------------------------------------------------- |
425b69f7ff5f
Revise DEBUG_0() usage
Colin Clark <colin.clark@cclark.uk>
parents:
2350
diff
changeset
|
22 |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
23 GPL header, in every file, like this: |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
24 |
1645 | 25 /** \file |
26 * \short Short description of this file. | |
27 * \author Author1 | |
28 * \author Author2 | |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
29 * |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
30 * Optionaly detailed description of this file |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
31 * on more lines. |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
32 */ |
1645 | 33 |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
34 /* |
2262
540934ac0b5a
Changing reference to sourceforge
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2021
diff
changeset
|
35 * This file is a part of Geeqie project (http://www.geeqie.org/). |
2350
95507e596256
Update copyright in all files
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2262
diff
changeset
|
36 * Copyright (C) 2008 - 2016 The Geeqie Team |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
37 * |
1645 | 38 * This program is free software; you can redistribute it and/or modify it |
39 * under the terms of the GNU General Public License as published by the Free | |
40 * Software Foundation; either version 2 of the License, or (at your option) | |
41 * any later version. | |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
42 * |
1645 | 43 * This program is distributed in the hope that it will be useful, but WITHOUT |
44 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
45 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
46 * more details. | |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
47 */ |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
48 |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
49 -------------------------------------------------------------------------------- |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
50 |
2658
b3f34f91ac4d
Update web help file and other docs
Colin Clark <colin.clark@cclark.uk>
parents:
2604
diff
changeset
|
51 git change-log: |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
52 |
2658
b3f34f91ac4d
Update web help file and other docs
Colin Clark <colin.clark@cclark.uk>
parents:
2604
diff
changeset
|
53 If referencing a Geeqie GitHub issue, include the issue number in the summary line. |
1645 | 54 Start with a short summary in the first line (without a dot at the end) followed |
2658
b3f34f91ac4d
Update web help file and other docs
Colin Clark <colin.clark@cclark.uk>
parents:
2604
diff
changeset
|
55 by a empty line. |
b3f34f91ac4d
Update web help file and other docs
Colin Clark <colin.clark@cclark.uk>
parents:
2604
diff
changeset
|
56 |
b3f34f91ac4d
Update web help file and other docs
Colin Clark <colin.clark@cclark.uk>
parents:
2604
diff
changeset
|
57 If referencing a Geeqie GitHub issue, include a hyperlink to the GitHub issue page |
b3f34f91ac4d
Update web help file and other docs
Colin Clark <colin.clark@cclark.uk>
parents:
2604
diff
changeset
|
58 in the message body. |
b3f34f91ac4d
Update web help file and other docs
Colin Clark <colin.clark@cclark.uk>
parents:
2604
diff
changeset
|
59 Use whole sentences begins with Capital letter. For each |
1645 | 60 modification use new line. Or you can write the theme, colon and then every |
61 change on new line, begin with "- ". | |
62 | |
63 See also: http://www.tpope.net/node/106 | |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
64 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
65 Example: |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
66 |
1645 | 67 I did some bugfixes |
68 | |
69 There was the bug that something was wrong. I fixed it. | |
70 | |
71 Library: | |
72 - the interface was modified | |
73 - new functions were added | |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
74 |
2661
b50d57543696
Include note about original author
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2658
diff
changeset
|
75 Also please use your full name and a working e-mail address as author for any contribution. |
b50d57543696
Include note about original author
Klaus Ethgen <Klaus@Ethgen.de>
parents:
2658
diff
changeset
|
76 |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
77 -------------------------------------------------------------------------------- |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
78 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
79 sources: |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
80 |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
81 Indentation: tabs |
1645 | 82 Names of variables & functions: small_letters |
83 of defines: CAPITAL_LETTERS | |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
84 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
85 Try to use explicit variable and function names. |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
86 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
87 Try not to use macros. |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
88 Use EITHER "struct foo" OR "foo"; never both |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
89 |
1645 | 90 |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
91 Conditions, cycles: |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
92 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
93 if (<cond>) |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
94 { |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
95 <command>; |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
96 ... |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
97 <command>; |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
98 } |
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
99 else |
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
100 { |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
101 <command>; |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
102 ... |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
103 <command>; |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
104 } |
1645 | 105 |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
106 if (<cond_very_very_very_very_very_very_very_very_very_long> && |
1645 | 107 <cond2very_very_very_very_very_very_very_very_very_long>) |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
108 <the_only_command>; |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
109 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
110 switch (<var>) |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
111 { |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
112 case 0: |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
113 <command>; |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
114 <command>; |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
115 break; |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
116 case 1: |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
117 <command>; break; |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
118 } |
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
119 |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
120 for (i = 0; i <= 10; i++) |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
121 { |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
122 <command>; |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
123 ... |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
124 <command>; |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
125 } |
1645 | 126 |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
127 |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
128 Functions: |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
129 |
809
12c0d659cb48
Minor fixes and add a note about variable declaration.
Laurent Monin <geeqie@norz.org>
parents:
685
diff
changeset
|
130 gint bar(<var_def>, <var_def>, <var_def>) |
611
fca3e09afe1f
Update CODING and HACKING files, and add po/README file for translators.
Laurent Monin <geeqie@norz.org>
parents:
525
diff
changeset
|
131 { |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
132 <command>; |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
133 ... |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
134 <command>; |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
135 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
136 return 0; // i.e. SUCCESS; if error, you must return minus <err_no> |
611
fca3e09afe1f
Update CODING and HACKING files, and add po/README file for translators.
Laurent Monin <geeqie@norz.org>
parents:
525
diff
changeset
|
137 } |
fca3e09afe1f
Update CODING and HACKING files, and add po/README file for translators.
Laurent Monin <geeqie@norz.org>
parents:
525
diff
changeset
|
138 |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
139 void bar2(void) |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
140 { |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
141 <command>; |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
142 ... |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
143 <command>; |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
144 } |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
145 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
146 Pragma: (Indentation 2 spaces) |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
147 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
148 #ifdef ENABLE_NLS |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
149 # undef _ |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
150 # define _(String) (String) |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
151 #endif /* ENABLE_NLS */ |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
152 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
153 Headers: |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
154 |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
155 #ifndef _FILENAME_H |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
156 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
157 -------------------------------------------------------------------------------- |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
158 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
159 Use spaces around every operator (except ".", "->", "++" and "--"); |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
160 unary operator '*' and '&' are missing the space from right; |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
161 (and also unary '-'). |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
162 As you can see above, parentheses are closed to inside, i.e. " (blah blah) " |
1645 | 163 In "function(<var>)" there are no space before '('. |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
164 You MAY use more tabs/spaces than you OUGHT TO (according to this CodingStyle), if |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
165 it makes your code nicer in being verticaly indented. |
809
12c0d659cb48
Minor fixes and add a note about variable declaration.
Laurent Monin <geeqie@norz.org>
parents:
685
diff
changeset
|
166 Variables declarations should be followed by a blank line and should always be |
12c0d659cb48
Minor fixes and add a note about variable declaration.
Laurent Monin <geeqie@norz.org>
parents:
685
diff
changeset
|
167 at the start of the block. |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
168 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
169 -------------------------------------------------------------------------------- |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
170 |
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
171 Use glib types when possible (ie. gint and gchar instead of int and char). |
611
fca3e09afe1f
Update CODING and HACKING files, and add po/README file for translators.
Laurent Monin <geeqie@norz.org>
parents:
525
diff
changeset
|
172 Use glib functions when possible (ie. g_ascii_isspace() instead of isspace()). |
fca3e09afe1f
Update CODING and HACKING files, and add po/README file for translators.
Laurent Monin <geeqie@norz.org>
parents:
525
diff
changeset
|
173 Check if used functions are not deprecated. |
fca3e09afe1f
Update CODING and HACKING files, and add po/README file for translators.
Laurent Monin <geeqie@norz.org>
parents:
525
diff
changeset
|
174 |
685
c8c9942130ba
Updated CODING (GPL header, macros, svn change-log, ...).
Petr Ostadal <postadal@suse.cz>
parents:
611
diff
changeset
|
175 -------------------------------------------------------------------------------- |
524
ca430c3e3abe
Document the Geeqie coding style.
Laurent Monin <geeqie@norz.org>
parents:
diff
changeset
|
176 |
1645 | 177 Documentation: |
178 | |
179 To document the code use the following rules to allow extraction with doxygen. | |
180 Do not save with comments. Not all comments have to be doxygen comments. | |
181 | |
182 - Use C comments in plain C files and use C++ comments in C++ files for one line | |
183 comments. | |
184 - Use '/**' (note the two asterisks) to start comments to be extracted by | |
185 doxygen and start every following line with " *". | |
186 - Use '\' to indicate doxygen keywords/commands (see below). | |
187 - Use the '\deprecated' command to tell if the function is subject to be deleted | |
188 or to a complete rewrite. | |
189 | |
190 Example: | |
191 | |
192 To document functions or big structures: | |
193 /** | |
194 * \brief This is a short description of the function. | |
195 * | |
196 * This function does ... | |
197 * | |
198 * \param x1 This is the first parameter named x1 | |
199 * \param y1 This is the second parameter named y1 | |
200 * \return What the function returns | |
201 * You can extend that return description (or anything else) by indenting the | |
202 * following lines until the next empty line or the next keyword/command. | |
203 * \see Cross reference | |
204 */ | |
205 | |
206 To document members of a structure that have to be documented (use it at least | |
207 for big structures) use the '/**<' format: | |
208 int counter; /**< This counter counts images */ | |
209 | |
210 For further documentation about doxygen see | |
211 http://www.stack.nl/~dimitri/doxygen/manual.html. For the possible commands you | |
212 can use see http://www.stack.nl/~dimitri/doxygen/commands.html. | |
213 | |
214 But in case just think about that the documentation is for other developers not | |
215 for the end user. So keep the focus. |