Commit Graph

1685 Commits

Author SHA1 Message Date
bors-servo 70aca43f2f Auto merge of #341 - SSheldon:cocoa_version_0.19.1, r=jdm
Update cocoa version to 0.19.1

New version needed so that the #340 fixes can be published.
2019-10-16 13:10:29 -04:00
Steven Sheldon e65c9b2939 Update cocoa version to 0.19.1 2019-10-16 08:08:11 -07:00
bors-servo f7c2096ad0 Auto merge of #340 - SSheldon:fix_omitted_ret_types, r=jdm
Fixes so the compiler can infer msg_send! return types

Currently, due to a quirk in Rust's type inference interacting with the structure of the `msg_send!` macro, a `()` return type will be inferred when the compiler cannot otherwise determine the return type. This behavior is expected to change, and in the future could resolve to a `!` return type, which results in undefined behavior.

Linting has previously been added for this in rust-lang/rust#39216, but it did not catch these cases due to SSheldon/rust-objc#62. An upcoming version of objc will be fixed to stop hiding these errors, at which point they will become compile errors.

This change fixes these errors and allows cocoa to compile with the fixed version of objc.
2019-10-16 10:02:31 -04:00
Steven Sheldon 0a1b0d6f1b Fixes so the compiler can infer msg_send! return types
Currently, due to a quirk in Rust's type inference interacting with the
structure of the msg_send! macro, a () return type will be inferred when
the compiler cannot otherwise determine the return type. This behavior
is expected to change, and in the future could resolve to a ! return
type, which results in undefined behavior.

Linting has previously been added for this in rust-lang/rust#39216, but
it did not catch these cases due to SSheldon/rust-objc#62. An upcoming
version of objc will be fixed to stop hiding these errors, at which
point they will become compile errors.

This change fixes these errors and allows cocoa to compile with the
fixed version of objc.
2019-10-16 06:50:58 -07:00
bors-servo c9b0702dc0 Auto merge of #337 - wezm:CFDataGetBytes, r=jdm
Add CFDataGetBytes to CFData bindings

Just add a missing binding that I needed.

<!-- 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/337)
<!-- Reviewable:end -->
2019-10-15 08:13:08 -04:00
Wesley Moore b2a4a0e566 Add CFDataGetBytes to CFData bindings 2019-10-15 09:53:39 +11:00
bors-servo 6143ce111e Auto merge of #336 - wezm:copy-available-tables, r=jdm
Add get_available_font_tables to CTFont

The PR exposes `CTFontCopyAvailableTables` through `get_available_font_tables`.

<!-- 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/336)
<!-- Reviewable:end -->
2019-10-11 08:25:40 -04:00
Wesley Moore bc20614a3b Add get_available_font_tables to CTFont 2019-10-11 16:49:05 +11:00
bors-servo ba4e7f41f5 Auto merge of #335 - wezm:character-set, r=jdm
Add CFCharacterSet

<!-- 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/335)
<!-- Reviewable:end -->
2019-10-10 09:50:38 -04:00
Wesley Moore ad416b4890 Add CFCharacterSet to core-foundation 2019-10-10 15:35:21 +11:00
Wesley Moore 35e3e5b5c1 Add CFCharacterSet to core-foundation-sys 2019-10-10 15:33:37 +11:00
bors-servo 751146025c Auto merge of #333 - seanvoss:add_target, r=jdm
Adds setTarget to buttons and menu items, these are required in many …

…cases

<!-- 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/333)
<!-- Reviewable:end -->
2019-09-25 09:43:06 -04:00
svoss 4372c047e6 Adds setTarget to buttons and menu items, these are required in many cases 2019-09-25 06:41:07 -07:00
bors-servo e1229a6b9d Auto merge of #332 - servo:gleamup, r=manishearth
Update gleam. Publish io-surface 0.12.1.

<!-- 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/332)
<!-- Reviewable:end -->
2019-09-03 12:23:28 -04:00
Josh Matthews 33c087ee8f Update gleam. Publish io-surface 0.12.1. 2019-09-03 12:18:10 -04:00
bors-servo 0951ab3a83 Auto merge of #330 - aleksijuvani:fix-i686-apple-darwin, r=jdm
Fix i686-apple-darwin compile target

<!-- 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/330)
<!-- Reviewable:end -->
2019-08-30 19:49:45 -04:00
Aleksi Juvani 552021c096 Fix i686-apple-darwin compile target 2019-08-22 21:56:34 +03:00
bors-servo 0612ea1fbb Auto merge of #329 - fry:master, r=jdm
add shared_support_url to CFBundle

This adds access to CFBundleCopySharedSupportURL from the CFBundle struct

