Remove warnings for zero-sized structs
This change removes a bunch of warnings from the crate.
The only remaining warnings are due to the bitflags macro usage.
This will help fixservo/core-text-rs#62 when it upgrades to `core-graphics = 0.9`.
@jdm
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/90)
<!-- Reviewable:end -->
Adds an additional display function + bumps core-foundation dependency version
This is a small pull request, basically it adds the following things:
1. Adds a missing `CGDisplayCreateImage()` function, so that now the user has all required functions to capture static images (it was already implemented for window capturing and now the display capturing is also possible).
2. Adds a couple functions to `CGRect`.
3. Updates the version for `core-foundation` from `0.3` to `0.4`. I'm not sure if using `0.3` makes sense if we can use `0.4`. For me personally it was required to change it as my project depends on several crates, including the latest `core-foundation` version, so when I have both `core-graphics` and `core-foundation` in my dependencies, `core-foundation` has been compiled twice (once for `0.4` which is the new version and once for the old `0.3` which has been downloaded and compiled as one of the `core-graphics` dependencies). So basically the people who use the both `core-graphics` and `core-foundation` (the last versions) would encounter the same problems (`core-foundation` is compiled twice and it may cause compile time errors like it was in my case). What are your thoughts on these?
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/87)
<!-- Reviewable:end -->
Introduces CGWindowList API for window capturing and improves `CGImage` and `CGContext`
Initially I just wanted to rewrite https://github.com/servo/core-graphics-rs/pull/52 as it seems that the author is not interested in changing his pull request. So I just implemented `CGImage` bindings, but today another pull request has been merged (https://github.com/servo/core-graphics-rs/pull/79) which does exactly the same.
This pull request still improves some things in regards to `CGImage`, the most important ones are:
* Now `CGImage` uses `CGImageRelease` instead of `CFRelease` (it's a much safer to use `CGImageRelease` here, as it does not crash if you pass a `NULL` image reference to it).
* Now you can retrieve bytes from `CGImage` (uses data provider and copies the bytes from it).
Also several improvements in `CGContext`:
* Added a function `create_image()`, which allows you to create an image out of existing `CGContext`.
* Now it is possible to specify a data pointer passed as a first parameter to the `CGBitmapContextCreate()` upon `CGContext` creation -- very important thing when you deal with images as it allows you to specify your own buffer instead of allocating and copying an additional one from the context (tested it on my machine, it gave me 18.46% of performance boost).
And of course this pull requests adds `CGWindowListCreateImage()` and related things, so now window capturing is possible.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/80)
<!-- Reviewable:end -->