Skip to content

Commit

Permalink
Revert "Remove PLATFORM(NIX) from WebCore"
Browse files Browse the repository at this point in the history
This reverts commit ee41838.

Conflicts:
	Source/WebCore/ChangeLog
  • Loading branch information
lauromoura committed Jan 21, 2014
1 parent 3ffc4f3 commit 5b683f9
Show file tree
Hide file tree
Showing 41 changed files with 108 additions and 47 deletions.
10 changes: 5 additions & 5 deletions Source/WebCore/editing/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ String Editor::plainTextFromPasteboard(const PasteboardPlainText& text)

#endif

#if !PLATFORM(MAC) && !PLATFORM(EFL)
#if !PLATFORM(MAC) && !PLATFORM(EFL) && !PLATFORM(NIX)
void Editor::pasteWithPasteboard(Pasteboard* pasteboard, bool allowPlainText)
{
RefPtr<Range> range = selectedRange();
Expand Down Expand Up @@ -1283,7 +1283,7 @@ void Editor::cut()
if (enclosingTextFormControl(m_frame.selection().start()))
Pasteboard::createForCopyAndPaste()->writePlainText(selectedTextForClipboard(), canSmartCopyOrDelete() ? Pasteboard::CanSmartReplace : Pasteboard::CannotSmartReplace);
else {
#if PLATFORM(MAC) || PLATFORM(EFL)
#if PLATFORM(MAC) || PLATFORM(EFL) || PLATFORM(NIX)
writeSelectionToPasteboard(*Pasteboard::createForCopyAndPaste());
#else
// FIXME: Convert all other platforms to match Mac and delete this.
Expand All @@ -1310,13 +1310,13 @@ void Editor::copy()
canSmartCopyOrDelete() ? Pasteboard::CanSmartReplace : Pasteboard::CannotSmartReplace);
} else {
if (HTMLImageElement* imageElement = imageElementFromImageDocument(document())) {
#if PLATFORM(MAC) || PLATFORM(EFL)
#if PLATFORM(MAC) || PLATFORM(EFL) || PLATFORM(NIX)
writeImageToPasteboard(*Pasteboard::createForCopyAndPaste(), *imageElement, document().url(), document().title());
#else
Pasteboard::createForCopyAndPaste()->writeImage(*imageElement, document().url(), document().title());
#endif
} else {
#if PLATFORM(MAC) || PLATFORM(EFL)
#if PLATFORM(MAC) || PLATFORM(EFL) || PLATFORM(NIX)
writeSelectionToPasteboard(*Pasteboard::createForCopyAndPaste());
#else
// FIXME: Convert all other platforms to match Mac and delete this.
Expand Down Expand Up @@ -1420,7 +1420,7 @@ void Editor::copyImage(const HitTestResult& result)
if (url.isEmpty())
url = result.absoluteImageURL();

#if PLATFORM(MAC) || PLATFORM(EFL)
#if PLATFORM(MAC) || PLATFORM(EFL) || PLATFORM(NIX)
writeImageToPasteboard(*Pasteboard::createForCopyAndPaste(), *element, url, result.altDisplayString());
#else
Pasteboard::createForCopyAndPaste()->writeImage(*element, url, result.altDisplayString());
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/editing/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class Editor {
#endif // !PLATFORM(IOS)
#endif

#if PLATFORM(MAC) || PLATFORM(EFL)
#if PLATFORM(MAC) || PLATFORM(EFL) || PLATFORM(NIX)
void writeSelectionToPasteboard(Pasteboard&);
void writeImageToPasteboard(Pasteboard&, Element& imageElement, const URL&, const String& title);
#endif
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/HTMLCanvasElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "IntSize.h"
#include <wtf/Forward.h>

#if USE(CG)
#if USE(CG) || PLATFORM(NIX)
#define DefaultInterpolationQuality InterpolationLow
#else
#define DefaultInterpolationQuality InterpolationDefault
Expand Down
4 changes: 4 additions & 0 deletions Source/WebCore/loader/EmptyClients.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ class EmptyChromeClient : public ChromeClient {
virtual void AXFinishFrameLoad() override { }
#endif

#if PLATFORM(NIX)
virtual FloatRect screenRect() const override { return FloatRect(); }
#endif

#if PLATFORM(IOS)
#if ENABLE(TOUCH_EVENTS)
virtual void didPreventDefaultForEvent() override { }
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/loader/FrameLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ ObjectContentType FrameLoader::defaultObjectContentType(const URL& url, const St
if (mimeType.isEmpty())
mimeType = mimeTypeFromURL(url);

#if !PLATFORM(MAC) && !PLATFORM(EFL) // Mac has no PluginDatabase, nor does EFL
#if !PLATFORM(MAC) && !PLATFORM(EFL) && !PLATFORM(NIX) // Mac has no PluginDatabase, nor does Nix or EFL
if (mimeType.isEmpty()) {
String decodedPath = decodeURLEscapeSequences(url.path());
mimeType = PluginDatabase::installedPlugins()->MIMETypeForExtension(decodedPath.substring(decodedPath.reverseFind('.') + 1));
Expand All @@ -964,7 +964,7 @@ ObjectContentType FrameLoader::defaultObjectContentType(const URL& url, const St
if (mimeType.isEmpty())
return ObjectContentFrame; // Go ahead and hope that we can display the content.

#if !PLATFORM(MAC) && !PLATFORM(EFL) // Mac has no PluginDatabase, nor does EFL
#if !PLATFORM(MAC) && !PLATFORM(EFL) && !PLATFORM(NIX) // Mac has no PluginDatabase, nor does Nix or EFL
bool plugInSupportsMIMEType = PluginDatabase::installedPlugins()->isMIMETypeRegistered(mimeType);
#else
bool plugInSupportsMIMEType = false;
Expand Down
4 changes: 4 additions & 0 deletions Source/WebCore/page/ChromeClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ class ChromeClient {
virtual void AXFinishFrameLoad() = 0;
#endif

#if PLATFORM(NIX)
virtual FloatRect screenRect() const = 0;
#endif

#if ENABLE(TOUCH_EVENTS)
virtual void needTouchEvents(bool) = 0;
#endif
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/page/DragController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ bool DragController::startDrag(Frame& src, const DragState& state, DragOperation
if (enclosingTextFormControl(src.selection().start()))
clipboard.pasteboard().writePlainText(src.editor().selectedTextForClipboard(), Pasteboard::CannotSmartReplace);
else {
#if PLATFORM(MAC) || PLATFORM(EFL)
#if PLATFORM(MAC) || PLATFORM(EFL) || PLATFORM(NIX)
src.editor().writeSelectionToPasteboard(clipboard.pasteboard());
#else
// FIXME: Convert all other platforms to match Mac and delete this.
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/platform/Cursor.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ namespace WebCore {
typedef GRefPtr<GdkCursor> PlatformCursor;
#elif PLATFORM(EFL)
typedef const char* PlatformCursor;
#elif PLATFORM(NIX)
typedef unsigned PlatformCursor;
#else
typedef void* PlatformCursor;
#endif
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/DragData.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace WebCore {
class DataObjectGtk;
}
typedef WebCore::DataObjectGtk* DragDataRef;
#elif PLATFORM(EFL) || PLATFORM(IOS)
#elif PLATFORM(EFL) || PLATFORM(NIX) || PLATFORM(IOS)
typedef void* DragDataRef;
#endif

Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/DragImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ typedef struct CGImage *CGImageRef;
OBJC_CLASS NSImage;
#elif PLATFORM(WIN)
typedef struct HBITMAP__* HBITMAP;
#elif PLATFORM(GTK)
#elif PLATFORM(GTK) || PLATFORM(NIX)
typedef struct _cairo_surface cairo_surface_t;
#endif

Expand All @@ -63,7 +63,7 @@ typedef RetainPtr<CGImageRef> DragImageRef;
typedef RetainPtr<NSImage> DragImageRef;
#elif PLATFORM(WIN)
typedef HBITMAP DragImageRef;
#elif PLATFORM(GTK)
#elif PLATFORM(GTK) || PLATFORM(NIX)
typedef cairo_surface_t* DragImageRef;
#elif PLATFORM(EFL)
typedef void* DragImageRef;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/FileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ String encodeForFileName(const String&);
RetainPtr<CFURLRef> pathAsURL(const String&);
#endif

#if PLATFORM(GTK)
#if PLATFORM(GTK) || PLATFORM(NIX)
String filenameToString(const char*);
String filenameForDisplay(const String&);
CString applicationDirectoryPath();
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/LocalizedStrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace WebCore {
String contextMenuItemTagOpenImageInNewWindow();
String contextMenuItemTagDownloadImageToDisk();
String contextMenuItemTagCopyImageToClipboard();
#if PLATFORM(GTK) || PLATFORM(EFL)
#if PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(NIX)
String contextMenuItemTagCopyImageUrlToClipboard();
#endif
String contextMenuItemTagOpenFrameInNewWindow();
Expand All @@ -80,7 +80,7 @@ namespace WebCore {
String contextMenuItemTagUnicodeInsertZWJMark();
String contextMenuItemTagUnicodeInsertZWNJMark();
#endif
#if PLATFORM(GTK) || PLATFORM(EFL)
#if PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(NIX)
String contextMenuItemTagSelectAll();
#endif
String contextMenuItemTagNoGuessesFound();
Expand Down
4 changes: 4 additions & 0 deletions Source/WebCore/platform/Widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ typedef struct _GtkContainer GtkContainer;
typedef GtkWidget* PlatformWidget;
#endif

#if PLATFORM(NIX)
typedef void* PlatformWidget;
#endif

#if PLATFORM(EFL)
#if USE(EO)
typedef struct _Eo_Opaque Evas_Object;
Expand Down
8 changes: 8 additions & 0 deletions Source/WebCore/platform/audio/FFTFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ struct RDFTContext;
#include <ipps.h>
#endif // USE(WEBAUDIO_IPP)

#if PLATFORM(NIX)
#include <public/FFTFrame.h>
#endif

#include <memory>
#include <wtf/Forward.h>
#include <wtf/Threading.h>
Expand Down Expand Up @@ -178,6 +182,10 @@ class FFTFrame {
AudioFloatArray m_imagData;
#endif // USE(WEBAUDIO_IPP)

#if PLATFORM(NIX)
OwnPtr<Nix::FFTFrame> m_fftFrame;
#endif // PLATFORM(NIX)

#if USE(WEBAUDIO_OPENMAX_DL_FFT)
static OMXFFTSpec_R_F32* contextForSize(unsigned log2FFTSize);

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/audio/HRTFElevation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const size_t ResponseFrameSize = 256;
// The impulse responses may be resampled to a different sample-rate (depending on the audio hardware) when they are loaded.
const float ResponseSampleRate = 44100;

#if PLATFORM(MAC) || USE(WEBAUDIO_GSTREAMER)
#if PLATFORM(MAC) || USE(WEBAUDIO_GSTREAMER) || PLATFORM(NIX)
#define USE_CONCATENATED_IMPULSE_RESPONSES
#endif

Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/platform/cairo/WidgetBackingStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ namespace WebCore {
typedef GtkWidget* PlatformWidget;
#elif PLATFORM(EFL)
typedef Evas_Object* PlatformWidget;
#elif PLATFORM(NIX)
typedef void* PlatformWidget;
#endif

class WidgetBackingStore {
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>

#if !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATFORM(WIN)
#if !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATFORM(WIN) && !PLATFORM(NIX)
#include "ANGLE/ShaderLang.h"
#elif PLATFORM(WIN)
#include "GLSLANG/ShaderLang.h"
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/FontPlatformData.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// FIXME: This is temporary until all ports switch to using this file.
#if USE(WINGDI)
#include "wince/FontPlatformData.h"
#elif PLATFORM(EFL) || PLATFORM(GTK)
#elif PLATFORM(EFL) || PLATFORM(GTK) || PLATFORM(NIX)
#include "freetype/FontPlatformData.h"
#else

Expand Down
4 changes: 3 additions & 1 deletion Source/WebCore/platform/graphics/GLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "config.h"
#include "GLContext.h"

#if USE(OPENGL)
#if USE(OPENGL) || (PLATFORM(NIX) && USE(OPENGL_ES_2))

#if USE(EGL)
#include "GLContextEGL.h"
Expand Down Expand Up @@ -154,13 +154,15 @@ PassOwnPtr<GLContext> GLContext::createContextForWindow(GLNativeWindowType windo
}
#endif

#if !PLATFORM(NIX)
#if USE(GLX)
if (OwnPtr<GLContext> glxContext = GLContextGLX::createContext(windowHandle, sharingContext))
return glxContext.release();
#endif
#if USE(EGL)
if (OwnPtr<GLContext> eglContext = GLContextEGL::createContext(windowHandle, sharingContext))
return eglContext.release();
#endif
#endif
return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/GLContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>

#if USE(EGL) && !PLATFORM(GTK)
#if USE(EGL) && !PLATFORM(GTK) && !PLATFORM(NIX)
#include "eglplatform.h"
typedef EGLNativeWindowType GLNativeWindowType;
#else
Expand Down
6 changes: 3 additions & 3 deletions Source/WebCore/platform/graphics/GraphicsContext3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#include <wtf/RetainPtr.h>
OBJC_CLASS CALayer;
OBJC_CLASS WebGLLayer;
#elif PLATFORM(GTK) || PLATFORM(EFL)
#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(NIX)
typedef unsigned int GLuint;
#endif

Expand Down Expand Up @@ -987,7 +987,7 @@ class GraphicsContext3D : public RefCounted<GraphicsContext3D> {

bool reshapeFBOs(const IntSize&);
void resolveMultisamplingIfNecessary(const IntRect& = IntRect());
#if PLATFORM(EFL) && USE(GRAPHICS_SURFACE)
#if (PLATFORM(EFL) || PLATFORM(NIX)) && USE(GRAPHICS_SURFACE)
void createGraphicsSurfaces(const IntSize&);
#endif

Expand Down Expand Up @@ -1092,7 +1092,7 @@ class GraphicsContext3D : public RefCounted<GraphicsContext3D> {

OwnPtr<ShaderNameHash> nameHashMapForShaders;

#if ((PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN)) && USE(OPENGL_ES_2))
#if ((PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)) && USE(OPENGL_ES_2))
friend class Extensions3DOpenGLES;
OwnPtr<Extensions3DOpenGLES> m_extensions;
#else
Expand Down
7 changes: 7 additions & 0 deletions Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include "NotImplemented.h"
#include <wtf/StdLibExtras.h>

#if PLATFORM(NIX) && USE(EGL)
#include "GLContextFromCurrentEGL.h"
#endif

#if USE(CAIRO)
#include "PlatformContextCairo.h"
#endif
Expand Down Expand Up @@ -59,6 +63,9 @@ GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, G
m_glContext = GLContext::createOffscreenContext(GLContext::sharingContext());
break;
case GraphicsContext3D::RenderToCurrentGLContext:
#if PLATFORM(NIX) && USE(EGL)
m_glContext = GLContextFromCurrentEGL::createFromCurrentGLContext();
#endif
break;
case GraphicsContext3D::RenderDirectlyToHostWindow:
ASSERT_NOT_REACHED();
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/OpenGLESShims.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#ifndef OpenGLESShims_h
#define OpenGLESShims_h

#if PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN)
#if PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
#define glBindFramebufferEXT glBindFramebuffer
#define glFramebufferTexture2DEXT glFramebufferTexture2D
#define glBindRenderbufferEXT glBindRenderbuffer
Expand Down
19 changes: 19 additions & 0 deletions Source/WebCore/platform/graphics/OpenGLShims.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include <dlfcn.h>
#endif

#if PLATFORM(NIX) && USE(EGL)
#include <EGL/egl.h>
#endif

#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>

Expand All @@ -42,6 +46,11 @@ static void* getProcAddress(const char* procName)
{
return GetProcAddress(GetModuleHandleA("libGLESv2"), procName);
}
#elif PLATFORM(NIX) && USE(EGL)
static void* getProcAddress(const char* procName)
{
return reinterpret_cast<void*>(eglGetProcAddress(procName));
}
#else
typedef void* (*glGetProcAddressType) (const char* procName);
static void* getProcAddress(const char* procName)
Expand Down Expand Up @@ -99,9 +108,19 @@ static void* lookupOpenGLFunctionAddress(const char* functionName, bool* success
return target;
}

#if PLATFORM(NIX) && USE(OPENGL_ES_2)

// With Angle only EGL/GLES2 extensions are available through eglGetProcAddress, not the regular standardized functions.
#define ASSIGN_FUNCTION_TABLE_ENTRY(FunctionName, success) \
openGLFunctionTable()->FunctionName = reinterpret_cast<FunctionName##Type>(::FunctionName)

#else

#define ASSIGN_FUNCTION_TABLE_ENTRY(FunctionName, success) \
openGLFunctionTable()->FunctionName = reinterpret_cast<FunctionName##Type>(lookupOpenGLFunctionAddress(#FunctionName, &success))

#endif

#define ASSIGN_FUNCTION_TABLE_ENTRY_EXT(FunctionName) \
openGLFunctionTable()->FunctionName = reinterpret_cast<FunctionName##Type>(lookupOpenGLFunctionAddress(#FunctionName))

Expand Down
4 changes: 4 additions & 0 deletions Source/WebCore/platform/graphics/OpenGLShims.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
#ifndef OpenGLShims_h
#define OpenGLShims_h

#if PLATFORM(NIX) && USE(OPENGL_ES_2)
#include <GLES2/gl2.h>
#else
#include <GL/gl.h>
#include <GL/glext.h>
#endif

#if defined(GL_ES_VERSION_2_0)
// Some openGL ES systems miss this typedef.
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/PlatformLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class TextureMapperPlatformLayer;
typedef TextureMapperPlatformLayer PlatformLayer;
};
#endif
#elif PLATFORM(EFL)
#elif PLATFORM(EFL) || PLATFORM(NIX)
#if USE(TEXTURE_MAPPER)
namespace WebCore {
class TextureMapperPlatformLayer;
Expand Down
Loading

0 comments on commit 5b683f9

Please sign in to comment.