icrate 0.1.2

Bindings to Apple's frameworks
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::CoreData::*;
use crate::Foundation::*;

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum NSCompositingOperation {
        NSCompositingOperationClear = 0,
        NSCompositingOperationCopy = 1,
        NSCompositingOperationSourceOver = 2,
        NSCompositingOperationSourceIn = 3,
        NSCompositingOperationSourceOut = 4,
        NSCompositingOperationSourceAtop = 5,
        NSCompositingOperationDestinationOver = 6,
        NSCompositingOperationDestinationIn = 7,
        NSCompositingOperationDestinationOut = 8,
        NSCompositingOperationDestinationAtop = 9,
        NSCompositingOperationXOR = 10,
        NSCompositingOperationPlusDarker = 11,
        #[deprecated = "Use NSCompositingOperationSourceOver instead"]
        NSCompositingOperationHighlight = 12,
        NSCompositingOperationPlusLighter = 13,
        NSCompositingOperationMultiply = 14,
        NSCompositingOperationScreen = 15,
        NSCompositingOperationOverlay = 16,
        NSCompositingOperationDarken = 17,
        NSCompositingOperationLighten = 18,
        NSCompositingOperationColorDodge = 19,
        NSCompositingOperationColorBurn = 20,
        NSCompositingOperationSoftLight = 21,
        NSCompositingOperationHardLight = 22,
        NSCompositingOperationDifference = 23,
        NSCompositingOperationExclusion = 24,
        NSCompositingOperationHue = 25,
        NSCompositingOperationSaturation = 26,
        NSCompositingOperationColor = 27,
        NSCompositingOperationLuminosity = 28,
    }
);

extern_static!(NSCompositeClear: NSCompositingOperation = NSCompositingOperationClear);

extern_static!(NSCompositeCopy: NSCompositingOperation = NSCompositingOperationCopy);

extern_static!(NSCompositeSourceOver: NSCompositingOperation = NSCompositingOperationSourceOver);

extern_static!(NSCompositeSourceIn: NSCompositingOperation = NSCompositingOperationSourceIn);

extern_static!(NSCompositeSourceOut: NSCompositingOperation = NSCompositingOperationSourceOut);

extern_static!(NSCompositeSourceAtop: NSCompositingOperation = NSCompositingOperationSourceAtop);

extern_static!(NSCompositeDestinationOver: NSCompositingOperation = NSCompositingOperationDestinationOver);

extern_static!(NSCompositeDestinationIn: NSCompositingOperation = NSCompositingOperationDestinationIn);

extern_static!(NSCompositeDestinationOut: NSCompositingOperation = NSCompositingOperationDestinationOut);

extern_static!(NSCompositeDestinationAtop: NSCompositingOperation = NSCompositingOperationDestinationAtop);

extern_static!(NSCompositeXOR: NSCompositingOperation = NSCompositingOperationXOR);

extern_static!(NSCompositePlusDarker: NSCompositingOperation = NSCompositingOperationPlusDarker);

extern_static!(NSCompositeHighlight: NSCompositingOperation = NSCompositingOperationHighlight);

extern_static!(NSCompositePlusLighter: NSCompositingOperation = NSCompositingOperationPlusLighter);

extern_static!(NSCompositeMultiply: NSCompositingOperation = NSCompositingOperationMultiply);

extern_static!(NSCompositeScreen: NSCompositingOperation = NSCompositingOperationScreen);

extern_static!(NSCompositeOverlay: NSCompositingOperation = NSCompositingOperationOverlay);

extern_static!(NSCompositeDarken: NSCompositingOperation = NSCompositingOperationDarken);

extern_static!(NSCompositeLighten: NSCompositingOperation = NSCompositingOperationLighten);

extern_static!(NSCompositeColorDodge: NSCompositingOperation = NSCompositingOperationColorDodge);

extern_static!(NSCompositeColorBurn: NSCompositingOperation = NSCompositingOperationColorBurn);

extern_static!(NSCompositeSoftLight: NSCompositingOperation = NSCompositingOperationSoftLight);

extern_static!(NSCompositeHardLight: NSCompositingOperation = NSCompositingOperationHardLight);

