DragDropWrapper.cpp 904 B

1234567891011121314151617181920212223242526272829303132
  1. #include "imguiWrappedHeader.h"
  2. #include "DragDropWrapper.h"
  3. void* iggPayloadGetData(IggPayload handle) {
  4. ImGuiPayload *payload = reinterpret_cast<ImGuiPayload*>(handle);
  5. return payload->Data;
  6. }
  7. IggBool iggBeginDragDropSource(int flags) {
  8. return ImGui::BeginDragDropSource(flags) != 0 ? 1 : 0;
  9. }
  10. IggBool iggSetDragDropPayload(const char* type, const void* data, unsigned int sz, int cond) {
  11. return ImGui::SetDragDropPayload(type, data, sz, cond) != 0 ? 1 : 0;
  12. }
  13. void iggEndDragDropSource() {
  14. ImGui::EndDragDropSource();
  15. }
  16. IggBool iggBeginDragDropTarget() {
  17. return ImGui::BeginDragDropTarget() != 0 ? 1 : 0;
  18. }
  19. IggPayload iggAcceptDragDropPayload(const char *type, int flags) {
  20. const ImGuiPayload *payload = ImGui::AcceptDragDropPayload(type, flags);
  21. return static_cast<IggPayload>(const_cast<ImGuiPayload*>(payload));
  22. }
  23. void iggEndDragDropTarget() {
  24. ImGui::EndDragDropTarget();
  25. }