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