Subversion Repositories Kolibri OS

Rev

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