mirror of
https://github.com/debauchee/barrier.git
synced 2024-11-30 21:39:19 +03:00
d2135af0d9
CServer to the primary screen when the configuration changes so it can make necessary adjustments (the win32 primary screen must tell the hook dll about the new jump zones). changed includes of some std c++ library files to go through our own include files. these wrap the include with stuff to keep vc++ quiet when compiling at warning level 4, which is what it does now. it also works around missing <istream> and <ostream> on g++2.96. added missing std:: where necessary. g++ doesn't really support namespaces so it lets references without the namespace slip through. added workaround or fix. not sure if istringstream::str(string) should reset eofbit. it does on g++ but does not on vc++. added clear() after str() so it works either way. added low-level keyboard hook to win32. if available (it's only available on NT SP3 and up) it allows us to catch and handle alt+tab, alt+esc, ctrl+esc, and windows key hot keys. i think that leaves only ctrl+alt+del and accessibility functions uncaught on those systems.
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
#ifndef CSTRING_H
|
|
#define CSTRING_H
|
|
|
|
#include "common.h"
|
|
#include "stdpre.h"
|
|
#include <string>
|
|
#include "stdpost.h"
|
|
|
|
#if defined(_MSC_VER)
|
|
#pragma warning(push, 4)
|
|
#pragma warning(disable: 4097) // typedef-name used as synonym
|
|
#endif
|
|
|
|
#ifndef CSTRING_DEF_CTOR
|
|
#define CSTRING_ALLOC1
|
|
#define CSTRING_ALLOC2
|
|
#define CSTRING_DEF_CTOR CString() : _Myt() { }
|
|
#endif
|
|
|
|
// use to get appropriate type for string constants. it depends on
|
|
// the internal representation type of CString.
|
|
#define _CS(_x) _x
|
|
|
|
class CString : public std::string {
|
|
public:
|
|
typedef char _e;
|
|
typedef _e CharT;
|
|
typedef std::allocator<_e> _a;
|
|
typedef std::string _Myt;
|
|
typedef const_iterator _It;
|
|
|
|
// same constructors as base class
|
|
CSTRING_DEF_CTOR
|
|
CString(const _Myt& _x) : _Myt(_x) { }
|
|
CString(const _Myt& _x, size_type _p, size_type _m CSTRING_ALLOC1) :
|
|
_Myt(_x, _p, _m CSTRING_ALLOC2) { }
|
|
CString(const _e *_s, size_type _n CSTRING_ALLOC1) :
|
|
_Myt(_s, _n CSTRING_ALLOC2) { }
|
|
CString(const _e *_s CSTRING_ALLOC1) :
|
|
_Myt(_s CSTRING_ALLOC2) { }
|
|
CString(size_type _n, _e _c CSTRING_ALLOC1) :
|
|
_Myt(_n, _c CSTRING_ALLOC2) { }
|
|
CString(_It _f, _It _l CSTRING_ALLOC1) :
|
|
_Myt(_f, _l CSTRING_ALLOC2) { }
|
|
};
|
|
|
|
#if defined(_MSC_VER)
|
|
#pragma warning(pop)
|
|
#endif
|
|
|
|
#endif
|
|
|