Commit Graph

75 Commits

Author SHA1 Message Date
Mads Marquart 61b90e72da Deprecate cocoa, cocoa-foundation and io-surface and link to objc2 crates instead (#731)
* Deprecate cocoa-foundation

* Deprecate cocoa

* Deprecate io-surface
2025-05-16 16:46:10 +00:00
Gaauwe Rombouts f6e7580a35 fix: update NSWindowTabbingMode enum values (#714)
Signed-off-by: Gaauwe Rombouts <gromdroid@gmail.com>
2024-11-12 23:52:58 +00:00
Mads Marquart 6541d9a789 Fix invalid msg_send! (#702) 2024-08-13 12:04:01 +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
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
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
George Burton abbcc1eea5 Update bitflags to 2.2.1 (#549) 2024-04-09 08:47:41 +00: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
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
Bruce Mitchener 18df9aafe7 Some clippy fixes. (#624) 2023-08-03 14:20:26 +00:00
micolous b009c87f2d Auto-format code with "cargo fmt" and check in CI (#615)
* add rustfmt check to CI

* Run "cargo fmt" (rustfmt) over core-foundation-rs
2023-07-25 02:22:25 +00:00
Alexander Polakov e3a77bfee4 cocoa: add NSAppearance 2023-02-26 14:55:50 +04:00
Gkirito 79b2417bc2 🌟 feat(cocoa/src/appkit): add NSVisualEffectView 2023-02-20 00:31:37 +08:00
bors-servo bb8852eff8 Auto merge of #516 - keiya01:fix/use-animate-set-frame, r=jdm
fix: add animate property to NSWindow:setFrame:

I added animate property to `NSWindow:setFrame:`.
If this behavior is intended, I'm sorry but please close this PR.
2022-08-16 21:43:32 -04:00
bors-servo 7185556f5c Auto merge of #519 - mantou132:docktile, r=jdm
Add `NSDockTile`

init https://developer.apple.com/documentation/appkit/nsdocktile

example:
```rs
let dock_tile: cocoa::base::id = msg_send![NSApp(), dockTile];
NSDockTile::set_shows_applicatin_badge(dock_tile, cocoa::base::YES);
NSDockTile::setBadgeLabel_(dock_tile, NSString::alloc(nil).init_str("9"));
```
2022-08-16 21:39:39 -04:00
Josh Matthews e64eab3eca Merge pull request #508 from maxichrome/master
Add NSWindowToolbarStyle bindings
2022-08-15 09:41:17 -02:30
wangxianqiao f10db81e85 Add NSDockTile 2022-06-29 22:18:43 +08:00
keiya01 0df00e0543 fix: add animate property to NSWindow:setFrame: 2022-06-28 08:57:37 +09:00
bors-servo 614d43aa54 Auto merge of #510 - pevers:fix-set-tooltip, r=jrmuizel
fix: setToolTip wrong method invocation

This fixes the `setToolTip` method on the `NSTabViewItem`. It should be `setToolTip`, not `setTooltip`.
2022-06-14 09:34:46 -04:00
Adrian Hupka 01169af4e2 Added setWorksWhenModal to NSPanel trait 2022-06-03 19:01:08 +02:00
Adrian Hupka dd1135e599 AddNSPanel trait to create NSPanels
Intention for PR described here: https://github.com/servo/core-foundation-rs/issues/511
2022-06-03 16:17:32 +02:00
Peter Evers 3ede1dd222 fix: typo in setToolTip 2022-05-29 17:31:12 +02:00
maxichrome a4aac2645b attempt to add toolbar style 2022-05-23 00:32:06 -05:00
Josh Channings 29a7e2d265 Add binding for NSWindow::isDocumentEdited()
Getter for the existing setDocumentEdited() binding.
I've tested both via an in-progress change to tauri-apps/tao
2022-01-17 19:20:24 +00:00
youngsing 9b7c820c33 Update NSAppKitVersionNumber 2021-12-23 15:50:19 +08:00
bors-servo 2ae6b790de Auto merge of #455 - xiaopengli89:fix-window-number-at-point, r=jrmuizel
fix: windowNumberAtPoint_belowWindowWithWindowNumber_

[windowNumber(at:belowWindowWithWindowNumber:)](https://developer.apple.com/documentation/appkit/nswindow/1419210-windownumber) is a type method.
2021-11-02 16:22:45 -04:00
Max Brunsfeld 39e1e0eeef Add NSSavePanel binding 2021-05-04 13:44:19 -07:00
李小鹏 afb2f80ef3 feat: NSRunningApplication::runningApplicationWithProcessIdentifier 2021-04-13 18:51:29 +08:00
李小鹏 147a432fa9 fix: windowNumberAtPoint_belowWindowWithWindowNumber_ is class method 2021-04-13 18:25:42 +08:00
Max Brunsfeld 52b7bc0a70 Add NSOpenPanel binding 2021-04-08 21:59:54 -07:00
adamnemecek 970b27b9b7 added nscursor 2021-01-15 19:14:39 -08:00
Simon Hausmann 3743b68172 Add API for NSView's layerContentsPlacement property 2020-09-04 17:04:19 +02: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
Kornel acf2c86930 Fix style warnings 2020-05-08 11:42:06 +01:00
bors-servo 76f9053a89 Auto merge of #375 - casperstorm:feat/extended-nsprogressinfo, r=jdm
feat: extended NSProgressInfo with more functions

I have extended `NSProgressInfo` with two new functions:

* [`operatingSystemVersion`](https://developer.apple.com/documentation/foundation/nsprocessinfo/1410906-operatingsystemversion?language=objc) which returns a `NSOperatingSystemVersion` where you can get `majorVersion`, `minorVersion` and `patchVersion` from.

* [`isOperatingSystemAtLeastVersion`](https://developer.apple.com/documentation/foundation/nsprocessinfo/1414876-isoperatingsystematleastversion?language=objc) which takes a `NSOperatingSystemVersion` struct, and returns a `bool`.

Let me know if I missed something.
2020-05-06 10:08:38 -04:00
Casper Storm bdefcd927e feat: extended NSProgressInfo with more functions 2020-05-06 13:22:06 +02:00
Casper Storm 9c4b5c9310 feat: added binding to NSUserDefaults 2020-04-29 12:22:51 +02:00
Christian Duerr c31f6bd166 Add isKeyWindow function to NSWindow 2020-03-01 21:39:01 +01:00
not_a_seagull 0bc3b53667 Add new methods to NSView 2020-02-13 15:23:06 -08: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
svoss 4372c047e6 Adds setTarget to buttons and menu items, these are required in many cases 2019-09-25 06:41:07 -07:00
Aleksi Juvani 552021c096 Fix i686-apple-darwin compile target 2019-08-22 21:56:34 +03:00
Sean Voss 4885ac1384 Adds Image View Support 2019-07-22 15:28:55 -07:00
Felix Rabe 8bc0ed06cb Fix NSColor argument order: r b<->g 2019-07-14 23:20:33 +02: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
Colin Rofls 0d56822550 Add isARepeat 2019-06-07 11:45:24 +02: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