Subversion Repositories Kolibri OS

Rev

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

  1.  
  2. tx_control_data_size            = 26
  3. tx_no_show_text                 = 00000001b
  4. tx_text_and_background          = 00000010b
  5. tx_redraw_all                   = 10000000b
  6. tx_redraw_all_off               = 01111111b
  7. ;tx_special_redraw_on            = 00000100b
  8. ;tx_special_redraw_off           = 11111011b
  9.  
  10. ;****************************************************
  11. ;********************craete Text**********************
  12. ;****************************************************
  13. ;IN
  14. ;pointer to parend
  15. ;pointer to Text's structure
  16. ;OUT
  17. ;pointer to initialized Texr's structure
  18. align 4
  19.  
  20. craete_text:
  21.  
  22.       mov ebx,[esp+4]
  23.       mov eax,[esp+8]
  24.  
  25.       mov [PointerToStructureForText],eax
  26.  
  27.       mov eax,control_header_size+tx_control_data_size
  28.       call craete_control
  29.  
  30.       ;set all image's parameters in control
  31.       mov [eax],dword text
  32.  
  33.       mov ecx,tx_control_data_size
  34.       mov esi,[PointerToStructureForText]
  35.       mov edi,eax
  36.       add edi,control_header_size
  37.       rep movsb
  38.  
  39.       call get_skin_height
  40.  
  41.       mov ebx,[PointerToStructureForText]
  42.       mov ecx,[ebx+6]   ;x
  43.       mov edx,[ebx+10]  ;y
  44.       mov esi,[ebx+14]  ;length x
  45.       imul esi,6
  46.       add ecx,border_width
  47.       add edx,[skin_height]
  48.       ;copy information to control
  49.       mov [eax+24],ecx
  50.       mov [eax+28],edx
  51.       mov [eax+32],esi
  52.       mov [eax+36],dword 9
  53.  
  54.       ret 8
  55.  
  56. ;****************************************************
  57. ;********************Draw Text**********************
  58. ;****************************************************
  59. ;IN
  60. ;pointer to control of text
  61. ;message
  62. ;OUT
  63. ;not returned value
  64. align 4
  65.  
  66. text:
  67.  
  68.       ;get message
  69.       mov eax,[esp+8]
  70.  
  71.       ;get pointer to control of image
  72.       mov esi,[esp+4]
  73.       mov [PointerForText],esi
  74.       ;copy control to local control
  75.       add esi,control_header_size
  76.       mov edi,dword Text
  77.       mov ecx,tx_control_data_size
  78.       rep movsb
  79.  
  80.  
  81.       cmp [eax],dword 1
  82.       jne no_redraw_all_text
  83.  
  84.       xor ebx,ebx
  85.       mov bl,[Text.type]
  86.       and bl,tx_no_show_text
  87.       test bl,bl
  88.       jnz no_redraw_all_text
  89.  
  90.         or [Text.type],tx_redraw_all
  91.  
  92.       no_redraw_all_text:
  93.  
  94.       cmp [eax],dword 3
  95.       jne no_special_message_for_text
  96.  
  97.       xor ebx,ebx
  98.       mov bl,[Text.type]
  99.       and bl,activate_trap
  100.       test bl,bl
  101.       jz no_special_message_for_text
  102.  
  103.         or [Text.type],tx_redraw_all
  104.         and [Text.type],deactivate_trap
  105.  
  106.       no_special_message_for_text:
  107.  
  108.       ;load coordinats and size from control
  109.       mov eax,[PointerForText]
  110.       mov ebx,[eax+24]           ;x
  111.       mov ecx,[eax+28]           ;y
  112.       ;set current coordinats and sizes in zakladka
  113.       mov [Text.x],ebx
  114.       mov [Text.y],ecx
  115.  
  116.       ;get standart colors table
  117.         mov     eax,48
  118.         mov     ebx,3
  119.         mov     ecx,dword pointer2
  120.         mov     edx,40
  121.         mcall
  122.  
  123.       xor eax,eax
  124.       mov al,[Text.type]
  125.       and al,tx_redraw_all
  126.       test al,al
  127.       jz no_redraw_text_
  128.  
  129.        and [Text.type],tx_redraw_all_off
  130.  
  131.  
  132.        mov esi,dword Text
  133.        mov edi,[PointerForText]
  134.        add edi,control_header_size
  135.        mov ecx,2
  136.        rep movsb
  137.  
  138.        mov ecx,[Text.color]
  139.  
  140.        xor eax,eax
  141.        mov al,[Text.type]
  142.        and al,tx_text_and_background
  143.        test al,al
  144.        jz no_background_color
  145.  
  146.            mov edi,[Text.background_color]
  147.            or  ecx,01000000000000000000000000000000b
  148.  
  149.        no_background_color:
  150.  
  151.        mov eax,4
  152.        mov ebx,[Text.x]
  153.        shl ebx,16
  154.        add ebx,[Text.y]
  155.        mov edx,[Text.pointer]
  156.        mov esi,[Text.length]
  157.        mcall
  158.  
  159.       no_redraw_text_:
  160.  
  161.       exit_text:
  162.  
  163.       mov edi,[PointerForText]
  164.       add edi,control_header_size
  165.       mov esi,dword Text
  166.       mov ecx,tx_control_data_size
  167.       rep movsb
  168.  
  169.       ret 8
  170.