annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
1 #ifndef ANIMONE_ANIMONE_H_
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
2 #define ANIMONE_ANIMONE_H_
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
3
337
a7d4e5107531 dep/animone: REFACTOR ALL THE THINGS
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
4 #include <cstdint>
a7d4e5107531 dep/animone: REFACTOR ALL THE THINGS
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
5
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
6 #include "animone/media.h"
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
7 #include "animone/player.h"
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
8 #include "animone/types.h"
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
9
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
10 namespace animone {
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
11
342
adb79bdde329 dep/animone: fix tons of issues
Paper <paper@paper.us.eu.org>
parents: 337
diff changeset
12 struct ANIMONE_API Process {
337
a7d4e5107531 dep/animone: REFACTOR ALL THE THINGS
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
13 internal::pid_t pid = 0; /* platform-dependent PID */
a7d4e5107531 dep/animone: REFACTOR ALL THE THINGS
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
14 ExecutablePlatform platform = ExecutablePlatform::Unknown; /* platform of the executable */
a7d4e5107531 dep/animone: REFACTOR ALL THE THINGS
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
15 std::string comm; /* the full filename of the executable */
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
16 };
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
17
342
adb79bdde329 dep/animone: fix tons of issues
Paper <paper@paper.us.eu.org>
parents: 337
diff changeset
18 struct ANIMONE_API Window {
adb79bdde329 dep/animone: fix tons of issues
Paper <paper@paper.us.eu.org>
parents: 337
diff changeset
19 internal::wid_t id = {0}; /* union of window IDs. depends on the platform which one is correct */
337
a7d4e5107531 dep/animone: REFACTOR ALL THE THINGS
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
20 WindowPlatform platform = WindowPlatform::Unknown; /* platform of the window */
a7d4e5107531 dep/animone: REFACTOR ALL THE THINGS
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
21 std::string class_name; /* class name on win32 and x11, bundle ID on macos */
a7d4e5107531 dep/animone: REFACTOR ALL THE THINGS
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
22 std::string text; /* title bar text if available */
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
23 };
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
24
342
adb79bdde329 dep/animone: fix tons of issues
Paper <paper@paper.us.eu.org>
parents: 337
diff changeset
25 struct ANIMONE_API Result {
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
26 Player player;
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
27 Process process;
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
28 Window window; /* has nothing under process mode */
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
29 std::vector<Media> media;
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
30 };
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
31
342
adb79bdde329 dep/animone: fix tons of issues
Paper <paper@paper.us.eu.org>
parents: 337
diff changeset
32 ANIMONE_API bool GetResults(const std::vector<Player>& players, std::vector<Result>& results);
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
33
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
34 } // namespace animone
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
35
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
36 #endif // ANIMONE_ANIMONE_H_