Mercurial > minori
comparison dep/animone/src/animone.cc @ 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 |
comparison
equal
deleted
inserted
replaced
336:d260549151d6 | 337:a7d4e5107531 |
---|---|
14 namespace animone { | 14 namespace animone { |
15 | 15 |
16 namespace internal { | 16 namespace internal { |
17 | 17 |
18 static bool IsExecutableInList(const Player& player, const Process& proc) { | 18 static bool IsExecutableInList(const Player& player, const Process& proc) { |
19 for (const auto& pattern : player.executables) | 19 for (const auto& [platform, comms] : player.executables) |
20 if (util::CheckPattern(pattern, proc.name)) | 20 for (const auto& comm : comms) |
21 return true; | 21 if (platform == proc.platform && util::CheckPattern(comm, proc.comm)) |
22 return true; | |
22 | 23 |
23 return false; | 24 return false; |
24 } | 25 } |
25 | 26 |
26 static bool IsWindowInList(const Player& player, const Window& window) { | 27 static bool IsWindowInList(const Player& player, const Window& window) { |
27 for (const auto& pattern : player.windows) | 28 for (const auto& [platform, class_names] : player.windows) |
28 if (util::CheckPattern(pattern, window.class_name)) | 29 for (const auto& class_name : class_names) |
29 return true; | 30 if (platform == window.platform && util::CheckPattern(class_name, window.class_name)) |
31 return true; | |
30 | 32 |
31 return false; | 33 return false; |
32 } | 34 } |
33 | 35 |
34 static bool PlayerHasStrategy(const Player& player, const Strategy& strategy) { | 36 static bool PlayerHasStrategy(const Player& player, const Strategy& strategy) { |