Subversion Repositories Kolibri OS

Rev

Rev 5452 | Rev 6218 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. draw_tray:      ; draw cpu usage, time, date etc.
  3.         pusha
  4.         call    draw_tray_buttons
  5.         call    draw_time_skin
  6.         call    draw_time
  7.         mov     [draw_flag_certainly],1
  8.         call    draw_flag       ; language
  9.         call    draw_list_button
  10.         popa
  11.         ret
  12. ;---------------------------------------------------------------
  13. draw_tray_buttons:
  14.         mov     [offset_x_tray],0
  15.         cmp     [minimize_right],dword 0
  16.         je      @f
  17.         add     [offset_x_tray],MR_SIZE
  18. @@:
  19.         mov     ecx,[height]
  20.         mov     esi,[wcolor]
  21.         mov     eax,8
  22.         cmp     [clock_enable],dword 0
  23.         je      @f
  24.         add     [offset_x_tray],CLOCK_SIZE
  25.         mov     ebx,[max_x]
  26.         sub     ebx,[offset_x_tray]
  27.         shl     ebx,16
  28.         add     ebx,CLOCK_SIZE+1
  29.         mcall   ,,,0x60000000+2         ; time/date button
  30.         sub     ebx,3
  31.         mov     [pos_x_clock],ebx
  32. @@:
  33.         cmp     [cpu_usage_enable],dword 0
  34.         je      @f
  35.         add     [offset_x_tray],CPU_USAGE_SIZE
  36.         mov     ebx,[max_x]
  37.         sub     ebx,[offset_x_tray]
  38.         shl     ebx,16
  39.         add     ebx,CPU_USAGE_SIZE+1
  40.         mcall   ,,,0x60000000+18        ;button 18 - sysmeter_name (GMON)
  41.         sub     ebx,3
  42.         mov     [pos_x_cpu_usage],ebx
  43. @@:
  44.         cmp     [chlang_enable],dword 0
  45.         je      @f
  46.         add     [offset_x_tray],CHLANG_SIZE
  47.         mov     ebx,[max_x]
  48.         sub     ebx,[offset_x_tray]
  49.         shl     ebx,16
  50.         add     ebx,CHLANG_SIZE+1
  51.         mcall   ,,,0x60000000+16        ;button 16 - chang language
  52.         sub     ebx,3
  53.         mov     [pos_x_cpu_chlang],ebx
  54. @@:
  55.         cmp     [page_list_enable],dword 0
  56.         je      @f
  57.         add     [offset_x_tray],PAGE_LIST_SIZE
  58.         mov     ebx,[max_x]
  59.         sub     ebx,[offset_x_tray]
  60.         shl     ebx,16
  61.         add     ebx,10
  62.         mov     [pos_x_page_list],ebx
  63.         mcall   ,,,0x60000000+22        ;button 22 - page list decrease
  64.  
  65.         add     ebx,24 shl 16
  66.         mcall   ,,,0x60000000+21        ;button 21 - page list decrease
  67. @@:
  68.         ret
  69. ;---------------------------------------------------------------
  70. draw_time_skin:
  71.         cmp     [clock_enable],dword 0
  72.         je      @b
  73.         mov     ebx,[pos_x_clock]
  74.         call    calculate_button_y_coordinate_and_size
  75.  
  76.         mov     edx,[Clock_color]       ;time_bgr_color
  77.         mov     esi,[wcolor]
  78.         jmp     draw_appl_button
  79. ;---------------------------------------------------------------
  80. draw_time:
  81.         cmp     [clock_enable],dword 0
  82.         je      @b
  83.         mcall   3
  84.         cmp     eax,[ptime]
  85.         jz      @b
  86.         mov     [ptime],eax
  87.  
  88. ; draw hours and minutes
  89.         movzx   ebx,al
  90.         shr     eax,8
  91.         movzx   ecx,al
  92.         shr     eax,8
  93.         movzx   edx,al
  94.         push    ebx
  95.         push    ecx
  96.  
  97.         mov     ebx,[pos_x_clock]
  98.         call    calculate_button_y_coordinate_and_size
  99.         movzx   eax,cx
  100.         shr     eax,1
  101.         sub     eax,4
  102.         shr     ecx,16
  103.         add     eax,ecx
  104.         mov     bx,ax
  105.         add     ebx,18 shl 16
  106.         mov     ecx,[PanelText_color]
  107.         or      ecx,0x40000000
  108.         mov     edx,[esp]       ; __:_X
  109.         and     edx,15
  110.         add     ebx,10*65536
  111.         add     edx,text
  112.         mcall   4,,,,1,[Clock_color]    ;time_bgr_color
  113.  
  114.         pop     edx             ; __:X_
  115.         shr     edx,4
  116.         and     edx,15
  117.         sub     ebx,6*65536
  118.         add     edx,text
  119.         mcall
  120.  
  121.         mov     edx,[esp]       ; _X:__
  122.         and     edx,15
  123.         sub     ebx,11*65536
  124.         add     edx,text
  125.         mcall
  126.  
  127.         pop     edx             ; X_:__
  128.         shr     edx,4
  129.         and     edx,15
  130.         sub     ebx,6*65536
  131.         add     edx,text
  132.         mcall
  133.  
  134. ; draw seconds
  135.         mov     ebx,[pos_x_clock]
  136.         call    calculate_button_y_coordinate_and_size
  137.         movzx   eax,cx
  138.         shr     eax,1
  139.         sub     eax,4
  140.         shr     ecx,16
  141.         add     eax,ecx
  142.         mov     bx,ax
  143.         add     ebx,17 shl 16
  144.         mcall   3
  145.  
  146.         mov     ecx,eax
  147.         shr     ecx,16
  148.         and     ecx,1
  149.         mov     edx,[PanelText_color]
  150.         sub     edx,[Clock_color]       ;time_bgr_color;[wcolor]
  151.         imul    ecx,edx
  152.         add     ecx,[Clock_color]       ;time_bgr_color;[wcolor]
  153.         mcall   4,,,sec,1
  154.  
  155.         jmp     draw_cpu_usage
  156. ;---------------------------------------------------------------
  157. draw_list_button:
  158.         cmp     [page_list_enable],dword 0
  159.         je      @f
  160.  
  161. ; draw page list button  "skin"
  162.         mov     ebx,[pos_x_page_list]
  163.         mov     bx,10
  164.         call    calculate_button_y_coordinate_and_size
  165.  
  166.         xor     edx,edx
  167.         mov     edx,[PageList_color]    ;0xffffff
  168.         mov     esi,[wcolor]
  169.         call    draw_appl_button
  170.  
  171.         add     ebx,24 shl 16 ; 18 shl 16
  172.         mov     edx,[PageList_color]    ;0xffffff
  173.         mov     esi,[wcolor]
  174.         call    draw_appl_button
  175.  
  176. ; draw page list button  text <>
  177.         mov     ebx,[pos_x_page_list]
  178.         add     ebx,2 shl 16
  179.         call    calculate_button_y_coordinate_and_size
  180.         movzx   eax,cx
  181.         shr     eax,1
  182.         sub     eax,4
  183.         shr     ecx,16
  184.         add     eax,ecx
  185.         mov     bx,ax
  186.         xor     ecx,ecx
  187.         mcall   4,,,page_a1,5
  188.  
  189.         add     ebx,1 shl 16
  190.         mcall
  191.  
  192. ; draw page list number
  193.         mov     edx,ebx
  194.         add     edx,9 shl 16
  195.         mcall   47,0x20000,[page_list],,[system_colours.work_button_text]
  196. @@:
  197.         ret
  198. ;---------------------------------------------------------------
  199. draw_cpu_usage:
  200.         cmp     [cpu_usage_enable],dword 0
  201.         je      @b
  202.  
  203.         pushad
  204.  
  205.         mov     eax,[height]
  206.         sub     eax,[button_top_offset]
  207.         sub     eax,[button_bottom_offset]
  208.         sub     eax,2
  209.         mov     [ysi],eax       ;12
  210.         mcall   18,5    ; TSC / SEC
  211.  
  212.         shr     eax,20
  213.         push    eax
  214.         mcall   18,4    ; IDLE / SEC
  215.  
  216.         shr     eax,20
  217.         xor     edx,edx
  218.         imul    eax,[ysi]
  219.         cdq
  220.         pop     ebx
  221.         inc     ebx
  222.         div     ebx
  223.         cmp     eax,[ysi]
  224.         jng     @f
  225.         mov     eax,[ysi]
  226. @@:
  227.         push    eax
  228.         mov     ebx,[pos_x_cpu_usage]
  229.         mov     ecx,[button_top_offset]
  230.         shl     ecx,16
  231.         add     ecx,[ysi]
  232.         add     ecx,2
  233.         mov     edx,[CpuUsageBckgr_color]       ;0xdd2222
  234.         mov     esi,[wcolor]
  235.         call    draw_appl_button
  236.         pop     eax
  237.  
  238.         mov     ecx,[button_top_offset]
  239.         inc     ecx
  240.         shl     ecx,16
  241.         add     ecx,eax
  242.         add     ebx,1 shl 16
  243.         sub     ebx,2
  244.         mcall   13,,,[CpuUsage_color]   ;0x44aa44
  245.  
  246.         popad
  247. @@:
  248.         ret
  249. ;---------------------------------------------------------------
  250. ; get and draw keyboard layout
  251. draw_flag:
  252.         cmp     [chlang_enable],dword 0
  253.         je      @b
  254.         cmp     [draw_flag_certainly],0
  255.         je      @b
  256.  
  257.         pusha
  258.  
  259.         mcall   26,2,9
  260.         mov     edx,eax
  261.         mov     [type_lang],al
  262.  
  263.         pushad
  264.         mov     ebx,[pos_x_cpu_chlang]
  265.         call    calculate_button_y_coordinate_and_size
  266.         mov     edx,[ChangeLang_color]  ;time_bgr_color ;0xff ;[wcolor]
  267.         mov     esi,[wcolor]
  268.         call    draw_appl_button
  269.         popad
  270.  
  271.         mov     ebx,[pos_x_cpu_chlang]
  272.         mov     ax,bx
  273.         shr     eax,1
  274.         shl     eax,16
  275.         add     ebx,eax
  276.         sub     ebx,6 shl 16
  277.         call    calculate_button_y_coordinate_and_size
  278.         movzx   eax,cx
  279.         shr     eax,1
  280.         sub     eax,4
  281.         shr     ecx,16
  282.         add     eax,ecx
  283.         mov     bx,ax
  284.         mov     ecx,[PanelText_color]
  285.  
  286. if caps_lock_check
  287.         push    ebx
  288.         mov     [flag_text],flagTextSm
  289.         mcall   66,3
  290.         test    eax, 0x40
  291.         jz      @f
  292.         mov     [flag_text],flagTextBg
  293. @@:
  294.         pop     ebx
  295. end if
  296.  
  297.         dec     edx
  298.         shl     edx,1
  299.         add     edx,[flag_text]
  300.         mcall   4,,,,2
  301.         popa
  302.         mov     [draw_flag_certainly],0
  303.         ret
  304.