ResourceEvents.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //
  2. // Copyright (c) 2008-2017 the Urho3D project.
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. #pragma once
  23. #include "../Core/Object.h"
  24. namespace Atomic
  25. {
  26. /// Resource reloading started.
  27. ATOMIC_EVENT(E_RELOADSTARTED, ReloadStarted)
  28. {
  29. }
  30. /// Resource reloading finished successfully.
  31. ATOMIC_EVENT(E_RELOADFINISHED, ReloadFinished)
  32. {
  33. }
  34. /// Resource reloading failed.
  35. ATOMIC_EVENT(E_RELOADFAILED, ReloadFailed)
  36. {
  37. }
  38. /// Tracked file changed in the resource directories.
  39. ATOMIC_EVENT(E_FILECHANGED, FileChanged)
  40. {
  41. ATOMIC_PARAM(P_FILENAME, FileName); // String
  42. ATOMIC_PARAM(P_RESOURCENAME, ResourceName); // String
  43. }
  44. /// Resource loading failed.
  45. ATOMIC_EVENT(E_LOADFAILED, LoadFailed)
  46. {
  47. ATOMIC_PARAM(P_RESOURCENAME, ResourceName); // String
  48. }
  49. /// Resource not found.
  50. ATOMIC_EVENT(E_RESOURCENOTFOUND, ResourceNotFound)
  51. {
  52. ATOMIC_PARAM(P_RESOURCENAME, ResourceName); // String
  53. }
  54. /// Unknown resource type.
  55. ATOMIC_EVENT(E_UNKNOWNRESOURCETYPE, UnknownResourceType)
  56. {
  57. ATOMIC_PARAM(P_RESOURCETYPE, ResourceType); // StringHash
  58. }
  59. /// Resource background loading finished.
  60. ATOMIC_EVENT(E_RESOURCEBACKGROUNDLOADED, ResourceBackgroundLoaded)
  61. {
  62. ATOMIC_PARAM(P_RESOURCENAME, ResourceName); // String
  63. ATOMIC_PARAM(P_SUCCESS, Success); // bool
  64. ATOMIC_PARAM(P_RESOURCE, Resource); // Resource pointer
  65. }
  66. /// Language changed.
  67. ATOMIC_EVENT(E_CHANGELANGUAGE, ChangeLanguage)
  68. {
  69. }
  70. // ATOMIC BEGIN
  71. /// Resource was renamed
  72. ATOMIC_EVENT(E_RENAMERESOURCENOTIFICATION, RenameResourceNotification)
  73. {
  74. ATOMIC_PARAM(P_RESOURCEPATH, Path); // String
  75. ATOMIC_PARAM(P_NEWRESOURCEPATH, NewPath); // String
  76. ATOMIC_PARAM(P_NEWNAME, NewName); // String
  77. ATOMIC_PARAM(P_RESOURCE, Asset); // Resource pointer
  78. }
  79. // ATOMIC END
  80. }