imgui_user.inl 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. namespace ImGui
  2. {
  3. ImString::ImString()
  4. : Ptr(NULL)
  5. {
  6. }
  7. ImString::ImString(const ImString& rhs)
  8. : Ptr(NULL)
  9. {
  10. if (NULL != rhs.Ptr
  11. && 0 != strcmp(rhs.Ptr, ""))
  12. {
  13. Ptr = ImStrdup(rhs.Ptr);
  14. }
  15. }
  16. ImString::ImString(const char* rhs)
  17. : Ptr(NULL)
  18. {
  19. if (NULL != rhs
  20. && 0 != strcmp(rhs, ""))
  21. {
  22. Ptr = ImStrdup(rhs);
  23. }
  24. }
  25. ImString::~ImString()
  26. {
  27. Clear();
  28. }
  29. ImString& ImString::operator=(const ImString& rhs)
  30. {
  31. if (this != &rhs)
  32. {
  33. *this = rhs.Ptr;
  34. }
  35. return *this;
  36. }
  37. ImString& ImString::operator=(const char* rhs)
  38. {
  39. if (Ptr != rhs)
  40. {
  41. Clear();
  42. if (NULL != rhs
  43. && 0 != strcmp(rhs, ""))
  44. {
  45. Ptr = ImStrdup(rhs);
  46. }
  47. }
  48. return *this;
  49. }
  50. void ImString::Clear()
  51. {
  52. if (NULL != Ptr)
  53. {
  54. MemFree(Ptr);
  55. Ptr = NULL;
  56. }
  57. }
  58. bool ImString::IsEmpty() const
  59. {
  60. return NULL == Ptr;
  61. }
  62. } // namespace
  63. #include "widgets/color_picker.inl"
  64. #include "widgets/color_wheel.inl"
  65. #include "widgets/dock.inl"
  66. #include "widgets/file_list.inl"
  67. #include "widgets/gizmo.inl"
  68. #include "widgets/markdown.inl"
  69. #include "widgets/range_slider.inl"