~oem-solutions-group/unity-2d/clutter-1.0

« back to all changes in this revision

Viewing changes to doc/HACKING

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2010-03-21 13:27:56 UTC
  • mto: (2.1.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20100321132756-nf8yd30yxo3zzwcm
Tags: upstream-1.2.2
ImportĀ upstreamĀ versionĀ 1.2.2

Show diffs side-by-side

added added

removed removed

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