Subversion Repositories Kolibri OS

Rev

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

  1.  n_main:
  2.     mov     dword[nwin.width], 67
  3.     mov     dword[nwin.height], 16
  4.  
  5.     mov     dword[nwin.bgwidth], 66
  6.     mov     dword[nwin.bgheight], 1
  7.  
  8.     cmp     dword[dock_items.location], 1
  9.     je      .top
  10.     cmp     dword[dock_items.location], 4
  11.     je      .right
  12.     cmp     dword[dock_items.location], 3
  13.     je      .bottom
  14.     jmp     .left
  15.  
  16.  .top:
  17.     mov     eax, [win.height_opn]
  18.     mov     [nwin.y], eax
  19.  
  20.     mov     dword[nwin.bgx], 1
  21.  
  22.     jmp     @f
  23.  
  24.  .left:
  25.     mov     eax, [win.width_opn]
  26.     mov     [nwin.x], eax
  27.  
  28.     mov     dword[nwin.bgy], 1
  29.     mov     dword[nwin.bgwidth], 1
  30.     mov     eax, [nwin.height]
  31.     dec     eax
  32.     mov     dword[nwin.bgheight], eax
  33.  
  34.     jmp     @f
  35.  
  36.  .bottom:
  37.     mov     eax, [win.y_opn]
  38.     sub     eax, 16
  39.     mov     [nwin.y], eax
  40.  
  41.     mov     dword[nwin.bgx], 1
  42.     mov     eax, [nwin.height]
  43.     mov     [nwin.bgy], eax
  44.  
  45.     jmp     @f
  46.  
  47.  .right:
  48.     mov     eax, [win.x_opn]
  49.     sub     eax, 67
  50.     mov     [nwin.x], eax
  51.  
  52.     mov     eax, [nwin.width]
  53.     mov     [nwin.bgx], eax
  54.     mov     dword[nwin.bgy], 1
  55.     mov     dword[nwin.bgwidth], 1
  56.     mov     eax, [nwin.height]
  57.     dec     eax
  58.     mov     dword[nwin.bgheight], eax
  59.  
  60.   @@:
  61.  
  62.     mcall   40, 1b
  63.  
  64.     mcall   9, win.procinfo, -1
  65.     mov     ecx, [win.procinfo + 30]
  66.     mcall   18, 21
  67.     and     eax, 0xFFFF
  68.     mov     [nwin.sid], eax
  69. ;-------------------------------------------------------------------------------
  70. n_main_loop:
  71.     mcall   23, 1
  72.  
  73.     cmp     eax, EV_IDLE
  74.     je      n_event_idle
  75.     cmp     eax, EV_REDRAW
  76.     je      n_event_redraw
  77.  
  78.     jmp     n_main_loop
  79. ;-------------------------------------------------------------------------------
  80. n_event_idle:
  81.     cmp     byte[nwin.close], 1
  82.     jne     @f
  83.  
  84.     mcall   13, <0, [win.width]>, <[win.height], 1>, [color.frame]
  85.  
  86.     mov     byte[nwin.close], 0
  87.     mcall   -1
  88.  
  89.   @@:
  90.     cmp     byte[win.button_index], 100
  91.     jne     @f
  92.  
  93.     mcall   67, 0, 0, 0, 0
  94.     jmp     .end
  95.  
  96.   @@:
  97.     cmp     byte[nwin.change_shape], 1
  98.     jne     .end
  99.  
  100.     mov     byte[nwin.change_shape], 0
  101.     mcall   67, [nwin.x], [nwin.y], [nwin.width], [nwin.height]
  102.  
  103.  .end:
  104.     jmp     n_main_loop
  105. ;-------------------------------------------------------------------------------
  106. n_event_redraw:
  107.     mcall   12, 1
  108.  
  109.     mcall   0, <[nwin.x], [nwin.width]>, <[nwin.y], [nwin.height]>, [color.bg], [color.bg], [color.frame]
  110.  
  111.     mcall   13, <[nwin.bgx], [nwin.bgwidth]>, <[nwin.bgy], [nwin.bgheight]>, [color.bg]
  112.  
  113.     mov     edx, [win.button_index]
  114.     imul    edx, 16
  115.     add     edx, dock_items.name
  116.  
  117.     mov     eax, 0
  118.   @@:
  119.     inc     eax
  120.     cmp     byte[edx+eax], 0
  121.     jne     @b
  122.  
  123.     imul    eax, 3
  124.     mov     ebx, 34
  125.     sub     ebx, eax
  126.     add     ebx, 1
  127.     shl     ebx, 16
  128.     add     ebx, 5
  129.  
  130.     mcall   4, , [color.text]
  131.  
  132.     mcall   12, 2
  133.  
  134.     mcall   18, 3, [nwin.sid]
  135.  
  136.     jmp     n_main_loop