aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Third2017-05-23 02:42:20 -0700
committerPaul Eggert2017-05-23 02:45:13 -0700
commit4a485410ce74cafd4e9c344e31f7575464a16113 (patch)
tree8e5d40913f094c1f33a85da663ab905ab6d57156
parent107e60f49db71f1869848f0f0ce5ea7dd057366c (diff)
downloademacs-4a485410ce74cafd4e9c344e31f7575464a16113.tar.gz
emacs-4a485410ce74cafd4e9c344e31f7575464a16113.zip
Fix GNUstep build
* src/nsterm.h [NS_IMPL_GNUSTEP]: Add typedefs for Cocoa-only types. (NSWindowStyleMaskUtilityWindow): #define to NSUtilityWindowMask in GNUstep and old versions of macOS. * src/nsfns.m (ns-set-mouse-absolute-pixel-position): Function only works in cocoa, not GNUstep.
-rw-r--r--src/nsfns.m4
-rw-r--r--src/nsterm.h8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/nsfns.m b/src/nsfns.m
index 00310c051ff..3833ee75ac2 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -3046,6 +3046,9 @@ The coordinates X and Y are interpreted in pixels relative to a position
3046\(0, 0) of the selected frame's display. */) 3046\(0, 0) of the selected frame's display. */)
3047 (Lisp_Object x, Lisp_Object y) 3047 (Lisp_Object x, Lisp_Object y)
3048{ 3048{
3049#ifdef NS_IMPL_COCOA
3050 /* GNUstep doesn't support CGWarpMouseCursorPosition, so none of
3051 this will work. */
3049 struct frame *f = SELECTED_FRAME (); 3052 struct frame *f = SELECTED_FRAME ();
3050 EmacsView *view = FRAME_NS_VIEW (f); 3053 EmacsView *view = FRAME_NS_VIEW (f);
3051 NSScreen *screen = [[view window] screen]; 3054 NSScreen *screen = [[view window] screen];
@@ -3072,6 +3075,7 @@ The coordinates X and Y are interpreted in pixels relative to a position
3072 3075
3073 CGPoint mouse_pos = CGPointMake(mouse_x, mouse_y); 3076 CGPoint mouse_pos = CGPointMake(mouse_x, mouse_y);
3074 CGWarpMouseCursorPosition (mouse_pos); 3077 CGWarpMouseCursorPosition (mouse_pos);
3078#endif /* NS_IMPL_COCOA */
3075 3079
3076 return Qnil; 3080 return Qnil;
3077} 3081}
diff --git a/src/nsterm.h b/src/nsterm.h
index 5da949e1fb1..443a40ed6f5 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -62,6 +62,13 @@ typedef CGFloat EmacsCGFloat;
62typedef float EmacsCGFloat; 62typedef float EmacsCGFloat;
63#endif 63#endif
64 64
65/* FIXME: It looks as though instancetype will be supported in GNUstep
66 at some point, but I'm not sure what version. */
67#ifdef NS_IMPL_GNUSTEP
68typedef id instancetype;
69typedef int NSWindowStyleMask;
70#endif
71
65/* ========================================================================== 72/* ==========================================================================
66 73
67 Trace support 74 Trace support
@@ -1290,6 +1297,7 @@ extern char gnustep_base_version[]; /* version tracking */
1290#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask 1297#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
1291#define NSWindowStyleMaskResizable NSResizableWindowMask 1298#define NSWindowStyleMaskResizable NSResizableWindowMask
1292#define NSWindowStyleMaskTitled NSTitledWindowMask 1299#define NSWindowStyleMaskTitled NSTitledWindowMask
1300#define NSWindowStyleMaskUtilityWindow NSUtilityWindowMask
1293#define NSAlertStyleCritical NSCriticalAlertStyle 1301#define NSAlertStyleCritical NSCriticalAlertStyle
1294#define NSControlSizeRegular NSRegularControlSize 1302#define NSControlSizeRegular NSRegularControlSize
1295#endif 1303#endif