]> Dogcows Code - chaz/openbox/blob - src/util.hh
1e17657e4cba0dd79fb15b0a5c219cfbbdeca639
[chaz/openbox] / src / util.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef _BLACKBOX_UTIL_HH
3 #define _BLACKBOX_UTIL_HH
4
5 extern "C" {
6 #include <X11/Xlib.h>
7 #include <X11/Xutil.h>
8
9 #ifdef TIME_WITH_SYS_TIME
10 # include <sys/time.h>
11 # include <time.h>
12 #else // !TIME_WITH_SYS_TIME
13 # ifdef HAVE_SYS_TIME_H
14 # include <sys/time.h>
15 # else // !HAVE_SYS_TIME_H
16 # include <time.h>
17 # endif // HAVE_SYS_TIME_H
18 #endif // TIME_WITH_SYS_TIME
19 }
20
21
22 #include <string>
23 #include <vector>
24
25 namespace ob {
26
27 struct Strut {
28 unsigned int top, bottom, left, right;
29
30 Strut(void): top(0), bottom(0), left(0), right(0) {}
31 };
32
33 /* XXX: this needs autoconf help */
34 const unsigned int BSENTINEL = 65535;
35
36 std::string expandTilde(const std::string& s);
37
38 void bexec(const std::string& command, const std::string& displaystring);
39
40 std::string textPropertyToString(Display *display, XTextProperty& text_prop);
41
42 timeval normalizeTimeval(const timeval &tm);
43
44 std::string itostring(unsigned long i);
45 std::string itostring(long i);
46 inline std::string itostring(unsigned int i)
47 { return itostring((unsigned long) i); }
48 inline std::string itostring(int i)
49 { return itostring((long) i); }
50
51 }
52
53 #ifndef HAVE_BASENAME
54 std::string basename(const std::string& path);
55 #endif
56
57 #endif
This page took 0.033394 seconds and 4 git commands to generate.