comparison dep/animone/include/animone.h @ 342:adb79bdde329

dep/animone: fix tons of issues for example, the window ID stuff was just... completely wrong. since we're supporting multiple different window systems, it *has* to be a union rather than just a single integer type. HWND is also not a DWORD, it's a pointer(!), so now it's stored as a std::uintptr_t. (this probably breaks things)
author Paper <paper@paper.us.eu.org>
date Thu, 20 Jun 2024 03:03:05 -0400
parents a7d4e5107531
children
comparison
equal deleted inserted replaced
341:052ec053ee37 342:adb79bdde329
7 #include "animone/player.h" 7 #include "animone/player.h"
8 #include "animone/types.h" 8 #include "animone/types.h"
9 9
10 namespace animone { 10 namespace animone {
11 11
12 struct Process { 12 struct ANIMONE_API Process {
13 internal::pid_t pid = 0; /* platform-dependent PID */ 13 internal::pid_t pid = 0; /* platform-dependent PID */
14 ExecutablePlatform platform = ExecutablePlatform::Unknown; /* platform of the executable */ 14 ExecutablePlatform platform = ExecutablePlatform::Unknown; /* platform of the executable */
15 std::string comm; /* the full filename of the executable */ 15 std::string comm; /* the full filename of the executable */
16 }; 16 };
17 17
18 struct Window { 18 struct ANIMONE_API Window {
19 std::uint32_t id = 0; /* platform-dependent window id */ 19 internal::wid_t id = {0}; /* union of window IDs. depends on the platform which one is correct */
20 WindowPlatform platform = WindowPlatform::Unknown; /* platform of the window */ 20 WindowPlatform platform = WindowPlatform::Unknown; /* platform of the window */
21 std::string class_name; /* class name on win32 and x11, bundle ID on macos */ 21 std::string class_name; /* class name on win32 and x11, bundle ID on macos */
22 std::string text; /* title bar text if available */ 22 std::string text; /* title bar text if available */
23 }; 23 };
24 24
25 struct Result { 25 struct ANIMONE_API Result {
26 Player player; 26 Player player;
27 Process process; 27 Process process;
28 Window window; /* has nothing under process mode */ 28 Window window; /* has nothing under process mode */
29 std::vector<Media> media; 29 std::vector<Media> media;
30 }; 30 };
31 31
32 bool GetResults(const std::vector<Player>& players, std::vector<Result>& results); 32 ANIMONE_API bool GetResults(const std::vector<Player>& players, std::vector<Result>& results);
33 33
34 } // namespace animone 34 } // namespace animone
35 35
36 #endif // ANIMONE_ANIMONE_H_ 36 #endif // ANIMONE_ANIMONE_H_