* Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34111 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-2006, Jérôme Duval. All rights reserved.
|
* Copyright 2004-2006, Jérôme Duval. All rights reserved.
|
||||||
* Copyright 2005-2008, Axel Dörfler, [email protected].
|
* Copyright 2005-2009, Axel Dörfler, [email protected].
|
||||||
* Copyright 2008-2009, Stephan Aßmus, [email protected].
|
* Copyright 2008-2009, Stephan Aßmus, [email protected].
|
||||||
*
|
*
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
@@ -27,21 +27,21 @@
|
|||||||
|
|
||||||
|
|
||||||
#undef TRACE
|
#undef TRACE
|
||||||
|
|
||||||
//#define TRACE_KEYBOARD_DEVICE
|
//#define TRACE_KEYBOARD_DEVICE
|
||||||
#ifdef TRACE_KEYBOARD_DEVICE
|
#ifdef TRACE_KEYBOARD_DEVICE
|
||||||
|
|
||||||
class FunctionTracer {
|
class FunctionTracer {
|
||||||
public:
|
public:
|
||||||
FunctionTracer(const void* pointer, const char* className,
|
FunctionTracer(const void* pointer, const char* className,
|
||||||
const char* functionName,
|
const char* functionName)
|
||||||
int32& depth)
|
:
|
||||||
: fFunctionName(),
|
fFunctionName(),
|
||||||
fPrepend(),
|
fPrepend(),
|
||||||
fFunctionDepth(depth),
|
|
||||||
fPointer(pointer)
|
fPointer(pointer)
|
||||||
{
|
{
|
||||||
fFunctionDepth++;
|
sFunctionDepth++;
|
||||||
fPrepend.Append(' ', fFunctionDepth * 2);
|
fPrepend.Append(' ', sFunctionDepth * 2);
|
||||||
fFunctionName << className << "::" << functionName << "()";
|
fFunctionName << className << "::" << functionName << "()";
|
||||||
|
|
||||||
debug_printf("%p -> %s%s {\n", fPointer, fPrepend.String(),
|
debug_printf("%p -> %s%s {\n", fPointer, fPrepend.String(),
|
||||||
@@ -51,24 +51,26 @@
|
|||||||
~FunctionTracer()
|
~FunctionTracer()
|
||||||
{
|
{
|
||||||
debug_printf("%p -> %s}\n", fPointer, fPrepend.String());
|
debug_printf("%p -> %s}\n", fPointer, fPrepend.String());
|
||||||
fFunctionDepth--;
|
sFunctionDepth--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int32 Depth() const { return sFunctionDepth; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BString fFunctionName;
|
BString fFunctionName;
|
||||||
BString fPrepend;
|
BString fPrepend;
|
||||||
int32& fFunctionDepth;
|
|
||||||
const void* fPointer;
|
const void* fPointer;
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static int32 sFunctionDepth = -1;
|
static int32 sFunctionDepth = -1;
|
||||||
# define KD_CALLED(x...) FunctionTracer _ft(this, "KeyboardDevice", \
|
};
|
||||||
__FUNCTION__, sFunctionDepth)
|
|
||||||
# define KID_CALLED(x...) FunctionTracer _ft(this, "KeyboardInputDevice", \
|
# define KD_CALLED(x...) \
|
||||||
__FUNCTION__, sFunctionDepth)
|
FunctionTracer _ft(this, "KeyboardDevice", __FUNCTION__)
|
||||||
# define TRACE(x...) do { BString _to; \
|
# define KID_CALLED(x...) \
|
||||||
_to.Append(' ', (sFunctionDepth + 1) * 2); \
|
FunctionTracer _ft(this, "KeyboardInputDevice", __FUNCTION__)
|
||||||
|
# define TRACE(x...) \
|
||||||
|
do { BString _to; \
|
||||||
|
_to.Append(' ', (FunctionTracer::Depth() + 1) * 2); \
|
||||||
debug_printf("%p -> %s", this, _to.String()); \
|
debug_printf("%p -> %s", this, _to.String()); \
|
||||||
debug_printf(x); } while (0)
|
debug_printf(x); } while (0)
|
||||||
# define LOG_EVENT(text...) do {} while (0)
|
# define LOG_EVENT(text...) do {} while (0)
|
||||||
@@ -713,7 +715,8 @@ KeyboardDevice::_ControlThread()
|
|||||||
char* string = NULL;
|
char* string = NULL;
|
||||||
char* rawString = NULL;
|
char* rawString = NULL;
|
||||||
int32 numBytes = 0, rawNumBytes = 0;
|
int32 numBytes = 0, rawNumBytes = 0;
|
||||||
fKeymap.GetChars(keycode, fModifiers, activeDeadKey, &string, &numBytes);
|
fKeymap.GetChars(keycode, fModifiers, activeDeadKey, &string,
|
||||||
|
&numBytes);
|
||||||
fKeymap.GetChars(keycode, 0, 0, &rawString, &rawNumBytes);
|
fKeymap.GetChars(keycode, 0, 0, &rawString, &rawNumBytes);
|
||||||
|
|
||||||
BMessage* msg = new BMessage;
|
BMessage* msg = new BMessage;
|
||||||
@@ -1085,12 +1088,3 @@ KeyboardInputDevice::_RecursiveScan(const char* directory)
|
|||||||
_AddDevice(path.Path());
|
_AddDevice(path.Path());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user