1 [Error Logging](#error-logging)
2 [GPL header](#gpl-header)
3 [Git change log](#git-change-log)
5 [Documentation](#documentation)
10 # <a name='error-logging'>
14 Use `DEBUG_0()` only for temporary debugging i.e. not in code in the repository.
15 The user will then not see irrelevant debug output when the default
16 `debug level = 0` is used.
19 If the first word of the message is "error" or "warning" (case insensitive) the message will be color-coded appropriately.
21 - Note that these messages are output in the idle loop.
23 `print_term(gboolean err, const gchar *text_utf8)`
25 - If `err` is TRUE output is to STDERR, otherwise to STDOUT
29 For use with the [GTKInspector](https://wiki.gnome.org/action/show/Projects/GTK/Inspector?action=show&redirect=Projects%2FGTK%2B%2FInspector) to provide a visual indication of where objects are declared.
31 Sample command line call:
32 `GTK_DEBUG=interactive src/geeqie`
34 --------------------------------------------------------------------------------
36 # <a name='gpl-header'>
39 Include a header in every file, like this:
42 * @brief Short description of this file.
46 * Optionally detailed description of this file
51 * This file is a part of Geeqie project (http://www.geeqie.org/).
52 * Copyright (C) 2008 - 2021 The Geeqie Team
54 * This program is free software; you can redistribute it and/or modify it
55 * under the terms of the GNU General Public License as published by the Free
56 * Software Foundation; either version 2 of the License, or (at your option)
59 * This program is distributed in the hope that it will be useful, but WITHOUT
60 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
61 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
67 # <a name='git-change-log'>
70 If referencing a Geeqie GitHub issue, include the issue number in the summary line. Start with a short summary in the first line (without a dot at the end) followed by a empty line.
72 If referencing a Geeqie GitHub issue, include a hyperlink to the GitHub issue webpage in the message body. Use whole sentences beginning with Capital letter. For each modification use a new line. Or you can write the theme, colon and then every change on new line, begin with "- ".
74 See also [A Note About Git Commit Messages](http://www.tpope.net/node/106)
80 `There was the bug that something was wrong. I fixed it.`
83 `- the interface was modified`
84 `- new functions were added`
86 Also please use your full name and a working e-mail address as author for any contribution.
88 --------------------------------------------------------------------------------
93 Indentation: tabs at 4 spaces
98 - of variables & functions: small\_letters
99 - of defines: CAPITAL\_LETTERS
101 Try to use explicit variable and function names.
102 Try not to use macros.
103 Use EITHER "struct foo" OR "foo"; never both
121 if (<cond_very_very_very_very_very_very_very_very_very_long> &&
122 <cond2very_very_very_very_very_very_very_very_very_long>)
135 for (i = 0; i <= 10; i++)
144 gint bar(<var_def>, <var_def>, <var_def>)
150 return 0; // i.e. SUCCESS; if error, you must return minus <err_no>
160 Pragma: (Indentation 2 spaces)
164 # define _(String) (String)
165 #endif /* ENABLE_NLS */
172 Use spaces around every operator (except ".", "->", "++" and "--").
173 Unary operator '*' and '&' are missing the space from right, (and also unary '-').
175 As you can see above, parentheses are closed to inside, i.e. " (blah blah) "
176 In "`function(<var>)`" there is no space before the '('.
177 You MAY use more tabs/spaces than you OUGHT TO (according to this CodingStyle), if it makes your code nicer in being vertically indented.
178 Variables declarations should be followed by a blank line and should always be at the start of the block.
181 Use glib types when possible (ie. gint and gchar instead of int and char).
182 Use glib functions when possible (ie. `g_ascii_isspace()` instead of `isspace()`).
183 Check if used functions are not deprecated.
185 --------------------------------------------------------------------------------
187 # <a name='documentation'>
190 Use American, rather than British English, spelling. This will facilitate consistent
191 text searches. User text may be translated via the en_GB.po file.
193 To document the code use the following rules to allow extraction with doxygen.
194 Do not save with comments. Not all comments have to be doxygen comments.
196 - Use C comments in plain C files and use C++ comments in C++ files for one line
198 - Use '/**' (note the two asterisks) to start comments to be extracted by
199 doxygen and start every following line with " *".
200 - Use '@' to indicate doxygen keywords/commands (see below).
201 - Use the '@deprecated' command to tell if the function is subject to be deleted
202 or to a complete rewrite.
206 To document functions or big structures:
209 * @brief This is a short description of the function.
211 * This function does ...
213 * @param x1 This is the first parameter named x1
214 * @param y1 This is the second parameter named y1
215 * @return What the function returns
216 * You can extend that return description (or anything else) by indenting the
217 * following lines until the next empty line or the next keyword/command.
218 * @see Cross reference
221 To document members of a structure that have to be documented (use it at least
222 for big structures) use the `/**<` format:
223 `int counter; /**< This counter counts images */`
225 Document TODO or FIXME comments as:
235 For further documentation about doxygen see the [Doxygen Manual](https://www.doxygen.nl/index.html).
236 For the possible commands you may use, see [Doxygen Special Commands](https://www.doxygen.nl/manual/commands.html).
238 The file `./scripts/doxygen-help.sh` may be used to integrate access to the Doxygen files into a code editor.
240 The following environment variables may be set to personalize the Doxygen output:
241 `DOCDIR=<output folder>`
242 `SRCDIR=<the folder above ./src>`
246 `INLINE_SOURCES=<YES|NO>`
247 `STRIP_CODE_COMMENTS=<YES|NO>`
249 Ref: [INLINE\_SOURCES](https://www.doxygen.nl/manual/config.html#cfg_inline_sources)
250 Ref: [STRIP\_CODE\_COMMENTS](https://www.doxygen.nl/manual/config.html#cfg_strip_code_comments)
252 To include diagrams (if any) in the Doxygen output, the following are required to be installed. The installation process will vary between distributions:
253 [The PlantUML jar](https://plantuml.com/download)
254 `sudo apt install default-jre`
255 `sudo apt install texlive-font-utils`
259 But in case just think about that the documentation is for other developers not
260 for the end user. So keep the focus.