00001 /* 00002 * Copyright (C) 2003-2009 Olivier Boudeville 00003 * 00004 * This file is part of the Ceylan library. 00005 * 00006 * The Ceylan library is free software: you can redistribute it and/or modify 00007 * it under the terms of either the GNU Lesser General Public License or 00008 * the GNU General Public License, as they are published by the Free Software 00009 * Foundation, either version 3 of these Licenses, or (at your option) 00010 * any later version. 00011 * 00012 * The Ceylan library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU Lesser General Public License and the GNU General Public License 00016 * for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License and the GNU General Public License along with the Ceylan library. 00020 * If not, see <http://www.gnu.org/licenses/>. 00021 * 00022 * Author: Olivier Boudeville (olivier.boudeville@esperide.com) 00023 * 00024 */ 00025 00026 00027 #ifndef CEYLAN_SYSTEM_INFORMATION_H_ 00028 #define CEYLAN_SYSTEM_INFORMATION_H_ 00029 00030 00031 00032 #include "CeylanSystem.h" // for SystemException, etc. 00033 #include "CeylanTypes.h" // for UnsignedLongInteger, Ceylan::Uint32, etc. 00034 00035 00036 #include <ctime> 00037 #include <string> 00038 #include <iosfwd> 00039 00040 00041 00042 /* 00043 * Some Ceylan-using libraries or programs have to know the endianess : 00044 * 00045 * @note Defined automatically (at configure-time) to 1 if the platform is 00046 * little endian, 0 otherwise (big endian). 00047 * 00048 * The real source file is CeylanSystemInformation.h.in, not 00049 * CeylanSystemInformation.h. 00050 * 00051 */ 00052 #define CEYLAN_DETECTED_LITTLE_ENDIAN 1 00053 00054 00055 00056 00057 namespace Ceylan 00058 { 00059 00060 00061 00069 namespace System 00070 { 00071 00072 00073 00082 CEYLAN_DLL UnsignedLongInteger getSecondsSinceSystemBoot() ; 00083 00084 00085 00093 CEYLAN_DLL Ceylan::Uint32 getTotalProcessCount() ; 00094 00095 00096 00104 CEYLAN_DLL UnsignedLongInteger getTotalSystemMemorySize() ; 00105 00106 00107 00118 CEYLAN_DLL UnsignedLongInteger getFreeSystemMemorySize() ; 00119 00120 00121 00132 CEYLAN_DLL UnsignedLongInteger getUsedSystemMemorySize() ; 00133 00134 00135 00143 CEYLAN_DLL UnsignedLongInteger getTotalSwapMemorySize() ; 00144 00145 00146 00155 CEYLAN_DLL UnsignedLongInteger getFreeSwapMemorySize() ; 00156 00157 00158 00166 CEYLAN_DLL UnsignedLongInteger getTotalHighMemorySize() ; 00167 00168 00169 00178 CEYLAN_DLL UnsignedLongInteger getFreeHighMemorySize() ; 00179 00180 00181 00189 CEYLAN_DLL UnsignedLongInteger getSharedMemorySize() ; 00190 00191 00192 00201 CEYLAN_DLL UnsignedLongInteger getBuffersMemorySize() ; 00202 00203 00204 00205 00206 00207 // User-data related section, notably for the Nintendo DS. 00208 00209 00210 00224 CEYLAN_DLL std::string GetUserName() ; 00225 00226 00227 00228 00233 enum BatteryStatus 00234 { 00235 00237 WellCharged, 00238 00240 AlmostEmpty, 00241 00243 BatteryStatusUnknown 00244 00245 } ; 00246 00247 00248 00261 CEYLAN_DLL BatteryStatus GetBatteryStatus() ; 00262 00263 00264 00265 00270 enum DSType 00271 { 00272 00274 DSFat, 00275 00277 DSLite, 00278 00280 DSTypeUnknown 00281 00282 } ; 00283 00284 00285 00295 CEYLAN_DLL DSType GetDSType() ; 00296 00297 00298 00299 00300 00301 // OpenGL-related section. 00302 00303 00304 00321 CEYLAN_DLL bool openGLContextsCanBeLost() ; 00322 00323 00324 00333 CEYLAN_DLL bool openGLContextsLostOnResize() ; 00334 00335 00336 00345 CEYLAN_DLL bool openGLContextsLostOnApplicationSwitch() ; 00346 00347 00348 00356 CEYLAN_DLL bool openGLContextsLostOnColorDepthChange() ; 00357 00358 00359 00360 } 00361 00362 00363 } 00364 00365 00366 00367 #endif // CEYLAN_SYSTEM_INFORMATION_H_ 00368