Commit Graph

1607 Commits

Author SHA1 Message Date
bors-servo 348f7de691 Auto merge of #296 - waywardmonkeys:clippy-core-foundation-missing-default, r=jdm
clippy: Add missing Default impls.

<!-- 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/296)
<!-- Reviewable:end -->
2019-03-14 10:03:40 -04:00
bors-servo f8c1aaa3d3 Auto merge of #295 - waywardmonkeys:clippy-core-foundation-expect-with-function-call, r=jdm
clippy: Don't call expect with the result of a function call.

<!-- 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/295)
<!-- Reviewable:end -->
2019-03-14 09:55:14 -04:00
bors-servo c209e6cdd3 Auto merge of #299 - waywardmonkeys:refer-to-macos, r=jdm
Refer to macOS rather than OS X.

<!-- 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/299)
<!-- Reviewable:end -->
2019-03-14 09:50:45 -04:00
bors-servo 95a9f7a05b Auto merge of #298 - waywardmonkeys:fix-typo, r=jrmuizel
Fix typo.

<!-- 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/298)
<!-- Reviewable:end -->
2019-03-14 09:01:36 -04:00
Bruce Mitchener d2d3b3362a Refer to macOS rather than OS X. 2019-03-14 17:47:00 +07:00
Bruce Mitchener e284579031 Fix typo. 2019-03-14 17:42:22 +07:00
Bruce Mitchener 291a606fec clippy: Don't call expect with the result of a function call. 2019-03-14 09:40:33 +07:00
Bruce Mitchener 20d3a3f102 clippy: Add missing Default impls. 2019-03-14 09:36:00 +07:00
bors-servo 488aa87f21 Auto merge of #275 - acheronfail:chore/add-nsurl, r=jdm
add NSURL

This PR adds in the trait for `NSURL` (requested in #183).

<!-- 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/275)
<!-- Reviewable:end -->
2019-03-11 09:01:30 -04:00
acheronfail b08aa69460 chore: use bitflags to create NSURL constants 2019-03-11 07:54:32 +11:00
bors-servo dbdbb491c9 Auto merge of #293 - srijs:feat/get-glyph-with-name, r=jdm
implement CTFont::get_glyph_with_name

Expose a safe wrapper around `CTFontGetGlyphWithName`.

<!-- 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/293)
<!-- Reviewable:end -->
2019-02-10 15:48:25 -05:00
Sam Rijs 20348e0b8f implement CTFont::get_glyph_with_name 2019-02-09 12:30:48 +11:00
bors-servo 36d7c972fe Auto merge of #257 - mtak-:geometry_partialeq, r=jdm
Add PartialEq impls for CGSize CGPoint and CGAffineTransform

fixes #256

I was not able to directly use `CGSizeEqualToSize` or `CGPointEqualToPoint` because those are macros.

<!-- 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/257)
<!-- Reviewable:end -->
2019-01-25 17:23:02 -05:00
bors-servo 2070f4ba75 Auto merge of #290 - jrmuizel:eo, r=jdm
Expose support for even-odd fills.

<!-- 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/290)
<!-- Reviewable:end -->
2019-01-07 09:41:57 -05:00
Jeff Muizelaar 8b1f1ae9bf Expose support for even-odd fills. 2019-01-07 09:34:28 -05:00
bors-servo b05b6157bc Auto merge of #289 - jrmuizel:derive, r=jrmuizel
derive(Clone, Copy, Debug) on Line enums

<!-- 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/289)
<!-- Reviewable:end -->
2019-01-07 09:27:58 -05:00
Jeff Muizelaar b174773ba6 derive(Clone, Copy, Debug) on Line enums 2019-01-04 18:33:48 -05:00
bors-servo 674bf3bf33 Auto merge of #288 - jrmuizel:path, r=jdm
Add some minimal bindings for constructing a path

<!-- 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/288)
<!-- Reviewable:end -->
2019-01-04 17:23:24 -05:00
Jeff Muizelaar a45f389297 Add some minimal bindings for constructing a path 2019-01-04 17:04:58 -05:00
bors-servo 4fc0194cd0 Auto merge of #287 - jrmuizel:stroke-color, r=jdm
Add binding for CGContextSetRGBStrokeColor

<!-- 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/287)
<!-- Reviewable:end -->
2019-01-04 16:53:39 -05:00
Jeff Muizelaar e6e7729b0a Add binding for CGContextSetRGBStrokeColor 2019-01-04 16:46:54 -05:00
bors-servo a4b08a85bc Auto merge of #286 - jrmuizel:mitre, r=jdm
Fix the spelling of miter

<!-- 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/286)
<!-- Reviewable:end -->
2019-01-04 14:16:21 -05:00
Jeff Muizelaar a65bf52e87 Fix the spelling of miter 2019-01-04 14:07:06 -05:00
bors-servo e48becfa88 Auto merge of #285 - jrmuizel:bounding, r=jdm
Add a binding for CGContextGetClipBoundingBox

