Subversion Repositories Kolibri OS

Rev

Rev 8134 | Blame | Last modification | View Log | Download | RSS feed

  1. proc @Kolibri@OpenFileDialog$qr23Kolibri@TOpenFileStruct uses ebx esi edi ebp
  2.   call @Kolibri@GetThreadData$qv
  3.   mov  ebp,eax
  4.   mov  ebx,[esp+20]
  5.   cmp  dword [ebx+4],0
  6.   jnz  .open_file_dlg_str
  7.   mov  esi,7
  8.   jmp  .open_file_dlg_alloc
  9. .open_file_dlg_str:
  10.   cld
  11.   mov  edi,[ebx+4]
  12.   mov  ecx,-1
  13.   xor  al,al
  14.   repnz scas byte [edi]
  15.   not  ecx
  16.   mov  esi,ecx
  17. .open_file_dlg_alloc:
  18.   push esi
  19.   call @Kolibri@Alloc$qul
  20.   pop  ecx
  21.   test eax,eax
  22.   jz   .open_file_dlg_ret
  23.   mov  ecx,esi
  24.   dec  ecx
  25.   push esi
  26.   push ecx
  27.   push eax
  28.   mov  dword [ebx],-1
  29.   cmp  dword [ebx+4],0
  30.   jnz  .open_file_dlg_copy
  31.   mov  dword [eax],0x2F64722F
  32.   mov  word [eax+4],0x2F31
  33.   jmp  .open_file_dlg_redraw
  34. .open_file_dlg_copy:
  35.   cld
  36.   mov  ecx,esi
  37.   mov  esi,[ebx+4]
  38.   mov  edi,eax
  39.   rep movs byte [edi],[esi]
  40. .open_file_dlg_redraw:
  41.   mov  eax,12
  42.   mov  ebx,1
  43.   int  0x40
  44.   xor  eax,eax
  45.   mov  ebx,[ebp+KOLIBRI_THREAD_DATA_X*4]
  46.   mov  ecx,[ebp+KOLIBRI_THREAD_DATA_Y*4]
  47.   mov  edx,[ebp+KOLIBRI_THREAD_DATA_C_WINDOW*4]
  48.   mov  esi,[ebp+KOLIBRI_THREAD_DATA_C_HEADER*4]
  49.   mov  edi,[ebp+KOLIBRI_THREAD_DATA_C_BORDER*4]
  50.   int  0x40
  51.   mov  eax,4
  52.   mov  ebx,0x00070007
  53.   mov  ecx,[ebp+KOLIBRI_THREAD_DATA_C_TITLE*4]
  54.   mov  edx,Kolibri_open_file_dlg_name
  55.   mov  esi,Kolibri_open_file_dlg_name_end - Kolibri_open_file_dlg_name
  56.   int  0x40
  57.   mov  eax,4
  58.   mov  ebx,0x000C001E
  59.   xor  ecx,ecx
  60.   mov  edx,[esp]
  61.   mov  esi,[esp+4]
  62.   int  0x40
  63.   mov  eax,12
  64.   mov  ebx,2
  65.   int  0x40
  66. .open_file_dlg_loop:
  67.   mov  eax,10
  68.   int  0x40
  69.   dec  eax
  70.   jz   .open_file_dlg_redraw
  71.   dec  eax
  72.   jz   .open_file_dlg_key
  73.   dec  eax
  74.   jz   .open_file_dlg_end
  75.   jmp  .open_file_dlg_loop
  76. .open_file_dlg_key:
  77.   xor  edi,edi
  78. .open_file_dlg_key_loop:
  79.   mov  eax,2
  80.   int  0x40
  81.   test al,al
  82.   jnz  .open_file_dlg_key_end
  83.   cmp  ah,27
  84.   jz   .open_file_dlg_end
  85.   cmp  ah,13
  86.   jz   .open_file_dlg_apply
  87.   cmp  ah,8
  88.   jz   .open_file_dlg_key_bsp
  89.   cmp  ah,32
  90.   jna  .open_file_dlg_key_loop
  91.   mov  ebx,[esp+4]
  92.   cmp  ebx,[esp+8]
  93.   jb   .open_file_dlg_key_any
  94.   lea  esi,[ebx+2*ebx]
  95.   shr  esi,1
  96.   inc  esi
  97.   push eax
  98.   push esi
  99.   push dword [esp+8]
  100.   call @Kolibri@ReAlloc$qpvul
  101.   add  esp,8
  102.   mov  ecx,eax
  103.   pop  eax
  104.   test ecx,ecx
  105.   jz   .open_file_dlg_key
  106.   mov  [esp+8],esi
  107.   mov  [esp],ecx
  108. .open_file_dlg_key_any:
  109.   mov  esi,ebx
  110.   add  esi,[esp]
  111.   mov  byte [esi],ah
  112.   inc  ebx
  113.   mov  edi,1
  114.   mov  [esp+4],ebx
  115.   jmp  .open_file_dlg_key_loop
  116. .open_file_dlg_key_bsp:
  117.   mov  eax,[esp+4]
  118.   test eax,eax
  119.   jz   .open_file_dlg_key_loop
  120.   dec  eax
  121.   mov  edi,1
  122.   mov  [esp+4],eax
  123.   jmp  .open_file_dlg_key_loop
  124. .open_file_dlg_key_end:
  125.   test edi,edi
  126.   jnz  .open_file_dlg_redraw
  127.   jmp  .open_file_dlg_loop
  128. .open_file_dlg_apply:
  129.   mov  eax,[esp+4]
  130.   inc  eax
  131.   mov  [esp+8],eax
  132.   push eax
  133.   push dword [esp+4]
  134.   call @Kolibri@ReAlloc$qpvul
  135.   add  esp,8
  136.   test eax,eax
  137.   jz   .open_file_dlg_end
  138.   mov  eax,[esp]
  139.   mov  esi,eax
  140.   add  eax,[esp+4]
  141.   mov  byte [eax],0
  142.   add  esp,12
  143.   mov  ebx,[esp+20]
  144.   mov  dword [ebx],2
  145.   push dword [ebx+4]
  146.   call @Kolibri@Free$qpv
  147.   pop  ecx
  148.   mov  [ebx+4],esi
  149.   jmp  .open_file_dlg_invalidate
  150. .open_file_dlg_end:
  151.   call @Kolibri@Free$qpv
  152.   add  esp,12
  153.   mov  ebx,[esp+20]
  154.   mov  dword [ebx],1
  155. .open_file_dlg_invalidate:
  156.   push ebp
  157.   push dword 1
  158.   call @@Kolibri@Invalidate$qippv
  159.   add  esp,8
  160. .open_file_dlg_ret:
  161.   ret
  162. endp
  163.  
  164. Kolibri_open_file_dlg_name:
  165.   db   'Open file'
  166. Kolibri_open_file_dlg_name_end:
  167.  
  168.