SysInfo: Documentation done. Improved Windows hardware detection

git-svn-id: svn://ultimatepp.org/upp/trunk@1244 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
koldo 2009-05-28 21:16:46 +00:00
parent 392f92f325
commit 52aa220fac
8 changed files with 1514 additions and 403 deletions

View file

@ -190,13 +190,10 @@ String GetExtExecutable(String ext)
if (ext[0] != '.')
ext = String(".") + ext;
#if defined(PLATFORM_WIN32)
String file = AppendFileName(GetHomeDirectory(), String("pru") + ext);
String file = AppendFileName(GetHomeDirectory(), String("dummy") + ext); // Required by FindExecutableW
SaveFile(file, " ");
if (!FileExists(file)) {
exeFile = "Error getting exe";
puts("ERROR");
return exeFile;
}
if (!FileExists(file))
return "";
HINSTANCE ret;
WString fileW(file);
WCHAR exe[1024];
@ -339,7 +336,7 @@ String GetShellFolder(const char *local, const char *users)
String GetDesktopFolder()
{
String ret = GetShellFolder("XDG_DESKTOP_DIR", "DESKTOP");
if (ret == "")
if (ret.IsEmpty())
return AppendFileName(GetHomeDirectory(), "Desktop");
else
return ret;
@ -376,30 +373,68 @@ String GetSystemFolder()
/////////////////////////////////////////////////////////////////////
// Hardware Info
#if defined(PLATFORM_WIN32)
void GetSystemInfo(String &manufacturer, String &productName, String &version, int &numberOfProcessors)
String LaunchWindowsCommand(String command)
{
manufacturer = FromSystemCharset(GetWinRegString("SystemManufacturer", "HARDWARE\\DESCRIPTION\\System\\BIOS", HKEY_LOCAL_MACHINE));
if (manufacturer == "") {
String ret;
char aux[1000];
FILE *fp = _popen (command, "r");
if (fp == NULL)
return ret;
fgets (aux, 1000, fp);
while (!feof (fp)) {
ret.Cat(aux);
fgets (aux, 1000, fp);
}
_pclose (fp);
return ret;
}
void GetSystemInfo(String &manufacturer, String &productName, String &version, int &numberOfProcessors)
{
{
StringParse fileData = LaunchWindowsCommand("wmic computersystem get manufacturer");
fileData.GoAfter("\r\n");
manufacturer = TrimBoth(fileData.GetText("\r\n"));
}
if (manufacturer.IsEmpty())
manufacturer = FromSystemCharset(GetWinRegString("SystemManufacturer", "HARDWARE\\DESCRIPTION\\System\\BIOS", HKEY_LOCAL_MACHINE));
if (manufacturer.IsEmpty()) {
StringParse fileData = LoadFile(AppendFileName(GetSystemFolder(), "oeminfo.ini"));
fileData.GoAfter("Manufacturer=");
manufacturer = fileData.GetText("\r\n");
}
productName = FromSystemCharset(GetWinRegString("SystemProductName", "HARDWARE\\DESCRIPTION\\System\\BIOS", HKEY_LOCAL_MACHINE));
if (productName == "")
{
StringParse modelData = LaunchWindowsCommand("wmic computersystem get model");
modelData.GoAfter("\r\n");
productName = TrimBoth(modelData.GetText("\r\n"));
}
if (productName.IsEmpty())
productName = FromSystemCharset(GetWinRegString("SystemProductName", "HARDWARE\\DESCRIPTION\\System\\BIOS", HKEY_LOCAL_MACHINE));
if (productName.IsEmpty())
productName = FromSystemCharset(GetWinRegString("Model", "SOFTWARE\\Microsoft\\PCHealth\\HelpSvc\\OEMInfo", HKEY_LOCAL_MACHINE));
version = FromSystemCharset(GetWinRegString("SystemVersion", "HARDWARE\\DESCRIPTION\\System\\BIOS", HKEY_LOCAL_MACHINE));
numberOfProcessors = atoi(GetEnv("NUMBER_OF_PROCESSORS"));
}
void GetBiosInfo(String &biosVersion, Date &biosReleaseDate)
{
{
// Alternative is "wmic bios get name" and "wmic bios get releasedate"
String strBios = FromSystemCharset(GetWinRegString("BIOSVersion", "HARDWARE\\DESCRIPTION\\System\\BIOS", HKEY_LOCAL_MACHINE));
if (strBios.IsEmpty())
strBios = FromSystemCharset(GetWinRegString("SystemBiosVersion", "HARDWARE\\DESCRIPTION\\System", HKEY_LOCAL_MACHINE));
for (int i = 0; i < strBios.GetLength(); ++i) {
if (strBios[i] == '\0')
biosVersion.Cat(". ");
else
biosVersion.Cat(strBios[i]);
}
StrToDate(biosReleaseDate, FromSystemCharset(GetWinRegString("BIOSReleaseDate", "HARDWARE\\DESCRIPTION\\System\\BIOS", HKEY_LOCAL_MACHINE)));
String strDate = FromSystemCharset(GetWinRegString("BIOSReleaseDate", "HARDWARE\\DESCRIPTION\\System\\BIOS", HKEY_LOCAL_MACHINE));
if (strDate.IsEmpty())
strDate = FromSystemCharset(GetWinRegString("SystemBiosDate", "HARDWARE\\DESCRIPTION\\System", HKEY_LOCAL_MACHINE));
StrToDate(biosReleaseDate, strDate);
}
bool GetProcessorInfo(int number, String &vendor, String &identifier, String &architecture, int &speed)
{
@ -481,13 +516,13 @@ typedef struct _MEMORYSTATUSEX {
WINBASEAPI BOOL WINAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX);
bool GetMemoryInfo(
int &memoryLoad, // percent of memory in use
uint64 &totalPhys, // physical memory
uint64 &freePhys, // free physical memory
uint64 &totalPageFile, // total paging file
uint64 &freePageFile, // free paging file
uint64 &totalVirtual, // total virtual memory
uint64 &freeVirtual) // free virtual memory
int &memoryLoad, // percent of memory in use
uint64 &totalPhys, // physical memory
uint64 &freePhys, // free physical memory
uint64 &totalPageFile, // total paging file
uint64 &freePageFile, // free paging file
uint64 &totalVirtual, // total virtual memory
uint64 &freeVirtual) // free virtual memory
{
MEMORYSTATUS status;
status.dwLength = sizeof (status);
@ -507,13 +542,13 @@ uint64 &freeVirtual) // free virtual memory
#ifdef COMPILER_MSC
bool GetMemoryInfo(
int &memoryLoad, // percent of memory in use
uint64 &totalPhys, // physical memory
uint64 &freePhys, // free physical memory
uint64 &totalPageFile, // total paging file
uint64 &freePageFile, // free paging file
uint64 &totalVirtual, // total virtual memory
uint64 &freeVirtual) // free virtual memory
int &memoryLoad, // percent of memory in use
uint64 &totalPhys, // physical memory
uint64 &freePhys, // free physical memory
uint64 &totalPageFile, // total paging file
uint64 &freePageFile, // free paging file
uint64 &totalVirtual, // total virtual memory
uint64 &freeVirtual) // free virtual memory
{
MEMORYSTATUSEX status;
status.dwLength = sizeof (status);
@ -683,11 +718,11 @@ void GetWindowsList(Array<long> &hWnd, Array<long> &processId, Array<String> &na
if (GetModuleFileNameExW(hProcess, hInstance, str, sizeof(str)/sizeof(WCHAR)))
fileName.Add(FromSystemCharset(WString(str).ToString()));
else
fileName.Add("UNKNOWN");
fileName.Add(t_("UNKNOWN"));
if (GetModuleBaseNameW(hProcess, hInstance, str, sizeof(str)/sizeof(WCHAR)))
name.Add(FromSystemCharset(WString(str).ToString()));
else
name.Add("UNKNOWN");
name.Add(t_("UNKNOWN"));
CloseHandle(hProcess);
if (IsWindowVisible((HWND)hWnd[i])) {
int count = SendMessageW((HWND)hWnd[i], WM_GETTEXT, sizeof(str)/sizeof(WCHAR), (LPARAM)str);
@ -1497,10 +1532,10 @@ Array<String> GetDriveList()
}
bool GetDriveSpace(String drive,
//uint64 &totalBytes, // To determine the total number of bytes on a disk or volume, use IOCTL_DISK_GET_LENGTH_INFO.
uint64 &freeBytesUser, // Total number of free bytes on a disk that are available to the user who is associated with the calling thread.
uint64 &totalBytesUser, // Total number of bytes on a disk that are available to the user who is associated with the calling thread.
uint64 &totalFreeBytes) // Total number of free bytes on a disk.
//uint64 &totalBytes, // To determine the total number of bytes on a disk or volume, use IOCTL_DISK_GET_LENGTH_INFO.
uint64 &freeBytesUser, // Total number of free bytes on a disk that are available to the user who is associated with the calling thread.
uint64 &totalBytesUser, // Total number of bytes on a disk that are available to the user who is associated with the calling thread.
uint64 &totalFreeBytes) // Total number of free bytes on a disk.
{
StringBuffer sb(drive);
@ -1540,7 +1575,7 @@ bool GetDriveInformation(String drive, String &type, String &volume, /*uint64 &s
return false;
volume = vol;
fileSystem = fs;
maxName = (int)maxName;
maxName = (int)_maxName;
return true;
}
@ -1578,10 +1613,10 @@ Array<String> GetDriveList()
return ret;
}
bool GetDriveSpace(String drive,
//uint64 &totalBytes, // To determine the total number of bytes on a disk or volume, use IOCTL_DISK_GET_LENGTH_INFO.
uint64 &freeBytesUser, // Total number of free bytes on a disk that are available to the user who is associated with the calling thread.
uint64 &totalBytesUser, // Total number of bytes on a disk that are available to the user who is associated with the calling thread.
uint64 &totalFreeBytes) // Total number of free bytes on a disk.
//uint64 &totalBytes, // To determine the total number of bytes on a disk or volume, use IOCTL_DISK_GET_LENGTH_INFO.
uint64 &freeBytesUser, // Total number of free bytes on a disk that are available to the user who is associated with the calling thread.
uint64 &totalBytesUser, // Total number of bytes on a disk that are available to the user who is associated with the calling thread.
uint64 &totalFreeBytes) // Total number of free bytes on a disk.
{
freeBytesUser = totalBytesUser = totalFreeBytes = 0;
@ -1591,7 +1626,7 @@ uint64 &totalFreeBytes) // Total number of free bytes on a disk.
while (drive != space.GetText())
;
space.MoveRel(-10); space.GoBeginLine();
space.MoveRel(-10); space.GoBeginLine();
space.GetText(); space.GetText(); // Jumps over device path and filesystem
totalBytesUser = 1024*space.GetUInt64();
space.GetText(); // Jumps over used space

View file

@ -1,362 +1,362 @@
#ifndef _SysInfo_SysInfo_h
#define _SysInfo_SysInfo_h
using namespace Upp;
/////////////////////////////////////////////////////////////////////
// Different functions
// Appends a file after other
bool FileCat(const char *file, const char *appendFile);
// Replace find with replace in str
String Replace(String str, String find, String replace);
// Convert a long into a String
String FormatLong(long a);
// Search a file fith name with wildcards in a dir and subdirectories with certain text inside
Array<String> SearchFile(String dir, String condFile, String text = "");
// As LoadFile but it works in Linux for files automatically generated by the OS
// #ifdef PLATFORM_POSIX
String LoadFile_Safe(String fileName);
// #endif
// #if defined(PLATFORM_WIN32)
// #define LoadFile_Safe LoadFile // Not necessary in Windows
// #endif
// Gets the program that will open by default the files with extension ext
String GetExtExecutable(const String ext);
// Open the file with the adecuated program defined in the OS by default
bool LaunchFile(const String file);
// Functions to launch command line programs
// readCallBack is a function to manage the program output
// Returns the command exit code
int LaunchCommand(const char *cmd, void (*readCallBack)(String &));
// ret gets all the program output
// Returns the command exit code
int LaunchCommand(const char *cmd, String &ret);
// It returns the program output
String LaunchCommand(const char *cmd);
// A ProcessEvents than can be used in non gui programs
inline void DoEvents()
{
#ifdef CTRLLIB_H
Ctrl::ProcessEvents();
#endif
}
// A String based class to parse into
class StringParse : public String {
public:
void GoInit() {pos = 0; lastSeparator='\0';};
StringParse():String("") {GoInit();};
StringParse(String s): String(s) {GoInit();};
bool GoBefore(const String text)
{
int newpos = Find(text, pos);
if (newpos < 0)
return false; // If it does not find it, it does not move
pos = newpos;
return true;
};
bool GoAfter(const String text)
{
if(!GoBefore(text))
return false;
pos += strlen(text);
return true;
};
bool GoAfter(const String text, const String text2)
{
if(!GoAfter(text))
return false;
if(!GoAfter(text2))
return false;
return true;
};
bool GoAfter(const String text, const String text2, const String text3)
{
if(!GoAfter(text))
return false;
if(!GoAfter(text2))
return false;
if(!GoAfter(text3))
return false;
return true;
};
bool GoAfter_Init(const String text) {GoInit(); return GoAfter(text);};
bool GoAfter_Init(const String text, const String text2) {GoInit(); return GoAfter(text, text2);};
bool GoAfter_Init(const String text, const String text2, const String text3) {GoInit(); return GoAfter(text, text2, text3);};
void GoBeginLine()
{
for (; pos >= 0; --pos) {
if ((ToString()[pos-1] == '\r') || (ToString()[pos-1] == '\n'))
return;
}
}
bool IsBeginLine()
{
if (pos == 0)
return true;
if ((ToString()[pos-1] == '\r') || (ToString()[pos-1] == '\n'))
return true;
return false;
}
bool IsSpaceRN(int c)
{
if (IsSpace(c))
return true;
if ((c == '\r') || (c == '\n'))
return true;
return false;
}
// Gets text between "" or just a word until an space
// It considers special characters with \ if between ""
// If not between "" it gets the word when it finds one of the separator characters
String GetText(String separators = "")
{
String ret = "";
if (pos > GetCount())
return ret;
int newpos = pos;
while ((IsSpaceRN(ToString()[newpos]) && (ToString()[newpos] != '\"') &&
(ToString()[newpos] != '\0')))
newpos++;
if (ToString()[newpos] == '\0') {
pos = newpos;
return "";
}
if (ToString()[newpos] == '\"') { // Between ""
newpos++;
while (ToString()[newpos] != '\"' && ToString()[newpos] != '\0') {
if (ToString()[newpos] == '\\') {
newpos++;
if (ToString()[newpos] == '\0')
return "";
}
ret.Cat(ToString()[newpos]);
newpos++;
}
lastSeparator = '"';
} else if (separators == "") { // Simple word
while (!IsSpaceRN(ToString()[newpos]) && ToString()[newpos] != '\0') {
if (ToString()[newpos] == '\"') {
newpos--; // This " belongs to the next
break;
}
ret.Cat(ToString()[newpos]);
newpos++;
}
lastSeparator = ToString()[newpos];
} else { // Simple word, special separator
while (ToString()[newpos] != '\0') {// Only consider included spaces (!IsSpaceRN(ToString()[newpos]) && ToString()[newpos] != '\0') {
if (ToString()[newpos] == '\"') {
newpos--; // This " belongs to the next
break;
}
if (separators.Find(ToString()[newpos]) >= 0) {
lastSeparator = ToString()[newpos];
break;
}
ret.Cat(ToString()[newpos]);
newpos++;
}
lastSeparator = ToString()[newpos];
}
pos = ++newpos; // After the separator: ", space or separator
return ret;
}
String GetLine()
{
return GetText("\r\n");
}
double GetDouble(String separators = "") {return atof(GetText(separators));};
int GetInt(String separators = "") {return atoi(GetText(separators));};
long GetLong(String separators = "") {return atol(GetText(separators));};
uint64 GetUInt64(String separators = "")
#if defined(PLATFORM_WIN32)
{return _atoi64(GetText(separators));};
#endif
#ifdef PLATFORM_POSIX
{return atoll(GetText(separators));};
#endif
String Right() {return String::Right(GetLength()-pos);}
int GetLastSeparator() {return lastSeparator;}
void MoveRel(int val)
{
pos += val;
if (pos < 0)
pos = 0;
else if (pos >= GetCount())
pos = GetCount() - 1;
}
int GetPos() {return pos;};
bool SetPos(int i)
{
if (i < 0 || i >= GetCount())
return false;
else {
pos = i;
return true;
}
}
bool Eof()
{
return pos >= GetCount();
}
unsigned Count(String s)
{
int from = 0;
unsigned count = 0;
while ((from = ToString().Find(s, from)) >= 0)
count++;
return count;
}
private:
int pos;
int lastSeparator;
};
/////////////////////////////////////////////////////////////////////
// Special Folders
// Get the path to special folders
String GetDesktopFolder();
String GetProgramsFolder();
String GetAppDataFolder();
String GetMusicFolder();
String GetPicturesFolder();
String GetVideoFolder();
String GetPersonalFolder();
String GetTemplatesFolder();
String GetDownloadFolder();
String GetRootFolder();
String GetTempFolder();
String GetOsFolder();
String GetSystemFolder();
/////////////////////////////////////////////////////////////////////
// Processor Info
void GetSystemInfo(String &manufacturer, String &productName, String &version, int &numberOfProcessors);
void GetBiosInfo(String &biosVersion, Date &biosReleaseDate);
bool GetProcessorInfo(int number, String &vendor, String &identifier, String &architecture, int &speed);
// Gets the real CPU speed in MHz
int GetCpuSpeed();
/////////////////////////////////////////////////////////////////////
// Memory Info
bool GetMemoryInfo(int &memoryLoad, uint64 &totalPhys, uint64 &freePhys, uint64 &totalPageFile, uint64 &freePageFile, uint64 &totalVirtual, uint64 &freeVirtual);
/////////////////////////////////////////////////////////////////////
// Windows list
// They get arrays with handles to all the opened windows with additional info as
// pid: Handle to the process that manages the window
// name: Window name
// fileName: Window process program file name
// title: Window title (caption)
void GetWindowsList(Array<long> &wid, Array<long> &pid, Array<String> &name, Array<String> &fileName, Array<String> &title);
Array<long> GetWindowsList();
/////////////////////////////////////////////////////////////////////
// Process list
// They get arrays with handles to all the opened processes and process names
bool GetProcessList(Array<long> &pid, Array<String> &pNames);
Array<long> GetProcessList();
String GetProcessName(long pid);
// Gets the program file name of a process
String GetProcessFileName(long processID);
// Gets the process id of a program with a window with certain title
long GetProcessIdFromWindowCaption(String windowCaption, bool exactMatch = false);
long GetWindowIdFromCaption(String windowCaption, bool exactMatch = false);
long GetProcessIdFromWindowId(long wid);
long GetWindowIdFromProcessId(long pid);
// Ends a process by any means
bool ProcessTerminate(long pid, int timeout = 500);
// Gets the process priority as a number from 0 (minimum) to 10 (maximum)
int GetProcessPriority(long pid);
bool SetProcessPriority(long pid, int priority);
// True if a process with handle pid exists
bool ProcessExists(long pid);
/////////////////////////////////////////////////////////////////////
// Os Info
bool GetOsInfo(String &kernel, String &kerVersion, String &kerArchitecture, String &distro, String &distVersion, String &desktop, String &deskVersion);
String GetDesktopManagerNew();
/////////////////////////////////////////////////////////////////////
// Drives list
// Get the dirve path list
Array<String> GetDriveList();
// Get drives info
// Return false if drive is not mounted or it is not accesible
bool GetDriveSpace(String drive, uint64 &freeBytesUser, uint64 &totalBytesUser, uint64 &totalFreeBytes);
bool GetDriveInformation(String drive, String &type, String &volume, /*uint64 &serial, */int &maxName, String &fileSystem);
/////////////////////////////////////////////////////////////////////
// Others
// Gets process id
long GetProcessId();
// I tries to "logoff", "reboot" or "shutdown"
bool Shutdown(String action);
// It converts an amount of bytes to compact size
String BytesToKMGT(uint64 bytes);
// It gets compiler info
void GetCompilerInfo(String &name, int &version, String &date);
// It gets info about the battery status
bool GetBatteryStatus(bool &discharging, int &percentage, int &remainingMin);
// Get if there is battery
bool GetBatteryInfo(bool &present/*, int &designCapacity, int &lastFullCapacity, String &vendor, String &type, String &model, String &serial*/);
/////////////////////////////////////////////////////////////////////
// Key and mouse keys
bool Window_GetRect(long windowId, long &left, long &top, long &right, long &bottom);
bool Mouse_GetPos(long &x, long &y);
bool Mouse_SetPos(long x, long y, long windowId);
bool Window_SaveCapture(long windowId, String fileName);
#if defined(PLATFORM_WIN32)
void Mouse_LeftClick();
void Mouse_MiddleClick();
void Mouse_RightClick();
void Mouse_LeftDblClick();
void Mouse_MiddleDblClick();
void Mouse_RightDblClick();
void Keyb_SendKeys(String text, long finalDelay = 100, long delayBetweenKeys = 50);
void GetKeyLockStatus(bool &caps, bool &num, bool &scroll);
void SetKeyLockStatus(bool caps, bool num, bool scroll);
void Window_SetRect(long windowId, long left, long top, long right, long bottom);
#endif
#endif
// Known bugs
// GetWindowsList does not get the window title in Kde
// Shutdown in Linux only works with option "logoff", probably because of user permissions
#ifndef _SysInfo_SysInfo_h
#define _SysInfo_SysInfo_h
using namespace Upp;
/////////////////////////////////////////////////////////////////////
// Different functions
// Appends a file after other
bool FileCat(const char *file, const char *appendFile);
// Replace find with replace in str
String Replace(String str, String find, String replace);
// Convert a long into a String
String FormatLong(long a);
// Search a file fith name with wildcards in a dir and subdirectories with certain text inside
Array<String> SearchFile(String dir, String condFile, String text = "");
// As LoadFile but it works in Linux for files automatically generated by the OS
// #ifdef PLATFORM_POSIX
String LoadFile_Safe(String fileName);
// #endif
// #if defined(PLATFORM_WIN32)
// #define LoadFile_Safe LoadFile // Not necessary in Windows
// #endif
// Gets the program that will open by default the files with extension ext
String GetExtExecutable(String ext);
// Open the file with the adecuated program defined in the OS by default
bool LaunchFile(const String file);
// Functions to launch command line programs
// readCallBack is a function to manage the program output
// Returns the command exit code
int LaunchCommand(const char *cmd, void (*readCallBack)(String &));
// ret gets all the program output
// Returns the command exit code
int LaunchCommand(const char *cmd, String &ret);
// It returns the program output
String LaunchCommand(const char *cmd);
// A ProcessEvents than can be used in non gui programs
inline void DoEvents()
{
#ifdef CTRLLIB_H
Ctrl::ProcessEvents();
#endif
}
// A String based class to parse into
class StringParse : public String {
public:
void GoInit() {pos = 0; lastSeparator='\0';};
StringParse():String("") {GoInit();};
StringParse(String s): String(s) {GoInit();};
bool GoBefore(const String text)
{
int newpos = Find(text, pos);
if (newpos < 0)
return false; // If it does not find it, it does not move
pos = newpos;
return true;
};
bool GoAfter(const String text)
{
if(!GoBefore(text))
return false;
pos += strlen(text);
return true;
};
bool GoAfter(const String text, const String text2)
{
if(!GoAfter(text))
return false;
if(!GoAfter(text2))
return false;
return true;
};
bool GoAfter(const String text, const String text2, const String text3)
{
if(!GoAfter(text))
return false;
if(!GoAfter(text2))
return false;
if(!GoAfter(text3))
return false;
return true;
};
bool GoAfter_Init(const String text) {GoInit(); return GoAfter(text);};
bool GoAfter_Init(const String text, const String text2) {GoInit(); return GoAfter(text, text2);};
bool GoAfter_Init(const String text, const String text2, const String text3) {GoInit(); return GoAfter(text, text2, text3);};
void GoBeginLine()
{
for (; pos >= 0; --pos) {
if ((ToString()[pos-1] == '\r') || (ToString()[pos-1] == '\n'))
return;
}
}
bool IsBeginLine()
{
if (pos == 0)
return true;
if ((ToString()[pos-1] == '\r') || (ToString()[pos-1] == '\n'))
return true;
return false;
}
bool IsSpaceRN(int c)
{
if (IsSpace(c))
return true;
if ((c == '\r') || (c == '\n'))
return true;
return false;
}
// Gets text between "" or just a word until an space
// It considers special characters with \ if between ""
// If not between "" it gets the word when it finds one of the separator characters
String GetText(String separators = "")
{
String ret = "";
if (pos > GetCount())
return ret;
int newpos = pos;
while ((IsSpaceRN(ToString()[newpos]) && (ToString()[newpos] != '\"') &&
(ToString()[newpos] != '\0')))
newpos++;
if (ToString()[newpos] == '\0') {
pos = newpos;
return "";
}
if (ToString()[newpos] == '\"') { // Between ""
newpos++;
while (ToString()[newpos] != '\"' && ToString()[newpos] != '\0') {
if (ToString()[newpos] == '\\') {
newpos++;
if (ToString()[newpos] == '\0')
return "";
}
ret.Cat(ToString()[newpos]);
newpos++;
}
lastSeparator = '"';
} else if (separators == "") { // Simple word
while (!IsSpaceRN(ToString()[newpos]) && ToString()[newpos] != '\0') {
if (ToString()[newpos] == '\"') {
newpos--; // This " belongs to the next
break;
}
ret.Cat(ToString()[newpos]);
newpos++;
}
lastSeparator = ToString()[newpos];
} else { // Simple word, special separator
while (ToString()[newpos] != '\0') {// Only consider included spaces (!IsSpaceRN(ToString()[newpos]) && ToString()[newpos] != '\0') {
if (ToString()[newpos] == '\"') {
newpos--; // This " belongs to the next
break;
}
if (separators.Find(ToString()[newpos]) >= 0) {
lastSeparator = ToString()[newpos];
break;
}
ret.Cat(ToString()[newpos]);
newpos++;
}
lastSeparator = ToString()[newpos];
}
pos = ++newpos; // After the separator: ", space or separator
return ret;
}
String GetLine()
{
return GetText("\r\n");
}
double GetDouble(String separators = "") {return atof(GetText(separators));};
int GetInt(String separators = "") {return atoi(GetText(separators));};
long GetLong(String separators = "") {return atol(GetText(separators));};
uint64 GetUInt64(String separators = "")
#if defined(PLATFORM_WIN32)
{return _atoi64(GetText(separators));};
#endif
#ifdef PLATFORM_POSIX
{return atoll(GetText(separators));};
#endif
String Right() {return String::Right(GetLength()-pos);}
int GetLastSeparator() {return lastSeparator;}
void MoveRel(int val)
{
pos += val;
if (pos < 0)
pos = 0;
else if (pos >= GetCount())
pos = GetCount() - 1;
}
int GetPos() {return pos;};
bool SetPos(int i)
{
if (i < 0 || i >= GetCount())
return false;
else {
pos = i;
return true;
}
}
bool Eof()
{
return pos >= GetCount();
}
unsigned Count(String s)
{
int from = 0;
unsigned count = 0;
while ((from = ToString().Find(s, from)) >= 0)
count++;
return count;
}
private:
int pos;
int lastSeparator;
};
/////////////////////////////////////////////////////////////////////
// Special Folders
// Get the path to special folders
String GetDesktopFolder();
String GetProgramsFolder();
String GetAppDataFolder();
String GetMusicFolder();
String GetPicturesFolder();
String GetVideoFolder();
String GetPersonalFolder();
String GetTemplatesFolder();
String GetDownloadFolder();
String GetRootFolder();
String GetTempFolder();
String GetOsFolder();
String GetSystemFolder();
/////////////////////////////////////////////////////////////////////
// Processor Info
void GetSystemInfo(String &manufacturer, String &productName, String &version, int &numberOfProcessors);
void GetBiosInfo(String &biosVersion, Date &biosReleaseDate);
bool GetProcessorInfo(int number, String &vendor, String &identifier, String &architecture, int &speed);
// Gets the real CPU speed in MHz
int GetCpuSpeed();
/////////////////////////////////////////////////////////////////////
// Memory Info
bool GetMemoryInfo(int &memoryLoad, uint64 &totalPhys, uint64 &freePhys, uint64 &totalPageFile, uint64 &freePageFile, uint64 &totalVirtual, uint64 &freeVirtual);
/////////////////////////////////////////////////////////////////////
// Windows list
// They get arrays with handles to all the opened windows with additional info as
// pid: Handle to the process that manages the window
// name: Window name
// fileName: Window process program file name
// title: Window title (caption)
void GetWindowsList(Array<long> &wid, Array<long> &pid, Array<String> &name, Array<String> &fileName, Array<String> &title);
Array<long> GetWindowsList();
/////////////////////////////////////////////////////////////////////
// Process list
// They get arrays with handles to all the opened processes and process names
bool GetProcessList(Array<long> &pid, Array<String> &pNames);
Array<long> GetProcessList();
String GetProcessName(long pid);
// Gets the program file name of a process
String GetProcessFileName(long processID);
// Gets the process id of a program with a window with certain title
long GetProcessIdFromWindowCaption(String windowCaption, bool exactMatch = false);
long GetWindowIdFromCaption(String windowCaption, bool exactMatch = false);
long GetProcessIdFromWindowId(long wid);
long GetWindowIdFromProcessId(long pid);
// Ends a process by any means
bool ProcessTerminate(long pid, int timeout = 500);
// Gets the process priority as a number from 0 (minimum) to 10 (maximum)
int GetProcessPriority(long pid);
bool SetProcessPriority(long pid, int priority);
// True if a process with handle pid exists
bool ProcessExists(long pid);
/////////////////////////////////////////////////////////////////////
// Os Info
bool GetOsInfo(String &kernel, String &kerVersion, String &kerArchitecture, String &distro, String &distVersion, String &desktop, String &deskVersion);
String GetDesktopManagerNew();
/////////////////////////////////////////////////////////////////////
// Drives list
// Get the dirve path list
Array<String> GetDriveList();
// Get drives info
// Return false if drive is not mounted or it is not accesible
bool GetDriveSpace(String drive, uint64 &freeBytesUser, uint64 &totalBytesUser, uint64 &totalFreeBytes);
bool GetDriveInformation(String drive, String &type, String &volume, /*uint64 &serial, */int &maxName, String &fileSystem);
/////////////////////////////////////////////////////////////////////
// Others
// Gets process id
long GetProcessId();
// I tries to "logoff", "reboot" or "shutdown"
bool Shutdown(String action);
// It converts an amount of bytes to compact size
String BytesToKMGT(uint64 bytes);
// It gets compiler info
void GetCompilerInfo(String &name, int &version, String &date);
// It gets info about the battery status
bool GetBatteryStatus(bool &discharging, int &percentage, int &remainingMin);
// Get if there is battery
bool GetBatteryInfo(bool &present/*, int &designCapacity, int &lastFullCapacity, String &vendor, String &type, String &model, String &serial*/);
/////////////////////////////////////////////////////////////////////
// Key and mouse keys
bool Window_GetRect(long windowId, long &left, long &top, long &right, long &bottom);
void Window_SetRect(long windowId, long left, long top, long right, long bottom);
bool Mouse_GetPos(long &x, long &y);
bool Mouse_SetPos(long x, long y, long windowId);
bool Window_SaveCapture(long windowId, String fileName);
#if defined(PLATFORM_WIN32)
void Mouse_LeftClick();
void Mouse_MiddleClick();
void Mouse_RightClick();
void Mouse_LeftDblClick();
void Mouse_MiddleDblClick();
void Mouse_RightDblClick();
void Keyb_SendKeys(String text, long finalDelay = 100, long delayBetweenKeys = 50);
void GetKeyLockStatus(bool &caps, bool &num, bool &scroll);
void SetKeyLockStatus(bool caps, bool num, bool scroll);
#endif
#endif
// Known bugs
// GetWindowsList does not get the window title in Kde
// Shutdown in Linux only works with option "logoff", probably because of user permissions

7
bazaar/SysInfo/SysInfo.t Normal file
View file

@ -0,0 +1,7 @@
#ifdef _MSC_VER
#pragma setlocale("C")
#endif
// SysInfo.cpp
T_("UNKNOWN")
esES("DESCONOCIDO")

View file

@ -1,3 +1,7 @@
description "OS, hardware and Desktop handling functions\377BI128,0,0";
noblitz;
uses
Core;
@ -8,7 +12,10 @@ library(!WIN32) X11;
file
SysInfo.h,
SysInfo.cpp,
src.tpp;
srcimp.tpp,
srcdoc.tpp,
src.tpp,
SysInfo.t;
mainconfig
"" = "";

4
bazaar/SysInfo/init Normal file
View file

@ -0,0 +1,4 @@
#ifndef _SysInfo_icpp_init_stub
#define _SysInfo_icpp_init_stub
#include "Core/init"
#endif

View file

@ -0,0 +1,482 @@
topic "SysInfo function reference";
[2 $$0,0#00000000000000000000000000000000:Default]
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
[l288;2 $$2,0#27521748481378242620020725143825:desc]
[0 $$3,0#96390100711032703541132217272105:end]
[H6;0 $$4,0#05600065144404261032431302351956:begin]
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
[b42;2 $$9,9#13035079074754324216151401829390:normal]
[{_}%EN-US
[s4;%- [*R6 SysInfo]&]
[s0;%- &]
[s4;%- &]
[s5;:Replace`(String`,String`,String`):%- [_^String^ String]_[* Replace]([_^String^ String]_
[*@3 str], [_^String^ String]_[*@3 find], [_^String^ String]_[*@3 replace])&]
[s2; Returns the resulting String obtained by replacing in [%-*@3 str]
String [%-*@3 find] with [%-*@3 replace ]all the times that [%-*@3 find
]appears in [%-*@3 str].&]
[s3; &]
[s4;%- &]
[s5;:FormatLong`(long`):%- [_^String^ String]_[* FormatLong]([@(0.0.255) long]_[*@3 a])&]
[s2; Returns the long number [%-*@3 a ]converted into a String.&]
[s3; &]
[s4;%- &]
[s5;:SearchFile`(String`,String`,String`):%- [_^Array^ Array]<[_^String^ String]>_[* Search
File]([_^String^ String]_[*@3 dir], [_^String^ String]_[*@3 condFile],
[_^String^ String]_[*@3 text]_`=_`"`")&]
[s2; Returns an Array of Strings containing the file names with full
path of the files under folder [%-*@3 dir] that comply with condition
(with wildcards) [%-*@3 condFile] and that contain inside the text
[%-*@3 text].&]
[s3; &]
[s4;%- &]
[s5;:LoadFile`_Safe`(String`):%- [_^String^ String]_[* LoadFile`_Safe]([_^String^ String]_[*@3 f
ileName])&]
[s2; Same as LoadFile([%-*@3 fileName]) but it works in Posix for files
automatically generated by the OS.&]
[s0; &]
[s0; U`+`+ LoadFile() functions prior to loading the file into a
String, get the length of the file to dimension the String that
will get the file. This is not valid for OS generated virtual
files where the file length returned by the OS is 0 (for example
files under folder /proc)&]
[s0; &]
[s0; LoadFile`_Safe() just get the file bytes returned by the OS
until the file end.&]
[s3; &]
[s4;%- &]
[s5;:GetExtExecutable`(const String`):%- [_^String^ String]_[* GetExtExecutable]([@(0.0.255) c
onst]_[_^String^ String]_[*@3 ext])&]
[s2; Gets the program that will open by default the files with extension
[%-*@3 ext].&]
[s0; -|For example GetExtExecutable(`"html`") will return a String
with the name of the default internet browser.&]
[s3; &]
[s4;%- &]
[s5;:LaunchFile`(const String`):%- [@(0.0.255) bool]_[* LaunchFile]([@(0.0.255) const]_[_^String^ S
tring]_[*@3 file])&]
[s2; Opens the file [%-*@3 file ]with the adecuated program defined
in the OS by default.&]
[s3; &]
[s4;%- &]
[s5;:LaunchCommand`(const char`*`,void`(`*`)`(String`&`)`):%- [@(0.0.255) int]_[* LaunchC
ommand]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 cmd], [@(0.0.255) void]_(`*[*@3 readCal
lBack])(String_`&))&]
[s2; Launches command line program [%-*@3 cmd. readCallBack ]is a function
to manage the program output.&]
[s2; Returns the command exit code .&]
[s3; &]
[s4;%- &]
[s5;:LaunchCommand`(const char`*`,String`&`):%- [@(0.0.255) int]_[* LaunchCommand]([@(0.0.255) c
onst]_[@(0.0.255) char]_`*[*@3 cmd], [_^String^ String]_`&[*@3 ret])&]
[s2; Launches command line program [%-*@3 cmd. ret ]gets all the program
output.&]
[s2; Returns the command exit code.&]
[s3; &]
[s4;%- &]
[s5;:LaunchCommand`(const char`*`):%- [_^String^ String]_[* LaunchCommand]([@(0.0.255) cons
t]_[@(0.0.255) char]_`*[*@3 cmd])&]
[s2;%- [%% Launches command line program ][*@3 cmd.]&]
[s0; -|Returns the program output.&]
[s3; &]
[s4;%- &]
[s5;:DoEvents`(`):%- [@(0.0.255) void]_[* DoEvents]()&]
[s2; A ProcessEvents just for old Visual Basic programmers.&]
[s3;%- &]
[s4;%- &]
[s5;:GetDesktopFolder`(`):%- [_^String^ String]_[* GetDesktopFolder]()&]
[s2; Gets the default Desktop folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetProgramsFolder`(`):%- [_^String^ String]_[* GetProgramsFolder]()&]
[s2; Gets the default programs folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetAppDataFolder`(`):%- [_^String^ String]_[* GetAppDataFolder]()&]
[s2; Gets the default application data folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetMusicFolder`(`):%- [_^String^ String]_[* GetMusicFolder]()&]
[s2; Gets the default music files folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetPicturesFolder`(`):%- [_^String^ String]_[* GetPicturesFolder]()&]
[s2; Gets the default picture files folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetVideoFolder`(`):%- [_^String^ String]_[* GetVideoFolder]()&]
[s2; Gets the default video files folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetPersonalFolder`(`):%- [_^String^ String]_[* GetPersonalFolder]()&]
[s2; Gets the default personal files folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetTemplatesFolder`(`):%- [_^String^ String]_[* GetTemplatesFolder]()&]
[s2; Gets the default templates files folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetDownloadFolder`(`):%- [_^String^ String]_[* GetDownloadFolder]()&]
[s2; Gets the default file download folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetRootFolder`(`):%- [_^String^ String]_[* GetRootFolder]()&]
[s2; Gets the default root folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetTempFolder`(`):%- [_^String^ String]_[* GetTempFolder]()&]
[s2; Gets the default temp files folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetOsFolder`(`):%- [_^String^ String]_[* GetOsFolder]()&]
[s2; Gets the default operating system files folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetSystemFolder`(`):%- [_^String^ String]_[* GetSystemFolder]()&]
[s2; Gets the default system files folder path.&]
[s3;%- &]
[s4;%- &]
[s5;:GetSystemInfo`(String`&`,String`&`,String`&`,int`&`):%- [@(0.0.255) void]_[* GetSyst
emInfo]([_^String^ String]_`&[*@3 manufacturer], [_^String^ String]_`&[*@3 productName],
[_^String^ String]_`&[*@3 version], [@(0.0.255) int]_`&[*@3 numberOfProcessors])&]
[s2; Returns hardware information including computer [%-*@3 manufacturer,
] [%-*@3 productName, ] [%-*@3 version ]and [%-*@3 numberOfProcessors].&]
[s3; &]
[s4;%- &]
[s5;:GetBiosInfo`(String`&`,Date`&`):%- [@(0.0.255) void]_[* GetBiosInfo]([_^String^ String
]_`&[*@3 biosVersion], [_^Date^ Date]_`&[*@3 biosReleaseDate])&]
[s2; Returns bios information including [%-*@3 biosVersion] and [%-*@3 biosReleaseDate].&]
[s3; &]
[s4;%- &]
[s5;:GetProcessorInfo`(int`,String`&`,String`&`,String`&`,int`&`):%- [@(0.0.255) bool]_
[* GetProcessorInfo]([@(0.0.255) int]_[*@3 number], [_^String^ String]_`&[*@3 vendor],
[_^String^ String]_`&[*@3 identifier], [_^String^ String]_`&[*@3 architecture],
[@(0.0.255) int]_`&[*@3 speed])&]
[s2; Returns information about the different cpu cores.&]
[s2; [%-*@3 number] is the core number to get the information&]
[s2; [%-*@3 vendor] is the core vendor&]
[s2; [%-*@3 identifier] is the core identifier&]
[s2; [%-*@3 architecture] is the core architecture (32, 64)&]
[s2; [%-*@3 speed].is the core speed in MHz.&]
[s3; &]
[s4;%- &]
[s5;:GetMemoryInfo`(int`&`,uint64`&`,uint64`&`,uint64`&`,uint64`&`,uint64`&`,uint64`&`):%- [@(0.0.255) b
ool]_[* GetMemoryInfo]([@(0.0.255) int]_`&[*@3 memoryLoad], [_^uint64^ uint64]_`&[*@3 total
Phys], [_^uint64^ uint64]_`&[*@3 freePhys], [_^uint64^ uint64]_`&[*@3 totalPageFile],
[_^uint64^ uint64]_`&[*@3 freePageFile], [_^uint64^ uint64]_`&[*@3 totalVirtual],
[_^uint64^ uint64]_`&[*@3 freeVirtual])&]
[s2; Gets information about the system memory:&]
[s2; [%-*@3 memoryLoad ]is the percent of memory in use&]
[s2; [%-*@3 totalPhys ]is the total physical memory&]
[s2; [%-*@3 freePhys] is the free physical memory&]
[s2; [%-*@3 totalPageFile ]is the total paging file&]
[s2; [%-*@3 freePageFile ]is the free paging file&]
[s2; [%-*@3 totalVirtual ]is the total virtual memory&]
[s2; [%-*@3 freeVirtual ]is the free virtual memory.&]
[s0; &]
[s4;%- &]
[s5;:GetWindowsList`(Array`<long`>`&`,Array`<long`>`&`,Array`<String`>`&`,Array`<String`>`&`,Array`<String`>`&`):%- [@(0.0.255) v
oid]_[* GetWindowsList]([_^Array^ Array]<[@(0.0.255) long]>_`&[*@3 wid],
[_^Array^ Array]<[@(0.0.255) long]>_`&[*@3 pid], [_^Array^ Array]<[_^String^ String]>_`&[*@3 n
ame], [_^Array^ Array]<[_^String^ String]>_`&[*@3 fileName], [_^Array^ Array]<[_^String^ St
ring]>_`&[*@3 title])&]
[s2; Gets arrays with handles to all the opened windows with additional
info as:&]
[s2; [%-*@3 wid]: Handle to the the window&]
[s2; [%-*@3 pid]: Handle to the process that manages the window&]
[s2; [%-*@3 name]: Window name&]
[s2; [%-*@3 fileName]: Window process program file name&]
[s2; [%-*@3 title]: Window title (caption)&]
[s3; &]
[s4;%- &]
[s5;:GetWindowsList`(`):%- [_^Array^ Array]<[@(0.0.255) long]>_[* GetWindowsList]()&]
[s2; Gets an array with handles to all the opened windows.&]
[s3;%- &]
[s4;%- &]
[s5;:GetProcessList`(Array`<long`>`&`,Array`<String`>`&`):%- [@(0.0.255) bool]_[* GetProc
essList]([_^Array^ Array]<[@(0.0.255) long]>_`&[*@3 pid], [_^Array^ Array]<[_^String^ Strin
g]>_`&[*@3 pNames])&]
[s2; Gets arrays with handles to all the opened processes [%-*@3 pid
]and process names [%-*@3 pNames].&]
[s3; &]
[s4;%- &]
[s5;:GetProcessList`(`):%- [_^Array^ Array]<[@(0.0.255) long]>_[* GetProcessList]()&]
[s2; Gets an array with handles to all the opened processes&]
[s3;%- &]
[s4;%- &]
[s5;:GetProcessName`(long`):%- [_^String^ String]_[* GetProcessName]([@(0.0.255) long]_[*@3 p
id])&]
[s2; Returns the process name for a process with handle [%-*@3 pid].&]
[s3; &]
[s4;%- &]
[s5;:GetProcessFileName`(long`):%- [_^String^ String]_[* GetProcessFileName]([@(0.0.255) lo
ng]_[*@3 processID])&]
[s2; Gets the program file name of a process with handle [%-*@3 processID].&]
[s3; &]
[s4;%- &]
[s5;:GetProcessIdFromWindowCaption`(String`,bool`):%- [@(0.0.255) long]_[* GetProcessIdFr
omWindowCaption]([_^String^ String]_[*@3 windowCaption], [@(0.0.255) bool]_[*@3 exactMatc
h]_`=_[@(0.0.255) false])&]
[s2;%- [%% Gets the process handle of a program with a window with
title ][*@3 windowCaption.]&]
[s2;%- [%% If ][*@3 exactMatch][%% .is true it only returns the process
handle of a process with a window title that is equal to ][*@3 windowCaption.
][%% If it is false then the handle is returned if only part of
the window title matches with ][*@3 windowCaption.]&]
[s3; &]
[s4;%- &]
[s5;:GetWindowIdFromCaption`(String`,bool`):%- [@(0.0.255) long]_[* GetWindowIdFromCaptio
n]([_^String^ String]_[*@3 windowCaption], [@(0.0.255) bool]_[*@3 exactMatch]_`=_[@(0.0.255) f
alse])&]
[s2;%- [%% Gets the window handle of a program with a window with title
][*@3 windowCaption.]&]
[s2;%- [%% If ][*@3 exactMatch][%% .is true it only returns the process
handle of a process with a window title that is equal to ][*@3 windowCaption.
][%% If it is false then the handle is returned if only part of
the window title matches with ][*@3 windowCaption.]&]
[s3; &]
[s4;%- &]
[s5;:GetProcessIdFromWindowId`(long`):%- [@(0.0.255) long]_[* GetProcessIdFromWindowId]([@(0.0.255) l
ong]_[*@3 wid])&]
[s2;%- [%% Returns the process handle of a program with window handle
][*@3 wid.]&]
[s3; &]
[s4;%- &]
[s5;:GetWindowIdFromProcessId`(long`):%- [@(0.0.255) long]_[* GetWindowIdFromProcessId]([@(0.0.255) l
ong]_[*@3 pid])&]
[s2;%- [%% Returns the window handle of a program with process handle
][*@3 pid.]&]
[s3; &]
[s4;%- &]
[s5;:ProcessTerminate`(long`,int`):%- [@(0.0.255) bool]_[* ProcessTerminate]([@(0.0.255) lo
ng]_[*@3 pid], [@(0.0.255) int]_[*@3 timeout]_`=_[@3 500])&]
[s2;%- [%% Ends the program with handle ][*@3 pid.]&]
[s2; If after asking the process to end [%-*@3 timeout ]is over, it
will kill the process by different means in order of increasing
`"aggressivity`".&]
[s0; -|For example in Posix it will send the process first a SIGTERM,
if the process does not stop it will send a SIGKILL, and if the
process remains running it will simply call WindowKill() to do
the dirty job.&]
[s3; &]
[s4;%- &]
[s5;:GetProcessPriority`(long`):%- [@(0.0.255) int]_[* GetProcessPriority]([@(0.0.255) long
]_[*@3 pid])&]
[s2; Gets the process priority of the process with handle [%-*@3 pid]
as a number from 0 (minimum) to 10 (maximum), if possible.&]
[s3; &]
[s4;%- &]
[s5;:SetProcessPriority`(long`,int`):%- [@(0.0.255) bool]_[* SetProcessPriority]([@(0.0.255) l
ong]_[*@3 pid], [@(0.0.255) int]_[*@3 priority])&]
[s2; Sets the process priority to [%-*@3 priority ]of the process with
handle [%-*@3 pid] as a number from 0 (minimum) to 10 (maximum),
if possible.&]
[s3; &]
[s4;%- &]
[s5;:ProcessExists`(long`):%- [@(0.0.255) bool]_[* ProcessExists]([@(0.0.255) long]_[*@3 pid])
&]
[s2; Returns true if a process with handle [%-*@3 pid ]exists.&]
[s3; &]
[s4;%- &]
[s5;:GetOsInfo`(String`&`,String`&`,String`&`,String`&`,String`&`,String`&`,String`&`):%- [@(0.0.255) b
ool]_[* GetOsInfo]([_^String^ String]_`&[*@3 kernel], [_^String^ String]_`&[*@3 kerVersion],
[_^String^ String]_`&[*@3 kerArchitecture], [_^String^ String]_`&[*@3 distro],
[_^String^ String]_`&[*@3 distVersion], [_^String^ String]_`&[*@3 desktop],
[_^String^ String]_`&[*@3 deskVersion])&]
[s2; Gets many information to identify the operating system and Desktop
where the application is being run. &]
[s2; [%-*@3 kernel]: Kernel name&]
[s2; [%-*@3 kerVersion]: Kernel version&]
[s2; [%-*@3 kerArchitecture]: Kernel architecture&]
[s2; [%-*@3 distro]: Distro name&]
[s2; [%-*@3 distVersion]: Distro version&]
[s2; [%-*@3 desktop]: Desktop manager name&]
[s2; [%-*@3 deskVersion].: Desktop manager version&]
[s3; &]
[s4;%- &]
[s5;:GetDesktopManagerNew`(`):%- [_^String^ String]_[* GetDesktopManagerNew]()&]
[s2; A more complete version of GetDesktopManager() based on GetOsInfo().&]
[s3;%- &]
[s4;%- &]
[s5;:GetDriveList`(`):%- [_^Array^ Array]<[_^String^ String]>_[* GetDriveList]()&]
[s2; Returns an array with the paths to all drives, internal or external,
identified in the system.&]
[s3;%- &]
[s4;%- &]
[s5;:GetDriveSpace`(String`,uint64`&`,uint64`&`,uint64`&`):%- [@(0.0.255) bool]_[* GetDri
veSpace]([_^String^ String]_[*@3 drive], [_^uint64^ uint64]_`&[*@3 freeBytesUser],
[_^uint64^ uint64]_`&[*@3 totalBytesUser], [_^uint64^ uint64]_`&[*@3 totalFreeBytes])&]
[s2; Gets [%-*@3 drive] space.&]
[s2; [%-*@3 freeBytesUser]: Amount of free bytes available to the user&]
[s2; [%-*@3 totalBytesUser]: Size of drive visible for the user&]
[s2; [%-*@3 totalFreeBytes]: Amount of free bytes.&]
[s0; -|Returns false if drive is not mounted or it is not accessible&]
[s3; &]
[s4;%- &]
[s5;:GetDriveInformation`(String`,String`&`,String`&`,int`&`,String`&`):%- [@(0.0.255) b
ool]_[* GetDriveInformation]([_^String^ String]_[*@3 drive], [_^String^ String]_`&[*@3 type
], [_^String^ String]_`&[*@3 volume], [@(0.0.255) int]_`&[*@3 maxName],
[_^String^ String]_`&[*@3 fileSystem])&]
[s2; Gets [%-*@3 drive] information&]
[s2;%- [*@3 type]: Gets the type of the drive.&]
[s2;%- Available types are `"Hard`", `"Network`", `"Optical`", `"RAM`",
`"Removable`".&]
[s2;%- [*@3 volume]: Gets the name of the drive&]
[s2;%- [*@3 maxName]: Gets the maximum length permitted for a file name&]
[s2;%- [*@3 fileSystem]: Gets the drive formatting system.&]
[s0; -|Returns false if drive is not mounted or it is not accessible&]
[s3; &]
[s4;%- &]
[s5;:GetProcessId`(`):%- [@(0.0.255) long]_[* GetProcessId]()&]
[s2; Gets actual running process handle.&]
[s3;%- &]
[s4;%- &]
[s5;:Shutdown`(String`):%- [@(0.0.255) bool]_[* Shutdown]([_^String^ String]_[*@3 action])&]
[s2; Tries to logoff, reboot or shutdown the actual running process.&]
[s0; -|Actual valid [%-*@3 action ]values are `"logoff`", `"reboot`"
and `"shutdown`".&]
[s3; &]
[s4;%- &]
[s5;:BytesToKMGT`(uint64`):%- [_^String^ String]_[* BytesToKMGT]([_^uint64^ uint64]_[*@3 byte
s])&]
[s2; Converts an amount of bytes [%-*@3 bytes ]to the shortest String
possible.&]
[s3; &]
[s4;%- &]
[s5;:GetCompilerInfo`(String`&`,int`&`,String`&`):%- [@(0.0.255) void]_[* GetCompilerInfo
]([_^String^ String]_`&[*@3 name], [@(0.0.255) int]_`&[*@3 version],
[_^String^ String]_`&[*@3 date])&]
[s2; Returns compiling information, like compiler [%-*@3 name, ]compiler
[%-*@3 version] and program compilation [%-*@3 date].&]
[s3; &]
[s4;%- &]
[s5;:GetBatteryStatus`(bool`&`,int`&`,int`&`):%- [@(0.0.255) bool]_[* GetBatteryStatus]([@(0.0.255) b
ool]_`&[*@3 discharging], [@(0.0.255) int]_`&[*@3 percentage], [@(0.0.255) int]_`&[*@3 rema
iningMin])&]
[s2; Gets battery information like if it is [%-*@3 discharging] or
connected to the grid, [%-*@3 percentage] of charging where 100%
means full charge, and number of expected computer running minutes
in [%-*@3 remainingMin].&]
[s0; -|Returns true if the values got are valid.&]
[s3; &]
[s4;%- &]
[s5;:GetBatteryInfo`(bool`&`):%- [@(0.0.255) bool]_[* GetBatteryInfo]([@(0.0.255) bool]_`&[*@3 p
resent]_)&]
[s2; Gets if battery is [%-*@3 present ]or not.&]
[s0; -|Returns true if the values got are valid.&]
[s3; &]
[s4;%- &]
[s5;:Window`_GetRect`(long`,long`&`,long`&`,long`&`,long`&`):%- [@(0.0.255) bool]_[* Wind
ow`_GetRect]([@(0.0.255) long]_[*@3 windowId], [@(0.0.255) long]_`&[*@3 left],
[@(0.0.255) long]_`&[*@3 top], [@(0.0.255) long]_`&[*@3 right], [@(0.0.255) long]_`&[*@3 bott
om])&]
[s2; Giving this function the [%-*@3 windowId], it returns the window
location in the screen in [%-*@3 left], [%-*@3 top], [%-*@3 right]
and [%-*@3 bottom].&]
[s0; -|Returns true if the values got are valid.&]
[s3; &]
[s4;%- &]
[s5;:Window`_SetRect`(long`,long`,long`,long`,long`):%- [@(0.0.255) void]_[* Window`_SetR
ect]([@(0.0.255) long]_[*@3 windowId], [@(0.0.255) long]_[*@3 left],
[@(0.0.255) long]_[*@3 top], [@(0.0.255) long]_[*@3 right], [@(0.0.255) long]_[*@3 bottom])&]
[s2; Giving this function the [%-*@3 windowId], it sets the window
location in the screen in [%-*@3 left], [%-*@3 top], [%-*@3 right]
and [%-*@3 bottom].&]
[s2; -|Returns true if the window is relocated correctly..&]
[s3; &]
[s4;%- &]
[s5;:Mouse`_GetPos`(long`&`,long`&`):%- [@(0.0.255) bool]_[* Mouse`_GetPos]([@(0.0.255) lon
g]_`&[*@3 x], [@(0.0.255) long]_`&[*@3 y])&]
[s2; Gets the mouse position [%-*@3 x, y].in screen pixels where upper
left corner is (0, 0).&]
[s0; -|Returns true if the operation has been done successfully.&]
[s3; &]
[s4;%- &]
[s5;:Mouse`_SetPos`(long`,long`,long`):%- [@(0.0.255) bool]_[* Mouse`_SetPos]([@(0.0.255) l
ong]_[*@3 x], [@(0.0.255) long]_[*@3 y], [@(0.0.255) long]_[*@3 windowId])&]
[s2; Sets the mouse position to [%-*@3 x] [%-*@3 y] referenced to the
upper left vertex of window with window handle [%-*@3 windowId].&]
[s0; -|Returns true if the operation has been done successfully.&]
[s3; &]
[s4;%- &]
[s5;:Window`_SaveCapture`(long`,String`):%- [@(0.0.255) bool]_[* Window`_SaveCapture]([@(0.0.255) l
ong]_[*@3 windowId], [_^String^ String]_[*@3 fileName])&]
[s2; Saves the image of the window with handle [%-*@3 windowId] to
the file with name [%-*@3 fileName].&]
[s0; -|In Posix systems the bitmap file format is .xwd&]
[s0; -|In Windows systems the bitmap file format is .bmp.&]
[s3; &]
[s4;%- &]
[s5;:Mouse`_LeftClick`(`):%- [@(0.0.255) void]_[* Mouse`_LeftClick]()&]
[s2; Simulates by software a mouse click with the left button as
if it would have been done with the mouse.&]
[s3;%- &]
[s4;%- &]
[s5;:Mouse`_MiddleClick`(`):%- [@(0.0.255) void]_[* Mouse`_MiddleClick]()&]
[s2; Simulates by software a mouse click with the middle button as
if it would have been done with the mouse.&]
[s3;%- &]
[s4;%- &]
[s5;:Mouse`_RightClick`(`):%- [@(0.0.255) void]_[* Mouse`_RightClick]()&]
[s2; Simulates by software a mouse click with the right button as
if it would have been done with the mouse.&]
[s3;%- &]
[s4;%- &]
[s5;:Mouse`_LeftDblClick`(`):%- [@(0.0.255) void]_[* Mouse`_LeftDblClick]()&]
[s2; Simulates by software a mouse double click with the left button
as if it would have been done with the mouse.&]
[s3;%- &]
[s4;%- &]
[s5;:Mouse`_MiddleDblClick`(`):%- [@(0.0.255) void]_[* Mouse`_MiddleDblClick]()&]
[s2; Simulates by software a mouse double click with the middle button
as if it would have been done with the mouse.&]
[s3;%- &]
[s4;%- &]
[s5;:Mouse`_RightDblClick`(`):%- [@(0.0.255) void]_[* Mouse`_RightDblClick]()&]
[s2; Simulates by software a mouse double click with the right button
as if it would have been done with the mouse.&]
[s3;%- &]
[s4;%- &]
[s5;:Keyb`_SendKeys`(String`,long`,long`):%- [@(0.0.255) void]_[* Keyb`_SendKeys]([_^String^ S
tring]_[*@3 text], [@(0.0.255) long]_[*@3 finalDelay]_`=_[@3 100], [@(0.0.255) long]_[*@3 del
ayBetweenKeys]_`=_[@3 50])&]
[s2; Simulates by software a text entered using the keyboard as if
it would have been entered with the keyboard.&]
[s2; To really simulate manual key typing the function lets to enter
delays between keys and after entering the text.&]
[s2; [%-*@3 text]: Is the text to be entered&]
[s2; [%-*@3 finalDelay]: Is the delay in ms that is forced after entering
text&]
[s2; [%-*@3 delayBetweenKeys]: Is the delay in ms that is forced between
text keys.&]
[s3; &]
[s4;%- &]
[s5;:GetKeyLockStatus`(bool`&`,bool`&`,bool`&`):%- [@(0.0.255) void]_[* GetKeyLockStatus](
[@(0.0.255) bool]_`&[*@3 caps], [@(0.0.255) bool]_`&[*@3 num], [@(0.0.255) bool]_`&[*@3 scrol
l])&]
[s2; Gets the status of keys [%-*@3 caps ]lock, [%-*@3 num ]lock and
[%-*@3 scroll] [%-*@3 ]lock.&]
[s3; &]
[s4;%- &]
[s5;:SetKeyLockStatus`(bool`,bool`,bool`):%- [@(0.0.255) void]_[* SetKeyLockStatus]([@(0.0.255) b
ool]_[*@3 caps], [@(0.0.255) bool]_[*@3 num], [@(0.0.255) bool]_[*@3 scroll])&]
[s2; Sets the status of keys [%-*@3 caps ]lock, [%-*@3 num ]lock and
[%-*@3 scroll] [%-*@3 ]lock.&]
[s3; &]
[s4;%- &]
[s5;:GetCpuSpeed`(`):%- [@(0.0.255) int]_[* GetCpuSpeed]()&]
[s2; Gets the real time main CPU speed in MHz.&]
[s0; -|This data is directly calculated by the function.&]
[s3;%- &]
[s4;%- &]
[s5;:FileCat`(const char`*`,const char`*`):%- [@(0.0.255) bool]_[* FileCat]([@(0.0.255) con
st]_[@(0.0.255) char]_`*[*@3 file], [@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 appendFile])
&]
[s2; Appends at the end of [%-*@3 file] the contents of file [%-*@3 appendFile].
[%-*@3 file] will be modified and [%-*@3 appendFile ]remains unchanged.&]
[s0; -|Returns true if the operations has been done succesfully.&]
[s3; &]
[s0; ]

View file

@ -0,0 +1,45 @@
topic "SysInfo general description";
[2 $$0,0#00000000000000000000000000000000:Default]
[l288;i1120;a17;O9;~~~.1408;2 $$1,0#10431211400427159095818037425705:param]
[a83;*R6 $$2,5#31310162474203024125188417583966:caption]
[H4;b83;*4 $$3,5#07864147445237544204411237157677:title]
[i288;O9;C2 $$4,6#40027414424643823182269349404212:item]
[b42;a42;2 $$5,5#45413000475342174754091244180557:text]
[l288;b17;a17;2 $$6,6#27521748481378242620020725143825:desc]
[l321;C@5;1 $$7,7#20902679421464641399138805415013:code]
[b2503;2 $$8,0#65142375456100023862071332075487:separator]
[*@(0.0.255)2 $$9,0#83433469410354161042741608181528:base]
[C2 $$10,0#37138531426314131251341829483380:class]
[l288;a17;*1 $$11,11#70004532496200323422659154056402:requirement]
[i417;b42;a42;O9;~~~.416;2 $$12,12#10566046415157235020018451313112:tparam]
[b167;C2 $$13,13#92430459443460461911108080531343:item1]
[i288;a42;O9;C2 $$14,14#77422149456609303542238260500223:item2]
[*@2$(0.128.128)2 $$15,15#34511555403152284025741354420178:NewsDate]
[l321;*C$7;2 $$16,16#03451589433145915344929335295360:result]
[l321;b83;a83;*C$7;2 $$17,17#07531550463529505371228428965313:result`-line]
[l160;*C+117 $$18,5#88603949442205825958800053222425:package`-title]
[2 $$19,0#53580023442335529039900623488521:gap]
[C2 $$20,20#70211524482531209251820423858195:class`-nested]
[b50;2 $$21,21#03324558446220344731010354752573:Par]
[{_}%EN-US
[s2; SysInfo&]
[s0; Functions to get information and handle Desktop, OS and hardware
internals.&]
[s0; &]
[s0; Includes functions to manage:&]
[s0;0 &]
[s0;i150;O0; Special folders&]
[s0;i150;O0; System Info&]
[s0;i150;O0; Memory Info&]
[s0;i150;O0; OS Info&]
[s0;i150;O0; Distro Info&]
[s0;i150;O0; Default Exes&]
[s0;i150;O0; Drives Info&]
[s0;i150;O0; Launch File&]
[s0;i150;O0; Find and Kill Window&]
[s0;i150;O0; Windows List&]
[s0;i150;O0; Process List&]
[s0;i150;O0; Windows handling&]
[s0;i150;O0; Mouse handling&]
[s0;i150;O0; Keyboard handling&]
[s0; ]

View file

@ -0,0 +1,531 @@
topic "SysInfo implementation details";
[2 $$0,0#00000000000000000000000000000000:Default]
[l288;i1120;a17;O9;~~~.1408;2 $$1,0#10431211400427159095818037425705:param]
[a83;*R6 $$2,5#31310162474203024125188417583966:caption]
[H4;b83;*4 $$3,5#07864147445237544204411237157677:title]
[i288;O9;C2 $$4,6#40027414424643823182269349404212:item]
[b42;a42;2 $$5,5#45413000475342174754091244180557:text]
[l288;b17;a17;2 $$6,6#27521748481378242620020725143825:desc]
[l321;C@5;1 $$7,7#20902679421464641399138805415013:code]
[b2503;2 $$8,0#65142375456100023862071332075487:separator]
[*@(0.0.255)2 $$9,0#83433469410354161042741608181528:base]
[C2 $$10,0#37138531426314131251341829483380:class]
[l288;a17;*1 $$11,11#70004532496200323422659154056402:requirement]
[i417;b42;a42;O9;~~~.416;2 $$12,12#10566046415157235020018451313112:tparam]
[b167;C2 $$13,13#92430459443460461911108080531343:item1]
[i288;a42;O9;C2 $$14,14#77422149456609303542238260500223:item2]
[*@2$(0.128.128)2 $$15,15#34511555403152284025741354420178:NewsDate]
[l321;*C$7;2 $$16,16#03451589433145915344929335295360:result]
[l321;b83;a83;*C$7;2 $$17,17#07531550463529505371228428965313:result`-line]
[l160;*C+117 $$18,5#88603949442205825958800053222425:package`-title]
[2 $$19,0#53580023442335529039900623488521:gap]
[C2 $$20,20#70211524482531209251820423858195:class`-nested]
[b50;2 $$21,21#03324558446220344731010354752573:Par]
[{_}%EN-US
[s2; SysInfo&]
[s0; A goal in the design of these functions has been to avoid accessing
external software not included internally in the OS by default.&]
[s5;i150;O0; Windows implementation does use of internal DLL and
wmic.&]
[s0;i150;O0; Posix implementation uses X11 libraries and OS related
utilities like mount and xdg.&]
[s0; &]
[s0; Another goal is to provide the running program information about
the environment including hardware and software to adapt itself
after program compiling. This way for example a program compiled
in Ubuntu can run properly in Fedora without recompiling.&]
[s0; &]
[s0; OS and Desktop implementation is a work in process as in some
implementations it requires a level of hacking so all feedback
will be acknowledged.&]
[s0; &]
[s0; &]
[ {{10000@(128) [s0; [* Testing results]]}}&]
[s0; &]
[ {{769:769:769:769:769:769:769:769:769:769:769:769:772h1;@1 [s0; [0 Distro]]
:: [s0; [0 Version]]
:: [s0; [0 Architecture]]
:: [s0; [0 Desktop]]
:: [s0; [0 Version]]
:: [s0; [0 Tested]]
:: [s0; [0 Comments]]
:: [s0; [0 Special folders]]
:: [s0; [0 System Info]]
:: [s0; [0 Memory Info]]
:: [s0; [0 OS Info]]
:: [s0; [0 Distro Info]]
:: [s0; [0 Default Exes]]
::@2 [s0; [0 Freesbie]]
:: [s0; [0 2.0]]
:: [s0; [0 32]]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 No]]
::@9 [s0; [0 Not possible to run without password]]
::@2 [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 Fedora]]
:: [s0; [0 9]]
:: [s0; [0 32]]
:: [s0; [0 Gnome]]
:: [s0; [0 2.22]]
:: [s0; [0 Yes]]
:: [s0;0 ]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Fedora]]
:: [s0; [0 9]]
:: [s0; [0 32]]
:: [s0; [0 Kde]]
:: [s0; [0 4.0.3]]
:: [s0; [0 Yes]]
:: [s0;0 ]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Fluxbox]]
:: [s0; [0 7.10]]
:: [s0; [0 32]]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 No]]
::@9 [s0; [0 Live version not found]]
::@2 [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 Gentoo]]
:: [s0;0 ]
:: [s0; [0 32]]
:: [s0; [0 Xfce]]
:: [s0;0 ]
:: [s0; [0 No]]
::@9 [s0; [0 Not possible to mount internal or usb HD]]
::@2 [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 Knoppix]]
:: [s0; [0 5.11]]
:: [s0; [0 32]]
:: [s0; [0 Kde]]
:: [s0;0 ]
:: [s0; [0 No]]
::@9 [s0; [0 Old Glib version]]
::@2 [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 Kubuntu]]
:: [s0; [0 8.10]]
:: [s0; [0 32]]
:: [s0; [0 Kde]]
:: [s0; [0 4.1.2]]
:: [s0; [0 Yes]]
:: [s0;0 ]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Mandriva]]
:: [s0; [0 2009]]
:: [s0; [0 32]]
:: [s0; [0 Kde]]
:: [s0;0 ]
:: [s0; [0 Yes]]
:: [s0;0 ]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Mandriva]]
:: [s0; [0 2009]]
:: [s0; [0 32]]
:: [s0; [0 Gnome]]
:: [s0; [0 2.24]]
:: [s0; [0 Yes]]
:: [s0;0 ]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
::@9 [s0; [0 No virtual memory]]
::@2 [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Opengeu]]
:: [s0; [0 8.04]]
:: [s0; [0 32]]
:: [s0; [0 Enlightenment]]
:: [s0; [0 0.16]]
:: [s0; [0 Yes]]
:: [s0;0 ]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 OpenSuse]]
:: [s0; [0 11]]
:: [s0; [0 32]]
:: [s0; [0 Gnome]]
:: [s0; [0 2.22]]
:: [s0; [0 Yes]]
:: [s0;0 ]
::@9 [s0; [0 Some not detected]]
::@2 [s0; [0 Ok]]
::@9 [s0; [0 No virtual memory]]
::@2 [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 OpenSuse]]
:: [s0; [0 11]]
:: [s0; [0 32]]
:: [s0; [0 Kde]]
:: [s0; [0 4.0.4]]
:: [s0; [0 Yes]]
:: [s0;0 ]
::@9 [s0; [0 Some not detected]]
::@2 [s0; [0 Ok]]
::@9 [s0; [0 No virtual memory]]
::@2 [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Slackware]]
:: [s0;0 ]
:: [s0; [0 32]]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
::@9 [s0; [0 Live version not found]]
::@2 [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 Slax]]
:: [s0;0 ]
:: [s0; [0 32]]
:: [s0; [0 Kde]]
:: [s0; [0 3.5.9]]
:: [s0; [0 Yes]]
:: [s0;0 ]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ubuntu]]
:: [s0; [0 8.04]]
:: [s0; [0 32]]
:: [s0; [0 Gnome]]
:: [s0; [0 2.22]]
:: [s0; [0 Yes]]
:: [s0;0 ]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ubuntu]]
:: [s0; [0 8.04]]
:: [s0; [0 64]]
:: [s0; [0 Gnome]]
:: [s0; [0 2.22]]
:: [s0; [0 Yes]]
:: [s0;0 ]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Xubuntu]]
:: [s0; [0 8.10]]
:: [s0; [0 32]]
:: [s0; [0 Xfce]]
:: [s0;0 ]
:: [s0; [0 Yes]]
::@9 [s0; [0 Partial test. Expected better results]]
:: [s0; [0 Some not detected]]
::@2 [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
::@9 [s0; [0 No version]]
::@2 [s0; [0 Ok]]
:: [s0; [0 Vista]]
:: [s0; [0 Home Premium Edition]]
:: [s0; [0 32]]
:: [s0; [0 Vista]]
:: [s0;0 ]
:: [s0; [0 Yes]]
:: [s0;0 ]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 XP]]
:: [s0; [0 5.1 SP3]]
:: [s0; [0 32]]
:: [s0; [0 XP]]
:: [s0;0 ]
:: [s0; [0 Yes]]
:: [s0;0 ]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]}}&]
[s0;0 &]
[s0;%- &]
[ {{908:908:908:908:908:908:908:908:908:908:920h1;@1 [s0; [0 Distro]]
:: [s0; [0 Version]]
:: [s0; [0 Architecture]]
:: [s0; [0 Desktop]]
:: [s0; [0 Version]]
:: [s0; [0 Tested]]
:: [s0; [0 Drives Info]]
:: [s0; [0 Launch File]]
:: [s0; [0 Find and Kill Window]]
:: [s0; [0 Windows List]]
:: [s0; [0 Process List]]
::@2 [s0; [0 Freesbie]]
:: [s0; [0 2.0]]
:: [s0; [0 32]]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 No]]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 Fedora]]
:: [s0; [0 9]]
:: [s0; [0 32]]
:: [s0; [0 Gnome]]
:: [s0; [0 2.22]]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Fedora]]
:: [s0; [0 9]]
:: [s0; [0 32]]
:: [s0; [0 Kde]]
:: [s0; [0 4.0.3]]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Fluxbox]]
:: [s0; [0 7.10]]
:: [s0; [0 32]]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 No]]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 Gentoo]]
:: [s0;0 ]
:: [s0; [0 32]]
:: [s0; [0 Xfce]]
:: [s0;0 ]
:: [s0; [0 No]]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 Knoppix]]
:: [s0; [0 5.11]]
:: [s0; [0 32]]
:: [s0; [0 Kde]]
:: [s0;0 ]
:: [s0; [0 No]]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 Kubuntu]]
:: [s0; [0 8.10]]
:: [s0; [0 32]]
:: [s0; [0 Kde]]
:: [s0; [0 4.1.2]]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Mandriva]]
:: [s0; [0 2009]]
:: [s0; [0 32]]
:: [s0; [0 Kde]]
:: [s0;0 ]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Mandriva]]
:: [s0; [0 2009]]
:: [s0; [0 32]]
:: [s0; [0 Gnome]]
:: [s0; [0 2.24]]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Opengeu]]
:: [s0; [0 8.04]]
:: [s0; [0 32]]
:: [s0; [0 Enlightenment]]
:: [s0; [0 0.16]]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 OpenSuse]]
:: [s0; [0 11]]
:: [s0; [0 32]]
:: [s0; [0 Gnome]]
:: [s0; [0 2.22]]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 OpenSuse]]
:: [s0; [0 11]]
:: [s0; [0 32]]
:: [s0; [0 Kde]]
:: [s0; [0 4.0.4]]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Slackware]]
:: [s0;0 ]
:: [s0; [0 32]]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0;0 ]
:: [s0; [0 Slax]]
:: [s0;0 ]
:: [s0; [0 32]]
:: [s0; [0 Kde]]
:: [s0; [0 3.5.9]]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ubuntu]]
:: [s0; [0 8.04]]
:: [s0; [0 32]]
:: [s0; [0 Gnome]]
:: [s0; [0 2.22]]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ubuntu]]
:: [s0; [0 8.04]]
:: [s0; [0 64]]
:: [s0; [0 Gnome]]
:: [s0; [0 2.22]]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Xubuntu]]
:: [s0; [0 8.10]]
:: [s0; [0 32]]
:: [s0; [0 Xfce]]
:: [s0;0 ]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Vista]]
:: [s0; [0 Home Premium Edition]]
:: [s0; [0 32]]
:: [s0; [0 Vista]]
:: [s0;0 ]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 XP]]
:: [s0; [0 5.1 SP3]]
:: [s0; [0 32]]
:: [s0; [0 XP]]
:: [s0;0 ]
:: [s0; [0 Yes]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]
:: [s0; [0 Ok]]}}&]
[s0; &]
[s0; It seems OS CPU speed report is not reliable in Linux as it
varies between program runs.&]
[s0; The same error has been found in system reporting programs and
desktop cpu speed icons.]