<!-- 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/329)
<!-- Reviewable:end -->
2019-08-05 10:16:56 -04:00
Eike Siewertsen 1a0e69872a add shared_support_url to CFBundle 2019-08-05 10:50:58 +02:00
bors-servo 1a857cd745 Auto merge of #328 - king6cong:master, r=jdm
Sync member order in impl and trait

<!-- 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/328)
<!-- Reviewable:end -->
2019-08-02 05:45:19 -04:00
king6cong 0f953f4e7b Sync member order in impl and trait 2019-08-02 15:11:32 +08:00
bors-servo b18ad75ff8 Auto merge of #327 - seanvoss:add_imageview, r=jdm
Adds Image View 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-foundation-rs/327)
<!-- Reviewable:end -->
2019-07-23 09:58:52 -04:00
bors-servo 99b4dfe38b Auto merge of #326 - servo:jdm-patch-3, r=asajeffrey
Major version changes for cocoa and io-surface

<!-- 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/326)
<!-- Reviewable:end -->
2019-07-22 20:26:11 -04:00
Sean Voss 4885ac1384 Adds Image View Support 2019-07-22 15:28:55 -07:00
bors-servo 0fdc104311 Auto merge of #325 - poiru:bump-ct, r=jdm
Bump core-text to 13.3.0

The only API change since the last bump is #321.

<!-- 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/325)
<!-- Reviewable:end -->
2019-07-17 09:13:21 -04:00
Josh Matthews 70275f5af1 Update cocoa to 0.19.0 2019-07-17 08:29:40 -04:00
Birunthan Mohanathas 5200688b1b Bump core-text to 13.3.0
The only API change since the last bump is #321.
2019-07-17 15:28:10 +03:00
bors-servo d5e805cd78 Auto merge of #322 - felixrabe:fix-nscolor, r=jdm
Fix NSColor argument order: r b<->g

<!-- 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/322)
<!-- Reviewable:end -->
2019-07-17 08:24:15 -04:00
Josh Matthews 451af6e167 Update io-surface to 0.12.0. 2019-07-17 08:17:44 -04:00
bors-servo 2563989875 Auto merge of #324 - zakorgy:io-surface-alpha, r=jdm
Add alpha option to bind_to_gl_texture

This PR is related to https://github.com/servo/servo/pull/23509.
If the WebGL context we use doesn't have alpha, the underlying IOsurface should use RGB internal format instead of RGBA, else the reported GL_ALPHA_BITS value will be incorrect fot the context in the related wpt-tests.
We only need to change the internal format in this case, according to https://github.com/phracker/MacOSX-SDKs/blob/master/MacOSX10.8.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/CGLIOSurface.h#L99
cc @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/324)
<!-- Reviewable:end -->
2019-07-17 07:34:10 -04:00
Zakor Gyula 8a15cb91c4 Add alpha option to bind_to_gl_texture 2019-07-17 10:58:18 +02:00
bors-servo 0ed0c4b7d9 Auto merge of #321 - poiru:font-descriptor-format, r=jdm
Implement CTFontDescriptor::font_format()

<!-- 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/321)
<!-- Reviewable:end -->
2019-07-16 16:50:16 -04:00
bors-servo eab13d8032 Auto merge of #323 - atouchet:master, r=jdm
Update Travis CI URLs

<!-- 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/323)
<!-- Reviewable:end -->
2019-07-15 08:11:31 -04:00
atouchet 7430046924 Update Travis CI URLs 2019-07-14 21:16:49 -07:00
Felix Rabe 8bc0ed06cb Fix NSColor argument order: r b<->g 2019-07-14 23:20:33 +02:00
bors-servo 152251b848 Auto merge of #320 - poiru:fix-deprecated-int-uint, r=jdm
Fix use of deprecated libc::(u)int{16,32}_t

This fixes warnings like:

>use of deprecated item 'libc::int32_t': Use i32 instead.

<!-- 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/320)
<!-- Reviewable:end -->
2019-07-14 08:47:44 -04:00
Birunthan Mohanathas 28557ccc85 Implement CTFontDescriptor::font_format() 2019-07-14 12:07:35 +03:00
Birunthan Mohanathas 1ad4d50d16 Fix use of deprecated libc::(u)int{16,32}_t
This fixes warnings like:

>use of deprecated item 'libc::int32_t': Use i32 instead.
2019-07-14 11:57:05 +03:00
bors-servo 05952a809c Auto merge of #317 - cmyr:add-isARepeat, r=jdm
Add isARepeat

closes #316

<!-- 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/317)
<!-- Reviewable:end -->
2019-06-10 21:39:06 -04:00
Colin Rofls 0d56822550 Add isARepeat 2019-06-07 11:45:24 +02:00
bors-servo bbc7f0bb96 Auto merge of #315 - fanzeyi:add-nsbundle, r=jdm
Add some bindings for Appkit and Cocoa Foundation

This commit adds several missing AppKit & Cocoa Foundation bindings. Specifically:

AppKit:

