]> code.delx.au - gnu-emacs/blobdiff - src/macterm.h
*** empty log message ***
[gnu-emacs] / src / macterm.h
index 1c967e3274161d792863874943bf0022f1a14c2b..945dbf3af571453c086d552f7e746222d2da53a6 100644 (file)
@@ -1,6 +1,6 @@
 /* Display module for Mac OS.
    Copyright (C) 2000, 2001, 2002, 2003, 2004,
-                 2005 Free Software Foundation, Inc.
+                 2005, 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -79,7 +79,7 @@ struct mac_display_info
   /* Number of planes on this screen.  */
   int n_planes;
 
-  /* Whether the screen supports color */ 
+  /* Whether the screen supports color */
   int color_p;
 
   /* Dimensions of this screen.  */
@@ -206,9 +206,6 @@ extern struct mac_display_info one_mac_display_info;
    FONT-LIST-CACHE records previous values returned by x-list-fonts.  */
 extern Lisp_Object x_display_name_list;
 
-/* A flag to control how to display unibyte 8-bit character.  */
-extern int unibyte_display_via_language_environment;
-
 extern struct x_display_info *x_display_info_for_display P_ ((Display *));
 extern struct x_display_info *x_display_info_for_name P_ ((Lisp_Object));
 
@@ -322,9 +319,6 @@ struct mac_output {
   /* Nonzero means menubar is currently active.  */
   char menubar_active;
 
-  /* Nonzero means a menu command is being processed.  */
-  char menu_command_in_progress;
-
   /* Relief GCs, colors etc.  */
   struct relief
   {
@@ -340,6 +334,11 @@ struct mac_output {
 
   /* Hints for the size and the position of a window.  */
   XSizeHints *size_hints;
+
+#if USE_CG_DRAWING
+  /* Quartz 2D graphics context.  */
+  CGContextRef cg_context;
+#endif
 };
 
 typedef struct mac_output mac_output;
@@ -525,10 +524,61 @@ struct scroll_bar {
    text from glomming up against the scroll bar */
 #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)
 
+/* Variations of possible Aqua scroll bar width.  */
+#define MAC_AQUA_VERTICAL_SCROLL_BAR_WIDTH (15)
+#define MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH (11)
+
 /* Size of hourglass controls */
 #define HOURGLASS_WIDTH 16
 #define HOURGLASS_HEIGHT 16
 
+/* Some constants that are used locally.  */
+/* Apple event descriptor types */
+enum {
+  TYPE_FILE_NAME               = 'fNam'
+};
+
+/* Keywords for Apple event attributes */
+enum {
+  KEY_EMACS_SUSPENSION_ID_ATTR = 'esId' /* typeUInt32 */
+};
+
+/* Carbon event parameter names.  */
+enum {
+  EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER = 'tsSn' /* typeUInt32 */
+};
+
+/* Some constants that are not defined in older versions.  */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
+/* Keywords for Apple event attributes */
+enum {
+  keyReplyRequestedAttr                = 'repq'
+};
+#endif
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
+/* Gestalt selectors */
+enum {
+  gestaltSystemVersionMajor    = 'sys1',
+  gestaltSystemVersionMinor    = 'sys2',
+  gestaltSystemVersionBugFix   = 'sys3'
+};
+#endif
+
+#ifdef MAC_OSX
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1020
+/* Apple event descriptor types */
+enum {
+  typeUTF8Text                 = 'utf8'
+};
+
+/* Carbon event parameter names */
+enum {
+  kEventParamWindowMouseLocation = 'wmou'
+};
+#endif
+#endif
+
 struct frame;
 struct face;
 struct image;
@@ -547,7 +597,15 @@ extern int XParseGeometry P_ ((char *, int *, int *, unsigned int *,
 /* Defined in macterm.c.  */
 
 extern void x_set_window_size P_ ((struct frame *, int, int, int));
+extern void x_set_mouse_position P_ ((struct frame *, int, int));
+extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int));
 extern void x_make_frame_visible P_ ((struct frame *));
+extern void x_make_frame_invisible P_ ((struct frame *));
+extern void x_iconify_frame P_ ((struct frame *));
+extern void x_free_frame_resources P_ ((struct frame *));
+extern void x_destroy_window P_ ((struct frame *));
+extern void x_wm_set_size_hint P_ ((struct frame *, long, int));
+extern void x_delete_display P_ ((struct x_display_info *));
 extern void mac_initialize P_ ((void));
 extern Pixmap XCreatePixmap P_ ((Display *, WindowPtr, unsigned int,
                                 unsigned int, unsigned int));
@@ -557,6 +615,7 @@ extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowPtr, char *,
                                               unsigned int));
 extern void XFreePixmap P_ ((Display *, Pixmap));
 extern GC XCreateGC P_ ((Display *, Window, unsigned long, XGCValues *));
+extern void XFreeGC P_ ((Display *, GC));
 extern void XSetForeground P_ ((Display *, GC, unsigned long));
 extern void XSetBackground P_ ((Display *, GC, unsigned long));
 extern void XSetWindowBackground P_ ((Display *, WindowPtr, unsigned long));
@@ -565,8 +624,16 @@ extern void mac_draw_line_to_pixmap P_ ((Display *, Pixmap, GC, int, int,
 extern void mac_clear_area P_ ((struct frame *, int, int,
                                unsigned int, unsigned int));
 extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *));
-extern OSErr install_window_handler P_ ((WindowPtr));
+extern int mac_font_panel_visible_p P_ ((void));
+extern OSStatus mac_show_hide_font_panel P_ ((void));
+extern OSStatus mac_set_font_info_for_selection P_ ((struct frame *, int, int));
+extern OSStatus install_window_handler P_ ((WindowPtr));
 extern void remove_window_handler P_ ((WindowPtr));
+extern void do_menu_choice P_ ((SInt32));
+extern OSStatus mac_post_mouse_moved_event P_ ((void));
+#if USE_CG_DRAWING
+extern void mac_prepare_for_quickdraw P_ ((struct frame *));
+#endif
 
 #define FONT_TYPE_FOR_UNIBYTE(font, ch) 0
 #define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0
@@ -575,12 +642,39 @@ extern void remove_window_handler P_ ((WindowPtr));
 
 extern void x_clear_frame_selections P_ ((struct frame *));
 
+/* Defined in macfns.c */
+
+extern int have_menus_p P_ ((void));
+
+extern void x_real_positions P_ ((struct frame *, int *, int *));
+extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
+extern int x_pixel_width P_ ((struct frame *));
+extern int x_pixel_height P_ ((struct frame *));
+extern int x_char_width P_ ((struct frame *));
+extern int x_char_height P_ ((struct frame *));
+extern void x_sync P_ ((struct frame *));
+extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
+extern void mac_update_title_bar P_ ((struct frame *, int));
+extern Lisp_Object x_get_focus_frame P_ ((struct frame *));
+
+/* Defined in macmenu.c */
+
+extern void x_activate_menubar P_ ((struct frame *));
+extern void free_frame_menubar P_ ((struct frame *));
+
 /* Defined in mac.c.  */
 
-extern OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *));
-extern OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int));
 extern void mac_clear_font_name_table P_ ((void));
+extern Lisp_Object mac_aedesc_to_lisp P_ ((const AEDesc *));
+extern OSErr mac_ae_put_lisp P_ ((AEDescList *, UInt32, Lisp_Object));
 #if TARGET_API_MAC_CARBON
+extern OSStatus create_apple_event_from_event_ref P_ ((EventRef, UInt32,
+                                                      EventParamName *,
+                                                      EventParamType *,
+                                                      AppleEvent *));
+extern OSErr create_apple_event_from_drag_ref P_ ((DragRef, UInt32,
+                                                  FlavorType *,
+                                                  AppleEvent *));
 extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
 extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
 extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef));
@@ -595,6 +689,7 @@ extern Lisp_Object cfproperty_list_to_lisp P_ ((CFPropertyListRef, int, int));
 extern void xrm_merge_string_database P_ ((XrmDatabase, char *));
 extern Lisp_Object xrm_get_resource P_ ((XrmDatabase, char *, char *));
 extern XrmDatabase xrm_get_preference_database P_ ((char *));
+EXFUN (Fmac_get_preference, 4);
 
 /* arch-tag: 6b4ca125-5bef-476d-8ee8-31ed808b7e79
    (do not change this comment) */