extern_static!(NSCompositeDifference: NSCompositingOperation = NSCompositingOperationDifference);

extern_static!(NSCompositeExclusion: NSCompositingOperation = NSCompositingOperationExclusion);

extern_static!(NSCompositeHue: NSCompositingOperation = NSCompositingOperationHue);

extern_static!(NSCompositeSaturation: NSCompositingOperation = NSCompositingOperationSaturation);

extern_static!(NSCompositeColor: NSCompositingOperation = NSCompositingOperationColor);

extern_static!(NSCompositeLuminosity: NSCompositingOperation = NSCompositingOperationLuminosity);

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum NSBackingStoreType {
        #[deprecated]
        NSBackingStoreRetained = 0,
        #[deprecated]
        NSBackingStoreNonretained = 1,
        NSBackingStoreBuffered = 2,
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSWindowOrderingMode {
        NSWindowAbove = 1,
        NSWindowBelow = -1,
        NSWindowOut = 0,
    }
);

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum NSFocusRingPlacement {
        NSFocusRingOnly = 0,
        NSFocusRingBelow = 1,
        NSFocusRingAbove = 2,
    }
);

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum NSFocusRingType {
        NSFocusRingTypeDefault = 0,
        NSFocusRingTypeNone = 1,
        NSFocusRingTypeExterior = 2,
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSColorRenderingIntent {
        NSColorRenderingIntentDefault = 0,
        NSColorRenderingIntentAbsoluteColorimetric = 1,
        NSColorRenderingIntentRelativeColorimetric = 2,
        NSColorRenderingIntentPerceptual = 3,
        NSColorRenderingIntentSaturation = 4,
    }
);

typed_enum!(
    pub type NSColorSpaceName = NSString;
);

extern_static!(NSCalibratedWhiteColorSpace: &'static NSColorSpaceName);

extern_static!(NSCalibratedRGBColorSpace: &'static NSColorSpaceName);

extern_static!(NSDeviceWhiteColorSpace: &'static NSColorSpaceName);

extern_static!(NSDeviceRGBColorSpace: &'static NSColorSpaceName);

extern_static!(NSDeviceCMYKColorSpace: &'static NSColorSpaceName);

extern_static!(NSNamedColorSpace: &'static NSColorSpaceName);

extern_static!(NSPatternColorSpace: &'static NSColorSpaceName);

extern_static!(NSCustomColorSpace: &'static NSColorSpaceName);

extern_static!(NSCalibratedBlackColorSpace: &'static NSColorSpaceName);

extern_static!(NSDeviceBlackColorSpace: &'static NSColorSpaceName);

ns_enum!(
    #[underlying(i32)]
    pub enum NSWindowDepth {
        NSWindowDepthTwentyfourBitRGB = 0x208,
        NSWindowDepthSixtyfourBitRGB = 0x210,
        NSWindowDepthOnehundredtwentyeightBitRGB = 0x220,
    }
);

extern_fn!(
    pub unsafe fn NSBestDepth(
        color_space: &NSColorSpaceName,
        bps: NSInteger,
        bpp: NSInteger,
        planar: Bool,
        exact_match: *mut Bool,
    ) -> NSWindowDepth;
);

extern_fn!(
    pub unsafe fn NSPlanarFromDepth(depth: NSWindowDepth) -> Bool;
);

extern_fn!(
    pub unsafe fn NSColorSpaceFromDepth(depth: NSWindowDepth) -> *mut NSColorSpaceName;
);

extern_fn!(
    pub unsafe fn NSBitsPerSampleFromDepth(depth: NSWindowDepth) -> NSInteger;
);

extern_fn!(
    pub unsafe fn NSBitsPerPixelFromDepth(depth: NSWindowDepth) -> NSInteger;
);

extern_fn!(
    pub unsafe fn NSNumberOfColorComponents(color_space_name: &NSColorSpaceName) -> NSInteger;
);

extern_fn!(
    pub unsafe fn NSAvailableWindowDepths() -> NonNull<NSWindowDepth>;
);

extern_static!(NSWhite: CGFloat);

extern_static!(NSLightGray: CGFloat);

extern_static!(NSDarkGray: CGFloat);

extern_static!(NSBlack: CGFloat);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSDisplayGamut {
        NSDisplayGamutSRGB = 1,
        NSDisplayGamutP3 = 2,
    }
);

typed_extensible_enum!(
    pub type NSDeviceDescriptionKey = NSString;
);

extern_static!(NSDeviceResolution: &'static NSDeviceDescriptionKey);

extern_static!(NSDeviceColorSpaceName: &'static NSDeviceDescriptionKey);

extern_static!(NSDeviceBitsPerSample: &'static NSDeviceDescriptionKey);

extern_static!(NSDeviceIsScreen: &'static NSDeviceDescriptionKey);

extern_static!(NSDeviceIsPrinter: &'static NSDeviceDescriptionKey);

extern_static!(NSDeviceSize: &'static NSDeviceDescriptionKey);

extern_fn!(
    pub unsafe fn NSRectFill(rect: NSRect);
);

extern_fn!(
    pub unsafe fn NSRectFillList(rects: NonNull<NSRect>, count: NSInteger);
);

extern_fn!(
    pub unsafe fn NSRectFillListWithGrays(
        rects: NonNull<NSRect>,
        grays: NonNull<CGFloat>,
        num: NSInteger,
    );
);

extern_fn!(
    #[cfg(feature = "AppKit_NSColor")]
    pub unsafe fn NSRectFillListWithColors(
        rects: NonNull<NSRect>,
        colors: NonNull<NonNull<NSColor>>,
        num: NSInteger,
    );
);

extern_fn!(
    pub unsafe fn NSRectFillUsingOperation(rect: NSRect, op: NSCompositingOperation);
);

extern_fn!(
    pub unsafe fn NSRectFillListUsingOperation(
        rects: NonNull<NSRect>,
        count: NSInteger,
        op: NSCompositingOperation,
    );
);

extern_fn!(
    #[cfg(feature = "AppKit_NSColor")]
    pub unsafe fn NSRectFillListWithColorsUsingOperation(
        rects: NonNull<NSRect>,
        colors: NonNull<NonNull<NSColor>>,
        num: NSInteger,
        op: NSCompositingOperation,
    );
);

extern_fn!(
    pub unsafe fn NSFrameRect(rect: NSRect);
);

extern_fn!(
    pub unsafe fn NSFrameRectWithWidth(rect: NSRect, frame_width: CGFloat);
);

extern_fn!(
    pub unsafe fn NSFrameRectWithWidthUsingOperation(
        rect: NSRect,
        frame_width: CGFloat,
        op: NSCompositingOperation,
    );
);

extern_fn!(
    pub unsafe fn NSRectClip(rect: NSRect);
);

extern_fn!(
    pub unsafe fn NSRectClipList(rects: NonNull<NSRect>, count: NSInteger);
);

extern_fn!(
    pub unsafe fn NSDrawTiledRects(
        bounds_rect: NSRect,
        clip_rect: NSRect,
        sides: NonNull<NSRectEdge>,
        grays: NonNull<CGFloat>,
        count: NSInteger,
    ) -> NSRect;
);

extern_fn!(
    pub unsafe fn NSDrawGrayBezel(rect: NSRect, clip_rect: NSRect);
);

extern_fn!(
    pub unsafe fn NSDrawGroove(rect: NSRect, clip_rect: NSRect);
);

extern_fn!(
    pub unsafe fn NSDrawWhiteBezel(rect: NSRect, clip_rect: NSRect);
);

extern_fn!(
    pub unsafe fn NSDrawButton(rect: NSRect, clip_rect: NSRect);
);

extern_fn!(
    pub unsafe fn NSEraseRect(rect: NSRect);
);

extern_fn!(
    #[cfg(feature = "AppKit_NSColor")]
    #[deprecated = "Use -[NSBitmapImageRep colorAtX:y:] to interrogate pixel values.  If necessary, use -[NSView cacheDisplayInRect:toBitmapImageRep:] to snapshot a view hierarchy into an NSBitmapImageRep."]
    pub unsafe fn NSReadPixel(passed_point: NSPoint) -> *mut NSColor;
);

extern_fn!(
    #[deprecated]
    pub unsafe fn NSHighlightRect(rect: NSRect);
);

extern_fn!(
    pub unsafe fn NSBeep();
);

extern_fn!(
    #[cfg(feature = "Foundation_NSString")]
    #[deprecated = "Doesn't return anything useful since 10.0"]
    pub unsafe fn NSGetWindowServerMemory(
        context: NSInteger,
        virtual_memory: NonNull<NSInteger>,
        window_backing_memory: NonNull<NSInteger>,
        window_dump_string: NonNull<NonNull<NSString>>,
    ) -> NSInteger;
);

extern_fn!(
    #[cfg(feature = "AppKit_NSColor")]
    pub unsafe fn NSDrawColorTiledRects(
        bounds_rect: NSRect,
        clip_rect: NSRect,
        sides: NonNull<NSRectEdge>,
        colors: NonNull<NonNull<NSColor>>,
        count: NSInteger,
    ) -> NSRect;
);

extern_fn!(
    pub unsafe fn NSDrawDarkBezel(rect: NSRect, clip_rect: NSRect);
);

extern_fn!(
    pub unsafe fn NSDrawLightBezel(rect: NSRect, clip_rect: NSRect);
);

extern_fn!(
    pub unsafe fn NSDottedFrameRect(rect: NSRect);
);

extern_fn!(
    pub unsafe fn NSDrawWindowBackground(rect: NSRect);
);

extern_fn!(
    pub unsafe fn NSSetFocusRingStyle(placement: NSFocusRingPlacement);
);

extern_fn!(
    #[deprecated = "As of 10.11 it is not generally necessary to take explicit action to achieve visual atomicity. +[NSAnimationContext runAnimationGroup:] and other similar methods can be used when a stronger than normal need for visual atomicity is required. The NSAnimationContext methods do not suffer from the same performance problems as NSDisableScreenUpdates."]
    pub unsafe fn NSDisableScreenUpdates();
);

extern_fn!(
    #[deprecated = "As of 10.11 it is not generally necessary to take explicit action to achieve visual atomicity. +[NSAnimationContext runAnimationGroup:] and other similar methods can be used when a stronger than normal need for visual atomicity is required. The NSAnimationContext methods do not suffer from the same performance problems as NSEnableScreenUpdates."]
    pub unsafe fn NSEnableScreenUpdates();
);

ns_enum!(
    #[underlying(NSUInteger)]
    #[deprecated = "Use +[NSCursor disappearingItemCursor] instead"]
    pub enum NSAnimationEffect {
        NSAnimationEffectDisappearingItemDefault = 0,
        NSAnimationEffectPoof = 10,
    }
);

extern_fn!(
    #[deprecated = "Use +[NSCursor disappearingItemCursor] instead"]
    pub unsafe fn NSShowAnimationEffect(
        animation_effect: NSAnimationEffect,
        center_location: NSPoint,
        size: NSSize,
        animation_delegate: Option<&AnyObject>,
        did_end_selector: Option<Sel>,
        context_info: *mut c_void,
    );
);

extern_fn!(
    #[deprecated = "Use +[NSWindow windowNumbersWithOptions:] instead"]
    pub unsafe fn NSCountWindows(count: NonNull<NSInteger>);
);

extern_fn!(
    #[deprecated = "Use +[NSWindow windowNumbersWithOptions:] instead"]
    pub unsafe fn NSWindowList(size: NSInteger, list: NonNull<NSInteger>);
);

extern_fn!(
    #[deprecated = "Use +[NSWindow windowNumbersWithOptions:] instead"]
    pub unsafe fn NSCountWindowsForContext(context: NSInteger, count: NonNull<NSInteger>);
);

extern_fn!(
    #[deprecated = "Use +[NSWindow windowNumbersWithOptions:] instead"]
    pub unsafe fn NSWindowListForContext(
        context: NSInteger,
        size: NSInteger,
        list: NonNull<NSInteger>,
    );
);

extern_fn!(
    #[deprecated]
    pub unsafe fn NSCopyBits(src_g_state: NSInteger, src_rect: NSRect, dest_point: NSPoint);
);