ProjectLibrary.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. using System;
  4. using System.Collections.Generic;
  5. using System.IO;
  6. using System.Runtime.CompilerServices;
  7. using bs;
  8. namespace bs.Editor
  9. {
  10. /** @addtogroup Library
  11. * @{
  12. */
  13. /// <summary>
  14. /// The primary location for interacting with all the resources in the current project. A complete hierarchy of
  15. /// resources is provided which can be interacted with by importing new ones, deleting them, moving, renaming and similar.
  16. /// </summary>
  17. public sealed class ProjectLibrary : ScriptObject
  18. {
  19. /// <summary>
  20. /// Root entry of the project library, referencing the top level resources folder.
  21. /// </summary>
  22. public static DirectoryEntry Root { get { return Internal_GetRoot(); } }
  23. /// <summary>
  24. /// Absolute path to the current project's project library resource folder.
  25. /// </summary>
  26. public static string ResourceFolder { get { return Internal_GetResourceFolder(); } }
  27. /// <summary>
  28. /// Triggered when a new entry is added to the project library. Provided path relative to the project library
  29. /// resources folder.
  30. /// </summary>
  31. public static event Action<string> OnEntryAdded;
  32. /// <summary>
  33. /// Triggered when an entry is removed from the project library. Provided path relative to the project library
  34. /// resources folder.
  35. /// </summary>
  36. public static event Action<string> OnEntryRemoved;
  37. /// <summary>
  38. /// Triggered when an entry is (re)imported in the project library. Provided path relative to the project library
  39. /// resources folder.
  40. /// </summary>
  41. public static event Action<string> OnEntryImported;
  42. /// <summary>
  43. /// Checks wheher an asset import is currently in progress.
  44. /// </summary>
  45. internal static bool ImportInProgress { get { return InProgressImportCount > 0; } }
  46. /// <summary>
  47. /// Returns the number of resources currently being imported.
  48. /// </summary>
  49. internal static int InProgressImportCount { get { return Internal_GetInProgressImportCount(); } }
  50. private static int totalFilesToImport;
  51. /// <summary>
  52. /// Checks the project library folder for any modifications and reimports the required resources.
  53. /// </summary>
  54. /// <param name="synchronous">If true this method will block until the project library has done refreshing,
  55. /// otherwise the refresh will happen over the course of this and next frames.</param>
  56. public static void Refresh(bool synchronous = false)
  57. {
  58. totalFilesToImport += Internal_Refresh(ResourceFolder, synchronous);
  59. if (synchronous)
  60. totalFilesToImport = 0;
  61. }
  62. /// <summary>
  63. /// Checks the specified folder for any modifications and reimports the required resources.
  64. /// </summary>
  65. /// <param name="path">Path to a file or folder to refresh. Relative to the project library resources folder or
  66. /// absolute.</param>
  67. public static void Refresh(string path)
  68. {
  69. totalFilesToImport += Internal_Refresh(path, false);
  70. }
  71. /// <summary>
  72. /// Registers a new resource in the library.
  73. /// </summary>
  74. /// <param name="resource">Resource instance to add to the library. A copy of the resource will be saved at the
  75. /// provided path.</param>
  76. /// <param name="path">Path where where to store the resource. Absolute or relative to the resources folder.</param>
  77. public static void Create(Resource resource, string path)
  78. {
  79. Internal_Create(resource, path);
  80. }
  81. /// <summary>
  82. /// Updates a resource that is already in the library.
  83. /// </summary>
  84. /// <param name="resource">Resource to save.</param>
  85. public static void Save(Resource resource)
  86. {
  87. Internal_Save(resource);
  88. }
  89. /// <summary>
  90. /// Loads a resource from the project library.
  91. /// </summary>
  92. /// <typeparam name="T">Type of the resource to load.</typeparam>
  93. /// <param name="path">Path of the resource to load. Absolute or relative to the resources folder. If a
  94. /// sub-resource within a file is needed, append the name of the subresource to the path (
  95. /// for example mymesh.fbx/my_animation).</param>
  96. /// <returns>Instance of the loaded resource, or null if not found.</returns>
  97. public static T Load<T>(string path) where T : Resource
  98. {
  99. return (T) Internal_Load(path);
  100. }
  101. /// <summary>
  102. /// Triggers a reimport of a resource using the provided import options, if needed.
  103. /// </summary>
  104. /// <param name="path">Path to the resource to reimport, absolute or relative to resources folder.</param>
  105. /// <param name="options">ptional import options to use when importing the resource. Caller must ensure the import
  106. /// options are of the correct type for the resource in question. If null is provided default
  107. /// import options are used.</param>
  108. /// <param name="force">Should the resource be reimported even if no changes are detected.</param>
  109. /// <param name="synchronous">If true the import will happen synchronously on the calling thread. If false the
  110. /// import operation will be queued for execution on a worker thread.</param>
  111. public static void Reimport(string path, ImportOptions options = null, bool force = false, bool synchronous = false)
  112. {
  113. Internal_Reimport(path, options, force, synchronous);
  114. }
  115. /// <summary>
  116. /// Checks how far along is the import for the specified file.
  117. /// </summary>
  118. /// <param name="path">Path to the file to check, absolute or relative to the resources folder.</param>
  119. /// <returns> Reports 1 if the file is fully imported. Reports 0 if the import has not started or the file isn't
  120. /// even queued for import. Reports >= 0 if the file is in process of being imported. Note that not all importers
  121. /// support fine grained progress reporting, in which case the import progress will be reported as a binary 0 or 1.
  122. /// </returns>
  123. public static float GetImportProgress(string path)
  124. {
  125. return Internal_GetImportProgress(path);
  126. }
  127. /// <summary>
  128. /// Cancels import for all resources currently queued for import. This method returns immediately but it may take
  129. /// some time until imports are fully canceled.
  130. /// </summary>
  131. public static void CancelImport()
  132. {
  133. Internal_CancelImport();
  134. }
  135. /// <summary>
  136. /// Checks does the project library contain a file or folder at the specified path.
  137. /// </summary>
  138. /// <param name="path">Path to the file/folder to check, absolute or relative to resources folder.</param>
  139. /// <returns>True if the element exists, false otherwise.</returns>
  140. public static bool Exists(string path)
  141. {
  142. return GetEntry(path) != null;
  143. }
  144. /// <summary>
  145. /// Attempts to locate a library entry that describes a file or a folder in the project library.
  146. /// </summary>
  147. /// <param name="path">Path to the entry to retrieve, absolute or relative to resources folder.</param>
  148. /// <returns>Library entry if found, null otherwise. This object can become invalid on the next library refresh
  149. /// and you are not meant to hold a permanent reference to it.</returns>
  150. public static LibraryEntry GetEntry(string path)
  151. {
  152. return Internal_GetEntry(path);
  153. }
  154. /// <summary>
  155. /// Checks whether the provided path points to a sub-resource. Sub-resource is any resource that is not the
  156. /// primary resource in the file.
  157. /// </summary>
  158. /// <param name="path">Path to the entry, absolute or relative to resources folder.</param>
  159. /// <returns>True if the path is a sub-resource, false otherwise.</returns>
  160. public static bool IsSubresource(string path)
  161. {
  162. return Internal_IsSubresource(path);
  163. }
  164. /// <summary>
  165. /// Attempts to locate meta-data for a resource at the specified path.
  166. /// </summary>
  167. /// <param name="path">Path to the entry to retrieve, absolute or relative to resources folder. If a sub-resource
  168. /// within a file is needed, append the name of the subresource to the path (for example
  169. /// mymesh.fbx/my_animation).</param>
  170. /// <returns>Resource meta-data if the resource was found, null otherwise.</returns>
  171. public static ResourceMeta GetMeta(string path)
  172. {
  173. return Internal_GetMeta(path);
  174. }
  175. /// <summary>
  176. /// Searches the library for a pattern and returns all entries matching it.
  177. /// </summary>
  178. /// <param name="pattern">Pattern to search for. Use wildcard * to match any character(s).</param>
  179. /// <param name="types">Type of resources to search for. If null all entries will be searched.</param>
  180. /// <returns>A set of entries matching the pattern. These objects can become invalid on the next library refresh
  181. /// and you are not meant to hold a permanent reference to them.</returns>
  182. public static LibraryEntry[] Search(string pattern, ResourceType[] types = null)
  183. {
  184. return Internal_Search(pattern, types);
  185. }
  186. /// <summary>
  187. /// Returns a path to a resource stored in the project library.
  188. /// </summary>
  189. /// <param name="resource">Resource to find the path for.</param>
  190. /// <returns>Path to relative to the project library resources folder if resource was found, null otherwise.
  191. /// </returns>
  192. public static string GetPath(Resource resource)
  193. {
  194. return Internal_GetPath(resource);
  195. }
  196. /// <summary>
  197. /// Returns a path to a resource with the specified UUID stored in the project library.
  198. /// </summary>
  199. /// <param name="uuid">Unique identifier of the resources to retrieve the path of.</param>
  200. /// <returns>Path to relative to the project library resources folder if resource was found, null otherwise.
  201. /// </returns>
  202. public static string GetPath(UUID uuid)
  203. {
  204. return Internal_GetPathFromUUID(ref uuid);
  205. }
  206. /// <summary>
  207. /// Deletes a resource in the project library.
  208. /// </summary>
  209. /// <param name="path">Path to the entry to delete, absolute or relative to resources folder.</param>
  210. public static void Delete(string path)
  211. {
  212. Internal_Delete(path);
  213. }
  214. /// <summary>
  215. /// Creates a new folder in the library.
  216. /// </summary>
  217. /// <param name="path">Path of the folder to create. Absolute or relative to the resources folder.</param>
  218. public static void CreateFolder(string path)
  219. {
  220. Internal_CreateFolder(path);
  221. }
  222. /// <summary>
  223. /// Renames an entry in the project library.
  224. /// </summary>
  225. /// <param name="path">Path of the entry to rename, absolute or relative to resources folder.</param>
  226. /// <param name="name">New name of the entry with an extension.</param>
  227. /// <param name="overwrite">Determines should the entry be deleted if one with the provided name already exists. If
  228. /// this is false and an entry already exists, no rename operation will be performed.</param>
  229. public static void Rename(string path, string name, bool overwrite = false)
  230. {
  231. Internal_Rename(path, name, false);
  232. }
  233. /// <summary>
  234. /// Moves an entry in the project library from one path to another.
  235. /// </summary>
  236. /// <param name="oldPath">Source path of the entry, absolute or relative to resources folder.</param>
  237. /// <param name="newPath">Destination path of the entry, absolute or relative to resources folder.</param>
  238. /// <param name="overwrite">Determines should the entry be deleted if one at the destination path already exists. If
  239. /// this is false and an entry already exists, no move operation will be performed.</param>
  240. public static void Move(string oldPath, string newPath, bool overwrite = false)
  241. {
  242. Internal_Move(oldPath, newPath, overwrite);
  243. }
  244. /// <summary>
  245. /// Copies an entry in the project library from one path to another.
  246. /// </summary>
  247. /// <param name="source">Source path of the entry, absolute or relative to resources folder.</param>
  248. /// <param name="destination">Destination path of the entry, absolute or relative to resources folder.</param>
  249. /// <param name="overwrite">Determines should the entry be deleted if one at the destination path already exists. If
  250. /// this is false and an entry already exists, no copy operation will be performed.</param>
  251. public static void Copy(string source, string destination, bool overwrite = false)
  252. {
  253. Internal_Copy(source, destination, overwrite);
  254. }
  255. /// <summary>
  256. /// Controls should a resource be included an a build. All dependant resources will also be included.
  257. /// </summary>
  258. /// <param name="path">Path of the resource to include, absolute or relative to resources folder.</param>
  259. /// <param name="include">True if it should be included, false otherwise.</param>
  260. public static void SetIncludeInBuild(string path, bool include)
  261. {
  262. Internal_SetIncludeInBuild(path, include);
  263. }
  264. /// <summary>
  265. /// Assigns a non-specific editor data object to the resource at the specified path.
  266. /// </summary>
  267. /// <param name="path">Path to the resource to modify, absolute or relative to resources folder.</param>
  268. /// <param name="userData">Data to assign to the resource, which can later be retrieved from the resource's
  269. /// meta-data as needed. </param>
  270. public static void SetEditorData(string path, object userData)
  271. {
  272. Internal_SetEditorData(path, userData);
  273. }
  274. /// <summary>
  275. /// Triggers reimport for queued resource. Should be called once per frame.
  276. /// </summary>
  277. internal static void Update()
  278. {
  279. Internal_FinalizeImports();
  280. int inProgressImports = InProgressImportCount;
  281. if (inProgressImports > 0)
  282. {
  283. int numRemaining = totalFilesToImport - inProgressImports;
  284. float pct = 1.0f;
  285. if(totalFilesToImport > 0)
  286. pct = numRemaining / (float)totalFilesToImport;
  287. EditorApplication.SetStatusImporting(true, pct);
  288. }
  289. else
  290. {
  291. totalFilesToImport = 0;
  292. EditorApplication.SetStatusImporting(false, 0.0f);
  293. }
  294. }
  295. /// <summary>
  296. /// Triggered internally by the runtime when a new entry is added to the project library.
  297. /// </summary>
  298. /// <param name="path">Path relative to the project library resources folder.</param>
  299. private static void Internal_DoOnEntryAdded(string path)
  300. {
  301. if (OnEntryAdded != null)
  302. OnEntryAdded(path);
  303. }
  304. /// <summary>
  305. /// Triggered internally by the runtime when an entry is removed from the project library.
  306. /// </summary>
  307. /// <param name="path">Path relative to the project library resources folder.</param>
  308. private static void Internal_DoOnEntryRemoved(string path)
  309. {
  310. if (OnEntryRemoved != null)
  311. OnEntryRemoved(path);
  312. }
  313. /// <summary>
  314. /// Triggered internally by the runtime when an entry is (re)imported in the project library.
  315. /// </summary>
  316. /// <param name="path">Path relative to the project library resources folder.</param>
  317. private static void Internal_DoOnEntryImported(string path)
  318. {
  319. if (OnEntryImported != null)
  320. OnEntryImported(path);
  321. }
  322. [MethodImpl(MethodImplOptions.InternalCall)]
  323. private static extern int Internal_Refresh(string path, bool synchronous);
  324. [MethodImpl(MethodImplOptions.InternalCall)]
  325. private static extern void Internal_FinalizeImports();
  326. [MethodImpl(MethodImplOptions.InternalCall)]
  327. private static extern int Internal_GetInProgressImportCount();
  328. [MethodImpl(MethodImplOptions.InternalCall)]
  329. private static extern void Internal_Create(Resource resource, string path);
  330. [MethodImpl(MethodImplOptions.InternalCall)]
  331. private static extern Resource Internal_Load(string path);
  332. [MethodImpl(MethodImplOptions.InternalCall)]
  333. private static extern void Internal_Save(Resource resource);
  334. [MethodImpl(MethodImplOptions.InternalCall)]
  335. private static extern DirectoryEntry Internal_GetRoot();
  336. [MethodImpl(MethodImplOptions.InternalCall)]
  337. private static extern bool Internal_IsSubresource(string path);
  338. [MethodImpl(MethodImplOptions.InternalCall)]
  339. private static extern void Internal_Reimport(string path, ImportOptions options, bool force, bool synchronous);
  340. [MethodImpl(MethodImplOptions.InternalCall)]
  341. private static extern float Internal_GetImportProgress(string path);
  342. [MethodImpl(MethodImplOptions.InternalCall)]
  343. private static extern void Internal_CancelImport();
  344. [MethodImpl(MethodImplOptions.InternalCall)]
  345. private static extern LibraryEntry Internal_GetEntry(string path);
  346. [MethodImpl(MethodImplOptions.InternalCall)]
  347. private static extern ResourceMeta Internal_GetMeta(string path);
  348. [MethodImpl(MethodImplOptions.InternalCall)]
  349. private static extern LibraryEntry[] Internal_Search(string path, ResourceType[] types);
  350. [MethodImpl(MethodImplOptions.InternalCall)]
  351. private static extern string Internal_GetPath(Resource resource);
  352. [MethodImpl(MethodImplOptions.InternalCall)]
  353. private static extern string Internal_GetPathFromUUID(ref UUID uuid);
  354. [MethodImpl(MethodImplOptions.InternalCall)]
  355. private static extern void Internal_Delete(string path);
  356. [MethodImpl(MethodImplOptions.InternalCall)]
  357. private static extern void Internal_CreateFolder(string path);
  358. [MethodImpl(MethodImplOptions.InternalCall)]
  359. private static extern void Internal_Rename(string path, string name, bool overwrite);
  360. [MethodImpl(MethodImplOptions.InternalCall)]
  361. private static extern void Internal_Move(string oldPath, string newPath, bool overwrite);
  362. [MethodImpl(MethodImplOptions.InternalCall)]
  363. private static extern void Internal_Copy(string source, string destination, bool overwrite);
  364. [MethodImpl(MethodImplOptions.InternalCall)]
  365. private static extern string Internal_GetResourceFolder();
  366. [MethodImpl(MethodImplOptions.InternalCall)]
  367. private static extern void Internal_SetIncludeInBuild(string path, bool force);
  368. [MethodImpl(MethodImplOptions.InternalCall)]
  369. private static extern void Internal_SetEditorData(string path, object userData);
  370. }
  371. /// <summary>
  372. /// Type of project library entries.
  373. /// </summary>
  374. public enum LibraryEntryType // Note: Must match the C++ enum ProjectLibrary::LibraryEntryType
  375. {
  376. File, Directory
  377. }
  378. /// <summary>
  379. /// Type of resources supported by the project library.
  380. /// </summary>
  381. public enum ResourceType // Note: Must match the C++ enum ScriptResourceType
  382. {
  383. Texture, SpriteTexture, Mesh, Font, Shader, ShaderInclude, Material, Prefab, PlainText, ScriptCode, StringTable,
  384. GUISkin, PhysicsMaterial, PhysicsMesh, AudioClip, AnimationClip, VectorField, Undefined
  385. }
  386. /// <summary>
  387. /// A generic project library entry that may be a file or a folder.
  388. /// </summary>
  389. public class LibraryEntry : ScriptObject
  390. {
  391. /// <summary>
  392. /// Path of the library entry, relative to the project library resources folder.
  393. /// </summary>
  394. public string Path { get { return Internal_GetPath(mCachedPtr); } }
  395. /// <summary>
  396. /// Name of the library entry.
  397. /// </summary>
  398. public string Name { get { return Internal_GetName(mCachedPtr); } }
  399. /// <summary>
  400. /// Type of the library entry.
  401. /// </summary>
  402. public LibraryEntryType Type { get { return Internal_GetType(mCachedPtr); } }
  403. /// <summary>
  404. /// Directory entry that contains this entry. This may be null for the root entry.
  405. /// </summary>
  406. public DirectoryEntry Parent { get { return Internal_GetParent(mCachedPtr); } }
  407. [MethodImpl(MethodImplOptions.InternalCall)]
  408. private static extern string Internal_GetPath(IntPtr thisPtr);
  409. [MethodImpl(MethodImplOptions.InternalCall)]
  410. private static extern string Internal_GetName(IntPtr thisPtr);
  411. [MethodImpl(MethodImplOptions.InternalCall)]
  412. private static extern LibraryEntryType Internal_GetType(IntPtr thisPtr);
  413. [MethodImpl(MethodImplOptions.InternalCall)]
  414. private static extern DirectoryEntry Internal_GetParent(IntPtr thisPtr);
  415. }
  416. /// <summary>
  417. /// A project library entry representing a directory that contains other entries.
  418. /// </summary>
  419. public class DirectoryEntry : LibraryEntry
  420. {
  421. /// <summary>
  422. /// A set of entries contained in this entry.
  423. /// </summary>
  424. public LibraryEntry[] Children { get { return Internal_GetChildren(mCachedPtr); } }
  425. [MethodImpl(MethodImplOptions.InternalCall)]
  426. private static extern LibraryEntry[] Internal_GetChildren(IntPtr thisPtr);
  427. }
  428. /// <summary>
  429. /// A library entry representing a file.
  430. /// </summary>
  431. public class FileEntry : LibraryEntry
  432. {
  433. /// <summary>
  434. /// Import options used for importing the resources in the file.
  435. /// </summary>
  436. public ImportOptions Options { get { return Internal_GetImportOptions(mCachedPtr); } }
  437. /// <summary>
  438. /// Returns meta-data for all resources part of the file represented by this object.
  439. /// </summary>
  440. public ResourceMeta[] ResourceMetas { get { return Internal_GetResourceMetas(mCachedPtr); } }
  441. /// <summary>
  442. /// Determines will the resources in the file be included in the project build.
  443. /// </summary>
  444. public bool IncludeInBuild { get { return Internal_GetIncludeInBuild(mCachedPtr); } }
  445. [MethodImpl(MethodImplOptions.InternalCall)]
  446. private static extern ImportOptions Internal_GetImportOptions(IntPtr thisPtr);
  447. [MethodImpl(MethodImplOptions.InternalCall)]
  448. private static extern ResourceMeta[] Internal_GetResourceMetas(IntPtr thisPtr);
  449. [MethodImpl(MethodImplOptions.InternalCall)]
  450. private static extern bool Internal_GetIncludeInBuild(IntPtr thisPtr);
  451. }
  452. /// <summary>
  453. /// Contains meta-data for a resource in the ProjectLibrary.
  454. /// </summary>
  455. public class ResourceMeta : ScriptObject
  456. {
  457. /// <summary>
  458. /// Unique identifier of the resource.
  459. /// </summary>
  460. public UUID UUID
  461. {
  462. get
  463. {
  464. UUID uuid;
  465. Internal_GetUUID(mCachedPtr, out uuid);
  466. return uuid;
  467. }
  468. }
  469. /// <summary>
  470. /// Returns a name of the subresources. Each resource within a file has a unique name.
  471. /// </summary>
  472. public string SubresourceName { get { return Internal_GetSubresourceName(mCachedPtr); } }
  473. /// <summary>
  474. /// Custom icons for the resource to display in the editor, if the resource has them.
  475. /// </summary>
  476. public ProjectResourceIcons Icons
  477. {
  478. get
  479. {
  480. ProjectResourceIcons output;
  481. Internal_GetPreviewIcons(mCachedPtr, out output);
  482. return output;
  483. }
  484. }
  485. /// <summary>
  486. /// Type of the resource referenced by this entry.
  487. /// </summary>
  488. public ResourceType ResType { get { return Internal_GetResourceType(mCachedPtr); } }
  489. /// <summary>
  490. /// Type information of the resource referenced by this entry.
  491. /// </summary>
  492. public Type Type { get { return Internal_GetType(mCachedPtr); } }
  493. /// <summary>
  494. /// Non-specific data assigned to the resource, available in editor only.
  495. /// </summary>
  496. public object EditorData { get { return Internal_GetEditorData(mCachedPtr); } }
  497. [MethodImpl(MethodImplOptions.InternalCall)]
  498. private static extern void Internal_GetUUID(IntPtr thisPtr, out UUID uuid);
  499. [MethodImpl(MethodImplOptions.InternalCall)]
  500. private static extern string Internal_GetSubresourceName(IntPtr thisPtr);
  501. [MethodImpl(MethodImplOptions.InternalCall)]
  502. private static extern void Internal_GetPreviewIcons(IntPtr thisPtr, out ProjectResourceIcons icons);
  503. [MethodImpl(MethodImplOptions.InternalCall)]
  504. private static extern ResourceType Internal_GetResourceType(IntPtr thisPtr);
  505. [MethodImpl(MethodImplOptions.InternalCall)]
  506. private static extern Type Internal_GetType(IntPtr thisPtr);
  507. [MethodImpl(MethodImplOptions.InternalCall)]
  508. private static extern object Internal_GetEditorData(IntPtr thisPtr);
  509. }
  510. /** @} */
  511. }