Blame doc/HACKING

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