<commit_before>// Copyright 2016 The go-vgo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// https://github.com/go-vgo/robotgo/blob/master/LICENSE
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// #include "../base/os.h"
#if defined(USE_X11)
	// #include <X11/Xlib.h>
	// #include <X11/Xatom.h>
	#include <X11/Xresource.h>
#endif

Bounds get_client(uintptr pid, uintptr isHwnd);

double sys_scale(int32_t display_id) {
	#if defined(IS_MACOSX)
	
		CGDirectDisplayID displayID = (CGDirectDisplayID) display_id;
		if (displayID == -1) {
			displayID = CGMainDisplayID();
		}
		CGDisplayModeRef modeRef = CGDisplayCopyDisplayMode(displayID);

		double pixelWidth = CGDisplayModeGetPixelWidth(modeRef);
		double targetWidth = CGDisplayModeGetWidth(modeRef);
		
		return pixelWidth / targetWidth;
	#elif defined(USE_X11)
		double xres;

		char *displayname = NULL;
		Display *dpy = XOpenDisplay(displayname);
		
		int scr = 0; /* Screen number */
		xres = ((((double) DisplayWidth(dpy, scr)) * 25.4) /
			((double) DisplayWidthMM(dpy, scr)));

		// https://github.com/glfw/glfw/issues/1019#issuecomment-302772498
		char *rms = XResourceManagerString(dpy);
		if (rms) {
			XrmDatabase db = XrmGetStringDatabase(rms);
			if (db) {
				XrmValue value;
				char *type = NULL;
<commit_msg>Fixed windows CI build<commit_after>// Copyright 2016 The go-vgo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// https://github.com/go-vgo/robotgo/blob/master/LICENSE
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// #include "../base/os.h"
#if defined(USE_X11)
	// #include <X11/Xlib.h>
	// #include <X11/Xatom.h>
	#include <X11/Xresource.h>
#endif

Bounds get_client(uintptr pid, uintptr isHwnd);
intptr scaleX();

double sys_scale(int32_t display_id) {
	#if defined(IS_MACOSX)
	
		CGDirectDisplayID displayID = (CGDirectDisplayID) display_id;
		if (displayID == -1) {
			displayID = CGMainDisplayID();
		}
		CGDisplayModeRef modeRef = CGDisplayCopyDisplayMode(displayID);

		double pixelWidth = CGDisplayModeGetPixelWidth(modeRef);
		double targetWidth = CGDisplayModeGetWidth(modeRef);
		
		return pixelWidth / targetWidth;
	#elif defined(USE_X11)
		char *displayname = NULL;
		Display *dpy = XOpenDisplay(displayname);
		
		int scr = 0; /* Screen number */
		double xres = ((((double) DisplayWidth(dpy, scr)) * 25.4) /
			((double) DisplayWidthMM(dpy, scr)));

		// https://github.com/glfw/glfw/issues/1019#issuecomment-302772498
		char *rms = XResourceManagerString(dpy);
		if (rms) {
			XrmDatabase db = XrmGetStringDatabase(rms);
			if (db) {
				XrmValue value;
				char *type = NULL;

{'fraction_non_alphanumeric': 0.12949640287769784, 'fraction_numerical': 0.0237722865186112, 'mean_word_length': 3.9658385093167703, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '460535', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1074, 'n_words': 276}