#ifndef MAC_OS_X_VERSION_10_8
#define MAC_OS_X_VERSION_10_8 1080
#endif
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+#define HAVE_NATIVE_FS
+#endif
+
#endif /* NS_IMPL_COCOA */
#ifdef __OBJC__
+/* CGFloat on GNUStep may be 4 or 8 byte, but functions expect float* for some
+ versions.
+ On Cocoa, functions expect CGFloat*. Make compatible type. */
+#if defined (NS_IMPL_COCOA) || GNUSTEP_GUI_MAJOR_VERSION > 0 || \
+ GNUSTEP_GUI_MINOR_VERSION >= 22
+typedef CGFloat EmacsCGFloat;
+#else
+typedef float EmacsCGFloat;
+#endif
+
/* ==========================================================================
The Emacs application
/* We override sendEvent: as a means to stop/start the event loop */
@interface EmacsApp : NSApplication
{
+#ifdef NS_IMPL_GNUSTEP
+@public
+ int nextappdefined;
+#endif
}
- (void)logNotification: (NSNotification *)notification;
- (void)sendEvent: (NSEvent *)theEvent;
- (void)fd_handler: (id)unused;
- (void)timeout_handler: (NSTimer *)timedEntry;
- (BOOL)fulfillService: (NSString *)name withArg: (NSString *)arg;
+#ifdef NS_IMPL_GNUSTEP
+- (void)sendFromMainThread:(id)unused;
+#endif
@end
+#ifdef NS_IMPL_GNUSTEP
+/* Dummy class to get rid of startup warnings. */
+@interface EmacsDocument : NSDocument
+{
+}
+@end
+#endif
/* ==========================================================================
int tibar_height, tobar_height, bwidth;
int maximized_width, maximized_height;
NSWindow *nonfs_window;
+ BOOL fs_is_native;
@public
struct frame *emacsframe;
int rows, cols;
- (void) handleFS;
- (void) setFSValue: (int)value;
- (void) toggleFullScreen: (id) sender;
+- (BOOL) fsIsNative;
+- (BOOL) isFullscreen;
+#ifdef HAVE_NATIVE_FS
+- (void) updateCollectionBehaviour;
+#endif
#ifdef NS_IMPL_GNUSTEP
-/* Not declared, but useful. */
-- (void) unlockFocusNeedsFlush: (BOOL)needs;
+- (void)windowDidMove: (id)sender;
#endif
@end
}
- initForView: (EmacsView *)view withIdentifier: (NSString *)identifier;
- (void) clearActive;
+- (void) clearAll;
- (BOOL) changed;
-- (void) addDisplayItemWithImage: (EmacsImage *)img idx: (int)idx
+- (void) addDisplayItemWithImage: (EmacsImage *)img
+ idx: (int)idx
+ tag: (int)tag
helpText: (const char *)help
enabled: (BOOL)enabled;
+
/* delegate methods */
- (NSToolbarItem *)toolbar: (NSToolbar *)toolbar
itemForItemIdentifier: (NSString *)itemIdentifier
NSResponder *prevResponder;
/* offset to the bottom of knob of last mouse down */
- float last_mouse_offset;
+ CGFloat last_mouse_offset;
float min_portion;
int pixel_height;
int last_hit_part;
extern struct ns_display_info *ns_display_info_for_name (Lisp_Object name);
struct ns_display_info *check_x_display_info (Lisp_Object frame);
-FRAME_PTR check_x_frame (Lisp_Object frame);
-
struct ns_output
{
#define FRAME_FONT(f) ((f)->output_data.ns->font)
#ifdef __OBJC__
-#define XNS_SCROLL_BAR(vec) ((id) XSAVE_VALUE (vec)->pointer)
+#define XNS_SCROLL_BAR(vec) ((id) XSAVE_POINTER (vec, 0))
#else
-#define XNS_SCROLL_BAR(vec) XSAVE_VALUE (vec)->pointer
+#define XNS_SCROLL_BAR(vec) XSAVE_POINTER (vec, 0)
#endif
/* Compute pixel size for vertical scroll bars */
extern const char *ns_xlfd_to_fontname (const char *xlfd);
-extern void check_ns (void);
extern Lisp_Object ns_map_event_to_object (void);
#ifdef __OBJC__
extern Lisp_Object ns_string_from_pasteboard (id pb);
extern NSColor *ns_lookup_indexed_color (unsigned long idx, struct frame *f);
extern unsigned long ns_index_color (NSColor *color, struct frame *f);
extern void ns_free_indexed_color (unsigned long idx, struct frame *f);
+extern const char *ns_get_pending_menu_title (void);
+extern void ns_check_menu_open (NSMenu *menu);
+extern void ns_check_pending_open_menu (void);
#endif
/* C access to ObjC functionality */
extern int x_display_pixel_width (struct ns_display_info *);
/* This in nsterm.m */
+extern void x_destroy_window (struct frame *f);
extern int ns_select (int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, EMACS_TIME *timeout,
sigset_t *sigmask);