Commit Graph

204 Commits

Author SHA1 Message Date
bors-servo 4ede46bf1c Auto merge of #88 - snapview:cgwindowlist, r=jdm
Add CGWindowListCreateImageFromArray()

Just adds a binding to one small function.

<!-- 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/88)
<!-- Reviewable:end -->
2017-07-25 07:30:10 -07:00
Daniel Abramov 7066159155 Add CGWindowListCreateImageFromArray() 2017-07-24 16:54:13 +02:00
bors-servo aeb81086b5 Auto merge of #87 - snapview:display, r=KiChjang
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 -->
2017-07-04 02:24:36 -07:00
Daniel Abramov f9f22263d8 Add a couple additional CGRect functions 2017-07-04 10:52:10 +02:00
Daniel Abramov c60afb8261 Update core-foundation version, bump crate version 2017-07-04 10:52:00 +02:00
Daniel Abramov f9d4aa4dea Add missing CGDisplayCreateImage() function. 2017-07-04 10:50:52 +02:00
bors-servo 93b2636ea5 Auto merge of #86 - Eijebong:bitflags, r=jdm
Bump bitflags to 0.9 and bump version

<!-- 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/86)
<!-- Reviewable:end -->
2017-07-03 07:54:38 -07:00
Bastien Orivel 77d66fcc42 Bump bitflags to 0.9 and bump version 2017-06-19 20:29:12 +02:00
bors-servo 18acb4f230 Auto merge of #85 - algesten:font_smooth, r=jdm
Font smooth

<!-- 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/85)
<!-- Reviewable:end -->
2017-05-31 09:50:59 -05:00
Martin Algesten 2aaf2d2d84 patch version 2017-05-31 16:14:30 +02:00
Martin Algesten da76a42406 pub, obviously 2017-05-31 16:13:47 +02:00
bors-servo 558451db2e Auto merge of #84 - servo:version, r=mbrubeck
Update minor version.
2017-05-23 13:11:17 -05:00
Josh Matthews 62d4cc7c8d Update minor version. 2017-05-23 10:28:48 -04:00
bors-servo 6d11a1bd38 Auto merge of #83 - algesten:font_smooth, r=jdm
CGContextSetFontSmoothingStyle

<!-- 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/83)
<!-- Reviewable:end -->
2017-05-19 08:38:07 -05:00
Martin Algesten f82e6e5015 CGContextSetFontSmoothingStyle 2017-05-19 10:45:17 +02:00
bors-servo aa0471758a Auto merge of #80 - snapview:master, r=jdm
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 -->
2017-04-24 09:49:03 -05:00
Daniel Abramov 81ded0d8ab Add the posibility to specify buffer for CGContext 2017-04-24 16:07:33 +02:00
Daniel Abramov a4d3c12cb5 Add CFRectMakeWithDictionaryRepresentation 2017-04-24 16:07:33 +02:00
Daniel Abramov c57d98ab71 Add CGWindowList API 2017-04-24 16:04:32 +02:00
Daniel Abramov 02cfd064ad Add major CGImageRef related bindings 2017-04-24 16:04:24 +02:00
bors-servo aa1a2cc65d Auto merge of #82 - alfredoyang:remove_serde, r=jdm
Remove serde crate

Remove ```serde``` from ```core-graphics-rs```. The serialization function moves to ```webrender```.

https://github.com/servo/servo/issues/15607

<!-- 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/82)
<!-- Reviewable:end -->
2017-04-18 05:59:57 -05:00
alfredoyang d503560bb1 Remove serde crate 2017-04-18 18:00:12 +08:00
bors-servo 1753515405 Auto merge of #79 - msanders:ms/cgimage, r=jdm
Add CGImage support

<!-- 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/79)
<!-- Reviewable:end -->
2017-04-03 23:44:27 -05:00
Michael Sanders 8daf52206a Add CGImage support 2017-04-03 21:38:43 -07:00
bors-servo 409d1639c5 Auto merge of #73 - msanders:ms/set-string, r=jdm
Add support for CGEventKeyboardSetUnicodeString

<!-- 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/73)
<!-- Reviewable:end -->
2017-03-22 10:29:40 -07:00
Michael Sanders 65dd626c1c Rename to set_string_from_utf16_unchecked 2017-03-22 10:05:00 -07:00
Michael Sanders 52952115c1 Add support for CGEventKeyboardSetUnicodeString 2017-03-22 10:04:59 -07:00
bors-servo 43f708c430 Auto merge of #74 - msanders:ms/set-event-flags, r=jdm
Allow applying multiple bitmask flags to events