<!-- 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/285)
<!-- Reviewable:end -->
2019-01-04 10:00:37 -05:00
Jeff Muizelaar 128f022a47 Add a binding for CGContextGetClipBoundingBox 2019-01-04 09:57:32 -05:00
bors-servo 815accb232 Auto merge of #283 - jrmuizel:stroke, r=jdm
Expose stroking apis on 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-foundation-rs/283)
<!-- Reviewable:end -->
2019-01-03 22:44:22 -05:00
Jeff Muizelaar be6dd330b8 Expose stroking apis on CGContext 2019-01-03 22:17:07 -05:00
bors-servo b5b08d9cdd Auto merge of #281 - jrmuizel:clear-rect, r=jrmuizel
Add bindings for CGContextClearRect

<!-- 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/281)
<!-- Reviewable:end -->
2019-01-03 22:09:05 -05:00
Jeff Muizelaar b55674f65b Add bindings for CGContextClearRect 2019-01-03 22:08:24 -05:00
bors-servo cf71f83951 Auto merge of #276 - euclio:ns-not-found, r=jrmuizel
add NSNotFound and NSIntegerMax constants

<!-- 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/276)
<!-- Reviewable:end -->
2019-01-03 20:20:26 -05:00
bors-servo df62de513b Auto merge of #279 - silwol:master, r=jrmuizel
Use libc c_char instead of i8 for libc strlen() call

This patch allows build errors like https://buildd.debian.org/status/fetch.php?pkg=rust-core-foundation&arch=arm64&ver=0.6.1-1&stamp=1533301991&raw=0 to go through on architectures that use u8 as c_char.

<!-- 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/279)
<!-- Reviewable:end -->
2019-01-03 20:16:37 -05:00
Wolfgang Silbermayr e2ae28c815 Use libc c_char instead of i8 for libc strlen() call 2018-12-07 07:06:09 +01:00
bors-servo 42a6014bf4 Auto merge of #269 - jrmuizel:run, r=jdm
Add some minimal bindings for CTLine and CTRun

<!-- 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/269)
<!-- Reviewable:end -->
2018-11-14 17:42:48 -05:00
Andy Russell 6884430a82 add NSNotFound constant 2018-11-10 16:16:37 -05:00
bors-servo 55a4d799ed Auto merge of #274 - acheronfail:chore/add-cf-bookmark-definitions, r=jdm
chore: add CF functions for using bookmark data

fixes #116 (a closed issue)

Provides the definitions for some of the CF functions for using Bookmark data (which is useful for sandboxed applications).

<!-- 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/274)
<!-- Reviewable:end -->
2018-11-09 09:23:06 -05:00
acheronfail 4d92078a1b add NSURL 2018-11-09 18:02:03 +11:00
acheronfail cf356f6c61 chore: add CF functions for using bookmark data
fixes #116 (a closed issue)
2018-11-09 12:20:09 +11:00
bors-servo e24f1442bc Auto merge of #273 - acheronfail:chore/add-more-methods-to-nscolor, r=jdm
chore: add NSColorSpace and more methods to NSColor

fixes #184
fixes #251

This PR adds some requested methods for `NSColor`, as well as adding a bit of functionality for `NSColorSpace` too.

<!-- 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/273)
<!-- Reviewable:end -->
2018-11-08 18:41:35 -05:00
acheronfail 6148a59381 chore: add NSColorSpace and more methods to NSColor
fixes #184
fixes #251
2018-11-09 09:48:20 +11:00
Jeff Muizelaar 42889636bf Add some minimal bindings for CTLine and CTRun 2018-11-08 16:03:21 -05:00
bors-servo 9f23b511ad Auto merge of #272 - acheronfail:chore/add-isEnabled-setEnabled-to-nsbutton, r=jdm
chore: add simple NSControl class

I needed to use `[button setEnabled]` for an `NSButton`, so I added some of `NSControl`'s basic functionality.

Example usage:

```rust
use cocoa::foundation::NSRect;
use cocoa::appkit::{NSButton, NSControl, NSView};

// Parent view
let view = NSView::alloc(nil)
    .initWithFrame_(NSRect::new(NSPoint::new(0., 0.), NSSize::new(200., 200.)));

// Add button to view
let button = NSButton::alloc(nil)
    .initWithFrame_(NSRect::new(NSPoint::new(20., 20.), NSSize::new(150., 50.)));
NSView::addSubview_(view, button);

// Prints "1" (button enabled)
println!("{:?}", NSControl::isEnabled_(button));

// Disable the button
NSControl::setEnabled_(button, NO);

// Prints "0" (button disabled)
println!("{:?}", NSControl::isEnabled_(button));
```

<!-- 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/272)
<!-- Reviewable:end -->
2018-11-08 15:28:45 -05:00
acheronfail 8a72e96c97 chore: add simple NSControl class 2018-11-09 07:20:57 +11:00
bors-servo 8ffba8a79a Auto merge of #271 - Darkspirit:https, r=jdm
Remove unneeded webhook notification

https://github.com/servo/saltfs/pull/906#issuecomment-436313032

<!-- 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/271)
<!-- Reviewable:end -->
2018-11-06 19:56:55 -05:00
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