core_string_names.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /**************************************************************************/
  2. /* core_string_names.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #pragma once
  31. #include "core/string/string_name.h"
  32. class CoreStringNames {
  33. inline static CoreStringNames *singleton = nullptr;
  34. public:
  35. static void create() { singleton = memnew(CoreStringNames); }
  36. static void free() {
  37. memdelete(singleton);
  38. singleton = nullptr;
  39. }
  40. _FORCE_INLINE_ static CoreStringNames *get_singleton() { return singleton; }
  41. const StringName free_ = "free"; // free would conflict with C++ keyword.
  42. const StringName changed = "changed";
  43. const StringName script = "script";
  44. const StringName script_changed = "script_changed";
  45. const StringName _iter_init = "_iter_init";
  46. const StringName _iter_next = "_iter_next";
  47. const StringName _iter_get = "_iter_get";
  48. const StringName get_rid = "get_rid";
  49. const StringName _to_string = "_to_string";
  50. const StringName _custom_features = "_custom_features";
  51. const StringName x = "x";
  52. const StringName y = "y";
  53. const StringName z = "z";
  54. const StringName w = "w";
  55. const StringName r = "r";
  56. const StringName g = "g";
  57. const StringName b = "b";
  58. const StringName a = "a";
  59. const StringName position = "position";
  60. const StringName size = "size";
  61. const StringName end = "end";
  62. const StringName basis = "basis";
  63. const StringName origin = "origin";
  64. const StringName normal = "normal";
  65. const StringName d = "d";
  66. const StringName h = "h";
  67. const StringName s = "s";
  68. const StringName v = "v";
  69. const StringName r8 = "r8";
  70. const StringName g8 = "g8";
  71. const StringName b8 = "b8";
  72. const StringName a8 = "a8";
  73. const StringName call = "call";
  74. const StringName call_deferred = "call_deferred";
  75. const StringName bind = "bind";
  76. const StringName notification = "notification";
  77. const StringName property_list_changed = "property_list_changed";
  78. };
  79. #define CoreStringName(m_name) CoreStringNames::get_singleton()->m_name