<!-- 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/74)
<!-- Reviewable:end -->
2017-03-17 14:28:34 -07:00
bors-servo 458684b073 Auto merge of #72 - msanders:ms/cgevent-type, r=jdm
Add support for CGEventSetType

<!-- 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/72)
<!-- Reviewable:end -->
2017-03-17 14:18:16 -07:00
Jeff Muizelaar 4a47f13f97 Merge pull request #76 from jrmuizel/callback-types
Fix callback types
2017-03-15 18:01:27 -04:00
Jeff Muizelaar 34659f9ae2 Fix callback types 2017-03-15 11:51:29 -04:00
Michael Sanders d15fa934d3 Add support for CGEventSetType 2017-02-23 19:51:14 -08:00
Michael Sanders a7c53a2bf9 Add prefix to bitflags
Necessary until rust-lang-nursery/bitflags/issues/21 is implemented.
2017-02-22 20:30:23 -08:00
Michael Sanders 34d678356b Use bitflags crate for CGEventFlags 2017-02-22 20:26:33 -08:00
Michael Sanders b35e818544 Allow applying multiple bitmask flags to events 2017-02-20 16:50:40 -08:00
bors-servo ecf21c2c5b Auto merge of #71 - pythoneer:patch-1, r=jdm
Fixed CGEventType in event.rs

changed the enum declaration from bit shifts to one without, like in the original  CGEventTypes.h

<!-- 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/71)
<!-- Reviewable:end -->
2017-02-20 04:55:51 -08:00
Anthony Ramine 154529d6db Merge pull request #69 from nox/serde
Update serde to 0.9
2017-02-17 14:54:35 +01:00
pythoneer 7687a5ed9c Fixed CGEventType in event.rs
changed the enum declaration from bit shifts to one without, like in the original  CGEventTypes.h
2017-02-02 21:38:07 +01:00
Anthony Ramine 5df4a8f58e Update serde to 0.9 2017-02-01 13:38:26 +01:00
bors-servo 75753f05d1 Auto merge of #68 - jrmuizel:cf3, r=jdm
Update to core-foundation 0.3

<!-- 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/68)
<!-- Reviewable:end -->
2017-01-26 12:15:55 -08:00
Jeff Muizelaar d796d9fae2 Update to core-foundation 0.3 2017-01-26 11:23:07 -05:00
bors-servo 33d6ca8ac6 Auto merge of #67 - servo:10.11, r=jrmuizel
Hide newer APIs behind features

<!-- 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/67)
<!-- Reviewable:end -->
2017-01-13 16:00:36 -08:00
Josh Matthews 5afc7df3af Test with features and without. 2017-01-13 13:28:17 -05:00
Josh Matthews 495c81d35f Breaking change version bump. 2017-01-13 13:28:17 -05:00
Josh Matthews 0b08242836 Hide features from macOS 10.11 behind a feature. 2017-01-13 13:28:17 -05:00
bors-servo 62cb73a392 Auto merge of #65 - changm:fill_rect, r=jdm
Add CGContextFillRect to CGContext

<!-- 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/65)
<!-- Reviewable:end -->
2017-01-10 00:53:17 -08:00
Mason Chang b459976fc8 Add CGContextFillRect to CGContext 2017-01-09 17:18:21 -08:00
bors-servo a950da1c7e Auto merge of #64 - msanders:ms/cgevent-additions, r=jdm
Add support for CGEvent::new & CGEventGetLocation

<!-- 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/64)
<!-- Reviewable:end -->
2017-01-08 19:05:25 -08:00
Michael Sanders 8079a2f905 Add support for CGEvent::new & CGEventGetLocation 2017-01-08 18:06:32 -08:00
bors-servo 3d50c8ea1d Auto merge of #59 - WilsonGiese:master, r=jdm
Add CGEvent and CGEventSource

Added CGEvent and CGEventSource to simulate keyboard events.

FFI corresponds mostly to their respective headers in CoreGraphics except for some data types which are defined in CGEventTypes.h.

Uses:
CoreGraphics.framework/Headers/CGEvent.h
CoreGraphics.framework/Headers/CGEventSource.h
CoreGraphics.framework/Headers/CGEventTypes.h

<!-- 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/59)

<!-- Reviewable:end -->
2016-11-06 23:08:09 -06:00