HACKING 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. Hacking Cairo
  2. =============
  3. This is a high-level guide to how the cairo distribution is organized
  4. and how to get started hacking on it. Make sure you read through the
  5. file README before continuing.
  6. Coding Style
  7. ------------
  8. The easiest way to write code in the cairo style is to follow code close
  9. to the place you are hacking, but if you want a written down set of
  10. rules, see file CODING_STYLE.
  11. Files for backends that depend on languages other than C (C++ or
  12. Objective C for example) may use features specific to those languages.
  13. For example, "//" comments are allowed, though discouraged, in those files.
  14. Contact
  15. -------
  16. Various ways to get in touch with other cairo developers and maintainers
  17. have been enumerated at:
  18. http://cairographics.org/contact/
  19. Most of that information is also reflected in the following sections.
  20. Mailing Lists
  21. -------------
  22. There are various mailing lists that are useful when developing cairo
  23. code. A complete list is always available at:
  24. http://cairographics.org/lists/
  25. It is recommended that cairo developers subscribe to all those lists.
  26. The cairo list by itself generates much more traffic than the others
  27. combined, so developers and contributors should not be intimidated by
  28. the -commit and -bugs lists.
  29. Bug Tracking System
  30. -------------------
  31. We use a standard bugzilla bug tracking system available at:
  32. http://bugs.freedesktop.org/
  33. See file named BUGS for detailed information on reporting bugs. In short,
  34. for straight bug reports, it's best to report them there such that they
  35. are not lost or forgotten. For discussion of new features or
  36. complicated issues, use the mailing list.
  37. IRC
  38. ---
  39. It's a great idea to hang around the cairo IRC channel if you have any
  40. interest in cairo. We use the #cairo channel on irc.freenode.net.
  41. Make sure you introduce yourself if your nick is not easy to match to
  42. the name you use on the mailing list.
  43. Version Control System
  44. ----------------------
  45. We use /git/ for version control. See:
  46. http://cairographics.org/download/
  47. For more information on using git, see:
  48. http://freedesktop.org/wiki/Infrastructure/git/
  49. Build System
  50. ------------
  51. We use the autotools build system with cairo, but with various
  52. customizations and advanced features. Reading configure.in is your
  53. best bet to understanding it, or just ask on IRC.
  54. To bootstrap the build system run ./autogen.sh. After that the
  55. regular "./configure; make; make install" sequence can be used.
  56. See file named INSTALL for more details.
  57. There is limited support for a win32 build system.
  58. See README.win32 and Makefile.win32 files in various directories.
  59. ChangeLog
  60. ---------
  61. We generate ChangeLog files automatically from the git commit log.
  62. No manual ChangeLog writing is necessary.
  63. Copyrights and Licensing
  64. ------------------------
  65. The cairo library is dual-licensed under LGPL and MPL. See the file
  66. named COPYING for details. The test suites are more liberal, and are
  67. allowed to include GPL code.
  68. When writing new code, update the file headers to add your (or your
  69. employers) copyright line and contributor line. If adding new files
  70. or splitting a file, copy the file header from other files.
  71. Source Code
  72. -----------
  73. The library source code and headers live in the src/ directory.
  74. See src/README for more information.
  75. Regression Test Suite
  76. ---------------------
  77. Cairo has a fairly extensive regression-testing suite. Indeed, without
  78. these tests it would be impossible to make a cairo release without
  79. introducing tens of regressions. We still manage to introduce
  80. regressions with each release even with the hundreds of tests we already
  81. have.
  82. The regression test suite is located under the test/ directory.
  83. See test/README for more information.
  84. Performance Test Suite
  85. ----------------------
  86. There is a performance test suite located under the perf/ directory.
  87. A collection of traces of real-world behavior are also available in the
  88. cairo-traces repository, which can be used in isolation or hooked in
  89. with the main performance test suite. See perf/README for more
  90. information.
  91. Boilerplate
  92. -----------
  93. The cairo-boilerplate is a small private library used by the regression
  94. and performance test suites. It includes the boilerplace code needed
  95. to initialize various backends for the test suites, as well as allow
  96. tweaking some of the internal workings of the backends for more testing.
  97. The boilerplate code is localted under the boilerplate/ directory.
  98. See boilerplate/README for more information.
  99. Documentation
  100. -------------
  101. Cairo uses the gtk-doc system for reference API documentation.
  102. The reference documentation is located under doc/public.
  103. See doc/public/README for more information.
  104. For more documentation including frequently asked questions, tutorials,
  105. samples, roadmap, todo list, etc visit:
  106. http://cairographics.org/documentation/
  107. Some of those should gradually be moved to doc/.
  108. Utilities
  109. ---------
  110. We have developed several utilities useful for writing cairo or code
  111. that uses cairo. These tools can be found under the util/ directory.
  112. See util/README for more information.
  113. Releasing
  114. ---------
  115. Now you are a cairo maintainer, so what? See file named RELEASING.