diff options
| author | Andrew Choi | 2002-04-26 23:39:06 +0000 |
|---|---|---|
| committer | Andrew Choi | 2002-04-26 23:39:06 +0000 |
| commit | e0f712ba55fa0d073f6ab93606e428f61fc7caf2 (patch) | |
| tree | 7dc6d3403fafcbee1a83288ac840f7eba1d92b44 /mac/inc | |
| parent | 501d8923ae2cdec4ef50f050bb66d3715ba2a8f6 (diff) | |
| download | emacs-e0f712ba55fa0d073f6ab93606e428f61fc7caf2.tar.gz emacs-e0f712ba55fa0d073f6ab93606e428f61fc7caf2.zip | |
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
lisp/ChangeLog, and src/ChangeLog for list of changes.
Diffstat (limited to 'mac/inc')
| -rw-r--r-- | mac/inc/alloca.h | 2 | ||||
| -rw-r--r-- | mac/inc/config.h | 4 | ||||
| -rw-r--r-- | mac/inc/defs-cw5.h | 23 | ||||
| -rw-r--r-- | mac/inc/defs-cw6.h | 5 | ||||
| -rw-r--r-- | mac/inc/dirent.h | 2 | ||||
| -rw-r--r-- | mac/inc/epaths.h | 2 | ||||
| -rw-r--r-- | mac/inc/m-mac.h | 2 | ||||
| -rw-r--r-- | mac/inc/macgui.h | 155 | ||||
| -rw-r--r-- | mac/inc/macterm.h | 652 | ||||
| -rw-r--r-- | mac/inc/pwd.h | 2 | ||||
| -rw-r--r-- | mac/inc/s-mac.h | 2 | ||||
| -rw-r--r-- | mac/inc/sys/file.h | 2 | ||||
| -rw-r--r-- | mac/inc/sys/ioctl.h | 2 | ||||
| -rw-r--r-- | mac/inc/sys/param.h | 2 | ||||
| -rw-r--r-- | mac/inc/sys/stat.h | 4 | ||||
| -rw-r--r-- | mac/inc/sys/time.h | 2 | ||||
| -rw-r--r-- | mac/inc/sys/types.h | 2 | ||||
| -rw-r--r-- | mac/inc/termio.h | 2 | ||||
| -rw-r--r-- | mac/inc/utime.h | 2 | ||||
| -rw-r--r-- | mac/inc/utsname.h | 2 |
20 files changed, 22 insertions, 849 deletions
diff --git a/mac/inc/alloca.h b/mac/inc/alloca.h index 6d29a0e7617..f0b1e76fbf3 100644 --- a/mac/inc/alloca.h +++ b/mac/inc/alloca.h | |||
| @@ -17,7 +17,7 @@ along with GNU Emacs; see the file COPYING. If not, write to the Free | |||
| 17 | Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | 17 | Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 18 | 02111-1307, USA. */ | 18 | 02111-1307, USA. */ |
| 19 | 19 | ||
| 20 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 20 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 21 | 21 | ||
| 22 | #ifndef _ALLOCA_H_ | 22 | #ifndef _ALLOCA_H_ |
| 23 | #define _ALLOCA_H_ | 23 | #define _ALLOCA_H_ |
diff --git a/mac/inc/config.h b/mac/inc/config.h index aeb4a8aaad7..a536ee9e877 100644 --- a/mac/inc/config.h +++ b/mac/inc/config.h | |||
| @@ -20,6 +20,8 @@ along with GNU Emacs; see the file COPYING. If not, write to the | |||
| 20 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 20 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 21 | Boston, MA 02111-1307, USA. */ | 21 | Boston, MA 02111-1307, USA. */ |
| 22 | 22 | ||
| 23 | /* Contributed by Andrew Choi (akochoi@mac.com). */ | ||
| 24 | |||
| 23 | 25 | ||
| 24 | /* No code in Emacs #includes config.h twice, but some of the code | 26 | /* No code in Emacs #includes config.h twice, but some of the code |
| 25 | intended to work with other packages as well (like gmalloc.c) | 27 | intended to work with other packages as well (like gmalloc.c) |
| @@ -567,4 +569,4 @@ extern char *getenv (); | |||
| 567 | 569 | ||
| 568 | /* #define GLYPH_DEBUG 1 */ | 570 | /* #define GLYPH_DEBUG 1 */ |
| 569 | 571 | ||
| 570 | #define NO_RETURN /* nothing */ \ No newline at end of file | 572 | #define NO_RETURN /* nothing */ |
diff --git a/mac/inc/defs-cw5.h b/mac/inc/defs-cw5.h deleted file mode 100644 index ffc00d0f7da..00000000000 --- a/mac/inc/defs-cw5.h +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | /* Copyright (C) 2001 Free Software Foundation, Inc. | ||
| 2 | |||
| 3 | This file is part of GNU Emacs. | ||
| 4 | |||
| 5 | GNU Emacs is free software; you can redistribute it and/or modify it | ||
| 6 | under the terms of the GNU General Public License as published by the | ||
| 7 | Free Software Foundation; either version 2, or (at your option) any | ||
| 8 | later version. | ||
| 9 | |||
| 10 | GNU Emacs is distributed in the hope that it will be useful, but | ||
| 11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | General Public License for more details. | ||
| 14 | |||
| 15 | You should have received a copy of the GNU General Public License | ||
| 16 | along with GNU Emacs; see the file COPYING. If not, write to the Free | ||
| 17 | Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | ||
| 18 | 02111-1307, USA. */ | ||
| 19 | |||
| 20 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | ||
| 21 | |||
| 22 | #define emacs 1 | ||
| 23 | #define HAVE_CONFIG_H | ||
diff --git a/mac/inc/defs-cw6.h b/mac/inc/defs-cw6.h index 6b386ba723d..e8d8abb8750 100644 --- a/mac/inc/defs-cw6.h +++ b/mac/inc/defs-cw6.h | |||
| @@ -17,9 +17,10 @@ along with GNU Emacs; see the file COPYING. If not, write to the Free | |||
| 17 | Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | 17 | Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 18 | 02111-1307, USA. */ | 18 | 02111-1307, USA. */ |
| 19 | 19 | ||
| 20 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 20 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 21 | 21 | ||
| 22 | #define emacs 1 | 22 | #define emacs 1 |
| 23 | #define HAVE_CONFIG_H | 23 | #define HAVE_CONFIG_H |
| 24 | 24 | ||
| 25 | #define CODEWARRIOR_VERSION_6 | 25 | #define MAC_OS8 1 |
| 26 | #define MAC_OS 1 | ||
diff --git a/mac/inc/dirent.h b/mac/inc/dirent.h index 8513acb2bee..59b0c44cc41 100644 --- a/mac/inc/dirent.h +++ b/mac/inc/dirent.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | #ifndef _DIRENT_H | 23 | #ifndef _DIRENT_H |
| 24 | #define _DIRENT_H | 24 | #define _DIRENT_H |
diff --git a/mac/inc/epaths.h b/mac/inc/epaths.h index 7dad4582efa..0ec9da70a2b 100644 --- a/mac/inc/epaths.h +++ b/mac/inc/epaths.h | |||
| @@ -20,7 +20,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 20 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 20 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 21 | Boston, MA 02111-1307, USA. */ | 21 | Boston, MA 02111-1307, USA. */ |
| 22 | 22 | ||
| 23 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 23 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 24 | 24 | ||
| 25 | /* The default search path for Lisp function "load". | 25 | /* The default search path for Lisp function "load". |
| 26 | This sets load-path. */ | 26 | This sets load-path. */ |
diff --git a/mac/inc/m-mac.h b/mac/inc/m-mac.h index 6378c614e93..69f33a36131 100644 --- a/mac/inc/m-mac.h +++ b/mac/inc/m-mac.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | /* The following line tells the configuration script what sort of | 23 | /* The following line tells the configuration script what sort of |
| 24 | operating system this machine is likely to run. | 24 | operating system this machine is likely to run. |
diff --git a/mac/inc/macgui.h b/mac/inc/macgui.h deleted file mode 100644 index 1072bcec533..00000000000 --- a/mac/inc/macgui.h +++ /dev/null | |||
| @@ -1,155 +0,0 @@ | |||
| 1 | /* Definitions and headers for communication on the Mac OS. | ||
| 2 | Copyright (C) 2000 Free Software Foundation, Inc. | ||
| 3 | |||
| 4 | This file is part of GNU Emacs. | ||
| 5 | |||
| 6 | GNU Emacs is free software; you can redistribute it and/or modify | ||
| 7 | it under the terms of the GNU General Public License as published by | ||
| 8 | the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | any later version. | ||
| 10 | |||
| 11 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | GNU General Public License for more details. | ||
| 15 | |||
| 16 | You should have received a copy of the GNU General Public License | ||
| 17 | along with GNU Emacs; see the file COPYING. If not, write to | ||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
| 19 | Boston, MA 02111-1307, USA. */ | ||
| 20 | |||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | ||
| 22 | |||
| 23 | #ifndef EMACS_MACGUI_H | ||
| 24 | #define EMACS_MACGUI_H | ||
| 25 | |||
| 26 | #include <MacTypes.h> | ||
| 27 | #include <Quickdraw.h> | ||
| 28 | |||
| 29 | typedef int Pixmap; | ||
| 30 | typedef int Bitmap; | ||
| 31 | |||
| 32 | typedef int Display; /* fix later */ | ||
| 33 | |||
| 34 | typedef unsigned long Time; | ||
| 35 | typedef RGBColor Color; | ||
| 36 | typedef WindowPtr Window; | ||
| 37 | |||
| 38 | #define FACE_DEFAULT (~0) | ||
| 39 | |||
| 40 | |||
| 41 | /* Emulate XCharStruct. */ | ||
| 42 | typedef struct _XCharStruct | ||
| 43 | { | ||
| 44 | int rbearing; | ||
| 45 | int lbearing; | ||
| 46 | int width; | ||
| 47 | int ascent; | ||
| 48 | int descent; | ||
| 49 | } XCharStruct; | ||
| 50 | |||
| 51 | struct MacFontStruct { | ||
| 52 | char *fontname; | ||
| 53 | |||
| 54 | SInt16 mac_fontnum; /* font number of font used in this window */ | ||
| 55 | int mac_fontsize; /* size of font */ | ||
| 56 | Style mac_fontface; /* plain, bold, italics, etc. */ | ||
| 57 | short mac_scriptcode; /* Mac OS script code for font used */ | ||
| 58 | |||
| 59 | #if 0 | ||
| 60 | SInt16 mFontNum; /* font number of font used in this window */ | ||
| 61 | short mScriptCode; /* Mac OS script code for font used */ | ||
| 62 | int mFontSize; /* size of font */ | ||
| 63 | Style mFontFace; /* plain, bold, italics, etc. */ | ||
| 64 | int mHeight; /* height of one line of text in pixels */ | ||
| 65 | int mWidth; /* width of one character in pixels */ | ||
| 66 | int mAscent; | ||
| 67 | int mDescent; | ||
| 68 | int mLeading; | ||
| 69 | char mTwoByte; /* true for two-byte font */ | ||
| 70 | #endif | ||
| 71 | |||
| 72 | /* from Xlib.h */ | ||
| 73 | #if 0 | ||
| 74 | XExtData *ext_data; /* hook for extension to hang data */ | ||
| 75 | Font fid; /* Font id for this font */ | ||
| 76 | unsigned direction; /* hint about the direction font is painted */ | ||
| 77 | #endif | ||
| 78 | unsigned min_char_or_byte2;/* first character */ | ||
| 79 | unsigned max_char_or_byte2;/* last character */ | ||
| 80 | unsigned min_byte1; /* first row that exists */ | ||
| 81 | unsigned max_byte1; /* last row that exists */ | ||
| 82 | #if 0 | ||
| 83 | Bool all_chars_exist; /* flag if all characters have nonzero size */ | ||
| 84 | unsigned default_char; /* char to print for undefined character */ | ||
| 85 | int n_properties; /* how many properties there are */ | ||
| 86 | XFontProp *properties; /* pointer to array of additional properties */ | ||
| 87 | #endif | ||
| 88 | XCharStruct min_bounds; /* minimum bounds over all existing char */ | ||
| 89 | XCharStruct max_bounds; /* maximum bounds over all existing char */ | ||
| 90 | XCharStruct *per_char; /* first_char to last_char information */ | ||
| 91 | int ascent; /* logical extent above baseline for spacing */ | ||
| 92 | int descent; /* logical decent below baseline for spacing */ | ||
| 93 | }; | ||
| 94 | |||
| 95 | typedef struct MacFontStruct MacFontStruct; | ||
| 96 | typedef struct MacFontStruct XFontStruct; | ||
| 97 | |||
| 98 | |||
| 99 | /* Emulate X GC's by keeping color and font info in a structure. */ | ||
| 100 | typedef struct _XGCValues | ||
| 101 | { | ||
| 102 | unsigned long foreground; | ||
| 103 | unsigned long background; | ||
| 104 | XFontStruct *font; | ||
| 105 | } XGCValues; | ||
| 106 | |||
| 107 | typedef XGCValues *GC; | ||
| 108 | |||
| 109 | extern XGCValues * | ||
| 110 | XCreateGC (void *, Window, unsigned long, XGCValues *); | ||
| 111 | |||
| 112 | #define GCForeground 0x01 | ||
| 113 | #define GCBackground 0x02 | ||
| 114 | #define GCFont 0x03 | ||
| 115 | #define GCGraphicsExposures 0 | ||
| 116 | |||
| 117 | /* Bit Gravity */ | ||
| 118 | |||
| 119 | #define ForgetGravity 0 | ||
| 120 | #define NorthWestGravity 1 | ||
| 121 | #define NorthGravity 2 | ||
| 122 | #define NorthEastGravity 3 | ||
| 123 | #define WestGravity 4 | ||
| 124 | #define CenterGravity 5 | ||
| 125 | #define EastGravity 6 | ||
| 126 | #define SouthWestGravity 7 | ||
| 127 | #define SouthGravity 8 | ||
| 128 | #define SouthEastGravity 9 | ||
| 129 | #define StaticGravity 10 | ||
| 130 | |||
| 131 | #define NoValue 0x0000 | ||
| 132 | #define XValue 0x0001 | ||
| 133 | #define YValue 0x0002 | ||
| 134 | #define WidthValue 0x0004 | ||
| 135 | #define HeightValue 0x0008 | ||
| 136 | #define AllValues 0x000F | ||
| 137 | #define XNegative 0x0010 | ||
| 138 | #define YNegative 0x0020 | ||
| 139 | |||
| 140 | #define USPosition (1L << 0) /* user specified x, y */ | ||
| 141 | #define USSize (1L << 1) /* user specified width, height */ | ||
| 142 | |||
| 143 | #define PPosition (1L << 2) /* program specified position */ | ||
| 144 | #define PSize (1L << 3) /* program specified size */ | ||
| 145 | #define PMinSize (1L << 4) /* program specified minimum size */ | ||
| 146 | #define PMaxSize (1L << 5) /* program specified maximum size */ | ||
| 147 | #define PResizeInc (1L << 6) /* program specified resize increments */ | ||
| 148 | #define PAspect (1L << 7) /* program specified min and max aspect ratios */ | ||
| 149 | #define PBaseSize (1L << 8) /* program specified base for incrementing */ | ||
| 150 | #define PWinGravity (1L << 9) /* program specified window gravity */ | ||
| 151 | |||
| 152 | extern int XParseGeometry (); | ||
| 153 | |||
| 154 | #endif /* EMACS_MACGUI_H */ | ||
| 155 | |||
diff --git a/mac/inc/macterm.h b/mac/inc/macterm.h deleted file mode 100644 index 340be4e35f3..00000000000 --- a/mac/inc/macterm.h +++ /dev/null | |||
| @@ -1,652 +0,0 @@ | |||
| 1 | /* Display module for Mac OS. | ||
| 2 | Copyright (C) 2000 Free Software Foundation, Inc. | ||
| 3 | |||
| 4 | This file is part of GNU Emacs. | ||
| 5 | |||
| 6 | GNU Emacs is free software; you can redistribute it and/or modify | ||
| 7 | it under the terms of the GNU General Public License as published by | ||
| 8 | the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | any later version. | ||
| 10 | |||
| 11 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | GNU General Public License for more details. | ||
| 15 | |||
| 16 | You should have received a copy of the GNU General Public License | ||
| 17 | along with GNU Emacs; see the file COPYING. If not, write to | ||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
| 19 | Boston, MA 02111-1307, USA. */ | ||
| 20 | |||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | ||
| 22 | |||
| 23 | #include "macgui.h" | ||
| 24 | #include "frame.h" | ||
| 25 | |||
| 26 | /* The class of this X application. */ | ||
| 27 | #define EMACS_CLASS "Emacs" | ||
| 28 | |||
| 29 | #define RGB_TO_ULONG(r, g, b) (((r) << 16) | ((g) << 8) | (b)) | ||
| 30 | |||
| 31 | #define RED_FROM_ULONG(color) ((color) >> 16) | ||
| 32 | #define GREEN_FROM_ULONG(color) (((color) >> 8) & 0xff) | ||
| 33 | #define BLUE_FROM_ULONG(color) ((color) & 0xff) | ||
| 34 | |||
| 35 | #define BLACK_PIX_DEFAULT(f) RGB_TO_ULONG(0,0,0) | ||
| 36 | #define WHITE_PIX_DEFAULT(f) RGB_TO_ULONG(255,255,255) | ||
| 37 | |||
| 38 | #define FONT_WIDTH(f) ((f)->max_bounds.width) | ||
| 39 | #define FONT_HEIGHT(f) ((f)->ascent + (f)->descent) | ||
| 40 | #define FONT_BASE(f) ((f)->ascent) | ||
| 41 | #define FONT_DESCENT(f) ((f)->descent) | ||
| 42 | |||
| 43 | #define FONT_MAX_WIDTH(f) FONT_WIDTH(f) /* fix later */ | ||
| 44 | |||
| 45 | enum text_cursor_kinds { | ||
| 46 | NO_CURSOR = -1, | ||
| 47 | FILLED_BOX_CURSOR, | ||
| 48 | HOLLOW_BOX_CURSOR, | ||
| 49 | BAR_CURSOR | ||
| 50 | }; | ||
| 51 | |||
| 52 | /* Structure recording bitmaps and reference count. | ||
| 53 | If REFCOUNT is 0 then this record is free to be reused. */ | ||
| 54 | |||
| 55 | struct mac_bitmap_record | ||
| 56 | { | ||
| 57 | char *bitmap_data; | ||
| 58 | int refcount; | ||
| 59 | int height, width; | ||
| 60 | }; | ||
| 61 | |||
| 62 | |||
| 63 | /* For each display (currently only one on mac), we have a structure that | ||
| 64 | records information about it. */ | ||
| 65 | |||
| 66 | struct mac_display_info | ||
| 67 | { | ||
| 68 | /* Chain of all mac_display_info structures. */ | ||
| 69 | struct mac_display_info *next; | ||
| 70 | |||
| 71 | /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). | ||
| 72 | The same cons cell also appears in x_display_name_list. */ | ||
| 73 | Lisp_Object name_list_element; | ||
| 74 | |||
| 75 | /* Number of frames that are on this display. */ | ||
| 76 | int reference_count; | ||
| 77 | |||
| 78 | /* Dots per inch of the screen. */ | ||
| 79 | double resx, resy; | ||
| 80 | |||
| 81 | /* Number of planes on this screen. */ | ||
| 82 | int n_planes; | ||
| 83 | |||
| 84 | /* Number of bits per pixel on this screen. */ | ||
| 85 | int n_cbits; | ||
| 86 | |||
| 87 | /* Dimensions of this screen. */ | ||
| 88 | int height, width; | ||
| 89 | #if 0 | ||
| 90 | int height_in,width_in; | ||
| 91 | #endif | ||
| 92 | |||
| 93 | /* Mask of things that cause the mouse to be grabbed. */ | ||
| 94 | int grabbed; | ||
| 95 | |||
| 96 | #if 0 | ||
| 97 | /* Emacs bitmap-id of the default icon bitmap for this frame. | ||
| 98 | Or -1 if none has been allocated yet. */ | ||
| 99 | int icon_bitmap_id; | ||
| 100 | |||
| 101 | #endif | ||
| 102 | /* The root window of this screen. */ | ||
| 103 | Window root_window; | ||
| 104 | |||
| 105 | /* The cursor to use for vertical scroll bars. */ | ||
| 106 | Cursor vertical_scroll_bar_cursor; | ||
| 107 | |||
| 108 | #if 0 | ||
| 109 | /* color palette information. */ | ||
| 110 | int has_palette; | ||
| 111 | struct w32_palette_entry * color_list; | ||
| 112 | unsigned num_colors; | ||
| 113 | HPALETTE palette; | ||
| 114 | |||
| 115 | /* deferred action flags checked when starting frame update. */ | ||
| 116 | int regen_palette; | ||
| 117 | |||
| 118 | /* Keystroke that has been faked by Emacs and will be ignored when | ||
| 119 | received; value is reset after key is received. */ | ||
| 120 | int faked_key; | ||
| 121 | |||
| 122 | #endif | ||
| 123 | |||
| 124 | /* A table of all the fonts we have already loaded. */ | ||
| 125 | struct font_info *font_table; | ||
| 126 | |||
| 127 | /* The current capacity of font_table. */ | ||
| 128 | int font_table_size; | ||
| 129 | |||
| 130 | /* The number of fonts actually stored in the font table. | ||
| 131 | font_table[n] is used and valid iff 0 <= n < n_fonts. 0 <= | ||
| 132 | n_fonts <= font_table_size. and font_table[i].name != 0. */ | ||
| 133 | int n_fonts; | ||
| 134 | |||
| 135 | /* Minimum width over all characters in all fonts in font_table. */ | ||
| 136 | int smallest_char_width; | ||
| 137 | |||
| 138 | /* Minimum font height over all fonts in font_table. */ | ||
| 139 | int smallest_font_height; | ||
| 140 | |||
| 141 | /* Reusable Graphics Context for drawing a cursor in a non-default face. */ | ||
| 142 | XGCValues *scratch_cursor_gc; | ||
| 143 | |||
| 144 | /* These variables describe the range of text currently shown in its | ||
| 145 | mouse-face, together with the window they apply to. As long as | ||
| 146 | the mouse stays within this range, we need not redraw anything on | ||
| 147 | its account. Rows and columns are glyph matrix positions in | ||
| 148 | MOUSE_FACE_WINDOW. */ | ||
| 149 | int mouse_face_beg_row, mouse_face_beg_col; | ||
| 150 | int mouse_face_beg_x, mouse_face_beg_y; | ||
| 151 | int mouse_face_end_row, mouse_face_end_col; | ||
| 152 | int mouse_face_end_x, mouse_face_end_y; | ||
| 153 | int mouse_face_past_end; | ||
| 154 | |||
| 155 | Lisp_Object mouse_face_window; | ||
| 156 | |||
| 157 | int mouse_face_face_id; | ||
| 158 | |||
| 159 | /* 1 if a mouse motion event came and we didn't handle it right away because | ||
| 160 | gc was in progress. */ | ||
| 161 | int mouse_face_deferred_gc; | ||
| 162 | |||
| 163 | /* FRAME and X, Y position of mouse when last checked for | ||
| 164 | highlighting. X and Y can be negative or out of range for the frame. */ | ||
| 165 | struct frame *mouse_face_mouse_frame; | ||
| 166 | |||
| 167 | int mouse_face_mouse_x, mouse_face_mouse_y; | ||
| 168 | |||
| 169 | /* Nonzero means defer mouse-motion highlighting. */ | ||
| 170 | int mouse_face_defer; | ||
| 171 | |||
| 172 | int mouse_face_image_state; | ||
| 173 | |||
| 174 | char *mac_id_name; | ||
| 175 | |||
| 176 | /* Pointer to bitmap records. */ | ||
| 177 | struct mac_bitmap_record *bitmaps; | ||
| 178 | |||
| 179 | /* Allocated size of bitmaps field. */ | ||
| 180 | int bitmaps_size; | ||
| 181 | |||
| 182 | /* Last used bitmap index. */ | ||
| 183 | int bitmaps_last; | ||
| 184 | |||
| 185 | /* The frame (if any) which has the window that has keyboard focus. | ||
| 186 | Zero if none. This is examined by Ffocus_frame in w32fns.c. Note | ||
| 187 | that a mere EnterNotify event can set this; if you need to know the | ||
| 188 | last frame specified in a FocusIn or FocusOut event, use | ||
| 189 | w32_focus_event_frame. */ | ||
| 190 | struct frame *x_focus_frame; | ||
| 191 | |||
| 192 | /* The last frame mentioned in a FocusIn or FocusOut event. This is | ||
| 193 | separate from w32_focus_frame, because whether or not LeaveNotify | ||
| 194 | events cause us to lose focus depends on whether or not we have | ||
| 195 | received a FocusIn event for it. */ | ||
| 196 | struct frame *x_focus_event_frame; | ||
| 197 | |||
| 198 | /* The frame which currently has the visual highlight, and should get | ||
| 199 | keyboard input (other sorts of input have the frame encoded in the | ||
| 200 | event). It points to the focus frame's selected window's | ||
| 201 | frame. It differs from w32_focus_frame when we're using a global | ||
| 202 | minibuffer. */ | ||
| 203 | struct frame *x_highlight_frame; | ||
| 204 | |||
| 205 | /* Cache of images. */ | ||
| 206 | struct image_cache *image_cache; | ||
| 207 | }; | ||
| 208 | |||
| 209 | #define x_display_info mac_display_info | ||
| 210 | |||
| 211 | /* This is a chain of structures for all the displays currently in use. */ | ||
| 212 | extern struct mac_display_info one_mac_display_info; | ||
| 213 | |||
| 214 | /* This is a chain of structures for all the X displays currently in use. */ | ||
| 215 | extern struct x_display_info *x_display_list; | ||
| 216 | |||
| 217 | /* This is a list of cons cells, each of the form (NAME . FONT-LIST-CACHE), | ||
| 218 | one for each element of x_display_list and in the same order. | ||
| 219 | NAME is the name of the frame. | ||
| 220 | FONT-LIST-CACHE records previous values returned by x-list-fonts. */ | ||
| 221 | extern Lisp_Object x_display_name_list; | ||
| 222 | |||
| 223 | /* A flag to control how to display unibyte 8-bit character. */ | ||
| 224 | extern int unibyte_display_via_language_environment; | ||
| 225 | |||
| 226 | extern struct x_display_info *x_display_info_for_display P_ ((Display *)); | ||
| 227 | extern struct x_display_info *x_display_info_for_name P_ ((Lisp_Object)); | ||
| 228 | |||
| 229 | extern struct mac_display_info *mac_term_init (); | ||
| 230 | |||
| 231 | /* The collection of data describing a window on the Mac. Functions | ||
| 232 | defined in macterm.c */ | ||
| 233 | struct mac_output { | ||
| 234 | WindowPtr mWP; /* pointer to QuickDraw window */ | ||
| 235 | FRAME_PTR mFP; /* points back to the frame struct */ | ||
| 236 | |||
| 237 | #if 0 | ||
| 238 | int mNumCols; /* number of characters per column */ | ||
| 239 | int mNumRows; /* number of characters per row */ | ||
| 240 | int mLineHeight; /* height of one line of text in pixels */ | ||
| 241 | int mCharWidth; /* width of one character in pixels */ | ||
| 242 | int mHomeX; /* X pixel coordinate of lower left corner of character at (0, 0) */ | ||
| 243 | int mHomeY; /* Y pixel coordinate of lower left corner of character at (0, 0) */ | ||
| 244 | int mHighlight; /* current highlight state (0 = off). */ | ||
| 245 | int mTermWinSize; /* num of lines from top of window affected by ins_del_lines; set by set_terminal_window. */ | ||
| 246 | #endif | ||
| 247 | |||
| 248 | #if 0 | ||
| 249 | /* stuffs used by xfaces.c */ | ||
| 250 | struct face **param_faces; | ||
| 251 | int n_param_faces; | ||
| 252 | struct face **computed_faces; | ||
| 253 | int n_computed_faces; | ||
| 254 | int size_computed_faces; | ||
| 255 | #endif | ||
| 256 | |||
| 257 | unsigned long background_pixel; | ||
| 258 | unsigned long foreground_pixel; | ||
| 259 | |||
| 260 | /* Position of the Mac window (x and y offsets in global coordinates). */ | ||
| 261 | int left_pos; | ||
| 262 | int top_pos; | ||
| 263 | |||
| 264 | /* Border width of the W32 window as known by the window system. */ | ||
| 265 | int border_width; | ||
| 266 | |||
| 267 | /* Size of the W32 window in pixels. */ | ||
| 268 | int pixel_height, pixel_width; | ||
| 269 | |||
| 270 | /* Height of a line, in pixels. */ | ||
| 271 | int line_height; | ||
| 272 | |||
| 273 | /* Here are the Graphics Contexts for the default font. */ | ||
| 274 | GC normal_gc; /* Normal video */ | ||
| 275 | GC reverse_gc; /* Reverse video */ | ||
| 276 | GC cursor_gc; /* cursor drawing */ | ||
| 277 | |||
| 278 | /* Width of the internal border. This is a line of background color | ||
| 279 | just inside the window's border. When the frame is selected, | ||
| 280 | a highlighting is displayed inside the internal border. */ | ||
| 281 | int internal_border_width; | ||
| 282 | |||
| 283 | /* The window used for this frame. | ||
| 284 | May be zero while the frame object is being created | ||
| 285 | and the window has not yet been created. */ | ||
| 286 | Window window_desc; | ||
| 287 | |||
| 288 | /* The window that is the parent of this window. | ||
| 289 | Usually this is a window that was made by the window manager, | ||
| 290 | but it can be the root window, and it can be explicitly specified | ||
| 291 | (see the explicit_parent field, below). */ | ||
| 292 | Window parent_desc; | ||
| 293 | |||
| 294 | /* Default ASCII font of this frame. */ | ||
| 295 | XFontStruct *font; | ||
| 296 | |||
| 297 | /* The baseline offset of the default ASCII font. */ | ||
| 298 | int baseline_offset; | ||
| 299 | |||
| 300 | /* If a fontset is specified for this frame instead of font, this | ||
| 301 | value contains an ID of the fontset, else -1. */ | ||
| 302 | int fontset; | ||
| 303 | |||
| 304 | /* Pixel values used for various purposes. | ||
| 305 | border_pixel may be -1 meaning use a gray tile. */ | ||
| 306 | unsigned long cursor_pixel; | ||
| 307 | unsigned long border_pixel; | ||
| 308 | unsigned long mouse_pixel; | ||
| 309 | unsigned long cursor_foreground_pixel; | ||
| 310 | |||
| 311 | /* Foreground color for scroll bars. A value of -1 means use the | ||
| 312 | default (black for non-toolkit scroll bars). */ | ||
| 313 | unsigned long scroll_bar_foreground_pixel; | ||
| 314 | |||
| 315 | /* Background color for scroll bars. A value of -1 means use the | ||
| 316 | default (background color of the frame for non-toolkit scroll | ||
| 317 | bars). */ | ||
| 318 | unsigned long scroll_bar_background_pixel; | ||
| 319 | |||
| 320 | /* Descriptor for the cursor in use for this window. */ | ||
| 321 | Cursor text_cursor; | ||
| 322 | Cursor nontext_cursor; | ||
| 323 | Cursor modeline_cursor; | ||
| 324 | Cursor cross_cursor; | ||
| 325 | Cursor hourglass_cursor; | ||
| 326 | #if 0 | ||
| 327 | /* Window whose cursor is hourglass_cursor. This window is temporarily | ||
| 328 | mapped to display a hourglass-cursor. */ | ||
| 329 | Window hourglass_window; | ||
| 330 | |||
| 331 | /* Non-zero means hourglass cursor is currently displayed. */ | ||
| 332 | unsigned hourglass_p : 1; | ||
| 333 | |||
| 334 | /* Flag to set when the window needs to be completely repainted. */ | ||
| 335 | int needs_exposure; | ||
| 336 | |||
| 337 | #endif | ||
| 338 | |||
| 339 | /* What kind of text cursor is drawn in this window right now? | ||
| 340 | (If there is no cursor (phys_cursor_x < 0), then this means nothing.) */ | ||
| 341 | enum text_cursor_kinds current_cursor; | ||
| 342 | |||
| 343 | /* What kind of text cursor should we draw in the future? | ||
| 344 | This should always be filled_box_cursor or bar_cursor. */ | ||
| 345 | enum text_cursor_kinds desired_cursor; | ||
| 346 | |||
| 347 | /* Width of bar cursor (if we are using that). */ | ||
| 348 | int cursor_width; | ||
| 349 | |||
| 350 | #if 0 | ||
| 351 | DWORD dwStyle; | ||
| 352 | #endif | ||
| 353 | |||
| 354 | /* The size of the extra width currently allotted for vertical | ||
| 355 | scroll bars, in pixels. */ | ||
| 356 | int vertical_scroll_bar_extra; | ||
| 357 | |||
| 358 | /* The extra width currently allotted for the areas in which | ||
| 359 | truncation marks, continuation marks, and overlay arrows are | ||
| 360 | displayed. */ | ||
| 361 | int left_fringe_width, right_fringe_width; | ||
| 362 | int fringe_cols, fringes_extra; | ||
| 363 | |||
| 364 | /* This is the gravity value for the specified window position. */ | ||
| 365 | int win_gravity; | ||
| 366 | |||
| 367 | /* The geometry flags for this window. */ | ||
| 368 | int size_hint_flags; | ||
| 369 | |||
| 370 | /* This is the Emacs structure for the display this frame is on. */ | ||
| 371 | /* struct w32_display_info *display_info; */ | ||
| 372 | |||
| 373 | /* Nonzero means our parent is another application's window | ||
| 374 | and was explicitly specified. */ | ||
| 375 | char explicit_parent; | ||
| 376 | |||
| 377 | /* Nonzero means tried already to make this frame visible. */ | ||
| 378 | char asked_for_visible; | ||
| 379 | |||
| 380 | /* Nonzero means menubar is currently active. */ | ||
| 381 | char menubar_active; | ||
| 382 | |||
| 383 | /* Always contains NULL on the Mac OS because the menu bar is shared. */ | ||
| 384 | int menubar_widget; | ||
| 385 | |||
| 386 | #if 0 | ||
| 387 | /* Nonzero means menubar is about to become active, but should be | ||
| 388 | brought up to date first. */ | ||
| 389 | volatile char pending_menu_activation; | ||
| 390 | |||
| 391 | #endif | ||
| 392 | /* Relief GCs, colors etc. */ | ||
| 393 | struct relief | ||
| 394 | { | ||
| 395 | XGCValues *gc; | ||
| 396 | unsigned long pixel; | ||
| 397 | int allocated_p; | ||
| 398 | } | ||
| 399 | black_relief, white_relief; | ||
| 400 | |||
| 401 | /* The background for which the above relief GCs were set up. | ||
| 402 | They are changed only when a different background is involved. */ | ||
| 403 | unsigned long relief_background; | ||
| 404 | }; | ||
| 405 | |||
| 406 | typedef struct mac_output mac_output; | ||
| 407 | |||
| 408 | /* Return the Mac window used for displaying data in frame F. */ | ||
| 409 | #define FRAME_MAC_WINDOW(f) ((f)->output_data.mac->mWP) | ||
| 410 | |||
| 411 | #define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.mac->foreground_pixel) | ||
| 412 | #define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.mac->background_pixel) | ||
| 413 | |||
| 414 | #define FRAME_FONT(f) ((f)->output_data.mac->font) | ||
| 415 | #define FRAME_FONTSET(f) ((f)->output_data.mac->fontset) | ||
| 416 | |||
| 417 | #define FRAME_INTERNAL_BORDER_WIDTH(f) ((f)->output_data.mac->internal_border_width) | ||
| 418 | #define FRAME_LINE_HEIGHT(f) ((f)->output_data.mac->line_height) | ||
| 419 | /* Width of the default font of frame F. Must be defined by each | ||
| 420 | terminal specific header. */ | ||
| 421 | #define FRAME_DEFAULT_FONT_WIDTH(F) FONT_WIDTH (FRAME_FONT (F)) | ||
| 422 | #define FRAME_BASELINE_OFFSET(f) ((f)->output_data.mac->baseline_offset) | ||
| 423 | |||
| 424 | /* This gives the w32_display_info structure for the display F is on. */ | ||
| 425 | #define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info) | ||
| 426 | #define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info) | ||
| 427 | |||
| 428 | /* This is the `Display *' which frame F is on. */ | ||
| 429 | #define FRAME_MAC_DISPLAY(f) (0) | ||
| 430 | |||
| 431 | /* This is the 'font_info *' which frame F has. */ | ||
| 432 | #define FRAME_MAC_FONT_TABLE(f) (FRAME_MAC_DISPLAY_INFO (f)->font_table) | ||
| 433 | |||
| 434 | /* These two really ought to be called FRAME_PIXEL_{WIDTH,HEIGHT}. */ | ||
| 435 | #define PIXEL_WIDTH(f) ((f)->output_data.mac->pixel_width) | ||
| 436 | #define PIXEL_HEIGHT(f) ((f)->output_data.mac->pixel_height) | ||
| 437 | |||
| 438 | #define FRAME_DESIRED_CURSOR(f) ((f)->output_data.mac->desired_cursor) | ||
| 439 | |||
| 440 | /* Value is the smallest width of any character in any font on frame F. */ | ||
| 441 | |||
| 442 | #define FRAME_SMALLEST_CHAR_WIDTH(F) \ | ||
| 443 | FRAME_MAC_DISPLAY_INFO(F)->smallest_char_width | ||
| 444 | |||
| 445 | /* Value is the smallest height of any font on frame F. */ | ||
| 446 | |||
| 447 | #define FRAME_SMALLEST_FONT_HEIGHT(F) \ | ||
| 448 | FRAME_MAC_DISPLAY_INFO(F)->smallest_font_height | ||
| 449 | |||
| 450 | /* Return a pointer to the image cache of frame F. */ | ||
| 451 | |||
| 452 | #define FRAME_X_IMAGE_CACHE(F) FRAME_MAC_DISPLAY_INFO ((F))->image_cache | ||
| 453 | |||
| 454 | |||
| 455 | /* Total width of fringes reserved for drawing truncation bitmaps, | ||
| 456 | continuation bitmaps and alike. The width is in canonical char | ||
| 457 | units of the frame. This must currently be the case because window | ||
| 458 | sizes aren't pixel values. If it weren't the case, we wouldn't be | ||
| 459 | able to split windows horizontally nicely. */ | ||
| 460 | |||
| 461 | #define FRAME_X_FRINGE_COLS(F) ((F)->output_data.mac->fringe_cols) | ||
| 462 | |||
| 463 | /* Total width of fringes in pixels. */ | ||
| 464 | |||
| 465 | #define FRAME_X_FRINGE_WIDTH(F) ((F)->output_data.mac->fringes_extra) | ||
| 466 | |||
| 467 | /* Pixel-width of the left and right fringe. */ | ||
| 468 | |||
| 469 | #define FRAME_X_LEFT_FRINGE_WIDTH(F) ((F)->output_data.mac->left_fringe_width) | ||
| 470 | #define FRAME_X_RIGHT_FRINGE_WIDTH(F) ((F)->output_data.mac->right_fringe_width) | ||
| 471 | |||
| 472 | |||
| 473 | /* Mac-specific scroll bar stuff. */ | ||
| 474 | |||
| 475 | /* We represent scroll bars as lisp vectors. This allows us to place | ||
| 476 | references to them in windows without worrying about whether we'll | ||
| 477 | end up with windows referring to dead scroll bars; the garbage | ||
| 478 | collector will free it when its time comes. | ||
| 479 | |||
| 480 | We use struct scroll_bar as a template for accessing fields of the | ||
| 481 | vector. */ | ||
| 482 | |||
| 483 | struct scroll_bar { | ||
| 484 | |||
| 485 | /* These fields are shared by all vectors. */ | ||
| 486 | EMACS_INT size_from_Lisp_Vector_struct; | ||
| 487 | struct Lisp_Vector *next_from_Lisp_Vector_struct; | ||
| 488 | |||
| 489 | /* The window we're a scroll bar for. */ | ||
| 490 | Lisp_Object window; | ||
| 491 | |||
| 492 | /* The next and previous in the chain of scroll bars in this frame. */ | ||
| 493 | Lisp_Object next, prev; | ||
| 494 | |||
| 495 | /* The Mac control handle of this scroll bar. Since this is a full | ||
| 496 | 32-bit quantity, we store it split into two 32-bit values. */ | ||
| 497 | Lisp_Object control_handle_low, control_handle_high; | ||
| 498 | |||
| 499 | /* The position and size of the scroll bar in pixels, relative to the | ||
| 500 | frame. */ | ||
| 501 | Lisp_Object top, left, width, height; | ||
| 502 | |||
| 503 | /* The starting and ending positions of the handle, relative to the | ||
| 504 | handle area (i.e. zero is the top position, not | ||
| 505 | SCROLL_BAR_TOP_BORDER). If they're equal, that means the handle | ||
| 506 | hasn't been drawn yet. | ||
| 507 | |||
| 508 | These are not actually the locations where the beginning and end | ||
| 509 | are drawn; in order to keep handles from becoming invisible when | ||
| 510 | editing large files, we establish a minimum height by always | ||
| 511 | drawing handle bottoms VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below | ||
| 512 | where they would be normally; the bottom and top are in a | ||
| 513 | different co-ordinate system. */ | ||
| 514 | Lisp_Object start, end; | ||
| 515 | |||
| 516 | /* If the scroll bar handle is currently being dragged by the user, | ||
| 517 | this is the number of pixels from the top of the handle to the | ||
| 518 | place where the user grabbed it. If the handle isn't currently | ||
| 519 | being dragged, this is Qnil. */ | ||
| 520 | Lisp_Object dragging; | ||
| 521 | }; | ||
| 522 | |||
| 523 | /* The number of elements a vector holding a struct scroll_bar needs. */ | ||
| 524 | #define SCROLL_BAR_VEC_SIZE \ | ||
| 525 | ((sizeof (struct scroll_bar) \ | ||
| 526 | - sizeof (EMACS_INT) - sizeof (struct Lisp_Vector *)) \ | ||
| 527 | / sizeof (Lisp_Object)) | ||
| 528 | |||
| 529 | /* Turning a lisp vector value into a pointer to a struct scroll_bar. */ | ||
| 530 | #define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec)) | ||
| 531 | |||
| 532 | |||
| 533 | /* Building a 32-bit C integer from two 16-bit lisp integers. */ | ||
| 534 | #define SCROLL_BAR_PACK(low, high) (XINT (high) << 16 | XINT (low)) | ||
| 535 | |||
| 536 | /* Setting two lisp integers to the low and high words of a 32-bit C int. */ | ||
| 537 | #define SCROLL_BAR_UNPACK(low, high, int32) \ | ||
| 538 | (XSETINT ((low), (int32) & 0xffff), \ | ||
| 539 | XSETINT ((high), ((int32) >> 16) & 0xffff)) | ||
| 540 | |||
| 541 | |||
| 542 | /* Extract the Mac control handle of the scroll bar from a struct scroll_bar. */ | ||
| 543 | #define SCROLL_BAR_CONTROL_HANDLE(ptr) \ | ||
| 544 | ((ControlHandle) SCROLL_BAR_PACK ((ptr)->control_handle_low, (ptr)->control_handle_high)) | ||
| 545 | |||
| 546 | /* Store a Mac control handle in a struct scroll_bar. */ | ||
| 547 | #define SET_SCROLL_BAR_CONTROL_HANDLE(ptr, id) \ | ||
| 548 | (SCROLL_BAR_UNPACK ((ptr)->control_handle_low, (ptr)->control_handle_high, (int) id)) | ||
| 549 | |||
| 550 | /* Return the inside width of a vertical scroll bar, given the outside | ||
| 551 | width. */ | ||
| 552 | #define VERTICAL_SCROLL_BAR_INSIDE_WIDTH(f,width) \ | ||
| 553 | ((width) \ | ||
| 554 | - VERTICAL_SCROLL_BAR_LEFT_BORDER \ | ||
| 555 | - VERTICAL_SCROLL_BAR_RIGHT_BORDER \ | ||
| 556 | - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2) | ||
| 557 | |||
| 558 | /* Return the length of the rectangle within which the top of the | ||
| 559 | handle must stay. This isn't equivalent to the inside height, | ||
| 560 | because the scroll bar handle has a minimum height. | ||
| 561 | |||
| 562 | This is the real range of motion for the scroll bar, so when we're | ||
| 563 | scaling buffer positions to scroll bar positions, we use this, not | ||
| 564 | VERTICAL_SCROLL_BAR_INSIDE_HEIGHT. */ | ||
| 565 | #define VERTICAL_SCROLL_BAR_TOP_RANGE(f,height) \ | ||
| 566 | (VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, height) - VERTICAL_SCROLL_BAR_MIN_HANDLE - UP_AND_DOWN_ARROWS) | ||
| 567 | |||
| 568 | /* Return the inside height of vertical scroll bar, given the outside | ||
| 569 | height. See VERTICAL_SCROLL_BAR_TOP_RANGE too. */ | ||
| 570 | #define VERTICAL_SCROLL_BAR_INSIDE_HEIGHT(f,height) \ | ||
| 571 | ((height) - VERTICAL_SCROLL_BAR_TOP_BORDER - VERTICAL_SCROLL_BAR_BOTTOM_BORDER) | ||
| 572 | |||
| 573 | |||
| 574 | /* Border widths for scroll bars. | ||
| 575 | |||
| 576 | Scroll bar windows don't have any borders; their border width is | ||
| 577 | set to zero, and we redraw borders ourselves. This makes the code | ||
| 578 | a bit cleaner, since we don't have to convert between outside width | ||
| 579 | (used when relating to the rest of the screen) and inside width | ||
| 580 | (used when sizing and drawing the scroll bar window itself). | ||
| 581 | |||
| 582 | The handle moves up and down/back and forth in a rectangle inset | ||
| 583 | from the edges of the scroll bar. These are widths by which we | ||
| 584 | inset the handle boundaries from the scroll bar edges. */ | ||
| 585 | #define VERTICAL_SCROLL_BAR_LEFT_BORDER (0) | ||
| 586 | #define VERTICAL_SCROLL_BAR_RIGHT_BORDER (0) | ||
| 587 | #define VERTICAL_SCROLL_BAR_TOP_BORDER (0) | ||
| 588 | #define VERTICAL_SCROLL_BAR_BOTTOM_BORDER (0) | ||
| 589 | |||
| 590 | /* Minimum lengths for scroll bar handles, in pixels. */ | ||
| 591 | #define VERTICAL_SCROLL_BAR_MIN_HANDLE (16) | ||
| 592 | |||
| 593 | /* Combined length of up and down arrow boxes in scroll bars, in pixels. */ | ||
| 594 | #define UP_AND_DOWN_ARROWS (32) | ||
| 595 | |||
| 596 | /* Trimming off a few pixels from each side prevents | ||
| 597 | text from glomming up against the scroll bar */ | ||
| 598 | #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0) | ||
| 599 | |||
| 600 | |||
| 601 | /* Manipulating pixel sizes and character sizes. | ||
| 602 | Knowledge of which factors affect the overall size of the window should | ||
| 603 | be hidden in these macros, if that's possible. | ||
| 604 | |||
| 605 | Return the upper/left pixel position of the character cell on frame F | ||
| 606 | at ROW/COL. */ | ||
| 607 | #define CHAR_TO_PIXEL_ROW(f, row) \ | ||
| 608 | ((f)->output_data.mac->internal_border_width \ | ||
| 609 | + (row) * (f)->output_data.mac->line_height) | ||
| 610 | #define CHAR_TO_PIXEL_COL(f, col) \ | ||
| 611 | ((f)->output_data.mac->internal_border_width \ | ||
| 612 | + (col) * FONT_WIDTH ((f)->output_data.mac->font)) | ||
| 613 | |||
| 614 | /* Return the pixel width/height of frame F if it has | ||
| 615 | WIDTH columns/HEIGHT rows. */ | ||
| 616 | #define CHAR_TO_PIXEL_WIDTH(f, width) \ | ||
| 617 | (CHAR_TO_PIXEL_COL (f, width) \ | ||
| 618 | + (f)->output_data.mac->vertical_scroll_bar_extra \ | ||
| 619 | + (f)->output_data.mac->fringes_extra \ | ||
| 620 | + (f)->output_data.mac->internal_border_width) | ||
| 621 | #define CHAR_TO_PIXEL_HEIGHT(f, height) \ | ||
| 622 | (CHAR_TO_PIXEL_ROW (f, height) \ | ||
| 623 | + (f)->output_data.mac->internal_border_width) | ||
| 624 | |||
| 625 | |||
| 626 | /* Return the row/column (zero-based) of the character cell containing | ||
| 627 | the pixel on FRAME at ROW/COL. */ | ||
| 628 | #define PIXEL_TO_CHAR_ROW(f, row) \ | ||
| 629 | (((row) - (f)->output_data.mac->internal_border_width) \ | ||
| 630 | / (f)->output_data.mac->line_height) | ||
| 631 | #define PIXEL_TO_CHAR_COL(f, col) \ | ||
| 632 | (((col) - (f)->output_data.mac->internal_border_width) \ | ||
| 633 | / FONT_WIDTH ((f)->output_data.mac->font)) | ||
| 634 | |||
| 635 | /* How many columns/rows of text can we fit in WIDTH/HEIGHT pixels on | ||
| 636 | frame F? */ | ||
| 637 | #define PIXEL_TO_CHAR_WIDTH(f, width) \ | ||
| 638 | (PIXEL_TO_CHAR_COL (f, ((width) \ | ||
| 639 | - (f)->output_data.mac->internal_border_width \ | ||
| 640 | - (f)->output_data.mac->fringes_extra \ | ||
| 641 | - (f)->output_data.mac->vertical_scroll_bar_extra))) | ||
| 642 | #define PIXEL_TO_CHAR_HEIGHT(f, height) \ | ||
| 643 | (PIXEL_TO_CHAR_ROW (f, ((height) \ | ||
| 644 | - (f)->output_data.mac->internal_border_width))) | ||
| 645 | |||
| 646 | struct frame * check_x_frame (Lisp_Object); | ||
| 647 | |||
| 648 | /* Dummy entry for defining tty_display in frame.c. */ | ||
| 649 | struct x_output | ||
| 650 | { | ||
| 651 | char _dummy; | ||
| 652 | }; | ||
diff --git a/mac/inc/pwd.h b/mac/inc/pwd.h index 8e6a5dece34..dedc8091c45 100644 --- a/mac/inc/pwd.h +++ b/mac/inc/pwd.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | #ifndef _PWD_H | 23 | #ifndef _PWD_H |
| 24 | #define _PWD_H | 24 | #define _PWD_H |
diff --git a/mac/inc/s-mac.h b/mac/inc/s-mac.h index 3780664f74e..35143ddf267 100644 --- a/mac/inc/s-mac.h +++ b/mac/inc/s-mac.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | /* | 23 | /* |
| 24 | * Define symbols to identify the version of Unix this is. | 24 | * Define symbols to identify the version of Unix this is. |
diff --git a/mac/inc/sys/file.h b/mac/inc/sys/file.h index c37d7006d48..b33f8aaa9cc 100644 --- a/mac/inc/sys/file.h +++ b/mac/inc/sys/file.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | #ifndef _SYS_FILE_H | 23 | #ifndef _SYS_FILE_H |
| 24 | #define _SYS_FILE_H | 24 | #define _SYS_FILE_H |
diff --git a/mac/inc/sys/ioctl.h b/mac/inc/sys/ioctl.h index 116e7bf5b06..ae1a76b7a0f 100644 --- a/mac/inc/sys/ioctl.h +++ b/mac/inc/sys/ioctl.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | #ifndef _SYS_IOCTL_H | 23 | #ifndef _SYS_IOCTL_H |
| 24 | #define _SYS_IOCTL_H | 24 | #define _SYS_IOCTL_H |
diff --git a/mac/inc/sys/param.h b/mac/inc/sys/param.h index 7a39b149366..247f3971a4c 100644 --- a/mac/inc/sys/param.h +++ b/mac/inc/sys/param.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | #ifndef _SYS_PARAM_H | 23 | #ifndef _SYS_PARAM_H |
| 24 | #define _SYS_PARAM_H | 24 | #define _SYS_PARAM_H |
diff --git a/mac/inc/sys/stat.h b/mac/inc/sys/stat.h index fe3dc5df669..0f9ee79dab1 100644 --- a/mac/inc/sys/stat.h +++ b/mac/inc/sys/stat.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | #ifndef _SYS_STAT_H | 23 | #ifndef _SYS_STAT_H |
| 24 | #define _SYS_STAT_H | 24 | #define _SYS_STAT_H |
| @@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 26 | #ifdef __MWERKS__ | 26 | #ifdef __MWERKS__ |
| 27 | #include <stat.mac.h> | 27 | #include <stat.mac.h> |
| 28 | 28 | ||
| 29 | #ifdef CODEWARRIOR_VERSION_6 | 29 | #if __MSL__ >= 0x6000 |
| 30 | #define fstat _fstat | 30 | #define fstat _fstat |
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
diff --git a/mac/inc/sys/time.h b/mac/inc/sys/time.h index 5c55c09b5cd..b9936e92075 100644 --- a/mac/inc/sys/time.h +++ b/mac/inc/sys/time.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | #ifndef _SYS_TIME_H | 23 | #ifndef _SYS_TIME_H |
| 24 | #define _SYS_TIME_H | 24 | #define _SYS_TIME_H |
diff --git a/mac/inc/sys/types.h b/mac/inc/sys/types.h index 71eb976f3b2..9f358b2a4e8 100644 --- a/mac/inc/sys/types.h +++ b/mac/inc/sys/types.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | #ifndef _SYS_TYPES_H | 23 | #ifndef _SYS_TYPES_H |
| 24 | #define _SYS_TYPES_H | 24 | #define _SYS_TYPES_H |
diff --git a/mac/inc/termio.h b/mac/inc/termio.h index 3f194e59af4..7d423630c93 100644 --- a/mac/inc/termio.h +++ b/mac/inc/termio.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | #ifndef _SYS_TERMIO_H | 23 | #ifndef _SYS_TERMIO_H |
| 24 | #define _SYS_TERMIO_H | 24 | #define _SYS_TERMIO_H |
diff --git a/mac/inc/utime.h b/mac/inc/utime.h index 8cb65ec5f80..1a7f9253296 100644 --- a/mac/inc/utime.h +++ b/mac/inc/utime.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | #ifndef _UTIME_H_ | 23 | #ifndef _UTIME_H_ |
| 24 | #define _UTIME_H_ | 24 | #define _UTIME_H_ |
diff --git a/mac/inc/utsname.h b/mac/inc/utsname.h index fec32be7421..0469fcf9eab 100644 --- a/mac/inc/utsname.h +++ b/mac/inc/utsname.h | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to | |||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ | 19 | Boston, MA 02111-1307, USA. */ |
| 20 | 20 | ||
| 21 | /* Contributed by Andrew Choi (akochoi@users.sourceforge.net). */ | 21 | /* Contributed by Andrew Choi (akochoi@mac.com). */ |
| 22 | 22 | ||
| 23 | #ifndef _UTSNAME_H | 23 | #ifndef _UTSNAME_H |
| 24 | #define _UTSNAME_H | 24 | #define _UTSNAME_H |