Subversion Repositories Kolibri OS

Rev

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