Subversion Repositories Kolibri OS

Rev

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

  1. /********* C library *********/
  2.    
  3. get_event()
  4. {
  5. #asm
  6.   mov  eax,10
  7.   int  0x40
  8. #endasm
  9. }
  10.    
  11. get_key()
  12. {
  13. #asm
  14.   mov  eax,2
  15.   int  0x40
  16.   and  eax,0x0000ff00
  17.   shr  eax,8
  18. #endasm
  19. }
  20.    
  21. get_button()
  22. {
  23. #asm
  24.   mov  eax,17
  25.   int  0x40
  26.   shr  eax,8
  27. #endasm
  28. }
  29.    
  30. begin_draw()
  31. {
  32. #asm
  33.   mov  ebx,1
  34.   mov  eax,12
  35.   int  0x40
  36. #endasm
  37. }
  38.    
  39. end_draw()
  40. {
  41. #asm
  42.   mov  ebx,2
  43.   mov  eax,12
  44.   int  0x40
  45. #endasm
  46. }
  47.    
  48. window(x1,y1,w,h,c_area,c_grab,c_fram)
  49. int x1,y1,w,h;            /* esp +32 +28 +24 +20 */
  50. int c_area,c_grab,c_fram; /* esp +16 +12 +8 */
  51. {
  52. #asm
  53.   ; color of frames
  54.   mov  edi,[esp+8]
  55.    
  56.   ; color of grab bar bit 8->color gl
  57.   mov  esi,[esp+12]
  58.    
  59.   ; color of work area bit 8-> color gl
  60.   mov  edx,[esp+16]
  61.    
  62.   ;left / width
  63.   mov  ebx,[esp+32]
  64.   shl  ebx,16
  65.   mov  bx,[esp+24]
  66.   ;top / height
  67.   mov  ecx,[esp+28]
  68.   shl  ecx,16
  69.   mov  cx,[esp+20]
  70.    
  71.   ;execute
  72.   mov  eax,0
  73.   int  0x40
  74. #endasm
  75. }
  76.    
  77. label(x,y,color,p_string)
  78. int x,y,color;  /* esp +20 +16 +12 */
  79. char *p_string; /* esp +8 */
  80. {
  81. #asm
  82.   mov  ebx,[esp+20]
  83.   shl  ebx,16
  84.   mov  bx,[esp+16]
  85.   mov  ecx,[esp+12]
  86.   mov  edx,[esp+8]
  87.    
  88.   ;find text lenght
  89.   xor  esi,esi
  90. .next:
  91.   cmp  byte [edx+esi],0
  92.   jz   .good
  93.   inc  esi
  94.   jmp  .next
  95. .good:
  96.    
  97.   mov  eax,4
  98.   int  0x40
  99. #endasm
  100. }
  101.  
  102. // Button + Text
  103. buttonT(x1,y1,w,h,color,id,p_string, str_color)
  104. int x1,y1,w,h;  /* esp +28 +24 +20 +16 */
  105. int color,id;
  106. char *p_string;
  107. int str_color;
  108.  
  109. {
  110.         button(x1,y1,w,h,color,id);
  111.         label(x1+4,y1+2,str_color,p_string);
  112. }
  113.    
  114. button(x1,y1,w,h,color,id)
  115. int x1,y1,w,h;  /* esp +28 +24 +20 +16 */
  116. int color,id;   /* esp +12 +8 */
  117. {
  118. #asm
  119.   ;left / width
  120.   mov  ebx,[esp+28]
  121.   shl  ebx,16
  122.   mov  bx,[esp+20]
  123.   ;top / height
  124.   mov  ecx,[esp+24]
  125.   shl  ecx,16
  126.   mov  cx,[esp+16]
  127.    
  128.   mov  edx,[esp+8]
  129.   mov  esi,[esp+12]
  130.    
  131.   mov  eax,8
  132.   int  0x40
  133. #endasm
  134. }
  135.    
  136. s_quit()
  137. {
  138. #asm
  139.   mov  eax,-1
  140.   int  0x40
  141. #endasm
  142. }
  143.    
  144. /*
  145.    
  146.  s_get_event()
  147.  s_get_key()
  148.  s_get_button()
  149.  s_begin_draw()
  150.  s_end_draw()
  151.  s_draw_window(x1,y1,w,h,c_area,c_grab,c_fram)
  152.  s_print_text(x,y,color,p_string)
  153.  s_draw_button(x1,y1,w,h,color,id)
  154.  s_quit()
  155.    
  156. */
  157.    
  158. /*****************************/
  159.