Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update

  • Loading branch information...
commit eb0c63abce4890656732c46ee76818b7fe45830b 1 parent f111638
Socketubs authored
Showing with 32,087 additions and 1 deletion.
  1. +1 −1  public/Packages.json
  2. BIN  public/x86_64/osx/novers/htop.source/build/bin/htop
  3. +10 −0 public/x86_64/osx/novers/htop.source/build/share/applications/htop.desktop
  4. +142 −0 public/x86_64/osx/novers/htop.source/build/share/man/man1/htop.1
  5. BIN  public/x86_64/osx/novers/htop.source/build/share/pixmaps/htop.png
  6. +60 −0 public/x86_64/osx/novers/htop.source/control.py
  7. BIN  public/x86_64/osx/novers/htop.source/control.pyc
  8. BIN  public/x86_64/osx/novers/htop.source/htop.tar
  9. +60 −0 public/x86_64/osx/novers/htop.source/htop/control.py
  10. BIN  public/x86_64/osx/novers/htop.source/htop/files.bz2
  11. +4 −0 public/x86_64/osx/novers/htop.source/htop/files.lst
  12. +27 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/.gitignore
  13. +1 −0  public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AUTHORS
  14. +49 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AffinityPanel.c
  15. +17 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AffinityPanel.h
  16. +71 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AvailableColumnsPanel.c
  17. +28 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AvailableColumnsPanel.h
  18. +106 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AvailableMetersPanel.c
  19. +29 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AvailableMetersPanel.h
  20. +145 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/BatteryMeter.c
  21. +38 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/BatteryMeter.h
  22. +339 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/COPYING
  23. +166 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CPUMeter.c
  24. +37 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CPUMeter.h
  25. +566 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CRT.c
  26. +134 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CRT.h
  27. +134 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CategoriesPanel.c
  28. +31 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CategoriesPanel.h
  29. +372 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ChangeLog
  30. +74 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CheckItem.c
  31. +38 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CheckItem.h
  32. +36 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ClockMeter.c
  33. +22 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ClockMeter.h
  34. +95 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ColorsPanel.c
  35. +33 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ColorsPanel.h
  36. +111 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ColumnsPanel.c
  37. +30 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ColumnsPanel.h
  38. +227 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/DebugMemory.c
  39. +71 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/DebugMemory.h
  40. +77 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/DisplayOptionsPanel.c
  41. +26 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/DisplayOptionsPanel.h
  42. +131 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/FunctionBar.c
  43. +52 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/FunctionBar.h
  44. +172 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Hashtable.c
  45. +54 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Hashtable.h
  46. +171 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Header.c
  47. +59 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Header.h
  48. +33 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/HostnameMeter.c
  49. +22 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/HostnameMeter.h
  50. +229 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/INSTALL
  51. +73 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ListItem.c
  52. +42 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ListItem.h
  53. +86 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/LoadAverageMeter.c
  54. +26 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/LoadAverageMeter.h
  55. +54 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Makefile.am
  56. +71 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/MemoryMeter.c
  57. +29 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/MemoryMeter.h
  58. +438 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Meter.c
  59. +149 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Meter.h
  60. +106 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/MetersPanel.c
  61. +26 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/MetersPanel.h
  62. +5 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/NEWS
  63. +57 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Object.c
  64. +52 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Object.h
  65. +195 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/OpenFilesScreen.c
  66. +53 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/OpenFilesScreen.h
  67. +399 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Panel.c
  68. +115 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Panel.h
  69. +728 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Process.c
  70. +190 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Process.h
  71. +1,028 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ProcessList.c
  72. +202 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ProcessList.h
  73. +50 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/README
  74. +142 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/RichString.c
  75. +82 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/RichString.h
  76. +216 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ScreenManager.c
  77. +56 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/ScreenManager.h
  78. +234 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Settings.c
  79. +37 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Settings.h
  80. +101 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/SignalItem.c
  81. +39 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/SignalItem.h
  82. +77 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/SignalsPanel.c
  83. +28 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/SignalsPanel.h
  84. +132 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/String.c
  85. +38 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/String.h
  86. +56 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/SwapMeter.c
  87. +29 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/SwapMeter.h
  88. +20 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/TODO
  89. +49 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/TasksMeter.c
  90. +24 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/TasksMeter.h
  91. +170 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/TraceScreen.c
  92. +42 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/TraceScreen.h
  93. +73 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/UptimeMeter.c
  94. +26 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/UptimeMeter.h
  95. +52 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/UsersTable.c
  96. +35 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/UsersTable.h
  97. +270 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Vector.c
  98. +80 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/Vector.h
  99. 0  public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/acinclude.m4
  100. +9 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/autogen.sh
  101. +90 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/configure.ac
  102. +28 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/debug.h
  103. +142 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/htop.1
  104. +789 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/htop.c
  105. +10 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/htop.desktop
  106. +45 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/htop.h
  107. BIN  public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/htop.png
  108. +79 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/scripts/MakeHeader.py
  109. +25 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/util.c
  110. +20 −0 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/util.h
  111. BIN  public/x86_64/osx/novers/htop.tar
  112. +549 −0 public/x86_64/osx/novers/spilleliste.source/build/bin/spilleliste
  113. +64 −0 public/x86_64/osx/novers/spilleliste.source/control.py
  114. BIN  public/x86_64/osx/novers/spilleliste.source/control.pyc
  115. +549 −0 public/x86_64/osx/novers/spilleliste.source/source/bin/spilleliste
  116. BIN  public/x86_64/osx/novers/spilleliste.source/spilleliste.tar
  117. +64 −0 public/x86_64/osx/novers/spilleliste.source/spilleliste/control.py
  118. BIN  public/x86_64/osx/novers/spilleliste.source/spilleliste/files.bz2
  119. +1 −0  public/x86_64/osx/novers/spilleliste.source/spilleliste/files.lst
  120. BIN  public/x86_64/osx/novers/spilleliste.tar
  121. +59 −0 public/x86_64/osx/novers/wget.source/control.py
  122. BIN  public/x86_64/osx/novers/wget.source/control.pyc
  123. +1 −0  public/x86_64/osx/novers/wget.source/source/wget-1.14/.tarball-version
  124. +1 −0  public/x86_64/osx/novers/wget.source/source/wget-1.14/.version
  125. +1,068 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/ABOUT-NLS
  126. +58 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/AUTHORS
  127. +674 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/COPYING
  128. +3,035 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/ChangeLog
  129. +16 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/ChangeLog.README
  130. +127 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/GNUmakefile
  131. +370 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/INSTALL
  132. +50 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/MAILING-LIST
  133. +1,708 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/Makefile
  134. +64 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/Makefile.am
  135. +1,708 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/Makefile.in
  136. +833 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/NEWS
  137. +90 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/README
  138. +1,174 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/aclocal.m4
  139. +555 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/announce-gen
  140. +139 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/build_info.pl
  141. +343 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/compile
  142. +1,534 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/config.guess
  143. +690 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/config.rpath
  144. +1,786 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/config.sub
  145. +780 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/depcomp
  146. +220 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/git-version-gen
  147. +430 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/gnupload
  148. +527 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/install-sh
  149. +224 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/mdate-sh
  150. +331 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/missing
  151. +10 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/snippet/_Noreturn.h
  152. +26 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/snippet/arg-nonnull.h
  153. +271 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/snippet/c++defs.h
  154. +109 −0 public/x86_64/osx/novers/wget.source/source/wget-1.14/build-aux/snippet/warn-on-use.h
