NSPoint
struct@objc_type(.encoding = "{CGPoint=dd}")
NSPoint : struct {
x : CGFloat = 0.0
y : CGFloat = 0.0
} macOS application, window, view, event, menu, button, and file dialog wrappers.
16 structs · 217 functions · Public API
@objc_type(.encoding = "{CGPoint=dd}")
NSPoint : struct {
x : CGFloat = 0.0
y : CGFloat = 0.0
} @objc_type(.encoding = "{CGSize=dd}")
NSSize : struct {
width : CGFloat = 0.0
height : CGFloat = 0.0
} @objc_type(.encoding = "{CGRect={CGPoint=dd}{CGSize=dd}}")
NSRect : struct {
origin : NSPoint = NSPoint {}
size : NSSize = NSSize {}
} @objc_object(.runtime_name = "NSApplication", .handle = "handle")
NSApplication : struct {
handle : core.ObjCId = null
} @objc_object(.runtime_name = "NSImage", .handle = "handle")
NSImage : struct {
handle : core.ObjCId = null
} @objc_object(.runtime_name = "NSWindow", .handle = "handle")
NSWindow : struct {
handle : core.ObjCId = null
} @objc_object(.runtime_name = "NSView", .handle = "handle")
NSView : struct {
handle : core.ObjCId = null
} @objc_object(.runtime_name = "NSRunningApplication", .handle = "handle")
NSRunningApplication : struct {
handle : core.ObjCId = null
} @objc_object(.runtime_name = "NSEvent", .handle = "handle")
NSEvent : struct {
handle : core.ObjCId = null
} NSWindowResizeContext : struct {
callback : NSWindowResizeCallback
user_data : ^void = null
} @objc_subclass(.runtime_name = "ChicNSWindowResizeObserver", .superclass = "NSObject", .handle = "handle", .context_ivar = "_chicContext")
NSWindowResizeObserver : struct {
handle : core.ObjCId = null
// init owns this malloc-backed callback context; deinit clears and frees it.
context : ^NSWindowResizeContext = null
} ObjCIvarObject : struct {} @objc_object(.runtime_name = "NSButton", .handle = "handle")
NSButton : struct {
handle : core.ObjCId = null
} @objc_object(.runtime_name = "NSMenu", .handle = "handle")
NSMenu : struct {
handle : core.ObjCId = null
} @objc_object(.runtime_name = "NSMenuItem", .handle = "handle")
NSMenuItem : struct {
handle : core.ObjCId = null
} @objc_object(.runtime_name = "NSOpenPanel", .handle = "handle")
NSOpenPanel : struct {
handle : core.ObjCId = null
} objc_allocateClassPair : func(superclass : core.ObjCClass, name : cstring, extra_bytes : i64) -> core.ObjCClass objc_registerClassPair : func(class : core.ObjCClass) objc_disposeClassPair : func(class : core.ObjCClass) class_addIvar : func(class : core.ObjCClass, name : cstring, size : i64, alignment : u8, types : cstring) -> core.ObjCBool class_getInstanceVariable : func(class : core.ObjCClass, name : cstring) -> ObjCIvar ivar_getOffset : func(ivar : ObjCIvar) -> i64 mouse_down : func(self : ^NSView, event : ^NSEvent) make_NSPoint : func(x : CGFloat, y : CGFloat) -> NSPoint make_NSSize : func(width : CGFloat, height : CGFloat) -> NSSize make_NSRect : func(x : CGFloat, y : CGFloat, width : CGFloat, height : CGFloat) -> NSRect default_style_mask_NSWindow : func() -> NSWindowStyleMask class_NSApplication : func() -> core.ObjCClass class_NSImage : func() -> core.ObjCClass class_NSWindow : func() -> core.ObjCClass class_NSView : func() -> core.ObjCClass class_NSRunningApplication : func() -> core.ObjCClass class_NSWindowResizeObserver : func() -> core.ObjCClass init : func(self : ^NSWindowResizeObserver, callback : NSWindowResizeCallback, user_data : ^void) -> bool deinit : func(self : ^NSWindowResizeObserver) NSApplication : func() -> NSApplication current_NSRunningApplication : func() -> NSRunningApplication NSDate_distant_past : func() -> core.ObjCId NSEvent_pressed_mouse_buttons : func() -> u64 create_NSImage : func(path : string) -> NSImage alloc_NSWindow : func() -> NSWindow create_NSWindow : func(rect : NSRect, style : NSWindowStyleMask, backing : NSBackingStoreType, defer_create : bool) -> NSWindow create_default_NSWindow : func(x : CGFloat, y : CGFloat, width : CGFloat, height : CGFloat, title : cstring) -> NSWindow alloc_NSView : func() -> NSView create_NSView : func(rect : NSRect) -> NSView set_activation_policy : func(self : ^NSApplication, policy : NSApplicationActivationPolicy) -> bool get_application_icon_image : func(self : ^NSApplication) -> NSImage set_application_icon_image : func(self : ^NSApplication, image : ^NSImage) activate_ignoring_other_apps : func(self : ^NSApplication, flag : bool) unhide : func(self : ^NSApplication, sender : core.ObjCId) finish_launching : func(self : ^NSApplication) run : func(self : ^NSApplication) next_event : func(self : ^NSApplication) -> NSEvent send_event : func(self : ^NSApplication, event : ^NSEvent) poll_events : func(self : ^NSApplication) update_windows : func(self : ^NSApplication) event_type : func(self : ^NSEvent) -> u64 location_in_window : func(self : ^NSEvent) -> NSPoint key_code : func(self : ^NSEvent) -> u64 modifier_flags : func(self : ^NSEvent) -> u64 characters : func(self : ^NSEvent) -> foundation.NSString stop : func(self : ^NSApplication, sender : core.ObjCId) terminate : func(self : ^NSApplication, sender : core.ObjCId) init_with_content_rect : func(self : ^NSWindow, rect : NSRect, style : NSWindowStyleMask, backing : NSBackingStoreType, defer_create : bool) -> NSWindow set_title : func(self : ^NSWindow, title : ^foundation.NSString) set_title_utf8 : func(self : ^NSWindow, title : cstring) set_content_view : func(self : ^NSWindow, view : ^NSView) delegate : func(self : ^NSWindow) -> core.ObjCId set_delegate : func(self : ^NSWindow, delegate : core.ObjCId) set_content_min_size : func(self : ^NSWindow, size : NSSize) content_view : func(self : ^NSWindow) -> NSView display : func(self : ^NSWindow) set_released_when_closed : func(self : ^NSWindow, flag : bool) set_accepts_mouse_moved_events : func(self : ^NSWindow, flag : bool) set_collection_behavior : func(self : ^NSWindow, behavior : NSWindowCollectionBehavior) center : func(self : ^NSWindow) make_key_and_order_front : func(self : ^NSWindow, sender : core.ObjCId) order_front : func(self : ^NSWindow, sender : core.ObjCId) order_front_regardless : func(self : ^NSWindow) set_level : func(self : ^NSWindow, level : NSWindowLevel) is_visible : func(self : ^NSWindow) -> bool mouse_location_outside_event_stream : func(self : ^NSWindow) -> NSPoint backing_scale_factor : func(self : ^NSWindow) -> CGFloat close : func(self : ^NSWindow) deinit : func(self : ^NSWindow) deinit : func(self : ^NSImage) init : func(self : ^NSView) -> NSView init_with_frame : func(self : ^NSView, rect : NSRect) -> NSView bounds : func(self : ^NSView) -> NSRect add_subview : func(self : ^NSView, view : ^NSView) deinit : func(self : ^NSView) activate_with_options : func(self : ^NSRunningApplication, options : NSApplicationActivationOptions) -> bool set_activation_policy_NSApplication : func(app : ^NSApplication, policy : NSApplicationActivationPolicy) -> bool application_icon_image_NSApplication : func(app : ^NSApplication) -> NSImage set_application_icon_image_NSApplication : func(app : ^NSApplication, image : ^NSImage) activate_ignoring_other_apps_NSApplication : func(app : ^NSApplication, flag : bool) unhide_NSApplication : func(app : ^NSApplication, sender : core.ObjCId) finish_launching_NSApplication : func(app : ^NSApplication) run_NSApplication : func(app : ^NSApplication) poll_events_NSApplication : func(app : ^NSApplication) update_windows_NSApplication : func(app : ^NSApplication) event_type_NSEvent : func(event : ^NSEvent) -> u64 location_in_window_NSEvent : func(event : ^NSEvent) -> NSPoint key_code_NSEvent : func(event : ^NSEvent) -> u64 modifier_flags_NSEvent : func(event : ^NSEvent) -> u64 characters_NSEvent : func(event : ^NSEvent) -> foundation.NSString stop_NSApplication : func(app : ^NSApplication, sender : core.ObjCId) terminate_NSApplication : func(app : ^NSApplication, sender : core.ObjCId) init_with_content_rect_NSWindow : func(window : ^NSWindow, rect : NSRect, style : NSWindowStyleMask, backing : NSBackingStoreType, defer_create : bool) -> NSWindow set_title_NSWindow : func(window : ^NSWindow, title : ^foundation.NSString) set_title_utf8_NSWindow : func(window : ^NSWindow, title : cstring) set_content_view_NSWindow : func(window : ^NSWindow, view : ^NSView) delegate_NSWindow : func(window : ^NSWindow) -> core.ObjCId set_delegate_NSWindow : func(window : ^NSWindow, delegate : core.ObjCId) set_content_min_size_NSWindow : func(window : ^NSWindow, size : NSSize) content_view_NSWindow : func(window : ^NSWindow) -> NSView display_NSWindow : func(window : ^NSWindow) set_released_when_closed_NSWindow : func(window : ^NSWindow, flag : bool) set_accepts_mouse_moved_events_NSWindow : func(window : ^NSWindow, flag : bool) set_collection_behavior_NSWindow : func(window : ^NSWindow, behavior : NSWindowCollectionBehavior) center_NSWindow : func(window : ^NSWindow) make_key_and_order_front_NSWindow : func(window : ^NSWindow, sender : core.ObjCId) order_front_NSWindow : func(window : ^NSWindow, sender : core.ObjCId) order_front_regardless_NSWindow : func(window : ^NSWindow) set_level_NSWindow : func(window : ^NSWindow, level : NSWindowLevel) is_visible_NSWindow : func(window : ^NSWindow) -> bool mouse_location_outside_event_stream_NSWindow : func(window : ^NSWindow) -> NSPoint backing_scale_factor_NSWindow : func(window : ^NSWindow) -> CGFloat close_NSWindow : func(window : ^NSWindow) release_NSWindow : func(window : ^NSWindow) init_NSView : func(view : ^NSView) -> NSView init_with_frame_NSView : func(view : ^NSView, rect : NSRect) -> NSView bounds_NSView : func(view : ^NSView) -> NSRect add_subview_NSView : func(view : ^NSView, subview : ^NSView) release_NSView : func(view : ^NSView) activate_with_options_NSRunningApplication : func(app : ^NSRunningApplication, options : NSApplicationActivationOptions) -> bool class_NSButton : func() -> core.ObjCClass alloc_NSButton : func() -> NSButton create_NSButton : func(title : cstring, target : core.ObjCId, action : core.ObjCSelector) -> NSButton create_NSButton : func(rect : NSRect) -> NSButton init_with_frame : func(self : ^NSButton, rect : NSRect) -> NSButton as_view : func(self : ^NSButton) -> NSView set_frame : func(self : ^NSButton, rect : NSRect) set_title : func(self : ^NSButton, title : ^foundation.NSString) set_title_utf8 : func(self : ^NSButton, title : cstring) set_target : func(self : ^NSButton, target : core.ObjCId) set_action : func(self : ^NSButton, action : core.ObjCSelector) set_button_type : func(self : ^NSButton, button_type : NSButtonType) set_bezel_style : func(self : ^NSButton, style : NSBezelStyle) set_state : func(self : ^NSButton, state : NSControlStateValue) set_enabled : func(self : ^NSButton, enabled : bool) deinit : func(self : ^NSButton) set_title_NSButton : func(button : ^NSButton, title : ^foundation.NSString) init_with_frame_NSButton : func(button : ^NSButton, rect : NSRect) -> NSButton as_view_NSButton : func(button : ^NSButton) -> NSView set_frame_NSButton : func(button : ^NSButton, rect : NSRect) set_title_utf8_NSButton : func(button : ^NSButton, title : cstring) set_target_NSButton : func(button : ^NSButton, target : core.ObjCId) set_action_NSButton : func(button : ^NSButton, action : core.ObjCSelector) set_button_type_NSButton : func(button : ^NSButton, button_type : NSButtonType) set_bezel_style_NSButton : func(button : ^NSButton, style : NSBezelStyle) set_state_NSButton : func(button : ^NSButton, state : NSControlStateValue) set_enabled_NSButton : func(button : ^NSButton, enabled : bool) release_NSButton : func(button : ^NSButton) class_NSMenu : func() -> core.ObjCClass class_NSMenuItem : func() -> core.ObjCClass alloc_NSMenu : func() -> NSMenu alloc_NSMenuItem : func() -> NSMenuItem create_NSMenu : func(title : cstring) -> NSMenu create_NSMenuItem : func(title : cstring, action : core.ObjCSelector, key_equivalent : cstring) -> NSMenuItem create_separator_NSMenuItem : func() -> NSMenuItem set_main_menu : func(self : ^NSApplication, menu : ^NSMenu) init_with_title : func(self : ^NSMenu, title : ^foundation.NSString) -> NSMenu init_with_title_utf8 : func(self : ^NSMenu, title : cstring) -> NSMenu add_item : func(self : ^NSMenu, item : ^NSMenuItem) add_item_with_title : func(self : ^NSMenu, title : cstring, action : core.ObjCSelector, key_equivalent : cstring) -> NSMenuItem set_submenu : func(self : ^NSMenu, submenu : ^NSMenu, item : ^NSMenuItem) deinit : func(self : ^NSMenu) set_title : func(self : ^NSMenuItem, title : ^foundation.NSString) set_title_utf8 : func(self : ^NSMenuItem, title : cstring) set_target : func(self : ^NSMenuItem, target : core.ObjCId) set_action : func(self : ^NSMenuItem, action : core.ObjCSelector) set_enabled : func(self : ^NSMenuItem, enabled : bool) deinit : func(self : ^NSMenuItem) set_main_menu_NSApplication : func(app : ^NSApplication, menu : ^NSMenu) init_with_title_NSMenu : func(menu : ^NSMenu, title : ^foundation.NSString) -> NSMenu init_with_title_utf8_NSMenu : func(menu : ^NSMenu, title : cstring) -> NSMenu add_item_NSMenu : func(menu : ^NSMenu, item : ^NSMenuItem) add_item_with_title_NSMenu : func(menu : ^NSMenu, title : cstring, action : core.ObjCSelector, key_equivalent : cstring) -> NSMenuItem set_submenu_NSMenu : func(menu : ^NSMenu, submenu : ^NSMenu, item : ^NSMenuItem) release_NSMenu : func(menu : ^NSMenu) set_title_NSMenuItem : func(item : ^NSMenuItem, title : ^foundation.NSString) set_title_utf8_NSMenuItem : func(item : ^NSMenuItem, title : cstring) set_target_NSMenuItem : func(item : ^NSMenuItem, target : core.ObjCId) set_action_NSMenuItem : func(item : ^NSMenuItem, action : core.ObjCSelector) set_enabled_NSMenuItem : func(item : ^NSMenuItem, enabled : bool) release_NSMenuItem : func(item : ^NSMenuItem) class_NSOpenPanel : func() -> core.ObjCClass NSOpenPanel : func() -> NSOpenPanel Returns AppKit's autoreleased panel for immediate modal use.
run_modal : func(self : ^NSOpenPanel) -> NSModalResponse set_can_choose_files : func(self : ^NSOpenPanel, enabled : bool) can_choose_files : func(self : ^NSOpenPanel) -> bool set_can_choose_directories : func(self : ^NSOpenPanel, enabled : bool) can_choose_directories : func(self : ^NSOpenPanel) -> bool set_allows_multiple_selection : func(self : ^NSOpenPanel, enabled : bool) allows_multiple_selection : func(self : ^NSOpenPanel) -> bool set_can_create_directories : func(self : ^NSOpenPanel, enabled : bool) can_create_directories : func(self : ^NSOpenPanel) -> bool set_resolves_aliases : func(self : ^NSOpenPanel, enabled : bool) resolves_aliases : func(self : ^NSOpenPanel) -> bool set_allowed_file_types : func(self : ^NSOpenPanel, file_types : ^foundation.NSArray) allowed_file_types : func(self : ^NSOpenPanel) -> foundation.NSArray set_directory_url : func(self : ^NSOpenPanel, url : ^foundation.NSURL) directory_url : func(self : ^NSOpenPanel) -> foundation.NSURL url : func(self : ^NSOpenPanel) -> foundation.NSURL urls : func(self : ^NSOpenPanel) -> foundation.NSArray run_modal_NSOpenPanel : func(panel : ^NSOpenPanel) -> NSModalResponse set_can_choose_files_NSOpenPanel : func(panel : ^NSOpenPanel, enabled : bool) can_choose_files_NSOpenPanel : func(panel : ^NSOpenPanel) -> bool set_can_choose_directories_NSOpenPanel : func(panel : ^NSOpenPanel, enabled : bool) can_choose_directories_NSOpenPanel : func(panel : ^NSOpenPanel) -> bool set_allows_multiple_selection_NSOpenPanel : func(panel : ^NSOpenPanel, enabled : bool) allows_multiple_selection_NSOpenPanel : func(panel : ^NSOpenPanel) -> bool set_can_create_directories_NSOpenPanel : func(panel : ^NSOpenPanel, enabled : bool) can_create_directories_NSOpenPanel : func(panel : ^NSOpenPanel) -> bool set_resolves_aliases_NSOpenPanel : func(panel : ^NSOpenPanel, enabled : bool) resolves_aliases_NSOpenPanel : func(panel : ^NSOpenPanel) -> bool set_allowed_file_types_NSOpenPanel : func(panel : ^NSOpenPanel, file_types : ^foundation.NSArray) allowed_file_types_NSOpenPanel : func(panel : ^NSOpenPanel) -> foundation.NSArray set_directory_url_NSOpenPanel : func(panel : ^NSOpenPanel, url : ^foundation.NSURL) directory_url_NSOpenPanel : func(panel : ^NSOpenPanel) -> foundation.NSURL url_NSOpenPanel : func(panel : ^NSOpenPanel) -> foundation.NSURL urls_NSOpenPanel : func(panel : ^NSOpenPanel) -> foundation.NSArray