aboutsummaryrefslogtreecommitdiff
path: root/src/tests/testKeys.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-02-04 23:48:31 (GMT)
committerfluxgen <fluxgen>2002-02-04 23:48:31 (GMT)
commitccb2beb0e1e078a33a8603ec591adadf78ff148a (patch)
tree7ce7268d6262feda35d4ce395656098cc784681f /src/tests/testKeys.cc
parent26754cd47722ac36380a7a2f8bd56e8a40b951ce (diff)
downloadfluxbox_pavel-ccb2beb0e1e078a33a8603ec591adadf78ff148a.zip
fluxbox_pavel-ccb2beb0e1e078a33a8603ec591adadf78ff148a.tar.bz2
initial import
Diffstat (limited to 'src/tests/testKeys.cc')
-rw-r--r--src/tests/testKeys.cc66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/tests/testKeys.cc b/src/tests/testKeys.cc
new file mode 100644
index 0000000..071eed3
--- /dev/null
+++ b/src/tests/testKeys.cc
@@ -0,0 +1,66 @@
1// testKeys.cc
2// Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen@linuxmail.org)
3//
4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"),
6// to deal in the Software without restriction, including without limitation
7// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8// and/or sell copies of the Software, and to permit persons to whom the
9// Software is furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE.
21
22#include "../Keys.hh"
23#include <iostream>
24#include <X11/Xlib.h>
25#include <uds/init.hh>
26
27#ifdef UDS
28#include <uds/uds.hh>
29// configure UDS
30uds::uds_flags_t uds::flags = uds::leak_check|uds::log_allocs;
31#endif
32
33using namespace std;
34
35void testKeys(int argc, char **argv) {
36 Display *display = XOpenDisplay(0);
37
38 if (display==0) {
39 cerr<<"Cant open display."<<endl;
40 return;
41 }
42
43 Keys *keys = new Keys(display);
44 const char default_keyfile[] = "keys";
45
46 if (argc>1) {
47 cerr<<"Loading file: "<<argv[1]<<endl;
48 keys->load(const_cast<char *>(argv[1]));
49 } else {
50 cerr<<"Using default file: "<<default_keyfile<<endl;
51 keys->load(const_cast<char *>(default_keyfile));
52 }
53
54 keys->load(const_cast<char *>(default_keyfile));
55
56 delete keys;
57
58 XCloseDisplay(display);
59}
60
61int main(int argc, char **argv) {
62 #ifdef UDS
63 uds::Init uds_init;
64 #endif
65 testKeys(argc, argv);
66}