Repository: servo/cocoa-rs
Branch: master
Commit: ea0667fdd2cf
Files: 14
Total size: 187.5 KB
Directory structure:
gitextract_oxm60gs9/
├── .gitignore
├── .travis.yml
├── COPYRIGHT
├── Cargo.toml
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── examples/
│ ├── hello_world.rs
│ └── tab_view.rs
├── src/
│ ├── appkit.rs
│ ├── base.rs
│ ├── foundation.rs
│ └── lib.rs
└── tests/
└── foundation.rs
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*~
build
/target
/Cargo.lock
================================================
FILE: .travis.yml
================================================
os: osx
language: rust
notifications:
webhooks: http://build.servo.org:54856/travis
================================================
FILE: COPYRIGHT
================================================
Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
<LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
option. All files in the project carrying such notice may not be
copied, modified, or distributed except according to those terms.
================================================
FILE: Cargo.toml
================================================
[package]
name = "cocoa"
description = "Bindings to Cocoa for OS X"
homepage = "https://github.com/servo/cocoa-rs"
repository = "https://github.com/servo/cocoa-rs"
version = "0.14.0"
authors = ["The Servo Project Developers"]
license = "MIT / Apache-2.0"
[lib]
name = "cocoa"
crate-type = ["rlib"]
[dependencies]
block = "0.1"
bitflags = "1.0"
libc = "0.2"
core-graphics = "0.13"
objc = "0.2"
================================================
FILE: LICENSE-APACHE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: LICENSE-MIT
================================================
Copyright (c) 2012-2013 Mozilla Foundation
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================
Cocoa-rs
--------
This repository has been merged into the [core-foundation](https://github.com/servo/core-foundation-rs/tree/master/cocoa) repository and is now outdated.
================================================
FILE: examples/hello_world.rs
================================================
extern crate cocoa;
use cocoa::base::{selector, nil, NO};
use cocoa::foundation::{NSRect, NSPoint, NSSize, NSAutoreleasePool, NSProcessInfo,
NSString};
use cocoa::appkit::{NSApp, NSApplication, NSApplicationActivationPolicyRegular, NSWindow,
NSBackingStoreBuffered, NSMenu, NSMenuItem, NSWindowStyleMask,
NSRunningApplication, NSApplicationActivateIgnoringOtherApps};
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);
let current_app = NSRunningApplication::currentApplication(nil);
current_app.activateWithOptions_(NSApplicationActivateIgnoringOtherApps);
app.run();
}
}
================================================
FILE: examples/tab_view.rs
================================================
extern crate cocoa;
use cocoa::base::{selector, id, nil, NO};
use cocoa::foundation::{NSRect, NSPoint, NSSize, NSAutoreleasePool, NSProcessInfo,
NSString};
use cocoa::appkit::{NSApp, NSApplication, NSApplicationActivationPolicyRegular, NSWindow,
NSMenu, NSMenuItem, NSTabView, NSWindowStyleMask, NSBackingStoreType,
NSTabViewItem, NSRunningApplication, NSApplicationActivateIgnoringOtherApps};
fn main() {
unsafe {
// create a tab View
let tab_view = NSTabView::new(nil)
.initWithFrame_(NSRect::new(NSPoint::new(0., 0.), NSSize::new(200., 200.)));
// create a tab view item
let tab_view_item = NSTabViewItem::new(nil)
.initWithIdentifier_(NSString::alloc(nil).init_str("TabView1"));
tab_view_item.setLabel_(NSString::alloc(nil).init_str("Tab view item 1"));
tab_view.addTabViewItem_(tab_view_item);
// create a second tab view item
let tab_view_item2 = NSTabViewItem::new(nil)
.initWithIdentifier_(NSString::alloc(nil).init_str("TabView2"));
tab_view_item2.setLabel_(NSString::alloc(nil).init_str("Tab view item 2"));
tab_view.addTabViewItem_(tab_view_item2);
// Create the app and set the content.
let app = create_app(NSString::alloc(nil).init_str("Tab View"), tab_view);
app.run();
}
}
unsafe fn create_app(title: id, content: id) -> id {
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 |
NSWindowStyleMask::NSClosableWindowMask |
NSWindowStyleMask::NSResizableWindowMask |
NSWindowStyleMask::NSMiniaturizableWindowMask |
NSWindowStyleMask::NSUnifiedTitleAndToolbarWindowMask,
NSBackingStoreType::NSBackingStoreBuffered,
NO
).autorelease();
window.cascadeTopLeftFromPoint_(NSPoint::new(20., 20.));
window.center();
window.setTitle_(title);
window.makeKeyAndOrderFront_(nil);
window.setContentView_(content);
let current_app = NSRunningApplication::currentApplication(nil);
current_app.activateWithOptions_(NSApplicationActivateIgnoringOtherApps);
return app;
}
================================================
FILE: src/appkit.rs
================================================
// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(non_upper_case_globals)]
use base::{id, class, BOOL, SEL};
use block::Block;
use foundation::{NSInteger, NSUInteger, NSTimeInterval,
NSPoint, NSSize, NSRect, NSRectEdge};
use libc;
pub use core_graphics::base::CGFloat;
pub use core_graphics::geometry::CGPoint;
pub use self::NSApplicationActivationPolicy::*;
pub use self::NSApplicationActivationOptions::*;
pub use self::NSBackingStoreType::*;
pub use self::NSOpenGLPixelFormatAttribute::*;
pub use self::NSOpenGLPFAOpenGLProfiles::*;
pub use self::NSEventType::*;
pub type CGLContextObj = *mut libc::c_void;
pub type GLint = libc::int32_t;
#[link(name = "AppKit", kind = "framework")]
extern {
pub static NSAppKitVersionNumber: f64;
// Types for Standard Data - OS X v10.6 and later. (NSString *const)
pub static NSPasteboardTypeString: id;
pub static NSPasteboardTypePDF: id;
pub static NSPasteboardTypeTIFF: id;
pub static NSPasteboardTypePNG: id;
pub static NSPasteboardTypeRTF: id;
pub static NSPasteboardTypeRTFD: id;
pub static NSPasteboardTypeHTML: id;
pub static NSPasteboardTypeTabularText: id;
pub static NSPasteboardTypeFont: id;
pub static NSPasteboardTypeRuler: id;
pub static NSPasteboardTypeColor: id;
pub static NSPasteboardTypeSound: id;
pub static NSPasteboardTypeMultipleTextSelection: id;
pub static NSPasteboardTypeFindPanelSearchOptions: id;
// Types for Standard Data - OS X v10.5 and earlier. (NSString *)
pub static NSStringPboardType: id;
pub static NSFilenamesPboardType: id;
pub static NSPostScriptPboardType: id;
pub static NSTIFFPboardType: id;
pub static NSRTFPboardType: id;
pub static NSTabularTextPboardType: id;
pub static NSFontPboardType: id;
pub static NSRulerPboardType: id;
pub static NSFileContentsPboardType: id;
pub static NSColorPboardType: id;
pub static NSRTFDPboardType: id;
pub static NSHTMLPboardType: id;
pub static NSPICTPboardType: id;
pub static NSURLPboardType: id;
pub static NSPDFPboardType: id;
pub static NSVCardPboardType: id;
pub static NSFilesPromisePboardType: id;
pub static NSMultipleTextSelectionPboardType: id;
pub static NSSoundPboardType: id;
// Names of provided pasteboards. (NSString *)
pub static NSGeneralPboard: id;
pub static NSFontPboard: id;
pub static NSRulerPboard: id;
pub static NSFindPboard: id;
pub static NSDragPboard: id;
// Pasteboard reading options - OS X v10.6 and later. (NSString *)
pub static NSPasteboardURLReadingFileURLsOnlyKey: id;
pub static NSPasteboardURLReadingContentsConformToTypesKey: id;
// NSAppearance names. (NSString *)
pub static NSAppearanceNameVibrantDark: id;
pub static NSAppearanceNameVibrantLight: id;
}
pub const NSAppKitVersionNumber10_0: f64 = 577.0;
pub const NSAppKitVersionNumber10_1: f64 = 620.0;
pub const NSAppKitVersionNumber10_2: f64 = 663.0;
pub const NSAppKitVersionNumber10_2_3: f64 = 663.6;
pub const NSAppKitVersionNumber10_3: f64 = 743.0;
pub const NSAppKitVersionNumber10_3_2: f64 = 743.14;
pub const NSAppKitVersionNumber10_3_3: f64 = 743.2;
pub const NSAppKitVersionNumber10_3_5: f64 = 743.24;
pub const NSAppKitVersionNumber10_3_7: f64 = 743.33;
pub const NSAppKitVersionNumber10_3_9: f64 = 743.36;
pub const NSAppKitVersionNumber10_4: f64 = 824.0;
pub const NSAppKitVersionNumber10_4_1: f64 = 824.1;
pub const NSAppKitVersionNumber10_4_3: f64 = 824.23;
pub const NSAppKitVersionNumber10_4_4: f64 = 824.33;
pub const NSAppKitVersionNumber10_4_7: f64 = 824.41;
pub const NSAppKitVersionNumber10_5: f64 = 949.0;
pub const NSAppKitVersionNumber10_5_2: f64 = 949.27;
pub const NSAppKitVersionNumber10_5_3: f64 = 949.33;
pub const NSAppKitVersionNumber10_6: f64 = 1038.0;
pub const NSAppKitVersionNumber10_7: f64 = 1138.0;
pub const NSAppKitVersionNumber10_7_2: f64 = 1138.23;
pub const NSAppKitVersionNumber10_7_3: f64 = 1138.32;
pub const NSAppKitVersionNumber10_7_4: f64 = 1138.47;
pub const NSAppKitVersionNumber10_8: f64 = 1187.0;
pub const NSAppKitVersionNumber10_9: f64 = 1265.0;
pub unsafe fn NSApp() -> id {
msg_send![class("NSApplication"), sharedApplication]
}
#[repr(i64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSApplicationActivationPolicy {
NSApplicationActivationPolicyRegular = 0,
NSApplicationActivationPolicyAccessory = 1,
NSApplicationActivationPolicyProhibited = 2,
NSApplicationActivationPolicyERROR = -1
}
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSApplicationActivationOptions {
NSApplicationActivateAllWindows = 1 << 0,
NSApplicationActivateIgnoringOtherApps = 1 << 1
}
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSApplicationTerminateReply {
NSTerminateCancel = 0,
NSTerminateNow = 1,
NSTerminateLater = 2,
}
bitflags! {
pub struct NSWindowStyleMask: NSUInteger {
const NSBorderlessWindowMask = 0;
const NSTitledWindowMask = 1 << 0;
const NSClosableWindowMask = 1 << 1;
const NSMiniaturizableWindowMask = 1 << 2;
const NSResizableWindowMask = 1 << 3;
const NSTexturedBackgroundWindowMask = 1 << 8;
const NSUnifiedTitleAndToolbarWindowMask = 1 << 12;
const NSFullScreenWindowMask = 1 << 14;
const NSFullSizeContentViewWindowMask = 1 << 15;
}
}
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSWindowTitleVisibility {
NSWindowTitleVisible = 0,
NSWindowTitleHidden = 1
}
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSBackingStoreType {
NSBackingStoreRetained = 0,
NSBackingStoreNonretained = 1,
NSBackingStoreBuffered = 2
}
bitflags! {
pub struct NSWindowOrderingMode: NSInteger {
const NSWindowAbove = 1;
const NSWindowBelow = -1;
const NSWindowOut = 0;
}
}
bitflags! {
pub struct NSAlignmentOptions: libc::c_ulonglong {
const NSAlignMinXInward = 1 << 0;
const NSAlignMinYInward = 1 << 1;
const NSAlignMaxXInward = 1 << 2;
const NSAlignMaxYInward = 1 << 3;
const NSAlignWidthInward = 1 << 4;
const NSAlignHeightInward = 1 << 5;
const NSAlignMinXOutward = 1 << 8;
const NSAlignMinYOutward = 1 << 9;
const NSAlignMaxXOutward = 1 << 10;
const NSAlignMaxYOutward = 1 << 11;
const NSAlignWidthOutward = 1 << 12;
const NSAlignHeightOutward = 1 << 13;
const NSAlignMinXNearest = 1 << 16;
const NSAlignMinYNearest = 1 << 17;
const NSAlignMaxXNearest = 1 << 18;
const NSAlignMaxYNearest = 1 << 19;
const NSAlignWidthNearest = 1 << 20;
const NSAlignHeightNearest = 1 << 21;
const NSAlignRectFlipped = 1 << 63;
const NSAlignAllEdgesInward = NSAlignmentOptions::NSAlignMinXInward.bits
| NSAlignmentOptions::NSAlignMaxXInward.bits
| NSAlignmentOptions::NSAlignMinYInward.bits
| NSAlignmentOptions::NSAlignMaxYInward.bits;
const NSAlignAllEdgesOutward = NSAlignmentOptions::NSAlignMinXOutward.bits
| NSAlignmentOptions::NSAlignMaxXOutward.bits
| NSAlignmentOptions::NSAlignMinYOutward.bits
| NSAlignmentOptions::NSAlignMaxYOutward.bits;
const NSAlignAllEdgesNearest = NSAlignmentOptions::NSAlignMinXNearest.bits
| NSAlignmentOptions::NSAlignMaxXNearest.bits
| NSAlignmentOptions::NSAlignMinYNearest.bits
| NSAlignmentOptions::NSAlignMaxYNearest.bits;
}
}
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSOpenGLPixelFormatAttribute {
NSOpenGLPFAAllRenderers = 1,
NSOpenGLPFATripleBuffer = 3,
NSOpenGLPFADoubleBuffer = 5,
NSOpenGLPFAStereo = 6,
NSOpenGLPFAAuxBuffers = 7,
NSOpenGLPFAColorSize = 8,
NSOpenGLPFAAlphaSize = 11,
NSOpenGLPFADepthSize = 12,
NSOpenGLPFAStencilSize = 13,
NSOpenGLPFAAccumSize = 14,
NSOpenGLPFAMinimumPolicy = 51,
NSOpenGLPFAMaximumPolicy = 52,
NSOpenGLPFAOffScreen = 53,
NSOpenGLPFAFullScreen = 54,
NSOpenGLPFASampleBuffers = 55,
NSOpenGLPFASamples = 56,
NSOpenGLPFAAuxDepthStencil = 57,
NSOpenGLPFAColorFloat = 58,
NSOpenGLPFAMultisample = 59,
NSOpenGLPFASupersample = 60,
NSOpenGLPFASampleAlpha = 61,
NSOpenGLPFARendererID = 70,
NSOpenGLPFASingleRenderer = 71,
NSOpenGLPFANoRecovery = 72,
NSOpenGLPFAAccelerated = 73,
NSOpenGLPFAClosestPolicy = 74,
NSOpenGLPFARobust = 75,
NSOpenGLPFABackingStore = 76,
NSOpenGLPFAMPSafe = 78,
NSOpenGLPFAWindow = 80,
NSOpenGLPFAMultiScreen = 81,
NSOpenGLPFACompliant = 83,
NSOpenGLPFAScreenMask = 84,
NSOpenGLPFAPixelBuffer = 90,
NSOpenGLPFARemotePixelBuffer = 91,
NSOpenGLPFAAllowOfflineRenderers = 96,
NSOpenGLPFAAcceleratedCompute = 97,
NSOpenGLPFAOpenGLProfile = 99,
NSOpenGLPFAVirtualScreenCount = 128,
}
#[repr(u64)]
#[allow(non_camel_case_types)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSOpenGLPFAOpenGLProfiles {
NSOpenGLProfileVersionLegacy = 0x1000,
NSOpenGLProfileVersion3_2Core = 0x3200,
NSOpenGLProfileVersion4_1Core = 0x4100,
}
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSOpenGLContextParameter {
NSOpenGLCPSwapInterval = 222,
NSOpenGLCPSurfaceOrder = 235,
NSOpenGLCPSurfaceOpacity = 236,
NSOpenGLCPSurfaceBackingSize = 304,
NSOpenGLCPReclaimResources = 308,
NSOpenGLCPCurrentRendererID = 309,
NSOpenGLCPGPUVertexProcessing = 310,
NSOpenGLCPGPUFragmentProcessing = 311,
NSOpenGLCPHasDrawable = 314,
NSOpenGLCPMPSwapsInFlight = 315,
}
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSWindowButton {
NSWindowCloseButton = 0,
NSWindowMiniaturizeButton = 1,
NSWindowZoomButton = 2,
NSWindowToolbarButton = 3,
NSWindowDocumentIconButton = 4,
NSWindowDocumentVersionsButton = 6,
NSWindowFullScreenButton = 7,
}
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSBezelStyle {
NSRoundedBezelStyle = 1,
NSRegularSquareBezelStyle = 2,
NSDisclosureBezelStyle = 5,
NSShadowlessSquareBezelStyle = 6,
NSCircularBezelStyle = 7,
NSTexturedSquareBezelStyle = 8,
NSHelpButtonBezelStyle = 9,
NSSmallSquareBezelStyle = 10,
NSTexturedRoundedBezelStyle = 11,
NSRoundRectBezelStyle = 12,
NSRecessedBezelStyle = 13,
NSRoundedDisclosureBezelStyle = 14,
}
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSRequestUserAttentionType {
NSCriticalRequest = 0,
NSInformationalRequest = 10,
}
pub static NSMainMenuWindowLevel: libc::int32_t = 24;
pub trait NSApplication: Sized {
unsafe fn sharedApplication(_: Self) -> id {
msg_send![class("NSApplication"), sharedApplication]
}
unsafe fn mainMenu(self) -> id;
unsafe fn setActivationPolicy_(self, policy: NSApplicationActivationPolicy) -> BOOL;
unsafe fn setMainMenu_(self, menu: id);
unsafe fn setServicesMenu_(self, menu: id);
unsafe fn setWindowsMenu_(self, menu: id);
unsafe fn activateIgnoringOtherApps_(self, ignore: BOOL);
unsafe fn run(self);
unsafe fn finishLaunching(self);
unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue_(self,
mask: NSUInteger,
expiration: id,
in_mode: id,
dequeue: BOOL) -> id;
unsafe fn sendEvent_(self, an_event: id);
unsafe fn postEvent_atStart_(self, anEvent: id, flag: BOOL);
unsafe fn stop_(self, sender: id);
unsafe fn setApplicationIconImage_(self, image: id);
unsafe fn requestUserAttention_(self, requestType: NSRequestUserAttentionType);
}
impl NSApplication for id {
unsafe fn mainMenu(self) -> id {
msg_send![self, mainMenu]
}
unsafe fn setActivationPolicy_(self, policy: NSApplicationActivationPolicy) -> BOOL {
msg_send![self, setActivationPolicy:policy as NSInteger]
}
unsafe fn setMainMenu_(self, menu: id) {
msg_send![self, setMainMenu:menu]
}
unsafe fn setServicesMenu_(self, menu: id) {
msg_send![self, setServicesMenu:menu]
}
unsafe fn setWindowsMenu_(self, menu: id) {
msg_send![self, setWindowsMenu:menu]
}
unsafe fn activateIgnoringOtherApps_(self, ignore: BOOL) {
msg_send![self, activateIgnoringOtherApps:ignore]
}
unsafe fn run(self) {
msg_send![self, run]
}
unsafe fn finishLaunching(self) {
msg_send![self, finishLaunching]
}
unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue_(self,
mask: NSUInteger,
expiration: id,
in_mode: id,
dequeue: BOOL) -> id {
msg_send![self, nextEventMatchingMask:mask
untilDate:expiration
inMode:in_mode
dequeue:dequeue]
}
unsafe fn sendEvent_(self, an_event: id) {
msg_send![self, sendEvent:an_event]
}
unsafe fn postEvent_atStart_(self, anEvent: id, flag: BOOL) {
msg_send![self, postEvent:anEvent atStart:flag]
}
unsafe fn stop_(self, sender: id) {
msg_send![self, stop:sender]
}
unsafe fn setApplicationIconImage_(self, icon: id) {
msg_send![self, setApplicationIconImage:icon]
}
unsafe fn requestUserAttention_(self, requestType: NSRequestUserAttentionType) {
msg_send![self, requestUserAttention:requestType]
}
}
pub trait NSRunningApplication: Sized {
unsafe fn currentApplication(_: Self) -> id {
msg_send![class("NSRunningApplication"), currentApplication]
}
unsafe fn activateWithOptions_(self, options: NSApplicationActivationOptions) -> BOOL;
}
impl NSRunningApplication for id {
unsafe fn activateWithOptions_(self, options: NSApplicationActivationOptions) -> BOOL {
msg_send![self, activateWithOptions:options as NSUInteger]
}
}
pub trait NSPasteboard: Sized {
unsafe fn generalPasteboard(_: Self) -> id {
msg_send![class("NSPasteboard"), generalPasteboard]
}
unsafe fn pasteboardByFilteringData_ofType(_: Self, data: id, _type: id) -> id {
msg_send![class("NSPasteboard"), pasteboardByFilteringData:data ofType:_type]
}
unsafe fn pasteboardByFilteringFile(_: Self, file: id) -> id {
msg_send![class("NSPasteboard"), pasteboardByFilteringFile:file]
}
unsafe fn pasteboardByFilteringTypesInPasteboard(_: Self, pboard: id) -> id {
msg_send![class("NSPasteboard"), pasteboardByFilteringTypesInPasteboard:pboard]
}
unsafe fn pasteboardWithName(_: Self, name: id) -> id {
msg_send![class("NSPasteboard"), pasteboardWithName:name]
}
unsafe fn pasteboardWithUniqueName(_: Self) -> id {
msg_send![class("NSPasteboard"), pasteboardWithUniqueName]
}
unsafe fn releaseGlobally(self);
unsafe fn clearContents(self) -> NSInteger;
unsafe fn writeObjects(self, objects: id) -> BOOL;
unsafe fn sendData_forType(self, data: id, dataType: id) -> BOOL;
unsafe fn setPropertyList_forType(self, plist: id, dataType: id) -> BOOL;
unsafe fn setString_forType(self, string: id, dataType: id) -> BOOL;
unsafe fn readObjectsForClasses_options(self, classArray: id, options: id) -> id;
unsafe fn pasteboardItems(self) -> id;
unsafe fn indexOfPasteboardItem(self, pasteboardItem: id) -> NSInteger;
unsafe fn dataForType(self, dataType: id) -> id;
unsafe fn propertyListForType(self, dataType: id) -> id;
unsafe fn stringForType(self, dataType: id) -> id;
unsafe fn availableTypeFromArray(self, types: id) -> id;
unsafe fn canReadItemWithDataConformingToTypes(self, types: id) -> BOOL;
unsafe fn canReadObjectForClasses_options(self, classArray: id, options: id) -> BOOL;
unsafe fn types(self) -> id;
unsafe fn typesFilterableTo(_: Self, _type: id) -> id {
msg_send![class("NSPasteboard"), typesFilterableTo:_type]
}
unsafe fn name(self) -> id;
unsafe fn changeCount(self) -> NSInteger;
unsafe fn declareTypes_owner(self, newTypes: id, newOwner: id) -> NSInteger;
unsafe fn addTypes_owner(self, newTypes: id, newOwner: id) -> NSInteger;
unsafe fn writeFileContents(self, filename: id) -> BOOL;
unsafe fn writeFileWrapper(self, wrapper: id) -> BOOL;
unsafe fn readFileContentsType_toFile(self, _type: id, filename: id) -> id;
unsafe fn readFileWrapper(self) -> id;
}
impl NSPasteboard for id {
unsafe fn releaseGlobally(self) {
msg_send![self, releaseGlobally];
}
unsafe fn clearContents(self) -> NSInteger {
msg_send![self, clearContents]
}
unsafe fn writeObjects(self, objects: id) -> BOOL {
msg_send![self, writeObjects:objects]
}
unsafe fn sendData_forType(self, data: id, dataType: id) -> BOOL {
msg_send![self, sendData:data forType:dataType]
}
unsafe fn setPropertyList_forType(self, plist: id, dataType: id) -> BOOL {
msg_send![self, setPropertyList:plist forType:dataType]
}
unsafe fn setString_forType(self, string: id, dataType: id) -> BOOL {
msg_send![self, setString:string forType:dataType]
}
unsafe fn readObjectsForClasses_options(self, classArray: id, options: id) -> id {
msg_send![self, readObjectsForClasses:classArray options:options]
}
unsafe fn pasteboardItems(self) -> id {
msg_send![self, pasteboardItems]
}
unsafe fn indexOfPasteboardItem(self, pasteboardItem: id) -> NSInteger {
msg_send![self, indexOfPasteboardItem:pasteboardItem]
}
unsafe fn dataForType(self, dataType: id) -> id {
msg_send![self, dataForType:dataType]
}
unsafe fn propertyListForType(self, dataType: id) -> id {
msg_send![self, propertyListForType:dataType]
}
unsafe fn stringForType(self, dataType: id) -> id {
msg_send![self, stringForType:dataType]
}
unsafe fn availableTypeFromArray(self, types: id) -> id {
msg_send![self, availableTypeFromArray:types]
}
unsafe fn canReadItemWithDataConformingToTypes(self, types: id) -> BOOL {
msg_send![self, canReadItemWithDataConformingToTypes:types]
}
unsafe fn canReadObjectForClasses_options(self, classArray: id, options: id) -> BOOL {
msg_send![self, canReadObjectForClasses:classArray options:options]
}
unsafe fn types(self) -> id {
msg_send![self, types]
}
unsafe fn name(self) -> id {
msg_send![self, name]
}
unsafe fn changeCount(self) -> NSInteger {
msg_send![self, changeCount]
}
unsafe fn declareTypes_owner(self, newTypes: id, newOwner: id) -> NSInteger {
msg_send![self, declareTypes:newTypes owner:newOwner]
}
unsafe fn addTypes_owner(self, newTypes: id, newOwner: id) -> NSInteger {
msg_send![self, addTypes:newTypes owner:newOwner]
}
unsafe fn writeFileContents(self, filename: id) -> BOOL {
msg_send![self, writeFileContents:filename]
}
unsafe fn writeFileWrapper(self, wrapper: id) -> BOOL {
msg_send![self, writeFileWrapper:wrapper]
}
unsafe fn readFileContentsType_toFile(self, _type: id, filename: id) -> id {
msg_send![self, readFileContentsType:_type toFile:filename]
}
unsafe fn readFileWrapper(self) -> id {
msg_send![self, readFileWrapper]
}
}
pub trait NSPasteboardItem: Sized {
unsafe fn types(self) -> id;
unsafe fn setDataProvider_forTypes(self, dataProvider: id, types: id) -> BOOL;
unsafe fn setData_forType(self, data: id, _type: id) -> BOOL;
unsafe fn setString_forType(self, string: id, _type: id) -> BOOL;
unsafe fn setPropertyList_forType(self, propertyList: id, _type: id) -> BOOL;
unsafe fn dataForType(self, _type: id) -> id;
unsafe fn stringForType(self, _type: id) -> id;
unsafe fn propertyListForType(self, _type: id) -> id;
}
impl NSPasteboardItem for id {
unsafe fn types(self) -> id {
msg_send![self, types]
}
unsafe fn setDataProvider_forTypes(self, dataProvider: id, types: id) -> BOOL {
msg_send![self, setDataProvider:dataProvider forTypes:types]
}
unsafe fn setData_forType(self, data: id, _type: id) -> BOOL {
msg_send![self, setData:data forType:_type]
}
unsafe fn setString_forType(self, string: id, _type: id) -> BOOL {
msg_send![self, setString:string forType:_type]
}
unsafe fn setPropertyList_forType(self, propertyList: id, _type: id) -> BOOL {
msg_send![self, setPropertyList:propertyList forType:_type]
}
unsafe fn dataForType(self, _type: id) -> id {
msg_send![self, dataForType:_type]
}
unsafe fn stringForType(self, _type: id) -> id {
msg_send![self, stringForType:_type]
}
unsafe fn propertyListForType(self, _type: id) -> id {
msg_send![self, propertyListForType:_type]
}
}
pub trait NSPasteboardItemDataProvider: Sized {
unsafe fn pasteboard_item_provideDataForType(self, pasteboard: id, item: id, _type: id);
unsafe fn pasteboardFinishedWithDataProvider(self, pasteboard: id);
}
impl NSPasteboardItemDataProvider for id {
unsafe fn pasteboard_item_provideDataForType(self, pasteboard: id, item: id, _type: id) {
msg_send![self, pasteboard:pasteboard item:item provideDataForType:_type]
}
unsafe fn pasteboardFinishedWithDataProvider(self, pasteboard: id) {
msg_send![self, pasteboardFinishedWithDataProvider:pasteboard]
}
}
pub trait NSPasteboardWriting: Sized {
unsafe fn writableTypesForPasteboard(self, pasteboard: id) -> id;
unsafe fn writingOptionsForType_pasteboard(self, _type: id, pasteboard: id) -> NSPasteboardWritingOptions;
unsafe fn pasteboardPropertyListForType(self, _type: id) -> id;
}
impl NSPasteboardWriting for id {
unsafe fn writableTypesForPasteboard(self, pasteboard: id) -> id {
msg_send![self, writableTypesForPasteboard:pasteboard]
}
unsafe fn writingOptionsForType_pasteboard(self, _type: id, pasteboard: id) -> NSPasteboardWritingOptions {
msg_send![self, writingOptionsForType:_type pasteboard:pasteboard]
}
unsafe fn pasteboardPropertyListForType(self, _type: id) -> id {
msg_send![self, pasteboardPropertyListForType:_type]
}
}
pub trait NSPasteboardReading: Sized {
unsafe fn initWithPasteboardPropertyList_ofType(self, propertyList: id, _type: id) -> id;
unsafe fn readableTypesForPasteboard(self, pasteboard: id) -> id;
unsafe fn readingOptionsForType_pasteboard(self, _type: id, pasteboard: id) -> NSPasteboardReadingOptions;
}
impl NSPasteboardReading for id {
unsafe fn initWithPasteboardPropertyList_ofType(self, propertyList: id, _type: id) -> id {
msg_send![self, initWithPasteboardPropertyList:propertyList ofType:_type]
}
unsafe fn readableTypesForPasteboard(self, pasteboard: id) -> id {
let class: id = msg_send![self, class];
msg_send![class, readableTypesForPasteboard:pasteboard]
}
unsafe fn readingOptionsForType_pasteboard(self, _type: id, pasteboard: id) -> NSPasteboardReadingOptions {
let class: id = msg_send![self, class];
msg_send![class, readingOptionsForType:_type pasteboard:pasteboard]
}
}
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSPasteboardReadingOptions {
NSPasteboardReadingAsData = 0,
NSPasteboardReadingAsString = 1 << 0,
NSPasteboardReadingAsPropertyList = 1 << 1,
NSPasteboardReadingAsKeyedArchive = 1 << 2
}
#[repr(u64)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NSPasteboardWritingOptions {
NSPasteboardWritingPromised = 1 << 9,
}
pub trait NSMenu: Sized {
unsafe fn alloc(_: Self) -> id {
msg_send![class("NSMenu"), alloc]
}
unsafe fn new(_: Self) -> id {
msg_send![class("NSMenu"), new]
}
unsafe fn initWithTitle_(self, title: id /* NSString */) -> id;
unsafe fn setAutoenablesItems(self, state: BOOL);
unsafe fn addItem_(self, menu_item: id);
unsafe fn addItemWithTitle_action_keyEquivalent(self, title: id, action: SEL, key: id) -> id;
unsafe fn itemAtIndex_(self, index: NSInteger) -> id;
}
impl NSMenu for id {
unsafe fn initWithTitle_(self, title: id /* NSString */) -> id {
msg_send![self, initWithTitle:title]
}
unsafe fn setAutoenablesItems(self, state: BOOL) {
msg_send![self, setAutoenablesItems: state]
}
unsafe fn addItem_(self, menu_item: id) {
msg_send![self, addItem:menu_item]
}
unsafe fn addItemWithTitle_action_keyEquivalent(self, title: id, action: SEL, key: id) -> id {
msg_send![self, addItemWithTitle:title action:action keyEquivalent:key]
}
unsafe fn itemAtIndex_(self, index: NSInteger) -> id {
msg_send![self, itemAtIndex:index]
}
}
pub trait NSMenuItem: Sized {
unsafe fn alloc(_: Self) -> id {
msg_send![class("NSMenuItem"), alloc]
}
unsafe fn new(_: Self) -> id {
msg_send![class("NSMenuItem"), new]
}
unsafe fn separatorItem(_: Self) -> id {
msg_send![class("NSMenuItem"), separatorItem]
}
unsafe fn initWithTitle_action_keyEquivalent_(self, title: id, action: SEL, key: id) -> id;
unsafe fn setKeyEquivalentModifierMask_(self, mask: NSEventModifierFlags);
unsafe fn setSubmenu_(self, submenu: id);
}
impl NSMenuItem for id {
unsafe fn initWithTitle_action_keyEquivalent_(self, title: id, action: SEL, key: id) -> id {
msg_send![self, initWithTitle:title action:action keyEquivalent:key]
}
unsafe fn setKeyEquivalentModifierMask_(self, mask: NSEventModifierFlags) {
msg_send![self, setKeyEquivalentModifierMask:mask]
}
unsafe fn setSubmenu_(self, submenu: id) {
msg_send![self, setSubmenu:submenu]
}
}
pub type NSWindowDepth = libc::c_int;
bitflags! {
pub struct NSWindowCollectionBehavior: NSUInteger {
const NSWindowCollectionBehaviorDefault = 0;
const NSWindowCollectionBehaviorCanJoinAllSpaces = 1 << 0;
const NSWindowCollectionBehaviorMoveToActiveSpace = 1 << 1;
const NSWindowCollectionBehaviorManaged = 1 << 2;
const NSWindowCollectionBehaviorTransient = 1 << 3;
const NSWindowCollectionBehaviorStationary = 1 << 4;
const NSWindowCollectionBehaviorParticipatesInCycle = 1 << 5;
const NSWindowCollectionBehaviorIgnoresCycle = 1 << 6;
const NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7;
const NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8;
}
}
bitflags! {
pub struct NSWindowOcclusionState: NSUInteger {
const NSWindowOcclusionStateVisible = 1 << 1;
}
}
pub trait NSWindow: Sized {
unsafe fn alloc(_: Self) -> id {
msg_send![class("NSWindow"), alloc]
}
// Creating Windows
unsafe fn initWithContentRect_styleMask_backing_defer_(self,
rect: NSRect,
style: NSWindowStyleMask,
backing: NSBackingStoreType,
defer: BOOL) -> id;
unsafe fn initWithContentRect_styleMask_backing_defer_screen_(self,
rect: NSRect,
style: NSWindowStyleMask,
backing: NSBackingStoreType,
defer: BOOL,
screen: id) -> id;
// Configuring Windows
unsafe fn styleMask(self) -> NSWindowStyleMask;
unsafe fn setStyleMask_(self, styleMask: NSWindowStyleMask);
unsafe fn toggleFullScreen_(self, sender: id);
unsafe fn worksWhenModal(self) -> BOOL;
unsafe fn alphaValue(self) -> CGFloat;
unsafe fn setAlphaValue_(self, windowAlpha: CGFloat);
unsafe fn backgroundColor(self) -> id;
unsafe fn setBackgroundColor_(self, color: id);
unsafe fn colorSpace(self) -> id;
unsafe fn setColorSpace_(self, colorSpace: id);
unsafe fn contentView(self) -> id;
unsafe fn setContentView_(self, view: id);
unsafe fn canHide(self) -> BOOL;
unsafe fn setCanHide_(self, canHide: BOOL);
unsafe fn hidesOnDeactivate(self) -> BOOL;
unsafe fn setHidesOnDeactivate_(self, hideOnDeactivate: BOOL);
unsafe fn collectionBehavior(self) -> NSWindowCollectionBehavior;
unsafe fn setCollectionBehavior_(self, collectionBehavior: NSWindowCollectionBehavior);
unsafe fn setOpaque_(self, opaque: BOOL);
unsafe fn hasShadow(self) -> BOOL;
unsafe fn setHasShadow_(self, hasShadow: BOOL);
unsafe fn invalidateShadow(self);
unsafe fn autorecalculatesContentBorderThicknessForEdge_(self, edge: NSRectEdge) -> BOOL;
unsafe fn setAutorecalculatesContentBorderThickness_forEdge_(self,
autorecalculateContentBorderThickness: BOOL,
edge: NSRectEdge) -> BOOL;
unsafe fn contentBorderThicknessForEdge_(self, edge: NSRectEdge) -> CGFloat;
unsafe fn setContentBorderThickness_forEdge_(self, borderThickness: CGFloat, edge: NSRectEdge);
unsafe fn delegate(self) -> id;
unsafe fn setDelegate_(self, delegate: id);
unsafe fn preventsApplicationTerminationWhenModal(self) -> BOOL;
unsafe fn setPreventsApplicationTerminationWhenModal_(self, flag: BOOL);
// TODO: Accessing Window Information
// Getting Layout Information
unsafe fn contentRectForFrameRect_styleMask_(self, windowFrame: NSRect, windowStyle: NSWindowStyleMask) -> NSRect;
unsafe fn frameRectForContentRect_styleMask_(self, windowContentRect: NSRect, windowStyle: NSWindowStyleMask) -> NSRect;
unsafe fn minFrameWidthWithTitle_styleMask_(self, windowTitle: id, windowStyle: NSWindowStyleMask) -> CGFloat;
unsafe fn contentRectForFrameRect_(self, windowFrame: NSRect) -> NSRect;
unsafe fn frameRectForContentRect_(self, windowContent: NSRect) -> NSRect;
// Managing Windows
unsafe fn drawers(self) -> id;
unsafe fn windowController(self) -> id;
unsafe fn setWindowController_(self, windowController: id);
// TODO: Managing Sheets
// Sizing Windows
unsafe fn frame(self) -> NSRect;
unsafe fn setFrameOrigin_(self, point: NSPoint);
unsafe fn setFrameTopLeftPoint_(self, point: NSPoint);
unsafe fn constrainFrameRect_toScreen_(self, frameRect: NSRect, screen: id);
unsafe fn cascadeTopLeftFromPoint_(self, topLeft: NSPoint) -> NSPoint;
unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL);
unsafe fn setFrame_displayViews_(self, windowFrame: NSRect, display: BOOL);
unsafe fn aspectRatio(self) -> NSSize;
unsafe fn setAspectRatio_(self, aspectRatio: NSSize);
unsafe fn minSize(self) -> NSSize;
unsafe fn setMinSize_(self, minSize: NSSize);
unsafe fn maxSize(self) -> NSSize;
unsafe fn setMaxSize_(self, maxSize: NSSize);
unsafe fn performZoom_(self, sender: id);
unsafe fn zoom_(self, sender: id);
unsafe fn resizeFlags(self) -> NSInteger;
unsafe fn showsResizeIndicator(self) -> BOOL;
unsafe fn setShowsResizeIndicator_(self, showsResizeIndicator: BOOL);
unsafe fn resizeIncrements(self) -> NSSize;
unsafe fn setResizeIncrements_(self, resizeIncrements: NSSize);
unsafe fn preservesContentDuringLiveResize(self) -> BOOL;
unsafe fn setPreservesContentDuringLiveResize_(self, preservesContentDuringLiveResize: BOOL);
unsafe fn inLiveResize(self) -> BOOL;
// Sizing Content
unsafe fn contentAspectRatio(self) -> NSSize;
unsafe fn setContentAspectRatio_(self, contentAspectRatio: NSSize);
unsafe fn contentMinSize(self) -> NSSize;
unsafe fn setContentMinSize_(self, contentMinSize: NSSize);
unsafe fn contentSize(self) -> NSSize;
unsafe fn setContentSize_(self, contentSize: NSSize);
unsafe fn contentMaxSize(self) -> NSSize;
unsafe fn setContentMaxSize_(self, contentMaxSize: NSSize);
unsafe fn contentResizeIncrements(self) -> NSSize;
unsafe fn setContentResizeIncrements_(self, contentResizeIncrements: NSSize);
// Managing Window Visibility and Occlusion State
unsafe fn isVisible(self) -> BOOL; // NOTE: Deprecated in 10.9
unsafe fn occlusionState(self) -> NSWindowOcclusionState;
// Managing Window Layers
unsafe fn orderOut_(self, sender: id);
unsafe fn orderBack_(self, sender: id);
unsafe fn orderFront_(self, sender: id);
unsafe fn orderFrontRegardless(self);
unsafe fn orderFrontWindow_relativeTo_(self, orderingMode: NSWindowOrderingMode, otherWindowNumber: NSInteger);
unsafe fn level(self) -> NSInteger;
unsafe fn setLevel_(self, level: NSInteger);
// Managing Key Status
unsafe fn canBecomeKeyWindow(self) -> BOOL;
unsafe fn makeKeyWindow(self);
unsafe fn makeKeyAndOrderFront_(self, sender: id);
// skipped: becomeKeyWindow (should not be invoked directly, according to Apple's documentation)
// skipped: resignKeyWindow (should not be invoked directly, according to Apple's documentation)
// Managing Main Status
unsafe fn canBecomeMainWindow(self) -> BOOL;
unsafe fn makeMainWindow(self);
// skipped: becomeMainWindow (should not be invoked directly, according to Apple's documentation)
// skipped: resignMainWindow (should not be invoked directly, according to Apple's documentation)
// TODO: Managing Toolbars
// TODO: Managing Attached Windows
// TODO: Managing Window Buffers
// TODO: Managing Default Buttons
// TODO: Managing Field Editors
// TODO: Managing the Window Menu
// TODO: Managing Cursor Rectangles
// Managing Title Bars
unsafe fn standardWindowButton_(self, windowButtonKind: NSWindowButton) -> id;
// TODO: Managing Tooltips
// TODO: Handling Events
// Managing Responders
unsafe fn initialFirstResponder(self) -> id;
unsafe fn firstResponder(self) -> id;
unsafe fn setInitialFirstResponder_(self, responder: id);
unsafe fn makeFirstResponder_(self, responder: id) -> BOOL;
// TODO: Managing the Key View Loop
// Handling Keyboard Events
unsafe fn keyDown_(self, event: id);
// Handling Mouse Events
unsafe fn acceptsMouseMovedEvents(self) -> BOOL;
unsafe fn ignoresMouseEvents(self) -> BOOL;
unsafe fn setIgnoresMouseEvents_(self, ignoreMouseEvents: BOOL);
unsafe fn mouseLocationOutsideOfEventStream(self) -> NSPoint;
unsafe fn setAcceptsMouseMovedEvents_(self, acceptMouseMovedEvents: BOOL);
unsafe fn windowNumberAtPoint_belowWindowWithWindowNumber_(self,
point: NSPoint,
windowNumber: NSInteger) -> NSInteger;
// TODO: Handling Window Restoration
// TODO: Bracketing Drawing Operations
// TODO: Drawing Windows
// TODO: Window Animation
// TODO: Updating Windows
// TODO: Dragging Items
// Converting Coordinates
unsafe fn backingScaleFactor(self) -> CGFloat;
unsafe fn backingAlignedRect_options_(self, rect: NSRect, options: NSAlignmentOptions) -> NSRect;
unsafe fn convertRectFromBacking_(self, rect: NSRect) -> NSRect;
unsafe fn convertRectToBacking_(self, rect: NSRect) -> NSRect;
unsafe fn convertRectToScreen_(self, rect: NSRect) -> NSRect;
unsafe fn convertRectFromScreen_(self, rect: NSRect) -> NSRect;
// Accessing Edited Status
unsafe fn setDocumentEdited_(self, documentEdited: BOOL);
// Managing Titles
unsafe fn title(self) -> id;
unsafe fn setTitle_(self, title: id);
unsafe fn setTitleWithRepresentedFilename_(self, filePath: id);
unsafe fn setTitleVisibility_(self, visibility: NSWindowTitleVisibility);
unsafe fn setTitlebarAppearsTransparent_(self, transparent: BOOL);
unsafe fn representedFilename(self) -> id;
unsafe fn setRepresentedFilename_(self, filePath: id);
unsafe fn representedURL(self) -> id;
unsafe fn setRepresentedURL_(self, representedURL: id);
// Accessing Screen Information
unsafe fn screen(self) -> id;
unsafe fn deepestScreen(self) -> id;
unsafe fn displaysWhenScreenProfileChanges(self) -> BOOL;
unsafe fn setDisplaysWhenScreenProfileChanges_(self, displaysWhenScreenProfileChanges: BOOL);
// Moving Windows
unsafe fn setMovableByWindowBackground_(self, movableByWindowBackground: BOOL);
unsafe fn setMovable_(self, movable: BOOL);
unsafe fn center(self);
// Closing Windows
unsafe fn performClose_(self, sender: id);
unsafe fn close(self);
unsafe fn setReleasedWhenClosed_(self, releasedWhenClosed: BOOL);
// Minimizing Windows
unsafe fn performMiniaturize_(self, sender: id);
unsafe fn miniaturize_(self, sender: id);
unsafe fn deminiaturize_(self, sender: id);
unsafe fn miniwindowImage(self) -> id;
unsafe fn setMiniwindowImage_(self, miniwindowImage: id);
unsafe fn miniwindowTitle(self) -> id;
unsafe fn setMiniwindowTitle_(self, miniwindowTitle: id);
// TODO: Getting the Dock Tile
// TODO: Printing Windows
// TODO: Providing Services
// TODO: Working with Carbon
// TODO: Triggering Constraint-Based Layout
// TODO: Debugging Constraint-Based Layout
// TODO: Constraint-Based Layouts
}
impl NSWindow for id {
// Creating Windows
unsafe fn initWithContentRect_styleMask_backing_defer_(self,
rect: NSRect,
style: NSWindowStyleMask,
backing: NSBackingStoreType,
defer: BOOL) -> id {
msg_send![self, initWithContentRect:rect
styleMask:style.bits
backing:backing as NSUInteger
defer:defer]
}
unsafe fn initWithContentRect_styleMask_backing_defer_screen_(self,
rect: NSRect,
style: NSWindowStyleMask,
backing: NSBackingStoreType,
defer: BOOL,
screen: id) -> id {
msg_send![self, initWithContentRect:rect
styleMask:style.bits
backing:backing as NSUInteger
defer:defer
screen:screen]
}
// Configuring Windows
unsafe fn styleMask(self) -> NSWindowStyleMask {
let styleMask = NSWindowStyleMask::from_bits_truncate(msg_send![self, styleMask]);
styleMask
}
unsafe fn setStyleMask_(self, styleMask: NSWindowStyleMask) {
msg_send![self, setStyleMask:styleMask.bits]
}
unsafe fn toggleFullScreen_(self, sender: id) {
msg_send![self, toggleFullScreen:sender]
}
unsafe fn worksWhenModal(self) -> BOOL {
msg_send![self, worksWhenModal]
}
unsafe fn alphaValue(self) -> CGFloat {
msg_send![self, alphaValue]
}
unsafe fn setAlphaValue_(self, windowAlpha: CGFloat) {
msg_send![self, setAlphaValue:windowAlpha]
}
unsafe fn backgroundColor(self) -> id {
msg_send![self, backgroundColor]
}
unsafe fn setBackgroundColor_(self, color: id) {
msg_send![self, setBackgroundColor:color]
}
unsafe fn colorSpace(self) -> id {
msg_send![self, colorSpace]
}
unsafe fn setColorSpace_(self, colorSpace: id) {
msg_send![self, setColorSpace:colorSpace]
}
unsafe fn contentView(self) -> id {
msg_send![self, contentView]
}
unsafe fn setContentView_(self, view: id) {
msg_send![self, setContentView:view]
}
unsafe fn canHide(self) -> BOOL {
msg_send![self, canHide]
}
unsafe fn setCanHide_(self, canHide: BOOL) {
msg_send![self, setCanHide:canHide]
}
unsafe fn hidesOnDeactivate(self) -> BOOL {
msg_send![self, hidesOnDeactivate]
}
unsafe fn setHidesOnDeactivate_(self, hideOnDeactivate: BOOL) {
msg_send![self, setHidesOnDeactivate:hideOnDeactivate]
}
unsafe fn collectionBehavior(self) -> NSWindowCollectionBehavior {
msg_send![self, collectionBehavior]
}
unsafe fn setCollectionBehavior_(self, collectionBehavior: NSWindowCollectionBehavior) {
msg_send![self, setCollectionBehavior:collectionBehavior]
}
unsafe fn setOpaque_(self, opaque: BOOL) {
msg_send![self, setOpaque:opaque]
}
unsafe fn hasShadow(self) -> BOOL {
msg_send![self, hasShadow]
}
unsafe fn setHasShadow_(self, hasShadow: BOOL) {
msg_send![self, setHasShadow:hasShadow]
}
unsafe fn invalidateShadow(self) {
msg_send![self, invalidateShadow]
}
unsafe fn autorecalculatesContentBorderThicknessForEdge_(self, edge: NSRectEdge) -> BOOL {
msg_send![self, autorecalculatesContentBorderThicknessForEdge:edge]
}
unsafe fn setAutorecalculatesContentBorderThickness_forEdge_(self,
autorecalculateContentBorderThickness: BOOL,
edge: NSRectEdge) -> BOOL {
msg_send![self, setAutorecalculatesContentBorderThickness:
autorecalculateContentBorderThickness forEdge:edge]
}
unsafe fn contentBorderThicknessForEdge_(self, edge: NSRectEdge) -> CGFloat {
msg_send![self, contentBorderThicknessForEdge:edge]
}
unsafe fn setContentBorderThickness_forEdge_(self, borderThickness: CGFloat, edge: NSRectEdge) {
msg_send![self, setContentBorderThickness:borderThickness forEdge:edge]
}
unsafe fn delegate(self) -> id {
msg_send![self, delegate]
}
unsafe fn setDelegate_(self, delegate: id) {
msg_send![self, setDelegate:delegate]
}
unsafe fn preventsApplicationTerminationWhenModal(self) -> BOOL {
msg_send![self, preventsApplicationTerminationWhenModal]
}
unsafe fn setPreventsApplicationTerminationWhenModal_(self, flag: BOOL) {
msg_send![self, setPreventsApplicationTerminationWhenModal:flag]
}
// TODO: Accessing Window Information
// Getting Layout Information
unsafe fn contentRectForFrameRect_styleMask_(self, windowFrame: NSRect, windowStyle: NSWindowStyleMask) -> NSRect {
msg_send![self, contentRectForFrameRect:windowFrame styleMask:windowStyle.bits]
}
unsafe fn frameRectForContentRect_styleMask_(self, windowContentRect: NSRect, windowStyle: NSWindowStyleMask) -> NSRect {
msg_send![self, frameRectForContentRect:windowContentRect styleMask:windowStyle.bits]
}
unsafe fn minFrameWidthWithTitle_styleMask_(self, windowTitle: id, windowStyle: NSWindowStyleMask) -> CGFloat {
msg_send![self, minFrameWidthWithTitle:windowTitle styleMask:windowStyle.bits]
}
unsafe fn contentRectForFrameRect_(self, windowFrame: NSRect) -> NSRect {
msg_send![self, contentRectForFrameRect:windowFrame]
}
unsafe fn frameRectForContentRect_(self, windowContent: NSRect) -> NSRect {
msg_send![self, frameRectForContentRect:windowContent]
}
// Managing Windows
unsafe fn drawers(self) -> id {
msg_send![self, drawers]
}
unsafe fn windowController(self) -> id {
msg_send![self, windowController]
}
unsafe fn setWindowController_(self, windowController: id) {
msg_send![self, setWindowController:windowController]
}
// TODO: Managing Sheets
// Sizing Windows
unsafe fn frame(self) -> NSRect {
msg_send![self, frame]
}
unsafe fn setFrameOrigin_(self, point: NSPoint) {
msg_send![self, setFrameOrigin:point]
}
unsafe fn setFrameTopLeftPoint_(self, point: NSPoint) {
msg_send![self, setFrameTopLeftPoint:point]
}
unsafe fn constrainFrameRect_toScreen_(self, frameRect: NSRect, screen: id) {
msg_send![self, constrainFrameRect:frameRect toScreen:screen]
}
unsafe fn cascadeTopLeftFromPoint_(self, topLeft: NSPoint) -> NSPoint {
msg_send![self, cascadeTopLeftFromPoint:topLeft]
}
unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL) {
msg_send![self, setFrame:windowFrame display:display]
}
unsafe fn setFrame_displayViews_(self, windowFrame: NSRect, display: BOOL) {
msg_send![self, setFrame:windowFrame displayViews:display]
}
unsafe fn aspectRatio(self) -> NSSize {
msg_send![self, aspectRatio]
}
unsafe fn setAspectRatio_(self, aspectRatio: NSSize) {
msg_send![self, setAspectRatio:aspectRatio]
}
unsafe fn minSize(self) -> NSSize {
msg_send![self, minSize]
}
unsafe fn setMinSize_(self, minSize: NSSize) {
msg_send![self, setMinSize:minSize]
}
unsafe fn maxSize(self) -> NSSize {
msg_send![self, maxSize]
}
unsafe fn setMaxSize_(self, maxSize: NSSize) {
msg_send![self, setMaxSize:maxSize]
}
unsafe fn performZoom_(self, sender: id) {
msg_send![self, performZoom:sender]
}
unsafe fn zoom_(self, sender: id) {
msg_send![self, zoom:sender]
}
unsafe fn resizeFlags(self) -> NSInteger {
msg_send![self, resizeFlags]
}
unsafe fn showsResizeIndicator(self) -> BOOL {
msg_send![self, showsResizeIndicator]
}
unsafe fn setShowsResizeIndicator_(self, showsResizeIndicator: BOOL) {
msg_send![self, setShowsResizeIndicator:showsResizeIndicator]
}
unsafe fn resizeIncrements(self) -> NSSize {
msg_send![self, resizeIncrements]
}
unsafe fn setResizeIncrements_(self, resizeIncrements: NSSize) {
msg_send![self, setResizeIncrements:resizeIncrements]
}
unsafe fn preservesContentDuringLiveResize(self) -> BOOL {
msg_send![self, preservesContentDuringLiveResize]
}
unsafe fn setPreservesContentDuringLiveResize_(self, preservesContentDuringLiveResize: BOOL) {
msg_send![self, setPreservesContentDuringLiveResize:preservesContentDuringLiveResize]
}
unsafe fn inLiveResize(self) -> BOOL {
msg_send![self, inLiveResize]
}
// Sizing Content
unsafe fn contentAspectRatio(self) -> NSSize {
msg_send![self, contentAspectRatio]
}
unsafe fn setContentAspectRatio_(self, contentAspectRatio: NSSize) {
msg_send![self, setContentAspectRatio:contentAspectRatio]
}
unsafe fn contentMinSize(self) -> NSSize {
msg_send![self, contentMinSize]
}
unsafe fn setContentMinSize_(self, contentMinSize: NSSize) {
msg_send![self, setContentMinSize:contentMinSize]
}
unsafe fn contentSize(self) -> NSSize {
msg_send![self, contentSize]
}
unsafe fn setContentSize_(self, contentSize: NSSize) {
msg_send![self, setContentSize:contentSize]
}
unsafe fn contentMaxSize(self) -> NSSize {
msg_send![self, contentMaxSize]
}
unsafe fn setContentMaxSize_(self, contentMaxSize: NSSize) {
msg_send![self, setContentMaxSize:contentMaxSize]
}
unsafe fn contentResizeIncrements(self) -> NSSize {
msg_send![self, contentResizeIncrements]
}
unsafe fn setContentResizeIncrements_(self, contentResizeIncrements: NSSize) {
msg_send![self, setContentResizeIncrements:contentResizeIncrements]
}
// Managing Window Visibility and Occlusion State
unsafe fn isVisible(self) -> BOOL {
msg_send![self, isVisible]
}
unsafe fn occlusionState(self) -> NSWindowOcclusionState {
msg_send![self, occlusionState]
}
// Managing Window Layers
unsafe fn orderOut_(self, sender: id) {
msg_send![self, orderOut:sender]
}
unsafe fn orderBack_(self, sender: id) {
msg_send![self, orderBack:sender]
}
unsafe fn orderFront_(self, sender: id) {
msg_send![self, orderFront:sender]
}
unsafe fn orderFrontRegardless(self) {
msg_send![self, orderFrontRegardless]
}
unsafe fn orderFrontWindow_relativeTo_(self, ordering_mode: NSWindowOrderingMode, other_window_number: NSInteger) {
msg_send![self, orderWindow:ordering_mode relativeTo:other_window_number]
}
unsafe fn level(self) -> NSInteger {
msg_send![self, level]
}
unsafe fn setLevel_(self, level: NSInteger) {
msg_send![self, setLevel:level]
}
// Managing Key Status
unsafe fn canBecomeKeyWindow(self) -> BOOL {
msg_send![self, canBecomeKeyWindow]
}
unsafe fn makeKeyWindow(self) {
msg_send![self, makeKeyWindow]
}
unsafe fn makeKeyAndOrderFront_(self, sender: id) {
msg_send![self, makeKeyAndOrderFront:sender]
}
// Managing Main Status
unsafe fn canBecomeMainWindow(self) -> BOOL {
msg_send![self, canBecomeMainWindow]
}
unsafe fn makeMainWindow(self) {
msg_send![self, makeMainWindow]
}
// TODO: Managing Toolbars
// TODO: Managing Attached Windows
// TODO: Managing Window Buffers
// TODO: Managing Default Buttons
// TODO: Managing Field Editors
// TODO: Managing the Window Menu
// TODO: Managing Cursor Rectangles
// Managing Title Bars
unsafe fn standardWindowButton_(self, windowButtonKind: NSWindowButton) -> id {
msg_send![self, standardWindowButton:windowButtonKind]
}
// TODO: Managing Tooltips
// TODO: Handling Events
// Managing Responders
unsafe fn initialFirstResponder(self) -> id {
msg_send![self, initialFirstResponder]
}
unsafe fn firstResponder(self) -> id {
msg_send![self, firstResponder]
}
unsafe fn setInitialFirstResponder_(self, responder: id) {
msg_send![self, setInitialFirstResponder:responder]
}
unsafe fn makeFirstResponder_(self, responder: id) -> BOOL {
msg_send![self, makeFirstResponder:responder]
}
// TODO: Managing the Key View Loop
// Handling Keyboard Events
unsafe fn keyDown_(self, event: id) {
msg_send![self, keyDown:event]
}
// Handling Mouse Events
unsafe fn acceptsMouseMovedEvents(self) -> BOOL {
msg_send![self, acceptsMouseMovedEvents]
}
unsafe fn ignoresMouseEvents(self) -> BOOL {
msg_send![self, ignoresMouseEvents]
}
unsafe fn setIgnoresMouseEvents_(self, ignoreMouseEvents: BOOL) {
msg_send![self, setIgnoresMouseEvents:ignoreMouseEvents]
}
unsafe fn mouseLocationOutsideOfEventStream(self) -> NSPoint {
msg_send![self, mouseLocationOutsideOfEventStream]
}
unsafe fn setAcceptsMouseMovedEvents_(self, acceptMouseMovedEvents: BOOL) {
msg_send![self, setAcceptsMouseMovedEvents:acceptMouseMovedEvents]
}
unsafe fn windowNumberAtPoint_belowWindowWithWindowNumber_(self,
point: NSPoint,
windowNumber: NSInteger) -> NSInteger {
msg_send![self, windowNumberAtPoint:point belowWindowWithWindowNumber:windowNumber]
}
// Converting Coordinates
unsafe fn backingScaleFactor(self) -> CGFloat {
msg_send![self, backingScaleFactor]
}
unsafe fn backingAlignedRect_options_(self, rect: NSRect, options: NSAlignmentOptions) -> NSRect {
msg_send![self, backingAlignedRect:rect options:options]
}
unsafe fn convertRectFromBacking_(self, rect: NSRect) -> NSRect {
msg_send![self, convertRectFromBacking:rect]
}
unsafe fn convertRectToBacking_(self, rect: NSRect) -> NSRect {
msg_send![self, convertRectToBacking:rect]
}
unsafe fn convertRectToScreen_(self, rect: NSRect) -> NSRect {
msg_send![self, convertRectToScreen:rect]
}
unsafe fn convertRectFromScreen_(self, rect: NSRect) -> NSRect {
msg_send![self, convertRectFromScreen:rect]
}
// Accessing Edited Status
unsafe fn setDocumentEdited_(self, documentEdited: BOOL) {
msg_send![self, setDocumentEdited:documentEdited]
}
// Managing Titles
unsafe fn title(self) -> id {
msg_send![self, title]
}
unsafe fn setTitle_(self, title: id) {
msg_send![self, setTitle:title]
}
unsafe fn setTitleWithRepresentedFilename_(self, filePath: id) {
msg_send![self, setTitleWithRepresentedFilename:filePath]
}
unsafe fn setTitleVisibility_(self, visibility: NSWindowTitleVisibility) {
msg_send![self, setTitleVisibility:visibility]
}
unsafe fn setTitlebarAppearsTransparent_(self, transparent: BOOL) {
msg_send![self, setTitlebarAppearsTransparent:transparent]
}
unsafe fn representedFilename(self) -> id {
msg_send![self, representedFilename]
}
unsafe fn setRepresentedFilename_(self, filePath: id) {
msg_send![self, setRepresentedFilename:filePath]
}
unsafe fn representedURL(self) -> id {
msg_send![self, representedURL]
}
unsafe fn setRepresentedURL_(self, representedURL: id) {
msg_send![self, setRepresentedURL:representedURL]
}
// Accessing Screen Information
unsafe fn screen(self) -> id {
msg_send![self, screen]
}
unsafe fn deepestScreen(self) -> id {
msg_send![self, deepestScreen]
}
unsafe fn displaysWhenScreenProfileChanges(self) -> BOOL {
msg_send![self, displaysWhenScreenProfileChanges]
}
unsafe fn setDisplaysWhenScreenProfileChanges_(self, displaysWhenScreenProfileChanges: BOOL) {
msg_send![self, setDisplaysWhenScreenProfileChanges:displaysWhenScreenProfileChanges]
}
// Moving Windows
unsafe fn setMovableByWindowBackground_(self, movableByWindowBackground: BOOL) {
msg_send![self, setMovableByWindowBackground:movableByWindowBackground]
}
unsafe fn setMovable_(self, movable: BOOL) {
msg_send![self, setMovable:movable]
}
unsafe fn center(self) {
msg_send![self, center]
}
// Closing Windows
unsafe fn performClose_(self, sender: id) {
msg_send![self, performClose:sender]
}
unsafe fn close(self) {
msg_send![self, close]
}
unsafe fn setReleasedWhenClosed_(self, releasedWhenClosed: BOOL) {
msg_send![self, setReleasedWhenClosed:releasedWhenClosed]
}
// Minimizing Windows
unsafe fn performMiniaturize_(self, sender: id) {
msg_send![self, performMiniaturize:sender]
}
unsafe fn miniaturize_(self, sender: id) {
msg_send![self, miniaturize:sender]
}
unsafe fn deminiaturize_(self, sender: id) {
msg_send![self, deminiaturize:sender]
}
unsafe fn miniwindowImage(self) -> id {
msg_send![self, miniwindowImage]
}
unsafe fn setMiniwindowImage_(self, miniwindowImage: id) {
msg_send![self, setMiniwindowImage:miniwindowImage]
}
unsafe fn miniwindowTitle(self) -> id {
msg_send![self, miniwindowTitle]
}
unsafe fn setMiniwindowTitle_(self, miniwindowTitle: id) {
msg_send![self, setMiniwindowTitle:miniwindowTitle]
}
// TODO: Getting the Dock Tile
// TODO: Printing Windows
// TODO: Providing Services
// TODO: Working with Carbon
// TODO: Triggering Constraint-Based Layout
// TODO: Debugging Constraint-Based Layout
// TODO: Constraint-Based Layouts
}
pub trait NSView: Sized {
unsafe fn alloc(_: Self) -> id {
msg_send![class("NSView"), alloc]
}
unsafe fn init(self) -> id;
unsafe fn initWithFrame_(self, frameRect: NSRect) -> id;
unsafe fn bounds(self) -> NSRect;
unsafe fn frame(self) -> NSRect;
unsafe fn display_(self);
unsafe fn setWantsBestResolutionOpenGLSurface_(self, flag: BOOL);
unsafe fn convertPoint_fromView_(self, point: NSPoint, view: id) -> NSPoint;
unsafe fn addSubview_(self, view: id);
unsafe fn superview(self) -> id;
unsafe fn removeFromSuperview(self);
unsafe fn setAutoresizingMask_(self, autoresizingMask: NSAutoresizingMaskOptions);
unsafe fn wantsLayer(self) -> BOOL;
unsafe fn setWantsLayer(self, wantsLayer: BOOL);
unsafe fn layer(self) -> id;
unsafe fn setLayer(self, layer: id);
unsafe fn widthAnchor(self) -> id;
unsafe fn heightAnchor(self) -> id;
}
impl NSView for id {
unsafe fn init(self) -> id {
msg_send![self, init]
}
unsafe fn initWithFrame_(self, frameRect: NSRect) -> id {
msg_send![self, initWithFrame:frameRect]
}
unsafe fn bounds(self) -> NSRect {
msg_send![self, bounds]
}
unsafe fn frame(self) -> NSRect {
msg_send![self, frame]
}
unsafe fn display_(self) {
msg_send![self, display]
}
unsafe fn setWantsBestResolutionOpenGLSurface_(self, flag: BOOL) {
msg_send![self, setWantsBestResolutionOpenGLSurface:flag]
}
unsafe fn convertPoint_fromView_(self, point: NSPoint, view: id) -> NSPoint {
msg_send![self, convertPoint:point fromView:view]
}
unsafe fn addSubview_(self, view: id) {
msg_send![self, addSubview:view]
}
unsafe fn superview(self) -> id {
msg_send![self, superview]
}
unsafe fn removeFromSuperview(self) {
msg_send![self, removeFromSuperview]
}
unsafe fn setAutoresizingMask_(self, autoresizingMask: NSAutoresizingMaskOptions) {
msg_send![self, setAutoresizingMask:autoresizingMask]
}
unsafe fn wantsLayer(self) -> BOOL {
msg_send![self, wantsLayer]
}
unsafe fn setWantsLayer(self, wantsLayer: BOOL) {
msg_send![self, setWantsLayer:wantsLayer]
}
unsafe fn layer(self) -> id {
msg_send![self, layer]
}
unsafe fn setLayer(self, layer: id) {
msg_send![self, setLayer:layer]
}
unsafe fn widthAnchor(self) -> id {
msg_send![self, widthAnchor]
}
unsafe fn heightAnchor(self) -> id {
msg_send![self, heightAnchor]
}
}
pub type NSAutoresizingMaskOptions = u64;
pub const NSViewNotSizable: u64 = 0;
pub const NSViewMinXMargin: u64 = 1;
pub const NSViewWidthSizable: u64 = 2;
pub const NSViewMaxXMargin: u64 = 4;
pub const NSViewMinYMargin: u64 = 8;
pub const NSViewHeightSizable: u64 = 16;
pub const NSViewMaxYMargin: u64 = 32;
pub trait NSOpenGLView: Sized {
unsafe fn alloc(_: Self) -> id {
msg_send![class("NSOpenGLView"), alloc]
}
unsafe fn initWithFrame_pixelFormat_(self, frameRect: NSRect, format: id) -> id;
unsafe fn display_(self);
unsafe fn setOpenGLContext_(self, context: id);
unsafe fn setPixelFormat_(self, pixelformat: id);
}
impl NSOpenGLView for id {
unsafe fn initWithFrame_pixelFormat_(self, frameRect: NSRect, format: id) -> id {
msg_send![self, initWithFrame:frameRect pixelFormat:format]
}
unsafe fn display_(self) {
msg_send![self, display]
}
unsafe fn setOpenGLContext_(self, context: id) {
msg_send![self, setOpenGLContext:context]
}
unsafe fn setPixelFormat_(self, pixelformat: id) {
msg_send![self, setPixelFormat:pixelformat]
}
}
pub trait NSOpenGLPixelFormat: Sized {
unsafe fn alloc(_: Self) -> id {
msg_send![class("NSOpenGLPixelFormat"), alloc]
}
// Creating an NSOpenGLPixelFormat Object
unsafe fn initWithAttributes_(self, attributes: &[u32]) -> id;
// Managing the Pixel Format
unsafe fn getValues_forAttribute_forVirtualScreen_(self, val: *mut GLint, attrib: NSOpenGLPixelFormatAttribute, screen: GLint);
unsafe fn numberOfVirtualScreens(self) -> GLint;
}
impl NSOpenGLPixelFormat for id {
// Creating an NSOpenGLPixelFormat Object
unsafe fn initWithAttributes_(self, attributes: &[u32]) -> id {
msg_send![self, initWithAttributes:attributes]
}
// Managing the Pixel Format
unsafe fn getValues_forAttribute_forVirtualScreen_(self, val: *mut GLint, attrib: NSOpenGLPixelFormatAttribute, screen: GLint) {
msg_send![self, getValues:val forAttribute:attrib forVirtualScreen:screen]
}
unsafe fn numberOfVirtualScreens(self) -> GLint {
msg_send![self, numberOfVirtualScreens]
}
}
pub trait NSOpenGLContext: Sized {
unsafe fn alloc(_: Self) -> id {
msg_send![class("NSOpenGLContext"), alloc]
}
// Context Creation
unsafe fn initWithFormat_shareContext_(self, format: id /* (NSOpenGLPixelFormat *) */, shareContext: id /* (NSOpenGLContext *) */) -> id /* (instancetype) */;
unsafe fn initWithCGLContextObj_(self, context: CGLContextObj) -> id /* (instancetype) */;
// Managing the Current Context
unsafe fn clearCurrentContext(_: Self);
unsafe fn currentContext(_: Self) -> id /* (NSOpenGLContext *) */;
unsafe fn makeCurrentContext(self);
// Drawable Object Management
unsafe fn setView_(self, view: id /* (NSView *) */);
unsafe fn view(self) -> id /* (NSView *) */;
unsafe fn clearDrawable(self);
unsafe fn update(self);
// Flushing the Drawing Buffer
unsafe fn flushBuffer(self);
// Context Parameter Handling
unsafe fn setValues_forParameter_(self, vals: *const GLint, param: NSOpenGLContextParameter);
unsafe fn getValues_forParameter_(self, vals: *mut GLint, param: NSOpenGLContextParameter);
// Working with Virtual Screens
unsafe fn setCurrentVirtualScreen_(self, screen: GLint);
unsafe fn currentVirtualScreen(self) -> GLint;
// Getting the CGL Context Object
unsafe fn CGLContextObj(self) -> CGLContextObj;
}
impl NSOpenGLContext for id {
// Context Creation
unsafe fn initWithFormat_shareContext_(self, format: id /* (NSOpenGLPixelFormat *) */, shareContext: id /* (NSOpenGLContext *) */) -> id /* (instancetype) */ {
msg_send![self, initWithFormat:format shareContext:shareContext]
}
unsafe fn initWithCGLContextObj_(self, context: CGLContextObj) -> id /* (instancetype) */ {
msg_send![self, initWithCGLContextObj:context]
}
// Managing the Current Context
unsafe fn clearCurrentContext(_: Self) {
msg_send![class("NSOpenGLContext"), clearCurrentContext]
}
unsafe fn currentContext(_: Self) -> id /* (NSOpenGLContext *) */ {
msg_send![class("NSOpenGLContext"), currentContext]
}
unsafe fn makeCurrentContext(self) {
msg_send![self, makeCurrentContext]
}
// Drawable Object Management
unsafe fn setView_(self, view: id /* (NSView *) */) {
msg_send![self, setView:view]
}
unsafe fn view(self) -> id /* (NSView *) */ {
msg_send![self, view]
}
unsafe fn clearDrawable(self) {
msg_send![self, clearDrawable]
}
unsafe fn update(self) {
msg_send![self, update]
}
// Flushing the Drawing Buffer
unsafe fn flushBuffer(self) {
msg_send![self, flushBuffer]
}
// Context Parameter Handling
unsafe fn setValues_forParameter_(self, vals: *const GLint, param: NSOpenGLContextParameter) {
msg_send![self, setValues:vals forParameter:param]
}
unsafe fn getValues_forParameter_(self, vals: *mut GLint, param: NSOpenGLContextParameter) {
msg_send![self, getValues:vals forParameter:param]
}
// Working with Virtual Screens
unsafe fn setCurrentVirtualScreen_(self, screen: GLint) {
msg_send![self, setCurrentVirtualScreen:screen]
}
unsafe fn currentVirtualScreen(self) -> GLint {
msg_send![self, currentVirtualScreen]
}
// Getting the CGL Context Object
unsafe fn CGLContextObj(self) -> CGLContextObj {
msg_send![self, CGLContextObj]
}
}
bitflags! {
pub struct NSEventSwipeTrackingOptions: NSUInteger {
const NSEventSwipeTrackingLockDirection = 0x1 << 0;
const NSEventSwipeTrackingClampGestureAmount = 0x1 << 1;
}
}
#[repr(i64)] // NSInteger
pub enum NSEventGestureAxis {
NSEventGestureAxisNone = 0,
NSEventGestureAxisHorizontal,
NSEventGestureAxisVertical,
}
bitflags! {
pub struct NSEventPhase: NSUInteger {
const NSEventPhaseNone = 0;
const NSEventPhaseBegan = 0x1 << 0;
const NSEventPhaseStationary = 0x1 << 1;
const NSEventPhaseChanged = 0x1 << 2;
const NSEventPhaseEnded = 0x1 << 3;
const NSEventPhaseCancelled = 0x1 << 4;
const NSEventPhaseMayBegin = 0x1 << 5;
}
}
bitflags! {
pub struct NSTouchPhase: NSUInteger {
const NSTouchPhaseBegan = 1 << 0;
const NSTouchPhaseMoved = 1 << 1;
const NSTouchPhaseStationary = 1 << 2;
const NSTouchPhaseEnded = 1 << 3;
const NSTouchPhaseCancelled = 1 << 4;
const NSTouchPhaseTouching = NSTouchPhase::NSTouchPhaseBegan.bits
| NSTouchPhase::NSTouchPhaseMoved.bits
| NSTouchPhase::NSTouchPhaseStationary.bits;
const NSTouchPhaseAny = !0; // NSUIntegerMax
}
}
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u64)] // NSUInteger
pub enum NSEventType {
NSLeftMouseDown = 1,
NSLeftMouseUp = 2,
NSRightMouseDown = 3,
NSRightMouseUp = 4,
NSMouseMoved = 5,
NSLeftMouseDragged = 6,
NSRightMouseDragged = 7,
NSMouseEntered = 8,
NSMouseExited = 9,
NSKeyDown = 10,
NSKeyUp = 11,
NSFlagsChanged = 12,
NSAppKitDefined = 13,
NSSystemDefined = 14,
NSApplicationDefined = 15,
NSPeriodic = 16,
NSCursorUpdate = 17,
NSScrollWheel = 22,
NSTabletPoint = 23,
NSTabletProximity = 24,
NSOtherMouseDown = 25,
NSOtherMouseUp = 26,
NSOtherMouseDragged = 27,
NSEventTypeGesture = 29,
NSEventTypeMagnify = 30,
NSEventTypeSwipe = 31,
NSEventTypeRotate = 18,
NSEventTypeBeginGesture = 19,
NSEventTypeEndGesture = 20,
NSEventTypePressure = 34,
}
bitflags! {
pub struct NSEventMask: libc::c_ulonglong {
const NSLeftMouseDownMask = 1 << NSLeftMouseDown as libc::c_ulonglong;
const NSLeftMouseUpMask = 1 << NSLeftMouseUp as libc::c_ulonglong;
const NSRightMouseDownMask = 1 << NSRightMouseDown as libc::c_ulonglong;
const NSRightMouseUpMask = 1 << NSRightMouseUp as libc::c_ulonglong;
const NSMouseMovedMask = 1 << NSMouseMoved as libc::c_ulonglong;
const NSLeftMouseDraggedMask = 1 << NSLeftMouseDragged as libc::c_ulonglong;
const NSRightMouseDraggedMask = 1 << NSRightMouseDragged as libc::c_ulonglong;
const NSMouseEnteredMask = 1 << NSMouseEntered as libc::c_ulonglong;
const NSMouseExitedMask = 1 << NSMouseExited as libc::c_ulonglong;
const NSKeyDownMask = 1 << NSKeyDown as libc::c_ulonglong;
const NSKeyUpMask = 1 << NSKeyUp as libc::c_ulonglong;
const NSFlagsChangedMask = 1 << NSFlagsChanged as libc::c_ulonglong;
const NSAppKitDefinedMask = 1 << NSAppKitDefined as libc::c_ulonglong;
const NSSystemDefinedMask = 1 << NSSystemDefined as libc::c_ulonglong;
const NSApplicationDefinedMask = 1 << NSApplicationDefined as libc::c_ulonglong;
const NSPeriodicMask = 1 << NSPeriodic as libc::c_ulonglong;
const NSCursorUpdateMask = 1 << NSCursorUpdate as libc::c_ulonglong;
const NSScrollWheelMask = 1 << NSScrollWheel as libc::c_ulonglong;
const NSTabletPointMask = 1 << NSTabletPoint as libc::c_ulonglong;
const NSTabletProximityMask = 1 << NSTabletProximity as libc::c_ulonglong;
const NSOtherMouseDownMask = 1 << NSOtherMouseDown as libc::c_ulonglong;
const NSOtherMouseUpMask = 1 << NSOtherMouseUp as libc::c_ulonglong;
const NSOtherMouseDraggedMask = 1 << NSOtherMouseDragged as libc::c_ulonglong;
const NSEventMaskGesture = 1 << NSEventTypeGesture as libc::c_ulonglong;
const NSEventMaskSwipe = 1 << NSEventTypeSwipe as libc::c_ulonglong;
const NSEventMaskRotate = 1 << NSEventTypeRotate as libc::c_ulonglong;
const NSEventMaskBeginGesture = 1 << NSEventTypeBeginGesture as libc::c_ulonglong;
const NSEventMaskEndGesture = 1 << NSEventTypeEndGesture as libc::c_ulonglong;
const NSEventMaskPressure = 1 << NSEventTypePressure as libc::c_ulonglong;
const NSAnyEventMask = 0xffffffffffffffff;
}
}
impl NSEventMask {
pub fn from_type(ty: NSEventType) -> NSEventMask {
NSEventMask { bits: 1 << ty as libc::c_ulonglong }
}
}
bitflags! {
pub struct NSEventModifierFlags: NSUInteger {
const NSAlphaShiftKeyMask = 1 << 16;
const NSShiftKeyMask = 1 << 17;
const NSControlKeyMask = 1 << 18;
const NSAlternateKeyMask = 1 << 19;
const NSCommandKeyMask = 1 << 20;
const NSNumericPadKeyMask = 1 << 21;
const NSHelpKeyMask = 1 << 22;
const NSFunctionKeyMask = 1 << 23;
const NSDeviceIndependentModifierFlagsMask = 0xffff0000;
}
}
// Not sure of the type here
pub enum NSPointingDeviceType {
// TODO: Not sure what these values are
// NSUnknownPointingDevice = NX_TABLET_POINTER_UNKNOWN,
// NSPenPointingDevice = NX_TABLET_POINTER_PEN,
// NSCursorPointingDevice = NX_TABLET_POINTER_CURSOR,
// NSEraserPointingDevice = NX_TABLET_POINTER_ERASER,
}
// Not sure of the type here
pub enum NSEventButtonMask {
// TODO: Not sure what these values are
// NSPenTipMask = NX_TABLET_BUTTON_PENTIPMASK,
// NSPenLowerSideMask = NX_TABLET_BUTTON_PENLOWERSIDEMASK,
// NSPenUpperSideMask = NX_TABLET_BUTTON_PENUPPERSIDEMASK,
}
#[repr(i16)]
pub enum NSEventSubtype {
// TODO: Not sure what these values are
// NSMouseEventSubtype = NX_SUBTYPE_DEFAULT,
// NSTabletPointEventSubtype = NX_SUBTYPE_TABLET_POINT,
// NSTabletProximityEventSubtype = NX_SUBTYPE_TABLET_PROXIMITY
// NSTouchEventSubtype = NX_SUBTYPE_MOUSE_TOUCH,
NSWindowExposedEventType = 0,
NSApplicationActivatedEventType = 1,
NSApplicationDeactivatedEventType = 2,
NSWindowMovedEventType = 4,
NSScreenChangedEventType = 8,
NSAWTEventType = 16,
}
pub const NSUpArrowFunctionKey: libc::c_ushort = 0xF700;
pub const NSDownArrowFunctionKey: libc::c_ushort = 0xF701;
pub const NSLeftArrowFunctionKey: libc::c_ushort = 0xF702;
pub const NSRightArrowFunctionKey: libc::c_ushort = 0xF703;
pub const NSF1FunctionKey: libc::c_ushort = 0xF704;
pub const NSF2FunctionKey: libc::c_ushort = 0xF705;
pub const NSF3FunctionKey: libc::c_ushort = 0xF706;
pub const NSF4FunctionKey: libc::c_ushort = 0xF707;
pub const NSF5FunctionKey: libc::c_ushort = 0xF708;
pub const NSF6FunctionKey: libc::c_ushort = 0xF709;
pub const NSF7FunctionKey: libc::c_ushort = 0xF70A;
pub const NSF8FunctionKey: libc::c_ushort = 0xF70B;
pub const NSF9FunctionKey: libc::c_ushort = 0xF70C;
pub const NSF10FunctionKey: libc::c_ushort = 0xF70D;
pub const NSF11FunctionKey: libc::c_ushort = 0xF70E;
pub const NSF12FunctionKey: libc::c_ushort = 0xF70F;
pub const NSF13FunctionKey: libc::c_ushort = 0xF710;
pub const NSF14FunctionKey: libc::c_ushort = 0xF711;
pub const NSF15FunctionKey: libc::c_ushort = 0xF712;
pub const NSF16FunctionKey: libc::c_ushort = 0xF713;
pub const NSF17FunctionKey: libc::c_ushort = 0xF714;
pub const NSF18FunctionKey: libc::c_ushort = 0xF715;
pub const NSF19FunctionKey: libc::c_ushort = 0xF716;
pub const NSF20FunctionKey: libc::c_ushort = 0xF717;
pub const NSF21FunctionKey: libc::c_ushort = 0xF718;
pub const NSF22FunctionKey: libc::c_ushort = 0xF719;
pub const NSF23FunctionKey: libc::c_ushort = 0xF71A;
pub const NSF24FunctionKey: libc::c_ushort = 0xF71B;
pub const NSF25FunctionKey: libc::c_ushort = 0xF71C;
pub const NSF26FunctionKey: libc::c_ushort = 0xF71D;
pub const NSF27FunctionKey: libc::c_ushort = 0xF71E;
pub const NSF28FunctionKey: libc::c_ushort = 0xF71F;
pub const NSF29FunctionKey: libc::c_ushort = 0xF720;
pub const NSF30FunctionKey: libc::c_ushort = 0xF721;
pub const NSF31FunctionKey: libc::c_ushort = 0xF722;
pub const NSF32FunctionKey: libc::c_ushort = 0xF723;
pub const NSF33FunctionKey: libc::c_ushort = 0xF724;
pub const NSF34FunctionKey: libc::c_ushort = 0xF725;
pub const NSF35FunctionKey: libc::c_ushort = 0xF726;
pub const NSInsertFunctionKey: libc::c_ushort = 0xF727;
pub const NSDeleteFunctionKey: libc::c_ushort = 0xF728;
pub const NSHomeFunctionKey: libc::c_ushort = 0xF729;
pub const NSBeginFunctionKey: libc::c_ushort = 0xF72A;
pub const NSEndFunctionKey: libc::c_ushort = 0xF72B;
pub const NSPageUpFunctionKey: libc::c_ushort = 0xF72C;
pub const NSPageDownFunctionKey: libc::c_ushort = 0xF72D;
pub const NSPrintScreenFunctionKey: libc::c_ushort = 0xF72E;
pub const NSScrollLockFunctionKey: libc::c_ushort = 0xF72F;
pub const NSPauseFunctionKey: libc::c_ushort = 0xF730;
pub const NSSysReqFunctionKey: libc::c_ushort = 0xF731;
pub const NSBreakFunctionKey: libc::c_ushort = 0xF732;
pub const NSResetFunctionKey: libc::c_ushort = 0xF733;
pub const NSStopFunctionKey: libc::c_ushort = 0xF734;
pub const NSMenuFunctionKey: libc::c_ushort = 0xF735;
pub const NSUserFunctionKey: libc::c_ushort = 0xF736;
pub const NSSystemFunctionKey: libc::c_ushort = 0xF737;
pub const NSPrintFunctionKey: libc::c_ushort = 0xF738;
pub const NSClearLineFunctionKey: libc::c_ushort = 0xF739;
pub const NSClearDisplayFunctionKey: libc::c_ushort = 0xF73A;
pub const NSInsertLineFunctionKey: libc::c_ushort = 0xF73B;
pub const NSDeleteLineFunctionKey: libc::c_ushort = 0xF73C;
pub const NSInsertCharFunctionKey: libc::c_ushort = 0xF73D;
pub const NSDeleteCharFunctionKey: libc::c_ushort = 0xF73E;
pub const NSPrevFunctionKey: libc::c_ushort = 0xF73F;
pub const NSNextFunctionKey: libc::c_ushort = 0xF740;
pub const NSSelectFunctionKey: libc::c_ushort = 0xF741;
pub const NSExecuteFunctionKey: libc::c_ushort = 0xF742;
pub const NSUndoFunctionKey: libc::c_ushort = 0xF743;
pub const NSRedoFunctionKey: libc::c_ushort = 0xF744;
pub const NSFindFunctionKey: libc::c_ushort = 0xF745;
pub const NSHelpFunctionKey: libc::c_ushort = 0xF746;
pub const NSModeSwitchFunctionKey: libc::c_ushort = 0xF747;
pub trait NSEvent: Sized {
// Creating Events
unsafe fn keyEventWithType_location_modifierFlags_timestamp_windowNumber_context_characters_charactersIgnoringModifiers_isARepeat_keyCode_(
_: Self,
eventType: NSEventType,
location: NSPoint,
modifierFlags: NSEventModifierFlags,
timestamp: NSTimeInterval,
windowNumber: NSInteger,
context: id /* (NSGraphicsContext *) */,
characters: id /* (NSString *) */,
unmodCharacters: id /* (NSString *) */,
repeatKey: BOOL,
code: libc::c_ushort) -> id /* (NSEvent *) */;
unsafe fn mouseEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_clickCount_pressure_(
_: Self,
eventType: NSEventType,
location: NSPoint,
modifierFlags: NSEventModifierFlags,
timestamp: NSTimeInterval,
windowNumber: NSInteger,
context: id /* (NSGraphicsContext *) */,
eventNumber: NSInteger,
clickCount: NSInteger,
pressure: libc::c_float) -> id /* (NSEvent *) */;
unsafe fn enterExitEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_trackingNumber_userData_(
_: Self,
eventType: NSEventType,
location: NSPoint,
modifierFlags: NSEventModifierFlags,
timestamp: NSTimeInterval,
windowNumber: NSInteger,
context: id /* (NSGraphicsContext *) */,
eventNumber: NSInteger,
trackingNumber: NSInteger,
userData: *mut libc::c_void) -> id /* (NSEvent *) */;
unsafe fn otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2_(
_: Self,
eventType: NSEventType,
location: NSPoint,
modifierFlags: NSEventModifierFlags,
timestamp: NSTimeInterval,
windowNumber: NSInteger,
context: id /* (NSGraphicsContext *) */,
subtype: NSEventSubtype,
data1: NSInteger,
data2: NSInteger) -> id /* (NSEvent *) */;
unsafe fn eventWithEventRef_(_: Self, eventRef: *const libc::c_void) -> id;
unsafe fn eventWithCGEvent_(_: Self, cgEvent: *mut libc::c_void /* CGEventRef */) -> id;
// Getting General Event Information
unsafe fn context(self) -> id /* (NSGraphicsContext *) */;
unsafe fn locationInWindow(self) -> NSPoint;
unsafe fn modifierFlags(self) -> NSEventModifierFlags;
unsafe fn timestamp(self) -> NSTimeInterval;
// NOTE: renamed from `- type` due to Rust keyword collision
unsafe fn eventType(self) -> NSEventType;
unsafe fn window(self) -> id /* (NSWindow *) */;
unsafe fn windowNumber(self) -> NSInteger;
unsafe fn eventRef(self) -> *const libc::c_void;
unsafe fn CGEvent(self) -> *mut libc::c_void /* CGEventRef */;
// Getting Key Event Information
// NOTE: renamed from `+ modifierFlags` due to conflict with `- modifierFlags`
unsafe fn currentModifierFlags(_: Self) -> NSEventModifierFlags;
unsafe fn keyRepeatDelay(_: Self) -> NSTimeInterval;
unsafe fn keyRepeatInterval(_: Self) -> NSTimeInterval;
unsafe fn characters(self) -> id /* (NSString *) */;
unsafe fn charactersIgnoringModifiers(self) -> id /* (NSString *) */;
unsafe fn keyCode(self) -> libc::c_ushort;
// Getting Mouse Event Information
unsafe fn pressedMouseButtons(_: Self) -> NSUInteger;
unsafe fn doubleClickInterval(_: Self) -> NSTimeInterval;
unsafe fn mouseLocation(_: Self) -> NSPoint;
unsafe fn buttonNumber(self) -> NSInteger;
unsafe fn clickCount(self) -> NSInteger;
unsafe fn pressure(self) -> libc::c_float;
unsafe fn stage(self) -> NSInteger;
unsafe fn setMouseCoalescingEnabled_(_: Self, flag: BOOL);
unsafe fn isMouseCoalescingEnabled(_: Self) -> BOOL;
// Getting Mouse-Tracking Event Information
unsafe fn eventNumber(self) -> NSInteger;
unsafe fn trackingNumber(self) -> NSInteger;
unsafe fn trackingArea(self) -> id /* (NSTrackingArea *) */;
unsafe fn userData(self) -> *const libc::c_void;
// Getting Custom Event Information
unsafe fn data1(self) -> NSInteger;
unsafe fn data2(self) -> NSInteger;
unsafe fn subtype(self) -> NSEventSubtype;
// Getting Scroll Wheel Event Information
unsafe fn deltaX(self) -> CGFloat;
unsafe fn deltaY(self) -> CGFloat;
unsafe fn deltaZ(self) -> CGFloat;
// Getting Tablet Proximity Information
unsafe fn capabilityMask(self) -> NSUInteger;
unsafe fn deviceID(self) -> NSUInteger;
unsafe fn pointingDeviceID(self) -> NSUInteger;
unsafe fn pointingDeviceSerialNumber(self) -> NSUInteger;
unsafe fn pointingDeviceType(self) -> NSPointingDeviceType;
unsafe fn systemTabletID(self) -> NSUInteger;
unsafe fn tabletID(self) -> NSUInteger;
unsafe fn uniqueID(self) -> libc::c_ulonglong;
unsafe fn vendorID(self) -> NSUInteger;
unsafe fn vendorPointingDeviceType(self) -> NSUInteger;
// Getting Tablet Pointing Information
unsafe fn absoluteX(self) -> NSInteger;
unsafe fn absoluteY(self) -> NSInteger;
unsafe fn absoluteZ(self) -> NSInteger;
unsafe fn buttonMask(self) -> NSEventButtonMask;
unsafe fn rotation(self) -> libc::c_float;
unsafe fn tangentialPressure(self) -> libc::c_float;
unsafe fn tilt(self) -> NSPoint;
unsafe fn vendorDefined(self) -> id;
// Requesting and Stopping Periodic Events
unsafe fn startPeriodicEventsAfterDelay_withPeriod_(_: Self, delaySeconds: NSTimeInterval, periodSeconds: NSTimeInterval);
unsafe fn stopPeriodicEvents(_: Self);
// Getting Touch and Gesture Information
unsafe fn magnification(self) -> CGFloat;
unsafe fn touchesMatchingPhase_inView_(self, phase: NSTouchPhase, view: id /* (NSView *) */) -> id /* (NSSet *) */;
unsafe fn isSwipeTrackingFromScrollEventsEnabled(_: Self) -> BOOL;
// Monitoring Application Events
// TODO: addGlobalMonitorForEventsMatchingMask_handler_ (unsure how to bind to blocks)
// TODO: addLocalMonitorForEventsMatchingMask_handler_ (unsure how to bind to blocks)
unsafe fn removeMonitor_(_: Self, eventMonitor: id);
// Scroll Wheel and Flick Events
unsafe fn hasPreciseScrollingDeltas(self) -> BOOL;
unsafe fn scrollingDeltaX(self) -> CGFloat;
unsafe fn scrollingDeltaY(self) -> CGFloat;
unsafe fn momentumPhase(self) -> NSEventPhase;
unsafe fn phase(self) -> NSEventPhase;
// TODO: trackSwipeEventWithOptions_dampenAmountThresholdMin_max_usingHandler_ (unsure how to bind to blocks)
// Converting a Mouse Event’s Position into a Sprite Kit Node’s Coordinate Space
unsafe fn locationInNode_(self, node: id /* (SKNode *) */) -> CGPoint;
}
impl NSEvent for id {
// Creating Events
unsafe fn keyEventWithType_location_modifierFlags_timestamp_windowNumber_context_characters_charactersIgnoringModifiers_isARepeat_keyCode_(
_: Self,
eventType: NSEventType,
location: NSPoint,
modifierFlags: NSEventModifierFlags,
timestamp: NSTimeInterval,
windowNumber: NSInteger,
context: id /* (NSGraphicsContext *) */,
characters: id /* (NSString *) */,
unmodCharacters: id /* (NSString *) */,
repeatKey: BOOL,
code: libc::c_ushort) -> id /* (NSEvent *) */
{
msg_send![class("NSEvent"), keyEventWithType:eventType
location:location
modifierFlags:modifierFlags
timestamp:timestamp
windowNumber:windowNumber
context:context
characters:characters
charactersIgnoringModifiers:unmodCharacters
isARepeat:repeatKey
keyCode:code]
}
unsafe fn mouseEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_clickCount_pressure_(
_: Self,
eventType: NSEventType,
location: NSPoint,
modifierFlags: NSEventModifierFlags,
timestamp: NSTimeInterval,
windowNumber: NSInteger,
context: id /* (NSGraphicsContext *) */,
eventNumber: NSInteger,
clickCount: NSInteger,
pressure: libc::c_float) -> id /* (NSEvent *) */
{
msg_send![class("NSEvent"), mouseEventWithType:eventType
location:location
modifierFlags:modifierFlags
timestamp:timestamp
windowNumber:windowNumber
context:context
eventNumber:eventNumber
clickCount:clickCount
pressure:pressure]
}
unsafe fn enterExitEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_trackingNumber_userData_(
_: Self,
eventType: NSEventType,
location: NSPoint,
modifierFlags: NSEventModifierFlags,
timestamp: NSTimeInterval,
windowNumber: NSInteger,
context: id /* (NSGraphicsContext *) */,
eventNumber: NSInteger,
trackingNumber: NSInteger,
userData: *mut libc::c_void) -> id /* (NSEvent *) */
{
msg_send![class("NSEvent"), enterExitEventWithType:eventType
location:location
modifierFlags:modifierFlags
timestamp:timestamp
windowNumber:windowNumber
context:context
eventNumber:eventNumber
trackingNumber:trackingNumber
userData:userData]
}
unsafe fn otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2_(
_: Self,
eventType: NSEventType,
location: NSPoint,
modifierFlags: NSEventModifierFlags,
timestamp: NSTimeInterval,
windowNumber: NSInteger,
context: id /* (NSGraphicsContext *) */,
subtype: NSEventSubtype,
data1: NSInteger,
data2: NSInteger) -> id /* (NSEvent *) */
{
msg_send![class("NSEvent"), otherEventWithType:eventType
location:location
modifierFlags:modifierFlags
timestamp:timestamp
windowNumber:windowNumber
context:context
subtype:subtype
data1:data1
data2:data2]
}
unsafe fn eventWithEventRef_(_: Self, eventRef: *const libc::c_void) -> id {
msg_send![class("NSEvent"), eventWithEventRef:eventRef]
}
unsafe fn eventWithCGEvent_(_: Self, cgEvent: *mut libc::c_void /* CGEventRef */) -> id {
msg_send![class("NSEvent"), eventWithCGEvent:cgEvent]
}
// Getting General Event Information
unsafe fn context(self) -> id /* (NSGraphicsContext *) */ {
msg_send![self, context]
}
unsafe fn locationInWindow(self) -> NSPoint {
msg_send![self, locationInWindow]
}
unsafe fn modifierFlags(self) -> NSEventModifierFlags {
msg_send![self, modifierFlags]
}
unsafe fn timestamp(self) -> NSTimeInterval {
msg_send![self, timestamp]
}
// NOTE: renamed from `- type` due to Rust keyword collision
unsafe fn eventType(self) -> NSEventType {
msg_send![self, type]
}
unsafe fn window(self) -> id /* (NSWindow *) */ {
msg_send![self, window]
}
unsafe fn windowNumber(self) -> NSInteger {
msg_send![self, windowNumber]
}
unsafe fn eventRef(self) -> *const libc::c_void {
msg_send![self, eventRef]
}
unsafe fn CGEvent(self) -> *mut libc::c_void /* CGEventRef */ {
msg_send![self, CGEvent]
}
// Getting Key Event Information
// NOTE: renamed from `+ modifierFlags` due to conflict with `- modifierFlags`
unsafe fn currentModifierFlags(_: Self) -> NSEventModifierFlags {
msg_send![class("NSEvent"), currentModifierFlags]
}
unsafe fn keyRepeatDelay(_: Self) -> NSTimeInterval {
msg_send![class("NSEvent"), keyRepeatDelay]
}
unsafe fn keyRepeatInterval(_: Self) -> NSTimeInterval {
msg_send![class("NSEvent"), keyRepeatInterval]
}
unsafe fn characters(self) -> id /* (NSString *) */ {
msg_send![self, characters]
}
unsafe fn charactersIgnoringModifiers(self) -> id /* (NSString *) */ {
msg_send![self, charactersIgnoringModifiers]
}
unsafe fn keyCode(self) -> libc::c_ushort {
msg_send![self, keyCode]
}
// Getting Mouse Event Information
unsafe fn pressedMouseButtons(_: Self) -> NSUInteger {
msg_send![class("NSEvent"), pressedMouseButtons]
}
unsafe fn doubleClickInterval(_: Self) -> NSTimeInterval {
msg_send![class("NSEvent"), doubleClickInterval]
}
unsafe fn mouseLocation(_: Self) -> NSPoint {
msg_send![class("NSEvent"), mouseLocation]
}
unsafe fn buttonNumber(self) -> NSInteger {
msg_send![self, buttonNumber]
}
unsafe fn clickCount(self) -> NSInteger {
msg_send![self, clickCount]
}
unsafe fn pressure(self) -> libc::c_float {
msg_send![self, pressure]
}
unsafe fn stage(self) -> NSInteger{
msg_send![self, stage]
}
unsafe fn setMouseCoalescingEnabled_(_: Self, flag: BOOL) {
msg_send![class("NSEvent"), setMouseCoalescingEnabled:flag]
}
unsafe fn isMouseCoalescingEnabled(_: Self) -> BOOL {
msg_send![class("NSEvent"), isMouseCoalescingEnabled]
}
// Getting Mouse-Tracking Event Information
unsafe fn eventNumber(self) -> NSInteger {
msg_send![self, eventNumber]
}
unsafe fn trackingNumber(self) -> NSInteger {
msg_send![self, trackingNumber]
}
unsafe fn trackingArea(self) -> id /* (NSTrackingArea *) */ {
msg_send![self, trackingArea]
}
unsafe fn userData(self) -> *const libc::c_void {
msg_send![self, userData]
}
// Getting Custom Event Information
unsafe fn data1(self) -> NSInteger {
msg_send![self, data1]
}
unsafe fn data2(self) -> NSInteger {
msg_send![self, data2]
}
unsafe fn subtype(self) -> NSEventSubtype {
msg_send![self, subtype]
}
// Getting Scroll Wheel Event Information
unsafe fn deltaX(self) -> CGFloat {
msg_send![self, deltaX]
}
unsafe fn deltaY(self) -> CGFloat {
msg_send![self, deltaY]
}
unsafe fn deltaZ(self) -> CGFloat {
msg_send![self, deltaZ]
}
// Getting Tablet Proximity Information
unsafe fn capabilityMask(self) -> NSUInteger {
msg_send![self, capabilityMask]
}
unsafe fn deviceID(self) -> NSUInteger {
msg_send![self, deviceID]
}
unsafe fn pointingDeviceID(self) -> NSUInteger {
msg_send![self, pointingDeviceID]
}
unsafe fn pointingDeviceSerialNumber(self) -> NSUInteger {
msg_send![self, pointingDeviceSerialNumber]
}
unsafe fn pointingDeviceType(self) -> NSPointingDeviceType {
msg_send![self, pointingDeviceType]
}
unsafe fn systemTabletID(self) -> NSUInteger {
msg_send![self, systemTabletID]
}
unsafe fn tabletID(self) -> NSUInteger {
msg_send![self, tabletID]
}
unsafe fn uniqueID(self) -> libc::c_ulonglong {
msg_send![self, uniqueID]
}
unsafe fn vendorID(self) -> NSUInteger {
msg_send![self, vendorID]
}
unsafe fn vendorPointingDeviceType(self) -> NSUInteger {
msg_send![self, vendorPointingDeviceType]
}
// Getting Tablet Pointing Information
unsafe fn absoluteX(self) -> NSInteger {
msg_send![self, absoluteX]
}
unsafe fn absoluteY(self) -> NSInteger {
msg_send![self, absoluteY]
}
unsafe fn absoluteZ(self) -> NSInteger {
msg_send![self, absoluteZ]
}
unsafe fn buttonMask(self) -> NSEventButtonMask {
msg_send![self, buttonMask]
}
unsafe fn rotation(self) -> libc::c_float {
msg_send![self, rotation]
}
unsafe fn tangentialPressure(self) -> libc::c_float {
msg_send![self, tangentialPressure]
}
unsafe fn tilt(self) -> NSPoint {
msg_send![self, tilt]
}
unsafe fn vendorDefined(self) -> id {
msg_send![self, vendorDefined]
}
// Requesting and Stopping Periodic Events
unsafe fn startPeriodicEventsAfterDelay_withPeriod_(_: Self, delaySeconds: NSTimeInterval, periodSeconds: NSTimeInterval) {
msg_send![class("NSEvent"), startPeriodicEventsAfterDelay:delaySeconds withPeriod:periodSeconds]
}
unsafe fn stopPeriodicEvents(_: Self) {
msg_send![class("NSEvent"), stopPeriodicEvents]
}
// Getting Touch and Gesture Information
unsafe fn magnification(self) -> CGFloat {
msg_send![self, magnification]
}
unsafe fn touchesMatchingPhase_inView_(self, phase: NSTouchPhase, view: id /* (NSView *) */) -> id /* (NSSet *) */ {
msg_send![self, touchesMatchingPhase:phase inView:view]
}
unsafe fn isSwipeTrackingFromScrollEventsEnabled(_: Self) -> BOOL {
msg_send![class("NSEvent"), isSwipeTrackingFromScrollEventsEnabled]
}
// Monitoring Application Events
// TODO: addGlobalMonitorForEventsMatchingMask_handler_ (unsure how to bind to blocks)
// TODO: addLocalMonitorForEventsMatchingMask_handler_ (unsure how to bind to blocks)
unsafe fn removeMonitor_(_: Self, eventMonitor: id) {
msg_send![class("NSEvent"), removeMonitor:eventMonitor]
}
// Scroll Wheel and Flick Events
unsafe fn hasPreciseScrollingDeltas(self) -> BOOL {
msg_send![self, hasPreciseScrollingDeltas]
}
unsafe fn scrollingDeltaX(self) -> CGFloat {
msg_send![self, scrollingDeltaX]
}
unsafe fn scrollingDeltaY(self) -> CGFloat {
msg_send![self, scrollingDeltaY]
}
unsafe fn momentumPhase(self) -> NSEventPhase {
msg_send![self, momentumPhase]
}
unsafe fn phase(self) -> NSEventPhase {
msg_send![self, phase]
}
// TODO: trackSwipeEventWithOptions_dampenAmountThresholdMin_max_usingHandler_ (unsure how to bind to blocks)
// Converting a Mouse Event’s Position into a Sprite Kit Node’s Coordinate Space
unsafe fn locationInNode_(self, node: id /* (SKNode *) */) -> CGPoint {
msg_send![self, locationInNode:node]
}
}
pub trait NSScreen: Sized {
// Getting NSScreen Objects
unsafe fn mainScreen(_: Self) -> id /* (NSScreen *) */;
unsafe fn deepestScreen(_: Self) -> id /* (NSScreen *) */;
unsafe fn screens(_: Self) -> id /* (NSArray *) */;
// Getting Screen Information
unsafe fn depth(self) -> NSWindowDepth;
unsafe fn frame(self) -> NSRect;
unsafe fn supportedWindowDepths(self) -> *const NSWindowDepth;
unsafe fn deviceDescription(self) -> id /* (NSDictionary *) */;
unsafe fn visibleFrame(self) -> NSRect;
unsafe fn colorSpace(self) -> id /* (NSColorSpace *) */;
unsafe fn screensHaveSeparateSpaces(_: Self) -> BOOL;
// Screen Backing Coordinate Conversion
unsafe fn backingAlignedRect_options_(self, aRect: NSRect, options: NSAlignmentOptions) -> NSRect;
unsafe fn backingScaleFactor(self) -> CGFloat;
unsafe fn convertRectFromBacking_(self, aRect: NSRect) -> NSRect;
unsafe fn convertRectToBacking_(self, aRect: NSRect) -> NSRect;
}
impl NSScreen for id {
// Getting NSScreen Objects
unsafe fn mainScreen(_: Self) -> id /* (NSScreen *) */ {
msg_send![class("NSScreen"), mainScreen]
}
unsafe fn deepestScreen(_: Self) -> id /* (NSScreen *) */ {
msg_send![class("NSScreen"), deepestScreen]
}
unsafe fn screens(_: Self) -> id /* (NSArray *) */ {
msg_send![class("NSScreen"), screens]
}
// Getting Screen Information
unsafe fn depth(self) -> NSWindowDepth {
msg_send![self, depth]
}
unsafe fn frame(self) -> NSRect {
msg_send![self, frame]
}
unsafe fn supportedWindowDepths(self) -> *const NSWindowDepth {
msg_send![self, supportedWindowDepths]
}
unsafe fn deviceDescription(self) -> id /* (NSDictionary *) */ {
msg_send![self, deviceDescription]
}
unsafe fn visibleFrame(self) -> NSRect {
msg_send![self, visibleFrame]
}
unsafe fn colorSpace(self) -> id /* (NSColorSpace *) */ {
msg_send![self, colorSpace]
}
unsafe fn screensHaveSeparateSpaces(_: Self) -> BOOL {
msg_send![class("NSScreen"), screensHaveSeparateSpaces]
}
// Screen Backing Coordinate Conversion
unsafe fn backingAlignedRect_options_(self, aRect: NSRect, options: NSAlignmentOptions) -> NSRect {
msg_send![self, backingAlignedRect:aRect options:options]
}
unsafe fn backingScaleFactor(self) -> CGFloat {
msg_send![self, backingScaleFactor]
}
unsafe fn convertRectFromBacking_(self, aRect: NSRect) -> NSRect {
msg_send![self, convertRectFromBacking:aRect]
}
unsafe fn convertRectToBacking_(self, aRect: NSRect) -> NSRect {
msg_send![self, convertRectToBacking:aRect]
}
}
pub trait NSButton: Sized {
unsafe fn setImage_(self, img: id /* (NSImage *) */);
unsafe fn setBezelStyle_(self, style: NSBezelStyle);
unsafe fn setTitle_(self, title: id /* (NSString*) */);
unsafe fn alloc(_: Self) -> id {
msg_send![class("NSButton"), alloc]
}
unsafe fn initWithFrame_(self, frameRect: NSRect) -> id;
}
impl NSButton for id {
unsafe fn initWithFrame_(self, frameRect: NSRect) -> id {
msg_send![self, initWithFrame:frameRect]
}
unsafe fn setBezelStyle_(self, style: NSBezelStyle) {
msg_send![self, setBezelStyle:style];
}
unsafe fn setTitle_(self, title: id /* (NSString*) */) {
msg_send![self, setTitle:title]
}
unsafe fn setImage_(self, img: id /* (NSImage *) */) {
msg_send![self, setImage:img]
}
}
pub trait NSImage: Sized {
unsafe fn alloc(_: Self) -> id {
msg_send![class("NSImage"), alloc]
}
unsafe fn initByReferencingFile_(self, file_name: id /* (NSString *) */) -> id;
unsafe fn initWithContentsOfFile_(self, file_name: id /* (NSString *) */) -> id;
unsafe fn initWithData_(self, data: id /* (NSData *) */) -> id;
unsafe fn initWithDataIgnoringOrientation_(self, data: id /* (NSData *) */) -> id;
unsafe fn initWithPasteboard_(self, pasteboard: id /* (NSPasteboard *) */) -> id;
unsafe fn initWithSize_flipped_drawingHandler_(self, size: NSSize,
drawingHandlerShouldBeCalledWithFlippedContext: BOOL,
drawingHandler: *mut Block<(NSRect,), BOOL>);
unsafe fn initWithSize_(self, aSize: NSSize) -> id;
unsafe fn imageNamed_(_: Self, name: id /* (NSString *) */) -> id {
msg_send![class("NSImage"), imageNamed:name]
}
unsafe fn name(self) -> id /* (NSString *) */;
unsafe fn setName_(self, name: id /* (NSString *) */) -> BOOL;
unsafe fn size(self) -> NSSize;
unsafe fn template(self) -> BOOL;
unsafe fn canInitWithPasteboard_(self, pasteboard: id /* (NSPasteboard *) */) -> BOOL;
unsafe fn imageTypes(self) -> id /* (NSArray<NSString *> ) */;
unsafe fn imageUnfilteredTypes(self) -> id /* (NSArray<NSString *> ) */;
unsafe fn addRepresentation_(self, imageRep: id /* (NSImageRep *) */);
unsafe fn addRepresentations_(self, imageReps: id /* (NSArray<NSImageRep *> *) */);
unsafe fn representations(self) -> id /* (NSArray<NSImageRep *> *) */;
unsafe fn removeRepresentation_(self, imageRep: id /* (NSImageRep *) */);
unsafe fn bestRepresentationForRect_context_hints_(self, rect: NSRect,
referenceContext: id /* (NSGraphicsContext *) */,
hints: id /* (NSDictionary<NSString *, id> *) */)
-> id /* (NSImageRep *) */;
unsafe fn prefersColorMatch(self) -> BOOL;
unsafe fn usesEPSOnResolutionMismatch(self) -> BOOL;
unsafe fn matchesOnMultipleResolution(self) -> BOOL;
unsafe fn drawInRect_(self, rect: NSRect);
unsafe fn drawAtPoint_fromRect_operation_fraction_(self, point: NSPoint, srcRect: NSRect,
op: NSCompositingOperation, delta: CGFloat);
unsafe fn drawInRect_fromRect_operation_fraction_(self, dstRect: NSRect, srcRect: NSRect,
op: NSCompositingOperation, delta: CGFloat);
unsafe fn drawInRect_fromRect_operation_fraction_respectFlipped_hints_(self, dstSpacePortionRect: NSRect,
srcSpacePortionRect: NSRect, op: NSCompositingOperation, delta: CGFloat, respectContextIsFlipped: BOOL,
hints: id /* (NSDictionary<NSString *, id> *) */);
unsafe fn drawRepresentation_inRect_(self, imageRep: id /* (NSImageRep *) */, dstRect: NSRect);
unsafe fn isValid(self) -> BOOL;
unsafe fn backgroundColor(self) -> id /* (NSColor *) */;
unsafe fn lockFocus(self);
unsafe fn lockFocusFlipped_(self, flipped: BOOL);
unsafe fn unlockFocus(self);
unsafe fn alignmentRect(self) -> NSRect;
unsafe fn cacheMode(self) -> NSImageCacheMode;
unsafe fn recache(self);
unsafe fn delegate(self) -> id /* (id<NSImageDelegate *> *) */;
unsafe fn TIFFRepresentation(self) -> id /* (NSData *) */;
unsafe fn TIFFRepresentationUsingCompression_factor_(self, comp: NSTIFFCompression, aFloat: f32)
-> id /* (NSData *) */;
unsafe fn cancelIncrementalLoad(self);
unsafe fn hitTestRect_withImageDestinationRect_context_hints_flipped_(self, testRectDestSpace: NSRect,
imageRectDestSpace: NSRect, referenceContext: id /* (NSGraphicsContext *) */,
hints: id /* (NSDictionary<NSString *, id> *) */, flipped: BOOL) -> BOOL;
unsafe fn accessibilityDescription(self) -> id /* (NSString *) */;
unsafe fn layerContentsForContentsScale_(self, layerContentsScale: CGFloat) -> id /* (id) */;
unsafe fn recommendedLayerContentsScale_(self, preferredContentsScale: CGFloat) -> CGFloat;
unsafe fn matchesOnlyOnBestFittingAxis(self) -> BOOL;
}
impl NSImage for id {
unsafe fn initByReferencingFile_(self, file_name: id /* (NSString *) */) -> id {
msg_send![self, initByReferencingFile:file_name]
}
unsafe fn initWithContentsOfFile_(self, file_name: id /* (NSString *) */) -> id {
msg_send![self, initWithContentsOfFile:file_name]
}
unsafe fn initWithData_(self, data: id /* (NSData *) */) -> id {
msg_send![self, initWithData:data]
}
unsafe fn initWithDataIgnoringOrientation_(self, data: id /* (NSData *) */) -> id {
msg_send![self, initWithDataIgnoringOrientation:data]
}
unsafe fn initWithPasteboard_(self, pasteboard: id /* (NSPasteboard *) */) -> id {
msg_send![self, initWithPasteboard:pasteboard]
}
unsafe fn initWithSize_flipped_drawingHandler_(self, size: NSSize,
drawingHandlerShouldBeCalledWithFlippedContext: BOOL,
drawingHandler: *mut Block<(NSRect,), BOOL>) {
msg_send![self, initWithSize:size
flipped:drawingHandlerShouldBeCalledWithFlippedContext
drawingHandler:drawingHandler]
}
unsafe fn initWithSize_(self, aSize: NSSize) -> id {
msg_send![self, initWithSize:aSize]
}
unsafe fn name(self) -> id /* (NSString *) */ {
msg_send![self, name]
}
unsafe fn setName_(self, name: id /* (NSString *) */) -> BOOL {
msg_send![self, setName:name]
}
unsafe fn size(self) -> NSSize {
msg_send![self, size]
}
unsafe fn template(self) -> BOOL {
msg_send![self, template]
}
unsafe fn canInitWithPasteboard_(self, pasteboard: id /* (NSPasteboard *) */) -> BOOL {
msg_send![self, canInitWithPasteboard:pasteboard]
}
unsafe fn imageTypes(self) -> id /* (NSArray<NSString *> ) */ {
msg_send![self, imageTypes]
}
unsafe fn imageUnfilteredTypes(self) -> id /* (NSArray<NSString *> ) */ {
msg_send![self, imageUnfilteredTypes]
}
unsafe fn addRepresentation_(self, imageRep: id /* (NSImageRep *) */) {
msg_send![self, addRepresentation:imageRep]
}
unsafe fn addRepresentations_(self, imageReps: id /* (NSArray<NSImageRep *> *) */) {
msg_send![self, addRepresentations:imageReps]
}
unsafe fn representations(self) -> id /* (NSArray<NSImageRep *> *) */ {
msg_send![self, representations]
}
unsafe fn removeRepresentation_(self, imageRep: id /* (NSImageRep *) */) {
msg_send![self, removeRepresentation:imageRep]
}
unsafe fn bestRepresentationForRect_context_hints_(self, rect: NSRect,
referenceContext: id /* (NSGraphicsContext *) */,
hints: id /* (NSDictionary<NSString *, id> *) */)
-> id /* (NSImageRep *) */ {
msg_send![self, bestRepresentationForRect:rect context:referenceContext hints:hints]
}
unsafe fn prefersColorMatch(self) -> BOOL {
msg_send![self, prefersColorMatch]
}
unsafe fn usesEPSOnResolutionMismatch(self) -> BOOL {
msg_send![self, usesEPSOnResolutionMismatch]
}
unsafe fn matchesOnMultipleResolution(self) -> BOOL {
msg_send![self, matchesOnMultipleResolution]
}
unsafe fn drawInRect_(self, rect: NSRect) {
msg_send![self, drawInRect:rect]
}
unsafe fn drawAtPoint_fromRect_operation_fraction_(self, point: NSPoint, srcRect: NSRect,
op: NSCompositingOperation, delta: CGFloat) {
msg_send![self, drawAtPoint:point fromRect:srcRect operation:op fraction:delta]
}
unsafe fn drawInRect_fromRect_operation_fraction_(self, dstRect: NSRect, srcRect: NSRect,
op: NSCompositingOperation, delta: CGFloat) {
msg_send![self, drawInRect:dstRect fromRect:srcRect operation:op fraction:delta]
}
unsafe fn drawInRect_fromRect_operation_fraction_respectFlipped_hints_(self, dstSpacePortionRect: NSRect,
srcSpacePortionRect: NSRect, op: NSCompositingOperation, delta: CGFloat, respectContextIsFlipped: BOOL,
hints: id /* (NSDictionary<NSString *, id> *) */) {
msg_send![self, drawInRect:dstSpacePortionRect
fromRect:srcSpacePortionRect
operation:op
fraction:delta
respectFlipped:respectContextIsFlipped
hints:hints]
}
unsafe fn drawRepresentation_inRect_(self, imageRep: id /* (NSImageRep *) */, dstRect: NSRect) {
msg_send![self, drawRepresentation:imageRep inRect:dstRect]
}
unsafe fn isValid(self) -> BOOL {
msg_send![self, isValid]
}
unsafe fn backgroundColor(self) -> id /* (NSColor *) */ {
msg_send![self, backgroundColor]
}
unsafe fn lockFocus(self) {
msg_send![self, lockFocus]
}
unsafe fn lockFocusFlipped_(self, flipped: BOOL) {
msg_send![self, lockFocusFlipped:flipped]
}
unsafe fn unlockFocus(self) {
msg_send![self, unlockFocus]
}
unsafe fn alignmentRect(self) -> NSRect {
msg_send![self, alignmentRect]
}
unsafe fn cacheMode(self) -> NSImageCacheMode {
msg_send![self, cacheMode]
}
unsafe fn recache(self) {
msg_send![self, recache]
}
unsafe fn delegate(self) -> id /* (id<NSImageDelegate *> *) */ {
msg_send![self, delegate]
}
unsafe fn TIFFRepresentation(self) -> id /* (NSData *) */ {
msg_send![self, TIFFRepresentation]
}
unsafe fn TIFFRepresentationUsingCompression_factor_(self, comp: NSTIFFCompression, aFloat: f32)
-> id /* (NSData *) */ {
msg_send![self, TIFFRepresentationUsingCompression:comp factor:aFloat]
}
unsafe fn cancelIncrementalLoad(self) {
msg_send![self, cancelIncrementalLoad]
}
unsafe fn hitTestRect_withImageDestinationRect_context_hints_flipped_(self, testRectDestSpace: NSRect,
imageRectDestSpace: NSRect, referenceContext: id /* (NSGraphicsContext *) */,
hints: id /* (NSDictionary<NSString *, id> *) */, flipped: BOOL) -> BOOL {
msg_send![self, hitTestRect:testRectDestSpace
withImageDestinationRect:imageRectDestSpace
context:referenceContext
hints:hints
flipped:flipped]
}
unsafe fn accessibilityDescription(self) -> id /* (NSString *) */ {
msg_send![self, accessibilityDescription]
}
unsafe fn layerContentsForContentsScale_(self, layerContentsScale: CGFloat) -> id /* (id) */ {
msg_send![self, layerContentsForContentsScale:layerContentsScale]
}
unsafe fn recommendedLayerContentsScale_(self, preferredContentsScale: CGFloat) -> CGFloat {
msg_send![self, recommendedLayerContentsScale:preferredContentsScale]
}
unsafe fn matchesOnlyOnBestFittingAxis(self) -> BOOL {
msg_send![self, matchesOnlyOnBestFittingAxis]
}
}
#[link(name = "AppKit", kind = "framework")]
extern {
// Image hints (NSString* const)
pub static NSImageHintCTM: id;
pub static NSImageHintInterpolation: id;
// System image names (NSString const*)
pub static NSImageNameQuickLookTemplate: id;
pub static NSImageNameBluetoothTemplate: id;
pub static NSImageNameIChatTheaterTemplate: id;
pub static NSImageNameSlideshowTemplate: id;
pub static NSImageNameActionTemplate: id;
pub static NSImageNameSmartBadgeTemplate: id;
pub static NSImageNamePathTemplate: id;
pub static NSImageNameInvalidDataFreestandingTemplate: id;
pub static NSImageNameLockLockedTemplate: id;
pub static NSImageNameLockUnlockedTemplate: id;
pub static NSImageNameGoRightTemplate: id;
pub static NSImageNameGoLeftTemplate: id;
pub static NSImageNameRightFacingTriangleTemplate: id;
pub static NSImageNameLeftFacingTriangleTemplate: id;
pub static NSImageNameAddTemplate: id;
pub static NSImageNameRemoveTemplate: id;
pub static NSImageNameRevealFreestandingTemplate: id;
pub static NSImageNameFollowLinkFreestandingTemplate: id;
pub static NSImageNameEnterFullScreenTemplate: id;
pub static NSImageNameExitFullScreenTemplate: id;
pub static NSImageNameStopProgressTemplate: id;
pub static NSImageNameStopProgressFreestandingTemplate: id;
pub static NSImageNameRefreshTemplate: id;
pub static NSImageNameRefreshFreestandingTemplate: id;
pub static NSImageNameMultipleDocuments: id;
pub static NSImageNameUser: id;
pub static NSImageNameUserGroup: id;
pub static NSImageNameEveryone: id;
pub static NSImageNameUserGuest: id;
pub static NSImageNameBonjour: id;
pub static NSImageNameDotMac: id;
pub static NSImageNameComputer: id;
pub static NSImageNameFolderBurnable: id;
pub static NSImageNameFolderSmart: id;
pub static NSImageNameNetwork: id;
pub static NSImageNameUserAccounts: id;
pub static NSImageNamePreferencesGeneral: id;
pub static NSImageNameAdvanced: id;
pub static NSImageNameInfo: id;
pub static NSImageNameFontPanel: id;
pub static NSImageNameColorPanel: id;
pub static NSImageNameFolder: id;
pub static NSImageNameTrashEmpty: id;
pub static NSImageNameTrashFull: id;
pub static NSImageNameHomeTemplate: id;
pub static NSImageNameBookmarksTemplate: id;
pub static NSImageNameCaution: id;
pub static NSImageNameStatusAvailable: id;
pub static NSImageNameStatusPartiallyAvailable: id;
pub static NSImageNameStatusUnavailable: id;
pub static NSImageNameStatusNone: id;
pub static NSImageNameApplicationIcon: id;
pub static NSImageNameMenuOnStateTemplate: id;
pub static NSImageNameMenuMixedStateTemplate: id;
pub static NSImageNameMobileMe: id;
pub static NSImageNameIconViewTemplate: id;
pub static NSImageNameListViewTemplate: id;
pub static NSImageNameColumnViewTemplate: id;
pub static NSImageNameFlowViewTemplate: id;
pub static NSImageNameShareTemplate: id;
}
#[repr(usize)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum NSCompositingOperation {
NSCompositeClear = 0,
NSCompositeCopy = 1,
NSCompositeSourceOver = 2,
NSCompositeSourceIn = 3,
NSCompositeSourceOut = 4,
NSCompositeSourceAtop = 5,
NSCompositeDestinationOver = 6,
NSCompositeDestinationIn = 7,
NSCompositeDestinationOut = 8,
NSCompositeDestinationAtop = 9,
NSCompositeXOR = 10,
NSCompositePlusDarker = 11,
NSCompositeHighlight = 12,
NSCompositePlusLighter = 13
}
#[repr(usize)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum NSImageCacheMode {
NSImageCacheDefault,
NSImageCacheAlways,
NSImageCacheBySize,
NSImageCacheNever
}
#[repr(usize)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum NSTIFFCompression {
NSTIFFCompressionNone = 1,
NSTIFFCompressionCCITTFAX3 = 3,
NSTIFFCompressionCCITTFAX4 = 4,
NSTIFFCompressionLZW = 5,
NSTIFFCompressionJPEG = 6,
NSTIFFCompressionNEXT = 32766,
NSTIFFCompressionPackBits = 32773,
NSTIFFCompressionOldJPEG = 32865
}
#[repr(usize)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum NSImageLoadStatus {
NSImageLoadStatusCompleted,
NSImageLoadStatusCancelled,
NSImageLoadStatusInvalidData,
NSImageLoadStatusUnexpectedEOF,
NSImageLoadStatusReadError
}
pub trait NSSound: Sized {
unsafe fn canInitWithPasteboard_(_: Self, pasteboard: id) -> BOOL {
msg_send![class("NSSound"), canInitWithPasteboard:pasteboard]
}
unsafe fn initWithContentsOfFile_withReference_(self, filepath: id, byRef: BOOL) -> id;
unsafe fn initWithContentsOfURL_withReference_(self, fileUrl: id, byRef: BOOL) -> id;
unsafe fn initWithData_(self, audioData: id) -> id;
unsafe fn initWithPasteboard_(self, pasteboard: id) -> id;
unsafe fn name(self) -> id;
unsafe fn volume(self) -> f32;
unsafe fn currentTime(self) -> NSTimeInterval;
unsafe fn loops(self) -> BOOL;
unsafe fn playbackDeviceIdentifier(self) -> id;
unsafe fn delegate(self) -> id;
unsafe fn soundUnfilteredTypes(_: Self) -> id {
msg_send![class("NSSound"), soundUnfilteredTypes]
}
unsafe fn soundNamed_(_: Self, soundName: id) -> id {
msg_send![class("NSSound"), soundNamed:soundName]
}
unsafe fn duration(self) -> NSTimeInterval;
unsafe fn playing(self) -> BOOL;
unsafe fn pause(self) -> BOOL;
unsafe fn play(self) -> BOOL;
unsafe fn resume(self) -> BOOL;
unsafe fn stop(self) -> BOOL;
unsafe fn writeToPasteboard_(self, pasteboard: id);
}
impl NSSound for id {
unsafe fn initWithContentsOfFile_withReference_(self, filepath: id, byRef: BOOL) -> id {
msg_send![self, initWithContentsOfFile:filepath withReference:byRef]
}
unsafe fn initWithContentsOfURL_withReference_(self, fileUrl: id, byRef: BOOL) -> id {
msg_send![self, initWithContentsOfURL:fileUrl withReference:byRef]
}
unsafe fn initWithData_(self, audioData: id) -> id {
msg_send![self, initWithData:audioData]
}
unsafe fn initWithPasteboard_(self, pasteboard: id) -> id {
msg_send![self, initWithPasteboard:pasteboard]
}
unsafe fn name(self) -> id {
msg_send![self, name]
}
unsafe fn volume(self) -> f32 {
msg_send![self, volume]
}
unsafe fn currentTime(self) -> NSTimeInterval {
msg_send![self, currentTime]
}
unsafe fn loops(self) -> BOOL {
msg_send![self, loops]
}
unsafe fn playbackDeviceIdentifier(self) -> id {
msg_send![self, playbackDeviceIdentifier]
}
unsafe fn delegate(self) -> id {
msg_send![self, delegate]
}
unsafe fn duration(self) -> NSTimeInterval {
msg_send![self, duration]
}
unsafe fn playing(self) -> BOOL {
msg_send![self, playing]
}
unsafe fn pause(self) -> BOOL {
msg_send![self, pause]
}
unsafe fn play(self) -> BOOL {
msg_send![self, play]
}
unsafe fn resume(self) -> BOOL {
msg_send![self, resume]
}
unsafe fn stop(self) -> BOOL {
msg_send![self, stop]
}
unsafe fn writeToPasteboard_(self, pasteboard: id) {
msg_send![self, writeToPasteboard:pasteboard]
}
}
pub const NSVariableStatusItemLength: CGFloat = -1.0;
pub const NSSquareStatusItemLength: CGFloat = -2.0;
pub trait NSStatusItem: Sized {
unsafe fn statusBar(self) -> id /* (NSStatusBar *) */;
unsafe fn button(self) -> id /* (NSStatusBarButton *) */;
unsafe fn menu(self) -> id;
unsafe fn setMenu_(self, menu: id);
unsafe fn length(self) -> CGFloat;
unsafe fn setLength_(self, length: CGFloat);
}
impl NSStatusItem for id {
unsafe fn statusBar(self) -> id /* (NSStatusBar *) */ {
msg_send![self, statusBar]
}
unsafe fn button(self) -> id /* (NSStatusBarButton *) */ {
msg_send![self, button]
}
unsafe fn menu(self) -> id {
msg_send![self, menu]
}
unsafe fn setMenu_(self, menu: id) {
msg_send![self, setMenu:menu]
}
unsafe fn length(self) -> CGFloat {
msg_send![self, length]
}
unsafe fn setLength_(self, length: CGFloat) {
msg_send![self, setLength: length]
}
}
pub trait NSStatusBar: Sized {
unsafe fn systemStatusBar(_: Self) -> id {
msg_send![class("NSStatusBar"), systemStatusBar]
}
unsafe fn statusItemWithLength_(self, length: CGFloat) -> id /* (NSStatusItem *) */;
unsafe fn removeStatusItem_(self, item: id /* (NSStatusItem *) */);
unsafe fn isVertical(self) -> BOOL;
}
impl NSStatusBar for id {
unsafe fn statusItemWithLength_(self, length: CGFloat) -> id /* (NSStatusItem *) */ {
msg_send![self, statusItemWithLength:length]
}
unsafe fn removeStatusItem_(self, item: id /* (NSStatusItem *) */) {
msg_send![self, removeStatusItem:item]
}
unsafe fn isVertical(self) -> BOOL {
msg_send![self, isVertical]
}
}
extern {
pub fn NSRectFill(rect: NSRect);
}
pub trait NSTextField: Sized {
unsafe fn alloc(_: Self) -> id {
msg_send![class("NSTextField"), alloc]
}
unsafe fn initWithFrame_(self, frameRect: NSRect) -> id;
unsafe fn setEditable_(self, editable: BOOL);
unsafe fn setStringValue_(self, label: id /* NSString */);
}
impl NSTextField for id {
unsafe fn initWithFrame_(self, frameRect: NSRect) -> id {
msg_send![self, initWithFrame:frameRect]
}
unsafe fn setEditable_(self, editable: BOOL) {
msg_send![self, setEditable:editable];
}
unsafe fn setStringValue_(self, label: id) {
msg_send![self, setStringValue:label];
}
}
#[repr(u64)]
pub enum NSTabViewType {
NSTopTabsBezelBorder = 0,
NSLeftTabsBezelBorder = 1,
NSBottomTabsBezelBorder = 2,
NSRightTabsBezelBorder = 3,
NSNoTabsBezelBorder = 4,
NSNoTabsLineBorder = 5,
NSNoTabsNoBorder = 6
}
pub trait NSTabView: Sized {
unsafe fn new(_: Self) -> id {
msg_send![class("NSTabView"), new]
}
unsafe fn initWithFrame_(self, frameRect: NSRect) -> id;
unsafe fn addTabViewItem_(self, tabViewItem: id);
unsafe fn insertTabViewItem_atIndex_(self,tabViewItem:id, index:NSInteger);
unsafe fn removeTabViewItem_(self,tabViewItem:id);
unsafe fn indexOfTabViewItem_(self, tabViewItem:id) -> id;
unsafe fn indexOfTabViewItemWithIdentifier_(self,identifier:id) -> id;
unsafe fn numberOfTabViewItems(self) -> id;
unsafe fn tabViewItemAtIndex_(self,index:id) -> id;
unsafe fn tabViewItems(self) -> id;
unsafe fn selectFirstTabViewItem_(self,sender:id);
unsafe fn selectLastTabViewItem_(self,sender:id);
unsafe fn selectNextTabViewItem_(self, sender:id);
unsafe fn selectPreviousTabViewItem_(self,sender:id);
unsafe fn selectTabViewItem_(self,tabViewItem:id);
unsafe fn selectTabViewItemAtIndex_(self,index:id);
unsafe fn selectTabViewItemWithIdentifier_(self,identifier:id);
unsafe fn selectedTabViewItem(self) -> id;
unsafe fn takeSelectedTabViewItemFromSender_(self,sender:id);
unsafe fn font(self) -> id;
unsafe fn setFont_(self, font:id);
unsafe fn tabViewType(self) -> NSTabViewType;
unsafe fn setTabViewType_(self,tabViewType: NSTabViewType);
unsafe fn controlTint(self) -> id;
unsafe fn setControlTint_(self,controlTint:id);
unsafe fn drawsBackground(self) -> BOOL;
unsafe fn setDrawsBackground_(self,drawsBackground:BOOL);
unsafe fn minimumSize(self) -> id;
unsafe fn contentRect(self) -> id;
unsafe fn controlSize(self) -> id;
unsafe fn setControlSize_(self,controlSize:id);
unsafe fn allowsTruncatedLabels(self) -> BOOL;
unsafe fn setAllowsTruncatedLabels_(self, allowTruncatedLabels:BOOL);
unsafe fn setDelegate_(self, delegate:id);
unsafe fn delegate(self) -> id ;
unsafe fn tabViewAtPoint_(self, point:id) -> id;
}
impl NSTabView for id {
unsafe fn initWithFrame_(self, frameRect: NSRect) -> id {
msg_send![self, initWithFrame:frameRect]
}
unsafe fn addTabViewItem_(self, tabViewItem: id) {
msg_send![self, addTabViewItem:tabViewItem]
}
unsafe fn insertTabViewItem_atIndex_(self, tabViewItem: id,index:NSInteger) {
msg_send![self, addTabViewItem:tabViewItem atIndex:index]
}
unsafe fn removeTabViewItem_(self,tabViewItem:id){
msg_send![self, removeTabViewItem:tabViewItem]
}
unsafe fn indexOfTabViewItem_(self, tabViewItem:id) -> id{
msg_send![self, indexOfTabViewItem:tabViewItem]
}
unsafe fn indexOfTabViewItemWithIdentifier_(self,identifier:id) -> id{
msg_send![self, indexOfTabViewItemWithIdentifier:identifier]
}
unsafe fn numberOfTabViewItems(self) -> id{
msg_send![self, numberOfTabViewItems]
}
unsafe fn tabViewItemAtIndex_(self,index:id)->id{
msg_send![self, tabViewItemAtIndex:index]
}
unsafe fn tabViewItems(self)->id{
msg_send![self, tabViewItems]
}
unsafe fn selectFirstTabViewItem_(self,sender:id){
msg_send![self, selectFirstTabViewItem:sender]
}
unsafe fn selectLastTabViewItem_(self,sender:id){
msg_send![self, selectLastTabViewItem:sender]
}
unsafe fn selectNextTabViewItem_(self, sender:id){
msg_send![self, selectNextTabViewItem:sender]
}
unsafe fn selectPreviousTabViewItem_(self,sender:id){
msg_send![self, selectPreviousTabViewItem:sender]
}
unsafe fn selectTabViewItem_(self,tabViewItem:id){
msg_send![self, selectTabViewItem:tabViewItem]
}
unsafe fn selectTabViewItemAtIndex_(self,index:id){
msg_send![self, selectTabViewItemAtIndex:index]
}
unsafe fn selectTabViewItemWithIdentifier_(self,identifier:id){
msg_send![self, selectTabViewItemWithIdentifier:identifier]
}
unsafe fn selectedTabViewItem(self) -> id{
msg_send![self, selectedTabViewItem]
}
unsafe fn takeSelectedTabViewItemFromSender_(self,sender:id){
msg_send![self, takeSelectedTabViewItemFromSender:sender]
}
unsafe fn font(self)->id{
msg_send![self, font]
}
unsafe fn setFont_(self, font:id){
msg_send![self, setFont:font]
}
unsafe fn tabViewType(self)->NSTabViewType{
msg_send![self, tabViewType]
}
unsafe fn setTabViewType_(self,tabViewType: NSTabViewType){
msg_send![self, setTabViewType:tabViewType]
}
unsafe fn controlTint(self) -> id{
msg_send![self, controlTint]
}
unsafe fn setControlTint_(self,controlTint:id){
msg_send![self, setControlTint:controlTint]
}
unsafe fn drawsBackground(self) -> BOOL{
msg_send![self, drawsBackground]
}
unsafe fn setDrawsBackground_(self,drawsBackground:BOOL){
msg_send![self, setDrawsBackground:drawsBackground as libc::c_int]
}
unsafe fn minimumSize(self) -> id{
msg_send![self, minimumSize]
}
unsafe fn contentRect(self) -> id{
msg_send![self, contentRect]
}
unsafe fn controlSize(self) -> id{
msg_send![self, controlSize]
}
unsafe fn setControlSize_(self,controlSize:id){
msg_send![self, setControlSize:controlSize]
}
unsafe fn allowsTruncatedLabels(self) -> BOOL{
msg_send![self, allowsTruncatedLabels]
}
unsafe fn setAllowsTruncatedLabels_(self, allowTruncatedLabels:BOOL){
msg_send![self, setAllowsTruncatedLabels:allowTruncatedLabels as libc::c_int]
}
unsafe fn setDelegate_(self, delegate:id){
msg_send![self, setDelegate:delegate]
}
unsafe fn delegate(self) -> id {
msg_send![self, delegate]
}
unsafe fn tabViewAtPoint_(self, point:id) -> id{
msg_send![self, tabViewAtPoint:point]
}
}
#[repr(u64)]
pub enum NSTabState {
NSSelectedTab = 0,
NSBackgroundTab = 1,
NSPressedTab = 2
}
pub trait NSTabViewItem: Sized {
unsafe fn alloc(_: Self) -> id {
msg_send![class("NSTabViewItem"), alloc]
}
unsafe fn new(_: Self) -> id {
msg_send![class("NSTabViewItem"), new]
}
unsafe fn initWithIdentifier_(self, identifier:id) -> id;
unsafe fn drawLabel_inRect_(self,shouldTruncateLabel:BOOL,labelRect:NSRect);
unsafe fn label(self) -> id;
unsafe fn setLabel_(self,label:id);
unsafe fn sizeOfLabel_(self, computeMin:BOOL);
unsafe fn tabState(self) -> NSTabState;
unsafe fn identifier(self)-> id;
unsafe fn setIdentifier_(self,identifier:id);
unsafe fn color(self)-> id;
unsafe fn setColor_(self,color:id);
unsafe fn view(self) -> id;
unsafe fn setView_(self, view:id);
unsafe fn initialFirstResponder(self)->id;
unsafe fn setInitialFirstResponder_(self,initialFirstResponder:id);
unsafe fn tabView(self) -> id;
unsafe fn tooltip(self) -> id;
unsafe fn setTooltip_(self,toolTip:id);
}
impl NSTabViewItem for id {
unsafe fn initWithIdentifier_(self, identifier: id) -> id {
msg_send![self, initWithIdentifier:identifier]
}
unsafe fn drawLabel_inRect_(self, shouldTruncateLabel:BOOL,labelRect:NSRect){
msg_send![self, drawLabel:shouldTruncateLabel as libc::c_int inRect:labelRect]
}
unsafe fn label(self)->id{
msg_send![self, label]
}
unsafe fn setLabel_(self,label : id){
msg_send![self, setLabel:label]
}
unsafe fn sizeOfLabel_(self,computeMin:BOOL){
msg_send![self, sizeOfLabel:computeMin as libc::c_int]
}
unsafe fn tabState(self) -> NSTabState{
msg_send![self, tabState]
}
unsafe fn identifier(self)-> id {
msg_send![self, identifier]
}
unsafe fn setIdentifier_(self,identifier:id){
msg_send![self, identifier:identifier]
}
unsafe fn color(self)-> id{
msg_send![self, color]
}
unsafe fn setColor_(self,color:id){
msg_send![self, color:color]
}
unsafe fn view(self) -> id {
msg_send![self, view]
}
unsafe fn setView_(self, view:id){
msg_send![self, setView:view]
}
unsafe fn initialFirstResponder(self)->id{
msg_send![self, initialFirstResponder]
}
unsafe fn setInitialFirstResponder_(self,initialFirstResponder:id){
msg_send![self, setInitialFirstResponder:initialFirstResponder]
}
unsafe fn tabView(self) -> id{
msg_send![self, tabView]
}
unsafe fn tooltip(self) -> id{
msg_send![self, tooltip]
}
unsafe fn setTooltip_(self,toolTip:id){
msg_send![self, setTooltip:toolTip]
}
}
pub trait NSLayoutConstraint: Sized {
unsafe fn activateConstraints(_: Self, constraints: id) -> id;
}
impl NSLayoutConstraint for id {
unsafe fn activateConstraints(_: Self, constraints: id) -> id {
msg_send![class("NSLayoutConstraint"), activateConstraints:constraints]
}
}
pub trait NSLayoutDimension: Sized {
unsafe fn constraintEqualToConstant(self, c: CGFloat) -> id;
unsafe fn constraintLessThanOrEqualToConstant(self, c: CGFloat) -> id;
unsafe fn constraintGreaterThanOrEqualToConstant(self, c: CGFloat) -> id;
}
impl NSLayoutDimension for id {
unsafe fn constraintEqualToConstant(self, c: CGFloat) -> id {
msg_send![self, constraintEqualToConstant:c]
}
unsafe fn constraintLessThanOrEqualToConstant(self, c: CGFloat) -> id {
msg_send![self, constraintLessThanOrEqualToConstant:c]
}
unsafe fn constraintGreaterThanOrEqualToConstant(self, c: CGFloat) -> id {
msg_send![self, constraintGreaterThanOrEqualToConstant:c]
}
}
pub trait NSColor: Sized {
unsafe fn clearColor(_: Self) -> id;
}
impl NSColor for id {
unsafe fn clearColor(_: Self) -> id {
msg_send![class("NSColor"), clearColor]
}
}
#[cfg(test)]
mod test {
use super::*;
#[test]
pub fn test_nsapp() {
unsafe {
let _nsApp = NSApp();
}
}
}
================================================
FILE: src/base.rs
================================================
// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use objc::runtime;
use std::mem;
pub use objc::runtime::{BOOL, NO, YES};
pub type Class = *mut runtime::Class;
#[allow(non_camel_case_types)]
pub type id = *mut runtime::Object;
pub type SEL = runtime::Sel;
#[allow(non_upper_case_globals)]
pub const nil: id = 0 as id;
#[allow(non_upper_case_globals)]
pub const Nil: Class = 0 as Class;
/// A convenience method to convert the name of a class to the class object itself.
#[inline]
pub fn class(name: &str) -> Class {
unsafe {
mem::transmute(runtime::Class::get(name))
}
}
/// A convenience method to convert the name of a selector to the selector object.
#[inline]
pub fn selector(name: &str) -> SEL {
runtime::Sel::register(name)
}
================================================
FILE: src/foundation.rs
================================================
// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(non_upper_case_globals)]
use std::ptr;
use base::{id, class, BOOL, NO, SEL, nil};
use block::Block;
use libc;
#[cfg(target_pointer_width = "32")]
pub type NSInteger = libc::c_int;
#[cfg(target_pointer_width = "32")]
pub type NSUInteger = libc::c_uint;
#[cfg(target_pointer_width = "64")]
pub type NSInteger = libc::c_long;
#[cfg(target_pointer_width = "64")]
pub type NSUInteger = libc::c_ulong;
const UTF8_ENCODING: usize = 4;
#[cfg(target_os = "macos")]
mod macos {
use std::mem;
use base::{id, class};
use core_graphics::base::CGFloat;
use core_graphics::geometry::CGRect;
use objc;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct NSPoint {
pub x: f64,
pub y: f64,
}
impl NSPoint {
#[inline]
pub fn new(x: f64, y: f64) -> NSPoint {
NSPoint {
x: x,
y: y,
}
}
}
unsafe impl objc::Encode for NSPoint {
fn encode() -> objc::Encoding {
let encoding = format!("{{CGPoint={}{}}}",
f64::encode().as_str(),
f64::encode().as_str());
unsafe { objc::Encoding::from_str(&encoding) }
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct NSSize {
pub width: f64,
pub height: f64,
}
impl NSSize {
#[inline]
pub fn new(width: f64, height: f64) -> NSSize {
NSSize {
width: width,
height: height,
}
}
}
unsafe impl objc::Encode for NSSize {
fn encode() -> objc::Encoding {
let encoding = format!("{{CGSize={}{}}}",
f64::encode().as_str(),
f64::encode().as_str());
unsafe { objc::Encoding::from_str(&encoding) }
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct NSRect {
pub origin: NSPoint,
pub size: NSSize,
}
impl NSRect {
#[inline]
pub fn new(origin: NSPoint, size: NSSize) -> NSRect {
NSRect {
origin: origin,
size: size
}
}
#[inline]
pub fn as_CGRect(&self) -> &CGRect {
unsafe {
mem::transmute::<&NSRect, &CGRect>(self)
}
}
#[inline]
pub fn inset(&self, x: CGFloat, y: CGFloat) -> NSRect {
unsafe {
NSInsetRect(*self, x, y)
}
}
}
unsafe impl objc::Encode for NSRect {
fn encode() -> objc::Encoding {
let encoding = format!("{{CGRect={}{}}}",
NSPoint::encode().as_str(),
NSSize::encode().as_str());
unsafe { objc::Encoding::from_str(&encoding) }
}
}
// Same as CGRectEdge
#[repr(u32)]
pub enum NSRectEdge {
NSRectMinXEdge,
NSRectMinYEdge,
NSRectMaxXEdge,
NSRectMaxYEdge,
}
#[link(name = "Foundation", kind = "framework")]
extern {
fn NSInsetRect(rect: NSRect, x: CGFloat, y: CGFloat) -> NSRect;
}
pub trait NSValue: Sized {
unsafe fn valueWithPoint(_: Self, point: NSPoint) -> id {
msg_send![class("NSValue"), valueWithPoint:point]
}
unsafe fn valueWithSize(_: Self, size: NSSize) -> id {
msg_send![class("NSValue"), valueWithSize:size]
}
}
impl NSValue for id {
}
}
#[cfg(target_os = "macos")]
pub use self::macos::*;
#[repr(C)]
pub struct NSRange {
pub location: NSUInteger,
pub length: NSUInteger,
}
impl NSRange {
#[inline]
pub fn new(location: NSUInteger, length: NSUInteger) -> NSRange {
NSRange {
location: location,
length: length
}
}
}
#[link(name = "Foundation", kind = "framework")]
extern {
pub static NSDefaultRunLoopMode: id;
}
pub trait NSAutoreleasePool: Sized {
unsafe fn new(_: Self) -> id {
msg_send![class("NSAutoreleasePool"), new]
}
unsafe fn autorelease(self) -> Self;
unsafe fn drain(self);
}
impl NSAutoreleasePool for id {
unsafe fn autorelease(self) -> id {
msg_send![self, autorelease]
}
unsafe fn drain(self) {
msg_send![self, drain]
}
}
pub trait NSProcessInfo: Sized {
unsafe fn processInfo(_: Self) -> id {
msg_send![class("NSProcessInfo"), processInfo]
}
unsafe fn processName(self) -> id;
}
impl NSProcessInfo for id {
unsafe fn processName(self) -> id {
msg_send![self, processName]
}
}
pub type NSTimeInterval = libc::c_double;
pub trait NSArray: Sized {
unsafe fn array(_: Self) -> id {
msg_send![class("NSArray"), array]
}
unsafe fn arrayWithObjects(_: Self, objects: &[id]) -> id {
msg_send![class("NSArray"), arrayWithObjects:objects.as_ptr()
count:objects.len()]
}
unsafe fn arrayWithObject(_: Self, object: id) -> id {
msg_send![class("NSArray"), arrayWithObject:object]
}
unsafe fn arrayByAddingObjectFromArray(self, object: id) -> id;
unsafe fn arrayByAddingObjectsFromArray(self, objects: id) -> id;
}
impl NSArray for id {
unsafe fn arrayByAddingObjectFromArray(self, object: id) -> id {
msg_send![self, arrayByAddingObjectFromArray:object]
}
unsafe fn arrayByAddingObjectsFromArray(self, objects: id) -> id {
msg_send![self, arrayByAddingObjectsFromArray:objects]
}
}
pub trait NSDictionary: Sized {
unsafe fn dictionary(_: Self) -> id {
msg_send![class("NSDictionary"), dictionary]
}
unsafe fn dictionaryWithContentsOfFile_(_: Self, path: id) -> id {
msg_send![class("NSDictionary"), dictionaryWithContentsOfFile:path]
}
unsafe fn dictionaryWithContentsOfURL_(_: Self, aURL: id) -> id {
msg_send![class("NSDictionary"), dictionaryWithContentsOfURL:aURL]
}
unsafe fn dictionaryWithDictionary_(_: Self, otherDictionary: id) -> id {
msg_send![class("NSDictionary"), dictionaryWithDictionary:otherDictionary]
}
unsafe fn dictionaryWithObject_forKey_(_: Self, anObject: id, aKey: id) -> id {
msg_send![class("NSDictionary"), dictionaryWithObject:anObject forKey:aKey]
}
unsafe fn dictionaryWithObjects_forKeys_(_: Self, objects: id, keys: id) -> id {
msg_send![class("NSDictionary"), dictionaryWithObjects:objects forKeys:keys]
}
unsafe fn dictionaryWithObjects_forKeys_count_(_: Self, objects: *const id, keys: *const id, count: NSUInteger) -> id {
msg_send![class("NSDictionary"), dictionaryWithObjects:objects forKeys:keys count:count]
}
unsafe fn dictionaryWithObjectsAndKeys_(_: Self, firstObject: id) -> id {
msg_send![class("NSDictionary"), dictionaryWithObjectsAndKeys:firstObject]
}
unsafe fn init(self) -> id;
unsafe fn initWithContentsOfFile_(self, path: id) -> id;
unsafe fn initWithContentsOfURL_(self, aURL: id) -> id;
unsafe fn initWithDictionary_(self, otherDicitonary: id) -> id;
unsafe fn initWithDictionary_copyItems_(self, otherDicitonary: id, flag: BOOL) -> id;
unsafe fn initWithObjects_forKeys_(self, objects: id, keys: id) -> id;
unsafe fn initWithObjects_forKeys_count_(self, objects: id, keys: id, count: NSUInteger) -> id;
unsafe fn initWithObjectsAndKeys_(self, firstObject: id) -> id;
unsafe fn sharedKeySetForKeys_(_: Self, keys: id) -> id {
msg_send![class("NSDictionary"), sharedKeySetForKeys:keys]
}
unsafe fn count(self) -> NSUInteger;
unsafe fn isEqualToDictionary_(self, otherDictionary: id) -> BOOL;
unsafe fn allKeys(self) -> id;
unsafe fn allKeysForObject_(self, anObject: id) -> id;
unsafe fn allValues(self) -> id;
unsafe fn objectForKey_(self, aKey: id) -> id;
unsafe fn objectForKeyedSubscript_(self, key: id) -> id;
unsafe fn objectsForKeys_notFoundMarker_(self, keys: id, anObject: id) -> id;
unsafe fn valueForKey_(self, key: id) -> id;
unsafe fn keyEnumerator(self) -> id;
unsafe fn objectEnumerator(self) -> id;
unsafe fn enumerateKeysAndObjectsUsingBlock_(self, block: *mut Block<(id, id, *mut BOOL), ()>);
unsafe fn enumerateKeysAndObjectsWithOptions_usingBlock_(self, opts: NSEnumerationOptions,
block: *mut Block<(id, id, *mut BOOL), ()>);
unsafe fn keysSortedByValueUsingSelector_(self, comparator: SEL) -> id;
unsafe fn keysSortedByValueUsingComparator_(self, cmptr: NSComparator) -> id;
unsafe fn keysSortedByValueWithOptions_usingComparator_(self, opts: NSEnumerationOptions, cmptr: NSComparator) -> id;
unsafe fn keysOfEntriesPassingTest_(self, predicate: *mut Block<(id, id, *mut BOOL), BOOL>) -> id;
unsafe fn keysOfEntriesWithOptions_PassingTest_(self, opts: NSEnumerationOptions,
predicate: *mut Block<(id, id, *mut BOOL), BOOL>) -> id;
unsafe fn writeToFile_atomically_(self, path: id, flag: BOOL) -> BOOL;
unsafe fn writeToURL_atomically_(self, aURL: id, flag: BOOL) -> BOOL;
unsafe fn fileCreationDate(self) -> id;
unsafe fn fileExtensionHidden(self) -> BOOL;
unsafe fn fileGroupOwnerAccountID(self) -> id;
unsafe fn fileGroupOwnerAccountName(self) -> id;
unsafe fn fileIsAppendOnly(self) -> BOOL;
unsafe fn fileIsImmutable(self) -> BOOL;
unsafe fn fileModificationDate(self) -> id;
unsafe fn fileOwnerAccountID(self) -> id;
unsafe fn fileOwnerAccountName(self) -> id;
unsafe fn filePosixPermissions(self) -> NSUInteger;
unsafe fn fileSize(self) -> libc::c_ulonglong;
unsafe fn fileSystemFileNumber(self) -> NSUInteger;
unsafe fn fileSystemNumber(self) -> NSInteger;
unsafe fn fileType(self) -> id;
unsafe fn description(self) -> id;
unsafe fn descriptionInStringsFileFormat(self) -> id;
unsafe fn descriptionWithLocale_(self, locale: id) -> id;
unsafe fn descriptionWithLocale_indent_(self, locale: id, indent: NSUInteger) -> id;
}
impl NSDictionary for id {
unsafe fn init(self) -> id {
msg_send![self, init]
}
unsafe fn initWithContentsOfFile_(self, path: id) -> id {
msg_send![self, initWithContentsOfFile:path]
}
unsafe fn initWithContentsOfURL_(self, aURL: id) -> id {
msg_send![self, initWithContentsOfURL:aURL]
}
unsafe fn initWithDictionary_(self, otherDictionary: id) -> id {
msg_send![self, initWithDictionary:otherDictionary]
}
unsafe fn initWithDictionary_copyItems_(self, otherDictionary: id, flag: BOOL) -> id {
msg_send![self, initWithDictionary:otherDictionary copyItems:flag]
}
unsafe fn initWithObjects_forKeys_(self, objects: id, keys: id) -> id {
msg_send![self, initWithObjects:objects forKeys:keys]
}
unsafe fn initWithObjects_forKeys_count_(self, objects: id, keys: id, count: NSUInteger) -> id {
msg_send![self, initWithObjects:objects forKeys:keys count:count]
}
unsafe fn initWithObjectsAndKeys_(self, firstObject: id) -> id {
msg_send![self, initWithObjectsAndKeys:firstObject]
}
unsafe fn count(self) -> NSUInteger {
msg_send![self, count]
}
unsafe fn isEqualToDictionary_(self, otherDictionary: id) -> BOOL {
msg_send![self, isEqualToDictionary:otherDictionary]
}
unsafe fn allKeys(self) -> id {
msg_send![self, allKeys]
}
unsafe fn allKeysForObject_(self, anObject: id) -> id {
msg_send![self, allKeysForObject:anObject]
}
unsafe fn allValues(self) -> id {
msg_send![self, allValues]
}
unsafe fn objectForKey_(self, aKey: id) -> id {
msg_send![self, objectForKey:aKey]
}
unsafe fn objectForKeyedSubscript_(self, key: id) -> id {
msg_send![self, objectForKeyedSubscript:key]
}
unsafe fn objectsForKeys_notFoundMarker_(self, keys: id, anObject: id) -> id {
msg_send![self, objectsForKeys:keys notFoundMarker:anObject]
}
unsafe fn valueForKey_(self, key: id) -> id {
msg_send![self, valueForKey:key]
}
unsafe fn keyEnumerator(self) -> id {
msg_send![self, keyEnumerator]
}
unsafe fn objectEnumerator(self) -> id {
msg_send![self, objectEnumerator]
}
unsafe fn enumerateKeysAndObjectsUsingBlock_(self, block: *mut Block<(id, id, *mut BOOL), ()>) {
msg_send![self, enumerateKeysAndObjectsUsingBlock:block]
}
unsafe fn enumerateKeysAndObjectsWithOptions_usingBlock_(self, opts: NSEnumerationOptions,
block: *mut Block<(id, id, *mut BOOL), ()>) {
msg_send![self, enumerateKeysAndObjectsWithOptions:opts usingBlock:block]
}
unsafe fn keysSortedByValueUsingSelector_(self, comparator: SEL) -> id {
msg_send![self, keysSortedByValueUsingSelector:comparator]
}
unsafe fn keysSortedByValueUsingComparator_(self, cmptr: NSComparator) -> id {
msg_send![self, keysSortedByValueUsingComparator:cmptr]
}
unsafe fn keysSortedByValueWithOptions_usingComparator_(self, opts: NSEnumerationOptions, cmptr: NSComparator) -> id {
let rv: id = msg_send![self, keysSortedByValueWithOptions:opts usingComparator:cmptr];
rv
}
unsafe fn keysOfEntriesPassingTest_(self, predicate: *mut Block<(id, id, *mut BOOL), BOOL>) -> id {
msg_send![self, keysOfEntriesPassingTest:predicate]
}
unsafe fn keysOfEntriesWithOptions_PassingTest_(self, opts: NSEnumerationOptions,
predicate: *mut Block<(id, id, *mut BOOL), BOOL>) -> id {
msg_send![self, keysOfEntriesWithOptions:opts PassingTest:predicate]
}
unsafe fn writeToFile_atomically_(self, path: id, flag: BOOL) -> BOOL {
msg_send![self, writeToFile:path atomically:flag]
}
unsafe fn writeToURL_atomically_(self, aURL: id, flag: BOOL) -> BOOL {
msg_send![self, writeToURL:aURL atomically:flag]
}
unsafe fn fileCreationDate(self) -> id {
msg_send![self, fileCreationDate]
}
unsafe fn fileExtensionHidden(self) -> BOOL {
msg_send![self, fileExtensionHidden]
}
unsafe fn fileGroupOwnerAccountID(self) -> id {
msg_send![self, fileGroupOwnerAccountID]
}
unsafe fn fileGroupOwnerAccountName(self) -> id {
msg_send![self, fileGroupOwnerAccountName]
}
unsafe fn fileIsAppendOnly(self) -> BOOL {
msg_send![self, fileIsAppendOnly]
}
unsafe fn fileIsImmutable(self) -> BOOL {
msg_send![self, fileIsImmutable]
}
unsafe fn fileModificationDate(self) -> id {
msg_send![self, fileModificationDate]
}
unsafe fn fileOwnerAccountID(self) -> id {
msg_send![self, fileOwnerAccountID]
}
unsafe fn fileOwnerAccountName(self) -> id {
msg_send![self, fileOwnerAccountName]
}
unsafe fn filePosixPermissions(self) -> NSUInteger {
msg_send![self, filePosixPermissions]
}
unsafe fn fileSize(self) -> libc::c_ulonglong {
msg_send![self, fileSize]
}
unsafe fn fileSystemFileNumber(self) -> NSUInteger {
msg_send![self, fileSystemFileNumber]
}
unsafe fn fileSystemNumber(self) -> NSInteger {
msg_send![self, fileSystemNumber]
}
unsafe fn fileType(self) -> id {
msg_send![self, fileType]
}
unsafe fn description(self) -> id {
msg_send![self, description]
}
unsafe fn descriptionInStringsFileFormat(self) -> id {
msg_send![self, descriptionInStringsFileFormat]
}
unsafe fn descriptionWithLocale_(self, locale: id) -> id {
msg_send![self, descriptionWithLocale:locale]
}
unsafe fn descriptionWithLocale_indent_(self, locale: id, indent: NSUInteger) -> id {
msg_send![self, descriptionWithLocale:locale indent:indent]
}
}
bitflags! {
pub struct NSEnumerationOptions: libc::c_ulonglong {
const NSEnumerationConcurrent = 1 << 0;
const NSEnumerationReverse = 1 << 1;
}
}
pub type NSComparator = *mut Block<(id, id), NSComparisonResult>;
#[repr(isize)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum NSComparisonResult {
NSOrderedAscending = -1,
NSOrderedSame = 0,
NSOrderedDescending = 1
}
pub trait NSString: Sized {
unsafe fn alloc(_: Self) -> id {
msg_send![class("NSString"), alloc]
}
unsafe fn stringByAppendingString_(self, other: id) -> id;
unsafe fn init_str(self, string: &str) -> Self;
unsafe fn UTF8String(self) -> *const libc::c_char;
unsafe fn len(self) -> usize;
unsafe fn isEqualToString(self, &str) -> bool;
}
impl NSString for id {
unsafe fn isEqualToString(self, other: &str) -> bool {
let other = NSString::alloc(nil).init_str(other);
let rv: BOOL = msg_send![self, isEqualToString:other];
rv != NO
}
unsafe fn stringByAppendingString_(self, other: id) -> id {
msg_send![self, stringByAppendingString:other]
}
unsafe fn init_str(self, string: &str) -> id {
return msg_send![self,
initWithBytes:string.as_ptr()
length:string.len()
encoding:UTF8_ENCODING as id];
}
unsafe fn len(self) -> usize {
msg_send![self, lengthOfBytesUsingEncoding:UTF8_ENCODING]
}
unsafe fn UTF8String(self) -> *const libc::c_char {
msg_send![self, UTF8String]
}
}
pub trait NSDate: Sized {
unsafe fn distantPast(_: Self) -> id {
msg_send![class("NSDate"), distantPast]
}
unsafe fn distantFuture(_: Self) -> id {
msg_send![class("NSDate"), distantFuture]
}
}
impl NSDate for id {
}
#[repr(C)]
struct NSFastEnumerationState {
pub state: libc::c_ulong,
pub items_ptr: *mut id,
pub mutations_ptr: *mut libc::c_ulong,
pub extra: [libc::c_ulong; 5]
}
const NS_FAST_ENUM_BUF_SIZE: usize = 16;
pub struct NSFastIterator {
state: NSFastEnumerationState,
buffer: [id; NS_FAST_ENUM_BUF_SIZE],
mut_val: Option<libc::c_ulong>,
len: usize,
idx: usize,
object: id
}
impl Iterator for NSFastIterator {
type Item = id;
fn next(&mut self) -> Option<id> {
if self.idx >= self.len {
self.len = unsafe {
msg_send![self.object, countByEnumeratingWithState:&mut self.state objects:self.buffer.as_mut_ptr() count:NS_FAST_ENUM_BUF_SIZE]
};
self.idx = 0;
}
let new_mut = unsafe {
*self.state.mutations_ptr
};
if let Some(old_mut) = self.mut_val {
assert!(old_mut == new_mut, "The collection was mutated while being enumerated");
}
if self.idx < self.len {
let object = unsafe {
*self.state.items_ptr.offset(self.idx as isize)
};
self.mut_val = Some(new_mut);
self.idx += 1;
Some(object)
} else {
None
}
}
}
pub trait NSFastEnumeration: Sized {
unsafe fn iter(self) -> NSFastIterator;
}
impl NSFastEnumeration for id {
unsafe fn iter(self) -> NSFastIterator {
NSFastIterator {
state: NSFastEnumerationState {
state: 0,
items_ptr: ptr::null_mut(),
mutations_ptr: ptr::null_mut(),
extra: [0; 5]
},
buffer: [nil; NS_FAST_ENUM_BUF_SIZE],
mut_val: None,
len: 0,
idx: 0,
object: self
}
}
}
pub trait NSRunLoop: Sized {
unsafe fn currentRunLoop() -> Self;
unsafe fn performSelector_target_argument_order_modes_(self,
aSelector: SEL,
target: id,
anArgument: id,
order: NSUInteger,
modes: id);
}
impl NSRunLoop for id {
unsafe fn currentRunLoop() -> id {
msg_send![class("NSRunLoop"), currentRunLoop]
}
unsafe fn performSelector_target_argument_order_modes_(self,
aSelector: SEL,
target: id,
anArgument: id,
order: NSUInteger,
modes: id) {
msg_send![self, performSelector:aSelector
target:target
argument:anArgument
order:order
modes:modes]
}
}
pub trait NSData: Sized {
unsafe fn data(_: Self) -> id {
msg_send![class("NSData"), data]
}
unsafe fn dataWithBytes_length_(_: Self, bytes: *const libc::c_void, length: NSUInteger) -> id {
msg_send![class("NSData"), dataWithBytes:bytes length:length]
}
unsafe fn dataWithBytesNoCopy_length_(_: Self, bytes: *const libc::c_void, length: NSUInteger) -> id {
msg_send![class("NSData"), dataWithBytesNoCopy:bytes length:length]
}
unsafe fn dataWithBytesNoCopy_length_freeWhenDone_(_: Self, bytes: *const libc::c_void,
length: NSUInteger, freeWhenDone: BOOL) -> id {
msg_send![class("NSData"), dataWithBytesNoCopy:bytes length:length freeWhenDone:freeWhenDone]
}
unsafe fn dataWithContentsOfFile_(_: Self, path: id) -> id {
msg_send![class("NSData"), dataWithContentsOfFile:path]
}
unsafe fn dataWithContentsOfFile_options_error_(_: Self, path: id, mask: NSDataReadingOptions,
errorPtr: *mut id) -> id {
msg_send![class("NSData"), dataWithContentsOfFile:path options:mask error:errorPtr]
}
unsafe fn dataWithContentsOfURL_(_: Self, aURL: id) -> id {
msg_send![class("NSData"), dataWithContentsOfURL:aURL]
}
unsafe fn dataWithContentsOfURL_options_error_(_: Self, aURL: id, mask: NSDataReadingOptions,
errorPtr: *mut id) -> id {
msg_send![class("NSData"), dataWithContentsOfURL:aURL options:mask error:errorPtr]
}
unsafe fn dataWithData_(_: Self, aData: id) -> id {
msg_send![class("NSData"), dataWithData:aData]
}
unsafe fn initWithBase64EncodedData_options_(self, base64Data: id, options: NSDataBase64DecodingOptions)
-> id;
unsafe fn initWithBase64EncodedString_options_(self, base64String: id, options: NSDataBase64DecodingOptions)
-> id;
unsafe fn initWithBytes_length_(self, bytes: *const libc::c_void, length: NSUInteger) -> id;
unsafe fn initWithBytesNoCopy_length_(self, bytes: *const libc::c_void, length: NSUInteger) -> id;
unsafe fn initWithBytesNoCopy_length_deallocator_(self, bytes: *const libc::c_void, length: NSUInteger,
deallocator: *mut Block<(*const libc::c_void, NSUInteger), ()>)
-> id;
unsafe fn initWithBytesNoCopy_length_freeWhenDone_(self, bytes: *const libc::c_void,
length: NSUInteger, freeWhenDone: BOOL) -> id;
unsafe fn initWithContentsOfFile_(self, path: id) -> id;
unsafe fn initWithContentsOfFile_options_error(self, path: id, mask: NSDataReadingOptions, errorPtr: *mut id)
-> id;
unsafe fn initWithContentsOfURL_(self, aURL: id) -> id;
unsafe fn initWithContentsOfURL_options_error_(self, aURL: id, mask: NSDataReadingOptions, errorPtr: *mut id)
-> id;
unsafe fn initWithData_(self, data: id) -> id;
unsafe fn bytes(self) -> *const libc::c_void;
unsafe fn description(self) -> id;
unsafe fn enumerateByteRangesUsingBlock_(self, block: *mut Block<(*const libc::c_void, NSRange, *mut BOOL), ()>);
unsafe fn getBytes_length_(self, buffer: *mut libc::c_void, length: NSUInteger);
unsafe fn getBytes_range_(self, buffer: *mut libc::c_void, range: NSRange);
unsafe fn subdataWithRange_(self, range: NSRange) -> id;
unsafe fn rangeOfData_options_range_(self, dataToFind: id, options: NSDataSearchOptions, searchRange: NSRange)
-> NSRange;
unsafe fn base64EncodedDataWithOptions_(self, options: NSDataBase64EncodingOptions) -> id;
unsafe fn base64EncodedStringWithOptions_(self, options: NSDataBase64EncodingOptions) -> id;
unsafe fn isEqualToData_(self, otherData: id) -> id;
unsafe fn length(self) -> NSUInteger;
unsafe fn writeToFile_atomically_(self, path: id, atomically: BOOL) -> BOOL;
unsafe fn writeToFile_options_error_(self, path: id, mask: NSDataWritingOptions, errorPtr: *mut id) -> BOOL;
unsafe fn writeToURL_atomically_(self, aURL: id, atomically: BOOL) -> BOOL;
unsafe fn writeToURL_options_error_(self, aURL: id, mask: NSDataWritingOptions, errorPtr: *mut id) -> BOOL;
}
impl NSData for id {
unsafe fn initWithBase64EncodedData_options_(self, base64Data: id, options: NSDataBase64DecodingOptions)
-> id {
msg_send![self, initWithBase64EncodedData:base64Data options:options]
}
unsafe fn initWithBase64EncodedString_options_(self, base64String: id, options: NSDataBase64DecodingOptions)
-> id {
msg_send![self, initWithBase64EncodedString:base64String options:options]
}
unsafe fn initWithBytes_length_(self, bytes: *const libc::c_void, length: NSUInteger) -> id {
msg_send![self,initWithBytes:bytes length:length]
}
unsafe fn initWithBytesNoCopy_length_(self, bytes: *const libc::c_void, length: NSUInteger) -> id {
msg_send![self, initWithBytesNoCopy:bytes length:length]
}
unsafe fn initWithBytesNoCopy_length_deallocator_(self, bytes: *const libc::c_void, length: NSUInteger,
deallocator: *mut Block<(*const libc::c_void, NSUInteger), ()>)
-> id {
msg_send![self, initWithBytesNoCopy:bytes length:length deallocator:deallocator]
}
unsafe fn initWithBytesNoCopy_length_freeWhenDone_(self, bytes: *const libc::c_void,
length: NSUInteger, freeWhenDone: BOOL) -> id {
msg_send![self, initWithBytesNoCopy:bytes length:length freeWhenDone:freeWhenDone]
}
unsafe fn initWithContentsOfFile_(self, path: id) -> id {
msg_send![self, initWithContentsOfFile:path]
}
unsafe fn initWithContentsOfFile_options_error(self, path: id, mask: NSDataReadingOptions, errorPtr: *mut id)
-> id {
msg_send![self, initWithContentsOfFile:path options:mask error:errorPtr]
}
unsafe fn initWithContentsOfURL_(self, aURL: id) -> id {
msg_send![self, initWithContentsOfURL:aURL]
}
unsafe fn initWithContentsOfURL_options_error_(self, aURL: id, mask: NSDataReadingOptions, errorPtr: *mut id)
-> id {
msg_send![self, initWithContentsOfURL:aURL options:mask error:errorPtr]
}
unsafe fn initWithData_(self, data: id) -> id {
msg_send![self, initWithData:data]
}
unsafe fn bytes(self) -> *const libc::c_void {
msg_send![self, bytes]
}
unsafe fn description(self) -> id {
msg_send![self, description]
}
unsafe fn enumerateByteRangesUsingBlock_(self, block: *mut Block<(*const libc::c_void, NSRange, *mut BOOL), ()>) {
msg_send![self, enumerateByteRangesUsingBlock:block]
}
unsafe fn getBytes_length_(self, buffer: *mut libc::c_void, length: NSUInteger) {
msg_send![self, getBytes:buffer length:length]
}
unsafe fn getBytes_range_(self, buffer: *mut libc::c_void, range: NSRange) {
msg_send![self, getBytes:buffer range:range]
}
unsafe fn subdataWithRange_(self, range: NSRange) -> id {
msg_send![self, subdataWithRange:range]
}
unsafe fn rangeOfData_options_range_(self, dataToFind: id, options: NSDataSearchOptions, searchRange: NSRange)
-> NSRange {
msg_send![self, rangeOfData:dataToFind options:options range:searchRange]
}
unsafe fn base64EncodedDataWithOptions_(self, options: NSDataBase64EncodingOptions) -> id {
msg_send![self, base64EncodedDataWithOptions:options]
}
unsafe fn base64EncodedStringWithOptions_(self, options: NSDataBase64EncodingOptions) -> id {
msg_send![self, base64EncodedStringWithOptions:options]
}
unsafe fn isEqualToData_(self, otherData: id) -> id {
msg_send![self, isEqualToData:otherData]
}
unsafe fn length(self) -> NSUInteger {
msg_send![self, length]
}
unsafe fn writeToFile_atomically_(self, path: id, atomically: BOOL) -> BOOL {
msg_send![self, writeToFile:path atomically:atomically]
}
unsafe fn writeToFile_options_error_(self, path: id, mask: NSDataWritingOptions, errorPtr: *mut id) -> BOOL {
msg_send![self, writeToFile:path options:mask error:errorPtr]
}
unsafe fn writeToURL_atomically_(self, aURL: id, atomically: BOOL) -> BOOL {
msg_send![self, writeToURL:aURL atomically:atomically]
}
unsafe fn writeToURL_options_error_(self, aURL: id, mask: NSDataWritingOptions, errorPtr: *mut id) -> BOOL {
msg_send![self, writeToURL:aURL options:mask error:errorPtr]
}
}
bitflags! {
pub struct NSDataReadingOptions: libc::c_ulonglong {
const NSDataReadingMappedIfSafe = 1 << 0;
const NSDataReadingUncached = 1 << 1;
const NSDataReadingMappedAlways = 1 << 3;
}
}
bitflags! {
pub struct NSDataBase64EncodingOptions: libc::c_ulonglong {
const NSDataBase64Encoding64CharacterLineLength = 1 << 0;
const NSDataBase64Encoding76CharacterLineLength = 1 << 1;
const NSDataBase64EncodingEndLineWithCarriageReturn = 1 << 4;
const NSDataBase64EncodingEndLineWithLineFeed = 1 << 5;
}
}
bitflags! {
pub struct NSDataBase64DecodingOptions: libc::c_ulonglong {
const NSDataBase64DecodingIgnoreUnknownCharacters = 1 << 0;
}
}
bitflags! {
pub struct NSDataWritingOptions: libc::c_ulonglong {
const NSDataWritingAtomic = 1 << 0;
const NSDataWritingWithoutOverwriting = 1 << 1;
}
}
bitflags! {
pub struct NSDataSearchOptions: libc::c_ulonglong {
const NSDataSearchBackwards = 1 << 0;
const NSDataSearchAnchored = 1 << 1;
}
}
================================================
FILE: src/lib.rs
================================================
// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_name = "cocoa"]
#![crate_type = "rlib"]
#![allow(non_snake_case)]
extern crate block;
#[macro_use]
extern crate bitflags;
extern crate libc;
extern crate core_graphics;
#[macro_use]
extern crate objc;
#[cfg(target_os = "macos")]
pub mod appkit;
pub mod base;
pub mod foundation;
================================================
FILE: tests/foundation.rs
================================================
#[macro_use]
extern crate objc;
extern crate block;
extern crate cocoa;
#[cfg(test)]
mod foundation {
mod nsstring {
use cocoa::foundation::NSString;
use cocoa::base::nil;
use std::slice;
use std::str;
#[test]
fn test_utf8() {
let expected = "Iñtërnâtiônàlizætiøn";
unsafe {
let built = NSString::alloc(nil).init_str(expected);
let bytes = built.UTF8String() as *const u8;
let objc_string = str::from_utf8(slice::from_raw_parts(bytes, built.len()))
.unwrap();
assert!(objc_string.len() == expected.len());
assert!(objc_string == expected);
}
}
#[test]
fn test_string() {
let expected = "Hello World!";
unsafe {
let built = NSString::alloc(nil).init_str(expected);
let bytes = built.UTF8String() as *const u8;
let objc_string = str::from_utf8(slice::from_raw_parts(bytes, built.len()))
.unwrap();
assert!(objc_string.len() == expected.len());
assert!(objc_string == expected);
}
}
#[test]
fn test_length() {
let expected = "Hello!";
unsafe {
let built = NSString::alloc(nil).init_str(expected);
assert!(built.len() == expected.len());
}
}
#[test]
fn test_append_by_appending_string() {
let initial_str = "Iñtërnâtiônàlizætiøn";
let to_append = "_more_strings";
let expected = concat!("Iñtërnâtiônàlizætiøn", "_more_strings");
unsafe {
let built = NSString::alloc(nil).init_str(initial_str);
let built_to_append = NSString::alloc(nil).init_str(to_append);
let append_string = built.stringByAppendingString_(built_to_append);
let bytes = append_string.UTF8String() as *const u8;
let objc_string = str::from_utf8(slice::from_raw_parts(bytes, append_string.len()))
.unwrap();
assert!(objc_string == expected);
}
}
}
mod nsfastenumeration {
use std::str;
use std::slice;
use cocoa::foundation::{NSString, NSFastEnumeration};
use cocoa::base::{id, nil};
#[test]
fn test_iter() {
unsafe {
let string = NSString::alloc(nil).init_str("this is a test string");
let separator = NSString::alloc(nil).init_str(" ");
let components: id = msg_send![string, componentsSeparatedByString: separator];
let combined = components.iter()
.map(|s| {
let bytes = s.UTF8String() as *const u8;
str::from_utf8(slice::from_raw_parts(bytes, s.len())).unwrap()
})
.fold(String::new(), |mut acc, s| {
acc.push_str(s);
acc
});
assert_eq!(combined, "thisisateststring");
}
}
#[test]
#[should_panic]
fn test_mutation() {
unsafe {
let string = NSString::alloc(nil).init_str("this is a test string");
let separator = NSString::alloc(nil).init_str(" ");
let components: id = msg_send![string, componentsSeparatedByString: separator];
let mut_components: id = msg_send![components, mutableCopy];
let mut iter = mut_components.iter();
iter.next();
msg_send![mut_components, removeObjectAtIndex:1];
iter.next();
}
}
}
mod nsdictionary {
use block::ConcreteBlock;
use cocoa::foundation::{NSArray, NSComparisonResult, NSDictionary, NSFastEnumeration,
NSString};
use cocoa::base::{id, nil};
#[test]
fn test_get() {
const KEY: &'static str = "The key";
const VALUE: &'static str = "Some value";
unsafe {
let key = NSString::alloc(nil).init_str(KEY);
let value = NSString::alloc(nil).init_str(VALUE);
let dict = NSDictionary::dictionaryWithObject_forKey_(nil, value, key);
let retrieved_value = dict.objectForKey_(key);
assert!(retrieved_value.isEqualToString(VALUE));
}
}
#[test]
fn test_iter() {
let mkstr = |s| unsafe { NSString::alloc(nil).init_str(s) };
let keys = vec!["a", "b", "c", "d", "e", "f"];
let objects = vec!["1", "2", "3", "4", "5", "6"];
unsafe {
use std::{slice, str};
use std::cmp::{Ord, Ordering};
let keys_raw_vec = keys.clone().into_iter().map(&mkstr).collect::<Vec<_>>();
let objs_raw_vec = objects.clone().into_iter().map(&mkstr).collect::<Vec<_>>();
let keys_array = NSArray::arrayWithObjects(nil, &keys_raw_vec);
let objs_array = NSArray::arrayWithObjects(nil, &objs_raw_vec);
let dict =
NSDictionary::dictionaryWithObjects_forKeys_(nil, objs_array, keys_array);
// NSDictionary does not store its contents in order of insertion, so ask for
// sorted iterators to ensure that each item is the same as its counterpart in
// the vector.
// First test cocoa sorting...
let mut comparator = ConcreteBlock::new(|s0: id, s1: id| {
let (bytes0, len0) = (s0.UTF8String() as *const u8, s0.len());
let (bytes1, len1) = (s1.UTF8String() as *const u8, s1.len());
let (s0, s1) = (str::from_utf8(slice::from_raw_parts(bytes0, len0)).unwrap(),
str::from_utf8(slice::from_raw_parts(bytes1, len1)).unwrap());
let (c0, c1) = (s0.chars().next().unwrap(), s1.chars().next().unwrap());
match c0.cmp(&c1) {
Ordering::Less => NSComparisonResult::NSOrderedAscending,
Ordering::Equal => NSComparisonResult::NSOrderedSame,
Ordering::Greater => NSComparisonResult::NSOrderedDescending,
}
});
let associated_iter = keys.iter().zip(objects.iter());
for (k_id, (k, v)) in dict.keysSortedByValueUsingComparator_(&mut *comparator)
.iter()
.zip(associated_iter) {
assert!(k_id.isEqualToString(k));
let v_id = dict.objectForKey_(k_id);
assert!(v_id.isEqualToString(v));
}
// Then use rust sorting
let mut keys_arr = dict.allKeys().iter().collect::<Vec<_>>();
keys_arr.sort();
for (k0, k1) in keys_arr.into_iter().zip(keys.iter()) {
assert!(k0.isEqualToString(k1));
}
let mut objects_arr = dict.allValues().iter().collect::<Vec<_>>();
objects_arr.sort();
for (v0, v1) in objects_arr.into_iter().zip(objects.iter()) {
assert!(v0.isEqualToString(v1));
}
}
}
}
}
gitextract_oxm60gs9/
├── .gitignore
├── .travis.yml
├── COPYRIGHT
├── Cargo.toml
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── examples/
│ ├── hello_world.rs
│ └── tab_view.rs
├── src/
│ ├── appkit.rs
│ ├── base.rs
│ ├── foundation.rs
│ └── lib.rs
└── tests/
└── foundation.rs
SYMBOL INDEX (1353 symbols across 6 files)
FILE: examples/hello_world.rs
function main (line 10) | fn main() {
FILE: examples/tab_view.rs
function main (line 13) | fn main() {
function create_app (line 40) | unsafe fn create_app(title: id, content: id) -> id {
FILE: src/appkit.rs
type CGLContextObj (line 28) | pub type CGLContextObj = *mut libc::c_void;
type GLint (line 30) | pub type GLint = libc::int32_t;
constant NSAppKitVersionNumber10_0 (line 89) | pub const NSAppKitVersionNumber10_0: f64 = 577.0;
constant NSAppKitVersionNumber10_1 (line 90) | pub const NSAppKitVersionNumber10_1: f64 = 620.0;
constant NSAppKitVersionNumber10_2 (line 91) | pub const NSAppKitVersionNumber10_2: f64 = 663.0;
constant NSAppKitVersionNumber10_2_3 (line 92) | pub const NSAppKitVersionNumber10_2_3: f64 = 663.6;
constant NSAppKitVersionNumber10_3 (line 93) | pub const NSAppKitVersionNumber10_3: f64 = 743.0;
constant NSAppKitVersionNumber10_3_2 (line 94) | pub const NSAppKitVersionNumber10_3_2: f64 = 743.14;
constant NSAppKitVersionNumber10_3_3 (line 95) | pub const NSAppKitVersionNumber10_3_3: f64 = 743.2;
constant NSAppKitVersionNumber10_3_5 (line 96) | pub const NSAppKitVersionNumber10_3_5: f64 = 743.24;
constant NSAppKitVersionNumber10_3_7 (line 97) | pub const NSAppKitVersionNumber10_3_7: f64 = 743.33;
constant NSAppKitVersionNumber10_3_9 (line 98) | pub const NSAppKitVersionNumber10_3_9: f64 = 743.36;
constant NSAppKitVersionNumber10_4 (line 99) | pub const NSAppKitVersionNumber10_4: f64 = 824.0;
constant NSAppKitVersionNumber10_4_1 (line 100) | pub const NSAppKitVersionNumber10_4_1: f64 = 824.1;
constant NSAppKitVersionNumber10_4_3 (line 101) | pub const NSAppKitVersionNumber10_4_3: f64 = 824.23;
constant NSAppKitVersionNumber10_4_4 (line 102) | pub const NSAppKitVersionNumber10_4_4: f64 = 824.33;
constant NSAppKitVersionNumber10_4_7 (line 103) | pub const NSAppKitVersionNumber10_4_7: f64 = 824.41;
constant NSAppKitVersionNumber10_5 (line 104) | pub const NSAppKitVersionNumber10_5: f64 = 949.0;
constant NSAppKitVersionNumber10_5_2 (line 105) | pub const NSAppKitVersionNumber10_5_2: f64 = 949.27;
constant NSAppKitVersionNumber10_5_3 (line 106) | pub const NSAppKitVersionNumber10_5_3: f64 = 949.33;
constant NSAppKitVersionNumber10_6 (line 107) | pub const NSAppKitVersionNumber10_6: f64 = 1038.0;
constant NSAppKitVersionNumber10_7 (line 108) | pub const NSAppKitVersionNumber10_7: f64 = 1138.0;
constant NSAppKitVersionNumber10_7_2 (line 109) | pub const NSAppKitVersionNumber10_7_2: f64 = 1138.23;
constant NSAppKitVersionNumber10_7_3 (line 110) | pub const NSAppKitVersionNumber10_7_3: f64 = 1138.32;
constant NSAppKitVersionNumber10_7_4 (line 111) | pub const NSAppKitVersionNumber10_7_4: f64 = 1138.47;
constant NSAppKitVersionNumber10_8 (line 112) | pub const NSAppKitVersionNumber10_8: f64 = 1187.0;
constant NSAppKitVersionNumber10_9 (line 113) | pub const NSAppKitVersionNumber10_9: f64 = 1265.0;
function NSApp (line 115) | pub unsafe fn NSApp() -> id {
type NSApplicationActivationPolicy (line 121) | pub enum NSApplicationActivationPolicy {
type NSApplicationActivationOptions (line 130) | pub enum NSApplicationActivationOptions {
type NSApplicationTerminateReply (line 137) | pub enum NSApplicationTerminateReply {
type NSWindowTitleVisibility (line 163) | pub enum NSWindowTitleVisibility {
type NSBackingStoreType (line 170) | pub enum NSBackingStoreType {
type NSOpenGLPixelFormatAttribute (line 222) | pub enum NSOpenGLPixelFormatAttribute {
type NSOpenGLPFAOpenGLProfiles (line 267) | pub enum NSOpenGLPFAOpenGLProfiles {
type NSOpenGLContextParameter (line 275) | pub enum NSOpenGLContextParameter {
type NSWindowButton (line 290) | pub enum NSWindowButton {
type NSBezelStyle (line 302) | pub enum NSBezelStyle {
type NSRequestUserAttentionType (line 319) | pub enum NSRequestUserAttentionType {
type NSApplication (line 326) | pub trait NSApplication: Sized {
method sharedApplication (line 327) | unsafe fn sharedApplication(_: Self) -> id {
method mainMenu (line 331) | unsafe fn mainMenu(self) -> id;
method setActivationPolicy_ (line 332) | unsafe fn setActivationPolicy_(self, policy: NSApplicationActivationPo...
method setMainMenu_ (line 333) | unsafe fn setMainMenu_(self, menu: id);
method setServicesMenu_ (line 334) | unsafe fn setServicesMenu_(self, menu: id);
method setWindowsMenu_ (line 335) | unsafe fn setWindowsMenu_(self, menu: id);
method activateIgnoringOtherApps_ (line 336) | unsafe fn activateIgnoringOtherApps_(self, ignore: BOOL);
method run (line 337) | unsafe fn run(self);
method finishLaunching (line 338) | unsafe fn finishLaunching(self);
method nextEventMatchingMask_untilDate_inMode_dequeue_ (line 339) | unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue_(self,
method sendEvent_ (line 344) | unsafe fn sendEvent_(self, an_event: id);
method postEvent_atStart_ (line 345) | unsafe fn postEvent_atStart_(self, anEvent: id, flag: BOOL);
method stop_ (line 346) | unsafe fn stop_(self, sender: id);
method setApplicationIconImage_ (line 347) | unsafe fn setApplicationIconImage_(self, image: id);
method requestUserAttention_ (line 348) | unsafe fn requestUserAttention_(self, requestType: NSRequestUserAttent...
method mainMenu (line 352) | unsafe fn mainMenu(self) -> id {
method setActivationPolicy_ (line 356) | unsafe fn setActivationPolicy_(self, policy: NSApplicationActivationPo...
method setMainMenu_ (line 360) | unsafe fn setMainMenu_(self, menu: id) {
method setServicesMenu_ (line 364) | unsafe fn setServicesMenu_(self, menu: id) {
method setWindowsMenu_ (line 368) | unsafe fn setWindowsMenu_(self, menu: id) {
method activateIgnoringOtherApps_ (line 372) | unsafe fn activateIgnoringOtherApps_(self, ignore: BOOL) {
method run (line 376) | unsafe fn run(self) {
method finishLaunching (line 380) | unsafe fn finishLaunching(self) {
method nextEventMatchingMask_untilDate_inMode_dequeue_ (line 384) | unsafe fn nextEventMatchingMask_untilDate_inMode_dequeue_(self,
method sendEvent_ (line 395) | unsafe fn sendEvent_(self, an_event: id) {
method postEvent_atStart_ (line 399) | unsafe fn postEvent_atStart_(self, anEvent: id, flag: BOOL) {
method stop_ (line 403) | unsafe fn stop_(self, sender: id) {
method setApplicationIconImage_ (line 407) | unsafe fn setApplicationIconImage_(self, icon: id) {
method requestUserAttention_ (line 411) | unsafe fn requestUserAttention_(self, requestType: NSRequestUserAttent...
type NSRunningApplication (line 416) | pub trait NSRunningApplication: Sized {
method currentApplication (line 417) | unsafe fn currentApplication(_: Self) -> id {
method activateWithOptions_ (line 420) | unsafe fn activateWithOptions_(self, options: NSApplicationActivationO...
method activateWithOptions_ (line 424) | unsafe fn activateWithOptions_(self, options: NSApplicationActivationO...
type NSPasteboard (line 429) | pub trait NSPasteboard: Sized {
method generalPasteboard (line 430) | unsafe fn generalPasteboard(_: Self) -> id {
method pasteboardByFilteringData_ofType (line 434) | unsafe fn pasteboardByFilteringData_ofType(_: Self, data: id, _type: i...
method pasteboardByFilteringFile (line 438) | unsafe fn pasteboardByFilteringFile(_: Self, file: id) -> id {
method pasteboardByFilteringTypesInPasteboard (line 442) | unsafe fn pasteboardByFilteringTypesInPasteboard(_: Self, pboard: id) ...
method pasteboardWithName (line 446) | unsafe fn pasteboardWithName(_: Self, name: id) -> id {
method pasteboardWithUniqueName (line 450) | unsafe fn pasteboardWithUniqueName(_: Self) -> id {
method releaseGlobally (line 454) | unsafe fn releaseGlobally(self);
method clearContents (line 456) | unsafe fn clearContents(self) -> NSInteger;
method writeObjects (line 457) | unsafe fn writeObjects(self, objects: id) -> BOOL;
method sendData_forType (line 458) | unsafe fn sendData_forType(self, data: id, dataType: id) -> BOOL;
method setPropertyList_forType (line 459) | unsafe fn setPropertyList_forType(self, plist: id, dataType: id) -> BOOL;
method setString_forType (line 460) | unsafe fn setString_forType(self, string: id, dataType: id) -> BOOL;
method readObjectsForClasses_options (line 462) | unsafe fn readObjectsForClasses_options(self, classArray: id, options:...
method pasteboardItems (line 463) | unsafe fn pasteboardItems(self) -> id;
method indexOfPasteboardItem (line 464) | unsafe fn indexOfPasteboardItem(self, pasteboardItem: id) -> NSInteger;
method dataForType (line 465) | unsafe fn dataForType(self, dataType: id) -> id;
method propertyListForType (line 466) | unsafe fn propertyListForType(self, dataType: id) -> id;
method stringForType (line 467) | unsafe fn stringForType(self, dataType: id) -> id;
method availableTypeFromArray (line 469) | unsafe fn availableTypeFromArray(self, types: id) -> id;
method canReadItemWithDataConformingToTypes (line 470) | unsafe fn canReadItemWithDataConformingToTypes(self, types: id) -> BOOL;
method canReadObjectForClasses_options (line 471) | unsafe fn canReadObjectForClasses_options(self, classArray: id, option...
method types (line 472) | unsafe fn types(self) -> id;
method typesFilterableTo (line 473) | unsafe fn typesFilterableTo(_: Self, _type: id) -> id {
method name (line 477) | unsafe fn name(self) -> id;
method changeCount (line 478) | unsafe fn changeCount(self) -> NSInteger;
method declareTypes_owner (line 480) | unsafe fn declareTypes_owner(self, newTypes: id, newOwner: id) -> NSIn...
method addTypes_owner (line 481) | unsafe fn addTypes_owner(self, newTypes: id, newOwner: id) -> NSInteger;
method writeFileContents (line 482) | unsafe fn writeFileContents(self, filename: id) -> BOOL;
method writeFileWrapper (line 483) | unsafe fn writeFileWrapper(self, wrapper: id) -> BOOL;
method readFileContentsType_toFile (line 485) | unsafe fn readFileContentsType_toFile(self, _type: id, filename: id) -...
method readFileWrapper (line 486) | unsafe fn readFileWrapper(self) -> id;
method releaseGlobally (line 490) | unsafe fn releaseGlobally(self) {
method clearContents (line 494) | unsafe fn clearContents(self) -> NSInteger {
method writeObjects (line 498) | unsafe fn writeObjects(self, objects: id) -> BOOL {
method sendData_forType (line 502) | unsafe fn sendData_forType(self, data: id, dataType: id) -> BOOL {
method setPropertyList_forType (line 506) | unsafe fn setPropertyList_forType(self, plist: id, dataType: id) -> BO...
method setString_forType (line 510) | unsafe fn setString_forType(self, string: id, dataType: id) -> BOOL {
method readObjectsForClasses_options (line 514) | unsafe fn readObjectsForClasses_options(self, classArray: id, options:...
method pasteboardItems (line 518) | unsafe fn pasteboardItems(self) -> id {
method indexOfPasteboardItem (line 522) | unsafe fn indexOfPasteboardItem(self, pasteboardItem: id) -> NSInteger {
method dataForType (line 526) | unsafe fn dataForType(self, dataType: id) -> id {
method propertyListForType (line 530) | unsafe fn propertyListForType(self, dataType: id) -> id {
method stringForType (line 534) | unsafe fn stringForType(self, dataType: id) -> id {
method availableTypeFromArray (line 538) | unsafe fn availableTypeFromArray(self, types: id) -> id {
method canReadItemWithDataConformingToTypes (line 542) | unsafe fn canReadItemWithDataConformingToTypes(self, types: id) -> BOOL {
method canReadObjectForClasses_options (line 546) | unsafe fn canReadObjectForClasses_options(self, classArray: id, option...
method types (line 550) | unsafe fn types(self) -> id {
method name (line 554) | unsafe fn name(self) -> id {
method changeCount (line 558) | unsafe fn changeCount(self) -> NSInteger {
method declareTypes_owner (line 562) | unsafe fn declareTypes_owner(self, newTypes: id, newOwner: id) -> NSIn...
method addTypes_owner (line 566) | unsafe fn addTypes_owner(self, newTypes: id, newOwner: id) -> NSInteger {
method writeFileContents (line 570) | unsafe fn writeFileContents(self, filename: id) -> BOOL {
method writeFileWrapper (line 574) | unsafe fn writeFileWrapper(self, wrapper: id) -> BOOL {
method readFileContentsType_toFile (line 578) | unsafe fn readFileContentsType_toFile(self, _type: id, filename: id) -...
method readFileWrapper (line 582) | unsafe fn readFileWrapper(self) -> id {
type NSPasteboardItem (line 588) | pub trait NSPasteboardItem: Sized {
method types (line 589) | unsafe fn types(self) -> id;
method setDataProvider_forTypes (line 591) | unsafe fn setDataProvider_forTypes(self, dataProvider: id, types: id) ...
method setData_forType (line 592) | unsafe fn setData_forType(self, data: id, _type: id) -> BOOL;
method setString_forType (line 593) | unsafe fn setString_forType(self, string: id, _type: id) -> BOOL;
method setPropertyList_forType (line 594) | unsafe fn setPropertyList_forType(self, propertyList: id, _type: id) -...
method dataForType (line 596) | unsafe fn dataForType(self, _type: id) -> id;
method stringForType (line 597) | unsafe fn stringForType(self, _type: id) -> id;
method propertyListForType (line 598) | unsafe fn propertyListForType(self, _type: id) -> id;
method types (line 602) | unsafe fn types(self) -> id {
method setDataProvider_forTypes (line 606) | unsafe fn setDataProvider_forTypes(self, dataProvider: id, types: id) ...
method setData_forType (line 610) | unsafe fn setData_forType(self, data: id, _type: id) -> BOOL {
method setString_forType (line 614) | unsafe fn setString_forType(self, string: id, _type: id) -> BOOL {
method setPropertyList_forType (line 618) | unsafe fn setPropertyList_forType(self, propertyList: id, _type: id) -...
method dataForType (line 622) | unsafe fn dataForType(self, _type: id) -> id {
method stringForType (line 626) | unsafe fn stringForType(self, _type: id) -> id {
method propertyListForType (line 630) | unsafe fn propertyListForType(self, _type: id) -> id {
type NSPasteboardItemDataProvider (line 635) | pub trait NSPasteboardItemDataProvider: Sized {
method pasteboard_item_provideDataForType (line 636) | unsafe fn pasteboard_item_provideDataForType(self, pasteboard: id, ite...
method pasteboardFinishedWithDataProvider (line 637) | unsafe fn pasteboardFinishedWithDataProvider(self, pasteboard: id);
method pasteboard_item_provideDataForType (line 641) | unsafe fn pasteboard_item_provideDataForType(self, pasteboard: id, ite...
method pasteboardFinishedWithDataProvider (line 645) | unsafe fn pasteboardFinishedWithDataProvider(self, pasteboard: id) {
type NSPasteboardWriting (line 650) | pub trait NSPasteboardWriting: Sized {
method writableTypesForPasteboard (line 651) | unsafe fn writableTypesForPasteboard(self, pasteboard: id) -> id;
method writingOptionsForType_pasteboard (line 652) | unsafe fn writingOptionsForType_pasteboard(self, _type: id, pasteboard...
method pasteboardPropertyListForType (line 654) | unsafe fn pasteboardPropertyListForType(self, _type: id) -> id;
method writableTypesForPasteboard (line 658) | unsafe fn writableTypesForPasteboard(self, pasteboard: id) -> id {
method writingOptionsForType_pasteboard (line 662) | unsafe fn writingOptionsForType_pasteboard(self, _type: id, pasteboard...
method pasteboardPropertyListForType (line 666) | unsafe fn pasteboardPropertyListForType(self, _type: id) -> id {
type NSPasteboardReading (line 671) | pub trait NSPasteboardReading: Sized {
method initWithPasteboardPropertyList_ofType (line 672) | unsafe fn initWithPasteboardPropertyList_ofType(self, propertyList: id...
method readableTypesForPasteboard (line 674) | unsafe fn readableTypesForPasteboard(self, pasteboard: id) -> id;
method readingOptionsForType_pasteboard (line 675) | unsafe fn readingOptionsForType_pasteboard(self, _type: id, pasteboard...
method initWithPasteboardPropertyList_ofType (line 679) | unsafe fn initWithPasteboardPropertyList_ofType(self, propertyList: id...
method readableTypesForPasteboard (line 683) | unsafe fn readableTypesForPasteboard(self, pasteboard: id) -> id {
method readingOptionsForType_pasteboard (line 687) | unsafe fn readingOptionsForType_pasteboard(self, _type: id, pasteboard...
type NSPasteboardReadingOptions (line 695) | pub enum NSPasteboardReadingOptions {
type NSPasteboardWritingOptions (line 704) | pub enum NSPasteboardWritingOptions {
type NSMenu (line 708) | pub trait NSMenu: Sized {
method alloc (line 709) | unsafe fn alloc(_: Self) -> id {
method new (line 713) | unsafe fn new(_: Self) -> id {
method initWithTitle_ (line 717) | unsafe fn initWithTitle_(self, title: id /* NSString */) -> id;
method setAutoenablesItems (line 718) | unsafe fn setAutoenablesItems(self, state: BOOL);
method addItem_ (line 720) | unsafe fn addItem_(self, menu_item: id);
method addItemWithTitle_action_keyEquivalent (line 721) | unsafe fn addItemWithTitle_action_keyEquivalent(self, title: id, actio...
method itemAtIndex_ (line 722) | unsafe fn itemAtIndex_(self, index: NSInteger) -> id;
method initWithTitle_ (line 726) | unsafe fn initWithTitle_(self, title: id /* NSString */) -> id {
method setAutoenablesItems (line 730) | unsafe fn setAutoenablesItems(self, state: BOOL) {
method addItem_ (line 734) | unsafe fn addItem_(self, menu_item: id) {
method addItemWithTitle_action_keyEquivalent (line 738) | unsafe fn addItemWithTitle_action_keyEquivalent(self, title: id, actio...
method itemAtIndex_ (line 742) | unsafe fn itemAtIndex_(self, index: NSInteger) -> id {
type NSMenuItem (line 747) | pub trait NSMenuItem: Sized {
method alloc (line 748) | unsafe fn alloc(_: Self) -> id {
method new (line 752) | unsafe fn new(_: Self) -> id {
method separatorItem (line 756) | unsafe fn separatorItem(_: Self) -> id {
method initWithTitle_action_keyEquivalent_ (line 760) | unsafe fn initWithTitle_action_keyEquivalent_(self, title: id, action:...
method setKeyEquivalentModifierMask_ (line 761) | unsafe fn setKeyEquivalentModifierMask_(self, mask: NSEventModifierFla...
method setSubmenu_ (line 762) | unsafe fn setSubmenu_(self, submenu: id);
method initWithTitle_action_keyEquivalent_ (line 766) | unsafe fn initWithTitle_action_keyEquivalent_(self, title: id, action:...
method setKeyEquivalentModifierMask_ (line 770) | unsafe fn setKeyEquivalentModifierMask_(self, mask: NSEventModifierFla...
method setSubmenu_ (line 774) | unsafe fn setSubmenu_(self, submenu: id) {
type NSWindowDepth (line 779) | pub type NSWindowDepth = libc::c_int;
type NSWindow (line 805) | pub trait NSWindow: Sized {
method alloc (line 806) | unsafe fn alloc(_: Self) -> id {
method initWithContentRect_styleMask_backing_defer_ (line 811) | unsafe fn initWithContentRect_styleMask_backing_defer_(self,
method initWithContentRect_styleMask_backing_defer_screen_ (line 816) | unsafe fn initWithContentRect_styleMask_backing_defer_screen_(self,
method styleMask (line 824) | unsafe fn styleMask(self) -> NSWindowStyleMask;
method setStyleMask_ (line 825) | unsafe fn setStyleMask_(self, styleMask: NSWindowStyleMask);
method toggleFullScreen_ (line 826) | unsafe fn toggleFullScreen_(self, sender: id);
method worksWhenModal (line 827) | unsafe fn worksWhenModal(self) -> BOOL;
method alphaValue (line 828) | unsafe fn alphaValue(self) -> CGFloat;
method setAlphaValue_ (line 829) | unsafe fn setAlphaValue_(self, windowAlpha: CGFloat);
method backgroundColor (line 830) | unsafe fn backgroundColor(self) -> id;
method setBackgroundColor_ (line 831) | unsafe fn setBackgroundColor_(self, color: id);
method colorSpace (line 832) | unsafe fn colorSpace(self) -> id;
method setColorSpace_ (line 833) | unsafe fn setColorSpace_(self, colorSpace: id);
method contentView (line 834) | unsafe fn contentView(self) -> id;
method setContentView_ (line 835) | unsafe fn setContentView_(self, view: id);
method canHide (line 836) | unsafe fn canHide(self) -> BOOL;
method setCanHide_ (line 837) | unsafe fn setCanHide_(self, canHide: BOOL);
method hidesOnDeactivate (line 838) | unsafe fn hidesOnDeactivate(self) -> BOOL;
method setHidesOnDeactivate_ (line 839) | unsafe fn setHidesOnDeactivate_(self, hideOnDeactivate: BOOL);
method collectionBehavior (line 840) | unsafe fn collectionBehavior(self) -> NSWindowCollectionBehavior;
method setCollectionBehavior_ (line 841) | unsafe fn setCollectionBehavior_(self, collectionBehavior: NSWindowCol...
method setOpaque_ (line 842) | unsafe fn setOpaque_(self, opaque: BOOL);
method hasShadow (line 843) | unsafe fn hasShadow(self) -> BOOL;
method setHasShadow_ (line 844) | unsafe fn setHasShadow_(self, hasShadow: BOOL);
method invalidateShadow (line 845) | unsafe fn invalidateShadow(self);
method autorecalculatesContentBorderThicknessForEdge_ (line 846) | unsafe fn autorecalculatesContentBorderThicknessForEdge_(self, edge: N...
method setAutorecalculatesContentBorderThickness_forEdge_ (line 847) | unsafe fn setAutorecalculatesContentBorderThickness_forEdge_(self,
method contentBorderThicknessForEdge_ (line 850) | unsafe fn contentBorderThicknessForEdge_(self, edge: NSRectEdge) -> CG...
method setContentBorderThickness_forEdge_ (line 851) | unsafe fn setContentBorderThickness_forEdge_(self, borderThickness: CG...
method delegate (line 852) | unsafe fn delegate(self) -> id;
method setDelegate_ (line 853) | unsafe fn setDelegate_(self, delegate: id);
method preventsApplicationTerminationWhenModal (line 854) | unsafe fn preventsApplicationTerminationWhenModal(self) -> BOOL;
method setPreventsApplicationTerminationWhenModal_ (line 855) | unsafe fn setPreventsApplicationTerminationWhenModal_(self, flag: BOOL);
method contentRectForFrameRect_styleMask_ (line 860) | unsafe fn contentRectForFrameRect_styleMask_(self, windowFrame: NSRect...
method frameRectForContentRect_styleMask_ (line 861) | unsafe fn frameRectForContentRect_styleMask_(self, windowContentRect: ...
method minFrameWidthWithTitle_styleMask_ (line 862) | unsafe fn minFrameWidthWithTitle_styleMask_(self, windowTitle: id, win...
method contentRectForFrameRect_ (line 863) | unsafe fn contentRectForFrameRect_(self, windowFrame: NSRect) -> NSRect;
method frameRectForContentRect_ (line 864) | unsafe fn frameRectForContentRect_(self, windowContent: NSRect) -> NSR...
method drawers (line 867) | unsafe fn drawers(self) -> id;
method windowController (line 868) | unsafe fn windowController(self) -> id;
method setWindowController_ (line 869) | unsafe fn setWindowController_(self, windowController: id);
method frame (line 874) | unsafe fn frame(self) -> NSRect;
method setFrameOrigin_ (line 875) | unsafe fn setFrameOrigin_(self, point: NSPoint);
method setFrameTopLeftPoint_ (line 876) | unsafe fn setFrameTopLeftPoint_(self, point: NSPoint);
method constrainFrameRect_toScreen_ (line 877) | unsafe fn constrainFrameRect_toScreen_(self, frameRect: NSRect, screen...
method cascadeTopLeftFromPoint_ (line 878) | unsafe fn cascadeTopLeftFromPoint_(self, topLeft: NSPoint) -> NSPoint;
method setFrame_display_ (line 879) | unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL);
method setFrame_displayViews_ (line 880) | unsafe fn setFrame_displayViews_(self, windowFrame: NSRect, display: B...
method aspectRatio (line 881) | unsafe fn aspectRatio(self) -> NSSize;
method setAspectRatio_ (line 882) | unsafe fn setAspectRatio_(self, aspectRatio: NSSize);
method minSize (line 883) | unsafe fn minSize(self) -> NSSize;
method setMinSize_ (line 884) | unsafe fn setMinSize_(self, minSize: NSSize);
method maxSize (line 885) | unsafe fn maxSize(self) -> NSSize;
method setMaxSize_ (line 886) | unsafe fn setMaxSize_(self, maxSize: NSSize);
method performZoom_ (line 887) | unsafe fn performZoom_(self, sender: id);
method zoom_ (line 888) | unsafe fn zoom_(self, sender: id);
method resizeFlags (line 889) | unsafe fn resizeFlags(self) -> NSInteger;
method showsResizeIndicator (line 890) | unsafe fn showsResizeIndicator(self) -> BOOL;
method setShowsResizeIndicator_ (line 891) | unsafe fn setShowsResizeIndicator_(self, showsResizeIndicator: BOOL);
method resizeIncrements (line 892) | unsafe fn resizeIncrements(self) -> NSSize;
method setResizeIncrements_ (line 893) | unsafe fn setResizeIncrements_(self, resizeIncrements: NSSize);
method preservesContentDuringLiveResize (line 894) | unsafe fn preservesContentDuringLiveResize(self) -> BOOL;
method setPreservesContentDuringLiveResize_ (line 895) | unsafe fn setPreservesContentDuringLiveResize_(self, preservesContentD...
method inLiveResize (line 896) | unsafe fn inLiveResize(self) -> BOOL;
method contentAspectRatio (line 899) | unsafe fn contentAspectRatio(self) -> NSSize;
method setContentAspectRatio_ (line 900) | unsafe fn setContentAspectRatio_(self, contentAspectRatio: NSSize);
method contentMinSize (line 901) | unsafe fn contentMinSize(self) -> NSSize;
method setContentMinSize_ (line 902) | unsafe fn setContentMinSize_(self, contentMinSize: NSSize);
method contentSize (line 903) | unsafe fn contentSize(self) -> NSSize;
method setContentSize_ (line 904) | unsafe fn setContentSize_(self, contentSize: NSSize);
method contentMaxSize (line 905) | unsafe fn contentMaxSize(self) -> NSSize;
method setContentMaxSize_ (line 906) | unsafe fn setContentMaxSize_(self, contentMaxSize: NSSize);
method contentResizeIncrements (line 907) | unsafe fn contentResizeIncrements(self) -> NSSize;
method setContentResizeIncrements_ (line 908) | unsafe fn setContentResizeIncrements_(self, contentResizeIncrements: N...
method isVisible (line 911) | unsafe fn isVisible(self) -> BOOL;
method occlusionState (line 912) | unsafe fn occlusionState(self) -> NSWindowOcclusionState;
method orderOut_ (line 915) | unsafe fn orderOut_(self, sender: id);
method orderBack_ (line 916) | unsafe fn orderBack_(self, sender: id);
method orderFront_ (line 917) | unsafe fn orderFront_(self, sender: id);
method orderFrontRegardless (line 918) | unsafe fn orderFrontRegardless(self);
method orderFrontWindow_relativeTo_ (line 919) | unsafe fn orderFrontWindow_relativeTo_(self, orderingMode: NSWindowOrd...
method level (line 920) | unsafe fn level(self) -> NSInteger;
method setLevel_ (line 921) | unsafe fn setLevel_(self, level: NSInteger);
method canBecomeKeyWindow (line 924) | unsafe fn canBecomeKeyWindow(self) -> BOOL;
method makeKeyWindow (line 925) | unsafe fn makeKeyWindow(self);
method makeKeyAndOrderFront_ (line 926) | unsafe fn makeKeyAndOrderFront_(self, sender: id);
method canBecomeMainWindow (line 931) | unsafe fn canBecomeMainWindow(self) -> BOOL;
method makeMainWindow (line 932) | unsafe fn makeMainWindow(self);
method standardWindowButton_ (line 945) | unsafe fn standardWindowButton_(self, windowButtonKind: NSWindowButton...
method initialFirstResponder (line 951) | unsafe fn initialFirstResponder(self) -> id;
method firstResponder (line 952) | unsafe fn firstResponder(self) -> id;
method setInitialFirstResponder_ (line 953) | unsafe fn setInitialFirstResponder_(self, responder: id);
method makeFirstResponder_ (line 954) | unsafe fn makeFirstResponder_(self, responder: id) -> BOOL;
method keyDown_ (line 959) | unsafe fn keyDown_(self, event: id);
method acceptsMouseMovedEvents (line 962) | unsafe fn acceptsMouseMovedEvents(self) -> BOOL;
method ignoresMouseEvents (line 963) | unsafe fn ignoresMouseEvents(self) -> BOOL;
method setIgnoresMouseEvents_ (line 964) | unsafe fn setIgnoresMouseEvents_(self, ignoreMouseEvents: BOOL);
method mouseLocationOutsideOfEventStream (line 965) | unsafe fn mouseLocationOutsideOfEventStream(self) -> NSPoint;
method setAcceptsMouseMovedEvents_ (line 966) | unsafe fn setAcceptsMouseMovedEvents_(self, acceptMouseMovedEvents: BO...
method windowNumberAtPoint_belowWindowWithWindowNumber_ (line 967) | unsafe fn windowNumberAtPoint_belowWindowWithWindowNumber_(self,
method backingScaleFactor (line 979) | unsafe fn backingScaleFactor(self) -> CGFloat;
method backingAlignedRect_options_ (line 980) | unsafe fn backingAlignedRect_options_(self, rect: NSRect, options: NSA...
method convertRectFromBacking_ (line 981) | unsafe fn convertRectFromBacking_(self, rect: NSRect) -> NSRect;
method convertRectToBacking_ (line 982) | unsafe fn convertRectToBacking_(self, rect: NSRect) -> NSRect;
method convertRectToScreen_ (line 983) | unsafe fn convertRectToScreen_(self, rect: NSRect) -> NSRect;
method convertRectFromScreen_ (line 984) | unsafe fn convertRectFromScreen_(self, rect: NSRect) -> NSRect;
method setDocumentEdited_ (line 987) | unsafe fn setDocumentEdited_(self, documentEdited: BOOL);
method title (line 990) | unsafe fn title(self) -> id;
method setTitle_ (line 991) | unsafe fn setTitle_(self, title: id);
method setTitleWithRepresentedFilename_ (line 992) | unsafe fn setTitleWithRepresentedFilename_(self, filePath: id);
method setTitleVisibility_ (line 993) | unsafe fn setTitleVisibility_(self, visibility: NSWindowTitleVisibility);
method setTitlebarAppearsTransparent_ (line 994) | unsafe fn setTitlebarAppearsTransparent_(self, transparent: BOOL);
method representedFilename (line 995) | unsafe fn representedFilename(self) -> id;
method setRepresentedFilename_ (line 996) | unsafe fn setRepresentedFilename_(self, filePath: id);
method representedURL (line 997) | unsafe fn representedURL(self) -> id;
method setRepresentedURL_ (line 998) | unsafe fn setRepresentedURL_(self, representedURL: id);
method screen (line 1001) | unsafe fn screen(self) -> id;
method deepestScreen (line 1002) | unsafe fn deepestScreen(self) -> id;
method displaysWhenScreenProfileChanges (line 1003) | unsafe fn displaysWhenScreenProfileChanges(self) -> BOOL;
method setDisplaysWhenScreenProfileChanges_ (line 1004) | unsafe fn setDisplaysWhenScreenProfileChanges_(self, displaysWhenScree...
method setMovableByWindowBackground_ (line 1007) | unsafe fn setMovableByWindowBackground_(self, movableByWindowBackgroun...
method setMovable_ (line 1008) | unsafe fn setMovable_(self, movable: BOOL);
method center (line 1009) | unsafe fn center(self);
method performClose_ (line 1012) | unsafe fn performClose_(self, sender: id);
method close (line 1013) | unsafe fn close(self);
method setReleasedWhenClosed_ (line 1014) | unsafe fn setReleasedWhenClosed_(self, releasedWhenClosed: BOOL);
method performMiniaturize_ (line 1017) | unsafe fn performMiniaturize_(self, sender: id);
method miniaturize_ (line 1018) | unsafe fn miniaturize_(self, sender: id);
method deminiaturize_ (line 1019) | unsafe fn deminiaturize_(self, sender: id);
method miniwindowImage (line 1020) | unsafe fn miniwindowImage(self) -> id;
method setMiniwindowImage_ (line 1021) | unsafe fn setMiniwindowImage_(self, miniwindowImage: id);
method miniwindowTitle (line 1022) | unsafe fn miniwindowTitle(self) -> id;
method setMiniwindowTitle_ (line 1023) | unsafe fn setMiniwindowTitle_(self, miniwindowTitle: id);
method initWithContentRect_styleMask_backing_defer_ (line 1037) | unsafe fn initWithContentRect_styleMask_backing_defer_(self,
method initWithContentRect_styleMask_backing_defer_screen_ (line 1048) | unsafe fn initWithContentRect_styleMask_backing_defer_screen_(self,
method styleMask (line 1063) | unsafe fn styleMask(self) -> NSWindowStyleMask {
method setStyleMask_ (line 1068) | unsafe fn setStyleMask_(self, styleMask: NSWindowStyleMask) {
method toggleFullScreen_ (line 1072) | unsafe fn toggleFullScreen_(self, sender: id) {
method worksWhenModal (line 1076) | unsafe fn worksWhenModal(self) -> BOOL {
method alphaValue (line 1080) | unsafe fn alphaValue(self) -> CGFloat {
method setAlphaValue_ (line 1084) | unsafe fn setAlphaValue_(self, windowAlpha: CGFloat) {
method backgroundColor (line 1088) | unsafe fn backgroundColor(self) -> id {
method setBackgroundColor_ (line 1092) | unsafe fn setBackgroundColor_(self, color: id) {
method colorSpace (line 1096) | unsafe fn colorSpace(self) -> id {
method setColorSpace_ (line 1100) | unsafe fn setColorSpace_(self, colorSpace: id) {
method contentView (line 1104) | unsafe fn contentView(self) -> id {
method setContentView_ (line 1108) | unsafe fn setContentView_(self, view: id) {
method canHide (line 1112) | unsafe fn canHide(self) -> BOOL {
method setCanHide_ (line 1116) | unsafe fn setCanHide_(self, canHide: BOOL) {
method hidesOnDeactivate (line 1120) | unsafe fn hidesOnDeactivate(self) -> BOOL {
method setHidesOnDeactivate_ (line 1124) | unsafe fn setHidesOnDeactivate_(self, hideOnDeactivate: BOOL) {
method collectionBehavior (line 1128) | unsafe fn collectionBehavior(self) -> NSWindowCollectionBehavior {
method setCollectionBehavior_ (line 1132) | unsafe fn setCollectionBehavior_(self, collectionBehavior: NSWindowCol...
method setOpaque_ (line 1136) | unsafe fn setOpaque_(self, opaque: BOOL) {
method hasShadow (line 1140) | unsafe fn hasShadow(self) -> BOOL {
method setHasShadow_ (line 1144) | unsafe fn setHasShadow_(self, hasShadow: BOOL) {
method invalidateShadow (line 1148) | unsafe fn invalidateShadow(self) {
method autorecalculatesContentBorderThicknessForEdge_ (line 1152) | unsafe fn autorecalculatesContentBorderThicknessForEdge_(self, edge: N...
method setAutorecalculatesContentBorderThickness_forEdge_ (line 1156) | unsafe fn setAutorecalculatesContentBorderThickness_forEdge_(self,
method contentBorderThicknessForEdge_ (line 1163) | unsafe fn contentBorderThicknessForEdge_(self, edge: NSRectEdge) -> CG...
method setContentBorderThickness_forEdge_ (line 1167) | unsafe fn setContentBorderThickness_forEdge_(self, borderThickness: CG...
method delegate (line 1171) | unsafe fn delegate(self) -> id {
method setDelegate_ (line 1175) | unsafe fn setDelegate_(self, delegate: id) {
method preventsApplicationTerminationWhenModal (line 1179) | unsafe fn preventsApplicationTerminationWhenModal(self) -> BOOL {
method setPreventsApplicationTerminationWhenModal_ (line 1183) | unsafe fn setPreventsApplicationTerminationWhenModal_(self, flag: BOOL) {
method contentRectForFrameRect_styleMask_ (line 1191) | unsafe fn contentRectForFrameRect_styleMask_(self, windowFrame: NSRect...
method frameRectForContentRect_styleMask_ (line 1195) | unsafe fn frameRectForContentRect_styleMask_(self, windowContentRect: ...
method minFrameWidthWithTitle_styleMask_ (line 1199) | unsafe fn minFrameWidthWithTitle_styleMask_(self, windowTitle: id, win...
method contentRectForFrameRect_ (line 1203) | unsafe fn contentRectForFrameRect_(self, windowFrame: NSRect) -> NSRect {
method frameRectForContentRect_ (line 1207) | unsafe fn frameRectForContentRect_(self, windowContent: NSRect) -> NSR...
method drawers (line 1213) | unsafe fn drawers(self) -> id {
method windowController (line 1217) | unsafe fn windowController(self) -> id {
method setWindowController_ (line 1221) | unsafe fn setWindowController_(self, windowController: id) {
method frame (line 1229) | unsafe fn frame(self) -> NSRect {
method setFrameOrigin_ (line 1233) | unsafe fn setFrameOrigin_(self, point: NSPoint) {
method setFrameTopLeftPoint_ (line 1237) | unsafe fn setFrameTopLeftPoint_(self, point: NSPoint) {
method constrainFrameRect_toScreen_ (line 1241) | unsafe fn constrainFrameRect_toScreen_(self, frameRect: NSRect, screen...
method cascadeTopLeftFromPoint_ (line 1245) | unsafe fn cascadeTopLeftFromPoint_(self, topLeft: NSPoint) -> NSPoint {
method setFrame_display_ (line 1249) | unsafe fn setFrame_display_(self, windowFrame: NSRect, display: BOOL) {
method setFrame_displayViews_ (line 1253) | unsafe fn setFrame_displayViews_(self, windowFrame: NSRect, display: B...
method aspectRatio (line 1257) | unsafe fn aspectRatio(self) -> NSSize {
method setAspectRatio_ (line 1261) | unsafe fn setAspectRatio_(self, aspectRatio: NSSize) {
method minSize (line 1265) | unsafe fn minSize(self) -> NSSize {
method setMinSize_ (line 1269) | unsafe fn setMinSize_(self, minSize: NSSize) {
method maxSize (line 1273) | unsafe fn maxSize(self) -> NSSize {
method setMaxSize_ (line 1277) | unsafe fn setMaxSize_(self, maxSize: NSSize) {
method performZoom_ (line 1281) | unsafe fn performZoom_(self, sender: id) {
method zoom_ (line 1285) | unsafe fn zoom_(self, sender: id) {
method resizeFlags (line 1289) | unsafe fn resizeFlags(self) -> NSInteger {
method showsResizeIndicator (line 1293) | unsafe fn showsResizeIndicator(self) -> BOOL {
method setShowsResizeIndicator_ (line 1297) | unsafe fn setShowsResizeIndicator_(self, showsResizeIndicator: BOOL) {
method resizeIncrements (line 1301) | unsafe fn resizeIncrements(self) -> NSSize {
method setResizeIncrements_ (line 1305) | unsafe fn setResizeIncrements_(self, resizeIncrements: NSSize) {
method preservesContentDuringLiveResize (line 1309) | unsafe fn preservesContentDuringLiveResize(self) -> BOOL {
method setPreservesContentDuringLiveResize_ (line 1313) | unsafe fn setPreservesContentDuringLiveResize_(self, preservesContentD...
method inLiveResize (line 1317) | unsafe fn inLiveResize(self) -> BOOL {
method contentAspectRatio (line 1323) | unsafe fn contentAspectRatio(self) -> NSSize {
method setContentAspectRatio_ (line 1327) | unsafe fn setContentAspectRatio_(self, contentAspectRatio: NSSize) {
method contentMinSize (line 1331) | unsafe fn contentMinSize(self) -> NSSize {
method setContentMinSize_ (line 1335) | unsafe fn setContentMinSize_(self, contentMinSize: NSSize) {
method contentSize (line 1339) | unsafe fn contentSize(self) -> NSSize {
method setContentSize_ (line 1343) | unsafe fn setContentSize_(self, contentSize: NSSize) {
method contentMaxSize (line 1347) | unsafe fn contentMaxSize(self) -> NSSize {
method setContentMaxSize_ (line 1351) | unsafe fn setContentMaxSize_(self, contentMaxSize: NSSize) {
method contentResizeIncrements (line 1355) | unsafe fn contentResizeIncrements(self) -> NSSize {
method setContentResizeIncrements_ (line 1359) | unsafe fn setContentResizeIncrements_(self, contentResizeIncrements: N...
method isVisible (line 1365) | unsafe fn isVisible(self) -> BOOL {
method occlusionState (line 1369) | unsafe fn occlusionState(self) -> NSWindowOcclusionState {
method orderOut_ (line 1375) | unsafe fn orderOut_(self, sender: id) {
method orderBack_ (line 1379) | unsafe fn orderBack_(self, sender: id) {
method orderFront_ (line 1383) | unsafe fn orderFront_(self, sender: id) {
method orderFrontRegardless (line 1387) | unsafe fn orderFrontRegardless(self) {
method orderFrontWindow_relativeTo_ (line 1391) | unsafe fn orderFrontWindow_relativeTo_(self, ordering_mode: NSWindowOr...
method level (line 1395) | unsafe fn level(self) -> NSInteger {
method setLevel_ (line 1399) | unsafe fn setLevel_(self, level: NSInteger) {
method canBecomeKeyWindow (line 1405) | unsafe fn canBecomeKeyWindow(self) -> BOOL {
method makeKeyWindow (line 1409) | unsafe fn makeKeyWindow(self) {
method makeKeyAndOrderFront_ (line 1413) | unsafe fn makeKeyAndOrderFront_(self, sender: id) {
method canBecomeMainWindow (line 1419) | unsafe fn canBecomeMainWindow(self) -> BOOL {
method makeMainWindow (line 1423) | unsafe fn makeMainWindow(self) {
method standardWindowButton_ (line 1437) | unsafe fn standardWindowButton_(self, windowButtonKind: NSWindowButton...
method initialFirstResponder (line 1446) | unsafe fn initialFirstResponder(self) -> id {
method firstResponder (line 1450) | unsafe fn firstResponder(self) -> id {
method setInitialFirstResponder_ (line 1454) | unsafe fn setInitialFirstResponder_(self, responder: id) {
method makeFirstResponder_ (line 1458) | unsafe fn makeFirstResponder_(self, responder: id) -> BOOL {
method keyDown_ (line 1466) | unsafe fn keyDown_(self, event: id) {
method acceptsMouseMovedEvents (line 1472) | unsafe fn acceptsMouseMovedEvents(self) -> BOOL {
method ignoresMouseEvents (line 1476) | unsafe fn ignoresMouseEvents(self) -> BOOL {
method setIgnoresMouseEvents_ (line 1480) | unsafe fn setIgnoresMouseEvents_(self, ignoreMouseEvents: BOOL) {
method mouseLocationOutsideOfEventStream (line 1484) | unsafe fn mouseLocationOutsideOfEventStream(self) -> NSPoint {
method setAcceptsMouseMovedEvents_ (line 1488) | unsafe fn setAcceptsMouseMovedEvents_(self, acceptMouseMovedEvents: BO...
method windowNumberAtPoint_belowWindowWithWindowNumber_ (line 1492) | unsafe fn windowNumberAtPoint_belowWindowWithWindowNumber_(self,
method backingScaleFactor (line 1500) | unsafe fn backingScaleFactor(self) -> CGFloat {
method backingAlignedRect_options_ (line 1504) | unsafe fn backingAlignedRect_options_(self, rect: NSRect, options: NSA...
method convertRectFromBacking_ (line 1508) | unsafe fn convertRectFromBacking_(self, rect: NSRect) -> NSRect {
method convertRectToBacking_ (line 1512) | unsafe fn convertRectToBacking_(self, rect: NSRect) -> NSRect {
method convertRectToScreen_ (line 1516) | unsafe fn convertRectToScreen_(self, rect: NSRect) -> NSRect {
method convertRectFromScreen_ (line 1520) | unsafe fn convertRectFromScreen_(self, rect: NSRect) -> NSRect {
method setDocumentEdited_ (line 1526) | unsafe fn setDocumentEdited_(self, documentEdited: BOOL) {
method title (line 1532) | unsafe fn title(self) -> id {
method setTitle_ (line 1536) | unsafe fn setTitle_(self, title: id) {
method setTitleWithRepresentedFilename_ (line 1540) | unsafe fn setTitleWithRepresentedFilename_(self, filePath: id) {
method setTitleVisibility_ (line 1544) | unsafe fn setTitleVisibility_(self, visibility: NSWindowTitleVisibilit...
method setTitlebarAppearsTransparent_ (line 1548) | unsafe fn setTitlebarAppearsTransparent_(self, transparent: BOOL) {
method representedFilename (line 1552) | unsafe fn representedFilename(self) -> id {
method setRepresentedFilename_ (line 1556) | unsafe fn setRepresentedFilename_(self, filePath: id) {
method representedURL (line 1560) | unsafe fn representedURL(self) -> id {
method setRepresentedURL_ (line 1564) | unsafe fn setRepresentedURL_(self, representedURL: id) {
method screen (line 1570) | unsafe fn screen(self) -> id {
method deepestScreen (line 1574) | unsafe fn deepestScreen(self) -> id {
method displaysWhenScreenProfileChanges (line 1578) | unsafe fn displaysWhenScreenProfileChanges(self) -> BOOL {
method setDisplaysWhenScreenProfileChanges_ (line 1582) | unsafe fn setDisplaysWhenScreenProfileChanges_(self, displaysWhenScree...
method setMovableByWindowBackground_ (line 1588) | unsafe fn setMovableByWindowBackground_(self, movableByWindowBackgroun...
method setMovable_ (line 1592) | unsafe fn setMovable_(self, movable: BOOL) {
method center (line 1596) | unsafe fn center(self) {
method performClose_ (line 1602) | unsafe fn performClose_(self, sender: id) {
method close (line 1606) | unsafe fn close(self) {
method setReleasedWhenClosed_ (line 1610) | unsafe fn setReleasedWhenClosed_(self, releasedWhenClosed: BOOL) {
method performMiniaturize_ (line 1616) | unsafe fn performMiniaturize_(self, sender: id) {
method miniaturize_ (line 1620) | unsafe fn miniaturize_(self, sender: id) {
method deminiaturize_ (line 1624) | unsafe fn deminiaturize_(self, sender: id) {
method miniwindowImage (line 1628) | unsafe fn miniwindowImage(self) -> id {
method setMiniwindowImage_ (line 1632) | unsafe fn setMiniwindowImage_(self, miniwindowImage: id) {
method miniwindowTitle (line 1636) | unsafe fn miniwindowTitle(self) -> id {
method setMiniwindowTitle_ (line 1640) | unsafe fn setMiniwindowTitle_(self, miniwindowTitle: id) {
type NSView (line 1653) | pub trait NSView: Sized {
method alloc (line 1654) | unsafe fn alloc(_: Self) -> id {
method init (line 1658) | unsafe fn init(self) -> id;
method initWithFrame_ (line 1659) | unsafe fn initWithFrame_(self, frameRect: NSRect) -> id;
method bounds (line 1660) | unsafe fn bounds(self) -> NSRect;
method frame (line 1661) | unsafe fn frame(self) -> NSRect;
method display_ (line 1662) | unsafe fn display_(self);
method setWantsBestResolutionOpenGLSurface_ (line 1663) | unsafe fn setWantsBestResolutionOpenGLSurface_(self, flag: BOOL);
method convertPoint_fromView_ (line 1664) | unsafe fn convertPoint_fromView_(self, point: NSPoint, view: id) -> NS...
method addSubview_ (line 1665) | unsafe fn addSubview_(self, view: id);
method superview (line 1666) | unsafe fn superview(self) -> id;
method removeFromSuperview (line 1667) | unsafe fn removeFromSuperview(self);
method setAutoresizingMask_ (line 1668) | unsafe fn setAutoresizingMask_(self, autoresizingMask: NSAutoresizingM...
method wantsLayer (line 1670) | unsafe fn wantsLayer(self) -> BOOL;
method setWantsLayer (line 1671) | unsafe fn setWantsLayer(self, wantsLayer: BOOL);
method layer (line 1672) | unsafe fn layer(self) -> id;
method setLayer (line 1673) | unsafe fn setLayer(self, layer: id);
method widthAnchor (line 1675) | unsafe fn widthAnchor(self) -> id;
method heightAnchor (line 1676) | unsafe fn heightAnchor(self) -> id;
method init (line 1680) | unsafe fn init(self) -> id {
method initWithFrame_ (line 1684) | unsafe fn initWithFrame_(self, frameRect: NSRect) -> id {
method bounds (line 1688) | unsafe fn bounds(self) -> NSRect {
method frame (line 1692) | unsafe fn frame(self) -> NSRect {
method display_ (line 1696) | unsafe fn display_(self) {
method setWantsBestResolutionOpenGLSurface_ (line 1700) | unsafe fn setWantsBestResolutionOpenGLSurface_(self, flag: BOOL) {
method convertPoint_fromView_ (line 1704) | unsafe fn convertPoint_fromView_(self, point: NSPoint, view: id) -> NS...
method addSubview_ (line 1708) | unsafe fn addSubview_(self, view: id) {
method superview (line 1712) | unsafe fn superview(self) -> id {
method removeFromSuperview (line 1716) | unsafe fn removeFromSuperview(self) {
method setAutoresizingMask_ (line 1720) | unsafe fn setAutoresizingMask_(self, autoresizingMask: NSAutoresizingM...
method wantsLayer (line 1724) | unsafe fn wantsLayer(self) -> BOOL {
method setWantsLayer (line 1728) | unsafe fn setWantsLayer(self, wantsLayer: BOOL) {
method layer (line 1732) | unsafe fn layer(self) -> id {
method setLayer (line 1736) | unsafe fn setLayer(self, layer: id) {
method widthAnchor (line 1740) | unsafe fn widthAnchor(self) -> id {
method heightAnchor (line 1744) | unsafe fn heightAnchor(self) -> id {
type NSAutoresizingMaskOptions (line 1749) | pub type NSAutoresizingMaskOptions = u64;
constant NSViewNotSizable (line 1751) | pub const NSViewNotSizable: u64 = 0;
constant NSViewMinXMargin (line 1752) | pub const NSViewMinXMargin: u64 = 1;
constant NSViewWidthSizable (line 1753) | pub const NSViewWidthSizable: u64 = 2;
constant NSViewMaxXMargin (line 1754) | pub const NSViewMaxXMargin: u64 = 4;
constant NSViewMinYMargin (line 1755) | pub const NSViewMinYMargin: u64 = 8;
constant NSViewHeightSizable (line 1756) | pub const NSViewHeightSizable: u64 = 16;
constant NSViewMaxYMargin (line 1757) | pub const NSViewMaxYMargin: u64 = 32;
type NSOpenGLView (line 1759) | pub trait NSOpenGLView: Sized {
method alloc (line 1760) | unsafe fn alloc(_: Self) -> id {
method initWithFrame_pixelFormat_ (line 1764) | unsafe fn initWithFrame_pixelFormat_(self, frameRect: NSRect, format: ...
method display_ (line 1765) | unsafe fn display_(self);
method setOpenGLContext_ (line 1766) | unsafe fn setOpenGLContext_(self, context: id);
method setPixelFormat_ (line 1767) | unsafe fn setPixelFormat_(self, pixelformat: id);
method initWithFrame_pixelFormat_ (line 1771) | unsafe fn initWithFrame_pixelFormat_(self, frameRect: NSRect, format:...
method display_ (line 1775) | unsafe fn display_(self) {
method setOpenGLContext_ (line 1779) | unsafe fn setOpenGLContext_(self, context: id) {
method setPixelFormat_ (line 1783) | unsafe fn setPixelFormat_(self, pixelformat: id) {
type NSOpenGLPixelFormat (line 1788) | pub trait NSOpenGLPixelFormat: Sized {
method alloc (line 1789) | unsafe fn alloc(_: Self) -> id {
method initWithAttributes_ (line 1795) | unsafe fn initWithAttributes_(self, attributes: &[u32]) -> id;
method getValues_forAttribute_forVirtualScreen_ (line 1799) | unsafe fn getValues_forAttribute_forVirtualScreen_(self, val: *mut GLi...
method numberOfVirtualScreens (line 1800) | unsafe fn numberOfVirtualScreens(self) -> GLint;
method initWithAttributes_ (line 1807) | unsafe fn initWithAttributes_(self, attributes: &[u32]) -> id {
method getValues_forAttribute_forVirtualScreen_ (line 1813) | unsafe fn getValues_forAttribute_forVirtualScreen_(self, val: *mut GLi...
method numberOfVirtualScreens (line 1817) | unsafe fn numberOfVirtualScreens(self) -> GLint {
type NSOpenGLContext (line 1822) | pub trait NSOpenGLContext: Sized {
method alloc (line 1823) | unsafe fn alloc(_: Self) -> id {
method initWithFormat_shareContext_ (line 1828) | unsafe fn initWithFormat_shareContext_(self, format: id /* (NSOpenGLPi...
method initWithCGLContextObj_ (line 1829) | unsafe fn initWithCGLContextObj_(self, context: CGLContextObj) -> id /...
method clearCurrentContext (line 1832) | unsafe fn clearCurrentContext(_: Self);
method currentContext (line 1833) | unsafe fn currentContext(_: Self) -> id /* (NSOpenGLContext *) */;
method makeCurrentContext (line 1834) | unsafe fn makeCurrentContext(self);
method setView_ (line 1837) | unsafe fn setView_(self, view: id /* (NSView *) */);
method view (line 1838) | unsafe fn view(self) -> id /* (NSView *) */;
method clearDrawable (line 1839) | unsafe fn clearDrawable(self);
method update (line 1840) | unsafe fn update(self);
method flushBuffer (line 1843) | unsafe fn flushBuffer(self);
method setValues_forParameter_ (line 1846) | unsafe fn setValues_forParameter_(self, vals: *const GLint, param: NSO...
method getValues_forParameter_ (line 1847) | unsafe fn getValues_forParameter_(self, vals: *mut GLint, param: NSOpe...
method setCurrentVirtualScreen_ (line 1850) | unsafe fn setCurrentVirtualScreen_(self, screen: GLint);
method currentVirtualScreen (line 1851) | unsafe fn currentVirtualScreen(self) -> GLint;
method CGLContextObj (line 1854) | unsafe fn CGLContextObj(self) -> CGLContextObj;
method initWithFormat_shareContext_ (line 1860) | unsafe fn initWithFormat_shareContext_(self, format: id /* (NSOpenGLPi...
method initWithCGLContextObj_ (line 1864) | unsafe fn initWithCGLContextObj_(self, context: CGLContextObj) -> id /...
method clearCurrentContext (line 1870) | unsafe fn clearCurrentContext(_: Self) {
method currentContext (line 1874) | unsafe fn currentContext(_: Self) -> id /* (NSOpenGLContext *) */ {
method makeCurrentContext (line 1878) | unsafe fn makeCurrentContext(self) {
method setView_ (line 1884) | unsafe fn setView_(self, view: id /* (NSView *) */) {
method view (line 1888) | unsafe fn view(self) -> id /* (NSView *) */ {
method clearDrawable (line 1892) | unsafe fn clearDrawable(self) {
method update (line 1896) | unsafe fn update(self) {
method flushBuffer (line 1902) | unsafe fn flushBuffer(self) {
method setValues_forParameter_ (line 1908) | unsafe fn setValues_forParameter_(self, vals: *const GLint, param: NSO...
method getValues_forParameter_ (line 1912) | unsafe fn getValues_forParameter_(self, vals: *mut GLint, param: NSOpe...
method setCurrentVirtualScreen_ (line 1918) | unsafe fn setCurrentVirtualScreen_(self, screen: GLint) {
method currentVirtualScreen (line 1922) | unsafe fn currentVirtualScreen(self) -> GLint {
method CGLContextObj (line 1928) | unsafe fn CGLContextObj(self) -> CGLContextObj {
type NSEventGestureAxis (line 1941) | pub enum NSEventGestureAxis {
type NSEventType (line 1975) | pub enum NSEventType {
method from_type (line 2044) | pub fn from_type(ty: NSEventType) -> NSEventMask {
type NSPointingDeviceType (line 2064) | pub enum NSPointingDeviceType {
type NSEventButtonMask (line 2073) | pub enum NSEventButtonMask {
type NSEventSubtype (line 2081) | pub enum NSEventSubtype {
constant NSUpArrowFunctionKey (line 2095) | pub const NSUpArrowFunctionKey: libc::c_ushort = 0xF700;
constant NSDownArrowFunctionKey (line 2096) | pub const NSDownArrowFunctionKey: libc::c_ushort = 0xF701;
constant NSLeftArrowFunctionKey (line 2097) | pub const NSLeftArrowFunctionKey: libc::c_ushort = 0xF702;
constant NSRightArrowFunctionKey (line 2098) | pub const NSRightArrowFunctionKey: libc::c_ushort = 0xF703;
constant NSF1FunctionKey (line 2099) | pub const NSF1FunctionKey: libc::c_ushort = 0xF704;
constant NSF2FunctionKey (line 2100) | pub const NSF2FunctionKey: libc::c_ushort = 0xF705;
constant NSF3FunctionKey (line 2101) | pub const NSF3FunctionKey: libc::c_ushort = 0xF706;
constant NSF4FunctionKey (line 2102) | pub const NSF4FunctionKey: libc::c_ushort = 0xF707;
constant NSF5FunctionKey (line 2103) | pub const NSF5FunctionKey: libc::c_ushort = 0xF708;
constant NSF6FunctionKey (line 2104) | pub const NSF6FunctionKey: libc::c_ushort = 0xF709;
constant NSF7FunctionKey (line 2105) | pub const NSF7FunctionKey: libc::c_ushort = 0xF70A;
constant NSF8FunctionKey (line 2106) | pub const NSF8FunctionKey: libc::c_ushort = 0xF70B;
constant NSF9FunctionKey (line 2107) | pub const NSF9FunctionKey: libc::c_ushort = 0xF70C;
constant NSF10FunctionKey (line 2108) | pub const NSF10FunctionKey: libc::c_ushort = 0xF70D;
constant NSF11FunctionKey (line 2109) | pub const NSF11FunctionKey: libc::c_ushort = 0xF70E;
constant NSF12FunctionKey (line 2110) | pub const NSF12FunctionKey: libc::c_ushort = 0xF70F;
constant NSF13FunctionKey (line 2111) | pub const NSF13FunctionKey: libc::c_ushort = 0xF710;
constant NSF14FunctionKey (line 2112) | pub const NSF14FunctionKey: libc::c_ushort = 0xF711;
constant NSF15FunctionKey (line 2113) | pub const NSF15FunctionKey: libc::c_ushort = 0xF712;
constant NSF16FunctionKey (line 2114) | pub const NSF16FunctionKey: libc::c_ushort = 0xF713;
constant NSF17FunctionKey (line 2115) | pub const NSF17FunctionKey: libc::c_ushort = 0xF714;
constant NSF18FunctionKey (line 2116) | pub const NSF18FunctionKey: libc::c_ushort = 0xF715;
constant NSF19FunctionKey (line 2117) | pub const NSF19FunctionKey: libc::c_ushort = 0xF716;
constant NSF20FunctionKey (line 2118) | pub const NSF20FunctionKey: libc::c_ushort = 0xF717;
constant NSF21FunctionKey (line 2119) | pub const NSF21FunctionKey: libc::c_ushort = 0xF718;
constant NSF22FunctionKey (line 2120) | pub const NSF22FunctionKey: libc::c_ushort = 0xF719;
constant NSF23FunctionKey (line 2121) | pub const NSF23FunctionKey: libc::c_ushort = 0xF71A;
constant NSF24FunctionKey (line 2122) | pub const NSF24FunctionKey: libc::c_ushort = 0xF71B;
constant NSF25FunctionKey (line 2123) | pub const NSF25FunctionKey: libc::c_ushort = 0xF71C;
constant NSF26FunctionKey (line 2124) | pub const NSF26FunctionKey: libc::c_ushort = 0xF71D;
constant NSF27FunctionKey (line 2125) | pub const NSF27FunctionKey: libc::c_ushort = 0xF71E;
constant NSF28FunctionKey (line 2126) | pub const NSF28FunctionKey: libc::c_ushort = 0xF71F;
constant NSF29FunctionKey (line 2127) | pub const NSF29FunctionKey: libc::c_ushort = 0xF720;
constant NSF30FunctionKey (line 2128) | pub const NSF30FunctionKey: libc::c_ushort = 0xF721;
constant NSF31FunctionKey (line 2129) | pub const NSF31FunctionKey: libc::c_ushort = 0xF722;
constant NSF32FunctionKey (line 2130) | pub const NSF32FunctionKey: libc::c_ushort = 0xF723;
constant NSF33FunctionKey (line 2131) | pub const NSF33FunctionKey: libc::c_ushort = 0xF724;
constant NSF34FunctionKey (line 2132) | pub const NSF34FunctionKey: libc::c_ushort = 0xF725;
constant NSF35FunctionKey (line 2133) | pub const NSF35FunctionKey: libc::c_ushort = 0xF726;
constant NSInsertFunctionKey (line 2134) | pub const NSInsertFunctionKey: libc::c_ushort = 0xF727;
constant NSDeleteFunctionKey (line 2135) | pub const NSDeleteFunctionKey: libc::c_ushort = 0xF728;
constant NSHomeFunctionKey (line 2136) | pub const NSHomeFunctionKey: libc::c_ushort = 0xF729;
constant NSBeginFunctionKey (line 2137) | pub const NSBeginFunctionKey: libc::c_ushort = 0xF72A;
constant NSEndFunctionKey (line 2138) | pub const NSEndFunctionKey: libc::c_ushort = 0xF72B;
constant NSPageUpFunctionKey (line 2139) | pub const NSPageUpFunctionKey: libc::c_ushort = 0xF72C;
constant NSPageDownFunctionKey (line 2140) | pub const NSPageDownFunctionKey: libc::c_ushort = 0xF72D;
constant NSPrintScreenFunctionKey (line 2141) | pub const NSPrintScreenFunctionKey: libc::c_ushort = 0xF72E;
constant NSScrollLockFunctionKey (line 2142) | pub const NSScrollLockFunctionKey: libc::c_ushort = 0xF72F;
constant NSPauseFunctionKey (line 2143) | pub const NSPauseFunctionKey: libc::c_ushort = 0xF730;
constant NSSysReqFunctionKey (line 2144) | pub const NSSysReqFunctionKey: libc::c_ushort = 0xF731;
constant NSBreakFunctionKey (line 2145) | pub const NSBreakFunctionKey: libc::c_ushort = 0xF732;
constant NSResetFunctionKey (line 2146) | pub const NSResetFunctionKey: libc::c_ushort = 0xF733;
constant NSStopFunctionKey (line 2147) | pub const NSStopFunctionKey: libc::c_ushort = 0xF734;
constant NSMenuFunctionKey (line 2148) | pub const NSMenuFunctionKey: libc::c_ushort = 0xF735;
constant NSUserFunctionKey (line 2149) | pub const NSUserFunctionKey: libc::c_ushort = 0xF736;
constant NSSystemFunctionKey (line 2150) | pub const NSSystemFunctionKey: libc::c_ushort = 0xF737;
constant NSPrintFunctionKey (line 2151) | pub const NSPrintFunctionKey: libc::c_ushort = 0xF738;
constant NSClearLineFunctionKey (line 2152) | pub const NSClearLineFunctionKey: libc::c_ushort = 0xF739;
constant NSClearDisplayFunctionKey (line 2153) | pub const NSClearDisplayFunctionKey: libc::c_ushort = 0xF73A;
constant NSInsertLineFunctionKey (line 2154) | pub const NSInsertLineFunctionKey: libc::c_ushort = 0xF73B;
constant NSDeleteLineFunctionKey (line 2155) | pub const NSDeleteLineFunctionKey: libc::c_ushort = 0xF73C;
constant NSInsertCharFunctionKey (line 2156) | pub const NSInsertCharFunctionKey: libc::c_ushort = 0xF73D;
constant NSDeleteCharFunctionKey (line 2157) | pub const NSDeleteCharFunctionKey: libc::c_ushort = 0xF73E;
constant NSPrevFunctionKey (line 2158) | pub const NSPrevFunctionKey: libc::c_ushort = 0xF73F;
constant NSNextFunctionKey (line 2159) | pub const NSNextFunctionKey: libc::c_ushort = 0xF740;
constant NSSelectFunctionKey (line 2160) | pub const NSSelectFunctionKey: libc::c_ushort = 0xF741;
constant NSExecuteFunctionKey (line 2161) | pub const NSExecuteFunctionKey: libc::c_ushort = 0xF742;
constant NSUndoFunctionKey (line 2162) | pub const NSUndoFunctionKey: libc::c_ushort = 0xF743;
constant NSRedoFunctionKey (line 2163) | pub const NSRedoFunctionKey: libc::c_ushort = 0xF744;
constant NSFindFunctionKey (line 2164) | pub const NSFindFunctionKey: libc::c_ushort = 0xF745;
constant NSHelpFunctionKey (line 2165) | pub const NSHelpFunctionKey: libc::c_ushort = 0xF746;
constant NSModeSwitchFunctionKey (line 2166) | pub const NSModeSwitchFunctionKey: libc::c_ushort = 0xF747;
type NSEvent (line 2168) | pub trait NSEvent: Sized {
method keyEventWithType_location_modifierFlags_timestamp_windowNumber_context_characters_charactersIgnoringModifiers_isARepeat_keyCode_ (line 2170) | unsafe fn keyEventWithType_location_modifierFlags_timestamp_windowNumb...
method mouseEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_clickCount_pressure_ (line 2182) | unsafe fn mouseEventWithType_location_modifierFlags_timestamp_windowNu...
method enterExitEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_trackingNumber_userData_ (line 2193) | unsafe fn enterExitEventWithType_location_modifierFlags_timestamp_wind...
method otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2_ (line 2204) | unsafe fn otherEventWithType_location_modifierFlags_timestamp_windowNu...
method eventWithEventRef_ (line 2215) | unsafe fn eventWithEventRef_(_: Self, eventRef: *const libc::c_void) -...
method eventWithCGEvent_ (line 2216) | unsafe fn eventWithCGEvent_(_: Self, cgEvent: *mut libc::c_void /* CGE...
method context (line 2219) | unsafe fn context(self) -> id /* (NSGraphicsContext *) */;
method locationInWindow (line 2220) | unsafe fn locationInWindow(self) -> NSPoint;
method modifierFlags (line 2221) | unsafe fn modifierFlags(self) -> NSEventModifierFlags;
method timestamp (line 2222) | unsafe fn timestamp(self) -> NSTimeInterval;
method eventType (line 2224) | unsafe fn eventType(self) -> NSEventType;
method window (line 2225) | unsafe fn window(self) -> id /* (NSWindow *) */;
method windowNumber (line 2226) | unsafe fn windowNumber(self) -> NSInteger;
method eventRef (line 2227) | unsafe fn eventRef(self) -> *const libc::c_void;
method CGEvent (line 2228) | unsafe fn CGEvent(self) -> *mut libc::c_void /* CGEventRef */;
method currentModifierFlags (line 2232) | unsafe fn currentModifierFlags(_: Self) -> NSEventModifierFlags;
method keyRepeatDelay (line 2233) | unsafe fn keyRepeatDelay(_: Self) -> NSTimeInterval;
method keyRepeatInterval (line 2234) | unsafe fn keyRepeatInterval(_: Self) -> NSTimeInterval;
method characters (line 2235) | unsafe fn characters(self) -> id /* (NSString *) */;
method charactersIgnoringModifiers (line 2236) | unsafe fn charactersIgnoringModifiers(self) -> id /* (NSString *) */;
method keyCode (line 2237) | unsafe fn keyCode(self) -> libc::c_ushort;
method pressedMouseButtons (line 2240) | unsafe fn pressedMouseButtons(_: Self) -> NSUInteger;
method doubleClickInterval (line 2241) | unsafe fn doubleClickInterval(_: Self) -> NSTimeInterval;
method mouseLocation (line 2242) | unsafe fn mouseLocation(_: Self) -> NSPoint;
method buttonNumber (line 2243) | unsafe fn buttonNumber(self) -> NSInteger;
method clickCount (line 2244) | unsafe fn clickCount(self) -> NSInteger;
method pressure (line 2245) | unsafe fn pressure(self) -> libc::c_float;
method stage (line 2246) | unsafe fn stage(self) -> NSInteger;
method setMouseCoalescingEnabled_ (line 2247) | unsafe fn setMouseCoalescingEnabled_(_: Self, flag: BOOL);
method isMouseCoalescingEnabled (line 2248) | unsafe fn isMouseCoalescingEnabled(_: Self) -> BOOL;
method eventNumber (line 2251) | unsafe fn eventNumber(self) -> NSInteger;
method trackingNumber (line 2252) | unsafe fn trackingNumber(self) -> NSInteger;
method trackingArea (line 2253) | unsafe fn trackingArea(self) -> id /* (NSTrackingArea *) */;
method userData (line 2254) | unsafe fn userData(self) -> *const libc::c_void;
method data1 (line 2257) | unsafe fn data1(self) -> NSInteger;
method data2 (line 2258) | unsafe fn data2(self) -> NSInteger;
method subtype (line 2259) | unsafe fn subtype(self) -> NSEventSubtype;
method deltaX (line 2262) | unsafe fn deltaX(self) -> CGFloat;
method deltaY (line 2263) | unsafe fn deltaY(self) -> CGFloat;
method deltaZ (line 2264) | unsafe fn deltaZ(self) -> CGFloat;
method capabilityMask (line 2267) | unsafe fn capabilityMask(self) -> NSUInteger;
method deviceID (line 2268) | unsafe fn deviceID(self) -> NSUInteger;
method pointingDeviceID (line 2269) | unsafe fn pointingDeviceID(self) -> NSUInteger;
method pointingDeviceSerialNumber (line 2270) | unsafe fn pointingDeviceSerialNumber(self) -> NSUInteger;
method pointingDeviceType (line 2271) | unsafe fn pointingDeviceType(self) -> NSPointingDeviceType;
method systemTabletID (line 2272) | unsafe fn systemTabletID(self) -> NSUInteger;
method tabletID (line 2273) | unsafe fn tabletID(self) -> NSUInteger;
method uniqueID (line 2274) | unsafe fn uniqueID(self) -> libc::c_ulonglong;
method vendorID (line 2275) | unsafe fn vendorID(self) -> NSUInteger;
method vendorPointingDeviceType (line 2276) | unsafe fn vendorPointingDeviceType(self) -> NSUInteger;
method absoluteX (line 2279) | unsafe fn absoluteX(self) -> NSInteger;
method absoluteY (line 2280) | unsafe fn absoluteY(self) -> NSInteger;
method absoluteZ (line 2281) | unsafe fn absoluteZ(self) -> NSInteger;
method buttonMask (line 2282) | unsafe fn buttonMask(self) -> NSEventButtonMask;
method rotation (line 2283) | unsafe fn rotation(self) -> libc::c_float;
method tangentialPressure (line 2284) | unsafe fn tangentialPressure(self) -> libc::c_float;
method tilt (line 2285) | unsafe fn tilt(self) -> NSPoint;
method vendorDefined (line 2286) | unsafe fn vendorDefined(self) -> id;
method startPeriodicEventsAfterDelay_withPeriod_ (line 2289) | unsafe fn startPeriodicEventsAfterDelay_withPeriod_(_: Self, delaySeco...
method stopPeriodicEvents (line 2290) | unsafe fn stopPeriodicEvents(_: Self);
method magnification (line 2293) | unsafe fn magnification(self) -> CGFloat;
method touchesMatchingPhase_inView_ (line 2294) | unsafe fn touchesMatchingPhase_inView_(self, phase: NSTouchPhase, view...
method isSwipeTrackingFromScrollEventsEnabled (line 2295) | unsafe fn isSwipeTrackingFromScrollEventsEnabled(_: Self) -> BOOL;
method removeMonitor_ (line 2300) | unsafe fn removeMonitor_(_: Self, eventMonitor: id);
method hasPreciseScrollingDeltas (line 2303) | unsafe fn hasPreciseScrollingDeltas(self) -> BOOL;
method scrollingDeltaX (line 2304) | unsafe fn scrollingDeltaX(self) -> CGFloat;
method scrollingDeltaY (line 2305) | unsafe fn scrollingDeltaY(self) -> CGFloat;
method momentumPhase (line 2306) | unsafe fn momentumPhase(self) -> NSEventPhase;
method phase (line 2307) | unsafe fn phase(self) -> NSEventPhase;
method locationInNode_ (line 2311) | unsafe fn locationInNode_(self, node: id /* (SKNode *) */) -> CGPoint;
method keyEventWithType_location_modifierFlags_timestamp_windowNumber_context_characters_charactersIgnoringModifiers_isARepeat_keyCode_ (line 2317) | unsafe fn keyEventWithType_location_modifierFlags_timestamp_windowNumb...
method mouseEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_clickCount_pressure_ (line 2342) | unsafe fn mouseEventWithType_location_modifierFlags_timestamp_windowNu...
method enterExitEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_trackingNumber_userData_ (line 2365) | unsafe fn enterExitEventWithType_location_modifierFlags_timestamp_wind...
method otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2_ (line 2388) | unsafe fn otherEventWithType_location_modifierFlags_timestamp_windowNu...
method eventWithEventRef_ (line 2411) | unsafe fn eventWithEventRef_(_: Self, eventRef: *const libc::c_void) -...
method eventWithCGEvent_ (line 2415) | unsafe fn eventWithCGEvent_(_: Self, cgEvent: *mut libc::c_void /* CGE...
method context (line 2421) | unsafe fn context(self) -> id /* (NSGraphicsContext *) */ {
method locationInWindow (line 2425) | unsafe fn locationInWindow(self) -> NSPoint {
method modifierFlags (line 2429) | unsafe fn modifierFlags(self) -> NSEventModifierFlags {
method timestamp (line 2433) | unsafe fn timestamp(self) -> NSTimeInterval {
method eventType (line 2438) | unsafe fn eventType(self) -> NSEventType {
method window (line 2442) | unsafe fn window(self) -> id /* (NSWindow *) */ {
method windowNumber (line 2446) | unsafe fn windowNumber(self) -> NSInteger {
method eventRef (line 2450) | unsafe fn eventRef(self) -> *const libc::c_void {
method CGEvent (line 2454) | unsafe fn CGEvent(self) -> *mut libc::c_void /* CGEventRef */ {
method currentModifierFlags (line 2462) | unsafe fn currentModifierFlags(_: Self) -> NSEventModifierFlags {
method keyRepeatDelay (line 2466) | unsafe fn keyRepeatDelay(_: Self) -> NSTimeInterval {
method keyRepeatInterval (line 2470) | unsafe fn keyRepeatInterval(_: Self) -> NSTimeInterval {
method characters (line 2474) | unsafe fn characters(self) -> id /* (NSString *) */ {
method charactersIgnoringModifiers (line 2478) | unsafe fn charactersIgnoringModifiers(self) -> id /* (NSString *) */ {
method keyCode (line 2482) | unsafe fn keyCode(self) -> libc::c_ushort {
method pressedMouseButtons (line 2488) | unsafe fn pressedMouseButtons(_: Self) -> NSUInteger {
method doubleClickInterval (line 2492) | unsafe fn doubleClickInterval(_: Self) -> NSTimeInterval {
method mouseLocation (line 2496) | unsafe fn mouseLocation(_: Self) -> NSPoint {
method buttonNumber (line 2500) | unsafe fn buttonNumber(self) -> NSInteger {
method clickCount (line 2504) | unsafe fn clickCount(self) -> NSInteger {
method pressure (line 2508) | unsafe fn pressure(self) -> libc::c_float {
method stage (line 2512) | unsafe fn stage(self) -> NSInteger{
method setMouseCoalescingEnabled_ (line 2516) | unsafe fn setMouseCoalescingEnabled_(_: Self, flag: BOOL) {
method isMouseCoalescingEnabled (line 2520) | unsafe fn isMouseCoalescingEnabled(_: Self) -> BOOL {
method eventNumber (line 2526) | unsafe fn eventNumber(self) -> NSInteger {
method trackingNumber (line 2530) | unsafe fn trackingNumber(self) -> NSInteger {
method trackingArea (line 2534) | unsafe fn trackingArea(self) -> id /* (NSTrackingArea *) */ {
method userData (line 2538) | unsafe fn userData(self) -> *const libc::c_void {
method data1 (line 2544) | unsafe fn data1(self) -> NSInteger {
method data2 (line 2548) | unsafe fn data2(self) -> NSInteger {
method subtype (line 2552) | unsafe fn subtype(self) -> NSEventSubtype {
method deltaX (line 2558) | unsafe fn deltaX(self) -> CGFloat {
method deltaY (line 2562) | unsafe fn deltaY(self) -> CGFloat {
method deltaZ (line 2566) | unsafe fn deltaZ(self) -> CGFloat {
method capabilityMask (line 2572) | unsafe fn capabilityMask(self) -> NSUInteger {
method deviceID (line 2576) | unsafe fn deviceID(self) -> NSUInteger {
method pointingDeviceID (line 2580) | unsafe fn pointingDeviceID(self) -> NSUInteger {
method pointingDeviceSerialNumber (line 2584) | unsafe fn pointingDeviceSerialNumber(self) -> NSUInteger {
method pointingDeviceType (line 2588) | unsafe fn pointingDeviceType(self) -> NSPointingDeviceType {
method systemTabletID (line 2592) | unsafe fn systemTabletID(self) -> NSUInteger {
method tabletID (line 2596) | unsafe fn tabletID(self) -> NSUInteger {
method uniqueID (line 2600) | unsafe fn uniqueID(self) -> libc::c_ulonglong {
method vendorID (line 2604) | unsafe fn vendorID(self) -> NSUInteger {
method vendorPointingDeviceType (line 2608) | unsafe fn vendorPointingDeviceType(self) -> NSUInteger {
method absoluteX (line 2614) | unsafe fn absoluteX(self) -> NSInteger {
method absoluteY (line 2618) | unsafe fn absoluteY(self) -> NSInteger {
method absoluteZ (line 2622) | unsafe fn absoluteZ(self) -> NSInteger {
method buttonMask (line 2626) | unsafe fn buttonMask(self) -> NSEventButtonMask {
method rotation (line 2630) | unsafe fn rotation(self) -> libc::c_float {
method tangentialPressure (line 2634) | unsafe fn tangentialPressure(self) -> libc::c_float {
method tilt (line 2638) | unsafe fn tilt(self) -> NSPoint {
method vendorDefined (line 2642) | unsafe fn vendorDefined(self) -> id {
method startPeriodicEventsAfterDelay_withPeriod_ (line 2648) | unsafe fn startPeriodicEventsAfterDelay_withPeriod_(_: Self, delaySeco...
method stopPeriodicEvents (line 2652) | unsafe fn stopPeriodicEvents(_: Self) {
method magnification (line 2658) | unsafe fn magnification(self) -> CGFloat {
method touchesMatchingPhase_inView_ (line 2662) | unsafe fn touchesMatchingPhase_inView_(self, phase: NSTouchPhase, view...
method isSwipeTrackingFromScrollEventsEnabled (line 2666) | unsafe fn isSwipeTrackingFromScrollEventsEnabled(_: Self) -> BOOL {
method removeMonitor_ (line 2675) | unsafe fn removeMonitor_(_: Self, eventMonitor: id) {
method hasPreciseScrollingDeltas (line 2681) | unsafe fn hasPreciseScrollingDeltas(self) -> BOOL {
method scrollingDeltaX (line 2685) | unsafe fn scrollingDeltaX(self) -> CGFloat {
method scrollingDeltaY (line 2689) | unsafe fn scrollingDeltaY(self) -> CGFloat {
method momentumPhase (line 2693) | unsafe fn momentumPhase(self) -> NSEventPhase {
method phase (line 2697) | unsafe fn phase(self) -> NSEventPhase {
method locationInNode_ (line 2704) | unsafe fn locationInNode_(self, node: id /* (SKNode *) */) -> CGPoint {
type NSScreen (line 2709) | pub trait NSScreen: Sized {
method mainScreen (line 2711) | unsafe fn mainScreen(_: Self) -> id /* (NSScreen *) */;
method deepestScreen (line 2712) | unsafe fn deepestScreen(_: Self) -> id /* (NSScreen *) */;
method screens (line 2713) | unsafe fn screens(_: Self) -> id /* (NSArray *) */;
method depth (line 2716) | unsafe fn depth(self) -> NSWindowDepth;
method frame (line 2717) | unsafe fn frame(self) -> NSRect;
method supportedWindowDepths (line 2718) | unsafe fn supportedWindowDepths(self) -> *const NSWindowDepth;
method deviceDescription (line 2719) | unsafe fn deviceDescription(self) -> id /* (NSDictionary *) */;
method visibleFrame (line 2720) | unsafe fn visibleFrame(self) -> NSRect;
method colorSpace (line 2721) | unsafe fn colorSpace(self) -> id /* (NSColorSpace *) */;
method screensHaveSeparateSpaces (line 2722) | unsafe fn screensHaveSeparateSpaces(_: Self) -> BOOL;
method backingAlignedRect_options_ (line 2725) | unsafe fn backingAlignedRect_options_(self, aRect: NSRect, options: NS...
method backingScaleFactor (line 2726) | unsafe fn backingScaleFactor(self) -> CGFloat;
method convertRectFromBacking_ (line 2727) | unsafe fn convertRectFromBacking_(self, aRect: NSRect) -> NSRect;
method convertRectToBacking_ (line 2728) | unsafe fn convertRectToBacking_(self, aRect: NSRect) -> NSRect;
method mainScreen (line 2734) | unsafe fn mainScreen(_: Self) -> id /* (NSScreen *) */ {
method deepestScreen (line 2738) | unsafe fn deepestScreen(_: Self) -> id /* (NSScreen *) */ {
method screens (line 2742) | unsafe fn screens(_: Self) -> id /* (NSArray *) */ {
method depth (line 2748) | unsafe fn depth(self) -> NSWindowDepth {
method frame (line 2752) | unsafe fn frame(self) -> NSRect {
method supportedWindowDepths (line 2756) | unsafe fn supportedWindowDepths(self) -> *const NSWindowDepth {
method deviceDescription (line 2760) | unsafe fn deviceDescription(self) -> id /* (NSDictionary *) */ {
method visibleFrame (line 2764) | unsafe fn visibleFrame(self) -> NSRect {
method colorSpace (line 2768) | unsafe fn colorSpace(self) -> id /* (NSColorSpace *) */ {
method screensHaveSeparateSpaces (line 2772) | unsafe fn screensHaveSeparateSpaces(_: Self) -> BOOL {
method backingAlignedRect_options_ (line 2778) | unsafe fn backingAlignedRect_options_(self, aRect: NSRect, options: NS...
method backingScaleFactor (line 2782) | unsafe fn backingScaleFactor(self) -> CGFloat {
method convertRectFromBacking_ (line 2786) | unsafe fn convertRectFromBacking_(self, aRect: NSRect) -> NSRect {
method convertRectToBacking_ (line 2790) | unsafe fn convertRectToBacking_(self, aRect: NSRect) -> NSRect {
type NSButton (line 2795) | pub trait NSButton: Sized {
method setImage_ (line 2796) | unsafe fn setImage_(self, img: id /* (NSImage *) */);
method setBezelStyle_ (line 2797) | unsafe fn setBezelStyle_(self, style: NSBezelStyle);
method setTitle_ (line 2798) | unsafe fn setTitle_(self, title: id /* (NSString*) */);
method alloc (line 2799) | unsafe fn alloc(_: Self) -> id {
method initWithFrame_ (line 2802) | unsafe fn initWithFrame_(self, frameRect: NSRect) -> id;
method initWithFrame_ (line 2806) | unsafe fn initWithFrame_(self, frameRect: NSRect) -> id {
method setBezelStyle_ (line 2809) | unsafe fn setBezelStyle_(self, style: NSBezelStyle) {
method setTitle_ (line 2812) | unsafe fn setTitle_(self, title: id /* (NSString*) */) {
method setImage_ (line 2815) | unsafe fn setImage_(self, img: id /* (NSImage *) */) {
type NSImage (line 2820) | pub trait NSImage: Sized {
method alloc (line 2821) | unsafe fn alloc(_: Self) -> id {
method initByReferencingFile_ (line 2825) | unsafe fn initByReferencingFile_(self, file_name: id /* (NSString *) *...
method initWithContentsOfFile_ (line 2826) | unsafe fn initWithContentsOfFile_(self, file_name: id /* (NSString *) ...
method initWithData_ (line 2827) | unsafe fn initWithData_(self, data: id /* (NSData *) */) -> id;
method initWithDataIgnoringOrientation_ (line 2828) | unsafe fn initWithDataIgnoringOrientation_(self, data: id /* (NSData *...
method initWithPasteboard_ (line 2829) | unsafe fn initWithPasteboard_(self, pasteboard: id /* (NSPasteboard *)...
method initWithSize_flipped_drawingHandler_ (line 2830) | unsafe fn initWithSize_flipped_drawingHandler_(self, size: NSSize,
method initWithSize_ (line 2833) | unsafe fn initWithSize_(self, aSize: NSSize) -> id;
method imageNamed_ (line 2835) | unsafe fn imageNamed_(_: Self, name: id /* (NSString *) */) -> id {
method name (line 2839) | unsafe fn name(self) -> id /* (NSString *) */;
method setName_ (line 2840) | unsafe fn setName_(self, name: id /* (NSString *) */) -> BOOL;
method size (line 2842) | unsafe fn size(self) -> NSSize;
method template (line 2843) | unsafe fn template(self) -> BOOL;
method canInitWithPasteboard_ (line 2845) | unsafe fn canInitWithPasteboard_(self, pasteboard: id /* (NSPasteboard...
method imageTypes (line 2846) | unsafe fn imageTypes(self) -> id /* (NSArray<NSString *> ) */;
method imageUnfilteredTypes (line 2847) | unsafe fn imageUnfilteredTypes(self) -> id /* (NSArray<NSString *> ) */;
method addRepresentation_ (line 2849) | unsafe fn addRepresentation_(self, imageRep: id /* (NSImageRep *) */);
method addRepresentations_ (line 2850) | unsafe fn addRepresentations_(self, imageReps: id /* (NSArray<NSImageR...
method representations (line 2851) | unsafe fn representations(self) -> id /* (NSArray<NSImageRep *> *) */;
method removeRepresentation_ (line 2852) | unsafe fn removeRepresentation_(self, imageRep: id /* (NSImageRep *) */);
method bestRepresentationForRect_context_hints_ (line 2853) | unsafe fn bestRepresentationForRect_context_hints_(self, rect: NSRect,
method prefersColorMatch (line 2857) | unsafe fn prefersColorMatch(self) -> BOOL;
method usesEPSOnResolutionMismatch (line 2858) | unsafe fn usesEPSOnResolutionMismatch(self) -> BOOL;
method matchesOnMultipleResolution (line 2859) | unsafe fn matchesOnMultipleResolution(self) -> BOOL;
method drawInRect_ (line 2861) | unsafe fn drawInRect_(self, rect: NSRect);
method drawAtPoint_fromRect_operation_fraction_ (line 2862) | unsafe fn drawAtPoint_fromRect_operation_fraction_(self, point: NSPoin...
method drawInRect_fromRect_operation_fraction_ (line 2864) | unsafe fn drawInRect_fromRect_operation_fraction_(self, dstRect: NSRec...
method drawInRect_fromRect_operation_fraction_respectFlipped_hints_ (line 2866) | unsafe fn drawInRect_fromRect_operation_fraction_respectFlipped_hints_...
method drawRepresentation_inRect_ (line 2869) | unsafe fn drawRepresentation_inRect_(self, imageRep: id /* (NSImageRep...
method isValid (line 2871) | unsafe fn isValid(self) -> BOOL;
method backgroundColor (line 2872) | unsafe fn backgroundColor(self) -> id /* (NSColor *) */;
method lockFocus (line 2874) | unsafe fn lockFocus(self);
method lockFocusFlipped_ (line 2875) | unsafe fn lockFocusFlipped_(self, flipped: BOOL);
method unlockFocus (line 2876) | unsafe fn unlockFocus(self);
method alignmentRect (line 2878) | unsafe fn alignmentRect(self) -> NSRect;
method cacheMode (line 2880) | unsafe fn cacheMode(self) -> NSImageCacheMode;
method recache (line 2881) | unsafe fn recache(self);
method delegate (line 2883) | unsafe fn delegate(self) -> id /* (id<NSImageDelegate *> *) */;
method TIFFRepresentation (line 2885) | unsafe fn TIFFRepresentation(self) -> id /* (NSData *) */;
method TIFFRepresentationUsingCompression_factor_ (line 2886) | unsafe fn TIFFRepresentationUsingCompression_factor_(self, comp: NSTIF...
method cancelIncrementalLoad (line 2889) | unsafe fn cancelIncrementalLoad(self);
method hitTestRect_withImageDestinationRect_context_hints_flipped_ (line 2891) | unsafe fn hitTestRect_withImageDestinationRect_context_hints_flipped_(...
method accessibilityDescription (line 2895) | unsafe fn accessibilityDescription(self) -> id /* (NSString *) */;
method layerContentsForContentsScale_ (line 2897) | unsafe fn layerContentsForContentsScale_(self, layerContentsScale: CGF...
method recommendedLayerContentsScale_ (line 2898) | unsafe fn recommendedLayerContentsScale_(self, preferredContentsScale:...
method matchesOnlyOnBestFittingAxis (line 2900) | unsafe fn matchesOnlyOnBestFittingAxis(self) -> BOOL;
method initByReferencingFile_ (line 2904) | unsafe fn initByReferencingFile_(self, file_name: id /* (NSString *) *...
method initWithContentsOfFile_ (line 2908) | unsafe fn initWithContentsOfFile_(self, file_name: id /* (NSString *) ...
method initWithData_ (line 2912) | unsafe fn initWithData_(self, data: id /* (NSData *) */) -> id {
method initWithDataIgnoringOrientation_ (line 2916) | unsafe fn initWithDataIgnoringOrientation_(self, data: id /* (NSData *...
method initWithPasteboard_ (line 2920) | unsafe fn initWithPasteboard_(self, pasteboard: id /* (NSPasteboard *)...
method initWithSize_flipped_drawingHandler_ (line 2924) | unsafe fn initWithSize_flipped_drawingHandler_(self, size: NSSize,
method initWithSize_ (line 2932) | unsafe fn initWithSize_(self, aSize: NSSize) -> id {
method name (line 2936) | unsafe fn name(self) -> id /* (NSString *) */ {
method setName_ (line 2940) | unsafe fn setName_(self, name: id /* (NSString *) */) -> BOOL {
method size (line 2944) | unsafe fn size(self) -> NSSize {
method template (line 2948) | unsafe fn template(self) -> BOOL {
method canInitWithPasteboard_ (line 2952) | unsafe fn canInitWithPasteboard_(self, pasteboard: id /* (NSPasteboard...
method imageTypes (line 2956) | unsafe fn imageTypes(self) -> id /* (NSArray<NSString *> ) */ {
method imageUnfilteredTypes (line 2960) | unsafe fn imageUnfilteredTypes(self) -> id /* (NSArray<NSString *> ) */ {
method addRepresentation_ (line 2964) | unsafe fn addRepresentation_(self, imageRep: id /* (NSImageRep *) */) {
method addRepresentations_ (line 2968) | unsafe fn addRepresentations_(self, imageReps: id /* (NSArray<NSImageR...
method representations (line 2972) | unsafe fn representations(self) -> id /* (NSArray<NSImageRep *> *) */ {
method removeRepresentation_ (line 2976) | unsafe fn removeRepresentation_(self, imageRep: id /* (NSImageRep *) *...
method bestRepresentationForRect_context_hints_ (line 2980) | unsafe fn bestRepresentationForRect_context_hints_(self, rect: NSRect,
method prefersColorMatch (line 2987) | unsafe fn prefersColorMatch(self) -> BOOL {
method usesEPSOnResolutionMismatch (line 2991) | unsafe fn usesEPSOnResolutionMismatch(self) -> BOOL {
method matchesOnMultipleResolution (line 2995) | unsafe fn matchesOnMultipleResolution(self) -> BOOL {
method drawInRect_ (line 2999) | unsafe fn drawInRect_(self, rect: NSRect) {
method drawAtPoint_fromRect_operation_fraction_ (line 3003) | unsafe fn drawAtPoint_fromRect_operation_fraction_(self, point: NSPoin...
method drawInRect_fromRect_operation_fraction_ (line 3008) | unsafe fn drawInRect_fromRect_operation_fraction_(self, dstRect: NSRec...
method drawInRect_fromRect_operation_fraction_respectFlipped_hints_ (line 3013) | unsafe fn drawInRect_fromRect_operation_fraction_respectFlipped_hints_...
method drawRepresentation_inRect_ (line 3024) | unsafe fn drawRepresentation_inRect_(self, imageRep: id /* (NSImageRep...
method isValid (line 3028) | unsafe fn isValid(self) -> BOOL {
method backgroundColor (line 3032) | unsafe fn backgroundColor(self) -> id /* (NSColor *) */ {
method lockFocus (line 3036) | unsafe fn lockFocus(self) {
method lockFocusFlipped_ (line 3040) | unsafe fn lockFocusFlipped_(self, flipped: BOOL) {
method unlockFocus (line 3044) | unsafe fn unlockFocus(self) {
method alignmentRect (line 3048) | unsafe fn alignmentRect(self) -> NSRect {
method cacheMode (line 3052) | unsafe fn cacheMode(self) -> NSImageCacheMode {
method recache (line 3056) | unsafe fn recache(self) {
method delegate (line 3060) | unsafe fn delegate(self) -> id /* (id<NSImageDelegate *> *) */ {
method TIFFRepresentation (line 3064) | unsafe fn TIFFRepresentation(self) -> id /* (NSData *) */ {
method TIFFRepresentationUsingCompression_factor_ (line 3068) | unsafe fn TIFFRepresentationUsingCompression_factor_(self, comp: NSTIF...
method cancelIncrementalLoad (line 3073) | unsafe fn cancelIncrementalLoad(self) {
method hitTestRect_withImageDestinationRect_context_hints_flipped_ (line 3077) | unsafe fn hitTestRect_withImageDestinationRect_context_hints_flipped_(...
method accessibilityDescription (line 3087) | unsafe fn accessibilityDescription(self) -> id /* (NSString *) */ {
method layerContentsForContentsScale_ (line 3091) | unsafe fn layerContentsForContentsScale_(self, layerContentsScale: CGF...
method recommendedLayerContentsScale_ (line 3095) | unsafe fn recommendedLayerContentsScale_(self, preferredContentsScale:...
method matchesOnlyOnBestFittingAxis (line 3099) | unsafe fn matchesOnlyOnBestFittingAxis(self) -> BOOL {
type NSCompositingOperation (line 3180) | pub enum NSCompositingOperation {
type NSImageCacheMode (line 3199) | pub enum NSImageCacheMode {
type NSTIFFCompression (line 3208) | pub enum NSTIFFCompression {
type NSImageLoadStatus (line 3221) | pub enum NSImageLoadStatus {
type NSSound (line 3229) | pub trait NSSound: Sized {
method canInitWithPasteboard_ (line 3230) | unsafe fn canInitWithPasteboard_(_: Self, pasteboard: id) -> BOOL {
method initWithContentsOfFile_withReference_ (line 3234) | unsafe fn initWithContentsOfFile_withReference_(self, filepath: id, by...
method initWithContentsOfURL_withReference_ (line 3235) | unsafe fn initWithContentsOfURL_withReference_(self, fileUrl: id, byRe...
method initWithData_ (line 3236) | unsafe fn initWithData_(self, audioData: id) -> id;
method initWithPasteboard_ (line 3237) | unsafe fn initWithPasteboard_(self, pasteboard: id) -> id;
method name (line 3239) | unsafe fn name(self) -> id;
method volume (line 3240) | unsafe fn volume(self) -> f32;
method currentTime (line 3241) | unsafe fn currentTime(self) -> NSTimeInterval;
method loops (line 3242) | unsafe fn loops(self) -> BOOL;
method playbackDeviceIdentifier (line 3243) | unsafe fn playbackDeviceIdentifier(self) -> id;
method delegate (line 3244) | unsafe fn delegate(self) -> id;
method soundUnfilteredTypes (line 3246) | unsafe fn soundUnfilteredTypes(_: Self) -> id {
method soundNamed_ (line 3250) | unsafe fn soundNamed_(_: Self, soundName: id) -> id {
method duration (line 3254) | unsafe fn duration(self) -> NSTimeInterval;
method playing (line 3256) | unsafe fn playing(self) -> BOOL;
method pause (line 3257) | unsafe fn pause(self) -> BOOL;
method play (line 3258) | unsafe fn play(self) -> BOOL;
method resume (line 3259) | unsafe fn resume(self) -> BOOL;
method stop (line 3260) | unsafe fn stop(self) -> BOOL;
method writeToPasteboard_ (line 3262) | unsafe fn writeToPasteboard_(self, pasteboard: id);
method initWithContentsOfFile_withReference_ (line 3266) | unsafe fn initWithContentsOfFile_withReference_(self, filepath: id, by...
method initWithContentsOfURL_withReference_ (line 3270) | unsafe fn initWithContentsOfURL_withReference_(self, fileUrl: id, byRe...
method initWithData_ (line 3274) | unsafe fn initWithData_(self, audioData: id) -> id {
method initWithPasteboard_ (line 3278) | unsafe fn initWithPasteboard_(self, pasteboard: id) -> id {
method name (line 3282) | unsafe fn name(self) -> id {
method volume (line 3286) | unsafe fn volume(self) -> f32 {
method currentTime (line 3290) | unsafe fn currentTime(self) -> NSTimeInterval {
method loops (line 3294) | unsafe fn loops(self) -> BOOL {
method playbackDeviceIdentifier (line 3298) | unsafe fn playbackDeviceIdentifier(self) -> id {
method delegate (line 3302) | unsafe fn delegate(self) -> id {
method duration (line 3306) | unsafe fn duration(self) -> NSTimeInterval {
method playing (line 3310) | unsafe fn playing(self) -> BOOL {
method pause (line 3314) | unsafe fn pause(self) -> BOOL {
method play (line 3318) | unsafe fn play(self) -> BOOL {
method resume (line 3322) | unsafe fn resume(self) -> BOOL {
method stop (line 3326) | unsafe fn stop(self) -> BOOL {
method writeToPasteboard_ (line 3330) | unsafe fn writeToPasteboard_(self, pasteboard: id) {
constant NSVariableStatusItemLength (line 3335) | pub const NSVariableStatusItemLength: CGFloat = -1.0;
constant NSSquareStatusItemLength (line 3336) | pub const NSSquareStatusItemLength: CGFloat = -2.0;
type NSStatusItem (line 3338) | pub trait NSStatusItem: Sized {
method statusBar (line 3339) | unsafe fn statusBar(self) -> id /* (NSStatusBar *) */;
method button (line 3340) | unsafe fn button(self) -> id /* (NSStatusBarButton *) */;
method menu (line 3341) | unsafe fn menu(self) -> id;
method setMenu_ (line 3342) | unsafe fn setMenu_(self, menu: id);
method length (line 3343) | unsafe fn length(self) -> CGFloat;
method setLength_ (line 3344) | unsafe fn setLength_(self, length: CGFloat);
method statusBar (line 3348) | unsafe fn statusBar(self) -> id /* (NSStatusBar *) */ {
method button (line 3352) | unsafe fn button(self) -> id /* (NSStatusBarButton *) */ {
method menu (line 3356) | unsafe fn menu(self) -> id {
method setMenu_ (line 3360) | unsafe fn setMenu_(self, menu: id) {
method length (line 3364) | unsafe fn length(self) -> CGFloat {
method setLength_ (line 3368) | unsafe fn setLength_(self, length: CGFloat) {
type NSStatusBar (line 3373) | pub trait NSStatusBar: Sized {
method systemStatusBar (line 3374) | unsafe fn systemStatusBar(_: Self) -> id {
method statusItemWithLength_ (line 3378) | unsafe fn statusItemWithLength_(self, length: CGFloat) -> id /* (NSSta...
method removeStatusItem_ (line 3379) | unsafe fn removeStatusItem_(self, item: id /* (NSStatusItem *) */);
method isVertical (line 3380) | unsafe fn isVertical(self) -> BOOL;
method statusItemWithLength_ (line 3384) | unsafe fn statusItemWithLength_(self, length: CGFloat) -> id /* (NSSta...
method removeStatusItem_ (line 3388) | unsafe fn removeStatusItem_(self, item: id /* (NSStatusItem *) */) {
method isVertical (line 3392) | unsafe fn isVertical(self) -> BOOL {
function NSRectFill (line 3398) | pub fn NSRectFill(rect: NSRect);
type NSTextField (line 3401) | pub trait NSTextField: Sized {
method alloc (line 3402) | unsafe fn alloc(_: Self) -> id {
method initWithFrame_ (line 3405) | unsafe fn initWithFrame_(self, frameRect: NSRect) -> id;
method setEditable_ (line 3406) | unsafe fn setEditable_(self, editable: BOOL);
method setStringValue_ (line 3407) | unsafe fn setStringValue_(self, label: id /* NSString */);
method initWithFrame_ (line 3411) | unsafe fn initWithFrame_(self, frameRect: NSRect) -> id {
method setEditable_ (line 3414) | unsafe fn setEditable_(self, editable: BOOL) {
method setStringValue_ (line 3417) | unsafe fn setStringValue_(self, label: id) {
type NSTabViewType (line 3423) | pub enum NSTabViewType {
type NSTabView (line 3433) | pub trait NSTabView: Sized {
method new (line 3434) | unsafe fn new(_: Self) -> id {
method initWithFrame_ (line 3438) | unsafe fn initWithFrame_(self, frameRect: NSRect) -> id;
method addTabViewItem_ (line 3439) | unsafe fn addTabViewItem_(self, tabViewItem: id);
method insertTabViewItem_atIndex_ (line 3440) | unsafe fn insertTabViewItem_atIndex_(self,tabViewItem:id, index:NSInte...
method removeTabViewItem_ (line 3441) | unsafe fn removeTabViewItem_(self,tabViewItem:id);
method indexOfTabViewItem_ (line 3442) | unsafe fn indexOfTabViewItem_(self, tabViewItem:id) -> id;
method indexOfTabViewItemWithIdentifier_ (line 3443) | unsafe fn indexOfTabViewItemWithIdentifier_(self,identifier:id) -> id;
method numberOfTabViewItems (line 3444) | unsafe fn numberOfTabViewItems(self) -> id;
method tabViewItemAtIndex_ (line 3445) | unsafe fn tabViewItemAtIndex_(self,index:id) -> id;
method tabViewItems (line 3446) | unsafe fn tabViewItems(self) -> id;
method selectFirstTabViewItem_ (line 3447) | unsafe fn selectFirstTabViewItem_(self,sender:id);
method selectLastTabViewItem_ (line 3448) | unsafe fn selectLastTabViewItem_(self,sender:id);
method selectNextTabViewItem_ (line 3449) | unsafe fn selectNextTabViewItem_(self, sender:id);
method selectPreviousTabViewItem_ (line 3450) | unsafe fn selectPreviousTabViewItem_(self,sender:id);
method selectTabViewItem_ (line 3451) | unsafe fn selectTabViewItem_(self,tabViewItem:id);
method selectTabViewItemAtIndex_ (line 3452) | unsafe fn selectTabViewItemAtIndex_(self,index:id);
method selectTabViewItemWithIdentifier_ (line 3453) | unsafe fn selectTabViewItemWithIdentifier_(self,identifier:id);
method selectedTabViewItem (line 3454) | unsafe fn selectedTabViewItem(self) -> id;
method takeSelectedTabViewItemFromSender_ (line 3455) | unsafe fn takeSelectedTabViewItemFromSender_(self,sender:id);
method font (line 3456) | unsafe fn font(self) -> id;
method setFont_ (line 3457) | unsafe fn setFont_(self, font:id);
method tabViewType (line 3458) | unsafe fn tabViewType(self) -> NSTabViewType;
method setTabViewType_ (line 3459) | unsafe fn setTabViewType_(self,tabViewType: NSTabViewType);
method controlTint (line 3460) | unsafe fn controlTint(self) -> id;
method setControlTint_ (line 3461) | unsafe fn setControlTint_(self,controlTint:id);
method drawsBackground (line 3462) | unsafe fn drawsBackground(self) -> BOOL;
method setDrawsBackground_ (line 3463) | unsafe fn setDrawsBackground_(self,drawsBackground:BOOL);
method minimumSize (line 3464) | unsafe fn minimumSize(self) -> id;
method contentRect (line 3465) | unsafe fn contentRect(self) -> id;
method controlSize (line 3466) | unsafe fn controlSize(self) -> id;
method setControlSize_ (line 3467) | unsafe fn setControlSize_(self,controlSize:id);
method allowsTruncatedLabels (line 3468) | unsafe fn allowsTruncatedLabels(self) -> BOOL;
method setAllowsTruncatedLabels_ (line 3469) | unsafe fn setAllowsTruncatedLabels_(self, allowTruncatedLabels:BOOL);
method setDelegate_ (line 3470) | unsafe fn setDelegate_(self, delegate:id);
method delegate (line 3471) | unsafe fn delegate(self) -> id ;
method tabViewAtPoint_ (line 3472) | unsafe fn tabViewAtPoint_(self, point:id) -> id;
method initWithFrame_ (line 3476) | unsafe fn initWithFrame_(self, frameRect: NSRect) -> id {
method addTabViewItem_ (line 3480) | unsafe fn addTabViewItem_(self, tabViewItem: id) {
method insertTabViewItem_atIndex_ (line 3483) | unsafe fn insertTabViewItem_atIndex_(self, tabViewItem: id,index:NSInt...
method removeTabViewItem_ (line 3486) | unsafe fn removeTabViewItem_(self,tabViewItem:id){
method indexOfTabViewItem_ (line 3490) | unsafe fn indexOfTabViewItem_(self, tabViewItem:id) -> id{
method indexOfTabViewItemWithIdentifier_ (line 3494) | unsafe fn indexOfTabViewItemWithIdentifier_(self,identifier:id) -> id{
method numberOfTabViewItems (line 3497) | unsafe fn numberOfTabViewItems(self) -> id{
method tabViewItemAtIndex_ (line 3501) | unsafe fn tabViewItemAtIndex_(self,index:id)->id{
method tabViewItems (line 3505) | unsafe fn tabViewItems(self)->id{
method selectFirstTabViewItem_ (line 3509) | unsafe fn selectFirstTabViewItem_(self,sender:id){
method selectLastTabViewItem_ (line 3513) | unsafe fn selectLastTabViewItem_(self,sender:id){
method selectNextTabViewItem_ (line 3516) | unsafe fn selectNextTabViewItem_(self, sender:id){
method selectPreviousTabViewItem_ (line 3519) | unsafe fn selectPreviousTabViewItem_(self,sender:id){
method selectTabViewItem_ (line 3523) | unsafe fn selectTabViewItem_(self,tabViewItem:id){
method selectTabViewItemAtIndex_ (line 3527) | unsafe fn selectTabViewItemAtIndex_(self,index:id){
method selectTabViewItemWithIdentifier_ (line 3530) | unsafe fn selectTabViewItemWithIdentifier_(self,identifier:id){
method selectedTabViewItem (line 3533) | unsafe fn selectedTabViewItem(self) -> id{
method takeSelectedTabViewItemFromSender_ (line 3536) | unsafe fn takeSelectedTabViewItemFromSender_(self,sender:id){
method font (line 3540) | unsafe fn font(self)->id{
method setFont_ (line 3544) | unsafe fn setFont_(self, font:id){
method tabViewType (line 3548) | unsafe fn tabViewType(self)->NSTabViewType{
method setTabViewType_ (line 3551) | unsafe fn setTabViewType_(self,tabViewType: NSTabViewType){
method controlTint (line 3555) | unsafe fn controlTint(self) -> id{
method setControlTint_ (line 3558) | unsafe fn setControlTint_(self,controlTint:id){
method drawsBackground (line 3562) | unsafe fn drawsBackground(self) -> BOOL{
method setDrawsBackground_ (line 3565) | unsafe fn setDrawsBackground_(self,drawsBackground:BOOL){
method minimumSize (line 3569) | unsafe fn minimumSize(self) -> id{
method contentRect (line 3572) | unsafe fn contentRect(self) -> id{
method controlSize (line 3575) | unsafe fn controlSize(self) -> id{
method setControlSize_ (line 3578) | unsafe fn setControlSize_(self,controlSize:id){
method allowsTruncatedLabels (line 3582) | unsafe fn allowsTruncatedLabels(self) -> BOOL{
method setAllowsTruncatedLabels_ (line 3585) | unsafe fn setAllowsTruncatedLabels_(self, allowTruncatedLabels:BOOL){
method setDelegate_ (line 3589) | unsafe fn setDelegate_(self, delegate:id){
method delegate (line 3592) | unsafe fn delegate(self) -> id {
method tabViewAtPoint_ (line 3596) | unsafe fn tabViewAtPoint_(self, point:id) -> id{
type NSTabState (line 3602) | pub enum NSTabState {
type NSTabViewItem (line 3608) | pub trait NSTabViewItem: Sized {
method alloc (line 3609) | unsafe fn alloc(_: Self) -> id {
method new (line 3612) | unsafe fn new(_: Self) -> id {
method initWithIdentifier_ (line 3616) | unsafe fn initWithIdentifier_(self, identifier:id) -> id;
method drawLabel_inRect_ (line 3617) | unsafe fn drawLabel_inRect_(self,shouldTruncateLabel:BOOL,labelRect:NS...
method label (line 3618) | unsafe fn label(self) -> id;
method setLabel_ (line 3619) | unsafe fn setLabel_(self,label:id);
method sizeOfLabel_ (line 3620) | unsafe fn sizeOfLabel_(self, computeMin:BOOL);
method tabState (line 3621) | unsafe fn tabState(self) -> NSTabState;
method identifier (line 3622) | unsafe fn identifier(self)-> id;
method setIdentifier_ (line 3623) | unsafe fn setIdentifier_(self,identifier:id);
method color (line 3624) | unsafe fn color(self)-> id;
method setColor_ (line 3625) | unsafe fn setColor_(self,color:id);
method view (line 3626) | unsafe fn view(self) -> id;
method setView_ (line 3627) | unsafe fn setView_(self, view:id);
method initialFirstResponder (line 3628) | unsafe fn initialFirstResponder(self)->id;
method setInitialFirstResponder_ (line 3629) | unsafe fn setInitialFirstResponder_(self,initialFirstResponder:id);
method tabView (line 3630) | unsafe fn tabView(self) -> id;
method tooltip (line 3631) | unsafe fn tooltip(self) -> id;
method setTooltip_ (line 3632) | unsafe fn setTooltip_(self,toolTip:id);
method initWithIdentifier_ (line 3636) | unsafe fn initWithIdentifier_(self, identifier: id) -> id {
method drawLabel_inRect_ (line 3640) | unsafe fn drawLabel_inRect_(self, shouldTruncateLabel:BOOL,labelRect:N...
method label (line 3644) | unsafe fn label(self)->id{
method setLabel_ (line 3647) | unsafe fn setLabel_(self,label : id){
method sizeOfLabel_ (line 3651) | unsafe fn sizeOfLabel_(self,computeMin:BOOL){
method tabState (line 3655) | unsafe fn tabState(self) -> NSTabState{
method identifier (line 3659) | unsafe fn identifier(self)-> id {
method setIdentifier_ (line 3663) | unsafe fn setIdentifier_(self,identifier:id){
method color (line 3667) | unsafe fn color(self)-> id{
method setColor_ (line 3671) | unsafe fn setColor_(self,color:id){
method view (line 3675) | unsafe fn view(self) -> id {
method setView_ (line 3679) | unsafe fn setView_(self, view:id){
method initialFirstResponder (line 3683) | unsafe fn initialFirstResponder(self)->id{
method setInitialFirstResponder_ (line 3687) | unsafe fn setInitialFirstResponder_(self,initialFirstResponder:id){
method tabView (line 3691) | unsafe fn tabView(self) -> id{
method tooltip (line 3695) | unsafe fn tooltip(self) -> id{
method setTooltip_ (line 3699) | unsafe fn setTooltip_(self,toolTip:id){
type NSLayoutConstraint (line 3704) | pub trait NSLayoutConstraint: Sized {
method activateConstraints (line 3705) | unsafe fn activateConstraints(_: Self, constraints: id) -> id;
method activateConstraints (line 3709) | unsafe fn activateConstraints(_: Self, constraints: id) -> id {
type NSLayoutDimension (line 3714) | pub trait NSLayoutDimension: Sized {
method constraintEqualToConstant (line 3715) | unsafe fn constraintEqualToConstant(self, c: CGFloat) -> id;
method constraintLessThanOrEqualToConstant (line 3716) | unsafe fn constraintLessThanOrEqualToConstant(self, c: CGFloat) -> id;
method constraintGreaterThanOrEqualToConstant (line 3717) | unsafe fn constraintGreaterThanOrEqualToConstant(self, c: CGFloat) -> id;
method constraintEqualToConstant (line 3721) | unsafe fn constraintEqualToConstant(self, c: CGFloat) -> id {
method constraintLessThanOrEqualToConstant (line 3725) | unsafe fn constraintLessThanOrEqualToConstant(self, c: CGFloat) -> id {
method constraintGreaterThanOrEqualToConstant (line 3729) | unsafe fn constraintGreaterThanOrEqualToConstant(self, c: CGFloat) -> ...
type NSColor (line 3734) | pub trait NSColor: Sized {
method clearColor (line 3735) | unsafe fn clearColor(_: Self) -> id;
method clearColor (line 3739) | unsafe fn clearColor(_: Self) -> id {
function test_nsapp (line 3749) | pub fn test_nsapp() {
FILE: src/base.rs
type Class (line 15) | pub type Class = *mut runtime::Class;
type id (line 17) | pub type id = *mut runtime::Object;
type SEL (line 18) | pub type SEL = runtime::Sel;
constant nil (line 21) | pub const nil: id = 0 as id;
constant Nil (line 23) | pub const Nil: Class = 0 as Class;
function class (line 27) | pub fn class(name: &str) -> Class {
function selector (line 35) | pub fn selector(name: &str) -> SEL {
FILE: src/foundation.rs
type NSInteger (line 19) | pub type NSInteger = libc::c_int;
type NSUInteger (line 21) | pub type NSUInteger = libc::c_uint;
type NSInteger (line 24) | pub type NSInteger = libc::c_long;
type NSUInteger (line 26) | pub type NSUInteger = libc::c_ulong;
constant UTF8_ENCODING (line 28) | const UTF8_ENCODING: usize = 4;
type NSPoint (line 40) | pub struct NSPoint {
method new (line 47) | pub fn new(x: f64, y: f64) -> NSPoint {
method encode (line 56) | fn encode() -> objc::Encoding {
type NSSize (line 66) | pub struct NSSize {
method new (line 73) | pub fn new(width: f64, height: f64) -> NSSize {
method encode (line 82) | fn encode() -> objc::Encoding {
type NSRect (line 92) | pub struct NSRect {
method new (line 99) | pub fn new(origin: NSPoint, size: NSSize) -> NSRect {
method as_CGRect (line 107) | pub fn as_CGRect(&self) -> &CGRect {
method inset (line 114) | pub fn inset(&self, x: CGFloat, y: CGFloat) -> NSRect {
method encode (line 122) | fn encode() -> objc::Encoding {
type NSRectEdge (line 132) | pub enum NSRectEdge {
function NSInsetRect (line 141) | fn NSInsetRect(rect: NSRect, x: CGFloat, y: CGFloat) -> NSRect;
type NSValue (line 144) | pub trait NSValue: Sized {
method valueWithPoint (line 145) | unsafe fn valueWithPoint(_: Self, point: NSPoint) -> id {
method valueWithSize (line 149) | unsafe fn valueWithSize(_: Self, size: NSSize) -> id {
type NSRange (line 162) | pub struct NSRange {
method new (line 169) | pub fn new(location: NSUInteger, length: NSUInteger) -> NSRange {
type NSAutoreleasePool (line 182) | pub trait NSAutoreleasePool: Sized {
method new (line 183) | unsafe fn new(_: Self) -> id {
method autorelease (line 187) | unsafe fn autorelease(self) -> Self;
method drain (line 188) | unsafe fn drain(self);
method autorelease (line 192) | unsafe fn autorelease(self) -> id {
method drain (line 196) | unsafe fn drain(self) {
type NSProcessInfo (line 201) | pub trait NSProcessInfo: Sized {
method processInfo (line 202) | unsafe fn processInfo(_: Self) -> id {
method processName (line 206) | unsafe fn processName(self) -> id;
method processName (line 210) | unsafe fn processName(self) -> id {
type NSTimeInterval (line 215) | pub type NSTimeInterval = libc::c_double;
type NSArray (line 217) | pub trait NSArray: Sized {
method array (line 218) | unsafe fn array(_: Self) -> id {
method arrayWithObjects (line 222) | unsafe fn arrayWithObjects(_: Self, objects: &[id]) -> id {
method arrayWithObject (line 227) | unsafe fn arrayWithObject(_: Self, object: id) -> id {
method arrayByAddingObjectFromArray (line 231) | unsafe fn arrayByAddingObjectFromArray(self, object: id) -> id;
method arrayByAddingObjectsFromArray (line 232) | unsafe fn arrayByAddingObjectsFromArray(self, objects: id) -> id;
method arrayByAddingObjectFromArray (line 236) | unsafe fn arrayByAddingObjectFromArray(self, object: id) -> id {
method arrayByAddingObjectsFromArray (line 240) | unsafe fn arrayByAddingObjectsFromArray(self, objects: id) -> id {
type NSDictionary (line 245) | pub trait NSDictionary: Sized {
method dictionary (line 246) | unsafe fn dictionary(_: Self) -> id {
method dictionaryWithContentsOfFile_ (line 250) | unsafe fn dictionaryWithContentsOfFile_(_: Self, path: id) -> id {
method dictionaryWithContentsOfURL_ (line 254) | unsafe fn dictionaryWithContentsOfURL_(_: Self, aURL: id) -> id {
method dictionaryWithDictionary_ (line 258) | unsafe fn dictionaryWithDictionary_(_: Self, otherDictionary: id) -> id {
method dictionaryWithObject_forKey_ (line 262) | unsafe fn dictionaryWithObject_forKey_(_: Self, anObject: id, aKey: id...
method dictionaryWithObjects_forKeys_ (line 266) | unsafe fn dictionaryWithObjects_forKeys_(_: Self, objects: id, keys: i...
method dictionaryWithObjects_forKeys_count_ (line 270) | unsafe fn dictionaryWithObjects_forKeys_count_(_: Self, objects: *cons...
method dictionaryWithObjectsAndKeys_ (line 274) | unsafe fn dictionaryWithObjectsAndKeys_(_: Self, firstObject: id) -> id {
method init (line 278) | unsafe fn init(self) -> id;
method initWithContentsOfFile_ (line 279) | unsafe fn initWithContentsOfFile_(self, path: id) -> id;
method initWithContentsOfURL_ (line 280) | unsafe fn initWithContentsOfURL_(self, aURL: id) -> id;
method initWithDictionary_ (line 281) | unsafe fn initWithDictionary_(self, otherDicitonary: id) -> id;
method initWithDictionary_copyItems_ (line 282) | unsafe fn initWithDictionary_copyItems_(self, otherDicitonary: id, fla...
method initWithObjects_forKeys_ (line 283) | unsafe fn initWithObjects_forKeys_(self, objects: id, keys: id) -> id;
method initWithObjects_forKeys_count_ (line 284) | unsafe fn initWithObjects_forKeys_count_(self, objects: id, keys: id, ...
method initWithObjectsAndKeys_ (line 285) | unsafe fn initWithObjectsAndKeys_(self, firstObject: id) -> id;
method sharedKeySetForKeys_ (line 287) | unsafe fn sharedKeySetForKeys_(_: Self, keys: id) -> id {
method count (line 291) | unsafe fn count(self) -> NSUInteger;
method isEqualToDictionary_ (line 293) | unsafe fn isEqualToDictionary_(self, otherDictionary: id) -> BOOL;
method allKeys (line 295) | unsafe fn allKeys(self) -> id;
method allKeysForObject_ (line 296) | unsafe fn allKeysForObject_(self, anObject: id) -> id;
method allValues (line 297) | unsafe fn allValues(self) -> id;
method objectForKey_ (line 298) | unsafe fn objectForKey_(self, aKey: id) -> id;
method objectForKeyedSubscript_ (line 299) | unsafe fn objectForKeyedSubscript_(self, key: id) -> id;
method objectsForKeys_notFoundMarker_ (line 300) | unsafe fn objectsForKeys_notFoundMarker_(self, keys: id, anObject: id)...
method valueForKey_ (line 301) | unsafe fn valueForKey_(self, key: id) -> id;
method keyEnumerator (line 303) | unsafe fn keyEnumerator(self) -> id;
method objectEnumerator (line 304) | unsafe fn objectEnumerator(self) -> id;
method enumerateKeysAndObjectsUsingBlock_ (line 305) | unsafe fn enumerateKeysAndObjectsUsingBlock_(self, block: *mut Block<(...
method enumerateKeysAndObjectsWithOptions_usingBlock_ (line 306) | unsafe fn enumerateKeysAndObjectsWithOptions_usingBlock_(self, opts: N...
method keysSortedByValueUsingSelector_ (line 309) | unsafe fn keysSortedByValueUsingSelector_(self, comparator: SEL) -> id;
method keysSortedByValueUsingComparator_ (line 310) | unsafe fn keysSortedByValueUsingComparator_(self, cmptr: NSComparator)...
method keysSortedByValueWithOptions_usingComparator_ (line 311) | unsafe fn keysSortedByValueWithOptions_usingComparator_(self, opts: NS...
method keysOfEntriesPassingTest_ (line 313) | unsafe fn keysOfEntriesPassingTest_(self, predicate: *mut Block<(id, i...
method keysOfEntriesWithOptions_PassingTest_ (line 314) | unsafe fn keysOfEntriesWithOptions_PassingTest_(self, opts: NSEnumerat...
method writeToFile_atomically_ (line 317) | unsafe fn writeToFile_atomically_(self, path: id, flag: BOOL) -> BOOL;
method writeToURL_atomically_ (line 318) | unsafe fn writeToURL_atomically_(self, aURL: id, flag: BOOL) -> BOOL;
method fileCreationDate (line 320) | unsafe fn fileCreationDate(self) -> id;
method fileExtensionHidden (line 321) | unsafe fn fileExtensionHidden(self) -> BOOL;
method fileGroupOwnerAccountID (line 322) | unsafe fn fileGroupOwnerAccountID(self) -> id;
method fileGroupOwnerAccountName (line 323) | unsafe fn fileGroupOwnerAccountName(self) -> id;
method fileIsAppendOnly (line 324) | unsafe fn fileIsAppendOnly(self) -> BOOL;
method fileIsImmutable (line 325) | unsafe fn fileIsImmutable(self) -> BOOL;
method fileModificationDate (line 326) | unsafe fn fileModificationDate(self) -> id;
method fileOwnerAccountID (line 327) | unsafe fn fileOwnerAccountID(self) -> id;
method fileOwnerAccountName (line 328) | unsafe fn fileOwnerAccountName(self) -> id;
method filePosixPermissions (line 329) | unsafe fn filePosixPermissions(self) -> NSUInteger;
method fileSize (line 330) | unsafe fn fileSize(self) -> libc::c_ulonglong;
method fileSystemFileNumber (line 331) | unsafe fn fileSystemFileNumber(self) -> NSUInteger;
method fileSystemNumber (line 332) | unsafe fn fileSystemNumber(self) -> NSInteger;
method fileType (line 333) | unsafe fn fileType(self) -> id;
method description (line 335) | unsafe fn description(self) -> id;
method descriptionInStringsFileFormat (line 336) | unsafe fn descriptionInStringsFileFormat(self) -> id;
method descriptionWithLocale_ (line 337) | unsafe fn descriptionWithLocale_(self, locale: id) -> id;
method descriptionWithLocale_indent_ (line 338) | unsafe fn descriptionWithLocale_indent_(self, locale: id, indent: NSUI...
method init (line 342) | unsafe fn init(self) -> id {
method initWithContentsOfFile_ (line 346) | unsafe fn initWithContentsOfFile_(self, path: id) -> id {
method initWithContentsOfURL_ (line 350) | unsafe fn initWithContentsOfURL_(self, aURL: id) -> id {
method initWithDictionary_ (line 354) | unsafe fn initWithDictionary_(self, otherDictionary: id) -> id {
method initWithDictionary_copyItems_ (line 358) | unsafe fn initWithDictionary_copyItems_(self, otherDictionary: id, fla...
method initWithObjects_forKeys_ (line 362) | unsafe fn initWithObjects_forKeys_(self, objects: id, keys: id) -> id {
method initWithObjects_forKeys_count_ (line 366) | unsafe fn initWithObjects_forKeys_count_(self, objects: id, keys: id, ...
method initWithObjectsAndKeys_ (line 370) | unsafe fn initWithObjectsAndKeys_(self, firstObject: id) -> id {
method count (line 374) | unsafe fn count(self) -> NSUInteger {
method isEqualToDictionary_ (line 378) | unsafe fn isEqualToDictionary_(self, otherDictionary: id) -> BOOL {
method allKeys (line 382) | unsafe fn allKeys(self) -> id {
method allKeysForObject_ (line 386) | unsafe fn allKeysForObject_(self, anObject: id) -> id {
method allValues (line 390) | unsafe fn allValues(self) -> id {
method objectForKey_ (line 394) | unsafe fn objectForKey_(self, aKey: id) -> id {
method objectForKeyedSubscript_ (line 398) | unsafe fn objectForKeyedSubscript_(self, key: id) -> id {
method objectsForKeys_notFoundMarker_ (line 402) | unsafe fn objectsForKeys_notFoundMarker_(self, keys: id, anObject: id)...
method valueForKey_ (line 406) | unsafe fn valueForKey_(self, key: id) -> id {
method keyEnumerator (line 410) | unsafe fn keyEnumerator(self) -> id {
method objectEnumerator (line 414) | unsafe fn objectEnumerator(self) -> id {
method enumerateKeysAndObjectsUsingBlock_ (line 418) | unsafe fn enumerateKeysAndObjectsUsingBlock_(self, block: *mut Block<(...
method enumerateKeysAndObjectsWithOptions_usingBlock_ (line 422) | unsafe fn enumerateKeysAndObjectsWithOptions_usingBlock_(self, opts: N...
method keysSortedByValueUsingSelector_ (line 427) | unsafe fn keysSortedByValueUsingSelector_(self, comparator: SEL) -> id {
method keysSortedByValueUsingComparator_ (line 431) | unsafe fn keysSortedByValueUsingComparator_(self, cmptr: NSComparator)...
method keysSortedByValueWithOptions_usingComparator_ (line 435) | unsafe fn keysSortedByValueWithOptions_usingComparator_(self, opts: NS...
method keysOfEntriesPassingTest_ (line 440) | unsafe fn keysOfEntriesPassingTest_(self, predicate: *mut Block<(id, i...
method keysOfEntriesWithOptions_PassingTest_ (line 444) | unsafe fn keysOfEntriesWithOptions_PassingTest_(self, opts: NSEnumerat...
method writeToFile_atomically_ (line 449) | unsafe fn writeToFile_atomically_(self, path: id, flag: BOOL) -> BOOL {
method writeToURL_atomically_ (line 453) | unsafe fn writeToURL_atomically_(self, aURL: id, flag: BOOL) -> BOOL {
method fileCreationDate (line 457) | unsafe fn fileCreationDate(self) -> id {
method fileExtensionHidden (line 461) | unsafe fn fileExtensionHidden(self) -> BOOL {
method fileGroupOwnerAccountID (line 465) | unsafe fn fileGroupOwnerAccountID(self) -> id {
method fileGroupOwnerAccountName (line 469) | unsafe fn fileGroupOwnerAccountName(self) -> id {
method fileIsAppendOnly (line 473) | unsafe fn fileIsAppendOnly(self) -> BOOL {
method fileIsImmutable (line 477) | unsafe fn fileIsImmutable(self) -> BOOL {
method fileModificationDate (line 481) | unsafe fn fileModificationDate(self) -> id {
method fileOwnerAccountID (line 485) | unsafe fn fileOwnerAccountID(self) -> id {
method fileOwnerAccountName (line 489) | unsafe fn fileOwnerAccountName(self) -> id {
method filePosixPermissions (line 493) | unsafe fn filePosixPermissions(self) -> NSUInteger {
method fileSize (line 497) | unsafe fn fileSize(self) -> libc::c_ulonglong {
method fileSystemFileNumber (line 501) | unsafe fn fileSystemFileNumber(self) -> NSUInteger {
method fileSystemNumber (line 505) | unsafe fn fileSystemNumber(self) -> NSInteger {
method fileType (line 509) | unsafe fn fileType(self) -> id {
method description (line 513) | unsafe fn description(self) -> id {
method descriptionInStringsFileFormat (line 517) | unsafe fn descriptionInStringsFileFormat(self) -> id {
method descriptionWithLocale_ (line 521) | unsafe fn descriptionWithLocale_(self, locale: id) -> id {
method descriptionWithLocale_indent_ (line 525) | unsafe fn descriptionWithLocale_indent_(self, locale: id, indent: NSUI...
type NSComparator (line 537) | pub type NSComparator = *mut Block<(id, id), NSComparisonResult>;
type NSComparisonResult (line 541) | pub enum NSComparisonResult {
type NSString (line 547) | pub trait NSString: Sized {
method alloc (line 548) | unsafe fn alloc(_: Self) -> id {
method stringByAppendingString_ (line 552) | unsafe fn stringByAppendingString_(self, other: id) -> id;
method init_str (line 553) | unsafe fn init_str(self, string: &str) -> Self;
method UTF8String (line 554) | unsafe fn UTF8String(self) -> *const libc::c_char;
method len (line 555) | unsafe fn len(self) -> usize;
method isEqualToString (line 556) | unsafe fn isEqualToString(self, &str) -> bool;
method isEqualToString (line 560) | unsafe fn isEqualToString(self, other: &str) -> bool {
method stringByAppendingString_ (line 566) | unsafe fn stringByAppendingString_(self, other: id) -> id {
method init_str (line 570) | unsafe fn init_str(self, string: &str) -> id {
method len (line 577) | unsafe fn len(self) -> usize {
method UTF8String (line 581) | unsafe fn UTF8String(self) -> *const libc::c_char {
type NSDate (line 586) | pub trait NSDate: Sized {
method distantPast (line 587) | unsafe fn distantPast(_: Self) -> id {
method distantFuture (line 591) | unsafe fn distantFuture(_: Self) -> id {
type NSFastEnumerationState (line 601) | struct NSFastEnumerationState {
constant NS_FAST_ENUM_BUF_SIZE (line 608) | const NS_FAST_ENUM_BUF_SIZE: usize = 16;
type NSFastIterator (line 610) | pub struct NSFastIterator {
type Item (line 620) | type Item = id;
method next (line 622) | fn next(&mut self) -> Option<id> {
type NSFastEnumeration (line 651) | pub trait NSFastEnumeration: Sized {
method iter (line 652) | unsafe fn iter(self) -> NSFastIterator;
method iter (line 656) | unsafe fn iter(self) -> NSFastIterator {
type NSRunLoop (line 673) | pub trait NSRunLoop: Sized {
method currentRunLoop (line 674) | unsafe fn currentRunLoop() -> Self;
method performSelector_target_argument_order_modes_ (line 676) | unsafe fn performSelector_target_argument_order_modes_(self,
method currentRunLoop (line 685) | unsafe fn currentRunLoop() -> id {
method performSelector_target_argument_order_modes_ (line 689) | unsafe fn performSelector_target_argument_order_modes_(self,
type NSData (line 703) | pub trait NSData: Sized {
method data (line 704) | unsafe fn data(_: Self) -> id {
method dataWithBytes_length_ (line 708) | unsafe fn dataWithBytes_length_(_: Self, bytes: *const libc::c_void, l...
method dataWithBytesNoCopy_length_ (line 712) | unsafe fn dataWithBytesNoCopy_length_(_: Self, bytes: *const libc::c_v...
method dataWithBytesNoCopy_length_freeWhenDone_ (line 716) | unsafe fn dataWithBytesNoCopy_length_freeWhenDone_(_: Self, bytes: *co...
method dataWithContentsOfFile_ (line 721) | unsafe fn dataWithContentsOfFile_(_: Self, path: id) -> id {
method dataWithContentsOfFile_options_error_ (line 725) | unsafe fn dataWithContentsOfFile_options_error_(_: Self, path: id, mas...
method dataWithContentsOfURL_ (line 730) | unsafe fn dataWithContentsOfURL_(_: Self, aURL: id) -> id {
method dataWithContentsOfURL_options_error_ (line 734) | unsafe fn dataWithContentsOfURL_options_error_(_: Self, aURL: id, mask...
method dataWithData_ (line 739) | unsafe fn dataWithData_(_: Self, aData: id) -> id {
method initWithBase64EncodedData_options_ (line 743) | unsafe fn initWithBase64EncodedData_options_(self, base64Data: id, opt...
method initWithBase64EncodedString_options_ (line 745) | unsafe fn initWithBase64EncodedString_options_(self, base64String: id,...
method initWithBytes_length_ (line 747) | unsafe fn initWithBytes_length_(self, bytes: *const libc::c_void, leng...
method initWithBytesNoCopy_length_ (line 748) | unsafe fn initWithBytesNoCopy_length_(self, bytes: *const libc::c_void...
method initWithBytesNoCopy_length_deallocator_ (line 749) | unsafe fn initWithBytesNoCopy_length_deallocator_(self, bytes: *const ...
method initWithBytesNoCopy_length_freeWhenDone_ (line 752) | unsafe fn initWithBytesNoCopy_length_freeWhenDone_(self, bytes: *const...
method initWithContentsOfFile_ (line 754) | unsafe fn initWithContentsOfFile_(self, path: id) -> id;
method initWithContentsOfFile_options_error (line 755) | unsafe fn initWithContentsOfFile_options_error(self, path: id, mask: N...
method initWithContentsOfURL_ (line 757) | unsafe fn initWithContentsOfURL_(self, aURL: id) -> id;
method initWithContentsOfURL_options_error_ (line 758) | unsafe fn initWithContentsOfURL_options_error_(self, aURL: id, mask: N...
method initWithData_ (line 760) | unsafe fn initWithData_(self, data: id) -> id;
method bytes (line 762) | unsafe fn bytes(self) -> *const libc::c_void;
method description (line 763) | unsafe fn description(self) -> id;
method enumerateByteRangesUsingBlock_ (line 764) | unsafe fn enumerateByteRangesUsingBlock_(self, block: *mut Block<(*con...
method getBytes_length_ (line 765) | unsafe fn getBytes_length_(self, buffer: *mut libc::c_void, length: NS...
method getBytes_range_ (line 766) | unsafe fn getBytes_range_(self, buffer: *mut libc::c_void, range: NSRa...
method subdataWithRange_ (line 767) | unsafe fn subdataWithRange_(self, range: NSRange) -> id;
method rangeOfData_options_range_ (line 768) | unsafe fn rangeOfData_options_range_(self, dataToFind: id, options: NS...
method base64EncodedDataWithOptions_ (line 771) | unsafe fn base64EncodedDataWithOptions_(self, options: NSDataBase64Enc...
method base64EncodedStringWithOptions_ (line 772) | unsafe fn base64EncodedStringWithOptions_(self, options: NSDataBase64E...
method isEqualToData_ (line 774) | unsafe fn isEqualToData_(self, otherData: id) -> id;
method length (line 775) | unsafe fn length(self) -> NSUInteger;
method writeToFile_atomically_ (line 777) | unsafe fn writeToFile_atomically_(self, path: id, atomically: BOOL) ->...
method writeToFile_options_error_ (line 778) | unsafe fn writeToFile_options_error_(self, path: id, mask: NSDataWriti...
method writeToURL_atomically_ (line 779) | unsafe fn writeToURL_atomically_(self, aURL: id, atomically: BOOL) -> ...
method writeToURL_options_error_ (line 780) | unsafe fn writeToURL_options_error_(self, aURL: id, mask: NSDataWritin...
method initWithBase64EncodedData_options_ (line 784) | unsafe fn initWithBase64EncodedData_options_(self, base64Data: id, opt...
method initWithBase64EncodedString_options_ (line 789) | unsafe fn initWithBase64EncodedString_options_(self, base64String: id,...
method initWithBytes_length_ (line 794) | unsafe fn initWithBytes_length_(self, bytes: *const libc::c_void, leng...
method initWithBytesNoCopy_length_ (line 798) | unsafe fn initWithBytesNoCopy_length_(self, bytes: *const libc::c_void...
method initWithBytesNoCopy_length_deallocator_ (line 802) | unsafe fn initWithBytesNoCopy_length_deallocator_(self, bytes: *const ...
method initWithBytesNoCopy_length_freeWhenDone_ (line 808) | unsafe fn initWithBytesNoCopy_length_freeWhenDone_(self, bytes: *const...
method initWithContentsOfFile_ (line 813) | unsafe fn initWithContentsOfFile_(self, path: id) -> id {
method initWithContentsOfFile_options_error (line 817) | unsafe fn initWithContentsOfFile_options_error(self, path: id, mask: N...
method initWithContentsOfURL_ (line 822) | unsafe fn initWithContentsOfURL_(self, aURL: id) -> id {
method initWithContentsOfURL_options_error_ (line 826) | unsafe fn initWithContentsOfURL_options_error_(self, aURL: id, mask: N...
method initWithData_ (line 831) | unsafe fn initWithData_(self, data: id) -> id {
method bytes (line 835) | unsafe fn bytes(self) -> *const libc::c_void {
method description (line 839) | unsafe fn description(self) -> id {
method enumerateByteRangesUsingBlock_ (line 843) | unsafe fn enumerateByteRangesUsingBlock_(self, block: *mut Block<(*con...
method getBytes_length_ (line 847) | unsafe fn getBytes_length_(self, buffer: *mut libc::c_void, length: NS...
method getBytes_range_ (line 851) | unsafe fn getBytes_range_(self, buffer: *mut libc::c_void, range: NSRa...
method subdataWithRange_ (line 855) | unsafe fn subdataWithRange_(self, range: NSRange) -> id {
method rangeOfData_options_range_ (line 859) | unsafe fn rangeOfData_options_range_(self, dataToFind: id, options: NS...
method base64EncodedDataWithOptions_ (line 864) | unsafe fn base64EncodedDataWithOptions_(self, options: NSDataBase64Enc...
method base64EncodedStringWithOptions_ (line 868) | unsafe fn base64EncodedStringWithOptions_(self, options: NSDataBase64E...
method isEqualToData_ (line 872) | unsafe fn isEqualToData_(self, otherData: id) -> id {
method length (line 876) | unsafe fn length(self) -> NSUInteger {
method writeToFile_atomically_ (line 880) | unsafe fn writeToFile_atomically_(self, path: id, atomically: BOOL) ->...
method writeToFile_options_error_ (line 884) | unsafe fn writeToFile_options_error_(self, path: id, mask: NSDataWriti...
method writeToURL_atomically_ (line 888) | unsafe fn writeToURL_atomically_(self, aURL: id, atomically: BOOL) -> ...
method writeToURL_options_error_ (line 892) | unsafe fn writeToURL_options_error_(self, aURL: id, mask: NSDataWritin...
FILE: tests/foundation.rs
function test_utf8 (line 15) | fn test_utf8() {
function test_string (line 28) | fn test_string() {
function test_length (line 41) | fn test_length() {
function test_append_by_appending_string (line 50) | fn test_append_by_appending_string() {
function test_iter (line 73) | fn test_iter() {
function test_mutation (line 95) | fn test_mutation() {
function test_get (line 116) | fn test_get() {
function test_iter (line 130) | fn test_iter() {
Condensed preview — 14 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (198K chars).
[
{
"path": ".gitignore",
"chars": 29,
"preview": "*~\nbuild\n/target\n/Cargo.lock\n"
},
{
"path": ".travis.yml",
"chars": 88,
"preview": "os: osx\n\nlanguage: rust\n\nnotifications:\n webhooks: http://build.servo.org:54856/travis\n"
},
{
"path": "COPYRIGHT",
"chars": 321,
"preview": "Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\nhttp://www.apache.org/licenses/LICENSE-2.0> or the MIT"
},
{
"path": "Cargo.toml",
"chars": 396,
"preview": "\n[package]\nname = \"cocoa\"\ndescription = \"Bindings to Cocoa for OS X\"\nhomepage = \"https://github.com/servo/cocoa-rs\"\nrepo"
},
{
"path": "LICENSE-APACHE",
"chars": 10847,
"preview": " Apache License\n Version 2.0, January 2004\n http"
},
{
"path": "LICENSE-MIT",
"chars": 1067,
"preview": "Copyright (c) 2012-2013 Mozilla Foundation\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy"
},
{
"path": "README.md",
"chars": 173,
"preview": "Cocoa-rs\n--------\n\nThis repository has been merged into the [core-foundation](https://github.com/servo/core-foundation-r"
},
{
"path": "examples/hello_world.rs",
"chars": 2400,
"preview": "extern crate cocoa;\n\nuse cocoa::base::{selector, nil, NO};\nuse cocoa::foundation::{NSRect, NSPoint, NSSize, NSAutoreleas"
},
{
"path": "examples/tab_view.rs",
"chars": 3257,
"preview": "extern crate cocoa;\n\nuse cocoa::base::{selector, id, nil, NO};\n\n\nuse cocoa::foundation::{NSRect, NSPoint, NSSize, NSAuto"
},
{
"path": "src/appkit.rs",
"chars": 132129,
"preview": "// Copyright 2013 The Servo Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distributio"
},
{
"path": "src/base.rs",
"chars": 1135,
"preview": "// Copyright 2013 The Servo Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distributio"
},
{
"path": "src/foundation.rs",
"chars": 31809,
"preview": "// Copyright 2013 The Servo Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distributio"
},
{
"path": "src/lib.rs",
"chars": 718,
"preview": "// Copyright 2013 The Servo Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distributio"
},
{
"path": "tests/foundation.rs",
"chars": 7596,
"preview": "#[macro_use]\nextern crate objc;\nextern crate block;\nextern crate cocoa;\n\n#[cfg(test)]\nmod foundation {\n mod nsstring "
}
]
About this extraction
This page contains the full source code of the servo/cocoa-rs GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 14 files (187.5 KB), approximately 46.9k tokens, and a symbol index with 1353 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.