Commit Graph

1957 Commits

Author SHA1 Message Date
George Burton 6215a8bb2b cocoa-foundation crate does not depend on foreign-types 2023-04-25 22:33:18 +01:00
George Burton 6ddf5cadcc Update foreign-types crate to v0.5 2023-04-25 22:15:52 +01:00
bors-servo 30ffd6a158 Auto merge of #543 - atouchet:lic, r=jdm
Use SPDX license format

None
2023-04-04 04:10:28 +02:00
Alex Touchet 1632edee66 Use SPDX license format 2023-04-02 22:43:22 -07:00
bors-servo f7d16c9685 Auto merge of #542 - jrmuizel:cf-sys-bump, r=jdm
Bump minor version of core-foundation-sys to 0.8.4

None
2023-04-02 22:23:22 +02:00
Jeff Muizelaar 0b46a8dae4 Bump minor version of core-foundation-sys to 0.8.4 2023-04-02 13:43:46 -04:00
bors-servo d22e809486 Auto merge of #541 - joshleeb:joshleeb-graphics-tap_post_event, r=jdm
Add binding for CGEventTapPostEvent

This change adds the binding for CGEventTapPostEvent and adds a wrapper function CGEvent::post_from_tap to call the core-graphics function.
2023-03-21 13:29:58 +01:00
Josh Leeb-du Toit 49aa01d437 Add binding for CGEventTapPostEvent
This change adds the binding for CGEventTapPostEvent and adds a wrapper
function CGEvent::post_from_tap to call the core-graphics function.
2023-03-21 15:38:43 +11:00
bors-servo 0876315e2e Auto merge of #539 - polachok:appearance, r=jdm
cocoa: add NSAppearance

Fixes https://github.com/servo/core-foundation-rs/issues/515
2023-02-26 16:07:16 +01:00
Alexander Polakov e3a77bfee4 cocoa: add NSAppearance 2023-02-26 14:55:50 +04:00
bors-servo 65eccd9e79 Auto merge of #538 - Gkirito:feature/add-NSVisualEffectMaterial, r=jdm
Add NSVisualEffectView

Add NSVisualEffectView
Related issues #463
2023-02-20 13:55:18 +01:00
Gkirito 8bbdd5fd4c 🧪 test(cocoa/examples/nsvisualeffectview_blur): add an example for NSVisualEffectView 2023-02-20 00:33:13 +08:00
Gkirito 79b2417bc2 🌟 feat(cocoa/src/appkit): add NSVisualEffectView 2023-02-20 00:31:37 +08:00
bors-servo 8c2444066a Auto merge of #533 - AlexanderEkdahl:patch-1, r=jdm
Add all color space names

Adds all of the non-deprecated color space names found at: https://developer.apple.com/documentation/coregraphics/cgcolorspace/color_space_names

This is required for EDR (Extended Dynamic Range) rendering.
2022-12-25 10:27:58 -05:00
Alexander Ekdahl 6a0cbbfb3d Add all color space names
Adds all of the non-deprecated color space names found at: https://developer.apple.com/documentation/coregraphics/cgcolorspace/color_space_names
2022-12-24 00:41:31 +01:00
Liu Hancheng 7868956431 add CGRectContainsPoint and wrapped method 2022-11-01 09:01:36 -04:00
Mads Marquart 498ba0a76f Revert cocoa version bump
39e1e0e is not a breaking change since the NSOpenPanel API has not been published in any stable version.

147a432 is a clear bugfix and didn't work at all before, so while it is breaking public API, no-one could have used it without their program being broken.
2022-11-01 09:00:31 -04:00
Hein Rutjes 342af5e6a9 Add CGContextResetClip 2022-10-07 07:43:07 -04:00
Hein Rutjes 3213c3e3f3 Add CGContextSetAlpha 2022-10-06 13:50:31 -04:00
JL 0c69dc41e3 feat: version bump for cocoa-rs
Version dump cocoa-rs to 0.25.0
2022-10-06 13:41:17 -04:00
bors-servo de8752262a Auto merge of #523 - madsmtm:cg-winit-ffi, r=jdm
Add CoreGraphics FFI used by `winit`