Sorry, we could not display the entire diff because too many files (1,160) changed.
View
2  public/Packages.json
@@ -1 +1 @@
-[{"vers": "novers", "dist": "osx", "name": "spilleliste", "requires": [], "version": "0.1.0", "release": "0", "md5": "636ddc9eb74d59bb6db0845a99957b8e", "arch": "x86_64", "description": "Spilleliste read your iTunes playlist and generate for you a simple but beautiful html page to share with your friends with all the Spotify links (Youtube fallback) you want."}, {"vers": "novers", "dist": "osx", "name": "wget", "requires": [], "version": "1.14", "release": "0", "md5": "56b2e7390105c5b4e422908deb9db753", "arch": "x86_64", "description": "GNU Wget is a free software package for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc."}]
+[{"vers": "novers", "dist": "osx", "name": "htop", "requires": [], "version": "0.8.2.1", "release": "0", "md5": "17ead77b36e24eb10fb57c136a557bb6", "arch": "x86_64", "description": ""}, {"vers": "novers", "dist": "osx", "name": "spilleliste", "requires": [], "version": "0.1.0", "release": "0", "md5": "40f71436462412a24a2a5ff51e102eb9", "arch": "x86_64", "description": "Spilleliste read your iTunes playlist and generate for you a simple but beautiful html page to share with your friends with all the Spotify links (Youtube fallback) you want."}, {"vers": "novers", "dist": "osx", "name": "wget", "requires": [], "version": "1.14", "release": "0", "md5": "56b2e7390105c5b4e422908deb9db753", "arch": "x86_64", "description": "GNU Wget is a free software package for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc."}]
View
BIN  public/x86_64/osx/novers/htop.source/build/bin/htop
Binary file not shown
View
10 public/x86_64/osx/novers/htop.source/build/share/applications/htop.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Version=1.0
+Name=Htop
+Type=Application
+Comment=Show System Processes
+Terminal=true
+Exec=htop
+Icon=htop
+Categories=ConsoleOnly;System;
+GenericName=Process Viewer
View
142 public/x86_64/osx/novers/htop.source/build/share/man/man1/htop.1
@@ -0,0 +1,142 @@
+.TH "htop" "1" "0.8.2" "Bartosz Fenski <fenio@o2.pl>" "Utils"
+.SH "NAME"
+htop \- interactive process viewer
+.SH "SYNTAX"
+.LP
+.B htop
+.SH "DESCRIPTION"
+.LP
+This program is a free (GPL) ncurses-based process viewer.
+.LP
+It is similar to top, but allows to scroll the list vertically and
+horizontally to see all processes and their full command lines.
+.LP
+Tasks related to processes (killing, renicing) can be done without
+entering their PIDs.
+.br
+.SH "COMMAND-LINE OPTIONS"
+.LP
+The following flags are supported:
+.LP
+.TP
+\fB\-d DELAY\fR
+Delay between updates, in tenths of seconds
+.TP
+\fB\-u USERNAME\fR
+Show only processes of a given user
+.TP
+\fB\-\-sort\-key COLUMN\fR
+Sort by this column (use --sort-key help for a column list)
+.PP
+.br
+.SH "INTERACTIVE COMMANDS"
+.LP
+The following commands are supported:
+.LP
+.TP 5
+.B Arrows, PgUP, PgDn, Home, End
+Scroll process list.
+.TP
+.B Space
+"Tag": mark a process. Commands that can operate on multiple processes,
+like "kill", will then apply over the list of tagged processes, instead
+of the currently highlighted one.
+.TP
+.B U
+"Untag" all processes (remove all tags added with the Space key).
+.TP
+.B s
+Trace process system calls: if strace(1) is installed, pressing this key
+will attach it to the currently selected process, presenting a live
+update of system calls issued by the process.
+.TP
+.B l
+Display open files for a process: if lsof(1) is installed, pressing this key
+will display the list of file descriptors opened by the process.
+.TP
+.B F1, h
+Help screen
+.TP
+.B F2, S
+Setup screen. There you can configure meters displayed on the top side
+of the screen, as well as set various display options, choose among
+color schemes and select the layout of the displayed columns.
+.TP
+.B F3, /
+Incremental process search: type in part of a process command line and
+the selection highlight will be moved to it. While in search mode,
+pressing this key will cycle through matching occurrences.
+.TP
+.B F4, I
+Invert sort order: if sort order is increasing, switch to decreasing,
+and vice-versa.
+.TP
+.B F5, t
+Tree view: organize processes by parenthood, and layout the relations
+between them as a tree. Toggling the key will switch between tree and
+your previously selected sort view. Selecting a sort view will exit
+tree view.
+.TP
+.B F6, >
+Select field for sorting. The sort field is indicated by a
+highlight in the header.
+.TP
+.B F7, ], -
+Increase selected process priority (subtract from 'nice' value).
+This can be done by the superuser only.
+.TP
+.B F8, [, +
+Decrease selected process priority (add to 'nice' value)
+.TP
+.B F9, k
+"Kill" process: sends a signal which is selected in a menu, to one or a group
+of processes. If processes were tagged, sends the signal to all tagged processes.
+If none is tagged, sends to the currently selected process.
+.TP
+.B F10, q
+Quit
+.TP
+.B a (on multiprocessor machines)
+Set CPU affinity: mark which CPUs a process is allowed to use.
+.TP
+.B u
+Show only processes owned by a specified user.
+.TP
+.B M
+Sort by memory usage (top compatibility key).
+.TP
+.B P
+Sort by processor usage (top compatibility key).
+.TP
+.B T
+Sort by time (top compatibility key).
+.TP
+.B F
+"Follow" process: if the sort order causes the currently selected process
+to move in the list, make the selection bar follow it. This is useful for
+monitoring a process: this way, you can keep a process always visible on
+screen. When a movement key is used, "follow" loses effect.
+.TP
+.B K
+Hide kernel threads: prevent the threads belonging the kernel to be
+displayed in the process list. (This is a toggle key.)
+.TP
+.B H
+Hide user threads: on systems that represent them differently than ordinary
+processes (such as recent NPTL-based systems), this can hide threads from
+userspace processes in the process list. (This is a toggle key.)
+.TP
+.B Ctrl-L
+Refresh: redraw screen and recalculate values.
+.TP
+.B Numbers
+PID search: type in process ID and the selection highlight will be moved to it.
+.PD
+
+.SH "AUTHORS"
+.LP
+htop is developed by Hisham Muhammad <loderunner@users.sourceforge.net>.
+.br
+This man page was written by Bartosz Fenski <fenio@o2.pl> for the
+Debian GNU/Linux distribution (but it may be used by others), and
+updated by Hisham Muhammad.
View
BIN  public/x86_64/osx/novers/htop.source/build/share/pixmaps/htop.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
60 public/x86_64/osx/novers/htop.source/control.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+import os
+
+from ubik_toolbelt.logger import stream_logger
+from ubik_toolbelt.control import Control
+
+from ubik_toolbelt.contrib import which
+
+from ubik.core import conf
+
+class Package(Control):
+ def __init__(self):
+ Control.__init__(self)
+ self.name = 'htop'
+ self.version = '0.8.2.1'
+ self.release = '0'
+ self.requires = []
+ self.arch = ''
+ self.dist = ''
+ self.vers = ''
+ self.description = ''
+
+ self.cur_dir = os.getcwd()
+ self.src_dir = os.path.join(os.getcwd(), 'source')
+ self.pkg_dir = os.path.join(os.getcwd(), 'build')
+
+ def build(self):
+ stream_logger.info('Building...')
+ os.chdir(self.src_dir)
+
+ os.system('curl -k -L https://github.com/max-horvath/htop-osx/tarball/%s-2012-04-18 | tar zx' % self.version)
+ os.chdir('max-horvath-htop-osx-d92a7d4')
+ os.system('./autogen.sh')
+ os.system('./configure --disable-dependency-tracking --prefix=%s' % conf.get('settings', 'packages'))
+ os.system('make')
+
+ def package(self):
+ stream_logger.info('Packaging...')
+ os.chdir(self.src_dir)
+ os.chdir('max-horvath-htop-osx-d92a7d4')
+
+ os.system('make prefix=%s install' % self.pkg_dir)
+
+ def pre_install(self):
+ pass
+
+ def post_install(self):
+ pass
+
+ def pre_upgrade(self):
+ pass
+
+ def post_upgrade(self):
+ pass
+
+ def pre_remove(self):
+ pass
+
+ def post_remove(self):
+ pass
View
BIN  public/x86_64/osx/novers/htop.source/control.pyc
Binary file not shown
View
BIN  public/x86_64/osx/novers/htop.source/htop.tar
Binary file not shown
View
60 public/x86_64/osx/novers/htop.source/htop/control.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+import os
+
+from ubik_toolbelt.logger import stream_logger
+from ubik_toolbelt.control import Control
+
+from ubik_toolbelt.contrib import which
+
+from ubik.core import conf
+
+class Package(Control):
+ def __init__(self):
+ Control.__init__(self)
+ self.name = 'htop'
+ self.version = '0.8.2.1'
+ self.release = '0'
+ self.requires = []
+ self.arch = ''
+ self.dist = ''
+ self.vers = ''
+ self.description = ''
+
+ self.cur_dir = os.getcwd()
+ self.src_dir = os.path.join(os.getcwd(), 'source')
+ self.pkg_dir = os.path.join(os.getcwd(), 'build')
+
+ def build(self):
+ stream_logger.info('Building...')
+ os.chdir(self.src_dir)
+
+ os.system('curl -k -L https://github.com/max-horvath/htop-osx/tarball/%s-2012-04-18 | tar zx' % self.version)
+ os.chdir('max-horvath-htop-osx-d92a7d4')
+ os.system('./autogen.sh')
+ os.system('./configure --disable-dependency-tracking --prefix=%s' % conf.get('settings', 'packages'))
+ os.system('make')
+
+ def package(self):
+ stream_logger.info('Packaging...')
+ os.chdir(self.src_dir)
+ os.chdir('max-horvath-htop-osx-d92a7d4')
+
+ os.system('make prefix=%s install' % self.pkg_dir)
+
+ def pre_install(self):
+ pass
+
+ def post_install(self):
+ pass
+
+ def pre_upgrade(self):
+ pass
+
+ def post_upgrade(self):
+ pass
+
+ def pre_remove(self):
+ pass
+
+ def post_remove(self):
+ pass
View
BIN  public/x86_64/osx/novers/htop.source/htop/files.bz2
Binary file not shown
View
4 public/x86_64/osx/novers/htop.source/htop/files.lst
@@ -0,0 +1,4 @@
+./bin/htop
+./share/applications/htop.desktop
+./share/man/man1/htop.1
+./share/pixmaps/htop.png
View
27 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/.gitignore
@@ -0,0 +1,27 @@
+*.in
+*.o
+.deps
+Makefile
+aclocal.m4
+autom4te.cache
+compile
+config.guess
+config.h
+config.log
+config.status
+config.sub
+configure
+depcomp
+htop
+install-sh
+libtool
+ltmain.sh
+m4
+missing
+stamp-h1
+.*.swp
+Session.vim
+proc
+sedarwin7
+TAGS
+tags
View
1  public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AUTHORS
@@ -0,0 +1 @@
+Hisham H. Muhammad
View
49 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AffinityPanel.c
@@ -0,0 +1,49 @@
+
+#include "AffinityPanel.h"
+
+#include "Panel.h"
+#include "CheckItem.h"
+
+#include "debug.h"
+#include <assert.h>
+
+static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) {
+ HandlerResult result = IGNORED;
+ CheckItem* selected = (CheckItem*) Panel_getSelected(this);
+ switch(ch) {
+ case KEY_MOUSE:
+ case ' ':
+ CheckItem_set(selected, ! (CheckItem_get(selected)) );
+ result = HANDLED;
+ break;
+ case 0x0a:
+ case 0x0d:
+ case KEY_ENTER:
+ result = BREAK_LOOP;
+ break;
+ }
+ return result;
+}
+
+Panel* AffinityPanel_new(int processorCount, unsigned long mask) {
+ Panel* this = Panel_new(1, 1, 1, 1, CHECKITEM_CLASS, true, ListItem_compare);
+ this->eventHandler = AffinityPanel_eventHandler;
+
+ Panel_setHeader(this, "Use CPUs:");
+ for (int i = 0; i < processorCount; i++) {
+ char number[10];
+ snprintf(number, 9, "%d", i+1);
+ Panel_add(this, (Object*) CheckItem_new(String_copy(number), NULL, mask & (1 << i)));
+ }
+ return this;
+}
+
+unsigned long AffinityPanel_getAffinity(Panel* this) {
+ int size = Panel_size(this);
+ unsigned long mask = 0;
+ for (int i = 0; i < size; i++) {
+ if (CheckItem_get((CheckItem*)Panel_get(this, i)))
+ mask = mask | (1 << i);
+ }
+ return mask;
+}
View
17 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AffinityPanel.h
@@ -0,0 +1,17 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_AffinityPanel
+#define HEADER_AffinityPanel
+
+
+#include "Panel.h"
+#include "CheckItem.h"
+
+#include "debug.h"
+#include <assert.h>
+
+Panel* AffinityPanel_new(int processorCount, unsigned long mask);
+
+unsigned long AffinityPanel_getAffinity(Panel* this);
+
+#endif
View
71 ...x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AvailableColumnsPanel.c
@@ -0,0 +1,71 @@
+
+#include "AvailableColumnsPanel.h"
+#include "Settings.h"
+#include "Header.h"
+#include "ScreenManager.h"
+#include "ColumnsPanel.h"
+
+#include "Panel.h"
+
+#include "debug.h"
+#include <assert.h>
+
+/*{
+
+typedef struct AvailableColumnsPanel_ {
+ Panel super;
+ Panel* columns;
+
+ Settings* settings;
+ ScreenManager* scr;
+} AvailableColumnsPanel;
+
+}*/
+
+static void AvailableColumnsPanel_delete(Object* object) {
+ Panel* super = (Panel*) object;
+ AvailableColumnsPanel* this = (AvailableColumnsPanel*) object;
+ Panel_done(super);
+ free(this);
+}
+
+static HandlerResult AvailableColumnsPanel_eventHandler(Panel* super, int ch) {
+ AvailableColumnsPanel* this = (AvailableColumnsPanel*) super;
+ char* text = ((ListItem*) Panel_getSelected(super))->value;
+ HandlerResult result = IGNORED;
+
+ switch(ch) {
+ case 13:
+ case KEY_ENTER:
+ case KEY_F(5):
+ {
+ int at = Panel_getSelectedIndex(this->columns);
+ Panel_insert(this->columns, at, (Object*) ListItem_new(text, 0));
+ Panel_setSelected(this->columns, at+1);
+ ColumnsPanel_update(this->columns);
+ result = HANDLED;
+ break;
+ }
+ }
+ return result;
+}
+
+AvailableColumnsPanel* AvailableColumnsPanel_new(Settings* settings, Panel* columns, ScreenManager* scr) {
+ AvailableColumnsPanel* this = (AvailableColumnsPanel*) malloc(sizeof(AvailableColumnsPanel));
+ Panel* super = (Panel*) this;
+ Panel_init(super, 1, 1, 1, 1, LISTITEM_CLASS, true);
+ ((Object*)this)->delete = AvailableColumnsPanel_delete;
+
+ this->settings = settings;
+ this->scr = scr;
+ super->eventHandler = AvailableColumnsPanel_eventHandler;
+
+ Panel_setHeader(super, "Available Columns");
+
+ for (int i = 1; i < LAST_PROCESSFIELD; i++) {
+ if (i != COMM)
+ Panel_add(super, (Object*) ListItem_new(Process_fieldNames[i], 0));
+ }
+ this->columns = columns;
+ return this;
+}
View
28 ...x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AvailableColumnsPanel.h
@@ -0,0 +1,28 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_AvailableColumnsPanel
+#define HEADER_AvailableColumnsPanel
+
+#include "Settings.h"
+#include "Header.h"
+#include "ScreenManager.h"
+#include "ColumnsPanel.h"
+
+#include "Panel.h"
+
+#include "debug.h"
+#include <assert.h>
+
+
+typedef struct AvailableColumnsPanel_ {
+ Panel super;
+ Panel* columns;
+
+ Settings* settings;
+ ScreenManager* scr;
+} AvailableColumnsPanel;
+
+
+AvailableColumnsPanel* AvailableColumnsPanel_new(Settings* settings, Panel* columns, ScreenManager* scr);
+
+#endif
View
106 .../x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AvailableMetersPanel.c
@@ -0,0 +1,106 @@
+
+#include "AvailableMetersPanel.h"
+#include "Settings.h"
+#include "Header.h"
+#include "ScreenManager.h"
+#include "CPUMeter.h"
+
+#include "Panel.h"
+
+#include "debug.h"
+#include <assert.h>
+
+/*{
+
+typedef struct AvailableMetersPanel_ {
+ Panel super;
+
+ Settings* settings;
+ Panel* leftPanel;
+ Panel* rightPanel;
+ ScreenManager* scr;
+} AvailableMetersPanel;
+
+}*/
+
+static void AvailableMetersPanel_delete(Object* object) {
+ Panel* super = (Panel*) object;
+ AvailableMetersPanel* this = (AvailableMetersPanel*) object;
+ Panel_done(super);
+ free(this);
+}
+
+static inline void AvailableMetersPanel_addHeader(Header* header, Panel* panel, MeterType* type, int param, HeaderSide side) {
+ Meter* meter = (Meter*) Header_addMeter(header, type, param, side);
+ Panel_add(panel, (Object*) Meter_toListItem(meter));
+}
+
+static HandlerResult AvailableMetersPanel_eventHandler(Panel* super, int ch) {
+ AvailableMetersPanel* this = (AvailableMetersPanel*) super;
+ Header* header = this->settings->header;
+
+ ListItem* selected = (ListItem*) Panel_getSelected(super);
+ int param = selected->key & 0xff;
+ int type = selected->key >> 16;
+ HandlerResult result = IGNORED;
+
+ switch(ch) {
+ case KEY_F(5):
+ case 'l':
+ case 'L':
+ {
+ AvailableMetersPanel_addHeader(header, this->leftPanel, Meter_types[type], param, LEFT_HEADER);
+ result = HANDLED;
+ break;
+ }
+ case KEY_F(6):
+ case 'r':
+ case 'R':
+ {
+ AvailableMetersPanel_addHeader(header, this->rightPanel, Meter_types[type], param, RIGHT_HEADER);
+ result = HANDLED;
+ break;
+ }
+ }
+ if (result == HANDLED) {
+ this->settings->changed = true;
+ Header_calculateHeight(header);
+ Header_draw(header);
+ ScreenManager_resize(this->scr, this->scr->x1, header->height, this->scr->x2, this->scr->y2);
+ }
+ return result;
+}
+
+AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr) {
+ AvailableMetersPanel* this = (AvailableMetersPanel*) malloc(sizeof(AvailableMetersPanel));
+ Panel* super = (Panel*) this;
+ Panel_init(super, 1, 1, 1, 1, LISTITEM_CLASS, true);
+ ((Object*)this)->delete = AvailableMetersPanel_delete;
+
+ this->settings = settings;
+ this->leftPanel = leftMeters;
+ this->rightPanel = rightMeters;
+ this->scr = scr;
+ super->eventHandler = AvailableMetersPanel_eventHandler;
+
+ Panel_setHeader(super, "Available meters");
+ for (int i = 1; Meter_types[i]; i++) {
+ MeterType* type = Meter_types[i];
+ if (type != &CPUMeter) {
+ Panel_add(super, (Object*) ListItem_new(type->uiName, i << 16));
+ }
+ }
+ MeterType* type = &CPUMeter;
+ int processors = settings->pl->processorCount;
+ if (processors > 1) {
+ Panel_add(super, (Object*) ListItem_new("CPU average", 0));
+ for (int i = 1; i <= processors; i++) {
+ char buffer[50];
+ sprintf(buffer, "%s %d", type->uiName, i);
+ Panel_add(super, (Object*) ListItem_new(buffer, i));
+ }
+ } else {
+ Panel_add(super, (Object*) ListItem_new("CPU", 1));
+ }
+ return this;
+}
View
29 .../x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/AvailableMetersPanel.h
@@ -0,0 +1,29 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_AvailableMetersPanel
+#define HEADER_AvailableMetersPanel
+
+#include "Settings.h"
+#include "Header.h"
+#include "ScreenManager.h"
+#include "CPUMeter.h"
+
+#include "Panel.h"
+
+#include "debug.h"
+#include <assert.h>
+
+
+typedef struct AvailableMetersPanel_ {
+ Panel super;
+
+ Settings* settings;
+ Panel* leftPanel;
+ Panel* rightPanel;
+ ScreenManager* scr;
+} AvailableMetersPanel;
+
+
+AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr);
+
+#endif
View
145 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/BatteryMeter.c
@@ -0,0 +1,145 @@
+/*
+ htop
+ (C) 2004-2006 Hisham H. Muhammad
+ Released under the GNU GPL, see the COPYING file
+ in the source distribution for its full text.
+
+ This "Meter" written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
+ Adapted for OSX by Jonas Due Vesterheden (jonasduevesterheden@gmail.com)
+*/
+
+#include <CoreFoundation/CoreFoundation.h>
+#include <CoreFoundation/CFString.h>
+#include <IOKit/ps/IOPowerSources.h>
+#include <IOKit/ps/IOPSKeys.h>
+
+#include "BatteryMeter.h"
+#include "Meter.h"
+#include "ProcessList.h"
+#include "CRT.h"
+#include "String.h"
+#include "debug.h"
+
+/*{
+
+typedef enum ACPresence_ {
+ AC_ABSENT,
+ AC_PRESENT,
+ AC_ERROR
+} ACPresence;
+
+}*/
+
+int BatteryMeter_attributes[] = {
+ BATTERY
+};
+
+static ACPresence chkIsOnline() {
+ CFTypeRef sourceInfo = IOPSCopyPowerSourcesInfo();
+ CFArrayRef sourceList = IOPSCopyPowerSourcesList(sourceInfo);
+
+ // Loop through sources, find the first battery
+ int count = CFArrayGetCount(sourceList);
+ CFDictionaryRef source = NULL;
+ for(int i=0; i < count; i++) {
+ source = IOPSGetPowerSourceDescription(sourceInfo, CFArrayGetValueAtIndex(sourceList, i));
+
+ // Is this a battery?
+ CFStringRef type = (CFStringRef)CFDictionaryGetValue(source, CFSTR(kIOPSTransportTypeKey));
+ if(kCFCompareEqualTo == CFStringCompare(type, CFSTR(kIOPSInternalType), 0)) {
+ break;
+ }
+ }
+
+ ACPresence isOn = AC_ERROR;
+ if(source != NULL) {
+ CFStringRef state = CFDictionaryGetValue(source, CFSTR(kIOPSPowerSourceStateKey));
+ if(kCFCompareEqualTo == CFStringCompare(state, CFSTR(kIOPSACPowerValue), 0)) {
+ isOn = AC_PRESENT;
+ } else {
+ isOn = AC_ABSENT;
+ }
+ }
+
+ CFRelease(sourceInfo);
+ CFRelease(sourceList);
+ return isOn;
+}
+
+static double getBatData() {
+ CFTypeRef sourceInfo = IOPSCopyPowerSourcesInfo();
+ CFArrayRef sourceList = IOPSCopyPowerSourcesList(sourceInfo);
+
+ // Loop through sources, find the first battery
+ int count = CFArrayGetCount(sourceList);
+ CFDictionaryRef source = NULL;
+ for(int i=0; i < count; i++) {
+ source = IOPSGetPowerSourceDescription(sourceInfo, CFArrayGetValueAtIndex(sourceList, i));
+
+ // Is this a battery?
+ CFStringRef type = (CFStringRef)CFDictionaryGetValue(source, CFSTR(kIOPSTransportTypeKey));
+ if(kCFCompareEqualTo == CFStringCompare(type, CFSTR(kIOPSInternalType), 0)) {
+ break;
+ }
+ }
+
+ float percent = 0;
+ if(source != NULL) {
+ int curCapacity;
+ CFNumberGetValue(CFDictionaryGetValue(source, CFSTR(kIOPSCurrentCapacityKey)), kCFNumberIntType, &curCapacity);
+
+ int maxCapacity;
+ CFNumberGetValue(CFDictionaryGetValue(source, CFSTR(kIOPSMaxCapacityKey)), kCFNumberIntType, &maxCapacity);
+
+ percent = curCapacity / (float)maxCapacity*100.f;
+ }
+
+ CFRelease(sourceInfo);
+ CFRelease(sourceList);
+ return percent;
+}
+
+static void BatteryMeter_setValues(Meter * this, char *buffer, int len) {
+ double percent = getBatData();
+ if (percent == 0) {
+ snprintf(buffer, len, "n/a");
+ return;
+ }
+
+ this->values[0] = percent;
+
+ char *onAcText, *onBatteryText, *unknownText;
+
+ unknownText = "%.1f%%";
+ if (this->mode == TEXT_METERMODE) {
+ onAcText = "%.1f%% (Running on A/C)";
+ onBatteryText = "%.1f%% (Running on battery)";
+ } else {
+ onAcText = "%.1f%%(A/C)";
+ onBatteryText = "%.1f%%(bat)";
+ }
+
+ ACPresence isOnLine = chkIsOnline();
+
+ if (isOnLine == AC_PRESENT) {
+ snprintf(buffer, len, onAcText, percent);
+ } else if (isOnLine == AC_ABSENT) {
+ snprintf(buffer, len, onBatteryText, percent);
+ } else {
+ snprintf(buffer, len, unknownText, percent);
+ }
+
+ return;
+}
+
+MeterType BatteryMeter = {
+ .setValues = BatteryMeter_setValues,
+ .display = NULL,
+ .mode = TEXT_METERMODE,
+ .items = 1,
+ .total = 100.0,
+ .attributes = BatteryMeter_attributes,
+ .name = "Battery",
+ .uiName = "Battery",
+ .caption = "Battery: "
+};
View
38 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/BatteryMeter.h
@@ -0,0 +1,38 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_BatteryMeter
+#define HEADER_BatteryMeter
+/*
+ htop
+ (C) 2004-2006 Hisham H. Muhammad
+ Released under the GNU GPL, see the COPYING file
+ in the source distribution for its full text.
+
+ This "Meter" written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
+*/
+
+#include <CoreFoundation/CoreFoundation.h>
+#include <CoreFoundation/CFDateFormatter.h>
+#include <CoreFoundation/CFString.h>
+#include <IOKit/ps/IOPowerSources.h>
+#include <IOKit/ps/IOPSKeys.h>
+
+#include "Meter.h"
+#include "ProcessList.h"
+#include "CRT.h"
+#include "String.h"
+#include "debug.h"
+
+
+typedef enum ACPresence_ {
+ AC_ABSENT,
+ AC_PRESENT,
+ AC_ERROR
+} ACPresence;
+
+
+extern int BatteryMeter_attributes[];
+
+extern MeterType BatteryMeter;
+
+#endif
View
339 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
View
166 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CPUMeter.c
@@ -0,0 +1,166 @@
+/*
+htop - CPUMeter.c
+(C) 2004-2006 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "CPUMeter.h"
+#include "Meter.h"
+
+#include "ProcessList.h"
+
+#include <stdlib.h>
+#include <curses.h>
+#include <string.h>
+#include <math.h>
+
+#include "debug.h"
+#include <assert.h>
+
+int CPUMeter_attributes[] = {
+ CPU_NICE, CPU_NORMAL, CPU_KERNEL, CPU_IRQ, CPU_SOFTIRQ, CPU_IOWAIT
+};
+
+#ifndef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
+#endif
+#ifndef MAX
+#define MAX(a,b) ((a)>(b)?(a):(b))
+#endif
+
+static void CPUMeter_init(Meter* this) {
+ int processor = this->param;
+ if (this->pl->processorCount > 1) {
+ char caption[10];
+ sprintf(caption, "%-3d", processor);
+ Meter_setCaption(this, caption);
+ }
+ if (this->param == 0)
+ Meter_setCaption(this, "Avg");
+}
+
+static void CPUMeter_setValues(Meter* this, char* buffer, int size) {
+ ProcessList* pl = this->pl;
+ int processor = this->param;
+ if (processor > this->pl->processorCount) {
+ snprintf(buffer, size, "absent");
+ return;
+ }
+ double total = (double) pl->totalPeriod[processor];
+ double cpu;
+ this->values[0] = pl->nicePeriod[processor] / total * 100.0;
+ this->values[1] = pl->userPeriod[processor] / total * 100.0;
+ if (pl->detailedCPUTime) {
+ this->values[2] = pl->systemPeriod[processor] / total * 100.0;
+ this->values[3] = pl->irqPeriod[processor] / total * 100.0;
+ this->values[4] = pl->softIrqPeriod[processor] / total * 100.0;
+ this->values[5] = pl->ioWaitPeriod[processor] / total * 100.0;
+ this->type->items = 6;
+ cpu = MIN(100.0, MAX(0.0, (this->values[0]+this->values[1]+this->values[2]+
+ this->values[3]+this->values[4])));
+ } else {
+ this->values[2] = pl->systemAllPeriod[processor] / total * 100.0;
+ this->type->items = 3;
+ cpu = MIN(100.0, MAX(0.0, (this->values[0]+this->values[1]+this->values[2])));
+ }
+ snprintf(buffer, size, "%5.1f%%", cpu );
+}
+
+static void CPUMeter_display(Object* cast, RichString* out) {
+ char buffer[50];
+ Meter* this = (Meter*)cast;
+ RichString_init(out);
+ if (this->param > this->pl->processorCount) {
+ RichString_append(out, CRT_colors[METER_TEXT], "absent");
+ return;
+ }
+ sprintf(buffer, "%5.1f%% ", this->values[1]);
+ RichString_append(out, CRT_colors[METER_TEXT], ":");
+ RichString_append(out, CRT_colors[CPU_NORMAL], buffer);
+ if (this->pl->detailedCPUTime) {
+ sprintf(buffer, "%5.1f%% ", this->values[2]);
+ RichString_append(out, CRT_colors[METER_TEXT], "sy:");
+ RichString_append(out, CRT_colors[CPU_KERNEL], buffer);
+ sprintf(buffer, "%5.1f%% ", this->values[0]);
+ RichString_append(out, CRT_colors[METER_TEXT], "ni:");
+ RichString_append(out, CRT_colors[CPU_NICE], buffer);
+ sprintf(buffer, "%5.1f%% ", this->values[3]);
+ RichString_append(out, CRT_colors[METER_TEXT], "hi:");
+ RichString_append(out, CRT_colors[CPU_IRQ], buffer);
+ sprintf(buffer, "%5.1f%% ", this->values[4]);
+ RichString_append(out, CRT_colors[METER_TEXT], "si:");
+ RichString_append(out, CRT_colors[CPU_SOFTIRQ], buffer);
+ sprintf(buffer, "%5.1f%% ", this->values[5]);
+ RichString_append(out, CRT_colors[METER_TEXT], "wa:");
+ RichString_append(out, CRT_colors[CPU_IOWAIT], buffer);
+ } else {
+ sprintf(buffer, "%5.1f%% ", this->values[2]);
+ RichString_append(out, CRT_colors[METER_TEXT], "sys:");
+ RichString_append(out, CRT_colors[CPU_KERNEL], buffer);
+ sprintf(buffer, "%5.1f%% ", this->values[0]);
+ RichString_append(out, CRT_colors[METER_TEXT], "low:");
+ RichString_append(out, CRT_colors[CPU_NICE], buffer);
+ }
+}
+
+static void AllCPUsMeter_init(Meter* this) {
+ int processors = this->pl->processorCount;
+ this->drawBuffer = malloc(sizeof(Meter*) * processors);
+ Meter** meters = (Meter**) this->drawBuffer;
+ for (int i = 0; i < processors; i++)
+ meters[i] = Meter_new(this->pl, i+1, &CPUMeter);
+ this->h = processors;
+ this->mode = BAR_METERMODE;
+}
+
+static void AllCPUsMeter_done(Meter* this) {
+ int processors = this->pl->processorCount;
+ Meter** meters = (Meter**) this->drawBuffer;
+ for (int i = 0; i < processors; i++)
+ Meter_delete((Object*)meters[i]);
+}
+
+static void AllCPUsMeter_setMode(Meter* this, int mode) {
+ this->mode = mode;
+ int processors = this->pl->processorCount;
+ int h = Meter_modes[this->mode]->h;
+ this->h = h * processors;
+}
+
+static void AllCPUsMeter_draw(Meter* this, int x, int y, int w) {
+ int processors = this->pl->processorCount;
+ Meter** meters = (Meter**) this->drawBuffer;
+ for (int i = 0; i < processors; i++) {
+ Meter_setMode(meters[i], this->mode);
+ meters[i]->draw(meters[i], x, y, w);
+ y += meters[i]->h;
+ }
+}
+
+MeterType CPUMeter = {
+ .setValues = CPUMeter_setValues,
+ .display = CPUMeter_display,
+ .mode = BAR_METERMODE,
+ .items = 6,
+ .total = 100.0,
+ .attributes = CPUMeter_attributes,
+ .name = "CPU",
+ .uiName = "CPU",
+ .caption = "CPU",
+ .init = CPUMeter_init
+};
+
+MeterType AllCPUsMeter = {
+ .mode = 0,
+ .items = 1,
+ .total = 100.0,
+ .attributes = CPUMeter_attributes,
+ .name = "AllCPUs",
+ .uiName = "All CPUs",
+ .caption = "CPU",
+ .draw = AllCPUsMeter_draw,
+ .init = AllCPUsMeter_init,
+ .setMode = AllCPUsMeter_setMode,
+ .done = AllCPUsMeter_done
+};
View
37 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CPUMeter.h
@@ -0,0 +1,37 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_CPUMeter
+#define HEADER_CPUMeter
+/*
+htop - CPUMeter.h
+(C) 2004-2006 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Meter.h"
+
+#include "ProcessList.h"
+
+#include <stdlib.h>
+#include <curses.h>
+#include <string.h>
+#include <math.h>
+
+#include "debug.h"
+#include <assert.h>
+
+extern int CPUMeter_attributes[];
+
+#ifndef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
+#endif
+#ifndef MAX
+#define MAX(a,b) ((a)>(b)?(a):(b))
+#endif
+
+extern MeterType CPUMeter;
+
+extern MeterType AllCPUsMeter;
+
+#endif
View
566 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CRT.c
@@ -0,0 +1,566 @@
+/*
+htop - CRT.c
+(C) 2004-2006 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "CRT.h"
+
+#include <curses.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdbool.h>
+
+#include "String.h"
+
+#include "config.h"
+#include "debug.h"
+
+#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)
+
+#define COLORSCHEME_DEFAULT 0
+#define COLORSCHEME_MONOCHROME 1
+#define COLORSCHEME_BLACKONWHITE 2
+#define COLORSCHEME_BLACKONWHITE2 3
+#define COLORSCHEME_MIDNIGHT 4
+#define COLORSCHEME_BLACKNIGHT 5
+
+#define Black COLOR_BLACK
+#define Red COLOR_RED
+#define Green COLOR_GREEN
+#define Yellow COLOR_YELLOW
+#define Blue COLOR_BLUE
+#define Magenta COLOR_MAGENTA
+#define Cyan COLOR_CYAN
+#define White COLOR_WHITE
+
+//#link curses
+
+bool CRT_hasColors;
+
+/*{
+
+typedef enum ColorElements_ {
+ RESET_COLOR,
+ DEFAULT_COLOR,
+ FUNCTION_BAR,
+ FUNCTION_KEY,
+ FAILED_SEARCH,
+ PANEL_HEADER_FOCUS,
+ PANEL_HEADER_UNFOCUS,
+ PANEL_HIGHLIGHT_FOCUS,
+ PANEL_HIGHLIGHT_UNFOCUS,
+ LARGE_NUMBER,
+ METER_TEXT,
+ METER_VALUE,
+ LED_COLOR,
+ UPTIME,
+ BATTERY,
+ TASKS_TOTAL,
+ TASKS_RUNNING,
+ SWAP,
+ PROCESS,
+ PROCESS_SHADOW,
+ PROCESS_TAG,
+ PROCESS_MEGABYTES,
+ PROCESS_TREE,
+ PROCESS_R_STATE,
+ PROCESS_BASENAME,
+ PROCESS_HIGH_PRIORITY,
+ PROCESS_LOW_PRIORITY,
+ PROCESS_THREAD,
+ PROCESS_THREAD_BASENAME,
+ BAR_BORDER,
+ BAR_SHADOW,
+ GRAPH_1,
+ GRAPH_2,
+ GRAPH_3,
+ GRAPH_4,
+ GRAPH_5,
+ GRAPH_6,
+ GRAPH_7,
+ GRAPH_8,
+ GRAPH_9,
+ MEMORY_USED,
+ MEMORY_BUFFERS,
+ MEMORY_CACHE,
+ LOAD,
+ LOAD_AVERAGE_FIFTEEN,
+ LOAD_AVERAGE_FIVE,
+ LOAD_AVERAGE_ONE,
+ CHECK_BOX,
+ CHECK_MARK,
+ CHECK_TEXT,
+ CLOCK,
+ CPU_NICE,
+ CPU_NORMAL,
+ CPU_KERNEL,
+ HELP_BOLD,
+ CPU_IOWAIT,
+ CPU_IRQ,
+ CPU_SOFTIRQ,
+ HOSTNAME,
+ LAST_COLORELEMENT
+} ColorElements;
+
+}*/
+
+// TODO: centralize these in Settings.
+
+int CRT_delay = 0;
+
+int CRT_colorScheme = 0;
+
+int CRT_colors[LAST_COLORELEMENT] = { 0 };
+
+char* CRT_termType;
+
+static void CRT_handleSIGSEGV(int signal) {
+ CRT_done();
+ fprintf(stderr, "htop " VERSION " aborted. Please report bug at http://htop.sf.net\n");
+ exit(1);
+}
+
+static void CRT_handleSIGTERM(int signal) {
+ CRT_done();
+ exit(0);
+}
+
+// TODO: pass an instance of Settings instead.
+
+void CRT_init(int delay, int colorScheme) {
+ initscr();
+ noecho();
+ CRT_delay = delay;
+ CRT_colorScheme = colorScheme;
+ halfdelay(CRT_delay);
+ nonl();
+ intrflush(stdscr, false);
+ keypad(stdscr, true);
+ curs_set(0);
+ if (has_colors()) {
+ start_color();
+ CRT_hasColors = true;
+ } else {
+ CRT_hasColors = false;
+ }
+ CRT_termType = getenv("TERM");
+ if (String_eq(CRT_termType, "xterm") || String_eq(CRT_termType, "xterm-color") || String_eq(CRT_termType, "vt220")) {
+ define_key("\033[H", KEY_HOME);
+ define_key("\033[F", KEY_END);
+ define_key("\033OP", KEY_F(1));
+ define_key("\033OQ", KEY_F(2));
+ define_key("\033OR", KEY_F(3));
+ define_key("\033OS", KEY_F(4));
+ define_key("\033[11~", KEY_F(1));
+ define_key("\033[12~", KEY_F(2));
+ define_key("\033[13~", KEY_F(3));
+ define_key("\033[14~", KEY_F(4));
+ define_key("\033[17;2~", KEY_F(18));
+ }
+#ifndef DEBUG
+ signal(11, CRT_handleSIGSEGV);
+#endif
+ signal(SIGTERM, CRT_handleSIGTERM);
+ use_default_colors();
+ if (!has_colors())
+ CRT_colorScheme = 1;
+ CRT_setColors(CRT_colorScheme);
+
+ mousemask(BUTTON1_CLICKED, NULL);
+}
+
+void CRT_done() {
+ curs_set(1);
+ endwin();
+}
+
+int CRT_readKey() {
+ nocbreak();
+ cbreak();
+ nodelay(stdscr, FALSE);
+ int ret = getch();
+ halfdelay(CRT_delay);
+ return ret;
+}
+
+void CRT_disableDelay() {
+ nocbreak();
+ cbreak();
+ nodelay(stdscr, TRUE);
+}
+
+void CRT_enableDelay() {
+ halfdelay(CRT_delay);
+}
+
+void CRT_setColors(int colorScheme) {
+ CRT_colorScheme = colorScheme;
+ if (colorScheme == COLORSCHEME_BLACKNIGHT) {
+ for (int i = 0; i < 8; i++)
+ for (int j = 0; j < 8; j++)
+ init_pair((7-i)*8+j, i, j);
+ } else {
+ for (int i = 0; i < 8; i++)
+ for (int j = 0; j < 8; j++)
+ init_pair((7-i)*8+j, i, (j==0?-1:j));
+ }
+
+ if (colorScheme == COLORSCHEME_MONOCHROME) {
+ CRT_colors[RESET_COLOR] = A_NORMAL;
+ CRT_colors[DEFAULT_COLOR] = A_NORMAL;
+ CRT_colors[FUNCTION_BAR] = A_REVERSE;
+ CRT_colors[FUNCTION_KEY] = A_NORMAL;
+ CRT_colors[PANEL_HEADER_FOCUS] = A_REVERSE;
+ CRT_colors[PANEL_HEADER_UNFOCUS] = A_REVERSE;
+ CRT_colors[PANEL_HIGHLIGHT_FOCUS] = A_REVERSE;
+ CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = A_BOLD;
+ CRT_colors[FAILED_SEARCH] = A_REVERSE | A_BOLD;
+ CRT_colors[UPTIME] = A_BOLD;
+ CRT_colors[BATTERY] = A_BOLD;
+ CRT_colors[LARGE_NUMBER] = A_BOLD;
+ CRT_colors[METER_TEXT] = A_NORMAL;
+ CRT_colors[METER_VALUE] = A_BOLD;
+ CRT_colors[LED_COLOR] = A_NORMAL;
+ CRT_colors[TASKS_RUNNING] = A_BOLD;
+ CRT_colors[PROCESS] = A_NORMAL;
+ CRT_colors[PROCESS_SHADOW] = A_DIM;
+ CRT_colors[PROCESS_TAG] = A_BOLD;
+ CRT_colors[PROCESS_MEGABYTES] = A_BOLD;
+ CRT_colors[PROCESS_BASENAME] = A_BOLD;
+ CRT_colors[PROCESS_TREE] = A_BOLD;
+ CRT_colors[PROCESS_R_STATE] = A_BOLD;
+ CRT_colors[PROCESS_HIGH_PRIORITY] = A_BOLD;
+ CRT_colors[PROCESS_LOW_PRIORITY] = A_DIM;
+ CRT_colors[PROCESS_THREAD] = A_BOLD;
+ CRT_colors[PROCESS_THREAD_BASENAME] = A_REVERSE;
+ CRT_colors[BAR_BORDER] = A_BOLD;
+ CRT_colors[BAR_SHADOW] = A_DIM;
+ CRT_colors[SWAP] = A_BOLD;
+ CRT_colors[GRAPH_1] = A_BOLD;
+ CRT_colors[GRAPH_2] = A_BOLD;
+ CRT_colors[GRAPH_3] = A_BOLD;
+ CRT_colors[GRAPH_4] = A_NORMAL;
+ CRT_colors[GRAPH_5] = A_NORMAL;
+ CRT_colors[GRAPH_6] = A_NORMAL;
+ CRT_colors[GRAPH_7] = A_DIM;
+ CRT_colors[GRAPH_8] = A_DIM;
+ CRT_colors[GRAPH_9] = A_DIM;
+ CRT_colors[MEMORY_USED] = A_BOLD;
+ CRT_colors[MEMORY_BUFFERS] = A_NORMAL;
+ CRT_colors[MEMORY_CACHE] = A_NORMAL;
+ CRT_colors[LOAD_AVERAGE_FIFTEEN] = A_DIM;
+ CRT_colors[LOAD_AVERAGE_FIVE] = A_NORMAL;
+ CRT_colors[LOAD_AVERAGE_ONE] = A_BOLD;
+ CRT_colors[LOAD] = A_BOLD;
+ CRT_colors[HELP_BOLD] = A_BOLD;
+ CRT_colors[CPU_NICE] = A_NORMAL;
+ CRT_colors[CPU_NORMAL] = A_BOLD;
+ CRT_colors[CPU_KERNEL] = A_BOLD;
+ CRT_colors[CLOCK] = A_BOLD;
+ CRT_colors[CHECK_BOX] = A_BOLD;
+ CRT_colors[CHECK_MARK] = A_NORMAL;
+ CRT_colors[CHECK_TEXT] = A_NORMAL;
+ CRT_colors[CPU_IOWAIT] = A_NORMAL;
+ CRT_colors[CPU_IRQ] = A_BOLD;
+ CRT_colors[CPU_SOFTIRQ] = A_BOLD;
+ CRT_colors[HOSTNAME] = A_BOLD;
+ } else if (CRT_colorScheme == COLORSCHEME_BLACKONWHITE) {
+ CRT_colors[RESET_COLOR] = ColorPair(Black,White);
+ CRT_colors[DEFAULT_COLOR] = ColorPair(Black,White);
+ CRT_colors[FUNCTION_BAR] = ColorPair(Black,Cyan);
+ CRT_colors[FUNCTION_KEY] = ColorPair(Black,White);
+ CRT_colors[PANEL_HEADER_FOCUS] = ColorPair(Black,Green);
+ CRT_colors[PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green);
+ CRT_colors[PANEL_HIGHLIGHT_FOCUS] = ColorPair(Black,Cyan);
+ CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = ColorPair(Blue,White);
+ CRT_colors[FAILED_SEARCH] = ColorPair(Red,Cyan);
+ CRT_colors[UPTIME] = ColorPair(Yellow,White);
+ CRT_colors[BATTERY] = ColorPair(Yellow,White);
+ CRT_colors[LARGE_NUMBER] = ColorPair(Red,White);
+ CRT_colors[METER_TEXT] = ColorPair(Blue,White);
+ CRT_colors[METER_VALUE] = ColorPair(Black,White);
+ CRT_colors[LED_COLOR] = ColorPair(Green,White);
+ CRT_colors[TASKS_RUNNING] = ColorPair(Green,White);
+ CRT_colors[PROCESS] = ColorPair(Black,White);
+ CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,White);
+ CRT_colors[PROCESS_TAG] = ColorPair(White,Blue);
+ CRT_colors[PROCESS_MEGABYTES] = ColorPair(Blue,White);
+ CRT_colors[PROCESS_BASENAME] = ColorPair(Blue,White);
+ CRT_colors[PROCESS_TREE] = ColorPair(Green,White);
+ CRT_colors[PROCESS_R_STATE] = ColorPair(Green,White);
+ CRT_colors[PROCESS_HIGH_PRIORITY] = ColorPair(Red,White);
+ CRT_colors[PROCESS_LOW_PRIORITY] = ColorPair(Red,White);
+ CRT_colors[PROCESS_THREAD] = ColorPair(Blue,White);
+ CRT_colors[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,White);
+ CRT_colors[BAR_BORDER] = ColorPair(Blue,White);
+ CRT_colors[BAR_SHADOW] = ColorPair(Black,White);
+ CRT_colors[SWAP] = ColorPair(Red,White);
+ CRT_colors[GRAPH_1] = ColorPair(Yellow,White);
+ CRT_colors[GRAPH_2] = ColorPair(Yellow,White);
+ CRT_colors[GRAPH_3] = ColorPair(Yellow,White);
+ CRT_colors[GRAPH_4] = ColorPair(Yellow,White);
+ CRT_colors[GRAPH_5] = ColorPair(Yellow,White);
+ CRT_colors[GRAPH_6] = ColorPair(Yellow,White);
+ CRT_colors[GRAPH_7] = ColorPair(Yellow,White);
+ CRT_colors[GRAPH_8] = ColorPair(Yellow,White);
+ CRT_colors[GRAPH_9] = ColorPair(Yellow,White);
+ CRT_colors[MEMORY_USED] = ColorPair(Green,White);
+ CRT_colors[MEMORY_BUFFERS] = ColorPair(Cyan,White);
+ CRT_colors[MEMORY_CACHE] = ColorPair(Yellow,White);
+ CRT_colors[LOAD_AVERAGE_FIFTEEN] = ColorPair(Black,White);
+ CRT_colors[LOAD_AVERAGE_FIVE] = ColorPair(Black,White);
+ CRT_colors[LOAD_AVERAGE_ONE] = ColorPair(Black,White);
+ CRT_colors[LOAD] = ColorPair(Black,White);
+ CRT_colors[HELP_BOLD] = ColorPair(Blue,White);
+ CRT_colors[CPU_NICE] = ColorPair(Cyan,White);
+ CRT_colors[CPU_NORMAL] = ColorPair(Green,White);
+ CRT_colors[CPU_KERNEL] = ColorPair(Red,White);
+ CRT_colors[CLOCK] = ColorPair(Black,White);
+ CRT_colors[CHECK_BOX] = ColorPair(Blue,White);
+ CRT_colors[CHECK_MARK] = ColorPair(Black,White);
+ CRT_colors[CHECK_TEXT] = ColorPair(Black,White);
+ CRT_colors[CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black);
+ CRT_colors[CPU_IRQ] = ColorPair(Blue,White);
+ CRT_colors[CPU_SOFTIRQ] = ColorPair(Blue,White);
+ CRT_colors[HOSTNAME] = ColorPair(Black,White);
+ } else if (CRT_colorScheme == COLORSCHEME_BLACKONWHITE2) {
+ CRT_colors[RESET_COLOR] = ColorPair(Black,Black);
+ CRT_colors[DEFAULT_COLOR] = ColorPair(Black,Black);
+ CRT_colors[FUNCTION_BAR] = ColorPair(Black,Cyan);
+ CRT_colors[FUNCTION_KEY] = ColorPair(Black,Black);
+ CRT_colors[PANEL_HEADER_FOCUS] = ColorPair(Black,Green);
+ CRT_colors[PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green);
+ CRT_colors[PANEL_HIGHLIGHT_FOCUS] = ColorPair(Black,Cyan);
+ CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = ColorPair(Blue,Black);
+ CRT_colors[FAILED_SEARCH] = ColorPair(Red,Cyan);
+ CRT_colors[UPTIME] = ColorPair(Yellow,Black);
+ CRT_colors[BATTERY] = ColorPair(Yellow,Black);
+ CRT_colors[LARGE_NUMBER] = ColorPair(Red,Black);
+ CRT_colors[METER_TEXT] = ColorPair(Blue,Black);
+ CRT_colors[METER_VALUE] = ColorPair(Black,Black);
+ CRT_colors[LED_COLOR] = ColorPair(Green,Black);
+ CRT_colors[TASKS_RUNNING] = ColorPair(Green,Black);
+ CRT_colors[PROCESS] = ColorPair(Black,Black);
+ CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black);
+ CRT_colors[PROCESS_TAG] = ColorPair(White,Blue);
+ CRT_colors[PROCESS_MEGABYTES] = ColorPair(Blue,Black);
+ CRT_colors[PROCESS_BASENAME] = ColorPair(Green,Black);
+ CRT_colors[PROCESS_TREE] = ColorPair(Blue,Black);
+ CRT_colors[PROCESS_R_STATE] = ColorPair(Green,Black);
+ CRT_colors[PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black);
+ CRT_colors[PROCESS_LOW_PRIORITY] = ColorPair(Red,Black);
+ CRT_colors[PROCESS_THREAD] = ColorPair(Blue,Black);
+ CRT_colors[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,Black);
+ CRT_colors[BAR_BORDER] = ColorPair(Blue,Black);
+ CRT_colors[BAR_SHADOW] = ColorPair(Black,Black);
+ CRT_colors[SWAP] = ColorPair(Red,Black);
+ CRT_colors[GRAPH_1] = ColorPair(Yellow,Black);
+ CRT_colors[GRAPH_2] = ColorPair(Yellow,Black);
+ CRT_colors[GRAPH_3] = ColorPair(Yellow,Black);
+ CRT_colors[GRAPH_4] = ColorPair(Yellow,Black);
+ CRT_colors[GRAPH_5] = ColorPair(Yellow,Black);
+ CRT_colors[GRAPH_6] = ColorPair(Yellow,Black);
+ CRT_colors[GRAPH_7] = ColorPair(Yellow,Black);
+ CRT_colors[GRAPH_8] = ColorPair(Yellow,Black);
+ CRT_colors[GRAPH_9] = ColorPair(Yellow,Black);
+ CRT_colors[MEMORY_USED] = ColorPair(Green,Black);
+ CRT_colors[MEMORY_BUFFERS] = ColorPair(Cyan,Black);
+ CRT_colors[MEMORY_CACHE] = ColorPair(Yellow,Black);
+ CRT_colors[LOAD_AVERAGE_FIFTEEN] = ColorPair(Black,Black);
+ CRT_colors[LOAD_AVERAGE_FIVE] = ColorPair(Black,Black);
+ CRT_colors[LOAD_AVERAGE_ONE] = ColorPair(Black,Black);
+ CRT_colors[LOAD] = ColorPair(White,Black);
+ CRT_colors[HELP_BOLD] = ColorPair(Blue,Black);
+ CRT_colors[CPU_NICE] = ColorPair(Cyan,Black);
+ CRT_colors[CPU_NORMAL] = ColorPair(Green,Black);
+ CRT_colors[CPU_KERNEL] = ColorPair(Red,Black);
+ CRT_colors[CLOCK] = ColorPair(White,Black);
+ CRT_colors[CHECK_BOX] = ColorPair(Blue,Black);
+ CRT_colors[CHECK_MARK] = ColorPair(Black,Black);
+ CRT_colors[CHECK_TEXT] = ColorPair(Black,Black);
+ CRT_colors[CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black);
+ CRT_colors[CPU_IRQ] = A_BOLD | ColorPair(Blue,Black);
+ CRT_colors[CPU_SOFTIRQ] = ColorPair(Blue,Black);
+ CRT_colors[HOSTNAME] = ColorPair(White,Black);
+ } else if (CRT_colorScheme == COLORSCHEME_MIDNIGHT) {
+ CRT_colors[RESET_COLOR] = ColorPair(White,Blue);
+ CRT_colors[DEFAULT_COLOR] = ColorPair(White,Blue);
+ CRT_colors[FUNCTION_BAR] = ColorPair(Black,Cyan);
+ CRT_colors[FUNCTION_KEY] = A_NORMAL;
+ CRT_colors[PANEL_HEADER_FOCUS] = ColorPair(Black,Cyan);
+ CRT_colors[PANEL_HEADER_UNFOCUS] = ColorPair(Black,Cyan);
+ CRT_colors[PANEL_HIGHLIGHT_FOCUS] = ColorPair(Black,White);
+ CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[FAILED_SEARCH] = ColorPair(Red,Cyan);
+ CRT_colors[UPTIME] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[BATTERY] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[LARGE_NUMBER] = A_BOLD | ColorPair(Red,Blue);
+ CRT_colors[METER_TEXT] = ColorPair(Cyan,Blue);
+ CRT_colors[METER_VALUE] = A_BOLD | ColorPair(Cyan,Blue);
+ CRT_colors[LED_COLOR] = ColorPair(Green,Blue);
+ CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Blue);
+ CRT_colors[PROCESS] = ColorPair(White,Blue);
+ CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Blue);
+ CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[PROCESS_MEGABYTES] = ColorPair(Cyan,Blue);
+ CRT_colors[PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan,Blue);
+ CRT_colors[PROCESS_TREE] = ColorPair(Cyan,Blue);
+ CRT_colors[PROCESS_R_STATE] = ColorPair(Green,Blue);
+ CRT_colors[PROCESS_HIGH_PRIORITY] = ColorPair(Red,Blue);
+ CRT_colors[PROCESS_LOW_PRIORITY] = ColorPair(Red,Blue);
+ CRT_colors[PROCESS_THREAD] = ColorPair(Green,Blue);
+ CRT_colors[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green,Blue);
+ CRT_colors[BAR_BORDER] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[BAR_SHADOW] = ColorPair(Cyan,Blue);
+ CRT_colors[SWAP] = ColorPair(Red,Blue);
+ CRT_colors[GRAPH_1] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[GRAPH_2] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[GRAPH_3] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[GRAPH_4] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[GRAPH_5] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[GRAPH_6] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[GRAPH_7] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[GRAPH_8] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[GRAPH_9] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[MEMORY_USED] = A_BOLD | ColorPair(Green,Blue);
+ CRT_colors[MEMORY_BUFFERS] = A_BOLD | ColorPair(Cyan,Blue);
+ CRT_colors[MEMORY_CACHE] = A_BOLD | ColorPair(Yellow,Blue);
+ CRT_colors[LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Black,Blue);
+ CRT_colors[LOAD_AVERAGE_FIVE] = A_NORMAL | ColorPair(White,Blue);
+ CRT_colors[LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White,Blue);
+ CRT_colors[LOAD] = A_BOLD | ColorPair(White,Blue);
+ CRT_colors[HELP_BOLD] = A_BOLD | ColorPair(Cyan,Blue);
+ CRT_colors[CPU_NICE] = A_BOLD | ColorPair(Cyan,Blue);
+ CRT_colors[CPU_NORMAL] = A_BOLD | ColorPair(Green,Blue);
+ CRT_colors[CPU_KERNEL] = A_BOLD | ColorPair(Red,Blue);
+ CRT_colors[CLOCK] = ColorPair(White,Blue);
+ CRT_colors[CHECK_BOX] = ColorPair(Cyan,Blue);
+ CRT_colors[CHECK_MARK] = A_BOLD | ColorPair(White,Blue);
+ CRT_colors[CHECK_TEXT] = A_NORMAL | ColorPair(White,Blue);
+ CRT_colors[CPU_IOWAIT] = ColorPair(Yellow,Blue);
+ CRT_colors[CPU_IRQ] = A_BOLD | ColorPair(Black,Blue);
+ CRT_colors[CPU_SOFTIRQ] = ColorPair(Black,Blue);
+ CRT_colors[HOSTNAME] = ColorPair(White,Blue);
+ } else if (CRT_colorScheme == COLORSCHEME_BLACKNIGHT) {
+ CRT_colors[RESET_COLOR] = ColorPair(Cyan,Black);
+ CRT_colors[DEFAULT_COLOR] = ColorPair(Cyan,Black);
+ CRT_colors[FUNCTION_BAR] = ColorPair(Black,Green);
+ CRT_colors[FUNCTION_KEY] = ColorPair(Cyan,Black);
+ CRT_colors[PANEL_HEADER_FOCUS] = ColorPair(Black,Green);
+ CRT_colors[PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green);
+ CRT_colors[PANEL_HIGHLIGHT_FOCUS] = ColorPair(Black,Cyan);
+ CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = ColorPair(Black,White);
+ CRT_colors[FAILED_SEARCH] = ColorPair(Red,Cyan);
+ CRT_colors[UPTIME] = ColorPair(Green,Black);
+ CRT_colors[BATTERY] = ColorPair(Green,Black);
+ CRT_colors[LARGE_NUMBER] = A_BOLD | ColorPair(Red,Black);
+ CRT_colors[METER_TEXT] = ColorPair(Cyan,Black);
+ CRT_colors[METER_VALUE] = ColorPair(Green,Black);
+ CRT_colors[LED_COLOR] = ColorPair(Green,Black);
+ CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black);
+ CRT_colors[PROCESS] = ColorPair(Cyan,Black);
+ CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black);
+ CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black);
+ CRT_colors[PROCESS_MEGABYTES] = A_BOLD | ColorPair(Green,Black);
+ CRT_colors[PROCESS_BASENAME] = A_BOLD | ColorPair(Green,Black);
+ CRT_colors[PROCESS_TREE] = ColorPair(Cyan,Black);
+ CRT_colors[PROCESS_THREAD] = ColorPair(Green,Black);
+ CRT_colors[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,Black);
+ CRT_colors[PROCESS_R_STATE] = ColorPair(Green,Black);
+ CRT_colors[PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black);
+ CRT_colors[PROCESS_LOW_PRIORITY] = ColorPair(Red,Black);
+ CRT_colors[BAR_BORDER] = A_BOLD | ColorPair(Green,Black);
+ CRT_colors[BAR_SHADOW] = ColorPair(Cyan,Black);
+ CRT_colors[SWAP] = ColorPair(Red,Black);
+ CRT_colors[GRAPH_1] = A_BOLD | ColorPair(Red,Black);
+ CRT_colors[GRAPH_2] = ColorPair(Red,Black);
+ CRT_colors[GRAPH_3] = A_BOLD | ColorPair(Yellow,Black);
+ CRT_colors[GRAPH_4] = A_BOLD | ColorPair(Green,Black);
+ CRT_colors[GRAPH_5] = ColorPair(Green,Black);
+ CRT_colors[GRAPH_6] = ColorPair(Cyan,Black);
+ CRT_colors[GRAPH_7] = A_BOLD | ColorPair(Blue,Black);
+ CRT_colors[GRAPH_8] = ColorPair(Blue,Black);
+ CRT_colors[GRAPH_9] = A_BOLD | ColorPair(Black,Black);
+ CRT_colors[MEMORY_USED] = ColorPair(Green,Black);
+ CRT_colors[MEMORY_BUFFERS] = ColorPair(Blue,Black);
+ CRT_colors[MEMORY_CACHE] = ColorPair(Yellow,Black);
+ CRT_colors[LOAD_AVERAGE_FIFTEEN] = ColorPair(Green,Black);
+ CRT_colors[LOAD_AVERAGE_FIVE] = ColorPair(Green,Black);
+ CRT_colors[LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(Green,Black);
+ CRT_colors[LOAD] = A_BOLD;
+ CRT_colors[HELP_BOLD] = A_BOLD | ColorPair(Cyan,Black);
+ CRT_colors[CPU_NICE] = ColorPair(Blue,Black);
+ CRT_colors[CPU_NORMAL] = ColorPair(Green,Black);
+ CRT_colors[CPU_KERNEL] = ColorPair(Red,Black);
+ CRT_colors[CLOCK] = ColorPair(Green,Black);
+ CRT_colors[CHECK_BOX] = ColorPair(Green,Black);
+ CRT_colors[CHECK_MARK] = A_BOLD | ColorPair(Green,Black);
+ CRT_colors[CHECK_TEXT] = ColorPair(Cyan,Black);
+ CRT_colors[CPU_IOWAIT] = ColorPair(Yellow,Black);
+ CRT_colors[CPU_IRQ] = A_BOLD | ColorPair(Blue,Black);
+ CRT_colors[CPU_SOFTIRQ] = ColorPair(Blue,Black);
+ CRT_colors[HOSTNAME] = ColorPair(Green,Black);
+ } else {
+ /* Default */
+ CRT_colors[RESET_COLOR] = ColorPair(White,Black);
+ CRT_colors[DEFAULT_COLOR] = ColorPair(White,Black);
+ CRT_colors[FUNCTION_BAR] = ColorPair(Black,Cyan);
+ CRT_colors[FUNCTION_KEY] = ColorPair(White,Black);
+ CRT_colors[PANEL_HEADER_FOCUS] = ColorPair(Black,Green);
+ CRT_colors[PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green);
+ CRT_colors[PANEL_HIGHLIGHT_FOCUS] = ColorPair(Black,Cyan);
+ CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = ColorPair(Black,White);
+ CRT_colors[FAILED_SEARCH] = ColorPair(Red,Cyan);
+ CRT_colors[UPTIME] = A_BOLD | ColorPair(Cyan,Black);
+ CRT_colors[BATTERY] = A_BOLD | ColorPair(Cyan,Black);
+ CRT_colors[LARGE_NUMBER] = A_BOLD | ColorPair(Red,Black);
+ CRT_colors[METER_TEXT] = ColorPair(Cyan,Black);
+ CRT_colors[METER_VALUE] = A_BOLD | ColorPair(Cyan,Black);
+ CRT_colors[LED_COLOR] = ColorPair(Green,Black);
+ CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black);
+ CRT_colors[PROCESS] = A_NORMAL;
+ CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black);
+ CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black);
+ CRT_colors[PROCESS_MEGABYTES] = ColorPair(Cyan,Black);
+ CRT_colors[PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan,Black);
+ CRT_colors[PROCESS_TREE] = ColorPair(Cyan,Black);
+ CRT_colors[PROCESS_R_STATE] = ColorPair(Green,Black);
+ CRT_colors[PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black);
+ CRT_colors[PROCESS_LOW_PRIORITY] = ColorPair(Red,Black);
+ CRT_colors[PROCESS_THREAD] = ColorPair(Green,Black);
+ CRT_colors[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green,Black);
+ CRT_colors[BAR_BORDER] = A_BOLD;
+ CRT_colors[BAR_SHADOW] = A_BOLD | ColorPair(Black,Black);
+ CRT_colors[SWAP] = ColorPair(Red,Black);
+ CRT_colors[GRAPH_1] = A_BOLD | ColorPair(Red,Black);
+ CRT_colors[GRAPH_2] = ColorPair(Red,Black);
+ CRT_colors[GRAPH_3] = A_BOLD | ColorPair(Yellow,Black);
+ CRT_colors[GRAPH_4] = A_BOLD | ColorPair(Green,Black);
+ CRT_colors[GRAPH_5] = ColorPair(Green,Black);
+ CRT_colors[GRAPH_6] = ColorPair(Cyan,Black);
+ CRT_colors[GRAPH_7] = A_BOLD | ColorPair(Blue,Black);
+ CRT_colors[GRAPH_8] = ColorPair(Blue,Black);
+ CRT_colors[GRAPH_9] = A_BOLD | ColorPair(Black,Black);
+ CRT_colors[MEMORY_USED] = ColorPair(Green,Black);
+ CRT_colors[MEMORY_BUFFERS] = ColorPair(Blue,Black);
+ CRT_colors[MEMORY_CACHE] = ColorPair(Yellow,Black);
+ CRT_colors[LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Black,Black);
+ CRT_colors[LOAD_AVERAGE_FIVE] = A_NORMAL;
+ CRT_colors[LOAD_AVERAGE_ONE] = A_BOLD;
+ CRT_colors[LOAD] = A_BOLD;
+ CRT_colors[HELP_BOLD] = A_BOLD | ColorPair(Cyan,Black);
+ CRT_colors[CPU_NICE] = ColorPair(Blue,Black);
+ CRT_colors[CPU_NORMAL] = ColorPair(Green,Black);
+ CRT_colors[CPU_KERNEL] = ColorPair(Red,Black);
+ CRT_colors[CLOCK] = A_BOLD;
+ CRT_colors[CHECK_BOX] = ColorPair(Cyan,Black);
+ CRT_colors[CHECK_MARK] = A_BOLD;
+ CRT_colors[CHECK_TEXT] = A_NORMAL;
+ CRT_colors[CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black);
+ CRT_colors[CPU_IRQ] = ColorPair(Yellow,Black);
+ CRT_colors[CPU_SOFTIRQ] = ColorPair(Magenta,Black);
+ CRT_colors[HOSTNAME] = A_BOLD;
+ }
+}
View
134 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CRT.h
@@ -0,0 +1,134 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_CRT
+#define HEADER_CRT
+/*
+htop - CRT.h
+(C) 2004-2006 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+
+#include <curses.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdbool.h>
+
+#include "String.h"
+
+#include "config.h"
+#include "debug.h"
+
+#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)
+
+#define COLORSCHEME_DEFAULT 0
+#define COLORSCHEME_MONOCHROME 1
+#define COLORSCHEME_BLACKONWHITE 2
+#define COLORSCHEME_BLACKONWHITE2 3
+#define COLORSCHEME_MIDNIGHT 4
+#define COLORSCHEME_BLACKNIGHT 5
+
+#define Black COLOR_BLACK
+#define Red COLOR_RED
+#define Green COLOR_GREEN
+#define Yellow COLOR_YELLOW
+#define Blue COLOR_BLUE
+#define Magenta COLOR_MAGENTA
+#define Cyan COLOR_CYAN
+#define White COLOR_WHITE
+
+//#link curses
+
+bool CRT_hasColors;
+
+
+typedef enum ColorElements_ {
+ RESET_COLOR,
+ DEFAULT_COLOR,
+ FUNCTION_BAR,
+ FUNCTION_KEY,
+ FAILED_SEARCH,
+ PANEL_HEADER_FOCUS,
+ PANEL_HEADER_UNFOCUS,
+ PANEL_HIGHLIGHT_FOCUS,
+ PANEL_HIGHLIGHT_UNFOCUS,
+ LARGE_NUMBER,
+ METER_TEXT,
+ METER_VALUE,
+ LED_COLOR,
+ UPTIME,
+ BATTERY,
+ TASKS_TOTAL,
+ TASKS_RUNNING,
+ SWAP,
+ PROCESS,
+ PROCESS_SHADOW,
+ PROCESS_TAG,
+ PROCESS_MEGABYTES,
+ PROCESS_TREE,
+ PROCESS_R_STATE,
+ PROCESS_BASENAME,
+ PROCESS_HIGH_PRIORITY,
+ PROCESS_LOW_PRIORITY,
+ PROCESS_THREAD,
+ PROCESS_THREAD_BASENAME,
+ BAR_BORDER,
+ BAR_SHADOW,
+ GRAPH_1,
+ GRAPH_2,
+ GRAPH_3,
+ GRAPH_4,
+ GRAPH_5,
+ GRAPH_6,
+ GRAPH_7,
+ GRAPH_8,
+ GRAPH_9,
+ MEMORY_USED,
+ MEMORY_BUFFERS,
+ MEMORY_CACHE,
+ LOAD,
+ LOAD_AVERAGE_FIFTEEN,
+ LOAD_AVERAGE_FIVE,
+ LOAD_AVERAGE_ONE,
+ CHECK_BOX,
+ CHECK_MARK,
+ CHECK_TEXT,
+ CLOCK,
+ CPU_NICE,
+ CPU_NORMAL,
+ CPU_KERNEL,
+ HELP_BOLD,
+ CPU_IOWAIT,
+ CPU_IRQ,
+ CPU_SOFTIRQ,
+ HOSTNAME,
+ LAST_COLORELEMENT
+} ColorElements;
+
+
+// TODO: centralize these in Settings.
+
+extern int CRT_delay;
+
+extern int CRT_colorScheme;
+
+extern int CRT_colors[LAST_COLORELEMENT];
+
+char* CRT_termType;
+
+// TODO: pass an instance of Settings instead.
+
+void CRT_init(int delay, int colorScheme);
+
+void CRT_done();
+
+int CRT_readKey();
+
+void CRT_disableDelay();
+
+void CRT_enableDelay();
+
+void CRT_setColors(int colorScheme);
+
+#endif
View
134 public/x86_64/osx/novers/htop.source/source/max-horvath-htop-osx-d92a7d4/CategoriesPanel.c
@@ -0,0 +1,134 @@
+
+#include "CategoriesPanel.h"
+#include "AvailableMetersPanel.h"
+#include "MetersPanel.h"
+#include "DisplayOptionsPanel.h"
+#include "ColumnsPanel.h"
+#include "ColorsPanel.h"
+#include "AvailableColumnsPanel.h"
+
+#include "Panel.h"
+
+#include "debug.h"
+#include <assert.h>
+
+/*{
+
+typedef struct CategoriesPanel_ {
+ Panel super;
+
+ Settings* settings;
+ ScreenManager* scr;
+} CategoriesPanel;
+
+}*/
+
+static char* MetersFunctions[] = {" ", " ", " ", "Type ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done ", NULL};
+
+static char* AvailableMetersFunctions[] = {" ", " ", " ", " ", "Add L ", "Add R ", " ", " ", " ", "Done ", NULL};
+
+static char* DisplayOptionsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL};
+
+static char* ColumnsFunctions[] = {" ", " ", " ", " ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done ", NULL};
+
+static char* ColorsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL};
+
+static char* AvailableColumnsFunctions[] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done ", NULL};
+
+static void CategoriesPanel_delete(Object* object) {
+ Panel* super = (Panel*) object;
+ CategoriesPanel* this = (CategoriesPanel*) object;
+ Panel_done(super);
+ free(this);
+}
+
+void CategoriesPanel_makeMetersPage(CategoriesPanel* this) {
+ Panel* leftMeters = (Panel*) MetersPanel_new(this->settings, "Left column", this->settings->header->leftMeters, this->scr);
+ Panel* rightMeters = (Panel*) MetersPanel_new(this->settings, "Right column", this->settings->header->rightMeters, this->scr);
+ Panel* availableMeters = (Panel*) AvailableMetersPanel_new(this->settings, leftMeters, rightMeters, this->scr);
+ ScreenManager_add(this->scr, leftMeters, FunctionBar_new(MetersFunctions, NULL, NULL), 20);
+ ScreenManager_add(this->scr, rightMeters, FunctionBar_new(MetersFunctions, NULL, NULL), 20);
+ ScreenManager_add(this->scr, availableMeters, FunctionBar_new(AvailableMetersFunctions, NULL, NULL), -1);
+}
+
+static void CategoriesPanel_makeDisplayOptionsPage(CategoriesPanel* this) {
+ Panel* displayOptions = (Panel*) DisplayOptionsPanel_new(this->settings, this->scr);
+ ScreenManager_add(this->scr, displayOptions, FunctionBar_new(DisplayOptionsFunctions, NULL, NULL), -1);
+}
+
+static void CategoriesPanel_makeColorsPage(CategoriesPanel* this) {
+ Panel* colors = (Panel*) ColorsPanel_new(this->settings, this->scr);
+ ScreenManager_add(this->scr, colors, FunctionBar_new(ColorsFunctions, NULL, NULL), -1);
+}
+
+static void CategoriesPanel_makeColumnsPage(CategoriesPanel* this) {
+ Panel* columns = (Panel*) ColumnsPanel_new(this->settings, this->scr);
+ Panel* availableColumns = (Panel*) AvailableColumnsPanel_new(this->settings, columns, this->scr);
+ ScreenManager_add(this->scr, columns, FunctionBar_new(ColumnsFunctions, NULL, NULL), 20);
+ ScreenManager_add(this->scr, availableColumns, FunctionBar_new(AvailableColumnsFunctions, NULL, NULL), -1);
+}
+
+static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
+ CategoriesPanel* this = (CategoriesPanel*) super;
+
+ HandlerResult result = IGNORED;
+