summaryrefslogtreecommitdiff
path: root/widget
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-05-06 09:24:03 +0000
committerMoonchild <moonchild@palemoon.org>2021-05-06 09:24:03 +0000
commit6f707bde95dab6998ac204f9ee6c925ee230c740 (patch)
tree859f6cf99f2e026b76dcc40b27b211154310d16e /widget
parentaa0fd3d68c856504646e1d7eb499bc890ef44101 (diff)
downloaduxp-6f707bde95dab6998ac204f9ee6c925ee230c740.tar.gz
Issue #1751 -- Remove XP_MACOSX conditionals from the rest of the tree.
This also removes some PP abuse and takes file entries out of PP when no longer needed without XP_MACOSX conditionals.
Diffstat (limited to 'widget')
-rw-r--r--widget/CompositorWidget.h6
-rw-r--r--widget/GfxInfoBase.cpp8
-rw-r--r--widget/NativeKeyToDOMCodeName.h6
-rw-r--r--widget/NativeKeyToDOMKeyName.h4
-rw-r--r--widget/TextEvents.h31
-rw-r--r--widget/WidgetEventImpl.cpp4
-rw-r--r--widget/nsBaseWidget.cpp23
-rw-r--r--widget/nsBaseWidget.h2
-rw-r--r--widget/nsGUIEventIPC.h14
-rw-r--r--widget/nsIWidget.h4
-rw-r--r--widget/nsNativeTheme.cpp14
11 files changed, 7 insertions, 109 deletions
diff --git a/widget/CompositorWidget.h b/widget/CompositorWidget.h
index eb657ba7f3..829255b62d 100644
--- a/widget/CompositorWidget.h
+++ b/widget/CompositorWidget.h
@@ -54,11 +54,7 @@ class CompositorWidgetChild;
class WidgetRenderingContext
{
-public:
-#ifdef XP_MACOSX
- WidgetRenderingContext() : mLayerManager(nullptr) {}
- layers::LayerManagerComposite* mLayerManager;
-#endif
+/** Mac Stub **/
};
/**
diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp
index ed47355367..ae0878c757 100644
--- a/widget/GfxInfoBase.cpp
+++ b/widget/GfxInfoBase.cpp
@@ -1,4 +1,3 @@
-/* vim: se cin sw=2 ts=2 et : */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
@@ -646,13 +645,6 @@ MatchingOperatingSystems(OperatingSystem aBlockedOS, OperatingSystem aSystemOS)
}
#endif
-#if defined (XP_MACOSX)
- if (aBlockedOS == OperatingSystem::OSX) {
- // We do want even "unknown" aSystemOS to fall under "all OS X"
- return true;
- }
-#endif
-
return aSystemOS == aBlockedOS;
}
diff --git a/widget/NativeKeyToDOMCodeName.h b/widget/NativeKeyToDOMCodeName.h
index 74f2ed1f47..05bcd3babb 100644
--- a/widget/NativeKeyToDOMCodeName.h
+++ b/widget/NativeKeyToDOMCodeName.h
@@ -27,12 +27,6 @@
#define CODE_MAP_WIN(aCPPCodeName, aNativeKey) \
NS_NATIVE_KEY_TO_DOM_CODE_NAME_INDEX(aNativeKey, \
CODE_NAME_INDEX_##aCPPCodeName)
-#elif defined(XP_MACOSX)
-#undef CODE_MAP_MAC
-// aNativeKey is key code starting with kVK_.
-#define CODE_MAP_MAC(aCPPCodeName, aNativeKey) \
- NS_NATIVE_KEY_TO_DOM_CODE_NAME_INDEX(aNativeKey, \
- CODE_NAME_INDEX_##aCPPCodeName)
#elif defined(MOZ_WIDGET_GTK)
#undef CODE_MAP_X11
// aNativeKey is hardware_keycode of GDKEvent or nativeScanCode of QKeyEvent.
diff --git a/widget/NativeKeyToDOMKeyName.h b/widget/NativeKeyToDOMKeyName.h
index 25dafff6f3..45400e9564 100644
--- a/widget/NativeKeyToDOMKeyName.h
+++ b/widget/NativeKeyToDOMKeyName.h
@@ -61,10 +61,6 @@
#else
#error Any NS_*_TO_DOM_KEY_NAME_INDEX() is not defined.
#endif // #if defined(NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX) ...
-#elif defined(XP_MACOSX)
-#undef KEY_MAP_COCOA
-#define KEY_MAP_COCOA(aCPPKeyName, aNativeKey) \
- NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, KEY_NAME_INDEX_##aCPPKeyName)
#elif defined(MOZ_WIDGET_GTK)
#undef KEY_MAP_GTK
#define KEY_MAP_GTK(aCPPKeyName, aNativeKey) \
diff --git a/widget/TextEvents.h b/widget/TextEvents.h
index 6c29341144..736effeeab 100644
--- a/widget/TextEvents.h
+++ b/widget/TextEvents.h
@@ -111,10 +111,6 @@ protected:
, mLocation(nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD)
, mAccessKeyForwardedToChild(false)
, mUniqueId(0)
-#ifdef XP_MACOSX
- , mNativeModifierFlags(0)
- , mNativeKeyCode(0)
-#endif // #ifdef XP_MACOSX
, mKeyNameIndex(mozilla::KEY_NAME_INDEX_Unidentified)
, mCodeNameIndex(CODE_NAME_INDEX_UNKNOWN)
, mInputMethodAppState(eNotHandled)
@@ -140,10 +136,6 @@ public:
, mLocation(nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD)
, mAccessKeyForwardedToChild(false)
, mUniqueId(0)
-#ifdef XP_MACOSX
- , mNativeModifierFlags(0)
- , mNativeKeyCode(0)
-#endif // #ifdef XP_MACOSX
, mKeyNameIndex(mozilla::KEY_NAME_INDEX_Unidentified)
, mCodeNameIndex(CODE_NAME_INDEX_UNKNOWN)
, mInputMethodAppState(eNotHandled)
@@ -204,15 +196,6 @@ public:
// CODE_NAME_INDEX_USE_STRING.
nsString mCodeValue;
-#ifdef XP_MACOSX
- // Values given by a native NSEvent, for use with Cocoa NPAPI plugins.
- nsString mNativeCharacters;
- nsString mNativeCharactersIgnoringModifiers;
- // If this is non-empty, create a text event for plugins instead of a
- // keyboard event.
- nsString mPluginTextEventString;
-#endif // #ifdef XP_MACOSX
-
// OS-specific native event can optionally be preserved
void* mNativeKeyEvent;
// A DOM keyCode value or 0. If a keypress event whose mCharCode is 0, this
@@ -240,12 +223,6 @@ public:
// over long periods.
uint32_t mUniqueId;
-#ifdef XP_MACOSX
- // Values given by a native NSEvent, for use with Cocoa NPAPI plugins.
- uint32_t mNativeModifierFlags;
- uint16_t mNativeKeyCode;
-#endif // #ifdef XP_MACOSX
-
// DOM KeyboardEvent.key
KeyNameIndex mKeyNameIndex;
// DOM KeyboardEvent.code
@@ -397,14 +374,6 @@ public:
// is destroyed.
mNativeKeyEvent = nullptr;
mUniqueId = aEvent.mUniqueId;
-#ifdef XP_MACOSX
- mNativeKeyCode = aEvent.mNativeKeyCode;
- mNativeModifierFlags = aEvent.mNativeModifierFlags;
- mNativeCharacters.Assign(aEvent.mNativeCharacters);
- mNativeCharactersIgnoringModifiers.
- Assign(aEvent.mNativeCharactersIgnoringModifiers);
- mPluginTextEventString.Assign(aEvent.mPluginTextEventString);
-#endif
mInputMethodAppState = aEvent.mInputMethodAppState;
mIsSynthesizedByTIP = aEvent.mIsSynthesizedByTIP;
}
diff --git a/widget/WidgetEventImpl.cpp b/widget/WidgetEventImpl.cpp
index 59c80672b1..1302c3e948 100644
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -479,11 +479,7 @@ WidgetInputEvent::AccelModifier()
sAccelModifier = MODIFIER_CONTROL;
break;
default:
-#ifdef XP_MACOSX
- sAccelModifier = MODIFIER_META;
-#else
sAccelModifier = MODIFIER_CONTROL;
-#endif
break;
}
}
diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp
index d3cdf72cfc..23859383c2 100644
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -84,10 +84,6 @@ static void debug_RegisterPrefCallbacks();
static int32_t gNumWidgets;
#endif
-#ifdef XP_MACOSX
-#include "nsCocoaFeatures.h"
-#endif
-
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
static nsRefPtrHashtable<nsVoidPtrHashKey, nsIWidget>* sPluginWidgetList;
#endif
@@ -175,7 +171,7 @@ nsBaseWidget::nsBaseWidget()
, mUpdateCursor(true)
, mUseAttachedEvents(false)
, mIMEHasFocus(false)
-#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
+#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
, mAccessibilityInUseFlag(false)
#endif
{
@@ -645,15 +641,8 @@ void nsBaseWidget::AddChild(nsIWidget* aChild)
void nsBaseWidget::RemoveChild(nsIWidget* aChild)
{
#ifdef DEBUG
-#ifdef XP_MACOSX
- // nsCocoaWindow doesn't implement GetParent, so in that case parent will be
- // null and we'll just have to do without this assertion.
- nsIWidget* parent = aChild->GetParent();
- NS_ASSERTION(!parent || parent == this, "Not one of our kids!");
-#else
MOZ_RELEASE_ASSERT(aChild->GetParent() == this, "Not one of our kids!");
#endif
-#endif
if (mLastChild == aChild) {
mLastChild = mLastChild->GetPrevSibling();
@@ -1382,12 +1371,8 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
mLayerManager = lm.forget();
// Only track compositors for top-level windows, since other window types
- // may use the basic compositor. Except on the OS X - see bug 1306383
-#if defined(XP_MACOSX)
- bool getCompositorFromThisWindow = true;
-#else
+ // may use the basic compositor.
bool getCompositorFromThisWindow = (mWindowType == eWindowType_toplevel);
-#endif
if (getCompositorFromThisWindow) {
gfxPlatform::GetPlatform()->NotifyCompositorCreated(mLayerManager->GetCompositorBackendType());
@@ -1885,7 +1870,7 @@ nsBaseWidget::ZoomToRect(const uint32_t& aPresShellId,
#ifdef ACCESSIBILITY
-#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
+#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
// defined in nsAppRunner.cpp
extern const char* kAccessibilityLastRunDatePref;
@@ -1914,7 +1899,7 @@ nsBaseWidget::GetRootAccessible()
// make sure it's not created at unsafe times.
nsAccessibilityService* accService = GetOrCreateAccService();
if (accService) {
-#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
+#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
if (!mAccessibilityInUseFlag) {
mAccessibilityInUseFlag = true;
uint32_t now = PRTimeToSeconds(PR_Now());
diff --git a/widget/nsBaseWidget.h b/widget/nsBaseWidget.h
index bbc6b72383..4065a7f1e8 100644
--- a/widget/nsBaseWidget.h
+++ b/widget/nsBaseWidget.h
@@ -677,7 +677,7 @@ protected:
bool mUpdateCursor;
bool mUseAttachedEvents;
bool mIMEHasFocus;
-#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
+#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
bool mAccessibilityInUseFlag;
#endif
static nsIRollupListener* gRollupListener;
diff --git a/widget/nsGUIEventIPC.h b/widget/nsGUIEventIPC.h
index e45189bb10..bf03652440 100644
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -431,13 +431,6 @@ struct ParamTraits<mozilla::WidgetKeyboardEvent>
WriteParam(aMsg,
static_cast<paramType::InputMethodAppStateType>
(aParam.mInputMethodAppState));
-#ifdef XP_MACOSX
- WriteParam(aMsg, aParam.mNativeKeyCode);
- WriteParam(aMsg, aParam.mNativeModifierFlags);
- WriteParam(aMsg, aParam.mNativeCharacters);
- WriteParam(aMsg, aParam.mNativeCharactersIgnoringModifiers);
- WriteParam(aMsg, aParam.mPluginTextEventString);
-#endif
// An OS-specific native event might be attached in |mNativeKeyEvent|, but
// that cannot be copied across process boundaries.
}
@@ -465,13 +458,6 @@ struct ParamTraits<mozilla::WidgetKeyboardEvent>
ReadParam(aMsg, aIter, &aResult->mUniqueId) &&
ReadParam(aMsg, aIter, &aResult->mIsSynthesizedByTIP) &&
ReadParam(aMsg, aIter, &inputMethodAppState)
-#ifdef XP_MACOSX
- && ReadParam(aMsg, aIter, &aResult->mNativeKeyCode)
- && ReadParam(aMsg, aIter, &aResult->mNativeModifierFlags)
- && ReadParam(aMsg, aIter, &aResult->mNativeCharacters)
- && ReadParam(aMsg, aIter, &aResult->mNativeCharactersIgnoringModifiers)
- && ReadParam(aMsg, aIter, &aResult->mPluginTextEventString)
-#endif
)
{
aResult->mKeyNameIndex = static_cast<mozilla::KeyNameIndex>(keyNameIndex);
diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h
index 8e28c24da5..716ed85c45 100644
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -115,10 +115,6 @@ typedef void* nsNativeWidget;
// IME context. Note that the result is only valid in the process. So,
// XP code should use nsIWidget::GetNativeIMEContext() instead of using this.
#define NS_RAW_NATIVE_IME_CONTEXT 14
-#ifdef XP_MACOSX
-#define NS_NATIVE_PLUGIN_PORT_QD 100
-#define NS_NATIVE_PLUGIN_PORT_CG 101
-#endif
#ifdef XP_WIN
#define NS_NATIVE_TSF_THREAD_MGR 100
#define NS_NATIVE_TSF_CATEGORY_MGR 101
diff --git a/widget/nsNativeTheme.cpp b/widget/nsNativeTheme.cpp
index a5bd85fafa..35c5a84f75 100644
--- a/widget/nsNativeTheme.cpp
+++ b/widget/nsNativeTheme.cpp
@@ -99,25 +99,13 @@ nsNativeTheme::GetContentState(nsIFrame* aFrame, uint8_t aWidgetType)
flags |= NS_EVENT_STATE_FOCUS;
}
- // On Windows and Mac, only draw focus rings if they should be shown. This
+ // On Windows, only draw focus rings if they should be shown. This
// means that focus rings are only shown once the keyboard has been used to
// focus something in the window.
-#if defined(XP_MACOSX)
- // Mac always draws focus rings for textboxes and lists.
- if (aWidgetType == NS_THEME_NUMBER_INPUT ||
- aWidgetType == NS_THEME_TEXTFIELD ||
- aWidgetType == NS_THEME_TEXTFIELD_MULTILINE ||
- aWidgetType == NS_THEME_SEARCHFIELD ||
- aWidgetType == NS_THEME_LISTBOX) {
- return flags;
- }
-#endif
#if defined(XP_WIN)
// On Windows, focused buttons are always drawn as such by the native theme.
if (aWidgetType == NS_THEME_BUTTON)
return flags;
-#endif
-#if defined(XP_MACOSX) || defined(XP_WIN)
nsIDocument* doc = aFrame->GetContent()->OwnerDoc();
nsPIDOMWindowOuter* window = doc->GetWindow();
if (window && !window->ShouldShowFocusRing())