None
2022-09-05 07:45:39 -04:00
Mads Marquart 560da05fef Add CoreGraphics FFI used by winit 2022-09-05 13:33:55 +02: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
bors-servo e51cf4186d Auto merge of #512 - Hupka:master, r=jrmuizel
Fixes #511: Add`NSPanel` trait to create NSPanels

Intention for PR described here: https://github.com/servo/core-foundation-rs/issues/511.

I didn't extend any of the examples to include `NSPanel` because I think that's not really worth it. Instead, here is an adapted version of the `hello_world.rs` example that prints out responses of the API for both, `NSWindow` and `NSPanel`.

  ```Rust
extern crate cocoa;

use cocoa::appkit::{
    NSApp, NSApplication, NSApplicationActivateIgnoringOtherApps,
    NSApplicationActivationPolicyRegular, NSBackingStoreBuffered, NSMenu, NSMenuItem, NSPanel,
    NSRunningApplication, NSWindow, NSWindowStyleMask,
};
use cocoa::base::{nil, selector, NO};
use cocoa::foundation::{NSAutoreleasePool, NSPoint, NSProcessInfo, NSRect, NSSize, NSString};

fn main() {
    unsafe {
        let _pool = NSAutoreleasePool::new(nil);

        let app = NSApp();
        app.setActivationPolicy_(NSApplicationActivationPolicyRegular);

        // create Menu Bar
        let menubar = NSMenu::new(nil).autorelease();
        let app_menu_item = NSMenuItem::new(nil).autorelease();
        menubar.addItem_(app_menu_item);
        app.setMainMenu_(menubar);

        // create Application menu
        let app_menu = NSMenu::new(nil).autorelease();
        let quit_prefix = NSString::alloc(nil).init_str("Quit ");
        let quit_title =
            quit_prefix.stringByAppendingString_(NSProcessInfo::processInfo(nil).processName());
        let quit_action = selector("terminate:");
        let quit_key = NSString::alloc(nil).init_str("q");
        let quit_item = NSMenuItem::alloc(nil)
            .initWithTitle_action_keyEquivalent_(quit_title, quit_action, quit_key)
            .autorelease();
        app_menu.addItem_(quit_item);
        app_menu_item.setSubmenu_(app_menu);

        // create Window
        let window = NSWindow::alloc(nil)
            .initWithContentRect_styleMask_backing_defer_(
                NSRect::new(NSPoint::new(0., 0.), NSSize::new(200., 200.)),
                NSWindowStyleMask::NSTitledWindowMask,
                NSBackingStoreBuffered,
                NO,
            )
            .autorelease();
        window.cascadeTopLeftFromPoint_(NSPoint::new(20., 20.));
        window.center();
        let title = NSString::alloc(nil).init_str("Hello World!");
        window.setTitle_(title);
        window.makeKeyAndOrderFront_(nil);

        // create Panel
        let panel = NSPanel::alloc(nil)
            .initWithContentRect_styleMask_backing_defer_(
                NSRect::new(NSPoint::new(0., 0.), NSSize::new(200., 200.)),
                NSWindowStyleMask::NSTitledWindowMask,
                NSBackingStoreBuffered,
                NO,
            )
            .autorelease();
        panel.cascadeTopLeftFromPoint_(NSPoint::new(20., 20.));
        panel.center();
        let title = NSString::alloc(nil).init_str("Hello PANEL!");
        panel.setTitle_(title);
        panel.makeKeyAndOrderFront_(nil);

        // Specific behavior of NSWindow & NSPanel
        println!(
            "NSWindow can become main window: {}",
            window.canBecomeMainWindow()
        ); // returns true
        println!(
            "NSPanel can become main window? {}",
            panel.canBecomeMainWindow()
        ); // returns false

        // Test methods of NSPanel Trait
        println!(
            "BEFORE setting it: NSPanel is a floating panel: {}",
            panel.floatingPanel()
        ); // returns false
        println!(
            "BEFORE setting it: NSPanel becomes key only when needed: {}",
            panel.becomesKeyOnlyIfNeeded()
        ); // returns false

        panel.setFloatingPanel(true);
        panel.setBecomesKeyOnlyIfNeeded(true);

        println!(
            "AFTER: NSPanel is a floating panel: {}",
            panel.floatingPanel()
        ); // returns true
        println!(
            "AFTER: NSPanel becomes key only when needed: {}",
            panel.becomesKeyOnlyIfNeeded()
        ); // returns true

        let current_app = NSRunningApplication::currentApplication(nil);
        current_app.activateWithOptions_(NSApplicationActivateIgnoringOtherApps);
        app.run();
    }
}
```
2022-06-09 20:04:04 -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
Alex Touchet 5143684bb5 Fix listed core-graphics homepage 2022-05-26 08:25:16 -04:00
maxichrome a4aac2645b attempt to add toolbar style 2022-05-23 00:32:06 -05:00
bors-servo 0796658825 Auto merge of #482 - rectang:contribution-guidelines, r=jdm
Add basic contfibution guidelines to README

