Commit Graph

1563 Commits

Author SHA1 Message Date
Jan Andre Ikenmeyer 77bb7b6cfe Remove unneeded webhook notification 2018-11-07 00:06:36 +01:00
bors-servo d052be8d40 Auto merge of #270 - pcwalton:version-0.18.4, r=jdm
Update `cocoa` version to 0.18.4

r? @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-foundation-rs/270)
<!-- Reviewable:end -->
2018-11-03 17:41:34 -04:00
Patrick Walton f537062e05 Update cocoa version to 0.18.4 2018-11-02 12:24:24 -07:00
bors-servo 0edd977eb7 Auto merge of #268 - pcwalton:additions-0.17.3, r=jdm
CFArray, Core Animation, and Quartz Window Services additions

Here's your regularly scheduled set of additions to the Core Foundation bindings. I needed these for the testing infrastructure I'm developing for https://github.com/pcwalton/planeshift.

r? @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-foundation-rs/268)
<!-- Reviewable:end -->
2018-11-02 07:53:15 -04:00
Patrick Walton fd4736bb9f Update version number to 0.17.3 2018-11-01 20:26:29 -07:00
Patrick Walton ee0ada3d28 Add bindings to Quartz Window Services.
This series of functions allows us to take screenshots, which are useful for
integration testing.
2018-11-01 19:53:02 -07:00
Patrick Walton 692ba80aec Add bindings to -[CATransaction completionBlock] and
`-[CATransaction setCompletionBlock:]`

We have support for blocks, so there's no reason to not include these.
2018-11-01 19:51:32 -07:00
Patrick Walton b56fda0a13 Add bindings to CARenderer 2018-11-01 19:50:02 -07:00
Patrick Walton ee0269808d Add a few bindings to Core Video to go along with the CARenderer bindings 2018-11-01 19:47:36 -07:00
Patrick Walton 1cdd18a0e2 Add a binding to CACurrentMediaTime() 2018-11-01 19:46:25 -07:00
Patrick Walton 90ddbb60b2 Allow a CFArray to be constructed from Copy data.
This is necessary for the bindings to Quartz Window Services to work, since
those APIs don't wrap `CGWindowID` objects in `CFNumber` wrappers.
2018-11-01 19:39:48 -07:00
bors-servo b9372673f0 Auto merge of #265 - faern:dictionary-conversion, r=jdm
Converting between dictionary types

I'm trying to use the `CFDictionary` and `CFMutableDictionary` types more extensively. But run into problems. They are not very compatible with each other. This crate for example does not expose any clean way of using `CFDictionaryCreateMutableCopy` to create a `CFMutableDictionary` from any `CFDictionary`. I added a `From` implementation for this.

It was not possible to, in some safe/simple way, cast a `CFDictionary<K, V>` into the untyped `CFDictionary<*const c_void, *const c_void>` something I added `to_untyped` to be able to do.

When it comes to downcasting, it was not possible to downcast a `CFType` into a dictionary, since they don't implement `ConcreteCFType`. Something they probably should, for the case where the keys and values are just void pointers. `CFArray` does exactly this.

Lastly, what I needed the most was to be able to convert a `CFMutableDictionary` into a `CFDictionary`. This allows me to borrow an immutable `CFDictionary` via the `ItemRef` type basically. It's possible to work around this and actually have owned instances of a `CFDictionary` and a `CFMutableDictionary` pointing to the same actual dictionary by doing this:
```rust
let mut_dict = CFMutableDictionary::new();
let mut_dict2 = mut_dict.clone();
let dict = mut_dict.as_immutable();
// Here one can mutate the dict via `mut_dict2` while `dict` is still in scope/alive.
```
But since we already allow cloning a `CFMutableDictionary` to have two mutable references to the same dictionary I guess someone decided this should be viewed as safe. Both `CFDictionary` and `CFMutableDictionary` does not implement `Send` so we should not end up in any actual thread inconsistencies here.

If the above is indeed considered safe, I could get rid of the `ItemRef` juggling and just make it `fn as_immutable(&self) -> CFDictionary` directly maybe? Would simplify usage.

