summary refs log tree commit diff stats
path: root/src/common/dbus/remote-object.xml
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2013-11-23 15:31:09 -0500
committerTingPing <tingping@tingping.se>2013-11-23 15:31:09 -0500
commitd38bbb1e2c96314dd61faa84f2908b90ae29b987 (patch)
treefcc3c1329d04849820c5a8f23dd395644cbb308d /src/common/dbus/remote-object.xml
parent5c223ec5d55d82ab8dd1fc81c7cea5caf36ade45 (diff)
update help message for /names
Diffstat (limited to 'src/common/dbus/remote-object.xml')
0 files changed, 0 insertions, 0 deletions
ef='#n105'>105
/* HexChat
 * Copyright (c) 2011-2012 Berke Viktor.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

#include <stdio.h>
#include <windows.h>
#include <wbemidl.h>

#include <glib.h>

#include "../../../src/common/sysinfo/sysinfo.h"

#include "../format.h"

static char *get_memory_info (void);

char *
sysinfo_backend_get_sound (void)
{
	return NULL;
}

char *
sysinfo_backend_get_network (void)
{
	return NULL;
}

char *
sysinfo_backend_get_uptime (void)
{
	return sysinfo_format_uptime (GetTickCount64 () / 1000);
}

char *
sysinfo_backend_get_disk (void)
{
	guint64 hdd_capacity;
	guint64 hdd_free_space;

	sysinfo_get_hdd_info (&hdd_capacity, &hdd_free_space);

	if (hdd_capacity != 0)
	{
		return sysinfo_format_disk(hdd_capacity, hdd_free_space);
	}

	return NULL;
}

char *
sysinfo_backend_get_cpu (void)
{
	return sysinfo_get_cpu ();
}

char *
sysinfo_backend_get_memory (void)
{
	/* Memory information is always loaded dynamically since it includes the current amount of free memory */
	return get_memory_info ();
}

char *
sysinfo_backend_get_gpu (void)
{
	return sysinfo_get_gpu ();
}

char *
sysinfo_backend_get_os (void)
{
	return sysinfo_get_os ();
}

static char *get_memory_info (void)
{
	MEMORYSTATUSEX meminfo = { 0 };
	meminfo.dwLength = sizeof (meminfo);

	if (!GlobalMemoryStatusEx (&meminfo))
	{
		return NULL;
	}

	return sysinfo_format_memory (meminfo.ullTotalPhys, meminfo.ullAvailPhys);
}