2015-06-20 01:42:09 +03:00
|
|
|
//
|
2019-08-14 22:25:12 +03:00
|
|
|
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
|
2015-06-20 01:42:09 +03:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
//
|
|
|
|
|
2015-07-15 22:57:34 +03:00
|
|
|
// OSXWindow.h: Definition of the implementation of OSWindow for OSX
|
2015-06-20 01:42:09 +03:00
|
|
|
|
|
|
|
#ifndef UTIL_OSX_WINDOW_H_
|
|
|
|
#define UTIL_OSX_WINDOW_H_
|
|
|
|
|
2015-07-15 22:57:34 +03:00
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
2018-12-29 18:29:33 +03:00
|
|
|
#include "util/OSWindow.h"
|
2015-06-20 01:42:09 +03:00
|
|
|
|
2015-07-15 22:57:34 +03:00
|
|
|
class OSXWindow;
|
|
|
|
|
2018-12-29 18:29:33 +03:00
|
|
|
@interface WindowDelegate : NSObject {
|
2015-07-15 22:57:34 +03:00
|
|
|
OSXWindow *mWindow;
|
|
|
|
}
|
2018-12-29 18:29:33 +03:00
|
|
|
- (id)initWithWindow:(OSXWindow *)window;
|
2015-07-15 22:57:34 +03:00
|
|
|
@end
|
|
|
|
|
2018-12-29 18:29:33 +03:00
|
|
|
@interface ContentView : NSView {
|
2015-07-15 22:57:34 +03:00
|
|
|
OSXWindow *mWindow;
|
|
|
|
NSTrackingArea *mTrackingArea;
|
|
|
|
int mCurrentModifier;
|
|
|
|
}
|
2018-12-29 18:29:33 +03:00
|
|
|
- (id)initWithWindow:(OSXWindow *)window;
|
2015-07-15 22:57:34 +03:00
|
|
|
@end
|
|
|
|
|
|
|
|
class OSXWindow : public OSWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
OSXWindow();
|
2019-10-24 19:55:11 +03:00
|
|
|
~OSXWindow() override;
|
2015-07-15 22:57:34 +03:00
|
|
|
|
2019-08-07 03:17:19 +03:00
|
|
|
bool initialize(const std::string &name, int width, int height) override;
|
2020-07-06 16:50:49 +03:00
|
|
|
void disableErrorMessageDialog() override;
|
2015-07-15 22:57:34 +03:00
|
|
|
void destroy() override;
|
|
|
|
|
2019-01-22 02:09:15 +03:00
|
|
|
void resetNativeWindow() override;
|
2015-07-15 22:57:34 +03:00
|
|
|
EGLNativeWindowType getNativeWindow() const override;
|
|
|
|
EGLNativeDisplayType getNativeDisplay() const override;
|
|
|
|
|
|
|
|
void messageLoop() override;
|
|
|
|
|
|
|
|
void setMousePosition(int x, int y) override;
|
2020-07-10 18:13:39 +03:00
|
|
|
bool setOrientation(int width, int height) override;
|
2015-07-15 22:57:34 +03:00
|
|
|
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;
|
|
|
|
};
|
2015-06-20 01:42:09 +03:00
|
|
|
|
2018-12-29 18:29:33 +03:00
|
|
|
#endif // UTIL_OSX_WINDOW_H_
|