cursor.cpp 955 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include <precomp.h>
  2. #include "cursor.h"
  3. #define CBCLASS CursorI
  4. START_DISPATCH;
  5. CB(CURSOR_GETOSHANDLE, getOSHandle);
  6. END_DISPATCH;
  7. #ifdef WASABI_COMPILE_SKIN
  8. SkinCursor::SkinCursor(const wchar_t *elementid) {
  9. name = elementid;
  10. cursor = NULL;
  11. WASABI_API_SYSCB->syscb_registerCallback(static_cast<SkinCallbackI *>(this));
  12. }
  13. SkinCursor::SkinCursor() {
  14. WASABI_API_SYSCB->syscb_registerCallback(static_cast<SkinCallbackI *>(this));
  15. cursor = NULL;
  16. }
  17. SkinCursor::~SkinCursor() {
  18. WASABI_API_SYSCB->syscb_deregisterCallback(static_cast<SkinCallbackI *>(this));
  19. }
  20. OSCURSORHANDLE SkinCursor::getOSHandle() {
  21. if (cursor == NULL && !name.isempty()) {
  22. cursor = WASABI_API_SKIN->cursor_request(name);
  23. }
  24. return cursor;
  25. }
  26. int SkinCursor::skincb_onReset() {
  27. reset();
  28. return 1;
  29. }
  30. void SkinCursor::reset() {
  31. cursor = NULL;
  32. }
  33. void SkinCursor::setCursorElementId(const wchar_t *id) {
  34. name = id;
  35. reset();
  36. }
  37. #endif