Commit Graph

2152 Commits

Author SHA1 Message Date
Bruce Mitchener 84b8365425 Use CFIndex::MAX rather than CFIndex::max_value() (#699)
Since `CFIndex` is just `isize`, we can use the `CFIndex::MAX`
constant. The `max_value` and other functions are pending
deprecation and cause a clippy lint warning.
2024-08-12 02:42:23 +00:00
Bruce Mitchener 9d6b64153d ci: Add typos check (#697) 2024-08-12 01:28:59 +00:00
Bruce Mitchener e513e990dc Correct screen capture access return values. (#698)
Both `CGRequestScreenCaptureAccess` and `CGPreflightScreenCaptureAccess`
return `bool`, not `boolean_t`.

Fixes #677.
Replaces #678.
2024-08-12 01:27:32 +00:00
Bruce Mitchener b10b72c0cc core-foundation: Use dep syntax for with-uuid feature. (#691)
This removes an implicit feature due to the optional dependency
`uuid`.

While this is user visible, any use of `uuid` as a feature previously
would not have enabled the support code and so it wouldn't have had
any benefit.
2024-08-11 20:25:03 +00:00
Bruce Mitchener 4dac7cfd68 core-graphics-types: Remove dep on bitflags (#695)
This is unused.
2024-08-11 20:24:38 +00:00
Bruce Mitchener 9f33b121fb Use core::ffi over std::os::raw and libc::c_* (#692)
`core::ffi` is the preferred way to access these type definitions.
Begin removing uses of the versions from `libc`.

`libc::c_void` is not exactly the same as `core::ffi::c_void` but
some code has tried using them interchangeably (like in io-surface).

`libc::size_t` is `usize` on all current platforms.
2024-08-11 20:24:22 +00:00
Bruce Mitchener 42ec06106d Bump MSRV to 1.65 (#694)
This will allow us to use `dep:` syntax and also move to using types
from `core::ffi` as well as some other more modern constructs.
2024-08-11 16:15:49 +00:00
Xiaopeng Li b10f1efc48 Retain calayer after creation (#546)
* Retain calayer after creation

* Fix fmt

* fix create_calayer test
2024-08-09 16:48:56 +00:00
Ngo Iok Ui (Wu Yu Wei) 652bab0a62 Bump version of core-foundation-sys to 0.8.7 (#683)
* Bump version of core-foundation-sys to 0.9.0

* Bump patch version instead
2024-08-09 16:47:06 +00:00
Marco Mastropaolo f94fa25c02 Added ffi bindings for CGDisplayRegisterReconfigurationCallback and related types/funcs (#687) 2024-08-02 06:15:35 +00:00
Bruce Mitchener 31a92cd2fc Fix typos. (#689) 2024-07-20 10:26:35 +00:00
Bruce Mitchener 2847e06cf5 core-graphics: Fix kCGWindowSharingReadWrite value (#690) 2024-07-20 10:25:46 +00:00
Kornel 3570256ecc Avoid UB if the CFData pointer is NULL (#688) 2024-07-14 17:50:44 +00:00
Marco Mastropaolo 8002ddd167 Fixes a minor race condition in active_displays (#686)
Fixes a minor race condition in active_displays that might happen
	if a display is removed between the active_display_count and the
	CGGetActiveDisplayList. In that case the returned vec would be
	inconsistent and contain one (or more) spurious null displays.

	Note: the returned value will always be subject to TOC/TOU,
	of course, but this specific case has the returned value
	containing invalid displays with id=0 that were never supposed
	to be in the returned value in any possible state of the
	displays; this commit fixes this case.
2024-06-18 14:39:29 +00:00
Bruce Mitchener 6940925635 Remove remaining chrono code. (#682)
In 9721646053, the `with-chrono`
feature was removed, but this dead code lingered.
2024-05-27 07:01:47 +00:00
Bruce Mitchener c2cca87e8c ci: Remove usage of macos-11 (#681)
* ci: Remove usage of macos-11

This is being removed at GitHub on June 28, 2024.

Switch semver action to macos-14.

* Use `macos-14` instead of `macos-14.0` for semver check

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-05-27 06:47:45 +00:00
Bruce Mitchener 8d2b732db5 Remove usages of extern crate. (#672) 2024-05-27 06:40:54 +00:00
Lukas Santner a496791d62 update NSAppKitVersionNumbers (#673) 2024-05-23 13:40:44 +00:00
simlay f49a4a5f91 Fix rustfmt for ci (#680) 2024-05-23 02:16:38 +00:00
David Stern 32368020b6 core-text: Implement CTRunGetTypographicBounds. (#675) 2024-05-23 02:05:58 +00:00
simlay fb8fd65eef Add visionOS and watchOS to linking to CoreFoundation framework (#679) 2024-05-22 16:06:06 +00:00
David Stern e5162be4fa core-text: Implement CTFontGetMatrix. (#674) 2024-04-30 00:42:50 +00:00
Bruce Mitchener dec5ede821 clippy: Fix clippy::mixed_attributes_style lint. (#671) 2024-04-29 01:39:36 +00:00
Dirkjan Ochtman 199badc40f Fix support for macOS 14 (#668)
* core-text: define version variable and dbg!() it

Note that this test already has a number of dbg!() calls, presumably
to aid debugging when it fails in the future (for example due to
OS changes).

* core-text: extract helper function in test

* core-text: improve assertion to make failure easier to diagnose

* core-text: allow variations test to pass on 14.x.y

* CI: test on macOS 14

* CI: only test old Rust on one version
2024-04-16 09:47:06 +00:00
Bruce Mitchener 48d6bdf9be Update uuid dep to 1.x (#228)
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-09 11:00:07 +00:00
Jeff Muizelaar 408497e534 Add some links to other alternatives (#449) 2024-04-09 09:22:53 +00:00
George Burton abbcc1eea5 Update bitflags to 2.2.1 (#549) 2024-04-09 08:47:41 +00:00
Alex Touchet f9440bcddb Update/remove obsolete badges and update link (#663) 2024-04-08 10:27:33 +00:00
Dirkjan Ochtman 9721646053 foundation: remove optional chrono dependency (#666)
* foundation: remove optional chrono dependency

* Bump version numbers for semver-incompatible changes
2024-04-08 10:20:45 +00:00
Martin Robinson d7879eb353 core-graphics: Add more metrics functions to CGFont (#661) 2024-04-04 19:28:23 +00:00
Jeff Muizelaar dd284a07f4 Bump the patch version. (#662)
The change to kCGWindowListOptionAll was technically semver breaking
but the constants were wrong before so it should be fine.
2024-04-04 17:14:38 +00:00
Martin Robinson 9b4af6e91e Rename master branch to main (#658)
This is in line with a decision made about the Servo organization by the Servo TSC. We consider `main` to be shorter, easier to type, and more modern, so we are standardizing on this branch name.
2024-04-04 14:40:42 +00:00
nashaofu 0933af08be fix: Correcting errors in window CGWindowListOption values (#653) 2024-01-13 12:21:17 +00:00
Jeff Muizelaar d4ce710182 Bump required version of core-foundation for link feature 2023-11-30 17:06:49 -05:00
Jeff Muizelaar 795398aa37 Bump the version of core-foundation and the dependency on core-foundation-sys 2023-11-30 10:56:38 -05:00
Ryo "Genbuchan" Shigematsu 64dd01a6a9 NSScreen (cocoa): Add maximumRefreshInterval and minimumRefreshInterval (#646) 2023-11-24 06:55:29 +00:00
Bruce Mitchener 58972aef0a Update to 2018 edition. (#642)
This is the minimum fix required. It updates to use crate-relative
imports.
2023-10-24 00:30:22 +00:00
Jeff Muizelaar eb41f50561 Bump core-graphics-types version 2023-10-12 09:35:29 -04:00
Bruce Mitchener 723886f243 Only import SInt32 on macOS. (#641)
It is only used on macOS, so having it when building for other
targets (like iOS) results in a warning.
2023-10-10 16:13:57 +00:00
Bruce Mitchener 6484a6e9ac ci: Update to actions/checkout@v4 (#640) 2023-10-10 15:26:05 +00:00
Bruce Mitchener 3ff7cc2795 docs: Fix various markdown issues. (#639) 2023-10-10 15:22:46 +00:00
Leo Kettmeir c4f4ad20b6 feat: add link feature (#608)
adjust docs

Update cocoa/Cargo.toml

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>

fmt
2023-10-10 14:46:20 +00:00
Jeff Muizelaar fbde5035c3 Bump cocoa-foundation version 2023-09-22 10:35:29 -04:00
jfkthame 5be8e2cd8f Bump core-text version (#638)
Just exposing a couple of additional APIs.

(Motivation: to enable us to try using the `_and_options` API when instantiating fonts in webrender, for https://bugzilla.mozilla.org/show_bug.cgi?id=1803406.)
2023-09-22 14:00:13 +00:00
jfkthame 099bd27d93 rustfmt fixes (#637) 2023-09-19 20:33:28 +00:00
jfkthame 91fb8c385a Expose the CTFont-creation functions with options parameter (#636) 2023-09-19 19:41:56 +00:00
Bruce Mitchener e589abe82e Make license files consistent. (#625)
Each crate now has a symlink to the root level license files.
Previously, some did, some had copies, and some had nothing.

Fixes #503.
2023-08-13 12:20:16 +00:00
micolous 2ead1f968d Run tests for MSRV, on macOS versions, and fix toolchain (#614)
* run tests on MSRV, for all macOS versions

* use dtolnay/rust-toolchain rather than unmaintained actions-rs/toolchain

* remove "msrv" build target as blocker for build result, as it is part of build

* update outdated actions/checkout
2023-08-13 12:18:12 +00:00
Bruce Mitchener b6d2529ca9 More clippy fixes. (#629) 2023-08-07 17:42:26 +00:00
Bruce Mitchener 855319c0e2 Apple renamed CTFontOrientation values. (#630)
* `kCTFontDefaultOrientation` -> `kCTFontOrientationDefault`
* `kCTFontOrientationHorizontal` -> `kCTFontOrientationHorizontal`
* `kCTFontOrientationVertical` -> `kCTFontOrientationVertical`

The old names were deprecated in macOS 10.11, iOS 9. The new names
were introduced in macOS 10.8, iOS 6.

Fixes #438.
2023-08-07 17:41:35 +00:00