Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Adds an additional display function + bumps core-foundation dependency version #87

Merged
merged 3 commits into from
Jul 4, 2017
Merged

Conversation

daniel-abramov
Copy link
Contributor

@daniel-abramov daniel-abramov commented Jun 20, 2017

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?

This change is Reviewable

@bors-servo
Copy link

☔ The latest upstream changes (presumably #86) made this pull request unmergeable. Please resolve the merge conflicts.

@jdm
Copy link
Member

jdm commented Jul 3, 2017

This looks fine. Sorry for the delay; if you rebase and increase appropriate Cargo version numbers, we can merge and publish these changes.

@daniel-abramov
Copy link
Contributor Author

Done.

@KiChjang
Copy link

KiChjang commented Jul 4, 2017

The changes here don't seem like they're breaking; why did you increment the minor version number?

@daniel-abramov
Copy link
Contributor Author

daniel-abramov commented Jul 4, 2017

They are indeed non breaking, that's why I incremented the minor version, not the major version. I incremented the minor version as I thought that changing the dependency versions (core-foundation 0.3 -> core-foundation 0.4) requires this change. But if it is not the case, I can revert this change and increase only the patch version.

@daniel-abramov
Copy link
Contributor Author

UPD. I just followed semver:

Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is introduced to the public API.

@daniel-abramov
Copy link
Contributor Author

And also I've just checked the history of Cargo.toml and noticed that the last time when the core-foundation dependency version was increased, the minor version of the crate was increased as well:
d796d9f

Another one example:
b7c2f5c

@KiChjang
Copy link

KiChjang commented Jul 4, 2017

Ok, looks like the version bump in core-foundation necessitates a minor version bump. Thanks!

@bors-servo r+

@bors-servo
Copy link

📌 Commit f9f2226 has been approved by KiChjang

@bors-servo
Copy link

⌛ Testing commit f9f2226 with merge aeb8108...

bors-servo pushed a commit that referenced this pull request Jul 4, 2017
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 -->
@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: KiChjang
Pushing aeb8108 to master...

@bors-servo bors-servo merged commit f9f2226 into servo:master Jul 4, 2017
@daniel-abramov daniel-abramov deleted the display branch July 24, 2017 13:22
rthomas added a commit to rthomas/core-graphics-rs that referenced this pull request Jul 27, 2017
This follows the servo pattern mentioned in
rust-lang/rust#27303 to replace the zero-sized
structs with an `enum`.
rthomas added a commit to rthomas/core-graphics-rs that referenced this pull request Jul 27, 2017
Changes zero-sized structs to an `enum` and removed unused macro use statement.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants