Commit Graph

1834 Commits

Author SHA1 Message Date
Jeff Muizelaar 0f3eaa7416 Add create_font_descriptor_with_data
This allows create a font from a CFData instead of slice.
More importantly this allows using a CFData that was created
with a custom allocator.
2020-11-03 10:58:40 -05:00
bors-servo e9e0c6e86c Auto merge of #425 - servo:jrmuizel-patch-2, r=emilio
Add github actions CI for macos-11.0
2020-10-29 20:57:32 -04:00
bors-servo 29588625c7 Auto merge of #423 - jrmuizel:dict-debug, r=emilio
Implement Debug on the generic CFDictionary
2020-10-29 20:48:32 -04:00
bors-servo afb65b0ca6 Auto merge of #424 - jrmuizel:sync-desc, r=emilio
Make CTFontDescriptor Send and Sync and expose attributes()
2020-10-29 20:34:42 -04:00
Jeff Muizelaar 3ea06fb10a Add github actions CI for macos-11.0 2020-10-28 19:22:41 -04:00
Jeff Muizelaar 597a12983a Make CTFontDescriptor Send and Sync and expose attributes() 2020-10-28 12:13:03 -04:00
Jeff Muizelaar 2ee8facbd6 Implement Debug on the generic CFDictionary 2020-10-27 17:22:26 -04:00
bors-servo 1bcbef7027 Auto merge of #422 - jrmuizel:cfprop-describe, r=jdm
Implement Debug on CFPropertyList
2020-10-27 08:31:55 -04:00
Jeff Muizelaar faf0d7c0ff Implement Debug on CFPropertyList 2020-10-26 23:11:12 -04:00
bors-servo 20dcdc0970 Auto merge of #420 - jrmuizel:round-trip, r=jdm
Make sure we can round trip data fonts through descriptors.
2020-10-26 15:12:22 -04:00
Jeff Muizelaar 5a9ab37c01 Make sure we can round trip data fonts through descriptors. 2020-10-26 14:46:13 -04:00
bors-servo e000e130c9 Auto merge of #419 - jrmuizel:tv, r=jdm
Expand and correct osx versions.

xcode7.2 doesn't seem to exist anymore and there doesn't
seem to be other 10.10 images available.
2020-10-26 14:34:19 -04:00
Jeff Muizelaar 3a74c3756e Expand and correct osx versions.
xcode7.2 doesn't seem to exist anymore and there doesn't
seem to be other 10.10 images available.
2020-10-26 13:38:20 -04:00
bors-servo f4b01d2344 Auto merge of #418 - jrmuizel:copy-attrs, r=jdm
Expose CTFontDescriptorCreateCopyWithAttributes
2020-10-21 13:01:21 -04:00
Jeff Muizelaar f8b2abf407 Expose CTFontDescriptorCreateCopyWithAttributes 2020-10-21 11:34:27 -04:00
bors-servo b427c7d9b3 Auto merge of #416 - yuhr:core-foundation-bundle-copy-resources-directory-url, r=jdm
Add CFBundleCopyResourcesDirectoryURL

I need this because of https://github.com/burtonageo/cargo-bundle/issues/12.
2020-10-14 15:22:19 -04:00
bors-servo 54ce1ec4fc Auto merge of #417 - jrmuizel:from-buffer, r=jdm
Fix the type of Arc::from_raw().

Previously we were mistakenly creating an `Arc<c_void>` instead of an
`Arc<T>`. This also changes the test to catch this problem.
2020-10-14 15:14:45 -04:00
Jeff Muizelaar dc588497db Fix the type of Arc::from_raw().
Previously we were mistakenly creating an Arc<c_void> instead of an
Arc<T>. This also changes the test to catch this problem.
2020-10-14 13:29:28 -04:00
Yu Shimura 437be24cdb CFBundleCopyResourcesDirectoryURL 2020-10-14 11:10:39 +09:00
bors-servo d2ff40289a Auto merge of #415 - jrmuizel:allocator, r=jdm
Fix the definition of CFAllocatorContext

The function pointers can be null so should be wrapped in Option.

This struct was basically unusable before so I think we should
be fine making this change while only bumping the patch version.
I was unable to find any uses of it on github.
2020-10-13 18:44:46 -04:00
Jeff Muizelaar c55fd48fbe Fix the definition of CFAllocatorContext
The function pointers can be null so should be wrapped in Option.

This struct was basically unusable before so I think we should
be fine making this change while only bumping the patch version.
I was unable to find any uses of it on github.
2020-10-13 17:55:00 -04:00
bors-servo d540fee244 Auto merge of #412 - sassman:feat/number-type-as-const, r=jrmuizel
feat(CFNumber): change `CFNumberType` from static to const, to improve match expression ergonomics

this PR changes the `CFNumberType` values like `kCFNumberSInt64Type` from `static` to `const`.

That way it is possible to simplify match expressions like this:

before:
```rust
let type_id = unsafe { CFNumberGetType(value) };
match type_id {
    si64 if si64 == kCFNumberSInt64Type => {},
    si32 if si32 == kCFNumberSInt32Type => {},
    _ => {},
}
```

after:
```rust
let type_id = unsafe { CFNumberGetType(value) };
match type_id {
    kCFNumberSInt64Type => {},
    kCFNumberSInt32Type => {},
    _ => {},
}
```

Note: function call `CFNumberGetType(value)` is implemented in PR #411
2020-10-07 08:48:55 -04:00
Sven Assmann b078b8754d feat(CFNumber): change CFNumberType from static to const, to improve match expression ergonomics 2020-10-07 09:17:32 +02:00
bors-servo 0be2364850 Auto merge of #411 - sassman:master, r=jrmuizel
add `CFNumberGetType` to determine specific number type

this PR adds support for `CFNumberGetType` that is needed if there is a `CFNumberRef` and it is not clear what sort of number it is.

Now it would be possible to do such a thing:

```rust
let type_id = unsafe { CFNumberGetType(value) };
match type_id {
    si64 if si64 == kCFNumberSInt64Type => {},
    si32 if si32 == kCFNumberSInt32Type => {},
    _ => {},
}
```
2020-10-06 18:14:01 -04:00
bors-servo 7aad25e327 Auto merge of #413 - sassman:feat/boolean-get-value, r=jdm
feat(CFBoolean): add function `CFBooleanGetValue` to retrieve a value of a `CFBooleanRef`

This PR adds the function `CFBooleanGetValue` that gets the bool value by a `CFBooleanRef`
2020-10-04 08:17:34 -04:00
Sven Assmann 9007f1348c feat(CFBoolean): add function CFBooleanGetValue to retrieve a value of a CFBooleanRef 2020-10-04 12:26:01 +02:00
Sven Assmann 36d06c85ba feat(CFNumber): add CFNumberGetType to figure out the correct numeric type of a CFNumberRef 2020-10-04 10:42:40 +02:00
Josh Matthews d3336c3a21 Version bumps for cocoa, core-foundation-sys, core-foundation, core-text, core-graphics-types, core-graphics. 2020-09-15 12:19:56 -04:00
Josh Matthews 95d071234c Bump core-graphics to 0.22.0, core-text to 19.0.0, cocoa to 0.23.0. 2020-09-15 12:15:41 -04:00
bors-servo adf0c6a87b Auto merge of #410 - kaiwk:create-font-descriptor, r=jdm
Add `CTFontManagerCreateFontDescriptorFromData` for avoid CGFont
2020-09-13 08:12:55 -04:00
Wang Kai d76d3deb29 Add CTFontManagerCreateFontDescriptorFromData for avoid CGFont 2020-09-13 20:03:50 +08:00
bors-servo bc3de2c2aa Auto merge of #408 - tronical:simon/layer-contents-placement, r=jdm
Add API for NSView's layerContentsPlacement property
2020-09-04 11:13:05 -04:00
Simon Hausmann 3743b68172 Add API for NSView's layerContentsPlacement property 2020-09-04 17:04:19 +02:00
bors-servo 466405cc0d Auto merge of #406 - kornelski:docsbuild, r=jdm
Fix docs.rs build

docs.rs fails to build `core-graphics`. This adds metadata to let it know to build on an Apple platform.
2020-08-26 12:37:58 -04:00
Kornel Lesiński 71a0d68abf Fix docs.rs build 2020-08-26 17:28:10 +01:00
bors-servo 69c09ab8fd Auto merge of #403 - jrmuizel:separate-crates, r=jdm
Separate out some new crates

This spits out core-graphics-types and cocoa-foundation with the goal of reducing the amount of interdependence between the crates with goal of reducing churn when things need to be updated.

cocoa-foundation should be enough for metal-rs and gfx-metal-backend.

Originally, I had wanted core-graphics-types to be enough for core-text but it's use of CGContext prevents that.
2020-07-18 10:47:30 -04:00
Jeff Muizelaar edb7a8c7fc Add cocoa-foundation crate
This should let gfx-metal-rust avoid depending on core-graphics
2020-07-17 22:48:21 -04:00
Jeff Muizelaar c03f281b84 Add a new core-graphics-types crate
This should help us avoid dependency churn.
2020-07-17 16:00:56 -04:00
bors-servo e4ac55e090 Auto merge of #402 - jrmuizel:data-provider, r=jdm
Make CGDataProvider::from_buffer more generic

This lets us use more types than just Vec<u8> and should avoid any
compatibility breaks. It also adds a test that ensures
the memory gets released.
2020-07-16 18:23:16 -04:00
Jeff Muizelaar 8bf741bc82 Make CGDataProvider::from_buffer more generic
This lets us use more types than just Vec<u8> and should avoid any
compatibility breaks. It also adds a test that ensures
the memory gets released.
2020-07-16 18:07:33 -04:00
bors-servo dac5ce1014 Auto merge of #400 - servo:jdm-patch-6, r=jdm
Publish core-text 18.0.1.

This incorporates #399.
2020-06-30 10:54:35 -04:00
Josh Matthews 0dec27a0fa Publish core-text 18.0.1. 2020-06-30 10:53:56 -04:00
bors-servo a19c9d8f50 Auto merge of #391 - servo:no-gleam-iosurface, r=jrmuizel
Remove gleam dependency from io-surface.

Fixes #371.
2020-06-30 08:26:38 -04:00
Josh Matthews 68ddb7e51d Remove gleam dependency from io-surface. 2020-06-30 08:26:14 -04:00
bors-servo 3f7e516fda Auto merge of #399 - cmyr:use-get-rule, r=jdm
Use wrap_under_get_rule where expected

I had initially thought I could skip a retain in these cases since
we can trivially track the lifetime of the reference, but I ran into
a segfault in a test that used the empty string, which I tracked
down to here.

I'm not totally sure what's actually going on under the hood, but I
do know that this fixes my crash and also that I was being overly
clever anyway.
2020-06-29 15:19:10 -04:00
Colin Rofls a7075f3b9d Use wrap_under_get_rule where expected
I had initially thought I could skip a retain in these cases since
we can trivially track the lifetime of the reference, but I ran into
a segfault in a test that used the empty string, which I tracked
down to here.

I'm not totally sure what's actually going on under the hood, but I
do know that this fixes my crash and also that I was being overly
clever anyway.
2020-06-29 15:06:27 -04:00
Josh Matthews 762a01b90f Major version update for core-foundation-sys and all other dependencies. 2020-06-29 11:45:17 -04:00
Josh Matthews aa69b91def Add missing major version changes. 2020-06-29 11:27:35 -04:00
Josh Matthews 7487580958 Publish core-foundation-sys 0.7.2. 2020-06-29 11:23:29 -04:00
bors-servo 40a787f0e6 Auto merge of #397 - servo:major-bump, r=jdm
Major version change for core-foundation.

https://github.com/servo/core-foundation-rs/commit/b68e9c782af87534d50596d7c2a7b965e067eaef changed a public API, so we can't have a minor version change.
2020-06-29 11:06:02 -04:00