1 CenterIM 5 Hacking Documentation
14 - The clang-format tool should be used to format the code ('clang-format
15 --style=file -i FILE').
16 - Indentation is done by two spaces.
17 - Line length is limited to 80 characters.
18 - C++-style comments should be used and they must form full sentences:
20 - Names of classes use CamelNotation, methods use camelNotation(), variables use
21 common_c_naming. THIS_IS_A_CONST. An exception are libpurple/glib callbacks,
22 which use usual C naming-style (purple_print()).
23 - Example of a class definition:
24 class MyClass : public OtherClass {
26 // Enums and typedefs first,
31 virtual size_t getLinesCount() const { return lines_count; }
36 - Methods in each implementation file should be ordered as in the associated
38 - Methods that can be bound to a key should be prefixed with 'action', for
39 example, actionActivate().
40 - Methods connected to signals should use the 'on' prefix, for example,
42 - Singletons have all variables private, other classes should have all
49 The '--enable-debug' configure option can be used to disable optimizations and
50 to produce a binary that contains debugging information.
52 The '--enable-strict' configure options enables extra compiler warnings. This
53 option should be always used during the development.
59 % export GLIBCXX_FORCE_NEW=1
60 % export G_DEBUG=gc-friendly
61 % export G_SLICE=always-malloc
62 % valgrind --leak-check=full --child-silent-after-fork=yes \
63 --log-file=cim5.log --track-fds=yes centerim5
65 The final command should be run on an actual binary, not on a libtool's binary
68 GLIBCXX_FORCE_NEW forces libstdc++ allocator to use new() and delete() calls
69 instead of using memory pools
70 (http://gcc.gnu.org/onlinedocs/libstdc++/manual/ext_allocators.html).
72 Setting the G_SLICE and G_DEBUG environment variables to the values mentioned
73 above turns off memory optimizations in Glib, which prevents some confusion for
74 Valgrind (https://live.gnome.org/Valgrind).