<!-- 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-foundation-rs/265)
<!-- Reviewable:end -->
2018-10-29 08:57:26 -04:00
bors-servo 3239e415ef Auto merge of #266 - pcwalton:new-appkit-versions, r=emilio
Add constants for new AppKit versions through El Capitan.

I need this to fix `winit`, because Mojave has some new behavior around
layer-backed views and version sniffing is the easiest way to detect when I need to handle it.

This also bumps the version to 0.18.3.

r? @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-foundation-rs/266)
<!-- Reviewable:end -->
2018-10-27 19:56:19 -04:00
Patrick Walton 95f3257573 Add constants for new AppKit versions through El Capitan.
I need this to fix `winit`, because Mojave has some new behavior around
layer-backed views and version sniffing is the easiest way to detect when I
need to handle it.

This also bumps the version to 0.18.3.
2018-10-25 11:51:04 -07:00
Linus Färnstrand 1cb7f0816f Change as_immutable to to_immutable 2018-10-23 09:38:46 +02:00
Linus Färnstrand c539fbc644 Fix indentation 2018-10-23 09:38:46 +02:00
Linus Färnstrand f8c0f59a48 Add as_immutable to CFMutableDictionary 2018-10-23 09:38:46 +02:00
Linus Färnstrand 57170cf838 Allow converting dictionaries to their untyped counterparts 2018-10-23 09:38:46 +02:00
Linus Färnstrand 8ca2746589 Implement ConcreteCFType for CFDictionary<*void, *void> 2018-10-23 09:38:35 +02:00
Linus Färnstrand 1dd66bd610 Add conversion from CFDictionary to CFMutableDictionary 2018-10-19 10:27:24 +02:00
bors-servo 105fd39dd3 Auto merge of #264 - pcwalton:version-bump-0.18.2, r=jdm
Bump some versions

r? @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-foundation-rs/264)
<!-- Reviewable:end -->
2018-10-16 18:48:28 -04:00
Patrick Walton 33ed5ec8e6 Bump some versions 2018-10-16 15:46:01 -07:00
bors-servo 88d5222139 Auto merge of #263 - pcwalton:add-sublayer, r=jdm
Add a few more bindings to `CALayer` and `CFBundle`

r? @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-foundation-rs/263)
<!-- Reviewable:end -->
2018-10-16 18:37:47 -04:00
Patrick Walton 6eb7c9d1cb Add bindings to CFBundleGetBundleWithIdentifier and
`CFBundleGetFunctionPointerForName`.
2018-10-16 15:34:43 -07:00
Patrick Walton 5b4f4ebf42 Add bindings to -[CALayer addSublayer:] and -[CALayer setContentsOpaque:]. 2018-10-16 15:34:40 -07:00
bors-servo e7d90872c4 Auto merge of #262 - servo:jdm-patch-1, r=jrmuizel
Update version of core-foundation for core-text.

<!-- 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-foundation-rs/262)
<!-- Reviewable:end -->
2018-10-10 08:30:48 -04:00
bors-servo b92a14275e Auto merge of #261 - jrmuizel:rustkit, r=jdm
Mention RustKit for people that might be interested.

<!-- 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-foundation-rs/261)
<!-- Reviewable:end -->
2018-10-10 01:10:34 -04:00
Josh Matthews 7ec88453f5 Update version of core-foundation for core-text. 2018-10-09 14:01:17 -04:00
Jeff Muizelaar 276bcac1c4 Mention RustKit for people that might be interested. 2018-09-28 13:39:27 -04:00
bors-servo 370a26ac58 Auto merge of #260 - jrmuizel:versions, r=jdm
Bump the versions of a bunch crates.

<!-- 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-foundation-rs/260)
<!-- Reviewable:end -->
2018-09-28 13:37:39 -04:00
Jeff Muizelaar 0b377a959b Bump the versions of a bunch crates. 2018-09-28 13:19:37 -04:00
bors-servo 2d97cbc244 Auto merge of #259 - pcwalton:core-animation, r=jrmuizel
Add initial bindings to Core Animation.

Bound types include `CALayer`, `CATransaction`, and `CATransform3D`.