* NSWindowTabbingMode ([Apple Doc](https://developer.apple.com/documentation/appkit/nswindowtabbingmode?language=objc))
* Managing Window Tabs section for NSWindow ([Apple Doc](https://developer.apple.com/documentation/appkit/nswindow?language=objc#3020937))
* NSNib ([Apple Doc](https://developer.apple.com/documentation/appkit/nsnib?language=objc))

Cocoa Foundation

* `init`, `count` and `objectAtIndex` for `NSArray`  ([Apple Doc](https://developer.apple.com/documentation/foundation/nsarray?language=objc))
* `NSBundle` ([Apple Doc](https://developer.apple.com/documentation/foundation/nsbundle?language=objc))

I don't have much experience in Cocoa nor Objective-C. Please let me know if there is anything need to be changed. Thanks!

<!-- 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/315)
<!-- Reviewable:end -->
2019-05-06 11:02:57 -04:00
Zeyi Fan e174d01b8a Add some bindings for Appkit and Cocoa Foundation
This commit adds several missing AppKit & Cocoa Foundation bindings. Specifically:

AppKit:

* NSWindowTabbingMode ([Apple Doc](https://developer.apple.com/documentation/appkit/nswindowtabbingmode?language=objc))
* Managing Window Tabs section for NSWindow ([Apple Doc](https://developer.apple.com/documentation/appkit/nswindow?language=objc#3020937))
* NSNib ([Apple Doc](https://developer.apple.com/documentation/appkit/nsnib?language=objc))

Cocoa Foundation

* `init`, `count` and `objectAtIndex` for `NSArray`  ([Apple Doc](https://developer.apple.com/documentation/foundation/nsarray?language=objc))
* `NSBundle` ([Apple Doc](https://developer.apple.com/documentation/foundation/nsbundle?language=objc))
2019-05-04 19:14:51 -07:00
bors-servo 965cc88a91 Auto merge of #314 - Litarvan:master, r=jdm
delegate! macro, a higher-level way to create Cocoa delegates (e.g. NSWindowDelegate)

As @vbo mentioned in #205 the only way to create cocoa delegates such as NSWindowDelegate is to use the objc crate and it's a bit hard.

I thought a macro for this would be useful.

## Example with NSWindowDelegate

Without macro :
```rust
let mut decl = ClassDecl::new("MyWindowDelegate", class!(NSObject)).unwrap();

decl.add_ivar::<id>("window");
decl.add_method(sel!(windowWillEnterFullScreen:), on_enter_fullscreen as extern fn(&Object, Sel, id));

let cl = decl.register();

let delegate: id = msg_send![cl, alloc];
(*delegate).set_ivar("window", window);

window.setDelegate_(delegate);
```

With macro :
```rust
window.setDelegate_(delegate!("MyWindowDelegate", {
    window: id = window,
    (windowWillEnterFullScreen:) => on_enter_fullscreen as extern fn(&Object, Sel, id)
}));
```

<!-- 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/314)
<!-- Reviewable:end -->
2019-05-02 17:23:44 -04:00
Adrien Navratil f65f59b83a Fixed delegate! example code 2019-05-02 20:05:36 +02:00
Adrien Navratil 054a56d3ed Added delegate! macro 2019-05-02 19:28:52 +02:00
bors-servo 15da198774 Auto merge of #312 - euclio:nsspellchecker, r=jdm
add barebones NSSpellChecker bindings

Also adds `substringWithRange` to `NSString`.

<!-- 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/312)
<!-- Reviewable:end -->
2019-04-29 18:42:27 -04:00
Andy Russell a939bec429 add barebones NSSpellChecker bindings 2019-04-29 18:15:53 -04:00
bors-servo 673be9f0b5 Auto merge of #313 - yvt:patch-fn, r=jdm
Expose more APIs on CGContext

This PR exposes the following APIs:

- `CGContextRotateCTM`
- `CGContextGetCTM`
- `CGContextConcatCTM`
- `CGContextFillRects`
- `CGContextStrokeRect`
- `CGContextStrokeRectWithWidth`
- `CGContextReplacePathWithStrokedPath`
- `CGContextFillEllipseInRect`
- `CGContextStrokeEllipseInRect`
- `CGContextStrokeLineSegments`
- `CGContextAddQuadCurveToPoint`
- `CGContextClipToRect`
- `CGContextClipToRects`

<!-- 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/313)
<!-- Reviewable:end -->
2019-04-29 11:35:03 -04:00
yvt 2d5bdcc9b5 Add CGContext::{clip_to_rect, clip_to_rects} 2019-04-29 10:27:49 +09:00
yvt e012b2051f Add all missing functions from section "Transforming User Space" to CGContext
API documentation: <https://developer.apple.com/documentation/coregraphics/cgcontext>
2019-04-29 09:38:39 +09:00