Update Norwegian translation.
[dana/openbox.git] / HACKING
1 dirs:
2         openbox - core of the WM
3         render - librender, rendering routines for the WM and for apps
4         parser - libparser, for parsing config files
5
6 Beware the Client.transient_for. It can be set to a !NULL value of TRAN_GROUP,
7 which is not a valid pointer. You must ALWAYS check for TRAN_GROUP before
8 following transient_for. However if it is transient for the group, this
9 excludes other windows whom are transient for the group, and windows which
10 are children of the window (infinite loops would result)!
11
12 When using coordinates/sizes of windows, make sure you use the right area. The
13 Client.area rect is the reference point and size of the *CLIENT* window. This
14 value is not what you see in any shape or form, and gravity is applied to it to
15 translate it into what you see. The Client.frame.area is the actual position
16 and size of the entire frame. This is usually the value you want to use, unless
17 you are in client.c (probably) and adjusting/using the position or size from
18 the client's perspective.
19
20 Indentation
21 -----------
22 For openbox, we aim to have consistent coding style. Some, but surely
23 not all, guidelines:
24  * use 4 space indents
25  * tabs should not appear in source files
26  * closing braces always go on a new line
27  * for functions, the opening brace goes on a new line
28      void foo()
29      {
30          hi;
31      }
32  * for control blocks, the opening brace goes on the same line as the
33    condition, unless the condition spans more than one line. then the brace
34    goes on a new line.
35      if (one line) {
36          hi;
37      }
38      if (first line &&
39          second line)
40      {
41          hi;
42      }
43  * always use braces around conditional blocks that consist of more than one
44    line, even if they contain a single statement
45      if (check) {
46          /* Check was true. */
47          yay = true(ok,
48                     thanks);
49      }
50  * don't need to use braces for conditional blocks that use only a single
51    line, including comments.
52      if (check)
53          all_on_one_line_so_no_braces_needed();
54  * when in doubt look at the rest of the source
55  * vim users can use "set expandtab tabstop=4 shiftwidth=4
56    softtabstop=4" for some of this