Mercurial > minori
comparison dep/animia/src/animia.cc @ 156:cdf79282d647
dep/animia: add VERY early x11 window stuff
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Wed, 15 Nov 2023 18:04:04 -0500 |
| parents | d2bbb5773616 |
| children | 80d6b28eb29f |
comparison
equal
deleted
inserted
replaced
| 155:d2bbb5773616 | 156:cdf79282d647 |
|---|---|
| 1 #include "animia.h" | |
| 2 #include "animia/fd.h" | |
| 3 #include "animia/strategies.h" | |
| 4 #include "animia/types.h" | |
| 5 #include "animia/util.h" | |
| 6 #include "animia/win.h" | |
| 7 | |
| 8 #include <set> | |
| 1 #include <string> | 9 #include <string> |
| 2 #include <vector> | 10 #include <vector> |
| 3 #include <set> | |
| 4 | |
| 5 #include "animia.h" | |
| 6 #include "animia/util.h" | |
| 7 #include "animia/strategies.h" | |
| 8 #include "animia/types.h" | |
| 9 #include "animia/fd.h" | |
| 10 #include "animia/win.h" | |
| 11 | |
| 12 #include <iostream> | |
| 13 | 11 |
| 14 namespace animia { | 12 namespace animia { |
| 15 | 13 |
| 16 namespace internal { | 14 namespace internal { |
| 17 | 15 |
| 48 } // namespace internal | 46 } // namespace internal |
| 49 | 47 |
| 50 bool GetResults(const std::vector<Player>& players, std::vector<Result>& results) { | 48 bool GetResults(const std::vector<Player>& players, std::vector<Result>& results) { |
| 51 /* Start out with file descriptors. */ | 49 /* Start out with file descriptors. */ |
| 52 auto process_proc = [&](const Process& process) -> bool { | 50 auto process_proc = [&](const Process& process) -> bool { |
| 53 std::cout << process.name << std::endl; | |
| 54 | |
| 55 for (const auto& player : players) { | 51 for (const auto& player : players) { |
| 56 if (!internal::PlayerHasStrategy(player, Strategy::OpenFiles)) | 52 if (!internal::PlayerHasStrategy(player, Strategy::OpenFiles)) |
| 57 continue; | 53 continue; |
| 58 | 54 |
| 59 if (!internal::IsExecutableInList(player, process.name)) | 55 if (!internal::IsExecutableInList(player, process.name)) |
| 91 return false; | 87 return false; |
| 92 | 88 |
| 93 return internal::ApplyStrategies(results); | 89 return internal::ApplyStrategies(results); |
| 94 } | 90 } |
| 95 | 91 |
| 96 } | 92 } // namespace animia |
