Subversion Repositories Kolibri OS

Rev

Rev 5676 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. // cursor file should be 32x32 in default MS Windows .cur format
  2. #ifndef INCLUDE_CURSOR_H
  3. #define INCLUDE_CURSOR_H
  4. #print "[include <cursor.h>]\n"
  5.  
  6. #ifndef INCLUDE_KOLIBRI_H
  7. #include "../lib/kolibri.h"
  8. #endif
  9.  
  10. struct CustomCursor
  11. {
  12.     dword CursorPointer;
  13.     dword Load();
  14.     dword Set();
  15.     dword Restore();
  16.     void Delete();
  17. };
  18.  
  19. dword CustomCursor::Load(dword CursorFilePath)
  20. {
  21.     if (CursorPointer) return;
  22.     EAX = 37;
  23.     EBX = 4;
  24.     ECX = CursorFilePath;
  25.     EDX = 1;
  26.     $int 0x40
  27.     CursorPointer = EAX; // 0 - err, other - handle
  28. }
  29.  
  30. dword CustomCursor::Set()
  31. {
  32.   EAX = 37;
  33.   EBX = 5;
  34.   ECX = CursorPointer;
  35.   $int 0x40
  36. }
  37.  
  38. dword CustomCursor::Restore()
  39. {
  40.   if (!CursorPointer) return;
  41.   EAX = 37;
  42.   EBX = 5;
  43.   ECX = 0;
  44.   $int 0x40
  45.   CursorPointer = 0;
  46. }
  47.  
  48. void CustomCursor::Delete()
  49. {
  50.     EAX = 37;
  51.     EBX = 6;
  52.     ECX = CursorPointer;
  53.     $int 0x40
  54. }
  55.  
  56. #endif