r? @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-foundation-rs/259)
<!-- Reviewable:end -->
2018-09-27 14:50:59 -04:00
Patrick Walton e0951ae07b Add initial bindings to Core Animation.
Bound types include `CALayer`, `CATransaction`, and `CATransform3D`.
2018-09-27 11:50:14 -07:00
bors-servo febdc72357 Auto merge of #254 - sibsibsib:master, r=jdm
to_i32 shortcut for CFNumber

kCFNumberIntType is needed in some iokit APIs.

Please let me know if you think anything is missing.

<!-- 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-foundation-rs/254)
<!-- Reviewable:end -->
2018-09-23 20:20:21 -04:00
sib 6b3205e3e4 to_i32 shortcut for CFNumber 2018-09-23 16:41:24 -04:00
Patrick Walton 77f53a210e core-graphics 0.17.1 2018-09-19 11:18:45 -07:00
bors-servo 7bf031cf04 Auto merge of #255 - pcwalton:blend-mode, r=jdm
Add a binding to `CGContextSetBlendMode`

r? @jrmuizel

<!-- 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-foundation-rs/255)
<!-- Reviewable:end -->
2018-09-18 22:03:41 -04:00
Patrick Walton 7fae6fae0c Add a binding to CGContextSetBlendMode 2018-09-18 15:14:47 -07:00
bors-servo 27d8f9e190 Auto merge of #253 - bn3t:cgdisplaymode-extensions, r=jdm
Cgdisplaymode extensions

I am writing a tool to change resolution on MacOS. For this I needed, more support for CGDisplayMode methods. I also need support for CGConfigureDisplayWithDisplayMode().

<!-- 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-foundation-rs/253)
<!-- Reviewable:end -->
2018-09-18 08:48:14 -04:00
Bernard Niset f58e2b6dd9 Changes according to PR remarks. 2018-09-11 23:49:55 +02:00
Bernard Niset 2df2f7297f Extended CDDisplayMode Doc 2018-09-08 15:07:28 +02:00
bors-servo 832e337b1a Auto merge of #252 - Litarvan:master, r=jrmuizel
Added basic NSToolbar

-> Basic NSToolbar implementation (init, separator, adding to NSWindow)
I needed this for a project, and i wanted to share it.

Empty toolbar example :
![Example](https://user-images.githubusercontent.com/8712146/44870891-954eb980-ac91-11e8-97f5-384ad71baf7a.png)

Even empty, combined with a fullsized content view and a transparent title bar, this can be very useful (used for example by Firefox, and Atom).

<!-- 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-foundation-rs/252)
<!-- Reviewable:end -->
2018-08-30 15:09:55 -04:00
bors-servo 6c36d5167e Auto merge of #249 - mehcode:feature/add-ctframe, r=jrmuizel
Add CTFrame and CTFramesetter

<!-- 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-foundation-rs/249)
<!-- Reviewable:end -->
2018-08-30 15:05:52 -04:00
bors-servo c9616cc15c Auto merge of #250 - mehcode:feature/cgcontext, r=jrmuizel
Allow most CGContext methods to be usable from a immutable reference and expose several more methods

If this is too much to submit at once, please tell me. This is what I've got left to send in and I'm unsure where to break it up more.

<!-- 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-foundation-rs/250)
<!-- Reviewable:end -->
2018-08-30 15:00:37 -04:00
Adrien Navratil 1a156546b1 Added basic NSToolbar 2018-08-30 20:11:53 +02:00
Bernard Niset 7cb87e5ba2 Added support for configuring the display mode for a display. 2018-08-26 19:58:35 +02:00
Ryan Leckey 8052ba29e1 Add save, restore, translate, scale, set_fill_color, add_path, close_path, and fill_path to CGContext 2018-08-20 16:36:02 -07:00
Ryan Leckey 071d2c6025 Move methods on CGContext taking &self from to CGContextRef 2018-08-20 16:35:54 -07:00
Ryan Leckey 7ec49da393 Add CTFrame and CTFramesetter 2018-08-20 16:29:13 -07:00
Bernard Niset 2685bbd05b Added options to all_display_modes 2018-08-20 21:03:56 +02:00