HACKING 1.54 KB
Newer Older
1
2
First of all, Rhythmbox tries to have a consistent code style.  You will
need to follow this.  Here's a summary:
Jorn Baayen's avatar
Jorn Baayen committed
3

4
- Code must compile with -Wall -Werror
Jorn Baayen's avatar
Jorn Baayen committed
5
- use 8-space tabs for indentation
6
7
- curly brackets are NOT on a new line, except for function definitions.
  (we are slowly converting the code)
8
- if statements are written like this: "if (this != that)"
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
- Major functions should have prototypes
- callback functions should have a suffix _cb

Rhythmbox is also highly object-oriented using GObject.  Any major
additions should generally go into their own class, and not be bolted onto
an existing one.

Any patches you send should be in unified diff format (-u option to patch).

Most importantly, Rhythmbox is developed using the Arch revision control
system.  If you want to make any major changes, it is highly recommended
that you create your own branch of the source tree, and work from there.
When you are done, you can send a message to rhythmbox-devel@gnome.org,
or post a bugzilla bug with a merge request.
For more information about this, see:
http://web.rhythmbox.org/development.html

Finally, here is some sample code written in the correct style:
27

28
29
30
31
32
33
34
  Important comment blocks are written like this:
  
/**
 * bla_bla_cb: This is an example comment block
 */

  Here is a correctly indented code sample:
35
36
37
38
39
40
41

void
foo (const char *bla, gpointer cow)
{
	if (!strcmp (bla, cow)) {
		g_print ("moo!");
		return;
42
43
44
	} else {
		do_something (cow);	
		do_something_else (bla, cow);
45
	}
46
47
48

	if (foo)
	    return;
49
50
51
52

	...
}	

53
arch-tag: How to hack Rhythmbox and submit patches