зеркало из https://github.com/mozilla/gecko-dev.git
Move EClickState to Netscape_Constants
This commit is contained in:
Родитель
bed4ed474f
Коммит
6657dfedfc
|
@ -194,7 +194,7 @@ Boolean CHTMLClickRecord::PixelReallyInElement(
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
CHTMLClickRecord::EClickState CHTMLClickRecord::WaitForMouseAction(
|
EClickState CHTMLClickRecord::WaitForMouseAction(
|
||||||
const SMouseDownEvent& inMouseDown,
|
const SMouseDownEvent& inMouseDown,
|
||||||
LAttachable* inAttachable,
|
LAttachable* inAttachable,
|
||||||
Int32 inDelay,
|
Int32 inDelay,
|
||||||
|
@ -209,14 +209,14 @@ CHTMLClickRecord::EClickState CHTMLClickRecord::WaitForMouseAction(
|
||||||
|
|
||||||
CContextMenuAttachment::SExecuteParams params;
|
CContextMenuAttachment::SExecuteParams params;
|
||||||
params.inMouseDown = &inMouseDown;
|
params.inMouseDown = &inMouseDown;
|
||||||
params.outResult = (CContextMenuAttachment::EClickState)eUndefined;
|
params.outResult = eMouseUndefined;
|
||||||
if (inExecuteContextMenuAttachment)
|
if (inExecuteContextMenuAttachment)
|
||||||
{
|
{
|
||||||
inAttachable->ExecuteAttachments(
|
inAttachable->ExecuteAttachments(
|
||||||
CContextMenuAttachment::msg_ContextMenu,
|
CContextMenuAttachment::msg_ContextMenu,
|
||||||
(void*)¶ms);
|
(void*)¶ms);
|
||||||
}
|
}
|
||||||
if (params.outResult != eUndefined)
|
if (params.outResult != eMouseUndefined)
|
||||||
return (EClickState)params.outResult;
|
return (EClickState)params.outResult;
|
||||||
|
|
||||||
// ¥ The old way.
|
// ¥ The old way.
|
||||||
|
@ -227,7 +227,7 @@ CHTMLClickRecord::EClickState CHTMLClickRecord::WaitForMouseAction(
|
||||||
} // CHTMLClickRecord::WaitForMouseAction
|
} // CHTMLClickRecord::WaitForMouseAction
|
||||||
|
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
CHTMLClickRecord::EClickState CHTMLClickRecord::WaitForMouseAction(
|
EClickState CHTMLClickRecord::WaitForMouseAction(
|
||||||
const Point& inInitialPoint,
|
const Point& inInitialPoint,
|
||||||
Int32 inWhen,
|
Int32 inWhen,
|
||||||
Int32 inDelay)
|
Int32 inDelay)
|
||||||
|
@ -246,8 +246,8 @@ CHTMLClickRecord::EClickState CHTMLClickRecord::WaitForMouseAction(
|
||||||
Point theCurrentPoint;
|
Point theCurrentPoint;
|
||||||
::GetMouse(&theCurrentPoint);
|
::GetMouse(&theCurrentPoint);
|
||||||
|
|
||||||
if ((abs(theCurrentPoint.h - inInitialPoint.h) >= eMouseHystersis) ||
|
if ((abs(theCurrentPoint.h - inInitialPoint.h) >= kMouseHysteresis) ||
|
||||||
(abs(theCurrentPoint.v - inInitialPoint.v) >= eMouseHystersis))
|
(abs(theCurrentPoint.v - inInitialPoint.v) >= kMouseHysteresis))
|
||||||
return eMouseDragging;
|
return eMouseDragging;
|
||||||
|
|
||||||
Int32 now = ::TickCount();
|
Int32 now = ::TickCount();
|
||||||
|
|
|
@ -36,15 +36,6 @@ class CHTMLClickRecord
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum EClickState {
|
|
||||||
eUndefined = 0,
|
|
||||||
eMouseHystersis = 6,
|
|
||||||
eMouseDragging = 1,
|
|
||||||
eMouseTimeout,
|
|
||||||
eMouseUpEarly,
|
|
||||||
eHandledByAttachment
|
|
||||||
};
|
|
||||||
|
|
||||||
CHTMLClickRecord(
|
CHTMLClickRecord(
|
||||||
Point inLocalWhere,
|
Point inLocalWhere,
|
||||||
const SPoint32& inImageWhere,
|
const SPoint32& inImageWhere,
|
||||||
|
|
|
@ -41,7 +41,7 @@ CContextMenuAttachment::~CContextMenuAttachment()
|
||||||
} // CContextMenuAttachment::CContextMenuAttachment
|
} // CContextMenuAttachment::CContextMenuAttachment
|
||||||
|
|
||||||
//-----------------------------------
|
//-----------------------------------
|
||||||
CContextMenuAttachment::EClickState CContextMenuAttachment::WaitMouseAction(
|
EClickState CContextMenuAttachment::WaitMouseAction(
|
||||||
const Point& inInitialPoint,
|
const Point& inInitialPoint,
|
||||||
Int32 inWhen,
|
Int32 inWhen,
|
||||||
Int32 inDelay)
|
Int32 inDelay)
|
||||||
|
@ -61,8 +61,8 @@ CContextMenuAttachment::EClickState CContextMenuAttachment::WaitMouseAction(
|
||||||
{
|
{
|
||||||
Point theCurrentPoint;
|
Point theCurrentPoint;
|
||||||
::GetMouse(&theCurrentPoint);
|
::GetMouse(&theCurrentPoint);
|
||||||
if ((abs(theCurrentPoint.h - inInitialPoint.h) >= eMouseHysteresis) ||
|
if ((abs(theCurrentPoint.h - inInitialPoint.h) >= kMouseHysteresis) ||
|
||||||
(abs(theCurrentPoint.v - inInitialPoint.v) >= eMouseHysteresis))
|
(abs(theCurrentPoint.v - inInitialPoint.v) >= kMouseHysteresis))
|
||||||
return eMouseDragging;
|
return eMouseDragging;
|
||||||
Int32 now = ::TickCount();
|
Int32 now = ::TickCount();
|
||||||
if (abs( now - inWhen ) > inDelay)
|
if (abs( now - inWhen ) > inDelay)
|
||||||
|
@ -215,7 +215,7 @@ void CContextMenuAttachment::DoPopup(const SMouseDownEvent& inMouseDown, EClickS
|
||||||
whereGlobal.h - 5,
|
whereGlobal.h - 5,
|
||||||
defaultItem);
|
defaultItem);
|
||||||
mExecuteHost = false;
|
mExecuteHost = false;
|
||||||
outResult = eHandledByAttachment;
|
outResult = eMouseHandledByAttachment;
|
||||||
// Restore the system font
|
// Restore the system font
|
||||||
::LMSetSysFontFam(saveFont);
|
::LMSetSysFontFam(saveFont);
|
||||||
::LMSetSysFontSize(saveSize);
|
::LMSetSysFontSize(saveSize);
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <LAttachment.h>
|
#include <LAttachment.h>
|
||||||
|
#include "Netscape_Constants.h" // for EClickState
|
||||||
|
|
||||||
class LCommander;
|
class LCommander;
|
||||||
struct SMouseDownEvent;
|
struct SMouseDownEvent;
|
||||||
|
@ -50,13 +51,6 @@ public:
|
||||||
CContextMenuAttachment(LStream* inStream);
|
CContextMenuAttachment(LStream* inStream);
|
||||||
virtual ~CContextMenuAttachment();
|
virtual ~CContextMenuAttachment();
|
||||||
|
|
||||||
enum EClickState {
|
|
||||||
eMouseHysteresis = 6
|
|
||||||
, eMouseDragging = 1
|
|
||||||
, eMouseTimeout
|
|
||||||
, eMouseUpEarly
|
|
||||||
, eHandledByAttachment
|
|
||||||
};
|
|
||||||
struct SExecuteParams
|
struct SExecuteParams
|
||||||
{
|
{
|
||||||
const SMouseDownEvent* inMouseDown;
|
const SMouseDownEvent* inMouseDown;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче