Commit Graph

118 Commits

Author SHA1 Message Date
Nabil Elqatib f57966fd36 Publish core-foundation-sys, core-foundation 2021-10-12 13:43:34 +02:00
bors-servo f7e0b97e0b Auto merge of #436 - AsafFisher:master, r=jrmuizel
Add CGEventTap

https://github.com/servo/core-graphics-rs/issues/111
2021-05-26 13:18:34 -04:00
Jeff Muizelaar ce17c9aa59 Add CFData::from_arc
This allows creating a zero-copy CFData wrapping existing data.
2021-02-14 11:52:04 -05:00
Makoto Kato 2fe22f8c98 Add CFStringCreateWithCharactersNoCopy 2021-01-26 13:59:23 +09:00
Asaf Fisher edb187a17c core-foundation: Add basic CFMachPort 2021-01-23 03:24:30 +02:00
Yu Shimura 437be24cdb CFBundleCopyResourcesDirectoryURL 2020-10-14 11:10:39 +09: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
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
Kornel Lesiński 71a0d68abf Fix docs.rs build 2020-08-26 17:28:10 +01: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 7487580958 Publish core-foundation-sys 0.7.2. 2020-06-29 11:23:29 -04:00
Bryan Burgers a4e2983219 Add CFTimeZone::name
Add a `name` method to `CFTimeZone` to get the time zone ID (e.g.,
"America/Los_Angeles") of the current time zone.

Core Foundation calls this "name" instead of "id" in its method
signatures, but acknowledges it in the closely-related NSTimeZone
related docs. Since most of the other methods in this library match
closely with CF naming, also use `name` here.

> Time zone database entries such as “America/Los_Angeles” are IDs, not
> names. An example of a time zone name is “Pacific Daylight Time”.
> Although many NSTimeZone symbols include the word “name”, they
> actually refer to IDs.
2020-06-29 07:18:58 -05:00
Adam Perry 9c264d2904 Bump core-foundation(-sys) to 0.7.1 for release. 2020-06-28 09:44:43 -07:00
bors-servo 14ee94aef7 Auto merge of #359 - roblabla:cfset-missing-methods, r=jdm
CFSet: Add missing methods in -sys

Adds a handful of missing methods from the CFSet family.
2020-05-17 12:50:08 -04:00
Kornel 6ded5c360f CFBundleCopyBundleURL 2020-05-08 11:38:31 +01:00
brunohgouveia 1f4c983cee Add missing APIs to CTLine 2020-04-13 21:25:53 +01:00
roblabla 63a8dc37c3 CFSet: Add missing methods in -sys 2020-03-21 18:34:08 +00:00
Vasiliy Badanov aa6d1cd4c1 Fix for link error "Undefined symbols for architecture x86_64: _CFMutableAttributedStringGetTypeID" 2020-02-21 23:40:36 +03:00
Wez Furlong cf3659fc6f Fix CFRunLoop types to avoid UB
A number of callback functions associated with the CFRunLoop types are
allowed to be NULL to evoke default behavior.

Prior to this commit the definition of those structs prevented passing
in null which meant resorting to transmute or other tricks to
effectively set null, but with recent compiler versions the compiler
emits `ud2` instructions and triggers a fault at runtime.

The correct resolution for this is to define these fields as `Option`al
callbacks and that is what this commit does.

I've used this approach successfully here in another project:
Refs: https://github.com/wez/wezterm/commit/398f333c32fb1ff4ccd9cc001a66ae22522eb60c

I've bumped up the version for the crate as part of this commit
because it effectively changes the API around these structs.
2019-11-11 19:57:48 -08:00
Josh Matthews ae995daaab Minor version update for core-foundation-sys and core-foundation. 2019-11-05 12:54:59 +01:00
Wesley Moore b2a4a0e566 Add CFDataGetBytes to CFData bindings 2019-10-15 09:53:39 +11:00
Wesley Moore 35e3e5b5c1 Add CFCharacterSet to core-foundation-sys 2019-10-10 15:33:37 +11:00
Aleksi Juvani 552021c096 Fix i686-apple-darwin compile target 2019-08-22 21:56:34 +03:00
Eike Siewertsen 1a0e69872a add shared_support_url to CFBundle 2019-08-05 10:50:58 +02:00
Bruce Mitchener d2d3b3362a Refer to macOS rather than OS X. 2019-03-14 17:47:00 +07:00
acheronfail cf356f6c61 chore: add CF functions for using bookmark data
fixes #116 (a closed issue)
2018-11-09 12:20:09 +11:00
Jeff Muizelaar 0b377a959b Bump the versions of a bunch crates. 2018-09-28 13:19:37 -04:00
Jeff Muizelaar 4fe550a8fc Bump minor version of core-foundation for past changes. 2018-07-12 10:14:25 -04:00
Ryan Leckey 1d369075c3 Add CF(Mutable)AttributedString and a couple helpers 2018-07-06 12:25:18 -07:00
Jeff Muizelaar bb9ce9e8e1 Update all of the major versions for the new releases
Basically everything needed to be bumped because of changes to
core-foundation-sys
2018-05-02 17:46:00 -04:00
Bruce Mitchener 7e7d65bb4d Reduce usage of libc crate.
Switch from using `libc` types to `::std::os::raw`. This is a breaking
change due to the differences in how `c_void` is defined.

`core-foundation-sys` no longer needs the `libc` dependency.
2018-02-01 20:39:10 +07:00
Bruce Mitchener bf3a9c89bd Add missing license headers to src files. 2018-02-01 09:32:29 +07:00
bors-servo ff67c15632 Auto merge of #153 - servo:updateversion, r=jdm
Bump version to 0.5.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/153)
<!-- Reviewable:end -->
2018-01-26 13:01:11 -06:00
Josh Matthews 5d7753a78a Bump version to 0.5.1. 2018-01-26 13:48:25 -05:00
Josh Matthews 53609f26ac Respect const/mut of system headers. 2018-01-26 13:46:06 -05:00
Linus Färnstrand 7e87a9d8fa Bump version to 0.5.0 2018-01-24 08:57:50 +01:00
Linus Färnstrand 3aa63aa5b7 Add TCFTypeRef trait 2018-01-23 22:35:52 +01:00
Linus Färnstrand 249300d8ab Change CFErrorRef to *const ptr instead of *mut 2018-01-23 22:35:52 +01:00
bors-servo 2d35ed2d49 Auto merge of #84 - trlim:filedescriptor, r=jdm
Add bindings for `CFFileDescriptor`

This pull request adds implementation of `CFFileDescriptor` and `CFRunLoopSource` related API.

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

<!-- Reviewable:end -->
2018-01-20 17:17:36 -06:00
bors-servo a4cee535b6 Auto merge of #144 - Nemo157:publish-licenses, r=jdm
Include license files in packages

<!-- 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/144)
<!-- Reviewable:end -->
2018-01-20 13:01:36 -06:00
Wim Looman 6bf580ee28 Include license files in packages 2018-01-17 20:52:01 +01:00
Tae-il Lim 530f732ce8 Implement CFFileDescriptor 2018-01-15 14:35:16 +09:00
Dan Glastonbury 6a77e377ba Add CFMutableDictionary type.
Added CFMutableDictionary that presents the mutable dictionary
functions of CF. Tries to present a similar interface as CFDictionary.

Fixes issue #93.
2017-11-29 12:50:05 +10:00
Linus Färnstrand c33598dc99 Bump version to 0.4.6 2017-11-28 16:46:33 +01:00
Anthony Ramine cc66c00ac3 Bump core-foundation-sys version to 0.4.5
This is needed to publish a new core-foundation-rs version.
2017-11-27 14:30:18 +01:00