core_string_names.h 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. #ifndef CORE_STRING_NAMES_H
  31. #define CORE_STRING_NAMES_H
  32. #include "core/string/string_name.h"
  33. class CoreStringNames {
  34. inline static CoreStringNames *singleton = nullptr;
  35. public:
  36. static void create() { singleton = memnew(CoreStringNames); }
  37. static void free() {
  38. memdelete(singleton);
  39. singleton = nullptr;
  40. }
  41. _FORCE_INLINE_ static CoreStringNames *get_singleton() { return singleton; }
  42. const StringName free_ = StaticCString::create("free"); // free would conflict with C++ keyword.
  43. const StringName changed = StaticCString::create("changed");
  44. const StringName script = StaticCString::create("script");
  45. const StringName script_changed = StaticCString::create("script_changed");
  46. const StringName _iter_init = StaticCString::create("_iter_init");
  47. const StringName _iter_next = StaticCString::create("_iter_next");
  48. const StringName _iter_get = StaticCString::create("_iter_get");
  49. const StringName get_rid = StaticCString::create("get_rid");
  50. const StringName _to_string = StaticCString::create("_to_string");
  51. const StringName _custom_features = StaticCString::create("_custom_features");
  52. const StringName x = StaticCString::create("x");
  53. const StringName y = StaticCString::create("y");
  54. const StringName z = StaticCString::create("z");
  55. const StringName w = StaticCString::create("w");
  56. const StringName r = StaticCString::create("r");
  57. const StringName g = StaticCString::create("g");
  58. const StringName b = StaticCString::create("b");
  59. const StringName a = StaticCString::create("a");
  60. const StringName position = StaticCString::create("position");
  61. const StringName size = StaticCString::create("size");
  62. const StringName end = StaticCString::create("end");
  63. const StringName basis = StaticCString::create("basis");
  64. const StringName origin = StaticCString::create("origin");
  65. const StringName normal = StaticCString::create("normal");
  66. const StringName d = StaticCString::create("d");
  67. const StringName h = StaticCString::create("h");
  68. const StringName s = StaticCString::create("s");
  69. const StringName v = StaticCString::create("v");
  70. const StringName r8 = StaticCString::create("r8");
  71. const StringName g8 = StaticCString::create("g8");
  72. const StringName b8 = StaticCString::create("b8");
  73. const StringName a8 = StaticCString::create("a8");
  74. const StringName call = StaticCString::create("call");
  75. const StringName call_deferred = StaticCString::create("call_deferred");
  76. const StringName bind = StaticCString::create("bind");
  77. const StringName notification = StaticCString::create("notification");
  78. const StringName property_list_changed = StaticCString::create("property_list_changed");
  79. };
  80. #define CoreStringName(m_name) CoreStringNames::get_singleton()->m_name
  81. #endif // CORE_STRING_NAMES_H