Subversion Repositories Kolibri OS

Rev

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

  1.  
  2. im_control_data_size           = 26
  3. im_redraw_all                  = 10000000b
  4. im_redraw_all_off              = 01111111b
  5. ;im_special_redraw_on           = 00000001b
  6. ;im_special_redraw_off          = 11111110b
  7.  
  8. ;****************************************************
  9. ;*******************craete Image**********************
  10. ;****************************************************
  11. ;IN
  12. ;pointer to parend
  13. ;pointer to Image's structure
  14. ;OUT
  15. ;pointer to initialized Image's structure
  16. align 4
  17.  
  18. craete_image:
  19.  
  20.       mov ebx,[esp+4]
  21.       mov eax,[esp+8]
  22.  
  23.       mov [PointerToStructureForImage],eax
  24.  
  25.       mov eax,control_header_size+im_control_data_size
  26.       call craete_control
  27.  
  28.       ;set all image's parameters in control
  29.       mov [eax],dword image
  30.  
  31.       mov ecx,im_control_data_size
  32.       mov esi,[PointerToStructureForImage]
  33.       mov edi,eax
  34.       add edi,control_header_size
  35.       rep movsb
  36.  
  37.       call get_skin_height
  38.  
  39.       mov ebx,[PointerToStructureForImage]
  40.       mov ecx,[ebx+6]   ;x
  41.       mov edx,[ebx+10]  ;y
  42.       mov esi,[ebx+14]  ;size x
  43.       mov edi,[ebx+18]  ;size y
  44.       add ecx,border_width
  45.       add edx,[skin_height]
  46.       ;copy information to control
  47.       mov [eax+24],ecx
  48.       mov [eax+28],edx
  49.       mov [eax+32],esi
  50.       mov [eax+36],edi
  51.  
  52.       ret 8
  53.  
  54. ;****************************************************
  55. ;********************Draw Image**********************
  56. ;****************************************************
  57. ;IN
  58. ;pointer to control of button
  59. ;message
  60. ;OUT
  61. ;not returned value
  62. align 4
  63.  
  64. image:
  65.  
  66.       ;get message
  67.       mov eax,[esp+8]
  68.  
  69.       ;get pointer to control of image
  70.       mov esi,[esp+4]
  71.       mov [PointerForImage],esi
  72.       ;copy control to local control
  73.       add esi,control_header_size
  74.       mov edi,dword Image
  75.       mov ecx,im_control_data_size
  76.       rep movsb
  77.  
  78.  
  79.       cmp [eax],dword 1
  80.       jne no_redraw_all_image
  81.  
  82.       or [Image.type],im_redraw_all
  83.       no_redraw_all_image:
  84.  
  85.       cmp [eax],dword 3
  86.       jne no_special_message_image
  87.  
  88.        xor eax,eax
  89.        mov al,[Image.type]
  90.        and al,activate_trap
  91.        test al,al
  92.        jz no_activate_redraw_image
  93.  
  94.          and [Image.type],deactivate_trap
  95.          or [Image.type],im_redraw_all
  96.        no_activate_redraw_image:
  97.  
  98.       no_special_message_image:
  99.  
  100.       ;load coordinats and size from control
  101.       mov eax,[PointerForImage]
  102.       mov ebx,[eax+24]           ;x
  103.       mov ecx,[eax+28]           ;y
  104.       mov edx,[eax+32]           ;size x
  105.       mov esi,[eax+36]           ;size y
  106.       ;set current coordinats and sizes in zakladka
  107.       mov [Image.x],ebx
  108.       mov [Image.y],ecx
  109.       mov [Image.sizex],edx
  110.       mov [Image.sizey],esi
  111.  
  112.       xor eax,eax
  113.       mov al,[Image.type]
  114.       and al,im_redraw_all
  115.       test al,al
  116.       jz no_redraw_image_
  117.  
  118.        and [Image.type],im_redraw_all_off
  119.  
  120.        mov esi,dword Image
  121.        mov edi,[PointerForImage]
  122.        add edi,control_header_size
  123.        mov ecx,2
  124.        rep movsb
  125.  
  126.        mov eax,7
  127.        mov ebx,[Image.pointer]
  128.        mov ecx,[Image.sizex]
  129.        shl ecx,16
  130.        add ecx,[Image.sizey]
  131.        mov edx,[Image.x]
  132.        shl edx,16
  133.        add edx,[Image.y]
  134.        mcall
  135.  
  136.       no_redraw_image_:
  137.  
  138.       exit_image:
  139.  
  140.       mov edi,[PointerForImage]
  141.       add edi,control_header_size
  142.       mov esi,dword Image
  143.       mov ecx,im_control_data_size
  144.       rep movsb
  145.  
  146.       ret 8
  147.