In #453, @pmj proposed bare-bones contribution guidelines, which were received favorably by @jrmuizel. This pull request insert's @pmj's proposed text into the top-level README.
2022-03-27 18:37:32 -04:00
bors-servo 29af672896 Auto merge of #500 - ssssota:master, r=jdm
Add get name function to CTFont

## Overview

Now we can get family name, full name, postscript name and some names.
But I want to use other names. (e.g. Copyright notice, License etc...)
So, I made `get_string_by_name_key` methods from helper function.
2022-03-27 18:01:05 -04:00
bors-servo 9941118f82 Auto merge of #502 - madsmtm:remove-build-script, r=jrmuizel
Remove build script from `core-foundation-sys`

Should result in faster build times
2022-03-21 23:15:12 -04:00
Mads Marquart f855f23902 Remove build script from core-foundation-sys
Should result in faster build times
2022-03-22 01:14:16 +01:00
ssssota b0e0dd8bf4 Add get name function 2022-02-16 12:09:01 +09:00
bors-servo 18b5e607c0 Auto merge of #498 - n-eq:patch-1, r=jrmuizel
Update Cargo.toml: cocoa-foundation - publish a new version (0.1.1)

Following this change https://github.com/servo/core-foundation-rs/commit/6e78ddfb8a18b2e0f88c330e1a08c7c1f8c6a71e
2022-02-08 11:51:05 -05:00
Nabil Elqatib 8d3c2cd870 Update Cargo.toml
Following this change https://github.com/servo/core-foundation-rs/commit/6e78ddfb8a18b2e0f88c330e1a08c7c1f8c6a71e
2022-02-07 21:47:39 +01:00
bors-servo 6642b11b4c Auto merge of #481 - n-eq:master, r=jrmuizel
Bump core-foundation crate version

Following https://github.com/servo/core-foundation-rs/pull/477
2022-02-07 09:42:34 -05:00
bors-servo f8f8a5867a Auto merge of #493 - joshchngs:nswindow-document-edited, r=jdm
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 14:55:22 -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
bors-servo f58166d728 Auto merge of #491 - ldm0:more_array, r=jdm
Add more functions to CFArray

None
2021-12-26 13:44:48 -05:00
Liu Dingming 09763eb8bd Add more functions to CFArray 2021-12-27 01:57:52 +08:00
bors-servo 669cb0c0f6 Auto merge of #489 - youngsing:master, r=jdm
Update NSAppKitVersionNumber

Version Number get from macOS 12.1 and Xcode 13.2

![Screen Shot 2021-12-23 at 15 51 50](https://user-images.githubusercontent.com/2562374/147207082-775b259c-6cba-4518-a7b3-627e212469ba.png)
2021-12-23 10:20:11 -05:00
youngsing 9b7c820c33 Update NSAppKitVersionNumber 2021-12-23 15:50:19 +08:00
bors-servo 6be86aa99f Auto merge of #488 - jrmuizel:ui-font, r=mstange
Expose bindings to CTFontCreateUIFontForLanguage

None
2021-12-13 15:23:31 -05:00
Jeff Muizelaar aee417874f Expose bindings to CTFontCreateUIFontForLanguage 2021-12-13 12:42:52 -05:00