-\f
-/* Manipulating pixel sizes and character sizes.
- Knowledge of which factors affect the overall size of the window should
- be hidden in these macros, if that's possible.
-
- Return the upper/left pixel position of the character cell on frame F
- at ROW/COL. */
-#define CHAR_TO_PIXEL_ROW(f, row) \
- ((f)->output_data.mac->internal_border_width \
- + (row) * (f)->output_data.mac->line_height)
-#define CHAR_TO_PIXEL_COL(f, col) \
- ((f)->output_data.mac->internal_border_width \
- + (col) * FONT_WIDTH ((f)->output_data.mac->font))
-
-/* Return the pixel width/height of frame F if it has
- WIDTH columns/HEIGHT rows. */
-#define CHAR_TO_PIXEL_WIDTH(f, width) \
- (CHAR_TO_PIXEL_COL (f, width) \
- + (f)->output_data.mac->vertical_scroll_bar_extra \
- + (f)->output_data.mac->fringes_extra \
- + (f)->output_data.mac->internal_border_width)
-#define CHAR_TO_PIXEL_HEIGHT(f, height) \
- (CHAR_TO_PIXEL_ROW (f, height) \
- + (f)->output_data.mac->internal_border_width)
-
-
-/* Return the row/column (zero-based) of the character cell containing
- the pixel on FRAME at ROW/COL. */
-#define PIXEL_TO_CHAR_ROW(f, row) \
- (((row) - (f)->output_data.mac->internal_border_width) \
- / (f)->output_data.mac->line_height)
-#define PIXEL_TO_CHAR_COL(f, col) \
- (((col) - (f)->output_data.mac->internal_border_width) \
- / FONT_WIDTH ((f)->output_data.mac->font))
-
-/* How many columns/rows of text can we fit in WIDTH/HEIGHT pixels on
- frame F? */
-#define PIXEL_TO_CHAR_WIDTH(f, width) \
- (PIXEL_TO_CHAR_COL (f, ((width) \
- - (f)->output_data.mac->internal_border_width \
- - (f)->output_data.mac->fringes_extra \
- - (f)->output_data.mac->vertical_scroll_bar_extra)))
-#define PIXEL_TO_CHAR_HEIGHT(f, height) \
- (PIXEL_TO_CHAR_ROW (f, ((height) \
- - (f)->output_data.mac->internal_border_width)))
-
-struct frame * check_x_frame (Lisp_Object);
-
-void activate_scroll_bars (FRAME_PTR);
-void deactivate_scroll_bars (FRAME_PTR);
+/* 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. */
+/* Creator code for Emacs on Mac OS. */
+enum {
+ MAC_EMACS_CREATOR_CODE = 'EMAx'
+};
+
+/* 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;
+
+Lisp_Object display_x_get_resource P_ ((struct x_display_info *,
+ Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object));
+struct frame *check_x_frame P_ ((Lisp_Object));
+EXFUN (Fx_display_color_p, 1);
+EXFUN (Fx_display_grayscale_p, 1);
+EXFUN (Fx_display_planes, 1);
+extern void x_free_gcs P_ ((struct frame *));
+extern int XParseGeometry P_ ((char *, int *, int *, unsigned 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));
+extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowPtr, char *,
+ unsigned int, unsigned int,
+ unsigned long, unsigned long,
+ unsigned int));
+extern void XFreePixmap P_ ((Display *, Pixmap));
+extern GC XCreateGC P_ ((Display *, void *, 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));
+extern void XDrawLine P_ ((Display *, Pixmap, GC, int, int, 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 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 OSStatus mac_post_mouse_moved_event P_ ((void));
+#if !TARGET_API_MAC_CARBON
+extern void do_apple_menu P_ ((SInt16));
+#endif
+#if USE_CG_DRAWING
+extern void mac_prepare_for_quickdraw P_ ((struct frame *));
+#endif
+extern int mac_quit_char_key_p P_ ((UInt32, UInt32));