comparison 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
comparison
equal deleted inserted replaced
336:d260549151d6 337:a7d4e5107531
1 #ifndef ANIMONE_ANIMONE_H_ 1 #ifndef ANIMONE_ANIMONE_H_
2 #define ANIMONE_ANIMONE_H_ 2 #define ANIMONE_ANIMONE_H_
3
4 #include <cstdint>
3 5
4 #include "animone/media.h" 6 #include "animone/media.h"
5 #include "animone/player.h" 7 #include "animone/player.h"
6 #include "animone/types.h" 8 #include "animone/types.h"
7 9
8 namespace animone { 10 namespace animone {
9 11
10 enum class ResultType {
11 Process,
12 Window
13 };
14
15 struct Process { 12 struct Process {
16 internal::pid_t pid = 0; /* pid_t == DWORD on Windows, from <sys/types.h> everywhere else */ 13 internal::pid_t pid = 0; /* platform-dependent PID */
17 std::string name; 14 ExecutablePlatform platform = ExecutablePlatform::Unknown; /* platform of the executable */
15 std::string comm; /* the full filename of the executable */
18 }; 16 };
19 17
20 struct Window { 18 struct Window {
21 unsigned int id = 0; 19 std::uint32_t id = 0; /* platform-dependent window id */
22 std::string class_name; 20 WindowPlatform platform = WindowPlatform::Unknown; /* platform of the window */
23 std::string text; /* title bar text */ 21 std::string class_name; /* class name on win32 and x11, bundle ID on macos */
22 std::string text; /* title bar text if available */
24 }; 23 };
25 24
26 struct Result { 25 struct Result {
27 Player player; 26 Player player;
28 Process process; 27 Process process;