Blame HACKING

Packit 324a5c
Hacking Cairo
Packit 324a5c
=============
Packit 324a5c
Packit 324a5c
This is a high-level guide to how the cairo distribution is organized
Packit 324a5c
and how to get started hacking on it.  Make sure you read through the
Packit 324a5c
file README before continuing.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Coding Style
Packit 324a5c
------------
Packit 324a5c
Packit 324a5c
The easiest way to write code in the cairo style is to follow code close
Packit 324a5c
to the place you are hacking, but if you want a written down set of
Packit 324a5c
rules, see file CODING_STYLE.
Packit 324a5c
Packit 324a5c
Files for backends that depend on languages other than C (C++ or
Packit 324a5c
Objective C for example) may use features specific to those languages.
Packit 324a5c
For example, "//" comments are allowed, though discouraged, in those files.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Contact
Packit 324a5c
-------
Packit 324a5c
Packit 324a5c
Various ways to get in touch with other cairo developers and maintainers
Packit 324a5c
have been enumerated at:
Packit 324a5c
Packit 324a5c
	http://cairographics.org/contact/
Packit 324a5c
Packit 324a5c
Most of that information is also reflected in the following sections.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Mailing Lists
Packit 324a5c
-------------
Packit 324a5c
Packit 324a5c
There are various mailing lists that are useful when developing cairo
Packit 324a5c
code.  A complete list is always available at:
Packit 324a5c
Packit 324a5c
	http://cairographics.org/lists/
Packit 324a5c
Packit 324a5c
It is recommended that cairo developers subscribe to all those lists.
Packit 324a5c
The cairo list by itself generates much more traffic than the others
Packit 324a5c
combined, so developers and contributors should not be intimidated by
Packit 324a5c
the -commit and -bugs lists.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Bug Tracking System
Packit 324a5c
-------------------
Packit 324a5c
Packit 324a5c
We use a standard bugzilla bug tracking system available at:
Packit 324a5c
Packit 324a5c
	http://bugs.freedesktop.org/
Packit 324a5c
Packit 324a5c
See file named BUGS for detailed information on reporting bugs.  In short,
Packit 324a5c
for straight bug reports, it's best to report them there such that they
Packit 324a5c
are not lost or forgotten.  For discussion of new features or
Packit 324a5c
complicated issues, use the mailing list.
Packit 324a5c
Packit 324a5c
Packit 324a5c
IRC
Packit 324a5c
---
Packit 324a5c
Packit 324a5c
It's a great idea to hang around the cairo IRC channel if you have any
Packit 324a5c
interest in cairo.  We use the #cairo channel on irc.freenode.net.
Packit 324a5c
Packit 324a5c
Make sure you introduce yourself if your nick is not easy to match to
Packit 324a5c
the name you use on the mailing list.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Version Control System
Packit 324a5c
----------------------
Packit 324a5c
Packit 324a5c
We use /git/ for version control.  See:
Packit 324a5c
Packit 324a5c
	http://cairographics.org/download/
Packit 324a5c
Packit 324a5c
For more information on using git, see:
Packit 324a5c
Packit 324a5c
	http://freedesktop.org/wiki/Infrastructure/git/
Packit 324a5c
Packit 324a5c
Packit 324a5c
Build System
Packit 324a5c
------------
Packit 324a5c
Packit 324a5c
We use the autotools build system with cairo, but with various
Packit 324a5c
customizations and advanced features.  Reading configure.in is your
Packit 324a5c
best bet to understanding it, or just ask on IRC.
Packit 324a5c
Packit 324a5c
To bootstrap the build system run ./autogen.sh.  After that the
Packit 324a5c
regular "./configure; make; make install" sequence can be used.
Packit 324a5c
See file named INSTALL for more details.
Packit 324a5c
Packit 324a5c
There is limited support for a win32 build system.
Packit 324a5c
See README.win32 and Makefile.win32 files in various directories.
Packit 324a5c
Packit 324a5c
Packit 324a5c
ChangeLog
Packit 324a5c
---------
Packit 324a5c
Packit 324a5c
We generate ChangeLog files automatically from the git commit log.
Packit 324a5c
No manual ChangeLog writing is necessary.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Copyrights and Licensing
Packit 324a5c
------------------------
Packit 324a5c
Packit 324a5c
The cairo library is dual-licensed under LGPL and MPL.  See the file
Packit 324a5c
named COPYING for details.  The test suites are more liberal, and are
Packit 324a5c
allowed to include GPL code.
Packit 324a5c
Packit 324a5c
When writing new code, update the file headers to add your (or your
Packit 324a5c
employers) copyright line and contributor line.  If adding new files
Packit 324a5c
or splitting a file, copy the file header from other files.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Source Code
Packit 324a5c
-----------
Packit 324a5c
Packit 324a5c
The library source code and headers live in the src/ directory.
Packit 324a5c
See src/README for more information.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Regression Test Suite
Packit 324a5c
---------------------
Packit 324a5c
Packit 324a5c
Cairo has a fairly extensive regression-testing suite.  Indeed, without
Packit 324a5c
these tests it would be impossible to make a cairo release without
Packit 324a5c
introducing tens of regressions.  We still manage to introduce
Packit 324a5c
regressions with each release even with the hundreds of tests we already
Packit 324a5c
have.
Packit 324a5c
Packit 324a5c
The regression test suite is located under the test/ directory.
Packit 324a5c
See test/README for more information.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Performance Test Suite
Packit 324a5c
----------------------
Packit 324a5c
Packit 324a5c
There is a performance test suite located under the perf/ directory.
Packit 324a5c
A collection of traces of real-world behavior are also available in the
Packit 324a5c
cairo-traces repository, which can be used in isolation or hooked in
Packit 324a5c
with the main performance test suite.  See perf/README for more
Packit 324a5c
information.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Boilerplate
Packit 324a5c
-----------
Packit 324a5c
Packit 324a5c
The cairo-boilerplate is a small private library used by the regression
Packit 324a5c
and performance test suites.  It includes the boilerplace code needed
Packit 324a5c
to initialize various backends for the test suites, as well as allow
Packit 324a5c
tweaking some of the internal workings of the backends for more testing.
Packit 324a5c
Packit 324a5c
The boilerplate code is localted under the boilerplate/ directory.
Packit 324a5c
See boilerplate/README for more information.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Documentation
Packit 324a5c
-------------
Packit 324a5c
Packit 324a5c
Cairo uses the gtk-doc system for reference API documentation.
Packit 324a5c
Packit 324a5c
The reference documentation is located under doc/public.
Packit 324a5c
See doc/public/README for more information.
Packit 324a5c
Packit 324a5c
For more documentation including frequently asked questions, tutorials,
Packit 324a5c
samples, roadmap, todo list, etc visit:
Packit 324a5c
Packit 324a5c
	http://cairographics.org/documentation/
Packit 324a5c
Packit 324a5c
Some of those should gradually be moved to doc/.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Utilities
Packit 324a5c
---------
Packit 324a5c
Packit 324a5c
We have developed several utilities useful for writing cairo or code
Packit 324a5c
that uses cairo.  These tools can be found under the util/ directory.
Packit 324a5c
See util/README for more information.
Packit 324a5c
Packit 324a5c
Packit 324a5c
Releasing
Packit 324a5c
---------
Packit 324a5c
Packit 324a5c
Now you are a cairo maintainer, so what?  See file named RELEASING.
Packit 324a5c