forked from GNOME/rhythmbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HACKING
62 lines (48 loc) · 2.07 KB
/
HACKING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
First of all, Rhythmbox tries to have a consistent code style. You will
need to follow this. Here's a summary:
- Code must compile with -Wall -Werror
- use 8-space tabs for indentation
- curly brackets are NOT on a new line, except for function definitions.
(we are slowly converting the code)
- if statements are written like this: "if (this != that)"
- Major functions should have prototypes
- There should be a space between a function call and the parameters
- 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.
Where it makes sense, it's often easier to add new features as plugins, rather
than integrating them into the core. Plugins can be written in C or Python.
When writing a Python plugin, you might encounter gaps or bugs in the Python
bindings, but these are generally fixed quickly.
You can find some information on plugin development here:
https://wiki.gnome.org/Apps/Rhythmbox/Plugins/WritingGuide
Rhythmbox is developed in GNOME git. You can get a copy of the repository
by running 'git clone git://git.gnome.org/rhythmbox'. Any patches you
send should be in 'git format-patch' or 'git diff' format against current
git master. You can also browse the source code and revision history using
a web browser here: http://git.gnome.org/browse/rhythmbox.
Bugs and feature requests are tracked in GNOME Bugzilla
(http://bugzilla.gnome.org/) under the 'rhythmbox' product. Patches should be
attached to bugs rather than sent to the mailing list, as patches sent to the
mailing list are easily overlooked and forgotten.
Finally, here is some sample code written in the correct style:
Important comment blocks are written like this:
/**
* bla_bla_cb: This is an example comment block
*/
Here is a correctly indented code sample:
void
foo (const char *bla, gpointer cow)
{
if (!strcmp (bla, cow)) {
g_print ("moo!");
return;
} else {
do_something (cow);
do_something_else (bla, cow);
}
if (foo)
return;
...
}