NSWindow.odin 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  1. package objc_Foundation
  2. import "core:strings"
  3. import "base:runtime"
  4. import "base:intrinsics"
  5. Rect :: struct {
  6. using origin: Point,
  7. using size: Size,
  8. }
  9. Depth :: enum UInteger {
  10. onehundredtwentyeightBitRGB = 544,
  11. sixtyfourBitRGB = 528,
  12. twentyfourBitRGB = 520,
  13. }
  14. when size_of(Float) == 8 {
  15. _RECT_ENCODING :: "{CGRect="+_POINT_ENCODING+_SIZE_ENCODING+"}"
  16. } else {
  17. _RECT_ENCODING :: "{NSRect="+_POINT_ENCODING+_SIZE_ENCODING+"}"
  18. }
  19. WindowStyleFlag :: enum UInteger {
  20. Titled = 0,
  21. Closable = 1,
  22. Miniaturizable = 2,
  23. Resizable = 3,
  24. TexturedBackground = 8,
  25. UnifiedTitleAndToolbar = 12,
  26. FullScreen = 14,
  27. FullSizeContentView = 15,
  28. UtilityWindow = 4,
  29. DocModalWindow = 6,
  30. NonactivatingPanel = 7,
  31. HUDWindow = 13,
  32. }
  33. WindowStyleMask :: distinct bit_set[WindowStyleFlag; UInteger]
  34. WindowStyleMaskBorderless :: WindowStyleMask{}
  35. WindowStyleMaskTitled :: WindowStyleMask{.Titled}
  36. WindowStyleMaskClosable :: WindowStyleMask{.Closable}
  37. WindowStyleMaskMiniaturizable :: WindowStyleMask{.Miniaturizable}
  38. WindowStyleMaskResizable :: WindowStyleMask{.Resizable}
  39. WindowStyleMaskTexturedBackground :: WindowStyleMask{.TexturedBackground}
  40. WindowStyleMaskUnifiedTitleAndToolbar :: WindowStyleMask{.UnifiedTitleAndToolbar}
  41. WindowStyleMaskFullScreen :: WindowStyleMask{.FullScreen}
  42. WindowStyleMaskFullSizeContentView :: WindowStyleMask{.FullSizeContentView}
  43. WindowStyleMaskUtilityWindow :: WindowStyleMask{.UtilityWindow}
  44. WindowStyleMaskDocModalWindow :: WindowStyleMask{.DocModalWindow}
  45. WindowStyleMaskNonactivatingPanel :: WindowStyleMask{.NonactivatingPanel}
  46. WindowStyleMaskHUDWindow :: WindowStyleMask{.HUDWindow}
  47. BackingStoreType :: enum UInteger {
  48. Retained = 0,
  49. Nonretained = 1,
  50. Buffered = 2,
  51. }
  52. WindowDelegateTemplate :: struct {
  53. // Managing Sheets
  54. windowWillPositionSheetUsingRect: proc(window: ^Window, sheet: ^Window, rect: Rect) -> Rect,
  55. windowWillBeginSheet: proc(notification: ^Notification),
  56. windowDidEndSheet: proc(notification: ^Notification),
  57. // Sizing Windows
  58. windowWillResizeToSize: proc(sender: ^Window, frameSize: Size) -> Size,
  59. windowDidResize: proc(notification: ^Notification),
  60. windowWillStartLiveResize: proc(noitifcation: ^Notification),
  61. windowDidEndLiveResize: proc(notification: ^Notification),
  62. // Minimizing Windows
  63. windowWillMiniaturize: proc(notification: ^Notification),
  64. windowDidMiniaturize: proc(notification: ^Notification),
  65. windowDidDeminiaturize: proc(notification: ^Notification),
  66. // Zooming window
  67. windowWillUseStandardFrameDefaultFrame: proc(window: ^Window, newFrame: Rect) -> Rect,
  68. windowShouldZoomToFrame: proc(window: ^Window, newFrame: Rect) -> BOOL,
  69. // Managing Full-Screen Presentation
  70. windowWillUseFullScreenContentSize: proc(window: ^Window, proposedSize: Size) -> Size,
  71. windowWillUseFullScreenPresentationOptions: proc(window: ^Window, proposedOptions: ApplicationPresentationOptions) -> ApplicationPresentationOptions,
  72. windowWillEnterFullScreen: proc(notification: ^Notification),
  73. windowDidEnterFullScreen: proc(notification: ^Notification),
  74. windowWillExitFullScreen: proc(notification: ^Notification),
  75. windowDidExitFullScreen: proc(notification: ^Notification),
  76. // Custom Full-Screen Presentation Animations
  77. customWindowsToEnterFullScreenForWindow: proc(window: ^Window) -> ^Array,
  78. customWindowsToEnterFullScreenForWindowOnScreen: proc(window: ^Window, screen: ^Screen) -> ^Array,
  79. windowStartCustomAnimationToEnterFullScreenWithDuration: proc(window: ^Window, duration: TimeInterval),
  80. windowStartCustomAnimationToEnterFullScreenOnScreenWithDuration: proc(window: ^Window, screen: ^Screen, duration: TimeInterval),
  81. windowDidFailToEnterFullScreen: proc(window: ^Window),
  82. customWindowsToExitFullScreenForWindow: proc(window: ^Window) -> ^Array,
  83. windowStartCustomAnimationToExitFullScreenWithDuration: proc(window: ^Window, duration: TimeInterval),
  84. windowDidFailToExitFullScreen: proc(window: ^Window),
  85. // Moving Windows
  86. windowWillMove: proc(notification: ^Notification),
  87. windowDidMove: proc(notification: ^Notification),
  88. windowDidChangeScreen: proc(notification: ^Notification),
  89. windowDidChangeScreenProfile: proc(notification: ^Notification),
  90. windowDidChangeBackingProperties: proc(notification: ^Notification),
  91. // Closing Windows
  92. windowShouldClose: proc(sender: ^Window) -> BOOL,
  93. windowWillClose: proc(notification: ^Notification),
  94. // Managing Key Status
  95. windowDidBecomeKey: proc(notification: ^Notification),
  96. windowDidResignKey: proc(notification: ^Notification),
  97. // Managing Main Status
  98. windowDidBecomeMain: proc(notification: ^Notification),
  99. windowDidResignMain: proc(notification: ^Notification),
  100. // Managing Field Editors
  101. windowWillReturnFieldEditorToObject: proc(sender: ^Window, client: id) -> id,
  102. // Updating Windows
  103. windowDidUpdate: proc (notification: ^Notification),
  104. // Exposing Windows
  105. windowDidExpose: proc (notification: ^Notification),
  106. // Managing Occlusion State
  107. windowDidChangeOcclusionState: proc(notification: ^Notification),
  108. // Dragging Windows
  109. windowShouldDragDocumentWithEventFromWithPasteboard: proc(window: ^Window, event: ^Event, dragImageLocation: Point, pasteboard: ^Pasteboard) -> BOOL,
  110. // Getting the Undo Manager
  111. windowWillReturnUndoManager: proc(window: ^Window) -> ^UndoManager,
  112. // Managing Titles
  113. windowShouldPopUpDocumentPathMenu: proc(window: ^Window, menu: ^Menu) -> BOOL,
  114. // Managing Restorable State
  115. windowWillEncodeRestorableState: proc(window: ^Window, state: ^Coder),
  116. windowDidEncodeRestorableState: proc(window: ^Window, state: ^Coder),
  117. // Managing Presentation in Version Browsers
  118. windowWillResizeForVersionBrowserWithMaxPreferredSizeMaxAllowedSize: proc(window: ^Window, maxPreferredFrameSize: Size, maxAllowedFrameSize: Size) -> Size,
  119. windowWillEnterVersionBrowser: proc(notification: ^Notification),
  120. windowDidEnterVersionBrowser: proc(notification: ^Notification),
  121. windowWillExitVersionBrowser: proc(notification: ^Notification),
  122. windowDidExitVersionBrowser: proc(notification: ^Notification),
  123. }
  124. Window_Title_Visibility :: enum UInteger {
  125. Visible,
  126. Hidden,
  127. }
  128. WindowDelegate :: struct { using _: Object } // This is not the same as NSWindowDelegate
  129. _WindowDelegateInternal :: struct {
  130. using _: WindowDelegateTemplate,
  131. _context: runtime.Context,
  132. }
  133. window_delegate_register_and_alloc :: proc(template: WindowDelegateTemplate, class_name: string, delegate_context: Maybe(runtime.Context)) -> ^WindowDelegate {
  134. class := objc_allocateClassPair(intrinsics.objc_find_class("NSObject"), strings.clone_to_cstring(class_name, context.temp_allocator), 0); if class == nil {
  135. // Class already registered
  136. return nil
  137. }
  138. if template.windowWillPositionSheetUsingRect != nil {
  139. windowWillPositionSheetUsingRect :: proc "c" (self: id, cmd: SEL, window: ^Window, sheet: ^Window, rect: Rect) -> Rect {
  140. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  141. context = del._context
  142. return del.windowWillPositionSheetUsingRect(window, sheet, rect)
  143. }
  144. class_addMethod(class, intrinsics.objc_find_selector("window:willPositionSheet:usingRect:"), auto_cast windowWillPositionSheetUsingRect, _RECT_ENCODING+"@:@@"+_RECT_ENCODING)
  145. }
  146. if template.windowWillBeginSheet != nil {
  147. windowWillBeginSheet :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  148. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  149. context = del._context
  150. del.windowWillBeginSheet(notification)
  151. }
  152. class_addMethod(class, intrinsics.objc_find_selector("windowWillBeginSheet:"), auto_cast windowWillBeginSheet, "v@:@")
  153. }
  154. if template.windowDidEndSheet != nil {
  155. windowDidEndSheet :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  156. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  157. context = del._context
  158. del.windowDidEndSheet(notification)
  159. }
  160. class_addMethod(class, intrinsics.objc_find_selector("windowDidEndSheet:"), auto_cast windowDidEndSheet, "v@:@")
  161. }
  162. if template.windowWillResizeToSize != nil {
  163. windowWillResizeToSize :: proc "c" (self: id, cmd: SEL, sender: ^Window, frameSize: Size) -> Size {
  164. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  165. context = del._context
  166. return del.windowWillResizeToSize(sender, frameSize)
  167. }
  168. class_addMethod(class, intrinsics.objc_find_selector("windowWillResize:toSize:"), auto_cast windowWillResizeToSize, _SIZE_ENCODING+"@:@"+_SIZE_ENCODING)
  169. }
  170. if template.windowDidResize != nil {
  171. windowDidResize :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  172. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  173. context = del._context
  174. del.windowDidResize(notification)
  175. }
  176. class_addMethod(class, intrinsics.objc_find_selector("windowDidResize:"), auto_cast windowDidResize, "v@:@")
  177. }
  178. if template.windowWillStartLiveResize != nil {
  179. windowWillStartLiveResize :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  180. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  181. context = del._context
  182. del.windowWillStartLiveResize(notification)
  183. }
  184. class_addMethod(class, intrinsics.objc_find_selector("windowWillStartLiveResize:"), auto_cast windowWillStartLiveResize, "v@:@")
  185. }
  186. if template.windowDidEndLiveResize != nil {
  187. windowDidEndLiveResize :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  188. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  189. context = del._context
  190. del.windowDidEndLiveResize(notification)
  191. }
  192. class_addMethod(class, intrinsics.objc_find_selector("windowDidEndLiveResize:"), auto_cast windowDidEndLiveResize, "v@:@")
  193. }
  194. if template.windowWillMiniaturize != nil {
  195. windowWillMiniaturize :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  196. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  197. context = del._context
  198. del.windowWillMiniaturize(notification)
  199. }
  200. class_addMethod(class, intrinsics.objc_find_selector("windowWillMiniaturize:"), auto_cast windowWillMiniaturize, "v@:@")
  201. }
  202. if template.windowDidMiniaturize != nil {
  203. windowDidMiniaturize :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  204. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  205. context = del._context
  206. del.windowDidMiniaturize(notification)
  207. }
  208. class_addMethod(class, intrinsics.objc_find_selector("windowDidMiniaturize:"), auto_cast windowDidMiniaturize, "v@:@")
  209. }
  210. if template.windowDidDeminiaturize != nil {
  211. windowDidDeminiaturize :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  212. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  213. context = del._context
  214. del.windowDidDeminiaturize(notification)
  215. }
  216. class_addMethod(class, intrinsics.objc_find_selector("windowDidDeminiaturize:"), auto_cast windowDidDeminiaturize, "v@:@")
  217. }
  218. if template.windowWillUseStandardFrameDefaultFrame != nil {
  219. windowWillUseStandardFrameDefaultFrame :: proc(self: id, cmd: SEL, window: ^Window, newFrame: Rect) -> Rect {
  220. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  221. context = del._context
  222. return del.windowWillUseStandardFrameDefaultFrame(window, newFrame)
  223. }
  224. class_addMethod(class, intrinsics.objc_find_selector("windowWillUseStandardFrame:defaultFrame:"), auto_cast windowWillUseStandardFrameDefaultFrame, _RECT_ENCODING+"@:@"+_RECT_ENCODING)
  225. }
  226. if template.windowShouldZoomToFrame != nil {
  227. windowShouldZoomToFrame :: proc "c" (self: id, cmd: SEL, window: ^Window, newFrame: Rect) -> BOOL {
  228. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  229. context = del._context
  230. return del.windowShouldZoomToFrame(window, newFrame)
  231. }
  232. class_addMethod(class, intrinsics.objc_find_selector("windowShouldZoom:toFrame:"), auto_cast windowShouldZoomToFrame, "B@:@"+_RECT_ENCODING)
  233. }
  234. if template.windowWillUseFullScreenContentSize != nil {
  235. windowWillUseFullScreenContentSize :: proc "c" (self: id, cmd: SEL, window: ^Window, proposedSize: Size) -> Size {
  236. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  237. context = del._context
  238. return del.windowWillUseFullScreenContentSize(window, proposedSize)
  239. }
  240. class_addMethod(class, intrinsics.objc_find_selector("window:willUseFullScreenContentSize:"), auto_cast windowWillUseFullScreenContentSize, _SIZE_ENCODING+"@:@"+_SIZE_ENCODING)
  241. }
  242. if template.windowWillUseFullScreenPresentationOptions != nil {
  243. windowWillUseFullScreenPresentationOptions :: proc(self: id, cmd: SEL, window: ^Window, proposedOptions: ApplicationPresentationOptions) -> ApplicationPresentationOptions {
  244. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  245. context = del._context
  246. return del.windowWillUseFullScreenPresentationOptions(window, proposedOptions)
  247. }
  248. class_addMethod(class, intrinsics.objc_find_selector("window:willUseFullScreenPresentationOptions:"), auto_cast windowWillUseFullScreenPresentationOptions, _UINTEGER_ENCODING+"@:@"+_UINTEGER_ENCODING)
  249. }
  250. if template.windowWillEnterFullScreen != nil {
  251. windowWillEnterFullScreen :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  252. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  253. context = del._context
  254. del.windowWillEnterFullScreen(notification)
  255. }
  256. class_addMethod(class, intrinsics.objc_find_selector("windowWillEnterFullScreen:"), auto_cast windowWillEnterFullScreen, "v@:@")
  257. }
  258. if template.windowDidEnterFullScreen != nil {
  259. windowDidEnterFullScreen :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  260. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  261. context = del._context
  262. del.windowDidEnterFullScreen(notification)
  263. }
  264. class_addMethod(class, intrinsics.objc_find_selector("windowDidEnterFullScreen:"), auto_cast windowDidEnterFullScreen, "v@:@")
  265. }
  266. if template.windowWillExitFullScreen != nil {
  267. windowWillExitFullScreen :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  268. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  269. context = del._context
  270. del.windowWillExitFullScreen(notification)
  271. }
  272. class_addMethod(class, intrinsics.objc_find_selector("windowWillExitFullScreen:"), auto_cast windowWillExitFullScreen, "v@:@")
  273. }
  274. if template.windowDidExitFullScreen != nil {
  275. windowDidExitFullScreen :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  276. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  277. context = del._context
  278. del.windowDidExitFullScreen(notification)
  279. }
  280. class_addMethod(class, intrinsics.objc_find_selector("windowDidExitFullScreen:"), auto_cast windowDidExitFullScreen, "v@:@")
  281. }
  282. if template.customWindowsToEnterFullScreenForWindow != nil {
  283. customWindowsToEnterFullScreenForWindow :: proc "c" (self: id, cmd: SEL, window: ^Window) -> ^Array {
  284. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  285. context = del._context
  286. return del.customWindowsToEnterFullScreenForWindow(window)
  287. }
  288. class_addMethod(class, intrinsics.objc_find_selector("customWindowsToEnterFullScreenForWindow:"), auto_cast customWindowsToEnterFullScreenForWindow, "@@:@")
  289. }
  290. if template.customWindowsToEnterFullScreenForWindowOnScreen != nil {
  291. customWindowsToEnterFullScreenForWindowOnScreen :: proc(self: id, cmd: SEL, window: ^Window, screen: ^Screen) -> ^Array {
  292. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  293. context = del._context
  294. return del.customWindowsToEnterFullScreenForWindowOnScreen(window, screen)
  295. }
  296. class_addMethod(class, intrinsics.objc_find_selector("customWindowsToEnterFullScreenForWindow:onScreen:"), auto_cast customWindowsToEnterFullScreenForWindowOnScreen, "@@:@@")
  297. }
  298. if template.windowStartCustomAnimationToEnterFullScreenWithDuration != nil {
  299. windowStartCustomAnimationToEnterFullScreenWithDuration :: proc "c" (self: id, cmd: SEL, window: ^Window, duration: TimeInterval) {
  300. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  301. context = del._context
  302. del.windowStartCustomAnimationToEnterFullScreenWithDuration(window, duration)
  303. }
  304. class_addMethod(class, intrinsics.objc_find_selector("window:startCustomAnimationToEnterFullScreenWithDuration:"), auto_cast windowStartCustomAnimationToEnterFullScreenWithDuration, "v@:@@")
  305. }
  306. if template.windowStartCustomAnimationToEnterFullScreenOnScreenWithDuration != nil {
  307. windowStartCustomAnimationToEnterFullScreenOnScreenWithDuration :: proc(self: id, cmd: SEL, window: ^Window, screen: ^Screen, duration: TimeInterval) {
  308. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  309. context = del._context
  310. del.windowStartCustomAnimationToEnterFullScreenOnScreenWithDuration(window, screen, duration)
  311. }
  312. class_addMethod(class, intrinsics.objc_find_selector("window:startCustomAnimationToEnterFullScreenOnScreen:withDuration:"), auto_cast windowStartCustomAnimationToEnterFullScreenOnScreenWithDuration, "v@:@@d")
  313. }
  314. if template.windowDidFailToEnterFullScreen != nil {
  315. windowDidFailToEnterFullScreen :: proc "c" (self: id, cmd: SEL, window: ^Window) {
  316. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  317. context = del._context
  318. del.windowDidFailToEnterFullScreen(window)
  319. }
  320. class_addMethod(class, intrinsics.objc_find_selector("windowDidFailToEnterFullScreen:"), auto_cast windowDidFailToEnterFullScreen, "v@:@")
  321. }
  322. if template.customWindowsToExitFullScreenForWindow != nil {
  323. customWindowsToExitFullScreenForWindow :: proc "c" (self: id, cmd: SEL, window: ^Window) -> ^Array {
  324. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  325. context = del._context
  326. return del.customWindowsToExitFullScreenForWindow(window)
  327. }
  328. class_addMethod(class, intrinsics.objc_find_selector("customWindowsToExitFullScreenForWindow:"), auto_cast customWindowsToExitFullScreenForWindow, "@@:@")
  329. }
  330. if template.windowStartCustomAnimationToExitFullScreenWithDuration != nil {
  331. windowStartCustomAnimationToExitFullScreenWithDuration :: proc "c" (self: id, cmd: SEL, window: ^Window, duration: TimeInterval) {
  332. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  333. context = del._context
  334. del.windowStartCustomAnimationToExitFullScreenWithDuration(window, duration)
  335. }
  336. class_addMethod(class, intrinsics.objc_find_selector("window:startCustomAnimationToExitFullScreenWithDuration:"), auto_cast windowStartCustomAnimationToExitFullScreenWithDuration, "v@:@d")
  337. }
  338. if template.windowDidFailToExitFullScreen != nil {
  339. windowDidFailToExitFullScreen :: proc "c" (self: id, cmd: SEL, window: ^Window) {
  340. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  341. context = del._context
  342. del.windowDidFailToExitFullScreen(window)
  343. }
  344. class_addMethod(class, intrinsics.objc_find_selector("windowDidFailToExitFullScreen:"), auto_cast windowDidFailToExitFullScreen, "v@:@")
  345. }
  346. if template.windowWillMove != nil {
  347. windowWillMove :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  348. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  349. context = del._context
  350. del.windowWillMove(notification)
  351. }
  352. class_addMethod(class, intrinsics.objc_find_selector("windowWillMove:"), auto_cast windowWillMove, "v@:@")
  353. }
  354. if template.windowDidMove != nil {
  355. windowDidMove :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  356. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  357. context = del._context
  358. del.windowDidMove(notification)
  359. }
  360. class_addMethod(class, intrinsics.objc_find_selector("windowDidMove:"), auto_cast windowDidMove, "v@:@")
  361. }
  362. if template.windowDidChangeScreen != nil {
  363. windowDidChangeScreen :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  364. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  365. context = del._context
  366. del.windowDidChangeScreen(notification)
  367. }
  368. class_addMethod(class, intrinsics.objc_find_selector("windowDidChangeScreen:"), auto_cast windowDidChangeScreen, "v@:@")
  369. }
  370. if template.windowDidChangeScreenProfile != nil {
  371. windowDidChangeScreenProfile :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  372. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  373. context = del._context
  374. del.windowDidChangeScreenProfile(notification)
  375. }
  376. class_addMethod(class, intrinsics.objc_find_selector("windowDidChangeScreenProfile:"), auto_cast windowDidChangeScreenProfile, "v@:@")
  377. }
  378. if template.windowDidChangeBackingProperties != nil {
  379. windowDidChangeBackingProperties :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  380. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  381. context = del._context
  382. del.windowDidChangeBackingProperties(notification)
  383. }
  384. class_addMethod(class, intrinsics.objc_find_selector("windowDidChangeBackingProperties:"), auto_cast windowDidChangeBackingProperties, "v@:@")
  385. }
  386. if template.windowShouldClose != nil {
  387. windowShouldClose :: proc "c" (self:id, cmd: SEL, sender: ^Window) -> BOOL {
  388. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  389. context = del._context
  390. return del.windowShouldClose(sender)
  391. }
  392. class_addMethod(class, intrinsics.objc_find_selector("windowShouldClose:"), auto_cast windowShouldClose, "B@:@")
  393. }
  394. if template.windowWillClose != nil {
  395. windowWillClose :: proc "c" (self:id, cmd: SEL, notification: ^Notification) {
  396. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  397. context = del._context
  398. del.windowWillClose(notification)
  399. }
  400. class_addMethod(class, intrinsics.objc_find_selector("windowWillClose:"), auto_cast windowWillClose, "v@:@")
  401. }
  402. if template.windowDidBecomeKey != nil {
  403. windowDidBecomeKey :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  404. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  405. context = del._context
  406. del.windowDidBecomeKey(notification)
  407. }
  408. class_addMethod(class, intrinsics.objc_find_selector("windowDidBecomeKey:"), auto_cast windowDidBecomeKey, "v@:@")
  409. }
  410. if template.windowDidResignKey != nil {
  411. windowDidResignKey :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  412. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  413. context = del._context
  414. del.windowDidResignKey(notification)
  415. }
  416. class_addMethod(class, intrinsics.objc_find_selector("windowDidResignKey:"), auto_cast windowDidResignKey, "v@:@")
  417. }
  418. if template.windowDidBecomeMain != nil {
  419. windowDidBecomeMain :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  420. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  421. context = del._context
  422. del.windowDidBecomeMain(notification)
  423. }
  424. class_addMethod(class, intrinsics.objc_find_selector("windowDidBecomeMain:"), auto_cast windowDidBecomeMain, "v@:@")
  425. }
  426. if template.windowDidResignMain != nil {
  427. windowDidResignMain :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  428. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  429. context = del._context
  430. del.windowDidResignMain(notification)
  431. }
  432. class_addMethod(class, intrinsics.objc_find_selector("windowDidResignMain:"), auto_cast windowDidResignMain, "v@:@")
  433. }
  434. if template.windowWillReturnFieldEditorToObject != nil {
  435. windowWillReturnFieldEditorToObject :: proc "c" (self:id, cmd: SEL, sender: ^Window, client: id) -> id {
  436. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  437. context = del._context
  438. return del.windowWillReturnFieldEditorToObject(sender, client)
  439. }
  440. class_addMethod(class, intrinsics.objc_find_selector("windowWillReturnFieldEditor:toObject:"), auto_cast windowWillReturnFieldEditorToObject, "@@:@@")
  441. }
  442. if template.windowDidUpdate != nil {
  443. windowDidUpdate :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  444. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  445. context = del._context
  446. del.windowDidUpdate(notification)
  447. }
  448. class_addMethod(class, intrinsics.objc_find_selector("windowDidUpdate:"), auto_cast windowDidUpdate, "v@:@")
  449. }
  450. if template.windowDidExpose != nil {
  451. windowDidExpose :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  452. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  453. context = del._context
  454. del.windowDidExpose(notification)
  455. }
  456. class_addMethod(class, intrinsics.objc_find_selector("windowDidExpose:"), auto_cast windowDidExpose, "v@:@")
  457. }
  458. if template.windowDidChangeOcclusionState != nil {
  459. windowDidChangeOcclusionState :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  460. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  461. context = del._context
  462. del.windowDidChangeOcclusionState(notification)
  463. }
  464. class_addMethod(class, intrinsics.objc_find_selector("windowDidChangeOcclusionState:"), auto_cast windowDidChangeOcclusionState, "v@:@")
  465. }
  466. if template.windowShouldDragDocumentWithEventFromWithPasteboard != nil {
  467. windowShouldDragDocumentWithEventFromWithPasteboard :: proc "c" (self: id, cmd: SEL, window: ^Window, event: ^Event, dragImageLocation: Point, pasteboard: ^Pasteboard) -> BOOL {
  468. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  469. context = del._context
  470. return del.windowShouldDragDocumentWithEventFromWithPasteboard(window, event, dragImageLocation, pasteboard)
  471. }
  472. class_addMethod(class, intrinsics.objc_find_selector("window:shouldDragDocumentWithEvent:from:withPasteboard:"), auto_cast windowShouldDragDocumentWithEventFromWithPasteboard, "B@:@@"+_POINT_ENCODING+"@")
  473. }
  474. if template.windowWillReturnUndoManager != nil {
  475. windowWillReturnUndoManager :: proc "c" (self: id, cmd: SEL, window: ^Window) -> ^UndoManager {
  476. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  477. context = del._context
  478. return del.windowWillReturnUndoManager(window)
  479. }
  480. class_addMethod(class, intrinsics.objc_find_selector("windowWillReturnUndoManager:"), auto_cast windowWillReturnUndoManager, "@@:@")
  481. }
  482. if template.windowShouldPopUpDocumentPathMenu != nil {
  483. windowShouldPopUpDocumentPathMenu :: proc "c" (self: id, cmd: SEL, window: ^Window, menu: ^Menu) -> BOOL {
  484. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  485. context = del._context
  486. return del.windowShouldPopUpDocumentPathMenu(window, menu)
  487. }
  488. class_addMethod(class, intrinsics.objc_find_selector("window:shouldPopUpDocumentPathMenu:"), auto_cast windowShouldPopUpDocumentPathMenu, "B@:@@")
  489. }
  490. if template.windowWillEncodeRestorableState != nil {
  491. windowWillEncodeRestorableState :: proc "c" (self: id, cmd: SEL, window: ^Window, state: ^Coder) {
  492. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  493. context = del._context
  494. del.windowWillEncodeRestorableState(window, state)
  495. }
  496. class_addMethod(class, intrinsics.objc_find_selector("window:willEncodeRestorableState:"), auto_cast windowWillEncodeRestorableState, "v@:@@")
  497. }
  498. if template.windowDidEncodeRestorableState != nil {
  499. windowDidEncodeRestorableState :: proc "c" (self: id, cmd: SEL, window: ^Window, state: ^Coder) {
  500. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  501. context = del._context
  502. del.windowDidEncodeRestorableState(window, state)
  503. }
  504. class_addMethod(class, intrinsics.objc_find_selector("window:didDecodeRestorableState:"), auto_cast windowDidEncodeRestorableState, "v@:@@")
  505. }
  506. if template.windowWillResizeForVersionBrowserWithMaxPreferredSizeMaxAllowedSize != nil {
  507. windowWillResizeForVersionBrowserWithMaxPreferredSizeMaxAllowedSize :: proc "c" (self: id, cmd: SEL, window: ^Window, maxPreferredFrameSize: Size, maxAllowedFrameSize: Size) -> Size {
  508. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  509. context = del._context
  510. return del.windowWillResizeForVersionBrowserWithMaxPreferredSizeMaxAllowedSize(window, maxPreferredFrameSize, maxPreferredFrameSize)
  511. }
  512. class_addMethod(class, intrinsics.objc_find_selector("window:willResizeForVersionBrowserWithMaxPreferredSize:maxAllowedSize:"), auto_cast windowWillResizeForVersionBrowserWithMaxPreferredSizeMaxAllowedSize, _SIZE_ENCODING+"@:@"+_SIZE_ENCODING+_SIZE_ENCODING)
  513. }
  514. if template.windowWillEnterVersionBrowser != nil {
  515. windowWillEnterVersionBrowser :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  516. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  517. context = del._context
  518. del.windowWillEnterVersionBrowser(notification)
  519. }
  520. class_addMethod(class, intrinsics.objc_find_selector("windowWillEnterVersionBrowser:"), auto_cast windowWillEnterVersionBrowser, "v@:@")
  521. }
  522. if template.windowDidEnterVersionBrowser != nil {
  523. windowDidEnterVersionBrowser :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  524. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  525. context = del._context
  526. del.windowDidEnterVersionBrowser(notification)
  527. }
  528. class_addMethod(class, intrinsics.objc_find_selector("windowDidEnterVersionBrowser:"), auto_cast windowDidEnterVersionBrowser, "v@:@")
  529. }
  530. if template.windowWillExitVersionBrowser != nil {
  531. windowWillExitVersionBrowser :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  532. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  533. context = del._context
  534. del.windowWillExitVersionBrowser(notification)
  535. }
  536. class_addMethod(class, intrinsics.objc_find_selector("windowWillExitVersionBrowser:"), auto_cast windowWillExitVersionBrowser, "v@:@")
  537. }
  538. if template.windowDidExitVersionBrowser != nil {
  539. windowDidExitVersionBrowser :: proc "c" (self: id, cmd: SEL, notification: ^Notification) {
  540. del := cast(^_WindowDelegateInternal)object_getIndexedIvars(self)
  541. context = del._context
  542. del.windowDidExitVersionBrowser(notification)
  543. }
  544. class_addMethod(class, intrinsics.objc_find_selector("windowDidExitVersionBrowser:"), auto_cast windowDidExitVersionBrowser, "v@:@")
  545. }
  546. objc_registerClassPair(class)
  547. del := class_createInstance(class, size_of(_WindowDelegateInternal))
  548. del_internal := cast(^_WindowDelegateInternal)object_getIndexedIvars(del)
  549. del_internal^ = {
  550. template,
  551. delegate_context.(runtime.Context) or_else runtime.default_context(),
  552. }
  553. return cast(^WindowDelegate)del
  554. }
  555. @(objc_class="CALayer")
  556. Layer :: struct { using _: Object }
  557. @(objc_type=Layer, objc_name="contents")
  558. Layer_contents :: proc "c" (self: ^Layer) -> rawptr {
  559. return msgSend(rawptr, self, "contents")
  560. }
  561. @(objc_type=Layer, objc_name="setContents")
  562. Layer_setContents :: proc "c" (self: ^Layer, contents: rawptr) {
  563. msgSend(nil, self, "setContents:", contents)
  564. }
  565. @(objc_type=Layer, objc_name="contentsScale")
  566. Layer_contentsScale :: proc "c" (self: ^Layer) -> Float {
  567. return msgSend(Float, self, "contentsScale")
  568. }
  569. @(objc_type=Layer, objc_name="setContentsScale")
  570. Layer_setContentsScale :: proc "c" (self: ^Layer, scale: Float) {
  571. msgSend(nil, self, "setContentsScale:", scale)
  572. }
  573. @(objc_type=Layer, objc_name="frame")
  574. Layer_frame :: proc "c" (self: ^Layer) -> Rect {
  575. return msgSend(Rect, self, "frame")
  576. }
  577. @(objc_type=Layer, objc_name="addSublayer")
  578. Layer_addSublayer :: proc "c" (self: ^Layer, layer: ^Layer) {
  579. msgSend(nil, self, "addSublayer:", layer)
  580. }
  581. @(objc_class="NSResponder")
  582. Responder :: struct {using _: Object}
  583. @(objc_class="NSView")
  584. View :: struct {using _: Responder}
  585. @(objc_type=View, objc_name="initWithFrame")
  586. View_initWithFrame :: proc "c" (self: ^View, frame: Rect) -> ^View {
  587. return msgSend(^View, self, "initWithFrame:", frame)
  588. }
  589. @(objc_type=View, objc_name="bounds")
  590. View_bounds :: proc "c" (self: ^View) -> Rect {
  591. return msgSend(Rect, self, "bounds")
  592. }
  593. @(objc_type=View, objc_name="layer")
  594. View_layer :: proc "c" (self: ^View) -> ^Layer {
  595. return msgSend(^Layer, self, "layer")
  596. }
  597. @(objc_type=View, objc_name="setLayer")
  598. View_setLayer :: proc "c" (self: ^View, layer: ^Layer) {
  599. msgSend(nil, self, "setLayer:", layer)
  600. }
  601. @(objc_type=View, objc_name="wantsLayer")
  602. View_wantsLayer :: proc "c" (self: ^View) -> BOOL {
  603. return msgSend(BOOL, self, "wantsLayer")
  604. }
  605. @(objc_type=View, objc_name="setWantsLayer")
  606. View_setWantsLayer :: proc "c" (self: ^View, wantsLayer: BOOL) {
  607. msgSend(nil, self, "setWantsLayer:", wantsLayer)
  608. }
  609. @(objc_type=View, objc_name="convertPointFromView")
  610. View_convertPointFromView :: proc "c" (self: ^View, point: Point, view: ^View) -> Point {
  611. return msgSend(Point, self, "convertPoint:fromView:", point, view)
  612. }
  613. @(objc_type=View, objc_name="addSubview")
  614. View_addSubview :: proc "c" (self: ^View, view: ^View) {
  615. msgSend(nil, self, "addSubview:", view)
  616. }
  617. @(objc_class="NSWindow")
  618. Window :: struct {using _: Responder}
  619. @(objc_type=Window, objc_name="alloc", objc_is_class_method=true)
  620. Window_alloc :: proc "c" () -> ^Window {
  621. return msgSend(^Window, Window, "alloc")
  622. }
  623. @(objc_type=Window, objc_name="initWithContentRect")
  624. Window_initWithContentRect :: proc (self: ^Window, contentRect: Rect, styleMask: WindowStyleMask, backing: BackingStoreType, doDefer: BOOL) -> ^Window {
  625. return msgSend(^Window, self, "initWithContentRect:styleMask:backing:defer:", contentRect, styleMask, backing, doDefer)
  626. }
  627. @(objc_type=Window, objc_name="contentView")
  628. Window_contentView :: proc "c" (self: ^Window) -> ^View {
  629. return msgSend(^View, self, "contentView")
  630. }
  631. @(objc_type=Window, objc_name="setContentView")
  632. Window_setContentView :: proc "c" (self: ^Window, content_view: ^View) {
  633. msgSend(nil, self, "setContentView:", content_view)
  634. }
  635. @(objc_type=Window, objc_name="contentLayoutRect")
  636. Window_contentLayoutRect :: proc "c" (self: ^Window) -> Rect {
  637. return msgSend(Rect, self, "contentLayoutRect")
  638. }
  639. @(objc_type=Window, objc_name="frame")
  640. Window_frame :: proc "c" (self: ^Window) -> Rect {
  641. return msgSend(Rect, self, "frame")
  642. }
  643. @(objc_type=Window, objc_name="setFrame")
  644. Window_setFrame :: proc "c" (self: ^Window, frame: Rect, display: BOOL) {
  645. msgSend(nil, self, "setFrame:display:", frame, display)
  646. }
  647. @(objc_type=Window, objc_name="setFrameOrigin")
  648. Window_setFrameOrigin :: proc "c" (self: ^Window, origin: Point) {
  649. msgSend(nil, self, "setFrameOrigin:", origin)
  650. }
  651. @(objc_type=Window, objc_name="opaque")
  652. Window_opaque :: proc "c" (self: ^Window) -> BOOL {
  653. return msgSend(BOOL, self, "opaque")
  654. }
  655. @(objc_type=Window, objc_name="setOpaque")
  656. Window_setOpaque :: proc "c" (self: ^Window, ok: BOOL) {
  657. msgSend(nil, self, "setOpaque:", ok)
  658. }
  659. @(objc_type=Window, objc_name="backgroundColor")
  660. Window_backgroundColor :: proc "c" (self: ^Window) -> ^Color {
  661. return msgSend(^Color, self, "backgroundColor")
  662. }
  663. @(objc_type=Window, objc_name="setBackgroundColor")
  664. Window_setBackgroundColor :: proc "c" (self: ^Window, color: ^Color) {
  665. msgSend(nil, self, "setBackgroundColor:", color)
  666. }
  667. @(objc_type=Window, objc_name="makeKeyAndOrderFront")
  668. Window_makeKeyAndOrderFront :: proc "c" (self: ^Window, key: ^Object) {
  669. msgSend(nil, self, "makeKeyAndOrderFront:", key)
  670. }
  671. @(objc_type=Window, objc_name="setTitle")
  672. Window_setTitle :: proc "c" (self: ^Window, title: ^String) {
  673. msgSend(nil, self, "setTitle:", title)
  674. }
  675. @(objc_type=Window, objc_name="setTitlebarAppearsTransparent")
  676. Window_setTitlebarAppearsTransparent :: proc "c" (self: ^Window, ok: BOOL) {
  677. msgSend(nil, self, "setTitlebarAppearsTransparent:", ok)
  678. }
  679. @(objc_type=Window, objc_name="setMovable")
  680. Window_setMovable :: proc "c" (self: ^Window, ok: BOOL) {
  681. msgSend(nil, self, "setMovable:", ok)
  682. }
  683. @(objc_type=Window, objc_name="setMovableByWindowBackground")
  684. Window_setMovableByWindowBackground :: proc "c" (self: ^Window, ok: BOOL) {
  685. msgSend(nil, self, "setMovableByWindowBackground:", ok)
  686. }
  687. @(objc_type=Window, objc_name="setAcceptsMouseMovedEvents")
  688. Window_setAcceptsMouseMovedEvents :: proc "c" (self: ^Window, ok: BOOL) {
  689. msgSend(nil, self, "setAcceptsMouseMovedEvents:", ok)
  690. }
  691. @(objc_type=Window, objc_name="setStyleMask")
  692. Window_setStyleMask :: proc "c" (self: ^Window, style_mask: WindowStyleMask) {
  693. msgSend(nil, self, "setStyleMask:", style_mask)
  694. }
  695. @(objc_type=Window, objc_name="close")
  696. Window_close :: proc "c" (self: ^Window) {
  697. msgSend(nil, self, "close")
  698. }
  699. @(objc_type=Window, objc_name="setDelegate")
  700. Window_setDelegate :: proc "c" (self: ^Window, delegate: ^WindowDelegate) {
  701. msgSend(nil, self, "setDelegate:", delegate)
  702. }
  703. @(objc_type=Window, objc_name="backingScaleFactor")
  704. Window_backingScaleFactor :: proc "c" (self: ^Window) -> Float {
  705. return msgSend(Float, self, "backingScaleFactor")
  706. }
  707. @(objc_type=Window, objc_name="setWantsLayer")
  708. Window_setWantsLayer :: proc "c" (self: ^Window, ok: BOOL) {
  709. msgSend(nil, self, "setWantsLayer:", ok)
  710. }
  711. @(objc_type=Window, objc_name="setIsMiniaturized")
  712. Window_setIsMiniaturized :: proc "c" (self: ^Window, ok: BOOL) {
  713. msgSend(nil, self, "setIsMiniaturized:", ok)
  714. }
  715. @(objc_type=Window, objc_name="setIsVisible")
  716. Window_setIsVisible :: proc "c" (self: ^Window, ok: BOOL) {
  717. msgSend(nil, self, "setIsVisible:", ok)
  718. }
  719. @(objc_type=Window, objc_name="setIsZoomed")
  720. Window_setIsZoomed :: proc "c" (self: ^Window, ok: BOOL) {
  721. msgSend(nil, self, "setIsZoomed:", ok)
  722. }
  723. @(objc_type=Window, objc_name="isZoomable")
  724. Window_isZoomable :: proc "c" (self: ^Window) -> BOOL {
  725. return msgSend(BOOL, self, "isZoomable")
  726. }
  727. @(objc_type=Window, objc_name="isResizable")
  728. Window_isResizable :: proc "c" (self: ^Window) -> BOOL {
  729. return msgSend(BOOL, self, "isResizable")
  730. }
  731. @(objc_type=Window, objc_name="isModalPanel")
  732. Window_isModalPanel :: proc "c" (self: ^Window) -> BOOL {
  733. return msgSend(BOOL, self, "isModalPanel")
  734. }
  735. @(objc_type=Window, objc_name="isMiniaturizable")
  736. Window_isMiniaturizable :: proc "c" (self: ^Window) -> BOOL {
  737. return msgSend(BOOL, self, "isMiniaturizable")
  738. }
  739. @(objc_type=Window, objc_name="isFloatingPanel")
  740. Window_isFloatingPanel :: proc "c" (self: ^Window) -> BOOL {
  741. return msgSend(BOOL, self, "isFloatingPanel")
  742. }
  743. @(objc_type=Window, objc_name="hasCloseBox")
  744. Window_hasCloseBox :: proc "c" (self: ^Window) -> BOOL {
  745. return msgSend(BOOL, self, "hasCloseBox")
  746. }
  747. @(objc_type=Window, objc_name="hasTitleBar")
  748. Window_hasTitleBar :: proc "c" (self: ^Window) -> BOOL {
  749. return msgSend(BOOL, self, "hasTitleBar")
  750. }
  751. @(objc_type=Window, objc_name="orderedIndex")
  752. Window_orderedIndex :: proc "c" (self: ^Window) -> Integer {
  753. return msgSend(Integer, self, "orderedIndex")
  754. }
  755. @(objc_type=Window, objc_name="setMinSize")
  756. Window_setMinSize :: proc "c" (self: ^Window, size: Size) {
  757. msgSend(nil, self, "setMinSize:", size)
  758. }
  759. @(objc_type=Window, objc_name="setTitleVisibility")
  760. Window_setTitleVisibility :: proc "c" (self: ^Window, visibility: Window_Title_Visibility) {
  761. msgSend(nil, self, "setTitleVisibility:", visibility)
  762. }
  763. @(objc_type=Window, objc_name="performZoom")
  764. Window_performZoom :: proc "c" (self: ^Window) {
  765. msgSend(nil, self, "performZoom:", self)
  766. }
  767. @(objc_type=Window, objc_name="setFrameAutosaveName")
  768. NSWindow_setFrameAutosaveName :: proc "c" (self: ^Window, name: ^String) {
  769. msgSend(nil, self, "setFrameAutosaveName:", name)
  770. }
  771. @(objc_type=Window, objc_name="performWindowDragWithEvent")
  772. Window_performWindowDragWithEvent :: proc "c" (self: ^Window, event: ^Event) {
  773. msgSend(nil, self, "performWindowDragWithEvent:", event)
  774. }
  775. @(objc_type=Window, objc_name="setToolbar")
  776. Window_setToolbar :: proc "c" (self: ^Window, toolbar: ^Toolbar) {
  777. msgSend(nil, self, "setToolbar:", toolbar)
  778. }