2007-07-30 12:28:53 -04:00
|
|
|
GENERAL
|
|
|
|
=======
|
|
|
|
|
2007-07-25 18:09:53 -04:00
|
|
|
General notes and rules on clutter core hacking;
|
|
|
|
|
2008-12-18 12:56:11 -05:00
|
|
|
- Follow the CODING_STYLE document.
|
2007-07-25 18:09:53 -04:00
|
|
|
|
2009-04-23 06:38:58 -04:00
|
|
|
- *Really* follow the CODING_STYLE document.
|
2009-03-12 05:27:39 -04:00
|
|
|
|
2008-01-30 08:05:10 -05:00
|
|
|
- All non static public API funcs should be documented in the source files
|
|
|
|
via gtk-doc. Structures, enumerations and macros should be documented in
|
|
|
|
the header files.
|
|
|
|
|
|
|
|
- All non-trivial static and private API should be documented, especially
|
|
|
|
the eventual lifetime handling of the arguments/return values or locking
|
|
|
|
of mutexes.
|
2007-07-30 12:28:53 -04:00
|
|
|
|
2008-04-03 03:21:15 -04:00
|
|
|
- Properties should always be in floating point (never fixed point).
|
2009-03-12 05:27:39 -04:00
|
|
|
The preferred precision is double for angles, and single precision
|
|
|
|
for size and position -- especially if they have to be passed down
|
|
|
|
to COGL.
|
2008-04-17 07:10:32 -04:00
|
|
|
|
2009-06-16 11:41:29 -04:00
|
|
|
- Properties should use pixels whenever is possible. Dimensional and
|
|
|
|
positional properties can also use ClutterParamSpecUnits to define
|
|
|
|
the units-based logical values with a unit type.
|
2007-07-25 18:09:53 -04:00
|
|
|
|
2008-04-03 03:21:15 -04:00
|
|
|
- Public entry points must always check their arguments with
|
|
|
|
g_return_if_fail() or g_return_val_if_fail().
|
|
|
|
|
2009-06-16 11:41:29 -04:00
|
|
|
- Private entry points should use g_assert() or g_warn_if_fail() to
|
|
|
|
verify internal state; do not use g_return_if_fail() or
|
|
|
|
g_return_val_if_fail() as they might be compiled out.
|
2008-04-03 03:21:15 -04:00
|
|
|
|
2009-03-12 05:27:39 -04:00
|
|
|
- If you need to share some state variable across source files use
|
|
|
|
ClutterContext and a private accessor.
|
|
|
|
|
|
|
|
- Private, non-static functions must begin with an underscore and
|
|
|
|
be declared inside clutter-private.h.
|
2007-07-25 18:09:53 -04:00
|
|
|
|
2009-03-12 05:27:39 -04:00
|
|
|
- Don't add direct GL calls but add API to COGL (both GL and GL|ES
|
|
|
|
versions if possible).
|
2007-07-25 18:09:53 -04:00
|
|
|
|
2009-03-12 05:27:39 -04:00
|
|
|
- Use the CLUTTER_NOTE() macro for debug statements in Clutter, and
|
|
|
|
the COGL_NOTE() macro for debug statements in COGL. If necessary,
|
|
|
|
add a value inside ClutterDebugFlags or CoglDebugFlags to specify
|
|
|
|
the debug section.
|
2007-07-30 12:28:53 -04:00
|
|
|
|
2008-12-18 12:56:11 -05:00
|
|
|
- New features should also include an exhaustive test unit under
|
2009-03-12 05:27:39 -04:00
|
|
|
tests/conform and, eventually, a user-interactive test under
|
2008-12-18 12:56:11 -05:00
|
|
|
tests/interactive.
|
2007-07-30 12:28:53 -04:00
|
|
|
|
2009-03-11 10:01:55 -04:00
|
|
|
- When committing, use the standard git commit message format:
|
|
|
|
|
2009-04-23 06:38:58 -04:00
|
|
|
=== begin example commit ===
|
|
|
|
Short explanation of the commit
|
|
|
|
|
|
|
|
Longer explanation explaining exactly what's changed, whether any
|
|
|
|
external or private interfaces changed, what bugs were fixed (with bug
|
|
|
|
tracker reference if applicable) and so forth. Be concise but not too
|
2010-01-15 12:32:46 -05:00
|
|
|
brief. Don't be afraid of using UTF-8, or even ASCII art.
|
2009-04-23 06:38:58 -04:00
|
|
|
=== end example commit ===
|
|
|
|
|
|
|
|
Always add a brief description of the commit to the _first_ line of
|
|
|
|
the commit and terminate by two newlines (it will work without the
|
|
|
|
second newline, but that is not nice for the interfaces).
|
|
|
|
|
|
|
|
short description - MUST be less than 72 characters
|
2009-03-11 10:01:55 -04:00
|
|
|
<newline> - MANDATORY empty line
|
2009-04-23 06:38:58 -04:00
|
|
|
long description - Each line MUST be less than 76 characters
|
|
|
|
|
|
|
|
Do NOT put the commit message on the short description line. One line
|
|
|
|
commit messages should be avoided, unless they can be *fully* explained
|
|
|
|
in less than 72 characters (e.g. "Fix typo in
|
|
|
|
clutter_actor_create_pango_context() docs").
|
|
|
|
|
|
|
|
The brief description might optionally have a "tag", enclosed in
|
|
|
|
square brackets, detailing what part of the repository the commit
|
|
|
|
affected, e.g.:
|
|
|
|
|
|
|
|
[alpha] Add :mode property
|
|
|
|
[text] Emit ::cursor-event only on changes
|
|
|
|
|
|
|
|
The tag counts as part of overall character count, so try using
|
2009-06-16 11:41:29 -04:00
|
|
|
a short word. Optionally, you can also use the "tag:" form.
|
2009-04-23 06:38:58 -04:00
|
|
|
|
|
|
|
Think of the commit message as an email sent to the maintainers explaining
|
|
|
|
"what" you did and, more importantly, "why" you did it. The "how" is not
|
|
|
|
important, since "git show" will show the patch inlined with the commit
|
|
|
|
message.
|