1 /*
2   Copyright 2012-2020 David Robillard <d@drobilla.net>
3   Copyright 2017 Hanspeter Portner <dev@open-music-kontrollers.ch>
4 
5   Permission to use, copy, modify, and/or distribute this software for any
6   purpose with or without fee is hereby granted, provided that the above
7   copyright notice and this permission notice appear in all copies.
8 
9   THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10   WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11   MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12   ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17 
18 #ifndef PUGL_DETAIL_MAC_H
19 #define PUGL_DETAIL_MAC_H
20 
21 #include "pugl/pugl.h"
22 
23 #import <Cocoa/Cocoa.h>
24 
25 #include <stdint.h>
26 
27 @interface PuglWrapperView : NSView<NSTextInputClient>
28 
29 - (void)dispatchExpose:(NSRect)rect;
30 - (void)setReshaped;
31 
32 @end
33 
34 @interface PuglWindow : NSWindow
35 
36 - (void)setPuglview:(PuglView*)view;
37 
38 @end
39 
40 struct PuglWorldInternalsImpl {
41   NSApplication*     app;
42   NSAutoreleasePool* autoreleasePool;
43 };
44 
45 struct PuglInternalsImpl {
46   NSApplication*   app;
47   PuglWrapperView* wrapperView;
48   NSView*          drawView;
49   NSCursor*        cursor;
50   PuglWindow*      window;
51   uint32_t         mods;
52   bool             mouseTracked;
53 };
54 
55 #endif // PUGL_DETAIL_MAC_H
56