Mercurial > libanimone
annotate src/win.cc @ 9:fac204fb3748
dep/animone: x11: correctly check for connection failure
if there's no X server running then the previous code segfaults(!)
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Mon, 22 Apr 2024 19:11:06 -0400 |
parents | 97ea6a3e1954 |
children | 52927e5118f9 |
rev | line source |
---|---|
0 | 1 #include "animone/win.h" |
2 | |
3 #ifdef WIN32 | |
4 # include "animone/win/win32.h" | |
5 #endif | |
6 | |
7 #ifdef MACOSX | |
8 # include "animone/win/quartz.h" | |
9 #endif | |
10 | |
11 #ifdef X11 | |
12 # include "animone/win/x11.h" | |
13 #endif | |
14 | |
2
97ea6a3e1954
dep/animone: make bsd.cc and x11.cc actually work
Paper <paper@paper.us.eu.org>
parents:
0
diff
changeset
|
15 #include <iostream> |
97ea6a3e1954
dep/animone: make bsd.cc and x11.cc actually work
Paper <paper@paper.us.eu.org>
parents:
0
diff
changeset
|
16 |
0 | 17 namespace animone::internal { |
18 | |
19 bool EnumerateWindows(window_proc_t window_proc) { | |
20 bool success = false; | |
21 | |
2
97ea6a3e1954
dep/animone: make bsd.cc and x11.cc actually work
Paper <paper@paper.us.eu.org>
parents:
0
diff
changeset
|
22 std::cout << "enumerating windows" << std::endl; |
97ea6a3e1954
dep/animone: make bsd.cc and x11.cc actually work
Paper <paper@paper.us.eu.org>
parents:
0
diff
changeset
|
23 |
0 | 24 #ifdef WIN32 |
25 success |= win32::EnumerateWindows(window_proc); | |
26 #endif | |
27 | |
28 #ifdef MACOSX | |
29 success |= quartz::EnumerateWindows(window_proc); | |
30 #endif | |
31 | |
32 #ifdef X11 | |
33 success |= x11::EnumerateWindows(window_proc); | |
34 #endif | |
35 | |
36 return success; | |
37 } | |
38 | |
39 } // namespace animone::internal |