Subversion Repositories Kolibri OS

Rev

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

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