view dep/animone/src/win.cc @ 268:382b50754fe4

dep/animone: make osx code a bit less hacky it would be nice if macos actually provided a real API for getting window titles (outside of the accessibility api). the accessibility API is a real mess to work with; the user has to give permission to access it under newer versions.
author Paper <paper@paper.us.eu.org>
date Fri, 12 Apr 2024 05:21:45 -0400
parents 1a6a5d3a94cd
children 65df2813d0de
line wrap: on
line source

#include "animone/win.h"

#ifdef WIN32
#	include "animone/win/win32.h"
#endif

#ifdef MACOSX
#	include "animone/win/quartz.h"
#endif

#ifdef X11
#	include "animone/win/x11.h"
#endif

#include <iostream>

namespace animone::internal {

bool EnumerateWindows(window_proc_t window_proc) {
	bool success = false;

	std::cout << "enumerating windows" << std::endl;

#ifdef WIN32
	success |= win32::EnumerateWindows(window_proc);
#endif

#ifdef MACOSX
	success |= quartz::EnumerateWindows(window_proc);
#endif

#ifdef X11
	success |= x11::EnumerateWindows(window_proc);
#endif

	return success;
}

} // namespace animone::internal