mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
narrowing the GDK include guard to #if defined(HAVE_GTK3), and
removing legacy HAVE_GTK2 / HAVE_GTK toolkit label branches from sysinfo_detect_toolkit(),
narrowing GDK display probing guard in sysinfo_detect_display_backend() to GTK3-only.
Updated Windows and macOS sysinfo backends to remove HAVE_GTK2 / HAVE_GTK fallback labels so sysinfo_detect_toolkit() now returns only "GTK3" (or NULL).
Updated API docs for sysinfo_backend_get_ui() to remove the outdated "GTK2 / X11" example so comments match runtime behavior.
Removed the deprecated Meson option option('gtk3', ... deprecated: true) from meson_options.txt, leaving gtk-frontend/text-frontend options intact.
Removed -Dgtk3=true from Debian’s Meson configure flags in debian/rules (override_dh_auto_configure).
Removed remaining active -Dgtk3=true packaging consumers in Flatpak config:
dropped it from config-opts
dropped -Dgtk3=true from cflags.
Removed -Dgtk3=true from Solus packaging Meson configure args.
Committed changes on the current branch (e018bfd) and created a PR record via the make_pr tool.
129 lines
2.8 KiB
C
129 lines
2.8 KiB
C
/* ZoiteChat
|
|
* 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);
|
|
}
|
|
|
|
static const char *sysinfo_detect_toolkit(void)
|
|
{
|
|
#if defined(HAVE_GTK3)
|
|
return "GTK3";
|
|
#else
|
|
return NULL;
|
|
#endif
|
|
}
|
|
|
|
char *
|
|
sysinfo_backend_get_ui (void)
|
|
{
|
|
const char *toolkit = sysinfo_detect_toolkit();
|
|
|
|
/* On Windows we don't have X11/Wayland. Keep it simple. */
|
|
if (toolkit)
|
|
{
|
|
return g_strdup_printf ("Windows / %s", toolkit);
|
|
}
|
|
|
|
return g_strdup ("Windows");
|
|
}
|