]>
Commit | Line | Data |
---|---|---|
240d1fc8 GB |
1 | This file is meant to summarize the Viking development policies. |
2 | ||
6c1496fc RN |
3 | #### |
4 | #### Also check information in the Wiki: | |
5 | #### http://sourceforge.net/apps/mediawiki/viking/index.php?title=Main_Page | |
6 | #### | |
240d1fc8 GB |
7 | |
8 | Clean commits | |
9 | ============= | |
10 | ||
11 | Commits/patches should be as fine-grained as possible (and no finer). Every | |
12 | distinct change should be in its own commit and every commit should be a | |
13 | meaningful change on its own. | |
14 | ||
6c1496fc RN |
15 | Preferred Code Contribution Methods |
16 | =================================== | |
17 | ||
18 | Since the project uses git for source control, patches that utilize git (especially for patch sets) are preferred in this order: | |
19 | * Commits pushed to a publically accessible git host (e.g. GitHub, Gitorious, etc...) | |
20 | - This enables commits to be easily managed such as pulling, merging or cherry-picking | |
21 | * Email git diffs to the dev mailing list - use 'git format-patch' method | |
22 | * Plain diffs can be emailed to the dev mailing list and/or stored in the SourceForge Patch Tracker for Viking. | |
23 | ||
240d1fc8 GB |
24 | Coding style |
25 | ============ | |
26 | ||
50a14534 EB |
27 | Naming: |
28 | A "module" is a .c file. | |
29 | ||
30 | Functions starting with "vik_" operate on an object/structure with the module name (see layer.c for an example). | |
31 | Functions starting with "a_" do not, these modules may have static variables. | |
32 | Both are followed by the module name. Unless of course the function is static, in which case it may be called anything. | |
33 | ||
34 | All (well, practically all) global constants and macros start with "VIK_" and then the module name. | |
35 | ||
6c1496fc RN |
36 | Coding Checks |
37 | ============= | |
38 | ||
39 | Code should compile with the minimum number of warnings (ideally none). | |
40 | ||
41 | Code should pass static analysis with defaults for 'cppcheck' (http://sourceforge.net/projects/cppcheck/) with no errors. | |
42 | ||
43 | ATM there is one deliberate error in vikgpslayer.c designed to prevent building if the code encounters a GPSD version we don't handle. Something like: | |
44 | [vikgpslayer.c:1479]: (error) Invalid number of character ({) when these macros are defined: 'GPSD_API_MAJOR_VERSION;VIK_CONFIG_REALTIME_GPS_TRACKING'. | |
45 | This can be 'hidden' via cppcheck --suppress syntax. | |
46 | ||
240d1fc8 GB |
47 | Technical notices |
48 | ================= | |
50a14534 | 49 | |
e5c58469 GB |
50 | In order to activate reference documentation, you have to specify the following configure command line: |
51 | $ ./configure --enable-gtk-doc --enable-gtk-doc-html | |
52 | ||
53 | Then, cd to doc/reference and launch make command. | |
54 | ||
55 | --- | |
56 | ||
50a14534 EB |
57 | The layers panel holds all the layers. Layers connect to the layers panel via what I call "interfaces" which are really just a |
58 | structure of function pointers and pointers to other bits such as icons. viklayer.c switches between the layers like | |
59 | polymorhpism. Anything specific to the layer should (in theory) be found solely in that layer's source file. | |
60 | ||
61 | There are some ugly hacks in here, like the layers panel holding the viewport and each layer holding the viewport and a | |
62 | GtkTreeIter. Unfortunately it was the only way I could figure out to do some things. It would be _much_ easier with a | |
63 | object-oriented language. | |
64 | ||
65 | --- | |
66 | ||
67 | "xmpp" and "ympp" are really misnomers, as they only represent the Meters Per Pixel in UTM mode. Otherwise they are an artificial | |
68 | zooming system. In expedia mode it represents the "Alti", in Google mode it represents 2^(scale), e.g. 2^0 = 1, 2^8 = 256. | |
2a035b62 GB |
69 | |
70 | --- | |
71 | Implementing a MapSource | |
72 | ||
73 | VikMapSource is the "interface", the really base class of the MapSource tree. | |
74 | In order to implement a MapSource, you have to prefer to derive from VikMapSourceDefault, a less abstract class, adding a property based implementation for some aspects of the VikMapSource interface. | |
75 | Then, you have to provide implementation for coord_to_mapcoord, mapcoord_to_center_coord and download methods. |