Subversion Repositories Kolibri OS

Rev

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

  1. /*
  2.  * System Monitor
  3.  * version 0.87
  4.  * Author: Leency
  5. */
  6.  
  7. #define MEMSIZE 4096*30
  8.  
  9. //===================================================//
  10. //                                                   //
  11. //                       LIB                         //
  12. //                                                   //
  13. //===================================================//
  14.  
  15. #include "../lib/io.h"
  16. #include "../lib/gui.h"
  17. #include "../lib/fs.h"
  18. #include "../lib/list_box.h"
  19.  
  20. #include "../lib/obj/libio.h"
  21. #include "../lib/obj/libimg.h"
  22. #include "../lib/obj/libini.h"
  23. #include "../lib/obj/box_lib.h"
  24.  
  25. #include "../lib/patterns/select_list.h"
  26. #include "../lib/patterns/restart_process.h"
  27.  
  28. //===================================================//
  29. //                                                   //
  30. //                       DATA                        //
  31. //                                                   //
  32. //===================================================//
  33.  
  34. #define WIN_PAD 20   //Window padding
  35. #define WIN_CONTENT_X WIN_PAD
  36. #define WIN_CONTENT_Y TAB_HEIGHT+WIN_PAD
  37. #define WIN_CONTENT_W 400
  38. #define WIN_CONTENT_H 465
  39. proc_info Form;
  40.  
  41. #include "general.h"
  42. #include "process.h"
  43.  
  44. #define T_GENERAL "General"
  45. #define T_PROCESSES "Processes"
  46.  
  47. enum {
  48.         TAB_GENERAL=20,
  49.         TAB_PROCESSES
  50. };
  51. _tabs tabs = { TAB_GENERAL, 4, 0, WIN_CONTENT_W+WIN_PAD+WIN_PAD-4-4, TAB_HEIGHT };
  52.  
  53. void main()
  54. {
  55.         load_dll(libio, #libio_init,1);
  56.         load_dll(libimg, #libimg_init,1);
  57.         load_dll(libini, #lib_init,1);
  58.         load_dll(boxlib, #box_lib_init,0);
  59.         General__Main();
  60. }
  61.  
  62. int Sysmon__DefineAndDrawWindow()
  63. {
  64.         sc.get();
  65.         DefineAndDrawWindow(screen.width - WIN_CONTENT_H - 200, 100, WIN_CONTENT_W + WIN_PAD + WIN_PAD +9,
  66.                 WIN_CONTENT_H + TAB_HEIGHT + skin_height + 4, 0x34, sc.work, "System Monitor",0);
  67.         GetProcessInfo(#Form, SelfInfo);
  68.         if (Form.status_window>2) return false;
  69.         //if (Form.width  < 300) { MoveSize(OLD,OLD,300,OLD); break; }
  70.         //if (Form.height < 200) { MoveSize(OLD,OLD,OLD,200); break; }
  71.         tabs.draw_wrapper();
  72.         tabs.draw_button(tabs.x+TAB_PADDING, TAB_GENERAL, T_GENERAL);  
  73.         tabs.draw_button(strlen(T_GENERAL)*8+tabs.x+TAB_PADDING+TAB_PADDING, TAB_PROCESSES, T_PROCESSES);
  74.         return true;
  75. }
  76.  
  77. //===================================================//
  78. //                                                   //
  79. //                      EVENTS                       //
  80. //                                                   //
  81. //===================================================//
  82.  
  83. void Sysmon__ButtonEvent(dword id)
  84. {
  85.         if (1==id) ExitProcess();
  86.         if (TAB_GENERAL==id) {
  87.                 tabs.active_tab = TAB_GENERAL;
  88.                 General__Main();
  89.         }
  90.         if (TAB_PROCESSES==id) {
  91.                 tabs.active_tab = TAB_PROCESSES;
  92.                 Processes__Main();
  93.         }
  94. }
  95.  
  96.  
  97. stop: