/* Definitions and headers for communication with NeXT/Open/GNUstep API.
- Copyright (C) 1989, 1993, 2005, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1993, 2005, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@interface EmacsApp : NSApplication
{
}
+- (void)logNotification: (NSNotification *)notification;
- (void)sendEvent: (NSEvent *)theEvent;
- (void)showPreferencesWindow: (id)sender;
+- (BOOL) openFile: (NSString *)fileName;
+- (void)fd_handler: (NSTimer *) fdEntry;
+- (void)timeout_handler: (NSTimer *)timedEntry;
+- (BOOL)fulfillService: (NSString *)name withArg: (NSString *)arg;
@end
- (void) setWindowClosing: (BOOL)closing;
- (EmacsToolbar *) toolbar;
- (void) deleteWorkingText;
+
+#ifdef NS_IMPL_GNUSTEP
+/* Not declared, but useful. */
+- (void) unlockFocusNeedsFlush: (BOOL)needs;
+#endif
@end
- (void)setFrame: (struct frame *)f;
- (void)menuNeedsUpdate: (NSMenu *)menu; /* (delegate method) */
- (NSString *)parseKeyEquiv: (char *)key;
-- (id <NSMenuItem>)addItemWithWidgetValue: (void *)wvptr;
+- (NSMenuItem *)addItemWithWidgetValue: (void *)wvptr;
- (void)fillWithWidgetValue: (void *)wvptr;
- (EmacsMenu *)addSubmenuWithTitle: (char *)title forFrame: (struct frame *)f;
- (void) clear;
- (void) showForFrame: (struct frame *)f;
- (void) setPanelFromValues;
+- (void) setPanelFromDefaultValues;
- (void) setValuesFromPanel;
@end
extern NSArray *ns_send_types, *ns_return_types;
-extern EmacsMenu *mainMenu, *svcsMenu;
+extern EmacsMenu *mainMenu, *svcsMenu, *dockMenu;
/* Apple removed the declaration, but kept the implementation */
-#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
@interface NSApplication (EmacsApp)
- (void)setAppleMenu: (NSMenu *)menu;
@end
#endif
+#ifndef NS_HAVE_NSINTEGER
+typedef long NSInteger;
+typedef unsigned long NSUInteger;
+#endif /* not NS_HAVE_NSINTEGER */
+
#endif /* __OBJC__ */
========================================================================== */
-enum ns_cursor_types
-{
- no_highlight =0,
- filled_box,
- hollow_box,
- underscore,
- bar
-};
-
-
/* could use list to store these, but rest of emacs has a big infrastructure
for managing a table of bitmap "records" */
struct ns_bitmap_record
char bold, ital; /* convenience flags */
char synthItal;
float voffset; /* mean of ascender/descender offsets */
- XCharStruct max_bounds; /* 23 */
+ XCharStruct max_bounds;
/* we compute glyph codes and metrics on-demand in blocks of 256 indexed
by hibyte, lobyte */
unsigned short **glyphs; /* map unicode index to glyph */
/* Minimum font height over all fonts in font_table. */
int smallest_font_height;
- /*/23 */
struct ns_bitmap_record *bitmaps;
int bitmaps_size;
int bitmaps_last;
- /* 23 */
struct image_cache *image_cache;
struct ns_color_table *color_table;
- /* 23: Dimensions and DPI resolution of this screen */
- int height, width;
+ /* DPI resolution of this screen */
double resx, resy;
- /* 23: Mask of things that cause the mouse to be grabbed */
+ /* Mask of things that cause the mouse to be grabbed */
int grabbed;
- /* 23 */
int n_planes;
- /* 23 */
int color_p;
- /* 23 */
Window root_window;
- /* 23: Xism */
+ /* Xism */
XrmDatabase xrdb;
- /* 23: The cursor to use for vertical scroll bars. */
+ /* The cursor to use for vertical scroll bars. */
Cursor vertical_scroll_bar_cursor;
- /* 23: most mouse face stuff moved in here (and reasonably so) */
+ /* 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;
extern Lisp_Object ns_display_name_list;
extern struct ns_display_info *ns_display_info_for_name ();
-/* 23: FIXME: these functions (we defined in nsfns) are used in various
- places, but no prototypes are provided */
struct ns_display_info *check_x_display_info (Lisp_Object frame);
FRAME_PTR check_x_frame (Lisp_Object frame);
#ifdef __OBJC__
EmacsView *view;
id miniimage;
- NSColor *current_cursor_color;
- NSColor *desired_cursor_color;
+ NSColor *cursor_color;
NSColor *foreground_color;
NSColor *background_color;
EmacsToolbar *toolbar;
#else
void *view;
void *miniimage;
- void *current_cursor_color;
- void *desired_cursor_color;
+ void *cursor_color;
void *foreground_color;
void *background_color;
void *toolbar;
#endif
- /* 23: NSCursors init'ed in initFrameFromEmacs */
+ /* NSCursors init'ed in initFrameFromEmacs */
Cursor text_cursor;
Cursor nontext_cursor;
Cursor modeline_cursor;
Cursor hourglass_cursor;
Cursor horizontal_drag_cursor;
- /* 23: NS-specific */
+ /* NS-specific */
Cursor current_pointer;
- /* 23: lord knows why Emacs needs to know about our Window ids.. */
+ /* lord knows why Emacs needs to know about our Window ids.. */
Window window_desc, parent_desc;
char explicit_parent;
Lisp_Object icon_top;
Lisp_Object icon_left;
- enum ns_cursor_types current_cursor, desired_cursor;
- unsigned char last_inactive;
/* The size of the extra width currently allotted for vertical
scroll bars, in pixels. */
struct ns_display_info *display_info;
};
-/* 23: this dummy decl now needed to support TTYs */
+/* this dummy decl needed to support TTYs */
struct x_output
{
unsigned long background_pixel;
#define FRAME_DEFAULT_FACE(f) FACE_FROM_ID (f, DEFAULT_FACE_ID)
#define FRAME_NS_VIEW(f) ((f)->output_data.ns->view)
-#define FRAME_CURSOR(f) ((f)->output_data.ns->current_cursor)
-#define FRAME_CURSOR_COLOR(f) ((f)->output_data.ns->current_cursor_color)
-#define FRAME_NEW_CURSOR_COLOR(f) ((f)->output_data.ns->desired_cursor_color)
-#define FRAME_NEW_CURSOR(f) ((f)->output_data.ns->desired_cursor)
+#define FRAME_CURSOR_COLOR(f) ((f)->output_data.ns->cursor_color)
#define FRAME_POINTER_TYPE(f) ((f)->output_data.ns->current_pointer)
-#define FRAME_LAST_INACTIVE(f) ((f)->output_data.ns->last_inactive)
#define FRAME_FONT(f) ((f)->output_data.ns->font)
#define FRAME_FONTSET(f) ((f)->output_data.ns->fontset)
-/* 23 */
#define FRAME_SMALLEST_CHAR_WIDTH(f) \
(FRAME_NS_DISPLAY_INFO (f)->smallest_char_width)
#define FRAME_SMALLEST_FONT_HEIGHT(f) \
int size, int maxnames);
extern void ns_clear_frame (struct frame *f);
-#ifdef __OBJC__
-extern const char *ns_font_to_xlfd (NSFont *font);
-#endif
-extern const char *ns_fontname_to_xlfd (const char *name);
extern const char *ns_xlfd_to_fontname (const char *xlfd);
extern void check_ns (void);
extern void update_frame_tool_bar (FRAME_PTR f);
extern void free_frame_tool_bar (FRAME_PTR f);
extern void find_and_call_menu_selection (FRAME_PTR f,
- EMACS_INT menu_bar_items_used, Lisp_Object vector, void *client_data);
+ int menu_bar_items_used, Lisp_Object vector, void *client_data);
extern Lisp_Object find_and_return_menu_selection (FRAME_PTR f,
int keymaps,
void *client_data);
extern void ns_put_pixel (void *img, int x, int y, unsigned long argb);
extern void ns_set_alpha (void *img, int x, int y, unsigned char a);
+extern int x_display_pixel_height P_ ((struct ns_display_info *));
+extern int x_display_pixel_width P_ ((struct ns_display_info *));
+
/* This in nsterm.m */
extern unsigned long ns_get_rgb_color (struct frame *f,
float r, float g, float b, float a);
? (min) : (((x)>(max)) ? (max) : (x)))
#define SCREENMAXBOUND(x) (IN_BOUND (-SCREENMAX, x, SCREENMAX))
-/* 23: needed somewhere... */
+/* needed somewhere... */
#define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)