Subversion Repositories Kolibri OS

Rev

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