X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=HACKING;h=73864bde8d2d01c3079f872dfbf28bdefb9f2719;hb=efc7efcd42db3a0c84dcfaf1d7abbe852ca16dac;hp=3433ad67f608c15451ae84d9ffbc41b79df94931;hpb=bb649ac996a8dddb315b3283d547a35c26a24afc;p=chaz%2Fopenbox diff --git a/HACKING b/HACKING index 3433ad67..73864bde 100644 --- a/HACKING +++ b/HACKING @@ -1,19 +1,13 @@ -Woop, a HACKING document for openbox at last! - dirs: - kernel - core of the WM + openbox - core of the WM render - librender, rendering routines for the WM and for apps parser - libparser, for parsing config files Beware the Client.transient_for. It can be set to a !NULL value of TRAN_GROUP, which is not a valid pointer. You must ALWAYS check for TRAN_GROUP before -following transient_for. When TRAN_GROUP is found, Client.group will always -be !NULL. Some smart action should be taken using all members of the group in -this case. - Smart action idea: - Skip over members of the group that are also transients of the group - (have Client.transient_for set to TRAN_GROUP). These windows are not - ancestors and using them will also end up causing infinite loops! +following transient_for. However if it is transient for the group, this +excludes other windows whom are transient for the group, and windows which +are children of the window (infinite loops would result)! When using coordinates/sizes of windows, make sure you use the right area. The Client.area rect is the reference point and size of the *CLIENT* window. This @@ -29,12 +23,34 @@ For openbox, we aim to have consistent coding style. Some, but surely not all, guidelines: * use 4 space indents * tabs should not appear in source files - * functions should have the opening and closing braces on their own - lines - * most other constructs should have braces on the same line as the - statement + * closing braces always go on a new line + * for functions, the opening brace goes on a new line + void foo() + { + hi; + } + * for control blocks, the opening brace goes on the same line as the + condition, unless the condition spans more than one line. then the brace + goes on a new line. + if (one line) { + hi; + } + if (first line && + second line) + { + hi; + } + * always use braces around conditional blocks that consist of more than one + line, even if they contain a single statement + if (check) { + /* Check was true. */ + yay = true(ok, + thanks); + } + * don't need to use braces for conditional blocks that use only a single + line, including comments. + if (check) + all_on_one_line_so_no_braces_needed(); * when in doubt look at the rest of the source * vim users can use "set expandtab tabstop=4 shiftwidth=4 softtabstop=4" for some of this - -