зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-inbound and mozilla-central
This commit is contained in:
Коммит
c5e0e2137d
|
@ -136,39 +136,10 @@ NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AccEvent, Release)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// AccEvent protected methods
|
||||
|
||||
nsAccessible *
|
||||
nsAccessible*
|
||||
AccEvent::GetAccessibleForNode() const
|
||||
{
|
||||
if (!mNode)
|
||||
return nsnull;
|
||||
|
||||
nsAccessible *accessible = GetAccService()->GetAccessible(mNode);
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
// hack for xul tree table. We need a better way for firing delayed event
|
||||
// against xul tree table. see bug 386821.
|
||||
// There will be problem if some day we want to fire delayed event against
|
||||
// the xul tree itself or an unselected treeitem.
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(mNode));
|
||||
if (content && content->NodeInfo()->Equals(nsAccessibilityAtoms::tree,
|
||||
kNameSpaceID_XUL)) {
|
||||
|
||||
nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSelect =
|
||||
do_QueryInterface(mNode);
|
||||
|
||||
if (multiSelect) {
|
||||
PRInt32 treeIndex = -1;
|
||||
multiSelect->GetCurrentIndex(&treeIndex);
|
||||
if (treeIndex >= 0) {
|
||||
nsRefPtr<nsXULTreeAccessible> treeAcc = do_QueryObject(accessible);
|
||||
if (treeAcc)
|
||||
return treeAcc->GetTreeItemAccessible(treeIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return accessible;
|
||||
return mNode ? GetAccService()->GetAccessible(mNode) : nsnull;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -393,10 +393,10 @@ nsRootAccessible::FireAccessibleFocusEvent(nsAccessible* aFocusAccessible,
|
|||
|
||||
// Coalesce focus events from the same document, because DOM focus event might
|
||||
// be fired for the document node and then for the focused DOM element.
|
||||
focusDocument->FireDelayedAccessibleEvent(nsIAccessibleEvent::EVENT_FOCUS,
|
||||
focusNode,
|
||||
AccEvent::eCoalesceFromSameDocument,
|
||||
aIsFromUserInput);
|
||||
nsRefPtr<AccEvent> focusEvent =
|
||||
new AccEvent(nsIAccessibleEvent::EVENT_FOCUS, focusAccessible,
|
||||
aIsFromUserInput, AccEvent::eCoalesceFromSameDocument);
|
||||
focusDocument->FireDelayedAccessibleEvent(focusEvent);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -66,6 +66,7 @@ _TEST_FILES =\
|
|||
test_focus.html \
|
||||
test_focus.xul \
|
||||
test_focus_name.html \
|
||||
test_focus_tree.xul \
|
||||
test_focusdoc.html \
|
||||
test_menu.xul \
|
||||
test_mutation.html \
|
||||
|
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="XUL tree focus testing">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js" />
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../treeview.js" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../events.js" />
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Invokers
|
||||
|
||||
function setTreeView(aTreeID, aView)
|
||||
{
|
||||
this.DOMNode = getNode(aTreeID);
|
||||
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_REORDER, this.DOMNode)
|
||||
];
|
||||
|
||||
this.invoke = function setTreeView_invoke()
|
||||
{
|
||||
this.DOMNode.treeBoxObject.view = aView;
|
||||
}
|
||||
|
||||
this.getID = function setTreeView_getID()
|
||||
{ return "set tree view for " + prettyName(aTreeID); }
|
||||
};
|
||||
|
||||
function focusTree(aTreeID)
|
||||
{
|
||||
var checker = new invokerChecker(EVENT_FOCUS, getFirstTreeItem, aTreeID);
|
||||
this.__proto__ = new synthFocus(aTreeID, [ checker ]);
|
||||
}
|
||||
|
||||
function moveToNextItem(aTreeID)
|
||||
{
|
||||
var checker = new invokerChecker(EVENT_FOCUS, getSecondTreeItem, aTreeID);
|
||||
this.__proto__ = new synthDownKey(aTreeID, [ checker ]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Helpers
|
||||
|
||||
function getTreeItemAt(aTreeID, aIdx)
|
||||
{ return getAccessible(aTreeID).getChildAt(aIdx + 1); }
|
||||
|
||||
function getFirstTreeItem(aTreeID)
|
||||
{ return getTreeItemAt(aTreeID, 0); }
|
||||
|
||||
function getSecondTreeItem(aTreeID)
|
||||
{ return getTreeItemAt(aTreeID, 1); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Test
|
||||
|
||||
var gQueue = null;
|
||||
|
||||
//gA11yEventDumpID = "debug"; // debugging
|
||||
//gA11yEventDumpToConsole = true; // debugging
|
||||
|
||||
function doTest()
|
||||
{
|
||||
gQueue = new eventQueue();
|
||||
|
||||
gQueue.push(new setTreeView("tree", new nsTableTreeView(5)));
|
||||
gQueue.push(new focusTree("tree"));
|
||||
gQueue.push(new moveToNextItem("tree"));
|
||||
|
||||
gQueue.invoke();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<hbox flex="1" style="overflow: auto;">
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=386821"
|
||||
title="Need better solution for firing delayed event against xul tree">
|
||||
Mozilla Bug 386821
|
||||
</a><br/>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
<vbox id="debug"/>
|
||||
<tree id="tree" flex="1">
|
||||
<treecols>
|
||||
<treecol id="col1" flex="1" primary="true" label="column"/>
|
||||
<treecol id="col2" flex="1" label="column 2"/>
|
||||
</treecols>
|
||||
<treechildren id="treechildren"/>
|
||||
</tree>
|
||||
</hbox>
|
||||
|
||||
</window>
|
||||
|
|
@ -5194,7 +5194,7 @@ incorrect])
|
|||
fi
|
||||
|
||||
MOZ_ENABLE_QTMOBILITY=
|
||||
PKG_CHECK_MODULES(_QTMOBILITY, QtSensors,
|
||||
PKG_CHECK_MODULES(_QTMOBILITY, QtSensors QtFeedback,
|
||||
MOZ_ENABLE_QTMOBILITY=1,
|
||||
MOZ_ENABLE_QTMOBILITY=)
|
||||
if test "$MOZ_ENABLE_QTMOBILITY"; then
|
||||
|
@ -5202,11 +5202,12 @@ incorrect])
|
|||
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QTMOBILITY_CFLAGS"
|
||||
MOZ_QT_LIBS="$MOZ_QT_LIBS $_QTMOBILITY_LIBS"
|
||||
else
|
||||
AC_CHECK_LIB(QtSensors, main, [
|
||||
AC_CHECK_LIB(QtSensors QtFeedback, main, [
|
||||
MOZ_ENABLE_QTMOBILITY=1
|
||||
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I/usr/include/qt4/QtMobility"
|
||||
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I/usr/include/qt4/QtSensors"
|
||||
MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtSensors"
|
||||
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I/usr/include/qt4/QtFeedback"
|
||||
MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtSensors -lQtFeedback"
|
||||
])
|
||||
fi
|
||||
if test "$MOZ_ENABLE_QTMOBILITY"; then
|
||||
|
|
|
@ -112,6 +112,8 @@ child:
|
|||
nsString aDisplayName,
|
||||
nsString aIconPath);
|
||||
|
||||
async SetParentHangTimeout(uint32_t seconds);
|
||||
|
||||
parent:
|
||||
/**
|
||||
* This message is only used on X11 platforms.
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#endif
|
||||
|
||||
#include "mozilla/plugins/PluginModuleChild.h"
|
||||
#include "mozilla/ipc/SyncChannel.h"
|
||||
|
||||
#ifdef MOZ_WIDGET_GTK2
|
||||
#include <gtk/gtk.h>
|
||||
|
@ -513,6 +514,24 @@ PluginModuleChild::ExitedCxxStack()
|
|||
|
||||
#endif
|
||||
|
||||
bool
|
||||
PluginModuleChild::RecvSetParentHangTimeout(const uint32_t& aSeconds)
|
||||
{
|
||||
#ifdef XP_WIN
|
||||
SetReplyTimeoutMs(((aSeconds > 0) ? (1000 * aSeconds) : 0));
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
PluginModuleChild::ShouldContinueFromReplyTimeout()
|
||||
{
|
||||
#ifdef XP_WIN
|
||||
NS_RUNTIMEABORT("terminating child process");
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
PluginModuleChild::InitGraphics()
|
||||
{
|
||||
|
|
|
@ -111,6 +111,9 @@ protected:
|
|||
return MediateRace(parent, child);
|
||||
}
|
||||
|
||||
NS_OVERRIDE
|
||||
virtual bool ShouldContinueFromReplyTimeout();
|
||||
|
||||
// Implement the PPluginModuleChild interface
|
||||
virtual bool AnswerNP_GetEntryPoints(NPError* rv);
|
||||
virtual bool AnswerNP_Initialize(NativeThreadId* tid, NPError* rv);
|
||||
|
@ -168,6 +171,9 @@ protected:
|
|||
const nsString& aDisplayName,
|
||||
const nsString& aIconPath);
|
||||
|
||||
virtual bool
|
||||
RecvSetParentHangTimeout(const uint32_t& aSeconds);
|
||||
|
||||
virtual void
|
||||
ActorDestroy(ActorDestroyReason why);
|
||||
|
||||
|
|
|
@ -79,7 +79,8 @@ using namespace mozilla;
|
|||
using namespace mozilla::plugins;
|
||||
using namespace mozilla::plugins::parent;
|
||||
|
||||
static const char kTimeoutPref[] = "dom.ipc.plugins.timeoutSecs";
|
||||
static const char kChildTimeoutPref[] = "dom.ipc.plugins.timeoutSecs";
|
||||
static const char kParentTimeoutPref[] = "dom.ipc.plugins.parentTimeoutSecs";
|
||||
static const char kLaunchTimeoutPref[] = "dom.ipc.plugins.processLaunchTimeoutSecs";
|
||||
|
||||
template<>
|
||||
|
@ -109,7 +110,7 @@ PluginModuleParent::LoadModule(const char* aFilePath)
|
|||
parent->Open(parent->mSubprocess->GetChannel(),
|
||||
parent->mSubprocess->GetChildProcessHandle());
|
||||
|
||||
TimeoutChanged(kTimeoutPref, parent);
|
||||
TimeoutChanged(kChildTimeoutPref, parent);
|
||||
return parent.forget();
|
||||
}
|
||||
|
||||
|
@ -131,7 +132,8 @@ PluginModuleParent::PluginModuleParent(const char* aFilePath)
|
|||
NS_ERROR("Out of memory");
|
||||
}
|
||||
|
||||
Preferences::RegisterCallback(TimeoutChanged, kTimeoutPref, this);
|
||||
Preferences::RegisterCallback(TimeoutChanged, kChildTimeoutPref, this);
|
||||
Preferences::RegisterCallback(TimeoutChanged, kParentTimeoutPref, this);
|
||||
}
|
||||
|
||||
PluginModuleParent::~PluginModuleParent()
|
||||
|
@ -156,7 +158,8 @@ PluginModuleParent::~PluginModuleParent()
|
|||
mSubprocess = nsnull;
|
||||
}
|
||||
|
||||
Preferences::UnregisterCallback(TimeoutChanged, kTimeoutPref, this);
|
||||
Preferences::UnregisterCallback(TimeoutChanged, kChildTimeoutPref, this);
|
||||
Preferences::UnregisterCallback(TimeoutChanged, kParentTimeoutPref, this);
|
||||
}
|
||||
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
|
@ -226,14 +229,17 @@ int
|
|||
PluginModuleParent::TimeoutChanged(const char* aPref, void* aModule)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thead!");
|
||||
NS_ABORT_IF_FALSE(!strcmp(aPref, kTimeoutPref),
|
||||
"unexpected pref callback");
|
||||
|
||||
PRInt32 timeoutSecs = Preferences::GetInt(kTimeoutPref, 0);
|
||||
int32 timeoutMs = (timeoutSecs > 0) ? (1000 * timeoutSecs) :
|
||||
SyncChannel::kNoTimeout;
|
||||
|
||||
static_cast<PluginModuleParent*>(aModule)->SetReplyTimeoutMs(timeoutMs);
|
||||
if (!strcmp(aPref, kChildTimeoutPref)) {
|
||||
// The timeout value used by the parent for children
|
||||
PRInt32 timeoutSecs = Preferences::GetInt(kChildTimeoutPref, 0);
|
||||
int32 timeoutMs = (timeoutSecs > 0) ? (1000 * timeoutSecs) :
|
||||
SyncChannel::kNoTimeout;
|
||||
static_cast<PluginModuleParent*>(aModule)->SetReplyTimeoutMs(timeoutMs);
|
||||
} else if (!strcmp(aPref, kParentTimeoutPref)) {
|
||||
// The timeout value used by the child for its parent
|
||||
PRInt32 timeoutSecs = Preferences::GetInt(kParentTimeoutPref, 0);
|
||||
static_cast<PluginModuleParent*>(aModule)->SendSetParentHangTimeout(timeoutSecs);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -921,6 +927,8 @@ PluginModuleParent::NPP_New(NPMIMEType pluginType, NPP instance,
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
TimeoutChanged(kParentTimeoutPref, this);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,10 @@ ifdef MOZ_PLATFORM_MAEMO
|
|||
CPPSRCS += nsHapticFeedback.cpp
|
||||
LOCAL_INCLUDES += $(MOZ_DBUS_CFLAGS) \
|
||||
$(NULL)
|
||||
ifdef MOZ_ENABLE_QTMOBILITY
|
||||
LOCAL_INCLUDES += $(MOZ_QT_CFLAGS) \
|
||||
$(NULL)
|
||||
endif
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -35,11 +35,16 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsHapticFeedback.h"
|
||||
#if (MOZ_PLATFORM_MAEMO == 5)
|
||||
#include <dbus/dbus.h>
|
||||
#include <mce/dbus-names.h>
|
||||
#endif
|
||||
#if defined(MOZ_ENABLE_QTMOBILITY)
|
||||
#include <QFeedbackEffect>
|
||||
using namespace QtMobility;
|
||||
#endif
|
||||
|
||||
#include "nsHapticFeedback.h"
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsHapticFeedback, nsIHapticFeedback)
|
||||
|
||||
|
@ -84,6 +89,12 @@ nsHapticFeedback::PerformSimpleAction(PRInt32 aType)
|
|||
dbus_message_unref(msg);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#elif defined(MOZ_ENABLE_QTMOBILITY)
|
||||
if (aType == ShortPress)
|
||||
QFeedbackEffect::playThemeEffect(QFeedbackEffect::ThemeBasicButton);
|
||||
if (aType == LongPress)
|
||||
QFeedbackEffect::playThemeEffect(QFeedbackEffect::ThemeLongPress);
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -275,10 +275,10 @@ void ARMAssembler::dataTransferN(bool isLoad, bool isSigned, int size, RegisterI
|
|||
{
|
||||
bool posOffset = true;
|
||||
|
||||
// there may be more elegant ways of handling this, but this one works.
|
||||
// There may be more elegant ways of handling this, but this one works.
|
||||
if (offset == 0x80000000) {
|
||||
// for even bigger offsets, load the entire offset into a register, then do an
|
||||
// indexed load using the base register and the index register
|
||||
// For even bigger offsets, load the entire offset into a register, then do an
|
||||
// indexed load using the base register and the index register.
|
||||
moveImm(offset, ARMRegisters::S0);
|
||||
mem_reg_off(isLoad, isSigned, size, posOffset, rt, base, ARMRegisters::S0);
|
||||
return;
|
||||
|
@ -291,18 +291,18 @@ void ARMAssembler::dataTransferN(bool isLoad, bool isSigned, int size, RegisterI
|
|||
// LDR rd, [rb, #+offset]
|
||||
mem_imm_off(isLoad, isSigned, size, posOffset, rt, base, offset);
|
||||
} else if (offset <= 0xfffff) {
|
||||
// add upper bits of offset to the base, and store the result into the temp registe
|
||||
// Add upper bits of offset to the base, and store the result into the temp register.
|
||||
if (posOffset) {
|
||||
add_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | (10 << 8));
|
||||
add_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | getOp2RotLSL(12));
|
||||
} else {
|
||||
sub_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | (10 << 8));
|
||||
sub_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | getOp2RotLSL(12));
|
||||
}
|
||||
// load using the lower bits of the offset
|
||||
// Load using the lower bits of the offset.
|
||||
mem_imm_off(isLoad, isSigned, size, posOffset, rt,
|
||||
ARMRegisters::S0, (offset & 0xfff));
|
||||
} else {
|
||||
// for even bigger offsets, load the entire offset into a register, then do an
|
||||
// indexed load using the base register and the index register
|
||||
// For even bigger offsets, load the entire offset into a register, then do an
|
||||
// indexed load using the base register and the index register.
|
||||
moveImm(offset, ARMRegisters::S0);
|
||||
mem_reg_off(isLoad, isSigned, size, posOffset, rt, base, ARMRegisters::S0);
|
||||
}
|
||||
|
@ -315,23 +315,23 @@ void ARMAssembler::dataTransfer32(bool isLoad, RegisterID srcDst, RegisterID bas
|
|||
// LDR rd, [rb, +offset]
|
||||
dtr_u(isLoad, srcDst, base, offset);
|
||||
else if (offset <= 0xfffff) {
|
||||
// add upper bits of offset to the base, and store the result into the temp registe
|
||||
add_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | (10 << 8));
|
||||
// load using the lower bits of the register
|
||||
// Add upper bits of offset to the base, and store the result into the temp register.
|
||||
add_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | getOp2RotLSL(12));
|
||||
// Load using the lower bits of the register.
|
||||
dtr_u(isLoad, srcDst, ARMRegisters::S0, (offset & 0xfff));
|
||||
} else {
|
||||
// for even bigger offsets, load the entire offset into a registe, then do an
|
||||
// indexed load using the base register and the index register
|
||||
// For even bigger offsets, load the entire offset into a register, then do an
|
||||
// indexed load using the base register and the index register.
|
||||
moveImm(offset, ARMRegisters::S0);
|
||||
dtr_ur(isLoad, srcDst, base, ARMRegisters::S0);
|
||||
}
|
||||
} else {
|
||||
// negative offsets
|
||||
// Negative offsets.
|
||||
offset = -offset;
|
||||
if (offset <= 0xfff)
|
||||
dtr_d(isLoad, srcDst, base, offset);
|
||||
else if (offset <= 0xfffff) {
|
||||
sub_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | (10 << 8));
|
||||
sub_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | getOp2RotLSL(12));
|
||||
dtr_d(isLoad, srcDst, ARMRegisters::S0, (offset & 0xfff));
|
||||
} else {
|
||||
moveImm(offset, ARMRegisters::S0);
|
||||
|
@ -349,7 +349,7 @@ void ARMAssembler::dataTransfer8(bool isLoad, RegisterID srcDst, RegisterID base
|
|||
else
|
||||
dtrb_u(isLoad, srcDst, base, offset);
|
||||
} else if (offset <= 0xfffff) {
|
||||
add_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | (10 << 8));
|
||||
add_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | getOp2RotLSL(12));
|
||||
if (isSigned)
|
||||
mem_imm_off(isLoad, true, 8, true, srcDst, ARMRegisters::S0, (offset & 0xfff));
|
||||
else
|
||||
|
@ -370,7 +370,7 @@ void ARMAssembler::dataTransfer8(bool isLoad, RegisterID srcDst, RegisterID base
|
|||
dtrb_d(isLoad, srcDst, base, offset);
|
||||
}
|
||||
else if (offset <= 0xfffff) {
|
||||
sub_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | (10 << 8));
|
||||
sub_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 12) | getOp2RotLSL(12));
|
||||
if (isSigned)
|
||||
mem_imm_off(isLoad, true, 8, false, srcDst, ARMRegisters::S0, (offset & 0xfff));
|
||||
else
|
||||
|
@ -435,75 +435,75 @@ void ARMAssembler::baseIndexTransferN(bool isLoad, bool isSigned, int size, Regi
|
|||
|
||||
void ARMAssembler::doubleTransfer(bool isLoad, FPRegisterID srcDst, RegisterID base, int32_t offset)
|
||||
{
|
||||
if (offset & 0x3) {
|
||||
if (offset <= 0x3ff && offset >= 0) {
|
||||
fdtr_u(isLoad, srcDst, base, offset >> 2);
|
||||
return;
|
||||
}
|
||||
if (offset <= 0x3ffff && offset >= 0) {
|
||||
add_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 10) | (11 << 8));
|
||||
fdtr_u(isLoad, srcDst, ARMRegisters::S0, (offset >> 2) & 0xff);
|
||||
return;
|
||||
}
|
||||
offset = -offset;
|
||||
|
||||
if (offset <= 0x3ff && offset >= 0) {
|
||||
fdtr_d(isLoad, srcDst, base, offset >> 2);
|
||||
return;
|
||||
}
|
||||
if (offset <= 0x3ffff && offset >= 0) {
|
||||
sub_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 10) | (11 << 8));
|
||||
fdtr_d(isLoad, srcDst, ARMRegisters::S0, (offset >> 2) & 0xff);
|
||||
return;
|
||||
}
|
||||
offset = -offset;
|
||||
}
|
||||
|
||||
// TODO: This is broken in the case that offset is unaligned. VFP can never
|
||||
// perform unaligned accesses, even from an unaligned register base. (NEON
|
||||
// can, but VFP isn't NEON. It is not advisable to interleave a NEON load
|
||||
// with VFP code, so the best solution here is probably to perform an
|
||||
// unaligned integer load, then move the result into VFP using VMOV.)
|
||||
// VFP cannot directly access memory that is not four-byte-aligned, so
|
||||
// special-case support will be required for such cases. However, we don't
|
||||
// currently use any unaligned floating-point memory accesses and probably
|
||||
// never will, so for now just assert that the offset is aligned.
|
||||
//
|
||||
// Note that we cannot assert that the base register is aligned, but in
|
||||
// that case, an alignment fault will be raised at run-time.
|
||||
ASSERT((offset & 0x3) == 0);
|
||||
|
||||
// Try to use a single load/store instruction, or at least a simple address
|
||||
// calculation.
|
||||
if (offset >= 0) {
|
||||
if (offset <= 0x3ff) {
|
||||
fmem_imm_off(isLoad, true, true, srcDst, base, offset >> 2);
|
||||
return;
|
||||
}
|
||||
if (offset <= 0x3ffff) {
|
||||
add_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 10) | getOp2RotLSL(10));
|
||||
fmem_imm_off(isLoad, true, true, srcDst, ARMRegisters::S0, (offset >> 2) & 0xff);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (offset >= -0x3ff) {
|
||||
fmem_imm_off(isLoad, true, false, srcDst, base, -offset >> 2);
|
||||
return;
|
||||
}
|
||||
if (offset >= -0x3ffff) {
|
||||
sub_r(ARMRegisters::S0, base, OP2_IMM | (-offset >> 10) | getOp2RotLSL(10));
|
||||
fmem_imm_off(isLoad, true, false, srcDst, ARMRegisters::S0, (-offset >> 2) & 0xff);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Slow case for long-range accesses.
|
||||
ldr_un_imm(ARMRegisters::S0, offset);
|
||||
add_r(ARMRegisters::S0, ARMRegisters::S0, base);
|
||||
fdtr_u(isLoad, srcDst, ARMRegisters::S0, 0);
|
||||
fmem_imm_off(isLoad, true, true, srcDst, ARMRegisters::S0, 0);
|
||||
}
|
||||
|
||||
void ARMAssembler::floatTransfer(bool isLoad, FPRegisterID srcDst, RegisterID base, int32_t offset)
|
||||
{
|
||||
if (offset & 0x3) {
|
||||
if (offset <= 0x3ff && offset >= 0) {
|
||||
// Assert that the access is aligned, as in doubleTransfer.
|
||||
ASSERT((offset & 0x3) == 0);
|
||||
|
||||
// Try to use a single load/store instruction, or at least a simple address
|
||||
// calculation.
|
||||
if (offset >= 0) {
|
||||
if (offset <= 0x3ff) {
|
||||
fmem_imm_off(isLoad, false, true, srcDst, base, offset >> 2);
|
||||
return;
|
||||
}
|
||||
if (offset <= 0x3ffff && offset >= 0) {
|
||||
add_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 10) | (11 << 8));
|
||||
if (offset <= 0x3ffff) {
|
||||
add_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 10) | getOp2RotLSL(10));
|
||||
fmem_imm_off(isLoad, false, true, srcDst, ARMRegisters::S0, (offset >> 2) & 0xff);
|
||||
return;
|
||||
}
|
||||
offset = -offset;
|
||||
|
||||
if (offset <= 0x3ff && offset >= 0) {
|
||||
fmem_imm_off(isLoad, false, false, srcDst, base, offset >> 2);
|
||||
} else {
|
||||
if (offset >= -0x3ff) {
|
||||
fmem_imm_off(isLoad, false, false, srcDst, base, -offset >> 2);
|
||||
return;
|
||||
}
|
||||
if (offset <= 0x3ffff && offset >= 0) {
|
||||
sub_r(ARMRegisters::S0, base, OP2_IMM | (offset >> 10) | (11 << 8));
|
||||
fmem_imm_off(isLoad, false, true, srcDst, ARMRegisters::S0, (offset >> 2) & 0xff);
|
||||
if (offset >= -0x3ffff) {
|
||||
sub_r(ARMRegisters::S0, base, OP2_IMM | (-offset >> 10) | getOp2RotLSL(10));
|
||||
fmem_imm_off(isLoad, false, false, srcDst, ARMRegisters::S0, (-offset >> 2) & 0xff);
|
||||
return;
|
||||
}
|
||||
offset = -offset;
|
||||
}
|
||||
|
||||
// TODO: This is broken in the case that offset is unaligned. VFP can never
|
||||
// perform unaligned accesses, even from an unaligned register base. (NEON
|
||||
// can, but VFP isn't NEON. It is not advisable to interleave a NEON load
|
||||
// with VFP code, so the best solution here is probably to perform an
|
||||
// unaligned integer load, then move the result into VFP using VMOV.)
|
||||
ASSERT((offset & 0x3) == 0);
|
||||
|
||||
// Slow case for long-range accesses.
|
||||
ldr_un_imm(ARMRegisters::S0, offset);
|
||||
add_r(ARMRegisters::S0, ARMRegisters::S0, base);
|
||||
fmem_imm_off(isLoad, false, true, srcDst, ARMRegisters::S0, 0);
|
||||
|
|
|
@ -319,6 +319,19 @@ namespace JSC {
|
|||
m_buffer.putInt(op | RN(rn) | RD(rd) | op2);
|
||||
}
|
||||
|
||||
// Work out the pre-shifted constant necessary to encode the specified
|
||||
// logical shift left for op2 immediates. Only even shifts can be
|
||||
// applied.
|
||||
//
|
||||
// Input validity is asserted in debug builds.
|
||||
ARMWord getOp2RotLSL(int lsl)
|
||||
{
|
||||
ASSERT((lsl >= 0) && (lsl <= 24));
|
||||
ASSERT(!(lsl % 2));
|
||||
|
||||
return (-(lsl/2) & 0xf) << 8;
|
||||
}
|
||||
|
||||
void and_r(int rd, int rn, ARMWord op2, Condition cc = AL)
|
||||
{
|
||||
spewInsWithOp2("and", cc, rd, rn, op2);
|
||||
|
@ -1654,24 +1667,6 @@ namespace JSC {
|
|||
emitInst(static_cast<ARMWord>(cc) | FSQRTD, dd, 0, dm);
|
||||
}
|
||||
|
||||
void fdtr_u(bool isLoad, int dd, int rn, ARMWord offset, Condition cc = AL)
|
||||
{
|
||||
char const * ins = isLoad ? "vldr.f64" : "vstr.f64";
|
||||
js::JaegerSpew(js::JSpew_Insns,
|
||||
IPFX "%-15s %s, [%s, #+%u]\n", MAYBE_PAD, ins, nameFpRegD(dd), nameGpReg(rn), offset);
|
||||
ASSERT(offset <= 0xff);
|
||||
emitInst(static_cast<ARMWord>(cc) | FDTR | DT_UP | (isLoad ? DT_LOAD : 0), dd, rn, offset);
|
||||
}
|
||||
|
||||
void fdtr_d(bool isLoad, int dd, int rn, ARMWord offset, Condition cc = AL)
|
||||
{
|
||||
char const * ins = isLoad ? "vldr.f64" : "vstr.f64";
|
||||
js::JaegerSpew(js::JSpew_Insns,
|
||||
IPFX "%-15s %s, [%s, #-%u]\n", MAYBE_PAD, ins, nameFpRegD(dd), nameGpReg(rn), offset);
|
||||
ASSERT(offset <= 0xff);
|
||||
emitInst(static_cast<ARMWord>(cc) | FDTR | (isLoad ? DT_LOAD : 0), dd, rn, offset);
|
||||
}
|
||||
|
||||
void fmsr_r(int dd, int rn, Condition cc = AL)
|
||||
{
|
||||
// TODO: emitInst doesn't work for VFP instructions, though it
|
||||
|
|
|
@ -1137,7 +1137,7 @@ public:
|
|||
DataLabelPtr loadDouble(const void* address, FPRegisterID dest)
|
||||
{
|
||||
DataLabelPtr label = moveWithPatch(ImmPtr(address), ARMRegisters::S0);
|
||||
m_assembler.fdtr_u(true, dest, ARMRegisters::S0, 0);
|
||||
m_assembler.doubleTransfer(true, dest, ARMRegisters::S0, 0);
|
||||
return label;
|
||||
}
|
||||
|
||||
|
|
|
@ -1227,7 +1227,7 @@ JS_ClearContextDebugHooks(JSContext *cx)
|
|||
static char gLastError[2000];
|
||||
|
||||
static void
|
||||
#ifdef _GNU_SOURCE
|
||||
#ifdef __GNUC__
|
||||
__attribute__((unused,format(printf,1,2)))
|
||||
#endif
|
||||
UnsafeError(const char *format, ...)
|
||||
|
|
|
@ -163,6 +163,9 @@ pref("alerts.slideIncrementTime", 10);
|
|||
pref("alerts.totalOpenTime", 6000);
|
||||
pref("alerts.height", 50);
|
||||
|
||||
/* download helper */
|
||||
pref("browser.helperApps.deleteTempFileOnExit", false);
|
||||
|
||||
/* password manager */
|
||||
pref("signon.rememberSignons", true);
|
||||
pref("signon.expireMasterPassword", false);
|
||||
|
|
|
@ -91,6 +91,7 @@ var ViewConfig = {
|
|||
switch (aType) {
|
||||
case Ci.nsIPrefBranch.PREF_INT:
|
||||
setting.setAttribute("type", "integer");
|
||||
setting.setAttribute("min", -Infinity);
|
||||
break;
|
||||
case Ci.nsIPrefBranch.PREF_BOOL:
|
||||
setting.setAttribute("type", "bool");
|
||||
|
@ -158,6 +159,7 @@ var ViewConfig = {
|
|||
case Ci.nsIPrefBranch.PREF_INT:
|
||||
setting.setAttribute("type", "integer");
|
||||
setting.setAttribute("increment", this.getIncrementForValue(pref.value));
|
||||
setting.setAttribute("min", -Infinity);
|
||||
shouldFocus = true;
|
||||
break;
|
||||
|
||||
|
|
|
@ -1453,6 +1453,10 @@ pref("dom.max_script_run_time", 10);
|
|||
// How long a plugin is allowed to process a synchronous IPC message
|
||||
// before we consider it "hung".
|
||||
pref("dom.ipc.plugins.timeoutSecs", 45);
|
||||
// How long a plugin process will wait for a response from the parent
|
||||
// to a synchronous request before terminating itself. After this
|
||||
// point the child assumes the parent is hung.
|
||||
pref("dom.ipc.plugins.parentTimeoutSecs", 15);
|
||||
// How long a plugin launch is allowed to take before
|
||||
// we consider it failed.
|
||||
pref("dom.ipc.plugins.processLaunchTimeoutSecs", 45);
|
||||
|
@ -1460,6 +1464,7 @@ pref("dom.ipc.plugins.processLaunchTimeoutSecs", 45);
|
|||
// No timeout in DEBUG builds
|
||||
pref("dom.ipc.plugins.timeoutSecs", 0);
|
||||
pref("dom.ipc.plugins.processLaunchTimeoutSecs", 0);
|
||||
pref("dom.ipc.plugins.parentTimeoutSecs", 0);
|
||||
#endif
|
||||
|
||||
// Disable oopp for standard java. They run their own process isolation (which
|
||||
|
|
|
@ -677,9 +677,6 @@ nsSocketTransportService::DoPollIteration(PRBool wait)
|
|||
|
||||
//
|
||||
// poll loop
|
||||
//
|
||||
PRBool pollError = PR_FALSE;
|
||||
|
||||
//
|
||||
// walk active list backwards to see if any sockets should actually be
|
||||
// idle, then walk the idle list backwards to see if any idle sockets
|
||||
|
@ -728,7 +725,6 @@ nsSocketTransportService::DoPollIteration(PRBool wait)
|
|||
PRInt32 n = Poll(wait, &pollInterval);
|
||||
if (n < 0) {
|
||||
SOCKET_LOG((" PR_Poll error [%d]\n", PR_GetError()));
|
||||
pollError = PR_TRUE;
|
||||
}
|
||||
else {
|
||||
//
|
||||
|
|
|
@ -3092,9 +3092,22 @@ nsWindow::SetInputMode(const IMEContext& aContext)
|
|||
NS_ENSURE_TRUE(mWidget, NS_ERROR_FAILURE);
|
||||
|
||||
mIMEContext = aContext;
|
||||
|
||||
// Ensure that opening the virtual keyboard is allowed for this specific
|
||||
// IMEContext depending on the content.ime.strict.policy pref
|
||||
if (aContext.mStatus != nsIWidget::IME_STATUS_DISABLED &&
|
||||
aContext.mStatus != nsIWidget::IME_STATUS_PLUGIN) {
|
||||
if (Preferences::GetBool("content.ime.strict_policy", PR_FALSE) &&
|
||||
!aContext.FocusMovedByUser() &&
|
||||
aContext.FocusMovedInContentProcess()) {
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
switch (aContext.mStatus) {
|
||||
case nsIWidget::IME_STATUS_ENABLED:
|
||||
case nsIWidget::IME_STATUS_PASSWORD:
|
||||
case nsIWidget::IME_STATUS_PLUGIN:
|
||||
{
|
||||
PRInt32 openDelay =
|
||||
Preferences::GetInt("ui.vkb.open.delay", 200);
|
||||
|
|
|
@ -70,6 +70,9 @@
|
|||
#include "nsNetUtil.h"
|
||||
#include "nsEscape.h"
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
PRLogModuleInfo* gWin32ClipboardLog = nsnull;
|
||||
#endif
|
||||
|
||||
// oddly, this isn't in the MSVC headers anywhere.
|
||||
UINT nsClipboard::CF_HTML = ::RegisterClipboardFormatW(L"HTML Format");
|
||||
|
@ -82,6 +85,12 @@ UINT nsClipboard::CF_HTML = ::RegisterClipboardFormatW(L"HTML Format");
|
|||
//-------------------------------------------------------------------------
|
||||
nsClipboard::nsClipboard() : nsBaseClipboard()
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
if (!gWin32ClipboardLog) {
|
||||
gWin32ClipboardLog = PR_NewLogModule("nsClipboard");
|
||||
}
|
||||
#endif
|
||||
|
||||
mIgnoreEmptyNotification = PR_FALSE;
|
||||
mWindow = nsnull;
|
||||
}
|
||||
|
@ -341,39 +350,40 @@ static void DisplayErrCode(HRESULT hres)
|
|||
{
|
||||
#if defined(DEBUG_rods) || defined(DEBUG_pinkerton)
|
||||
if (hres == E_INVALIDARG) {
|
||||
printf("E_INVALIDARG\n");
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("E_INVALIDARG\n"));
|
||||
} else
|
||||
if (hres == E_UNEXPECTED) {
|
||||
printf("E_UNEXPECTED\n");
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("E_UNEXPECTED\n"));
|
||||
} else
|
||||
if (hres == E_OUTOFMEMORY) {
|
||||
printf("E_OUTOFMEMORY\n");
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("E_OUTOFMEMORY\n"));
|
||||
} else
|
||||
if (hres == DV_E_LINDEX ) {
|
||||
printf("DV_E_LINDEX\n");
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("DV_E_LINDEX\n"));
|
||||
} else
|
||||
if (hres == DV_E_FORMATETC) {
|
||||
printf("DV_E_FORMATETC\n");
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("DV_E_FORMATETC\n"));
|
||||
} else
|
||||
if (hres == DV_E_TYMED) {
|
||||
printf("DV_E_TYMED\n");
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("DV_E_TYMED\n"));
|
||||
} else
|
||||
if (hres == DV_E_DVASPECT) {
|
||||
printf("DV_E_DVASPECT\n");
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("DV_E_DVASPECT\n"));
|
||||
} else
|
||||
if (hres == OLE_E_NOTRUNNING) {
|
||||
printf("OLE_E_NOTRUNNING\n");
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("OLE_E_NOTRUNNING\n"));
|
||||
} else
|
||||
if (hres == STG_E_MEDIUMFULL) {
|
||||
printf("STG_E_MEDIUMFULL\n");
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("STG_E_MEDIUMFULL\n"));
|
||||
} else
|
||||
if (hres == DV_E_CLIPFORMAT) {
|
||||
printf("DV_E_CLIPFORMAT\n");
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("DV_E_CLIPFORMAT\n"));
|
||||
} else
|
||||
if (hres == S_OK) {
|
||||
printf("S_OK\n");
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS, ("S_OK\n"));
|
||||
} else {
|
||||
printf("****** DisplayErrCode 0x%X\n", hres);
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS,
|
||||
("****** DisplayErrCode 0x%X\n", hres));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -540,7 +550,8 @@ nsresult nsClipboard::GetNativeDataOffClipboard(IDataObject * aDataObject, UINT
|
|||
case TYMED_GDI:
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("*********************** TYMED_GDI\n");
|
||||
PR_LOG(gWin32ClipboardLog, PR_LOG_ALWAYS,
|
||||
("*********************** TYMED_GDI\n"));
|
||||
#endif
|
||||
} break;
|
||||
|
||||
|
|
|
@ -569,7 +569,8 @@ STDMETHODIMP nsDataObj::GetData(LPFORMATETC aFormat, LPSTGMEDIUM pSTM)
|
|||
return GetFileContents ( *aFormat, *pSTM );
|
||||
if ( format == PreferredDropEffect )
|
||||
return GetPreferredDropEffect( *aFormat, *pSTM );
|
||||
//printf("***** nsDataObj::GetData - Unknown format %u\n", format);
|
||||
//PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
// ("***** nsDataObj::GetData - Unknown format %u\n", format));
|
||||
return GetText(df, *aFormat, *pSTM);
|
||||
} //switch
|
||||
} // if
|
||||
|
|
|
@ -72,6 +72,10 @@
|
|||
#include "nsUXThemeData.h"
|
||||
#include "nsUXThemeConstants.h"
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gWindowsLog;
|
||||
#endif
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsNativeThemeWin, nsNativeTheme, nsITheme)
|
||||
|
||||
static inline PRBool IsHTMLContent(nsIFrame *frame)
|
||||
|
@ -1285,10 +1289,13 @@ RENDER_AGAIN:
|
|||
|
||||
#if 0
|
||||
{
|
||||
fprintf (stderr, "xform: %f %f %f %f [%f %f]\n", m.xx, m.yx, m.xy, m.yy, m.x0, m.y0);
|
||||
fprintf (stderr, "tr: [%d %d %d %d]\ndr: [%d %d %d %d]\noff: [%f %f]\n",
|
||||
tr.x, tr.y, tr.width, tr.height, dr.x, dr.y, dr.width, dr.height,
|
||||
offset.x, offset.y);
|
||||
PR_LOG(gWindowsLog, PR_LOG_ERROR,
|
||||
(stderr, "xform: %f %f %f %f [%f %f]\n", m.xx, m.yx, m.xy, m.yy,
|
||||
m.x0, m.y0));
|
||||
PR_LOG(gWindowsLog, PR_LOG_ERROR,
|
||||
(stderr, "tr: [%d %d %d %d]\ndr: [%d %d %d %d]\noff: [%f %f]\n",
|
||||
tr.x, tr.y, tr.width, tr.height, dr.x, dr.y, dr.width, dr.height,
|
||||
offset.x, offset.y));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -51,8 +51,17 @@
|
|||
#include "nsNetUtil.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#include "prlog.h"
|
||||
#include "prtime.h"
|
||||
#include "prprf.h"
|
||||
#include "prmem.h"
|
||||
|
||||
#include "nsNativeCharsetUtils.h"
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
PRLogModuleInfo* gWin32SoundLog = nsnull;
|
||||
#endif
|
||||
|
||||
class nsSoundPlayer: public nsRunnable {
|
||||
public:
|
||||
nsSoundPlayer(nsISound *aSound, const wchar_t* aSoundName) :
|
||||
|
@ -126,7 +135,13 @@ NS_IMPL_ISUPPORTS2(nsSound, nsISound, nsIStreamLoaderObserver)
|
|||
|
||||
nsSound::nsSound()
|
||||
{
|
||||
mLastSound = nsnull;
|
||||
#ifdef PR_LOGGING
|
||||
if (!gWin32SoundLog) {
|
||||
gWin32SoundLog = PR_NewLogModule("nsSound");
|
||||
}
|
||||
#endif
|
||||
|
||||
mLastSound = nsnull;
|
||||
}
|
||||
|
||||
nsSound::~nsSound()
|
||||
|
@ -177,7 +192,8 @@ NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader,
|
|||
if (uri) {
|
||||
nsCAutoString uriSpec;
|
||||
uri->GetSpec(uriSpec);
|
||||
printf("Failed to load %s\n", uriSpec.get());
|
||||
PR_LOG(gWin32SoundLog, PR_LOG_ALWAYS,
|
||||
("Failed to load %s\n", uriSpec.get()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +225,8 @@ NS_IMETHODIMP nsSound::Play(nsIURL *aURL)
|
|||
#ifdef DEBUG_SOUND
|
||||
char *url;
|
||||
aURL->GetSpec(&url);
|
||||
printf("%s\n", url);
|
||||
PR_LOG(gWin32SoundLog, PR_LOG_ALWAYS,
|
||||
("%s\n", url));
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIStreamLoader> loader;
|
||||
|
|
|
@ -53,6 +53,10 @@ using namespace mozilla;
|
|||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gWindowsLog;
|
||||
#endif
|
||||
|
||||
const PRUnichar nsWinGesture::kGestureLibraryName[] = L"user32.dll";
|
||||
HMODULE nsWinGesture::sLibraryHandle = nsnull;
|
||||
nsWinGesture::GetGestureInfoPtr nsWinGesture::getGestureInfo = nsnull;
|
||||
|
@ -474,8 +478,9 @@ nsWinGesture::ProcessPanMessage(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||
#ifdef DBG_jimm
|
||||
PRInt32 deltaX = mPanIntermediate.x - coord.x;
|
||||
PRInt32 deltaY = mPanIntermediate.y - coord.y;
|
||||
printf("coordX=%d coordY=%d deltaX=%d deltaY=%d x:%d y:%d\n", coord.x,
|
||||
coord.y, deltaX, deltaY, mXAxisFeedback, mYAxisFeedback);
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("coordX=%d coordY=%d deltaX=%d deltaY=%d x:%d y:%d\n", coord.x,
|
||||
coord.y, deltaX, deltaY, mXAxisFeedback, mYAxisFeedback));
|
||||
#endif
|
||||
|
||||
mPixelScrollDelta.x = mPanIntermediate.x - coord.x;
|
||||
|
|
|
@ -358,8 +358,9 @@ static const PRInt32 kGlassMarginAdjustment = 2;
|
|||
nsWindow::nsWindow() : nsBaseWidget()
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
if (!gWindowsLog)
|
||||
gWindowsLog = PR_NewLogModule("nsWindowsWidgets");
|
||||
if (!gWindowsLog) {
|
||||
gWindowsLog = PR_NewLogModule("nsWindow");
|
||||
}
|
||||
#endif
|
||||
|
||||
mWnd = nsnull;
|
||||
|
@ -1387,8 +1388,10 @@ NS_METHOD nsWindow::Move(PRInt32 aX, PRInt32 aY)
|
|||
RECT workArea;
|
||||
::SystemParametersInfo(SPI_GETWORKAREA, 0, &workArea, 0);
|
||||
// no annoying assertions. just mention the issue.
|
||||
if (aX < 0 || aX >= workArea.right || aY < 0 || aY >= workArea.bottom)
|
||||
printf("window moved to offscreen position\n");
|
||||
if (aX < 0 || aX >= workArea.right || aY < 0 || aY >= workArea.bottom) {
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("window moved to offscreen position\n"));
|
||||
}
|
||||
}
|
||||
::ReleaseDC(mWnd, dc);
|
||||
}
|
||||
|
@ -1788,10 +1791,13 @@ NS_METHOD nsWindow::SetFocus(PRBool aRaise)
|
|||
{
|
||||
if (mWnd) {
|
||||
#ifdef WINSTATE_DEBUG_OUTPUT
|
||||
if (mWnd == GetTopLevelHWND(mWnd))
|
||||
printf("*** SetFocus: [ top] raise=%d\n", aRaise);
|
||||
else
|
||||
printf("*** SetFocus: [child] raise=%d\n", aRaise);
|
||||
if (mWnd == GetTopLevelHWND(mWnd)) {
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("*** SetFocus: [ top] raise=%d\n", aRaise));
|
||||
} else {
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("*** SetFocus: [child] raise=%d\n", aRaise));
|
||||
}
|
||||
#endif
|
||||
// Uniconify, if necessary
|
||||
HWND toplevelWnd = GetTopLevelHWND(mWnd);
|
||||
|
@ -2882,7 +2888,9 @@ NS_METHOD nsWindow::SetIcon(const nsAString& aIconSpec)
|
|||
#ifdef DEBUG_SetIcon
|
||||
else {
|
||||
NS_LossyConvertUTF16toASCII cPath(iconPath);
|
||||
printf( "\nIcon load error; icon=%s, rc=0x%08X\n\n", cPath.get(), ::GetLastError() );
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("\nIcon load error; icon=%s, rc=0x%08X\n\n",
|
||||
cPath.get(), ::GetLastError()));
|
||||
}
|
||||
#endif
|
||||
if (smallIcon) {
|
||||
|
@ -2893,7 +2901,9 @@ NS_METHOD nsWindow::SetIcon(const nsAString& aIconSpec)
|
|||
#ifdef DEBUG_SetIcon
|
||||
else {
|
||||
NS_LossyConvertUTF16toASCII cPath(iconPath);
|
||||
printf( "\nSmall icon load error; icon=%s, rc=0x%08X\n\n", cPath.get(), ::GetLastError() );
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("\nSmall icon load error; icon=%s, rc=0x%08X\n\n",
|
||||
cPath.get(), ::GetLastError()));
|
||||
}
|
||||
#endif
|
||||
return NS_OK;
|
||||
|
@ -3594,21 +3604,27 @@ PRBool nsWindow::DispatchKeyEvent(PRUint32 aEventType, WORD aCharCode,
|
|||
|
||||
#ifdef KE_DEBUG
|
||||
static cnt=0;
|
||||
printf("%d DispatchKE Type: %s charCode %d keyCode %d ", cnt++,
|
||||
(NS_KEY_PRESS == aEventType) ? "PRESS" : (aEventType == NS_KEY_UP ? "Up" : "Down"),
|
||||
event.charCode, event.keyCode);
|
||||
printf("Shift: %s Control %s Alt: %s \n",
|
||||
(mIsShiftDown ? "D" : "U"), (mIsControlDown ? "D" : "U"), (mIsAltDown ? "D" : "U"));
|
||||
printf("[%c][%c][%c] <== [%c][%c][%c][ space bar ][%c][%c][%c]\n",
|
||||
IS_VK_DOWN(NS_VK_SHIFT) ? 'S' : ' ',
|
||||
IS_VK_DOWN(NS_VK_CONTROL) ? 'C' : ' ',
|
||||
IS_VK_DOWN(NS_VK_ALT) ? 'A' : ' ',
|
||||
IS_VK_DOWN(VK_LSHIFT) ? 'S' : ' ',
|
||||
IS_VK_DOWN(VK_LCONTROL) ? 'C' : ' ',
|
||||
IS_VK_DOWN(VK_LMENU) ? 'A' : ' ',
|
||||
IS_VK_DOWN(VK_RMENU) ? 'A' : ' ',
|
||||
IS_VK_DOWN(VK_RCONTROL) ? 'C' : ' ',
|
||||
IS_VK_DOWN(VK_RSHIFT) ? 'S' : ' ');
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("%d DispatchKE Type: %s charCode %d keyCode %d ", cnt++,
|
||||
NS_KEY_PRESS == aEventType ? "PRESS :
|
||||
(aEventType == NS_KEY_UP ? "Up" : "Down"),
|
||||
event.charCode, event.keyCode));
|
||||
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("Shift: %s Control %s Alt: %s \n", (mIsShiftDown ? "D" : "U"),
|
||||
(mIsControlDown ? "D" : "U"), (mIsAltDown ? "D" : "U")));
|
||||
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("[%c][%c][%c] <== [%c][%c][%c][ space bar ][%c][%c][%c]\n",
|
||||
IS_VK_DOWN(NS_VK_SHIFT) ? 'S' : ' ',
|
||||
IS_VK_DOWN(NS_VK_CONTROL) ? 'C' : ' ',
|
||||
IS_VK_DOWN(NS_VK_ALT) ? 'A' : ' ',
|
||||
IS_VK_DOWN(VK_LSHIFT) ? 'S' : ' ',
|
||||
IS_VK_DOWN(VK_LCONTROL) ? 'C' : ' ',
|
||||
IS_VK_DOWN(VK_LMENU) ? 'A' : ' ',
|
||||
IS_VK_DOWN(VK_RMENU) ? 'A' : ' ',
|
||||
IS_VK_DOWN(VK_RCONTROL) ? 'C' : ' ',
|
||||
IS_VK_DOWN(VK_RSHIFT) ? 'S' : ' '));
|
||||
#endif
|
||||
|
||||
event.isShift = aModKeyState.mIsShiftDown;
|
||||
|
@ -3886,7 +3902,8 @@ PRBool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam,
|
|||
event.clickCount = sLastClickCount;
|
||||
|
||||
#ifdef NS_DEBUG_XX
|
||||
printf("Msg Time: %d Click Count: %d\n", curMsgTime, event.clickCount);
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("Msg Time: %d Click Count: %d\n", curMsgTime, event.clickCount));
|
||||
#endif
|
||||
|
||||
NPEvent pluginEvent;
|
||||
|
@ -5691,8 +5708,8 @@ LRESULT nsWindow::ProcessCharMessage(const MSG &aMsg, PRBool *aEventDispatched)
|
|||
"message is not keydown event");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("%s charCode=%d scanCode=%d\n",
|
||||
aMsg.message == WM_SYSCHAR ? "WM_SYSCHAR" : "WM_CHAR",
|
||||
aMsg.wParam, HIWORD(aMsg.lParam) & 0xFF));
|
||||
aMsg.message == WM_SYSCHAR ? "WM_SYSCHAR" : "WM_CHAR",
|
||||
aMsg.wParam, HIWORD(aMsg.lParam) & 0xFF));
|
||||
|
||||
// These must be checked here too as a lone WM_CHAR could be received
|
||||
// if a child window didn't handle it (for example Alt+Space in a content window)
|
||||
|
@ -5706,7 +5723,7 @@ LRESULT nsWindow::ProcessKeyUpMessage(const MSG &aMsg, PRBool *aEventDispatched)
|
|||
"message is not keydown event");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("%s VK=%d\n", aMsg.message == WM_SYSKEYDOWN ?
|
||||
"WM_SYSKEYUP" : "WM_KEYUP", aMsg.wParam));
|
||||
"WM_SYSKEYUP" : "WM_KEYUP", aMsg.wParam));
|
||||
|
||||
nsModifierKeyState modKeyState;
|
||||
|
||||
|
@ -5742,7 +5759,7 @@ LRESULT nsWindow::ProcessKeyDownMessage(const MSG &aMsg,
|
|||
{
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("%s VK=%d\n", aMsg.message == WM_SYSKEYDOWN ?
|
||||
"WM_SYSKEYDOWN" : "WM_KEYDOWN", aMsg.wParam));
|
||||
"WM_SYSKEYDOWN" : "WM_KEYDOWN", aMsg.wParam));
|
||||
NS_PRECONDITION(aMsg.message == WM_KEYDOWN || aMsg.message == WM_SYSKEYDOWN,
|
||||
"message is not keydown event");
|
||||
|
||||
|
@ -5901,7 +5918,7 @@ nsWindow::SynthesizeNativeMouseEvent(nsIntPoint aPoint,
|
|||
BOOL nsWindow::OnInputLangChange(HKL aHKL)
|
||||
{
|
||||
#ifdef KE_DEBUG
|
||||
printf("OnInputLanguageChange\n");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("OnInputLanguageChange\n"));
|
||||
#endif
|
||||
gKbdLayout.LoadLayout(aHKL);
|
||||
return PR_FALSE; // always pass to child window
|
||||
|
@ -5913,24 +5930,31 @@ void nsWindow::OnWindowPosChanged(WINDOWPOS *wp, PRBool& result)
|
|||
return;
|
||||
|
||||
#ifdef WINSTATE_DEBUG_OUTPUT
|
||||
if (mWnd == GetTopLevelHWND(mWnd))
|
||||
printf("*** OnWindowPosChanged: [ top] ");
|
||||
else
|
||||
printf("*** OnWindowPosChanged: [child] ");
|
||||
printf("WINDOWPOS flags:");
|
||||
if (wp->flags & SWP_FRAMECHANGED)
|
||||
printf("SWP_FRAMECHANGED ");
|
||||
if (wp->flags & SWP_SHOWWINDOW)
|
||||
printf("SWP_SHOWWINDOW ");
|
||||
if (wp->flags & SWP_NOSIZE)
|
||||
printf("SWP_NOSIZE ");
|
||||
if (wp->flags & SWP_HIDEWINDOW)
|
||||
printf("SWP_HIDEWINDOW ");
|
||||
if (wp->flags & SWP_NOZORDER)
|
||||
printf("SWP_NOZORDER ");
|
||||
if (wp->flags & SWP_NOACTIVATE)
|
||||
printf("SWP_NOACTIVATE ");
|
||||
printf("\n");
|
||||
if (mWnd == GetTopLevelHWND(mWnd)) {
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** OnWindowPosChanged: [ top] "));
|
||||
} else {
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** OnWindowPosChanged: [child] "));
|
||||
}
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("WINDOWPOS flags:"));
|
||||
if (wp->flags & SWP_FRAMECHANGED) {
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("SWP_FRAMECHANGED "));
|
||||
}
|
||||
if (wp->flags & SWP_SHOWWINDOW) {
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("SWP_SHOWWINDOW "));
|
||||
}
|
||||
if (wp->flags & SWP_NOSIZE) {
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("SWP_NOSIZE "));
|
||||
}
|
||||
if (wp->flags & SWP_HIDEWINDOW) {
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("SWP_HIDEWINDOW "));
|
||||
}
|
||||
if (wp->flags & SWP_NOZORDER) {
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("SWP_NOZORDER "));
|
||||
}
|
||||
if (wp->flags & SWP_NOACTIVATE) {
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("SWP_NOACTIVATE "));
|
||||
}
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("\n"));
|
||||
#endif
|
||||
|
||||
// Handle window size mode changes
|
||||
|
@ -5978,16 +6002,19 @@ void nsWindow::OnWindowPosChanged(WINDOWPOS *wp, PRBool& result)
|
|||
#ifdef WINSTATE_DEBUG_OUTPUT
|
||||
switch (mSizeMode) {
|
||||
case nsSizeMode_Normal:
|
||||
printf("*** mSizeMode: nsSizeMode_Normal\n");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("*** mSizeMode: nsSizeMode_Normal\n"));
|
||||
break;
|
||||
case nsSizeMode_Minimized:
|
||||
printf("*** mSizeMode: nsSizeMode_Minimized\n");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("*** mSizeMode: nsSizeMode_Minimized\n"));
|
||||
break;
|
||||
case nsSizeMode_Maximized:
|
||||
printf("*** mSizeMode: nsSizeMode_Maximized\n");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("*** mSizeMode: nsSizeMode_Maximized\n");
|
||||
break;
|
||||
default:
|
||||
printf("*** mSizeMode: ??????\n");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** mSizeMode: ??????\n");
|
||||
break;
|
||||
};
|
||||
#endif
|
||||
|
@ -6058,7 +6085,9 @@ void nsWindow::OnWindowPosChanged(WINDOWPOS *wp, PRBool& result)
|
|||
mLastSize.height = newHeight;
|
||||
|
||||
#ifdef WINSTATE_DEBUG_OUTPUT
|
||||
printf("*** Resize window: %d x %d x %d x %d\n", wp->x, wp->y, newWidth, newHeight);
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("*** Resize window: %d x %d x %d x %d\n", wp->x, wp->y,
|
||||
newWidth, newHeight));
|
||||
#endif
|
||||
|
||||
// If a maximized window is resized, recalculate the non-client margins and
|
||||
|
@ -6669,7 +6698,7 @@ LRESULT nsWindow::OnKeyDown(const MSG &aMsg,
|
|||
virtualKeyCode : MapFromNativeToDOM(virtualKeyCode);
|
||||
|
||||
#ifdef DEBUG
|
||||
//printf("In OnKeyDown virt: %d\n", DOMKeyCode);
|
||||
//PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("In OnKeyDown virt: %d\n", DOMKeyCode));
|
||||
#endif
|
||||
|
||||
static PRBool sRedirectedKeyDownEventPreventedDefault = PR_FALSE;
|
||||
|
@ -6774,7 +6803,8 @@ LRESULT nsWindow::OnKeyDown(const MSG &aMsg,
|
|||
while (gotMsg && (msg.message == WM_CHAR || msg.message == WM_SYSCHAR))
|
||||
{
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("%s charCode=%d scanCode=%d\n", msg.message == WM_SYSCHAR ? "WM_SYSCHAR" : "WM_CHAR",
|
||||
("%s charCode=%d scanCode=%d\n", msg.message == WM_SYSCHAR ?
|
||||
"WM_SYSCHAR" : "WM_CHAR",
|
||||
msg.wParam, HIWORD(msg.lParam) & 0xFF));
|
||||
RemoveMessageAndDispatchPluginEvent(WM_KEYFIRST, WM_KEYLAST);
|
||||
anyCharMessagesRemoved = PR_TRUE;
|
||||
|
@ -7407,9 +7437,10 @@ PRBool nsWindow::OnResize(nsIntRect &aWindowRect)
|
|||
}
|
||||
|
||||
#if 0
|
||||
printf("[%X] OnResize: client:(%d x %d x %d x %d) window:(%d x %d)\n", this,
|
||||
aWindowRect.x, aWindowRect.y, aWindowRect.width, aWindowRect.height,
|
||||
event.mWinWidth, event.mWinHeight);
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("[%X] OnResize: client:(%d x %d x %d x %d) window:(%d x %d)\n", this,
|
||||
aWindowRect.x, aWindowRect.y, aWindowRect.width, aWindowRect.height,
|
||||
event.mWinWidth, event.mWinHeight));
|
||||
#endif
|
||||
|
||||
return DispatchWindowEvent(&event);
|
||||
|
@ -7918,7 +7949,7 @@ nsWindow::HasBogusPopupsDropShadowOnMultiMonitor() {
|
|||
NS_IMETHODIMP nsWindow::ResetInputState()
|
||||
{
|
||||
#ifdef DEBUG_KBSTATE
|
||||
printf("ResetInputState\n");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("ResetInputState\n"));
|
||||
#endif
|
||||
|
||||
#ifdef NS_ENABLE_TSF
|
||||
|
@ -7932,7 +7963,8 @@ NS_IMETHODIMP nsWindow::ResetInputState()
|
|||
NS_IMETHODIMP nsWindow::SetIMEOpenState(PRBool aState)
|
||||
{
|
||||
#ifdef DEBUG_KBSTATE
|
||||
printf("SetIMEOpenState %s\n", (aState ? "Open" : "Close"));
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("SetIMEOpenState %s\n", (aState ? "Open" : "Close")));
|
||||
#endif
|
||||
|
||||
#ifdef NS_ENABLE_TSF
|
||||
|
@ -7969,9 +8001,10 @@ NS_IMETHODIMP nsWindow::SetInputMode(const IMEContext& aContext)
|
|||
nsTextStore::SetInputMode(aContext);
|
||||
#endif //NS_ENABLE_TSF
|
||||
#ifdef DEBUG_KBSTATE
|
||||
printf("SetInputMode: %s\n", (status == nsIWidget::IME_STATUS_ENABLED ||
|
||||
status == nsIWidget::IME_STATUS_PLUGIN) ?
|
||||
"Enabled" : "Disabled");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("SetInputMode: %s\n", (status == nsIWidget::IME_STATUS_ENABLED ||
|
||||
status == nsIWidget::IME_STATUS_PLUGIN) ?
|
||||
"Enabled" : "Disabled"));
|
||||
#endif
|
||||
if (nsIMM32Handler::IsComposing()) {
|
||||
ResetInputState();
|
||||
|
@ -7987,7 +8020,8 @@ NS_IMETHODIMP nsWindow::SetInputMode(const IMEContext& aContext)
|
|||
NS_IMETHODIMP nsWindow::GetInputMode(IMEContext& aContext)
|
||||
{
|
||||
#ifdef DEBUG_KBSTATE
|
||||
printf("GetInputMode: %s\n", mIMEContext.mStatus ? "Enabled" : "Disabled");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("GetInputMode: %s\n", mIMEContext.mStatus ? "Enabled" : "Disabled");
|
||||
#endif
|
||||
aContext = mIMEContext;
|
||||
return NS_OK;
|
||||
|
@ -7996,7 +8030,7 @@ NS_IMETHODIMP nsWindow::GetInputMode(IMEContext& aContext)
|
|||
NS_IMETHODIMP nsWindow::CancelIMEComposition()
|
||||
{
|
||||
#ifdef DEBUG_KBSTATE
|
||||
printf("CancelIMEComposition\n");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("CancelIMEComposition\n"));
|
||||
#endif
|
||||
|
||||
#ifdef NS_ENABLE_TSF
|
||||
|
@ -8011,7 +8045,7 @@ NS_IMETHODIMP
|
|||
nsWindow::GetToggledKeyState(PRUint32 aKeyCode, PRBool* aLEDState)
|
||||
{
|
||||
#ifdef DEBUG_KBSTATE
|
||||
printf("GetToggledKeyState\n");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("GetToggledKeyState\n"));
|
||||
#endif
|
||||
NS_ENSURE_ARG_POINTER(aLEDState);
|
||||
*aLEDState = (::GetKeyState(aKeyCode) & 1) != 0;
|
||||
|
@ -8085,33 +8119,37 @@ PRBool nsWindow::AssociateDefaultIMC(PRBool aAssociate)
|
|||
#define NS_LOG_WMGETOBJECT_WNDACC(aWnd) \
|
||||
nsAccessible* acc = aWnd ? \
|
||||
aWnd->DispatchAccessibleEvent(NS_GETACCESSIBLE) : nsnull; \
|
||||
printf(" acc: %p", acc); \
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, (" acc: %p", acc)); \
|
||||
if (acc) { \
|
||||
nsAutoString name; \
|
||||
acc->GetName(name); \
|
||||
printf(", accname: %s", NS_ConvertUTF16toUTF8(name).get()); \
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, \
|
||||
(", accname: %s", NS_ConvertUTF16toUTF8(name).get())); \
|
||||
nsCOMPtr<nsIAccessibleDocument> doc = do_QueryObject(acc); \
|
||||
void *hwnd = nsnull; \
|
||||
doc->GetWindowHandle(&hwnd); \
|
||||
printf(", acc hwnd: %d", hwnd); \
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, (", acc hwnd: %d", hwnd)); \
|
||||
}
|
||||
|
||||
#define NS_LOG_WMGETOBJECT_THISWND \
|
||||
{ \
|
||||
printf("\n*******Get Doc Accessible*******\nOrig Window: "); \
|
||||
printf("\n {\n HWND: %d, parent HWND: %d, wndobj: %p,\n", \
|
||||
mWnd, ::GetParent(mWnd), this); \
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, \
|
||||
("\n*******Get Doc Accessible*******\nOrig Window: ")); \
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, \
|
||||
("\n {\n HWND: %d, parent HWND: %d, wndobj: %p,\n", \
|
||||
mWnd, ::GetParent(mWnd), this)); \
|
||||
NS_LOG_WMGETOBJECT_WNDACC(this) \
|
||||
printf("\n }\n"); \
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("\n }\n")); \
|
||||
}
|
||||
|
||||
#define NS_LOG_WMGETOBJECT_WND(aMsg, aHwnd) \
|
||||
{ \
|
||||
nsWindow* wnd = GetNSWindowPtr(aHwnd); \
|
||||
printf("Get " aMsg ":\n {\n HWND: %d, parent HWND: %d, wndobj: %p,\n", \
|
||||
aHwnd, ::GetParent(aHwnd), wnd); \
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, \
|
||||
("Get " aMsg ":\n {\n HWND: %d, parent HWND: %d, wndobj: %p,\n", \
|
||||
aHwnd, ::GetParent(aHwnd), wnd)); \
|
||||
NS_LOG_WMGETOBJECT_WNDACC(wnd); \
|
||||
printf("\n }\n"); \
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("\n }\n")); \
|
||||
}
|
||||
#else
|
||||
#define NS_LOG_WMGETOBJECT_THISWND
|
||||
|
@ -8362,11 +8400,15 @@ LRESULT CALLBACK nsWindow::MozSpecialMsgFilter(int code, WPARAM wParam, LPARAM l
|
|||
if (code != gLastMsgCode) {
|
||||
if (gMSGFEvents[inx].mId == code) {
|
||||
#ifdef DEBUG
|
||||
printf("MozSpecialMessageProc - code: 0x%X - %s hw: %p\n", code, gMSGFEvents[inx].mStr, pMsg->hwnd);
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("MozSpecialMessageProc - code: 0x%X - %s hw: %p\n",
|
||||
code, gMSGFEvents[inx].mStr, pMsg->hwnd));
|
||||
#endif
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
printf("MozSpecialMessageProc - code: 0x%X - %d hw: %p\n", code, gMSGFEvents[inx].mId, pMsg->hwnd);
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("MozSpecialMessageProc - code: 0x%X - %d hw: %p\n",
|
||||
code, gMSGFEvents[inx].mId, pMsg->hwnd));
|
||||
#endif
|
||||
}
|
||||
gLastMsgCode = code;
|
||||
|
@ -8451,7 +8493,8 @@ void nsWindow::RegisterSpecialDropdownHooks()
|
|||
sMsgFilterHook = SetWindowsHookEx(WH_MSGFILTER, MozSpecialMsgFilter, NULL, GetCurrentThreadId());
|
||||
#ifdef POPUP_ROLLUP_DEBUG_OUTPUT
|
||||
if (!sMsgFilterHook) {
|
||||
printf("***** SetWindowsHookEx is NOT installed for WH_MSGFILTER!\n");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("***** SetWindowsHookEx is NOT installed for WH_MSGFILTER!\n"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -8462,7 +8505,8 @@ void nsWindow::RegisterSpecialDropdownHooks()
|
|||
sCallProcHook = SetWindowsHookEx(WH_CALLWNDPROC, MozSpecialWndProc, NULL, GetCurrentThreadId());
|
||||
#ifdef POPUP_ROLLUP_DEBUG_OUTPUT
|
||||
if (!sCallProcHook) {
|
||||
printf("***** SetWindowsHookEx is NOT installed for WH_CALLWNDPROC!\n");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("***** SetWindowsHookEx is NOT installed for WH_CALLWNDPROC!\n"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -8473,7 +8517,8 @@ void nsWindow::RegisterSpecialDropdownHooks()
|
|||
sCallMouseHook = SetWindowsHookEx(WH_MOUSE, MozSpecialMouseProc, NULL, GetCurrentThreadId());
|
||||
#ifdef POPUP_ROLLUP_DEBUG_OUTPUT
|
||||
if (!sCallMouseHook) {
|
||||
printf("***** SetWindowsHookEx is NOT installed for WH_MOUSE!\n");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("***** SetWindowsHookEx is NOT installed for WH_MOUSE!\n"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -42,7 +42,11 @@
|
|||
|
||||
#include "nsWindowDbg.h"
|
||||
|
||||
#if defined(POPUP_ROLLUP_DEBUG_OUTPUT) || defined(EVENT_DEBUG_OUTPUT)
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gWindowsLog;
|
||||
#endif
|
||||
|
||||
#if defined(POPUP_ROLLUP_DEBUG_OUTPUT) || defined(EVENT_DEBUG_OUTPUT) || 1
|
||||
|
||||
typedef struct {
|
||||
char * mStr;
|
||||
|
@ -409,7 +413,9 @@ void PrintEvent(UINT msg, PRBool aShowAllEvents, PRBool aShowMouseMoves)
|
|||
}
|
||||
if (aShowAllEvents || (!aShowAllEvents && gLastEventMsg != (long)msg)) {
|
||||
if (aShowMouseMoves || (!aShowMouseMoves && msg != 0x0020 && msg != 0x0200 && msg != 0x0084)) {
|
||||
printf("%6d - 0x%04X %s\n", gEventCounter++, msg, gAllEvents[inx].mStr ? gAllEvents[inx].mStr : "Unknown");
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
|
||||
("%6d - 0x%04X %s\n", gEventCounter++, msg,
|
||||
gAllEvents[inx].mStr ? gAllEvents[inx].mStr : "Unknown"));
|
||||
gLastEventMsg = msg;
|
||||
}
|
||||
}
|
||||
|
@ -421,7 +427,8 @@ void PrintEvent(UINT msg, PRBool aShowAllEvents, PRBool aShowMouseMoves)
|
|||
void DDError(const char *msg, HRESULT hr)
|
||||
{
|
||||
/*XXX make nicer */
|
||||
fprintf(stderr, "direct draw error %s: 0x%08lx\n", msg, hr);
|
||||
PR_LOG(gWindowsLog, PR_LOG_ERROR,
|
||||
("direct draw error %s: 0x%08lx\n", msg, hr));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -430,7 +437,7 @@ PRBool is_vk_down(int vk)
|
|||
{
|
||||
SHORT st = GetKeyState(vk);
|
||||
#ifdef DEBUG
|
||||
printf("is_vk_down vk=%x st=%x\n",vk, st);
|
||||
PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("is_vk_down vk=%x st=%x\n",vk, st));
|
||||
#endif
|
||||
return (st < 0);
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
#define SHOW_MOUSEMOVE_EVENTS PR_FALSE
|
||||
#endif // defined(EVENT_DEBUG_OUTPUT)
|
||||
|
||||
#if defined(POPUP_ROLLUP_DEBUG_OUTPUT) || defined(EVENT_DEBUG_OUTPUT)
|
||||
#if defined(POPUP_ROLLUP_DEBUG_OUTPUT) || defined(EVENT_DEBUG_OUTPUT) || 1
|
||||
void PrintEvent(UINT msg, PRBool aShowAllEvents, PRBool aShowMouseMoves);
|
||||
#endif // defined(POPUP_ROLLUP_DEBUG_OUTPUT) || defined(EVENT_DEBUG_OUTPUT)
|
||||
|
||||
|
@ -77,7 +77,7 @@ typedef struct {
|
|||
int mId;
|
||||
} MSGFEventMsgInfo;
|
||||
|
||||
#define DISPLAY_NMM_PRT(_arg) printf((_arg));
|
||||
#define DISPLAY_NMM_PRT(_arg) PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ((_arg)));
|
||||
#else
|
||||
#define DISPLAY_NMM_PRT(_arg)
|
||||
#endif // defined(POPUP_ROLLUP_DEBUG_OUTPUT)
|
||||
|
|
|
@ -52,6 +52,26 @@
|
|||
#define VERIFY(exp) (exp)
|
||||
#endif // !_DEBUG
|
||||
|
||||
// NSPR Win32 modules:
|
||||
// nsWindow, nsSound, and nsClipboard
|
||||
//
|
||||
// Logging can be changed at runtime without recompiling in the General
|
||||
// property page of Visual Studio under the "Environment" property.
|
||||
//
|
||||
// Two variables are of importance to be set:
|
||||
// NSPR_LOG_MODULES and NSPR_LOG_FILE
|
||||
//
|
||||
// NSPR_LOG_MODULES:
|
||||
// NSPR_LOG_MODULES=all:5 (To log everything completely)
|
||||
// NSPR_LOG_MODULES=nsWindow:5,nsSound:5,nsClipboard:5
|
||||
// (To log windows widget stuff)
|
||||
// NSPR_LOG_MODULES= (To turn off logging)
|
||||
//
|
||||
// NSPR_LOG_FILE:
|
||||
// NSPR_LOG_FILE=C:\nsprlog.txt (To a file on disk)
|
||||
// NSPR_LOG_FILE=WinDebug (To the debug window)
|
||||
// NSPR_LOG_FILE= (To stdout/stderr)
|
||||
|
||||
#endif // NSDEFS_H
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче