Refactor window-system configuration
[bpt/emacs.git] / src / nsterm.h
index 52246ca..f0cae19 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions and headers for communication with NeXT/Open/GNUstep API.
-   Copyright (C) 1989, 1993, 2005, 2008-2011 Free Software Foundation, Inc.
+   Copyright (C) 1989, 1993, 2005, 2008-2012 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -56,7 +56,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 - (void)sendEvent: (NSEvent *)theEvent;
 - (void)showPreferencesWindow: (id)sender;
 - (BOOL) openFile: (NSString *)fileName;
-- (void)fd_handler: (NSTimer *) fdEntry;
+- (void)fd_handler: (id)unused;
 - (void)timeout_handler: (NSTimer *)timedEntry;
 - (BOOL)fulfillService: (NSString *)name withArg: (NSString *)arg;
 @end
@@ -89,7 +89,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    }
 
 /* AppKit-side interface */
-- menuDown: sender;
+- menuDown: (id)sender;
 - toolbarClicked: (id)item;
 - toggleToolbar: (id)sender;
 - (void)keyDown: (NSEvent *)theEvent;
@@ -195,12 +195,17 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    NSTextField *title;
    NSMatrix *matrix;
    int rows, cols;
+   BOOL timer_fired, window_closed;
+   Lisp_Object dialog_return;
+   Lisp_Object *button_values;
    }
 - initFromContents: (Lisp_Object)menu isQuestion: (BOOL)isQ;
-- addButton: (char *)str value: (Lisp_Object)val row: (int)row;
-- addString: (char *)str row: (int)row;
-- addSplit;
+- (void)process_dialog: (Lisp_Object)list;
+- (void)addButton: (char *)str value: (int)tag row: (int)row;
+- (void)addString: (char *)str row: (int)row;
+- (void)addSplit;
 - (Lisp_Object)runDialogAt: (NSPoint)p;
+- (void)timeout_handler: (NSTimer *)timedEntry;
 @end
 
 #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
@@ -448,7 +453,10 @@ struct nsfont_info
   struct font font;
 
   char *name;  /* PostScript name, uniquely identifies on NS systems */
-  float width;  /* this and following metrics stored as float rather than int */
+
+  /* The following metrics are stored as float rather than int. */
+
+  float width;  /* Maximum advance for the font.  */
   float height;
   float underpos;
   float underwidth;
@@ -535,7 +543,7 @@ struct ns_display_info
 extern struct ns_display_info *x_display_list;
 
 extern Lisp_Object ns_display_name_list;
-extern struct ns_display_info *ns_display_info_for_name ();
+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);
@@ -623,6 +631,8 @@ struct x_output
 /* This is the `Display *' which frame F is on.  */
 #define FRAME_NS_DISPLAY(f) (0)
 #define FRAME_X_DISPLAY(f) (0)
+#define FRAME_X_SCREEN(f) (0)
+#define FRAME_X_VISUAL(f) FRAME_NS_DISPLAY_INFO(f)->visual
 
 #define FRAME_FOREGROUND_COLOR(f) ((f)->output_data.ns->foreground_color)
 #define FRAME_BACKGROUND_COLOR(f) ((f)->output_data.ns->background_color)
@@ -697,7 +707,7 @@ struct x_output
   (! (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)) ? 0 \
    : FRAME_SCROLL_BAR_COLS (f))
 
-extern struct ns_display_info *ns_term_init ();
+extern struct ns_display_info *ns_term_init (Lisp_Object display_name);
 extern void ns_term_shutdown (int sig);
 
 /* constants for text rendering */
@@ -707,8 +717,6 @@ extern void ns_term_shutdown (int sig);
 #define NS_DUMPGLYPH_MOUSEFACE          3
 
 
-EXFUN (Fx_display_grayscale_p, 1);
-EXFUN (Fx_display_planes, 1);
 
 /* In nsfont, called from fontset.c */
 extern void nsfont_make_fontset_for_font (Lisp_Object name,
@@ -727,15 +735,16 @@ extern void ns_clear_frame (struct frame *f);
 extern const char *ns_xlfd_to_fontname (const char *xlfd);
 
 extern void check_ns (void);
-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_map_event_to_object (void);
+#ifdef __OBJC__
+extern Lisp_Object ns_string_from_pasteboard (id pb);
+extern void ns_string_to_pasteboard (id pb, Lisp_Object str);
+#endif
 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 void nxatoms_of_nsselect (void);
+extern int ns_lisp_to_cursor_type (Lisp_Object arg);
 extern Lisp_Object ns_cursor_type_to_lisp (int arg);
-extern Lisp_Object Qnone;
 extern void ns_set_name_as_filename (struct frame *f);
 extern void ns_set_doc_edited (struct frame *f, Lisp_Object arg);
 
@@ -758,8 +767,9 @@ extern void ns_free_indexed_color (unsigned long idx, struct frame *f);
 /* C access to ObjC functionality */
 extern void  ns_release_object (void *obj);
 extern void  ns_retain_object (void *obj);
-extern void *ns_alloc_autorelease_pool ();
-extern void ns_release_autorelease_pool ();
+extern void *ns_alloc_autorelease_pool (void);
+extern void ns_release_autorelease_pool (void *);
+extern const char *ns_get_defaults_value (const char *key);
 
 /* in nsmenu */
 extern void update_frame_tool_bar (FRAME_PTR f);
@@ -772,33 +782,12 @@ extern Lisp_Object find_and_return_menu_selection (FRAME_PTR f,
 extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object contents,
                                     Lisp_Object header);
 
-/* More prototypes that should be moved to a more general include file */
-extern void set_frame_menubar (struct frame *f, int first_time, int deep_p);
-extern void x_set_window_size (struct frame *f, int change_grav,
-                              int cols, int rows);
-extern void x_sync (struct frame *);
-extern Lisp_Object x_get_focus_frame (struct frame *);
-extern void x_set_mouse_position (struct frame *f, int h, int v);
-extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
-extern void x_make_frame_visible (struct frame *f);
-extern void x_make_frame_invisible (struct frame *f);
-extern void x_iconify_frame (struct frame *f);
-extern int x_char_width (struct frame *f);
-extern int x_char_height (struct frame *f);
-extern int x_pixel_width (struct frame *f);
-extern int x_pixel_height (struct frame *f);
-extern void x_set_frame_alpha (struct frame *f);
-extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
-extern void x_set_tool_bar_lines (struct frame *f,
-                                  Lisp_Object value,
-                                  Lisp_Object oldval);
-extern void x_activate_menubar (struct frame *);
-extern void free_frame_menubar (struct frame *);
-
 #define NSAPP_DATA2_RUNASSCRIPT 10
 extern void ns_run_ascript (void);
 
-extern void ns_init_paths (void);
+extern const char *ns_etc_directory (void);
+extern const char *ns_exec_path (void);
+extern const char *ns_load_path (void);
 extern void syms_of_nsterm (void);
 extern void syms_of_nsfns (void);
 extern void syms_of_nsmenu (void);
@@ -822,7 +811,8 @@ extern int x_display_pixel_width (struct ns_display_info *);
 
 /* This in nsterm.m */
 extern int ns_select (int nfds, fd_set *readfds, fd_set *writefds,
-                      fd_set *exceptfds, struct timeval *timeout);
+                      fd_set *exceptfds, EMACS_TIME *timeout,
+                     sigset_t *sigmask);
 extern unsigned long ns_get_rgb_color (struct frame *f,
                                        float r, float g, float b, float a);
 extern NSPoint last_mouse_motion_position;