Skip to content

Commit fbfbf32

Browse files
committed
Add IOKit graphics submodule
1 parent 6af228c commit fbfbf32

File tree

7 files changed

+53
-4
lines changed

7 files changed

+53
-4
lines changed

crates/header-translator/src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl Expr {
248248
if ident == "CFSTR" {
249249
Token::CFStringBegin
250250
} else if ident == "CFUUIDGetConstantUUIDWithBytes" {
251-
i += tokens.len();
251+
i = tokens.len() - i - 1;
252252
Token::CFUUID("todo".into())
253253
} else if let Some(expr) = declaration_references.get(&ident) {
254254
Token::Expr(expr.clone())

crates/objc2/src/topics/about_generated/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4848
- `IntentsUI` / `objc2-intents-ui`.
4949
- `IOBluetooth` / `objc2-io-bluetooth`.
5050
- `IOBluetoothUI` / `objc2-io-bluetooth-ui`.
51-
- `IOKit` / `objc2-io-kit` (currently only `usb` submodule).
51+
- `IOKit` / `objc2-io-kit` (currently only `usb` and `graphics` submodules).
5252
- `IOUSBHost` / `objc2-io-usb-host`.
5353
- `iTunesLibrary` / `objc2-itunes-library`.
5454
- `JavaScriptCore` / `objc2-java-script-core`.

framework-crates/objc2-io-kit/Cargo.toml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

framework-crates/objc2-io-kit/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ pub(crate) type Boolean = u8;
3939
pub(crate) type AbsoluteTime = i32;
4040
#[allow(dead_code)]
4141
pub(crate) type NumVersion = u32; // Actually a struct with 4 u8s
42+
#[allow(dead_code)]
43+
pub(crate) type FourCharCode = u32;
4244

4345
// device/device_types.h
4446
#[allow(dead_code, non_camel_case_types)]

framework-crates/objc2-io-kit/src/macros.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ macro_rules! iokit_usb_msg {
5151
};
5252
}
5353

54+
macro_rules! IO_FOUR_CHAR_CODE {
55+
($code:expr) => {
56+
$code
57+
};
58+
}
59+
5460
pub(crate) use err_sub;
5561
pub(crate) use err_system;
5662
pub(crate) use iokit_common_msg;
@@ -66,3 +72,4 @@ pub(crate) use IOUSBBitRange as IOUSBHostFamilyBitRange;
6672
pub(crate) use IOUSBBitRangePhase;
6773
pub(crate) use IOUSBBitRangePhase as USBBitRangePhase;
6874
pub(crate) use IOUSBBitRangePhase as IOUSBHostFamilyBitRangePhase;
75+
pub(crate) use IO_FOUR_CHAR_CODE;

framework-crates/objc2-io-kit/translation-config.toml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ visionos = "1.0"
1111
module.audio.skipped = true
1212
module.avc.skipped = true
1313
module.firewire.skipped = true
14-
module.graphics.skipped = true
1514
module.hid.skipped = true
1615
module.hidsystem.skipped = true
1716
module.i2c.skipped = true
@@ -104,6 +103,8 @@ const.kUSBDeviceContainerID.skipped = true
104103
const.kIOUSB30Bitrate5Gbps.skipped = true
105104
const.kIOUSB30Bitrate10Gbps.skipped = true
106105
const.kIOUSB32Bitrate20Gbps.skipped = true
106+
const.kIODisplayModeIDBootProgrammable.skipped = true
107+
const.kIODisplayModeIDReservedBase.skipped = true
107108

108109
# Emit these.
109110
const.IO1BitIndexedPixels.skipped = false
@@ -117,3 +118,35 @@ const.IO8BitOverlayPixels.skipped = false
117118
const.IOPagedPixels.skipped = false
118119
const.IO_SampleTypeAlpha.skipped = false
119120
const.IO_SampleTypeSkip.skipped = false
121+
122+
# https://github.com/shurizzle/rust-four-char-code/issues/2
123+
const.kConnectionIgnore.skipped = true
124+
const.kConnectionControllerDepthsSupported.skipped = true
125+
const.kConnectionControllerColorDepth.skipped = true
126+
const.kConnectionControllerDitherControl.skipped = true
127+
128+
# Needs OSSpinLock
129+
struct.StdFBShmem_t.skipped = true
130+
typedef.StdFBShmem_t.skipped = true
131+
struct.IOGraphicsEngineContext.skipped = true
132+
typedef.IOGraphicsEngineContext.skipped = true
133+
const.kIOGraphicsEngineContext.skipped = true
134+
const.kIOGraphicsEngineContextVersion.skipped = true
135+
struct._NXEQElStruct.skipped = true
136+
typedef._NXEQElStruct.skipped = true
137+
struct._evGlobals.skipped = true
138+
typedef._evGlobals.skipped = true
139+
const.IOSharedLockData.skipped = true
140+
const.ev_lock_data_t.skipped = true
141+
142+
# Needs `task_port_t` to be available in `libc`
143+
fn.IOFramebufferOpen.skipped = true
144+
145+
# Unknown ABI
146+
typedef.IOPixelEncoding.skipped = true
147+
struct.IOPixelInformation.skipped = true
148+
typedef.IOPixelInformation.skipped = true
149+
struct.bm12Cursor.skipped = true
150+
struct.bm18Cursor.skipped = true
151+
struct.bm34Cursor.skipped = true
152+
struct.bm38Cursor.skipped = true

generated

0 commit comments

Comments
 (0)