/* Definitions and headers for communication with NeXT/Open/GNUstep API.
- Copyright (C) 1989, 1993, 2005, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1993, 2005, 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#ifdef HAVE_NS
+#ifdef NS_IMPL_COCOA
+#ifndef MAC_OS_X_VERSION_10_3
+#define MAC_OS_X_VERSION_10_3 1030
+#endif
+#ifndef MAC_OS_X_VERSION_10_4
+#define MAC_OS_X_VERSION_10_4 1040
+#endif
+#ifndef MAC_OS_X_VERSION_10_5
+#define MAC_OS_X_VERSION_10_5 1050
+#endif
+#ifndef MAC_OS_X_VERSION_10_6
+#define MAC_OS_X_VERSION_10_6 1060
+#endif
+#endif /* NS_IMPL_COCOA */
+
#ifdef __OBJC__
/* ==========================================================================
@class EmacsToolbar;
-@interface EmacsView : NSView <NSTextInput> /* 10.6+: NSWindowDelegate */
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+@interface EmacsView : NSView <NSTextInput, NSWindowDelegate>
+#else
+@interface EmacsView : NSView <NSTextInput>
+#endif
{
char *old_title;
BOOL windowClosing;
int rows, cols;
int scrollbarsNeedingUpdate;
EmacsToolbar *toolbar;
+ NSRect ns_userRect;
}
/* AppKit-side interface */
========================================================================== */
-@interface EmacsMenu : NSMenu /* 10.6+: <NSMenuDelegate> */
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+@interface EmacsMenu : NSMenu <NSMenuDelegate>
+#else
+@interface EmacsMenu : NSMenu
+#endif
{
struct frame *frame;
unsigned long keyEquivModMask;
@class EmacsImage;
-@interface EmacsToolbar : NSToolbar /* 10.6+: <NSToolbarDelegate> */
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+@interface EmacsToolbar : NSToolbar <NSToolbarDelegate>
+#else
+@interface EmacsToolbar : NSToolbar
+#endif
{
EmacsView *emacsView;
NSMutableDictionary *identifierToItem;
- (Lisp_Object)runDialogAt: (NSPoint)p;
@end
-@interface EmacsTooltip : NSObject /* 10.6+: <NSWindowDelegate> */
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+@interface EmacsTooltip : NSObject <NSWindowDelegate>
+#else
+@interface EmacsTooltip : NSObject
+#endif
{
NSWindow *win;
NSTextField *textField;
/* this to map between emacs color indices and NSColor objects */
struct ns_color_table
{
- unsigned int size;
- unsigned int avail;
+ ptrdiff_t size;
+ ptrdiff_t avail;
#ifdef __OBJC__
NSColor **colors;
NSMutableSet *empty_indices;
#endif
char bold, ital; /* convenience flags */
char synthItal;
- float voffset; /* mean of ascender/descender offsets */
XCharStruct max_bounds;
/* we compute glyph codes and metrics on-demand in blocks of 256 indexed
by hibyte, lobyte */
int smallest_font_height;
struct ns_bitmap_record *bitmaps;
- int bitmaps_size;
- int bitmaps_last;
+ ptrdiff_t bitmaps_size;
+ ptrdiff_t bitmaps_last;
struct image_cache *image_cache;
/* The cursor to use for vertical scroll bars. */
Cursor vertical_scroll_bar_cursor;
- /* most mouse face stuff moved in here as of 21+ (and reasonably so) */
- int mouse_face_beg_row, mouse_face_beg_col;
- int mouse_face_end_row, mouse_face_end_col;
- int mouse_face_beg_x, mouse_face_beg_y;
- int mouse_face_end_x, mouse_face_end_y;
- int mouse_face_past_end;
- Lisp_Object mouse_face_window;
- int mouse_face_face_id;
- int mouse_face_deferred_gc;
- Lisp_Object mouse_face_overlay;
- FRAME_PTR mouse_face_mouse_frame;
- int mouse_face_mouse_x, mouse_face_mouse_y;
- int mouse_face_defer;
- int mouse_face_hidden;
- int mouse_face_image_state;
+ /* Information about the range of text currently shown in
+ mouse-face. */
+ Mouse_HLInfo mouse_highlight;
struct frame *x_highlight_frame;
struct frame *x_focus_frame;
/* This is the Emacs structure for the NS display this frame is on. */
struct ns_display_info *display_info;
+
+ /* Non-zero if we want to constrain the frame to the screen. */
+ int dont_constrain;
+
+ /* Non-zero if we are zooming (maximizing) the frame. */
+ int zooming;
};
/* this dummy decl needed to support TTYs */
extern Lisp_Object ns_map_event_to_object ();
extern Lisp_Object ns_string_from_pasteboard ();
extern void ns_string_to_pasteboard ();
+extern Lisp_Object ns_get_local_selection (Lisp_Object selection_name,
+ Lisp_Object target_type);
extern void nxatoms_of_nsselect ();
extern int ns_lisp_to_cursor_type ();
extern Lisp_Object ns_cursor_type_to_lisp (int arg);
float r, float g, float b, float a);
extern NSPoint last_mouse_motion_position;
+/* From nsterm.m, needed in nsfont.m. */
+#ifdef __OBJC__
+extern void
+ns_draw_text_decoration (struct glyph_string *s, struct face *face,
+ NSColor *defaultCol, CGFloat width, CGFloat x);
+#endif
+
#ifdef NS_IMPL_GNUSTEP
extern char gnustep_base_version[]; /* version tracking */
#endif
#endif /* HAVE_NS */
-
-/* arch-tag: 0a28b142-4ac1-4a81-a243-abcd82d9c4e5
- (do not change this comment) */