]> code.delx.au - gnu-emacs/blobdiff - src/nsterm.h
Fix last set of Nextstep changes.
[gnu-emacs] / src / nsterm.h
index 351c5160fe42e9cff2e7abe403fd08d71ae52456..01086e63b698fa9856b45d22f86fca37f8b8f282 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions and headers for communication with NeXT/Open/GNUstep API.
-   Copyright (C) 1989, 1993, 2005, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1989, 1993, 2005, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -54,7 +54,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 @class EmacsToolbar;
 
-@interface EmacsView : NSView <NSTextInput>
+@interface EmacsView : NSView <NSTextInput> /* 10.6+: NSWindowDelegate */
    {
    char *old_title;
    BOOL windowClosing;
@@ -104,7 +104,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
    ========================================================================== */
 
-@interface EmacsMenu : NSMenu
+@interface EmacsMenu : NSMenu  /* 10.6+: <NSMenuDelegate> */
 {
   struct frame *frame;
   unsigned long keyEquivModMask;
@@ -131,7 +131,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 @class EmacsImage;
 
-@interface EmacsToolbar : NSToolbar
+@interface EmacsToolbar : NSToolbar  /* 10.6+: <NSToolbarDelegate> */
    {
      EmacsView *emacsView;
      NSMutableDictionary *identifierToItem;
@@ -174,7 +174,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 - (Lisp_Object)runDialogAt: (NSPoint)p;
 @end
 
-@interface EmacsTooltip : NSObject
+@interface EmacsTooltip : NSObject  /* 10.6+: <NSWindowDelegate> */
   {
     NSWindow *win;
     NSTextField *textField;
@@ -317,49 +317,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 @end
 #endif /* NS_IMPL_COCOA */
 
-
-/* ==========================================================================
-
-   Running the preferences window
-
-   ========================================================================== */
-
-@interface EmacsPrefsController : NSObject
-{
-    struct frame *frame;
-    IBOutlet NSWindow *prefsWindow;
-    IBOutlet NSPopUpButton *alternateModMenu;
-    IBOutlet NSPopUpButton *commandModMenu;
-#ifdef NS_IMPL_COCOA
-    IBOutlet NSPopUpButton *controlModMenu;
-    IBOutlet NSPopUpButton *functionModMenu;
-#endif
-    IBOutlet NSMatrix *cursorTypeMatrix;
-    IBOutlet NSSlider *cursorBlinkSlider;
-    IBOutlet NSSlider *expandSpaceSlider;
-#ifdef NS_IMPL_COCOA
-    IBOutlet NSButton *smoothFontsCheck;
-    IBOutlet NSButton *useQuickdrawCheck;
-    IBOutlet NSButton *useSysHiliteCheck;
-    Lisp_Object prevUseHighlightColor;
-#endif
-    float prevExpandSpace;
-    float prevBlinkRate;
-}
-- (IBAction)cancel: (id)sender;
-- (IBAction)ok: (id)sender;
-- (IBAction)resetToDefaults: (id)sender;
-- (IBAction)runHelp: (id)sender;
-- (IBAction)setColors: (id)sender;
-- (IBAction)setDefaultFont: (id)sender;
-
-- (void) showForFrame: (struct frame *)f;
-- (void) setPanelFromValues;
-- (void) setPanelFromDefaultValues;
-- (void) setValuesFromPanel;
-@end
-
 extern NSArray *ns_send_types, *ns_return_types;
+extern NSString *ns_app_name;
 extern EmacsMenu *mainMenu, *svcsMenu, *dockMenu;
 
 /* Apple removed the declaration, but kept the implementation */
@@ -370,8 +329,15 @@ extern EmacsMenu *mainMenu, *svcsMenu, *dockMenu;
 #endif
 
 #ifndef NS_HAVE_NSINTEGER
+#if defined(__LP64__) && __LP64__
+typedef double CGFloat;
 typedef long NSInteger;
 typedef unsigned long NSUInteger;
+#else
+typedef float CGFloat;
+typedef int NSInteger;
+typedef unsigned int NSUInteger;
+#endif /* not LP64 */
 #endif /* not NS_HAVE_NSINTEGER */
 
 #endif  /* __OBJC__ */
@@ -384,6 +350,22 @@ typedef unsigned long NSUInteger;
 
    ========================================================================== */
 
+/* Special keycodes that we pass down the event chain */
+#define KEY_NS_POWER_OFF               ((1<<28)|(0<<16)|1)
+#define KEY_NS_OPEN_FILE               ((1<<28)|(0<<16)|2)
+#define KEY_NS_OPEN_TEMP_FILE          ((1<<28)|(0<<16)|3)
+#define KEY_NS_DRAG_FILE               ((1<<28)|(0<<16)|4)
+#define KEY_NS_DRAG_COLOR              ((1<<28)|(0<<16)|5)
+#define KEY_NS_DRAG_TEXT               ((1<<28)|(0<<16)|6)
+#define KEY_NS_CHANGE_FONT             ((1<<28)|(0<<16)|7)
+#define KEY_NS_OPEN_FILE_LINE          ((1<<28)|(0<<16)|8)
+#define KEY_NS_PUT_WORKING_TEXT        ((1<<28)|(0<<16)|9)
+#define KEY_NS_UNPUT_WORKING_TEXT      ((1<<28)|(0<<16)|10)
+#define KEY_NS_SPI_SERVICE_CALL        ((1<<28)|(0<<16)|11)
+#define KEY_NS_NEW_FRAME               ((1<<28)|(0<<16)|12)
+#define KEY_NS_TOGGLE_TOOLBAR          ((1<<28)|(0<<16)|13)
+#define KEY_NS_SHOW_PREFS              ((1<<28)|(0<<16)|14)
+
 /* 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
@@ -453,7 +435,7 @@ struct nsfont_info
   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 */
@@ -483,38 +465,33 @@ struct ns_display_info
   /* 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: DPI resolution of this screen */
+  /* 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;
@@ -540,8 +517,6 @@ 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 ();
 
-/* 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);
 
@@ -564,7 +539,7 @@ struct ns_output
   void *toolbar;
 #endif
 
-  /* 23: NSCursors init'ed in initFrameFromEmacs */
+  /* NSCursors init'ed in initFrameFromEmacs */
   Cursor text_cursor;
   Cursor nontext_cursor;
   Cursor modeline_cursor;
@@ -572,10 +547,10 @@ struct ns_output
   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;
 
@@ -603,7 +578,7 @@ struct ns_output
   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;
@@ -680,7 +655,6 @@ struct x_output
 
 #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) \
@@ -716,7 +690,7 @@ extern void nsfont_make_fontset_for_font (Lisp_Object name,
 
 /* In nsfont, for debugging */
 struct glyph_string;
-void dump_glyphstring (struct glyph_string *s);
+void ns_dump_glyphstring (struct glyph_string *s);
 
 /* Implemented in nsterm, published in or needed from nsfns. */
 extern Lisp_Object Qfontsize;
@@ -734,12 +708,14 @@ extern void nxatoms_of_nsselect ();
 extern int ns_lisp_to_cursor_type ();
 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);
 
-/* XColor defined in dispextern.h (we use color_def->pixel = NSColor id), but
-   this causes an #include snafu, so we can't declare it.  */
 extern int
 ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc,
                   char makeIndex);
+extern void
+ns_query_color (void *col, XColor *color_def, int setPixel);
 
 #ifdef __OBJC__
 extern Lisp_Object ns_color_to_lisp (NSColor *col);
@@ -813,7 +789,7 @@ extern char gnustep_base_version[];  /* version tracking */
                                 ? (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)