Subversion Repositories Kolibri OS

Rev

Rev 2056 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #code32 TRUE
  2.  
  3. char   os_name[8]   = {'M','E','N','U','E','T','0','1'};
  4. dword  os_version   = 0x00000001;
  5. dword  start_addr   = #main;
  6. dword  final_addr   = #stop+32;
  7. dword  alloc_mem    = 0x00004096;
  8. dword  x86esp_reg   = 0x00004096;
  9. dword  I_Param      = 0x0;
  10. dword  I_Icon       = 0x0;
  11.  
  12. #define evButton  3
  13. #define evKey     2
  14. #define evReDraw  1
  15.  
  16. #define BT_DEL          0x80000000
  17. #define BT_HIDE 0x40000000
  18. #define BT_NOFRAME      0x20000000
  19.  
  20.  
  21. struct proc_info{
  22.         dword   use_cpu;
  23.         word    pos_in_stack,num_slot,rezerv1;
  24.         char    name[11];
  25.         char    rezerv2;
  26.         dword   adress,use_memory,ID,left,top,width,height;
  27.         word    status_slot,rezerv3;
  28.         dword   work_left,work_top,work_width,work_height;
  29.         char    status_window;
  30.         void    GetInfo(dword ECX);
  31.         byte    reserved[1024-71];
  32. #define SelfInfo -1
  33. };
  34.  
  35. void GetProcessInfo(dword EBX, ECX)
  36. {
  37.         EAX = 9;
  38.         $int  0x40
  39. }
  40.  
  41. struct system_colors{
  42.         dword frame,grab,grab_button,grab_button_text,grab_text,work,work_button,work_button_text,work_text,work_graph;
  43.         void get();
  44. };
  45. void system_colors::get()
  46. {
  47.         EAX = 48;
  48.         EBX = 3;
  49.         ECX = #frame;
  50.         EDX = 40;
  51.         $int    0x40
  52. }
  53.  
  54. inline fastcall dword WaitEvent(){
  55.  EAX = 10;              // wait here for event
  56.  $int 0x40
  57. }
  58.  
  59.  
  60. inline fastcall void ExitProcess(){
  61.  EAX = -1;              // close this program
  62.  $int 0x40
  63. }
  64.  
  65. inline fastcall byte GetKey(){
  66.  EAX = 2;              // just read it key from buffer
  67.  $int  0x40
  68.  EAX = EAX >> 8;
  69. }
  70.  
  71. inline fastcall byte GetButtonID(){
  72.  EAX = 17;            // Get ID
  73.  $int  0x40
  74.  EAX = EAX >> 8;
  75. }
  76.  
  77. inline fastcall dword GetSkinWidth()
  78. {
  79.         EAX = 48;
  80.         EBX = 4;
  81.         $int 0x40
  82. }
  83.  
  84.  
  85. void DefineButton(dword x,y,w,h,EDX,ESI)
  86. {
  87.         EAX = 8;
  88.         EBX = x<<16+w;
  89.         ECX = y<<16+h;
  90.         $int 0x40
  91. }
  92.  
  93. inline fastcall void DeleteButton(dword EDX)
  94. {
  95.         EAX = 8;
  96.         EDX += BT_DEL;
  97.         $int 0x40;
  98. }
  99.  
  100.  
  101.  
  102. inline fastcall void WindowRedrawStatus(dword EBX){
  103.         EAX = 12;
  104.         $int 0x40
  105. }
  106.  
  107.  
  108. void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,EDI)
  109. {
  110.         WindowRedrawStatus(1);
  111.         EAX = 0;
  112.         EBX = x << 16 + sizeX;
  113.         ECX = y << 16 + sizeY;
  114.         EDX = mainAreaType << 24 | mainAreaColour;
  115.         ESI = headerType << 24 | headerColour;
  116.         $int 0x40
  117.         WindowRedrawStatus(2);
  118. }
  119.  
  120.  
  121. void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
  122. {
  123.         EAX = 4;
  124.         EBX = x<<16+y;
  125.         ECX = fontType<<24+color;
  126.         $int 0x40;
  127. }
  128.  
  129.  
  130. void DrawBar(dword x,y,w,h,EDX)
  131. {
  132.         EAX = 13;
  133.         EBX = x<<16+w;
  134.         ECX = y<<16+h;
  135.         $int 0x40
  136. }
  137.  
  138.  
  139. void PutImage(dword EBX,w,h,x,y)
  140. {
  141.         EAX = 7;
  142.         ECX = w<<16+h;
  143.         EDX = x<<16+y;
  144.         $int 0x40
  145. }
  146.  
  147.  
  148. void copystr(dword s,d)
  149. {
  150.         $mov esi,s
  151.         $mov edi,d
  152.         $cld
  153. l1:
  154.         $lodsb
  155.         $stosb
  156.         $test al,al
  157.         $jnz l1
  158. }
  159.  
  160. void WriteNumber(dword x,y,byte fontType, ESI, ECX)
  161. {
  162.         EAX = 47;
  163.         EBX = 2<<16;
  164.         EDX = x<<16+y;
  165.         ESI = fontType<<24+ESI;
  166.         $int 0x40;
  167. }  
  168.