objc2_app_kit/generated/
NSColorPicking.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 pub unsafe trait NSColorPickingDefault: MainThreadOnly {
13 #[cfg(all(
14 feature = "NSColorPanel",
15 feature = "NSPanel",
16 feature = "NSResponder",
17 feature = "NSWindow"
18 ))]
19 #[unsafe(method(initWithPickerMask:colorPanel:))]
20 #[unsafe(method_family = init)]
21 unsafe fn initWithPickerMask_colorPanel(
22 this: Allocated<Self>,
23 mask: NSUInteger,
24 owning_color_panel: &NSColorPanel,
25 ) -> Option<Retained<Self>>;
26
27 #[cfg(feature = "NSImage")]
28 #[unsafe(method(provideNewButtonImage))]
29 #[unsafe(method_family = none)]
30 unsafe fn provideNewButtonImage(&self) -> Retained<NSImage>;
31
32 #[cfg(all(
33 feature = "NSActionCell",
34 feature = "NSButtonCell",
35 feature = "NSCell",
36 feature = "NSImage"
37 ))]
38 #[unsafe(method(insertNewButtonImage:in:))]
39 #[unsafe(method_family = none)]
40 unsafe fn insertNewButtonImage_in(
41 &self,
42 new_button_image: &NSImage,
43 button_cell: &NSButtonCell,
44 );
45
46 #[unsafe(method(viewSizeChanged:))]
47 #[unsafe(method_family = none)]
48 unsafe fn viewSizeChanged(&self, sender: Option<&AnyObject>);
49
50 #[unsafe(method(alphaControlAddedOrRemoved:))]
51 #[unsafe(method_family = none)]
52 unsafe fn alphaControlAddedOrRemoved(&self, sender: Option<&AnyObject>);
53
54 #[cfg(feature = "NSColorList")]
55 #[unsafe(method(attachColorList:))]
56 #[unsafe(method_family = none)]
57 unsafe fn attachColorList(&self, color_list: &NSColorList);
58
59 #[cfg(feature = "NSColorList")]
60 #[unsafe(method(detachColorList:))]
61 #[unsafe(method_family = none)]
62 unsafe fn detachColorList(&self, color_list: &NSColorList);
63
64 #[cfg(feature = "NSColorPanel")]
65 #[unsafe(method(setMode:))]
66 #[unsafe(method_family = none)]
67 unsafe fn setMode(&self, mode: NSColorPanelMode);
68
69 #[unsafe(method(buttonToolTip))]
70 #[unsafe(method_family = none)]
71 unsafe fn buttonToolTip(&self) -> Retained<NSString>;
72
73 #[unsafe(method(minContentSize))]
74 #[unsafe(method_family = none)]
75 unsafe fn minContentSize(&self) -> NSSize;
76 }
77);
78
79extern_protocol!(
80 pub unsafe trait NSColorPickingCustom: NSColorPickingDefault + MainThreadOnly {
82 #[cfg(feature = "NSColorPanel")]
83 #[unsafe(method(supportsMode:))]
84 #[unsafe(method_family = none)]
85 unsafe fn supportsMode(&self, mode: NSColorPanelMode) -> bool;
86
87 #[cfg(feature = "NSColorPanel")]
88 #[unsafe(method(currentMode))]
89 #[unsafe(method_family = none)]
90 unsafe fn currentMode(&self) -> NSColorPanelMode;
91
92 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
93 #[unsafe(method(provideNewView:))]
94 #[unsafe(method_family = none)]
95 unsafe fn provideNewView(&self, initial_request: bool) -> Retained<NSView>;
96
97 #[cfg(feature = "NSColor")]
98 #[unsafe(method(setColor:))]
99 #[unsafe(method_family = none)]
100 unsafe fn setColor(&self, new_color: &NSColor);
101 }
102);