doc: Invoke doxygen via the defined make variable.

Invoke doxygen via the autoconf-defined make variable instead of directly.
This brings it in line with standard makefile practices.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
doc: removed redundant dependency

The .tmp file dependency depends on the index.xml file so it does not need to
be repeated.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
doc: Remove duplicated descriptions of wayland objects

This text is a duplicate of the text in the protocol documentation, but
the converter mangled it by removing the paragraph breaks and some other
errors. Instead replace it with a list of links to the protocol docs.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
doc: Add config check for doxygen 1.6.0+.

Add a config time check for a new enough (1.6.0+) version of doxygen.

v2. require 1.6.0+ instead of 1.8.0+

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
client: update obsolete comments

1) there is nothing like main thread since
   3c7e8bfbb4745315b7bcbf69fa746c3d6718c305 anymore, so remove
   it from documentation and update the doc accordingly.

2) use calling 'default queue' instead of 'main queue'. In the code
   we use display->default_queue, so it'll be easier the understand.

3) update some obsolete or unprecise pieces of documentation

v2. Not only remove out-of-date comment, but fix/remove more
    things across the wayland-client.[ch]

v3. fixes (rephrasing unclear paragraphs etc.)
    according to Pakka Paalanen notes (thanks)

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
client: update documentation about threading

Remove out-dated documentation and add few more words
about this topic.

v2. replace a paragraph by better explanation from Pekka Paalanen
    fix other notes from reviewing

v3. fix typo

v4. fix flags for poll in an example

    add wl_display_cancel_read() to another example
    (so that user sees that it should be used)

    move proper use of wl_display_prepare_read
    before the explanation why it is wrong to use
    wl_display_displach

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
test-runner: move leak checking into function

1) now we can use it in the test-compositor
2) it looks better

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
test-compositor: extend leak checks into clients

Run leak checking also on clients of test-compositor.

Checking leaks in memory is the same as in normal TEST.
The problem here is with fds. Because we pass WAYLAND_SOCKET
fd to the client, which is over taken by wl_display and
closed in wl_display_disonnect(). The result is that
the client closed one more fd than it opened. That would
not be a problem if every client used wl_display_connect().
But this is not the case. E. g. sanity-tests usually do not
call wl_display_connect().

Solution is simple: when client does not call wl_display_connect(),
it states it by invoking TEST_CLIENT_NOT_USING_WL_DISPLAY_CONNECT macro.
Because mostly (we can use word 'only' at the moment) sanity-test
clients do not use wl_display_connect(),
this does not introduce any changes to regular testing clients
(and thus for the guys that write those clients)

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
tests: add tests for leak check in clients

Sanity tests for leak checks in clients of test compositor
and also check if the test-compositor itself is not leaking
anything.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
tests: use atomic operation in leak checker

In some tests we use threads, so we need to be sure that
the allocation counters are reace-free

This works only for gcc >= 4.1.2 since in this version
were introduced the atomic operations.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
connection-test: add tests for closure leaks

When we destroy closure, we are leaking memory sometimes.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
client: release display queue in wl_display_disconnect()

Don't leak events, not even on exit

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
client: unref or destroy proxy when releasing queue

When we release event queue with queued events, we can leak
proxies in some cases.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>