Commit 31658f92 by Corentin Wallez

Implement OSXWindow.

BUG=angleproject:891 Change-Id: If8aefa4a37ba7d1b6b08921bee61463bb20550af Reviewed-on: https://chromium-review.googlesource.com/285834Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 0dce07bc
...@@ -540,6 +540,13 @@ ...@@ -540,6 +540,13 @@
'EGLAPI=__attribute__((visibility("default")))', 'EGLAPI=__attribute__((visibility("default")))',
], ],
}], }],
['OS == "mac"',
{
'xcode_settings':
{
'DYLIB_INSTALL_NAME_BASE': '@rpath',
},
}],
['angle_enable_d3d9==1', ['angle_enable_d3d9==1',
{ {
'defines': 'defines':
...@@ -768,6 +775,15 @@ ...@@ -768,6 +775,15 @@
], ],
}, },
}], }],
['OS == "mac"',
{
'all_dependent_settings':
{
'xcode_settings': {
'LD_RUNPATH_SEARCH_PATHS': ['@executable_path/.'],
},
}
}]
], ],
}, },
], ],
......
//
// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// OSXWindow.cpp: Implementation of OSWindow for OSX
#include "osx/OSXWindow.h"
// TODO(cwallez): implement OSXWindow.
OSWindow *CreateOSWindow()
{
return nullptr;
}
...@@ -4,13 +4,60 @@ ...@@ -4,13 +4,60 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
// OSXWindow.h: Definition of the implementation of OSWindow for OSX` // OSXWindow.h: Definition of the implementation of OSWindow for OSX
#ifndef UTIL_OSX_WINDOW_H_ #ifndef UTIL_OSX_WINDOW_H_
#define UTIL_OSX_WINDOW_H_ #define UTIL_OSX_WINDOW_H_
#import <Cocoa/Cocoa.h>
#include "OSWindow.h" #include "OSWindow.h"
// TODO(cwallez): implement OSXWindow. class OSXWindow;
@interface WindowDelegate : NSObject
{
OSXWindow *mWindow;
}
- (id) initWithWindow: (OSXWindow*) window;
@end
@interface ContentView : NSView
{
OSXWindow *mWindow;
NSTrackingArea *mTrackingArea;
int mCurrentModifier;
}
- (id) initWithWindow: (OSXWindow*) window;
@end
class OSXWindow : public OSWindow
{
public:
OSXWindow();
~OSXWindow();
bool initialize(const std::string &name, size_t width, size_t height) override;
void destroy() override;
EGLNativeWindowType getNativeWindow() const override;
EGLNativeDisplayType getNativeDisplay() const override;
void messageLoop() override;
void setMousePosition(int x, int y) override;
bool setPosition(int x, int y) override;
bool resize(int width, int height) override;
void setVisible(bool isVisible) override;
void signalTestEvent() override;
NSWindow *getNSWindow() const;
private:
NSWindow *mWindow;
WindowDelegate *mDelegate;
ContentView *mView;
};
#endif // UTIL_OSX_WINDOW_H_ #endif // UTIL_OSX_WINDOW_H_
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
'osx/OSX_system_utils.cpp', 'osx/OSX_system_utils.cpp',
'osx/OSXTimer.cpp', 'osx/OSXTimer.cpp',
'osx/OSXTimer.h', 'osx/OSXTimer.h',
'osx/OSXWindow.cpp', 'osx/OSXWindow.mm',
'osx/OSXWindow.h', 'osx/OSXWindow.h',
'posix/Posix_system_utils.cpp', 'posix/Posix_system_utils.cpp',
], ],
...@@ -131,6 +131,13 @@ ...@@ -131,6 +131,13 @@
[ [
'<@(util_osx_sources)', '<@(util_osx_sources)',
], ],
'link_settings':
{
'libraries':
[
'-framework AppKit',
],
},
}], }],
], ],
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment