NSBundle.odin 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. package objc_Foundation
  2. @(objc_class="NSBundle")
  3. Bundle :: struct { using _: Object }
  4. @(objc_type=Bundle, objc_name="mainBundle", objc_is_class_method=true)
  5. Bundle_mainBundle :: proc "c" () -> ^Bundle {
  6. return msgSend(^Bundle, Bundle, "mainBundle")
  7. }
  8. @(objc_type=Bundle, objc_name="bundleWithPath", objc_is_class_method=true)
  9. Bundle_bundleWithPath :: proc "c" (path: ^String) -> ^Bundle {
  10. return msgSend(^Bundle, Bundle, "bundleWithPath:", path)
  11. }
  12. @(objc_type=Bundle, objc_name="bundleWithURL", objc_is_class_method=true)
  13. Bundle_bundleWithURL :: proc "c" (url: ^URL) -> ^Bundle {
  14. return msgSend(^Bundle, Bundle, "bundleWithUrl:", url)
  15. }
  16. @(objc_type=Bundle, objc_name="alloc", objc_is_class_method=true)
  17. Bundle_alloc :: proc "c" () -> ^Bundle {
  18. return msgSend(^Bundle, Bundle, "alloc")
  19. }
  20. @(objc_type=Bundle, objc_name="init")
  21. Bundle_init :: proc "c" (self: ^Bundle) -> ^Bundle {
  22. return msgSend(^Bundle, self, "init")
  23. }
  24. @(objc_type=Bundle, objc_name="initWithPath")
  25. Bundle_initWithPath :: proc "c" (self: ^Bundle, path: ^String) -> ^Bundle {
  26. return msgSend(^Bundle, self, "initWithPath:", path)
  27. }
  28. @(objc_type=Bundle, objc_name="initWithURL")
  29. Bundle_initWithURL :: proc "c" (self: ^Bundle, url: ^URL) -> ^Bundle {
  30. return msgSend(^Bundle, self, "initWithUrl:", url)
  31. }
  32. @(objc_type=Bundle, objc_name="allBundles")
  33. Bundle_allBundles :: proc "c" () -> (all: ^Array) {
  34. return msgSend(type_of(all), Bundle, "allBundles")
  35. }
  36. @(objc_type=Bundle, objc_name="allFrameworks")
  37. Bundle_allFrameworks :: proc "c" () -> (all: ^Array) {
  38. return msgSend(type_of(all), Bundle, "allFrameworks")
  39. }
  40. @(objc_type=Bundle, objc_name="load")
  41. Bundle_load :: proc "c" (self: ^Bundle) -> BOOL {
  42. return msgSend(BOOL, self, "load")
  43. }
  44. @(objc_type=Bundle, objc_name="unload")
  45. Bundle_unload :: proc "c" (self: ^Bundle) -> BOOL {
  46. return msgSend(BOOL, self, "unload")
  47. }
  48. @(objc_type=Bundle, objc_name="isLoaded")
  49. Bundle_isLoaded :: proc "c" (self: ^Bundle) -> BOOL {
  50. return msgSend(BOOL, self, "isLoaded")
  51. }
  52. @(objc_type=Bundle, objc_name="preflightAndReturnError")
  53. Bundle_preflightAndReturnError :: proc "contextless" (self: ^Bundle) -> (ok: BOOL, error: ^Error) {
  54. ok = msgSend(BOOL, self, "preflightAndReturnError:", &error)
  55. return
  56. }
  57. @(objc_type=Bundle, objc_name="loadAndReturnError")
  58. Bundle_loadAndReturnError :: proc "contextless" (self: ^Bundle) -> (ok: BOOL, error: ^Error) {
  59. ok = msgSend(BOOL, self, "loadAndReturnError:", &error)
  60. return
  61. }
  62. @(objc_type=Bundle, objc_name="bundleURL")
  63. Bundle_bundleURL :: proc "c" (self: ^Bundle) -> ^URL {
  64. return msgSend(^URL, self, "bundleURL")
  65. }
  66. @(objc_type=Bundle, objc_name="resourceURL")
  67. Bundle_resourceURL :: proc "c" (self: ^Bundle) -> ^URL {
  68. return msgSend(^URL, self, "resourceURL")
  69. }
  70. @(objc_type=Bundle, objc_name="executableURL")
  71. Bundle_executableURL :: proc "c" (self: ^Bundle) -> ^URL {
  72. return msgSend(^URL, self, "executableURL")
  73. }
  74. @(objc_type=Bundle, objc_name="URLForAuxiliaryExecutable")
  75. Bundle_URLForAuxiliaryExecutable :: proc "c" (self: ^Bundle, executableName: ^String) -> ^URL {
  76. return msgSend(^URL, self, "URLForAuxiliaryExecutable:", executableName)
  77. }
  78. @(objc_type=Bundle, objc_name="privateFrameworksURL")
  79. Bundle_privateFrameworksURL :: proc "c" (self: ^Bundle) -> ^URL {
  80. return msgSend(^URL, self, "privateFrameworksURL")
  81. }
  82. @(objc_type=Bundle, objc_name="sharedFrameworksURL")
  83. Bundle_sharedFrameworksURL :: proc "c" (self: ^Bundle) -> ^URL {
  84. return msgSend(^URL, self, "sharedFrameworksURL")
  85. }
  86. @(objc_type=Bundle, objc_name="sharedSupportURL")
  87. Bundle_sharedSupportURL :: proc "c" (self: ^Bundle) -> ^URL {
  88. return msgSend(^URL, self, "sharedSupportURL")
  89. }
  90. @(objc_type=Bundle, objc_name="builtInPlugInsURL")
  91. Bundle_builtInPlugInsURL :: proc "c" (self: ^Bundle) -> ^URL {
  92. return msgSend(^URL, self, "builtInPlugInsURL")
  93. }
  94. @(objc_type=Bundle, objc_name="appStoreReceiptURL")
  95. Bundle_appStoreReceiptURL :: proc "c" (self: ^Bundle) -> ^URL {
  96. return msgSend(^URL, self, "appStoreReceiptURL")
  97. }
  98. @(objc_type=Bundle, objc_name="bundlePath")
  99. Bundle_bundlePath :: proc "c" (self: ^Bundle) -> ^String {
  100. return msgSend(^String, self, "bundlePath")
  101. }
  102. @(objc_type=Bundle, objc_name="resourcePath")
  103. Bundle_resourcePath :: proc "c" (self: ^Bundle) -> ^String {
  104. return msgSend(^String, self, "resourcePath")
  105. }
  106. @(objc_type=Bundle, objc_name="executablePath")
  107. Bundle_executablePath :: proc "c" (self: ^Bundle) -> ^String {
  108. return msgSend(^String, self, "executablePath")
  109. }
  110. @(objc_type=Bundle, objc_name="PathForAuxiliaryExecutable")
  111. Bundle_PathForAuxiliaryExecutable :: proc "c" (self: ^Bundle, executableName: ^String) -> ^String {
  112. return msgSend(^String, self, "PathForAuxiliaryExecutable:", executableName)
  113. }
  114. @(objc_type=Bundle, objc_name="privateFrameworksPath")
  115. Bundle_privateFrameworksPath :: proc "c" (self: ^Bundle) -> ^String {
  116. return msgSend(^String, self, "privateFrameworksPath")
  117. }
  118. @(objc_type=Bundle, objc_name="sharedFrameworksPath")
  119. Bundle_sharedFrameworksPath :: proc "c" (self: ^Bundle) -> ^String {
  120. return msgSend(^String, self, "sharedFrameworksPath")
  121. }
  122. @(objc_type=Bundle, objc_name="sharedSupportPath")
  123. Bundle_sharedSupportPath :: proc "c" (self: ^Bundle) -> ^String {
  124. return msgSend(^String, self, "sharedSupportPath")
  125. }
  126. @(objc_type=Bundle, objc_name="builtInPlugInsPath")
  127. Bundle_builtInPlugInsPath :: proc "c" (self: ^Bundle) -> ^String {
  128. return msgSend(^String, self, "builtInPlugInsPath")
  129. }
  130. @(objc_type=Bundle, objc_name="appStoreReceiptPath")
  131. Bundle_appStoreReceiptPath :: proc "c" (self: ^Bundle) -> ^String {
  132. return msgSend(^String, self, "appStoreReceiptPath")
  133. }
  134. @(objc_type=Bundle, objc_name="bundleIdentifier")
  135. Bundle_bundleIdentifier :: proc "c" (self: ^Bundle) -> ^String {
  136. return msgSend(^String, self, "bundleIdentifier")
  137. }
  138. @(objc_type=Bundle, objc_name="infoDictionary")
  139. Bundle_infoDictionary :: proc "c" (self: ^Bundle) -> ^Dictionary {
  140. return msgSend(^Dictionary, self, "infoDictionary")
  141. }
  142. @(objc_type=Bundle, objc_name="localizedInfoDictionary")
  143. Bundle_localizedInfoDictionary :: proc "c" (self: ^Bundle) -> ^Dictionary {
  144. return msgSend(^Dictionary, self, "localizedInfoDictionary")
  145. }
  146. @(objc_type=Bundle, objc_name="objectForInfoDictionaryKey")
  147. Bundle_objectForInfoDictionaryKey :: proc "c" (self: ^Bundle, key: ^String) -> ^Object {
  148. return msgSend(^Object, self, "objectForInfoDictionaryKey:", key)
  149. }
  150. @(objc_type=Bundle, objc_name="localizedStringForKey")
  151. Bundle_localizedStringForKey :: proc "c" (self: ^Bundle, key: ^String, value: ^String = nil, tableName: ^String = nil) -> ^String {
  152. return msgSend(^String, self, "localizedStringForKey:value:table:", key, value, tableName)
  153. }