view dep/animone/include/animone.h @ 337:a7d4e5107531

dep/animone: REFACTOR ALL THE THINGS 1: animone now has its own syntax divergent from anisthesia, making different platforms actually have their own sections 2: process names in animone are now called `comm' (this will probably break things). this is what its called in bsd/linux so I'm just going to use it everywhere 3: the X11 code now checks for the existence of a UTF-8 window title and passes it if available 4: ANYTHING THATS NOT LINUX IS 100% UNTESTED AND CAN AND WILL BREAK! I still actually need to test the bsd code. to be honest I'm probably going to move all of the bsds into separate files because they're all essentially different operating systems at this point
author Paper <paper@paper.us.eu.org>
date Wed, 19 Jun 2024 12:51:15 -0400
parents b1f625b0227c
children adb79bdde329
line wrap: on
line source

#ifndef ANIMONE_ANIMONE_H_
#define ANIMONE_ANIMONE_H_

#include <cstdint>

#include "animone/media.h"
#include "animone/player.h"
#include "animone/types.h"

namespace animone {

struct Process {
	internal::pid_t pid = 0; /* platform-dependent PID */
	ExecutablePlatform platform = ExecutablePlatform::Unknown; /* platform of the executable */
	std::string comm; /* the full filename of the executable */
};

struct Window {
	std::uint32_t id = 0; /* platform-dependent window id */
	WindowPlatform platform = WindowPlatform::Unknown; /* platform of the window */
	std::string class_name; /* class name on win32 and x11, bundle ID on macos */
	std::string text; /* title bar text if available */
};

struct Result {
	Player player;
	Process process;
	Window window; /* has nothing under process mode */
	std::vector<Media> media;
};

bool GetResults(const std::vector<Player>& players, std::vector<Result>& results);

} // namespace animone

#endif // ANIMONE_ANIMONE_H_