Subversion Repositories Kolibri OS

Rev

Rev 984 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. //BOX_LIB
  2. dword edit_box_draw = #aEdit_box_draw;
  3. dword edit_box_key  = #aEdit_box_key;
  4. dword edit_box_mouse = #aEdit_box_mouse;
  5.  
  6.  
  7. dword  am__ = 0x0;
  8. dword  bm__ = 0x0;
  9.  
  10. char aEdit_box_draw[9]  = "edit_box\0";
  11. char aEdit_box_key[13] = "edit_box_key\0";
  12. char aEdit_box_mouse[15] = "edit_box_mouse\0";
  13.  
  14.  
  15.  
  16. struct edit_box{
  17. dword width, left, top, color, shift_color, focus_border_color, blur_border_color,
  18. text_color, max, text, mouse_variable, flags, size, pos, offset, cl_curs_x, cl_curs_y, shift, shift_old;
  19. };
  20.  
  21.  
  22. int fastcall load_editbox_lib(EAX)
  23. {
  24. //set mask
  25.         $mov    eax,40
  26.         $mov    ebx,0x27
  27.         $int    0x40
  28. // load DLL
  29.         $mov     eax, 68
  30.         $mov     ebx, 19
  31.         ECX="/sys/lib/box_lib.obj";
  32.         $int     0x40
  33.         $test    eax, eax
  34.         $jz      exit
  35.  
  36. // initialize import
  37.         $mov     edx,eax
  38.         ESI=#edit_box_draw;
  39. import_loop:
  40.         $lodsd
  41.         $test    eax,eax
  42.         $jz      import_done
  43.         $push    edx
  44. import_find:
  45.         $mov     ebx,DSDWORD[EDX]
  46.         $test    ebx, ebx
  47.         $jz      exit
  48.         $push    eax
  49. nex1:
  50.         $mov     cl,DSBYTE[EAX];
  51.         $cmp     cl,DSBYTE[EBX];
  52.         $jnz     import_find_next
  53.         $test    cl,cl
  54.         $jz      import_found
  55.         $inc     eax
  56.         $inc     ebx
  57.         $jmp     nex1
  58. import_find_next:
  59.         $pop     eax
  60.         $add     edx, 8
  61.         $jmp     import_find
  62. import_found:
  63.         $pop     eax
  64.         $mov     eax,DSDWORD[edx+4]
  65.         $mov     DSDWORD[esi-4],eax
  66.         $pop     edx
  67.         $jmp     import_loop
  68. import_done:
  69.         return 0;
  70. exit:
  71.         return -1;
  72. }
  73.